@edgex-web/components 0.1.0-beta.29 → 0.1.0-beta.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Deposit/src/evm/WalletView.d.ts.map +1 -1
- package/dist/components/Deposit/src/evm/index.d.ts.map +1 -1
- package/dist/components/Deposit/src/utils.d.ts +5 -0
- package/dist/components/Deposit/src/utils.d.ts.map +1 -1
- package/dist/hooks/useTranslation.d.ts +4 -0
- package/dist/hooks/useTranslation.d.ts.map +1 -1
- package/dist/index.esm.js +2657 -2621
- package/dist/index.esm.js.map +1 -1
- package/dist/index.umd.js +32 -32
- package/dist/index.umd.js.map +1 -1
- package/dist/locales/en-US.d.ts +2 -0
- package/dist/locales/en-US.d.ts.map +1 -1
- package/dist/locales/ja-JP.d.ts +2 -0
- package/dist/locales/ja-JP.d.ts.map +1 -1
- package/dist/locales/ru-RU.d.ts +2 -0
- package/dist/locales/ru-RU.d.ts.map +1 -1
- package/dist/locales/zh-CN.d.ts +2 -0
- package/dist/locales/zh-CN.d.ts.map +1 -1
- package/dist/locales/zh-TW.d.ts +2 -0
- package/dist/locales/zh-TW.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.umd.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(Z,m){typeof exports=="object"&&typeof module<"u"?m(exports,require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react-dom"],m):(Z=typeof globalThis<"u"?globalThis:Z||self,m(Z.EdgeXComponents={},Z.React,Z.ReactDOM))})(this,function(Z,m,Se){"use strict";var yh=Object.defineProperty;var xh=(Z,m,Se)=>m in Z?yh(Z,m,{enumerable:!0,configurable:!0,writable:!0,value:Se}):Z[m]=Se;var Ie=(Z,m,Se)=>xh(Z,typeof m!="symbol"?m+"":m,Se);function $o(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 R=$o(m),Vt=$o(Se);function sa(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Zn={exports:{}},zt={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* react-jsx-runtime.production.min.js
|
|
4
4
|
*
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var
|
|
9
|
+
*/var Ao;function la(){if(Ao)return zt;Ao=1;var e=m,t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,o=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i={key:!0,ref:!0,__self:!0,__source:!0};function l(u,s,a){var c,d={},p=null,f=null;a!==void 0&&(p=""+a),s.key!==void 0&&(p=""+s.key),s.ref!==void 0&&(f=s.ref);for(c in s)r.call(s,c)&&!i.hasOwnProperty(c)&&(d[c]=s[c]);if(u&&u.defaultProps)for(c in s=u.defaultProps,s)d[c]===void 0&&(d[c]=s[c]);return{$$typeof:t,type:u,key:p,ref:f,props:d,_owner:o.current}}return zt.Fragment=n,zt.jsx=l,zt.jsxs=l,zt}var Ht={};/**
|
|
10
10
|
* @license React
|
|
11
11
|
* react-jsx-runtime.development.js
|
|
12
12
|
*
|
|
@@ -14,53 +14,53 @@
|
|
|
14
14
|
*
|
|
15
15
|
* This source code is licensed under the MIT license found in the
|
|
16
16
|
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var Mo;function
|
|
18
|
-
`+
|
|
19
|
-
`),
|
|
20
|
-
`),pe=te.length-1,me=
|
|
21
|
-
`+te[pe].replace(" at new "," at ");return
|
|
17
|
+
*/var Mo;function aa(){return Mo||(Mo=1,process.env.NODE_ENV!=="production"&&function(){var e=m,t=Symbol.for("react.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),l=Symbol.for("react.provider"),u=Symbol.for("react.context"),s=Symbol.for("react.forward_ref"),a=Symbol.for("react.suspense"),c=Symbol.for("react.suspense_list"),d=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),f=Symbol.for("react.offscreen"),g=Symbol.iterator,v="@@iterator";function E(A){if(A===null||typeof A!="object")return null;var U=g&&A[g]||A[v];return typeof U=="function"?U:null}var M=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function w(A){{for(var U=arguments.length,K=new Array(U>1?U-1:0),X=1;X<U;X++)K[X-1]=arguments[X];N("error",A,K)}}function N(A,U,K){{var X=M.ReactDebugCurrentFrame,ie=X.getStackAddendum();ie!==""&&(U+="%s",K=K.concat([ie]));var ae=K.map(function(re){return String(re)});ae.unshift("Warning: "+U),Function.prototype.apply.call(console[A],console,ae)}}var F=!1,j=!1,k=!1,B=!1,h=!1,b;b=Symbol.for("react.module.reference");function y(A){return!!(typeof A=="string"||typeof A=="function"||A===r||A===i||h||A===o||A===a||A===c||B||A===f||F||j||k||typeof A=="object"&&A!==null&&(A.$$typeof===p||A.$$typeof===d||A.$$typeof===l||A.$$typeof===u||A.$$typeof===s||A.$$typeof===b||A.getModuleId!==void 0))}function $(A,U,K){var X=A.displayName;if(X)return X;var ie=U.displayName||U.name||"";return ie!==""?K+"("+ie+")":K}function D(A){return A.displayName||"Context"}function L(A){if(A==null)return null;if(typeof A.tag=="number"&&w("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof A=="function")return A.displayName||A.name||null;if(typeof A=="string")return A;switch(A){case r:return"Fragment";case n:return"Portal";case i:return"Profiler";case o:return"StrictMode";case a:return"Suspense";case c:return"SuspenseList"}if(typeof A=="object")switch(A.$$typeof){case u:var U=A;return D(U)+".Consumer";case l:var K=A;return D(K._context)+".Provider";case s:return $(A,A.render,"ForwardRef");case d:var X=A.displayName||null;return X!==null?X:L(A.type)||"Memo";case p:{var ie=A,ae=ie._payload,re=ie._init;try{return L(re(ae))}catch{return null}}}return null}var C=Object.assign,O=0,T,P,x,I,_,V,W;function Y(){}Y.__reactDisabledLog=!0;function q(){{if(O===0){T=console.log,P=console.info,x=console.warn,I=console.error,_=console.group,V=console.groupCollapsed,W=console.groupEnd;var A={configurable:!0,enumerable:!0,value:Y,writable:!0};Object.defineProperties(console,{info:A,log:A,warn:A,error:A,group:A,groupCollapsed:A,groupEnd:A})}O++}}function G(){{if(O--,O===0){var A={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:C({},A,{value:T}),info:C({},A,{value:P}),warn:C({},A,{value:x}),error:C({},A,{value:I}),group:C({},A,{value:_}),groupCollapsed:C({},A,{value:V}),groupEnd:C({},A,{value:W})})}O<0&&w("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var H=M.ReactCurrentDispatcher,z;function J(A,U,K){{if(z===void 0)try{throw Error()}catch(ie){var X=ie.stack.trim().match(/\n( *(at )?)/);z=X&&X[1]||""}return`
|
|
18
|
+
`+z+A}}var se=!1,he;{var $e=typeof WeakMap=="function"?WeakMap:Map;he=new $e}function it(A,U){if(!A||se)return"";{var K=he.get(A);if(K!==void 0)return K}var X;se=!0;var ie=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var ae;ae=H.current,H.current=null,q();try{if(U){var re=function(){throw Error()};if(Object.defineProperty(re.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(re,[])}catch(Ae){X=Ae}Reflect.construct(A,[],re)}else{try{re.call()}catch(Ae){X=Ae}A.call(re.prototype)}}else{try{throw Error()}catch(Ae){X=Ae}A()}}catch(Ae){if(Ae&&X&&typeof Ae.stack=="string"){for(var te=Ae.stack.split(`
|
|
19
|
+
`),Oe=X.stack.split(`
|
|
20
|
+
`),pe=te.length-1,me=Oe.length-1;pe>=1&&me>=0&&te[pe]!==Oe[me];)me--;for(;pe>=1&&me>=0;pe--,me--)if(te[pe]!==Oe[me]){if(pe!==1||me!==1)do if(pe--,me--,me<0||te[pe]!==Oe[me]){var He=`
|
|
21
|
+
`+te[pe].replace(" at new "," at ");return A.displayName&&He.includes("<anonymous>")&&(He=He.replace("<anonymous>",A.displayName)),typeof A=="function"&&he.set(A,He),He}while(pe>=1&&me>=0);break}}}finally{se=!1,H.current=ae,G(),Error.prepareStackTrace=ie}var Ut=A?A.displayName||A.name:"",Dt=Ut?J(Ut):"";return typeof A=="function"&&he.set(A,Dt),Dt}function Ee(A,U,K){return it(A,!1)}function ge(A){var U=A.prototype;return!!(U&&U.isReactComponent)}function le(A,U,K){if(A==null)return"";if(typeof A=="function")return it(A,ge(A));if(typeof A=="string")return J(A);switch(A){case a:return J("Suspense");case c:return J("SuspenseList")}if(typeof A=="object")switch(A.$$typeof){case s:return Ee(A.render);case d:return le(A.type,U,K);case p:{var X=A,ie=X._payload,ae=X._init;try{return le(ae(ie),U,K)}catch{}}}return""}var an=Object.prototype.hasOwnProperty,Hl={},Gl=M.ReactDebugCurrentFrame;function Qn(A){if(A){var U=A._owner,K=le(A.type,A._source,U?U.type:null);Gl.setExtraStackFrame(K)}else Gl.setExtraStackFrame(null)}function Qm(A,U,K,X,ie){{var ae=Function.call.bind(an);for(var re in A)if(ae(A,re)){var te=void 0;try{if(typeof A[re]!="function"){var Oe=Error((X||"React class")+": "+K+" type `"+re+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof A[re]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw Oe.name="Invariant Violation",Oe}te=A[re](U,re,X,K,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(pe){te=pe}te&&!(te instanceof Error)&&(Qn(ie),w("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",X||"React class",K,re,typeof te),Qn(null)),te instanceof Error&&!(te.message in Hl)&&(Hl[te.message]=!0,Qn(ie),w("Failed %s type: %s",K,te.message),Qn(null))}}}var Zm=Array.isArray;function To(A){return Zm(A)}function Jm(A){{var U=typeof Symbol=="function"&&Symbol.toStringTag,K=U&&A[Symbol.toStringTag]||A.constructor.name||"Object";return K}}function eh(A){try{return Yl(A),!1}catch{return!0}}function Yl(A){return""+A}function Kl(A){if(eh(A))return w("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Jm(A)),Yl(A)}var ql=M.ReactCurrentOwner,th={key:!0,ref:!0,__self:!0,__source:!0},Xl,Ql;function nh(A){if(an.call(A,"ref")){var U=Object.getOwnPropertyDescriptor(A,"ref").get;if(U&&U.isReactWarning)return!1}return A.ref!==void 0}function rh(A){if(an.call(A,"key")){var U=Object.getOwnPropertyDescriptor(A,"key").get;if(U&&U.isReactWarning)return!1}return A.key!==void 0}function oh(A,U){typeof A.ref=="string"&&ql.current}function ih(A,U){{var K=function(){Xl||(Xl=!0,w("%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://reactjs.org/link/special-props)",U))};K.isReactWarning=!0,Object.defineProperty(A,"key",{get:K,configurable:!0})}}function sh(A,U){{var K=function(){Ql||(Ql=!0,w("%s: `ref` 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://reactjs.org/link/special-props)",U))};K.isReactWarning=!0,Object.defineProperty(A,"ref",{get:K,configurable:!0})}}var lh=function(A,U,K,X,ie,ae,re){var te={$$typeof:t,type:A,key:U,ref:K,props:re,_owner:ae};return te._store={},Object.defineProperty(te._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(te,"_self",{configurable:!1,enumerable:!1,writable:!1,value:X}),Object.defineProperty(te,"_source",{configurable:!1,enumerable:!1,writable:!1,value:ie}),Object.freeze&&(Object.freeze(te.props),Object.freeze(te)),te};function ah(A,U,K,X,ie){{var ae,re={},te=null,Oe=null;K!==void 0&&(Kl(K),te=""+K),rh(U)&&(Kl(U.key),te=""+U.key),nh(U)&&(Oe=U.ref,oh(U,ie));for(ae in U)an.call(U,ae)&&!th.hasOwnProperty(ae)&&(re[ae]=U[ae]);if(A&&A.defaultProps){var pe=A.defaultProps;for(ae in pe)re[ae]===void 0&&(re[ae]=pe[ae])}if(te||Oe){var me=typeof A=="function"?A.displayName||A.name||"Unknown":A;te&&ih(re,me),Oe&&sh(re,me)}return lh(A,te,Oe,ie,X,ql.current,re)}}var No=M.ReactCurrentOwner,Zl=M.ReactDebugCurrentFrame;function Wt(A){if(A){var U=A._owner,K=le(A.type,A._source,U?U.type:null);Zl.setExtraStackFrame(K)}else Zl.setExtraStackFrame(null)}var Lo;Lo=!1;function Po(A){return typeof A=="object"&&A!==null&&A.$$typeof===t}function Jl(){{if(No.current){var A=L(No.current.type);if(A)return`
|
|
22
22
|
|
|
23
|
-
Check the render method of \``+
|
|
23
|
+
Check the render method of \``+A+"`."}return""}}function uh(A){return""}var ea={};function ch(A){{var U=Jl();if(!U){var K=typeof A=="string"?A:A.displayName||A.name;K&&(U=`
|
|
24
24
|
|
|
25
|
-
Check the top-level render call using <`+
|
|
25
|
+
Check the top-level render call using <`+K+">.")}return U}}function ta(A,U){{if(!A._store||A._store.validated||A.key!=null)return;A._store.validated=!0;var K=ch(U);if(ea[K])return;ea[K]=!0;var X="";A&&A._owner&&A._owner!==No.current&&(X=" It was passed a child from "+L(A._owner.type)+"."),Wt(A),w('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',K,X),Wt(null)}}function na(A,U){{if(typeof A!="object")return;if(To(A))for(var K=0;K<A.length;K++){var X=A[K];Po(X)&&ta(X,U)}else if(Po(A))A._store&&(A._store.validated=!0);else if(A){var ie=E(A);if(typeof ie=="function"&&ie!==A.entries)for(var ae=ie.call(A),re;!(re=ae.next()).done;)Po(re.value)&&ta(re.value,U)}}}function fh(A){{var U=A.type;if(U==null||typeof U=="string")return;var K;if(typeof U=="function")K=U.propTypes;else if(typeof U=="object"&&(U.$$typeof===s||U.$$typeof===d))K=U.propTypes;else return;if(K){var X=L(U);Qm(K,A.props,"prop",X,A)}else if(U.PropTypes!==void 0&&!Lo){Lo=!0;var ie=L(U);w("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",ie||"Unknown")}typeof U.getDefaultProps=="function"&&!U.getDefaultProps.isReactClassApproved&&w("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function dh(A){{for(var U=Object.keys(A.props),K=0;K<U.length;K++){var X=U[K];if(X!=="children"&&X!=="key"){Wt(A),w("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",X),Wt(null);break}}A.ref!==null&&(Wt(A),w("Invalid attribute `ref` supplied to `React.Fragment`."),Wt(null))}}var ra={};function oa(A,U,K,X,ie,ae){{var re=y(A);if(!re){var te="";(A===void 0||typeof A=="object"&&A!==null&&Object.keys(A).length===0)&&(te+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var Oe=uh();Oe?te+=Oe:te+=Jl();var pe;A===null?pe="null":To(A)?pe="array":A!==void 0&&A.$$typeof===t?(pe="<"+(L(A.type)||"Unknown")+" />",te=" Did you accidentally export a JSX literal instead of a component?"):pe=typeof A,w("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",pe,te)}var me=ah(A,U,K,ie,ae);if(me==null)return me;if(re){var He=U.children;if(He!==void 0)if(X)if(To(He)){for(var Ut=0;Ut<He.length;Ut++)na(He[Ut],A);Object.freeze&&Object.freeze(He)}else w("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 na(He,A)}if(an.call(U,"key")){var Dt=L(A),Ae=Object.keys(U).filter(function(bh){return bh!=="key"}),Do=Ae.length>0?"{key: someKey, "+Ae.join(": ..., ")+": ...}":"{key: someKey}";if(!ra[Dt+Do]){var vh=Ae.length>0?"{"+Ae.join(": ..., ")+": ...}":"{}";w(`A props object containing a "key" prop is being spread into JSX:
|
|
26
26
|
let props = %s;
|
|
27
27
|
<%s {...props} />
|
|
28
28
|
React keys must be passed directly to JSX without using spread:
|
|
29
29
|
let props = %s;
|
|
30
|
-
<%s key={someKey} {...props} />`,
|
|
31
|
-
充值金额大于 200,000 时,到账时间存在一定延迟,请耐心等待。`,enableSystemProWithToken:"在{{network}}上启用{{token}}",enableTokenDesc:"您首次在{{network}}上存款时必须启用{{token}}。",enableWithToken:"启用 {{token}}",arrivaltimeTooltip1:"您可以在约 {{v}} 分钟 (达到 {{v1}} 个区块确认后) 提走已到账的资金",arrivaltimeTooltip2:"预计时间是根据历史数据计算所得,仅供参考。网络拥堵可能会导致实际到账时间变长。",arrivalEstimated:"≈ {{v}}分钟",availableDesc:"您可以提取的最大金额。当 available 为0或负数时,不允许提现。",noPrivateKeyWalletWarning:"暂不支持无私钥钱包充值。若您是无私钥钱包,请勿进行充值。"},withdraw:{noticeDesc:"普通提现是一个两步过程。 此步骤将发起您的提现请求,并将在 Layer2 进行处理。 一旦资金准备就绪(可能需要最多 4 小时),您将收到一条将资金提现到钱包的通知。受链同步等情况影响下,时长可能到 48 小时。您需要自行承担交易 gas 费用。",crossChainTips:"跨链提币需在 L2(通过零知识证明)进行验证。提币过程最多约需2小时。相关链的资产池中需有充足的资金来处理跨链提币,其间还将产生矿工费。 edgeX 将收取一定的手续费作为矿工费。",commonWithdraw:"提现说明",withdraw:"提现",speed:"速度",confirmWithdraw:"提现确认",speedNote:"处理时间:",speedNoteSpeed1:"用时约8分钟",speedNoteSpeed2:"用时约 2-4 小时",speedNoteSpeed3:"用时约4小时",receiverAddress:"接收地址",fee:"手续费",withdrawlAmount:"提现金额",amountToReceive:"到账金额",invalidReceiverAddress:"接收地址不合法"}},
|
|
32
|
-
If the deposit amount exceeds 200,000, there may be a delay in the arrival time. Please be patient.`,enableSystemProWithToken:"Enable {{token}} on {{network}}",enableTokenDesc:"You must enable {{token}} the first time you deposit on {{network}}.",enableWithToken:"Enable {{token}}",arrivaltimeTooltip1:"You can withdraw the arrived funds in approximately {{v}} minutes (after reaching {{v1}} block confirmations)",arrivaltimeTooltip2:"Estimated time is calculated based on historical data and is for reference only. Network congestion may result in longer actual arrival times.",arrivalEstimated:"≈ {{v}} minutes",availableDesc:"Max. amount you can withdraw. When the available amount shown is 0 or negative, you are not allowed to make withdrawals.",noPrivateKeyWalletWarning:"Deposits from wallets without private keys are not supported at the moment. If you are using such a wallet, please do not make a deposit."},withdraw:{noticeDesc:"Normal withdrawals are a two-step process. The current step initiates your withdrawal request and will be processed on Layer 2. Once your funds are ready (can take up to 4 hours), you will receive a notification to withdraw funds to your wallet. Due to chain synchronization and other factors, the duration may take up to 48 hours. You are responsible for any transaction gas fees.",crossChainTips:"Cross-chain withdrawals require verification at L2 (via ZK proofs) and the withdrawal process may take up to 2 hours. Sufficient funds in the corresponding chain's asset pool are required to process cross-chain withdrawals. Gas fees will also be incurred. edgeX will charge a fee to cover this.",commonWithdraw:"Withdrawal FAQ",withdraw:"Withdraw",speed:"Speed",confirmWithdraw:"Confirm Withdrawal",speedNote:"Processing Times:",speedNoteSpeed1:"Approx. 8 Minutes",speedNoteSpeed2:"Approx. 2-4 Hours",speedNoteSpeed3:"Approx. 4 Hours",receiverAddress:"Receiver Address",fee:"Fee",withdrawlAmount:"Withdrawal amount",amountToReceive:"Amount to Receive",invalidReceiverAddress:"Invalid receiver address"}},
|
|
33
|
-
入金金額が 200,000 を超える場合、反映までに時間がかかることがあります。しばらくお待ちください。`,enableSystemProWithToken:"{{network}} 上で {{token}} を有効化",enableTokenDesc:"初めて {{network}} に入金する際は、{{token}} の有効化が必要です。",enableWithToken:"{{token}} を有効化",arrivaltimeTooltip1:"{{v1}} ブロック確認後、おおよそ {{v}} 分以内に引き出し可能となります",arrivaltimeTooltip2:"着金時間は過去データに基づいた目安であり、ネットワーク状況により遅延する場合があります。",arrivalEstimated:"≈ {{v}}分",availableDesc:"出金可能な最大金額です。 available が0またはマイナスの場合、出金は行えません。",noPrivateKeyWalletWarning:"現在、秘密鍵のないウォレットからの入金はサポートされていません。該当ウォレットをご利用の場合は、入金しないでください。"},withdraw:{noticeDesc:"通常出金は2ステップで行われます。このステップで出金リクエストを送信し、Layer2で処理されます。資金の準備が完了すると(最大4時間かかる場合があります)、出金の通知が届きます。チェーンの同期などの影響により、所要時間は最長で48時間かかる場合があります。ガス代はユーザー負担です。",crossChainTips:"クロスチェーン出金はL2上(ゼロ知識証明経由)で検証が必要です。出金処理には最大2時間ほどかかる場合があります。対応するチェーンの資産プールに十分な流動性が必要であり、ガス代も発生します。edgeXはそのコストを補うため、一定の手数料を徴収します。",commonWithdraw:"出金ガイド",withdraw:"出金",speed:"出金時間",confirmWithdraw:"出金確認",speedNote:"処理時間:",speedNoteSpeed1:"約8分",speedNoteSpeed2:"約2~4時間",speedNoteSpeed3:"約4時間",receiverAddress:"受取アドレス",fee:"手数料",withdrawlAmount:"出金額",amountToReceive:"受け取り金額",invalidReceiverAddress:"無効な受け取りアドレス"}},
|
|
34
|
-
Если сумма депозита превышает 200 000, время поступления может быть увеличено. Пожалуйста, ожидайте.`,enableSystemProWithToken:"Включить {{token}} в сети {{network}}",enableTokenDesc:"При первом депозите в сети {{network}} необходимо включить {{token}}.",enableWithToken:"Включить {{token}}",arrivaltimeTooltip1:"Вы сможете вывести поступившие средства примерно через {{v}} минут (после {{v1}} подтверждений в блокчейне)",arrivaltimeTooltip2:"Оценка времени основана на истории и дана только для справки. Задержки сети могут увеличить фактическое время поступления.",arrivalEstimated:"≈ {{v}} минут",availableDesc:"Максимальная сумма для вывода. Если доступная сумма равна 0 или меньше, вывод невозможен.",noPrivateKeyWalletWarning:"В настоящее время пополнение кошельков без приватных ключей не поддерживается. Если у вас такой кошелёк, пожалуйста, не выполняйте пополнение."},withdraw:{noticeDesc:"Вывод средств происходит в два этапа: сначала подаётся заявка на вывод (обрабатывается на Layer 2), затем - перевод на кошелёк после подготовки средств (до 14 часов). Из-за синхронизации цепочки и других факторов процесс может занять до 48 часов. За gas-комиссии отвечает пользователь.",crossChainTips:"• Кроссчейн выводы требуют проверки на L2 (через ZK доказательства) и могут занять до 2 часов. Для вывода нужны средства в пуле соответствующей цепи. Также взимается комиссия за газ. edgeX взимает плату за обслуживание.",commonWithdraw:"Часто задаваемые вопросы по выводу",withdraw:"Вывод",speed:"Скорость",confirmWithdraw:"Подтвердить вывод",speedNote:"Время обработки:",speedNoteSpeed1:"Прибл. 8 минут",speedNoteSpeed2:"Прибл. 2-4 часа",speedNoteSpeed3:"Прибл. 4 часа",receiverAddress:"Адрес получателя",fee:"Комиссия",withdrawlAmount:"Сумма вывода",amountToReceive:"Сумма к получению",invalidReceiverAddress:"Неверный адрес получателя"}},
|
|
35
|
-
充值金額大於 200,000 時,到账時間可能會有延遲,請耐心等待。`,enableSystemProWithToken:"在{{network}}上啓用{{token}}",enableTokenDesc:"您首次在{{network}}上存款時必須啓用{{token}}。",enableWithToken:"啓用 {{token}}",arrivaltimeTooltip1:"您可以在約 {{v}} 分鐘 (達到 {{v1}} 個區塊確認後) 提走已到帳的資金",arrivaltimeTooltip2:"預計時間是根據歷史資料計算所得,僅供參考。網路壅塞可能會導致實際到帳時間變長。",arrivalEstimated:"≈ {{v}}分鐘",availableDesc:"您可以提取的最大金額。當 available 爲0或負數時,不允許提現。",noPrivateKeyWalletWarning:"暫不支援無私鑰錢包充值。若您使用的是無私鑰錢包,請勿進行充值。"},withdraw:{noticeDesc:"普通提現是一個兩步過程。此步驟將發起您的提現請求,並將在 Layer2 進行處理。一旦資金準備就緒(可能需要最多 4 小時),您將收到一條將資金提現到錢包的通知。受鏈同步等情況影響下,時長可能需要長達 48 小時。您需要自行承擔交易 gas 費用。",crossChainTips:"跨鏈提幣需在 L2(通過零知識證明)進行驗證。提幣過程最多約需2小時。相關鏈的資產池中需有充足的資金來處理跨鏈提幣,其間還將產生礦工費。 edgeX 將收取一定的手續費作爲礦工費。",commonWithdraw:"提現說明",withdraw:"提現",speed:"速度",confirmWithdraw:"提現確認",speedNote:"處理時間:",speedNoteSpeed1:"用時約8分鐘",speedNoteSpeed2:"用時約 2-4 小時",speedNoteSpeed3:"用時約4小時",receiverAddress:"接收地址",fee:"手續費",withdrawlAmount:"提現金額",amountToReceive:"到账金額",invalidReceiverAddress:"接收地址不合法"}},Jn=["en-US","ja-JP","ru-RU","zh-CN","zh-TW"],Io={"en-US":ua,"ja-JP":ca,"ru-RU":fa,"zh-CN":aa,"zh-TW":da},un="en-US",pa={"en-US":"English","zh-CN":"简体中文","zh-TW":"繁體中文","ja-JP":"日本語","ru-RU":"Русский"},ma=e=>Jn.includes(e)?Io[e]:Io[un],ha=e=>Jn.includes(e),jo=m.createContext(null),ga=({config:e,children:t})=>{const n=m.useMemo(()=>{const r=e.locale||un,o=ha(r)?r:un,i=ma(o);return{...e,currentLocale:o,translations:i}},[e]);return C.jsx(jo.Provider,{value:n,children:t})},Fo=()=>{const e=m.useContext(jo);if(!e)throw new Error("useComponentConfig must be used within ComponentProvider");return e};var va=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,Zn=Math.ceil,je=Math.floor,Ce="[BigNumber Error] ",Ro=Ce+"Number primitive has more than 15 significant digits: ",Ge=1e14,Q=14,er=9007199254740991,tr=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],ht=1e7,ge=1e9;function ko(e){var t,n,r,o=w.prototype={constructor:w,toString:null,valueOf:null},i=new w(1),l=20,u=4,s=-7,a=21,c=-1e7,d=1e7,p=!1,f=1,g=0,v={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},E="0123456789abcdefghijklmnopqrstuvwxyz",M=!0;function w(h,b){var x,$,A,P,S,O,T,L,y=this;if(!(y instanceof w))return new w(h,b);if(b==null){if(h&&h._isBigNumber===!0){y.s=h.s,!h.c||h.e>d?y.c=y.e=null:h.e<c?y.c=[y.e=0]:(y.e=h.e,y.c=h.c.slice());return}if((O=typeof h=="number")&&h*0==0){if(y.s=1/h<0?(h=-h,-1):1,h===~~h){for(P=0,S=h;S>=10;S/=10,P++);P>d?y.c=y.e=null:(y.e=P,y.c=[h]);return}L=String(h)}else{if(!va.test(L=String(h)))return r(y,L,O);y.s=L.charCodeAt(0)==45?(L=L.slice(1),-1):1}(P=L.indexOf("."))>-1&&(L=L.replace(".","")),(S=L.search(/e/i))>0?(P<0&&(P=S),P+=+L.slice(S+1),L=L.substring(0,S)):P<0&&(P=L.length)}else{if(ce(b,2,E.length,"Base"),b==10&&M)return y=new w(h),k(y,l+y.e+1,u);if(L=String(h),O=typeof h=="number"){if(h*0!=0)return r(y,L,O,b);if(y.s=1/h<0?(L=L.slice(1),-1):1,w.DEBUG&&L.replace(/^0\.0*|\./,"").length>15)throw Error(Ro+h)}else y.s=L.charCodeAt(0)===45?(L=L.slice(1),-1):1;for(x=E.slice(0,b),P=S=0,T=L.length;S<T;S++)if(x.indexOf($=L.charAt(S))<0){if($=="."){if(S>P){P=T;continue}}else if(!A&&(L==L.toUpperCase()&&(L=L.toLowerCase())||L==L.toLowerCase()&&(L=L.toUpperCase()))){A=!0,S=-1,P=0;continue}return r(y,String(h),O,b)}O=!1,L=n(L,b,10,y.s),(P=L.indexOf("."))>-1?L=L.replace(".",""):P=L.length}for(S=0;L.charCodeAt(S)===48;S++);for(T=L.length;L.charCodeAt(--T)===48;);if(L=L.slice(S,++T)){if(T-=S,O&&w.DEBUG&&T>15&&(h>er||h!==je(h)))throw Error(Ro+y.s*h);if((P=P-S-1)>d)y.c=y.e=null;else if(P<c)y.c=[y.e=0];else{if(y.e=P,y.c=[],S=(P+1)%Q,P<0&&(S+=Q),S<T){for(S&&y.c.push(+L.slice(0,S)),T-=Q;S<T;)y.c.push(+L.slice(S,S+=Q));S=Q-(L=L.slice(S)).length}else S-=T;for(;S--;L+="0");y.c.push(+L)}}else y.c=[y.e=0]}w.clone=ko,w.ROUND_UP=0,w.ROUND_DOWN=1,w.ROUND_CEIL=2,w.ROUND_FLOOR=3,w.ROUND_HALF_UP=4,w.ROUND_HALF_DOWN=5,w.ROUND_HALF_EVEN=6,w.ROUND_HALF_CEIL=7,w.ROUND_HALF_FLOOR=8,w.EUCLID=9,w.config=w.set=function(h){var b,x;if(h!=null)if(typeof h=="object"){if(h.hasOwnProperty(b="DECIMAL_PLACES")&&(x=h[b],ce(x,0,ge,b),l=x),h.hasOwnProperty(b="ROUNDING_MODE")&&(x=h[b],ce(x,0,8,b),u=x),h.hasOwnProperty(b="EXPONENTIAL_AT")&&(x=h[b],x&&x.pop?(ce(x[0],-ge,0,b),ce(x[1],0,ge,b),s=x[0],a=x[1]):(ce(x,-ge,ge,b),s=-(a=x<0?-x:x))),h.hasOwnProperty(b="RANGE"))if(x=h[b],x&&x.pop)ce(x[0],-ge,-1,b),ce(x[1],1,ge,b),c=x[0],d=x[1];else if(ce(x,-ge,ge,b),x)c=-(d=x<0?-x:x);else throw Error(Ce+b+" cannot be zero: "+x);if(h.hasOwnProperty(b="CRYPTO"))if(x=h[b],x===!!x)if(x)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))p=x;else throw p=!x,Error(Ce+"crypto unavailable");else p=x;else throw Error(Ce+b+" not true or false: "+x);if(h.hasOwnProperty(b="MODULO_MODE")&&(x=h[b],ce(x,0,9,b),f=x),h.hasOwnProperty(b="POW_PRECISION")&&(x=h[b],ce(x,0,ge,b),g=x),h.hasOwnProperty(b="FORMAT"))if(x=h[b],typeof x=="object")v=x;else throw Error(Ce+b+" not an object: "+x);if(h.hasOwnProperty(b="ALPHABET"))if(x=h[b],typeof x=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test(x))M=x.slice(0,10)=="0123456789",E=x;else throw Error(Ce+b+" invalid: "+x)}else throw Error(Ce+"Object expected: "+h);return{DECIMAL_PLACES:l,ROUNDING_MODE:u,EXPONENTIAL_AT:[s,a],RANGE:[c,d],CRYPTO:p,MODULO_MODE:f,POW_PRECISION:g,FORMAT:v,ALPHABET:E}},w.isBigNumber=function(h){if(!h||h._isBigNumber!==!0)return!1;if(!w.DEBUG)return!0;var b,x,$=h.c,A=h.e,P=h.s;e:if({}.toString.call($)=="[object Array]"){if((P===1||P===-1)&&A>=-ge&&A<=ge&&A===je(A)){if($[0]===0){if(A===0&&$.length===1)return!0;break e}if(b=(A+1)%Q,b<1&&(b+=Q),String($[0]).length==b){for(b=0;b<$.length;b++)if(x=$[b],x<0||x>=Ge||x!==je(x))break e;if(x!==0)return!0}}}else if($===null&&A===null&&(P===null||P===1||P===-1))return!0;throw Error(Ce+"Invalid BigNumber: "+h)},w.maximum=w.max=function(){return j(arguments,-1)},w.minimum=w.min=function(){return j(arguments,1)},w.random=function(){var h=9007199254740992,b=Math.random()*h&2097151?function(){return je(Math.random()*h)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(x){var $,A,P,S,O,T=0,L=[],y=new w(i);if(x==null?x=l:ce(x,0,ge),S=Zn(x/Q),p)if(crypto.getRandomValues){for($=crypto.getRandomValues(new Uint32Array(S*=2));T<S;)O=$[T]*131072+($[T+1]>>>11),O>=9e15?(A=crypto.getRandomValues(new Uint32Array(2)),$[T]=A[0],$[T+1]=A[1]):(L.push(O%1e14),T+=2);T=S/2}else if(crypto.randomBytes){for($=crypto.randomBytes(S*=7);T<S;)O=($[T]&31)*281474976710656+$[T+1]*1099511627776+$[T+2]*4294967296+$[T+3]*16777216+($[T+4]<<16)+($[T+5]<<8)+$[T+6],O>=9e15?crypto.randomBytes(7).copy($,T):(L.push(O%1e14),T+=7);T=S/7}else throw p=!1,Error(Ce+"crypto unavailable");if(!p)for(;T<S;)O=b(),O<9e15&&(L[T++]=O%1e14);for(S=L[--T],x%=Q,S&&x&&(O=tr[Q-x],L[T]=je(S/O)*O);L[T]===0;L.pop(),T--);if(T<0)L=[P=0];else{for(P=-1;L[0]===0;L.splice(0,1),P-=Q);for(T=1,O=L[0];O>=10;O/=10,T++);T<Q&&(P-=Q-T)}return y.e=P,y.c=L,y}}(),w.sum=function(){for(var h=1,b=arguments,x=new w(b[0]);h<b.length;)x=x.plus(b[h++]);return x},n=function(){var h="0123456789";function b(x,$,A,P){for(var S,O=[0],T,L=0,y=x.length;L<y;){for(T=O.length;T--;O[T]*=$);for(O[0]+=P.indexOf(x.charAt(L++)),S=0;S<O.length;S++)O[S]>A-1&&(O[S+1]==null&&(O[S+1]=0),O[S+1]+=O[S]/A|0,O[S]%=A)}return O.reverse()}return function(x,$,A,P,S){var O,T,L,y,I,_,V,z,G=x.indexOf("."),q=l,B=u;for(G>=0&&(y=g,g=0,x=x.replace(".",""),z=new w($),_=z.pow(x.length-G),g=y,z.c=b(st(Re(_.c),_.e,"0"),10,A,h),z.e=z.c.length),V=b(x,$,A,S?(O=E,h):(O=h,E)),L=y=V.length;V[--y]==0;V.pop());if(!V[0])return O.charAt(0);if(G<0?--L:(_.c=V,_.e=L,_.s=P,_=t(_,z,q,B,A),V=_.c,I=_.r,L=_.e),T=L+q+1,G=V[T],y=A/2,I=I||T<0||V[T+1]!=null,I=B<4?(G!=null||I)&&(B==0||B==(_.s<0?3:2)):G>y||G==y&&(B==4||I||B==6&&V[T-1]&1||B==(_.s<0?8:7)),T<1||!V[0])x=I?st(O.charAt(1),-q,O.charAt(0)):O.charAt(0);else{if(V.length=T,I)for(--A;++V[--T]>A;)V[T]=0,T||(++L,V=[1].concat(V));for(y=V.length;!V[--y];);for(G=0,x="";G<=y;x+=O.charAt(V[G++]));x=st(x,L,O.charAt(0))}return x}}(),t=function(){function h($,A,P){var S,O,T,L,y=0,I=$.length,_=A%ht,V=A/ht|0;for($=$.slice();I--;)T=$[I]%ht,L=$[I]/ht|0,S=V*T+L*_,O=_*T+S%ht*ht+y,y=(O/P|0)+(S/ht|0)+V*L,$[I]=O%P;return y&&($=[y].concat($)),$}function b($,A,P,S){var O,T;if(P!=S)T=P>S?1:-1;else for(O=T=0;O<P;O++)if($[O]!=A[O]){T=$[O]>A[O]?1:-1;break}return T}function x($,A,P,S){for(var O=0;P--;)$[P]-=O,O=$[P]<A[P]?1:0,$[P]=O*S+$[P]-A[P];for(;!$[0]&&$.length>1;$.splice(0,1));}return function($,A,P,S,O){var T,L,y,I,_,V,z,G,q,B,K,H,Z,ae,Ae,$e,it,ye=$.s==A.s?1:-1,he=$.c,se=A.c;if(!he||!he[0]||!se||!se[0])return new w(!$.s||!A.s||(he?se&&he[0]==se[0]:!se)?NaN:he&&he[0]==0||!se?ye*0:ye/0);for(G=new w(ye),q=G.c=[],L=$.e-A.e,ye=P+L+1,O||(O=Ge,L=Fe($.e/Q)-Fe(A.e/Q),ye=ye/Q|0),y=0;se[y]==(he[y]||0);y++);if(se[y]>(he[y]||0)&&L--,ye<0)q.push(1),I=!0;else{for(ae=he.length,$e=se.length,y=0,ye+=2,_=je(O/(se[0]+1)),_>1&&(se=h(se,_,O),he=h(he,_,O),$e=se.length,ae=he.length),Z=$e,B=he.slice(0,$e),K=B.length;K<$e;B[K++]=0);it=se.slice(),it=[0].concat(it),Ae=se[0],se[1]>=O/2&&Ae++;do{if(_=0,T=b(se,B,$e,K),T<0){if(H=B[0],$e!=K&&(H=H*O+(B[1]||0)),_=je(H/Ae),_>1)for(_>=O&&(_=O-1),V=h(se,_,O),z=V.length,K=B.length;b(V,B,z,K)==1;)_--,x(V,$e<z?it:se,z,O),z=V.length,T=1;else _==0&&(T=_=1),V=se.slice(),z=V.length;if(z<K&&(V=[0].concat(V)),x(B,V,K,O),K=B.length,T==-1)for(;b(se,B,$e,K)<1;)_++,x(B,$e<K?it:se,K,O),K=B.length}else T===0&&(_++,B=[0]);q[y++]=_,B[0]?B[K++]=he[Z]||0:(B=[he[Z]],K=1)}while((Z++<ae||B[0]!=null)&&ye--);I=B[0]!=null,q[0]||q.splice(0,1)}if(O==Ge){for(y=1,ye=q[0];ye>=10;ye/=10,y++);k(G,P+(G.e=y+L*Q-1)+1,S,I)}else G.e=L,G.r=+I;return G}}();function N(h,b,x,$){var A,P,S,O,T;if(x==null?x=u:ce(x,0,8),!h.c)return h.toString();if(A=h.c[0],S=h.e,b==null)T=Re(h.c),T=$==1||$==2&&(S<=s||S>=a)?fn(T,S):st(T,S,"0");else if(h=k(new w(h),b,x),P=h.e,T=Re(h.c),O=T.length,$==1||$==2&&(b<=P||P<=s)){for(;O<b;T+="0",O++);T=fn(T,P)}else if(b-=S+($===2&&P>S),T=st(T,P,"0"),P+1>O){if(--b>0)for(T+=".";b--;T+="0");}else if(b+=P-O,b>0)for(P+1==O&&(T+=".");b--;T+="0");return h.s<0&&A?"-"+T:T}function j(h,b){for(var x,$,A=1,P=new w(h[0]);A<h.length;A++)$=new w(h[A]),(!$.s||(x=Et(P,$))===b||x===0&&P.s===b)&&(P=$);return P}function F(h,b,x){for(var $=1,A=b.length;!b[--A];b.pop());for(A=b[0];A>=10;A/=10,$++);return(x=$+x*Q-1)>d?h.c=h.e=null:x<c?h.c=[h.e=0]:(h.e=x,h.c=b),h}r=function(){var h=/^(-?)0([xbo])(?=\w[\w.]*$)/i,b=/^([^.]+)\.$/,x=/^\.([^.]+)$/,$=/^-?(Infinity|NaN)$/,A=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(P,S,O,T){var L,y=O?S:S.replace(A,"");if($.test(y))P.s=isNaN(y)?null:y<0?-1:1;else{if(!O&&(y=y.replace(h,function(I,_,V){return L=(V=V.toLowerCase())=="x"?16:V=="b"?2:8,!T||T==L?_:I}),T&&(L=T,y=y.replace(b,"$1").replace(x,"0.$1")),S!=y))return new w(y,L);if(w.DEBUG)throw Error(Ce+"Not a"+(T?" base "+T:"")+" number: "+S);P.s=null}P.c=P.e=null}}();function k(h,b,x,$){var A,P,S,O,T,L,y,I=h.c,_=tr;if(I){e:{for(A=1,O=I[0];O>=10;O/=10,A++);if(P=b-A,P<0)P+=Q,S=b,T=I[L=0],y=je(T/_[A-S-1]%10);else if(L=Zn((P+1)/Q),L>=I.length)if($){for(;I.length<=L;I.push(0));T=y=0,A=1,P%=Q,S=P-Q+1}else break e;else{for(T=O=I[L],A=1;O>=10;O/=10,A++);P%=Q,S=P-Q+A,y=S<0?0:je(T/_[A-S-1]%10)}if($=$||b<0||I[L+1]!=null||(S<0?T:T%_[A-S-1]),$=x<4?(y||$)&&(x==0||x==(h.s<0?3:2)):y>5||y==5&&(x==4||$||x==6&&(P>0?S>0?T/_[A-S]:0:I[L-1])%10&1||x==(h.s<0?8:7)),b<1||!I[0])return I.length=0,$?(b-=h.e+1,I[0]=_[(Q-b%Q)%Q],h.e=-b||0):I[0]=h.e=0,h;if(P==0?(I.length=L,O=1,L--):(I.length=L+1,O=_[Q-P],I[L]=S>0?je(T/_[A-S]%_[S])*O:0),$)for(;;)if(L==0){for(P=1,S=I[0];S>=10;S/=10,P++);for(S=I[0]+=O,O=1;S>=10;S/=10,O++);P!=O&&(h.e++,I[0]==Ge&&(I[0]=1));break}else{if(I[L]+=O,I[L]!=Ge)break;I[L--]=0,O=1}for(P=I.length;I[--P]===0;I.pop());}h.e>d?h.c=h.e=null:h.e<c&&(h.c=[h.e=0])}return h}function W(h){var b,x=h.e;return x===null?h.toString():(b=Re(h.c),b=x<=s||x>=a?fn(b,x):st(b,x,"0"),h.s<0?"-"+b:b)}return o.absoluteValue=o.abs=function(){var h=new w(this);return h.s<0&&(h.s=1),h},o.comparedTo=function(h,b){return Et(this,new w(h,b))},o.decimalPlaces=o.dp=function(h,b){var x,$,A,P=this;if(h!=null)return ce(h,0,ge),b==null?b=u:ce(b,0,8),k(new w(P),h+P.e+1,b);if(!(x=P.c))return null;if($=((A=x.length-1)-Fe(this.e/Q))*Q,A=x[A])for(;A%10==0;A/=10,$--);return $<0&&($=0),$},o.dividedBy=o.div=function(h,b){return t(this,new w(h,b),l,u)},o.dividedToIntegerBy=o.idiv=function(h,b){return t(this,new w(h,b),0,1)},o.exponentiatedBy=o.pow=function(h,b){var x,$,A,P,S,O,T,L,y,I=this;if(h=new w(h),h.c&&!h.isInteger())throw Error(Ce+"Exponent not an integer: "+W(h));if(b!=null&&(b=new w(b)),O=h.e>14,!I.c||!I.c[0]||I.c[0]==1&&!I.e&&I.c.length==1||!h.c||!h.c[0])return y=new w(Math.pow(+W(I),O?h.s*(2-cn(h)):+W(h))),b?y.mod(b):y;if(T=h.s<0,b){if(b.c?!b.c[0]:!b.s)return new w(NaN);$=!T&&I.isInteger()&&b.isInteger(),$&&(I=I.mod(b))}else{if(h.e>9&&(I.e>0||I.e<-1||(I.e==0?I.c[0]>1||O&&I.c[1]>=24e7:I.c[0]<8e13||O&&I.c[0]<=9999975e7)))return P=I.s<0&&cn(h)?-0:0,I.e>-1&&(P=1/P),new w(T?1/P:P);g&&(P=Zn(g/Q+2))}for(O?(x=new w(.5),T&&(h.s=1),L=cn(h)):(A=Math.abs(+W(h)),L=A%2),y=new w(i);;){if(L){if(y=y.times(I),!y.c)break;P?y.c.length>P&&(y.c.length=P):$&&(y=y.mod(b))}if(A){if(A=je(A/2),A===0)break;L=A%2}else if(h=h.times(x),k(h,h.e+1,1),h.e>14)L=cn(h);else{if(A=+W(h),A===0)break;L=A%2}I=I.times(I),P?I.c&&I.c.length>P&&(I.c.length=P):$&&(I=I.mod(b))}return $?y:(T&&(y=i.div(y)),b?y.mod(b):P?k(y,g,u,S):y)},o.integerValue=function(h){var b=new w(this);return h==null?h=u:ce(h,0,8),k(b,b.e+1,h)},o.isEqualTo=o.eq=function(h,b){return Et(this,new w(h,b))===0},o.isFinite=function(){return!!this.c},o.isGreaterThan=o.gt=function(h,b){return Et(this,new w(h,b))>0},o.isGreaterThanOrEqualTo=o.gte=function(h,b){return(b=Et(this,new w(h,b)))===1||b===0},o.isInteger=function(){return!!this.c&&Fe(this.e/Q)>this.c.length-2},o.isLessThan=o.lt=function(h,b){return Et(this,new w(h,b))<0},o.isLessThanOrEqualTo=o.lte=function(h,b){return(b=Et(this,new w(h,b)))===-1||b===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(h,b){var x,$,A,P,S=this,O=S.s;if(h=new w(h,b),b=h.s,!O||!b)return new w(NaN);if(O!=b)return h.s=-b,S.plus(h);var T=S.e/Q,L=h.e/Q,y=S.c,I=h.c;if(!T||!L){if(!y||!I)return y?(h.s=-b,h):new w(I?S:NaN);if(!y[0]||!I[0])return I[0]?(h.s=-b,h):new w(y[0]?S:u==3?-0:0)}if(T=Fe(T),L=Fe(L),y=y.slice(),O=T-L){for((P=O<0)?(O=-O,A=y):(L=T,A=I),A.reverse(),b=O;b--;A.push(0));A.reverse()}else for($=(P=(O=y.length)<(b=I.length))?O:b,O=b=0;b<$;b++)if(y[b]!=I[b]){P=y[b]<I[b];break}if(P&&(A=y,y=I,I=A,h.s=-h.s),b=($=I.length)-(x=y.length),b>0)for(;b--;y[x++]=0);for(b=Ge-1;$>O;){if(y[--$]<I[$]){for(x=$;x&&!y[--x];y[x]=b);--y[x],y[$]+=Ge}y[$]-=I[$]}for(;y[0]==0;y.splice(0,1),--L);return y[0]?F(h,y,L):(h.s=u==3?-1:1,h.c=[h.e=0],h)},o.modulo=o.mod=function(h,b){var x,$,A=this;return h=new w(h,b),!A.c||!h.s||h.c&&!h.c[0]?new w(NaN):!h.c||A.c&&!A.c[0]?new w(A):(f==9?($=h.s,h.s=1,x=t(A,h,0,3),h.s=$,x.s*=$):x=t(A,h,0,f),h=A.minus(x.times(h)),!h.c[0]&&f==1&&(h.s=A.s),h)},o.multipliedBy=o.times=function(h,b){var x,$,A,P,S,O,T,L,y,I,_,V,z,G,q,B=this,K=B.c,H=(h=new w(h,b)).c;if(!K||!H||!K[0]||!H[0])return!B.s||!h.s||K&&!K[0]&&!H||H&&!H[0]&&!K?h.c=h.e=h.s=null:(h.s*=B.s,!K||!H?h.c=h.e=null:(h.c=[0],h.e=0)),h;for($=Fe(B.e/Q)+Fe(h.e/Q),h.s*=B.s,T=K.length,I=H.length,T<I&&(z=K,K=H,H=z,A=T,T=I,I=A),A=T+I,z=[];A--;z.push(0));for(G=Ge,q=ht,A=I;--A>=0;){for(x=0,_=H[A]%q,V=H[A]/q|0,S=T,P=A+S;P>A;)L=K[--S]%q,y=K[S]/q|0,O=V*L+y*_,L=_*L+O%q*q+z[P]+x,x=(L/G|0)+(O/q|0)+V*y,z[P--]=L%G;z[P]=x}return x?++$:z.splice(0,1),F(h,z,$)},o.negated=function(){var h=new w(this);return h.s=-h.s||null,h},o.plus=function(h,b){var x,$=this,A=$.s;if(h=new w(h,b),b=h.s,!A||!b)return new w(NaN);if(A!=b)return h.s=-b,$.minus(h);var P=$.e/Q,S=h.e/Q,O=$.c,T=h.c;if(!P||!S){if(!O||!T)return new w(A/0);if(!O[0]||!T[0])return T[0]?h:new w(O[0]?$:A*0)}if(P=Fe(P),S=Fe(S),O=O.slice(),A=P-S){for(A>0?(S=P,x=T):(A=-A,x=O),x.reverse();A--;x.push(0));x.reverse()}for(A=O.length,b=T.length,A-b<0&&(x=T,T=O,O=x,b=A),A=0;b;)A=(O[--b]=O[b]+T[b]+A)/Ge|0,O[b]=Ge===O[b]?0:O[b]%Ge;return A&&(O=[A].concat(O),++S),F(h,O,S)},o.precision=o.sd=function(h,b){var x,$,A,P=this;if(h!=null&&h!==!!h)return ce(h,1,ge),b==null?b=u:ce(b,0,8),k(new w(P),h,b);if(!(x=P.c))return null;if(A=x.length-1,$=A*Q+1,A=x[A]){for(;A%10==0;A/=10,$--);for(A=x[0];A>=10;A/=10,$++);}return h&&P.e+1>$&&($=P.e+1),$},o.shiftedBy=function(h){return ce(h,-er,er),this.times("1e"+h)},o.squareRoot=o.sqrt=function(){var h,b,x,$,A,P=this,S=P.c,O=P.s,T=P.e,L=l+4,y=new w("0.5");if(O!==1||!S||!S[0])return new w(!O||O<0&&(!S||S[0])?NaN:S?P:1/0);if(O=Math.sqrt(+W(P)),O==0||O==1/0?(b=Re(S),(b.length+T)%2==0&&(b+="0"),O=Math.sqrt(+b),T=Fe((T+1)/2)-(T<0||T%2),O==1/0?b="5e"+T:(b=O.toExponential(),b=b.slice(0,b.indexOf("e")+1)+T),x=new w(b)):x=new w(O+""),x.c[0]){for(T=x.e,O=T+L,O<3&&(O=0);;)if(A=x,x=y.times(A.plus(t(P,A,L,1))),Re(A.c).slice(0,O)===(b=Re(x.c)).slice(0,O))if(x.e<T&&--O,b=b.slice(O-3,O+1),b=="9999"||!$&&b=="4999"){if(!$&&(k(A,A.e+l+2,0),A.times(A).eq(P))){x=A;break}L+=4,O+=4,$=1}else{(!+b||!+b.slice(1)&&b.charAt(0)=="5")&&(k(x,x.e+l+2,1),h=!x.times(x).eq(P));break}}return k(x,x.e+l+1,u,h)},o.toExponential=function(h,b){return h!=null&&(ce(h,0,ge),h++),N(this,h,b,1)},o.toFixed=function(h,b){return h!=null&&(ce(h,0,ge),h=h+this.e+1),N(this,h,b)},o.toFormat=function(h,b,x){var $,A=this;if(x==null)h!=null&&b&&typeof b=="object"?(x=b,b=null):h&&typeof h=="object"?(x=h,h=b=null):x=v;else if(typeof x!="object")throw Error(Ce+"Argument not an object: "+x);if($=A.toFixed(h,b),A.c){var P,S=$.split("."),O=+x.groupSize,T=+x.secondaryGroupSize,L=x.groupSeparator||"",y=S[0],I=S[1],_=A.s<0,V=_?y.slice(1):y,z=V.length;if(T&&(P=O,O=T,T=P,z-=P),O>0&&z>0){for(P=z%O||O,y=V.substr(0,P);P<z;P+=O)y+=L+V.substr(P,O);T>0&&(y+=L+V.slice(P)),_&&(y="-"+y)}$=I?y+(x.decimalSeparator||"")+((T=+x.fractionGroupSize)?I.replace(new RegExp("\\d{"+T+"}\\B","g"),"$&"+(x.fractionGroupSeparator||"")):I):y}return(x.prefix||"")+$+(x.suffix||"")},o.toFraction=function(h){var b,x,$,A,P,S,O,T,L,y,I,_,V=this,z=V.c;if(h!=null&&(O=new w(h),!O.isInteger()&&(O.c||O.s!==1)||O.lt(i)))throw Error(Ce+"Argument "+(O.isInteger()?"out of range: ":"not an integer: ")+W(O));if(!z)return new w(V);for(b=new w(i),L=x=new w(i),$=T=new w(i),_=Re(z),P=b.e=_.length-V.e-1,b.c[0]=tr[(S=P%Q)<0?Q+S:S],h=!h||O.comparedTo(b)>0?P>0?b:L:O,S=d,d=1/0,O=new w(_),T.c[0]=0;y=t(O,b,0,1),A=x.plus(y.times($)),A.comparedTo(h)!=1;)x=$,$=A,L=T.plus(y.times(A=L)),T=A,b=O.minus(y.times(A=b)),O=A;return A=t(h.minus(x),$,0,1),T=T.plus(A.times(L)),x=x.plus(A.times($)),T.s=L.s=V.s,P=P*2,I=t(L,$,P,u).minus(V).abs().comparedTo(t(T,x,P,u).minus(V).abs())<1?[L,$]:[T,x],d=S,I},o.toNumber=function(){return+W(this)},o.toPrecision=function(h,b){return h!=null&&ce(h,1,ge),N(this,h,b,2)},o.toString=function(h){var b,x=this,$=x.s,A=x.e;return A===null?$?(b="Infinity",$<0&&(b="-"+b)):b="NaN":(h==null?b=A<=s||A>=a?fn(Re(x.c),A):st(Re(x.c),A,"0"):h===10&&M?(x=k(new w(x),l+A+1,u),b=st(Re(x.c),x.e,"0")):(ce(h,2,E.length,"Base"),b=n(st(Re(x.c),A,"0"),10,h,$,!0)),$<0&&x.c[0]&&(b="-"+b)),b},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&&w.set(e),w}function Fe(e){var t=e|0;return e>0||e===t?t:t-1}function Re(e){for(var t,n,r=1,o=e.length,i=e[0]+"";r<o;){for(t=e[r++]+"",n=Q-t.length;n--;t="0"+t);i+=t}for(o=i.length;i.charCodeAt(--o)===48;);return i.slice(0,o+1||1)}function Et(e,t){var n,r,o=e.c,i=t.c,l=e.s,u=t.s,s=e.e,a=t.e;if(!l||!u)return null;if(n=o&&!o[0],r=i&&!i[0],n||r)return n?r?0:-u:l;if(l!=u)return l;if(n=l<0,r=s==a,!o||!i)return r?0:!o^n?1:-1;if(!r)return s>a^n?1:-1;for(u=(s=o.length)<(a=i.length)?s:a,l=0;l<u;l++)if(o[l]!=i[l])return o[l]>i[l]^n?1:-1;return s==a?0:s>a^n?1:-1}function ce(e,t,n,r){if(e<t||e>n||e!==je(e))throw Error(Ce+(r||"Argument")+(typeof e=="number"?e<t||e>n?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function cn(e){var t=e.c.length-1;return Fe(e.e/Q)==t&&e.c[t]%2!=0}function fn(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function st(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}var Oe=ko();const ba=(e,t=6)=>{try{const n=new Oe(e||"0");if(n.isNaN())return"0";const r=n.decimalPlaces(t,Oe.ROUND_DOWN),[o,i=""]=r.toString().split("."),l=o.replace(/\B(?=(\d{3})+(?!\d))/g,",");if(t>0){const u=(i||"").padEnd(t,"0");return`${l}.${u}`}return l}catch(n){return console.warn("formatThousands error:",n),"0"}},Ye=()=>{const{translations:e,currentLocale:t}=Fo();return{t:(i,l)=>{try{const u=i.split(".");let s=e;for(const c of u)if(s&&typeof s=="object"&&c in s)s=s[c];else return i;let a=typeof s=="string"?s:i;return l&&typeof a=="string"&&Object.keys(l).forEach(c=>{const d=`{{${c}}}`;a=a.replace(new RegExp(d,"g"),String(l[c]))}),a}catch(u){return console.warn(`Translation error for key "${i}":`,u),i}},translations:e,locale:t,getTranslationObject:i=>{try{const l=i.split(".");let u=e;for(const s of l)if(u&&typeof u=="object"&&s in u)u=u[s];else return{};return typeof u=="object"?u:{}}catch(l){return console.warn(`Translation object error for key "${i}":`,l),{}}},hasTranslation:i=>{try{const l=i.split(".");let u=e;for(const s of l)if(u&&typeof u=="object"&&s in u)u=u[s];else return!1;return typeof u=="string"}catch{return!1}}}},xa=()=>({openDeposit:m.useCallback(t=>{},[])}),ya=()=>({openWithdraw:m.useCallback(t=>{},[])});/**
|
|
30
|
+
<%s key={someKey} {...props} />`,Do,Dt,vh,Dt),ra[Dt+Do]=!0}}return A===r?dh(me):fh(me),me}}function ph(A,U,K){return oa(A,U,K,!0)}function mh(A,U,K){return oa(A,U,K,!1)}var hh=mh,gh=ph;Ht.Fragment=r,Ht.jsx=hh,Ht.jsxs=gh}()),Ht}process.env.NODE_ENV==="production"?Zn.exports=la():Zn.exports=aa();var S=Zn.exports;const ua={deposit:{title:"充值",chain:"链",asset:"资产",amount:"数量",available:"可用",equity:"总资产",confirmDeposit:"充值确认",switchNetwork:"切换网络",max:"最大",arrivalTime:"到账时间",minDeposit:"最小充值金额",minDepositParsed:"最少充值 {{amount}} {{token}}",maxDeposit:"最大充值金额",depositTipFor25w:"单笔充值金额上限为 200,000。若充值金额大于200,000,请使用Ethereum链充值。",depositAllTip:`仅支持发送 {{coin}} ({{v}}) 资产到此地址。
|
|
31
|
+
充值金额大于 200,000 时,到账时间存在一定延迟,请耐心等待。`,enableSystemProWithToken:"在{{network}}上启用{{token}}",enableTokenDesc:"您首次在{{network}}上存款时必须启用{{token}}。",enableWithToken:"启用 {{token}}",arrivaltimeTooltip1:"您可以在约 {{v}} 分钟 (达到 {{v1}} 个区块确认后) 提走已到账的资金",arrivaltimeTooltip2:"预计时间是根据历史数据计算所得,仅供参考。网络拥堵可能会导致实际到账时间变长。",arrivalEstimated:"≈ {{v}}分钟",availableDesc:"您可以提取的最大金额。当 available 为0或负数时,不允许提现。",noPrivateKeyWalletWarning:"暂不支持无私钥钱包充值。若您是无私钥钱包,请勿进行充值。",layerZeroDepositTip:"系统会根据充值资金实际情况,将您的充值通过LayerZero完成。",layerZeroDepositButton:"使用LayerZero充值"},withdraw:{noticeDesc:"普通提现是一个两步过程。 此步骤将发起您的提现请求,并将在 Layer2 进行处理。 一旦资金准备就绪(可能需要最多 4 小时),您将收到一条将资金提现到钱包的通知。受链同步等情况影响下,时长可能到 48 小时。您需要自行承担交易 gas 费用。",crossChainTips:"跨链提币需在 L2(通过零知识证明)进行验证。提币过程最多约需2小时。相关链的资产池中需有充足的资金来处理跨链提币,其间还将产生矿工费。 edgeX 将收取一定的手续费作为矿工费。",commonWithdraw:"提现说明",withdraw:"提现",speed:"速度",confirmWithdraw:"提现确认",speedNote:"处理时间:",speedNoteSpeed1:"用时约8分钟",speedNoteSpeed2:"用时约 2-4 小时",speedNoteSpeed3:"用时约4小时",receiverAddress:"接收地址",fee:"手续费",withdrawlAmount:"提现金额",amountToReceive:"到账金额",invalidReceiverAddress:"接收地址不合法"}},ca={deposit:{title:"Deposit",chain:"Chain",asset:"Asset",amount:"Amount",available:"Available",equity:"Equity",confirmDeposit:"Confirm Deposit",switchNetwork:"Switch Network",max:"Max",arrivalTime:"Arrival Time",minDeposit:"Minimum Deposit Amount",minDepositParsed:"Min. Deposit {{amount}} {{token}}",maxDeposit:"Maximum Deposit Amount",depositTipFor25w:"The maximum amount per deposit is 200,000. If your deposit exceeds 200,000, please use the Ethereum chain.",depositAllTip:`Only {{coin}} ({{v}}) is supported for deposits to this address.
|
|
32
|
+
If the deposit amount exceeds 200,000, there may be a delay in the arrival time. Please be patient.`,enableSystemProWithToken:"Enable {{token}} on {{network}}",enableTokenDesc:"You must enable {{token}} the first time you deposit on {{network}}.",enableWithToken:"Enable {{token}}",arrivaltimeTooltip1:"You can withdraw the arrived funds in approximately {{v}} minutes (after reaching {{v1}} block confirmations)",arrivaltimeTooltip2:"Estimated time is calculated based on historical data and is for reference only. Network congestion may result in longer actual arrival times.",arrivalEstimated:"≈ {{v}} minutes",availableDesc:"Max. amount you can withdraw. When the available amount shown is 0 or negative, you are not allowed to make withdrawals.",noPrivateKeyWalletWarning:"Deposits from wallets without private keys are not supported at the moment. If you are using such a wallet, please do not make a deposit.",layerZeroDepositTip:"The system will complete your deposit via LayerZero based on the actual deposit conditions.",layerZeroDepositButton:"Deposit with LayerZero"},withdraw:{noticeDesc:"Normal withdrawals are a two-step process. The current step initiates your withdrawal request and will be processed on Layer 2. Once your funds are ready (can take up to 4 hours), you will receive a notification to withdraw funds to your wallet. Due to chain synchronization and other factors, the duration may take up to 48 hours. You are responsible for any transaction gas fees.",crossChainTips:"Cross-chain withdrawals require verification at L2 (via ZK proofs) and the withdrawal process may take up to 2 hours. Sufficient funds in the corresponding chain's asset pool are required to process cross-chain withdrawals. Gas fees will also be incurred. edgeX will charge a fee to cover this.",commonWithdraw:"Withdrawal FAQ",withdraw:"Withdraw",speed:"Speed",confirmWithdraw:"Confirm Withdrawal",speedNote:"Processing Times:",speedNoteSpeed1:"Approx. 8 Minutes",speedNoteSpeed2:"Approx. 2-4 Hours",speedNoteSpeed3:"Approx. 4 Hours",receiverAddress:"Receiver Address",fee:"Fee",withdrawlAmount:"Withdrawal amount",amountToReceive:"Amount to Receive",invalidReceiverAddress:"Invalid receiver address"}},fa={deposit:{title:"入金",chain:"チェーン",asset:"資産",amount:"数量",available:"利用可能",equity:"総資産",confirmDeposit:"入金確認",switchNetwork:"ネットワークを切り替え",max:"最大",arrivalTime:"着金予定時間",minDeposit:"最低入金額",minDepositParsed:"最低入金額 {{amount}} {{token}}",maxDeposit:"最大入金額",depositTipFor25w:"1回の入金上限額は200,000です。200,000を超える場合は、Ethereumチェーンでの入金をご利用ください。",depositAllTip:`このアドレスは{{coin}}({{v}})専用です。他通貨は送金しないでください。
|
|
33
|
+
入金金額が 200,000 を超える場合、反映までに時間がかかることがあります。しばらくお待ちください。`,enableSystemProWithToken:"{{network}} 上で {{token}} を有効化",enableTokenDesc:"初めて {{network}} に入金する際は、{{token}} の有効化が必要です。",enableWithToken:"{{token}} を有効化",arrivaltimeTooltip1:"{{v1}} ブロック確認後、おおよそ {{v}} 分以内に引き出し可能となります",arrivaltimeTooltip2:"着金時間は過去データに基づいた目安であり、ネットワーク状況により遅延する場合があります。",arrivalEstimated:"≈ {{v}}分",availableDesc:"出金可能な最大金額です。 available が0またはマイナスの場合、出金は行えません。",noPrivateKeyWalletWarning:"現在、秘密鍵のないウォレットからの入金はサポートされていません。該当ウォレットをご利用の場合は、入金しないでください。",layerZeroDepositTip:"システムは入金資金の実際の状況に基づき、LayerZeroを通じて入金を完了します。",layerZeroDepositButton:"LayerZeroで入金"},withdraw:{noticeDesc:"通常出金は2ステップで行われます。このステップで出金リクエストを送信し、Layer2で処理されます。資金の準備が完了すると(最大4時間かかる場合があります)、出金の通知が届きます。チェーンの同期などの影響により、所要時間は最長で48時間かかる場合があります。ガス代はユーザー負担です。",crossChainTips:"クロスチェーン出金はL2上(ゼロ知識証明経由)で検証が必要です。出金処理には最大2時間ほどかかる場合があります。対応するチェーンの資産プールに十分な流動性が必要であり、ガス代も発生します。edgeXはそのコストを補うため、一定の手数料を徴収します。",commonWithdraw:"出金ガイド",withdraw:"出金",speed:"出金時間",confirmWithdraw:"出金確認",speedNote:"処理時間:",speedNoteSpeed1:"約8分",speedNoteSpeed2:"約2~4時間",speedNoteSpeed3:"約4時間",receiverAddress:"受取アドレス",fee:"手数料",withdrawlAmount:"出金額",amountToReceive:"受け取り金額",invalidReceiverAddress:"無効な受け取りアドレス"}},da={deposit:{title:"Депозит",chain:"Сеть",asset:"Актив",amount:"Сумма",available:"Доступно",equity:"Капитал",confirmDeposit:"Подтвердить депозит",switchNetwork:"Сменить сеть",max:"Максимум",arrivalTime:"Время поступления",minDeposit:"Минимальная сумма депозита",minDepositParsed:"Мин. депозит {{amount}} {{token}}",maxDeposit:"Максимальная сумма депозита",depositTipFor25w:"Максимальная сумма одного пополнения — 200 000. Если сумма превышает 200 000, пожалуйста, используйте сеть Ethereum для пополнения.",depositAllTip:`На этот адрес можно внести только {{coin}} ({{v}}).
|
|
34
|
+
Если сумма депозита превышает 200 000, время поступления может быть увеличено. Пожалуйста, ожидайте.`,enableSystemProWithToken:"Включить {{token}} в сети {{network}}",enableTokenDesc:"При первом депозите в сети {{network}} необходимо включить {{token}}.",enableWithToken:"Включить {{token}}",arrivaltimeTooltip1:"Вы сможете вывести поступившие средства примерно через {{v}} минут (после {{v1}} подтверждений в блокчейне)",arrivaltimeTooltip2:"Оценка времени основана на истории и дана только для справки. Задержки сети могут увеличить фактическое время поступления.",arrivalEstimated:"≈ {{v}} минут",availableDesc:"Максимальная сумма для вывода. Если доступная сумма равна 0 или меньше, вывод невозможен.",noPrivateKeyWalletWarning:"В настоящее время пополнение кошельков без приватных ключей не поддерживается. Если у вас такой кошелёк, пожалуйста, не выполняйте пополнение.",layerZeroDepositTip:"Система завершит ваше пополнение через LayerZero в зависимости от фактических условий депозита.",layerZeroDepositButton:"Пополнение через LayerZero"},withdraw:{noticeDesc:"Вывод средств происходит в два этапа: сначала подаётся заявка на вывод (обрабатывается на Layer 2), затем - перевод на кошелёк после подготовки средств (до 14 часов). Из-за синхронизации цепочки и других факторов процесс может занять до 48 часов. За gas-комиссии отвечает пользователь.",crossChainTips:"• Кроссчейн выводы требуют проверки на L2 (через ZK доказательства) и могут занять до 2 часов. Для вывода нужны средства в пуле соответствующей цепи. Также взимается комиссия за газ. edgeX взимает плату за обслуживание.",commonWithdraw:"Часто задаваемые вопросы по выводу",withdraw:"Вывод",speed:"Скорость",confirmWithdraw:"Подтвердить вывод",speedNote:"Время обработки:",speedNoteSpeed1:"Прибл. 8 минут",speedNoteSpeed2:"Прибл. 2-4 часа",speedNoteSpeed3:"Прибл. 4 часа",receiverAddress:"Адрес получателя",fee:"Комиссия",withdrawlAmount:"Сумма вывода",amountToReceive:"Сумма к получению",invalidReceiverAddress:"Неверный адрес получателя"}},pa={deposit:{title:"充值",chain:"鏈",asset:"資產",amount:"數量",available:"可用",equity:"總資產",confirmDeposit:"充值確認",switchNetwork:"切換網絡",max:"最大",arrivalTime:"到帳時間",minDeposit:"最小儲值金額",minDepositParsed:"最少充值 {{amount}} {{token}}",maxDeposit:"最大儲值金額",depositTipFor25w:"單筆充值金額上限為 200,000。若充值金額大於 200,000,請使用 Ethereum 鏈充值。",depositAllTip:`僅支援發送 {{coin}} ({{v}}) 資產到此位址。
|
|
35
|
+
充值金額大於 200,000 時,到账時間可能會有延遲,請耐心等待。`,enableSystemProWithToken:"在{{network}}上啓用{{token}}",enableTokenDesc:"您首次在{{network}}上存款時必須啓用{{token}}。",enableWithToken:"啓用 {{token}}",arrivaltimeTooltip1:"您可以在約 {{v}} 分鐘 (達到 {{v1}} 個區塊確認後) 提走已到帳的資金",arrivaltimeTooltip2:"預計時間是根據歷史資料計算所得,僅供參考。網路壅塞可能會導致實際到帳時間變長。",arrivalEstimated:"≈ {{v}}分鐘",availableDesc:"您可以提取的最大金額。當 available 爲0或負數時,不允許提現。",noPrivateKeyWalletWarning:"暫不支援無私鑰錢包充值。若您使用的是無私鑰錢包,請勿進行充值。",layerZeroDepositTip:"系統會根據充值資金的實際情況,通過 LayerZero 完成您的充值。",layerZeroDepositButton:"使用LayerZero充值"},withdraw:{noticeDesc:"普通提現是一個兩步過程。此步驟將發起您的提現請求,並將在 Layer2 進行處理。一旦資金準備就緒(可能需要最多 4 小時),您將收到一條將資金提現到錢包的通知。受鏈同步等情況影響下,時長可能需要長達 48 小時。您需要自行承擔交易 gas 費用。",crossChainTips:"跨鏈提幣需在 L2(通過零知識證明)進行驗證。提幣過程最多約需2小時。相關鏈的資產池中需有充足的資金來處理跨鏈提幣,其間還將產生礦工費。 edgeX 將收取一定的手續費作爲礦工費。",commonWithdraw:"提現說明",withdraw:"提現",speed:"速度",confirmWithdraw:"提現確認",speedNote:"處理時間:",speedNoteSpeed1:"用時約8分鐘",speedNoteSpeed2:"用時約 2-4 小時",speedNoteSpeed3:"用時約4小時",receiverAddress:"接收地址",fee:"手續費",withdrawlAmount:"提現金額",amountToReceive:"到账金額",invalidReceiverAddress:"接收地址不合法"}},Jn=["en-US","ja-JP","ru-RU","zh-CN","zh-TW"],Io={"en-US":ca,"ja-JP":fa,"ru-RU":da,"zh-CN":ua,"zh-TW":pa},un="en-US",ma={"en-US":"English","zh-CN":"简体中文","zh-TW":"繁體中文","ja-JP":"日本語","ru-RU":"Русский"},ha=e=>Jn.includes(e)?Io[e]:Io[un],ga=e=>Jn.includes(e),jo=m.createContext(null),va=({config:e,children:t})=>{const n=m.useMemo(()=>{const r=e.locale||un,o=ga(r)?r:un,i=ha(o);return{...e,currentLocale:o,translations:i}},[e]);return S.jsx(jo.Provider,{value:n,children:t})},Fo=()=>{const e=m.useContext(jo);if(!e)throw new Error("useComponentConfig must be used within ComponentProvider");return e};var ba=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,er=Math.ceil,je=Math.floor,Te="[BigNumber Error] ",Ro=Te+"Number primitive has more than 15 significant digits: ",Ge=1e14,Q=14,tr=9007199254740991,nr=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],ht=1e7,ve=1e9;function ko(e){var t,n,r,o=w.prototype={constructor:w,toString:null,valueOf:null},i=new w(1),l=20,u=4,s=-7,a=21,c=-1e7,d=1e7,p=!1,f=1,g=0,v={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},E="0123456789abcdefghijklmnopqrstuvwxyz",M=!0;function w(h,b){var y,$,D,L,C,O,T,P,x=this;if(!(x instanceof w))return new w(h,b);if(b==null){if(h&&h._isBigNumber===!0){x.s=h.s,!h.c||h.e>d?x.c=x.e=null:h.e<c?x.c=[x.e=0]:(x.e=h.e,x.c=h.c.slice());return}if((O=typeof h=="number")&&h*0==0){if(x.s=1/h<0?(h=-h,-1):1,h===~~h){for(L=0,C=h;C>=10;C/=10,L++);L>d?x.c=x.e=null:(x.e=L,x.c=[h]);return}P=String(h)}else{if(!ba.test(P=String(h)))return r(x,P,O);x.s=P.charCodeAt(0)==45?(P=P.slice(1),-1):1}(L=P.indexOf("."))>-1&&(P=P.replace(".","")),(C=P.search(/e/i))>0?(L<0&&(L=C),L+=+P.slice(C+1),P=P.substring(0,C)):L<0&&(L=P.length)}else{if(ce(b,2,E.length,"Base"),b==10&&M)return x=new w(h),k(x,l+x.e+1,u);if(P=String(h),O=typeof h=="number"){if(h*0!=0)return r(x,P,O,b);if(x.s=1/h<0?(P=P.slice(1),-1):1,w.DEBUG&&P.replace(/^0\.0*|\./,"").length>15)throw Error(Ro+h)}else x.s=P.charCodeAt(0)===45?(P=P.slice(1),-1):1;for(y=E.slice(0,b),L=C=0,T=P.length;C<T;C++)if(y.indexOf($=P.charAt(C))<0){if($=="."){if(C>L){L=T;continue}}else if(!D&&(P==P.toUpperCase()&&(P=P.toLowerCase())||P==P.toLowerCase()&&(P=P.toUpperCase()))){D=!0,C=-1,L=0;continue}return r(x,String(h),O,b)}O=!1,P=n(P,b,10,x.s),(L=P.indexOf("."))>-1?P=P.replace(".",""):L=P.length}for(C=0;P.charCodeAt(C)===48;C++);for(T=P.length;P.charCodeAt(--T)===48;);if(P=P.slice(C,++T)){if(T-=C,O&&w.DEBUG&&T>15&&(h>tr||h!==je(h)))throw Error(Ro+x.s*h);if((L=L-C-1)>d)x.c=x.e=null;else if(L<c)x.c=[x.e=0];else{if(x.e=L,x.c=[],C=(L+1)%Q,L<0&&(C+=Q),C<T){for(C&&x.c.push(+P.slice(0,C)),T-=Q;C<T;)x.c.push(+P.slice(C,C+=Q));C=Q-(P=P.slice(C)).length}else C-=T;for(;C--;P+="0");x.c.push(+P)}}else x.c=[x.e=0]}w.clone=ko,w.ROUND_UP=0,w.ROUND_DOWN=1,w.ROUND_CEIL=2,w.ROUND_FLOOR=3,w.ROUND_HALF_UP=4,w.ROUND_HALF_DOWN=5,w.ROUND_HALF_EVEN=6,w.ROUND_HALF_CEIL=7,w.ROUND_HALF_FLOOR=8,w.EUCLID=9,w.config=w.set=function(h){var b,y;if(h!=null)if(typeof h=="object"){if(h.hasOwnProperty(b="DECIMAL_PLACES")&&(y=h[b],ce(y,0,ve,b),l=y),h.hasOwnProperty(b="ROUNDING_MODE")&&(y=h[b],ce(y,0,8,b),u=y),h.hasOwnProperty(b="EXPONENTIAL_AT")&&(y=h[b],y&&y.pop?(ce(y[0],-ve,0,b),ce(y[1],0,ve,b),s=y[0],a=y[1]):(ce(y,-ve,ve,b),s=-(a=y<0?-y:y))),h.hasOwnProperty(b="RANGE"))if(y=h[b],y&&y.pop)ce(y[0],-ve,-1,b),ce(y[1],1,ve,b),c=y[0],d=y[1];else if(ce(y,-ve,ve,b),y)c=-(d=y<0?-y:y);else throw Error(Te+b+" cannot be zero: "+y);if(h.hasOwnProperty(b="CRYPTO"))if(y=h[b],y===!!y)if(y)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))p=y;else throw p=!y,Error(Te+"crypto unavailable");else p=y;else throw Error(Te+b+" not true or false: "+y);if(h.hasOwnProperty(b="MODULO_MODE")&&(y=h[b],ce(y,0,9,b),f=y),h.hasOwnProperty(b="POW_PRECISION")&&(y=h[b],ce(y,0,ve,b),g=y),h.hasOwnProperty(b="FORMAT"))if(y=h[b],typeof y=="object")v=y;else throw Error(Te+b+" not an object: "+y);if(h.hasOwnProperty(b="ALPHABET"))if(y=h[b],typeof y=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test(y))M=y.slice(0,10)=="0123456789",E=y;else throw Error(Te+b+" invalid: "+y)}else throw Error(Te+"Object expected: "+h);return{DECIMAL_PLACES:l,ROUNDING_MODE:u,EXPONENTIAL_AT:[s,a],RANGE:[c,d],CRYPTO:p,MODULO_MODE:f,POW_PRECISION:g,FORMAT:v,ALPHABET:E}},w.isBigNumber=function(h){if(!h||h._isBigNumber!==!0)return!1;if(!w.DEBUG)return!0;var b,y,$=h.c,D=h.e,L=h.s;e:if({}.toString.call($)=="[object Array]"){if((L===1||L===-1)&&D>=-ve&&D<=ve&&D===je(D)){if($[0]===0){if(D===0&&$.length===1)return!0;break e}if(b=(D+1)%Q,b<1&&(b+=Q),String($[0]).length==b){for(b=0;b<$.length;b++)if(y=$[b],y<0||y>=Ge||y!==je(y))break e;if(y!==0)return!0}}}else if($===null&&D===null&&(L===null||L===1||L===-1))return!0;throw Error(Te+"Invalid BigNumber: "+h)},w.maximum=w.max=function(){return F(arguments,-1)},w.minimum=w.min=function(){return F(arguments,1)},w.random=function(){var h=9007199254740992,b=Math.random()*h&2097151?function(){return je(Math.random()*h)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(y){var $,D,L,C,O,T=0,P=[],x=new w(i);if(y==null?y=l:ce(y,0,ve),C=er(y/Q),p)if(crypto.getRandomValues){for($=crypto.getRandomValues(new Uint32Array(C*=2));T<C;)O=$[T]*131072+($[T+1]>>>11),O>=9e15?(D=crypto.getRandomValues(new Uint32Array(2)),$[T]=D[0],$[T+1]=D[1]):(P.push(O%1e14),T+=2);T=C/2}else if(crypto.randomBytes){for($=crypto.randomBytes(C*=7);T<C;)O=($[T]&31)*281474976710656+$[T+1]*1099511627776+$[T+2]*4294967296+$[T+3]*16777216+($[T+4]<<16)+($[T+5]<<8)+$[T+6],O>=9e15?crypto.randomBytes(7).copy($,T):(P.push(O%1e14),T+=7);T=C/7}else throw p=!1,Error(Te+"crypto unavailable");if(!p)for(;T<C;)O=b(),O<9e15&&(P[T++]=O%1e14);for(C=P[--T],y%=Q,C&&y&&(O=nr[Q-y],P[T]=je(C/O)*O);P[T]===0;P.pop(),T--);if(T<0)P=[L=0];else{for(L=-1;P[0]===0;P.splice(0,1),L-=Q);for(T=1,O=P[0];O>=10;O/=10,T++);T<Q&&(L-=Q-T)}return x.e=L,x.c=P,x}}(),w.sum=function(){for(var h=1,b=arguments,y=new w(b[0]);h<b.length;)y=y.plus(b[h++]);return y},n=function(){var h="0123456789";function b(y,$,D,L){for(var C,O=[0],T,P=0,x=y.length;P<x;){for(T=O.length;T--;O[T]*=$);for(O[0]+=L.indexOf(y.charAt(P++)),C=0;C<O.length;C++)O[C]>D-1&&(O[C+1]==null&&(O[C+1]=0),O[C+1]+=O[C]/D|0,O[C]%=D)}return O.reverse()}return function(y,$,D,L,C){var O,T,P,x,I,_,V,W,Y=y.indexOf("."),q=l,G=u;for(Y>=0&&(x=g,g=0,y=y.replace(".",""),W=new w($),_=W.pow(y.length-Y),g=x,W.c=b(st(Re(_.c),_.e,"0"),10,D,h),W.e=W.c.length),V=b(y,$,D,C?(O=E,h):(O=h,E)),P=x=V.length;V[--x]==0;V.pop());if(!V[0])return O.charAt(0);if(Y<0?--P:(_.c=V,_.e=P,_.s=L,_=t(_,W,q,G,D),V=_.c,I=_.r,P=_.e),T=P+q+1,Y=V[T],x=D/2,I=I||T<0||V[T+1]!=null,I=G<4?(Y!=null||I)&&(G==0||G==(_.s<0?3:2)):Y>x||Y==x&&(G==4||I||G==6&&V[T-1]&1||G==(_.s<0?8:7)),T<1||!V[0])y=I?st(O.charAt(1),-q,O.charAt(0)):O.charAt(0);else{if(V.length=T,I)for(--D;++V[--T]>D;)V[T]=0,T||(++P,V=[1].concat(V));for(x=V.length;!V[--x];);for(Y=0,y="";Y<=x;y+=O.charAt(V[Y++]));y=st(y,P,O.charAt(0))}return y}}(),t=function(){function h($,D,L){var C,O,T,P,x=0,I=$.length,_=D%ht,V=D/ht|0;for($=$.slice();I--;)T=$[I]%ht,P=$[I]/ht|0,C=V*T+P*_,O=_*T+C%ht*ht+x,x=(O/L|0)+(C/ht|0)+V*P,$[I]=O%L;return x&&($=[x].concat($)),$}function b($,D,L,C){var O,T;if(L!=C)T=L>C?1:-1;else for(O=T=0;O<L;O++)if($[O]!=D[O]){T=$[O]>D[O]?1:-1;break}return T}function y($,D,L,C){for(var O=0;L--;)$[L]-=O,O=$[L]<D[L]?1:0,$[L]=O*C+$[L]-D[L];for(;!$[0]&&$.length>1;$.splice(0,1));}return function($,D,L,C,O){var T,P,x,I,_,V,W,Y,q,G,H,z,J,se,he,$e,it,Ee=$.s==D.s?1:-1,ge=$.c,le=D.c;if(!ge||!ge[0]||!le||!le[0])return new w(!$.s||!D.s||(ge?le&&ge[0]==le[0]:!le)?NaN:ge&&ge[0]==0||!le?Ee*0:Ee/0);for(Y=new w(Ee),q=Y.c=[],P=$.e-D.e,Ee=L+P+1,O||(O=Ge,P=Fe($.e/Q)-Fe(D.e/Q),Ee=Ee/Q|0),x=0;le[x]==(ge[x]||0);x++);if(le[x]>(ge[x]||0)&&P--,Ee<0)q.push(1),I=!0;else{for(se=ge.length,$e=le.length,x=0,Ee+=2,_=je(O/(le[0]+1)),_>1&&(le=h(le,_,O),ge=h(ge,_,O),$e=le.length,se=ge.length),J=$e,G=ge.slice(0,$e),H=G.length;H<$e;G[H++]=0);it=le.slice(),it=[0].concat(it),he=le[0],le[1]>=O/2&&he++;do{if(_=0,T=b(le,G,$e,H),T<0){if(z=G[0],$e!=H&&(z=z*O+(G[1]||0)),_=je(z/he),_>1)for(_>=O&&(_=O-1),V=h(le,_,O),W=V.length,H=G.length;b(V,G,W,H)==1;)_--,y(V,$e<W?it:le,W,O),W=V.length,T=1;else _==0&&(T=_=1),V=le.slice(),W=V.length;if(W<H&&(V=[0].concat(V)),y(G,V,H,O),H=G.length,T==-1)for(;b(le,G,$e,H)<1;)_++,y(G,$e<H?it:le,H,O),H=G.length}else T===0&&(_++,G=[0]);q[x++]=_,G[0]?G[H++]=ge[J]||0:(G=[ge[J]],H=1)}while((J++<se||G[0]!=null)&&Ee--);I=G[0]!=null,q[0]||q.splice(0,1)}if(O==Ge){for(x=1,Ee=q[0];Ee>=10;Ee/=10,x++);k(Y,L+(Y.e=x+P*Q-1)+1,C,I)}else Y.e=P,Y.r=+I;return Y}}();function N(h,b,y,$){var D,L,C,O,T;if(y==null?y=u:ce(y,0,8),!h.c)return h.toString();if(D=h.c[0],C=h.e,b==null)T=Re(h.c),T=$==1||$==2&&(C<=s||C>=a)?fn(T,C):st(T,C,"0");else if(h=k(new w(h),b,y),L=h.e,T=Re(h.c),O=T.length,$==1||$==2&&(b<=L||L<=s)){for(;O<b;T+="0",O++);T=fn(T,L)}else if(b-=C+($===2&&L>C),T=st(T,L,"0"),L+1>O){if(--b>0)for(T+=".";b--;T+="0");}else if(b+=L-O,b>0)for(L+1==O&&(T+=".");b--;T+="0");return h.s<0&&D?"-"+T:T}function F(h,b){for(var y,$,D=1,L=new w(h[0]);D<h.length;D++)$=new w(h[D]),(!$.s||(y=Et(L,$))===b||y===0&&L.s===b)&&(L=$);return L}function j(h,b,y){for(var $=1,D=b.length;!b[--D];b.pop());for(D=b[0];D>=10;D/=10,$++);return(y=$+y*Q-1)>d?h.c=h.e=null:y<c?h.c=[h.e=0]:(h.e=y,h.c=b),h}r=function(){var h=/^(-?)0([xbo])(?=\w[\w.]*$)/i,b=/^([^.]+)\.$/,y=/^\.([^.]+)$/,$=/^-?(Infinity|NaN)$/,D=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(L,C,O,T){var P,x=O?C:C.replace(D,"");if($.test(x))L.s=isNaN(x)?null:x<0?-1:1;else{if(!O&&(x=x.replace(h,function(I,_,V){return P=(V=V.toLowerCase())=="x"?16:V=="b"?2:8,!T||T==P?_:I}),T&&(P=T,x=x.replace(b,"$1").replace(y,"0.$1")),C!=x))return new w(x,P);if(w.DEBUG)throw Error(Te+"Not a"+(T?" base "+T:"")+" number: "+C);L.s=null}L.c=L.e=null}}();function k(h,b,y,$){var D,L,C,O,T,P,x,I=h.c,_=nr;if(I){e:{for(D=1,O=I[0];O>=10;O/=10,D++);if(L=b-D,L<0)L+=Q,C=b,T=I[P=0],x=je(T/_[D-C-1]%10);else if(P=er((L+1)/Q),P>=I.length)if($){for(;I.length<=P;I.push(0));T=x=0,D=1,L%=Q,C=L-Q+1}else break e;else{for(T=O=I[P],D=1;O>=10;O/=10,D++);L%=Q,C=L-Q+D,x=C<0?0:je(T/_[D-C-1]%10)}if($=$||b<0||I[P+1]!=null||(C<0?T:T%_[D-C-1]),$=y<4?(x||$)&&(y==0||y==(h.s<0?3:2)):x>5||x==5&&(y==4||$||y==6&&(L>0?C>0?T/_[D-C]:0:I[P-1])%10&1||y==(h.s<0?8:7)),b<1||!I[0])return I.length=0,$?(b-=h.e+1,I[0]=_[(Q-b%Q)%Q],h.e=-b||0):I[0]=h.e=0,h;if(L==0?(I.length=P,O=1,P--):(I.length=P+1,O=_[Q-L],I[P]=C>0?je(T/_[D-C]%_[C])*O:0),$)for(;;)if(P==0){for(L=1,C=I[0];C>=10;C/=10,L++);for(C=I[0]+=O,O=1;C>=10;C/=10,O++);L!=O&&(h.e++,I[0]==Ge&&(I[0]=1));break}else{if(I[P]+=O,I[P]!=Ge)break;I[P--]=0,O=1}for(L=I.length;I[--L]===0;I.pop());}h.e>d?h.c=h.e=null:h.e<c&&(h.c=[h.e=0])}return h}function B(h){var b,y=h.e;return y===null?h.toString():(b=Re(h.c),b=y<=s||y>=a?fn(b,y):st(b,y,"0"),h.s<0?"-"+b:b)}return o.absoluteValue=o.abs=function(){var h=new w(this);return h.s<0&&(h.s=1),h},o.comparedTo=function(h,b){return Et(this,new w(h,b))},o.decimalPlaces=o.dp=function(h,b){var y,$,D,L=this;if(h!=null)return ce(h,0,ve),b==null?b=u:ce(b,0,8),k(new w(L),h+L.e+1,b);if(!(y=L.c))return null;if($=((D=y.length-1)-Fe(this.e/Q))*Q,D=y[D])for(;D%10==0;D/=10,$--);return $<0&&($=0),$},o.dividedBy=o.div=function(h,b){return t(this,new w(h,b),l,u)},o.dividedToIntegerBy=o.idiv=function(h,b){return t(this,new w(h,b),0,1)},o.exponentiatedBy=o.pow=function(h,b){var y,$,D,L,C,O,T,P,x,I=this;if(h=new w(h),h.c&&!h.isInteger())throw Error(Te+"Exponent not an integer: "+B(h));if(b!=null&&(b=new w(b)),O=h.e>14,!I.c||!I.c[0]||I.c[0]==1&&!I.e&&I.c.length==1||!h.c||!h.c[0])return x=new w(Math.pow(+B(I),O?h.s*(2-cn(h)):+B(h))),b?x.mod(b):x;if(T=h.s<0,b){if(b.c?!b.c[0]:!b.s)return new w(NaN);$=!T&&I.isInteger()&&b.isInteger(),$&&(I=I.mod(b))}else{if(h.e>9&&(I.e>0||I.e<-1||(I.e==0?I.c[0]>1||O&&I.c[1]>=24e7:I.c[0]<8e13||O&&I.c[0]<=9999975e7)))return L=I.s<0&&cn(h)?-0:0,I.e>-1&&(L=1/L),new w(T?1/L:L);g&&(L=er(g/Q+2))}for(O?(y=new w(.5),T&&(h.s=1),P=cn(h)):(D=Math.abs(+B(h)),P=D%2),x=new w(i);;){if(P){if(x=x.times(I),!x.c)break;L?x.c.length>L&&(x.c.length=L):$&&(x=x.mod(b))}if(D){if(D=je(D/2),D===0)break;P=D%2}else if(h=h.times(y),k(h,h.e+1,1),h.e>14)P=cn(h);else{if(D=+B(h),D===0)break;P=D%2}I=I.times(I),L?I.c&&I.c.length>L&&(I.c.length=L):$&&(I=I.mod(b))}return $?x:(T&&(x=i.div(x)),b?x.mod(b):L?k(x,g,u,C):x)},o.integerValue=function(h){var b=new w(this);return h==null?h=u:ce(h,0,8),k(b,b.e+1,h)},o.isEqualTo=o.eq=function(h,b){return Et(this,new w(h,b))===0},o.isFinite=function(){return!!this.c},o.isGreaterThan=o.gt=function(h,b){return Et(this,new w(h,b))>0},o.isGreaterThanOrEqualTo=o.gte=function(h,b){return(b=Et(this,new w(h,b)))===1||b===0},o.isInteger=function(){return!!this.c&&Fe(this.e/Q)>this.c.length-2},o.isLessThan=o.lt=function(h,b){return Et(this,new w(h,b))<0},o.isLessThanOrEqualTo=o.lte=function(h,b){return(b=Et(this,new w(h,b)))===-1||b===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(h,b){var y,$,D,L,C=this,O=C.s;if(h=new w(h,b),b=h.s,!O||!b)return new w(NaN);if(O!=b)return h.s=-b,C.plus(h);var T=C.e/Q,P=h.e/Q,x=C.c,I=h.c;if(!T||!P){if(!x||!I)return x?(h.s=-b,h):new w(I?C:NaN);if(!x[0]||!I[0])return I[0]?(h.s=-b,h):new w(x[0]?C:u==3?-0:0)}if(T=Fe(T),P=Fe(P),x=x.slice(),O=T-P){for((L=O<0)?(O=-O,D=x):(P=T,D=I),D.reverse(),b=O;b--;D.push(0));D.reverse()}else for($=(L=(O=x.length)<(b=I.length))?O:b,O=b=0;b<$;b++)if(x[b]!=I[b]){L=x[b]<I[b];break}if(L&&(D=x,x=I,I=D,h.s=-h.s),b=($=I.length)-(y=x.length),b>0)for(;b--;x[y++]=0);for(b=Ge-1;$>O;){if(x[--$]<I[$]){for(y=$;y&&!x[--y];x[y]=b);--x[y],x[$]+=Ge}x[$]-=I[$]}for(;x[0]==0;x.splice(0,1),--P);return x[0]?j(h,x,P):(h.s=u==3?-1:1,h.c=[h.e=0],h)},o.modulo=o.mod=function(h,b){var y,$,D=this;return h=new w(h,b),!D.c||!h.s||h.c&&!h.c[0]?new w(NaN):!h.c||D.c&&!D.c[0]?new w(D):(f==9?($=h.s,h.s=1,y=t(D,h,0,3),h.s=$,y.s*=$):y=t(D,h,0,f),h=D.minus(y.times(h)),!h.c[0]&&f==1&&(h.s=D.s),h)},o.multipliedBy=o.times=function(h,b){var y,$,D,L,C,O,T,P,x,I,_,V,W,Y,q,G=this,H=G.c,z=(h=new w(h,b)).c;if(!H||!z||!H[0]||!z[0])return!G.s||!h.s||H&&!H[0]&&!z||z&&!z[0]&&!H?h.c=h.e=h.s=null:(h.s*=G.s,!H||!z?h.c=h.e=null:(h.c=[0],h.e=0)),h;for($=Fe(G.e/Q)+Fe(h.e/Q),h.s*=G.s,T=H.length,I=z.length,T<I&&(W=H,H=z,z=W,D=T,T=I,I=D),D=T+I,W=[];D--;W.push(0));for(Y=Ge,q=ht,D=I;--D>=0;){for(y=0,_=z[D]%q,V=z[D]/q|0,C=T,L=D+C;L>D;)P=H[--C]%q,x=H[C]/q|0,O=V*P+x*_,P=_*P+O%q*q+W[L]+y,y=(P/Y|0)+(O/q|0)+V*x,W[L--]=P%Y;W[L]=y}return y?++$:W.splice(0,1),j(h,W,$)},o.negated=function(){var h=new w(this);return h.s=-h.s||null,h},o.plus=function(h,b){var y,$=this,D=$.s;if(h=new w(h,b),b=h.s,!D||!b)return new w(NaN);if(D!=b)return h.s=-b,$.minus(h);var L=$.e/Q,C=h.e/Q,O=$.c,T=h.c;if(!L||!C){if(!O||!T)return new w(D/0);if(!O[0]||!T[0])return T[0]?h:new w(O[0]?$:D*0)}if(L=Fe(L),C=Fe(C),O=O.slice(),D=L-C){for(D>0?(C=L,y=T):(D=-D,y=O),y.reverse();D--;y.push(0));y.reverse()}for(D=O.length,b=T.length,D-b<0&&(y=T,T=O,O=y,b=D),D=0;b;)D=(O[--b]=O[b]+T[b]+D)/Ge|0,O[b]=Ge===O[b]?0:O[b]%Ge;return D&&(O=[D].concat(O),++C),j(h,O,C)},o.precision=o.sd=function(h,b){var y,$,D,L=this;if(h!=null&&h!==!!h)return ce(h,1,ve),b==null?b=u:ce(b,0,8),k(new w(L),h,b);if(!(y=L.c))return null;if(D=y.length-1,$=D*Q+1,D=y[D]){for(;D%10==0;D/=10,$--);for(D=y[0];D>=10;D/=10,$++);}return h&&L.e+1>$&&($=L.e+1),$},o.shiftedBy=function(h){return ce(h,-tr,tr),this.times("1e"+h)},o.squareRoot=o.sqrt=function(){var h,b,y,$,D,L=this,C=L.c,O=L.s,T=L.e,P=l+4,x=new w("0.5");if(O!==1||!C||!C[0])return new w(!O||O<0&&(!C||C[0])?NaN:C?L:1/0);if(O=Math.sqrt(+B(L)),O==0||O==1/0?(b=Re(C),(b.length+T)%2==0&&(b+="0"),O=Math.sqrt(+b),T=Fe((T+1)/2)-(T<0||T%2),O==1/0?b="5e"+T:(b=O.toExponential(),b=b.slice(0,b.indexOf("e")+1)+T),y=new w(b)):y=new w(O+""),y.c[0]){for(T=y.e,O=T+P,O<3&&(O=0);;)if(D=y,y=x.times(D.plus(t(L,D,P,1))),Re(D.c).slice(0,O)===(b=Re(y.c)).slice(0,O))if(y.e<T&&--O,b=b.slice(O-3,O+1),b=="9999"||!$&&b=="4999"){if(!$&&(k(D,D.e+l+2,0),D.times(D).eq(L))){y=D;break}P+=4,O+=4,$=1}else{(!+b||!+b.slice(1)&&b.charAt(0)=="5")&&(k(y,y.e+l+2,1),h=!y.times(y).eq(L));break}}return k(y,y.e+l+1,u,h)},o.toExponential=function(h,b){return h!=null&&(ce(h,0,ve),h++),N(this,h,b,1)},o.toFixed=function(h,b){return h!=null&&(ce(h,0,ve),h=h+this.e+1),N(this,h,b)},o.toFormat=function(h,b,y){var $,D=this;if(y==null)h!=null&&b&&typeof b=="object"?(y=b,b=null):h&&typeof h=="object"?(y=h,h=b=null):y=v;else if(typeof y!="object")throw Error(Te+"Argument not an object: "+y);if($=D.toFixed(h,b),D.c){var L,C=$.split("."),O=+y.groupSize,T=+y.secondaryGroupSize,P=y.groupSeparator||"",x=C[0],I=C[1],_=D.s<0,V=_?x.slice(1):x,W=V.length;if(T&&(L=O,O=T,T=L,W-=L),O>0&&W>0){for(L=W%O||O,x=V.substr(0,L);L<W;L+=O)x+=P+V.substr(L,O);T>0&&(x+=P+V.slice(L)),_&&(x="-"+x)}$=I?x+(y.decimalSeparator||"")+((T=+y.fractionGroupSize)?I.replace(new RegExp("\\d{"+T+"}\\B","g"),"$&"+(y.fractionGroupSeparator||"")):I):x}return(y.prefix||"")+$+(y.suffix||"")},o.toFraction=function(h){var b,y,$,D,L,C,O,T,P,x,I,_,V=this,W=V.c;if(h!=null&&(O=new w(h),!O.isInteger()&&(O.c||O.s!==1)||O.lt(i)))throw Error(Te+"Argument "+(O.isInteger()?"out of range: ":"not an integer: ")+B(O));if(!W)return new w(V);for(b=new w(i),P=y=new w(i),$=T=new w(i),_=Re(W),L=b.e=_.length-V.e-1,b.c[0]=nr[(C=L%Q)<0?Q+C:C],h=!h||O.comparedTo(b)>0?L>0?b:P:O,C=d,d=1/0,O=new w(_),T.c[0]=0;x=t(O,b,0,1),D=y.plus(x.times($)),D.comparedTo(h)!=1;)y=$,$=D,P=T.plus(x.times(D=P)),T=D,b=O.minus(x.times(D=b)),O=D;return D=t(h.minus(y),$,0,1),T=T.plus(D.times(P)),y=y.plus(D.times($)),T.s=P.s=V.s,L=L*2,I=t(P,$,L,u).minus(V).abs().comparedTo(t(T,y,L,u).minus(V).abs())<1?[P,$]:[T,y],d=C,I},o.toNumber=function(){return+B(this)},o.toPrecision=function(h,b){return h!=null&&ce(h,1,ve),N(this,h,b,2)},o.toString=function(h){var b,y=this,$=y.s,D=y.e;return D===null?$?(b="Infinity",$<0&&(b="-"+b)):b="NaN":(h==null?b=D<=s||D>=a?fn(Re(y.c),D):st(Re(y.c),D,"0"):h===10&&M?(y=k(new w(y),l+D+1,u),b=st(Re(y.c),y.e,"0")):(ce(h,2,E.length,"Base"),b=n(st(Re(y.c),D,"0"),10,h,$,!0)),$<0&&y.c[0]&&(b="-"+b)),b},o.valueOf=o.toJSON=function(){return B(this)},o._isBigNumber=!0,o[Symbol.toStringTag]="BigNumber",o[Symbol.for("nodejs.util.inspect.custom")]=o.valueOf,e!=null&&w.set(e),w}function Fe(e){var t=e|0;return e>0||e===t?t:t-1}function Re(e){for(var t,n,r=1,o=e.length,i=e[0]+"";r<o;){for(t=e[r++]+"",n=Q-t.length;n--;t="0"+t);i+=t}for(o=i.length;i.charCodeAt(--o)===48;);return i.slice(0,o+1||1)}function Et(e,t){var n,r,o=e.c,i=t.c,l=e.s,u=t.s,s=e.e,a=t.e;if(!l||!u)return null;if(n=o&&!o[0],r=i&&!i[0],n||r)return n?r?0:-u:l;if(l!=u)return l;if(n=l<0,r=s==a,!o||!i)return r?0:!o^n?1:-1;if(!r)return s>a^n?1:-1;for(u=(s=o.length)<(a=i.length)?s:a,l=0;l<u;l++)if(o[l]!=i[l])return o[l]>i[l]^n?1:-1;return s==a?0:s>a^n?1:-1}function ce(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 cn(e){var t=e.c.length-1;return Fe(e.e/Q)==t&&e.c[t]%2!=0}function fn(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function st(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}var xe=ko();const ya=(e,t=6)=>{try{const n=new xe(e||"0");if(n.isNaN())return"0";const r=n.decimalPlaces(t,xe.ROUND_DOWN),[o,i=""]=r.toString().split("."),l=o.replace(/\B(?=(\d{3})+(?!\d))/g,",");if(t>0){const u=(i||"").padEnd(t,"0");return`${l}.${u}`}return l}catch(n){return console.warn("formatThousands error:",n),"0"}},Ye=()=>{const{translations:e,currentLocale:t}=Fo();return{t:(i,l)=>{try{const u=i.split(".");let s=e;for(const c of u)if(s&&typeof s=="object"&&c in s)s=s[c];else return i;let a=typeof s=="string"?s:i;return l&&typeof a=="string"&&Object.keys(l).forEach(c=>{const d=`{{${c}}}`;a=a.replace(new RegExp(d,"g"),String(l[c]))}),a}catch(u){return console.warn(`Translation error for key "${i}":`,u),i}},translations:e,locale:t,getTranslationObject:i=>{try{const l=i.split(".");let u=e;for(const s of l)if(u&&typeof u=="object"&&s in u)u=u[s];else return{};return typeof u=="object"?u:{}}catch(l){return console.warn(`Translation object error for key "${i}":`,l),{}}},hasTranslation:i=>{try{const l=i.split(".");let u=e;for(const s of l)if(u&&typeof u=="object"&&s in u)u=u[s];else return!1;return typeof u=="string"}catch{return!1}}}},xa=()=>({openDeposit:m.useCallback(t=>{},[])}),wa=()=>({openWithdraw:m.useCallback(t=>{},[])});/**
|
|
36
36
|
* @license lucide-react v0.540.0 - ISC
|
|
37
37
|
*
|
|
38
38
|
* This source code is licensed under the ISC license.
|
|
39
39
|
* See the LICENSE file in the root directory of this source tree.
|
|
40
|
-
*/const
|
|
40
|
+
*/const Ea=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Sa=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),_o=e=>{const t=Sa(e);return t.charAt(0).toUpperCase()+t.slice(1)},Bo=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),Ca=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};/**
|
|
41
41
|
* @license lucide-react v0.540.0 - ISC
|
|
42
42
|
*
|
|
43
43
|
* This source code is licensed under the ISC license.
|
|
44
44
|
* See the LICENSE file in the root directory of this source tree.
|
|
45
|
-
*/var
|
|
45
|
+
*/var Oa={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
|
|
46
46
|
* @license lucide-react v0.540.0 - ISC
|
|
47
47
|
*
|
|
48
48
|
* This source code is licensed under the ISC license.
|
|
49
49
|
* See the LICENSE file in the root directory of this source tree.
|
|
50
|
-
*/const
|
|
50
|
+
*/const Ta=m.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:i,iconNode:l,...u},s)=>m.createElement("svg",{ref:s,...Oa,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:Bo("lucide",o),...!i&&!Ca(u)&&{"aria-hidden":"true"},...u},[...l.map(([a,c])=>m.createElement(a,c)),...Array.isArray(i)?i:[i]]));/**
|
|
51
51
|
* @license lucide-react v0.540.0 - ISC
|
|
52
52
|
*
|
|
53
53
|
* This source code is licensed under the ISC license.
|
|
54
54
|
* See the LICENSE file in the root directory of this source tree.
|
|
55
|
-
*/const
|
|
55
|
+
*/const Na=(e,t)=>{const n=m.forwardRef(({className:r,...o},i)=>m.createElement(Ta,{ref:i,iconNode:t,className:Bo(`lucide-${Ea(_o(e))}`,`lucide-${e}`,r),...o}));return n.displayName=_o(e),n};/**
|
|
56
56
|
* @license lucide-react v0.540.0 - ISC
|
|
57
57
|
*
|
|
58
58
|
* This source code is licensed under the ISC license.
|
|
59
59
|
* See the LICENSE file in the root directory of this source tree.
|
|
60
|
-
*/const Bo=Ta("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);class Uo{constructor(){Ie(this,"state");this.state={isLoading:!1,isApproving:!1,isDepositing:!1,error:null,txHash:null}}getState(){return{...this.state}}setState(t){this.state={...this.state,...t}}}class Na extends Uo{constructor(n,r){super();Ie(this,"smartWallet");Ie(this,"currentActiveAccount");this.smartWallet=n,this.currentActiveAccount=r}getWalletType(){return"mpc"}getDisplayAddress(){var n;return((n=this.smartWallet)==null?void 0:n.address)||""}isApprovalRequired(){return!1}getApprovalStatus(){return!0}async connect(){this.setState({isLoading:!0,error:null});try{this.setState({isLoading:!1})}catch(n){throw this.setState({isLoading:!1,error:n instanceof Error?n.message:"Connection failed"}),n}}async disconnect(){}async switchChain(n){}async getBalance(n){return"0"}async approve(n,r){return""}async deposit(n,r){this.setState({isDepositing:!0,error:null});try{const o=`mpc_deposit_${Date.now()}`;return this.setState({isDepositing:!1,txHash:o}),o}catch(o){throw this.setState({isDepositing:!1,error:o instanceof Error?o.message:"Deposit failed"}),o}}async signMessage(n){return`mpc_signature_${Date.now()}`}getAAWalletAddress(){var n,r;return((n=this.smartWallet)==null?void 0:n.address)||((r=this.currentActiveAccount)==null?void 0:r.ethAddress)||""}}class Pa extends Uo{constructor(n,r,o,i="0",l="0"){super();Ie(this,"currentActiveAccount");Ie(this,"approved");Ie(this,"chainId");Ie(this,"balance");Ie(this,"allowance");this.currentActiveAccount=n,this.approved=r,this.chainId=o,this.balance=i,this.allowance=l}getWalletType(){return"evm"}getDisplayAddress(){var n;return((n=this.currentActiveAccount)==null?void 0:n.ethAddress)||""}isApprovalRequired(){return!0}getApprovalStatus(){return this.approved}async connect(){this.setState({isLoading:!0,error:null});try{this.setState({isLoading:!1})}catch(n){throw this.setState({isLoading:!1,error:n instanceof Error?n.message:"Connection failed"}),n}}async disconnect(){}async switchChain(n){this.setState({isLoading:!0,error:null});try{this.chainId=n,this.setState({isLoading:!1})}catch(r){throw this.setState({isLoading:!1,error:r instanceof Error?r.message:"Chain switch failed"}),r}}async getBalance(n){return this.balance}async approve(n,r){this.setState({isApproving:!0,error:null});try{const o=`evm_approve_${Date.now()}`;return this.approved=!0,this.setState({isApproving:!1,txHash:o}),o}catch(o){throw this.setState({isApproving:!1,error:o instanceof Error?o.message:"Approval failed"}),o}}async deposit(n,r){this.setState({isDepositing:!0,error:null});try{if(!this.approved)throw new Error("Token approval required");const o=`evm_deposit_${Date.now()}`;return this.setState({isDepositing:!1,txHash:o}),o}catch(o){throw this.setState({isDepositing:!1,error:o instanceof Error?o.message:"Deposit failed"}),o}}async signMessage(n){return`evm_signature_${Date.now()}`}updateApprovalStatus(n){this.approved=n}updateBalance(n){this.balance=n}updateAllowance(n){this.allowance=n}}function Vo(e,t,n,r,o,i){switch(e==null?void 0:e.wallet){case"mpc":return new Na(t,e);default:return new Pa(e,!1,r||1,o,i)}}const zo=typeof document<"u"?m.useLayoutEffect:()=>{};var nr;const La=(nr=m.useInsertionEffect)!==null&&nr!==void 0?nr:zo;function Aa(e){const t=m.useRef(null);return La(()=>{t.current=e},[e]),m.useCallback((...n)=>{const r=t.current;return r==null?void 0:r(...n)},[])}const gt=e=>{var t;return(t=e==null?void 0:e.ownerDocument)!==null&&t!==void 0?t:document},St=e=>e&&"window"in e&&e.window===e?e:gt(e).defaultView||window;function $a(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&typeof e.nodeType=="number"}function Da(e){return $a(e)&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&"host"in e}let Ma=!1;function rr(){return Ma}function Ho(e,t){if(!rr())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:Da(n)?n=n.host:n=n.parentNode}return!1}const or=(e=document)=>{var t;if(!rr())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 rr()&&e.target.shadowRoot&&e.composedPath?e.composedPath()[0]:e.target}function dn(e){var t;if(typeof window>"u"||window.navigator==null)return!1;let n=(t=window.navigator.userAgentData)===null||t===void 0?void 0:t.brands;return Array.isArray(n)&&n.some(r=>e.test(r.brand))||e.test(window.navigator.userAgent)}function ir(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 lt(e){if(process.env.NODE_ENV==="test")return e;let t=null;return()=>(t==null&&(t=e()),t)}const sr=lt(function(){return ir(/^Mac/i)}),Ia=lt(function(){return ir(/^iPhone/i)}),ja=lt(function(){return ir(/^iPad/i)||sr()&&navigator.maxTouchPoints>1}),Fa=lt(function(){return Ia()||ja()});lt(function(){return sr()||Fa()}),lt(function(){return dn(/AppleWebKit/i)&&!Ra()});const Ra=lt(function(){return dn(/Chrome/i)}),ka=lt(function(){return dn(/Android/i)});lt(function(){return dn(/Firefox/i)});function Yo(){let e=m.useRef(new Map),t=m.useCallback((o,i,l,u)=>{let s=u!=null&&u.once?(...a)=>{e.current.delete(l),l(...a)}:l;e.current.set(l,{type:i,eventTarget:o,fn:s,options:u}),o.addEventListener(i,s,u)},[]),n=m.useCallback((o,i,l,u)=>{var s;let a=((s=e.current.get(l))===null||s===void 0?void 0:s.fn)||l;o.removeEventListener(i,a,u),e.current.delete(l)},[]),r=m.useCallback(()=>{e.current.forEach((o,i)=>{n(o.eventTarget,o.type,i,o.options)})},[n]);return m.useEffect(()=>r,[r]),{addGlobalListener:t,removeGlobalListener:n,removeAllGlobalListeners:r}}function _a(e){return e.mozInputSource===0&&e.isTrusted?!0:ka()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function Ko(e){let t=e;return t.nativeEvent=e,t.isDefaultPrevented=()=>t.defaultPrevented,t.isPropagationStopped=()=>t.cancelBubble,t.persist=()=>{},t}function Wa(e,t){Object.defineProperty(e,"target",{value:t}),Object.defineProperty(e,"currentTarget",{value:t})}function qo(e){let t=m.useRef({isFocused:!1,observer:null});zo(()=>{const r=t.current;return()=>{r.observer&&(r.observer.disconnect(),r.observer=null)}},[]);let n=Aa(r=>{e==null||e(r)});return m.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=>{if(t.current.isFocused=!1,o.disabled){let u=Ko(l);n(u)}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 u=o===document.activeElement?null:document.activeElement;o.dispatchEvent(new FocusEvent("blur",{relatedTarget:u})),o.dispatchEvent(new FocusEvent("focusout",{bubbles:!0,relatedTarget:u}))}}),t.current.observer.observe(o,{attributes:!0,attributeFilter:["disabled"]})}},[n])}let Ba=!1,Gt=null,lr=new Set,Yt=new Map,Ct=!1,ar=!1;const Ua={Tab:!0,Escape:!0};function ur(e,t){for(let n of lr)n(e,t)}function Va(e){return!(e.metaKey||!sr()&&e.altKey||e.ctrlKey||e.key==="Control"||e.key==="Shift"||e.key==="Meta")}function pn(e){Ct=!0,Va(e)&&(Gt="keyboard",ur("keyboard",e))}function ke(e){Gt="pointer",(e.type==="mousedown"||e.type==="pointerdown")&&(Ct=!0,ur("pointer",e))}function Xo(e){_a(e)&&(Ct=!0,Gt="virtual")}function Qo(e){e.target===window||e.target===document||Ba||!e.isTrusted||(!Ct&&!ar&&(Gt="virtual",ur("virtual",e)),Ct=!1,ar=!1)}function Jo(){Ct=!1,ar=!0}function cr(e){if(typeof window>"u"||typeof document>"u"||Yt.get(St(e)))return;const t=St(e),n=gt(e);let r=t.HTMLElement.prototype.focus;t.HTMLElement.prototype.focus=function(){Ct=!0,r.apply(this,arguments)},n.addEventListener("keydown",pn,!0),n.addEventListener("keyup",pn,!0),n.addEventListener("click",Xo,!0),t.addEventListener("focus",Qo,!0),t.addEventListener("blur",Jo,!1),typeof PointerEvent<"u"?(n.addEventListener("pointerdown",ke,!0),n.addEventListener("pointermove",ke,!0),n.addEventListener("pointerup",ke,!0)):process.env.NODE_ENV==="test"&&(n.addEventListener("mousedown",ke,!0),n.addEventListener("mousemove",ke,!0),n.addEventListener("mouseup",ke,!0)),t.addEventListener("beforeunload",()=>{Zo(e)},{once:!0}),Yt.set(t,{focus:r})}const Zo=(e,t)=>{const n=St(e),r=gt(e);t&&r.removeEventListener("DOMContentLoaded",t),Yt.has(n)&&(n.HTMLElement.prototype.focus=Yt.get(n).focus,r.removeEventListener("keydown",pn,!0),r.removeEventListener("keyup",pn,!0),r.removeEventListener("click",Xo,!0),n.removeEventListener("focus",Qo,!0),n.removeEventListener("blur",Jo,!1),typeof PointerEvent<"u"?(r.removeEventListener("pointerdown",ke,!0),r.removeEventListener("pointermove",ke,!0),r.removeEventListener("pointerup",ke,!0)):process.env.NODE_ENV==="test"&&(r.removeEventListener("mousedown",ke,!0),r.removeEventListener("mousemove",ke,!0),r.removeEventListener("mouseup",ke,!0)),Yt.delete(n))};function za(e){const t=gt(e);let n;return t.readyState!=="loading"?cr(e):(n=()=>{cr(e)},t.addEventListener("DOMContentLoaded",n)),()=>Zo(e,n)}typeof document<"u"&&za();function ei(){return Gt!=="pointer"}const Ha=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function Ga(e,t,n){let r=gt(n==null?void 0:n.target);const o=typeof window<"u"?St(n==null?void 0:n.target).HTMLInputElement:HTMLInputElement,i=typeof window<"u"?St(n==null?void 0:n.target).HTMLTextAreaElement:HTMLTextAreaElement,l=typeof window<"u"?St(n==null?void 0:n.target).HTMLElement:HTMLElement,u=typeof window<"u"?St(n==null?void 0:n.target).KeyboardEvent:KeyboardEvent;return e=e||r.activeElement instanceof o&&!Ha.has(r.activeElement.type)||r.activeElement instanceof i||r.activeElement instanceof l&&r.activeElement.isContentEditable,!(e&&t==="keyboard"&&n instanceof u&&!Ua[n.key])}function Ya(e,t,n){cr(),m.useEffect(()=>{let r=(o,i)=>{Ga(!!(n!=null&&n.isTextInput),o,i)&&e(ei())};return lr.add(r),()=>{lr.delete(r)}},t)}function Ka(e){let{isDisabled:t,onFocus:n,onBlur:r,onFocusChange:o}=e;const i=m.useCallback(s=>{if(s.target===s.currentTarget)return r&&r(s),o&&o(!1),!0},[r,o]),l=qo(i),u=m.useCallback(s=>{const a=gt(s.target),c=a?or(a):or();s.target===s.currentTarget&&c===Go(s.nativeEvent)&&(n&&n(s),o&&o(!0),l(s))},[o,n,l]);return{focusProps:{onFocus:!t&&(n||o||r)?u:void 0,onBlur:!t&&(r||o)?i:void 0}}}function qa(e){let{isDisabled:t,onBlurWithin:n,onFocusWithin:r,onFocusWithinChange:o}=e,i=m.useRef({isFocusWithin:!1}),{addGlobalListener:l,removeAllGlobalListeners:u}=Yo(),s=m.useCallback(d=>{d.currentTarget.contains(d.target)&&i.current.isFocusWithin&&!d.currentTarget.contains(d.relatedTarget)&&(i.current.isFocusWithin=!1,u(),n&&n(d),o&&o(!1))},[n,o,i,u]),a=qo(s),c=m.useCallback(d=>{if(!d.currentTarget.contains(d.target))return;const p=gt(d.target),f=or(p);if(!i.current.isFocusWithin&&f===Go(d.nativeEvent)){r&&r(d),o&&o(!0),i.current.isFocusWithin=!0,a(d);let g=d.currentTarget;l(p,"focus",v=>{if(i.current.isFocusWithin&&!Ho(g,v.target)){let E=new p.defaultView.FocusEvent("blur",{relatedTarget:v.target});Wa(E,g);let M=Ko(E);s(M)}},{capture:!0})}},[r,o,a,l,s]);return t?{focusWithinProps:{onFocus:void 0,onBlur:void 0}}:{focusWithinProps:{onFocus:c,onBlur:s}}}let mn=!1,hn=0;function fr(){mn=!0,setTimeout(()=>{mn=!1},50)}function ti(e){e.pointerType==="touch"&&fr()}function Xa(){if(!(typeof document>"u"))return hn===0&&(typeof PointerEvent<"u"?document.addEventListener("pointerup",ti):process.env.NODE_ENV==="test"&&document.addEventListener("touchend",fr)),hn++,()=>{hn--,!(hn>0)&&(typeof PointerEvent<"u"?document.removeEventListener("pointerup",ti):process.env.NODE_ENV==="test"&&document.removeEventListener("touchend",fr))}}function Qa(e){let{onHoverStart:t,onHoverChange:n,onHoverEnd:r,isDisabled:o}=e,[i,l]=m.useState(!1),u=m.useRef({isHovered:!1,ignoreEmulatedMouseEvents:!1,pointerType:"",target:null}).current;m.useEffect(Xa,[]);let{addGlobalListener:s,removeAllGlobalListeners:a}=Yo(),{hoverProps:c,triggerHoverEnd:d}=m.useMemo(()=>{let p=(v,E)=>{if(u.pointerType=E,o||E==="touch"||u.isHovered||!v.currentTarget.contains(v.target))return;u.isHovered=!0;let M=v.currentTarget;u.target=M,s(gt(v.target),"pointerover",w=>{u.isHovered&&u.target&&!Ho(u.target,w.target)&&f(w,w.pointerType)},{capture:!0}),t&&t({type:"hoverstart",target:M,pointerType:E}),n&&n(!0),l(!0)},f=(v,E)=>{let M=u.target;u.pointerType="",u.target=null,!(E==="touch"||!u.isHovered||!M)&&(u.isHovered=!1,a(),r&&r({type:"hoverend",target:M,pointerType:E}),n&&n(!1),l(!1))},g={};return typeof PointerEvent<"u"?(g.onPointerEnter=v=>{mn&&v.pointerType==="mouse"||p(v,v.pointerType)},g.onPointerLeave=v=>{!o&&v.currentTarget.contains(v.target)&&f(v,v.pointerType)}):process.env.NODE_ENV==="test"&&(g.onTouchStart=()=>{u.ignoreEmulatedMouseEvents=!0},g.onMouseEnter=v=>{!u.ignoreEmulatedMouseEvents&&!mn&&p(v,"mouse"),u.ignoreEmulatedMouseEvents=!1},g.onMouseLeave=v=>{!o&&v.currentTarget.contains(v.target)&&f(v,"mouse")}),{hoverProps:g,triggerHoverEnd:f}},[t,n,r,o,u,s,a]);return m.useEffect(()=>{o&&d({currentTarget:u.target},u.pointerType)},[o]),{hoverProps:c,isHovered:i}}function Ja(e={}){let{autoFocus:t=!1,isTextInput:n,within:r}=e,o=m.useRef({isFocused:!1,isFocusVisible:t||ei()}),[i,l]=m.useState(!1),[u,s]=m.useState(()=>o.current.isFocused&&o.current.isFocusVisible),a=m.useCallback(()=>s(o.current.isFocused&&o.current.isFocusVisible),[]),c=m.useCallback(f=>{o.current.isFocused=f,l(f),a()},[a]);Ya(f=>{o.current.isFocusVisible=f,a()},[],{isTextInput:n});let{focusProps:d}=Ka({isDisabled:r,onFocusChange:c}),{focusWithinProps:p}=qa({isDisabled:!r,onFocusWithinChange:c});return{isFocused:i,isFocusVisible:u,focusProps:r?p:d}}var Za=Object.defineProperty,eu=(e,t,n)=>t in e?Za(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,dr=(e,t,n)=>(eu(e,typeof t!="symbol"?t+"":t,n),n);let tu=class{constructor(){dr(this,"current",this.detect()),dr(this,"handoffState","pending"),dr(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"}},Qe=new tu;function Kt(e){var t,n;return Qe.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 ni(e){typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e).catch(t=>setTimeout(()=>{throw t}))}function Ke(){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 ni(()=>{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=Ke();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 $t(){let[e]=m.useState(Ke);return m.useEffect(()=>()=>e.dispose(),[e]),e}let ue=(e,t)=>{Qe.isServer?m.useEffect(e,t):m.useLayoutEffect(e,t)};function Ot(e){let t=m.useRef(e);return ue(()=>{t.current=e},[e]),t}let ne=function(e){let t=Ot(e);return m.useCallback((...n)=>t.current(...n),[t])};function nu(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 ru(e,t){return!(!e||!t||e.right<t.left||e.left>t.right||e.bottom<t.top||e.top>t.bottom)}function ou({disabled:e=!1}={}){let t=m.useRef(null),[n,r]=m.useState(!1),o=$t(),i=ne(()=>{t.current=null,r(!1),o.dispose()}),l=ne(u=>{if(o.dispose(),t.current===null){t.current=u.currentTarget,r(!0);{let s=Kt(u.currentTarget);o.addEventListener(s,"pointerup",i,!1),o.addEventListener(s,"pointermove",a=>{if(t.current){let c=nu(a);r(ru(c,t.current.getBoundingClientRect()))}},!1),o.addEventListener(s,"pointercancel",i,!1)}}});return{pressed:n,pressProps:e?{}:{onPointerDown:l,onPointerUp:i,onClick:i}}}let iu=m.createContext(void 0);function pr(){return m.useContext(iu)}function mr(...e){return Array.from(new Set(e.flatMap(t=>typeof t=="string"?t.split(" "):[]))).filter(Boolean).join(" ")}function _e(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,_e),r}var gn=(e=>(e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static",e))(gn||{}),vt=(e=>(e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden",e))(vt||{});function Me(){let e=lu();return m.useCallback(t=>su({mergeRefs:e,...t}),[e])}function su({ourProps:e,theirProps:t,slot:n,defaultTag:r,features:o,visible:i=!0,name:l,mergeRefs:u}){u=u??au;let s=ri(t,e);if(i)return vn(s,n,r,l,u);let a=o??0;if(a&2){let{static:c=!1,...d}=s;if(c)return vn(d,n,r,l,u)}if(a&1){let{unmount:c=!0,...d}=s;return _e(c?0:1,{0(){return null},1(){return vn({...d,hidden:!0,style:{display:"none"}},n,r,l,u)}})}return vn(s,n,r,l,u)}function vn(e,t={},n,r,o){let{as:i=n,children:l,refName:u="ref",...s}=hr(e,["unmount","static"]),a=e.ref!==void 0?{[u]:e.ref}:{},c=typeof l=="function"?l(t):l;"className"in s&&s.className&&typeof s.className=="function"&&(s.className=s.className(t)),s["aria-labelledby"]&&s["aria-labelledby"]===s.id&&(s["aria-labelledby"]=void 0);let d={};if(t){let p=!1,f=[];for(let[g,v]of Object.entries(t))typeof v=="boolean"&&(p=!0),v===!0&&f.push(g.replace(/([A-Z])/g,E=>`-${E.toLowerCase()}`));if(p){d["data-headlessui-state"]=f.join(" ");for(let g of f)d[`data-${g}`]=""}}if(i===m.Fragment&&(Object.keys(bt(s)).length>0||Object.keys(bt(d)).length>0))if(!m.isValidElement(c)||Array.isArray(c)&&c.length>1){if(Object.keys(bt(s)).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(bt(s)).concat(Object.keys(bt(d))).map(p=>` - ${p}`).join(`
|
|
60
|
+
*/const Wo=Na("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);class Uo{constructor(){Ie(this,"state");this.state={isLoading:!1,isApproving:!1,isDepositing:!1,error:null,txHash:null}}getState(){return{...this.state}}setState(t){this.state={...this.state,...t}}}class La extends Uo{constructor(n,r){super();Ie(this,"smartWallet");Ie(this,"currentActiveAccount");this.smartWallet=n,this.currentActiveAccount=r}getWalletType(){return"mpc"}getDisplayAddress(){var n;return((n=this.smartWallet)==null?void 0:n.address)||""}isApprovalRequired(){return!1}getApprovalStatus(){return!0}async connect(){this.setState({isLoading:!0,error:null});try{this.setState({isLoading:!1})}catch(n){throw this.setState({isLoading:!1,error:n instanceof Error?n.message:"Connection failed"}),n}}async disconnect(){}async switchChain(n){}async getBalance(n){return"0"}async approve(n,r){return""}async deposit(n,r){this.setState({isDepositing:!0,error:null});try{const o=`mpc_deposit_${Date.now()}`;return this.setState({isDepositing:!1,txHash:o}),o}catch(o){throw this.setState({isDepositing:!1,error:o instanceof Error?o.message:"Deposit failed"}),o}}async signMessage(n){return`mpc_signature_${Date.now()}`}getAAWalletAddress(){var n,r;return((n=this.smartWallet)==null?void 0:n.address)||((r=this.currentActiveAccount)==null?void 0:r.ethAddress)||""}}class Pa extends Uo{constructor(n,r,o,i="0",l="0"){super();Ie(this,"currentActiveAccount");Ie(this,"approved");Ie(this,"chainId");Ie(this,"balance");Ie(this,"allowance");this.currentActiveAccount=n,this.approved=r,this.chainId=o,this.balance=i,this.allowance=l}getWalletType(){return"evm"}getDisplayAddress(){var n;return((n=this.currentActiveAccount)==null?void 0:n.ethAddress)||""}isApprovalRequired(){return!0}getApprovalStatus(){return this.approved}async connect(){this.setState({isLoading:!0,error:null});try{this.setState({isLoading:!1})}catch(n){throw this.setState({isLoading:!1,error:n instanceof Error?n.message:"Connection failed"}),n}}async disconnect(){}async switchChain(n){this.setState({isLoading:!0,error:null});try{this.chainId=n,this.setState({isLoading:!1})}catch(r){throw this.setState({isLoading:!1,error:r instanceof Error?r.message:"Chain switch failed"}),r}}async getBalance(n){return this.balance}async approve(n,r){this.setState({isApproving:!0,error:null});try{const o=`evm_approve_${Date.now()}`;return this.approved=!0,this.setState({isApproving:!1,txHash:o}),o}catch(o){throw this.setState({isApproving:!1,error:o instanceof Error?o.message:"Approval failed"}),o}}async deposit(n,r){this.setState({isDepositing:!0,error:null});try{if(!this.approved)throw new Error("Token approval required");const o=`evm_deposit_${Date.now()}`;return this.setState({isDepositing:!1,txHash:o}),o}catch(o){throw this.setState({isDepositing:!1,error:o instanceof Error?o.message:"Deposit failed"}),o}}async signMessage(n){return`evm_signature_${Date.now()}`}updateApprovalStatus(n){this.approved=n}updateBalance(n){this.balance=n}updateAllowance(n){this.allowance=n}}function Vo(e,t,n,r,o,i){switch(e==null?void 0:e.wallet){case"mpc":return new La(t,e);default:return new Pa(e,!1,r||1,o,i)}}const zo=typeof document<"u"?m.useLayoutEffect:()=>{};var rr;const Da=(rr=m.useInsertionEffect)!==null&&rr!==void 0?rr:zo;function $a(e){const t=m.useRef(null);return Da(()=>{t.current=e},[e]),m.useCallback((...n)=>{const r=t.current;return r==null?void 0:r(...n)},[])}const gt=e=>{var t;return(t=e==null?void 0:e.ownerDocument)!==null&&t!==void 0?t:document},St=e=>e&&"window"in e&&e.window===e?e:gt(e).defaultView||window;function Aa(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&typeof e.nodeType=="number"}function Ma(e){return Aa(e)&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&"host"in e}let Ia=!1;function or(){return Ia}function Ho(e,t){if(!or())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:Ma(n)?n=n.host:n=n.parentNode}return!1}const ir=(e=document)=>{var t;if(!or())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 or()&&e.target.shadowRoot&&e.composedPath?e.composedPath()[0]:e.target}function dn(e){var t;if(typeof window>"u"||window.navigator==null)return!1;let n=(t=window.navigator.userAgentData)===null||t===void 0?void 0:t.brands;return Array.isArray(n)&&n.some(r=>e.test(r.brand))||e.test(window.navigator.userAgent)}function sr(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 lt(e){if(process.env.NODE_ENV==="test")return e;let t=null;return()=>(t==null&&(t=e()),t)}const lr=lt(function(){return sr(/^Mac/i)}),ja=lt(function(){return sr(/^iPhone/i)}),Fa=lt(function(){return sr(/^iPad/i)||lr()&&navigator.maxTouchPoints>1}),Ra=lt(function(){return ja()||Fa()});lt(function(){return lr()||Ra()}),lt(function(){return dn(/AppleWebKit/i)&&!ka()});const ka=lt(function(){return dn(/Chrome/i)}),_a=lt(function(){return dn(/Android/i)});lt(function(){return dn(/Firefox/i)});function Yo(){let e=m.useRef(new Map),t=m.useCallback((o,i,l,u)=>{let s=u!=null&&u.once?(...a)=>{e.current.delete(l),l(...a)}:l;e.current.set(l,{type:i,eventTarget:o,fn:s,options:u}),o.addEventListener(i,s,u)},[]),n=m.useCallback((o,i,l,u)=>{var s;let a=((s=e.current.get(l))===null||s===void 0?void 0:s.fn)||l;o.removeEventListener(i,a,u),e.current.delete(l)},[]),r=m.useCallback(()=>{e.current.forEach((o,i)=>{n(o.eventTarget,o.type,i,o.options)})},[n]);return m.useEffect(()=>r,[r]),{addGlobalListener:t,removeGlobalListener:n,removeAllGlobalListeners:r}}function Ba(e){return e.mozInputSource===0&&e.isTrusted?!0:_a()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function Ko(e){let t=e;return t.nativeEvent=e,t.isDefaultPrevented=()=>t.defaultPrevented,t.isPropagationStopped=()=>t.cancelBubble,t.persist=()=>{},t}function Wa(e,t){Object.defineProperty(e,"target",{value:t}),Object.defineProperty(e,"currentTarget",{value:t})}function qo(e){let t=m.useRef({isFocused:!1,observer:null});zo(()=>{const r=t.current;return()=>{r.observer&&(r.observer.disconnect(),r.observer=null)}},[]);let n=$a(r=>{e==null||e(r)});return m.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=>{if(t.current.isFocused=!1,o.disabled){let u=Ko(l);n(u)}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 u=o===document.activeElement?null:document.activeElement;o.dispatchEvent(new FocusEvent("blur",{relatedTarget:u})),o.dispatchEvent(new FocusEvent("focusout",{bubbles:!0,relatedTarget:u}))}}),t.current.observer.observe(o,{attributes:!0,attributeFilter:["disabled"]})}},[n])}let Ua=!1,Gt=null,ar=new Set,Yt=new Map,Ct=!1,ur=!1;const Va={Tab:!0,Escape:!0};function cr(e,t){for(let n of ar)n(e,t)}function za(e){return!(e.metaKey||!lr()&&e.altKey||e.ctrlKey||e.key==="Control"||e.key==="Shift"||e.key==="Meta")}function pn(e){Ct=!0,za(e)&&(Gt="keyboard",cr("keyboard",e))}function ke(e){Gt="pointer",(e.type==="mousedown"||e.type==="pointerdown")&&(Ct=!0,cr("pointer",e))}function Xo(e){Ba(e)&&(Ct=!0,Gt="virtual")}function Qo(e){e.target===window||e.target===document||Ua||!e.isTrusted||(!Ct&&!ur&&(Gt="virtual",cr("virtual",e)),Ct=!1,ur=!1)}function Zo(){Ct=!1,ur=!0}function fr(e){if(typeof window>"u"||typeof document>"u"||Yt.get(St(e)))return;const t=St(e),n=gt(e);let r=t.HTMLElement.prototype.focus;t.HTMLElement.prototype.focus=function(){Ct=!0,r.apply(this,arguments)},n.addEventListener("keydown",pn,!0),n.addEventListener("keyup",pn,!0),n.addEventListener("click",Xo,!0),t.addEventListener("focus",Qo,!0),t.addEventListener("blur",Zo,!1),typeof PointerEvent<"u"?(n.addEventListener("pointerdown",ke,!0),n.addEventListener("pointermove",ke,!0),n.addEventListener("pointerup",ke,!0)):process.env.NODE_ENV==="test"&&(n.addEventListener("mousedown",ke,!0),n.addEventListener("mousemove",ke,!0),n.addEventListener("mouseup",ke,!0)),t.addEventListener("beforeunload",()=>{Jo(e)},{once:!0}),Yt.set(t,{focus:r})}const Jo=(e,t)=>{const n=St(e),r=gt(e);t&&r.removeEventListener("DOMContentLoaded",t),Yt.has(n)&&(n.HTMLElement.prototype.focus=Yt.get(n).focus,r.removeEventListener("keydown",pn,!0),r.removeEventListener("keyup",pn,!0),r.removeEventListener("click",Xo,!0),n.removeEventListener("focus",Qo,!0),n.removeEventListener("blur",Zo,!1),typeof PointerEvent<"u"?(r.removeEventListener("pointerdown",ke,!0),r.removeEventListener("pointermove",ke,!0),r.removeEventListener("pointerup",ke,!0)):process.env.NODE_ENV==="test"&&(r.removeEventListener("mousedown",ke,!0),r.removeEventListener("mousemove",ke,!0),r.removeEventListener("mouseup",ke,!0)),Yt.delete(n))};function Ha(e){const t=gt(e);let n;return t.readyState!=="loading"?fr(e):(n=()=>{fr(e)},t.addEventListener("DOMContentLoaded",n)),()=>Jo(e,n)}typeof document<"u"&&Ha();function ei(){return Gt!=="pointer"}const Ga=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function Ya(e,t,n){let r=gt(n==null?void 0:n.target);const o=typeof window<"u"?St(n==null?void 0:n.target).HTMLInputElement:HTMLInputElement,i=typeof window<"u"?St(n==null?void 0:n.target).HTMLTextAreaElement:HTMLTextAreaElement,l=typeof window<"u"?St(n==null?void 0:n.target).HTMLElement:HTMLElement,u=typeof window<"u"?St(n==null?void 0:n.target).KeyboardEvent:KeyboardEvent;return e=e||r.activeElement instanceof o&&!Ga.has(r.activeElement.type)||r.activeElement instanceof i||r.activeElement instanceof l&&r.activeElement.isContentEditable,!(e&&t==="keyboard"&&n instanceof u&&!Va[n.key])}function Ka(e,t,n){fr(),m.useEffect(()=>{let r=(o,i)=>{Ya(!!(n!=null&&n.isTextInput),o,i)&&e(ei())};return ar.add(r),()=>{ar.delete(r)}},t)}function qa(e){let{isDisabled:t,onFocus:n,onBlur:r,onFocusChange:o}=e;const i=m.useCallback(s=>{if(s.target===s.currentTarget)return r&&r(s),o&&o(!1),!0},[r,o]),l=qo(i),u=m.useCallback(s=>{const a=gt(s.target),c=a?ir(a):ir();s.target===s.currentTarget&&c===Go(s.nativeEvent)&&(n&&n(s),o&&o(!0),l(s))},[o,n,l]);return{focusProps:{onFocus:!t&&(n||o||r)?u:void 0,onBlur:!t&&(r||o)?i:void 0}}}function Xa(e){let{isDisabled:t,onBlurWithin:n,onFocusWithin:r,onFocusWithinChange:o}=e,i=m.useRef({isFocusWithin:!1}),{addGlobalListener:l,removeAllGlobalListeners:u}=Yo(),s=m.useCallback(d=>{d.currentTarget.contains(d.target)&&i.current.isFocusWithin&&!d.currentTarget.contains(d.relatedTarget)&&(i.current.isFocusWithin=!1,u(),n&&n(d),o&&o(!1))},[n,o,i,u]),a=qo(s),c=m.useCallback(d=>{if(!d.currentTarget.contains(d.target))return;const p=gt(d.target),f=ir(p);if(!i.current.isFocusWithin&&f===Go(d.nativeEvent)){r&&r(d),o&&o(!0),i.current.isFocusWithin=!0,a(d);let g=d.currentTarget;l(p,"focus",v=>{if(i.current.isFocusWithin&&!Ho(g,v.target)){let E=new p.defaultView.FocusEvent("blur",{relatedTarget:v.target});Wa(E,g);let M=Ko(E);s(M)}},{capture:!0})}},[r,o,a,l,s]);return t?{focusWithinProps:{onFocus:void 0,onBlur:void 0}}:{focusWithinProps:{onFocus:c,onBlur:s}}}let mn=!1,hn=0;function dr(){mn=!0,setTimeout(()=>{mn=!1},50)}function ti(e){e.pointerType==="touch"&&dr()}function Qa(){if(!(typeof document>"u"))return hn===0&&(typeof PointerEvent<"u"?document.addEventListener("pointerup",ti):process.env.NODE_ENV==="test"&&document.addEventListener("touchend",dr)),hn++,()=>{hn--,!(hn>0)&&(typeof PointerEvent<"u"?document.removeEventListener("pointerup",ti):process.env.NODE_ENV==="test"&&document.removeEventListener("touchend",dr))}}function Za(e){let{onHoverStart:t,onHoverChange:n,onHoverEnd:r,isDisabled:o}=e,[i,l]=m.useState(!1),u=m.useRef({isHovered:!1,ignoreEmulatedMouseEvents:!1,pointerType:"",target:null}).current;m.useEffect(Qa,[]);let{addGlobalListener:s,removeAllGlobalListeners:a}=Yo(),{hoverProps:c,triggerHoverEnd:d}=m.useMemo(()=>{let p=(v,E)=>{if(u.pointerType=E,o||E==="touch"||u.isHovered||!v.currentTarget.contains(v.target))return;u.isHovered=!0;let M=v.currentTarget;u.target=M,s(gt(v.target),"pointerover",w=>{u.isHovered&&u.target&&!Ho(u.target,w.target)&&f(w,w.pointerType)},{capture:!0}),t&&t({type:"hoverstart",target:M,pointerType:E}),n&&n(!0),l(!0)},f=(v,E)=>{let M=u.target;u.pointerType="",u.target=null,!(E==="touch"||!u.isHovered||!M)&&(u.isHovered=!1,a(),r&&r({type:"hoverend",target:M,pointerType:E}),n&&n(!1),l(!1))},g={};return typeof PointerEvent<"u"?(g.onPointerEnter=v=>{mn&&v.pointerType==="mouse"||p(v,v.pointerType)},g.onPointerLeave=v=>{!o&&v.currentTarget.contains(v.target)&&f(v,v.pointerType)}):process.env.NODE_ENV==="test"&&(g.onTouchStart=()=>{u.ignoreEmulatedMouseEvents=!0},g.onMouseEnter=v=>{!u.ignoreEmulatedMouseEvents&&!mn&&p(v,"mouse"),u.ignoreEmulatedMouseEvents=!1},g.onMouseLeave=v=>{!o&&v.currentTarget.contains(v.target)&&f(v,"mouse")}),{hoverProps:g,triggerHoverEnd:f}},[t,n,r,o,u,s,a]);return m.useEffect(()=>{o&&d({currentTarget:u.target},u.pointerType)},[o]),{hoverProps:c,isHovered:i}}function Ja(e={}){let{autoFocus:t=!1,isTextInput:n,within:r}=e,o=m.useRef({isFocused:!1,isFocusVisible:t||ei()}),[i,l]=m.useState(!1),[u,s]=m.useState(()=>o.current.isFocused&&o.current.isFocusVisible),a=m.useCallback(()=>s(o.current.isFocused&&o.current.isFocusVisible),[]),c=m.useCallback(f=>{o.current.isFocused=f,l(f),a()},[a]);Ka(f=>{o.current.isFocusVisible=f,a()},[],{isTextInput:n});let{focusProps:d}=qa({isDisabled:r,onFocusChange:c}),{focusWithinProps:p}=Xa({isDisabled:!r,onFocusWithinChange:c});return{isFocused:i,isFocusVisible:u,focusProps:r?p:d}}var eu=Object.defineProperty,tu=(e,t,n)=>t in e?eu(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,pr=(e,t,n)=>(tu(e,typeof t!="symbol"?t+"":t,n),n);let nu=class{constructor(){pr(this,"current",this.detect()),pr(this,"handoffState","pending"),pr(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"}},Qe=new nu;function Kt(e){var t,n;return Qe.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 ni(e){typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e).catch(t=>setTimeout(()=>{throw t}))}function Ke(){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 ni(()=>{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=Ke();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 $t(){let[e]=m.useState(Ke);return m.useEffect(()=>()=>e.dispose(),[e]),e}let ue=(e,t)=>{Qe.isServer?m.useEffect(e,t):m.useLayoutEffect(e,t)};function Ot(e){let t=m.useRef(e);return ue(()=>{t.current=e},[e]),t}let ne=function(e){let t=Ot(e);return m.useCallback((...n)=>t.current(...n),[t])};function ru(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 ou(e,t){return!(!e||!t||e.right<t.left||e.left>t.right||e.bottom<t.top||e.top>t.bottom)}function iu({disabled:e=!1}={}){let t=m.useRef(null),[n,r]=m.useState(!1),o=$t(),i=ne(()=>{t.current=null,r(!1),o.dispose()}),l=ne(u=>{if(o.dispose(),t.current===null){t.current=u.currentTarget,r(!0);{let s=Kt(u.currentTarget);o.addEventListener(s,"pointerup",i,!1),o.addEventListener(s,"pointermove",a=>{if(t.current){let c=ru(a);r(ou(c,t.current.getBoundingClientRect()))}},!1),o.addEventListener(s,"pointercancel",i,!1)}}});return{pressed:n,pressProps:e?{}:{onPointerDown:l,onPointerUp:i,onClick:i}}}let su=m.createContext(void 0);function mr(){return m.useContext(su)}function hr(...e){return Array.from(new Set(e.flatMap(t=>typeof t=="string"?t.split(" "):[]))).filter(Boolean).join(" ")}function _e(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,_e),r}var gn=(e=>(e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static",e))(gn||{}),vt=(e=>(e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden",e))(vt||{});function Me(){let e=au();return m.useCallback(t=>lu({mergeRefs:e,...t}),[e])}function lu({ourProps:e,theirProps:t,slot:n,defaultTag:r,features:o,visible:i=!0,name:l,mergeRefs:u}){u=u??uu;let s=ri(t,e);if(i)return vn(s,n,r,l,u);let a=o??0;if(a&2){let{static:c=!1,...d}=s;if(c)return vn(d,n,r,l,u)}if(a&1){let{unmount:c=!0,...d}=s;return _e(c?0:1,{0(){return null},1(){return vn({...d,hidden:!0,style:{display:"none"}},n,r,l,u)}})}return vn(s,n,r,l,u)}function vn(e,t={},n,r,o){let{as:i=n,children:l,refName:u="ref",...s}=gr(e,["unmount","static"]),a=e.ref!==void 0?{[u]:e.ref}:{},c=typeof l=="function"?l(t):l;"className"in s&&s.className&&typeof s.className=="function"&&(s.className=s.className(t)),s["aria-labelledby"]&&s["aria-labelledby"]===s.id&&(s["aria-labelledby"]=void 0);let d={};if(t){let p=!1,f=[];for(let[g,v]of Object.entries(t))typeof v=="boolean"&&(p=!0),v===!0&&f.push(g.replace(/([A-Z])/g,E=>`-${E.toLowerCase()}`));if(p){d["data-headlessui-state"]=f.join(" ");for(let g of f)d[`data-${g}`]=""}}if(i===m.Fragment&&(Object.keys(bt(s)).length>0||Object.keys(bt(d)).length>0))if(!m.isValidElement(c)||Array.isArray(c)&&c.length>1){if(Object.keys(bt(s)).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(bt(s)).concat(Object.keys(bt(d))).map(p=>` - ${p}`).join(`
|
|
61
61
|
`),"","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(p=>` - ${p}`).join(`
|
|
62
62
|
`)].join(`
|
|
63
|
-
`))}else{let p=c.props,f=p==null?void 0:p.className,g=typeof f=="function"?(...M)=>mr(f(...M),s.className):mr(f,s.className),v=g?{className:g}:{},E=ri(c.props,bt(hr(s,["ref"])));for(let M in d)M in E&&delete d[M];return m.cloneElement(c,Object.assign({},E,d,a,{ref:o(uu(c),a.ref)},v))}return m.createElement(i,Object.assign({},hr(s,["ref"]),i!==m.Fragment&&a,i!==m.Fragment&&d),c)}function lu(){let e=m.useRef([]),t=m.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 au(...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 ri(...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 u of l){if((o instanceof Event||(o==null?void 0:o.nativeEvent)instanceof Event)&&o.defaultPrevented)return;u(o,...i)}}});return t}function oi(...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 Te(e){var t;return Object.assign(m.forwardRef(e),{displayName:(t=e.displayName)!=null?t:e.name})}function bt(e){let t=Object.assign({},e);for(let n in t)t[n]===void 0&&delete t[n];return t}function hr(e,t=[]){let n=Object.assign({},e);for(let r of t)r in n&&delete n[r];return n}function uu(e){return m.version.split(".")[0]>="19"?e.props.ref:e.ref}function cu(e,t,n){let[r,o]=m.useState(n),i=e!==void 0,l=m.useRef(i),u=m.useRef(!1),s=m.useRef(!1);return i&&!l.current&&!u.current?(u.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&&!s.current&&(s.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(a=>(i||o(a),t==null?void 0:t(a)))]}function fu(e){let[t]=m.useState(e);return t}function ii(e={},t=null,n=[]){for(let[r,o]of Object.entries(e))li(n,si(t,r),o);return n}function si(e,t){return e?e+"["+t+"]":t}function li(e,t,n){if(Array.isArray(n))for(let[r,o]of n.entries())li(e,si(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,""]):ii(n,t,e)}function du(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 pu="span";var gr=(e=>(e[e.None=1]="None",e[e.Focusable=2]="Focusable",e[e.Hidden=4]="Hidden",e))(gr||{});function mu(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 Me()({ourProps:i,theirProps:o,slot:{},defaultTag:pu,name:"Hidden"})}let ai=Te(mu),hu=m.createContext(null);function gu({children:e}){let t=m.useContext(hu);if(!t)return m.createElement(m.Fragment,null,e);let{target:n}=t;return n?we.createPortal(m.createElement(m.Fragment,null,e),n):null}function vu({data:e,form:t,disabled:n,onReset:r,overrides:o}){let[i,l]=m.useState(null),u=$t();return m.useEffect(()=>{if(r&&i)return u.addEventListener(i,"reset",r)},[i,t,r]),m.createElement(gu,null,m.createElement(bu,{setForm:l,formId:t}),ii(e).map(([s,a])=>m.createElement(ai,{features:gr.Hidden,...bt({key:s,as:"input",type:"hidden",hidden:!0,readOnly:!0,form:t,disabled:n,name:s,value:a,...o})})))}function bu({setForm:e,formId:t}){return m.useEffect(()=>{if(t){let n=document.getElementById(t);n&&e(n)}},[e,t]),t?null:m.createElement(ai,{features:gr.Hidden,as:"input",type:"hidden",hidden:!0,readOnly:!0,ref:n=>{if(!n)return;let r=n.closest("form");r&&e(r)}})}let xu=m.createContext(void 0);function ui(){return m.useContext(xu)}function vr(e){return typeof e!="object"||e===null?!1:"nodeType"in e}function bn(e){return vr(e)&&"tagName"in e}function at(e){return bn(e)&&"accessKey"in e}function Dt(e){return bn(e)&&"tabIndex"in e}function yu(e){return bn(e)&&"style"in e}function wu(e){return at(e)&&e.nodeName==="IFRAME"}function ci(e){return at(e)&&e.nodeName==="INPUT"}function fi(e){return at(e)&&e.nodeName==="LABEL"}function Eu(e){return at(e)&&e.nodeName==="FIELDSET"}function di(e){return at(e)&&e.nodeName==="LEGEND"}function Su(e){return bn(e)?e.matches('a[href],audio[controls],button,details,embed,iframe,img[usemap],input:not([type="hidden"]),label,select,textarea,video[controls]'):!1}function Cu(e){let t=e.parentElement,n=null;for(;t&&!Eu(t);)di(t)&&(n=t),t=t.parentElement;let r=(t==null?void 0:t.getAttribute("disabled"))==="";return r&&Ou(n)?!1:r}function Ou(e){if(!e)return!1;let t=e.previousElementSibling;for(;t!==null;){if(di(t))return!1;t=t.previousElementSibling}return!0}let pi=Symbol();function Tu(e,t=!0){return Object.assign(e,{[pi]:t})}function We(...e){let t=m.useRef(e);m.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[pi]))?void 0:n}let br=m.createContext(null);br.displayName="DescriptionContext";function mi(){let e=m.useContext(br);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,mi),t}return e}function Nu(){var e,t;return(t=(e=m.useContext(br))==null?void 0:e.value)!=null?t:void 0}let Pu="p";function Lu(e,t){let n=m.useId(),r=pr(),{id:o=`headlessui-description-${n}`,...i}=e,l=mi(),u=We(t);ue(()=>l.register(o),[o,l.register]);let s=r||!1,a=m.useMemo(()=>({...l.slot,disabled:s}),[l.slot,s]),c={ref:u,...l.props,id:o};return Me()({ourProps:c,theirProps:i,slot:a,defaultTag:Pu,name:l.name||"Description"})}let Au=Te(Lu);Object.assign(Au,{});var ve=(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))(ve||{});let xn=m.createContext(null);xn.displayName="LabelContext";function hi(){let e=m.useContext(xn);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,hi),t}return e}function gi(e){var t,n,r;let o=(n=(t=m.useContext(xn))==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 $u({inherit:e=!1}={}){let t=gi(),[n,r]=m.useState([]),o=e?[t,...n].filter(Boolean):n;return[o.length>0?o.join(" "):void 0,m.useMemo(()=>function(i){let l=ne(s=>(r(a=>[...a,s]),()=>r(a=>{let c=a.slice(),d=c.indexOf(s);return d!==-1&&c.splice(d,1),c}))),u=m.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 m.createElement(xn.Provider,{value:u},i.children)},[r])]}let Du="label";function Mu(e,t){var n;let r=m.useId(),o=hi(),i=ui(),l=pr(),{id:u=`headlessui-label-${r}`,htmlFor:s=i??((n=o.props)==null?void 0:n.htmlFor),passive:a=!1,...c}=e,d=We(t);ue(()=>o.register(u),[u,o.register]);let p=ne(E=>{let M=E.currentTarget;if(!(E.target!==E.currentTarget&&Su(E.target))&&(fi(M)&&E.preventDefault(),o.props&&"onClick"in o.props&&typeof o.props.onClick=="function"&&o.props.onClick(E),fi(M))){let w=document.getElementById(M.htmlFor);if(w){let N=w.getAttribute("disabled");if(N==="true"||N==="")return;let j=w.getAttribute("aria-disabled");if(j==="true"||j==="")return;(ci(w)&&(w.type==="file"||w.type==="radio"||w.type==="checkbox")||w.role==="radio"||w.role==="checkbox"||w.role==="switch")&&w.click(),w.focus({preventScroll:!0})}}}),f=l||!1,g=m.useMemo(()=>({...o.slot,disabled:f}),[o.slot,f]),v={ref:d,...o.props,id:u,htmlFor:s,onClick:p};return a&&("onClick"in v&&(delete v.htmlFor,delete v.onClick),"onClick"in c&&delete c.onClick),Me()({ourProps:v,theirProps:c,slot:g,defaultTag:s?Du:"div",name:o.name||"Label"})}let Iu=Te(Mu),ju=Object.assign(Iu,{});function Fu(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 Ru(e=Fu){return m.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 ku(e){if(e===null)return{width:0,height:0};let{width:t,height:n}=e.getBoundingClientRect();return{width:t,height:n}}function _u(e,t=!1){let[n,r]=m.useReducer(()=>({}),{}),o=m.useMemo(()=>ku(e),[e,n]);return ue(()=>{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 vi=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}};var Wu=Object.defineProperty,Bu=(e,t,n)=>t in e?Wu(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Uu=(e,t,n)=>(Bu(e,t+"",n),n),bi=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)},Be=(e,t,n)=>(bi(e,t,"read from private field"),n?n.call(e):t.get(e)),xr=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},xi=(e,t,n,r)=>(bi(e,t,"write to private field"),t.set(e,n),n),Je,qt,Xt;let yi=class{constructor(t){xr(this,Je,{}),xr(this,qt,new vi(()=>new Set)),xr(this,Xt,new Set),Uu(this,"disposables",Ke()),xi(this,Je,t),Qe.isServer&&this.disposables.microTask(()=>{this.dispose()})}dispose(){this.disposables.dispose()}get state(){return Be(this,Je)}subscribe(t,n){if(Qe.isServer)return()=>{};let r={selector:t,callback:n,current:t(Be(this,Je))};return Be(this,Xt).add(r),this.disposables.add(()=>{Be(this,Xt).delete(r)})}on(t,n){return Qe.isServer?()=>{}:(Be(this,qt).get(t).add(n),this.disposables.add(()=>{Be(this,qt).get(t).delete(n)}))}send(t){let n=this.reduce(Be(this,Je),t);if(n!==Be(this,Je)){xi(this,Je,n);for(let r of Be(this,Xt)){let o=r.selector(Be(this,Je));wi(r.current,o)||(r.current=o,r.callback(o))}for(let r of Be(this,qt).get(t.type))r(Be(this,Je),t)}}};Je=new WeakMap,qt=new WeakMap,Xt=new WeakMap;function wi(e,t){return Object.is(e,t)?!0:typeof e!="object"||e===null||typeof t!="object"||t===null?!1:Array.isArray(e)&&Array.isArray(t)?e.length!==t.length?!1:yr(e[Symbol.iterator](),t[Symbol.iterator]()):e instanceof Map&&t instanceof Map||e instanceof Set&&t instanceof Set?e.size!==t.size?!1:yr(e.entries(),t.entries()):Ei(e)&&Ei(t)?yr(Object.entries(e)[Symbol.iterator](),Object.entries(t)[Symbol.iterator]()):!1}function yr(e,t){do{let n=e.next(),r=t.next();if(n.done&&r.done)return!0;if(n.done||r.done||!Object.is(n.value,r.value))return!1}while(!0)}function Ei(e){if(Object.prototype.toString.call(e)!=="[object Object]")return!1;let t=Object.getPrototypeOf(e);return t===null||Object.getPrototypeOf(t)===null}function wr(e){let[t,n]=e(),r=Ke();return(...o)=>{t(...o),r.dispose(),r.microTask(n)}}var Vu=Object.defineProperty,zu=(e,t,n)=>t in e?Vu(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Si=(e,t,n)=>(zu(e,typeof t!="symbol"?t+"":t,n),n),Ci=(e=>(e[e.Push=0]="Push",e[e.Pop=1]="Pop",e))(Ci||{});let Hu={0(e,t){let n=t.id,r=e.stack,o=e.stack.indexOf(n);if(o!==-1){let i=e.stack.slice();return i.splice(o,1),i.push(n),r=i,{...e,stack:r}}return{...e,stack:[...e.stack,n]}},1(e,t){let n=t.id,r=e.stack.indexOf(n);if(r===-1)return e;let o=e.stack.slice();return o.splice(r,1),{...e,stack:o}}},Gu=class oa extends yi{constructor(){super(...arguments),Si(this,"actions",{push:t=>this.send({type:0,id:t}),pop:t=>this.send({type:1,id:t})}),Si(this,"selectors",{isTop:(t,n)=>t.stack[t.stack.length-1]===n,inStack:(t,n)=>t.stack.includes(n)})}static new(){return new oa({stack:[]})}reduce(t,n){return _e(n.type,Hu,t,n)}};const Er=new vi(()=>Gu.new());var Sr={exports:{}},Cr={};/**
|
|
63
|
+
`))}else{let p=c.props,f=p==null?void 0:p.className,g=typeof f=="function"?(...M)=>hr(f(...M),s.className):hr(f,s.className),v=g?{className:g}:{},E=ri(c.props,bt(gr(s,["ref"])));for(let M in d)M in E&&delete d[M];return m.cloneElement(c,Object.assign({},E,d,a,{ref:o(cu(c),a.ref)},v))}return m.createElement(i,Object.assign({},gr(s,["ref"]),i!==m.Fragment&&a,i!==m.Fragment&&d),c)}function au(){let e=m.useRef([]),t=m.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 uu(...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 ri(...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 u of l){if((o instanceof Event||(o==null?void 0:o.nativeEvent)instanceof Event)&&o.defaultPrevented)return;u(o,...i)}}});return t}function oi(...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 Ne(e){var t;return Object.assign(m.forwardRef(e),{displayName:(t=e.displayName)!=null?t:e.name})}function bt(e){let t=Object.assign({},e);for(let n in t)t[n]===void 0&&delete t[n];return t}function gr(e,t=[]){let n=Object.assign({},e);for(let r of t)r in n&&delete n[r];return n}function cu(e){return m.version.split(".")[0]>="19"?e.props.ref:e.ref}function fu(e,t,n){let[r,o]=m.useState(n),i=e!==void 0,l=m.useRef(i),u=m.useRef(!1),s=m.useRef(!1);return i&&!l.current&&!u.current?(u.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&&!s.current&&(s.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(a=>(i||o(a),t==null?void 0:t(a)))]}function du(e){let[t]=m.useState(e);return t}function ii(e={},t=null,n=[]){for(let[r,o]of Object.entries(e))li(n,si(t,r),o);return n}function si(e,t){return e?e+"["+t+"]":t}function li(e,t,n){if(Array.isArray(n))for(let[r,o]of n.entries())li(e,si(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,""]):ii(n,t,e)}function pu(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 mu="span";var vr=(e=>(e[e.None=1]="None",e[e.Focusable=2]="Focusable",e[e.Hidden=4]="Hidden",e))(vr||{});function hu(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 Me()({ourProps:i,theirProps:o,slot:{},defaultTag:mu,name:"Hidden"})}let ai=Ne(hu),gu=m.createContext(null);function vu({children:e}){let t=m.useContext(gu);if(!t)return m.createElement(m.Fragment,null,e);let{target:n}=t;return n?Se.createPortal(m.createElement(m.Fragment,null,e),n):null}function bu({data:e,form:t,disabled:n,onReset:r,overrides:o}){let[i,l]=m.useState(null),u=$t();return m.useEffect(()=>{if(r&&i)return u.addEventListener(i,"reset",r)},[i,t,r]),m.createElement(vu,null,m.createElement(yu,{setForm:l,formId:t}),ii(e).map(([s,a])=>m.createElement(ai,{features:vr.Hidden,...bt({key:s,as:"input",type:"hidden",hidden:!0,readOnly:!0,form:t,disabled:n,name:s,value:a,...o})})))}function yu({setForm:e,formId:t}){return m.useEffect(()=>{if(t){let n=document.getElementById(t);n&&e(n)}},[e,t]),t?null:m.createElement(ai,{features:vr.Hidden,as:"input",type:"hidden",hidden:!0,readOnly:!0,ref:n=>{if(!n)return;let r=n.closest("form");r&&e(r)}})}let xu=m.createContext(void 0);function ui(){return m.useContext(xu)}function br(e){return typeof e!="object"||e===null?!1:"nodeType"in e}function bn(e){return br(e)&&"tagName"in e}function at(e){return bn(e)&&"accessKey"in e}function At(e){return bn(e)&&"tabIndex"in e}function wu(e){return bn(e)&&"style"in e}function Eu(e){return at(e)&&e.nodeName==="IFRAME"}function ci(e){return at(e)&&e.nodeName==="INPUT"}function fi(e){return at(e)&&e.nodeName==="LABEL"}function Su(e){return at(e)&&e.nodeName==="FIELDSET"}function di(e){return at(e)&&e.nodeName==="LEGEND"}function Cu(e){return bn(e)?e.matches('a[href],audio[controls],button,details,embed,iframe,img[usemap],input:not([type="hidden"]),label,select,textarea,video[controls]'):!1}function Ou(e){let t=e.parentElement,n=null;for(;t&&!Su(t);)di(t)&&(n=t),t=t.parentElement;let r=(t==null?void 0:t.getAttribute("disabled"))==="";return r&&Tu(n)?!1:r}function Tu(e){if(!e)return!1;let t=e.previousElementSibling;for(;t!==null;){if(di(t))return!1;t=t.previousElementSibling}return!0}let pi=Symbol();function Nu(e,t=!0){return Object.assign(e,{[pi]:t})}function Be(...e){let t=m.useRef(e);m.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[pi]))?void 0:n}let yr=m.createContext(null);yr.displayName="DescriptionContext";function mi(){let e=m.useContext(yr);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,mi),t}return e}function Lu(){var e,t;return(t=(e=m.useContext(yr))==null?void 0:e.value)!=null?t:void 0}let Pu="p";function Du(e,t){let n=m.useId(),r=mr(),{id:o=`headlessui-description-${n}`,...i}=e,l=mi(),u=Be(t);ue(()=>l.register(o),[o,l.register]);let s=r||!1,a=m.useMemo(()=>({...l.slot,disabled:s}),[l.slot,s]),c={ref:u,...l.props,id:o};return Me()({ourProps:c,theirProps:i,slot:a,defaultTag:Pu,name:l.name||"Description"})}let $u=Ne(Du);Object.assign($u,{});var be=(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))(be||{});let yn=m.createContext(null);yn.displayName="LabelContext";function hi(){let e=m.useContext(yn);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,hi),t}return e}function gi(e){var t,n,r;let o=(n=(t=m.useContext(yn))==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 Au({inherit:e=!1}={}){let t=gi(),[n,r]=m.useState([]),o=e?[t,...n].filter(Boolean):n;return[o.length>0?o.join(" "):void 0,m.useMemo(()=>function(i){let l=ne(s=>(r(a=>[...a,s]),()=>r(a=>{let c=a.slice(),d=c.indexOf(s);return d!==-1&&c.splice(d,1),c}))),u=m.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 m.createElement(yn.Provider,{value:u},i.children)},[r])]}let Mu="label";function Iu(e,t){var n;let r=m.useId(),o=hi(),i=ui(),l=mr(),{id:u=`headlessui-label-${r}`,htmlFor:s=i??((n=o.props)==null?void 0:n.htmlFor),passive:a=!1,...c}=e,d=Be(t);ue(()=>o.register(u),[u,o.register]);let p=ne(E=>{let M=E.currentTarget;if(!(E.target!==E.currentTarget&&Cu(E.target))&&(fi(M)&&E.preventDefault(),o.props&&"onClick"in o.props&&typeof o.props.onClick=="function"&&o.props.onClick(E),fi(M))){let w=document.getElementById(M.htmlFor);if(w){let N=w.getAttribute("disabled");if(N==="true"||N==="")return;let F=w.getAttribute("aria-disabled");if(F==="true"||F==="")return;(ci(w)&&(w.type==="file"||w.type==="radio"||w.type==="checkbox")||w.role==="radio"||w.role==="checkbox"||w.role==="switch")&&w.click(),w.focus({preventScroll:!0})}}}),f=l||!1,g=m.useMemo(()=>({...o.slot,disabled:f}),[o.slot,f]),v={ref:d,...o.props,id:u,htmlFor:s,onClick:p};return a&&("onClick"in v&&(delete v.htmlFor,delete v.onClick),"onClick"in c&&delete c.onClick),Me()({ourProps:v,theirProps:c,slot:g,defaultTag:s?Mu:"div",name:o.name||"Label"})}let ju=Ne(Iu),Fu=Object.assign(ju,{});function Ru(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 ku(e=Ru){return m.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 _u(e){if(e===null)return{width:0,height:0};let{width:t,height:n}=e.getBoundingClientRect();return{width:t,height:n}}function Bu(e,t=!1){let[n,r]=m.useReducer(()=>({}),{}),o=m.useMemo(()=>_u(e),[e,n]);return ue(()=>{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 vi=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}};var Wu=Object.defineProperty,Uu=(e,t,n)=>t in e?Wu(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Vu=(e,t,n)=>(Uu(e,t+"",n),n),bi=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)},We=(e,t,n)=>(bi(e,t,"read from private field"),n?n.call(e):t.get(e)),xr=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},yi=(e,t,n,r)=>(bi(e,t,"write to private field"),t.set(e,n),n),Ze,qt,Xt;let xi=class{constructor(t){xr(this,Ze,{}),xr(this,qt,new vi(()=>new Set)),xr(this,Xt,new Set),Vu(this,"disposables",Ke()),yi(this,Ze,t),Qe.isServer&&this.disposables.microTask(()=>{this.dispose()})}dispose(){this.disposables.dispose()}get state(){return We(this,Ze)}subscribe(t,n){if(Qe.isServer)return()=>{};let r={selector:t,callback:n,current:t(We(this,Ze))};return We(this,Xt).add(r),this.disposables.add(()=>{We(this,Xt).delete(r)})}on(t,n){return Qe.isServer?()=>{}:(We(this,qt).get(t).add(n),this.disposables.add(()=>{We(this,qt).get(t).delete(n)}))}send(t){let n=this.reduce(We(this,Ze),t);if(n!==We(this,Ze)){yi(this,Ze,n);for(let r of We(this,Xt)){let o=r.selector(We(this,Ze));wi(r.current,o)||(r.current=o,r.callback(o))}for(let r of We(this,qt).get(t.type))r(We(this,Ze),t)}}};Ze=new WeakMap,qt=new WeakMap,Xt=new WeakMap;function wi(e,t){return Object.is(e,t)?!0:typeof e!="object"||e===null||typeof t!="object"||t===null?!1:Array.isArray(e)&&Array.isArray(t)?e.length!==t.length?!1:wr(e[Symbol.iterator](),t[Symbol.iterator]()):e instanceof Map&&t instanceof Map||e instanceof Set&&t instanceof Set?e.size!==t.size?!1:wr(e.entries(),t.entries()):Ei(e)&&Ei(t)?wr(Object.entries(e)[Symbol.iterator](),Object.entries(t)[Symbol.iterator]()):!1}function wr(e,t){do{let n=e.next(),r=t.next();if(n.done&&r.done)return!0;if(n.done||r.done||!Object.is(n.value,r.value))return!1}while(!0)}function Ei(e){if(Object.prototype.toString.call(e)!=="[object Object]")return!1;let t=Object.getPrototypeOf(e);return t===null||Object.getPrototypeOf(t)===null}function Er(e){let[t,n]=e(),r=Ke();return(...o)=>{t(...o),r.dispose(),r.microTask(n)}}var zu=Object.defineProperty,Hu=(e,t,n)=>t in e?zu(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Si=(e,t,n)=>(Hu(e,typeof t!="symbol"?t+"":t,n),n),Ci=(e=>(e[e.Push=0]="Push",e[e.Pop=1]="Pop",e))(Ci||{});let Gu={0(e,t){let n=t.id,r=e.stack,o=e.stack.indexOf(n);if(o!==-1){let i=e.stack.slice();return i.splice(o,1),i.push(n),r=i,{...e,stack:r}}return{...e,stack:[...e.stack,n]}},1(e,t){let n=t.id,r=e.stack.indexOf(n);if(r===-1)return e;let o=e.stack.slice();return o.splice(r,1),{...e,stack:o}}},Yu=class ia extends xi{constructor(){super(...arguments),Si(this,"actions",{push:t=>this.send({type:0,id:t}),pop:t=>this.send({type:1,id:t})}),Si(this,"selectors",{isTop:(t,n)=>t.stack[t.stack.length-1]===n,inStack:(t,n)=>t.stack.includes(n)})}static new(){return new ia({stack:[]})}reduce(t,n){return _e(n.type,Gu,t,n)}};const Sr=new vi(()=>Yu.new());var Cr={exports:{}},Or={};/**
|
|
64
64
|
* @license React
|
|
65
65
|
* use-sync-external-store-with-selector.production.js
|
|
66
66
|
*
|
|
@@ -68,7 +68,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
68
68
|
*
|
|
69
69
|
* This source code is licensed under the MIT license found in the
|
|
70
70
|
* LICENSE file in the root directory of this source tree.
|
|
71
|
-
*/var Oi;function
|
|
71
|
+
*/var Oi;function Ku(){if(Oi)return Or;Oi=1;var e=m;function t(s,a){return s===a&&(s!==0||1/s===1/a)||s!==s&&a!==a}var n=typeof Object.is=="function"?Object.is:t,r=e.useSyncExternalStore,o=e.useRef,i=e.useEffect,l=e.useMemo,u=e.useDebugValue;return Or.useSyncExternalStoreWithSelector=function(s,a,c,d,p){var f=o(null);if(f.current===null){var g={hasValue:!1,value:null};f.current=g}else g=f.current;f=l(function(){function E(j){if(!M){if(M=!0,w=j,j=d(j),p!==void 0&&g.hasValue){var k=g.value;if(p(k,j))return N=k}return N=j}if(k=N,n(w,j))return k;var B=d(j);return p!==void 0&&p(k,B)?(w=j,k):(w=j,N=B)}var M=!1,w,N,F=c===void 0?null:c;return[function(){return E(a())},F===null?void 0:function(){return E(F())}]},[a,c,d,p]);var v=r(s,f[0],f[1]);return i(function(){g.hasValue=!0,g.value=v},[v]),u(v),v},Or}var Tr={};/**
|
|
72
72
|
* @license React
|
|
73
73
|
* use-sync-external-store-with-selector.development.js
|
|
74
74
|
*
|
|
@@ -76,39 +76,39 @@ React keys must be passed directly to JSX without using spread:
|
|
|
76
76
|
*
|
|
77
77
|
* This source code is licensed under the MIT license found in the
|
|
78
78
|
* LICENSE file in the root directory of this source tree.
|
|
79
|
-
*/var Ti;function Ku(){return Ti||(Ti=1,process.env.NODE_ENV!=="production"&&function(){function e(s,a){return s===a&&(s!==0||1/s===1/a)||s!==s&&a!==a}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var t=m,n=typeof Object.is=="function"?Object.is:e,r=t.useSyncExternalStore,o=t.useRef,i=t.useEffect,l=t.useMemo,u=t.useDebugValue;Or.useSyncExternalStoreWithSelector=function(s,a,c,d,p){var f=o(null);if(f.current===null){var g={hasValue:!1,value:null};f.current=g}else g=f.current;f=l(function(){function E(F){if(!M){if(M=!0,w=F,F=d(F),p!==void 0&&g.hasValue){var k=g.value;if(p(k,F))return N=k}return N=F}if(k=N,n(w,F))return k;var W=d(F);return p!==void 0&&p(k,W)?(w=F,k):(w=F,N=W)}var M=!1,w,N,j=c===void 0?null:c;return[function(){return E(a())},j===null?void 0:function(){return E(j())}]},[a,c,d,p]);var v=r(s,f[0],f[1]);return i(function(){g.hasValue=!0,g.value=v},[v]),u(v),v},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),Or}process.env.NODE_ENV==="production"?Sr.exports=Yu():Sr.exports=Ku();var qu=Sr.exports;function Ue(e,t,n=wi){return qu.useSyncExternalStoreWithSelector(ne(r=>e.subscribe(Xu,r)),ne(()=>e.state),ne(()=>e.state),ne(t),n)}function Xu(e){return e}function Ni(e,t){let n=m.useId(),r=Er.get(t),[o,i]=Ue(r,m.useCallback(l=>[r.selectors.isTop(l,n),r.selectors.inStack(l,n)],[r,n]));return ue(()=>{if(e)return r.actions.push(n),()=>r.actions.pop(n)},[r,e,n]),e?i?o:!0:!1}let Tr=new Map,Qt=new Map;function Pi(e){var t;let n=(t=Qt.get(e))!=null?t:0;return Qt.set(e,n+1),n!==0?()=>Li(e):(Tr.set(e,{"aria-hidden":e.getAttribute("aria-hidden"),inert:e.inert}),e.setAttribute("aria-hidden","true"),e.inert=!0,()=>Li(e))}function Li(e){var t;let n=(t=Qt.get(e))!=null?t:1;if(n===1?Qt.delete(e):Qt.set(e,n-1),n!==1)return;let r=Tr.get(e);r&&(r["aria-hidden"]===null?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden",r["aria-hidden"]),e.inert=r.inert,Tr.delete(e))}function Qu(e,{allowed:t,disallowed:n}={}){let r=Ni(e,"inert-others");ue(()=>{var o,i;if(!r)return;let l=Ke();for(let s of(o=n==null?void 0:n())!=null?o:[])s&&l.add(Pi(s));let u=(i=t==null?void 0:t())!=null?i:[];for(let s of u){if(!s)continue;let a=Kt(s);if(!a)continue;let c=s.parentElement;for(;c&&c!==a.body;){for(let d of c.children)u.some(p=>d.contains(p))||l.add(Pi(d));c=c.parentElement}}return l.dispose},[r,t,n])}function Ju(e,t,n){let r=Ot(o=>{let i=o.getBoundingClientRect();i.x===0&&i.y===0&&i.width===0&&i.height===0&&n()});m.useEffect(()=>{if(!e)return;let o=t===null?null:at(t)?t:t.current;if(!o)return;let i=Ke();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 Nr=["[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(","),Zu=["[data-autofocus]"].map(e=>`${e}:not([tabindex='-1'])`).join(",");var Pr=(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))(Pr||{}),ec=(e=>(e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow",e))(ec||{}),tc=(e=>(e[e.Previous=-1]="Previous",e[e.Next=1]="Next",e))(tc||{});function Ai(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(Nr)).sort((t,n)=>Math.sign((t.tabIndex||Number.MAX_SAFE_INTEGER)-(n.tabIndex||Number.MAX_SAFE_INTEGER)))}function nc(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(Zu)).sort((t,n)=>Math.sign((t.tabIndex||Number.MAX_SAFE_INTEGER)-(n.tabIndex||Number.MAX_SAFE_INTEGER)))}var Lr=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))(Lr||{});function $i(e,t=0){var n;return e===((n=Kt(e))==null?void 0:n.body)?!1:_e(t,{0(){return e.matches(Nr)},1(){let r=e;for(;r!==null;){if(r.matches(Nr))return!0;r=r.parentElement}return!1}})}var rc=(e=>(e[e.Keyboard=0]="Keyboard",e[e.Mouse=1]="Mouse",e))(rc||{});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 oc=["textarea","input"].join(",");function ic(e){var t,n;return(n=(t=e==null?void 0:e.matches)==null?void 0:t.call(e,oc))!=null?n:!1}function Di(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 sc(e,t){return lc(Ai(),t,{relativeTo:e})}function lc(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?Di(e):e:t&64?nc(e):Ai(e);o.length>0&&l.length>1&&(l=l.filter(f=>!o.some(g=>g!=null&&"current"in g?(g==null?void 0:g.current)===f:g===f))),r=r??i.activeElement;let u=(()=>{if(t&5)return 1;if(t&10)return-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),s=(()=>{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")})(),a=t&32?{preventScroll:!0}:{},c=0,d=l.length,p;do{if(c>=d||c+d<=0)return 0;let f=s+c;if(t&16)f=(f+d)%d;else{if(f<0)return 3;if(f>=d)return 1}p=l[f],p==null||p.focus(a),c+=u}while(p!==i.activeElement);return t&6&&ic(p)&&p.select(),2}function Mi(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function ac(){return/Android/gi.test(window.navigator.userAgent)}function Ii(){return Mi()||ac()}function Mt(e,t,n,r){let o=Ot(n);m.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 uc(e,t,n,r){let o=Ot(n);m.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 ji=30;function cc(e,t,n){let r=Ot(n),o=m.useCallback(function(u,s){if(u.defaultPrevented)return;let a=s(u);if(a===null||!a.getRootNode().contains(a)||!a.isConnected)return;let c=function d(p){return typeof p=="function"?d(p()):Array.isArray(p)||p instanceof Set?p:[p]}(t);for(let d of c)if(d!==null&&(d.contains(a)||u.composed&&u.composedPath().includes(d)))return;return!$i(a,Lr.Loose)&&a.tabIndex!==-1&&u.preventDefault(),r.current(u,a)},[r,t]),i=m.useRef(null);Mt(e,"pointerdown",u=>{var s,a;Ii()||(i.current=((a=(s=u.composedPath)==null?void 0:s.call(u))==null?void 0:a[0])||u.target)},!0),Mt(e,"pointerup",u=>{if(Ii()||!i.current)return;let s=i.current;return i.current=null,o(u,()=>s)},!0);let l=m.useRef({x:0,y:0});Mt(e,"touchstart",u=>{l.current.x=u.touches[0].clientX,l.current.y=u.touches[0].clientY},!0),Mt(e,"touchend",u=>{let s={x:u.changedTouches[0].clientX,y:u.changedTouches[0].clientY};if(!(Math.abs(s.x-l.current.x)>=ji||Math.abs(s.y-l.current.y)>=ji))return o(u,()=>Dt(u.target)?u.target:null)},!0),uc(e,"blur",u=>o(u,()=>wu(window.document.activeElement)?window.document.activeElement:null),!0)}function Ar(...e){return m.useMemo(()=>Kt(...e),[...e])}var fc=(e=>(e[e.Ignore=0]="Ignore",e[e.Select=1]="Select",e[e.Close=2]="Close",e))(fc||{});const yn={Ignore:{kind:0},Select:e=>({kind:1,target:e}),Close:{kind:2}},dc=200,Fi=5;function pc(e,{trigger:t,action:n,close:r,select:o}){let i=m.useRef(null),l=m.useRef(null),u=m.useRef(null);Mt(e&&t!==null,"pointerdown",s=>{vr(s==null?void 0:s.target)&&t!=null&&t.contains(s.target)&&(l.current=s.x,u.current=s.y,i.current=s.timeStamp)}),Mt(e&&t!==null,"pointerup",s=>{var a,c;let d=i.current;if(d===null||(i.current=null,!Dt(s.target))||Math.abs(s.x-((a=l.current)!=null?a:s.x))<Fi&&Math.abs(s.y-((c=u.current)!=null?c:s.y))<Fi)return;let p=n(s);switch(p.kind){case 0:return;case 1:{s.timeStamp-d>dc&&(o(p.target),r());break}case 2:{r();break}}},{capture:!0})}function mc(e,t){return m.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 hc(e){return m.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot)}function gc(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(u=>u()))}}}function vc(){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 bc(){return Mi()?{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 u=Ke();u.style(e.documentElement,"scrollBehavior","auto"),t.add(()=>t.microTask(()=>u.dispose()))}let i=(o=window.scrollY)!=null?o:window.pageYOffset,l=null;t.addEventListener(e,"click",u=>{if(Dt(u.target))try{let s=u.target.closest("a");if(!s)return;let{hash:a}=new URL(s.href),c=e.querySelector(a);Dt(c)&&!r(c)&&(l=c)}catch{}},!0),t.addEventListener(e,"touchstart",u=>{if(Dt(u.target)&&yu(u.target))if(r(u.target)){let s=u.target;for(;s.parentElement&&r(s.parentElement);)s=s.parentElement;t.style(s,"overscrollBehavior","contain")}else t.style(u.target,"touchAction","none")}),t.addEventListener(e,"touchmove",u=>{if(Dt(u.target)){if(ci(u.target))return;if(r(u.target)){let s=u.target;for(;s.parentElement&&s.dataset.headlessuiPortal!==""&&!(s.scrollHeight>s.clientHeight||s.scrollWidth>s.clientWidth);)s=s.parentElement;s.dataset.headlessuiPortal===""&&u.preventDefault()}else u.preventDefault()}},{passive:!1}),t.add(()=>{var u;let s=(u=window.scrollY)!=null?u:window.pageYOffset;i!==s&&window.scrollTo(0,i),l&&l.isConnected&&(l.scrollIntoView({block:"nearest"}),l=null)})})}}:{}}function xc(){return{before({doc:e,d:t}){t.style(e.documentElement,"overflow","hidden")}}}function yc(e){let t={};for(let n of e)Object.assign(t,n(t));return t}let Tt=gc(()=>new Map,{PUSH(e,t){var n;let r=(n=this.get(e))!=null?n:{doc:e,count:0,d:Ke(),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:yc(n)},o=[bc(),vc(),xc()];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)}});Tt.subscribe(()=>{let e=Tt.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)&&Tt.dispatch(n.count>0?"SCROLL_PREVENT":"SCROLL_ALLOW",n),n.count===0&&Tt.dispatch("TEARDOWN",n)}});function wc(e,t,n=()=>({containers:[]})){let r=hc(Tt),o=t?r.get(t):void 0,i=o?o.count>0:!1;return ue(()=>{if(!(!t||!e))return Tt.dispatch("PUSH",t,n),()=>Tt.dispatch("POP",t,n)},[e,t]),i}function Ec(e,t,n=()=>[document.body]){let r=Ni(e,"scroll-lock");wc(r,t,o=>{var i;return{containers:[...(i=o.containers)!=null?i:[],n]}})}function Ri(e){return[e.screenX,e.screenY]}function Sc(){let e=m.useRef([-1,-1]);return{wasMoved(t){let n=Ri(t);return e.current[0]===n[0]&&e.current[1]===n[1]?!1:(e.current=n,!0)},update(t){e.current=Ri(t)}}}function Cc(e=0){let[t,n]=m.useState(e),r=m.useCallback(s=>n(s),[t]),o=m.useCallback(s=>n(a=>a|s),[t]),i=m.useCallback(s=>(t&s)===s,[t]),l=m.useCallback(s=>n(a=>a&~s),[n]),u=m.useCallback(s=>n(a=>a^s),[n]);return{flags:t,setFlag:r,addFlag:o,hasFlag:i,removeFlag:l,toggleFlag:u}}var ki,_i;typeof process<"u"&&typeof globalThis<"u"&&typeof Element<"u"&&((ki=process==null?void 0:process.env)==null?void 0:ki.NODE_ENV)==="test"&&typeof((_i=Element==null?void 0:Element.prototype)==null?void 0:_i.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(`
|
|
80
|
-
`)),[]});var
|
|
79
|
+
*/var Ti;function qu(){return Ti||(Ti=1,process.env.NODE_ENV!=="production"&&function(){function e(s,a){return s===a&&(s!==0||1/s===1/a)||s!==s&&a!==a}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var t=m,n=typeof Object.is=="function"?Object.is:e,r=t.useSyncExternalStore,o=t.useRef,i=t.useEffect,l=t.useMemo,u=t.useDebugValue;Tr.useSyncExternalStoreWithSelector=function(s,a,c,d,p){var f=o(null);if(f.current===null){var g={hasValue:!1,value:null};f.current=g}else g=f.current;f=l(function(){function E(j){if(!M){if(M=!0,w=j,j=d(j),p!==void 0&&g.hasValue){var k=g.value;if(p(k,j))return N=k}return N=j}if(k=N,n(w,j))return k;var B=d(j);return p!==void 0&&p(k,B)?(w=j,k):(w=j,N=B)}var M=!1,w,N,F=c===void 0?null:c;return[function(){return E(a())},F===null?void 0:function(){return E(F())}]},[a,c,d,p]);var v=r(s,f[0],f[1]);return i(function(){g.hasValue=!0,g.value=v},[v]),u(v),v},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),Tr}process.env.NODE_ENV==="production"?Cr.exports=Ku():Cr.exports=qu();var Xu=Cr.exports;function Ue(e,t,n=wi){return Xu.useSyncExternalStoreWithSelector(ne(r=>e.subscribe(Qu,r)),ne(()=>e.state),ne(()=>e.state),ne(t),n)}function Qu(e){return e}function Ni(e,t){let n=m.useId(),r=Sr.get(t),[o,i]=Ue(r,m.useCallback(l=>[r.selectors.isTop(l,n),r.selectors.inStack(l,n)],[r,n]));return ue(()=>{if(e)return r.actions.push(n),()=>r.actions.pop(n)},[r,e,n]),e?i?o:!0:!1}let Nr=new Map,Qt=new Map;function Li(e){var t;let n=(t=Qt.get(e))!=null?t:0;return Qt.set(e,n+1),n!==0?()=>Pi(e):(Nr.set(e,{"aria-hidden":e.getAttribute("aria-hidden"),inert:e.inert}),e.setAttribute("aria-hidden","true"),e.inert=!0,()=>Pi(e))}function Pi(e){var t;let n=(t=Qt.get(e))!=null?t:1;if(n===1?Qt.delete(e):Qt.set(e,n-1),n!==1)return;let r=Nr.get(e);r&&(r["aria-hidden"]===null?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden",r["aria-hidden"]),e.inert=r.inert,Nr.delete(e))}function Zu(e,{allowed:t,disallowed:n}={}){let r=Ni(e,"inert-others");ue(()=>{var o,i;if(!r)return;let l=Ke();for(let s of(o=n==null?void 0:n())!=null?o:[])s&&l.add(Li(s));let u=(i=t==null?void 0:t())!=null?i:[];for(let s of u){if(!s)continue;let a=Kt(s);if(!a)continue;let c=s.parentElement;for(;c&&c!==a.body;){for(let d of c.children)u.some(p=>d.contains(p))||l.add(Li(d));c=c.parentElement}}return l.dispose},[r,t,n])}function Ju(e,t,n){let r=Ot(o=>{let i=o.getBoundingClientRect();i.x===0&&i.y===0&&i.width===0&&i.height===0&&n()});m.useEffect(()=>{if(!e)return;let o=t===null?null:at(t)?t:t.current;if(!o)return;let i=Ke();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 Lr=["[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(","),ec=["[data-autofocus]"].map(e=>`${e}:not([tabindex='-1'])`).join(",");var Pr=(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))(Pr||{}),tc=(e=>(e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow",e))(tc||{}),nc=(e=>(e[e.Previous=-1]="Previous",e[e.Next=1]="Next",e))(nc||{});function Di(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(Lr)).sort((t,n)=>Math.sign((t.tabIndex||Number.MAX_SAFE_INTEGER)-(n.tabIndex||Number.MAX_SAFE_INTEGER)))}function rc(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(ec)).sort((t,n)=>Math.sign((t.tabIndex||Number.MAX_SAFE_INTEGER)-(n.tabIndex||Number.MAX_SAFE_INTEGER)))}var Dr=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))(Dr||{});function $i(e,t=0){var n;return e===((n=Kt(e))==null?void 0:n.body)?!1:_e(t,{0(){return e.matches(Lr)},1(){let r=e;for(;r!==null;){if(r.matches(Lr))return!0;r=r.parentElement}return!1}})}var oc=(e=>(e[e.Keyboard=0]="Keyboard",e[e.Mouse=1]="Mouse",e))(oc||{});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 ic=["textarea","input"].join(",");function sc(e){var t,n;return(n=(t=e==null?void 0:e.matches)==null?void 0:t.call(e,ic))!=null?n:!1}function Ai(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 lc(e,t){return ac(Di(),t,{relativeTo:e})}function ac(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?Ai(e):e:t&64?rc(e):Di(e);o.length>0&&l.length>1&&(l=l.filter(f=>!o.some(g=>g!=null&&"current"in g?(g==null?void 0:g.current)===f:g===f))),r=r??i.activeElement;let u=(()=>{if(t&5)return 1;if(t&10)return-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),s=(()=>{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")})(),a=t&32?{preventScroll:!0}:{},c=0,d=l.length,p;do{if(c>=d||c+d<=0)return 0;let f=s+c;if(t&16)f=(f+d)%d;else{if(f<0)return 3;if(f>=d)return 1}p=l[f],p==null||p.focus(a),c+=u}while(p!==i.activeElement);return t&6&&sc(p)&&p.select(),2}function Mi(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function uc(){return/Android/gi.test(window.navigator.userAgent)}function Ii(){return Mi()||uc()}function Mt(e,t,n,r){let o=Ot(n);m.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 cc(e,t,n,r){let o=Ot(n);m.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 ji=30;function fc(e,t,n){let r=Ot(n),o=m.useCallback(function(u,s){if(u.defaultPrevented)return;let a=s(u);if(a===null||!a.getRootNode().contains(a)||!a.isConnected)return;let c=function d(p){return typeof p=="function"?d(p()):Array.isArray(p)||p instanceof Set?p:[p]}(t);for(let d of c)if(d!==null&&(d.contains(a)||u.composed&&u.composedPath().includes(d)))return;return!$i(a,Dr.Loose)&&a.tabIndex!==-1&&u.preventDefault(),r.current(u,a)},[r,t]),i=m.useRef(null);Mt(e,"pointerdown",u=>{var s,a;Ii()||(i.current=((a=(s=u.composedPath)==null?void 0:s.call(u))==null?void 0:a[0])||u.target)},!0),Mt(e,"pointerup",u=>{if(Ii()||!i.current)return;let s=i.current;return i.current=null,o(u,()=>s)},!0);let l=m.useRef({x:0,y:0});Mt(e,"touchstart",u=>{l.current.x=u.touches[0].clientX,l.current.y=u.touches[0].clientY},!0),Mt(e,"touchend",u=>{let s={x:u.changedTouches[0].clientX,y:u.changedTouches[0].clientY};if(!(Math.abs(s.x-l.current.x)>=ji||Math.abs(s.y-l.current.y)>=ji))return o(u,()=>At(u.target)?u.target:null)},!0),cc(e,"blur",u=>o(u,()=>Eu(window.document.activeElement)?window.document.activeElement:null),!0)}function $r(...e){return m.useMemo(()=>Kt(...e),[...e])}var dc=(e=>(e[e.Ignore=0]="Ignore",e[e.Select=1]="Select",e[e.Close=2]="Close",e))(dc||{});const xn={Ignore:{kind:0},Select:e=>({kind:1,target:e}),Close:{kind:2}},pc=200,Fi=5;function mc(e,{trigger:t,action:n,close:r,select:o}){let i=m.useRef(null),l=m.useRef(null),u=m.useRef(null);Mt(e&&t!==null,"pointerdown",s=>{br(s==null?void 0:s.target)&&t!=null&&t.contains(s.target)&&(l.current=s.x,u.current=s.y,i.current=s.timeStamp)}),Mt(e&&t!==null,"pointerup",s=>{var a,c;let d=i.current;if(d===null||(i.current=null,!At(s.target))||Math.abs(s.x-((a=l.current)!=null?a:s.x))<Fi&&Math.abs(s.y-((c=u.current)!=null?c:s.y))<Fi)return;let p=n(s);switch(p.kind){case 0:return;case 1:{s.timeStamp-d>pc&&(o(p.target),r());break}case 2:{r();break}}},{capture:!0})}function hc(e,t){return m.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 gc(e){return m.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot)}function vc(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(u=>u()))}}}function bc(){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 yc(){return Mi()?{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 u=Ke();u.style(e.documentElement,"scrollBehavior","auto"),t.add(()=>t.microTask(()=>u.dispose()))}let i=(o=window.scrollY)!=null?o:window.pageYOffset,l=null;t.addEventListener(e,"click",u=>{if(At(u.target))try{let s=u.target.closest("a");if(!s)return;let{hash:a}=new URL(s.href),c=e.querySelector(a);At(c)&&!r(c)&&(l=c)}catch{}},!0),t.addEventListener(e,"touchstart",u=>{if(At(u.target)&&wu(u.target))if(r(u.target)){let s=u.target;for(;s.parentElement&&r(s.parentElement);)s=s.parentElement;t.style(s,"overscrollBehavior","contain")}else t.style(u.target,"touchAction","none")}),t.addEventListener(e,"touchmove",u=>{if(At(u.target)){if(ci(u.target))return;if(r(u.target)){let s=u.target;for(;s.parentElement&&s.dataset.headlessuiPortal!==""&&!(s.scrollHeight>s.clientHeight||s.scrollWidth>s.clientWidth);)s=s.parentElement;s.dataset.headlessuiPortal===""&&u.preventDefault()}else u.preventDefault()}},{passive:!1}),t.add(()=>{var u;let s=(u=window.scrollY)!=null?u:window.pageYOffset;i!==s&&window.scrollTo(0,i),l&&l.isConnected&&(l.scrollIntoView({block:"nearest"}),l=null)})})}}:{}}function xc(){return{before({doc:e,d:t}){t.style(e.documentElement,"overflow","hidden")}}}function wc(e){let t={};for(let n of e)Object.assign(t,n(t));return t}let Tt=vc(()=>new Map,{PUSH(e,t){var n;let r=(n=this.get(e))!=null?n:{doc:e,count:0,d:Ke(),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:wc(n)},o=[yc(),bc(),xc()];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)}});Tt.subscribe(()=>{let e=Tt.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)&&Tt.dispatch(n.count>0?"SCROLL_PREVENT":"SCROLL_ALLOW",n),n.count===0&&Tt.dispatch("TEARDOWN",n)}});function Ec(e,t,n=()=>({containers:[]})){let r=gc(Tt),o=t?r.get(t):void 0,i=o?o.count>0:!1;return ue(()=>{if(!(!t||!e))return Tt.dispatch("PUSH",t,n),()=>Tt.dispatch("POP",t,n)},[e,t]),i}function Sc(e,t,n=()=>[document.body]){let r=Ni(e,"scroll-lock");Ec(r,t,o=>{var i;return{containers:[...(i=o.containers)!=null?i:[],n]}})}function Ri(e){return[e.screenX,e.screenY]}function Cc(){let e=m.useRef([-1,-1]);return{wasMoved(t){let n=Ri(t);return e.current[0]===n[0]&&e.current[1]===n[1]?!1:(e.current=n,!0)},update(t){e.current=Ri(t)}}}function Oc(e=0){let[t,n]=m.useState(e),r=m.useCallback(s=>n(s),[t]),o=m.useCallback(s=>n(a=>a|s),[t]),i=m.useCallback(s=>(t&s)===s,[t]),l=m.useCallback(s=>n(a=>a&~s),[n]),u=m.useCallback(s=>n(a=>a^s),[n]);return{flags:t,setFlag:r,addFlag:o,hasFlag:i,removeFlag:l,toggleFlag:u}}var ki,_i;typeof process<"u"&&typeof globalThis<"u"&&typeof Element<"u"&&((ki=process==null?void 0:process.env)==null?void 0:ki.NODE_ENV)==="test"&&typeof((_i=Element==null?void 0:Element.prototype)==null?void 0:_i.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(`
|
|
80
|
+
`)),[]});var Tc=(e=>(e[e.None=0]="None",e[e.Closed=1]="Closed",e[e.Enter=2]="Enter",e[e.Leave=4]="Leave",e))(Tc||{});function Bi(e){let t={};for(let n in e)e[n]===!0&&(t[`data-${n}`]="");return t}function Wi(e,t,n,r){let[o,i]=m.useState(n),{hasFlag:l,addFlag:u,removeFlag:s}=Oc(e&&o?3:0),a=m.useRef(!1),c=m.useRef(!1),d=$t();return ue(()=>{var p;if(e){if(n&&i(!0),!t){n&&u(3);return}return(p=r==null?void 0:r.start)==null||p.call(r,n),Nc(t,{inFlight:a,prepare(){c.current?c.current=!1:c.current=a.current,a.current=!0,!c.current&&(n?(u(3),s(4)):(u(4),s(2)))},run(){c.current?n?(s(3),u(4)):(s(4),u(3)):n?s(1):u(1)},done(){var f;c.current&&typeof t.getAnimations=="function"&&t.getAnimations().length>0||(a.current=!1,s(7),n||i(!1),(f=r==null?void 0:r.end)==null||f.call(r,n))}})}},[e,n,t,d]),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 Nc(e,{prepare:t,run:n,done:r,inFlight:o}){let i=Ke();return Pc(e,{prepare:t,inFlight:o}),i.nextFrame(()=>{n(),i.requestAnimationFrame(()=>{i.add(Lc(e,r))})}),i.dispose}function Lc(e,t){var n,r;let o=Ke();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(u=>u instanceof CSSTransition))!=null?r:[];return l.length===0?(t(),o.dispose):(Promise.allSettled(l.map(u=>u.finished)).then(()=>{i||t()}),o.dispose)}function Pc(e,{inFlight:t,prepare:n}){if(t!=null&&t.current){n();return}let r=e.style.transition;e.style.transition="none",n(),e.offsetHeight,e.style.transition=r}function wn(){return typeof window<"u"}function It(e){return Ar(e)?(e.nodeName||"").toLowerCase():"#document"}function Le(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Je(e){var t;return(t=(Ar(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Ar(e){return wn()?e instanceof Node||e instanceof Le(e).Node:!1}function oe(e){return wn()?e instanceof Element||e instanceof Le(e).Element:!1}function Ce(e){return wn()?e instanceof HTMLElement||e instanceof Le(e).HTMLElement:!1}function Mr(e){return!wn()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Le(e).ShadowRoot}const Dc=new Set(["inline","contents"]);function Zt(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Ve(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!Dc.has(o)}const $c=new Set(["table","td","th"]);function Ac(e){return $c.has(It(e))}const Mc=[":popover-open",":modal"];function En(e){return Mc.some(t=>{try{return e.matches(t)}catch{return!1}})}const Ic=["transform","translate","scale","rotate","perspective"],jc=["transform","translate","scale","rotate","perspective","filter"],Fc=["paint","layout","strict","content"];function Ir(e){const t=Sn(),n=oe(e)?Ve(e):e;return Ic.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)||jc.some(r=>(n.willChange||"").includes(r))||Fc.some(r=>(n.contain||"").includes(r))}function Rc(e){let t=ct(e);for(;Ce(t)&&!ut(t);){if(Ir(t))return t;if(En(t))return null;t=ct(t)}return null}function Sn(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const kc=new Set(["html","body","#document"]);function ut(e){return kc.has(It(e))}function Ve(e){return Le(e).getComputedStyle(e)}function Cn(e){return oe(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ct(e){if(It(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Mr(e)&&e.host||Je(e);return Mr(t)?t.host:t}function Ui(e){const t=ct(e);return ut(t)?e.ownerDocument?e.ownerDocument.body:e.body:Ce(t)&&Zt(t)?t:Ui(t)}function yt(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=Ui(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),l=Le(o);if(i){const u=jr(l);return t.concat(l,l.visualViewport||[],Zt(o)?o:[],u&&n?yt(u):[])}return t.concat(o,yt(o,[],n))}function jr(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function _c(){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 ft=Math.min,we=Math.max,Jt=Math.round,On=Math.floor,et=e=>({x:e,y:e}),Bc={left:"right",right:"left",bottom:"top",top:"bottom"},Wc={start:"end",end:"start"};function Fr(e,t,n){return we(e,ft(t,n))}function Nt(e,t){return typeof e=="function"?e(t):e}function xt(e){return e.split("-")[0]}function jt(e){return e.split("-")[1]}function Vi(e){return e==="x"?"y":"x"}function Rr(e){return e==="y"?"height":"width"}const Uc=new Set(["top","bottom"]);function dt(e){return Uc.has(xt(e))?"y":"x"}function kr(e){return Vi(dt(e))}function Vc(e,t,n){n===void 0&&(n=!1);const r=jt(e),o=kr(e),i=Rr(o);let l=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(l=Tn(l)),[l,Tn(l)]}function zc(e){const t=Tn(e);return[_r(e),t,_r(t)]}function _r(e){return e.replace(/start|end/g,t=>Wc[t])}const zi=["left","right"],Hi=["right","left"],Hc=["top","bottom"],Gc=["bottom","top"];function Yc(e,t,n){switch(e){case"top":case"bottom":return n?t?Hi:zi:t?zi:Hi;case"left":case"right":return t?Hc:Gc;default:return[]}}function Kc(e,t,n,r){const o=jt(e);let i=Yc(xt(e),n==="start",r);return o&&(i=i.map(l=>l+"-"+o),t&&(i=i.concat(i.map(_r)))),i}function Tn(e){return e.replace(/left|right|bottom|top/g,t=>Bc[t])}function qc(e){return{top:0,right:0,bottom:0,left:0,...e}}function Gi(e){return typeof e!="number"?qc(e):{top:e,right:e,bottom:e,left:e}}function Nn(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}}/*!
|
|
81
81
|
* tabbable 6.2.0
|
|
82
82
|
* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
|
|
83
|
-
*/var qc=["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])"],_r=qc.join(","),Yi=typeof Element>"u",en=Yi?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Pn=!Yi&&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},Ln=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},Xc=function(t){var n,r=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return r===""||r==="true"},Qc=function(t,n,r){if(Ln(t))return[];var o=Array.prototype.slice.apply(t.querySelectorAll(_r));return n&&en.call(t,_r)&&o.unshift(t),o=o.filter(r),o},Jc=function e(t,n,r){for(var o=[],i=Array.from(t);i.length;){var l=i.shift();if(!Ln(l,!1))if(l.tagName==="SLOT"){var u=l.assignedElements(),s=u.length?u:l.children,a=e(s,!0,r);r.flatten?o.push.apply(o,a):o.push({scopeParent:l,candidates:a})}else{var c=en.call(l,_r);c&&r.filter(l)&&(n||!t.includes(l))&&o.push(l);var d=l.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(l),p=!Ln(d,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(l));if(d&&p){var f=e(d===!0?l.children:d.children,!0,r);r.flatten?o.push.apply(o,f):o.push({scopeParent:l,candidates:f})}else i.unshift.apply(i,l.children)}}return o},Ki=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},qi=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||Xc(t))&&!Ki(t)?0:t.tabIndex},Zc=function(t,n){var r=qi(t);return r<0&&n&&!Ki(t)?0:r},ef=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},Xi=function(t){return t.tagName==="INPUT"},tf=function(t){return Xi(t)&&t.type==="hidden"},nf=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return n},rf=function(t,n){for(var r=0;r<t.length;r++)if(t[r].checked&&t[r].form===n)return t[r]},of=function(t){if(!t.name)return!0;var n=t.form||Pn(t),r=function(u){return n.querySelectorAll('input[type="radio"][name="'+u+'"]')},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=rf(o,t.form);return!i||i===t},sf=function(t){return Xi(t)&&t.type==="radio"},lf=function(t){return sf(t)&&!of(t)},af=function(t){var n,r=t&&Pn(t),o=(n=r)===null||n===void 0?void 0:n.host,i=!1;if(r&&r!==t){var l,u,s;for(i=!!((l=o)!==null&&l!==void 0&&(u=l.ownerDocument)!==null&&u!==void 0&&u.contains(o)||t!=null&&(s=t.ownerDocument)!==null&&s!==void 0&&s.contains(t));!i&&o;){var a,c,d;r=Pn(o),o=(a=r)===null||a===void 0?void 0:a.host,i=!!((c=o)!==null&&c!==void 0&&(d=c.ownerDocument)!==null&&d!==void 0&&d.contains(o))}}return i},Qi=function(t){var n=t.getBoundingClientRect(),r=n.width,o=n.height;return r===0&&o===0},uf=function(t,n){var r=n.displayCheck,o=n.getShadowRoot;if(getComputedStyle(t).visibility==="hidden")return!0;var i=en.call(t,"details>summary:first-of-type"),l=i?t.parentElement:t;if(en.call(l,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="legacy-full"){if(typeof o=="function"){for(var u=t;t;){var s=t.parentElement,a=Pn(t);if(s&&!s.shadowRoot&&o(s)===!0)return Qi(t);t.assignedSlot?t=t.assignedSlot:!s&&a!==t.ownerDocument?t=a.host:t=s}t=u}if(af(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return Qi(t);return!1},cf=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 en.call(n,"fieldset[disabled] *")?!0:!o.contains(t)}return!0}n=n.parentElement}return!1},ff=function(t,n){return!(n.disabled||Ln(n)||tf(n)||uf(n,t)||nf(n)||cf(n))},Ji=function(t,n){return!(lf(n)||qi(n)<0||!ff(t,n))},df=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},pf=function e(t){var n=[],r=[];return t.forEach(function(o,i){var l=!!o.scopeParent,u=l?o.scopeParent:o,s=Zc(u,l),a=l?e(o.candidates):u;s===0?l?n.push.apply(n,a):n.push(u):r.push({documentOrder:i,tabIndex:s,item:o,isScope:l,content:a})}),r.sort(ef).reduce(function(o,i){return i.isScope?o.push.apply(o,i.content):o.push(i.content),o},[]).concat(n)},Zi=function(t,n){n=n||{};var r;return n.getShadowRoot?r=Jc([t],n.includeContainer,{filter:Ji.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:df}):r=Qc(t,n.includeContainer,Ji.bind(null,n)),pf(r)};function es(e,t,n){let{reference:r,floating:o}=e;const i=dt(t),l=Rr(t),u=Fr(l),s=yt(t),a=i==="y",c=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,p=r[u]/2-o[u]/2;let f;switch(s){case"top":f={x:c,y:r.y-o.height};break;case"bottom":f={x:c,y:r.y+r.height};break;case"right":f={x:r.x+r.width,y:d};break;case"left":f={x:r.x-o.width,y:d};break;default:f={x:r.x,y:r.y}}switch(jt(t)){case"start":f[l]-=p*(n&&a?-1:1);break;case"end":f[l]+=p*(n&&a?-1:1);break}return f}const mf=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:l}=n,u=i.filter(Boolean),s=await(l.isRTL==null?void 0:l.isRTL(t));let a=await l.getElementRects({reference:e,floating:t,strategy:o}),{x:c,y:d}=es(a,r,s),p=r,f={},g=0;for(let v=0;v<u.length;v++){const{name:E,fn:M}=u[v],{x:w,y:N,data:j,reset:F}=await M({x:c,y:d,initialPlacement:r,placement:p,strategy:o,middlewareData:f,rects:a,platform:l,elements:{reference:e,floating:t}});c=w??c,d=N??d,f={...f,[E]:{...f[E],...j}},F&&g<=50&&(g++,typeof F=="object"&&(F.placement&&(p=F.placement),F.rects&&(a=F.rects===!0?await l.getElementRects({reference:e,floating:t,strategy:o}):F.rects),{x:c,y:d}=es(a,p,s)),v=-1)}return{x:c,y:d,placement:p,strategy:o,middlewareData:f}};async function An(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:i,rects:l,elements:u,strategy:s}=e,{boundary:a="clippingAncestors",rootBoundary:c="viewport",elementContext:d="floating",altBoundary:p=!1,padding:f=0}=Nt(t,e),g=Gi(f),E=u[p?d==="floating"?"reference":"floating":d],M=Nn(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(E)))==null||n?E:E.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(u.floating)),boundary:a,rootBoundary:c,strategy:s})),w=d==="floating"?{x:r,y:o,width:l.floating.width,height:l.floating.height}:l.reference,N=await(i.getOffsetParent==null?void 0:i.getOffsetParent(u.floating)),j=await(i.isElement==null?void 0:i.isElement(N))?await(i.getScale==null?void 0:i.getScale(N))||{x:1,y:1}:{x:1,y:1},F=Nn(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:u,rect:w,offsetParent:N,strategy:s}):w);return{top:(M.top-F.top+g.top)/j.y,bottom:(F.bottom-M.bottom+g.bottom)/j.y,left:(M.left-F.left+g.left)/j.x,right:(F.right-M.right+g.right)/j.x}}const hf=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:l,elements:u,middlewareData:s}=t,{element:a,padding:c=0}=Nt(e,t)||{};if(a==null)return{};const d=Gi(c),p={x:n,y:r},f=Rr(o),g=Fr(f),v=await l.getDimensions(a),E=f==="y",M=E?"top":"left",w=E?"bottom":"right",N=E?"clientHeight":"clientWidth",j=i.reference[g]+i.reference[f]-p[f]-i.floating[g],F=p[f]-i.reference[f],k=await(l.getOffsetParent==null?void 0:l.getOffsetParent(a));let W=k?k[N]:0;(!W||!await(l.isElement==null?void 0:l.isElement(k)))&&(W=u.floating[N]||i.floating[g]);const h=j/2-F/2,b=W/2-v[g]/2-1,x=ft(d[M],b),$=ft(d[w],b),A=x,P=W-v[g]-$,S=W/2-v[g]/2+h,O=jr(A,S,P),T=!s.arrow&&jt(o)!=null&&S!==O&&i.reference[g]/2-(S<A?x:$)-v[g]/2<0,L=T?S<A?S-A:S-P:0;return{[f]:p[f]+L,data:{[f]:O,centerOffset:S-O-L,...T&&{alignmentOffset:L}},reset:T}}}),gf=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:u,platform:s,elements:a}=t,{mainAxis:c=!0,crossAxis:d=!0,fallbackPlacements:p,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:v=!0,...E}=Nt(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const M=yt(o),w=dt(u),N=yt(u)===u,j=await(s.isRTL==null?void 0:s.isRTL(a.floating)),F=p||(N||!v?[Tn(u)]:Vc(u)),k=g!=="none";!p&&k&&F.push(...Yc(u,v,g,j));const W=[u,...F],h=await An(t,E),b=[];let x=((r=i.flip)==null?void 0:r.overflows)||[];if(c&&b.push(h[M]),d){const S=Uc(o,l,j);b.push(h[S[0]],h[S[1]])}if(x=[...x,{placement:o,overflows:b}],!b.every(S=>S<=0)){var $,A;const S=((($=i.flip)==null?void 0:$.index)||0)+1,O=W[S];if(O&&(!(d==="alignment"?w!==dt(O):!1)||x.every(y=>dt(y.placement)===w?y.overflows[0]>0:!0)))return{data:{index:S,overflows:x},reset:{placement:O}};let T=(A=x.filter(L=>L.overflows[0]<=0).sort((L,y)=>L.overflows[1]-y.overflows[1])[0])==null?void 0:A.placement;if(!T)switch(f){case"bestFit":{var P;const L=(P=x.filter(y=>{if(k){const I=dt(y.placement);return I===w||I==="y"}return!0}).map(y=>[y.placement,y.overflows.filter(I=>I>0).reduce((I,_)=>I+_,0)]).sort((y,I)=>y[1]-I[1])[0])==null?void 0:P[0];L&&(T=L);break}case"initialPlacement":T=u;break}if(o!==T)return{reset:{placement:T}}}return{}}}},vf=new Set(["left","top"]);async function bf(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),l=yt(n),u=jt(n),s=dt(n)==="y",a=vf.has(l)?-1:1,c=i&&s?-1:1,d=Nt(t,e);let{mainAxis:p,crossAxis:f,alignmentAxis:g}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return u&&typeof g=="number"&&(f=u==="end"?g*-1:g),s?{x:f*c,y:p*a}:{x:p*a,y:f*c}}const xf=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:u}=t,s=await bf(t,e);return l===((n=u.offset)==null?void 0:n.placement)&&(r=u.arrow)!=null&&r.alignmentOffset?{}:{x:o+s.x,y:i+s.y,data:{...s,placement:l}}}}},yf=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:u={fn:E=>{let{x:M,y:w}=E;return{x:M,y:w}}},...s}=Nt(e,t),a={x:n,y:r},c=await An(t,s),d=dt(yt(o)),p=Vi(d);let f=a[p],g=a[d];if(i){const E=p==="y"?"top":"left",M=p==="y"?"bottom":"right",w=f+c[E],N=f-c[M];f=jr(w,f,N)}if(l){const E=d==="y"?"top":"left",M=d==="y"?"bottom":"right",w=g+c[E],N=g-c[M];g=jr(w,g,N)}const v=u.fn({...t,[p]:f,[d]:g});return{...v,data:{x:v.x-n,y:v.y-r,enabled:{[p]:i,[d]:l}}}}}},wf=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:u}=t,{apply:s=()=>{},...a}=Nt(e,t),c=await An(t,a),d=yt(o),p=jt(o),f=dt(o)==="y",{width:g,height:v}=i.floating;let E,M;d==="top"||d==="bottom"?(E=d,M=p===(await(l.isRTL==null?void 0:l.isRTL(u.floating))?"start":"end")?"left":"right"):(M=d,E=p==="end"?"top":"bottom");const w=v-c.top-c.bottom,N=g-c.left-c.right,j=ft(v-c[E],w),F=ft(g-c[M],N),k=!t.middlewareData.shift;let W=j,h=F;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(h=N),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(W=w),k&&!p){const x=xe(c.left,0),$=xe(c.right,0),A=xe(c.top,0),P=xe(c.bottom,0);f?h=g-2*(x!==0||$!==0?x+$:xe(c.left,c.right)):W=v-2*(A!==0||P!==0?A+P:xe(c.top,c.bottom))}await s({...t,availableWidth:h,availableHeight:W});const b=await l.getDimensions(u.floating);return g!==b.width||v!==b.height?{reset:{rects:!0}}:{}}}};function ts(e){const t=Ve(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Ee(e),i=o?e.offsetWidth:n,l=o?e.offsetHeight:r,u=Zt(n)!==i||Zt(r)!==l;return u&&(n=i,r=l),{width:n,height:r,$:u}}function Wr(e){return oe(e)?e:e.contextElement}function Ft(e){const t=Wr(e);if(!Ee(t))return et(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=ts(t);let l=(i?Zt(n.width):n.width)/r,u=(i?Zt(n.height):n.height)/o;return(!l||!Number.isFinite(l))&&(l=1),(!u||!Number.isFinite(u))&&(u=1),{x:l,y:u}}const Ef=et(0);function ns(e){const t=Ne(e);return!Sn()||!t.visualViewport?Ef:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Sf(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Ne(e)?!1:t}function Pt(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=Wr(e);let l=et(1);t&&(r?oe(r)&&(l=Ft(r)):l=Ft(e));const u=Sf(i,n,r)?ns(i):et(0);let s=(o.left+u.x)/l.x,a=(o.top+u.y)/l.y,c=o.width/l.x,d=o.height/l.y;if(i){const p=Ne(i),f=r&&oe(r)?Ne(r):r;let g=p,v=Ir(g);for(;v&&r&&f!==g;){const E=Ft(v),M=v.getBoundingClientRect(),w=Ve(v),N=M.left+(v.clientLeft+parseFloat(w.paddingLeft))*E.x,j=M.top+(v.clientTop+parseFloat(w.paddingTop))*E.y;s*=E.x,a*=E.y,c*=E.x,d*=E.y,s+=N,a+=j,g=Ne(v),v=Ir(g)}}return Nn({width:c,height:d,x:s,y:a})}function $n(e,t){const n=Cn(e).scrollLeft;return t?t.left+n:Pt(Ze(e)).left+n}function rs(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-$n(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function Cf(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i=o==="fixed",l=Ze(r),u=t?En(t.floating):!1;if(r===l||u&&i)return n;let s={scrollLeft:0,scrollTop:0},a=et(1);const c=et(0),d=Ee(r);if((d||!d&&!i)&&((It(r)!=="body"||Jt(l))&&(s=Cn(r)),Ee(r))){const f=Pt(r);a=Ft(r),c.x=f.x+r.clientLeft,c.y=f.y+r.clientTop}const p=l&&!d&&!i?rs(l,s):et(0);return{width:n.width*a.x,height:n.height*a.y,x:n.x*a.x-s.scrollLeft*a.x+c.x+p.x,y:n.y*a.y-s.scrollTop*a.y+c.y+p.y}}function Of(e){return Array.from(e.getClientRects())}function Tf(e){const t=Ze(e),n=Cn(e),r=e.ownerDocument.body,o=xe(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=xe(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let l=-n.scrollLeft+$n(e);const u=-n.scrollTop;return Ve(r).direction==="rtl"&&(l+=xe(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:l,y:u}}const os=25;function Nf(e,t){const n=Ne(e),r=Ze(e),o=n.visualViewport;let i=r.clientWidth,l=r.clientHeight,u=0,s=0;if(o){i=o.width,l=o.height;const c=Sn();(!c||c&&t==="fixed")&&(u=o.offsetLeft,s=o.offsetTop)}const a=$n(r);if(a<=0){const c=r.ownerDocument,d=c.body,p=getComputedStyle(d),f=c.compatMode==="CSS1Compat"&&parseFloat(p.marginLeft)+parseFloat(p.marginRight)||0,g=Math.abs(r.clientWidth-d.clientWidth-f);g<=os&&(i-=g)}else a<=os&&(i+=a);return{width:i,height:l,x:u,y:s}}const Pf=new Set(["absolute","fixed"]);function Lf(e,t){const n=Pt(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=Ee(e)?Ft(e):et(1),l=e.clientWidth*i.x,u=e.clientHeight*i.y,s=o*i.x,a=r*i.y;return{width:l,height:u,x:s,y:a}}function is(e,t,n){let r;if(t==="viewport")r=Nf(e,n);else if(t==="document")r=Tf(Ze(e));else if(oe(t))r=Lf(t,n);else{const o=ns(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Nn(r)}function ss(e,t){const n=ct(e);return n===t||!oe(n)||ut(n)?!1:Ve(n).position==="fixed"||ss(n,t)}function Af(e,t){const n=t.get(e);if(n)return n;let r=xt(e,[],!1).filter(u=>oe(u)&&It(u)!=="body"),o=null;const i=Ve(e).position==="fixed";let l=i?ct(e):e;for(;oe(l)&&!ut(l);){const u=Ve(l),s=Mr(l);!s&&u.position==="fixed"&&(o=null),(i?!s&&!o:!s&&u.position==="static"&&!!o&&Pf.has(o.position)||Jt(l)&&!s&&ss(e,l))?r=r.filter(c=>c!==l):o=u,l=ct(l)}return t.set(e,r),r}function $f(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const l=[...n==="clippingAncestors"?En(t)?[]:Af(t,this._c):[].concat(n),r],u=l[0],s=l.reduce((a,c)=>{const d=is(t,c,o);return a.top=xe(d.top,a.top),a.right=ft(d.right,a.right),a.bottom=ft(d.bottom,a.bottom),a.left=xe(d.left,a.left),a},is(t,u,o));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}}function Df(e){const{width:t,height:n}=ts(e);return{width:t,height:n}}function Mf(e,t,n){const r=Ee(t),o=Ze(t),i=n==="fixed",l=Pt(e,!0,i,t);let u={scrollLeft:0,scrollTop:0};const s=et(0);function a(){s.x=$n(o)}if(r||!r&&!i)if((It(t)!=="body"||Jt(o))&&(u=Cn(t)),r){const f=Pt(t,!0,i,t);s.x=f.x+t.clientLeft,s.y=f.y+t.clientTop}else o&&a();i&&!r&&o&&a();const c=o&&!r&&!i?rs(o,u):et(0),d=l.left+u.scrollLeft-s.x-c.x,p=l.top+u.scrollTop-s.y-c.y;return{x:d,y:p,width:l.width,height:l.height}}function Br(e){return Ve(e).position==="static"}function ls(e,t){if(!Ee(e)||Ve(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Ze(e)===n&&(n=n.ownerDocument.body),n}function as(e,t){const n=Ne(e);if(En(e))return n;if(!Ee(e)){let o=ct(e);for(;o&&!ut(o);){if(oe(o)&&!Br(o))return o;o=ct(o)}return n}let r=ls(e,t);for(;r&&$c(r)&&Br(r);)r=ls(r,t);return r&&ut(r)&&Br(r)&&!Mr(r)?n:r||Fc(e)||n}const If=async function(e){const t=this.getOffsetParent||as,n=this.getDimensions,r=await n(e.floating);return{reference:Mf(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function jf(e){return Ve(e).direction==="rtl"}const Ff={convertOffsetParentRelativeRectToViewportRelativeRect:Cf,getDocumentElement:Ze,getClippingRect:$f,getOffsetParent:as,getElementRects:If,getClientRects:Of,getDimensions:Df,getScale:Ft,isElement:oe,isRTL:jf};function us(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Rf(e,t){let n=null,r;const o=Ze(e);function i(){var u;clearTimeout(r),(u=n)==null||u.disconnect(),n=null}function l(u,s){u===void 0&&(u=!1),s===void 0&&(s=1),i();const a=e.getBoundingClientRect(),{left:c,top:d,width:p,height:f}=a;if(u||t(),!p||!f)return;const g=On(d),v=On(o.clientWidth-(c+p)),E=On(o.clientHeight-(d+f)),M=On(c),N={rootMargin:-g+"px "+-v+"px "+-E+"px "+-M+"px",threshold:xe(0,ft(1,s))||1};let j=!0;function F(k){const W=k[0].intersectionRatio;if(W!==s){if(!j)return l();W?l(!1,W):r=setTimeout(()=>{l(!1,1e-7)},1e3)}W===1&&!us(a,e.getBoundingClientRect())&&l(),j=!1}try{n=new IntersectionObserver(F,{...N,root:o.ownerDocument})}catch{n=new IntersectionObserver(F,N)}n.observe(e)}return l(!0),i}function cs(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:u=typeof IntersectionObserver=="function",animationFrame:s=!1}=r,a=Wr(e),c=o||i?[...a?xt(a):[],...xt(t)]:[];c.forEach(M=>{o&&M.addEventListener("scroll",n,{passive:!0}),i&&M.addEventListener("resize",n)});const d=a&&u?Rf(a,n):null;let p=-1,f=null;l&&(f=new ResizeObserver(M=>{let[w]=M;w&&w.target===a&&f&&(f.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var N;(N=f)==null||N.observe(t)})),n()}),a&&!s&&f.observe(a),f.observe(t));let g,v=s?Pt(e):null;s&&E();function E(){const M=Pt(e);v&&!us(v,M)&&n(),v=M,g=requestAnimationFrame(E)}return n(),()=>{var M;c.forEach(w=>{o&&w.removeEventListener("scroll",n),i&&w.removeEventListener("resize",n)}),d==null||d(),(M=f)==null||M.disconnect(),f=null,s&&cancelAnimationFrame(g)}}const Ur=An,kf=xf,_f=yf,Wf=gf,Bf=wf,fs=hf,Uf=(e,t,n)=>{const r=new Map,o={platform:Ff,...n},i={...o.platform,_c:r};return mf(e,t,{...o,platform:i})};var Vf=typeof document<"u",zf=function(){},Dn=Vf?m.useLayoutEffect:zf;function Mn(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(!Mn(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)&&!Mn(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function ds(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function ps(e,t){const n=ds(e);return Math.round(t*n)/n}function Vr(e){const t=R.useRef(e);return Dn(()=>{t.current=e}),t}function ms(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:i,floating:l}={},transform:u=!0,whileElementsMounted:s,open:a}=e,[c,d]=R.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,f]=R.useState(r);Mn(p,r)||f(r);const[g,v]=R.useState(null),[E,M]=R.useState(null),w=R.useCallback(y=>{y!==k.current&&(k.current=y,v(y))},[]),N=R.useCallback(y=>{y!==W.current&&(W.current=y,M(y))},[]),j=i||g,F=l||E,k=R.useRef(null),W=R.useRef(null),h=R.useRef(c),b=s!=null,x=Vr(s),$=Vr(o),A=Vr(a),P=R.useCallback(()=>{if(!k.current||!W.current)return;const y={placement:t,strategy:n,middleware:p};$.current&&(y.platform=$.current),Uf(k.current,W.current,y).then(I=>{const _={...I,isPositioned:A.current!==!1};S.current&&!Mn(h.current,_)&&(h.current=_,Vt.flushSync(()=>{d(_)}))})},[p,t,n,$,A]);Dn(()=>{a===!1&&h.current.isPositioned&&(h.current.isPositioned=!1,d(y=>({...y,isPositioned:!1})))},[a]);const S=R.useRef(!1);Dn(()=>(S.current=!0,()=>{S.current=!1}),[]),Dn(()=>{if(j&&(k.current=j),F&&(W.current=F),j&&F){if(x.current)return x.current(j,F,P);P()}},[j,F,P,x,b]);const O=R.useMemo(()=>({reference:k,floating:W,setReference:w,setFloating:N}),[w,N]),T=R.useMemo(()=>({reference:j,floating:F}),[j,F]),L=R.useMemo(()=>{const y={position:n,left:0,top:0};if(!T.floating)return y;const I=ps(T.floating,c.x),_=ps(T.floating,c.y);return u?{...y,transform:"translate("+I+"px, "+_+"px)",...ds(T.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:I,top:_}},[n,u,T.floating,c.x,c.y]);return R.useMemo(()=>({...c,update:P,refs:O,elements:T,floatingStyles:L}),[c,P,O,T,L])}const Hf=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?fs({element:r.current,padding:o}).fn(n):{}:r?fs({element:r,padding:o}).fn(n):{}}}},zr=(e,t)=>({...kf(e),options:[e,t]}),hs=(e,t)=>({..._f(e),options:[e,t]}),gs=(e,t)=>({...Wf(e),options:[e,t]}),Gf=(e,t)=>({...Bf(e),options:[e,t]}),Yf=(e,t)=>({...Hf(e),options:[e,t]}),vs={...R},Kf=vs.useInsertionEffect||(e=>e());function bs(e){const t=R.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return Kf(()=>{t.current=e}),R.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 Hr=typeof document<"u"?m.useLayoutEffect:m.useEffect;let xs=!1,qf=0;const ys=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+qf++;function Xf(){const[e,t]=R.useState(()=>xs?ys():void 0);return Hr(()=>{e==null&&t(ys())},[]),R.useEffect(()=>{xs=!0},[]),e}const Qf=vs.useId||Xf;let tn;process.env.NODE_ENV!=="production"&&(tn=new Set);function Jf(){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=tn)!=null&&e.has(o))){var i;(i=tn)==null||i.add(o),console.warn(o)}}function Zf(){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=tn)!=null&&e.has(o))){var i;(i=tn)==null||i.add(o),console.error(o)}}function ed(){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 td=R.createContext(null),nd=R.createContext(null),rd=()=>{var e;return((e=R.useContext(td))==null?void 0:e.id)||null},od=()=>R.useContext(nd),id="data-floating-ui-focusable";function sd(e){const{open:t=!1,onOpenChange:n,elements:r}=e,o=Qf(),i=R.useRef({}),[l]=R.useState(()=>ed()),u=rd()!=null;if(process.env.NODE_ENV!=="production"){const f=r.reference;f&&!oe(f)&&Zf("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[s,a]=R.useState(r.reference),c=bs((f,g,v)=>{i.current.openEvent=f?g:void 0,l.emit("openchange",{open:f,event:g,reason:v,nested:u}),n==null||n(f,g,v)}),d=R.useMemo(()=>({setPositionReference:a}),[]),p=R.useMemo(()=>({reference:s||r.reference||null,floating:r.floating||null,domReference:r.reference}),[s,r.reference,r.floating]);return R.useMemo(()=>({dataRef:i,open:t,onOpenChange:c,elements:p,events:l,floatingId:o,refs:d}),[t,c,p,l,o,d])}function ld(e){e===void 0&&(e={});const{nodeId:t}=e,n=sd({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,o=r.elements,[i,l]=R.useState(null),[u,s]=R.useState(null),c=(o==null?void 0:o.domReference)||i,d=R.useRef(null),p=od();Hr(()=>{c&&(d.current=c)},[c]);const f=ms({...e,elements:{...o,...u&&{reference:u}}}),g=R.useCallback(N=>{const j=oe(N)?{getBoundingClientRect:()=>N.getBoundingClientRect(),contextElement:N}:N;s(j),f.refs.setReference(j)},[f.refs]),v=R.useCallback(N=>{(oe(N)||N===null)&&(d.current=N,l(N)),(oe(f.refs.reference.current)||f.refs.reference.current===null||N!==null&&!oe(N))&&f.refs.setReference(N)},[f.refs]),E=R.useMemo(()=>({...f.refs,setReference:v,setPositionReference:g,domReference:d}),[f.refs,v,g]),M=R.useMemo(()=>({...f.elements,domReference:c}),[f.elements,c]),w=R.useMemo(()=>({...f,...r,refs:E,elements:M,nodeId:t}),[f,E,M,t,r]);return Hr(()=>{r.dataRef.current.floatingContext=w;const N=p==null?void 0:p.nodesRef.current.find(j=>j.id===t);N&&(N.context=w)}),R.useMemo(()=>({...f,context:w,refs:E,elements:M}),[f,E,M,w])}const ws="active",Es="selected";function Gr(e,t,n){const r=new Map,o=n==="item";let i=e;if(o&&e){const{[ws]:l,[Es]:u,...s}=e;i=s}return{...n==="floating"&&{tabIndex:-1,[id]:""},...i,...t.map(l=>{const u=l?l[n]:null;return typeof u=="function"?e?u(e):null:u}).concat(e).reduce((l,u)=>(u&&Object.entries(u).forEach(s=>{let[a,c]=s;if(!(o&&[ws,Es].includes(a)))if(a.indexOf("on")===0){if(r.has(a)||r.set(a,[]),typeof c=="function"){var d;(d=r.get(a))==null||d.push(c),l[a]=function(){for(var p,f=arguments.length,g=new Array(f),v=0;v<f;v++)g[v]=arguments[v];return(p=r.get(a))==null?void 0:p.map(E=>E(...g)).find(E=>E!==void 0)}}}else l[a]=c}),l),{})}}function ad(e){e===void 0&&(e=[]);const t=e.map(u=>u==null?void 0:u.reference),n=e.map(u=>u==null?void 0:u.floating),r=e.map(u=>u==null?void 0:u.item),o=R.useCallback(u=>Gr(u,e,"reference"),t),i=R.useCallback(u=>Gr(u,e,"floating"),n),l=R.useCallback(u=>Gr(u,e,"item"),r);return R.useMemo(()=>({getReferenceProps:o,getFloatingProps:i,getItemProps:l}),[o,i,l])}function Ss(e,t){return{...e,rects:{...e.rects,floating:{...e.rects.floating,height:t}}}}const ud=e=>({name:"inner",options:e,async fn(t){const{listRef:n,overflowRef:r,onFallbackChange:o,offset:i=0,index:l=0,minItemsVisible:u=4,referenceOverflowThreshold:s=0,scrollRef:a,...c}=Nt(e,t),{rects:d,elements:{floating:p}}=t,f=n.current[l],g=(a==null?void 0:a.current)||p,v=p.clientTop||g.clientTop,E=p.clientTop!==0,M=g.clientTop!==0,w=p===g;if(process.env.NODE_ENV!=="production"&&(t.placement.startsWith("bottom")||Jf('`placement` side must be "bottom" when using the `inner`',"middleware.")),!f)return{};const N={...t,...await zr(-f.offsetTop-p.clientTop-d.reference.height/2-f.offsetHeight/2-i).fn(t)},j=await Ur(Ss(N,g.scrollHeight+v+p.clientTop),c),F=await Ur(N,{...c,elementContext:"reference"}),k=xe(0,j.top),W=N.y+k,x=(g.scrollHeight>g.clientHeight?$=>$:Zt)(xe(0,g.scrollHeight+(E&&w||M?v*2:0)-k-xe(0,j.bottom)));if(g.style.maxHeight=x+"px",g.scrollTop=k,o){const $=g.offsetHeight<f.offsetHeight*ft(u,n.current.length)-1||F.top>=-s||F.bottom>=-s;Vt.flushSync(()=>o($))}return r&&(r.current=await Ur(Ss({...N,y:W},g.offsetHeight+v+p.clientTop),c)),{y:W}}});function cd(e,t){const{open:n,elements:r}=e,{enabled:o=!0,overflowRef:i,scrollRef:l,onChange:u}=t,s=bs(u),a=R.useRef(!1),c=R.useRef(null),d=R.useRef(null);R.useEffect(()=>{if(!o)return;function f(v){if(v.ctrlKey||!g||i.current==null)return;const E=v.deltaY,M=i.current.top>=-.5,w=i.current.bottom>=-.5,N=g.scrollHeight-g.clientHeight,j=E<0?-1:1,F=E<0?"max":"min";g.scrollHeight<=g.clientHeight||(!M&&E>0||!w&&E<0?(v.preventDefault(),Vt.flushSync(()=>{s(k=>k+Math[F](E,N*j))})):/firefox/i.test(kc())&&(g.scrollTop+=E))}const g=(l==null?void 0:l.current)||r.floating;if(n&&g)return g.addEventListener("wheel",f),requestAnimationFrame(()=>{c.current=g.scrollTop,i.current!=null&&(d.current={...i.current})}),()=>{c.current=null,d.current=null,g.removeEventListener("wheel",f)}},[o,n,r.floating,i,l,s]);const p=R.useMemo(()=>({onKeyDown(){a.current=!0},onWheel(){a.current=!1},onPointerMove(){a.current=!1},onScroll(){const f=(l==null?void 0:l.current)||r.floating;if(!(!i.current||!f||!a.current)){if(c.current!==null){const g=f.scrollTop-c.current;(i.current.bottom<-.5&&g<-1||i.current.top<-.5&&g>1)&&Vt.flushSync(()=>s(v=>v+g))}requestAnimationFrame(()=>{c.current=f.scrollTop})}}}),[r.floating,s,i,l]);return R.useMemo(()=>o?{floating:p}:{},[o,p])}let Rt=m.createContext({styles:void 0,setReference:()=>{},setFloating:()=>{},getReferenceProps:()=>({}),getFloatingProps:()=>({}),slot:{}});Rt.displayName="FloatingContext";let Yr=m.createContext(null);Yr.displayName="PlacementContext";function fd(e){return m.useMemo(()=>e?typeof e=="string"?{to:e}:e:null,[e])}function dd(){return m.useContext(Rt).setReference}function pd(){return m.useContext(Rt).getReferenceProps}function md(){let{getFloatingProps:e,slot:t}=m.useContext(Rt);return m.useCallback((...n)=>Object.assign({},e(...n),{"data-anchor":t.anchor}),[e,t])}function hd(e=null){e===!1&&(e=null),typeof e=="string"&&(e={to:e});let t=m.useContext(Yr),n=m.useMemo(()=>e,[JSON.stringify(e,(o,i)=>{var l;return(l=i==null?void 0:i.outerHTML)!=null?l:i})]);ue(()=>{t==null||t(n??null)},[t,n]);let r=m.useContext(Rt);return m.useMemo(()=>[r.setFloating,e?r.styles:{}],[r.setFloating,e,r.styles])}let Cs=4;function gd({children:e,enabled:t=!0}){let[n,r]=m.useState(null),[o,i]=m.useState(0),l=m.useRef(null),[u,s]=m.useState(null);vd(u);let a=t&&n!==null&&u!==null,{to:c="bottom",gap:d=0,offset:p=0,padding:f=0,inner:g}=bd(n,u),[v,E="center"]=c.split(" ");ue(()=>{a&&i(0)},[a]);let{refs:M,floatingStyles:w,context:N}=ld({open:a,placement:v==="selection"?E==="center"?"bottom":`bottom-${E}`:E==="center"?`${v}`:`${v}-${E}`,strategy:"absolute",transform:!1,middleware:[zr({mainAxis:v==="selection"?0:d,crossAxis:p}),hs({padding:f}),v!=="selection"&&gs({padding:f}),v==="selection"&&g?ud({...g,padding:f,overflowRef:l,offset:o,minItemsVisible:Cs,referenceOverflowThreshold:f,onFallbackChange($){var A,P;if(!$)return;let S=N.elements.floating;if(!S)return;let O=parseFloat(getComputedStyle(S).scrollPaddingBottom)||0,T=Math.min(Cs,S.childElementCount),L=0,y=0;for(let I of(P=(A=N.elements.floating)==null?void 0:A.childNodes)!=null?P:[])if(at(I)){let _=I.offsetTop,V=_+I.clientHeight+O,z=S.scrollTop,G=z+S.clientHeight;if(_>=z&&V<=G)T--;else{y=Math.max(0,Math.min(V,G)-Math.max(_,z)),L=I.clientHeight;break}}T>=1&&i(I=>{let _=L*T-y+O;return I>=_?I:_})}}):null,Gf({padding:f,apply({availableWidth:$,availableHeight:A,elements:P}){Object.assign(P.floating.style,{overflow:"auto",maxWidth:`${$}px`,maxHeight:`min(var(--anchor-max-height, 100vh), ${A}px)`})}})].filter(Boolean),whileElementsMounted:cs}),[j=v,F=E]=N.placement.split("-");v==="selection"&&(j="selection");let k=m.useMemo(()=>({anchor:[j,F].filter(Boolean).join(" ")}),[j,F]),W=cd(N,{overflowRef:l,onChange:i}),{getReferenceProps:h,getFloatingProps:b}=ad([W]),x=ne($=>{s($),M.setFloating($)});return R.createElement(Yr.Provider,{value:r},R.createElement(Rt.Provider,{value:{setFloating:x,setReference:M.setReference,styles:w,getReferenceProps:h,getFloatingProps:b,slot:k}},e))}function vd(e){ue(()=>{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 bd(e,t){var n,r,o;let i=Kr((n=e==null?void 0:e.gap)!=null?n:"var(--anchor-gap, 0)",t),l=Kr((r=e==null?void 0:e.offset)!=null?r:"var(--anchor-offset, 0)",t),u=Kr((o=e==null?void 0:e.padding)!=null?o:"var(--anchor-padding, 0)",t);return{...e,gap:i,offset:l,padding:u}}function Kr(e,t,n=void 0){let r=$t(),o=ne((s,a)=>{if(s==null)return[n,null];if(typeof s=="number")return[s,null];if(typeof s=="string"){if(!a)return[n,null];let c=Ts(s,a);return[c,d=>{let p=Os(s);{let f=p.map(g=>window.getComputedStyle(a).getPropertyValue(g));r.requestAnimationFrame(function g(){r.nextFrame(g);let v=!1;for(let[M,w]of p.entries()){let N=window.getComputedStyle(a).getPropertyValue(w);if(f[M]!==N){f[M]=N,v=!0;break}}if(!v)return;let E=Ts(s,a);c!==E&&(d(E),c=E)})}return r.dispose}]}return[n,null]}),i=m.useMemo(()=>o(e,t)[0],[e,t]),[l=i,u]=m.useState();return ue(()=>{let[s,a]=o(e,t);if(u(s),!!a)return a(u)},[e,t]),l}function Os(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,...Os(o)]:[r]}return[]}function Ts(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 xd(e,t){let[n,r]=m.useState(t);return!e&&n!==t&&r(t),e?n:t}let qr=m.createContext(null);qr.displayName="OpenClosedContext";var qe=(e=>(e[e.Open=1]="Open",e[e.Closed=2]="Closed",e[e.Closing=4]="Closing",e[e.Opening=8]="Opening",e))(qe||{});function Xr(){return m.useContext(qr)}function Ns({value:e,children:t}){return m.createElement(qr.Provider,{value:e},t)}function yd(e){throw new Error("Unexpected object: "+e)}var fe=(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))(fe||{});function In(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:yd(e)}}var Ps=(e=>(e[e.Left=0]="Left",e[e.Right=2]="Right",e))(Ps||{});function Ls(e){let t=ne(e),n=m.useRef(!1);m.useEffect(()=>(n.current=!1,()=>{n.current=!0,ni(()=>{n.current&&t()})}),[t])}function wd(){let e=typeof document>"u";return"useSyncExternalStore"in R?(t=>t.useSyncExternalStore)(R)(()=>()=>{},()=>!1,()=>!e):!1}function Qr(){let e=wd(),[t,n]=R.useState(Qe.isHandoffComplete);return t&&Qe.isHandoffComplete===!1&&n(!1),R.useEffect(()=>{t!==!0&&n(!0)},[t]),R.useEffect(()=>Qe.handoff(),[]),e?!1:t}let Ed=m.createContext(!1);function Sd(){return m.useContext(Ed)}function Cd(e){let t=Sd(),n=m.useContext($s),[r,o]=m.useState(()=>{var i;if(!t&&n!==null)return(i=n.current)!=null?i:null;if(Qe.isServer)return null;let l=e==null?void 0:e.getElementById("headlessui-portal-root");if(l)return l;if(e===null)return null;let u=e.createElement("div");return u.setAttribute("id","headlessui-portal-root"),e.body.appendChild(u)});return m.useEffect(()=>{r!==null&&(e!=null&&e.body.contains(r)||e==null||e.body.appendChild(r))},[r,e]),m.useEffect(()=>{t||n!==null&&o(n.current)},[n,o,t]),r}let As=m.Fragment,Od=Te(function(e,t){let{ownerDocument:n=null,...r}=e,o=m.useRef(null),i=We(Tu(f=>{o.current=f}),t),l=Ar(o),u=n??l,s=Cd(u),[a]=m.useState(()=>{var f;return Qe.isServer?null:(f=u==null?void 0:u.createElement("div"))!=null?f:null}),c=m.useContext(Ld),d=Qr();ue(()=>{!s||!a||s.contains(a)||(a.setAttribute("data-headlessui-portal",""),s.appendChild(a))},[s,a]),ue(()=>{if(a&&c)return c.register(a)},[c,a]),Ls(()=>{var f;!s||!a||(vr(a)&&s.contains(a)&&s.removeChild(a),s.childNodes.length<=0&&((f=s.parentElement)==null||f.removeChild(s)))});let p=Me();return d?!s||!a?null:we.createPortal(p({ourProps:{ref:i},theirProps:r,slot:{},defaultTag:As,name:"Portal"}),a):null});function Td(e,t){let n=We(t),{enabled:r=!0,ownerDocument:o,...i}=e,l=Me();return r?m.createElement(Od,{...i,ownerDocument:o,ref:n}):l({ourProps:{ref:n},theirProps:i,slot:{},defaultTag:As,name:"Portal"})}let Nd=m.Fragment,$s=m.createContext(null);function Pd(e,t){let{target:n,...r}=e,o={ref:We(t)},i=Me();return m.createElement($s.Provider,{value:n},i({ourProps:o,theirProps:r,defaultTag:Nd,name:"Popover.Group"}))}let Ld=m.createContext(null),Ad=Te(Td),$d=Te(Pd),Dd=Object.assign(Ad,{Group:$d});function Md(){let e=m.useRef(!1);return ue(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function Ds(e){var t;return!!(e.enter||e.enterFrom||e.enterTo||e.leave||e.leaveFrom||e.leaveTo)||((t=e.as)!=null?t:Is)!==m.Fragment||m.Children.count(e.children)===1}let jn=m.createContext(null);jn.displayName="TransitionContext";var Id=(e=>(e.Visible="visible",e.Hidden="hidden",e))(Id||{});function jd(){let e=m.useContext(jn);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}function Fd(){let e=m.useContext(Fn);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}let Fn=m.createContext(null);Fn.displayName="NestingContext";function Rn(e){return"children"in e?Rn(e.children):e.current.filter(({el:t})=>t.current!==null).filter(({state:t})=>t==="visible").length>0}function Ms(e,t){let n=Ot(e),r=m.useRef([]),o=Md(),i=$t(),l=ne((f,g=vt.Hidden)=>{let v=r.current.findIndex(({el:E})=>E===f);v!==-1&&(_e(g,{[vt.Unmount](){r.current.splice(v,1)},[vt.Hidden](){r.current[v].state="hidden"}}),i.microTask(()=>{var E;!Rn(r)&&o.current&&((E=n.current)==null||E.call(n))}))}),u=ne(f=>{let g=r.current.find(({el:v})=>v===f);return g?g.state!=="visible"&&(g.state="visible"):r.current.push({el:f,state:"visible"}),()=>l(f,vt.Unmount)}),s=m.useRef([]),a=m.useRef(Promise.resolve()),c=m.useRef({enter:[],leave:[]}),d=ne((f,g,v)=>{s.current.splice(0),t&&(t.chains.current[g]=t.chains.current[g].filter(([E])=>E!==f)),t==null||t.chains.current[g].push([f,new Promise(E=>{s.current.push(E)})]),t==null||t.chains.current[g].push([f,new Promise(E=>{Promise.all(c.current[g].map(([M,w])=>w)).then(()=>E())})]),g==="enter"?a.current=a.current.then(()=>t==null?void 0:t.wait.current).then(()=>v(g)):v(g)}),p=ne((f,g,v)=>{Promise.all(c.current[g].splice(0).map(([E,M])=>M)).then(()=>{var E;(E=s.current.shift())==null||E()}).then(()=>v(g))});return m.useMemo(()=>({children:r,register:u,unregister:l,onStart:d,onStop:p,wait:a,chains:c}),[u,l,r,d,p,c,a])}let Is=m.Fragment,js=gn.RenderStrategy;function Rd(e,t){var n,r;let{transition:o=!0,beforeEnter:i,afterEnter:l,beforeLeave:u,afterLeave:s,enter:a,enterFrom:c,enterTo:d,entered:p,leave:f,leaveFrom:g,leaveTo:v,...E}=e,[M,w]=m.useState(null),N=m.useRef(null),j=Ds(e),F=We(...j?[N,t,w]:t===null?[]:[t]),k=(n=E.unmount)==null||n?vt.Unmount:vt.Hidden,{show:W,appear:h,initial:b}=jd(),[x,$]=m.useState(W?"visible":"hidden"),A=Fd(),{register:P,unregister:S}=A;ue(()=>P(N),[P,N]),ue(()=>{if(k===vt.Hidden&&N.current){if(W&&x!=="visible"){$("visible");return}return _e(x,{hidden:()=>S(N),visible:()=>P(N)})}},[x,N,P,S,W,k]);let O=Qr();ue(()=>{if(j&&O&&x==="visible"&&N.current===null)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[N,x,O,j]);let T=b&&!h,L=h&&W&&b,y=m.useRef(!1),I=Ms(()=>{y.current||($("hidden"),S(N))},A),_=ne(H=>{y.current=!0;let Z=H?"enter":"leave";I.onStart(N,Z,ae=>{ae==="enter"?i==null||i():ae==="leave"&&(u==null||u())})}),V=ne(H=>{let Z=H?"enter":"leave";y.current=!1,I.onStop(N,Z,ae=>{ae==="enter"?l==null||l():ae==="leave"&&(s==null||s())}),Z==="leave"&&!Rn(I)&&($("hidden"),S(N))});m.useEffect(()=>{j&&o||(_(W),V(W))},[W,j,o]);let z=!(!o||!j||!O||T),[,G]=Bi(z,M,W,{start:_,end:V}),q=bt({ref:F,className:((r=mr(E.className,L&&a,L&&c,G.enter&&a,G.enter&&G.closed&&c,G.enter&&!G.closed&&d,G.leave&&f,G.leave&&!G.closed&&g,G.leave&&G.closed&&v,!G.transition&&W&&p))==null?void 0:r.trim())||void 0,...Wi(G)}),B=0;x==="visible"&&(B|=qe.Open),x==="hidden"&&(B|=qe.Closed),W&&x==="hidden"&&(B|=qe.Opening),!W&&x==="visible"&&(B|=qe.Closing);let K=Me();return m.createElement(Fn.Provider,{value:I},m.createElement(Ns,{value:B},K({ourProps:q,theirProps:E,defaultTag:Is,features:js,visible:x==="visible",name:"Transition.Child"})))}function kd(e,t){let{show:n,appear:r=!1,unmount:o=!0,...i}=e,l=m.useRef(null),u=Ds(e),s=We(...u?[l,t]:t===null?[]:[t]);Qr();let a=Xr();if(n===void 0&&a!==null&&(n=(a&qe.Open)===qe.Open),n===void 0)throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");let[c,d]=m.useState(n?"visible":"hidden"),p=Ms(()=>{n||d("hidden")}),[f,g]=m.useState(!0),v=m.useRef([n]);ue(()=>{f!==!1&&v.current[v.current.length-1]!==n&&(v.current.push(n),g(!1))},[v,n]);let E=m.useMemo(()=>({show:n,appear:r,initial:f}),[n,r,f]);ue(()=>{n?d("visible"):!Rn(p)&&l.current!==null&&d("hidden")},[n,p]);let M={unmount:o},w=ne(()=>{var F;f&&g(!1),(F=e.beforeEnter)==null||F.call(e)}),N=ne(()=>{var F;f&&g(!1),(F=e.beforeLeave)==null||F.call(e)}),j=Me();return m.createElement(Fn.Provider,{value:p},m.createElement(jn.Provider,{value:E},j({ourProps:{...M,as:m.Fragment,children:m.createElement(Fs,{ref:s,...M,...i,beforeEnter:w,beforeLeave:N})},theirProps:{},defaultTag:m.Fragment,features:js,visible:c==="visible",name:"Transition"})))}function _d(e,t){let n=m.useContext(jn)!==null,r=Xr()!==null;return m.createElement(m.Fragment,null,!n&&r?m.createElement(Jr,{ref:t,...e}):m.createElement(Fs,{ref:t,...e}))}let Jr=Te(kd),Fs=Te(Rd),Wd=Te(_d),Rs=Object.assign(Jr,{Child:Wd,Root:Jr});function Bd(e,t){let n=m.useRef({left:0,top:0});if(ue(()=>{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 ks=/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g;function _s(e){var t,n;let r=(t=e.innerText)!=null?t:"",o=e.cloneNode(!0);if(!at(o))return r;let i=!1;for(let u of o.querySelectorAll('[hidden],[aria-hidden],[role="img"]'))u.remove(),i=!0;let l=i?(n=o.innerText)!=null?n:"":r;return ks.test(l)&&(l=l.replace(ks,"")),l}function Ud(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():_s(i).trim()}return null}).filter(Boolean);if(r.length>0)return r.join(", ")}return _s(e).trim()}function Vd(e){let t=m.useRef(""),n=m.useRef("");return ne(()=>{let r=e.current;if(!r)return"";let o=r.innerText;if(t.current===o)return n.current;let i=Ud(r).trim().toLowerCase();return t.current=o,n.current=i,i})}var zd=Object.defineProperty,Hd=(e,t,n)=>t in e?zd(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ws=(e,t,n)=>(Hd(e,typeof t!="symbol"?t+"":t,n),n),be=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(be||{}),tt=(e=>(e[e.Single=0]="Single",e[e.Multi=1]="Multi",e))(tt||{}),kn=(e=>(e[e.Pointer=0]="Pointer",e[e.Other=1]="Other",e))(kn||{}),Bs=(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.RegisterOptions=5]="RegisterOptions",e[e.UnregisterOptions=6]="UnregisterOptions",e[e.SetButtonElement=7]="SetButtonElement",e[e.SetOptionsElement=8]="SetOptionsElement",e[e.SortOptions=9]="SortOptions",e))(Bs||{});function Us(e,t=n=>n){let n=e.activeOptionIndex!==null?e.options[e.activeOptionIndex]:null,r=Di(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 Gd={1(e){return e.dataRef.current.disabled||e.listboxState===1?e:{...e,activeOptionIndex:null,pendingFocus:{focus:fe.Nothing},listboxState:1,__demoMode:!1}},0(e,t){if(e.dataRef.current.disabled||e.listboxState===0)return e;let n=e.activeOptionIndex,{isSelected:r}=e.dataRef.current,o=e.options.findIndex(i=>r(i.dataRef.current.value));return o!==-1&&(n=o),{...e,pendingFocus:t.focus,listboxState:0,activeOptionIndex:n,__demoMode:!1}},2(e,t){var n,r,o,i,l;if(e.dataRef.current.disabled||e.listboxState===1)return e;let u={...e,searchQuery:"",activationTrigger:(n=t.trigger)!=null?n:1,__demoMode:!1};if(t.focus===fe.Nothing)return{...u,activeOptionIndex:null};if(t.focus===fe.Specific)return{...u,activeOptionIndex:e.options.findIndex(c=>c.id===t.id)};if(t.focus===fe.Previous){let c=e.activeOptionIndex;if(c!==null){let d=e.options[c].dataRef.current.domRef,p=In(t,{resolveItems:()=>e.options,resolveActiveIndex:()=>e.activeOptionIndex,resolveId:f=>f.id,resolveDisabled:f=>f.dataRef.current.disabled});if(p!==null){let f=e.options[p].dataRef.current.domRef;if(((r=d.current)==null?void 0:r.previousElementSibling)===f.current||((o=f.current)==null?void 0:o.previousElementSibling)===null)return{...u,activeOptionIndex:p}}}}else if(t.focus===fe.Next){let c=e.activeOptionIndex;if(c!==null){let d=e.options[c].dataRef.current.domRef,p=In(t,{resolveItems:()=>e.options,resolveActiveIndex:()=>e.activeOptionIndex,resolveId:f=>f.id,resolveDisabled:f=>f.dataRef.current.disabled});if(p!==null){let f=e.options[p].dataRef.current.domRef;if(((i=d.current)==null?void 0:i.nextElementSibling)===f.current||((l=f.current)==null?void 0:l.nextElementSibling)===null)return{...u,activeOptionIndex:p}}}}let s=Us(e),a=In(t,{resolveItems:()=>s.options,resolveActiveIndex:()=>s.activeOptionIndex,resolveId:c=>c.id,resolveDisabled:c=>c.dataRef.current.disabled});return{...u,...s,activeOptionIndex:a}},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 u;return!l.dataRef.current.disabled&&((u=l.dataRef.current.textValue)==null?void 0:u.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=e.options.concat(t.options),r=e.activeOptionIndex;if(e.pendingFocus.focus!==fe.Nothing&&(r=In(e.pendingFocus,{resolveItems:()=>n,resolveActiveIndex:()=>e.activeOptionIndex,resolveId:o=>o.id,resolveDisabled:o=>o.dataRef.current.disabled})),e.activeOptionIndex===null){let{isSelected:o}=e.dataRef.current;if(o){let i=n.findIndex(l=>o==null?void 0:o(l.dataRef.current.value));i!==-1&&(r=i)}}return{...e,options:n,activeOptionIndex:r,pendingFocus:{focus:fe.Nothing},pendingShouldSort:!0}},6:(e,t)=>{let n=e.options,r=[],o=new Set(t.options);for(let[i,l]of n.entries())if(o.has(l.id)&&(r.push(i),o.delete(l.id),o.size===0))break;if(r.length>0){n=n.slice();for(let i of r.reverse())n.splice(i,1)}return{...e,options: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},9:e=>e.pendingShouldSort?{...e,...Us(e),pendingShouldSort:!1}:e};class Zr extends yi{constructor(t){super(t),Ws(this,"actions",{onChange:n=>{let{onChange:r,compare:o,mode:i,value:l}=this.state.dataRef.current;return _e(i,{0:()=>r==null?void 0:r(n),1:()=>{let u=l.slice(),s=u.findIndex(a=>o(a,n));return s===-1?u.push(n):u.splice(s,1),r==null?void 0:r(u)}})},registerOption:wr(()=>{let n=[],r=new Set;return[(o,i)=>{r.has(i)||(r.add(i),n.push({id:o,dataRef:i}))},()=>(r.clear(),this.send({type:5,options:n.splice(0)}))]}),unregisterOption:wr(()=>{let n=[];return[r=>n.push(r),()=>{this.send({type:6,options:n.splice(0)})}]}),goToOption:wr(()=>{let n=null;return[(r,o)=>{n={type:2,...r,trigger:o}},()=>n&&this.send(n)]}),closeListbox:()=>{this.send({type:1})},openListbox:n=>{this.send({type:0,focus:n})},selectActiveOption:()=>{if(this.state.activeOptionIndex!==null){let{dataRef:n,id:r}=this.state.options[this.state.activeOptionIndex];this.actions.onChange(n.current.value),this.send({type:2,focus:fe.Specific,id:r})}},selectOption:n=>{let r=this.state.options.find(o=>o.id===n);r&&this.actions.onChange(r.dataRef.current.value)},search:n=>{this.send({type:3,value:n})},clearSearch:()=>{this.send({type:4})},setButtonElement:n=>{this.send({type:7,element:n})},setOptionsElement:n=>{this.send({type:8,element:n})}}),Ws(this,"selectors",{activeDescendantId(n){var r;let o=n.activeOptionIndex,i=n.options;return o===null||(r=i[o])==null?void 0:r.id},isActive(n,r){var o;let i=n.activeOptionIndex,l=n.options;return i!==null?((o=l[i])==null?void 0:o.id)===r:!1},shouldScrollIntoView(n,r){return n.__demoMode||n.listboxState!==0||n.activationTrigger===0?!1:this.isActive(n,r)}}),this.on(5,()=>{requestAnimationFrame(()=>{this.send({type:9})})});{let n=this.state.id,r=Er.get(null);this.disposables.add(r.on(Ci.Push,o=>{!r.selectors.isTop(o,n)&&this.state.listboxState===0&&this.actions.closeListbox()})),this.on(0,()=>r.actions.push(n)),this.on(1,()=>r.actions.pop(n))}}static new({id:t,__demoMode:n=!1}){return new Zr({id:t,dataRef:{current:{}},listboxState:n?0:1,options:[],searchQuery:"",activeOptionIndex:null,activationTrigger:1,buttonElement:null,optionsElement:null,pendingShouldSort:!1,pendingFocus:{focus:fe.Nothing},__demoMode:n})}reduce(t,n){return _e(n.type,Gd,t,n)}}const Vs=m.createContext(null);function eo(e){let t=m.useContext(Vs);if(t===null){let n=new Error(`<${e} /> is missing a parent <Listbox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,zs),n}return t}function zs({id:e,__demoMode:t=!1}){let n=m.useMemo(()=>Zr.new({id:e,__demoMode:t}),[]);return Ls(()=>n.dispose()),n}let _n=m.createContext(null);_n.displayName="ListboxDataContext";function nn(e){let t=m.useContext(_n);if(t===null){let n=new Error(`<${e} /> is missing a parent <Listbox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,nn),n}return t}let Yd=m.Fragment;function Kd(e,t){let n=m.useId(),r=pr(),{value:o,defaultValue:i,form:l,name:u,onChange:s,by:a,invalid:c=!1,disabled:d=r||!1,horizontal:p=!1,multiple:f=!1,__demoMode:g=!1,...v}=e;const E=p?"horizontal":"vertical";let M=We(t),w=fu(i),[N=f?[]:void 0,j]=cu(o,s,w),F=zs({id:n,__demoMode:g}),k=m.useRef({static:!1,hold:!1}),W=m.useRef(new Map),h=Ru(a),b=m.useCallback(z=>_e(x.mode,{[tt.Multi]:()=>N.some(G=>h(G,z)),[tt.Single]:()=>h(N,z)}),[N]),x=m.useMemo(()=>({value:N,disabled:d,invalid:c,mode:f?tt.Multi:tt.Single,orientation:E,onChange:j,compare:h,isSelected:b,optionsPropsRef:k,listRef:W}),[N,d,c,f,E,j,h,b,k,W]);ue(()=>{F.state.dataRef.current=x},[x]);let $=Ue(F,z=>z.listboxState),A=Er.get(null),P=Ue(A,m.useCallback(z=>A.selectors.isTop(z,n),[A,n])),[S,O]=Ue(F,z=>[z.buttonElement,z.optionsElement]);cc(P,[S,O],(z,G)=>{F.send({type:Bs.CloseListbox}),$i(G,Lr.Loose)||(z.preventDefault(),S==null||S.focus())});let T=m.useMemo(()=>({open:$===be.Open,disabled:d,invalid:c,value:N}),[$,d,c,N]),[L,y]=$u({inherit:!0}),I={ref:M},_=m.useCallback(()=>{if(w!==void 0)return j==null?void 0:j(w)},[j,w]),V=Me();return m.createElement(y,{value:L,props:{htmlFor:S==null?void 0:S.id},slot:{open:$===be.Open,disabled:d}},m.createElement(gd,null,m.createElement(Vs.Provider,{value:F},m.createElement(_n.Provider,{value:x},m.createElement(Ns,{value:_e($,{[be.Open]:qe.Open,[be.Closed]:qe.Closed})},u!=null&&N!=null&&m.createElement(vu,{disabled:d,data:{[u]:N},form:l,onReset:_}),V({ourProps:I,theirProps:v,slot:T,defaultTag:Yd,name:"Listbox"}))))))}let qd="button";function Xd(e,t){let n=m.useId(),r=ui(),o=nn("Listbox.Button"),i=eo("Listbox.Button"),{id:l=r||`headlessui-listbox-button-${n}`,disabled:u=o.disabled||!1,autoFocus:s=!1,...a}=e,c=We(t,dd(),i.actions.setButtonElement),d=pd(),[p,f,g]=Ue(i,y=>[y.listboxState,y.buttonElement,y.optionsElement]),v=p===be.Open;pc(v,{trigger:f,action:m.useCallback(y=>{if(f!=null&&f.contains(y.target))return yn.Ignore;let I=y.target.closest('[role="option"]:not([data-disabled])');return at(I)?yn.Select(I):g!=null&&g.contains(y.target)?yn.Ignore:yn.Close},[f,g]),close:i.actions.closeListbox,select:i.actions.selectActiveOption});let E=ne(y=>{switch(y.key){case ve.Enter:du(y.currentTarget);break;case ve.Space:case ve.ArrowDown:y.preventDefault(),i.actions.openListbox({focus:o.value?fe.Nothing:fe.First});break;case ve.ArrowUp:y.preventDefault(),i.actions.openListbox({focus:o.value?fe.Nothing:fe.Last});break}}),M=ne(y=>{switch(y.key){case ve.Space:y.preventDefault();break}}),w=ne(y=>{var I;if(y.button===Ps.Left){if(Cu(y.currentTarget))return y.preventDefault();i.state.listboxState===be.Open?(we.flushSync(()=>i.actions.closeListbox()),(I=i.state.buttonElement)==null||I.focus({preventScroll:!0})):(y.preventDefault(),i.actions.openListbox({focus:fe.Nothing}))}}),N=m.useRef(null),j=ne(y=>{N.current=y.pointerType,y.pointerType==="mouse"&&w(y)}),F=ne(y=>{N.current!=="mouse"&&w(y)}),k=ne(y=>y.preventDefault()),W=gi([l]),h=Nu(),{isFocusVisible:b,focusProps:x}=Ja({autoFocus:s}),{isHovered:$,hoverProps:A}=Qa({isDisabled:u}),{pressed:P,pressProps:S}=ou({disabled:u}),O=m.useMemo(()=>({open:p===be.Open,active:P||p===be.Open,disabled:u,invalid:o.invalid,value:o.value,hover:$,focus:b,autofocus:s}),[p,o.value,u,$,b,P,o.invalid,s]),T=Ue(i,y=>y.listboxState===be.Open),L=oi(d(),{ref:c,id:l,type:mc(e,f),"aria-haspopup":"listbox","aria-controls":g==null?void 0:g.id,"aria-expanded":T,"aria-labelledby":W,"aria-describedby":h,disabled:u||void 0,autoFocus:s,onKeyDown:E,onKeyUp:M,onKeyPress:k,onPointerDown:j,onClick:F},x,A,S);return Me()({ourProps:L,theirProps:a,slot:O,defaultTag:qd,name:"Listbox.Button"})}let Hs=m.createContext(!1),Qd="div",Jd=gn.RenderStrategy|gn.Static;function Zd(e,t){let n=m.useId(),{id:r=`headlessui-listbox-options-${n}`,anchor:o,portal:i=!1,modal:l=!0,transition:u=!1,...s}=e,a=fd(o),[c,d]=m.useState(null);a&&(i=!0);let p=nn("Listbox.Options"),f=eo("Listbox.Options"),[g,v,E,M]=Ue(f,H=>[H.listboxState,H.buttonElement,H.optionsElement,H.__demoMode]),w=Ar(v),N=Ar(E),j=Xr(),[F,k]=Bi(u,c,j!==null?(j&qe.Open)===qe.Open:g===be.Open);Ju(F,v,f.actions.closeListbox);let W=M?!1:l&&g===be.Open;Ec(W,N);let h=M?!1:l&&g===be.Open;Qu(h,{allowed:m.useCallback(()=>[v,E],[v,E])});let b=g!==be.Open,x=Bd(b,v)?!1:F,$=F&&g===be.Closed,A=xd($,p.value),P=ne(H=>p.compare(A,H)),S=Ue(f,H=>{var Z;if(a==null||!((Z=a==null?void 0:a.to)!=null&&Z.includes("selection")))return null;let ae=H.options.findIndex(Ae=>P(Ae.dataRef.current.value));return ae===-1&&(ae=0),ae}),O=(()=>{if(a==null)return;if(S===null)return{...a,inner:void 0};let H=Array.from(p.listRef.current.values());return{...a,inner:{listRef:{current:H},index:S}}})(),[T,L]=hd(O),y=md(),I=We(t,a?T:null,f.actions.setOptionsElement,d),_=$t();m.useEffect(()=>{var H;let Z=E;Z&&g===be.Open&&Z!==((H=Kt(Z))==null?void 0:H.activeElement)&&(Z==null||Z.focus({preventScroll:!0}))},[g,E]);let V=ne(H=>{var Z,ae;switch(_.dispose(),H.key){case ve.Space:if(f.state.searchQuery!=="")return H.preventDefault(),H.stopPropagation(),f.actions.search(H.key);case ve.Enter:if(H.preventDefault(),H.stopPropagation(),f.state.activeOptionIndex!==null){let{dataRef:Ae}=f.state.options[f.state.activeOptionIndex];f.actions.onChange(Ae.current.value)}p.mode===tt.Single&&(we.flushSync(()=>f.actions.closeListbox()),(Z=f.state.buttonElement)==null||Z.focus({preventScroll:!0}));break;case _e(p.orientation,{vertical:ve.ArrowDown,horizontal:ve.ArrowRight}):return H.preventDefault(),H.stopPropagation(),f.actions.goToOption({focus:fe.Next});case _e(p.orientation,{vertical:ve.ArrowUp,horizontal:ve.ArrowLeft}):return H.preventDefault(),H.stopPropagation(),f.actions.goToOption({focus:fe.Previous});case ve.Home:case ve.PageUp:return H.preventDefault(),H.stopPropagation(),f.actions.goToOption({focus:fe.First});case ve.End:case ve.PageDown:return H.preventDefault(),H.stopPropagation(),f.actions.goToOption({focus:fe.Last});case ve.Escape:H.preventDefault(),H.stopPropagation(),we.flushSync(()=>f.actions.closeListbox()),(ae=f.state.buttonElement)==null||ae.focus({preventScroll:!0});return;case ve.Tab:H.preventDefault(),H.stopPropagation(),we.flushSync(()=>f.actions.closeListbox()),sc(f.state.buttonElement,H.shiftKey?Pr.Previous:Pr.Next);break;default:H.key.length===1&&(f.actions.search(H.key),_.setTimeout(()=>f.actions.clearSearch(),350));break}}),z=Ue(f,H=>{var Z;return(Z=H.buttonElement)==null?void 0:Z.id}),G=m.useMemo(()=>({open:g===be.Open}),[g]),q=oi(a?y():{},{id:r,ref:I,"aria-activedescendant":Ue(f,f.selectors.activeDescendantId),"aria-multiselectable":p.mode===tt.Multi?!0:void 0,"aria-labelledby":z,"aria-orientation":p.orientation,onKeyDown:V,role:"listbox",tabIndex:g===be.Open?0:void 0,style:{...s.style,...L,"--button-width":_u(v,!0).width},...Wi(k)}),B=Me(),K=m.useMemo(()=>p.mode===tt.Multi?p:{...p,isSelected:P},[p,P]);return m.createElement(Dd,{enabled:i?e.static||F:!1,ownerDocument:w},m.createElement(_n.Provider,{value:K},B({ourProps:q,theirProps:s,slot:G,defaultTag:Qd,features:Jd,visible:x,name:"Listbox.Options"})))}let ep="div";function tp(e,t){let n=m.useId(),{id:r=`headlessui-listbox-option-${n}`,disabled:o=!1,value:i,...l}=e,u=m.useContext(Hs)===!0,s=nn("Listbox.Option"),a=eo("Listbox.Option"),c=Ue(a,x=>a.selectors.isActive(x,r)),d=s.isSelected(i),p=m.useRef(null),f=Vd(p),g=Ot({disabled:o,value:i,domRef:p,get textValue(){return f()}}),v=We(t,p,x=>{x?s.listRef.current.set(r,x):s.listRef.current.delete(r)}),E=Ue(a,x=>a.selectors.shouldScrollIntoView(x,r));ue(()=>{if(E)return Ke().requestAnimationFrame(()=>{var x,$;($=(x=p.current)==null?void 0:x.scrollIntoView)==null||$.call(x,{block:"nearest"})})},[E,p]),ue(()=>{if(!u)return a.actions.registerOption(r,g),()=>a.actions.unregisterOption(r)},[g,r,u]);let M=ne(x=>{var $;if(o)return x.preventDefault();a.actions.onChange(i),s.mode===tt.Single&&(we.flushSync(()=>a.actions.closeListbox()),($=a.state.buttonElement)==null||$.focus({preventScroll:!0}))}),w=ne(()=>{if(o)return a.actions.goToOption({focus:fe.Nothing});a.actions.goToOption({focus:fe.Specific,id:r})}),N=Sc(),j=ne(x=>N.update(x)),F=ne(x=>{N.wasMoved(x)&&(o||c&&a.state.activationTrigger===kn.Pointer||a.actions.goToOption({focus:fe.Specific,id:r},kn.Pointer))}),k=ne(x=>{N.wasMoved(x)&&(o||c&&a.state.activationTrigger===kn.Pointer&&a.actions.goToOption({focus:fe.Nothing}))}),W=m.useMemo(()=>({active:c,focus:c,selected:d,disabled:o,selectedOption:d&&u}),[c,d,o,u]),h=u?{}:{id:r,ref:v,role:"option",tabIndex:o===!0?void 0:-1,"aria-disabled":o===!0?!0:void 0,"aria-selected":d,disabled:void 0,onClick:M,onFocus:w,onPointerEnter:j,onMouseEnter:j,onPointerMove:F,onMouseMove:F,onPointerLeave:k,onMouseLeave:k},b=Me();return!d&&u?null:b({ourProps:h,theirProps:l,slot:W,defaultTag:ep,name:"Listbox.Option"})}let np=m.Fragment;function rp(e,t){let{options:n,placeholder:r,...o}=e,i={ref:We(t)},l=nn("ListboxSelectedOption"),u=m.useMemo(()=>({}),[]),s=l.value===void 0||l.value===null||l.mode===tt.Multi&&Array.isArray(l.value)&&l.value.length===0,a=Me();return m.createElement(Hs.Provider,{value:!0},a({ourProps:i,theirProps:{...o,children:m.createElement(m.Fragment,null,r&&s?r:n)},slot:u,defaultTag:np,name:"ListboxSelectedOption"}))}let op=Te(Kd),ip=Te(Xd),sp=ju,lp=Te(Zd),ap=Te(tp),up=Te(rp),wt=Object.assign(op,{Button:ip,Label:sp,Options:lp,Option:ap,SelectedOption:up});function cp({title:e,titleId:t,...n},r){return R.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?R.createElement("title",{id:t},e):null,R.createElement("path",{fillRule:"evenodd",d:"M16.704 4.153a.75.75 0 0 1 .143 1.052l-8 10.5a.75.75 0 0 1-1.127.075l-4.5-4.5a.75.75 0 0 1 1.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 0 1 1.05-.143Z",clipRule:"evenodd"}))}const Gs=R.forwardRef(cp),fp=({tokens:e,selectedToken:t,onTokenChange:n,disabled:r=!1,className:o=""})=>{const{t:i}=Ye();return C.jsx("div",{className:`relative ${o}`,children:C.jsx(wt,{value:t,onChange:n,disabled:r,children:({open:l})=>C.jsxs(C.Fragment,{children:[C.jsxs(wt.Button,{className:`
|
|
83
|
+
*/var Xc=["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])"],Br=Xc.join(","),Yi=typeof Element>"u",en=Yi?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Ln=!Yi&&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},Pn=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},Qc=function(t){var n,r=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return r===""||r==="true"},Zc=function(t,n,r){if(Pn(t))return[];var o=Array.prototype.slice.apply(t.querySelectorAll(Br));return n&&en.call(t,Br)&&o.unshift(t),o=o.filter(r),o},Jc=function e(t,n,r){for(var o=[],i=Array.from(t);i.length;){var l=i.shift();if(!Pn(l,!1))if(l.tagName==="SLOT"){var u=l.assignedElements(),s=u.length?u:l.children,a=e(s,!0,r);r.flatten?o.push.apply(o,a):o.push({scopeParent:l,candidates:a})}else{var c=en.call(l,Br);c&&r.filter(l)&&(n||!t.includes(l))&&o.push(l);var d=l.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(l),p=!Pn(d,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(l));if(d&&p){var f=e(d===!0?l.children:d.children,!0,r);r.flatten?o.push.apply(o,f):o.push({scopeParent:l,candidates:f})}else i.unshift.apply(i,l.children)}}return o},Ki=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},qi=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||Qc(t))&&!Ki(t)?0:t.tabIndex},ef=function(t,n){var r=qi(t);return r<0&&n&&!Ki(t)?0:r},tf=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},Xi=function(t){return t.tagName==="INPUT"},nf=function(t){return Xi(t)&&t.type==="hidden"},rf=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return n},of=function(t,n){for(var r=0;r<t.length;r++)if(t[r].checked&&t[r].form===n)return t[r]},sf=function(t){if(!t.name)return!0;var n=t.form||Ln(t),r=function(u){return n.querySelectorAll('input[type="radio"][name="'+u+'"]')},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=of(o,t.form);return!i||i===t},lf=function(t){return Xi(t)&&t.type==="radio"},af=function(t){return lf(t)&&!sf(t)},uf=function(t){var n,r=t&&Ln(t),o=(n=r)===null||n===void 0?void 0:n.host,i=!1;if(r&&r!==t){var l,u,s;for(i=!!((l=o)!==null&&l!==void 0&&(u=l.ownerDocument)!==null&&u!==void 0&&u.contains(o)||t!=null&&(s=t.ownerDocument)!==null&&s!==void 0&&s.contains(t));!i&&o;){var a,c,d;r=Ln(o),o=(a=r)===null||a===void 0?void 0:a.host,i=!!((c=o)!==null&&c!==void 0&&(d=c.ownerDocument)!==null&&d!==void 0&&d.contains(o))}}return i},Qi=function(t){var n=t.getBoundingClientRect(),r=n.width,o=n.height;return r===0&&o===0},cf=function(t,n){var r=n.displayCheck,o=n.getShadowRoot;if(getComputedStyle(t).visibility==="hidden")return!0;var i=en.call(t,"details>summary:first-of-type"),l=i?t.parentElement:t;if(en.call(l,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="legacy-full"){if(typeof o=="function"){for(var u=t;t;){var s=t.parentElement,a=Ln(t);if(s&&!s.shadowRoot&&o(s)===!0)return Qi(t);t.assignedSlot?t=t.assignedSlot:!s&&a!==t.ownerDocument?t=a.host:t=s}t=u}if(uf(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return Qi(t);return!1},ff=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 en.call(n,"fieldset[disabled] *")?!0:!o.contains(t)}return!0}n=n.parentElement}return!1},df=function(t,n){return!(n.disabled||Pn(n)||nf(n)||cf(n,t)||rf(n)||ff(n))},Zi=function(t,n){return!(af(n)||qi(n)<0||!df(t,n))},pf=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},mf=function e(t){var n=[],r=[];return t.forEach(function(o,i){var l=!!o.scopeParent,u=l?o.scopeParent:o,s=ef(u,l),a=l?e(o.candidates):u;s===0?l?n.push.apply(n,a):n.push(u):r.push({documentOrder:i,tabIndex:s,item:o,isScope:l,content:a})}),r.sort(tf).reduce(function(o,i){return i.isScope?o.push.apply(o,i.content):o.push(i.content),o},[]).concat(n)},Ji=function(t,n){n=n||{};var r;return n.getShadowRoot?r=Jc([t],n.includeContainer,{filter:Zi.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:pf}):r=Zc(t,n.includeContainer,Zi.bind(null,n)),mf(r)};function es(e,t,n){let{reference:r,floating:o}=e;const i=dt(t),l=kr(t),u=Rr(l),s=xt(t),a=i==="y",c=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,p=r[u]/2-o[u]/2;let f;switch(s){case"top":f={x:c,y:r.y-o.height};break;case"bottom":f={x:c,y:r.y+r.height};break;case"right":f={x:r.x+r.width,y:d};break;case"left":f={x:r.x-o.width,y:d};break;default:f={x:r.x,y:r.y}}switch(jt(t)){case"start":f[l]-=p*(n&&a?-1:1);break;case"end":f[l]+=p*(n&&a?-1:1);break}return f}const hf=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:l}=n,u=i.filter(Boolean),s=await(l.isRTL==null?void 0:l.isRTL(t));let a=await l.getElementRects({reference:e,floating:t,strategy:o}),{x:c,y:d}=es(a,r,s),p=r,f={},g=0;for(let v=0;v<u.length;v++){const{name:E,fn:M}=u[v],{x:w,y:N,data:F,reset:j}=await M({x:c,y:d,initialPlacement:r,placement:p,strategy:o,middlewareData:f,rects:a,platform:l,elements:{reference:e,floating:t}});c=w??c,d=N??d,f={...f,[E]:{...f[E],...F}},j&&g<=50&&(g++,typeof j=="object"&&(j.placement&&(p=j.placement),j.rects&&(a=j.rects===!0?await l.getElementRects({reference:e,floating:t,strategy:o}):j.rects),{x:c,y:d}=es(a,p,s)),v=-1)}return{x:c,y:d,placement:p,strategy:o,middlewareData:f}};async function Dn(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:i,rects:l,elements:u,strategy:s}=e,{boundary:a="clippingAncestors",rootBoundary:c="viewport",elementContext:d="floating",altBoundary:p=!1,padding:f=0}=Nt(t,e),g=Gi(f),E=u[p?d==="floating"?"reference":"floating":d],M=Nn(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(E)))==null||n?E:E.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(u.floating)),boundary:a,rootBoundary:c,strategy:s})),w=d==="floating"?{x:r,y:o,width:l.floating.width,height:l.floating.height}:l.reference,N=await(i.getOffsetParent==null?void 0:i.getOffsetParent(u.floating)),F=await(i.isElement==null?void 0:i.isElement(N))?await(i.getScale==null?void 0:i.getScale(N))||{x:1,y:1}:{x:1,y:1},j=Nn(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:u,rect:w,offsetParent:N,strategy:s}):w);return{top:(M.top-j.top+g.top)/F.y,bottom:(j.bottom-M.bottom+g.bottom)/F.y,left:(M.left-j.left+g.left)/F.x,right:(j.right-M.right+g.right)/F.x}}const gf=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:l,elements:u,middlewareData:s}=t,{element:a,padding:c=0}=Nt(e,t)||{};if(a==null)return{};const d=Gi(c),p={x:n,y:r},f=kr(o),g=Rr(f),v=await l.getDimensions(a),E=f==="y",M=E?"top":"left",w=E?"bottom":"right",N=E?"clientHeight":"clientWidth",F=i.reference[g]+i.reference[f]-p[f]-i.floating[g],j=p[f]-i.reference[f],k=await(l.getOffsetParent==null?void 0:l.getOffsetParent(a));let B=k?k[N]:0;(!B||!await(l.isElement==null?void 0:l.isElement(k)))&&(B=u.floating[N]||i.floating[g]);const h=F/2-j/2,b=B/2-v[g]/2-1,y=ft(d[M],b),$=ft(d[w],b),D=y,L=B-v[g]-$,C=B/2-v[g]/2+h,O=Fr(D,C,L),T=!s.arrow&&jt(o)!=null&&C!==O&&i.reference[g]/2-(C<D?y:$)-v[g]/2<0,P=T?C<D?C-D:C-L:0;return{[f]:p[f]+P,data:{[f]:O,centerOffset:C-O-P,...T&&{alignmentOffset:P}},reset:T}}}),vf=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:u,platform:s,elements:a}=t,{mainAxis:c=!0,crossAxis:d=!0,fallbackPlacements:p,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:v=!0,...E}=Nt(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const M=xt(o),w=dt(u),N=xt(u)===u,F=await(s.isRTL==null?void 0:s.isRTL(a.floating)),j=p||(N||!v?[Tn(u)]:zc(u)),k=g!=="none";!p&&k&&j.push(...Kc(u,v,g,F));const B=[u,...j],h=await Dn(t,E),b=[];let y=((r=i.flip)==null?void 0:r.overflows)||[];if(c&&b.push(h[M]),d){const C=Vc(o,l,F);b.push(h[C[0]],h[C[1]])}if(y=[...y,{placement:o,overflows:b}],!b.every(C=>C<=0)){var $,D;const C=((($=i.flip)==null?void 0:$.index)||0)+1,O=B[C];if(O&&(!(d==="alignment"?w!==dt(O):!1)||y.every(x=>dt(x.placement)===w?x.overflows[0]>0:!0)))return{data:{index:C,overflows:y},reset:{placement:O}};let T=(D=y.filter(P=>P.overflows[0]<=0).sort((P,x)=>P.overflows[1]-x.overflows[1])[0])==null?void 0:D.placement;if(!T)switch(f){case"bestFit":{var L;const P=(L=y.filter(x=>{if(k){const I=dt(x.placement);return I===w||I==="y"}return!0}).map(x=>[x.placement,x.overflows.filter(I=>I>0).reduce((I,_)=>I+_,0)]).sort((x,I)=>x[1]-I[1])[0])==null?void 0:L[0];P&&(T=P);break}case"initialPlacement":T=u;break}if(o!==T)return{reset:{placement:T}}}return{}}}},bf=new Set(["left","top"]);async function yf(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),l=xt(n),u=jt(n),s=dt(n)==="y",a=bf.has(l)?-1:1,c=i&&s?-1:1,d=Nt(t,e);let{mainAxis:p,crossAxis:f,alignmentAxis:g}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return u&&typeof g=="number"&&(f=u==="end"?g*-1:g),s?{x:f*c,y:p*a}:{x:p*a,y:f*c}}const xf=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:u}=t,s=await yf(t,e);return l===((n=u.offset)==null?void 0:n.placement)&&(r=u.arrow)!=null&&r.alignmentOffset?{}:{x:o+s.x,y:i+s.y,data:{...s,placement:l}}}}},wf=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:u={fn:E=>{let{x:M,y:w}=E;return{x:M,y:w}}},...s}=Nt(e,t),a={x:n,y:r},c=await Dn(t,s),d=dt(xt(o)),p=Vi(d);let f=a[p],g=a[d];if(i){const E=p==="y"?"top":"left",M=p==="y"?"bottom":"right",w=f+c[E],N=f-c[M];f=Fr(w,f,N)}if(l){const E=d==="y"?"top":"left",M=d==="y"?"bottom":"right",w=g+c[E],N=g-c[M];g=Fr(w,g,N)}const v=u.fn({...t,[p]:f,[d]:g});return{...v,data:{x:v.x-n,y:v.y-r,enabled:{[p]:i,[d]:l}}}}}},Ef=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:u}=t,{apply:s=()=>{},...a}=Nt(e,t),c=await Dn(t,a),d=xt(o),p=jt(o),f=dt(o)==="y",{width:g,height:v}=i.floating;let E,M;d==="top"||d==="bottom"?(E=d,M=p===(await(l.isRTL==null?void 0:l.isRTL(u.floating))?"start":"end")?"left":"right"):(M=d,E=p==="end"?"top":"bottom");const w=v-c.top-c.bottom,N=g-c.left-c.right,F=ft(v-c[E],w),j=ft(g-c[M],N),k=!t.middlewareData.shift;let B=F,h=j;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(h=N),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(B=w),k&&!p){const y=we(c.left,0),$=we(c.right,0),D=we(c.top,0),L=we(c.bottom,0);f?h=g-2*(y!==0||$!==0?y+$:we(c.left,c.right)):B=v-2*(D!==0||L!==0?D+L:we(c.top,c.bottom))}await s({...t,availableWidth:h,availableHeight:B});const b=await l.getDimensions(u.floating);return g!==b.width||v!==b.height?{reset:{rects:!0}}:{}}}};function ts(e){const t=Ve(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Ce(e),i=o?e.offsetWidth:n,l=o?e.offsetHeight:r,u=Jt(n)!==i||Jt(r)!==l;return u&&(n=i,r=l),{width:n,height:r,$:u}}function Wr(e){return oe(e)?e:e.contextElement}function Ft(e){const t=Wr(e);if(!Ce(t))return et(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=ts(t);let l=(i?Jt(n.width):n.width)/r,u=(i?Jt(n.height):n.height)/o;return(!l||!Number.isFinite(l))&&(l=1),(!u||!Number.isFinite(u))&&(u=1),{x:l,y:u}}const Sf=et(0);function ns(e){const t=Le(e);return!Sn()||!t.visualViewport?Sf:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Cf(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Le(e)?!1:t}function Lt(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=Wr(e);let l=et(1);t&&(r?oe(r)&&(l=Ft(r)):l=Ft(e));const u=Cf(i,n,r)?ns(i):et(0);let s=(o.left+u.x)/l.x,a=(o.top+u.y)/l.y,c=o.width/l.x,d=o.height/l.y;if(i){const p=Le(i),f=r&&oe(r)?Le(r):r;let g=p,v=jr(g);for(;v&&r&&f!==g;){const E=Ft(v),M=v.getBoundingClientRect(),w=Ve(v),N=M.left+(v.clientLeft+parseFloat(w.paddingLeft))*E.x,F=M.top+(v.clientTop+parseFloat(w.paddingTop))*E.y;s*=E.x,a*=E.y,c*=E.x,d*=E.y,s+=N,a+=F,g=Le(v),v=jr(g)}}return Nn({width:c,height:d,x:s,y:a})}function $n(e,t){const n=Cn(e).scrollLeft;return t?t.left+n:Lt(Je(e)).left+n}function rs(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-$n(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function Of(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i=o==="fixed",l=Je(r),u=t?En(t.floating):!1;if(r===l||u&&i)return n;let s={scrollLeft:0,scrollTop:0},a=et(1);const c=et(0),d=Ce(r);if((d||!d&&!i)&&((It(r)!=="body"||Zt(l))&&(s=Cn(r)),Ce(r))){const f=Lt(r);a=Ft(r),c.x=f.x+r.clientLeft,c.y=f.y+r.clientTop}const p=l&&!d&&!i?rs(l,s):et(0);return{width:n.width*a.x,height:n.height*a.y,x:n.x*a.x-s.scrollLeft*a.x+c.x+p.x,y:n.y*a.y-s.scrollTop*a.y+c.y+p.y}}function Tf(e){return Array.from(e.getClientRects())}function Nf(e){const t=Je(e),n=Cn(e),r=e.ownerDocument.body,o=we(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=we(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let l=-n.scrollLeft+$n(e);const u=-n.scrollTop;return Ve(r).direction==="rtl"&&(l+=we(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:l,y:u}}const os=25;function Lf(e,t){const n=Le(e),r=Je(e),o=n.visualViewport;let i=r.clientWidth,l=r.clientHeight,u=0,s=0;if(o){i=o.width,l=o.height;const c=Sn();(!c||c&&t==="fixed")&&(u=o.offsetLeft,s=o.offsetTop)}const a=$n(r);if(a<=0){const c=r.ownerDocument,d=c.body,p=getComputedStyle(d),f=c.compatMode==="CSS1Compat"&&parseFloat(p.marginLeft)+parseFloat(p.marginRight)||0,g=Math.abs(r.clientWidth-d.clientWidth-f);g<=os&&(i-=g)}else a<=os&&(i+=a);return{width:i,height:l,x:u,y:s}}const Pf=new Set(["absolute","fixed"]);function Df(e,t){const n=Lt(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=Ce(e)?Ft(e):et(1),l=e.clientWidth*i.x,u=e.clientHeight*i.y,s=o*i.x,a=r*i.y;return{width:l,height:u,x:s,y:a}}function is(e,t,n){let r;if(t==="viewport")r=Lf(e,n);else if(t==="document")r=Nf(Je(e));else if(oe(t))r=Df(t,n);else{const o=ns(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Nn(r)}function ss(e,t){const n=ct(e);return n===t||!oe(n)||ut(n)?!1:Ve(n).position==="fixed"||ss(n,t)}function $f(e,t){const n=t.get(e);if(n)return n;let r=yt(e,[],!1).filter(u=>oe(u)&&It(u)!=="body"),o=null;const i=Ve(e).position==="fixed";let l=i?ct(e):e;for(;oe(l)&&!ut(l);){const u=Ve(l),s=Ir(l);!s&&u.position==="fixed"&&(o=null),(i?!s&&!o:!s&&u.position==="static"&&!!o&&Pf.has(o.position)||Zt(l)&&!s&&ss(e,l))?r=r.filter(c=>c!==l):o=u,l=ct(l)}return t.set(e,r),r}function Af(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const l=[...n==="clippingAncestors"?En(t)?[]:$f(t,this._c):[].concat(n),r],u=l[0],s=l.reduce((a,c)=>{const d=is(t,c,o);return a.top=we(d.top,a.top),a.right=ft(d.right,a.right),a.bottom=ft(d.bottom,a.bottom),a.left=we(d.left,a.left),a},is(t,u,o));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}}function Mf(e){const{width:t,height:n}=ts(e);return{width:t,height:n}}function If(e,t,n){const r=Ce(t),o=Je(t),i=n==="fixed",l=Lt(e,!0,i,t);let u={scrollLeft:0,scrollTop:0};const s=et(0);function a(){s.x=$n(o)}if(r||!r&&!i)if((It(t)!=="body"||Zt(o))&&(u=Cn(t)),r){const f=Lt(t,!0,i,t);s.x=f.x+t.clientLeft,s.y=f.y+t.clientTop}else o&&a();i&&!r&&o&&a();const c=o&&!r&&!i?rs(o,u):et(0),d=l.left+u.scrollLeft-s.x-c.x,p=l.top+u.scrollTop-s.y-c.y;return{x:d,y:p,width:l.width,height:l.height}}function Ur(e){return Ve(e).position==="static"}function ls(e,t){if(!Ce(e)||Ve(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Je(e)===n&&(n=n.ownerDocument.body),n}function as(e,t){const n=Le(e);if(En(e))return n;if(!Ce(e)){let o=ct(e);for(;o&&!ut(o);){if(oe(o)&&!Ur(o))return o;o=ct(o)}return n}let r=ls(e,t);for(;r&&Ac(r)&&Ur(r);)r=ls(r,t);return r&&ut(r)&&Ur(r)&&!Ir(r)?n:r||Rc(e)||n}const jf=async function(e){const t=this.getOffsetParent||as,n=this.getDimensions,r=await n(e.floating);return{reference:If(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Ff(e){return Ve(e).direction==="rtl"}const Rf={convertOffsetParentRelativeRectToViewportRelativeRect:Of,getDocumentElement:Je,getClippingRect:Af,getOffsetParent:as,getElementRects:jf,getClientRects:Tf,getDimensions:Mf,getScale:Ft,isElement:oe,isRTL:Ff};function us(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function kf(e,t){let n=null,r;const o=Je(e);function i(){var u;clearTimeout(r),(u=n)==null||u.disconnect(),n=null}function l(u,s){u===void 0&&(u=!1),s===void 0&&(s=1),i();const a=e.getBoundingClientRect(),{left:c,top:d,width:p,height:f}=a;if(u||t(),!p||!f)return;const g=On(d),v=On(o.clientWidth-(c+p)),E=On(o.clientHeight-(d+f)),M=On(c),N={rootMargin:-g+"px "+-v+"px "+-E+"px "+-M+"px",threshold:we(0,ft(1,s))||1};let F=!0;function j(k){const B=k[0].intersectionRatio;if(B!==s){if(!F)return l();B?l(!1,B):r=setTimeout(()=>{l(!1,1e-7)},1e3)}B===1&&!us(a,e.getBoundingClientRect())&&l(),F=!1}try{n=new IntersectionObserver(j,{...N,root:o.ownerDocument})}catch{n=new IntersectionObserver(j,N)}n.observe(e)}return l(!0),i}function cs(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:u=typeof IntersectionObserver=="function",animationFrame:s=!1}=r,a=Wr(e),c=o||i?[...a?yt(a):[],...yt(t)]:[];c.forEach(M=>{o&&M.addEventListener("scroll",n,{passive:!0}),i&&M.addEventListener("resize",n)});const d=a&&u?kf(a,n):null;let p=-1,f=null;l&&(f=new ResizeObserver(M=>{let[w]=M;w&&w.target===a&&f&&(f.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var N;(N=f)==null||N.observe(t)})),n()}),a&&!s&&f.observe(a),f.observe(t));let g,v=s?Lt(e):null;s&&E();function E(){const M=Lt(e);v&&!us(v,M)&&n(),v=M,g=requestAnimationFrame(E)}return n(),()=>{var M;c.forEach(w=>{o&&w.removeEventListener("scroll",n),i&&w.removeEventListener("resize",n)}),d==null||d(),(M=f)==null||M.disconnect(),f=null,s&&cancelAnimationFrame(g)}}const Vr=Dn,_f=xf,Bf=wf,Wf=vf,Uf=Ef,fs=gf,Vf=(e,t,n)=>{const r=new Map,o={platform:Rf,...n},i={...o.platform,_c:r};return hf(e,t,{...o,platform:i})};var zf=typeof document<"u",Hf=function(){},An=zf?m.useLayoutEffect:Hf;function Mn(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(!Mn(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)&&!Mn(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function ds(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function ps(e,t){const n=ds(e);return Math.round(t*n)/n}function zr(e){const t=R.useRef(e);return An(()=>{t.current=e}),t}function ms(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:i,floating:l}={},transform:u=!0,whileElementsMounted:s,open:a}=e,[c,d]=R.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,f]=R.useState(r);Mn(p,r)||f(r);const[g,v]=R.useState(null),[E,M]=R.useState(null),w=R.useCallback(x=>{x!==k.current&&(k.current=x,v(x))},[]),N=R.useCallback(x=>{x!==B.current&&(B.current=x,M(x))},[]),F=i||g,j=l||E,k=R.useRef(null),B=R.useRef(null),h=R.useRef(c),b=s!=null,y=zr(s),$=zr(o),D=zr(a),L=R.useCallback(()=>{if(!k.current||!B.current)return;const x={placement:t,strategy:n,middleware:p};$.current&&(x.platform=$.current),Vf(k.current,B.current,x).then(I=>{const _={...I,isPositioned:D.current!==!1};C.current&&!Mn(h.current,_)&&(h.current=_,Vt.flushSync(()=>{d(_)}))})},[p,t,n,$,D]);An(()=>{a===!1&&h.current.isPositioned&&(h.current.isPositioned=!1,d(x=>({...x,isPositioned:!1})))},[a]);const C=R.useRef(!1);An(()=>(C.current=!0,()=>{C.current=!1}),[]),An(()=>{if(F&&(k.current=F),j&&(B.current=j),F&&j){if(y.current)return y.current(F,j,L);L()}},[F,j,L,y,b]);const O=R.useMemo(()=>({reference:k,floating:B,setReference:w,setFloating:N}),[w,N]),T=R.useMemo(()=>({reference:F,floating:j}),[F,j]),P=R.useMemo(()=>{const x={position:n,left:0,top:0};if(!T.floating)return x;const I=ps(T.floating,c.x),_=ps(T.floating,c.y);return u?{...x,transform:"translate("+I+"px, "+_+"px)",...ds(T.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:I,top:_}},[n,u,T.floating,c.x,c.y]);return R.useMemo(()=>({...c,update:L,refs:O,elements:T,floatingStyles:P}),[c,L,O,T,P])}const Gf=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?fs({element:r.current,padding:o}).fn(n):{}:r?fs({element:r,padding:o}).fn(n):{}}}},Hr=(e,t)=>({..._f(e),options:[e,t]}),hs=(e,t)=>({...Bf(e),options:[e,t]}),gs=(e,t)=>({...Wf(e),options:[e,t]}),Yf=(e,t)=>({...Uf(e),options:[e,t]}),Kf=(e,t)=>({...Gf(e),options:[e,t]}),vs={...R},qf=vs.useInsertionEffect||(e=>e());function bs(e){const t=R.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return qf(()=>{t.current=e}),R.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 Gr=typeof document<"u"?m.useLayoutEffect:m.useEffect;let ys=!1,Xf=0;const xs=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+Xf++;function Qf(){const[e,t]=R.useState(()=>ys?xs():void 0);return Gr(()=>{e==null&&t(xs())},[]),R.useEffect(()=>{ys=!0},[]),e}const Zf=vs.useId||Qf;let tn;process.env.NODE_ENV!=="production"&&(tn=new Set);function Jf(){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=tn)!=null&&e.has(o))){var i;(i=tn)==null||i.add(o),console.warn(o)}}function ed(){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=tn)!=null&&e.has(o))){var i;(i=tn)==null||i.add(o),console.error(o)}}function td(){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 nd=R.createContext(null),rd=R.createContext(null),od=()=>{var e;return((e=R.useContext(nd))==null?void 0:e.id)||null},id=()=>R.useContext(rd),sd="data-floating-ui-focusable";function ld(e){const{open:t=!1,onOpenChange:n,elements:r}=e,o=Zf(),i=R.useRef({}),[l]=R.useState(()=>td()),u=od()!=null;if(process.env.NODE_ENV!=="production"){const f=r.reference;f&&!oe(f)&&ed("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[s,a]=R.useState(r.reference),c=bs((f,g,v)=>{i.current.openEvent=f?g:void 0,l.emit("openchange",{open:f,event:g,reason:v,nested:u}),n==null||n(f,g,v)}),d=R.useMemo(()=>({setPositionReference:a}),[]),p=R.useMemo(()=>({reference:s||r.reference||null,floating:r.floating||null,domReference:r.reference}),[s,r.reference,r.floating]);return R.useMemo(()=>({dataRef:i,open:t,onOpenChange:c,elements:p,events:l,floatingId:o,refs:d}),[t,c,p,l,o,d])}function ad(e){e===void 0&&(e={});const{nodeId:t}=e,n=ld({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,o=r.elements,[i,l]=R.useState(null),[u,s]=R.useState(null),c=(o==null?void 0:o.domReference)||i,d=R.useRef(null),p=id();Gr(()=>{c&&(d.current=c)},[c]);const f=ms({...e,elements:{...o,...u&&{reference:u}}}),g=R.useCallback(N=>{const F=oe(N)?{getBoundingClientRect:()=>N.getBoundingClientRect(),contextElement:N}:N;s(F),f.refs.setReference(F)},[f.refs]),v=R.useCallback(N=>{(oe(N)||N===null)&&(d.current=N,l(N)),(oe(f.refs.reference.current)||f.refs.reference.current===null||N!==null&&!oe(N))&&f.refs.setReference(N)},[f.refs]),E=R.useMemo(()=>({...f.refs,setReference:v,setPositionReference:g,domReference:d}),[f.refs,v,g]),M=R.useMemo(()=>({...f.elements,domReference:c}),[f.elements,c]),w=R.useMemo(()=>({...f,...r,refs:E,elements:M,nodeId:t}),[f,E,M,t,r]);return Gr(()=>{r.dataRef.current.floatingContext=w;const N=p==null?void 0:p.nodesRef.current.find(F=>F.id===t);N&&(N.context=w)}),R.useMemo(()=>({...f,context:w,refs:E,elements:M}),[f,E,M,w])}const ws="active",Es="selected";function Yr(e,t,n){const r=new Map,o=n==="item";let i=e;if(o&&e){const{[ws]:l,[Es]:u,...s}=e;i=s}return{...n==="floating"&&{tabIndex:-1,[sd]:""},...i,...t.map(l=>{const u=l?l[n]:null;return typeof u=="function"?e?u(e):null:u}).concat(e).reduce((l,u)=>(u&&Object.entries(u).forEach(s=>{let[a,c]=s;if(!(o&&[ws,Es].includes(a)))if(a.indexOf("on")===0){if(r.has(a)||r.set(a,[]),typeof c=="function"){var d;(d=r.get(a))==null||d.push(c),l[a]=function(){for(var p,f=arguments.length,g=new Array(f),v=0;v<f;v++)g[v]=arguments[v];return(p=r.get(a))==null?void 0:p.map(E=>E(...g)).find(E=>E!==void 0)}}}else l[a]=c}),l),{})}}function ud(e){e===void 0&&(e=[]);const t=e.map(u=>u==null?void 0:u.reference),n=e.map(u=>u==null?void 0:u.floating),r=e.map(u=>u==null?void 0:u.item),o=R.useCallback(u=>Yr(u,e,"reference"),t),i=R.useCallback(u=>Yr(u,e,"floating"),n),l=R.useCallback(u=>Yr(u,e,"item"),r);return R.useMemo(()=>({getReferenceProps:o,getFloatingProps:i,getItemProps:l}),[o,i,l])}function Ss(e,t){return{...e,rects:{...e.rects,floating:{...e.rects.floating,height:t}}}}const cd=e=>({name:"inner",options:e,async fn(t){const{listRef:n,overflowRef:r,onFallbackChange:o,offset:i=0,index:l=0,minItemsVisible:u=4,referenceOverflowThreshold:s=0,scrollRef:a,...c}=Nt(e,t),{rects:d,elements:{floating:p}}=t,f=n.current[l],g=(a==null?void 0:a.current)||p,v=p.clientTop||g.clientTop,E=p.clientTop!==0,M=g.clientTop!==0,w=p===g;if(process.env.NODE_ENV!=="production"&&(t.placement.startsWith("bottom")||Jf('`placement` side must be "bottom" when using the `inner`',"middleware.")),!f)return{};const N={...t,...await Hr(-f.offsetTop-p.clientTop-d.reference.height/2-f.offsetHeight/2-i).fn(t)},F=await Vr(Ss(N,g.scrollHeight+v+p.clientTop),c),j=await Vr(N,{...c,elementContext:"reference"}),k=we(0,F.top),B=N.y+k,y=(g.scrollHeight>g.clientHeight?$=>$:Jt)(we(0,g.scrollHeight+(E&&w||M?v*2:0)-k-we(0,F.bottom)));if(g.style.maxHeight=y+"px",g.scrollTop=k,o){const $=g.offsetHeight<f.offsetHeight*ft(u,n.current.length)-1||j.top>=-s||j.bottom>=-s;Vt.flushSync(()=>o($))}return r&&(r.current=await Vr(Ss({...N,y:B},g.offsetHeight+v+p.clientTop),c)),{y:B}}});function fd(e,t){const{open:n,elements:r}=e,{enabled:o=!0,overflowRef:i,scrollRef:l,onChange:u}=t,s=bs(u),a=R.useRef(!1),c=R.useRef(null),d=R.useRef(null);R.useEffect(()=>{if(!o)return;function f(v){if(v.ctrlKey||!g||i.current==null)return;const E=v.deltaY,M=i.current.top>=-.5,w=i.current.bottom>=-.5,N=g.scrollHeight-g.clientHeight,F=E<0?-1:1,j=E<0?"max":"min";g.scrollHeight<=g.clientHeight||(!M&&E>0||!w&&E<0?(v.preventDefault(),Vt.flushSync(()=>{s(k=>k+Math[j](E,N*F))})):/firefox/i.test(_c())&&(g.scrollTop+=E))}const g=(l==null?void 0:l.current)||r.floating;if(n&&g)return g.addEventListener("wheel",f),requestAnimationFrame(()=>{c.current=g.scrollTop,i.current!=null&&(d.current={...i.current})}),()=>{c.current=null,d.current=null,g.removeEventListener("wheel",f)}},[o,n,r.floating,i,l,s]);const p=R.useMemo(()=>({onKeyDown(){a.current=!0},onWheel(){a.current=!1},onPointerMove(){a.current=!1},onScroll(){const f=(l==null?void 0:l.current)||r.floating;if(!(!i.current||!f||!a.current)){if(c.current!==null){const g=f.scrollTop-c.current;(i.current.bottom<-.5&&g<-1||i.current.top<-.5&&g>1)&&Vt.flushSync(()=>s(v=>v+g))}requestAnimationFrame(()=>{c.current=f.scrollTop})}}}),[r.floating,s,i,l]);return R.useMemo(()=>o?{floating:p}:{},[o,p])}let Rt=m.createContext({styles:void 0,setReference:()=>{},setFloating:()=>{},getReferenceProps:()=>({}),getFloatingProps:()=>({}),slot:{}});Rt.displayName="FloatingContext";let Kr=m.createContext(null);Kr.displayName="PlacementContext";function dd(e){return m.useMemo(()=>e?typeof e=="string"?{to:e}:e:null,[e])}function pd(){return m.useContext(Rt).setReference}function md(){return m.useContext(Rt).getReferenceProps}function hd(){let{getFloatingProps:e,slot:t}=m.useContext(Rt);return m.useCallback((...n)=>Object.assign({},e(...n),{"data-anchor":t.anchor}),[e,t])}function gd(e=null){e===!1&&(e=null),typeof e=="string"&&(e={to:e});let t=m.useContext(Kr),n=m.useMemo(()=>e,[JSON.stringify(e,(o,i)=>{var l;return(l=i==null?void 0:i.outerHTML)!=null?l:i})]);ue(()=>{t==null||t(n??null)},[t,n]);let r=m.useContext(Rt);return m.useMemo(()=>[r.setFloating,e?r.styles:{}],[r.setFloating,e,r.styles])}let Cs=4;function vd({children:e,enabled:t=!0}){let[n,r]=m.useState(null),[o,i]=m.useState(0),l=m.useRef(null),[u,s]=m.useState(null);bd(u);let a=t&&n!==null&&u!==null,{to:c="bottom",gap:d=0,offset:p=0,padding:f=0,inner:g}=yd(n,u),[v,E="center"]=c.split(" ");ue(()=>{a&&i(0)},[a]);let{refs:M,floatingStyles:w,context:N}=ad({open:a,placement:v==="selection"?E==="center"?"bottom":`bottom-${E}`:E==="center"?`${v}`:`${v}-${E}`,strategy:"absolute",transform:!1,middleware:[Hr({mainAxis:v==="selection"?0:d,crossAxis:p}),hs({padding:f}),v!=="selection"&&gs({padding:f}),v==="selection"&&g?cd({...g,padding:f,overflowRef:l,offset:o,minItemsVisible:Cs,referenceOverflowThreshold:f,onFallbackChange($){var D,L;if(!$)return;let C=N.elements.floating;if(!C)return;let O=parseFloat(getComputedStyle(C).scrollPaddingBottom)||0,T=Math.min(Cs,C.childElementCount),P=0,x=0;for(let I of(L=(D=N.elements.floating)==null?void 0:D.childNodes)!=null?L:[])if(at(I)){let _=I.offsetTop,V=_+I.clientHeight+O,W=C.scrollTop,Y=W+C.clientHeight;if(_>=W&&V<=Y)T--;else{x=Math.max(0,Math.min(V,Y)-Math.max(_,W)),P=I.clientHeight;break}}T>=1&&i(I=>{let _=P*T-x+O;return I>=_?I:_})}}):null,Yf({padding:f,apply({availableWidth:$,availableHeight:D,elements:L}){Object.assign(L.floating.style,{overflow:"auto",maxWidth:`${$}px`,maxHeight:`min(var(--anchor-max-height, 100vh), ${D}px)`})}})].filter(Boolean),whileElementsMounted:cs}),[F=v,j=E]=N.placement.split("-");v==="selection"&&(F="selection");let k=m.useMemo(()=>({anchor:[F,j].filter(Boolean).join(" ")}),[F,j]),B=fd(N,{overflowRef:l,onChange:i}),{getReferenceProps:h,getFloatingProps:b}=ud([B]),y=ne($=>{s($),M.setFloating($)});return R.createElement(Kr.Provider,{value:r},R.createElement(Rt.Provider,{value:{setFloating:y,setReference:M.setReference,styles:w,getReferenceProps:h,getFloatingProps:b,slot:k}},e))}function bd(e){ue(()=>{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 yd(e,t){var n,r,o;let i=qr((n=e==null?void 0:e.gap)!=null?n:"var(--anchor-gap, 0)",t),l=qr((r=e==null?void 0:e.offset)!=null?r:"var(--anchor-offset, 0)",t),u=qr((o=e==null?void 0:e.padding)!=null?o:"var(--anchor-padding, 0)",t);return{...e,gap:i,offset:l,padding:u}}function qr(e,t,n=void 0){let r=$t(),o=ne((s,a)=>{if(s==null)return[n,null];if(typeof s=="number")return[s,null];if(typeof s=="string"){if(!a)return[n,null];let c=Ts(s,a);return[c,d=>{let p=Os(s);{let f=p.map(g=>window.getComputedStyle(a).getPropertyValue(g));r.requestAnimationFrame(function g(){r.nextFrame(g);let v=!1;for(let[M,w]of p.entries()){let N=window.getComputedStyle(a).getPropertyValue(w);if(f[M]!==N){f[M]=N,v=!0;break}}if(!v)return;let E=Ts(s,a);c!==E&&(d(E),c=E)})}return r.dispose}]}return[n,null]}),i=m.useMemo(()=>o(e,t)[0],[e,t]),[l=i,u]=m.useState();return ue(()=>{let[s,a]=o(e,t);if(u(s),!!a)return a(u)},[e,t]),l}function Os(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,...Os(o)]:[r]}return[]}function Ts(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 xd(e,t){let[n,r]=m.useState(t);return!e&&n!==t&&r(t),e?n:t}let Xr=m.createContext(null);Xr.displayName="OpenClosedContext";var qe=(e=>(e[e.Open=1]="Open",e[e.Closed=2]="Closed",e[e.Closing=4]="Closing",e[e.Opening=8]="Opening",e))(qe||{});function Qr(){return m.useContext(Xr)}function Ns({value:e,children:t}){return m.createElement(Xr.Provider,{value:e},t)}function wd(e){throw new Error("Unexpected object: "+e)}var fe=(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))(fe||{});function In(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:wd(e)}}var Ls=(e=>(e[e.Left=0]="Left",e[e.Right=2]="Right",e))(Ls||{});function Ps(e){let t=ne(e),n=m.useRef(!1);m.useEffect(()=>(n.current=!1,()=>{n.current=!0,ni(()=>{n.current&&t()})}),[t])}function Ed(){let e=typeof document>"u";return"useSyncExternalStore"in R?(t=>t.useSyncExternalStore)(R)(()=>()=>{},()=>!1,()=>!e):!1}function Zr(){let e=Ed(),[t,n]=R.useState(Qe.isHandoffComplete);return t&&Qe.isHandoffComplete===!1&&n(!1),R.useEffect(()=>{t!==!0&&n(!0)},[t]),R.useEffect(()=>Qe.handoff(),[]),e?!1:t}let Sd=m.createContext(!1);function Cd(){return m.useContext(Sd)}function Od(e){let t=Cd(),n=m.useContext($s),[r,o]=m.useState(()=>{var i;if(!t&&n!==null)return(i=n.current)!=null?i:null;if(Qe.isServer)return null;let l=e==null?void 0:e.getElementById("headlessui-portal-root");if(l)return l;if(e===null)return null;let u=e.createElement("div");return u.setAttribute("id","headlessui-portal-root"),e.body.appendChild(u)});return m.useEffect(()=>{r!==null&&(e!=null&&e.body.contains(r)||e==null||e.body.appendChild(r))},[r,e]),m.useEffect(()=>{t||n!==null&&o(n.current)},[n,o,t]),r}let Ds=m.Fragment,Td=Ne(function(e,t){let{ownerDocument:n=null,...r}=e,o=m.useRef(null),i=Be(Nu(f=>{o.current=f}),t),l=$r(o),u=n??l,s=Od(u),[a]=m.useState(()=>{var f;return Qe.isServer?null:(f=u==null?void 0:u.createElement("div"))!=null?f:null}),c=m.useContext(Dd),d=Zr();ue(()=>{!s||!a||s.contains(a)||(a.setAttribute("data-headlessui-portal",""),s.appendChild(a))},[s,a]),ue(()=>{if(a&&c)return c.register(a)},[c,a]),Ps(()=>{var f;!s||!a||(br(a)&&s.contains(a)&&s.removeChild(a),s.childNodes.length<=0&&((f=s.parentElement)==null||f.removeChild(s)))});let p=Me();return d?!s||!a?null:Se.createPortal(p({ourProps:{ref:i},theirProps:r,slot:{},defaultTag:Ds,name:"Portal"}),a):null});function Nd(e,t){let n=Be(t),{enabled:r=!0,ownerDocument:o,...i}=e,l=Me();return r?m.createElement(Td,{...i,ownerDocument:o,ref:n}):l({ourProps:{ref:n},theirProps:i,slot:{},defaultTag:Ds,name:"Portal"})}let Ld=m.Fragment,$s=m.createContext(null);function Pd(e,t){let{target:n,...r}=e,o={ref:Be(t)},i=Me();return m.createElement($s.Provider,{value:n},i({ourProps:o,theirProps:r,defaultTag:Ld,name:"Popover.Group"}))}let Dd=m.createContext(null),$d=Ne(Nd),Ad=Ne(Pd),Md=Object.assign($d,{Group:Ad});function Id(){let e=m.useRef(!1);return ue(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function As(e){var t;return!!(e.enter||e.enterFrom||e.enterTo||e.leave||e.leaveFrom||e.leaveTo)||((t=e.as)!=null?t:Is)!==m.Fragment||m.Children.count(e.children)===1}let jn=m.createContext(null);jn.displayName="TransitionContext";var jd=(e=>(e.Visible="visible",e.Hidden="hidden",e))(jd||{});function Fd(){let e=m.useContext(jn);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}function Rd(){let e=m.useContext(Fn);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}let Fn=m.createContext(null);Fn.displayName="NestingContext";function Rn(e){return"children"in e?Rn(e.children):e.current.filter(({el:t})=>t.current!==null).filter(({state:t})=>t==="visible").length>0}function Ms(e,t){let n=Ot(e),r=m.useRef([]),o=Id(),i=$t(),l=ne((f,g=vt.Hidden)=>{let v=r.current.findIndex(({el:E})=>E===f);v!==-1&&(_e(g,{[vt.Unmount](){r.current.splice(v,1)},[vt.Hidden](){r.current[v].state="hidden"}}),i.microTask(()=>{var E;!Rn(r)&&o.current&&((E=n.current)==null||E.call(n))}))}),u=ne(f=>{let g=r.current.find(({el:v})=>v===f);return g?g.state!=="visible"&&(g.state="visible"):r.current.push({el:f,state:"visible"}),()=>l(f,vt.Unmount)}),s=m.useRef([]),a=m.useRef(Promise.resolve()),c=m.useRef({enter:[],leave:[]}),d=ne((f,g,v)=>{s.current.splice(0),t&&(t.chains.current[g]=t.chains.current[g].filter(([E])=>E!==f)),t==null||t.chains.current[g].push([f,new Promise(E=>{s.current.push(E)})]),t==null||t.chains.current[g].push([f,new Promise(E=>{Promise.all(c.current[g].map(([M,w])=>w)).then(()=>E())})]),g==="enter"?a.current=a.current.then(()=>t==null?void 0:t.wait.current).then(()=>v(g)):v(g)}),p=ne((f,g,v)=>{Promise.all(c.current[g].splice(0).map(([E,M])=>M)).then(()=>{var E;(E=s.current.shift())==null||E()}).then(()=>v(g))});return m.useMemo(()=>({children:r,register:u,unregister:l,onStart:d,onStop:p,wait:a,chains:c}),[u,l,r,d,p,c,a])}let Is=m.Fragment,js=gn.RenderStrategy;function kd(e,t){var n,r;let{transition:o=!0,beforeEnter:i,afterEnter:l,beforeLeave:u,afterLeave:s,enter:a,enterFrom:c,enterTo:d,entered:p,leave:f,leaveFrom:g,leaveTo:v,...E}=e,[M,w]=m.useState(null),N=m.useRef(null),F=As(e),j=Be(...F?[N,t,w]:t===null?[]:[t]),k=(n=E.unmount)==null||n?vt.Unmount:vt.Hidden,{show:B,appear:h,initial:b}=Fd(),[y,$]=m.useState(B?"visible":"hidden"),D=Rd(),{register:L,unregister:C}=D;ue(()=>L(N),[L,N]),ue(()=>{if(k===vt.Hidden&&N.current){if(B&&y!=="visible"){$("visible");return}return _e(y,{hidden:()=>C(N),visible:()=>L(N)})}},[y,N,L,C,B,k]);let O=Zr();ue(()=>{if(F&&O&&y==="visible"&&N.current===null)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[N,y,O,F]);let T=b&&!h,P=h&&B&&b,x=m.useRef(!1),I=Ms(()=>{x.current||($("hidden"),C(N))},D),_=ne(z=>{x.current=!0;let J=z?"enter":"leave";I.onStart(N,J,se=>{se==="enter"?i==null||i():se==="leave"&&(u==null||u())})}),V=ne(z=>{let J=z?"enter":"leave";x.current=!1,I.onStop(N,J,se=>{se==="enter"?l==null||l():se==="leave"&&(s==null||s())}),J==="leave"&&!Rn(I)&&($("hidden"),C(N))});m.useEffect(()=>{F&&o||(_(B),V(B))},[B,F,o]);let W=!(!o||!F||!O||T),[,Y]=Wi(W,M,B,{start:_,end:V}),q=bt({ref:j,className:((r=hr(E.className,P&&a,P&&c,Y.enter&&a,Y.enter&&Y.closed&&c,Y.enter&&!Y.closed&&d,Y.leave&&f,Y.leave&&!Y.closed&&g,Y.leave&&Y.closed&&v,!Y.transition&&B&&p))==null?void 0:r.trim())||void 0,...Bi(Y)}),G=0;y==="visible"&&(G|=qe.Open),y==="hidden"&&(G|=qe.Closed),B&&y==="hidden"&&(G|=qe.Opening),!B&&y==="visible"&&(G|=qe.Closing);let H=Me();return m.createElement(Fn.Provider,{value:I},m.createElement(Ns,{value:G},H({ourProps:q,theirProps:E,defaultTag:Is,features:js,visible:y==="visible",name:"Transition.Child"})))}function _d(e,t){let{show:n,appear:r=!1,unmount:o=!0,...i}=e,l=m.useRef(null),u=As(e),s=Be(...u?[l,t]:t===null?[]:[t]);Zr();let a=Qr();if(n===void 0&&a!==null&&(n=(a&qe.Open)===qe.Open),n===void 0)throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");let[c,d]=m.useState(n?"visible":"hidden"),p=Ms(()=>{n||d("hidden")}),[f,g]=m.useState(!0),v=m.useRef([n]);ue(()=>{f!==!1&&v.current[v.current.length-1]!==n&&(v.current.push(n),g(!1))},[v,n]);let E=m.useMemo(()=>({show:n,appear:r,initial:f}),[n,r,f]);ue(()=>{n?d("visible"):!Rn(p)&&l.current!==null&&d("hidden")},[n,p]);let M={unmount:o},w=ne(()=>{var j;f&&g(!1),(j=e.beforeEnter)==null||j.call(e)}),N=ne(()=>{var j;f&&g(!1),(j=e.beforeLeave)==null||j.call(e)}),F=Me();return m.createElement(Fn.Provider,{value:p},m.createElement(jn.Provider,{value:E},F({ourProps:{...M,as:m.Fragment,children:m.createElement(Fs,{ref:s,...M,...i,beforeEnter:w,beforeLeave:N})},theirProps:{},defaultTag:m.Fragment,features:js,visible:c==="visible",name:"Transition"})))}function Bd(e,t){let n=m.useContext(jn)!==null,r=Qr()!==null;return m.createElement(m.Fragment,null,!n&&r?m.createElement(Jr,{ref:t,...e}):m.createElement(Fs,{ref:t,...e}))}let Jr=Ne(_d),Fs=Ne(kd),Wd=Ne(Bd),Rs=Object.assign(Jr,{Child:Wd,Root:Jr});function Ud(e,t){let n=m.useRef({left:0,top:0});if(ue(()=>{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 ks=/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g;function _s(e){var t,n;let r=(t=e.innerText)!=null?t:"",o=e.cloneNode(!0);if(!at(o))return r;let i=!1;for(let u of o.querySelectorAll('[hidden],[aria-hidden],[role="img"]'))u.remove(),i=!0;let l=i?(n=o.innerText)!=null?n:"":r;return ks.test(l)&&(l=l.replace(ks,"")),l}function Vd(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():_s(i).trim()}return null}).filter(Boolean);if(r.length>0)return r.join(", ")}return _s(e).trim()}function zd(e){let t=m.useRef(""),n=m.useRef("");return ne(()=>{let r=e.current;if(!r)return"";let o=r.innerText;if(t.current===o)return n.current;let i=Vd(r).trim().toLowerCase();return t.current=o,n.current=i,i})}var Hd=Object.defineProperty,Gd=(e,t,n)=>t in e?Hd(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Bs=(e,t,n)=>(Gd(e,typeof t!="symbol"?t+"":t,n),n),ye=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(ye||{}),tt=(e=>(e[e.Single=0]="Single",e[e.Multi=1]="Multi",e))(tt||{}),kn=(e=>(e[e.Pointer=0]="Pointer",e[e.Other=1]="Other",e))(kn||{}),Ws=(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.RegisterOptions=5]="RegisterOptions",e[e.UnregisterOptions=6]="UnregisterOptions",e[e.SetButtonElement=7]="SetButtonElement",e[e.SetOptionsElement=8]="SetOptionsElement",e[e.SortOptions=9]="SortOptions",e))(Ws||{});function Us(e,t=n=>n){let n=e.activeOptionIndex!==null?e.options[e.activeOptionIndex]:null,r=Ai(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 Yd={1(e){return e.dataRef.current.disabled||e.listboxState===1?e:{...e,activeOptionIndex:null,pendingFocus:{focus:fe.Nothing},listboxState:1,__demoMode:!1}},0(e,t){if(e.dataRef.current.disabled||e.listboxState===0)return e;let n=e.activeOptionIndex,{isSelected:r}=e.dataRef.current,o=e.options.findIndex(i=>r(i.dataRef.current.value));return o!==-1&&(n=o),{...e,pendingFocus:t.focus,listboxState:0,activeOptionIndex:n,__demoMode:!1}},2(e,t){var n,r,o,i,l;if(e.dataRef.current.disabled||e.listboxState===1)return e;let u={...e,searchQuery:"",activationTrigger:(n=t.trigger)!=null?n:1,__demoMode:!1};if(t.focus===fe.Nothing)return{...u,activeOptionIndex:null};if(t.focus===fe.Specific)return{...u,activeOptionIndex:e.options.findIndex(c=>c.id===t.id)};if(t.focus===fe.Previous){let c=e.activeOptionIndex;if(c!==null){let d=e.options[c].dataRef.current.domRef,p=In(t,{resolveItems:()=>e.options,resolveActiveIndex:()=>e.activeOptionIndex,resolveId:f=>f.id,resolveDisabled:f=>f.dataRef.current.disabled});if(p!==null){let f=e.options[p].dataRef.current.domRef;if(((r=d.current)==null?void 0:r.previousElementSibling)===f.current||((o=f.current)==null?void 0:o.previousElementSibling)===null)return{...u,activeOptionIndex:p}}}}else if(t.focus===fe.Next){let c=e.activeOptionIndex;if(c!==null){let d=e.options[c].dataRef.current.domRef,p=In(t,{resolveItems:()=>e.options,resolveActiveIndex:()=>e.activeOptionIndex,resolveId:f=>f.id,resolveDisabled:f=>f.dataRef.current.disabled});if(p!==null){let f=e.options[p].dataRef.current.domRef;if(((i=d.current)==null?void 0:i.nextElementSibling)===f.current||((l=f.current)==null?void 0:l.nextElementSibling)===null)return{...u,activeOptionIndex:p}}}}let s=Us(e),a=In(t,{resolveItems:()=>s.options,resolveActiveIndex:()=>s.activeOptionIndex,resolveId:c=>c.id,resolveDisabled:c=>c.dataRef.current.disabled});return{...u,...s,activeOptionIndex:a}},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 u;return!l.dataRef.current.disabled&&((u=l.dataRef.current.textValue)==null?void 0:u.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=e.options.concat(t.options),r=e.activeOptionIndex;if(e.pendingFocus.focus!==fe.Nothing&&(r=In(e.pendingFocus,{resolveItems:()=>n,resolveActiveIndex:()=>e.activeOptionIndex,resolveId:o=>o.id,resolveDisabled:o=>o.dataRef.current.disabled})),e.activeOptionIndex===null){let{isSelected:o}=e.dataRef.current;if(o){let i=n.findIndex(l=>o==null?void 0:o(l.dataRef.current.value));i!==-1&&(r=i)}}return{...e,options:n,activeOptionIndex:r,pendingFocus:{focus:fe.Nothing},pendingShouldSort:!0}},6:(e,t)=>{let n=e.options,r=[],o=new Set(t.options);for(let[i,l]of n.entries())if(o.has(l.id)&&(r.push(i),o.delete(l.id),o.size===0))break;if(r.length>0){n=n.slice();for(let i of r.reverse())n.splice(i,1)}return{...e,options: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},9:e=>e.pendingShouldSort?{...e,...Us(e),pendingShouldSort:!1}:e};class eo extends xi{constructor(t){super(t),Bs(this,"actions",{onChange:n=>{let{onChange:r,compare:o,mode:i,value:l}=this.state.dataRef.current;return _e(i,{0:()=>r==null?void 0:r(n),1:()=>{let u=l.slice(),s=u.findIndex(a=>o(a,n));return s===-1?u.push(n):u.splice(s,1),r==null?void 0:r(u)}})},registerOption:Er(()=>{let n=[],r=new Set;return[(o,i)=>{r.has(i)||(r.add(i),n.push({id:o,dataRef:i}))},()=>(r.clear(),this.send({type:5,options:n.splice(0)}))]}),unregisterOption:Er(()=>{let n=[];return[r=>n.push(r),()=>{this.send({type:6,options:n.splice(0)})}]}),goToOption:Er(()=>{let n=null;return[(r,o)=>{n={type:2,...r,trigger:o}},()=>n&&this.send(n)]}),closeListbox:()=>{this.send({type:1})},openListbox:n=>{this.send({type:0,focus:n})},selectActiveOption:()=>{if(this.state.activeOptionIndex!==null){let{dataRef:n,id:r}=this.state.options[this.state.activeOptionIndex];this.actions.onChange(n.current.value),this.send({type:2,focus:fe.Specific,id:r})}},selectOption:n=>{let r=this.state.options.find(o=>o.id===n);r&&this.actions.onChange(r.dataRef.current.value)},search:n=>{this.send({type:3,value:n})},clearSearch:()=>{this.send({type:4})},setButtonElement:n=>{this.send({type:7,element:n})},setOptionsElement:n=>{this.send({type:8,element:n})}}),Bs(this,"selectors",{activeDescendantId(n){var r;let o=n.activeOptionIndex,i=n.options;return o===null||(r=i[o])==null?void 0:r.id},isActive(n,r){var o;let i=n.activeOptionIndex,l=n.options;return i!==null?((o=l[i])==null?void 0:o.id)===r:!1},shouldScrollIntoView(n,r){return n.__demoMode||n.listboxState!==0||n.activationTrigger===0?!1:this.isActive(n,r)}}),this.on(5,()=>{requestAnimationFrame(()=>{this.send({type:9})})});{let n=this.state.id,r=Sr.get(null);this.disposables.add(r.on(Ci.Push,o=>{!r.selectors.isTop(o,n)&&this.state.listboxState===0&&this.actions.closeListbox()})),this.on(0,()=>r.actions.push(n)),this.on(1,()=>r.actions.pop(n))}}static new({id:t,__demoMode:n=!1}){return new eo({id:t,dataRef:{current:{}},listboxState:n?0:1,options:[],searchQuery:"",activeOptionIndex:null,activationTrigger:1,buttonElement:null,optionsElement:null,pendingShouldSort:!1,pendingFocus:{focus:fe.Nothing},__demoMode:n})}reduce(t,n){return _e(n.type,Yd,t,n)}}const Vs=m.createContext(null);function to(e){let t=m.useContext(Vs);if(t===null){let n=new Error(`<${e} /> is missing a parent <Listbox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,zs),n}return t}function zs({id:e,__demoMode:t=!1}){let n=m.useMemo(()=>eo.new({id:e,__demoMode:t}),[]);return Ps(()=>n.dispose()),n}let _n=m.createContext(null);_n.displayName="ListboxDataContext";function nn(e){let t=m.useContext(_n);if(t===null){let n=new Error(`<${e} /> is missing a parent <Listbox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,nn),n}return t}let Kd=m.Fragment;function qd(e,t){let n=m.useId(),r=mr(),{value:o,defaultValue:i,form:l,name:u,onChange:s,by:a,invalid:c=!1,disabled:d=r||!1,horizontal:p=!1,multiple:f=!1,__demoMode:g=!1,...v}=e;const E=p?"horizontal":"vertical";let M=Be(t),w=du(i),[N=f?[]:void 0,F]=fu(o,s,w),j=zs({id:n,__demoMode:g}),k=m.useRef({static:!1,hold:!1}),B=m.useRef(new Map),h=ku(a),b=m.useCallback(W=>_e(y.mode,{[tt.Multi]:()=>N.some(Y=>h(Y,W)),[tt.Single]:()=>h(N,W)}),[N]),y=m.useMemo(()=>({value:N,disabled:d,invalid:c,mode:f?tt.Multi:tt.Single,orientation:E,onChange:F,compare:h,isSelected:b,optionsPropsRef:k,listRef:B}),[N,d,c,f,E,F,h,b,k,B]);ue(()=>{j.state.dataRef.current=y},[y]);let $=Ue(j,W=>W.listboxState),D=Sr.get(null),L=Ue(D,m.useCallback(W=>D.selectors.isTop(W,n),[D,n])),[C,O]=Ue(j,W=>[W.buttonElement,W.optionsElement]);fc(L,[C,O],(W,Y)=>{j.send({type:Ws.CloseListbox}),$i(Y,Dr.Loose)||(W.preventDefault(),C==null||C.focus())});let T=m.useMemo(()=>({open:$===ye.Open,disabled:d,invalid:c,value:N}),[$,d,c,N]),[P,x]=Au({inherit:!0}),I={ref:M},_=m.useCallback(()=>{if(w!==void 0)return F==null?void 0:F(w)},[F,w]),V=Me();return m.createElement(x,{value:P,props:{htmlFor:C==null?void 0:C.id},slot:{open:$===ye.Open,disabled:d}},m.createElement(vd,null,m.createElement(Vs.Provider,{value:j},m.createElement(_n.Provider,{value:y},m.createElement(Ns,{value:_e($,{[ye.Open]:qe.Open,[ye.Closed]:qe.Closed})},u!=null&&N!=null&&m.createElement(bu,{disabled:d,data:{[u]:N},form:l,onReset:_}),V({ourProps:I,theirProps:v,slot:T,defaultTag:Kd,name:"Listbox"}))))))}let Xd="button";function Qd(e,t){let n=m.useId(),r=ui(),o=nn("Listbox.Button"),i=to("Listbox.Button"),{id:l=r||`headlessui-listbox-button-${n}`,disabled:u=o.disabled||!1,autoFocus:s=!1,...a}=e,c=Be(t,pd(),i.actions.setButtonElement),d=md(),[p,f,g]=Ue(i,x=>[x.listboxState,x.buttonElement,x.optionsElement]),v=p===ye.Open;mc(v,{trigger:f,action:m.useCallback(x=>{if(f!=null&&f.contains(x.target))return xn.Ignore;let I=x.target.closest('[role="option"]:not([data-disabled])');return at(I)?xn.Select(I):g!=null&&g.contains(x.target)?xn.Ignore:xn.Close},[f,g]),close:i.actions.closeListbox,select:i.actions.selectActiveOption});let E=ne(x=>{switch(x.key){case be.Enter:pu(x.currentTarget);break;case be.Space:case be.ArrowDown:x.preventDefault(),i.actions.openListbox({focus:o.value?fe.Nothing:fe.First});break;case be.ArrowUp:x.preventDefault(),i.actions.openListbox({focus:o.value?fe.Nothing:fe.Last});break}}),M=ne(x=>{switch(x.key){case be.Space:x.preventDefault();break}}),w=ne(x=>{var I;if(x.button===Ls.Left){if(Ou(x.currentTarget))return x.preventDefault();i.state.listboxState===ye.Open?(Se.flushSync(()=>i.actions.closeListbox()),(I=i.state.buttonElement)==null||I.focus({preventScroll:!0})):(x.preventDefault(),i.actions.openListbox({focus:fe.Nothing}))}}),N=m.useRef(null),F=ne(x=>{N.current=x.pointerType,x.pointerType==="mouse"&&w(x)}),j=ne(x=>{N.current!=="mouse"&&w(x)}),k=ne(x=>x.preventDefault()),B=gi([l]),h=Lu(),{isFocusVisible:b,focusProps:y}=Ja({autoFocus:s}),{isHovered:$,hoverProps:D}=Za({isDisabled:u}),{pressed:L,pressProps:C}=iu({disabled:u}),O=m.useMemo(()=>({open:p===ye.Open,active:L||p===ye.Open,disabled:u,invalid:o.invalid,value:o.value,hover:$,focus:b,autofocus:s}),[p,o.value,u,$,b,L,o.invalid,s]),T=Ue(i,x=>x.listboxState===ye.Open),P=oi(d(),{ref:c,id:l,type:hc(e,f),"aria-haspopup":"listbox","aria-controls":g==null?void 0:g.id,"aria-expanded":T,"aria-labelledby":B,"aria-describedby":h,disabled:u||void 0,autoFocus:s,onKeyDown:E,onKeyUp:M,onKeyPress:k,onPointerDown:F,onClick:j},y,D,C);return Me()({ourProps:P,theirProps:a,slot:O,defaultTag:Xd,name:"Listbox.Button"})}let Hs=m.createContext(!1),Zd="div",Jd=gn.RenderStrategy|gn.Static;function ep(e,t){let n=m.useId(),{id:r=`headlessui-listbox-options-${n}`,anchor:o,portal:i=!1,modal:l=!0,transition:u=!1,...s}=e,a=dd(o),[c,d]=m.useState(null);a&&(i=!0);let p=nn("Listbox.Options"),f=to("Listbox.Options"),[g,v,E,M]=Ue(f,z=>[z.listboxState,z.buttonElement,z.optionsElement,z.__demoMode]),w=$r(v),N=$r(E),F=Qr(),[j,k]=Wi(u,c,F!==null?(F&qe.Open)===qe.Open:g===ye.Open);Ju(j,v,f.actions.closeListbox);let B=M?!1:l&&g===ye.Open;Sc(B,N);let h=M?!1:l&&g===ye.Open;Zu(h,{allowed:m.useCallback(()=>[v,E],[v,E])});let b=g!==ye.Open,y=Ud(b,v)?!1:j,$=j&&g===ye.Closed,D=xd($,p.value),L=ne(z=>p.compare(D,z)),C=Ue(f,z=>{var J;if(a==null||!((J=a==null?void 0:a.to)!=null&&J.includes("selection")))return null;let se=z.options.findIndex(he=>L(he.dataRef.current.value));return se===-1&&(se=0),se}),O=(()=>{if(a==null)return;if(C===null)return{...a,inner:void 0};let z=Array.from(p.listRef.current.values());return{...a,inner:{listRef:{current:z},index:C}}})(),[T,P]=gd(O),x=hd(),I=Be(t,a?T:null,f.actions.setOptionsElement,d),_=$t();m.useEffect(()=>{var z;let J=E;J&&g===ye.Open&&J!==((z=Kt(J))==null?void 0:z.activeElement)&&(J==null||J.focus({preventScroll:!0}))},[g,E]);let V=ne(z=>{var J,se;switch(_.dispose(),z.key){case be.Space:if(f.state.searchQuery!=="")return z.preventDefault(),z.stopPropagation(),f.actions.search(z.key);case be.Enter:if(z.preventDefault(),z.stopPropagation(),f.state.activeOptionIndex!==null){let{dataRef:he}=f.state.options[f.state.activeOptionIndex];f.actions.onChange(he.current.value)}p.mode===tt.Single&&(Se.flushSync(()=>f.actions.closeListbox()),(J=f.state.buttonElement)==null||J.focus({preventScroll:!0}));break;case _e(p.orientation,{vertical:be.ArrowDown,horizontal:be.ArrowRight}):return z.preventDefault(),z.stopPropagation(),f.actions.goToOption({focus:fe.Next});case _e(p.orientation,{vertical:be.ArrowUp,horizontal:be.ArrowLeft}):return z.preventDefault(),z.stopPropagation(),f.actions.goToOption({focus:fe.Previous});case be.Home:case be.PageUp:return z.preventDefault(),z.stopPropagation(),f.actions.goToOption({focus:fe.First});case be.End:case be.PageDown:return z.preventDefault(),z.stopPropagation(),f.actions.goToOption({focus:fe.Last});case be.Escape:z.preventDefault(),z.stopPropagation(),Se.flushSync(()=>f.actions.closeListbox()),(se=f.state.buttonElement)==null||se.focus({preventScroll:!0});return;case be.Tab:z.preventDefault(),z.stopPropagation(),Se.flushSync(()=>f.actions.closeListbox()),lc(f.state.buttonElement,z.shiftKey?Pr.Previous:Pr.Next);break;default:z.key.length===1&&(f.actions.search(z.key),_.setTimeout(()=>f.actions.clearSearch(),350));break}}),W=Ue(f,z=>{var J;return(J=z.buttonElement)==null?void 0:J.id}),Y=m.useMemo(()=>({open:g===ye.Open}),[g]),q=oi(a?x():{},{id:r,ref:I,"aria-activedescendant":Ue(f,f.selectors.activeDescendantId),"aria-multiselectable":p.mode===tt.Multi?!0:void 0,"aria-labelledby":W,"aria-orientation":p.orientation,onKeyDown:V,role:"listbox",tabIndex:g===ye.Open?0:void 0,style:{...s.style,...P,"--button-width":Bu(v,!0).width},...Bi(k)}),G=Me(),H=m.useMemo(()=>p.mode===tt.Multi?p:{...p,isSelected:L},[p,L]);return m.createElement(Md,{enabled:i?e.static||j:!1,ownerDocument:w},m.createElement(_n.Provider,{value:H},G({ourProps:q,theirProps:s,slot:Y,defaultTag:Zd,features:Jd,visible:y,name:"Listbox.Options"})))}let tp="div";function np(e,t){let n=m.useId(),{id:r=`headlessui-listbox-option-${n}`,disabled:o=!1,value:i,...l}=e,u=m.useContext(Hs)===!0,s=nn("Listbox.Option"),a=to("Listbox.Option"),c=Ue(a,y=>a.selectors.isActive(y,r)),d=s.isSelected(i),p=m.useRef(null),f=zd(p),g=Ot({disabled:o,value:i,domRef:p,get textValue(){return f()}}),v=Be(t,p,y=>{y?s.listRef.current.set(r,y):s.listRef.current.delete(r)}),E=Ue(a,y=>a.selectors.shouldScrollIntoView(y,r));ue(()=>{if(E)return Ke().requestAnimationFrame(()=>{var y,$;($=(y=p.current)==null?void 0:y.scrollIntoView)==null||$.call(y,{block:"nearest"})})},[E,p]),ue(()=>{if(!u)return a.actions.registerOption(r,g),()=>a.actions.unregisterOption(r)},[g,r,u]);let M=ne(y=>{var $;if(o)return y.preventDefault();a.actions.onChange(i),s.mode===tt.Single&&(Se.flushSync(()=>a.actions.closeListbox()),($=a.state.buttonElement)==null||$.focus({preventScroll:!0}))}),w=ne(()=>{if(o)return a.actions.goToOption({focus:fe.Nothing});a.actions.goToOption({focus:fe.Specific,id:r})}),N=Cc(),F=ne(y=>N.update(y)),j=ne(y=>{N.wasMoved(y)&&(o||c&&a.state.activationTrigger===kn.Pointer||a.actions.goToOption({focus:fe.Specific,id:r},kn.Pointer))}),k=ne(y=>{N.wasMoved(y)&&(o||c&&a.state.activationTrigger===kn.Pointer&&a.actions.goToOption({focus:fe.Nothing}))}),B=m.useMemo(()=>({active:c,focus:c,selected:d,disabled:o,selectedOption:d&&u}),[c,d,o,u]),h=u?{}:{id:r,ref:v,role:"option",tabIndex:o===!0?void 0:-1,"aria-disabled":o===!0?!0:void 0,"aria-selected":d,disabled:void 0,onClick:M,onFocus:w,onPointerEnter:F,onMouseEnter:F,onPointerMove:j,onMouseMove:j,onPointerLeave:k,onMouseLeave:k},b=Me();return!d&&u?null:b({ourProps:h,theirProps:l,slot:B,defaultTag:tp,name:"Listbox.Option"})}let rp=m.Fragment;function op(e,t){let{options:n,placeholder:r,...o}=e,i={ref:Be(t)},l=nn("ListboxSelectedOption"),u=m.useMemo(()=>({}),[]),s=l.value===void 0||l.value===null||l.mode===tt.Multi&&Array.isArray(l.value)&&l.value.length===0,a=Me();return m.createElement(Hs.Provider,{value:!0},a({ourProps:i,theirProps:{...o,children:m.createElement(m.Fragment,null,r&&s?r:n)},slot:u,defaultTag:rp,name:"ListboxSelectedOption"}))}let ip=Ne(qd),sp=Ne(Qd),lp=Fu,ap=Ne(ep),up=Ne(np),cp=Ne(op),wt=Object.assign(ip,{Button:sp,Label:lp,Options:ap,Option:up,SelectedOption:cp});function fp({title:e,titleId:t,...n},r){return R.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?R.createElement("title",{id:t},e):null,R.createElement("path",{fillRule:"evenodd",d:"M16.704 4.153a.75.75 0 0 1 .143 1.052l-8 10.5a.75.75 0 0 1-1.127.075l-4.5-4.5a.75.75 0 0 1 1.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 0 1 1.05-.143Z",clipRule:"evenodd"}))}const Gs=R.forwardRef(fp),dp=({tokens:e,selectedToken:t,onTokenChange:n,disabled:r=!1,className:o=""})=>{const{t:i}=Ye();return S.jsx("div",{className:`relative ${o}`,children:S.jsx(wt,{value:t,onChange:n,disabled:r,children:({open:l})=>S.jsxs(S.Fragment,{children:[S.jsxs(wt.Button,{className:`
|
|
84
84
|
relative w-full h-9 text-text-primary bg-fill-input-primary
|
|
85
85
|
items-center justify-between flex px-3 rounded-lg
|
|
86
86
|
focus:outline-none
|
|
87
87
|
${r?"opacity-50 cursor-not-allowed":"cursor-pointer hover:bg-fill-btn-secondary-hover"}
|
|
88
88
|
${l?"ring-1 ring-white":""}
|
|
89
|
-
`,children:[
|
|
89
|
+
`,children:[S.jsx("span",{className:"text-sm leading-[18px] font-medium",children:i("deposit.asset")}),S.jsxs("div",{className:"flex items-center",children:[t.iconUrl?S.jsx("img",{src:t.iconUrl,alt:t.token,className:"w-4 h-4 rounded-full"}):S.jsx("div",{className:"w-4 h-4 rounded-full bg-green-500 flex items-center justify-center",children:S.jsx("span",{className:"text-xs text-white font-bold",children:t.token.charAt(0)})}),S.jsx("span",{className:"text-sm text-white ml-1",children:t.symbol||t.token}),S.jsxs("svg",{className:`w-3 h-3 ml-2 transition-transform duration-200 ${l?"rotate-180":""}`,xmlns:"http://www.w3.org/2000/svg",width:"10",height:"11",viewBox:"0 0 10 11",fill:"none",children:[S.jsx("g",{clipPath:"url(#clip0_12919_27745)",children:S.jsx("path",{d:"M5.32733 7.6716C5.13944 7.83432 4.86056 7.83432 4.67267 7.6716L1.68366 5.08304C1.33371 4.77997 1.54804 4.20508 2.01099 4.20508L7.98901 4.20508C8.45196 4.20508 8.66629 4.77998 8.31634 5.08304L5.32733 7.6716Z",fill:"#F9F9F9"})}),S.jsx("defs",{children:S.jsx("clipPath",{id:"clip0_12919_27745",children:S.jsx("rect",{width:"10",height:"10",fill:"white",transform:"translate(0 0.955078)"})})})]})]})]}),S.jsx(Rs,{as:m.Fragment,enter:"transition ease-out duration-100",enterFrom:"transform opacity-0 scale-95",enterTo:"transform opacity-100 scale-100",leave:"transition ease-in duration-75",leaveFrom:"transform opacity-100 scale-100",leaveTo:"transform opacity-0 scale-95",children:S.jsx(wt.Options,{className:`
|
|
90
90
|
absolute z-50 mt-1 w-full max-h-60 overflow-auto rounded-lg
|
|
91
91
|
bg-fill-input-primary border border-line-divider-secondary shadow-lg
|
|
92
92
|
focus:outline-none
|
|
93
|
-
`,children:e.map(u=>
|
|
93
|
+
`,children:e.map(u=>S.jsx(wt.Option,{value:u,className:({active:s,selected:a})=>`relative cursor-pointer select-none py-3 px-3 ${a?"bg-fill-btn-secondary":s?"bg-fill-input-secondary":""}`,children:({selected:s,active:a})=>S.jsxs("div",{className:"flex items-center justify-between",children:[S.jsxs("div",{className:"flex items-center space-x-3",children:[u.iconUrl?S.jsx("img",{src:u.iconUrl,alt:u.token,className:"w-5 h-5 rounded-full"}):S.jsx("div",{className:"w-5 h-5 rounded-full bg-green-500 flex items-center justify-center",children:S.jsx("span",{className:"text-xs text-white font-bold",children:u.token.charAt(0)})}),S.jsx("div",{className:"flex flex-col",children:S.jsx("span",{className:`text-sm font-medium ${s||a?"text-text-primary":"text-text-tertiary"}`,children:u.symbol||u.token})})]}),s&&S.jsx(Gs,{className:"w-4 h-4 text-blue-400"})]})},u.tokenAddress))})})]})})})},pp=({chains:e,selectedChain:t,onChainChange:n,disabled:r=!1,className:o="",walletType:i="mpc"})=>{const{t:l}=Ye();return S.jsx("div",{className:`relative ${o}`,children:S.jsx(wt,{value:t,onChange:n,disabled:r,children:({open:u})=>S.jsxs(S.Fragment,{children:[S.jsxs(wt.Button,{className:`
|
|
94
94
|
relative w-full h-9 text-text-primary bg-fill-input-primary
|
|
95
95
|
items-center justify-between flex px-3 rounded-lg
|
|
96
96
|
focus:outline-none
|
|
97
97
|
${r?"opacity-50 cursor-not-allowed":"cursor-pointer hover:bg-fill-btn-secondary-hover"}
|
|
98
98
|
${u?"ring-1 ring-white":""}
|
|
99
|
-
`,children:[
|
|
99
|
+
`,children:[S.jsx("span",{className:"text-sm leading-[18px] font-medium",children:l("deposit.chain")}),S.jsxs("div",{className:"flex items-center space-x-2",children:[t.chainIconUrl?S.jsx("img",{src:t.chainIconUrl,alt:t.chain,className:"w-4 h-4 rounded-full"}):S.jsx("div",{className:"w-4 h-4 rounded-full bg-blue-500 flex items-center justify-center",children:S.jsx("span",{className:"text-xs text-white font-bold",children:t.chain.charAt(0)})}),S.jsx("span",{className:"text-sm text-white ml-1",children:t.chain}),S.jsxs("svg",{className:`w-3 h-3 ml-2 transition-transform duration-200 ${u?"rotate-180":""}`,xmlns:"http://www.w3.org/2000/svg",width:"10",height:"11",viewBox:"0 0 10 11",fill:"none",children:[S.jsx("g",{clipPath:"url(#clip0_12919_27745)",children:S.jsx("path",{d:"M5.32733 7.6716C5.13944 7.83432 4.86056 7.83432 4.67267 7.6716L1.68366 5.08304C1.33371 4.77997 1.54804 4.20508 2.01099 4.20508L7.98901 4.20508C8.45196 4.20508 8.66629 4.77998 8.31634 5.08304L5.32733 7.6716Z",fill:"#F9F9F9"})}),S.jsx("defs",{children:S.jsx("clipPath",{id:"clip0_12919_27745",children:S.jsx("rect",{width:"10",height:"10",fill:"white",transform:"translate(0 0.955078)"})})})]})]})]}),S.jsx(Rs,{as:m.Fragment,enter:"transition ease-out duration-100",enterFrom:"transform opacity-0 scale-95",enterTo:"transform opacity-100 scale-100",leave:"transition ease-in duration-75",leaveFrom:"transform opacity-100 scale-100",leaveTo:"transform opacity-0 scale-95",children:S.jsx(wt.Options,{className:`
|
|
100
100
|
absolute z-50 mt-1 w-full max-h-60 overflow-auto rounded-lg
|
|
101
101
|
bg-fill-input-primary border border-line-divider-secondary shadow-lg
|
|
102
102
|
focus:outline-none
|
|
103
|
-
`,children:e.filter(s=>s[i==="mpc"?"allowAaDeposit":"allowDeposit"]!==!1).map(s=>C.jsx(wt.Option,{value:s,className:({active:a,selected:c})=>`relative cursor-pointer select-none py-3 px-3 ${c?"bg-fill-btn-secondary":a?"bg-fill-input-secondary":""}`,children:({selected:a,active:c})=>C.jsxs("div",{className:"flex items-center justify-between",children:[C.jsxs("div",{className:"flex items-center space-x-3",children:[s.chainIconUrl?C.jsx("img",{src:s.chainIconUrl,alt:s.chain,className:"w-5 h-5 rounded-full"}):C.jsx("div",{className:"w-5 h-5 rounded-full bg-blue-500 flex items-center justify-center",children:C.jsx("span",{className:"text-xs text-white font-bold",children:s.chain.charAt(0)})}),C.jsx("div",{className:"flex flex-col",children:C.jsx("span",{className:`text-sm font-medium ${a||c?"text-text-primary":"text-text-tertiary"}`,children:s.chain})})]}),a&&C.jsx(Gs,{className:"w-4 h-4 text-blue-400"})]})},s.chainId))})})]})})})},to=({currentActiveChain:e,chainList:t,onChainChange:n,curSelectToken:r,onTokenChange:o,walletType:i="mpc"})=>{const l=m.useMemo(()=>(e==null?void 0:e.tokenList)||[],[e]),u=f=>{if(n(f.chainId),f.tokenList&&f.tokenList.length>0&&!f.tokenList.some(v=>v.token===r||v.symbol===r)){const v=f.tokenList[0];o(v.symbol||v.token)}},s=f=>{o(f.symbol||f.token)},a=m.useMemo(()=>t.map(f=>f),[t]),c=m.useMemo(()=>a.find(f=>f.chainId===e.chainId)||a[0],[a,e.chainId]),d=m.useMemo(()=>l.map(f=>({token:f.token,symbol:f.symbol,iconUrl:f.iconUrl,decimals:f.decimals,tokenAddress:f.tokenAddress})),[l]),p=m.useMemo(()=>{if(d.length!==0)return d.find(f=>f.token===r||f.symbol===r)||d[0]},[d,r]);return C.jsxs("div",{className:"space-y-4",children:[C.jsx(dp,{chains:a,selectedChain:c,onChainChange:f=>{const g=t.find(v=>v.chainId===f.chainId);g&&u(g)},walletType:i,className:"w-full"}),d.length>0?p&&C.jsx(fp,{tokens:d,selectedToken:p,onTokenChange:s,className:"w-full"}):C.jsx("div",{className:"w-full h-9 bg-fill-input-primary rounded-lg flex items-center justify-center",children:C.jsx("span",{className:"text-sm text-gray-400",children:"No tokens available"})})]})},pp=(e,t)=>Number(e)>Number(t),Xe=e=>{if(!e||e===""||isNaN(Number(e)))return"0.00";const t=Number(e);if(t===0)return"0.00";let n=t.toString();n.includes("e")&&(n=t.toFixed(20));const r=n.split("."),o=r[0];let i=r[1]||"";return i.length>6&&(i=i.substring(0,6)),i=i.replace(/0+$/,""),i?(i.length===1&&(i+="0"),o+"."+i):o+".00"},no=(e,t="0")=>{if(/[^0-9.]/.test(e))return{isValid:!1,formattedValue:"",errorType:"invalid_char"};if(e===".")return{isValid:!0,formattedValue:"0."};if((e.match(/\./g)||[]).length>1)return{isValid:!1,formattedValue:"",errorType:"invalid_char"};if(!e||e==="")return{isValid:!0,formattedValue:""};const o=e.split(".");if(o.length===2&&o[1].length>6){const s=o[0]+"."+o[1].substring(0,6);return no(s,t)}const i=parseFloat(e),l=parseFloat(t);return!isNaN(i)&&!isNaN(l)&&i>l?{isValid:!0,formattedValue:Xe(t),errorType:"auto_adjusted_to_max"}:{isValid:!0,formattedValue:e}},mp=(e,t,n)=>{if(!e||e===""||e==="0"||e==="0.00")return!1;const r=parseFloat(e),o=parseFloat(t);return!(isNaN(r)||isNaN(o)||r>o||!n)},Wn={ETHEREUM:1,ARBITRUM:42161,ARBITRUM_SEPOLIA:421614,SEPOLIA:11155111},hp=[Wn.ETHEREUM,Wn.SEPOLIA,Wn.ARBITRUM,Wn.ARBITRUM_SEPOLIA],gp=e=>{if(e.chainId!==void 0){const t=typeof e.chainId=="string"?parseInt(e.chainId,10):e.chainId;return!hp.includes(t)}return!0},vp=[{chainId:1,chain:"Ethereum",chainIconUrl:"https://static.edgex.exchange/icons/logo/ethereum.svg",allowDeposit:!0,blockTime:12,txConfirm:12},{chainId:42161,chain:"Arbitrum",chainIconUrl:"https://static.edgex.exchange/icons/logo/arbitrum.svg",allowDeposit:!0,blockTime:1,txConfirm:1}],ro={wallet:"mpc",ethAddress:"",accountId:"",l2Key:""},oo={address:""},io={multiChain:{minDeposit:10}};var Bn={},bp=function(){var e=document.getSelection();if(!e.rangeCount)return function(){};for(var t=document.activeElement,n=[],r=0;r<e.rangeCount;r++)n.push(e.getRangeAt(r));switch(t.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":t.blur();break;default:t=null;break}return e.removeAllRanges(),function(){e.type==="Caret"&&e.removeAllRanges(),e.rangeCount||n.forEach(function(o){e.addRange(o)}),t&&t.focus()}},xp=bp,Ys={"text/plain":"Text","text/html":"Url",default:"Text"},yp="Copy to clipboard: #{key}, Enter";function wp(e){var t=(/mac os x/i.test(navigator.userAgent)?"⌘":"Ctrl")+"+C";return e.replace(/#{\s*key\s*}/g,t)}function Ep(e,t){var n,r,o,i,l,u,s=!1;t||(t={}),n=t.debug||!1;try{o=xp(),i=document.createRange(),l=document.getSelection(),u=document.createElement("span"),u.textContent=e,u.ariaHidden="true",u.style.all="unset",u.style.position="fixed",u.style.top=0,u.style.clip="rect(0, 0, 0, 0)",u.style.whiteSpace="pre",u.style.webkitUserSelect="text",u.style.MozUserSelect="text",u.style.msUserSelect="text",u.style.userSelect="text",u.addEventListener("copy",function(c){if(c.stopPropagation(),t.format)if(c.preventDefault(),typeof c.clipboardData>"u"){n&&console.warn("unable to use e.clipboardData"),n&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var d=Ys[t.format]||Ys.default;window.clipboardData.setData(d,e)}else c.clipboardData.clearData(),c.clipboardData.setData(t.format,e);t.onCopy&&(c.preventDefault(),t.onCopy(c.clipboardData))}),document.body.appendChild(u),i.selectNodeContents(u),l.addRange(i);var a=document.execCommand("copy");if(!a)throw new Error("copy command was unsuccessful");s=!0}catch(c){n&&console.error("unable to copy using execCommand: ",c),n&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(t.format||"text",e),t.onCopy&&t.onCopy(window.clipboardData),s=!0}catch(d){n&&console.error("unable to copy using clipboardData: ",d),n&&console.error("falling back to prompt"),r=wp("message"in t?t.message:yp),window.prompt(r,e)}}finally{l&&(typeof l.removeRange=="function"?l.removeRange(i):l.removeAllRanges()),u&&document.body.removeChild(u),o()}return s}var Sp=Ep;function so(e){"@babel/helpers - typeof";return so=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},so(e)}Object.defineProperty(Bn,"__esModule",{value:!0}),Bn.CopyToClipboard=void 0;var Un=Ks(m),Cp=Ks(Sp),Op=["text","onCopy","options","children"];function Ks(e){return e&&e.__esModule?e:{default:e}}function qs(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function Xs(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?qs(Object(n),!0).forEach(function(r){ao(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):qs(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Tp(e,t){if(e==null)return{};var n=Np(e,t),r,o;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++)r=i[o],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Np(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i<r.length;i++)o=r[i],!(t.indexOf(o)>=0)&&(n[o]=e[o]);return n}function Pp(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Lp(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Ap(e,t,n){return t&&Lp(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function $p(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&lo(e,t)}function lo(e,t){return lo=Object.setPrototypeOf||function(r,o){return r.__proto__=o,r},lo(e,t)}function Dp(e){var t=Ip();return function(){var r=Vn(e),o;if(t){var i=Vn(this).constructor;o=Reflect.construct(r,arguments,i)}else o=r.apply(this,arguments);return Mp(this,o)}}function Mp(e,t){if(t&&(so(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Qs(e)}function Qs(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ip(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Vn(e){return Vn=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},Vn(e)}function ao(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Js=function(e){$p(n,e);var t=Dp(n);function n(){var r;Pp(this,n);for(var o=arguments.length,i=new Array(o),l=0;l<o;l++)i[l]=arguments[l];return r=t.call.apply(t,[this].concat(i)),ao(Qs(r),"onClick",function(u){var s=r.props,a=s.text,c=s.onCopy,d=s.children,p=s.options,f=Un.default.Children.only(d),g=(0,Cp.default)(a,p);c&&c(a,g),f&&f.props&&typeof f.props.onClick=="function"&&f.props.onClick(u)}),r}return Ap(n,[{key:"render",value:function(){var o=this.props;o.text,o.onCopy,o.options;var i=o.children,l=Tp(o,Op),u=Un.default.Children.only(i);return Un.default.cloneElement(u,Xs(Xs({},l),{},{onClick:this.onClick}))}}]),n}(Un.default.PureComponent);Bn.CopyToClipboard=Js,ao(Js,"defaultProps",{onCopy:void 0,options:void 0});var jp=Bn,uo=jp.CopyToClipboard;uo.CopyToClipboard=uo;var Fp=uo;const Rp=ia(Fp);var kp=Object.defineProperty,zn=Object.getOwnPropertySymbols,Zs=Object.prototype.hasOwnProperty,el=Object.prototype.propertyIsEnumerable,tl=(e,t,n)=>t in e?kp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,co=(e,t)=>{for(var n in t||(t={}))Zs.call(t,n)&&tl(e,n,t[n]);if(zn)for(var n of zn(t))el.call(t,n)&&tl(e,n,t[n]);return e},fo=(e,t)=>{var n={};for(var r in e)Zs.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&zn)for(var r of zn(e))t.indexOf(r)<0&&el.call(e,r)&&(n[r]=e[r]);return n};/**
|
|
103
|
+
`,children:e.filter(s=>s[i==="mpc"?"allowAaDeposit":"allowDeposit"]!==!1).map(s=>S.jsx(wt.Option,{value:s,className:({active:a,selected:c})=>`relative cursor-pointer select-none py-3 px-3 ${c?"bg-fill-btn-secondary":a?"bg-fill-input-secondary":""}`,children:({selected:a,active:c})=>S.jsxs("div",{className:"flex items-center justify-between",children:[S.jsxs("div",{className:"flex items-center space-x-3",children:[s.chainIconUrl?S.jsx("img",{src:s.chainIconUrl,alt:s.chain,className:"w-5 h-5 rounded-full"}):S.jsx("div",{className:"w-5 h-5 rounded-full bg-blue-500 flex items-center justify-center",children:S.jsx("span",{className:"text-xs text-white font-bold",children:s.chain.charAt(0)})}),S.jsx("div",{className:"flex flex-col",children:S.jsx("span",{className:`text-sm font-medium ${a||c?"text-text-primary":"text-text-tertiary"}`,children:s.chain})})]}),a&&S.jsx(Gs,{className:"w-4 h-4 text-blue-400"})]})},s.chainId))})})]})})})},no=({currentActiveChain:e,chainList:t,onChainChange:n,curSelectToken:r,onTokenChange:o,walletType:i="mpc"})=>{const l=m.useMemo(()=>(e==null?void 0:e.tokenList)||[],[e]),u=f=>{if(n(f.chainId),f.tokenList&&f.tokenList.length>0&&!f.tokenList.some(v=>v.token===r||v.symbol===r)){const v=f.tokenList[0];o(v.symbol||v.token)}},s=f=>{o(f.symbol||f.token)},a=m.useMemo(()=>t.map(f=>f),[t]),c=m.useMemo(()=>a.find(f=>f.chainId===e.chainId)||a[0],[a,e.chainId]),d=m.useMemo(()=>l.map(f=>({token:f.token,symbol:f.symbol,iconUrl:f.iconUrl,decimals:f.decimals,tokenAddress:f.tokenAddress})),[l]),p=m.useMemo(()=>{if(d.length!==0)return d.find(f=>f.token===r||f.symbol===r)||d[0]},[d,r]);return S.jsxs("div",{className:"space-y-4",children:[S.jsx(pp,{chains:a,selectedChain:c,onChainChange:f=>{const g=t.find(v=>v.chainId===f.chainId);g&&u(g)},walletType:i,className:"w-full"}),d.length>0?p&&S.jsx(dp,{tokens:d,selectedToken:p,onTokenChange:s,className:"w-full"}):S.jsx("div",{className:"w-full h-9 bg-fill-input-primary rounded-lg flex items-center justify-center",children:S.jsx("span",{className:"text-sm text-gray-400",children:"No tokens available"})})]})},mp=(e,t)=>Number(e)>Number(t),Xe=e=>{if(!e||e===""||isNaN(Number(e)))return"0.00";const t=Number(e);if(t===0)return"0.00";let n=t.toString();n.includes("e")&&(n=t.toFixed(20));const r=n.split("."),o=r[0];let i=r[1]||"";return i.length>6&&(i=i.substring(0,6)),i=i.replace(/0+$/,""),i?(i.length===1&&(i+="0"),o+"."+i):o+".00"},ro=(e,t="0")=>{if(/[^0-9.]/.test(e))return{isValid:!1,formattedValue:"",errorType:"invalid_char"};if(e===".")return{isValid:!0,formattedValue:"0."};if((e.match(/\./g)||[]).length>1)return{isValid:!1,formattedValue:"",errorType:"invalid_char"};if(!e||e==="")return{isValid:!0,formattedValue:""};const o=e.split(".");if(o.length===2&&o[1].length>6){const s=o[0]+"."+o[1].substring(0,6);return ro(s,t)}const i=parseFloat(e),l=parseFloat(t);return!isNaN(i)&&!isNaN(l)&&i>l?{isValid:!0,formattedValue:Xe(t),errorType:"auto_adjusted_to_max"}:{isValid:!0,formattedValue:e}},hp=(e,t,n)=>{if(!e||e===""||e==="0"||e==="0.00")return!1;const r=parseFloat(e),o=parseFloat(t);return!(isNaN(r)||isNaN(o)||r>o||!n)},Bn={ETHEREUM:1,ARBITRUM:42161,ARBITRUM_SEPOLIA:421614,SEPOLIA:11155111},gp=[Bn.ETHEREUM,Bn.SEPOLIA,Bn.ARBITRUM,Bn.ARBITRUM_SEPOLIA],vp=e=>{if(e.chainId!==void 0){const t=typeof e.chainId=="string"?parseInt(e.chainId,10):e.chainId;return!gp.includes(t)}return!0},Ys=(e,t,n)=>{const r=typeof e=="string"?parseInt(e,10):e,o=r===42161||r===421614,i=(t==null?void 0:t.toUpperCase())==="USDT";if(!o||!i)return!1;try{const l=new xe(n||"0"),u=new xe("200000");return l.isNaN()||u.isNaN()?!1:l.gte(u)}catch{return!1}},bp=[{chainId:1,chain:"Ethereum",chainIconUrl:"https://static.edgex.exchange/icons/logo/ethereum.svg",allowDeposit:!0,blockTime:12,txConfirm:12},{chainId:42161,chain:"Arbitrum",chainIconUrl:"https://static.edgex.exchange/icons/logo/arbitrum.svg",allowDeposit:!0,blockTime:1,txConfirm:1}],oo={wallet:"mpc",ethAddress:"",accountId:"",l2Key:""},io={address:""},so={multiChain:{minDeposit:10}};var Wn={},yp=function(){var e=document.getSelection();if(!e.rangeCount)return function(){};for(var t=document.activeElement,n=[],r=0;r<e.rangeCount;r++)n.push(e.getRangeAt(r));switch(t.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":t.blur();break;default:t=null;break}return e.removeAllRanges(),function(){e.type==="Caret"&&e.removeAllRanges(),e.rangeCount||n.forEach(function(o){e.addRange(o)}),t&&t.focus()}},xp=yp,Ks={"text/plain":"Text","text/html":"Url",default:"Text"},wp="Copy to clipboard: #{key}, Enter";function Ep(e){var t=(/mac os x/i.test(navigator.userAgent)?"⌘":"Ctrl")+"+C";return e.replace(/#{\s*key\s*}/g,t)}function Sp(e,t){var n,r,o,i,l,u,s=!1;t||(t={}),n=t.debug||!1;try{o=xp(),i=document.createRange(),l=document.getSelection(),u=document.createElement("span"),u.textContent=e,u.ariaHidden="true",u.style.all="unset",u.style.position="fixed",u.style.top=0,u.style.clip="rect(0, 0, 0, 0)",u.style.whiteSpace="pre",u.style.webkitUserSelect="text",u.style.MozUserSelect="text",u.style.msUserSelect="text",u.style.userSelect="text",u.addEventListener("copy",function(c){if(c.stopPropagation(),t.format)if(c.preventDefault(),typeof c.clipboardData>"u"){n&&console.warn("unable to use e.clipboardData"),n&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var d=Ks[t.format]||Ks.default;window.clipboardData.setData(d,e)}else c.clipboardData.clearData(),c.clipboardData.setData(t.format,e);t.onCopy&&(c.preventDefault(),t.onCopy(c.clipboardData))}),document.body.appendChild(u),i.selectNodeContents(u),l.addRange(i);var a=document.execCommand("copy");if(!a)throw new Error("copy command was unsuccessful");s=!0}catch(c){n&&console.error("unable to copy using execCommand: ",c),n&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(t.format||"text",e),t.onCopy&&t.onCopy(window.clipboardData),s=!0}catch(d){n&&console.error("unable to copy using clipboardData: ",d),n&&console.error("falling back to prompt"),r=Ep("message"in t?t.message:wp),window.prompt(r,e)}}finally{l&&(typeof l.removeRange=="function"?l.removeRange(i):l.removeAllRanges()),u&&document.body.removeChild(u),o()}return s}var Cp=Sp;function lo(e){"@babel/helpers - typeof";return lo=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},lo(e)}Object.defineProperty(Wn,"__esModule",{value:!0}),Wn.CopyToClipboard=void 0;var Un=qs(m),Op=qs(Cp),Tp=["text","onCopy","options","children"];function qs(e){return e&&e.__esModule?e:{default:e}}function Xs(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function Qs(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Xs(Object(n),!0).forEach(function(r){uo(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Xs(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Np(e,t){if(e==null)return{};var n=Lp(e,t),r,o;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++)r=i[o],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Lp(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i<r.length;i++)o=r[i],!(t.indexOf(o)>=0)&&(n[o]=e[o]);return n}function Pp(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Dp(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function $p(e,t,n){return t&&Dp(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ap(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ao(e,t)}function ao(e,t){return ao=Object.setPrototypeOf||function(r,o){return r.__proto__=o,r},ao(e,t)}function Mp(e){var t=jp();return function(){var r=Vn(e),o;if(t){var i=Vn(this).constructor;o=Reflect.construct(r,arguments,i)}else o=r.apply(this,arguments);return Ip(this,o)}}function Ip(e,t){if(t&&(lo(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Zs(e)}function Zs(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function jp(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Vn(e){return Vn=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},Vn(e)}function uo(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Js=function(e){Ap(n,e);var t=Mp(n);function n(){var r;Pp(this,n);for(var o=arguments.length,i=new Array(o),l=0;l<o;l++)i[l]=arguments[l];return r=t.call.apply(t,[this].concat(i)),uo(Zs(r),"onClick",function(u){var s=r.props,a=s.text,c=s.onCopy,d=s.children,p=s.options,f=Un.default.Children.only(d),g=(0,Op.default)(a,p);c&&c(a,g),f&&f.props&&typeof f.props.onClick=="function"&&f.props.onClick(u)}),r}return $p(n,[{key:"render",value:function(){var o=this.props;o.text,o.onCopy,o.options;var i=o.children,l=Np(o,Tp),u=Un.default.Children.only(i);return Un.default.cloneElement(u,Qs(Qs({},l),{},{onClick:this.onClick}))}}]),n}(Un.default.PureComponent);Wn.CopyToClipboard=Js,uo(Js,"defaultProps",{onCopy:void 0,options:void 0});var Fp=Wn,co=Fp.CopyToClipboard;co.CopyToClipboard=co;var Rp=co;const kp=sa(Rp);var _p=Object.defineProperty,zn=Object.getOwnPropertySymbols,el=Object.prototype.hasOwnProperty,tl=Object.prototype.propertyIsEnumerable,nl=(e,t,n)=>t in e?_p(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,fo=(e,t)=>{for(var n in t||(t={}))el.call(t,n)&&nl(e,n,t[n]);if(zn)for(var n of zn(t))tl.call(t,n)&&nl(e,n,t[n]);return e},po=(e,t)=>{var n={};for(var r in e)el.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&zn)for(var r of zn(e))t.indexOf(r)<0&&tl.call(e,r)&&(n[r]=e[r]);return n};/**
|
|
104
104
|
* @license QR Code generator library (TypeScript)
|
|
105
105
|
* Copyright (c) Project Nayuki.
|
|
106
106
|
* SPDX-License-Identifier: MIT
|
|
107
|
-
*/var Lt;(e=>{const t=class ee{constructor(s,a,c,d){if(this.version=s,this.errorCorrectionLevel=a,this.modules=[],this.isFunction=[],s<ee.MIN_VERSION||s>ee.MAX_VERSION)throw new RangeError("Version value out of range");if(d<-1||d>7)throw new RangeError("Mask value out of range");this.size=s*4+17;let p=[];for(let g=0;g<this.size;g++)p.push(!1);for(let g=0;g<this.size;g++)this.modules.push(p.slice()),this.isFunction.push(p.slice());this.drawFunctionPatterns();const f=this.addEccAndInterleave(c);if(this.drawCodewords(f),d==-1){let g=1e9;for(let v=0;v<8;v++){this.applyMask(v),this.drawFormatBits(v);const E=this.getPenaltyScore();E<g&&(d=v,g=E),this.applyMask(v)}}o(0<=d&&d<=7),this.mask=d,this.applyMask(d),this.drawFormatBits(d),this.isFunction=[]}static encodeText(s,a){const c=e.QrSegment.makeSegments(s);return ee.encodeSegments(c,a)}static encodeBinary(s,a){const c=e.QrSegment.makeBytes(s);return ee.encodeSegments([c],a)}static encodeSegments(s,a,c=1,d=40,p=-1,f=!0){if(!(ee.MIN_VERSION<=c&&c<=d&&d<=ee.MAX_VERSION)||p<-1||p>7)throw new RangeError("Invalid value");let g,v;for(g=c;;g++){const N=ee.getNumDataCodewords(g,a)*8,j=l.getTotalBits(s,g);if(j<=N){v=j;break}if(g>=d)throw new RangeError("Data too long")}for(const N of[ee.Ecc.MEDIUM,ee.Ecc.QUARTILE,ee.Ecc.HIGH])f&&v<=ee.getNumDataCodewords(g,N)*8&&(a=N);let E=[];for(const N of s){n(N.mode.modeBits,4,E),n(N.numChars,N.mode.numCharCountBits(g),E);for(const j of N.getData())E.push(j)}o(E.length==v);const M=ee.getNumDataCodewords(g,a)*8;o(E.length<=M),n(0,Math.min(4,M-E.length),E),n(0,(8-E.length%8)%8,E),o(E.length%8==0);for(let N=236;E.length<M;N^=253)n(N,8,E);let w=[];for(;w.length*8<E.length;)w.push(0);return E.forEach((N,j)=>w[j>>>3]|=N<<7-(j&7)),new ee(g,a,w,p)}getModule(s,a){return 0<=s&&s<this.size&&0<=a&&a<this.size&&this.modules[a][s]}getModules(){return this.modules}drawFunctionPatterns(){for(let c=0;c<this.size;c++)this.setFunctionModule(6,c,c%2==0),this.setFunctionModule(c,6,c%2==0);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);const s=this.getAlignmentPatternPositions(),a=s.length;for(let c=0;c<a;c++)for(let d=0;d<a;d++)c==0&&d==0||c==0&&d==a-1||c==a-1&&d==0||this.drawAlignmentPattern(s[c],s[d]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(s){const a=this.errorCorrectionLevel.formatBits<<3|s;let c=a;for(let p=0;p<10;p++)c=c<<1^(c>>>9)*1335;const d=(a<<10|c)^21522;o(d>>>15==0);for(let p=0;p<=5;p++)this.setFunctionModule(8,p,r(d,p));this.setFunctionModule(8,7,r(d,6)),this.setFunctionModule(8,8,r(d,7)),this.setFunctionModule(7,8,r(d,8));for(let p=9;p<15;p++)this.setFunctionModule(14-p,8,r(d,p));for(let p=0;p<8;p++)this.setFunctionModule(this.size-1-p,8,r(d,p));for(let p=8;p<15;p++)this.setFunctionModule(8,this.size-15+p,r(d,p));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let s=this.version;for(let c=0;c<12;c++)s=s<<1^(s>>>11)*7973;const a=this.version<<12|s;o(a>>>18==0);for(let c=0;c<18;c++){const d=r(a,c),p=this.size-11+c%3,f=Math.floor(c/3);this.setFunctionModule(p,f,d),this.setFunctionModule(f,p,d)}}drawFinderPattern(s,a){for(let c=-4;c<=4;c++)for(let d=-4;d<=4;d++){const p=Math.max(Math.abs(d),Math.abs(c)),f=s+d,g=a+c;0<=f&&f<this.size&&0<=g&&g<this.size&&this.setFunctionModule(f,g,p!=2&&p!=4)}}drawAlignmentPattern(s,a){for(let c=-2;c<=2;c++)for(let d=-2;d<=2;d++)this.setFunctionModule(s+d,a+c,Math.max(Math.abs(d),Math.abs(c))!=1)}setFunctionModule(s,a,c){this.modules[a][s]=c,this.isFunction[a][s]=!0}addEccAndInterleave(s){const a=this.version,c=this.errorCorrectionLevel;if(s.length!=ee.getNumDataCodewords(a,c))throw new RangeError("Invalid argument");const d=ee.NUM_ERROR_CORRECTION_BLOCKS[c.ordinal][a],p=ee.ECC_CODEWORDS_PER_BLOCK[c.ordinal][a],f=Math.floor(ee.getNumRawDataModules(a)/8),g=d-f%d,v=Math.floor(f/d);let E=[];const M=ee.reedSolomonComputeDivisor(p);for(let N=0,j=0;N<d;N++){let F=s.slice(j,j+v-p+(N<g?0:1));j+=F.length;const k=ee.reedSolomonComputeRemainder(F,M);N<g&&F.push(0),E.push(F.concat(k))}let w=[];for(let N=0;N<E[0].length;N++)E.forEach((j,F)=>{(N!=v-p||F>=g)&&w.push(j[N])});return o(w.length==f),w}drawCodewords(s){if(s.length!=Math.floor(ee.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");let a=0;for(let c=this.size-1;c>=1;c-=2){c==6&&(c=5);for(let d=0;d<this.size;d++)for(let p=0;p<2;p++){const f=c-p,v=(c+1&2)==0?this.size-1-d:d;!this.isFunction[v][f]&&a<s.length*8&&(this.modules[v][f]=r(s[a>>>3],7-(a&7)),a++)}}o(a==s.length*8)}applyMask(s){if(s<0||s>7)throw new RangeError("Mask value out of range");for(let a=0;a<this.size;a++)for(let c=0;c<this.size;c++){let d;switch(s){case 0:d=(c+a)%2==0;break;case 1:d=a%2==0;break;case 2:d=c%3==0;break;case 3:d=(c+a)%3==0;break;case 4:d=(Math.floor(c/3)+Math.floor(a/2))%2==0;break;case 5:d=c*a%2+c*a%3==0;break;case 6:d=(c*a%2+c*a%3)%2==0;break;case 7:d=((c+a)%2+c*a%3)%2==0;break;default:throw new Error("Unreachable")}!this.isFunction[a][c]&&d&&(this.modules[a][c]=!this.modules[a][c])}}getPenaltyScore(){let s=0;for(let p=0;p<this.size;p++){let f=!1,g=0,v=[0,0,0,0,0,0,0];for(let E=0;E<this.size;E++)this.modules[p][E]==f?(g++,g==5?s+=ee.PENALTY_N1:g>5&&s++):(this.finderPenaltyAddHistory(g,v),f||(s+=this.finderPenaltyCountPatterns(v)*ee.PENALTY_N3),f=this.modules[p][E],g=1);s+=this.finderPenaltyTerminateAndCount(f,g,v)*ee.PENALTY_N3}for(let p=0;p<this.size;p++){let f=!1,g=0,v=[0,0,0,0,0,0,0];for(let E=0;E<this.size;E++)this.modules[E][p]==f?(g++,g==5?s+=ee.PENALTY_N1:g>5&&s++):(this.finderPenaltyAddHistory(g,v),f||(s+=this.finderPenaltyCountPatterns(v)*ee.PENALTY_N3),f=this.modules[E][p],g=1);s+=this.finderPenaltyTerminateAndCount(f,g,v)*ee.PENALTY_N3}for(let p=0;p<this.size-1;p++)for(let f=0;f<this.size-1;f++){const g=this.modules[p][f];g==this.modules[p][f+1]&&g==this.modules[p+1][f]&&g==this.modules[p+1][f+1]&&(s+=ee.PENALTY_N2)}let a=0;for(const p of this.modules)a=p.reduce((f,g)=>f+(g?1:0),a);const c=this.size*this.size,d=Math.ceil(Math.abs(a*20-c*10)/c)-1;return o(0<=d&&d<=9),s+=d*ee.PENALTY_N4,o(0<=s&&s<=2568888),s}getAlignmentPatternPositions(){if(this.version==1)return[];{const s=Math.floor(this.version/7)+2,a=this.version==32?26:Math.ceil((this.version*4+4)/(s*2-2))*2;let c=[6];for(let d=this.size-7;c.length<s;d-=a)c.splice(1,0,d);return c}}static getNumRawDataModules(s){if(s<ee.MIN_VERSION||s>ee.MAX_VERSION)throw new RangeError("Version number out of range");let a=(16*s+128)*s+64;if(s>=2){const c=Math.floor(s/7)+2;a-=(25*c-10)*c-55,s>=7&&(a-=36)}return o(208<=a&&a<=29648),a}static getNumDataCodewords(s,a){return Math.floor(ee.getNumRawDataModules(s)/8)-ee.ECC_CODEWORDS_PER_BLOCK[a.ordinal][s]*ee.NUM_ERROR_CORRECTION_BLOCKS[a.ordinal][s]}static reedSolomonComputeDivisor(s){if(s<1||s>255)throw new RangeError("Degree out of range");let a=[];for(let d=0;d<s-1;d++)a.push(0);a.push(1);let c=1;for(let d=0;d<s;d++){for(let p=0;p<a.length;p++)a[p]=ee.reedSolomonMultiply(a[p],c),p+1<a.length&&(a[p]^=a[p+1]);c=ee.reedSolomonMultiply(c,2)}return a}static reedSolomonComputeRemainder(s,a){let c=a.map(d=>0);for(const d of s){const p=d^c.shift();c.push(0),a.forEach((f,g)=>c[g]^=ee.reedSolomonMultiply(f,p))}return c}static reedSolomonMultiply(s,a){if(s>>>8||a>>>8)throw new RangeError("Byte out of range");let c=0;for(let d=7;d>=0;d--)c=c<<1^(c>>>7)*285,c^=(a>>>d&1)*s;return o(c>>>8==0),c}finderPenaltyCountPatterns(s){const a=s[1];o(a<=this.size*3);const c=a>0&&s[2]==a&&s[3]==a*3&&s[4]==a&&s[5]==a;return(c&&s[0]>=a*4&&s[6]>=a?1:0)+(c&&s[6]>=a*4&&s[0]>=a?1:0)}finderPenaltyTerminateAndCount(s,a,c){return s&&(this.finderPenaltyAddHistory(a,c),a=0),a+=this.size,this.finderPenaltyAddHistory(a,c),this.finderPenaltyCountPatterns(c)}finderPenaltyAddHistory(s,a){a[0]==0&&(s+=this.size),a.pop(),a.unshift(s)}};t.MIN_VERSION=1,t.MAX_VERSION=40,t.PENALTY_N1=3,t.PENALTY_N2=3,t.PENALTY_N3=40,t.PENALTY_N4=10,t.ECC_CODEWORDS_PER_BLOCK=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],t.NUM_ERROR_CORRECTION_BLOCKS=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]],e.QrCode=t;function n(u,s,a){if(s<0||s>31||u>>>s)throw new RangeError("Value out of range");for(let c=s-1;c>=0;c--)a.push(u>>>c&1)}function r(u,s){return(u>>>s&1)!=0}function o(u){if(!u)throw new Error("Assertion error")}const i=class de{constructor(s,a,c){if(this.mode=s,this.numChars=a,this.bitData=c,a<0)throw new RangeError("Invalid argument");this.bitData=c.slice()}static makeBytes(s){let a=[];for(const c of s)n(c,8,a);return new de(de.Mode.BYTE,s.length,a)}static makeNumeric(s){if(!de.isNumeric(s))throw new RangeError("String contains non-numeric characters");let a=[];for(let c=0;c<s.length;){const d=Math.min(s.length-c,3);n(parseInt(s.substring(c,c+d),10),d*3+1,a),c+=d}return new de(de.Mode.NUMERIC,s.length,a)}static makeAlphanumeric(s){if(!de.isAlphanumeric(s))throw new RangeError("String contains unencodable characters in alphanumeric mode");let a=[],c;for(c=0;c+2<=s.length;c+=2){let d=de.ALPHANUMERIC_CHARSET.indexOf(s.charAt(c))*45;d+=de.ALPHANUMERIC_CHARSET.indexOf(s.charAt(c+1)),n(d,11,a)}return c<s.length&&n(de.ALPHANUMERIC_CHARSET.indexOf(s.charAt(c)),6,a),new de(de.Mode.ALPHANUMERIC,s.length,a)}static makeSegments(s){return s==""?[]:de.isNumeric(s)?[de.makeNumeric(s)]:de.isAlphanumeric(s)?[de.makeAlphanumeric(s)]:[de.makeBytes(de.toUtf8ByteArray(s))]}static makeEci(s){let a=[];if(s<0)throw new RangeError("ECI assignment value out of range");if(s<128)n(s,8,a);else if(s<16384)n(2,2,a),n(s,14,a);else if(s<1e6)n(6,3,a),n(s,21,a);else throw new RangeError("ECI assignment value out of range");return new de(de.Mode.ECI,0,a)}static isNumeric(s){return de.NUMERIC_REGEX.test(s)}static isAlphanumeric(s){return de.ALPHANUMERIC_REGEX.test(s)}getData(){return this.bitData.slice()}static getTotalBits(s,a){let c=0;for(const d of s){const p=d.mode.numCharCountBits(a);if(d.numChars>=1<<p)return 1/0;c+=4+p+d.bitData.length}return c}static toUtf8ByteArray(s){s=encodeURI(s);let a=[];for(let c=0;c<s.length;c++)s.charAt(c)!="%"?a.push(s.charCodeAt(c)):(a.push(parseInt(s.substring(c+1,c+3),16)),c+=2);return a}};i.NUMERIC_REGEX=/^[0-9]*$/,i.ALPHANUMERIC_REGEX=/^[A-Z0-9 $%*+.\/:-]*$/,i.ALPHANUMERIC_CHARSET="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:";let l=i;e.QrSegment=i})(Lt||(Lt={})),(e=>{(t=>{const n=class{constructor(o,i){this.ordinal=o,this.formatBits=i}};n.LOW=new n(0,1),n.MEDIUM=new n(1,0),n.QUARTILE=new n(2,3),n.HIGH=new n(3,2),t.Ecc=n})(e.QrCode||(e.QrCode={}))})(Lt||(Lt={})),(e=>{(t=>{const n=class{constructor(o,i){this.modeBits=o,this.numBitsCharCount=i}numCharCountBits(o){return this.numBitsCharCount[Math.floor((o+7)/17)]}};n.NUMERIC=new n(1,[10,12,14]),n.ALPHANUMERIC=new n(2,[9,11,13]),n.BYTE=new n(4,[8,16,16]),n.KANJI=new n(8,[8,10,12]),n.ECI=new n(7,[0,0,0]),t.Mode=n})(e.QrSegment||(e.QrSegment={}))})(Lt||(Lt={}));var kt=Lt;/**
|
|
107
|
+
*/var Pt;(e=>{const t=class ee{constructor(s,a,c,d){if(this.version=s,this.errorCorrectionLevel=a,this.modules=[],this.isFunction=[],s<ee.MIN_VERSION||s>ee.MAX_VERSION)throw new RangeError("Version value out of range");if(d<-1||d>7)throw new RangeError("Mask value out of range");this.size=s*4+17;let p=[];for(let g=0;g<this.size;g++)p.push(!1);for(let g=0;g<this.size;g++)this.modules.push(p.slice()),this.isFunction.push(p.slice());this.drawFunctionPatterns();const f=this.addEccAndInterleave(c);if(this.drawCodewords(f),d==-1){let g=1e9;for(let v=0;v<8;v++){this.applyMask(v),this.drawFormatBits(v);const E=this.getPenaltyScore();E<g&&(d=v,g=E),this.applyMask(v)}}o(0<=d&&d<=7),this.mask=d,this.applyMask(d),this.drawFormatBits(d),this.isFunction=[]}static encodeText(s,a){const c=e.QrSegment.makeSegments(s);return ee.encodeSegments(c,a)}static encodeBinary(s,a){const c=e.QrSegment.makeBytes(s);return ee.encodeSegments([c],a)}static encodeSegments(s,a,c=1,d=40,p=-1,f=!0){if(!(ee.MIN_VERSION<=c&&c<=d&&d<=ee.MAX_VERSION)||p<-1||p>7)throw new RangeError("Invalid value");let g,v;for(g=c;;g++){const N=ee.getNumDataCodewords(g,a)*8,F=l.getTotalBits(s,g);if(F<=N){v=F;break}if(g>=d)throw new RangeError("Data too long")}for(const N of[ee.Ecc.MEDIUM,ee.Ecc.QUARTILE,ee.Ecc.HIGH])f&&v<=ee.getNumDataCodewords(g,N)*8&&(a=N);let E=[];for(const N of s){n(N.mode.modeBits,4,E),n(N.numChars,N.mode.numCharCountBits(g),E);for(const F of N.getData())E.push(F)}o(E.length==v);const M=ee.getNumDataCodewords(g,a)*8;o(E.length<=M),n(0,Math.min(4,M-E.length),E),n(0,(8-E.length%8)%8,E),o(E.length%8==0);for(let N=236;E.length<M;N^=253)n(N,8,E);let w=[];for(;w.length*8<E.length;)w.push(0);return E.forEach((N,F)=>w[F>>>3]|=N<<7-(F&7)),new ee(g,a,w,p)}getModule(s,a){return 0<=s&&s<this.size&&0<=a&&a<this.size&&this.modules[a][s]}getModules(){return this.modules}drawFunctionPatterns(){for(let c=0;c<this.size;c++)this.setFunctionModule(6,c,c%2==0),this.setFunctionModule(c,6,c%2==0);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);const s=this.getAlignmentPatternPositions(),a=s.length;for(let c=0;c<a;c++)for(let d=0;d<a;d++)c==0&&d==0||c==0&&d==a-1||c==a-1&&d==0||this.drawAlignmentPattern(s[c],s[d]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(s){const a=this.errorCorrectionLevel.formatBits<<3|s;let c=a;for(let p=0;p<10;p++)c=c<<1^(c>>>9)*1335;const d=(a<<10|c)^21522;o(d>>>15==0);for(let p=0;p<=5;p++)this.setFunctionModule(8,p,r(d,p));this.setFunctionModule(8,7,r(d,6)),this.setFunctionModule(8,8,r(d,7)),this.setFunctionModule(7,8,r(d,8));for(let p=9;p<15;p++)this.setFunctionModule(14-p,8,r(d,p));for(let p=0;p<8;p++)this.setFunctionModule(this.size-1-p,8,r(d,p));for(let p=8;p<15;p++)this.setFunctionModule(8,this.size-15+p,r(d,p));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let s=this.version;for(let c=0;c<12;c++)s=s<<1^(s>>>11)*7973;const a=this.version<<12|s;o(a>>>18==0);for(let c=0;c<18;c++){const d=r(a,c),p=this.size-11+c%3,f=Math.floor(c/3);this.setFunctionModule(p,f,d),this.setFunctionModule(f,p,d)}}drawFinderPattern(s,a){for(let c=-4;c<=4;c++)for(let d=-4;d<=4;d++){const p=Math.max(Math.abs(d),Math.abs(c)),f=s+d,g=a+c;0<=f&&f<this.size&&0<=g&&g<this.size&&this.setFunctionModule(f,g,p!=2&&p!=4)}}drawAlignmentPattern(s,a){for(let c=-2;c<=2;c++)for(let d=-2;d<=2;d++)this.setFunctionModule(s+d,a+c,Math.max(Math.abs(d),Math.abs(c))!=1)}setFunctionModule(s,a,c){this.modules[a][s]=c,this.isFunction[a][s]=!0}addEccAndInterleave(s){const a=this.version,c=this.errorCorrectionLevel;if(s.length!=ee.getNumDataCodewords(a,c))throw new RangeError("Invalid argument");const d=ee.NUM_ERROR_CORRECTION_BLOCKS[c.ordinal][a],p=ee.ECC_CODEWORDS_PER_BLOCK[c.ordinal][a],f=Math.floor(ee.getNumRawDataModules(a)/8),g=d-f%d,v=Math.floor(f/d);let E=[];const M=ee.reedSolomonComputeDivisor(p);for(let N=0,F=0;N<d;N++){let j=s.slice(F,F+v-p+(N<g?0:1));F+=j.length;const k=ee.reedSolomonComputeRemainder(j,M);N<g&&j.push(0),E.push(j.concat(k))}let w=[];for(let N=0;N<E[0].length;N++)E.forEach((F,j)=>{(N!=v-p||j>=g)&&w.push(F[N])});return o(w.length==f),w}drawCodewords(s){if(s.length!=Math.floor(ee.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");let a=0;for(let c=this.size-1;c>=1;c-=2){c==6&&(c=5);for(let d=0;d<this.size;d++)for(let p=0;p<2;p++){const f=c-p,v=(c+1&2)==0?this.size-1-d:d;!this.isFunction[v][f]&&a<s.length*8&&(this.modules[v][f]=r(s[a>>>3],7-(a&7)),a++)}}o(a==s.length*8)}applyMask(s){if(s<0||s>7)throw new RangeError("Mask value out of range");for(let a=0;a<this.size;a++)for(let c=0;c<this.size;c++){let d;switch(s){case 0:d=(c+a)%2==0;break;case 1:d=a%2==0;break;case 2:d=c%3==0;break;case 3:d=(c+a)%3==0;break;case 4:d=(Math.floor(c/3)+Math.floor(a/2))%2==0;break;case 5:d=c*a%2+c*a%3==0;break;case 6:d=(c*a%2+c*a%3)%2==0;break;case 7:d=((c+a)%2+c*a%3)%2==0;break;default:throw new Error("Unreachable")}!this.isFunction[a][c]&&d&&(this.modules[a][c]=!this.modules[a][c])}}getPenaltyScore(){let s=0;for(let p=0;p<this.size;p++){let f=!1,g=0,v=[0,0,0,0,0,0,0];for(let E=0;E<this.size;E++)this.modules[p][E]==f?(g++,g==5?s+=ee.PENALTY_N1:g>5&&s++):(this.finderPenaltyAddHistory(g,v),f||(s+=this.finderPenaltyCountPatterns(v)*ee.PENALTY_N3),f=this.modules[p][E],g=1);s+=this.finderPenaltyTerminateAndCount(f,g,v)*ee.PENALTY_N3}for(let p=0;p<this.size;p++){let f=!1,g=0,v=[0,0,0,0,0,0,0];for(let E=0;E<this.size;E++)this.modules[E][p]==f?(g++,g==5?s+=ee.PENALTY_N1:g>5&&s++):(this.finderPenaltyAddHistory(g,v),f||(s+=this.finderPenaltyCountPatterns(v)*ee.PENALTY_N3),f=this.modules[E][p],g=1);s+=this.finderPenaltyTerminateAndCount(f,g,v)*ee.PENALTY_N3}for(let p=0;p<this.size-1;p++)for(let f=0;f<this.size-1;f++){const g=this.modules[p][f];g==this.modules[p][f+1]&&g==this.modules[p+1][f]&&g==this.modules[p+1][f+1]&&(s+=ee.PENALTY_N2)}let a=0;for(const p of this.modules)a=p.reduce((f,g)=>f+(g?1:0),a);const c=this.size*this.size,d=Math.ceil(Math.abs(a*20-c*10)/c)-1;return o(0<=d&&d<=9),s+=d*ee.PENALTY_N4,o(0<=s&&s<=2568888),s}getAlignmentPatternPositions(){if(this.version==1)return[];{const s=Math.floor(this.version/7)+2,a=this.version==32?26:Math.ceil((this.version*4+4)/(s*2-2))*2;let c=[6];for(let d=this.size-7;c.length<s;d-=a)c.splice(1,0,d);return c}}static getNumRawDataModules(s){if(s<ee.MIN_VERSION||s>ee.MAX_VERSION)throw new RangeError("Version number out of range");let a=(16*s+128)*s+64;if(s>=2){const c=Math.floor(s/7)+2;a-=(25*c-10)*c-55,s>=7&&(a-=36)}return o(208<=a&&a<=29648),a}static getNumDataCodewords(s,a){return Math.floor(ee.getNumRawDataModules(s)/8)-ee.ECC_CODEWORDS_PER_BLOCK[a.ordinal][s]*ee.NUM_ERROR_CORRECTION_BLOCKS[a.ordinal][s]}static reedSolomonComputeDivisor(s){if(s<1||s>255)throw new RangeError("Degree out of range");let a=[];for(let d=0;d<s-1;d++)a.push(0);a.push(1);let c=1;for(let d=0;d<s;d++){for(let p=0;p<a.length;p++)a[p]=ee.reedSolomonMultiply(a[p],c),p+1<a.length&&(a[p]^=a[p+1]);c=ee.reedSolomonMultiply(c,2)}return a}static reedSolomonComputeRemainder(s,a){let c=a.map(d=>0);for(const d of s){const p=d^c.shift();c.push(0),a.forEach((f,g)=>c[g]^=ee.reedSolomonMultiply(f,p))}return c}static reedSolomonMultiply(s,a){if(s>>>8||a>>>8)throw new RangeError("Byte out of range");let c=0;for(let d=7;d>=0;d--)c=c<<1^(c>>>7)*285,c^=(a>>>d&1)*s;return o(c>>>8==0),c}finderPenaltyCountPatterns(s){const a=s[1];o(a<=this.size*3);const c=a>0&&s[2]==a&&s[3]==a*3&&s[4]==a&&s[5]==a;return(c&&s[0]>=a*4&&s[6]>=a?1:0)+(c&&s[6]>=a*4&&s[0]>=a?1:0)}finderPenaltyTerminateAndCount(s,a,c){return s&&(this.finderPenaltyAddHistory(a,c),a=0),a+=this.size,this.finderPenaltyAddHistory(a,c),this.finderPenaltyCountPatterns(c)}finderPenaltyAddHistory(s,a){a[0]==0&&(s+=this.size),a.pop(),a.unshift(s)}};t.MIN_VERSION=1,t.MAX_VERSION=40,t.PENALTY_N1=3,t.PENALTY_N2=3,t.PENALTY_N3=40,t.PENALTY_N4=10,t.ECC_CODEWORDS_PER_BLOCK=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],t.NUM_ERROR_CORRECTION_BLOCKS=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]],e.QrCode=t;function n(u,s,a){if(s<0||s>31||u>>>s)throw new RangeError("Value out of range");for(let c=s-1;c>=0;c--)a.push(u>>>c&1)}function r(u,s){return(u>>>s&1)!=0}function o(u){if(!u)throw new Error("Assertion error")}const i=class de{constructor(s,a,c){if(this.mode=s,this.numChars=a,this.bitData=c,a<0)throw new RangeError("Invalid argument");this.bitData=c.slice()}static makeBytes(s){let a=[];for(const c of s)n(c,8,a);return new de(de.Mode.BYTE,s.length,a)}static makeNumeric(s){if(!de.isNumeric(s))throw new RangeError("String contains non-numeric characters");let a=[];for(let c=0;c<s.length;){const d=Math.min(s.length-c,3);n(parseInt(s.substring(c,c+d),10),d*3+1,a),c+=d}return new de(de.Mode.NUMERIC,s.length,a)}static makeAlphanumeric(s){if(!de.isAlphanumeric(s))throw new RangeError("String contains unencodable characters in alphanumeric mode");let a=[],c;for(c=0;c+2<=s.length;c+=2){let d=de.ALPHANUMERIC_CHARSET.indexOf(s.charAt(c))*45;d+=de.ALPHANUMERIC_CHARSET.indexOf(s.charAt(c+1)),n(d,11,a)}return c<s.length&&n(de.ALPHANUMERIC_CHARSET.indexOf(s.charAt(c)),6,a),new de(de.Mode.ALPHANUMERIC,s.length,a)}static makeSegments(s){return s==""?[]:de.isNumeric(s)?[de.makeNumeric(s)]:de.isAlphanumeric(s)?[de.makeAlphanumeric(s)]:[de.makeBytes(de.toUtf8ByteArray(s))]}static makeEci(s){let a=[];if(s<0)throw new RangeError("ECI assignment value out of range");if(s<128)n(s,8,a);else if(s<16384)n(2,2,a),n(s,14,a);else if(s<1e6)n(6,3,a),n(s,21,a);else throw new RangeError("ECI assignment value out of range");return new de(de.Mode.ECI,0,a)}static isNumeric(s){return de.NUMERIC_REGEX.test(s)}static isAlphanumeric(s){return de.ALPHANUMERIC_REGEX.test(s)}getData(){return this.bitData.slice()}static getTotalBits(s,a){let c=0;for(const d of s){const p=d.mode.numCharCountBits(a);if(d.numChars>=1<<p)return 1/0;c+=4+p+d.bitData.length}return c}static toUtf8ByteArray(s){s=encodeURI(s);let a=[];for(let c=0;c<s.length;c++)s.charAt(c)!="%"?a.push(s.charCodeAt(c)):(a.push(parseInt(s.substring(c+1,c+3),16)),c+=2);return a}};i.NUMERIC_REGEX=/^[0-9]*$/,i.ALPHANUMERIC_REGEX=/^[A-Z0-9 $%*+.\/:-]*$/,i.ALPHANUMERIC_CHARSET="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:";let l=i;e.QrSegment=i})(Pt||(Pt={})),(e=>{(t=>{const n=class{constructor(o,i){this.ordinal=o,this.formatBits=i}};n.LOW=new n(0,1),n.MEDIUM=new n(1,0),n.QUARTILE=new n(2,3),n.HIGH=new n(3,2),t.Ecc=n})(e.QrCode||(e.QrCode={}))})(Pt||(Pt={})),(e=>{(t=>{const n=class{constructor(o,i){this.modeBits=o,this.numBitsCharCount=i}numCharCountBits(o){return this.numBitsCharCount[Math.floor((o+7)/17)]}};n.NUMERIC=new n(1,[10,12,14]),n.ALPHANUMERIC=new n(2,[9,11,13]),n.BYTE=new n(4,[8,16,16]),n.KANJI=new n(8,[8,10,12]),n.ECI=new n(7,[0,0,0]),t.Mode=n})(e.QrSegment||(e.QrSegment={}))})(Pt||(Pt={}));var kt=Pt;/**
|
|
108
108
|
* @license qrcode.react
|
|
109
109
|
* Copyright (c) Paul O'Shannessy
|
|
110
110
|
* SPDX-License-Identifier: ISC
|
|
111
|
-
*/var _p={L:kt.QrCode.Ecc.LOW,M:kt.QrCode.Ecc.MEDIUM,Q:kt.QrCode.Ecc.QUARTILE,H:kt.QrCode.Ecc.HIGH},nl=128,rl="L",ol="#FFFFFF",il="#000000",sl=!1,ll=1,Wp=4,Bp=0,Up=.1;function al(e,t=0){const n=[];return e.forEach(function(r,o){let i=null;r.forEach(function(l,u){if(!l&&i!==null){n.push(`M${i+t} ${o+t}h${u-i}v1H${i+t}z`),i=null;return}if(u===r.length-1){if(!l)return;i===null?n.push(`M${u+t},${o+t} h1v1H${u+t}z`):n.push(`M${i+t},${o+t} h${u+1-i}v1H${i+t}z`);return}l&&i===null&&(i=u)})}),n.join("")}function ul(e,t){return e.slice().map((n,r)=>r<t.y||r>=t.y+t.h?n:n.map((o,i)=>i<t.x||i>=t.x+t.w?o:!1))}function Vp(e,t,n,r){if(r==null)return null;const o=e.length+n*2,i=Math.floor(t*Up),l=o/t,u=(r.width||i)*l,s=(r.height||i)*l,a=r.x==null?e.length/2-u/2:r.x*l,c=r.y==null?e.length/2-s/2:r.y*l,d=r.opacity==null?1:r.opacity;let p=null;if(r.excavate){let g=Math.floor(a),v=Math.floor(c),E=Math.ceil(u+a-g),M=Math.ceil(s+c-v);p={x:g,y:v,w:E,h:M}}const f=r.crossOrigin;return{x:a,y:c,h:s,w:u,excavation:p,opacity:d,crossOrigin:f}}function zp(e,t){return t!=null?Math.max(Math.floor(t),0):e?Wp:Bp}function cl({value:e,level:t,minVersion:n,includeMargin:r,marginSize:o,imageSettings:i,size:l,boostLevel:u}){let s=m.useMemo(()=>{const g=(Array.isArray(e)?e:[e]).reduce((v,E)=>(v.push(...kt.QrSegment.makeSegments(E)),v),[]);return kt.QrCode.encodeSegments(g,_p[t],n,void 0,void 0,u)},[e,t,n,u]);const{cells:a,margin:c,numCells:d,calculatedImageSettings:p}=m.useMemo(()=>{let f=s.getModules();const g=zp(r,o),v=f.length+g*2,E=Vp(f,l,g,i);return{cells:f,margin:g,numCells:v,calculatedImageSettings:E}},[s,l,i,r,o]);return{qrcode:s,margin:c,cells:a,numCells:d,calculatedImageSettings:p}}var Hp=function(){try{new Path2D().addPath(new Path2D)}catch{return!1}return!0}(),Gp=m.forwardRef(function(t,n){const r=t,{value:o,size:i=nl,level:l=rl,bgColor:u=ol,fgColor:s=il,includeMargin:a=sl,minVersion:c=ll,boostLevel:d,marginSize:p,imageSettings:f}=r,v=fo(r,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","marginSize","imageSettings"]),{style:E}=v,M=fo(v,["style"]),w=f==null?void 0:f.src,N=m.useRef(null),j=m.useRef(null),F=m.useCallback(S=>{N.current=S,typeof n=="function"?n(S):n&&(n.current=S)},[n]),[k,W]=m.useState(!1),{margin:h,cells:b,numCells:x,calculatedImageSettings:$}=cl({value:o,level:l,minVersion:c,boostLevel:d,includeMargin:a,marginSize:p,imageSettings:f,size:i});m.useEffect(()=>{if(N.current!=null){const S=N.current,O=S.getContext("2d");if(!O)return;let T=b;const L=j.current,y=$!=null&&L!==null&&L.complete&&L.naturalHeight!==0&&L.naturalWidth!==0;y&&$.excavation!=null&&(T=ul(b,$.excavation));const I=window.devicePixelRatio||1;S.height=S.width=i*I;const _=i/x*I;O.scale(_,_),O.fillStyle=u,O.fillRect(0,0,x,x),O.fillStyle=s,Hp?O.fill(new Path2D(al(T,h))):b.forEach(function(V,z){V.forEach(function(G,q){G&&O.fillRect(q+h,z+h,1,1)})}),$&&(O.globalAlpha=$.opacity),y&&O.drawImage(L,$.x+h,$.y+h,$.w,$.h)}}),m.useEffect(()=>{W(!1)},[w]);const A=co({height:i,width:i},E);let P=null;return w!=null&&(P=m.createElement("img",{src:w,key:w,style:{display:"none"},onLoad:()=>{W(!0)},ref:j,crossOrigin:$==null?void 0:$.crossOrigin})),m.createElement(m.Fragment,null,m.createElement("canvas",co({style:A,height:i,width:i,ref:F,role:"img"},M)),P)});Gp.displayName="QRCodeCanvas";var fl=m.forwardRef(function(t,n){const r=t,{value:o,size:i=nl,level:l=rl,bgColor:u=ol,fgColor:s=il,includeMargin:a=sl,minVersion:c=ll,boostLevel:d,title:p,marginSize:f,imageSettings:g}=r,v=fo(r,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","title","marginSize","imageSettings"]),{margin:E,cells:M,numCells:w,calculatedImageSettings:N}=cl({value:o,level:l,minVersion:c,boostLevel:d,includeMargin:a,marginSize:f,imageSettings:g,size:i});let j=M,F=null;g!=null&&N!=null&&(N.excavation!=null&&(j=ul(M,N.excavation)),F=m.createElement("image",{href:g.src,height:N.h,width:N.w,x:N.x+E,y:N.y+E,preserveAspectRatio:"none",opacity:N.opacity,crossOrigin:N.crossOrigin}));const k=al(j,E);return m.createElement("svg",co({height:i,width:i,viewBox:`0 0 ${w} ${w}`,ref:n,role:"img"},v),!!p&&m.createElement("title",null,p),m.createElement("path",{fill:u,d:`M0,0 h${w}v${w}H0z`,shapeRendering:"crispEdges"}),m.createElement("path",{fill:s,d:k,shapeRendering:"crispEdges"}),F)});fl.displayName="QRCodeSVG";function Yp(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function Kp(){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 dl(){return/apple/i.test(navigator.vendor)}function qp(){return Yp().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function Xp(){return Kp().includes("jsdom/")}const pl="data-floating-ui-focusable",Qp="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function po(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 _t(e,t){if(!e||!t)return!1;const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&Dr(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function Wt(e){return"composedPath"in e?e.composedPath()[0]:e.target}function mo(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 Jp(e){return e.matches("html,body")}function nt(e){return(e==null?void 0:e.ownerDocument)||document}function ml(e){return Ee(e)&&e.matches(Qp)}function Zp(e){if(!e||Xp())return!0;try{return e.matches(":focus-visible")}catch{return!0}}function em(e){return e?e.hasAttribute(pl)?e:e.querySelector("["+pl+"]")||e:null}function Hn(e,t,n){return n===void 0&&(n=!0),e.filter(o=>{var i;return o.parentId===t&&(!n||((i=o.context)==null?void 0:i.open))}).flatMap(o=>[o,...Hn(e,o.id,n)])}function tm(e){return"nativeEvent"in e}function rn(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}var nm=typeof document<"u",rm=function(){},rt=nm?m.useLayoutEffect:rm;const om={...R};function Gn(e){const t=R.useRef(e);return rt(()=>{t.current=e}),t}const im=om.useInsertionEffect||(e=>e());function ot(e){const t=R.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return im(()=>{t.current=e}),R.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)},[])}const hl=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function gl(e,t){const n=Zi(e,hl()),r=n.length;if(r===0)return;const o=po(nt(e)),i=n.indexOf(o),l=i===-1?t===1?0:r-1:i+t;return n[l]}function sm(e){return gl(nt(e).body,1)||e}function lm(e){return gl(nt(e).body,-1)||e}function ho(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!_t(n,r)}function am(e){Zi(e,hl()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function vl(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 um="data-floating-ui-focusable",bl="active",xl="selected",cm={...R};let yl=!1,fm=0;const wl=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+fm++;function dm(){const[e,t]=R.useState(()=>yl?wl():void 0);return rt(()=>{e==null&&t(wl())},[]),R.useEffect(()=>{yl=!0},[]),e}const go=cm.useId||dm;let vo;process.env.NODE_ENV!=="production"&&(vo=new Set);function pm(){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=vo)!=null&&e.has(o))){var i;(i=vo)==null||i.add(o),console.error(o)}}function mm(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(o=>o(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){var r;(r=e.get(t))==null||r.delete(n)}}}const hm=R.createContext(null),gm=R.createContext(null),bo=()=>{var e;return((e=R.useContext(hm))==null?void 0:e.id)||null},xo=()=>R.useContext(gm);function on(e){return"data-floating-ui-"+e}function ze(e){e.current!==-1&&(clearTimeout(e.current),e.current=-1)}const El=on("safe-polygon");function yo(e,t,n){if(n&&!rn(n))return 0;if(typeof e=="number")return e;if(typeof e=="function"){const r=e();return typeof r=="number"?r:r==null?void 0:r[t]}return e==null?void 0:e[t]}function wo(e){return typeof e=="function"?e():e}function vm(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,dataRef:o,events:i,elements:l}=e,{enabled:u=!0,delay:s=0,handleClose:a=null,mouseOnly:c=!1,restMs:d=0,move:p=!0}=t,f=xo(),g=bo(),v=Gn(a),E=Gn(s),M=Gn(n),w=Gn(d),N=R.useRef(),j=R.useRef(-1),F=R.useRef(),k=R.useRef(-1),W=R.useRef(!0),h=R.useRef(!1),b=R.useRef(()=>{}),x=R.useRef(!1),$=ot(()=>{var L;const y=(L=o.current.openEvent)==null?void 0:L.type;return(y==null?void 0:y.includes("mouse"))&&y!=="mousedown"});R.useEffect(()=>{if(!u)return;function L(y){let{open:I}=y;I||(ze(j),ze(k),W.current=!0,x.current=!1)}return i.on("openchange",L),()=>{i.off("openchange",L)}},[u,i]),R.useEffect(()=>{if(!u||!v.current||!n)return;function L(I){$()&&r(!1,I,"hover")}const y=nt(l.floating).documentElement;return y.addEventListener("mouseleave",L),()=>{y.removeEventListener("mouseleave",L)}},[l.floating,n,r,u,v,$]);const A=R.useCallback(function(L,y,I){y===void 0&&(y=!0),I===void 0&&(I="hover");const _=yo(E.current,"close",N.current);_&&!F.current?(ze(j),j.current=window.setTimeout(()=>r(!1,L,I),_)):y&&(ze(j),r(!1,L,I))},[E,r]),P=ot(()=>{b.current(),F.current=void 0}),S=ot(()=>{if(h.current){const L=nt(l.floating).body;L.style.pointerEvents="",L.removeAttribute(El),h.current=!1}}),O=ot(()=>o.current.openEvent?["click","mousedown"].includes(o.current.openEvent.type):!1);R.useEffect(()=>{if(!u)return;function L(z){if(ze(j),W.current=!1,c&&!rn(N.current)||wo(w.current)>0&&!yo(E.current,"open"))return;const G=yo(E.current,"open",N.current);G?j.current=window.setTimeout(()=>{M.current||r(!0,z,"hover")},G):n||r(!0,z,"hover")}function y(z){if(O()){S();return}b.current();const G=nt(l.floating);if(ze(k),x.current=!1,v.current&&o.current.floatingContext){n||ze(j),F.current=v.current({...o.current.floatingContext,tree:f,x:z.clientX,y:z.clientY,onClose(){S(),P(),O()||A(z,!0,"safe-polygon")}});const B=F.current;G.addEventListener("mousemove",B),b.current=()=>{G.removeEventListener("mousemove",B)};return}(N.current==="touch"?!_t(l.floating,z.relatedTarget):!0)&&A(z)}function I(z){O()||o.current.floatingContext&&(v.current==null||v.current({...o.current.floatingContext,tree:f,x:z.clientX,y:z.clientY,onClose(){S(),P(),O()||A(z)}})(z))}function _(){ze(j)}function V(z){O()||A(z,!1)}if(oe(l.domReference)){const z=l.domReference,G=l.floating;return n&&z.addEventListener("mouseleave",I),p&&z.addEventListener("mousemove",L,{once:!0}),z.addEventListener("mouseenter",L),z.addEventListener("mouseleave",y),G&&(G.addEventListener("mouseleave",I),G.addEventListener("mouseenter",_),G.addEventListener("mouseleave",V)),()=>{n&&z.removeEventListener("mouseleave",I),p&&z.removeEventListener("mousemove",L),z.removeEventListener("mouseenter",L),z.removeEventListener("mouseleave",y),G&&(G.removeEventListener("mouseleave",I),G.removeEventListener("mouseenter",_),G.removeEventListener("mouseleave",V))}}},[l,u,e,c,p,A,P,S,r,n,M,f,E,v,o,O,w]),rt(()=>{var L;if(u&&n&&(L=v.current)!=null&&(L=L.__options)!=null&&L.blockPointerEvents&&$()){h.current=!0;const I=l.floating;if(oe(l.domReference)&&I){var y;const _=nt(l.floating).body;_.setAttribute(El,"");const V=l.domReference,z=f==null||(y=f.nodesRef.current.find(G=>G.id===g))==null||(y=y.context)==null?void 0:y.elements.floating;return z&&(z.style.pointerEvents=""),_.style.pointerEvents="none",V.style.pointerEvents="auto",I.style.pointerEvents="auto",()=>{_.style.pointerEvents="",V.style.pointerEvents="",I.style.pointerEvents=""}}}},[u,n,g,l,f,v,$]),rt(()=>{n||(N.current=void 0,x.current=!1,P(),S())},[n,P,S]),R.useEffect(()=>()=>{P(),ze(j),ze(k),S()},[u,l.domReference,P,S]);const T=R.useMemo(()=>{function L(y){N.current=y.pointerType}return{onPointerDown:L,onPointerEnter:L,onMouseMove(y){const{nativeEvent:I}=y;function _(){!W.current&&!M.current&&r(!0,I,"hover")}c&&!rn(N.current)||n||wo(w.current)===0||x.current&&y.movementX**2+y.movementY**2<2||(ze(k),N.current==="touch"?_():(x.current=!0,k.current=window.setTimeout(_,wo(w.current))))}}},[c,r,n,M,w]);return R.useMemo(()=>u?{reference:T}:{},[u,T])}const Sl={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},Cl=R.forwardRef(function(t,n){const[r,o]=R.useState();rt(()=>{dl()&&o("button")},[]);const i={ref:n,tabIndex:0,role:r,"aria-hidden":r?void 0:!0,[on("focus-guard")]:"",style:Sl};return C.jsx("span",{...t,...i})}),Ol=R.createContext(null),Tl=on("portal");function bm(e){e===void 0&&(e={});const{id:t,root:n}=e,r=go(),o=ym(),[i,l]=R.useState(null),u=R.useRef(null);return rt(()=>()=>{i==null||i.remove(),queueMicrotask(()=>{u.current=null})},[i]),rt(()=>{if(!r||u.current)return;const s=t?document.getElementById(t):null;if(!s)return;const a=document.createElement("div");a.id=r,a.setAttribute(Tl,""),s.appendChild(a),u.current=a,l(a)},[t,r]),rt(()=>{if(n===null||!r||u.current)return;let s=n||(o==null?void 0:o.portalNode);s&&!$r(s)&&(s=s.current),s=s||document.body;let a=null;t&&(a=document.createElement("div"),a.id=t,s.appendChild(a));const c=document.createElement("div");c.id=r,c.setAttribute(Tl,""),s=a||s,s.appendChild(c),u.current=c,l(c)},[t,n,r,o]),i}function xm(e){const{children:t,id:n,root:r,preserveTabOrder:o=!0}=e,i=bm({id:n,root:r}),[l,u]=R.useState(null),s=R.useRef(null),a=R.useRef(null),c=R.useRef(null),d=R.useRef(null),p=l==null?void 0:l.modal,f=l==null?void 0:l.open,g=!!l&&!l.modal&&l.open&&o&&!!(r||i);return R.useEffect(()=>{if(!i||!o||p)return;function v(E){i&&ho(E)&&(E.type==="focusin"?vl:am)(i)}return i.addEventListener("focusin",v,!0),i.addEventListener("focusout",v,!0),()=>{i.removeEventListener("focusin",v,!0),i.removeEventListener("focusout",v,!0)}},[i,o,p]),R.useEffect(()=>{i&&(f||vl(i))},[f,i]),C.jsxs(Ol.Provider,{value:R.useMemo(()=>({preserveTabOrder:o,beforeOutsideRef:s,afterOutsideRef:a,beforeInsideRef:c,afterInsideRef:d,portalNode:i,setFocusManagerState:u}),[o,i]),children:[g&&i&&C.jsx(Cl,{"data-type":"outside",ref:s,onFocus:v=>{if(ho(v,i)){var E;(E=c.current)==null||E.focus()}else{const M=l?l.domReference:null,w=lm(M);w==null||w.focus()}}}),g&&i&&C.jsx("span",{"aria-owns":i.id,style:Sl}),i&&Vt.createPortal(t,i),g&&i&&C.jsx(Cl,{"data-type":"outside",ref:a,onFocus:v=>{if(ho(v,i)){var E;(E=d.current)==null||E.focus()}else{const M=l?l.domReference:null,w=sm(M);w==null||w.focus(),l!=null&&l.closeOnFocusOut&&(l==null||l.onOpenChange(!1,v.nativeEvent,"focus-out"))}}})]})}const ym=()=>R.useContext(Ol);function Nl(e){return Ee(e.target)&&e.target.tagName==="BUTTON"}function wm(e){return Ee(e.target)&&e.target.tagName==="A"}function Pl(e){return ml(e)}function Em(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,dataRef:o,elements:{domReference:i}}=e,{enabled:l=!0,event:u="click",toggle:s=!0,ignoreMouse:a=!1,keyboardHandlers:c=!0,stickIfOpen:d=!0}=t,p=R.useRef(),f=R.useRef(!1),g=R.useMemo(()=>({onPointerDown(v){p.current=v.pointerType},onMouseDown(v){const E=p.current;v.button===0&&u!=="click"&&(rn(E,!0)&&a||(n&&s&&(!(o.current.openEvent&&d)||o.current.openEvent.type==="mousedown")?r(!1,v.nativeEvent,"click"):(v.preventDefault(),r(!0,v.nativeEvent,"click"))))},onClick(v){const E=p.current;if(u==="mousedown"&&p.current){p.current=void 0;return}rn(E,!0)&&a||(n&&s&&(!(o.current.openEvent&&d)||o.current.openEvent.type==="click")?r(!1,v.nativeEvent,"click"):r(!0,v.nativeEvent,"click"))},onKeyDown(v){p.current=void 0,!(v.defaultPrevented||!c||Nl(v))&&(v.key===" "&&!Pl(i)&&(v.preventDefault(),f.current=!0),!wm(v)&&v.key==="Enter"&&r(!(n&&s),v.nativeEvent,"click"))},onKeyUp(v){v.defaultPrevented||!c||Nl(v)||Pl(i)||v.key===" "&&f.current&&(f.current=!1,r(!(n&&s),v.nativeEvent,"click"))}}),[o,i,u,a,c,r,n,d,s]);return R.useMemo(()=>l?{reference:g}:{},[l,g])}const Sm={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},Cm={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},Ll=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 Om(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,elements:o,dataRef:i}=e,{enabled:l=!0,escapeKey:u=!0,outsidePress:s=!0,outsidePressEvent:a="pointerdown",referencePress:c=!1,referencePressEvent:d="pointerdown",ancestorScroll:p=!1,bubbles:f,capture:g}=t,v=xo(),E=ot(typeof s=="function"?s:()=>!1),M=typeof s=="function"?E:s,w=R.useRef(!1),{escapeKey:N,outsidePress:j}=Ll(f),{escapeKey:F,outsidePress:k}=Ll(g),W=R.useRef(!1),h=ot(S=>{var O;if(!n||!l||!u||S.key!=="Escape"||W.current)return;const T=(O=i.current.floatingContext)==null?void 0:O.nodeId,L=v?Hn(v.nodesRef.current,T):[];if(!N&&(S.stopPropagation(),L.length>0)){let y=!0;if(L.forEach(I=>{var _;if((_=I.context)!=null&&_.open&&!I.context.dataRef.current.__escapeKeyBubbles){y=!1;return}}),!y)return}r(!1,tm(S)?S.nativeEvent:S,"escape-key")}),b=ot(S=>{var O;const T=()=>{var L;h(S),(L=Wt(S))==null||L.removeEventListener("keydown",T)};(O=Wt(S))==null||O.addEventListener("keydown",T)}),x=ot(S=>{var O;const T=i.current.insideReactTree;i.current.insideReactTree=!1;const L=w.current;if(w.current=!1,a==="click"&&L||T||typeof M=="function"&&!M(S))return;const y=Wt(S),I="["+on("inert")+"]",_=nt(o.floating).querySelectorAll(I);let V=oe(y)?y:null;for(;V&&!ut(V);){const B=ct(V);if(ut(B)||!oe(B))break;V=B}if(_.length&&oe(y)&&!Jp(y)&&!_t(y,o.floating)&&Array.from(_).every(B=>!_t(V,B)))return;if(Ee(y)&&P){const B=ut(y),K=Ve(y),H=/auto|scroll/,Z=B||H.test(K.overflowX),ae=B||H.test(K.overflowY),Ae=Z&&y.clientWidth>0&&y.scrollWidth>y.clientWidth,$e=ae&&y.clientHeight>0&&y.scrollHeight>y.clientHeight,it=K.direction==="rtl",ye=$e&&(it?S.offsetX<=y.offsetWidth-y.clientWidth:S.offsetX>y.clientWidth),he=Ae&&S.offsetY>y.clientHeight;if(ye||he)return}const z=(O=i.current.floatingContext)==null?void 0:O.nodeId,G=v&&Hn(v.nodesRef.current,z).some(B=>{var K;return mo(S,(K=B.context)==null?void 0:K.elements.floating)});if(mo(S,o.floating)||mo(S,o.domReference)||G)return;const q=v?Hn(v.nodesRef.current,z):[];if(q.length>0){let B=!0;if(q.forEach(K=>{var H;if((H=K.context)!=null&&H.open&&!K.context.dataRef.current.__outsidePressBubbles){B=!1;return}}),!B)return}r(!1,S,"outside-press")}),$=ot(S=>{var O;const T=()=>{var L;x(S),(L=Wt(S))==null||L.removeEventListener(a,T)};(O=Wt(S))==null||O.addEventListener(a,T)});R.useEffect(()=>{if(!n||!l)return;i.current.__escapeKeyBubbles=N,i.current.__outsidePressBubbles=j;let S=-1;function O(_){r(!1,_,"ancestor-scroll")}function T(){window.clearTimeout(S),W.current=!0}function L(){S=window.setTimeout(()=>{W.current=!1},Sn()?5:0)}const y=nt(o.floating);u&&(y.addEventListener("keydown",F?b:h,F),y.addEventListener("compositionstart",T),y.addEventListener("compositionend",L)),M&&y.addEventListener(a,k?$:x,k);let I=[];return p&&(oe(o.domReference)&&(I=xt(o.domReference)),oe(o.floating)&&(I=I.concat(xt(o.floating))),!oe(o.reference)&&o.reference&&o.reference.contextElement&&(I=I.concat(xt(o.reference.contextElement)))),I=I.filter(_=>{var V;return _!==((V=y.defaultView)==null?void 0:V.visualViewport)}),I.forEach(_=>{_.addEventListener("scroll",O,{passive:!0})}),()=>{u&&(y.removeEventListener("keydown",F?b:h,F),y.removeEventListener("compositionstart",T),y.removeEventListener("compositionend",L)),M&&y.removeEventListener(a,k?$:x,k),I.forEach(_=>{_.removeEventListener("scroll",O)}),window.clearTimeout(S)}},[i,o,u,M,a,n,r,p,l,N,j,h,F,b,x,k,$]),R.useEffect(()=>{i.current.insideReactTree=!1},[i,M,a]);const A=R.useMemo(()=>({onKeyDown:h,...c&&{[Sm[d]]:S=>{r(!1,S.nativeEvent,"reference-press")},...d!=="click"&&{onClick(S){r(!1,S.nativeEvent,"reference-press")}}}}),[h,r,c,d]),P=R.useMemo(()=>({onKeyDown:h,onMouseDown(){w.current=!0},onMouseUp(){w.current=!0},[Cm[a]]:()=>{i.current.insideReactTree=!0}}),[h,a,i]);return R.useMemo(()=>l?{reference:A,floating:P}:{},[l,A,P])}function Tm(e){const{open:t=!1,onOpenChange:n,elements:r}=e,o=go(),i=R.useRef({}),[l]=R.useState(()=>mm()),u=bo()!=null;if(process.env.NODE_ENV!=="production"){const f=r.reference;f&&!oe(f)&&pm("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[s,a]=R.useState(r.reference),c=ot((f,g,v)=>{i.current.openEvent=f?g:void 0,l.emit("openchange",{open:f,event:g,reason:v,nested:u}),n==null||n(f,g,v)}),d=R.useMemo(()=>({setPositionReference:a}),[]),p=R.useMemo(()=>({reference:s||r.reference||null,floating:r.floating||null,domReference:r.reference}),[s,r.reference,r.floating]);return R.useMemo(()=>({dataRef:i,open:t,onOpenChange:c,elements:p,events:l,floatingId:o,refs:d}),[t,c,p,l,o,d])}function Nm(e){e===void 0&&(e={});const{nodeId:t}=e,n=Tm({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,o=r.elements,[i,l]=R.useState(null),[u,s]=R.useState(null),c=(o==null?void 0:o.domReference)||i,d=R.useRef(null),p=xo();rt(()=>{c&&(d.current=c)},[c]);const f=ms({...e,elements:{...o,...u&&{reference:u}}}),g=R.useCallback(N=>{const j=oe(N)?{getBoundingClientRect:()=>N.getBoundingClientRect(),getClientRects:()=>N.getClientRects(),contextElement:N}:N;s(j),f.refs.setReference(j)},[f.refs]),v=R.useCallback(N=>{(oe(N)||N===null)&&(d.current=N,l(N)),(oe(f.refs.reference.current)||f.refs.reference.current===null||N!==null&&!oe(N))&&f.refs.setReference(N)},[f.refs]),E=R.useMemo(()=>({...f.refs,setReference:v,setPositionReference:g,domReference:d}),[f.refs,v,g]),M=R.useMemo(()=>({...f.elements,domReference:c}),[f.elements,c]),w=R.useMemo(()=>({...f,...r,refs:E,elements:M,nodeId:t}),[f,E,M,t,r]);return rt(()=>{r.dataRef.current.floatingContext=w;const N=p==null?void 0:p.nodesRef.current.find(j=>j.id===t);N&&(N.context=w)}),R.useMemo(()=>({...f,context:w,refs:E,elements:M}),[f,E,M,w])}function Eo(){return qp()&&dl()}function Pm(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,events:o,dataRef:i,elements:l}=e,{enabled:u=!0,visibleOnly:s=!0}=t,a=R.useRef(!1),c=R.useRef(-1),d=R.useRef(!0);R.useEffect(()=>{if(!u)return;const f=Ne(l.domReference);function g(){!n&&Ee(l.domReference)&&l.domReference===po(nt(l.domReference))&&(a.current=!0)}function v(){d.current=!0}function E(){d.current=!1}return f.addEventListener("blur",g),Eo()&&(f.addEventListener("keydown",v,!0),f.addEventListener("pointerdown",E,!0)),()=>{f.removeEventListener("blur",g),Eo()&&(f.removeEventListener("keydown",v,!0),f.removeEventListener("pointerdown",E,!0))}},[l.domReference,n,u]),R.useEffect(()=>{if(!u)return;function f(g){let{reason:v}=g;(v==="reference-press"||v==="escape-key")&&(a.current=!0)}return o.on("openchange",f),()=>{o.off("openchange",f)}},[o,u]),R.useEffect(()=>()=>{ze(c)},[]);const p=R.useMemo(()=>({onMouseLeave(){a.current=!1},onFocus(f){if(a.current)return;const g=Wt(f.nativeEvent);if(s&&oe(g)){if(Eo()&&!f.relatedTarget){if(!d.current&&!ml(g))return}else if(!Zp(g))return}r(!0,f.nativeEvent,"focus")},onBlur(f){a.current=!1;const g=f.relatedTarget,v=f.nativeEvent,E=oe(g)&&g.hasAttribute(on("focus-guard"))&&g.getAttribute("data-type")==="outside";c.current=window.setTimeout(()=>{var M;const w=po(l.domReference?l.domReference.ownerDocument:document);!g&&w===l.domReference||_t((M=i.current.floatingContext)==null?void 0:M.refs.floating.current,w)||_t(l.domReference,w)||E||r(!1,v,"focus")})}}),[i,l.domReference,r,s]);return R.useMemo(()=>u?{reference:p}:{},[u,p])}function So(e,t,n){const r=new Map,o=n==="item";let i=e;if(o&&e){const{[bl]:l,[xl]:u,...s}=e;i=s}return{...n==="floating"&&{tabIndex:-1,[um]:""},...i,...t.map(l=>{const u=l?l[n]:null;return typeof u=="function"?e?u(e):null:u}).concat(e).reduce((l,u)=>(u&&Object.entries(u).forEach(s=>{let[a,c]=s;if(!(o&&[bl,xl].includes(a)))if(a.indexOf("on")===0){if(r.has(a)||r.set(a,[]),typeof c=="function"){var d;(d=r.get(a))==null||d.push(c),l[a]=function(){for(var p,f=arguments.length,g=new Array(f),v=0;v<f;v++)g[v]=arguments[v];return(p=r.get(a))==null?void 0:p.map(E=>E(...g)).find(E=>E!==void 0)}}}else l[a]=c}),l),{})}}function Lm(e){e===void 0&&(e=[]);const t=e.map(u=>u==null?void 0:u.reference),n=e.map(u=>u==null?void 0:u.floating),r=e.map(u=>u==null?void 0:u.item),o=R.useCallback(u=>So(u,e,"reference"),t),i=R.useCallback(u=>So(u,e,"floating"),n),l=R.useCallback(u=>So(u,e,"item"),r);return R.useMemo(()=>({getReferenceProps:o,getFloatingProps:i,getItemProps:l}),[o,i,l])}const Am=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function $m(e,t){var n,r;t===void 0&&(t={});const{open:o,elements:i,floatingId:l}=e,{enabled:u=!0,role:s="dialog"}=t,a=go(),c=((n=i.domReference)==null?void 0:n.id)||a,d=R.useMemo(()=>{var w;return((w=em(i.floating))==null?void 0:w.id)||l},[i.floating,l]),p=(r=Am.get(s))!=null?r:s,g=bo()!=null,v=R.useMemo(()=>p==="tooltip"||s==="label"?{["aria-"+(s==="label"?"labelledby":"describedby")]:o?d:void 0}:{"aria-expanded":o?"true":"false","aria-haspopup":p==="alertdialog"?"dialog":p,"aria-controls":o?d:void 0,...p==="listbox"&&{role:"combobox"},...p==="menu"&&{id:c},...p==="menu"&&g&&{role:"menuitem"},...s==="select"&&{"aria-autocomplete":"none"},...s==="combobox"&&{"aria-autocomplete":"list"}},[p,d,g,o,c,s]),E=R.useMemo(()=>{const w={id:d,...p&&{role:p}};return p==="tooltip"||s==="label"?w:{...w,...p==="menu"&&{"aria-labelledby":c}}},[p,d,c,s]),M=R.useCallback(w=>{let{active:N,selected:j}=w;const F={role:"option",...N&&{id:d+"-fui-option"}};switch(s){case"select":case"combobox":return{...F,"aria-selected":j}}return{}},[d,s]);return R.useMemo(()=>u?{reference:v,floating:E,item:M}:{},[u,v,E,M])}const Al=m.forwardRef(({placement:e,className:t=""},n)=>{const o=(i=>{switch(i.split("-")[0]){case"top":return{bottom:"-4px",left:"50%",transform:"translateX(-50%)",borderLeft:"4px solid transparent",borderRight:"4px solid transparent",borderTop:"4px solid #242424"};case"bottom":return{top:"-4px",left:"50%",transform:"translateX(-50%)",borderLeft:"4px solid transparent",borderRight:"4px solid transparent",borderBottom:"4px solid #242424"};case"left":return{right:"-4px",top:"50%",transform:"translateY(-50%)",borderTop:"4px solid transparent",borderBottom:"4px solid transparent",borderLeft:"4px solid #242424"};case"right":return{left:"-4px",top:"50%",transform:"translateY(-50%)",borderTop:"4px solid transparent",borderBottom:"4px solid transparent",borderRight:"4px solid #242424"};default:return{}}})(e);return C.jsx("div",{ref:n,className:`absolute w-0 h-0 ${t}`,style:o})});Al.displayName="TooltipArrow";const sn=({children:e,content:t,placement:n="top",delay:r=200,showArrow:o=!0,className:i="",disabled:l=!1,maxWidth:u="max-w-xs",trigger:s=["hover","focus"]})=>{const[a,c]=m.useState(!1),d=m.useRef(null),{refs:p,floatingStyles:f,context:g}=Nm({open:a&&!l,onOpenChange:c,placement:n,whileElementsMounted:cs,middleware:[zr(o?12:8),gs({fallbackAxisSideDirection:"start",padding:8}),hs({padding:8}),...o?[Yf({element:d})]:[]]}),v=vm(g,{enabled:s.includes("hover"),delay:{open:r,close:150}}),E=Pm(g,{enabled:s.includes("focus")}),M=Em(g,{enabled:s.includes("click")}),w=Om(g),N=$m(g,{role:"tooltip"}),{getReferenceProps:j,getFloatingProps:F}=Lm([v,E,M,w,N]);return l?C.jsx(C.Fragment,{children:e}):C.jsxs(C.Fragment,{children:[C.jsx("div",{ref:p.setReference,...j(),children:e}),a&&C.jsx(xm,{children:C.jsxs("div",{ref:p.setFloating,...F(),style:f,className:`
|
|
111
|
+
*/var Bp={L:kt.QrCode.Ecc.LOW,M:kt.QrCode.Ecc.MEDIUM,Q:kt.QrCode.Ecc.QUARTILE,H:kt.QrCode.Ecc.HIGH},rl=128,ol="L",il="#FFFFFF",sl="#000000",ll=!1,al=1,Wp=4,Up=0,Vp=.1;function ul(e,t=0){const n=[];return e.forEach(function(r,o){let i=null;r.forEach(function(l,u){if(!l&&i!==null){n.push(`M${i+t} ${o+t}h${u-i}v1H${i+t}z`),i=null;return}if(u===r.length-1){if(!l)return;i===null?n.push(`M${u+t},${o+t} h1v1H${u+t}z`):n.push(`M${i+t},${o+t} h${u+1-i}v1H${i+t}z`);return}l&&i===null&&(i=u)})}),n.join("")}function cl(e,t){return e.slice().map((n,r)=>r<t.y||r>=t.y+t.h?n:n.map((o,i)=>i<t.x||i>=t.x+t.w?o:!1))}function zp(e,t,n,r){if(r==null)return null;const o=e.length+n*2,i=Math.floor(t*Vp),l=o/t,u=(r.width||i)*l,s=(r.height||i)*l,a=r.x==null?e.length/2-u/2:r.x*l,c=r.y==null?e.length/2-s/2:r.y*l,d=r.opacity==null?1:r.opacity;let p=null;if(r.excavate){let g=Math.floor(a),v=Math.floor(c),E=Math.ceil(u+a-g),M=Math.ceil(s+c-v);p={x:g,y:v,w:E,h:M}}const f=r.crossOrigin;return{x:a,y:c,h:s,w:u,excavation:p,opacity:d,crossOrigin:f}}function Hp(e,t){return t!=null?Math.max(Math.floor(t),0):e?Wp:Up}function fl({value:e,level:t,minVersion:n,includeMargin:r,marginSize:o,imageSettings:i,size:l,boostLevel:u}){let s=m.useMemo(()=>{const g=(Array.isArray(e)?e:[e]).reduce((v,E)=>(v.push(...kt.QrSegment.makeSegments(E)),v),[]);return kt.QrCode.encodeSegments(g,Bp[t],n,void 0,void 0,u)},[e,t,n,u]);const{cells:a,margin:c,numCells:d,calculatedImageSettings:p}=m.useMemo(()=>{let f=s.getModules();const g=Hp(r,o),v=f.length+g*2,E=zp(f,l,g,i);return{cells:f,margin:g,numCells:v,calculatedImageSettings:E}},[s,l,i,r,o]);return{qrcode:s,margin:c,cells:a,numCells:d,calculatedImageSettings:p}}var Gp=function(){try{new Path2D().addPath(new Path2D)}catch{return!1}return!0}(),Yp=m.forwardRef(function(t,n){const r=t,{value:o,size:i=rl,level:l=ol,bgColor:u=il,fgColor:s=sl,includeMargin:a=ll,minVersion:c=al,boostLevel:d,marginSize:p,imageSettings:f}=r,v=po(r,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","marginSize","imageSettings"]),{style:E}=v,M=po(v,["style"]),w=f==null?void 0:f.src,N=m.useRef(null),F=m.useRef(null),j=m.useCallback(C=>{N.current=C,typeof n=="function"?n(C):n&&(n.current=C)},[n]),[k,B]=m.useState(!1),{margin:h,cells:b,numCells:y,calculatedImageSettings:$}=fl({value:o,level:l,minVersion:c,boostLevel:d,includeMargin:a,marginSize:p,imageSettings:f,size:i});m.useEffect(()=>{if(N.current!=null){const C=N.current,O=C.getContext("2d");if(!O)return;let T=b;const P=F.current,x=$!=null&&P!==null&&P.complete&&P.naturalHeight!==0&&P.naturalWidth!==0;x&&$.excavation!=null&&(T=cl(b,$.excavation));const I=window.devicePixelRatio||1;C.height=C.width=i*I;const _=i/y*I;O.scale(_,_),O.fillStyle=u,O.fillRect(0,0,y,y),O.fillStyle=s,Gp?O.fill(new Path2D(ul(T,h))):b.forEach(function(V,W){V.forEach(function(Y,q){Y&&O.fillRect(q+h,W+h,1,1)})}),$&&(O.globalAlpha=$.opacity),x&&O.drawImage(P,$.x+h,$.y+h,$.w,$.h)}}),m.useEffect(()=>{B(!1)},[w]);const D=fo({height:i,width:i},E);let L=null;return w!=null&&(L=m.createElement("img",{src:w,key:w,style:{display:"none"},onLoad:()=>{B(!0)},ref:F,crossOrigin:$==null?void 0:$.crossOrigin})),m.createElement(m.Fragment,null,m.createElement("canvas",fo({style:D,height:i,width:i,ref:j,role:"img"},M)),L)});Yp.displayName="QRCodeCanvas";var dl=m.forwardRef(function(t,n){const r=t,{value:o,size:i=rl,level:l=ol,bgColor:u=il,fgColor:s=sl,includeMargin:a=ll,minVersion:c=al,boostLevel:d,title:p,marginSize:f,imageSettings:g}=r,v=po(r,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","title","marginSize","imageSettings"]),{margin:E,cells:M,numCells:w,calculatedImageSettings:N}=fl({value:o,level:l,minVersion:c,boostLevel:d,includeMargin:a,marginSize:f,imageSettings:g,size:i});let F=M,j=null;g!=null&&N!=null&&(N.excavation!=null&&(F=cl(M,N.excavation)),j=m.createElement("image",{href:g.src,height:N.h,width:N.w,x:N.x+E,y:N.y+E,preserveAspectRatio:"none",opacity:N.opacity,crossOrigin:N.crossOrigin}));const k=ul(F,E);return m.createElement("svg",fo({height:i,width:i,viewBox:`0 0 ${w} ${w}`,ref:n,role:"img"},v),!!p&&m.createElement("title",null,p),m.createElement("path",{fill:u,d:`M0,0 h${w}v${w}H0z`,shapeRendering:"crispEdges"}),m.createElement("path",{fill:s,d:k,shapeRendering:"crispEdges"}),j)});dl.displayName="QRCodeSVG";function Kp(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function qp(){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 pl(){return/apple/i.test(navigator.vendor)}function Xp(){return Kp().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function Qp(){return qp().includes("jsdom/")}const ml="data-floating-ui-focusable",Zp="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function mo(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 _t(e,t){if(!e||!t)return!1;const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&Mr(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function Bt(e){return"composedPath"in e?e.composedPath()[0]:e.target}function ho(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 Jp(e){return e.matches("html,body")}function nt(e){return(e==null?void 0:e.ownerDocument)||document}function hl(e){return Ce(e)&&e.matches(Zp)}function em(e){if(!e||Qp())return!0;try{return e.matches(":focus-visible")}catch{return!0}}function tm(e){return e?e.hasAttribute(ml)?e:e.querySelector("["+ml+"]")||e:null}function Hn(e,t,n){return n===void 0&&(n=!0),e.filter(o=>{var i;return o.parentId===t&&(!n||((i=o.context)==null?void 0:i.open))}).flatMap(o=>[o,...Hn(e,o.id,n)])}function nm(e){return"nativeEvent"in e}function rn(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}var rm=typeof document<"u",om=function(){},rt=rm?m.useLayoutEffect:om;const im={...R};function Gn(e){const t=R.useRef(e);return rt(()=>{t.current=e}),t}const sm=im.useInsertionEffect||(e=>e());function ot(e){const t=R.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return sm(()=>{t.current=e}),R.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)},[])}const gl=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function vl(e,t){const n=Ji(e,gl()),r=n.length;if(r===0)return;const o=mo(nt(e)),i=n.indexOf(o),l=i===-1?t===1?0:r-1:i+t;return n[l]}function lm(e){return vl(nt(e).body,1)||e}function am(e){return vl(nt(e).body,-1)||e}function go(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!_t(n,r)}function um(e){Ji(e,gl()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function bl(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 cm="data-floating-ui-focusable",yl="active",xl="selected",fm={...R};let wl=!1,dm=0;const El=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+dm++;function pm(){const[e,t]=R.useState(()=>wl?El():void 0);return rt(()=>{e==null&&t(El())},[]),R.useEffect(()=>{wl=!0},[]),e}const vo=fm.useId||pm;let bo;process.env.NODE_ENV!=="production"&&(bo=new Set);function mm(){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=bo)!=null&&e.has(o))){var i;(i=bo)==null||i.add(o),console.error(o)}}function hm(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(o=>o(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){var r;(r=e.get(t))==null||r.delete(n)}}}const gm=R.createContext(null),vm=R.createContext(null),yo=()=>{var e;return((e=R.useContext(gm))==null?void 0:e.id)||null},xo=()=>R.useContext(vm);function on(e){return"data-floating-ui-"+e}function ze(e){e.current!==-1&&(clearTimeout(e.current),e.current=-1)}const Sl=on("safe-polygon");function wo(e,t,n){if(n&&!rn(n))return 0;if(typeof e=="number")return e;if(typeof e=="function"){const r=e();return typeof r=="number"?r:r==null?void 0:r[t]}return e==null?void 0:e[t]}function Eo(e){return typeof e=="function"?e():e}function bm(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,dataRef:o,events:i,elements:l}=e,{enabled:u=!0,delay:s=0,handleClose:a=null,mouseOnly:c=!1,restMs:d=0,move:p=!0}=t,f=xo(),g=yo(),v=Gn(a),E=Gn(s),M=Gn(n),w=Gn(d),N=R.useRef(),F=R.useRef(-1),j=R.useRef(),k=R.useRef(-1),B=R.useRef(!0),h=R.useRef(!1),b=R.useRef(()=>{}),y=R.useRef(!1),$=ot(()=>{var P;const x=(P=o.current.openEvent)==null?void 0:P.type;return(x==null?void 0:x.includes("mouse"))&&x!=="mousedown"});R.useEffect(()=>{if(!u)return;function P(x){let{open:I}=x;I||(ze(F),ze(k),B.current=!0,y.current=!1)}return i.on("openchange",P),()=>{i.off("openchange",P)}},[u,i]),R.useEffect(()=>{if(!u||!v.current||!n)return;function P(I){$()&&r(!1,I,"hover")}const x=nt(l.floating).documentElement;return x.addEventListener("mouseleave",P),()=>{x.removeEventListener("mouseleave",P)}},[l.floating,n,r,u,v,$]);const D=R.useCallback(function(P,x,I){x===void 0&&(x=!0),I===void 0&&(I="hover");const _=wo(E.current,"close",N.current);_&&!j.current?(ze(F),F.current=window.setTimeout(()=>r(!1,P,I),_)):x&&(ze(F),r(!1,P,I))},[E,r]),L=ot(()=>{b.current(),j.current=void 0}),C=ot(()=>{if(h.current){const P=nt(l.floating).body;P.style.pointerEvents="",P.removeAttribute(Sl),h.current=!1}}),O=ot(()=>o.current.openEvent?["click","mousedown"].includes(o.current.openEvent.type):!1);R.useEffect(()=>{if(!u)return;function P(W){if(ze(F),B.current=!1,c&&!rn(N.current)||Eo(w.current)>0&&!wo(E.current,"open"))return;const Y=wo(E.current,"open",N.current);Y?F.current=window.setTimeout(()=>{M.current||r(!0,W,"hover")},Y):n||r(!0,W,"hover")}function x(W){if(O()){C();return}b.current();const Y=nt(l.floating);if(ze(k),y.current=!1,v.current&&o.current.floatingContext){n||ze(F),j.current=v.current({...o.current.floatingContext,tree:f,x:W.clientX,y:W.clientY,onClose(){C(),L(),O()||D(W,!0,"safe-polygon")}});const G=j.current;Y.addEventListener("mousemove",G),b.current=()=>{Y.removeEventListener("mousemove",G)};return}(N.current==="touch"?!_t(l.floating,W.relatedTarget):!0)&&D(W)}function I(W){O()||o.current.floatingContext&&(v.current==null||v.current({...o.current.floatingContext,tree:f,x:W.clientX,y:W.clientY,onClose(){C(),L(),O()||D(W)}})(W))}function _(){ze(F)}function V(W){O()||D(W,!1)}if(oe(l.domReference)){const W=l.domReference,Y=l.floating;return n&&W.addEventListener("mouseleave",I),p&&W.addEventListener("mousemove",P,{once:!0}),W.addEventListener("mouseenter",P),W.addEventListener("mouseleave",x),Y&&(Y.addEventListener("mouseleave",I),Y.addEventListener("mouseenter",_),Y.addEventListener("mouseleave",V)),()=>{n&&W.removeEventListener("mouseleave",I),p&&W.removeEventListener("mousemove",P),W.removeEventListener("mouseenter",P),W.removeEventListener("mouseleave",x),Y&&(Y.removeEventListener("mouseleave",I),Y.removeEventListener("mouseenter",_),Y.removeEventListener("mouseleave",V))}}},[l,u,e,c,p,D,L,C,r,n,M,f,E,v,o,O,w]),rt(()=>{var P;if(u&&n&&(P=v.current)!=null&&(P=P.__options)!=null&&P.blockPointerEvents&&$()){h.current=!0;const I=l.floating;if(oe(l.domReference)&&I){var x;const _=nt(l.floating).body;_.setAttribute(Sl,"");const V=l.domReference,W=f==null||(x=f.nodesRef.current.find(Y=>Y.id===g))==null||(x=x.context)==null?void 0:x.elements.floating;return W&&(W.style.pointerEvents=""),_.style.pointerEvents="none",V.style.pointerEvents="auto",I.style.pointerEvents="auto",()=>{_.style.pointerEvents="",V.style.pointerEvents="",I.style.pointerEvents=""}}}},[u,n,g,l,f,v,$]),rt(()=>{n||(N.current=void 0,y.current=!1,L(),C())},[n,L,C]),R.useEffect(()=>()=>{L(),ze(F),ze(k),C()},[u,l.domReference,L,C]);const T=R.useMemo(()=>{function P(x){N.current=x.pointerType}return{onPointerDown:P,onPointerEnter:P,onMouseMove(x){const{nativeEvent:I}=x;function _(){!B.current&&!M.current&&r(!0,I,"hover")}c&&!rn(N.current)||n||Eo(w.current)===0||y.current&&x.movementX**2+x.movementY**2<2||(ze(k),N.current==="touch"?_():(y.current=!0,k.current=window.setTimeout(_,Eo(w.current))))}}},[c,r,n,M,w]);return R.useMemo(()=>u?{reference:T}:{},[u,T])}const Cl={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},Ol=R.forwardRef(function(t,n){const[r,o]=R.useState();rt(()=>{pl()&&o("button")},[]);const i={ref:n,tabIndex:0,role:r,"aria-hidden":r?void 0:!0,[on("focus-guard")]:"",style:Cl};return S.jsx("span",{...t,...i})}),Tl=R.createContext(null),Nl=on("portal");function ym(e){e===void 0&&(e={});const{id:t,root:n}=e,r=vo(),o=wm(),[i,l]=R.useState(null),u=R.useRef(null);return rt(()=>()=>{i==null||i.remove(),queueMicrotask(()=>{u.current=null})},[i]),rt(()=>{if(!r||u.current)return;const s=t?document.getElementById(t):null;if(!s)return;const a=document.createElement("div");a.id=r,a.setAttribute(Nl,""),s.appendChild(a),u.current=a,l(a)},[t,r]),rt(()=>{if(n===null||!r||u.current)return;let s=n||(o==null?void 0:o.portalNode);s&&!Ar(s)&&(s=s.current),s=s||document.body;let a=null;t&&(a=document.createElement("div"),a.id=t,s.appendChild(a));const c=document.createElement("div");c.id=r,c.setAttribute(Nl,""),s=a||s,s.appendChild(c),u.current=c,l(c)},[t,n,r,o]),i}function xm(e){const{children:t,id:n,root:r,preserveTabOrder:o=!0}=e,i=ym({id:n,root:r}),[l,u]=R.useState(null),s=R.useRef(null),a=R.useRef(null),c=R.useRef(null),d=R.useRef(null),p=l==null?void 0:l.modal,f=l==null?void 0:l.open,g=!!l&&!l.modal&&l.open&&o&&!!(r||i);return R.useEffect(()=>{if(!i||!o||p)return;function v(E){i&&go(E)&&(E.type==="focusin"?bl:um)(i)}return i.addEventListener("focusin",v,!0),i.addEventListener("focusout",v,!0),()=>{i.removeEventListener("focusin",v,!0),i.removeEventListener("focusout",v,!0)}},[i,o,p]),R.useEffect(()=>{i&&(f||bl(i))},[f,i]),S.jsxs(Tl.Provider,{value:R.useMemo(()=>({preserveTabOrder:o,beforeOutsideRef:s,afterOutsideRef:a,beforeInsideRef:c,afterInsideRef:d,portalNode:i,setFocusManagerState:u}),[o,i]),children:[g&&i&&S.jsx(Ol,{"data-type":"outside",ref:s,onFocus:v=>{if(go(v,i)){var E;(E=c.current)==null||E.focus()}else{const M=l?l.domReference:null,w=am(M);w==null||w.focus()}}}),g&&i&&S.jsx("span",{"aria-owns":i.id,style:Cl}),i&&Vt.createPortal(t,i),g&&i&&S.jsx(Ol,{"data-type":"outside",ref:a,onFocus:v=>{if(go(v,i)){var E;(E=d.current)==null||E.focus()}else{const M=l?l.domReference:null,w=lm(M);w==null||w.focus(),l!=null&&l.closeOnFocusOut&&(l==null||l.onOpenChange(!1,v.nativeEvent,"focus-out"))}}})]})}const wm=()=>R.useContext(Tl);function Ll(e){return Ce(e.target)&&e.target.tagName==="BUTTON"}function Em(e){return Ce(e.target)&&e.target.tagName==="A"}function Pl(e){return hl(e)}function Sm(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,dataRef:o,elements:{domReference:i}}=e,{enabled:l=!0,event:u="click",toggle:s=!0,ignoreMouse:a=!1,keyboardHandlers:c=!0,stickIfOpen:d=!0}=t,p=R.useRef(),f=R.useRef(!1),g=R.useMemo(()=>({onPointerDown(v){p.current=v.pointerType},onMouseDown(v){const E=p.current;v.button===0&&u!=="click"&&(rn(E,!0)&&a||(n&&s&&(!(o.current.openEvent&&d)||o.current.openEvent.type==="mousedown")?r(!1,v.nativeEvent,"click"):(v.preventDefault(),r(!0,v.nativeEvent,"click"))))},onClick(v){const E=p.current;if(u==="mousedown"&&p.current){p.current=void 0;return}rn(E,!0)&&a||(n&&s&&(!(o.current.openEvent&&d)||o.current.openEvent.type==="click")?r(!1,v.nativeEvent,"click"):r(!0,v.nativeEvent,"click"))},onKeyDown(v){p.current=void 0,!(v.defaultPrevented||!c||Ll(v))&&(v.key===" "&&!Pl(i)&&(v.preventDefault(),f.current=!0),!Em(v)&&v.key==="Enter"&&r(!(n&&s),v.nativeEvent,"click"))},onKeyUp(v){v.defaultPrevented||!c||Ll(v)||Pl(i)||v.key===" "&&f.current&&(f.current=!1,r(!(n&&s),v.nativeEvent,"click"))}}),[o,i,u,a,c,r,n,d,s]);return R.useMemo(()=>l?{reference:g}:{},[l,g])}const Cm={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},Om={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},Dl=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 Tm(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,elements:o,dataRef:i}=e,{enabled:l=!0,escapeKey:u=!0,outsidePress:s=!0,outsidePressEvent:a="pointerdown",referencePress:c=!1,referencePressEvent:d="pointerdown",ancestorScroll:p=!1,bubbles:f,capture:g}=t,v=xo(),E=ot(typeof s=="function"?s:()=>!1),M=typeof s=="function"?E:s,w=R.useRef(!1),{escapeKey:N,outsidePress:F}=Dl(f),{escapeKey:j,outsidePress:k}=Dl(g),B=R.useRef(!1),h=ot(C=>{var O;if(!n||!l||!u||C.key!=="Escape"||B.current)return;const T=(O=i.current.floatingContext)==null?void 0:O.nodeId,P=v?Hn(v.nodesRef.current,T):[];if(!N&&(C.stopPropagation(),P.length>0)){let x=!0;if(P.forEach(I=>{var _;if((_=I.context)!=null&&_.open&&!I.context.dataRef.current.__escapeKeyBubbles){x=!1;return}}),!x)return}r(!1,nm(C)?C.nativeEvent:C,"escape-key")}),b=ot(C=>{var O;const T=()=>{var P;h(C),(P=Bt(C))==null||P.removeEventListener("keydown",T)};(O=Bt(C))==null||O.addEventListener("keydown",T)}),y=ot(C=>{var O;const T=i.current.insideReactTree;i.current.insideReactTree=!1;const P=w.current;if(w.current=!1,a==="click"&&P||T||typeof M=="function"&&!M(C))return;const x=Bt(C),I="["+on("inert")+"]",_=nt(o.floating).querySelectorAll(I);let V=oe(x)?x:null;for(;V&&!ut(V);){const G=ct(V);if(ut(G)||!oe(G))break;V=G}if(_.length&&oe(x)&&!Jp(x)&&!_t(x,o.floating)&&Array.from(_).every(G=>!_t(V,G)))return;if(Ce(x)&&L){const G=ut(x),H=Ve(x),z=/auto|scroll/,J=G||z.test(H.overflowX),se=G||z.test(H.overflowY),he=J&&x.clientWidth>0&&x.scrollWidth>x.clientWidth,$e=se&&x.clientHeight>0&&x.scrollHeight>x.clientHeight,it=H.direction==="rtl",Ee=$e&&(it?C.offsetX<=x.offsetWidth-x.clientWidth:C.offsetX>x.clientWidth),ge=he&&C.offsetY>x.clientHeight;if(Ee||ge)return}const W=(O=i.current.floatingContext)==null?void 0:O.nodeId,Y=v&&Hn(v.nodesRef.current,W).some(G=>{var H;return ho(C,(H=G.context)==null?void 0:H.elements.floating)});if(ho(C,o.floating)||ho(C,o.domReference)||Y)return;const q=v?Hn(v.nodesRef.current,W):[];if(q.length>0){let G=!0;if(q.forEach(H=>{var z;if((z=H.context)!=null&&z.open&&!H.context.dataRef.current.__outsidePressBubbles){G=!1;return}}),!G)return}r(!1,C,"outside-press")}),$=ot(C=>{var O;const T=()=>{var P;y(C),(P=Bt(C))==null||P.removeEventListener(a,T)};(O=Bt(C))==null||O.addEventListener(a,T)});R.useEffect(()=>{if(!n||!l)return;i.current.__escapeKeyBubbles=N,i.current.__outsidePressBubbles=F;let C=-1;function O(_){r(!1,_,"ancestor-scroll")}function T(){window.clearTimeout(C),B.current=!0}function P(){C=window.setTimeout(()=>{B.current=!1},Sn()?5:0)}const x=nt(o.floating);u&&(x.addEventListener("keydown",j?b:h,j),x.addEventListener("compositionstart",T),x.addEventListener("compositionend",P)),M&&x.addEventListener(a,k?$:y,k);let I=[];return p&&(oe(o.domReference)&&(I=yt(o.domReference)),oe(o.floating)&&(I=I.concat(yt(o.floating))),!oe(o.reference)&&o.reference&&o.reference.contextElement&&(I=I.concat(yt(o.reference.contextElement)))),I=I.filter(_=>{var V;return _!==((V=x.defaultView)==null?void 0:V.visualViewport)}),I.forEach(_=>{_.addEventListener("scroll",O,{passive:!0})}),()=>{u&&(x.removeEventListener("keydown",j?b:h,j),x.removeEventListener("compositionstart",T),x.removeEventListener("compositionend",P)),M&&x.removeEventListener(a,k?$:y,k),I.forEach(_=>{_.removeEventListener("scroll",O)}),window.clearTimeout(C)}},[i,o,u,M,a,n,r,p,l,N,F,h,j,b,y,k,$]),R.useEffect(()=>{i.current.insideReactTree=!1},[i,M,a]);const D=R.useMemo(()=>({onKeyDown:h,...c&&{[Cm[d]]:C=>{r(!1,C.nativeEvent,"reference-press")},...d!=="click"&&{onClick(C){r(!1,C.nativeEvent,"reference-press")}}}}),[h,r,c,d]),L=R.useMemo(()=>({onKeyDown:h,onMouseDown(){w.current=!0},onMouseUp(){w.current=!0},[Om[a]]:()=>{i.current.insideReactTree=!0}}),[h,a,i]);return R.useMemo(()=>l?{reference:D,floating:L}:{},[l,D,L])}function Nm(e){const{open:t=!1,onOpenChange:n,elements:r}=e,o=vo(),i=R.useRef({}),[l]=R.useState(()=>hm()),u=yo()!=null;if(process.env.NODE_ENV!=="production"){const f=r.reference;f&&!oe(f)&&mm("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[s,a]=R.useState(r.reference),c=ot((f,g,v)=>{i.current.openEvent=f?g:void 0,l.emit("openchange",{open:f,event:g,reason:v,nested:u}),n==null||n(f,g,v)}),d=R.useMemo(()=>({setPositionReference:a}),[]),p=R.useMemo(()=>({reference:s||r.reference||null,floating:r.floating||null,domReference:r.reference}),[s,r.reference,r.floating]);return R.useMemo(()=>({dataRef:i,open:t,onOpenChange:c,elements:p,events:l,floatingId:o,refs:d}),[t,c,p,l,o,d])}function Lm(e){e===void 0&&(e={});const{nodeId:t}=e,n=Nm({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,o=r.elements,[i,l]=R.useState(null),[u,s]=R.useState(null),c=(o==null?void 0:o.domReference)||i,d=R.useRef(null),p=xo();rt(()=>{c&&(d.current=c)},[c]);const f=ms({...e,elements:{...o,...u&&{reference:u}}}),g=R.useCallback(N=>{const F=oe(N)?{getBoundingClientRect:()=>N.getBoundingClientRect(),getClientRects:()=>N.getClientRects(),contextElement:N}:N;s(F),f.refs.setReference(F)},[f.refs]),v=R.useCallback(N=>{(oe(N)||N===null)&&(d.current=N,l(N)),(oe(f.refs.reference.current)||f.refs.reference.current===null||N!==null&&!oe(N))&&f.refs.setReference(N)},[f.refs]),E=R.useMemo(()=>({...f.refs,setReference:v,setPositionReference:g,domReference:d}),[f.refs,v,g]),M=R.useMemo(()=>({...f.elements,domReference:c}),[f.elements,c]),w=R.useMemo(()=>({...f,...r,refs:E,elements:M,nodeId:t}),[f,E,M,t,r]);return rt(()=>{r.dataRef.current.floatingContext=w;const N=p==null?void 0:p.nodesRef.current.find(F=>F.id===t);N&&(N.context=w)}),R.useMemo(()=>({...f,context:w,refs:E,elements:M}),[f,E,M,w])}function So(){return Xp()&&pl()}function Pm(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,events:o,dataRef:i,elements:l}=e,{enabled:u=!0,visibleOnly:s=!0}=t,a=R.useRef(!1),c=R.useRef(-1),d=R.useRef(!0);R.useEffect(()=>{if(!u)return;const f=Le(l.domReference);function g(){!n&&Ce(l.domReference)&&l.domReference===mo(nt(l.domReference))&&(a.current=!0)}function v(){d.current=!0}function E(){d.current=!1}return f.addEventListener("blur",g),So()&&(f.addEventListener("keydown",v,!0),f.addEventListener("pointerdown",E,!0)),()=>{f.removeEventListener("blur",g),So()&&(f.removeEventListener("keydown",v,!0),f.removeEventListener("pointerdown",E,!0))}},[l.domReference,n,u]),R.useEffect(()=>{if(!u)return;function f(g){let{reason:v}=g;(v==="reference-press"||v==="escape-key")&&(a.current=!0)}return o.on("openchange",f),()=>{o.off("openchange",f)}},[o,u]),R.useEffect(()=>()=>{ze(c)},[]);const p=R.useMemo(()=>({onMouseLeave(){a.current=!1},onFocus(f){if(a.current)return;const g=Bt(f.nativeEvent);if(s&&oe(g)){if(So()&&!f.relatedTarget){if(!d.current&&!hl(g))return}else if(!em(g))return}r(!0,f.nativeEvent,"focus")},onBlur(f){a.current=!1;const g=f.relatedTarget,v=f.nativeEvent,E=oe(g)&&g.hasAttribute(on("focus-guard"))&&g.getAttribute("data-type")==="outside";c.current=window.setTimeout(()=>{var M;const w=mo(l.domReference?l.domReference.ownerDocument:document);!g&&w===l.domReference||_t((M=i.current.floatingContext)==null?void 0:M.refs.floating.current,w)||_t(l.domReference,w)||E||r(!1,v,"focus")})}}),[i,l.domReference,r,s]);return R.useMemo(()=>u?{reference:p}:{},[u,p])}function Co(e,t,n){const r=new Map,o=n==="item";let i=e;if(o&&e){const{[yl]:l,[xl]:u,...s}=e;i=s}return{...n==="floating"&&{tabIndex:-1,[cm]:""},...i,...t.map(l=>{const u=l?l[n]:null;return typeof u=="function"?e?u(e):null:u}).concat(e).reduce((l,u)=>(u&&Object.entries(u).forEach(s=>{let[a,c]=s;if(!(o&&[yl,xl].includes(a)))if(a.indexOf("on")===0){if(r.has(a)||r.set(a,[]),typeof c=="function"){var d;(d=r.get(a))==null||d.push(c),l[a]=function(){for(var p,f=arguments.length,g=new Array(f),v=0;v<f;v++)g[v]=arguments[v];return(p=r.get(a))==null?void 0:p.map(E=>E(...g)).find(E=>E!==void 0)}}}else l[a]=c}),l),{})}}function Dm(e){e===void 0&&(e=[]);const t=e.map(u=>u==null?void 0:u.reference),n=e.map(u=>u==null?void 0:u.floating),r=e.map(u=>u==null?void 0:u.item),o=R.useCallback(u=>Co(u,e,"reference"),t),i=R.useCallback(u=>Co(u,e,"floating"),n),l=R.useCallback(u=>Co(u,e,"item"),r);return R.useMemo(()=>({getReferenceProps:o,getFloatingProps:i,getItemProps:l}),[o,i,l])}const $m=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function Am(e,t){var n,r;t===void 0&&(t={});const{open:o,elements:i,floatingId:l}=e,{enabled:u=!0,role:s="dialog"}=t,a=vo(),c=((n=i.domReference)==null?void 0:n.id)||a,d=R.useMemo(()=>{var w;return((w=tm(i.floating))==null?void 0:w.id)||l},[i.floating,l]),p=(r=$m.get(s))!=null?r:s,g=yo()!=null,v=R.useMemo(()=>p==="tooltip"||s==="label"?{["aria-"+(s==="label"?"labelledby":"describedby")]:o?d:void 0}:{"aria-expanded":o?"true":"false","aria-haspopup":p==="alertdialog"?"dialog":p,"aria-controls":o?d:void 0,...p==="listbox"&&{role:"combobox"},...p==="menu"&&{id:c},...p==="menu"&&g&&{role:"menuitem"},...s==="select"&&{"aria-autocomplete":"none"},...s==="combobox"&&{"aria-autocomplete":"list"}},[p,d,g,o,c,s]),E=R.useMemo(()=>{const w={id:d,...p&&{role:p}};return p==="tooltip"||s==="label"?w:{...w,...p==="menu"&&{"aria-labelledby":c}}},[p,d,c,s]),M=R.useCallback(w=>{let{active:N,selected:F}=w;const j={role:"option",...N&&{id:d+"-fui-option"}};switch(s){case"select":case"combobox":return{...j,"aria-selected":F}}return{}},[d,s]);return R.useMemo(()=>u?{reference:v,floating:E,item:M}:{},[u,v,E,M])}const $l=m.forwardRef(({placement:e,className:t=""},n)=>{const o=(i=>{switch(i.split("-")[0]){case"top":return{bottom:"-4px",left:"50%",transform:"translateX(-50%)",borderLeft:"4px solid transparent",borderRight:"4px solid transparent",borderTop:"4px solid #242424"};case"bottom":return{top:"-4px",left:"50%",transform:"translateX(-50%)",borderLeft:"4px solid transparent",borderRight:"4px solid transparent",borderBottom:"4px solid #242424"};case"left":return{right:"-4px",top:"50%",transform:"translateY(-50%)",borderTop:"4px solid transparent",borderBottom:"4px solid transparent",borderLeft:"4px solid #242424"};case"right":return{left:"-4px",top:"50%",transform:"translateY(-50%)",borderTop:"4px solid transparent",borderBottom:"4px solid transparent",borderRight:"4px solid #242424"};default:return{}}})(e);return S.jsx("div",{ref:n,className:`absolute w-0 h-0 ${t}`,style:o})});$l.displayName="TooltipArrow";const sn=({children:e,content:t,placement:n="top",delay:r=200,showArrow:o=!0,className:i="",disabled:l=!1,maxWidth:u="max-w-xs",trigger:s=["hover","focus"]})=>{const[a,c]=m.useState(!1),d=m.useRef(null),{refs:p,floatingStyles:f,context:g}=Lm({open:a&&!l,onOpenChange:c,placement:n,whileElementsMounted:cs,middleware:[Hr(o?12:8),gs({fallbackAxisSideDirection:"start",padding:8}),hs({padding:8}),...o?[Kf({element:d})]:[]]}),v=bm(g,{enabled:s.includes("hover"),delay:{open:r,close:150}}),E=Pm(g,{enabled:s.includes("focus")}),M=Sm(g,{enabled:s.includes("click")}),w=Tm(g),N=Am(g,{role:"tooltip"}),{getReferenceProps:F,getFloatingProps:j}=Dm([v,E,M,w,N]);return l?S.jsx(S.Fragment,{children:e}):S.jsxs(S.Fragment,{children:[S.jsx("div",{ref:p.setReference,...F(),children:e}),a&&S.jsx(xm,{children:S.jsxs("div",{ref:p.setFloating,...j(),style:f,className:`
|
|
112
112
|
z-50 px-3 py-2
|
|
113
113
|
bg-fill-page-secondary
|
|
114
114
|
text-text-primary text-sm font-medium
|
|
@@ -116,5 +116,5 @@ React keys must be passed directly to JSX without using spread:
|
|
|
116
116
|
relative
|
|
117
117
|
${u}
|
|
118
118
|
${i}
|
|
119
|
-
`,children:[t,o&&C.jsx(Al,{ref:d,placement:g.placement||n})]})})]})},Co="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAIcSURBVHgBxZc/T8JAGMafA4mDEXFw0DiQmDi4CP5JHGFx0qizg8QvIHwCZHYAvwEm7mji5CJuJv7DxcWYYMLmIEYXY/R8j6tQaBvuaCm/pOlbSu99+rZ97zlgwDBowvNLCdrF6NJ50891OvNC+wrL3JShgZIAnl+JAj97FKXoMNLl7ySGnQDBHMtcVeFGAM8nKNlnlsI0eoIVuwlhzsmXqcwoURSFK1iVRCSdRDDn5PwC3cutingsJOK60nkiYE0unrdi8uFRIDwFBSJiTKOqzgKMl00teXgS2D0Fto+BiVkoIMYs8Xws4iiAkmeVn/n0oqyA2NQEQI4dytoKMEqfQt/haZmrQ4C8e7/4TtsI4JvwDbYDswCjvXr1yakQMXI2KxCD/8RMAtx2ux5gcjIzBAT8LH8bAQwYbwR8fUAb/vtuEsAr0OX5Eng8o30ZqN1BHzFLAkPGkb4AcdfnObigkbM5HdN3+Qb/ekGdrNu4CMyd8Ag6iElo/QBYzcpYByYsm8QkIFSADmI2nEkAc2sUL0ALHsxZBEjLxA+hSu22tb0+KV9Gd18027M2SybNQui+f53R6g/b+gDLVMi7YQsND+c5dTtzamlE0jiyJLwVYZhSqzO27YRSxFD8v1m4Q4xh74gdBUgRQm2QKsH0Ps82xEs9EndK3sgDlWGkW96naANqSzMSHSy4XprZi2kuTqN09VjrBH9AD4vTgfMHJt+rxIFF7EgAAAAASUVORK5CYII=",Dm=({walletAdapter:e,curSelectToken:t,currentActiveChain:n,metadata:r,onCopy:o})=>{var u;const{t:i}=Ye(),l=m.useMemo(()=>gp(n||{}),[n]);return C.jsxs(C.Fragment,{children:[C.jsx("div",{className:"flex justify-center mt-4 mb-3",children:(e==null?void 0:e.getDisplayAddress())&&C.jsx("div",{className:"bg-white rounded-lg",children:C.jsx(fl,{value:(e==null?void 0:e.getDisplayAddress())||"",size:120,level:"L",bgColor:"#ffffff",fgColor:"#000000",marginSize:0})})}),(e==null?void 0:e.getDisplayAddress())&&C.jsxs("div",{className:"flex items-center justify-between bg-fill-input-primary rounded-lg py-2 px-3 mb-3",children:[C.jsx("span",{className:"flex-1 text-text-primary text-sm font-medium break-all mr-3",children:e==null?void 0:e.getDisplayAddress()}),C.jsx(Rp,{onCopy:()=>{const s=(e==null?void 0:e.getDisplayAddress())||"";o&&o(s)},text:e==null?void 0:e.getDisplayAddress(),children:C.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:[C.jsx("rect",{x:"2.08496",y:"4.02295",width:"9.89893",height:"9.89893",rx:"2",stroke:"#F9F9F9"}),C.jsx("path",{d:"M5.85547 2.07861H11.415C12.7957 2.07861 13.915 3.1979 13.915 4.57861V10.0786",stroke:"#F9F9F9",strokeLinecap:"round"})]})},"copy")]}),C.jsxs("div",{className:"border-b border-dashed border-line-divider-secondary pb-4",children:[C.jsxs("div",{className:"flex items-start",children:[C.jsx("div",{className:"w-5",children:C.jsx("img",{src:Co,className:"w-4 h-4",alt:"Warning"})}),C.jsx("div",{className:"flex-1",children:C.jsx("p",{className:"text-xs text-functional-orange-1",children:i("deposit.depositAllTip",{coin:t,v:n==null?void 0:n.chain})})})]}),l&&C.jsxs(C.Fragment,{children:[C.jsx("div",{className:"my-2 ml-5 h-[1px] border-b border-dashed border-line-divider-secondary"}),C.jsx("div",{className:"flex items-start pl-5 text-functional-orange-1 text-xs",children:i("deposit.depositTipFor25w")})]})]}),C.jsxs("div",{className:"text-sm",children:[C.jsxs("div",{className:"flex justify-between items-center h-[18px] mt-4",children:[C.jsx("span",{className:"text-text-tertiary",children:i("deposit.arrivalTime")}),C.jsx(sn,{content:C.jsxs("div",{className:"grid flex-grow max-w-[300px] min-w-[80px] rounded-2xl flex-col gap-[10px]",children:[C.jsx("p",{children:i("deposit.arrivaltimeTooltip1",{v:(n==null?void 0:n.blockTime)*n.txConfirm/60,v1:n==null?void 0:n.txConfirm})}),C.jsx("p",{children:i("deposit.arrivaltimeTooltip2")})]}),placement:"top",children:C.jsx("span",{className:"text-text-primary font-medium text-right border-b-[2px] border-dashed border-line-divider-primary decoration-dashed",children:i("deposit.arrivalEstimated",{v:(n==null?void 0:n.blockTime)*n.txConfirm/60})})})]}),C.jsxs("div",{className:"flex justify-between items-center h-[18px] mt-2",children:[C.jsx("span",{className:"text-text-tertiary",children:i("deposit.minDeposit")}),C.jsxs("span",{className:"text-text-primary font-medium text-right",children:[((u=r==null?void 0:r.multiChain)==null?void 0:u.minDeposit)||10," ",t]})]}),C.jsxs("div",{className:"flex justify-between items-center h-[18px] mt-2",children:[C.jsx("span",{className:"text-text-tertiary",children:i("deposit.maxDeposit")}),C.jsxs("span",{className:"text-text-primary font-medium text-right",children:["200,000 ",t]})]})]})]})},Mm=({chains:e,defaultChainId:t,defaultTokenAddress:n,walletAdapter:r,metadata:o,onDeposit:i,onCopy:l,onClose:u})=>{var v;const{t:s}=Ye(),[a,c]=m.useState(()=>{var E;return!e||e.length===0?1:t||((E=e[0])==null?void 0:E.chainId)||1}),[d,p]=m.useState(()=>{var N;if(!e||e.length===0)return"";const E=t||((N=e[0])==null?void 0:N.chainId),M=e.find(j=>j.chainId===E);if(!M||!M.tokenList||M.tokenList.length===0)return"";const w=M.tokenList.find(j=>j.tokenAddress===n)||M.tokenList[0];return(w==null?void 0:w.token)||""}),f=e&&e.length>0?e.find(E=>E.chainId===a)||e[0]:null,g=(v=f==null?void 0:f.tokenList)==null?void 0:v.find(E=>E.token===d);return!e||e.length===0?C.jsx("div",{className:"text-center py-8",children:C.jsx("p",{className:"text-gray-400",children:"No chains available"})}):f?C.jsxs(C.Fragment,{children:[C.jsx(to,{currentActiveChain:f,chainList:e,onChainChange:c,curSelectToken:d,onTokenChange:p,walletType:"mpc"}),C.jsx(Dm,{walletAdapter:r,curSelectToken:d,currentActiveChain:f,metadata:o,onCopy:l}),C.jsx("button",{className:"w-full h-[38px] bg-fill-btn-primary rounded-xl text-sm font-medium text-text-on-sec-btn mt-4",onClick:()=>{i&&i({amount:"",chainId:a,tokenAddress:(g==null?void 0:g.tokenAddress)||"",tokenSymbol:d}),u()},children:s("deposit.title")})]}):C.jsx("div",{className:"text-center py-8",children:C.jsx("p",{className:"text-gray-400",children:"Loading..."})})},Im=Object.values({MAINNET:1,SEPOLIA:11155111}),pt=e=>{const t=typeof e=="string"?parseInt(e,10):e;return Im.includes(t)},jm={USDT:!0},Oo=(e,t)=>{const n=typeof e=="string"?parseInt(e,10):e;return n===1||n===11155111?!1:(n===42161||n===421614)&&t?t.toUpperCase()==="ETH"?!1:!jm[t.toUpperCase()]:!0},ln=({size:e="xs",color:t,className:n="",label:r="Loading...",inline:o=!1})=>{const i=t?`loading-${t}`:"",l=o?"loading-inline":"";return C.jsx("span",{className:`loading loading-${e} loading-spinner ${i} ${l} ${n}`.trim(),"aria-label":r,role:"status","aria-live":"polite"})},Fm=({depositAmount:e,curSelectToken:t,curSelectTokenData:n,approved:r,currentActiveChain:o,currentEquity:i,amount:l,decimals:u,tokenBalance:s,platformBalance:a="0",onDepositAmountChange:c,onApproved:d})=>{const{t:p}=Ye(),[f,g]=m.useState(!1);m.useEffect(()=>{r&&f&&g(!1)},[r,f]);const v=m.useCallback(async()=>{if(!f)try{g(!0),await d()}catch(j){g(!1),console.error("Approve failed:",j)}},[d,f]),E=m.useCallback(()=>{let j=s||"0";if(Oo(o==null?void 0:o.chainId,t))try{const F=new Oe(j),k=new Oe("200000");F.gt(k)&&(j="200000")}catch(F){console.warn("Error calculating max amount limit:",F)}return j},[s,o==null?void 0:o.chainId,t]),M=m.useMemo(()=>{if(!Oo(o==null?void 0:o.chainId,t))return!1;try{const j=new Oe(e||"0"),F=new Oe("200000");return j.isNaN()||F.isNaN()?!1:j.gte(F)}catch{return!1}},[o,e,t]);m.useMemo(()=>{if(!Oo(o==null?void 0:o.chainId,t))return!1;try{const j=new Oe(s||"0"),F=new Oe("200000");return j.gt(F)}catch{return!1}},[o==null?void 0:o.chainId,s,t]);const w=j=>{const F=j.target.value,k=E(),W=no(F,k);if(W.isValid)c(W.formattedValue),W.errorType;else return W.errorType==="exceed_balance",void 0},N=()=>{const j=parseFloat(s||"0"),F=parseFloat(e||"0");if(F>0){const k=j-F,W=Xe(Math.max(0,k).toString());return C.jsxs("span",{className:"flex items-center gap-1",children:[Xe(s||"0"),C.jsx("span",{className:"text-sm font-edgex-harmony text-functional-green-1 leading-[18px] font-medium",children:"→"}),W," ",t]})}return`${Xe(s||"0")} ${t}`};return C.jsxs(C.Fragment,{children:[C.jsxs("div",{className:"bg-fill-input-primary rounded-lg px-3 py-3 my-4",children:[C.jsxs("div",{className:"flex justify-between items-center h-[18px] mb-3",children:[C.jsx("input",{type:"text",placeholder:p("deposit.amount"),value:e,onChange:w,className:"flex-1 bg-transparent text-text-primary text-sm font-medium placeholder-text-tertiary placeholder:font-normal focus:outline-none border-none p-0 h-full"}),C.jsx("button",{onClick:()=>{const j=E();c(j)},className:"text-theme-normal text-xs font-medium cursor-pointer hover:opacity-80 transition-opacity h-full flex items-center",children:p("deposit.max")})]}),C.jsx("div",{className:"h-[1px] bg-line-divider-secondary mb-2"}),C.jsxs("div",{className:"flex justify-between items-center",children:[C.jsx(sn,{content:p("deposit.availableDesc"),children:C.jsx("span",{className:"text-text-tertiary text-xs leading-[14px] border-b border-dashed border-line-divider-primary",children:p("deposit.available")})}),C.jsx("span",{className:"text-text-primary text-xs leading-[14px]",children:N()})]})]}),!r&&pp(e||"0",0)&&C.jsxs("div",{className:"flex justify-center flex-col items-center",children:[C.jsx("h3",{className:"text-text-primary text-sm leading-4 font-medium",children:p("deposit.enableSystemProWithToken",{token:t,network:o==null?void 0:o.chain})}),C.jsx("p",{className:"text-text-secondary text-xs leading-3 mt-4",children:p("deposit.enableTokenDesc",{token:t,network:o==null?void 0:o.chain})}),C.jsx("button",{className:"w-[180px] h-8 bg-fill-btn-primary hover:bg-fill-btn-primary-hover text-text-on-sec-btn rounded-xl text-sm font-medium transition-colors my-4 disabled:opacity-50 disabled:cursor-not-allowed flex items-center justify-center",onClick:v,disabled:f,children:f?C.jsx(ln,{size:"xs",inline:!0}):p("deposit.enableWithToken",{token:t})})]}),M&&C.jsxs("div",{className:"flex mb-4",children:[C.jsx("div",{className:"w-5",children:C.jsx("img",{src:Co,className:"w-4 h-4",alt:"Warning"})}),C.jsx("div",{className:"flex-1 text-xs text-functional-orange-1",children:p("deposit.depositTipFor25w")})]}),M&&C.jsx("div",{className:"my-2 ml-5 h-[1px] border-b border-dashed border-line-divider-secondary"}),C.jsxs("div",{className:"flex mb-4",children:[C.jsx("div",{className:"w-5",children:!M&&C.jsx("img",{src:Co,className:"w-4 h-4",alt:"Warning"})}),C.jsx("div",{className:"flex-1 text-xs text-functional-orange-1",children:p("deposit.noPrivateKeyWalletWarning")})]}),C.jsx("div",{className:"border-t border-line-divider-secondary border-dashed py-4",children:C.jsxs("div",{className:"flex justify-between items-center",children:[C.jsx("span",{className:"text-sm leading-[18px] text-text-tertiary",children:p("deposit.equity")}),C.jsx("span",{className:"text-sm leading-[18px] text-text-primary font-medium",children:e?C.jsxs("span",{className:"flex items-center gap-1",children:[Xe(a),C.jsx("span",{className:"text-sm font-edgex-harmony text-functional-green-1 leading-[18px] font-medium",children:"→"}),Xe((parseFloat(a)+parseFloat(e)).toString())," ",t]}):`${Xe(a)} ${t}`})]})})]})},Rm=({token:e,account:t,chainId:n,contractAddress:r,wagmiHooks:o,onResult:i})=>{var s,a;const l=(s=o==null?void 0:o.useBalance)==null?void 0:s.call(o,{address:t,token:e.tokenAddress,chainId:n,query:{enabled:!!t&&!!n&&!!e.tokenAddress&&!!(o!=null&&o.useBalance)}}),u=(a=o==null?void 0:o.useReadContract)==null?void 0:a.call(o,{address:e.tokenAddress,abi:[{name:"allowance",type:"function",stateMutability:"view",inputs:[{name:"owner",type:"address"},{name:"spender",type:"address"}],outputs:[{name:"",type:"uint256"}]}],functionName:"allowance",args:[t,r],chainId:n,query:{enabled:!!t&&!!n&&!!e.tokenAddress&&!!r&&!!(o!=null&&o.useReadContract)}});return m.useEffect(()=>{i(e.tokenAddress,{balance:l,allowance:u})},[l,u,e.tokenAddress,i]),null},$l=({account:e,chainId:t,contractAddress:n,tokens:r=[],wagmiHooks:o})=>{var g;const i=m.useMemo(()=>r.filter(v=>v.tokenAddress&&v.tokenAddress!=="0x0000000000000000000000000000000000000000"),[r]),[l,u]=m.useState({}),s=m.useCallback((v,E)=>{u(M=>({...M,[v]:E}))},[]),a=(g=o==null?void 0:o.useBalance)==null?void 0:g.call(o,{address:e,chainId:t,query:{enabled:!!e&&!!t&&!!(o!=null&&o.useBalance)}}),c=m.useMemo(()=>i.map(v=>m.createElement(Rm,{key:v.tokenAddress,token:v,account:e,chainId:t,contractAddress:n,wagmiHooks:o,onResult:s})),[i,e,t,n,o,s]),d=m.useMemo(()=>{if(!(o!=null&&o.useBalance))return{balanceList:[],allowanceList:[],baseTokenBalance:{value:BigInt(0),formatted:"0",decimals:18,symbol:"ETH"},combinedData:{}};const v=a!=null&&a.data?{value:a.data.value,formatted:a.data.formatted,decimals:a.data.decimals,symbol:a.data.symbol}:{value:BigInt(0),formatted:"0",decimals:18,symbol:"ETH"},E=i.map(N=>{const j=l[N.tokenAddress],F=j==null?void 0:j.balance,k=F==null?void 0:F.data;return{address:N.tokenAddress,value:(k==null?void 0:k.value)||BigInt(0),formatted:(k==null?void 0:k.formatted)||"0",decimals:(k==null?void 0:k.decimals)||N.decimals}}).filter(N=>N.address),M=i.map(N=>{const j=l[N.tokenAddress],F=j==null?void 0:j.allowance,k=F==null?void 0:F.data,W=BigInt(k?k.toString():0);return{address:N.tokenAddress,value:W,formatted:(W/BigInt(10)**BigInt(N.decimals)).toString(),decimals:N.decimals}}).filter(N=>N.address),w=E.reduce((N,j)=>{const F=M.find(k=>k.address===j.address);return{...N,[j.address]:{balance:j,allowance:F||{address:j.address,value:BigInt(0),formatted:"0",decimals:j.decimals}}}},{});return{balanceList:E,allowanceList:M,baseTokenBalance:v,combinedData:w}},[a,l,i,o==null?void 0:o.useBalance]),p=m.useCallback(async()=>d,[d]),f=m.useMemo(()=>{const v=(a==null?void 0:a.isLoading)||!1,E=Object.values(l).some(M=>{var w,N;return((w=M.balance)==null?void 0:w.isLoading)||((N=M.allowance)==null?void 0:N.isLoading)});return v||E},[a==null?void 0:a.isLoading,l]);return{multicallRun:p,multicallResult:d,validErcTokens:i,isLoading:f,queryComponents:c}};let Pe=null;const km={symbol:"USDT"},Dl=m.forwardRef((e,t)=>{const[n,r]=m.useState(!1),[o,i]=m.useState(!1),[l,u]=m.useState({chains:[]}),s=m.useCallback(g=>{u(g),r(!0)},[]),a=m.useCallback(g=>{u(v=>({...v,...g}))},[]),c=m.useCallback(()=>{r(!1),i(!1),l.onClose&&l.onClose()},[l.onClose]),d=m.useCallback(g=>{i(g)},[]),p=m.useCallback(()=>n,[n]),f=m.useCallback(()=>o,[o]);return m.useImperativeHandle(t,()=>({openDeposit:s,closeDeposit:c,updateDepositOptions:a,setDepositLoading:d,isOpen:p,isLoading:f}),[s,c,a,d,p,f]),m.useEffect(()=>(Pe={openDeposit:s,closeDeposit:c,updateDepositOptions:a,setDepositLoading:d,isOpen:p,isLoading:f},()=>{Pe=null}),[s,c,a,d,p,f]),C.jsx(Rl,{isOpen:n,isLoading:o,onClose:c,config:l.config||km,currentActiveAccount:l.currentActiveAccount||ro,smartWallet:l.smartWallet||oo,chains:l.chains||vp,defaultChainId:l.defaultChainId,defaultTokenAddress:l.defaultTokenAddress,defaultAmount:l.defaultAmount,metadata:l.metadata||io,currentEquity:l.currentEquity??5e3,platformBalance:l.platformBalance||"0",wagmiHooks:l.wagmiHooks,approved:l.approved,onApproved:l.onApproved,onDeposit:l.onDeposit,onCopy:l.onCopy,onChainChange:l.onChainChange,onTokenChange:l.onTokenChange})});Dl.displayName="DepositManager";const Ml=e=>{if(!Pe){console.error("DepositManager not initialized. Make sure to render <DepositManager /> in your app.");return}Pe.openDeposit(e||{chains:[]})},Il=()=>{if(!Pe){console.error("DepositManager not initialized. Make sure to render <DepositManager /> in your app.");return}Pe.closeDeposit()},jl=e=>{Pe&&Pe.updateDepositOptions(e)},Yn=e=>{if(!Pe){console.error("DepositManager not initialized. Make sure to render <DepositManager /> in your app.");return}Pe.setDepositLoading(e)},_m=()=>Pe?Pe.isOpen():!1,Fl=()=>Pe?Pe.isLoading():!1,Wm=()=>({openDeposit:Ml,closeDeposit:Il,updateDepositOptions:jl,setDepositLoading:Yn,isOpen:_m,isLoading:Fl}),Bm=({chains:e,defaultChainId:t,defaultTokenAddress:n,defaultAmount:r="",walletAdapter:o,metadata:i,currentEquity:l,platformBalance:u="0",isLoading:s=!1,wagmiHooks:a,approved:c,onApproved:d,onDeposit:p,onClose:f,onChainChange:g,onTokenChange:v})=>{var q;const{t:E}=Ye(),M=a==null?void 0:a.useAccount(),[w,N]=m.useState(()=>{var B;return!e||e.length===0?1:t||((B=e[0])==null?void 0:B.chainId)||1}),[j,F]=m.useState(()=>{var Z;if(!e||e.length===0)return"";const B=t||((Z=e[0])==null?void 0:Z.chainId),K=e.find(ae=>ae.chainId===B);if(!K||!K.tokenList||K.tokenList.length===0)return"";const H=K.tokenList.find(ae=>ae.tokenAddress===n)||K.tokenList[0];return(H==null?void 0:H.token)||""}),[k,W]=m.useState(r),h=m.useCallback(B=>{N(B),g==null||g(B)},[g]),b=m.useCallback(B=>{F(B),v==null||v(B)},[v]),x=m.useRef(!0),$=m.useRef(j),A=m.useRef(w);m.useEffect(()=>{if(x.current){x.current=!1,$.current=j,A.current=w;return}($.current!==j||A.current!==w)&&(W(""),$.current=j,A.current=w)},[j,w]);const P=e&&e.length>0?e.find(B=>B.chainId===w)||e[0]:null,S=(q=P==null?void 0:P.tokenList)==null?void 0:q.find(B=>B.token===j),O=o==null?void 0:o.getDisplayAddress(),{multicallResult:T,queryComponents:L}=$l({account:O,chainId:w,contractAddress:void 0,tokens:(P==null?void 0:P.tokenList)||[],wagmiHooks:a}),y=m.useMemo(()=>{var K;if(!S)return;if(!S.tokenAddress||S.tokenAddress.toLowerCase()==="0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee")return T.baseTokenBalance.formatted;const B=T.combinedData[S.tokenAddress];return((K=B==null?void 0:B.balance)==null?void 0:K.formatted)||"0"},[S,T]),I=c??!1,_=m.useMemo(()=>+M.chainId!=+w,[M.chainId,w]),V=m.useMemo(()=>{if(_)return{text:E("deposit.switchNetwork"),disabled:!1,isNetworkSwitch:!0};const B=parseFloat(k||"0"),K=10,Z=mp(k,y||"0",I);return!k||B===0||!I?{text:E("deposit.confirmDeposit"),disabled:!0,isNetworkSwitch:!1}:B<K?{text:E("deposit.minDepositParsed",{amount:K,token:j}),disabled:!0,isNetworkSwitch:!1}:{text:E("deposit.confirmDeposit"),disabled:!Z,isNetworkSwitch:!1}},[k,j,y,I,_,E]),z=m.useCallback(async()=>{h&&h(w)},[h,w]),G=m.useCallback(async()=>{Yn(!0);try{p&&p({amount:k,chainId:w,tokenAddress:(S==null?void 0:S.tokenAddress)||"",tokenSymbol:j})}catch(B){console.error("Deposit error:",B),Yn(!1)}},[p,k,w,S==null?void 0:S.tokenAddress,j]);return!(a!=null&&a.useBalance)||!(a!=null&&a.useReadContract)||!(a!=null&&a.useAccount)?C.jsxs("div",{className:"p-6 text-center",children:[C.jsx("p",{className:"text-red-500",children:"缺少必要的 wagmi hooks"}),C.jsx("p",{className:"text-sm text-gray-500 mt-2",children:"请确保传入了 useBalance, useReadContract, useAccount"})]}):!e||e.length===0?C.jsx("div",{className:"text-center py-8",children:C.jsx("p",{className:"text-gray-400",children:"No chains available"})}):P?C.jsxs(C.Fragment,{children:[L,C.jsx(to,{currentActiveChain:P,chainList:e,onChainChange:h,curSelectToken:j,onTokenChange:b,walletType:"evm"}),C.jsx(Fm,{depositAmount:k,curSelectToken:j,curSelectTokenData:{balance:S==null?void 0:S.balance,allowance:S==null?void 0:S.allowance},approved:I,currentActiveChain:P,currentEquity:l||0,amount:k,decimals:(S==null?void 0:S.decimals)||6,tokenBalance:y,platformBalance:u,onDepositAmountChange:W,onApproved:async()=>{d&&await d()}}),C.jsxs("button",{className:`w-full h-[38px] text-sm rounded-xl font-medium transition-colors flex items-center justify-center gap-2 ${V.disabled||s?"bg-text-disabled text-text-secondary cursor-not-allowed":"bg-fill-btn-primary text-text-on-sec-btn"}`,onClick:V.isNetworkSwitch?z:G,disabled:V.disabled||s,children:[s&&C.jsx(ln,{size:"xs"}),V.text]})]}):C.jsx("div",{className:"text-center py-8",children:C.jsx("p",{className:"text-gray-400",children:"Loading..."})})},Rl=({isOpen:e,isLoading:t=!1,onClose:n,config:r,currentActiveAccount:o=ro,smartWallet:i=oo,chains:l,defaultChainId:u,defaultTokenAddress:s,defaultAmount:a="",metadata:c=io,currentEquity:d=5e3,platformBalance:p="0",wagmiHooks:f,approved:g,onApproved:v,onDeposit:E,onCopy:M,onChainChange:w,onTokenChange:N})=>{const{t:j}=Ye(),F=m.useMemo(()=>{var W;return o?Vo(o,i,!1,(W=l[0])==null?void 0:W.chainId,"0","0"):null},[o,i,l]),k=(F==null?void 0:F.getWalletType())==="mpc";return e?we.createPortal(C.jsx("div",{className:"fixed top-0 left-0 right-0 bottom-0 w-screen h-screen",style:{zIndex:49},children:C.jsx("div",{className:"fixed top-0 left-0 right-0 bottom-0 z-49 flex items-center justify-center",style:{background:"rgba(0, 0, 0, 0.6)"},onClick:()=>{n()},"aria-hidden":"true",children:C.jsxs("div",{className:"relative w-[420px] max-h-[85vh] bg-fill-page-secondary overflow-auto rounded-lg p-6 shadow-xl",onClick:W=>{W.stopPropagation()},children:[C.jsxs("div",{className:"flex items-center justify-between mb-4",children:[C.jsx("h2",{className:"text-lg font-semibold text-white",children:j("deposit.title")}),C.jsx("button",{className:"text-gray-400 hover:text-gray-200 transition-colors",onClick:n,"aria-label":"Close",children:C.jsx(Bo,{className:"h-4 w-4"})})]}),k?C.jsx(Mm,{chains:l,defaultChainId:u,defaultTokenAddress:s,defaultAmount:a,walletAdapter:F,metadata:c,currentEquity:d,onDeposit:E,onCopy:M,onClose:n}):C.jsx(Bm,{chains:l,defaultChainId:u,defaultTokenAddress:s,defaultAmount:a,walletAdapter:F,metadata:c,currentEquity:d,platformBalance:p,isLoading:t,wagmiHooks:f,approved:g,onApproved:v,onDeposit:E,onClose:n,onChainChange:w,onTokenChange:N})]})})}),document.body):null};m.createContext(null);const Um=()=>C.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"13",viewBox:"0 0 12 13",fill:"none",children:[C.jsx("g",{clipPath:"url(#clip0_active)",children:C.jsx("path",{d:"M4.63791 6.91929H2.62541C2.36266 6.91929 2.18141 6.65629 2.27491 6.41091L4.27466 1.16191C4.30172 1.0909 4.34971 1.02978 4.41228 0.986649C4.47485 0.943521 4.54905 0.920422 4.62504 0.92041H7.99954C8.26579 0.92041 8.44729 1.19016 8.34679 1.43679L7.18241 4.29479H9.37441C9.69679 4.29479 9.86879 4.67479 9.65616 4.91704L4.28191 11.0408C4.02066 11.3385 3.53629 11.0805 3.63766 10.6977L4.63791 6.91929Z",fill:"#22FD73"})}),C.jsx("defs",{children:C.jsx("clipPath",{id:"clip0_active",children:C.jsx("rect",{width:"12",height:"12",fill:"white",transform:"translate(0 0.0454102)"})})})]}),Vm=()=>C.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"13",viewBox:"0 0 12 13",fill:"none",children:[C.jsx("g",{clipPath:"url(#clip0_inactive)",children:C.jsx("path",{d:"M4.63791 6.91929H2.62541C2.36266 6.91929 2.18141 6.65629 2.27491 6.41091L4.27466 1.16191C4.30172 1.0909 4.34971 1.02978 4.41228 0.986649C4.47485 0.943521 4.54905 0.920422 4.62504 0.92041H7.99954C8.26579 0.92041 8.44729 1.19016 8.34679 1.43679L7.18241 4.29479H9.37441C9.69679 4.29479 9.86879 4.67479 9.65616 4.91704L4.28191 11.0408C4.02066 11.3385 3.53629 11.0805 3.63766 10.6977L4.63791 6.91929Z",fill:"#F9F9F9"})}),C.jsx("defs",{children:C.jsx("clipPath",{id:"clip0_inactive",children:C.jsx("rect",{width:"12",height:"12",fill:"white",transform:"translate(0 0.0454102)"})})})]}),Kn=({selectedLevel:e,maxLevel:t,className:n=""})=>{const r=Array.from({length:t},(o,i)=>i+1);return C.jsx("div",{className:`flex items-center ${n}`,children:r.map(o=>C.jsx("div",{className:"flex items-center justify-center",children:o<=e?C.jsx(Um,{}):C.jsx(Vm,{})},o))})};class mt{}Ie(mt,"FAST",3),Ie(mt,"Medium",2),Ie(mt,"SLOW",1),Ie(mt,"NONE",0);const zm=({withdrawAmount:e,curSelectToken:t,currentActiveChain:n,platformBalance:r="0",fee:o="0.00",walletType:i="evm",receiverAddress:l="",onWithdrawAmountChange:u,onReceiverAddressChange:s,onAmountChanged:a})=>{const{t:c}=Ye(),d=m.useMemo(()=>{if(!pt(n==null?void 0:n.chainId)){const E=new Oe(e||"0").minus(o||"0").decimalPlaces(2,Oe.ROUND_DOWN);return E.isNegative()?"0.00":E.toString()}return e||"0"},[e,o,n==null?void 0:n.chainId]),p=m.useMemo(()=>r||"0",[r]),f=E=>{const M=E.target.value,N=no(M,p||"0");if(N.isValid)u(N.formattedValue),N.errorType;else return N.errorType==="exceed_balance",void 0;a==null||a(N.formattedValue)},g=()=>{u(p),a==null||a(p)},v=()=>{const E=parseFloat(r||"0"),M=parseFloat(e||"0");if(M>0){const w=E-M,N=Xe(Math.max(0,w).toString());return C.jsxs("span",{className:"flex items-center gap-1",children:[Xe(r||"0"),C.jsx("span",{className:"text-sm font-edgex-harmony text-functional-green-1 leading-[18px] font-medium",children:"→"}),N," ",t]})}return`${Xe(r||"0")} ${t}`};return C.jsxs(C.Fragment,{children:[C.jsxs("div",{className:"bg-fill-input-primary rounded-lg px-3 py-3 my-4",children:[C.jsxs("div",{className:"flex justify-between items-center h-[18px] mb-3",children:[C.jsx("input",{type:"text",placeholder:c("deposit.amount"),value:e,onChange:f,className:"flex-1 bg-transparent text-text-primary text-sm font-medium placeholder-text-tertiary placeholder:font-normal focus:outline-none border-none p-0 h-full"}),C.jsx("button",{onClick:g,className:"text-theme-normal text-xs font-medium cursor-pointer hover:opacity-80 transition-opacity h-full flex items-center",children:c("deposit.max")})]}),C.jsx("div",{className:"h-[1px] bg-line-divider-secondary mb-2"}),C.jsxs("div",{className:"flex justify-between items-center",children:[C.jsx(sn,{content:c("deposit.availableDesc"),children:C.jsx("span",{className:"text-text-tertiary text-xs leading-[14px] border-b border-dashed border-line-divider-primary",children:c("deposit.available")})}),C.jsx("span",{className:"text-text-primary text-xs leading-[14px]",children:v()})]})]}),i==="mpc"&&!pt(n==null?void 0:n.chainId)&&C.jsx("div",{className:"bg-fill-input-primary rounded-lg my-4 h-9 flex items-center px-3",children:C.jsx("input",{type:"text",placeholder:c("withdraw.receiverAddress"),value:l,onChange:E=>s==null?void 0:s(E.target.value),className:"flex-1 bg-transparent text-text-primary text-sm font-medium placeholder-text-tertiary placeholder:font-normal focus:outline-none border-none p-0 h-full"})}),C.jsx("div",{className:"bg-fill-page-secondary rounded-lg mb-4",children:pt(n==null?void 0:n.chainId)?C.jsxs(C.Fragment,{children:[C.jsx("p",{className:"text-text-tertiary text-xs leading-[18px]",children:c("withdraw.noticeDesc")}),C.jsx("a",{className:"block text-xs leading-[18px] mt-1 text-theme-normal",href:"https://edgex-1.gitbook.io/edgeX-documentation/getting-started/deposits-and-withdrawals/withdrawals",rel:"noreferrer",target:"_blank",children:c("withdraw.commonWithdraw")})]}):C.jsx("p",{className:"text-text-tertiary text-xs leading-[18px]",children:c("withdraw.crossChainTips")})}),C.jsxs("div",{className:"py-4 border-t border-line-divider-secondary border-dashed",children:[C.jsxs("div",{className:"flex items-center justify-between",children:[C.jsx("span",{className:"text-text-tertiary text-xs",children:c("withdraw.speed")}),C.jsx("div",{className:"flex items-center",children:C.jsx(sn,{content:C.jsxs("div",{children:[C.jsx("div",{children:c("withdraw.speedNote")}),C.jsxs("div",{className:"flex gap-1 items-center mt-1",children:[C.jsx(Kn,{selectedLevel:mt.FAST,maxLevel:3}),C.jsx("span",{children:c("withdraw.speedNoteSpeed1")})]}),C.jsxs("div",{className:"flex gap-1 items-center mt-1",children:[C.jsx(Kn,{selectedLevel:mt.Medium,maxLevel:3}),C.jsx("span",{children:c("withdraw.speedNoteSpeed2")})]}),C.jsxs("div",{className:"flex gap-1 items-center mt-1",children:[C.jsx(Kn,{selectedLevel:mt.SLOW,maxLevel:3}),C.jsx("span",{children:c("withdraw.speedNoteSpeed3")})]})]}),children:C.jsx(Kn,{selectedLevel:pt(n==null?void 0:n.chainId)?mt.SLOW:mt.FAST,maxLevel:3})})})]}),!pt(n==null?void 0:n.chainId)&&C.jsxs("div",{className:"flex items-center justify-between mt-2 h-[18px]",children:[C.jsx("span",{className:"text-text-tertiary text-sm leading-4",children:c("withdraw.fee")}),C.jsxs("span",{className:"text-text-primary text-sm leading-4 font-medium",children:[o," ",t]})]}),C.jsxs("div",{className:"flex items-center justify-between mt-2 h-[18px]",children:[C.jsx("span",{className:"text-text-tertiary text-sm leading-4",children:c(pt(n==null?void 0:n.chainId)?"withdraw.withdrawlAmount":"withdraw.amountToReceive")}),C.jsxs("span",{className:"text-text-primary text-sm leading-4 font-medium",children:[Xe(d)," ",t]})]})]})]})},Hm=[],Gm={};let Le=null;const kl=m.forwardRef((e,t)=>{const[n,r]=m.useState(!1),[o,i]=m.useState(!1),[l,u]=m.useState({chains:[]}),s=m.useCallback(g=>{u(g||{chains:[]}),r(!0)},[]),a=m.useCallback(g=>{u(v=>({...v,...g}))},[]),c=m.useCallback(()=>{r(!1),i(!1),l.onClose&&l.onClose()},[l.onClose]),d=m.useCallback(g=>{i(g)},[]),p=m.useCallback(()=>n,[n]),f=m.useCallback(()=>o,[o]);return m.useImperativeHandle(t,()=>({openWithdraw:s,closeWithdraw:c,updateWithdrawOptions:a,setWithdrawLoading:d,isOpen:p,isLoading:f}),[s,c,a,d,p,f]),m.useEffect(()=>(Le={openWithdraw:s,closeWithdraw:c,updateWithdrawOptions:a,setWithdrawLoading:d,isOpen:p,isLoading:f},()=>{Le=null}),[s,c,a,d,p,f]),C.jsx(Vl,{isOpen:n,isLoading:o,onClose:c,config:l.config||{symbol:"USDT"},currentActiveAccount:l.currentActiveAccount,smartWallet:l.smartWallet,chains:l.chains||Hm,defaultChainId:l.defaultChainId,defaultTokenAddress:l.defaultTokenAddress,defaultAmount:l.defaultAmount,metadata:l.metadata||Gm,currentEquity:l.currentEquity??5e3,platformBalance:l.platformBalance||"0",fee:l.fee,wagmiHooks:l.wagmiHooks,onWithdraw:l.onWithdraw,onChainChange:l.onChainChange,onTokenChange:l.onTokenChange,onAmountChanged:l.onAmountChanged})});kl.displayName="WithdrawManager";const _l=e=>{if(!Le){console.error("WithdrawManager not initialized. Make sure to render <WithdrawManager /> in your app.");return}Le.openWithdraw(e||{chains:[]})},Wl=()=>{if(!Le){console.error("WithdrawManager not initialized. Make sure to render <WithdrawManager /> in your app.");return}Le.closeWithdraw()},Bl=e=>{if(!Le){console.error("WithdrawManager not initialized. Make sure to render <WithdrawManager /> in your app.");return}Le.updateWithdrawOptions(e)},qn=e=>{if(!Le){console.error("WithdrawManager not initialized. Make sure to render <WithdrawManager /> in your app.");return}Le.setWithdrawLoading(e)},Ym=()=>Le?Le.isOpen():!1,Ul=()=>Le?Le.isLoading():!1,Km=()=>({openWithdraw:_l,closeWithdraw:Wl,updateWithdrawOptions:Bl,setWithdrawLoading:qn,isOpen:Ym,isLoading:Ul}),qm=({chains:e,defaultChainId:t,defaultTokenAddress:n,defaultAmount:r="",walletAdapter:o,metadata:i,currentEquity:l,platformBalance:u="0",fee:s="0.00",isLoading:a=!1,wagmiHooks:c,onWithdraw:d,onClose:p,onChainChange:f,onTokenChange:g,onAmountChanged:v})=>{var G;const{t:E}=Ye(),[M,w]=m.useState(()=>{var q;return!e||e.length===0?1:t||((q=e[0])==null?void 0:q.chainId)||1}),[N,j]=m.useState(()=>{var H;if(!e||e.length===0)return"";const q=t||((H=e[0])==null?void 0:H.chainId),B=e.find(Z=>Z.chainId===q);if(!B||!B.tokenList||B.tokenList.length===0)return"";const K=B.tokenList.find(Z=>Z.tokenAddress===n)||B.tokenList[0];return(K==null?void 0:K.token)||""}),[F,k]=m.useState(r),[W,h]=m.useState(""),b=(o==null?void 0:o.getWalletType())||"evm",x=m.useCallback(q=>{w(q),f==null||f(q)},[f]),$=m.useCallback(q=>{j(q),g==null||g(q)},[g]),A=m.useRef(!0),P=m.useRef(N),S=m.useRef(M);m.useEffect(()=>{if(A.current){A.current=!1,P.current=N,S.current=M;return}(P.current!==N||S.current!==M)&&(k(""),P.current=N,S.current=M)},[N,M]);const O=e&&e.length>0?e.find(q=>q.chainId===M)||e[0]:null,T=(G=O==null?void 0:O.tokenList)==null?void 0:G.find(q=>q.token===N),L=o==null?void 0:o.getDisplayAddress(),{multicallResult:y,queryComponents:I}=$l({account:L,chainId:M,contractAddress:void 0,tokens:(O==null?void 0:O.tokenList)||[],wagmiHooks:c}),_=m.useMemo(()=>{var B;if(!T)return;if(!T.tokenAddress||T.tokenAddress.toLowerCase()==="0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee")return y.baseTokenBalance.formatted;const q=y.combinedData[T.tokenAddress];return((B=q==null?void 0:q.balance)==null?void 0:B.formatted)||"0"},[T,y]),V=m.useMemo(()=>{const q=new Oe(F||"0"),B=new Oe(s||"0"),K=pt(M);return!F||q.isZero()||!K&&q.isLessThan(B)?{text:E("withdraw.confirmWithdraw"),disabled:!0}:b==="mpc"&&!K&&!W.trim()?{text:E("withdraw.invalidReceiverAddress"),disabled:!0}:{text:E("withdraw.confirmWithdraw"),disabled:!1}},[E,M,F,b,W,s]),z=m.useCallback(async()=>{qn(!0);try{if(d){const q=new Oe(F||"0"),B=new Oe(s||"0"),H={amount:(pt(M)?q:q.minus(B)).toString(),chainId:M,tokenAddress:(T==null?void 0:T.tokenAddress)||"",tokenSymbol:N};b==="mpc"&&!pt(M)&&(H.receiverAddress=W),d(H)}}catch{qn(!1)}},[d,F,s,M,T==null?void 0:T.tokenAddress,N,b,W]);return!(c!=null&&c.useBalance)||!(c!=null&&c.useReadContract)||!(c!=null&&c.useAccount)?C.jsxs("div",{className:"p-6 text-center",children:[C.jsx("p",{className:"text-red-500",children:"缺少必要的 wagmi hooks"}),C.jsx("p",{className:"text-sm text-gray-500 mt-2",children:"请确保传入了 useBalance, useReadContract, useAccount"})]}):!e||e.length===0?C.jsx("div",{className:"text-center py-8",children:C.jsx("p",{className:"text-gray-400",children:"No chains available"})}):O?C.jsxs(C.Fragment,{children:[I,C.jsx(to,{currentActiveChain:O,chainList:e,onChainChange:x,curSelectToken:N,onTokenChange:$,walletType:"evm"}),C.jsx(zm,{withdrawAmount:F,curSelectToken:N,curSelectTokenData:{balance:T==null?void 0:T.balance,allowance:T==null?void 0:T.allowance},currentActiveChain:O,currentEquity:l||0,amount:F,decimals:(T==null?void 0:T.decimals)||6,tokenBalance:_,platformBalance:u,fee:s,walletType:b,receiverAddress:W,onWithdrawAmountChange:k,onReceiverAddressChange:h,onAmountChanged:v}),C.jsxs("button",{className:`w-full h-[38px] text-sm rounded-xl font-medium transition-colors flex items-center justify-center gap-2 ${V.disabled||a?"bg-text-disabled text-text-secondary cursor-not-allowed":"bg-fill-btn-primary text-text-on-sec-btn"}`,onClick:z,disabled:V.disabled||a,children:[a&&C.jsx(ln,{size:"xs"}),V.text]})]}):C.jsx("div",{className:"text-center py-8",children:C.jsx("p",{className:"text-gray-400",children:"Loading..."})})},Vl=({isOpen:e,isLoading:t=!1,onClose:n,config:r,currentActiveAccount:o=ro,smartWallet:i=oo,chains:l,defaultChainId:u,defaultTokenAddress:s,defaultAmount:a="",metadata:c=io,currentEquity:d=5e3,platformBalance:p="0",fee:f,wagmiHooks:g,onWithdraw:v,onChainChange:E,onTokenChange:M,onAmountChanged:w})=>{const{t:N}=Ye(),j=m.useMemo(()=>{var F;return o?Vo(o,i,!1,(F=l[0])==null?void 0:F.chainId,"0","0"):null},[o,i,l]);return e?we.createPortal(C.jsx("div",{className:"fixed top-0 left-0 right-0 bottom-0 w-screen h-screen",style:{zIndex:49},children:C.jsx("div",{className:"fixed top-0 left-0 right-0 bottom-0 z-49 flex items-center justify-center",style:{background:"rgba(0, 0, 0, 0.6)"},onClick:()=>{n()},"aria-hidden":"true",children:C.jsxs("div",{className:"relative w-[420px] max-h-[85vh] bg-fill-page-secondary overflow-auto rounded-lg p-6 shadow-xl",onClick:F=>{F.stopPropagation()},children:[C.jsxs("div",{className:"flex items-center justify-between mb-4",children:[C.jsx("h2",{className:"text-lg font-semibold text-white",children:N("withdraw.withdraw")}),C.jsx("button",{className:"text-gray-400 hover:text-gray-200 transition-colors",onClick:n,"aria-label":"Close",children:C.jsx(Bo,{className:"h-4 w-4"})})]}),C.jsx(qm,{chains:l,defaultChainId:u,defaultTokenAddress:s,defaultAmount:a,walletAdapter:j,metadata:c,currentEquity:d,platformBalance:p,fee:f,isLoading:t,wagmiHooks:g,onWithdraw:v,onClose:n,onChainChange:E,onTokenChange:M,onAmountChanged:w})]})})}),document.body):null};J.ChromeLoader=ln,J.ComponentProvider=ga,J.DEFAULT_LOCALE=un,J.Deposit=Rl,J.DepositManager=Dl,J.LOCALE_NAMES=pa,J.LoadingSpinner=ln,J.SUPPORTED_LOCALES=Jn,J.Tooltip=sn,J.Withdraw=Vl,J.WithdrawManager=kl,J.closeDeposit=Il,J.closeWithdraw=Wl,J.formatThousands=ba,J.isDepositLoading=Fl,J.isWithdrawLoading=Ul,J.openDeposit=Ml,J.openWithdraw=_l,J.setDepositLoading=Yn,J.setWithdrawLoading=qn,J.updateDepositOptions=jl,J.updateWithdrawOptions=Bl,J.useComponentConfig=Fo,J.useDeposit=xa,J.useDepositManager=Wm,J.useTranslation=Ye,J.useWithdraw=ya,J.useWithdrawManager=Km,Object.defineProperty(J,Symbol.toStringTag,{value:"Module"})});
|
|
119
|
+
`,children:[t,o&&S.jsx($l,{ref:d,placement:g.placement||n})]})})]})},Yn="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAIcSURBVHgBxZc/T8JAGMafA4mDEXFw0DiQmDi4CP5JHGFx0qizg8QvIHwCZHYAvwEm7mji5CJuJv7DxcWYYMLmIEYXY/R8j6tQaBvuaCm/pOlbSu99+rZ97zlgwDBowvNLCdrF6NJ50891OvNC+wrL3JShgZIAnl+JAj97FKXoMNLl7ySGnQDBHMtcVeFGAM8nKNlnlsI0eoIVuwlhzsmXqcwoURSFK1iVRCSdRDDn5PwC3cutingsJOK60nkiYE0unrdi8uFRIDwFBSJiTKOqzgKMl00teXgS2D0Fto+BiVkoIMYs8Xws4iiAkmeVn/n0oqyA2NQEQI4dytoKMEqfQt/haZmrQ4C8e7/4TtsI4JvwDbYDswCjvXr1yakQMXI2KxCD/8RMAtx2ux5gcjIzBAT8LH8bAQwYbwR8fUAb/vtuEsAr0OX5Eng8o30ZqN1BHzFLAkPGkb4AcdfnObigkbM5HdN3+Qb/ekGdrNu4CMyd8Ag6iElo/QBYzcpYByYsm8QkIFSADmI2nEkAc2sUL0ALHsxZBEjLxA+hSu22tb0+KV9Gd18027M2SybNQui+f53R6g/b+gDLVMi7YQsND+c5dTtzamlE0jiyJLwVYZhSqzO27YRSxFD8v1m4Q4xh74gdBUgRQm2QKsH0Ps82xEs9EndK3sgDlWGkW96naANqSzMSHSy4XprZi2kuTqN09VjrBH9AD4vTgfMHJt+rxIFF7EgAAAAASUVORK5CYII=",Mm=({walletAdapter:e,curSelectToken:t,currentActiveChain:n,metadata:r,onCopy:o})=>{var u;const{t:i}=Ye(),l=m.useMemo(()=>vp(n||{}),[n]);return S.jsxs(S.Fragment,{children:[S.jsx("div",{className:"flex justify-center mt-4 mb-3",children:(e==null?void 0:e.getDisplayAddress())&&S.jsx("div",{className:"bg-white rounded-lg",children:S.jsx(dl,{value:(e==null?void 0:e.getDisplayAddress())||"",size:120,level:"L",bgColor:"#ffffff",fgColor:"#000000",marginSize:0})})}),(e==null?void 0:e.getDisplayAddress())&&S.jsxs("div",{className:"flex items-center justify-between bg-fill-input-primary rounded-lg py-2 px-3 mb-3",children:[S.jsx("span",{className:"flex-1 text-text-primary text-sm font-medium break-all mr-3",children:e==null?void 0:e.getDisplayAddress()}),S.jsx(kp,{onCopy:()=>{const s=(e==null?void 0:e.getDisplayAddress())||"";o&&o(s)},text:e==null?void 0:e.getDisplayAddress(),children:S.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:[S.jsx("rect",{x:"2.08496",y:"4.02295",width:"9.89893",height:"9.89893",rx:"2",stroke:"#F9F9F9"}),S.jsx("path",{d:"M5.85547 2.07861H11.415C12.7957 2.07861 13.915 3.1979 13.915 4.57861V10.0786",stroke:"#F9F9F9",strokeLinecap:"round"})]})},"copy")]}),S.jsxs("div",{className:"border-b border-dashed border-line-divider-secondary pb-4",children:[S.jsxs("div",{className:"flex items-start",children:[S.jsx("div",{className:"w-5",children:S.jsx("img",{src:Yn,className:"w-4 h-4",alt:"Warning"})}),S.jsx("div",{className:"flex-1",children:S.jsx("p",{className:"text-xs text-functional-orange-1",children:i("deposit.depositAllTip",{coin:t,v:n==null?void 0:n.chain})})})]}),l&&S.jsxs(S.Fragment,{children:[S.jsx("div",{className:"my-2 ml-5 h-[1px] border-b border-dashed border-line-divider-secondary"}),S.jsx("div",{className:"flex items-start pl-5 text-functional-orange-1 text-xs",children:i("deposit.depositTipFor25w")})]})]}),S.jsxs("div",{className:"text-sm",children:[S.jsxs("div",{className:"flex justify-between items-center h-[18px] mt-4",children:[S.jsx("span",{className:"text-text-tertiary",children:i("deposit.arrivalTime")}),S.jsx(sn,{content:S.jsxs("div",{className:"grid flex-grow max-w-[300px] min-w-[80px] rounded-2xl flex-col gap-[10px]",children:[S.jsx("p",{children:i("deposit.arrivaltimeTooltip1",{v:(n==null?void 0:n.blockTime)*n.txConfirm/60,v1:n==null?void 0:n.txConfirm})}),S.jsx("p",{children:i("deposit.arrivaltimeTooltip2")})]}),placement:"top",children:S.jsx("span",{className:"text-text-primary font-medium text-right border-b-[2px] border-dashed border-line-divider-primary decoration-dashed",children:i("deposit.arrivalEstimated",{v:(n==null?void 0:n.blockTime)*n.txConfirm/60})})})]}),S.jsxs("div",{className:"flex justify-between items-center h-[18px] mt-2",children:[S.jsx("span",{className:"text-text-tertiary",children:i("deposit.minDeposit")}),S.jsxs("span",{className:"text-text-primary font-medium text-right",children:[((u=r==null?void 0:r.multiChain)==null?void 0:u.minDeposit)||10," ",t]})]}),S.jsxs("div",{className:"flex justify-between items-center h-[18px] mt-2",children:[S.jsx("span",{className:"text-text-tertiary",children:i("deposit.maxDeposit")}),S.jsxs("span",{className:"text-text-primary font-medium text-right",children:["200,000 ",t]})]})]})]})},Im=({chains:e,defaultChainId:t,defaultTokenAddress:n,walletAdapter:r,metadata:o,onDeposit:i,onCopy:l,onClose:u})=>{var v;const{t:s}=Ye(),[a,c]=m.useState(()=>{var E;return!e||e.length===0?1:t||((E=e[0])==null?void 0:E.chainId)||1}),[d,p]=m.useState(()=>{var N;if(!e||e.length===0)return"";const E=t||((N=e[0])==null?void 0:N.chainId),M=e.find(F=>F.chainId===E);if(!M||!M.tokenList||M.tokenList.length===0)return"";const w=M.tokenList.find(F=>F.tokenAddress===n)||M.tokenList[0];return(w==null?void 0:w.token)||""}),f=e&&e.length>0?e.find(E=>E.chainId===a)||e[0]:null,g=(v=f==null?void 0:f.tokenList)==null?void 0:v.find(E=>E.token===d);return!e||e.length===0?S.jsx("div",{className:"text-center py-8",children:S.jsx("p",{className:"text-gray-400",children:"No chains available"})}):f?S.jsxs(S.Fragment,{children:[S.jsx(no,{currentActiveChain:f,chainList:e,onChainChange:c,curSelectToken:d,onTokenChange:p,walletType:"mpc"}),S.jsx(Mm,{walletAdapter:r,curSelectToken:d,currentActiveChain:f,metadata:o,onCopy:l}),S.jsx("button",{className:"w-full h-[38px] bg-fill-btn-primary rounded-xl text-sm font-medium text-text-on-sec-btn mt-4",onClick:()=>{i&&i({amount:"",chainId:a,tokenAddress:(g==null?void 0:g.tokenAddress)||"",tokenSymbol:d}),u()},children:s("deposit.title")})]}):S.jsx("div",{className:"text-center py-8",children:S.jsx("p",{className:"text-gray-400",children:"Loading..."})})},jm=Object.values({MAINNET:1,SEPOLIA:11155111}),pt=e=>{const t=typeof e=="string"?parseInt(e,10):e;return jm.includes(t)},Fm={USDT:!0},Oo=(e,t)=>{const n=typeof e=="string"?parseInt(e,10):e;return n===1||n===11155111?!1:(n===42161||n===421614)&&t?t.toUpperCase()==="ETH"?!1:!Fm[t.toUpperCase()]:!0},ln=({size:e="xs",color:t,className:n="",label:r="Loading...",inline:o=!1})=>{const i=t?`loading-${t}`:"",l=o?"loading-inline":"";return S.jsx("span",{className:`loading loading-${e} loading-spinner ${i} ${l} ${n}`.trim(),"aria-label":r,role:"status","aria-live":"polite"})},Rm=({depositAmount:e,curSelectToken:t,curSelectTokenData:n,approved:r,currentActiveChain:o,currentEquity:i,amount:l,decimals:u,tokenBalance:s,platformBalance:a="0",onDepositAmountChange:c,onApproved:d})=>{const{t:p}=Ye(),[f,g]=m.useState(!1);m.useEffect(()=>{r&&f&&g(!1)},[r,f]);const v=m.useCallback(async()=>{if(!f)try{g(!0),await d()}catch(j){g(!1),console.error("Approve failed:",j)}},[d,f]),E=m.useCallback(()=>{let j=s||"0";if(Oo(o==null?void 0:o.chainId,t))try{const k=new xe(j),B=new xe("200000");k.gt(B)&&(j="200000")}catch(k){console.warn("Error calculating max amount limit:",k)}return j},[s,o==null?void 0:o.chainId,t]),M=m.useMemo(()=>{if(!Oo(o==null?void 0:o.chainId,t))return!1;try{const j=new xe(e||"0"),k=new xe("200000");return j.isNaN()||k.isNaN()?!1:j.gte(k)}catch{return!1}},[o,e,t]);m.useMemo(()=>{if(!Oo(o==null?void 0:o.chainId,t))return!1;try{const j=new xe(s||"0"),k=new xe("200000");return j.gt(k)}catch{return!1}},[o==null?void 0:o.chainId,s,t]);const w=m.useMemo(()=>Ys(o==null?void 0:o.chainId,t,e),[o==null?void 0:o.chainId,t,e]),N=j=>{const k=j.target.value,B=E(),h=ro(k,B);if(h.isValid)c(h.formattedValue),h.errorType;else return h.errorType==="exceed_balance",void 0},F=()=>{const j=parseFloat(s||"0"),k=parseFloat(e||"0");if(k>0){const B=j-k,h=Xe(Math.max(0,B).toString());return S.jsxs("span",{className:"flex items-center gap-1",children:[Xe(s||"0"),S.jsx("span",{className:"text-sm font-edgex-harmony text-functional-green-1 leading-[18px] font-medium",children:"→"}),h," ",t]})}return`${Xe(s||"0")} ${t}`};return S.jsxs(S.Fragment,{children:[S.jsxs("div",{className:"bg-fill-input-primary rounded-lg px-3 py-3 my-4",children:[S.jsxs("div",{className:"flex justify-between items-center h-[18px] mb-3",children:[S.jsx("input",{type:"text",placeholder:p("deposit.amount"),value:e,onChange:N,className:"flex-1 bg-transparent text-text-primary text-sm font-medium placeholder-text-tertiary placeholder:font-normal focus:outline-none border-none p-0 h-full"}),S.jsx("button",{onClick:()=>{const j=E();c(j)},className:"text-theme-normal text-xs font-medium cursor-pointer hover:opacity-80 transition-opacity h-full flex items-center",children:p("deposit.max")})]}),S.jsx("div",{className:"h-[1px] bg-line-divider-secondary mb-2"}),S.jsxs("div",{className:"flex justify-between items-center",children:[S.jsx(sn,{content:p("deposit.availableDesc"),children:S.jsx("span",{className:"text-text-tertiary text-xs leading-[14px] border-b border-dashed border-line-divider-primary",children:p("deposit.available")})}),S.jsx("span",{className:"text-text-primary text-xs leading-[14px]",children:F()})]})]}),!r&&mp(e||"0",0)&&S.jsxs("div",{className:"flex justify-center flex-col items-center",children:[S.jsx("h3",{className:"text-text-primary text-sm leading-4 font-medium",children:p("deposit.enableSystemProWithToken",{token:t,network:o==null?void 0:o.chain})}),S.jsx("p",{className:"text-text-secondary text-xs leading-3 mt-4",children:p("deposit.enableTokenDesc",{token:t,network:o==null?void 0:o.chain})}),S.jsx("button",{className:"w-[180px] h-8 bg-fill-btn-primary hover:bg-fill-btn-primary-hover text-text-on-sec-btn rounded-xl text-sm font-medium transition-colors my-4 disabled:opacity-50 disabled:cursor-not-allowed flex items-center justify-center",onClick:v,disabled:f,children:f?S.jsx(ln,{size:"xs",inline:!0}):p("deposit.enableWithToken",{token:t})})]}),w&&S.jsxs(S.Fragment,{children:[S.jsxs("div",{className:"flex mb-4",children:[S.jsx("div",{className:"w-5",children:S.jsx("img",{src:Yn,className:"w-4 h-4",alt:"Warning"})}),S.jsx("div",{className:"flex-1 text-xs text-functional-orange-1",children:p("deposit.layerZeroDepositTip")})]}),S.jsx("div",{className:"my-2 ml-5 h-[1px] border-b border-dashed border-line-divider-secondary"})]}),M&&S.jsxs("div",{className:"flex mb-4",children:[S.jsx("div",{className:"w-5",children:S.jsx("img",{src:Yn,className:"w-4 h-4",alt:"Warning"})}),S.jsx("div",{className:"flex-1 text-xs text-functional-orange-1",children:p("deposit.depositTipFor25w")})]}),M&&S.jsx("div",{className:"my-2 ml-5 h-[1px] border-b border-dashed border-line-divider-secondary"}),S.jsxs("div",{className:"flex mb-4",children:[S.jsx("div",{className:"w-5",children:!(M||w)&&S.jsx("img",{src:Yn,className:"w-4 h-4",alt:"Warning"})}),S.jsx("div",{className:"flex-1 text-xs text-functional-orange-1",children:p("deposit.noPrivateKeyWalletWarning")})]}),S.jsx("div",{className:"border-t border-line-divider-secondary border-dashed py-4",children:S.jsxs("div",{className:"flex justify-between items-center",children:[S.jsx("span",{className:"text-sm leading-[18px] text-text-tertiary",children:p("deposit.equity")}),S.jsx("span",{className:"text-sm leading-[18px] text-text-primary font-medium",children:e?S.jsxs("span",{className:"flex items-center gap-1",children:[Xe(a),S.jsx("span",{className:"text-sm font-edgex-harmony text-functional-green-1 leading-[18px] font-medium",children:"→"}),Xe((parseFloat(a)+parseFloat(e)).toString())," ",t]}):`${Xe(a)} ${t}`})]})})]})},km=({token:e,account:t,chainId:n,contractAddress:r,wagmiHooks:o,onResult:i})=>{var s,a;const l=(s=o==null?void 0:o.useBalance)==null?void 0:s.call(o,{address:t,token:e.tokenAddress,chainId:n,query:{enabled:!!t&&!!n&&!!e.tokenAddress&&!!(o!=null&&o.useBalance)}}),u=(a=o==null?void 0:o.useReadContract)==null?void 0:a.call(o,{address:e.tokenAddress,abi:[{name:"allowance",type:"function",stateMutability:"view",inputs:[{name:"owner",type:"address"},{name:"spender",type:"address"}],outputs:[{name:"",type:"uint256"}]}],functionName:"allowance",args:[t,r],chainId:n,query:{enabled:!!t&&!!n&&!!e.tokenAddress&&!!r&&!!(o!=null&&o.useReadContract)}});return m.useEffect(()=>{i(e.tokenAddress,{balance:l,allowance:u})},[l,u,e.tokenAddress,i]),null},Al=({account:e,chainId:t,contractAddress:n,tokens:r=[],wagmiHooks:o})=>{var g;const i=m.useMemo(()=>r.filter(v=>v.tokenAddress&&v.tokenAddress!=="0x0000000000000000000000000000000000000000"),[r]),[l,u]=m.useState({}),s=m.useCallback((v,E)=>{u(M=>({...M,[v]:E}))},[]),a=(g=o==null?void 0:o.useBalance)==null?void 0:g.call(o,{address:e,chainId:t,query:{enabled:!!e&&!!t&&!!(o!=null&&o.useBalance)}}),c=m.useMemo(()=>i.map(v=>m.createElement(km,{key:v.tokenAddress,token:v,account:e,chainId:t,contractAddress:n,wagmiHooks:o,onResult:s})),[i,e,t,n,o,s]),d=m.useMemo(()=>{if(!(o!=null&&o.useBalance))return{balanceList:[],allowanceList:[],baseTokenBalance:{value:BigInt(0),formatted:"0",decimals:18,symbol:"ETH"},combinedData:{}};const v=a!=null&&a.data?{value:a.data.value,formatted:a.data.formatted,decimals:a.data.decimals,symbol:a.data.symbol}:{value:BigInt(0),formatted:"0",decimals:18,symbol:"ETH"},E=i.map(N=>{const F=l[N.tokenAddress],j=F==null?void 0:F.balance,k=j==null?void 0:j.data;return{address:N.tokenAddress,value:(k==null?void 0:k.value)||BigInt(0),formatted:(k==null?void 0:k.formatted)||"0",decimals:(k==null?void 0:k.decimals)||N.decimals}}).filter(N=>N.address),M=i.map(N=>{const F=l[N.tokenAddress],j=F==null?void 0:F.allowance,k=j==null?void 0:j.data,B=BigInt(k?k.toString():0);return{address:N.tokenAddress,value:B,formatted:(B/BigInt(10)**BigInt(N.decimals)).toString(),decimals:N.decimals}}).filter(N=>N.address),w=E.reduce((N,F)=>{const j=M.find(k=>k.address===F.address);return{...N,[F.address]:{balance:F,allowance:j||{address:F.address,value:BigInt(0),formatted:"0",decimals:F.decimals}}}},{});return{balanceList:E,allowanceList:M,baseTokenBalance:v,combinedData:w}},[a,l,i,o==null?void 0:o.useBalance]),p=m.useCallback(async()=>d,[d]),f=m.useMemo(()=>{const v=(a==null?void 0:a.isLoading)||!1,E=Object.values(l).some(M=>{var w,N;return((w=M.balance)==null?void 0:w.isLoading)||((N=M.allowance)==null?void 0:N.isLoading)});return v||E},[a==null?void 0:a.isLoading,l]);return{multicallRun:p,multicallResult:d,validErcTokens:i,isLoading:f,queryComponents:c}};let Pe=null;const _m={symbol:"USDT"},Ml=m.forwardRef((e,t)=>{const[n,r]=m.useState(!1),[o,i]=m.useState(!1),[l,u]=m.useState({chains:[]}),s=m.useCallback(g=>{u(g),r(!0)},[]),a=m.useCallback(g=>{u(v=>({...v,...g}))},[]),c=m.useCallback(()=>{r(!1),i(!1),l.onClose&&l.onClose()},[l.onClose]),d=m.useCallback(g=>{i(g)},[]),p=m.useCallback(()=>n,[n]),f=m.useCallback(()=>o,[o]);return m.useImperativeHandle(t,()=>({openDeposit:s,closeDeposit:c,updateDepositOptions:a,setDepositLoading:d,isOpen:p,isLoading:f}),[s,c,a,d,p,f]),m.useEffect(()=>(Pe={openDeposit:s,closeDeposit:c,updateDepositOptions:a,setDepositLoading:d,isOpen:p,isLoading:f},()=>{Pe=null}),[s,c,a,d,p,f]),S.jsx(kl,{isOpen:n,isLoading:o,onClose:c,config:l.config||_m,currentActiveAccount:l.currentActiveAccount||oo,smartWallet:l.smartWallet||io,chains:l.chains||bp,defaultChainId:l.defaultChainId,defaultTokenAddress:l.defaultTokenAddress,defaultAmount:l.defaultAmount,metadata:l.metadata||so,currentEquity:l.currentEquity??5e3,platformBalance:l.platformBalance||"0",wagmiHooks:l.wagmiHooks,approved:l.approved,onApproved:l.onApproved,onDeposit:l.onDeposit,onCopy:l.onCopy,onChainChange:l.onChainChange,onTokenChange:l.onTokenChange})});Ml.displayName="DepositManager";const Il=e=>{if(!Pe){console.error("DepositManager not initialized. Make sure to render <DepositManager /> in your app.");return}Pe.openDeposit(e||{chains:[]})},jl=()=>{if(!Pe){console.error("DepositManager not initialized. Make sure to render <DepositManager /> in your app.");return}Pe.closeDeposit()},Fl=e=>{Pe&&Pe.updateDepositOptions(e)},Kn=e=>{if(!Pe){console.error("DepositManager not initialized. Make sure to render <DepositManager /> in your app.");return}Pe.setDepositLoading(e)},Bm=()=>Pe?Pe.isOpen():!1,Rl=()=>Pe?Pe.isLoading():!1,Wm=()=>({openDeposit:Il,closeDeposit:jl,updateDepositOptions:Fl,setDepositLoading:Kn,isOpen:Bm,isLoading:Rl}),Um=({chains:e,defaultChainId:t,defaultTokenAddress:n,defaultAmount:r="",walletAdapter:o,metadata:i,currentEquity:l,platformBalance:u="0",isLoading:s=!1,wagmiHooks:a,approved:c,onApproved:d,onDeposit:p,onClose:f,onChainChange:g,onTokenChange:v})=>{var G;const{t:E}=Ye(),M=a==null?void 0:a.useAccount(),[w,N]=m.useState(()=>{var H;return!e||e.length===0?1:t||((H=e[0])==null?void 0:H.chainId)||1}),[F,j]=m.useState(()=>{var se;if(!e||e.length===0)return"";const H=t||((se=e[0])==null?void 0:se.chainId),z=e.find(he=>he.chainId===H);if(!z||!z.tokenList||z.tokenList.length===0)return"";const J=z.tokenList.find(he=>he.tokenAddress===n)||z.tokenList[0];return(J==null?void 0:J.token)||""}),[k,B]=m.useState(r),h=m.useCallback(H=>{N(H),g==null||g(H)},[g]),b=m.useCallback(H=>{j(H),v==null||v(H)},[v]),y=m.useRef(!0),$=m.useRef(F),D=m.useRef(w);m.useEffect(()=>{if(y.current){y.current=!1,$.current=F,D.current=w;return}($.current!==F||D.current!==w)&&(B(""),$.current=F,D.current=w)},[F,w]);const L=e&&e.length>0?e.find(H=>H.chainId===w)||e[0]:null,C=(G=L==null?void 0:L.tokenList)==null?void 0:G.find(H=>H.token===F),O=o==null?void 0:o.getDisplayAddress(),{multicallResult:T,queryComponents:P}=Al({account:O,chainId:w,contractAddress:void 0,tokens:(L==null?void 0:L.tokenList)||[],wagmiHooks:a}),x=m.useMemo(()=>{var z;if(!C)return;if(!C.tokenAddress||C.tokenAddress.toLowerCase()==="0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee")return T.baseTokenBalance.formatted;const H=T.combinedData[C.tokenAddress];return((z=H==null?void 0:H.balance)==null?void 0:z.formatted)||"0"},[C,T]),I=c??!1,_=m.useMemo(()=>+M.chainId!=+w,[M.chainId,w]),V=m.useMemo(()=>Ys(w,F,k),[w,F,k]),W=m.useMemo(()=>{if(_)return{text:E("deposit.switchNetwork"),disabled:!1,isNetworkSwitch:!0};const H=parseFloat(k||"0"),z=10,se=hp(k,x||"0",I);return!k||H===0||!I?{text:E(V?"deposit.layerZeroDepositButton":"deposit.confirmDeposit"),disabled:!0,isNetworkSwitch:!1}:H<z?{text:E("deposit.minDepositParsed",{amount:z,token:F}),disabled:!0,isNetworkSwitch:!1}:{text:E(V?"deposit.layerZeroDepositButton":"deposit.confirmDeposit"),disabled:!se,isNetworkSwitch:!1}},[k,F,x,I,_,V,E]),Y=m.useCallback(async()=>{h&&h(w)},[h,w]),q=m.useCallback(async()=>{Kn(!0);try{p&&p({amount:k,chainId:w,tokenAddress:(C==null?void 0:C.tokenAddress)||"",tokenSymbol:F})}catch(H){console.error("Deposit error:",H),Kn(!1)}},[p,k,w,C==null?void 0:C.tokenAddress,F]);return!(a!=null&&a.useBalance)||!(a!=null&&a.useReadContract)||!(a!=null&&a.useAccount)?S.jsxs("div",{className:"p-6 text-center",children:[S.jsx("p",{className:"text-red-500",children:"缺少必要的 wagmi hooks"}),S.jsx("p",{className:"text-sm text-gray-500 mt-2",children:"请确保传入了 useBalance, useReadContract, useAccount"})]}):!e||e.length===0?S.jsx("div",{className:"text-center py-8",children:S.jsx("p",{className:"text-gray-400",children:"No chains available"})}):L?S.jsxs(S.Fragment,{children:[P,S.jsx(no,{currentActiveChain:L,chainList:e,onChainChange:h,curSelectToken:F,onTokenChange:b,walletType:"evm"}),S.jsx(Rm,{depositAmount:k,curSelectToken:F,curSelectTokenData:{balance:C==null?void 0:C.balance,allowance:C==null?void 0:C.allowance},approved:I,currentActiveChain:L,currentEquity:l||0,amount:k,decimals:(C==null?void 0:C.decimals)||6,tokenBalance:x,platformBalance:u,onDepositAmountChange:B,onApproved:async()=>{d&&await d()}}),S.jsxs("button",{className:`w-full h-[38px] text-sm rounded-xl font-medium transition-colors flex items-center justify-center gap-2 ${W.disabled||s?"bg-text-disabled text-text-secondary cursor-not-allowed":"bg-fill-btn-primary text-text-on-sec-btn"}`,onClick:W.isNetworkSwitch?Y:q,disabled:W.disabled||s,children:[s&&S.jsx(ln,{size:"xs"}),W.text]})]}):S.jsx("div",{className:"text-center py-8",children:S.jsx("p",{className:"text-gray-400",children:"Loading..."})})},kl=({isOpen:e,isLoading:t=!1,onClose:n,config:r,currentActiveAccount:o=oo,smartWallet:i=io,chains:l,defaultChainId:u,defaultTokenAddress:s,defaultAmount:a="",metadata:c=so,currentEquity:d=5e3,platformBalance:p="0",wagmiHooks:f,approved:g,onApproved:v,onDeposit:E,onCopy:M,onChainChange:w,onTokenChange:N})=>{const{t:F}=Ye(),j=m.useMemo(()=>{var B;return o?Vo(o,i,!1,(B=l[0])==null?void 0:B.chainId,"0","0"):null},[o,i,l]),k=(j==null?void 0:j.getWalletType())==="mpc";return e?Se.createPortal(S.jsx("div",{className:"fixed top-0 left-0 right-0 bottom-0 w-screen h-screen",style:{zIndex:49},children:S.jsx("div",{className:"fixed top-0 left-0 right-0 bottom-0 z-49 flex items-center justify-center",style:{background:"rgba(0, 0, 0, 0.6)"},onClick:()=>{n()},"aria-hidden":"true",children:S.jsxs("div",{className:"relative w-[420px] max-h-[85vh] bg-fill-page-secondary overflow-auto rounded-lg p-6 shadow-xl",onClick:B=>{B.stopPropagation()},children:[S.jsxs("div",{className:"flex items-center justify-between mb-4",children:[S.jsx("h2",{className:"text-lg font-semibold text-white",children:F("deposit.title")}),S.jsx("button",{className:"text-gray-400 hover:text-gray-200 transition-colors",onClick:n,"aria-label":"Close",children:S.jsx(Wo,{className:"h-4 w-4"})})]}),k?S.jsx(Im,{chains:l,defaultChainId:u,defaultTokenAddress:s,defaultAmount:a,walletAdapter:j,metadata:c,currentEquity:d,onDeposit:E,onCopy:M,onClose:n}):S.jsx(Um,{chains:l,defaultChainId:u,defaultTokenAddress:s,defaultAmount:a,walletAdapter:j,metadata:c,currentEquity:d,platformBalance:p,isLoading:t,wagmiHooks:f,approved:g,onApproved:v,onDeposit:E,onClose:n,onChainChange:w,onTokenChange:N})]})})}),document.body):null};m.createContext(null);const Vm=()=>S.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"13",viewBox:"0 0 12 13",fill:"none",children:[S.jsx("g",{clipPath:"url(#clip0_active)",children:S.jsx("path",{d:"M4.63791 6.91929H2.62541C2.36266 6.91929 2.18141 6.65629 2.27491 6.41091L4.27466 1.16191C4.30172 1.0909 4.34971 1.02978 4.41228 0.986649C4.47485 0.943521 4.54905 0.920422 4.62504 0.92041H7.99954C8.26579 0.92041 8.44729 1.19016 8.34679 1.43679L7.18241 4.29479H9.37441C9.69679 4.29479 9.86879 4.67479 9.65616 4.91704L4.28191 11.0408C4.02066 11.3385 3.53629 11.0805 3.63766 10.6977L4.63791 6.91929Z",fill:"#22FD73"})}),S.jsx("defs",{children:S.jsx("clipPath",{id:"clip0_active",children:S.jsx("rect",{width:"12",height:"12",fill:"white",transform:"translate(0 0.0454102)"})})})]}),zm=()=>S.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"13",viewBox:"0 0 12 13",fill:"none",children:[S.jsx("g",{clipPath:"url(#clip0_inactive)",children:S.jsx("path",{d:"M4.63791 6.91929H2.62541C2.36266 6.91929 2.18141 6.65629 2.27491 6.41091L4.27466 1.16191C4.30172 1.0909 4.34971 1.02978 4.41228 0.986649C4.47485 0.943521 4.54905 0.920422 4.62504 0.92041H7.99954C8.26579 0.92041 8.44729 1.19016 8.34679 1.43679L7.18241 4.29479H9.37441C9.69679 4.29479 9.86879 4.67479 9.65616 4.91704L4.28191 11.0408C4.02066 11.3385 3.53629 11.0805 3.63766 10.6977L4.63791 6.91929Z",fill:"#F9F9F9"})}),S.jsx("defs",{children:S.jsx("clipPath",{id:"clip0_inactive",children:S.jsx("rect",{width:"12",height:"12",fill:"white",transform:"translate(0 0.0454102)"})})})]}),qn=({selectedLevel:e,maxLevel:t,className:n=""})=>{const r=Array.from({length:t},(o,i)=>i+1);return S.jsx("div",{className:`flex items-center ${n}`,children:r.map(o=>S.jsx("div",{className:"flex items-center justify-center",children:o<=e?S.jsx(Vm,{}):S.jsx(zm,{})},o))})};class mt{}Ie(mt,"FAST",3),Ie(mt,"Medium",2),Ie(mt,"SLOW",1),Ie(mt,"NONE",0);const Hm=({withdrawAmount:e,curSelectToken:t,currentActiveChain:n,platformBalance:r="0",fee:o="0.00",walletType:i="evm",receiverAddress:l="",onWithdrawAmountChange:u,onReceiverAddressChange:s,onAmountChanged:a})=>{const{t:c}=Ye(),d=m.useMemo(()=>{if(!pt(n==null?void 0:n.chainId)){const E=new xe(e||"0").minus(o||"0").decimalPlaces(2,xe.ROUND_DOWN);return E.isNegative()?"0.00":E.toString()}return e||"0"},[e,o,n==null?void 0:n.chainId]),p=m.useMemo(()=>r||"0",[r]),f=E=>{const M=E.target.value,N=ro(M,p||"0");if(N.isValid)u(N.formattedValue),N.errorType;else return N.errorType==="exceed_balance",void 0;a==null||a(N.formattedValue)},g=()=>{u(p),a==null||a(p)},v=()=>{const E=parseFloat(r||"0"),M=parseFloat(e||"0");if(M>0){const w=E-M,N=Xe(Math.max(0,w).toString());return S.jsxs("span",{className:"flex items-center gap-1",children:[Xe(r||"0"),S.jsx("span",{className:"text-sm font-edgex-harmony text-functional-green-1 leading-[18px] font-medium",children:"→"}),N," ",t]})}return`${Xe(r||"0")} ${t}`};return S.jsxs(S.Fragment,{children:[S.jsxs("div",{className:"bg-fill-input-primary rounded-lg px-3 py-3 my-4",children:[S.jsxs("div",{className:"flex justify-between items-center h-[18px] mb-3",children:[S.jsx("input",{type:"text",placeholder:c("deposit.amount"),value:e,onChange:f,className:"flex-1 bg-transparent text-text-primary text-sm font-medium placeholder-text-tertiary placeholder:font-normal focus:outline-none border-none p-0 h-full"}),S.jsx("button",{onClick:g,className:"text-theme-normal text-xs font-medium cursor-pointer hover:opacity-80 transition-opacity h-full flex items-center",children:c("deposit.max")})]}),S.jsx("div",{className:"h-[1px] bg-line-divider-secondary mb-2"}),S.jsxs("div",{className:"flex justify-between items-center",children:[S.jsx(sn,{content:c("deposit.availableDesc"),children:S.jsx("span",{className:"text-text-tertiary text-xs leading-[14px] border-b border-dashed border-line-divider-primary",children:c("deposit.available")})}),S.jsx("span",{className:"text-text-primary text-xs leading-[14px]",children:v()})]})]}),i==="mpc"&&!pt(n==null?void 0:n.chainId)&&S.jsx("div",{className:"bg-fill-input-primary rounded-lg my-4 h-9 flex items-center px-3",children:S.jsx("input",{type:"text",placeholder:c("withdraw.receiverAddress"),value:l,onChange:E=>s==null?void 0:s(E.target.value),className:"flex-1 bg-transparent text-text-primary text-sm font-medium placeholder-text-tertiary placeholder:font-normal focus:outline-none border-none p-0 h-full"})}),S.jsx("div",{className:"bg-fill-page-secondary rounded-lg mb-4",children:pt(n==null?void 0:n.chainId)?S.jsxs(S.Fragment,{children:[S.jsx("p",{className:"text-text-tertiary text-xs leading-[18px]",children:c("withdraw.noticeDesc")}),S.jsx("a",{className:"block text-xs leading-[18px] mt-1 text-theme-normal",href:"https://edgex-1.gitbook.io/edgeX-documentation/getting-started/deposits-and-withdrawals/withdrawals",rel:"noreferrer",target:"_blank",children:c("withdraw.commonWithdraw")})]}):S.jsx("p",{className:"text-text-tertiary text-xs leading-[18px]",children:c("withdraw.crossChainTips")})}),S.jsxs("div",{className:"py-4 border-t border-line-divider-secondary border-dashed",children:[S.jsxs("div",{className:"flex items-center justify-between",children:[S.jsx("span",{className:"text-text-tertiary text-xs",children:c("withdraw.speed")}),S.jsx("div",{className:"flex items-center",children:S.jsx(sn,{content:S.jsxs("div",{children:[S.jsx("div",{children:c("withdraw.speedNote")}),S.jsxs("div",{className:"flex gap-1 items-center mt-1",children:[S.jsx(qn,{selectedLevel:mt.FAST,maxLevel:3}),S.jsx("span",{children:c("withdraw.speedNoteSpeed1")})]}),S.jsxs("div",{className:"flex gap-1 items-center mt-1",children:[S.jsx(qn,{selectedLevel:mt.Medium,maxLevel:3}),S.jsx("span",{children:c("withdraw.speedNoteSpeed2")})]}),S.jsxs("div",{className:"flex gap-1 items-center mt-1",children:[S.jsx(qn,{selectedLevel:mt.SLOW,maxLevel:3}),S.jsx("span",{children:c("withdraw.speedNoteSpeed3")})]})]}),children:S.jsx(qn,{selectedLevel:pt(n==null?void 0:n.chainId)?mt.SLOW:mt.FAST,maxLevel:3})})})]}),!pt(n==null?void 0:n.chainId)&&S.jsxs("div",{className:"flex items-center justify-between mt-2 h-[18px]",children:[S.jsx("span",{className:"text-text-tertiary text-sm leading-4",children:c("withdraw.fee")}),S.jsxs("span",{className:"text-text-primary text-sm leading-4 font-medium",children:[o," ",t]})]}),S.jsxs("div",{className:"flex items-center justify-between mt-2 h-[18px]",children:[S.jsx("span",{className:"text-text-tertiary text-sm leading-4",children:c(pt(n==null?void 0:n.chainId)?"withdraw.withdrawlAmount":"withdraw.amountToReceive")}),S.jsxs("span",{className:"text-text-primary text-sm leading-4 font-medium",children:[Xe(d)," ",t]})]})]})]})},Gm=[],Ym={};let De=null;const _l=m.forwardRef((e,t)=>{const[n,r]=m.useState(!1),[o,i]=m.useState(!1),[l,u]=m.useState({chains:[]}),s=m.useCallback(g=>{u(g||{chains:[]}),r(!0)},[]),a=m.useCallback(g=>{u(v=>({...v,...g}))},[]),c=m.useCallback(()=>{r(!1),i(!1),l.onClose&&l.onClose()},[l.onClose]),d=m.useCallback(g=>{i(g)},[]),p=m.useCallback(()=>n,[n]),f=m.useCallback(()=>o,[o]);return m.useImperativeHandle(t,()=>({openWithdraw:s,closeWithdraw:c,updateWithdrawOptions:a,setWithdrawLoading:d,isOpen:p,isLoading:f}),[s,c,a,d,p,f]),m.useEffect(()=>(De={openWithdraw:s,closeWithdraw:c,updateWithdrawOptions:a,setWithdrawLoading:d,isOpen:p,isLoading:f},()=>{De=null}),[s,c,a,d,p,f]),S.jsx(zl,{isOpen:n,isLoading:o,onClose:c,config:l.config||{symbol:"USDT"},currentActiveAccount:l.currentActiveAccount,smartWallet:l.smartWallet,chains:l.chains||Gm,defaultChainId:l.defaultChainId,defaultTokenAddress:l.defaultTokenAddress,defaultAmount:l.defaultAmount,metadata:l.metadata||Ym,currentEquity:l.currentEquity??5e3,platformBalance:l.platformBalance||"0",fee:l.fee,wagmiHooks:l.wagmiHooks,onWithdraw:l.onWithdraw,onChainChange:l.onChainChange,onTokenChange:l.onTokenChange,onAmountChanged:l.onAmountChanged})});_l.displayName="WithdrawManager";const Bl=e=>{if(!De){console.error("WithdrawManager not initialized. Make sure to render <WithdrawManager /> in your app.");return}De.openWithdraw(e||{chains:[]})},Wl=()=>{if(!De){console.error("WithdrawManager not initialized. Make sure to render <WithdrawManager /> in your app.");return}De.closeWithdraw()},Ul=e=>{if(!De){console.error("WithdrawManager not initialized. Make sure to render <WithdrawManager /> in your app.");return}De.updateWithdrawOptions(e)},Xn=e=>{if(!De){console.error("WithdrawManager not initialized. Make sure to render <WithdrawManager /> in your app.");return}De.setWithdrawLoading(e)},Km=()=>De?De.isOpen():!1,Vl=()=>De?De.isLoading():!1,qm=()=>({openWithdraw:Bl,closeWithdraw:Wl,updateWithdrawOptions:Ul,setWithdrawLoading:Xn,isOpen:Km,isLoading:Vl}),Xm=({chains:e,defaultChainId:t,defaultTokenAddress:n,defaultAmount:r="",walletAdapter:o,metadata:i,currentEquity:l,platformBalance:u="0",fee:s="0.00",isLoading:a=!1,wagmiHooks:c,onWithdraw:d,onClose:p,onChainChange:f,onTokenChange:g,onAmountChanged:v})=>{var Y;const{t:E}=Ye(),[M,w]=m.useState(()=>{var q;return!e||e.length===0?1:t||((q=e[0])==null?void 0:q.chainId)||1}),[N,F]=m.useState(()=>{var z;if(!e||e.length===0)return"";const q=t||((z=e[0])==null?void 0:z.chainId),G=e.find(J=>J.chainId===q);if(!G||!G.tokenList||G.tokenList.length===0)return"";const H=G.tokenList.find(J=>J.tokenAddress===n)||G.tokenList[0];return(H==null?void 0:H.token)||""}),[j,k]=m.useState(r),[B,h]=m.useState(""),b=(o==null?void 0:o.getWalletType())||"evm",y=m.useCallback(q=>{w(q),f==null||f(q)},[f]),$=m.useCallback(q=>{F(q),g==null||g(q)},[g]),D=m.useRef(!0),L=m.useRef(N),C=m.useRef(M);m.useEffect(()=>{if(D.current){D.current=!1,L.current=N,C.current=M;return}(L.current!==N||C.current!==M)&&(k(""),L.current=N,C.current=M)},[N,M]);const O=e&&e.length>0?e.find(q=>q.chainId===M)||e[0]:null,T=(Y=O==null?void 0:O.tokenList)==null?void 0:Y.find(q=>q.token===N),P=o==null?void 0:o.getDisplayAddress(),{multicallResult:x,queryComponents:I}=Al({account:P,chainId:M,contractAddress:void 0,tokens:(O==null?void 0:O.tokenList)||[],wagmiHooks:c}),_=m.useMemo(()=>{var G;if(!T)return;if(!T.tokenAddress||T.tokenAddress.toLowerCase()==="0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee")return x.baseTokenBalance.formatted;const q=x.combinedData[T.tokenAddress];return((G=q==null?void 0:q.balance)==null?void 0:G.formatted)||"0"},[T,x]),V=m.useMemo(()=>{const q=new xe(j||"0"),G=new xe(s||"0"),H=pt(M);return!j||q.isZero()||!H&&q.isLessThan(G)?{text:E("withdraw.confirmWithdraw"),disabled:!0}:b==="mpc"&&!H&&!B.trim()?{text:E("withdraw.invalidReceiverAddress"),disabled:!0}:{text:E("withdraw.confirmWithdraw"),disabled:!1}},[E,M,j,b,B,s]),W=m.useCallback(async()=>{Xn(!0);try{if(d){const q=new xe(j||"0"),G=new xe(s||"0"),z={amount:(pt(M)?q:q.minus(G)).toString(),chainId:M,tokenAddress:(T==null?void 0:T.tokenAddress)||"",tokenSymbol:N};b==="mpc"&&!pt(M)&&(z.receiverAddress=B),d(z)}}catch{Xn(!1)}},[d,j,s,M,T==null?void 0:T.tokenAddress,N,b,B]);return!(c!=null&&c.useBalance)||!(c!=null&&c.useReadContract)||!(c!=null&&c.useAccount)?S.jsxs("div",{className:"p-6 text-center",children:[S.jsx("p",{className:"text-red-500",children:"缺少必要的 wagmi hooks"}),S.jsx("p",{className:"text-sm text-gray-500 mt-2",children:"请确保传入了 useBalance, useReadContract, useAccount"})]}):!e||e.length===0?S.jsx("div",{className:"text-center py-8",children:S.jsx("p",{className:"text-gray-400",children:"No chains available"})}):O?S.jsxs(S.Fragment,{children:[I,S.jsx(no,{currentActiveChain:O,chainList:e,onChainChange:y,curSelectToken:N,onTokenChange:$,walletType:"evm"}),S.jsx(Hm,{withdrawAmount:j,curSelectToken:N,curSelectTokenData:{balance:T==null?void 0:T.balance,allowance:T==null?void 0:T.allowance},currentActiveChain:O,currentEquity:l||0,amount:j,decimals:(T==null?void 0:T.decimals)||6,tokenBalance:_,platformBalance:u,fee:s,walletType:b,receiverAddress:B,onWithdrawAmountChange:k,onReceiverAddressChange:h,onAmountChanged:v}),S.jsxs("button",{className:`w-full h-[38px] text-sm rounded-xl font-medium transition-colors flex items-center justify-center gap-2 ${V.disabled||a?"bg-text-disabled text-text-secondary cursor-not-allowed":"bg-fill-btn-primary text-text-on-sec-btn"}`,onClick:W,disabled:V.disabled||a,children:[a&&S.jsx(ln,{size:"xs"}),V.text]})]}):S.jsx("div",{className:"text-center py-8",children:S.jsx("p",{className:"text-gray-400",children:"Loading..."})})},zl=({isOpen:e,isLoading:t=!1,onClose:n,config:r,currentActiveAccount:o=oo,smartWallet:i=io,chains:l,defaultChainId:u,defaultTokenAddress:s,defaultAmount:a="",metadata:c=so,currentEquity:d=5e3,platformBalance:p="0",fee:f,wagmiHooks:g,onWithdraw:v,onChainChange:E,onTokenChange:M,onAmountChanged:w})=>{const{t:N}=Ye(),F=m.useMemo(()=>{var j;return o?Vo(o,i,!1,(j=l[0])==null?void 0:j.chainId,"0","0"):null},[o,i,l]);return e?Se.createPortal(S.jsx("div",{className:"fixed top-0 left-0 right-0 bottom-0 w-screen h-screen",style:{zIndex:49},children:S.jsx("div",{className:"fixed top-0 left-0 right-0 bottom-0 z-49 flex items-center justify-center",style:{background:"rgba(0, 0, 0, 0.6)"},onClick:()=>{n()},"aria-hidden":"true",children:S.jsxs("div",{className:"relative w-[420px] max-h-[85vh] bg-fill-page-secondary overflow-auto rounded-lg p-6 shadow-xl",onClick:j=>{j.stopPropagation()},children:[S.jsxs("div",{className:"flex items-center justify-between mb-4",children:[S.jsx("h2",{className:"text-lg font-semibold text-white",children:N("withdraw.withdraw")}),S.jsx("button",{className:"text-gray-400 hover:text-gray-200 transition-colors",onClick:n,"aria-label":"Close",children:S.jsx(Wo,{className:"h-4 w-4"})})]}),S.jsx(Xm,{chains:l,defaultChainId:u,defaultTokenAddress:s,defaultAmount:a,walletAdapter:F,metadata:c,currentEquity:d,platformBalance:p,fee:f,isLoading:t,wagmiHooks:g,onWithdraw:v,onClose:n,onChainChange:E,onTokenChange:M,onAmountChanged:w})]})})}),document.body):null};Z.ChromeLoader=ln,Z.ComponentProvider=va,Z.DEFAULT_LOCALE=un,Z.Deposit=kl,Z.DepositManager=Ml,Z.LOCALE_NAMES=ma,Z.LoadingSpinner=ln,Z.SUPPORTED_LOCALES=Jn,Z.Tooltip=sn,Z.Withdraw=zl,Z.WithdrawManager=_l,Z.closeDeposit=jl,Z.closeWithdraw=Wl,Z.formatThousands=ya,Z.isDepositLoading=Rl,Z.isWithdrawLoading=Vl,Z.openDeposit=Il,Z.openWithdraw=Bl,Z.setDepositLoading=Kn,Z.setWithdrawLoading=Xn,Z.updateDepositOptions=Fl,Z.updateWithdrawOptions=Ul,Z.useComponentConfig=Fo,Z.useDeposit=xa,Z.useDepositManager=Wm,Z.useTranslation=Ye,Z.useWithdraw=wa,Z.useWithdrawManager=qm,Object.defineProperty(Z,Symbol.toStringTag,{value:"Module"})});
|
|
120
120
|
//# sourceMappingURL=index.umd.js.map
|