@deslop/auth 0.1.1248 → 0.1.1250

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ import{n as e}from"./rolldown-runtime-WkwZ5CU-.js";import{a as t,n,o as r}from"./react-COyt-gOi.js";import{C as i,D as a,E as o,H as s,L as c,N as l,O as u,T as d,_ as f,at as p,b as m,ct as h,g,h as _,t as v,x as y,z as b}from"./components-DxFAwEtI.js";import{$a as x,Aa as S,B as C,Ea as w,La as T,Ta as E,ca as D,no as O}from"./effect-Cym5PIVz.js";import{Cn as k,D as A,En as j,In as M,O as N,Pr as P,W as F,_ as I,a as L,at as R,it as ee,kn as te,nn as z,r as ne,st as re,tn as B,un as V,vn as ie,wn as H,xn as ae,xt as oe}from"./utils-CQ8HfW2q.js";import{a as U,c as W,i as G,n as K,r as se,s as ce,t as le}from"./dialog-DKm49liV.js";var q=e(r(),1),J=t();function ue(e){let[t,n]=q.useState({getBoundingClientRect(){return DOMRect.fromRect({width:0,height:0,x:0,y:0})}}),r=q.useRef(null),i=q.useRef(null),o=q.useRef(null),s=q.useRef(null),c=q.useRef(!0),l=q.useRef(null),u=re(),f=q.useMemo(()=>({anchor:t,setAnchor:n,actionsRef:o,backdropRef:r,internalBackdropRef:i,positionerRef:s,allowMouseUpTriggerRef:c,initialCursorPointRef:l,rootId:u}),[t,u]);return(0,J.jsx)(d.Provider,{value:f,children:(0,J.jsx)(a.Provider,{value:void 0,children:(0,J.jsx)(g,{...e})})})}var Y=500,de=q.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,{setAnchor:s,actionsRef:c,internalBackdropRef:l,backdropRef:d,positionerRef:f,allowMouseUpTriggerRef:m,initialCursorPointRef:g,rootId:v}=o(!1),{store:y}=u(!1),b=y.useState(`open`),x=y.useState(`disabled`),S=q.useRef(null),C=q.useRef(null),w=V(),T=V(),E=q.useRef(!1),D=q.useRef(null);function O(e,t,n){let r=n.type.startsWith(`touch`);g.current={x:e,y:t},s({getBoundingClientRect(){return DOMRect.fromRect({width:r?10:0,height:r?10:0,x:e,y:t})}}),E.current=!1,c.current?.setOpen(!0,R(ee,n)),T.start(Y,()=>{E.current=!0})}function k(e){if(x)return;m.current=!0,p(e),O(e.clientX,e.clientY,e.nativeEvent);let t=M(S.current);D.current?.abort();let n=new AbortController;D.current=n,t.addEventListener(`mouseup`,e=>{if(m.current=!1,!E.current)return;T.clear(),E.current=!1;let t=z(e);B(f.current,t)||v&&t&&_(t)===v||c.current?.setOpen(!1,R(F,e))},{once:!0,signal:n.signal})}function A(){w.clear(),C.current=null}function j(e){if(x||(m.current=!1,e.touches.length!==1)){A();return}e.stopPropagation();let t=e.touches[0],n={x:t.clientX,y:t.clientY};C.current=n,w.start(Y,()=>{O(n.x,n.y,e.nativeEvent)})}function N(e){if(e.touches.length!==1)A();else if(w.isStarted()&&C.current){let t=e.touches[0],n=Math.abs(t.clientX-C.current.x),r=Math.abs(t.clientY-C.current.y);(n>10||r>10)&&A()}}return q.useEffect(()=>()=>{D.current?.abort()},[]),q.useEffect(()=>{function e(e){if(x)return;let t=z(e);(B(S.current,t)||B(l.current,t)||B(d.current,t))&&e.preventDefault()}let t=M(S.current);return oe(t,`contextmenu`,e)},[d,x,l]),te(`div`,e,{state:{open:b},ref:[S,t],props:[{onContextMenu:k,onTouchStart:j,onTouchMove:N,onTouchEnd:A,onTouchCancel:A,style:{WebkitTouchCallout:`none`}},a],stateAttributesMapping:h})}),fe=f,X=n();function pe(e){let t=(0,X.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,J.jsx)(ue,{"data-slot":`context-menu`,...n}),t[2]=n,t[3]=r),r}function me(e){let t=(0,X.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=j(`select-none`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,J.jsx)(de,{"data-slot":`context-menu-trigger`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function he(e){let t=(0,X.c)(18),n,r,i,a,o,s;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6]):({className:n,align:i,alignOffset:a,side:o,sideOffset:s,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s);let c=i===void 0?`start`:i,l=a===void 0?4:a,u=o===void 0?`right`:o,d=s===void 0?0:s,f;t[7]===n?f=t[8]:(f=j(`z-50 max-h-(--available-height) min-w-32 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 outline-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,n),t[7]=n,t[8]=f);let p;t[9]!==r||t[10]!==f?(p=(0,J.jsx)(y,{"data-slot":`context-menu-content`,className:f,...r}),t[9]=r,t[10]=f,t[11]=p):p=t[11];let h;return t[12]!==c||t[13]!==l||t[14]!==u||t[15]!==d||t[16]!==p?(h=(0,J.jsx)(m,{children:(0,J.jsx)(fe,{className:`isolate z-50 outline-none`,align:c,alignOffset:l,side:u,sideOffset:d,children:p})}),t[12]=c,t[13]=l,t[14]=u,t[15]=d,t[16]=p,t[17]=h):h=t[17],h}function ge(e){let t=(0,X.c)(12),n,r,a,o;t[0]===e?(n=t[1],r=t[2],a=t[3],o=t[4]):({className:n,inset:r,variant:o,...a}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=a,t[4]=o);let s=o===void 0?`default`:o,c;t[5]===n?c=t[6]:(c=j(`group/context-menu-item relative flex min-h-7 cursor-default items-center gap-2 rounded-md px-2 py-1 text-xs/relaxed outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7.5 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-3.5 data-[variant=destructive]:*:[svg]:text-destructive`,n),t[5]=n,t[6]=c);let l;return t[7]!==r||t[8]!==a||t[9]!==c||t[10]!==s?(l=(0,J.jsx)(i,{"data-slot":`context-menu-item`,"data-inset":r,"data-variant":s,className:c,...a}),t[7]=r,t[8]=a,t[9]=c,t[10]=s,t[11]=l):l=t[11],l}function Z(e){let t=(0,X.c)(11),n;t[0]!==e.person.id||t[1]!==e.person.name?(n=(0,J.jsx)(v,{id:e.person.id,name:e.person.name}),t[0]=e.person.id,t[1]=e.person.name,t[2]=n):n=t[2];let r=e.person.fullName??e.person.name,i;t[3]===r?i=t[4]:(i=(0,J.jsx)(`span`,{className:`min-w-0 truncate font-medium`,children:r}),t[3]=r,t[4]=i);let a=e.person.fullName!==void 0&&`@${e.person.name}`,o;t[5]===a?o=t[6]:(o=(0,J.jsx)(`span`,{className:`text-muted-foreground min-w-0 flex-1 truncate font-mono text-xs`,children:a}),t[5]=a,t[6]=o);let s;return t[7]!==n||t[8]!==i||t[9]!==o?(s=(0,J.jsxs)(J.Fragment,{children:[n,i,o]}),t[7]=n,t[8]=i,t[9]=o,t[10]=s):s=t[10],s}function Q(e){let t=(0,X.c)(9),n=`person-${e.person.id}`,r;t[0]===e.person?r=t[1]:(r=(0,J.jsx)(Z,{person:e.person}),t[0]=e.person,t[1]=r);let i;t[2]!==e.children||t[3]!==r?(i=(0,J.jsxs)(`div`,{className:`flex h-8 min-w-0 items-center gap-3 px-1 text-sm max-sm:h-11`,children:[r,e.children]}),t[2]=e.children,t[3]=r,t[4]=i):i=t[4];let a;return t[5]!==e.failure||t[6]!==n||t[7]!==i?(a=(0,J.jsxs)(`div`,{role:`listitem`,id:n,className:`border-b`,children:[i,e.failure]}),t[5]=e.failure,t[6]=n,t[7]=i,t[8]=a):a=t[8],a}function $(e){let t=(0,X.c)(28),n;t[0]===e.person.id?n=t[1]:(n=L(e.person.id),t[0]=e.person.id,t[1]=n);let[r,i]=b(n),a=e.person,o;t[2]===r?o=t[3]:(o=(0,J.jsx)(l,{result:r,className:`mr-1 mb-2 ml-10 wrap-anywhere`}),t[2]=r,t[3]=o);let s;t[4]===e.person.since?s=t[5]:(s=I(e.person.since),t[4]=e.person.since,t[5]=s);let c;t[6]===s?c=t[7]:(c=(0,J.jsx)(`span`,{className:`text-muted-foreground shrink-0 font-mono text-xs max-sm:hidden`,children:s}),t[6]=s,t[7]=c);let u;t[8]===r?u=t[9]:(u=C(r),t[8]=r,t[9]=u);let d;t[10]===i?d=t[11]:(d=()=>i(!0),t[10]=i,t[11]=d);let f;t[12]!==u||t[13]!==d?(f=(0,J.jsx)(H,{size:`sm`,className:`shrink-0 max-sm:h-11`,disabled:u,onClick:d,children:`Allow`}),t[12]=u,t[13]=d,t[14]=f):f=t[14];let p;t[15]===r?p=t[16]:(p=C(r),t[15]=r,t[16]=p);let m;t[17]===i?m=t[18]:(m=()=>i(!1),t[17]=i,t[18]=m);let h;t[19]!==p||t[20]!==m?(h=(0,J.jsx)(H,{size:`sm`,variant:`outline`,className:`shrink-0 max-sm:h-11`,disabled:p,onClick:m,children:`Decline`}),t[19]=p,t[20]=m,t[21]=h):h=t[21];let g;return t[22]!==e.person||t[23]!==h||t[24]!==o||t[25]!==c||t[26]!==f?(g=(0,J.jsxs)(Q,{person:a,failure:o,children:[c,f,h]}),t[22]=e.person,t[23]=h,t[24]=o,t[25]=c,t[26]=f,t[27]=g):g=t[27],g}function _e(e){let t=(0,X.c)(60),n;t[0]===e.person.id?n=t[1]:(n=N(e.person.id),t[0]=e.person.id,t[1]=n);let[r,i]=b(n),[a,o]=(0,q.useState)(!1);if(e.person.role===`Admin`){let n;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,J.jsx)(W,{variant:`outline`,className:`shrink-0`,children:`admin`}),t[2]=n):n=t[2];let r;return t[3]===e.person?r=t[4]:(r=(0,J.jsx)(Q,{person:e.person,children:n}),t[3]=e.person,t[4]=r),r}let s=e.person.fullName??e.person.name,c=`person-${e.person.id}`,u;t[5]===e.person.since?u=t[6]:(u=I(e.person.since),t[5]=e.person.since,t[6]=u);let d=`${s}, member since ${u}`,f;t[7]===d?f=t[8]:(f=(0,J.jsx)(`div`,{role:`button`,tabIndex:0,"aria-haspopup":`menu`,"aria-label":d,className:`hover:bg-muted/50 flex h-8 min-w-0 items-center gap-3 px-1 text-sm max-sm:h-11`}),t[7]=d,t[8]=f);let p;t[9]===e.person?p=t[10]:(p=(0,J.jsx)(Z,{person:e.person}),t[9]=e.person,t[10]=p);let m;t[11]===e.person.since?m=t[12]:(m=I(e.person.since),t[11]=e.person.since,t[12]=m);let h;t[13]===m?h=t[14]:(h=(0,J.jsx)(`span`,{className:`text-muted-foreground shrink-0 font-mono text-xs`,children:m}),t[13]=m,t[14]=h);let g;t[15]!==f||t[16]!==p||t[17]!==h?(g=(0,J.jsxs)(me,{render:f,children:[p,h]}),t[15]=f,t[16]=p,t[17]=h,t[18]=g):g=t[18];let _;t[19]===r?_=t[20]:(_=(0,J.jsx)(l,{result:r,className:`mr-1 mb-2 ml-10 wrap-anywhere`}),t[19]=r,t[20]=_);let v;t[21]!==c||t[22]!==g||t[23]!==_?(v=(0,J.jsxs)(`div`,{role:`listitem`,id:c,className:`border-b`,children:[g,_]}),t[21]=c,t[22]=g,t[23]=_,t[24]=v):v=t[24];let y;t[25]===r?y=t[26]:(y=C(r),t[25]=r,t[26]=y);let x;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(x=()=>o(!0),t[27]=x):x=t[27];let S;t[28]===y?S=t[29]:(S=(0,J.jsx)(he,{className:`w-auto min-w-36`,children:(0,J.jsx)(ge,{variant:`destructive`,className:`max-sm:h-11`,disabled:y,onClick:x,children:`Remove`})}),t[28]=y,t[29]=S);let w;t[30]===s?w=t[31]:(w=(0,J.jsxs)(ce,{children:[`Remove `,s,`?`]}),t[30]=s,t[31]=w);let T;t[32]===Symbol.for(`react.memo_cache_sentinel`)?(T=(0,J.jsx)(G,{children:`They will no longer be able to sign in to any Deslop app, and their sign-ins end.`}),t[32]=T):T=t[32];let E;t[33]===r?E=t[34]:(E=(0,J.jsx)(l,{result:r}),t[33]=r,t[34]=E);let D;t[35]===r?D=t[36]:(D=C(r),t[35]=r,t[36]=D);let O;t[37]===D?O=t[38]:(O=(0,J.jsx)(K,{render:(0,J.jsx)(H,{variant:`ghost`,disabled:D}),children:`Cancel`}),t[37]=D,t[38]=O);let k;t[39]===r?k=t[40]:(k=C(r),t[39]=r,t[40]=k);let A;t[41]===i?A=t[42]:(A=()=>i(),t[41]=i,t[42]=A);let j;t[43]!==k||t[44]!==A?(j=(0,J.jsx)(H,{variant:`destructive`,disabled:k,onClick:A,children:`Remove`}),t[43]=k,t[44]=A,t[45]=j):j=t[45];let M;t[46]!==O||t[47]!==j?(M=(0,J.jsxs)(U,{children:[O,j]}),t[46]=O,t[47]=j,t[48]=M):M=t[48];let P;t[49]!==w||t[50]!==E||t[51]!==M?(P=(0,J.jsxs)(se,{children:[w,T,E,M]}),t[49]=w,t[50]=E,t[51]=M,t[52]=P):P=t[52];let F;t[53]!==a||t[54]!==P?(F=(0,J.jsx)(le,{open:a,onOpenChange:o,children:P}),t[53]=a,t[54]=P,t[55]=F):F=t[55];let L;return t[56]!==v||t[57]!==S||t[58]!==F?(L=(0,J.jsxs)(pe,{children:[v,S,F]}),t[56]=v,t[57]=S,t[58]=F,t[59]=L):L=t[59],L}function ve(){return w(S(s(A).value,O(x,Se)),{onEmpty:xe,onNonEmpty:ye})}function ye(e){return(0,J.jsx)(`div`,{role:`list`,"aria-label":`People`,children:E(e,be)})}function be(e){return D(e.role===`Waiting`,{onFalse:()=>(0,J.jsx)(_e,{person:e},e.id),onTrue:()=>(0,J.jsx)($,{person:e},e.id)})}function xe(){return(0,J.jsx)(ie,{children:(0,J.jsx)(ae,{children:(0,J.jsx)(k,{children:`No one yet`})})})}function Se(e){return e.role!==`Waiting`}function Ce(){let e=(0,X.c)(2);if(!T(s(ne).value,we)){let t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,J.jsx)(P,{to:`/`}),e[0]=t):t=e[0],t}let t;return e[1]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,J.jsx)(q.Suspense,{fallback:(0,J.jsx)(c,{label:`People`,media:!0,rows:3}),children:(0,J.jsx)(ve,{})}),e[1]=t):t=e[1],t}function we(e){return e.role===`Admin`}export{Ce as component};