@sudobility/entity_pages 0.0.23 → 0.0.25
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.
- package/dist/index.esm.js +3 -3
- package/dist/index.umd.js +1 -1
- package/package.json +3 -3
package/dist/index.esm.js
CHANGED
|
@@ -10525,8 +10525,8 @@ const Ig = d.forwardRef(({ className: e, children: t, position: r = "popper", ..
|
|
|
10525
10525
|
ref: o,
|
|
10526
10526
|
className: ee(
|
|
10527
10527
|
ue.overlays.dropdown.menu(),
|
|
10528
|
-
"z-[1000000] max-h-96
|
|
10529
|
-
r === "popper" && "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
|
|
10528
|
+
"z-[1000000] max-h-96 overflow-hidden data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-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",
|
|
10529
|
+
r === "popper" && "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1 w-[var(--radix-select-trigger-width)]",
|
|
10530
10530
|
e
|
|
10531
10531
|
),
|
|
10532
10532
|
position: r,
|
|
@@ -10538,7 +10538,7 @@ const Ig = d.forwardRef(({ className: e, children: t, position: r = "popper", ..
|
|
|
10538
10538
|
{
|
|
10539
10539
|
className: ee(
|
|
10540
10540
|
ue.overlays.dropdown.itemContainer(),
|
|
10541
|
-
r === "popper" && "h-[var(--radix-select-trigger-height)] w-full
|
|
10541
|
+
r === "popper" && "h-[var(--radix-select-trigger-height)] w-full"
|
|
10542
10542
|
),
|
|
10543
10543
|
children: t
|
|
10544
10544
|
}
|
package/dist/index.umd.js
CHANGED
|
@@ -41,4 +41,4 @@
|
|
|
41
41
|
`)},Hd=0,gt=[];function Gd(e){var t=d.useRef([]),r=d.useRef([0,0]),n=d.useRef(),o=d.useState(Hd++)[0],a=d.useState(ca)[0],i=d.useRef(e);d.useEffect(function(){i.current=e},[e]),d.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var m=pd([e.lockRef.current],(e.shards||[]).map(ha),!0).filter(Boolean);return m.forEach(function(g){return g.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),m.forEach(function(g){return g.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var s=d.useCallback(function(m,g){if("touches"in m&&m.touches.length===2||m.type==="wheel"&&m.ctrlKey)return!i.current.allowPinchZoom;var w=cr(m),E=r.current,v="deltaX"in m?m.deltaX:E[0]-w[0],x="deltaY"in m?m.deltaY:E[1]-w[1],C,O=m.target,b=Math.abs(v)>Math.abs(x)?"h":"v";if("touches"in m&&b==="h"&&O.type==="range")return!1;var A=window.getSelection(),k=A&&A.anchorNode,M=k?k===O||k.contains(O):!1;if(M)return!1;var j=fa(b,O);if(!j)return!0;if(j?C=b:(C=b==="v"?"h":"v",j=fa(b,O)),!j)return!1;if(!n.current&&"changedTouches"in m&&(v||x)&&(n.current=C),!C)return!0;var $=n.current||C;return Vd($,g,m,$==="h"?v:x)},[]),l=d.useCallback(function(m){var g=m;if(!(!gt.length||gt[gt.length-1]!==a)){var w="deltaY"in g?ga(g):cr(g),E=t.current.filter(function(C){return C.name===g.type&&(C.target===g.target||g.target===C.shadowParent)&&Bd(C.delta,w)})[0];if(E&&E.should){g.cancelable&&g.preventDefault();return}if(!E){var v=(i.current.shards||[]).map(ha).filter(Boolean).filter(function(C){return C.contains(g.target)}),x=v.length>0?s(g,v[0]):!i.current.noIsolation;x&&g.cancelable&&g.preventDefault()}}},[]),c=d.useCallback(function(m,g,w,E){var v={name:m,delta:g,target:w,should:E,shadowParent:Yd(w)};t.current.push(v),setTimeout(function(){t.current=t.current.filter(function(x){return x!==v})},1)},[]),f=d.useCallback(function(m){r.current=cr(m),n.current=void 0},[]),u=d.useCallback(function(m){c(m.type,ga(m),m.target,s(m,e.lockRef.current))},[]),p=d.useCallback(function(m){c(m.type,cr(m),m.target,s(m,e.lockRef.current))},[]);d.useEffect(function(){return gt.push(a),e.setCallbacks({onScrollCapture:u,onWheelCapture:u,onTouchMoveCapture:p}),document.addEventListener("wheel",l,mt),document.addEventListener("touchmove",l,mt),document.addEventListener("touchstart",f,mt),function(){gt=gt.filter(function(m){return m!==a}),document.removeEventListener("wheel",l,mt),document.removeEventListener("touchmove",l,mt),document.removeEventListener("touchstart",f,mt)}},[]);var h=e.removeScrollBar,y=e.inert;return d.createElement(d.Fragment,null,y?d.createElement(a,{styles:zd(o)}):null,h?d.createElement(Ld,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Yd(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Kd=Sd(la,Gd);var ba=d.forwardRef(function(e,t){return d.createElement(sr,Ne({},e,{ref:t,sideCar:Kd}))});ba.classNames=sr.classNames;var Xd=[" ","Enter","ArrowUp","ArrowDown"],qd=[" ","Enter"],ur="Select",[Jr,dr,Zd]=lo(ur),[ht]=st(ur,[Zd,Ko]),Qr=Ko(),[Rg,Ge]=ht(ur),[kg,Jd]=ht(ur),ya="SelectTrigger",va=d.forwardRef((e,t)=>{const{__scopeSelect:r,disabled:n=!1,...o}=e,a=Qr(r),i=Ge(ya,r),s=i.disabled||n,l=J(t,i.onTriggerChange),c=dr(r),f=d.useRef("touch"),[u,p,h]=Ua(m=>{const g=c().filter(v=>!v.disabled),w=g.find(v=>v.value===i.value),E=Va(g,m,w);E!==void 0&&i.onValueChange(E.value)}),y=m=>{s||(i.onOpenChange(!0),h()),m&&(i.triggerPointerDownPosRef.current={x:Math.round(m.pageX),y:Math.round(m.pageY)})};return S.jsx(Zu,{asChild:!0,...a,children:S.jsx(H.button,{type:"button",role:"combobox","aria-controls":i.contentId,"aria-expanded":i.open,"aria-required":i.required,"aria-autocomplete":"none",dir:i.dir,"data-state":i.open?"open":"closed",disabled:s,"data-disabled":s?"":void 0,"data-placeholder":Wa(i.value)?"":void 0,...o,ref:l,onClick:U(o.onClick,m=>{m.currentTarget.focus(),f.current!=="mouse"&&y(m)}),onPointerDown:U(o.onPointerDown,m=>{f.current=m.pointerType;const g=m.target;g.hasPointerCapture(m.pointerId)&&g.releasePointerCapture(m.pointerId),m.button===0&&m.ctrlKey===!1&&m.pointerType==="mouse"&&(y(m),m.preventDefault())}),onKeyDown:U(o.onKeyDown,m=>{const g=u.current!=="";!(m.ctrlKey||m.altKey||m.metaKey)&&m.key.length===1&&p(m.key),!(g&&m.key===" ")&&Xd.includes(m.key)&&(y(),m.preventDefault())})})})});va.displayName=ya;var wa="SelectValue",Qd=d.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:o,children:a,placeholder:i="",...s}=e,l=Ge(wa,r),{onValueNodeHasChildrenChange:c}=l,f=a!==void 0,u=J(t,l.onValueNodeChange);return ce(()=>{c(f)},[c,f]),S.jsx(H.span,{...s,ref:u,style:{pointerEvents:"none"},children:Wa(l.value)?S.jsx(S.Fragment,{children:i}):a})});Qd.displayName=wa;var ef="SelectIcon",Ea=d.forwardRef((e,t)=>{const{__scopeSelect:r,children:n,...o}=e;return S.jsx(H.span,{"aria-hidden":!0,...o,ref:t,children:n||"▼"})});Ea.displayName=ef;var tf="SelectPortal",Sa=e=>S.jsx(ra,{asChild:!0,...e});Sa.displayName=tf;var Ze="SelectContent",xa=d.forwardRef((e,t)=>{const r=Ge(Ze,e.__scopeSelect),[n,o]=d.useState();if(ce(()=>{o(new DocumentFragment)},[]),!r.open){const a=n;return a?Wt.createPortal(S.jsx(Ca,{scope:e.__scopeSelect,children:S.jsx(Jr.Slot,{scope:e.__scopeSelect,children:S.jsx("div",{children:e.children})})}),a):null}return S.jsx(Aa,{...e,ref:t})});xa.displayName=Ze;var Ee=10,[Ca,Ye]=ht(Ze),rf="SelectContentImpl",nf=td("SelectContent.RemoveScroll"),Aa=d.forwardRef((e,t)=>{const{__scopeSelect:r,position:n="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:a,onPointerDownOutside:i,side:s,sideOffset:l,align:c,alignOffset:f,arrowPadding:u,collisionBoundary:p,collisionPadding:h,sticky:y,hideWhenDetached:m,avoidCollisions:g,...w}=e,E=Ge(Ze,r),[v,x]=d.useState(null),[C,O]=d.useState(null),b=J(t,P=>x(P)),[A,k]=d.useState(null),[M,j]=d.useState(null),$=dr(r),[V,W]=d.useState(!1),B=d.useRef(!1);d.useEffect(()=>{if(v)return fd(v)},[v]),Cc();const _=d.useCallback(P=>{const[X,...re]=$().map(q=>q.ref.current),[z]=re.slice(-1),Y=document.activeElement;for(const q of P)if(q===Y||(q?.scrollIntoView({block:"nearest"}),q===X&&C&&(C.scrollTop=0),q===z&&C&&(C.scrollTop=C.scrollHeight),q?.focus(),document.activeElement!==Y))return},[$,C]),F=d.useCallback(()=>_([A,v]),[_,A,v]);d.useEffect(()=>{V&&F()},[V,F]);const{onOpenChange:T,triggerPointerDownPosRef:G}=E;d.useEffect(()=>{if(v){let P={x:0,y:0};const X=z=>{P={x:Math.abs(Math.round(z.pageX)-(G.current?.x??0)),y:Math.abs(Math.round(z.pageY)-(G.current?.y??0))}},re=z=>{P.x<=10&&P.y<=10?z.preventDefault():v.contains(z.target)||T(!1),document.removeEventListener("pointermove",X),G.current=null};return G.current!==null&&(document.addEventListener("pointermove",X),document.addEventListener("pointerup",re,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",X),document.removeEventListener("pointerup",re,{capture:!0})}}},[v,T,G]),d.useEffect(()=>{const P=()=>T(!1);return window.addEventListener("blur",P),window.addEventListener("resize",P),()=>{window.removeEventListener("blur",P),window.removeEventListener("resize",P)}},[T]);const[le,ke]=Ua(P=>{const X=$().filter(Y=>!Y.disabled),re=X.find(Y=>Y.ref.current===document.activeElement),z=Va(X,P,re);z&&setTimeout(()=>z.ref.current.focus())}),We=d.useCallback((P,X,re)=>{const z=!B.current&&!re;(E.value!==void 0&&E.value===X||z)&&(k(P),z&&(B.current=!0))},[E.value]),te=d.useCallback(()=>v?.focus(),[v]),Z=d.useCallback((P,X,re)=>{const z=!B.current&&!re;(E.value!==void 0&&E.value===X||z)&&j(P)},[E.value]),Ce=n==="popper"?en:Ta,_e=Ce===en?{side:s,sideOffset:l,align:c,alignOffset:f,arrowPadding:u,collisionBoundary:p,collisionPadding:h,sticky:y,hideWhenDetached:m,avoidCollisions:g}:{};return S.jsx(Ca,{scope:r,content:v,viewport:C,onViewportChange:O,itemRefCallback:We,selectedItem:A,onItemLeave:te,itemTextRefCallback:Z,focusSelectedItem:F,selectedItemText:M,position:n,isPositioned:V,searchRef:le,children:S.jsx(ba,{as:nf,allowPinchZoom:!0,children:S.jsx(yo,{asChild:!0,trapped:E.open,onMountAutoFocus:P=>{P.preventDefault()},onUnmountAutoFocus:U(o,P=>{E.trigger?.focus({preventScroll:!0}),P.preventDefault()}),children:S.jsx(po,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:i,onFocusOutside:P=>P.preventDefault(),onDismiss:()=>E.onOpenChange(!1),children:S.jsx(Ce,{role:"listbox",id:E.contentId,"data-state":E.open?"open":"closed",dir:E.dir,onContextMenu:P=>P.preventDefault(),...w,..._e,onPlaced:()=>W(!0),ref:b,style:{display:"flex",flexDirection:"column",outline:"none",...w.style},onKeyDown:U(w.onKeyDown,P=>{const X=P.ctrlKey||P.altKey||P.metaKey;if(P.key==="Tab"&&P.preventDefault(),!X&&P.key.length===1&&ke(P.key),["ArrowUp","ArrowDown","Home","End"].includes(P.key)){let z=$().filter(Y=>!Y.disabled).map(Y=>Y.ref.current);if(["ArrowUp","End"].includes(P.key)&&(z=z.slice().reverse()),["ArrowUp","ArrowDown"].includes(P.key)){const Y=P.target,q=z.indexOf(Y);z=z.slice(q+1)}setTimeout(()=>_(z)),P.preventDefault()}})})})})})})});Aa.displayName=rf;var of="SelectItemAlignedPosition",Ta=d.forwardRef((e,t)=>{const{__scopeSelect:r,onPlaced:n,...o}=e,a=Ge(Ze,r),i=Ye(Ze,r),[s,l]=d.useState(null),[c,f]=d.useState(null),u=J(t,b=>f(b)),p=dr(r),h=d.useRef(!1),y=d.useRef(!0),{viewport:m,selectedItem:g,selectedItemText:w,focusSelectedItem:E}=i,v=d.useCallback(()=>{if(a.trigger&&a.valueNode&&s&&c&&m&&g&&w){const b=a.trigger.getBoundingClientRect(),A=c.getBoundingClientRect(),k=a.valueNode.getBoundingClientRect(),M=w.getBoundingClientRect();if(a.dir!=="rtl"){const Y=M.left-A.left,q=k.left-Y,be=b.left-q,rt=b.width+be,An=Math.max(rt,A.width),Tn=window.innerWidth-Ee,On=io(q,[Ee,Math.max(Ee,Tn-An)]);s.style.minWidth=rt+"px",s.style.left=On+"px"}else{const Y=A.right-M.right,q=window.innerWidth-k.right-Y,be=window.innerWidth-b.right-q,rt=b.width+be,An=Math.max(rt,A.width),Tn=window.innerWidth-Ee,On=io(q,[Ee,Math.max(Ee,Tn-An)]);s.style.minWidth=rt+"px",s.style.right=On+"px"}const j=p(),$=window.innerHeight-Ee*2,V=m.scrollHeight,W=window.getComputedStyle(c),B=parseInt(W.borderTopWidth,10),_=parseInt(W.paddingTop,10),F=parseInt(W.borderBottomWidth,10),T=parseInt(W.paddingBottom,10),G=B+_+V+T+F,le=Math.min(g.offsetHeight*5,G),ke=window.getComputedStyle(m),We=parseInt(ke.paddingTop,10),te=parseInt(ke.paddingBottom,10),Z=b.top+b.height/2-Ee,Ce=$-Z,_e=g.offsetHeight/2,P=g.offsetTop+_e,X=B+_+P,re=G-X;if(X<=Z){const Y=j.length>0&&g===j[j.length-1].ref.current;s.style.bottom="0px";const q=c.clientHeight-m.offsetTop-m.offsetHeight,be=Math.max(Ce,_e+(Y?te:0)+q+F),rt=X+be;s.style.height=rt+"px"}else{const Y=j.length>0&&g===j[0].ref.current;s.style.top="0px";const be=Math.max(Z,B+m.offsetTop+(Y?We:0)+_e)+re;s.style.height=be+"px",m.scrollTop=X-Z+m.offsetTop}s.style.margin=`${Ee}px 0`,s.style.minHeight=le+"px",s.style.maxHeight=$+"px",n?.(),requestAnimationFrame(()=>h.current=!0)}},[p,a.trigger,a.valueNode,s,c,m,g,w,a.dir,n]);ce(()=>v(),[v]);const[x,C]=d.useState();ce(()=>{c&&C(window.getComputedStyle(c).zIndex)},[c]);const O=d.useCallback(b=>{b&&y.current===!0&&(v(),E?.(),y.current=!1)},[v,E]);return S.jsx(sf,{scope:r,contentWrapper:s,shouldExpandOnScrollRef:h,onScrollButtonChange:O,children:S.jsx("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:x},children:S.jsx(H.div,{...o,ref:u,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});Ta.displayName=of;var af="SelectPopperPosition",en=d.forwardRef((e,t)=>{const{__scopeSelect:r,align:n="start",collisionPadding:o=Ee,...a}=e,i=Qr(r);return S.jsx(Ju,{...i,...a,ref:t,align:n,collisionPadding:o,style:{boxSizing:"border-box",...a.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});en.displayName=af;var[sf,tn]=ht(Ze,{}),rn="SelectViewport",Oa=d.forwardRef((e,t)=>{const{__scopeSelect:r,nonce:n,...o}=e,a=Ye(rn,r),i=tn(rn,r),s=J(t,a.onViewportChange),l=d.useRef(0);return S.jsxs(S.Fragment,{children:[S.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:n}),S.jsx(Jr.Slot,{scope:r,children:S.jsx(H.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:s,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:U(o.onScroll,c=>{const f=c.currentTarget,{contentWrapper:u,shouldExpandOnScrollRef:p}=i;if(p?.current&&u){const h=Math.abs(l.current-f.scrollTop);if(h>0){const y=window.innerHeight-Ee*2,m=parseFloat(u.style.minHeight),g=parseFloat(u.style.height),w=Math.max(m,g);if(w<y){const E=w+h,v=Math.min(y,E),x=E-v;u.style.height=v+"px",u.style.bottom==="0px"&&(f.scrollTop=x>0?x:0,u.style.justifyContent="flex-end")}}}l.current=f.scrollTop})})})]})});Oa.displayName=rn;var Pa="SelectGroup",[lf,cf]=ht(Pa),uf=d.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,o=Gt();return S.jsx(lf,{scope:r,id:o,children:S.jsx(H.div,{role:"group","aria-labelledby":o,...n,ref:t})})});uf.displayName=Pa;var Na="SelectLabel",Ia=d.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,o=cf(Na,r);return S.jsx(H.div,{id:o.id,...n,ref:t})});Ia.displayName=Na;var fr="SelectItem",[df,Ra]=ht(fr),ka=d.forwardRef((e,t)=>{const{__scopeSelect:r,value:n,disabled:o=!1,textValue:a,...i}=e,s=Ge(fr,r),l=Ye(fr,r),c=s.value===n,[f,u]=d.useState(a??""),[p,h]=d.useState(!1),y=J(t,E=>l.itemRefCallback?.(E,n,o)),m=Gt(),g=d.useRef("touch"),w=()=>{o||(s.onValueChange(n),s.onOpenChange(!1))};if(n==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return S.jsx(df,{scope:r,value:n,disabled:o,textId:m,isSelected:c,onItemTextChange:d.useCallback(E=>{u(v=>v||(E?.textContent??"").trim())},[]),children:S.jsx(Jr.ItemSlot,{scope:r,value:n,disabled:o,textValue:f,children:S.jsx(H.div,{role:"option","aria-labelledby":m,"data-highlighted":p?"":void 0,"aria-selected":c&&p,"data-state":c?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...i,ref:y,onFocus:U(i.onFocus,()=>h(!0)),onBlur:U(i.onBlur,()=>h(!1)),onClick:U(i.onClick,()=>{g.current!=="mouse"&&w()}),onPointerUp:U(i.onPointerUp,()=>{g.current==="mouse"&&w()}),onPointerDown:U(i.onPointerDown,E=>{g.current=E.pointerType}),onPointerMove:U(i.onPointerMove,E=>{g.current=E.pointerType,o?l.onItemLeave?.():g.current==="mouse"&&E.currentTarget.focus({preventScroll:!0})}),onPointerLeave:U(i.onPointerLeave,E=>{E.currentTarget===document.activeElement&&l.onItemLeave?.()}),onKeyDown:U(i.onKeyDown,E=>{l.searchRef?.current!==""&&E.key===" "||(qd.includes(E.key)&&w(),E.key===" "&&E.preventDefault())})})})})});ka.displayName=fr;var It="SelectItemText",_a=d.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:o,...a}=e,i=Ge(It,r),s=Ye(It,r),l=Ra(It,r),c=Jd(It,r),[f,u]=d.useState(null),p=J(t,w=>u(w),l.onItemTextChange,w=>s.itemTextRefCallback?.(w,l.value,l.disabled)),h=f?.textContent,y=d.useMemo(()=>S.jsx("option",{value:l.value,disabled:l.disabled,children:h},l.value),[l.disabled,l.value,h]),{onNativeOptionAdd:m,onNativeOptionRemove:g}=c;return ce(()=>(m(y),()=>g(y)),[m,g,y]),S.jsxs(S.Fragment,{children:[S.jsx(H.span,{id:l.textId,...a,ref:p}),l.isSelected&&i.valueNode&&!i.valueNodeHasChildren?Wt.createPortal(a.children,i.valueNode):null]})});_a.displayName=It;var Ma="SelectItemIndicator",La=d.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return Ra(Ma,r).isSelected?S.jsx(H.span,{"aria-hidden":!0,...n,ref:t}):null});La.displayName=Ma;var nn="SelectScrollUpButton",Da=d.forwardRef((e,t)=>{const r=Ye(nn,e.__scopeSelect),n=tn(nn,e.__scopeSelect),[o,a]=d.useState(!1),i=J(t,n.onScrollButtonChange);return ce(()=>{if(r.viewport&&r.isPositioned){let s=function(){const c=l.scrollTop>0;a(c)};const l=r.viewport;return s(),l.addEventListener("scroll",s),()=>l.removeEventListener("scroll",s)}},[r.viewport,r.isPositioned]),o?S.jsx(Fa,{...e,ref:i,onAutoScroll:()=>{const{viewport:s,selectedItem:l}=r;s&&l&&(s.scrollTop=s.scrollTop-l.offsetHeight)}}):null});Da.displayName=nn;var on="SelectScrollDownButton",ja=d.forwardRef((e,t)=>{const r=Ye(on,e.__scopeSelect),n=tn(on,e.__scopeSelect),[o,a]=d.useState(!1),i=J(t,n.onScrollButtonChange);return ce(()=>{if(r.viewport&&r.isPositioned){let s=function(){const c=l.scrollHeight-l.clientHeight,f=Math.ceil(l.scrollTop)<c;a(f)};const l=r.viewport;return s(),l.addEventListener("scroll",s),()=>l.removeEventListener("scroll",s)}},[r.viewport,r.isPositioned]),o?S.jsx(Fa,{...e,ref:i,onAutoScroll:()=>{const{viewport:s,selectedItem:l}=r;s&&l&&(s.scrollTop=s.scrollTop+l.offsetHeight)}}):null});ja.displayName=on;var Fa=d.forwardRef((e,t)=>{const{__scopeSelect:r,onAutoScroll:n,...o}=e,a=Ye("SelectScrollButton",r),i=d.useRef(null),s=dr(r),l=d.useCallback(()=>{i.current!==null&&(window.clearInterval(i.current),i.current=null)},[]);return d.useEffect(()=>()=>l(),[l]),ce(()=>{s().find(f=>f.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[s]),S.jsx(H.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:U(o.onPointerDown,()=>{i.current===null&&(i.current=window.setInterval(n,50))}),onPointerMove:U(o.onPointerMove,()=>{a.onItemLeave?.(),i.current===null&&(i.current=window.setInterval(n,50))}),onPointerLeave:U(o.onPointerLeave,()=>{l()})})}),ff="SelectSeparator",$a=d.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return S.jsx(H.div,{"aria-hidden":!0,...n,ref:t})});$a.displayName=ff;var an="SelectArrow",pf=d.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,o=Qr(r),a=Ge(an,r),i=Ye(an,r);return a.open&&i.position==="popper"?S.jsx(Qu,{...o,...n,ref:t}):null});pf.displayName=an;var mf="SelectBubbleInput",gf=d.forwardRef(({__scopeSelect:e,value:t,...r},n)=>{const o=d.useRef(null),a=J(n,o),i=Jn(t);return d.useEffect(()=>{const s=o.current;if(!s)return;const l=window.HTMLSelectElement.prototype,f=Object.getOwnPropertyDescriptor(l,"value").set;if(i!==t&&f){const u=new Event("change",{bubbles:!0});f.call(s,t),s.dispatchEvent(u)}},[i,t]),S.jsx(H.select,{...r,style:{...na,...r.style},ref:a,defaultValue:t})});gf.displayName=mf;function Wa(e){return e===""||e===void 0}function Ua(e){const t=Ve(e),r=d.useRef(""),n=d.useRef(0),o=d.useCallback(i=>{const s=r.current+i;t(s),(function l(c){r.current=c,window.clearTimeout(n.current),c!==""&&(n.current=window.setTimeout(()=>l(""),1e3))})(s)},[t]),a=d.useCallback(()=>{r.current="",window.clearTimeout(n.current)},[]);return d.useEffect(()=>()=>window.clearTimeout(n.current),[]),[r,o,a]}function Va(e,t,r){const o=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,a=r?e.indexOf(r):-1;let i=hf(e,Math.max(a,0));o.length===1&&(i=i.filter(c=>c!==r));const l=i.find(c=>c.textValue.toLowerCase().startsWith(o.toLowerCase()));return l!==r?l:void 0}function hf(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var Ba=va,bf=Ea,yf=Sa,za=xa,vf=Oa,Ha=Ia,Ga=ka,wf=_a,Ef=La,Ya=Da,Ka=ja,Xa=$a,Sf=Symbol.for("react.lazy"),pr=d[" use ".trim().toString()];function xf(e){return typeof e=="object"&&e!==null&&"then"in e}function qa(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===Sf&&"_payload"in e&&xf(e._payload)}function Za(e){const t=Af(e),r=d.forwardRef((n,o)=>{let{children:a,...i}=n;qa(a)&&typeof pr=="function"&&(a=pr(a._payload));const s=d.Children.toArray(a),l=s.find(Of);if(l){const c=l.props.children,f=s.map(u=>u===l?d.Children.count(c)>1?d.Children.only(null):d.isValidElement(c)?c.props.children:null:u);return S.jsx(t,{...i,ref:o,children:d.isValidElement(c)?d.cloneElement(c,void 0,f):null})}return S.jsx(t,{...i,ref:o,children:a})});return r.displayName=`${e}.Slot`,r}var Cf=Za("Slot");function Af(e){const t=d.forwardRef((r,n)=>{let{children:o,...a}=r;if(qa(o)&&typeof pr=="function"&&(o=pr(o._payload)),d.isValidElement(o)){const i=Nf(o),s=Pf(a,o.props);return o.type!==d.Fragment&&(s.ref=n?Tt(n,i):i),d.cloneElement(o,s)}return d.Children.count(o)>1?d.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Tf=Symbol("radix.slottable");function Of(e){return d.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Tf}function Pf(e,t){const r={...t};for(const n in t){const o=e[n],a=t[n];/^on[A-Z]/.test(n)?o&&a?r[n]=(...s)=>{const l=a(...s);return o(...s),l}:o&&(r[n]=o):n==="style"?r[n]={...o,...a}:n==="className"&&(r[n]=[o,a].filter(Boolean).join(" "))}return{...e,...r}}function Nf(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var If=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Rf=If.reduce((e,t)=>{const r=Za(`Primitive.${t}`),n=d.forwardRef((o,a)=>{const{asChild:i,...s}=o,l=i?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),S.jsx(l,{...s,ref:a})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),kf="Label",Ja=d.forwardRef((e,t)=>S.jsx(Rf.label,{...e,ref:t,onMouseDown:r=>{r.target.closest("button, input, select, textarea")||(e.onMouseDown?.(r),!r.defaultPrevented&&r.detail>1&&r.preventDefault())}}));Ja.displayName=kf;var Qa=Ja;function ae(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Ie(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function sn({pathname:e="/",search:t="",hash:r=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),r&&r!=="#"&&(e+=r.charAt(0)==="#"?r:"#"+r),e}function ln(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substring(r),e=e.substring(0,r));let n=e.indexOf("?");n>=0&&(t.search=e.substring(n),e=e.substring(0,n)),e&&(t.pathname=e)}return t}function ei(e,t,r="/"){return _f(e,t,r,!1)}function _f(e,t,r,n){let o=typeof t=="string"?ln(t):t,a=Ke(o.pathname||"/",r);if(a==null)return null;let i=ti(e);Mf(i);let s=null;for(let l=0;s==null&&l<i.length;++l){let c=Hf(a);s=Bf(i[l],c,n)}return s}function ti(e,t=[],r=[],n="",o=!1){let a=(i,s,l=o,c)=>{let f={relativePath:c===void 0?i.path||"":c,caseSensitive:i.caseSensitive===!0,childrenIndex:s,route:i};if(f.relativePath.startsWith("/")){if(!f.relativePath.startsWith(n)&&l)return;ae(f.relativePath.startsWith(n),`Absolute route path "${f.relativePath}" nested under path "${n}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),f.relativePath=f.relativePath.slice(n.length)}let u=je([n,f.relativePath]),p=r.concat(f);i.children&&i.children.length>0&&(ae(i.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${u}".`),ti(i.children,t,p,u,l)),!(i.path==null&&!i.index)&&t.push({path:u,score:Uf(u,i.index),routesMeta:p})};return e.forEach((i,s)=>{if(i.path===""||!i.path?.includes("?"))a(i,s);else for(let l of ri(i.path))a(i,s,!0,l)}),t}function ri(e){let t=e.split("/");if(t.length===0)return[];let[r,...n]=t,o=r.endsWith("?"),a=r.replace(/\?$/,"");if(n.length===0)return o?[a,""]:[a];let i=ri(n.join("/")),s=[];return s.push(...i.map(l=>l===""?a:[a,l].join("/"))),o&&s.push(...i),s.map(l=>e.startsWith("/")&&l===""?"/":l)}function Mf(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:Vf(t.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}var Lf=/^:[\w-]+$/,Df=3,jf=2,Ff=1,$f=10,Wf=-2,ni=e=>e==="*";function Uf(e,t){let r=e.split("/"),n=r.length;return r.some(ni)&&(n+=Wf),t&&(n+=jf),r.filter(o=>!ni(o)).reduce((o,a)=>o+(Lf.test(a)?Df:a===""?Ff:$f),n)}function Vf(e,t){return e.length===t.length&&e.slice(0,-1).every((n,o)=>n===t[o])?e[e.length-1]-t[t.length-1]:0}function Bf(e,t,r=!1){let{routesMeta:n}=e,o={},a="/",i=[];for(let s=0;s<n.length;++s){let l=n[s],c=s===n.length-1,f=a==="/"?t:t.slice(a.length)||"/",u=mr({path:l.relativePath,caseSensitive:l.caseSensitive,end:c},f),p=l.route;if(!u&&c&&r&&!n[n.length-1].route.index&&(u=mr({path:l.relativePath,caseSensitive:l.caseSensitive,end:!1},f)),!u)return null;Object.assign(o,u.params),i.push({params:o,pathname:je([a,u.pathname]),pathnameBase:Xf(je([a,u.pathnameBase])),route:p}),u.pathnameBase!=="/"&&(a=je([a,u.pathnameBase]))}return i}function mr(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,n]=zf(e.path,e.caseSensitive,e.end),o=t.match(r);if(!o)return null;let a=o[0],i=a.replace(/(.)\/+$/,"$1"),s=o.slice(1);return{params:n.reduce((c,{paramName:f,isOptional:u},p)=>{if(f==="*"){let y=s[p]||"";i=a.slice(0,a.length-y.length).replace(/(.)\/+$/,"$1")}const h=s[p];return u&&!h?c[f]=void 0:c[f]=(h||"").replace(/%2F/g,"/"),c},{}),pathname:a,pathnameBase:i,pattern:e}}function zf(e,t=!1,r=!0){Ie(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let n=[],o="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(i,s,l)=>(n.push({paramName:s,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(n.push({paramName:"*"}),o+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?o+="\\/*$":e!==""&&e!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,t?void 0:"i"),n]}function Hf(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Ie(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function Ke(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,n=e.charAt(r);return n&&n!=="/"?null:e.slice(r)||"/"}var oi=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Gf=e=>oi.test(e);function Yf(e,t="/"){let{pathname:r,search:n="",hash:o=""}=typeof e=="string"?ln(e):e,a;if(r)if(Gf(r))a=r;else{if(r.includes("//")){let i=r;r=r.replace(/\/\/+/g,"/"),Ie(!1,`Pathnames cannot have embedded double slashes - normalizing ${i} -> ${r}`)}r.startsWith("/")?a=ai(r.substring(1),"/"):a=ai(r,t)}else a=t;return{pathname:a,search:qf(n),hash:Zf(o)}}function ai(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(o=>{o===".."?r.length>1&&r.pop():o!=="."&&r.push(o)}),r.length>1?r.join("/"):"/"}function cn(e,t,r,n){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(n)}]. Please separate it out to the \`to.${r}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function Kf(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function ii(e){let t=Kf(e);return t.map((r,n)=>n===t.length-1?r.pathname:r.pathnameBase)}function si(e,t,r,n=!1){let o;typeof e=="string"?o=ln(e):(o={...e},ae(!o.pathname||!o.pathname.includes("?"),cn("?","pathname","search",o)),ae(!o.pathname||!o.pathname.includes("#"),cn("#","pathname","hash",o)),ae(!o.search||!o.search.includes("#"),cn("#","search","hash",o)));let a=e===""||o.pathname==="",i=a?"/":o.pathname,s;if(i==null)s=r;else{let u=t.length-1;if(!n&&i.startsWith("..")){let p=i.split("/");for(;p[0]==="..";)p.shift(),u-=1;o.pathname=p.join("/")}s=u>=0?t[u]:"/"}let l=Yf(o,s),c=i&&i!=="/"&&i.endsWith("/"),f=(a||i===".")&&r.endsWith("/");return!l.pathname.endsWith("/")&&(c||f)&&(l.pathname+="/"),l}var je=e=>e.join("/").replace(/\/\/+/g,"/"),Xf=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),qf=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Zf=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,Jf=class{constructor(e,t,r,n=!1){this.status=e,this.statusText=t||"",this.internal=n,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}};function Qf(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function ep(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var li=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function ci(e,t){let r=e;if(typeof r!="string"||!oi.test(r))return{absoluteURL:void 0,isExternal:!1,to:r};let n=r,o=!1;if(li)try{let a=new URL(window.location.href),i=r.startsWith("//")?new URL(a.protocol+r):new URL(r),s=Ke(i.pathname,t);i.origin===a.origin&&s!=null?r=s+i.search+i.hash:o=!0}catch{Ie(!1,`<Link to="${r}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:n,isExternal:o,to:r}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var ui=["POST","PUT","PATCH","DELETE"];new Set(ui);var tp=["GET",...ui];new Set(tp);var bt=d.createContext(null);bt.displayName="DataRouter";var gr=d.createContext(null);gr.displayName="DataRouterState";var rp=d.createContext(!1),di=d.createContext({isTransitioning:!1});di.displayName="ViewTransition";var np=d.createContext(new Map);np.displayName="Fetchers";var op=d.createContext(null);op.displayName="Await";var Se=d.createContext(null);Se.displayName="Navigation";var un=d.createContext(null);un.displayName="Location";var Fe=d.createContext({outlet:null,matches:[],isDataRoute:!1});Fe.displayName="Route";var dn=d.createContext(null);dn.displayName="RouteError";var fi="REACT_ROUTER_ERROR",ap="REDIRECT",ip="ROUTE_ERROR_RESPONSE";function sp(e){if(e.startsWith(`${fi}:${ap}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.location=="string"&&typeof t.reloadDocument=="boolean"&&typeof t.replace=="boolean")return t}catch{}}function lp(e){if(e.startsWith(`${fi}:${ip}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new Jf(t.status,t.statusText,t.data)}catch{}}function cp(e,{relative:t}={}){ae(hr(),"useHref() may be used only in the context of a <Router> component.");let{basename:r,navigator:n}=d.useContext(Se),{hash:o,pathname:a,search:i}=Rt(e,{relative:t}),s=a;return r!=="/"&&(s=a==="/"?r:je([r,a])),n.createHref({pathname:s,search:i,hash:o})}function hr(){return d.useContext(un)!=null}function Je(){return ae(hr(),"useLocation() may be used only in the context of a <Router> component."),d.useContext(un).location}var pi="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function mi(e){d.useContext(Se).static||d.useLayoutEffect(e)}function up(){let{isDataRoute:e}=d.useContext(Fe);return e?xp():dp()}function dp(){ae(hr(),"useNavigate() may be used only in the context of a <Router> component.");let e=d.useContext(bt),{basename:t,navigator:r}=d.useContext(Se),{matches:n}=d.useContext(Fe),{pathname:o}=Je(),a=JSON.stringify(ii(n)),i=d.useRef(!1);return mi(()=>{i.current=!0}),d.useCallback((l,c={})=>{if(Ie(i.current,pi),!i.current)return;if(typeof l=="number"){r.go(l);return}let f=si(l,JSON.parse(a),o,c.relative==="path");e==null&&t!=="/"&&(f.pathname=f.pathname==="/"?t:je([t,f.pathname])),(c.replace?r.replace:r.push)(f,c.state,c)},[t,r,a,o,e])}d.createContext(null);function Rt(e,{relative:t}={}){let{matches:r}=d.useContext(Fe),{pathname:n}=Je(),o=JSON.stringify(ii(r));return d.useMemo(()=>si(e,JSON.parse(o),n,t==="path"),[e,o,n,t])}function fp(e,t,r,n,o){ae(hr(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:a}=d.useContext(Se),{matches:i}=d.useContext(Fe),s=i[i.length-1],l=s?s.params:{},c=s?s.pathname:"/",f=s?s.pathnameBase:"/",u=s&&s.route;{let E=u&&u.path||"";bi(c,!u||E.endsWith("*")||E.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${c}" (under <Route path="${E}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
42
42
|
|
|
43
43
|
Please change the parent <Route path="${E}"> to <Route path="${E==="/"?"*":`${E}/*`}">.`)}let p=Je(),h;h=p;let y=h.pathname||"/",m=y;if(f!=="/"){let E=f.replace(/^\//,"").split("/");m="/"+y.replace(/^\//,"").split("/").slice(E.length).join("/")}let g=ei(e,{pathname:m});return Ie(u||g!=null,`No routes matched location "${h.pathname}${h.search}${h.hash}" `),Ie(g==null||g[g.length-1].route.element!==void 0||g[g.length-1].route.Component!==void 0||g[g.length-1].route.lazy!==void 0,`Matched leaf route at location "${h.pathname}${h.search}${h.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`),bp(g&&g.map(E=>Object.assign({},E,{params:Object.assign({},l,E.params),pathname:je([f,a.encodeLocation?a.encodeLocation(E.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:E.pathname]),pathnameBase:E.pathnameBase==="/"?f:je([f,a.encodeLocation?a.encodeLocation(E.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:E.pathnameBase])})),i,r,n,o)}function pp(){let e=Sp(),t=Qf(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,n="rgba(200,200,200, 0.5)",o={padding:"0.5rem",backgroundColor:n},a={padding:"2px 4px",backgroundColor:n},i=null;return console.error("Error handled by React Router default ErrorBoundary:",e),i=d.createElement(d.Fragment,null,d.createElement("p",null,"💿 Hey developer 👋"),d.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",d.createElement("code",{style:a},"ErrorBoundary")," or"," ",d.createElement("code",{style:a},"errorElement")," prop on your route.")),d.createElement(d.Fragment,null,d.createElement("h2",null,"Unexpected Application Error!"),d.createElement("h3",{style:{fontStyle:"italic"}},t),r?d.createElement("pre",{style:o},r):null,i)}var mp=d.createElement(pp,null),gi=class extends d.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const r=lp(e.digest);r&&(e=r)}let t=e!==void 0?d.createElement(Fe.Provider,{value:this.props.routeContext},d.createElement(dn.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?d.createElement(gp,{error:e},t):t}};gi.contextType=rp;var fn=new WeakMap;function gp({children:e,error:t}){let{basename:r}=d.useContext(Se);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let n=sp(t.digest);if(n){let o=fn.get(t);if(o)throw o;let a=ci(n.location,r);if(li&&!fn.get(t))if(a.isExternal||n.reloadDocument)window.location.href=a.absoluteURL||a.to;else{const i=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(a.to,{replace:n.replace}));throw fn.set(t,i),i}return d.createElement("meta",{httpEquiv:"refresh",content:`0;url=${a.absoluteURL||a.to}`})}}return e}function hp({routeContext:e,match:t,children:r}){let n=d.useContext(bt);return n&&n.static&&n.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(n.staticContext._deepestRenderedBoundaryId=t.route.id),d.createElement(Fe.Provider,{value:e},r)}function bp(e,t=[],r=null,n=null,o=null){if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let a=e,i=r?.errors;if(i!=null){let f=a.findIndex(u=>u.route.id&&i?.[u.route.id]!==void 0);ae(f>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(i).join(",")}`),a=a.slice(0,Math.min(a.length,f+1))}let s=!1,l=-1;if(r)for(let f=0;f<a.length;f++){let u=a[f];if((u.route.HydrateFallback||u.route.hydrateFallbackElement)&&(l=f),u.route.id){let{loaderData:p,errors:h}=r,y=u.route.loader&&!p.hasOwnProperty(u.route.id)&&(!h||h[u.route.id]===void 0);if(u.route.lazy||y){s=!0,l>=0?a=a.slice(0,l+1):a=[a[0]];break}}}let c=r&&n?(f,u)=>{n(f,{location:r.location,params:r.matches?.[0]?.params??{},unstable_pattern:ep(r.matches),errorInfo:u})}:void 0;return a.reduceRight((f,u,p)=>{let h,y=!1,m=null,g=null;r&&(h=i&&u.route.id?i[u.route.id]:void 0,m=u.route.errorElement||mp,s&&(l<0&&p===0?(bi("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),y=!0,g=null):l===p&&(y=!0,g=u.route.hydrateFallbackElement||null)));let w=t.concat(a.slice(0,p+1)),E=()=>{let v;return h?v=m:y?v=g:u.route.Component?v=d.createElement(u.route.Component,null):u.route.element?v=u.route.element:v=f,d.createElement(hp,{match:u,routeContext:{outlet:f,matches:w,isDataRoute:r!=null},children:v})};return r&&(u.route.ErrorBoundary||u.route.errorElement||p===0)?d.createElement(gi,{location:r.location,revalidation:r.revalidation,component:m,error:h,children:E(),routeContext:{outlet:null,matches:w,isDataRoute:!0},onError:c}):E()},null)}function pn(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function yp(e){let t=d.useContext(bt);return ae(t,pn(e)),t}function vp(e){let t=d.useContext(gr);return ae(t,pn(e)),t}function wp(e){let t=d.useContext(Fe);return ae(t,pn(e)),t}function mn(e){let t=wp(e),r=t.matches[t.matches.length-1];return ae(r.route.id,`${e} can only be used on routes that contain a unique "id"`),r.route.id}function Ep(){return mn("useRouteId")}function Sp(){let e=d.useContext(dn),t=vp("useRouteError"),r=mn("useRouteError");return e!==void 0?e:t.errors?.[r]}function xp(){let{router:e}=yp("useNavigate"),t=mn("useNavigate"),r=d.useRef(!1);return mi(()=>{r.current=!0}),d.useCallback(async(o,a={})=>{Ie(r.current,pi),r.current&&(typeof o=="number"?await e.navigate(o):await e.navigate(o,{fromRouteId:t,...a}))},[e,t])}var hi={};function bi(e,t,r){!t&&!hi[e]&&(hi[e]=!0,Ie(!1,r))}d.memo(Cp);function Cp({routes:e,future:t,state:r,onError:n}){return fp(e,void 0,r,n,t)}var br="get",yr="application/x-www-form-urlencoded";function vr(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function Ap(e){return vr(e)&&e.tagName.toLowerCase()==="button"}function Tp(e){return vr(e)&&e.tagName.toLowerCase()==="form"}function Op(e){return vr(e)&&e.tagName.toLowerCase()==="input"}function Pp(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Np(e,t){return e.button===0&&(!t||t==="_self")&&!Pp(e)}var wr=null;function Ip(){if(wr===null)try{new FormData(document.createElement("form"),0),wr=!1}catch{wr=!0}return wr}var Rp=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function gn(e){return e!=null&&!Rp.has(e)?(Ie(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${yr}"`),null):e}function kp(e,t){let r,n,o,a,i;if(Tp(e)){let s=e.getAttribute("action");n=s?Ke(s,t):null,r=e.getAttribute("method")||br,o=gn(e.getAttribute("enctype"))||yr,a=new FormData(e)}else if(Ap(e)||Op(e)&&(e.type==="submit"||e.type==="image")){let s=e.form;if(s==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let l=e.getAttribute("formaction")||s.getAttribute("action");if(n=l?Ke(l,t):null,r=e.getAttribute("formmethod")||s.getAttribute("method")||br,o=gn(e.getAttribute("formenctype"))||gn(s.getAttribute("enctype"))||yr,a=new FormData(s,e),!Ip()){let{name:c,type:f,value:u}=e;if(f==="image"){let p=c?`${c}.`:"";a.append(`${p}x`,"0"),a.append(`${p}y`,"0")}else c&&a.append(c,u)}}else{if(vr(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r=br,n=null,o=yr,i=e}return a&&o==="text/plain"&&(i=a,a=void 0),{action:n,method:r.toLowerCase(),encType:o,formData:a,body:i}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function hn(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function _p(e,t,r){let n=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return n.pathname==="/"?n.pathname=`_root.${r}`:t&&Ke(n.pathname,t)==="/"?n.pathname=`${t.replace(/\/$/,"")}/_root.${r}`:n.pathname=`${n.pathname.replace(/\/$/,"")}.${r}`,n}async function Mp(e,t){if(e.id in t)return t[e.id];try{let r=await import(e.module);return t[e.id]=r,r}catch(r){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(r),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function Lp(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function Dp(e,t,r){let n=await Promise.all(e.map(async o=>{let a=t.routes[o.route.id];if(a){let i=await Mp(a,r);return i.links?i.links():[]}return[]}));return Wp(n.flat(1).filter(Lp).filter(o=>o.rel==="stylesheet"||o.rel==="preload").map(o=>o.rel==="stylesheet"?{...o,rel:"prefetch",as:"style"}:{...o,rel:"prefetch"}))}function yi(e,t,r,n,o,a){let i=(l,c)=>r[c]?l.route.id!==r[c].route.id:!0,s=(l,c)=>r[c].pathname!==l.pathname||r[c].route.path?.endsWith("*")&&r[c].params["*"]!==l.params["*"];return a==="assets"?t.filter((l,c)=>i(l,c)||s(l,c)):a==="data"?t.filter((l,c)=>{let f=n.routes[l.route.id];if(!f||!f.hasLoader)return!1;if(i(l,c)||s(l,c))return!0;if(l.route.shouldRevalidate){let u=l.route.shouldRevalidate({currentUrl:new URL(o.pathname+o.search+o.hash,window.origin),currentParams:r[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:l.params,defaultShouldRevalidate:!0});if(typeof u=="boolean")return u}return!0}):[]}function jp(e,t,{includeHydrateFallback:r}={}){return Fp(e.map(n=>{let o=t.routes[n.route.id];if(!o)return[];let a=[o.module];return o.clientActionModule&&(a=a.concat(o.clientActionModule)),o.clientLoaderModule&&(a=a.concat(o.clientLoaderModule)),r&&o.hydrateFallbackModule&&(a=a.concat(o.hydrateFallbackModule)),o.imports&&(a=a.concat(o.imports)),a}).flat(1))}function Fp(e){return[...new Set(e)]}function $p(e){let t={},r=Object.keys(e).sort();for(let n of r)t[n]=e[n];return t}function Wp(e,t){let r=new Set;return new Set(t),e.reduce((n,o)=>{let a=JSON.stringify($p(o));return r.has(a)||(r.add(a),n.push({key:a,link:o})),n},[])}function vi(){let e=d.useContext(bt);return hn(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function Up(){let e=d.useContext(gr);return hn(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var bn=d.createContext(void 0);bn.displayName="FrameworkContext";function wi(){let e=d.useContext(bn);return hn(e,"You must render this element inside a <HydratedRouter> element"),e}function Vp(e,t){let r=d.useContext(bn),[n,o]=d.useState(!1),[a,i]=d.useState(!1),{onFocus:s,onBlur:l,onMouseEnter:c,onMouseLeave:f,onTouchStart:u}=t,p=d.useRef(null);d.useEffect(()=>{if(e==="render"&&i(!0),e==="viewport"){let m=w=>{w.forEach(E=>{i(E.isIntersecting)})},g=new IntersectionObserver(m,{threshold:.5});return p.current&&g.observe(p.current),()=>{g.disconnect()}}},[e]),d.useEffect(()=>{if(n){let m=setTimeout(()=>{i(!0)},100);return()=>{clearTimeout(m)}}},[n]);let h=()=>{o(!0)},y=()=>{o(!1),i(!1)};return r?e!=="intent"?[a,p,{}]:[a,p,{onFocus:kt(s,h),onBlur:kt(l,y),onMouseEnter:kt(c,h),onMouseLeave:kt(f,y),onTouchStart:kt(u,h)}]:[!1,p,{}]}function kt(e,t){return r=>{e&&e(r),r.defaultPrevented||t(r)}}function Bp({page:e,...t}){let{router:r}=vi(),n=d.useMemo(()=>ei(r.routes,e,r.basename),[r.routes,e,r.basename]);return n?d.createElement(Hp,{page:e,matches:n,...t}):null}function zp(e){let{manifest:t,routeModules:r}=wi(),[n,o]=d.useState([]);return d.useEffect(()=>{let a=!1;return Dp(e,t,r).then(i=>{a||o(i)}),()=>{a=!0}},[e,t,r]),n}function Hp({page:e,matches:t,...r}){let n=Je(),{manifest:o,routeModules:a}=wi(),{basename:i}=vi(),{loaderData:s,matches:l}=Up(),c=d.useMemo(()=>yi(e,t,l,o,n,"data"),[e,t,l,o,n]),f=d.useMemo(()=>yi(e,t,l,o,n,"assets"),[e,t,l,o,n]),u=d.useMemo(()=>{if(e===n.pathname+n.search+n.hash)return[];let y=new Set,m=!1;if(t.forEach(w=>{let E=o.routes[w.route.id];!E||!E.hasLoader||(!c.some(v=>v.route.id===w.route.id)&&w.route.id in s&&a[w.route.id]?.shouldRevalidate||E.hasClientLoader?m=!0:y.add(w.route.id))}),y.size===0)return[];let g=_p(e,i,"data");return m&&y.size>0&&g.searchParams.set("_routes",t.filter(w=>y.has(w.route.id)).map(w=>w.route.id).join(",")),[g.pathname+g.search]},[i,s,n,o,c,t,e,a]),p=d.useMemo(()=>jp(f,o),[f,o]),h=zp(f);return d.createElement(d.Fragment,null,u.map(y=>d.createElement("link",{key:y,rel:"prefetch",as:"fetch",href:y,...r})),p.map(y=>d.createElement("link",{key:y,rel:"modulepreload",href:y,...r})),h.map(({key:y,link:m})=>d.createElement("link",{key:y,nonce:r.nonce,...m})))}function Gp(...e){return t=>{e.forEach(r=>{typeof r=="function"?r(t):r!=null&&(r.current=t)})}}var Yp=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{Yp&&(window.__reactRouterVersion="7.11.0")}catch{}var Ei=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,yn=d.forwardRef(function({onClick:t,discover:r="render",prefetch:n="none",relative:o,reloadDocument:a,replace:i,state:s,target:l,to:c,preventScrollReset:f,viewTransition:u,unstable_defaultShouldRevalidate:p,...h},y){let{basename:m,unstable_useTransitions:g}=d.useContext(Se),w=typeof c=="string"&&Ei.test(c),E=ci(c,m);c=E.to;let v=cp(c,{relative:o}),[x,C,O]=Vp(n,h),b=Zp(c,{replace:i,state:s,target:l,preventScrollReset:f,relative:o,viewTransition:u,unstable_defaultShouldRevalidate:p,unstable_useTransitions:g});function A(M){t&&t(M),M.defaultPrevented||b(M)}let k=d.createElement("a",{...h,...O,href:E.absoluteURL||v,onClick:E.isExternal||a?t:A,ref:Gp(y,C),target:l,"data-discover":!w&&r==="render"?"true":void 0});return x&&!w?d.createElement(d.Fragment,null,k,d.createElement(Bp,{page:v})):k});yn.displayName="Link";var Kp=d.forwardRef(function({"aria-current":t="page",caseSensitive:r=!1,className:n="",end:o=!1,style:a,to:i,viewTransition:s,children:l,...c},f){let u=Rt(i,{relative:c.relative}),p=Je(),h=d.useContext(gr),{navigator:y,basename:m}=d.useContext(Se),g=h!=null&&rm(u)&&s===!0,w=y.encodeLocation?y.encodeLocation(u).pathname:u.pathname,E=p.pathname,v=h&&h.navigation&&h.navigation.location?h.navigation.location.pathname:null;r||(E=E.toLowerCase(),v=v?v.toLowerCase():null,w=w.toLowerCase()),v&&m&&(v=Ke(v,m)||v);const x=w!=="/"&&w.endsWith("/")?w.length-1:w.length;let C=E===w||!o&&E.startsWith(w)&&E.charAt(x)==="/",O=v!=null&&(v===w||!o&&v.startsWith(w)&&v.charAt(w.length)==="/"),b={isActive:C,isPending:O,isTransitioning:g},A=C?t:void 0,k;typeof n=="function"?k=n(b):k=[n,C?"active":null,O?"pending":null,g?"transitioning":null].filter(Boolean).join(" ");let M=typeof a=="function"?a(b):a;return d.createElement(yn,{...c,"aria-current":A,className:k,ref:f,style:M,to:i,viewTransition:s},typeof l=="function"?l(b):l)});Kp.displayName="NavLink";var Xp=d.forwardRef(({discover:e="render",fetcherKey:t,navigate:r,reloadDocument:n,replace:o,state:a,method:i=br,action:s,onSubmit:l,relative:c,preventScrollReset:f,viewTransition:u,unstable_defaultShouldRevalidate:p,...h},y)=>{let{unstable_useTransitions:m}=d.useContext(Se),g=em(),w=tm(s,{relative:c}),E=i.toLowerCase()==="get"?"get":"post",v=typeof s=="string"&&Ei.test(s),x=C=>{if(l&&l(C),C.defaultPrevented)return;C.preventDefault();let O=C.nativeEvent.submitter,b=O?.getAttribute("formmethod")||i,A=()=>g(O||C.currentTarget,{fetcherKey:t,method:b,navigate:r,replace:o,state:a,relative:c,preventScrollReset:f,viewTransition:u,unstable_defaultShouldRevalidate:p});m&&r!==!1?d.startTransition(()=>A()):A()};return d.createElement("form",{ref:y,method:E,action:w,onSubmit:n?l:x,...h,"data-discover":!v&&e==="render"?"true":void 0})});Xp.displayName="Form";function qp(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Si(e){let t=d.useContext(bt);return ae(t,qp(e)),t}function Zp(e,{target:t,replace:r,state:n,preventScrollReset:o,relative:a,viewTransition:i,unstable_defaultShouldRevalidate:s,unstable_useTransitions:l}={}){let c=up(),f=Je(),u=Rt(e,{relative:a});return d.useCallback(p=>{if(Np(p,t)){p.preventDefault();let h=r!==void 0?r:sn(f)===sn(u),y=()=>c(e,{replace:h,state:n,preventScrollReset:o,relative:a,viewTransition:i,unstable_defaultShouldRevalidate:s});l?d.startTransition(()=>y()):y()}},[f,c,u,r,n,t,e,o,a,i,s,l])}var Jp=0,Qp=()=>`__${String(++Jp)}__`;function em(){let{router:e}=Si("useSubmit"),{basename:t}=d.useContext(Se),r=Ep(),n=e.fetch,o=e.navigate;return d.useCallback(async(a,i={})=>{let{action:s,method:l,encType:c,formData:f,body:u}=kp(a,t);if(i.navigate===!1){let p=i.fetcherKey||Qp();await n(p,r,i.action||s,{unstable_defaultShouldRevalidate:i.unstable_defaultShouldRevalidate,preventScrollReset:i.preventScrollReset,formData:f,body:u,formMethod:i.method||l,formEncType:i.encType||c,flushSync:i.flushSync})}else await o(i.action||s,{unstable_defaultShouldRevalidate:i.unstable_defaultShouldRevalidate,preventScrollReset:i.preventScrollReset,formData:f,body:u,formMethod:i.method||l,formEncType:i.encType||c,replace:i.replace,state:i.state,fromRouteId:r,flushSync:i.flushSync,viewTransition:i.viewTransition})},[n,o,t,r])}function tm(e,{relative:t}={}){let{basename:r}=d.useContext(Se),n=d.useContext(Fe);ae(n,"useFormAction must be used inside a RouteContext");let[o]=n.matches.slice(-1),a={...Rt(e||".",{relative:t})},i=Je();if(e==null){a.search=i.search;let s=new URLSearchParams(a.search),l=s.getAll("index");if(l.some(f=>f==="")){s.delete("index"),l.filter(u=>u).forEach(u=>s.append("index",u));let f=s.toString();a.search=f?`?${f}`:""}}return(!e||e===".")&&o.route.index&&(a.search=a.search?a.search.replace(/^\?/,"?index&"):"?index"),r!=="/"&&(a.pathname=a.pathname==="/"?r:je([r,a.pathname])),sn(a)}function rm(e,{relative:t}={}){let r=d.useContext(di);ae(r!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:n}=Si("useViewTransitionState"),o=Rt(e,{relative:t});if(!r.isTransitioning)return!1;let a=Ke(r.currentLocation.pathname,n)||r.currentLocation.pathname,i=Ke(r.nextLocation.pathname,n)||r.nextLocation.pathname;return mr(o.pathname,i)!=null||mr(o.pathname,a)!=null}var vn="rovingFocusGroup.onEntryFocus",nm={bubbles:!1,cancelable:!0},_t="RovingFocusGroup",[wn,xi,om]=lo(_t),[am,Ci]=st(_t,[om]),[im,sm]=am(_t),Ai=d.forwardRef((e,t)=>S.jsx(wn.Provider,{scope:e.__scopeRovingFocusGroup,children:S.jsx(wn.Slot,{scope:e.__scopeRovingFocusGroup,children:S.jsx(lm,{...e,ref:t})})}));Ai.displayName=_t;var lm=d.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,orientation:n,loop:o=!1,dir:a,currentTabStopId:i,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:l,onEntryFocus:c,preventScrollOnEntryFocus:f=!1,...u}=e,p=d.useRef(null),h=J(t,p),y=co(a),[m,g]=Ir({prop:i,defaultProp:s??null,onChange:l,caller:_t}),[w,E]=d.useState(!1),v=Ve(c),x=xi(r),C=d.useRef(!1),[O,b]=d.useState(0);return d.useEffect(()=>{const A=p.current;if(A)return A.addEventListener(vn,v),()=>A.removeEventListener(vn,v)},[v]),S.jsx(im,{scope:r,orientation:n,dir:y,loop:o,currentTabStopId:m,onItemFocus:d.useCallback(A=>g(A),[g]),onItemShiftTab:d.useCallback(()=>E(!0),[]),onFocusableItemAdd:d.useCallback(()=>b(A=>A+1),[]),onFocusableItemRemove:d.useCallback(()=>b(A=>A-1),[]),children:S.jsx(H.div,{tabIndex:w||O===0?-1:0,"data-orientation":n,...u,ref:h,style:{outline:"none",...e.style},onMouseDown:U(e.onMouseDown,()=>{C.current=!0}),onFocus:U(e.onFocus,A=>{const k=!C.current;if(A.target===A.currentTarget&&k&&!w){const M=new CustomEvent(vn,nm);if(A.currentTarget.dispatchEvent(M),!M.defaultPrevented){const j=x().filter(_=>_.focusable),$=j.find(_=>_.active),V=j.find(_=>_.id===m),B=[$,V,...j].filter(Boolean).map(_=>_.ref.current);Pi(B,f)}}C.current=!1}),onBlur:U(e.onBlur,()=>E(!1))})})}),Ti="RovingFocusGroupItem",Oi=d.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,focusable:n=!0,active:o=!1,tabStopId:a,children:i,...s}=e,l=Gt(),c=a||l,f=sm(Ti,r),u=f.currentTabStopId===c,p=xi(r),{onFocusableItemAdd:h,onFocusableItemRemove:y,currentTabStopId:m}=f;return d.useEffect(()=>{if(n)return h(),()=>y()},[n,h,y]),S.jsx(wn.ItemSlot,{scope:r,id:c,focusable:n,active:o,children:S.jsx(H.span,{tabIndex:u?0:-1,"data-orientation":f.orientation,...s,ref:t,onMouseDown:U(e.onMouseDown,g=>{n?f.onItemFocus(c):g.preventDefault()}),onFocus:U(e.onFocus,()=>f.onItemFocus(c)),onKeyDown:U(e.onKeyDown,g=>{if(g.key==="Tab"&&g.shiftKey){f.onItemShiftTab();return}if(g.target!==g.currentTarget)return;const w=dm(g,f.orientation,f.dir);if(w!==void 0){if(g.metaKey||g.ctrlKey||g.altKey||g.shiftKey)return;g.preventDefault();let v=p().filter(x=>x.focusable).map(x=>x.ref.current);if(w==="last")v.reverse();else if(w==="prev"||w==="next"){w==="prev"&&v.reverse();const x=v.indexOf(g.currentTarget);v=f.loop?fm(v,x+1):v.slice(x+1)}setTimeout(()=>Pi(v))}}),children:typeof i=="function"?i({isCurrentTabStop:u,hasTabStop:m!=null}):i})})});Oi.displayName=Ti;var cm={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function um(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function dm(e,t,r){const n=um(e.key,r);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return cm[n]}function Pi(e,t=!1){const r=document.activeElement;for(const n of e)if(n===r||(n.focus({preventScroll:t}),document.activeElement!==r))return}function fm(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var pm=Ai,mm=Oi;function gm(e,t){return d.useReducer((r,n)=>t[r][n]??r,e)}var Ni=e=>{const{present:t,children:r}=e,n=hm(t),o=typeof r=="function"?r({present:n.isPresent}):d.Children.only(r),a=J(n.ref,bm(o));return typeof r=="function"||n.isPresent?d.cloneElement(o,{ref:a}):null};Ni.displayName="Presence";function hm(e){const[t,r]=d.useState(),n=d.useRef(null),o=d.useRef(e),a=d.useRef("none"),i=e?"mounted":"unmounted",[s,l]=gm(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return d.useEffect(()=>{const c=Er(n.current);a.current=s==="mounted"?c:"none"},[s]),ce(()=>{const c=n.current,f=o.current;if(f!==e){const p=a.current,h=Er(c);e?l("MOUNT"):h==="none"||c?.display==="none"?l("UNMOUNT"):l(f&&p!==h?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,l]),ce(()=>{if(t){let c;const f=t.ownerDocument.defaultView??window,u=h=>{const m=Er(n.current).includes(CSS.escape(h.animationName));if(h.target===t&&m&&(l("ANIMATION_END"),!o.current)){const g=t.style.animationFillMode;t.style.animationFillMode="forwards",c=f.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=g)})}},p=h=>{h.target===t&&(a.current=Er(n.current))};return t.addEventListener("animationstart",p),t.addEventListener("animationcancel",u),t.addEventListener("animationend",u),()=>{f.clearTimeout(c),t.removeEventListener("animationstart",p),t.removeEventListener("animationcancel",u),t.removeEventListener("animationend",u)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:d.useCallback(c=>{n.current=c?getComputedStyle(c):null,r(c)},[])}}function Er(e){return e?.animationName||"none"}function bm(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var Sr="Tabs",[ym]=st(Sr,[Ci]),Ii=Ci(),[vm,En]=ym(Sr),Ri=d.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,onValueChange:o,defaultValue:a,orientation:i="horizontal",dir:s,activationMode:l="automatic",...c}=e,f=co(s),[u,p]=Ir({prop:n,onChange:o,defaultProp:a??"",caller:Sr});return S.jsx(vm,{scope:r,baseId:Gt(),value:u,onValueChange:p,orientation:i,dir:f,activationMode:l,children:S.jsx(H.div,{dir:f,"data-orientation":i,...c,ref:t})})});Ri.displayName=Sr;var ki="TabsList",_i=d.forwardRef((e,t)=>{const{__scopeTabs:r,loop:n=!0,...o}=e,a=En(ki,r),i=Ii(r);return S.jsx(pm,{asChild:!0,...i,orientation:a.orientation,dir:a.dir,loop:n,children:S.jsx(H.div,{role:"tablist","aria-orientation":a.orientation,...o,ref:t})})});_i.displayName=ki;var Mi="TabsTrigger",Li=d.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,disabled:o=!1,...a}=e,i=En(Mi,r),s=Ii(r),l=Fi(i.baseId,n),c=$i(i.baseId,n),f=n===i.value;return S.jsx(mm,{asChild:!0,...s,focusable:!o,active:f,children:S.jsx(H.button,{type:"button",role:"tab","aria-selected":f,"aria-controls":c,"data-state":f?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:l,...a,ref:t,onMouseDown:U(e.onMouseDown,u=>{!o&&u.button===0&&u.ctrlKey===!1?i.onValueChange(n):u.preventDefault()}),onKeyDown:U(e.onKeyDown,u=>{[" ","Enter"].includes(u.key)&&i.onValueChange(n)}),onFocus:U(e.onFocus,()=>{const u=i.activationMode!=="manual";!f&&!o&&u&&i.onValueChange(n)})})})});Li.displayName=Mi;var Di="TabsContent",ji=d.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,forceMount:o,children:a,...i}=e,s=En(Di,r),l=Fi(s.baseId,n),c=$i(s.baseId,n),f=n===s.value,u=d.useRef(f);return d.useEffect(()=>{const p=requestAnimationFrame(()=>u.current=!1);return()=>cancelAnimationFrame(p)},[]),S.jsx(Ni,{present:o||f,children:({present:p})=>S.jsx(H.div,{"data-state":f?"active":"inactive","data-orientation":s.orientation,role:"tabpanel","aria-labelledby":l,hidden:!p,id:c,tabIndex:0,...i,ref:t,style:{...e.style,animationDuration:u.current?"0s":void 0},children:p&&a})})});ji.displayName=Di;function Fi(e,t){return`${e}-trigger-${t}`}function $i(e,t){return`${e}-content-${t}`}var wm=Ri,Wi=_i,Ui=Li,Vi=ji;function Q(...e){return Gl(Rn(e))}const Em=zt("",{variants:{variant:{default:"",hero:"relative overflow-hidden",feature:"bg-white dark:bg-gray-800",cta:"relative overflow-hidden",testimonial:"bg-gray-50 dark:bg-gray-900",footer:"bg-white dark:bg-gray-800 border-gray-200 dark:border-gray-700 border-t"},spacing:{none:"",xs:"py-2",sm:"py-3",md:"py-4",lg:"py-6",xl:"py-8","2xl":"py-12","3xl":"py-16","4xl":"py-20","5xl":"py-24"},background:{none:"bg-transparent",default:"bg-gray-50 dark:bg-gray-900",surface:"bg-white dark:bg-gray-800",gradient:"bg-gradient-to-br from-gray-50 via-blue-50 to-purple-50 dark:from-gray-900 dark:via-blue-900/50 dark:to-purple-900/50","gradient-primary":"bg-gradient-to-br from-blue-50 to-indigo-100 dark:from-blue-900/50 dark:to-indigo-900/50","gradient-secondary":"bg-gradient-to-br from-green-50 to-blue-100 dark:from-green-900/50 dark:to-blue-900/50","gradient-tertiary":"bg-gradient-to-r from-emerald-50 to-teal-50 dark:from-gray-800 dark:to-gray-900","gradient-vibrant":"bg-gradient-to-br from-blue-800 to-purple-800 dark:from-blue-900 dark:to-purple-900"}},defaultVariants:{variant:"default",spacing:"3xl",background:"none"}}),Sm={sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg",xl:"max-w-xl","2xl":"max-w-2xl","3xl":"max-w-3xl","4xl":"max-w-4xl","5xl":"max-w-5xl","6xl":"max-w-6xl","7xl":"max-w-7xl",full:"max-w-full"},xr=({children:e,variant:t="default",spacing:r="3xl",background:n="none",maxWidth:o="7xl",className:a,containerClassName:i,as:s="section",id:l,fullWidth:c=!1})=>{const f=c?e:S.jsx("div",{className:Q(Sm[o],"mx-auto px-4 sm:px-6 lg:px-8",i),children:e});return K.createElement(s,{id:l,className:Q(Em({variant:t,spacing:r,background:n}),a)},f)},ee={typography:{family:{body:"font-sans"},weight:{body:"font-normal",emphasis:"font-medium"},decoration:{none:"no-underline",underline:"underline"},underlineOffset:{medium:"underline-offset-2"}}},Mt={link:{default:()=>`${ee.typography.decoration.underline} ${ee.typography.underlineOffset.medium} text-blue-600 dark:text-blue-400 hover:text-blue-700 dark:hover:text-blue-300 transition-colors duration-150`,subtle:()=>`${ee.typography.decoration.none} text-blue-600 dark:text-blue-400 hover:text-blue-700 dark:hover:text-blue-300 hover:${ee.typography.decoration.underline} hover:${ee.typography.underlineOffset.medium} transition-all duration-150`,muted:()=>`${ee.typography.decoration.underline} ${ee.typography.underlineOffset.medium} text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-gray-100 transition-colors duration-150`,external:()=>`${ee.typography.decoration.underline} ${ee.typography.underlineOffset.medium} text-blue-600 dark:text-blue-400 hover:text-blue-700 dark:hover:text-blue-300 transition-colors duration-150 inline-flex items-center gap-1`},label:{default:()=>`${ee.typography.family.body} text-sm ${ee.typography.weight.emphasis} text-gray-900 dark:text-white`,required:()=>`${ee.typography.family.body} text-sm ${ee.typography.weight.emphasis} text-gray-900 dark:text-white after:content-['*'] after:ml-0.5 after:text-red-500`,optional:()=>`${ee.typography.family.body} text-sm ${ee.typography.weight.body} text-gray-600 dark:text-gray-400`,helper:()=>`${ee.typography.family.body} text-sm ${ee.typography.weight.body} text-gray-500 dark:text-gray-500`,error:()=>`${ee.typography.family.body} text-sm ${ee.typography.weight.body} text-red-600 dark:text-red-400`,success:()=>`${ee.typography.family.body} text-sm ${ee.typography.weight.body} text-green-600 dark:text-green-400`}},de={button:{primary:{default:()=>"bg-blue-600 text-white hover:bg-blue-700 active:bg-blue-800 border-transparent focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2 disabled:opacity-50 disabled:cursor-not-allowed dark:bg-blue-600 dark:hover:bg-blue-700 dark:active:bg-blue-800 dark:text-white dark:focus-visible:ring-blue-400 inline-flex items-center justify-center rounded-md px-4 py-2 text-sm font-medium transition-colors duration-200",small:()=>"bg-blue-600 text-white hover:bg-blue-700 active:bg-blue-800 border border-transparent focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2 disabled:opacity-50 disabled:cursor-not-allowed dark:bg-blue-600 dark:hover:bg-blue-700 dark:active:bg-blue-800 dark:text-white dark:focus-visible:ring-blue-400 inline-flex items-center justify-center rounded-md px-3 py-1.5 text-xs font-medium transition-colors duration-200 h-8",large:()=>"bg-blue-600 text-white hover:bg-blue-700 active:bg-blue-800 border-transparent focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2 disabled:opacity-50 disabled:cursor-not-allowed dark:bg-blue-600 dark:hover:bg-blue-700 dark:active:bg-blue-800 dark:text-white dark:focus-visible:ring-blue-400 inline-flex items-center justify-center rounded-md px-6 py-3 text-base font-medium transition-colors duration-200 h-12",withIcon:()=>"bg-blue-600 text-white hover:bg-blue-700 active:bg-blue-800 border-transparent focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2 disabled:opacity-50 disabled:cursor-not-allowed dark:bg-blue-600 dark:hover:bg-blue-700 dark:active:bg-blue-800 dark:text-white dark:focus-visible:ring-blue-400 inline-flex items-center justify-center gap-2 rounded-md px-4 py-2 text-sm font-medium transition-colors duration-200",fullWidth:()=>"bg-blue-600 text-white hover:bg-blue-700 active:bg-blue-800 border-transparent focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2 disabled:opacity-50 disabled:cursor-not-allowed dark:bg-blue-600 dark:hover:bg-blue-700 dark:active:bg-blue-800 dark:text-white dark:focus-visible:ring-blue-400 flex items-center justify-center w-full rounded-md px-4 py-2 text-sm font-medium transition-colors duration-200"},secondary:{default:()=>"bg-gray-100 text-gray-900 hover:bg-gray-200 active:bg-gray-300 border-transparent focus-visible:ring-2 focus-visible:ring-gray-500 focus-visible:ring-offset-2 disabled:opacity-50 disabled:cursor-not-allowed dark:bg-gray-800 dark:text-gray-50 dark:hover:bg-gray-700 dark:active:bg-gray-600 inline-flex items-center justify-center rounded-md px-4 py-2 text-sm font-medium transition-colors duration-200",small:()=>"bg-gray-100 text-gray-900 hover:bg-gray-200 active:bg-gray-300 border-transparent focus-visible:ring-2 focus-visible:ring-gray-500 focus-visible:ring-offset-2 disabled:opacity-50 disabled:cursor-not-allowed dark:bg-gray-800 dark:text-gray-50 dark:hover:bg-gray-700 dark:active:bg-gray-600 inline-flex items-center justify-center rounded-md px-3 py-1.5 text-xs font-medium transition-colors duration-200 h-8",large:()=>"bg-gray-100 text-gray-900 hover:bg-gray-200 active:bg-gray-300 border-transparent focus-visible:ring-2 focus-visible:ring-gray-500 focus-visible:ring-offset-2 disabled:opacity-50 disabled:cursor-not-allowed dark:bg-gray-800 dark:text-gray-50 dark:hover:bg-gray-700 dark:active:bg-gray-600 inline-flex items-center justify-center rounded-md px-6 py-3 text-base font-medium transition-colors duration-200 h-12",withIcon:()=>"bg-gray-100 text-gray-900 hover:bg-gray-200 active:bg-gray-300 border-transparent focus-visible:ring-2 focus-visible:ring-gray-500 focus-visible:ring-offset-2 disabled:opacity-50 disabled:cursor-not-allowed dark:bg-gray-800 dark:text-gray-50 dark:hover:bg-gray-700 dark:active:bg-gray-600 inline-flex items-center justify-center gap-2 rounded-md px-4 py-2 text-sm font-medium transition-colors duration-200"},outline:{default:()=>"bg-transparent hover:bg-gray-50 active:bg-gray-100 text-gray-900 border border-gray-300 focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2 disabled:opacity-50 disabled:cursor-not-allowed dark:bg-transparent dark:hover:bg-gray-800 dark:active:bg-gray-700 dark:text-gray-50 dark:border-gray-600 inline-flex items-center justify-center rounded-md px-4 py-2 text-sm font-medium transition-colors duration-200",small:()=>"bg-transparent hover:bg-gray-50 active:bg-gray-100 text-gray-900 border border-gray-300 focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2 disabled:opacity-50 disabled:cursor-not-allowed dark:bg-transparent dark:hover:bg-gray-800 dark:active:bg-gray-700 dark:text-gray-50 dark:border-gray-600 inline-flex items-center justify-center rounded-md px-3 py-1.5 text-xs font-medium transition-colors duration-200 h-8",large:()=>"bg-transparent hover:bg-gray-50 active:bg-gray-100 text-gray-900 border border-gray-300 focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2 disabled:opacity-50 disabled:cursor-not-allowed dark:bg-transparent dark:hover:bg-gray-800 dark:active:bg-gray-700 dark:text-gray-50 dark:border-gray-600 inline-flex items-center justify-center rounded-md px-6 py-3 text-base font-medium transition-colors duration-200 h-12",withIcon:()=>"bg-transparent hover:bg-gray-50 active:bg-gray-100 text-gray-900 border border-gray-300 focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2 disabled:opacity-50 disabled:cursor-not-allowed dark:bg-transparent dark:hover:bg-gray-800 dark:active:bg-gray-700 dark:text-gray-50 dark:border-gray-600 inline-flex items-center justify-center gap-2 rounded-md px-4 py-2 text-sm font-medium transition-colors duration-200"},destructive:{default:()=>"bg-red-600 text-white hover:bg-red-700 active:bg-red-800 border-transparent focus-visible:ring-2 focus-visible:ring-red-500 focus-visible:ring-offset-2 disabled:opacity-50 disabled:cursor-not-allowed dark:bg-red-600 dark:hover:bg-red-700 dark:active:bg-red-800 dark:text-white inline-flex items-center justify-center rounded-md px-4 py-2 text-sm font-medium transition-colors duration-200",outline:()=>"bg-transparent hover:bg-red-50 active:bg-red-100 text-red-600 border border-red-300 focus-visible:ring-2 focus-visible:ring-red-500 focus-visible:ring-offset-2 disabled:opacity-50 disabled:cursor-not-allowed dark:hover:bg-red-900/20 dark:text-red-400 dark:border-red-800 inline-flex items-center justify-center rounded-md px-4 py-2 text-sm font-medium transition-colors duration-200",small:()=>"bg-red-600 text-white hover:bg-red-700 active:bg-red-800 border-transparent focus-visible:ring-2 focus-visible:ring-red-500 focus-visible:ring-offset-2 disabled:opacity-50 disabled:cursor-not-allowed dark:bg-red-600 dark:hover:bg-red-700 dark:active:bg-red-800 dark:text-white inline-flex items-center justify-center rounded-md px-3 py-1.5 text-xs font-medium transition-colors duration-200 h-8"},ghost:{default:()=>"bg-transparent hover:bg-gray-100 active:bg-gray-200 text-gray-700 border-transparent focus-visible:ring-2 focus-visible:ring-gray-500 focus-visible:ring-offset-2 disabled:opacity-50 disabled:cursor-not-allowed dark:bg-transparent dark:hover:bg-gray-800 dark:active:bg-gray-700 dark:text-gray-300 inline-flex items-center justify-center rounded-md px-4 py-2 text-sm font-medium transition-colors duration-200",small:()=>"bg-transparent hover:bg-gray-100 active:bg-gray-200 text-gray-700 border-transparent focus-visible:ring-2 focus-visible:ring-gray-500 focus-visible:ring-offset-2 disabled:opacity-50 disabled:cursor-not-allowed dark:bg-transparent dark:hover:bg-gray-800 dark:active:bg-gray-700 dark:text-gray-300 inline-flex items-center justify-center rounded-md px-2 py-1 text-xs font-medium transition-colors duration-200 h-8",icon:()=>"bg-transparent hover:bg-gray-100 active:bg-gray-200 text-gray-700 border-transparent focus-visible:ring-2 focus-visible:ring-gray-500 focus-visible:ring-offset-2 disabled:opacity-50 disabled:cursor-not-allowed dark:bg-transparent dark:hover:bg-gray-800 dark:active:bg-gray-700 dark:text-gray-300 inline-flex items-center justify-center rounded-md p-2 transition-colors duration-200 h-10 w-10"},link:{default:()=>"bg-transparent hover:bg-transparent active:bg-transparent text-blue-600 border-transparent underline-offset-4 hover:underline focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2 disabled:opacity-50 disabled:cursor-not-allowed disabled:no-underline dark:text-blue-400 inline-flex items-center justify-center rounded-md px-0 py-0 text-sm font-medium transition-colors duration-200",muted:()=>"bg-transparent hover:bg-transparent active:bg-transparent text-gray-600 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-300 border-transparent underline-offset-4 hover:underline focus-visible:ring-2 focus-visible:ring-gray-500 focus-visible:ring-offset-2 disabled:opacity-50 disabled:cursor-not-allowed disabled:no-underline inline-flex items-center justify-center rounded-md px-0 py-0 text-sm font-medium transition-colors duration-200"},gradient:{primary:()=>"bg-gradient-to-r from-blue-600 to-purple-600 hover:from-blue-700 hover:to-purple-700 text-white border-transparent shadow-lg hover:shadow-xl focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2 disabled:opacity-50 disabled:cursor-not-allowed inline-flex items-center justify-center rounded-md px-4 py-2 text-sm font-medium transition-all duration-200",secondary:()=>"bg-gradient-to-r from-gray-100 to-gray-200 hover:from-gray-200 hover:to-gray-300 text-gray-900 border-transparent focus-visible:ring-2 focus-visible:ring-gray-500 focus-visible:ring-offset-2 disabled:opacity-50 disabled:cursor-not-allowed inline-flex items-center justify-center rounded-md px-4 py-2 text-sm font-medium transition-all duration-200",success:()=>"bg-gradient-to-r from-green-500 to-emerald-600 hover:from-green-600 hover:to-emerald-700 text-white border-transparent shadow-lg hover:shadow-xl focus-visible:ring-2 focus-visible:ring-green-500 focus-visible:ring-offset-2 disabled:opacity-50 disabled:cursor-not-allowed inline-flex items-center justify-center rounded-md px-4 py-2 text-sm font-medium transition-all duration-200"},web3:{wallet:()=>"bg-white dark:bg-gray-800 border border-gray-300 dark:border-gray-600 hover:bg-gray-50 dark:hover:bg-gray-700 text-gray-900 dark:text-gray-100 focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2 disabled:opacity-50 disabled:cursor-not-allowed inline-flex items-center justify-center gap-2 rounded-md px-4 py-2 text-sm font-medium transition-colors duration-200",connect:()=>"bg-gradient-to-r from-blue-600 to-purple-600 hover:from-blue-700 hover:to-purple-700 text-white border-transparent shadow-lg hover:shadow-xl focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2 disabled:opacity-50 disabled:cursor-not-allowed inline-flex items-center justify-center gap-2 rounded-md px-4 py-2 text-sm font-medium transition-all duration-200",disconnect:()=>"bg-transparent hover:bg-red-50 active:bg-red-100 text-red-600 border border-red-300 focus-visible:ring-2 focus-visible:ring-red-500 focus-visible:ring-offset-2 disabled:opacity-50 disabled:cursor-not-allowed dark:hover:bg-red-900/20 dark:text-red-400 dark:border-red-800 inline-flex items-center justify-center gap-2 rounded-md px-4 py-2 text-sm font-medium transition-colors duration-200"}},input:{default:()=>"bg-gray-50 dark:bg-gray-800 border-gray-300 dark:border-gray-600 text-gray-900 dark:text-gray-100 focus:border-blue-500 focus:ring-blue-500 dark:focus:border-blue-400 dark:focus:ring-blue-400 block w-full rounded-md px-3 py-2 text-sm placeholder:text-gray-500 dark:placeholder:text-gray-400 transition-colors duration-200 focus:outline-none focus:ring-2 focus:ring-offset-2",search:()=>"bg-gray-50 dark:bg-gray-800 border-gray-300 dark:border-gray-600 text-gray-900 dark:text-gray-100 focus:border-blue-500 focus:ring-blue-500 dark:focus:border-blue-400 dark:focus:ring-blue-400 block w-full rounded-md px-3 py-2 text-sm placeholder:text-gray-500 dark:placeholder:text-gray-400 transition-colors duration-200 focus:outline-none focus:ring-2 focus:ring-offset-2",error:()=>"bg-gray-50 dark:bg-gray-800 border-red-300 dark:border-red-700 text-gray-900 dark:text-gray-100 focus:border-red-500 focus:ring-red-500 block w-full rounded-md px-3 py-2 text-sm placeholder:text-gray-500 dark:placeholder:text-gray-400 transition-colors duration-200 focus:outline-none focus:ring-2 focus:ring-offset-2",small:()=>"bg-gray-50 dark:bg-gray-800 border-gray-300 dark:border-gray-600 text-gray-900 dark:text-gray-100 focus:border-blue-500 focus:ring-blue-500 dark:focus:border-blue-400 dark:focus:ring-blue-400 block w-full rounded-md px-2 py-1.5 text-xs placeholder:text-gray-500 dark:placeholder:text-gray-400 transition-colors duration-200 focus:outline-none focus:ring-2 focus:ring-offset-2",large:()=>"bg-gray-50 dark:bg-gray-800 border-gray-300 dark:border-gray-600 text-gray-900 dark:text-gray-100 focus:border-blue-500 focus:ring-blue-500 dark:focus:border-blue-400 dark:focus:ring-blue-400 block w-full rounded-md px-4 py-3 text-base placeholder:text-gray-500 dark:placeholder:text-gray-400 transition-colors duration-200 focus:outline-none focus:ring-2 focus:ring-offset-2",withIcon:()=>"bg-gray-50 dark:bg-gray-800 border-gray-300 dark:border-gray-600 text-gray-900 dark:text-gray-100 focus:border-blue-500 focus:ring-blue-500 dark:focus:border-blue-400 dark:focus:ring-blue-400 block w-full rounded-md pl-10 pr-3 py-2 text-sm placeholder:text-gray-500 dark:placeholder:text-gray-400 transition-colors duration-200 focus:outline-none focus:ring-2 focus:ring-offset-2"},navigation:{tabs:{root:()=>"",list:()=>"inline-flex h-10 items-center justify-center rounded-md bg-gray-100 dark:bg-gray-800 p-1 text-gray-500 dark:text-gray-400",listUnderlined:()=>"flex border-b border-gray-200 dark:border-gray-700",listPills:()=>"flex space-x-1 bg-gray-100 dark:bg-gray-800 rounded-lg p-1",trigger:()=>"inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-white transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-white data-[state=active]:text-gray-950 data-[state=active]:shadow-sm dark:ring-offset-gray-950 dark:focus-visible:ring-blue-400 dark:data-[state=active]:bg-gray-950 dark:data-[state=active]:text-gray-50",triggerUnderlined:()=>"inline-flex items-center justify-center whitespace-nowrap px-4 py-2 text-sm font-medium text-gray-500 dark:text-gray-400 border-b-2 border-transparent hover:text-gray-700 dark:hover:text-gray-300 hover:border-gray-300 dark:hover:border-gray-600 focus:outline-none focus:text-blue-600 focus:border-blue-600 dark:focus:text-blue-400 dark:focus:border-blue-400 data-[state=active]:text-blue-600 data-[state=active]:border-blue-600 dark:data-[state=active]:text-blue-400 dark:data-[state=active]:border-blue-400 transition-colors",triggerPills:()=>"inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1.5 text-sm font-medium text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-gray-100 hover:bg-white dark:hover:bg-gray-700 focus:outline-none focus:ring-2 focus:ring-blue-500 data-[state=active]:bg-white data-[state=active]:text-gray-900 data-[state=active]:shadow-sm dark:data-[state=active]:bg-gray-700 dark:data-[state=active]:text-gray-100 transition-all",content:()=>"mt-2 ring-offset-white focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2 dark:ring-offset-gray-950 dark:focus-visible:ring-blue-400"}},overlays:{dropdown:{container:()=>"relative inline-block",trigger:()=>"inline-flex justify-center items-center bg-transparent border-0 text-gray-900 dark:text-gray-100 focus:outline-none transition-colors",triggerBordered:()=>"inline-flex justify-center items-center bg-white dark:bg-gray-800 border border-gray-300 dark:border-gray-600 text-gray-900 dark:text-gray-100 hover:bg-gray-50 dark:hover:bg-gray-700 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 dark:ring-offset-gray-950 transition-colors",menu:()=>"absolute z-50 w-56 bg-white dark:bg-gray-800 rounded-md shadow-lg focus:outline-none transition-all duration-200",menuSmall:()=>"w-40",menuLarge:()=>"w-72",menuAuto:()=>"w-auto min-w-40",menuTop:()=>"bottom-full mb-1",menuBottom:()=>"top-full mt-1",menuLeft:()=>"right-0",menuRight:()=>"left-0",menuEntering:()=>"opacity-0 scale-95 transform origin-top",menuEntered:()=>"opacity-100 scale-100 transform origin-top",menuExiting:()=>"opacity-0 scale-95 transform origin-top",itemContainer:()=>"py-1 px-1",item:()=>"flex items-center w-full text-left px-4 py-2 text-sm text-gray-700 dark:text-gray-300 hover:bg-blue-50 dark:hover:bg-blue-900/20 hover:text-blue-700 dark:hover:text-blue-300 transition-all duration-200 cursor-pointer hover:shadow-sm rounded-sm",itemActive:()=>"bg-blue-100 dark:bg-blue-900/30 text-blue-700 dark:text-blue-300 shadow-sm",itemDisabled:()=>"text-gray-400 dark:text-gray-600 cursor-not-allowed hover:bg-transparent hover:text-gray-400 dark:hover:text-gray-600",divider:()=>"my-1 border-t border-gray-200 dark:border-gray-700",header:()=>"px-4 py-2 text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wide",itemIcon:()=>"mr-3 h-4 w-4 flex-shrink-0",itemIconRight:()=>"ml-auto h-4 w-4 flex-shrink-0"}}};K.createContext(null);var yt={},vt={},Bi={},zi;function xm(){return zi||(zi=1,Object.defineProperty(Bi,"__esModule",{value:!0})),Bi}var Hi={},R={},Gi;function wt(){if(Gi)return R;Gi=1,Object.defineProperty(R,"__esModule",{value:!0}),R.Currency=R.ErrorType=R.FeatureFlag=R.EmailValidationState=R.PlatformType=R.ConnectionState=R.ConnectionType=R.EmailSortCriteria=R.SortOrder=R.EmailAddressType=R.InfoType=R.NotificationType=R.RequestStatus=R.SubscriptionAction=R.EmailAction=R.MediumView=R.MobileView=R.EmailComposeType=R.FontSize=R.Theme=R.Chain=R.ChainType=R.AuthStatus=void 0;var e;(function(b){b.CONNECTED="connected",b.DISCONNECTED="disconnected",b.VERIFIED="verified"})(e||(R.AuthStatus=e={}));var t;(function(b){b.EVM="evm",b.SOLANA="solana"})(t||(R.ChainType=t={}));var r;(function(b){b.ETH_MAINNET="eth-mainnet",b.ETH_SEPOLIA="eth-sepolia",b.ETH_GOERLI="eth-goerli",b.POLYGON_MAINNET="polygon-mainnet",b.POLYGON_MUMBAI="polygon-mumbai",b.POLYGON_AMOY="polygon-amoy",b.OPTIMISM_MAINNET="optimism-mainnet",b.OPTIMISM_SEPOLIA="optimism-sepolia",b.OPTIMISM_GOERLI="optimism-goerli",b.ARBITRUM_MAINNET="arbitrum-mainnet",b.ARBITRUM_SEPOLIA="arbitrum-sepolia",b.ARBITRUM_GOERLI="arbitrum-goerli",b.BASE_MAINNET="base-mainnet",b.BASE_SEPOLIA="base-sepolia",b.BASE_GOERLI="base-goerli",b.AVALANCHE_MAINNET="avalanche-mainnet",b.AVALANCHE_FUJI="avalanche-fuji",b.BNB_MAINNET="bnb-mainnet",b.BNB_TESTNET="bnb-testnet",b.GNOSIS_MAINNET="gnosis-mainnet",b.GNOSIS_CHIADO="gnosis-chiado",b.CELO_MAINNET="celo-mainnet",b.CELO_ALFAJORES="celo-alfajores",b.ZKSYNC_MAINNET="zksync-mainnet",b.ZKSYNC_SEPOLIA="zksync-sepolia",b.LINEA_MAINNET="linea-mainnet",b.LINEA_SEPOLIA="linea-sepolia",b.SCROLL_MAINNET="scroll-mainnet",b.SCROLL_SEPOLIA="scroll-sepolia",b.MONAD_MAINNET="monad-mainnet",b.MONAD_TESTNET="monad-testnet",b.STORY_MAINNET="story-mainnet",b.STORY_TESTNET="story-testnet",b.PLUME_MAINNET="plume-mainnet",b.PLUME_TESTNET="plume-testnet",b.NEXUS_MAINNET="nexus-mainnet",b.NEXUS_TESTNET="nexus-testnet",b.HYPEREVM_MAINNET="hyperevm-mainnet",b.HYPEREVM_TESTNET="hyperevm-testnet",b.SONIC_MAINNET="sonic-mainnet",b.SONIC_TESTNET="sonic-testnet",b.SONIC_BLAZE="sonic-blaze",b.UNICHAIN_MAINNET="unichain-mainnet",b.UNICHAIN_SEPOLIA="unichain-sepolia",b.WORLD_MAINNET="world-mainnet",b.XDC_MAINNET="xdc-mainnet",b.INK_TESTNET="ink-testnet",b.FETCH_MAINNET="fetch-mainnet",b.FETCH_TESTNET="fetch-testnet",b.GENSYN_MAINNET="gensyn-mainnet",b.GENSYN_TESTNET="gensyn-testnet",b.RITUAL_MAINNET="ritual-mainnet",b.RITUAL_TESTNET="ritual-testnet",b.SOLANA_MAINNET="solana-mainnet",b.SOLANA_DEVNET="solana-devnet",b.SOLANA_TESTNET="solana-testnet",b.EVM_LOCAL="evm-local",b.SOLANA_LOCAL="solana-local"})(r||(R.Chain=r={}));var n;(function(b){b.LIGHT="light",b.DARK="dark",b.SYSTEM="system"})(n||(R.Theme=n={}));var o;(function(b){b.SMALL="small",b.MEDIUM="medium",b.LARGE="large"})(o||(R.FontSize=o={}));var a;(function(b){b.NEW="new",b.REPLY="reply",b.REPLY_ALL="replyAll",b.FORWARD="forward"})(a||(R.EmailComposeType=a={}));var i;(function(b){b.EMAIL_ADDRESSES="emailAddresses",b.FOLDERS="folders",b.EMAILS="emails",b.EMAIL_BODY="emailBody"})(i||(R.MobileView=i={}));var s;(function(b){b.LEFT="left",b.RIGHT="right"})(s||(R.MediumView=s={}));var l;(function(b){b.OPEN="open",b.REPLY="reply",b.FORWARD="forward",b.DELETE="delete",b.STAR="star",b.UNSTAR="unstar",b.MARK_READ="mark_read",b.MARK_UNREAD="mark_unread"})(l||(R.EmailAction=l={}));var c;(function(b){b.VIEW="view",b.PURCHASE="purchase",b.CANCEL="cancel",b.RESTORE="restore"})(c||(R.SubscriptionAction=c={}));var f;(function(b){b.IDLE="idle",b.LOADING="loading",b.SUCCESS="success",b.ERROR="error"})(f||(R.RequestStatus=f={}));var u;(function(b){b.INFO="info",b.SUCCESS="success",b.WARNING="warning",b.ERROR="error"})(u||(R.NotificationType=u={}));var p;(function(b){b.INFO="info",b.SUCCESS="success",b.WARNING="warning",b.ERROR="error"})(p||(R.InfoType=p={}));var h;(function(b){b.DIRECT="direct",b.ENS="ens",b.SNS="sns",b.CUSTOM="custom"})(h||(R.EmailAddressType=h={}));var y;(function(b){b.ASC="asc",b.DESC="desc"})(y||(R.SortOrder=y={}));var m;(function(b){b.DATE="date",b.SUBJECT="subject",b.FROM="from",b.SIZE="size"})(m||(R.EmailSortCriteria=m={}));var g;(function(b){b.UNKNOWN="unknown",b.NONE="none",b.WIFI="wifi",b.CELLULAR_2G="2g",b.CELLULAR_3G="3g",b.CELLULAR_4G="4g",b.CELLULAR_5G="5g",b.ETHERNET="ethernet"})(g||(R.ConnectionType=g={}));var w;(function(b){b.UNKNOWN="unknown",b.DISCONNECTED="disconnected",b.CONNECTING="connecting",b.CONNECTED="connected",b.RECONNECTING="reconnecting",b.VERIFIED="verified",b.LIMITED="limited",b.ERROR="error"})(w||(R.ConnectionState=w={}));var E;(function(b){b.WEB="web",b.REACT_NATIVE="react_native",b.DESKTOP="desktop"})(E||(R.PlatformType=E={}));var v;(function(b){b.VALID="valid",b.INVALID="invalid",b.PENDING="pending",b.UNKNOWN="unknown"})(v||(R.EmailValidationState=v={}));var x;(function(b){b.AI_SEARCH="ai_search",b.SMART_COMPOSE="smart_compose",b.ADVANCED_FILTERS="advanced_filters",b.DARK_MODE="dark_mode",b.NOTIFICATIONS="notifications",b.ANALYTICS="analytics"})(x||(R.FeatureFlag=x={}));var C;(function(b){b.NETWORK="network",b.AUTH="auth",b.VALIDATION="validation",b.PERMISSION="permission",b.UNKNOWN="unknown"})(C||(R.ErrorType=C={}));var O;return(function(b){b.USD="USD",b.EUR="EUR",b.GBP="GBP",b.CAD="CAD",b.AUD="AUD"})(O||(R.Currency=O={})),R}var Yi={},Ki;function Cm(){return Ki||(Ki=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getWalletConnectionState=e.isWalletVerified=e.isWalletConnected=void 0;const t=wt(),r=a=>a!=null&&!!a.walletAddress;e.isWalletConnected=r;const n=a=>(0,e.isWalletConnected)(a)&&!!a.message&&!!a.signature;e.isWalletVerified=n;const o=a=>(0,e.isWalletConnected)(a)?(0,e.isWalletVerified)(a)?t.ConnectionState.VERIFIED:t.ConnectionState.CONNECTED:t.ConnectionState.DISCONNECTED;e.getWalletConnectionState=o})(Yi)),Yi}var Xi;function Am(){return Xi||(Xi=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.isWalletVerified=e.isWalletConnected=e.getWalletConnectionState=e.Theme=e.SubscriptionAction=e.SortOrder=e.RequestStatus=e.PlatformType=e.NotificationType=e.MobileView=e.MediumView=e.InfoType=e.FontSize=e.FeatureFlag=e.ErrorType=e.EmailValidationState=e.EmailSortCriteria=e.EmailComposeType=e.EmailAddressType=e.EmailAction=e.Currency=e.ConnectionType=e.ConnectionState=e.ChainType=e.Chain=e.AuthStatus=void 0;var t=wt();Object.defineProperty(e,"AuthStatus",{enumerable:!0,get:function(){return t.AuthStatus}}),Object.defineProperty(e,"Chain",{enumerable:!0,get:function(){return t.Chain}}),Object.defineProperty(e,"ChainType",{enumerable:!0,get:function(){return t.ChainType}}),Object.defineProperty(e,"ConnectionState",{enumerable:!0,get:function(){return t.ConnectionState}}),Object.defineProperty(e,"ConnectionType",{enumerable:!0,get:function(){return t.ConnectionType}}),Object.defineProperty(e,"Currency",{enumerable:!0,get:function(){return t.Currency}}),Object.defineProperty(e,"EmailAction",{enumerable:!0,get:function(){return t.EmailAction}}),Object.defineProperty(e,"EmailAddressType",{enumerable:!0,get:function(){return t.EmailAddressType}}),Object.defineProperty(e,"EmailComposeType",{enumerable:!0,get:function(){return t.EmailComposeType}}),Object.defineProperty(e,"EmailSortCriteria",{enumerable:!0,get:function(){return t.EmailSortCriteria}}),Object.defineProperty(e,"EmailValidationState",{enumerable:!0,get:function(){return t.EmailValidationState}}),Object.defineProperty(e,"ErrorType",{enumerable:!0,get:function(){return t.ErrorType}}),Object.defineProperty(e,"FeatureFlag",{enumerable:!0,get:function(){return t.FeatureFlag}}),Object.defineProperty(e,"FontSize",{enumerable:!0,get:function(){return t.FontSize}}),Object.defineProperty(e,"InfoType",{enumerable:!0,get:function(){return t.InfoType}}),Object.defineProperty(e,"MediumView",{enumerable:!0,get:function(){return t.MediumView}}),Object.defineProperty(e,"MobileView",{enumerable:!0,get:function(){return t.MobileView}}),Object.defineProperty(e,"NotificationType",{enumerable:!0,get:function(){return t.NotificationType}}),Object.defineProperty(e,"PlatformType",{enumerable:!0,get:function(){return t.PlatformType}}),Object.defineProperty(e,"RequestStatus",{enumerable:!0,get:function(){return t.RequestStatus}}),Object.defineProperty(e,"SortOrder",{enumerable:!0,get:function(){return t.SortOrder}}),Object.defineProperty(e,"SubscriptionAction",{enumerable:!0,get:function(){return t.SubscriptionAction}}),Object.defineProperty(e,"Theme",{enumerable:!0,get:function(){return t.Theme}});var r=Cm();Object.defineProperty(e,"getWalletConnectionState",{enumerable:!0,get:function(){return r.getWalletConnectionState}}),Object.defineProperty(e,"isWalletConnected",{enumerable:!0,get:function(){return r.isWalletConnected}}),Object.defineProperty(e,"isWalletVerified",{enumerable:!0,get:function(){return r.isWalletVerified}})})(Hi)),Hi}var qi={},me={},Zi;function Sn(){if(Zi)return me;Zi=1,Object.defineProperty(me,"__esModule",{value:!0}),me.PROTOCOL_CONSTANTS=me.TransactionStatus=me.MessageType=void 0,me.isSolanaAddress=r,me.isEvmAddress=n,me.isSolanaRecipient=o,me.isEvmRecipient=a;var e;(function(i){i.STANDARD="standard",i.PRIORITY="priority",i.PREPARED_STANDARD="prepared_standard",i.PREPARED_PRIORITY="prepared_priority"})(e||(me.MessageType=e={}));var t;(function(i){i.SUCCESS="success",i.FAILED="failed",i.PENDING="pending"})(t||(me.TransactionStatus=t={}));function r(i){try{if(i.length<32||i.length>44||!/^[1-9A-HJ-NP-Za-km-z]+$/.test(i))return!1;try{return require("bs58").decode(i).length===32}catch{return!0}}catch{return!1}}function n(i){return/^0x[a-fA-F0-9]{40}$/.test(i)}function o(i){return r(i)}function a(i){return n(i)}return me.PROTOCOL_CONSTANTS={SEND_FEE:100000n,CLAIM_PERIOD:1440*60*60,REVENUE_SHARES:{SENDER:90,OWNER:10},USDC_DECIMALS:6,MAX_LENGTHS:{SUBJECT:200,BODY:2e3,MAIL_ID:100}},me}var Qe={},ge={},Ji;function Qi(){if(Ji)return ge;Ji=1,Object.defineProperty(ge,"__esModule",{value:!0}),ge.AddressType=void 0,ge.isENSName=n,ge.isSNSName=o,ge.getAddressType=a,ge.isValidWalletAddress=i,ge.isValidSignature=s,ge.parseEmailAddress=l,ge.formatWalletAddress=c,ge.getChainDisplayName=f;const e=wt(),t=Sn();var r;(function(u){u.EVMAddress="EVMAddress",u.SolanaAddress="SolanaAddress",u.ENSName="ENSName",u.SNSName="SNSName"})(r||(ge.AddressType=r={}));function n(u){const p=u.toLowerCase();if(!p.endsWith(".eth")&&!p.endsWith(".box"))return!1;const h=(p.endsWith(".eth"),p.slice(0,-4));if(h.length===0)return!1;const y=h.split("."),m=/^[a-z0-9]([a-z0-9-]*[a-z0-9])?$/;for(const g of y)if(g.length===0||!m.test(g)||g.includes("--"))return!1;return!0}function o(u){const p=u.toLowerCase(),h=[".sol",".abc",".bonk",".poor",".gm",".dao",".defi",".web3"].find(w=>p.endsWith(w));if(!h)return!1;const y=p.slice(0,-h.length);if(y.length===0)return!1;const m=y.split("."),g=/^[a-z0-9]([a-z0-9-]*[a-z0-9])?$/;for(const w of m)if(w.length===0||!g.test(w)||w.includes("--"))return!1;return!0}function a(u,p=void 0){if((0,t.isEvmAddress)(u))return r.EVMAddress;if((0,t.isSolanaAddress)(u))return r.SolanaAddress;if(p&&u.includes(".")){if(p===r.EVMAddress)return r.ENSName;if(p===r.SolanaAddress)return r.SNSName}}function i(u,p){if(!u||typeof u!="string")return!1;const h=a(u);switch(p){case e.ChainType.EVM:return h===r.EVMAddress||h===r.ENSName;case e.ChainType.SOLANA:return h===r.SolanaAddress||h===r.SNSName;default:return!!h}}function s(u,p){if(!u||typeof u!="string")return!1;switch(p){case e.ChainType.EVM:return/^0x[a-fA-F0-9]{130}$/.test(u);case e.ChainType.SOLANA:return/^[1-9A-HJ-NP-Za-km-z]{87,88}$/.test(u);default:return u.length>50}}function l(u){if(!u||typeof u!="string")return;const p=u.split("@");if(p.length!==2)return;const[h,y]=p;if(!h||!y)return;const m=a(h);return{address:h,domain:y,type:m}}function c(u){if(!u||u.length<10)return u;const p=a(u);return(p===r.ENSName||p===r.SNSName)&&u.length<=20?u:`${u.slice(0,6)}...${u.slice(-4)}`}function f(u){if(!u)return"Unknown Chain";switch(u){case e.ChainType.EVM:return"EVM Chain";case e.ChainType.SOLANA:return"Solana";default:return"Blockchain"}}return ge}var es;function Tm(){if(es)return Qe;es=1,Object.defineProperty(Qe,"__esModule",{value:!0}),Qe.validateDomain=t,Qe.validateMessage=r,Qe.validateAddress=n,Qe.validateAmount=o;const e=Qi();function t(a){if(!a||a.length===0)throw new Error("Domain cannot be empty");if(a.length>100)throw new Error("Domain cannot exceed 100 characters");if(!/^[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(\.[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/.test(a))throw new Error("Invalid domain format");return!0}function r(a,i){if(!a||a.length===0)throw new Error("Message subject cannot be empty");if(a.length>200)throw new Error("Message subject cannot exceed 200 characters");if(!i||i.length===0)throw new Error("Message body cannot be empty");if(i.length>1e4)throw new Error("Message body cannot exceed 10000 characters");return!0}function n(a,i){if(!a||a.length===0)throw new Error("Address cannot be empty");if(!(0,e.isValidWalletAddress)(a,i))throw new Error(`Invalid ${i} address format`);return!0}function o(a){if(a==null||a===""||typeof a=="string"&&a.trim()==="")throw new Error("Invalid amount format");let i;try{if(typeof a=="string"){if(!/^-?\d+$/.test(a.trim()))throw new Error("Invalid amount format");i=BigInt(a)}else if(typeof a=="number"){if(!Number.isFinite(a))throw new Error("Invalid amount format");i=BigInt(Math.floor(a))}else if(typeof a=="bigint")i=a;else throw new Error("Invalid amount format")}catch{throw new Error("Invalid amount format")}if(i<0n)throw new Error("Amount cannot be negative");return i}return Qe}var ts;function Om(){return ts||(ts=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.validateMessage=e.validateDomain=e.validateAmount=e.validateAddress=e.isSolanaRecipient=e.isSolanaAddress=e.isEvmRecipient=e.isEvmAddress=e.TransactionStatus=e.PROTOCOL_CONSTANTS=e.MessageType=void 0;var t=Sn();Object.defineProperty(e,"MessageType",{enumerable:!0,get:function(){return t.MessageType}}),Object.defineProperty(e,"PROTOCOL_CONSTANTS",{enumerable:!0,get:function(){return t.PROTOCOL_CONSTANTS}}),Object.defineProperty(e,"TransactionStatus",{enumerable:!0,get:function(){return t.TransactionStatus}}),Object.defineProperty(e,"isEvmAddress",{enumerable:!0,get:function(){return t.isEvmAddress}}),Object.defineProperty(e,"isEvmRecipient",{enumerable:!0,get:function(){return t.isEvmRecipient}}),Object.defineProperty(e,"isSolanaAddress",{enumerable:!0,get:function(){return t.isSolanaAddress}}),Object.defineProperty(e,"isSolanaRecipient",{enumerable:!0,get:function(){return t.isSolanaRecipient}});var r=Tm();Object.defineProperty(e,"validateAddress",{enumerable:!0,get:function(){return r.validateAddress}}),Object.defineProperty(e,"validateAmount",{enumerable:!0,get:function(){return r.validateAmount}}),Object.defineProperty(e,"validateDomain",{enumerable:!0,get:function(){return r.validateDomain}}),Object.defineProperty(e,"validateMessage",{enumerable:!0,get:function(){return r.validateMessage}})})(qi)),qi}var rs={},Lt={},ns;function Pm(){if(ns)return Lt;ns=1,Object.defineProperty(Lt,"__esModule",{value:!0}),Lt.StorageType=void 0;var e;return(function(t){t.LOCAL_STORAGE="localStorage",t.SESSION_STORAGE="sessionStorage",t.ASYNC_STORAGE="asyncStorage",t.MEMORY="memory"})(e||(Lt.StorageType=e={})),Lt}var os;function Nm(){return os||(os=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.StorageType=void 0;var t=Pm();Object.defineProperty(e,"StorageType",{enumerable:!0,get:function(){return t.StorageType}})})(rs)),rs}var as={},et={},is;function Im(){if(is)return et;is=1,Object.defineProperty(et,"__esModule",{value:!0}),et.AnalyticsEventBuilder=et.AnalyticsEvent=void 0;var e;(function(r){r.USER_LOGIN="user_login",r.USER_LOGOUT="user_logout",r.USER_SIGNUP="user_signup",r.EMAIL_SENT="email_sent",r.EMAIL_RECEIVED="email_received",r.EMAIL_OPENED="email_opened",r.EMAIL_REPLY="email_reply",r.EMAIL_FORWARD="email_forward",r.EMAIL_DELETE="email_delete",r.EMAIL_STAR="email_star",r.EMAIL_COMPOSE="email_compose",r.EMAIL_CLICKED="email_clicked",r.PAGE_VIEW="page_view",r.SCREEN_VIEW="screen_view",r.FOLDER_SWITCH="folder_switch",r.SUBSCRIPTION_VIEW="subscription_view",r.SUBSCRIPTION_PURCHASE="subscription_purchase",r.SUBSCRIPTION_CANCEL="subscription_cancel",r.SEARCH_PERFORMED="search_performed",r.SETTINGS_CHANGED="settings_changed",r.ERROR_OCCURRED="error_occurred",r.AB_TEST_VIEWED="ab_test_viewed",r.AB_TEST_CONVERTED="ab_test_converted",r.CUSTOM_EVENT="custom_event"})(e||(et.AnalyticsEvent=e={}));class t{static emailAction(n,o,a){return{action:n,email_id:o,folder:a,timestamp:Date.now()}}static pageView(n,o){return{page_name:n,page_path:o,timestamp:Date.now()}}static error(n,o,a){return{error_type:n,error_message:o,page_name:a,timestamp:Date.now()}}static subscription(n,o,a,i){return{action:n,plan_type:o,amount:a,currency:i,timestamp:Date.now()}}static engagement(n,o,a){return{feature:n,interaction:o,duration:a,timestamp:Date.now()}}static performance(n,o,a){return{metric:n,value:o,context:a,timestamp:Date.now()}}}return et.AnalyticsEventBuilder=t,et}var ss={},ls;function Rm(){return ls||(ls=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ProcessedEventName=e.ContractType=e.ChainType=void 0;var t=wt();Object.defineProperty(e,"ChainType",{enumerable:!0,get:function(){return t.ChainType}});var r;(function(o){o.Mailer="Mailer",o.MailService="MailService"})(r||(e.ContractType=r={}));var n;(function(o){o.MailSent="MailSent",o.PreparedMailSent="PreparedMailSent",o.DelegationSet="DelegationSet",o.DelegationCleared="DelegationCleared",o.DomainRegistered="DomainRegistered",o.DomainExtended="DomainExtended",o.DomainReleased="DomainReleased",o.FeeUpdated="FeeUpdated",o.SharesRecorded="SharesRecorded",o.RecipientClaimed="RecipientClaimed",o.OwnerClaimed="OwnerClaimed",o.ExpiredSharesClaimed="ExpiredSharesClaimed"})(n||(e.ProcessedEventName=n={}))})(ss)),ss}var Dt={},cs;function km(){if(cs)return Dt;cs=1,Object.defineProperty(Dt,"__esModule",{value:!0}),Dt.NetworkError=void 0;class e extends Error{constructor(r,n,o,a){super(r),this.name="NetworkError",this.status=n,this.statusText=o,this.response=a}}return Dt.NetworkError=e,Dt}var jt={},us;function _m(){if(us)return jt;us=1,Object.defineProperty(jt,"__esModule",{value:!0}),jt.WalletType=void 0;var e;return(function(t){t.METAMASK="metamask",t.PHANTOM="phantom",t.COINBASE="coinbase",t.WALLETCONNECT="walletconnect",t.INJECTED="injected"})(e||(jt.WalletType=e={})),jt}var ds;function Mm(){return ds||(ds=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.WalletType=e.NetworkError=e.ProcessedEventName=e.ContractType=e.ChainType=e.AnalyticsEventBuilder=e.AnalyticsEvent=void 0;var t=Im();Object.defineProperty(e,"AnalyticsEvent",{enumerable:!0,get:function(){return t.AnalyticsEvent}}),Object.defineProperty(e,"AnalyticsEventBuilder",{enumerable:!0,get:function(){return t.AnalyticsEventBuilder}});var r=Rm();Object.defineProperty(e,"ChainType",{enumerable:!0,get:function(){return r.ChainType}}),Object.defineProperty(e,"ContractType",{enumerable:!0,get:function(){return r.ContractType}}),Object.defineProperty(e,"ProcessedEventName",{enumerable:!0,get:function(){return r.ProcessedEventName}});var n=km();Object.defineProperty(e,"NetworkError",{enumerable:!0,get:function(){return n.NetworkError}});var o=_m();Object.defineProperty(e,"WalletType",{enumerable:!0,get:function(){return o.WalletType}})})(as)),as}var Et={},Ft={},fs;function Lm(){if(fs)return Ft;fs=1,Object.defineProperty(Ft,"__esModule",{value:!0}),Ft.RateLimitPeriodType=void 0;var e;return(function(t){t.HOUR="hour",t.DAY="day",t.MONTH="month"})(e||(Ft.RateLimitPeriodType=e={})),Ft}var ps;function Dm(){return ps||(ps=1,(function(e){var t=Et&&Et.__createBinding||(Object.create?(function(n,o,a,i){i===void 0&&(i=a);var s=Object.getOwnPropertyDescriptor(o,a);(!s||("get"in s?!o.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return o[a]}}),Object.defineProperty(n,i,s)}):(function(n,o,a,i){i===void 0&&(i=a),n[i]=o[a]})),r=Et&&Et.__exportStar||function(n,o){for(var a in n)a!=="default"&&!Object.prototype.hasOwnProperty.call(o,a)&&t(o,n,a)};Object.defineProperty(e,"__esModule",{value:!0}),r(Lm(),e)})(Et)),Et}var St={},$e={},ms;function gs(){if(ms)return $e;ms=1,Object.defineProperty($e,"__esModule",{value:!0}),$e.InvitationStatus=$e.EntityRole=$e.EntityType=void 0;var e;(function(n){n.PERSONAL="personal",n.ORGANIZATION="organization"})(e||($e.EntityType=e={}));var t;(function(n){n.OWNER="owner",n.ADMIN="admin",n.MEMBER="member"})(t||($e.EntityRole=t={}));var r;return(function(n){n.PENDING="pending",n.ACCEPTED="accepted",n.DECLINED="declined",n.EXPIRED="expired"})(r||($e.InvitationStatus=r={})),$e}var hs={},bs;function jm(){return bs||(bs=1,Object.defineProperty(hs,"__esModule",{value:!0})),hs}var ys={},vs;function Fm(){return vs||(vs=1,Object.defineProperty(ys,"__esModule",{value:!0})),ys}var ws={},Es;function $m(){return Es||(Es=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ROLE_PERMISSIONS=void 0,e.getPermissionsForRole=a,e.hasPermission=i;const t=gs(),r={canViewEntity:!0,canEditEntity:!0,canDeleteEntity:!0,canManageMembers:!0,canInviteMembers:!0,canManageProjects:!0,canCreateProjects:!0,canViewProjects:!0,canManageApiKeys:!0,canViewApiKeys:!0},n={canViewEntity:!0,canEditEntity:!0,canDeleteEntity:!1,canManageMembers:!1,canInviteMembers:!1,canManageProjects:!0,canCreateProjects:!0,canViewProjects:!0,canManageApiKeys:!0,canViewApiKeys:!0},o={canViewEntity:!0,canEditEntity:!1,canDeleteEntity:!1,canManageMembers:!1,canInviteMembers:!1,canManageProjects:!1,canCreateProjects:!1,canViewProjects:!0,canManageApiKeys:!1,canViewApiKeys:!0};e.ROLE_PERMISSIONS={[t.EntityRole.OWNER]:r,[t.EntityRole.ADMIN]:n,[t.EntityRole.MEMBER]:o};function a(s){return e.ROLE_PERMISSIONS[s]}function i(s,l){return e.ROLE_PERMISSIONS[s][l]}})(ws)),ws}var Ss;function Wm(){return Ss||(Ss=1,(function(e){var t=St&&St.__createBinding||(Object.create?(function(n,o,a,i){i===void 0&&(i=a);var s=Object.getOwnPropertyDescriptor(o,a);(!s||("get"in s?!o.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return o[a]}}),Object.defineProperty(n,i,s)}):(function(n,o,a,i){i===void 0&&(i=a),n[i]=o[a]})),r=St&&St.__exportStar||function(n,o){for(var a in n)a!=="default"&&!Object.prototype.hasOwnProperty.call(o,a)&&t(o,n,a)};Object.defineProperty(e,"__esModule",{value:!0}),r(gs(),e),r(jm(),e),r(Fm(),e),r($m(),e)})(St)),St}var xs;function Cs(){return xs||(xs=1,(function(e){var t=vt&&vt.__createBinding||(Object.create?(function(n,o,a,i){i===void 0&&(i=a);var s=Object.getOwnPropertyDescriptor(o,a);(!s||("get"in s?!o.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return o[a]}}),Object.defineProperty(n,i,s)}):(function(n,o,a,i){i===void 0&&(i=a),n[i]=o[a]})),r=vt&&vt.__exportStar||function(n,o){for(var a in n)a!=="default"&&!Object.prototype.hasOwnProperty.call(o,a)&&t(o,n,a)};Object.defineProperty(e,"__esModule",{value:!0}),r(xm(),e),r(Am(),e),r(Om(),e),r(Nm(),e),r(Mm(),e),r(Dm(),e),r(Wm(),e)})(vt)),vt}var xt={},As={},$t={},Ts;function Um(){if(Ts)return $t;Ts=1,Object.defineProperty($t,"__esModule",{value:!0}),$t.Web3UsernameValidator=void 0;const e=wt();class t{static validate(n){if(n){if(this.EVM_REGEX.test(n))return{name:null,address:n.toLowerCase(),chainType:e.ChainType.EVM};if(!n.startsWith("0x")&&n.length>=32&&n.length<=44&&this.BASE58_REGEX.test(n))return{name:null,address:n,chainType:e.ChainType.SOLANA};if((n.toLowerCase().endsWith(".eth")||n.toLowerCase().endsWith(".box"))&&n.length>=5&&this.ENS_REGEX.test(n))return{name:n.toLowerCase(),address:null,chainType:e.ChainType.EVM};if(n.toLowerCase().includes(".")){const o=n.toLowerCase().split(".");if(o.length===2){const[a,i]=o;if(this.VALID_SNS_TLDS.includes(i)&&this.SNS_NAME_REGEX.test(a)&&a.length>=1)return{name:n.toLowerCase(),address:null,chainType:e.ChainType.SOLANA}}}}}static isValidEVMAddress(n){return this.EVM_REGEX.test(n)}static isValidSolanaAddress(n){return!n.startsWith("0x")&&n.length>=32&&n.length<=44&&this.BASE58_REGEX.test(n)}static isValidENSName(n){return(n.toLowerCase().endsWith(".eth")||n.toLowerCase().endsWith(".box"))&&n.length>=5&&this.ENS_REGEX.test(n)}static isValidSNSName(n){if(!n.toLowerCase().includes("."))return!1;const o=n.toLowerCase().split(".");if(o.length!==2)return!1;const[a,i]=o;return this.VALID_SNS_TLDS.includes(i)&&this.SNS_NAME_REGEX.test(a)&&a.length>=1}}return $t.Web3UsernameValidator=t,t.EVM_REGEX=/^0x[a-fA-F0-9]{40}$/,t.BASE58_REGEX=/^[1-9A-HJ-NP-Za-km-z]+$/,t.ENS_REGEX=/^[a-zA-Z0-9]([a-zA-Z0-9]|(-[a-zA-Z0-9]))*\.(eth|box)$/i,t.SNS_NAME_REGEX=/^[a-zA-Z0-9]([a-zA-Z0-9]|(-[a-zA-Z0-9]))*$/,t.VALID_SNS_TLDS=["sol","abc","backpack","bonk","coin","dao","defi","gm","poor","pump","shdw","stepn","web3"],$t}var Os={},Ps;function Vm(){return Ps||(Ps=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.parseJson=e.createAssertion=e.isUrl=e.isEmail=e.isValidDate=e.isErrorResponse=e.isSuccessResponse=e.isApiResponse=e.optional=e.validateArray=e.hasRequiredProperties=e.isNullish=e.isArray=e.isObject=e.isBoolean=e.isNumber=e.isString=e.createValidator=void 0;const t=(v,x)=>C=>{try{return v(C)?{isValid:!0,data:C}:{isValid:!1,error:`Invalid ${x}`,data:null}}catch(O){return{isValid:!1,error:`Validation error for ${x}: ${O instanceof Error?O.message:"Unknown error"}`,data:null}}};e.createValidator=t;const r=v=>typeof v=="string";e.isString=r;const n=v=>typeof v=="number"&&!isNaN(v);e.isNumber=n;const o=v=>typeof v=="boolean";e.isBoolean=o;const a=v=>typeof v=="object"&&v!==null&&!Array.isArray(v);e.isObject=a;const i=v=>Array.isArray(v);e.isArray=i;const s=v=>v==null;e.isNullish=s;const l=(v,x)=>(0,e.isObject)(v)?x.every(C=>C in v):!1;e.hasRequiredProperties=l;const c=(v,x)=>(0,e.isArray)(v)?v.every(x):!1;e.validateArray=c;const f=v=>x=>x===void 0||v(x);e.optional=f;const u=v=>(0,e.isObject)(v)&&(0,e.isBoolean)(v.success);e.isApiResponse=u;const p=(v,x)=>!(0,e.isApiResponse)(v)||!v.success?!1:x&&"data"in v?x(v.data):!0;e.isSuccessResponse=p;const h=v=>(0,e.isApiResponse)(v)&&!v.success&&"error"in v&&(0,e.isString)(v.error);e.isErrorResponse=h;const y=v=>{if(!(0,e.isString)(v))return!1;const x=new Date(v);return!isNaN(x.getTime())};e.isValidDate=y;const m=v=>(0,e.isString)(v)?/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(v):!1;e.isEmail=m;const g=v=>{if(!(0,e.isString)(v))return!1;try{return new URL(v),!0}catch{return!1}};e.isUrl=g;const w=(v,x)=>(C,O=x)=>{if(!v(C))throw new TypeError(`Invalid ${O}: expected ${x}`)};e.createAssertion=w;const E=(v,x)=>{try{const C=JSON.parse(v);return x?x(C)?{isValid:!0,data:C}:{isValid:!1,error:"Parsed JSON does not match expected type",data:null}:{isValid:!0,data:C}}catch(C){return{isValid:!1,error:`JSON parse error: ${C instanceof Error?C.message:"Unknown error"}`,data:null}}};e.parseJson=E})(Os)),Os}var Ns;function Bm(){return Ns||(Ns=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.validateArray=e.parseJson=e.optional=e.isValidDate=e.isUrl=e.isSuccessResponse=e.isString=e.isObject=e.isNumber=e.isNullish=e.isErrorResponse=e.isEmail=e.isBoolean=e.isArray=e.isApiResponse=e.hasRequiredProperties=e.createValidator=e.createAssertion=e.Web3UsernameValidator=void 0;var t=Um();Object.defineProperty(e,"Web3UsernameValidator",{enumerable:!0,get:function(){return t.Web3UsernameValidator}});var r=Vm();Object.defineProperty(e,"createAssertion",{enumerable:!0,get:function(){return r.createAssertion}}),Object.defineProperty(e,"createValidator",{enumerable:!0,get:function(){return r.createValidator}}),Object.defineProperty(e,"hasRequiredProperties",{enumerable:!0,get:function(){return r.hasRequiredProperties}}),Object.defineProperty(e,"isApiResponse",{enumerable:!0,get:function(){return r.isApiResponse}}),Object.defineProperty(e,"isArray",{enumerable:!0,get:function(){return r.isArray}}),Object.defineProperty(e,"isBoolean",{enumerable:!0,get:function(){return r.isBoolean}}),Object.defineProperty(e,"isEmail",{enumerable:!0,get:function(){return r.isEmail}}),Object.defineProperty(e,"isErrorResponse",{enumerable:!0,get:function(){return r.isErrorResponse}}),Object.defineProperty(e,"isNullish",{enumerable:!0,get:function(){return r.isNullish}}),Object.defineProperty(e,"isNumber",{enumerable:!0,get:function(){return r.isNumber}}),Object.defineProperty(e,"isObject",{enumerable:!0,get:function(){return r.isObject}}),Object.defineProperty(e,"isString",{enumerable:!0,get:function(){return r.isString}}),Object.defineProperty(e,"isSuccessResponse",{enumerable:!0,get:function(){return r.isSuccessResponse}}),Object.defineProperty(e,"isUrl",{enumerable:!0,get:function(){return r.isUrl}}),Object.defineProperty(e,"isValidDate",{enumerable:!0,get:function(){return r.isValidDate}}),Object.defineProperty(e,"optional",{enumerable:!0,get:function(){return r.optional}}),Object.defineProperty(e,"parseJson",{enumerable:!0,get:function(){return r.parseJson}}),Object.defineProperty(e,"validateArray",{enumerable:!0,get:function(){return r.validateArray}})})(As)),As}var Is={},he={},Rs;function zm(){if(Rs)return he;Rs=1,Object.defineProperty(he,"__esModule",{value:!0}),he.createMultiChainId=e,he.createUserMultiChainId=t,he.createChainStatsId=r,he.createDelegationId=n,he.normalizeAddress=o,he.formatBigInt=a,he.isZeroAddress=i,he.isTestNet=s,he.validateEventArgs=l;function e(c,f,u){return`${c}-${f}-${u}`}function t(c,f){return`${c}-${f.toLowerCase()}`}function r(c){return`${c}-global`}function n(c,f){return`${c.toLowerCase()}-${f}`}function o(c){return c.toLowerCase()}function a(c,f=18){const u=BigInt(10**f),p=c/u,h=c%u;return h===0n?p.toString():`${p}.${h.toString().padStart(f,"0").replace(/0+$/,"")}`}function i(c){return c.toLowerCase()==="0x0000000000000000000000000000000000000000"}function s(c){const f=new Set([31337,11155111,80001,80002,421614,11155420,84532,43113]),u=new Set([-102,-103,-104]);return f.has(c)||u.has(c)}function l(c,f){for(const u of f)if(c[u]===void 0||c[u]===null)return console.error(`❌ Missing required field: ${String(u)}`),!1;return!0}return he}var ks;function Hm(){return ks||(ks=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.validateEventArgs=e.normalizeAddress=e.isZeroAddress=e.isTestNet=e.formatBigInt=e.createUserMultiChainId=e.createMultiChainId=e.createDelegationId=e.createChainStatsId=e.isSolanaAddress=e.isEvmAddress=e.parseEmailAddress=e.isValidWalletAddress=e.isValidSignature=e.isSNSName=e.isENSName=e.getChainDisplayName=e.getAddressType=e.formatWalletAddress=e.AddressType=void 0;var t=Qi();Object.defineProperty(e,"AddressType",{enumerable:!0,get:function(){return t.AddressType}}),Object.defineProperty(e,"formatWalletAddress",{enumerable:!0,get:function(){return t.formatWalletAddress}}),Object.defineProperty(e,"getAddressType",{enumerable:!0,get:function(){return t.getAddressType}}),Object.defineProperty(e,"getChainDisplayName",{enumerable:!0,get:function(){return t.getChainDisplayName}}),Object.defineProperty(e,"isENSName",{enumerable:!0,get:function(){return t.isENSName}}),Object.defineProperty(e,"isSNSName",{enumerable:!0,get:function(){return t.isSNSName}}),Object.defineProperty(e,"isValidSignature",{enumerable:!0,get:function(){return t.isValidSignature}}),Object.defineProperty(e,"isValidWalletAddress",{enumerable:!0,get:function(){return t.isValidWalletAddress}}),Object.defineProperty(e,"parseEmailAddress",{enumerable:!0,get:function(){return t.parseEmailAddress}});var r=Sn();Object.defineProperty(e,"isEvmAddress",{enumerable:!0,get:function(){return r.isEvmAddress}}),Object.defineProperty(e,"isSolanaAddress",{enumerable:!0,get:function(){return r.isSolanaAddress}});var n=zm();Object.defineProperty(e,"createChainStatsId",{enumerable:!0,get:function(){return n.createChainStatsId}}),Object.defineProperty(e,"createDelegationId",{enumerable:!0,get:function(){return n.createDelegationId}}),Object.defineProperty(e,"createMultiChainId",{enumerable:!0,get:function(){return n.createMultiChainId}}),Object.defineProperty(e,"createUserMultiChainId",{enumerable:!0,get:function(){return n.createUserMultiChainId}}),Object.defineProperty(e,"formatBigInt",{enumerable:!0,get:function(){return n.formatBigInt}}),Object.defineProperty(e,"isTestNet",{enumerable:!0,get:function(){return n.isTestNet}}),Object.defineProperty(e,"isZeroAddress",{enumerable:!0,get:function(){return n.isZeroAddress}}),Object.defineProperty(e,"normalizeAddress",{enumerable:!0,get:function(){return n.normalizeAddress}}),Object.defineProperty(e,"validateEventArgs",{enumerable:!0,get:function(){return n.validateEventArgs}})})(Is)),Is}var _s={},xe={},Ms;function Gm(){if(Ms)return xe;Ms=1,Object.defineProperty(xe,"__esModule",{value:!0}),xe.generateAuthMessage=t,xe.isAuthExpired=r,xe.getAuthStatusText=n,xe.canAccessProtectedFeatures=o,xe.isAuthStatusConnected=a,xe.generateNonce=i,xe.extractNonceFromMessage=s,xe.isValidNonce=l;const e=wt();function t(c,f){const u=f||`${Date.now()}-${Math.random().toString(36).substr(2,9)}`;return`Authenticate with ${c}
|
|
44
|
-
Nonce: ${u}`}function r(c,f=24){const u=new Date(c.getTime()+f*60*60*1e3);return new Date>u}function n(c){switch(c){case e.AuthStatus.DISCONNECTED:return"Not connected";case e.AuthStatus.CONNECTED:return"Connected - Please verify";case e.AuthStatus.VERIFIED:return"Authenticated";default:return"Unknown status"}}function o(c){return c===e.AuthStatus.VERIFIED}function a(c){return c===e.AuthStatus.CONNECTED||c===e.AuthStatus.VERIFIED}function i(){return`${Date.now()}-${Math.random().toString(36).substr(2,9)}`}function s(c){const f=c.match(/Nonce:\s*(.+)$/m);return f?f[1].trim():void 0}function l(c){if(!c||typeof c!="string"||c.length<10)return!1;const f=c.split("-");if(f.length>=2){const u=parseInt(f[0],10);if(!isNaN(u)){const p=Date.now()-864e5;if(u<p)return!1}}return!0}return xe}var Ls;function Ym(){return Ls||(Ls=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.isValidNonce=e.isAuthStatusConnected=e.isAuthExpired=e.getAuthStatusText=e.generateNonce=e.generateAuthMessage=e.extractNonceFromMessage=e.canAccessProtectedFeatures=void 0;var t=Gm();Object.defineProperty(e,"canAccessProtectedFeatures",{enumerable:!0,get:function(){return t.canAccessProtectedFeatures}}),Object.defineProperty(e,"extractNonceFromMessage",{enumerable:!0,get:function(){return t.extractNonceFromMessage}}),Object.defineProperty(e,"generateAuthMessage",{enumerable:!0,get:function(){return t.generateAuthMessage}}),Object.defineProperty(e,"generateNonce",{enumerable:!0,get:function(){return t.generateNonce}}),Object.defineProperty(e,"getAuthStatusText",{enumerable:!0,get:function(){return t.getAuthStatusText}}),Object.defineProperty(e,"isAuthExpired",{enumerable:!0,get:function(){return t.isAuthExpired}}),Object.defineProperty(e,"isAuthStatusConnected",{enumerable:!0,get:function(){return t.isAuthStatusConnected}}),Object.defineProperty(e,"isValidNonce",{enumerable:!0,get:function(){return t.isValidNonce}})})(_s)),_s}var Ds={},js={},Fs;function Km(){return Fs||(Fs=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CLAIM_PERIOD_DAYS=e.USDC_DECIMALS=void 0,e.formatUSDC=t,e.parseUSDC=r,e.USDC_DECIMALS=6,e.CLAIM_PERIOD_DAYS=60;function t(n){return(n/Math.pow(10,e.USDC_DECIMALS)).toFixed(2)}function r(n){return Math.floor(parseFloat(n)*Math.pow(10,e.USDC_DECIMALS))}})(js)),js}var Re={},$s;function Xm(){if($s)return Re;$s=1,Object.defineProperty(Re,"__esModule",{value:!0}),Re.formatEmailDate=e,Re.formatTimestamp=t,Re.formatRelativeTime=r,Re.parseDate=n,Re.isDateInRange=o,Re.addDays=a,Re.addHours=i;function e(s){const l=typeof s=="string"?new Date(s):s;if(isNaN(l.getTime()))return"Invalid date";const c=new Date,f=c.getTime()-l.getTime(),u=Math.floor(f/(1e3*60*60*24));return u===0?l.toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0}):u===1?"Yesterday":u<7?l.toLocaleDateString("en-US",{weekday:"long"}):l.getFullYear()===c.getFullYear()?l.toLocaleDateString("en-US",{month:"short",day:"numeric"}):l.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})}function t(s){return new Date(s).toISOString()}function r(s){const l=typeof s=="string"||typeof s=="number"?new Date(s):s;if(isNaN(l.getTime()))return"Invalid date";const c=new Date().getTime()-l.getTime(),f=Math.floor(c/1e3),u=Math.floor(f/60),p=Math.floor(u/60),h=Math.floor(p/24),y=Math.floor(h/7),m=Math.floor(h/30),g=Math.floor(h/365);return f<60?"just now":u<60?u===1?"1 minute ago":`${u} minutes ago`:p<24?p===1?"1 hour ago":`${p} hours ago`:h<7?h===1?"1 day ago":`${h} days ago`:y<4?y===1?"1 week ago":`${y} weeks ago`:m<12?m===1?"1 month ago":`${m} months ago`:g===1?"1 year ago":`${g} years ago`}function n(s){try{const l=new Date(s);return isNaN(l.getTime())?null:l}catch{return null}}function o(s,l,c){return s>=l&&s<=c}function a(s,l){const c=new Date(s);return c.setDate(c.getDate()+l),c}function i(s,l){const c=new Date(s);return c.setHours(c.getHours()+l),c}return Re}var oe={},Ws;function qm(){if(Ws)return oe;Ws=1,Object.defineProperty(oe,"__esModule",{value:!0}),oe.truncate=e,oe.capitalize=t,oe.toTitleCase=r,oe.toKebabCase=n,oe.toCamelCase=o,oe.toSnakeCase=a,oe.normalizeWhitespace=i,oe.isBlank=s,oe.isNotBlank=l,oe.escapeHtml=c,oe.stripHtml=f,oe.getInitials=u,oe.formatBytes=p,oe.randomString=h,oe.pluralize=y,oe.formatNumber=m;function e(g,w,E="..."){return!g||g.length<=w?g:g.slice(0,w-E.length)+E}function t(g){return g&&g.charAt(0).toUpperCase()+g.slice(1)}function r(g){return g&&g.toLowerCase().split(" ").map(w=>t(w)).join(" ")}function n(g){return g&&g.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase()}function o(g){return g&&g.replace(/[-_\s]+(.)?/g,(w,E)=>E?E.toUpperCase():"").replace(/^./,w=>w.toLowerCase())}function a(g){return g&&g.replace(/([a-z])([A-Z])/g,"$1_$2").replace(/[\s-]+/g,"_").toLowerCase()}function i(g){return g&&g.replace(/\s+/g," ").trim()}function s(g){return!g||g.trim().length===0}function l(g){return!s(g)}function c(g){if(!g)return g;const w={"&":"&","<":"<",">":">",'"':""","'":"'"};return g.replace(/[&<>"']/g,E=>w[E])}function f(g){return g&&g.replace(/<[^>]*>/g,"")}function u(g,w=2){return g?g.trim().split(/\s+/).slice(0,w).map(E=>E.charAt(0).toUpperCase()).join(""):""}function p(g,w=2){if(g===0)return"0 Bytes";const E=1024,v=w<0?0:w,x=["Bytes","KB","MB","GB","TB","PB"],C=Math.floor(Math.log(g)/Math.log(E));return parseFloat((g/Math.pow(E,C)).toFixed(v))+" "+x[C]}function h(g,w="alphanumeric"){let E;switch(w){case"alpha":E="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";break;case"numeric":E="0123456789";break;case"alphanumeric":E="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";break;case"hex":E="0123456789abcdef";break;default:E=w}let v="";for(let x=0;x<g;x++)v+=E.charAt(Math.floor(Math.random()*E.length));return v}function y(g,w,E){return g===1?w:E||`${w}s`}function m(g){return g.toString().replace(/\B(?=(\d{3})+(?!\d))/g,",")}return oe}var Us;function Zm(){return Us||(Us=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.truncate=e.toTitleCase=e.toSnakeCase=e.toKebabCase=e.toCamelCase=e.stripHtml=e.randomString=e.pluralize=e.normalizeWhitespace=e.isNotBlank=e.isBlank=e.getInitials=e.formatNumber=e.formatBytes=e.escapeHtml=e.capitalize=e.parseDate=e.isDateInRange=e.formatTimestamp=e.formatRelativeTime=e.formatEmailDate=e.addHours=e.addDays=e.parseUSDC=e.formatUSDC=e.USDC_DECIMALS=e.CLAIM_PERIOD_DAYS=void 0;var t=Km();Object.defineProperty(e,"CLAIM_PERIOD_DAYS",{enumerable:!0,get:function(){return t.CLAIM_PERIOD_DAYS}}),Object.defineProperty(e,"USDC_DECIMALS",{enumerable:!0,get:function(){return t.USDC_DECIMALS}}),Object.defineProperty(e,"formatUSDC",{enumerable:!0,get:function(){return t.formatUSDC}}),Object.defineProperty(e,"parseUSDC",{enumerable:!0,get:function(){return t.parseUSDC}});var r=Xm();Object.defineProperty(e,"addDays",{enumerable:!0,get:function(){return r.addDays}}),Object.defineProperty(e,"addHours",{enumerable:!0,get:function(){return r.addHours}}),Object.defineProperty(e,"formatEmailDate",{enumerable:!0,get:function(){return r.formatEmailDate}}),Object.defineProperty(e,"formatRelativeTime",{enumerable:!0,get:function(){return r.formatRelativeTime}}),Object.defineProperty(e,"formatTimestamp",{enumerable:!0,get:function(){return r.formatTimestamp}}),Object.defineProperty(e,"isDateInRange",{enumerable:!0,get:function(){return r.isDateInRange}}),Object.defineProperty(e,"parseDate",{enumerable:!0,get:function(){return r.parseDate}});var n=qm();Object.defineProperty(e,"capitalize",{enumerable:!0,get:function(){return n.capitalize}}),Object.defineProperty(e,"escapeHtml",{enumerable:!0,get:function(){return n.escapeHtml}}),Object.defineProperty(e,"formatBytes",{enumerable:!0,get:function(){return n.formatBytes}}),Object.defineProperty(e,"formatNumber",{enumerable:!0,get:function(){return n.formatNumber}}),Object.defineProperty(e,"getInitials",{enumerable:!0,get:function(){return n.getInitials}}),Object.defineProperty(e,"isBlank",{enumerable:!0,get:function(){return n.isBlank}}),Object.defineProperty(e,"isNotBlank",{enumerable:!0,get:function(){return n.isNotBlank}}),Object.defineProperty(e,"normalizeWhitespace",{enumerable:!0,get:function(){return n.normalizeWhitespace}}),Object.defineProperty(e,"pluralize",{enumerable:!0,get:function(){return n.pluralize}}),Object.defineProperty(e,"randomString",{enumerable:!0,get:function(){return n.randomString}}),Object.defineProperty(e,"stripHtml",{enumerable:!0,get:function(){return n.stripHtml}}),Object.defineProperty(e,"toCamelCase",{enumerable:!0,get:function(){return n.toCamelCase}}),Object.defineProperty(e,"toKebabCase",{enumerable:!0,get:function(){return n.toKebabCase}}),Object.defineProperty(e,"toSnakeCase",{enumerable:!0,get:function(){return n.toSnakeCase}}),Object.defineProperty(e,"toTitleCase",{enumerable:!0,get:function(){return n.toTitleCase}}),Object.defineProperty(e,"truncate",{enumerable:!0,get:function(){return n.truncate}})})(Ds)),Ds}var Vs={},D={},Bs;function Jm(){if(Bs)return D;Bs=1,Object.defineProperty(D,"__esModule",{value:!0}),D.Z_INDEX=D.ANIMATION=D.NETWORK_IDS=D.WALLET_NAMES=D.CONTACT_INFO=D.ROUTES=D.SUCCESS_MESSAGES=D.ERROR_MESSAGES=D.TIME_FORMAT=D.SUBSCRIPTION_TIERS=D.EMAIL_CONFIG=D.STORAGE_KEYS=D.CHAIN_TYPE=D.AUTH_STATUS=D.API_RETRY_DELAY=D.API_RETRY_ATTEMPTS=D.API_TIMEOUT=void 0;const e=3e4;D.API_TIMEOUT=e;const t=3;D.API_RETRY_ATTEMPTS=t;const r=1e3;D.API_RETRY_DELAY=r;const n={DISCONNECTED:"disconnected",CONNECTED:"connected",VERIFIED:"verified"};D.AUTH_STATUS=n;const o={EVM:"evm",SOLANA:"solana",UNKNOWN:"unknown"};D.CHAIN_TYPE=o;const a={AUTH_TOKEN:"authToken",USER_DATA:"userData",THEME:"theme",EMAIL_CACHE:"emailCache",WALLET_ADDRESS:"walletAddress",CHAIN_TYPE:"chainType"};D.STORAGE_KEYS=a;const i={MAX_ATTACHMENT_SIZE:25*1024*1024,MAX_RECIPIENTS:100,ITEMS_PER_PAGE:50,REFRESH_INTERVAL:6e4,NOTIFICATION_COOLDOWN:3e5};D.EMAIL_CONFIG=i;const s={FREE:"free",BASIC:"basic",PRO:"pro",ENTERPRISE:"enterprise"};D.SUBSCRIPTION_TIERS=s;const l={SHORT_DATE:"MMM d",FULL_DATE:"MMM d, yyyy",DATE_TIME:"MMM d, yyyy h:mm a",RELATIVE:"relative"};D.TIME_FORMAT=l;const c={WALLET_NOT_CONNECTED:"Please connect your wallet first",INVALID_ADDRESS:"Please enter a valid address",NETWORK_ERROR:"Network error. Please try again.",AUTHENTICATION_FAILED:"Authentication failed. Please sign in again.",TRANSACTION_FAILED:"Transaction failed. Please try again.",INSUFFICIENT_FUNDS:"Insufficient funds for this operation",RATE_LIMITED:"Too many requests. Please wait a moment.",SESSION_EXPIRED:"Your session has expired. Please sign in again.",PERMISSION_DENIED:"You do not have permission to perform this action"};D.ERROR_MESSAGES=c;const f={EMAIL_SENT:"Email sent successfully",EMAIL_DELETED:"Email deleted successfully",PREFERENCES_SAVED:"Preferences saved successfully",WALLET_CONNECTED:"Wallet connected successfully",AUTHENTICATION_SUCCESS:"Authentication successful",DELEGATION_SUCCESS:"Delegation successful",SUBSCRIPTION_ACTIVATED:"Subscription activated successfully"};D.SUCCESS_MESSAGES=f;const u={HOME:"/",ABOUT:"/about",CONNECT:"/connect",MAIL:"/mail",COMPOSE:"/mail/compose",PREFERENCES:"/preferences",TERMS:"/terms",PRIVACY:"/privacy",DOCUMENTATION:"/document",WEB3_USERS:"/web3-users",WEB3_PROJECTS:"/web3-projects"};D.ROUTES=u;const p={SUPPORT_EMAIL:"support@sudobility.com",CONTACT_EMAIL:"info@sudobility.com"};D.CONTACT_INFO=p;const h={METAMASK:"MetaMask",WALLETCONNECT:"WalletConnect",COINBASE:"Coinbase Wallet",PHANTOM:"Phantom",SAFE:"Safe",ARGENT:"Argent",RAINBOW:"Rainbow",TRUST:"Trust Wallet",LEDGER:"Ledger",TREZOR:"Trezor"};D.WALLET_NAMES=h;const y={ETHEREUM_MAINNET:1,POLYGON:137,ARBITRUM:42161,OPTIMISM:10,BASE:8453,SOLANA_MAINNET:"mainnet-beta",SOLANA_DEVNET:"devnet"};D.NETWORK_IDS=y;const m={FAST:150,NORMAL:300,SLOW:500,VERY_SLOW:1e3};D.ANIMATION=m;const g={DROPDOWN:10,OVERLAY:20,MODAL:30,POPOVER:40,TOOLTIP:50,TOAST:60};return D.Z_INDEX=g,D}var Cr={},zs;function Qm(){return zs||(zs=1,Object.defineProperty(Cr,"__esModule",{value:!0}),Cr.STATUS_VALUES=void 0,Cr.STATUS_VALUES={SUCCESS:"success",PENDING:"pending",FAILED:"failed",ERROR:"error"}),Cr}var Hs;function eg(){return Hs||(Hs=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.STATUS_VALUES=e.Z_INDEX=e.ANIMATION=e.NETWORK_IDS=e.WALLET_NAMES=e.CONTACT_INFO=e.ROUTES=e.SUCCESS_MESSAGES=e.ERROR_MESSAGES=e.TIME_FORMAT=e.SUBSCRIPTION_TIERS=e.EMAIL_CONFIG=e.STORAGE_KEYS=e.CHAIN_TYPE=e.AUTH_STATUS=e.API_RETRY_DELAY=e.API_RETRY_ATTEMPTS=e.API_TIMEOUT=void 0;var t=Jm();Object.defineProperty(e,"API_TIMEOUT",{enumerable:!0,get:function(){return t.API_TIMEOUT}}),Object.defineProperty(e,"API_RETRY_ATTEMPTS",{enumerable:!0,get:function(){return t.API_RETRY_ATTEMPTS}}),Object.defineProperty(e,"API_RETRY_DELAY",{enumerable:!0,get:function(){return t.API_RETRY_DELAY}}),Object.defineProperty(e,"AUTH_STATUS",{enumerable:!0,get:function(){return t.AUTH_STATUS}}),Object.defineProperty(e,"CHAIN_TYPE",{enumerable:!0,get:function(){return t.CHAIN_TYPE}}),Object.defineProperty(e,"STORAGE_KEYS",{enumerable:!0,get:function(){return t.STORAGE_KEYS}}),Object.defineProperty(e,"EMAIL_CONFIG",{enumerable:!0,get:function(){return t.EMAIL_CONFIG}}),Object.defineProperty(e,"SUBSCRIPTION_TIERS",{enumerable:!0,get:function(){return t.SUBSCRIPTION_TIERS}}),Object.defineProperty(e,"TIME_FORMAT",{enumerable:!0,get:function(){return t.TIME_FORMAT}}),Object.defineProperty(e,"ERROR_MESSAGES",{enumerable:!0,get:function(){return t.ERROR_MESSAGES}}),Object.defineProperty(e,"SUCCESS_MESSAGES",{enumerable:!0,get:function(){return t.SUCCESS_MESSAGES}}),Object.defineProperty(e,"ROUTES",{enumerable:!0,get:function(){return t.ROUTES}}),Object.defineProperty(e,"CONTACT_INFO",{enumerable:!0,get:function(){return t.CONTACT_INFO}}),Object.defineProperty(e,"WALLET_NAMES",{enumerable:!0,get:function(){return t.WALLET_NAMES}}),Object.defineProperty(e,"NETWORK_IDS",{enumerable:!0,get:function(){return t.NETWORK_IDS}}),Object.defineProperty(e,"ANIMATION",{enumerable:!0,get:function(){return t.ANIMATION}}),Object.defineProperty(e,"Z_INDEX",{enumerable:!0,get:function(){return t.Z_INDEX}});var r=Qm();Object.defineProperty(e,"STATUS_VALUES",{enumerable:!0,get:function(){return r.STATUS_VALUES}})})(Vs)),Vs}var Gs={},ie={},Ys;function tg(){if(Ys)return ie;Ys=1,Object.defineProperty(ie,"__esModule",{value:!0}),ie.storageLogger=ie.ensLogger=ie.contractLogger=ie.apiLogger=ie.authLogger=ie.logger=ie.LogLevel=void 0;var e;(function(l){l.ERROR="error",l.WARN="warn",l.INFO="info",l.DEBUG="debug"})(e||(ie.LogLevel=e={}));class t{constructor(){this.isDevelopment=process.env.NODE_ENV==="development"}formatTimestamp(){return new Date().toISOString()}formatMessage(c,f,u){const p=this.formatTimestamp(),h=u?` [${u}]`:"";return`[${p}]${h} ${f}`}shouldLog(c){return this.isDevelopment?!0:c===e.ERROR||c===e.WARN}error(c,f,u){this.shouldLog(e.ERROR)&&(console.error(this.formatMessage(e.ERROR,c,f)),u&&console.error(u))}warn(c,f,u){this.shouldLog(e.WARN)&&(console.warn(this.formatMessage(e.WARN,c,f)),u&&console.warn(u))}info(c,f,u){this.shouldLog(e.INFO)&&(console.log(this.formatMessage(e.INFO,c,f)),u&&console.log(u))}debug(c,f,u){this.shouldLog(e.DEBUG)&&(console.log(this.formatMessage(e.DEBUG,c,f)),u&&console.log(u))}withContext(c){return{error:(f,u)=>this.error(f,c,u),warn:(f,u)=>this.warn(f,c,u),info:(f,u)=>this.info(f,c,u),debug:(f,u)=>this.debug(f,c,u)}}}const r=new t;ie.logger=r;const n=r.withContext("AUTH");ie.authLogger=n;const o=r.withContext("API");ie.apiLogger=o;const a=r.withContext("CONTRACT");ie.contractLogger=a;const i=r.withContext("ENS");ie.ensLogger=i;const s=r.withContext("STORAGE");return ie.storageLogger=s,ie}var Ks;function Xs(){return Ks||(Ks=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.storageLogger=e.ensLogger=e.contractLogger=e.apiLogger=e.authLogger=e.logger=e.LogLevel=void 0;var t=tg();Object.defineProperty(e,"LogLevel",{enumerable:!0,get:function(){return t.LogLevel}}),Object.defineProperty(e,"logger",{enumerable:!0,get:function(){return t.logger}}),Object.defineProperty(e,"authLogger",{enumerable:!0,get:function(){return t.authLogger}}),Object.defineProperty(e,"apiLogger",{enumerable:!0,get:function(){return t.apiLogger}}),Object.defineProperty(e,"contractLogger",{enumerable:!0,get:function(){return t.contractLogger}}),Object.defineProperty(e,"ensLogger",{enumerable:!0,get:function(){return t.ensLogger}}),Object.defineProperty(e,"storageLogger",{enumerable:!0,get:function(){return t.storageLogger}})})(Gs)),Gs}var qs={},tt={},Zs;function rg(){if(Zs)return tt;Zs=1,Object.defineProperty(tt,"__esModule",{value:!0}),tt.createURLSearchParams=t,tt.createSearchParams=r,tt.searchParamsToString=n,tt.parseSearchParams=o;class e{constructor(i){if(this.params=new Map,i)if(typeof i=="string")this.parseString(i);else if(Array.isArray(i))for(const[s,l]of i)this.append(s,l);else for(const[s,l]of Object.entries(i))l!==void 0&&this.append(s,l)}parseString(i){const s=i.startsWith("?")?i.slice(1):i;if(s)for(const l of s.split("&")){const[c,f=""]=l.split("=");c&&this.append(decodeURIComponent(c),decodeURIComponent(f))}}append(i,s){this.params.has(i)||this.params.set(i,[]);const l=this.params.get(i);l&&l.push(s)}delete(i){this.params.delete(i)}get(i){const s=this.params.get(i);return s&&s.length>0?s[0]:null}getAll(i){return this.params.get(i)||[]}has(i){return this.params.has(i)}set(i,s){this.params.set(i,[s])}toString(){const i=[];return this.params.forEach((s,l)=>{for(const c of s)i.push(`${encodeURIComponent(l)}=${encodeURIComponent(c)}`)}),i.join("&")}forEach(i){this.params.forEach((s,l)=>{for(const c of s)i(c,l)})}}function t(a){return typeof URLSearchParams<"u"?new URLSearchParams(a):new e(a)}function r(a){const i=t(void 0);for(const[s,l]of Object.entries(a))l!=null&&i.append(s,String(l));return i}function n(a){return a.toString()}function o(a){const i=t(a),s={};return i.forEach((l,c)=>{s[c]=l}),s}return tt}var Js;function ng(){return Js||(Js=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.parseSearchParams=e.searchParamsToString=e.createSearchParams=e.createURLSearchParams=void 0;var t=rg();Object.defineProperty(e,"createURLSearchParams",{enumerable:!0,get:function(){return t.createURLSearchParams}}),Object.defineProperty(e,"createSearchParams",{enumerable:!0,get:function(){return t.createSearchParams}}),Object.defineProperty(e,"searchParamsToString",{enumerable:!0,get:function(){return t.searchParamsToString}}),Object.defineProperty(e,"parseSearchParams",{enumerable:!0,get:function(){return t.parseSearchParams}})})(qs)),qs}var se={},Qs;function og(){if(Qs)return se;Qs=1,Object.defineProperty(se,"__esModule",{value:!0}),se.debounceAsync=se.clearExpiredCache=se.withCache=se.withTimeout=se.safeParallel=se.withLoadingState=se.safeAsync=void 0;const e=Xs(),t=async(f,u)=>{try{return{data:await f(),success:!0}}catch(p){const h=p instanceof Error?p:new Error(String(p));return e.logger.error(`Async operation failed: ${h.message}`,u,p),{error:h,success:!1}}};se.safeAsync=t;const r=async(f,u,p,h)=>{u(!0),p(null);try{return await f()}catch(y){const m=y instanceof Error?y.message:String(y);p(m),e.logger.error(`Operation failed: ${m}`,h,y);return}finally{u(!1)}};se.withLoadingState=r;const n=async(f,u)=>{try{return{data:await Promise.all(f.map(p=>p())),success:!0}}catch(p){const h=p instanceof Error?p:new Error(String(p));return e.logger.error(`Parallel operations failed: ${h.message}`,u,p),{error:h,success:!1}}};se.safeParallel=n;const o=async(f,u,p)=>{const h=new Promise((y,m)=>setTimeout(()=>m(new Error(`Operation timed out after ${u}ms`)),u));try{return await Promise.race([f(),h])}catch(y){throw e.logger.error("Timeout operation failed",p,y),y}};se.withTimeout=o;const a=new Map,i=async(f,u,p=300*1e3)=>{const h=a.get(f),y=Date.now();if(h&&y-h.timestamp<h.ttl)return h.data;const m=await u();return a.set(f,{data:m,timestamp:y,ttl:p}),m};se.withCache=i;const s=()=>{const f=Date.now();for(const[u,p]of a.entries())f-p.timestamp>=p.ttl&&a.delete(u)};se.clearExpiredCache=s;const l=new Map,c=(f,u,p)=>(...h)=>new Promise(y=>{const m=l.get(p);m&&clearTimeout(m);const g=setTimeout(async()=>{l.delete(p);try{const w=await f(...h);y(w)}catch(w){e.logger.error("Debounced operation failed",p,w),y(void 0)}},u);l.set(p,g)});return se.debounceAsync=c,se}var el;function tl(){return el||(el=1,(function(e){var t=xt&&xt.__createBinding||(Object.create?(function(n,o,a,i){i===void 0&&(i=a);var s=Object.getOwnPropertyDescriptor(o,a);(!s||("get"in s?!o.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return o[a]}}),Object.defineProperty(n,i,s)}):(function(n,o,a,i){i===void 0&&(i=a),n[i]=o[a]})),r=xt&&xt.__exportStar||function(n,o){for(var a in n)a!=="default"&&!Object.prototype.hasOwnProperty.call(o,a)&&t(o,n,a)};Object.defineProperty(e,"__esModule",{value:!0}),r(Bm(),e),r(Hm(),e),r(Ym(),e),r(Zm(),e),r(eg(),e),r(Xs(),e),r(ng(),e),r(og(),e)})(xt)),xt}var rl;function ag(){return rl||(rl=1,(function(e){var t=yt&&yt.__createBinding||(Object.create?(function(a,i,s,l){l===void 0&&(l=s);var c=Object.getOwnPropertyDescriptor(i,s);(!c||("get"in c?!i.__esModule:c.writable||c.configurable))&&(c={enumerable:!0,get:function(){return i[s]}}),Object.defineProperty(a,l,c)}):(function(a,i,s,l){l===void 0&&(l=s),a[l]=i[s]})),r=yt&&yt.__exportStar||function(a,i){for(var s in a)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&t(i,a,s)};Object.defineProperty(e,"__esModule",{value:!0}),e.ProcessedEventName=e.ContractType=e.StorageType=e.WalletType=e.ChainType=e.AnalyticsEvent=e.TransactionStatus=e.MessageType=e.InfoType=e.NotificationType=e.RequestStatus=e.MobileView=e.EmailComposeType=e.FontSize=e.Theme=e.Chain=e.AuthStatus=e.debounceAsync=e.clearExpiredCache=e.withCache=e.withTimeout=e.safeParallel=e.withLoadingState=e.safeAsync=void 0,r(Cs(),e),r(tl(),e);var n=tl();Object.defineProperty(e,"safeAsync",{enumerable:!0,get:function(){return n.safeAsync}}),Object.defineProperty(e,"withLoadingState",{enumerable:!0,get:function(){return n.withLoadingState}}),Object.defineProperty(e,"safeParallel",{enumerable:!0,get:function(){return n.safeParallel}}),Object.defineProperty(e,"withTimeout",{enumerable:!0,get:function(){return n.withTimeout}}),Object.defineProperty(e,"withCache",{enumerable:!0,get:function(){return n.withCache}}),Object.defineProperty(e,"clearExpiredCache",{enumerable:!0,get:function(){return n.clearExpiredCache}}),Object.defineProperty(e,"debounceAsync",{enumerable:!0,get:function(){return n.debounceAsync}});var o=Cs();Object.defineProperty(e,"AuthStatus",{enumerable:!0,get:function(){return o.AuthStatus}}),Object.defineProperty(e,"Chain",{enumerable:!0,get:function(){return o.Chain}}),Object.defineProperty(e,"Theme",{enumerable:!0,get:function(){return o.Theme}}),Object.defineProperty(e,"FontSize",{enumerable:!0,get:function(){return o.FontSize}}),Object.defineProperty(e,"EmailComposeType",{enumerable:!0,get:function(){return o.EmailComposeType}}),Object.defineProperty(e,"MobileView",{enumerable:!0,get:function(){return o.MobileView}}),Object.defineProperty(e,"RequestStatus",{enumerable:!0,get:function(){return o.RequestStatus}}),Object.defineProperty(e,"NotificationType",{enumerable:!0,get:function(){return o.NotificationType}}),Object.defineProperty(e,"InfoType",{enumerable:!0,get:function(){return o.InfoType}}),Object.defineProperty(e,"MessageType",{enumerable:!0,get:function(){return o.MessageType}}),Object.defineProperty(e,"TransactionStatus",{enumerable:!0,get:function(){return o.TransactionStatus}}),Object.defineProperty(e,"AnalyticsEvent",{enumerable:!0,get:function(){return o.AnalyticsEvent}}),Object.defineProperty(e,"ChainType",{enumerable:!0,get:function(){return o.ChainType}}),Object.defineProperty(e,"WalletType",{enumerable:!0,get:function(){return o.WalletType}}),Object.defineProperty(e,"StorageType",{enumerable:!0,get:function(){return o.StorageType}}),Object.defineProperty(e,"ContractType",{enumerable:!0,get:function(){return o.ContractType}}),Object.defineProperty(e,"ProcessedEventName",{enumerable:!0,get:function(){return o.ProcessedEventName}})})(yt)),yt}var Ar=ag();const ig=d.forwardRef(({className:e,type:t,onTrack:r,trackingLabel:n,componentName:o,onBlur:a,onChange:i,...s},l)=>{const c=u=>{r&&r({action:"blur",trackingLabel:n,componentName:o}),a?.(u)},f=u=>{r&&r({action:"change",trackingLabel:n,componentName:o}),i?.(u)};return S.jsx("input",{type:t,className:Q(de.input.default(),e),ref:l,onBlur:c,onChange:f,...s})});ig.displayName="Input";const sg=d.forwardRef(({className:e,onTrack:t,trackingLabel:r,componentName:n,onCheckedChange:o,...a},i)=>{const s=l=>{t&&t({action:"toggle",trackingLabel:r,componentName:n}),o?.(l)};return S.jsx(ao,{className:Q("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2 focus-visible:ring-offset-white disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-blue-600 data-[state=unchecked]:bg-gray-200 dark:focus-visible:ring-blue-400 dark:focus-visible:ring-offset-gray-950 dark:data-[state=checked]:bg-blue-500 dark:data-[state=unchecked]:bg-gray-700",e),onCheckedChange:s,...a,ref:i,children:S.jsx(cc,{className:Q("pointer-events-none block h-5 w-5 rounded-full bg-white shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})})});sg.displayName=ao.displayName;const lg=d.forwardRef(({className:e,children:t,...r},n)=>S.jsxs(Ba,{ref:n,className:Q("flex h-9 w-full items-center justify-between rounded-md border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-800 px-3 py-2 text-sm text-gray-900 dark:text-gray-100 hover:bg-gray-50 dark:hover:bg-gray-700 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 dark:ring-offset-gray-950 transition-colors disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...r,children:[t,S.jsx(bf,{asChild:!0,children:S.jsx(Ct.ChevronDown,{className:"h-4 w-4 opacity-50 ml-2 flex-shrink-0"})})]}));lg.displayName=Ba.displayName;const nl=d.forwardRef(({className:e,...t},r)=>S.jsx(Ya,{ref:r,className:Q("flex cursor-default items-center justify-center py-1",e),...t,children:S.jsx(Ct.ChevronUp,{className:"h-4 w-4"})}));nl.displayName=Ya.displayName;const ol=d.forwardRef(({className:e,...t},r)=>S.jsx(Ka,{ref:r,className:Q("flex cursor-default items-center justify-center py-1",e),...t,children:S.jsx(Ct.ChevronDown,{className:"h-4 w-4"})}));ol.displayName=Ka.displayName;const cg=d.forwardRef(({className:e,children:t,position:r="popper",...n},o)=>S.jsx(yf,{children:S.jsxs(za,{ref:o,className:Q(de.overlays.dropdown.menu(),"z-[1000000] max-h-96 min-w-[8rem] overflow-hidden data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-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",r==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:r,...n,children:[S.jsx(nl,{}),S.jsx(vf,{className:Q(de.overlays.dropdown.itemContainer(),r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),S.jsx(ol,{})]})}));cg.displayName=za.displayName;const ug=d.forwardRef(({className:e,...t},r)=>S.jsx(Ha,{ref:r,className:Q(de.overlays.dropdown.header(),"py-1.5",e),...t}));ug.displayName=Ha.displayName;const dg=d.forwardRef(({className:e,children:t,...r},n)=>S.jsxs(Ga,{ref:n,className:Q(de.overlays.dropdown.item(),"relative select-none justify-between pr-8 data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...r,children:[S.jsx(wf,{children:t}),S.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:S.jsx(Ef,{children:S.jsx(Ct.Check,{className:"h-4 w-4"})})})]}));dg.displayName=Ga.displayName;const fg=d.forwardRef(({className:e,...t},r)=>S.jsx(Xa,{ref:r,className:Q("my-1 h-px bg-gray-200 dark:bg-gray-700",e),...t}));fg.displayName=Xa.displayName;const pg=zt(`${Mt.label.default()} peer-disabled:cursor-not-allowed peer-disabled:opacity-70`),mg=d.forwardRef(({className:e,...t},r)=>S.jsx(Qa,{ref:r,className:Q(pg(),e),...t}));mg.displayName=Qa.displayName;const gg=zt("min-h-[44px] touch-manipulation",{variants:{variant:{default:"",primary:"",secondary:"",outline:"",ghost:"",destructive:"","destructive-outline":"",success:"",link:"",gradient:"","gradient-secondary":"","gradient-success":"",wallet:"",connect:"",disconnect:""},size:{default:"",sm:"h-8",lg:"h-12",icon:"h-10 w-10 p-0"},animation:{none:"transition-colors duration-200",hover:"transition-all duration-200 hover:scale-105",lift:"transition-all duration-200 hover:scale-105",scale:"transition-transform duration-200 hover:scale-95",glow:"transition-all duration-200 hover:shadow-lg",shimmer:"transition-all duration-200",tap:"transition-transform duration-100 active:scale-95",connect:"transition-all duration-200 hover:scale-105",transaction:"transition-all duration-200 animate-pulse",disconnect:"transition-all duration-200 hover:opacity-80"}},defaultVariants:{variant:"default",size:"default",animation:"hover"}}),hg=d.forwardRef(({className:e,variant:t,size:r,animation:n,asChild:o=!1,onTrack:a,trackingLabel:i,componentName:s,onClick:l,children:c,...f},u)=>{const p=o?Cf:"button",h=t||"default",y=r&&r!=="default"&&r!=="icon"?r:void 0,m=E=>E?{sm:"small",lg:"large",default:"default"}[E]||E:"default",g=(()=>{if(h.startsWith("gradient")){const E=h.replace("gradient-","").replace("gradient","primary");return de.button.gradient[E]?.()||de.button.primary.default()}else{if(["wallet","connect","disconnect"].includes(h))return de.button.web3[h]?.()||de.button.primary.default();{const E=m(y);return de.button[h]?.[E]?.()||de.button.primary.default()}}})(),w=E=>{a&&a({action:"click",trackingLabel:i,componentName:s}),l?.(E)};return S.jsx(p,{className:Q(gg({size:r,animation:n}),g,e),ref:u,onClick:w,...f,children:c})});hg.displayName="Button",Ar.InfoType.INFO+"",Ar.InfoType.SUCCESS+"",Ar.InfoType.WARNING+"",Ar.InfoType.ERROR+"";const xn=zt("transition-all duration-200 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 rounded-sm",{variants:{variant:{subtle:Mt.link.subtle(),default:Mt.link.default(),muted:Mt.link.muted(),external:Mt.link.external(),inherit:"text-inherit hover:text-blue-600 dark:hover:text-blue-400 underline-offset-2 hover:underline transition-colors duration-200"},size:{sm:"text-sm",default:"text-base",lg:"text-lg"}},defaultVariants:{variant:"subtle",size:"default"}}),bg=d.forwardRef(({className:e,variant:t,size:r,to:n,href:o,external:a,children:i,onTrack:s,trackingLabel:l,componentName:c,onClick:f,...u},p)=>{const h=n||o,y=a||h&&(h.startsWith("http")||h.startsWith("mailto:")),m=g=>{s&&s({action:"click",trackingLabel:l,componentName:c}),f?.(g)};return h?y?S.jsx("a",{className:Q(xn({variant:t==="subtle"?"external":t,size:r,className:e})),href:h,target:"_blank",rel:"noopener noreferrer",ref:p,onClick:m,...u,children:i}):S.jsx(yn,{className:Q(xn({variant:t,size:r,className:e})),to:h,ref:p,onClick:m,...u,children:i}):S.jsx("span",{className:Q(xn({variant:t,size:r,className:e})),onClick:m,...u,children:i})});bg.displayName="SmartLink";const yg=d.forwardRef(({onTrack:e,trackingLabel:t,componentName:r,onValueChange:n,children:o,...a},i)=>S.jsx(wm,{ref:i,onValueChange:s=>{e&&e({action:"change",trackingLabel:t,componentName:r}),n?.(s)},...a,children:o}));yg.displayName="Tabs";const vg=d.forwardRef(({className:e,...t},r)=>S.jsx(Wi,{ref:r,className:Q(de.navigation.tabs.list(),e),...t}));vg.displayName=Wi.displayName;const wg=d.forwardRef(({className:e,...t},r)=>S.jsx(Ui,{ref:r,className:Q(de.navigation.tabs.trigger(),e),...t}));wg.displayName=Ui.displayName;const Eg=d.forwardRef(({className:e,...t},r)=>S.jsx(Vi,{ref:r,className:Q(de.navigation.tabs.content(),e),...t}));Eg.displayName=Vi.displayName,K.createContext(void 0),K.memo(({children:e,compute:t,deps:r})=>{const n=K.useRef(r),o=K.useRef(t),a=K.useRef(void 0),i=K.useMemo(()=>{const s=r.length!==n.current.length||r.some((c,f)=>c!==n.current[f]),l=t!==o.current;if(s||l||a.current===void 0){let c;return process.env.NODE_ENV==="development"?(performance.now(),c=t(),performance.now()):c=t(),n.current=r,o.current=t,a.current=c,c}return a.current},[t,r]);return S.jsx(S.Fragment,{children:e(i)})}),K.memo(({item:e,index:t,style:r,renderItem:n})=>S.jsx("div",{style:r,children:n(e,t)}),(e,t)=>e.index===t.index&&e.item===t.item&&e.style.height===t.style.height&&e.style.top===t.style.top),K.memo(({condition:e,children:t,fallback:r=null})=>e?S.jsx(S.Fragment,{children:t}):S.jsx(S.Fragment,{children:r})),K.createContext(void 0),K.createContext(null);const Sg=e=>({"default-src":["'self'"],"script-src":["'self'","'unsafe-inline'","'unsafe-eval'","https://fonts.googleapis.com","https://www.googletagmanager.com","https://www.google-analytics.com"],"style-src":["'self'","'unsafe-inline'","https://fonts.googleapis.com","https://fonts.gstatic.com"],"font-src":["'self'","https://fonts.gstatic.com","data:"],"img-src":["'self'","data:","https:","blob:"],"connect-src":["'self'","https://*.walletconnect.com","https://*.walletconnect.org","https://registry.walletconnect.com","https://relay.walletconnect.com","wss://*.walletconnect.com","wss://*.walletconnect.org","https://keys.coinbase.com","https://api.coinbase.com","https://www.walletlink.org","https://mainnet.infura.io","https://polygon-rpc.com","https://rpc.ankr.com","https://cloudflare-eth.com","https://eth-mainnet.alchemyapi.io","https://api.phantom.app","https://solana-api.projectserum.com","https://api.mainnet-beta.solana.com","https://api.devnet.solana.com","wss://api.phantom.app","wss://api.devnet.solana.com","wss://api.mainnet-beta.solana.com","https://bridge.arbitrum.io","https://polygon-mainnet.infura.io","https://optimism-mainnet.infura.io"],"frame-src":["'self'","https://verify.walletconnect.com","https://verify.walletconnect.org"],"worker-src":["'self'","blob:"],"child-src":["'self'","https://verify.walletconnect.com"],"object-src":["'none'"],"base-uri":["'self'"],"form-action":["'self'"]}),xg=e=>{const t=Sg();return Object.entries(t).map(([r,n])=>`${r} ${n.join(" ")}`).join("; ")};(e=>({"X-Frame-Options":"DENY","X-Content-Type-Options":"nosniff","X-XSS-Protection":"1; mode=block","Referrer-Policy":"strict-origin-when-cross-origin","Permissions-Policy":"camera=(), microphone=(), geolocation=(), interest-cohort=()","Strict-Transport-Security":"max-age=31536000; includeSubDomains; preload","Cross-Origin-Embedder-Policy":"credentialless","Cross-Origin-Opener-Policy":"same-origin-allow-popups","Cross-Origin-Resource-Policy":"cross-origin","Content-Security-Policy":xg()}))();function Cg(){if("connection"in navigator){const e=navigator.connection;e&&(e.effectiveType==="4g"||e.effectiveType)}}Cg(),process.env.NODE_ENV,process.env.NODE_ENV,process.env.NODE_ENV;var al=(e=>(e[e.HIGH=0]="HIGH",e[e.MEDIUM=1]="MEDIUM",e[e.LOW=2]="LOW",e[e.IDLE=3]="IDLE",e))(al||{});class Ag{constructor(){this.queues=new Map,this.isProcessing=!1,Object.values(al).filter(t=>typeof t=="number").forEach(t=>{this.queues.set(t,[])})}load(t,r=1){const n=this.queues.get(r);n&&n.push(t),this.process()}async process(){if(!this.isProcessing){this.isProcessing=!0;for(const[t,r]of this.queues)for(;r.length>0;){const n=r.shift();if(n)try{await n()}catch{}t>=2&&await new Promise(o=>setTimeout(o,50))}this.isProcessing=!1}}}new Ag;class Cn{constructor(t={}){this.prefix=t.prefix||"mailbox",this.defaultTTL=t.ttl,this.platformStorage=t.platformStorage||this.createFallbackStorage()}createFallbackStorage(){const t=new Map;return{getItem:r=>t.get(r)||null,setItem:(r,n)=>{t.set(r,n)},removeItem:r=>{t.delete(r)},clear:()=>{t.clear()},getAllKeys:()=>Array.from(t.keys())}}getKey(t){return`${this.prefix}-${t}`}isExpired(t){return t.ttl?Date.now()-t.timestamp>t.ttl:!1}set(t,r,n){try{const o={value:r,timestamp:Date.now(),ttl:n||this.defaultTTL};this.platformStorage.setItem(this.getKey(t),JSON.stringify(o))}catch{}}get(t,r){try{const n=this.platformStorage.getItem(this.getKey(t));if(!n)return r;const o=JSON.parse(n);return this.isExpired(o)?(this.remove(t),r):o.value}catch{return r}}remove(t){try{this.platformStorage.removeItem(this.getKey(t))}catch{}}clear(t){try{if(this.platformStorage.getAllKeys){const r=this.platformStorage.getAllKeys(),n=this.getKey(t||""),o=r.filter(a=>a.startsWith(n));for(const a of o)this.platformStorage.removeItem(a)}else this.platformStorage.clear?.()}catch(r){console.error("Failed to clear storage:",r)}}has(t){try{return this.platformStorage.getItem(this.getKey(t))!==null}catch(r){return console.error(`Failed to check item ${t}:`,r),!1}}getAllKeys(){try{if(this.platformStorage.getAllKeys){const t=this.platformStorage.getAllKeys(),r=`${this.prefix}-`;return t.filter(n=>n.startsWith(r)).map(n=>n.substring(r.length))}return[]}catch(t){return console.error("Failed to get all keys:",t),[]}}}new Cn,new Cn({prefix:"mailbox-theme"}),new Cn({prefix:"walletUser",ttl:10080*60*1e3});function Tg({client:e,onSelectEntity:t}){const[r,n]=K.useState(!1),[o,a]=K.useState({displayName:"",description:""}),[i,s]=K.useState(null),{data:l=[],isLoading:c}=ye.useEntities(e),f=ye.useCreateEntity(e),u=l.filter(y=>y.entityType==="personal"),p=l.filter(y=>y.entityType==="organization"),h=async y=>{if(y.preventDefault(),s(null),!o.displayName.trim()){s("Display name is required");return}try{await f.mutateAsync({displayName:o.displayName.trim(),description:o.description.trim()||void 0}),n(!1),a({displayName:"",description:""})}catch(m){s(m.message||"Failed to create organization")}};return S.jsxs(xr,{spacing:"lg",maxWidth:"4xl",children:[S.jsxs("div",{className:"flex items-center justify-between mb-8",children:[S.jsxs("div",{children:[S.jsx("h1",{className:"text-2xl font-bold text-foreground",children:"Workspaces"}),S.jsx("p",{className:"text-muted-foreground",children:"Manage your personal and organization workspaces"})]}),S.jsxs("button",{type:"button",onClick:()=>n(!0),className:"flex items-center gap-2 px-4 py-2 rounded-lg bg-primary text-primary-foreground font-medium hover:bg-primary/90 transition-colors",children:[S.jsx(Ct.Plus,{className:"h-4 w-4"}),S.jsx("span",{children:"New Organization"})]})]}),r&&S.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50",children:S.jsxs("div",{className:"w-full max-w-md rounded-lg bg-background p-6 shadow-lg",children:[S.jsx("h2",{className:"text-lg font-semibold mb-4",children:"Create Organization"}),S.jsxs("form",{onSubmit:h,className:"space-y-4",children:[S.jsxs("div",{children:[S.jsx("label",{className:"block text-sm font-medium mb-1",children:"Display Name"}),S.jsx("input",{type:"text",value:o.displayName,onChange:y=>a(m=>({...m,displayName:y.target.value})),placeholder:"My Organization",className:"w-full px-3 py-2 rounded-lg border bg-background focus:outline-none focus:ring-2 focus:ring-primary"})]}),S.jsxs("div",{children:[S.jsx("label",{className:"block text-sm font-medium mb-1",children:"Description (optional)"}),S.jsx("textarea",{value:o.description,onChange:y=>a(m=>({...m,description:y.target.value})),placeholder:"What is this organization for?",rows:3,className:"w-full px-3 py-2 rounded-lg border bg-background focus:outline-none focus:ring-2 focus:ring-primary resize-none"})]}),i&&S.jsx("p",{className:"text-sm text-destructive",children:i}),S.jsxs("div",{className:"flex justify-end gap-2",children:[S.jsx("button",{type:"button",onClick:()=>{n(!1),a({displayName:"",description:""}),s(null)},className:"px-4 py-2 rounded-lg border hover:bg-muted transition-colors",children:"Cancel"}),S.jsx("button",{type:"submit",disabled:f.isPending,className:"px-4 py-2 rounded-lg bg-primary text-primary-foreground font-medium hover:bg-primary/90 transition-colors disabled:opacity-50",children:f.isPending?"Creating...":"Create"})]})]})]})}),u.length>0&&S.jsxs("div",{className:"mb-8",children:[S.jsx("h2",{className:"text-lg font-semibold mb-3",children:"Personal Workspace"}),S.jsx(nt.EntityList,{entities:u,onSelect:t,isLoading:c})]}),S.jsxs("div",{children:[S.jsx("h2",{className:"text-lg font-semibold mb-3",children:"Organizations"}),p.length===0&&!c?S.jsxs("div",{className:"text-center py-8 text-muted-foreground border border-dashed rounded-lg",children:[S.jsx("p",{children:"No organizations yet"}),S.jsx("button",{type:"button",onClick:()=>n(!0),className:"mt-2 text-primary hover:underline",children:"Create your first organization"})]}):S.jsx(nt.EntityList,{entities:p,onSelect:t,isLoading:c})]})]})}function Og({client:e,entity:t,currentUserId:r}){const n=t.userRole==="admin",{data:o=[],isLoading:a}=ye.useEntityMembers(e,t.entitySlug),i=ye.useUpdateMemberRole(e),s=ye.useRemoveMember(e),{data:l=[],isLoading:c}=ye.useEntityInvitations(e,n?t.entitySlug:null),f=ye.useCreateInvitation(e),u=ye.useCancelInvitation(e),p=async(g,w)=>{try{await i.mutateAsync({entitySlug:t.entitySlug,memberId:g,role:w})}catch(E){console.error("Failed to update role:",E)}},h=async g=>{if(confirm("Are you sure you want to remove this member?"))try{await s.mutateAsync({entitySlug:t.entitySlug,memberId:g})}catch(w){console.error("Failed to remove member:",w)}},y=async g=>{await f.mutateAsync({entitySlug:t.entitySlug,request:g})},m=async g=>{try{await u.mutateAsync({entitySlug:t.entitySlug,invitationId:g})}catch(w){console.error("Failed to cancel invitation:",w)}};return t.entityType==="personal"?S.jsx(xr,{spacing:"lg",maxWidth:"4xl",children:S.jsxs("div",{className:"text-center py-12 text-muted-foreground",children:[S.jsx("p",{children:"Personal workspaces cannot have additional members."}),S.jsx("p",{className:"mt-2",children:"Create an organization to collaborate with others."})]})}):S.jsxs(xr,{spacing:"lg",maxWidth:"4xl",children:[S.jsxs("div",{className:"mb-8",children:[S.jsx("h1",{className:"text-2xl font-bold text-foreground",children:"Members"}),S.jsxs("p",{className:"text-muted-foreground",children:["Manage members and invitations for ",t.displayName]})]}),n&&S.jsxs("div",{className:"rounded-lg border p-4 mb-8",children:[S.jsx("h2",{className:"text-lg font-semibold mb-4",children:"Invite Members"}),S.jsx(nt.InvitationForm,{onSubmit:y,isSubmitting:f.isPending})]}),n&&S.jsxs("div",{className:"mb-8",children:[S.jsx("h2",{className:"text-lg font-semibold mb-3",children:"Pending Invitations"}),S.jsx(nt.InvitationList,{invitations:l,mode:"admin",onCancel:m,isLoading:c,emptyMessage:"No pending invitations"})]}),S.jsxs("div",{children:[S.jsxs("h2",{className:"text-lg font-semibold mb-3",children:["Current Members (",o.length,")"]}),S.jsx(nt.MemberList,{members:o,currentUserId:r,canManage:n,onRoleChange:p,onRemove:h,isLoading:a})]})]})}function Pg({client:e,onInvitationAccepted:t}){const{data:r=[],isLoading:n}=ye.useMyInvitations(e),o=ye.useAcceptInvitation(e),a=ye.useDeclineInvitation(e),i=async c=>{try{await o.mutateAsync(c),t?.()}catch(f){console.error("Failed to accept invitation:",f)}},s=async c=>{try{await a.mutateAsync(c)}catch(f){console.error("Failed to decline invitation:",f)}},l=r.filter(c=>c.status==="pending").length;return S.jsxs(xr,{spacing:"lg",maxWidth:"4xl",children:[S.jsxs("div",{className:"mb-6",children:[S.jsx("h1",{className:"text-2xl font-bold text-foreground",children:"Invitations"}),S.jsx("p",{className:"text-muted-foreground",children:l>0?`You have ${l} pending invitation${l>1?"s":""}`:"No pending invitations"})]}),S.jsx(nt.InvitationList,{invitations:r,mode:"user",onAccept:i,onDecline:s,isLoading:n,emptyMessage:"You don't have any pending invitations"})]})}ue.EntityListPage=Tg,ue.InvitationsPage=Pg,ue.MembersManagementPage=Og,Object.defineProperty(ue,Symbol.toStringTag,{value:"Module"})}));
|
|
44
|
+
Nonce: ${u}`}function r(c,f=24){const u=new Date(c.getTime()+f*60*60*1e3);return new Date>u}function n(c){switch(c){case e.AuthStatus.DISCONNECTED:return"Not connected";case e.AuthStatus.CONNECTED:return"Connected - Please verify";case e.AuthStatus.VERIFIED:return"Authenticated";default:return"Unknown status"}}function o(c){return c===e.AuthStatus.VERIFIED}function a(c){return c===e.AuthStatus.CONNECTED||c===e.AuthStatus.VERIFIED}function i(){return`${Date.now()}-${Math.random().toString(36).substr(2,9)}`}function s(c){const f=c.match(/Nonce:\s*(.+)$/m);return f?f[1].trim():void 0}function l(c){if(!c||typeof c!="string"||c.length<10)return!1;const f=c.split("-");if(f.length>=2){const u=parseInt(f[0],10);if(!isNaN(u)){const p=Date.now()-864e5;if(u<p)return!1}}return!0}return xe}var Ls;function Ym(){return Ls||(Ls=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.isValidNonce=e.isAuthStatusConnected=e.isAuthExpired=e.getAuthStatusText=e.generateNonce=e.generateAuthMessage=e.extractNonceFromMessage=e.canAccessProtectedFeatures=void 0;var t=Gm();Object.defineProperty(e,"canAccessProtectedFeatures",{enumerable:!0,get:function(){return t.canAccessProtectedFeatures}}),Object.defineProperty(e,"extractNonceFromMessage",{enumerable:!0,get:function(){return t.extractNonceFromMessage}}),Object.defineProperty(e,"generateAuthMessage",{enumerable:!0,get:function(){return t.generateAuthMessage}}),Object.defineProperty(e,"generateNonce",{enumerable:!0,get:function(){return t.generateNonce}}),Object.defineProperty(e,"getAuthStatusText",{enumerable:!0,get:function(){return t.getAuthStatusText}}),Object.defineProperty(e,"isAuthExpired",{enumerable:!0,get:function(){return t.isAuthExpired}}),Object.defineProperty(e,"isAuthStatusConnected",{enumerable:!0,get:function(){return t.isAuthStatusConnected}}),Object.defineProperty(e,"isValidNonce",{enumerable:!0,get:function(){return t.isValidNonce}})})(_s)),_s}var Ds={},js={},Fs;function Km(){return Fs||(Fs=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CLAIM_PERIOD_DAYS=e.USDC_DECIMALS=void 0,e.formatUSDC=t,e.parseUSDC=r,e.USDC_DECIMALS=6,e.CLAIM_PERIOD_DAYS=60;function t(n){return(n/Math.pow(10,e.USDC_DECIMALS)).toFixed(2)}function r(n){return Math.floor(parseFloat(n)*Math.pow(10,e.USDC_DECIMALS))}})(js)),js}var Re={},$s;function Xm(){if($s)return Re;$s=1,Object.defineProperty(Re,"__esModule",{value:!0}),Re.formatEmailDate=e,Re.formatTimestamp=t,Re.formatRelativeTime=r,Re.parseDate=n,Re.isDateInRange=o,Re.addDays=a,Re.addHours=i;function e(s){const l=typeof s=="string"?new Date(s):s;if(isNaN(l.getTime()))return"Invalid date";const c=new Date,f=c.getTime()-l.getTime(),u=Math.floor(f/(1e3*60*60*24));return u===0?l.toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0}):u===1?"Yesterday":u<7?l.toLocaleDateString("en-US",{weekday:"long"}):l.getFullYear()===c.getFullYear()?l.toLocaleDateString("en-US",{month:"short",day:"numeric"}):l.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})}function t(s){return new Date(s).toISOString()}function r(s){const l=typeof s=="string"||typeof s=="number"?new Date(s):s;if(isNaN(l.getTime()))return"Invalid date";const c=new Date().getTime()-l.getTime(),f=Math.floor(c/1e3),u=Math.floor(f/60),p=Math.floor(u/60),h=Math.floor(p/24),y=Math.floor(h/7),m=Math.floor(h/30),g=Math.floor(h/365);return f<60?"just now":u<60?u===1?"1 minute ago":`${u} minutes ago`:p<24?p===1?"1 hour ago":`${p} hours ago`:h<7?h===1?"1 day ago":`${h} days ago`:y<4?y===1?"1 week ago":`${y} weeks ago`:m<12?m===1?"1 month ago":`${m} months ago`:g===1?"1 year ago":`${g} years ago`}function n(s){try{const l=new Date(s);return isNaN(l.getTime())?null:l}catch{return null}}function o(s,l,c){return s>=l&&s<=c}function a(s,l){const c=new Date(s);return c.setDate(c.getDate()+l),c}function i(s,l){const c=new Date(s);return c.setHours(c.getHours()+l),c}return Re}var oe={},Ws;function qm(){if(Ws)return oe;Ws=1,Object.defineProperty(oe,"__esModule",{value:!0}),oe.truncate=e,oe.capitalize=t,oe.toTitleCase=r,oe.toKebabCase=n,oe.toCamelCase=o,oe.toSnakeCase=a,oe.normalizeWhitespace=i,oe.isBlank=s,oe.isNotBlank=l,oe.escapeHtml=c,oe.stripHtml=f,oe.getInitials=u,oe.formatBytes=p,oe.randomString=h,oe.pluralize=y,oe.formatNumber=m;function e(g,w,E="..."){return!g||g.length<=w?g:g.slice(0,w-E.length)+E}function t(g){return g&&g.charAt(0).toUpperCase()+g.slice(1)}function r(g){return g&&g.toLowerCase().split(" ").map(w=>t(w)).join(" ")}function n(g){return g&&g.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase()}function o(g){return g&&g.replace(/[-_\s]+(.)?/g,(w,E)=>E?E.toUpperCase():"").replace(/^./,w=>w.toLowerCase())}function a(g){return g&&g.replace(/([a-z])([A-Z])/g,"$1_$2").replace(/[\s-]+/g,"_").toLowerCase()}function i(g){return g&&g.replace(/\s+/g," ").trim()}function s(g){return!g||g.trim().length===0}function l(g){return!s(g)}function c(g){if(!g)return g;const w={"&":"&","<":"<",">":">",'"':""","'":"'"};return g.replace(/[&<>"']/g,E=>w[E])}function f(g){return g&&g.replace(/<[^>]*>/g,"")}function u(g,w=2){return g?g.trim().split(/\s+/).slice(0,w).map(E=>E.charAt(0).toUpperCase()).join(""):""}function p(g,w=2){if(g===0)return"0 Bytes";const E=1024,v=w<0?0:w,x=["Bytes","KB","MB","GB","TB","PB"],C=Math.floor(Math.log(g)/Math.log(E));return parseFloat((g/Math.pow(E,C)).toFixed(v))+" "+x[C]}function h(g,w="alphanumeric"){let E;switch(w){case"alpha":E="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";break;case"numeric":E="0123456789";break;case"alphanumeric":E="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";break;case"hex":E="0123456789abcdef";break;default:E=w}let v="";for(let x=0;x<g;x++)v+=E.charAt(Math.floor(Math.random()*E.length));return v}function y(g,w,E){return g===1?w:E||`${w}s`}function m(g){return g.toString().replace(/\B(?=(\d{3})+(?!\d))/g,",")}return oe}var Us;function Zm(){return Us||(Us=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.truncate=e.toTitleCase=e.toSnakeCase=e.toKebabCase=e.toCamelCase=e.stripHtml=e.randomString=e.pluralize=e.normalizeWhitespace=e.isNotBlank=e.isBlank=e.getInitials=e.formatNumber=e.formatBytes=e.escapeHtml=e.capitalize=e.parseDate=e.isDateInRange=e.formatTimestamp=e.formatRelativeTime=e.formatEmailDate=e.addHours=e.addDays=e.parseUSDC=e.formatUSDC=e.USDC_DECIMALS=e.CLAIM_PERIOD_DAYS=void 0;var t=Km();Object.defineProperty(e,"CLAIM_PERIOD_DAYS",{enumerable:!0,get:function(){return t.CLAIM_PERIOD_DAYS}}),Object.defineProperty(e,"USDC_DECIMALS",{enumerable:!0,get:function(){return t.USDC_DECIMALS}}),Object.defineProperty(e,"formatUSDC",{enumerable:!0,get:function(){return t.formatUSDC}}),Object.defineProperty(e,"parseUSDC",{enumerable:!0,get:function(){return t.parseUSDC}});var r=Xm();Object.defineProperty(e,"addDays",{enumerable:!0,get:function(){return r.addDays}}),Object.defineProperty(e,"addHours",{enumerable:!0,get:function(){return r.addHours}}),Object.defineProperty(e,"formatEmailDate",{enumerable:!0,get:function(){return r.formatEmailDate}}),Object.defineProperty(e,"formatRelativeTime",{enumerable:!0,get:function(){return r.formatRelativeTime}}),Object.defineProperty(e,"formatTimestamp",{enumerable:!0,get:function(){return r.formatTimestamp}}),Object.defineProperty(e,"isDateInRange",{enumerable:!0,get:function(){return r.isDateInRange}}),Object.defineProperty(e,"parseDate",{enumerable:!0,get:function(){return r.parseDate}});var n=qm();Object.defineProperty(e,"capitalize",{enumerable:!0,get:function(){return n.capitalize}}),Object.defineProperty(e,"escapeHtml",{enumerable:!0,get:function(){return n.escapeHtml}}),Object.defineProperty(e,"formatBytes",{enumerable:!0,get:function(){return n.formatBytes}}),Object.defineProperty(e,"formatNumber",{enumerable:!0,get:function(){return n.formatNumber}}),Object.defineProperty(e,"getInitials",{enumerable:!0,get:function(){return n.getInitials}}),Object.defineProperty(e,"isBlank",{enumerable:!0,get:function(){return n.isBlank}}),Object.defineProperty(e,"isNotBlank",{enumerable:!0,get:function(){return n.isNotBlank}}),Object.defineProperty(e,"normalizeWhitespace",{enumerable:!0,get:function(){return n.normalizeWhitespace}}),Object.defineProperty(e,"pluralize",{enumerable:!0,get:function(){return n.pluralize}}),Object.defineProperty(e,"randomString",{enumerable:!0,get:function(){return n.randomString}}),Object.defineProperty(e,"stripHtml",{enumerable:!0,get:function(){return n.stripHtml}}),Object.defineProperty(e,"toCamelCase",{enumerable:!0,get:function(){return n.toCamelCase}}),Object.defineProperty(e,"toKebabCase",{enumerable:!0,get:function(){return n.toKebabCase}}),Object.defineProperty(e,"toSnakeCase",{enumerable:!0,get:function(){return n.toSnakeCase}}),Object.defineProperty(e,"toTitleCase",{enumerable:!0,get:function(){return n.toTitleCase}}),Object.defineProperty(e,"truncate",{enumerable:!0,get:function(){return n.truncate}})})(Ds)),Ds}var Vs={},D={},Bs;function Jm(){if(Bs)return D;Bs=1,Object.defineProperty(D,"__esModule",{value:!0}),D.Z_INDEX=D.ANIMATION=D.NETWORK_IDS=D.WALLET_NAMES=D.CONTACT_INFO=D.ROUTES=D.SUCCESS_MESSAGES=D.ERROR_MESSAGES=D.TIME_FORMAT=D.SUBSCRIPTION_TIERS=D.EMAIL_CONFIG=D.STORAGE_KEYS=D.CHAIN_TYPE=D.AUTH_STATUS=D.API_RETRY_DELAY=D.API_RETRY_ATTEMPTS=D.API_TIMEOUT=void 0;const e=3e4;D.API_TIMEOUT=e;const t=3;D.API_RETRY_ATTEMPTS=t;const r=1e3;D.API_RETRY_DELAY=r;const n={DISCONNECTED:"disconnected",CONNECTED:"connected",VERIFIED:"verified"};D.AUTH_STATUS=n;const o={EVM:"evm",SOLANA:"solana",UNKNOWN:"unknown"};D.CHAIN_TYPE=o;const a={AUTH_TOKEN:"authToken",USER_DATA:"userData",THEME:"theme",EMAIL_CACHE:"emailCache",WALLET_ADDRESS:"walletAddress",CHAIN_TYPE:"chainType"};D.STORAGE_KEYS=a;const i={MAX_ATTACHMENT_SIZE:25*1024*1024,MAX_RECIPIENTS:100,ITEMS_PER_PAGE:50,REFRESH_INTERVAL:6e4,NOTIFICATION_COOLDOWN:3e5};D.EMAIL_CONFIG=i;const s={FREE:"free",BASIC:"basic",PRO:"pro",ENTERPRISE:"enterprise"};D.SUBSCRIPTION_TIERS=s;const l={SHORT_DATE:"MMM d",FULL_DATE:"MMM d, yyyy",DATE_TIME:"MMM d, yyyy h:mm a",RELATIVE:"relative"};D.TIME_FORMAT=l;const c={WALLET_NOT_CONNECTED:"Please connect your wallet first",INVALID_ADDRESS:"Please enter a valid address",NETWORK_ERROR:"Network error. Please try again.",AUTHENTICATION_FAILED:"Authentication failed. Please sign in again.",TRANSACTION_FAILED:"Transaction failed. Please try again.",INSUFFICIENT_FUNDS:"Insufficient funds for this operation",RATE_LIMITED:"Too many requests. Please wait a moment.",SESSION_EXPIRED:"Your session has expired. Please sign in again.",PERMISSION_DENIED:"You do not have permission to perform this action"};D.ERROR_MESSAGES=c;const f={EMAIL_SENT:"Email sent successfully",EMAIL_DELETED:"Email deleted successfully",PREFERENCES_SAVED:"Preferences saved successfully",WALLET_CONNECTED:"Wallet connected successfully",AUTHENTICATION_SUCCESS:"Authentication successful",DELEGATION_SUCCESS:"Delegation successful",SUBSCRIPTION_ACTIVATED:"Subscription activated successfully"};D.SUCCESS_MESSAGES=f;const u={HOME:"/",ABOUT:"/about",CONNECT:"/connect",MAIL:"/mail",COMPOSE:"/mail/compose",PREFERENCES:"/preferences",TERMS:"/terms",PRIVACY:"/privacy",DOCUMENTATION:"/document",WEB3_USERS:"/web3-users",WEB3_PROJECTS:"/web3-projects"};D.ROUTES=u;const p={SUPPORT_EMAIL:"support@sudobility.com",CONTACT_EMAIL:"info@sudobility.com"};D.CONTACT_INFO=p;const h={METAMASK:"MetaMask",WALLETCONNECT:"WalletConnect",COINBASE:"Coinbase Wallet",PHANTOM:"Phantom",SAFE:"Safe",ARGENT:"Argent",RAINBOW:"Rainbow",TRUST:"Trust Wallet",LEDGER:"Ledger",TREZOR:"Trezor"};D.WALLET_NAMES=h;const y={ETHEREUM_MAINNET:1,POLYGON:137,ARBITRUM:42161,OPTIMISM:10,BASE:8453,SOLANA_MAINNET:"mainnet-beta",SOLANA_DEVNET:"devnet"};D.NETWORK_IDS=y;const m={FAST:150,NORMAL:300,SLOW:500,VERY_SLOW:1e3};D.ANIMATION=m;const g={DROPDOWN:10,OVERLAY:20,MODAL:30,POPOVER:40,TOOLTIP:50,TOAST:60};return D.Z_INDEX=g,D}var Cr={},zs;function Qm(){return zs||(zs=1,Object.defineProperty(Cr,"__esModule",{value:!0}),Cr.STATUS_VALUES=void 0,Cr.STATUS_VALUES={SUCCESS:"success",PENDING:"pending",FAILED:"failed",ERROR:"error"}),Cr}var Hs;function eg(){return Hs||(Hs=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.STATUS_VALUES=e.Z_INDEX=e.ANIMATION=e.NETWORK_IDS=e.WALLET_NAMES=e.CONTACT_INFO=e.ROUTES=e.SUCCESS_MESSAGES=e.ERROR_MESSAGES=e.TIME_FORMAT=e.SUBSCRIPTION_TIERS=e.EMAIL_CONFIG=e.STORAGE_KEYS=e.CHAIN_TYPE=e.AUTH_STATUS=e.API_RETRY_DELAY=e.API_RETRY_ATTEMPTS=e.API_TIMEOUT=void 0;var t=Jm();Object.defineProperty(e,"API_TIMEOUT",{enumerable:!0,get:function(){return t.API_TIMEOUT}}),Object.defineProperty(e,"API_RETRY_ATTEMPTS",{enumerable:!0,get:function(){return t.API_RETRY_ATTEMPTS}}),Object.defineProperty(e,"API_RETRY_DELAY",{enumerable:!0,get:function(){return t.API_RETRY_DELAY}}),Object.defineProperty(e,"AUTH_STATUS",{enumerable:!0,get:function(){return t.AUTH_STATUS}}),Object.defineProperty(e,"CHAIN_TYPE",{enumerable:!0,get:function(){return t.CHAIN_TYPE}}),Object.defineProperty(e,"STORAGE_KEYS",{enumerable:!0,get:function(){return t.STORAGE_KEYS}}),Object.defineProperty(e,"EMAIL_CONFIG",{enumerable:!0,get:function(){return t.EMAIL_CONFIG}}),Object.defineProperty(e,"SUBSCRIPTION_TIERS",{enumerable:!0,get:function(){return t.SUBSCRIPTION_TIERS}}),Object.defineProperty(e,"TIME_FORMAT",{enumerable:!0,get:function(){return t.TIME_FORMAT}}),Object.defineProperty(e,"ERROR_MESSAGES",{enumerable:!0,get:function(){return t.ERROR_MESSAGES}}),Object.defineProperty(e,"SUCCESS_MESSAGES",{enumerable:!0,get:function(){return t.SUCCESS_MESSAGES}}),Object.defineProperty(e,"ROUTES",{enumerable:!0,get:function(){return t.ROUTES}}),Object.defineProperty(e,"CONTACT_INFO",{enumerable:!0,get:function(){return t.CONTACT_INFO}}),Object.defineProperty(e,"WALLET_NAMES",{enumerable:!0,get:function(){return t.WALLET_NAMES}}),Object.defineProperty(e,"NETWORK_IDS",{enumerable:!0,get:function(){return t.NETWORK_IDS}}),Object.defineProperty(e,"ANIMATION",{enumerable:!0,get:function(){return t.ANIMATION}}),Object.defineProperty(e,"Z_INDEX",{enumerable:!0,get:function(){return t.Z_INDEX}});var r=Qm();Object.defineProperty(e,"STATUS_VALUES",{enumerable:!0,get:function(){return r.STATUS_VALUES}})})(Vs)),Vs}var Gs={},ie={},Ys;function tg(){if(Ys)return ie;Ys=1,Object.defineProperty(ie,"__esModule",{value:!0}),ie.storageLogger=ie.ensLogger=ie.contractLogger=ie.apiLogger=ie.authLogger=ie.logger=ie.LogLevel=void 0;var e;(function(l){l.ERROR="error",l.WARN="warn",l.INFO="info",l.DEBUG="debug"})(e||(ie.LogLevel=e={}));class t{constructor(){this.isDevelopment=process.env.NODE_ENV==="development"}formatTimestamp(){return new Date().toISOString()}formatMessage(c,f,u){const p=this.formatTimestamp(),h=u?` [${u}]`:"";return`[${p}]${h} ${f}`}shouldLog(c){return this.isDevelopment?!0:c===e.ERROR||c===e.WARN}error(c,f,u){this.shouldLog(e.ERROR)&&(console.error(this.formatMessage(e.ERROR,c,f)),u&&console.error(u))}warn(c,f,u){this.shouldLog(e.WARN)&&(console.warn(this.formatMessage(e.WARN,c,f)),u&&console.warn(u))}info(c,f,u){this.shouldLog(e.INFO)&&(console.log(this.formatMessage(e.INFO,c,f)),u&&console.log(u))}debug(c,f,u){this.shouldLog(e.DEBUG)&&(console.log(this.formatMessage(e.DEBUG,c,f)),u&&console.log(u))}withContext(c){return{error:(f,u)=>this.error(f,c,u),warn:(f,u)=>this.warn(f,c,u),info:(f,u)=>this.info(f,c,u),debug:(f,u)=>this.debug(f,c,u)}}}const r=new t;ie.logger=r;const n=r.withContext("AUTH");ie.authLogger=n;const o=r.withContext("API");ie.apiLogger=o;const a=r.withContext("CONTRACT");ie.contractLogger=a;const i=r.withContext("ENS");ie.ensLogger=i;const s=r.withContext("STORAGE");return ie.storageLogger=s,ie}var Ks;function Xs(){return Ks||(Ks=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.storageLogger=e.ensLogger=e.contractLogger=e.apiLogger=e.authLogger=e.logger=e.LogLevel=void 0;var t=tg();Object.defineProperty(e,"LogLevel",{enumerable:!0,get:function(){return t.LogLevel}}),Object.defineProperty(e,"logger",{enumerable:!0,get:function(){return t.logger}}),Object.defineProperty(e,"authLogger",{enumerable:!0,get:function(){return t.authLogger}}),Object.defineProperty(e,"apiLogger",{enumerable:!0,get:function(){return t.apiLogger}}),Object.defineProperty(e,"contractLogger",{enumerable:!0,get:function(){return t.contractLogger}}),Object.defineProperty(e,"ensLogger",{enumerable:!0,get:function(){return t.ensLogger}}),Object.defineProperty(e,"storageLogger",{enumerable:!0,get:function(){return t.storageLogger}})})(Gs)),Gs}var qs={},tt={},Zs;function rg(){if(Zs)return tt;Zs=1,Object.defineProperty(tt,"__esModule",{value:!0}),tt.createURLSearchParams=t,tt.createSearchParams=r,tt.searchParamsToString=n,tt.parseSearchParams=o;class e{constructor(i){if(this.params=new Map,i)if(typeof i=="string")this.parseString(i);else if(Array.isArray(i))for(const[s,l]of i)this.append(s,l);else for(const[s,l]of Object.entries(i))l!==void 0&&this.append(s,l)}parseString(i){const s=i.startsWith("?")?i.slice(1):i;if(s)for(const l of s.split("&")){const[c,f=""]=l.split("=");c&&this.append(decodeURIComponent(c),decodeURIComponent(f))}}append(i,s){this.params.has(i)||this.params.set(i,[]);const l=this.params.get(i);l&&l.push(s)}delete(i){this.params.delete(i)}get(i){const s=this.params.get(i);return s&&s.length>0?s[0]:null}getAll(i){return this.params.get(i)||[]}has(i){return this.params.has(i)}set(i,s){this.params.set(i,[s])}toString(){const i=[];return this.params.forEach((s,l)=>{for(const c of s)i.push(`${encodeURIComponent(l)}=${encodeURIComponent(c)}`)}),i.join("&")}forEach(i){this.params.forEach((s,l)=>{for(const c of s)i(c,l)})}}function t(a){return typeof URLSearchParams<"u"?new URLSearchParams(a):new e(a)}function r(a){const i=t(void 0);for(const[s,l]of Object.entries(a))l!=null&&i.append(s,String(l));return i}function n(a){return a.toString()}function o(a){const i=t(a),s={};return i.forEach((l,c)=>{s[c]=l}),s}return tt}var Js;function ng(){return Js||(Js=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.parseSearchParams=e.searchParamsToString=e.createSearchParams=e.createURLSearchParams=void 0;var t=rg();Object.defineProperty(e,"createURLSearchParams",{enumerable:!0,get:function(){return t.createURLSearchParams}}),Object.defineProperty(e,"createSearchParams",{enumerable:!0,get:function(){return t.createSearchParams}}),Object.defineProperty(e,"searchParamsToString",{enumerable:!0,get:function(){return t.searchParamsToString}}),Object.defineProperty(e,"parseSearchParams",{enumerable:!0,get:function(){return t.parseSearchParams}})})(qs)),qs}var se={},Qs;function og(){if(Qs)return se;Qs=1,Object.defineProperty(se,"__esModule",{value:!0}),se.debounceAsync=se.clearExpiredCache=se.withCache=se.withTimeout=se.safeParallel=se.withLoadingState=se.safeAsync=void 0;const e=Xs(),t=async(f,u)=>{try{return{data:await f(),success:!0}}catch(p){const h=p instanceof Error?p:new Error(String(p));return e.logger.error(`Async operation failed: ${h.message}`,u,p),{error:h,success:!1}}};se.safeAsync=t;const r=async(f,u,p,h)=>{u(!0),p(null);try{return await f()}catch(y){const m=y instanceof Error?y.message:String(y);p(m),e.logger.error(`Operation failed: ${m}`,h,y);return}finally{u(!1)}};se.withLoadingState=r;const n=async(f,u)=>{try{return{data:await Promise.all(f.map(p=>p())),success:!0}}catch(p){const h=p instanceof Error?p:new Error(String(p));return e.logger.error(`Parallel operations failed: ${h.message}`,u,p),{error:h,success:!1}}};se.safeParallel=n;const o=async(f,u,p)=>{const h=new Promise((y,m)=>setTimeout(()=>m(new Error(`Operation timed out after ${u}ms`)),u));try{return await Promise.race([f(),h])}catch(y){throw e.logger.error("Timeout operation failed",p,y),y}};se.withTimeout=o;const a=new Map,i=async(f,u,p=300*1e3)=>{const h=a.get(f),y=Date.now();if(h&&y-h.timestamp<h.ttl)return h.data;const m=await u();return a.set(f,{data:m,timestamp:y,ttl:p}),m};se.withCache=i;const s=()=>{const f=Date.now();for(const[u,p]of a.entries())f-p.timestamp>=p.ttl&&a.delete(u)};se.clearExpiredCache=s;const l=new Map,c=(f,u,p)=>(...h)=>new Promise(y=>{const m=l.get(p);m&&clearTimeout(m);const g=setTimeout(async()=>{l.delete(p);try{const w=await f(...h);y(w)}catch(w){e.logger.error("Debounced operation failed",p,w),y(void 0)}},u);l.set(p,g)});return se.debounceAsync=c,se}var el;function tl(){return el||(el=1,(function(e){var t=xt&&xt.__createBinding||(Object.create?(function(n,o,a,i){i===void 0&&(i=a);var s=Object.getOwnPropertyDescriptor(o,a);(!s||("get"in s?!o.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return o[a]}}),Object.defineProperty(n,i,s)}):(function(n,o,a,i){i===void 0&&(i=a),n[i]=o[a]})),r=xt&&xt.__exportStar||function(n,o){for(var a in n)a!=="default"&&!Object.prototype.hasOwnProperty.call(o,a)&&t(o,n,a)};Object.defineProperty(e,"__esModule",{value:!0}),r(Bm(),e),r(Hm(),e),r(Ym(),e),r(Zm(),e),r(eg(),e),r(Xs(),e),r(ng(),e),r(og(),e)})(xt)),xt}var rl;function ag(){return rl||(rl=1,(function(e){var t=yt&&yt.__createBinding||(Object.create?(function(a,i,s,l){l===void 0&&(l=s);var c=Object.getOwnPropertyDescriptor(i,s);(!c||("get"in c?!i.__esModule:c.writable||c.configurable))&&(c={enumerable:!0,get:function(){return i[s]}}),Object.defineProperty(a,l,c)}):(function(a,i,s,l){l===void 0&&(l=s),a[l]=i[s]})),r=yt&&yt.__exportStar||function(a,i){for(var s in a)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&t(i,a,s)};Object.defineProperty(e,"__esModule",{value:!0}),e.ProcessedEventName=e.ContractType=e.StorageType=e.WalletType=e.ChainType=e.AnalyticsEvent=e.TransactionStatus=e.MessageType=e.InfoType=e.NotificationType=e.RequestStatus=e.MobileView=e.EmailComposeType=e.FontSize=e.Theme=e.Chain=e.AuthStatus=e.debounceAsync=e.clearExpiredCache=e.withCache=e.withTimeout=e.safeParallel=e.withLoadingState=e.safeAsync=void 0,r(Cs(),e),r(tl(),e);var n=tl();Object.defineProperty(e,"safeAsync",{enumerable:!0,get:function(){return n.safeAsync}}),Object.defineProperty(e,"withLoadingState",{enumerable:!0,get:function(){return n.withLoadingState}}),Object.defineProperty(e,"safeParallel",{enumerable:!0,get:function(){return n.safeParallel}}),Object.defineProperty(e,"withTimeout",{enumerable:!0,get:function(){return n.withTimeout}}),Object.defineProperty(e,"withCache",{enumerable:!0,get:function(){return n.withCache}}),Object.defineProperty(e,"clearExpiredCache",{enumerable:!0,get:function(){return n.clearExpiredCache}}),Object.defineProperty(e,"debounceAsync",{enumerable:!0,get:function(){return n.debounceAsync}});var o=Cs();Object.defineProperty(e,"AuthStatus",{enumerable:!0,get:function(){return o.AuthStatus}}),Object.defineProperty(e,"Chain",{enumerable:!0,get:function(){return o.Chain}}),Object.defineProperty(e,"Theme",{enumerable:!0,get:function(){return o.Theme}}),Object.defineProperty(e,"FontSize",{enumerable:!0,get:function(){return o.FontSize}}),Object.defineProperty(e,"EmailComposeType",{enumerable:!0,get:function(){return o.EmailComposeType}}),Object.defineProperty(e,"MobileView",{enumerable:!0,get:function(){return o.MobileView}}),Object.defineProperty(e,"RequestStatus",{enumerable:!0,get:function(){return o.RequestStatus}}),Object.defineProperty(e,"NotificationType",{enumerable:!0,get:function(){return o.NotificationType}}),Object.defineProperty(e,"InfoType",{enumerable:!0,get:function(){return o.InfoType}}),Object.defineProperty(e,"MessageType",{enumerable:!0,get:function(){return o.MessageType}}),Object.defineProperty(e,"TransactionStatus",{enumerable:!0,get:function(){return o.TransactionStatus}}),Object.defineProperty(e,"AnalyticsEvent",{enumerable:!0,get:function(){return o.AnalyticsEvent}}),Object.defineProperty(e,"ChainType",{enumerable:!0,get:function(){return o.ChainType}}),Object.defineProperty(e,"WalletType",{enumerable:!0,get:function(){return o.WalletType}}),Object.defineProperty(e,"StorageType",{enumerable:!0,get:function(){return o.StorageType}}),Object.defineProperty(e,"ContractType",{enumerable:!0,get:function(){return o.ContractType}}),Object.defineProperty(e,"ProcessedEventName",{enumerable:!0,get:function(){return o.ProcessedEventName}})})(yt)),yt}var Ar=ag();const ig=d.forwardRef(({className:e,type:t,onTrack:r,trackingLabel:n,componentName:o,onBlur:a,onChange:i,...s},l)=>{const c=u=>{r&&r({action:"blur",trackingLabel:n,componentName:o}),a?.(u)},f=u=>{r&&r({action:"change",trackingLabel:n,componentName:o}),i?.(u)};return S.jsx("input",{type:t,className:Q(de.input.default(),e),ref:l,onBlur:c,onChange:f,...s})});ig.displayName="Input";const sg=d.forwardRef(({className:e,onTrack:t,trackingLabel:r,componentName:n,onCheckedChange:o,...a},i)=>{const s=l=>{t&&t({action:"toggle",trackingLabel:r,componentName:n}),o?.(l)};return S.jsx(ao,{className:Q("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2 focus-visible:ring-offset-white disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-blue-600 data-[state=unchecked]:bg-gray-200 dark:focus-visible:ring-blue-400 dark:focus-visible:ring-offset-gray-950 dark:data-[state=checked]:bg-blue-500 dark:data-[state=unchecked]:bg-gray-700",e),onCheckedChange:s,...a,ref:i,children:S.jsx(cc,{className:Q("pointer-events-none block h-5 w-5 rounded-full bg-white shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})})});sg.displayName=ao.displayName;const lg=d.forwardRef(({className:e,children:t,...r},n)=>S.jsxs(Ba,{ref:n,className:Q("flex h-9 w-full items-center justify-between rounded-md border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-800 px-3 py-2 text-sm text-gray-900 dark:text-gray-100 hover:bg-gray-50 dark:hover:bg-gray-700 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 dark:ring-offset-gray-950 transition-colors disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...r,children:[t,S.jsx(bf,{asChild:!0,children:S.jsx(Ct.ChevronDown,{className:"h-4 w-4 opacity-50 ml-2 flex-shrink-0"})})]}));lg.displayName=Ba.displayName;const nl=d.forwardRef(({className:e,...t},r)=>S.jsx(Ya,{ref:r,className:Q("flex cursor-default items-center justify-center py-1",e),...t,children:S.jsx(Ct.ChevronUp,{className:"h-4 w-4"})}));nl.displayName=Ya.displayName;const ol=d.forwardRef(({className:e,...t},r)=>S.jsx(Ka,{ref:r,className:Q("flex cursor-default items-center justify-center py-1",e),...t,children:S.jsx(Ct.ChevronDown,{className:"h-4 w-4"})}));ol.displayName=Ka.displayName;const cg=d.forwardRef(({className:e,children:t,position:r="popper",...n},o)=>S.jsx(yf,{children:S.jsxs(za,{ref:o,className:Q(de.overlays.dropdown.menu(),"z-[1000000] max-h-96 overflow-hidden data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-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",r==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1 w-[var(--radix-select-trigger-width)]",e),position:r,...n,children:[S.jsx(nl,{}),S.jsx(vf,{className:Q(de.overlays.dropdown.itemContainer(),r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full"),children:t}),S.jsx(ol,{})]})}));cg.displayName=za.displayName;const ug=d.forwardRef(({className:e,...t},r)=>S.jsx(Ha,{ref:r,className:Q(de.overlays.dropdown.header(),"py-1.5",e),...t}));ug.displayName=Ha.displayName;const dg=d.forwardRef(({className:e,children:t,...r},n)=>S.jsxs(Ga,{ref:n,className:Q(de.overlays.dropdown.item(),"relative select-none justify-between pr-8 data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...r,children:[S.jsx(wf,{children:t}),S.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:S.jsx(Ef,{children:S.jsx(Ct.Check,{className:"h-4 w-4"})})})]}));dg.displayName=Ga.displayName;const fg=d.forwardRef(({className:e,...t},r)=>S.jsx(Xa,{ref:r,className:Q("my-1 h-px bg-gray-200 dark:bg-gray-700",e),...t}));fg.displayName=Xa.displayName;const pg=zt(`${Mt.label.default()} peer-disabled:cursor-not-allowed peer-disabled:opacity-70`),mg=d.forwardRef(({className:e,...t},r)=>S.jsx(Qa,{ref:r,className:Q(pg(),e),...t}));mg.displayName=Qa.displayName;const gg=zt("min-h-[44px] touch-manipulation",{variants:{variant:{default:"",primary:"",secondary:"",outline:"",ghost:"",destructive:"","destructive-outline":"",success:"",link:"",gradient:"","gradient-secondary":"","gradient-success":"",wallet:"",connect:"",disconnect:""},size:{default:"",sm:"h-8",lg:"h-12",icon:"h-10 w-10 p-0"},animation:{none:"transition-colors duration-200",hover:"transition-all duration-200 hover:scale-105",lift:"transition-all duration-200 hover:scale-105",scale:"transition-transform duration-200 hover:scale-95",glow:"transition-all duration-200 hover:shadow-lg",shimmer:"transition-all duration-200",tap:"transition-transform duration-100 active:scale-95",connect:"transition-all duration-200 hover:scale-105",transaction:"transition-all duration-200 animate-pulse",disconnect:"transition-all duration-200 hover:opacity-80"}},defaultVariants:{variant:"default",size:"default",animation:"hover"}}),hg=d.forwardRef(({className:e,variant:t,size:r,animation:n,asChild:o=!1,onTrack:a,trackingLabel:i,componentName:s,onClick:l,children:c,...f},u)=>{const p=o?Cf:"button",h=t||"default",y=r&&r!=="default"&&r!=="icon"?r:void 0,m=E=>E?{sm:"small",lg:"large",default:"default"}[E]||E:"default",g=(()=>{if(h.startsWith("gradient")){const E=h.replace("gradient-","").replace("gradient","primary");return de.button.gradient[E]?.()||de.button.primary.default()}else{if(["wallet","connect","disconnect"].includes(h))return de.button.web3[h]?.()||de.button.primary.default();{const E=m(y);return de.button[h]?.[E]?.()||de.button.primary.default()}}})(),w=E=>{a&&a({action:"click",trackingLabel:i,componentName:s}),l?.(E)};return S.jsx(p,{className:Q(gg({size:r,animation:n}),g,e),ref:u,onClick:w,...f,children:c})});hg.displayName="Button",Ar.InfoType.INFO+"",Ar.InfoType.SUCCESS+"",Ar.InfoType.WARNING+"",Ar.InfoType.ERROR+"";const xn=zt("transition-all duration-200 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 rounded-sm",{variants:{variant:{subtle:Mt.link.subtle(),default:Mt.link.default(),muted:Mt.link.muted(),external:Mt.link.external(),inherit:"text-inherit hover:text-blue-600 dark:hover:text-blue-400 underline-offset-2 hover:underline transition-colors duration-200"},size:{sm:"text-sm",default:"text-base",lg:"text-lg"}},defaultVariants:{variant:"subtle",size:"default"}}),bg=d.forwardRef(({className:e,variant:t,size:r,to:n,href:o,external:a,children:i,onTrack:s,trackingLabel:l,componentName:c,onClick:f,...u},p)=>{const h=n||o,y=a||h&&(h.startsWith("http")||h.startsWith("mailto:")),m=g=>{s&&s({action:"click",trackingLabel:l,componentName:c}),f?.(g)};return h?y?S.jsx("a",{className:Q(xn({variant:t==="subtle"?"external":t,size:r,className:e})),href:h,target:"_blank",rel:"noopener noreferrer",ref:p,onClick:m,...u,children:i}):S.jsx(yn,{className:Q(xn({variant:t,size:r,className:e})),to:h,ref:p,onClick:m,...u,children:i}):S.jsx("span",{className:Q(xn({variant:t,size:r,className:e})),onClick:m,...u,children:i})});bg.displayName="SmartLink";const yg=d.forwardRef(({onTrack:e,trackingLabel:t,componentName:r,onValueChange:n,children:o,...a},i)=>S.jsx(wm,{ref:i,onValueChange:s=>{e&&e({action:"change",trackingLabel:t,componentName:r}),n?.(s)},...a,children:o}));yg.displayName="Tabs";const vg=d.forwardRef(({className:e,...t},r)=>S.jsx(Wi,{ref:r,className:Q(de.navigation.tabs.list(),e),...t}));vg.displayName=Wi.displayName;const wg=d.forwardRef(({className:e,...t},r)=>S.jsx(Ui,{ref:r,className:Q(de.navigation.tabs.trigger(),e),...t}));wg.displayName=Ui.displayName;const Eg=d.forwardRef(({className:e,...t},r)=>S.jsx(Vi,{ref:r,className:Q(de.navigation.tabs.content(),e),...t}));Eg.displayName=Vi.displayName,K.createContext(void 0),K.memo(({children:e,compute:t,deps:r})=>{const n=K.useRef(r),o=K.useRef(t),a=K.useRef(void 0),i=K.useMemo(()=>{const s=r.length!==n.current.length||r.some((c,f)=>c!==n.current[f]),l=t!==o.current;if(s||l||a.current===void 0){let c;return process.env.NODE_ENV==="development"?(performance.now(),c=t(),performance.now()):c=t(),n.current=r,o.current=t,a.current=c,c}return a.current},[t,r]);return S.jsx(S.Fragment,{children:e(i)})}),K.memo(({item:e,index:t,style:r,renderItem:n})=>S.jsx("div",{style:r,children:n(e,t)}),(e,t)=>e.index===t.index&&e.item===t.item&&e.style.height===t.style.height&&e.style.top===t.style.top),K.memo(({condition:e,children:t,fallback:r=null})=>e?S.jsx(S.Fragment,{children:t}):S.jsx(S.Fragment,{children:r})),K.createContext(void 0),K.createContext(null);const Sg=e=>({"default-src":["'self'"],"script-src":["'self'","'unsafe-inline'","'unsafe-eval'","https://fonts.googleapis.com","https://www.googletagmanager.com","https://www.google-analytics.com"],"style-src":["'self'","'unsafe-inline'","https://fonts.googleapis.com","https://fonts.gstatic.com"],"font-src":["'self'","https://fonts.gstatic.com","data:"],"img-src":["'self'","data:","https:","blob:"],"connect-src":["'self'","https://*.walletconnect.com","https://*.walletconnect.org","https://registry.walletconnect.com","https://relay.walletconnect.com","wss://*.walletconnect.com","wss://*.walletconnect.org","https://keys.coinbase.com","https://api.coinbase.com","https://www.walletlink.org","https://mainnet.infura.io","https://polygon-rpc.com","https://rpc.ankr.com","https://cloudflare-eth.com","https://eth-mainnet.alchemyapi.io","https://api.phantom.app","https://solana-api.projectserum.com","https://api.mainnet-beta.solana.com","https://api.devnet.solana.com","wss://api.phantom.app","wss://api.devnet.solana.com","wss://api.mainnet-beta.solana.com","https://bridge.arbitrum.io","https://polygon-mainnet.infura.io","https://optimism-mainnet.infura.io"],"frame-src":["'self'","https://verify.walletconnect.com","https://verify.walletconnect.org"],"worker-src":["'self'","blob:"],"child-src":["'self'","https://verify.walletconnect.com"],"object-src":["'none'"],"base-uri":["'self'"],"form-action":["'self'"]}),xg=e=>{const t=Sg();return Object.entries(t).map(([r,n])=>`${r} ${n.join(" ")}`).join("; ")};(e=>({"X-Frame-Options":"DENY","X-Content-Type-Options":"nosniff","X-XSS-Protection":"1; mode=block","Referrer-Policy":"strict-origin-when-cross-origin","Permissions-Policy":"camera=(), microphone=(), geolocation=(), interest-cohort=()","Strict-Transport-Security":"max-age=31536000; includeSubDomains; preload","Cross-Origin-Embedder-Policy":"credentialless","Cross-Origin-Opener-Policy":"same-origin-allow-popups","Cross-Origin-Resource-Policy":"cross-origin","Content-Security-Policy":xg()}))();function Cg(){if("connection"in navigator){const e=navigator.connection;e&&(e.effectiveType==="4g"||e.effectiveType)}}Cg(),process.env.NODE_ENV,process.env.NODE_ENV,process.env.NODE_ENV;var al=(e=>(e[e.HIGH=0]="HIGH",e[e.MEDIUM=1]="MEDIUM",e[e.LOW=2]="LOW",e[e.IDLE=3]="IDLE",e))(al||{});class Ag{constructor(){this.queues=new Map,this.isProcessing=!1,Object.values(al).filter(t=>typeof t=="number").forEach(t=>{this.queues.set(t,[])})}load(t,r=1){const n=this.queues.get(r);n&&n.push(t),this.process()}async process(){if(!this.isProcessing){this.isProcessing=!0;for(const[t,r]of this.queues)for(;r.length>0;){const n=r.shift();if(n)try{await n()}catch{}t>=2&&await new Promise(o=>setTimeout(o,50))}this.isProcessing=!1}}}new Ag;class Cn{constructor(t={}){this.prefix=t.prefix||"mailbox",this.defaultTTL=t.ttl,this.platformStorage=t.platformStorage||this.createFallbackStorage()}createFallbackStorage(){const t=new Map;return{getItem:r=>t.get(r)||null,setItem:(r,n)=>{t.set(r,n)},removeItem:r=>{t.delete(r)},clear:()=>{t.clear()},getAllKeys:()=>Array.from(t.keys())}}getKey(t){return`${this.prefix}-${t}`}isExpired(t){return t.ttl?Date.now()-t.timestamp>t.ttl:!1}set(t,r,n){try{const o={value:r,timestamp:Date.now(),ttl:n||this.defaultTTL};this.platformStorage.setItem(this.getKey(t),JSON.stringify(o))}catch{}}get(t,r){try{const n=this.platformStorage.getItem(this.getKey(t));if(!n)return r;const o=JSON.parse(n);return this.isExpired(o)?(this.remove(t),r):o.value}catch{return r}}remove(t){try{this.platformStorage.removeItem(this.getKey(t))}catch{}}clear(t){try{if(this.platformStorage.getAllKeys){const r=this.platformStorage.getAllKeys(),n=this.getKey(t||""),o=r.filter(a=>a.startsWith(n));for(const a of o)this.platformStorage.removeItem(a)}else this.platformStorage.clear?.()}catch(r){console.error("Failed to clear storage:",r)}}has(t){try{return this.platformStorage.getItem(this.getKey(t))!==null}catch(r){return console.error(`Failed to check item ${t}:`,r),!1}}getAllKeys(){try{if(this.platformStorage.getAllKeys){const t=this.platformStorage.getAllKeys(),r=`${this.prefix}-`;return t.filter(n=>n.startsWith(r)).map(n=>n.substring(r.length))}return[]}catch(t){return console.error("Failed to get all keys:",t),[]}}}new Cn,new Cn({prefix:"mailbox-theme"}),new Cn({prefix:"walletUser",ttl:10080*60*1e3});function Tg({client:e,onSelectEntity:t}){const[r,n]=K.useState(!1),[o,a]=K.useState({displayName:"",description:""}),[i,s]=K.useState(null),{data:l=[],isLoading:c}=ye.useEntities(e),f=ye.useCreateEntity(e),u=l.filter(y=>y.entityType==="personal"),p=l.filter(y=>y.entityType==="organization"),h=async y=>{if(y.preventDefault(),s(null),!o.displayName.trim()){s("Display name is required");return}try{await f.mutateAsync({displayName:o.displayName.trim(),description:o.description.trim()||void 0}),n(!1),a({displayName:"",description:""})}catch(m){s(m.message||"Failed to create organization")}};return S.jsxs(xr,{spacing:"lg",maxWidth:"4xl",children:[S.jsxs("div",{className:"flex items-center justify-between mb-8",children:[S.jsxs("div",{children:[S.jsx("h1",{className:"text-2xl font-bold text-foreground",children:"Workspaces"}),S.jsx("p",{className:"text-muted-foreground",children:"Manage your personal and organization workspaces"})]}),S.jsxs("button",{type:"button",onClick:()=>n(!0),className:"flex items-center gap-2 px-4 py-2 rounded-lg bg-primary text-primary-foreground font-medium hover:bg-primary/90 transition-colors",children:[S.jsx(Ct.Plus,{className:"h-4 w-4"}),S.jsx("span",{children:"New Organization"})]})]}),r&&S.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50",children:S.jsxs("div",{className:"w-full max-w-md rounded-lg bg-background p-6 shadow-lg",children:[S.jsx("h2",{className:"text-lg font-semibold mb-4",children:"Create Organization"}),S.jsxs("form",{onSubmit:h,className:"space-y-4",children:[S.jsxs("div",{children:[S.jsx("label",{className:"block text-sm font-medium mb-1",children:"Display Name"}),S.jsx("input",{type:"text",value:o.displayName,onChange:y=>a(m=>({...m,displayName:y.target.value})),placeholder:"My Organization",className:"w-full px-3 py-2 rounded-lg border bg-background focus:outline-none focus:ring-2 focus:ring-primary"})]}),S.jsxs("div",{children:[S.jsx("label",{className:"block text-sm font-medium mb-1",children:"Description (optional)"}),S.jsx("textarea",{value:o.description,onChange:y=>a(m=>({...m,description:y.target.value})),placeholder:"What is this organization for?",rows:3,className:"w-full px-3 py-2 rounded-lg border bg-background focus:outline-none focus:ring-2 focus:ring-primary resize-none"})]}),i&&S.jsx("p",{className:"text-sm text-destructive",children:i}),S.jsxs("div",{className:"flex justify-end gap-2",children:[S.jsx("button",{type:"button",onClick:()=>{n(!1),a({displayName:"",description:""}),s(null)},className:"px-4 py-2 rounded-lg border hover:bg-muted transition-colors",children:"Cancel"}),S.jsx("button",{type:"submit",disabled:f.isPending,className:"px-4 py-2 rounded-lg bg-primary text-primary-foreground font-medium hover:bg-primary/90 transition-colors disabled:opacity-50",children:f.isPending?"Creating...":"Create"})]})]})]})}),u.length>0&&S.jsxs("div",{className:"mb-8",children:[S.jsx("h2",{className:"text-lg font-semibold mb-3",children:"Personal Workspace"}),S.jsx(nt.EntityList,{entities:u,onSelect:t,isLoading:c})]}),S.jsxs("div",{children:[S.jsx("h2",{className:"text-lg font-semibold mb-3",children:"Organizations"}),p.length===0&&!c?S.jsxs("div",{className:"text-center py-8 text-muted-foreground border border-dashed rounded-lg",children:[S.jsx("p",{children:"No organizations yet"}),S.jsx("button",{type:"button",onClick:()=>n(!0),className:"mt-2 text-primary hover:underline",children:"Create your first organization"})]}):S.jsx(nt.EntityList,{entities:p,onSelect:t,isLoading:c})]})]})}function Og({client:e,entity:t,currentUserId:r}){const n=t.userRole==="admin",{data:o=[],isLoading:a}=ye.useEntityMembers(e,t.entitySlug),i=ye.useUpdateMemberRole(e),s=ye.useRemoveMember(e),{data:l=[],isLoading:c}=ye.useEntityInvitations(e,n?t.entitySlug:null),f=ye.useCreateInvitation(e),u=ye.useCancelInvitation(e),p=async(g,w)=>{try{await i.mutateAsync({entitySlug:t.entitySlug,memberId:g,role:w})}catch(E){console.error("Failed to update role:",E)}},h=async g=>{if(confirm("Are you sure you want to remove this member?"))try{await s.mutateAsync({entitySlug:t.entitySlug,memberId:g})}catch(w){console.error("Failed to remove member:",w)}},y=async g=>{await f.mutateAsync({entitySlug:t.entitySlug,request:g})},m=async g=>{try{await u.mutateAsync({entitySlug:t.entitySlug,invitationId:g})}catch(w){console.error("Failed to cancel invitation:",w)}};return t.entityType==="personal"?S.jsx(xr,{spacing:"lg",maxWidth:"4xl",children:S.jsxs("div",{className:"text-center py-12 text-muted-foreground",children:[S.jsx("p",{children:"Personal workspaces cannot have additional members."}),S.jsx("p",{className:"mt-2",children:"Create an organization to collaborate with others."})]})}):S.jsxs(xr,{spacing:"lg",maxWidth:"4xl",children:[S.jsxs("div",{className:"mb-8",children:[S.jsx("h1",{className:"text-2xl font-bold text-foreground",children:"Members"}),S.jsxs("p",{className:"text-muted-foreground",children:["Manage members and invitations for ",t.displayName]})]}),n&&S.jsxs("div",{className:"rounded-lg border p-4 mb-8",children:[S.jsx("h2",{className:"text-lg font-semibold mb-4",children:"Invite Members"}),S.jsx(nt.InvitationForm,{onSubmit:y,isSubmitting:f.isPending})]}),n&&S.jsxs("div",{className:"mb-8",children:[S.jsx("h2",{className:"text-lg font-semibold mb-3",children:"Pending Invitations"}),S.jsx(nt.InvitationList,{invitations:l,mode:"admin",onCancel:m,isLoading:c,emptyMessage:"No pending invitations"})]}),S.jsxs("div",{children:[S.jsxs("h2",{className:"text-lg font-semibold mb-3",children:["Current Members (",o.length,")"]}),S.jsx(nt.MemberList,{members:o,currentUserId:r,canManage:n,onRoleChange:p,onRemove:h,isLoading:a})]})]})}function Pg({client:e,onInvitationAccepted:t}){const{data:r=[],isLoading:n}=ye.useMyInvitations(e),o=ye.useAcceptInvitation(e),a=ye.useDeclineInvitation(e),i=async c=>{try{await o.mutateAsync(c),t?.()}catch(f){console.error("Failed to accept invitation:",f)}},s=async c=>{try{await a.mutateAsync(c)}catch(f){console.error("Failed to decline invitation:",f)}},l=r.filter(c=>c.status==="pending").length;return S.jsxs(xr,{spacing:"lg",maxWidth:"4xl",children:[S.jsxs("div",{className:"mb-6",children:[S.jsx("h1",{className:"text-2xl font-bold text-foreground",children:"Invitations"}),S.jsx("p",{className:"text-muted-foreground",children:l>0?`You have ${l} pending invitation${l>1?"s":""}`:"No pending invitations"})]}),S.jsx(nt.InvitationList,{invitations:r,mode:"user",onAccept:i,onDecline:s,isLoading:n,emptyMessage:"You don't have any pending invitations"})]})}ue.EntityListPage=Tg,ue.InvitationsPage=Pg,ue.MembersManagementPage=Og,Object.defineProperty(ue,Symbol.toStringTag,{value:"Module"})}));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sudobility/entity_pages",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.25",
|
|
4
4
|
"description": "Page containers for entity/organization management",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.umd.js",
|
|
@@ -42,13 +42,13 @@
|
|
|
42
42
|
"react": "^18.0.0 || ^19.0.0",
|
|
43
43
|
"react-dom": "^18.0.0 || ^19.0.0",
|
|
44
44
|
"@tanstack/react-query": "^5.0.0",
|
|
45
|
-
"@sudobility/components": "^4.0.
|
|
45
|
+
"@sudobility/components": "^4.0.153",
|
|
46
46
|
"@sudobility/entity_client": "^0.0.14",
|
|
47
47
|
"@sudobility/entity-components": "^1.0.4"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
50
|
"@eslint/js": "^9.38.0",
|
|
51
|
-
"@sudobility/components": "^4.0.
|
|
51
|
+
"@sudobility/components": "^4.0.153",
|
|
52
52
|
"@sudobility/entity-components": "^1.0.4",
|
|
53
53
|
"@sudobility/entity_client": "^0.0.14",
|
|
54
54
|
"@tanstack/react-query": "^5.0.0",
|