@use-glyph/sdk-react 2.2.6 → 2.2.7

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.
@@ -53,7 +53,7 @@ If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHid
53
53
 
54
54
  For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return S.useEffect(()=>{e&&(document.getElementById(e)||console.error(r))},[r,e]),null},Q5="DialogDescriptionWarning",J5=({contentRef:e,descriptionId:t})=>{const n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Tc(Q5).contentName}}.`;return S.useEffect(()=>{const o=e.current?.getAttribute("aria-describedby");t&&o&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},kc=gc,Pc=hc,_c=mc,zo=yc,Wo=bc,jo=Cc,Go=Ec,R5=Sc;function eh(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",t.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}const Ic=w.createContext({drawerRef:{current:null},overlayRef:{current:null},onPress:()=>{},onRelease:()=>{},onDrag:()=>{},onNestedDrag:()=>{},onNestedOpenChange:()=>{},onNestedRelease:()=>{},openProp:void 0,dismissible:!1,isOpen:!1,isDragging:!1,keyboardIsOpen:{current:!1},snapPointsOffset:null,snapPoints:null,handleOnly:!1,modal:!1,shouldFade:!1,activeSnapPoint:null,onOpenChange:()=>{},setActiveSnapPoint:()=>{},closeDrawer:()=>{},direction:"bottom",shouldAnimate:{current:!0},shouldScaleBackground:!1,setBackgroundColorOnScale:!0,noBodyStyles:!1,container:null,autoFocus:!1}),An=()=>{const e=w.useContext(Ic);if(!e)throw new Error("useDrawerContext must be used within a Drawer.Root");return e};eh(`[data-vaul-drawer]{touch-action:none;will-change:transform;transition:transform .5s cubic-bezier(.32, .72, 0, 1);animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=open]{animation-name:slideFromBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=closed]{animation-name:slideToBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=open]{animation-name:slideFromTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=closed]{animation-name:slideToTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=open]{animation-name:slideFromLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=closed]{animation-name:slideToLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=open]{animation-name:slideFromRight}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=closed]{animation-name:slideToRight}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--initial-transform,100%),0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--initial-transform,100%),0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-overlay][data-vaul-snap-points=false]{animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-overlay][data-vaul-snap-points=false][data-state=open]{animation-name:fadeIn}[data-vaul-overlay][data-state=closed]{animation-name:fadeOut}[data-vaul-animate=false]{animation:none!important}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:0;transition:opacity .5s cubic-bezier(.32, .72, 0, 1)}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:1}[data-vaul-drawer]:not([data-vaul-custom-container=true])::after{content:'';position:absolute;background:inherit;background-color:inherit}[data-vaul-drawer][data-vaul-drawer-direction=top]::after{top:initial;bottom:100%;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=bottom]::after{top:100%;bottom:initial;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=left]::after{left:initial;right:100%;top:0;bottom:0;width:200%}[data-vaul-drawer][data-vaul-drawer-direction=right]::after{left:100%;right:initial;top:0;bottom:0;width:200%}[data-vaul-overlay][data-vaul-snap-points=true]:not([data-vaul-snap-points-overlay=true]):not(
55
55
  [data-state=closed]
56
- ){opacity:0}[data-vaul-overlay][data-vaul-snap-points-overlay=true]{opacity:1}[data-vaul-handle]{display:block;position:relative;opacity:.7;background:#e2e2e4;margin-left:auto;margin-right:auto;height:5px;width:32px;border-radius:1rem;touch-action:pan-y}[data-vaul-handle]:active,[data-vaul-handle]:hover{opacity:1}[data-vaul-handle-hitarea]{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:max(100%,2.75rem);height:max(100%,2.75rem);touch-action:inherit}@media (hover:hover) and (pointer:fine){[data-vaul-drawer]{user-select:none}}@media (pointer:fine){[data-vaul-handle-hitarea]:{width:100%;height:100%}}@keyframes fadeIn{from{opacity:0}to{opacity:1}}@keyframes fadeOut{to{opacity:0}}@keyframes slideFromBottom{from{transform:translate3d(0,var(--initial-transform,100%),0)}to{transform:translate3d(0,0,0)}}@keyframes slideToBottom{to{transform:translate3d(0,var(--initial-transform,100%),0)}}@keyframes slideFromTop{from{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}to{transform:translate3d(0,0,0)}}@keyframes slideToTop{to{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}}@keyframes slideFromLeft{from{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToLeft{to{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}}@keyframes slideFromRight{from{transform:translate3d(var(--initial-transform,100%),0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToRight{to{transform:translate3d(var(--initial-transform,100%),0,0)}}`);function th(){const e=navigator.userAgent;return typeof window<"u"&&(/Firefox/.test(e)&&/Mobile/.test(e)||/FxiOS/.test(e))}function rh(){return qo(/^Mac/)}function nh(){return qo(/^iPhone/)}function Oc(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function sh(){return qo(/^iPad/)||rh()&&navigator.maxTouchPoints>1}function Lc(){return nh()||sh()}function qo(e){return typeof window<"u"&&window.navigator!=null?e.test(window.navigator.platform):void 0}const oh=24,ah=typeof window<"u"?w.useLayoutEffect:w.useEffect;function Mc(...e){return(...t)=>{for(let r of e)typeof r=="function"&&r(...t)}}const Zo=typeof document<"u"&&window.visualViewport;function Dc(e){let t=window.getComputedStyle(e);return/(auto|scroll)/.test(t.overflow+t.overflowX+t.overflowY)}function Fc(e){for(Dc(e)&&(e=e.parentElement);e&&!Dc(e);)e=e.parentElement;return e||document.scrollingElement||document.documentElement}const ih=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);let gs=0,Yo;function lh(e={}){let{isDisabled:t}=e;ah(()=>{if(!t)return gs++,gs===1&&Lc()&&(Yo=ch()),()=>{gs--,gs===0&&Yo?.()}},[t])}function ch(){let e,t=0,r=d=>{e=Fc(d.target),!(e===document.documentElement&&e===document.body)&&(t=d.changedTouches[0].pageY)},n=d=>{if(!e||e===document.documentElement||e===document.body){d.preventDefault();return}let g=d.changedTouches[0].pageY,h=e.scrollTop,v=e.scrollHeight-e.clientHeight;v!==0&&((h<=0&&g>t||h>=v&&g<t)&&d.preventDefault(),t=g)},o=d=>{let g=d.target;Ko(g)&&g!==document.activeElement&&(d.preventDefault(),g.style.transform="translateY(-2000px)",g.focus(),requestAnimationFrame(()=>{g.style.transform=""}))},a=d=>{let g=d.target;Ko(g)&&(g.style.transform="translateY(-2000px)",requestAnimationFrame(()=>{g.style.transform="",Zo&&(Zo.height<window.innerHeight?requestAnimationFrame(()=>{Uc(g)}):Zo.addEventListener("resize",()=>Uc(g),{once:!0}))}))},i=()=>{window.scrollTo(0,0)},l=window.pageXOffset,c=window.pageYOffset,u=Mc(dh(document.documentElement,"paddingRight",`${window.innerWidth-document.documentElement.clientWidth}px`));window.scrollTo(0,0);let f=Mc(Tn(document,"touchstart",r,{passive:!1,capture:!0}),Tn(document,"touchmove",n,{passive:!1,capture:!0}),Tn(document,"touchend",o,{passive:!1,capture:!0}),Tn(document,"focus",a,!0),Tn(window,"scroll",i));return()=>{u(),f(),window.scrollTo(l,c)}}function dh(e,t,r){let n=e.style[t];return e.style[t]=r,()=>{e.style[t]=n}}function Tn(e,t,r,n){return e.addEventListener(t,r,n),()=>{e.removeEventListener(t,r,n)}}function Uc(e){let t=document.scrollingElement||document.documentElement;for(;e&&e!==t;){let r=Fc(e);if(r!==document.documentElement&&r!==document.body&&r!==e){let n=r.getBoundingClientRect().top,o=e.getBoundingClientRect().top,a=e.getBoundingClientRect().bottom;const i=r.getBoundingClientRect().bottom+oh;a>i&&(r.scrollTop+=o-n)}e=r.parentElement}}function Ko(e){return e instanceof HTMLInputElement&&!ih.has(e.type)||e instanceof HTMLTextAreaElement||e instanceof HTMLElement&&e.isContentEditable}function uh(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function fh(...e){return t=>e.forEach(r=>uh(r,t))}function Bc(...e){return S.useCallback(fh(...e),e)}const Hc=new WeakMap;function je(e,t,r=!1){if(!e||!(e instanceof HTMLElement))return;let n={};Object.entries(t).forEach(([o,a])=>{if(o.startsWith("--")){e.style.setProperty(o,a);return}n[o]=e.style[o],e.style[o]=a}),!r&&Hc.set(e,n)}function gh(e,t){if(!e||!(e instanceof HTMLElement))return;let r=Hc.get(e);r&&(e.style[t]=r[t])}const Ve=e=>{switch(e){case"top":case"bottom":return!0;case"left":case"right":return!1;default:return e}};function ws(e,t){if(!e)return null;const r=window.getComputedStyle(e),n=r.transform||r.webkitTransform||r.mozTransform;let o=n.match(/^matrix3d\((.+)\)$/);return o?parseFloat(o[1].split(", ")[Ve(t)?13:12]):(o=n.match(/^matrix\((.+)\)$/),o?parseFloat(o[1].split(", ")[Ve(t)?5:4]):null)}function wh(e){return 8*(Math.log(e+1)-2)}function Xo(e,t){if(!e)return()=>{};const r=e.style.cssText;return Object.assign(e.style,t),()=>{e.style.cssText=r}}function hh(...e){return(...t)=>{for(const r of e)typeof r=="function"&&r(...t)}}const Ie={DURATION:.5,EASE:[.32,.72,0,1]},$c=.4,ph=.25,mh=100,Vc=8,kr=16,Qo=26,Jo="vaul-dragging";function zc(e){const t=w.useRef(e);return w.useEffect(()=>{t.current=e}),w.useMemo(()=>(...r)=>t.current==null?void 0:t.current.call(t,...r),[])}function yh({defaultProp:e,onChange:t}){const r=w.useState(e),[n]=r,o=w.useRef(n),a=zc(t);return w.useEffect(()=>{o.current!==n&&(a(n),o.current=n)},[n,o,a]),r}function Wc({prop:e,defaultProp:t,onChange:r=()=>{}}){const[n,o]=yh({defaultProp:t,onChange:r}),a=e!==void 0,i=a?e:n,l=zc(r),c=w.useCallback(u=>{if(a){const d=typeof u=="function"?u(e):u;d!==e&&l(d)}else o(u)},[a,e,o,l]);return[i,c]}function bh({activeSnapPointProp:e,setActiveSnapPointProp:t,snapPoints:r,drawerRef:n,overlayRef:o,fadeFromIndex:a,onSnapPointChange:i,direction:l="bottom",container:c,snapToSequentialPoint:u}){const[f,d]=Wc({prop:e,defaultProp:r?.[0],onChange:t}),[g,h]=w.useState(typeof window<"u"?{innerWidth:window.innerWidth,innerHeight:window.innerHeight}:void 0);w.useEffect(()=>{function T(){h({innerWidth:window.innerWidth,innerHeight:window.innerHeight})}return window.addEventListener("resize",T),()=>window.removeEventListener("resize",T)},[]);const v=w.useMemo(()=>f===r?.[r.length-1]||null,[r,f]),m=w.useMemo(()=>{var T;return(T=r?.findIndex(D=>D===f))!=null?T:null},[r,f]),b=r&&r.length>0&&(a||a===0)&&!Number.isNaN(a)&&r[a]===f||!r,p=w.useMemo(()=>{const T=c?{width:c.getBoundingClientRect().width,height:c.getBoundingClientRect().height}:typeof window<"u"?{width:window.innerWidth,height:window.innerHeight}:{width:0,height:0};var D;return(D=r?.map(L=>{const A=typeof L=="string";let O=0;if(A&&(O=parseInt(L,10)),Ve(l)){const E=A?O:g?L*T.height:0;return g?l==="bottom"?T.height-E:-T.height+E:E}const F=A?O:g?L*T.width:0;return g?l==="right"?T.width-F:-T.width+F:F}))!=null?D:[]},[r,g,c]),x=w.useMemo(()=>m!==null?p?.[m]:null,[p,m]),C=w.useCallback(T=>{var D;const L=(D=p?.findIndex(A=>A===T))!=null?D:null;i(L),je(n.current,{transition:`transform ${Ie.DURATION}s cubic-bezier(${Ie.EASE.join(",")})`,transform:Ve(l)?`translate3d(0, ${T}px, 0)`:`translate3d(${T}px, 0, 0)`}),p&&L!==p.length-1&&a!==void 0&&L!==a&&L<a?je(o.current,{transition:`opacity ${Ie.DURATION}s cubic-bezier(${Ie.EASE.join(",")})`,opacity:"0"}):je(o.current,{transition:`opacity ${Ie.DURATION}s cubic-bezier(${Ie.EASE.join(",")})`,opacity:"1"}),d(r?.[Math.max(L,0)])},[n.current,r,p,a,o,d]);w.useEffect(()=>{if(f||e){var T;const D=(T=r?.findIndex(L=>L===e||L===f))!=null?T:-1;p&&D!==-1&&typeof p[D]=="number"&&C(p[D])}},[f,e,r,p,C]);function y({draggedDistance:T,closeDrawer:D,velocity:L,dismissible:A}){if(a===void 0)return;const O=l==="bottom"||l==="right"?(x??0)-T:(x??0)+T,F=m===a-1,E=m===0,I=T>0;if(F&&je(o.current,{transition:`opacity ${Ie.DURATION}s cubic-bezier(${Ie.EASE.join(",")})`}),!u&&L>2&&!I){A?D():C(p[0]);return}if(!u&&L>2&&I&&p&&r){C(p[r.length-1]);return}const _=p?.reduce((H,U)=>typeof H!="number"||typeof U!="number"?H:Math.abs(U-O)<Math.abs(H-O)?U:H),M=Ve(l)?window.innerHeight:window.innerWidth;if(L>$c&&Math.abs(T)<M*.4){const H=I?1:-1;if(H>0&&v&&r){C(p[r.length-1]);return}if(E&&H<0&&A&&D(),m===null)return;C(p[m+H]);return}C(_)}function N({draggedDistance:T}){if(x===null)return;const D=l==="bottom"||l==="right"?x-T:x+T;(l==="bottom"||l==="right")&&D<p[p.length-1]||(l==="top"||l==="left")&&D>p[p.length-1]||je(n.current,{transform:Ve(l)?`translate3d(0, ${D}px, 0)`:`translate3d(${D}px, 0, 0)`})}function P(T,D){if(!r||typeof m!="number"||!p||a===void 0)return null;const L=m===a-1;if(m>=a&&D)return 0;if(L&&!D)return 1;if(!b&&!L)return null;const O=L?m+1:m-1,F=L?p[O]-p[O-1]:p[O+1]-p[O],E=T/Math.abs(F);return L?1-E:E}return{isLastSnapPoint:v,activeSnapPoint:f,shouldFade:b,getPercentageDragged:P,setActiveSnapPoint:d,activeSnapPointIndex:m,onRelease:y,onDrag:N,snapPointsOffset:p}}const vh=()=>()=>{};function Ch(){const{direction:e,isOpen:t,shouldScaleBackground:r,setBackgroundColorOnScale:n,noBodyStyles:o}=An(),a=w.useRef(null),i=w.useMemo(()=>document.body.style.backgroundColor,[]);function l(){return(window.innerWidth-Qo)/window.innerWidth}w.useEffect(()=>{if(t&&r){a.current&&clearTimeout(a.current);const c=document.querySelector("[data-vaul-drawer-wrapper]")||document.querySelector("[vaul-drawer-wrapper]");if(!c)return;hh(n&&!o?Xo(document.body,{background:"black"}):vh,Xo(c,{transformOrigin:Ve(e)?"top":"left",transitionProperty:"transform, border-radius",transitionDuration:`${Ie.DURATION}s`,transitionTimingFunction:`cubic-bezier(${Ie.EASE.join(",")})`}));const u=Xo(c,{borderRadius:`${Vc}px`,overflow:"hidden",...Ve(e)?{transform:`scale(${l()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`}:{transform:`scale(${l()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`}});return()=>{u(),a.current=window.setTimeout(()=>{i?document.body.style.background=i:document.body.style.removeProperty("background")},Ie.DURATION*1e3)}}},[t,r,i])}let kn=null;function xh({isOpen:e,modal:t,nested:r,hasBeenOpened:n,preventScrollRestoration:o,noBodyStyles:a}){const[i,l]=w.useState(()=>typeof window<"u"?window.location.href:""),c=w.useRef(0),u=w.useCallback(()=>{if(Oc()&&kn===null&&e&&!a){kn={position:document.body.style.position,top:document.body.style.top,left:document.body.style.left,height:document.body.style.height,right:"unset"};const{scrollX:d,innerHeight:g}=window;document.body.style.setProperty("position","fixed","important"),Object.assign(document.body.style,{top:`${-c.current}px`,left:`${-d}px`,right:"0px",height:"auto"}),window.setTimeout(()=>window.requestAnimationFrame(()=>{const h=g-window.innerHeight;h&&c.current>=g&&(document.body.style.top=`${-(c.current+h)}px`)}),300)}},[e]),f=w.useCallback(()=>{if(Oc()&&kn!==null&&!a){const d=-parseInt(document.body.style.top,10),g=-parseInt(document.body.style.left,10);Object.assign(document.body.style,kn),window.requestAnimationFrame(()=>{if(o&&i!==window.location.href){l(window.location.href);return}window.scrollTo(g,d)}),kn=null}},[i]);return w.useEffect(()=>{function d(){c.current=window.scrollY}return d(),window.addEventListener("scroll",d),()=>{window.removeEventListener("scroll",d)}},[]),w.useEffect(()=>{if(t)return()=>{typeof document>"u"||document.querySelector("[data-vaul-drawer]")||f()}},[t,f]),w.useEffect(()=>{r||!n||(e?(!window.matchMedia("(display-mode: standalone)").matches&&u(),t||window.setTimeout(()=>{f()},500)):f())},[e,n,i,t,r,u,f]),{restorePositionSetting:f}}function Eh({open:e,onOpenChange:t,children:r,onDrag:n,onRelease:o,snapPoints:a,shouldScaleBackground:i=!1,setBackgroundColorOnScale:l=!0,closeThreshold:c=ph,scrollLockTimeout:u=mh,dismissible:f=!0,handleOnly:d=!1,fadeFromIndex:g=a&&a.length-1,activeSnapPoint:h,setActiveSnapPoint:v,fixed:m,modal:b=!0,onClose:p,nested:x,noBodyStyles:C=!1,direction:y="bottom",defaultOpen:N=!1,disablePreventScroll:P=!0,snapToSequentialPoint:T=!1,preventScrollRestoration:D=!1,repositionInputs:L=!0,onAnimationEnd:A,container:O,autoFocus:F=!1}){var E,I;const[_=!1,M]=Wc({defaultProp:N,prop:e,onChange:R=>{t?.(R),!R&&!x&&it(),setTimeout(()=>{A?.(R)},Ie.DURATION*1e3),R&&!b&&typeof window<"u"&&window.requestAnimationFrame(()=>{document.body.style.pointerEvents="auto"}),R||(document.body.style.pointerEvents="auto")}}),[H,U]=w.useState(!1),[j,re]=w.useState(!1),[oe,we]=w.useState(!1),J=w.useRef(null),G=w.useRef(null),z=w.useRef(null),ce=w.useRef(null),Y=w.useRef(null),K=w.useRef(!1),xe=w.useRef(null),Ke=w.useRef(0),ze=w.useRef(!1),ie=w.useRef(!N),Oe=w.useRef(0),X=w.useRef(null),wt=w.useRef(((E=X.current)==null?void 0:E.getBoundingClientRect().height)||0),Xe=w.useRef(((I=X.current)==null?void 0:I.getBoundingClientRect().width)||0),_e=w.useRef(0),ne=w.useCallback(R=>{a&&R===q.length-1&&(G.current=new Date)},[]),{activeSnapPoint:de,activeSnapPointIndex:Le,setActiveSnapPoint:tt,onRelease:Me,snapPointsOffset:q,onDrag:ae,shouldFade:Nt,getPercentageDragged:Qe}=bh({snapPoints:a,activeSnapPointProp:h,setActiveSnapPointProp:v,drawerRef:X,fadeFromIndex:g,overlayRef:J,onSnapPointChange:ne,direction:y,container:O,snapToSequentialPoint:T});lh({isDisabled:!_||j||!b||oe||!H||!L||!P});const{restorePositionSetting:it}=xh({isOpen:_,modal:b,nested:x??!1,hasBeenOpened:H,preventScrollRestoration:D,noBodyStyles:C});function We(){return(window.innerWidth-Qo)/window.innerWidth}function ht(R){var B,Q;!f&&!a||X.current&&!X.current.contains(R.target)||(wt.current=((B=X.current)==null?void 0:B.getBoundingClientRect().height)||0,Xe.current=((Q=X.current)==null?void 0:Q.getBoundingClientRect().width)||0,re(!0),z.current=new Date,Lc()&&window.addEventListener("touchend",()=>K.current=!1,{once:!0}),R.target.setPointerCapture(R.pointerId),Ke.current=Ve(y)?R.pageY:R.pageX)}function pt(R,B){var Q;let se=R;const ye=(Q=window.getSelection())==null?void 0:Q.toString(),ee=X.current?ws(X.current,y):null,he=new Date;if(se.tagName==="SELECT"||se.hasAttribute("data-vaul-no-drag")||se.closest("[data-vaul-no-drag]"))return!1;if(y==="right"||y==="left")return!0;if(G.current&&he.getTime()-G.current.getTime()<500)return!1;if(ee!==null&&(y==="bottom"?ee>0:ee<0))return!0;if(ye&&ye.length>0)return!1;if(Y.current&&he.getTime()-Y.current.getTime()<u&&ee===0||B)return Y.current=he,!1;for(;se;){if(se.scrollHeight>se.clientHeight){if(se.scrollTop!==0)return Y.current=new Date,!1;if(se.getAttribute("role")==="dialog")return!0}se=se.parentNode}return!0}function St(R){if(X.current&&j){const B=y==="bottom"||y==="right"?1:-1,Q=(Ke.current-(Ve(y)?R.pageY:R.pageX))*B,se=Q>0,ye=a&&!f&&!se;if(ye&&Le===0)return;const ee=Math.abs(Q),he=document.querySelector("[data-vaul-drawer-wrapper]"),ke=y==="bottom"||y==="top"?wt.current:Xe.current;let Pe=ee/ke;const Tt=Qe(ee,se);if(Tt!==null&&(Pe=Tt),ye&&Pe>=1||!K.current&&!pt(R.target,se))return;if(X.current.classList.add(Jo),K.current=!0,je(X.current,{transition:"none"}),je(J.current,{transition:"none"}),a&&ae({draggedDistance:Q}),se&&!a){const De=wh(Q),nr=Math.min(De*-1,0)*B;je(X.current,{transform:Ve(y)?`translate3d(0, ${nr}px, 0)`:`translate3d(${nr}px, 0, 0)`});return}const Ae=1-Pe;if((Nt||g&&Le===g-1)&&(n?.(R,Pe),je(J.current,{opacity:`${Ae}`,transition:"none"},!0)),he&&J.current&&i){const De=Math.min(We()+Pe*(1-We()),1),nr=8-Pe*8,mt=Math.max(0,14-Pe*14);je(he,{borderRadius:`${nr}px`,transform:Ve(y)?`scale(${De}) translate3d(0, ${mt}px, 0)`:`scale(${De}) translate3d(${mt}px, 0, 0)`,transition:"none"},!0)}if(!a){const De=ee*B;je(X.current,{transform:Ve(y)?`translate3d(0, ${De}px, 0)`:`translate3d(${De}px, 0, 0)`})}}}w.useEffect(()=>{window.requestAnimationFrame(()=>{ie.current=!0})},[]),w.useEffect(()=>{var R;function B(){if(!X.current||!L)return;const Q=document.activeElement;if(Ko(Q)||ze.current){var se;const ye=((se=window.visualViewport)==null?void 0:se.height)||0,ee=window.innerHeight;let he=ee-ye;const ke=X.current.getBoundingClientRect().height||0,Pe=ke>ee*.8;_e.current||(_e.current=ke);const Tt=X.current.getBoundingClientRect().top;if(Math.abs(Oe.current-he)>60&&(ze.current=!ze.current),a&&a.length>0&&q&&Le){const Ae=q[Le]||0;he+=Ae}if(Oe.current=he,ke>ye||ze.current){const Ae=X.current.getBoundingClientRect().height;let De=Ae;Ae>ye&&(De=ye-(Pe?Tt:Qo)),m?X.current.style.height=`${Ae-Math.max(he,0)}px`:X.current.style.height=`${Math.max(De,ye-Tt)}px`}else th()||(X.current.style.height=`${_e.current}px`);a&&a.length>0&&!ze.current?X.current.style.bottom="0px":X.current.style.bottom=`${Math.max(he,0)}px`}}return(R=window.visualViewport)==null||R.addEventListener("resize",B),()=>{var Q;return(Q=window.visualViewport)==null?void 0:Q.removeEventListener("resize",B)}},[Le,a,q]);function Se(R){Je(),p?.(),R||M(!1),setTimeout(()=>{a&&tt(a[0])},Ie.DURATION*1e3)}function Mt(){if(!X.current)return;const R=document.querySelector("[data-vaul-drawer-wrapper]"),B=ws(X.current,y);je(X.current,{transform:"translate3d(0, 0, 0)",transition:`transform ${Ie.DURATION}s cubic-bezier(${Ie.EASE.join(",")})`}),je(J.current,{transition:`opacity ${Ie.DURATION}s cubic-bezier(${Ie.EASE.join(",")})`,opacity:"1"}),i&&B&&B>0&&_&&je(R,{borderRadius:`${Vc}px`,overflow:"hidden",...Ve(y)?{transform:`scale(${We()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`,transformOrigin:"top"}:{transform:`scale(${We()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`,transformOrigin:"left"},transitionProperty:"transform, border-radius",transitionDuration:`${Ie.DURATION}s`,transitionTimingFunction:`cubic-bezier(${Ie.EASE.join(",")})`},!0)}function Je(){!j||!X.current||(X.current.classList.remove(Jo),K.current=!1,re(!1),ce.current=new Date)}function Or(R){if(!j||!X.current)return;X.current.classList.remove(Jo),K.current=!1,re(!1),ce.current=new Date;const B=ws(X.current,y);if(!R||!pt(R.target,!1)||!B||Number.isNaN(B)||z.current===null)return;const Q=ce.current.getTime()-z.current.getTime(),se=Ke.current-(Ve(y)?R.pageY:R.pageX),ye=Math.abs(se)/Q;if(ye>.05&&(we(!0),setTimeout(()=>{we(!1)},200)),a){Me({draggedDistance:se*(y==="bottom"||y==="right"?1:-1),closeDrawer:Se,velocity:ye,dismissible:f}),o?.(R,!0);return}if(y==="bottom"||y==="right"?se>0:se<0){Mt(),o?.(R,!0);return}if(ye>$c){Se(),o?.(R,!1);return}var ee;const he=Math.min((ee=X.current.getBoundingClientRect().height)!=null?ee:0,window.innerHeight);var ke;const Pe=Math.min((ke=X.current.getBoundingClientRect().width)!=null?ke:0,window.innerWidth),Tt=y==="left"||y==="right";if(Math.abs(B)>=(Tt?Pe:he)*c){Se(),o?.(R,!1);return}o?.(R,!0),Mt()}w.useEffect(()=>(_&&(je(document.documentElement,{scrollBehavior:"auto"}),G.current=new Date),()=>{gh(document.documentElement,"scrollBehavior")}),[_]);function Lr(R){const B=R?(window.innerWidth-kr)/window.innerWidth:1,Q=R?-kr:0;xe.current&&window.clearTimeout(xe.current),je(X.current,{transition:`transform ${Ie.DURATION}s cubic-bezier(${Ie.EASE.join(",")})`,transform:Ve(y)?`scale(${B}) translate3d(0, ${Q}px, 0)`:`scale(${B}) translate3d(${Q}px, 0, 0)`}),!R&&X.current&&(xe.current=setTimeout(()=>{const se=ws(X.current,y);je(X.current,{transition:"none",transform:Ve(y)?`translate3d(0, ${se}px, 0)`:`translate3d(${se}px, 0, 0)`})},500))}function Un(R,B){if(B<0)return;const Q=(window.innerWidth-kr)/window.innerWidth,se=Q+B*(1-Q),ye=-kr+B*kr;je(X.current,{transform:Ve(y)?`scale(${se}) translate3d(0, ${ye}px, 0)`:`scale(${se}) translate3d(${ye}px, 0, 0)`,transition:"none"})}function pr(R,B){const Q=Ve(y)?window.innerHeight:window.innerWidth,se=B?(Q-kr)/Q:1,ye=B?-kr:0;B&&je(X.current,{transition:`transform ${Ie.DURATION}s cubic-bezier(${Ie.EASE.join(",")})`,transform:Ve(y)?`scale(${se}) translate3d(0, ${ye}px, 0)`:`scale(${se}) translate3d(${ye}px, 0, 0)`})}return w.useEffect(()=>{b||window.requestAnimationFrame(()=>{document.body.style.pointerEvents="auto"})},[b]),w.createElement(kc,{defaultOpen:N,onOpenChange:R=>{!f&&!R||(R?U(!0):Se(!0),M(R))},open:_},w.createElement(Ic.Provider,{value:{activeSnapPoint:de,snapPoints:a,setActiveSnapPoint:tt,drawerRef:X,overlayRef:J,onOpenChange:t,onPress:ht,onRelease:Or,onDrag:St,dismissible:f,shouldAnimate:ie,handleOnly:d,isOpen:_,isDragging:j,shouldFade:Nt,closeDrawer:Se,onNestedDrag:Un,onNestedOpenChange:Lr,onNestedRelease:pr,keyboardIsOpen:ze,modal:b,snapPointsOffset:q,activeSnapPointIndex:Le,direction:y,shouldScaleBackground:i,setBackgroundColorOnScale:l,noBodyStyles:C,container:O,autoFocus:F}},r))}const jc=w.forwardRef(function({...e},t){const{overlayRef:r,snapPoints:n,onRelease:o,shouldFade:a,isOpen:i,modal:l,shouldAnimate:c}=An(),u=Bc(t,r),f=n&&n.length>0;if(!l)return null;const d=w.useCallback(g=>o(g),[o]);return w.createElement(zo,{onMouseUp:d,ref:u,"data-vaul-overlay":"","data-vaul-snap-points":i&&f?"true":"false","data-vaul-snap-points-overlay":i&&a?"true":"false","data-vaul-animate":c?.current?"true":"false",...e})});jc.displayName="Drawer.Overlay";const Gc=w.forwardRef(function({onPointerDownOutside:e,style:t,onOpenAutoFocus:r,...n},o){const{drawerRef:a,onPress:i,onRelease:l,onDrag:c,keyboardIsOpen:u,snapPointsOffset:f,activeSnapPointIndex:d,modal:g,isOpen:h,direction:v,snapPoints:m,container:b,handleOnly:p,shouldAnimate:x,autoFocus:C}=An(),[y,N]=w.useState(!1),P=Bc(o,a),T=w.useRef(null),D=w.useRef(null),L=w.useRef(!1),A=m&&m.length>0;Ch();const O=(E,I,_=0)=>{if(L.current)return!0;const M=Math.abs(E.y),H=Math.abs(E.x),U=H>M,j=["bottom","right"].includes(I)?1:-1;if(I==="left"||I==="right"){if(!(E.x*j<0)&&H>=0&&H<=_)return U}else if(!(E.y*j<0)&&M>=0&&M<=_)return!U;return L.current=!0,!0};w.useEffect(()=>{A&&window.requestAnimationFrame(()=>{N(!0)})},[]);function F(E){T.current=null,L.current=!1,l(E)}return w.createElement(Wo,{"data-vaul-drawer-direction":v,"data-vaul-drawer":"","data-vaul-delayed-snap-points":y?"true":"false","data-vaul-snap-points":h&&A?"true":"false","data-vaul-custom-container":b?"true":"false","data-vaul-animate":x?.current?"true":"false",...n,ref:P,style:f&&f.length>0?{"--snap-point-height":`${f[d??0]}px`,...t}:t,onPointerDown:E=>{p||(n.onPointerDown==null||n.onPointerDown.call(n,E),T.current={x:E.pageX,y:E.pageY},i(E))},onOpenAutoFocus:E=>{r?.(E),C||E.preventDefault()},onPointerDownOutside:E=>{if(e?.(E),!g||E.defaultPrevented){E.preventDefault();return}u.current&&(u.current=!1)},onFocusOutside:E=>{if(!g){E.preventDefault();return}},onPointerMove:E=>{if(D.current=E,p||(n.onPointerMove==null||n.onPointerMove.call(n,E),!T.current))return;const I=E.pageY-T.current.y,_=E.pageX-T.current.x,M=E.pointerType==="touch"?10:2;O({x:_,y:I},v,M)?c(E):(Math.abs(_)>M||Math.abs(I)>M)&&(T.current=null)},onPointerUp:E=>{n.onPointerUp==null||n.onPointerUp.call(n,E),T.current=null,L.current=!1,l(E)},onPointerOut:E=>{n.onPointerOut==null||n.onPointerOut.call(n,E),F(D.current)},onContextMenu:E=>{n.onContextMenu==null||n.onContextMenu.call(n,E),D.current&&F(D.current)}})});Gc.displayName="Drawer.Content";const Nh=250,Sh=120,qc=w.forwardRef(function({preventCycle:e=!1,children:t,...r},n){const{closeDrawer:o,isDragging:a,snapPoints:i,activeSnapPoint:l,setActiveSnapPoint:c,dismissible:u,handleOnly:f,isOpen:d,onPress:g,onDrag:h}=An(),v=w.useRef(null),m=w.useRef(!1);function b(){if(m.current){C();return}window.setTimeout(()=>{p()},Sh)}function p(){if(a||e||m.current){C();return}if(C(),!i||i.length===0){u||o();return}if(l===i[i.length-1]&&u){o();return}const N=i.findIndex(T=>T===l);if(N===-1)return;const P=i[N+1];c(P)}function x(){v.current=window.setTimeout(()=>{m.current=!0},Nh)}function C(){v.current&&window.clearTimeout(v.current),m.current=!1}return w.createElement("div",{onClick:b,onPointerCancel:C,onPointerDown:y=>{f&&g(y),x()},onPointerMove:y=>{f&&h(y)},ref:n,"data-vaul-drawer-visible":d?"true":"false","data-vaul-handle":"","aria-hidden":"true",...r},w.createElement("span",{"data-vaul-handle-hitarea":"","aria-hidden":"true"},t))});qc.displayName="Drawer.Handle";function Ah(e){const t=An(),{container:r=t.container,...n}=e;return w.createElement(_c,{container:r,...n})}const dr={Root:Eh,Content:Gc,Overlay:jc,Trigger:Pc,Portal:Ah,Handle:qc,Title:jo,Description:Go},Th=({shouldScaleBackground:e=!1,repositionInputs:t=!1,...r})=>s.jsx(dr.Root,{shouldScaleBackground:e,repositionInputs:t,...r}),kh=dr.Trigger,Ph=dr.Portal,_h=dr.Handle,Ih=w.forwardRef(({className:e,...t},r)=>s.jsx(dr.Overlay,{ref:r,className:V("gw-fixed gw-inset-0 gw-z-50 gw-backdrop-blur-sm gw-bg-black/50",e),...t})),Oh=w.forwardRef(({className:e,children:t,childrenWrapperClassName:r,...n},o)=>s.jsxs(Ph,{children:[s.jsx(Ih,{}),s.jsx(dr.Content,{ref:o,className:V("gw-fixed gw-left-0 gw-right-0 gw-bottom-0 gw-z-50 gw-flex gw-flex-col gw-rounded-t-3xl gw-bg-popover gw-text-popover-foreground gw-shadow-md",e),...n,children:s.jsx("div",{className:V("gw-w-full gw-mx-auto gw-rounded-t-3xl gw-pt-2",r),children:t})})]})),Lh=w.forwardRef(({className:e,...t},r)=>s.jsx(dr.Title,{ref:r,className:V("gw-text-lg gw-font-semibold gw-leading-none gw-tracking-tight",e),...t})),Mh=w.forwardRef(({className:e,...t},r)=>s.jsx(dr.Description,{ref:r,className:V("gw-text-sm gw-text-muted-foreground",e),...t})),Dh=["top","right","bottom","left"],ur=Math.min,xt=Math.max,hs=Math.round,ps=Math.floor,Vt=e=>({x:e,y:e}),Fh={left:"right",right:"left",bottom:"top",top:"bottom"},Uh={start:"end",end:"start"};function Ro(e,t,r){return xt(e,ur(t,r))}function tr(e,t){return typeof e=="function"?e(t):e}function rr(e){return e.split("-")[0]}function Qr(e){return e.split("-")[1]}function ea(e){return e==="x"?"y":"x"}function ta(e){return e==="y"?"height":"width"}const Bh=new Set(["top","bottom"]);function zt(e){return Bh.has(rr(e))?"y":"x"}function ra(e){return ea(zt(e))}function Hh(e,t,r){r===void 0&&(r=!1);const n=Qr(e),o=ra(e),a=ta(o);let i=o==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[a]>t.floating[a]&&(i=ms(i)),[i,ms(i)]}function $h(e){const t=ms(e);return[na(e),t,na(t)]}function na(e){return e.replace(/start|end/g,t=>Uh[t])}const Zc=["left","right"],Yc=["right","left"],Vh=["top","bottom"],zh=["bottom","top"];function Wh(e,t,r){switch(e){case"top":case"bottom":return r?t?Yc:Zc:t?Zc:Yc;case"left":case"right":return t?Vh:zh;default:return[]}}function jh(e,t,r,n){const o=Qr(e);let a=Wh(rr(e),r==="start",n);return o&&(a=a.map(i=>i+"-"+o),t&&(a=a.concat(a.map(na)))),a}function ms(e){return e.replace(/left|right|bottom|top/g,t=>Fh[t])}function Gh(e){return{top:0,right:0,bottom:0,left:0,...e}}function Kc(e){return typeof e!="number"?Gh(e):{top:e,right:e,bottom:e,left:e}}function ys(e){const{x:t,y:r,width:n,height:o}=e;return{width:n,height:o,top:r,left:t,right:t+n,bottom:r+o,x:t,y:r}}function Xc(e,t,r){let{reference:n,floating:o}=e;const a=zt(t),i=ra(t),l=ta(i),c=rr(t),u=a==="y",f=n.x+n.width/2-o.width/2,d=n.y+n.height/2-o.height/2,g=n[l]/2-o[l]/2;let h;switch(c){case"top":h={x:f,y:n.y-o.height};break;case"bottom":h={x:f,y:n.y+n.height};break;case"right":h={x:n.x+n.width,y:d};break;case"left":h={x:n.x-o.width,y:d};break;default:h={x:n.x,y:n.y}}switch(Qr(t)){case"start":h[i]-=g*(r&&u?-1:1);break;case"end":h[i]+=g*(r&&u?-1:1);break}return h}const qh=async(e,t,r)=>{const{placement:n="bottom",strategy:o="absolute",middleware:a=[],platform:i}=r,l=a.filter(Boolean),c=await(i.isRTL==null?void 0:i.isRTL(t));let u=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:f,y:d}=Xc(u,n,c),g=n,h={},v=0;for(let m=0;m<l.length;m++){const{name:b,fn:p}=l[m],{x,y:C,data:y,reset:N}=await p({x:f,y:d,initialPlacement:n,placement:g,strategy:o,middlewareData:h,rects:u,platform:i,elements:{reference:e,floating:t}});f=x??f,d=C??d,h={...h,[b]:{...h[b],...y}},N&&v<=50&&(v++,typeof N=="object"&&(N.placement&&(g=N.placement),N.rects&&(u=N.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:o}):N.rects),{x:f,y:d}=Xc(u,g,c)),m=-1)}return{x:f,y:d,placement:g,strategy:o,middlewareData:h}};async function Pn(e,t){var r;t===void 0&&(t={});const{x:n,y:o,platform:a,rects:i,elements:l,strategy:c}=e,{boundary:u="clippingAncestors",rootBoundary:f="viewport",elementContext:d="floating",altBoundary:g=!1,padding:h=0}=tr(t,e),v=Kc(h),b=l[g?d==="floating"?"reference":"floating":d],p=ys(await a.getClippingRect({element:(r=await(a.isElement==null?void 0:a.isElement(b)))==null||r?b:b.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(l.floating)),boundary:u,rootBoundary:f,strategy:c})),x=d==="floating"?{x:n,y:o,width:i.floating.width,height:i.floating.height}:i.reference,C=await(a.getOffsetParent==null?void 0:a.getOffsetParent(l.floating)),y=await(a.isElement==null?void 0:a.isElement(C))?await(a.getScale==null?void 0:a.getScale(C))||{x:1,y:1}:{x:1,y:1},N=ys(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:x,offsetParent:C,strategy:c}):x);return{top:(p.top-N.top+v.top)/y.y,bottom:(N.bottom-p.bottom+v.bottom)/y.y,left:(p.left-N.left+v.left)/y.x,right:(N.right-p.right+v.right)/y.x}}const Zh=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:o,rects:a,platform:i,elements:l,middlewareData:c}=t,{element:u,padding:f=0}=tr(e,t)||{};if(u==null)return{};const d=Kc(f),g={x:r,y:n},h=ra(o),v=ta(h),m=await i.getDimensions(u),b=h==="y",p=b?"top":"left",x=b?"bottom":"right",C=b?"clientHeight":"clientWidth",y=a.reference[v]+a.reference[h]-g[h]-a.floating[v],N=g[h]-a.reference[h],P=await(i.getOffsetParent==null?void 0:i.getOffsetParent(u));let T=P?P[C]:0;(!T||!await(i.isElement==null?void 0:i.isElement(P)))&&(T=l.floating[C]||a.floating[v]);const D=y/2-N/2,L=T/2-m[v]/2-1,A=ur(d[p],L),O=ur(d[x],L),F=A,E=T-m[v]-O,I=T/2-m[v]/2+D,_=Ro(F,I,E),M=!c.arrow&&Qr(o)!=null&&I!==_&&a.reference[v]/2-(I<F?A:O)-m[v]/2<0,H=M?I<F?I-F:I-E:0;return{[h]:g[h]+H,data:{[h]:_,centerOffset:I-_-H,...M&&{alignmentOffset:H}},reset:M}}}),Yh=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r,n;const{placement:o,middlewareData:a,rects:i,initialPlacement:l,platform:c,elements:u}=t,{mainAxis:f=!0,crossAxis:d=!0,fallbackPlacements:g,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:m=!0,...b}=tr(e,t);if((r=a.arrow)!=null&&r.alignmentOffset)return{};const p=rr(o),x=zt(l),C=rr(l)===l,y=await(c.isRTL==null?void 0:c.isRTL(u.floating)),N=g||(C||!m?[ms(l)]:$h(l)),P=v!=="none";!g&&P&&N.push(...jh(l,m,v,y));const T=[l,...N],D=await Pn(t,b),L=[];let A=((n=a.flip)==null?void 0:n.overflows)||[];if(f&&L.push(D[p]),d){const I=Hh(o,i,y);L.push(D[I[0]],D[I[1]])}if(A=[...A,{placement:o,overflows:L}],!L.every(I=>I<=0)){var O,F;const I=(((O=a.flip)==null?void 0:O.index)||0)+1,_=T[I];if(_&&(!(d==="alignment"?x!==zt(_):!1)||A.every(U=>zt(U.placement)===x?U.overflows[0]>0:!0)))return{data:{index:I,overflows:A},reset:{placement:_}};let M=(F=A.filter(H=>H.overflows[0]<=0).sort((H,U)=>H.overflows[1]-U.overflows[1])[0])==null?void 0:F.placement;if(!M)switch(h){case"bestFit":{var E;const H=(E=A.filter(U=>{if(P){const j=zt(U.placement);return j===x||j==="y"}return!0}).map(U=>[U.placement,U.overflows.filter(j=>j>0).reduce((j,re)=>j+re,0)]).sort((U,j)=>U[1]-j[1])[0])==null?void 0:E[0];H&&(M=H);break}case"initialPlacement":M=l;break}if(o!==M)return{reset:{placement:M}}}return{}}}};function Qc(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Jc(e){return Dh.some(t=>e[t]>=0)}const Kh=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r}=t,{strategy:n="referenceHidden",...o}=tr(e,t);switch(n){case"referenceHidden":{const a=await Pn(t,{...o,elementContext:"reference"}),i=Qc(a,r.reference);return{data:{referenceHiddenOffsets:i,referenceHidden:Jc(i)}}}case"escaped":{const a=await Pn(t,{...o,altBoundary:!0}),i=Qc(a,r.floating);return{data:{escapedOffsets:i,escaped:Jc(i)}}}default:return{}}}}},Rc=new Set(["left","top"]);async function Xh(e,t){const{placement:r,platform:n,elements:o}=e,a=await(n.isRTL==null?void 0:n.isRTL(o.floating)),i=rr(r),l=Qr(r),c=zt(r)==="y",u=Rc.has(i)?-1:1,f=a&&c?-1:1,d=tr(t,e);let{mainAxis:g,crossAxis:h,alignmentAxis:v}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return l&&typeof v=="number"&&(h=l==="end"?v*-1:v),c?{x:h*f,y:g*u}:{x:g*u,y:h*f}}const Qh=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:o,y:a,placement:i,middlewareData:l}=t,c=await Xh(t,e);return i===((r=l.offset)==null?void 0:r.placement)&&(n=l.arrow)!=null&&n.alignmentOffset?{}:{x:o+c.x,y:a+c.y,data:{...c,placement:i}}}}},Jh=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:o}=t,{mainAxis:a=!0,crossAxis:i=!1,limiter:l={fn:b=>{let{x:p,y:x}=b;return{x:p,y:x}}},...c}=tr(e,t),u={x:r,y:n},f=await Pn(t,c),d=zt(rr(o)),g=ea(d);let h=u[g],v=u[d];if(a){const b=g==="y"?"top":"left",p=g==="y"?"bottom":"right",x=h+f[b],C=h-f[p];h=Ro(x,h,C)}if(i){const b=d==="y"?"top":"left",p=d==="y"?"bottom":"right",x=v+f[b],C=v-f[p];v=Ro(x,v,C)}const m=l.fn({...t,[g]:h,[d]:v});return{...m,data:{x:m.x-r,y:m.y-n,enabled:{[g]:a,[d]:i}}}}}},Rh=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:o,rects:a,middlewareData:i}=t,{offset:l=0,mainAxis:c=!0,crossAxis:u=!0}=tr(e,t),f={x:r,y:n},d=zt(o),g=ea(d);let h=f[g],v=f[d];const m=tr(l,t),b=typeof m=="number"?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(c){const C=g==="y"?"height":"width",y=a.reference[g]-a.floating[C]+b.mainAxis,N=a.reference[g]+a.reference[C]-b.mainAxis;h<y?h=y:h>N&&(h=N)}if(u){var p,x;const C=g==="y"?"width":"height",y=Rc.has(rr(o)),N=a.reference[d]-a.floating[C]+(y&&((p=i.offset)==null?void 0:p[d])||0)+(y?0:b.crossAxis),P=a.reference[d]+a.reference[C]+(y?0:((x=i.offset)==null?void 0:x[d])||0)-(y?b.crossAxis:0);v<N?v=N:v>P&&(v=P)}return{[g]:h,[d]:v}}}},ep=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var r,n;const{placement:o,rects:a,platform:i,elements:l}=t,{apply:c=()=>{},...u}=tr(e,t),f=await Pn(t,u),d=rr(o),g=Qr(o),h=zt(o)==="y",{width:v,height:m}=a.floating;let b,p;d==="top"||d==="bottom"?(b=d,p=g===(await(i.isRTL==null?void 0:i.isRTL(l.floating))?"start":"end")?"left":"right"):(p=d,b=g==="end"?"top":"bottom");const x=m-f.top-f.bottom,C=v-f.left-f.right,y=ur(m-f[b],x),N=ur(v-f[p],C),P=!t.middlewareData.shift;let T=y,D=N;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&(D=C),(n=t.middlewareData.shift)!=null&&n.enabled.y&&(T=x),P&&!g){const A=xt(f.left,0),O=xt(f.right,0),F=xt(f.top,0),E=xt(f.bottom,0);h?D=v-2*(A!==0||O!==0?A+O:xt(f.left,f.right)):T=m-2*(F!==0||E!==0?F+E:xt(f.top,f.bottom))}await c({...t,availableWidth:D,availableHeight:T});const L=await i.getDimensions(l.floating);return v!==L.width||m!==L.height?{reset:{rects:!0}}:{}}}};function bs(){return typeof window<"u"}function Jr(e){return ed(e)?(e.nodeName||"").toLowerCase():"#document"}function Et(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Wt(e){var t;return(t=(ed(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function ed(e){return bs()?e instanceof Node||e instanceof Et(e).Node:!1}function _t(e){return bs()?e instanceof Element||e instanceof Et(e).Element:!1}function jt(e){return bs()?e instanceof HTMLElement||e instanceof Et(e).HTMLElement:!1}function td(e){return!bs()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Et(e).ShadowRoot}const tp=new Set(["inline","contents"]);function _n(e){const{overflow:t,overflowX:r,overflowY:n,display:o}=It(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!tp.has(o)}const rp=new Set(["table","td","th"]);function np(e){return rp.has(Jr(e))}const sp=[":popover-open",":modal"];function vs(e){return sp.some(t=>{try{return e.matches(t)}catch{return!1}})}const op=["transform","translate","scale","rotate","perspective"],ap=["transform","translate","scale","rotate","perspective","filter"],ip=["paint","layout","strict","content"];function sa(e){const t=oa(),r=_t(e)?It(e):e;return op.some(n=>r[n]?r[n]!=="none":!1)||(r.containerType?r.containerType!=="normal":!1)||!t&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!t&&(r.filter?r.filter!=="none":!1)||ap.some(n=>(r.willChange||"").includes(n))||ip.some(n=>(r.contain||"").includes(n))}function lp(e){let t=fr(e);for(;jt(t)&&!Rr(t);){if(sa(t))return t;if(vs(t))return null;t=fr(t)}return null}function oa(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const cp=new Set(["html","body","#document"]);function Rr(e){return cp.has(Jr(e))}function It(e){return Et(e).getComputedStyle(e)}function Cs(e){return _t(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function fr(e){if(Jr(e)==="html")return e;const t=e.assignedSlot||e.parentNode||td(e)&&e.host||Wt(e);return td(t)?t.host:t}function rd(e){const t=fr(e);return Rr(t)?e.ownerDocument?e.ownerDocument.body:e.body:jt(t)&&_n(t)?t:rd(t)}function In(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);const o=rd(e),a=o===((n=e.ownerDocument)==null?void 0:n.body),i=Et(o);if(a){const l=aa(i);return t.concat(i,i.visualViewport||[],_n(o)?o:[],l&&r?In(l):[])}return t.concat(o,In(o,[],r))}function aa(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function nd(e){const t=It(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const o=jt(e),a=o?e.offsetWidth:r,i=o?e.offsetHeight:n,l=hs(r)!==a||hs(n)!==i;return l&&(r=a,n=i),{width:r,height:n,$:l}}function ia(e){return _t(e)?e:e.contextElement}function en(e){const t=ia(e);if(!jt(t))return Vt(1);const r=t.getBoundingClientRect(),{width:n,height:o,$:a}=nd(t);let i=(a?hs(r.width):r.width)/n,l=(a?hs(r.height):r.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!l||!Number.isFinite(l))&&(l=1),{x:i,y:l}}const dp=Vt(0);function sd(e){const t=Et(e);return!oa()||!t.visualViewport?dp:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function up(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==Et(e)?!1:t}function Pr(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);const o=e.getBoundingClientRect(),a=ia(e);let i=Vt(1);t&&(n?_t(n)&&(i=en(n)):i=en(e));const l=up(a,r,n)?sd(a):Vt(0);let c=(o.left+l.x)/i.x,u=(o.top+l.y)/i.y,f=o.width/i.x,d=o.height/i.y;if(a){const g=Et(a),h=n&&_t(n)?Et(n):n;let v=g,m=aa(v);for(;m&&n&&h!==v;){const b=en(m),p=m.getBoundingClientRect(),x=It(m),C=p.left+(m.clientLeft+parseFloat(x.paddingLeft))*b.x,y=p.top+(m.clientTop+parseFloat(x.paddingTop))*b.y;c*=b.x,u*=b.y,f*=b.x,d*=b.y,c+=C,u+=y,v=Et(m),m=aa(v)}}return ys({width:f,height:d,x:c,y:u})}function xs(e,t){const r=Cs(e).scrollLeft;return t?t.left+r:Pr(Wt(e)).left+r}function od(e,t){const r=e.getBoundingClientRect(),n=r.left+t.scrollLeft-xs(e,r),o=r.top+t.scrollTop;return{x:n,y:o}}function fp(e){let{elements:t,rect:r,offsetParent:n,strategy:o}=e;const a=o==="fixed",i=Wt(n),l=t?vs(t.floating):!1;if(n===i||l&&a)return r;let c={scrollLeft:0,scrollTop:0},u=Vt(1);const f=Vt(0),d=jt(n);if((d||!d&&!a)&&((Jr(n)!=="body"||_n(i))&&(c=Cs(n)),jt(n))){const h=Pr(n);u=en(n),f.x=h.x+n.clientLeft,f.y=h.y+n.clientTop}const g=i&&!d&&!a?od(i,c):Vt(0);return{width:r.width*u.x,height:r.height*u.y,x:r.x*u.x-c.scrollLeft*u.x+f.x+g.x,y:r.y*u.y-c.scrollTop*u.y+f.y+g.y}}function gp(e){return Array.from(e.getClientRects())}function wp(e){const t=Wt(e),r=Cs(e),n=e.ownerDocument.body,o=xt(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),a=xt(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let i=-r.scrollLeft+xs(e);const l=-r.scrollTop;return It(n).direction==="rtl"&&(i+=xt(t.clientWidth,n.clientWidth)-o),{width:o,height:a,x:i,y:l}}const ad=25;function hp(e,t){const r=Et(e),n=Wt(e),o=r.visualViewport;let a=n.clientWidth,i=n.clientHeight,l=0,c=0;if(o){a=o.width,i=o.height;const f=oa();(!f||f&&t==="fixed")&&(l=o.offsetLeft,c=o.offsetTop)}const u=xs(n);if(u<=0){const f=n.ownerDocument,d=f.body,g=getComputedStyle(d),h=f.compatMode==="CSS1Compat"&&parseFloat(g.marginLeft)+parseFloat(g.marginRight)||0,v=Math.abs(n.clientWidth-d.clientWidth-h);v<=ad&&(a-=v)}else u<=ad&&(a+=u);return{width:a,height:i,x:l,y:c}}const pp=new Set(["absolute","fixed"]);function mp(e,t){const r=Pr(e,!0,t==="fixed"),n=r.top+e.clientTop,o=r.left+e.clientLeft,a=jt(e)?en(e):Vt(1),i=e.clientWidth*a.x,l=e.clientHeight*a.y,c=o*a.x,u=n*a.y;return{width:i,height:l,x:c,y:u}}function id(e,t,r){let n;if(t==="viewport")n=hp(e,r);else if(t==="document")n=wp(Wt(e));else if(_t(t))n=mp(t,r);else{const o=sd(e);n={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return ys(n)}function ld(e,t){const r=fr(e);return r===t||!_t(r)||Rr(r)?!1:It(r).position==="fixed"||ld(r,t)}function yp(e,t){const r=t.get(e);if(r)return r;let n=In(e,[],!1).filter(l=>_t(l)&&Jr(l)!=="body"),o=null;const a=It(e).position==="fixed";let i=a?fr(e):e;for(;_t(i)&&!Rr(i);){const l=It(i),c=sa(i);!c&&l.position==="fixed"&&(o=null),(a?!c&&!o:!c&&l.position==="static"&&!!o&&pp.has(o.position)||_n(i)&&!c&&ld(e,i))?n=n.filter(f=>f!==i):o=l,i=fr(i)}return t.set(e,n),n}function bp(e){let{element:t,boundary:r,rootBoundary:n,strategy:o}=e;const i=[...r==="clippingAncestors"?vs(t)?[]:yp(t,this._c):[].concat(r),n],l=i[0],c=i.reduce((u,f)=>{const d=id(t,f,o);return u.top=xt(d.top,u.top),u.right=ur(d.right,u.right),u.bottom=ur(d.bottom,u.bottom),u.left=xt(d.left,u.left),u},id(t,l,o));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function vp(e){const{width:t,height:r}=nd(e);return{width:t,height:r}}function Cp(e,t,r){const n=jt(t),o=Wt(t),a=r==="fixed",i=Pr(e,!0,a,t);let l={scrollLeft:0,scrollTop:0};const c=Vt(0);function u(){c.x=xs(o)}if(n||!n&&!a)if((Jr(t)!=="body"||_n(o))&&(l=Cs(t)),n){const h=Pr(t,!0,a,t);c.x=h.x+t.clientLeft,c.y=h.y+t.clientTop}else o&&u();a&&!n&&o&&u();const f=o&&!n&&!a?od(o,l):Vt(0),d=i.left+l.scrollLeft-c.x-f.x,g=i.top+l.scrollTop-c.y-f.y;return{x:d,y:g,width:i.width,height:i.height}}function la(e){return It(e).position==="static"}function cd(e,t){if(!jt(e)||It(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return Wt(e)===r&&(r=r.ownerDocument.body),r}function dd(e,t){const r=Et(e);if(vs(e))return r;if(!jt(e)){let o=fr(e);for(;o&&!Rr(o);){if(_t(o)&&!la(o))return o;o=fr(o)}return r}let n=cd(e,t);for(;n&&np(n)&&la(n);)n=cd(n,t);return n&&Rr(n)&&la(n)&&!sa(n)?r:n||lp(e)||r}const xp=async function(e){const t=this.getOffsetParent||dd,r=this.getDimensions,n=await r(e.floating);return{reference:Cp(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function Ep(e){return It(e).direction==="rtl"}const Np={convertOffsetParentRelativeRectToViewportRelativeRect:fp,getDocumentElement:Wt,getClippingRect:bp,getOffsetParent:dd,getElementRects:xp,getClientRects:gp,getDimensions:vp,getScale:en,isElement:_t,isRTL:Ep};function ud(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Sp(e,t){let r=null,n;const o=Wt(e);function a(){var l;clearTimeout(n),(l=r)==null||l.disconnect(),r=null}function i(l,c){l===void 0&&(l=!1),c===void 0&&(c=1),a();const u=e.getBoundingClientRect(),{left:f,top:d,width:g,height:h}=u;if(l||t(),!g||!h)return;const v=ps(d),m=ps(o.clientWidth-(f+g)),b=ps(o.clientHeight-(d+h)),p=ps(f),C={rootMargin:-v+"px "+-m+"px "+-b+"px "+-p+"px",threshold:xt(0,ur(1,c))||1};let y=!0;function N(P){const T=P[0].intersectionRatio;if(T!==c){if(!y)return i();T?i(!1,T):n=setTimeout(()=>{i(!1,1e-7)},1e3)}T===1&&!ud(u,e.getBoundingClientRect())&&i(),y=!1}try{r=new IntersectionObserver(N,{...C,root:o.ownerDocument})}catch{r=new IntersectionObserver(N,C)}r.observe(e)}return i(!0),a}function Ap(e,t,r,n){n===void 0&&(n={});const{ancestorScroll:o=!0,ancestorResize:a=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=n,u=ia(e),f=o||a?[...u?In(u):[],...In(t)]:[];f.forEach(p=>{o&&p.addEventListener("scroll",r,{passive:!0}),a&&p.addEventListener("resize",r)});const d=u&&l?Sp(u,r):null;let g=-1,h=null;i&&(h=new ResizeObserver(p=>{let[x]=p;x&&x.target===u&&h&&(h.unobserve(t),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var C;(C=h)==null||C.observe(t)})),r()}),u&&!c&&h.observe(u),h.observe(t));let v,m=c?Pr(e):null;c&&b();function b(){const p=Pr(e);m&&!ud(m,p)&&r(),m=p,v=requestAnimationFrame(b)}return r(),()=>{var p;f.forEach(x=>{o&&x.removeEventListener("scroll",r),a&&x.removeEventListener("resize",r)}),d?.(),(p=h)==null||p.disconnect(),h=null,c&&cancelAnimationFrame(v)}}const Tp=Qh,kp=Jh,Pp=Yh,_p=ep,Ip=Kh,fd=Zh,Op=Rh,Lp=(e,t,r)=>{const n=new Map,o={platform:Np,...r},a={...o.platform,_c:n};return qh(e,t,{...o,platform:a})};var Mp=typeof document<"u",Dp=function(){},Es=Mp?w.useLayoutEffect:Dp;function Ns(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let r,n,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(n=r;n--!==0;)if(!Ns(e[n],t[n]))return!1;return!0}if(o=Object.keys(e),r=o.length,r!==Object.keys(t).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(t,o[n]))return!1;for(n=r;n--!==0;){const a=o[n];if(!(a==="_owner"&&e.$$typeof)&&!Ns(e[a],t[a]))return!1}return!0}return e!==e&&t!==t}function gd(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function wd(e,t){const r=gd(e);return Math.round(t*r)/r}function ca(e){const t=S.useRef(e);return Es(()=>{t.current=e}),t}function Fp(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:o,elements:{reference:a,floating:i}={},transform:l=!0,whileElementsMounted:c,open:u}=e,[f,d]=S.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[g,h]=S.useState(n);Ns(g,n)||h(n);const[v,m]=S.useState(null),[b,p]=S.useState(null),x=S.useCallback(U=>{U!==P.current&&(P.current=U,m(U))},[]),C=S.useCallback(U=>{U!==T.current&&(T.current=U,p(U))},[]),y=a||v,N=i||b,P=S.useRef(null),T=S.useRef(null),D=S.useRef(f),L=c!=null,A=ca(c),O=ca(o),F=ca(u),E=S.useCallback(()=>{if(!P.current||!T.current)return;const U={placement:t,strategy:r,middleware:g};O.current&&(U.platform=O.current),Lp(P.current,T.current,U).then(j=>{const re={...j,isPositioned:F.current!==!1};I.current&&!Ns(D.current,re)&&(D.current=re,ei.flushSync(()=>{d(re)}))})},[g,t,r,O,F]);Es(()=>{u===!1&&D.current.isPositioned&&(D.current.isPositioned=!1,d(U=>({...U,isPositioned:!1})))},[u]);const I=S.useRef(!1);Es(()=>(I.current=!0,()=>{I.current=!1}),[]),Es(()=>{if(y&&(P.current=y),N&&(T.current=N),y&&N){if(A.current)return A.current(y,N,E);E()}},[y,N,E,A,L]);const _=S.useMemo(()=>({reference:P,floating:T,setReference:x,setFloating:C}),[x,C]),M=S.useMemo(()=>({reference:y,floating:N}),[y,N]),H=S.useMemo(()=>{const U={position:r,left:0,top:0};if(!M.floating)return U;const j=wd(M.floating,f.x),re=wd(M.floating,f.y);return l?{...U,transform:"translate("+j+"px, "+re+"px)",...gd(M.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:j,top:re}},[r,l,M.floating,f.x,f.y]);return S.useMemo(()=>({...f,update:E,refs:_,elements:M,floatingStyles:H}),[f,E,_,M,H])}const Up=e=>{function t(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){const{element:n,padding:o}=typeof e=="function"?e(r):e;return n&&t(n)?n.current!=null?fd({element:n.current,padding:o}).fn(r):{}:n?fd({element:n,padding:o}).fn(r):{}}}},Bp=(e,t)=>({...Tp(e),options:[e,t]}),Hp=(e,t)=>({...kp(e),options:[e,t]}),$p=(e,t)=>({...Op(e),options:[e,t]}),Vp=(e,t)=>({...Pp(e),options:[e,t]}),zp=(e,t)=>({..._p(e),options:[e,t]}),Wp=(e,t)=>({...Ip(e),options:[e,t]}),jp=(e,t)=>({...Up(e),options:[e,t]});var Gp="Arrow",hd=S.forwardRef((e,t)=>{const{children:r,width:n=10,height:o=5,...a}=e;return s.jsx(He.svg,{...a,ref:t,width:n,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:s.jsx("polygon",{points:"0,0 30,0 15,10"})})});hd.displayName=Gp;var qp=hd;function Zp(e){const[t,r]=S.useState(void 0);return er(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const n=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const a=o[0];let i,l;if("borderBoxSize"in a){const c=a.borderBoxSize,u=Array.isArray(c)?c[0]:c;i=u.inlineSize,l=u.blockSize}else i=e.offsetWidth,l=e.offsetHeight;r({width:i,height:l})});return n.observe(e,{box:"border-box"}),()=>n.unobserve(e)}else r(void 0)},[e]),t}var da="Popper",[pd,Ss]=Sr(da),[Yp,md]=pd(da),yd=e=>{const{__scopePopper:t,children:r}=e,[n,o]=S.useState(null);return s.jsx(Yp,{scope:t,anchor:n,onAnchorChange:o,children:r})};yd.displayName=da;var bd="PopperAnchor",vd=S.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:n,...o}=e,a=md(bd,r),i=S.useRef(null),l=Re(t,i),c=S.useRef(null);return S.useEffect(()=>{const u=c.current;c.current=n?.current||i.current,u!==c.current&&a.onAnchorChange(c.current)}),n?null:s.jsx(He.div,{...o,ref:l})});vd.displayName=bd;var ua="PopperContent",[Kp,Xp]=pd(ua),Cd=S.forwardRef((e,t)=>{const{__scopePopper:r,side:n="bottom",sideOffset:o=0,align:a="center",alignOffset:i=0,arrowPadding:l=0,avoidCollisions:c=!0,collisionBoundary:u=[],collisionPadding:f=0,sticky:d="partial",hideWhenDetached:g=!1,updatePositionStrategy:h="optimized",onPlaced:v,...m}=e,b=md(ua,r),[p,x]=S.useState(null),C=Re(t,Y=>x(Y)),[y,N]=S.useState(null),P=Zp(y),T=P?.width??0,D=P?.height??0,L=n+(a!=="center"?"-"+a:""),A=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},O=Array.isArray(u)?u:[u],F=O.length>0,E={padding:A,boundary:O.filter(Jp),altBoundary:F},{refs:I,floatingStyles:_,placement:M,isPositioned:H,middlewareData:U}=Fp({strategy:"fixed",placement:L,whileElementsMounted:(...Y)=>Ap(...Y,{animationFrame:h==="always"}),elements:{reference:b.anchor},middleware:[Bp({mainAxis:o+D,alignmentAxis:i}),c&&Hp({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?$p():void 0,...E}),c&&Vp({...E}),zp({...E,apply:({elements:Y,rects:K,availableWidth:xe,availableHeight:Ke})=>{const{width:ze,height:ie}=K.reference,Oe=Y.floating.style;Oe.setProperty("--radix-popper-available-width",`${xe}px`),Oe.setProperty("--radix-popper-available-height",`${Ke}px`),Oe.setProperty("--radix-popper-anchor-width",`${ze}px`),Oe.setProperty("--radix-popper-anchor-height",`${ie}px`)}}),y&&jp({element:y,padding:l}),Rp({arrowWidth:T,arrowHeight:D}),g&&Wp({strategy:"referenceHidden",...E})]}),[j,re]=Nd(M),oe=qr(v);er(()=>{H&&oe?.()},[H,oe]);const we=U.arrow?.x,J=U.arrow?.y,G=U.arrow?.centerOffset!==0,[z,ce]=S.useState();return er(()=>{p&&ce(window.getComputedStyle(p).zIndex)},[p]),s.jsx("div",{ref:I.setFloating,"data-radix-popper-content-wrapper":"",style:{..._,transform:H?_.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:z,"--radix-popper-transform-origin":[U.transformOrigin?.x,U.transformOrigin?.y].join(" "),...U.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:s.jsx(Kp,{scope:r,placedSide:j,onArrowChange:N,arrowX:we,arrowY:J,shouldHideArrow:G,children:s.jsx(He.div,{"data-side":j,"data-align":re,...m,ref:C,style:{...m.style,animation:H?void 0:"none"}})})})});Cd.displayName=ua;var xd="PopperArrow",Qp={top:"bottom",right:"left",bottom:"top",left:"right"},Ed=S.forwardRef(function(t,r){const{__scopePopper:n,...o}=t,a=Xp(xd,n),i=Qp[a.placedSide];return s.jsx("span",{ref:a.onArrowChange,style:{position:"absolute",left:a.arrowX,top:a.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[a.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[a.placedSide],visibility:a.shouldHideArrow?"hidden":void 0},children:s.jsx(qp,{...o,ref:r,style:{...o.style,display:"block"}})})});Ed.displayName=xd;function Jp(e){return e!==null}var Rp=e=>({name:"transformOrigin",options:e,fn(t){const{placement:r,rects:n,middlewareData:o}=t,i=o.arrow?.centerOffset!==0,l=i?0:e.arrowWidth,c=i?0:e.arrowHeight,[u,f]=Nd(r),d={start:"0%",center:"50%",end:"100%"}[f],g=(o.arrow?.x??0)+l/2,h=(o.arrow?.y??0)+c/2;let v="",m="";return u==="bottom"?(v=i?d:`${g}px`,m=`${-c}px`):u==="top"?(v=i?d:`${g}px`,m=`${n.floating.height+c}px`):u==="right"?(v=`${-c}px`,m=i?d:`${h}px`):u==="left"&&(v=`${n.floating.width+c}px`,m=i?d:`${h}px`),{data:{x:v,y:m}}}});function Nd(e){const[t,r="center"]=e.split("-");return[t,r]}var Sd=yd,fa=vd,Ad=Cd,Td=Ed,As="Popover",[kd]=Sr(As,[Ss]),On=Ss(),[e2,gr]=kd(As),Pd=e=>{const{__scopePopover:t,children:r,open:n,defaultOpen:o,onOpenChange:a,modal:i=!1}=e,l=On(t),c=S.useRef(null),[u,f]=S.useState(!1),[d,g]=Gr({prop:n,defaultProp:o??!1,onChange:a,caller:As});return s.jsx(Sd,{...l,children:s.jsx(e2,{scope:t,contentId:Ar(),triggerRef:c,open:d,onOpenChange:g,onOpenToggle:S.useCallback(()=>g(h=>!h),[g]),hasCustomAnchor:u,onCustomAnchorAdd:S.useCallback(()=>f(!0),[]),onCustomAnchorRemove:S.useCallback(()=>f(!1),[]),modal:i,children:r})})};Pd.displayName=As;var _d="PopoverAnchor",t2=S.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=gr(_d,r),a=On(r),{onCustomAnchorAdd:i,onCustomAnchorRemove:l}=o;return S.useEffect(()=>(i(),()=>l()),[i,l]),s.jsx(fa,{...a,...n,ref:t})});t2.displayName=_d;var Id="PopoverTrigger",Od=S.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=gr(Id,r),a=On(r),i=Re(t,o.triggerRef),l=s.jsx(He.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":Ud(o.open),...n,ref:i,onClick:Be(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?l:s.jsx(fa,{asChild:!0,...a,children:l})});Od.displayName=Id;var ga="PopoverPortal",[r2,n2]=kd(ga,{forceMount:void 0}),Ld=e=>{const{__scopePopover:t,forceMount:r,children:n,container:o}=e,a=gr(ga,t);return s.jsx(r2,{scope:t,forceMount:r,children:s.jsx(cr,{present:r||a.open,children:s.jsx(Io,{asChild:!0,container:o,children:n})})})};Ld.displayName=ga;var tn="PopoverContent",Md=S.forwardRef((e,t)=>{const r=n2(tn,e.__scopePopover),{forceMount:n=r.forceMount,...o}=e,a=gr(tn,e.__scopePopover);return s.jsx(cr,{present:n||a.open,children:a.modal?s.jsx(o2,{...o,ref:t}):s.jsx(a2,{...o,ref:t})})});Md.displayName=tn;var s2=Sn("PopoverContent.RemoveScroll"),o2=S.forwardRef((e,t)=>{const r=gr(tn,e.__scopePopover),n=S.useRef(null),o=Re(t,n),a=S.useRef(!1);return S.useEffect(()=>{const i=n.current;if(i)return uc(i)},[]),s.jsx(Uo,{as:s2,allowPinchZoom:!0,children:s.jsx(Dd,{...e,ref:o,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Be(e.onCloseAutoFocus,i=>{i.preventDefault(),a.current||r.triggerRef.current?.focus()}),onPointerDownOutside:Be(e.onPointerDownOutside,i=>{const l=i.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0,u=l.button===2||c;a.current=u},{checkForDefaultPrevented:!1}),onFocusOutside:Be(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1})})})}),a2=S.forwardRef((e,t)=>{const r=gr(tn,e.__scopePopover),n=S.useRef(!1),o=S.useRef(!1);return s.jsx(Dd,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{e.onCloseAutoFocus?.(a),a.defaultPrevented||(n.current||r.triggerRef.current?.focus(),a.preventDefault()),n.current=!1,o.current=!1},onInteractOutside:a=>{e.onInteractOutside?.(a),a.defaultPrevented||(n.current=!0,a.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const i=a.target;r.triggerRef.current?.contains(i)&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&o.current&&a.preventDefault()}})}),Dd=S.forwardRef((e,t)=>{const{__scopePopover:r,trapFocus:n,onOpenAutoFocus:o,onCloseAutoFocus:a,disableOutsidePointerEvents:i,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:u,onInteractOutside:f,...d}=e,g=gr(tn,r),h=On(r);return Xl(),s.jsx(_o,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:o,onUnmountAutoFocus:a,children:s.jsx(rs,{asChild:!0,disableOutsidePointerEvents:i,onInteractOutside:f,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:u,onDismiss:()=>g.onOpenChange(!1),children:s.jsx(Ad,{"data-state":Ud(g.open),role:"dialog",id:g.contentId,...h,...d,ref:t,style:{...d.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),Fd="PopoverClose",i2=S.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=gr(Fd,r);return s.jsx(He.button,{type:"button",...n,ref:t,onClick:Be(e.onClick,()=>o.onOpenChange(!1))})});i2.displayName=Fd;var l2="PopoverArrow",c2=S.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=On(r);return s.jsx(Td,{...o,...n,ref:t})});c2.displayName=l2;function Ud(e){return e?"open":"closed"}var d2=Pd,u2=Od,f2=Ld,g2=Md;const w2=d2,h2=u2,p2=w.forwardRef(({className:e,align:t="center",sideOffset:r=4,...n},o)=>s.jsx(f2,{children:s.jsx(g2,{ref:o,align:t,sideOffset:r,className:V("gw-PopoverContent gw-z-50 gw-w-72 gw-rounded-6xl gw-overflow-y-auto gw-bg-popover gw-p-6 gw-text-popover-foreground gw-shadow-buttonMd gw-outline-none data-[state=open]:gw-animate-in data-[state=closed]:gw-animate-out data-[state=closed]:gw-fade-out-0 data-[state=open]:gw-fade-in-0 data-[state=closed]:gw-zoom-out-95 data-[state=open]:gw-zoom-in-95 data-[side=bottom]:gw-slide-in-from-top-2 data-[side=left]:gw-slide-in-from-right-2 data-[side=right]:gw-slide-in-from-left-2 data-[side=top]:gw-slide-in-from-bottom-2",e),...n})}));function m2(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",t.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}const y2=e=>{switch(e){case"success":return C2;case"info":return E2;case"warning":return x2;case"error":return N2;default:return null}},b2=Array(12).fill(0),v2=({visible:e,className:t})=>w.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},w.createElement("div",{className:"sonner-spinner"},b2.map((r,n)=>w.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${n}`})))),C2=w.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},w.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),x2=w.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},w.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),E2=w.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},w.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),N2=w.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},w.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),S2=w.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},w.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),w.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),A2=()=>{const[e,t]=w.useState(document.hidden);return w.useEffect(()=>{const r=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",r),()=>window.removeEventListener("visibilitychange",r)},[]),e};let wa=1;class T2{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{const r=this.subscribers.indexOf(t);this.subscribers.splice(r,1)}),this.publish=t=>{this.subscribers.forEach(r=>r(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var r;const{message:n,...o}=t,a=typeof t?.id=="number"||((r=t.id)==null?void 0:r.length)>0?t.id:wa++,i=this.toasts.find(c=>c.id===a),l=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(a)&&this.dismissedToasts.delete(a),i?this.toasts=this.toasts.map(c=>c.id===a?(this.publish({...c,...t,id:a,title:n}),{...c,...t,id:a,dismissible:l,title:n}):c):this.addToast({title:n,...o,dismissible:l,id:a}),a},this.dismiss=t=>(t?(this.dismissedToasts.add(t),requestAnimationFrame(()=>this.subscribers.forEach(r=>r({id:t,dismiss:!0})))):this.toasts.forEach(r=>{this.subscribers.forEach(n=>n({id:r.id,dismiss:!0}))}),t),this.message=(t,r)=>this.create({...r,message:t}),this.error=(t,r)=>this.create({...r,message:t,type:"error"}),this.success=(t,r)=>this.create({...r,type:"success",message:t}),this.info=(t,r)=>this.create({...r,type:"info",message:t}),this.warning=(t,r)=>this.create({...r,type:"warning",message:t}),this.loading=(t,r)=>this.create({...r,type:"loading",message:t}),this.promise=(t,r)=>{if(!r)return;let n;r.loading!==void 0&&(n=this.create({...r,promise:t,type:"loading",message:r.loading,description:typeof r.description!="function"?r.description:void 0}));const o=Promise.resolve(t instanceof Function?t():t);let a=n!==void 0,i;const l=o.then(async u=>{if(i=["resolve",u],w.isValidElement(u))a=!1,this.create({id:n,type:"default",message:u});else if(P2(u)&&!u.ok){a=!1;const d=typeof r.error=="function"?await r.error(`HTTP error! status: ${u.status}`):r.error,g=typeof r.description=="function"?await r.description(`HTTP error! status: ${u.status}`):r.description,v=typeof d=="object"&&!w.isValidElement(d)?d:{message:d};this.create({id:n,type:"error",description:g,...v})}else if(u instanceof Error){a=!1;const d=typeof r.error=="function"?await r.error(u):r.error,g=typeof r.description=="function"?await r.description(u):r.description,v=typeof d=="object"&&!w.isValidElement(d)?d:{message:d};this.create({id:n,type:"error",description:g,...v})}else if(r.success!==void 0){a=!1;const d=typeof r.success=="function"?await r.success(u):r.success,g=typeof r.description=="function"?await r.description(u):r.description,v=typeof d=="object"&&!w.isValidElement(d)?d:{message:d};this.create({id:n,type:"success",description:g,...v})}}).catch(async u=>{if(i=["reject",u],r.error!==void 0){a=!1;const f=typeof r.error=="function"?await r.error(u):r.error,d=typeof r.description=="function"?await r.description(u):r.description,h=typeof f=="object"&&!w.isValidElement(f)?f:{message:f};this.create({id:n,type:"error",description:d,...h})}}).finally(()=>{a&&(this.dismiss(n),n=void 0),r.finally==null||r.finally.call(r)}),c=()=>new Promise((u,f)=>l.then(()=>i[0]==="reject"?f(i[1]):u(i[1])).catch(f));return typeof n!="string"&&typeof n!="number"?{unwrap:c}:Object.assign(n,{unwrap:c})},this.custom=(t,r)=>{const n=r?.id||wa++;return this.create({jsx:t(n),id:n,...r}),n},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const gt=new T2,k2=(e,t)=>{const r=t?.id||wa++;return gt.addToast({title:e,...t,id:r}),r},P2=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",_2=k2,I2=()=>gt.toasts,O2=()=>gt.getActiveToasts(),Gt=Object.assign(_2,{success:gt.success,info:gt.info,warning:gt.warning,error:gt.error,custom:gt.custom,message:gt.message,promise:gt.promise,dismiss:gt.dismiss,loading:gt.loading},{getHistory:I2,getToasts:O2});m2("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function Ts(e){return e.label!==void 0}const L2=3,M2="24px",D2="16px",Bd=4e3,F2=356,U2=14,B2=45,H2=200;function qt(...e){return e.filter(Boolean).join(" ")}function $2(e){const[t,r]=e.split("-"),n=[];return t&&n.push(t),r&&n.push(r),n}const V2=e=>{var t,r,n,o,a,i,l,c,u;const{invert:f,toast:d,unstyled:g,interacting:h,setHeights:v,visibleToasts:m,heights:b,index:p,toasts:x,expanded:C,removeToast:y,defaultRichColors:N,closeButton:P,style:T,cancelButtonStyle:D,actionButtonStyle:L,className:A="",descriptionClassName:O="",duration:F,position:E,gap:I,expandByDefault:_,classNames:M,icons:H,closeButtonAriaLabel:U="Close toast"}=e,[j,re]=w.useState(null),[oe,we]=w.useState(null),[J,G]=w.useState(!1),[z,ce]=w.useState(!1),[Y,K]=w.useState(!1),[xe,Ke]=w.useState(!1),[ze,ie]=w.useState(!1),[Oe,X]=w.useState(0),[wt,Xe]=w.useState(0),_e=w.useRef(d.duration||F||Bd),ne=w.useRef(null),de=w.useRef(null),Le=p===0,tt=p+1<=m,Me=d.type,q=d.dismissible!==!1,ae=d.className||"",Nt=d.descriptionClassName||"",Qe=w.useMemo(()=>b.findIndex(ee=>ee.toastId===d.id)||0,[b,d.id]),it=w.useMemo(()=>{var ee;return(ee=d.closeButton)!=null?ee:P},[d.closeButton,P]),We=w.useMemo(()=>d.duration||F||Bd,[d.duration,F]),ht=w.useRef(0),pt=w.useRef(0),St=w.useRef(0),Se=w.useRef(null),[Mt,Je]=E.split("-"),Or=w.useMemo(()=>b.reduce((ee,he,ke)=>ke>=Qe?ee:ee+he.height,0),[b,Qe]),Lr=A2(),Un=d.invert||f,pr=Me==="loading";pt.current=w.useMemo(()=>Qe*I+Or,[Qe,Or]),w.useEffect(()=>{_e.current=We},[We]),w.useEffect(()=>{G(!0)},[]),w.useEffect(()=>{const ee=de.current;if(ee){const he=ee.getBoundingClientRect().height;return Xe(he),v(ke=>[{toastId:d.id,height:he,position:d.position},...ke]),()=>v(ke=>ke.filter(Pe=>Pe.toastId!==d.id))}},[v,d.id]),w.useLayoutEffect(()=>{if(!J)return;const ee=de.current,he=ee.style.height;ee.style.height="auto";const ke=ee.getBoundingClientRect().height;ee.style.height=he,Xe(ke),v(Pe=>Pe.find(Ae=>Ae.toastId===d.id)?Pe.map(Ae=>Ae.toastId===d.id?{...Ae,height:ke}:Ae):[{toastId:d.id,height:ke,position:d.position},...Pe])},[J,d.title,d.description,v,d.id,d.jsx,d.action,d.cancel]);const R=w.useCallback(()=>{ce(!0),X(pt.current),v(ee=>ee.filter(he=>he.toastId!==d.id)),setTimeout(()=>{y(d)},H2)},[d,y,v,pt]);w.useEffect(()=>{if(d.promise&&Me==="loading"||d.duration===1/0||d.type==="loading")return;let ee;return C||h||Lr?(()=>{if(St.current<ht.current){const Pe=new Date().getTime()-ht.current;_e.current=_e.current-Pe}St.current=new Date().getTime()})():_e.current!==1/0&&(ht.current=new Date().getTime(),ee=setTimeout(()=>{d.onAutoClose==null||d.onAutoClose.call(d,d),R()},_e.current)),()=>clearTimeout(ee)},[C,h,d,Me,Lr,R]),w.useEffect(()=>{d.delete&&(R(),d.onDismiss==null||d.onDismiss.call(d,d))},[R,d.delete]);function B(){var ee;if(H?.loading){var he;return w.createElement("div",{className:qt(M?.loader,d==null||(he=d.classNames)==null?void 0:he.loader,"sonner-loader"),"data-visible":Me==="loading"},H.loading)}return w.createElement(v2,{className:qt(M?.loader,d==null||(ee=d.classNames)==null?void 0:ee.loader),visible:Me==="loading"})}const Q=d.icon||H?.[Me]||y2(Me);var se,ye;return w.createElement("li",{tabIndex:0,ref:de,className:qt(A,ae,M?.toast,d==null||(t=d.classNames)==null?void 0:t.toast,M?.default,M?.[Me],d==null||(r=d.classNames)==null?void 0:r[Me]),"data-sonner-toast":"","data-rich-colors":(se=d.richColors)!=null?se:N,"data-styled":!(d.jsx||d.unstyled||g),"data-mounted":J,"data-promise":!!d.promise,"data-swiped":ze,"data-removed":z,"data-visible":tt,"data-y-position":Mt,"data-x-position":Je,"data-index":p,"data-front":Le,"data-swiping":Y,"data-dismissible":q,"data-type":Me,"data-invert":Un,"data-swipe-out":xe,"data-swipe-direction":oe,"data-expanded":!!(C||_&&J),"data-testid":d.testId,style:{"--index":p,"--toasts-before":p,"--z-index":x.length-p,"--offset":`${z?Oe:pt.current}px`,"--initial-height":_?"auto":`${wt}px`,...T,...d.style},onDragEnd:()=>{K(!1),re(null),Se.current=null},onPointerDown:ee=>{ee.button!==2&&(pr||!q||(ne.current=new Date,X(pt.current),ee.target.setPointerCapture(ee.pointerId),ee.target.tagName!=="BUTTON"&&(K(!0),Se.current={x:ee.clientX,y:ee.clientY})))},onPointerUp:()=>{var ee,he,ke;if(xe||!q)return;Se.current=null;const Pe=Number(((ee=de.current)==null?void 0:ee.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Tt=Number(((he=de.current)==null?void 0:he.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Ae=new Date().getTime()-((ke=ne.current)==null?void 0:ke.getTime()),De=j==="x"?Pe:Tt,nr=Math.abs(De)/Ae;if(Math.abs(De)>=B2||nr>.11){X(pt.current),d.onDismiss==null||d.onDismiss.call(d,d),we(j==="x"?Pe>0?"right":"left":Tt>0?"down":"up"),R(),Ke(!0);return}else{var mt,Dt;(mt=de.current)==null||mt.style.setProperty("--swipe-amount-x","0px"),(Dt=de.current)==null||Dt.style.setProperty("--swipe-amount-y","0px")}ie(!1),K(!1),re(null)},onPointerMove:ee=>{var he,ke,Pe;if(!Se.current||!q||((he=window.getSelection())==null?void 0:he.toString().length)>0)return;const Ae=ee.clientY-Se.current.y,De=ee.clientX-Se.current.x;var nr;const mt=(nr=e.swipeDirections)!=null?nr:$2(E);!j&&(Math.abs(De)>1||Math.abs(Ae)>1)&&re(Math.abs(De)>Math.abs(Ae)?"x":"y");let Dt={x:0,y:0};const ff=Mr=>1/(1.5+Math.abs(Mr)/20);if(j==="y"){if(mt.includes("top")||mt.includes("bottom"))if(mt.includes("top")&&Ae<0||mt.includes("bottom")&&Ae>0)Dt.y=Ae;else{const Mr=Ae*ff(Ae);Dt.y=Math.abs(Mr)<Math.abs(Ae)?Mr:Ae}}else if(j==="x"&&(mt.includes("left")||mt.includes("right")))if(mt.includes("left")&&De<0||mt.includes("right")&&De>0)Dt.x=De;else{const Mr=De*ff(De);Dt.x=Math.abs(Mr)<Math.abs(De)?Mr:De}(Math.abs(Dt.x)>0||Math.abs(Dt.y)>0)&&ie(!0),(ke=de.current)==null||ke.style.setProperty("--swipe-amount-x",`${Dt.x}px`),(Pe=de.current)==null||Pe.style.setProperty("--swipe-amount-y",`${Dt.y}px`)}},it&&!d.jsx&&Me!=="loading"?w.createElement("button",{"aria-label":U,"data-disabled":pr,"data-close-button":!0,onClick:pr||!q?()=>{}:()=>{R(),d.onDismiss==null||d.onDismiss.call(d,d)},className:qt(M?.closeButton,d==null||(n=d.classNames)==null?void 0:n.closeButton)},(ye=H?.close)!=null?ye:S2):null,(Me||d.icon||d.promise)&&d.icon!==null&&(H?.[Me]!==null||d.icon)?w.createElement("div",{"data-icon":"",className:qt(M?.icon,d==null||(o=d.classNames)==null?void 0:o.icon)},d.promise||d.type==="loading"&&!d.icon?d.icon||B():null,d.type!=="loading"?Q:null):null,w.createElement("div",{"data-content":"",className:qt(M?.content,d==null||(a=d.classNames)==null?void 0:a.content)},w.createElement("div",{"data-title":"",className:qt(M?.title,d==null||(i=d.classNames)==null?void 0:i.title)},d.jsx?d.jsx:typeof d.title=="function"?d.title():d.title),d.description?w.createElement("div",{"data-description":"",className:qt(O,Nt,M?.description,d==null||(l=d.classNames)==null?void 0:l.description)},typeof d.description=="function"?d.description():d.description):null),w.isValidElement(d.cancel)?d.cancel:d.cancel&&Ts(d.cancel)?w.createElement("button",{"data-button":!0,"data-cancel":!0,style:d.cancelButtonStyle||D,onClick:ee=>{Ts(d.cancel)&&q&&(d.cancel.onClick==null||d.cancel.onClick.call(d.cancel,ee),R())},className:qt(M?.cancelButton,d==null||(c=d.classNames)==null?void 0:c.cancelButton)},d.cancel.label):null,w.isValidElement(d.action)?d.action:d.action&&Ts(d.action)?w.createElement("button",{"data-button":!0,"data-action":!0,style:d.actionButtonStyle||L,onClick:ee=>{Ts(d.action)&&(d.action.onClick==null||d.action.onClick.call(d.action,ee),!ee.defaultPrevented&&R())},className:qt(M?.actionButton,d==null||(u=d.classNames)==null?void 0:u.actionButton)},d.action.label):null)};function Hd(){if(typeof window>"u"||typeof document>"u")return"ltr";const e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function z2(e,t){const r={};return[e,t].forEach((n,o)=>{const a=o===1,i=a?"--mobile-offset":"--offset",l=a?D2:M2;function c(u){["top","right","bottom","left"].forEach(f=>{r[`${i}-${f}`]=typeof u=="number"?`${u}px`:u})}typeof n=="number"||typeof n=="string"?c(n):typeof n=="object"?["top","right","bottom","left"].forEach(u=>{n[u]===void 0?r[`${i}-${u}`]=l:r[`${i}-${u}`]=typeof n[u]=="number"?`${n[u]}px`:n[u]}):c(l)}),r}const W2=w.forwardRef(function(t,r){const{id:n,invert:o,position:a="bottom-right",hotkey:i=["altKey","KeyT"],expand:l,closeButton:c,className:u,offset:f,mobileOffset:d,theme:g="light",richColors:h,duration:v,style:m,visibleToasts:b=L2,toastOptions:p,dir:x=Hd(),gap:C=U2,icons:y,containerAriaLabel:N="Notifications"}=t,[P,T]=w.useState([]),D=w.useMemo(()=>n?P.filter(J=>J.toasterId===n):P.filter(J=>!J.toasterId),[P,n]),L=w.useMemo(()=>Array.from(new Set([a].concat(D.filter(J=>J.position).map(J=>J.position)))),[D,a]),[A,O]=w.useState([]),[F,E]=w.useState(!1),[I,_]=w.useState(!1),[M,H]=w.useState(g!=="system"?g:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),U=w.useRef(null),j=i.join("+").replace(/Key/g,"").replace(/Digit/g,""),re=w.useRef(null),oe=w.useRef(!1),we=w.useCallback(J=>{T(G=>{var z;return(z=G.find(ce=>ce.id===J.id))!=null&&z.delete||gt.dismiss(J.id),G.filter(({id:ce})=>ce!==J.id)})},[]);return w.useEffect(()=>gt.subscribe(J=>{if(J.dismiss){requestAnimationFrame(()=>{T(G=>G.map(z=>z.id===J.id?{...z,delete:!0}:z))});return}setTimeout(()=>{Gs.flushSync(()=>{T(G=>{const z=G.findIndex(ce=>ce.id===J.id);return z!==-1?[...G.slice(0,z),{...G[z],...J},...G.slice(z+1)]:[J,...G]})})})}),[P]),w.useEffect(()=>{if(g!=="system"){H(g);return}if(g==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?H("dark"):H("light")),typeof window>"u")return;const J=window.matchMedia("(prefers-color-scheme: dark)");try{J.addEventListener("change",({matches:G})=>{H(G?"dark":"light")})}catch{J.addListener(({matches:z})=>{try{H(z?"dark":"light")}catch(ce){console.error(ce)}})}},[g]),w.useEffect(()=>{P.length<=1&&E(!1)},[P]),w.useEffect(()=>{const J=G=>{var z;if(i.every(K=>G[K]||G.code===K)){var Y;E(!0),(Y=U.current)==null||Y.focus()}G.code==="Escape"&&(document.activeElement===U.current||(z=U.current)!=null&&z.contains(document.activeElement))&&E(!1)};return document.addEventListener("keydown",J),()=>document.removeEventListener("keydown",J)},[i]),w.useEffect(()=>{if(U.current)return()=>{re.current&&(re.current.focus({preventScroll:!0}),re.current=null,oe.current=!1)}},[U.current]),w.createElement("section",{ref:r,"aria-label":`${N} ${j}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},L.map((J,G)=>{var z;const[ce,Y]=J.split("-");return D.length?w.createElement("ol",{key:J,dir:x==="auto"?Hd():x,tabIndex:-1,ref:U,className:u,"data-sonner-toaster":!0,"data-sonner-theme":M,"data-y-position":ce,"data-x-position":Y,style:{"--front-toast-height":`${((z=A[0])==null?void 0:z.height)||0}px`,"--width":`${F2}px`,"--gap":`${C}px`,...m,...z2(f,d)},onBlur:K=>{oe.current&&!K.currentTarget.contains(K.relatedTarget)&&(oe.current=!1,re.current&&(re.current.focus({preventScroll:!0}),re.current=null))},onFocus:K=>{K.target instanceof HTMLElement&&K.target.dataset.dismissible==="false"||oe.current||(oe.current=!0,re.current=K.relatedTarget)},onMouseEnter:()=>E(!0),onMouseMove:()=>E(!0),onMouseLeave:()=>{I||E(!1)},onDragEnd:()=>E(!1),onPointerDown:K=>{K.target instanceof HTMLElement&&K.target.dataset.dismissible==="false"||_(!0)},onPointerUp:()=>_(!1)},D.filter(K=>!K.position&&G===0||K.position===J).map((K,xe)=>{var Ke,ze;return w.createElement(V2,{key:K.id,icons:y,index:xe,toast:K,defaultRichColors:h,duration:(Ke=p?.duration)!=null?Ke:v,className:p?.className,descriptionClassName:p?.descriptionClassName,invert:o,visibleToasts:b,closeButton:(ze=p?.closeButton)!=null?ze:c,interacting:I,position:J,style:p?.style,unstyled:p?.unstyled,classNames:p?.classNames,cancelButtonStyle:p?.cancelButtonStyle,actionButtonStyle:p?.actionButtonStyle,closeButtonAriaLabel:p?.closeButtonAriaLabel,removeToast:we,toasts:D.filter(ie=>ie.position==K.position),heights:A.filter(ie=>ie.position==K.position),setHeights:O,expandByDefault:l,gap:C,expanded:F,swipeDirections:t.swipeDirections})})):null}))}),$d=({...e})=>s.jsx(W2,{closeButton:!0,theme:e.theme,richColors:!0,position:"bottom-center",className:"gw-toaster group",offset:8,toastOptions:{classNames:{toast:"gw-toast group-[.gw-toaster]:gw-bg-background group-[.gw-toaster]:gw-text-foreground group-[.gw-toaster]:gw-border-border !gw-rounded-2xl group-[.gw-toaster]:gw-shadow-lg",description:"group-[.gw-toast]:gw-text-muted-foreground",actionButton:"group-[.gw-toast]:gw-bg-primary group-[.gw-toast]:gw-text-primary-foreground",cancelButton:"group-[.gw-toast]:gw-bg-muted group-[.gw-toast]:gw-text-muted-foreground"}},...e});class Vd extends Error{constructor(){super("Widget content could not be loaded")}}class ha extends w.Component{constructor(t){super(t),this.state={failed:!1,content:w.lazy(()=>t.loader().catch(()=>{throw new Vd}))}}static getDerivedStateFromError(t){if(!(t instanceof Vd))throw t;return{failed:!0}}render(){return this.state.failed?s.jsxs("div",{className:"gw-p-4 gw-text-center gw-text-sm",role:"alert",children:[s.jsx("p",{children:"Glyph could not load this content. Reload the page to try again."}),s.jsx("p",{children:"Reloading may clear unsaved input."}),s.jsx("button",{type:"button",className:"gw-mt-2 gw-min-h-[44px] gw-px-4 gw-underline",onClick:()=>window.location.reload(),children:"Reload page"})]}):s.jsx(w.Suspense,{fallback:null,children:w.createElement(this.state.content,this.props.componentProps)})}}const j2=()=>Promise.resolve().then(()=>n3).then(({Wallet:e})=>({default:e})),pa=w.memo(({setGradientType:e})=>s.jsx(ha,{loader:j2,componentProps:{setGradientType:e}})),zd=()=>Promise.resolve().then(()=>o3).then(({WidgetGradient:e})=>({default:e})),G2=({buttonProps:e,minWidth:t=768,alwaysOpen:r=!1})=>{const n="light",o=vf(`(min-width: ${t}px)`),a=w.useContext(Bn);if(!a)throw new Error("GlyphWidget must be used within a GlyphViewProvider");const{glyphView:i,setGlyphView:l}=a,{ready:c,authenticated:u,user:f,hideWidget:d}=me();w.useEffect(()=>{r?l(ve.OPEN):(!c||!u)&&l(ve.CLOSED)},[c,u,l]);const[g,h]=w.useState();return d?s.jsx("div",{}):s.jsx("div",{className:"glyph-widget gw-widget-container light",children:c&&u&&f?s.jsx(s.Fragment,{children:o?s.jsxs(w2,{open:r?!0:i!==ve.CLOSED,onOpenChange:r?()=>l(ve.OPEN):v=>l(v?ve.OPEN:ve.CLOSED),children:[s.jsx(h2,{children:r?null:s.jsx(_l,{...e||{}})}),s.jsxs(p2,{sideOffset:10,align:"end",className:"glyph-widget gw-wallet-container",children:[s.jsx($d,{theme:n}),s.jsx(ha,{loader:zd,componentProps:{gradientType:g??bt.PRIMARY}})," ",s.jsx(pa,{setGradientType:h})]})]}):s.jsxs(Th,{open:r?!0:i!==ve.CLOSED,onOpenChange:r?()=>l(ve.OPEN):v=>l(v?ve.OPEN:ve.CLOSED),children:[s.jsx(kh,{children:r?null:s.jsx(_l,{...e||{}})}),s.jsxs(Oh,{className:"glyph-widget",children:[s.jsx(ha,{loader:zd,componentProps:{gradientType:g??bt.PRIMARY}})," ",s.jsx(_h,{}),s.jsx(Lh,{className:"gw-sr-only",children:"Glyph Wallet"}),s.jsx(Mh,{className:"gw-sr-only",children:"Glyph Widget to access all the things in one place related to your account!"}),s.jsx($d,{theme:n}),s.jsx("div",{className:"gw-wallet-container gw-w-full",style:{maxHeight:"80dvh"},children:s.jsx(pa,{setGradientType:h})})]})]})}):s.jsx(Ao,{})})},q2=()=>{const{logout:e}=me();return s.jsx(ue,{className:"gw-w-full",variant:"outline",onClick:e,children:"Logout"})},Z2=()=>{const{glyphUrl:e}=me(),t=new URL("/",e).toString();return e?s.jsx(ue,{variant:"outline",size:"login",onClick:()=>{window.open(t,"_blank")},className:"gw-w-52 !gw-justify-start",children:s.jsxs("span",{className:"gw-flex gw-items-center gw-gap-1 gw-w-full",children:[s.jsx("span",{className:"gw-p-2 gw-rounded-full",children:s.jsx(yr,{className:"!gw-size-5"})}),s.jsx("span",{className:"gw-flex-1 gw-text-center",children:"Visit Glyph Portal"})]})}):s.jsx(ue,{variant:"outline",size:"login",disabled:!0,children:s.jsxs("span",{className:"gw-inline-flex gw-items-center gw-w-full gw-gap-1",children:[s.jsx("span",{className:"gw-p-2 gw-rounded-full",children:s.jsx(yr,{className:"!gw-size-5"})}),s.jsx(Nr,{className:"gw-size-4 gw-animate-spin"})]})})};var Y2=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),K2="VisuallyHidden",Wd=S.forwardRef((e,t)=>s.jsx(He.span,{...e,ref:t,style:{...Y2,...e.style}}));Wd.displayName=K2;var X2=Wd,[ks]=Sr("Tooltip",[Ss]),Ps=Ss(),jd="TooltipProvider",Q2=700,ma="tooltip.open",[J2,ya]=ks(jd),Gd=e=>{const{__scopeTooltip:t,delayDuration:r=Q2,skipDelayDuration:n=300,disableHoverableContent:o=!1,children:a}=e,i=S.useRef(!0),l=S.useRef(!1),c=S.useRef(0);return S.useEffect(()=>{const u=c.current;return()=>window.clearTimeout(u)},[]),s.jsx(J2,{scope:t,isOpenDelayedRef:i,delayDuration:r,onOpen:S.useCallback(()=>{window.clearTimeout(c.current),i.current=!1},[]),onClose:S.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>i.current=!0,n)},[n]),isPointerInTransitRef:l,onPointerInTransitChange:S.useCallback(u=>{l.current=u},[]),disableHoverableContent:o,children:a})};Gd.displayName=jd;var Ln="Tooltip",[R2,_s]=ks(Ln),qd=e=>{const{__scopeTooltip:t,children:r,open:n,defaultOpen:o,onOpenChange:a,disableHoverableContent:i,delayDuration:l}=e,c=ya(Ln,e.__scopeTooltip),u=Ps(t),[f,d]=S.useState(null),g=Ar(),h=S.useRef(0),v=i??c.disableHoverableContent,m=l??c.delayDuration,b=S.useRef(!1),[p,x]=Gr({prop:n,defaultProp:o??!1,onChange:T=>{T?(c.onOpen(),document.dispatchEvent(new CustomEvent(ma))):c.onClose(),a?.(T)},caller:Ln}),C=S.useMemo(()=>p?b.current?"delayed-open":"instant-open":"closed",[p]),y=S.useCallback(()=>{window.clearTimeout(h.current),h.current=0,b.current=!1,x(!0)},[x]),N=S.useCallback(()=>{window.clearTimeout(h.current),h.current=0,x(!1)},[x]),P=S.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>{b.current=!0,x(!0),h.current=0},m)},[m,x]);return S.useEffect(()=>()=>{h.current&&(window.clearTimeout(h.current),h.current=0)},[]),s.jsx(Sd,{...u,children:s.jsx(R2,{scope:t,contentId:g,open:p,stateAttribute:C,trigger:f,onTriggerChange:d,onTriggerEnter:S.useCallback(()=>{c.isOpenDelayedRef.current?P():y()},[c.isOpenDelayedRef,P,y]),onTriggerLeave:S.useCallback(()=>{v?N():(window.clearTimeout(h.current),h.current=0)},[N,v]),onOpen:y,onClose:N,disableHoverableContent:v,children:r})})};qd.displayName=Ln;var ba="TooltipTrigger",Zd=S.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,o=_s(ba,r),a=ya(ba,r),i=Ps(r),l=S.useRef(null),c=Re(t,l,o.onTriggerChange),u=S.useRef(!1),f=S.useRef(!1),d=S.useCallback(()=>u.current=!1,[]);return S.useEffect(()=>()=>document.removeEventListener("pointerup",d),[d]),s.jsx(fa,{asChild:!0,...i,children:s.jsx(He.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...n,ref:c,onPointerMove:Be(e.onPointerMove,g=>{g.pointerType!=="touch"&&!f.current&&!a.isPointerInTransitRef.current&&(o.onTriggerEnter(),f.current=!0)}),onPointerLeave:Be(e.onPointerLeave,()=>{o.onTriggerLeave(),f.current=!1}),onPointerDown:Be(e.onPointerDown,()=>{o.open&&o.onClose(),u.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:Be(e.onFocus,()=>{u.current||o.onOpen()}),onBlur:Be(e.onBlur,o.onClose),onClick:Be(e.onClick,o.onClose)})})});Zd.displayName=ba;var e6="TooltipPortal",[e7,t6]=ks(e6,{forceMount:void 0}),rn="TooltipContent",Yd=S.forwardRef((e,t)=>{const r=t6(rn,e.__scopeTooltip),{forceMount:n=r.forceMount,side:o="top",...a}=e,i=_s(rn,e.__scopeTooltip);return s.jsx(cr,{present:n||i.open,children:i.disableHoverableContent?s.jsx(Kd,{side:o,...a,ref:t}):s.jsx(r6,{side:o,...a,ref:t})})}),r6=S.forwardRef((e,t)=>{const r=_s(rn,e.__scopeTooltip),n=ya(rn,e.__scopeTooltip),o=S.useRef(null),a=Re(t,o),[i,l]=S.useState(null),{trigger:c,onClose:u}=r,f=o.current,{onPointerInTransitChange:d}=n,g=S.useCallback(()=>{l(null),d(!1)},[d]),h=S.useCallback((v,m)=>{const b=v.currentTarget,p={x:v.clientX,y:v.clientY},x=i6(p,b.getBoundingClientRect()),C=l6(p,x),y=c6(m.getBoundingClientRect()),N=u6([...C,...y]);l(N),d(!0)},[d]);return S.useEffect(()=>()=>g(),[g]),S.useEffect(()=>{if(c&&f){const v=b=>h(b,f),m=b=>h(b,c);return c.addEventListener("pointerleave",v),f.addEventListener("pointerleave",m),()=>{c.removeEventListener("pointerleave",v),f.removeEventListener("pointerleave",m)}}},[c,f,h,g]),S.useEffect(()=>{if(i){const v=m=>{const b=m.target,p={x:m.clientX,y:m.clientY},x=c?.contains(b)||f?.contains(b),C=!d6(p,i);x?g():C&&(g(),u())};return document.addEventListener("pointermove",v),()=>document.removeEventListener("pointermove",v)}},[c,f,i,u,g]),s.jsx(Kd,{...e,ref:a})}),[n6,s6]=ks(Ln,{isInside:!1}),o6=M0("TooltipContent"),Kd=S.forwardRef((e,t)=>{const{__scopeTooltip:r,children:n,"aria-label":o,onEscapeKeyDown:a,onPointerDownOutside:i,...l}=e,c=_s(rn,r),u=Ps(r),{onClose:f}=c;return S.useEffect(()=>(document.addEventListener(ma,f),()=>document.removeEventListener(ma,f)),[f]),S.useEffect(()=>{if(c.trigger){const d=g=>{g.target?.contains(c.trigger)&&f()};return window.addEventListener("scroll",d,{capture:!0}),()=>window.removeEventListener("scroll",d,{capture:!0})}},[c.trigger,f]),s.jsx(rs,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:i,onFocusOutside:d=>d.preventDefault(),onDismiss:f,children:s.jsxs(Ad,{"data-state":c.stateAttribute,...u,...l,ref:t,style:{...l.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[s.jsx(o6,{children:n}),s.jsx(n6,{scope:r,isInside:!0,children:s.jsx(X2,{id:c.contentId,role:"tooltip",children:o||n})})]})})});Yd.displayName=rn;var Xd="TooltipArrow",a6=S.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,o=Ps(r);return s6(Xd,r).isInside?null:s.jsx(Td,{...o,...n,ref:t})});a6.displayName=Xd;function i6(e,t){const r=Math.abs(t.top-e.y),n=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(r,n,o,a)){case a:return"left";case o:return"right";case r:return"top";case n:return"bottom";default:throw new Error("unreachable")}}function l6(e,t,r=5){const n=[];switch(t){case"top":n.push({x:e.x-r,y:e.y+r},{x:e.x+r,y:e.y+r});break;case"bottom":n.push({x:e.x-r,y:e.y-r},{x:e.x+r,y:e.y-r});break;case"left":n.push({x:e.x+r,y:e.y-r},{x:e.x+r,y:e.y+r});break;case"right":n.push({x:e.x-r,y:e.y-r},{x:e.x-r,y:e.y+r});break}return n}function c6(e){const{top:t,right:r,bottom:n,left:o}=e;return[{x:o,y:t},{x:r,y:t},{x:r,y:n},{x:o,y:n}]}function d6(e,t){const{x:r,y:n}=e;let o=!1;for(let a=0,i=t.length-1;a<t.length;i=a++){const l=t[a],c=t[i],u=l.x,f=l.y,d=c.x,g=c.y;f>n!=g>n&&r<(d-u)*(n-f)/(g-f)+u&&(o=!o)}return o}function u6(e){const t=e.slice();return t.sort((r,n)=>r.x<n.x?-1:r.x>n.x?1:r.y<n.y?-1:r.y>n.y?1:0),f6(t)}function f6(e){if(e.length<=1)return e.slice();const t=[];for(let n=0;n<e.length;n++){const o=e[n];for(;t.length>=2;){const a=t[t.length-1],i=t[t.length-2];if((a.x-i.x)*(o.y-i.y)>=(a.y-i.y)*(o.x-i.x))t.pop();else break}t.push(o)}t.pop();const r=[];for(let n=e.length-1;n>=0;n--){const o=e[n];for(;r.length>=2;){const a=r[r.length-1],i=r[r.length-2];if((a.x-i.x)*(o.y-i.y)>=(a.y-i.y)*(o.x-i.x))r.pop();else break}r.push(o)}return r.pop(),t.length===1&&r.length===1&&t[0].x===r[0].x&&t[0].y===r[0].y?t:t.concat(r)}var g6=Gd,w6=qd,h6=Zd,p6=Yd;const m6=g6,y6=w6,b6=h6,v6=w.forwardRef(({className:e,sideOffset:t=4,...r},n)=>s.jsx(p6,{ref:n,sideOffset:t,className:V("gw-z-50 gw-overflow-hidden gw-typography-caption gw-rounded-lg gw-bg-popover gw-px-3 gw-py-1.5 gw-text-popover-foreground gw-shadow-inputFocus gw-animate-in gw-fade-in-0 gw-zoom-in-95 data-[state=closed]:gw-animate-out data-[state=closed]:gw-fade-out-0 data-[state=closed]:gw-zoom-out-95 data-[side=bottom]:gw-slide-in-from-top-2 data-[side=left]:gw-slide-in-from-right-2 data-[side=right]:gw-slide-in-from-left-2 data-[side=top]:gw-slide-in-from-bottom-2",e),...r}));function wr(){const e=w.useContext(Dr);if(!e)throw new Error("glyph hooks must be used within GlyphProvider");return{glyphApiFetch:e.apiFetch}}const Qd=w.createContext(void 0),Mn=()=>{const e=w.useContext(Qd);if(!e)throw new Error("useGlyphSwap must be used within GlyphSwapProvider");return e};function C6({children:e}){const{glyphApiFetch:t}=wr(),[r,n]=w.useState({fromCurrency:void 0,toCurrency:void 0,tradeType:"EXACT_INPUT",amount:"",topupGas:!1,topupGasAmount:"2000000"}),o=w.useCallback(i=>{n(l=>({...l,...i}))},[]),a=w.useCallback(async i=>{t&&await t(`/api/widget/swap/quote/${i}/failed`,{method:"PATCH"})},[t]);return s.jsx(Qd.Provider,{value:{...r,update:o,reportSwapFailed:a},children:e})}const Jd=64*1024*1024,nn=e=>typeof e=="object"&&e!==null&&!Array.isArray(e);class Rd extends Error{constructor(){super("Invalid Glyph balances response"),this.name="GlyphBalancesDecodeError"}}function eu(e){const t=()=>new Rd;if(!nn(e))throw t();if(Array.isArray(e.nfts))return e;const r=e.nfts;if(!nn(r)||r.format!=="nft-images-v1"||!Array.isArray(r.collections)||!Array.isArray(r.images)||!Array.from(r.images).every(g=>typeof g=="string")||!Array.isArray(r.references)||r.images.length>r.references.length)throw t();const n=r.collections;if(!n.every(g=>nn(g)&&Array.isArray(g.items)&&g.items.every(nn)))throw t();const o=n,a=r.images,i=g=>new TextEncoder().encode(g).byteLength,l=a.map(g=>i(JSON.stringify(g)));let c=i(JSON.stringify(o));if(c>Jd)throw t();const u=[],f=new Set;for(const g of r.references){if(!Array.isArray(g)||g.length!==4||!Array.from(g).every(Number.isSafeInteger))throw t();const[h,v,m,b]=g,p=o[h];if(h<0||!p||v<-1||m!==0&&m!==1||b<0||b>=a.length||v>=0&&(!p.items[v]||m===1&&!nn(p.items[v].image)))throw t();const x=v===-1?p[m===0?"image":"contractImage"]:m===0?p.items[v].tokenImage:p.items[v].image.cachedUrl,C=`${h}:${v}:${m}`;if(x!==""||f.has(C)||(f.add(C),c+=l[b]-2,c>Jd))throw t();u.push(g)}const d=o.map(g=>({...g,items:g.items.map(h=>({...h,...nn(h.image)?{image:{...h.image}}:{}}))}));for(const[g,h,v,m]of u){const b=d[g];h===-1?b[v===0?"image":"contractImage"]=a[m]:v===0?b.items[h].tokenImage=a[m]:b.items[h].image.cachedUrl=a[m]}return{...e,nfts:d}}class tu extends Error{constructor(t){super(`Glyph data request failed (HTTP ${t})`),this.status=t,this.name="GlyphDataRequestError"}status}async function Is(e,t,r,n,o,a){const i=()=>{if(!e||r.aborted||!n())throw new DOMException("Glyph data session changed","AbortError")};i();const l=await e(t,{signal:r});if(i(),!l.ok)throw new tu(l.status);const c=await l.json();i();const u=a?a(c):c;return i(),{scope:o,value:u}}function va(e,t,r){return e.name==="AbortError"||e instanceof Rd||e instanceof tu&&e.status>=400&&e.status<500?!1:t<r}const x6=zr("GlyphData"),E6=({children:e})=>{const t=w.useContext(Dr);if(!t)throw new Error("GlyphUserDataProvider must be used within GlyphProvider");const{ready:r,authenticated:n,apiFetch:o,glyphUrl:a}=t,i=lt.useQueryClient(),l=ge.useChainId(),[c,u]=w.useState(!1),f=c?"all":l,d=w.useMemo(()=>({key:crypto.randomUUID(),apiFetch:r&&n?o:null,glyphUrl:a,active:!0}),[r,n,o,a]),g=w.useRef(d);g.current=d;const h=w.useCallback(()=>g.current===d&&d.active&&!!d.apiFetch,[d]);w.useEffect(()=>(d.active=!0,()=>{d.active=!1,i.cancelQueries({predicate:A=>A.queryKey[1]===d.key})}),[d,i]);const v=lt.useQuery({queryKey:["glyphWidgetUser",d.key],queryFn:({signal:A})=>Is(d.apiFetch,"/api/widget/user",A,h,d.key),enabled:h(),gcTime:0,placeholderData:()=>{},refetchInterval:yf,retry:(A,O)=>h()&&va(O,A,5),retryDelay:A=>Math.min(1e3*2**A,3e4)}),m=h()&&!v.isError&&v.data?.scope===d.key?v.data.value:null,b=m?.evmWallet,p=w.useMemo(()=>({key:crypto.randomUUID(),session:d,chain:f,evmWallet:b,active:!0}),[d,f,b]),x=w.useRef(p);x.current=p;const C=w.useCallback(()=>h()&&x.current===p&&p.active&&typeof p.evmWallet=="string"&&$.isAddress(p.evmWallet,{strict:!1}),[p,h]);w.useEffect(()=>(p.active=!0,()=>{p.active=!1,i.cancelQueries({queryKey:["glyphWidgetBalances",d.key,p.key],exact:!0})}),[p,d,i]);const y=lt.useQuery({queryKey:["glyphWidgetBalances",d.key,p.key],queryFn:({signal:A})=>Is(d.apiFetch,`/api/widget/balances?chainId=${p.chain}&nftImageEncoding=references-v1`,A,C,p.key,eu),enabled:C(),gcTime:0,placeholderData:()=>{},refetchInterval:ni,retry:(A,O)=>C()&&va(O,A,3),retryDelay:A=>Math.min(1e3*2**A,3e4)}),N=C()&&!y.isError&&y.data?.scope===p.key?y.data.value:null,{refetch:P}=v,{refetch:T}=y,D=w.useCallback(async(A=!1)=>{h()&&await P({throwOnError:!1,cancelRefetch:A})},[h,P]),L=w.useCallback(async(A=!1,O)=>{if(!C())return;const F=await T({throwOnError:!1,cancelRefetch:A});if(!C()||F.isError||F.data?.scope!==p.key||!O)return;const E=F.data.value;if(!ge.deepEqual(N,E))for(const[I,_]of Object.entries(O)){if(!C())return;const M=E.tokens?.find(U=>`${U.chainId}:${U.address}`===I)?.value||"0",H=N?.tokens?.find(U=>`${U.chainId}:${U.address}`===I)?.value||"0";M!==H&&_(Number(M)-Number(H))}},[C,T,p,N]);return w.useEffect(()=>{h()&&v.error&&x6.error("Failed to load/refresh user data")},[h,v.error]),w.useEffect(()=>{C()&&y.error&&Gt.error("Failed to fetch balances")},[C,y.error]),s.jsx(Hn.Provider,{value:{user:m,balances:N,hasBalances:!!N,isBalancesLoading:C()&&y.isFetching,refreshUser:D,refreshBalances:L,setFetchForAllNetworks:u,fetchForAllNetworks:c},children:e})},ru=pe.MAIN,nu=be.HOME,su=zr("GlyphViewProvider"),N6=({children:e})=>{const t=w.useContext(Hn);if(!t)throw new Error("GlyphViewProvider must be used within GlyphProvider");const{user:r}=t,[n,o]=w.useState(ru),[a,i]=w.useState(nu),[l,c]=w.useState(ve.CLOSED);return w.useEffect(()=>{switch(l){case ve.CLOSED:break;case ve.OPEN:o(ru),i(nu);break;case ve.FUND:o(pe.FUND);break;case ve.SWAP:o(pe.SWAP);break;case ve.SEND:o(pe.SEND);break;case ve.RECEIVE:o(pe.RECEIVE);break;case ve.PROFILE:r?.hasProfile?o(pe.PROFILE):(su.warn("Cannot open Profile view for a non-Glyph user - directing to Home view"),c(ve.OPEN));break;case ve.MAIN:o(pe.MAIN),i(ve.HOME);break;case ve.LINKED_ACCOUNTS:r?.hasProfile?(o(pe.MAIN),i(ve.LINKED_ACCOUNTS)):(su.warn("Cannot open Linked Accounts view for a non-Glyph user - directing to Home view"),c(ve.OPEN));break;case ve.HOME:case ve.ACTIVITY:case ve.TOKENS:case ve.NFTS:o(pe.MAIN),i(l);break}},[l,r?.hasProfile]),s.jsx(Bn.Provider,{value:{glyphView:l,setGlyphView:c,walletView:n,setWalletView:o,walletMainViewTab:a,setWalletMainViewTab:i},children:e})},S6=w.lazy(()=>Promise.resolve().then(()=>c3)),A6=w.lazy(()=>Promise.resolve().then(()=>m3)),Ca=({children:e,strategy:t=si,glyphUrl:r,useStagingTenant:n,...o})=>{const a=ge.useConfig();w.useEffect(()=>{if(a.chains){const f=new Set(ot.chains.map(h=>h.id)),d=new Set(a.chains.map(h=>h.id));if(!((h,v)=>h.size===v.size&&[...h].every(m=>v.has(m)))(f,d))throw new Error("Chain mismatch detected. Please use `useGlyphConfigureDynamicChains` from `@use-glyph/sdk-react` to configure chains dynamically.")}},[a.chains,ot.chains]);const i=w.useMemo(()=>({[mr.EIP1193]:A6,[mr.PRIVY]:S6}),[]),[l,c]=w.useState(t);w.useEffect(()=>{t&&Object.values(mr).includes(t)?c(t):c(si)},[t]);const u=w.useMemo(()=>i[l],[l,i]);return s.jsx(u,{glyphUrl:r?.trim?.(),...o,children:s.jsx(E6,{children:s.jsx(C6,{children:s.jsx(N6,{children:s.jsx(m6,{children:e})})})})})},xa=({className:e})=>s.jsx(w0,{className:V("gw-size-6 gw-text-brand-gray-700",e)});function ou(){const{setFetchForAllNetworks:e,fetchForAllNetworks:t}=me(),{iconMap:r}=s0(),n=ge.useChains(),o=ge.useChainId(),{switchChainAsync:a}=ge.useSwitchChain(),[i,l]=w.useState([]),[c,u]=w.useState(!1),f=w.useRef(null),d=t?s.jsx(xa,{}):s.jsx("img",{src:r.get(o),className:"gw-size-6 gw-rounded-full gw-object-cover"});return w.useEffect(()=>{l(n.slice().sort((g,h)=>(g.id===o?-1:1)-(h.id===o?-1:1)))},[n,o]),w.useEffect(()=>{const g=h=>{f.current&&!f.current.contains(h.target)&&u(!1)};return document.addEventListener("mousedown",g),()=>document.removeEventListener("mousedown",g)},[]),n?.length===1?d??s.jsx(Ne,{className:"gw-size-6 gw-rounded-full"}):s.jsxs("div",{className:"gw-relative",ref:f,children:[s.jsxs("button",{onClick:()=>u(!c),className:"gw-rounded-full gw-pl-0.5 gw-pr-1 gw-py-0.5 gw-h-auto gw-w-auto gw-min-w-0 !gw-ring-0 gw-flex gw-items-center gw-space-x-0.5 gw-bg-white/20 gw-backdrop-blur-sm gw-border gw-border-brand-white/20 gw-shadow-liquidSm",children:[s.jsx("div",{className:"gw-mx-0.5 gw-my-0.5",children:d??s.jsx(Ne,{className:"gw-size-6 gw-rounded-full"})}),s.jsx(No,{className:"gw-size-4 gw-text-gray-500"})]}),c&&s.jsxs("div",{className:"gw-absolute gw-top-full gw-right-0 gw-mt-1 gw-rounded-xl gw-z-50 gw-min-w-[14rem] gw-overflow-hidden gw-bg-popover/80 gw-backdrop-blur-sm gw-border gw-border-brand-white/20 gw-shadow-liquidSm",children:[s.jsxs("button",{onClick:()=>{e(!0),u(!1)},className:V("gw-w-full gw-flex gw-items-center gw-space-x-2 gw-px-1 gw-py-1 gw-text-left",t?"gw-bg-green-500/15":"hover:gw-bg-gray-500/15"),children:[s.jsx("div",{className:"gw-mx-1 gw-my-1",children:s.jsx(xa,{})}),s.jsx("span",{className:V("gw-text-sm",t&&"!gw-font-bold"),children:"All Supported Chains"})]},"All"),i.map(g=>{const h=!t&&g.id===o,v=Bt[g.id]||g.name,m=r.get(g.id),b=m?s.jsx("img",{src:m,alt:g.name,className:"gw-size-6 gw-rounded-full gw-object-cover"}):s.jsx(xa,{});return s.jsxs("button",{onClick:async()=>{u(!1),await a({chainId:g.id}),e(!1)},className:V("gw-w-full gw-flex gw-items-center gw-space-x-2 gw-px-1 gw-py-1 gw-text-left",h?"gw-bg-green-500/15":"hover:gw-bg-gray-500/15"),children:[s.jsx("div",{className:"gw-mx-1 gw-my-1",children:b}),s.jsx("span",{className:V("gw-text-sm",h&&"!gw-font-bold"),children:v})]},g.id)})]})]})}const T6=e=>{const t={};if(!e)return t;for(const[r,n]of Object.entries(e)){const o=(Array.isArray(n)?n:[n]).filter(a=>!!a);o.length&&(t[Number(r)]=o)}return t},Ea=(e,t)=>{const[r,n]=w.useState(),[o,a]=w.useState([]),i=JSON.stringify(t??{});return w.useEffect(()=>{r||(async()=>{const u=await fetch(`${e||Zs}/api/public/supported_chains`,{method:"GET"});if(!u.ok)throw new Error(`Failed to fetch Glyph required chains: ${u.status} ${u.statusText}`);const f=await u.json();if(Array.isArray(f.supportedChains)&&Array.isArray(f.chains)&&f.supportedChains.length>0&&f.chains.length>0){const d=T6(t),g=f.chains.map(h=>{const v=d[h.id];return v?{...h,httpRpcUrl:v[0]}:h});n(f.supportedChains),a(g.map(h=>{const v=Jn(h).viemChain,m=d[h.id];return m?{...v,rpcUrls:{...v.rpcUrls,default:{...v.rpcUrls.default,http:m,webSocket:[]},...v.rpcUrls.public?{public:{...v.rpcUrls.public,http:m,webSocket:[]}}:{}}}:v})),ot.configure({chains:g})}else throw new Error("No supported chains returned from API")})()},[e,r,i]),{chainIds:r,chains:o}};function Dn(){const e=w.useContext(Hn);if(!e)throw new Error("useBalances must be used within GlyphProvider");const{balances:t,hasBalances:r,refreshBalances:n,fetchForAllNetworks:o,setFetchForAllNetworks:a,isBalancesLoading:i}=e;return{balances:t,hasBalances:r,refreshBalances:n,fetchForAllNetworks:o,setFetchForAllNetworks:a,isBalancesLoading:i}}function k6(e,t,r){var n=r||{},o=n.noTrailing,a=o===void 0?!1:o,i=n.noLeading,l=i===void 0?!1:i,c=n.debounceMode,u=c===void 0?void 0:c,f,d=!1,g=0;function h(){f&&clearTimeout(f)}function v(b){var p=b||{},x=p.upcomingOnly,C=x===void 0?!1:x;h(),d=!C}function m(){for(var b=arguments.length,p=new Array(b),x=0;x<b;x++)p[x]=arguments[x];var C=this,y=Date.now()-g;if(d)return;function N(){g=Date.now(),t.apply(C,p)}function P(){f=void 0}!l&&u&&!f&&N(),h(),u===void 0&&y>e?l?(g=Date.now(),a||(f=setTimeout(u?P:N,e))):N():a!==!0&&(f=setTimeout(u?P:N,u===void 0?e-y:e))}return m.cancel=v,m}function Os(e,t,r){var n={},o=n.atBegin,a=o===void 0?!1:o;return k6(e,t,{debounceMode:a!==!1})}function P6({url:e,target:t,height:r,width:n}){const o=Math.round((window.screen.width-n)/2),a=Math.round((window.screen.height-r)/2),i=`width=${n},height=${r},resizable,scrollbars=yes,status=1,left=${o},top=${a},popup=true`;return window.open(e,t,i)}let Na=null;function _6(){const{glyphApiFetch:e}=wr(),t=ge.useChainId(),r=w.useCallback(async i=>{if(e&&i?.id){const l=await e(`/api/widget/onramp/quote/${i.id}/buy`,{method:"POST",headers:{"Content-Type":"application/json"}}),c=await l.json();return{url:l.ok?c.url:null,ok:l.ok,error:c.error}}return{url:null,ok:!1}},[e]),n=w.useCallback(async(i,l,c,u,f)=>{if(f&&Na?.abort?.(),!e)return{quote:null,ok:!1,error:"Glyph API not ready"};Na=new AbortController;const d=Na.signal,g=await e("/api/widget/onramp/quote",{method:"POST",body:JSON.stringify({chainId:t,amount:i,currency:l,country:c,subdivision:u}),headers:{"Content-Type":"application/json"},signal:d}),h=await g.json();return{quote:g.ok?h:null,ok:g.ok,error:h.error}},[t,e]),o=w.useCallback(async(i,l)=>{if(!e)return{quote:null,ok:!1,error:"Glyph API not ready"};const c=await e(`/api/widget/onramp/quote/${i}`,{method:"PATCH",body:JSON.stringify({amount:l}),headers:{"Content-Type":"application/json"}}),u=await c.json();return{quote:c.ok?u:null,ok:c.ok,error:u.error}},[e]),a=w.useCallback(async i=>{if(e&&i?.id){const l=await e(`/api/widget/onramp/quote/${i.id}/status`,{method:"GET",headers:{"Content-Type":"application/json"}});return l.ok?{...await l.json(),ok:!0}:{status:null,ok:!1}}return{status:null,ok:!1,details:""}},[e]);return{getPaymentLink:r,createQuote:n,getQuoteStatus:a,refreshQuote:o}}const I6=720,O6=460,L6=10*1e3,M6="Region not supported";function au(){const{user:e,nativeSymbol:t,refreshBalances:r}=me(),n=ge.useChainId(),{getPaymentLink:o,createQuote:a,getQuoteStatus:i,refreshQuote:l}=_6(),[c,u]=w.useState(""),[f,d]=w.useState(""),[g,h]=w.useState(2),[v,m]=w.useState(999999),[b,p]=w.useState(null),[x,C]=w.useState("STARTED"),[y,N]=w.useState(!1),[P,T]=w.useState(!1),[D,L]=w.useState(0),[A,O]=w.useState(null),[F,E]=w.useState(null),[I,_]=w.useState(!1);w.useEffect(()=>{e&&(d(e.currency??"USD"),h(e.minFundingAmount??2),m(e.maxFundingAmount??999999))},[e]);const M=w.useCallback(G=>{const z=typeof G=="string"?G:G(c);if(u(z),z&&Number(z)<g){p(`Minimum funding amount for your location is ${Ee(g,f)}.`);return}if(z&&Number(z)>v){p(`Maximum funding amount for your location is ${Ee(v,f)}.`);return}O(null),T(!1),_(!1),C("STARTED"),L(0),N(!0),E(null),p(null)},[c,g,v,f]),H=w.useMemo(()=>Os(1500,async G=>{try{N(!0);const z=await a(G,f,e.country,e?.subdivision,!0);if(!z.ok)throw new Error(z?.error||"Could not fetch the quote");E(null),O(z.quote)}catch(z){if(z?.name==="AbortError")return;E(z?.message)}N(!1)}),[f,e,a]),U=w.useCallback(async(G,z)=>{try{N(!0);const ce=await l(G,z);if(!ce.ok)throw new Error(ce?.error||"Could not update the quote");O(ce.quote)}catch(ce){E(ce?.message)}N(!1)},[l]);w.useEffect(()=>{if(e&&f&&c&&!P&&!I&&!b)if(A){const G=setInterval(()=>U(A.id,c),A.refresh_in_seconds*1e3);return()=>clearInterval(G)}else H(c)},[f,c,b,I,P,A,H,e,U]);const j=async(G,z,ce=!0)=>{if(!e)return z("User not authenticated");let Y="";try{if(!A)return z("Cannot create payment link for invalid quote");const K=await o(A);if(!K.ok||!K.url)return z(K?.error||"Cannot create payment link");if(Y=K.url,ce){const xe=P6({url:"",height:I6,width:O6});if(!xe)return z("Cannot open popup");xe.location.href=Y}T(!0)}catch(K){return z(K?.message||"Error initiating funding")}return G(Y)},re=w.useCallback(async G=>{L(z=>z+1);try{if(!A)throw new Error("Cannot fetch funding status for invalid quote");const z=await i(A);if(!z.ok)return G("Error fetching funding status");C(z.status),(z.status==="SUCCESS"||z.status==="FAILED")&&(z.status==="FAILED"?E(z.details):await r(!0),T(!1),_(!0))}catch(z){G(z?.message||"Error fetching funding status");return}},[A,i,r]);w.useEffect(()=>{if(!P)return;const G=setInterval(()=>re(E),D?L6:0);return()=>clearInterval(G)},[P,D,re]);const oe=!e?.isOnrampEnabled,we=n!==yt.apeChain.id,J=oe?M6:null;return{userCurrency:f,fundMinAmount:g,fundMaxAmount:v,fundIntermediaryToken:e?.cb_token,fundIntermediaryChain:e?.cb_chain,fundAmount:c,fundAmountError:b,fundDone:I,fundError:F,fundInProgress:P,fundQuote:A,fundStatus:x,isOnrampEnabled:!(oe||we),onramppDisabledError:J,quoteLoading:y,fundSymbol:t,doFunding:j,setFundAmount:M}}function iu(e){const t=w.useContext(Dr);if(!t)throw new Error("glyph hooks must be used within GlyphProvider");const{ready:r,authenticated:n,apiFetch:o,glyphUrl:a}=t,i=w.useMemo(()=>({key:crypto.randomUUID(),glyphUrl:a,identity:e,apiFetch:r&&n?o:null,active:!0}),[r,n,o,a,e]),l=w.useRef(i);l.current=i;const c=w.useCallback(()=>l.current===i&&i.active&&!!i.apiFetch,[i]);return w.useEffect(()=>(i.active=!0,()=>{i.active=!1}),[i]),{scope:i,isCurrent:c}}var lu=(e=>(e.FUND="FUND",e.SWAP="SWAP",e.WITHDRAW="WITHDRAW",e))(lu||{}),cu=(e=>(e.SEND="SEND",e.RECEIVE="RECEIVE",e.TRANSFER="TRANSFER",e.PAY="PAY",e))(cu||{});function du(e=10,t){const r=ot?.chains||[],{fetchForAllNetworks:n,user:o}=me(),{scope:a,isCurrent:i}=iu(o?.evmWallet),l=w.useRef(null),c=ge.useChainId(),[u,f]=w.useState(0),[d,g]=w.useState(!0),[h,v]=w.useState(!1),[m,b]=w.useState([]),p=t?.types?.join(",")??"",x=n?r.map(O=>O.id).join(","):String(c),C=`${a.key}:${x}:${e}:${p}`,y=w.useRef(C);y.current=C;const[N,P]=w.useState(C);w.useEffect(()=>(f(0),g(!0),v(!1),b([]),P(C),()=>{l.current?.abort()}),[C]);const T=w.useCallback(async(O=!1)=>{if(!i()||y.current!==C)return null;l.current?.abort();const F=new AbortController;l.current=F;const E=()=>i()&&y.current===C&&!F.signal.aborted;try{v(!0);const I=O?0:u;O&&b([]);const{value:_}=await Is(a.apiFetch,`/api/widget/activity?chainId=${x}&offset=${I}&size=${e}&type=${p}`,F.signal,E,a.key);let M=[];if(_.groups?M=_.groups:_.transactions&&(M=[{label:"",transactions:_.transactions}]),O)b(M),f(M.reduce((U,j)=>U+j.transactions.length,0));else{const U=A(m,M);b(U),f(I+e)}const H=M.reduce((U,j)=>U+j.transactions.length,0);return g(H===e),P(C),M}catch(I){return I?.name?.includes?.("AbortError")||E()&&Gt.error("Failed to fetch transactions"),null}finally{i()&&y.current===C&&l.current===F&&v(!1)}},[a,i,C,x,p,e,u,m]),D=async()=>!d||h?!1:(await T(),!0),L=async()=>{f(0),g(!0),await T(!0)},A=(O,F)=>{const E={};O.forEach(_=>{E[_.label]=[...E[_.label]||[],..._.transactions]}),F.forEach(_=>{E[_.label]=[...E[_.label]||[],..._.transactions]});const I=Object.entries(E).map(([_,M])=>({label:_,transactions:M}));return I.sort((_,M)=>{if(!_.label)return-1;if(!M.label)return 1;const H=new Date(_.label);return new Date(M.label).getTime()-H.getTime()}),I};return{refreshKey:C,transactionGroups:N===C&&i()?m:[],fetchTransactions:T,loadMore:D,reset:L,hasMore:d,isLoading:h}}function D6(){const{user:e}=me(),t=ge.useChainId(),{glyphApiFetch:r}=wr(),[n,o]=w.useState(!1);return{checkTokenGate:w.useCallback(async i=>{try{return e?r?(o(!0),await(await r("/api/widget/ownership_check",{method:"POST",body:JSON.stringify({chainId:t,walletAddress:e.evmWallet,...i}),headers:{"Content-Type":"application/json"}})).json()):{result:!1,error:"Glyph API not ready"}:{result:!1,error:"User not authenticated"}}catch(l){return{result:!1,error:l?.message||"Glyph tokengate error"}}finally{o(!1)}},[t,e,r,o]),isTokenGateLoading:n}}function F6(){const{user:e}=me(),t=ge.useChainId(),{glyphApiFetch:r}=wr(),[n,o]=w.useState(!1);return{checkOwnership:w.useCallback(async i=>{try{return e?r?(o(!0),await(await r("/api/widget/ownership_check",{method:"POST",body:JSON.stringify({chainId:t,walletAddress:e.evmWallet,...i}),headers:{"Content-Type":"application/json"}})).json()):{result:!1,error:"Glyph API not ready",tokens:[],delegationChain:[]}:{result:!1,error:"User not authenticated",tokens:[],delegationChain:[]}}catch(l){return{result:!1,error:l?.message||"Glyph ownership check error",tokens:[],delegationChain:[]}}finally{o(!1)}},[r,t]),isOwnershipCheckLoading:n}}const U6=()=>{const e=w.useContext(Bn);if(e===void 0)throw new Error("useGlyphView must be used within a GlyphViewProvider");const{setGlyphView:t}=e;return{setGlyphView:t}},uu=()=>{const{connectAsync:e,connectors:t}=ge.useConnect(),{disconnect:r}=ge.useDisconnect();return{connect:w.useCallback(async()=>{const o=t.find(a=>a.id===dt.id);if(!o)throw new Error("Glyph Wallet Connector not found");await e({connector:o})},[e,t]),disconnect:r}},B6=()=>{const{connect:e}=uu(),{isConnected:t,isConnecting:r}=ge.useAccount();return t?s.jsx(Ao,{}):r?s.jsx(ue,{variant:"default",size:"login",disabled:!0,children:s.jsxs("span",{className:"gw-inline-flex gw-items-center gw-w-full gw-gap-1",children:[s.jsx("span",{className:"gw-p-2 gw-rounded-full",children:s.jsx(yr,{className:"!gw-size-5"})}),s.jsx(Nr,{className:"gw-size-4 gw-animate-spin"})]})}):s.jsx(ue,{variant:"default",size:"login",onClick:e,className:"gw-w-52 !gw-justify-start",children:s.jsxs("span",{className:"gw-flex gw-items-center gw-gap-1 gw-w-full",children:[s.jsx("span",{className:"gw-p-2 gw-rounded-full",children:s.jsx(yr,{className:"!gw-size-5"})}),s.jsx("span",{className:"gw-flex-1 gw-text-center",children:"Connect to Glyph"})]})})};function fu(e={}){const{rkDetails:t,useStagingTenant:r}=e;return n=>{const o=js.toPrivyWalletConnector({iconUrl:dt.iconUrl,id:r?Ut:Ft,name:dt.name})(n);return{...o,...t,getProvider:async l=>{const c=l?.chainId??n.chains?.[0]?.id??yt.apeChain.id;return await o.getProvider({chainId:c})},type:dt.type,id:dt.id}}}const H6=new lt.QueryClient,$6=({queryClient:e=H6,children:t,ssr:r,...n})=>{const{chains:o}=Ea(n.glyphUrl,n.rpcUrls),a=w.useMemo(()=>o&&o.length>0?ge.createConfig({chains:o,ssr:r,connectors:[fu({useStagingTenant:n.useStagingTenant})],transports:o.reduce((i,l)=>{const c=(l.rpcUrls?.default?.http??[]).filter(Boolean);return i[l.id]=c.length?$.fallback(c.map(u=>$.http(u))):$.http(),i},{}),multiInjectedProviderDiscovery:!1}):null,[o,n.useStagingTenant,r]);return a?s.jsx(ge.WagmiProvider,{config:a,children:s.jsx(lt.QueryClientProvider,{client:e,children:s.jsx(Ca,{strategy:mr.EIP1193,walletClientType:Ys.WAGMI,...n,children:t})})}):null},V6=js.toPrivyWallet({id:Ft,name:dt.name,iconUrl:dt.iconUrl}),z6=js.toPrivyWallet({id:Ut,name:dt.name,iconUrl:dt.iconUrl}),W6=zr("usePrivyCrossAppProvider"),gu=({chains:e,useStagingTenant:t})=>{const{loginWithCrossAppAccount:r,linkCrossAppAccount:n,sendTransaction:o,signMessage:a,signTypedData:i}=ln.useCrossAppAccounts(),{user:l,authenticated:c,ready:u}=ln.usePrivy(),[f,d]=w.useState(null);w.useEffect(()=>{e.length>0&&!f&&d(e[0].id.toString())},[e,f]);const g=w.useMemo(()=>({web3_clientVersion:!0,web3_sha3:!0,net_listening:!0,net_peerCount:!0,net_version:!0,eth_blobBaseFee:!0,eth_blockNumber:!0,eth_call:!0,eth_chainId:!0,eth_coinbase:!0,eth_estimateGas:!0,eth_feeHistory:!0,eth_gasPrice:!0,eth_getBalance:!0,eth_getBlockByHash:!0,eth_getBlockByNumber:!0,eth_getBlockTransactionCountByHash:!0,eth_getBlockTransactionCountByNumber:!0,eth_getCode:!0,eth_getFilterChanges:!0,eth_getFilterLogs:!0,eth_getLogs:!0,eth_getProof:!0,eth_getStorageAt:!0,eth_getTransactionByBlockHashAndIndex:!0,eth_getTransactionByBlockNumberAndIndex:!0,eth_getTransactionByHash:!0,eth_getTransactionCount:!0,eth_getTransactionReceipt:!0,eth_getUncleByBlockHashAndIndex:!0,eth_getUncleByBlockNumberAndIndex:!0,eth_getUncleCountByBlockHash:!0,eth_getUncleCountByBlockNumber:!0,eth_maxPriorityFeePerGas:!0,eth_newBlockFilter:!0,eth_newFilter:!0,eth_newPendingTransactionFilter:!0,eth_protocolVersion:!0,eth_sendRawTransaction:!0,eth_uninstallFilter:!0,zks_estimateFee:!0}),[]),h=w.useCallback(E=>!!g[E],[g]),v=w.useMemo(()=>Object.fromEntries(e.map(E=>{const I=E.rpcUrls.default.http.filter(Boolean);return[E.id,$.createPublicClient({chain:E,transport:I.length?$.fallback(I.map(_=>$.http(_))):$.http()})]})),[e]),m=w.useCallback(E=>{if(!E)return{smartAccount:void 0,signer:void 0};const I=E.linkedAccounts.find(H=>H.type==="cross_app"&&H.providerApp.id===(t?Ut:Ft)),_=I?.smartWallets?.[0]?.address,M=I?.embeddedWallets?.[0]?.address;return{smartAccount:_||void 0,signer:M||void 0}},[t]),b=w.useCallback(async E=>{if(!u)return{accounts:[],user:null};let I=l;E&&(!I&&!c?I=await r({appId:t?Ut:Ft}):!I&&c&&(I=await n({appId:t?Ut:Ft})));const{signer:_}=m(I);return _?{accounts:[_],user:I}:{accounts:[],user:I}},[l,c,u,r,n,t,m]),p=!!(u&&c&&l&&l.linkedAccounts.some(E=>E.type==="cross_app"&&E.providerApp.id===(t?Ut:Ft))),{signer:x,smartAccount:C}=m(l),y=JSON.stringify([p,u,l?.id,x,C,t]),N=u&&!l,P=JSON.stringify([l?.id,x,C,t]),T=w.useMemo(()=>({active:!1,generation:0,key:y,identity:P,successor:null,request:null,interactiveLogin:N,listeners:new Map}),[y,N,P]),D=w.useRef(null),L=T.listeners,A=w.useCallback(E=>{E!==f&&(d(E),(L.get("chainChanged")||[]).forEach(_=>_(E)))},[f,L]),O=w.useCallback(async E=>{const{method:I,params:_}=E;W6.debug("Handling provider request");const M=_?.chainId||_?.[0]?.chainId||+f;if(h(I))return v[M].request(E);switch(I){case"eth_requestAccounts":return await b(!0);case"eth_accounts":return(await b(!1)).accounts;case"wallet_addEthereumChain":case"wallet_switchEthereumChain":{const U=_[0].chainId;if(!U)throw new Error("Chain ID is required");const j=$.isHex(U)?$.hexToNumber(U):U;if(!Object.values(e).find(oe=>oe.id===j))throw new Error(`Chain ${j} not supported`);return A(j.toString()),null}case"wallet_revokePermissions":return null;case"eth_signTransaction":throw new Error("eth_signTransaction is not supported");case"eth_sendTransaction":{const H=_[0];return A(M.toString()),await o({...H,chainId:M},{address:H.from})}case"eth_signTypedData_v4":return A(M.toString()),await i(JSON.parse(_[1]),{address:_[0],chainId:M});case"eth_sign":throw new Error("eth_sign is unsafe and not supported");case"personal_sign":return A(M.toString()),await a($.fromHex(_[0],"string"),{address:_[1],chainId:M});default:throw new Error(`Unsupported request: ${I}`)}},[h,v,b,a,i,o,f,A,e]);w.useLayoutEffect(()=>{D.current&&D.current!==T&&(D.current.successor=T),D.current=T,T.active=!0;const E=++T.generation;return()=>{T.active=!1,queueMicrotask(()=>{T.generation===E&&!T.active&&L.clear()})}},[T,L]),w.useLayoutEffect(()=>{T.request=O},[T,O]);const F=w.useMemo(()=>({on:(E,I)=>{L.set(E,[...L.get(E)??[],I])},removeListener:(E,I)=>{L.set(E,(L.get(E)??[]).filter(_=>_!==I))},request:(async E=>{if(!T.active||!T.request)throw new Error("Privy session is no longer active");const I=await T.request(E);if(E.method==="eth_requestAccounts"){const _=I.user,M=m(_),H=JSON.stringify([_?.id,M.signer,M.smartAccount,t]),U=T.successor;if(!T.active&&!(T.interactiveLogin&&U&&U===D.current&&U.active&&U.identity===H))throw new Error("Privy session is no longer active");return I.accounts}if(!T.active&&E.method!=="eth_sendTransaction")throw new Error("Privy session is no longer active");return I})}),[T,L,m,t]);return{ready:p,provider:F,chainId:f?parseInt(f):e[0].id}},j6=zr("InjectWagmiConnector"),wu=({children:e,useStagingTenant:t})=>{const r=ge.useConfig(),{ready:n,provider:o}=gu({chains:r.chains,useStagingTenant:t});return w.useEffect(()=>{if(!n||!o)return;let a=!1;const i=[],l=new Proxy(o,{get(d,g){if(g==="on")return(v,m)=>{a||(i.push({event:v,listener:m}),d.on(v,m))};if(g==="removeListener")return(v,m)=>{d.removeListener(v,m);const b=i.findIndex(p=>p.event===v&&p.listener===m);b!==-1&&i.splice(b,1)};const h=Reflect.get(d,g);return typeof h=="function"?h.bind(d):h}}),c=r._internal.connectors.setup(r0(l,t)),u=c.connect.bind(c);c.connect=async(...d)=>{if(a)throw new Error("Connector is retired");const g=await u(...d);if(a)throw new Error("Connector is retired");return g},r._internal.connectors.setState([...r.connectors,c]);const f=()=>{a=!0;for(const{event:g,listener:h}of i.splice(0))o.removeListener(g,h);const d=r._internal.events;c.emitter.off("connect",d.connect),c.emitter.off("change",d.change),c.emitter.off("disconnect",d.disconnect),r._internal.connectors.setState(r.connectors.filter(g=>g!==c)),r.setState(g=>{if(!g.connections.has(c.uid))return g;const h=new Map(g.connections);h.delete(c.uid);const v=g.current===c.uid?h.keys().next().value??null:g.current;return{...g,connections:h,current:v,status:h.size?g.status:"disconnected"}})};return(async()=>{try{if(await r.storage?.removeItem(`${dt.id}.disconnected`),a||!await c.isAuthorized()||a)return;const d=await c.connect({isReconnecting:!0});if(a||!d.accounts.length)return;const g=r._internal.events;c.emitter.off("connect",g.connect),c.emitter.on("change",g.change),c.emitter.on("disconnect",g.disconnect),r.setState(h=>({...h,connections:new Map(h.connections).set(c.uid,{...d,accounts:d.accounts,connector:c}),current:h.current??c.uid,status:"connected"}))}catch{a||j6.error("Failed to setup or reconnect connector")}})(),f},[n,o,t,r]),s.jsx(s.Fragment,{children:e})},Sa=`privy:${Ft}`,Aa=`privy:${Ut}`,G6=({queryClient:e=new lt.QueryClient,glyphUrl:t,useStagingTenant:r,ssr:n,onLogin:o,onLogout:a,rpcUrls:i,...l})=>{const{chains:c}=Ea(t,i),u=w.useMemo(()=>{if(!(!c||c.length===0))return Ja.createConfig({chains:c,ssr:n,connectors:[],transports:c.reduce((d,g)=>{const h=(g.rpcUrls?.default?.webSocket??[]).filter(Boolean),v=(g.rpcUrls?.default?.http??[]).filter(Boolean),m=[...h.map(b=>$.webSocket(b)),...v.map(b=>$.http(b))];return d[g.id]=m.length?$.fallback(m):$.http(),d},{}),multiInjectedProviderDiscovery:!1})},[c,n]),f=w.useMemo(()=>!c||c.length===0?l:(l.config?l.config.loginMethodsAndOrder?l.config.defaultChain||(l.config.defaultChain=c[0]):l.config.loginMethodsAndOrder={primary:[r?Aa:Sa]}:l.config={loginMethodsAndOrder:{primary:[r?Aa:Sa]},defaultChain:c[0]},{...l,config:{...l.config,supportedChains:c}}),[l,c,r]);return!u||!f.config?null:s.jsx(ln.PrivyProvider,{...f,children:s.jsx(lt.QueryClientProvider,{client:e,children:s.jsx(Ja.WagmiProvider,{config:u,children:s.jsx(wu,{useStagingTenant:r,children:s.jsx(Ca,{strategy:mr.PRIVY,glyphUrl:t,useStagingTenant:r,onLogin:o,onLogout:a,children:l.children})})})})})},q6=typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__dirname+"/assets/USDIcon.png").href:new URL("assets/USDIcon.png",typeof document>"u"?location.href:document.currentScript&&document.currentScript.tagName.toUpperCase()==="SCRIPT"&&document.currentScript.src||document.baseURI).href;function Z6(e){return s.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[s.jsxs("g",{clipPath:"url(#clip0_2143_5128)",children:[s.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2.61602 3.16387C2.96293 2.81696 3.43344 2.62207 3.92404 2.62207H6.92085C7.31525 2.62207 7.63497 2.94179 7.63497 3.33619C7.63497 3.73059 7.31525 4.05031 6.92085 4.05031H3.92404C3.81223 4.05031 3.705 4.09473 3.62594 4.17379C3.54688 4.25285 3.50246 4.36008 3.50246 4.47189V12.4218C3.50246 12.5336 3.54688 12.6409 3.62594 12.7199C3.705 12.799 3.81223 12.8434 3.92404 12.8434H11.874C11.9858 12.8434 12.093 12.799 12.1721 12.7199C12.2511 12.6409 12.2955 12.5336 12.2955 12.4218V9.16244C12.2955 8.76805 12.6153 8.44832 13.0097 8.44832C13.4041 8.44832 13.7238 8.76805 13.7238 9.16244V12.4218C13.7238 12.9124 13.5289 13.3829 13.182 13.7298C12.8351 14.0767 12.3646 14.2716 11.874 14.2716H3.92404C3.43344 14.2716 2.96293 14.0767 2.61602 13.7298C2.26911 13.3829 2.07422 12.9124 2.07422 12.4218V4.47189C2.07422 3.98129 2.26911 3.51078 2.61602 3.16387Z",fill:"currentColor"}),s.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.36743 1.93238C8.36743 1.53718 8.68781 1.2168 9.08301 1.2168H14.3571V6.70854C14.3571 7.10375 14.0367 7.42413 13.6415 7.42413C13.2463 7.42413 12.9259 7.10375 12.9259 6.70854V3.7643L7.50929 9.63969C7.24141 9.93026 6.7887 9.94865 6.49813 9.68077C6.20756 9.41289 6.18917 8.96018 6.45705 8.66961L12.0085 2.64797H9.08301C8.68781 2.64797 8.36743 2.32759 8.36743 1.93238Z",fill:"currentColor"})]}),s.jsx("defs",{children:s.jsx("clipPath",{id:"clip0_2143_5128",children:s.jsx("rect",{width:"14.3118",height:"15.0273",fill:"white",transform:"translate(0.792969 0.389648)"})})})]})}function hu(e,t,r){let n=e;if(n.includes(t)&&!n.endsWith(t)){const[o,a]=n.split(t);a.length>r&&(n=`${o}${t}${a.substring(0,r)}`)}return n}function Ls(e,t){let r=e;return r.match(/^0+[.,]/)&&(r=r.replace(/^0+/,"0")),r.match(/^0[0-9]+/)&&(r=r.replace(/^0+/,"")),r=hu(r,".",t),r=hu(r,",",t),r}function Ms(e){return s.jsxs("svg",{width:"175",height:"175",viewBox:"0 0 175 175",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[s.jsx("circle",{cx:"87.5",cy:"87.5",r:"87.5",fill:"#929792"}),s.jsx("g",{clipPath:"url(#clip0_4594_16001)",filter:"url(#filter0_d_4594_16001)",children:s.jsx("g",{filter:"url(#filter1_d_4594_16001)",children:s.jsx("path",{d:"M110.139 65.9764C99.9177 55.4825 88.8017 47.8048 79.3155 43.8935C74.5667 41.9482 70.2392 40.9505 66.6961 40.9515C63.1529 40.9524 60.5034 41.8708 58.6363 43.6892C56.7693 45.5076 55.7814 48.1321 55.687 51.6739C55.5927 55.2158 56.4759 59.5682 58.2954 64.3666C61.9552 73.9526 69.3371 85.2671 79.5579 95.7611C89.7788 106.255 100.895 113.933 110.376 117.839C115.133 119.793 119.457 120.787 123 120.786C126.544 120.785 129.193 119.867 131.06 118.048C132.927 116.23 133.915 113.605 134.009 110.064C134.104 106.522 133.224 102.173 131.396 97.3661C127.741 87.7849 120.359 76.4704 110.139 65.9764ZM51.6994 50.4456L43.6197 58.3151C42.6057 59.3027 41.6178 61.9271 41.5234 65.469C41.429 69.0108 42.3122 73.3632 44.1317 78.1616C47.7916 87.7476 55.1734 99.0622 65.3943 109.556C75.6151 120.05 86.7311 127.728 96.2126 131.634C100.969 133.588 105.294 134.582 108.837 134.581C112.38 134.58 115.029 133.662 116.043 132.674L124.123 124.805C123.741 124.832 123.376 124.843 122.995 124.838C118.721 124.829 113.938 123.685 108.849 121.585C98.6564 117.399 87.2109 109.415 76.6608 98.5828C66.1108 87.7509 58.4315 76.0988 54.5189 65.8024C52.5545 60.662 51.5344 55.8471 51.64 51.5761C51.6466 51.1965 51.6787 50.8108 51.6994 50.4456Z",fill:"#B9B9B9"})})}),s.jsxs("defs",{children:[s.jsxs("filter",{id:"filter0_d_4594_16001",x:"2.43213",y:"6.43359",width:"170.669",height:"170.668",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB",children:[s.jsx("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),s.jsx("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),s.jsx("feOffset",{dy:"4"}),s.jsx("feGaussianBlur",{stdDeviation:"2"}),s.jsx("feComposite",{in2:"hardAlpha",operator:"out"}),s.jsx("feColorMatrix",{type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"}),s.jsx("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow_4594_16001"}),s.jsx("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect1_dropShadow_4594_16001",result:"shape"})]}),s.jsxs("filter",{id:"filter1_d_4594_16001",x:"37.5165",y:"40.9531",width:"100.5",height:"101.629",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB",children:[s.jsx("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),s.jsx("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),s.jsx("feOffset",{dy:"4"}),s.jsx("feGaussianBlur",{stdDeviation:"2"}),s.jsx("feComposite",{in2:"hardAlpha",operator:"out"}),s.jsx("feColorMatrix",{type:"matrix",values:"0 0 0 0 0.458139 0 0 0 0 0.458139 0 0 0 0 0.458139 0 0 0 1 0"}),s.jsx("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow_4594_16001"}),s.jsx("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect1_dropShadow_4594_16001",result:"shape"})]}),s.jsx("clipPath",{id:"clip0_4594_16001",children:s.jsx("rect",{width:"115.034",height:"115.034",fill:"white",transform:"translate(88.8388 6.43359) rotate(45.7554)"})})]})]})}function Fn({className:e}){const{balances:t}=me(),r=ge.useChainId(),n=t?.tokens?.find?.(a=>a.native&&a?.chainId===r),o=n?.logo;return o?s.jsx("img",{src:o,alt:n?.symbol,className:V("gw-size-6 gw-rounded-full gw-object-cover",e)}):s.jsx(Ms,{className:V("gw-size-6",e)})}function Y6(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ds={},pu;function K6(){if(pu)return Ds;pu=1,Object.defineProperty(Ds,"__esModule",{value:!0});var e=/^(0x[a-zA-Z0-9]{4})[a-zA-Z0-9]+([a-zA-Z0-9]{4})$/,t=function(r){var n=r.match(e);return n?n[1]+"…"+n[2]:r};return Ds.default=t,Ds}var X6=K6();const at=Y6(X6);function Q6(e){return s.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:s.jsx("path",{d:"M15.41 16.59L10.83 12L15.41 7.41L14 6L8 12L14 18L15.41 16.59Z",fill:"currentColor"})})}function J6(e){const{isCopied:t,...r}=e;return t?s.jsx("svg",{viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...r,children:s.jsx("path",{d:"M8.6 14.6L15.65 7.55L14.25 6.15L8.6 11.8L5.75 8.95L4.35 10.35L8.6 14.6ZM10 20C8.61667 20 7.31667 19.7373 6.1 19.212C4.88333 18.6873 3.825 17.975 2.925 17.075C2.025 16.175 1.31267 15.1167 0.788 13.9C0.262667 12.6833 0 11.3833 0 10C0 8.61667 0.262667 7.31667 0.788 6.1C1.31267 4.88333 2.025 3.825 2.925 2.925C3.825 2.025 4.88333 1.31233 6.1 0.787C7.31667 0.262333 8.61667 0 10 0C11.3833 0 12.6833 0.262333 13.9 0.787C15.1167 1.31233 16.175 2.025 17.075 2.925C17.975 3.825 18.6873 4.88333 19.212 6.1C19.7373 7.31667 20 8.61667 20 10C20 11.3833 19.7373 12.6833 19.212 13.9C18.6873 15.1167 17.975 16.175 17.075 17.075C16.175 17.975 15.1167 18.6873 13.9 19.212C12.6833 19.7373 11.3833 20 10 20Z",fill:"currentColor"})}):s.jsxs("svg",{viewBox:"0 0 18 17",fill:"none",xmlns:"http://www.w3.org/2000/svg",...r,children:[s.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6.87207 8.31641C6.87207 7.21184 7.7675 6.31641 8.87207 6.31641H14.5016C15.6061 6.31641 16.5016 7.21184 16.5016 8.31641V13.3281C16.5016 14.4327 15.6061 15.3281 14.5016 15.3281H8.87207C7.7675 15.3281 6.87207 14.4327 6.87207 13.3281V8.31641ZM14.5016 8.31641H8.87207V13.3281H14.5016V8.31641Z",fill:"currentColor"}),s.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.02246 3.36719C3.02246 2.26262 3.91789 1.36719 5.02246 1.36719H10.3771C11.4817 1.36719 12.3771 2.26262 12.3771 3.36719V4.63574H10.3771V3.36719H5.02246V8.99737H5.67204V10.9974H5.02246C3.91789 10.9974 3.02246 10.1019 3.02246 8.99737V3.36719Z",fill:"currentColor"})]})}const R6=({text:e,textToCopy:t,className:r,textClassName:n,iconClassName:o})=>{const[a,i]=w.useState(!1);return s.jsxs("button",{onClick:()=>{const l=t0(t||e);i(l),setTimeout(()=>{i(!1)},2e3)},className:V("gw-inline-flex gw-items-center gw-justify-end gw-text-brand-gray-500 gw-gap-1",r),children:[s.jsx("span",{className:n,children:e}),s.jsx("span",{children:s.jsx(J6,{isCopied:a,className:V("gw-text-secondary gw-size-4",o)})})]})},_r=w.memo(R6),e4=({fullScreenHeader:e,onProfileClick:t,isStickyHeader:r})=>{const{user:n}=me(),o=w.useRef(null),[a,i]=w.useState(!1);return w.useEffect(()=>{if(!r||!e?.title)return;const l=o.current;if(!l)return;const c=l.closest(".gw-wallet-view"),u=c?.querySelector(".gw-wallet-content");if(!c||!u)return;const f=l.closest(".gw-wallet-header"),d=f?f.offsetTop:0,g=()=>{const v=c.scrollTop>d;i(v)};return g(),c.addEventListener("scroll",g,{passive:!0}),()=>{c.removeEventListener("scroll",g)}},[e?.title,r]),e&&e?.title?s.jsx(s.Fragment,{children:s.jsxs("div",{ref:o,className:"gw-flex gw-items-center gw-space-x-4 gw-justify-between gw-w-full",children:[s.jsx("div",{className:"gw-size-12",children:e?.onBackClick?s.jsx("button",{className:V("gw-size-full gw-inline-flex gw-items-center"),onClick:e?.onBackClick,children:s.jsx("span",{className:V("gw-transition-all gw-duration-300",a?"gw-px-1 gw-py-1 gw-bg-white/40 gw-backdrop-blur-sm gw-border gw-border-brand-white/20 gw-shadow-liquidSm gw-rounded-full":"gw-border-transparent gw-shadow-none"),children:s.jsx(Q6,{className:V("gw-transition-all",a?"gw-w-5 gw-h-5":"gw-w-6 gw-h-6")})})}):null}),s.jsx("div",{className:V("gw-transition-all gw-duration-300",a?"gw-px-2 gw-py-1 gw-bg-white/40 gw-backdrop-blur-sm gw-border gw-border-brand-white/20 gw-shadow-liquidSm gw-rounded-full gw-typography-body2":"gw-typography-subtitle1 gw-border-transparent gw-shadow-none"),children:e.title}),s.jsx("div",{className:"gw-size-12",children:e?.onCloseClick?s.jsx("button",{className:V("gw-size-full gw-inline-flex gw-items-center"),onClick:e?.onCloseClick,children:s.jsx("span",{className:V("gw-transition-all gw-duration-300",a?"gw-px-1 gw-py-1 gw-bg-white/40 gw-backdrop-blur-sm gw-border gw-border-brand-white/20 gw-shadow-liquidSm gw-rounded-full":"gw-border-transparent gw-shadow-none"),children:s.jsx(Rt,{className:V("gw-transition-all",a?"gw-w-5 gw-h-5":"gw-w-6 gw-h-6")})})}):null})]})}):s.jsx(s.Fragment,{children:s.jsxs("div",{className:"gw-flex gw-items-center gw-space-x-4 gw-justify-between gw-w-full",children:[s.jsxs("div",{className:"gw-flex gw-items-center gw-space-x-4 gw-justify-between",children:[s.jsx("button",{onClick:t,disabled:!n?.hasProfile,children:s.jsx(Ct,{className:"gw-size-12"})}),s.jsxs("div",{className:"gw-flex gw-flex-col",children:[s.jsx("button",{onClick:t,disabled:!n?.hasProfile,children:s.jsx("div",{className:"gw-mt-1.5 gw-typography-subtitle1 gw-text-left",children:n?.name})}),s.jsx("div",{children:s.jsx(_r,{textClassName:"gw-max-w-56 gw-break-all gw-typography-body2",text:at(n.evmWallet),textToCopy:n.evmWallet})})]})]}),s.jsx(ou,{})]})})},Zt=w.memo(e4);function st({mainFooter:e=!0,isStickyHeader:t,...r}){return s.jsxs("div",{className:V("gw-wallet-view","gw-overflow-y-auto"),style:{scrollbarGutter:"stable"},children:[r.header&&s.jsx("div",{className:V("gw-wallet-header",t?"gw-sticky gw-top-0 gw-z-10":"",r.headerClassName),children:r.header}),s.jsx("div",{className:"gw-wallet-content",children:r.content}),r.footer&&s.jsx("div",{className:V(`${e?"gw-wallet-footer-nav gw-sticky gw-z-10 gw-rounded-full gw-m-4 gw-bottom-4 gw-right-4 gw-mt-0 gw-bg-brand-white/40 gw-backdrop-blur-sm gw-border gw-border-brand-white/20 gw-shadow-liquid":"gw-wallet-footer"} ${r.footerCols?"gw-flex-col gw-flex-nowrap gw-items-center":"gw-flex-row gw-flex-nowrap"}`,r.footerClassName),children:r.footer})]})}function t4(e){return s.jsxs("svg",{width:"17",height:"17",viewBox:"0 0 17 17",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[s.jsx("g",{clipPath:"url(#clip0_114_7349)",children:s.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.17526 2.92832C4.83466 2.92832 2.12656 5.63641 2.12656 8.97702C2.12656 12.3176 4.83466 15.0257 8.17526 15.0257C11.5159 15.0257 14.224 12.3176 14.224 8.97702C14.224 5.63641 11.5159 2.92832 8.17526 2.92832ZM0.890625 8.97702C0.890625 4.95383 4.15207 1.69238 8.17526 1.69238C12.1985 1.69238 15.4599 4.95383 15.4599 8.97702C15.4599 13.0002 12.1985 16.2617 8.17526 16.2617C4.15207 16.2617 0.890625 13.0002 0.890625 8.97702ZM8.01797 6.09037C7.56262 6.17853 7.23374 6.458 7.13875 6.82319C7.05283 7.15349 6.71542 7.35161 6.38511 7.26569C6.05481 7.17978 5.85669 6.84236 5.94261 6.51206C6.18584 5.57696 6.98216 5.03202 7.78305 4.87696C8.58183 4.72232 9.52098 4.92632 10.1262 5.64535C10.809 6.45654 10.9445 7.49367 10.5598 8.34691C10.2421 9.05142 9.59704 9.57332 8.74137 9.74306V9.94707C8.74137 10.2884 8.4647 10.565 8.1234 10.565C7.78211 10.565 7.50543 10.2884 7.50543 9.94707V9.18426C7.50543 8.84297 7.78211 8.5663 8.1234 8.5663C8.84083 8.5663 9.25922 8.22452 9.43309 7.8389C9.61246 7.44109 9.57333 6.90774 9.18068 6.44127C8.92354 6.13579 8.47542 6.0018 8.01797 6.09037ZM8.0833 12.9359C8.53581 12.9359 8.90264 12.5691 8.90264 12.1166C8.90264 11.664 8.53581 11.2972 8.0833 11.2972C7.63079 11.2972 7.26396 11.664 7.26396 12.1166C7.26396 12.5691 7.63079 12.9359 8.0833 12.9359Z",fill:"currentColor"})}),s.jsx("defs",{children:s.jsx("clipPath",{id:"clip0_114_7349",children:s.jsx("rect",{width:"16",height:"16",fill:"white",transform:"translate(0.173828 0.977539)"})})})]})}function Ot({contentClassName:e,triggerClassName:t,description:r,children:n,side:o,align:a,defaultOpen:i,open:l,onOpenChange:c,stopPropagation:u}){const[f,d]=w.useState(!1);return s.jsxs(y6,{defaultOpen:i,delayDuration:0,onOpenChange:c===void 0?d:c,open:l===void 0?f:l===null?void 0:l,children:[s.jsx(b6,{asChild:!0,onClick:g=>{u&&g.stopPropagation(),l===void 0&&!c&&d(h=>!h)},children:n??s.jsx("div",{children:s.jsx(t4,{className:V("gw-text-brand-gray-500 gw-size-5",t)})})}),s.jsx(v6,{align:a,className:V("gw-max-w-72",e),side:o,children:s.jsx("div",{children:r})})]})}function Ta(e){return s.jsxs("svg",{width:"105",height:"105",viewBox:"0 0 105 105",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[s.jsx("path",{d:"M20.361 59.0825V55.3721H21.8028C22.5926 55.3721 23.1279 55.8703 23.1279 56.6018C23.1279 57.328 22.5926 57.8263 21.8028 57.8263H20.9918V59.0825H20.361ZM20.9918 57.2644H21.8134C22.2109 57.2644 22.4919 56.9941 22.4919 56.6018C22.4919 56.2043 22.2109 55.934 21.8134 55.934H20.9918V57.2644ZM23.6416 59.0825V55.3721H24.2565V59.0825H23.6416ZM26.0586 59.1461C25.2741 59.1461 24.6698 58.579 24.6698 57.7733C24.6698 56.9676 25.2635 56.4004 26.0321 56.4004C26.7901 56.4004 27.3307 56.9146 27.3307 57.6991C27.3307 57.7945 27.3201 57.8952 27.3148 57.9429H25.29C25.3324 58.351 25.6451 58.6267 26.0586 58.6267C26.3978 58.6267 26.6417 58.4358 26.7265 58.2185L27.2777 58.3669C27.1399 58.8069 26.6735 59.1461 26.0586 59.1461ZM25.3112 57.4923H26.7371C26.6947 57.1372 26.3978 56.9252 26.0374 56.9252C25.6823 56.9252 25.396 57.1319 25.3112 57.4923ZM28.5601 59.1461C28.0459 59.1461 27.6378 58.8599 27.6378 58.3722C27.6378 57.9323 27.924 57.662 28.4594 57.5771L29.3499 57.4393V57.3651C29.3499 57.0789 29.1325 56.9252 28.8092 56.9252C28.4912 56.9252 28.2526 57.1001 28.136 57.3704L27.659 57.1266C27.8233 56.6813 28.2579 56.4004 28.8092 56.4004C29.4983 56.4004 29.9647 56.8033 29.9647 57.3651V59.0825H29.3552V58.8281C29.1749 59.0295 28.9046 59.1461 28.5601 59.1461ZM28.2367 58.3404C28.2367 58.5631 28.4223 58.685 28.6979 58.6797C29.0848 58.6744 29.3499 58.4517 29.3499 58.0701V57.8793L28.576 58.0012C28.3693 58.0383 28.2367 58.1602 28.2367 58.3404ZM31.4905 59.1461C30.9074 59.1461 30.4303 58.8228 30.3667 58.3934L30.8915 58.2556C30.9445 58.5048 31.1724 58.6797 31.4851 58.6797C31.7343 58.6797 31.8986 58.5631 31.8986 58.3828C31.8986 58.2291 31.7873 58.1337 31.4851 58.0489L31.1618 57.9588C30.6901 57.821 30.4515 57.5824 30.4515 57.2008C30.4515 56.7237 30.8226 56.4004 31.4109 56.4004C31.9516 56.4004 32.3598 56.6919 32.4711 57.1372L31.941 57.2379C31.8668 57.0206 31.6654 56.8722 31.4162 56.8722C31.183 56.8669 31.0346 56.9941 31.0346 57.1637C31.0346 57.3174 31.1459 57.4128 31.4427 57.487L31.7714 57.5718C32.2325 57.6991 32.4817 57.927 32.4817 58.3298C32.4817 58.8175 32.0788 59.1461 31.4905 59.1461ZM34.1737 59.1461C33.3892 59.1461 32.785 58.579 32.785 57.7733C32.785 56.9676 33.3786 56.4004 34.1472 56.4004C34.9052 56.4004 35.4459 56.9146 35.4459 57.6991C35.4459 57.7945 35.4353 57.8952 35.43 57.9429H33.4051C33.4475 58.351 33.7603 58.6267 34.1737 58.6267C34.513 58.6267 34.7568 58.4358 34.8416 58.2185L35.3929 58.3669C35.255 58.8069 34.7886 59.1461 34.1737 59.1461ZM33.4263 57.4923H34.8522C34.8098 57.1372 34.513 56.9252 34.1525 56.9252C33.7974 56.9252 33.5111 57.1319 33.4263 57.4923ZM38.2586 59.1461C37.5006 59.1461 36.9441 58.5843 36.9441 57.7733C36.9441 56.9676 37.5006 56.4004 38.2586 56.4004C38.6138 56.4004 38.9265 56.5276 39.1385 56.7608V55.3721H39.7534V59.0825H39.1385V58.791C38.9159 59.0242 38.6085 59.1461 38.2586 59.1461ZM37.559 57.7733C37.559 58.2503 37.8982 58.5896 38.3487 58.5896C38.7993 58.5896 39.1385 58.2503 39.1385 57.7733C39.1385 57.3015 38.7993 56.957 38.3487 56.957C37.8982 56.957 37.559 57.2962 37.559 57.7733ZM41.559 59.1461C40.7745 59.1461 40.1702 58.579 40.1702 57.7733C40.1702 56.9729 40.7798 56.4004 41.559 56.4004C42.3382 56.4004 42.9477 56.9729 42.9477 57.7733C42.9477 58.579 42.3382 59.1461 41.559 59.1461ZM40.7851 57.7733C40.7851 58.245 41.1084 58.5896 41.559 58.5896C42.0042 58.5896 42.3329 58.245 42.3329 57.7733C42.3329 57.3015 42.0042 56.957 41.559 56.957C41.1084 56.957 40.7851 57.3015 40.7851 57.7733ZM44.5861 59.0825V56.464H45.201V56.7184C45.3653 56.5117 45.625 56.4004 45.9536 56.4004C46.5367 56.4004 46.9449 56.8086 46.9449 57.3969V59.0825H46.33V57.5612C46.33 57.1902 46.118 56.957 45.7734 56.957C45.4236 56.957 45.201 57.1955 45.201 57.5612V59.0825H44.5861ZM48.7372 59.1461C47.9527 59.1461 47.3484 58.579 47.3484 57.7733C47.3484 56.9729 47.958 56.4004 48.7372 56.4004C49.5164 56.4004 50.1259 56.9729 50.1259 57.7733C50.1259 58.579 49.5164 59.1461 48.7372 59.1461ZM47.9633 57.7733C47.9633 58.245 48.2866 58.5896 48.7372 58.5896C49.1824 58.5896 49.5111 58.245 49.5111 57.7733C49.5111 57.3015 49.1824 56.957 48.7372 56.957C48.2866 56.957 47.9633 57.3015 47.9633 57.7733ZM51.6924 59.1143C51.1517 59.1143 50.7966 58.7804 50.7966 58.2662V56.9888H50.2983V56.464H50.5104C50.7224 56.464 50.7966 56.3368 50.7966 55.9764V55.7643H51.4115V56.464H52.0846V56.9888H51.4115V58.2291C51.4115 58.4676 51.544 58.6055 51.7719 58.6055C51.8938 58.6055 52.0157 58.579 52.1164 58.5472L52.2013 59.0295C52.0475 59.0825 51.8726 59.1143 51.6924 59.1143ZM55.0089 59.1461C54.2191 59.1461 53.6466 58.579 53.6466 57.7786C53.6466 56.9729 54.2244 56.4004 55.0089 56.4004C55.6344 56.4004 56.1061 56.7608 56.2227 57.222L55.6715 57.3704C55.6026 57.1584 55.364 56.957 55.0195 56.957C54.5848 56.957 54.2615 57.275 54.2615 57.7786C54.2615 58.2768 54.5848 58.5896 55.0195 58.5896C55.364 58.5896 55.6026 58.3881 55.6715 58.1814L56.2227 58.3298C56.1061 58.7857 55.6344 59.1461 55.0089 59.1461ZM56.6429 59.0825V55.3721H57.2578V59.0825H56.6429ZM59.0599 59.1461C58.2754 59.1461 57.6712 58.579 57.6712 57.7733C57.6712 56.9729 58.2807 56.4004 59.0599 56.4004C59.8391 56.4004 60.4487 56.9729 60.4487 57.7733C60.4487 58.579 59.8391 59.1461 59.0599 59.1461ZM58.286 57.7733C58.286 58.245 58.6094 58.5896 59.0599 58.5896C59.5052 58.5896 59.8338 58.245 59.8338 57.7733C59.8338 57.3015 59.5052 56.957 59.0599 56.957C58.6094 56.957 58.286 57.3015 58.286 57.7733ZM61.8765 59.1461C61.2934 59.1461 60.8163 58.8228 60.7527 58.3934L61.2775 58.2556C61.3305 58.5048 61.5584 58.6797 61.8712 58.6797C62.1203 58.6797 62.2846 58.5631 62.2846 58.3828C62.2846 58.2291 62.1733 58.1337 61.8712 58.0489L61.5478 57.9588C61.0761 57.821 60.8375 57.5824 60.8375 57.2008C60.8375 56.7237 61.2086 56.4004 61.797 56.4004C62.3376 56.4004 62.7458 56.6919 62.8571 57.1372L62.327 57.2379C62.2528 57.0206 62.0514 56.8722 61.8023 56.8722C61.569 56.8669 61.4206 56.9941 61.4206 57.1637C61.4206 57.3174 61.5319 57.4128 61.8288 57.487L62.1574 57.5718C62.6186 57.6991 62.8677 57.927 62.8677 58.3298C62.8677 58.8175 62.4648 59.1461 61.8765 59.1461ZM64.5597 59.1461C63.7752 59.1461 63.171 58.579 63.171 57.7733C63.171 56.9676 63.7646 56.4004 64.5332 56.4004C65.2912 56.4004 65.8319 56.9146 65.8319 57.6991C65.8319 57.7945 65.8213 57.8952 65.816 57.9429H63.7911C63.8336 58.351 64.1463 58.6267 64.5597 58.6267C64.899 58.6267 65.1428 58.4358 65.2276 58.2185L65.7789 58.3669C65.6411 58.8069 65.1746 59.1461 64.5597 59.1461ZM63.8124 57.4923H65.2382C65.1958 57.1372 64.899 56.9252 64.5385 56.9252C64.1834 56.9252 63.8972 57.1319 63.8124 57.4923ZM68.6447 59.1143C68.104 59.1143 67.7489 58.7804 67.7489 58.2662V56.9888H67.2506V56.464H67.4626C67.6746 56.464 67.7489 56.3368 67.7489 55.9764V55.7643H68.3637V56.464H69.0369V56.9888H68.3637V58.2291C68.3637 58.4676 68.4962 58.6055 68.7242 58.6055C68.8461 58.6055 68.968 58.579 69.0687 58.5472L69.1535 59.0295C68.9998 59.0825 68.8249 59.1143 68.6447 59.1143ZM69.5137 59.0825V55.3721H70.1286V56.7661C70.2929 56.5276 70.5526 56.4004 70.8813 56.4004C71.4643 56.4004 71.8725 56.8086 71.8725 57.3969V59.0825H71.2576V57.5612C71.2576 57.1902 71.0456 56.957 70.701 56.957C70.3512 56.957 70.1286 57.1955 70.1286 57.5612V59.0825H69.5137ZM72.3983 59.0825V56.464H73.0132V59.0825H72.3983ZM72.2976 55.7219C72.2976 55.4993 72.4778 55.3138 72.7058 55.3138C72.939 55.3138 73.1192 55.4993 73.1192 55.7219C73.1192 55.9499 72.939 56.1354 72.7058 56.1354C72.4778 56.1354 72.2976 55.9499 72.2976 55.7219ZM74.5764 59.1461C73.9934 59.1461 73.5163 58.8228 73.4527 58.3934L73.9775 58.2556C74.0305 58.5048 74.2584 58.6797 74.5711 58.6797C74.8203 58.6797 74.9846 58.5631 74.9846 58.3828C74.9846 58.2291 74.8733 58.1337 74.5711 58.0489L74.2478 57.9588C73.776 57.821 73.5375 57.5824 73.5375 57.2008C73.5375 56.7237 73.9085 56.4004 74.4969 56.4004C75.0376 56.4004 75.4457 56.6919 75.557 57.1372L75.027 57.2379C74.9528 57.0206 74.7513 56.8722 74.5022 56.8722C74.269 56.8669 74.1206 56.9941 74.1206 57.1637C74.1206 57.3174 74.2319 57.4128 74.5287 57.487L74.8574 57.5718C75.3185 57.6991 75.5676 57.927 75.5676 58.3298C75.5676 58.8175 75.1648 59.1461 74.5764 59.1461ZM78.3825 59.1143C77.8418 59.1143 77.4867 58.7804 77.4867 58.2662V56.9888H76.9884V56.464H77.2004C77.4125 56.464 77.4867 56.3368 77.4867 55.9764V55.7643H78.1015V56.464H78.7747V56.9888H78.1015V58.2291C78.1015 58.4676 78.2341 58.6055 78.462 58.6055C78.5839 58.6055 78.7058 58.579 78.8065 58.5472L78.8913 59.0295C78.7376 59.0825 78.5627 59.1143 78.3825 59.1143ZM80.0678 59.1461C79.5537 59.1461 79.1455 58.8599 79.1455 58.3722C79.1455 57.9323 79.4317 57.662 79.9671 57.5771L80.8576 57.4393V57.3651C80.8576 57.0789 80.6403 56.9252 80.3169 56.9252C79.9989 56.9252 79.7604 57.1001 79.6438 57.3704L79.1667 57.1266C79.331 56.6813 79.7657 56.4004 80.3169 56.4004C81.006 56.4004 81.4725 56.8033 81.4725 57.3651V59.0825H80.8629V58.8281C80.6827 59.0295 80.4124 59.1461 80.0678 59.1461ZM79.7445 58.3404C79.7445 58.5631 79.93 58.685 80.2056 58.6797C80.5926 58.6744 80.8576 58.4517 80.8576 58.0701V57.8793L80.0837 58.0012C79.877 58.0383 79.7445 58.1602 79.7445 58.3404ZM83.4859 59.1461C83.136 59.1461 82.8286 59.0242 82.606 58.791V59.0825H81.9911V55.3721H82.606V56.7608C82.818 56.5276 83.1254 56.4004 83.4859 56.4004C84.2438 56.4004 84.8004 56.9676 84.8004 57.7733C84.8004 58.5843 84.2438 59.1461 83.4859 59.1461ZM82.606 57.7733C82.606 58.2503 82.9452 58.5896 83.3957 58.5896C83.8463 58.5896 84.1855 58.2503 84.1855 57.7733C84.1855 57.2962 83.8463 56.957 83.3957 56.957C82.9452 56.957 82.606 57.3015 82.606 57.7733ZM85.3637 59.1143C85.1411 59.1143 84.9714 58.9394 84.9714 58.7221C84.9714 58.5101 85.1411 58.3298 85.3637 58.3298C85.5863 58.3298 85.7559 58.5101 85.7559 58.7221C85.7559 58.9394 85.5863 59.1143 85.3637 59.1143Z",fill:"#FF4500"}),s.jsx("path",{d:"M40.2522 49.5017C38.9037 49.5017 38.0556 48.5942 37.9538 47.7885L38.8613 47.5341C38.9631 47.9836 39.4295 48.5688 40.2437 48.5688C40.8458 48.5688 41.3038 48.2804 41.3038 47.7716C41.3038 47.3305 40.9307 47.0931 40.4133 46.9489L39.6246 46.7199C38.6917 46.4485 38.1234 45.9312 38.1234 45.0831C38.1234 44.0314 38.9885 43.3614 40.108 43.3614C41.3802 43.3614 42.0756 44.0908 42.2282 44.8795L41.3123 45.134C41.219 44.7269 40.8543 44.2943 40.1504 44.2943C39.5652 44.2943 39.1581 44.5912 39.1581 45.0661C39.1581 45.5071 39.4804 45.7107 40.0317 45.8633L40.8204 46.0838C41.8381 46.3807 42.3385 46.9319 42.3385 47.7546C42.3385 48.8232 41.4141 49.5017 40.2522 49.5017ZM44.6365 49.5017C43.6951 49.5017 43.0421 48.8317 43.0421 47.8055V45.2103H44.0259V47.6528C44.0259 48.2634 44.3821 48.6112 44.9249 48.6112C45.4761 48.6112 45.8323 48.2041 45.8323 47.5765V45.2103H46.8161V49.3999H45.8323V48.8995C45.5609 49.2896 45.1539 49.5017 44.6365 49.5017ZM49.5742 49.5017C48.3105 49.5017 47.3946 48.5942 47.3946 47.3136C47.3946 46.0245 48.319 45.1085 49.5742 45.1085C50.5749 45.1085 51.3297 45.6852 51.5163 46.4231L50.6343 46.6605C50.5241 46.3213 50.1424 45.999 49.5911 45.999C48.8957 45.999 48.3784 46.5079 48.3784 47.3136C48.3784 48.1108 48.8957 48.6112 49.5911 48.6112C50.1424 48.6112 50.5241 48.2889 50.6343 47.9581L51.5163 48.1956C51.3297 48.925 50.5749 49.5017 49.5742 49.5017ZM54.0797 49.5017C52.816 49.5017 51.9001 48.5942 51.9001 47.3136C51.9001 46.0245 52.8245 45.1085 54.0797 45.1085C55.0805 45.1085 55.8353 45.6852 56.0219 46.4231L55.1398 46.6605C55.0296 46.3213 54.6479 45.999 54.0967 45.999C53.4012 45.999 52.8839 46.5079 52.8839 47.3136C52.8839 48.1108 53.4012 48.6112 54.0967 48.6112C54.6479 48.6112 55.0296 48.2889 55.1398 47.9581L56.0219 48.1956C55.8353 48.925 55.0805 49.5017 54.0797 49.5017ZM58.6276 49.5017C57.3725 49.5017 56.4056 48.5942 56.4056 47.3051C56.4056 46.016 57.3555 45.1085 58.5852 45.1085C59.798 45.1085 60.6631 45.9312 60.6631 47.1864C60.6631 47.339 60.6461 47.5002 60.6376 47.5765H57.3979C57.4657 48.2295 57.9661 48.6705 58.6276 48.6705C59.1704 48.6705 59.5606 48.3652 59.6962 48.0175L60.5783 48.255C60.3578 48.9589 59.6114 49.5017 58.6276 49.5017ZM57.4318 46.8556H59.7132C59.6454 46.2874 59.1704 45.9481 58.5937 45.9481C58.0255 45.9481 57.5675 46.2789 57.4318 46.8556ZM62.8588 49.5017C61.9259 49.5017 61.1626 48.9843 61.0608 48.2974L61.9004 48.0769C61.9853 48.4755 62.3499 48.7553 62.8503 48.7553C63.2489 48.7553 63.5118 48.5688 63.5118 48.2804C63.5118 48.0345 63.3337 47.8818 62.8503 47.7461L62.333 47.6019C61.5782 47.3814 61.1965 46.9998 61.1965 46.3891C61.1965 45.6259 61.7902 45.1085 62.7316 45.1085C63.5966 45.1085 64.2497 45.575 64.4278 46.2874L63.5797 46.4485C63.4609 46.1008 63.1387 45.8633 62.7401 45.8633C62.3669 45.8548 62.1294 46.0584 62.1294 46.3298C62.1294 46.5757 62.3075 46.7284 62.7825 46.8471L63.3083 46.9828C64.0461 47.1864 64.4447 47.551 64.4447 48.1956C64.4447 48.9759 63.8002 49.5017 62.8588 49.5017ZM66.6686 49.5017C65.7357 49.5017 64.9724 48.9843 64.8706 48.2974L65.7103 48.0769C65.7951 48.4755 66.1598 48.7553 66.6601 48.7553C67.0587 48.7553 67.3217 48.5688 67.3217 48.2804C67.3217 48.0345 67.1436 47.8818 66.6601 47.7461L66.1428 47.6019C65.388 47.3814 65.0063 46.9998 65.0063 46.3891C65.0063 45.6259 65.6 45.1085 66.5414 45.1085C67.4065 45.1085 68.0595 45.575 68.2376 46.2874L67.3895 46.4485C67.2708 46.1008 66.9485 45.8633 66.5499 45.8633C66.1767 45.8548 65.9393 46.0584 65.9393 46.3298C65.9393 46.5757 66.1174 46.7284 66.5923 46.8471L67.1181 46.9828C67.856 47.1864 68.2546 47.551 68.2546 48.1956C68.2546 48.9759 67.61 49.5017 66.6686 49.5017Z",fill:"black"}),s.jsx("circle",{cx:"52.5332",cy:"52.5205",r:"51.9238",fill:"url(#paint0_linear_266_5356)"}),s.jsx("path",{d:"M33.2988 33.1992L72.6068 72.5072",stroke:"#FAFAFA",strokeWidth:"4",strokeLinecap:"round"}),s.jsx("path",{d:"M72.6074 33.1992L33.2995 72.5072",stroke:"#FAFAFA",strokeWidth:"4",strokeLinecap:"round"}),s.jsx("defs",{children:s.jsxs("linearGradient",{id:"paint0_linear_266_5356",x1:"52.5332",y1:"0.59668",x2:"52.5332",y2:"104.444",gradientUnits:"userSpaceOnUse",children:[s.jsx("stop",{stopColor:"#E67E75"}),s.jsx("stop",{offset:"1",stopColor:"#DF5448"})]})})]})}const r4=({onEnd:e,onShowActivity:t,id:r})=>s.jsx(st,{isStickyHeader:!1,content:s.jsxs("div",{className:"gw-w-full gw-min-h-full gw-flex gw-flex-col gw-items-center gw-rounded-6xl gw-relative",children:[s.jsx("div",{className:"gw-flex gw-justify-end gw-w-full gw-p-4 gw-relative gw-z-10",children:s.jsx("div",{className:"gw-size-12",children:s.jsx("button",{className:"gw-size-full gw-inline-flex gw-justify-center gw-items-center",onClick:e,children:s.jsx(Rt,{className:"gw-size-6"})})})}),s.jsx("div",{className:"gw-w-full gw-p-4 gw-relative gw-z-10 gw-flex-1 gw-flex-col gw-flex gw-justify-end",children:s.jsxs("div",{className:"gw-flex gw-flex-col gw-items-center gw-w-full",children:[s.jsx(Ta,{className:"gw-size-24"}),s.jsxs("span",{className:"gw-mt-7 gw-typography-h4-nr gw-text-center",children:["Transaction",s.jsx("br",{}),"failed."]}),s.jsx("span",{className:"gw-mt-3 gw-text-center gw-whitespace-pre-wrap !gw-leading-tight",children:`Your transaction failed.
56
+ ){opacity:0}[data-vaul-overlay][data-vaul-snap-points-overlay=true]{opacity:1}[data-vaul-handle]{display:block;position:relative;opacity:.7;background:#e2e2e4;margin-left:auto;margin-right:auto;height:5px;width:32px;border-radius:1rem;touch-action:pan-y}[data-vaul-handle]:active,[data-vaul-handle]:hover{opacity:1}[data-vaul-handle-hitarea]{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:max(100%,2.75rem);height:max(100%,2.75rem);touch-action:inherit}@media (hover:hover) and (pointer:fine){[data-vaul-drawer]{user-select:none}}@media (pointer:fine){[data-vaul-handle-hitarea]:{width:100%;height:100%}}@keyframes fadeIn{from{opacity:0}to{opacity:1}}@keyframes fadeOut{to{opacity:0}}@keyframes slideFromBottom{from{transform:translate3d(0,var(--initial-transform,100%),0)}to{transform:translate3d(0,0,0)}}@keyframes slideToBottom{to{transform:translate3d(0,var(--initial-transform,100%),0)}}@keyframes slideFromTop{from{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}to{transform:translate3d(0,0,0)}}@keyframes slideToTop{to{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}}@keyframes slideFromLeft{from{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToLeft{to{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}}@keyframes slideFromRight{from{transform:translate3d(var(--initial-transform,100%),0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToRight{to{transform:translate3d(var(--initial-transform,100%),0,0)}}`);function th(){const e=navigator.userAgent;return typeof window<"u"&&(/Firefox/.test(e)&&/Mobile/.test(e)||/FxiOS/.test(e))}function rh(){return qo(/^Mac/)}function nh(){return qo(/^iPhone/)}function Oc(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function sh(){return qo(/^iPad/)||rh()&&navigator.maxTouchPoints>1}function Lc(){return nh()||sh()}function qo(e){return typeof window<"u"&&window.navigator!=null?e.test(window.navigator.platform):void 0}const oh=24,ah=typeof window<"u"?w.useLayoutEffect:w.useEffect;function Mc(...e){return(...t)=>{for(let r of e)typeof r=="function"&&r(...t)}}const Zo=typeof document<"u"&&window.visualViewport;function Dc(e){let t=window.getComputedStyle(e);return/(auto|scroll)/.test(t.overflow+t.overflowX+t.overflowY)}function Fc(e){for(Dc(e)&&(e=e.parentElement);e&&!Dc(e);)e=e.parentElement;return e||document.scrollingElement||document.documentElement}const ih=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);let gs=0,Yo;function lh(e={}){let{isDisabled:t}=e;ah(()=>{if(!t)return gs++,gs===1&&Lc()&&(Yo=ch()),()=>{gs--,gs===0&&Yo?.()}},[t])}function ch(){let e,t=0,r=d=>{e=Fc(d.target),!(e===document.documentElement&&e===document.body)&&(t=d.changedTouches[0].pageY)},n=d=>{if(!e||e===document.documentElement||e===document.body){d.preventDefault();return}let g=d.changedTouches[0].pageY,h=e.scrollTop,v=e.scrollHeight-e.clientHeight;v!==0&&((h<=0&&g>t||h>=v&&g<t)&&d.preventDefault(),t=g)},o=d=>{let g=d.target;Ko(g)&&g!==document.activeElement&&(d.preventDefault(),g.style.transform="translateY(-2000px)",g.focus(),requestAnimationFrame(()=>{g.style.transform=""}))},a=d=>{let g=d.target;Ko(g)&&(g.style.transform="translateY(-2000px)",requestAnimationFrame(()=>{g.style.transform="",Zo&&(Zo.height<window.innerHeight?requestAnimationFrame(()=>{Uc(g)}):Zo.addEventListener("resize",()=>Uc(g),{once:!0}))}))},i=()=>{window.scrollTo(0,0)},l=window.pageXOffset,c=window.pageYOffset,u=Mc(dh(document.documentElement,"paddingRight",`${window.innerWidth-document.documentElement.clientWidth}px`));window.scrollTo(0,0);let f=Mc(Tn(document,"touchstart",r,{passive:!1,capture:!0}),Tn(document,"touchmove",n,{passive:!1,capture:!0}),Tn(document,"touchend",o,{passive:!1,capture:!0}),Tn(document,"focus",a,!0),Tn(window,"scroll",i));return()=>{u(),f(),window.scrollTo(l,c)}}function dh(e,t,r){let n=e.style[t];return e.style[t]=r,()=>{e.style[t]=n}}function Tn(e,t,r,n){return e.addEventListener(t,r,n),()=>{e.removeEventListener(t,r,n)}}function Uc(e){let t=document.scrollingElement||document.documentElement;for(;e&&e!==t;){let r=Fc(e);if(r!==document.documentElement&&r!==document.body&&r!==e){let n=r.getBoundingClientRect().top,o=e.getBoundingClientRect().top,a=e.getBoundingClientRect().bottom;const i=r.getBoundingClientRect().bottom+oh;a>i&&(r.scrollTop+=o-n)}e=r.parentElement}}function Ko(e){return e instanceof HTMLInputElement&&!ih.has(e.type)||e instanceof HTMLTextAreaElement||e instanceof HTMLElement&&e.isContentEditable}function uh(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function fh(...e){return t=>e.forEach(r=>uh(r,t))}function Bc(...e){return S.useCallback(fh(...e),e)}const Hc=new WeakMap;function je(e,t,r=!1){if(!e||!(e instanceof HTMLElement))return;let n={};Object.entries(t).forEach(([o,a])=>{if(o.startsWith("--")){e.style.setProperty(o,a);return}n[o]=e.style[o],e.style[o]=a}),!r&&Hc.set(e,n)}function gh(e,t){if(!e||!(e instanceof HTMLElement))return;let r=Hc.get(e);r&&(e.style[t]=r[t])}const Ve=e=>{switch(e){case"top":case"bottom":return!0;case"left":case"right":return!1;default:return e}};function ws(e,t){if(!e)return null;const r=window.getComputedStyle(e),n=r.transform||r.webkitTransform||r.mozTransform;let o=n.match(/^matrix3d\((.+)\)$/);return o?parseFloat(o[1].split(", ")[Ve(t)?13:12]):(o=n.match(/^matrix\((.+)\)$/),o?parseFloat(o[1].split(", ")[Ve(t)?5:4]):null)}function wh(e){return 8*(Math.log(e+1)-2)}function Xo(e,t){if(!e)return()=>{};const r=e.style.cssText;return Object.assign(e.style,t),()=>{e.style.cssText=r}}function hh(...e){return(...t)=>{for(const r of e)typeof r=="function"&&r(...t)}}const Ie={DURATION:.5,EASE:[.32,.72,0,1]},$c=.4,ph=.25,mh=100,Vc=8,kr=16,Qo=26,Jo="vaul-dragging";function zc(e){const t=w.useRef(e);return w.useEffect(()=>{t.current=e}),w.useMemo(()=>(...r)=>t.current==null?void 0:t.current.call(t,...r),[])}function yh({defaultProp:e,onChange:t}){const r=w.useState(e),[n]=r,o=w.useRef(n),a=zc(t);return w.useEffect(()=>{o.current!==n&&(a(n),o.current=n)},[n,o,a]),r}function Wc({prop:e,defaultProp:t,onChange:r=()=>{}}){const[n,o]=yh({defaultProp:t,onChange:r}),a=e!==void 0,i=a?e:n,l=zc(r),c=w.useCallback(u=>{if(a){const d=typeof u=="function"?u(e):u;d!==e&&l(d)}else o(u)},[a,e,o,l]);return[i,c]}function bh({activeSnapPointProp:e,setActiveSnapPointProp:t,snapPoints:r,drawerRef:n,overlayRef:o,fadeFromIndex:a,onSnapPointChange:i,direction:l="bottom",container:c,snapToSequentialPoint:u}){const[f,d]=Wc({prop:e,defaultProp:r?.[0],onChange:t}),[g,h]=w.useState(typeof window<"u"?{innerWidth:window.innerWidth,innerHeight:window.innerHeight}:void 0);w.useEffect(()=>{function T(){h({innerWidth:window.innerWidth,innerHeight:window.innerHeight})}return window.addEventListener("resize",T),()=>window.removeEventListener("resize",T)},[]);const v=w.useMemo(()=>f===r?.[r.length-1]||null,[r,f]),m=w.useMemo(()=>{var T;return(T=r?.findIndex(D=>D===f))!=null?T:null},[r,f]),b=r&&r.length>0&&(a||a===0)&&!Number.isNaN(a)&&r[a]===f||!r,p=w.useMemo(()=>{const T=c?{width:c.getBoundingClientRect().width,height:c.getBoundingClientRect().height}:typeof window<"u"?{width:window.innerWidth,height:window.innerHeight}:{width:0,height:0};var D;return(D=r?.map(L=>{const A=typeof L=="string";let O=0;if(A&&(O=parseInt(L,10)),Ve(l)){const E=A?O:g?L*T.height:0;return g?l==="bottom"?T.height-E:-T.height+E:E}const F=A?O:g?L*T.width:0;return g?l==="right"?T.width-F:-T.width+F:F}))!=null?D:[]},[r,g,c]),x=w.useMemo(()=>m!==null?p?.[m]:null,[p,m]),C=w.useCallback(T=>{var D;const L=(D=p?.findIndex(A=>A===T))!=null?D:null;i(L),je(n.current,{transition:`transform ${Ie.DURATION}s cubic-bezier(${Ie.EASE.join(",")})`,transform:Ve(l)?`translate3d(0, ${T}px, 0)`:`translate3d(${T}px, 0, 0)`}),p&&L!==p.length-1&&a!==void 0&&L!==a&&L<a?je(o.current,{transition:`opacity ${Ie.DURATION}s cubic-bezier(${Ie.EASE.join(",")})`,opacity:"0"}):je(o.current,{transition:`opacity ${Ie.DURATION}s cubic-bezier(${Ie.EASE.join(",")})`,opacity:"1"}),d(r?.[Math.max(L,0)])},[n.current,r,p,a,o,d]);w.useEffect(()=>{if(f||e){var T;const D=(T=r?.findIndex(L=>L===e||L===f))!=null?T:-1;p&&D!==-1&&typeof p[D]=="number"&&C(p[D])}},[f,e,r,p,C]);function y({draggedDistance:T,closeDrawer:D,velocity:L,dismissible:A}){if(a===void 0)return;const O=l==="bottom"||l==="right"?(x??0)-T:(x??0)+T,F=m===a-1,E=m===0,I=T>0;if(F&&je(o.current,{transition:`opacity ${Ie.DURATION}s cubic-bezier(${Ie.EASE.join(",")})`}),!u&&L>2&&!I){A?D():C(p[0]);return}if(!u&&L>2&&I&&p&&r){C(p[r.length-1]);return}const _=p?.reduce((H,U)=>typeof H!="number"||typeof U!="number"?H:Math.abs(U-O)<Math.abs(H-O)?U:H),M=Ve(l)?window.innerHeight:window.innerWidth;if(L>$c&&Math.abs(T)<M*.4){const H=I?1:-1;if(H>0&&v&&r){C(p[r.length-1]);return}if(E&&H<0&&A&&D(),m===null)return;C(p[m+H]);return}C(_)}function N({draggedDistance:T}){if(x===null)return;const D=l==="bottom"||l==="right"?x-T:x+T;(l==="bottom"||l==="right")&&D<p[p.length-1]||(l==="top"||l==="left")&&D>p[p.length-1]||je(n.current,{transform:Ve(l)?`translate3d(0, ${D}px, 0)`:`translate3d(${D}px, 0, 0)`})}function P(T,D){if(!r||typeof m!="number"||!p||a===void 0)return null;const L=m===a-1;if(m>=a&&D)return 0;if(L&&!D)return 1;if(!b&&!L)return null;const O=L?m+1:m-1,F=L?p[O]-p[O-1]:p[O+1]-p[O],E=T/Math.abs(F);return L?1-E:E}return{isLastSnapPoint:v,activeSnapPoint:f,shouldFade:b,getPercentageDragged:P,setActiveSnapPoint:d,activeSnapPointIndex:m,onRelease:y,onDrag:N,snapPointsOffset:p}}const vh=()=>()=>{};function Ch(){const{direction:e,isOpen:t,shouldScaleBackground:r,setBackgroundColorOnScale:n,noBodyStyles:o}=An(),a=w.useRef(null),i=w.useMemo(()=>document.body.style.backgroundColor,[]);function l(){return(window.innerWidth-Qo)/window.innerWidth}w.useEffect(()=>{if(t&&r){a.current&&clearTimeout(a.current);const c=document.querySelector("[data-vaul-drawer-wrapper]")||document.querySelector("[vaul-drawer-wrapper]");if(!c)return;hh(n&&!o?Xo(document.body,{background:"black"}):vh,Xo(c,{transformOrigin:Ve(e)?"top":"left",transitionProperty:"transform, border-radius",transitionDuration:`${Ie.DURATION}s`,transitionTimingFunction:`cubic-bezier(${Ie.EASE.join(",")})`}));const u=Xo(c,{borderRadius:`${Vc}px`,overflow:"hidden",...Ve(e)?{transform:`scale(${l()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`}:{transform:`scale(${l()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`}});return()=>{u(),a.current=window.setTimeout(()=>{i?document.body.style.background=i:document.body.style.removeProperty("background")},Ie.DURATION*1e3)}}},[t,r,i])}let kn=null;function xh({isOpen:e,modal:t,nested:r,hasBeenOpened:n,preventScrollRestoration:o,noBodyStyles:a}){const[i,l]=w.useState(()=>typeof window<"u"?window.location.href:""),c=w.useRef(0),u=w.useCallback(()=>{if(Oc()&&kn===null&&e&&!a){kn={position:document.body.style.position,top:document.body.style.top,left:document.body.style.left,height:document.body.style.height,right:"unset"};const{scrollX:d,innerHeight:g}=window;document.body.style.setProperty("position","fixed","important"),Object.assign(document.body.style,{top:`${-c.current}px`,left:`${-d}px`,right:"0px",height:"auto"}),window.setTimeout(()=>window.requestAnimationFrame(()=>{const h=g-window.innerHeight;h&&c.current>=g&&(document.body.style.top=`${-(c.current+h)}px`)}),300)}},[e]),f=w.useCallback(()=>{if(Oc()&&kn!==null&&!a){const d=-parseInt(document.body.style.top,10),g=-parseInt(document.body.style.left,10);Object.assign(document.body.style,kn),window.requestAnimationFrame(()=>{if(o&&i!==window.location.href){l(window.location.href);return}window.scrollTo(g,d)}),kn=null}},[i]);return w.useEffect(()=>{function d(){c.current=window.scrollY}return d(),window.addEventListener("scroll",d),()=>{window.removeEventListener("scroll",d)}},[]),w.useEffect(()=>{if(t)return()=>{typeof document>"u"||document.querySelector("[data-vaul-drawer]")||f()}},[t,f]),w.useEffect(()=>{r||!n||(e?(!window.matchMedia("(display-mode: standalone)").matches&&u(),t||window.setTimeout(()=>{f()},500)):f())},[e,n,i,t,r,u,f]),{restorePositionSetting:f}}function Eh({open:e,onOpenChange:t,children:r,onDrag:n,onRelease:o,snapPoints:a,shouldScaleBackground:i=!1,setBackgroundColorOnScale:l=!0,closeThreshold:c=ph,scrollLockTimeout:u=mh,dismissible:f=!0,handleOnly:d=!1,fadeFromIndex:g=a&&a.length-1,activeSnapPoint:h,setActiveSnapPoint:v,fixed:m,modal:b=!0,onClose:p,nested:x,noBodyStyles:C=!1,direction:y="bottom",defaultOpen:N=!1,disablePreventScroll:P=!0,snapToSequentialPoint:T=!1,preventScrollRestoration:D=!1,repositionInputs:L=!0,onAnimationEnd:A,container:O,autoFocus:F=!1}){var E,I;const[_=!1,M]=Wc({defaultProp:N,prop:e,onChange:R=>{t?.(R),!R&&!x&&it(),setTimeout(()=>{A?.(R)},Ie.DURATION*1e3),R&&!b&&typeof window<"u"&&window.requestAnimationFrame(()=>{document.body.style.pointerEvents="auto"}),R||(document.body.style.pointerEvents="auto")}}),[H,U]=w.useState(!1),[j,re]=w.useState(!1),[oe,we]=w.useState(!1),J=w.useRef(null),G=w.useRef(null),z=w.useRef(null),ce=w.useRef(null),Y=w.useRef(null),K=w.useRef(!1),xe=w.useRef(null),Ke=w.useRef(0),ze=w.useRef(!1),ie=w.useRef(!N),Oe=w.useRef(0),X=w.useRef(null),wt=w.useRef(((E=X.current)==null?void 0:E.getBoundingClientRect().height)||0),Xe=w.useRef(((I=X.current)==null?void 0:I.getBoundingClientRect().width)||0),_e=w.useRef(0),ne=w.useCallback(R=>{a&&R===q.length-1&&(G.current=new Date)},[]),{activeSnapPoint:de,activeSnapPointIndex:Le,setActiveSnapPoint:tt,onRelease:Me,snapPointsOffset:q,onDrag:ae,shouldFade:Nt,getPercentageDragged:Qe}=bh({snapPoints:a,activeSnapPointProp:h,setActiveSnapPointProp:v,drawerRef:X,fadeFromIndex:g,overlayRef:J,onSnapPointChange:ne,direction:y,container:O,snapToSequentialPoint:T});lh({isDisabled:!_||j||!b||oe||!H||!L||!P});const{restorePositionSetting:it}=xh({isOpen:_,modal:b,nested:x??!1,hasBeenOpened:H,preventScrollRestoration:D,noBodyStyles:C});function We(){return(window.innerWidth-Qo)/window.innerWidth}function ht(R){var B,Q;!f&&!a||X.current&&!X.current.contains(R.target)||(wt.current=((B=X.current)==null?void 0:B.getBoundingClientRect().height)||0,Xe.current=((Q=X.current)==null?void 0:Q.getBoundingClientRect().width)||0,re(!0),z.current=new Date,Lc()&&window.addEventListener("touchend",()=>K.current=!1,{once:!0}),R.target.setPointerCapture(R.pointerId),Ke.current=Ve(y)?R.pageY:R.pageX)}function pt(R,B){var Q;let se=R;const ye=(Q=window.getSelection())==null?void 0:Q.toString(),ee=X.current?ws(X.current,y):null,he=new Date;if(se.tagName==="SELECT"||se.hasAttribute("data-vaul-no-drag")||se.closest("[data-vaul-no-drag]"))return!1;if(y==="right"||y==="left")return!0;if(G.current&&he.getTime()-G.current.getTime()<500)return!1;if(ee!==null&&(y==="bottom"?ee>0:ee<0))return!0;if(ye&&ye.length>0)return!1;if(Y.current&&he.getTime()-Y.current.getTime()<u&&ee===0||B)return Y.current=he,!1;for(;se;){if(se.scrollHeight>se.clientHeight){if(se.scrollTop!==0)return Y.current=new Date,!1;if(se.getAttribute("role")==="dialog")return!0}se=se.parentNode}return!0}function St(R){if(X.current&&j){const B=y==="bottom"||y==="right"?1:-1,Q=(Ke.current-(Ve(y)?R.pageY:R.pageX))*B,se=Q>0,ye=a&&!f&&!se;if(ye&&Le===0)return;const ee=Math.abs(Q),he=document.querySelector("[data-vaul-drawer-wrapper]"),ke=y==="bottom"||y==="top"?wt.current:Xe.current;let Pe=ee/ke;const Tt=Qe(ee,se);if(Tt!==null&&(Pe=Tt),ye&&Pe>=1||!K.current&&!pt(R.target,se))return;if(X.current.classList.add(Jo),K.current=!0,je(X.current,{transition:"none"}),je(J.current,{transition:"none"}),a&&ae({draggedDistance:Q}),se&&!a){const De=wh(Q),nr=Math.min(De*-1,0)*B;je(X.current,{transform:Ve(y)?`translate3d(0, ${nr}px, 0)`:`translate3d(${nr}px, 0, 0)`});return}const Ae=1-Pe;if((Nt||g&&Le===g-1)&&(n?.(R,Pe),je(J.current,{opacity:`${Ae}`,transition:"none"},!0)),he&&J.current&&i){const De=Math.min(We()+Pe*(1-We()),1),nr=8-Pe*8,mt=Math.max(0,14-Pe*14);je(he,{borderRadius:`${nr}px`,transform:Ve(y)?`scale(${De}) translate3d(0, ${mt}px, 0)`:`scale(${De}) translate3d(${mt}px, 0, 0)`,transition:"none"},!0)}if(!a){const De=ee*B;je(X.current,{transform:Ve(y)?`translate3d(0, ${De}px, 0)`:`translate3d(${De}px, 0, 0)`})}}}w.useEffect(()=>{window.requestAnimationFrame(()=>{ie.current=!0})},[]),w.useEffect(()=>{var R;function B(){if(!X.current||!L)return;const Q=document.activeElement;if(Ko(Q)||ze.current){var se;const ye=((se=window.visualViewport)==null?void 0:se.height)||0,ee=window.innerHeight;let he=ee-ye;const ke=X.current.getBoundingClientRect().height||0,Pe=ke>ee*.8;_e.current||(_e.current=ke);const Tt=X.current.getBoundingClientRect().top;if(Math.abs(Oe.current-he)>60&&(ze.current=!ze.current),a&&a.length>0&&q&&Le){const Ae=q[Le]||0;he+=Ae}if(Oe.current=he,ke>ye||ze.current){const Ae=X.current.getBoundingClientRect().height;let De=Ae;Ae>ye&&(De=ye-(Pe?Tt:Qo)),m?X.current.style.height=`${Ae-Math.max(he,0)}px`:X.current.style.height=`${Math.max(De,ye-Tt)}px`}else th()||(X.current.style.height=`${_e.current}px`);a&&a.length>0&&!ze.current?X.current.style.bottom="0px":X.current.style.bottom=`${Math.max(he,0)}px`}}return(R=window.visualViewport)==null||R.addEventListener("resize",B),()=>{var Q;return(Q=window.visualViewport)==null?void 0:Q.removeEventListener("resize",B)}},[Le,a,q]);function Se(R){Je(),p?.(),R||M(!1),setTimeout(()=>{a&&tt(a[0])},Ie.DURATION*1e3)}function Mt(){if(!X.current)return;const R=document.querySelector("[data-vaul-drawer-wrapper]"),B=ws(X.current,y);je(X.current,{transform:"translate3d(0, 0, 0)",transition:`transform ${Ie.DURATION}s cubic-bezier(${Ie.EASE.join(",")})`}),je(J.current,{transition:`opacity ${Ie.DURATION}s cubic-bezier(${Ie.EASE.join(",")})`,opacity:"1"}),i&&B&&B>0&&_&&je(R,{borderRadius:`${Vc}px`,overflow:"hidden",...Ve(y)?{transform:`scale(${We()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`,transformOrigin:"top"}:{transform:`scale(${We()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`,transformOrigin:"left"},transitionProperty:"transform, border-radius",transitionDuration:`${Ie.DURATION}s`,transitionTimingFunction:`cubic-bezier(${Ie.EASE.join(",")})`},!0)}function Je(){!j||!X.current||(X.current.classList.remove(Jo),K.current=!1,re(!1),ce.current=new Date)}function Or(R){if(!j||!X.current)return;X.current.classList.remove(Jo),K.current=!1,re(!1),ce.current=new Date;const B=ws(X.current,y);if(!R||!pt(R.target,!1)||!B||Number.isNaN(B)||z.current===null)return;const Q=ce.current.getTime()-z.current.getTime(),se=Ke.current-(Ve(y)?R.pageY:R.pageX),ye=Math.abs(se)/Q;if(ye>.05&&(we(!0),setTimeout(()=>{we(!1)},200)),a){Me({draggedDistance:se*(y==="bottom"||y==="right"?1:-1),closeDrawer:Se,velocity:ye,dismissible:f}),o?.(R,!0);return}if(y==="bottom"||y==="right"?se>0:se<0){Mt(),o?.(R,!0);return}if(ye>$c){Se(),o?.(R,!1);return}var ee;const he=Math.min((ee=X.current.getBoundingClientRect().height)!=null?ee:0,window.innerHeight);var ke;const Pe=Math.min((ke=X.current.getBoundingClientRect().width)!=null?ke:0,window.innerWidth),Tt=y==="left"||y==="right";if(Math.abs(B)>=(Tt?Pe:he)*c){Se(),o?.(R,!1);return}o?.(R,!0),Mt()}w.useEffect(()=>(_&&(je(document.documentElement,{scrollBehavior:"auto"}),G.current=new Date),()=>{gh(document.documentElement,"scrollBehavior")}),[_]);function Lr(R){const B=R?(window.innerWidth-kr)/window.innerWidth:1,Q=R?-kr:0;xe.current&&window.clearTimeout(xe.current),je(X.current,{transition:`transform ${Ie.DURATION}s cubic-bezier(${Ie.EASE.join(",")})`,transform:Ve(y)?`scale(${B}) translate3d(0, ${Q}px, 0)`:`scale(${B}) translate3d(${Q}px, 0, 0)`}),!R&&X.current&&(xe.current=setTimeout(()=>{const se=ws(X.current,y);je(X.current,{transition:"none",transform:Ve(y)?`translate3d(0, ${se}px, 0)`:`translate3d(${se}px, 0, 0)`})},500))}function Un(R,B){if(B<0)return;const Q=(window.innerWidth-kr)/window.innerWidth,se=Q+B*(1-Q),ye=-kr+B*kr;je(X.current,{transform:Ve(y)?`scale(${se}) translate3d(0, ${ye}px, 0)`:`scale(${se}) translate3d(${ye}px, 0, 0)`,transition:"none"})}function pr(R,B){const Q=Ve(y)?window.innerHeight:window.innerWidth,se=B?(Q-kr)/Q:1,ye=B?-kr:0;B&&je(X.current,{transition:`transform ${Ie.DURATION}s cubic-bezier(${Ie.EASE.join(",")})`,transform:Ve(y)?`scale(${se}) translate3d(0, ${ye}px, 0)`:`scale(${se}) translate3d(${ye}px, 0, 0)`})}return w.useEffect(()=>{b||window.requestAnimationFrame(()=>{document.body.style.pointerEvents="auto"})},[b]),w.createElement(kc,{defaultOpen:N,onOpenChange:R=>{!f&&!R||(R?U(!0):Se(!0),M(R))},open:_},w.createElement(Ic.Provider,{value:{activeSnapPoint:de,snapPoints:a,setActiveSnapPoint:tt,drawerRef:X,overlayRef:J,onOpenChange:t,onPress:ht,onRelease:Or,onDrag:St,dismissible:f,shouldAnimate:ie,handleOnly:d,isOpen:_,isDragging:j,shouldFade:Nt,closeDrawer:Se,onNestedDrag:Un,onNestedOpenChange:Lr,onNestedRelease:pr,keyboardIsOpen:ze,modal:b,snapPointsOffset:q,activeSnapPointIndex:Le,direction:y,shouldScaleBackground:i,setBackgroundColorOnScale:l,noBodyStyles:C,container:O,autoFocus:F}},r))}const jc=w.forwardRef(function({...e},t){const{overlayRef:r,snapPoints:n,onRelease:o,shouldFade:a,isOpen:i,modal:l,shouldAnimate:c}=An(),u=Bc(t,r),f=n&&n.length>0;if(!l)return null;const d=w.useCallback(g=>o(g),[o]);return w.createElement(zo,{onMouseUp:d,ref:u,"data-vaul-overlay":"","data-vaul-snap-points":i&&f?"true":"false","data-vaul-snap-points-overlay":i&&a?"true":"false","data-vaul-animate":c?.current?"true":"false",...e})});jc.displayName="Drawer.Overlay";const Gc=w.forwardRef(function({onPointerDownOutside:e,style:t,onOpenAutoFocus:r,...n},o){const{drawerRef:a,onPress:i,onRelease:l,onDrag:c,keyboardIsOpen:u,snapPointsOffset:f,activeSnapPointIndex:d,modal:g,isOpen:h,direction:v,snapPoints:m,container:b,handleOnly:p,shouldAnimate:x,autoFocus:C}=An(),[y,N]=w.useState(!1),P=Bc(o,a),T=w.useRef(null),D=w.useRef(null),L=w.useRef(!1),A=m&&m.length>0;Ch();const O=(E,I,_=0)=>{if(L.current)return!0;const M=Math.abs(E.y),H=Math.abs(E.x),U=H>M,j=["bottom","right"].includes(I)?1:-1;if(I==="left"||I==="right"){if(!(E.x*j<0)&&H>=0&&H<=_)return U}else if(!(E.y*j<0)&&M>=0&&M<=_)return!U;return L.current=!0,!0};w.useEffect(()=>{A&&window.requestAnimationFrame(()=>{N(!0)})},[]);function F(E){T.current=null,L.current=!1,l(E)}return w.createElement(Wo,{"data-vaul-drawer-direction":v,"data-vaul-drawer":"","data-vaul-delayed-snap-points":y?"true":"false","data-vaul-snap-points":h&&A?"true":"false","data-vaul-custom-container":b?"true":"false","data-vaul-animate":x?.current?"true":"false",...n,ref:P,style:f&&f.length>0?{"--snap-point-height":`${f[d??0]}px`,...t}:t,onPointerDown:E=>{p||(n.onPointerDown==null||n.onPointerDown.call(n,E),T.current={x:E.pageX,y:E.pageY},i(E))},onOpenAutoFocus:E=>{r?.(E),C||E.preventDefault()},onPointerDownOutside:E=>{if(e?.(E),!g||E.defaultPrevented){E.preventDefault();return}u.current&&(u.current=!1)},onFocusOutside:E=>{if(!g){E.preventDefault();return}},onPointerMove:E=>{if(D.current=E,p||(n.onPointerMove==null||n.onPointerMove.call(n,E),!T.current))return;const I=E.pageY-T.current.y,_=E.pageX-T.current.x,M=E.pointerType==="touch"?10:2;O({x:_,y:I},v,M)?c(E):(Math.abs(_)>M||Math.abs(I)>M)&&(T.current=null)},onPointerUp:E=>{n.onPointerUp==null||n.onPointerUp.call(n,E),T.current=null,L.current=!1,l(E)},onPointerOut:E=>{n.onPointerOut==null||n.onPointerOut.call(n,E),F(D.current)},onContextMenu:E=>{n.onContextMenu==null||n.onContextMenu.call(n,E),D.current&&F(D.current)}})});Gc.displayName="Drawer.Content";const Nh=250,Sh=120,qc=w.forwardRef(function({preventCycle:e=!1,children:t,...r},n){const{closeDrawer:o,isDragging:a,snapPoints:i,activeSnapPoint:l,setActiveSnapPoint:c,dismissible:u,handleOnly:f,isOpen:d,onPress:g,onDrag:h}=An(),v=w.useRef(null),m=w.useRef(!1);function b(){if(m.current){C();return}window.setTimeout(()=>{p()},Sh)}function p(){if(a||e||m.current){C();return}if(C(),!i||i.length===0){u||o();return}if(l===i[i.length-1]&&u){o();return}const N=i.findIndex(T=>T===l);if(N===-1)return;const P=i[N+1];c(P)}function x(){v.current=window.setTimeout(()=>{m.current=!0},Nh)}function C(){v.current&&window.clearTimeout(v.current),m.current=!1}return w.createElement("div",{onClick:b,onPointerCancel:C,onPointerDown:y=>{f&&g(y),x()},onPointerMove:y=>{f&&h(y)},ref:n,"data-vaul-drawer-visible":d?"true":"false","data-vaul-handle":"","aria-hidden":"true",...r},w.createElement("span",{"data-vaul-handle-hitarea":"","aria-hidden":"true"},t))});qc.displayName="Drawer.Handle";function Ah(e){const t=An(),{container:r=t.container,...n}=e;return w.createElement(_c,{container:r,...n})}const dr={Root:Eh,Content:Gc,Overlay:jc,Trigger:Pc,Portal:Ah,Handle:qc,Title:jo,Description:Go},Th=({shouldScaleBackground:e=!1,repositionInputs:t=!1,...r})=>s.jsx(dr.Root,{shouldScaleBackground:e,repositionInputs:t,...r}),kh=dr.Trigger,Ph=dr.Portal,_h=dr.Handle,Ih=w.forwardRef(({className:e,...t},r)=>s.jsx(dr.Overlay,{ref:r,className:V("gw-fixed gw-inset-0 gw-z-50 gw-backdrop-blur-sm gw-bg-black/50",e),...t})),Oh=w.forwardRef(({className:e,children:t,childrenWrapperClassName:r,...n},o)=>s.jsxs(Ph,{children:[s.jsx(Ih,{}),s.jsx(dr.Content,{ref:o,className:V("gw-fixed gw-left-0 gw-right-0 gw-bottom-0 gw-z-50 gw-flex gw-flex-col gw-rounded-t-3xl gw-bg-popover gw-text-popover-foreground gw-shadow-md",e),...n,children:s.jsx("div",{className:V("gw-w-full gw-mx-auto gw-rounded-t-3xl gw-pt-2",r),children:t})})]})),Lh=w.forwardRef(({className:e,...t},r)=>s.jsx(dr.Title,{ref:r,className:V("gw-text-lg gw-font-semibold gw-leading-none gw-tracking-tight",e),...t})),Mh=w.forwardRef(({className:e,...t},r)=>s.jsx(dr.Description,{ref:r,className:V("gw-text-sm gw-text-muted-foreground",e),...t})),Dh=["top","right","bottom","left"],ur=Math.min,xt=Math.max,hs=Math.round,ps=Math.floor,Vt=e=>({x:e,y:e}),Fh={left:"right",right:"left",bottom:"top",top:"bottom"},Uh={start:"end",end:"start"};function Ro(e,t,r){return xt(e,ur(t,r))}function tr(e,t){return typeof e=="function"?e(t):e}function rr(e){return e.split("-")[0]}function Qr(e){return e.split("-")[1]}function ea(e){return e==="x"?"y":"x"}function ta(e){return e==="y"?"height":"width"}const Bh=new Set(["top","bottom"]);function zt(e){return Bh.has(rr(e))?"y":"x"}function ra(e){return ea(zt(e))}function Hh(e,t,r){r===void 0&&(r=!1);const n=Qr(e),o=ra(e),a=ta(o);let i=o==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[a]>t.floating[a]&&(i=ms(i)),[i,ms(i)]}function $h(e){const t=ms(e);return[na(e),t,na(t)]}function na(e){return e.replace(/start|end/g,t=>Uh[t])}const Zc=["left","right"],Yc=["right","left"],Vh=["top","bottom"],zh=["bottom","top"];function Wh(e,t,r){switch(e){case"top":case"bottom":return r?t?Yc:Zc:t?Zc:Yc;case"left":case"right":return t?Vh:zh;default:return[]}}function jh(e,t,r,n){const o=Qr(e);let a=Wh(rr(e),r==="start",n);return o&&(a=a.map(i=>i+"-"+o),t&&(a=a.concat(a.map(na)))),a}function ms(e){return e.replace(/left|right|bottom|top/g,t=>Fh[t])}function Gh(e){return{top:0,right:0,bottom:0,left:0,...e}}function Kc(e){return typeof e!="number"?Gh(e):{top:e,right:e,bottom:e,left:e}}function ys(e){const{x:t,y:r,width:n,height:o}=e;return{width:n,height:o,top:r,left:t,right:t+n,bottom:r+o,x:t,y:r}}function Xc(e,t,r){let{reference:n,floating:o}=e;const a=zt(t),i=ra(t),l=ta(i),c=rr(t),u=a==="y",f=n.x+n.width/2-o.width/2,d=n.y+n.height/2-o.height/2,g=n[l]/2-o[l]/2;let h;switch(c){case"top":h={x:f,y:n.y-o.height};break;case"bottom":h={x:f,y:n.y+n.height};break;case"right":h={x:n.x+n.width,y:d};break;case"left":h={x:n.x-o.width,y:d};break;default:h={x:n.x,y:n.y}}switch(Qr(t)){case"start":h[i]-=g*(r&&u?-1:1);break;case"end":h[i]+=g*(r&&u?-1:1);break}return h}const qh=async(e,t,r)=>{const{placement:n="bottom",strategy:o="absolute",middleware:a=[],platform:i}=r,l=a.filter(Boolean),c=await(i.isRTL==null?void 0:i.isRTL(t));let u=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:f,y:d}=Xc(u,n,c),g=n,h={},v=0;for(let m=0;m<l.length;m++){const{name:b,fn:p}=l[m],{x,y:C,data:y,reset:N}=await p({x:f,y:d,initialPlacement:n,placement:g,strategy:o,middlewareData:h,rects:u,platform:i,elements:{reference:e,floating:t}});f=x??f,d=C??d,h={...h,[b]:{...h[b],...y}},N&&v<=50&&(v++,typeof N=="object"&&(N.placement&&(g=N.placement),N.rects&&(u=N.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:o}):N.rects),{x:f,y:d}=Xc(u,g,c)),m=-1)}return{x:f,y:d,placement:g,strategy:o,middlewareData:h}};async function Pn(e,t){var r;t===void 0&&(t={});const{x:n,y:o,platform:a,rects:i,elements:l,strategy:c}=e,{boundary:u="clippingAncestors",rootBoundary:f="viewport",elementContext:d="floating",altBoundary:g=!1,padding:h=0}=tr(t,e),v=Kc(h),b=l[g?d==="floating"?"reference":"floating":d],p=ys(await a.getClippingRect({element:(r=await(a.isElement==null?void 0:a.isElement(b)))==null||r?b:b.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(l.floating)),boundary:u,rootBoundary:f,strategy:c})),x=d==="floating"?{x:n,y:o,width:i.floating.width,height:i.floating.height}:i.reference,C=await(a.getOffsetParent==null?void 0:a.getOffsetParent(l.floating)),y=await(a.isElement==null?void 0:a.isElement(C))?await(a.getScale==null?void 0:a.getScale(C))||{x:1,y:1}:{x:1,y:1},N=ys(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:x,offsetParent:C,strategy:c}):x);return{top:(p.top-N.top+v.top)/y.y,bottom:(N.bottom-p.bottom+v.bottom)/y.y,left:(p.left-N.left+v.left)/y.x,right:(N.right-p.right+v.right)/y.x}}const Zh=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:o,rects:a,platform:i,elements:l,middlewareData:c}=t,{element:u,padding:f=0}=tr(e,t)||{};if(u==null)return{};const d=Kc(f),g={x:r,y:n},h=ra(o),v=ta(h),m=await i.getDimensions(u),b=h==="y",p=b?"top":"left",x=b?"bottom":"right",C=b?"clientHeight":"clientWidth",y=a.reference[v]+a.reference[h]-g[h]-a.floating[v],N=g[h]-a.reference[h],P=await(i.getOffsetParent==null?void 0:i.getOffsetParent(u));let T=P?P[C]:0;(!T||!await(i.isElement==null?void 0:i.isElement(P)))&&(T=l.floating[C]||a.floating[v]);const D=y/2-N/2,L=T/2-m[v]/2-1,A=ur(d[p],L),O=ur(d[x],L),F=A,E=T-m[v]-O,I=T/2-m[v]/2+D,_=Ro(F,I,E),M=!c.arrow&&Qr(o)!=null&&I!==_&&a.reference[v]/2-(I<F?A:O)-m[v]/2<0,H=M?I<F?I-F:I-E:0;return{[h]:g[h]+H,data:{[h]:_,centerOffset:I-_-H,...M&&{alignmentOffset:H}},reset:M}}}),Yh=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r,n;const{placement:o,middlewareData:a,rects:i,initialPlacement:l,platform:c,elements:u}=t,{mainAxis:f=!0,crossAxis:d=!0,fallbackPlacements:g,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:m=!0,...b}=tr(e,t);if((r=a.arrow)!=null&&r.alignmentOffset)return{};const p=rr(o),x=zt(l),C=rr(l)===l,y=await(c.isRTL==null?void 0:c.isRTL(u.floating)),N=g||(C||!m?[ms(l)]:$h(l)),P=v!=="none";!g&&P&&N.push(...jh(l,m,v,y));const T=[l,...N],D=await Pn(t,b),L=[];let A=((n=a.flip)==null?void 0:n.overflows)||[];if(f&&L.push(D[p]),d){const I=Hh(o,i,y);L.push(D[I[0]],D[I[1]])}if(A=[...A,{placement:o,overflows:L}],!L.every(I=>I<=0)){var O,F;const I=(((O=a.flip)==null?void 0:O.index)||0)+1,_=T[I];if(_&&(!(d==="alignment"?x!==zt(_):!1)||A.every(U=>zt(U.placement)===x?U.overflows[0]>0:!0)))return{data:{index:I,overflows:A},reset:{placement:_}};let M=(F=A.filter(H=>H.overflows[0]<=0).sort((H,U)=>H.overflows[1]-U.overflows[1])[0])==null?void 0:F.placement;if(!M)switch(h){case"bestFit":{var E;const H=(E=A.filter(U=>{if(P){const j=zt(U.placement);return j===x||j==="y"}return!0}).map(U=>[U.placement,U.overflows.filter(j=>j>0).reduce((j,re)=>j+re,0)]).sort((U,j)=>U[1]-j[1])[0])==null?void 0:E[0];H&&(M=H);break}case"initialPlacement":M=l;break}if(o!==M)return{reset:{placement:M}}}return{}}}};function Qc(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Jc(e){return Dh.some(t=>e[t]>=0)}const Kh=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r}=t,{strategy:n="referenceHidden",...o}=tr(e,t);switch(n){case"referenceHidden":{const a=await Pn(t,{...o,elementContext:"reference"}),i=Qc(a,r.reference);return{data:{referenceHiddenOffsets:i,referenceHidden:Jc(i)}}}case"escaped":{const a=await Pn(t,{...o,altBoundary:!0}),i=Qc(a,r.floating);return{data:{escapedOffsets:i,escaped:Jc(i)}}}default:return{}}}}},Rc=new Set(["left","top"]);async function Xh(e,t){const{placement:r,platform:n,elements:o}=e,a=await(n.isRTL==null?void 0:n.isRTL(o.floating)),i=rr(r),l=Qr(r),c=zt(r)==="y",u=Rc.has(i)?-1:1,f=a&&c?-1:1,d=tr(t,e);let{mainAxis:g,crossAxis:h,alignmentAxis:v}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return l&&typeof v=="number"&&(h=l==="end"?v*-1:v),c?{x:h*f,y:g*u}:{x:g*u,y:h*f}}const Qh=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:o,y:a,placement:i,middlewareData:l}=t,c=await Xh(t,e);return i===((r=l.offset)==null?void 0:r.placement)&&(n=l.arrow)!=null&&n.alignmentOffset?{}:{x:o+c.x,y:a+c.y,data:{...c,placement:i}}}}},Jh=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:o}=t,{mainAxis:a=!0,crossAxis:i=!1,limiter:l={fn:b=>{let{x:p,y:x}=b;return{x:p,y:x}}},...c}=tr(e,t),u={x:r,y:n},f=await Pn(t,c),d=zt(rr(o)),g=ea(d);let h=u[g],v=u[d];if(a){const b=g==="y"?"top":"left",p=g==="y"?"bottom":"right",x=h+f[b],C=h-f[p];h=Ro(x,h,C)}if(i){const b=d==="y"?"top":"left",p=d==="y"?"bottom":"right",x=v+f[b],C=v-f[p];v=Ro(x,v,C)}const m=l.fn({...t,[g]:h,[d]:v});return{...m,data:{x:m.x-r,y:m.y-n,enabled:{[g]:a,[d]:i}}}}}},Rh=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:o,rects:a,middlewareData:i}=t,{offset:l=0,mainAxis:c=!0,crossAxis:u=!0}=tr(e,t),f={x:r,y:n},d=zt(o),g=ea(d);let h=f[g],v=f[d];const m=tr(l,t),b=typeof m=="number"?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(c){const C=g==="y"?"height":"width",y=a.reference[g]-a.floating[C]+b.mainAxis,N=a.reference[g]+a.reference[C]-b.mainAxis;h<y?h=y:h>N&&(h=N)}if(u){var p,x;const C=g==="y"?"width":"height",y=Rc.has(rr(o)),N=a.reference[d]-a.floating[C]+(y&&((p=i.offset)==null?void 0:p[d])||0)+(y?0:b.crossAxis),P=a.reference[d]+a.reference[C]+(y?0:((x=i.offset)==null?void 0:x[d])||0)-(y?b.crossAxis:0);v<N?v=N:v>P&&(v=P)}return{[g]:h,[d]:v}}}},ep=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var r,n;const{placement:o,rects:a,platform:i,elements:l}=t,{apply:c=()=>{},...u}=tr(e,t),f=await Pn(t,u),d=rr(o),g=Qr(o),h=zt(o)==="y",{width:v,height:m}=a.floating;let b,p;d==="top"||d==="bottom"?(b=d,p=g===(await(i.isRTL==null?void 0:i.isRTL(l.floating))?"start":"end")?"left":"right"):(p=d,b=g==="end"?"top":"bottom");const x=m-f.top-f.bottom,C=v-f.left-f.right,y=ur(m-f[b],x),N=ur(v-f[p],C),P=!t.middlewareData.shift;let T=y,D=N;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&(D=C),(n=t.middlewareData.shift)!=null&&n.enabled.y&&(T=x),P&&!g){const A=xt(f.left,0),O=xt(f.right,0),F=xt(f.top,0),E=xt(f.bottom,0);h?D=v-2*(A!==0||O!==0?A+O:xt(f.left,f.right)):T=m-2*(F!==0||E!==0?F+E:xt(f.top,f.bottom))}await c({...t,availableWidth:D,availableHeight:T});const L=await i.getDimensions(l.floating);return v!==L.width||m!==L.height?{reset:{rects:!0}}:{}}}};function bs(){return typeof window<"u"}function Jr(e){return ed(e)?(e.nodeName||"").toLowerCase():"#document"}function Et(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Wt(e){var t;return(t=(ed(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function ed(e){return bs()?e instanceof Node||e instanceof Et(e).Node:!1}function _t(e){return bs()?e instanceof Element||e instanceof Et(e).Element:!1}function jt(e){return bs()?e instanceof HTMLElement||e instanceof Et(e).HTMLElement:!1}function td(e){return!bs()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Et(e).ShadowRoot}const tp=new Set(["inline","contents"]);function _n(e){const{overflow:t,overflowX:r,overflowY:n,display:o}=It(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!tp.has(o)}const rp=new Set(["table","td","th"]);function np(e){return rp.has(Jr(e))}const sp=[":popover-open",":modal"];function vs(e){return sp.some(t=>{try{return e.matches(t)}catch{return!1}})}const op=["transform","translate","scale","rotate","perspective"],ap=["transform","translate","scale","rotate","perspective","filter"],ip=["paint","layout","strict","content"];function sa(e){const t=oa(),r=_t(e)?It(e):e;return op.some(n=>r[n]?r[n]!=="none":!1)||(r.containerType?r.containerType!=="normal":!1)||!t&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!t&&(r.filter?r.filter!=="none":!1)||ap.some(n=>(r.willChange||"").includes(n))||ip.some(n=>(r.contain||"").includes(n))}function lp(e){let t=fr(e);for(;jt(t)&&!Rr(t);){if(sa(t))return t;if(vs(t))return null;t=fr(t)}return null}function oa(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const cp=new Set(["html","body","#document"]);function Rr(e){return cp.has(Jr(e))}function It(e){return Et(e).getComputedStyle(e)}function Cs(e){return _t(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function fr(e){if(Jr(e)==="html")return e;const t=e.assignedSlot||e.parentNode||td(e)&&e.host||Wt(e);return td(t)?t.host:t}function rd(e){const t=fr(e);return Rr(t)?e.ownerDocument?e.ownerDocument.body:e.body:jt(t)&&_n(t)?t:rd(t)}function In(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);const o=rd(e),a=o===((n=e.ownerDocument)==null?void 0:n.body),i=Et(o);if(a){const l=aa(i);return t.concat(i,i.visualViewport||[],_n(o)?o:[],l&&r?In(l):[])}return t.concat(o,In(o,[],r))}function aa(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function nd(e){const t=It(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const o=jt(e),a=o?e.offsetWidth:r,i=o?e.offsetHeight:n,l=hs(r)!==a||hs(n)!==i;return l&&(r=a,n=i),{width:r,height:n,$:l}}function ia(e){return _t(e)?e:e.contextElement}function en(e){const t=ia(e);if(!jt(t))return Vt(1);const r=t.getBoundingClientRect(),{width:n,height:o,$:a}=nd(t);let i=(a?hs(r.width):r.width)/n,l=(a?hs(r.height):r.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!l||!Number.isFinite(l))&&(l=1),{x:i,y:l}}const dp=Vt(0);function sd(e){const t=Et(e);return!oa()||!t.visualViewport?dp:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function up(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==Et(e)?!1:t}function Pr(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);const o=e.getBoundingClientRect(),a=ia(e);let i=Vt(1);t&&(n?_t(n)&&(i=en(n)):i=en(e));const l=up(a,r,n)?sd(a):Vt(0);let c=(o.left+l.x)/i.x,u=(o.top+l.y)/i.y,f=o.width/i.x,d=o.height/i.y;if(a){const g=Et(a),h=n&&_t(n)?Et(n):n;let v=g,m=aa(v);for(;m&&n&&h!==v;){const b=en(m),p=m.getBoundingClientRect(),x=It(m),C=p.left+(m.clientLeft+parseFloat(x.paddingLeft))*b.x,y=p.top+(m.clientTop+parseFloat(x.paddingTop))*b.y;c*=b.x,u*=b.y,f*=b.x,d*=b.y,c+=C,u+=y,v=Et(m),m=aa(v)}}return ys({width:f,height:d,x:c,y:u})}function xs(e,t){const r=Cs(e).scrollLeft;return t?t.left+r:Pr(Wt(e)).left+r}function od(e,t){const r=e.getBoundingClientRect(),n=r.left+t.scrollLeft-xs(e,r),o=r.top+t.scrollTop;return{x:n,y:o}}function fp(e){let{elements:t,rect:r,offsetParent:n,strategy:o}=e;const a=o==="fixed",i=Wt(n),l=t?vs(t.floating):!1;if(n===i||l&&a)return r;let c={scrollLeft:0,scrollTop:0},u=Vt(1);const f=Vt(0),d=jt(n);if((d||!d&&!a)&&((Jr(n)!=="body"||_n(i))&&(c=Cs(n)),jt(n))){const h=Pr(n);u=en(n),f.x=h.x+n.clientLeft,f.y=h.y+n.clientTop}const g=i&&!d&&!a?od(i,c):Vt(0);return{width:r.width*u.x,height:r.height*u.y,x:r.x*u.x-c.scrollLeft*u.x+f.x+g.x,y:r.y*u.y-c.scrollTop*u.y+f.y+g.y}}function gp(e){return Array.from(e.getClientRects())}function wp(e){const t=Wt(e),r=Cs(e),n=e.ownerDocument.body,o=xt(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),a=xt(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let i=-r.scrollLeft+xs(e);const l=-r.scrollTop;return It(n).direction==="rtl"&&(i+=xt(t.clientWidth,n.clientWidth)-o),{width:o,height:a,x:i,y:l}}const ad=25;function hp(e,t){const r=Et(e),n=Wt(e),o=r.visualViewport;let a=n.clientWidth,i=n.clientHeight,l=0,c=0;if(o){a=o.width,i=o.height;const f=oa();(!f||f&&t==="fixed")&&(l=o.offsetLeft,c=o.offsetTop)}const u=xs(n);if(u<=0){const f=n.ownerDocument,d=f.body,g=getComputedStyle(d),h=f.compatMode==="CSS1Compat"&&parseFloat(g.marginLeft)+parseFloat(g.marginRight)||0,v=Math.abs(n.clientWidth-d.clientWidth-h);v<=ad&&(a-=v)}else u<=ad&&(a+=u);return{width:a,height:i,x:l,y:c}}const pp=new Set(["absolute","fixed"]);function mp(e,t){const r=Pr(e,!0,t==="fixed"),n=r.top+e.clientTop,o=r.left+e.clientLeft,a=jt(e)?en(e):Vt(1),i=e.clientWidth*a.x,l=e.clientHeight*a.y,c=o*a.x,u=n*a.y;return{width:i,height:l,x:c,y:u}}function id(e,t,r){let n;if(t==="viewport")n=hp(e,r);else if(t==="document")n=wp(Wt(e));else if(_t(t))n=mp(t,r);else{const o=sd(e);n={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return ys(n)}function ld(e,t){const r=fr(e);return r===t||!_t(r)||Rr(r)?!1:It(r).position==="fixed"||ld(r,t)}function yp(e,t){const r=t.get(e);if(r)return r;let n=In(e,[],!1).filter(l=>_t(l)&&Jr(l)!=="body"),o=null;const a=It(e).position==="fixed";let i=a?fr(e):e;for(;_t(i)&&!Rr(i);){const l=It(i),c=sa(i);!c&&l.position==="fixed"&&(o=null),(a?!c&&!o:!c&&l.position==="static"&&!!o&&pp.has(o.position)||_n(i)&&!c&&ld(e,i))?n=n.filter(f=>f!==i):o=l,i=fr(i)}return t.set(e,n),n}function bp(e){let{element:t,boundary:r,rootBoundary:n,strategy:o}=e;const i=[...r==="clippingAncestors"?vs(t)?[]:yp(t,this._c):[].concat(r),n],l=i[0],c=i.reduce((u,f)=>{const d=id(t,f,o);return u.top=xt(d.top,u.top),u.right=ur(d.right,u.right),u.bottom=ur(d.bottom,u.bottom),u.left=xt(d.left,u.left),u},id(t,l,o));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function vp(e){const{width:t,height:r}=nd(e);return{width:t,height:r}}function Cp(e,t,r){const n=jt(t),o=Wt(t),a=r==="fixed",i=Pr(e,!0,a,t);let l={scrollLeft:0,scrollTop:0};const c=Vt(0);function u(){c.x=xs(o)}if(n||!n&&!a)if((Jr(t)!=="body"||_n(o))&&(l=Cs(t)),n){const h=Pr(t,!0,a,t);c.x=h.x+t.clientLeft,c.y=h.y+t.clientTop}else o&&u();a&&!n&&o&&u();const f=o&&!n&&!a?od(o,l):Vt(0),d=i.left+l.scrollLeft-c.x-f.x,g=i.top+l.scrollTop-c.y-f.y;return{x:d,y:g,width:i.width,height:i.height}}function la(e){return It(e).position==="static"}function cd(e,t){if(!jt(e)||It(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return Wt(e)===r&&(r=r.ownerDocument.body),r}function dd(e,t){const r=Et(e);if(vs(e))return r;if(!jt(e)){let o=fr(e);for(;o&&!Rr(o);){if(_t(o)&&!la(o))return o;o=fr(o)}return r}let n=cd(e,t);for(;n&&np(n)&&la(n);)n=cd(n,t);return n&&Rr(n)&&la(n)&&!sa(n)?r:n||lp(e)||r}const xp=async function(e){const t=this.getOffsetParent||dd,r=this.getDimensions,n=await r(e.floating);return{reference:Cp(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function Ep(e){return It(e).direction==="rtl"}const Np={convertOffsetParentRelativeRectToViewportRelativeRect:fp,getDocumentElement:Wt,getClippingRect:bp,getOffsetParent:dd,getElementRects:xp,getClientRects:gp,getDimensions:vp,getScale:en,isElement:_t,isRTL:Ep};function ud(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Sp(e,t){let r=null,n;const o=Wt(e);function a(){var l;clearTimeout(n),(l=r)==null||l.disconnect(),r=null}function i(l,c){l===void 0&&(l=!1),c===void 0&&(c=1),a();const u=e.getBoundingClientRect(),{left:f,top:d,width:g,height:h}=u;if(l||t(),!g||!h)return;const v=ps(d),m=ps(o.clientWidth-(f+g)),b=ps(o.clientHeight-(d+h)),p=ps(f),C={rootMargin:-v+"px "+-m+"px "+-b+"px "+-p+"px",threshold:xt(0,ur(1,c))||1};let y=!0;function N(P){const T=P[0].intersectionRatio;if(T!==c){if(!y)return i();T?i(!1,T):n=setTimeout(()=>{i(!1,1e-7)},1e3)}T===1&&!ud(u,e.getBoundingClientRect())&&i(),y=!1}try{r=new IntersectionObserver(N,{...C,root:o.ownerDocument})}catch{r=new IntersectionObserver(N,C)}r.observe(e)}return i(!0),a}function Ap(e,t,r,n){n===void 0&&(n={});const{ancestorScroll:o=!0,ancestorResize:a=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=n,u=ia(e),f=o||a?[...u?In(u):[],...In(t)]:[];f.forEach(p=>{o&&p.addEventListener("scroll",r,{passive:!0}),a&&p.addEventListener("resize",r)});const d=u&&l?Sp(u,r):null;let g=-1,h=null;i&&(h=new ResizeObserver(p=>{let[x]=p;x&&x.target===u&&h&&(h.unobserve(t),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var C;(C=h)==null||C.observe(t)})),r()}),u&&!c&&h.observe(u),h.observe(t));let v,m=c?Pr(e):null;c&&b();function b(){const p=Pr(e);m&&!ud(m,p)&&r(),m=p,v=requestAnimationFrame(b)}return r(),()=>{var p;f.forEach(x=>{o&&x.removeEventListener("scroll",r),a&&x.removeEventListener("resize",r)}),d?.(),(p=h)==null||p.disconnect(),h=null,c&&cancelAnimationFrame(v)}}const Tp=Qh,kp=Jh,Pp=Yh,_p=ep,Ip=Kh,fd=Zh,Op=Rh,Lp=(e,t,r)=>{const n=new Map,o={platform:Np,...r},a={...o.platform,_c:n};return qh(e,t,{...o,platform:a})};var Mp=typeof document<"u",Dp=function(){},Es=Mp?w.useLayoutEffect:Dp;function Ns(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let r,n,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(n=r;n--!==0;)if(!Ns(e[n],t[n]))return!1;return!0}if(o=Object.keys(e),r=o.length,r!==Object.keys(t).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(t,o[n]))return!1;for(n=r;n--!==0;){const a=o[n];if(!(a==="_owner"&&e.$$typeof)&&!Ns(e[a],t[a]))return!1}return!0}return e!==e&&t!==t}function gd(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function wd(e,t){const r=gd(e);return Math.round(t*r)/r}function ca(e){const t=S.useRef(e);return Es(()=>{t.current=e}),t}function Fp(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:o,elements:{reference:a,floating:i}={},transform:l=!0,whileElementsMounted:c,open:u}=e,[f,d]=S.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[g,h]=S.useState(n);Ns(g,n)||h(n);const[v,m]=S.useState(null),[b,p]=S.useState(null),x=S.useCallback(U=>{U!==P.current&&(P.current=U,m(U))},[]),C=S.useCallback(U=>{U!==T.current&&(T.current=U,p(U))},[]),y=a||v,N=i||b,P=S.useRef(null),T=S.useRef(null),D=S.useRef(f),L=c!=null,A=ca(c),O=ca(o),F=ca(u),E=S.useCallback(()=>{if(!P.current||!T.current)return;const U={placement:t,strategy:r,middleware:g};O.current&&(U.platform=O.current),Lp(P.current,T.current,U).then(j=>{const re={...j,isPositioned:F.current!==!1};I.current&&!Ns(D.current,re)&&(D.current=re,ei.flushSync(()=>{d(re)}))})},[g,t,r,O,F]);Es(()=>{u===!1&&D.current.isPositioned&&(D.current.isPositioned=!1,d(U=>({...U,isPositioned:!1})))},[u]);const I=S.useRef(!1);Es(()=>(I.current=!0,()=>{I.current=!1}),[]),Es(()=>{if(y&&(P.current=y),N&&(T.current=N),y&&N){if(A.current)return A.current(y,N,E);E()}},[y,N,E,A,L]);const _=S.useMemo(()=>({reference:P,floating:T,setReference:x,setFloating:C}),[x,C]),M=S.useMemo(()=>({reference:y,floating:N}),[y,N]),H=S.useMemo(()=>{const U={position:r,left:0,top:0};if(!M.floating)return U;const j=wd(M.floating,f.x),re=wd(M.floating,f.y);return l?{...U,transform:"translate("+j+"px, "+re+"px)",...gd(M.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:j,top:re}},[r,l,M.floating,f.x,f.y]);return S.useMemo(()=>({...f,update:E,refs:_,elements:M,floatingStyles:H}),[f,E,_,M,H])}const Up=e=>{function t(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){const{element:n,padding:o}=typeof e=="function"?e(r):e;return n&&t(n)?n.current!=null?fd({element:n.current,padding:o}).fn(r):{}:n?fd({element:n,padding:o}).fn(r):{}}}},Bp=(e,t)=>({...Tp(e),options:[e,t]}),Hp=(e,t)=>({...kp(e),options:[e,t]}),$p=(e,t)=>({...Op(e),options:[e,t]}),Vp=(e,t)=>({...Pp(e),options:[e,t]}),zp=(e,t)=>({..._p(e),options:[e,t]}),Wp=(e,t)=>({...Ip(e),options:[e,t]}),jp=(e,t)=>({...Up(e),options:[e,t]});var Gp="Arrow",hd=S.forwardRef((e,t)=>{const{children:r,width:n=10,height:o=5,...a}=e;return s.jsx(He.svg,{...a,ref:t,width:n,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:s.jsx("polygon",{points:"0,0 30,0 15,10"})})});hd.displayName=Gp;var qp=hd;function Zp(e){const[t,r]=S.useState(void 0);return er(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const n=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const a=o[0];let i,l;if("borderBoxSize"in a){const c=a.borderBoxSize,u=Array.isArray(c)?c[0]:c;i=u.inlineSize,l=u.blockSize}else i=e.offsetWidth,l=e.offsetHeight;r({width:i,height:l})});return n.observe(e,{box:"border-box"}),()=>n.unobserve(e)}else r(void 0)},[e]),t}var da="Popper",[pd,Ss]=Sr(da),[Yp,md]=pd(da),yd=e=>{const{__scopePopper:t,children:r}=e,[n,o]=S.useState(null);return s.jsx(Yp,{scope:t,anchor:n,onAnchorChange:o,children:r})};yd.displayName=da;var bd="PopperAnchor",vd=S.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:n,...o}=e,a=md(bd,r),i=S.useRef(null),l=Re(t,i),c=S.useRef(null);return S.useEffect(()=>{const u=c.current;c.current=n?.current||i.current,u!==c.current&&a.onAnchorChange(c.current)}),n?null:s.jsx(He.div,{...o,ref:l})});vd.displayName=bd;var ua="PopperContent",[Kp,Xp]=pd(ua),Cd=S.forwardRef((e,t)=>{const{__scopePopper:r,side:n="bottom",sideOffset:o=0,align:a="center",alignOffset:i=0,arrowPadding:l=0,avoidCollisions:c=!0,collisionBoundary:u=[],collisionPadding:f=0,sticky:d="partial",hideWhenDetached:g=!1,updatePositionStrategy:h="optimized",onPlaced:v,...m}=e,b=md(ua,r),[p,x]=S.useState(null),C=Re(t,Y=>x(Y)),[y,N]=S.useState(null),P=Zp(y),T=P?.width??0,D=P?.height??0,L=n+(a!=="center"?"-"+a:""),A=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},O=Array.isArray(u)?u:[u],F=O.length>0,E={padding:A,boundary:O.filter(Jp),altBoundary:F},{refs:I,floatingStyles:_,placement:M,isPositioned:H,middlewareData:U}=Fp({strategy:"fixed",placement:L,whileElementsMounted:(...Y)=>Ap(...Y,{animationFrame:h==="always"}),elements:{reference:b.anchor},middleware:[Bp({mainAxis:o+D,alignmentAxis:i}),c&&Hp({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?$p():void 0,...E}),c&&Vp({...E}),zp({...E,apply:({elements:Y,rects:K,availableWidth:xe,availableHeight:Ke})=>{const{width:ze,height:ie}=K.reference,Oe=Y.floating.style;Oe.setProperty("--radix-popper-available-width",`${xe}px`),Oe.setProperty("--radix-popper-available-height",`${Ke}px`),Oe.setProperty("--radix-popper-anchor-width",`${ze}px`),Oe.setProperty("--radix-popper-anchor-height",`${ie}px`)}}),y&&jp({element:y,padding:l}),Rp({arrowWidth:T,arrowHeight:D}),g&&Wp({strategy:"referenceHidden",...E})]}),[j,re]=Nd(M),oe=qr(v);er(()=>{H&&oe?.()},[H,oe]);const we=U.arrow?.x,J=U.arrow?.y,G=U.arrow?.centerOffset!==0,[z,ce]=S.useState();return er(()=>{p&&ce(window.getComputedStyle(p).zIndex)},[p]),s.jsx("div",{ref:I.setFloating,"data-radix-popper-content-wrapper":"",style:{..._,transform:H?_.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:z,"--radix-popper-transform-origin":[U.transformOrigin?.x,U.transformOrigin?.y].join(" "),...U.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:s.jsx(Kp,{scope:r,placedSide:j,onArrowChange:N,arrowX:we,arrowY:J,shouldHideArrow:G,children:s.jsx(He.div,{"data-side":j,"data-align":re,...m,ref:C,style:{...m.style,animation:H?void 0:"none"}})})})});Cd.displayName=ua;var xd="PopperArrow",Qp={top:"bottom",right:"left",bottom:"top",left:"right"},Ed=S.forwardRef(function(t,r){const{__scopePopper:n,...o}=t,a=Xp(xd,n),i=Qp[a.placedSide];return s.jsx("span",{ref:a.onArrowChange,style:{position:"absolute",left:a.arrowX,top:a.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[a.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[a.placedSide],visibility:a.shouldHideArrow?"hidden":void 0},children:s.jsx(qp,{...o,ref:r,style:{...o.style,display:"block"}})})});Ed.displayName=xd;function Jp(e){return e!==null}var Rp=e=>({name:"transformOrigin",options:e,fn(t){const{placement:r,rects:n,middlewareData:o}=t,i=o.arrow?.centerOffset!==0,l=i?0:e.arrowWidth,c=i?0:e.arrowHeight,[u,f]=Nd(r),d={start:"0%",center:"50%",end:"100%"}[f],g=(o.arrow?.x??0)+l/2,h=(o.arrow?.y??0)+c/2;let v="",m="";return u==="bottom"?(v=i?d:`${g}px`,m=`${-c}px`):u==="top"?(v=i?d:`${g}px`,m=`${n.floating.height+c}px`):u==="right"?(v=`${-c}px`,m=i?d:`${h}px`):u==="left"&&(v=`${n.floating.width+c}px`,m=i?d:`${h}px`),{data:{x:v,y:m}}}});function Nd(e){const[t,r="center"]=e.split("-");return[t,r]}var Sd=yd,fa=vd,Ad=Cd,Td=Ed,As="Popover",[kd]=Sr(As,[Ss]),On=Ss(),[e2,gr]=kd(As),Pd=e=>{const{__scopePopover:t,children:r,open:n,defaultOpen:o,onOpenChange:a,modal:i=!1}=e,l=On(t),c=S.useRef(null),[u,f]=S.useState(!1),[d,g]=Gr({prop:n,defaultProp:o??!1,onChange:a,caller:As});return s.jsx(Sd,{...l,children:s.jsx(e2,{scope:t,contentId:Ar(),triggerRef:c,open:d,onOpenChange:g,onOpenToggle:S.useCallback(()=>g(h=>!h),[g]),hasCustomAnchor:u,onCustomAnchorAdd:S.useCallback(()=>f(!0),[]),onCustomAnchorRemove:S.useCallback(()=>f(!1),[]),modal:i,children:r})})};Pd.displayName=As;var _d="PopoverAnchor",t2=S.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=gr(_d,r),a=On(r),{onCustomAnchorAdd:i,onCustomAnchorRemove:l}=o;return S.useEffect(()=>(i(),()=>l()),[i,l]),s.jsx(fa,{...a,...n,ref:t})});t2.displayName=_d;var Id="PopoverTrigger",Od=S.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=gr(Id,r),a=On(r),i=Re(t,o.triggerRef),l=s.jsx(He.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":Ud(o.open),...n,ref:i,onClick:Be(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?l:s.jsx(fa,{asChild:!0,...a,children:l})});Od.displayName=Id;var ga="PopoverPortal",[r2,n2]=kd(ga,{forceMount:void 0}),Ld=e=>{const{__scopePopover:t,forceMount:r,children:n,container:o}=e,a=gr(ga,t);return s.jsx(r2,{scope:t,forceMount:r,children:s.jsx(cr,{present:r||a.open,children:s.jsx(Io,{asChild:!0,container:o,children:n})})})};Ld.displayName=ga;var tn="PopoverContent",Md=S.forwardRef((e,t)=>{const r=n2(tn,e.__scopePopover),{forceMount:n=r.forceMount,...o}=e,a=gr(tn,e.__scopePopover);return s.jsx(cr,{present:n||a.open,children:a.modal?s.jsx(o2,{...o,ref:t}):s.jsx(a2,{...o,ref:t})})});Md.displayName=tn;var s2=Sn("PopoverContent.RemoveScroll"),o2=S.forwardRef((e,t)=>{const r=gr(tn,e.__scopePopover),n=S.useRef(null),o=Re(t,n),a=S.useRef(!1);return S.useEffect(()=>{const i=n.current;if(i)return uc(i)},[]),s.jsx(Uo,{as:s2,allowPinchZoom:!0,children:s.jsx(Dd,{...e,ref:o,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Be(e.onCloseAutoFocus,i=>{i.preventDefault(),a.current||r.triggerRef.current?.focus()}),onPointerDownOutside:Be(e.onPointerDownOutside,i=>{const l=i.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0,u=l.button===2||c;a.current=u},{checkForDefaultPrevented:!1}),onFocusOutside:Be(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1})})})}),a2=S.forwardRef((e,t)=>{const r=gr(tn,e.__scopePopover),n=S.useRef(!1),o=S.useRef(!1);return s.jsx(Dd,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{e.onCloseAutoFocus?.(a),a.defaultPrevented||(n.current||r.triggerRef.current?.focus(),a.preventDefault()),n.current=!1,o.current=!1},onInteractOutside:a=>{e.onInteractOutside?.(a),a.defaultPrevented||(n.current=!0,a.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const i=a.target;r.triggerRef.current?.contains(i)&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&o.current&&a.preventDefault()}})}),Dd=S.forwardRef((e,t)=>{const{__scopePopover:r,trapFocus:n,onOpenAutoFocus:o,onCloseAutoFocus:a,disableOutsidePointerEvents:i,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:u,onInteractOutside:f,...d}=e,g=gr(tn,r),h=On(r);return Xl(),s.jsx(_o,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:o,onUnmountAutoFocus:a,children:s.jsx(rs,{asChild:!0,disableOutsidePointerEvents:i,onInteractOutside:f,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:u,onDismiss:()=>g.onOpenChange(!1),children:s.jsx(Ad,{"data-state":Ud(g.open),role:"dialog",id:g.contentId,...h,...d,ref:t,style:{...d.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),Fd="PopoverClose",i2=S.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=gr(Fd,r);return s.jsx(He.button,{type:"button",...n,ref:t,onClick:Be(e.onClick,()=>o.onOpenChange(!1))})});i2.displayName=Fd;var l2="PopoverArrow",c2=S.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=On(r);return s.jsx(Td,{...o,...n,ref:t})});c2.displayName=l2;function Ud(e){return e?"open":"closed"}var d2=Pd,u2=Od,f2=Ld,g2=Md;const w2=d2,h2=u2,p2=w.forwardRef(({className:e,align:t="center",sideOffset:r=4,...n},o)=>s.jsx(f2,{children:s.jsx(g2,{ref:o,align:t,sideOffset:r,className:V("gw-PopoverContent gw-z-50 gw-w-72 gw-rounded-6xl gw-overflow-y-auto gw-bg-popover gw-p-6 gw-text-popover-foreground gw-shadow-buttonMd gw-outline-none data-[state=open]:gw-animate-in data-[state=closed]:gw-animate-out data-[state=closed]:gw-fade-out-0 data-[state=open]:gw-fade-in-0 data-[state=closed]:gw-zoom-out-95 data-[state=open]:gw-zoom-in-95 data-[side=bottom]:gw-slide-in-from-top-2 data-[side=left]:gw-slide-in-from-right-2 data-[side=right]:gw-slide-in-from-left-2 data-[side=top]:gw-slide-in-from-bottom-2",e),...n})}));function m2(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",t.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}const y2=e=>{switch(e){case"success":return C2;case"info":return E2;case"warning":return x2;case"error":return N2;default:return null}},b2=Array(12).fill(0),v2=({visible:e,className:t})=>w.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},w.createElement("div",{className:"sonner-spinner"},b2.map((r,n)=>w.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${n}`})))),C2=w.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},w.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),x2=w.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},w.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),E2=w.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},w.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),N2=w.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},w.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),S2=w.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},w.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),w.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),A2=()=>{const[e,t]=w.useState(document.hidden);return w.useEffect(()=>{const r=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",r),()=>window.removeEventListener("visibilitychange",r)},[]),e};let wa=1;class T2{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{const r=this.subscribers.indexOf(t);this.subscribers.splice(r,1)}),this.publish=t=>{this.subscribers.forEach(r=>r(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var r;const{message:n,...o}=t,a=typeof t?.id=="number"||((r=t.id)==null?void 0:r.length)>0?t.id:wa++,i=this.toasts.find(c=>c.id===a),l=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(a)&&this.dismissedToasts.delete(a),i?this.toasts=this.toasts.map(c=>c.id===a?(this.publish({...c,...t,id:a,title:n}),{...c,...t,id:a,dismissible:l,title:n}):c):this.addToast({title:n,...o,dismissible:l,id:a}),a},this.dismiss=t=>(t?(this.dismissedToasts.add(t),requestAnimationFrame(()=>this.subscribers.forEach(r=>r({id:t,dismiss:!0})))):this.toasts.forEach(r=>{this.subscribers.forEach(n=>n({id:r.id,dismiss:!0}))}),t),this.message=(t,r)=>this.create({...r,message:t}),this.error=(t,r)=>this.create({...r,message:t,type:"error"}),this.success=(t,r)=>this.create({...r,type:"success",message:t}),this.info=(t,r)=>this.create({...r,type:"info",message:t}),this.warning=(t,r)=>this.create({...r,type:"warning",message:t}),this.loading=(t,r)=>this.create({...r,type:"loading",message:t}),this.promise=(t,r)=>{if(!r)return;let n;r.loading!==void 0&&(n=this.create({...r,promise:t,type:"loading",message:r.loading,description:typeof r.description!="function"?r.description:void 0}));const o=Promise.resolve(t instanceof Function?t():t);let a=n!==void 0,i;const l=o.then(async u=>{if(i=["resolve",u],w.isValidElement(u))a=!1,this.create({id:n,type:"default",message:u});else if(P2(u)&&!u.ok){a=!1;const d=typeof r.error=="function"?await r.error(`HTTP error! status: ${u.status}`):r.error,g=typeof r.description=="function"?await r.description(`HTTP error! status: ${u.status}`):r.description,v=typeof d=="object"&&!w.isValidElement(d)?d:{message:d};this.create({id:n,type:"error",description:g,...v})}else if(u instanceof Error){a=!1;const d=typeof r.error=="function"?await r.error(u):r.error,g=typeof r.description=="function"?await r.description(u):r.description,v=typeof d=="object"&&!w.isValidElement(d)?d:{message:d};this.create({id:n,type:"error",description:g,...v})}else if(r.success!==void 0){a=!1;const d=typeof r.success=="function"?await r.success(u):r.success,g=typeof r.description=="function"?await r.description(u):r.description,v=typeof d=="object"&&!w.isValidElement(d)?d:{message:d};this.create({id:n,type:"success",description:g,...v})}}).catch(async u=>{if(i=["reject",u],r.error!==void 0){a=!1;const f=typeof r.error=="function"?await r.error(u):r.error,d=typeof r.description=="function"?await r.description(u):r.description,h=typeof f=="object"&&!w.isValidElement(f)?f:{message:f};this.create({id:n,type:"error",description:d,...h})}}).finally(()=>{a&&(this.dismiss(n),n=void 0),r.finally==null||r.finally.call(r)}),c=()=>new Promise((u,f)=>l.then(()=>i[0]==="reject"?f(i[1]):u(i[1])).catch(f));return typeof n!="string"&&typeof n!="number"?{unwrap:c}:Object.assign(n,{unwrap:c})},this.custom=(t,r)=>{const n=r?.id||wa++;return this.create({jsx:t(n),id:n,...r}),n},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const gt=new T2,k2=(e,t)=>{const r=t?.id||wa++;return gt.addToast({title:e,...t,id:r}),r},P2=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",_2=k2,I2=()=>gt.toasts,O2=()=>gt.getActiveToasts(),Gt=Object.assign(_2,{success:gt.success,info:gt.info,warning:gt.warning,error:gt.error,custom:gt.custom,message:gt.message,promise:gt.promise,dismiss:gt.dismiss,loading:gt.loading},{getHistory:I2,getToasts:O2});m2("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function Ts(e){return e.label!==void 0}const L2=3,M2="24px",D2="16px",Bd=4e3,F2=356,U2=14,B2=45,H2=200;function qt(...e){return e.filter(Boolean).join(" ")}function $2(e){const[t,r]=e.split("-"),n=[];return t&&n.push(t),r&&n.push(r),n}const V2=e=>{var t,r,n,o,a,i,l,c,u;const{invert:f,toast:d,unstyled:g,interacting:h,setHeights:v,visibleToasts:m,heights:b,index:p,toasts:x,expanded:C,removeToast:y,defaultRichColors:N,closeButton:P,style:T,cancelButtonStyle:D,actionButtonStyle:L,className:A="",descriptionClassName:O="",duration:F,position:E,gap:I,expandByDefault:_,classNames:M,icons:H,closeButtonAriaLabel:U="Close toast"}=e,[j,re]=w.useState(null),[oe,we]=w.useState(null),[J,G]=w.useState(!1),[z,ce]=w.useState(!1),[Y,K]=w.useState(!1),[xe,Ke]=w.useState(!1),[ze,ie]=w.useState(!1),[Oe,X]=w.useState(0),[wt,Xe]=w.useState(0),_e=w.useRef(d.duration||F||Bd),ne=w.useRef(null),de=w.useRef(null),Le=p===0,tt=p+1<=m,Me=d.type,q=d.dismissible!==!1,ae=d.className||"",Nt=d.descriptionClassName||"",Qe=w.useMemo(()=>b.findIndex(ee=>ee.toastId===d.id)||0,[b,d.id]),it=w.useMemo(()=>{var ee;return(ee=d.closeButton)!=null?ee:P},[d.closeButton,P]),We=w.useMemo(()=>d.duration||F||Bd,[d.duration,F]),ht=w.useRef(0),pt=w.useRef(0),St=w.useRef(0),Se=w.useRef(null),[Mt,Je]=E.split("-"),Or=w.useMemo(()=>b.reduce((ee,he,ke)=>ke>=Qe?ee:ee+he.height,0),[b,Qe]),Lr=A2(),Un=d.invert||f,pr=Me==="loading";pt.current=w.useMemo(()=>Qe*I+Or,[Qe,Or]),w.useEffect(()=>{_e.current=We},[We]),w.useEffect(()=>{G(!0)},[]),w.useEffect(()=>{const ee=de.current;if(ee){const he=ee.getBoundingClientRect().height;return Xe(he),v(ke=>[{toastId:d.id,height:he,position:d.position},...ke]),()=>v(ke=>ke.filter(Pe=>Pe.toastId!==d.id))}},[v,d.id]),w.useLayoutEffect(()=>{if(!J)return;const ee=de.current,he=ee.style.height;ee.style.height="auto";const ke=ee.getBoundingClientRect().height;ee.style.height=he,Xe(ke),v(Pe=>Pe.find(Ae=>Ae.toastId===d.id)?Pe.map(Ae=>Ae.toastId===d.id?{...Ae,height:ke}:Ae):[{toastId:d.id,height:ke,position:d.position},...Pe])},[J,d.title,d.description,v,d.id,d.jsx,d.action,d.cancel]);const R=w.useCallback(()=>{ce(!0),X(pt.current),v(ee=>ee.filter(he=>he.toastId!==d.id)),setTimeout(()=>{y(d)},H2)},[d,y,v,pt]);w.useEffect(()=>{if(d.promise&&Me==="loading"||d.duration===1/0||d.type==="loading")return;let ee;return C||h||Lr?(()=>{if(St.current<ht.current){const Pe=new Date().getTime()-ht.current;_e.current=_e.current-Pe}St.current=new Date().getTime()})():_e.current!==1/0&&(ht.current=new Date().getTime(),ee=setTimeout(()=>{d.onAutoClose==null||d.onAutoClose.call(d,d),R()},_e.current)),()=>clearTimeout(ee)},[C,h,d,Me,Lr,R]),w.useEffect(()=>{d.delete&&(R(),d.onDismiss==null||d.onDismiss.call(d,d))},[R,d.delete]);function B(){var ee;if(H?.loading){var he;return w.createElement("div",{className:qt(M?.loader,d==null||(he=d.classNames)==null?void 0:he.loader,"sonner-loader"),"data-visible":Me==="loading"},H.loading)}return w.createElement(v2,{className:qt(M?.loader,d==null||(ee=d.classNames)==null?void 0:ee.loader),visible:Me==="loading"})}const Q=d.icon||H?.[Me]||y2(Me);var se,ye;return w.createElement("li",{tabIndex:0,ref:de,className:qt(A,ae,M?.toast,d==null||(t=d.classNames)==null?void 0:t.toast,M?.default,M?.[Me],d==null||(r=d.classNames)==null?void 0:r[Me]),"data-sonner-toast":"","data-rich-colors":(se=d.richColors)!=null?se:N,"data-styled":!(d.jsx||d.unstyled||g),"data-mounted":J,"data-promise":!!d.promise,"data-swiped":ze,"data-removed":z,"data-visible":tt,"data-y-position":Mt,"data-x-position":Je,"data-index":p,"data-front":Le,"data-swiping":Y,"data-dismissible":q,"data-type":Me,"data-invert":Un,"data-swipe-out":xe,"data-swipe-direction":oe,"data-expanded":!!(C||_&&J),"data-testid":d.testId,style:{"--index":p,"--toasts-before":p,"--z-index":x.length-p,"--offset":`${z?Oe:pt.current}px`,"--initial-height":_?"auto":`${wt}px`,...T,...d.style},onDragEnd:()=>{K(!1),re(null),Se.current=null},onPointerDown:ee=>{ee.button!==2&&(pr||!q||(ne.current=new Date,X(pt.current),ee.target.setPointerCapture(ee.pointerId),ee.target.tagName!=="BUTTON"&&(K(!0),Se.current={x:ee.clientX,y:ee.clientY})))},onPointerUp:()=>{var ee,he,ke;if(xe||!q)return;Se.current=null;const Pe=Number(((ee=de.current)==null?void 0:ee.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Tt=Number(((he=de.current)==null?void 0:he.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Ae=new Date().getTime()-((ke=ne.current)==null?void 0:ke.getTime()),De=j==="x"?Pe:Tt,nr=Math.abs(De)/Ae;if(Math.abs(De)>=B2||nr>.11){X(pt.current),d.onDismiss==null||d.onDismiss.call(d,d),we(j==="x"?Pe>0?"right":"left":Tt>0?"down":"up"),R(),Ke(!0);return}else{var mt,Dt;(mt=de.current)==null||mt.style.setProperty("--swipe-amount-x","0px"),(Dt=de.current)==null||Dt.style.setProperty("--swipe-amount-y","0px")}ie(!1),K(!1),re(null)},onPointerMove:ee=>{var he,ke,Pe;if(!Se.current||!q||((he=window.getSelection())==null?void 0:he.toString().length)>0)return;const Ae=ee.clientY-Se.current.y,De=ee.clientX-Se.current.x;var nr;const mt=(nr=e.swipeDirections)!=null?nr:$2(E);!j&&(Math.abs(De)>1||Math.abs(Ae)>1)&&re(Math.abs(De)>Math.abs(Ae)?"x":"y");let Dt={x:0,y:0};const ff=Mr=>1/(1.5+Math.abs(Mr)/20);if(j==="y"){if(mt.includes("top")||mt.includes("bottom"))if(mt.includes("top")&&Ae<0||mt.includes("bottom")&&Ae>0)Dt.y=Ae;else{const Mr=Ae*ff(Ae);Dt.y=Math.abs(Mr)<Math.abs(Ae)?Mr:Ae}}else if(j==="x"&&(mt.includes("left")||mt.includes("right")))if(mt.includes("left")&&De<0||mt.includes("right")&&De>0)Dt.x=De;else{const Mr=De*ff(De);Dt.x=Math.abs(Mr)<Math.abs(De)?Mr:De}(Math.abs(Dt.x)>0||Math.abs(Dt.y)>0)&&ie(!0),(ke=de.current)==null||ke.style.setProperty("--swipe-amount-x",`${Dt.x}px`),(Pe=de.current)==null||Pe.style.setProperty("--swipe-amount-y",`${Dt.y}px`)}},it&&!d.jsx&&Me!=="loading"?w.createElement("button",{"aria-label":U,"data-disabled":pr,"data-close-button":!0,onClick:pr||!q?()=>{}:()=>{R(),d.onDismiss==null||d.onDismiss.call(d,d)},className:qt(M?.closeButton,d==null||(n=d.classNames)==null?void 0:n.closeButton)},(ye=H?.close)!=null?ye:S2):null,(Me||d.icon||d.promise)&&d.icon!==null&&(H?.[Me]!==null||d.icon)?w.createElement("div",{"data-icon":"",className:qt(M?.icon,d==null||(o=d.classNames)==null?void 0:o.icon)},d.promise||d.type==="loading"&&!d.icon?d.icon||B():null,d.type!=="loading"?Q:null):null,w.createElement("div",{"data-content":"",className:qt(M?.content,d==null||(a=d.classNames)==null?void 0:a.content)},w.createElement("div",{"data-title":"",className:qt(M?.title,d==null||(i=d.classNames)==null?void 0:i.title)},d.jsx?d.jsx:typeof d.title=="function"?d.title():d.title),d.description?w.createElement("div",{"data-description":"",className:qt(O,Nt,M?.description,d==null||(l=d.classNames)==null?void 0:l.description)},typeof d.description=="function"?d.description():d.description):null),w.isValidElement(d.cancel)?d.cancel:d.cancel&&Ts(d.cancel)?w.createElement("button",{"data-button":!0,"data-cancel":!0,style:d.cancelButtonStyle||D,onClick:ee=>{Ts(d.cancel)&&q&&(d.cancel.onClick==null||d.cancel.onClick.call(d.cancel,ee),R())},className:qt(M?.cancelButton,d==null||(c=d.classNames)==null?void 0:c.cancelButton)},d.cancel.label):null,w.isValidElement(d.action)?d.action:d.action&&Ts(d.action)?w.createElement("button",{"data-button":!0,"data-action":!0,style:d.actionButtonStyle||L,onClick:ee=>{Ts(d.action)&&(d.action.onClick==null||d.action.onClick.call(d.action,ee),!ee.defaultPrevented&&R())},className:qt(M?.actionButton,d==null||(u=d.classNames)==null?void 0:u.actionButton)},d.action.label):null)};function Hd(){if(typeof window>"u"||typeof document>"u")return"ltr";const e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function z2(e,t){const r={};return[e,t].forEach((n,o)=>{const a=o===1,i=a?"--mobile-offset":"--offset",l=a?D2:M2;function c(u){["top","right","bottom","left"].forEach(f=>{r[`${i}-${f}`]=typeof u=="number"?`${u}px`:u})}typeof n=="number"||typeof n=="string"?c(n):typeof n=="object"?["top","right","bottom","left"].forEach(u=>{n[u]===void 0?r[`${i}-${u}`]=l:r[`${i}-${u}`]=typeof n[u]=="number"?`${n[u]}px`:n[u]}):c(l)}),r}const W2=w.forwardRef(function(t,r){const{id:n,invert:o,position:a="bottom-right",hotkey:i=["altKey","KeyT"],expand:l,closeButton:c,className:u,offset:f,mobileOffset:d,theme:g="light",richColors:h,duration:v,style:m,visibleToasts:b=L2,toastOptions:p,dir:x=Hd(),gap:C=U2,icons:y,containerAriaLabel:N="Notifications"}=t,[P,T]=w.useState([]),D=w.useMemo(()=>n?P.filter(J=>J.toasterId===n):P.filter(J=>!J.toasterId),[P,n]),L=w.useMemo(()=>Array.from(new Set([a].concat(D.filter(J=>J.position).map(J=>J.position)))),[D,a]),[A,O]=w.useState([]),[F,E]=w.useState(!1),[I,_]=w.useState(!1),[M,H]=w.useState(g!=="system"?g:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),U=w.useRef(null),j=i.join("+").replace(/Key/g,"").replace(/Digit/g,""),re=w.useRef(null),oe=w.useRef(!1),we=w.useCallback(J=>{T(G=>{var z;return(z=G.find(ce=>ce.id===J.id))!=null&&z.delete||gt.dismiss(J.id),G.filter(({id:ce})=>ce!==J.id)})},[]);return w.useEffect(()=>gt.subscribe(J=>{if(J.dismiss){requestAnimationFrame(()=>{T(G=>G.map(z=>z.id===J.id?{...z,delete:!0}:z))});return}setTimeout(()=>{Gs.flushSync(()=>{T(G=>{const z=G.findIndex(ce=>ce.id===J.id);return z!==-1?[...G.slice(0,z),{...G[z],...J},...G.slice(z+1)]:[J,...G]})})})}),[P]),w.useEffect(()=>{if(g!=="system"){H(g);return}if(g==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?H("dark"):H("light")),typeof window>"u")return;const J=window.matchMedia("(prefers-color-scheme: dark)");try{J.addEventListener("change",({matches:G})=>{H(G?"dark":"light")})}catch{J.addListener(({matches:z})=>{try{H(z?"dark":"light")}catch(ce){console.error(ce)}})}},[g]),w.useEffect(()=>{P.length<=1&&E(!1)},[P]),w.useEffect(()=>{const J=G=>{var z;if(i.every(K=>G[K]||G.code===K)){var Y;E(!0),(Y=U.current)==null||Y.focus()}G.code==="Escape"&&(document.activeElement===U.current||(z=U.current)!=null&&z.contains(document.activeElement))&&E(!1)};return document.addEventListener("keydown",J),()=>document.removeEventListener("keydown",J)},[i]),w.useEffect(()=>{if(U.current)return()=>{re.current&&(re.current.focus({preventScroll:!0}),re.current=null,oe.current=!1)}},[U.current]),w.createElement("section",{ref:r,"aria-label":`${N} ${j}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},L.map((J,G)=>{var z;const[ce,Y]=J.split("-");return D.length?w.createElement("ol",{key:J,dir:x==="auto"?Hd():x,tabIndex:-1,ref:U,className:u,"data-sonner-toaster":!0,"data-sonner-theme":M,"data-y-position":ce,"data-x-position":Y,style:{"--front-toast-height":`${((z=A[0])==null?void 0:z.height)||0}px`,"--width":`${F2}px`,"--gap":`${C}px`,...m,...z2(f,d)},onBlur:K=>{oe.current&&!K.currentTarget.contains(K.relatedTarget)&&(oe.current=!1,re.current&&(re.current.focus({preventScroll:!0}),re.current=null))},onFocus:K=>{K.target instanceof HTMLElement&&K.target.dataset.dismissible==="false"||oe.current||(oe.current=!0,re.current=K.relatedTarget)},onMouseEnter:()=>E(!0),onMouseMove:()=>E(!0),onMouseLeave:()=>{I||E(!1)},onDragEnd:()=>E(!1),onPointerDown:K=>{K.target instanceof HTMLElement&&K.target.dataset.dismissible==="false"||_(!0)},onPointerUp:()=>_(!1)},D.filter(K=>!K.position&&G===0||K.position===J).map((K,xe)=>{var Ke,ze;return w.createElement(V2,{key:K.id,icons:y,index:xe,toast:K,defaultRichColors:h,duration:(Ke=p?.duration)!=null?Ke:v,className:p?.className,descriptionClassName:p?.descriptionClassName,invert:o,visibleToasts:b,closeButton:(ze=p?.closeButton)!=null?ze:c,interacting:I,position:J,style:p?.style,unstyled:p?.unstyled,classNames:p?.classNames,cancelButtonStyle:p?.cancelButtonStyle,actionButtonStyle:p?.actionButtonStyle,closeButtonAriaLabel:p?.closeButtonAriaLabel,removeToast:we,toasts:D.filter(ie=>ie.position==K.position),heights:A.filter(ie=>ie.position==K.position),setHeights:O,expandByDefault:l,gap:C,expanded:F,swipeDirections:t.swipeDirections})})):null}))}),$d=({...e})=>s.jsx(W2,{closeButton:!0,theme:e.theme,richColors:!0,position:"bottom-center",className:"gw-toaster group",offset:8,toastOptions:{classNames:{toast:"gw-toast group-[.gw-toaster]:gw-bg-background group-[.gw-toaster]:gw-text-foreground group-[.gw-toaster]:gw-border-border !gw-rounded-2xl group-[.gw-toaster]:gw-shadow-lg",description:"group-[.gw-toast]:gw-text-muted-foreground",actionButton:"group-[.gw-toast]:gw-bg-primary group-[.gw-toast]:gw-text-primary-foreground",cancelButton:"group-[.gw-toast]:gw-bg-muted group-[.gw-toast]:gw-text-muted-foreground"}},...e});class Vd extends Error{constructor(){super("Widget content could not be loaded")}}class ha extends w.Component{constructor(t){super(t),this.state={failed:!1,content:w.lazy(()=>t.loader().catch(()=>{throw new Vd}))}}static getDerivedStateFromError(t){if(!(t instanceof Vd))throw t;return{failed:!0}}render(){return this.state.failed?s.jsxs("div",{className:"gw-p-4 gw-text-center gw-text-sm",role:"alert",children:[s.jsx("p",{children:"Glyph could not load this content. Reload the page to try again."}),s.jsx("p",{children:"Reloading may clear unsaved input."}),s.jsx("button",{type:"button",className:"gw-mt-2 gw-min-h-[44px] gw-px-4 gw-underline",onClick:()=>window.location.reload(),children:"Reload page"})]}):s.jsx(w.Suspense,{fallback:null,children:w.createElement(this.state.content,this.props.componentProps)})}}const j2=()=>Promise.resolve().then(()=>n3).then(({Wallet:e})=>({default:e})),pa=w.memo(({setGradientType:e})=>s.jsx(ha,{loader:j2,componentProps:{setGradientType:e}})),zd=()=>Promise.resolve().then(()=>o3).then(({WidgetGradient:e})=>({default:e})),G2=({buttonProps:e,minWidth:t=768,alwaysOpen:r=!1})=>{const n="light",o=vf(`(min-width: ${t}px)`),a=w.useContext(Bn);if(!a)throw new Error("GlyphWidget must be used within a GlyphViewProvider");const{glyphView:i,setGlyphView:l}=a,{ready:c,authenticated:u,user:f,hideWidget:d}=me();w.useEffect(()=>{r?l(ve.OPEN):(!c||!u)&&l(ve.CLOSED)},[c,u,l]);const[g,h]=w.useState();return d?s.jsx("div",{}):s.jsx("div",{className:"glyph-widget gw-widget-container light",children:c&&u&&f?s.jsx(s.Fragment,{children:o?s.jsxs(w2,{open:r?!0:i!==ve.CLOSED,onOpenChange:r?()=>l(ve.OPEN):v=>l(v?ve.OPEN:ve.CLOSED),children:[s.jsx(h2,{children:r?null:s.jsx(_l,{...e||{}})}),s.jsxs(p2,{sideOffset:10,align:"end",className:"glyph-widget gw-wallet-container",children:[s.jsx($d,{theme:n}),s.jsx(ha,{loader:zd,componentProps:{gradientType:g??bt.PRIMARY}})," ",s.jsx(pa,{setGradientType:h})]})]}):s.jsxs(Th,{open:r?!0:i!==ve.CLOSED,onOpenChange:r?()=>l(ve.OPEN):v=>l(v?ve.OPEN:ve.CLOSED),children:[s.jsx(kh,{children:r?null:s.jsx(_l,{...e||{}})}),s.jsxs(Oh,{className:"glyph-widget",children:[s.jsx(ha,{loader:zd,componentProps:{gradientType:g??bt.PRIMARY}})," ",s.jsx(_h,{}),s.jsx(Lh,{className:"gw-sr-only",children:"Glyph Wallet"}),s.jsx(Mh,{className:"gw-sr-only",children:"Glyph Widget to access all the things in one place related to your account!"}),s.jsx($d,{theme:n}),s.jsx("div",{className:"gw-wallet-container gw-w-full",style:{maxHeight:"80dvh"},children:s.jsx(pa,{setGradientType:h})})]})]})}):s.jsx(Ao,{})})},q2=()=>{const{logout:e}=me();return s.jsx(ue,{className:"gw-w-full",variant:"outline",onClick:e,children:"Logout"})},Z2=()=>{const{glyphUrl:e}=me(),t=new URL("/",e).toString();return e?s.jsx(ue,{variant:"outline",size:"login",onClick:()=>{window.open(t,"_blank")},className:"gw-w-52 !gw-justify-start",children:s.jsxs("span",{className:"gw-flex gw-items-center gw-gap-1 gw-w-full",children:[s.jsx("span",{className:"gw-p-2 gw-rounded-full",children:s.jsx(yr,{className:"!gw-size-5"})}),s.jsx("span",{className:"gw-flex-1 gw-text-center",children:"Visit Glyph Portal"})]})}):s.jsx(ue,{variant:"outline",size:"login",disabled:!0,children:s.jsxs("span",{className:"gw-inline-flex gw-items-center gw-w-full gw-gap-1",children:[s.jsx("span",{className:"gw-p-2 gw-rounded-full",children:s.jsx(yr,{className:"!gw-size-5"})}),s.jsx(Nr,{className:"gw-size-4 gw-animate-spin"})]})})};var Y2=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),K2="VisuallyHidden",Wd=S.forwardRef((e,t)=>s.jsx(He.span,{...e,ref:t,style:{...Y2,...e.style}}));Wd.displayName=K2;var X2=Wd,[ks]=Sr("Tooltip",[Ss]),Ps=Ss(),jd="TooltipProvider",Q2=700,ma="tooltip.open",[J2,ya]=ks(jd),Gd=e=>{const{__scopeTooltip:t,delayDuration:r=Q2,skipDelayDuration:n=300,disableHoverableContent:o=!1,children:a}=e,i=S.useRef(!0),l=S.useRef(!1),c=S.useRef(0);return S.useEffect(()=>{const u=c.current;return()=>window.clearTimeout(u)},[]),s.jsx(J2,{scope:t,isOpenDelayedRef:i,delayDuration:r,onOpen:S.useCallback(()=>{window.clearTimeout(c.current),i.current=!1},[]),onClose:S.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>i.current=!0,n)},[n]),isPointerInTransitRef:l,onPointerInTransitChange:S.useCallback(u=>{l.current=u},[]),disableHoverableContent:o,children:a})};Gd.displayName=jd;var Ln="Tooltip",[R2,_s]=ks(Ln),qd=e=>{const{__scopeTooltip:t,children:r,open:n,defaultOpen:o,onOpenChange:a,disableHoverableContent:i,delayDuration:l}=e,c=ya(Ln,e.__scopeTooltip),u=Ps(t),[f,d]=S.useState(null),g=Ar(),h=S.useRef(0),v=i??c.disableHoverableContent,m=l??c.delayDuration,b=S.useRef(!1),[p,x]=Gr({prop:n,defaultProp:o??!1,onChange:T=>{T?(c.onOpen(),document.dispatchEvent(new CustomEvent(ma))):c.onClose(),a?.(T)},caller:Ln}),C=S.useMemo(()=>p?b.current?"delayed-open":"instant-open":"closed",[p]),y=S.useCallback(()=>{window.clearTimeout(h.current),h.current=0,b.current=!1,x(!0)},[x]),N=S.useCallback(()=>{window.clearTimeout(h.current),h.current=0,x(!1)},[x]),P=S.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>{b.current=!0,x(!0),h.current=0},m)},[m,x]);return S.useEffect(()=>()=>{h.current&&(window.clearTimeout(h.current),h.current=0)},[]),s.jsx(Sd,{...u,children:s.jsx(R2,{scope:t,contentId:g,open:p,stateAttribute:C,trigger:f,onTriggerChange:d,onTriggerEnter:S.useCallback(()=>{c.isOpenDelayedRef.current?P():y()},[c.isOpenDelayedRef,P,y]),onTriggerLeave:S.useCallback(()=>{v?N():(window.clearTimeout(h.current),h.current=0)},[N,v]),onOpen:y,onClose:N,disableHoverableContent:v,children:r})})};qd.displayName=Ln;var ba="TooltipTrigger",Zd=S.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,o=_s(ba,r),a=ya(ba,r),i=Ps(r),l=S.useRef(null),c=Re(t,l,o.onTriggerChange),u=S.useRef(!1),f=S.useRef(!1),d=S.useCallback(()=>u.current=!1,[]);return S.useEffect(()=>()=>document.removeEventListener("pointerup",d),[d]),s.jsx(fa,{asChild:!0,...i,children:s.jsx(He.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...n,ref:c,onPointerMove:Be(e.onPointerMove,g=>{g.pointerType!=="touch"&&!f.current&&!a.isPointerInTransitRef.current&&(o.onTriggerEnter(),f.current=!0)}),onPointerLeave:Be(e.onPointerLeave,()=>{o.onTriggerLeave(),f.current=!1}),onPointerDown:Be(e.onPointerDown,()=>{o.open&&o.onClose(),u.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:Be(e.onFocus,()=>{u.current||o.onOpen()}),onBlur:Be(e.onBlur,o.onClose),onClick:Be(e.onClick,o.onClose)})})});Zd.displayName=ba;var e6="TooltipPortal",[e7,t6]=ks(e6,{forceMount:void 0}),rn="TooltipContent",Yd=S.forwardRef((e,t)=>{const r=t6(rn,e.__scopeTooltip),{forceMount:n=r.forceMount,side:o="top",...a}=e,i=_s(rn,e.__scopeTooltip);return s.jsx(cr,{present:n||i.open,children:i.disableHoverableContent?s.jsx(Kd,{side:o,...a,ref:t}):s.jsx(r6,{side:o,...a,ref:t})})}),r6=S.forwardRef((e,t)=>{const r=_s(rn,e.__scopeTooltip),n=ya(rn,e.__scopeTooltip),o=S.useRef(null),a=Re(t,o),[i,l]=S.useState(null),{trigger:c,onClose:u}=r,f=o.current,{onPointerInTransitChange:d}=n,g=S.useCallback(()=>{l(null),d(!1)},[d]),h=S.useCallback((v,m)=>{const b=v.currentTarget,p={x:v.clientX,y:v.clientY},x=i6(p,b.getBoundingClientRect()),C=l6(p,x),y=c6(m.getBoundingClientRect()),N=u6([...C,...y]);l(N),d(!0)},[d]);return S.useEffect(()=>()=>g(),[g]),S.useEffect(()=>{if(c&&f){const v=b=>h(b,f),m=b=>h(b,c);return c.addEventListener("pointerleave",v),f.addEventListener("pointerleave",m),()=>{c.removeEventListener("pointerleave",v),f.removeEventListener("pointerleave",m)}}},[c,f,h,g]),S.useEffect(()=>{if(i){const v=m=>{const b=m.target,p={x:m.clientX,y:m.clientY},x=c?.contains(b)||f?.contains(b),C=!d6(p,i);x?g():C&&(g(),u())};return document.addEventListener("pointermove",v),()=>document.removeEventListener("pointermove",v)}},[c,f,i,u,g]),s.jsx(Kd,{...e,ref:a})}),[n6,s6]=ks(Ln,{isInside:!1}),o6=M0("TooltipContent"),Kd=S.forwardRef((e,t)=>{const{__scopeTooltip:r,children:n,"aria-label":o,onEscapeKeyDown:a,onPointerDownOutside:i,...l}=e,c=_s(rn,r),u=Ps(r),{onClose:f}=c;return S.useEffect(()=>(document.addEventListener(ma,f),()=>document.removeEventListener(ma,f)),[f]),S.useEffect(()=>{if(c.trigger){const d=g=>{g.target?.contains(c.trigger)&&f()};return window.addEventListener("scroll",d,{capture:!0}),()=>window.removeEventListener("scroll",d,{capture:!0})}},[c.trigger,f]),s.jsx(rs,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:i,onFocusOutside:d=>d.preventDefault(),onDismiss:f,children:s.jsxs(Ad,{"data-state":c.stateAttribute,...u,...l,ref:t,style:{...l.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[s.jsx(o6,{children:n}),s.jsx(n6,{scope:r,isInside:!0,children:s.jsx(X2,{id:c.contentId,role:"tooltip",children:o||n})})]})})});Yd.displayName=rn;var Xd="TooltipArrow",a6=S.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,o=Ps(r);return s6(Xd,r).isInside?null:s.jsx(Td,{...o,...n,ref:t})});a6.displayName=Xd;function i6(e,t){const r=Math.abs(t.top-e.y),n=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(r,n,o,a)){case a:return"left";case o:return"right";case r:return"top";case n:return"bottom";default:throw new Error("unreachable")}}function l6(e,t,r=5){const n=[];switch(t){case"top":n.push({x:e.x-r,y:e.y+r},{x:e.x+r,y:e.y+r});break;case"bottom":n.push({x:e.x-r,y:e.y-r},{x:e.x+r,y:e.y-r});break;case"left":n.push({x:e.x+r,y:e.y-r},{x:e.x+r,y:e.y+r});break;case"right":n.push({x:e.x-r,y:e.y-r},{x:e.x-r,y:e.y+r});break}return n}function c6(e){const{top:t,right:r,bottom:n,left:o}=e;return[{x:o,y:t},{x:r,y:t},{x:r,y:n},{x:o,y:n}]}function d6(e,t){const{x:r,y:n}=e;let o=!1;for(let a=0,i=t.length-1;a<t.length;i=a++){const l=t[a],c=t[i],u=l.x,f=l.y,d=c.x,g=c.y;f>n!=g>n&&r<(d-u)*(n-f)/(g-f)+u&&(o=!o)}return o}function u6(e){const t=e.slice();return t.sort((r,n)=>r.x<n.x?-1:r.x>n.x?1:r.y<n.y?-1:r.y>n.y?1:0),f6(t)}function f6(e){if(e.length<=1)return e.slice();const t=[];for(let n=0;n<e.length;n++){const o=e[n];for(;t.length>=2;){const a=t[t.length-1],i=t[t.length-2];if((a.x-i.x)*(o.y-i.y)>=(a.y-i.y)*(o.x-i.x))t.pop();else break}t.push(o)}t.pop();const r=[];for(let n=e.length-1;n>=0;n--){const o=e[n];for(;r.length>=2;){const a=r[r.length-1],i=r[r.length-2];if((a.x-i.x)*(o.y-i.y)>=(a.y-i.y)*(o.x-i.x))r.pop();else break}r.push(o)}return r.pop(),t.length===1&&r.length===1&&t[0].x===r[0].x&&t[0].y===r[0].y?t:t.concat(r)}var g6=Gd,w6=qd,h6=Zd,p6=Yd;const m6=g6,y6=w6,b6=h6,v6=w.forwardRef(({className:e,sideOffset:t=4,...r},n)=>s.jsx(p6,{ref:n,sideOffset:t,className:V("gw-z-50 gw-overflow-hidden gw-typography-caption gw-rounded-lg gw-bg-popover gw-px-3 gw-py-1.5 gw-text-popover-foreground gw-shadow-inputFocus gw-animate-in gw-fade-in-0 gw-zoom-in-95 data-[state=closed]:gw-animate-out data-[state=closed]:gw-fade-out-0 data-[state=closed]:gw-zoom-out-95 data-[side=bottom]:gw-slide-in-from-top-2 data-[side=left]:gw-slide-in-from-right-2 data-[side=right]:gw-slide-in-from-left-2 data-[side=top]:gw-slide-in-from-bottom-2",e),...r}));function wr(){const e=w.useContext(Dr);if(!e)throw new Error("glyph hooks must be used within GlyphProvider");return{glyphApiFetch:e.apiFetch}}const Qd=w.createContext(void 0),Mn=()=>{const e=w.useContext(Qd);if(!e)throw new Error("useGlyphSwap must be used within GlyphSwapProvider");return e};function C6({children:e}){const{glyphApiFetch:t}=wr(),[r,n]=w.useState({fromCurrency:void 0,toCurrency:void 0,tradeType:"EXACT_INPUT",amount:"",topupGas:!1,topupGasAmount:"2000000"}),o=w.useCallback(i=>{n(l=>({...l,...i}))},[]),a=w.useCallback(async i=>{t&&await t(`/api/widget/swap/quote/${i}/failed`,{method:"PATCH"})},[t]);return s.jsx(Qd.Provider,{value:{...r,update:o,reportSwapFailed:a},children:e})}const Jd=64*1024*1024,nn=e=>typeof e=="object"&&e!==null&&!Array.isArray(e);class Rd extends Error{constructor(){super("Invalid Glyph balances response"),this.name="GlyphBalancesDecodeError"}}function eu(e){const t=()=>new Rd;if(!nn(e))throw t();if(Array.isArray(e.nfts))return e;const r=e.nfts;if(!nn(r)||r.format!=="nft-images-v1"||!Array.isArray(r.collections)||!Array.isArray(r.images)||!Array.from(r.images).every(g=>typeof g=="string")||!Array.isArray(r.references)||r.images.length>r.references.length)throw t();const n=r.collections;if(!n.every(g=>nn(g)&&Array.isArray(g.items)&&g.items.every(nn)))throw t();const o=n,a=r.images,i=g=>new TextEncoder().encode(g).byteLength,l=a.map(g=>i(JSON.stringify(g)));let c=i(JSON.stringify(o));if(c>Jd)throw t();const u=[],f=new Set;for(const g of r.references){if(!Array.isArray(g)||g.length!==4||!Array.from(g).every(Number.isSafeInteger))throw t();const[h,v,m,b]=g,p=o[h];if(h<0||!p||v<-1||m!==0&&m!==1||b<0||b>=a.length||v>=0&&(!p.items[v]||m===1&&!nn(p.items[v].image)))throw t();const x=v===-1?p[m===0?"image":"contractImage"]:m===0?p.items[v].tokenImage:p.items[v].image.cachedUrl,C=`${h}:${v}:${m}`;if(x!==""||f.has(C)||(f.add(C),c+=l[b]-2,c>Jd))throw t();u.push(g)}const d=o.map(g=>({...g,items:g.items.map(h=>({...h,...nn(h.image)?{image:{...h.image}}:{}}))}));for(const[g,h,v,m]of u){const b=d[g];h===-1?b[v===0?"image":"contractImage"]=a[m]:v===0?b.items[h].tokenImage=a[m]:b.items[h].image.cachedUrl=a[m]}return{...e,nfts:d}}class tu extends Error{constructor(t){super(`Glyph data request failed (HTTP ${t})`),this.status=t,this.name="GlyphDataRequestError"}status}async function Is(e,t,r,n,o,a){const i=()=>{if(!e||r.aborted||!n())throw new DOMException("Glyph data session changed","AbortError")};i();const l=await e(t,{signal:r});if(i(),!l.ok)throw new tu(l.status);const c=await l.json();i();const u=a?a(c):c;return i(),{scope:o,value:u}}function va(e,t,r){return e.name==="AbortError"||e instanceof Rd||e instanceof tu&&e.status>=400&&e.status<500?!1:t<r}const x6=zr("GlyphData"),E6=({children:e})=>{const t=w.useContext(Dr);if(!t)throw new Error("GlyphUserDataProvider must be used within GlyphProvider");const{ready:r,authenticated:n,apiFetch:o,glyphUrl:a}=t,i=lt.useQueryClient(),l=ge.useChainId(),[c,u]=w.useState(!1),f=c?"all":l,d=w.useMemo(()=>({key:crypto.randomUUID(),apiFetch:r&&n?o:null,glyphUrl:a,active:!0}),[r,n,o,a]),g=w.useRef(d);g.current=d;const h=w.useCallback(()=>g.current===d&&d.active&&!!d.apiFetch,[d]);w.useEffect(()=>(d.active=!0,()=>{d.active=!1,i.cancelQueries({predicate:A=>A.queryKey[1]===d.key})}),[d,i]);const v=lt.useQuery({queryKey:["glyphWidgetUser",d.key],queryFn:({signal:A})=>Is(d.apiFetch,"/api/widget/user",A,h,d.key),enabled:h(),gcTime:0,placeholderData:()=>{},refetchInterval:yf,retry:(A,O)=>h()&&va(O,A,5),retryDelay:A=>Math.min(1e3*2**A,3e4)}),m=h()&&!v.isError&&v.data?.scope===d.key?v.data.value:null,b=m?.evmWallet,p=w.useMemo(()=>({key:crypto.randomUUID(),session:d,chain:f,evmWallet:b,active:!0}),[d,f,b]),x=w.useRef(p);x.current=p;const C=w.useCallback(()=>h()&&x.current===p&&p.active&&typeof p.evmWallet=="string"&&$.isAddress(p.evmWallet,{strict:!1}),[p,h]);w.useEffect(()=>(p.active=!0,()=>{p.active=!1,i.cancelQueries({queryKey:["glyphWidgetBalances",d.key,p.key],exact:!0})}),[p,d,i]);const y=lt.useQuery({queryKey:["glyphWidgetBalances",d.key,p.key],queryFn:({signal:A})=>Is(d.apiFetch,`/api/widget/balances?chainId=${p.chain}&nftImageEncoding=references-v1`,A,C,p.key,eu),enabled:C(),gcTime:0,placeholderData:()=>{},refetchInterval:ni,retry:(A,O)=>C()&&va(O,A,3),retryDelay:A=>Math.min(1e3*2**A,3e4)}),N=C()&&!y.isError&&y.data?.scope===p.key?y.data.value:null,{refetch:P}=v,{refetch:T}=y,D=w.useCallback(async(A=!1)=>{h()&&await P({throwOnError:!1,cancelRefetch:A})},[h,P]),L=w.useCallback(async(A=!1,O)=>{if(!C())return;const F=await T({throwOnError:!1,cancelRefetch:A});if(!C()||F.isError||F.data?.scope!==p.key||!O)return;const E=F.data.value;if(!ge.deepEqual(N,E))for(const[I,_]of Object.entries(O)){if(!C())return;const M=E.tokens?.find(U=>`${U.chainId}:${U.address}`===I)?.value||"0",H=N?.tokens?.find(U=>`${U.chainId}:${U.address}`===I)?.value||"0";M!==H&&_(Number(M)-Number(H))}},[C,T,p,N]);return w.useEffect(()=>{h()&&v.error&&x6.error("Failed to load/refresh user data")},[h,v.error]),w.useEffect(()=>{C()&&y.error&&Gt.error("Failed to fetch balances")},[C,y.error]),s.jsx(Hn.Provider,{value:{user:m,balances:N,hasBalances:!!N,isBalancesLoading:C()&&y.isFetching,refreshUser:D,refreshBalances:L,setFetchForAllNetworks:u,fetchForAllNetworks:c},children:e})},ru=pe.MAIN,nu=be.HOME,su=zr("GlyphViewProvider"),N6=({children:e})=>{const t=w.useContext(Hn);if(!t)throw new Error("GlyphViewProvider must be used within GlyphProvider");const{user:r}=t,[n,o]=w.useState(ru),[a,i]=w.useState(nu),[l,c]=w.useState(ve.CLOSED);return w.useEffect(()=>{switch(l){case ve.CLOSED:break;case ve.OPEN:o(ru),i(nu);break;case ve.FUND:o(pe.FUND);break;case ve.SWAP:o(pe.SWAP);break;case ve.SEND:o(pe.SEND);break;case ve.RECEIVE:o(pe.RECEIVE);break;case ve.PROFILE:r?.hasProfile?o(pe.PROFILE):(su.warn("Cannot open Profile view for a non-Glyph user - directing to Home view"),c(ve.OPEN));break;case ve.MAIN:o(pe.MAIN),i(ve.HOME);break;case ve.LINKED_ACCOUNTS:r?.hasProfile?(o(pe.MAIN),i(ve.LINKED_ACCOUNTS)):(su.warn("Cannot open Linked Accounts view for a non-Glyph user - directing to Home view"),c(ve.OPEN));break;case ve.HOME:case ve.ACTIVITY:case ve.TOKENS:case ve.NFTS:o(pe.MAIN),i(l);break}},[l,r?.hasProfile]),s.jsx(Bn.Provider,{value:{glyphView:l,setGlyphView:c,walletView:n,setWalletView:o,walletMainViewTab:a,setWalletMainViewTab:i},children:e})},S6=w.lazy(()=>Promise.resolve().then(()=>c3)),A6=w.lazy(()=>Promise.resolve().then(()=>m3)),Ca=({children:e,strategy:t=si,glyphUrl:r,useStagingTenant:n,...o})=>{const a=ge.useConfig();w.useEffect(()=>{if(a.chains){const f=new Set(ot.chains.map(h=>h.id)),d=new Set(a.chains.map(h=>h.id));if(!((h,v)=>h.size===v.size&&[...h].every(m=>v.has(m)))(f,d))throw new Error("Chain mismatch detected. Please use `useGlyphConfigureDynamicChains` from `@use-glyph/sdk-react` to configure chains dynamically.")}},[a.chains,ot.chains]);const i=w.useMemo(()=>({[mr.EIP1193]:A6,[mr.PRIVY]:S6}),[]),[l,c]=w.useState(t);w.useEffect(()=>{t&&Object.values(mr).includes(t)?c(t):c(si)},[t]);const u=w.useMemo(()=>i[l],[l,i]);return s.jsx(u,{glyphUrl:r?.trim?.(),useStagingTenant:n,...o,children:s.jsx(E6,{children:s.jsx(C6,{children:s.jsx(N6,{children:s.jsx(m6,{children:e})})})})})},xa=({className:e})=>s.jsx(w0,{className:V("gw-size-6 gw-text-brand-gray-700",e)});function ou(){const{setFetchForAllNetworks:e,fetchForAllNetworks:t}=me(),{iconMap:r}=s0(),n=ge.useChains(),o=ge.useChainId(),{switchChainAsync:a}=ge.useSwitchChain(),[i,l]=w.useState([]),[c,u]=w.useState(!1),f=w.useRef(null),d=t?s.jsx(xa,{}):s.jsx("img",{src:r.get(o),className:"gw-size-6 gw-rounded-full gw-object-cover"});return w.useEffect(()=>{l(n.slice().sort((g,h)=>(g.id===o?-1:1)-(h.id===o?-1:1)))},[n,o]),w.useEffect(()=>{const g=h=>{f.current&&!f.current.contains(h.target)&&u(!1)};return document.addEventListener("mousedown",g),()=>document.removeEventListener("mousedown",g)},[]),n?.length===1?d??s.jsx(Ne,{className:"gw-size-6 gw-rounded-full"}):s.jsxs("div",{className:"gw-relative",ref:f,children:[s.jsxs("button",{onClick:()=>u(!c),className:"gw-rounded-full gw-pl-0.5 gw-pr-1 gw-py-0.5 gw-h-auto gw-w-auto gw-min-w-0 !gw-ring-0 gw-flex gw-items-center gw-space-x-0.5 gw-bg-white/20 gw-backdrop-blur-sm gw-border gw-border-brand-white/20 gw-shadow-liquidSm",children:[s.jsx("div",{className:"gw-mx-0.5 gw-my-0.5",children:d??s.jsx(Ne,{className:"gw-size-6 gw-rounded-full"})}),s.jsx(No,{className:"gw-size-4 gw-text-gray-500"})]}),c&&s.jsxs("div",{className:"gw-absolute gw-top-full gw-right-0 gw-mt-1 gw-rounded-xl gw-z-50 gw-min-w-[14rem] gw-overflow-hidden gw-bg-popover/80 gw-backdrop-blur-sm gw-border gw-border-brand-white/20 gw-shadow-liquidSm",children:[s.jsxs("button",{onClick:()=>{e(!0),u(!1)},className:V("gw-w-full gw-flex gw-items-center gw-space-x-2 gw-px-1 gw-py-1 gw-text-left",t?"gw-bg-green-500/15":"hover:gw-bg-gray-500/15"),children:[s.jsx("div",{className:"gw-mx-1 gw-my-1",children:s.jsx(xa,{})}),s.jsx("span",{className:V("gw-text-sm",t&&"!gw-font-bold"),children:"All Supported Chains"})]},"All"),i.map(g=>{const h=!t&&g.id===o,v=Bt[g.id]||g.name,m=r.get(g.id),b=m?s.jsx("img",{src:m,alt:g.name,className:"gw-size-6 gw-rounded-full gw-object-cover"}):s.jsx(xa,{});return s.jsxs("button",{onClick:async()=>{u(!1),await a({chainId:g.id}),e(!1)},className:V("gw-w-full gw-flex gw-items-center gw-space-x-2 gw-px-1 gw-py-1 gw-text-left",h?"gw-bg-green-500/15":"hover:gw-bg-gray-500/15"),children:[s.jsx("div",{className:"gw-mx-1 gw-my-1",children:b}),s.jsx("span",{className:V("gw-text-sm",h&&"!gw-font-bold"),children:v})]},g.id)})]})]})}const T6=e=>{const t={};if(!e)return t;for(const[r,n]of Object.entries(e)){const o=(Array.isArray(n)?n:[n]).filter(a=>!!a);o.length&&(t[Number(r)]=o)}return t},Ea=(e,t)=>{const[r,n]=w.useState(),[o,a]=w.useState([]),i=JSON.stringify(t??{});return w.useEffect(()=>{r||(async()=>{const u=await fetch(`${e||Zs}/api/public/supported_chains`,{method:"GET"});if(!u.ok)throw new Error(`Failed to fetch Glyph required chains: ${u.status} ${u.statusText}`);const f=await u.json();if(Array.isArray(f.supportedChains)&&Array.isArray(f.chains)&&f.supportedChains.length>0&&f.chains.length>0){const d=T6(t),g=f.chains.map(h=>{const v=d[h.id];return v?{...h,httpRpcUrl:v[0]}:h});n(f.supportedChains),a(g.map(h=>{const v=Jn(h).viemChain,m=d[h.id];return m?{...v,rpcUrls:{...v.rpcUrls,default:{...v.rpcUrls.default,http:m,webSocket:[]},...v.rpcUrls.public?{public:{...v.rpcUrls.public,http:m,webSocket:[]}}:{}}}:v})),ot.configure({chains:g})}else throw new Error("No supported chains returned from API")})()},[e,r,i]),{chainIds:r,chains:o}};function Dn(){const e=w.useContext(Hn);if(!e)throw new Error("useBalances must be used within GlyphProvider");const{balances:t,hasBalances:r,refreshBalances:n,fetchForAllNetworks:o,setFetchForAllNetworks:a,isBalancesLoading:i}=e;return{balances:t,hasBalances:r,refreshBalances:n,fetchForAllNetworks:o,setFetchForAllNetworks:a,isBalancesLoading:i}}function k6(e,t,r){var n=r||{},o=n.noTrailing,a=o===void 0?!1:o,i=n.noLeading,l=i===void 0?!1:i,c=n.debounceMode,u=c===void 0?void 0:c,f,d=!1,g=0;function h(){f&&clearTimeout(f)}function v(b){var p=b||{},x=p.upcomingOnly,C=x===void 0?!1:x;h(),d=!C}function m(){for(var b=arguments.length,p=new Array(b),x=0;x<b;x++)p[x]=arguments[x];var C=this,y=Date.now()-g;if(d)return;function N(){g=Date.now(),t.apply(C,p)}function P(){f=void 0}!l&&u&&!f&&N(),h(),u===void 0&&y>e?l?(g=Date.now(),a||(f=setTimeout(u?P:N,e))):N():a!==!0&&(f=setTimeout(u?P:N,u===void 0?e-y:e))}return m.cancel=v,m}function Os(e,t,r){var n={},o=n.atBegin,a=o===void 0?!1:o;return k6(e,t,{debounceMode:a!==!1})}function P6({url:e,target:t,height:r,width:n}){const o=Math.round((window.screen.width-n)/2),a=Math.round((window.screen.height-r)/2),i=`width=${n},height=${r},resizable,scrollbars=yes,status=1,left=${o},top=${a},popup=true`;return window.open(e,t,i)}let Na=null;function _6(){const{glyphApiFetch:e}=wr(),t=ge.useChainId(),r=w.useCallback(async i=>{if(e&&i?.id){const l=await e(`/api/widget/onramp/quote/${i.id}/buy`,{method:"POST",headers:{"Content-Type":"application/json"}}),c=await l.json();return{url:l.ok?c.url:null,ok:l.ok,error:c.error}}return{url:null,ok:!1}},[e]),n=w.useCallback(async(i,l,c,u,f)=>{if(f&&Na?.abort?.(),!e)return{quote:null,ok:!1,error:"Glyph API not ready"};Na=new AbortController;const d=Na.signal,g=await e("/api/widget/onramp/quote",{method:"POST",body:JSON.stringify({chainId:t,amount:i,currency:l,country:c,subdivision:u}),headers:{"Content-Type":"application/json"},signal:d}),h=await g.json();return{quote:g.ok?h:null,ok:g.ok,error:h.error}},[t,e]),o=w.useCallback(async(i,l)=>{if(!e)return{quote:null,ok:!1,error:"Glyph API not ready"};const c=await e(`/api/widget/onramp/quote/${i}`,{method:"PATCH",body:JSON.stringify({amount:l}),headers:{"Content-Type":"application/json"}}),u=await c.json();return{quote:c.ok?u:null,ok:c.ok,error:u.error}},[e]),a=w.useCallback(async i=>{if(e&&i?.id){const l=await e(`/api/widget/onramp/quote/${i.id}/status`,{method:"GET",headers:{"Content-Type":"application/json"}});return l.ok?{...await l.json(),ok:!0}:{status:null,ok:!1}}return{status:null,ok:!1,details:""}},[e]);return{getPaymentLink:r,createQuote:n,getQuoteStatus:a,refreshQuote:o}}const I6=720,O6=460,L6=10*1e3,M6="Region not supported";function au(){const{user:e,nativeSymbol:t,refreshBalances:r}=me(),n=ge.useChainId(),{getPaymentLink:o,createQuote:a,getQuoteStatus:i,refreshQuote:l}=_6(),[c,u]=w.useState(""),[f,d]=w.useState(""),[g,h]=w.useState(2),[v,m]=w.useState(999999),[b,p]=w.useState(null),[x,C]=w.useState("STARTED"),[y,N]=w.useState(!1),[P,T]=w.useState(!1),[D,L]=w.useState(0),[A,O]=w.useState(null),[F,E]=w.useState(null),[I,_]=w.useState(!1);w.useEffect(()=>{e&&(d(e.currency??"USD"),h(e.minFundingAmount??2),m(e.maxFundingAmount??999999))},[e]);const M=w.useCallback(G=>{const z=typeof G=="string"?G:G(c);if(u(z),z&&Number(z)<g){p(`Minimum funding amount for your location is ${Ee(g,f)}.`);return}if(z&&Number(z)>v){p(`Maximum funding amount for your location is ${Ee(v,f)}.`);return}O(null),T(!1),_(!1),C("STARTED"),L(0),N(!0),E(null),p(null)},[c,g,v,f]),H=w.useMemo(()=>Os(1500,async G=>{try{N(!0);const z=await a(G,f,e.country,e?.subdivision,!0);if(!z.ok)throw new Error(z?.error||"Could not fetch the quote");E(null),O(z.quote)}catch(z){if(z?.name==="AbortError")return;E(z?.message)}N(!1)}),[f,e,a]),U=w.useCallback(async(G,z)=>{try{N(!0);const ce=await l(G,z);if(!ce.ok)throw new Error(ce?.error||"Could not update the quote");O(ce.quote)}catch(ce){E(ce?.message)}N(!1)},[l]);w.useEffect(()=>{if(e&&f&&c&&!P&&!I&&!b)if(A){const G=setInterval(()=>U(A.id,c),A.refresh_in_seconds*1e3);return()=>clearInterval(G)}else H(c)},[f,c,b,I,P,A,H,e,U]);const j=async(G,z,ce=!0)=>{if(!e)return z("User not authenticated");let Y="";try{if(!A)return z("Cannot create payment link for invalid quote");const K=await o(A);if(!K.ok||!K.url)return z(K?.error||"Cannot create payment link");if(Y=K.url,ce){const xe=P6({url:"",height:I6,width:O6});if(!xe)return z("Cannot open popup");xe.location.href=Y}T(!0)}catch(K){return z(K?.message||"Error initiating funding")}return G(Y)},re=w.useCallback(async G=>{L(z=>z+1);try{if(!A)throw new Error("Cannot fetch funding status for invalid quote");const z=await i(A);if(!z.ok)return G("Error fetching funding status");C(z.status),(z.status==="SUCCESS"||z.status==="FAILED")&&(z.status==="FAILED"?E(z.details):await r(!0),T(!1),_(!0))}catch(z){G(z?.message||"Error fetching funding status");return}},[A,i,r]);w.useEffect(()=>{if(!P)return;const G=setInterval(()=>re(E),D?L6:0);return()=>clearInterval(G)},[P,D,re]);const oe=!e?.isOnrampEnabled,we=n!==yt.apeChain.id,J=oe?M6:null;return{userCurrency:f,fundMinAmount:g,fundMaxAmount:v,fundIntermediaryToken:e?.cb_token,fundIntermediaryChain:e?.cb_chain,fundAmount:c,fundAmountError:b,fundDone:I,fundError:F,fundInProgress:P,fundQuote:A,fundStatus:x,isOnrampEnabled:!(oe||we),onramppDisabledError:J,quoteLoading:y,fundSymbol:t,doFunding:j,setFundAmount:M}}function iu(e){const t=w.useContext(Dr);if(!t)throw new Error("glyph hooks must be used within GlyphProvider");const{ready:r,authenticated:n,apiFetch:o,glyphUrl:a}=t,i=w.useMemo(()=>({key:crypto.randomUUID(),glyphUrl:a,identity:e,apiFetch:r&&n?o:null,active:!0}),[r,n,o,a,e]),l=w.useRef(i);l.current=i;const c=w.useCallback(()=>l.current===i&&i.active&&!!i.apiFetch,[i]);return w.useEffect(()=>(i.active=!0,()=>{i.active=!1}),[i]),{scope:i,isCurrent:c}}var lu=(e=>(e.FUND="FUND",e.SWAP="SWAP",e.WITHDRAW="WITHDRAW",e))(lu||{}),cu=(e=>(e.SEND="SEND",e.RECEIVE="RECEIVE",e.TRANSFER="TRANSFER",e.PAY="PAY",e))(cu||{});function du(e=10,t){const r=ot?.chains||[],{fetchForAllNetworks:n,user:o}=me(),{scope:a,isCurrent:i}=iu(o?.evmWallet),l=w.useRef(null),c=ge.useChainId(),[u,f]=w.useState(0),[d,g]=w.useState(!0),[h,v]=w.useState(!1),[m,b]=w.useState([]),p=t?.types?.join(",")??"",x=n?r.map(O=>O.id).join(","):String(c),C=`${a.key}:${x}:${e}:${p}`,y=w.useRef(C);y.current=C;const[N,P]=w.useState(C);w.useEffect(()=>(f(0),g(!0),v(!1),b([]),P(C),()=>{l.current?.abort()}),[C]);const T=w.useCallback(async(O=!1)=>{if(!i()||y.current!==C)return null;l.current?.abort();const F=new AbortController;l.current=F;const E=()=>i()&&y.current===C&&!F.signal.aborted;try{v(!0);const I=O?0:u;O&&b([]);const{value:_}=await Is(a.apiFetch,`/api/widget/activity?chainId=${x}&offset=${I}&size=${e}&type=${p}`,F.signal,E,a.key);let M=[];if(_.groups?M=_.groups:_.transactions&&(M=[{label:"",transactions:_.transactions}]),O)b(M),f(M.reduce((U,j)=>U+j.transactions.length,0));else{const U=A(m,M);b(U),f(I+e)}const H=M.reduce((U,j)=>U+j.transactions.length,0);return g(H===e),P(C),M}catch(I){return I?.name?.includes?.("AbortError")||E()&&Gt.error("Failed to fetch transactions"),null}finally{i()&&y.current===C&&l.current===F&&v(!1)}},[a,i,C,x,p,e,u,m]),D=async()=>!d||h?!1:(await T(),!0),L=async()=>{f(0),g(!0),await T(!0)},A=(O,F)=>{const E={};O.forEach(_=>{E[_.label]=[...E[_.label]||[],..._.transactions]}),F.forEach(_=>{E[_.label]=[...E[_.label]||[],..._.transactions]});const I=Object.entries(E).map(([_,M])=>({label:_,transactions:M}));return I.sort((_,M)=>{if(!_.label)return-1;if(!M.label)return 1;const H=new Date(_.label);return new Date(M.label).getTime()-H.getTime()}),I};return{refreshKey:C,transactionGroups:N===C&&i()?m:[],fetchTransactions:T,loadMore:D,reset:L,hasMore:d,isLoading:h}}function D6(){const{user:e}=me(),t=ge.useChainId(),{glyphApiFetch:r}=wr(),[n,o]=w.useState(!1);return{checkTokenGate:w.useCallback(async i=>{try{return e?r?(o(!0),await(await r("/api/widget/ownership_check",{method:"POST",body:JSON.stringify({chainId:t,walletAddress:e.evmWallet,...i}),headers:{"Content-Type":"application/json"}})).json()):{result:!1,error:"Glyph API not ready"}:{result:!1,error:"User not authenticated"}}catch(l){return{result:!1,error:l?.message||"Glyph tokengate error"}}finally{o(!1)}},[t,e,r,o]),isTokenGateLoading:n}}function F6(){const{user:e}=me(),t=ge.useChainId(),{glyphApiFetch:r}=wr(),[n,o]=w.useState(!1);return{checkOwnership:w.useCallback(async i=>{try{return e?r?(o(!0),await(await r("/api/widget/ownership_check",{method:"POST",body:JSON.stringify({chainId:t,walletAddress:e.evmWallet,...i}),headers:{"Content-Type":"application/json"}})).json()):{result:!1,error:"Glyph API not ready",tokens:[],delegationChain:[]}:{result:!1,error:"User not authenticated",tokens:[],delegationChain:[]}}catch(l){return{result:!1,error:l?.message||"Glyph ownership check error",tokens:[],delegationChain:[]}}finally{o(!1)}},[r,t]),isOwnershipCheckLoading:n}}const U6=()=>{const e=w.useContext(Bn);if(e===void 0)throw new Error("useGlyphView must be used within a GlyphViewProvider");const{setGlyphView:t}=e;return{setGlyphView:t}},uu=()=>{const{connectAsync:e,connectors:t}=ge.useConnect(),{disconnect:r}=ge.useDisconnect();return{connect:w.useCallback(async()=>{const o=t.find(a=>a.id===dt.id);if(!o)throw new Error("Glyph Wallet Connector not found");await e({connector:o})},[e,t]),disconnect:r}},B6=()=>{const{connect:e}=uu(),{isConnected:t,isConnecting:r}=ge.useAccount();return t?s.jsx(Ao,{}):r?s.jsx(ue,{variant:"default",size:"login",disabled:!0,children:s.jsxs("span",{className:"gw-inline-flex gw-items-center gw-w-full gw-gap-1",children:[s.jsx("span",{className:"gw-p-2 gw-rounded-full",children:s.jsx(yr,{className:"!gw-size-5"})}),s.jsx(Nr,{className:"gw-size-4 gw-animate-spin"})]})}):s.jsx(ue,{variant:"default",size:"login",onClick:e,className:"gw-w-52 !gw-justify-start",children:s.jsxs("span",{className:"gw-flex gw-items-center gw-gap-1 gw-w-full",children:[s.jsx("span",{className:"gw-p-2 gw-rounded-full",children:s.jsx(yr,{className:"!gw-size-5"})}),s.jsx("span",{className:"gw-flex-1 gw-text-center",children:"Connect to Glyph"})]})})};function fu(e={}){const{rkDetails:t,useStagingTenant:r}=e;return n=>{const o=js.toPrivyWalletConnector({iconUrl:dt.iconUrl,id:r?Ut:Ft,name:dt.name})(n);return{...o,...t,getProvider:async l=>{const c=l?.chainId??n.chains?.[0]?.id??yt.apeChain.id;return await o.getProvider({chainId:c})},type:dt.type,id:dt.id}}}const H6=new lt.QueryClient,$6=({queryClient:e=H6,children:t,ssr:r,...n})=>{const{chains:o}=Ea(n.glyphUrl,n.rpcUrls),a=w.useMemo(()=>o&&o.length>0?ge.createConfig({chains:o,ssr:r,connectors:[fu({useStagingTenant:n.useStagingTenant})],transports:o.reduce((i,l)=>{const c=(l.rpcUrls?.default?.http??[]).filter(Boolean);return i[l.id]=c.length?$.fallback(c.map(u=>$.http(u))):$.http(),i},{}),multiInjectedProviderDiscovery:!1}):null,[o,n.useStagingTenant,r]);return a?s.jsx(ge.WagmiProvider,{config:a,children:s.jsx(lt.QueryClientProvider,{client:e,children:s.jsx(Ca,{strategy:mr.EIP1193,walletClientType:Ys.WAGMI,...n,children:t})})}):null},V6=js.toPrivyWallet({id:Ft,name:dt.name,iconUrl:dt.iconUrl}),z6=js.toPrivyWallet({id:Ut,name:dt.name,iconUrl:dt.iconUrl}),W6=zr("usePrivyCrossAppProvider"),gu=({chains:e,useStagingTenant:t})=>{const{loginWithCrossAppAccount:r,linkCrossAppAccount:n,sendTransaction:o,signMessage:a,signTypedData:i}=ln.useCrossAppAccounts(),{user:l,authenticated:c,ready:u}=ln.usePrivy(),[f,d]=w.useState(null);w.useEffect(()=>{e.length>0&&!f&&d(e[0].id.toString())},[e,f]);const g=w.useMemo(()=>({web3_clientVersion:!0,web3_sha3:!0,net_listening:!0,net_peerCount:!0,net_version:!0,eth_blobBaseFee:!0,eth_blockNumber:!0,eth_call:!0,eth_chainId:!0,eth_coinbase:!0,eth_estimateGas:!0,eth_feeHistory:!0,eth_gasPrice:!0,eth_getBalance:!0,eth_getBlockByHash:!0,eth_getBlockByNumber:!0,eth_getBlockTransactionCountByHash:!0,eth_getBlockTransactionCountByNumber:!0,eth_getCode:!0,eth_getFilterChanges:!0,eth_getFilterLogs:!0,eth_getLogs:!0,eth_getProof:!0,eth_getStorageAt:!0,eth_getTransactionByBlockHashAndIndex:!0,eth_getTransactionByBlockNumberAndIndex:!0,eth_getTransactionByHash:!0,eth_getTransactionCount:!0,eth_getTransactionReceipt:!0,eth_getUncleByBlockHashAndIndex:!0,eth_getUncleByBlockNumberAndIndex:!0,eth_getUncleCountByBlockHash:!0,eth_getUncleCountByBlockNumber:!0,eth_maxPriorityFeePerGas:!0,eth_newBlockFilter:!0,eth_newFilter:!0,eth_newPendingTransactionFilter:!0,eth_protocolVersion:!0,eth_sendRawTransaction:!0,eth_uninstallFilter:!0,zks_estimateFee:!0}),[]),h=w.useCallback(E=>!!g[E],[g]),v=w.useMemo(()=>Object.fromEntries(e.map(E=>{const I=E.rpcUrls.default.http.filter(Boolean);return[E.id,$.createPublicClient({chain:E,transport:I.length?$.fallback(I.map(_=>$.http(_))):$.http()})]})),[e]),m=w.useCallback(E=>{if(!E)return{smartAccount:void 0,signer:void 0};const I=E.linkedAccounts.find(H=>H.type==="cross_app"&&H.providerApp.id===(t?Ut:Ft)),_=I?.smartWallets?.[0]?.address,M=I?.embeddedWallets?.[0]?.address;return{smartAccount:_||void 0,signer:M||void 0}},[t]),b=w.useCallback(async E=>{if(!u)return{accounts:[],user:null};let I=l;E&&(!I&&!c?I=await r({appId:t?Ut:Ft}):!I&&c&&(I=await n({appId:t?Ut:Ft})));const{signer:_}=m(I);return _?{accounts:[_],user:I}:{accounts:[],user:I}},[l,c,u,r,n,t,m]),p=!!(u&&c&&l&&l.linkedAccounts.some(E=>E.type==="cross_app"&&E.providerApp.id===(t?Ut:Ft))),{signer:x,smartAccount:C}=m(l),y=JSON.stringify([p,u,l?.id,x,C,t]),N=u&&!l,P=JSON.stringify([l?.id,x,C,t]),T=w.useMemo(()=>({active:!1,generation:0,key:y,identity:P,successor:null,request:null,interactiveLogin:N,listeners:new Map}),[y,N,P]),D=w.useRef(null),L=T.listeners,A=w.useCallback(E=>{E!==f&&(d(E),(L.get("chainChanged")||[]).forEach(_=>_(E)))},[f,L]),O=w.useCallback(async E=>{const{method:I,params:_}=E;W6.debug("Handling provider request");const M=_?.chainId||_?.[0]?.chainId||+f;if(h(I))return v[M].request(E);switch(I){case"eth_requestAccounts":return await b(!0);case"eth_accounts":return(await b(!1)).accounts;case"wallet_addEthereumChain":case"wallet_switchEthereumChain":{const U=_[0].chainId;if(!U)throw new Error("Chain ID is required");const j=$.isHex(U)?$.hexToNumber(U):U;if(!Object.values(e).find(oe=>oe.id===j))throw new Error(`Chain ${j} not supported`);return A(j.toString()),null}case"wallet_revokePermissions":return null;case"eth_signTransaction":throw new Error("eth_signTransaction is not supported");case"eth_sendTransaction":{const H=_[0];return A(M.toString()),await o({...H,chainId:M},{address:H.from})}case"eth_signTypedData_v4":return A(M.toString()),await i(JSON.parse(_[1]),{address:_[0],chainId:M});case"eth_sign":throw new Error("eth_sign is unsafe and not supported");case"personal_sign":return A(M.toString()),await a($.fromHex(_[0],"string"),{address:_[1],chainId:M});default:throw new Error(`Unsupported request: ${I}`)}},[h,v,b,a,i,o,f,A,e]);w.useLayoutEffect(()=>{D.current&&D.current!==T&&(D.current.successor=T),D.current=T,T.active=!0;const E=++T.generation;return()=>{T.active=!1,queueMicrotask(()=>{T.generation===E&&!T.active&&L.clear()})}},[T,L]),w.useLayoutEffect(()=>{T.request=O},[T,O]);const F=w.useMemo(()=>({on:(E,I)=>{L.set(E,[...L.get(E)??[],I])},removeListener:(E,I)=>{L.set(E,(L.get(E)??[]).filter(_=>_!==I))},request:(async E=>{if(!T.active||!T.request)throw new Error("Privy session is no longer active");const I=await T.request(E);if(E.method==="eth_requestAccounts"){const _=I.user,M=m(_),H=JSON.stringify([_?.id,M.signer,M.smartAccount,t]),U=T.successor;if(!T.active&&!(T.interactiveLogin&&U&&U===D.current&&U.active&&U.identity===H))throw new Error("Privy session is no longer active");return I.accounts}if(!T.active&&E.method!=="eth_sendTransaction")throw new Error("Privy session is no longer active");return I})}),[T,L,m,t]);return{ready:p,provider:F,chainId:f?parseInt(f):e[0].id}},j6=zr("InjectWagmiConnector"),wu=({children:e,useStagingTenant:t})=>{const r=ge.useConfig(),{ready:n,provider:o}=gu({chains:r.chains,useStagingTenant:t});return w.useEffect(()=>{if(!n||!o)return;let a=!1;const i=[],l=new Proxy(o,{get(d,g){if(g==="on")return(v,m)=>{a||(i.push({event:v,listener:m}),d.on(v,m))};if(g==="removeListener")return(v,m)=>{d.removeListener(v,m);const b=i.findIndex(p=>p.event===v&&p.listener===m);b!==-1&&i.splice(b,1)};const h=Reflect.get(d,g);return typeof h=="function"?h.bind(d):h}}),c=r._internal.connectors.setup(r0(l,t)),u=c.connect.bind(c);c.connect=async(...d)=>{if(a)throw new Error("Connector is retired");const g=await u(...d);if(a)throw new Error("Connector is retired");return g},r._internal.connectors.setState([...r.connectors,c]);const f=()=>{a=!0;for(const{event:g,listener:h}of i.splice(0))o.removeListener(g,h);const d=r._internal.events;c.emitter.off("connect",d.connect),c.emitter.off("change",d.change),c.emitter.off("disconnect",d.disconnect),r._internal.connectors.setState(r.connectors.filter(g=>g!==c)),r.setState(g=>{if(!g.connections.has(c.uid))return g;const h=new Map(g.connections);h.delete(c.uid);const v=g.current===c.uid?h.keys().next().value??null:g.current;return{...g,connections:h,current:v,status:h.size?g.status:"disconnected"}})};return(async()=>{try{if(await r.storage?.removeItem(`${dt.id}.disconnected`),a||!await c.isAuthorized()||a)return;const d=await c.connect({isReconnecting:!0});if(a||!d.accounts.length)return;const g=r._internal.events;c.emitter.off("connect",g.connect),c.emitter.on("change",g.change),c.emitter.on("disconnect",g.disconnect),r.setState(h=>({...h,connections:new Map(h.connections).set(c.uid,{...d,accounts:d.accounts,connector:c}),current:h.current??c.uid,status:"connected"}))}catch{a||j6.error("Failed to setup or reconnect connector")}})(),f},[n,o,t,r]),s.jsx(s.Fragment,{children:e})},Sa=`privy:${Ft}`,Aa=`privy:${Ut}`,G6=({queryClient:e=new lt.QueryClient,glyphUrl:t,useStagingTenant:r,ssr:n,onLogin:o,onLogout:a,rpcUrls:i,...l})=>{const{chains:c}=Ea(t,i),u=w.useMemo(()=>{if(!(!c||c.length===0))return Ja.createConfig({chains:c,ssr:n,connectors:[],transports:c.reduce((d,g)=>{const h=(g.rpcUrls?.default?.webSocket??[]).filter(Boolean),v=(g.rpcUrls?.default?.http??[]).filter(Boolean),m=[...h.map(b=>$.webSocket(b)),...v.map(b=>$.http(b))];return d[g.id]=m.length?$.fallback(m):$.http(),d},{}),multiInjectedProviderDiscovery:!1})},[c,n]),f=w.useMemo(()=>!c||c.length===0?l:(l.config?l.config.loginMethodsAndOrder?l.config.defaultChain||(l.config.defaultChain=c[0]):l.config.loginMethodsAndOrder={primary:[r?Aa:Sa]}:l.config={loginMethodsAndOrder:{primary:[r?Aa:Sa]},defaultChain:c[0]},{...l,config:{...l.config,supportedChains:c}}),[l,c,r]);return!u||!f.config?null:s.jsx(ln.PrivyProvider,{...f,children:s.jsx(lt.QueryClientProvider,{client:e,children:s.jsx(Ja.WagmiProvider,{config:u,children:s.jsx(wu,{useStagingTenant:r,children:s.jsx(Ca,{strategy:mr.PRIVY,glyphUrl:t,useStagingTenant:r,onLogin:o,onLogout:a,children:l.children})})})})})},q6=typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__dirname+"/assets/USDIcon.png").href:new URL("assets/USDIcon.png",typeof document>"u"?location.href:document.currentScript&&document.currentScript.tagName.toUpperCase()==="SCRIPT"&&document.currentScript.src||document.baseURI).href;function Z6(e){return s.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[s.jsxs("g",{clipPath:"url(#clip0_2143_5128)",children:[s.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2.61602 3.16387C2.96293 2.81696 3.43344 2.62207 3.92404 2.62207H6.92085C7.31525 2.62207 7.63497 2.94179 7.63497 3.33619C7.63497 3.73059 7.31525 4.05031 6.92085 4.05031H3.92404C3.81223 4.05031 3.705 4.09473 3.62594 4.17379C3.54688 4.25285 3.50246 4.36008 3.50246 4.47189V12.4218C3.50246 12.5336 3.54688 12.6409 3.62594 12.7199C3.705 12.799 3.81223 12.8434 3.92404 12.8434H11.874C11.9858 12.8434 12.093 12.799 12.1721 12.7199C12.2511 12.6409 12.2955 12.5336 12.2955 12.4218V9.16244C12.2955 8.76805 12.6153 8.44832 13.0097 8.44832C13.4041 8.44832 13.7238 8.76805 13.7238 9.16244V12.4218C13.7238 12.9124 13.5289 13.3829 13.182 13.7298C12.8351 14.0767 12.3646 14.2716 11.874 14.2716H3.92404C3.43344 14.2716 2.96293 14.0767 2.61602 13.7298C2.26911 13.3829 2.07422 12.9124 2.07422 12.4218V4.47189C2.07422 3.98129 2.26911 3.51078 2.61602 3.16387Z",fill:"currentColor"}),s.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.36743 1.93238C8.36743 1.53718 8.68781 1.2168 9.08301 1.2168H14.3571V6.70854C14.3571 7.10375 14.0367 7.42413 13.6415 7.42413C13.2463 7.42413 12.9259 7.10375 12.9259 6.70854V3.7643L7.50929 9.63969C7.24141 9.93026 6.7887 9.94865 6.49813 9.68077C6.20756 9.41289 6.18917 8.96018 6.45705 8.66961L12.0085 2.64797H9.08301C8.68781 2.64797 8.36743 2.32759 8.36743 1.93238Z",fill:"currentColor"})]}),s.jsx("defs",{children:s.jsx("clipPath",{id:"clip0_2143_5128",children:s.jsx("rect",{width:"14.3118",height:"15.0273",fill:"white",transform:"translate(0.792969 0.389648)"})})})]})}function hu(e,t,r){let n=e;if(n.includes(t)&&!n.endsWith(t)){const[o,a]=n.split(t);a.length>r&&(n=`${o}${t}${a.substring(0,r)}`)}return n}function Ls(e,t){let r=e;return r.match(/^0+[.,]/)&&(r=r.replace(/^0+/,"0")),r.match(/^0[0-9]+/)&&(r=r.replace(/^0+/,"")),r=hu(r,".",t),r=hu(r,",",t),r}function Ms(e){return s.jsxs("svg",{width:"175",height:"175",viewBox:"0 0 175 175",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[s.jsx("circle",{cx:"87.5",cy:"87.5",r:"87.5",fill:"#929792"}),s.jsx("g",{clipPath:"url(#clip0_4594_16001)",filter:"url(#filter0_d_4594_16001)",children:s.jsx("g",{filter:"url(#filter1_d_4594_16001)",children:s.jsx("path",{d:"M110.139 65.9764C99.9177 55.4825 88.8017 47.8048 79.3155 43.8935C74.5667 41.9482 70.2392 40.9505 66.6961 40.9515C63.1529 40.9524 60.5034 41.8708 58.6363 43.6892C56.7693 45.5076 55.7814 48.1321 55.687 51.6739C55.5927 55.2158 56.4759 59.5682 58.2954 64.3666C61.9552 73.9526 69.3371 85.2671 79.5579 95.7611C89.7788 106.255 100.895 113.933 110.376 117.839C115.133 119.793 119.457 120.787 123 120.786C126.544 120.785 129.193 119.867 131.06 118.048C132.927 116.23 133.915 113.605 134.009 110.064C134.104 106.522 133.224 102.173 131.396 97.3661C127.741 87.7849 120.359 76.4704 110.139 65.9764ZM51.6994 50.4456L43.6197 58.3151C42.6057 59.3027 41.6178 61.9271 41.5234 65.469C41.429 69.0108 42.3122 73.3632 44.1317 78.1616C47.7916 87.7476 55.1734 99.0622 65.3943 109.556C75.6151 120.05 86.7311 127.728 96.2126 131.634C100.969 133.588 105.294 134.582 108.837 134.581C112.38 134.58 115.029 133.662 116.043 132.674L124.123 124.805C123.741 124.832 123.376 124.843 122.995 124.838C118.721 124.829 113.938 123.685 108.849 121.585C98.6564 117.399 87.2109 109.415 76.6608 98.5828C66.1108 87.7509 58.4315 76.0988 54.5189 65.8024C52.5545 60.662 51.5344 55.8471 51.64 51.5761C51.6466 51.1965 51.6787 50.8108 51.6994 50.4456Z",fill:"#B9B9B9"})})}),s.jsxs("defs",{children:[s.jsxs("filter",{id:"filter0_d_4594_16001",x:"2.43213",y:"6.43359",width:"170.669",height:"170.668",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB",children:[s.jsx("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),s.jsx("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),s.jsx("feOffset",{dy:"4"}),s.jsx("feGaussianBlur",{stdDeviation:"2"}),s.jsx("feComposite",{in2:"hardAlpha",operator:"out"}),s.jsx("feColorMatrix",{type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"}),s.jsx("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow_4594_16001"}),s.jsx("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect1_dropShadow_4594_16001",result:"shape"})]}),s.jsxs("filter",{id:"filter1_d_4594_16001",x:"37.5165",y:"40.9531",width:"100.5",height:"101.629",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB",children:[s.jsx("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),s.jsx("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),s.jsx("feOffset",{dy:"4"}),s.jsx("feGaussianBlur",{stdDeviation:"2"}),s.jsx("feComposite",{in2:"hardAlpha",operator:"out"}),s.jsx("feColorMatrix",{type:"matrix",values:"0 0 0 0 0.458139 0 0 0 0 0.458139 0 0 0 0 0.458139 0 0 0 1 0"}),s.jsx("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow_4594_16001"}),s.jsx("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect1_dropShadow_4594_16001",result:"shape"})]}),s.jsx("clipPath",{id:"clip0_4594_16001",children:s.jsx("rect",{width:"115.034",height:"115.034",fill:"white",transform:"translate(88.8388 6.43359) rotate(45.7554)"})})]})]})}function Fn({className:e}){const{balances:t}=me(),r=ge.useChainId(),n=t?.tokens?.find?.(a=>a.native&&a?.chainId===r),o=n?.logo;return o?s.jsx("img",{src:o,alt:n?.symbol,className:V("gw-size-6 gw-rounded-full gw-object-cover",e)}):s.jsx(Ms,{className:V("gw-size-6",e)})}function Y6(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ds={},pu;function K6(){if(pu)return Ds;pu=1,Object.defineProperty(Ds,"__esModule",{value:!0});var e=/^(0x[a-zA-Z0-9]{4})[a-zA-Z0-9]+([a-zA-Z0-9]{4})$/,t=function(r){var n=r.match(e);return n?n[1]+"…"+n[2]:r};return Ds.default=t,Ds}var X6=K6();const at=Y6(X6);function Q6(e){return s.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:s.jsx("path",{d:"M15.41 16.59L10.83 12L15.41 7.41L14 6L8 12L14 18L15.41 16.59Z",fill:"currentColor"})})}function J6(e){const{isCopied:t,...r}=e;return t?s.jsx("svg",{viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...r,children:s.jsx("path",{d:"M8.6 14.6L15.65 7.55L14.25 6.15L8.6 11.8L5.75 8.95L4.35 10.35L8.6 14.6ZM10 20C8.61667 20 7.31667 19.7373 6.1 19.212C4.88333 18.6873 3.825 17.975 2.925 17.075C2.025 16.175 1.31267 15.1167 0.788 13.9C0.262667 12.6833 0 11.3833 0 10C0 8.61667 0.262667 7.31667 0.788 6.1C1.31267 4.88333 2.025 3.825 2.925 2.925C3.825 2.025 4.88333 1.31233 6.1 0.787C7.31667 0.262333 8.61667 0 10 0C11.3833 0 12.6833 0.262333 13.9 0.787C15.1167 1.31233 16.175 2.025 17.075 2.925C17.975 3.825 18.6873 4.88333 19.212 6.1C19.7373 7.31667 20 8.61667 20 10C20 11.3833 19.7373 12.6833 19.212 13.9C18.6873 15.1167 17.975 16.175 17.075 17.075C16.175 17.975 15.1167 18.6873 13.9 19.212C12.6833 19.7373 11.3833 20 10 20Z",fill:"currentColor"})}):s.jsxs("svg",{viewBox:"0 0 18 17",fill:"none",xmlns:"http://www.w3.org/2000/svg",...r,children:[s.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6.87207 8.31641C6.87207 7.21184 7.7675 6.31641 8.87207 6.31641H14.5016C15.6061 6.31641 16.5016 7.21184 16.5016 8.31641V13.3281C16.5016 14.4327 15.6061 15.3281 14.5016 15.3281H8.87207C7.7675 15.3281 6.87207 14.4327 6.87207 13.3281V8.31641ZM14.5016 8.31641H8.87207V13.3281H14.5016V8.31641Z",fill:"currentColor"}),s.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.02246 3.36719C3.02246 2.26262 3.91789 1.36719 5.02246 1.36719H10.3771C11.4817 1.36719 12.3771 2.26262 12.3771 3.36719V4.63574H10.3771V3.36719H5.02246V8.99737H5.67204V10.9974H5.02246C3.91789 10.9974 3.02246 10.1019 3.02246 8.99737V3.36719Z",fill:"currentColor"})]})}const R6=({text:e,textToCopy:t,className:r,textClassName:n,iconClassName:o})=>{const[a,i]=w.useState(!1);return s.jsxs("button",{onClick:()=>{const l=t0(t||e);i(l),setTimeout(()=>{i(!1)},2e3)},className:V("gw-inline-flex gw-items-center gw-justify-end gw-text-brand-gray-500 gw-gap-1",r),children:[s.jsx("span",{className:n,children:e}),s.jsx("span",{children:s.jsx(J6,{isCopied:a,className:V("gw-text-secondary gw-size-4",o)})})]})},_r=w.memo(R6),e4=({fullScreenHeader:e,onProfileClick:t,isStickyHeader:r})=>{const{user:n}=me(),o=w.useRef(null),[a,i]=w.useState(!1);return w.useEffect(()=>{if(!r||!e?.title)return;const l=o.current;if(!l)return;const c=l.closest(".gw-wallet-view"),u=c?.querySelector(".gw-wallet-content");if(!c||!u)return;const f=l.closest(".gw-wallet-header"),d=f?f.offsetTop:0,g=()=>{const v=c.scrollTop>d;i(v)};return g(),c.addEventListener("scroll",g,{passive:!0}),()=>{c.removeEventListener("scroll",g)}},[e?.title,r]),e&&e?.title?s.jsx(s.Fragment,{children:s.jsxs("div",{ref:o,className:"gw-flex gw-items-center gw-space-x-4 gw-justify-between gw-w-full",children:[s.jsx("div",{className:"gw-size-12",children:e?.onBackClick?s.jsx("button",{className:V("gw-size-full gw-inline-flex gw-items-center"),onClick:e?.onBackClick,children:s.jsx("span",{className:V("gw-transition-all gw-duration-300",a?"gw-px-1 gw-py-1 gw-bg-white/40 gw-backdrop-blur-sm gw-border gw-border-brand-white/20 gw-shadow-liquidSm gw-rounded-full":"gw-border-transparent gw-shadow-none"),children:s.jsx(Q6,{className:V("gw-transition-all",a?"gw-w-5 gw-h-5":"gw-w-6 gw-h-6")})})}):null}),s.jsx("div",{className:V("gw-transition-all gw-duration-300",a?"gw-px-2 gw-py-1 gw-bg-white/40 gw-backdrop-blur-sm gw-border gw-border-brand-white/20 gw-shadow-liquidSm gw-rounded-full gw-typography-body2":"gw-typography-subtitle1 gw-border-transparent gw-shadow-none"),children:e.title}),s.jsx("div",{className:"gw-size-12",children:e?.onCloseClick?s.jsx("button",{className:V("gw-size-full gw-inline-flex gw-items-center"),onClick:e?.onCloseClick,children:s.jsx("span",{className:V("gw-transition-all gw-duration-300",a?"gw-px-1 gw-py-1 gw-bg-white/40 gw-backdrop-blur-sm gw-border gw-border-brand-white/20 gw-shadow-liquidSm gw-rounded-full":"gw-border-transparent gw-shadow-none"),children:s.jsx(Rt,{className:V("gw-transition-all",a?"gw-w-5 gw-h-5":"gw-w-6 gw-h-6")})})}):null})]})}):s.jsx(s.Fragment,{children:s.jsxs("div",{className:"gw-flex gw-items-center gw-space-x-4 gw-justify-between gw-w-full",children:[s.jsxs("div",{className:"gw-flex gw-items-center gw-space-x-4 gw-justify-between",children:[s.jsx("button",{onClick:t,disabled:!n?.hasProfile,children:s.jsx(Ct,{className:"gw-size-12"})}),s.jsxs("div",{className:"gw-flex gw-flex-col",children:[s.jsx("button",{onClick:t,disabled:!n?.hasProfile,children:s.jsx("div",{className:"gw-mt-1.5 gw-typography-subtitle1 gw-text-left",children:n?.name})}),s.jsx("div",{children:s.jsx(_r,{textClassName:"gw-max-w-56 gw-break-all gw-typography-body2",text:at(n.evmWallet),textToCopy:n.evmWallet})})]})]}),s.jsx(ou,{})]})})},Zt=w.memo(e4);function st({mainFooter:e=!0,isStickyHeader:t,...r}){return s.jsxs("div",{className:V("gw-wallet-view","gw-overflow-y-auto"),style:{scrollbarGutter:"stable"},children:[r.header&&s.jsx("div",{className:V("gw-wallet-header",t?"gw-sticky gw-top-0 gw-z-10":"",r.headerClassName),children:r.header}),s.jsx("div",{className:"gw-wallet-content",children:r.content}),r.footer&&s.jsx("div",{className:V(`${e?"gw-wallet-footer-nav gw-sticky gw-z-10 gw-rounded-full gw-m-4 gw-bottom-4 gw-right-4 gw-mt-0 gw-bg-brand-white/40 gw-backdrop-blur-sm gw-border gw-border-brand-white/20 gw-shadow-liquid":"gw-wallet-footer"} ${r.footerCols?"gw-flex-col gw-flex-nowrap gw-items-center":"gw-flex-row gw-flex-nowrap"}`,r.footerClassName),children:r.footer})]})}function t4(e){return s.jsxs("svg",{width:"17",height:"17",viewBox:"0 0 17 17",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[s.jsx("g",{clipPath:"url(#clip0_114_7349)",children:s.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.17526 2.92832C4.83466 2.92832 2.12656 5.63641 2.12656 8.97702C2.12656 12.3176 4.83466 15.0257 8.17526 15.0257C11.5159 15.0257 14.224 12.3176 14.224 8.97702C14.224 5.63641 11.5159 2.92832 8.17526 2.92832ZM0.890625 8.97702C0.890625 4.95383 4.15207 1.69238 8.17526 1.69238C12.1985 1.69238 15.4599 4.95383 15.4599 8.97702C15.4599 13.0002 12.1985 16.2617 8.17526 16.2617C4.15207 16.2617 0.890625 13.0002 0.890625 8.97702ZM8.01797 6.09037C7.56262 6.17853 7.23374 6.458 7.13875 6.82319C7.05283 7.15349 6.71542 7.35161 6.38511 7.26569C6.05481 7.17978 5.85669 6.84236 5.94261 6.51206C6.18584 5.57696 6.98216 5.03202 7.78305 4.87696C8.58183 4.72232 9.52098 4.92632 10.1262 5.64535C10.809 6.45654 10.9445 7.49367 10.5598 8.34691C10.2421 9.05142 9.59704 9.57332 8.74137 9.74306V9.94707C8.74137 10.2884 8.4647 10.565 8.1234 10.565C7.78211 10.565 7.50543 10.2884 7.50543 9.94707V9.18426C7.50543 8.84297 7.78211 8.5663 8.1234 8.5663C8.84083 8.5663 9.25922 8.22452 9.43309 7.8389C9.61246 7.44109 9.57333 6.90774 9.18068 6.44127C8.92354 6.13579 8.47542 6.0018 8.01797 6.09037ZM8.0833 12.9359C8.53581 12.9359 8.90264 12.5691 8.90264 12.1166C8.90264 11.664 8.53581 11.2972 8.0833 11.2972C7.63079 11.2972 7.26396 11.664 7.26396 12.1166C7.26396 12.5691 7.63079 12.9359 8.0833 12.9359Z",fill:"currentColor"})}),s.jsx("defs",{children:s.jsx("clipPath",{id:"clip0_114_7349",children:s.jsx("rect",{width:"16",height:"16",fill:"white",transform:"translate(0.173828 0.977539)"})})})]})}function Ot({contentClassName:e,triggerClassName:t,description:r,children:n,side:o,align:a,defaultOpen:i,open:l,onOpenChange:c,stopPropagation:u}){const[f,d]=w.useState(!1);return s.jsxs(y6,{defaultOpen:i,delayDuration:0,onOpenChange:c===void 0?d:c,open:l===void 0?f:l===null?void 0:l,children:[s.jsx(b6,{asChild:!0,onClick:g=>{u&&g.stopPropagation(),l===void 0&&!c&&d(h=>!h)},children:n??s.jsx("div",{children:s.jsx(t4,{className:V("gw-text-brand-gray-500 gw-size-5",t)})})}),s.jsx(v6,{align:a,className:V("gw-max-w-72",e),side:o,children:s.jsx("div",{children:r})})]})}function Ta(e){return s.jsxs("svg",{width:"105",height:"105",viewBox:"0 0 105 105",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[s.jsx("path",{d:"M20.361 59.0825V55.3721H21.8028C22.5926 55.3721 23.1279 55.8703 23.1279 56.6018C23.1279 57.328 22.5926 57.8263 21.8028 57.8263H20.9918V59.0825H20.361ZM20.9918 57.2644H21.8134C22.2109 57.2644 22.4919 56.9941 22.4919 56.6018C22.4919 56.2043 22.2109 55.934 21.8134 55.934H20.9918V57.2644ZM23.6416 59.0825V55.3721H24.2565V59.0825H23.6416ZM26.0586 59.1461C25.2741 59.1461 24.6698 58.579 24.6698 57.7733C24.6698 56.9676 25.2635 56.4004 26.0321 56.4004C26.7901 56.4004 27.3307 56.9146 27.3307 57.6991C27.3307 57.7945 27.3201 57.8952 27.3148 57.9429H25.29C25.3324 58.351 25.6451 58.6267 26.0586 58.6267C26.3978 58.6267 26.6417 58.4358 26.7265 58.2185L27.2777 58.3669C27.1399 58.8069 26.6735 59.1461 26.0586 59.1461ZM25.3112 57.4923H26.7371C26.6947 57.1372 26.3978 56.9252 26.0374 56.9252C25.6823 56.9252 25.396 57.1319 25.3112 57.4923ZM28.5601 59.1461C28.0459 59.1461 27.6378 58.8599 27.6378 58.3722C27.6378 57.9323 27.924 57.662 28.4594 57.5771L29.3499 57.4393V57.3651C29.3499 57.0789 29.1325 56.9252 28.8092 56.9252C28.4912 56.9252 28.2526 57.1001 28.136 57.3704L27.659 57.1266C27.8233 56.6813 28.2579 56.4004 28.8092 56.4004C29.4983 56.4004 29.9647 56.8033 29.9647 57.3651V59.0825H29.3552V58.8281C29.1749 59.0295 28.9046 59.1461 28.5601 59.1461ZM28.2367 58.3404C28.2367 58.5631 28.4223 58.685 28.6979 58.6797C29.0848 58.6744 29.3499 58.4517 29.3499 58.0701V57.8793L28.576 58.0012C28.3693 58.0383 28.2367 58.1602 28.2367 58.3404ZM31.4905 59.1461C30.9074 59.1461 30.4303 58.8228 30.3667 58.3934L30.8915 58.2556C30.9445 58.5048 31.1724 58.6797 31.4851 58.6797C31.7343 58.6797 31.8986 58.5631 31.8986 58.3828C31.8986 58.2291 31.7873 58.1337 31.4851 58.0489L31.1618 57.9588C30.6901 57.821 30.4515 57.5824 30.4515 57.2008C30.4515 56.7237 30.8226 56.4004 31.4109 56.4004C31.9516 56.4004 32.3598 56.6919 32.4711 57.1372L31.941 57.2379C31.8668 57.0206 31.6654 56.8722 31.4162 56.8722C31.183 56.8669 31.0346 56.9941 31.0346 57.1637C31.0346 57.3174 31.1459 57.4128 31.4427 57.487L31.7714 57.5718C32.2325 57.6991 32.4817 57.927 32.4817 58.3298C32.4817 58.8175 32.0788 59.1461 31.4905 59.1461ZM34.1737 59.1461C33.3892 59.1461 32.785 58.579 32.785 57.7733C32.785 56.9676 33.3786 56.4004 34.1472 56.4004C34.9052 56.4004 35.4459 56.9146 35.4459 57.6991C35.4459 57.7945 35.4353 57.8952 35.43 57.9429H33.4051C33.4475 58.351 33.7603 58.6267 34.1737 58.6267C34.513 58.6267 34.7568 58.4358 34.8416 58.2185L35.3929 58.3669C35.255 58.8069 34.7886 59.1461 34.1737 59.1461ZM33.4263 57.4923H34.8522C34.8098 57.1372 34.513 56.9252 34.1525 56.9252C33.7974 56.9252 33.5111 57.1319 33.4263 57.4923ZM38.2586 59.1461C37.5006 59.1461 36.9441 58.5843 36.9441 57.7733C36.9441 56.9676 37.5006 56.4004 38.2586 56.4004C38.6138 56.4004 38.9265 56.5276 39.1385 56.7608V55.3721H39.7534V59.0825H39.1385V58.791C38.9159 59.0242 38.6085 59.1461 38.2586 59.1461ZM37.559 57.7733C37.559 58.2503 37.8982 58.5896 38.3487 58.5896C38.7993 58.5896 39.1385 58.2503 39.1385 57.7733C39.1385 57.3015 38.7993 56.957 38.3487 56.957C37.8982 56.957 37.559 57.2962 37.559 57.7733ZM41.559 59.1461C40.7745 59.1461 40.1702 58.579 40.1702 57.7733C40.1702 56.9729 40.7798 56.4004 41.559 56.4004C42.3382 56.4004 42.9477 56.9729 42.9477 57.7733C42.9477 58.579 42.3382 59.1461 41.559 59.1461ZM40.7851 57.7733C40.7851 58.245 41.1084 58.5896 41.559 58.5896C42.0042 58.5896 42.3329 58.245 42.3329 57.7733C42.3329 57.3015 42.0042 56.957 41.559 56.957C41.1084 56.957 40.7851 57.3015 40.7851 57.7733ZM44.5861 59.0825V56.464H45.201V56.7184C45.3653 56.5117 45.625 56.4004 45.9536 56.4004C46.5367 56.4004 46.9449 56.8086 46.9449 57.3969V59.0825H46.33V57.5612C46.33 57.1902 46.118 56.957 45.7734 56.957C45.4236 56.957 45.201 57.1955 45.201 57.5612V59.0825H44.5861ZM48.7372 59.1461C47.9527 59.1461 47.3484 58.579 47.3484 57.7733C47.3484 56.9729 47.958 56.4004 48.7372 56.4004C49.5164 56.4004 50.1259 56.9729 50.1259 57.7733C50.1259 58.579 49.5164 59.1461 48.7372 59.1461ZM47.9633 57.7733C47.9633 58.245 48.2866 58.5896 48.7372 58.5896C49.1824 58.5896 49.5111 58.245 49.5111 57.7733C49.5111 57.3015 49.1824 56.957 48.7372 56.957C48.2866 56.957 47.9633 57.3015 47.9633 57.7733ZM51.6924 59.1143C51.1517 59.1143 50.7966 58.7804 50.7966 58.2662V56.9888H50.2983V56.464H50.5104C50.7224 56.464 50.7966 56.3368 50.7966 55.9764V55.7643H51.4115V56.464H52.0846V56.9888H51.4115V58.2291C51.4115 58.4676 51.544 58.6055 51.7719 58.6055C51.8938 58.6055 52.0157 58.579 52.1164 58.5472L52.2013 59.0295C52.0475 59.0825 51.8726 59.1143 51.6924 59.1143ZM55.0089 59.1461C54.2191 59.1461 53.6466 58.579 53.6466 57.7786C53.6466 56.9729 54.2244 56.4004 55.0089 56.4004C55.6344 56.4004 56.1061 56.7608 56.2227 57.222L55.6715 57.3704C55.6026 57.1584 55.364 56.957 55.0195 56.957C54.5848 56.957 54.2615 57.275 54.2615 57.7786C54.2615 58.2768 54.5848 58.5896 55.0195 58.5896C55.364 58.5896 55.6026 58.3881 55.6715 58.1814L56.2227 58.3298C56.1061 58.7857 55.6344 59.1461 55.0089 59.1461ZM56.6429 59.0825V55.3721H57.2578V59.0825H56.6429ZM59.0599 59.1461C58.2754 59.1461 57.6712 58.579 57.6712 57.7733C57.6712 56.9729 58.2807 56.4004 59.0599 56.4004C59.8391 56.4004 60.4487 56.9729 60.4487 57.7733C60.4487 58.579 59.8391 59.1461 59.0599 59.1461ZM58.286 57.7733C58.286 58.245 58.6094 58.5896 59.0599 58.5896C59.5052 58.5896 59.8338 58.245 59.8338 57.7733C59.8338 57.3015 59.5052 56.957 59.0599 56.957C58.6094 56.957 58.286 57.3015 58.286 57.7733ZM61.8765 59.1461C61.2934 59.1461 60.8163 58.8228 60.7527 58.3934L61.2775 58.2556C61.3305 58.5048 61.5584 58.6797 61.8712 58.6797C62.1203 58.6797 62.2846 58.5631 62.2846 58.3828C62.2846 58.2291 62.1733 58.1337 61.8712 58.0489L61.5478 57.9588C61.0761 57.821 60.8375 57.5824 60.8375 57.2008C60.8375 56.7237 61.2086 56.4004 61.797 56.4004C62.3376 56.4004 62.7458 56.6919 62.8571 57.1372L62.327 57.2379C62.2528 57.0206 62.0514 56.8722 61.8023 56.8722C61.569 56.8669 61.4206 56.9941 61.4206 57.1637C61.4206 57.3174 61.5319 57.4128 61.8288 57.487L62.1574 57.5718C62.6186 57.6991 62.8677 57.927 62.8677 58.3298C62.8677 58.8175 62.4648 59.1461 61.8765 59.1461ZM64.5597 59.1461C63.7752 59.1461 63.171 58.579 63.171 57.7733C63.171 56.9676 63.7646 56.4004 64.5332 56.4004C65.2912 56.4004 65.8319 56.9146 65.8319 57.6991C65.8319 57.7945 65.8213 57.8952 65.816 57.9429H63.7911C63.8336 58.351 64.1463 58.6267 64.5597 58.6267C64.899 58.6267 65.1428 58.4358 65.2276 58.2185L65.7789 58.3669C65.6411 58.8069 65.1746 59.1461 64.5597 59.1461ZM63.8124 57.4923H65.2382C65.1958 57.1372 64.899 56.9252 64.5385 56.9252C64.1834 56.9252 63.8972 57.1319 63.8124 57.4923ZM68.6447 59.1143C68.104 59.1143 67.7489 58.7804 67.7489 58.2662V56.9888H67.2506V56.464H67.4626C67.6746 56.464 67.7489 56.3368 67.7489 55.9764V55.7643H68.3637V56.464H69.0369V56.9888H68.3637V58.2291C68.3637 58.4676 68.4962 58.6055 68.7242 58.6055C68.8461 58.6055 68.968 58.579 69.0687 58.5472L69.1535 59.0295C68.9998 59.0825 68.8249 59.1143 68.6447 59.1143ZM69.5137 59.0825V55.3721H70.1286V56.7661C70.2929 56.5276 70.5526 56.4004 70.8813 56.4004C71.4643 56.4004 71.8725 56.8086 71.8725 57.3969V59.0825H71.2576V57.5612C71.2576 57.1902 71.0456 56.957 70.701 56.957C70.3512 56.957 70.1286 57.1955 70.1286 57.5612V59.0825H69.5137ZM72.3983 59.0825V56.464H73.0132V59.0825H72.3983ZM72.2976 55.7219C72.2976 55.4993 72.4778 55.3138 72.7058 55.3138C72.939 55.3138 73.1192 55.4993 73.1192 55.7219C73.1192 55.9499 72.939 56.1354 72.7058 56.1354C72.4778 56.1354 72.2976 55.9499 72.2976 55.7219ZM74.5764 59.1461C73.9934 59.1461 73.5163 58.8228 73.4527 58.3934L73.9775 58.2556C74.0305 58.5048 74.2584 58.6797 74.5711 58.6797C74.8203 58.6797 74.9846 58.5631 74.9846 58.3828C74.9846 58.2291 74.8733 58.1337 74.5711 58.0489L74.2478 57.9588C73.776 57.821 73.5375 57.5824 73.5375 57.2008C73.5375 56.7237 73.9085 56.4004 74.4969 56.4004C75.0376 56.4004 75.4457 56.6919 75.557 57.1372L75.027 57.2379C74.9528 57.0206 74.7513 56.8722 74.5022 56.8722C74.269 56.8669 74.1206 56.9941 74.1206 57.1637C74.1206 57.3174 74.2319 57.4128 74.5287 57.487L74.8574 57.5718C75.3185 57.6991 75.5676 57.927 75.5676 58.3298C75.5676 58.8175 75.1648 59.1461 74.5764 59.1461ZM78.3825 59.1143C77.8418 59.1143 77.4867 58.7804 77.4867 58.2662V56.9888H76.9884V56.464H77.2004C77.4125 56.464 77.4867 56.3368 77.4867 55.9764V55.7643H78.1015V56.464H78.7747V56.9888H78.1015V58.2291C78.1015 58.4676 78.2341 58.6055 78.462 58.6055C78.5839 58.6055 78.7058 58.579 78.8065 58.5472L78.8913 59.0295C78.7376 59.0825 78.5627 59.1143 78.3825 59.1143ZM80.0678 59.1461C79.5537 59.1461 79.1455 58.8599 79.1455 58.3722C79.1455 57.9323 79.4317 57.662 79.9671 57.5771L80.8576 57.4393V57.3651C80.8576 57.0789 80.6403 56.9252 80.3169 56.9252C79.9989 56.9252 79.7604 57.1001 79.6438 57.3704L79.1667 57.1266C79.331 56.6813 79.7657 56.4004 80.3169 56.4004C81.006 56.4004 81.4725 56.8033 81.4725 57.3651V59.0825H80.8629V58.8281C80.6827 59.0295 80.4124 59.1461 80.0678 59.1461ZM79.7445 58.3404C79.7445 58.5631 79.93 58.685 80.2056 58.6797C80.5926 58.6744 80.8576 58.4517 80.8576 58.0701V57.8793L80.0837 58.0012C79.877 58.0383 79.7445 58.1602 79.7445 58.3404ZM83.4859 59.1461C83.136 59.1461 82.8286 59.0242 82.606 58.791V59.0825H81.9911V55.3721H82.606V56.7608C82.818 56.5276 83.1254 56.4004 83.4859 56.4004C84.2438 56.4004 84.8004 56.9676 84.8004 57.7733C84.8004 58.5843 84.2438 59.1461 83.4859 59.1461ZM82.606 57.7733C82.606 58.2503 82.9452 58.5896 83.3957 58.5896C83.8463 58.5896 84.1855 58.2503 84.1855 57.7733C84.1855 57.2962 83.8463 56.957 83.3957 56.957C82.9452 56.957 82.606 57.3015 82.606 57.7733ZM85.3637 59.1143C85.1411 59.1143 84.9714 58.9394 84.9714 58.7221C84.9714 58.5101 85.1411 58.3298 85.3637 58.3298C85.5863 58.3298 85.7559 58.5101 85.7559 58.7221C85.7559 58.9394 85.5863 59.1143 85.3637 59.1143Z",fill:"#FF4500"}),s.jsx("path",{d:"M40.2522 49.5017C38.9037 49.5017 38.0556 48.5942 37.9538 47.7885L38.8613 47.5341C38.9631 47.9836 39.4295 48.5688 40.2437 48.5688C40.8458 48.5688 41.3038 48.2804 41.3038 47.7716C41.3038 47.3305 40.9307 47.0931 40.4133 46.9489L39.6246 46.7199C38.6917 46.4485 38.1234 45.9312 38.1234 45.0831C38.1234 44.0314 38.9885 43.3614 40.108 43.3614C41.3802 43.3614 42.0756 44.0908 42.2282 44.8795L41.3123 45.134C41.219 44.7269 40.8543 44.2943 40.1504 44.2943C39.5652 44.2943 39.1581 44.5912 39.1581 45.0661C39.1581 45.5071 39.4804 45.7107 40.0317 45.8633L40.8204 46.0838C41.8381 46.3807 42.3385 46.9319 42.3385 47.7546C42.3385 48.8232 41.4141 49.5017 40.2522 49.5017ZM44.6365 49.5017C43.6951 49.5017 43.0421 48.8317 43.0421 47.8055V45.2103H44.0259V47.6528C44.0259 48.2634 44.3821 48.6112 44.9249 48.6112C45.4761 48.6112 45.8323 48.2041 45.8323 47.5765V45.2103H46.8161V49.3999H45.8323V48.8995C45.5609 49.2896 45.1539 49.5017 44.6365 49.5017ZM49.5742 49.5017C48.3105 49.5017 47.3946 48.5942 47.3946 47.3136C47.3946 46.0245 48.319 45.1085 49.5742 45.1085C50.5749 45.1085 51.3297 45.6852 51.5163 46.4231L50.6343 46.6605C50.5241 46.3213 50.1424 45.999 49.5911 45.999C48.8957 45.999 48.3784 46.5079 48.3784 47.3136C48.3784 48.1108 48.8957 48.6112 49.5911 48.6112C50.1424 48.6112 50.5241 48.2889 50.6343 47.9581L51.5163 48.1956C51.3297 48.925 50.5749 49.5017 49.5742 49.5017ZM54.0797 49.5017C52.816 49.5017 51.9001 48.5942 51.9001 47.3136C51.9001 46.0245 52.8245 45.1085 54.0797 45.1085C55.0805 45.1085 55.8353 45.6852 56.0219 46.4231L55.1398 46.6605C55.0296 46.3213 54.6479 45.999 54.0967 45.999C53.4012 45.999 52.8839 46.5079 52.8839 47.3136C52.8839 48.1108 53.4012 48.6112 54.0967 48.6112C54.6479 48.6112 55.0296 48.2889 55.1398 47.9581L56.0219 48.1956C55.8353 48.925 55.0805 49.5017 54.0797 49.5017ZM58.6276 49.5017C57.3725 49.5017 56.4056 48.5942 56.4056 47.3051C56.4056 46.016 57.3555 45.1085 58.5852 45.1085C59.798 45.1085 60.6631 45.9312 60.6631 47.1864C60.6631 47.339 60.6461 47.5002 60.6376 47.5765H57.3979C57.4657 48.2295 57.9661 48.6705 58.6276 48.6705C59.1704 48.6705 59.5606 48.3652 59.6962 48.0175L60.5783 48.255C60.3578 48.9589 59.6114 49.5017 58.6276 49.5017ZM57.4318 46.8556H59.7132C59.6454 46.2874 59.1704 45.9481 58.5937 45.9481C58.0255 45.9481 57.5675 46.2789 57.4318 46.8556ZM62.8588 49.5017C61.9259 49.5017 61.1626 48.9843 61.0608 48.2974L61.9004 48.0769C61.9853 48.4755 62.3499 48.7553 62.8503 48.7553C63.2489 48.7553 63.5118 48.5688 63.5118 48.2804C63.5118 48.0345 63.3337 47.8818 62.8503 47.7461L62.333 47.6019C61.5782 47.3814 61.1965 46.9998 61.1965 46.3891C61.1965 45.6259 61.7902 45.1085 62.7316 45.1085C63.5966 45.1085 64.2497 45.575 64.4278 46.2874L63.5797 46.4485C63.4609 46.1008 63.1387 45.8633 62.7401 45.8633C62.3669 45.8548 62.1294 46.0584 62.1294 46.3298C62.1294 46.5757 62.3075 46.7284 62.7825 46.8471L63.3083 46.9828C64.0461 47.1864 64.4447 47.551 64.4447 48.1956C64.4447 48.9759 63.8002 49.5017 62.8588 49.5017ZM66.6686 49.5017C65.7357 49.5017 64.9724 48.9843 64.8706 48.2974L65.7103 48.0769C65.7951 48.4755 66.1598 48.7553 66.6601 48.7553C67.0587 48.7553 67.3217 48.5688 67.3217 48.2804C67.3217 48.0345 67.1436 47.8818 66.6601 47.7461L66.1428 47.6019C65.388 47.3814 65.0063 46.9998 65.0063 46.3891C65.0063 45.6259 65.6 45.1085 66.5414 45.1085C67.4065 45.1085 68.0595 45.575 68.2376 46.2874L67.3895 46.4485C67.2708 46.1008 66.9485 45.8633 66.5499 45.8633C66.1767 45.8548 65.9393 46.0584 65.9393 46.3298C65.9393 46.5757 66.1174 46.7284 66.5923 46.8471L67.1181 46.9828C67.856 47.1864 68.2546 47.551 68.2546 48.1956C68.2546 48.9759 67.61 49.5017 66.6686 49.5017Z",fill:"black"}),s.jsx("circle",{cx:"52.5332",cy:"52.5205",r:"51.9238",fill:"url(#paint0_linear_266_5356)"}),s.jsx("path",{d:"M33.2988 33.1992L72.6068 72.5072",stroke:"#FAFAFA",strokeWidth:"4",strokeLinecap:"round"}),s.jsx("path",{d:"M72.6074 33.1992L33.2995 72.5072",stroke:"#FAFAFA",strokeWidth:"4",strokeLinecap:"round"}),s.jsx("defs",{children:s.jsxs("linearGradient",{id:"paint0_linear_266_5356",x1:"52.5332",y1:"0.59668",x2:"52.5332",y2:"104.444",gradientUnits:"userSpaceOnUse",children:[s.jsx("stop",{stopColor:"#E67E75"}),s.jsx("stop",{offset:"1",stopColor:"#DF5448"})]})})]})}const r4=({onEnd:e,onShowActivity:t,id:r})=>s.jsx(st,{isStickyHeader:!1,content:s.jsxs("div",{className:"gw-w-full gw-min-h-full gw-flex gw-flex-col gw-items-center gw-rounded-6xl gw-relative",children:[s.jsx("div",{className:"gw-flex gw-justify-end gw-w-full gw-p-4 gw-relative gw-z-10",children:s.jsx("div",{className:"gw-size-12",children:s.jsx("button",{className:"gw-size-full gw-inline-flex gw-justify-center gw-items-center",onClick:e,children:s.jsx(Rt,{className:"gw-size-6"})})})}),s.jsx("div",{className:"gw-w-full gw-p-4 gw-relative gw-z-10 gw-flex-1 gw-flex-col gw-flex gw-justify-end",children:s.jsxs("div",{className:"gw-flex gw-flex-col gw-items-center gw-w-full",children:[s.jsx(Ta,{className:"gw-size-24"}),s.jsxs("span",{className:"gw-mt-7 gw-typography-h4-nr gw-text-center",children:["Transaction",s.jsx("br",{}),"failed."]}),s.jsx("span",{className:"gw-mt-3 gw-text-center gw-whitespace-pre-wrap !gw-leading-tight",children:`Your transaction failed.
57
57
  Please try again.`}),s.jsxs("div",{className:"gw-my-10 gw-flex gw-p-4 gw-items-center gw-w-full gw-justify-center gw-space-x-2 gw-typography-caption",children:[s.jsx("span",{children:"Transaction ID: "}),s.jsx(_r,{className:"!gw-text-foreground",textToCopy:r,text:r.slice(0,20)+"..."})]}),s.jsx(ue,{variant:"tertiary",className:"gw-w-full",onClick:t,children:"View Activity"})]})})]})}),n4=w.memo(r4);function Ge(e){return s.jsx("svg",{width:"15",viewBox:"0 0 15 9",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:s.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M14.3943 0.341538C14.0449 -0.00777915 13.4786 -0.00777917 13.1293 0.341538L7.5004 5.97041L1.87152 0.341538C1.52221 -0.0077797 0.955853 -0.00777972 0.606536 0.341538C0.257219 0.690854 0.257219 1.25721 0.606536 1.60652L6.86791 7.86789C7.21722 8.21721 7.78358 8.21721 8.13289 7.86789L14.3943 1.60653C14.7436 1.25721 14.7436 0.690855 14.3943 0.341538Z",fill:"currentColor"})})}function ka(e){return s.jsxs("svg",{width:"255",height:"254",viewBox:"0 0 255 254",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[s.jsx("path",{d:"M237.421 190.499C252.107 165.061 257.519 135.317 252.735 106.337C247.95 77.3557 233.264 50.9305 211.181 31.5634C189.097 12.1963 160.981 1.08568 131.623 0.124617C102.266 -0.836447 73.4833 8.41152 50.18 26.2928C26.8767 44.174 10.4944 69.5822 3.82443 98.1881C-2.84552 126.794 0.609563 156.828 13.601 183.172C26.5924 209.516 48.3163 230.54 75.0713 242.662C101.826 254.785 131.957 257.256 160.329 249.653L159.284 245.754C131.814 253.114 102.642 250.722 76.7374 238.985C50.8331 227.248 29.7999 206.892 17.2216 181.386C4.64325 155.88 1.29802 126.801 7.75589 99.1047C14.2138 71.4085 30.0752 46.8082 52.6375 29.4955C75.1998 12.1828 103.067 3.22887 131.491 4.15937C159.915 5.08988 187.137 15.8472 208.519 34.5985C229.901 53.3498 244.119 78.9348 248.752 106.994C253.384 135.053 248.144 163.851 233.925 188.48L237.421 190.499Z",fill:"url(#paint0_linear_116_7923)"}),s.jsx("defs",{children:s.jsxs("linearGradient",{id:"paint0_linear_116_7923",x1:"127.469",y1:"0.0566442",x2:"187.157",y2:"231.817",gradientUnits:"userSpaceOnUse",children:[s.jsx("stop",{stopColor:"#8FCA94"}),s.jsx("stop",{offset:"1",stopColor:"#5D9461",stopOpacity:"0"})]})})]})}const s4=({onBack:e,id:t,value:r})=>{const{user:n,nativeSymbol:o}=me();return s.jsx(st,{isStickyHeader:!0,header:s.jsx(Zt,{isStickyHeader:!0,fullScreenHeader:{title:"Transaction Status",onCloseClick:e}}),content:s.jsxs("div",{className:"gw-p-4 gw-pt-0 gw-h-full",children:[s.jsx("h6",{children:"Finalizing Purchase"}),s.jsxs("div",{className:"gw-mt-4 gw-typography-caption gw-flex gw-justify-between gw-items-center",children:[s.jsx("span",{children:"Estimated wait time:"}),s.jsx("span",{className:"gw-text-brand-gray-500",children:"1-5 mins"})]}),s.jsx("div",{className:"gw-mt-4 gw-flex gw-justify-center gw-items-center",children:s.jsxs("div",{className:"gw-rounded-full gw-flex gw-flex-col gw-items-center gw-justify-center gw-p-10 gw-relative gw-size-64 gw-overflow-hidden gw-bg-brand-white",children:[s.jsx(ka,{className:"gw-absolute gw-inset-0 gw-animate-spin gw-size-64 gw-z-0"}),s.jsxs("div",{className:"gw-flex gw-items-center gw-justify-center gw-relative gw-z-[1]",children:[s.jsx(Fn,{className:"gw-size-8"}),s.jsxs("div",{className:"gw-typography-h6 gw-ml-3",children:[s.jsx("span",{children:r})," ",s.jsx("span",{className:"gw-text-brand-gray-500",children:o})]})]}),s.jsxs("div",{className:"gw-my-4 gw-flex gw-flex-col gw-items-center gw-justify-center gw-text-brand-success gw-relative gw-z-[1]",children:[s.jsx(Ge,{className:"gw-animate-pulse gw-w-4"}),s.jsx(Ge,{className:"gw-animate-pulse gw-delay-300 gw-w-4"}),s.jsx(Ge,{className:"gw-animate-pulse gw-delay-600 gw-w-4"})]}),s.jsxs("div",{className:"gw-flex gw-items-center gw-space-x-3 gw-justify-between gw-relative gw-z-[1]",children:[s.jsx(Ct,{className:"gw-size-8"}),s.jsxs("div",{className:"gw-flex gw-flex-col gw-typography-body2",children:[s.jsx("div",{className:"",children:n?.name}),s.jsx("div",{className:"gw-text-brand-gray-600",children:at(n.evmWallet)})]})]})]})})]}),footer:s.jsxs(s.Fragment,{children:[s.jsxs("span",{className:"gw-inline-flex gw-items-center gw-space-x-2 gw-typography-caption gw-text-brand-gray-500",children:[s.jsx("span",{children:"Transaction ID: "}),s.jsx(_r,{textToCopy:t,text:t.slice(0,20)+"..."})]}),s.jsx(ue,{variant:"tertiary",className:"gw-w-full gw-mt-4",onClick:e,children:"Back to Home"})]}),footerCols:!0,mainFooter:!1})},o4=w.memo(s4);function Pa(e){return s.jsxs("svg",{width:"105",height:"105",viewBox:"0 0 105 105",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[s.jsx("path",{d:"M20.361 59.082V55.3716H21.8028C22.5926 55.3716 23.1279 55.8699 23.1279 56.6013C23.1279 57.3275 22.5926 57.8258 21.8028 57.8258H20.9918V59.082H20.361ZM20.9918 57.2639H21.8134C22.2109 57.2639 22.4919 56.9936 22.4919 56.6013C22.4919 56.2038 22.2109 55.9335 21.8134 55.9335H20.9918V57.2639ZM23.6416 59.082V55.3716H24.2565V59.082H23.6416ZM26.0586 59.1456C25.2741 59.1456 24.6698 58.5785 24.6698 57.7728C24.6698 56.9671 25.2635 56.3999 26.0321 56.3999C26.7901 56.3999 27.3307 56.9141 27.3307 57.6986C27.3307 57.794 27.3201 57.8947 27.3148 57.9424H25.29C25.3324 58.3505 25.6451 58.6262 26.0586 58.6262C26.3978 58.6262 26.6417 58.4354 26.7265 58.218L27.2777 58.3664C27.1399 58.8064 26.6735 59.1456 26.0586 59.1456ZM25.3112 57.4918H26.7371C26.6947 57.1367 26.3978 56.9247 26.0374 56.9247C25.6823 56.9247 25.396 57.1314 25.3112 57.4918ZM28.5601 59.1456C28.0459 59.1456 27.6378 58.8594 27.6378 58.3717C27.6378 57.9318 27.924 57.6615 28.4594 57.5767L29.3499 57.4388V57.3646C29.3499 57.0784 29.1325 56.9247 28.8092 56.9247C28.4912 56.9247 28.2526 57.0996 28.136 57.3699L27.659 57.1261C27.8233 56.6808 28.2579 56.3999 28.8092 56.3999C29.4983 56.3999 29.9647 56.8028 29.9647 57.3646V59.082H29.3552V58.8276C29.1749 59.029 28.9046 59.1456 28.5601 59.1456ZM28.2367 58.3399C28.2367 58.5626 28.4223 58.6845 28.6979 58.6792C29.0848 58.6739 29.3499 58.4513 29.3499 58.0696V57.8788L28.576 58.0007C28.3693 58.0378 28.2367 58.1597 28.2367 58.3399ZM31.4905 59.1456C30.9074 59.1456 30.4303 58.8223 30.3667 58.393L30.8915 58.2551C30.9445 58.5043 31.1724 58.6792 31.4851 58.6792C31.7343 58.6792 31.8986 58.5626 31.8986 58.3823C31.8986 58.2286 31.7873 58.1332 31.4851 58.0484L31.1618 57.9583C30.6901 57.8205 30.4515 57.582 30.4515 57.2003C30.4515 56.7233 30.8226 56.3999 31.4109 56.3999C31.9516 56.3999 32.3598 56.6915 32.4711 57.1367L31.941 57.2374C31.8668 57.0201 31.6654 56.8717 31.4162 56.8717C31.183 56.8664 31.0346 56.9936 31.0346 57.1632C31.0346 57.3169 31.1459 57.4123 31.4427 57.4865L31.7714 57.5714C32.2325 57.6986 32.4817 57.9265 32.4817 58.3293C32.4817 58.817 32.0788 59.1456 31.4905 59.1456ZM34.1737 59.1456C33.3892 59.1456 32.785 58.5785 32.785 57.7728C32.785 56.9671 33.3786 56.3999 34.1472 56.3999C34.9052 56.3999 35.4459 56.9141 35.4459 57.6986C35.4459 57.794 35.4353 57.8947 35.43 57.9424H33.4051C33.4475 58.3505 33.7603 58.6262 34.1737 58.6262C34.513 58.6262 34.7568 58.4354 34.8416 58.218L35.3929 58.3664C35.255 58.8064 34.7886 59.1456 34.1737 59.1456ZM33.4263 57.4918H34.8522C34.8098 57.1367 34.513 56.9247 34.1525 56.9247C33.7974 56.9247 33.5111 57.1314 33.4263 57.4918ZM38.2586 59.1456C37.5006 59.1456 36.9441 58.5838 36.9441 57.7728C36.9441 56.9671 37.5006 56.3999 38.2586 56.3999C38.6138 56.3999 38.9265 56.5271 39.1385 56.7604V55.3716H39.7534V59.082H39.1385V58.7905C38.9159 59.0237 38.6085 59.1456 38.2586 59.1456ZM37.559 57.7728C37.559 58.2498 37.8982 58.5891 38.3487 58.5891C38.7993 58.5891 39.1385 58.2498 39.1385 57.7728C39.1385 57.301 38.7993 56.9565 38.3487 56.9565C37.8982 56.9565 37.559 57.2957 37.559 57.7728ZM41.559 59.1456C40.7745 59.1456 40.1702 58.5785 40.1702 57.7728C40.1702 56.9724 40.7798 56.3999 41.559 56.3999C42.3382 56.3999 42.9477 56.9724 42.9477 57.7728C42.9477 58.5785 42.3382 59.1456 41.559 59.1456ZM40.7851 57.7728C40.7851 58.2445 41.1084 58.5891 41.559 58.5891C42.0042 58.5891 42.3329 58.2445 42.3329 57.7728C42.3329 57.301 42.0042 56.9565 41.559 56.9565C41.1084 56.9565 40.7851 57.301 40.7851 57.7728ZM44.5861 59.082V56.4635H45.201V56.718C45.3653 56.5112 45.625 56.3999 45.9536 56.3999C46.5367 56.3999 46.9449 56.8081 46.9449 57.3964V59.082H46.33V57.5608C46.33 57.1897 46.118 56.9565 45.7734 56.9565C45.4236 56.9565 45.201 57.195 45.201 57.5608V59.082H44.5861ZM48.7372 59.1456C47.9527 59.1456 47.3484 58.5785 47.3484 57.7728C47.3484 56.9724 47.958 56.3999 48.7372 56.3999C49.5164 56.3999 50.1259 56.9724 50.1259 57.7728C50.1259 58.5785 49.5164 59.1456 48.7372 59.1456ZM47.9633 57.7728C47.9633 58.2445 48.2866 58.5891 48.7372 58.5891C49.1824 58.5891 49.5111 58.2445 49.5111 57.7728C49.5111 57.301 49.1824 56.9565 48.7372 56.9565C48.2866 56.9565 47.9633 57.301 47.9633 57.7728ZM51.6924 59.1138C51.1517 59.1138 50.7966 58.7799 50.7966 58.2657V56.9883H50.2983V56.4635H50.5104C50.7224 56.4635 50.7966 56.3363 50.7966 55.9759V55.7638H51.4115V56.4635H52.0846V56.9883H51.4115V58.2286C51.4115 58.4672 51.544 58.605 51.7719 58.605C51.8938 58.605 52.0157 58.5785 52.1164 58.5467L52.2013 59.029C52.0475 59.082 51.8726 59.1138 51.6924 59.1138ZM55.0089 59.1456C54.2191 59.1456 53.6466 58.5785 53.6466 57.7781C53.6466 56.9724 54.2244 56.3999 55.0089 56.3999C55.6344 56.3999 56.1061 56.7604 56.2227 57.2215L55.6715 57.3699C55.6026 57.1579 55.364 56.9565 55.0195 56.9565C54.5848 56.9565 54.2615 57.2745 54.2615 57.7781C54.2615 58.2763 54.5848 58.5891 55.0195 58.5891C55.364 58.5891 55.6026 58.3876 55.6715 58.1809L56.2227 58.3293C56.1061 58.7852 55.6344 59.1456 55.0089 59.1456ZM56.6429 59.082V55.3716H57.2578V59.082H56.6429ZM59.0599 59.1456C58.2754 59.1456 57.6712 58.5785 57.6712 57.7728C57.6712 56.9724 58.2807 56.3999 59.0599 56.3999C59.8391 56.3999 60.4487 56.9724 60.4487 57.7728C60.4487 58.5785 59.8391 59.1456 59.0599 59.1456ZM58.286 57.7728C58.286 58.2445 58.6094 58.5891 59.0599 58.5891C59.5052 58.5891 59.8338 58.2445 59.8338 57.7728C59.8338 57.301 59.5052 56.9565 59.0599 56.9565C58.6094 56.9565 58.286 57.301 58.286 57.7728ZM61.8765 59.1456C61.2934 59.1456 60.8163 58.8223 60.7527 58.393L61.2775 58.2551C61.3305 58.5043 61.5584 58.6792 61.8712 58.6792C62.1203 58.6792 62.2846 58.5626 62.2846 58.3823C62.2846 58.2286 62.1733 58.1332 61.8712 58.0484L61.5478 57.9583C61.0761 57.8205 60.8375 57.582 60.8375 57.2003C60.8375 56.7233 61.2086 56.3999 61.797 56.3999C62.3376 56.3999 62.7458 56.6915 62.8571 57.1367L62.327 57.2374C62.2528 57.0201 62.0514 56.8717 61.8023 56.8717C61.569 56.8664 61.4206 56.9936 61.4206 57.1632C61.4206 57.3169 61.5319 57.4123 61.8288 57.4865L62.1574 57.5714C62.6186 57.6986 62.8677 57.9265 62.8677 58.3293C62.8677 58.817 62.4648 59.1456 61.8765 59.1456ZM64.5597 59.1456C63.7752 59.1456 63.171 58.5785 63.171 57.7728C63.171 56.9671 63.7646 56.3999 64.5332 56.3999C65.2912 56.3999 65.8319 56.9141 65.8319 57.6986C65.8319 57.794 65.8213 57.8947 65.816 57.9424H63.7911C63.8336 58.3505 64.1463 58.6262 64.5597 58.6262C64.899 58.6262 65.1428 58.4354 65.2276 58.218L65.7789 58.3664C65.6411 58.8064 65.1746 59.1456 64.5597 59.1456ZM63.8124 57.4918H65.2382C65.1958 57.1367 64.899 56.9247 64.5385 56.9247C64.1834 56.9247 63.8972 57.1314 63.8124 57.4918ZM68.6447 59.1138C68.104 59.1138 67.7489 58.7799 67.7489 58.2657V56.9883H67.2506V56.4635H67.4626C67.6746 56.4635 67.7489 56.3363 67.7489 55.9759V55.7638H68.3637V56.4635H69.0369V56.9883H68.3637V58.2286C68.3637 58.4672 68.4962 58.605 68.7242 58.605C68.8461 58.605 68.968 58.5785 69.0687 58.5467L69.1535 59.029C68.9998 59.082 68.8249 59.1138 68.6447 59.1138ZM69.5137 59.082V55.3716H70.1286V56.7657C70.2929 56.5271 70.5526 56.3999 70.8813 56.3999C71.4643 56.3999 71.8725 56.8081 71.8725 57.3964V59.082H71.2576V57.5608C71.2576 57.1897 71.0456 56.9565 70.701 56.9565C70.3512 56.9565 70.1286 57.195 70.1286 57.5608V59.082H69.5137ZM72.3983 59.082V56.4635H73.0132V59.082H72.3983ZM72.2976 55.7214C72.2976 55.4988 72.4778 55.3133 72.7058 55.3133C72.939 55.3133 73.1192 55.4988 73.1192 55.7214C73.1192 55.9494 72.939 56.1349 72.7058 56.1349C72.4778 56.1349 72.2976 55.9494 72.2976 55.7214ZM74.5764 59.1456C73.9934 59.1456 73.5163 58.8223 73.4527 58.393L73.9775 58.2551C74.0305 58.5043 74.2584 58.6792 74.5711 58.6792C74.8203 58.6792 74.9846 58.5626 74.9846 58.3823C74.9846 58.2286 74.8733 58.1332 74.5711 58.0484L74.2478 57.9583C73.776 57.8205 73.5375 57.582 73.5375 57.2003C73.5375 56.7233 73.9085 56.3999 74.4969 56.3999C75.0376 56.3999 75.4457 56.6915 75.557 57.1367L75.027 57.2374C74.9528 57.0201 74.7513 56.8717 74.5022 56.8717C74.269 56.8664 74.1206 56.9936 74.1206 57.1632C74.1206 57.3169 74.2319 57.4123 74.5287 57.4865L74.8574 57.5714C75.3185 57.6986 75.5676 57.9265 75.5676 58.3293C75.5676 58.817 75.1648 59.1456 74.5764 59.1456ZM78.3825 59.1138C77.8418 59.1138 77.4867 58.7799 77.4867 58.2657V56.9883H76.9884V56.4635H77.2004C77.4125 56.4635 77.4867 56.3363 77.4867 55.9759V55.7638H78.1015V56.4635H78.7747V56.9883H78.1015V58.2286C78.1015 58.4672 78.2341 58.605 78.462 58.605C78.5839 58.605 78.7058 58.5785 78.8065 58.5467L78.8913 59.029C78.7376 59.082 78.5627 59.1138 78.3825 59.1138ZM80.0678 59.1456C79.5537 59.1456 79.1455 58.8594 79.1455 58.3717C79.1455 57.9318 79.4317 57.6615 79.9671 57.5767L80.8576 57.4388V57.3646C80.8576 57.0784 80.6403 56.9247 80.3169 56.9247C79.9989 56.9247 79.7604 57.0996 79.6438 57.3699L79.1667 57.1261C79.331 56.6808 79.7657 56.3999 80.3169 56.3999C81.006 56.3999 81.4725 56.8028 81.4725 57.3646V59.082H80.8629V58.8276C80.6827 59.029 80.4124 59.1456 80.0678 59.1456ZM79.7445 58.3399C79.7445 58.5626 79.93 58.6845 80.2056 58.6792C80.5926 58.6739 80.8576 58.4513 80.8576 58.0696V57.8788L80.0837 58.0007C79.877 58.0378 79.7445 58.1597 79.7445 58.3399ZM83.4859 59.1456C83.136 59.1456 82.8286 59.0237 82.606 58.7905V59.082H81.9911V55.3716H82.606V56.7604C82.818 56.5271 83.1254 56.3999 83.4859 56.3999C84.2438 56.3999 84.8004 56.9671 84.8004 57.7728C84.8004 58.5838 84.2438 59.1456 83.4859 59.1456ZM82.606 57.7728C82.606 58.2498 82.9452 58.5891 83.3957 58.5891C83.8463 58.5891 84.1855 58.2498 84.1855 57.7728C84.1855 57.2957 83.8463 56.9565 83.3957 56.9565C82.9452 56.9565 82.606 57.301 82.606 57.7728ZM85.3637 59.1138C85.1411 59.1138 84.9714 58.9389 84.9714 58.7216C84.9714 58.5096 85.1411 58.3293 85.3637 58.3293C85.5863 58.3293 85.7559 58.5096 85.7559 58.7216C85.7559 58.9389 85.5863 59.1138 85.3637 59.1138Z",fill:"#FF4500"}),s.jsx("path",{d:"M40.2522 49.5012C38.9037 49.5012 38.0556 48.5937 37.9538 47.788L38.8613 47.5336C38.9631 47.9831 39.4295 48.5683 40.2437 48.5683C40.8458 48.5683 41.3038 48.2799 41.3038 47.7711C41.3038 47.3301 40.9307 47.0926 40.4133 46.9484L39.6246 46.7194C38.6917 46.448 38.1234 45.9307 38.1234 45.0826C38.1234 44.0309 38.9885 43.3609 40.108 43.3609C41.3802 43.3609 42.0756 44.0903 42.2282 44.879L41.3123 45.1335C41.219 44.7264 40.8543 44.2939 40.1504 44.2939C39.5652 44.2939 39.1581 44.5907 39.1581 45.0656C39.1581 45.5066 39.4804 45.7102 40.0317 45.8628L40.8204 46.0833C41.8381 46.3802 42.3385 46.9314 42.3385 47.7541C42.3385 48.8227 41.4141 49.5012 40.2522 49.5012ZM44.6365 49.5012C43.6951 49.5012 43.0421 48.8312 43.0421 47.805V45.2098H44.0259V47.6523C44.0259 48.263 44.3821 48.6107 44.9249 48.6107C45.4761 48.6107 45.8323 48.2036 45.8323 47.576V45.2098H46.8161V49.3994H45.8323V48.899C45.5609 49.2892 45.1539 49.5012 44.6365 49.5012ZM49.5742 49.5012C48.3105 49.5012 47.3946 48.5937 47.3946 47.3131C47.3946 46.024 48.319 45.108 49.5742 45.108C50.5749 45.108 51.3297 45.6847 51.5163 46.4226L50.6343 46.6601C50.5241 46.3208 50.1424 45.9985 49.5911 45.9985C48.8957 45.9985 48.3784 46.5074 48.3784 47.3131C48.3784 48.1103 48.8957 48.6107 49.5911 48.6107C50.1424 48.6107 50.5241 48.2884 50.6343 47.9576L51.5163 48.1951C51.3297 48.9245 50.5749 49.5012 49.5742 49.5012ZM54.0797 49.5012C52.816 49.5012 51.9001 48.5937 51.9001 47.3131C51.9001 46.024 52.8245 45.108 54.0797 45.108C55.0805 45.108 55.8353 45.6847 56.0219 46.4226L55.1398 46.6601C55.0296 46.3208 54.6479 45.9985 54.0967 45.9985C53.4012 45.9985 52.8839 46.5074 52.8839 47.3131C52.8839 48.1103 53.4012 48.6107 54.0967 48.6107C54.6479 48.6107 55.0296 48.2884 55.1398 47.9576L56.0219 48.1951C55.8353 48.9245 55.0805 49.5012 54.0797 49.5012ZM58.6276 49.5012C57.3725 49.5012 56.4056 48.5937 56.4056 47.3046C56.4056 46.0155 57.3555 45.108 58.5852 45.108C59.798 45.108 60.6631 45.9307 60.6631 47.1859C60.6631 47.3385 60.6461 47.4997 60.6376 47.576H57.3979C57.4657 48.229 57.9661 48.67 58.6276 48.67C59.1704 48.67 59.5606 48.3647 59.6962 48.017L60.5783 48.2545C60.3578 48.9584 59.6114 49.5012 58.6276 49.5012ZM57.4318 46.8551H59.7132C59.6454 46.2869 59.1704 45.9476 58.5937 45.9476C58.0255 45.9476 57.5675 46.2784 57.4318 46.8551ZM62.8588 49.5012C61.9259 49.5012 61.1626 48.9838 61.0608 48.2969L61.9004 48.0764C61.9853 48.475 62.3499 48.7549 62.8503 48.7549C63.2489 48.7549 63.5118 48.5683 63.5118 48.2799C63.5118 48.034 63.3337 47.8813 62.8503 47.7456L62.333 47.6014C61.5782 47.3809 61.1965 46.9993 61.1965 46.3887C61.1965 45.6254 61.7902 45.108 62.7316 45.108C63.5966 45.108 64.2497 45.5745 64.4278 46.2869L63.5797 46.448C63.4609 46.1003 63.1387 45.8628 62.7401 45.8628C62.3669 45.8544 62.1294 46.0579 62.1294 46.3293C62.1294 46.5752 62.3075 46.7279 62.7825 46.8466L63.3083 46.9823C64.0461 47.1859 64.4447 47.5506 64.4447 48.1951C64.4447 48.9754 63.8002 49.5012 62.8588 49.5012ZM66.6686 49.5012C65.7357 49.5012 64.9724 48.9838 64.8706 48.2969L65.7103 48.0764C65.7951 48.475 66.1598 48.7549 66.6601 48.7549C67.0587 48.7549 67.3217 48.5683 67.3217 48.2799C67.3217 48.034 67.1436 47.8813 66.6601 47.7456L66.1428 47.6014C65.388 47.3809 65.0063 46.9993 65.0063 46.3887C65.0063 45.6254 65.6 45.108 66.5414 45.108C67.4065 45.108 68.0595 45.5745 68.2376 46.2869L67.3895 46.448C67.2708 46.1003 66.9485 45.8628 66.5499 45.8628C66.1767 45.8544 65.9393 46.0579 65.9393 46.3293C65.9393 46.5752 66.1174 46.7279 66.5923 46.8466L67.1181 46.9823C67.856 47.1859 68.2546 47.5506 68.2546 48.1951C68.2546 48.9754 67.61 49.5012 66.6686 49.5012Z",fill:"black"}),s.jsx("circle",{cx:"52.5332",cy:"52.5205",r:"51.9238",fill:"url(#paint0_linear_125_5849)"}),s.jsx("circle",{cx:"52.5332",cy:"52.5205",r:"51.9238",fill:"url(#paint1_linear_125_5849)"}),s.jsx("path",{d:"M29.7695 53.0065L44.5519 67.7889C44.5519 67.7889 64.5228 47.8179 77.3193 35.0215",stroke:"#FAFAFA",strokeWidth:"6.09",strokeLinecap:"round",strokeLinejoin:"round"}),s.jsxs("defs",{children:[s.jsxs("linearGradient",{id:"paint0_linear_125_5849",x1:"52.5332",y1:"0.59668",x2:"52.5332",y2:"104.444",gradientUnits:"userSpaceOnUse",children:[s.jsx("stop",{stopColor:"#56F68B"}),s.jsx("stop",{offset:"1",stopColor:"#3DCF6E"})]}),s.jsxs("linearGradient",{id:"paint1_linear_125_5849",x1:"52.5332",y1:"0.59668",x2:"52.5332",y2:"104.444",gradientUnits:"userSpaceOnUse",children:[s.jsx("stop",{stopColor:"#8FCA94"}),s.jsx("stop",{offset:"1",stopColor:"#5D9461"})]})]})]})}const a4=({onEnd:e,onShowActivity:t,value:r})=>{const{user:n,nativeSymbol:o}=me();return s.jsx(st,{isStickyHeader:!1,content:s.jsxs("div",{className:"gw-w-full gw-min-h-full gw-flex gw-flex-col gw-items-center gw-rounded-6xl gw-relative",children:[s.jsx("div",{className:"gw-flex gw-justify-end gw-w-full gw-p-4 gw-relative gw-z-10",children:s.jsx("div",{className:"gw-size-12",children:s.jsx("button",{className:"gw-size-full gw-inline-flex gw-justify-center gw-items-center",onClick:e,children:s.jsx(Rt,{className:"gw-size-6"})})})}),s.jsx("div",{className:"gw-w-full gw-p-4 gw-relative gw-z-10 gw-flex-1 gw-flex-col gw-flex gw-justify-end",children:s.jsxs("div",{className:"gw-flex gw-flex-col gw-items-center gw-w-full",children:[s.jsx(Pa,{className:"gw-size-24"}),s.jsx("span",{className:"gw-mt-7 gw-typography-h4-nr",children:"Success"}),s.jsx("span",{className:"gw-mt-3 gw-text-center gw-whitespace-pre-wrap !gw-leading-tight",children:`Your account has been
58
58
  successfully funded!`}),s.jsxs("div",{className:V("gw-my-10 gw-rounded-2xl gw-flex gw-p-4 gw-items-center gw-space-x-2 gw-w-full gw-justify-between","gw-bg-brand-white/70 gw-backdrop-blur-sm gw-border gw-border-brand-white/20 gw-shadow-liquid"),children:[s.jsx(Fn,{className:"gw-size-6 gw-flex-shrink-0"}),s.jsx("div",{className:"gw-typography-body2",children:s.jsxs("span",{children:[r," ",o]})}),s.jsxs("div",{className:"gw-flex gw-items-center gw-justify-center gw-text-brand-success gw-relative gw-z-10",children:[s.jsx(Ge,{className:"gw-w-3 -gw-rotate-90 gw-opacity-50"}),s.jsx(Ge,{className:"gw-w-3 -gw-ml-1 -gw-rotate-90"})]}),s.jsx(Ct,{className:"gw-size-6 gw-flex-shrink-0"}),s.jsx("span",{className:"gw-break-all gw-typography-body2",children:at(n.evmWallet)})]}),s.jsx(ue,{variant:"tertiary",className:"gw-w-full",onClick:t,children:"View Transaction"})]})})]})})},i4=w.memo(a4),l4=2;function c4({onBack:e,onEnd:t,onShowActivity:r,setGradientType:n}){const{userCurrency:a,fundAmount:i,fundMinAmount:l,fundMaxAmount:c,fundIntermediaryToken:u,fundDone:f,fundError:d,fundAmountError:g,fundQuote:h,fundStatus:v,quoteLoading:m,doFunding:b,setFundAmount:p,isOnrampEnabled:x,onramppDisabledError:C,fundSymbol:y}=au(),[N,P]=w.useState(Kt.BUY),[T,D]=w.useState(!1),L=async()=>{x&&(D(!0),b(()=>{P(Kt.WAIT),D(!1)},O=>{Gt.error(O),D(!1)}))};w.useEffect(()=>{f&&P(Kt.END)},[f]),w.useEffect(()=>(N===Kt.END&&v==="SUCCESS"&&n(bt.SUCCESS),N===Kt.END&&v==="FAILED"&&n(bt.ERROR),()=>{n(void 0)}),[n,v,N]);const A=i&&!g;return s.jsxs(s.Fragment,{children:[N===Kt.BUY&&s.jsx(st,{isStickyHeader:!0,header:s.jsx(Zt,{isStickyHeader:!0,fullScreenHeader:{title:"Fund Wallet",onBackClick:e}}),content:s.jsxs("div",{className:"gw-p-4 gw-h-full gw-flex gw-flex-col gw-justify-center",children:[s.jsxs("div",{className:"gw-flex gw-flex-col gw-cursor-text",onClick:O=>{const F=O.currentTarget.querySelector("input");F&&F.focus()},children:[s.jsx("div",{className:"gw-typography-body2 gw-text-brand-gray-500",children:A?"Pay":"Enter Amount"}),s.jsx("div",{className:"gw-flex gw-justify-between gw-items-center gw-mt-1",children:s.jsxs("div",{className:"gw-w-full gw-text-center gw-border-b-2 gw-border-border focus-within:gw-border-foreground gw-pb-1 gw-flex gw-justify-between gw-items-center gw-typography-h3-nr",children:[s.jsx("span",{children:oi(a)}),s.jsx("div",{className:"gw-flex-1 gw-overflow-hidden",children:s.jsx("input",{type:"text",min:l??0,max:c??999999,onKeyDown:O=>{O.key==="Backspace"||O.key==="ArrowLeft"||O.key==="ArrowRight"||(/[0-9.]$/.test(O.key)||O.preventDefault(),i?.includes(".")&&O.key.includes(".")&&O.preventDefault())},disabled:T||!x&&!0,onWheelCapture:O=>{O.currentTarget.blur()},value:i,onChange:O=>p(F=>{let E=Ls(O.target.value,l4);return O.target.max&&parseFloat(E)>parseFloat(O.target.max)&&(E=F),E}),placeholder:"0",className:"gw-text-foreground gw-bg-transparent focus:gw-outline-none placeholder:gw-text-foreground gw-w-full disabled:gw-cursor-not-allowed"})}),a==="USD"?s.jsx("img",{src:q6,alt:"coin",className:"gw-size-10 gw-rounded-full"}):s.jsx("div",{className:"gw-rounded-full gw-size-10 gw-inline-flex gw-justify-center gw-items-center gw-bg-primary gw-text-primary-foreground gw-typography-body2",children:a})]})}),s.jsxs("div",{className:"gw-typography-caption",children:[s.jsx("div",{className:"gw-mt-2 gw-text-brand-gray-500 gw-text-center",children:g||x&&`${Ee(l??0,a)} min - ${Ee(c??999999,a)} max`}),!A&&(x?s.jsxs("div",{className:"gw-mt-4 gw-flex gw-space-x-2 gw-text-brand-gray-500 gw-items-center gw-justify-center",children:[s.jsxs("span",{children:["You will receive ",y]}),s.jsx(Fn,{})]}):s.jsxs("div",{className:"gw-mt-8 gw-text-brand-gray-600 gw-text-center gw-text-xs gw-px-4 gw-py-3 gw-rounded-xl gw-border",style:{borderColor:"#FFBD42",backgroundColor:"rgba(253, 215, 53, 0.08)"},children:["To fund your wallet, switch your network to"," ",s.jsx("b",{className:"gw-text-brand-gray-700",children:"ApeChain"}),". From Home, choose ApeChain in the top right. Remember, funds remain on"," ",s.jsx("b",{className:"gw-text-brand-gray-700",children:"ApeChain"}),"."]}))]})]}),A&&s.jsxs("div",{children:[s.jsxs("div",{className:"gw-flex gw-flex-col gw-mt-5",children:[s.jsx("div",{className:"gw-typography-body2 gw-text-brand-gray-500",children:"Receive"}),s.jsxs("div",{className:"gw-flex gw-justify-between gw-items-center gw-mt-1",children:[s.jsx("div",{className:"gw-typography-h3-nr",children:m?s.jsx(Ne,{className:"gw-w-20 gw-h-10"}):h?.out_tokens_amount}),s.jsx(Fn,{className:"gw-size-10 gw-rounded-full"})]}),s.jsxs("div",{className:"gw-typography-caption gw-text-brand-gray-500 gw-mt-1 gw-text-center gw-flex gw-items-center gw-justify-center gw-gap-0.5",children:[s.jsxs("span",{children:["1 ",y," = "]}),m?s.jsx(Ne,{className:"gw-w-6 gw-h-4 gw-inline-block"}):`${Ee(h?.ape_to_currency,h?.currency)}`]})]}),s.jsxs("div",{className:"gw-flex gw-justify-between gw-py-4 gw-border-b gw-border-muted",children:[s.jsx("span",{className:"gw-typography-caption",children:"How this transaction works"}),s.jsx(Ot,{stopPropagation:!0,description:s.jsxs("div",{className:"gw-p-3 gw-max-w-xs",children:[s.jsx("div",{className:"gw-typography-body2 !gw-font-bold gw-text-center",children:"How This Transaction Works"}),s.jsx("p",{className:"gw-typography-caption gw-text-brand-gray-500 gw-mt-2",children:"Once you enter an amount, we'll take care of the rest. Your order is processed via Coinbase."}),s.jsxs("div",{className:"gw-mt-4 gw-space-y-3",children:[s.jsxs("div",{className:"gw-flex gw-items-center gw-space-x-3",children:[s.jsx("div",{className:"gw-size-6 gw-flex-shrink-0 gw-rounded-full gw-border gw-border-secondary gw-flex gw-items-center gw-justify-center gw-typography-body2 gw-text-secondary",children:"1"}),s.jsxs("p",{className:"gw-typography-caption",children:[s.jsxs("span",{className:"gw-font-medium",children:["Buy ",u,":"]})," ","Your ",a," is converted to"," ",u]})]}),s.jsxs("div",{className:"gw-flex gw-items-center gw-space-x-3",children:[s.jsx("div",{className:"gw-size-6 gw-flex-shrink-0 gw-rounded-full gw-border gw-border-secondary gw-flex gw-items-center gw-justify-center gw-typography-body2 gw-text-secondary",children:"2"}),s.jsxs("p",{className:"gw-typography-caption",children:[s.jsxs("span",{className:"gw-font-medium",children:["Swap to ",y,":"]})," ",u," is exchanged for ",y," on current chain"]})]}),s.jsxs("div",{className:"gw-flex gw-items-center gw-space-x-3",children:[s.jsx("div",{className:"gw-size-6 gw-flex-shrink-0 gw-rounded-full gw-border gw-border-secondary gw-flex gw-items-center gw-justify-center gw-typography-body2 gw-text-secondary",children:"3"}),s.jsxs("p",{className:"gw-typography-caption",children:[s.jsx("span",{className:"gw-font-medium",children:"Receive Funds:"})," ",y," is sent to your wallet"]})]})]})]}),side:"left",align:"center"})]}),s.jsxs("div",{className:"gw-typography-body2 gw-mt-4",children:[s.jsxs("div",{className:"gw-flex gw-justify-between gw-items-center",children:[s.jsx("span",{children:"Transaction Time"}),s.jsx("span",{className:"gw-text-brand-gray-500",children:"1-5 mins"})]}),s.jsxs("div",{className:"gw-flex gw-justify-between gw-items-center gw-mt-2",children:[s.jsx("span",{children:"Network Fees"}),s.jsx("div",{className:"gw-text-brand-gray-500",children:m?s.jsx(Ne,{className:"gw-w-6 gw-h-3.5"}):`${Ee(h?.estimated_fees_amount,h?.currency)}`})]}),s.jsxs("div",{className:"gw-flex gw-justify-between gw-items-center gw-mt-2",children:[s.jsx("span",{children:"Total"}),s.jsx("div",{className:"gw-text-brand-gray-500",children:m?s.jsx(Ne,{className:"gw-w-6 gw-h-3.5"}):`${Ee(h?.in_amount,h?.currency)}`})]})]})]})]}),footer:s.jsxs(s.Fragment,{children:[s.jsx("span",{className:V(`gw-inline-flex gw-items-center gw-space-x-2 gw-typography-caption gw-mb-2 ${d?"gw-text-destructive":"gw-text-brand-gray-500"}`),children:s.jsx("span",{className:V("gw-backdrop-blur-sm gw-border gw-border-brand-white/20 gw-shadow-liquidSm gw-px-1 gw-rounded-full",d?"gw-bg-destructive-foreground/60":"gw-bg-brand-white/60"),children:d||(A?"*Your order will be fulfilled via Coinbase":`*You pay in ${oi(a)} (${a})`)})}),s.jsx(ue,{variant:"tertiary",className:"gw-w-full",style:{backgroundColor:x?void 0:"#EAEAEA",color:x?void 0:"#808080"},disabled:m||!!d||T||!x&&!0||!A,onClick:L,children:x?s.jsxs(s.Fragment,{children:[A&&!m?s.jsxs(s.Fragment,{children:["Continue to Coinbase ",s.jsx(Z6,{className:"gw-size-4"})]}):"Continue",(m&&A||T)&&s.jsx(Nr,{className:"gw-size-4 gw-animate-spin"})]}):C||"Continue"})]}),footerClassName:"gw-sticky gw-bottom-0 gw-z-10",mainFooter:!1,footerCols:!0}),N===Kt.WAIT&&s.jsx(o4,{onBack:e,id:h?.id||"",value:h?.out_tokens_amount||0}),N===Kt.END&&(v==="SUCCESS"?s.jsx(i4,{value:h?.out_tokens_amount||0,onEnd:t,onShowActivity:r}):s.jsx(n4,{id:h?.id||"",onEnd:t,onShowActivity:r}))]})}function d4(e){const{isActive:t,...r}=e;return s.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...r,children:[s.jsxs("g",{clipPath:"url(#clip0_665_3257)",children:[s.jsx("path",{d:"M10.3926 17.54C14.7882 17.54 18.3516 13.9767 18.3516 9.58105C18.3516 5.18543 14.7882 1.62207 10.3926 1.62207C5.99695 1.62207 2.43359 5.18543 2.43359 9.58105C2.43359 13.9767 5.99695 17.54 10.3926 17.54Z",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round"}),s.jsx("path",{d:"M10.3926 4.80566V9.58105L13.5762 11.1729",className:t?"gw-stroke-popover":"gw-stroke-current",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})]}),s.jsx("defs",{children:s.jsx("clipPath",{id:"clip0_665_3257",children:s.jsx("rect",{width:"19.1016",height:"19.1016",fill:"white",transform:"translate(0.841797 0.0302734)"})})})]})}function u4(e){return s.jsx("svg",{width:"23",height:"21",viewBox:"0 0 23 21",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:s.jsx("path",{d:"M10.3892 1.5525L2.16118 7.25004C1.89143 7.43683 1.73047 7.74406 1.73047 8.07217V18.2133C1.73047 19.2694 2.6134 20.1524 3.66956 20.1524H7.61845C8.17073 20.1524 8.61845 19.7046 8.61845 19.1524V14.491C8.61845 13.9387 9.06616 13.491 9.61844 13.491H13.4348C13.9871 13.491 14.4348 13.9387 14.4348 14.491V19.1524C14.4348 19.7046 14.8825 20.1524 15.4348 20.1524H19.3291C20.3853 20.1524 21.2682 19.2694 21.2682 18.2133V8.07021C21.2682 7.74319 21.1083 7.43683 20.84 7.24983L12.6715 1.55603C11.9861 1.07831 11.076 1.0769 10.3892 1.5525Z",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round"})})}function f4(e){return s.jsxs("svg",{width:"21",height:"21",viewBox:"0 0 21 21",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[s.jsxs("g",{clipPath:"url(#clip0_661_2577)",children:[s.jsx("rect",{x:"1.01807",y:"1.20703",width:"7.38889",height:"7.38889",rx:"1.25",fill:"inherit",stroke:"currentColor",strokeWidth:"1.5"}),s.jsx("rect",{x:"12.1294",y:"1.20703",width:"7.38889",height:"7.38889",rx:"1.25",fill:"inherit",stroke:"currentColor",strokeWidth:"1.5"}),s.jsx("rect",{x:"12.1294",y:"12.3184",width:"7.38889",height:"7.38889",rx:"1.25",fill:"inherit",stroke:"currentColor",strokeWidth:"1.5"}),s.jsx("rect",{x:"1.01807",y:"12.3181",width:"7.38889",height:"7.38889",rx:"1.25",fill:"inherit",stroke:"currentColor",strokeWidth:"1.5"})]}),s.jsx("defs",{children:s.jsx("clipPath",{id:"clip0_661_2577",children:s.jsx("rect",{width:"20",height:"20",fill:"white",transform:"translate(0.268066 0.457031)"})})})]})}const g4=e=>s.jsx("svg",{width:"22",height:"18",viewBox:"0 0 22 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:s.jsx("path",{d:"M19.1504 0C20.669 0.000237059 21.9004 1.23136 21.9004 2.75V11.7832H21.8926V15.7539C21.8926 16.8585 20.9971 17.7539 19.8926 17.7539H2.00391C0.899349 17.7539 0.00392532 16.8585 0.00390625 15.7539V11.1855H0V2.75C1.28851e-07 1.23122 1.23122 0 2.75 0H19.1504ZM2.75 5.58594C2.05964 5.58594 1.5 6.14558 1.5 6.83594V8.07324H7.34863C7.85585 8.07324 8.34436 8.26589 8.71484 8.6123L9.65625 9.49219C10.425 10.2111 11.6189 10.2111 12.3877 9.49219L13.3291 8.6123C13.6996 8.26586 14.1881 8.07324 14.6953 8.07324H20.4004V6.83594C20.4004 6.14573 19.8405 5.58617 19.1504 5.58594H2.75ZM2.75 1.5C2.05964 1.5 1.5 2.05964 1.5 2.75V4.38867C1.87532 4.19658 2.29942 4.08594 2.75 4.08594H19.1504C19.6009 4.08601 20.0251 4.19653 20.4004 4.38867V2.75C20.4004 2.05979 19.8405 1.50024 19.1504 1.5H2.75Z",fill:"currentColor"})}),w4=e=>s.jsx("svg",{width:"22",height:"18",viewBox:"0 0 22 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:s.jsx("path",{d:"M19.1504 0C20.669 0.000237059 21.9004 1.23136 21.9004 2.75V11.7832H21.8926V15.7539C21.8926 16.8585 20.9971 17.7539 19.8926 17.7539H2.00391C0.899349 17.7539 0.00392532 16.8585 0.00390625 15.7539V11.1855H0V2.75C1.28851e-07 1.23122 1.23122 0 2.75 0H19.1504ZM1.50391 15.7539C1.50393 16.03 1.72778 16.2539 2.00391 16.2539H19.8926C20.1687 16.2539 20.3926 16.03 20.3926 15.7539V9.57324H14.6953C14.5685 9.57324 14.4461 9.6214 14.3535 9.70801L13.4121 10.5879C12.0667 11.8459 9.9772 11.8459 8.63184 10.5879L7.69043 9.70801C7.59781 9.6214 7.47544 9.57324 7.34863 9.57324H1.50391V15.7539ZM2.75 5.58594C2.05964 5.58594 1.5 6.14558 1.5 6.83594V8.07324H7.34863C7.85585 8.07324 8.34436 8.26589 8.71484 8.6123L9.65625 9.49219C10.425 10.2111 11.6189 10.2111 12.3877 9.49219L13.3291 8.6123C13.6996 8.26586 14.1881 8.07324 14.6953 8.07324H20.4004V6.83594C20.4004 6.14573 19.8405 5.58617 19.1504 5.58594H2.75ZM2.75 1.5C2.05964 1.5 1.5 2.05964 1.5 2.75V4.38867C1.87532 4.19658 2.29942 4.08594 2.75 4.08594H19.1504C19.6009 4.08601 20.0251 4.19653 20.4004 4.38867V2.75C20.4004 2.05979 19.8405 1.50024 19.1504 1.5H2.75Z",fill:"currentColor"})}),h4=({tab:e,setTab:t})=>{const{user:r}=me();return s.jsxs(s.Fragment,{children:[s.jsxs("button",{className:"tab",onClick:()=>t(be.HOME),children:[s.jsx(u4,{className:V(e===be.HOME?"gw-fill-secondary gw-text-secondary":"gw-text-primary","gw-size-5")}),s.jsx("span",{className:"gw-sr-only",children:"Home"})]}),s.jsxs("button",{className:"tab",onClick:()=>t(be.TOKENS),children:[s.jsx(f4,{className:V(e===be.TOKENS||e===be.NFTS?"gw-fill-secondary gw-text-secondary":"gw-text-primary","gw-size-5")}),s.jsx("span",{className:"gw-sr-only",children:"Tokens & NFTs"})]}),r?.hasProfile&&s.jsxs("button",{className:"tab",onClick:()=>t(be.LINKED_ACCOUNTS),children:[e===be.LINKED_ACCOUNTS?s.jsx(g4,{className:"gw-text-secondary gw-h-5"}):s.jsx(w4,{className:"gw-text-primary gw-h-5"}),s.jsx("span",{className:"gw-sr-only",children:"Linked Accounts"})]}),s.jsxs("button",{className:"tab",onClick:()=>t(be.ACTIVITY),children:[s.jsx(d4,{isActive:e===be.ACTIVITY,className:V(e===be.ACTIVITY?"gw-fill-secondary gw-text-secondary":"gw-text-primary","gw-size-6")}),s.jsx("span",{className:"gw-sr-only",children:"Activity"})]})]})},p4=w.memo(h4);function _a(e){return s.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:s.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0.998047 0C0.445762 0 -0.00195312 0.447715 -0.00195312 1C-0.00195312 1.55228 0.445762 2 0.998047 2H8.61174L0.292089 10.2927C-0.0990687 10.6826 -0.100097 11.3157 0.289793 11.7069C0.679683 12.0981 1.31285 12.0991 1.704 11.7092L9.99805 3.44204V11C9.99805 11.5523 10.4458 12 10.998 12C11.5503 12 11.998 11.5523 11.998 11V1C11.998 0.447715 11.5503 0 10.998 0H0.998047Z",fill:"currentColor"})})}function m4(e){return s.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"21",height:"16",viewBox:"0 0 21 16",fill:"none",...e,children:[s.jsx("path",{d:"M5.85383 2.51924L5.83203 14.75",stroke:"#131313",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round"}),s.jsx("path",{d:"M10.9179 9.66607L5.83393 14.75L0.75 9.66607",stroke:"#131313",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round"}),s.jsx("path",{d:"M14.801 12.9808L14.7793 0.75",stroke:"#131313",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round"}),s.jsx("path",{d:"M19.8568 5.83393L14.7729 0.75L9.68896 5.83393",stroke:"#131313",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round"})]})}function y4({data:e}){const t=e?.chain_id?Ye(e.chain_id):void 0;return s.jsxs("div",{className:"gw-flex gw-items-center gw-typography-body1 gw-flex-1 gw-space-x-3",children:[s.jsxs("span",{className:"gw-relative gw-flex-shrink-0",children:[s.jsx("span",{className:V("gw-rounded-full gw-size-10 gw-flex-shrink-0 gw-flex gw-justify-center gw-items-center",e.status==="Confirmed"?e.type==="swap"?"gw-bg-brand-swapsuccess":"gw-bg-brand-success":e.status==="Failed"?"gw-bg-destructive":"gw-bg-brand-warning"),children:e.type==="swap"?s.jsx(m4,{}):e.type==="receive"?s.jsx(_a,{className:"gw-size-3 gw-rotate-180"}):s.jsx(_a,{})}),t?.iconUrl&&s.jsx("span",{className:V("gw-absolute gw-bottom-0 gw-right-0 gw-translate-x-[10%] gw-translate-y-[10%] gw-size-5 gw-rounded-full gw-bg-background"),children:s.jsx("img",{src:t?.iconUrl,alt:Bt[t?.id]||t?.name,className:"gw-rounded-full gw-size-full"})})]}),s.jsxs("div",{className:"gw-w-full gw-flex gw-justify-between gw-items-center gw-flex-1",children:[s.jsxs("div",{className:"gw-max-w-[35%] gw-flex gw-flex-col gw-text-start",children:[s.jsx("div",{className:"gw-font-medium gw-capitalize",children:e.type_text||e.type}),s.jsx("div",{className:V("gw-typography-caption",e.status==="Confirmed"?"gw-text-brand-success":e.status==="Failed"?"gw-text-destructive":"gw-text-brand-warning"),children:e.status})]}),s.jsxs("div",{className:"gw-max-w-[55%] gw-flex gw-flex-col gw-items-end",children:[s.jsx("div",{className:"gw-font-medium",children:e.value}),s.jsx("div",{className:"gw-typography-caption gw-text-brand-gray-500 gw-line-clamp-1",children:`${e.name_on_list!==null?e.name_on_list.toUpperCase():Ee(e.amount,e.amount_currency)}`})]})]})]})}function sn({text:e,url:t}){return s.jsx("a",{href:t,target:"_blank",rel:"noopener noreferrer",className:ts({variant:"link",size:"sm",className:"gw-py-0 gw-h-auto",scale:!1}),children:s.jsxs("div",{className:"gw-inline-flex gw-items-center gw-space-x-1 gw-text-foreground gw-typography-body2",children:[s.jsxs("span",{children:[e," "]}),s.jsx(_a,{className:"!gw-size-2.5 gw-text-primary"})]})})}function b4(){return s.jsxs("div",{className:"gw-flex gw-items-center gw-typography-body1 gw-flex-1 gw-space-x-3 gw-py-3.5",children:[s.jsx("div",{className:V("gw-rounded-full gw-overflow-hidden gw-size-10 gw-flex-shrink-0 gw-flex gw-justify-center gw-items-center"),children:s.jsx(Ne,{className:"gw-w-full gw-h-full gw-rounded-full"})}),s.jsxs("div",{className:"gw-flex gw-justify-between gw-items-center gw-flex-1",children:[s.jsxs("div",{className:"gw-flex gw-flex-col gw-text-start gw-space-y-1",children:[s.jsx("div",{className:"gw-font-medium gw-capitalize",children:s.jsx(Ne,{className:"gw-w-14 gw-h-4"})}),s.jsx("div",{className:V("gw-typography-caption"),children:s.jsx(Ne,{className:"gw-w-14 gw-h-3"})})]}),s.jsxs("div",{className:"gw-flex gw-flex-col gw-text-end gw-space-y-1",children:[s.jsx("div",{className:"gw-font-medium",children:s.jsx(Ne,{className:"gw-w-10 gw-h-4"})}),s.jsx("div",{className:"gw-typography-caption gw-text-brand-gray-500",children:s.jsx(Ne,{className:"gw-w-10 gw-h-3"})})]})]})]})}function v4(e){const t=e+"CollectionProvider",[r,n]=Sr(t),[o,a]=r(t,{collectionRef:{current:null},itemMap:new Map}),i=m=>{const{scope:b,children:p}=m,x=w.useRef(null),C=w.useRef(new Map).current;return s.jsx(o,{scope:b,itemMap:C,collectionRef:x,children:p})};i.displayName=t;const l=e+"CollectionSlot",c=Sn(l),u=w.forwardRef((m,b)=>{const{scope:p,children:x}=m,C=a(l,p),y=Re(b,C.collectionRef);return s.jsx(c,{ref:y,children:x})});u.displayName=l;const f=e+"CollectionItemSlot",d="data-radix-collection-item",g=Sn(f),h=w.forwardRef((m,b)=>{const{scope:p,children:x,...C}=m,y=w.useRef(null),N=Re(b,y),P=a(f,p);return w.useEffect(()=>(P.itemMap.set(y,{ref:y,...C}),()=>{P.itemMap.delete(y)})),s.jsx(g,{[d]:"",ref:N,children:x})});h.displayName=f;function v(m){const b=a(e+"CollectionConsumer",m);return w.useCallback(()=>{const x=b.collectionRef.current;if(!x)return[];const C=Array.from(x.querySelectorAll(`[${d}]`));return Array.from(b.itemMap.values()).sort((P,T)=>C.indexOf(P.ref.current)-C.indexOf(T.ref.current))},[b.collectionRef,b.itemMap])}return[{Provider:i,Slot:u,ItemSlot:h},v,n]}var Fs="Collapsible",[C4,mu]=Sr(Fs),[x4,Ia]=C4(Fs),yu=S.forwardRef((e,t)=>{const{__scopeCollapsible:r,open:n,defaultOpen:o,disabled:a,onOpenChange:i,...l}=e,[c,u]=Gr({prop:n,defaultProp:o??!1,onChange:i,caller:Fs});return s.jsx(x4,{scope:r,disabled:a,contentId:Ar(),open:c,onOpenToggle:S.useCallback(()=>u(f=>!f),[u]),children:s.jsx(He.div,{"data-state":La(c),"data-disabled":a?"":void 0,...l,ref:t})})});yu.displayName=Fs;var bu="CollapsibleTrigger",vu=S.forwardRef((e,t)=>{const{__scopeCollapsible:r,...n}=e,o=Ia(bu,r);return s.jsx(He.button,{type:"button","aria-controls":o.contentId,"aria-expanded":o.open||!1,"data-state":La(o.open),"data-disabled":o.disabled?"":void 0,disabled:o.disabled,...n,ref:t,onClick:Be(e.onClick,o.onOpenToggle)})});vu.displayName=bu;var Oa="CollapsibleContent",Cu=S.forwardRef((e,t)=>{const{forceMount:r,...n}=e,o=Ia(Oa,e.__scopeCollapsible);return s.jsx(cr,{present:r||o.open,children:({present:a})=>s.jsx(E4,{...n,ref:t,present:a})})});Cu.displayName=Oa;var E4=S.forwardRef((e,t)=>{const{__scopeCollapsible:r,present:n,children:o,...a}=e,i=Ia(Oa,r),[l,c]=S.useState(n),u=S.useRef(null),f=Re(t,u),d=S.useRef(0),g=d.current,h=S.useRef(0),v=h.current,m=i.open||l,b=S.useRef(m),p=S.useRef(void 0);return S.useEffect(()=>{const x=requestAnimationFrame(()=>b.current=!1);return()=>cancelAnimationFrame(x)},[]),er(()=>{const x=u.current;if(x){p.current=p.current||{transitionDuration:x.style.transitionDuration,animationName:x.style.animationName},x.style.transitionDuration="0s",x.style.animationName="none";const C=x.getBoundingClientRect();d.current=C.height,h.current=C.width,b.current||(x.style.transitionDuration=p.current.transitionDuration,x.style.animationName=p.current.animationName),c(n)}},[i.open,n]),s.jsx(He.div,{"data-state":La(i.open),"data-disabled":i.disabled?"":void 0,id:i.contentId,hidden:!m,...a,ref:f,style:{"--radix-collapsible-content-height":g?`${g}px`:void 0,"--radix-collapsible-content-width":v?`${v}px`:void 0,...e.style},children:m&&o})});function La(e){return e?"open":"closed"}var N4=yu,S4=vu,A4=Cu,T4=S.createContext(void 0);function k4(e){const t=S.useContext(T4);return e||t||"ltr"}var Lt="Accordion",P4=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[Ma,_4,I4]=v4(Lt),[Us]=Sr(Lt,[I4,mu]),Da=mu(),Fa=w.forwardRef((e,t)=>{const{type:r,...n}=e,o=n,a=n;return s.jsx(Ma.Provider,{scope:e.__scopeAccordion,children:r==="multiple"?s.jsx(D4,{...a,ref:t}):s.jsx(M4,{...o,ref:t})})});Fa.displayName=Lt;var[xu,O4]=Us(Lt),[Eu,L4]=Us(Lt,{collapsible:!1}),M4=w.forwardRef((e,t)=>{const{value:r,defaultValue:n,onValueChange:o=()=>{},collapsible:a=!1,...i}=e,[l,c]=Gr({prop:r,defaultProp:n??"",onChange:o,caller:Lt});return s.jsx(xu,{scope:e.__scopeAccordion,value:w.useMemo(()=>l?[l]:[],[l]),onItemOpen:c,onItemClose:w.useCallback(()=>a&&c(""),[a,c]),children:s.jsx(Eu,{scope:e.__scopeAccordion,collapsible:a,children:s.jsx(Nu,{...i,ref:t})})})}),D4=w.forwardRef((e,t)=>{const{value:r,defaultValue:n,onValueChange:o=()=>{},...a}=e,[i,l]=Gr({prop:r,defaultProp:n??[],onChange:o,caller:Lt}),c=w.useCallback(f=>l((d=[])=>[...d,f]),[l]),u=w.useCallback(f=>l((d=[])=>d.filter(g=>g!==f)),[l]);return s.jsx(xu,{scope:e.__scopeAccordion,value:i,onItemOpen:c,onItemClose:u,children:s.jsx(Eu,{scope:e.__scopeAccordion,collapsible:!0,children:s.jsx(Nu,{...a,ref:t})})})}),[F4,Bs]=Us(Lt),Nu=w.forwardRef((e,t)=>{const{__scopeAccordion:r,disabled:n,dir:o,orientation:a="vertical",...i}=e,l=w.useRef(null),c=Re(l,t),u=_4(r),d=k4(o)==="ltr",g=Be(e.onKeyDown,h=>{if(!P4.includes(h.key))return;const v=h.target,m=u().filter(D=>!D.ref.current?.disabled),b=m.findIndex(D=>D.ref.current===v),p=m.length;if(b===-1)return;h.preventDefault();let x=b;const C=0,y=p-1,N=()=>{x=b+1,x>y&&(x=C)},P=()=>{x=b-1,x<C&&(x=y)};switch(h.key){case"Home":x=C;break;case"End":x=y;break;case"ArrowRight":a==="horizontal"&&(d?N():P());break;case"ArrowDown":a==="vertical"&&N();break;case"ArrowLeft":a==="horizontal"&&(d?P():N());break;case"ArrowUp":a==="vertical"&&P();break}const T=x%p;m[T].ref.current?.focus()});return s.jsx(F4,{scope:r,disabled:n,direction:o,orientation:a,children:s.jsx(Ma.Slot,{scope:r,children:s.jsx(He.div,{...i,"data-orientation":a,ref:c,onKeyDown:n?void 0:g})})})}),Hs="AccordionItem",[U4,Ua]=Us(Hs),Ba=w.forwardRef((e,t)=>{const{__scopeAccordion:r,value:n,...o}=e,a=Bs(Hs,r),i=O4(Hs,r),l=Da(r),c=Ar(),u=n&&i.value.includes(n)||!1,f=a.disabled||e.disabled;return s.jsx(U4,{scope:r,open:u,disabled:f,triggerId:c,children:s.jsx(N4,{"data-orientation":a.orientation,"data-state":ku(u),...l,...o,ref:t,disabled:f,open:u,onOpenChange:d=>{d?i.onItemOpen(n):i.onItemClose(n)}})})});Ba.displayName=Hs;var Su="AccordionHeader",Au=w.forwardRef((e,t)=>{const{__scopeAccordion:r,...n}=e,o=Bs(Lt,r),a=Ua(Su,r);return s.jsx(He.h3,{"data-orientation":o.orientation,"data-state":ku(a.open),"data-disabled":a.disabled?"":void 0,...n,ref:t})});Au.displayName=Su;var Ha="AccordionTrigger",$a=w.forwardRef((e,t)=>{const{__scopeAccordion:r,...n}=e,o=Bs(Lt,r),a=Ua(Ha,r),i=L4(Ha,r),l=Da(r);return s.jsx(Ma.ItemSlot,{scope:r,children:s.jsx(S4,{"aria-disabled":a.open&&!i.collapsible||void 0,"data-orientation":o.orientation,id:a.triggerId,...l,...n,ref:t})})});$a.displayName=Ha;var Tu="AccordionContent",Va=w.forwardRef((e,t)=>{const{__scopeAccordion:r,...n}=e,o=Bs(Lt,r),a=Ua(Tu,r),i=Da(r);return s.jsx(A4,{role:"region","aria-labelledby":a.triggerId,"data-orientation":o.orientation,...i,...n,ref:t,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...e.style}})});Va.displayName=Tu;function ku(e){return e?"open":"closed"}var B4=Fa,H4=Ba,$4=Au,V4=$a,z4=Va;const W4=B4,j4=w.forwardRef(({className:e,...t},r)=>s.jsx(H4,{ref:r,className:V(e),...t})),G4=w.forwardRef(({className:e,children:t,...r},n)=>s.jsx($4,{className:"gw-flex",children:s.jsx(V4,{ref:n,className:V("gw-flex gw-flex-1 gw-items-center gw-justify-between gw-py-3 gw-transition-all",e),...r,children:t})})),q4=w.forwardRef(({className:e,children:t,...r},n)=>s.jsx(z4,{ref:n,className:"gw-overflow-hidden gw-text-sm gw-transition-all data-[state=closed]:gw-animate-accordion-up data-[state=open]:gw-animate-accordion-down",...r,children:s.jsx("div",{className:V("gw-pb-2 gw-pt-0",e),children:t})}));function Z4({expandFirst:e=!1}){const{user:t,fetchForAllNetworks:r}=me(),n=ge.useChainId(),o=r?null:Ye(n)?.explorerUrl,{transactionGroups:a,fetchTransactions:i,loadMore:l,hasMore:c,isLoading:u,refreshKey:f}=du(),d=w.useRef(null),g=w.useRef(null),[h,v]=w.useState(!1),[m,b]=w.useState(""),p=a.reduce((y,N)=>y+N.transactions.length,0),x=w.useRef(i);x.current=i,w.useEffect(()=>{x.current(!0)},[f]),w.useEffect(()=>{e&&b(m||a?.[0]?.transactions?.[0]?.id||"")},[m,a,e]);const C=w.useCallback(y=>{const[N]=y;N.isIntersecting&&c&&!u&&l()},[c,u,l]);return w.useEffect(()=>{const y=new IntersectionObserver(C,{root:null,rootMargin:"0px",threshold:1}),N=d.current;return N&&y.observe(N),()=>{N&&y.unobserve(N)}},[C]),w.useEffect(()=>{const y=g.current;if(!y)return;const N=new IntersectionObserver(([P])=>{v(!P.isIntersecting)},{root:null,rootMargin:"0px",threshold:0});return N.observe(y),()=>{N.disconnect()}},[]),s.jsxs("div",{className:"gw-pl-4 gw-pt-4 gw-flex gw-flex-col gw-h-full gw-relative",children:[s.jsx("div",{ref:g,className:"gw-absolute gw-top-4"}),s.jsx("a",{href:o?`${o}/address/${t?.evmWallet}`:`https://blockscan.com/address/${t?.evmWallet}`,target:"_blank",rel:"noreferrer",className:V("gw-sticky gw-z-10 gw-top-4 gw-self-start gw-transition-all gw-duration-300",h?"gw-px-2 gw-py-1 gw-bg-white/20 gw-backdrop-blur-sm gw-border gw-border-brand-white/20 gw-shadow-liquid gw-rounded-full gw-typography-body2 gw-left-1/2 -gw-translate-x-1/2":"gw-typography-body1 gw-left-0 gw-translate-x-0 gw-border-transparent gw-shadow-none"),children:s.jsxs("span",{className:"gw-flex gw-items-center gw-space-x-2",children:["My Activity ",s.jsx(f0,{className:V("gw-text-primary",h?"gw-size-4":"gw-size-5")})]})}),s.jsx("div",{className:"gw-absolute gw-top-4 gw-right-4",children:s.jsx(Ot,{description:"Activity keeps track of your transactions and their status. Click any transaction to see details.",stopPropagation:!0,side:"left",align:"center"})}),s.jsx("div",{className:"gw-grid gw-grid-cols-1 gw-overflow-auto gw-pr-4 gw-min-h-0",children:u&&p===0?new Array(3).fill(null).map((y,N)=>s.jsxs("div",{children:[s.jsx(b4,{}),N<2&&s.jsx("hr",{className:"gw-border-muted"})]},N)):p>0?s.jsxs(s.Fragment,{children:[a.map((y,N)=>s.jsxs("div",{children:[y.label&&s.jsx("div",{className:"gw-text-brand-gray-500 gw-rounded-md gw-py-3 gw-typography-body2",children:y.label}),s.jsx(W4,{type:"single",collapsible:!0,value:m,onValueChange:b,children:y.transactions.map((P,T)=>s.jsxs("div",{children:[s.jsxs(j4,{value:P.id,children:[s.jsx(G4,{children:s.jsx(y4,{data:{status:P.status,type:P.type,type_text:P.type_text,value:P.value,amount:P.amount,amount_currency:P.amount_currency,name_on_list:P.name_on_list,chain_id:r?P.chain_id:void 0}})}),s.jsxs(q4,{children:[P.detail_rows?.length?s.jsx("div",{className:"gw-w-[50%] gw-flex gw-flex-col gw-space-y-1 gw-px-3 gw-text-brand-gray-500",children:P.detail_rows?.map?.(D=>s.jsx("div",{className:"gw-line-clamp-1 gw-truncate",children:D.toUpperCase()}))}):null,P.blockExplorerTxns?.length?s.jsx("div",{className:"gw-flex gw-flex-col gw-items-start gw-space-y-1 gw-mb-2",children:P.blockExplorerTxns?.map?.(D=>s.jsx(sn,{text:D.text,url:D.url},D.url))}):s.jsx("div",{className:"gw-w-full gw-mb-2 gw-text-brand-gray-500 gw-typography-caption gw-text-center",children:P.status_text||"No transaction data"}),P.allowIdCopy&&s.jsxs("span",{className:"gw-flex gw-items-center gw-space-x-2 gw-typography-caption gw-text-brand-gray-500 gw-w-full gw-justify-center",children:[s.jsx("span",{children:"Transaction ID: "})," ",s.jsx(_r,{textToCopy:P?.id,text:P?.id.slice(0,20)+"..."})]})]})]}),T<y.transactions.length-1&&s.jsx("hr",{className:"gw-border-muted"})]},P.id))}),N<a.length-1&&s.jsx("div",{className:"gw-mb-2 gw-border-t gw-border-muted"})]},y.label||`group-${N}`)),c&&s.jsx("div",{className:"gw-py-2 gw-mb-4 gw-flex gw-justify-center",children:u?s.jsxs("div",{className:"gw-animate-pulse gw-flex gw-space-x-2 gw-items-center",children:[s.jsx("div",{className:"gw-h-2 gw-w-2 gw-bg-primary gw-rounded-full"}),s.jsx("div",{className:"gw-h-2 gw-w-2 gw-bg-primary gw-rounded-full"}),s.jsx("div",{className:"gw-h-2 gw-w-2 gw-bg-primary gw-rounded-full"})]}):s.jsx("div",{ref:d,className:"gw-h-4"})})]}):s.jsx("div",{className:"gw-flex gw-justify-center gw-items-center gw-text-brand-gray-500 gw-typography-body2 gw-py-8",children:"No transactions"})})]})}function Pu(e){return s.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[s.jsx("g",{clipPath:"url(#clip0_685_2031)",children:s.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.9216 1.04389C10.9216 0.536266 10.5101 0.124756 10.0025 0.124756C9.49487 0.124756 9.08336 0.536266 9.08336 1.04389V8.806H1.31952C0.811901 8.806 0.400391 9.21751 0.400391 9.72514C0.400391 10.2328 0.811901 10.6443 1.31952 10.6443H9.08336V18.4042C9.08336 18.9118 9.49487 19.3234 10.0025 19.3234C10.5101 19.3234 10.9216 18.9118 10.9216 18.4042V10.6443H18.6799C19.1875 10.6443 19.599 10.2328 19.599 9.72514C19.599 9.21752 19.1875 8.80601 18.6799 8.80601H10.9216V1.04389Z",fill:"currentColor"})}),s.jsx("defs",{children:s.jsx("clipPath",{id:"clip0_685_2031",children:s.jsx("rect",{width:"19.2",height:"19.2",fill:"white",transform:"translate(0.400391 0.124023)"})})})]})}function Y4(e){return s.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[s.jsx("g",{clipPath:"url(#clip0_685_1277)",children:s.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.86887 4.35704C8.86887 6.69582 6.97292 8.59177 4.63414 8.59177C2.29537 8.59177 0.399414 6.69582 0.399414 4.35704C0.399414 2.01827 2.29537 0.122314 4.63414 0.122314C6.97292 0.122314 8.86887 2.01827 8.86887 4.35704ZM6.98266 4.35691C6.98266 5.65403 5.93113 6.70556 4.63401 6.70556C3.33688 6.70556 2.28535 5.65403 2.28535 4.35691C2.28535 3.05978 3.33688 2.00825 4.63401 2.00825C5.93113 2.00825 6.98266 3.05978 6.98266 4.35691ZM8.86887 15.0869C8.86887 17.4257 6.97292 19.3217 4.63414 19.3217C2.29537 19.3217 0.399414 17.4257 0.399414 15.0869C0.399414 12.7481 2.29537 10.8522 4.63414 10.8522C6.97292 10.8522 8.86887 12.7481 8.86887 15.0869ZM6.98266 15.0868C6.98266 16.3839 5.93113 17.4354 4.63401 17.4354C3.33688 17.4354 2.28535 16.3839 2.28535 15.0868C2.28535 13.7897 3.33688 12.7381 4.63401 12.7381C5.93113 12.7381 6.98266 13.7897 6.98266 15.0868ZM15.0338 8.59177C17.3725 8.59177 19.2685 6.69582 19.2685 4.35704C19.2685 2.01827 17.3725 0.122314 15.0338 0.122314C12.695 0.122314 10.799 2.01827 10.799 4.35704C10.799 6.69582 12.695 8.59177 15.0338 8.59177ZM15.0336 6.70556C16.3307 6.70556 17.3823 5.65403 17.3823 4.35691C17.3823 3.05978 16.3307 2.00825 15.0336 2.00825C13.7365 2.00825 12.685 3.05978 12.685 4.35691C12.685 5.65403 13.7365 6.70556 15.0336 6.70556ZM12.2106 13.6753C12.9902 13.6753 13.6222 13.0434 13.6222 12.2638C13.6222 11.4842 12.9902 10.8522 12.2106 10.8522C11.431 10.8522 10.799 11.4842 10.799 12.2638C10.799 13.0434 11.431 13.6753 12.2106 13.6753ZM19.6108 12.2638C19.6108 13.0434 18.9789 13.6753 18.1993 13.6753C17.4197 13.6753 16.7877 13.0434 16.7877 12.2638C16.7877 11.4842 17.4197 10.8522 18.1993 10.8522C18.9789 10.8522 19.6108 11.4842 19.6108 12.2638ZM15.2071 16.4996C15.9867 16.4996 16.6187 15.8676 16.6187 15.088C16.6187 14.3084 15.9867 13.6764 15.2071 13.6764C14.4275 13.6764 13.7955 14.3084 13.7955 15.088C13.7955 15.8676 14.4275 16.4996 15.2071 16.4996ZM13.6222 17.911C13.6222 18.6906 12.9902 19.3226 12.2106 19.3226C11.431 19.3226 10.799 18.6906 10.799 17.911C10.799 17.1314 11.431 16.4995 12.2106 16.4995C12.9902 16.4995 13.6222 17.1314 13.6222 17.911ZM18.1993 19.3226C18.9789 19.3226 19.6108 18.6906 19.6108 17.911C19.6108 17.1314 18.9789 16.4995 18.1993 16.4995C17.4197 16.4995 16.7877 17.1314 16.7877 17.911C16.7877 18.6906 17.4197 19.3226 18.1993 19.3226Z",fill:"currentColor"})}),s.jsx("defs",{children:s.jsx("clipPath",{id:"clip0_685_1277",children:s.jsx("rect",{width:"19.2101",height:"19.1992",fill:"white",transform:"translate(0.400391 0.123535)"})})})]})}function K4({setWalletView:e}){const{user:t,balances:r,hasBalances:n,fetchForAllNetworks:o}=me(),a=r?.tokens?.find?.(c=>c.native),i=r?.wallet_value,l=r?.tokens;return s.jsxs("div",{className:"gw-w-full gw-h-full gw-p-4 gw-flex gw-flex-col gw-justify-between gw-gap-10 gw-items-center",children:[s.jsx("div",{className:V("gw-flex gw-items-center gw-w-full gw-min-h-6",o?"gw-justify-end":"gw-justify-between"),children:o?s.jsx(Ot,{description:"Portfolio value reflects fungible tokens held on supported networks only.",stopPropagation:!0,align:"end",side:"left"}):s.jsxs(s.Fragment,{children:[s.jsx("span",{children:"My Balance"}),s.jsx("div",{className:"gw-flex gw-font-medium gw-items-center gw-gap-1",children:!n||a?.value===void 0?s.jsx(Ne,{className:"gw-w-20 gw-h-6"}):s.jsxs(s.Fragment,{children:[s.jsx(Fn,{className:"gw-size-5"}),s.jsxs("span",{children:[Jt(a?.valueInWei,a?.decimals,a?.displayDecimals)," ",s.jsx("span",{className:"gw-text-brand-gray-600 gw-typography-body2",children:a?.symbol})]})]})})]})}),s.jsxs("div",{className:"gw-flex gw-justify-center gw-items-center gw-flex-col",children:[s.jsx("span",{className:"gw-typography-h2-nr",children:!n||i?.tokens===void 0?s.jsx(Ne,{className:"gw-w-20 gw-h-[3.75rem]"}):s.jsxs(s.Fragment,{children:[Ee(i?.tokens,void 0,l?.some(c=>BigInt(c.valueInWei)!==0n),"decimal"),s.jsx("span",{className:"gw-text-foreground gw-typography-h6-nr gw-pl-0.5",children:i?.currency||"USD"})]})}),s.jsx("span",{className:"gw-typography-subtitle1 !gw-font-normal gw-text-brand-gray-600 gw-mt-2",children:"Portfolio Value"})]}),s.jsxs("div",{className:"gw-flex gw-space-x-2 gw-w-fit gw-pb-2 gw-mb-4",children:[s.jsx(ue,{shadow:!0,variant:"cube",size:"cube",onClick:()=>e(pe.FUND),children:s.jsxs("span",{className:"gw-flex gw-flex-col gw-items-center gw-justify-center gw-space-y-1 gw-mt-2",children:[s.jsx(Pu,{}),s.jsx("span",{children:"Fund"})]})}),s.jsx(ue,{shadow:!0,variant:"cube",size:"cube",onClick:()=>e(pe.SWAP),children:s.jsxs("span",{className:"gw-flex gw-flex-col gw-items-center gw-justify-center gw-space-y-1 gw-mt-2",children:[s.jsx(Ll,{}),s.jsx("span",{children:"Swap"})]})}),s.jsx(ue,{shadow:!0,variant:"cube",size:"cube",onClick:()=>e(pe.RECEIVE),disabled:!t?.evmWallet,children:s.jsxs("span",{className:"gw-flex gw-flex-col gw-items-center gw-justify-center gw-space-y-1 gw-mt-2",children:[s.jsx(Y4,{}),s.jsx("span",{children:"Receive"})]})}),s.jsx(ue,{shadow:!0,variant:"cube",size:"cube",onClick:()=>e(pe.SEND),disabled:!t?.evmWallet,children:s.jsxs("span",{className:"gw-flex gw-flex-col gw-items-center gw-justify-center gw-space-y-1 gw-mt-2",children:[s.jsx(p0,{}),s.jsx("span",{children:"Send"})]})})]})]})}function X4(){const{user:e,glyphUrl:t}=me(),r=new URL("/profile",t).toString(),n=w.useRef(null),[o,a]=w.useState(!1);return w.useEffect(()=>{const i=n.current;if(!i)return;const l=new IntersectionObserver(([c])=>{a(!c.isIntersecting)},{root:null,rootMargin:"0px",threshold:0});return l.observe(i),()=>{l.disconnect()}},[]),s.jsxs("div",{className:"gw-p-4 gw-flex gw-flex-col gw-justify-between gw-min-h-full gw-relative",children:[s.jsxs("div",{children:[s.jsx("div",{ref:n,className:"gw-absolute gw-top-4"}),s.jsx("div",{className:V("gw-sticky gw-inline-block gw-z-10 gw-top-4 gw-transition-all gw-duration-300",o?"gw-px-2 gw-py-1 gw-bg-white/20 gw-backdrop-blur-sm gw-border gw-border-brand-white/20 gw-shadow-liquid gw-rounded-full gw-typography-body2 gw-left-1/2 -gw-translate-x-1/2":"gw-typography-body1 gw-left-0 gw-translate-x-0 gw-border-transparent gw-shadow-none"),children:"My Wallets"}),s.jsx("div",{className:"gw-absolute gw-top-4 gw-right-4",children:s.jsx(Ot,{stopPropagation:!0,description:"Your standard crypto wallet for storing assets, sending, and receiving funds.",side:"left",align:"center"})}),e?.hasProfile&&s.jsxs("div",{className:"gw-flex gw-items-center gw-w-full gw-mt-3",children:[s.jsx("div",{className:"gw-flex gw-items-start",children:s.jsxs("div",{className:"gw-typography-body1",children:[s.jsx("div",{className:"gw-font-medium",children:"Main Wallet"}),s.jsx("div",{className:"gw-text-brand-gray-500 gw-typography-caption",children:at(e.evmWallet)})]})}),s.jsx(_r,{text:"",textToCopy:e.evmWallet,className:"gw-ml-auto",iconClassName:"gw-size-5"})]}),s.jsx("hr",{className:"gw-my-5 gw-border-muted"}),s.jsxs("div",{className:"gw-mb-6 gw-flex gw-items-center gw-justify-between",children:[s.jsx("span",{children:"Linked Wallets"}),s.jsx(Ot,{stopPropagation:!0,description:"Prove token ownership across multiple wallets, access gated content, and manage assets without transfers.",side:"left",align:"center"})]}),e?.linkedWallets?.length?e?.linkedWallets?.map?.(i=>s.jsxs("div",{className:"gw-flex gw-items-center gw-w-full gw-mt-2",children:[s.jsx("div",{className:"gw-flex gw-items-center",children:s.jsx("div",{className:"gw-flex gw-items-start",children:s.jsxs("div",{className:"gw-typography-body1",children:[s.jsx("div",{className:"gw-font-medium gw-capitalize",children:i.walletClientType?.split?.("_")?.join?.(" ")||"External Wallet"}),s.jsx("div",{className:"gw-text-brand-gray-500 gw-typography-caption",children:at(i.address)})]})})}),s.jsx(_r,{text:"",textToCopy:i.address,className:"gw-ml-auto",iconClassName:"gw-size-5"})]},i.address)):s.jsxs("div",{className:"gw-flex gw-items-center gw-justify-center gw-w-full gw-text-center gw-my-8 gw-text-brand-gray-500 gw-typography-body2",children:["To link an existing wallet or",s.jsx("br",{}),"account, please go to the",s.jsx("br",{}),"Glyph Dashboard."]})]}),s.jsxs(ue,{className:"gw-w-full gw-mt-5",onClick:()=>{window.open(`${r}?linkAccounts=true`,"_blank")},variant:"link",children:[s.jsx(Pu,{className:"!gw-size-3 gw-mr-1"}),"Link Wallet or Account"]})]})}function Q4(e){return s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"10",height:"6",viewBox:"0 0 10 6",fill:"none",...e,children:s.jsx("path",{d:"M9.02588 4.85156L5 0.825684L0.974121 4.85156",stroke:"#095546",strokeWidth:"1.34196",strokeLinecap:"round",strokeLinejoin:"round"})})}function J4(e){return s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"13",height:"13",viewBox:"0 0 13 13",fill:"none",...e,children:s.jsxs("g",{children:[s.jsx("circle",{cx:"6.5",cy:"6.5",r:"6.5",fill:"black",fillOpacity:"0.5"}),s.jsx("path",{transform:"translate(2 2)",d:"M5.21106 3.78895C4.60357 3.18146 3.61865 3.18146 3.01117 3.78895L1.45561 5.3445C0.848129 5.95198 0.848129 6.93691 1.45561 7.54439C2.06309 8.15187 3.04802 8.15187 3.6555 7.54439L4.08389 7.116M3.78895 5.21106C4.39643 5.81854 5.38135 5.81854 5.98883 5.21106L7.54439 3.6555C8.15187 3.04802 8.15187 2.06309 7.54439 1.45561C6.93691 0.848129 5.95198 0.848129 5.3445 1.45561L4.91687 1.88324",stroke:"white",strokeWidth:"0.7",strokeLinecap:"round",strokeLinejoin:"round"})]})})}const R4=e=>s.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"66",height:"66",viewBox:"0 0 66 66",fill:"none",...e,children:[s.jsx("path",{d:"M0 5C0 2.23858 2.23858 0 5 0H61C63.7614 0 66 2.23858 66 5V61C66 63.7614 63.7614 66 61 66H5C2.23858 66 0 63.7614 0 61V5Z",fill:"#DFDFDF"}),s.jsx("path",{d:"M26.3147 21.6523C26.4077 21.7503 26.501 21.8483 26.594 21.9463C28.4087 23.8579 30.2236 25.77 32.0383 27.6816C31.3606 28.037 30.5969 28.2393 29.7883 28.2393C26.9975 28.239 24.7346 25.8572 24.7346 22.9199C24.7347 22.067 24.9267 21.2613 25.2659 20.5469C25.6156 20.9153 25.9651 21.284 26.3147 21.6523ZM29.7883 17.6016C32.5793 17.6016 34.8419 19.9826 34.842 22.9199C34.842 23.897 34.5904 24.8118 34.1536 25.5986C32.3451 23.6938 30.5371 21.7886 28.7288 19.8838C28.6356 19.7857 28.5426 19.687 28.4495 19.5889C28.0487 19.1667 27.6472 18.7453 27.2463 18.3232C27.9931 17.8648 28.8614 17.6016 29.7883 17.6016Z",fill:"#969E96"}),s.jsx("g",{filter:"url(#filter0_d_2977_3039)",children:s.jsx("path",{d:"M43.5314 25.4015C44.1049 25.1215 44.8406 25.1888 45.458 25.333C46.1015 25.4833 46.7446 25.7483 47.2143 25.9973C47.4875 26.1423 47.7248 26.3783 47.9501 26.6657C48.1779 26.9563 48.4185 27.3328 48.6878 27.7959C49.225 28.7197 49.9199 30.0636 50.9025 31.9036C51.8101 33.6032 53.5769 36.111 54.5178 37.5396C55.2851 38.7046 55.9735 39.7613 56.4989 40.6429C57.0137 41.5066 57.4078 42.2604 57.5435 42.8018C57.7956 43.8087 57.5709 44.6716 57.4837 45.0031C57.3662 45.4495 57.0877 45.7825 56.7885 46.0241C56.3653 46.3658 55.8233 46.5391 55.2762 46.6513C54.7298 46.7633 54.0998 46.8281 53.4896 46.906C52.8697 46.9852 51.8968 47.0121 49.778 47.0593C47.6374 47.107 44.3463 47.0208 42.4956 47.015C40.6223 47.0092 40.7079 47.0188 39.9927 47.0203C39.7511 47.0208 38.8787 47.0594 33.8482 47.0331C33.2081 47.0298 32.5006 47.0242 31.7427 47.017C30.1433 45.0629 28.5446 43.1082 26.9452 41.154C30.7496 38.7451 34.5554 36.3369 38.3598 33.928L39.8208 33.003L38.6891 31.6812C38.5515 31.5206 38.4136 31.3602 38.276 31.1996C38.9175 30.3623 39.3449 29.6955 39.606 29.3208C40.6967 27.7562 41.4821 26.8659 42.1007 26.3195C42.7331 25.761 43.1835 25.5713 43.5314 25.4015ZM19.8279 29.915C20.8419 29.7909 22.0906 29.8957 23.2044 30.6189C24.4481 31.4267 25.0305 32.3473 25.65 33.0747C26.3784 33.9298 27.8879 35.2664 29.1087 36.2237C27.3748 37.3218 25.6415 38.4209 23.9076 39.5188L22.4789 40.4232L23.5558 41.7383C24.9822 43.4811 26.409 45.2237 27.8354 46.9666C23.2092 46.901 17.922 46.7974 14.4754 46.6802C11.9432 46.5941 10.663 46.5954 9.97801 46.5529C9.63098 46.5313 9.36454 46.4962 9.13394 46.4052C8.89311 46.3102 8.7273 46.1673 8.57653 46.0383C8.2984 45.7999 8.13482 45.4897 8.0309 45.2328C7.93208 44.9883 7.85902 44.7091 7.82351 44.5984L7.81762 44.5809L7.81367 44.5623C7.79586 44.4878 7.79188 44.4114 7.7908 44.3661C7.78949 44.3109 7.79165 44.2498 7.79433 44.1883C7.79975 44.0644 7.81134 43.918 7.82764 43.7732C7.84395 43.6285 7.86559 43.4777 7.89022 43.3444C7.90745 43.2512 7.93471 43.1428 7.96674 43.0454C7.97044 43.0292 7.97311 43.0178 7.97449 43.0131C7.98116 42.9909 7.98791 42.9731 7.99196 42.9633C8.00019 42.9433 8.00906 42.9267 8.01433 42.9164C8.02555 42.8944 8.03872 42.8687 8.05421 42.8421C8.08608 42.7873 8.13866 42.7019 8.22355 42.5673C8.39438 42.2965 8.70734 41.8129 9.27681 40.9508C10.2998 39.4022 12.2842 36.5449 13.438 34.9157C15.3246 32.2518 16.4351 31.3658 17.559 30.659C18.3142 30.1842 19.124 30.0012 19.8279 29.915Z",fill:"#969E96"})}),s.jsx("defs",{children:s.jsxs("filter",{id:"filter0_d_2977_3039",x:"3.79053",y:"24.207",width:"57.8689",height:"29.8672",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB",children:[s.jsx("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),s.jsx("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),s.jsx("feOffset",{dy:"3"}),s.jsx("feGaussianBlur",{stdDeviation:"2"}),s.jsx("feComposite",{in2:"hardAlpha",operator:"out"}),s.jsx("feColorMatrix",{type:"matrix",values:"0 0 0 0 0.258824 0 0 0 0 0.372549 0 0 0 0 0.247059 0 0 0 0.25 0"}),s.jsx("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow_2977_3039"}),s.jsx("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect1_dropShadow_2977_3039",result:"shape"})]})})]}),_u=({url:e,alt:t,title:r,className:n,...o})=>{const[a,i]=w.useState(!1);return s.jsx(s.Fragment,{children:!a&&e?s.jsx("img",{src:e,alt:t,title:r,onError:()=>i(!0),className:V("gw-object-cover gw-rounded-md gw-block",n)}):s.jsx(R4,{style:{width:"100%",height:"100%"},...o})})};function e8(){const{glyphUrl:e,balances:t,hasBalances:r}=me(),[n,o]=w.useState(""),a=t?.nfts||[],i=new URL("/nfts",e).toString();return s.jsxs("div",{className:"gw-pl-4 gw-py-4 gw-flex gw-flex-col gw-h-full gw-min-h-0",children:[s.jsx("div",{className:"gw-flex gw-mb-2 gw-flex-row gw-justify-between gw-items-center gw-w-full gw-flex-shrink-0 gw-pr-4",children:s.jsx("span",{children:"My NFTs"})}),r&&a?.length?s.jsxs("div",{className:"gw-flex gw-flex-col gw-flex-1 gw-min-h-0",children:[s.jsx("div",{className:"gw-flex-1 gw-min-h-0 gw-overflow-auto",children:s.jsx(Fa,{className:"gw-w-full",type:"single",collapsible:!0,value:n,onValueChange:o,children:a.map((l,c)=>s.jsx("div",{children:s.jsxs(Ba,{value:c.toString(),className:"gw-pr-4",children:[s.jsx($a,{asChild:!0,children:s.jsxs("div",{className:"gw-flex gw-justify-between gw-items-center gw-w-full gw-py-2 gw-cursor-pointer",children:[s.jsxs("div",{className:"gw-flex gw-items-center gw-space-x-3 gw-min-w-0 gw-flex-1",children:[s.jsx("div",{className:"gw-flex-shrink-0",children:s.jsx(_u,{url:l.contractImage||l.image,alt:l.name,className:"gw-w-10 gw-h-10",height:"40",width:"40"})}),s.jsx("span",{className:"gw-text-sm gw-line-clamp-1 gw-truncate gw-letter-spacing-0.12 gw-min-w-0 gw-max-w-[75%]",children:l.name?.toLocaleUpperCase?.()||l.symbol||""})]}),s.jsx("div",{className:"gw-flex gw-flex-col gw-items-between gw-justify-end gw-text-end gw-flex-shrink-0",children:s.jsx(Q4,{className:`${n===c.toString()?"":"gw-rotate-180"}`})})]})}),s.jsx(Va,{children:s.jsx("div",{className:"gw-grid gw-grid-cols-4 gw-gap-4 gw-my-2",children:l.items.map(u=>s.jsxs("div",{className:"gw-relative",children:[u.fromLinked&&s.jsx("div",{className:"gw-absolute gw-top-1 gw-right-1 gw-z-10",children:s.jsx(J4,{})}),u.fromDelegated&&s.jsx("div",{className:"gw-absolute gw-bottom-0 gw-left-0 gw-right-0 gw-z-10",children:s.jsx("div",{className:"gw-bg-black gw-bg-opacity-50 gw-text-white gw-text-center gw-text-[10px] gw-py-0.5 gw-px-1",children:"Delegate"})}),s.jsx(_u,{url:u.tokenImage||u.image?.thumbnailUrl,alt:u.tokenId,className:"gw-w-16 gw-h-16",height:"64",width:"64",title:u.tokenName||u.name||u.tokenId})]},u.tokenId))})})]})},c.toString()))})}),s.jsxs("div",{className:"gw-flex gw-justify-center gw-items-center gw-w-full gw-text-brand-gray-500 gw-typography-body2 gw-flex-shrink-0 gw-mt-2",children:["Need to transfer? Use",s.jsx("a",{href:i,target:"_blank",rel:"noopener noreferrer",className:ts({variant:"link-inline",size:"xs-inline",scale:!1}),children:"Glyph Dashboard"})]})]}):s.jsx("div",{className:V("gw-flex gw-justify-center gw-items-center gw-flex-1 gw-text-brand-gray-500 gw-typography-body2 gw-pr-2 gw-whitespace-pre-wrap gw-text-center",r?"!gw-text-[13px]":""),children:r?`No NFTs found.
59
59
  If you own NFTs, they may be on a different network.