@deslop/auth 0.1.1246 → 0.1.1249

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{$t as i,At as a,C as o,I as s,Jt as c,Xt as l,Zt as u,bt as d,c as f,cn as p,f as m,i as h,in as g,j as _,jn as v,jt as y,ln as b,un as x,ut as S,xt as C}from"./toast-BKQ798Jo.js";import{$ as w,Bt as T,Ft as E,Gt as D,Ht as O,It as k,J as A,Jt as j,Kt as M,Lt as N,Pt as P,Rt as F,Ut as I,Vt as ee,Wt as te,Yt as ne,Z as L,en as R,q as z,tn as B}from"./components-BY_sC06M.js";function V(e){return i(e.defaultTagName??`div`,e,e)}var H=n(),U=u(`group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-full border border-transparent px-2 py-0.5 text-[0.625rem] font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-2.5!`,{variants:{variant:{default:`bg-primary text-primary-foreground [a]:hover:bg-primary/80`,secondary:`bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80`,destructive:`bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20`,outline:`border-border bg-input/20 text-foreground dark:bg-input/30 [a]:hover:bg-muted [a]:hover:text-muted-foreground`,ghost:`hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50`,link:`text-primary underline-offset-4 hover:underline`}},defaultVariants:{variant:`default`}});function W(e){let t=(0,H.c)(13),n,r,i,a,o;if(t[0]!==e){let{className:s,variant:c,render:u,...d}=e;n=u,o=c===void 0?`default`:c,a=V,r=`span`,i=b({className:l(U({variant:o}),s)},d),t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o}else n=t[1],r=t[2],i=t[3],a=t[4],o=t[5];let s;t[6]===o?s=t[7]:(s={slot:`badge`,variant:o},t[6]=o,t[7]=s);let c;return t[8]!==n||t[9]!==r||t[10]!==i||t[11]!==s?(c={defaultTagName:r,props:i,render:n,state:s},t[8]=n,t[9]=r,t[10]=i,t[11]=s,t[12]=c):c=t[12],a(c)}var G=e(r(),1),K=G.createContext(void 0);function q(e){let t=G.useContext(K);if(!e&&t===void 0)throw Error(p(27));return t}var J=G.forwardRef(function(e,t){let{render:n,className:r,style:a,forceRender:o=!1,...s}=e,c=q(),l=c.useState(`open`),u=c.useState(`nested`),d=c.useState(`mounted`),f={open:l,transitionStatus:c.useState(`transitionStatus`)};return i(`div`,e,{state:f,ref:[c.context.backdropRef,t],stateAttributesMapping:B,props:[{role:`presentation`,hidden:!d,style:{userSelect:`none`,WebkitUserSelect:`none`}},s],enabled:o||!u})}),Y=G.forwardRef(function(e,t){let{render:n,className:r,style:a,disabled:s=!1,nativeButton:c=!0,...l}=e,u=q(),d=u.useState(`open`),{getButtonProps:p,buttonRef:m}=g({disabled:s,native:c}),h={disabled:s};function _(e){d&&u.setOpen(!1,o(f,e.nativeEvent))}return i(`button`,e,{state:h,ref:[t,m],props:[{onClick:_},l,p]})}),X=G.forwardRef(function(e,t){let{render:n,className:r,style:a,id:o,...s}=e,c=q(),l=w(o);return c.useSyncedValueWithCleanup(`descriptionElementId`,l),i(`p`,e,{ref:t,props:[{id:l},s]})}),Z=G.createContext(void 0);function re(){let e=G.useContext(Z);if(e===void 0)throw Error(p(26));return e}var ie=`--nested-dialogs`,ae=`data-nested-dialog-open`,oe={...R,...S,nestedDialogOpen(e){return e?{[ae]:``}:null}},Q=t(),se=G.forwardRef(function(e,t){let{render:n,className:r,style:a,finalFocus:o,initialFocus:s,...c}=e,l=q(),u=l.useState(`descriptionElementId`),d=l.useState(`disablePointerDismissal`),f=l.useState(`floatingRootContext`),p=l.useState(`popupProps`),m=l.useState(`modal`),h=l.useState(`mounted`),g=l.useState(`nested`),v=l.useState(`nestedOpenDialogCount`),y=l.useState(`open`),b=l.useState(`openMethod`),x=l.useState(`titleElementId`),S=l.useState(`transitionStatus`),C=l.useState(`role`),w=f.useState(`floatingId`);re(),_({open:y,ref:l.context.popupRef,onComplete(){y&&l.context.onOpenChangeComplete?.(!0)}});let E=s===void 0?T(l.context.popupRef):s,D=v>0,O=l.useStateSetter(`popupElement`),k=i(`div`,e,{state:{open:y,nested:g,transitionStatus:S,nestedDialogOpen:D},props:[p,{id:w,"aria-labelledby":x,"aria-describedby":u,role:C,...N,hidden:!h,onKeyDown(e){L.has(e.key)&&e.stopPropagation()},style:{[ie]:v}},c],ref:[t,l.context.popupRef,O],stateAttributesMapping:oe});return(0,Q.jsx)(ne,{context:f,openInteractionType:b,disabled:!h,closeOnFocusOut:!d,initialFocus:E,returnFocus:o,modal:m!==!1,restoreFocus:`popup`,children:k})}),ce=G.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,i=q(),a=i.useState(`mounted`),o=i.useState(`modal`),c=i.useState(`open`);return a||n?(0,Q.jsx)(Z.Provider,{value:n,children:(0,Q.jsxs)(h,{ref:t,...r,children:[a&&o===!0&&(0,Q.jsx)(A,{ref:i.context.internalBackdropRef,inert:s(!c)}),e.children]})}):null});function le({store:e,parentContext:t,isDrawer:n}){let r=e.useState(`open`),i=e.useState(`mounted`),a=e.useState(`disablePointerDismissal`),o=e.useState(`modal`),s=e.useState(`popupElement`),c=e.useState(`floatingRootContext`),[l,u]=G.useState(0),[f,p]=G.useState(0),m=l===0,h=j(c,{outsidePressEvent(){return e.context.internalBackdropRef.current||e.context.backdropRef.current?`intentional`:{mouse:o===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}},outsidePress(t){if(!e.context.outsidePressEnabledRef.current||`button`in t&&t.button!==0)return!1;if(`touches`in t){if(t.type===`touchend`){if(t.changedTouches.length!==1||t.touches.length!==0)return!1}else if(t.touches.length!==1)return!1}let n=C(t);if(m&&!a){if(o){let t=e.context.internalBackdropRef.current,r=e.context.backdropRef.current;return t||r?t===n||r===n||d(n,s)&&!n?.hasAttribute(`data-base-ui-portal`):!0}return!0}return!1},escapeKey:m});return z(r&&o===!0,s),e.useContextCallback(`onNestedDialogOpen`,(t,n)=>{(e.select(`open`)||e.select(`mounted`))&&(u(t),p(n))}),x(()=>{!r&&!i&&(u(0),p(0))},[r,i]),x(()=>(t?.onNestedDialogOpen&&r&&t.onNestedDialogOpen(l+1,f+ +!!n),()=>{t?.onNestedDialogOpen&&r&&t.onNestedDialogOpen(0,0)}),[n,r,l,f,t]),te(e,{activeTriggerProps:h.reference,inactiveTriggerProps:h.trigger,popupProps:h.floating,nestedOpenDialogCount:l,nestedOpenDrawerCount:f}),null}var ue={...E,modal:e=>e.modal,nested:e=>e.nested,nestedOpenDialogCount:e=>e.nestedOpenDialogCount,nestedOpenDrawerCount:e=>e.nestedOpenDrawerCount,disablePointerDismissal:e=>e.disablePointerDismissal,openMethod:e=>e.openMethod,descriptionElementId:e=>e.descriptionElementId,titleElementId:e=>e.titleElementId,viewportElement:e=>e.viewportElement,role:e=>e.role},de=class extends a{constructor(e,t,n){let r=new k,i=fe(e,r,t,n);super(i,pe(r),ue)}setOpen=(e,t)=>{t.preventUnmountOnClose=()=>{this.set(`preventUnmountingOnClose`,!0)},!e&&t.trigger==null&&this.state.activeTriggerId!=null&&(t.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(e,t),t.isCanceled||(this.state.floatingRootContext.dispatchOpenChange(e,t),this.update(ee(this.state,e,t.trigger)))}};function fe(e,t,n,r=!1){return{...P(t,n,r),modal:!0,disablePointerDismissal:!1,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:`dialog`,...e}}function pe(e){return{popupRef:G.createRef(),backdropRef:G.createRef(),internalBackdropRef:G.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:e,onOpenChange:void 0,onOpenChangeComplete:void 0}}function $(e,t){let{children:n,open:r,defaultOpen:i=!1,onOpenChange:a,onOpenChangeComplete:s,disablePointerDismissal:c=!1,modal:l=!0,actionsRef:u,handle:d,triggerId:f,defaultTriggerId:p=null}=t,h=e===`drawer`,g=e===`alert-dialog`,_=g?!0:l,v=g||c,y=g?`alertdialog`:`dialog`,b=q(!0),x={modal:_,disablePointerDismissal:v,nested:b!=null,role:y},S=D((e,t)=>new de({open:i,openProp:r,activeTriggerId:p,triggerIdProp:f,...x},e,t),!0);S.useControlledProp(`openProp`,r),S.useControlledProp(`triggerIdProp`,f),S.useSyncedValues(x),S.useContextCallback(`onOpenChange`,a),S.useContextCallback(`onOpenChangeComplete`,s);let C=S.useState(`open`),w=S.useState(`mounted`),T=S.useState(`payload`);M(S,C),O(S);let{forceUnmount:E}=I(C,S);G.useImperativeHandle(u,()=>({unmount:E,close:()=>S.setOpen(!1,o(m))}),[E,S]);let k=C||w||d!=null;return(0,Q.jsxs)(K.Provider,{value:S,children:[d&&(0,Q.jsx)(F,{handle:d,store:S}),k&&(0,Q.jsx)(le,{store:S,parentContext:b?.context,isDrawer:h}),typeof n==`function`?n({payload:T}):n]})}var me=y(function(e){return $(`dialog`,e)}),he=G.forwardRef(function(e,t){let{render:n,className:r,style:a,id:o,...s}=e,c=q(),l=w(o);return c.useSyncedValueWithCleanup(`titleElementId`,l),i(`h2`,e,{ref:t,props:[{id:l},s]})});function ge(e){let t=(0,H.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,Q.jsx)(me,{"data-slot":`dialog`,...n}),t[2]=n,t[3]=r),r}function _e(e){let t=(0,H.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,Q.jsx)(ce,{"data-slot":`dialog-portal`,...n}),t[2]=n,t[3]=r),r}function ve(e){let t=(0,H.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,Q.jsx)(Y,{"data-slot":`dialog-close`,...n}),t[2]=n,t[3]=r),r}function ye(e){let t=(0,H.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=l(`fixed inset-0 isolate z-50 bg-black/80 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Q.jsx)(J,{"data-slot":`dialog-overlay`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function be(e){let t=(0,H.c)(15),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:r,children:n,showCloseButton:a,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o=a===void 0||a,s;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,Q.jsx)(ye,{}),t[5]=s):s=t[5];let u;t[6]===r?u=t[7]:(u=l(`fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl bg-popover p-4 text-xs/relaxed text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none sm:max-w-sm 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`,r),t[6]=r,t[7]=u);let d;t[8]===o?d=t[9]:(d=o&&(0,Q.jsxs)(Y,{"data-slot":`dialog-close`,render:(0,Q.jsx)(c,{variant:`ghost`,className:`absolute top-2 right-2`,size:`icon-sm`}),children:[(0,Q.jsx)(v,{}),(0,Q.jsx)(`span`,{className:`sr-only`,children:`Close`})]}),t[8]=o,t[9]=d);let f;return t[10]!==n||t[11]!==i||t[12]!==u||t[13]!==d?(f=(0,Q.jsxs)(_e,{children:[s,(0,Q.jsxs)(se,{"data-slot":`dialog-content`,className:u,...i,children:[n,d]})]}),t[10]=n,t[11]=i,t[12]=u,t[13]=d,t[14]=f):f=t[14],f}function xe(e){let t=(0,H.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=l(`flex flex-col gap-1`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Q.jsx)(`div`,{"data-slot":`dialog-header`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Se(e){let t=(0,H.c)(14),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:r,showCloseButton:a,children:n,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o=a!==void 0&&a,s;t[5]===r?s=t[6]:(s=l(`flex flex-col-reverse gap-2 sm:flex-row sm:justify-end`,r),t[5]=r,t[6]=s);let u;t[7]===o?u=t[8]:(u=o&&(0,Q.jsx)(Y,{render:(0,Q.jsx)(c,{variant:`outline`}),children:`Close`}),t[7]=o,t[8]=u);let d;return t[9]!==n||t[10]!==i||t[11]!==s||t[12]!==u?(d=(0,Q.jsxs)(`div`,{"data-slot":`dialog-footer`,className:s,...i,children:[n,u]}),t[9]=n,t[10]=i,t[11]=s,t[12]=u,t[13]=d):d=t[13],d}function Ce(e){let t=(0,H.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=l(`text-sm font-medium`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Q.jsx)(he,{"data-slot":`dialog-title`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function we(e){let t=(0,H.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=l(`text-xs/relaxed text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Q.jsx)(X,{"data-slot":`dialog-description`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}export{Se as a,W as c,we as i,V as l,ve as n,xe as o,be as r,Ce as s,ge as t};