@txnlab/use-wallet-ui-react 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +458 -127
- package/dist/cjs/index.cjs +9 -9
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/esm/index.js +8147 -3276
- package/dist/esm/index.js.map +1 -1
- package/dist/style.css +1221 -0
- package/dist/types/index.d.cts +111 -3
- package/dist/types/index.d.ts +111 -3
- package/package.json +11 -5
- package/dist/cjs/assets/use-wallet-ui-react.css +0 -1
package/dist/cjs/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const R=require("react"),Ae=require("react-dom"),zt=require("@txnlab/use-wallet-react");var sn=typeof document<"u"?document.currentScript:null;function eo(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const D=eo(R),bt=eo(Ae),Fi=()=>{typeof window>"u"||typeof document>"u"||(typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame(()=>{sr()}):setTimeout(sr,0))},sr=()=>{try{if(document.getElementById("wallet-ui-fonts"))return;const t=document.createElement("style");t.id="wallet-ui-fonts";let n="";try{n=new URL("data:font/woff2;base64,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",typeof document>"u"?require("url").pathToFileURL(__filename).href:sn&&sn.tagName.toUpperCase()==="SCRIPT"&&sn.src||new URL("index.cjs",document.baseURI).href).toString()}catch(r){console.warn("Could not resolve font URL. Using fallback styling.",r)}t.textContent=`
|
|
1
|
+
"use strict";var fs=e=>{throw TypeError(e)};var $r=(e,t,n)=>t.has(e)||fs("Cannot "+n);var T=(e,t,n)=>($r(e,t,"read from private field"),n?n.call(e):t.get(e)),te=(e,t,n)=>t.has(e)?fs("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Q=(e,t,n,r)=>($r(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),se=(e,t,n)=>($r(e,t,"access private method"),n);var tr=(e,t,n,r)=>({set _(o){Q(e,t,o,n)},get _(){return T(e,t,r)}});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const C=require("react"),nt=require("react-dom"),dt=require("@txnlab/use-wallet-react");var jr=typeof document<"u"?document.currentScript:null;function Ti(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const D=Ti(C),Ln=Ti(nt),Ol=()=>{typeof window>"u"||typeof document>"u"||(typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame(()=>{ds()}):setTimeout(ds,0))},ds=()=>{try{if(document.getElementById("wallet-ui-fonts"))return;const t=document.createElement("style");t.id="wallet-ui-fonts";let n="";try{n=new URL("data:font/woff2;base64,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",typeof document>"u"?require("url").pathToFileURL(__filename).href:jr&&jr.tagName.toUpperCase()==="SCRIPT"&&jr.src||new URL("index.cjs",document.baseURI).href).toString()}catch(r){console.warn("Could not resolve font URL. Using fallback styling.",r)}t.textContent=`
|
|
2
2
|
@font-face {
|
|
3
3
|
font-family: 'Aeonik';
|
|
4
4
|
src: url('${n}') format('woff2');
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
.wallet-custom-font {
|
|
11
11
|
font-family: 'Aeonik', system-ui, sans-serif !important;
|
|
12
12
|
}
|
|
13
|
-
`,document.head.appendChild(t),console.log("Wallet UI fonts loaded")}catch(e){console.warn("Failed to load custom fonts, using system fonts instead",e)}},
|
|
13
|
+
`,document.head.appendChild(t),console.log("Wallet UI fonts loaded")}catch(e){console.warn("Failed to load custom fonts, using system fonts instead",e)}},Tl=()=>{typeof window<"u"&&Ol()};var nr={exports:{}},kn={};/**
|
|
14
14
|
* @license React
|
|
15
15
|
* react-jsx-runtime.production.js
|
|
16
16
|
*
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
*
|
|
19
19
|
* This source code is licensed under the MIT license found in the
|
|
20
20
|
* LICENSE file in the root directory of this source tree.
|
|
21
|
-
*/var
|
|
21
|
+
*/var hs;function Fl(){if(hs)return kn;hs=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,o,s){var i=null;if(s!==void 0&&(i=""+s),o.key!==void 0&&(i=""+o.key),"key"in o){s={};for(var a in o)a!=="key"&&(s[a]=o[a])}else s=o;return o=s.ref,{$$typeof:e,type:r,key:i,ref:o!==void 0?o:null,props:s}}return kn.Fragment=t,kn.jsx=n,kn.jsxs=n,kn}var An={};/**
|
|
22
22
|
* @license React
|
|
23
23
|
* react-jsx-runtime.development.js
|
|
24
24
|
*
|
|
@@ -26,17 +26,17 @@
|
|
|
26
26
|
*
|
|
27
27
|
* This source code is licensed under the MIT license found in the
|
|
28
28
|
* LICENSE file in the root directory of this source tree.
|
|
29
|
-
*/var
|
|
29
|
+
*/var ps;function Pl(){return ps||(ps=1,process.env.NODE_ENV!=="production"&&function(){function e(P){if(P==null)return null;if(typeof P=="function")return P.$$typeof===b?null:P.displayName||P.name||null;if(typeof P=="string")return P;switch(P){case y:return"Fragment";case N:return"Profiler";case O:return"StrictMode";case U:return"Suspense";case H:return"SuspenseList";case f:return"Activity"}if(typeof P=="object")switch(typeof P.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),P.$$typeof){case g:return"Portal";case I:return(P.displayName||"Context")+".Provider";case x:return(P._context.displayName||"Context")+".Consumer";case B:var L=P.render;return P=P.displayName,P||(P=L.displayName||L.name||"",P=P!==""?"ForwardRef("+P+")":"ForwardRef"),P;case W:return L=P.displayName||null,L!==null?L:e(P.type)||"Memo";case c:L=P._payload,P=P._init;try{return e(P(L))}catch{}}return null}function t(P){return""+P}function n(P){try{var L=!1}catch{L=!0}if(L){L=console;var j=L.error,z=typeof Symbol=="function"&&Symbol.toStringTag&&P[Symbol.toStringTag]||P.constructor.name||"Object";return j.call(L,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",z),t(P)}}function r(P){if(P===y)return"<>";if(typeof P=="object"&&P!==null&&P.$$typeof===c)return"<...>";try{var L=e(P);return L?"<"+L+">":"<...>"}catch{return"<...>"}}function o(){var P=w.A;return P===null?null:P.getOwner()}function s(){return Error("react-stack-top-frame")}function i(P){if(R.call(P,"key")){var L=Object.getOwnPropertyDescriptor(P,"key").get;if(L&&L.isReactWarning)return!1}return P.key!==void 0}function a(P,L){function j(){m||(m=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",L))}j.isReactWarning=!0,Object.defineProperty(P,"key",{get:j,configurable:!0})}function l(){var P=e(this.type);return S[P]||(S[P]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),P=this.props.ref,P!==void 0?P:null}function u(P,L,j,z,q,V,X,ee){return j=V.ref,P={$$typeof:p,type:P,key:L,props:V,_owner:q},(j!==void 0?j:null)!==null?Object.defineProperty(P,"ref",{enumerable:!1,get:l}):Object.defineProperty(P,"ref",{enumerable:!1,value:null}),P._store={},Object.defineProperty(P._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(P,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(P,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:X}),Object.defineProperty(P,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:ee}),Object.freeze&&(Object.freeze(P.props),Object.freeze(P)),P}function d(P,L,j,z,q,V,X,ee){var ae=L.children;if(ae!==void 0)if(z)if(A(ae)){for(z=0;z<ae.length;z++)h(ae[z]);Object.freeze&&Object.freeze(ae)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else h(ae);if(R.call(L,"key")){ae=e(P);var de=Object.keys(L).filter(function(Z){return Z!=="key"});z=0<de.length?"{key: someKey, "+de.join(": ..., ")+": ...}":"{key: someKey}",M[ae+z]||(de=0<de.length?"{"+de.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
30
30
|
let props = %s;
|
|
31
31
|
<%s {...props} />
|
|
32
32
|
React keys must be passed directly to JSX without using spread:
|
|
33
33
|
let props = %s;
|
|
34
|
-
<%s key={someKey} {...props} />`,$,te,_,te),P[te+$]=!0)}if(te=null,H!==void 0&&(n(H),te=""+H),l(I)&&(n(I.key),te=""+I.key),"key"in I){H={};for(var Q in I)Q!=="key"&&(H[Q]=I[Q])}else H=I;return te&&s(H,typeof E=="function"?E.displayName||E.name||"Unknown":E),f(E,te,V,X,o(),H,q,ee)}function h(E){typeof E=="object"&&E!==null&&E.$$typeof===m&&E._store&&(E._store.validated=1)}var A=R,m=Symbol.for("react.transitional.element"),v=Symbol.for("react.portal"),T=Symbol.for("react.fragment"),k=Symbol.for("react.strict_mode"),N=Symbol.for("react.profiler"),C=Symbol.for("react.consumer"),M=Symbol.for("react.context"),B=Symbol.for("react.forward_ref"),j=Symbol.for("react.suspense"),W=Symbol.for("react.suspense_list"),G=Symbol.for("react.memo"),u=Symbol.for("react.lazy"),c=Symbol.for("react.activity"),p=Symbol.for("react.client.reference"),b=A.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,w=Object.prototype.hasOwnProperty,y=Array.isArray,F=console.createTask?console.createTask:function(){return null};A={"react-stack-bottom-frame":function(E){return E()}};var g,x={},O=A["react-stack-bottom-frame"].bind(A,i)(),S=F(r(i)),P={};dt.Fragment=T,dt.jsx=function(E,I,H,$,X){var V=1e4>b.recentlyCreatedOwnerStacks++;return d(E,I,H,!1,$,X,V?Error("react-stack-top-frame"):O,V?F(r(E)):S)},dt.jsxs=function(E,I,H,$,X){var V=1e4>b.recentlyCreatedOwnerStacks++;return d(E,I,H,!0,$,X,V?Error("react-stack-top-frame"):O,V?F(r(E)):S)}}()),dt}var cr;function Di(){return cr||(cr=1,process.env.NODE_ENV==="production"?Pt.exports=ki():Pt.exports=Ni()),Pt.exports}var L=Di();const Un=R.forwardRef(({className:e="",children:t,...n},r)=>L.jsx("button",{ref:r,className:`bg-[#2D2DF1] dark:bg-[#BFBFF9] transition-colors hover:bg-[#2929D9] dark:hover:bg-[#D4D4FA] text-white dark:text-[#001324] font-bold py-2.5 px-4 rounded-xl disabled:opacity-50 wallet-custom-font ${e}`.trim(),...n,type:"button",children:t||"Connect Wallet"}));Un.displayName="ConnectWalletButton";function Xt(){return typeof window<"u"}function We(e){return to(e)?(e.nodeName||"").toLowerCase():"#document"}function ge(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Fe(e){var t;return(t=(to(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function to(e){return Xt()?e instanceof Node||e instanceof ge(e).Node:!1}function re(e){return Xt()?e instanceof Element||e instanceof ge(e).Element:!1}function se(e){return Xt()?e instanceof HTMLElement||e instanceof ge(e).HTMLElement:!1}function Cn(e){return!Xt()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof ge(e).ShadowRoot}function Rt(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=xe(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function Ii(e){return["table","td","th"].includes(We(e))}function Kt(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function Vn(e){const t=Jt(),n=re(e)?xe(e):e;return["transform","translate","scale","rotate","perspective"].some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function Mi(e){let t=Le(e);for(;se(t)&&!Ie(t);){if(Vn(t))return t;if(Kt(t))return null;t=Le(t)}return null}function Jt(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Ie(e){return["html","body","#document"].includes(We(e))}function xe(e){return ge(e).getComputedStyle(e)}function Qt(e){return re(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Le(e){if(We(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Cn(e)&&e.host||Fe(e);return Cn(t)?t.host:t}function no(e){const t=Le(e);return Ie(t)?e.ownerDocument?e.ownerDocument.body:e.body:se(t)&&Rt(t)?t:no(t)}function Be(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=no(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),l=ge(o);if(i){const s=Tn(l);return t.concat(l,l.visualViewport||[],Rt(o)?o:[],s&&n?Be(s):[])}return t.concat(o,Be(o,[],n))}function Tn(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Ge(e){let t=e.activeElement;for(;((n=t)==null||(n=n.shadowRoot)==null?void 0:n.activeElement)!=null;){var n;t=t.shadowRoot.activeElement}return t}function pe(e,t){if(!e||!t)return!1;const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&Cn(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function ro(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function oo(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(t=>{let{brand:n,version:r}=t;return n+"/"+r}).join(" "):navigator.userAgent}function Li(e){return e.mozInputSource===0&&e.isTrusted?!0:An()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function $i(e){return Bi()?!1:!An()&&e.width===0&&e.height===0||An()&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType==="touch"}function ji(){return/apple/i.test(navigator.vendor)}function An(){const e=/android/i;return e.test(ro())||e.test(oo())}function Bi(){return oo().includes("jsdom/")}function fr(e,t){return["mouse","pen"].includes(e)}function Hi(e){return"nativeEvent"in e}function Wi(e){return e.matches("html,body")}function Ee(e){return(e==null?void 0:e.ownerDocument)||document}function an(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function _e(e){return"composedPath"in e?e.composedPath()[0]:e.target}const Ui="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function io(e){return se(e)&&e.matches(Ui)}function un(e){e.preventDefault(),e.stopPropagation()}function Vi(e){return e?e.getAttribute("role")==="combobox"&&io(e):!1}const Je=Math.min,ce=Math.max,yt=Math.round,kt=Math.floor,Oe=e=>({x:e,y:e}),Gi={left:"right",right:"left",bottom:"top",top:"bottom"},Yi={start:"end",end:"start"};function dr(e,t,n){return ce(e,Je(t,n))}function lt(e,t){return typeof e=="function"?e(t):e}function He(e){return e.split("-")[0]}function St(e){return e.split("-")[1]}function lo(e){return e==="x"?"y":"x"}function so(e){return e==="y"?"height":"width"}function Qe(e){return["top","bottom"].includes(He(e))?"y":"x"}function ao(e){return lo(Qe(e))}function qi(e,t,n){n===void 0&&(n=!1);const r=St(e),o=ao(e),i=so(o);let l=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(l=Bt(l)),[l,Bt(l)]}function _i(e){const t=Bt(e);return[On(e),t,On(t)]}function On(e){return e.replace(/start|end/g,t=>Yi[t])}function zi(e,t,n){const r=["left","right"],o=["right","left"],i=["top","bottom"],l=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?i:l;default:return[]}}function Xi(e,t,n,r){const o=St(e);let i=zi(He(e),n==="start",r);return o&&(i=i.map(l=>l+"-"+o),t&&(i=i.concat(i.map(On)))),i}function Bt(e){return e.replace(/left|right|bottom|top/g,t=>Gi[t])}function Ki(e){return{top:0,right:0,bottom:0,left:0,...e}}function Ji(e){return typeof e!="number"?Ki(e):{top:e,right:e,bottom:e,left:e}}function Ht(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}/*!
|
|
34
|
+
<%s key={someKey} {...props} />`,z,ae,de,ae),M[ae+z]=!0)}if(ae=null,j!==void 0&&(n(j),ae=""+j),i(L)&&(n(L.key),ae=""+L.key),"key"in L){j={};for(var pe in L)pe!=="key"&&(j[pe]=L[pe])}else j=L;return ae&&a(j,typeof P=="function"?P.displayName||P.name||"Unknown":P),u(P,ae,V,q,o(),j,X,ee)}function h(P){typeof P=="object"&&P!==null&&P.$$typeof===p&&P._store&&(P._store.validated=1)}var E=C,p=Symbol.for("react.transitional.element"),g=Symbol.for("react.portal"),y=Symbol.for("react.fragment"),O=Symbol.for("react.strict_mode"),N=Symbol.for("react.profiler"),x=Symbol.for("react.consumer"),I=Symbol.for("react.context"),B=Symbol.for("react.forward_ref"),U=Symbol.for("react.suspense"),H=Symbol.for("react.suspense_list"),W=Symbol.for("react.memo"),c=Symbol.for("react.lazy"),f=Symbol.for("react.activity"),b=Symbol.for("react.client.reference"),w=E.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,R=Object.prototype.hasOwnProperty,A=Array.isArray,k=console.createTask?console.createTask:function(){return null};E={"react-stack-bottom-frame":function(P){return P()}};var m,S={},F=E["react-stack-bottom-frame"].bind(E,s)(),v=k(r(s)),M={};An.Fragment=y,An.jsx=function(P,L,j,z,q){var V=1e4>w.recentlyCreatedOwnerStacks++;return d(P,L,j,!1,z,q,V?Error("react-stack-top-frame"):F,V?k(r(P)):v)},An.jsxs=function(P,L,j,z,q){var V=1e4>w.recentlyCreatedOwnerStacks++;return d(P,L,j,!0,z,q,V?Error("react-stack-top-frame"):F,V?k(r(P)):v)}}()),An}var ms;function Ml(){return ms||(ms=1,process.env.NODE_ENV==="production"?nr.exports=Fl():nr.exports=Pl()),nr.exports}var $=Ml();function Fi(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=Fi(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Il(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=Fi(e))&&(r&&(r+=" "),r+=t);return r}const Uo="-",Dl=e=>{const t=Ll(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:i=>{const a=i.split(Uo);return a[0]===""&&a.length!==1&&a.shift(),Pi(a,t)||Nl(i)},getConflictingClassGroupIds:(i,a)=>{const l=n[i]||[];return a&&r[i]?[...l,...r[i]]:l}}},Pi=(e,t)=>{var i;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),o=r?Pi(e.slice(1),r):void 0;if(o)return o;if(t.validators.length===0)return;const s=e.join(Uo);return(i=t.validators.find(({validator:a})=>a(s)))==null?void 0:i.classGroupId},gs=/^\[(.+)\]$/,Nl=e=>{if(gs.test(e)){const t=gs.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},Ll=e=>{const{theme:t,classGroups:n}=e,r={nextPart:new Map,validators:[]};for(const o in n)so(n[o],r,o,t);return r},so=(e,t,n,r)=>{e.forEach(o=>{if(typeof o=="string"){const s=o===""?t:bs(t,o);s.classGroupId=n;return}if(typeof o=="function"){if($l(o)){so(o(r),t,n,r);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([s,i])=>{so(i,bs(t,s),n,r)})})},bs=(e,t)=>{let n=e;return t.split(Uo).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},$l=e=>e.isThemeGetter,jl=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const o=(s,i)=>{n.set(s,i),t++,t>e&&(t=0,r=n,n=new Map)};return{get(s){let i=n.get(s);if(i!==void 0)return i;if((i=r.get(s))!==void 0)return o(s,i),i},set(s,i){n.has(s)?n.set(s,i):o(s,i)}}},io="!",ao=":",Bl=ao.length,Hl=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=o=>{const s=[];let i=0,a=0,l=0,u;for(let g=0;g<o.length;g++){let y=o[g];if(i===0&&a===0){if(y===ao){s.push(o.slice(l,g)),l=g+Bl;continue}if(y==="/"){u=g;continue}}y==="["?i++:y==="]"?i--:y==="("?a++:y===")"&&a--}const d=s.length===0?o:o.substring(l),h=Ul(d),E=h!==d,p=u&&u>l?u-l:void 0;return{modifiers:s,hasImportantModifier:E,baseClassName:h,maybePostfixModifierPosition:p}};if(t){const o=t+ao,s=r;r=i=>i.startsWith(o)?s(i.substring(o.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:i,maybePostfixModifierPosition:void 0}}if(n){const o=r;r=s=>n({className:s,parseClassName:o})}return r},Ul=e=>e.endsWith(io)?e.substring(0,e.length-1):e.startsWith(io)?e.substring(1):e,Wl=e=>{const t=Object.fromEntries(e.orderSensitiveModifiers.map(r=>[r,!0]));return r=>{if(r.length<=1)return r;const o=[];let s=[];return r.forEach(i=>{i[0]==="["||t[i]?(o.push(...s.sort(),i),s=[]):s.push(i)}),o.push(...s.sort()),o}},ql=e=>({cache:jl(e.cacheSize),parseClassName:Hl(e),sortModifiers:Wl(e),...Dl(e)}),zl=/\s+/,Gl=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o,sortModifiers:s}=t,i=[],a=e.trim().split(zl);let l="";for(let u=a.length-1;u>=0;u-=1){const d=a[u],{isExternal:h,modifiers:E,hasImportantModifier:p,baseClassName:g,maybePostfixModifierPosition:y}=n(d);if(h){l=d+(l.length>0?" "+l:l);continue}let O=!!y,N=r(O?g.substring(0,y):g);if(!N){if(!O){l=d+(l.length>0?" "+l:l);continue}if(N=r(g),!N){l=d+(l.length>0?" "+l:l);continue}O=!1}const x=s(E).join(":"),I=p?x+io:x,B=I+N;if(i.includes(B))continue;i.push(B);const U=o(N,O);for(let H=0;H<U.length;++H){const W=U[H];i.push(I+W)}l=d+(l.length>0?" "+l:l)}return l};function Vl(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=Mi(t))&&(r&&(r+=" "),r+=n);return r}const Mi=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=Mi(e[r]))&&(n&&(n+=" "),n+=t);return n};function _l(e,...t){let n,r,o,s=i;function i(l){const u=t.reduce((d,h)=>h(d),e());return n=ql(u),r=n.cache.get,o=n.cache.set,s=a,a(l)}function a(l){const u=r(l);if(u)return u;const d=Gl(l,n);return o(l,d),d}return function(){return s(Vl.apply(null,arguments))}}const ge=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},Ii=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Di=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Ql=/^\d+\/\d+$/,Kl=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Yl=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Xl=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Jl=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Zl=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Xt=e=>Ql.test(e),oe=e=>!!e&&!Number.isNaN(Number(e)),mt=e=>!!e&&Number.isInteger(Number(e)),Br=e=>e.endsWith("%")&&oe(e.slice(0,-1)),it=e=>Kl.test(e),ec=()=>!0,tc=e=>Yl.test(e)&&!Xl.test(e),Ni=()=>!1,nc=e=>Jl.test(e),rc=e=>Zl.test(e),oc=e=>!K(e)&&!Y(e),sc=e=>yn(e,ji,Ni),K=e=>Ii.test(e),Tt=e=>yn(e,Bi,tc),Hr=e=>yn(e,uc,oe),vs=e=>yn(e,Li,Ni),ic=e=>yn(e,$i,rc),rr=e=>yn(e,Hi,nc),Y=e=>Di.test(e),On=e=>wn(e,Bi),ac=e=>wn(e,fc),ys=e=>wn(e,Li),lc=e=>wn(e,ji),cc=e=>wn(e,$i),or=e=>wn(e,Hi,!0),yn=(e,t,n)=>{const r=Ii.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},wn=(e,t,n=!1)=>{const r=Di.exec(e);return r?r[1]?t(r[1]):n:!1},Li=e=>e==="position"||e==="percentage",$i=e=>e==="image"||e==="url",ji=e=>e==="length"||e==="size"||e==="bg-size",Bi=e=>e==="length",uc=e=>e==="number",fc=e=>e==="family-name",Hi=e=>e==="shadow",dc=()=>{const e=ge("color"),t=ge("font"),n=ge("text"),r=ge("font-weight"),o=ge("tracking"),s=ge("leading"),i=ge("breakpoint"),a=ge("container"),l=ge("spacing"),u=ge("radius"),d=ge("shadow"),h=ge("inset-shadow"),E=ge("text-shadow"),p=ge("drop-shadow"),g=ge("blur"),y=ge("perspective"),O=ge("aspect"),N=ge("ease"),x=ge("animate"),I=()=>["auto","avoid","all","avoid-page","page","left","right","column"],B=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],U=()=>[...B(),Y,K],H=()=>["auto","hidden","clip","visible","scroll"],W=()=>["auto","contain","none"],c=()=>[Y,K,l],f=()=>[Xt,"full","auto",...c()],b=()=>[mt,"none","subgrid",Y,K],w=()=>["auto",{span:["full",mt,Y,K]},mt,Y,K],R=()=>[mt,"auto",Y,K],A=()=>["auto","min","max","fr",Y,K],k=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],m=()=>["start","end","center","stretch","center-safe","end-safe"],S=()=>["auto",...c()],F=()=>[Xt,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...c()],v=()=>[e,Y,K],M=()=>[...B(),ys,vs,{position:[Y,K]}],P=()=>["no-repeat",{repeat:["","x","y","space","round"]}],L=()=>["auto","cover","contain",lc,sc,{size:[Y,K]}],j=()=>[Br,On,Tt],z=()=>["","none","full",u,Y,K],q=()=>["",oe,On,Tt],V=()=>["solid","dashed","dotted","double"],X=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ee=()=>[oe,Br,ys,vs],ae=()=>["","none",g,Y,K],de=()=>["none",oe,Y,K],pe=()=>["none",oe,Y,K],Z=()=>[oe,Y,K],G=()=>[Xt,"full",...c()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[it],breakpoint:[it],color:[ec],container:[it],"drop-shadow":[it],ease:["in","out","in-out"],font:[oc],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[it],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[it],shadow:[it],spacing:["px",oe],text:[it],"text-shadow":[it],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Xt,K,Y,O]}],container:["container"],columns:[{columns:[oe,K,Y,a]}],"break-after":[{"break-after":I()}],"break-before":[{"break-before":I()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:U()}],overflow:[{overflow:H()}],"overflow-x":[{"overflow-x":H()}],"overflow-y":[{"overflow-y":H()}],overscroll:[{overscroll:W()}],"overscroll-x":[{"overscroll-x":W()}],"overscroll-y":[{"overscroll-y":W()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:f()}],"inset-x":[{"inset-x":f()}],"inset-y":[{"inset-y":f()}],start:[{start:f()}],end:[{end:f()}],top:[{top:f()}],right:[{right:f()}],bottom:[{bottom:f()}],left:[{left:f()}],visibility:["visible","invisible","collapse"],z:[{z:[mt,"auto",Y,K]}],basis:[{basis:[Xt,"full","auto",a,...c()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[oe,Xt,"auto","initial","none",K]}],grow:[{grow:["",oe,Y,K]}],shrink:[{shrink:["",oe,Y,K]}],order:[{order:[mt,"first","last","none",Y,K]}],"grid-cols":[{"grid-cols":b()}],"col-start-end":[{col:w()}],"col-start":[{"col-start":R()}],"col-end":[{"col-end":R()}],"grid-rows":[{"grid-rows":b()}],"row-start-end":[{row:w()}],"row-start":[{"row-start":R()}],"row-end":[{"row-end":R()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":A()}],"auto-rows":[{"auto-rows":A()}],gap:[{gap:c()}],"gap-x":[{"gap-x":c()}],"gap-y":[{"gap-y":c()}],"justify-content":[{justify:[...k(),"normal"]}],"justify-items":[{"justify-items":[...m(),"normal"]}],"justify-self":[{"justify-self":["auto",...m()]}],"align-content":[{content:["normal",...k()]}],"align-items":[{items:[...m(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...m(),{baseline:["","last"]}]}],"place-content":[{"place-content":k()}],"place-items":[{"place-items":[...m(),"baseline"]}],"place-self":[{"place-self":["auto",...m()]}],p:[{p:c()}],px:[{px:c()}],py:[{py:c()}],ps:[{ps:c()}],pe:[{pe:c()}],pt:[{pt:c()}],pr:[{pr:c()}],pb:[{pb:c()}],pl:[{pl:c()}],m:[{m:S()}],mx:[{mx:S()}],my:[{my:S()}],ms:[{ms:S()}],me:[{me:S()}],mt:[{mt:S()}],mr:[{mr:S()}],mb:[{mb:S()}],ml:[{ml:S()}],"space-x":[{"space-x":c()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":c()}],"space-y-reverse":["space-y-reverse"],size:[{size:F()}],w:[{w:[a,"screen",...F()]}],"min-w":[{"min-w":[a,"screen","none",...F()]}],"max-w":[{"max-w":[a,"screen","none","prose",{screen:[i]},...F()]}],h:[{h:["screen",...F()]}],"min-h":[{"min-h":["screen","none",...F()]}],"max-h":[{"max-h":["screen",...F()]}],"font-size":[{text:["base",n,On,Tt]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,Y,Hr]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Br,K]}],"font-family":[{font:[ac,K,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[o,Y,K]}],"line-clamp":[{"line-clamp":[oe,"none",Y,Hr]}],leading:[{leading:[s,...c()]}],"list-image":[{"list-image":["none",Y,K]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Y,K]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:v()}],"text-color":[{text:v()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...V(),"wavy"]}],"text-decoration-thickness":[{decoration:[oe,"from-font","auto",Y,Tt]}],"text-decoration-color":[{decoration:v()}],"underline-offset":[{"underline-offset":[oe,"auto",Y,K]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:c()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Y,K]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Y,K]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:M()}],"bg-repeat":[{bg:P()}],"bg-size":[{bg:L()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},mt,Y,K],radial:["",Y,K],conic:[mt,Y,K]},cc,ic]}],"bg-color":[{bg:v()}],"gradient-from-pos":[{from:j()}],"gradient-via-pos":[{via:j()}],"gradient-to-pos":[{to:j()}],"gradient-from":[{from:v()}],"gradient-via":[{via:v()}],"gradient-to":[{to:v()}],rounded:[{rounded:z()}],"rounded-s":[{"rounded-s":z()}],"rounded-e":[{"rounded-e":z()}],"rounded-t":[{"rounded-t":z()}],"rounded-r":[{"rounded-r":z()}],"rounded-b":[{"rounded-b":z()}],"rounded-l":[{"rounded-l":z()}],"rounded-ss":[{"rounded-ss":z()}],"rounded-se":[{"rounded-se":z()}],"rounded-ee":[{"rounded-ee":z()}],"rounded-es":[{"rounded-es":z()}],"rounded-tl":[{"rounded-tl":z()}],"rounded-tr":[{"rounded-tr":z()}],"rounded-br":[{"rounded-br":z()}],"rounded-bl":[{"rounded-bl":z()}],"border-w":[{border:q()}],"border-w-x":[{"border-x":q()}],"border-w-y":[{"border-y":q()}],"border-w-s":[{"border-s":q()}],"border-w-e":[{"border-e":q()}],"border-w-t":[{"border-t":q()}],"border-w-r":[{"border-r":q()}],"border-w-b":[{"border-b":q()}],"border-w-l":[{"border-l":q()}],"divide-x":[{"divide-x":q()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":q()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...V(),"hidden","none"]}],"divide-style":[{divide:[...V(),"hidden","none"]}],"border-color":[{border:v()}],"border-color-x":[{"border-x":v()}],"border-color-y":[{"border-y":v()}],"border-color-s":[{"border-s":v()}],"border-color-e":[{"border-e":v()}],"border-color-t":[{"border-t":v()}],"border-color-r":[{"border-r":v()}],"border-color-b":[{"border-b":v()}],"border-color-l":[{"border-l":v()}],"divide-color":[{divide:v()}],"outline-style":[{outline:[...V(),"none","hidden"]}],"outline-offset":[{"outline-offset":[oe,Y,K]}],"outline-w":[{outline:["",oe,On,Tt]}],"outline-color":[{outline:v()}],shadow:[{shadow:["","none",d,or,rr]}],"shadow-color":[{shadow:v()}],"inset-shadow":[{"inset-shadow":["none",h,or,rr]}],"inset-shadow-color":[{"inset-shadow":v()}],"ring-w":[{ring:q()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:v()}],"ring-offset-w":[{"ring-offset":[oe,Tt]}],"ring-offset-color":[{"ring-offset":v()}],"inset-ring-w":[{"inset-ring":q()}],"inset-ring-color":[{"inset-ring":v()}],"text-shadow":[{"text-shadow":["none",E,or,rr]}],"text-shadow-color":[{"text-shadow":v()}],opacity:[{opacity:[oe,Y,K]}],"mix-blend":[{"mix-blend":[...X(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":X()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[oe]}],"mask-image-linear-from-pos":[{"mask-linear-from":ee()}],"mask-image-linear-to-pos":[{"mask-linear-to":ee()}],"mask-image-linear-from-color":[{"mask-linear-from":v()}],"mask-image-linear-to-color":[{"mask-linear-to":v()}],"mask-image-t-from-pos":[{"mask-t-from":ee()}],"mask-image-t-to-pos":[{"mask-t-to":ee()}],"mask-image-t-from-color":[{"mask-t-from":v()}],"mask-image-t-to-color":[{"mask-t-to":v()}],"mask-image-r-from-pos":[{"mask-r-from":ee()}],"mask-image-r-to-pos":[{"mask-r-to":ee()}],"mask-image-r-from-color":[{"mask-r-from":v()}],"mask-image-r-to-color":[{"mask-r-to":v()}],"mask-image-b-from-pos":[{"mask-b-from":ee()}],"mask-image-b-to-pos":[{"mask-b-to":ee()}],"mask-image-b-from-color":[{"mask-b-from":v()}],"mask-image-b-to-color":[{"mask-b-to":v()}],"mask-image-l-from-pos":[{"mask-l-from":ee()}],"mask-image-l-to-pos":[{"mask-l-to":ee()}],"mask-image-l-from-color":[{"mask-l-from":v()}],"mask-image-l-to-color":[{"mask-l-to":v()}],"mask-image-x-from-pos":[{"mask-x-from":ee()}],"mask-image-x-to-pos":[{"mask-x-to":ee()}],"mask-image-x-from-color":[{"mask-x-from":v()}],"mask-image-x-to-color":[{"mask-x-to":v()}],"mask-image-y-from-pos":[{"mask-y-from":ee()}],"mask-image-y-to-pos":[{"mask-y-to":ee()}],"mask-image-y-from-color":[{"mask-y-from":v()}],"mask-image-y-to-color":[{"mask-y-to":v()}],"mask-image-radial":[{"mask-radial":[Y,K]}],"mask-image-radial-from-pos":[{"mask-radial-from":ee()}],"mask-image-radial-to-pos":[{"mask-radial-to":ee()}],"mask-image-radial-from-color":[{"mask-radial-from":v()}],"mask-image-radial-to-color":[{"mask-radial-to":v()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":B()}],"mask-image-conic-pos":[{"mask-conic":[oe]}],"mask-image-conic-from-pos":[{"mask-conic-from":ee()}],"mask-image-conic-to-pos":[{"mask-conic-to":ee()}],"mask-image-conic-from-color":[{"mask-conic-from":v()}],"mask-image-conic-to-color":[{"mask-conic-to":v()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:M()}],"mask-repeat":[{mask:P()}],"mask-size":[{mask:L()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Y,K]}],filter:[{filter:["","none",Y,K]}],blur:[{blur:ae()}],brightness:[{brightness:[oe,Y,K]}],contrast:[{contrast:[oe,Y,K]}],"drop-shadow":[{"drop-shadow":["","none",p,or,rr]}],"drop-shadow-color":[{"drop-shadow":v()}],grayscale:[{grayscale:["",oe,Y,K]}],"hue-rotate":[{"hue-rotate":[oe,Y,K]}],invert:[{invert:["",oe,Y,K]}],saturate:[{saturate:[oe,Y,K]}],sepia:[{sepia:["",oe,Y,K]}],"backdrop-filter":[{"backdrop-filter":["","none",Y,K]}],"backdrop-blur":[{"backdrop-blur":ae()}],"backdrop-brightness":[{"backdrop-brightness":[oe,Y,K]}],"backdrop-contrast":[{"backdrop-contrast":[oe,Y,K]}],"backdrop-grayscale":[{"backdrop-grayscale":["",oe,Y,K]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[oe,Y,K]}],"backdrop-invert":[{"backdrop-invert":["",oe,Y,K]}],"backdrop-opacity":[{"backdrop-opacity":[oe,Y,K]}],"backdrop-saturate":[{"backdrop-saturate":[oe,Y,K]}],"backdrop-sepia":[{"backdrop-sepia":["",oe,Y,K]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":c()}],"border-spacing-x":[{"border-spacing-x":c()}],"border-spacing-y":[{"border-spacing-y":c()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Y,K]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[oe,"initial",Y,K]}],ease:[{ease:["linear","initial",N,Y,K]}],delay:[{delay:[oe,Y,K]}],animate:[{animate:["none",x,Y,K]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[y,Y,K]}],"perspective-origin":[{"perspective-origin":U()}],rotate:[{rotate:de()}],"rotate-x":[{"rotate-x":de()}],"rotate-y":[{"rotate-y":de()}],"rotate-z":[{"rotate-z":de()}],scale:[{scale:pe()}],"scale-x":[{"scale-x":pe()}],"scale-y":[{"scale-y":pe()}],"scale-z":[{"scale-z":pe()}],"scale-3d":["scale-3d"],skew:[{skew:Z()}],"skew-x":[{"skew-x":Z()}],"skew-y":[{"skew-y":Z()}],transform:[{transform:[Y,K,"","none","gpu","cpu"]}],"transform-origin":[{origin:U()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:G()}],"translate-x":[{"translate-x":G()}],"translate-y":[{"translate-y":G()}],"translate-z":[{"translate-z":G()}],"translate-none":["translate-none"],accent:[{accent:v()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:v()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Y,K]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":c()}],"scroll-mx":[{"scroll-mx":c()}],"scroll-my":[{"scroll-my":c()}],"scroll-ms":[{"scroll-ms":c()}],"scroll-me":[{"scroll-me":c()}],"scroll-mt":[{"scroll-mt":c()}],"scroll-mr":[{"scroll-mr":c()}],"scroll-mb":[{"scroll-mb":c()}],"scroll-ml":[{"scroll-ml":c()}],"scroll-p":[{"scroll-p":c()}],"scroll-px":[{"scroll-px":c()}],"scroll-py":[{"scroll-py":c()}],"scroll-ps":[{"scroll-ps":c()}],"scroll-pe":[{"scroll-pe":c()}],"scroll-pt":[{"scroll-pt":c()}],"scroll-pr":[{"scroll-pr":c()}],"scroll-pb":[{"scroll-pb":c()}],"scroll-pl":[{"scroll-pl":c()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Y,K]}],fill:[{fill:["none",...v()]}],"stroke-w":[{stroke:[oe,On,Tt,Hr]}],stroke:[{stroke:["none",...v()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},hc=_l(dc);function en(...e){return hc(Il(e))}const Wo=C.forwardRef(({className:e="",children:t,style:n,...r},o)=>$.jsx("button",{ref:o,className:en("bg-[#2D2DF1] dark:bg-[#BFBFF9] transition-colors hover:bg-[#2929D9] dark:hover:bg-[#D4D4FA] text-white dark:text-[#001324] font-bold py-2.5 px-4 rounded-xl disabled:opacity-50 wallet-custom-font",e),style:n,...r,type:"button","data-wallet-ui":!0,children:t||"Connect Wallet"}));Wo.displayName="ConnectWalletButton";function Cr(){return typeof window<"u"}function At(e){return Ui(e)?(e.nodeName||"").toLowerCase():"#document"}function Le(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ot(e){var t;return(t=(Ui(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Ui(e){return Cr()?e instanceof Node||e instanceof Le(e).Node:!1}function ue(e){return Cr()?e instanceof Element||e instanceof Le(e).Element:!1}function be(e){return Cr()?e instanceof HTMLElement||e instanceof Le(e).HTMLElement:!1}function lo(e){return!Cr()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Le(e).ShadowRoot}function _n(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=qe(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function pc(e){return["table","td","th"].includes(At(e))}function kr(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function qo(e){const t=Ar(),n=ue(e)?qe(e):e;return["transform","translate","scale","rotate","perspective"].some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function mc(e){let t=ht(e);for(;be(t)&&!ut(t);){if(qo(t))return t;if(kr(t))return null;t=ht(t)}return null}function Ar(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function ut(e){return["html","body","#document"].includes(At(e))}function qe(e){return Le(e).getComputedStyle(e)}function Or(e){return ue(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ht(e){if(At(e)==="html")return e;const t=e.assignedSlot||e.parentNode||lo(e)&&e.host||ot(e);return lo(t)?t.host:t}function Wi(e){const t=ht(e);return ut(t)?e.ownerDocument?e.ownerDocument.body:e.body:be(t)&&_n(t)?t:Wi(t)}function Ct(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=Wi(e),s=o===((r=e.ownerDocument)==null?void 0:r.body),i=Le(o);if(s){const a=co(i);return t.concat(i,i.visualViewport||[],_n(o)?o:[],a&&n?Ct(a):[])}return t.concat(o,Ct(o,[],n))}function co(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Pt(e){let t=e.activeElement;for(;((n=t)==null||(n=n.shadowRoot)==null?void 0:n.activeElement)!=null;){var n;t=t.shadowRoot.activeElement}return t}function Ie(e,t){if(!e||!t)return!1;const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&lo(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function qi(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function zi(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(t=>{let{brand:n,version:r}=t;return n+"/"+r}).join(" "):navigator.userAgent}function gc(e){return e.mozInputSource===0&&e.isTrusted?!0:uo()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function bc(e){return yc()?!1:!uo()&&e.width===0&&e.height===0||uo()&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType==="touch"}function vc(){return/apple/i.test(navigator.vendor)}function uo(){const e=/android/i;return e.test(qi())||e.test(zi())}function yc(){return zi().includes("jsdom/")}function ws(e,t){return["mouse","pen"].includes(e)}function wc(e){return"nativeEvent"in e}function xc(e){return e.matches("html,body")}function De(e){return(e==null?void 0:e.ownerDocument)||document}function Ur(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function Dt(e){return"composedPath"in e?e.composedPath()[0]:e.target}const Ec="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function Gi(e){return be(e)&&e.matches(Ec)}function Wr(e){e.preventDefault(),e.stopPropagation()}function xs(e){return e?e.getAttribute("role")==="combobox"&&Gi(e):!1}const Vt=Math.min,Se=Math.max,$n=Math.round,sr=Math.floor,rt=e=>({x:e,y:e}),Rc={left:"right",right:"left",bottom:"top",top:"bottom"},Sc={start:"end",end:"start"};function Es(e,t,n){return Se(e,Vt(t,n))}function xn(e,t){return typeof e=="function"?e(t):e}function kt(e){return e.split("-")[0]}function Qn(e){return e.split("-")[1]}function Vi(e){return e==="x"?"y":"x"}function _i(e){return e==="y"?"height":"width"}function _t(e){return["top","bottom"].includes(kt(e))?"y":"x"}function Qi(e){return Vi(_t(e))}function Cc(e,t,n){n===void 0&&(n=!1);const r=Qn(e),o=Qi(e),s=_i(o);let i=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=pr(i)),[i,pr(i)]}function kc(e){const t=pr(e);return[fo(e),t,fo(t)]}function fo(e){return e.replace(/start|end/g,t=>Sc[t])}function Ac(e,t,n){const r=["left","right"],o=["right","left"],s=["top","bottom"],i=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?s:i;default:return[]}}function Oc(e,t,n,r){const o=Qn(e);let s=Ac(kt(e),n==="start",r);return o&&(s=s.map(i=>i+"-"+o),t&&(s=s.concat(s.map(fo)))),s}function pr(e){return e.replace(/left|right|bottom|top/g,t=>Rc[t])}function Tc(e){return{top:0,right:0,bottom:0,left:0,...e}}function Fc(e){return typeof e!="number"?Tc(e):{top:e,right:e,bottom:e,left:e}}function mr(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}/*!
|
|
35
35
|
* tabbable 6.2.0
|
|
36
36
|
* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
|
|
37
|
-
*/var Qi=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"],Wt=Qi.join(","),uo=typeof Element>"u",ot=uo?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Ut=!uo&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e==null?void 0:e.ownerDocument},Vt=function e(t,n){var r;n===void 0&&(n=!0);var o=t==null||(r=t.getAttribute)===null||r===void 0?void 0:r.call(t,"inert"),i=o===""||o==="true",l=i||n&&t&&e(t.parentNode);return l},Zi=function(t){var n,r=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return r===""||r==="true"},el=function(t,n,r){if(Vt(t))return[];var o=Array.prototype.slice.apply(t.querySelectorAll(Wt));return n&&ot.call(t,Wt)&&o.unshift(t),o=o.filter(r),o},tl=function e(t,n,r){for(var o=[],i=Array.from(t);i.length;){var l=i.shift();if(!Vt(l,!1))if(l.tagName==="SLOT"){var s=l.assignedElements(),a=s.length?s:l.children,f=e(a,!0,r);r.flatten?o.push.apply(o,f):o.push({scopeParent:l,candidates:f})}else{var d=ot.call(l,Wt);d&&r.filter(l)&&(n||!t.includes(l))&&o.push(l);var h=l.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(l),A=!Vt(h,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(l));if(h&&A){var m=e(h===!0?l.children:h.children,!0,r);r.flatten?o.push.apply(o,m):o.push({scopeParent:l,candidates:m})}else i.unshift.apply(i,l.children)}}return o},co=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},fo=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||Zi(t))&&!co(t)?0:t.tabIndex},nl=function(t,n){var r=fo(t);return r<0&&n&&!co(t)?0:r},rl=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},po=function(t){return t.tagName==="INPUT"},ol=function(t){return po(t)&&t.type==="hidden"},il=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return n},ll=function(t,n){for(var r=0;r<t.length;r++)if(t[r].checked&&t[r].form===n)return t[r]},sl=function(t){if(!t.name)return!0;var n=t.form||Ut(t),r=function(s){return n.querySelectorAll('input[type="radio"][name="'+s+'"]')},o;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")o=r(window.CSS.escape(t.name));else try{o=r(t.name)}catch(l){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",l.message),!1}var i=ll(o,t.form);return!i||i===t},al=function(t){return po(t)&&t.type==="radio"},ul=function(t){return al(t)&&!sl(t)},cl=function(t){var n,r=t&&Ut(t),o=(n=r)===null||n===void 0?void 0:n.host,i=!1;if(r&&r!==t){var l,s,a;for(i=!!((l=o)!==null&&l!==void 0&&(s=l.ownerDocument)!==null&&s!==void 0&&s.contains(o)||t!=null&&(a=t.ownerDocument)!==null&&a!==void 0&&a.contains(t));!i&&o;){var f,d,h;r=Ut(o),o=(f=r)===null||f===void 0?void 0:f.host,i=!!((d=o)!==null&&d!==void 0&&(h=d.ownerDocument)!==null&&h!==void 0&&h.contains(o))}}return i},pr=function(t){var n=t.getBoundingClientRect(),r=n.width,o=n.height;return r===0&&o===0},fl=function(t,n){var r=n.displayCheck,o=n.getShadowRoot;if(getComputedStyle(t).visibility==="hidden")return!0;var i=ot.call(t,"details>summary:first-of-type"),l=i?t.parentElement:t;if(ot.call(l,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="legacy-full"){if(typeof o=="function"){for(var s=t;t;){var a=t.parentElement,f=Ut(t);if(a&&!a.shadowRoot&&o(a)===!0)return pr(t);t.assignedSlot?t=t.assignedSlot:!a&&f!==t.ownerDocument?t=f.host:t=a}t=s}if(cl(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return pr(t);return!1},dl=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var n=t.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var r=0;r<n.children.length;r++){var o=n.children.item(r);if(o.tagName==="LEGEND")return ot.call(n,"fieldset[disabled] *")?!0:!o.contains(t)}return!0}n=n.parentElement}return!1},pl=function(t,n){return!(n.disabled||Vt(n)||ol(n)||fl(n,t)||il(n)||dl(n))},Fn=function(t,n){return!(ul(n)||fo(n)<0||!pl(t,n))},ml=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},gl=function e(t){var n=[],r=[];return t.forEach(function(o,i){var l=!!o.scopeParent,s=l?o.scopeParent:o,a=nl(s,l),f=l?e(o.candidates):s;a===0?l?n.push.apply(n,f):n.push(s):r.push({documentOrder:i,tabIndex:a,item:o,isScope:l,content:f})}),r.sort(rl).reduce(function(o,i){return i.isScope?o.push.apply(o,i.content):o.push(i.content),o},[]).concat(n)},Zt=function(t,n){n=n||{};var r;return n.getShadowRoot?r=tl([t],n.includeContainer,{filter:Fn.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:ml}):r=el(t,n.includeContainer,Fn.bind(null,n)),gl(r)},hl=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return ot.call(t,Wt)===!1?!1:Fn(n,t)};function mr(e,t,n){let{reference:r,floating:o}=e;const i=Qe(t),l=ao(t),s=so(l),a=He(t),f=i==="y",d=r.x+r.width/2-o.width/2,h=r.y+r.height/2-o.height/2,A=r[s]/2-o[s]/2;let m;switch(a){case"top":m={x:d,y:r.y-o.height};break;case"bottom":m={x:d,y:r.y+r.height};break;case"right":m={x:r.x+r.width,y:h};break;case"left":m={x:r.x-o.width,y:h};break;default:m={x:r.x,y:r.y}}switch(St(t)){case"start":m[l]-=A*(n&&f?-1:1);break;case"end":m[l]+=A*(n&&f?-1:1);break}return m}const vl=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:l}=n,s=i.filter(Boolean),a=await(l.isRTL==null?void 0:l.isRTL(t));let f=await l.getElementRects({reference:e,floating:t,strategy:o}),{x:d,y:h}=mr(f,r,a),A=r,m={},v=0;for(let T=0;T<s.length;T++){const{name:k,fn:N}=s[T],{x:C,y:M,data:B,reset:j}=await N({x:d,y:h,initialPlacement:r,placement:A,strategy:o,middlewareData:m,rects:f,platform:l,elements:{reference:e,floating:t}});d=C??d,h=M??h,m={...m,[k]:{...m[k],...B}},j&&v<=50&&(v++,typeof j=="object"&&(j.placement&&(A=j.placement),j.rects&&(f=j.rects===!0?await l.getElementRects({reference:e,floating:t,strategy:o}):j.rects),{x:d,y:h}=mr(f,A,a)),T=-1)}return{x:d,y:h,placement:A,strategy:o,middlewareData:m}};async function en(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:i,rects:l,elements:s,strategy:a}=e,{boundary:f="clippingAncestors",rootBoundary:d="viewport",elementContext:h="floating",altBoundary:A=!1,padding:m=0}=lt(t,e),v=Ji(m),k=s[A?h==="floating"?"reference":"floating":h],N=Ht(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(k)))==null||n?k:k.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(s.floating)),boundary:f,rootBoundary:d,strategy:a})),C=h==="floating"?{x:r,y:o,width:l.floating.width,height:l.floating.height}:l.reference,M=await(i.getOffsetParent==null?void 0:i.getOffsetParent(s.floating)),B=await(i.isElement==null?void 0:i.isElement(M))?await(i.getScale==null?void 0:i.getScale(M))||{x:1,y:1}:{x:1,y:1},j=Ht(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:C,offsetParent:M,strategy:a}):C);return{top:(N.top-j.top+v.top)/B.y,bottom:(j.bottom-N.bottom+v.bottom)/B.y,left:(N.left-j.left+v.left)/B.x,right:(j.right-N.right+v.right)/B.x}}const bl=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:l,initialPlacement:s,platform:a,elements:f}=t,{mainAxis:d=!0,crossAxis:h=!0,fallbackPlacements:A,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:T=!0,...k}=lt(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const N=He(o),C=Qe(s),M=He(s)===s,B=await(a.isRTL==null?void 0:a.isRTL(f.floating)),j=A||(M||!T?[Bt(s)]:_i(s)),W=v!=="none";!A&&W&&j.push(...Xi(s,T,v,B));const G=[s,...j],u=await en(t,k),c=[];let p=((r=i.flip)==null?void 0:r.overflows)||[];if(d&&c.push(u[N]),h){const F=qi(o,l,B);c.push(u[F[0]],u[F[1]])}if(p=[...p,{placement:o,overflows:c}],!c.every(F=>F<=0)){var b,w;const F=(((b=i.flip)==null?void 0:b.index)||0)+1,g=G[F];if(g)return{data:{index:F,overflows:p},reset:{placement:g}};let x=(w=p.filter(O=>O.overflows[0]<=0).sort((O,S)=>O.overflows[1]-S.overflows[1])[0])==null?void 0:w.placement;if(!x)switch(m){case"bestFit":{var y;const O=(y=p.filter(S=>{if(W){const P=Qe(S.placement);return P===C||P==="y"}return!0}).map(S=>[S.placement,S.overflows.filter(P=>P>0).reduce((P,E)=>P+E,0)]).sort((S,P)=>S[1]-P[1])[0])==null?void 0:y[0];O&&(x=O);break}case"initialPlacement":x=s;break}if(o!==x)return{reset:{placement:x}}}return{}}}};async function yl(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),l=He(n),s=St(n),a=Qe(n)==="y",f=["left","top"].includes(l)?-1:1,d=i&&a?-1:1,h=lt(t,e);let{mainAxis:A,crossAxis:m,alignmentAxis:v}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return s&&typeof v=="number"&&(m=s==="end"?v*-1:v),a?{x:m*d,y:A*f}:{x:A*f,y:m*d}}const xl=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:l,middlewareData:s}=t,a=await yl(t,e);return l===((n=s.offset)==null?void 0:n.placement)&&(r=s.arrow)!=null&&r.alignmentOffset?{}:{x:o+a.x,y:i+a.y,data:{...a,placement:l}}}}},wl=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:l=!1,limiter:s={fn:k=>{let{x:N,y:C}=k;return{x:N,y:C}}},...a}=lt(e,t),f={x:n,y:r},d=await en(t,a),h=Qe(He(o)),A=lo(h);let m=f[A],v=f[h];if(i){const k=A==="y"?"top":"left",N=A==="y"?"bottom":"right",C=m+d[k],M=m-d[N];m=dr(C,m,M)}if(l){const k=h==="y"?"top":"left",N=h==="y"?"bottom":"right",C=v+d[k],M=v-d[N];v=dr(C,v,M)}const T=s.fn({...t,[A]:m,[h]:v});return{...T,data:{x:T.x-n,y:T.y-r,enabled:{[A]:i,[h]:l}}}}}},El=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:i,platform:l,elements:s}=t,{apply:a=()=>{},...f}=lt(e,t),d=await en(t,f),h=He(o),A=St(o),m=Qe(o)==="y",{width:v,height:T}=i.floating;let k,N;h==="top"||h==="bottom"?(k=h,N=A===(await(l.isRTL==null?void 0:l.isRTL(s.floating))?"start":"end")?"left":"right"):(N=h,k=A==="end"?"top":"bottom");const C=T-d.top-d.bottom,M=v-d.left-d.right,B=Je(T-d[k],C),j=Je(v-d[N],M),W=!t.middlewareData.shift;let G=B,u=j;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(u=M),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(G=C),W&&!A){const p=ce(d.left,0),b=ce(d.right,0),w=ce(d.top,0),y=ce(d.bottom,0);m?u=v-2*(p!==0||b!==0?p+b:ce(d.left,d.right)):G=T-2*(w!==0||y!==0?w+y:ce(d.top,d.bottom))}await a({...t,availableWidth:u,availableHeight:G});const c=await l.getDimensions(s.floating);return v!==c.width||T!==c.height?{reset:{rects:!0}}:{}}}};function mo(e){const t=xe(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=se(e),i=o?e.offsetWidth:n,l=o?e.offsetHeight:r,s=yt(n)!==i||yt(r)!==l;return s&&(n=i,r=l),{width:n,height:r,$:s}}function Gn(e){return re(e)?e:e.contextElement}function rt(e){const t=Gn(e);if(!se(t))return Oe(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=mo(t);let l=(i?yt(n.width):n.width)/r,s=(i?yt(n.height):n.height)/o;return(!l||!Number.isFinite(l))&&(l=1),(!s||!Number.isFinite(s))&&(s=1),{x:l,y:s}}const Rl=Oe(0);function go(e){const t=ge(e);return!Jt()||!t.visualViewport?Rl:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Sl(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==ge(e)?!1:t}function Ze(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=Gn(e);let l=Oe(1);t&&(r?re(r)&&(l=rt(r)):l=rt(e));const s=Sl(i,n,r)?go(i):Oe(0);let a=(o.left+s.x)/l.x,f=(o.top+s.y)/l.y,d=o.width/l.x,h=o.height/l.y;if(i){const A=ge(i),m=r&&re(r)?ge(r):r;let v=A,T=Tn(v);for(;T&&r&&m!==v;){const k=rt(T),N=T.getBoundingClientRect(),C=xe(T),M=N.left+(T.clientLeft+parseFloat(C.paddingLeft))*k.x,B=N.top+(T.clientTop+parseFloat(C.paddingTop))*k.y;a*=k.x,f*=k.y,d*=k.x,h*=k.y,a+=M,f+=B,v=ge(T),T=Tn(v)}}return Ht({width:d,height:h,x:a,y:f})}function Yn(e,t){const n=Qt(e).scrollLeft;return t?t.left+n:Ze(Fe(e)).left+n}function ho(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),o=r.left+t.scrollLeft-(n?0:Yn(e,r)),i=r.top+t.scrollTop;return{x:o,y:i}}function Cl(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i=o==="fixed",l=Fe(r),s=t?Kt(t.floating):!1;if(r===l||s&&i)return n;let a={scrollLeft:0,scrollTop:0},f=Oe(1);const d=Oe(0),h=se(r);if((h||!h&&!i)&&((We(r)!=="body"||Rt(l))&&(a=Qt(r)),se(r))){const m=Ze(r);f=rt(r),d.x=m.x+r.clientLeft,d.y=m.y+r.clientTop}const A=l&&!h&&!i?ho(l,a,!0):Oe(0);return{width:n.width*f.x,height:n.height*f.y,x:n.x*f.x-a.scrollLeft*f.x+d.x+A.x,y:n.y*f.y-a.scrollTop*f.y+d.y+A.y}}function Tl(e){return Array.from(e.getClientRects())}function Al(e){const t=Fe(e),n=Qt(e),r=e.ownerDocument.body,o=ce(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=ce(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let l=-n.scrollLeft+Yn(e);const s=-n.scrollTop;return xe(r).direction==="rtl"&&(l+=ce(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:l,y:s}}function Ol(e,t){const n=ge(e),r=Fe(e),o=n.visualViewport;let i=r.clientWidth,l=r.clientHeight,s=0,a=0;if(o){i=o.width,l=o.height;const f=Jt();(!f||f&&t==="fixed")&&(s=o.offsetLeft,a=o.offsetTop)}return{width:i,height:l,x:s,y:a}}function Fl(e,t){const n=Ze(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=se(e)?rt(e):Oe(1),l=e.clientWidth*i.x,s=e.clientHeight*i.y,a=o*i.x,f=r*i.y;return{width:l,height:s,x:a,y:f}}function gr(e,t,n){let r;if(t==="viewport")r=Ol(e,n);else if(t==="document")r=Al(Fe(e));else if(re(t))r=Fl(t,n);else{const o=go(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Ht(r)}function vo(e,t){const n=Le(e);return n===t||!re(n)||Ie(n)?!1:xe(n).position==="fixed"||vo(n,t)}function Pl(e,t){const n=t.get(e);if(n)return n;let r=Be(e,[],!1).filter(s=>re(s)&&We(s)!=="body"),o=null;const i=xe(e).position==="fixed";let l=i?Le(e):e;for(;re(l)&&!Ie(l);){const s=xe(l),a=Vn(l);!a&&s.position==="fixed"&&(o=null),(i?!a&&!o:!a&&s.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||Rt(l)&&!a&&vo(e,l))?r=r.filter(d=>d!==l):o=s,l=Le(l)}return t.set(e,r),r}function kl(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const l=[...n==="clippingAncestors"?Kt(t)?[]:Pl(t,this._c):[].concat(n),r],s=l[0],a=l.reduce((f,d)=>{const h=gr(t,d,o);return f.top=ce(h.top,f.top),f.right=Je(h.right,f.right),f.bottom=Je(h.bottom,f.bottom),f.left=ce(h.left,f.left),f},gr(t,s,o));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}}function Nl(e){const{width:t,height:n}=mo(e);return{width:t,height:n}}function Dl(e,t,n){const r=se(t),o=Fe(t),i=n==="fixed",l=Ze(e,!0,i,t);let s={scrollLeft:0,scrollTop:0};const a=Oe(0);if(r||!r&&!i)if((We(t)!=="body"||Rt(o))&&(s=Qt(t)),r){const A=Ze(t,!0,i,t);a.x=A.x+t.clientLeft,a.y=A.y+t.clientTop}else o&&(a.x=Yn(o));const f=o&&!r&&!i?ho(o,s):Oe(0),d=l.left+s.scrollLeft-a.x-f.x,h=l.top+s.scrollTop-a.y-f.y;return{x:d,y:h,width:l.width,height:l.height}}function cn(e){return xe(e).position==="static"}function hr(e,t){if(!se(e)||xe(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Fe(e)===n&&(n=n.ownerDocument.body),n}function bo(e,t){const n=ge(e);if(Kt(e))return n;if(!se(e)){let o=Le(e);for(;o&&!Ie(o);){if(re(o)&&!cn(o))return o;o=Le(o)}return n}let r=hr(e,t);for(;r&&Ii(r)&&cn(r);)r=hr(r,t);return r&&Ie(r)&&cn(r)&&!Vn(r)?n:r||Mi(e)||n}const Il=async function(e){const t=this.getOffsetParent||bo,n=this.getDimensions,r=await n(e.floating);return{reference:Dl(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Ml(e){return xe(e).direction==="rtl"}const Ll={convertOffsetParentRelativeRectToViewportRelativeRect:Cl,getDocumentElement:Fe,getClippingRect:kl,getOffsetParent:bo,getElementRects:Il,getClientRects:Tl,getDimensions:Nl,getScale:rt,isElement:re,isRTL:Ml};function yo(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function $l(e,t){let n=null,r;const o=Fe(e);function i(){var s;clearTimeout(r),(s=n)==null||s.disconnect(),n=null}function l(s,a){s===void 0&&(s=!1),a===void 0&&(a=1),i();const f=e.getBoundingClientRect(),{left:d,top:h,width:A,height:m}=f;if(s||t(),!A||!m)return;const v=kt(h),T=kt(o.clientWidth-(d+A)),k=kt(o.clientHeight-(h+m)),N=kt(d),M={rootMargin:-v+"px "+-T+"px "+-k+"px "+-N+"px",threshold:ce(0,Je(1,a))||1};let B=!0;function j(W){const G=W[0].intersectionRatio;if(G!==a){if(!B)return l();G?l(!1,G):r=setTimeout(()=>{l(!1,1e-7)},1e3)}G===1&&!yo(f,e.getBoundingClientRect())&&l(),B=!1}try{n=new IntersectionObserver(j,{...M,root:o.ownerDocument})}catch{n=new IntersectionObserver(j,M)}n.observe(e)}return l(!0),i}function xo(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:a=!1}=r,f=Gn(e),d=o||i?[...f?Be(f):[],...Be(t)]:[];d.forEach(N=>{o&&N.addEventListener("scroll",n,{passive:!0}),i&&N.addEventListener("resize",n)});const h=f&&s?$l(f,n):null;let A=-1,m=null;l&&(m=new ResizeObserver(N=>{let[C]=N;C&&C.target===f&&m&&(m.unobserve(t),cancelAnimationFrame(A),A=requestAnimationFrame(()=>{var M;(M=m)==null||M.observe(t)})),n()}),f&&!a&&m.observe(f),m.observe(t));let v,T=a?Ze(e):null;a&&k();function k(){const N=Ze(e);T&&!yo(T,N)&&n(),T=N,v=requestAnimationFrame(k)}return n(),()=>{var N;d.forEach(C=>{o&&C.removeEventListener("scroll",n),i&&C.removeEventListener("resize",n)}),h==null||h(),(N=m)==null||N.disconnect(),m=null,a&&cancelAnimationFrame(v)}}const fn=en,jl=xl,Bl=wl,Hl=bl,Wl=El,Ul=(e,t,n)=>{const r=new Map,o={platform:Ll,...n},i={...o.platform,_c:r};return vl(e,t,{...o,platform:i})};var jt=typeof document<"u"?R.useLayoutEffect:R.useEffect;function Gt(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 n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Gt(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const i=o[r];if(!(i==="_owner"&&e.$$typeof)&&!Gt(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function wo(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function vr(e,t){const n=wo(e);return Math.round(t*n)/n}function dn(e){const t=D.useRef(e);return jt(()=>{t.current=e}),t}function Eo(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:i,floating:l}={},transform:s=!0,whileElementsMounted:a,open:f}=e,[d,h]=D.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[A,m]=D.useState(r);Gt(A,r)||m(r);const[v,T]=D.useState(null),[k,N]=D.useState(null),C=D.useCallback(S=>{S!==W.current&&(W.current=S,T(S))},[]),M=D.useCallback(S=>{S!==G.current&&(G.current=S,N(S))},[]),B=i||v,j=l||k,W=D.useRef(null),G=D.useRef(null),u=D.useRef(d),c=a!=null,p=dn(a),b=dn(o),w=dn(f),y=D.useCallback(()=>{if(!W.current||!G.current)return;const S={placement:t,strategy:n,middleware:A};b.current&&(S.platform=b.current),Ul(W.current,G.current,S).then(P=>{const E={...P,isPositioned:w.current!==!1};F.current&&!Gt(u.current,E)&&(u.current=E,bt.flushSync(()=>{h(E)}))})},[A,t,n,b,w]);jt(()=>{f===!1&&u.current.isPositioned&&(u.current.isPositioned=!1,h(S=>({...S,isPositioned:!1})))},[f]);const F=D.useRef(!1);jt(()=>(F.current=!0,()=>{F.current=!1}),[]),jt(()=>{if(B&&(W.current=B),j&&(G.current=j),B&&j){if(p.current)return p.current(B,j,y);y()}},[B,j,y,p,c]);const g=D.useMemo(()=>({reference:W,floating:G,setReference:C,setFloating:M}),[C,M]),x=D.useMemo(()=>({reference:B,floating:j}),[B,j]),O=D.useMemo(()=>{const S={position:n,left:0,top:0};if(!x.floating)return S;const P=vr(x.floating,d.x),E=vr(x.floating,d.y);return s?{...S,transform:"translate("+P+"px, "+E+"px)",...wo(x.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:P,top:E}},[n,s,x.floating,d.x,d.y]);return D.useMemo(()=>({...d,update:y,refs:g,elements:x,floatingStyles:O}),[d,y,g,x,O])}const qn=(e,t)=>({...jl(e),options:[e,t]}),Ro=(e,t)=>({...Bl(e),options:[e,t]}),So=(e,t)=>({...Hl(e),options:[e,t]}),Vl=(e,t)=>({...Wl(e),options:[e,t]});function Gl(e){const t=D.useRef(void 0),n=D.useCallback(r=>{const o=e.map(i=>{if(i!=null){if(typeof i=="function"){const l=i,s=l(r);return typeof s=="function"?s:()=>{l(null)}}return i.current=r,()=>{i.current=null}}});return()=>{o.forEach(i=>i==null?void 0:i())}},e);return D.useMemo(()=>e.every(r=>r==null)?null:r=>{t.current&&(t.current(),t.current=void 0),r!=null&&(t.current=n(r))},e)}const Co={...D},Yl=Co.useInsertionEffect,ql=Yl||(e=>e());function De(e){const t=D.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return ql(()=>{t.current=e}),D.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t.current==null?void 0:t.current(...r)},[])}var me=typeof document<"u"?R.useLayoutEffect:R.useEffect;let br=!1,_l=0;const yr=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+_l++;function zl(){const[e,t]=D.useState(()=>br?yr():void 0);return me(()=>{e==null&&t(yr())},[]),D.useEffect(()=>{br=!0},[]),e}const Xl=Co.useId,it=Xl||zl;let Pn;process.env.NODE_ENV!=="production"&&(Pn=new Set);function Kl(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const o="Floating UI: "+n.join(" ");if(!((e=Pn)!=null&&e.has(o))){var i;(i=Pn)==null||i.add(o),console.error(o)}}function Jl(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(o=>o(n))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){var r;e.set(t,((r=e.get(t))==null?void 0:r.filter(o=>o!==n))||[])}}}const Ql=D.createContext(null),Zl=D.createContext(null),To=()=>{var e;return((e=D.useContext(Ql))==null?void 0:e.id)||null},_n=()=>D.useContext(Zl);function xt(e){return"data-floating-ui-"+e}function pn(e){const t=R.useRef(e);return me(()=>{t.current=e}),t}let xr=0;function tt(e,t){t===void 0&&(t={});const{preventScroll:n=!1,cancelPrevious:r=!0,sync:o=!1}=t;r&&cancelAnimationFrame(xr);const i=()=>e==null?void 0:e.focus({preventScroll:n});o?i():xr=requestAnimationFrame(i)}function wr(e,t){var n;let r=[],o=(n=e.find(i=>i.id===t))==null?void 0:n.parentId;for(;o;){const i=e.find(l=>l.id===o);o=i==null?void 0:i.parentId,i&&(r=r.concat(i))}return r}function mt(e,t){let n=e.filter(o=>{var i;return o.parentId===t&&((i=o.context)==null?void 0:i.open)}),r=n;for(;r.length;)r=e.filter(o=>{var i;return(i=r)==null?void 0:i.some(l=>{var s;return o.parentId===l.id&&((s=o.context)==null?void 0:s.open)})}),n=n.concat(r);return n}let nt=new WeakMap,Nt=new WeakSet,Dt={},mn=0;const es=()=>typeof HTMLElement<"u"&&"inert"in HTMLElement.prototype,Ao=e=>e&&(e.host||Ao(e.parentNode)),ts=(e,t)=>t.map(n=>{if(e.contains(n))return n;const r=Ao(n);return e.contains(r)?r:null}).filter(n=>n!=null);function ns(e,t,n,r){const o="data-floating-ui-inert",i=r?"inert":n?"aria-hidden":null,l=ts(t,e),s=new Set,a=new Set(l),f=[];Dt[o]||(Dt[o]=new WeakMap);const d=Dt[o];l.forEach(h),A(t),s.clear();function h(m){!m||s.has(m)||(s.add(m),m.parentNode&&h(m.parentNode))}function A(m){!m||a.has(m)||[].forEach.call(m.children,v=>{if(We(v)!=="script")if(s.has(v))A(v);else{const T=i?v.getAttribute(i):null,k=T!==null&&T!=="false",N=nt.get(v)||0,C=i?N+1:N,M=(d.get(v)||0)+1;nt.set(v,C),d.set(v,M),f.push(v),C===1&&k&&Nt.add(v),M===1&&v.setAttribute(o,""),!k&&i&&v.setAttribute(i,"true")}})}return mn++,()=>{f.forEach(m=>{const v=nt.get(m)||0,T=i?v-1:v,k=(d.get(m)||0)-1;nt.set(m,T),d.set(m,k),T||(!Nt.has(m)&&i&&m.removeAttribute(i),Nt.delete(m)),k||m.removeAttribute(o)}),mn--,mn||(nt=new WeakMap,nt=new WeakMap,Nt=new WeakSet,Dt={})}}function Er(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=Ee(e[0]).body;return ns(e.concat(Array.from(r.querySelectorAll("[aria-live]"))),r,t,n)}const tn=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function Oo(e,t){const n=Zt(e,tn());t==="prev"&&n.reverse();const r=n.indexOf(Ge(Ee(e)));return n.slice(r+1)[0]}function Fo(){return Oo(document.body,"next")}function Po(){return Oo(document.body,"prev")}function gt(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!pe(n,r)}function rs(e){Zt(e,tn()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function Rr(e){e.querySelectorAll("[data-tabindex]").forEach(n=>{const r=n.dataset.tabindex;delete n.dataset.tabindex,r?n.setAttribute("tabindex",r):n.removeAttribute("tabindex")})}const nn={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0},Yt=D.forwardRef(function(t,n){const[r,o]=D.useState();me(()=>{ji()&&o("button")},[]);const i={ref:n,tabIndex:0,role:r,"aria-hidden":r?void 0:!0,[xt("focus-guard")]:"",style:nn};return L.jsx("span",{...t,...i})}),ko=D.createContext(null),Sr=xt("portal");function os(e){e===void 0&&(e={});const{id:t,root:n}=e,r=it(),o=Do(),[i,l]=D.useState(null),s=D.useRef(null);return me(()=>()=>{i==null||i.remove(),queueMicrotask(()=>{s.current=null})},[i]),me(()=>{if(!r||s.current)return;const a=t?document.getElementById(t):null;if(!a)return;const f=document.createElement("div");f.id=r,f.setAttribute(Sr,""),a.appendChild(f),s.current=f,l(f)},[t,r]),me(()=>{if(n===null||!r||s.current)return;let a=n||(o==null?void 0:o.portalNode);a&&!re(a)&&(a=a.current),a=a||document.body;let f=null;t&&(f=document.createElement("div"),f.id=t,a.appendChild(f));const d=document.createElement("div");d.id=r,d.setAttribute(Sr,""),a=f||a,a.appendChild(d),s.current=d,l(d)},[t,n,r,o]),i}function No(e){const{children:t,id:n,root:r,preserveTabOrder:o=!0}=e,i=os({id:n,root:r}),[l,s]=D.useState(null),a=D.useRef(null),f=D.useRef(null),d=D.useRef(null),h=D.useRef(null),A=l==null?void 0:l.modal,m=l==null?void 0:l.open,v=!!l&&!l.modal&&l.open&&o&&!!(r||i);return D.useEffect(()=>{if(!i||!o||A)return;function T(k){i&>(k)&&(k.type==="focusin"?Rr:rs)(i)}return i.addEventListener("focusin",T,!0),i.addEventListener("focusout",T,!0),()=>{i.removeEventListener("focusin",T,!0),i.removeEventListener("focusout",T,!0)}},[i,o,A]),D.useEffect(()=>{i&&(m||Rr(i))},[m,i]),L.jsxs(ko.Provider,{value:D.useMemo(()=>({preserveTabOrder:o,beforeOutsideRef:a,afterOutsideRef:f,beforeInsideRef:d,afterInsideRef:h,portalNode:i,setFocusManagerState:s}),[o,i]),children:[v&&i&&L.jsx(Yt,{"data-type":"outside",ref:a,onFocus:T=>{if(gt(T,i)){var k;(k=d.current)==null||k.focus()}else{const N=Po()||(l==null?void 0:l.domReference);N==null||N.focus()}}}),v&&i&&L.jsx("span",{"aria-owns":i.id,style:nn}),i&&bt.createPortal(t,i),v&&i&&L.jsx(Yt,{"data-type":"outside",ref:f,onFocus:T=>{if(gt(T,i)){var k;(k=h.current)==null||k.focus()}else{const N=Fo()||(l==null?void 0:l.domReference);N==null||N.focus(),l!=null&&l.closeOnFocusOut&&(l==null||l.onOpenChange(!1,T.nativeEvent,"focus-out"))}}})]})}const Do=()=>D.useContext(ko),kn="data-floating-ui-focusable";function Cr(e){return e?e.hasAttribute(kn)?e:e.querySelector("["+kn+"]")||e:null}function Tr(e){return D.useMemo(()=>t=>{e.forEach(n=>{n&&(n.current=t)})},e)}const is=20;let Ye=[];function ls(e){Ye=Ye.filter(t=>t.isConnected),e&&We(e)!=="body"&&(Ye.push(e),Ye.length>is&&(Ye=Ye.slice(-20)))}function Ar(){return Ye.slice().reverse().find(e=>e.isConnected)}function ss(e){const t=tn();return hl(e,t)?e:Zt(e,t)[0]||e}const as=D.forwardRef(function(t,n){return L.jsx("button",{...t,type:"button",ref:n,tabIndex:-1,style:nn})});function Io(e){const{context:t,children:n,disabled:r=!1,order:o=["content"],guards:i=!0,initialFocus:l=0,returnFocus:s=!0,restoreFocus:a=!1,modal:f=!0,visuallyHiddenDismiss:d=!1,closeOnFocusOut:h=!0,outsideElementsInert:A=!1}=e,{open:m,onOpenChange:v,events:T,dataRef:k,elements:{domReference:N,floating:C}}=t,M=De(()=>{var _;return(_=k.current.floatingContext)==null?void 0:_.nodeId}),B=typeof l=="number"&&l<0,j=Vi(N)&&B,W=es(),G=W?i:!0,u=!G||W&&A,c=pn(o),p=pn(l),b=pn(s),w=_n(),y=Do(),F=D.useRef(null),g=D.useRef(null),x=D.useRef(!1),O=D.useRef(!1),S=D.useRef(-1),P=y!=null,E=Cr(C),I=De(function(_){return _===void 0&&(_=E),_?Zt(_,tn()):[]}),H=De(_=>{const Q=I(_);return c.current.map(Y=>N&&Y==="reference"?N:E&&Y==="floating"?E:Q).filter(Boolean).flat()});D.useEffect(()=>{if(r||!f)return;function _(Y){if(Y.key==="Tab"){pe(E,Ge(Ee(E)))&&I().length===0&&!j&&un(Y);const U=H(),z=_e(Y);c.current[0]==="reference"&&z===N&&(un(Y),Y.shiftKey?tt(U[U.length-1]):tt(U[1])),c.current[1]==="floating"&&z===E&&Y.shiftKey&&(un(Y),tt(U[0]))}}const Q=Ee(E);return Q.addEventListener("keydown",_),()=>{Q.removeEventListener("keydown",_)}},[r,N,E,f,c,j,I,H]),D.useEffect(()=>{if(r||!C)return;function _(Q){const Y=_e(Q),z=I().indexOf(Y);z!==-1&&(S.current=z)}return C.addEventListener("focusin",_),()=>{C.removeEventListener("focusin",_)}},[r,C,I]),D.useEffect(()=>{if(r||!h)return;function _(){O.current=!0,setTimeout(()=>{O.current=!1})}function Q(Y){const U=Y.relatedTarget;queueMicrotask(()=>{const z=M(),K=!(pe(N,U)||pe(C,U)||pe(U,C)||pe(y==null?void 0:y.portalNode,U)||U!=null&&U.hasAttribute(xt("focus-guard"))||w&&(mt(w.nodesRef.current,z).find(Z=>{var ue,Ce;return pe((ue=Z.context)==null?void 0:ue.elements.floating,U)||pe((Ce=Z.context)==null?void 0:Ce.elements.domReference,U)})||wr(w.nodesRef.current,z).find(Z=>{var ue,Ce,ke;return[(ue=Z.context)==null?void 0:ue.elements.floating,Cr((Ce=Z.context)==null?void 0:Ce.elements.floating)].includes(U)||((ke=Z.context)==null?void 0:ke.elements.domReference)===U})));if(a&&K&&Ge(Ee(E))===Ee(E).body){se(E)&&E.focus();const Z=S.current,ue=I(),Ce=ue[Z]||ue[ue.length-1]||E;se(Ce)&&Ce.focus()}(j||!f)&&U&&K&&!O.current&&U!==Ar()&&(x.current=!0,v(!1,Y,"focus-out"))})}if(C&&se(N))return N.addEventListener("focusout",Q),N.addEventListener("pointerdown",_),C.addEventListener("focusout",Q),()=>{N.removeEventListener("focusout",Q),N.removeEventListener("pointerdown",_),C.removeEventListener("focusout",Q)}},[r,N,C,E,f,w,y,v,h,a,I,j,M]);const $=D.useRef(null),X=D.useRef(null),V=Tr([$,y==null?void 0:y.beforeInsideRef]),q=Tr([X,y==null?void 0:y.afterInsideRef]);D.useEffect(()=>{var _;if(r||!C)return;const Q=Array.from((y==null||(_=y.portalNode)==null?void 0:_.querySelectorAll("["+xt("portal")+"]"))||[]),Y=w&&!f?wr(w==null?void 0:w.nodesRef.current,M()).map(K=>{var Z;return(Z=K.context)==null?void 0:Z.elements.floating}):[],U=[C,...Q,...Y,F.current,g.current,$.current,X.current,y==null?void 0:y.beforeOutsideRef.current,y==null?void 0:y.afterOutsideRef.current,c.current.includes("reference")||j?N:null].filter(K=>K!=null),z=f||j?Er(U,!u,u):Er(U);return()=>{z()}},[r,N,C,f,c,y,j,G,u,w,M]),me(()=>{if(r||!se(E))return;const _=Ee(E),Q=Ge(_);queueMicrotask(()=>{const Y=H(E),U=p.current,z=(typeof U=="number"?Y[U]:U.current)||E,K=pe(E,Q);!B&&!K&&m&&tt(z,{preventScroll:z===E})})},[r,m,E,B,H,p]),me(()=>{if(r||!E)return;let _=!1,Q=!1;const Y=Ee(E),U=Ge(Y);let K=k.current.openEvent;ls(U);function Z(ke){let{open:Ot,reason:ct,event:Te,nested:Ft}=ke;if(Ot&&(K=Te),ct==="escape-key"&&(Q=!0),["hover","safe-polygon"].includes(ct)&&Te.type==="mouseleave"&&(x.current=!0),ct==="outside-press")if(Ft)x.current=!1,_=!0;else if(Li(Te)||$i(Te))x.current=!1;else{let lr=!1;document.createElement("div").focus({get preventScroll(){return lr=!0,!1}}),lr?(x.current=!1,_=!0):x.current=!0}}T.on("openchange",Z);const ue=Y.createElement("span");ue.setAttribute("tabindex","-1"),ue.setAttribute("aria-hidden","true"),Object.assign(ue.style,nn),P&&N&&N.insertAdjacentElement("afterend",ue);function Ce(){return typeof b.current=="boolean"?Q&&N?N:Ar()||ue:b.current.current||ue}return()=>{T.off("openchange",Z);const ke=Ge(Y),Ot=pe(C,ke)||w&&mt(w.nodesRef.current,M()).some(Te=>{var Ft;return pe((Ft=Te.context)==null?void 0:Ft.elements.floating,ke)});(Ot||K&&["click","mousedown"].includes(K.type))&&(Q=!0);const ct=Ce();queueMicrotask(()=>{const Te=ss(ct);b.current&&!x.current&&se(Te)&&(!(Te!==ke&&ke!==Y.body)||Ot)&&Te.focus({preventScroll:_}),ue.remove()})}},[r,C,E,b,k,T,w,P,N,M]),D.useEffect(()=>{queueMicrotask(()=>{x.current=!1})},[r]),me(()=>{if(!r&&y)return y.setFocusManagerState({modal:f,closeOnFocusOut:h,open:m,onOpenChange:v,domReference:N}),()=>{y.setFocusManagerState(null)}},[r,y,f,m,v,h,N]),me(()=>{if(r||!E||typeof MutationObserver!="function"||B)return;const _=()=>{const Y=E.getAttribute("tabindex"),U=I(),z=Ge(Ee(C)),K=U.indexOf(z);K!==-1&&(S.current=K),c.current.includes("floating")||z!==N&&U.length===0?Y!=="0"&&E.setAttribute("tabindex","0"):Y!=="-1"&&E.setAttribute("tabindex","-1")};_();const Q=new MutationObserver(_);return Q.observe(E,{childList:!0,subtree:!0,attributes:!0}),()=>{Q.disconnect()}},[r,C,E,N,c,I,B]);function ee(_){return r||!d||!f?null:L.jsx(as,{ref:_==="start"?F:g,onClick:Q=>v(!1,Q.nativeEvent),children:typeof d=="string"?d:"Dismiss"})}const te=!r&&G&&(f?!j:!0)&&(P||f);return L.jsxs(L.Fragment,{children:[te&&L.jsx(Yt,{"data-type":"inside",ref:V,onFocus:_=>{if(f){const Y=H();tt(o[0]==="reference"?Y[0]:Y[Y.length-1])}else if(y!=null&&y.preserveTabOrder&&y.portalNode)if(x.current=!1,gt(_,y.portalNode)){const Y=Fo()||N;Y==null||Y.focus()}else{var Q;(Q=y.beforeOutsideRef.current)==null||Q.focus()}}}),!j&&ee("start"),n,ee("end"),te&&L.jsx(Yt,{"data-type":"inside",ref:q,onFocus:_=>{if(f)tt(H()[0]);else if(y!=null&&y.preserveTabOrder&&y.portalNode)if(h&&(x.current=!0),gt(_,y.portalNode)){const Y=Po()||N;Y==null||Y.focus()}else{var Q;(Q=y.afterOutsideRef.current)==null||Q.focus()}}})]})}let It=0;function us(){const e=/iP(hone|ad|od)|iOS/.test(ro()),t=document.body.style,r=Math.round(document.documentElement.getBoundingClientRect().left)+document.documentElement.scrollLeft?"paddingLeft":"paddingRight",o=window.innerWidth-document.documentElement.clientWidth,i=t.left?parseFloat(t.left):window.scrollX,l=t.top?parseFloat(t.top):window.scrollY;if(t.overflow="hidden",o&&(t[r]=o+"px"),e){var s,a;const f=((s=window.visualViewport)==null?void 0:s.offsetLeft)||0,d=((a=window.visualViewport)==null?void 0:a.offsetTop)||0;Object.assign(t,{position:"fixed",top:-(l-Math.floor(d))+"px",left:-(i-Math.floor(f))+"px",right:"0"})}return()=>{Object.assign(t,{overflow:"",[r]:""}),e&&(Object.assign(t,{position:"",top:"",left:"",right:""}),window.scrollTo(i,l))}}let Or=()=>{};const cs=D.forwardRef(function(t,n){const{lockScroll:r=!1,...o}=t;return me(()=>{if(r)return It++,It===1&&(Or=us()),()=>{It--,It===0&&Or()}},[r]),L.jsx("div",{ref:n,...o,style:{position:"fixed",overflow:"auto",top:0,right:0,bottom:0,left:0,...o.style}})});function Fr(e){return se(e.target)&&e.target.tagName==="BUTTON"}function Pr(e){return io(e)}function Mo(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,dataRef:o,elements:{domReference:i}}=e,{enabled:l=!0,event:s="click",toggle:a=!0,ignoreMouse:f=!1,keyboardHandlers:d=!0,stickIfOpen:h=!0}=t,A=D.useRef(),m=D.useRef(!1),v=D.useMemo(()=>({onPointerDown(T){A.current=T.pointerType},onMouseDown(T){const k=A.current;T.button===0&&s!=="click"&&(fr(k)&&f||(n&&a&&(!(o.current.openEvent&&h)||o.current.openEvent.type==="mousedown")?r(!1,T.nativeEvent,"click"):(T.preventDefault(),r(!0,T.nativeEvent,"click"))))},onClick(T){const k=A.current;if(s==="mousedown"&&A.current){A.current=void 0;return}fr(k)&&f||(n&&a&&(!(o.current.openEvent&&h)||o.current.openEvent.type==="click")?r(!1,T.nativeEvent,"click"):r(!0,T.nativeEvent,"click"))},onKeyDown(T){A.current=void 0,!(T.defaultPrevented||!d||Fr(T))&&(T.key===" "&&!Pr(i)&&(T.preventDefault(),m.current=!0),T.key==="Enter"&&r(!(n&&a),T.nativeEvent,"click"))},onKeyUp(T){T.defaultPrevented||!d||Fr(T)||Pr(i)||T.key===" "&&m.current&&(m.current=!1,r(!(n&&a),T.nativeEvent,"click"))}}),[o,i,s,f,d,r,n,h,a]);return D.useMemo(()=>l?{reference:v}:{},[l,v])}const fs={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},ds={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},kr=e=>{var t,n;return{escapeKey:typeof e=="boolean"?e:(t=e==null?void 0:e.escapeKey)!=null?t:!1,outsidePress:typeof e=="boolean"?e:(n=e==null?void 0:e.outsidePress)!=null?n:!0}};function Lo(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,elements:o,dataRef:i}=e,{enabled:l=!0,escapeKey:s=!0,outsidePress:a=!0,outsidePressEvent:f="pointerdown",referencePress:d=!1,referencePressEvent:h="pointerdown",ancestorScroll:A=!1,bubbles:m,capture:v}=t,T=_n(),k=De(typeof a=="function"?a:()=>!1),N=typeof a=="function"?k:a,C=D.useRef(!1),M=D.useRef(!1),{escapeKey:B,outsidePress:j}=kr(m),{escapeKey:W,outsidePress:G}=kr(v),u=D.useRef(!1),c=De(g=>{var x;if(!n||!l||!s||g.key!=="Escape"||u.current)return;const O=(x=i.current.floatingContext)==null?void 0:x.nodeId,S=T?mt(T.nodesRef.current,O):[];if(!B&&(g.stopPropagation(),S.length>0)){let P=!0;if(S.forEach(E=>{var I;if((I=E.context)!=null&&I.open&&!E.context.dataRef.current.__escapeKeyBubbles){P=!1;return}}),!P)return}r(!1,Hi(g)?g.nativeEvent:g,"escape-key")}),p=De(g=>{var x;const O=()=>{var S;c(g),(S=_e(g))==null||S.removeEventListener("keydown",O)};(x=_e(g))==null||x.addEventListener("keydown",O)}),b=De(g=>{var x;const O=C.current;C.current=!1;const S=M.current;if(M.current=!1,f==="click"&&S||O||typeof N=="function"&&!N(g))return;const P=_e(g),E="["+xt("inert")+"]",I=Ee(o.floating).querySelectorAll(E);let H=re(P)?P:null;for(;H&&!Ie(H);){const q=Le(H);if(Ie(q)||!re(q))break;H=q}if(I.length&&re(P)&&!Wi(P)&&!pe(P,o.floating)&&Array.from(I).every(q=>!pe(H,q)))return;if(se(P)&&F){const q=Ie(P),ee=xe(P),te=/auto|scroll/,_=q||te.test(ee.overflowX),Q=q||te.test(ee.overflowY),Y=_&&P.clientWidth>0&&P.scrollWidth>P.clientWidth,U=Q&&P.clientHeight>0&&P.scrollHeight>P.clientHeight,z=ee.direction==="rtl",K=U&&(z?g.offsetX<=P.offsetWidth-P.clientWidth:g.offsetX>P.clientWidth),Z=Y&&g.offsetY>P.clientHeight;if(K||Z)return}const $=(x=i.current.floatingContext)==null?void 0:x.nodeId,X=T&&mt(T.nodesRef.current,$).some(q=>{var ee;return an(g,(ee=q.context)==null?void 0:ee.elements.floating)});if(an(g,o.floating)||an(g,o.domReference)||X)return;const V=T?mt(T.nodesRef.current,$):[];if(V.length>0){let q=!0;if(V.forEach(ee=>{var te;if((te=ee.context)!=null&&te.open&&!ee.context.dataRef.current.__outsidePressBubbles){q=!1;return}}),!q)return}r(!1,g,"outside-press")}),w=De(g=>{var x;const O=()=>{var S;b(g),(S=_e(g))==null||S.removeEventListener(f,O)};(x=_e(g))==null||x.addEventListener(f,O)});D.useEffect(()=>{if(!n||!l)return;i.current.__escapeKeyBubbles=B,i.current.__outsidePressBubbles=j;let g=-1;function x(I){r(!1,I,"ancestor-scroll")}function O(){window.clearTimeout(g),u.current=!0}function S(){g=window.setTimeout(()=>{u.current=!1},Jt()?5:0)}const P=Ee(o.floating);s&&(P.addEventListener("keydown",W?p:c,W),P.addEventListener("compositionstart",O),P.addEventListener("compositionend",S)),N&&P.addEventListener(f,G?w:b,G);let E=[];return A&&(re(o.domReference)&&(E=Be(o.domReference)),re(o.floating)&&(E=E.concat(Be(o.floating))),!re(o.reference)&&o.reference&&o.reference.contextElement&&(E=E.concat(Be(o.reference.contextElement)))),E=E.filter(I=>{var H;return I!==((H=P.defaultView)==null?void 0:H.visualViewport)}),E.forEach(I=>{I.addEventListener("scroll",x,{passive:!0})}),()=>{s&&(P.removeEventListener("keydown",W?p:c,W),P.removeEventListener("compositionstart",O),P.removeEventListener("compositionend",S)),N&&P.removeEventListener(f,G?w:b,G),E.forEach(I=>{I.removeEventListener("scroll",x)}),window.clearTimeout(g)}},[i,o,s,N,f,n,r,A,l,B,j,c,W,p,b,G,w]),D.useEffect(()=>{C.current=!1},[N,f]);const y=D.useMemo(()=>({onKeyDown:c,...d&&{[fs[h]]:g=>{r(!1,g.nativeEvent,"reference-press")},...h!=="click"&&{onClick(g){r(!1,g.nativeEvent,"reference-press")}}}}),[c,r,d,h]),F=D.useMemo(()=>({onKeyDown:c,onMouseDown(){M.current=!0},onMouseUp(){M.current=!0},[ds[f]]:()=>{C.current=!0}}),[c,f]);return D.useMemo(()=>l?{reference:y,floating:F}:{},[l,y,F])}function ps(e){const{open:t=!1,onOpenChange:n,elements:r}=e,o=it(),i=D.useRef({}),[l]=D.useState(()=>Jl()),s=To()!=null;if(process.env.NODE_ENV!=="production"){const m=r.reference;m&&!re(m)&&Kl("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[a,f]=D.useState(r.reference),d=De((m,v,T)=>{i.current.openEvent=m?v:void 0,l.emit("openchange",{open:m,event:v,reason:T,nested:s}),n==null||n(m,v,T)}),h=D.useMemo(()=>({setPositionReference:f}),[]),A=D.useMemo(()=>({reference:a||r.reference||null,floating:r.floating||null,domReference:r.reference}),[a,r.reference,r.floating]);return D.useMemo(()=>({dataRef:i,open:t,onOpenChange:d,elements:A,events:l,floatingId:o,refs:h}),[t,d,A,l,o,h])}function $o(e){e===void 0&&(e={});const{nodeId:t}=e,n=ps({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,o=r.elements,[i,l]=D.useState(null),[s,a]=D.useState(null),d=(o==null?void 0:o.domReference)||i,h=D.useRef(null),A=_n();me(()=>{d&&(h.current=d)},[d]);const m=Eo({...e,elements:{...o,...s&&{reference:s}}}),v=D.useCallback(M=>{const B=re(M)?{getBoundingClientRect:()=>M.getBoundingClientRect(),contextElement:M}:M;a(B),m.refs.setReference(B)},[m.refs]),T=D.useCallback(M=>{(re(M)||M===null)&&(h.current=M,l(M)),(re(m.refs.reference.current)||m.refs.reference.current===null||M!==null&&!re(M))&&m.refs.setReference(M)},[m.refs]),k=D.useMemo(()=>({...m.refs,setReference:T,setPositionReference:v,domReference:h}),[m.refs,T,v]),N=D.useMemo(()=>({...m.elements,domReference:d}),[m.elements,d]),C=D.useMemo(()=>({...m,...r,refs:k,elements:N,nodeId:t}),[m,k,N,t,r]);return me(()=>{r.dataRef.current.floatingContext=C;const M=A==null?void 0:A.nodesRef.current.find(B=>B.id===t);M&&(M.context=C)}),D.useMemo(()=>({...m,context:C,refs:k,elements:N}),[m,k,N,C])}const Nr="active",Dr="selected";function gn(e,t,n){const r=new Map,o=n==="item";let i=e;if(o&&e){const{[Nr]:l,[Dr]:s,...a}=e;i=a}return{...n==="floating"&&{tabIndex:-1,[kn]:""},...i,...t.map(l=>{const s=l?l[n]:null;return typeof s=="function"?e?s(e):null:s}).concat(e).reduce((l,s)=>(s&&Object.entries(s).forEach(a=>{let[f,d]=a;if(!(o&&[Nr,Dr].includes(f)))if(f.indexOf("on")===0){if(r.has(f)||r.set(f,[]),typeof d=="function"){var h;(h=r.get(f))==null||h.push(d),l[f]=function(){for(var A,m=arguments.length,v=new Array(m),T=0;T<m;T++)v[T]=arguments[T];return(A=r.get(f))==null?void 0:A.map(k=>k(...v)).find(k=>k!==void 0)}}}else l[f]=d}),l),{})}}function jo(e){e===void 0&&(e=[]);const t=e.map(s=>s==null?void 0:s.reference),n=e.map(s=>s==null?void 0:s.floating),r=e.map(s=>s==null?void 0:s.item),o=D.useCallback(s=>gn(s,e,"reference"),t),i=D.useCallback(s=>gn(s,e,"floating"),n),l=D.useCallback(s=>gn(s,e,"item"),r);return D.useMemo(()=>({getReferenceProps:o,getFloatingProps:i,getItemProps:l}),[o,i,l])}const ms=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function gs(e,t){var n;t===void 0&&(t={});const{open:r,floatingId:o}=e,{enabled:i=!0,role:l="dialog"}=t,s=(n=ms.get(l))!=null?n:l,a=it(),d=To()!=null,h=D.useMemo(()=>s==="tooltip"||l==="label"?{["aria-"+(l==="label"?"labelledby":"describedby")]:r?o:void 0}:{"aria-expanded":r?"true":"false","aria-haspopup":s==="alertdialog"?"dialog":s,"aria-controls":r?o:void 0,...s==="listbox"&&{role:"combobox"},...s==="menu"&&{id:a},...s==="menu"&&d&&{role:"menuitem"},...l==="select"&&{"aria-autocomplete":"none"},...l==="combobox"&&{"aria-autocomplete":"list"}},[s,o,d,r,a,l]),A=D.useMemo(()=>{const v={id:o,...s&&{role:s}};return s==="tooltip"||l==="label"?v:{...v,...s==="menu"&&{"aria-labelledby":a}}},[s,o,a,l]),m=D.useCallback(v=>{let{active:T,selected:k}=v;const N={role:"option",...T&&{id:o+"-option"}};switch(l){case"select":return{...N,"aria-selected":T&&k};case"combobox":return{...N,...T&&{"aria-selected":!0}}}return{}},[o,l]);return D.useMemo(()=>i?{reference:h,floating:A,item:m}:{},[i,h,A,m])}function Bo({wallets:e,handleWalletClick:t}){return L.jsxs("ul",{className:"space-y-1.5",children:[e.map(n=>L.jsx("li",{children:L.jsxs("button",{onClick:()=>t(n),className:"flex w-full items-center gap-3 py-1.5 px-1.5 text-left text-gray-800 dark:text-[#E9E9FD] transition-colors hover:bg-[#E9E9FD] dark:hover:bg-[#192A39] rounded-xl",children:[L.jsx("div",{className:"flex-shrink-0 h-8 w-8 rounded-md overflow-hidden bg-gray-50 dark:bg-transparent flex items-center justify-center",children:L.jsx("img",{src:n.metadata.icon,alt:`${n.metadata.name} icon`,className:"h-8 w-8 object-contain rounded-md"})}),L.jsx("span",{className:"text-lg font-bold wallet-custom-font",children:n.metadata.name})]})},n.id)),e.length===0&&L.jsx("p",{className:"text-center text-gray-500 dark:text-gray-400",children:"No wallets found."})]})}function Ho({children:e}){const[t,n]=R.useState(!1),[r,o]=R.useState(null),{wallets:i,activeAddress:l}=zt.useWallet(),{refs:s,context:a}=$o({open:t,onOpenChange:W=>{W&&l||(W?(n(!0),o("starting"),requestAnimationFrame(()=>{o("entered")})):(o("exiting"),setTimeout(()=>{n(!1),o(null)},150)))}}),f=Mo(a),d=Lo(a,{outsidePressEvent:"mousedown"}),h=gs(a,{role:"dialog"}),{getReferenceProps:A,getFloatingProps:m}=jo([f,d,h]),v=it(),T=it(),k=async W=>{try{await W.connect(),a.onOpenChange(!1)}catch(G){console.error(`Error connecting to ${W.metadata.name}:`,G),a.onOpenChange(!1)}},N=W=>{l||a.onOpenChange(!0)},C=e||L.jsx(Un,{}),M=Gl([s.setReference,C.ref||null]),B={...A(),ref:M,onClick:N},j=R.cloneElement(C,B);return L.jsxs(L.Fragment,{children:[j,L.jsx(No,{id:"wallet-dialog-portal",children:t&&L.jsx(cs,{className:"grid place-items-center z-50 transition-opacity duration-150 ease-in-out bg-black/30 dark:bg-black/50 data-[state=starting]:opacity-0 data-[state=exiting]:opacity-0 data-[state=entered]:opacity-100","data-state":r,lockScroll:!0,children:L.jsx(Io,{context:a,modal:!0,children:L.jsxs("div",{ref:s.setFloating,...m({"aria-labelledby":v,"aria-describedby":T}),"data-state":r,className:"w-full max-w-sm rounded-3xl bg-white dark:bg-[#001324] shadow-xl transform transition-all duration-150 ease-in-out data-[state=starting]:opacity-0 data-[state=starting]:scale-90 data-[state=exiting]:opacity-0 data-[state=exiting]:scale-90 data-[state=entered]:opacity-100 data-[state=entered]:scale-100",style:{marginTop:"-0.5rem"},children:[L.jsxs("div",{className:"relative flex items-center px-6 pt-5 pb-4",children:[L.jsx("h2",{id:v,className:"text-xl font-bold text-gray-900 dark:text-[#E9E9FD] wallet-custom-font",children:"Connect a Wallet"}),L.jsx("button",{onClick:()=>a.onOpenChange(!1),className:"absolute right-4 rounded-full bg-gray-100 dark:bg-[#192A39]/75 p-2 text-gray-500 dark:text-gray-400 hover:bg-gray-200 dark:hover:bg-[#192A39] hover:text-gray-700 dark:hover:text-[#D4D4FA]","aria-label":"Close dialog",children:L.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor",children:L.jsx("path",{fillRule:"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z",clipRule:"evenodd"})})})]}),L.jsx("div",{className:"px-4 pb-3",children:L.jsx(Bo,{wallets:i,handleWalletClick:k})}),L.jsxs("div",{className:"px-6 py-5 border-t border-gray-200 dark:border-[#192A39] flex items-center justify-between",children:[L.jsx("span",{className:"text-gray-600 dark:text-[#99A1A7] text-sm",children:"Need an Algorand wallet?"}),L.jsx("a",{href:"https://algorand.co/wallets",className:"text-[#2D2DF1]/80 dark:text-[#6C6CF1] font-medium text-sm hover:text-[#2D2DF1] dark:hover:text-[#8080F3]",target:"_blank",rel:"noopener noreferrer",children:"Start here →"})]})]})})})})]})}var hs=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,hn=Math.ceil,ve=Math.floor,fe="[BigNumber Error] ",Ir=fe+"Number primitive has more than 15 significant digits: ",we=1e14,J=14,Mr=9007199254740991,vn=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],je=1e7,de=1e9;function Wo(e){var t,n,r,o=C.prototype={constructor:C,toString:null,valueOf:null},i=new C(1),l=20,s=4,a=-7,f=21,d=-1e7,h=1e7,A=!1,m=1,v=0,T={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},k="0123456789abcdefghijklmnopqrstuvwxyz",N=!0;function C(u,c){var p,b,w,y,F,g,x,O,S=this;if(!(S instanceof C))return new C(u,c);if(c==null){if(u&&u._isBigNumber===!0){S.s=u.s,!u.c||u.e>h?S.c=S.e=null:u.e<d?S.c=[S.e=0]:(S.e=u.e,S.c=u.c.slice());return}if((g=typeof u=="number")&&u*0==0){if(S.s=1/u<0?(u=-u,-1):1,u===~~u){for(y=0,F=u;F>=10;F/=10,y++);y>h?S.c=S.e=null:(S.e=y,S.c=[u]);return}O=String(u)}else{if(!hs.test(O=String(u)))return r(S,O,g);S.s=O.charCodeAt(0)==45?(O=O.slice(1),-1):1}(y=O.indexOf("."))>-1&&(O=O.replace(".","")),(F=O.search(/e/i))>0?(y<0&&(y=F),y+=+O.slice(F+1),O=O.substring(0,F)):y<0&&(y=O.length)}else{if(oe(c,2,k.length,"Base"),c==10&&N)return S=new C(u),W(S,l+S.e+1,s);if(O=String(u),g=typeof u=="number"){if(u*0!=0)return r(S,O,g,c);if(S.s=1/u<0?(O=O.slice(1),-1):1,C.DEBUG&&O.replace(/^0\.0*|\./,"").length>15)throw Error(Ir+u)}else S.s=O.charCodeAt(0)===45?(O=O.slice(1),-1):1;for(p=k.slice(0,c),y=F=0,x=O.length;F<x;F++)if(p.indexOf(b=O.charAt(F))<0){if(b=="."){if(F>y){y=x;continue}}else if(!w&&(O==O.toUpperCase()&&(O=O.toLowerCase())||O==O.toLowerCase()&&(O=O.toUpperCase()))){w=!0,F=-1,y=0;continue}return r(S,String(u),g,c)}g=!1,O=n(O,c,10,S.s),(y=O.indexOf("."))>-1?O=O.replace(".",""):y=O.length}for(F=0;O.charCodeAt(F)===48;F++);for(x=O.length;O.charCodeAt(--x)===48;);if(O=O.slice(F,++x)){if(x-=F,g&&C.DEBUG&&x>15&&(u>Mr||u!==ve(u)))throw Error(Ir+S.s*u);if((y=y-F-1)>h)S.c=S.e=null;else if(y<d)S.c=[S.e=0];else{if(S.e=y,S.c=[],F=(y+1)%J,y<0&&(F+=J),F<x){for(F&&S.c.push(+O.slice(0,F)),x-=J;F<x;)S.c.push(+O.slice(F,F+=J));F=J-(O=O.slice(F)).length}else F-=x;for(;F--;O+="0");S.c.push(+O)}}else S.c=[S.e=0]}C.clone=Wo,C.ROUND_UP=0,C.ROUND_DOWN=1,C.ROUND_CEIL=2,C.ROUND_FLOOR=3,C.ROUND_HALF_UP=4,C.ROUND_HALF_DOWN=5,C.ROUND_HALF_EVEN=6,C.ROUND_HALF_CEIL=7,C.ROUND_HALF_FLOOR=8,C.EUCLID=9,C.config=C.set=function(u){var c,p;if(u!=null)if(typeof u=="object"){if(u.hasOwnProperty(c="DECIMAL_PLACES")&&(p=u[c],oe(p,0,de,c),l=p),u.hasOwnProperty(c="ROUNDING_MODE")&&(p=u[c],oe(p,0,8,c),s=p),u.hasOwnProperty(c="EXPONENTIAL_AT")&&(p=u[c],p&&p.pop?(oe(p[0],-1e9,0,c),oe(p[1],0,de,c),a=p[0],f=p[1]):(oe(p,-1e9,de,c),a=-(f=p<0?-p:p))),u.hasOwnProperty(c="RANGE"))if(p=u[c],p&&p.pop)oe(p[0],-1e9,-1,c),oe(p[1],1,de,c),d=p[0],h=p[1];else if(oe(p,-1e9,de,c),p)d=-(h=p<0?-p:p);else throw Error(fe+c+" cannot be zero: "+p);if(u.hasOwnProperty(c="CRYPTO"))if(p=u[c],p===!!p)if(p)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))A=p;else throw A=!p,Error(fe+"crypto unavailable");else A=p;else throw Error(fe+c+" not true or false: "+p);if(u.hasOwnProperty(c="MODULO_MODE")&&(p=u[c],oe(p,0,9,c),m=p),u.hasOwnProperty(c="POW_PRECISION")&&(p=u[c],oe(p,0,de,c),v=p),u.hasOwnProperty(c="FORMAT"))if(p=u[c],typeof p=="object")T=p;else throw Error(fe+c+" not an object: "+p);if(u.hasOwnProperty(c="ALPHABET"))if(p=u[c],typeof p=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test(p))N=p.slice(0,10)=="0123456789",k=p;else throw Error(fe+c+" invalid: "+p)}else throw Error(fe+"Object expected: "+u);return{DECIMAL_PLACES:l,ROUNDING_MODE:s,EXPONENTIAL_AT:[a,f],RANGE:[d,h],CRYPTO:A,MODULO_MODE:m,POW_PRECISION:v,FORMAT:T,ALPHABET:k}},C.isBigNumber=function(u){if(!u||u._isBigNumber!==!0)return!1;if(!C.DEBUG)return!0;var c,p,b=u.c,w=u.e,y=u.s;e:if({}.toString.call(b)=="[object Array]"){if((y===1||y===-1)&&w>=-1e9&&w<=de&&w===ve(w)){if(b[0]===0){if(w===0&&b.length===1)return!0;break e}if(c=(w+1)%J,c<1&&(c+=J),String(b[0]).length==c){for(c=0;c<b.length;c++)if(p=b[c],p<0||p>=we||p!==ve(p))break e;if(p!==0)return!0}}}else if(b===null&&w===null&&(y===null||y===1||y===-1))return!0;throw Error(fe+"Invalid BigNumber: "+u)},C.maximum=C.max=function(){return B(arguments,-1)},C.minimum=C.min=function(){return B(arguments,1)},C.random=function(){var u=9007199254740992,c=Math.random()*u&2097151?function(){return ve(Math.random()*u)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(p){var b,w,y,F,g,x=0,O=[],S=new C(i);if(p==null?p=l:oe(p,0,de),F=hn(p/J),A)if(crypto.getRandomValues){for(b=crypto.getRandomValues(new Uint32Array(F*=2));x<F;)g=b[x]*131072+(b[x+1]>>>11),g>=9e15?(w=crypto.getRandomValues(new Uint32Array(2)),b[x]=w[0],b[x+1]=w[1]):(O.push(g%1e14),x+=2);x=F/2}else if(crypto.randomBytes){for(b=crypto.randomBytes(F*=7);x<F;)g=(b[x]&31)*281474976710656+b[x+1]*1099511627776+b[x+2]*4294967296+b[x+3]*16777216+(b[x+4]<<16)+(b[x+5]<<8)+b[x+6],g>=9e15?crypto.randomBytes(7).copy(b,x):(O.push(g%1e14),x+=7);x=F/7}else throw A=!1,Error(fe+"crypto unavailable");if(!A)for(;x<F;)g=c(),g<9e15&&(O[x++]=g%1e14);for(F=O[--x],p%=J,F&&p&&(g=vn[J-p],O[x]=ve(F/g)*g);O[x]===0;O.pop(),x--);if(x<0)O=[y=0];else{for(y=-1;O[0]===0;O.splice(0,1),y-=J);for(x=1,g=O[0];g>=10;g/=10,x++);x<J&&(y-=J-x)}return S.e=y,S.c=O,S}}(),C.sum=function(){for(var u=1,c=arguments,p=new C(c[0]);u<c.length;)p=p.plus(c[u++]);return p},n=function(){var u="0123456789";function c(p,b,w,y){for(var F,g=[0],x,O=0,S=p.length;O<S;){for(x=g.length;x--;g[x]*=b);for(g[0]+=y.indexOf(p.charAt(O++)),F=0;F<g.length;F++)g[F]>w-1&&(g[F+1]==null&&(g[F+1]=0),g[F+1]+=g[F]/w|0,g[F]%=w)}return g.reverse()}return function(p,b,w,y,F){var g,x,O,S,P,E,I,H,$=p.indexOf("."),X=l,V=s;for($>=0&&(S=v,v=0,p=p.replace(".",""),H=new C(b),E=H.pow(p.length-$),v=S,H.c=c(Ne(he(E.c),E.e,"0"),10,w,u),H.e=H.c.length),I=c(p,b,w,F?(g=k,u):(g=u,k)),O=S=I.length;I[--S]==0;I.pop());if(!I[0])return g.charAt(0);if($<0?--O:(E.c=I,E.e=O,E.s=y,E=t(E,H,X,V,w),I=E.c,P=E.r,O=E.e),x=O+X+1,$=I[x],S=w/2,P=P||x<0||I[x+1]!=null,P=V<4?($!=null||P)&&(V==0||V==(E.s<0?3:2)):$>S||$==S&&(V==4||P||V==6&&I[x-1]&1||V==(E.s<0?8:7)),x<1||!I[0])p=P?Ne(g.charAt(1),-X,g.charAt(0)):g.charAt(0);else{if(I.length=x,P)for(--w;++I[--x]>w;)I[x]=0,x||(++O,I=[1].concat(I));for(S=I.length;!I[--S];);for($=0,p="";$<=S;p+=g.charAt(I[$++]));p=Ne(p,O,g.charAt(0))}return p}}(),t=function(){function u(b,w,y){var F,g,x,O,S=0,P=b.length,E=w%je,I=w/je|0;for(b=b.slice();P--;)x=b[P]%je,O=b[P]/je|0,F=I*x+O*E,g=E*x+F%je*je+S,S=(g/y|0)+(F/je|0)+I*O,b[P]=g%y;return S&&(b=[S].concat(b)),b}function c(b,w,y,F){var g,x;if(y!=F)x=y>F?1:-1;else for(g=x=0;g<y;g++)if(b[g]!=w[g]){x=b[g]>w[g]?1:-1;break}return x}function p(b,w,y,F){for(var g=0;y--;)b[y]-=g,g=b[y]<w[y]?1:0,b[y]=g*F+b[y]-w[y];for(;!b[0]&&b.length>1;b.splice(0,1));}return function(b,w,y,F,g){var x,O,S,P,E,I,H,$,X,V,q,ee,te,_,Q,Y,U,z=b.s==w.s?1:-1,K=b.c,Z=w.c;if(!K||!K[0]||!Z||!Z[0])return new C(!b.s||!w.s||(K?Z&&K[0]==Z[0]:!Z)?NaN:K&&K[0]==0||!Z?z*0:z/0);for($=new C(z),X=$.c=[],O=b.e-w.e,z=y+O+1,g||(g=we,O=be(b.e/J)-be(w.e/J),z=z/J|0),S=0;Z[S]==(K[S]||0);S++);if(Z[S]>(K[S]||0)&&O--,z<0)X.push(1),P=!0;else{for(_=K.length,Y=Z.length,S=0,z+=2,E=ve(g/(Z[0]+1)),E>1&&(Z=u(Z,E,g),K=u(K,E,g),Y=Z.length,_=K.length),te=Y,V=K.slice(0,Y),q=V.length;q<Y;V[q++]=0);U=Z.slice(),U=[0].concat(U),Q=Z[0],Z[1]>=g/2&&Q++;do{if(E=0,x=c(Z,V,Y,q),x<0){if(ee=V[0],Y!=q&&(ee=ee*g+(V[1]||0)),E=ve(ee/Q),E>1)for(E>=g&&(E=g-1),I=u(Z,E,g),H=I.length,q=V.length;c(I,V,H,q)==1;)E--,p(I,Y<H?U:Z,H,g),H=I.length,x=1;else E==0&&(x=E=1),I=Z.slice(),H=I.length;if(H<q&&(I=[0].concat(I)),p(V,I,q,g),q=V.length,x==-1)for(;c(Z,V,Y,q)<1;)E++,p(V,Y<q?U:Z,q,g),q=V.length}else x===0&&(E++,V=[0]);X[S++]=E,V[0]?V[q++]=K[te]||0:(V=[K[te]],q=1)}while((te++<_||V[0]!=null)&&z--);P=V[0]!=null,X[0]||X.splice(0,1)}if(g==we){for(S=1,z=X[0];z>=10;z/=10,S++);W($,y+($.e=S+O*J-1)+1,F,P)}else $.e=O,$.r=+P;return $}}();function M(u,c,p,b){var w,y,F,g,x;if(p==null?p=s:oe(p,0,8),!u.c)return u.toString();if(w=u.c[0],F=u.e,c==null)x=he(u.c),x=b==1||b==2&&(F<=a||F>=f)?Lt(x,F):Ne(x,F,"0");else if(u=W(new C(u),c,p),y=u.e,x=he(u.c),g=x.length,b==1||b==2&&(c<=y||y<=a)){for(;g<c;x+="0",g++);x=Lt(x,y)}else if(c-=F,x=Ne(x,y,"0"),y+1>g){if(--c>0)for(x+=".";c--;x+="0");}else if(c+=y-g,c>0)for(y+1==g&&(x+=".");c--;x+="0");return u.s<0&&w?"-"+x:x}function B(u,c){for(var p,b,w=1,y=new C(u[0]);w<u.length;w++)b=new C(u[w]),(!b.s||(p=Ve(y,b))===c||p===0&&y.s===c)&&(y=b);return y}function j(u,c,p){for(var b=1,w=c.length;!c[--w];c.pop());for(w=c[0];w>=10;w/=10,b++);return(p=b+p*J-1)>h?u.c=u.e=null:p<d?u.c=[u.e=0]:(u.e=p,u.c=c),u}r=function(){var u=/^(-?)0([xbo])(?=\w[\w.]*$)/i,c=/^([^.]+)\.$/,p=/^\.([^.]+)$/,b=/^-?(Infinity|NaN)$/,w=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(y,F,g,x){var O,S=g?F:F.replace(w,"");if(b.test(S))y.s=isNaN(S)?null:S<0?-1:1;else{if(!g&&(S=S.replace(u,function(P,E,I){return O=(I=I.toLowerCase())=="x"?16:I=="b"?2:8,!x||x==O?E:P}),x&&(O=x,S=S.replace(c,"$1").replace(p,"0.$1")),F!=S))return new C(S,O);if(C.DEBUG)throw Error(fe+"Not a"+(x?" base "+x:"")+" number: "+F);y.s=null}y.c=y.e=null}}();function W(u,c,p,b){var w,y,F,g,x,O,S,P=u.c,E=vn;if(P){e:{for(w=1,g=P[0];g>=10;g/=10,w++);if(y=c-w,y<0)y+=J,F=c,x=P[O=0],S=ve(x/E[w-F-1]%10);else if(O=hn((y+1)/J),O>=P.length)if(b){for(;P.length<=O;P.push(0));x=S=0,w=1,y%=J,F=y-J+1}else break e;else{for(x=g=P[O],w=1;g>=10;g/=10,w++);y%=J,F=y-J+w,S=F<0?0:ve(x/E[w-F-1]%10)}if(b=b||c<0||P[O+1]!=null||(F<0?x:x%E[w-F-1]),b=p<4?(S||b)&&(p==0||p==(u.s<0?3:2)):S>5||S==5&&(p==4||b||p==6&&(y>0?F>0?x/E[w-F]:0:P[O-1])%10&1||p==(u.s<0?8:7)),c<1||!P[0])return P.length=0,b?(c-=u.e+1,P[0]=E[(J-c%J)%J],u.e=-c||0):P[0]=u.e=0,u;if(y==0?(P.length=O,g=1,O--):(P.length=O+1,g=E[J-y],P[O]=F>0?ve(x/E[w-F]%E[F])*g:0),b)for(;;)if(O==0){for(y=1,F=P[0];F>=10;F/=10,y++);for(F=P[0]+=g,g=1;F>=10;F/=10,g++);y!=g&&(u.e++,P[0]==we&&(P[0]=1));break}else{if(P[O]+=g,P[O]!=we)break;P[O--]=0,g=1}for(y=P.length;P[--y]===0;P.pop());}u.e>h?u.c=u.e=null:u.e<d&&(u.c=[u.e=0])}return u}function G(u){var c,p=u.e;return p===null?u.toString():(c=he(u.c),c=p<=a||p>=f?Lt(c,p):Ne(c,p,"0"),u.s<0?"-"+c:c)}return o.absoluteValue=o.abs=function(){var u=new C(this);return u.s<0&&(u.s=1),u},o.comparedTo=function(u,c){return Ve(this,new C(u,c))},o.decimalPlaces=o.dp=function(u,c){var p,b,w,y=this;if(u!=null)return oe(u,0,de),c==null?c=s:oe(c,0,8),W(new C(y),u+y.e+1,c);if(!(p=y.c))return null;if(b=((w=p.length-1)-be(this.e/J))*J,w=p[w])for(;w%10==0;w/=10,b--);return b<0&&(b=0),b},o.dividedBy=o.div=function(u,c){return t(this,new C(u,c),l,s)},o.dividedToIntegerBy=o.idiv=function(u,c){return t(this,new C(u,c),0,1)},o.exponentiatedBy=o.pow=function(u,c){var p,b,w,y,F,g,x,O,S,P=this;if(u=new C(u),u.c&&!u.isInteger())throw Error(fe+"Exponent not an integer: "+G(u));if(c!=null&&(c=new C(c)),g=u.e>14,!P.c||!P.c[0]||P.c[0]==1&&!P.e&&P.c.length==1||!u.c||!u.c[0])return S=new C(Math.pow(+G(P),g?u.s*(2-Mt(u)):+G(u))),c?S.mod(c):S;if(x=u.s<0,c){if(c.c?!c.c[0]:!c.s)return new C(NaN);b=!x&&P.isInteger()&&c.isInteger(),b&&(P=P.mod(c))}else{if(u.e>9&&(P.e>0||P.e<-1||(P.e==0?P.c[0]>1||g&&P.c[1]>=24e7:P.c[0]<8e13||g&&P.c[0]<=9999975e7)))return y=P.s<0&&Mt(u)?-0:0,P.e>-1&&(y=1/y),new C(x?1/y:y);v&&(y=hn(v/J+2))}for(g?(p=new C(.5),x&&(u.s=1),O=Mt(u)):(w=Math.abs(+G(u)),O=w%2),S=new C(i);;){if(O){if(S=S.times(P),!S.c)break;y?S.c.length>y&&(S.c.length=y):b&&(S=S.mod(c))}if(w){if(w=ve(w/2),w===0)break;O=w%2}else if(u=u.times(p),W(u,u.e+1,1),u.e>14)O=Mt(u);else{if(w=+G(u),w===0)break;O=w%2}P=P.times(P),y?P.c&&P.c.length>y&&(P.c.length=y):b&&(P=P.mod(c))}return b?S:(x&&(S=i.div(S)),c?S.mod(c):y?W(S,v,s,F):S)},o.integerValue=function(u){var c=new C(this);return u==null?u=s:oe(u,0,8),W(c,c.e+1,u)},o.isEqualTo=o.eq=function(u,c){return Ve(this,new C(u,c))===0},o.isFinite=function(){return!!this.c},o.isGreaterThan=o.gt=function(u,c){return Ve(this,new C(u,c))>0},o.isGreaterThanOrEqualTo=o.gte=function(u,c){return(c=Ve(this,new C(u,c)))===1||c===0},o.isInteger=function(){return!!this.c&&be(this.e/J)>this.c.length-2},o.isLessThan=o.lt=function(u,c){return Ve(this,new C(u,c))<0},o.isLessThanOrEqualTo=o.lte=function(u,c){return(c=Ve(this,new C(u,c)))===-1||c===0},o.isNaN=function(){return!this.s},o.isNegative=function(){return this.s<0},o.isPositive=function(){return this.s>0},o.isZero=function(){return!!this.c&&this.c[0]==0},o.minus=function(u,c){var p,b,w,y,F=this,g=F.s;if(u=new C(u,c),c=u.s,!g||!c)return new C(NaN);if(g!=c)return u.s=-c,F.plus(u);var x=F.e/J,O=u.e/J,S=F.c,P=u.c;if(!x||!O){if(!S||!P)return S?(u.s=-c,u):new C(P?F:NaN);if(!S[0]||!P[0])return P[0]?(u.s=-c,u):new C(S[0]?F:s==3?-0:0)}if(x=be(x),O=be(O),S=S.slice(),g=x-O){for((y=g<0)?(g=-g,w=S):(O=x,w=P),w.reverse(),c=g;c--;w.push(0));w.reverse()}else for(b=(y=(g=S.length)<(c=P.length))?g:c,g=c=0;c<b;c++)if(S[c]!=P[c]){y=S[c]<P[c];break}if(y&&(w=S,S=P,P=w,u.s=-u.s),c=(b=P.length)-(p=S.length),c>0)for(;c--;S[p++]=0);for(c=we-1;b>g;){if(S[--b]<P[b]){for(p=b;p&&!S[--p];S[p]=c);--S[p],S[b]+=we}S[b]-=P[b]}for(;S[0]==0;S.splice(0,1),--O);return S[0]?j(u,S,O):(u.s=s==3?-1:1,u.c=[u.e=0],u)},o.modulo=o.mod=function(u,c){var p,b,w=this;return u=new C(u,c),!w.c||!u.s||u.c&&!u.c[0]?new C(NaN):!u.c||w.c&&!w.c[0]?new C(w):(m==9?(b=u.s,u.s=1,p=t(w,u,0,3),u.s=b,p.s*=b):p=t(w,u,0,m),u=w.minus(p.times(u)),!u.c[0]&&m==1&&(u.s=w.s),u)},o.multipliedBy=o.times=function(u,c){var p,b,w,y,F,g,x,O,S,P,E,I,H,$,X,V=this,q=V.c,ee=(u=new C(u,c)).c;if(!q||!ee||!q[0]||!ee[0])return!V.s||!u.s||q&&!q[0]&&!ee||ee&&!ee[0]&&!q?u.c=u.e=u.s=null:(u.s*=V.s,!q||!ee?u.c=u.e=null:(u.c=[0],u.e=0)),u;for(b=be(V.e/J)+be(u.e/J),u.s*=V.s,x=q.length,P=ee.length,x<P&&(H=q,q=ee,ee=H,w=x,x=P,P=w),w=x+P,H=[];w--;H.push(0));for($=we,X=je,w=P;--w>=0;){for(p=0,E=ee[w]%X,I=ee[w]/X|0,F=x,y=w+F;y>w;)O=q[--F]%X,S=q[F]/X|0,g=I*O+S*E,O=E*O+g%X*X+H[y]+p,p=(O/$|0)+(g/X|0)+I*S,H[y--]=O%$;H[y]=p}return p?++b:H.splice(0,1),j(u,H,b)},o.negated=function(){var u=new C(this);return u.s=-u.s||null,u},o.plus=function(u,c){var p,b=this,w=b.s;if(u=new C(u,c),c=u.s,!w||!c)return new C(NaN);if(w!=c)return u.s=-c,b.minus(u);var y=b.e/J,F=u.e/J,g=b.c,x=u.c;if(!y||!F){if(!g||!x)return new C(w/0);if(!g[0]||!x[0])return x[0]?u:new C(g[0]?b:w*0)}if(y=be(y),F=be(F),g=g.slice(),w=y-F){for(w>0?(F=y,p=x):(w=-w,p=g),p.reverse();w--;p.push(0));p.reverse()}for(w=g.length,c=x.length,w-c<0&&(p=x,x=g,g=p,c=w),w=0;c;)w=(g[--c]=g[c]+x[c]+w)/we|0,g[c]=we===g[c]?0:g[c]%we;return w&&(g=[w].concat(g),++F),j(u,g,F)},o.precision=o.sd=function(u,c){var p,b,w,y=this;if(u!=null&&u!==!!u)return oe(u,1,de),c==null?c=s:oe(c,0,8),W(new C(y),u,c);if(!(p=y.c))return null;if(w=p.length-1,b=w*J+1,w=p[w]){for(;w%10==0;w/=10,b--);for(w=p[0];w>=10;w/=10,b++);}return u&&y.e+1>b&&(b=y.e+1),b},o.shiftedBy=function(u){return oe(u,-9007199254740991,Mr),this.times("1e"+u)},o.squareRoot=o.sqrt=function(){var u,c,p,b,w,y=this,F=y.c,g=y.s,x=y.e,O=l+4,S=new C("0.5");if(g!==1||!F||!F[0])return new C(!g||g<0&&(!F||F[0])?NaN:F?y:1/0);if(g=Math.sqrt(+G(y)),g==0||g==1/0?(c=he(F),(c.length+x)%2==0&&(c+="0"),g=Math.sqrt(+c),x=be((x+1)/2)-(x<0||x%2),g==1/0?c="5e"+x:(c=g.toExponential(),c=c.slice(0,c.indexOf("e")+1)+x),p=new C(c)):p=new C(g+""),p.c[0]){for(x=p.e,g=x+O,g<3&&(g=0);;)if(w=p,p=S.times(w.plus(t(y,w,O,1))),he(w.c).slice(0,g)===(c=he(p.c)).slice(0,g))if(p.e<x&&--g,c=c.slice(g-3,g+1),c=="9999"||!b&&c=="4999"){if(!b&&(W(w,w.e+l+2,0),w.times(w).eq(y))){p=w;break}O+=4,g+=4,b=1}else{(!+c||!+c.slice(1)&&c.charAt(0)=="5")&&(W(p,p.e+l+2,1),u=!p.times(p).eq(y));break}}return W(p,p.e+l+1,s,u)},o.toExponential=function(u,c){return u!=null&&(oe(u,0,de),u++),M(this,u,c,1)},o.toFixed=function(u,c){return u!=null&&(oe(u,0,de),u=u+this.e+1),M(this,u,c)},o.toFormat=function(u,c,p){var b,w=this;if(p==null)u!=null&&c&&typeof c=="object"?(p=c,c=null):u&&typeof u=="object"?(p=u,u=c=null):p=T;else if(typeof p!="object")throw Error(fe+"Argument not an object: "+p);if(b=w.toFixed(u,c),w.c){var y,F=b.split("."),g=+p.groupSize,x=+p.secondaryGroupSize,O=p.groupSeparator||"",S=F[0],P=F[1],E=w.s<0,I=E?S.slice(1):S,H=I.length;if(x&&(y=g,g=x,x=y,H-=y),g>0&&H>0){for(y=H%g||g,S=I.substr(0,y);y<H;y+=g)S+=O+I.substr(y,g);x>0&&(S+=O+I.slice(y)),E&&(S="-"+S)}b=P?S+(p.decimalSeparator||"")+((x=+p.fractionGroupSize)?P.replace(new RegExp("\\d{"+x+"}\\B","g"),"$&"+(p.fractionGroupSeparator||"")):P):S}return(p.prefix||"")+b+(p.suffix||"")},o.toFraction=function(u){var c,p,b,w,y,F,g,x,O,S,P,E,I=this,H=I.c;if(u!=null&&(g=new C(u),!g.isInteger()&&(g.c||g.s!==1)||g.lt(i)))throw Error(fe+"Argument "+(g.isInteger()?"out of range: ":"not an integer: ")+G(g));if(!H)return new C(I);for(c=new C(i),O=p=new C(i),b=x=new C(i),E=he(H),y=c.e=E.length-I.e-1,c.c[0]=vn[(F=y%J)<0?J+F:F],u=!u||g.comparedTo(c)>0?y>0?c:O:g,F=h,h=1/0,g=new C(E),x.c[0]=0;S=t(g,c,0,1),w=p.plus(S.times(b)),w.comparedTo(u)!=1;)p=b,b=w,O=x.plus(S.times(w=O)),x=w,c=g.minus(S.times(w=c)),g=w;return w=t(u.minus(p),b,0,1),x=x.plus(w.times(O)),p=p.plus(w.times(b)),x.s=O.s=I.s,y=y*2,P=t(O,b,y,s).minus(I).abs().comparedTo(t(x,p,y,s).minus(I).abs())<1?[O,b]:[x,p],h=F,P},o.toNumber=function(){return+G(this)},o.toPrecision=function(u,c){return u!=null&&oe(u,1,de),M(this,u,c,2)},o.toString=function(u){var c,p=this,b=p.s,w=p.e;return w===null?b?(c="Infinity",b<0&&(c="-"+c)):c="NaN":(u==null?c=w<=a||w>=f?Lt(he(p.c),w):Ne(he(p.c),w,"0"):u===10&&N?(p=W(new C(p),l+w+1,s),c=Ne(he(p.c),p.e,"0")):(oe(u,2,k.length,"Base"),c=n(Ne(he(p.c),w,"0"),10,u,b,!0)),b<0&&p.c[0]&&(c="-"+c)),c},o.valueOf=o.toJSON=function(){return G(this)},o._isBigNumber=!0,o[Symbol.toStringTag]="BigNumber",o[Symbol.for("nodejs.util.inspect.custom")]=o.valueOf,e!=null&&C.set(e),C}function be(e){var t=e|0;return e>0||e===t?t:t-1}function he(e){for(var t,n,r=1,o=e.length,i=e[0]+"";r<o;){for(t=e[r++]+"",n=J-t.length;n--;t="0"+t);i+=t}for(o=i.length;i.charCodeAt(--o)===48;);return i.slice(0,o+1||1)}function Ve(e,t){var n,r,o=e.c,i=t.c,l=e.s,s=t.s,a=e.e,f=t.e;if(!l||!s)return null;if(n=o&&!o[0],r=i&&!i[0],n||r)return n?r?0:-s:l;if(l!=s)return l;if(n=l<0,r=a==f,!o||!i)return r?0:!o^n?1:-1;if(!r)return a>f^n?1:-1;for(s=(a=o.length)<(f=i.length)?a:f,l=0;l<s;l++)if(o[l]!=i[l])return o[l]>i[l]^n?1:-1;return a==f?0:a>f^n?1:-1}function oe(e,t,n,r){if(e<t||e>n||e!==ve(e))throw Error(fe+(r||"Argument")+(typeof e=="number"?e<t||e>n?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function Mt(e){var t=e.c.length-1;return be(e.e/J)==t&&e.c[t]%2!=0}function Lt(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function Ne(e,t,n){var r,o;if(t<0){for(o=n+".";++t;o+=n);e=o+e}else if(r=e.length,++t>r){for(o=n,t-=r;--t;o+=n);e+=o}else t<r&&(e=e.slice(0,t)+"."+e.slice(t));return e}Wo();const vs=100000n,bs=(e,t={})=>{const{style:n="decimal",compact:r=!1,fractionDigits:o,adaptiveDecimals:i=!1}=t,l=typeof e=="string"?Number(e):e,s=typeof l=="bigint"?l<0n?-l:l:Math.abs(l),a=r==="auto"?s>=vs:r,f=typeof l=="bigint"?Number(l):l,d=i&&f!==0&&Math.abs(f)<Math.pow(10,-(o??2)),h=new Intl.NumberFormat("en-US",{style:n,...n==="currency"&&{currency:"USD"},maximumFractionDigits:d?20:o??2,minimumFractionDigits:d?0:o??2});if(!a)return d?h.format(Lr(f)):h.format(l);const A=[{threshold:1e12,suffix:"T",divisor:1e12},{threshold:1e9,suffix:"B",divisor:1e9},{threshold:1e6,suffix:"M",divisor:1e6},{threshold:1e3,suffix:"K",divisor:1e3}].find(m=>s>=m.threshold);if(A){const m=new Intl.NumberFormat("en-US",{style:n,...n==="currency"&&{currency:"USD"},maximumFractionDigits:o??1,minimumFractionDigits:o??1}),v=Number(l)/A.divisor;return m.format(v)+A.suffix}return d?h.format(Lr(f)):h.format(l)};function Lr(e){if(e===0)return 0;const t=e.toExponential().split("e"),n=parseInt(t[1]),r=Math.abs(n);return Number(e.toFixed(r))}const zn=R.forwardRef(({className:e="",showBalance:t=!0,children:n,...r},o)=>{const{activeAddress:i,algodClient:l}=zt.useWallet(),[s,a]=R.useState(null);return R.useEffect(()=>{if(!t)return;(async()=>{if(i&&l)try{const h=await l.accountInformation(i).do(),m=Number(h.amount)/1e6;a(m)}catch(h){console.error("Error fetching account balance:",h),a(null)}else a(null)})()},[i,l,t]),L.jsx("button",{ref:o,className:`flex items-center ${e}`.trim(),disabled:!1,...r,type:"button",children:n||L.jsxs("div",{className:"flex items-center",children:[t&&s!==null&&L.jsxs("div",{className:"flex items-center py-2.5 px-4 bg-gray-100 dark:bg-[#101B29] text-gray-600 dark:text-gray-400 rounded-xl mr-[-22px] font-medium",style:{paddingRight:"32px"},children:[bs(s,{fractionDigits:4})," ","ALGO"]}),L.jsxs("div",{className:"flex items-center py-2.5 px-4 bg-[#2D2DF1] dark:bg-[#BFBFF9] text-white dark:text-[#001324] rounded-xl font-bold",children:[i==null?void 0:i.substring(0,6),"...",i==null?void 0:i.substring((i==null?void 0:i.length)-4)]})]})})});zn.displayName="ConnectedWalletButton";const Uo=typeof document<"u"?R.useLayoutEffect:()=>{};function ys(e){const t=R.useRef(null);return Uo(()=>{t.current=e},[e]),R.useCallback((...n)=>{const r=t.current;return r==null?void 0:r(...n)},[])}const Ue=e=>{var t;return(t=e==null?void 0:e.ownerDocument)!==null&&t!==void 0?t:document},ze=e=>e&&"window"in e&&e.window===e?e:Ue(e).defaultView||window;function xs(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&typeof e.nodeType=="number"}function ws(e){return xs(e)&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&"host"in e}let Es=!1;function Xn(){return Es}function Vo(e,t){if(!Xn())return t&&e?e.contains(t):!1;if(!e||!t)return!1;let n=t;for(;n!==null;){if(n===e)return!0;n.tagName==="SLOT"&&n.assignedSlot?n=n.assignedSlot.parentNode:ws(n)?n=n.host:n=n.parentNode}return!1}const Nn=(e=document)=>{var t;if(!Xn())return e.activeElement;let n=e.activeElement;for(;n&&"shadowRoot"in n&&(!((t=n.shadowRoot)===null||t===void 0)&&t.activeElement);)n=n.shadowRoot.activeElement;return n};function Go(e){return Xn()&&e.target.shadowRoot&&e.composedPath?e.composedPath()[0]:e.target}function Rs(e){var t;return typeof window>"u"||window.navigator==null?!1:((t=window.navigator.userAgentData)===null||t===void 0?void 0:t.brands.some(n=>e.test(n.brand)))||e.test(window.navigator.userAgent)}function Ss(e){var t;return typeof window<"u"&&window.navigator!=null?e.test(((t=window.navigator.userAgentData)===null||t===void 0?void 0:t.platform)||window.navigator.platform):!1}function Yo(e){let t=null;return()=>(t==null&&(t=e()),t)}const Cs=Yo(function(){return Ss(/^Mac/i)}),Ts=Yo(function(){return Rs(/Android/i)});function qo(){let e=R.useRef(new Map),t=R.useCallback((o,i,l,s)=>{let a=s!=null&&s.once?(...f)=>{e.current.delete(l),l(...f)}:l;e.current.set(l,{type:i,eventTarget:o,fn:a,options:s}),o.addEventListener(i,a,s)},[]),n=R.useCallback((o,i,l,s)=>{var a;let f=((a=e.current.get(l))===null||a===void 0?void 0:a.fn)||l;o.removeEventListener(i,f,s),e.current.delete(l)},[]),r=R.useCallback(()=>{e.current.forEach((o,i)=>{n(o.eventTarget,o.type,i,o.options)})},[n]);return R.useEffect(()=>r,[r]),{addGlobalListener:t,removeGlobalListener:n,removeAllGlobalListeners:r}}function As(e){return e.mozInputSource===0&&e.isTrusted?!0:Ts()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}class _o{isDefaultPrevented(){return this.nativeEvent.defaultPrevented}preventDefault(){this.defaultPrevented=!0,this.nativeEvent.preventDefault()}stopPropagation(){this.nativeEvent.stopPropagation(),this.isPropagationStopped=()=>!0}isPropagationStopped(){return!1}persist(){}constructor(t,n){this.nativeEvent=n,this.target=n.target,this.currentTarget=n.currentTarget,this.relatedTarget=n.relatedTarget,this.bubbles=n.bubbles,this.cancelable=n.cancelable,this.defaultPrevented=n.defaultPrevented,this.eventPhase=n.eventPhase,this.isTrusted=n.isTrusted,this.timeStamp=n.timeStamp,this.type=t}}function zo(e){let t=R.useRef({isFocused:!1,observer:null});Uo(()=>{const r=t.current;return()=>{r.observer&&(r.observer.disconnect(),r.observer=null)}},[]);let n=ys(r=>{e==null||e(r)});return R.useCallback(r=>{if(r.target instanceof HTMLButtonElement||r.target instanceof HTMLInputElement||r.target instanceof HTMLTextAreaElement||r.target instanceof HTMLSelectElement){t.current.isFocused=!0;let o=r.target,i=l=>{t.current.isFocused=!1,o.disabled&&n(new _o("blur",l)),t.current.observer&&(t.current.observer.disconnect(),t.current.observer=null)};o.addEventListener("focusout",i,{once:!0}),t.current.observer=new MutationObserver(()=>{if(t.current.isFocused&&o.disabled){var l;(l=t.current.observer)===null||l===void 0||l.disconnect();let s=o===document.activeElement?null:document.activeElement;o.dispatchEvent(new FocusEvent("blur",{relatedTarget:s})),o.dispatchEvent(new FocusEvent("focusout",{bubbles:!0,relatedTarget:s}))}}),t.current.observer.observe(o,{attributes:!0,attributeFilter:["disabled"]})}},[n])}let Os=!1,Ct=null,Dn=new Set,ht=new Map,et=!1,In=!1;const Fs={Tab:!0,Escape:!0};function Kn(e,t){for(let n of Dn)n(e,t)}function Ps(e){return!(e.metaKey||!Cs()&&e.altKey||e.ctrlKey||e.key==="Control"||e.key==="Shift"||e.key==="Meta")}function qt(e){et=!0,Ps(e)&&(Ct="keyboard",Kn("keyboard",e))}function ye(e){Ct="pointer",(e.type==="mousedown"||e.type==="pointerdown")&&(et=!0,Kn("pointer",e))}function Xo(e){As(e)&&(et=!0,Ct="virtual")}function Ko(e){e.target===window||e.target===document||Os||!e.isTrusted||(!et&&!In&&(Ct="virtual",Kn("virtual",e)),et=!1,In=!1)}function Jo(){et=!1,In=!0}function Mn(e){if(typeof window>"u"||ht.get(ze(e)))return;const t=ze(e),n=Ue(e);let r=t.HTMLElement.prototype.focus;t.HTMLElement.prototype.focus=function(){et=!0,r.apply(this,arguments)},n.addEventListener("keydown",qt,!0),n.addEventListener("keyup",qt,!0),n.addEventListener("click",Xo,!0),t.addEventListener("focus",Ko,!0),t.addEventListener("blur",Jo,!1),typeof PointerEvent<"u"?(n.addEventListener("pointerdown",ye,!0),n.addEventListener("pointermove",ye,!0),n.addEventListener("pointerup",ye,!0)):(n.addEventListener("mousedown",ye,!0),n.addEventListener("mousemove",ye,!0),n.addEventListener("mouseup",ye,!0)),t.addEventListener("beforeunload",()=>{Qo(e)},{once:!0}),ht.set(t,{focus:r})}const Qo=(e,t)=>{const n=ze(e),r=Ue(e);t&&r.removeEventListener("DOMContentLoaded",t),ht.has(n)&&(n.HTMLElement.prototype.focus=ht.get(n).focus,r.removeEventListener("keydown",qt,!0),r.removeEventListener("keyup",qt,!0),r.removeEventListener("click",Xo,!0),n.removeEventListener("focus",Ko,!0),n.removeEventListener("blur",Jo,!1),typeof PointerEvent<"u"?(r.removeEventListener("pointerdown",ye,!0),r.removeEventListener("pointermove",ye,!0),r.removeEventListener("pointerup",ye,!0)):(r.removeEventListener("mousedown",ye,!0),r.removeEventListener("mousemove",ye,!0),r.removeEventListener("mouseup",ye,!0)),ht.delete(n))};function ks(e){const t=Ue(e);let n;return t.readyState!=="loading"?Mn(e):(n=()=>{Mn(e)},t.addEventListener("DOMContentLoaded",n)),()=>Qo(e,n)}typeof document<"u"&&ks();function Zo(){return Ct!=="pointer"}const Ns=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function Ds(e,t,n){let r=Ue(n==null?void 0:n.target);const o=typeof window<"u"?ze(n==null?void 0:n.target).HTMLInputElement:HTMLInputElement,i=typeof window<"u"?ze(n==null?void 0:n.target).HTMLTextAreaElement:HTMLTextAreaElement,l=typeof window<"u"?ze(n==null?void 0:n.target).HTMLElement:HTMLElement,s=typeof window<"u"?ze(n==null?void 0:n.target).KeyboardEvent:KeyboardEvent;return e=e||r.activeElement instanceof o&&!Ns.has(r.activeElement.type)||r.activeElement instanceof i||r.activeElement instanceof l&&r.activeElement.isContentEditable,!(e&&t==="keyboard"&&n instanceof s&&!Fs[n.key])}function Is(e,t,n){Mn(),R.useEffect(()=>{let r=(o,i)=>{Ds(!!(n!=null&&n.isTextInput),o,i)&&e(Zo())};return Dn.add(r),()=>{Dn.delete(r)}},t)}function Ms(e){let{isDisabled:t,onFocus:n,onBlur:r,onFocusChange:o}=e;const i=R.useCallback(a=>{if(a.target===a.currentTarget)return r&&r(a),o&&o(!1),!0},[r,o]),l=zo(i),s=R.useCallback(a=>{const f=Ue(a.target),d=f?Nn(f):Nn();a.target===a.currentTarget&&d===Go(a.nativeEvent)&&(n&&n(a),o&&o(!0),l(a))},[o,n,l]);return{focusProps:{onFocus:!t&&(n||o||r)?s:void 0,onBlur:!t&&(r||o)?i:void 0}}}function Ls(e){let{isDisabled:t,onBlurWithin:n,onFocusWithin:r,onFocusWithinChange:o}=e,i=R.useRef({isFocusWithin:!1}),{addGlobalListener:l,removeAllGlobalListeners:s}=qo(),a=R.useCallback(h=>{h.currentTarget.contains(h.target)&&i.current.isFocusWithin&&!h.currentTarget.contains(h.relatedTarget)&&(i.current.isFocusWithin=!1,s(),n&&n(h),o&&o(!1))},[n,o,i,s]),f=zo(a),d=R.useCallback(h=>{if(!h.currentTarget.contains(h.target))return;const A=Ue(h.target),m=Nn(A);if(!i.current.isFocusWithin&&m===Go(h.nativeEvent)){r&&r(h),o&&o(!0),i.current.isFocusWithin=!0,f(h);let v=h.currentTarget;l(A,"focus",T=>{if(i.current.isFocusWithin&&!Vo(v,T.target)){let k=new _o("blur",new A.defaultView.FocusEvent("blur",{relatedTarget:T.target}));k.target=v,k.currentTarget=v,a(k)}},{capture:!0})}},[r,o,f,l,a]);return t?{focusWithinProps:{onFocus:void 0,onBlur:void 0}}:{focusWithinProps:{onFocus:d,onBlur:a}}}let _t=!1,bn=0;function Ln(){_t=!0,setTimeout(()=>{_t=!1},50)}function $r(e){e.pointerType==="touch"&&Ln()}function $s(){if(!(typeof document>"u"))return typeof PointerEvent<"u"?document.addEventListener("pointerup",$r):document.addEventListener("touchend",Ln),bn++,()=>{bn--,!(bn>0)&&(typeof PointerEvent<"u"?document.removeEventListener("pointerup",$r):document.removeEventListener("touchend",Ln))}}function js(e){let{onHoverStart:t,onHoverChange:n,onHoverEnd:r,isDisabled:o}=e,[i,l]=R.useState(!1),s=R.useRef({isHovered:!1,ignoreEmulatedMouseEvents:!1,pointerType:"",target:null}).current;R.useEffect($s,[]);let{addGlobalListener:a,removeAllGlobalListeners:f}=qo(),{hoverProps:d,triggerHoverEnd:h}=R.useMemo(()=>{let A=(T,k)=>{if(s.pointerType=k,o||k==="touch"||s.isHovered||!T.currentTarget.contains(T.target))return;s.isHovered=!0;let N=T.currentTarget;s.target=N,a(Ue(T.target),"pointerover",C=>{s.isHovered&&s.target&&!Vo(s.target,C.target)&&m(C,C.pointerType)},{capture:!0}),t&&t({type:"hoverstart",target:N,pointerType:k}),n&&n(!0),l(!0)},m=(T,k)=>{let N=s.target;s.pointerType="",s.target=null,!(k==="touch"||!s.isHovered||!N)&&(s.isHovered=!1,f(),r&&r({type:"hoverend",target:N,pointerType:k}),n&&n(!1),l(!1))},v={};return typeof PointerEvent<"u"?(v.onPointerEnter=T=>{_t&&T.pointerType==="mouse"||A(T,T.pointerType)},v.onPointerLeave=T=>{!o&&T.currentTarget.contains(T.target)&&m(T,T.pointerType)}):(v.onTouchStart=()=>{s.ignoreEmulatedMouseEvents=!0},v.onMouseEnter=T=>{!s.ignoreEmulatedMouseEvents&&!_t&&A(T,"mouse"),s.ignoreEmulatedMouseEvents=!1},v.onMouseLeave=T=>{!o&&T.currentTarget.contains(T.target)&&m(T,"mouse")}),{hoverProps:v,triggerHoverEnd:m}},[t,n,r,o,s,a,f]);return R.useEffect(()=>{o&&h({currentTarget:s.target},s.pointerType)},[o]),{hoverProps:d,isHovered:i}}function Bs(e={}){let{autoFocus:t=!1,isTextInput:n,within:r}=e,o=R.useRef({isFocused:!1,isFocusVisible:t||Zo()}),[i,l]=R.useState(!1),[s,a]=R.useState(()=>o.current.isFocused&&o.current.isFocusVisible),f=R.useCallback(()=>a(o.current.isFocused&&o.current.isFocusVisible),[]),d=R.useCallback(m=>{o.current.isFocused=m,l(m),f()},[f]);Is(m=>{o.current.isFocusVisible=m,f()},[],{isTextInput:n});let{focusProps:h}=Ms({isDisabled:r,onFocusChange:d}),{focusWithinProps:A}=Ls({isDisabled:!r,onFocusWithinChange:d});return{isFocused:i,isFocusVisible:s,focusProps:r?A:h}}var Hs=Object.defineProperty,Ws=(e,t,n)=>t in e?Hs(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,yn=(e,t,n)=>(Ws(e,typeof t!="symbol"?t+"":t,n),n);let Us=class{constructor(){yn(this,"current",this.detect()),yn(this,"handoffState","pending"),yn(this,"currentId",0)}set(t){this.current!==t&&(this.handoffState="pending",this.currentId=0,this.current=t)}reset(){this.set(this.detect())}nextId(){return++this.currentId}get isServer(){return this.current==="server"}get isClient(){return this.current==="client"}detect(){return typeof window>"u"||typeof document>"u"?"server":"client"}handoff(){this.handoffState==="pending"&&(this.handoffState="complete")}get isHandoffComplete(){return this.handoffState==="complete"}},Ke=new Us;function Tt(e){return Ke.isServer?null:e instanceof Node?e.ownerDocument:e!=null&&e.hasOwnProperty("current")&&e.current instanceof Node?e.current.ownerDocument:document}function ei(e){typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e).catch(t=>setTimeout(()=>{throw t}))}function $e(){let e=[],t={addEventListener(n,r,o,i){return n.addEventListener(r,o,i),t.add(()=>n.removeEventListener(r,o,i))},requestAnimationFrame(...n){let r=requestAnimationFrame(...n);return t.add(()=>cancelAnimationFrame(r))},nextFrame(...n){return t.requestAnimationFrame(()=>t.requestAnimationFrame(...n))},setTimeout(...n){let r=setTimeout(...n);return t.add(()=>clearTimeout(r))},microTask(...n){let r={current:!0};return ei(()=>{r.current&&n[0]()}),t.add(()=>{r.current=!1})},style(n,r,o){let i=n.style.getPropertyValue(r);return Object.assign(n.style,{[r]:o}),this.add(()=>{Object.assign(n.style,{[r]:i})})},group(n){let r=$e();return n(r),this.add(()=>r.dispose())},add(n){return e.includes(n)||e.push(n),()=>{let r=e.indexOf(n);if(r>=0)for(let o of e.splice(r,1))o()}},dispose(){for(let n of e.splice(0))n()}};return t}function st(){let[e]=R.useState($e);return R.useEffect(()=>()=>e.dispose(),[e]),e}let ae=(e,t)=>{Ke.isServer?R.useEffect(e,t):R.useLayoutEffect(e,t)};function at(e){let t=R.useRef(e);return ae(()=>{t.current=e},[e]),t}let ne=function(e){let t=at(e);return R.useCallback((...n)=>t.current(...n),[t])};function Vs(e){let t=e.width/2,n=e.height/2;return{top:e.clientY-n,right:e.clientX+t,bottom:e.clientY+n,left:e.clientX-t}}function Gs(e,t){return!(!e||!t||e.right<t.left||e.left>t.right||e.bottom<t.top||e.top>t.bottom)}function Ys({disabled:e=!1}={}){let t=R.useRef(null),[n,r]=R.useState(!1),o=st(),i=ne(()=>{t.current=null,r(!1),o.dispose()}),l=ne(s=>{if(o.dispose(),t.current===null){t.current=s.currentTarget,r(!0);{let a=Tt(s.currentTarget);o.addEventListener(a,"pointerup",i,!1),o.addEventListener(a,"pointermove",f=>{if(t.current){let d=Vs(f);r(Gs(d,t.current.getBoundingClientRect()))}},!1),o.addEventListener(a,"pointercancel",i,!1)}}});return{pressed:n,pressProps:e?{}:{onPointerDown:l,onPointerUp:i,onClick:i}}}let qs=R.createContext(void 0);function Jn(){return R.useContext(qs)}function jr(...e){return Array.from(new Set(e.flatMap(t=>typeof t=="string"?t.split(" "):[]))).filter(Boolean).join(" ")}function Me(e,t,...n){if(e in t){let o=t[e];return typeof o=="function"?o(...n):o}let r=new Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(t).map(o=>`"${o}"`).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,Me),r}var $n=(e=>(e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static",e))($n||{}),_s=(e=>(e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden",e))(_s||{});function Re(){let e=Xs();return R.useCallback(t=>zs({mergeRefs:e,...t}),[e])}function zs({ourProps:e,theirProps:t,slot:n,defaultTag:r,features:o,visible:i=!0,name:l,mergeRefs:s}){s=s??Ks;let a=ti(t,e);if(i)return $t(a,n,r,l,s);let f=o??0;if(f&2){let{static:d=!1,...h}=a;if(d)return $t(h,n,r,l,s)}if(f&1){let{unmount:d=!0,...h}=a;return Me(d?0:1,{0(){return null},1(){return $t({...h,hidden:!0,style:{display:"none"}},n,r,l,s)}})}return $t(a,n,r,l,s)}function $t(e,t={},n,r,o){let{as:i=n,children:l,refName:s="ref",...a}=xn(e,["unmount","static"]),f=e.ref!==void 0?{[s]:e.ref}:{},d=typeof l=="function"?l(t):l;"className"in a&&a.className&&typeof a.className=="function"&&(a.className=a.className(t)),a["aria-labelledby"]&&a["aria-labelledby"]===a.id&&(a["aria-labelledby"]=void 0);let h={};if(t){let A=!1,m=[];for(let[v,T]of Object.entries(t))typeof T=="boolean"&&(A=!0),T===!0&&m.push(v.replace(/([A-Z])/g,k=>`-${k.toLowerCase()}`));if(A){h["data-headlessui-state"]=m.join(" ");for(let v of m)h[`data-${v}`]=""}}if(i===R.Fragment&&(Object.keys(qe(a)).length>0||Object.keys(qe(h)).length>0))if(!R.isValidElement(d)||Array.isArray(d)&&d.length>1){if(Object.keys(qe(a)).length>0)throw new Error(['Passing props on "Fragment"!',"",`The current component <${r} /> is rendering a "Fragment".`,"However we need to passthrough the following props:",Object.keys(qe(a)).concat(Object.keys(qe(h))).map(A=>` - ${A}`).join(`
|
|
38
|
-
`),"","You can apply a few solutions:",['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".',"Render a single element as the child so that we can forward the props onto that element."].map(
|
|
37
|
+
*/var Pc=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"],gr=Pc.join(","),Ki=typeof Element>"u",bn=Ki?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,br=!Ki&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e==null?void 0:e.ownerDocument},vr=function e(t,n){var r;n===void 0&&(n=!0);var o=t==null||(r=t.getAttribute)===null||r===void 0?void 0:r.call(t,"inert"),s=o===""||o==="true",i=s||n&&t&&e(t.parentNode);return i},Mc=function(t){var n,r=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return r===""||r==="true"},Ic=function(t,n,r){if(vr(t))return[];var o=Array.prototype.slice.apply(t.querySelectorAll(gr));return n&&bn.call(t,gr)&&o.unshift(t),o=o.filter(r),o},Dc=function e(t,n,r){for(var o=[],s=Array.from(t);s.length;){var i=s.shift();if(!vr(i,!1))if(i.tagName==="SLOT"){var a=i.assignedElements(),l=a.length?a:i.children,u=e(l,!0,r);r.flatten?o.push.apply(o,u):o.push({scopeParent:i,candidates:u})}else{var d=bn.call(i,gr);d&&r.filter(i)&&(n||!t.includes(i))&&o.push(i);var h=i.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(i),E=!vr(h,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(i));if(h&&E){var p=e(h===!0?i.children:h.children,!0,r);r.flatten?o.push.apply(o,p):o.push({scopeParent:i,candidates:p})}else s.unshift.apply(s,i.children)}}return o},Yi=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},Xi=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||Mc(t))&&!Yi(t)?0:t.tabIndex},Nc=function(t,n){var r=Xi(t);return r<0&&n&&!Yi(t)?0:r},Lc=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},Ji=function(t){return t.tagName==="INPUT"},$c=function(t){return Ji(t)&&t.type==="hidden"},jc=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return n},Bc=function(t,n){for(var r=0;r<t.length;r++)if(t[r].checked&&t[r].form===n)return t[r]},Hc=function(t){if(!t.name)return!0;var n=t.form||br(t),r=function(a){return n.querySelectorAll('input[type="radio"][name="'+a+'"]')},o;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")o=r(window.CSS.escape(t.name));else try{o=r(t.name)}catch(i){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",i.message),!1}var s=Bc(o,t.form);return!s||s===t},Uc=function(t){return Ji(t)&&t.type==="radio"},Wc=function(t){return Uc(t)&&!Hc(t)},qc=function(t){var n,r=t&&br(t),o=(n=r)===null||n===void 0?void 0:n.host,s=!1;if(r&&r!==t){var i,a,l;for(s=!!((i=o)!==null&&i!==void 0&&(a=i.ownerDocument)!==null&&a!==void 0&&a.contains(o)||t!=null&&(l=t.ownerDocument)!==null&&l!==void 0&&l.contains(t));!s&&o;){var u,d,h;r=br(o),o=(u=r)===null||u===void 0?void 0:u.host,s=!!((d=o)!==null&&d!==void 0&&(h=d.ownerDocument)!==null&&h!==void 0&&h.contains(o))}}return s},Rs=function(t){var n=t.getBoundingClientRect(),r=n.width,o=n.height;return r===0&&o===0},zc=function(t,n){var r=n.displayCheck,o=n.getShadowRoot;if(getComputedStyle(t).visibility==="hidden")return!0;var s=bn.call(t,"details>summary:first-of-type"),i=s?t.parentElement:t;if(bn.call(i,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="legacy-full"){if(typeof o=="function"){for(var a=t;t;){var l=t.parentElement,u=br(t);if(l&&!l.shadowRoot&&o(l)===!0)return Rs(t);t.assignedSlot?t=t.assignedSlot:!l&&u!==t.ownerDocument?t=u.host:t=l}t=a}if(qc(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return Rs(t);return!1},Gc=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var n=t.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var r=0;r<n.children.length;r++){var o=n.children.item(r);if(o.tagName==="LEGEND")return bn.call(n,"fieldset[disabled] *")?!0:!o.contains(t)}return!0}n=n.parentElement}return!1},Vc=function(t,n){return!(n.disabled||vr(n)||$c(n)||zc(n,t)||jc(n)||Gc(n))},ho=function(t,n){return!(Wc(n)||Xi(n)<0||!Vc(t,n))},_c=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},Qc=function e(t){var n=[],r=[];return t.forEach(function(o,s){var i=!!o.scopeParent,a=i?o.scopeParent:o,l=Nc(a,i),u=i?e(o.candidates):a;l===0?i?n.push.apply(n,u):n.push(a):r.push({documentOrder:s,tabIndex:l,item:o,isScope:i,content:u})}),r.sort(Lc).reduce(function(o,s){return s.isScope?o.push.apply(o,s.content):o.push(s.content),o},[]).concat(n)},Tr=function(t,n){n=n||{};var r;return n.getShadowRoot?r=Dc([t],n.includeContainer,{filter:ho.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:_c}):r=Ic(t,n.includeContainer,ho.bind(null,n)),Qc(r)},Kc=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return bn.call(t,gr)===!1?!1:ho(n,t)};function Ss(e,t,n){let{reference:r,floating:o}=e;const s=_t(t),i=Qi(t),a=_i(i),l=kt(t),u=s==="y",d=r.x+r.width/2-o.width/2,h=r.y+r.height/2-o.height/2,E=r[a]/2-o[a]/2;let p;switch(l){case"top":p={x:d,y:r.y-o.height};break;case"bottom":p={x:d,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:h};break;case"left":p={x:r.x-o.width,y:h};break;default:p={x:r.x,y:r.y}}switch(Qn(t)){case"start":p[i]-=E*(n&&u?-1:1);break;case"end":p[i]+=E*(n&&u?-1:1);break}return p}const Yc=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:s=[],platform:i}=n,a=s.filter(Boolean),l=await(i.isRTL==null?void 0:i.isRTL(t));let u=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:d,y:h}=Ss(u,r,l),E=r,p={},g=0;for(let y=0;y<a.length;y++){const{name:O,fn:N}=a[y],{x,y:I,data:B,reset:U}=await N({x:d,y:h,initialPlacement:r,placement:E,strategy:o,middlewareData:p,rects:u,platform:i,elements:{reference:e,floating:t}});d=x??d,h=I??h,p={...p,[O]:{...p[O],...B}},U&&g<=50&&(g++,typeof U=="object"&&(U.placement&&(E=U.placement),U.rects&&(u=U.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:o}):U.rects),{x:d,y:h}=Ss(u,E,l)),y=-1)}return{x:d,y:h,placement:E,strategy:o,middlewareData:p}};async function Fr(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:s,rects:i,elements:a,strategy:l}=e,{boundary:u="clippingAncestors",rootBoundary:d="viewport",elementContext:h="floating",altBoundary:E=!1,padding:p=0}=xn(t,e),g=Fc(p),O=a[E?h==="floating"?"reference":"floating":h],N=mr(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(O)))==null||n?O:O.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:u,rootBoundary:d,strategy:l})),x=h==="floating"?{x:r,y:o,width:i.floating.width,height:i.floating.height}:i.reference,I=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),B=await(s.isElement==null?void 0:s.isElement(I))?await(s.getScale==null?void 0:s.getScale(I))||{x:1,y:1}:{x:1,y:1},U=mr(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:x,offsetParent:I,strategy:l}):x);return{top:(N.top-U.top+g.top)/B.y,bottom:(U.bottom-N.bottom+g.bottom)/B.y,left:(N.left-U.left+g.left)/B.x,right:(U.right-N.right+g.right)/B.x}}const Xc=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:s,rects:i,initialPlacement:a,platform:l,elements:u}=t,{mainAxis:d=!0,crossAxis:h=!0,fallbackPlacements:E,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:y=!0,...O}=xn(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const N=kt(o),x=_t(a),I=kt(a)===a,B=await(l.isRTL==null?void 0:l.isRTL(u.floating)),U=E||(I||!y?[pr(a)]:kc(a)),H=g!=="none";!E&&H&&U.push(...Oc(a,y,g,B));const W=[a,...U],c=await Fr(t,O),f=[];let b=((r=s.flip)==null?void 0:r.overflows)||[];if(d&&f.push(c[N]),h){const k=Cc(o,i,B);f.push(c[k[0]],c[k[1]])}if(b=[...b,{placement:o,overflows:f}],!f.every(k=>k<=0)){var w,R;const k=(((w=s.flip)==null?void 0:w.index)||0)+1,m=W[k];if(m)return{data:{index:k,overflows:b},reset:{placement:m}};let S=(R=b.filter(F=>F.overflows[0]<=0).sort((F,v)=>F.overflows[1]-v.overflows[1])[0])==null?void 0:R.placement;if(!S)switch(p){case"bestFit":{var A;const F=(A=b.filter(v=>{if(H){const M=_t(v.placement);return M===x||M==="y"}return!0}).map(v=>[v.placement,v.overflows.filter(M=>M>0).reduce((M,P)=>M+P,0)]).sort((v,M)=>v[1]-M[1])[0])==null?void 0:A[0];F&&(S=F);break}case"initialPlacement":S=a;break}if(o!==S)return{reset:{placement:S}}}return{}}}};async function Jc(e,t){const{placement:n,platform:r,elements:o}=e,s=await(r.isRTL==null?void 0:r.isRTL(o.floating)),i=kt(n),a=Qn(n),l=_t(n)==="y",u=["left","top"].includes(i)?-1:1,d=s&&l?-1:1,h=xn(t,e);let{mainAxis:E,crossAxis:p,alignmentAxis:g}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return a&&typeof g=="number"&&(p=a==="end"?g*-1:g),l?{x:p*d,y:E*u}:{x:E*u,y:p*d}}const Zc=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:s,placement:i,middlewareData:a}=t,l=await Jc(t,e);return i===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+l.x,y:s+l.y,data:{...l,placement:i}}}}},eu=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:s=!0,crossAxis:i=!1,limiter:a={fn:O=>{let{x:N,y:x}=O;return{x:N,y:x}}},...l}=xn(e,t),u={x:n,y:r},d=await Fr(t,l),h=_t(kt(o)),E=Vi(h);let p=u[E],g=u[h];if(s){const O=E==="y"?"top":"left",N=E==="y"?"bottom":"right",x=p+d[O],I=p-d[N];p=Es(x,p,I)}if(i){const O=h==="y"?"top":"left",N=h==="y"?"bottom":"right",x=g+d[O],I=g-d[N];g=Es(x,g,I)}const y=a.fn({...t,[E]:p,[h]:g});return{...y,data:{x:y.x-n,y:y.y-r,enabled:{[E]:s,[h]:i}}}}}},tu=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:s,platform:i,elements:a}=t,{apply:l=()=>{},...u}=xn(e,t),d=await Fr(t,u),h=kt(o),E=Qn(o),p=_t(o)==="y",{width:g,height:y}=s.floating;let O,N;h==="top"||h==="bottom"?(O=h,N=E===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?"start":"end")?"left":"right"):(N=h,O=E==="end"?"top":"bottom");const x=y-d.top-d.bottom,I=g-d.left-d.right,B=Vt(y-d[O],x),U=Vt(g-d[N],I),H=!t.middlewareData.shift;let W=B,c=U;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(c=I),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(W=x),H&&!E){const b=Se(d.left,0),w=Se(d.right,0),R=Se(d.top,0),A=Se(d.bottom,0);p?c=g-2*(b!==0||w!==0?b+w:Se(d.left,d.right)):W=y-2*(R!==0||A!==0?R+A:Se(d.top,d.bottom))}await l({...t,availableWidth:c,availableHeight:W});const f=await i.getDimensions(a.floating);return g!==f.width||y!==f.height?{reset:{rects:!0}}:{}}}};function Zi(e){const t=qe(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=be(e),s=o?e.offsetWidth:n,i=o?e.offsetHeight:r,a=$n(n)!==s||$n(r)!==i;return a&&(n=s,r=i),{width:n,height:r,$:a}}function zo(e){return ue(e)?e:e.contextElement}function tn(e){const t=zo(e);if(!be(t))return rt(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:s}=Zi(t);let i=(s?$n(n.width):n.width)/r,a=(s?$n(n.height):n.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!a||!Number.isFinite(a))&&(a=1),{x:i,y:a}}const nu=rt(0);function ea(e){const t=Le(e);return!Ar()||!t.visualViewport?nu:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function ru(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Le(e)?!1:t}function Qt(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),s=zo(e);let i=rt(1);t&&(r?ue(r)&&(i=tn(r)):i=tn(e));const a=ru(s,n,r)?ea(s):rt(0);let l=(o.left+a.x)/i.x,u=(o.top+a.y)/i.y,d=o.width/i.x,h=o.height/i.y;if(s){const E=Le(s),p=r&&ue(r)?Le(r):r;let g=E,y=co(g);for(;y&&r&&p!==g;){const O=tn(y),N=y.getBoundingClientRect(),x=qe(y),I=N.left+(y.clientLeft+parseFloat(x.paddingLeft))*O.x,B=N.top+(y.clientTop+parseFloat(x.paddingTop))*O.y;l*=O.x,u*=O.y,d*=O.x,h*=O.y,l+=I,u+=B,g=Le(y),y=co(g)}}return mr({width:d,height:h,x:l,y:u})}function Go(e,t){const n=Or(e).scrollLeft;return t?t.left+n:Qt(ot(e)).left+n}function ta(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),o=r.left+t.scrollLeft-(n?0:Go(e,r)),s=r.top+t.scrollTop;return{x:o,y:s}}function ou(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const s=o==="fixed",i=ot(r),a=t?kr(t.floating):!1;if(r===i||a&&s)return n;let l={scrollLeft:0,scrollTop:0},u=rt(1);const d=rt(0),h=be(r);if((h||!h&&!s)&&((At(r)!=="body"||_n(i))&&(l=Or(r)),be(r))){const p=Qt(r);u=tn(r),d.x=p.x+r.clientLeft,d.y=p.y+r.clientTop}const E=i&&!h&&!s?ta(i,l,!0):rt(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+d.x+E.x,y:n.y*u.y-l.scrollTop*u.y+d.y+E.y}}function su(e){return Array.from(e.getClientRects())}function iu(e){const t=ot(e),n=Or(e),r=e.ownerDocument.body,o=Se(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=Se(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+Go(e);const a=-n.scrollTop;return qe(r).direction==="rtl"&&(i+=Se(t.clientWidth,r.clientWidth)-o),{width:o,height:s,x:i,y:a}}function au(e,t){const n=Le(e),r=ot(e),o=n.visualViewport;let s=r.clientWidth,i=r.clientHeight,a=0,l=0;if(o){s=o.width,i=o.height;const u=Ar();(!u||u&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}return{width:s,height:i,x:a,y:l}}function lu(e,t){const n=Qt(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,s=be(e)?tn(e):rt(1),i=e.clientWidth*s.x,a=e.clientHeight*s.y,l=o*s.x,u=r*s.y;return{width:i,height:a,x:l,y:u}}function Cs(e,t,n){let r;if(t==="viewport")r=au(e,n);else if(t==="document")r=iu(ot(e));else if(ue(t))r=lu(t,n);else{const o=ea(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return mr(r)}function na(e,t){const n=ht(e);return n===t||!ue(n)||ut(n)?!1:qe(n).position==="fixed"||na(n,t)}function cu(e,t){const n=t.get(e);if(n)return n;let r=Ct(e,[],!1).filter(a=>ue(a)&&At(a)!=="body"),o=null;const s=qe(e).position==="fixed";let i=s?ht(e):e;for(;ue(i)&&!ut(i);){const a=qe(i),l=qo(i);!l&&a.position==="fixed"&&(o=null),(s?!l&&!o:!l&&a.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||_n(i)&&!l&&na(e,i))?r=r.filter(d=>d!==i):o=a,i=ht(i)}return t.set(e,r),r}function uu(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[...n==="clippingAncestors"?kr(t)?[]:cu(t,this._c):[].concat(n),r],a=i[0],l=i.reduce((u,d)=>{const h=Cs(t,d,o);return u.top=Se(h.top,u.top),u.right=Vt(h.right,u.right),u.bottom=Vt(h.bottom,u.bottom),u.left=Se(h.left,u.left),u},Cs(t,a,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function fu(e){const{width:t,height:n}=Zi(e);return{width:t,height:n}}function du(e,t,n){const r=be(t),o=ot(t),s=n==="fixed",i=Qt(e,!0,s,t);let a={scrollLeft:0,scrollTop:0};const l=rt(0);if(r||!r&&!s)if((At(t)!=="body"||_n(o))&&(a=Or(t)),r){const E=Qt(t,!0,s,t);l.x=E.x+t.clientLeft,l.y=E.y+t.clientTop}else o&&(l.x=Go(o));const u=o&&!r&&!s?ta(o,a):rt(0),d=i.left+a.scrollLeft-l.x-u.x,h=i.top+a.scrollTop-l.y-u.y;return{x:d,y:h,width:i.width,height:i.height}}function qr(e){return qe(e).position==="static"}function ks(e,t){if(!be(e)||qe(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return ot(e)===n&&(n=n.ownerDocument.body),n}function ra(e,t){const n=Le(e);if(kr(e))return n;if(!be(e)){let o=ht(e);for(;o&&!ut(o);){if(ue(o)&&!qr(o))return o;o=ht(o)}return n}let r=ks(e,t);for(;r&&pc(r)&&qr(r);)r=ks(r,t);return r&&ut(r)&&qr(r)&&!qo(r)?n:r||mc(e)||n}const hu=async function(e){const t=this.getOffsetParent||ra,n=this.getDimensions,r=await n(e.floating);return{reference:du(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function pu(e){return qe(e).direction==="rtl"}const mu={convertOffsetParentRelativeRectToViewportRelativeRect:ou,getDocumentElement:ot,getClippingRect:uu,getOffsetParent:ra,getElementRects:hu,getClientRects:su,getDimensions:fu,getScale:tn,isElement:ue,isRTL:pu};function oa(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function gu(e,t){let n=null,r;const o=ot(e);function s(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function i(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),s();const u=e.getBoundingClientRect(),{left:d,top:h,width:E,height:p}=u;if(a||t(),!E||!p)return;const g=sr(h),y=sr(o.clientWidth-(d+E)),O=sr(o.clientHeight-(h+p)),N=sr(d),I={rootMargin:-g+"px "+-y+"px "+-O+"px "+-N+"px",threshold:Se(0,Vt(1,l))||1};let B=!0;function U(H){const W=H[0].intersectionRatio;if(W!==l){if(!B)return i();W?i(!1,W):r=setTimeout(()=>{i(!1,1e-7)},1e3)}W===1&&!oa(u,e.getBoundingClientRect())&&i(),B=!1}try{n=new IntersectionObserver(U,{...I,root:o.ownerDocument})}catch{n=new IntersectionObserver(U,I)}n.observe(e)}return i(!0),s}function sa(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,u=zo(e),d=o||s?[...u?Ct(u):[],...Ct(t)]:[];d.forEach(N=>{o&&N.addEventListener("scroll",n,{passive:!0}),s&&N.addEventListener("resize",n)});const h=u&&a?gu(u,n):null;let E=-1,p=null;i&&(p=new ResizeObserver(N=>{let[x]=N;x&&x.target===u&&p&&(p.unobserve(t),cancelAnimationFrame(E),E=requestAnimationFrame(()=>{var I;(I=p)==null||I.observe(t)})),n()}),u&&!l&&p.observe(u),p.observe(t));let g,y=l?Qt(e):null;l&&O();function O(){const N=Qt(e);y&&!oa(y,N)&&n(),y=N,g=requestAnimationFrame(O)}return n(),()=>{var N;d.forEach(x=>{o&&x.removeEventListener("scroll",n),s&&x.removeEventListener("resize",n)}),h==null||h(),(N=p)==null||N.disconnect(),p=null,l&&cancelAnimationFrame(g)}}const zr=Fr,bu=Zc,vu=eu,yu=Xc,wu=tu,xu=(e,t,n)=>{const r=new Map,o={platform:mu,...n},s={...o.platform,_c:r};return Yc(e,t,{...o,platform:s})};var hr=typeof document<"u"?C.useLayoutEffect:C.useEffect;function yr(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 n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!yr(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const s=o[r];if(!(s==="_owner"&&e.$$typeof)&&!yr(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function ia(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function As(e,t){const n=ia(e);return Math.round(t*n)/n}function Gr(e){const t=D.useRef(e);return hr(()=>{t.current=e}),t}function aa(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:s,floating:i}={},transform:a=!0,whileElementsMounted:l,open:u}=e,[d,h]=D.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[E,p]=D.useState(r);yr(E,r)||p(r);const[g,y]=D.useState(null),[O,N]=D.useState(null),x=D.useCallback(v=>{v!==H.current&&(H.current=v,y(v))},[]),I=D.useCallback(v=>{v!==W.current&&(W.current=v,N(v))},[]),B=s||g,U=i||O,H=D.useRef(null),W=D.useRef(null),c=D.useRef(d),f=l!=null,b=Gr(l),w=Gr(o),R=Gr(u),A=D.useCallback(()=>{if(!H.current||!W.current)return;const v={placement:t,strategy:n,middleware:E};w.current&&(v.platform=w.current),xu(H.current,W.current,v).then(M=>{const P={...M,isPositioned:R.current!==!1};k.current&&!yr(c.current,P)&&(c.current=P,Ln.flushSync(()=>{h(P)}))})},[E,t,n,w,R]);hr(()=>{u===!1&&c.current.isPositioned&&(c.current.isPositioned=!1,h(v=>({...v,isPositioned:!1})))},[u]);const k=D.useRef(!1);hr(()=>(k.current=!0,()=>{k.current=!1}),[]),hr(()=>{if(B&&(H.current=B),U&&(W.current=U),B&&U){if(b.current)return b.current(B,U,A);A()}},[B,U,A,b,f]);const m=D.useMemo(()=>({reference:H,floating:W,setReference:x,setFloating:I}),[x,I]),S=D.useMemo(()=>({reference:B,floating:U}),[B,U]),F=D.useMemo(()=>{const v={position:n,left:0,top:0};if(!S.floating)return v;const M=As(S.floating,d.x),P=As(S.floating,d.y);return a?{...v,transform:"translate("+M+"px, "+P+"px)",...ia(S.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:M,top:P}},[n,a,S.floating,d.x,d.y]);return D.useMemo(()=>({...d,update:A,refs:m,elements:S,floatingStyles:F}),[d,A,m,S,F])}const Vo=(e,t)=>({...bu(e),options:[e,t]}),la=(e,t)=>({...vu(e),options:[e,t]}),ca=(e,t)=>({...yu(e),options:[e,t]}),Eu=(e,t)=>({...wu(e),options:[e,t]});function Ru(e){const t=D.useRef(void 0),n=D.useCallback(r=>{const o=e.map(s=>{if(s!=null){if(typeof s=="function"){const i=s,a=i(r);return typeof a=="function"?a:()=>{i(null)}}return s.current=r,()=>{s.current=null}}});return()=>{o.forEach(s=>s==null?void 0:s())}},e);return D.useMemo(()=>e.every(r=>r==null)?null:r=>{t.current&&(t.current(),t.current=void 0),r!=null&&(t.current=n(r))},e)}const ua={...D},Su=ua.useInsertionEffect,Cu=Su||(e=>e());function tt(e){const t=D.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return Cu(()=>{t.current=e}),D.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t.current==null?void 0:t.current(...r)},[])}var Ne=typeof document<"u"?C.useLayoutEffect:C.useEffect;let Os=!1,ku=0;const Ts=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+ku++;function Au(){const[e,t]=D.useState(()=>Os?Ts():void 0);return Ne(()=>{e==null&&t(Ts())},[]),D.useEffect(()=>{Os=!0},[]),e}const Ou=ua.useId,vn=Ou||Au;let po;process.env.NODE_ENV!=="production"&&(po=new Set);function Tu(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const o="Floating UI: "+n.join(" ");if(!((e=po)!=null&&e.has(o))){var s;(s=po)==null||s.add(o),console.error(o)}}function Fu(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(o=>o(n))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){var r;e.set(t,((r=e.get(t))==null?void 0:r.filter(o=>o!==n))||[])}}}const Pu=D.createContext(null),Mu=D.createContext(null),fa=()=>{var e;return((e=D.useContext(Pu))==null?void 0:e.id)||null},_o=()=>D.useContext(Mu);function jn(e){return"data-floating-ui-"+e}function Vr(e){const t=C.useRef(e);return Ne(()=>{t.current=e}),t}let Fs=0;function Jt(e,t){t===void 0&&(t={});const{preventScroll:n=!1,cancelPrevious:r=!0,sync:o=!1}=t;r&&cancelAnimationFrame(Fs);const s=()=>e==null?void 0:e.focus({preventScroll:n});o?s():Fs=requestAnimationFrame(s)}function Ps(e,t){var n;let r=[],o=(n=e.find(s=>s.id===t))==null?void 0:n.parentId;for(;o;){const s=e.find(i=>i.id===o);o=s==null?void 0:s.parentId,s&&(r=r.concat(s))}return r}function Mn(e,t){let n=e.filter(o=>{var s;return o.parentId===t&&((s=o.context)==null?void 0:s.open)}),r=n;for(;r.length;)r=e.filter(o=>{var s;return(s=r)==null?void 0:s.some(i=>{var a;return o.parentId===i.id&&((a=o.context)==null?void 0:a.open)})}),n=n.concat(r);return n}let Zt=new WeakMap,ir=new WeakSet,ar={},_r=0;const Iu=()=>typeof HTMLElement<"u"&&"inert"in HTMLElement.prototype,da=e=>e&&(e.host||da(e.parentNode)),Du=(e,t)=>t.map(n=>{if(e.contains(n))return n;const r=da(n);return e.contains(r)?r:null}).filter(n=>n!=null);function Nu(e,t,n,r){const o="data-floating-ui-inert",s=r?"inert":n?"aria-hidden":null,i=Du(t,e),a=new Set,l=new Set(i),u=[];ar[o]||(ar[o]=new WeakMap);const d=ar[o];i.forEach(h),E(t),a.clear();function h(p){!p||a.has(p)||(a.add(p),p.parentNode&&h(p.parentNode))}function E(p){!p||l.has(p)||[].forEach.call(p.children,g=>{if(At(g)!=="script")if(a.has(g))E(g);else{const y=s?g.getAttribute(s):null,O=y!==null&&y!=="false",N=Zt.get(g)||0,x=s?N+1:N,I=(d.get(g)||0)+1;Zt.set(g,x),d.set(g,I),u.push(g),x===1&&O&&ir.add(g),I===1&&g.setAttribute(o,""),!O&&s&&g.setAttribute(s,s==="inert"?"":"true")}})}return _r++,()=>{u.forEach(p=>{const g=Zt.get(p)||0,y=s?g-1:g,O=(d.get(p)||0)-1;Zt.set(p,y),d.set(p,O),y||(!ir.has(p)&&s&&p.removeAttribute(s),ir.delete(p)),O||p.removeAttribute(o)}),_r--,_r||(Zt=new WeakMap,Zt=new WeakMap,ir=new WeakSet,ar={})}}function Ms(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=De(e[0]).body;return Nu(e.concat(Array.from(r.querySelectorAll("[aria-live]"))),r,t,n)}const Pr=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function ha(e,t){const n=Tr(e,Pr());t==="prev"&&n.reverse();const r=n.indexOf(Pt(De(e)));return n.slice(r+1)[0]}function pa(e){return ha(De(e).body,"next")||e}function ma(e){return ha(De(e).body,"prev")||e}function In(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!Ie(n,r)}function Lu(e){Tr(e,Pr()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function Is(e){e.querySelectorAll("[data-tabindex]").forEach(n=>{const r=n.dataset.tabindex;delete n.dataset.tabindex,r?n.setAttribute("tabindex",r):n.removeAttribute("tabindex")})}const Mr={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0},wr=D.forwardRef(function(t,n){const[r,o]=D.useState();Ne(()=>{vc()&&o("button")},[]);const s={ref:n,tabIndex:0,role:r,"aria-hidden":r?void 0:!0,[jn("focus-guard")]:"",style:Mr};return $.jsx("span",{...t,...s})}),ga=D.createContext(null),Ds=jn("portal");function $u(e){e===void 0&&(e={});const{id:t,root:n}=e,r=vn(),o=va(),[s,i]=D.useState(null),a=D.useRef(null);return Ne(()=>()=>{s==null||s.remove(),queueMicrotask(()=>{a.current=null})},[s]),Ne(()=>{if(!r||a.current)return;const l=t?document.getElementById(t):null;if(!l)return;const u=document.createElement("div");u.id=r,u.setAttribute(Ds,""),l.appendChild(u),a.current=u,i(u)},[t,r]),Ne(()=>{if(n===null||!r||a.current)return;let l=n||(o==null?void 0:o.portalNode);l&&!ue(l)&&(l=l.current),l=l||document.body;let u=null;t&&(u=document.createElement("div"),u.id=t,l.appendChild(u));const d=document.createElement("div");d.id=r,d.setAttribute(Ds,""),l=u||l,l.appendChild(d),a.current=d,i(d)},[t,n,r,o]),s}function ba(e){const{children:t,id:n,root:r,preserveTabOrder:o=!0}=e,s=$u({id:n,root:r}),[i,a]=D.useState(null),l=D.useRef(null),u=D.useRef(null),d=D.useRef(null),h=D.useRef(null),E=i==null?void 0:i.modal,p=i==null?void 0:i.open,g=!!i&&!i.modal&&i.open&&o&&!!(r||s);return D.useEffect(()=>{if(!s||!o||E)return;function y(O){s&&In(O)&&(O.type==="focusin"?Is:Lu)(s)}return s.addEventListener("focusin",y,!0),s.addEventListener("focusout",y,!0),()=>{s.removeEventListener("focusin",y,!0),s.removeEventListener("focusout",y,!0)}},[s,o,E]),D.useEffect(()=>{s&&(p||Is(s))},[p,s]),$.jsxs(ga.Provider,{value:D.useMemo(()=>({preserveTabOrder:o,beforeOutsideRef:l,afterOutsideRef:u,beforeInsideRef:d,afterInsideRef:h,portalNode:s,setFocusManagerState:a}),[o,s]),children:[g&&s&&$.jsx(wr,{"data-type":"outside",ref:l,onFocus:y=>{if(In(y,s)){var O;(O=d.current)==null||O.focus()}else{const N=i?i.domReference:null,x=ma(N);x==null||x.focus()}}}),g&&s&&$.jsx("span",{"aria-owns":s.id,style:Mr}),s&&Ln.createPortal(t,s),g&&s&&$.jsx(wr,{"data-type":"outside",ref:u,onFocus:y=>{if(In(y,s)){var O;(O=h.current)==null||O.focus()}else{const N=i?i.domReference:null,x=pa(N);x==null||x.focus(),i!=null&&i.closeOnFocusOut&&(i==null||i.onOpenChange(!1,y.nativeEvent,"focus-out"))}}})]})}const va=()=>D.useContext(ga),mo="data-floating-ui-focusable";function Ns(e){return e?e.hasAttribute(mo)?e:e.querySelector("["+mo+"]")||e:null}function Ls(e){return D.useMemo(()=>t=>{e.forEach(n=>{n&&(n.current=t)})},e)}const ju=20;let Mt=[];function Bu(e){Mt=Mt.filter(t=>t.isConnected),e&&At(e)!=="body"&&(Mt.push(e),Mt.length>ju&&(Mt=Mt.slice(-20)))}function $s(){return Mt.slice().reverse().find(e=>e.isConnected)}function Hu(e){const t=Pr();return Kc(e,t)?e:Tr(e,t)[0]||e}const Uu=D.forwardRef(function(t,n){return $.jsx("button",{...t,type:"button",ref:n,tabIndex:-1,style:Mr})});function ya(e){const{context:t,children:n,disabled:r=!1,order:o=["content"],guards:s=!0,initialFocus:i=0,returnFocus:a=!0,restoreFocus:l=!1,modal:u=!0,visuallyHiddenDismiss:d=!1,closeOnFocusOut:h=!0,outsideElementsInert:E=!1,getInsideElements:p=()=>[]}=e,{open:g,onOpenChange:y,events:O,dataRef:N,elements:{domReference:x,floating:I}}=t,B=tt(()=>{var Z;return(Z=N.current.floatingContext)==null?void 0:Z.nodeId}),U=tt(p),H=typeof i=="number"&&i<0,W=xs(x)&&H,c=Iu(),f=c?s:!0,b=!f||c&&E,w=Vr(o),R=Vr(i),A=Vr(a),k=_o(),m=va(),S=D.useRef(null),F=D.useRef(null),v=D.useRef(!1),M=D.useRef(!1),P=D.useRef(-1),L=m!=null,j=Ns(I),z=tt(function(Z){return Z===void 0&&(Z=j),Z?Tr(Z,Pr()):[]}),q=tt(Z=>{const G=z(Z);return w.current.map(_=>x&&_==="reference"?x:j&&_==="floating"?j:G).filter(Boolean).flat()});D.useEffect(()=>{if(r||!u)return;function Z(_){if(_.key==="Tab"){Ie(j,Pt(De(j)))&&z().length===0&&!W&&Wr(_);const J=q(),ne=Dt(_);w.current[0]==="reference"&&ne===x&&(Wr(_),_.shiftKey?Jt(J[J.length-1]):Jt(J[1])),w.current[1]==="floating"&&ne===j&&_.shiftKey&&(Wr(_),Jt(J[0]))}}const G=De(j);return G.addEventListener("keydown",Z),()=>{G.removeEventListener("keydown",Z)}},[r,x,j,u,w,W,z,q]),D.useEffect(()=>{if(r||!I)return;function Z(G){const _=Dt(G),ne=z().indexOf(_);ne!==-1&&(P.current=ne)}return I.addEventListener("focusin",Z),()=>{I.removeEventListener("focusin",Z)}},[r,I,z]),D.useEffect(()=>{if(r||!h)return;function Z(){M.current=!0,setTimeout(()=>{M.current=!1})}function G(_){const J=_.relatedTarget;queueMicrotask(()=>{const ne=B(),Pe=!(Ie(x,J)||Ie(I,J)||Ie(J,I)||Ie(m==null?void 0:m.portalNode,J)||J!=null&&J.hasAttribute(jn("focus-guard"))||k&&(Mn(k.nodesRef.current,ne).find(Oe=>{var me,Ee;return Ie((me=Oe.context)==null?void 0:me.elements.floating,J)||Ie((Ee=Oe.context)==null?void 0:Ee.elements.domReference,J)})||Ps(k.nodesRef.current,ne).find(Oe=>{var me,Ee,Ce;return[(me=Oe.context)==null?void 0:me.elements.floating,Ns((Ee=Oe.context)==null?void 0:Ee.elements.floating)].includes(J)||((Ce=Oe.context)==null?void 0:Ce.elements.domReference)===J})));if(l&&Pe&&Pt(De(j))===De(j).body){be(j)&&j.focus();const Oe=P.current,me=z(),Ee=me[Oe]||me[me.length-1]||j;be(Ee)&&Ee.focus()}(W||!u)&&J&&Pe&&!M.current&&J!==$s()&&(v.current=!0,y(!1,_,"focus-out"))})}if(I&&be(x))return x.addEventListener("focusout",G),x.addEventListener("pointerdown",Z),I.addEventListener("focusout",G),()=>{x.removeEventListener("focusout",G),x.removeEventListener("pointerdown",Z),I.removeEventListener("focusout",G)}},[r,x,I,j,u,k,m,y,h,l,z,W,B]);const V=D.useRef(null),X=D.useRef(null),ee=Ls([V,m==null?void 0:m.beforeInsideRef]),ae=Ls([X,m==null?void 0:m.afterInsideRef]);D.useEffect(()=>{var Z,G;if(r||!I)return;const _=Array.from((m==null||(Z=m.portalNode)==null?void 0:Z.querySelectorAll("["+jn("portal")+"]"))||[]),J=k?Ps(k.nodesRef.current,B()):[],ne=k&&!u?J.map(Ee=>{var Ce;return(Ce=Ee.context)==null?void 0:Ce.elements.floating}):[],Pe=(G=J.find(Ee=>{var Ce;return xs(((Ce=Ee.context)==null?void 0:Ce.elements.domReference)||null)}))==null||(G=G.context)==null?void 0:G.elements.domReference,Oe=[I,Pe,..._,...ne,...U(),S.current,F.current,V.current,X.current,m==null?void 0:m.beforeOutsideRef.current,m==null?void 0:m.afterOutsideRef.current,w.current.includes("reference")||W?x:null].filter(Ee=>Ee!=null),me=u||W?Ms(Oe,!b,b):Ms(Oe);return()=>{me()}},[r,x,I,u,w,m,W,f,b,k,B,U]),Ne(()=>{if(r||!be(j))return;const Z=De(j),G=Pt(Z);queueMicrotask(()=>{const _=q(j),J=R.current,ne=(typeof J=="number"?_[J]:J.current)||j,Pe=Ie(j,G);!H&&!Pe&&g&&Jt(ne,{preventScroll:ne===j})})},[r,g,j,H,q,R]),Ne(()=>{if(r||!j)return;let Z=!1,G=!1;const _=De(j),J=Pt(_);let Pe=N.current.openEvent;Bu(J);function Oe(Ce){let{open:Zn,reason:Cn,event:Ye,nested:er}=Ce;if(Zn&&(Pe=Ye),Cn==="escape-key"&&(G=!0),["hover","safe-polygon"].includes(Cn)&&Ye.type==="mouseleave"&&(v.current=!0),Cn==="outside-press")if(er)v.current=!1,Z=!0;else if(gc(Ye)||bc(Ye))v.current=!1;else{let us=!1;document.createElement("div").focus({get preventScroll(){return us=!0,!1}}),us?(v.current=!1,Z=!0):v.current=!0}}O.on("openchange",Oe);const me=_.createElement("span");me.setAttribute("tabindex","-1"),me.setAttribute("aria-hidden","true"),Object.assign(me.style,Mr),L&&x&&x.insertAdjacentElement("afterend",me);function Ee(){return typeof A.current=="boolean"?G&&x?x:$s()||me:A.current.current||me}return()=>{O.off("openchange",Oe);const Ce=Pt(_),Zn=Ie(I,Ce)||k&&Mn(k.nodesRef.current,B()).some(Ye=>{var er;return Ie((er=Ye.context)==null?void 0:er.elements.floating,Ce)});(Zn||Pe&&["click","mousedown"].includes(Pe.type))&&(G=!0);const Cn=Ee();queueMicrotask(()=>{const Ye=Hu(Cn);A.current&&!v.current&&be(Ye)&&(!(Ye!==Ce&&Ce!==_.body)||Zn)&&Ye.focus({preventScroll:Z}),me.remove()})}},[r,I,j,A,N,O,k,L,x,B]),D.useEffect(()=>{queueMicrotask(()=>{v.current=!1})},[r]),Ne(()=>{if(!r&&m)return m.setFocusManagerState({modal:u,closeOnFocusOut:h,open:g,onOpenChange:y,domReference:x}),()=>{m.setFocusManagerState(null)}},[r,m,u,g,y,h,x]),Ne(()=>{if(r||!j||typeof MutationObserver!="function"||H)return;const Z=()=>{const _=j.getAttribute("tabindex"),J=z(),ne=Pt(De(I)),Pe=J.indexOf(ne);Pe!==-1&&(P.current=Pe),w.current.includes("floating")||ne!==x&&J.length===0?_!=="0"&&j.setAttribute("tabindex","0"):_!=="-1"&&j.setAttribute("tabindex","-1")};Z();const G=new MutationObserver(Z);return G.observe(j,{childList:!0,subtree:!0,attributes:!0}),()=>{G.disconnect()}},[r,I,j,x,w,z,H]);function de(Z){return r||!d||!u?null:$.jsx(Uu,{ref:Z==="start"?S:F,onClick:G=>y(!1,G.nativeEvent),children:typeof d=="string"?d:"Dismiss"})}const pe=!r&&f&&(u?!W:!0)&&(L||u);return $.jsxs($.Fragment,{children:[pe&&$.jsx(wr,{"data-type":"inside",ref:ee,onFocus:Z=>{if(u){const _=q();Jt(o[0]==="reference"?_[0]:_[_.length-1])}else if(m!=null&&m.preserveTabOrder&&m.portalNode)if(v.current=!1,In(Z,m.portalNode)){const _=pa(x);_==null||_.focus()}else{var G;(G=m.beforeOutsideRef.current)==null||G.focus()}}}),!W&&de("start"),n,de("end"),pe&&$.jsx(wr,{"data-type":"inside",ref:ae,onFocus:Z=>{if(u)Jt(q()[0]);else if(m!=null&&m.preserveTabOrder&&m.portalNode)if(h&&(v.current=!0),In(Z,m.portalNode)){const _=ma(x);_==null||_.focus()}else{var G;(G=m.afterOutsideRef.current)==null||G.focus()}}})]})}let lr=0;function Wu(){const e=/iP(hone|ad|od)|iOS/.test(qi()),t=document.body.style,r=Math.round(document.documentElement.getBoundingClientRect().left)+document.documentElement.scrollLeft?"paddingLeft":"paddingRight",o=window.innerWidth-document.documentElement.clientWidth,s=t.left?parseFloat(t.left):window.scrollX,i=t.top?parseFloat(t.top):window.scrollY;if(t.overflow="hidden",o&&(t[r]=o+"px"),e){var a,l;const u=((a=window.visualViewport)==null?void 0:a.offsetLeft)||0,d=((l=window.visualViewport)==null?void 0:l.offsetTop)||0;Object.assign(t,{position:"fixed",top:-(i-Math.floor(d))+"px",left:-(s-Math.floor(u))+"px",right:"0"})}return()=>{Object.assign(t,{overflow:"",[r]:""}),e&&(Object.assign(t,{position:"",top:"",left:"",right:""}),window.scrollTo(s,i))}}let js=()=>{};const qu=D.forwardRef(function(t,n){const{lockScroll:r=!1,...o}=t;return Ne(()=>{if(r)return lr++,lr===1&&(js=Wu()),()=>{lr--,lr===0&&js()}},[r]),$.jsx("div",{ref:n,...o,style:{position:"fixed",overflow:"auto",top:0,right:0,bottom:0,left:0,...o.style}})});function Bs(e){return be(e.target)&&e.target.tagName==="BUTTON"}function zu(e){return be(e.target)&&e.target.tagName==="A"}function Hs(e){return Gi(e)}function wa(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,dataRef:o,elements:{domReference:s}}=e,{enabled:i=!0,event:a="click",toggle:l=!0,ignoreMouse:u=!1,keyboardHandlers:d=!0,stickIfOpen:h=!0}=t,E=D.useRef(),p=D.useRef(!1),g=D.useMemo(()=>({onPointerDown(y){E.current=y.pointerType},onMouseDown(y){const O=E.current;y.button===0&&a!=="click"&&(ws(O)&&u||(n&&l&&(!(o.current.openEvent&&h)||o.current.openEvent.type==="mousedown")?r(!1,y.nativeEvent,"click"):(y.preventDefault(),r(!0,y.nativeEvent,"click"))))},onClick(y){const O=E.current;if(a==="mousedown"&&E.current){E.current=void 0;return}ws(O)&&u||(n&&l&&(!(o.current.openEvent&&h)||o.current.openEvent.type==="click")?r(!1,y.nativeEvent,"click"):r(!0,y.nativeEvent,"click"))},onKeyDown(y){E.current=void 0,!(y.defaultPrevented||!d||Bs(y))&&(y.key===" "&&!Hs(s)&&(y.preventDefault(),p.current=!0),!zu(y)&&y.key==="Enter"&&r(!(n&&l),y.nativeEvent,"click"))},onKeyUp(y){y.defaultPrevented||!d||Bs(y)||Hs(s)||y.key===" "&&p.current&&(p.current=!1,r(!(n&&l),y.nativeEvent,"click"))}}),[o,s,a,u,d,r,n,h,l]);return D.useMemo(()=>i?{reference:g}:{},[i,g])}const Gu={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},Vu={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},Us=e=>{var t,n;return{escapeKey:typeof e=="boolean"?e:(t=e==null?void 0:e.escapeKey)!=null?t:!1,outsidePress:typeof e=="boolean"?e:(n=e==null?void 0:e.outsidePress)!=null?n:!0}};function xa(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,elements:o,dataRef:s}=e,{enabled:i=!0,escapeKey:a=!0,outsidePress:l=!0,outsidePressEvent:u="pointerdown",referencePress:d=!1,referencePressEvent:h="pointerdown",ancestorScroll:E=!1,bubbles:p,capture:g}=t,y=_o(),O=tt(typeof l=="function"?l:()=>!1),N=typeof l=="function"?O:l,x=D.useRef(!1),I=D.useRef(!1),{escapeKey:B,outsidePress:U}=Us(p),{escapeKey:H,outsidePress:W}=Us(g),c=D.useRef(!1),f=tt(m=>{var S;if(!n||!i||!a||m.key!=="Escape"||c.current)return;const F=(S=s.current.floatingContext)==null?void 0:S.nodeId,v=y?Mn(y.nodesRef.current,F):[];if(!B&&(m.stopPropagation(),v.length>0)){let M=!0;if(v.forEach(P=>{var L;if((L=P.context)!=null&&L.open&&!P.context.dataRef.current.__escapeKeyBubbles){M=!1;return}}),!M)return}r(!1,wc(m)?m.nativeEvent:m,"escape-key")}),b=tt(m=>{var S;const F=()=>{var v;f(m),(v=Dt(m))==null||v.removeEventListener("keydown",F)};(S=Dt(m))==null||S.addEventListener("keydown",F)}),w=tt(m=>{var S;const F=x.current;x.current=!1;const v=I.current;if(I.current=!1,u==="click"&&v||F||typeof N=="function"&&!N(m))return;const M=Dt(m),P="["+jn("inert")+"]",L=De(o.floating).querySelectorAll(P);let j=ue(M)?M:null;for(;j&&!ut(j);){const X=ht(j);if(ut(X)||!ue(X))break;j=X}if(L.length&&ue(M)&&!xc(M)&&!Ie(M,o.floating)&&Array.from(L).every(X=>!Ie(j,X)))return;if(be(M)&&k){const X=ut(M),ee=qe(M),ae=/auto|scroll/,de=X||ae.test(ee.overflowX),pe=X||ae.test(ee.overflowY),Z=de&&M.clientWidth>0&&M.scrollWidth>M.clientWidth,G=pe&&M.clientHeight>0&&M.scrollHeight>M.clientHeight,_=ee.direction==="rtl",J=G&&(_?m.offsetX<=M.offsetWidth-M.clientWidth:m.offsetX>M.clientWidth),ne=Z&&m.offsetY>M.clientHeight;if(J||ne)return}const z=(S=s.current.floatingContext)==null?void 0:S.nodeId,q=y&&Mn(y.nodesRef.current,z).some(X=>{var ee;return Ur(m,(ee=X.context)==null?void 0:ee.elements.floating)});if(Ur(m,o.floating)||Ur(m,o.domReference)||q)return;const V=y?Mn(y.nodesRef.current,z):[];if(V.length>0){let X=!0;if(V.forEach(ee=>{var ae;if((ae=ee.context)!=null&&ae.open&&!ee.context.dataRef.current.__outsidePressBubbles){X=!1;return}}),!X)return}r(!1,m,"outside-press")}),R=tt(m=>{var S;const F=()=>{var v;w(m),(v=Dt(m))==null||v.removeEventListener(u,F)};(S=Dt(m))==null||S.addEventListener(u,F)});D.useEffect(()=>{if(!n||!i)return;s.current.__escapeKeyBubbles=B,s.current.__outsidePressBubbles=U;let m=-1;function S(L){r(!1,L,"ancestor-scroll")}function F(){window.clearTimeout(m),c.current=!0}function v(){m=window.setTimeout(()=>{c.current=!1},Ar()?5:0)}const M=De(o.floating);a&&(M.addEventListener("keydown",H?b:f,H),M.addEventListener("compositionstart",F),M.addEventListener("compositionend",v)),N&&M.addEventListener(u,W?R:w,W);let P=[];return E&&(ue(o.domReference)&&(P=Ct(o.domReference)),ue(o.floating)&&(P=P.concat(Ct(o.floating))),!ue(o.reference)&&o.reference&&o.reference.contextElement&&(P=P.concat(Ct(o.reference.contextElement)))),P=P.filter(L=>{var j;return L!==((j=M.defaultView)==null?void 0:j.visualViewport)}),P.forEach(L=>{L.addEventListener("scroll",S,{passive:!0})}),()=>{a&&(M.removeEventListener("keydown",H?b:f,H),M.removeEventListener("compositionstart",F),M.removeEventListener("compositionend",v)),N&&M.removeEventListener(u,W?R:w,W),P.forEach(L=>{L.removeEventListener("scroll",S)}),window.clearTimeout(m)}},[s,o,a,N,u,n,r,E,i,B,U,f,H,b,w,W,R]),D.useEffect(()=>{x.current=!1},[N,u]);const A=D.useMemo(()=>({onKeyDown:f,...d&&{[Gu[h]]:m=>{r(!1,m.nativeEvent,"reference-press")},...h!=="click"&&{onClick(m){r(!1,m.nativeEvent,"reference-press")}}}}),[f,r,d,h]),k=D.useMemo(()=>({onKeyDown:f,onMouseDown(){I.current=!0},onMouseUp(){I.current=!0},[Vu[u]]:()=>{x.current=!0}}),[f,u]);return D.useMemo(()=>i?{reference:A,floating:k}:{},[i,A,k])}function _u(e){const{open:t=!1,onOpenChange:n,elements:r}=e,o=vn(),s=D.useRef({}),[i]=D.useState(()=>Fu()),a=fa()!=null;if(process.env.NODE_ENV!=="production"){const p=r.reference;p&&!ue(p)&&Tu("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[l,u]=D.useState(r.reference),d=tt((p,g,y)=>{s.current.openEvent=p?g:void 0,i.emit("openchange",{open:p,event:g,reason:y,nested:a}),n==null||n(p,g,y)}),h=D.useMemo(()=>({setPositionReference:u}),[]),E=D.useMemo(()=>({reference:l||r.reference||null,floating:r.floating||null,domReference:r.reference}),[l,r.reference,r.floating]);return D.useMemo(()=>({dataRef:s,open:t,onOpenChange:d,elements:E,events:i,floatingId:o,refs:h}),[t,d,E,i,o,h])}function Ea(e){e===void 0&&(e={});const{nodeId:t}=e,n=_u({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,o=r.elements,[s,i]=D.useState(null),[a,l]=D.useState(null),d=(o==null?void 0:o.domReference)||s,h=D.useRef(null),E=_o();Ne(()=>{d&&(h.current=d)},[d]);const p=aa({...e,elements:{...o,...a&&{reference:a}}}),g=D.useCallback(I=>{const B=ue(I)?{getBoundingClientRect:()=>I.getBoundingClientRect(),getClientRects:()=>I.getClientRects(),contextElement:I}:I;l(B),p.refs.setReference(B)},[p.refs]),y=D.useCallback(I=>{(ue(I)||I===null)&&(h.current=I,i(I)),(ue(p.refs.reference.current)||p.refs.reference.current===null||I!==null&&!ue(I))&&p.refs.setReference(I)},[p.refs]),O=D.useMemo(()=>({...p.refs,setReference:y,setPositionReference:g,domReference:h}),[p.refs,y,g]),N=D.useMemo(()=>({...p.elements,domReference:d}),[p.elements,d]),x=D.useMemo(()=>({...p,...r,refs:O,elements:N,nodeId:t}),[p,O,N,t,r]);return Ne(()=>{r.dataRef.current.floatingContext=x;const I=E==null?void 0:E.nodesRef.current.find(B=>B.id===t);I&&(I.context=x)}),D.useMemo(()=>({...p,context:x,refs:O,elements:N}),[p,O,N,x])}const Ws="active",qs="selected";function Qr(e,t,n){const r=new Map,o=n==="item";let s=e;if(o&&e){const{[Ws]:i,[qs]:a,...l}=e;s=l}return{...n==="floating"&&{tabIndex:-1,[mo]:""},...s,...t.map(i=>{const a=i?i[n]:null;return typeof a=="function"?e?a(e):null:a}).concat(e).reduce((i,a)=>(a&&Object.entries(a).forEach(l=>{let[u,d]=l;if(!(o&&[Ws,qs].includes(u)))if(u.indexOf("on")===0){if(r.has(u)||r.set(u,[]),typeof d=="function"){var h;(h=r.get(u))==null||h.push(d),i[u]=function(){for(var E,p=arguments.length,g=new Array(p),y=0;y<p;y++)g[y]=arguments[y];return(E=r.get(u))==null?void 0:E.map(O=>O(...g)).find(O=>O!==void 0)}}}else i[u]=d}),i),{})}}function Ra(e){e===void 0&&(e=[]);const t=e.map(a=>a==null?void 0:a.reference),n=e.map(a=>a==null?void 0:a.floating),r=e.map(a=>a==null?void 0:a.item),o=D.useCallback(a=>Qr(a,e,"reference"),t),s=D.useCallback(a=>Qr(a,e,"floating"),n),i=D.useCallback(a=>Qr(a,e,"item"),r);return D.useMemo(()=>({getReferenceProps:o,getFloatingProps:s,getItemProps:i}),[o,s,i])}const Qu=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function Ku(e,t){var n;t===void 0&&(t={});const{open:r,floatingId:o}=e,{enabled:s=!0,role:i="dialog"}=t,a=(n=Qu.get(i))!=null?n:i,l=vn(),d=fa()!=null,h=D.useMemo(()=>a==="tooltip"||i==="label"?{["aria-"+(i==="label"?"labelledby":"describedby")]:r?o:void 0}:{"aria-expanded":r?"true":"false","aria-haspopup":a==="alertdialog"?"dialog":a,"aria-controls":r?o:void 0,...a==="listbox"&&{role:"combobox"},...a==="menu"&&{id:l},...a==="menu"&&d&&{role:"menuitem"},...i==="select"&&{"aria-autocomplete":"none"},...i==="combobox"&&{"aria-autocomplete":"list"}},[a,o,d,r,l,i]),E=D.useMemo(()=>{const g={id:o,...a&&{role:a}};return a==="tooltip"||i==="label"?g:{...g,...a==="menu"&&{"aria-labelledby":l}}},[a,o,l,i]),p=D.useCallback(g=>{let{active:y,selected:O}=g;const N={role:"option",...y&&{id:o+"-option"}};switch(i){case"select":return{...N,"aria-selected":y&&O};case"combobox":return{...N,...y&&{"aria-selected":!0}}}return{}},[o,i]);return D.useMemo(()=>s?{reference:h,floating:E,item:p}:{},[s,h,E,p])}function Sa({wallets:e,handleWalletClick:t}){return $.jsxs("ul",{className:"space-y-1.5","data-wallet-ui":!0,children:[e.map(n=>$.jsx("li",{children:$.jsxs("button",{onClick:()=>t(n),className:"flex w-full items-center gap-3 py-1.5 px-1.5 text-left text-gray-800 dark:text-[#E9E9FD] transition-colors hover:bg-[#E9E9FD] dark:hover:bg-[#192A39] rounded-xl",children:[$.jsx("div",{className:"flex-shrink-0 h-8 w-8 rounded-md overflow-hidden bg-gray-50 dark:bg-transparent flex items-center justify-center",children:$.jsx("img",{src:n.metadata.icon,alt:`${n.metadata.name} icon`,className:"h-8 w-8 object-contain rounded-md"})}),$.jsx("span",{className:"text-lg font-bold wallet-custom-font",children:n.metadata.name})]})},n.id)),e.length===0&&$.jsx("p",{className:"text-center text-gray-500 dark:text-gray-400",children:"No wallets found."})]})}function Ca({children:e}){const[t,n]=C.useState(!1),[r,o]=C.useState(null),{wallets:s,activeAddress:i}=dt.useWallet(),{refs:a,context:l}=Ea({open:t,onOpenChange:H=>{H&&i||(H?(n(!0),o("starting"),requestAnimationFrame(()=>{o("entered")})):(o("exiting"),setTimeout(()=>{n(!1),o(null)},150)))}}),u=wa(l),d=xa(l,{outsidePressEvent:"mousedown"}),h=Ku(l,{role:"dialog"}),{getReferenceProps:E,getFloatingProps:p}=Ra([u,d,h]),g=vn(),y=vn(),O=async H=>{try{await H.connect(),l.onOpenChange(!1)}catch(W){console.error(`Error connecting to ${H.metadata.name}:`,W),l.onOpenChange(!1)}},N=H=>{i||l.onOpenChange(!0)},x=e||$.jsx(Wo,{}),I=Ru([a.setReference,x.ref||null]),B={...E(),ref:I,onClick:N},U=C.cloneElement(x,B);return $.jsxs($.Fragment,{children:[U,$.jsx(ba,{id:"wallet-dialog-portal","data-wallet-ui":!0,children:t&&$.jsx(qu,{className:"grid place-items-center px-4 z-50 transition-opacity duration-150 ease-in-out bg-black/30 dark:bg-black/50 data-[state=starting]:opacity-0 data-[state=exiting]:opacity-0 data-[state=entered]:opacity-100","data-state":r,lockScroll:!0,children:$.jsx(ya,{context:l,modal:!0,children:$.jsxs("div",{ref:a.setFloating,...p({"aria-labelledby":g,"aria-describedby":y}),"data-state":r,className:"w-full max-w-sm rounded-3xl bg-white dark:bg-[#001324] shadow-xl transform transition-all duration-150 ease-in-out data-[state=starting]:opacity-0 data-[state=starting]:scale-90 data-[state=exiting]:opacity-0 data-[state=exiting]:scale-90 data-[state=entered]:opacity-100 data-[state=entered]:scale-100",style:{marginTop:"-0.5rem"},children:[$.jsxs("div",{className:"relative flex items-center px-6 pt-5 pb-4",children:[$.jsx("h2",{id:g,className:"text-xl font-bold text-gray-900 dark:text-[#E9E9FD] wallet-custom-font",children:"Connect a Wallet"}),$.jsx("button",{onClick:()=>l.onOpenChange(!1),className:"absolute right-4 rounded-full bg-gray-100 dark:bg-[#192A39]/75 p-2 text-gray-500 dark:text-gray-400 hover:bg-gray-200 dark:hover:bg-[#192A39] hover:text-gray-700 dark:hover:text-[#D4D4FA]","aria-label":"Close dialog",children:$.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor",children:$.jsx("path",{fillRule:"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z",clipRule:"evenodd"})})})]}),$.jsx("div",{className:"px-4 pb-3",children:$.jsx(Sa,{wallets:s,handleWalletClick:O})}),$.jsxs("div",{className:"px-6 py-5 border-t border-gray-200 dark:border-[#192A39] flex items-center justify-between",children:[$.jsx("span",{className:"text-gray-600 dark:text-[#99A1A7] text-sm",children:"Need an Algorand wallet?"}),$.jsx("a",{href:"https://algorand.co/wallets",className:"text-[#2D2DF1]/80 dark:text-[#6C6CF1] font-medium text-sm hover:text-[#2D2DF1] dark:hover:text-[#8080F3]",target:"_blank",rel:"noopener noreferrer",children:"Start here →"})]})]})})})})]})}var Yu=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,Kr=Math.ceil,je=Math.floor,Te="[BigNumber Error] ",zs=Te+"Number primitive has more than 15 significant digits: ",ze=1e14,re=14,Gs=9007199254740991,Yr=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],gt=1e7,Me=1e9;function ka(e){var t,n,r,o=x.prototype={constructor:x,toString:null,valueOf:null},s=new x(1),i=20,a=4,l=-7,u=21,d=-1e7,h=1e7,E=!1,p=1,g=0,y={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},O="0123456789abcdefghijklmnopqrstuvwxyz",N=!0;function x(c,f){var b,w,R,A,k,m,S,F,v=this;if(!(v instanceof x))return new x(c,f);if(f==null){if(c&&c._isBigNumber===!0){v.s=c.s,!c.c||c.e>h?v.c=v.e=null:c.e<d?v.c=[v.e=0]:(v.e=c.e,v.c=c.c.slice());return}if((m=typeof c=="number")&&c*0==0){if(v.s=1/c<0?(c=-c,-1):1,c===~~c){for(A=0,k=c;k>=10;k/=10,A++);A>h?v.c=v.e=null:(v.e=A,v.c=[c]);return}F=String(c)}else{if(!Yu.test(F=String(c)))return r(v,F,m);v.s=F.charCodeAt(0)==45?(F=F.slice(1),-1):1}(A=F.indexOf("."))>-1&&(F=F.replace(".","")),(k=F.search(/e/i))>0?(A<0&&(A=k),A+=+F.slice(k+1),F=F.substring(0,k)):A<0&&(A=F.length)}else{if(fe(f,2,O.length,"Base"),f==10&&N)return v=new x(c),H(v,i+v.e+1,a);if(F=String(c),m=typeof c=="number"){if(c*0!=0)return r(v,F,m,f);if(v.s=1/c<0?(F=F.slice(1),-1):1,x.DEBUG&&F.replace(/^0\.0*|\./,"").length>15)throw Error(zs+c)}else v.s=F.charCodeAt(0)===45?(F=F.slice(1),-1):1;for(b=O.slice(0,f),A=k=0,S=F.length;k<S;k++)if(b.indexOf(w=F.charAt(k))<0){if(w=="."){if(k>A){A=S;continue}}else if(!R&&(F==F.toUpperCase()&&(F=F.toLowerCase())||F==F.toLowerCase()&&(F=F.toUpperCase()))){R=!0,k=-1,A=0;continue}return r(v,String(c),m,f)}m=!1,F=n(F,f,10,v.s),(A=F.indexOf("."))>-1?F=F.replace(".",""):A=F.length}for(k=0;F.charCodeAt(k)===48;k++);for(S=F.length;F.charCodeAt(--S)===48;);if(F=F.slice(k,++S)){if(S-=k,m&&x.DEBUG&&S>15&&(c>Gs||c!==je(c)))throw Error(zs+v.s*c);if((A=A-k-1)>h)v.c=v.e=null;else if(A<d)v.c=[v.e=0];else{if(v.e=A,v.c=[],k=(A+1)%re,A<0&&(k+=re),k<S){for(k&&v.c.push(+F.slice(0,k)),S-=re;k<S;)v.c.push(+F.slice(k,k+=re));k=re-(F=F.slice(k)).length}else k-=S;for(;k--;F+="0");v.c.push(+F)}}else v.c=[v.e=0]}x.clone=ka,x.ROUND_UP=0,x.ROUND_DOWN=1,x.ROUND_CEIL=2,x.ROUND_FLOOR=3,x.ROUND_HALF_UP=4,x.ROUND_HALF_DOWN=5,x.ROUND_HALF_EVEN=6,x.ROUND_HALF_CEIL=7,x.ROUND_HALF_FLOOR=8,x.EUCLID=9,x.config=x.set=function(c){var f,b;if(c!=null)if(typeof c=="object"){if(c.hasOwnProperty(f="DECIMAL_PLACES")&&(b=c[f],fe(b,0,Me,f),i=b),c.hasOwnProperty(f="ROUNDING_MODE")&&(b=c[f],fe(b,0,8,f),a=b),c.hasOwnProperty(f="EXPONENTIAL_AT")&&(b=c[f],b&&b.pop?(fe(b[0],-1e9,0,f),fe(b[1],0,Me,f),l=b[0],u=b[1]):(fe(b,-1e9,Me,f),l=-(u=b<0?-b:b))),c.hasOwnProperty(f="RANGE"))if(b=c[f],b&&b.pop)fe(b[0],-1e9,-1,f),fe(b[1],1,Me,f),d=b[0],h=b[1];else if(fe(b,-1e9,Me,f),b)d=-(h=b<0?-b:b);else throw Error(Te+f+" cannot be zero: "+b);if(c.hasOwnProperty(f="CRYPTO"))if(b=c[f],b===!!b)if(b)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))E=b;else throw E=!b,Error(Te+"crypto unavailable");else E=b;else throw Error(Te+f+" not true or false: "+b);if(c.hasOwnProperty(f="MODULO_MODE")&&(b=c[f],fe(b,0,9,f),p=b),c.hasOwnProperty(f="POW_PRECISION")&&(b=c[f],fe(b,0,Me,f),g=b),c.hasOwnProperty(f="FORMAT"))if(b=c[f],typeof b=="object")y=b;else throw Error(Te+f+" not an object: "+b);if(c.hasOwnProperty(f="ALPHABET"))if(b=c[f],typeof b=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test(b))N=b.slice(0,10)=="0123456789",O=b;else throw Error(Te+f+" invalid: "+b)}else throw Error(Te+"Object expected: "+c);return{DECIMAL_PLACES:i,ROUNDING_MODE:a,EXPONENTIAL_AT:[l,u],RANGE:[d,h],CRYPTO:E,MODULO_MODE:p,POW_PRECISION:g,FORMAT:y,ALPHABET:O}},x.isBigNumber=function(c){if(!c||c._isBigNumber!==!0)return!1;if(!x.DEBUG)return!0;var f,b,w=c.c,R=c.e,A=c.s;e:if({}.toString.call(w)=="[object Array]"){if((A===1||A===-1)&&R>=-1e9&&R<=Me&&R===je(R)){if(w[0]===0){if(R===0&&w.length===1)return!0;break e}if(f=(R+1)%re,f<1&&(f+=re),String(w[0]).length==f){for(f=0;f<w.length;f++)if(b=w[f],b<0||b>=ze||b!==je(b))break e;if(b!==0)return!0}}}else if(w===null&&R===null&&(A===null||A===1||A===-1))return!0;throw Error(Te+"Invalid BigNumber: "+c)},x.maximum=x.max=function(){return B(arguments,-1)},x.minimum=x.min=function(){return B(arguments,1)},x.random=function(){var c=9007199254740992,f=Math.random()*c&2097151?function(){return je(Math.random()*c)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(b){var w,R,A,k,m,S=0,F=[],v=new x(s);if(b==null?b=i:fe(b,0,Me),k=Kr(b/re),E)if(crypto.getRandomValues){for(w=crypto.getRandomValues(new Uint32Array(k*=2));S<k;)m=w[S]*131072+(w[S+1]>>>11),m>=9e15?(R=crypto.getRandomValues(new Uint32Array(2)),w[S]=R[0],w[S+1]=R[1]):(F.push(m%1e14),S+=2);S=k/2}else if(crypto.randomBytes){for(w=crypto.randomBytes(k*=7);S<k;)m=(w[S]&31)*281474976710656+w[S+1]*1099511627776+w[S+2]*4294967296+w[S+3]*16777216+(w[S+4]<<16)+(w[S+5]<<8)+w[S+6],m>=9e15?crypto.randomBytes(7).copy(w,S):(F.push(m%1e14),S+=7);S=k/7}else throw E=!1,Error(Te+"crypto unavailable");if(!E)for(;S<k;)m=f(),m<9e15&&(F[S++]=m%1e14);for(k=F[--S],b%=re,k&&b&&(m=Yr[re-b],F[S]=je(k/m)*m);F[S]===0;F.pop(),S--);if(S<0)F=[A=0];else{for(A=-1;F[0]===0;F.splice(0,1),A-=re);for(S=1,m=F[0];m>=10;m/=10,S++);S<re&&(A-=re-S)}return v.e=A,v.c=F,v}}(),x.sum=function(){for(var c=1,f=arguments,b=new x(f[0]);c<f.length;)b=b.plus(f[c++]);return b},n=function(){var c="0123456789";function f(b,w,R,A){for(var k,m=[0],S,F=0,v=b.length;F<v;){for(S=m.length;S--;m[S]*=w);for(m[0]+=A.indexOf(b.charAt(F++)),k=0;k<m.length;k++)m[k]>R-1&&(m[k+1]==null&&(m[k+1]=0),m[k+1]+=m[k]/R|0,m[k]%=R)}return m.reverse()}return function(b,w,R,A,k){var m,S,F,v,M,P,L,j,z=b.indexOf("."),q=i,V=a;for(z>=0&&(v=g,g=0,b=b.replace(".",""),j=new x(w),P=j.pow(b.length-z),g=v,j.c=f(at($e(P.c),P.e,"0"),10,R,c),j.e=j.c.length),L=f(b,w,R,k?(m=O,c):(m=c,O)),F=v=L.length;L[--v]==0;L.pop());if(!L[0])return m.charAt(0);if(z<0?--F:(P.c=L,P.e=F,P.s=A,P=t(P,j,q,V,R),L=P.c,M=P.r,F=P.e),S=F+q+1,z=L[S],v=R/2,M=M||S<0||L[S+1]!=null,M=V<4?(z!=null||M)&&(V==0||V==(P.s<0?3:2)):z>v||z==v&&(V==4||M||V==6&&L[S-1]&1||V==(P.s<0?8:7)),S<1||!L[0])b=M?at(m.charAt(1),-q,m.charAt(0)):m.charAt(0);else{if(L.length=S,M)for(--R;++L[--S]>R;)L[S]=0,S||(++F,L=[1].concat(L));for(v=L.length;!L[--v];);for(z=0,b="";z<=v;b+=m.charAt(L[z++]));b=at(b,F,m.charAt(0))}return b}}(),t=function(){function c(w,R,A){var k,m,S,F,v=0,M=w.length,P=R%gt,L=R/gt|0;for(w=w.slice();M--;)S=w[M]%gt,F=w[M]/gt|0,k=L*S+F*P,m=P*S+k%gt*gt+v,v=(m/A|0)+(k/gt|0)+L*F,w[M]=m%A;return v&&(w=[v].concat(w)),w}function f(w,R,A,k){var m,S;if(A!=k)S=A>k?1:-1;else for(m=S=0;m<A;m++)if(w[m]!=R[m]){S=w[m]>R[m]?1:-1;break}return S}function b(w,R,A,k){for(var m=0;A--;)w[A]-=m,m=w[A]<R[A]?1:0,w[A]=m*k+w[A]-R[A];for(;!w[0]&&w.length>1;w.splice(0,1));}return function(w,R,A,k,m){var S,F,v,M,P,L,j,z,q,V,X,ee,ae,de,pe,Z,G,_=w.s==R.s?1:-1,J=w.c,ne=R.c;if(!J||!J[0]||!ne||!ne[0])return new x(!w.s||!R.s||(J?ne&&J[0]==ne[0]:!ne)?NaN:J&&J[0]==0||!ne?_*0:_/0);for(z=new x(_),q=z.c=[],F=w.e-R.e,_=A+F+1,m||(m=ze,F=Be(w.e/re)-Be(R.e/re),_=_/re|0),v=0;ne[v]==(J[v]||0);v++);if(ne[v]>(J[v]||0)&&F--,_<0)q.push(1),M=!0;else{for(de=J.length,Z=ne.length,v=0,_+=2,P=je(m/(ne[0]+1)),P>1&&(ne=c(ne,P,m),J=c(J,P,m),Z=ne.length,de=J.length),ae=Z,V=J.slice(0,Z),X=V.length;X<Z;V[X++]=0);G=ne.slice(),G=[0].concat(G),pe=ne[0],ne[1]>=m/2&&pe++;do{if(P=0,S=f(ne,V,Z,X),S<0){if(ee=V[0],Z!=X&&(ee=ee*m+(V[1]||0)),P=je(ee/pe),P>1)for(P>=m&&(P=m-1),L=c(ne,P,m),j=L.length,X=V.length;f(L,V,j,X)==1;)P--,b(L,Z<j?G:ne,j,m),j=L.length,S=1;else P==0&&(S=P=1),L=ne.slice(),j=L.length;if(j<X&&(L=[0].concat(L)),b(V,L,X,m),X=V.length,S==-1)for(;f(ne,V,Z,X)<1;)P++,b(V,Z<X?G:ne,X,m),X=V.length}else S===0&&(P++,V=[0]);q[v++]=P,V[0]?V[X++]=J[ae]||0:(V=[J[ae]],X=1)}while((ae++<de||V[0]!=null)&&_--);M=V[0]!=null,q[0]||q.splice(0,1)}if(m==ze){for(v=1,_=q[0];_>=10;_/=10,v++);H(z,A+(z.e=v+F*re-1)+1,k,M)}else z.e=F,z.r=+M;return z}}();function I(c,f,b,w){var R,A,k,m,S;if(b==null?b=a:fe(b,0,8),!c.c)return c.toString();if(R=c.c[0],k=c.e,f==null)S=$e(c.c),S=w==1||w==2&&(k<=l||k>=u)?ur(S,k):at(S,k,"0");else if(c=H(new x(c),f,b),A=c.e,S=$e(c.c),m=S.length,w==1||w==2&&(f<=A||A<=l)){for(;m<f;S+="0",m++);S=ur(S,A)}else if(f-=k,S=at(S,A,"0"),A+1>m){if(--f>0)for(S+=".";f--;S+="0");}else if(f+=A-m,f>0)for(A+1==m&&(S+=".");f--;S+="0");return c.s<0&&R?"-"+S:S}function B(c,f){for(var b,w,R=1,A=new x(c[0]);R<c.length;R++)w=new x(c[R]),(!w.s||(b=Ft(A,w))===f||b===0&&A.s===f)&&(A=w);return A}function U(c,f,b){for(var w=1,R=f.length;!f[--R];f.pop());for(R=f[0];R>=10;R/=10,w++);return(b=w+b*re-1)>h?c.c=c.e=null:b<d?c.c=[c.e=0]:(c.e=b,c.c=f),c}r=function(){var c=/^(-?)0([xbo])(?=\w[\w.]*$)/i,f=/^([^.]+)\.$/,b=/^\.([^.]+)$/,w=/^-?(Infinity|NaN)$/,R=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(A,k,m,S){var F,v=m?k:k.replace(R,"");if(w.test(v))A.s=isNaN(v)?null:v<0?-1:1;else{if(!m&&(v=v.replace(c,function(M,P,L){return F=(L=L.toLowerCase())=="x"?16:L=="b"?2:8,!S||S==F?P:M}),S&&(F=S,v=v.replace(f,"$1").replace(b,"0.$1")),k!=v))return new x(v,F);if(x.DEBUG)throw Error(Te+"Not a"+(S?" base "+S:"")+" number: "+k);A.s=null}A.c=A.e=null}}();function H(c,f,b,w){var R,A,k,m,S,F,v,M=c.c,P=Yr;if(M){e:{for(R=1,m=M[0];m>=10;m/=10,R++);if(A=f-R,A<0)A+=re,k=f,S=M[F=0],v=je(S/P[R-k-1]%10);else if(F=Kr((A+1)/re),F>=M.length)if(w){for(;M.length<=F;M.push(0));S=v=0,R=1,A%=re,k=A-re+1}else break e;else{for(S=m=M[F],R=1;m>=10;m/=10,R++);A%=re,k=A-re+R,v=k<0?0:je(S/P[R-k-1]%10)}if(w=w||f<0||M[F+1]!=null||(k<0?S:S%P[R-k-1]),w=b<4?(v||w)&&(b==0||b==(c.s<0?3:2)):v>5||v==5&&(b==4||w||b==6&&(A>0?k>0?S/P[R-k]:0:M[F-1])%10&1||b==(c.s<0?8:7)),f<1||!M[0])return M.length=0,w?(f-=c.e+1,M[0]=P[(re-f%re)%re],c.e=-f||0):M[0]=c.e=0,c;if(A==0?(M.length=F,m=1,F--):(M.length=F+1,m=P[re-A],M[F]=k>0?je(S/P[R-k]%P[k])*m:0),w)for(;;)if(F==0){for(A=1,k=M[0];k>=10;k/=10,A++);for(k=M[0]+=m,m=1;k>=10;k/=10,m++);A!=m&&(c.e++,M[0]==ze&&(M[0]=1));break}else{if(M[F]+=m,M[F]!=ze)break;M[F--]=0,m=1}for(A=M.length;M[--A]===0;M.pop());}c.e>h?c.c=c.e=null:c.e<d&&(c.c=[c.e=0])}return c}function W(c){var f,b=c.e;return b===null?c.toString():(f=$e(c.c),f=b<=l||b>=u?ur(f,b):at(f,b,"0"),c.s<0?"-"+f:f)}return o.absoluteValue=o.abs=function(){var c=new x(this);return c.s<0&&(c.s=1),c},o.comparedTo=function(c,f){return Ft(this,new x(c,f))},o.decimalPlaces=o.dp=function(c,f){var b,w,R,A=this;if(c!=null)return fe(c,0,Me),f==null?f=a:fe(f,0,8),H(new x(A),c+A.e+1,f);if(!(b=A.c))return null;if(w=((R=b.length-1)-Be(this.e/re))*re,R=b[R])for(;R%10==0;R/=10,w--);return w<0&&(w=0),w},o.dividedBy=o.div=function(c,f){return t(this,new x(c,f),i,a)},o.dividedToIntegerBy=o.idiv=function(c,f){return t(this,new x(c,f),0,1)},o.exponentiatedBy=o.pow=function(c,f){var b,w,R,A,k,m,S,F,v,M=this;if(c=new x(c),c.c&&!c.isInteger())throw Error(Te+"Exponent not an integer: "+W(c));if(f!=null&&(f=new x(f)),m=c.e>14,!M.c||!M.c[0]||M.c[0]==1&&!M.e&&M.c.length==1||!c.c||!c.c[0])return v=new x(Math.pow(+W(M),m?c.s*(2-cr(c)):+W(c))),f?v.mod(f):v;if(S=c.s<0,f){if(f.c?!f.c[0]:!f.s)return new x(NaN);w=!S&&M.isInteger()&&f.isInteger(),w&&(M=M.mod(f))}else{if(c.e>9&&(M.e>0||M.e<-1||(M.e==0?M.c[0]>1||m&&M.c[1]>=24e7:M.c[0]<8e13||m&&M.c[0]<=9999975e7)))return A=M.s<0&&cr(c)?-0:0,M.e>-1&&(A=1/A),new x(S?1/A:A);g&&(A=Kr(g/re+2))}for(m?(b=new x(.5),S&&(c.s=1),F=cr(c)):(R=Math.abs(+W(c)),F=R%2),v=new x(s);;){if(F){if(v=v.times(M),!v.c)break;A?v.c.length>A&&(v.c.length=A):w&&(v=v.mod(f))}if(R){if(R=je(R/2),R===0)break;F=R%2}else if(c=c.times(b),H(c,c.e+1,1),c.e>14)F=cr(c);else{if(R=+W(c),R===0)break;F=R%2}M=M.times(M),A?M.c&&M.c.length>A&&(M.c.length=A):w&&(M=M.mod(f))}return w?v:(S&&(v=s.div(v)),f?v.mod(f):A?H(v,g,a,k):v)},o.integerValue=function(c){var f=new x(this);return c==null?c=a:fe(c,0,8),H(f,f.e+1,c)},o.isEqualTo=o.eq=function(c,f){return Ft(this,new x(c,f))===0},o.isFinite=function(){return!!this.c},o.isGreaterThan=o.gt=function(c,f){return Ft(this,new x(c,f))>0},o.isGreaterThanOrEqualTo=o.gte=function(c,f){return(f=Ft(this,new x(c,f)))===1||f===0},o.isInteger=function(){return!!this.c&&Be(this.e/re)>this.c.length-2},o.isLessThan=o.lt=function(c,f){return Ft(this,new x(c,f))<0},o.isLessThanOrEqualTo=o.lte=function(c,f){return(f=Ft(this,new x(c,f)))===-1||f===0},o.isNaN=function(){return!this.s},o.isNegative=function(){return this.s<0},o.isPositive=function(){return this.s>0},o.isZero=function(){return!!this.c&&this.c[0]==0},o.minus=function(c,f){var b,w,R,A,k=this,m=k.s;if(c=new x(c,f),f=c.s,!m||!f)return new x(NaN);if(m!=f)return c.s=-f,k.plus(c);var S=k.e/re,F=c.e/re,v=k.c,M=c.c;if(!S||!F){if(!v||!M)return v?(c.s=-f,c):new x(M?k:NaN);if(!v[0]||!M[0])return M[0]?(c.s=-f,c):new x(v[0]?k:a==3?-0:0)}if(S=Be(S),F=Be(F),v=v.slice(),m=S-F){for((A=m<0)?(m=-m,R=v):(F=S,R=M),R.reverse(),f=m;f--;R.push(0));R.reverse()}else for(w=(A=(m=v.length)<(f=M.length))?m:f,m=f=0;f<w;f++)if(v[f]!=M[f]){A=v[f]<M[f];break}if(A&&(R=v,v=M,M=R,c.s=-c.s),f=(w=M.length)-(b=v.length),f>0)for(;f--;v[b++]=0);for(f=ze-1;w>m;){if(v[--w]<M[w]){for(b=w;b&&!v[--b];v[b]=f);--v[b],v[w]+=ze}v[w]-=M[w]}for(;v[0]==0;v.splice(0,1),--F);return v[0]?U(c,v,F):(c.s=a==3?-1:1,c.c=[c.e=0],c)},o.modulo=o.mod=function(c,f){var b,w,R=this;return c=new x(c,f),!R.c||!c.s||c.c&&!c.c[0]?new x(NaN):!c.c||R.c&&!R.c[0]?new x(R):(p==9?(w=c.s,c.s=1,b=t(R,c,0,3),c.s=w,b.s*=w):b=t(R,c,0,p),c=R.minus(b.times(c)),!c.c[0]&&p==1&&(c.s=R.s),c)},o.multipliedBy=o.times=function(c,f){var b,w,R,A,k,m,S,F,v,M,P,L,j,z,q,V=this,X=V.c,ee=(c=new x(c,f)).c;if(!X||!ee||!X[0]||!ee[0])return!V.s||!c.s||X&&!X[0]&&!ee||ee&&!ee[0]&&!X?c.c=c.e=c.s=null:(c.s*=V.s,!X||!ee?c.c=c.e=null:(c.c=[0],c.e=0)),c;for(w=Be(V.e/re)+Be(c.e/re),c.s*=V.s,S=X.length,M=ee.length,S<M&&(j=X,X=ee,ee=j,R=S,S=M,M=R),R=S+M,j=[];R--;j.push(0));for(z=ze,q=gt,R=M;--R>=0;){for(b=0,P=ee[R]%q,L=ee[R]/q|0,k=S,A=R+k;A>R;)F=X[--k]%q,v=X[k]/q|0,m=L*F+v*P,F=P*F+m%q*q+j[A]+b,b=(F/z|0)+(m/q|0)+L*v,j[A--]=F%z;j[A]=b}return b?++w:j.splice(0,1),U(c,j,w)},o.negated=function(){var c=new x(this);return c.s=-c.s||null,c},o.plus=function(c,f){var b,w=this,R=w.s;if(c=new x(c,f),f=c.s,!R||!f)return new x(NaN);if(R!=f)return c.s=-f,w.minus(c);var A=w.e/re,k=c.e/re,m=w.c,S=c.c;if(!A||!k){if(!m||!S)return new x(R/0);if(!m[0]||!S[0])return S[0]?c:new x(m[0]?w:R*0)}if(A=Be(A),k=Be(k),m=m.slice(),R=A-k){for(R>0?(k=A,b=S):(R=-R,b=m),b.reverse();R--;b.push(0));b.reverse()}for(R=m.length,f=S.length,R-f<0&&(b=S,S=m,m=b,f=R),R=0;f;)R=(m[--f]=m[f]+S[f]+R)/ze|0,m[f]=ze===m[f]?0:m[f]%ze;return R&&(m=[R].concat(m),++k),U(c,m,k)},o.precision=o.sd=function(c,f){var b,w,R,A=this;if(c!=null&&c!==!!c)return fe(c,1,Me),f==null?f=a:fe(f,0,8),H(new x(A),c,f);if(!(b=A.c))return null;if(R=b.length-1,w=R*re+1,R=b[R]){for(;R%10==0;R/=10,w--);for(R=b[0];R>=10;R/=10,w++);}return c&&A.e+1>w&&(w=A.e+1),w},o.shiftedBy=function(c){return fe(c,-9007199254740991,Gs),this.times("1e"+c)},o.squareRoot=o.sqrt=function(){var c,f,b,w,R,A=this,k=A.c,m=A.s,S=A.e,F=i+4,v=new x("0.5");if(m!==1||!k||!k[0])return new x(!m||m<0&&(!k||k[0])?NaN:k?A:1/0);if(m=Math.sqrt(+W(A)),m==0||m==1/0?(f=$e(k),(f.length+S)%2==0&&(f+="0"),m=Math.sqrt(+f),S=Be((S+1)/2)-(S<0||S%2),m==1/0?f="5e"+S:(f=m.toExponential(),f=f.slice(0,f.indexOf("e")+1)+S),b=new x(f)):b=new x(m+""),b.c[0]){for(S=b.e,m=S+F,m<3&&(m=0);;)if(R=b,b=v.times(R.plus(t(A,R,F,1))),$e(R.c).slice(0,m)===(f=$e(b.c)).slice(0,m))if(b.e<S&&--m,f=f.slice(m-3,m+1),f=="9999"||!w&&f=="4999"){if(!w&&(H(R,R.e+i+2,0),R.times(R).eq(A))){b=R;break}F+=4,m+=4,w=1}else{(!+f||!+f.slice(1)&&f.charAt(0)=="5")&&(H(b,b.e+i+2,1),c=!b.times(b).eq(A));break}}return H(b,b.e+i+1,a,c)},o.toExponential=function(c,f){return c!=null&&(fe(c,0,Me),c++),I(this,c,f,1)},o.toFixed=function(c,f){return c!=null&&(fe(c,0,Me),c=c+this.e+1),I(this,c,f)},o.toFormat=function(c,f,b){var w,R=this;if(b==null)c!=null&&f&&typeof f=="object"?(b=f,f=null):c&&typeof c=="object"?(b=c,c=f=null):b=y;else if(typeof b!="object")throw Error(Te+"Argument not an object: "+b);if(w=R.toFixed(c,f),R.c){var A,k=w.split("."),m=+b.groupSize,S=+b.secondaryGroupSize,F=b.groupSeparator||"",v=k[0],M=k[1],P=R.s<0,L=P?v.slice(1):v,j=L.length;if(S&&(A=m,m=S,S=A,j-=A),m>0&&j>0){for(A=j%m||m,v=L.substr(0,A);A<j;A+=m)v+=F+L.substr(A,m);S>0&&(v+=F+L.slice(A)),P&&(v="-"+v)}w=M?v+(b.decimalSeparator||"")+((S=+b.fractionGroupSize)?M.replace(new RegExp("\\d{"+S+"}\\B","g"),"$&"+(b.fractionGroupSeparator||"")):M):v}return(b.prefix||"")+w+(b.suffix||"")},o.toFraction=function(c){var f,b,w,R,A,k,m,S,F,v,M,P,L=this,j=L.c;if(c!=null&&(m=new x(c),!m.isInteger()&&(m.c||m.s!==1)||m.lt(s)))throw Error(Te+"Argument "+(m.isInteger()?"out of range: ":"not an integer: ")+W(m));if(!j)return new x(L);for(f=new x(s),F=b=new x(s),w=S=new x(s),P=$e(j),A=f.e=P.length-L.e-1,f.c[0]=Yr[(k=A%re)<0?re+k:k],c=!c||m.comparedTo(f)>0?A>0?f:F:m,k=h,h=1/0,m=new x(P),S.c[0]=0;v=t(m,f,0,1),R=b.plus(v.times(w)),R.comparedTo(c)!=1;)b=w,w=R,F=S.plus(v.times(R=F)),S=R,f=m.minus(v.times(R=f)),m=R;return R=t(c.minus(b),w,0,1),S=S.plus(R.times(F)),b=b.plus(R.times(w)),S.s=F.s=L.s,A=A*2,M=t(F,w,A,a).minus(L).abs().comparedTo(t(S,b,A,a).minus(L).abs())<1?[F,w]:[S,b],h=k,M},o.toNumber=function(){return+W(this)},o.toPrecision=function(c,f){return c!=null&&fe(c,1,Me),I(this,c,f,2)},o.toString=function(c){var f,b=this,w=b.s,R=b.e;return R===null?w?(f="Infinity",w<0&&(f="-"+f)):f="NaN":(c==null?f=R<=l||R>=u?ur($e(b.c),R):at($e(b.c),R,"0"):c===10&&N?(b=H(new x(b),i+R+1,a),f=at($e(b.c),b.e,"0")):(fe(c,2,O.length,"Base"),f=n(at($e(b.c),R,"0"),10,c,w,!0)),w<0&&b.c[0]&&(f="-"+f)),f},o.valueOf=o.toJSON=function(){return W(this)},o._isBigNumber=!0,o[Symbol.toStringTag]="BigNumber",o[Symbol.for("nodejs.util.inspect.custom")]=o.valueOf,e!=null&&x.set(e),x}function Be(e){var t=e|0;return e>0||e===t?t:t-1}function $e(e){for(var t,n,r=1,o=e.length,s=e[0]+"";r<o;){for(t=e[r++]+"",n=re-t.length;n--;t="0"+t);s+=t}for(o=s.length;s.charCodeAt(--o)===48;);return s.slice(0,o+1||1)}function Ft(e,t){var n,r,o=e.c,s=t.c,i=e.s,a=t.s,l=e.e,u=t.e;if(!i||!a)return null;if(n=o&&!o[0],r=s&&!s[0],n||r)return n?r?0:-a:i;if(i!=a)return i;if(n=i<0,r=l==u,!o||!s)return r?0:!o^n?1:-1;if(!r)return l>u^n?1:-1;for(a=(l=o.length)<(u=s.length)?l:u,i=0;i<a;i++)if(o[i]!=s[i])return o[i]>s[i]^n?1:-1;return l==u?0:l>u^n?1:-1}function fe(e,t,n,r){if(e<t||e>n||e!==je(e))throw Error(Te+(r||"Argument")+(typeof e=="number"?e<t||e>n?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function cr(e){var t=e.c.length-1;return Be(e.e/re)==t&&e.c[t]%2!=0}function ur(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function at(e,t,n){var r,o;if(t<0){for(o=n+".";++t;o+=n);e=o+e}else if(r=e.length,++t>r){for(o=n,t-=r;--t;o+=n);e+=o}else t<r&&(e=e.slice(0,t)+"."+e.slice(t));return e}ka();const Xu=100000n,Ju=(e,t={})=>{const{style:n="decimal",compact:r=!1,fractionDigits:o,adaptiveDecimals:s=!1}=t,i=typeof e=="string"?Number(e):e,a=typeof i=="bigint"?i<0n?-i:i:Math.abs(i),l=r==="auto"?a>=Xu:r,u=typeof i=="bigint"?Number(i):i,d=s&&u!==0&&Math.abs(u)<Math.pow(10,-(o??2)),h=new Intl.NumberFormat("en-US",{style:n,...n==="currency"&&{currency:"USD"},maximumFractionDigits:d?20:o??2,minimumFractionDigits:d?0:o??2});if(!l)return d?h.format(Vs(u)):h.format(i);const E=[{threshold:1e12,suffix:"T",divisor:1e12},{threshold:1e9,suffix:"B",divisor:1e9},{threshold:1e6,suffix:"M",divisor:1e6},{threshold:1e3,suffix:"K",divisor:1e3}].find(p=>a>=p.threshold);if(E){const p=new Intl.NumberFormat("en-US",{style:n,...n==="currency"&&{currency:"USD"},maximumFractionDigits:o??1,minimumFractionDigits:o??1}),g=Number(i)/E.divisor;return p.format(g)+E.suffix}return d?h.format(Vs(u)):h.format(i)};function Vs(e){if(e===0)return 0;const t=e.toExponential().split("e"),n=parseInt(t[1]),r=Math.abs(n);return Number(e.toFixed(r))}function Fn(e,t=5,n=5){return e?e.length<=t+n?e:`${e.slice(0,t)}...${e.slice(-n)}`:""}var Kn=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Kt=typeof window>"u"||"Deno"in globalThis;function Ue(){}function Zu(e,t){return typeof e=="function"?e(t):e}function go(e){return typeof e=="number"&&e>=0&&e!==1/0}function Aa(e,t){return Math.max(e+(t||0)-Date.now(),0)}function nn(e,t){return typeof e=="function"?e(t):e}function _e(e,t){return typeof e=="function"?e(t):e}function _s(e,t){const{type:n="all",exact:r,fetchStatus:o,predicate:s,queryKey:i,stale:a}=e;if(i){if(r){if(t.queryHash!==Qo(i,t.options))return!1}else if(!Hn(t.queryKey,i))return!1}if(n!=="all"){const l=t.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof a=="boolean"&&t.isStale()!==a||o&&o!==t.state.fetchStatus||s&&!s(t))}function Qs(e,t){const{exact:n,status:r,predicate:o,mutationKey:s}=e;if(s){if(!t.options.mutationKey)return!1;if(n){if(Bn(t.options.mutationKey)!==Bn(s))return!1}else if(!Hn(t.options.mutationKey,s))return!1}return!(r&&t.state.status!==r||o&&!o(t))}function Qo(e,t){return((t==null?void 0:t.queryKeyHashFn)||Bn)(e)}function Bn(e){return JSON.stringify(e,(t,n)=>yo(n)?Object.keys(n).sort().reduce((r,o)=>(r[o]=n[o],r),{}):n)}function Hn(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>Hn(e[n],t[n])):!1}function bo(e,t){if(e===t)return e;const n=Ks(e)&&Ks(t);if(n||yo(e)&&yo(t)){const r=n?e:Object.keys(e),o=r.length,s=n?t:Object.keys(t),i=s.length,a=n?[]:{};let l=0;for(let u=0;u<i;u++){const d=n?u:s[u];(!n&&r.includes(d)||n)&&e[d]===void 0&&t[d]===void 0?(a[d]=void 0,l++):(a[d]=bo(e[d],t[d]),a[d]===e[d]&&e[d]!==void 0&&l++)}return o===i&&l===o?e:a}return t}function vo(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function Ks(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function yo(e){if(!Ys(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!Ys(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function Ys(e){return Object.prototype.toString.call(e)==="[object Object]"}function ef(e){return new Promise(t=>{setTimeout(t,e)})}function wo(e,t,n){if(typeof n.structuralSharing=="function")return n.structuralSharing(e,t);if(n.structuralSharing!==!1){if(process.env.NODE_ENV!=="production")try{return bo(e,t)}catch(r){throw console.error(`Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${n.queryHash}]: ${r}`),r}return bo(e,t)}return t}function tf(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function nf(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var xr=Symbol();function Oa(e,t){return process.env.NODE_ENV!=="production"&&e.queryFn===xr&&console.error(`Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${e.queryHash}'`),!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===xr?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}var $t,vt,rn,wi,rf=(wi=class extends Kn{constructor(){super();te(this,$t);te(this,vt);te(this,rn);Q(this,rn,t=>{if(!Kt&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){T(this,vt)||this.setEventListener(T(this,rn))}onUnsubscribe(){var t;this.hasListeners()||((t=T(this,vt))==null||t.call(this),Q(this,vt,void 0))}setEventListener(t){var n;Q(this,rn,t),(n=T(this,vt))==null||n.call(this),Q(this,vt,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){T(this,$t)!==t&&(Q(this,$t,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof T(this,$t)=="boolean"?T(this,$t):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},$t=new WeakMap,vt=new WeakMap,rn=new WeakMap,wi),Ko=new rf,on,yt,sn,xi,of=(xi=class extends Kn{constructor(){super();te(this,on,!0);te(this,yt);te(this,sn);Q(this,sn,t=>{if(!Kt&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){T(this,yt)||this.setEventListener(T(this,sn))}onUnsubscribe(){var t;this.hasListeners()||((t=T(this,yt))==null||t.call(this),Q(this,yt,void 0))}setEventListener(t){var n;Q(this,sn,t),(n=T(this,yt))==null||n.call(this),Q(this,yt,t(this.setOnline.bind(this)))}setOnline(t){T(this,on)!==t&&(Q(this,on,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return T(this,on)}},on=new WeakMap,yt=new WeakMap,sn=new WeakMap,xi),Er=new of;function xo(){let e,t;const n=new Promise((o,s)=>{e=o,t=s});n.status="pending",n.catch(()=>{});function r(o){Object.assign(n,o),delete n.resolve,delete n.reject}return n.resolve=o=>{r({status:"fulfilled",value:o}),e(o)},n.reject=o=>{r({status:"rejected",reason:o}),t(o)},n}function sf(e){return Math.min(1e3*2**e,3e4)}function Ta(e){return(e??"online")==="online"?Er.isOnline():!0}var Fa=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function Xr(e){return e instanceof Fa}function Pa(e){let t=!1,n=0,r=!1,o;const s=xo(),i=y=>{var O;r||(E(new Fa(y)),(O=e.abort)==null||O.call(e))},a=()=>{t=!0},l=()=>{t=!1},u=()=>Ko.isFocused()&&(e.networkMode==="always"||Er.isOnline())&&e.canRun(),d=()=>Ta(e.networkMode)&&e.canRun(),h=y=>{var O;r||(r=!0,(O=e.onSuccess)==null||O.call(e,y),o==null||o(),s.resolve(y))},E=y=>{var O;r||(r=!0,(O=e.onError)==null||O.call(e,y),o==null||o(),s.reject(y))},p=()=>new Promise(y=>{var O;o=N=>{(r||u())&&y(N)},(O=e.onPause)==null||O.call(e)}).then(()=>{var y;o=void 0,r||(y=e.onContinue)==null||y.call(e)}),g=()=>{if(r)return;let y;const O=n===0?e.initialPromise:void 0;try{y=O??e.fn()}catch(N){y=Promise.reject(N)}Promise.resolve(y).then(h).catch(N=>{var H;if(r)return;const x=e.retry??(Kt?0:3),I=e.retryDelay??sf,B=typeof I=="function"?I(n,N):I,U=x===!0||typeof x=="number"&&n<x||typeof x=="function"&&x(n,N);if(t||!U){E(N);return}n++,(H=e.onFail)==null||H.call(e,n,N),ef(B).then(()=>u()?void 0:p()).then(()=>{t?E(N):g()})})};return{promise:s,cancel:i,continue:()=>(o==null||o(),s),cancelRetry:a,continueRetry:l,canStart:d,start:()=>(d()?g():p().then(g),s)}}var af=e=>setTimeout(e,0);function lf(){let e=[],t=0,n=a=>{a()},r=a=>{a()},o=af;const s=a=>{t?e.push(a):o(()=>{n(a)})},i=()=>{const a=e;e=[],a.length&&o(()=>{r(()=>{a.forEach(l=>{n(l)})})})};return{batch:a=>{let l;t++;try{l=a()}finally{t--,t||i()}return l},batchCalls:a=>(...l)=>{s(()=>{a(...l)})},schedule:s,setNotifyFunction:a=>{n=a},setBatchNotifyFunction:a=>{r=a},setScheduler:a=>{o=a}}}var xe=lf(),jt,Ei,Ma=(Ei=class{constructor(){te(this,jt)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),go(this.gcTime)&&Q(this,jt,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Kt?1/0:5*60*1e3))}clearGcTimeout(){T(this,jt)&&(clearTimeout(T(this,jt)),Q(this,jt,void 0))}},jt=new WeakMap,Ei),an,ln,He,Bt,Re,qn,Ht,Ge,lt,Ri,cf=(Ri=class extends Ma{constructor(t){super();te(this,Ge);te(this,an);te(this,ln);te(this,He);te(this,Bt);te(this,Re);te(this,qn);te(this,Ht);Q(this,Ht,!1),Q(this,qn,t.defaultOptions),this.setOptions(t.options),this.observers=[],Q(this,Bt,t.client),Q(this,He,T(this,Bt).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,Q(this,an,uf(this.options)),this.state=t.state??T(this,an),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=T(this,Re))==null?void 0:t.promise}setOptions(t){this.options={...T(this,qn),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&T(this,He).remove(this)}setData(t,n){const r=wo(this.state.data,t,this.options);return se(this,Ge,lt).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){se(this,Ge,lt).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,o;const n=(r=T(this,Re))==null?void 0:r.promise;return(o=T(this,Re))==null||o.cancel(t),n?n.then(Ue).catch(Ue):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(T(this,an))}isActive(){return this.observers.some(t=>_e(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===xr||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(t=0){return this.state.isInvalidated||this.state.data===void 0||!Aa(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=T(this,Re))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=T(this,Re))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),T(this,He).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(T(this,Re)&&(T(this,Ht)?T(this,Re).cancel({revert:!0}):T(this,Re).cancelRetry()),this.scheduleGc()),T(this,He).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||se(this,Ge,lt).call(this,{type:"invalidate"})}fetch(t,n){var l,u,d;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(T(this,Re))return T(this,Re).continueRetry(),T(this,Re).promise}if(t&&this.setOptions(t),!this.options.queryFn){const h=this.observers.find(E=>E.options.queryFn);h&&this.setOptions(h.options)}process.env.NODE_ENV!=="production"&&(Array.isArray(this.options.queryKey)||console.error("As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']"));const r=new AbortController,o=h=>{Object.defineProperty(h,"signal",{enumerable:!0,get:()=>(Q(this,Ht,!0),r.signal)})},s=()=>{const h=Oa(this.options,n),E={client:T(this,Bt),queryKey:this.queryKey,meta:this.meta};return o(E),Q(this,Ht,!1),this.options.persister?this.options.persister(h,E,this):h(E)},i={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:T(this,Bt),state:this.state,fetchFn:s};o(i),(l=this.options.behavior)==null||l.onFetch(i,this),Q(this,ln,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((u=i.fetchOptions)==null?void 0:u.meta))&&se(this,Ge,lt).call(this,{type:"fetch",meta:(d=i.fetchOptions)==null?void 0:d.meta});const a=h=>{var E,p,g,y;Xr(h)&&h.silent||se(this,Ge,lt).call(this,{type:"error",error:h}),Xr(h)||((p=(E=T(this,He).config).onError)==null||p.call(E,h,this),(y=(g=T(this,He).config).onSettled)==null||y.call(g,this.state.data,h,this)),this.scheduleGc()};return Q(this,Re,Pa({initialPromise:n==null?void 0:n.initialPromise,fn:i.fetchFn,abort:r.abort.bind(r),onSuccess:h=>{var E,p,g,y;if(h===void 0){process.env.NODE_ENV!=="production"&&console.error(`Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`),a(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(h)}catch(O){a(O);return}(p=(E=T(this,He).config).onSuccess)==null||p.call(E,h,this),(y=(g=T(this,He).config).onSettled)==null||y.call(g,h,this.state.error,this),this.scheduleGc()},onError:a,onFail:(h,E)=>{se(this,Ge,lt).call(this,{type:"failed",failureCount:h,error:E})},onPause:()=>{se(this,Ge,lt).call(this,{type:"pause"})},onContinue:()=>{se(this,Ge,lt).call(this,{type:"continue"})},retry:i.options.retry,retryDelay:i.options.retryDelay,networkMode:i.options.networkMode,canRun:()=>!0})),T(this,Re).start()}},an=new WeakMap,ln=new WeakMap,He=new WeakMap,Bt=new WeakMap,Re=new WeakMap,qn=new WeakMap,Ht=new WeakMap,Ge=new WeakSet,lt=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...Ia(r.data,this.options),fetchMeta:t.meta??null};case"success":return{...r,data:t.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const o=t.error;return Xr(o)&&o.revert&&T(this,ln)?{...T(this,ln),fetchStatus:"idle"}:{...r,error:o,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),xe.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),T(this,He).notify({query:this,type:"updated",action:t})})},Ri);function Ia(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Ta(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function uf(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var Xe,Si,ff=(Si=class extends Kn{constructor(t={}){super();te(this,Xe);this.config=t,Q(this,Xe,new Map)}build(t,n,r){const o=n.queryKey,s=n.queryHash??Qo(o,n);let i=this.get(s);return i||(i=new cf({client:t,queryKey:o,queryHash:s,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(o)}),this.add(i)),i}add(t){T(this,Xe).has(t.queryHash)||(T(this,Xe).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=T(this,Xe).get(t.queryHash);n&&(t.destroy(),n===t&&T(this,Xe).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){xe.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return T(this,Xe).get(t)}getAll(){return[...T(this,Xe).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>_s(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>_s(t,r)):n}notify(t){xe.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){xe.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){xe.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Xe=new WeakMap,Si),Je,ke,Ut,Ze,bt,Ci,df=(Ci=class extends Ma{constructor(t){super();te(this,Ze);te(this,Je);te(this,ke);te(this,Ut);this.mutationId=t.mutationId,Q(this,ke,t.mutationCache),Q(this,Je,[]),this.state=t.state||hf(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){T(this,Je).includes(t)||(T(this,Je).push(t),this.clearGcTimeout(),T(this,ke).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){Q(this,Je,T(this,Je).filter(n=>n!==t)),this.scheduleGc(),T(this,ke).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){T(this,Je).length||(this.state.status==="pending"?this.scheduleGc():T(this,ke).remove(this))}continue(){var t;return((t=T(this,Ut))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var o,s,i,a,l,u,d,h,E,p,g,y,O,N,x,I,B,U,H,W;Q(this,Ut,Pa({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(c,f)=>{se(this,Ze,bt).call(this,{type:"failed",failureCount:c,error:f})},onPause:()=>{se(this,Ze,bt).call(this,{type:"pause"})},onContinue:()=>{se(this,Ze,bt).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>T(this,ke).canRun(this)}));const n=this.state.status==="pending",r=!T(this,Ut).canStart();try{if(!n){se(this,Ze,bt).call(this,{type:"pending",variables:t,isPaused:r}),await((s=(o=T(this,ke).config).onMutate)==null?void 0:s.call(o,t,this));const f=await((a=(i=this.options).onMutate)==null?void 0:a.call(i,t));f!==this.state.context&&se(this,Ze,bt).call(this,{type:"pending",context:f,variables:t,isPaused:r})}const c=await T(this,Ut).start();return await((u=(l=T(this,ke).config).onSuccess)==null?void 0:u.call(l,c,t,this.state.context,this)),await((h=(d=this.options).onSuccess)==null?void 0:h.call(d,c,t,this.state.context)),await((p=(E=T(this,ke).config).onSettled)==null?void 0:p.call(E,c,null,this.state.variables,this.state.context,this)),await((y=(g=this.options).onSettled)==null?void 0:y.call(g,c,null,t,this.state.context)),se(this,Ze,bt).call(this,{type:"success",data:c}),c}catch(c){try{throw await((N=(O=T(this,ke).config).onError)==null?void 0:N.call(O,c,t,this.state.context,this)),await((I=(x=this.options).onError)==null?void 0:I.call(x,c,t,this.state.context)),await((U=(B=T(this,ke).config).onSettled)==null?void 0:U.call(B,void 0,c,this.state.variables,this.state.context,this)),await((W=(H=this.options).onSettled)==null?void 0:W.call(H,void 0,c,t,this.state.context)),c}finally{se(this,Ze,bt).call(this,{type:"error",error:c})}}finally{T(this,ke).runNext(this)}}},Je=new WeakMap,ke=new WeakMap,Ut=new WeakMap,Ze=new WeakSet,bt=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),xe.batch(()=>{T(this,Je).forEach(r=>{r.onMutationUpdate(t)}),T(this,ke).notify({mutation:this,type:"updated",action:t})})},Ci);function hf(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var ct,Ve,zn,ki,pf=(ki=class extends Kn{constructor(t={}){super();te(this,ct);te(this,Ve);te(this,zn);this.config=t,Q(this,ct,new Set),Q(this,Ve,new Map),Q(this,zn,0)}build(t,n,r){const o=new df({mutationCache:this,mutationId:++tr(this,zn)._,options:t.defaultMutationOptions(n),state:r});return this.add(o),o}add(t){T(this,ct).add(t);const n=fr(t);if(typeof n=="string"){const r=T(this,Ve).get(n);r?r.push(t):T(this,Ve).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(T(this,ct).delete(t)){const n=fr(t);if(typeof n=="string"){const r=T(this,Ve).get(n);if(r)if(r.length>1){const o=r.indexOf(t);o!==-1&&r.splice(o,1)}else r[0]===t&&T(this,Ve).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=fr(t);if(typeof n=="string"){const r=T(this,Ve).get(n),o=r==null?void 0:r.find(s=>s.state.status==="pending");return!o||o===t}else return!0}runNext(t){var r;const n=fr(t);if(typeof n=="string"){const o=(r=T(this,Ve).get(n))==null?void 0:r.find(s=>s!==t&&s.state.isPaused);return(o==null?void 0:o.continue())??Promise.resolve()}else return Promise.resolve()}clear(){xe.batch(()=>{T(this,ct).forEach(t=>{this.notify({type:"removed",mutation:t})}),T(this,ct).clear(),T(this,Ve).clear()})}getAll(){return Array.from(T(this,ct))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Qs(n,r))}findAll(t={}){return this.getAll().filter(n=>Qs(t,n))}notify(t){xe.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return xe.batch(()=>Promise.all(t.map(n=>n.continue().catch(Ue))))}},ct=new WeakMap,Ve=new WeakMap,zn=new WeakMap,ki);function fr(e){var t;return(t=e.options.scope)==null?void 0:t.id}function Xs(e){return{onFetch:(t,n)=>{var d,h,E,p,g;const r=t.options,o=(E=(h=(d=t.fetchOptions)==null?void 0:d.meta)==null?void 0:h.fetchMore)==null?void 0:E.direction,s=((p=t.state.data)==null?void 0:p.pages)||[],i=((g=t.state.data)==null?void 0:g.pageParams)||[];let a={pages:[],pageParams:[]},l=0;const u=async()=>{let y=!1;const O=I=>{Object.defineProperty(I,"signal",{enumerable:!0,get:()=>(t.signal.aborted?y=!0:t.signal.addEventListener("abort",()=>{y=!0}),t.signal)})},N=Oa(t.options,t.fetchOptions),x=async(I,B,U)=>{if(y)return Promise.reject();if(B==null&&I.pages.length)return Promise.resolve(I);const H={client:t.client,queryKey:t.queryKey,pageParam:B,direction:U?"backward":"forward",meta:t.options.meta};O(H);const W=await N(H),{maxPages:c}=t.options,f=U?nf:tf;return{pages:f(I.pages,W,c),pageParams:f(I.pageParams,B,c)}};if(o&&s.length){const I=o==="backward",B=I?mf:Js,U={pages:s,pageParams:i},H=B(r,U);a=await x(U,H,I)}else{const I=e??s.length;do{const B=l===0?i[0]??r.initialPageParam:Js(r,a);if(l>0&&B==null)break;a=await x(a,B),l++}while(l<I)}return a};t.options.persister?t.fetchFn=()=>{var y,O;return(O=(y=t.options).persister)==null?void 0:O.call(y,u,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=u}}}function Js(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function mf(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}var he,wt,xt,cn,un,Et,fn,dn,Ai,gf=(Ai=class{constructor(e={}){te(this,he);te(this,wt);te(this,xt);te(this,cn);te(this,un);te(this,Et);te(this,fn);te(this,dn);Q(this,he,e.queryCache||new ff),Q(this,wt,e.mutationCache||new pf),Q(this,xt,e.defaultOptions||{}),Q(this,cn,new Map),Q(this,un,new Map),Q(this,Et,0)}mount(){tr(this,Et)._++,T(this,Et)===1&&(Q(this,fn,Ko.subscribe(async e=>{e&&(await this.resumePausedMutations(),T(this,he).onFocus())})),Q(this,dn,Er.subscribe(async e=>{e&&(await this.resumePausedMutations(),T(this,he).onOnline())})))}unmount(){var e,t;tr(this,Et)._--,T(this,Et)===0&&((e=T(this,fn))==null||e.call(this),Q(this,fn,void 0),(t=T(this,dn))==null||t.call(this),Q(this,dn,void 0))}isFetching(e){return T(this,he).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return T(this,wt).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=T(this,he).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=T(this,he).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(nn(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return T(this,he).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),o=T(this,he).get(r.queryHash),s=o==null?void 0:o.state.data,i=Zu(t,s);if(i!==void 0)return T(this,he).build(this,r).setData(i,{...n,manual:!0})}setQueriesData(e,t,n){return xe.batch(()=>T(this,he).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=T(this,he).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=T(this,he);xe.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=T(this,he);return xe.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=xe.batch(()=>T(this,he).findAll(e).map(o=>o.cancel(n)));return Promise.all(r).then(Ue).catch(Ue)}invalidateQueries(e,t={}){return xe.batch(()=>(T(this,he).findAll(e).forEach(n=>{n.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=xe.batch(()=>T(this,he).findAll(e).filter(o=>!o.isDisabled()).map(o=>{let s=o.fetch(void 0,n);return n.throwOnError||(s=s.catch(Ue)),o.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(r).then(Ue)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=T(this,he).build(this,t);return n.isStaleByTime(nn(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Ue).catch(Ue)}fetchInfiniteQuery(e){return e.behavior=Xs(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Ue).catch(Ue)}ensureInfiniteQueryData(e){return e.behavior=Xs(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Er.isOnline()?T(this,wt).resumePausedMutations():Promise.resolve()}getQueryCache(){return T(this,he)}getMutationCache(){return T(this,wt)}getDefaultOptions(){return T(this,xt)}setDefaultOptions(e){Q(this,xt,e)}setQueryDefaults(e,t){T(this,cn).set(Bn(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...T(this,cn).values()],n={};return t.forEach(r=>{Hn(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){T(this,un).set(Bn(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...T(this,un).values()],n={};return t.forEach(r=>{Hn(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...T(this,xt).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Qo(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===xr&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...T(this,xt).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){T(this,he).clear(),T(this,wt).clear()}},he=new WeakMap,wt=new WeakMap,xt=new WeakMap,cn=new WeakMap,un=new WeakMap,Et=new WeakMap,fn=new WeakMap,dn=new WeakMap,Ai),Fe,ie,Gn,Ae,Wt,hn,Rt,et,Vn,pn,mn,qt,zt,St,gn,ce,Pn,Eo,Ro,So,Co,ko,Ao,Oo,Da,Oi,bf=(Oi=class extends Kn{constructor(t,n){super();te(this,ce);te(this,Fe);te(this,ie);te(this,Gn);te(this,Ae);te(this,Wt);te(this,hn);te(this,Rt);te(this,et);te(this,Vn);te(this,pn);te(this,mn);te(this,qt);te(this,zt);te(this,St);te(this,gn,new Set);this.options=n,Q(this,Fe,t),Q(this,et,null),Q(this,Rt,xo()),this.options.experimental_prefetchInRender||T(this,Rt).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(T(this,ie).addObserver(this),Zs(T(this,ie),this.options)?se(this,ce,Pn).call(this):this.updateResult(),se(this,ce,Co).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return To(T(this,ie),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return To(T(this,ie),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,se(this,ce,ko).call(this),se(this,ce,Ao).call(this),T(this,ie).removeObserver(this)}setOptions(t){const n=this.options,r=T(this,ie);if(this.options=T(this,Fe).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof _e(this.options.enabled,T(this,ie))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");se(this,ce,Oo).call(this),T(this,ie).setOptions(this.options),n._defaulted&&!vo(this.options,n)&&T(this,Fe).getQueryCache().notify({type:"observerOptionsUpdated",query:T(this,ie),observer:this});const o=this.hasListeners();o&&ei(T(this,ie),r,this.options,n)&&se(this,ce,Pn).call(this),this.updateResult(),o&&(T(this,ie)!==r||_e(this.options.enabled,T(this,ie))!==_e(n.enabled,T(this,ie))||nn(this.options.staleTime,T(this,ie))!==nn(n.staleTime,T(this,ie)))&&se(this,ce,Eo).call(this);const s=se(this,ce,Ro).call(this);o&&(T(this,ie)!==r||_e(this.options.enabled,T(this,ie))!==_e(n.enabled,T(this,ie))||s!==T(this,St))&&se(this,ce,So).call(this,s)}getOptimisticResult(t){const n=T(this,Fe).getQueryCache().build(T(this,Fe),t),r=this.createResult(n,t);return yf(this,r)&&(Q(this,Ae,r),Q(this,hn,this.options),Q(this,Wt,T(this,ie).state)),r}getCurrentResult(){return T(this,Ae)}trackResult(t,n){const r={};return Object.keys(t).forEach(o=>{Object.defineProperty(r,o,{configurable:!1,enumerable:!0,get:()=>(this.trackProp(o),n==null||n(o),t[o])})}),r}trackProp(t){T(this,gn).add(t)}getCurrentQuery(){return T(this,ie)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=T(this,Fe).defaultQueryOptions(t),r=T(this,Fe).getQueryCache().build(T(this,Fe),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return se(this,ce,Pn).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),T(this,Ae)))}createResult(t,n){var c;const r=T(this,ie),o=this.options,s=T(this,Ae),i=T(this,Wt),a=T(this,hn),u=t!==r?t.state:T(this,Gn),{state:d}=t;let h={...d},E=!1,p;if(n._optimisticResults){const f=this.hasListeners(),b=!f&&Zs(t,n),w=f&&ei(t,r,n,o);(b||w)&&(h={...h,...Ia(d.data,t.options)}),n._optimisticResults==="isRestoring"&&(h.fetchStatus="idle")}let{error:g,errorUpdatedAt:y,status:O}=h;if(n.select&&h.data!==void 0)if(s&&h.data===(i==null?void 0:i.data)&&n.select===T(this,Vn))p=T(this,pn);else try{Q(this,Vn,n.select),p=n.select(h.data),p=wo(s==null?void 0:s.data,p,n),Q(this,pn,p),Q(this,et,null)}catch(f){Q(this,et,f)}else p=h.data;if(n.placeholderData!==void 0&&p===void 0&&O==="pending"){let f;if(s!=null&&s.isPlaceholderData&&n.placeholderData===(a==null?void 0:a.placeholderData))f=s.data;else if(f=typeof n.placeholderData=="function"?n.placeholderData((c=T(this,mn))==null?void 0:c.state.data,T(this,mn)):n.placeholderData,n.select&&f!==void 0)try{f=n.select(f),Q(this,et,null)}catch(b){Q(this,et,b)}f!==void 0&&(O="success",p=wo(s==null?void 0:s.data,f,n),E=!0)}T(this,et)&&(g=T(this,et),p=T(this,pn),y=Date.now(),O="error");const N=h.fetchStatus==="fetching",x=O==="pending",I=O==="error",B=x&&N,U=p!==void 0,W={status:O,fetchStatus:h.fetchStatus,isPending:x,isSuccess:O==="success",isError:I,isInitialLoading:B,isLoading:B,data:p,dataUpdatedAt:h.dataUpdatedAt,error:g,errorUpdatedAt:y,failureCount:h.fetchFailureCount,failureReason:h.fetchFailureReason,errorUpdateCount:h.errorUpdateCount,isFetched:h.dataUpdateCount>0||h.errorUpdateCount>0,isFetchedAfterMount:h.dataUpdateCount>u.dataUpdateCount||h.errorUpdateCount>u.errorUpdateCount,isFetching:N,isRefetching:N&&!x,isLoadingError:I&&!U,isPaused:h.fetchStatus==="paused",isPlaceholderData:E,isRefetchError:I&&U,isStale:Yo(t,n),refetch:this.refetch,promise:T(this,Rt)};if(this.options.experimental_prefetchInRender){const f=R=>{W.status==="error"?R.reject(W.error):W.data!==void 0&&R.resolve(W.data)},b=()=>{const R=Q(this,Rt,W.promise=xo());f(R)},w=T(this,Rt);switch(w.status){case"pending":t.queryHash===r.queryHash&&f(w);break;case"fulfilled":(W.status==="error"||W.data!==w.value)&&b();break;case"rejected":(W.status!=="error"||W.error!==w.reason)&&b();break}}return W}updateResult(){const t=T(this,Ae),n=this.createResult(T(this,ie),this.options);if(Q(this,Wt,T(this,ie).state),Q(this,hn,this.options),T(this,Wt).data!==void 0&&Q(this,mn,T(this,ie)),vo(n,t))return;Q(this,Ae,n);const r=()=>{if(!t)return!0;const{notifyOnChangeProps:o}=this.options,s=typeof o=="function"?o():o;if(s==="all"||!s&&!T(this,gn).size)return!0;const i=new Set(s??T(this,gn));return this.options.throwOnError&&i.add("error"),Object.keys(T(this,Ae)).some(a=>{const l=a;return T(this,Ae)[l]!==t[l]&&i.has(l)})};se(this,ce,Da).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&se(this,ce,Co).call(this)}},Fe=new WeakMap,ie=new WeakMap,Gn=new WeakMap,Ae=new WeakMap,Wt=new WeakMap,hn=new WeakMap,Rt=new WeakMap,et=new WeakMap,Vn=new WeakMap,pn=new WeakMap,mn=new WeakMap,qt=new WeakMap,zt=new WeakMap,St=new WeakMap,gn=new WeakMap,ce=new WeakSet,Pn=function(t){se(this,ce,Oo).call(this);let n=T(this,ie).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(Ue)),n},Eo=function(){se(this,ce,ko).call(this);const t=nn(this.options.staleTime,T(this,ie));if(Kt||T(this,Ae).isStale||!go(t))return;const r=Aa(T(this,Ae).dataUpdatedAt,t)+1;Q(this,qt,setTimeout(()=>{T(this,Ae).isStale||this.updateResult()},r))},Ro=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(T(this,ie)):this.options.refetchInterval)??!1},So=function(t){se(this,ce,Ao).call(this),Q(this,St,t),!(Kt||_e(this.options.enabled,T(this,ie))===!1||!go(T(this,St))||T(this,St)===0)&&Q(this,zt,setInterval(()=>{(this.options.refetchIntervalInBackground||Ko.isFocused())&&se(this,ce,Pn).call(this)},T(this,St)))},Co=function(){se(this,ce,Eo).call(this),se(this,ce,So).call(this,se(this,ce,Ro).call(this))},ko=function(){T(this,qt)&&(clearTimeout(T(this,qt)),Q(this,qt,void 0))},Ao=function(){T(this,zt)&&(clearInterval(T(this,zt)),Q(this,zt,void 0))},Oo=function(){const t=T(this,Fe).getQueryCache().build(T(this,Fe),this.options);if(t===T(this,ie))return;const n=T(this,ie);Q(this,ie,t),Q(this,Gn,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},Da=function(t){xe.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(T(this,Ae))}),T(this,Fe).getQueryCache().notify({query:T(this,ie),type:"observerResultsUpdated"})})},Oi);function vf(e,t){return _e(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function Zs(e,t){return vf(e,t)||e.state.data!==void 0&&To(e,t,t.refetchOnMount)}function To(e,t,n){if(_e(t.enabled,e)!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&Yo(e,t)}return!1}function ei(e,t,n,r){return(e!==t||_e(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&Yo(e,n)}function Yo(e,t){return _e(t.enabled,e)!==!1&&e.isStaleByTime(nn(t.staleTime,e))}function yf(e,t){return!vo(e.getCurrentResult(),t)}var Na=D.createContext(void 0),La=e=>{const t=D.useContext(Na);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},$a=({client:e,children:t})=>(D.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),$.jsx(Na.Provider,{value:e,children:t})),wf=D.createContext(!1),xf=()=>D.useContext(wf);function Ef(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Rf=D.createContext(Ef()),Sf=()=>D.useContext(Rf);function Cf(e,t){return typeof e=="function"?e(...t):!!e}function ti(){}var kf=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},Af=e=>{D.useEffect(()=>{e.clearReset()},[e])},Of=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:o})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(o&&e.data===void 0||Cf(n,[e.error,r])),Tf=e=>{const t=e.staleTime;e.suspense&&(e.staleTime=typeof t=="function"?(...n)=>Math.max(t(...n),1e3):Math.max(t??1e3,1e3),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3)))},Ff=(e,t)=>e.isLoading&&e.isFetching&&!t,Pf=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,ni=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function Mf(e,t,n){var h,E,p,g,y;if(process.env.NODE_ENV!=="production"&&(typeof e!="object"||Array.isArray(e)))throw new Error('Bad argument type. Starting with v5, only the "Object" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object');const r=La(),o=xf(),s=Sf(),i=r.defaultQueryOptions(e);(E=(h=r.getDefaultOptions().queries)==null?void 0:h._experimental_beforeQuery)==null||E.call(h,i),process.env.NODE_ENV!=="production"&&(i.queryFn||console.error(`[${i.queryHash}]: No queryFn was passed as an option, and no default queryFn was found. The queryFn parameter is only optional when using a default queryFn. More info here: https://tanstack.com/query/latest/docs/framework/react/guides/default-query-function`)),i._optimisticResults=o?"isRestoring":"optimistic",Tf(i),kf(i,s),Af(s);const a=!r.getQueryCache().get(i.queryHash),[l]=D.useState(()=>new t(r,i)),u=l.getOptimisticResult(i),d=!o&&e.subscribed!==!1;if(D.useSyncExternalStore(D.useCallback(O=>{const N=d?l.subscribe(xe.batchCalls(O)):ti;return l.updateResult(),N},[l,d]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),D.useEffect(()=>{l.setOptions(i)},[i,l]),Pf(i,u))throw ni(i,l,s);if(Of({result:u,errorResetBoundary:s,throwOnError:i.throwOnError,query:r.getQueryCache().get(i.queryHash),suspense:i.suspense}))throw u.error;if((g=(p=r.getDefaultOptions().queries)==null?void 0:p._experimental_afterQuery)==null||g.call(p,i,u),i.experimental_prefetchInRender&&!Kt&&Ff(u,o)){const O=a?ni(i,l,s):(y=r.getQueryCache().get(i.queryHash))==null?void 0:y.promise;O==null||O.catch(ti).finally(()=>{l.updateResult()})}return i.notifyOnChangeProps?u:l.trackResult(u)}function Xo(e,t){return Mf(e,bf)}function Jo(e={}){const{activeAddress:t}=dt.useWallet(),{activeNetwork:n}=dt.useNetwork(),{enabled:r=!0,view:o="thumbnail"}=e;return Xo({queryKey:["nfd",t,n,o],queryFn:async({signal:s})=>{if(!t)return null;const l=await fetch(`${n==="testnet"?"https://api.testnet.nf.domains":"https://api.nf.domains"}/nfd/lookup?address=${encodeURIComponent(t)}&view=${o}`,{method:"GET",headers:{Accept:"application/json"},signal:s});if(l.status===404)return null;if(!l.ok)throw new Error(`NFD lookup failed: ${l.statusText}`);return(await l.json())[t]},enabled:r&&!!t,retry:(s,i)=>i instanceof Error&&i.message.includes("404")?!1:s<3,refetchOnWindowFocus:!0})}const If="https://ipfs.algonode.dev",Df=async e=>{if(!e.startsWith("ipfs://"))return e;const t=e.replace("ipfs://",""),n=`https://images.nf.domains/ipfs/${t}`;try{if((await fetch(n,{method:"HEAD"})).ok)return n}catch{console.info(`CID ${t} is not cached on images.nf.domains, trying IPFS gateway...`)}return`${If}/ipfs/${t}`};function Zo({nfd:e,alt:t,className:n,size:r=40,fallback:o,lightOnly:s=!1}){var d,h,E,p;const i=((h=(d=e==null?void 0:e.properties)==null?void 0:d.userDefined)==null?void 0:h.avatar)||((p=(E=e==null?void 0:e.properties)==null?void 0:E.verified)==null?void 0:p.avatar)||null,a=t||(e==null?void 0:e.name)||"NFD Avatar",{data:l,isLoading:u}=Xo({queryKey:["nfd-avatar",i],queryFn:async()=>i?i.startsWith("https://")&&!i.includes("/ipfs/")?i:i.startsWith("ipfs://")||i.includes("/ipfs/")?await Df(i):i:null,enabled:!!i,staleTime:60*60*1e3,gcTime:24*60*60*1e3});return u||!l?o?$.jsx($.Fragment,{children:o}):$.jsx("div",{className:en("flex items-center justify-center rounded-full",s?"bg-gray-200 dark:bg-gray-200":"bg-gray-200 dark:bg-[#192A39]",n),style:{width:`${r}px`,height:`${r}px`},"aria-label":a,role:"img","data-wallet-ui":!0,children:$.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",className:en("text-gray-400",!s&&"dark:text-gray-500"),style:{width:`${Math.max(r/2,12)}px`,height:`${Math.max(r/2,12)}px`},children:$.jsx("path",{fillRule:"evenodd",d:"M7.5 6a4.5 4.5 0 119 0 4.5 4.5 0 01-9 0zM3.751 20.105a8.25 8.25 0 0116.498 0 .75.75 0 01-.437.695A18.683 18.683 0 0112 22.5c-2.786 0-5.433-.608-7.812-1.7a.75.75 0 01-.437-.695z",clipRule:"evenodd"})})}):$.jsx("img",{src:l,alt:a,className:en("rounded-full",n),style:{width:`${r}px`,height:`${r}px`,objectFit:"cover"},loading:"lazy"})}const Ir=C.forwardRef(({className:e="",children:t,style:n,...r},o)=>{var u;const{activeAddress:s}=dt.useWallet(),i=Jo({enabled:!!s}),a=((u=i.data)==null?void 0:u.name)??null;return $.jsx("button",{ref:o,className:en("flex items-center",e),style:n,disabled:!1,...r,type:"button","data-wallet-ui":!0,children:t||$.jsx("div",{className:"flex items-center",children:$.jsxs("div",{className:"flex items-center py-2.5 pl-3 md:pl-3.5 pr-3 bg-[#2D2DF1] dark:bg-[#BFBFF9] text-white dark:text-[#001324] rounded-xl font-bold",children:[s&&$.jsx("div",{className:"mr-1 md:mr-2 h-6 w-6 overflow-hidden",children:$.jsx(Zo,{nfd:i.data,alt:`${a||s} avatar`,size:24,lightOnly:!0})}),$.jsx("span",{className:"hidden md:block max-w-[160px] truncate",children:a||(s?Fn(s,6,4):"Connect")}),s&&$.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 16 16",fill:"none",className:"ml-1.5 mt-0.5","aria-hidden":"true",children:$.jsx("path",{d:"M4 6L8 10L12 6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})]})})})});Ir.displayName="ConnectedWalletButton";const ja=typeof document<"u"?C.useLayoutEffect:()=>{};function Nf(e){const t=C.useRef(null);return ja(()=>{t.current=e},[e]),C.useCallback((...n)=>{const r=t.current;return r==null?void 0:r(...n)},[])}const Ot=e=>{var t;return(t=e==null?void 0:e.ownerDocument)!==null&&t!==void 0?t:document},Nt=e=>e&&"window"in e&&e.window===e?e:Ot(e).defaultView||window;function Lf(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&typeof e.nodeType=="number"}function $f(e){return Lf(e)&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&"host"in e}let jf=!1;function es(){return jf}function Ba(e,t){if(!es())return t&&e?e.contains(t):!1;if(!e||!t)return!1;let n=t;for(;n!==null;){if(n===e)return!0;n.tagName==="SLOT"&&n.assignedSlot?n=n.assignedSlot.parentNode:$f(n)?n=n.host:n=n.parentNode}return!1}const Fo=(e=document)=>{var t;if(!es())return e.activeElement;let n=e.activeElement;for(;n&&"shadowRoot"in n&&(!((t=n.shadowRoot)===null||t===void 0)&&t.activeElement);)n=n.shadowRoot.activeElement;return n};function Ha(e){return es()&&e.target.shadowRoot&&e.composedPath?e.composedPath()[0]:e.target}function Bf(e){var t;return typeof window>"u"||window.navigator==null?!1:((t=window.navigator.userAgentData)===null||t===void 0?void 0:t.brands.some(n=>e.test(n.brand)))||e.test(window.navigator.userAgent)}function Hf(e){var t;return typeof window<"u"&&window.navigator!=null?e.test(((t=window.navigator.userAgentData)===null||t===void 0?void 0:t.platform)||window.navigator.platform):!1}function Ua(e){let t=null;return()=>(t==null&&(t=e()),t)}const Uf=Ua(function(){return Hf(/^Mac/i)}),Wf=Ua(function(){return Bf(/Android/i)});function Wa(){let e=C.useRef(new Map),t=C.useCallback((o,s,i,a)=>{let l=a!=null&&a.once?(...u)=>{e.current.delete(i),i(...u)}:i;e.current.set(i,{type:s,eventTarget:o,fn:l,options:a}),o.addEventListener(s,l,a)},[]),n=C.useCallback((o,s,i,a)=>{var l;let u=((l=e.current.get(i))===null||l===void 0?void 0:l.fn)||i;o.removeEventListener(s,u,a),e.current.delete(i)},[]),r=C.useCallback(()=>{e.current.forEach((o,s)=>{n(o.eventTarget,o.type,s,o.options)})},[n]);return C.useEffect(()=>r,[r]),{addGlobalListener:t,removeGlobalListener:n,removeAllGlobalListeners:r}}function qf(e){return e.mozInputSource===0&&e.isTrusted?!0:Wf()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}class qa{isDefaultPrevented(){return this.nativeEvent.defaultPrevented}preventDefault(){this.defaultPrevented=!0,this.nativeEvent.preventDefault()}stopPropagation(){this.nativeEvent.stopPropagation(),this.isPropagationStopped=()=>!0}isPropagationStopped(){return!1}persist(){}constructor(t,n){this.nativeEvent=n,this.target=n.target,this.currentTarget=n.currentTarget,this.relatedTarget=n.relatedTarget,this.bubbles=n.bubbles,this.cancelable=n.cancelable,this.defaultPrevented=n.defaultPrevented,this.eventPhase=n.eventPhase,this.isTrusted=n.isTrusted,this.timeStamp=n.timeStamp,this.type=t}}function za(e){let t=C.useRef({isFocused:!1,observer:null});ja(()=>{const r=t.current;return()=>{r.observer&&(r.observer.disconnect(),r.observer=null)}},[]);let n=Nf(r=>{e==null||e(r)});return C.useCallback(r=>{if(r.target instanceof HTMLButtonElement||r.target instanceof HTMLInputElement||r.target instanceof HTMLTextAreaElement||r.target instanceof HTMLSelectElement){t.current.isFocused=!0;let o=r.target,s=i=>{t.current.isFocused=!1,o.disabled&&n(new qa("blur",i)),t.current.observer&&(t.current.observer.disconnect(),t.current.observer=null)};o.addEventListener("focusout",s,{once:!0}),t.current.observer=new MutationObserver(()=>{if(t.current.isFocused&&o.disabled){var i;(i=t.current.observer)===null||i===void 0||i.disconnect();let a=o===document.activeElement?null:document.activeElement;o.dispatchEvent(new FocusEvent("blur",{relatedTarget:a})),o.dispatchEvent(new FocusEvent("focusout",{bubbles:!0,relatedTarget:a}))}}),t.current.observer.observe(o,{attributes:!0,attributeFilter:["disabled"]})}},[n])}let zf=!1,Yn=null,Po=new Set,Dn=new Map,Yt=!1,Mo=!1;const Gf={Tab:!0,Escape:!0};function ts(e,t){for(let n of Po)n(e,t)}function Vf(e){return!(e.metaKey||!Uf()&&e.altKey||e.ctrlKey||e.key==="Control"||e.key==="Shift"||e.key==="Meta")}function Rr(e){Yt=!0,Vf(e)&&(Yn="keyboard",ts("keyboard",e))}function We(e){Yn="pointer",(e.type==="mousedown"||e.type==="pointerdown")&&(Yt=!0,ts("pointer",e))}function Ga(e){qf(e)&&(Yt=!0,Yn="virtual")}function Va(e){e.target===window||e.target===document||zf||!e.isTrusted||(!Yt&&!Mo&&(Yn="virtual",ts("virtual",e)),Yt=!1,Mo=!1)}function _a(){Yt=!1,Mo=!0}function Io(e){if(typeof window>"u"||Dn.get(Nt(e)))return;const t=Nt(e),n=Ot(e);let r=t.HTMLElement.prototype.focus;t.HTMLElement.prototype.focus=function(){Yt=!0,r.apply(this,arguments)},n.addEventListener("keydown",Rr,!0),n.addEventListener("keyup",Rr,!0),n.addEventListener("click",Ga,!0),t.addEventListener("focus",Va,!0),t.addEventListener("blur",_a,!1),typeof PointerEvent<"u"?(n.addEventListener("pointerdown",We,!0),n.addEventListener("pointermove",We,!0),n.addEventListener("pointerup",We,!0)):(n.addEventListener("mousedown",We,!0),n.addEventListener("mousemove",We,!0),n.addEventListener("mouseup",We,!0)),t.addEventListener("beforeunload",()=>{Qa(e)},{once:!0}),Dn.set(t,{focus:r})}const Qa=(e,t)=>{const n=Nt(e),r=Ot(e);t&&r.removeEventListener("DOMContentLoaded",t),Dn.has(n)&&(n.HTMLElement.prototype.focus=Dn.get(n).focus,r.removeEventListener("keydown",Rr,!0),r.removeEventListener("keyup",Rr,!0),r.removeEventListener("click",Ga,!0),n.removeEventListener("focus",Va,!0),n.removeEventListener("blur",_a,!1),typeof PointerEvent<"u"?(r.removeEventListener("pointerdown",We,!0),r.removeEventListener("pointermove",We,!0),r.removeEventListener("pointerup",We,!0)):(r.removeEventListener("mousedown",We,!0),r.removeEventListener("mousemove",We,!0),r.removeEventListener("mouseup",We,!0)),Dn.delete(n))};function _f(e){const t=Ot(e);let n;return t.readyState!=="loading"?Io(e):(n=()=>{Io(e)},t.addEventListener("DOMContentLoaded",n)),()=>Qa(e,n)}typeof document<"u"&&_f();function Ka(){return Yn!=="pointer"}const Qf=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function Kf(e,t,n){let r=Ot(n==null?void 0:n.target);const o=typeof window<"u"?Nt(n==null?void 0:n.target).HTMLInputElement:HTMLInputElement,s=typeof window<"u"?Nt(n==null?void 0:n.target).HTMLTextAreaElement:HTMLTextAreaElement,i=typeof window<"u"?Nt(n==null?void 0:n.target).HTMLElement:HTMLElement,a=typeof window<"u"?Nt(n==null?void 0:n.target).KeyboardEvent:KeyboardEvent;return e=e||r.activeElement instanceof o&&!Qf.has(r.activeElement.type)||r.activeElement instanceof s||r.activeElement instanceof i&&r.activeElement.isContentEditable,!(e&&t==="keyboard"&&n instanceof a&&!Gf[n.key])}function Yf(e,t,n){Io(),C.useEffect(()=>{let r=(o,s)=>{Kf(!!(n!=null&&n.isTextInput),o,s)&&e(Ka())};return Po.add(r),()=>{Po.delete(r)}},t)}function Xf(e){let{isDisabled:t,onFocus:n,onBlur:r,onFocusChange:o}=e;const s=C.useCallback(l=>{if(l.target===l.currentTarget)return r&&r(l),o&&o(!1),!0},[r,o]),i=za(s),a=C.useCallback(l=>{const u=Ot(l.target),d=u?Fo(u):Fo();l.target===l.currentTarget&&d===Ha(l.nativeEvent)&&(n&&n(l),o&&o(!0),i(l))},[o,n,i]);return{focusProps:{onFocus:!t&&(n||o||r)?a:void 0,onBlur:!t&&(r||o)?s:void 0}}}function Jf(e){let{isDisabled:t,onBlurWithin:n,onFocusWithin:r,onFocusWithinChange:o}=e,s=C.useRef({isFocusWithin:!1}),{addGlobalListener:i,removeAllGlobalListeners:a}=Wa(),l=C.useCallback(h=>{h.currentTarget.contains(h.target)&&s.current.isFocusWithin&&!h.currentTarget.contains(h.relatedTarget)&&(s.current.isFocusWithin=!1,a(),n&&n(h),o&&o(!1))},[n,o,s,a]),u=za(l),d=C.useCallback(h=>{if(!h.currentTarget.contains(h.target))return;const E=Ot(h.target),p=Fo(E);if(!s.current.isFocusWithin&&p===Ha(h.nativeEvent)){r&&r(h),o&&o(!0),s.current.isFocusWithin=!0,u(h);let g=h.currentTarget;i(E,"focus",y=>{if(s.current.isFocusWithin&&!Ba(g,y.target)){let O=new qa("blur",new E.defaultView.FocusEvent("blur",{relatedTarget:y.target}));O.target=g,O.currentTarget=g,l(O)}},{capture:!0})}},[r,o,u,i,l]);return t?{focusWithinProps:{onFocus:void 0,onBlur:void 0}}:{focusWithinProps:{onFocus:d,onBlur:l}}}let Sr=!1,Jr=0;function Do(){Sr=!0,setTimeout(()=>{Sr=!1},50)}function ri(e){e.pointerType==="touch"&&Do()}function Zf(){if(!(typeof document>"u"))return typeof PointerEvent<"u"?document.addEventListener("pointerup",ri):document.addEventListener("touchend",Do),Jr++,()=>{Jr--,!(Jr>0)&&(typeof PointerEvent<"u"?document.removeEventListener("pointerup",ri):document.removeEventListener("touchend",Do))}}function ed(e){let{onHoverStart:t,onHoverChange:n,onHoverEnd:r,isDisabled:o}=e,[s,i]=C.useState(!1),a=C.useRef({isHovered:!1,ignoreEmulatedMouseEvents:!1,pointerType:"",target:null}).current;C.useEffect(Zf,[]);let{addGlobalListener:l,removeAllGlobalListeners:u}=Wa(),{hoverProps:d,triggerHoverEnd:h}=C.useMemo(()=>{let E=(y,O)=>{if(a.pointerType=O,o||O==="touch"||a.isHovered||!y.currentTarget.contains(y.target))return;a.isHovered=!0;let N=y.currentTarget;a.target=N,l(Ot(y.target),"pointerover",x=>{a.isHovered&&a.target&&!Ba(a.target,x.target)&&p(x,x.pointerType)},{capture:!0}),t&&t({type:"hoverstart",target:N,pointerType:O}),n&&n(!0),i(!0)},p=(y,O)=>{let N=a.target;a.pointerType="",a.target=null,!(O==="touch"||!a.isHovered||!N)&&(a.isHovered=!1,u(),r&&r({type:"hoverend",target:N,pointerType:O}),n&&n(!1),i(!1))},g={};return typeof PointerEvent<"u"?(g.onPointerEnter=y=>{Sr&&y.pointerType==="mouse"||E(y,y.pointerType)},g.onPointerLeave=y=>{!o&&y.currentTarget.contains(y.target)&&p(y,y.pointerType)}):(g.onTouchStart=()=>{a.ignoreEmulatedMouseEvents=!0},g.onMouseEnter=y=>{!a.ignoreEmulatedMouseEvents&&!Sr&&E(y,"mouse"),a.ignoreEmulatedMouseEvents=!1},g.onMouseLeave=y=>{!o&&y.currentTarget.contains(y.target)&&p(y,"mouse")}),{hoverProps:g,triggerHoverEnd:p}},[t,n,r,o,a,l,u]);return C.useEffect(()=>{o&&h({currentTarget:a.target},a.pointerType)},[o]),{hoverProps:d,isHovered:s}}function td(e={}){let{autoFocus:t=!1,isTextInput:n,within:r}=e,o=C.useRef({isFocused:!1,isFocusVisible:t||Ka()}),[s,i]=C.useState(!1),[a,l]=C.useState(()=>o.current.isFocused&&o.current.isFocusVisible),u=C.useCallback(()=>l(o.current.isFocused&&o.current.isFocusVisible),[]),d=C.useCallback(p=>{o.current.isFocused=p,i(p),u()},[u]);Yf(p=>{o.current.isFocusVisible=p,u()},[],{isTextInput:n});let{focusProps:h}=Xf({isDisabled:r,onFocusChange:d}),{focusWithinProps:E}=Jf({isDisabled:!r,onFocusWithinChange:d});return{isFocused:s,isFocusVisible:a,focusProps:r?E:h}}var nd=Object.defineProperty,rd=(e,t,n)=>t in e?nd(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Zr=(e,t,n)=>(rd(e,typeof t!="symbol"?t+"":t,n),n);let od=class{constructor(){Zr(this,"current",this.detect()),Zr(this,"handoffState","pending"),Zr(this,"currentId",0)}set(t){this.current!==t&&(this.handoffState="pending",this.currentId=0,this.current=t)}reset(){this.set(this.detect())}nextId(){return++this.currentId}get isServer(){return this.current==="server"}get isClient(){return this.current==="client"}detect(){return typeof window>"u"||typeof document>"u"?"server":"client"}handoff(){this.handoffState==="pending"&&(this.handoffState="complete")}get isHandoffComplete(){return this.handoffState==="complete"}},Gt=new od;function Xn(e){var t,n;return Gt.isServer?null:e?"ownerDocument"in e?e.ownerDocument:"current"in e?(n=(t=e.current)==null?void 0:t.ownerDocument)!=null?n:document:null:document}function Ya(e){typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e).catch(t=>setTimeout(()=>{throw t}))}function pt(){let e=[],t={addEventListener(n,r,o,s){return n.addEventListener(r,o,s),t.add(()=>n.removeEventListener(r,o,s))},requestAnimationFrame(...n){let r=requestAnimationFrame(...n);return t.add(()=>cancelAnimationFrame(r))},nextFrame(...n){return t.requestAnimationFrame(()=>t.requestAnimationFrame(...n))},setTimeout(...n){let r=setTimeout(...n);return t.add(()=>clearTimeout(r))},microTask(...n){let r={current:!0};return Ya(()=>{r.current&&n[0]()}),t.add(()=>{r.current=!1})},style(n,r,o){let s=n.style.getPropertyValue(r);return Object.assign(n.style,{[r]:o}),this.add(()=>{Object.assign(n.style,{[r]:s})})},group(n){let r=pt();return n(r),this.add(()=>r.dispose())},add(n){return e.includes(n)||e.push(n),()=>{let r=e.indexOf(n);if(r>=0)for(let o of e.splice(r,1))o()}},dispose(){for(let n of e.splice(0))n()}};return t}function En(){let[e]=C.useState(pt);return C.useEffect(()=>()=>e.dispose(),[e]),e}let we=(e,t)=>{Gt.isServer?C.useEffect(e,t):C.useLayoutEffect(e,t)};function Rn(e){let t=C.useRef(e);return we(()=>{t.current=e},[e]),t}let le=function(e){let t=Rn(e);return C.useCallback((...n)=>t.current(...n),[t])};function sd(e){let t=e.width/2,n=e.height/2;return{top:e.clientY-n,right:e.clientX+t,bottom:e.clientY+n,left:e.clientX-t}}function id(e,t){return!(!e||!t||e.right<t.left||e.left>t.right||e.bottom<t.top||e.top>t.bottom)}function ad({disabled:e=!1}={}){let t=C.useRef(null),[n,r]=C.useState(!1),o=En(),s=le(()=>{t.current=null,r(!1),o.dispose()}),i=le(a=>{if(o.dispose(),t.current===null){t.current=a.currentTarget,r(!0);{let l=Xn(a.currentTarget);o.addEventListener(l,"pointerup",s,!1),o.addEventListener(l,"pointermove",u=>{if(t.current){let d=sd(u);r(id(d,t.current.getBoundingClientRect()))}},!1),o.addEventListener(l,"pointercancel",s,!1)}}});return{pressed:n,pressProps:e?{}:{onPointerDown:i,onPointerUp:s,onClick:s}}}let ld=C.createContext(void 0);function ns(){return C.useContext(ld)}function oi(...e){return Array.from(new Set(e.flatMap(t=>typeof t=="string"?t.split(" "):[]))).filter(Boolean).join(" ")}function ft(e,t,...n){if(e in t){let o=t[e];return typeof o=="function"?o(...n):o}let r=new Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(t).map(o=>`"${o}"`).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,ft),r}var No=(e=>(e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static",e))(No||{}),cd=(e=>(e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden",e))(cd||{});function Qe(){let e=fd();return C.useCallback(t=>ud({mergeRefs:e,...t}),[e])}function ud({ourProps:e,theirProps:t,slot:n,defaultTag:r,features:o,visible:s=!0,name:i,mergeRefs:a}){a=a??dd;let l=Xa(t,e);if(s)return dr(l,n,r,i,a);let u=o??0;if(u&2){let{static:d=!1,...h}=l;if(d)return dr(h,n,r,i,a)}if(u&1){let{unmount:d=!0,...h}=l;return ft(d?0:1,{0(){return null},1(){return dr({...h,hidden:!0,style:{display:"none"}},n,r,i,a)}})}return dr(l,n,r,i,a)}function dr(e,t={},n,r,o){let{as:s=n,children:i,refName:a="ref",...l}=eo(e,["unmount","static"]),u=e.ref!==void 0?{[a]:e.ref}:{},d=typeof i=="function"?i(t):i;"className"in l&&l.className&&typeof l.className=="function"&&(l.className=l.className(t)),l["aria-labelledby"]&&l["aria-labelledby"]===l.id&&(l["aria-labelledby"]=void 0);let h={};if(t){let E=!1,p=[];for(let[g,y]of Object.entries(t))typeof y=="boolean"&&(E=!0),y===!0&&p.push(g.replace(/([A-Z])/g,O=>`-${O.toLowerCase()}`));if(E){h["data-headlessui-state"]=p.join(" ");for(let g of p)h[`data-${g}`]=""}}if(s===C.Fragment&&(Object.keys(It(l)).length>0||Object.keys(It(h)).length>0))if(!C.isValidElement(d)||Array.isArray(d)&&d.length>1){if(Object.keys(It(l)).length>0)throw new Error(['Passing props on "Fragment"!',"",`The current component <${r} /> is rendering a "Fragment".`,"However we need to passthrough the following props:",Object.keys(It(l)).concat(Object.keys(It(h))).map(E=>` - ${E}`).join(`
|
|
38
|
+
`),"","You can apply a few solutions:",['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".',"Render a single element as the child so that we can forward the props onto that element."].map(E=>` - ${E}`).join(`
|
|
39
39
|
`)].join(`
|
|
40
|
-
`))}else{let A=d.props,m=A==null?void 0:A.className,v=typeof m=="function"?(...N)=>jr(m(...N),a.className):jr(m,a.className),T=v?{className:v}:{},k=ti(d.props,qe(xn(a,["ref"])));for(let N in h)N in k&&delete h[N];return R.cloneElement(d,Object.assign({},k,h,f,{ref:o(Js(d),f.ref)},T))}return R.createElement(i,Object.assign({},xn(a,["ref"]),i!==R.Fragment&&f,i!==R.Fragment&&h),d)}function Xs(){let e=R.useRef([]),t=R.useCallback(n=>{for(let r of e.current)r!=null&&(typeof r=="function"?r(n):r.current=n)},[]);return(...n)=>{if(!n.every(r=>r==null))return e.current=n,t}}function Ks(...e){return e.every(t=>t==null)?void 0:t=>{for(let n of e)n!=null&&(typeof n=="function"?n(t):n.current=t)}}function ti(...e){if(e.length===0)return{};if(e.length===1)return e[0];let t={},n={};for(let r of e)for(let o in r)o.startsWith("on")&&typeof r[o]=="function"?(n[o]!=null||(n[o]=[]),n[o].push(r[o])):t[o]=r[o];if(t.disabled||t["aria-disabled"])for(let r in n)/^(on(?:Click|Pointer|Mouse|Key)(?:Down|Up|Press)?)$/.test(r)&&(n[r]=[o=>{var i;return(i=o==null?void 0:o.preventDefault)==null?void 0:i.call(o)}]);for(let r in n)Object.assign(t,{[r](o,...i){let l=n[r];for(let s of l){if((o instanceof Event||(o==null?void 0:o.nativeEvent)instanceof Event)&&o.defaultPrevented)return;s(o,...i)}}});return t}function ni(...e){if(e.length===0)return{};if(e.length===1)return e[0];let t={},n={};for(let r of e)for(let o in r)o.startsWith("on")&&typeof r[o]=="function"?(n[o]!=null||(n[o]=[]),n[o].push(r[o])):t[o]=r[o];for(let r in n)Object.assign(t,{[r](...o){let i=n[r];for(let l of i)l==null||l(...o)}});return t}function Se(e){var t;return Object.assign(R.forwardRef(e),{displayName:(t=e.displayName)!=null?t:e.name})}function qe(e){let t=Object.assign({},e);for(let n in t)t[n]===void 0&&delete t[n];return t}function xn(e,t=[]){let n=Object.assign({},e);for(let r of t)r in n&&delete n[r];return n}function Js(e){return R.version.split(".")[0]>="19"?e.props.ref:e.ref}function Qs(e,t,n){let[r,o]=R.useState(n),i=e!==void 0,l=R.useRef(i),s=R.useRef(!1),a=R.useRef(!1);return i&&!l.current&&!s.current?(s.current=!0,l.current=i,console.error("A component is changing from uncontrolled to controlled. This may be caused by the value changing from undefined to a defined value, which should not happen.")):!i&&l.current&&!a.current&&(a.current=!0,l.current=i,console.error("A component is changing from controlled to uncontrolled. This may be caused by the value changing from a defined value to undefined, which should not happen.")),[i?e:r,ne(f=>(i||o(f),t==null?void 0:t(f)))]}function Zs(e){let[t]=R.useState(e);return t}function ri(e={},t=null,n=[]){for(let[r,o]of Object.entries(e))ii(n,oi(t,r),o);return n}function oi(e,t){return e?e+"["+t+"]":t}function ii(e,t,n){if(Array.isArray(n))for(let[r,o]of n.entries())ii(e,oi(t,r.toString()),o);else n instanceof Date?e.push([t,n.toISOString()]):typeof n=="boolean"?e.push([t,n?"1":"0"]):typeof n=="string"?e.push([t,n]):typeof n=="number"?e.push([t,`${n}`]):n==null?e.push([t,""]):ri(n,t,e)}function ea(e){var t,n;let r=(t=e==null?void 0:e.form)!=null?t:e.closest("form");if(r){for(let o of r.elements)if(o!==e&&(o.tagName==="INPUT"&&o.type==="submit"||o.tagName==="BUTTON"&&o.type==="submit"||o.nodeName==="INPUT"&&o.type==="image")){o.click();return}(n=r.requestSubmit)==null||n.call(r)}}let ta="span";var Qn=(e=>(e[e.None=1]="None",e[e.Focusable=2]="Focusable",e[e.Hidden=4]="Hidden",e))(Qn||{});function na(e,t){var n;let{features:r=1,...o}=e,i={ref:t,"aria-hidden":(r&2)===2?!0:(n=o["aria-hidden"])!=null?n:void 0,hidden:(r&4)===4?!0:void 0,style:{position:"fixed",top:1,left:1,width:1,height:0,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",...(r&4)===4&&(r&2)!==2&&{display:"none"}}};return Re()({ourProps:i,theirProps:o,slot:{},defaultTag:ta,name:"Hidden"})}let li=Se(na),ra=R.createContext(null);function oa({children:e}){let t=R.useContext(ra);if(!t)return R.createElement(R.Fragment,null,e);let{target:n}=t;return n?Ae.createPortal(R.createElement(R.Fragment,null,e),n):null}function ia({data:e,form:t,disabled:n,onReset:r,overrides:o}){let[i,l]=R.useState(null),s=st();return R.useEffect(()=>{if(r&&i)return s.addEventListener(i,"reset",r)},[i,t,r]),R.createElement(oa,null,R.createElement(la,{setForm:l,formId:t}),ri(e).map(([a,f])=>R.createElement(li,{features:Qn.Hidden,...qe({key:a,as:"input",type:"hidden",hidden:!0,readOnly:!0,form:t,disabled:n,name:a,value:f,...o})})))}function la({setForm:e,formId:t}){return R.useEffect(()=>{if(t){let n=document.getElementById(t);n&&e(n)}},[e,t]),t?null:R.createElement(li,{features:Qn.Hidden,as:"input",type:"hidden",hidden:!0,readOnly:!0,ref:n=>{if(!n)return;let r=n.closest("form");r&&e(r)}})}let sa=R.createContext(void 0);function si(){return R.useContext(sa)}function aa(e){let t=e.parentElement,n=null;for(;t&&!(t instanceof HTMLFieldSetElement);)t instanceof HTMLLegendElement&&(n=t),t=t.parentElement;let r=(t==null?void 0:t.getAttribute("disabled"))==="";return r&&ua(n)?!1:r}function ua(e){if(!e)return!1;let t=e.previousElementSibling;for(;t!==null;){if(t instanceof HTMLLegendElement)return!1;t=t.previousElementSibling}return!0}let ai=Symbol();function ca(e,t=!0){return Object.assign(e,{[ai]:t})}function Pe(...e){let t=R.useRef(e);R.useEffect(()=>{t.current=e},[e]);let n=ne(r=>{for(let o of t.current)o!=null&&(typeof o=="function"?o(r):o.current=r)});return e.every(r=>r==null||(r==null?void 0:r[ai]))?void 0:n}let Zn=R.createContext(null);Zn.displayName="DescriptionContext";function ui(){let e=R.useContext(Zn);if(e===null){let t=new Error("You used a <Description /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(t,ui),t}return e}function fa(){var e,t;return(t=(e=R.useContext(Zn))==null?void 0:e.value)!=null?t:void 0}let da="p";function pa(e,t){let n=R.useId(),r=Jn(),{id:o=`headlessui-description-${n}`,...i}=e,l=ui(),s=Pe(t);ae(()=>l.register(o),[o,l.register]);let a=r||!1,f=R.useMemo(()=>({...l.slot,disabled:a}),[l.slot,a]),d={ref:s,...l.props,id:o};return Re()({ourProps:d,theirProps:i,slot:f,defaultTag:da,name:l.name||"Description"})}let ma=Se(pa);Object.assign(ma,{});var le=(e=>(e.Space=" ",e.Enter="Enter",e.Escape="Escape",e.Backspace="Backspace",e.Delete="Delete",e.ArrowLeft="ArrowLeft",e.ArrowUp="ArrowUp",e.ArrowRight="ArrowRight",e.ArrowDown="ArrowDown",e.Home="Home",e.End="End",e.PageUp="PageUp",e.PageDown="PageDown",e.Tab="Tab",e))(le||{});let rn=R.createContext(null);rn.displayName="LabelContext";function ci(){let e=R.useContext(rn);if(e===null){let t=new Error("You used a <Label /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(t,ci),t}return e}function fi(e){var t,n,r;let o=(n=(t=R.useContext(rn))==null?void 0:t.value)!=null?n:void 0;return((r=e==null?void 0:e.length)!=null?r:0)>0?[o,...e].filter(Boolean).join(" "):o}function ga({inherit:e=!1}={}){let t=fi(),[n,r]=R.useState([]),o=e?[t,...n].filter(Boolean):n;return[o.length>0?o.join(" "):void 0,R.useMemo(()=>function(i){let l=ne(a=>(r(f=>[...f,a]),()=>r(f=>{let d=f.slice(),h=d.indexOf(a);return h!==-1&&d.splice(h,1),d}))),s=R.useMemo(()=>({register:l,slot:i.slot,name:i.name,props:i.props,value:i.value}),[l,i.slot,i.name,i.props,i.value]);return R.createElement(rn.Provider,{value:s},i.children)},[r])]}let ha="label";function va(e,t){var n;let r=R.useId(),o=ci(),i=si(),l=Jn(),{id:s=`headlessui-label-${r}`,htmlFor:a=i??((n=o.props)==null?void 0:n.htmlFor),passive:f=!1,...d}=e,h=Pe(t);ae(()=>o.register(s),[s,o.register]);let A=ne(k=>{let N=k.currentTarget;if(N instanceof HTMLLabelElement&&k.preventDefault(),o.props&&"onClick"in o.props&&typeof o.props.onClick=="function"&&o.props.onClick(k),N instanceof HTMLLabelElement){let C=document.getElementById(N.htmlFor);if(C){let M=C.getAttribute("disabled");if(M==="true"||M==="")return;let B=C.getAttribute("aria-disabled");if(B==="true"||B==="")return;(C instanceof HTMLInputElement&&(C.type==="radio"||C.type==="checkbox")||C.role==="radio"||C.role==="checkbox"||C.role==="switch")&&C.click(),C.focus({preventScroll:!0})}}}),m=l||!1,v=R.useMemo(()=>({...o.slot,disabled:m}),[o.slot,m]),T={ref:h,...o.props,id:s,htmlFor:a,onClick:A};return f&&("onClick"in T&&(delete T.htmlFor,delete T.onClick),"onClick"in d&&delete d.onClick),Re()({ourProps:T,theirProps:d,slot:v,defaultTag:a?ha:"div",name:o.name||"Label"})}let ba=Se(va),di=Object.assign(ba,{});function ya(e,t){return e!==null&&t!==null&&typeof e=="object"&&typeof t=="object"&&"id"in e&&"id"in t?e.id===t.id:e===t}function xa(e=ya){return R.useCallback((t,n)=>{if(typeof e=="string"){let r=e;return(t==null?void 0:t[r])===(n==null?void 0:n[r])}return e(t,n)},[e])}function wa(e){if(e===null)return{width:0,height:0};let{width:t,height:n}=e.getBoundingClientRect();return{width:t,height:n}}function Ea(e,t=!1){let[n,r]=R.useReducer(()=>({}),{}),o=R.useMemo(()=>wa(e),[e,n]);return ae(()=>{if(!e)return;let i=new ResizeObserver(r);return i.observe(e),()=>{i.disconnect()}},[e]),t?{width:`${o.width}px`,height:`${o.height}px`}:o}let Ra=class extends Map{constructor(t){super(),this.factory=t}get(t){let n=super.get(t);return n===void 0&&(n=this.factory(t),this.set(t,n)),n}};function pi(e,t){let n=e(),r=new Set;return{getSnapshot(){return n},subscribe(o){return r.add(o),()=>r.delete(o)},dispatch(o,...i){let l=t[o].call(n,...i);l&&(n=l,r.forEach(s=>s()))}}}function mi(e){return R.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot)}let Sa=new Ra(()=>pi(()=>[],{ADD(e){return this.includes(e)?this:[...this,e]},REMOVE(e){let t=this.indexOf(e);if(t===-1)return this;let n=this.slice();return n.splice(t,1),n}}));function er(e,t){let n=Sa.get(t),r=R.useId(),o=mi(n);if(ae(()=>{if(e)return n.dispatch("ADD",r),()=>n.dispatch("REMOVE",r)},[n,e]),!e)return!1;let i=o.indexOf(r),l=o.length;return i===-1&&(i=l,l+=1),i===l-1}let jn=new Map,vt=new Map;function Br(e){var t;let n=(t=vt.get(e))!=null?t:0;return vt.set(e,n+1),n!==0?()=>Hr(e):(jn.set(e,{"aria-hidden":e.getAttribute("aria-hidden"),inert:e.inert}),e.setAttribute("aria-hidden","true"),e.inert=!0,()=>Hr(e))}function Hr(e){var t;let n=(t=vt.get(e))!=null?t:1;if(n===1?vt.delete(e):vt.set(e,n-1),n!==1)return;let r=jn.get(e);r&&(r["aria-hidden"]===null?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden",r["aria-hidden"]),e.inert=r.inert,jn.delete(e))}function Ca(e,{allowed:t,disallowed:n}={}){let r=er(e,"inert-others");ae(()=>{var o,i;if(!r)return;let l=$e();for(let a of(o=n==null?void 0:n())!=null?o:[])a&&l.add(Br(a));let s=(i=t==null?void 0:t())!=null?i:[];for(let a of s){if(!a)continue;let f=Tt(a);if(!f)continue;let d=a.parentElement;for(;d&&d!==f.body;){for(let h of d.children)s.some(A=>h.contains(A))||l.add(Br(h));d=d.parentElement}}return l.dispose},[r,t,n])}function Ta(e,t,n){let r=at(o=>{let i=o.getBoundingClientRect();i.x===0&&i.y===0&&i.width===0&&i.height===0&&n()});R.useEffect(()=>{if(!e)return;let o=t===null?null:t instanceof HTMLElement?t:t.current;if(!o)return;let i=$e();if(typeof ResizeObserver<"u"){let l=new ResizeObserver(()=>r.current(o));l.observe(o),i.add(()=>l.disconnect())}if(typeof IntersectionObserver<"u"){let l=new IntersectionObserver(()=>r.current(o));l.observe(o),i.add(()=>l.disconnect())}return()=>i.dispose()},[t,r,e])}let Bn=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].map(e=>`${e}:not([tabindex='-1'])`).join(","),Aa=["[data-autofocus]"].map(e=>`${e}:not([tabindex='-1'])`).join(",");var Hn=(e=>(e[e.First=1]="First",e[e.Previous=2]="Previous",e[e.Next=4]="Next",e[e.Last=8]="Last",e[e.WrapAround=16]="WrapAround",e[e.NoScroll=32]="NoScroll",e[e.AutoFocus=64]="AutoFocus",e))(Hn||{}),Oa=(e=>(e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow",e))(Oa||{}),Fa=(e=>(e[e.Previous=-1]="Previous",e[e.Next=1]="Next",e))(Fa||{});function gi(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(Bn)).sort((t,n)=>Math.sign((t.tabIndex||Number.MAX_SAFE_INTEGER)-(n.tabIndex||Number.MAX_SAFE_INTEGER)))}function Pa(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(Aa)).sort((t,n)=>Math.sign((t.tabIndex||Number.MAX_SAFE_INTEGER)-(n.tabIndex||Number.MAX_SAFE_INTEGER)))}var tr=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))(tr||{});function hi(e,t=0){var n;return e===((n=Tt(e))==null?void 0:n.body)?!1:Me(t,{0(){return e.matches(Bn)},1(){let r=e;for(;r!==null;){if(r.matches(Bn))return!0;r=r.parentElement}return!1}})}var ka=(e=>(e[e.Keyboard=0]="Keyboard",e[e.Mouse=1]="Mouse",e))(ka||{});typeof window<"u"&&typeof document<"u"&&(document.addEventListener("keydown",e=>{e.metaKey||e.altKey||e.ctrlKey||(document.documentElement.dataset.headlessuiFocusVisible="")},!0),document.addEventListener("click",e=>{e.detail===1?delete document.documentElement.dataset.headlessuiFocusVisible:e.detail===0&&(document.documentElement.dataset.headlessuiFocusVisible="")},!0));let Na=["textarea","input"].join(",");function Da(e){var t,n;return(n=(t=e==null?void 0:e.matches)==null?void 0:t.call(e,Na))!=null?n:!1}function vi(e,t=n=>n){return e.slice().sort((n,r)=>{let o=t(n),i=t(r);if(o===null||i===null)return 0;let l=o.compareDocumentPosition(i);return l&Node.DOCUMENT_POSITION_FOLLOWING?-1:l&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function Ia(e,t){return Ma(gi(),t,{relativeTo:e})}function Ma(e,t,{sorted:n=!0,relativeTo:r=null,skipElements:o=[]}={}){let i=Array.isArray(e)?e.length>0?e[0].ownerDocument:document:e.ownerDocument,l=Array.isArray(e)?n?vi(e):e:t&64?Pa(e):gi(e);o.length>0&&l.length>1&&(l=l.filter(m=>!o.some(v=>v!=null&&"current"in v?(v==null?void 0:v.current)===m:v===m))),r=r??i.activeElement;let s=(()=>{if(t&5)return 1;if(t&10)return-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),a=(()=>{if(t&1)return 0;if(t&2)return Math.max(0,l.indexOf(r))-1;if(t&4)return Math.max(0,l.indexOf(r))+1;if(t&8)return l.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),f=t&32?{preventScroll:!0}:{},d=0,h=l.length,A;do{if(d>=h||d+h<=0)return 0;let m=a+d;if(t&16)m=(m+h)%h;else{if(m<0)return 3;if(m>=h)return 1}A=l[m],A==null||A.focus(f),d+=s}while(A!==i.activeElement);return t&6&&Da(A)&&A.select(),2}function bi(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function La(){return/Android/gi.test(window.navigator.userAgent)}function $a(){return bi()||La()}function pt(e,t,n,r){let o=at(n);R.useEffect(()=>{if(!e)return;function i(l){o.current(l)}return document.addEventListener(t,i,r),()=>document.removeEventListener(t,i,r)},[e,t,r])}function ja(e,t,n,r){let o=at(n);R.useEffect(()=>{if(!e)return;function i(l){o.current(l)}return window.addEventListener(t,i,r),()=>window.removeEventListener(t,i,r)},[e,t,r])}const Wr=30;function Ba(e,t,n){let r=er(e,"outside-click"),o=at(n),i=R.useCallback(function(a,f){if(a.defaultPrevented)return;let d=f(a);if(d===null||!d.getRootNode().contains(d)||!d.isConnected)return;let h=function A(m){return typeof m=="function"?A(m()):Array.isArray(m)||m instanceof Set?m:[m]}(t);for(let A of h)if(A!==null&&(A.contains(d)||a.composed&&a.composedPath().includes(A)))return;return!hi(d,tr.Loose)&&d.tabIndex!==-1&&a.preventDefault(),o.current(a,d)},[o,t]),l=R.useRef(null);pt(r,"pointerdown",a=>{var f,d;l.current=((d=(f=a.composedPath)==null?void 0:f.call(a))==null?void 0:d[0])||a.target},!0),pt(r,"mousedown",a=>{var f,d;l.current=((d=(f=a.composedPath)==null?void 0:f.call(a))==null?void 0:d[0])||a.target},!0),pt(r,"click",a=>{$a()||l.current&&(i(a,()=>l.current),l.current=null)},!0);let s=R.useRef({x:0,y:0});pt(r,"touchstart",a=>{s.current.x=a.touches[0].clientX,s.current.y=a.touches[0].clientY},!0),pt(r,"touchend",a=>{let f={x:a.changedTouches[0].clientX,y:a.changedTouches[0].clientY};if(!(Math.abs(f.x-s.current.x)>=Wr||Math.abs(f.y-s.current.y)>=Wr))return i(a,()=>a.target instanceof HTMLElement?a.target:null)},!0),ja(r,"blur",a=>i(a,()=>window.document.activeElement instanceof HTMLIFrameElement?window.document.activeElement:null),!0)}function nr(...e){return R.useMemo(()=>Tt(...e),[...e])}function Ha(e,t){return R.useMemo(()=>{var n;if(e.type)return e.type;let r=(n=e.as)!=null?n:"button";if(typeof r=="string"&&r.toLowerCase()==="button"||(t==null?void 0:t.tagName)==="BUTTON"&&!t.hasAttribute("type"))return"button"},[e.type,e.as,t])}function Wa(){let e;return{before({doc:t}){var n;let r=t.documentElement,o=(n=t.defaultView)!=null?n:window;e=Math.max(0,o.innerWidth-r.clientWidth)},after({doc:t,d:n}){let r=t.documentElement,o=Math.max(0,r.clientWidth-r.offsetWidth),i=Math.max(0,e-o);n.style(r,"paddingRight",`${i}px`)}}}function Ua(){return bi()?{before({doc:e,d:t,meta:n}){function r(o){return n.containers.flatMap(i=>i()).some(i=>i.contains(o))}t.microTask(()=>{var o;if(window.getComputedStyle(e.documentElement).scrollBehavior!=="auto"){let s=$e();s.style(e.documentElement,"scrollBehavior","auto"),t.add(()=>t.microTask(()=>s.dispose()))}let i=(o=window.scrollY)!=null?o:window.pageYOffset,l=null;t.addEventListener(e,"click",s=>{if(s.target instanceof HTMLElement)try{let a=s.target.closest("a");if(!a)return;let{hash:f}=new URL(a.href),d=e.querySelector(f);d&&!r(d)&&(l=d)}catch{}},!0),t.addEventListener(e,"touchstart",s=>{if(s.target instanceof HTMLElement)if(r(s.target)){let a=s.target;for(;a.parentElement&&r(a.parentElement);)a=a.parentElement;t.style(a,"overscrollBehavior","contain")}else t.style(s.target,"touchAction","none")}),t.addEventListener(e,"touchmove",s=>{if(s.target instanceof HTMLElement){if(s.target.tagName==="INPUT")return;if(r(s.target)){let a=s.target;for(;a.parentElement&&a.dataset.headlessuiPortal!==""&&!(a.scrollHeight>a.clientHeight||a.scrollWidth>a.clientWidth);)a=a.parentElement;a.dataset.headlessuiPortal===""&&s.preventDefault()}else s.preventDefault()}},{passive:!1}),t.add(()=>{var s;let a=(s=window.scrollY)!=null?s:window.pageYOffset;i!==a&&window.scrollTo(0,i),l&&l.isConnected&&(l.scrollIntoView({block:"nearest"}),l=null)})})}}:{}}function Va(){return{before({doc:e,d:t}){t.style(e.documentElement,"overflow","hidden")}}}function Ga(e){let t={};for(let n of e)Object.assign(t,n(t));return t}let Xe=pi(()=>new Map,{PUSH(e,t){var n;let r=(n=this.get(e))!=null?n:{doc:e,count:0,d:$e(),meta:new Set};return r.count++,r.meta.add(t),this.set(e,r),this},POP(e,t){let n=this.get(e);return n&&(n.count--,n.meta.delete(t)),this},SCROLL_PREVENT({doc:e,d:t,meta:n}){let r={doc:e,d:t,meta:Ga(n)},o=[Ua(),Wa(),Va()];o.forEach(({before:i})=>i==null?void 0:i(r)),o.forEach(({after:i})=>i==null?void 0:i(r))},SCROLL_ALLOW({d:e}){e.dispose()},TEARDOWN({doc:e}){this.delete(e)}});Xe.subscribe(()=>{let e=Xe.getSnapshot(),t=new Map;for(let[n]of e)t.set(n,n.documentElement.style.overflow);for(let n of e.values()){let r=t.get(n.doc)==="hidden",o=n.count!==0;(o&&!r||!o&&r)&&Xe.dispatch(n.count>0?"SCROLL_PREVENT":"SCROLL_ALLOW",n),n.count===0&&Xe.dispatch("TEARDOWN",n)}});function Ya(e,t,n=()=>({containers:[]})){let r=mi(Xe),o=t?r.get(t):void 0,i=o?o.count>0:!1;return ae(()=>{if(!(!t||!e))return Xe.dispatch("PUSH",t,n),()=>Xe.dispatch("POP",t,n)},[e,t]),i}function qa(e,t,n=()=>[document.body]){let r=er(e,"scroll-lock");Ya(r,t,o=>{var i;return{containers:[...(i=o.containers)!=null?i:[],n]}})}function Ur(e){return[e.screenX,e.screenY]}function _a(){let e=R.useRef([-1,-1]);return{wasMoved(t){let n=Ur(t);return e.current[0]===n[0]&&e.current[1]===n[1]?!1:(e.current=n,!0)},update(t){e.current=Ur(t)}}}function za(e=0){let[t,n]=R.useState(e),r=R.useCallback(a=>n(a),[t]),o=R.useCallback(a=>n(f=>f|a),[t]),i=R.useCallback(a=>(t&a)===a,[t]),l=R.useCallback(a=>n(f=>f&~a),[n]),s=R.useCallback(a=>n(f=>f^a),[n]);return{flags:t,setFlag:r,addFlag:o,hasFlag:i,removeFlag:l,toggleFlag:s}}var Vr,Gr;typeof process<"u"&&typeof globalThis<"u"&&typeof Element<"u"&&((Vr=process==null?void 0:process.env)==null?void 0:Vr.NODE_ENV)==="test"&&typeof((Gr=Element==null?void 0:Element.prototype)==null?void 0:Gr.getAnimations)>"u"&&(Element.prototype.getAnimations=function(){return console.warn(["Headless UI has polyfilled `Element.prototype.getAnimations` for your tests.","Please install a proper polyfill e.g. `jsdom-testing-mocks`, to silence these warnings.","","Example usage:","```js","import { mockAnimationsApi } from 'jsdom-testing-mocks'","mockAnimationsApi()","```"].join(`
|
|
41
|
-
`)),[]});var Xa=(e=>(e[e.None=0]="None",e[e.Closed=1]="Closed",e[e.Enter=2]="Enter",e[e.Leave=4]="Leave",e))(Xa||{});function Ka(e){let t={};for(let n in e)e[n]===!0&&(t[`data-${n}`]="");return t}function Ja(e,t,n,r){let[o,i]=R.useState(n),{hasFlag:l,addFlag:s,removeFlag:a}=za(e&&o?3:0),f=R.useRef(!1),d=R.useRef(!1),h=st();return ae(()=>{var A;if(e){if(n&&i(!0),!t){n&&s(3);return}return(A=void 0)==null||A.call(r,n),Qa(t,{inFlight:f,prepare(){d.current?d.current=!1:d.current=f.current,f.current=!0,!d.current&&(n?(s(3),a(4)):(s(4),a(2)))},run(){d.current?n?(a(3),s(4)):(a(4),s(3)):n?a(1):s(1)},done(){var m;d.current&&typeof t.getAnimations=="function"&&t.getAnimations().length>0||(f.current=!1,a(7),n||i(!1),(m=void 0)==null||m.call(r,n))}})}},[e,n,t,h]),e?[o,{closed:l(1),enter:l(2),leave:l(4),transition:l(2)||l(4)}]:[n,{closed:void 0,enter:void 0,leave:void 0,transition:void 0}]}function Qa(e,{prepare:t,run:n,done:r,inFlight:o}){let i=$e();return eu(e,{prepare:t,inFlight:o}),i.nextFrame(()=>{n(),i.requestAnimationFrame(()=>{i.add(Za(e,r))})}),i.dispose}function Za(e,t){var n,r;let o=$e();if(!e)return o.dispose;let i=!1;o.add(()=>{i=!0});let l=(r=(n=e.getAnimations)==null?void 0:n.call(e).filter(s=>s instanceof CSSTransition))!=null?r:[];return l.length===0?(t(),o.dispose):(Promise.allSettled(l.map(s=>s.finished)).then(()=>{i||t()}),o.dispose)}function eu(e,{inFlight:t,prepare:n}){if(t!=null&&t.current){n();return}let r=e.style.transition;e.style.transition="none",n(),e.style.transition=r}function tu(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(t=>{let{brand:n,version:r}=t;return n+"/"+r}).join(" "):navigator.userAgent}const yi={...D},nu=yi.useInsertionEffect,ru=nu||(e=>e());function xi(e){const t=D.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return ru(()=>{t.current=e}),D.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t.current==null?void 0:t.current(...r)},[])}var Wn=typeof document<"u"?R.useLayoutEffect:R.useEffect;let Yr=!1,ou=0;const qr=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+ou++;function iu(){const[e,t]=D.useState(()=>Yr?qr():void 0);return Wn(()=>{e==null&&t(qr())},[]),D.useEffect(()=>{Yr=!0},[]),e}const lu=yi.useId,su=lu||iu;let wt;process.env.NODE_ENV!=="production"&&(wt=new Set);function au(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const o="Floating UI: "+n.join(" ");if(!((e=wt)!=null&&e.has(o))){var i;(i=wt)==null||i.add(o),console.warn(o)}}function uu(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const o="Floating UI: "+n.join(" ");if(!((e=wt)!=null&&e.has(o))){var i;(i=wt)==null||i.add(o),console.error(o)}}function cu(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(o=>o(n))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){var r;e.set(t,((r=e.get(t))==null?void 0:r.filter(o=>o!==n))||[])}}}const fu=D.createContext(null),du=D.createContext(null),pu=()=>{var e;return((e=D.useContext(fu))==null?void 0:e.id)||null},mu=()=>D.useContext(du),gu="data-floating-ui-focusable";function hu(e){const{open:t=!1,onOpenChange:n,elements:r}=e,o=su(),i=D.useRef({}),[l]=D.useState(()=>cu()),s=pu()!=null;if(process.env.NODE_ENV!=="production"){const m=r.reference;m&&!re(m)&&uu("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[a,f]=D.useState(r.reference),d=xi((m,v,T)=>{i.current.openEvent=m?v:void 0,l.emit("openchange",{open:m,event:v,reason:T,nested:s}),n==null||n(m,v,T)}),h=D.useMemo(()=>({setPositionReference:f}),[]),A=D.useMemo(()=>({reference:a||r.reference||null,floating:r.floating||null,domReference:r.reference}),[a,r.reference,r.floating]);return D.useMemo(()=>({dataRef:i,open:t,onOpenChange:d,elements:A,events:l,floatingId:o,refs:h}),[t,d,A,l,o,h])}function vu(e){e===void 0&&(e={});const{nodeId:t}=e,n=hu({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,o=r.elements,[i,l]=D.useState(null),[s,a]=D.useState(null),d=(o==null?void 0:o.domReference)||i,h=D.useRef(null),A=mu();Wn(()=>{d&&(h.current=d)},[d]);const m=Eo({...e,elements:{...o,...s&&{reference:s}}}),v=D.useCallback(M=>{const B=re(M)?{getBoundingClientRect:()=>M.getBoundingClientRect(),contextElement:M}:M;a(B),m.refs.setReference(B)},[m.refs]),T=D.useCallback(M=>{(re(M)||M===null)&&(h.current=M,l(M)),(re(m.refs.reference.current)||m.refs.reference.current===null||M!==null&&!re(M))&&m.refs.setReference(M)},[m.refs]),k=D.useMemo(()=>({...m.refs,setReference:T,setPositionReference:v,domReference:h}),[m.refs,T,v]),N=D.useMemo(()=>({...m.elements,domReference:d}),[m.elements,d]),C=D.useMemo(()=>({...m,...r,refs:k,elements:N,nodeId:t}),[m,k,N,t,r]);return Wn(()=>{r.dataRef.current.floatingContext=C;const M=A==null?void 0:A.nodesRef.current.find(B=>B.id===t);M&&(M.context=C)}),D.useMemo(()=>({...m,context:C,refs:k,elements:N}),[m,k,N,C])}const _r="active",zr="selected";function wn(e,t,n){const r=new Map,o=n==="item";let i=e;if(o&&e){const{[_r]:l,[zr]:s,...a}=e;i=a}return{...n==="floating"&&{tabIndex:-1,[gu]:""},...i,...t.map(l=>{const s=l?l[n]:null;return typeof s=="function"?e?s(e):null:s}).concat(e).reduce((l,s)=>(s&&Object.entries(s).forEach(a=>{let[f,d]=a;if(!(o&&[_r,zr].includes(f)))if(f.indexOf("on")===0){if(r.has(f)||r.set(f,[]),typeof d=="function"){var h;(h=r.get(f))==null||h.push(d),l[f]=function(){for(var A,m=arguments.length,v=new Array(m),T=0;T<m;T++)v[T]=arguments[T];return(A=r.get(f))==null?void 0:A.map(k=>k(...v)).find(k=>k!==void 0)}}}else l[f]=d}),l),{})}}function bu(e){e===void 0&&(e=[]);const t=e.map(s=>s==null?void 0:s.reference),n=e.map(s=>s==null?void 0:s.floating),r=e.map(s=>s==null?void 0:s.item),o=D.useCallback(s=>wn(s,e,"reference"),t),i=D.useCallback(s=>wn(s,e,"floating"),n),l=D.useCallback(s=>wn(s,e,"item"),r);return D.useMemo(()=>({getReferenceProps:o,getFloatingProps:i,getItemProps:l}),[o,i,l])}function Xr(e,t){return{...e,rects:{...e.rects,floating:{...e.rects.floating,height:t}}}}const yu=e=>({name:"inner",options:e,async fn(t){const{listRef:n,overflowRef:r,onFallbackChange:o,offset:i=0,index:l=0,minItemsVisible:s=4,referenceOverflowThreshold:a=0,scrollRef:f,...d}=lt(e,t),{rects:h,elements:{floating:A}}=t,m=n.current[l],v=(f==null?void 0:f.current)||A,T=A.clientTop||v.clientTop,k=A.clientTop!==0,N=v.clientTop!==0,C=A===v;if(process.env.NODE_ENV!=="production"&&(t.placement.startsWith("bottom")||au('`placement` side must be "bottom" when using the `inner`',"middleware.")),!m)return{};const M={...t,...await qn(-m.offsetTop-A.clientTop-h.reference.height/2-m.offsetHeight/2-i).fn(t)},B=await fn(Xr(M,v.scrollHeight+T+A.clientTop),d),j=await fn(M,{...d,elementContext:"reference"}),W=ce(0,B.top),G=M.y+W,p=(v.scrollHeight>v.clientHeight?b=>b:yt)(ce(0,v.scrollHeight+(k&&C||N?T*2:0)-W-ce(0,B.bottom)));if(v.style.maxHeight=p+"px",v.scrollTop=W,o){const b=v.offsetHeight<m.offsetHeight*Je(s,n.current.length)-1||j.top>=-a||j.bottom>=-a;bt.flushSync(()=>o(b))}return r&&(r.current=await fn(Xr({...M,y:G},v.offsetHeight+T+A.clientTop),d)),{y:G}}});function xu(e,t){const{open:n,elements:r}=e,{enabled:o=!0,overflowRef:i,scrollRef:l,onChange:s}=t,a=xi(s),f=D.useRef(!1),d=D.useRef(null),h=D.useRef(null);D.useEffect(()=>{if(!o)return;function m(T){if(T.ctrlKey||!v||i.current==null)return;const k=T.deltaY,N=i.current.top>=-.5,C=i.current.bottom>=-.5,M=v.scrollHeight-v.clientHeight,B=k<0?-1:1,j=k<0?"max":"min";v.scrollHeight<=v.clientHeight||(!N&&k>0||!C&&k<0?(T.preventDefault(),bt.flushSync(()=>{a(W=>W+Math[j](k,M*B))})):/firefox/i.test(tu())&&(v.scrollTop+=k))}const v=(l==null?void 0:l.current)||r.floating;if(n&&v)return v.addEventListener("wheel",m),requestAnimationFrame(()=>{d.current=v.scrollTop,i.current!=null&&(h.current={...i.current})}),()=>{d.current=null,h.current=null,v.removeEventListener("wheel",m)}},[o,n,r.floating,i,l,a]);const A=D.useMemo(()=>({onKeyDown(){f.current=!0},onWheel(){f.current=!1},onPointerMove(){f.current=!1},onScroll(){const m=(l==null?void 0:l.current)||r.floating;if(!(!i.current||!m||!f.current)){if(d.current!==null){const v=m.scrollTop-d.current;(i.current.bottom<-.5&&v<-1||i.current.top<-.5&&v>1)&&bt.flushSync(()=>a(T=>T+v))}requestAnimationFrame(()=>{d.current=m.scrollTop})}}}),[r.floating,a,i,l]);return D.useMemo(()=>o?{floating:A}:{},[o,A])}let ut=R.createContext({styles:void 0,setReference:()=>{},setFloating:()=>{},getReferenceProps:()=>({}),getFloatingProps:()=>({}),slot:{}});ut.displayName="FloatingContext";let rr=R.createContext(null);rr.displayName="PlacementContext";function wu(e){return R.useMemo(()=>e?typeof e=="string"?{to:e}:e:null,[e])}function Eu(){return R.useContext(ut).setReference}function Ru(){return R.useContext(ut).getReferenceProps}function Su(){let{getFloatingProps:e,slot:t}=R.useContext(ut);return R.useCallback((...n)=>Object.assign({},e(...n),{"data-anchor":t.anchor}),[e,t])}function Cu(e=null){e===!1&&(e=null),typeof e=="string"&&(e={to:e});let t=R.useContext(rr),n=R.useMemo(()=>e,[JSON.stringify(e,(o,i)=>{var l;return(l=i==null?void 0:i.outerHTML)!=null?l:i})]);ae(()=>{t==null||t(n??null)},[t,n]);let r=R.useContext(ut);return R.useMemo(()=>[r.setFloating,e?r.styles:{}],[r.setFloating,e,r.styles])}let Kr=4;function Tu({children:e,enabled:t=!0}){let[n,r]=R.useState(null),[o,i]=R.useState(0),l=R.useRef(null),[s,a]=R.useState(null);Au(s);let f=t&&n!==null&&s!==null,{to:d="bottom",gap:h=0,offset:A=0,padding:m=0,inner:v}=Ou(n,s),[T,k="center"]=d.split(" ");ae(()=>{f&&i(0)},[f]);let{refs:N,floatingStyles:C,context:M}=vu({open:f,placement:T==="selection"?k==="center"?"bottom":`bottom-${k}`:k==="center"?`${T}`:`${T}-${k}`,strategy:"absolute",transform:!1,middleware:[qn({mainAxis:T==="selection"?0:h,crossAxis:A}),Ro({padding:m}),T!=="selection"&&So({padding:m}),T==="selection"&&v?yu({...v,padding:m,overflowRef:l,offset:o,minItemsVisible:Kr,referenceOverflowThreshold:m,onFallbackChange(b){var w,y;if(!b)return;let F=M.elements.floating;if(!F)return;let g=parseFloat(getComputedStyle(F).scrollPaddingBottom)||0,x=Math.min(Kr,F.childElementCount),O=0,S=0;for(let P of(y=(w=M.elements.floating)==null?void 0:w.childNodes)!=null?y:[])if(P instanceof HTMLElement){let E=P.offsetTop,I=E+P.clientHeight+g,H=F.scrollTop,$=H+F.clientHeight;if(E>=H&&I<=$)x--;else{S=Math.max(0,Math.min(I,$)-Math.max(E,H)),O=P.clientHeight;break}}x>=1&&i(P=>{let E=O*x-S+g;return P>=E?P:E})}}):null,Vl({padding:m,apply({availableWidth:b,availableHeight:w,elements:y}){Object.assign(y.floating.style,{overflow:"auto",maxWidth:`${b}px`,maxHeight:`min(var(--anchor-max-height, 100vh), ${w}px)`})}})].filter(Boolean),whileElementsMounted:xo}),[B=T,j=k]=M.placement.split("-");T==="selection"&&(B="selection");let W=R.useMemo(()=>({anchor:[B,j].filter(Boolean).join(" ")}),[B,j]),G=xu(M,{overflowRef:l,onChange:i}),{getReferenceProps:u,getFloatingProps:c}=bu([G]),p=ne(b=>{a(b),N.setFloating(b)});return D.createElement(rr.Provider,{value:r},D.createElement(ut.Provider,{value:{setFloating:p,setReference:N.setReference,styles:C,getReferenceProps:u,getFloatingProps:c,slot:W}},e))}function Au(e){ae(()=>{if(!e)return;let t=new MutationObserver(()=>{let n=window.getComputedStyle(e).maxHeight,r=parseFloat(n);if(isNaN(r))return;let o=parseInt(n);isNaN(o)||r!==o&&(e.style.maxHeight=`${Math.ceil(r)}px`)});return t.observe(e,{attributes:!0,attributeFilter:["style"]}),()=>{t.disconnect()}},[e])}function Ou(e,t){var n,r,o;let i=En((n=e==null?void 0:e.gap)!=null?n:"var(--anchor-gap, 0)",t),l=En((r=e==null?void 0:e.offset)!=null?r:"var(--anchor-offset, 0)",t),s=En((o=e==null?void 0:e.padding)!=null?o:"var(--anchor-padding, 0)",t);return{...e,gap:i,offset:l,padding:s}}function En(e,t,n=void 0){let r=st(),o=ne((a,f)=>{if(a==null)return[n,null];if(typeof a=="number")return[a,null];if(typeof a=="string"){if(!f)return[n,null];let d=Jr(a,f);return[d,h=>{let A=wi(a);{let m=A.map(v=>window.getComputedStyle(f).getPropertyValue(v));r.requestAnimationFrame(function v(){r.nextFrame(v);let T=!1;for(let[N,C]of A.entries()){let M=window.getComputedStyle(f).getPropertyValue(C);if(m[N]!==M){m[N]=M,T=!0;break}}if(!T)return;let k=Jr(a,f);d!==k&&(h(k),d=k)})}return r.dispose}]}return[n,null]}),i=R.useMemo(()=>o(e,t)[0],[e,t]),[l=i,s]=R.useState();return ae(()=>{let[a,f]=o(e,t);if(s(a),!!f)return f(s)},[e,t]),l}function wi(e){let t=/var\((.*)\)/.exec(e);if(t){let n=t[1].indexOf(",");if(n===-1)return[t[1]];let r=t[1].slice(0,n).trim(),o=t[1].slice(n+1).trim();return o?[r,...wi(o)]:[r]}return[]}function Jr(e,t){let n=document.createElement("div");t.appendChild(n),n.style.setProperty("margin-top","0px","important"),n.style.setProperty("margin-top",e,"important");let r=parseFloat(window.getComputedStyle(n).marginTop)||0;return t.removeChild(n),r}function Fu(e,t){let[n,r]=R.useState(t);return!e&&n!==t&&r(t),e?n:t}let or=R.createContext(null);or.displayName="OpenClosedContext";var Et=(e=>(e[e.Open=1]="Open",e[e.Closed=2]="Closed",e[e.Closing=4]="Closing",e[e.Opening=8]="Opening",e))(Et||{});function Pu(){return R.useContext(or)}function ku({value:e,children:t}){return R.createElement(or.Provider,{value:e},t)}function Nu(e){throw new Error("Unexpected object: "+e)}var ie=(e=>(e[e.First=0]="First",e[e.Previous=1]="Previous",e[e.Next=2]="Next",e[e.Last=3]="Last",e[e.Specific=4]="Specific",e[e.Nothing=5]="Nothing",e))(ie||{});function Rn(e,t){let n=t.resolveItems();if(n.length<=0)return null;let r=t.resolveActiveIndex(),o=r??-1;switch(e.focus){case 0:{for(let i=0;i<n.length;++i)if(!t.resolveDisabled(n[i],i,n))return i;return r}case 1:{o===-1&&(o=n.length);for(let i=o-1;i>=0;--i)if(!t.resolveDisabled(n[i],i,n))return i;return r}case 2:{for(let i=o+1;i<n.length;++i)if(!t.resolveDisabled(n[i],i,n))return i;return r}case 3:{for(let i=n.length-1;i>=0;--i)if(!t.resolveDisabled(n[i],i,n))return i;return r}case 4:{for(let i=0;i<n.length;++i)if(t.resolveId(n[i],i,n)===e.id)return i;return r}case 5:return null;default:Nu(e)}}function Du(e){let t=ne(e),n=R.useRef(!1);R.useEffect(()=>(n.current=!1,()=>{n.current=!0,ei(()=>{n.current&&t()})}),[t])}function Iu(){let e=typeof document>"u";return"useSyncExternalStore"in D?(t=>t.useSyncExternalStore)(D)(()=>()=>{},()=>!1,()=>!e):!1}function Mu(){let e=Iu(),[t,n]=D.useState(Ke.isHandoffComplete);return t&&Ke.isHandoffComplete===!1&&n(!1),D.useEffect(()=>{t!==!0&&n(!0)},[t]),D.useEffect(()=>Ke.handoff(),[]),e?!1:t}let Lu=R.createContext(!1);function $u(){return R.useContext(Lu)}function ju(e){let t=$u(),n=R.useContext(Ri),r=nr(e),[o,i]=R.useState(()=>{var l;if(!t&&n!==null)return(l=n.current)!=null?l:null;if(Ke.isServer)return null;let s=r==null?void 0:r.getElementById("headlessui-portal-root");if(s)return s;if(r===null)return null;let a=r.createElement("div");return a.setAttribute("id","headlessui-portal-root"),r.body.appendChild(a)});return R.useEffect(()=>{o!==null&&(r!=null&&r.body.contains(o)||r==null||r.body.appendChild(o))},[o,r]),R.useEffect(()=>{t||n!==null&&i(n.current)},[n,i,t]),o}let Ei=R.Fragment,Bu=Se(function(e,t){let n=e,r=R.useRef(null),o=Pe(ca(h=>{r.current=h}),t),i=nr(r),l=ju(r),[s]=R.useState(()=>{var h;return Ke.isServer?null:(h=i==null?void 0:i.createElement("div"))!=null?h:null}),a=R.useContext(Vu),f=Mu();ae(()=>{!l||!s||l.contains(s)||(s.setAttribute("data-headlessui-portal",""),l.appendChild(s))},[l,s]),ae(()=>{if(s&&a)return a.register(s)},[a,s]),Du(()=>{var h;!l||!s||(s instanceof Node&&l.contains(s)&&l.removeChild(s),l.childNodes.length<=0&&((h=l.parentElement)==null||h.removeChild(l)))});let d=Re();return f?!l||!s?null:Ae.createPortal(d({ourProps:{ref:o},theirProps:n,slot:{},defaultTag:Ei,name:"Portal"}),s):null});function Hu(e,t){let n=Pe(t),{enabled:r=!0,...o}=e,i=Re();return r?R.createElement(Bu,{...o,ref:n}):i({ourProps:{ref:n},theirProps:o,slot:{},defaultTag:Ei,name:"Portal"})}let Wu=R.Fragment,Ri=R.createContext(null);function Uu(e,t){let{target:n,...r}=e,o={ref:Pe(t)},i=Re();return R.createElement(Ri.Provider,{value:n},i({ourProps:o,theirProps:r,defaultTag:Wu,name:"Popover.Group"}))}let Vu=R.createContext(null),Gu=Se(Hu),Yu=Se(Uu),qu=Object.assign(Gu,{Group:Yu});function _u(e,t){let n=R.useRef({left:0,top:0});if(ae(()=>{if(!t)return;let o=t.getBoundingClientRect();o&&(n.current=o)},[e,t]),t==null||!e||t===document.activeElement)return!1;let r=t.getBoundingClientRect();return r.top!==n.current.top||r.left!==n.current.left}let Qr=/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g;function Zr(e){var t,n;let r=(t=e.innerText)!=null?t:"",o=e.cloneNode(!0);if(!(o instanceof HTMLElement))return r;let i=!1;for(let s of o.querySelectorAll('[hidden],[aria-hidden],[role="img"]'))s.remove(),i=!0;let l=i?(n=o.innerText)!=null?n:"":r;return Qr.test(l)&&(l=l.replace(Qr,"")),l}function zu(e){let t=e.getAttribute("aria-label");if(typeof t=="string")return t.trim();let n=e.getAttribute("aria-labelledby");if(n){let r=n.split(" ").map(o=>{let i=document.getElementById(o);if(i){let l=i.getAttribute("aria-label");return typeof l=="string"?l.trim():Zr(i).trim()}return null}).filter(Boolean);if(r.length>0)return r.join(", ")}return Zr(e).trim()}function Xu(e){let t=R.useRef(""),n=R.useRef("");return ne(()=>{let r=e.current;if(!r)return"";let o=r.innerText;if(t.current===o)return n.current;let i=zu(r).trim().toLowerCase();return t.current=o,n.current=i,i})}var Ku=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(Ku||{}),Ju=(e=>(e[e.Single=0]="Single",e[e.Multi=1]="Multi",e))(Ju||{}),Qu=(e=>(e[e.Pointer=0]="Pointer",e[e.Other=1]="Other",e))(Qu||{}),Zu=(e=>(e[e.OpenListbox=0]="OpenListbox",e[e.CloseListbox=1]="CloseListbox",e[e.GoToOption=2]="GoToOption",e[e.Search=3]="Search",e[e.ClearSearch=4]="ClearSearch",e[e.RegisterOption=5]="RegisterOption",e[e.UnregisterOption=6]="UnregisterOption",e[e.SetButtonElement=7]="SetButtonElement",e[e.SetOptionsElement=8]="SetOptionsElement",e))(Zu||{});function Sn(e,t=n=>n){let n=e.activeOptionIndex!==null?e.options[e.activeOptionIndex]:null,r=vi(t(e.options.slice()),i=>i.dataRef.current.domRef.current),o=n?r.indexOf(n):null;return o===-1&&(o=null),{options:r,activeOptionIndex:o}}let ec={1(e){return e.dataRef.current.disabled||e.listboxState===1?e:{...e,activeOptionIndex:null,listboxState:1,__demoMode:!1}},0(e){if(e.dataRef.current.disabled||e.listboxState===0)return e;let t=e.activeOptionIndex,{isSelected:n}=e.dataRef.current,r=e.options.findIndex(o=>n(o.dataRef.current.value));return r!==-1&&(t=r),{...e,listboxState:0,activeOptionIndex:t,__demoMode:!1}},2(e,t){var n,r,o,i,l;if(e.dataRef.current.disabled||e.listboxState===1)return e;let s={...e,searchQuery:"",activationTrigger:(n=t.trigger)!=null?n:1,__demoMode:!1};if(t.focus===ie.Nothing)return{...s,activeOptionIndex:null};if(t.focus===ie.Specific)return{...s,activeOptionIndex:e.options.findIndex(d=>d.id===t.id)};if(t.focus===ie.Previous){let d=e.activeOptionIndex;if(d!==null){let h=e.options[d].dataRef.current.domRef,A=Rn(t,{resolveItems:()=>e.options,resolveActiveIndex:()=>e.activeOptionIndex,resolveId:m=>m.id,resolveDisabled:m=>m.dataRef.current.disabled});if(A!==null){let m=e.options[A].dataRef.current.domRef;if(((r=h.current)==null?void 0:r.previousElementSibling)===m.current||((o=m.current)==null?void 0:o.previousElementSibling)===null)return{...s,activeOptionIndex:A}}}}else if(t.focus===ie.Next){let d=e.activeOptionIndex;if(d!==null){let h=e.options[d].dataRef.current.domRef,A=Rn(t,{resolveItems:()=>e.options,resolveActiveIndex:()=>e.activeOptionIndex,resolveId:m=>m.id,resolveDisabled:m=>m.dataRef.current.disabled});if(A!==null){let m=e.options[A].dataRef.current.domRef;if(((i=h.current)==null?void 0:i.nextElementSibling)===m.current||((l=m.current)==null?void 0:l.nextElementSibling)===null)return{...s,activeOptionIndex:A}}}}let a=Sn(e),f=Rn(t,{resolveItems:()=>a.options,resolveActiveIndex:()=>a.activeOptionIndex,resolveId:d=>d.id,resolveDisabled:d=>d.dataRef.current.disabled});return{...s,...a,activeOptionIndex:f}},3:(e,t)=>{if(e.dataRef.current.disabled||e.listboxState===1)return e;let n=e.searchQuery!==""?0:1,r=e.searchQuery+t.value.toLowerCase(),o=(e.activeOptionIndex!==null?e.options.slice(e.activeOptionIndex+n).concat(e.options.slice(0,e.activeOptionIndex+n)):e.options).find(l=>{var s;return!l.dataRef.current.disabled&&((s=l.dataRef.current.textValue)==null?void 0:s.startsWith(r))}),i=o?e.options.indexOf(o):-1;return i===-1||i===e.activeOptionIndex?{...e,searchQuery:r}:{...e,searchQuery:r,activeOptionIndex:i,activationTrigger:1}},4(e){return e.dataRef.current.disabled||e.listboxState===1||e.searchQuery===""?e:{...e,searchQuery:""}},5:(e,t)=>{let n={id:t.id,dataRef:t.dataRef},r=Sn(e,o=>[...o,n]);return e.activeOptionIndex===null&&e.dataRef.current.isSelected(t.dataRef.current.value)&&(r.activeOptionIndex=r.options.indexOf(n)),{...e,...r}},6:(e,t)=>{let n=Sn(e,r=>{let o=r.findIndex(i=>i.id===t.id);return o!==-1&&r.splice(o,1),r});return{...e,...n,activationTrigger:1}},7:(e,t)=>e.buttonElement===t.element?e:{...e,buttonElement:t.element},8:(e,t)=>e.optionsElement===t.element?e:{...e,optionsElement:t.element}},ir=R.createContext(null);ir.displayName="ListboxActionsContext";function on(e){let t=R.useContext(ir);if(t===null){let n=new Error(`<${e} /> is missing a parent <Listbox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,on),n}return t}let ln=R.createContext(null);ln.displayName="ListboxDataContext";function At(e){let t=R.useContext(ln);if(t===null){let n=new Error(`<${e} /> is missing a parent <Listbox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,At),n}return t}function tc(e,t){return Me(t.type,ec,e,t)}let nc=R.Fragment;function rc(e,t){var n;let r=Jn(),{value:o,defaultValue:i,form:l,name:s,onChange:a,by:f,invalid:d=!1,disabled:h=r||!1,horizontal:A=!1,multiple:m=!1,__demoMode:v=!1,...T}=e;const k=A?"horizontal":"vertical";let N=Pe(t),C=Zs(i),[M=m?[]:void 0,B]=Qs(o,a,C),[j,W]=R.useReducer(tc,{dataRef:R.createRef(),listboxState:v?0:1,options:[],searchQuery:"",activeOptionIndex:null,activationTrigger:1,optionsVisible:!1,buttonElement:null,optionsElement:null,__demoMode:v}),G=R.useRef({static:!1,hold:!1}),u=R.useRef(new Map),c=xa(f),p=R.useCallback(U=>Me(b.mode,{1:()=>M.some(z=>c(z,U)),0:()=>c(M,U)}),[M]),b=R.useMemo(()=>({...j,value:M,disabled:h,invalid:d,mode:m?1:0,orientation:k,compare:c,isSelected:p,optionsPropsRef:G,listRef:u}),[M,h,d,m,j,u]);ae(()=>{j.dataRef.current=b},[b]);let w=b.listboxState===0;Ba(w,[b.buttonElement,b.optionsElement],(U,z)=>{var K;W({type:1}),hi(z,tr.Loose)||(U.preventDefault(),(K=b.buttonElement)==null||K.focus())});let y=R.useMemo(()=>({open:b.listboxState===0,disabled:h,invalid:d,value:M}),[b,h,M,d]),F=ne(U=>{let z=b.options.find(K=>K.id===U);z&&I(z.dataRef.current.value)}),g=ne(()=>{if(b.activeOptionIndex!==null){let{dataRef:U,id:z}=b.options[b.activeOptionIndex];I(U.current.value),W({type:2,focus:ie.Specific,id:z})}}),x=ne(()=>W({type:0})),O=ne(()=>W({type:1})),S=st(),P=ne((U,z,K)=>{S.dispose(),S.microTask(()=>U===ie.Specific?W({type:2,focus:ie.Specific,id:z,trigger:K}):W({type:2,focus:U,trigger:K}))}),E=ne((U,z)=>(W({type:5,id:U,dataRef:z}),()=>W({type:6,id:U}))),I=ne(U=>Me(b.mode,{0(){return B==null?void 0:B(U)},1(){let z=b.value.slice(),K=z.findIndex(Z=>c(Z,U));return K===-1?z.push(U):z.splice(K,1),B==null?void 0:B(z)}})),H=ne(U=>W({type:3,value:U})),$=ne(()=>W({type:4})),X=ne(U=>{W({type:7,element:U})}),V=ne(U=>{W({type:8,element:U})}),q=R.useMemo(()=>({onChange:I,registerOption:E,goToOption:P,closeListbox:O,openListbox:x,selectActiveOption:g,selectOption:F,search:H,clearSearch:$,setButtonElement:X,setOptionsElement:V}),[]),[ee,te]=ga({inherit:!0}),_={ref:N},Q=R.useCallback(()=>{if(C!==void 0)return B==null?void 0:B(C)},[B,C]),Y=Re();return R.createElement(te,{value:ee,props:{htmlFor:(n=b.buttonElement)==null?void 0:n.id},slot:{open:b.listboxState===0,disabled:h}},R.createElement(Tu,null,R.createElement(ir.Provider,{value:q},R.createElement(ln.Provider,{value:b},R.createElement(ku,{value:Me(b.listboxState,{0:Et.Open,1:Et.Closed})},s!=null&&M!=null&&R.createElement(ia,{disabled:h,data:{[s]:M},form:l,onReset:Q}),Y({ourProps:_,theirProps:T,slot:y,defaultTag:nc,name:"Listbox"}))))))}let oc="button";function ic(e,t){var n;let r=At("Listbox.Button"),o=on("Listbox.Button"),i=R.useId(),l=si(),{id:s=l||`headlessui-listbox-button-${i}`,disabled:a=r.disabled||!1,autoFocus:f=!1,...d}=e,h=Pe(t,Eu(),o.setButtonElement),A=Ru(),m=ne(b=>{switch(b.key){case le.Enter:ea(b.currentTarget);break;case le.Space:case le.ArrowDown:b.preventDefault(),Ae.flushSync(()=>o.openListbox()),r.value||o.goToOption(ie.First);break;case le.ArrowUp:b.preventDefault(),Ae.flushSync(()=>o.openListbox()),r.value||o.goToOption(ie.Last);break}}),v=ne(b=>{switch(b.key){case le.Space:b.preventDefault();break}}),T=ne(b=>{var w;if(aa(b.currentTarget))return b.preventDefault();r.listboxState===0?(Ae.flushSync(()=>o.closeListbox()),(w=r.buttonElement)==null||w.focus({preventScroll:!0})):(b.preventDefault(),o.openListbox())}),k=ne(b=>b.preventDefault()),N=fi([s]),C=fa(),{isFocusVisible:M,focusProps:B}=Bs({autoFocus:f}),{isHovered:j,hoverProps:W}=js({isDisabled:a}),{pressed:G,pressProps:u}=Ys({disabled:a}),c=R.useMemo(()=>({open:r.listboxState===0,active:G||r.listboxState===0,disabled:a,invalid:r.invalid,value:r.value,hover:j,focus:M,autofocus:f}),[r.listboxState,r.value,a,j,M,G,r.invalid,f]),p=ni(A(),{ref:h,id:s,type:Ha(e,r.buttonElement),"aria-haspopup":"listbox","aria-controls":(n=r.optionsElement)==null?void 0:n.id,"aria-expanded":r.listboxState===0,"aria-labelledby":N,"aria-describedby":C,disabled:a||void 0,autoFocus:f,onKeyDown:m,onKeyUp:v,onKeyPress:k,onClick:T},B,W,u);return Re()({ourProps:p,theirProps:d,slot:c,defaultTag:oc,name:"Listbox.Button"})}let Si=R.createContext(!1),lc="div",sc=$n.RenderStrategy|$n.Static;function ac(e,t){var n,r;let o=R.useId(),{id:i=`headlessui-listbox-options-${o}`,anchor:l,portal:s=!1,modal:a=!0,transition:f=!1,...d}=e,h=wu(l),[A,m]=R.useState(null);h&&(s=!0);let v=At("Listbox.Options"),T=on("Listbox.Options"),k=nr(v.optionsElement),N=Pu(),[C,M]=Ja(f,A,N!==null?(N&Et.Open)===Et.Open:v.listboxState===0);Ta(C,v.buttonElement,T.closeListbox);let B=v.__demoMode?!1:a&&v.listboxState===0;qa(B,k);let j=v.__demoMode?!1:a&&v.listboxState===0;Ca(j,{allowed:R.useCallback(()=>[v.buttonElement,v.optionsElement],[v.buttonElement,v.optionsElement])});let W=v.listboxState!==0,G=_u(W,v.buttonElement)?!1:C,u=C&&v.listboxState===1,c=Fu(u,v.value),p=ne($=>v.compare(c,$)),b=R.useMemo(()=>{var $;if(h==null||!(($=h==null?void 0:h.to)!=null&&$.includes("selection")))return null;let X=v.options.findIndex(V=>p(V.dataRef.current.value));return X===-1&&(X=0),X},[h,v.options]),w=(()=>{if(h==null)return;if(b===null)return{...h,inner:void 0};let $=Array.from(v.listRef.current.values());return{...h,inner:{listRef:{current:$},index:b}}})(),[y,F]=Cu(w),g=Su(),x=Pe(t,h?y:null,T.setOptionsElement,m),O=st();R.useEffect(()=>{var $;let X=v.optionsElement;X&&v.listboxState===0&&X!==(($=Tt(X))==null?void 0:$.activeElement)&&(X==null||X.focus({preventScroll:!0}))},[v.listboxState,v.optionsElement]);let S=ne($=>{var X,V;switch(O.dispose(),$.key){case le.Space:if(v.searchQuery!=="")return $.preventDefault(),$.stopPropagation(),T.search($.key);case le.Enter:if($.preventDefault(),$.stopPropagation(),v.activeOptionIndex!==null){let{dataRef:q}=v.options[v.activeOptionIndex];T.onChange(q.current.value)}v.mode===0&&(Ae.flushSync(()=>T.closeListbox()),(X=v.buttonElement)==null||X.focus({preventScroll:!0}));break;case Me(v.orientation,{vertical:le.ArrowDown,horizontal:le.ArrowRight}):return $.preventDefault(),$.stopPropagation(),T.goToOption(ie.Next);case Me(v.orientation,{vertical:le.ArrowUp,horizontal:le.ArrowLeft}):return $.preventDefault(),$.stopPropagation(),T.goToOption(ie.Previous);case le.Home:case le.PageUp:return $.preventDefault(),$.stopPropagation(),T.goToOption(ie.First);case le.End:case le.PageDown:return $.preventDefault(),$.stopPropagation(),T.goToOption(ie.Last);case le.Escape:$.preventDefault(),$.stopPropagation(),Ae.flushSync(()=>T.closeListbox()),(V=v.buttonElement)==null||V.focus({preventScroll:!0});return;case le.Tab:$.preventDefault(),$.stopPropagation(),Ae.flushSync(()=>T.closeListbox()),Ia(v.buttonElement,$.shiftKey?Hn.Previous:Hn.Next);break;default:$.key.length===1&&(T.search($.key),O.setTimeout(()=>T.clearSearch(),350));break}}),P=(n=v.buttonElement)==null?void 0:n.id,E=R.useMemo(()=>({open:v.listboxState===0}),[v.listboxState]),I=ni(h?g():{},{id:i,ref:x,"aria-activedescendant":v.activeOptionIndex===null||(r=v.options[v.activeOptionIndex])==null?void 0:r.id,"aria-multiselectable":v.mode===1?!0:void 0,"aria-labelledby":P,"aria-orientation":v.orientation,onKeyDown:S,role:"listbox",tabIndex:v.listboxState===0?0:void 0,style:{...d.style,...F,"--button-width":Ea(v.buttonElement,!0).width},...Ka(M)}),H=Re();return R.createElement(qu,{enabled:s?e.static||C:!1},R.createElement(ln.Provider,{value:v.mode===1?v:{...v,isSelected:p}},H({ourProps:I,theirProps:d,slot:E,defaultTag:lc,features:sc,visible:G,name:"Listbox.Options"})))}let uc="div";function cc(e,t){let n=R.useId(),{id:r=`headlessui-listbox-option-${n}`,disabled:o=!1,value:i,...l}=e,s=R.useContext(Si)===!0,a=At("Listbox.Option"),f=on("Listbox.Option"),d=a.activeOptionIndex!==null?a.options[a.activeOptionIndex].id===r:!1,h=a.isSelected(i),A=R.useRef(null),m=Xu(A),v=at({disabled:o,value:i,domRef:A,get textValue(){return m()}}),T=Pe(t,A,c=>{c?a.listRef.current.set(r,c):a.listRef.current.delete(r)});ae(()=>{if(!a.__demoMode&&a.listboxState===0&&d&&a.activationTrigger!==0)return $e().requestAnimationFrame(()=>{var c,p;(p=(c=A.current)==null?void 0:c.scrollIntoView)==null||p.call(c,{block:"nearest"})})},[A,d,a.__demoMode,a.listboxState,a.activationTrigger,a.activeOptionIndex]),ae(()=>{if(!s)return f.registerOption(r,v)},[v,r,s]);let k=ne(c=>{var p;if(o)return c.preventDefault();f.onChange(i),a.mode===0&&(Ae.flushSync(()=>f.closeListbox()),(p=a.buttonElement)==null||p.focus({preventScroll:!0}))}),N=ne(()=>{if(o)return f.goToOption(ie.Nothing);f.goToOption(ie.Specific,r)}),C=_a(),M=ne(c=>{C.update(c),!o&&(d||f.goToOption(ie.Specific,r,0))}),B=ne(c=>{C.wasMoved(c)&&(o||d||f.goToOption(ie.Specific,r,0))}),j=ne(c=>{C.wasMoved(c)&&(o||d&&f.goToOption(ie.Nothing))}),W=R.useMemo(()=>({active:d,focus:d,selected:h,disabled:o,selectedOption:h&&s}),[d,h,o,s]),G=s?{}:{id:r,ref:T,role:"option",tabIndex:o===!0?void 0:-1,"aria-disabled":o===!0?!0:void 0,"aria-selected":h,disabled:void 0,onClick:k,onFocus:N,onPointerEnter:M,onMouseEnter:M,onPointerMove:B,onMouseMove:B,onPointerLeave:j,onMouseLeave:j},u=Re();return!h&&s?null:u({ourProps:G,theirProps:l,slot:W,defaultTag:uc,name:"Listbox.Option"})}let fc=R.Fragment;function dc(e,t){let{options:n,placeholder:r,...o}=e,i={ref:Pe(t)},l=At("ListboxSelectedOption"),s=R.useMemo(()=>({}),[]),a=l.value===void 0||l.value===null||l.mode===1&&Array.isArray(l.value)&&l.value.length===0,f=Re();return R.createElement(Si.Provider,{value:!0},f({ourProps:i,theirProps:{...o,children:R.createElement(R.Fragment,null,r&&a?r:n)},slot:s,defaultTag:fc,name:"ListboxSelectedOption"}))}let pc=Se(rc),Ci=Se(ic),mc=di,Ti=Se(ac),Ai=Se(cc),gc=Se(dc),hc=Object.assign(pc,{Button:Ci,Label:mc,Options:Ti,Option:Ai,SelectedOption:gc});function Oi({children:e}){const{activeAddress:t,activeWallet:n}=zt.useWallet(),[r,o]=R.useState(!1),[i,l]=R.useState(!1),{refs:s,floatingStyles:a,context:f}=$o({open:r,onOpenChange:o,placement:"bottom-end",middleware:[qn(8),So(),Ro()],whileElementsMounted:xo}),d=Mo(f),h=Lo(f,{outsidePressEvent:"mousedown"}),{getReferenceProps:A,getFloatingProps:m}=jo([d,h]),v=it(),T=()=>{t&&(navigator.clipboard.writeText(t),l(!0),setTimeout(()=>l(!1),2e3))},k=async()=>{if(n)try{await n.disconnect(),o(!1)}catch(j){console.error("Error disconnecting wallet:",j)}},N=j=>{n&&n.setActiveAccount&&n.setActiveAccount(j)},C=j=>`${j.substring(0,6)}...${j.substring(j.length-4)}`,M=e||L.jsx(zn,{}),B=R.cloneElement(M,A({ref:s.setReference}));return L.jsxs(L.Fragment,{children:[B,r&&L.jsx(No,{children:L.jsx(Io,{context:f,modal:!1,children:L.jsx("div",{ref:s.setFloating,style:a,...m(),"aria-labelledby":v,className:"z-50 w-72 rounded-xl bg-white dark:bg-[#001324] shadow-xl border border-gray-200 dark:border-[#192A39]",children:L.jsxs("div",{className:"p-4",children:[L.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[L.jsx("div",{className:"h-12 w-12 rounded-full bg-gray-200 dark:bg-[#192A39] flex items-center justify-center overflow-hidden",children:L.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-8 w-8 text-gray-400 dark:text-gray-500",viewBox:"0 0 20 20",fill:"currentColor",children:L.jsx("path",{fillRule:"evenodd",d:"M10 9a3 3 0 100-6 3 3 0 000 6zm-7 9a7 7 0 1114 0H3z",clipRule:"evenodd"})})}),L.jsxs("div",{children:[L.jsx("h3",{id:v,className:"text-lg font-bold text-gray-900 dark:text-[#E9E9FD] wallet-custom-font",children:t?C(t):"My Wallet"}),n&&L.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:n.metadata.name})]})]}),n&&n.accounts&&n.accounts.length>1&&L.jsx("div",{className:"mb-4",children:L.jsxs(hc,{value:t||"",onChange:N,children:[L.jsx(di,{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:"Select Account"}),L.jsxs("div",{className:"relative mt-1",children:[L.jsxs(Ci,{className:"grid w-full cursor-default grid-cols-1 rounded-lg border border-gray-300 dark:border-[#192A39] bg-white dark:bg-[#101B29] py-2 px-3 text-left text-gray-800 dark:text-gray-300 shadow-sm focus:outline-none focus:ring-2 focus:ring-[#2D2DF1] dark:focus:ring-[#BFBFF9] focus:border-transparent text-sm",children:[L.jsx("span",{className:"col-start-1 row-start-1 truncate pr-8",children:t?C(t):"Select account"}),L.jsx("span",{className:"col-start-1 row-start-1 self-center justify-self-end",children:L.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",className:"text-gray-500 dark:text-gray-400","aria-hidden":"true",children:L.jsx("path",{d:"M4 6L8 10L12 6",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),L.jsx(Ti,{transition:!0,className:"absolute z-10 mt-1 max-h-60 w-full overflow-auto rounded-md bg-white dark:bg-[#101B29] py-1 shadow-lg ring-1 ring-black/5 dark:ring-[#192A39]/50 focus:outline-none text-sm data-[closed]:data-[leave]:opacity-0 data-[leave]:transition data-[leave]:duration-100 data-[leave]:ease-in",children:n.accounts.map(j=>L.jsxs(Ai,{value:j.address,className:"group relative cursor-default select-none py-2 pl-3 pr-9 text-gray-900 dark:text-gray-300 data-[focus]:bg-[#E9E9FD] dark:data-[focus]:bg-[#192A39] data-[focus]:text-gray-900 dark:data-[focus]:text-[#E9E9FD] data-[focus]:outline-none",children:[L.jsx("span",{className:"block truncate font-normal group-data-[selected]:font-medium",children:C(j.address)}),L.jsx("span",{className:"absolute inset-y-0 right-0 flex items-center pr-3 text-[#2D2DF1] dark:text-[#BFBFF9] group-[&:not([data-selected])]:hidden",children:L.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",className:"h-5 w-5","aria-hidden":"true",children:L.jsx("path",{d:"M13.3334 4L6.00008 11.3333L2.66675 8",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})]},j.address))})]})]})}),L.jsxs("div",{className:"flex gap-2",children:[L.jsx("button",{onClick:T,className:"flex-1 py-2 px-4 bg-gray-100 dark:bg-[#192A39] text-gray-700 dark:text-gray-300 font-medium rounded-xl hover:bg-gray-200 dark:hover:bg-[#263A4A] transition-colors text-sm flex items-center justify-center",title:"Copy address",children:i?L.jsxs(L.Fragment,{children:[L.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 text-green-500 mr-1.5",viewBox:"0 0 20 20",fill:"currentColor",children:L.jsx("path",{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",clipRule:"evenodd"})}),"Copied"]}):L.jsxs(L.Fragment,{children:[L.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 mr-1.5",viewBox:"0 0 20 20",fill:"currentColor",children:[L.jsx("path",{d:"M8 3a1 1 0 011-1h2a1 1 0 110 2H9a1 1 0 01-1-1z"}),L.jsx("path",{d:"M6 3a2 2 0 00-2 2v11a2 2 0 002 2h8a2 2 0 002-2V5a2 2 0 00-2-2 3 3 0 01-3 3H9a3 3 0 01-3-3z"})]}),"Copy"]})}),L.jsx("button",{onClick:k,className:"flex-1 py-2 px-4 bg-red-100 dark:bg-red-900/40 text-red-700 dark:text-red-300 font-medium rounded-xl hover:bg-red-200 dark:hover:bg-red-800/60 transition-colors text-sm",children:"Disconnect"})]})]})})})})]})}function vc(){const{activeAddress:e}=zt.useWallet();return e?L.jsx(Oi,{}):L.jsx(Ho,{})}Pi();exports.ConnectWalletButton=Un;exports.ConnectWalletMenu=Ho;exports.ConnectedWalletButton=zn;exports.ConnectedWalletMenu=Oi;exports.WalletButton=vc;exports.WalletList=Bo;
|
|
40
|
+
`))}else{let E=d.props,p=E==null?void 0:E.className,g=typeof p=="function"?(...N)=>oi(p(...N),l.className):oi(p,l.className),y=g?{className:g}:{},O=Xa(d.props,It(eo(l,["ref"])));for(let N in h)N in O&&delete h[N];return C.cloneElement(d,Object.assign({},O,h,u,{ref:o(hd(d),u.ref)},y))}return C.createElement(s,Object.assign({},eo(l,["ref"]),s!==C.Fragment&&u,s!==C.Fragment&&h),d)}function fd(){let e=C.useRef([]),t=C.useCallback(n=>{for(let r of e.current)r!=null&&(typeof r=="function"?r(n):r.current=n)},[]);return(...n)=>{if(!n.every(r=>r==null))return e.current=n,t}}function dd(...e){return e.every(t=>t==null)?void 0:t=>{for(let n of e)n!=null&&(typeof n=="function"?n(t):n.current=t)}}function Xa(...e){if(e.length===0)return{};if(e.length===1)return e[0];let t={},n={};for(let r of e)for(let o in r)o.startsWith("on")&&typeof r[o]=="function"?(n[o]!=null||(n[o]=[]),n[o].push(r[o])):t[o]=r[o];if(t.disabled||t["aria-disabled"])for(let r in n)/^(on(?:Click|Pointer|Mouse|Key)(?:Down|Up|Press)?)$/.test(r)&&(n[r]=[o=>{var s;return(s=o==null?void 0:o.preventDefault)==null?void 0:s.call(o)}]);for(let r in n)Object.assign(t,{[r](o,...s){let i=n[r];for(let a of i){if((o instanceof Event||(o==null?void 0:o.nativeEvent)instanceof Event)&&o.defaultPrevented)return;a(o,...s)}}});return t}function Ja(...e){if(e.length===0)return{};if(e.length===1)return e[0];let t={},n={};for(let r of e)for(let o in r)o.startsWith("on")&&typeof r[o]=="function"?(n[o]!=null||(n[o]=[]),n[o].push(r[o])):t[o]=r[o];for(let r in n)Object.assign(t,{[r](...o){let s=n[r];for(let i of s)i==null||i(...o)}});return t}function Ke(e){var t;return Object.assign(C.forwardRef(e),{displayName:(t=e.displayName)!=null?t:e.name})}function It(e){let t=Object.assign({},e);for(let n in t)t[n]===void 0&&delete t[n];return t}function eo(e,t=[]){let n=Object.assign({},e);for(let r of t)r in n&&delete n[r];return n}function hd(e){return C.version.split(".")[0]>="19"?e.props.ref:e.ref}function pd(e,t,n){let[r,o]=C.useState(n),s=e!==void 0,i=C.useRef(s),a=C.useRef(!1),l=C.useRef(!1);return s&&!i.current&&!a.current?(a.current=!0,i.current=s,console.error("A component is changing from uncontrolled to controlled. This may be caused by the value changing from undefined to a defined value, which should not happen.")):!s&&i.current&&!l.current&&(l.current=!0,i.current=s,console.error("A component is changing from controlled to uncontrolled. This may be caused by the value changing from a defined value to undefined, which should not happen.")),[s?e:r,le(u=>(s||o(u),t==null?void 0:t(u)))]}function md(e){let[t]=C.useState(e);return t}function Za(e={},t=null,n=[]){for(let[r,o]of Object.entries(e))tl(n,el(t,r),o);return n}function el(e,t){return e?e+"["+t+"]":t}function tl(e,t,n){if(Array.isArray(n))for(let[r,o]of n.entries())tl(e,el(t,r.toString()),o);else n instanceof Date?e.push([t,n.toISOString()]):typeof n=="boolean"?e.push([t,n?"1":"0"]):typeof n=="string"?e.push([t,n]):typeof n=="number"?e.push([t,`${n}`]):n==null?e.push([t,""]):Za(n,t,e)}function gd(e){var t,n;let r=(t=e==null?void 0:e.form)!=null?t:e.closest("form");if(r){for(let o of r.elements)if(o!==e&&(o.tagName==="INPUT"&&o.type==="submit"||o.tagName==="BUTTON"&&o.type==="submit"||o.nodeName==="INPUT"&&o.type==="image")){o.click();return}(n=r.requestSubmit)==null||n.call(r)}}let bd="span";var rs=(e=>(e[e.None=1]="None",e[e.Focusable=2]="Focusable",e[e.Hidden=4]="Hidden",e))(rs||{});function vd(e,t){var n;let{features:r=1,...o}=e,s={ref:t,"aria-hidden":(r&2)===2?!0:(n=o["aria-hidden"])!=null?n:void 0,hidden:(r&4)===4?!0:void 0,style:{position:"fixed",top:1,left:1,width:1,height:0,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",...(r&4)===4&&(r&2)!==2&&{display:"none"}}};return Qe()({ourProps:s,theirProps:o,slot:{},defaultTag:bd,name:"Hidden"})}let nl=Ke(vd),yd=C.createContext(null);function wd({children:e}){let t=C.useContext(yd);if(!t)return C.createElement(C.Fragment,null,e);let{target:n}=t;return n?nt.createPortal(C.createElement(C.Fragment,null,e),n):null}function xd({data:e,form:t,disabled:n,onReset:r,overrides:o}){let[s,i]=C.useState(null),a=En();return C.useEffect(()=>{if(r&&s)return a.addEventListener(s,"reset",r)},[s,t,r]),C.createElement(wd,null,C.createElement(Ed,{setForm:i,formId:t}),Za(e).map(([l,u])=>C.createElement(nl,{features:rs.Hidden,...It({key:l,as:"input",type:"hidden",hidden:!0,readOnly:!0,form:t,disabled:n,name:l,value:u,...o})})))}function Ed({setForm:e,formId:t}){return C.useEffect(()=>{if(t){let n=document.getElementById(t);n&&e(n)}},[e,t]),t?null:C.createElement(nl,{features:rs.Hidden,as:"input",type:"hidden",hidden:!0,readOnly:!0,ref:n=>{if(!n)return;let r=n.closest("form");r&&e(r)}})}let Rd=C.createContext(void 0);function rl(){return C.useContext(Rd)}function Sd(e){let t=e.parentElement,n=null;for(;t&&!(t instanceof HTMLFieldSetElement);)t instanceof HTMLLegendElement&&(n=t),t=t.parentElement;let r=(t==null?void 0:t.getAttribute("disabled"))==="";return r&&Cd(n)?!1:r}function Cd(e){if(!e)return!1;let t=e.previousElementSibling;for(;t!==null;){if(t instanceof HTMLLegendElement)return!1;t=t.previousElementSibling}return!0}let ol=Symbol();function kd(e,t=!0){return Object.assign(e,{[ol]:t})}function st(...e){let t=C.useRef(e);C.useEffect(()=>{t.current=e},[e]);let n=le(r=>{for(let o of t.current)o!=null&&(typeof o=="function"?o(r):o.current=r)});return e.every(r=>r==null||(r==null?void 0:r[ol]))?void 0:n}let os=C.createContext(null);os.displayName="DescriptionContext";function sl(){let e=C.useContext(os);if(e===null){let t=new Error("You used a <Description /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(t,sl),t}return e}function Ad(){var e,t;return(t=(e=C.useContext(os))==null?void 0:e.value)!=null?t:void 0}let Od="p";function Td(e,t){let n=C.useId(),r=ns(),{id:o=`headlessui-description-${n}`,...s}=e,i=sl(),a=st(t);we(()=>i.register(o),[o,i.register]);let l=r||!1,u=C.useMemo(()=>({...i.slot,disabled:l}),[i.slot,l]),d={ref:a,...i.props,id:o};return Qe()({ourProps:d,theirProps:s,slot:u,defaultTag:Od,name:i.name||"Description"})}let Fd=Ke(Td);Object.assign(Fd,{});var ye=(e=>(e.Space=" ",e.Enter="Enter",e.Escape="Escape",e.Backspace="Backspace",e.Delete="Delete",e.ArrowLeft="ArrowLeft",e.ArrowUp="ArrowUp",e.ArrowRight="ArrowRight",e.ArrowDown="ArrowDown",e.Home="Home",e.End="End",e.PageUp="PageUp",e.PageDown="PageDown",e.Tab="Tab",e))(ye||{});let Dr=C.createContext(null);Dr.displayName="LabelContext";function il(){let e=C.useContext(Dr);if(e===null){let t=new Error("You used a <Label /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(t,il),t}return e}function al(e){var t,n,r;let o=(n=(t=C.useContext(Dr))==null?void 0:t.value)!=null?n:void 0;return((r=e==null?void 0:e.length)!=null?r:0)>0?[o,...e].filter(Boolean).join(" "):o}function Pd({inherit:e=!1}={}){let t=al(),[n,r]=C.useState([]),o=e?[t,...n].filter(Boolean):n;return[o.length>0?o.join(" "):void 0,C.useMemo(()=>function(s){let i=le(l=>(r(u=>[...u,l]),()=>r(u=>{let d=u.slice(),h=d.indexOf(l);return h!==-1&&d.splice(h,1),d}))),a=C.useMemo(()=>({register:i,slot:s.slot,name:s.name,props:s.props,value:s.value}),[i,s.slot,s.name,s.props,s.value]);return C.createElement(Dr.Provider,{value:a},s.children)},[r])]}let Md="label";function Id(e,t){var n;let r=C.useId(),o=il(),s=rl(),i=ns(),{id:a=`headlessui-label-${r}`,htmlFor:l=s??((n=o.props)==null?void 0:n.htmlFor),passive:u=!1,...d}=e,h=st(t);we(()=>o.register(a),[a,o.register]);let E=le(O=>{let N=O.currentTarget;if(N instanceof HTMLLabelElement&&O.preventDefault(),o.props&&"onClick"in o.props&&typeof o.props.onClick=="function"&&o.props.onClick(O),N instanceof HTMLLabelElement){let x=document.getElementById(N.htmlFor);if(x){let I=x.getAttribute("disabled");if(I==="true"||I==="")return;let B=x.getAttribute("aria-disabled");if(B==="true"||B==="")return;(x instanceof HTMLInputElement&&(x.type==="radio"||x.type==="checkbox")||x.role==="radio"||x.role==="checkbox"||x.role==="switch")&&x.click(),x.focus({preventScroll:!0})}}}),p=i||!1,g=C.useMemo(()=>({...o.slot,disabled:p}),[o.slot,p]),y={ref:h,...o.props,id:a,htmlFor:l,onClick:E};return u&&("onClick"in y&&(delete y.htmlFor,delete y.onClick),"onClick"in d&&delete d.onClick),Qe()({ourProps:y,theirProps:d,slot:g,defaultTag:l?Md:"div",name:o.name||"Label"})}let Dd=Ke(Id),ll=Object.assign(Dd,{});function Nd(e,t){return e!==null&&t!==null&&typeof e=="object"&&typeof t=="object"&&"id"in e&&"id"in t?e.id===t.id:e===t}function Ld(e=Nd){return C.useCallback((t,n)=>{if(typeof e=="string"){let r=e;return(t==null?void 0:t[r])===(n==null?void 0:n[r])}return e(t,n)},[e])}function $d(e){if(e===null)return{width:0,height:0};let{width:t,height:n}=e.getBoundingClientRect();return{width:t,height:n}}function jd(e,t=!1){let[n,r]=C.useReducer(()=>({}),{}),o=C.useMemo(()=>$d(e),[e,n]);return we(()=>{if(!e)return;let s=new ResizeObserver(r);return s.observe(e),()=>{s.disconnect()}},[e]),t?{width:`${o.width}px`,height:`${o.height}px`}:o}let Bd=class extends Map{constructor(t){super(),this.factory=t}get(t){let n=super.get(t);return n===void 0&&(n=this.factory(t),this.set(t,n)),n}};function cl(e,t){let n=e(),r=new Set;return{getSnapshot(){return n},subscribe(o){return r.add(o),()=>r.delete(o)},dispatch(o,...s){let i=t[o].call(n,...s);i&&(n=i,r.forEach(a=>a()))}}}function ul(e){return C.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot)}let Hd=new Bd(()=>cl(()=>[],{ADD(e){return this.includes(e)?this:[...this,e]},REMOVE(e){let t=this.indexOf(e);if(t===-1)return this;let n=this.slice();return n.splice(t,1),n}}));function ss(e,t){let n=Hd.get(t),r=C.useId(),o=ul(n);if(we(()=>{if(e)return n.dispatch("ADD",r),()=>n.dispatch("REMOVE",r)},[n,e]),!e)return!1;let s=o.indexOf(r),i=o.length;return s===-1&&(s=i,i+=1),s===i-1}let Lo=new Map,Nn=new Map;function si(e){var t;let n=(t=Nn.get(e))!=null?t:0;return Nn.set(e,n+1),n!==0?()=>ii(e):(Lo.set(e,{"aria-hidden":e.getAttribute("aria-hidden"),inert:e.inert}),e.setAttribute("aria-hidden","true"),e.inert=!0,()=>ii(e))}function ii(e){var t;let n=(t=Nn.get(e))!=null?t:1;if(n===1?Nn.delete(e):Nn.set(e,n-1),n!==1)return;let r=Lo.get(e);r&&(r["aria-hidden"]===null?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden",r["aria-hidden"]),e.inert=r.inert,Lo.delete(e))}function Ud(e,{allowed:t,disallowed:n}={}){let r=ss(e,"inert-others");we(()=>{var o,s;if(!r)return;let i=pt();for(let l of(o=n==null?void 0:n())!=null?o:[])l&&i.add(si(l));let a=(s=t==null?void 0:t())!=null?s:[];for(let l of a){if(!l)continue;let u=Xn(l);if(!u)continue;let d=l.parentElement;for(;d&&d!==u.body;){for(let h of d.children)a.some(E=>h.contains(E))||i.add(si(h));d=d.parentElement}}return i.dispose},[r,t,n])}function Wd(e,t,n){let r=Rn(o=>{let s=o.getBoundingClientRect();s.x===0&&s.y===0&&s.width===0&&s.height===0&&n()});C.useEffect(()=>{if(!e)return;let o=t===null?null:t instanceof HTMLElement?t:t.current;if(!o)return;let s=pt();if(typeof ResizeObserver<"u"){let i=new ResizeObserver(()=>r.current(o));i.observe(o),s.add(()=>i.disconnect())}if(typeof IntersectionObserver<"u"){let i=new IntersectionObserver(()=>r.current(o));i.observe(o),s.add(()=>i.disconnect())}return()=>s.dispose()},[t,r,e])}let $o=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].map(e=>`${e}:not([tabindex='-1'])`).join(","),qd=["[data-autofocus]"].map(e=>`${e}:not([tabindex='-1'])`).join(",");var jo=(e=>(e[e.First=1]="First",e[e.Previous=2]="Previous",e[e.Next=4]="Next",e[e.Last=8]="Last",e[e.WrapAround=16]="WrapAround",e[e.NoScroll=32]="NoScroll",e[e.AutoFocus=64]="AutoFocus",e))(jo||{}),zd=(e=>(e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow",e))(zd||{}),Gd=(e=>(e[e.Previous=-1]="Previous",e[e.Next=1]="Next",e))(Gd||{});function fl(e=document.body){return e==null?[]:Array.from(e.querySelectorAll($o)).sort((t,n)=>Math.sign((t.tabIndex||Number.MAX_SAFE_INTEGER)-(n.tabIndex||Number.MAX_SAFE_INTEGER)))}function Vd(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(qd)).sort((t,n)=>Math.sign((t.tabIndex||Number.MAX_SAFE_INTEGER)-(n.tabIndex||Number.MAX_SAFE_INTEGER)))}var is=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))(is||{});function dl(e,t=0){var n;return e===((n=Xn(e))==null?void 0:n.body)?!1:ft(t,{0(){return e.matches($o)},1(){let r=e;for(;r!==null;){if(r.matches($o))return!0;r=r.parentElement}return!1}})}var _d=(e=>(e[e.Keyboard=0]="Keyboard",e[e.Mouse=1]="Mouse",e))(_d||{});typeof window<"u"&&typeof document<"u"&&(document.addEventListener("keydown",e=>{e.metaKey||e.altKey||e.ctrlKey||(document.documentElement.dataset.headlessuiFocusVisible="")},!0),document.addEventListener("click",e=>{e.detail===1?delete document.documentElement.dataset.headlessuiFocusVisible:e.detail===0&&(document.documentElement.dataset.headlessuiFocusVisible="")},!0));let Qd=["textarea","input"].join(",");function Kd(e){var t,n;return(n=(t=e==null?void 0:e.matches)==null?void 0:t.call(e,Qd))!=null?n:!1}function hl(e,t=n=>n){return e.slice().sort((n,r)=>{let o=t(n),s=t(r);if(o===null||s===null)return 0;let i=o.compareDocumentPosition(s);return i&Node.DOCUMENT_POSITION_FOLLOWING?-1:i&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function Yd(e,t){return Xd(fl(),t,{relativeTo:e})}function Xd(e,t,{sorted:n=!0,relativeTo:r=null,skipElements:o=[]}={}){let s=Array.isArray(e)?e.length>0?e[0].ownerDocument:document:e.ownerDocument,i=Array.isArray(e)?n?hl(e):e:t&64?Vd(e):fl(e);o.length>0&&i.length>1&&(i=i.filter(p=>!o.some(g=>g!=null&&"current"in g?(g==null?void 0:g.current)===p:g===p))),r=r??s.activeElement;let a=(()=>{if(t&5)return 1;if(t&10)return-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),l=(()=>{if(t&1)return 0;if(t&2)return Math.max(0,i.indexOf(r))-1;if(t&4)return Math.max(0,i.indexOf(r))+1;if(t&8)return i.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),u=t&32?{preventScroll:!0}:{},d=0,h=i.length,E;do{if(d>=h||d+h<=0)return 0;let p=l+d;if(t&16)p=(p+h)%h;else{if(p<0)return 3;if(p>=h)return 1}E=i[p],E==null||E.focus(u),d+=a}while(E!==s.activeElement);return t&6&&Kd(E)&&E.select(),2}function pl(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function Jd(){return/Android/gi.test(window.navigator.userAgent)}function Zd(){return pl()||Jd()}function Tn(e,t,n,r){let o=Rn(n);C.useEffect(()=>{if(!e)return;function s(i){o.current(i)}return document.addEventListener(t,s,r),()=>document.removeEventListener(t,s,r)},[e,t,r])}function eh(e,t,n,r){let o=Rn(n);C.useEffect(()=>{if(!e)return;function s(i){o.current(i)}return window.addEventListener(t,s,r),()=>window.removeEventListener(t,s,r)},[e,t,r])}const ai=30;function th(e,t,n){let r=ss(e,"outside-click"),o=Rn(n),s=C.useCallback(function(l,u){if(l.defaultPrevented)return;let d=u(l);if(d===null||!d.getRootNode().contains(d)||!d.isConnected)return;let h=function E(p){return typeof p=="function"?E(p()):Array.isArray(p)||p instanceof Set?p:[p]}(t);for(let E of h)if(E!==null&&(E.contains(d)||l.composed&&l.composedPath().includes(E)))return;return!dl(d,is.Loose)&&d.tabIndex!==-1&&l.preventDefault(),o.current(l,d)},[o,t]),i=C.useRef(null);Tn(r,"pointerdown",l=>{var u,d;i.current=((d=(u=l.composedPath)==null?void 0:u.call(l))==null?void 0:d[0])||l.target},!0),Tn(r,"mousedown",l=>{var u,d;i.current=((d=(u=l.composedPath)==null?void 0:u.call(l))==null?void 0:d[0])||l.target},!0),Tn(r,"click",l=>{Zd()||i.current&&(s(l,()=>i.current),i.current=null)},!0);let a=C.useRef({x:0,y:0});Tn(r,"touchstart",l=>{a.current.x=l.touches[0].clientX,a.current.y=l.touches[0].clientY},!0),Tn(r,"touchend",l=>{let u={x:l.changedTouches[0].clientX,y:l.changedTouches[0].clientY};if(!(Math.abs(u.x-a.current.x)>=ai||Math.abs(u.y-a.current.y)>=ai))return s(l,()=>l.target instanceof HTMLElement?l.target:null)},!0),eh(r,"blur",l=>s(l,()=>window.document.activeElement instanceof HTMLIFrameElement?window.document.activeElement:null),!0)}function Bo(...e){return C.useMemo(()=>Xn(...e),[...e])}function nh(e,t){return C.useMemo(()=>{var n;if(e.type)return e.type;let r=(n=e.as)!=null?n:"button";if(typeof r=="string"&&r.toLowerCase()==="button"||(t==null?void 0:t.tagName)==="BUTTON"&&!t.hasAttribute("type"))return"button"},[e.type,e.as,t])}function rh(){let e;return{before({doc:t}){var n;let r=t.documentElement,o=(n=t.defaultView)!=null?n:window;e=Math.max(0,o.innerWidth-r.clientWidth)},after({doc:t,d:n}){let r=t.documentElement,o=Math.max(0,r.clientWidth-r.offsetWidth),s=Math.max(0,e-o);n.style(r,"paddingRight",`${s}px`)}}}function oh(){return pl()?{before({doc:e,d:t,meta:n}){function r(o){return n.containers.flatMap(s=>s()).some(s=>s.contains(o))}t.microTask(()=>{var o;if(window.getComputedStyle(e.documentElement).scrollBehavior!=="auto"){let a=pt();a.style(e.documentElement,"scrollBehavior","auto"),t.add(()=>t.microTask(()=>a.dispose()))}let s=(o=window.scrollY)!=null?o:window.pageYOffset,i=null;t.addEventListener(e,"click",a=>{if(a.target instanceof HTMLElement)try{let l=a.target.closest("a");if(!l)return;let{hash:u}=new URL(l.href),d=e.querySelector(u);d&&!r(d)&&(i=d)}catch{}},!0),t.addEventListener(e,"touchstart",a=>{if(a.target instanceof HTMLElement)if(r(a.target)){let l=a.target;for(;l.parentElement&&r(l.parentElement);)l=l.parentElement;t.style(l,"overscrollBehavior","contain")}else t.style(a.target,"touchAction","none")}),t.addEventListener(e,"touchmove",a=>{if(a.target instanceof HTMLElement){if(a.target.tagName==="INPUT")return;if(r(a.target)){let l=a.target;for(;l.parentElement&&l.dataset.headlessuiPortal!==""&&!(l.scrollHeight>l.clientHeight||l.scrollWidth>l.clientWidth);)l=l.parentElement;l.dataset.headlessuiPortal===""&&a.preventDefault()}else a.preventDefault()}},{passive:!1}),t.add(()=>{var a;let l=(a=window.scrollY)!=null?a:window.pageYOffset;s!==l&&window.scrollTo(0,s),i&&i.isConnected&&(i.scrollIntoView({block:"nearest"}),i=null)})})}}:{}}function sh(){return{before({doc:e,d:t}){t.style(e.documentElement,"overflow","hidden")}}}function ih(e){let t={};for(let n of e)Object.assign(t,n(t));return t}let Lt=cl(()=>new Map,{PUSH(e,t){var n;let r=(n=this.get(e))!=null?n:{doc:e,count:0,d:pt(),meta:new Set};return r.count++,r.meta.add(t),this.set(e,r),this},POP(e,t){let n=this.get(e);return n&&(n.count--,n.meta.delete(t)),this},SCROLL_PREVENT({doc:e,d:t,meta:n}){let r={doc:e,d:t,meta:ih(n)},o=[oh(),rh(),sh()];o.forEach(({before:s})=>s==null?void 0:s(r)),o.forEach(({after:s})=>s==null?void 0:s(r))},SCROLL_ALLOW({d:e}){e.dispose()},TEARDOWN({doc:e}){this.delete(e)}});Lt.subscribe(()=>{let e=Lt.getSnapshot(),t=new Map;for(let[n]of e)t.set(n,n.documentElement.style.overflow);for(let n of e.values()){let r=t.get(n.doc)==="hidden",o=n.count!==0;(o&&!r||!o&&r)&&Lt.dispatch(n.count>0?"SCROLL_PREVENT":"SCROLL_ALLOW",n),n.count===0&&Lt.dispatch("TEARDOWN",n)}});function ah(e,t,n=()=>({containers:[]})){let r=ul(Lt),o=t?r.get(t):void 0,s=o?o.count>0:!1;return we(()=>{if(!(!t||!e))return Lt.dispatch("PUSH",t,n),()=>Lt.dispatch("POP",t,n)},[e,t]),s}function lh(e,t,n=()=>[document.body]){let r=ss(e,"scroll-lock");ah(r,t,o=>{var s;return{containers:[...(s=o.containers)!=null?s:[],n]}})}function li(e){return[e.screenX,e.screenY]}function ch(){let e=C.useRef([-1,-1]);return{wasMoved(t){let n=li(t);return e.current[0]===n[0]&&e.current[1]===n[1]?!1:(e.current=n,!0)},update(t){e.current=li(t)}}}function uh(e=0){let[t,n]=C.useState(e),r=C.useCallback(l=>n(l),[t]),o=C.useCallback(l=>n(u=>u|l),[t]),s=C.useCallback(l=>(t&l)===l,[t]),i=C.useCallback(l=>n(u=>u&~l),[n]),a=C.useCallback(l=>n(u=>u^l),[n]);return{flags:t,setFlag:r,addFlag:o,hasFlag:s,removeFlag:i,toggleFlag:a}}var ci,ui;typeof process<"u"&&typeof globalThis<"u"&&typeof Element<"u"&&((ci=process==null?void 0:process.env)==null?void 0:ci.NODE_ENV)==="test"&&typeof((ui=Element==null?void 0:Element.prototype)==null?void 0:ui.getAnimations)>"u"&&(Element.prototype.getAnimations=function(){return console.warn(["Headless UI has polyfilled `Element.prototype.getAnimations` for your tests.","Please install a proper polyfill e.g. `jsdom-testing-mocks`, to silence these warnings.","","Example usage:","```js","import { mockAnimationsApi } from 'jsdom-testing-mocks'","mockAnimationsApi()","```"].join(`
|
|
41
|
+
`)),[]});var fh=(e=>(e[e.None=0]="None",e[e.Closed=1]="Closed",e[e.Enter=2]="Enter",e[e.Leave=4]="Leave",e))(fh||{});function dh(e){let t={};for(let n in e)e[n]===!0&&(t[`data-${n}`]="");return t}function hh(e,t,n,r){let[o,s]=C.useState(n),{hasFlag:i,addFlag:a,removeFlag:l}=uh(e&&o?3:0),u=C.useRef(!1),d=C.useRef(!1),h=En();return we(()=>{var E;if(e){if(n&&s(!0),!t){n&&a(3);return}return(E=void 0)==null||E.call(r,n),ph(t,{inFlight:u,prepare(){d.current?d.current=!1:d.current=u.current,u.current=!0,!d.current&&(n?(a(3),l(4)):(a(4),l(2)))},run(){d.current?n?(l(3),a(4)):(l(4),a(3)):n?l(1):a(1)},done(){var p;d.current&&typeof t.getAnimations=="function"&&t.getAnimations().length>0||(u.current=!1,l(7),n||s(!1),(p=void 0)==null||p.call(r,n))}})}},[e,n,t,h]),e?[o,{closed:i(1),enter:i(2),leave:i(4),transition:i(2)||i(4)}]:[n,{closed:void 0,enter:void 0,leave:void 0,transition:void 0}]}function ph(e,{prepare:t,run:n,done:r,inFlight:o}){let s=pt();return gh(e,{prepare:t,inFlight:o}),s.nextFrame(()=>{n(),s.requestAnimationFrame(()=>{s.add(mh(e,r))})}),s.dispose}function mh(e,t){var n,r;let o=pt();if(!e)return o.dispose;let s=!1;o.add(()=>{s=!0});let i=(r=(n=e.getAnimations)==null?void 0:n.call(e).filter(a=>a instanceof CSSTransition))!=null?r:[];return i.length===0?(t(),o.dispose):(Promise.allSettled(i.map(a=>a.finished)).then(()=>{s||t()}),o.dispose)}function gh(e,{inFlight:t,prepare:n}){if(t!=null&&t.current){n();return}let r=e.style.transition;e.style.transition="none",n(),e.style.transition=r}function bh(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(t=>{let{brand:n,version:r}=t;return n+"/"+r}).join(" "):navigator.userAgent}const ml={...D},vh=ml.useInsertionEffect,yh=vh||(e=>e());function gl(e){const t=D.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return yh(()=>{t.current=e}),D.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t.current==null?void 0:t.current(...r)},[])}var Ho=typeof document<"u"?C.useLayoutEffect:C.useEffect;let fi=!1,wh=0;const di=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+wh++;function xh(){const[e,t]=D.useState(()=>fi?di():void 0);return Ho(()=>{e==null&&t(di())},[]),D.useEffect(()=>{fi=!0},[]),e}const Eh=ml.useId,Rh=Eh||xh;let Un;process.env.NODE_ENV!=="production"&&(Un=new Set);function Sh(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const o="Floating UI: "+n.join(" ");if(!((e=Un)!=null&&e.has(o))){var s;(s=Un)==null||s.add(o),console.warn(o)}}function Ch(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const o="Floating UI: "+n.join(" ");if(!((e=Un)!=null&&e.has(o))){var s;(s=Un)==null||s.add(o),console.error(o)}}function kh(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(o=>o(n))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){var r;e.set(t,((r=e.get(t))==null?void 0:r.filter(o=>o!==n))||[])}}}const Ah=D.createContext(null),Oh=D.createContext(null),Th=()=>{var e;return((e=D.useContext(Ah))==null?void 0:e.id)||null},Fh=()=>D.useContext(Oh),Ph="data-floating-ui-focusable";function Mh(e){const{open:t=!1,onOpenChange:n,elements:r}=e,o=Rh(),s=D.useRef({}),[i]=D.useState(()=>kh()),a=Th()!=null;if(process.env.NODE_ENV!=="production"){const p=r.reference;p&&!ue(p)&&Ch("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[l,u]=D.useState(r.reference),d=gl((p,g,y)=>{s.current.openEvent=p?g:void 0,i.emit("openchange",{open:p,event:g,reason:y,nested:a}),n==null||n(p,g,y)}),h=D.useMemo(()=>({setPositionReference:u}),[]),E=D.useMemo(()=>({reference:l||r.reference||null,floating:r.floating||null,domReference:r.reference}),[l,r.reference,r.floating]);return D.useMemo(()=>({dataRef:s,open:t,onOpenChange:d,elements:E,events:i,floatingId:o,refs:h}),[t,d,E,i,o,h])}function Ih(e){e===void 0&&(e={});const{nodeId:t}=e,n=Mh({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,o=r.elements,[s,i]=D.useState(null),[a,l]=D.useState(null),d=(o==null?void 0:o.domReference)||s,h=D.useRef(null),E=Fh();Ho(()=>{d&&(h.current=d)},[d]);const p=aa({...e,elements:{...o,...a&&{reference:a}}}),g=D.useCallback(I=>{const B=ue(I)?{getBoundingClientRect:()=>I.getBoundingClientRect(),contextElement:I}:I;l(B),p.refs.setReference(B)},[p.refs]),y=D.useCallback(I=>{(ue(I)||I===null)&&(h.current=I,i(I)),(ue(p.refs.reference.current)||p.refs.reference.current===null||I!==null&&!ue(I))&&p.refs.setReference(I)},[p.refs]),O=D.useMemo(()=>({...p.refs,setReference:y,setPositionReference:g,domReference:h}),[p.refs,y,g]),N=D.useMemo(()=>({...p.elements,domReference:d}),[p.elements,d]),x=D.useMemo(()=>({...p,...r,refs:O,elements:N,nodeId:t}),[p,O,N,t,r]);return Ho(()=>{r.dataRef.current.floatingContext=x;const I=E==null?void 0:E.nodesRef.current.find(B=>B.id===t);I&&(I.context=x)}),D.useMemo(()=>({...p,context:x,refs:O,elements:N}),[p,O,N,x])}const hi="active",pi="selected";function to(e,t,n){const r=new Map,o=n==="item";let s=e;if(o&&e){const{[hi]:i,[pi]:a,...l}=e;s=l}return{...n==="floating"&&{tabIndex:-1,[Ph]:""},...s,...t.map(i=>{const a=i?i[n]:null;return typeof a=="function"?e?a(e):null:a}).concat(e).reduce((i,a)=>(a&&Object.entries(a).forEach(l=>{let[u,d]=l;if(!(o&&[hi,pi].includes(u)))if(u.indexOf("on")===0){if(r.has(u)||r.set(u,[]),typeof d=="function"){var h;(h=r.get(u))==null||h.push(d),i[u]=function(){for(var E,p=arguments.length,g=new Array(p),y=0;y<p;y++)g[y]=arguments[y];return(E=r.get(u))==null?void 0:E.map(O=>O(...g)).find(O=>O!==void 0)}}}else i[u]=d}),i),{})}}function Dh(e){e===void 0&&(e=[]);const t=e.map(a=>a==null?void 0:a.reference),n=e.map(a=>a==null?void 0:a.floating),r=e.map(a=>a==null?void 0:a.item),o=D.useCallback(a=>to(a,e,"reference"),t),s=D.useCallback(a=>to(a,e,"floating"),n),i=D.useCallback(a=>to(a,e,"item"),r);return D.useMemo(()=>({getReferenceProps:o,getFloatingProps:s,getItemProps:i}),[o,s,i])}function mi(e,t){return{...e,rects:{...e.rects,floating:{...e.rects.floating,height:t}}}}const Nh=e=>({name:"inner",options:e,async fn(t){const{listRef:n,overflowRef:r,onFallbackChange:o,offset:s=0,index:i=0,minItemsVisible:a=4,referenceOverflowThreshold:l=0,scrollRef:u,...d}=xn(e,t),{rects:h,elements:{floating:E}}=t,p=n.current[i],g=(u==null?void 0:u.current)||E,y=E.clientTop||g.clientTop,O=E.clientTop!==0,N=g.clientTop!==0,x=E===g;if(process.env.NODE_ENV!=="production"&&(t.placement.startsWith("bottom")||Sh('`placement` side must be "bottom" when using the `inner`',"middleware.")),!p)return{};const I={...t,...await Vo(-p.offsetTop-E.clientTop-h.reference.height/2-p.offsetHeight/2-s).fn(t)},B=await zr(mi(I,g.scrollHeight+y+E.clientTop),d),U=await zr(I,{...d,elementContext:"reference"}),H=Se(0,B.top),W=I.y+H,b=(g.scrollHeight>g.clientHeight?w=>w:$n)(Se(0,g.scrollHeight+(O&&x||N?y*2:0)-H-Se(0,B.bottom)));if(g.style.maxHeight=b+"px",g.scrollTop=H,o){const w=g.offsetHeight<p.offsetHeight*Vt(a,n.current.length)-1||U.top>=-l||U.bottom>=-l;Ln.flushSync(()=>o(w))}return r&&(r.current=await zr(mi({...I,y:W},g.offsetHeight+y+E.clientTop),d)),{y:W}}});function Lh(e,t){const{open:n,elements:r}=e,{enabled:o=!0,overflowRef:s,scrollRef:i,onChange:a}=t,l=gl(a),u=D.useRef(!1),d=D.useRef(null),h=D.useRef(null);D.useEffect(()=>{if(!o)return;function p(y){if(y.ctrlKey||!g||s.current==null)return;const O=y.deltaY,N=s.current.top>=-.5,x=s.current.bottom>=-.5,I=g.scrollHeight-g.clientHeight,B=O<0?-1:1,U=O<0?"max":"min";g.scrollHeight<=g.clientHeight||(!N&&O>0||!x&&O<0?(y.preventDefault(),Ln.flushSync(()=>{l(H=>H+Math[U](O,I*B))})):/firefox/i.test(bh())&&(g.scrollTop+=O))}const g=(i==null?void 0:i.current)||r.floating;if(n&&g)return g.addEventListener("wheel",p),requestAnimationFrame(()=>{d.current=g.scrollTop,s.current!=null&&(h.current={...s.current})}),()=>{d.current=null,h.current=null,g.removeEventListener("wheel",p)}},[o,n,r.floating,s,i,l]);const E=D.useMemo(()=>({onKeyDown(){u.current=!0},onWheel(){u.current=!1},onPointerMove(){u.current=!1},onScroll(){const p=(i==null?void 0:i.current)||r.floating;if(!(!s.current||!p||!u.current)){if(d.current!==null){const g=p.scrollTop-d.current;(s.current.bottom<-.5&&g<-1||s.current.top<-.5&&g>1)&&Ln.flushSync(()=>l(y=>y+g))}requestAnimationFrame(()=>{d.current=p.scrollTop})}}}),[r.floating,l,s,i]);return D.useMemo(()=>o?{floating:E}:{},[o,E])}let Sn=C.createContext({styles:void 0,setReference:()=>{},setFloating:()=>{},getReferenceProps:()=>({}),getFloatingProps:()=>({}),slot:{}});Sn.displayName="FloatingContext";let as=C.createContext(null);as.displayName="PlacementContext";function $h(e){return C.useMemo(()=>e?typeof e=="string"?{to:e}:e:null,[e])}function jh(){return C.useContext(Sn).setReference}function Bh(){return C.useContext(Sn).getReferenceProps}function Hh(){let{getFloatingProps:e,slot:t}=C.useContext(Sn);return C.useCallback((...n)=>Object.assign({},e(...n),{"data-anchor":t.anchor}),[e,t])}function Uh(e=null){e===!1&&(e=null),typeof e=="string"&&(e={to:e});let t=C.useContext(as),n=C.useMemo(()=>e,[JSON.stringify(e,(o,s)=>{var i;return(i=s==null?void 0:s.outerHTML)!=null?i:s})]);we(()=>{t==null||t(n??null)},[t,n]);let r=C.useContext(Sn);return C.useMemo(()=>[r.setFloating,e?r.styles:{}],[r.setFloating,e,r.styles])}let gi=4;function Wh({children:e,enabled:t=!0}){let[n,r]=C.useState(null),[o,s]=C.useState(0),i=C.useRef(null),[a,l]=C.useState(null);qh(a);let u=t&&n!==null&&a!==null,{to:d="bottom",gap:h=0,offset:E=0,padding:p=0,inner:g}=zh(n,a),[y,O="center"]=d.split(" ");we(()=>{u&&s(0)},[u]);let{refs:N,floatingStyles:x,context:I}=Ih({open:u,placement:y==="selection"?O==="center"?"bottom":`bottom-${O}`:O==="center"?`${y}`:`${y}-${O}`,strategy:"absolute",transform:!1,middleware:[Vo({mainAxis:y==="selection"?0:h,crossAxis:E}),la({padding:p}),y!=="selection"&&ca({padding:p}),y==="selection"&&g?Nh({...g,padding:p,overflowRef:i,offset:o,minItemsVisible:gi,referenceOverflowThreshold:p,onFallbackChange(w){var R,A;if(!w)return;let k=I.elements.floating;if(!k)return;let m=parseFloat(getComputedStyle(k).scrollPaddingBottom)||0,S=Math.min(gi,k.childElementCount),F=0,v=0;for(let M of(A=(R=I.elements.floating)==null?void 0:R.childNodes)!=null?A:[])if(M instanceof HTMLElement){let P=M.offsetTop,L=P+M.clientHeight+m,j=k.scrollTop,z=j+k.clientHeight;if(P>=j&&L<=z)S--;else{v=Math.max(0,Math.min(L,z)-Math.max(P,j)),F=M.clientHeight;break}}S>=1&&s(M=>{let P=F*S-v+m;return M>=P?M:P})}}):null,Eu({padding:p,apply({availableWidth:w,availableHeight:R,elements:A}){Object.assign(A.floating.style,{overflow:"auto",maxWidth:`${w}px`,maxHeight:`min(var(--anchor-max-height, 100vh), ${R}px)`})}})].filter(Boolean),whileElementsMounted:sa}),[B=y,U=O]=I.placement.split("-");y==="selection"&&(B="selection");let H=C.useMemo(()=>({anchor:[B,U].filter(Boolean).join(" ")}),[B,U]),W=Lh(I,{overflowRef:i,onChange:s}),{getReferenceProps:c,getFloatingProps:f}=Dh([W]),b=le(w=>{l(w),N.setFloating(w)});return D.createElement(as.Provider,{value:r},D.createElement(Sn.Provider,{value:{setFloating:b,setReference:N.setReference,styles:x,getReferenceProps:c,getFloatingProps:f,slot:H}},e))}function qh(e){we(()=>{if(!e)return;let t=new MutationObserver(()=>{let n=window.getComputedStyle(e).maxHeight,r=parseFloat(n);if(isNaN(r))return;let o=parseInt(n);isNaN(o)||r!==o&&(e.style.maxHeight=`${Math.ceil(r)}px`)});return t.observe(e,{attributes:!0,attributeFilter:["style"]}),()=>{t.disconnect()}},[e])}function zh(e,t){var n,r,o;let s=no((n=e==null?void 0:e.gap)!=null?n:"var(--anchor-gap, 0)",t),i=no((r=e==null?void 0:e.offset)!=null?r:"var(--anchor-offset, 0)",t),a=no((o=e==null?void 0:e.padding)!=null?o:"var(--anchor-padding, 0)",t);return{...e,gap:s,offset:i,padding:a}}function no(e,t,n=void 0){let r=En(),o=le((l,u)=>{if(l==null)return[n,null];if(typeof l=="number")return[l,null];if(typeof l=="string"){if(!u)return[n,null];let d=bi(l,u);return[d,h=>{let E=bl(l);{let p=E.map(g=>window.getComputedStyle(u).getPropertyValue(g));r.requestAnimationFrame(function g(){r.nextFrame(g);let y=!1;for(let[N,x]of E.entries()){let I=window.getComputedStyle(u).getPropertyValue(x);if(p[N]!==I){p[N]=I,y=!0;break}}if(!y)return;let O=bi(l,u);d!==O&&(h(O),d=O)})}return r.dispose}]}return[n,null]}),s=C.useMemo(()=>o(e,t)[0],[e,t]),[i=s,a]=C.useState();return we(()=>{let[l,u]=o(e,t);if(a(l),!!u)return u(a)},[e,t]),i}function bl(e){let t=/var\((.*)\)/.exec(e);if(t){let n=t[1].indexOf(",");if(n===-1)return[t[1]];let r=t[1].slice(0,n).trim(),o=t[1].slice(n+1).trim();return o?[r,...bl(o)]:[r]}return[]}function bi(e,t){let n=document.createElement("div");t.appendChild(n),n.style.setProperty("margin-top","0px","important"),n.style.setProperty("margin-top",e,"important");let r=parseFloat(window.getComputedStyle(n).marginTop)||0;return t.removeChild(n),r}function Gh(e,t){let[n,r]=C.useState(t);return!e&&n!==t&&r(t),e?n:t}let ls=C.createContext(null);ls.displayName="OpenClosedContext";var Wn=(e=>(e[e.Open=1]="Open",e[e.Closed=2]="Closed",e[e.Closing=4]="Closing",e[e.Opening=8]="Opening",e))(Wn||{});function Vh(){return C.useContext(ls)}function _h({value:e,children:t}){return C.createElement(ls.Provider,{value:e},t)}function Qh(e){throw new Error("Unexpected object: "+e)}var ve=(e=>(e[e.First=0]="First",e[e.Previous=1]="Previous",e[e.Next=2]="Next",e[e.Last=3]="Last",e[e.Specific=4]="Specific",e[e.Nothing=5]="Nothing",e))(ve||{});function ro(e,t){let n=t.resolveItems();if(n.length<=0)return null;let r=t.resolveActiveIndex(),o=r??-1;switch(e.focus){case 0:{for(let s=0;s<n.length;++s)if(!t.resolveDisabled(n[s],s,n))return s;return r}case 1:{o===-1&&(o=n.length);for(let s=o-1;s>=0;--s)if(!t.resolveDisabled(n[s],s,n))return s;return r}case 2:{for(let s=o+1;s<n.length;++s)if(!t.resolveDisabled(n[s],s,n))return s;return r}case 3:{for(let s=n.length-1;s>=0;--s)if(!t.resolveDisabled(n[s],s,n))return s;return r}case 4:{for(let s=0;s<n.length;++s)if(t.resolveId(n[s],s,n)===e.id)return s;return r}case 5:return null;default:Qh(e)}}function Kh(e){let t=le(e),n=C.useRef(!1);C.useEffect(()=>(n.current=!1,()=>{n.current=!0,Ya(()=>{n.current&&t()})}),[t])}function Yh(){let e=typeof document>"u";return"useSyncExternalStore"in D?(t=>t.useSyncExternalStore)(D)(()=>()=>{},()=>!1,()=>!e):!1}function Xh(){let e=Yh(),[t,n]=D.useState(Gt.isHandoffComplete);return t&&Gt.isHandoffComplete===!1&&n(!1),D.useEffect(()=>{t!==!0&&n(!0)},[t]),D.useEffect(()=>Gt.handoff(),[]),e?!1:t}let Jh=C.createContext(!1);function Zh(){return C.useContext(Jh)}function ep(e){let t=Zh(),n=C.useContext(yl),[r,o]=C.useState(()=>{var s;if(!t&&n!==null)return(s=n.current)!=null?s:null;if(Gt.isServer)return null;let i=e==null?void 0:e.getElementById("headlessui-portal-root");if(i)return i;if(e===null)return null;let a=e.createElement("div");return a.setAttribute("id","headlessui-portal-root"),e.body.appendChild(a)});return C.useEffect(()=>{r!==null&&(e!=null&&e.body.contains(r)||e==null||e.body.appendChild(r))},[r,e]),C.useEffect(()=>{t||n!==null&&o(n.current)},[n,o,t]),r}let vl=C.Fragment,tp=Ke(function(e,t){let{ownerDocument:n=null,...r}=e,o=C.useRef(null),s=st(kd(p=>{o.current=p}),t),i=Bo(o),a=n??i,l=ep(a),[u]=C.useState(()=>{var p;return Gt.isServer?null:(p=a==null?void 0:a.createElement("div"))!=null?p:null}),d=C.useContext(sp),h=Xh();we(()=>{!l||!u||l.contains(u)||(u.setAttribute("data-headlessui-portal",""),l.appendChild(u))},[l,u]),we(()=>{if(u&&d)return d.register(u)},[d,u]),Kh(()=>{var p;!l||!u||(u instanceof Node&&l.contains(u)&&l.removeChild(u),l.childNodes.length<=0&&((p=l.parentElement)==null||p.removeChild(l)))});let E=Qe();return h?!l||!u?null:nt.createPortal(E({ourProps:{ref:s},theirProps:r,slot:{},defaultTag:vl,name:"Portal"}),u):null});function np(e,t){let n=st(t),{enabled:r=!0,ownerDocument:o,...s}=e,i=Qe();return r?C.createElement(tp,{...s,ownerDocument:o,ref:n}):i({ourProps:{ref:n},theirProps:s,slot:{},defaultTag:vl,name:"Portal"})}let rp=C.Fragment,yl=C.createContext(null);function op(e,t){let{target:n,...r}=e,o={ref:st(t)},s=Qe();return C.createElement(yl.Provider,{value:n},s({ourProps:o,theirProps:r,defaultTag:rp,name:"Popover.Group"}))}let sp=C.createContext(null),ip=Ke(np),ap=Ke(op),lp=Object.assign(ip,{Group:ap});function cp(e,t){let n=C.useRef({left:0,top:0});if(we(()=>{if(!t)return;let o=t.getBoundingClientRect();o&&(n.current=o)},[e,t]),t==null||!e||t===document.activeElement)return!1;let r=t.getBoundingClientRect();return r.top!==n.current.top||r.left!==n.current.left}let vi=/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g;function yi(e){var t,n;let r=(t=e.innerText)!=null?t:"",o=e.cloneNode(!0);if(!(o instanceof HTMLElement))return r;let s=!1;for(let a of o.querySelectorAll('[hidden],[aria-hidden],[role="img"]'))a.remove(),s=!0;let i=s?(n=o.innerText)!=null?n:"":r;return vi.test(i)&&(i=i.replace(vi,"")),i}function up(e){let t=e.getAttribute("aria-label");if(typeof t=="string")return t.trim();let n=e.getAttribute("aria-labelledby");if(n){let r=n.split(" ").map(o=>{let s=document.getElementById(o);if(s){let i=s.getAttribute("aria-label");return typeof i=="string"?i.trim():yi(s).trim()}return null}).filter(Boolean);if(r.length>0)return r.join(", ")}return yi(e).trim()}function fp(e){let t=C.useRef(""),n=C.useRef("");return le(()=>{let r=e.current;if(!r)return"";let o=r.innerText;if(t.current===o)return n.current;let s=up(r).trim().toLowerCase();return t.current=o,n.current=s,s})}var dp=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(dp||{}),hp=(e=>(e[e.Single=0]="Single",e[e.Multi=1]="Multi",e))(hp||{}),pp=(e=>(e[e.Pointer=0]="Pointer",e[e.Other=1]="Other",e))(pp||{}),mp=(e=>(e[e.OpenListbox=0]="OpenListbox",e[e.CloseListbox=1]="CloseListbox",e[e.GoToOption=2]="GoToOption",e[e.Search=3]="Search",e[e.ClearSearch=4]="ClearSearch",e[e.RegisterOption=5]="RegisterOption",e[e.UnregisterOption=6]="UnregisterOption",e[e.SetButtonElement=7]="SetButtonElement",e[e.SetOptionsElement=8]="SetOptionsElement",e))(mp||{});function oo(e,t=n=>n){let n=e.activeOptionIndex!==null?e.options[e.activeOptionIndex]:null,r=hl(t(e.options.slice()),s=>s.dataRef.current.domRef.current),o=n?r.indexOf(n):null;return o===-1&&(o=null),{options:r,activeOptionIndex:o}}let gp={1(e){return e.dataRef.current.disabled||e.listboxState===1?e:{...e,activeOptionIndex:null,listboxState:1,__demoMode:!1}},0(e){if(e.dataRef.current.disabled||e.listboxState===0)return e;let t=e.activeOptionIndex,{isSelected:n}=e.dataRef.current,r=e.options.findIndex(o=>n(o.dataRef.current.value));return r!==-1&&(t=r),{...e,listboxState:0,activeOptionIndex:t,__demoMode:!1}},2(e,t){var n,r,o,s,i;if(e.dataRef.current.disabled||e.listboxState===1)return e;let a={...e,searchQuery:"",activationTrigger:(n=t.trigger)!=null?n:1,__demoMode:!1};if(t.focus===ve.Nothing)return{...a,activeOptionIndex:null};if(t.focus===ve.Specific)return{...a,activeOptionIndex:e.options.findIndex(d=>d.id===t.id)};if(t.focus===ve.Previous){let d=e.activeOptionIndex;if(d!==null){let h=e.options[d].dataRef.current.domRef,E=ro(t,{resolveItems:()=>e.options,resolveActiveIndex:()=>e.activeOptionIndex,resolveId:p=>p.id,resolveDisabled:p=>p.dataRef.current.disabled});if(E!==null){let p=e.options[E].dataRef.current.domRef;if(((r=h.current)==null?void 0:r.previousElementSibling)===p.current||((o=p.current)==null?void 0:o.previousElementSibling)===null)return{...a,activeOptionIndex:E}}}}else if(t.focus===ve.Next){let d=e.activeOptionIndex;if(d!==null){let h=e.options[d].dataRef.current.domRef,E=ro(t,{resolveItems:()=>e.options,resolveActiveIndex:()=>e.activeOptionIndex,resolveId:p=>p.id,resolveDisabled:p=>p.dataRef.current.disabled});if(E!==null){let p=e.options[E].dataRef.current.domRef;if(((s=h.current)==null?void 0:s.nextElementSibling)===p.current||((i=p.current)==null?void 0:i.nextElementSibling)===null)return{...a,activeOptionIndex:E}}}}let l=oo(e),u=ro(t,{resolveItems:()=>l.options,resolveActiveIndex:()=>l.activeOptionIndex,resolveId:d=>d.id,resolveDisabled:d=>d.dataRef.current.disabled});return{...a,...l,activeOptionIndex:u}},3:(e,t)=>{if(e.dataRef.current.disabled||e.listboxState===1)return e;let n=e.searchQuery!==""?0:1,r=e.searchQuery+t.value.toLowerCase(),o=(e.activeOptionIndex!==null?e.options.slice(e.activeOptionIndex+n).concat(e.options.slice(0,e.activeOptionIndex+n)):e.options).find(i=>{var a;return!i.dataRef.current.disabled&&((a=i.dataRef.current.textValue)==null?void 0:a.startsWith(r))}),s=o?e.options.indexOf(o):-1;return s===-1||s===e.activeOptionIndex?{...e,searchQuery:r}:{...e,searchQuery:r,activeOptionIndex:s,activationTrigger:1}},4(e){return e.dataRef.current.disabled||e.listboxState===1||e.searchQuery===""?e:{...e,searchQuery:""}},5:(e,t)=>{let n={id:t.id,dataRef:t.dataRef},r=oo(e,o=>[...o,n]);return e.activeOptionIndex===null&&e.dataRef.current.isSelected(t.dataRef.current.value)&&(r.activeOptionIndex=r.options.indexOf(n)),{...e,...r}},6:(e,t)=>{let n=oo(e,r=>{let o=r.findIndex(s=>s.id===t.id);return o!==-1&&r.splice(o,1),r});return{...e,...n,activationTrigger:1}},7:(e,t)=>e.buttonElement===t.element?e:{...e,buttonElement:t.element},8:(e,t)=>e.optionsElement===t.element?e:{...e,optionsElement:t.element}},cs=C.createContext(null);cs.displayName="ListboxActionsContext";function Nr(e){let t=C.useContext(cs);if(t===null){let n=new Error(`<${e} /> is missing a parent <Listbox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,Nr),n}return t}let Lr=C.createContext(null);Lr.displayName="ListboxDataContext";function Jn(e){let t=C.useContext(Lr);if(t===null){let n=new Error(`<${e} /> is missing a parent <Listbox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,Jn),n}return t}function bp(e,t){return ft(t.type,gp,e,t)}let vp=C.Fragment;function yp(e,t){var n;let r=ns(),{value:o,defaultValue:s,form:i,name:a,onChange:l,by:u,invalid:d=!1,disabled:h=r||!1,horizontal:E=!1,multiple:p=!1,__demoMode:g=!1,...y}=e;const O=E?"horizontal":"vertical";let N=st(t),x=md(s),[I=p?[]:void 0,B]=pd(o,l,x),[U,H]=C.useReducer(bp,{dataRef:C.createRef(),listboxState:g?0:1,options:[],searchQuery:"",activeOptionIndex:null,activationTrigger:1,optionsVisible:!1,buttonElement:null,optionsElement:null,__demoMode:g}),W=C.useRef({static:!1,hold:!1}),c=C.useRef(new Map),f=Ld(u),b=C.useCallback(G=>ft(w.mode,{1:()=>I.some(_=>f(_,G)),0:()=>f(I,G)}),[I]),w=C.useMemo(()=>({...U,value:I,disabled:h,invalid:d,mode:p?1:0,orientation:O,compare:f,isSelected:b,optionsPropsRef:W,listRef:c}),[I,h,d,p,U,c]);we(()=>{U.dataRef.current=w},[w]);let R=w.listboxState===0;th(R,[w.buttonElement,w.optionsElement],(G,_)=>{var J;H({type:1}),dl(_,is.Loose)||(G.preventDefault(),(J=w.buttonElement)==null||J.focus())});let A=C.useMemo(()=>({open:w.listboxState===0,disabled:h,invalid:d,value:I}),[w,h,I,d]),k=le(G=>{let _=w.options.find(J=>J.id===G);_&&L(_.dataRef.current.value)}),m=le(()=>{if(w.activeOptionIndex!==null){let{dataRef:G,id:_}=w.options[w.activeOptionIndex];L(G.current.value),H({type:2,focus:ve.Specific,id:_})}}),S=le(()=>H({type:0})),F=le(()=>H({type:1})),v=En(),M=le((G,_,J)=>{v.dispose(),v.microTask(()=>G===ve.Specific?H({type:2,focus:ve.Specific,id:_,trigger:J}):H({type:2,focus:G,trigger:J}))}),P=le((G,_)=>(H({type:5,id:G,dataRef:_}),()=>H({type:6,id:G}))),L=le(G=>ft(w.mode,{0(){return B==null?void 0:B(G)},1(){let _=w.value.slice(),J=_.findIndex(ne=>f(ne,G));return J===-1?_.push(G):_.splice(J,1),B==null?void 0:B(_)}})),j=le(G=>H({type:3,value:G})),z=le(()=>H({type:4})),q=le(G=>{H({type:7,element:G})}),V=le(G=>{H({type:8,element:G})}),X=C.useMemo(()=>({onChange:L,registerOption:P,goToOption:M,closeListbox:F,openListbox:S,selectActiveOption:m,selectOption:k,search:j,clearSearch:z,setButtonElement:q,setOptionsElement:V}),[]),[ee,ae]=Pd({inherit:!0}),de={ref:N},pe=C.useCallback(()=>{if(x!==void 0)return B==null?void 0:B(x)},[B,x]),Z=Qe();return C.createElement(ae,{value:ee,props:{htmlFor:(n=w.buttonElement)==null?void 0:n.id},slot:{open:w.listboxState===0,disabled:h}},C.createElement(Wh,null,C.createElement(cs.Provider,{value:X},C.createElement(Lr.Provider,{value:w},C.createElement(_h,{value:ft(w.listboxState,{0:Wn.Open,1:Wn.Closed})},a!=null&&I!=null&&C.createElement(xd,{disabled:h,data:{[a]:I},form:i,onReset:pe}),Z({ourProps:de,theirProps:y,slot:A,defaultTag:vp,name:"Listbox"}))))))}let wp="button";function xp(e,t){var n;let r=Jn("Listbox.Button"),o=Nr("Listbox.Button"),s=C.useId(),i=rl(),{id:a=i||`headlessui-listbox-button-${s}`,disabled:l=r.disabled||!1,autoFocus:u=!1,...d}=e,h=st(t,jh(),o.setButtonElement),E=Bh(),p=le(w=>{switch(w.key){case ye.Enter:gd(w.currentTarget);break;case ye.Space:case ye.ArrowDown:w.preventDefault(),nt.flushSync(()=>o.openListbox()),r.value||o.goToOption(ve.First);break;case ye.ArrowUp:w.preventDefault(),nt.flushSync(()=>o.openListbox()),r.value||o.goToOption(ve.Last);break}}),g=le(w=>{switch(w.key){case ye.Space:w.preventDefault();break}}),y=le(w=>{var R;if(Sd(w.currentTarget))return w.preventDefault();r.listboxState===0?(nt.flushSync(()=>o.closeListbox()),(R=r.buttonElement)==null||R.focus({preventScroll:!0})):(w.preventDefault(),o.openListbox())}),O=le(w=>w.preventDefault()),N=al([a]),x=Ad(),{isFocusVisible:I,focusProps:B}=td({autoFocus:u}),{isHovered:U,hoverProps:H}=ed({isDisabled:l}),{pressed:W,pressProps:c}=ad({disabled:l}),f=C.useMemo(()=>({open:r.listboxState===0,active:W||r.listboxState===0,disabled:l,invalid:r.invalid,value:r.value,hover:U,focus:I,autofocus:u}),[r.listboxState,r.value,l,U,I,W,r.invalid,u]),b=Ja(E(),{ref:h,id:a,type:nh(e,r.buttonElement),"aria-haspopup":"listbox","aria-controls":(n=r.optionsElement)==null?void 0:n.id,"aria-expanded":r.listboxState===0,"aria-labelledby":N,"aria-describedby":x,disabled:l||void 0,autoFocus:u,onKeyDown:p,onKeyUp:g,onKeyPress:O,onClick:y},B,H,c);return Qe()({ourProps:b,theirProps:d,slot:f,defaultTag:wp,name:"Listbox.Button"})}let wl=C.createContext(!1),Ep="div",Rp=No.RenderStrategy|No.Static;function Sp(e,t){var n,r;let o=C.useId(),{id:s=`headlessui-listbox-options-${o}`,anchor:i,portal:a=!1,modal:l=!0,transition:u=!1,...d}=e,h=$h(i),[E,p]=C.useState(null);h&&(a=!0);let g=Jn("Listbox.Options"),y=Nr("Listbox.Options"),O=Bo(g.buttonElement),N=Bo(g.optionsElement),x=Vh(),[I,B]=hh(u,E,x!==null?(x&Wn.Open)===Wn.Open:g.listboxState===0);Wd(I,g.buttonElement,y.closeListbox);let U=g.__demoMode?!1:l&&g.listboxState===0;lh(U,N);let H=g.__demoMode?!1:l&&g.listboxState===0;Ud(H,{allowed:C.useCallback(()=>[g.buttonElement,g.optionsElement],[g.buttonElement,g.optionsElement])});let W=g.listboxState!==0,c=cp(W,g.buttonElement)?!1:I,f=I&&g.listboxState===1,b=Gh(f,g.value),w=le(q=>g.compare(b,q)),R=C.useMemo(()=>{var q;if(h==null||!((q=h==null?void 0:h.to)!=null&&q.includes("selection")))return null;let V=g.options.findIndex(X=>w(X.dataRef.current.value));return V===-1&&(V=0),V},[h,g.options]),A=(()=>{if(h==null)return;if(R===null)return{...h,inner:void 0};let q=Array.from(g.listRef.current.values());return{...h,inner:{listRef:{current:q},index:R}}})(),[k,m]=Uh(A),S=Hh(),F=st(t,h?k:null,y.setOptionsElement,p),v=En();C.useEffect(()=>{var q;let V=g.optionsElement;V&&g.listboxState===0&&V!==((q=Xn(V))==null?void 0:q.activeElement)&&(V==null||V.focus({preventScroll:!0}))},[g.listboxState,g.optionsElement]);let M=le(q=>{var V,X;switch(v.dispose(),q.key){case ye.Space:if(g.searchQuery!=="")return q.preventDefault(),q.stopPropagation(),y.search(q.key);case ye.Enter:if(q.preventDefault(),q.stopPropagation(),g.activeOptionIndex!==null){let{dataRef:ee}=g.options[g.activeOptionIndex];y.onChange(ee.current.value)}g.mode===0&&(nt.flushSync(()=>y.closeListbox()),(V=g.buttonElement)==null||V.focus({preventScroll:!0}));break;case ft(g.orientation,{vertical:ye.ArrowDown,horizontal:ye.ArrowRight}):return q.preventDefault(),q.stopPropagation(),y.goToOption(ve.Next);case ft(g.orientation,{vertical:ye.ArrowUp,horizontal:ye.ArrowLeft}):return q.preventDefault(),q.stopPropagation(),y.goToOption(ve.Previous);case ye.Home:case ye.PageUp:return q.preventDefault(),q.stopPropagation(),y.goToOption(ve.First);case ye.End:case ye.PageDown:return q.preventDefault(),q.stopPropagation(),y.goToOption(ve.Last);case ye.Escape:q.preventDefault(),q.stopPropagation(),nt.flushSync(()=>y.closeListbox()),(X=g.buttonElement)==null||X.focus({preventScroll:!0});return;case ye.Tab:q.preventDefault(),q.stopPropagation(),nt.flushSync(()=>y.closeListbox()),Yd(g.buttonElement,q.shiftKey?jo.Previous:jo.Next);break;default:q.key.length===1&&(y.search(q.key),v.setTimeout(()=>y.clearSearch(),350));break}}),P=(n=g.buttonElement)==null?void 0:n.id,L=C.useMemo(()=>({open:g.listboxState===0}),[g.listboxState]),j=Ja(h?S():{},{id:s,ref:F,"aria-activedescendant":g.activeOptionIndex===null||(r=g.options[g.activeOptionIndex])==null?void 0:r.id,"aria-multiselectable":g.mode===1?!0:void 0,"aria-labelledby":P,"aria-orientation":g.orientation,onKeyDown:M,role:"listbox",tabIndex:g.listboxState===0?0:void 0,style:{...d.style,...m,"--button-width":jd(g.buttonElement,!0).width},...dh(B)}),z=Qe();return C.createElement(lp,{enabled:a?e.static||I:!1,ownerDocument:O},C.createElement(Lr.Provider,{value:g.mode===1?g:{...g,isSelected:w}},z({ourProps:j,theirProps:d,slot:L,defaultTag:Ep,features:Rp,visible:c,name:"Listbox.Options"})))}let Cp="div";function kp(e,t){let n=C.useId(),{id:r=`headlessui-listbox-option-${n}`,disabled:o=!1,value:s,...i}=e,a=C.useContext(wl)===!0,l=Jn("Listbox.Option"),u=Nr("Listbox.Option"),d=l.activeOptionIndex!==null?l.options[l.activeOptionIndex].id===r:!1,h=l.isSelected(s),E=C.useRef(null),p=fp(E),g=Rn({disabled:o,value:s,domRef:E,get textValue(){return p()}}),y=st(t,E,f=>{f?l.listRef.current.set(r,f):l.listRef.current.delete(r)});we(()=>{if(!l.__demoMode&&l.listboxState===0&&d&&l.activationTrigger!==0)return pt().requestAnimationFrame(()=>{var f,b;(b=(f=E.current)==null?void 0:f.scrollIntoView)==null||b.call(f,{block:"nearest"})})},[E,d,l.__demoMode,l.listboxState,l.activationTrigger,l.activeOptionIndex]),we(()=>{if(!a)return u.registerOption(r,g)},[g,r,a]);let O=le(f=>{var b;if(o)return f.preventDefault();u.onChange(s),l.mode===0&&(nt.flushSync(()=>u.closeListbox()),(b=l.buttonElement)==null||b.focus({preventScroll:!0}))}),N=le(()=>{if(o)return u.goToOption(ve.Nothing);u.goToOption(ve.Specific,r)}),x=ch(),I=le(f=>{x.update(f),!o&&(d||u.goToOption(ve.Specific,r,0))}),B=le(f=>{x.wasMoved(f)&&(o||d||u.goToOption(ve.Specific,r,0))}),U=le(f=>{x.wasMoved(f)&&(o||d&&u.goToOption(ve.Nothing))}),H=C.useMemo(()=>({active:d,focus:d,selected:h,disabled:o,selectedOption:h&&a}),[d,h,o,a]),W=a?{}:{id:r,ref:y,role:"option",tabIndex:o===!0?void 0:-1,"aria-disabled":o===!0?!0:void 0,"aria-selected":h,disabled:void 0,onClick:O,onFocus:N,onPointerEnter:I,onMouseEnter:I,onPointerMove:B,onMouseMove:B,onPointerLeave:U,onMouseLeave:U},c=Qe();return!h&&a?null:c({ourProps:W,theirProps:i,slot:H,defaultTag:Cp,name:"Listbox.Option"})}let Ap=C.Fragment;function Op(e,t){let{options:n,placeholder:r,...o}=e,s={ref:st(t)},i=Jn("ListboxSelectedOption"),a=C.useMemo(()=>({}),[]),l=i.value===void 0||i.value===null||i.mode===1&&Array.isArray(i.value)&&i.value.length===0,u=Qe();return C.createElement(wl.Provider,{value:!0},u({ourProps:s,theirProps:{...o,children:C.createElement(C.Fragment,null,r&&l?r:n)},slot:a,defaultTag:Ap,name:"ListboxSelectedOption"}))}let Tp=Ke(yp),xl=Ke(xp),Fp=ll,El=Ke(Sp),Rl=Ke(kp),Pp=Ke(Op),Mp=Object.assign(Tp,{Button:xl,Label:Fp,Options:El,Option:Rl,SelectedOption:Pp});function Sl(e={}){const{activeAddress:t,algodClient:n}=dt.useWallet(),{enabled:r=!0}=e;return Xo({queryKey:["account-info",t],queryFn:async()=>{if(!t||!n)return null;try{return await n.accountInformation(t).do()}catch(o){throw new Error(`Error fetching account information: ${o}`)}},enabled:r&&!!t&&!!n,refetchOnWindowFocus:!0})}const Ip=()=>new gf({defaultOptions:{queries:{staleTime:5*60*1e3,gcTime:60*60*1e3,refetchOnWindowFocus:!0,refetchInterval:10*60*1e3,retry:(e,t)=>t instanceof Error&&t.message.includes("404")?!1:e<3}}}),Cl=C.createContext(void 0);function Dp({enabled:e,nfdView:t}){const n=La(),{activeAddress:r,activeWallet:o,algodClient:s}=dt.useWallet(),{activeNetwork:i}=dt.useNetwork(),a=C.useRef(null);return C.useEffect(()=>{if(!e){a.current=r;return}const l=a.current===null&&r!==null&&o!==null&&o.accounts!==void 0&&o.accounts.length>0&&s!==void 0;if(a.current=r,!l)return;console.log(`[WalletUI] Prefetching data for all accounts in wallet ${o.id}`);const u=o.accounts.map(d=>d.address);if(u.length>0){const h=[];for(let E=0;E<u.length;E+=20)h.push(u.slice(E,E+20));h.forEach(async E=>{const g=i==="testnet"?"https://api.testnet.nf.domains":"https://api.nf.domains",y=new URLSearchParams;E.forEach(O=>{y.append("address",O)}),y.append("view",t);try{const O=await fetch(`${g}/nfd/lookup?${y.toString()}`,{method:"GET",headers:{Accept:"application/json"}});if(!O.ok&&O.status!==404)throw new Error(`NFD prefetch lookup failed: ${O.statusText}`);const N=O.status===404?{}:await O.json();E.forEach(x=>{const I=N[x]||null;n.setQueryData(["nfd",x,i,t],I)})}catch(O){console.error("Error prefetching NFD data:",O)}})}u.forEach(d=>{n.prefetchQuery({queryKey:["account-balance",d],queryFn:async()=>{try{const h=await s.accountInformation(d).do();return Number(h.amount)}catch(h){throw new Error(`Error fetching account balance: ${h}`)}}})})},[r,o,i,t,s,n,e]),null}function Np({children:e,queryClient:t,enablePrefetching:n=!0,prefetchNfdView:r="thumbnail"}){const o=C.useMemo(()=>t||Ip(),[t]),s=C.useMemo(()=>({queryClient:o}),[o]),i=$.jsxs(Cl.Provider,{value:s,children:[$.jsx(Dp,{enabled:n,nfdView:r}),e]});return t?i:$.jsx($a,{client:o,children:i})}function kl(){const e=C.useContext(Cl);if(e===void 0)throw new Error("useWalletUI must be used within a WalletUIProvider");return e}function Lp({className:e,scale:t=.85}){return $.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:en("inline-block align-baseline",e),style:{width:`${t}em`,height:`${t}em`},"aria-label":"Algorand",fill:"currentColor","data-wallet-ui":!0,children:$.jsx("path",{d:"M23.98 23.99h-3.75l-2.44-9.07-5.25 9.07H8.34l8.1-14.04-1.3-4.88L4.22 24H.02L13.88 0h3.67l1.61 5.96h3.79l-2.59 4.5 3.62 13.53z"})})}function $p({children:e}){var A;const{activeAddress:t,activeWallet:n}=dt.useWallet(),[r,o]=C.useState(!1),[s,i]=C.useState(!1),[a,l]=C.useState(()=>{const k=localStorage.getItem("uwui:balance-preference");return k?k==="available":!1}),u=Jo({enabled:!!t}),d=((A=u.data)==null?void 0:A.name)??null,{data:h}=Sl({enabled:!!t}),E=C.useMemo(()=>!h||h.amount===void 0?null:Number(h.amount)/1e6,[h]),p=C.useMemo(()=>{if(!h||h.amount===void 0||h.minBalance===void 0)return null;const k=Number(h.amount)-Number(h.minBalance);return Math.max(0,k/1e6)},[h]),g=a?p:E,{refs:y,floatingStyles:O,context:N}=Ea({open:r,onOpenChange:o,placement:"bottom-end",middleware:[Vo(8),ca(),la()],whileElementsMounted:sa}),x=wa(N),I=xa(N,{outsidePressEvent:"mousedown"}),{getReferenceProps:B,getFloatingProps:U}=Ra([x,I]),H=vn(),W=()=>{t&&(navigator.clipboard.writeText(t),i(!0),setTimeout(()=>i(!1),2e3))},c=async()=>{if(n)try{await n.disconnect(),o(!1)}catch(k){console.error("Error disconnecting wallet:",k)}},f=k=>{n&&n.setActiveAccount&&n.setActiveAccount(k)},b=()=>{const k=!a;l(k),localStorage.setItem("uwui:balance-preference",k?"available":"total")},w=e||$.jsx(Ir,{}),R=C.cloneElement(w,B({ref:y.setReference}));return $.jsxs($.Fragment,{children:[R,r&&$.jsx(ba,{children:$.jsx(ya,{context:N,modal:!1,children:$.jsx("div",{ref:y.setFloating,style:O,...U(),"aria-labelledby":H,className:"z-50 w-80 rounded-xl bg-white dark:bg-[#001324] shadow-xl border border-gray-200 dark:border-[#192A39]","data-wallet-ui":!0,children:$.jsxs("div",{className:"p-4",children:[$.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[$.jsx("div",{className:"h-12 w-12 overflow-hidden",children:$.jsx(Zo,{nfd:u.data,alt:`${d||t} avatar`,size:48})}),$.jsxs("div",{children:[$.jsx("h3",{id:H,className:"text-lg font-bold text-gray-900 dark:text-[#E9E9FD] max-w-[220px] truncate wallet-custom-font",children:d||(t?Fn(t,6,4):"My Wallet")}),d&&t&&$.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:Fn(t,6,4)})]})]}),$.jsx("div",{className:"mb-4 bg-gray-50 dark:bg-[#101B29] rounded-lg p-3",children:$.jsxs("div",{className:"flex justify-between items-center",children:[g!==null&&$.jsxs("span",{className:"text-base font-medium text-gray-900 dark:text-white flex items-center gap-1",children:[Ju(g,{fractionDigits:4}),$.jsx(Lp,{})]}),$.jsxs("button",{onClick:b,className:"flex items-center gap-1 text-sm text-gray-600 dark:text-gray-400 bg-gray-200 dark:bg-[#192A39] py-1 pl-2.5 pr-2 rounded-md hover:bg-gray-300 dark:hover:bg-[#263A4A] transition-colors focus:outline-none",title:a?"Show total balance":"Show available balance",children:[a?"Available":"Total",$.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"ml-0.5 opacity-80",children:[$.jsx("path",{d:"m17 10-5-5-5 5"}),$.jsx("path",{d:"m17 14-5 5-5-5"})]})]})]})}),n&&n.accounts&&n.accounts.length>1&&$.jsx("div",{className:"mb-4",children:$.jsxs(Mp,{value:t||"",onChange:f,children:[$.jsx(ll,{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:"Select Account"}),$.jsxs("div",{className:"relative mt-1",children:[$.jsxs(xl,{className:"grid w-full cursor-default grid-cols-1 rounded-lg border border-gray-300 dark:border-[#192A39] bg-white dark:bg-[#101B29] py-2 px-3 text-left text-gray-800 dark:text-gray-300 shadow-sm focus:outline-none focus:ring-2 focus:ring-[#2D2DF1] dark:focus:ring-[#BFBFF9] focus:border-transparent text-sm",children:[$.jsx("span",{className:"col-start-1 row-start-1 truncate pr-8",children:t?Fn(t,6,4):"Select account"}),$.jsx("span",{className:"col-start-1 row-start-1 self-center justify-self-end",children:$.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",className:"text-gray-500 dark:text-gray-400","aria-hidden":"true",children:$.jsx("path",{d:"M4 6L8 10L12 6",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),$.jsx(El,{transition:!0,className:"absolute z-10 mt-1 max-h-60 w-full overflow-auto rounded-md bg-white dark:bg-[#101B29] py-1 shadow-lg ring-1 ring-black/5 dark:ring-[#192A39]/50 focus:outline-none text-sm data-[closed]:data-[leave]:opacity-0 data-[leave]:transition data-[leave]:duration-100 data-[leave]:ease-in",children:n.accounts.map(k=>$.jsxs(Rl,{value:k.address,className:"group relative cursor-default select-none py-2 pl-3 pr-9 text-gray-900 dark:text-gray-300 data-[focus]:bg-[#E9E9FD] dark:data-[focus]:bg-[#192A39] data-[focus]:text-gray-900 dark:data-[focus]:text-[#E9E9FD] data-[focus]:outline-none",children:[$.jsx("span",{className:"block truncate font-normal group-data-[selected]:font-medium",children:Fn(k.address,6,4)}),$.jsx("span",{className:"absolute inset-y-0 right-0 flex items-center pr-3 text-[#2D2DF1] dark:text-[#BFBFF9] group-[&:not([data-selected])]:hidden",children:$.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",className:"h-5 w-5","aria-hidden":"true",children:$.jsx("path",{d:"M13.3334 4L6.00008 11.3333L2.66675 8",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})]},k.address))})]})]})}),$.jsx("div",{className:"border-t border-gray-200 dark:border-[#192A39] mt-2 mb-2"}),n&&$.jsxs("div",{className:"mb-2 flex items-center gap-2 px-1 py-0.5",children:[$.jsx("div",{className:"h-5 w-5 overflow-hidden rounded flex items-center justify-center",children:n.metadata.icon?$.jsx("img",{src:n.metadata.icon,alt:`${n.metadata.name} icon`,className:"max-w-full max-h-full"}):$.jsx("div",{className:"h-5 w-5 rounded-full bg-gray-200 dark:bg-[#192A39] flex items-center justify-center",children:$.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-3 w-3 text-gray-400",viewBox:"0 0 20 20",fill:"currentColor",children:$.jsx("path",{fillRule:"evenodd",d:"M17 9c0-.55-.45-1-1-1h-4c-.55 0-1 .45-1 1v8c0 .55.45 1 1 1h4c.55 0 1-.45 1-1V9zm-1 0v8h-4V9h4zM8 4c0-.55-.45-1-1-1H3c-.55 0-1 .45-1 1v13c0 .55.45 1 1 1h4c.55 0 1-.45 1-1V4zM3 3h4v14H3V3z",clipRule:"evenodd"})})})}),$.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:n.metadata.name})]}),$.jsx("div",{className:"border-t border-gray-200 dark:border-[#192A39] mb-3 mt-2"}),$.jsxs("div",{className:"flex gap-2",children:[$.jsx("button",{onClick:W,className:"flex-1 py-2 px-4 bg-gray-100 dark:bg-[#192A39] text-gray-700 dark:text-gray-300 font-medium rounded-xl hover:bg-gray-200 dark:hover:bg-[#263A4A] transition-colors text-sm flex items-center justify-center",title:"Copy address",children:s?$.jsxs($.Fragment,{children:[$.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 text-green-500 mr-1.5",viewBox:"0 0 20 20",fill:"currentColor",children:$.jsx("path",{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",clipRule:"evenodd"})}),"Copied"]}):$.jsxs($.Fragment,{children:[$.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 mr-1.5",viewBox:"0 0 20 20",fill:"currentColor",children:[$.jsx("path",{d:"M8 3a1 1 0 011-1h2a1 1 0 110 2H9a1 1 0 01-1-1z"}),$.jsx("path",{d:"M6 3a2 2 0 00-2 2v11a2 2 0 002 2h8a2 2 0 002-2V5a2 2 0 00-2-2 3 3 0 01-3 3H9a3 3 0 01-3-3z"})]}),"Copy"]})}),$.jsx("button",{onClick:c,className:"flex-1 py-2 px-4 bg-red-100 dark:bg-red-900/40 text-red-700 dark:text-red-300 font-medium rounded-xl hover:bg-red-200 dark:hover:bg-red-800/60 transition-colors text-sm",children:"Disconnect"})]})]})})})})]})}function Al(e){const{queryClient:t}=kl();return $.jsx($a,{client:t,children:$.jsx($p,{...e})})}function jp(){const{activeAddress:e}=dt.useWallet();return e?$.jsx(Al,{children:$.jsx(Ir,{})}):$.jsx(Ca,{})}Tl();exports.ConnectWalletButton=Wo;exports.ConnectWalletMenu=Ca;exports.ConnectedWalletButton=Ir;exports.ConnectedWalletMenu=Al;exports.NfdAvatar=Zo;exports.WalletButton=jp;exports.WalletList=Sa;exports.WalletUIProvider=Np;exports.useAccountInfo=Sl;exports.useNfd=Jo;exports.useWalletUI=kl;
|
|
42
42
|
//# sourceMappingURL=index.cjs.map
|