const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-DAAglTXq.js","assets/sha3--8JbGYfk.js","assets/utils-CqP-FaiV.js","assets/clsx.m-DHulAg21.js","assets/index-DmtF-XQN.js","assets/events-DQ172AOg.js","assets/index-B8lqC164.js","assets/index-Bgc9HhbY.js","assets/index-Dv6ebf5e.js","assets/index.es-C5ku7T-p.js"])))=>i.map(i=>d[i]);
var YGe=Object.defineProperty;var mde=e=>{throw TypeError(e)};var XGe=(e,t,n)=>t in e?YGe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Un=(e,t,n)=>XGe(e,typeof t!="symbol"?t+"":t,n),oz=(e,t,n)=>t.has(e)||mde("Cannot "+n);var ze=(e,t,n)=>(oz(e,t,"read from private field"),n?n.call(e):t.get(e)),Rn=(e,t,n)=>t.has(e)?mde("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Wt=(e,t,n,r)=>(oz(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),vr=(e,t,n)=>(oz(e,t,"access private method"),n);var ib=(e,t,n,r)=>({set _(s){Wt(e,t,s,n)},get _(){return ze(e,t,r)}});function FNe(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const s in r)if(s!=="default"&&!(s in e)){const a=Object.getOwnPropertyDescriptor(r,s);a&&Object.defineProperty(e,s,a.get?a:{enumerable:!0,get:()=>r[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const a of s)if(a.type==="childList")for(const o of a.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(s){const a={};return s.integrity&&(a.integrity=s.integrity),s.referrerPolicy&&(a.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?a.credentials="include":s.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function r(s){if(s.ep)return;s.ep=!0;const a=n(s);fetch(s.href,a)}})();var Tu=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ti(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function i2n(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var s=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,s.get?s:{enumerable:!0,get:function(){return e[r]}})}),n}var lz={exports:{}},u7={},cz={exports:{}},zi={};/**
* @license React
* react.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var xde;function QGe(){if(xde)return zi;xde=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),o=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),u=Symbol.for("react.memo"),d=Symbol.for("react.lazy"),f=Symbol.iterator;function x(ae){return ae===null||typeof ae!="object"?null:(ae=f&&ae[f]||ae["@@iterator"],typeof ae=="function"?ae:null)}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},v=Object.assign,w={};function C(ae,fe,Ne){this.props=ae,this.context=fe,this.refs=w,this.updater=Ne||g}C.prototype.isReactComponent={},C.prototype.setState=function(ae,fe){if(typeof ae!="object"&&typeof ae!="function"&&ae!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,ae,fe,"setState")},C.prototype.forceUpdate=function(ae){this.updater.enqueueForceUpdate(this,ae,"forceUpdate")};function N(){}N.prototype=C.prototype;function P(ae,fe,Ne){this.props=ae,this.context=fe,this.refs=w,this.updater=Ne||g}var I=P.prototype=new N;I.constructor=P,v(I,C.prototype),I.isPureReactComponent=!0;var R=Array.isArray,F=Object.prototype.hasOwnProperty,U={current:null},L={key:!0,ref:!0,__self:!0,__source:!0};function z(ae,fe,Ne){var he,ge={},ye=null,ve=null;if(fe!=null)for(he in fe.ref!==void 0&&(ve=fe.ref),fe.key!==void 0&&(ye=""+fe.key),fe)F.call(fe,he)&&!L.hasOwnProperty(he)&&(ge[he]=fe[he]);var je=arguments.length-2;if(je===1)ge.children=Ne;else if(1<je){for(var Ie=Array(je),Le=0;Le<je;Le++)Ie[Le]=arguments[Le+2];ge.children=Ie}if(ae&&ae.defaultProps)for(he in je=ae.defaultProps,je)ge[he]===void 0&&(ge[he]=je[he]);return{$$typeof:e,type:ae,key:ye,ref:ve,props:ge,_owner:U.current}}function Q(ae,fe){return{$$typeof:e,type:ae.type,key:fe,ref:ae.ref,props:ae.props,_owner:ae._owner}}function ne(ae){return typeof ae=="object"&&ae!==null&&ae.$$typeof===e}function J(ae){var fe={"=":"=0",":":"=2"};return"$"+ae.replace(/[=:]/g,function(Ne){return fe[Ne]})}var X=/\/+/g;function re(ae,fe){return typeof ae=="object"&&ae!==null&&ae.key!=null?J(""+ae.key):fe.toString(36)}function pe(ae,fe,Ne,he,ge){var ye=typeof ae;(ye==="undefined"||ye==="boolean")&&(ae=null);var ve=!1;if(ae===null)ve=!0;else switch(ye){case"string":case"number":ve=!0;break;case"object":switch(ae.$$typeof){case e:case t:ve=!0}}if(ve)return ve=ae,ge=ge(ve),ae=he===""?"."+re(ve,0):he,R(ge)?(Ne="",ae!=null&&(Ne=ae.replace(X,"$&/")+"/"),pe(ge,fe,Ne,"",function(Le){return Le})):ge!=null&&(ne(ge)&&(ge=Q(ge,Ne+(!ge.key||ve&&ve.key===ge.key?"":(""+ge.key).replace(X,"$&/")+"/")+ae)),fe.push(ge)),1;if(ve=0,he=he===""?".":he+":",R(ae))for(var je=0;je<ae.length;je++){ye=ae[je];var Ie=he+re(ye,je);ve+=pe(ye,fe,Ne,Ie,ge)}else if(Ie=x(ae),typeof Ie=="function")for(ae=Ie.call(ae),je=0;!(ye=ae.next()).done;)ye=ye.value,Ie=he+re(ye,je++),ve+=pe(ye,fe,Ne,Ie,ge);else if(ye==="object")throw fe=String(ae),Error("Objects are not valid as a React child (found: "+(fe==="[object Object]"?"object with keys {"+Object.keys(ae).join(", ")+"}":fe)+"). If you meant to render a collection of children, use an array instead.");return ve}function Y(ae,fe,Ne){if(ae==null)return ae;var he=[],ge=0;return pe(ae,he,"","",function(ye){return fe.call(Ne,ye,ge++)}),he}function ie(ae){if(ae._status===-1){var fe=ae._result;fe=fe(),fe.then(function(Ne){(ae._status===0||ae._status===-1)&&(ae._status=1,ae._result=Ne)},function(Ne){(ae._status===0||ae._status===-1)&&(ae._status=2,ae._result=Ne)}),ae._status===-1&&(ae._status=0,ae._result=fe)}if(ae._status===1)return ae._result.default;throw ae._result}var oe={current:null},G={transition:null},V={ReactCurrentDispatcher:oe,ReactCurrentBatchConfig:G,ReactCurrentOwner:U};function ee(){throw Error("act(...) is not supported in production builds of React.")}return zi.Children={map:Y,forEach:function(ae,fe,Ne){Y(ae,function(){fe.apply(this,arguments)},Ne)},count:function(ae){var fe=0;return Y(ae,function(){fe++}),fe},toArray:function(ae){return Y(ae,function(fe){return fe})||[]},only:function(ae){if(!ne(ae))throw Error("React.Children.only expected to receive a single React element child.");return ae}},zi.Component=C,zi.Fragment=n,zi.Profiler=s,zi.PureComponent=P,zi.StrictMode=r,zi.Suspense=c,zi.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=V,zi.act=ee,zi.cloneElement=function(ae,fe,Ne){if(ae==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+ae+".");var he=v({},ae.props),ge=ae.key,ye=ae.ref,ve=ae._owner;if(fe!=null){if(fe.ref!==void 0&&(ye=fe.ref,ve=U.current),fe.key!==void 0&&(ge=""+fe.key),ae.type&&ae.type.defaultProps)var je=ae.type.defaultProps;for(Ie in fe)F.call(fe,Ie)&&!L.hasOwnProperty(Ie)&&(he[Ie]=fe[Ie]===void 0&&je!==void 0?je[Ie]:fe[Ie])}var Ie=arguments.length-2;if(Ie===1)he.children=Ne;else if(1<Ie){je=Array(Ie);for(var Le=0;Le<Ie;Le++)je[Le]=arguments[Le+2];he.children=je}return{$$typeof:e,type:ae.type,key:ge,ref:ye,props:he,_owner:ve}},zi.createContext=function(ae){return ae={$$typeof:o,_currentValue:ae,_currentValue2:ae,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},ae.Provider={$$typeof:a,_context:ae},ae.Consumer=ae},zi.createElement=z,zi.createFactory=function(ae){var fe=z.bind(null,ae);return fe.type=ae,fe},zi.createRef=function(){return{current:null}},zi.forwardRef=function(ae){return{$$typeof:l,render:ae}},zi.isValidElement=ne,zi.lazy=function(ae){return{$$typeof:d,_payload:{_status:-1,_result:ae},_init:ie}},zi.memo=function(ae,fe){return{$$typeof:u,type:ae,compare:fe===void 0?null:fe}},zi.startTransition=function(ae){var fe=G.transition;G.transition={};try{ae()}finally{G.transition=fe}},zi.unstable_act=ee,zi.useCallback=function(ae,fe){return oe.current.useCallback(ae,fe)},zi.useContext=function(ae){return oe.current.useContext(ae)},zi.useDebugValue=function(){},zi.useDeferredValue=function(ae){return oe.current.useDeferredValue(ae)},zi.useEffect=function(ae,fe){return oe.current.useEffect(ae,fe)},zi.useId=function(){return oe.current.useId()},zi.useImperativeHandle=function(ae,fe,Ne){return oe.current.useImperativeHandle(ae,fe,Ne)},zi.useInsertionEffect=function(ae,fe){return oe.current.useInsertionEffect(ae,fe)},zi.useLayoutEffect=function(ae,fe){return oe.current.useLayoutEffect(ae,fe)},zi.useMemo=function(ae,fe){return oe.current.useMemo(ae,fe)},zi.useReducer=function(ae,fe,Ne){return oe.current.useReducer(ae,fe,Ne)},zi.useRef=function(ae){return oe.current.useRef(ae)},zi.useState=function(ae){return oe.current.useState(ae)},zi.useSyncExternalStore=function(ae,fe,Ne){return oe.current.useSyncExternalStore(ae,fe,Ne)},zi.useTransition=function(){return oe.current.useTransition()},zi.version="18.3.1",zi}var gde;function ax(){return gde||(gde=1,cz.exports=QGe()),cz.exports}/**
* @license React
* react-jsx-runtime.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var bde;function ZGe(){if(bde)return u7;bde=1;var e=ax(),t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,s=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,a={key:!0,ref:!0,__self:!0,__source:!0};function o(l,c,u){var d,f={},x=null,g=null;u!==void 0&&(x=""+u),c.key!==void 0&&(x=""+c.key),c.ref!==void 0&&(g=c.ref);for(d in c)r.call(c,d)&&!a.hasOwnProperty(d)&&(f[d]=c[d]);if(l&&l.defaultProps)for(d in c=l.defaultProps,c)f[d]===void 0&&(f[d]=c[d]);return{$$typeof:t,type:l,key:x,ref:g,props:f,_owner:s.current}}return u7.Fragment=n,u7.jsx=o,u7.jsxs=o,u7}var yde;function JGe(){return yde||(yde=1,lz.exports=ZGe()),lz.exports}var i=JGe(),wI={},uz={exports:{}},Od={},dz={exports:{}},fz={};/**
* @license React
* scheduler.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var vde;function eKe(){return vde||(vde=1,function(e){function t(G,V){var ee=G.length;G.push(V);e:for(;0<ee;){var ae=ee-1>>>1,fe=G[ae];if(0<s(fe,V))G[ae]=V,G[ee]=fe,ee=ae;else break e}}function n(G){return G.length===0?null:G[0]}function r(G){if(G.length===0)return null;var V=G[0],ee=G.pop();if(ee!==V){G[0]=ee;e:for(var ae=0,fe=G.length,Ne=fe>>>1;ae<Ne;){var he=2*(ae+1)-1,ge=G[he],ye=he+1,ve=G[ye];if(0>s(ge,ee))ye<fe&&0>s(ve,ge)?(G[ae]=ve,G[ye]=ee,ae=ye):(G[ae]=ge,G[he]=ee,ae=he);else if(ye<fe&&0>s(ve,ee))G[ae]=ve,G[ye]=ee,ae=ye;else break e}}return V}function s(G,V){var ee=G.sortIndex-V.sortIndex;return ee!==0?ee:G.id-V.id}if(typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,l=o.now();e.unstable_now=function(){return o.now()-l}}var c=[],u=[],d=1,f=null,x=3,g=!1,v=!1,w=!1,C=typeof setTimeout=="function"?setTimeout:null,N=typeof clearTimeout=="function"?clearTimeout:null,P=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function I(G){for(var V=n(u);V!==null;){if(V.callback===null)r(u);else if(V.startTime<=G)r(u),V.sortIndex=V.expirationTime,t(c,V);else break;V=n(u)}}function R(G){if(w=!1,I(G),!v)if(n(c)!==null)v=!0,ie(F);else{var V=n(u);V!==null&&oe(R,V.startTime-G)}}function F(G,V){v=!1,w&&(w=!1,N(z),z=-1),g=!0;var ee=x;try{for(I(V),f=n(c);f!==null&&(!(f.expirationTime>V)||G&&!J());){var ae=f.callback;if(typeof ae=="function"){f.callback=null,x=f.priorityLevel;var fe=ae(f.expirationTime<=V);V=e.unstable_now(),typeof fe=="function"?f.callback=fe:f===n(c)&&r(c),I(V)}else r(c);f=n(c)}if(f!==null)var Ne=!0;else{var he=n(u);he!==null&&oe(R,he.startTime-V),Ne=!1}return Ne}finally{f=null,x=ee,g=!1}}var U=!1,L=null,z=-1,Q=5,ne=-1;function J(){return!(e.unstable_now()-ne<Q)}function X(){if(L!==null){var G=e.unstable_now();ne=G;var V=!0;try{V=L(!0,G)}finally{V?re():(U=!1,L=null)}}else U=!1}var re;if(typeof P=="function")re=function(){P(X)};else if(typeof MessageChannel<"u"){var pe=new MessageChannel,Y=pe.port2;pe.port1.onmessage=X,re=function(){Y.postMessage(null)}}else re=function(){C(X,0)};function ie(G){L=G,U||(U=!0,re())}function oe(G,V){z=C(function(){G(e.unstable_now())},V)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(G){G.callback=null},e.unstable_continueExecution=function(){v||g||(v=!0,ie(F))},e.unstable_forceFrameRate=function(G){0>G||125<G?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):Q=0<G?Math.floor(1e3/G):5},e.unstable_getCurrentPriorityLevel=function(){return x},e.unstable_getFirstCallbackNode=function(){return n(c)},e.unstable_next=function(G){switch(x){case 1:case 2:case 3:var V=3;break;default:V=x}var ee=x;x=V;try{return G()}finally{x=ee}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(G,V){switch(G){case 1:case 2:case 3:case 4:case 5:break;default:G=3}var ee=x;x=G;try{return V()}finally{x=ee}},e.unstable_scheduleCallback=function(G,V,ee){var ae=e.unstable_now();switch(typeof ee=="object"&&ee!==null?(ee=ee.delay,ee=typeof ee=="number"&&0<ee?ae+ee:ae):ee=ae,G){case 1:var fe=-1;break;case 2:fe=250;break;case 5:fe=1073741823;break;case 4:fe=1e4;break;default:fe=5e3}return fe=ee+fe,G={id:d++,callback:V,priorityLevel:G,startTime:ee,expirationTime:fe,sortIndex:-1},ee>ae?(G.sortIndex=ee,t(u,G),n(c)===null&&G===n(u)&&(w?(N(z),z=-1):w=!0,oe(R,ee-ae))):(G.sortIndex=fe,t(c,G),v||g||(v=!0,ie(F))),G},e.unstable_shouldYield=J,e.unstable_wrapCallback=function(G){var V=x;return function(){var ee=x;x=V;try{return G.apply(this,arguments)}finally{x=ee}}}}(fz)),fz}var wde;function tKe(){return wde||(wde=1,dz.exports=eKe()),dz.exports}/**
* @license React
* react-dom.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var Cde;function nKe(){if(Cde)return Od;Cde=1;var e=ax(),t=tKe();function n(A){for(var M="https://reactjs.org/docs/error-decoder.html?invariant="+A,Z=1;Z<arguments.length;Z++)M+="&args[]="+encodeURIComponent(arguments[Z]);return"Minified React error #"+A+"; visit "+M+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var r=new Set,s={};function a(A,M){o(A,M),o(A+"Capture",M)}function o(A,M){for(s[A]=M,A=0;A<M.length;A++)r.add(M[A])}var l=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),c=Object.prototype.hasOwnProperty,u=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,d={},f={};function x(A){return c.call(f,A)?!0:c.call(d,A)?!1:u.test(A)?f[A]=!0:(d[A]=!0,!1)}function g(A,M,Z,me){if(Z!==null&&Z.type===0)return!1;switch(typeof M){case"function":case"symbol":return!0;case"boolean":return me?!1:Z!==null?!Z.acceptsBooleans:(A=A.toLowerCase().slice(0,5),A!=="data-"&&A!=="aria-");default:return!1}}function v(A,M,Z,me){if(M===null||typeof M>"u"||g(A,M,Z,me))return!0;if(me)return!1;if(Z!==null)switch(Z.type){case 3:return!M;case 4:return M===!1;case 5:return isNaN(M);case 6:return isNaN(M)||1>M}return!1}function w(A,M,Z,me,Pe,He,St){this.acceptsBooleans=M===2||M===3||M===4,this.attributeName=me,this.attributeNamespace=Pe,this.mustUseProperty=Z,this.propertyName=A,this.type=M,this.sanitizeURL=He,this.removeEmptyString=St}var C={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(A){C[A]=new w(A,0,!1,A,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(A){var M=A[0];C[M]=new w(M,1,!1,A[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(A){C[A]=new w(A,2,!1,A.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(A){C[A]=new w(A,2,!1,A,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(A){C[A]=new w(A,3,!1,A.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(A){C[A]=new w(A,3,!0,A,null,!1,!1)}),["capture","download"].forEach(function(A){C[A]=new w(A,4,!1,A,null,!1,!1)}),["cols","rows","size","span"].forEach(function(A){C[A]=new w(A,6,!1,A,null,!1,!1)}),["rowSpan","start"].forEach(function(A){C[A]=new w(A,5,!1,A.toLowerCase(),null,!1,!1)});var N=/[\-:]([a-z])/g;function P(A){return A[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(A){var M=A.replace(N,P);C[M]=new w(M,1,!1,A,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(A){var M=A.replace(N,P);C[M]=new w(M,1,!1,A,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(A){var M=A.replace(N,P);C[M]=new w(M,1,!1,A,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(A){C[A]=new w(A,1,!1,A.toLowerCase(),null,!1,!1)}),C.xlinkHref=new w("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(A){C[A]=new w(A,1,!1,A.toLowerCase(),null,!0,!0)});function I(A,M,Z,me){var Pe=C.hasOwnProperty(M)?C[M]:null;(Pe!==null?Pe.type!==0:me||!(2<M.length)||M[0]!=="o"&&M[0]!=="O"||M[1]!=="n"&&M[1]!=="N")&&(v(M,Z,Pe,me)&&(Z=null),me||Pe===null?x(M)&&(Z===null?A.removeAttribute(M):A.setAttribute(M,""+Z)):Pe.mustUseProperty?A[Pe.propertyName]=Z===null?Pe.type===3?!1:"":Z:(M=Pe.attributeName,me=Pe.attributeNamespace,Z===null?A.removeAttribute(M):(Pe=Pe.type,Z=Pe===3||Pe===4&&Z===!0?"":""+Z,me?A.setAttributeNS(me,M,Z):A.setAttribute(M,Z))))}var R=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,F=Symbol.for("react.element"),U=Symbol.for("react.portal"),L=Symbol.for("react.fragment"),z=Symbol.for("react.strict_mode"),Q=Symbol.for("react.profiler"),ne=Symbol.for("react.provider"),J=Symbol.for("react.context"),X=Symbol.for("react.forward_ref"),re=Symbol.for("react.suspense"),pe=Symbol.for("react.suspense_list"),Y=Symbol.for("react.memo"),ie=Symbol.for("react.lazy"),oe=Symbol.for("react.offscreen"),G=Symbol.iterator;function V(A){return A===null||typeof A!="object"?null:(A=G&&A[G]||A["@@iterator"],typeof A=="function"?A:null)}var ee=Object.assign,ae;function fe(A){if(ae===void 0)try{throw Error()}catch(Z){var M=Z.stack.trim().match(/\n( *(at )?)/);ae=M&&M[1]||""}return`
`+ae+A}var Ne=!1;function he(A,M){if(!A||Ne)return"";Ne=!0;var Z=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(M)if(M=function(){throw Error()},Object.defineProperty(M.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(M,[])}catch(ar){var me=ar}Reflect.construct(A,[],M)}else{try{M.call()}catch(ar){me=ar}A.call(M.prototype)}else{try{throw Error()}catch(ar){me=ar}A()}}catch(ar){if(ar&&me&&typeof ar.stack=="string"){for(var Pe=ar.stack.split(`
`),He=me.stack.split(`
`),St=Pe.length-1,hn=He.length-1;1<=St&&0<=hn&&Pe[St]!==He[hn];)hn--;for(;1<=St&&0<=hn;St--,hn--)if(Pe[St]!==He[hn]){if(St!==1||hn!==1)do if(St--,hn--,0>hn||Pe[St]!==He[hn]){var _n=`
`+Pe[St].replace(" at new "," at ");return A.displayName&&_n.includes("<anonymous>")&&(_n=_n.replace("<anonymous>",A.displayName)),_n}while(1<=St&&0<=hn);break}}}finally{Ne=!1,Error.prepareStackTrace=Z}return(A=A?A.displayName||A.name:"")?fe(A):""}function ge(A){switch(A.tag){case 5:return fe(A.type);case 16:return fe("Lazy");case 13:return fe("Suspense");case 19:return fe("SuspenseList");case 0:case 2:case 15:return A=he(A.type,!1),A;case 11:return A=he(A.type.render,!1),A;case 1:return A=he(A.type,!0),A;default:return""}}function ye(A){if(A==null)return null;if(typeof A=="function")return A.displayName||A.name||null;if(typeof A=="string")return A;switch(A){case L:return"Fragment";case U:return"Portal";case Q:return"Profiler";case z:return"StrictMode";case re:return"Suspense";case pe:return"SuspenseList"}if(typeof A=="object")switch(A.$$typeof){case J:return(A.displayName||"Context")+".Consumer";case ne:return(A._context.displayName||"Context")+".Provider";case X:var M=A.render;return A=A.displayName,A||(A=M.displayName||M.name||"",A=A!==""?"ForwardRef("+A+")":"ForwardRef"),A;case Y:return M=A.displayName||null,M!==null?M:ye(A.type)||"Memo";case ie:M=A._payload,A=A._init;try{return ye(A(M))}catch{}}return null}function ve(A){var M=A.type;switch(A.tag){case 24:return"Cache";case 9:return(M.displayName||"Context")+".Consumer";case 10:return(M._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return A=M.render,A=A.displayName||A.name||"",M.displayName||(A!==""?"ForwardRef("+A+")":"ForwardRef");case 7:return"Fragment";case 5:return M;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return ye(M);case 8:return M===z?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof M=="function")return M.displayName||M.name||null;if(typeof M=="string")return M}return null}function je(A){switch(typeof A){case"boolean":case"number":case"string":case"undefined":return A;case"object":return A;default:return""}}function Ie(A){var M=A.type;return(A=A.nodeName)&&A.toLowerCase()==="input"&&(M==="checkbox"||M==="radio")}function Le(A){var M=Ie(A)?"checked":"value",Z=Object.getOwnPropertyDescriptor(A.constructor.prototype,M),me=""+A[M];if(!A.hasOwnProperty(M)&&typeof Z<"u"&&typeof Z.get=="function"&&typeof Z.set=="function"){var Pe=Z.get,He=Z.set;return Object.defineProperty(A,M,{configurable:!0,get:function(){return Pe.call(this)},set:function(St){me=""+St,He.call(this,St)}}),Object.defineProperty(A,M,{enumerable:Z.enumerable}),{getValue:function(){return me},setValue:function(St){me=""+St},stopTracking:function(){A._valueTracker=null,delete A[M]}}}}function Qe(A){A._valueTracker||(A._valueTracker=Le(A))}function $e(A){if(!A)return!1;var M=A._valueTracker;if(!M)return!0;var Z=M.getValue(),me="";return A&&(me=Ie(A)?A.checked?"true":"false":A.value),A=me,A!==Z?(M.setValue(A),!0):!1}function it(A){if(A=A||(typeof document<"u"?document:void 0),typeof A>"u")return null;try{return A.activeElement||A.body}catch{return A.body}}function tt(A,M){var Z=M.checked;return ee({},M,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:Z??A._wrapperState.initialChecked})}function lt(A,M){var Z=M.defaultValue==null?"":M.defaultValue,me=M.checked!=null?M.checked:M.defaultChecked;Z=je(M.value!=null?M.value:Z),A._wrapperState={initialChecked:me,initialValue:Z,controlled:M.type==="checkbox"||M.type==="radio"?M.checked!=null:M.value!=null}}function ft(A,M){M=M.checked,M!=null&&I(A,"checked",M,!1)}function ut(A,M){ft(A,M);var Z=je(M.value),me=M.type;if(Z!=null)me==="number"?(Z===0&&A.value===""||A.value!=Z)&&(A.value=""+Z):A.value!==""+Z&&(A.value=""+Z);else if(me==="submit"||me==="reset"){A.removeAttribute("value");return}M.hasOwnProperty("value")?It(A,M.type,Z):M.hasOwnProperty("defaultValue")&&It(A,M.type,je(M.defaultValue)),M.checked==null&&M.defaultChecked!=null&&(A.defaultChecked=!!M.defaultChecked)}function qt(A,M,Z){if(M.hasOwnProperty("value")||M.hasOwnProperty("defaultValue")){var me=M.type;if(!(me!=="submit"&&me!=="reset"||M.value!==void 0&&M.value!==null))return;M=""+A._wrapperState.initialValue,Z||M===A.value||(A.value=M),A.defaultValue=M}Z=A.name,Z!==""&&(A.name=""),A.defaultChecked=!!A._wrapperState.initialChecked,Z!==""&&(A.name=Z)}function It(A,M,Z){(M!=="number"||it(A.ownerDocument)!==A)&&(Z==null?A.defaultValue=""+A._wrapperState.initialValue:A.defaultValue!==""+Z&&(A.defaultValue=""+Z))}var nn=Array.isArray;function jt(A,M,Z,me){if(A=A.options,M){M={};for(var Pe=0;Pe<Z.length;Pe++)M["$"+Z[Pe]]=!0;for(Z=0;Z<A.length;Z++)Pe=M.hasOwnProperty("$"+A[Z].value),A[Z].selected!==Pe&&(A[Z].selected=Pe),Pe&&me&&(A[Z].defaultSelected=!0)}else{for(Z=""+je(Z),M=null,Pe=0;Pe<A.length;Pe++){if(A[Pe].value===Z){A[Pe].selected=!0,me&&(A[Pe].defaultSelected=!0);return}M!==null||A[Pe].disabled||(M=A[Pe])}M!==null&&(M.selected=!0)}}function cn(A,M){if(M.dangerouslySetInnerHTML!=null)throw Error(n(91));return ee({},M,{value:void 0,defaultValue:void 0,children:""+A._wrapperState.initialValue})}function un(A,M){var Z=M.value;if(Z==null){if(Z=M.children,M=M.defaultValue,Z!=null){if(M!=null)throw Error(n(92));if(nn(Z)){if(1<Z.length)throw Error(n(93));Z=Z[0]}M=Z}M==null&&(M=""),Z=M}A._wrapperState={initialValue:je(Z)}}function Ft(A,M){var Z=je(M.value),me=je(M.defaultValue);Z!=null&&(Z=""+Z,Z!==A.value&&(A.value=Z),M.defaultValue==null&&A.defaultValue!==Z&&(A.defaultValue=Z)),me!=null&&(A.defaultValue=""+me)}function Ke(A){var M=A.textContent;M===A._wrapperState.initialValue&&M!==""&&M!==null&&(A.value=M)}function Bt(A){switch(A){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function $t(A,M){return A==null||A==="http://www.w3.org/1999/xhtml"?Bt(M):A==="http://www.w3.org/2000/svg"&&M==="foreignObject"?"http://www.w3.org/1999/xhtml":A}var qe,Ye=function(A){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(M,Z,me,Pe){MSApp.execUnsafeLocalFunction(function(){return A(M,Z,me,Pe)})}:A}(function(A,M){if(A.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in A)A.innerHTML=M;else{for(qe=qe||document.createElement("div"),qe.innerHTML="<svg>"+M.valueOf().toString()+"</svg>",M=qe.firstChild;A.firstChild;)A.removeChild(A.firstChild);for(;M.firstChild;)A.appendChild(M.firstChild)}});function ht(A,M){if(M){var Z=A.firstChild;if(Z&&Z===A.lastChild&&Z.nodeType===3){Z.nodeValue=M;return}}A.textContent=M}var Zt={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},zt=["Webkit","ms","Moz","O"];Object.keys(Zt).forEach(function(A){zt.forEach(function(M){M=M+A.charAt(0).toUpperCase()+A.substring(1),Zt[M]=Zt[A]})});function Et(A,M,Z){return M==null||typeof M=="boolean"||M===""?"":Z||typeof M!="number"||M===0||Zt.hasOwnProperty(A)&&Zt[A]?(""+M).trim():M+"px"}function nt(A,M){A=A.style;for(var Z in M)if(M.hasOwnProperty(Z)){var me=Z.indexOf("--")===0,Pe=Et(Z,M[Z],me);Z==="float"&&(Z="cssFloat"),me?A.setProperty(Z,Pe):A[Z]=Pe}}var Ue=ee({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Rt(A,M){if(M){if(Ue[A]&&(M.children!=null||M.dangerouslySetInnerHTML!=null))throw Error(n(137,A));if(M.dangerouslySetInnerHTML!=null){if(M.children!=null)throw Error(n(60));if(typeof M.dangerouslySetInnerHTML!="object"||!("__html"in M.dangerouslySetInnerHTML))throw Error(n(61))}if(M.style!=null&&typeof M.style!="object")throw Error(n(62))}}function We(A,M){if(A.indexOf("-")===-1)return typeof M.is=="string";switch(A){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var at=null;function mt(A){return A=A.target||A.srcElement||window,A.correspondingUseElement&&(A=A.correspondingUseElement),A.nodeType===3?A.parentNode:A}var Dt=null,Tt=null,dn=null;function on(A){if(A=hc(A)){if(typeof Dt!="function")throw Error(n(280));var M=A.stateNode;M&&(M=B5(M),Dt(A.stateNode,A.type,M))}}function gn(A){Tt?dn?dn.push(A):dn=[A]:Tt=A}function Nn(){if(Tt){var A=Tt,M=dn;if(dn=Tt=null,on(A),M)for(A=0;A<M.length;A++)on(M[A])}}function kn(A,M){return A(M)}function yn(){}var Vn=!1;function Gn(A,M,Z){if(Vn)return A(M,Z);Vn=!0;try{return kn(A,M,Z)}finally{Vn=!1,(Tt!==null||dn!==null)&&(yn(),Nn())}}function Dn(A,M){var Z=A.stateNode;if(Z===null)return null;var me=B5(Z);if(me===null)return null;Z=me[M];e:switch(M){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(me=!me.disabled)||(A=A.type,me=!(A==="button"||A==="input"||A==="select"||A==="textarea")),A=!me;break e;default:A=!1}if(A)return null;if(Z&&typeof Z!="function")throw Error(n(231,M,typeof Z));return Z}var Kn=!1;if(l)try{var Cn={};Object.defineProperty(Cn,"passive",{get:function(){Kn=!0}}),window.addEventListener("test",Cn,Cn),window.removeEventListener("test",Cn,Cn)}catch{Kn=!1}function sn(A,M,Z,me,Pe,He,St,hn,_n){var ar=Array.prototype.slice.call(arguments,3);try{M.apply(Z,ar)}catch(Ur){this.onError(Ur)}}var Me=!1,en=null,an=!1,Nt=null,Yn={onError:function(A){Me=!0,en=A}};function xn(A,M,Z,me,Pe,He,St,hn,_n){Me=!1,en=null,sn.apply(Yn,arguments)}function Mt(A,M,Z,me,Pe,He,St,hn,_n){if(xn.apply(this,arguments),Me){if(Me){var ar=en;Me=!1,en=null}else throw Error(n(198));an||(an=!0,Nt=ar)}}function tn(A){var M=A,Z=A;if(A.alternate)for(;M.return;)M=M.return;else{A=M;do M=A,M.flags&4098&&(Z=M.return),A=M.return;while(A)}return M.tag===3?Z:null}function In(A){if(A.tag===13){var M=A.memoizedState;if(M===null&&(A=A.alternate,A!==null&&(M=A.memoizedState)),M!==null)return M.dehydrated}return null}function Xn(A){if(tn(A)!==A)throw Error(n(188))}function or(A){var M=A.alternate;if(!M){if(M=tn(A),M===null)throw Error(n(188));return M!==A?null:A}for(var Z=A,me=M;;){var Pe=Z.return;if(Pe===null)break;var He=Pe.alternate;if(He===null){if(me=Pe.return,me!==null){Z=me;continue}break}if(Pe.child===He.child){for(He=Pe.child;He;){if(He===Z)return Xn(Pe),A;if(He===me)return Xn(Pe),M;He=He.sibling}throw Error(n(188))}if(Z.return!==me.return)Z=Pe,me=He;else{for(var St=!1,hn=Pe.child;hn;){if(hn===Z){St=!0,Z=Pe,me=He;break}if(hn===me){St=!0,me=Pe,Z=He;break}hn=hn.sibling}if(!St){for(hn=He.child;hn;){if(hn===Z){St=!0,Z=He,me=Pe;break}if(hn===me){St=!0,me=He,Z=Pe;break}hn=hn.sibling}if(!St)throw Error(n(189))}}if(Z.alternate!==me)throw Error(n(190))}if(Z.tag!==3)throw Error(n(188));return Z.stateNode.current===Z?A:M}function lr(A){return A=or(A),A!==null?Qt(A):null}function Qt(A){if(A.tag===5||A.tag===6)return A;for(A=A.child;A!==null;){var M=Qt(A);if(M!==null)return M;A=A.sibling}return null}var zn=t.unstable_scheduleCallback,Jn=t.unstable_cancelCallback,Lt=t.unstable_shouldYield,jn=t.unstable_requestPaint,Ee=t.unstable_now,h=t.unstable_getCurrentPriorityLevel,p=t.unstable_ImmediatePriority,S=t.unstable_UserBlockingPriority,_=t.unstable_NormalPriority,k=t.unstable_LowPriority,T=t.unstable_IdlePriority,B=null,q=null;function te(A){if(q&&typeof q.onCommitFiberRoot=="function")try{q.onCommitFiberRoot(B,A,void 0,(A.current.flags&128)===128)}catch{}}var ue=Math.clz32?Math.clz32:Se,de=Math.log,xe=Math.LN2;function Se(A){return A>>>=0,A===0?32:31-(de(A)/xe|0)|0}var ke=64,Re=4194304;function Ge(A){switch(A&-A){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return A&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return A&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return A}}function Fe(A,M){var Z=A.pendingLanes;if(Z===0)return 0;var me=0,Pe=A.suspendedLanes,He=A.pingedLanes,St=Z&268435455;if(St!==0){var hn=St&~Pe;hn!==0?me=Ge(hn):(He&=St,He!==0&&(me=Ge(He)))}else St=Z&~Pe,St!==0?me=Ge(St):He!==0&&(me=Ge(He));if(me===0)return 0;if(M!==0&&M!==me&&!(M&Pe)&&(Pe=me&-me,He=M&-M,Pe>=He||Pe===16&&(He&4194240)!==0))return M;if(me&4&&(me|=Z&16),M=A.entangledLanes,M!==0)for(A=A.entanglements,M&=me;0<M;)Z=31-ue(M),Pe=1<<Z,me|=A[Z],M&=~Pe;return me}function st(A,M){switch(A){case 1:case 2:case 4:return M+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return M+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function se(A,M){for(var Z=A.suspendedLanes,me=A.pingedLanes,Pe=A.expirationTimes,He=A.pendingLanes;0<He;){var St=31-ue(He),hn=1<<St,_n=Pe[St];_n===-1?(!(hn&Z)||hn&me)&&(Pe[St]=st(hn,M)):_n<=M&&(A.expiredLanes|=hn),He&=~hn}}function Ce(A){return A=A.pendingLanes&-1073741825,A!==0?A:A&1073741824?1073741824:0}function Be(){var A=ke;return ke<<=1,!(ke&4194240)&&(ke=64),A}function De(A){for(var M=[],Z=0;31>Z;Z++)M.push(A);return M}function _e(A,M,Z){A.pendingLanes|=M,M!==536870912&&(A.suspendedLanes=0,A.pingedLanes=0),A=A.eventTimes,M=31-ue(M),A[M]=Z}function Je(A,M){var Z=A.pendingLanes&~M;A.pendingLanes=M,A.suspendedLanes=0,A.pingedLanes=0,A.expiredLanes&=M,A.mutableReadLanes&=M,A.entangledLanes&=M,M=A.entanglements;var me=A.eventTimes;for(A=A.expirationTimes;0<Z;){var Pe=31-ue(Z),He=1<<Pe;M[Pe]=0,me[Pe]=-1,A[Pe]=-1,Z&=~He}}function ct(A,M){var Z=A.entangledLanes|=M;for(A=A.entanglements;Z;){var me=31-ue(Z),Pe=1<<me;Pe&M|A[me]&M&&(A[me]|=M),Z&=~Pe}}var gt=0;function Xt(A){return A&=-A,1<A?4<A?A&268435455?16:536870912:4:1}var wt,Xe,Oe,bt,kt,Ut=!1,fn=[],On=null,Sn=null,yr=null,Pn=new Map,En=new Map,$n=[],Bn="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function _r(A,M){switch(A){case"focusin":case"focusout":On=null;break;case"dragenter":case"dragleave":Sn=null;break;case"mouseover":case"mouseout":yr=null;break;case"pointerover":case"pointerout":Pn.delete(M.pointerId);break;case"gotpointercapture":case"lostpointercapture":En.delete(M.pointerId)}}function sr(A,M,Z,me,Pe,He){return A===null||A.nativeEvent!==He?(A={blockedOn:M,domEventName:Z,eventSystemFlags:me,nativeEvent:He,targetContainers:[Pe]},M!==null&&(M=hc(M),M!==null&&Xe(M)),A):(A.eventSystemFlags|=me,M=A.targetContainers,Pe!==null&&M.indexOf(Pe)===-1&&M.push(Pe),A)}function rr(A,M,Z,me,Pe){switch(M){case"focusin":return On=sr(On,A,M,Z,me,Pe),!0;case"dragenter":return Sn=sr(Sn,A,M,Z,me,Pe),!0;case"mouseover":return yr=sr(yr,A,M,Z,me,Pe),!0;case"pointerover":var He=Pe.pointerId;return Pn.set(He,sr(Pn.get(He)||null,A,M,Z,me,Pe)),!0;case"gotpointercapture":return He=Pe.pointerId,En.set(He,sr(En.get(He)||null,A,M,Z,me,Pe)),!0}return!1}function Rr(A){var M=th(A.target);if(M!==null){var Z=tn(M);if(Z!==null){if(M=Z.tag,M===13){if(M=In(Z),M!==null){A.blockedOn=M,kt(A.priority,function(){Oe(Z)});return}}else if(M===3&&Z.stateNode.current.memoizedState.isDehydrated){A.blockedOn=Z.tag===3?Z.stateNode.containerInfo:null;return}}}A.blockedOn=null}function Jr(A){if(A.blockedOn!==null)return!1;for(var M=A.targetContainers;0<M.length;){var Z=jr(A.domEventName,A.eventSystemFlags,M[0],A.nativeEvent);if(Z===null){Z=A.nativeEvent;var me=new Z.constructor(Z.type,Z);at=me,Z.target.dispatchEvent(me),at=null}else return M=hc(Z),M!==null&&Xe(M),A.blockedOn=Z,!1;M.shift()}return!0}function ws(A,M,Z){Jr(A)&&Z.delete(M)}function ls(){Ut=!1,On!==null&&Jr(On)&&(On=null),Sn!==null&&Jr(Sn)&&(Sn=null),yr!==null&&Jr(yr)&&(yr=null),Pn.forEach(ws),En.forEach(ws)}function et(A,M){A.blockedOn===M&&(A.blockedOn=null,Ut||(Ut=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,ls)))}function yt(A){function M(Pe){return et(Pe,A)}if(0<fn.length){et(fn[0],A);for(var Z=1;Z<fn.length;Z++){var me=fn[Z];me.blockedOn===A&&(me.blockedOn=null)}}for(On!==null&&et(On,A),Sn!==null&&et(Sn,A),yr!==null&&et(yr,A),Pn.forEach(M),En.forEach(M),Z=0;Z<$n.length;Z++)me=$n[Z],me.blockedOn===A&&(me.blockedOn=null);for(;0<$n.length&&(Z=$n[0],Z.blockedOn===null);)Rr(Z),Z.blockedOn===null&&$n.shift()}var Tn=R.ReactCurrentBatchConfig,tr=!0;function Ar(A,M,Z,me){var Pe=gt,He=Tn.transition;Tn.transition=null;try{gt=1,Vr(A,M,Z,me)}finally{gt=Pe,Tn.transition=He}}function Br(A,M,Z,me){var Pe=gt,He=Tn.transition;Tn.transition=null;try{gt=4,Vr(A,M,Z,me)}finally{gt=Pe,Tn.transition=He}}function Vr(A,M,Z,me){if(tr){var Pe=jr(A,M,Z,me);if(Pe===null)h8(A,M,me,dr,Z),_r(A,me);else if(rr(Pe,A,M,Z,me))me.stopPropagation();else if(_r(A,me),M&4&&-1<Bn.indexOf(A)){for(;Pe!==null;){var He=hc(Pe);if(He!==null&&wt(He),He=jr(A,M,Z,me),He===null&&h8(A,M,me,dr,Z),He===Pe)break;Pe=He}Pe!==null&&me.stopPropagation()}else h8(A,M,me,null,Z)}}var dr=null;function jr(A,M,Z,me){if(dr=null,A=mt(me),A=th(A),A!==null)if(M=tn(A),M===null)A=null;else if(Z=M.tag,Z===13){if(A=In(M),A!==null)return A;A=null}else if(Z===3){if(M.stateNode.current.memoizedState.isDehydrated)return M.tag===3?M.stateNode.containerInfo:null;A=null}else M!==A&&(A=null);return dr=A,null}function ps(A){switch(A){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(h()){case p:return 1;case S:return 4;case _:case k:return 16;case T:return 536870912;default:return 16}default:return 16}}var gr=null,es=null,Gs=null;function Es(){if(Gs)return Gs;var A,M=es,Z=M.length,me,Pe="value"in gr?gr.value:gr.textContent,He=Pe.length;for(A=0;A<Z&&M[A]===Pe[A];A++);var St=Z-A;for(me=1;me<=St&&M[Z-me]===Pe[He-me];me++);return Gs=Pe.slice(A,1<me?1-me:void 0)}function xr(A){var M=A.keyCode;return"charCode"in A?(A=A.charCode,A===0&&M===13&&(A=13)):A=M,A===10&&(A=13),32<=A||A===13?A:0}function Gt(){return!0}function ce(){return!1}function rt(A){function M(Z,me,Pe,He,St){this._reactName=Z,this._targetInst=Pe,this.type=me,this.nativeEvent=He,this.target=St,this.currentTarget=null;for(var hn in A)A.hasOwnProperty(hn)&&(Z=A[hn],this[hn]=Z?Z(He):He[hn]);return this.isDefaultPrevented=(He.defaultPrevented!=null?He.defaultPrevented:He.returnValue===!1)?Gt:ce,this.isPropagationStopped=ce,this}return ee(M.prototype,{preventDefault:function(){this.defaultPrevented=!0;var Z=this.nativeEvent;Z&&(Z.preventDefault?Z.preventDefault():typeof Z.returnValue!="unknown"&&(Z.returnValue=!1),this.isDefaultPrevented=Gt)},stopPropagation:function(){var Z=this.nativeEvent;Z&&(Z.stopPropagation?Z.stopPropagation():typeof Z.cancelBubble!="unknown"&&(Z.cancelBubble=!0),this.isPropagationStopped=Gt)},persist:function(){},isPersistent:Gt}),M}var Pt={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(A){return A.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},vt=rt(Pt),ln=ee({},Pt,{view:0,detail:0}),mn=rt(ln),cr,Nr,fr,ur=ee({},ln,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Fr,button:0,buttons:0,relatedTarget:function(A){return A.relatedTarget===void 0?A.fromElement===A.srcElement?A.toElement:A.fromElement:A.relatedTarget},movementX:function(A){return"movementX"in A?A.movementX:(A!==fr&&(fr&&A.type==="mousemove"?(cr=A.screenX-fr.screenX,Nr=A.screenY-fr.screenY):Nr=cr=0,fr=A),cr)},movementY:function(A){return"movementY"in A?A.movementY:Nr}}),Yr=rt(ur),ss=ee({},ur,{dataTransfer:0}),Ir=rt(ss),mr=ee({},ln,{relatedTarget:0}),Qn=rt(mr),xs=ee({},Pt,{animationName:0,elapsedTime:0,pseudoElement:0}),Xs=rt(xs),ii=ee({},Pt,{clipboardData:function(A){return"clipboardData"in A?A.clipboardData:window.clipboardData}}),Pr=rt(ii),vn=ee({},Pt,{data:0}),Mn=rt(vn),ot={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Vt={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},er={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Wn(A){var M=this.nativeEvent;return M.getModifierState?M.getModifierState(A):(A=er[A])?!!M[A]:!1}function Fr(){return Wn}var kr=ee({},ln,{key:function(A){if(A.key){var M=ot[A.key]||A.key;if(M!=="Unidentified")return M}return A.type==="keypress"?(A=xr(A),A===13?"Enter":String.fromCharCode(A)):A.type==="keydown"||A.type==="keyup"?Vt[A.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Fr,charCode:function(A){return A.type==="keypress"?xr(A):0},keyCode:function(A){return A.type==="keydown"||A.type==="keyup"?A.keyCode:0},which:function(A){return A.type==="keypress"?xr(A):A.type==="keydown"||A.type==="keyup"?A.keyCode:0}}),ts=rt(kr),Ms=ee({},ur,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),At=rt(Ms),ir=ee({},ln,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Fr}),Hn=rt(ir),Hr=ee({},Pt,{propertyName:0,elapsedTime:0,pseudoElement:0}),os=rt(Hr),is=ee({},ur,{deltaX:function(A){return"deltaX"in A?A.deltaX:"wheelDeltaX"in A?-A.wheelDeltaX:0},deltaY:function(A){return"deltaY"in A?A.deltaY:"wheelDeltaY"in A?-A.wheelDeltaY:"wheelDelta"in A?-A.wheelDelta:0},deltaZ:0,deltaMode:0}),ms=rt(is),gs=[9,13,27,32],$i=l&&"CompositionEvent"in window,Bs=null;l&&"documentMode"in document&&(Bs=document.documentMode);var bs=l&&"TextEvent"in window&&!Bs,Tr=l&&(!$i||Bs&&8<Bs&&11>=Bs),ga=" ",El=!1;function _l(A,M){switch(A){case"keyup":return gs.indexOf(M.keyCode)!==-1;case"keydown":return M.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Bu(A){return A=A.detail,typeof A=="object"&&"data"in A?A.data:null}var ba=!1;function kl(A,M){switch(A){case"compositionend":return Bu(M);case"keypress":return M.which!==32?null:(El=!0,ga);case"textInput":return A=M.data,A===ga&&El?null:A;default:return null}}function px(A,M){if(ba)return A==="compositionend"||!$i&&_l(A,M)?(A=Es(),Gs=es=gr=null,ba=!1,A):null;switch(A){case"paste":return null;case"keypress":if(!(M.ctrlKey||M.altKey||M.metaKey)||M.ctrlKey&&M.altKey){if(M.char&&1<M.char.length)return M.char;if(M.which)return String.fromCharCode(M.which)}return null;case"compositionend":return Tr&&M.locale!=="ko"?null:M.data;default:return null}}var $u={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function gi(A){var M=A&&A.nodeName&&A.nodeName.toLowerCase();return M==="input"?!!$u[A.type]:M==="textarea"}function yd(A,M,Z,me){gn(me),M=M5(M,"onChange"),0<M.length&&(Z=new vt("onChange","change",null,Z,me),A.push({event:Z,listeners:M}))}var dt=null,y=null;function E(A){_T(A,0)}function O(A){var M=Ci(A);if($e(M))return A}function $(A,M){if(A==="change")return M}var H=!1;if(l){var K;if(l){var le="oninput"in document;if(!le){var we=document.createElement("div");we.setAttribute("oninput","return;"),le=typeof we.oninput=="function"}K=le}else K=!1;H=K&&(!document.documentMode||9<document.documentMode)}function Te(){dt&&(dt.detachEvent("onpropertychange",Ze),y=dt=null)}function Ze(A){if(A.propertyName==="value"&&O(y)){var M=[];yd(M,y,A,mt(A)),Gn(E,M)}}function pt(A,M,Z){A==="focusin"?(Te(),dt=M,y=Z,dt.attachEvent("onpropertychange",Ze)):A==="focusout"&&Te()}function _t(A){if(A==="selectionchange"||A==="keyup"||A==="keydown")return O(y)}function Jt(A,M){if(A==="click")return O(M)}function Ct(A,M){if(A==="input"||A==="change")return O(M)}function Ht(A,M){return A===M&&(A!==0||1/A===1/M)||A!==A&&M!==M}var Kt=typeof Object.is=="function"?Object.is:Ht;function An(A,M){if(Kt(A,M))return!0;if(typeof A!="object"||A===null||typeof M!="object"||M===null)return!1;var Z=Object.keys(A),me=Object.keys(M);if(Z.length!==me.length)return!1;for(me=0;me<Z.length;me++){var Pe=Z[me];if(!c.call(M,Pe)||!Kt(A[Pe],M[Pe]))return!1}return!0}function hr(A){for(;A&&A.firstChild;)A=A.firstChild;return A}function wr(A,M){var Z=hr(A);A=0;for(var me;Z;){if(Z.nodeType===3){if(me=A+Z.textContent.length,A<=M&&me>=M)return{node:Z,offset:M-A};A=me}e:{for(;Z;){if(Z.nextSibling){Z=Z.nextSibling;break e}Z=Z.parentNode}Z=void 0}Z=hr(Z)}}function Sr(A,M){return A&&M?A===M?!0:A&&A.nodeType===3?!1:M&&M.nodeType===3?Sr(A,M.parentNode):"contains"in A?A.contains(M):A.compareDocumentPosition?!!(A.compareDocumentPosition(M)&16):!1:!1}function Ss(){for(var A=window,M=it();M instanceof A.HTMLIFrameElement;){try{var Z=typeof M.contentWindow.location.href=="string"}catch{Z=!1}if(Z)A=M.contentWindow;else break;M=it(A.document)}return M}function Qs(A){var M=A&&A.nodeName&&A.nodeName.toLowerCase();return M&&(M==="input"&&(A.type==="text"||A.type==="search"||A.type==="tel"||A.type==="url"||A.type==="password")||M==="textarea"||A.contentEditable==="true")}function dc(A){var M=Ss(),Z=A.focusedElem,me=A.selectionRange;if(M!==Z&&Z&&Z.ownerDocument&&Sr(Z.ownerDocument.documentElement,Z)){if(me!==null&&Qs(Z)){if(M=me.start,A=me.end,A===void 0&&(A=M),"selectionStart"in Z)Z.selectionStart=M,Z.selectionEnd=Math.min(A,Z.value.length);else if(A=(M=Z.ownerDocument||document)&&M.defaultView||window,A.getSelection){A=A.getSelection();var Pe=Z.textContent.length,He=Math.min(me.start,Pe);me=me.end===void 0?He:Math.min(me.end,Pe),!A.extend&&He>me&&(Pe=me,me=He,He=Pe),Pe=wr(Z,He);var St=wr(Z,me);Pe&&St&&(A.rangeCount!==1||A.anchorNode!==Pe.node||A.anchorOffset!==Pe.offset||A.focusNode!==St.node||A.focusOffset!==St.offset)&&(M=M.createRange(),M.setStart(Pe.node,Pe.offset),A.removeAllRanges(),He>me?(A.addRange(M),A.extend(St.node,St.offset)):(M.setEnd(St.node,St.offset),A.addRange(M)))}}for(M=[],A=Z;A=A.parentNode;)A.nodeType===1&&M.push({element:A,left:A.scrollLeft,top:A.scrollTop});for(typeof Z.focus=="function"&&Z.focus(),Z=0;Z<M.length;Z++)A=M[Z],A.element.scrollLeft=A.left,A.element.scrollTop=A.top}}var Za=l&&"documentMode"in document&&11>=document.documentMode,Ja=null,da=null,_a=null,Wo=!1;function vd(A,M,Z){var me=Z.window===Z?Z.document:Z.nodeType===9?Z:Z.ownerDocument;Wo||Ja==null||Ja!==it(me)||(me=Ja,"selectionStart"in me&&Qs(me)?me={start:me.selectionStart,end:me.selectionEnd}:(me=(me.ownerDocument&&me.ownerDocument.defaultView||window).getSelection(),me={anchorNode:me.anchorNode,anchorOffset:me.anchorOffset,focusNode:me.focusNode,focusOffset:me.focusOffset}),_a&&An(_a,me)||(_a=me,me=M5(da,"onSelect"),0<me.length&&(M=new vt("onSelect","select",null,M,Z),A.push({event:M,listeners:me}),M.target=Ja)))}function Pi(A,M){var Z={};return Z[A.toLowerCase()]=M.toLowerCase(),Z["Webkit"+A]="webkit"+M,Z["Moz"+A]="moz"+M,Z}var _m={animationend:Pi("Animation","AnimationEnd"),animationiteration:Pi("Animation","AnimationIteration"),animationstart:Pi("Animation","AnimationStart"),transitionend:Pi("Transition","TransitionEnd")},F1={},N2={};l&&(N2=document.createElement("div").style,"AnimationEvent"in window||(delete _m.animationend.animation,delete _m.animationiteration.animation,delete _m.animationstart.animation),"TransitionEvent"in window||delete _m.transitionend.transition);function T5(A){if(F1[A])return F1[A];if(!_m[A])return A;var M=_m[A],Z;for(Z in M)if(M.hasOwnProperty(Z)&&Z in N2)return F1[A]=M[Z];return A}var AT=T5("animationend"),jT=T5("animationiteration"),A2=T5("animationstart"),mp=T5("transitionend"),j2=new Map,d8="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function hf(A,M){j2.set(A,M),a(M,[A])}for(var I5=0;I5<d8.length;I5++){var P5=d8[I5],F5=P5.toLowerCase(),ET=P5[0].toUpperCase()+P5.slice(1);hf(F5,"on"+ET)}hf(AT,"onAnimationEnd"),hf(jT,"onAnimationIteration"),hf(A2,"onAnimationStart"),hf("dblclick","onDoubleClick"),hf("focusin","onFocus"),hf("focusout","onBlur"),hf(mp,"onTransitionEnd"),o("onMouseEnter",["mouseout","mouseover"]),o("onMouseLeave",["mouseout","mouseover"]),o("onPointerEnter",["pointerout","pointerover"]),o("onPointerLeave",["pointerout","pointerover"]),a("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),a("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),a("onBeforeInput",["compositionend","keypress","textInput","paste"]),a("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),a("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),a("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var xp="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),mx=new Set("cancel close invalid load scroll toggle".split(" ").concat(xp));function E2(A,M,Z){var me=A.type||"unknown-event";A.currentTarget=Z,Mt(me,M,void 0,A),A.currentTarget=null}function _T(A,M){M=(M&4)!==0;for(var Z=0;Z<A.length;Z++){var me=A[Z],Pe=me.event;me=me.listeners;e:{var He=void 0;if(M)for(var St=me.length-1;0<=St;St--){var hn=me[St],_n=hn.instance,ar=hn.currentTarget;if(hn=hn.listener,_n!==He&&Pe.isPropagationStopped())break e;E2(Pe,hn,ar),He=_n}else for(St=0;St<me.length;St++){if(hn=me[St],_n=hn.instance,ar=hn.currentTarget,hn=hn.listener,_n!==He&&Pe.isPropagationStopped())break e;E2(Pe,hn,ar),He=_n}}}if(an)throw A=Nt,an=!1,Nt=null,A}function Wa(A,M){var Z=M[D5];Z===void 0&&(Z=M[D5]=new Set);var me=A+"__bubble";Z.has(me)||(O5(M,A,2,!1),Z.add(me))}function f8(A,M,Z){var me=0;M&&(me|=4),O5(Z,A,me,M)}var xx="_reactListening"+Math.random().toString(36).slice(2);function km(A){if(!A[xx]){A[xx]=!0,r.forEach(function(Z){Z!=="selectionchange"&&(mx.has(Z)||f8(Z,!1,A),f8(Z,!0,A))});var M=A.nodeType===9?A:A.ownerDocument;M===null||M[xx]||(M[xx]=!0,f8("selectionchange",!1,M))}}function O5(A,M,Z,me){switch(ps(M)){case 1:var Pe=Ar;break;case 4:Pe=Br;break;default:Pe=Vr}Z=Pe.bind(null,M,Z,A),Pe=void 0,!Kn||M!=="touchstart"&&M!=="touchmove"&&M!=="wheel"||(Pe=!0),me?Pe!==void 0?A.addEventListener(M,Z,{capture:!0,passive:Pe}):A.addEventListener(M,Z,!0):Pe!==void 0?A.addEventListener(M,Z,{passive:Pe}):A.addEventListener(M,Z,!1)}function h8(A,M,Z,me,Pe){var He=me;if(!(M&1)&&!(M&2)&&me!==null)e:for(;;){if(me===null)return;var St=me.tag;if(St===3||St===4){var hn=me.stateNode.containerInfo;if(hn===Pe||hn.nodeType===8&&hn.parentNode===Pe)break;if(St===4)for(St=me.return;St!==null;){var _n=St.tag;if((_n===3||_n===4)&&(_n=St.stateNode.containerInfo,_n===Pe||_n.nodeType===8&&_n.parentNode===Pe))return;St=St.return}for(;hn!==null;){if(St=th(hn),St===null)return;if(_n=St.tag,_n===5||_n===6){me=He=St;continue e}hn=hn.parentNode}}me=me.return}Gn(function(){var ar=He,Ur=mt(Z),Wr=[];e:{var $r=j2.get(A);if($r!==void 0){var ds=vt,Ns=A;switch(A){case"keypress":if(xr(Z)===0)break e;case"keydown":case"keyup":ds=ts;break;case"focusin":Ns="focus",ds=Qn;break;case"focusout":Ns="blur",ds=Qn;break;case"beforeblur":case"afterblur":ds=Qn;break;case"click":if(Z.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ds=Yr;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ds=Ir;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ds=Hn;break;case AT:case jT:case A2:ds=Xs;break;case mp:ds=os;break;case"scroll":ds=mn;break;case"wheel":ds=ms;break;case"copy":case"cut":case"paste":ds=Pr;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ds=At}var Ts=(M&4)!==0,Ao=!Ts&&A==="scroll",Zn=Ts?$r!==null?$r+"Capture":null:$r;Ts=[];for(var Ln=ar,nr;Ln!==null;){nr=Ln;var Xr=nr.stateNode;if(nr.tag===5&&Xr!==null&&(nr=Xr,Zn!==null&&(Xr=Dn(Ln,Zn),Xr!=null&&Ts.push(O1(Ln,Xr,nr)))),Ao)break;Ln=Ln.return}0<Ts.length&&($r=new ds($r,Ns,null,Z,Ur),Wr.push({event:$r,listeners:Ts}))}}if(!(M&7)){e:{if($r=A==="mouseover"||A==="pointerover",ds=A==="mouseout"||A==="pointerout",$r&&Z!==at&&(Ns=Z.relatedTarget||Z.fromElement)&&(th(Ns)||Ns[Uu]))break e;if((ds||$r)&&($r=Ur.window===Ur?Ur:($r=Ur.ownerDocument)?$r.defaultView||$r.parentWindow:window,ds?(Ns=Z.relatedTarget||Z.toElement,ds=ar,Ns=Ns?th(Ns):null,Ns!==null&&(Ao=tn(Ns),Ns!==Ao||Ns.tag!==5&&Ns.tag!==6)&&(Ns=null)):(ds=null,Ns=ar),ds!==Ns)){if(Ts=Yr,Xr="onMouseLeave",Zn="onMouseEnter",Ln="mouse",(A==="pointerout"||A==="pointerover")&&(Ts=At,Xr="onPointerLeave",Zn="onPointerEnter",Ln="pointer"),Ao=ds==null?$r:Ci(ds),nr=Ns==null?$r:Ci(Ns),$r=new Ts(Xr,Ln+"leave",ds,Z,Ur),$r.target=Ao,$r.relatedTarget=nr,Xr=null,th(Ur)===ar&&(Ts=new Ts(Zn,Ln+"enter",Ns,Z,Ur),Ts.target=nr,Ts.relatedTarget=Ao,Xr=Ts),Ao=Xr,ds&&Ns)t:{for(Ts=ds,Zn=Ns,Ln=0,nr=Ts;nr;nr=M1(nr))Ln++;for(nr=0,Xr=Zn;Xr;Xr=M1(Xr))nr++;for(;0<Ln-nr;)Ts=M1(Ts),Ln--;for(;0<nr-Ln;)Zn=M1(Zn),nr--;for(;Ln--;){if(Ts===Zn||Zn!==null&&Ts===Zn.alternate)break t;Ts=M1(Ts),Zn=M1(Zn)}Ts=null}else Ts=null;ds!==null&&qo(Wr,$r,ds,Ts,!1),Ns!==null&&Ao!==null&&qo(Wr,Ao,Ns,Ts,!0)}}e:{if($r=ar?Ci(ar):window,ds=$r.nodeName&&$r.nodeName.toLowerCase(),ds==="select"||ds==="input"&&$r.type==="file")var Is=$;else if(gi($r))if(H)Is=Ct;else{Is=_t;var zs=pt}else(ds=$r.nodeName)&&ds.toLowerCase()==="input"&&($r.type==="checkbox"||$r.type==="radio")&&(Is=Jt);if(Is&&(Is=Is(A,ar))){yd(Wr,Is,Z,Ur);break e}zs&&zs(A,$r,ar),A==="focusout"&&(zs=$r._wrapperState)&&zs.controlled&&$r.type==="number"&&It($r,"number",$r.value)}switch(zs=ar?Ci(ar):window,A){case"focusin":(gi(zs)||zs.contentEditable==="true")&&(Ja=zs,da=ar,_a=null);break;case"focusout":_a=da=Ja=null;break;case"mousedown":Wo=!0;break;case"contextmenu":case"mouseup":case"dragend":Wo=!1,vd(Wr,Z,Ur);break;case"selectionchange":if(Za)break;case"keydown":case"keyup":vd(Wr,Z,Ur)}var Hs;if($i)e:{switch(A){case"compositionstart":var Ys="onCompositionStart";break e;case"compositionend":Ys="onCompositionEnd";break e;case"compositionupdate":Ys="onCompositionUpdate";break e}Ys=void 0}else ba?_l(A,Z)&&(Ys="onCompositionEnd"):A==="keydown"&&Z.keyCode===229&&(Ys="onCompositionStart");Ys&&(Tr&&Z.locale!=="ko"&&(ba||Ys!=="onCompositionStart"?Ys==="onCompositionEnd"&&ba&&(Hs=Es()):(gr=Ur,es="value"in gr?gr.value:gr.textContent,ba=!0)),zs=M5(ar,Ys),0<zs.length&&(Ys=new Mn(Ys,A,null,Z,Ur),Wr.push({event:Ys,listeners:zs}),Hs?Ys.data=Hs:(Hs=Bu(Z),Hs!==null&&(Ys.data=Hs)))),(Hs=bs?kl(A,Z):px(A,Z))&&(ar=M5(ar,"onBeforeInput"),0<ar.length&&(Ur=new Mn("onBeforeInput","beforeinput",null,Z,Ur),Wr.push({event:Ur,listeners:ar}),Ur.data=Hs))}_T(Wr,M)})}function O1(A,M,Z){return{instance:A,listener:M,currentTarget:Z}}function M5(A,M){for(var Z=M+"Capture",me=[];A!==null;){var Pe=A,He=Pe.stateNode;Pe.tag===5&&He!==null&&(Pe=He,He=Dn(A,Z),He!=null&&me.unshift(O1(A,He,Pe)),He=Dn(A,M),He!=null&&me.push(O1(A,He,Pe))),A=A.return}return me}function M1(A){if(A===null)return null;do A=A.return;while(A&&A.tag!==5);return A||null}function qo(A,M,Z,me,Pe){for(var He=M._reactName,St=[];Z!==null&&Z!==me;){var hn=Z,_n=hn.alternate,ar=hn.stateNode;if(_n!==null&&_n===me)break;hn.tag===5&&ar!==null&&(hn=ar,Pe?(_n=Dn(Z,He),_n!=null&&St.unshift(O1(Z,_n,hn))):Pe||(_n=Dn(Z,He),_n!=null&&St.push(O1(Z,_n,hn)))),Z=Z.return}St.length!==0&&A.push({event:M,listeners:St})}var fc=/\r\n?/g,TU=/\u0000|\uFFFD/g;function kT(A){return(typeof A=="string"?A:""+A).replace(fc,`
`).replace(TU,"")}function _2(A,M,Z){if(M=kT(M),kT(A)!==M&&Z)throw Error(n(425))}function R5(){}var k2=null,gx=null;function T2(A,M){return A==="textarea"||A==="noscript"||typeof M.children=="string"||typeof M.children=="number"||typeof M.dangerouslySetInnerHTML=="object"&&M.dangerouslySetInnerHTML!==null&&M.dangerouslySetInnerHTML.__html!=null}var Tm=typeof setTimeout=="function"?setTimeout:void 0,I2=typeof clearTimeout=="function"?clearTimeout:void 0,R1=typeof Promise=="function"?Promise:void 0,L5=typeof queueMicrotask=="function"?queueMicrotask:typeof R1<"u"?function(A){return R1.resolve(null).then(A).catch(L1)}:Tm;function L1(A){setTimeout(function(){throw A})}function p8(A,M){var Z=M,me=0;do{var Pe=Z.nextSibling;if(A.removeChild(Z),Pe&&Pe.nodeType===8)if(Z=Pe.data,Z==="/$"){if(me===0){A.removeChild(Pe),yt(M);return}me--}else Z!=="$"&&Z!=="$?"&&Z!=="$!"||me++;Z=Pe}while(Z);yt(M)}function Im(A){for(;A!=null;A=A.nextSibling){var M=A.nodeType;if(M===1||M===3)break;if(M===8){if(M=A.data,M==="$"||M==="$!"||M==="$?")break;if(M==="/$")return null}}return A}function TT(A){A=A.previousSibling;for(var M=0;A;){if(A.nodeType===8){var Z=A.data;if(Z==="$"||Z==="$!"||Z==="$?"){if(M===0)return A;M--}else Z==="/$"&&M++}A=A.previousSibling}return null}var D1=Math.random().toString(36).slice(2),eh="__reactFiber$"+D1,Pm="__reactProps$"+D1,Uu="__reactContainer$"+D1,D5="__reactEvents$"+D1,Ot="__reactListeners$"+D1,B1="__reactHandles$"+D1;function th(A){var M=A[eh];if(M)return M;for(var Z=A.parentNode;Z;){if(M=Z[Uu]||Z[eh]){if(Z=M.alternate,M.child!==null||Z!==null&&Z.child!==null)for(A=TT(A);A!==null;){if(Z=A[eh])return Z;A=TT(A)}return M}A=Z,Z=A.parentNode}return null}function hc(A){return A=A[eh]||A[Uu],!A||A.tag!==5&&A.tag!==6&&A.tag!==13&&A.tag!==3?null:A}function Ci(A){if(A.tag===5||A.tag===6)return A.stateNode;throw Error(n(33))}function B5(A){return A[Pm]||null}var m8=[],$1=-1;function lu(A){return{current:A}}function qa(A){0>$1||(A.current=m8[$1],m8[$1]=null,$1--)}function $a(A,M){$1++,m8[$1]=A.current,A.current=M}var Fm={},pc=lu(Fm),cu=lu(!1),Dc=Fm;function U1(A,M){var Z=A.type.contextTypes;if(!Z)return Fm;var me=A.stateNode;if(me&&me.__reactInternalMemoizedUnmaskedChildContext===M)return me.__reactInternalMemoizedMaskedChildContext;var Pe={},He;for(He in Z)Pe[He]=M[He];return me&&(A=A.stateNode,A.__reactInternalMemoizedUnmaskedChildContext=M,A.__reactInternalMemoizedMaskedChildContext=Pe),Pe}function uu(A){return A=A.childContextTypes,A!=null}function $5(){qa(cu),qa(pc)}function IT(A,M,Z){if(pc.current!==Fm)throw Error(n(168));$a(pc,M),$a(cu,Z)}function PT(A,M,Z){var me=A.stateNode;if(M=M.childContextTypes,typeof me.getChildContext!="function")return Z;me=me.getChildContext();for(var Pe in me)if(!(Pe in M))throw Error(n(108,ve(A)||"Unknown",Pe));return ee({},Z,me)}function wd(A){return A=(A=A.stateNode)&&A.__reactInternalMemoizedMergedChildContext||Fm,Dc=pc.current,$a(pc,A),$a(cu,cu.current),!0}function FT(A,M,Z){var me=A.stateNode;if(!me)throw Error(n(169));Z?(A=PT(A,M,Dc),me.__reactInternalMemoizedMergedChildContext=A,qa(cu),qa(pc),$a(pc,A)):qa(cu),$a(cu,Z)}var gp=null,U5=!1,x8=!1;function OT(A){gp===null?gp=[A]:gp.push(A)}function bx(A){U5=!0,OT(A)}function Om(){if(!x8&&gp!==null){x8=!0;var A=0,M=gt;try{var Z=gp;for(gt=1;A<Z.length;A++){var me=Z[A];do me=me(!0);while(me!==null)}gp=null,U5=!1}catch(Pe){throw gp!==null&&(gp=gp.slice(A+1)),zn(p,Om),Pe}finally{gt=M,x8=!1}}return null}var z1=[],mc=0,z5=null,H5=0,Cd=[],Sd=0,yx=null,nh=1,rh="";function vx(A,M){z1[mc++]=H5,z1[mc++]=z5,z5=A,H5=M}function MT(A,M,Z){Cd[Sd++]=nh,Cd[Sd++]=rh,Cd[Sd++]=yx,yx=A;var me=nh;A=rh;var Pe=32-ue(me)-1;me&=~(1<<Pe),Z+=1;var He=32-ue(M)+Pe;if(30<He){var St=Pe-Pe%5;He=(me&(1<<St)-1).toString(32),me>>=St,Pe-=St,nh=1<<32-ue(M)+Pe|Z<<Pe|me,rh=He+A}else nh=1<<He|Z<<Pe|me,rh=A}function P2(A){A.return!==null&&(vx(A,1),MT(A,1,0))}function wx(A){for(;A===z5;)z5=z1[--mc],z1[mc]=null,H5=z1[--mc],z1[mc]=null;for(;A===yx;)yx=Cd[--Sd],Cd[Sd]=null,rh=Cd[--Sd],Cd[Sd]=null,nh=Cd[--Sd],Cd[Sd]=null}var xc=null,zu=null,Ga=!1,pf=null;function sh(A,M){var Z=Td(5,null,null,0);Z.elementType="DELETED",Z.stateNode=M,Z.return=A,M=A.deletions,M===null?(A.deletions=[Z],A.flags|=16):M.push(Z)}function V5(A,M){switch(A.tag){case 5:var Z=A.type;return M=M.nodeType!==1||Z.toLowerCase()!==M.nodeName.toLowerCase()?null:M,M!==null?(A.stateNode=M,xc=A,zu=Im(M.firstChild),!0):!1;case 6:return M=A.pendingProps===""||M.nodeType!==3?null:M,M!==null?(A.stateNode=M,xc=A,zu=null,!0):!1;case 13:return M=M.nodeType!==8?null:M,M!==null?(Z=yx!==null?{id:nh,overflow:rh}:null,A.memoizedState={dehydrated:M,treeContext:Z,retryLane:1073741824},Z=Td(18,null,null,0),Z.stateNode=M,Z.return=A,A.child=Z,xc=A,zu=null,!0):!1;default:return!1}}function bp(A){return(A.mode&1)!==0&&(A.flags&128)===0}function du(A){if(Ga){var M=zu;if(M){var Z=M;if(!V5(A,M)){if(bp(A))throw Error(n(418));M=Im(Z.nextSibling);var me=xc;M&&V5(A,M)?sh(me,Z):(A.flags=A.flags&-4097|2,Ga=!1,xc=A)}}else{if(bp(A))throw Error(n(418));A.flags=A.flags&-4097|2,Ga=!1,xc=A}}}function RT(A){for(A=A.return;A!==null&&A.tag!==5&&A.tag!==3&&A.tag!==13;)A=A.return;xc=A}function F2(A){if(A!==xc)return!1;if(!Ga)return RT(A),Ga=!0,!1;var M;if((M=A.tag!==3)&&!(M=A.tag!==5)&&(M=A.type,M=M!=="head"&&M!=="body"&&!T2(A.type,A.memoizedProps)),M&&(M=zu)){if(bp(A))throw g8(),Error(n(418));for(;M;)sh(A,M),M=Im(M.nextSibling)}if(RT(A),A.tag===13){if(A=A.memoizedState,A=A!==null?A.dehydrated:null,!A)throw Error(n(317));e:{for(A=A.nextSibling,M=0;A;){if(A.nodeType===8){var Z=A.data;if(Z==="/$"){if(M===0){zu=Im(A.nextSibling);break e}M--}else Z!=="$"&&Z!=="$!"&&Z!=="$?"||M++}A=A.nextSibling}zu=null}}else zu=xc?Im(A.stateNode.nextSibling):null;return!0}function g8(){for(var A=zu;A;)A=Im(A.nextSibling)}function ih(){zu=xc=null,Ga=!1}function ah(A){pf===null?pf=[A]:pf.push(A)}var LT=R.ReactCurrentBatchConfig;function O2(A,M,Z){if(A=Z.ref,A!==null&&typeof A!="function"&&typeof A!="object"){if(Z._owner){if(Z=Z._owner,Z){if(Z.tag!==1)throw Error(n(309));var me=Z.stateNode}if(!me)throw Error(n(147,A));var Pe=me,He=""+A;return M!==null&&M.ref!==null&&typeof M.ref=="function"&&M.ref._stringRef===He?M.ref:(M=function(St){var hn=Pe.refs;St===null?delete hn[He]:hn[He]=St},M._stringRef=He,M)}if(typeof A!="string")throw Error(n(284));if(!Z._owner)throw Error(n(290,A))}return A}function Cx(A,M){throw A=Object.prototype.toString.call(M),Error(n(31,A==="[object Object]"?"object with keys {"+Object.keys(M).join(", ")+"}":A))}function DT(A){var M=A._init;return M(A._payload)}function b8(A){function M(Zn,Ln){if(A){var nr=Zn.deletions;nr===null?(Zn.deletions=[Ln],Zn.flags|=16):nr.push(Ln)}}function Z(Zn,Ln){if(!A)return null;for(;Ln!==null;)M(Zn,Ln),Ln=Ln.sibling;return null}function me(Zn,Ln){for(Zn=new Map;Ln!==null;)Ln.key!==null?Zn.set(Ln.key,Ln):Zn.set(Ln.index,Ln),Ln=Ln.sibling;return Zn}function Pe(Zn,Ln){return Zn=wf(Zn,Ln),Zn.index=0,Zn.sibling=null,Zn}function He(Zn,Ln,nr){return Zn.index=nr,A?(nr=Zn.alternate,nr!==null?(nr=nr.index,nr<Ln?(Zn.flags|=2,Ln):nr):(Zn.flags|=2,Ln)):(Zn.flags|=1048576,Ln)}function St(Zn){return A&&Zn.alternate===null&&(Zn.flags|=2),Zn}function hn(Zn,Ln,nr,Xr){return Ln===null||Ln.tag!==6?(Ln=s7(nr,Zn.mode,Xr),Ln.return=Zn,Ln):(Ln=Pe(Ln,nr),Ln.return=Zn,Ln)}function _n(Zn,Ln,nr,Xr){var Is=nr.type;return Is===L?Ur(Zn,Ln,nr.props.children,Xr,nr.key):Ln!==null&&(Ln.elementType===Is||typeof Is=="object"&&Is!==null&&Is.$$typeof===ie&&DT(Is)===Ln.type)?(Xr=Pe(Ln,nr.props),Xr.ref=O2(Zn,Ln,nr),Xr.return=Zn,Xr):(Xr=A6(nr.type,nr.key,nr.props,null,Zn.mode,Xr),Xr.ref=O2(Zn,Ln,nr),Xr.return=Zn,Xr)}function ar(Zn,Ln,nr,Xr){return Ln===null||Ln.tag!==4||Ln.stateNode.containerInfo!==nr.containerInfo||Ln.stateNode.implementation!==nr.implementation?(Ln=i7(nr,Zn.mode,Xr),Ln.return=Zn,Ln):(Ln=Pe(Ln,nr.children||[]),Ln.return=Zn,Ln)}function Ur(Zn,Ln,nr,Xr,Is){return Ln===null||Ln.tag!==7?(Ln=Fx(nr,Zn.mode,Xr,Is),Ln.return=Zn,Ln):(Ln=Pe(Ln,nr),Ln.return=Zn,Ln)}function Wr(Zn,Ln,nr){if(typeof Ln=="string"&&Ln!==""||typeof Ln=="number")return Ln=s7(""+Ln,Zn.mode,nr),Ln.return=Zn,Ln;if(typeof Ln=="object"&&Ln!==null){switch(Ln.$$typeof){case F:return nr=A6(Ln.type,Ln.key,Ln.props,null,Zn.mode,nr),nr.ref=O2(Zn,null,Ln),nr.return=Zn,nr;case U:return Ln=i7(Ln,Zn.mode,nr),Ln.return=Zn,Ln;case ie:var Xr=Ln._init;return Wr(Zn,Xr(Ln._payload),nr)}if(nn(Ln)||V(Ln))return Ln=Fx(Ln,Zn.mode,nr,null),Ln.return=Zn,Ln;Cx(Zn,Ln)}return null}function $r(Zn,Ln,nr,Xr){var Is=Ln!==null?Ln.key:null;if(typeof nr=="string"&&nr!==""||typeof nr=="number")return Is!==null?null:hn(Zn,Ln,""+nr,Xr);if(typeof nr=="object"&&nr!==null){switch(nr.$$typeof){case F:return nr.key===Is?_n(Zn,Ln,nr,Xr):null;case U:return nr.key===Is?ar(Zn,Ln,nr,Xr):null;case ie:return Is=nr._init,$r(Zn,Ln,Is(nr._payload),Xr)}if(nn(nr)||V(nr))return Is!==null?null:Ur(Zn,Ln,nr,Xr,null);Cx(Zn,nr)}return null}function ds(Zn,Ln,nr,Xr,Is){if(typeof Xr=="string"&&Xr!==""||typeof Xr=="number")return Zn=Zn.get(nr)||null,hn(Ln,Zn,""+Xr,Is);if(typeof Xr=="object"&&Xr!==null){switch(Xr.$$typeof){case F:return Zn=Zn.get(Xr.key===null?nr:Xr.key)||null,_n(Ln,Zn,Xr,Is);case U:return Zn=Zn.get(Xr.key===null?nr:Xr.key)||null,ar(Ln,Zn,Xr,Is);case ie:var zs=Xr._init;return ds(Zn,Ln,nr,zs(Xr._payload),Is)}if(nn(Xr)||V(Xr))return Zn=Zn.get(nr)||null,Ur(Ln,Zn,Xr,Is,null);Cx(Ln,Xr)}return null}function Ns(Zn,Ln,nr,Xr){for(var Is=null,zs=null,Hs=Ln,Ys=Ln=0,ul=null;Hs!==null&&Ys<nr.length;Ys++){Hs.index>Ys?(ul=Hs,Hs=null):ul=Hs.sibling;var ia=$r(Zn,Hs,nr[Ys],Xr);if(ia===null){Hs===null&&(Hs=ul);break}A&&Hs&&ia.alternate===null&&M(Zn,Hs),Ln=He(ia,Ln,Ys),zs===null?Is=ia:zs.sibling=ia,zs=ia,Hs=ul}if(Ys===nr.length)return Z(Zn,Hs),Ga&&vx(Zn,Ys),Is;if(Hs===null){for(;Ys<nr.length;Ys++)Hs=Wr(Zn,nr[Ys],Xr),Hs!==null&&(Ln=He(Hs,Ln,Ys),zs===null?Is=Hs:zs.sibling=Hs,zs=Hs);return Ga&&vx(Zn,Ys),Is}for(Hs=me(Zn,Hs);Ys<nr.length;Ys++)ul=ds(Hs,Zn,Ys,nr[Ys],Xr),ul!==null&&(A&&ul.alternate!==null&&Hs.delete(ul.key===null?Ys:ul.key),Ln=He(ul,Ln,Ys),zs===null?Is=ul:zs.sibling=ul,zs=ul);return A&&Hs.forEach(function(qm){return M(Zn,qm)}),Ga&&vx(Zn,Ys),Is}function Ts(Zn,Ln,nr,Xr){var Is=V(nr);if(typeof Is!="function")throw Error(n(150));if(nr=Is.call(nr),nr==null)throw Error(n(151));for(var zs=Is=null,Hs=Ln,Ys=Ln=0,ul=null,ia=nr.next();Hs!==null&&!ia.done;Ys++,ia=nr.next()){Hs.index>Ys?(ul=Hs,Hs=null):ul=Hs.sibling;var qm=$r(Zn,Hs,ia.value,Xr);if(qm===null){Hs===null&&(Hs=ul);break}A&&Hs&&qm.alternate===null&&M(Zn,Hs),Ln=He(qm,Ln,Ys),zs===null?Is=qm:zs.sibling=qm,zs=qm,Hs=ul}if(ia.done)return Z(Zn,Hs),Ga&&vx(Zn,Ys),Is;if(Hs===null){for(;!ia.done;Ys++,ia=nr.next())ia=Wr(Zn,ia.value,Xr),ia!==null&&(Ln=He(ia,Ln,Ys),zs===null?Is=ia:zs.sibling=ia,zs=ia);return Ga&&vx(Zn,Ys),Is}for(Hs=me(Zn,Hs);!ia.done;Ys++,ia=nr.next())ia=ds(Hs,Zn,Ys,ia.value,Xr),ia!==null&&(A&&ia.alternate!==null&&Hs.delete(ia.key===null?Ys:ia.key),Ln=He(ia,Ln,Ys),zs===null?Is=ia:zs.sibling=ia,zs=ia);return A&&Hs.forEach(function(YU){return M(Zn,YU)}),Ga&&vx(Zn,Ys),Is}function Ao(Zn,Ln,nr,Xr){if(typeof nr=="object"&&nr!==null&&nr.type===L&&nr.key===null&&(nr=nr.props.children),typeof nr=="object"&&nr!==null){switch(nr.$$typeof){case F:e:{for(var Is=nr.key,zs=Ln;zs!==null;){if(zs.key===Is){if(Is=nr.type,Is===L){if(zs.tag===7){Z(Zn,zs.sibling),Ln=Pe(zs,nr.props.children),Ln.return=Zn,Zn=Ln;break e}}else if(zs.elementType===Is||typeof Is=="object"&&Is!==null&&Is.$$typeof===ie&&DT(Is)===zs.type){Z(Zn,zs.sibling),Ln=Pe(zs,nr.props),Ln.ref=O2(Zn,zs,nr),Ln.return=Zn,Zn=Ln;break e}Z(Zn,zs);break}else M(Zn,zs);zs=zs.sibling}nr.type===L?(Ln=Fx(nr.props.children,Zn.mode,Xr,nr.key),Ln.return=Zn,Zn=Ln):(Xr=A6(nr.type,nr.key,nr.props,null,Zn.mode,Xr),Xr.ref=O2(Zn,Ln,nr),Xr.return=Zn,Zn=Xr)}return St(Zn);case U:e:{for(zs=nr.key;Ln!==null;){if(Ln.key===zs)if(Ln.tag===4&&Ln.stateNode.containerInfo===nr.containerInfo&&Ln.stateNode.implementation===nr.implementation){Z(Zn,Ln.sibling),Ln=Pe(Ln,nr.children||[]),Ln.return=Zn,Zn=Ln;break e}else{Z(Zn,Ln);break}else M(Zn,Ln);Ln=Ln.sibling}Ln=i7(nr,Zn.mode,Xr),Ln.return=Zn,Zn=Ln}return St(Zn);case ie:return zs=nr._init,Ao(Zn,Ln,zs(nr._payload),Xr)}if(nn(nr))return Ns(Zn,Ln,nr,Xr);if(V(nr))return Ts(Zn,Ln,nr,Xr);Cx(Zn,nr)}return typeof nr=="string"&&nr!==""||typeof nr=="number"?(nr=""+nr,Ln!==null&&Ln.tag===6?(Z(Zn,Ln.sibling),Ln=Pe(Ln,nr),Ln.return=Zn,Zn=Ln):(Z(Zn,Ln),Ln=s7(nr,Zn.mode,Xr),Ln.return=Zn,Zn=Ln),St(Zn)):Z(Zn,Ln)}return Ao}var No=b8(!0),W5=b8(!1),M2=lu(null),Hu=null,Mm=null,H1=null;function yp(){H1=Mm=Hu=null}function q5(A){var M=M2.current;qa(M2),A._currentValue=M}function ql(A,M,Z){for(;A!==null;){var me=A.alternate;if((A.childLanes&M)!==M?(A.childLanes|=M,me!==null&&(me.childLanes|=M)):me!==null&&(me.childLanes&M)!==M&&(me.childLanes|=M),A===Z)break;A=A.return}}function Rm(A,M){Hu=A,H1=Mm=null,A=A.dependencies,A!==null&&A.firstContext!==null&&(A.lanes&M&&($c=!0),A.firstContext=null)}function Nd(A){var M=A._currentValue;if(H1!==A)if(A={context:A,memoizedValue:M,next:null},Mm===null){if(Hu===null)throw Error(n(308));Mm=A,Hu.dependencies={lanes:0,firstContext:A}}else Mm=Mm.next=A;return M}var Sx=null;function y8(A){Sx===null?Sx=[A]:Sx.push(A)}function G5(A,M,Z,me){var Pe=M.interleaved;return Pe===null?(Z.next=Z,y8(M)):(Z.next=Pe.next,Pe.next=Z),M.interleaved=Z,vp(A,me)}function vp(A,M){A.lanes|=M;var Z=A.alternate;for(Z!==null&&(Z.lanes|=M),Z=A,A=A.return;A!==null;)A.childLanes|=M,Z=A.alternate,Z!==null&&(Z.childLanes|=M),Z=A,A=A.return;return Z.tag===3?Z.stateNode:null}var Ad=!1;function K5(A){A.updateQueue={baseState:A.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function BT(A,M){A=A.updateQueue,M.updateQueue===A&&(M.updateQueue={baseState:A.baseState,firstBaseUpdate:A.firstBaseUpdate,lastBaseUpdate:A.lastBaseUpdate,shared:A.shared,effects:A.effects})}function wp(A,M){return{eventTime:A,lane:M,tag:0,payload:null,callback:null,next:null}}function jd(A,M,Z){var me=A.updateQueue;if(me===null)return null;if(me=me.shared,Yi&2){var Pe=me.pending;return Pe===null?M.next=M:(M.next=Pe.next,Pe.next=M),me.pending=M,vp(A,Z)}return Pe=me.interleaved,Pe===null?(M.next=M,y8(me)):(M.next=Pe.next,Pe.next=M),me.interleaved=M,vp(A,Z)}function Y5(A,M,Z){if(M=M.updateQueue,M!==null&&(M=M.shared,(Z&4194240)!==0)){var me=M.lanes;me&=A.pendingLanes,Z|=me,M.lanes=Z,ct(A,Z)}}function $T(A,M){var Z=A.updateQueue,me=A.alternate;if(me!==null&&(me=me.updateQueue,Z===me)){var Pe=null,He=null;if(Z=Z.firstBaseUpdate,Z!==null){do{var St={eventTime:Z.eventTime,lane:Z.lane,tag:Z.tag,payload:Z.payload,callback:Z.callback,next:null};He===null?Pe=He=St:He=He.next=St,Z=Z.next}while(Z!==null);He===null?Pe=He=M:He=He.next=M}else Pe=He=M;Z={baseState:me.baseState,firstBaseUpdate:Pe,lastBaseUpdate:He,shared:me.shared,effects:me.effects},A.updateQueue=Z;return}A=Z.lastBaseUpdate,A===null?Z.firstBaseUpdate=M:A.next=M,Z.lastBaseUpdate=M}function V1(A,M,Z,me){var Pe=A.updateQueue;Ad=!1;var He=Pe.firstBaseUpdate,St=Pe.lastBaseUpdate,hn=Pe.shared.pending;if(hn!==null){Pe.shared.pending=null;var _n=hn,ar=_n.next;_n.next=null,St===null?He=ar:St.next=ar,St=_n;var Ur=A.alternate;Ur!==null&&(Ur=Ur.updateQueue,hn=Ur.lastBaseUpdate,hn!==St&&(hn===null?Ur.firstBaseUpdate=ar:hn.next=ar,Ur.lastBaseUpdate=_n))}if(He!==null){var Wr=Pe.baseState;St=0,Ur=ar=_n=null,hn=He;do{var $r=hn.lane,ds=hn.eventTime;if((me&$r)===$r){Ur!==null&&(Ur=Ur.next={eventTime:ds,lane:0,tag:hn.tag,payload:hn.payload,callback:hn.callback,next:null});e:{var Ns=A,Ts=hn;switch($r=M,ds=Z,Ts.tag){case 1:if(Ns=Ts.payload,typeof Ns=="function"){Wr=Ns.call(ds,Wr,$r);break e}Wr=Ns;break e;case 3:Ns.flags=Ns.flags&-65537|128;case 0:if(Ns=Ts.payload,$r=typeof Ns=="function"?Ns.call(ds,Wr,$r):Ns,$r==null)break e;Wr=ee({},Wr,$r);break e;case 2:Ad=!0}}hn.callback!==null&&hn.lane!==0&&(A.flags|=64,$r=Pe.effects,$r===null?Pe.effects=[hn]:$r.push(hn))}else ds={eventTime:ds,lane:$r,tag:hn.tag,payload:hn.payload,callback:hn.callback,next:null},Ur===null?(ar=Ur=ds,_n=Wr):Ur=Ur.next=ds,St|=$r;if(hn=hn.next,hn===null){if(hn=Pe.shared.pending,hn===null)break;$r=hn,hn=$r.next,$r.next=null,Pe.lastBaseUpdate=$r,Pe.shared.pending=null}}while(!0);if(Ur===null&&(_n=Wr),Pe.baseState=_n,Pe.firstBaseUpdate=ar,Pe.lastBaseUpdate=Ur,M=Pe.shared.interleaved,M!==null){Pe=M;do St|=Pe.lane,Pe=Pe.next;while(Pe!==M)}else He===null&&(Pe.shared.lanes=0);Um|=St,A.lanes=St,A.memoizedState=Wr}}function v8(A,M,Z){if(A=M.effects,M.effects=null,A!==null)for(M=0;M<A.length;M++){var me=A[M],Pe=me.callback;if(Pe!==null){if(me.callback=null,me=Z,typeof Pe!="function")throw Error(n(191,Pe));Pe.call(me)}}}var R2={},oh=lu(R2),L2=lu(R2),W1=lu(R2);function Cp(A){if(A===R2)throw Error(n(174));return A}function w8(A,M){switch($a(W1,M),$a(L2,A),$a(oh,R2),A=M.nodeType,A){case 9:case 11:M=(M=M.documentElement)?M.namespaceURI:$t(null,"");break;default:A=A===8?M.parentNode:M,M=A.namespaceURI||null,A=A.tagName,M=$t(M,A)}qa(oh),$a(oh,M)}function Lm(){qa(oh),qa(L2),qa(W1)}function C8(A){Cp(W1.current);var M=Cp(oh.current),Z=$t(M,A.type);M!==Z&&($a(L2,A),$a(oh,Z))}function X5(A){L2.current===A&&(qa(oh),qa(L2))}var eo=lu(0);function Nx(A){for(var M=A;M!==null;){if(M.tag===13){var Z=M.memoizedState;if(Z!==null&&(Z=Z.dehydrated,Z===null||Z.data==="$?"||Z.data==="$!"))return M}else if(M.tag===19&&M.memoizedProps.revealOrder!==void 0){if(M.flags&128)return M}else if(M.child!==null){M.child.return=M,M=M.child;continue}if(M===A)break;for(;M.sibling===null;){if(M.return===null||M.return===A)return null;M=M.return}M.sibling.return=M.return,M=M.sibling}return null}var S8=[];function Q5(){for(var A=0;A<S8.length;A++)S8[A]._workInProgressVersionPrimary=null;S8.length=0}var D2=R.ReactCurrentDispatcher,N8=R.ReactCurrentBatchConfig,Dm=0,fo=null,Lo=null,ll=null,q1=!1,B2=!1,Ax=0,Fi=0;function gc(){throw Error(n(321))}function A8(A,M){if(M===null)return!1;for(var Z=0;Z<M.length&&Z<A.length;Z++)if(!Kt(A[Z],M[Z]))return!1;return!0}function jx(A,M,Z,me,Pe,He){if(Dm=He,fo=M,M.memoizedState=null,M.updateQueue=null,M.lanes=0,D2.current=A===null||A.memoizedState===null?PU:s6,A=Z(me,Pe),B2){He=0;do{if(B2=!1,Ax=0,25<=He)throw Error(n(301));He+=1,ll=Lo=null,M.updateQueue=null,D2.current=X1,A=Z(me,Pe)}while(B2)}if(D2.current=r6,M=Lo!==null&&Lo.next!==null,Dm=0,ll=Lo=fo=null,q1=!1,M)throw Error(n(300));return A}function Z5(){var A=Ax!==0;return Ax=0,A}function lh(){var A={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ll===null?fo.memoizedState=ll=A:ll=ll.next=A,ll}function Ed(){if(Lo===null){var A=fo.alternate;A=A!==null?A.memoizedState:null}else A=Lo.next;var M=ll===null?fo.memoizedState:ll.next;if(M!==null)ll=M,Lo=A;else{if(A===null)throw Error(n(310));Lo=A,A={memoizedState:Lo.memoizedState,baseState:Lo.baseState,baseQueue:Lo.baseQueue,queue:Lo.queue,next:null},ll===null?fo.memoizedState=ll=A:ll=ll.next=A}return ll}function bc(A,M){return typeof M=="function"?M(A):M}function j8(A){var M=Ed(),Z=M.queue;if(Z===null)throw Error(n(311));Z.lastRenderedReducer=A;var me=Lo,Pe=me.baseQueue,He=Z.pending;if(He!==null){if(Pe!==null){var St=Pe.next;Pe.next=He.next,He.next=St}me.baseQueue=Pe=He,Z.pending=null}if(Pe!==null){He=Pe.next,me=me.baseState;var hn=St=null,_n=null,ar=He;do{var Ur=ar.lane;if((Dm&Ur)===Ur)_n!==null&&(_n=_n.next={lane:0,action:ar.action,hasEagerState:ar.hasEagerState,eagerState:ar.eagerState,next:null}),me=ar.hasEagerState?ar.eagerState:A(me,ar.action);else{var Wr={lane:Ur,action:ar.action,hasEagerState:ar.hasEagerState,eagerState:ar.eagerState,next:null};_n===null?(hn=_n=Wr,St=me):_n=_n.next=Wr,fo.lanes|=Ur,Um|=Ur}ar=ar.next}while(ar!==null&&ar!==He);_n===null?St=me:_n.next=hn,Kt(me,M.memoizedState)||($c=!0),M.memoizedState=me,M.baseState=St,M.baseQueue=_n,Z.lastRenderedState=me}if(A=Z.interleaved,A!==null){Pe=A;do He=Pe.lane,fo.lanes|=He,Um|=He,Pe=Pe.next;while(Pe!==A)}else Pe===null&&(Z.lanes=0);return[M.memoizedState,Z.dispatch]}function G1(A){var M=Ed(),Z=M.queue;if(Z===null)throw Error(n(311));Z.lastRenderedReducer=A;var me=Z.dispatch,Pe=Z.pending,He=M.memoizedState;if(Pe!==null){Z.pending=null;var St=Pe=Pe.next;do He=A(He,St.action),St=St.next;while(St!==Pe);Kt(He,M.memoizedState)||($c=!0),M.memoizedState=He,M.baseQueue===null&&(M.baseState=He),Z.lastRenderedState=He}return[He,me]}function J5(){}function E8(A,M){var Z=fo,me=Ed(),Pe=M(),He=!Kt(me.memoizedState,Pe);if(He&&(me.memoizedState=Pe,$c=!0),me=me.queue,ch(Sp.bind(null,Z,me,A),[A]),me.getSnapshot!==M||He||ll!==null&&ll.memoizedState.tag&1){if(Z.flags|=2048,K1(9,fu.bind(null,Z,me,Pe,M),void 0,null),Il===null)throw Error(n(349));Dm&30||_8(Z,M,Pe)}return Pe}function _8(A,M,Z){A.flags|=16384,A={getSnapshot:M,value:Z},M=fo.updateQueue,M===null?(M={lastEffect:null,stores:null},fo.updateQueue=M,M.stores=[A]):(Z=M.stores,Z===null?M.stores=[A]:Z.push(A))}function fu(A,M,Z,me){M.value=Z,M.getSnapshot=me,e6(M)&&k8(A)}function Sp(A,M,Z){return Z(function(){e6(M)&&k8(A)})}function e6(A){var M=A.getSnapshot;A=A.value;try{var Z=M();return!Kt(A,Z)}catch{return!0}}function k8(A){var M=vp(A,1);M!==null&&vf(M,A,1,-1)}function $2(A){var M=lh();return typeof A=="function"&&(A=A()),M.memoizedState=M.baseState=A,A={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:bc,lastRenderedState:A},M.queue=A,A=A.dispatch=qT.bind(null,fo,A),[M.memoizedState,A]}function K1(A,M,Z,me){return A={tag:A,create:M,destroy:Z,deps:me,next:null},M=fo.updateQueue,M===null?(M={lastEffect:null,stores:null},fo.updateQueue=M,M.lastEffect=A.next=A):(Z=M.lastEffect,Z===null?M.lastEffect=A.next=A:(me=Z.next,Z.next=A,A.next=me,M.lastEffect=A)),A}function t6(){return Ed().memoizedState}function U2(A,M,Z,me){var Pe=lh();fo.flags|=A,Pe.memoizedState=K1(1|M,Z,void 0,me===void 0?null:me)}function Y1(A,M,Z,me){var Pe=Ed();me=me===void 0?null:me;var He=void 0;if(Lo!==null){var St=Lo.memoizedState;if(He=St.destroy,me!==null&&A8(me,St.deps)){Pe.memoizedState=K1(M,Z,He,me);return}}fo.flags|=A,Pe.memoizedState=K1(1|M,Z,He,me)}function n6(A,M){return U2(8390656,8,A,M)}function ch(A,M){return Y1(2048,8,A,M)}function UT(A,M){return Y1(4,2,A,M)}function Np(A,M){return Y1(4,4,A,M)}function T8(A,M){if(typeof M=="function")return A=A(),M(A),function(){M(null)};if(M!=null)return A=A(),M.current=A,function(){M.current=null}}function I8(A,M,Z){return Z=Z!=null?Z.concat([A]):null,Y1(4,4,T8.bind(null,M,A),Z)}function z2(){}function zT(A,M){var Z=Ed();M=M===void 0?null:M;var me=Z.memoizedState;return me!==null&&M!==null&&A8(M,me[1])?me[0]:(Z.memoizedState=[A,M],A)}function HT(A,M){var Z=Ed();M=M===void 0?null:M;var me=Z.memoizedState;return me!==null&&M!==null&&A8(M,me[1])?me[0]:(A=A(),Z.memoizedState=[A,M],A)}function VT(A,M,Z){return Dm&21?(Kt(Z,M)||(Z=Be(),fo.lanes|=Z,Um|=Z,A.baseState=!0),M):(A.baseState&&(A.baseState=!1,$c=!0),A.memoizedState=Z)}function WT(A,M){var Z=gt;gt=Z!==0&&4>Z?Z:4,A(!0);var me=N8.transition;N8.transition={};try{A(!1),M()}finally{gt=Z,N8.transition=me}}function P8(){return Ed().memoizedState}function IU(A,M,Z){var me=Vm(A);if(Z={lane:me,action:Z,hasEagerState:!1,eagerState:null,next:null},F8(A))Bc(M,Z);else if(Z=G5(A,M,Z,me),Z!==null){var Pe=Hc();vf(Z,A,me,Pe),mf(Z,M,me)}}function qT(A,M,Z){var me=Vm(A),Pe={lane:me,action:Z,hasEagerState:!1,eagerState:null,next:null};if(F8(A))Bc(M,Pe);else{var He=A.alternate;if(A.lanes===0&&(He===null||He.lanes===0)&&(He=M.lastRenderedReducer,He!==null))try{var St=M.lastRenderedState,hn=He(St,Z);if(Pe.hasEagerState=!0,Pe.eagerState=hn,Kt(hn,St)){var _n=M.interleaved;_n===null?(Pe.next=Pe,y8(M)):(Pe.next=_n.next,_n.next=Pe),M.interleaved=Pe;return}}catch{}finally{}Z=G5(A,M,Pe,me),Z!==null&&(Pe=Hc(),vf(Z,A,me,Pe),mf(Z,M,me))}}function F8(A){var M=A.alternate;return A===fo||M!==null&&M===fo}function Bc(A,M){B2=q1=!0;var Z=A.pending;Z===null?M.next=M:(M.next=Z.next,Z.next=M),A.pending=M}function mf(A,M,Z){if(Z&4194240){var me=M.lanes;me&=A.pendingLanes,Z|=me,M.lanes=Z,ct(A,Z)}}var r6={readContext:Nd,useCallback:gc,useContext:gc,useEffect:gc,useImperativeHandle:gc,useInsertionEffect:gc,useLayoutEffect:gc,useMemo:gc,useReducer:gc,useRef:gc,useState:gc,useDebugValue:gc,useDeferredValue:gc,useTransition:gc,useMutableSource:gc,useSyncExternalStore:gc,useId:gc,unstable_isNewReconciler:!1},PU={readContext:Nd,useCallback:function(A,M){return lh().memoizedState=[A,M===void 0?null:M],A},useContext:Nd,useEffect:n6,useImperativeHandle:function(A,M,Z){return Z=Z!=null?Z.concat([A]):null,U2(4194308,4,T8.bind(null,M,A),Z)},useLayoutEffect:function(A,M){return U2(4194308,4,A,M)},useInsertionEffect:function(A,M){return U2(4,2,A,M)},useMemo:function(A,M){var Z=lh();return M=M===void 0?null:M,A=A(),Z.memoizedState=[A,M],A},useReducer:function(A,M,Z){var me=lh();return M=Z!==void 0?Z(M):M,me.memoizedState=me.baseState=M,A={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:A,lastRenderedState:M},me.queue=A,A=A.dispatch=IU.bind(null,fo,A),[me.memoizedState,A]},useRef:function(A){var M=lh();return A={current:A},M.memoizedState=A},useState:$2,useDebugValue:z2,useDeferredValue:function(A){return lh().memoizedState=A},useTransition:function(){var A=$2(!1),M=A[0];return A=WT.bind(null,A[1]),lh().memoizedState=A,[M,A]},useMutableSource:function(){},useSyncExternalStore:function(A,M,Z){var me=fo,Pe=lh();if(Ga){if(Z===void 0)throw Error(n(407));Z=Z()}else{if(Z=M(),Il===null)throw Error(n(349));Dm&30||_8(me,M,Z)}Pe.memoizedState=Z;var He={value:Z,getSnapshot:M};return Pe.queue=He,n6(Sp.bind(null,me,He,A),[A]),me.flags|=2048,K1(9,fu.bind(null,me,He,Z,M),void 0,null),Z},useId:function(){var A=lh(),M=Il.identifierPrefix;if(Ga){var Z=rh,me=nh;Z=(me&~(1<<32-ue(me)-1)).toString(32)+Z,M=":"+M+"R"+Z,Z=Ax++,0<Z&&(M+="H"+Z.toString(32)),M+=":"}else Z=Fi++,M=":"+M+"r"+Z.toString(32)+":";return A.memoizedState=M},unstable_isNewReconciler:!1},s6={readContext:Nd,useCallback:zT,useContext:Nd,useEffect:ch,useImperativeHandle:I8,useInsertionEffect:UT,useLayoutEffect:Np,useMemo:HT,useReducer:j8,useRef:t6,useState:function(){return j8(bc)},useDebugValue:z2,useDeferredValue:function(A){var M=Ed();return VT(M,Lo.memoizedState,A)},useTransition:function(){var A=j8(bc)[0],M=Ed().memoizedState;return[A,M]},useMutableSource:J5,useSyncExternalStore:E8,useId:P8,unstable_isNewReconciler:!1},X1={readContext:Nd,useCallback:zT,useContext:Nd,useEffect:ch,useImperativeHandle:I8,useInsertionEffect:UT,useLayoutEffect:Np,useMemo:HT,useReducer:G1,useRef:t6,useState:function(){return G1(bc)},useDebugValue:z2,useDeferredValue:function(A){var M=Ed();return Lo===null?M.memoizedState=A:VT(M,Lo.memoizedState,A)},useTransition:function(){var A=G1(bc)[0],M=Ed().memoizedState;return[A,M]},useMutableSource:J5,useSyncExternalStore:E8,useId:P8,unstable_isNewReconciler:!1};function _d(A,M){if(A&&A.defaultProps){M=ee({},M),A=A.defaultProps;for(var Z in A)M[Z]===void 0&&(M[Z]=A[Z]);return M}return M}function i6(A,M,Z,me){M=A.memoizedState,Z=Z(me,M),Z=Z==null?M:ee({},M,Z),A.memoizedState=Z,A.lanes===0&&(A.updateQueue.baseState=Z)}var a6={isMounted:function(A){return(A=A._reactInternals)?tn(A)===A:!1},enqueueSetState:function(A,M,Z){A=A._reactInternals;var me=Hc(),Pe=Vm(A),He=wp(me,Pe);He.payload=M,Z!=null&&(He.callback=Z),M=jd(A,He,Pe),M!==null&&(vf(M,A,Pe,me),Y5(M,A,Pe))},enqueueReplaceState:function(A,M,Z){A=A._reactInternals;var me=Hc(),Pe=Vm(A),He=wp(me,Pe);He.tag=1,He.payload=M,Z!=null&&(He.callback=Z),M=jd(A,He,Pe),M!==null&&(vf(M,A,Pe,me),Y5(M,A,Pe))},enqueueForceUpdate:function(A,M){A=A._reactInternals;var Z=Hc(),me=Vm(A),Pe=wp(Z,me);Pe.tag=2,M!=null&&(Pe.callback=M),M=jd(A,Pe,me),M!==null&&(vf(M,A,me,Z),Y5(M,A,me))}};function O8(A,M,Z,me,Pe,He,St){return A=A.stateNode,typeof A.shouldComponentUpdate=="function"?A.shouldComponentUpdate(me,He,St):M.prototype&&M.prototype.isPureReactComponent?!An(Z,me)||!An(Pe,He):!0}function Ex(A,M,Z){var me=!1,Pe=Fm,He=M.contextType;return typeof He=="object"&&He!==null?He=Nd(He):(Pe=uu(M)?Dc:pc.current,me=M.contextTypes,He=(me=me!=null)?U1(A,Pe):Fm),M=new M(Z,He),A.memoizedState=M.state!==null&&M.state!==void 0?M.state:null,M.updater=a6,A.stateNode=M,M._reactInternals=A,me&&(A=A.stateNode,A.__reactInternalMemoizedUnmaskedChildContext=Pe,A.__reactInternalMemoizedMaskedChildContext=He),M}function Q1(A,M,Z,me){A=M.state,typeof M.componentWillReceiveProps=="function"&&M.componentWillReceiveProps(Z,me),typeof M.UNSAFE_componentWillReceiveProps=="function"&&M.UNSAFE_componentWillReceiveProps(Z,me),M.state!==A&&a6.enqueueReplaceState(M,M.state,null)}function M8(A,M,Z,me){var Pe=A.stateNode;Pe.props=Z,Pe.state=A.memoizedState,Pe.refs={},K5(A);var He=M.contextType;typeof He=="object"&&He!==null?Pe.context=Nd(He):(He=uu(M)?Dc:pc.current,Pe.context=U1(A,He)),Pe.state=A.memoizedState,He=M.getDerivedStateFromProps,typeof He=="function"&&(i6(A,M,He,Z),Pe.state=A.memoizedState),typeof M.getDerivedStateFromProps=="function"||typeof Pe.getSnapshotBeforeUpdate=="function"||typeof Pe.UNSAFE_componentWillMount!="function"&&typeof Pe.componentWillMount!="function"||(M=Pe.state,typeof Pe.componentWillMount=="function"&&Pe.componentWillMount(),typeof Pe.UNSAFE_componentWillMount=="function"&&Pe.UNSAFE_componentWillMount(),M!==Pe.state&&a6.enqueueReplaceState(Pe,Pe.state,null),V1(A,Z,Pe,me),Pe.state=A.memoizedState),typeof Pe.componentDidMount=="function"&&(A.flags|=4194308)}function _x(A,M){try{var Z="",me=M;do Z+=ge(me),me=me.return;while(me);var Pe=Z}catch(He){Pe=`
Error generating stack: `+He.message+`
`+He.stack}return{value:A,source:M,stack:Pe,digest:null}}function o6(A,M,Z){return{value:A,source:null,stack:Z??null,digest:M??null}}function Z1(A,M){try{console.error(M.value)}catch(Z){setTimeout(function(){throw Z})}}var GT=typeof WeakMap=="function"?WeakMap:Map;function H2(A,M,Z){Z=wp(-1,Z),Z.tag=3,Z.payload={element:null};var me=M.value;return Z.callback=function(){b6||(b6=!0,Q8=me),Z1(A,M)},Z}function l6(A,M,Z){Z=wp(-1,Z),Z.tag=3;var me=A.type.getDerivedStateFromError;if(typeof me=="function"){var Pe=M.value;Z.payload=function(){return me(Pe)},Z.callback=function(){Z1(A,M)}}var He=A.stateNode;return He!==null&&typeof He.componentDidCatch=="function"&&(Z.callback=function(){Z1(A,M),typeof me!="function"&&(zm===null?zm=new Set([this]):zm.add(this));var St=M.stack;this.componentDidCatch(M.value,{componentStack:St!==null?St:""})}),Z}function V2(A,M,Z){var me=A.pingCache;if(me===null){me=A.pingCache=new GT;var Pe=new Set;me.set(M,Pe)}else Pe=me.get(M),Pe===void 0&&(Pe=new Set,me.set(M,Pe));Pe.has(Z)||(Pe.add(Z),A=$U.bind(null,A,M,Z),M.then(A,A))}function KT(A){do{var M;if((M=A.tag===13)&&(M=A.memoizedState,M=M!==null?M.dehydrated!==null:!0),M)return A;A=A.return}while(A!==null);return null}function R8(A,M,Z,me,Pe){return A.mode&1?(A.flags|=65536,A.lanes=Pe,A):(A===M?A.flags|=65536:(A.flags|=128,Z.flags|=131072,Z.flags&=-52805,Z.tag===1&&(Z.alternate===null?Z.tag=17:(M=wp(-1,1),M.tag=2,jd(Z,M,1))),Z.lanes|=1),A)}var c6=R.ReactCurrentOwner,$c=!1;function Gl(A,M,Z,me){M.child=A===null?W5(M,null,Z,me):No(M,A.child,Z,me)}function YT(A,M,Z,me,Pe){Z=Z.render;var He=M.ref;return Rm(M,Pe),me=jx(A,M,Z,me,He,Pe),Z=Z5(),A!==null&&!$c?(M.updateQueue=A.updateQueue,M.flags&=-2053,A.lanes&=~Pe,xf(A,M,Pe)):(Ga&&Z&&P2(M),M.flags|=1,Gl(A,M,me,Pe),M.child)}function L8(A,M,Z,me,Pe){if(A===null){var He=Z.type;return typeof He=="function"&&!N6(He)&&He.defaultProps===void 0&&Z.compare===null&&Z.defaultProps===void 0?(M.tag=15,M.type=He,uh(A,M,He,me,Pe)):(A=A6(Z.type,null,me,M,M.mode,Pe),A.ref=M.ref,A.return=M,M.child=A)}if(He=A.child,!(A.lanes&Pe)){var St=He.memoizedProps;if(Z=Z.compare,Z=Z!==null?Z:An,Z(St,me)&&A.ref===M.ref)return xf(A,M,Pe)}return M.flags|=1,A=wf(He,me),A.ref=M.ref,A.return=M,M.child=A}function uh(A,M,Z,me,Pe){if(A!==null){var He=A.memoizedProps;if(An(He,me)&&A.ref===M.ref)if($c=!1,M.pendingProps=me=He,(A.lanes&Pe)!==0)A.flags&131072&&($c=!0);else return M.lanes=A.lanes,xf(A,M,Pe)}return $8(A,M,Z,me,Pe)}function D8(A,M,Z){var me=M.pendingProps,Pe=me.children,He=A!==null?A.memoizedState:null;if(me.mode==="hidden")if(!(M.mode&1))M.memoizedState={baseLanes:0,cachePool:null,transitions:null},$a(nb,Wu),Wu|=Z;else{if(!(Z&1073741824))return A=He!==null?He.baseLanes|Z:Z,M.lanes=M.childLanes=1073741824,M.memoizedState={baseLanes:A,cachePool:null,transitions:null},M.updateQueue=null,$a(nb,Wu),Wu|=A,null;M.memoizedState={baseLanes:0,cachePool:null,transitions:null},me=He!==null?He.baseLanes:Z,$a(nb,Wu),Wu|=me}else He!==null?(me=He.baseLanes|Z,M.memoizedState=null):me=Z,$a(nb,Wu),Wu|=me;return Gl(A,M,Pe,Z),M.child}function B8(A,M){var Z=M.ref;(A===null&&Z!==null||A!==null&&A.ref!==Z)&&(M.flags|=512,M.flags|=2097152)}function $8(A,M,Z,me,Pe){var He=uu(Z)?Dc:pc.current;return He=U1(M,He),Rm(M,Pe),Z=jx(A,M,Z,me,He,Pe),me=Z5(),A!==null&&!$c?(M.updateQueue=A.updateQueue,M.flags&=-2053,A.lanes&=~Pe,xf(A,M,Pe)):(Ga&&me&&P2(M),M.flags|=1,Gl(A,M,Z,Pe),M.child)}function U8(A,M,Z,me,Pe){if(uu(Z)){var He=!0;wd(M)}else He=!1;if(Rm(M,Pe),M.stateNode===null)d6(A,M),Ex(M,Z,me),M8(M,Z,me,Pe),me=!0;else if(A===null){var St=M.stateNode,hn=M.memoizedProps;St.props=hn;var _n=St.context,ar=Z.contextType;typeof ar=="object"&&ar!==null?ar=Nd(ar):(ar=uu(Z)?Dc:pc.current,ar=U1(M,ar));var Ur=Z.getDerivedStateFromProps,Wr=typeof Ur=="function"||typeof St.getSnapshotBeforeUpdate=="function";Wr||typeof St.UNSAFE_componentWillReceiveProps!="function"&&typeof St.componentWillReceiveProps!="function"||(hn!==me||_n!==ar)&&Q1(M,St,me,ar),Ad=!1;var $r=M.memoizedState;St.state=$r,V1(M,me,St,Pe),_n=M.memoizedState,hn!==me||$r!==_n||cu.current||Ad?(typeof Ur=="function"&&(i6(M,Z,Ur,me),_n=M.memoizedState),(hn=Ad||O8(M,Z,hn,me,$r,_n,ar))?(Wr||typeof St.UNSAFE_componentWillMount!="function"&&typeof St.componentWillMount!="function"||(typeof St.componentWillMount=="function"&&St.componentWillMount(),typeof St.UNSAFE_componentWillMount=="function"&&St.UNSAFE_componentWillMount()),typeof St.componentDidMount=="function"&&(M.flags|=4194308)):(typeof St.componentDidMount=="function"&&(M.flags|=4194308),M.memoizedProps=me,M.memoizedState=_n),St.props=me,St.state=_n,St.context=ar,me=hn):(typeof St.componentDidMount=="function"&&(M.flags|=4194308),me=!1)}else{St=M.stateNode,BT(A,M),hn=M.memoizedProps,ar=M.type===M.elementType?hn:_d(M.type,hn),St.props=ar,Wr=M.pendingProps,$r=St.context,_n=Z.contextType,typeof _n=="object"&&_n!==null?_n=Nd(_n):(_n=uu(Z)?Dc:pc.current,_n=U1(M,_n));var ds=Z.getDerivedStateFromProps;(Ur=typeof ds=="function"||typeof St.getSnapshotBeforeUpdate=="function")||typeof St.UNSAFE_componentWillReceiveProps!="function"&&typeof St.componentWillReceiveProps!="function"||(hn!==Wr||$r!==_n)&&Q1(M,St,me,_n),Ad=!1,$r=M.memoizedState,St.state=$r,V1(M,me,St,Pe);var Ns=M.memoizedState;hn!==Wr||$r!==Ns||cu.current||Ad?(typeof ds=="function"&&(i6(M,Z,ds,me),Ns=M.memoizedState),(ar=Ad||O8(M,Z,ar,me,$r,Ns,_n)||!1)?(Ur||typeof St.UNSAFE_componentWillUpdate!="function"&&typeof St.componentWillUpdate!="function"||(typeof St.componentWillUpdate=="function"&&St.componentWillUpdate(me,Ns,_n),typeof St.UNSAFE_componentWillUpdate=="function"&&St.UNSAFE_componentWillUpdate(me,Ns,_n)),typeof St.componentDidUpdate=="function"&&(M.flags|=4),typeof St.getSnapshotBeforeUpdate=="function"&&(M.flags|=1024)):(typeof St.componentDidUpdate!="function"||hn===A.memoizedProps&&$r===A.memoizedState||(M.flags|=4),typeof St.getSnapshotBeforeUpdate!="function"||hn===A.memoizedProps&&$r===A.memoizedState||(M.flags|=1024),M.memoizedProps=me,M.memoizedState=Ns),St.props=me,St.state=Ns,St.context=_n,me=ar):(typeof St.componentDidUpdate!="function"||hn===A.memoizedProps&&$r===A.memoizedState||(M.flags|=4),typeof St.getSnapshotBeforeUpdate!="function"||hn===A.memoizedProps&&$r===A.memoizedState||(M.flags|=1024),me=!1)}return z8(A,M,Z,me,He,Pe)}function z8(A,M,Z,me,Pe,He){B8(A,M);var St=(M.flags&128)!==0;if(!me&&!St)return Pe&&FT(M,Z,!1),xf(A,M,He);me=M.stateNode,c6.current=M;var hn=St&&typeof Z.getDerivedStateFromError!="function"?null:me.render();return M.flags|=1,A!==null&&St?(M.child=No(M,A.child,null,He),M.child=No(M,null,hn,He)):Gl(A,M,hn,He),M.memoizedState=me.state,Pe&&FT(M,Z,!0),M.child}function XT(A){var M=A.stateNode;M.pendingContext?IT(A,M.pendingContext,M.pendingContext!==M.context):M.context&&IT(A,M.context,!1),w8(A,M.containerInfo)}function dh(A,M,Z,me,Pe){return ih(),ah(Pe),M.flags|=256,Gl(A,M,Z,me),M.child}var W2={dehydrated:null,treeContext:null,retryLane:0};function q2(A){return{baseLanes:A,cachePool:null,transitions:null}}function u6(A,M,Z){var me=M.pendingProps,Pe=eo.current,He=!1,St=(M.flags&128)!==0,hn;if((hn=St)||(hn=A!==null&&A.memoizedState===null?!1:(Pe&2)!==0),hn?(He=!0,M.flags&=-129):(A===null||A.memoizedState!==null)&&(Pe|=1),$a(eo,Pe&1),A===null)return du(M),A=M.memoizedState,A!==null&&(A=A.dehydrated,A!==null)?(M.mode&1?A.data==="$!"?M.lanes=8:M.lanes=1073741824:M.lanes=1,null):(St=me.children,A=me.fallback,He?(me=M.mode,He=M.child,St={mode:"hidden",children:St},!(me&1)&&He!==null?(He.childLanes=0,He.pendingProps=St):He=j6(St,me,0,null),A=Fx(A,me,Z,null),He.return=M,A.return=M,He.sibling=A,M.child=He,M.child.memoizedState=q2(Z),M.memoizedState=W2,A):J1(M,St));if(Pe=A.memoizedState,Pe!==null&&(hn=Pe.dehydrated,hn!==null))return Ws(A,M,St,me,hn,Pe,Z);if(He){He=me.fallback,St=M.mode,Pe=A.child,hn=Pe.sibling;var _n={mode:"hidden",children:me.children};return!(St&1)&&M.child!==Pe?(me=M.child,me.childLanes=0,me.pendingProps=_n,M.deletions=null):(me=wf(Pe,_n),me.subtreeFlags=Pe.subtreeFlags&14680064),hn!==null?He=wf(hn,He):(He=Fx(He,St,Z,null),He.flags|=2),He.return=M,me.return=M,me.sibling=He,M.child=me,me=He,He=M.child,St=A.child.memoizedState,St=St===null?q2(Z):{baseLanes:St.baseLanes|Z,cachePool:null,transitions:St.transitions},He.memoizedState=St,He.childLanes=A.childLanes&~Z,M.memoizedState=W2,me}return He=A.child,A=He.sibling,me=wf(He,{mode:"visible",children:me.children}),!(M.mode&1)&&(me.lanes=Z),me.return=M,me.sibling=null,A!==null&&(Z=M.deletions,Z===null?(M.deletions=[A],M.flags|=16):Z.push(A)),M.child=me,M.memoizedState=null,me}function J1(A,M){return M=j6({mode:"visible",children:M},A.mode,0,null),M.return=A,A.child=M}function Ap(A,M,Z,me){return me!==null&&ah(me),No(M,A.child,null,Z),A=J1(M,M.pendingProps.children),A.flags|=2,M.memoizedState=null,A}function Ws(A,M,Z,me,Pe,He,St){if(Z)return M.flags&256?(M.flags&=-257,me=o6(Error(n(422))),Ap(A,M,St,me)):M.memoizedState!==null?(M.child=A.child,M.flags|=128,null):(He=me.fallback,Pe=M.mode,me=j6({mode:"visible",children:me.children},Pe,0,null),He=Fx(He,Pe,St,null),He.flags|=2,me.return=M,He.return=M,me.sibling=He,M.child=me,M.mode&1&&No(M,A.child,null,St),M.child.memoizedState=q2(St),M.memoizedState=W2,He);if(!(M.mode&1))return Ap(A,M,St,null);if(Pe.data==="$!"){if(me=Pe.nextSibling&&Pe.nextSibling.dataset,me)var hn=me.dgst;return me=hn,He=Error(n(419)),me=o6(He,me,void 0),Ap(A,M,St,me)}if(hn=(St&A.childLanes)!==0,$c||hn){if(me=Il,me!==null){switch(St&-St){case 4:Pe=2;break;case 16:Pe=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:Pe=32;break;case 536870912:Pe=268435456;break;default:Pe=0}Pe=Pe&(me.suspendedLanes|St)?0:Pe,Pe!==0&&Pe!==He.retryLane&&(He.retryLane=Pe,vp(A,Pe),vf(me,A,Pe,-1))}return r7(),me=o6(Error(n(421))),Ap(A,M,St,me)}return Pe.data==="$?"?(M.flags|=128,M.child=A.child,M=UU.bind(null,A),Pe._reactRetry=M,null):(A=He.treeContext,zu=Im(Pe.nextSibling),xc=M,Ga=!0,pf=null,A!==null&&(Cd[Sd++]=nh,Cd[Sd++]=rh,Cd[Sd++]=yx,nh=A.id,rh=A.overflow,yx=M),M=J1(M,me.children),M.flags|=4096,M)}function G2(A,M,Z){A.lanes|=M;var me=A.alternate;me!==null&&(me.lanes|=M),ql(A.return,M,Z)}function K2(A,M,Z,me,Pe){var He=A.memoizedState;He===null?A.memoizedState={isBackwards:M,rendering:null,renderingStartTime:0,last:me,tail:Z,tailMode:Pe}:(He.isBackwards=M,He.rendering=null,He.renderingStartTime=0,He.last=me,He.tail=Z,He.tailMode=Pe)}function Bm(A,M,Z){var me=M.pendingProps,Pe=me.revealOrder,He=me.tail;if(Gl(A,M,me.children,Z),me=eo.current,me&2)me=me&1|2,M.flags|=128;else{if(A!==null&&A.flags&128)e:for(A=M.child;A!==null;){if(A.tag===13)A.memoizedState!==null&&G2(A,Z,M);else if(A.tag===19)G2(A,Z,M);else if(A.child!==null){A.child.return=A,A=A.child;continue}if(A===M)break e;for(;A.sibling===null;){if(A.return===null||A.return===M)break e;A=A.return}A.sibling.return=A.return,A=A.sibling}me&=1}if($a(eo,me),!(M.mode&1))M.memoizedState=null;else switch(Pe){case"forwards":for(Z=M.child,Pe=null;Z!==null;)A=Z.alternate,A!==null&&Nx(A)===null&&(Pe=Z),Z=Z.sibling;Z=Pe,Z===null?(Pe=M.child,M.child=null):(Pe=Z.sibling,Z.sibling=null),K2(M,!1,Pe,Z,He);break;case"backwards":for(Z=null,Pe=M.child,M.child=null;Pe!==null;){if(A=Pe.alternate,A!==null&&Nx(A)===null){M.child=Pe;break}A=Pe.sibling,Pe.sibling=Z,Z=Pe,Pe=A}K2(M,!0,Z,null,He);break;case"together":K2(M,!1,null,null,void 0);break;default:M.memoizedState=null}return M.child}function d6(A,M){!(M.mode&1)&&A!==null&&(A.alternate=null,M.alternate=null,M.flags|=2)}function xf(A,M,Z){if(A!==null&&(M.dependencies=A.dependencies),Um|=M.lanes,!(Z&M.childLanes))return null;if(A!==null&&M.child!==A.child)throw Error(n(153));if(M.child!==null){for(A=M.child,Z=wf(A,A.pendingProps),M.child=Z,Z.return=M;A.sibling!==null;)A=A.sibling,Z=Z.sibling=wf(A,A.pendingProps),Z.return=M;Z.sibling=null}return M.child}function QT(A,M,Z){switch(M.tag){case 3:XT(M),ih();break;case 5:C8(M);break;case 1:uu(M.type)&&wd(M);break;case 4:w8(M,M.stateNode.containerInfo);break;case 10:var me=M.type._context,Pe=M.memoizedProps.value;$a(M2,me._currentValue),me._currentValue=Pe;break;case 13:if(me=M.memoizedState,me!==null)return me.dehydrated!==null?($a(eo,eo.current&1),M.flags|=128,null):Z&M.child.childLanes?u6(A,M,Z):($a(eo,eo.current&1),A=xf(A,M,Z),A!==null?A.sibling:null);$a(eo,eo.current&1);break;case 19:if(me=(Z&M.childLanes)!==0,A.flags&128){if(me)return Bm(A,M,Z);M.flags|=128}if(Pe=M.memoizedState,Pe!==null&&(Pe.rendering=null,Pe.tail=null,Pe.lastEffect=null),$a(eo,eo.current),me)break;return null;case 22:case 23:return M.lanes=0,D8(A,M,Z)}return xf(A,M,Z)}var Kl,H8,ZT,V8;Kl=function(A,M){for(var Z=M.child;Z!==null;){if(Z.tag===5||Z.tag===6)A.appendChild(Z.stateNode);else if(Z.tag!==4&&Z.child!==null){Z.child.return=Z,Z=Z.child;continue}if(Z===M)break;for(;Z.sibling===null;){if(Z.return===null||Z.return===M)return;Z=Z.return}Z.sibling.return=Z.return,Z=Z.sibling}},H8=function(){},ZT=function(A,M,Z,me){var Pe=A.memoizedProps;if(Pe!==me){A=M.stateNode,Cp(oh.current);var He=null;switch(Z){case"input":Pe=tt(A,Pe),me=tt(A,me),He=[];break;case"select":Pe=ee({},Pe,{value:void 0}),me=ee({},me,{value:void 0}),He=[];break;case"textarea":Pe=cn(A,Pe),me=cn(A,me),He=[];break;default:typeof Pe.onClick!="function"&&typeof me.onClick=="function"&&(A.onclick=R5)}Rt(Z,me);var St;Z=null;for(ar in Pe)if(!me.hasOwnProperty(ar)&&Pe.hasOwnProperty(ar)&&Pe[ar]!=null)if(ar==="style"){var hn=Pe[ar];for(St in hn)hn.hasOwnProperty(St)&&(Z||(Z={}),Z[St]="")}else ar!=="dangerouslySetInnerHTML"&&ar!=="children"&&ar!=="suppressContentEditableWarning"&&ar!=="suppressHydrationWarning"&&ar!=="autoFocus"&&(s.hasOwnProperty(ar)?He||(He=[]):(He=He||[]).push(ar,null));for(ar in me){var _n=me[ar];if(hn=Pe!=null?Pe[ar]:void 0,me.hasOwnProperty(ar)&&_n!==hn&&(_n!=null||hn!=null))if(ar==="style")if(hn){for(St in hn)!hn.hasOwnProperty(St)||_n&&_n.hasOwnProperty(St)||(Z||(Z={}),Z[St]="");for(St in _n)_n.hasOwnProperty(St)&&hn[St]!==_n[St]&&(Z||(Z={}),Z[St]=_n[St])}else Z||(He||(He=[]),He.push(ar,Z)),Z=_n;else ar==="dangerouslySetInnerHTML"?(_n=_n?_n.__html:void 0,hn=hn?hn.__html:void 0,_n!=null&&hn!==_n&&(He=He||[]).push(ar,_n)):ar==="children"?typeof _n!="string"&&typeof _n!="number"||(He=He||[]).push(ar,""+_n):ar!=="suppressContentEditableWarning"&&ar!=="suppressHydrationWarning"&&(s.hasOwnProperty(ar)?(_n!=null&&ar==="onScroll"&&Wa("scroll",A),He||hn===_n||(He=[])):(He=He||[]).push(ar,_n))}Z&&(He=He||[]).push("style",Z);var ar=He;(M.updateQueue=ar)&&(M.flags|=4)}},V8=function(A,M,Z,me){Z!==me&&(M.flags|=4)};function Y2(A,M){if(!Ga)switch(A.tailMode){case"hidden":M=A.tail;for(var Z=null;M!==null;)M.alternate!==null&&(Z=M),M=M.sibling;Z===null?A.tail=null:Z.sibling=null;break;case"collapsed":Z=A.tail;for(var me=null;Z!==null;)Z.alternate!==null&&(me=Z),Z=Z.sibling;me===null?M||A.tail===null?A.tail=null:A.tail.sibling=null:me.sibling=null}}function Yl(A){var M=A.alternate!==null&&A.alternate.child===A.child,Z=0,me=0;if(M)for(var Pe=A.child;Pe!==null;)Z|=Pe.lanes|Pe.childLanes,me|=Pe.subtreeFlags&14680064,me|=Pe.flags&14680064,Pe.return=A,Pe=Pe.sibling;else for(Pe=A.child;Pe!==null;)Z|=Pe.lanes|Pe.childLanes,me|=Pe.subtreeFlags,me|=Pe.flags,Pe.return=A,Pe=Pe.sibling;return A.subtreeFlags|=me,A.childLanes=Z,M}function FU(A,M,Z){var me=M.pendingProps;switch(wx(M),M.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Yl(M),null;case 1:return uu(M.type)&&$5(),Yl(M),null;case 3:return me=M.stateNode,Lm(),qa(cu),qa(pc),Q5(),me.pendingContext&&(me.context=me.pendingContext,me.pendingContext=null),(A===null||A.child===null)&&(F2(M)?M.flags|=4:A===null||A.memoizedState.isDehydrated&&!(M.flags&256)||(M.flags|=1024,pf!==null&&(e7(pf),pf=null))),H8(A,M),Yl(M),null;case 5:X5(M);var Pe=Cp(W1.current);if(Z=M.type,A!==null&&M.stateNode!=null)ZT(A,M,Z,me,Pe),A.ref!==M.ref&&(M.flags|=512,M.flags|=2097152);else{if(!me){if(M.stateNode===null)throw Error(n(166));return Yl(M),null}if(A=Cp(oh.current),F2(M)){me=M.stateNode,Z=M.type;var He=M.memoizedProps;switch(me[eh]=M,me[Pm]=He,A=(M.mode&1)!==0,Z){case"dialog":Wa("cancel",me),Wa("close",me);break;case"iframe":case"object":case"embed":Wa("load",me);break;case"video":case"audio":for(Pe=0;Pe<xp.length;Pe++)Wa(xp[Pe],me);break;case"source":Wa("error",me);break;case"img":case"image":case"link":Wa("error",me),Wa("load",me);break;case"details":Wa("toggle",me);break;case"input":lt(me,He),Wa("invalid",me);break;case"select":me._wrapperState={wasMultiple:!!He.multiple},Wa("invalid",me);break;case"textarea":un(me,He),Wa("invalid",me)}Rt(Z,He),Pe=null;for(var St in He)if(He.hasOwnProperty(St)){var hn=He[St];St==="children"?typeof hn=="string"?me.textContent!==hn&&(He.suppressHydrationWarning!==!0&&_2(me.textContent,hn,A),Pe=["children",hn]):typeof hn=="number"&&me.textContent!==""+hn&&(He.suppressHydrationWarning!==!0&&_2(me.textContent,hn,A),Pe=["children",""+hn]):s.hasOwnProperty(St)&&hn!=null&&St==="onScroll"&&Wa("scroll",me)}switch(Z){case"input":Qe(me),qt(me,He,!0);break;case"textarea":Qe(me),Ke(me);break;case"select":case"option":break;default:typeof He.onClick=="function"&&(me.onclick=R5)}me=Pe,M.updateQueue=me,me!==null&&(M.flags|=4)}else{St=Pe.nodeType===9?Pe:Pe.ownerDocument,A==="http://www.w3.org/1999/xhtml"&&(A=Bt(Z)),A==="http://www.w3.org/1999/xhtml"?Z==="script"?(A=St.createElement("div"),A.innerHTML="<script><\/script>",A=A.removeChild(A.firstChild)):typeof me.is=="string"?A=St.createElement(Z,{is:me.is}):(A=St.createElement(Z),Z==="select"&&(St=A,me.multiple?St.multiple=!0:me.size&&(St.size=me.size))):A=St.createElementNS(A,Z),A[eh]=M,A[Pm]=me,Kl(A,M,!1,!1),M.stateNode=A;e:{switch(St=We(Z,me),Z){case"dialog":Wa("cancel",A),Wa("close",A),Pe=me;break;case"iframe":case"object":case"embed":Wa("load",A),Pe=me;break;case"video":case"audio":for(Pe=0;Pe<xp.length;Pe++)Wa(xp[Pe],A);Pe=me;break;case"source":Wa("error",A),Pe=me;break;case"img":case"image":case"link":Wa("error",A),Wa("load",A),Pe=me;break;case"details":Wa("toggle",A),Pe=me;break;case"input":lt(A,me),Pe=tt(A,me),Wa("invalid",A);break;case"option":Pe=me;break;case"select":A._wrapperState={wasMultiple:!!me.multiple},Pe=ee({},me,{value:void 0}),Wa("invalid",A);break;case"textarea":un(A,me),Pe=cn(A,me),Wa("invalid",A);break;default:Pe=me}Rt(Z,Pe),hn=Pe;for(He in hn)if(hn.hasOwnProperty(He)){var _n=hn[He];He==="style"?nt(A,_n):He==="dangerouslySetInnerHTML"?(_n=_n?_n.__html:void 0,_n!=null&&Ye(A,_n)):He==="children"?typeof _n=="string"?(Z!=="textarea"||_n!=="")&&ht(A,_n):typeof _n=="number"&&ht(A,""+_n):He!=="suppressContentEditableWarning"&&He!=="suppressHydrationWarning"&&He!=="autoFocus"&&(s.hasOwnProperty(He)?_n!=null&&He==="onScroll"&&Wa("scroll",A):_n!=null&&I(A,He,_n,St))}switch(Z){case"input":Qe(A),qt(A,me,!1);break;case"textarea":Qe(A),Ke(A);break;case"option":me.value!=null&&A.setAttribute("value",""+je(me.value));break;case"select":A.multiple=!!me.multiple,He=me.value,He!=null?jt(A,!!me.multiple,He,!1):me.defaultValue!=null&&jt(A,!!me.multiple,me.defaultValue,!0);break;default:typeof Pe.onClick=="function"&&(A.onclick=R5)}switch(Z){case"button":case"input":case"select":case"textarea":me=!!me.autoFocus;break e;case"img":me=!0;break e;default:me=!1}}me&&(M.flags|=4)}M.ref!==null&&(M.flags|=512,M.flags|=2097152)}return Yl(M),null;case 6:if(A&&M.stateNode!=null)V8(A,M,A.memoizedProps,me);else{if(typeof me!="string"&&M.stateNode===null)throw Error(n(166));if(Z=Cp(W1.current),Cp(oh.current),F2(M)){if(me=M.stateNode,Z=M.memoizedProps,me[eh]=M,(He=me.nodeValue!==Z)&&(A=xc,A!==null))switch(A.tag){case 3:_2(me.nodeValue,Z,(A.mode&1)!==0);break;case 5:A.memoizedProps.suppressHydrationWarning!==!0&&_2(me.nodeValue,Z,(A.mode&1)!==0)}He&&(M.flags|=4)}else me=(Z.nodeType===9?Z:Z.ownerDocument).createTextNode(me),me[eh]=M,M.stateNode=me}return Yl(M),null;case 13:if(qa(eo),me=M.memoizedState,A===null||A.memoizedState!==null&&A.memoizedState.dehydrated!==null){if(Ga&&zu!==null&&M.mode&1&&!(M.flags&128))g8(),ih(),M.flags|=98560,He=!1;else if(He=F2(M),me!==null&&me.dehydrated!==null){if(A===null){if(!He)throw Error(n(318));if(He=M.memoizedState,He=He!==null?He.dehydrated:null,!He)throw Error(n(317));He[eh]=M}else ih(),!(M.flags&128)&&(M.memoizedState=null),M.flags|=4;Yl(M),He=!1}else pf!==null&&(e7(pf),pf=null),He=!0;if(!He)return M.flags&65536?M:null}return M.flags&128?(M.lanes=Z,M):(me=me!==null,me!==(A!==null&&A.memoizedState!==null)&&me&&(M.child.flags|=8192,M.mode&1&&(A===null||eo.current&1?cl===0&&(cl=3):r7())),M.updateQueue!==null&&(M.flags|=4),Yl(M),null);case 4:return Lm(),H8(A,M),A===null&&km(M.stateNode.containerInfo),Yl(M),null;case 10:return q5(M.type._context),Yl(M),null;case 17:return uu(M.type)&&$5(),Yl(M),null;case 19:if(qa(eo),He=M.memoizedState,He===null)return Yl(M),null;if(me=(M.flags&128)!==0,St=He.rendering,St===null)if(me)Y2(He,!1);else{if(cl!==0||A!==null&&A.flags&128)for(A=M.child;A!==null;){if(St=Nx(A),St!==null){for(M.flags|=128,Y2(He,!1),me=St.updateQueue,me!==null&&(M.updateQueue=me,M.flags|=4),M.subtreeFlags=0,me=Z,Z=M.child;Z!==null;)He=Z,A=me,He.flags&=14680066,St=He.alternate,St===null?(He.childLanes=0,He.lanes=A,He.child=null,He.subtreeFlags=0,He.memoizedProps=null,He.memoizedState=null,He.updateQueue=null,He.dependencies=null,He.stateNode=null):(He.childLanes=St.childLanes,He.lanes=St.lanes,He.child=St.child,He.subtreeFlags=0,He.deletions=null,He.memoizedProps=St.memoizedProps,He.memoizedState=St.memoizedState,He.updateQueue=St.updateQueue,He.type=St.type,A=St.dependencies,He.dependencies=A===null?null:{lanes:A.lanes,firstContext:A.firstContext}),Z=Z.sibling;return $a(eo,eo.current&1|2),M.child}A=A.sibling}He.tail!==null&&Ee()>kx&&(M.flags|=128,me=!0,Y2(He,!1),M.lanes=4194304)}else{if(!me)if(A=Nx(St),A!==null){if(M.flags|=128,me=!0,Z=A.updateQueue,Z!==null&&(M.updateQueue=Z,M.flags|=4),Y2(He,!0),He.tail===null&&He.tailMode==="hidden"&&!St.alternate&&!Ga)return Yl(M),null}else 2*Ee()-He.renderingStartTime>kx&&Z!==1073741824&&(M.flags|=128,me=!0,Y2(He,!1),M.lanes=4194304);He.isBackwards?(St.sibling=M.child,M.child=St):(Z=He.last,Z!==null?Z.sibling=St:M.child=St,He.last=St)}return He.tail!==null?(M=He.tail,He.rendering=M,He.tail=M.sibling,He.renderingStartTime=Ee(),M.sibling=null,Z=eo.current,$a(eo,me?Z&1|2:Z&1),M):(Yl(M),null);case 22:case 23:return n7(),me=M.memoizedState!==null,A!==null&&A.memoizedState!==null!==me&&(M.flags|=8192),me&&M.mode&1?Wu&1073741824&&(Yl(M),M.subtreeFlags&6&&(M.flags|=8192)):Yl(M),null;case 24:return null;case 25:return null}throw Error(n(156,M.tag))}function OU(A,M){switch(wx(M),M.tag){case 1:return uu(M.type)&&$5(),A=M.flags,A&65536?(M.flags=A&-65537|128,M):null;case 3:return Lm(),qa(cu),qa(pc),Q5(),A=M.flags,A&65536&&!(A&128)?(M.flags=A&-65537|128,M):null;case 5:return X5(M),null;case 13:if(qa(eo),A=M.memoizedState,A!==null&&A.dehydrated!==null){if(M.alternate===null)throw Error(n(340));ih()}return A=M.flags,A&65536?(M.flags=A&-65537|128,M):null;case 19:return qa(eo),null;case 4:return Lm(),null;case 10:return q5(M.type._context),null;case 22:case 23:return n7(),null;case 24:return null;default:return null}}var f6=!1,to=!1,Uc=typeof WeakSet=="function"?WeakSet:Set,ys=null;function eb(A,M){var Z=A.ref;if(Z!==null)if(typeof Z=="function")try{Z(null)}catch(me){ho(A,M,me)}else Z.current=null}function X2(A,M,Z){try{Z()}catch(me){ho(A,M,me)}}var JT=!1;function MU(A,M){if(k2=tr,A=Ss(),Qs(A)){if("selectionStart"in A)var Z={start:A.selectionStart,end:A.selectionEnd};else e:{Z=(Z=A.ownerDocument)&&Z.defaultView||window;var me=Z.getSelection&&Z.getSelection();if(me&&me.rangeCount!==0){Z=me.anchorNode;var Pe=me.anchorOffset,He=me.focusNode;me=me.focusOffset;try{Z.nodeType,He.nodeType}catch{Z=null;break e}var St=0,hn=-1,_n=-1,ar=0,Ur=0,Wr=A,$r=null;t:for(;;){for(var ds;Wr!==Z||Pe!==0&&Wr.nodeType!==3||(hn=St+Pe),Wr!==He||me!==0&&Wr.nodeType!==3||(_n=St+me),Wr.nodeType===3&&(St+=Wr.nodeValue.length),(ds=Wr.firstChild)!==null;)$r=Wr,Wr=ds;for(;;){if(Wr===A)break t;if($r===Z&&++ar===Pe&&(hn=St),$r===He&&++Ur===me&&(_n=St),(ds=Wr.nextSibling)!==null)break;Wr=$r,$r=Wr.parentNode}Wr=ds}Z=hn===-1||_n===-1?null:{start:hn,end:_n}}else Z=null}Z=Z||{start:0,end:0}}else Z=null;for(gx={focusedElem:A,selectionRange:Z},tr=!1,ys=M;ys!==null;)if(M=ys,A=M.child,(M.subtreeFlags&1028)!==0&&A!==null)A.return=M,ys=A;else for(;ys!==null;){M=ys;try{var Ns=M.alternate;if(M.flags&1024)switch(M.tag){case 0:case 11:case 15:break;case 1:if(Ns!==null){var Ts=Ns.memoizedProps,Ao=Ns.memoizedState,Zn=M.stateNode,Ln=Zn.getSnapshotBeforeUpdate(M.elementType===M.type?Ts:_d(M.type,Ts),Ao);Zn.__reactInternalSnapshotBeforeUpdate=Ln}break;case 3:var nr=M.stateNode.containerInfo;nr.nodeType===1?nr.textContent="":nr.nodeType===9&&nr.documentElement&&nr.removeChild(nr.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(Xr){ho(M,M.return,Xr)}if(A=M.sibling,A!==null){A.return=M.return,ys=A;break}ys=M.return}return Ns=JT,JT=!1,Ns}function jp(A,M,Z){var me=M.updateQueue;if(me=me!==null?me.lastEffect:null,me!==null){var Pe=me=me.next;do{if((Pe.tag&A)===A){var He=Pe.destroy;Pe.destroy=void 0,He!==void 0&&X2(M,Z,He)}Pe=Pe.next}while(Pe!==me)}}function Q2(A,M){if(M=M.updateQueue,M=M!==null?M.lastEffect:null,M!==null){var Z=M=M.next;do{if((Z.tag&A)===A){var me=Z.create;Z.destroy=me()}Z=Z.next}while(Z!==M)}}function h6(A){var M=A.ref;if(M!==null){var Z=A.stateNode;switch(A.tag){case 5:A=Z;break;default:A=Z}typeof M=="function"?M(A):M.current=A}}function eI(A){var M=A.alternate;M!==null&&(A.alternate=null,eI(M)),A.child=null,A.deletions=null,A.sibling=null,A.tag===5&&(M=A.stateNode,M!==null&&(delete M[eh],delete M[Pm],delete M[D5],delete M[Ot],delete M[B1])),A.stateNode=null,A.return=null,A.dependencies=null,A.memoizedProps=null,A.memoizedState=null,A.pendingProps=null,A.stateNode=null,A.updateQueue=null}function tI(A){return A.tag===5||A.tag===3||A.tag===4}function nI(A){e:for(;;){for(;A.sibling===null;){if(A.return===null||tI(A.return))return null;A=A.return}for(A.sibling.return=A.return,A=A.sibling;A.tag!==5&&A.tag!==6&&A.tag!==18;){if(A.flags&2||A.child===null||A.tag===4)continue e;A.child.return=A,A=A.child}if(!(A.flags&2))return A.stateNode}}function W8(A,M,Z){var me=A.tag;if(me===5||me===6)A=A.stateNode,M?Z.nodeType===8?Z.parentNode.insertBefore(A,M):Z.insertBefore(A,M):(Z.nodeType===8?(M=Z.parentNode,M.insertBefore(A,Z)):(M=Z,M.appendChild(A)),Z=Z._reactRootContainer,Z!=null||M.onclick!==null||(M.onclick=R5));else if(me!==4&&(A=A.child,A!==null))for(W8(A,M,Z),A=A.sibling;A!==null;)W8(A,M,Z),A=A.sibling}function p6(A,M,Z){var me=A.tag;if(me===5||me===6)A=A.stateNode,M?Z.insertBefore(A,M):Z.appendChild(A);else if(me!==4&&(A=A.child,A!==null))for(p6(A,M,Z),A=A.sibling;A!==null;)p6(A,M,Z),A=A.sibling}var Tl=null,gf=!1;function fh(A,M,Z){for(Z=Z.child;Z!==null;)q8(A,M,Z),Z=Z.sibling}function q8(A,M,Z){if(q&&typeof q.onCommitFiberUnmount=="function")try{q.onCommitFiberUnmount(B,Z)}catch{}switch(Z.tag){case 5:to||eb(Z,M);case 6:var me=Tl,Pe=gf;Tl=null,fh(A,M,Z),Tl=me,gf=Pe,Tl!==null&&(gf?(A=Tl,Z=Z.stateNode,A.nodeType===8?A.parentNode.removeChild(Z):A.removeChild(Z)):Tl.removeChild(Z.stateNode));break;case 18:Tl!==null&&(gf?(A=Tl,Z=Z.stateNode,A.nodeType===8?p8(A.parentNode,Z):A.nodeType===1&&p8(A,Z),yt(A)):p8(Tl,Z.stateNode));break;case 4:me=Tl,Pe=gf,Tl=Z.stateNode.containerInfo,gf=!0,fh(A,M,Z),Tl=me,gf=Pe;break;case 0:case 11:case 14:case 15:if(!to&&(me=Z.updateQueue,me!==null&&(me=me.lastEffect,me!==null))){Pe=me=me.next;do{var He=Pe,St=He.destroy;He=He.tag,St!==void 0&&(He&2||He&4)&&X2(Z,M,St),Pe=Pe.next}while(Pe!==me)}fh(A,M,Z);break;case 1:if(!to&&(eb(Z,M),me=Z.stateNode,typeof me.componentWillUnmount=="function"))try{me.props=Z.memoizedProps,me.state=Z.memoizedState,me.componentWillUnmount()}catch(hn){ho(Z,M,hn)}fh(A,M,Z);break;case 21:fh(A,M,Z);break;case 22:Z.mode&1?(to=(me=to)||Z.memoizedState!==null,fh(A,M,Z),to=me):fh(A,M,Z);break;default:fh(A,M,Z)}}function tb(A){var M=A.updateQueue;if(M!==null){A.updateQueue=null;var Z=A.stateNode;Z===null&&(Z=A.stateNode=new Uc),M.forEach(function(me){var Pe=zU.bind(null,A,me);Z.has(me)||(Z.add(me),me.then(Pe,Pe))})}}function Vu(A,M){var Z=M.deletions;if(Z!==null)for(var me=0;me<Z.length;me++){var Pe=Z[me];try{var He=A,St=M,hn=St;e:for(;hn!==null;){switch(hn.tag){case 5:Tl=hn.stateNode,gf=!1;break e;case 3:Tl=hn.stateNode.containerInfo,gf=!0;break e;case 4:Tl=hn.stateNode.containerInfo,gf=!0;break e}hn=hn.return}if(Tl===null)throw Error(n(160));q8(He,St,Pe),Tl=null,gf=!1;var _n=Pe.alternate;_n!==null&&(_n.return=null),Pe.return=null}catch(ar){ho(Pe,M,ar)}}if(M.subtreeFlags&12854)for(M=M.child;M!==null;)G8(M,A),M=M.sibling}function G8(A,M){var Z=A.alternate,me=A.flags;switch(A.tag){case 0:case 11:case 14:case 15:if(Vu(M,A),bf(A),me&4){try{jp(3,A,A.return),Q2(3,A)}catch(Ts){ho(A,A.return,Ts)}try{jp(5,A,A.return)}catch(Ts){ho(A,A.return,Ts)}}break;case 1:Vu(M,A),bf(A),me&512&&Z!==null&&eb(Z,Z.return);break;case 5:if(Vu(M,A),bf(A),me&512&&Z!==null&&eb(Z,Z.return),A.flags&32){var Pe=A.stateNode;try{ht(Pe,"")}catch(Ts){ho(A,A.return,Ts)}}if(me&4&&(Pe=A.stateNode,Pe!=null)){var He=A.memoizedProps,St=Z!==null?Z.memoizedProps:He,hn=A.type,_n=A.updateQueue;if(A.updateQueue=null,_n!==null)try{hn==="input"&&He.type==="radio"&&He.name!=null&&ft(Pe,He),We(hn,St);var ar=We(hn,He);for(St=0;St<_n.length;St+=2){var Ur=_n[St],Wr=_n[St+1];Ur==="style"?nt(Pe,Wr):Ur==="dangerouslySetInnerHTML"?Ye(Pe,Wr):Ur==="children"?ht(Pe,Wr):I(Pe,Ur,Wr,ar)}switch(hn){case"input":ut(Pe,He);break;case"textarea":Ft(Pe,He);break;case"select":var $r=Pe._wrapperState.wasMultiple;Pe._wrapperState.wasMultiple=!!He.multiple;var ds=He.value;ds!=null?jt(Pe,!!He.multiple,ds,!1):$r!==!!He.multiple&&(He.defaultValue!=null?jt(Pe,!!He.multiple,He.defaultValue,!0):jt(Pe,!!He.multiple,He.multiple?[]:"",!1))}Pe[Pm]=He}catch(Ts){ho(A,A.return,Ts)}}break;case 6:if(Vu(M,A),bf(A),me&4){if(A.stateNode===null)throw Error(n(162));Pe=A.stateNode,He=A.memoizedProps;try{Pe.nodeValue=He}catch(Ts){ho(A,A.return,Ts)}}break;case 3:if(Vu(M,A),bf(A),me&4&&Z!==null&&Z.memoizedState.isDehydrated)try{yt(M.containerInfo)}catch(Ts){ho(A,A.return,Ts)}break;case 4:Vu(M,A),bf(A);break;case 13:Vu(M,A),bf(A),Pe=A.child,Pe.flags&8192&&(He=Pe.memoizedState!==null,Pe.stateNode.isHidden=He,!He||Pe.alternate!==null&&Pe.alternate.memoizedState!==null||(X8=Ee())),me&4&&tb(A);break;case 22:if(Ur=Z!==null&&Z.memoizedState!==null,A.mode&1?(to=(ar=to)||Ur,Vu(M,A),to=ar):Vu(M,A),bf(A),me&8192){if(ar=A.memoizedState!==null,(A.stateNode.isHidden=ar)&&!Ur&&A.mode&1)for(ys=A,Ur=A.child;Ur!==null;){for(Wr=ys=Ur;ys!==null;){switch($r=ys,ds=$r.child,$r.tag){case 0:case 11:case 14:case 15:jp(4,$r,$r.return);break;case 1:eb($r,$r.return);var Ns=$r.stateNode;if(typeof Ns.componentWillUnmount=="function"){me=$r,Z=$r.return;try{M=me,Ns.props=M.memoizedProps,Ns.state=M.memoizedState,Ns.componentWillUnmount()}catch(Ts){ho(me,Z,Ts)}}break;case 5:eb($r,$r.return);break;case 22:if($r.memoizedState!==null){$m(Wr);continue}}ds!==null?(ds.return=$r,ys=ds):$m(Wr)}Ur=Ur.sibling}e:for(Ur=null,Wr=A;;){if(Wr.tag===5){if(Ur===null){Ur=Wr;try{Pe=Wr.stateNode,ar?(He=Pe.style,typeof He.setProperty=="function"?He.setProperty("display","none","important"):He.display="none"):(hn=Wr.stateNode,_n=Wr.memoizedProps.style,St=_n!=null&&_n.hasOwnProperty("display")?_n.display:null,hn.style.display=Et("display",St))}catch(Ts){ho(A,A.return,Ts)}}}else if(Wr.tag===6){if(Ur===null)try{Wr.stateNode.nodeValue=ar?"":Wr.memoizedProps}catch(Ts){ho(A,A.return,Ts)}}else if((Wr.tag!==22&&Wr.tag!==23||Wr.memoizedState===null||Wr===A)&&Wr.child!==null){Wr.child.return=Wr,Wr=Wr.child;continue}if(Wr===A)break e;for(;Wr.sibling===null;){if(Wr.return===null||Wr.return===A)break e;Ur===Wr&&(Ur=null),Wr=Wr.return}Ur===Wr&&(Ur=null),Wr.sibling.return=Wr.return,Wr=Wr.sibling}}break;case 19:Vu(M,A),bf(A),me&4&&tb(A);break;case 21:break;default:Vu(M,A),bf(A)}}function bf(A){var M=A.flags;if(M&2){try{e:{for(var Z=A.return;Z!==null;){if(tI(Z)){var me=Z;break e}Z=Z.return}throw Error(n(160))}switch(me.tag){case 5:var Pe=me.stateNode;me.flags&32&&(ht(Pe,""),me.flags&=-33);var He=nI(A);p6(A,He,Pe);break;case 3:case 4:var St=me.stateNode.containerInfo,hn=nI(A);W8(A,hn,St);break;default:throw Error(n(161))}}catch(_n){ho(A,A.return,_n)}A.flags&=-3}M&4096&&(A.flags&=-4097)}function m6(A,M,Z){ys=A,K8(A)}function K8(A,M,Z){for(var me=(A.mode&1)!==0;ys!==null;){var Pe=ys,He=Pe.child;if(Pe.tag===22&&me){var St=Pe.memoizedState!==null||f6;if(!St){var hn=Pe.alternate,_n=hn!==null&&hn.memoizedState!==null||to;hn=f6;var ar=to;if(f6=St,(to=_n)&&!ar)for(ys=Pe;ys!==null;)St=ys,_n=St.child,St.tag===22&&St.memoizedState!==null?rI(Pe):_n!==null?(_n.return=St,ys=_n):rI(Pe);for(;He!==null;)ys=He,K8(He),He=He.sibling;ys=Pe,f6=hn,to=ar}yf(A)}else Pe.subtreeFlags&8772&&He!==null?(He.return=Pe,ys=He):yf(A)}}function yf(A){for(;ys!==null;){var M=ys;if(M.flags&8772){var Z=M.alternate;try{if(M.flags&8772)switch(M.tag){case 0:case 11:case 15:to||Q2(5,M);break;case 1:var me=M.stateNode;if(M.flags&4&&!to)if(Z===null)me.componentDidMount();else{var Pe=M.elementType===M.type?Z.memoizedProps:_d(M.type,Z.memoizedProps);me.componentDidUpdate(Pe,Z.memoizedState,me.__reactInternalSnapshotBeforeUpdate)}var He=M.updateQueue;He!==null&&v8(M,He,me);break;case 3:var St=M.updateQueue;if(St!==null){if(Z=null,M.child!==null)switch(M.child.tag){case 5:Z=M.child.stateNode;break;case 1:Z=M.child.stateNode}v8(M,St,Z)}break;case 5:var hn=M.stateNode;if(Z===null&&M.flags&4){Z=hn;var _n=M.memoizedProps;switch(M.type){case"button":case"input":case"select":case"textarea":_n.autoFocus&&Z.focus();break;case"img":_n.src&&(Z.src=_n.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(M.memoizedState===null){var ar=M.alternate;if(ar!==null){var Ur=ar.memoizedState;if(Ur!==null){var Wr=Ur.dehydrated;Wr!==null&&yt(Wr)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}to||M.flags&512&&h6(M)}catch($r){ho(M,M.return,$r)}}if(M===A){ys=null;break}if(Z=M.sibling,Z!==null){Z.return=M.return,ys=Z;break}ys=M.return}}function $m(A){for(;ys!==null;){var M=ys;if(M===A){ys=null;break}var Z=M.sibling;if(Z!==null){Z.return=M.return,ys=Z;break}ys=M.return}}function rI(A){for(;ys!==null;){var M=ys;try{switch(M.tag){case 0:case 11:case 15:var Z=M.return;try{Q2(4,M)}catch(_n){ho(M,Z,_n)}break;case 1:var me=M.stateNode;if(typeof me.componentDidMount=="function"){var Pe=M.return;try{me.componentDidMount()}catch(_n){ho(M,Pe,_n)}}var He=M.return;try{h6(M)}catch(_n){ho(M,He,_n)}break;case 5:var St=M.return;try{h6(M)}catch(_n){ho(M,St,_n)}}}catch(_n){ho(M,M.return,_n)}if(M===A){ys=null;break}var hn=M.sibling;if(hn!==null){hn.return=M.return,ys=hn;break}ys=M.return}}var sI=Math.ceil,x6=R.ReactCurrentDispatcher,Y8=R.ReactCurrentOwner,kd=R.ReactCurrentBatchConfig,Yi=0,Il=null,Go=null,Xl=0,Wu=0,nb=lu(0),cl=0,Z2=null,Um=0,J2=0,g6=0,ev=null,hu=null,X8=0,kx=1/0,Ep=null,b6=!1,Q8=null,zm=null,y6=!1,Hm=null,zc=0,tv=0,Z8=null,v6=-1,nv=0;function Hc(){return Yi&6?Ee():v6!==-1?v6:v6=Ee()}function Vm(A){return A.mode&1?Yi&2&&Xl!==0?Xl&-Xl:LT.transition!==null?(nv===0&&(nv=Be()),nv):(A=gt,A!==0||(A=window.event,A=A===void 0?16:ps(A.type)),A):1}function vf(A,M,Z,me){if(50<tv)throw tv=0,Z8=null,Error(n(185));_e(A,Z,me),(!(Yi&2)||A!==Il)&&(A===Il&&(!(Yi&2)&&(J2|=Z),cl===4&&Wm(A,Xl)),pu(A,me),Z===1&&Yi===0&&!(M.mode&1)&&(kx=Ee()+500,U5&&Om()))}function pu(A,M){var Z=A.callbackNode;se(A,M);var me=Fe(A,A===Il?Xl:0);if(me===0)Z!==null&&Jn(Z),A.callbackNode=null,A.callbackPriority=0;else if(M=me&-me,A.callbackPriority!==M){if(Z!=null&&Jn(Z),M===1)A.tag===0?bx(iI.bind(null,A)):OT(iI.bind(null,A)),L5(function(){!(Yi&6)&&Om()}),Z=null;else{switch(Xt(me)){case 1:Z=p;break;case 4:Z=S;break;case 16:Z=_;break;case 536870912:Z=T;break;default:Z=_}Z=fI(Z,w6.bind(null,A))}A.callbackPriority=M,A.callbackNode=Z}}function w6(A,M){if(v6=-1,nv=0,Yi&6)throw Error(n(327));var Z=A.callbackNode;if(rb()&&A.callbackNode!==Z)return null;var me=Fe(A,A===Il?Xl:0);if(me===0)return null;if(me&30||me&A.expiredLanes||M)M=C6(A,me);else{M=me;var Pe=Yi;Yi|=2;var He=oI();(Il!==A||Xl!==M)&&(Ep=null,kx=Ee()+500,Ix(A,M));do try{DU();break}catch(hn){aI(A,hn)}while(!0);yp(),x6.current=He,Yi=Pe,Go!==null?M=0:(Il=null,Xl=0,M=cl)}if(M!==0){if(M===2&&(Pe=Ce(A),Pe!==0&&(me=Pe,M=J8(A,Pe))),M===1)throw Z=Z2,Ix(A,0),Wm(A,me),pu(A,Ee()),Z;if(M===6)Wm(A,me);else{if(Pe=A.current.alternate,!(me&30)&&!RU(Pe)&&(M=C6(A,me),M===2&&(He=Ce(A),He!==0&&(me=He,M=J8(A,He))),M===1))throw Z=Z2,Ix(A,0),Wm(A,me),pu(A,Ee()),Z;switch(A.finishedWork=Pe,A.finishedLanes=me,M){case 0:case 1:throw Error(n(345));case 2:Px(A,hu,Ep);break;case 3:if(Wm(A,me),(me&130023424)===me&&(M=X8+500-Ee(),10<M)){if(Fe(A,0)!==0)break;if(Pe=A.suspendedLanes,(Pe&me)!==me){Hc(),A.pingedLanes|=A.suspendedLanes&Pe;break}A.timeoutHandle=Tm(Px.bind(null,A,hu,Ep),M);break}Px(A,hu,Ep);break;case 4:if(Wm(A,me),(me&4194240)===me)break;for(M=A.eventTimes,Pe=-1;0<me;){var St=31-ue(me);He=1<<St,St=M[St],St>Pe&&(Pe=St),me&=~He}if(me=Pe,me=Ee()-me,me=(120>me?120:480>me?480:1080>me?1080:1920>me?1920:3e3>me?3e3:4320>me?4320:1960*sI(me/1960))-me,10<me){A.timeoutHandle=Tm(Px.bind(null,A,hu,Ep),me);break}Px(A,hu,Ep);break;case 5:Px(A,hu,Ep);break;default:throw Error(n(329))}}}return pu(A,Ee()),A.callbackNode===Z?w6.bind(null,A):null}function J8(A,M){var Z=ev;return A.current.memoizedState.isDehydrated&&(Ix(A,M).flags|=256),A=C6(A,M),A!==2&&(M=hu,hu=Z,M!==null&&e7(M)),A}function e7(A){hu===null?hu=A:hu.push.apply(hu,A)}function RU(A){for(var M=A;;){if(M.flags&16384){var Z=M.updateQueue;if(Z!==null&&(Z=Z.stores,Z!==null))for(var me=0;me<Z.length;me++){var Pe=Z[me],He=Pe.getSnapshot;Pe=Pe.value;try{if(!Kt(He(),Pe))return!1}catch{return!1}}}if(Z=M.child,M.subtreeFlags&16384&&Z!==null)Z.return=M,M=Z;else{if(M===A)break;for(;M.sibling===null;){if(M.return===null||M.return===A)return!0;M=M.return}M.sibling.return=M.return,M=M.sibling}}return!0}function Wm(A,M){for(M&=~g6,M&=~J2,A.suspendedLanes|=M,A.pingedLanes&=~M,A=A.expirationTimes;0<M;){var Z=31-ue(M),me=1<<Z;A[Z]=-1,M&=~me}}function iI(A){if(Yi&6)throw Error(n(327));rb();var M=Fe(A,0);if(!(M&1))return pu(A,Ee()),null;var Z=C6(A,M);if(A.tag!==0&&Z===2){var me=Ce(A);me!==0&&(M=me,Z=J8(A,me))}if(Z===1)throw Z=Z2,Ix(A,0),Wm(A,M),pu(A,Ee()),Z;if(Z===6)throw Error(n(345));return A.finishedWork=A.current.alternate,A.finishedLanes=M,Px(A,hu,Ep),pu(A,Ee()),null}function t7(A,M){var Z=Yi;Yi|=1;try{return A(M)}finally{Yi=Z,Yi===0&&(kx=Ee()+500,U5&&Om())}}function Tx(A){Hm!==null&&Hm.tag===0&&!(Yi&6)&&rb();var M=Yi;Yi|=1;var Z=kd.transition,me=gt;try{if(kd.transition=null,gt=1,A)return A()}finally{gt=me,kd.transition=Z,Yi=M,!(Yi&6)&&Om()}}function n7(){Wu=nb.current,qa(nb)}function Ix(A,M){A.finishedWork=null,A.finishedLanes=0;var Z=A.timeoutHandle;if(Z!==-1&&(A.timeoutHandle=-1,I2(Z)),Go!==null)for(Z=Go.return;Z!==null;){var me=Z;switch(wx(me),me.tag){case 1:me=me.type.childContextTypes,me!=null&&$5();break;case 3:Lm(),qa(cu),qa(pc),Q5();break;case 5:X5(me);break;case 4:Lm();break;case 13:qa(eo);break;case 19:qa(eo);break;case 10:q5(me.type._context);break;case 22:case 23:n7()}Z=Z.return}if(Il=A,Go=A=wf(A.current,null),Xl=Wu=M,cl=0,Z2=null,g6=J2=Um=0,hu=ev=null,Sx!==null){for(M=0;M<Sx.length;M++)if(Z=Sx[M],me=Z.interleaved,me!==null){Z.interleaved=null;var Pe=me.next,He=Z.pending;if(He!==null){var St=He.next;He.next=Pe,me.next=St}Z.pending=me}Sx=null}return A}function aI(A,M){do{var Z=Go;try{if(yp(),D2.current=r6,q1){for(var me=fo.memoizedState;me!==null;){var Pe=me.queue;Pe!==null&&(Pe.pending=null),me=me.next}q1=!1}if(Dm=0,ll=Lo=fo=null,B2=!1,Ax=0,Y8.current=null,Z===null||Z.return===null){cl=1,Z2=M,Go=null;break}e:{var He=A,St=Z.return,hn=Z,_n=M;if(M=Xl,hn.flags|=32768,_n!==null&&typeof _n=="object"&&typeof _n.then=="function"){var ar=_n,Ur=hn,Wr=Ur.tag;if(!(Ur.mode&1)&&(Wr===0||Wr===11||Wr===15)){var $r=Ur.alternate;$r?(Ur.updateQueue=$r.updateQueue,Ur.memoizedState=$r.memoizedState,Ur.lanes=$r.lanes):(Ur.updateQueue=null,Ur.memoizedState=null)}var ds=KT(St);if(ds!==null){ds.flags&=-257,R8(ds,St,hn,He,M),ds.mode&1&&V2(He,ar,M),M=ds,_n=ar;var Ns=M.updateQueue;if(Ns===null){var Ts=new Set;Ts.add(_n),M.updateQueue=Ts}else Ns.add(_n);break e}else{if(!(M&1)){V2(He,ar,M),r7();break e}_n=Error(n(426))}}else if(Ga&&hn.mode&1){var Ao=KT(St);if(Ao!==null){!(Ao.flags&65536)&&(Ao.flags|=256),R8(Ao,St,hn,He,M),ah(_x(_n,hn));break e}}He=_n=_x(_n,hn),cl!==4&&(cl=2),ev===null?ev=[He]:ev.push(He),He=St;do{switch(He.tag){case 3:He.flags|=65536,M&=-M,He.lanes|=M;var Zn=H2(He,_n,M);$T(He,Zn);break e;case 1:hn=_n;var Ln=He.type,nr=He.stateNode;if(!(He.flags&128)&&(typeof Ln.getDerivedStateFromError=="function"||nr!==null&&typeof nr.componentDidCatch=="function"&&(zm===null||!zm.has(nr)))){He.flags|=65536,M&=-M,He.lanes|=M;var Xr=l6(He,hn,M);$T(He,Xr);break e}}He=He.return}while(He!==null)}cI(Z)}catch(Is){M=Is,Go===Z&&Z!==null&&(Go=Z=Z.return);continue}break}while(!0)}function oI(){var A=x6.current;return x6.current=r6,A===null?r6:A}function r7(){(cl===0||cl===3||cl===2)&&(cl=4),Il===null||!(Um&268435455)&&!(J2&268435455)||Wm(Il,Xl)}function C6(A,M){var Z=Yi;Yi|=2;var me=oI();(Il!==A||Xl!==M)&&(Ep=null,Ix(A,M));do try{LU();break}catch(Pe){aI(A,Pe)}while(!0);if(yp(),Yi=Z,x6.current=me,Go!==null)throw Error(n(261));return Il=null,Xl=0,cl}function LU(){for(;Go!==null;)lI(Go)}function DU(){for(;Go!==null&&!Lt();)lI(Go)}function lI(A){var M=dI(A.alternate,A,Wu);A.memoizedProps=A.pendingProps,M===null?cI(A):Go=M,Y8.current=null}function cI(A){var M=A;do{var Z=M.alternate;if(A=M.return,M.flags&32768){if(Z=OU(Z,M),Z!==null){Z.flags&=32767,Go=Z;return}if(A!==null)A.flags|=32768,A.subtreeFlags=0,A.deletions=null;else{cl=6,Go=null;return}}else if(Z=FU(Z,M,Wu),Z!==null){Go=Z;return}if(M=M.sibling,M!==null){Go=M;return}Go=M=A}while(M!==null);cl===0&&(cl=5)}function Px(A,M,Z){var me=gt,Pe=kd.transition;try{kd.transition=null,gt=1,BU(A,M,Z,me)}finally{kd.transition=Pe,gt=me}return null}function BU(A,M,Z,me){do rb();while(Hm!==null);if(Yi&6)throw Error(n(327));Z=A.finishedWork;var Pe=A.finishedLanes;if(Z===null)return null;if(A.finishedWork=null,A.finishedLanes=0,Z===A.current)throw Error(n(177));A.callbackNode=null,A.callbackPriority=0;var He=Z.lanes|Z.childLanes;if(Je(A,He),A===Il&&(Go=Il=null,Xl=0),!(Z.subtreeFlags&2064)&&!(Z.flags&2064)||y6||(y6=!0,fI(_,function(){return rb(),null})),He=(Z.flags&15990)!==0,Z.subtreeFlags&15990||He){He=kd.transition,kd.transition=null;var St=gt;gt=1;var hn=Yi;Yi|=4,Y8.current=null,MU(A,Z),G8(Z,A),dc(gx),tr=!!k2,gx=k2=null,A.current=Z,m6(Z),jn(),Yi=hn,gt=St,kd.transition=He}else A.current=Z;if(y6&&(y6=!1,Hm=A,zc=Pe),He=A.pendingLanes,He===0&&(zm=null),te(Z.stateNode),pu(A,Ee()),M!==null)for(me=A.onRecoverableError,Z=0;Z<M.length;Z++)Pe=M[Z],me(Pe.value,{componentStack:Pe.stack,digest:Pe.digest});if(b6)throw b6=!1,A=Q8,Q8=null,A;return zc&1&&A.tag!==0&&rb(),He=A.pendingLanes,He&1?A===Z8?tv++:(tv=0,Z8=A):tv=0,Om(),null}function rb(){if(Hm!==null){var A=Xt(zc),M=kd.transition,Z=gt;try{if(kd.transition=null,gt=16>A?16:A,Hm===null)var me=!1;else{if(A=Hm,Hm=null,zc=0,Yi&6)throw Error(n(331));var Pe=Yi;for(Yi|=4,ys=A.current;ys!==null;){var He=ys,St=He.child;if(ys.flags&16){var hn=He.deletions;if(hn!==null){for(var _n=0;_n<hn.length;_n++){var ar=hn[_n];for(ys=ar;ys!==null;){var Ur=ys;switch(Ur.tag){case 0:case 11:case 15:jp(8,Ur,He)}var Wr=Ur.child;if(Wr!==null)Wr.return=Ur,ys=Wr;else for(;ys!==null;){Ur=ys;var $r=Ur.sibling,ds=Ur.return;if(eI(Ur),Ur===ar){ys=null;break}if($r!==null){$r.return=ds,ys=$r;break}ys=ds}}}var Ns=He.alternate;if(Ns!==null){var Ts=Ns.child;if(Ts!==null){Ns.child=null;do{var Ao=Ts.sibling;Ts.sibling=null,Ts=Ao}while(Ts!==null)}}ys=He}}if(He.subtreeFlags&2064&&St!==null)St.return=He,ys=St;else e:for(;ys!==null;){if(He=ys,He.flags&2048)switch(He.tag){case 0:case 11:case 15:jp(9,He,He.return)}var Zn=He.sibling;if(Zn!==null){Zn.return=He.return,ys=Zn;break e}ys=He.return}}var Ln=A.current;for(ys=Ln;ys!==null;){St=ys;var nr=St.child;if(St.subtreeFlags&2064&&nr!==null)nr.return=St,ys=nr;else e:for(St=Ln;ys!==null;){if(hn=ys,hn.flags&2048)try{switch(hn.tag){case 0:case 11:case 15:Q2(9,hn)}}catch(Is){ho(hn,hn.return,Is)}if(hn===St){ys=null;break e}var Xr=hn.sibling;if(Xr!==null){Xr.return=hn.return,ys=Xr;break e}ys=hn.return}}if(Yi=Pe,Om(),q&&typeof q.onPostCommitFiberRoot=="function")try{q.onPostCommitFiberRoot(B,A)}catch{}me=!0}return me}finally{gt=Z,kd.transition=M}}return!1}function S6(A,M,Z){M=_x(Z,M),M=H2(A,M,1),A=jd(A,M,1),M=Hc(),A!==null&&(_e(A,1,M),pu(A,M))}function ho(A,M,Z){if(A.tag===3)S6(A,A,Z);else for(;M!==null;){if(M.tag===3){S6(M,A,Z);break}else if(M.tag===1){var me=M.stateNode;if(typeof M.type.getDerivedStateFromError=="function"||typeof me.componentDidCatch=="function"&&(zm===null||!zm.has(me))){A=_x(Z,A),A=l6(M,A,1),M=jd(M,A,1),A=Hc(),M!==null&&(_e(M,1,A),pu(M,A));break}}M=M.return}}function $U(A,M,Z){var me=A.pingCache;me!==null&&me.delete(M),M=Hc(),A.pingedLanes|=A.suspendedLanes&Z,Il===A&&(Xl&Z)===Z&&(cl===4||cl===3&&(Xl&130023424)===Xl&&500>Ee()-X8?Ix(A,0):g6|=Z),pu(A,M)}function uI(A,M){M===0&&(A.mode&1?(M=Re,Re<<=1,!(Re&130023424)&&(Re=4194304)):M=1);var Z=Hc();A=vp(A,M),A!==null&&(_e(A,M,Z),pu(A,Z))}function UU(A){var M=A.memoizedState,Z=0;M!==null&&(Z=M.retryLane),uI(A,Z)}function zU(A,M){var Z=0;switch(A.tag){case 13:var me=A.stateNode,Pe=A.memoizedState;Pe!==null&&(Z=Pe.retryLane);break;case 19:me=A.stateNode;break;default:throw Error(n(314))}me!==null&&me.delete(M),uI(A,Z)}var dI;dI=function(A,M,Z){if(A!==null)if(A.memoizedProps!==M.pendingProps||cu.current)$c=!0;else{if(!(A.lanes&Z)&&!(M.flags&128))return $c=!1,QT(A,M,Z);$c=!!(A.flags&131072)}else $c=!1,Ga&&M.flags&1048576&&MT(M,H5,M.index);switch(M.lanes=0,M.tag){case 2:var me=M.type;d6(A,M),A=M.pendingProps;var Pe=U1(M,pc.current);Rm(M,Z),Pe=jx(null,M,me,A,Pe,Z);var He=Z5();return M.flags|=1,typeof Pe=="object"&&Pe!==null&&typeof Pe.render=="function"&&Pe.$$typeof===void 0?(M.tag=1,M.memoizedState=null,M.updateQueue=null,uu(me)?(He=!0,wd(M)):He=!1,M.memoizedState=Pe.state!==null&&Pe.state!==void 0?Pe.state:null,K5(M),Pe.updater=a6,M.stateNode=Pe,Pe._reactInternals=M,M8(M,me,A,Z),M=z8(null,M,me,!0,He,Z)):(M.tag=0,Ga&&He&&P2(M),Gl(null,M,Pe,Z),M=M.child),M;case 16:me=M.elementType;e:{switch(d6(A,M),A=M.pendingProps,Pe=me._init,me=Pe(me._payload),M.type=me,Pe=M.tag=VU(me),A=_d(me,A),Pe){case 0:M=$8(null,M,me,A,Z);break e;case 1:M=U8(null,M,me,A,Z);break e;case 11:M=YT(null,M,me,A,Z);break e;case 14:M=L8(null,M,me,_d(me.type,A),Z);break e}throw Error(n(306,me,""))}return M;case 0:return me=M.type,Pe=M.pendingProps,Pe=M.elementType===me?Pe:_d(me,Pe),$8(A,M,me,Pe,Z);case 1:return me=M.type,Pe=M.pendingProps,Pe=M.elementType===me?Pe:_d(me,Pe),U8(A,M,me,Pe,Z);case 3:e:{if(XT(M),A===null)throw Error(n(387));me=M.pendingProps,He=M.memoizedState,Pe=He.element,BT(A,M),V1(M,me,null,Z);var St=M.memoizedState;if(me=St.element,He.isDehydrated)if(He={element:me,isDehydrated:!1,cache:St.cache,pendingSuspenseBoundaries:St.pendingSuspenseBoundaries,transitions:St.transitions},M.updateQueue.baseState=He,M.memoizedState=He,M.flags&256){Pe=_x(Error(n(423)),M),M=dh(A,M,me,Z,Pe);break e}else if(me!==Pe){Pe=_x(Error(n(424)),M),M=dh(A,M,me,Z,Pe);break e}else for(zu=Im(M.stateNode.containerInfo.firstChild),xc=M,Ga=!0,pf=null,Z=W5(M,null,me,Z),M.child=Z;Z;)Z.flags=Z.flags&-3|4096,Z=Z.sibling;else{if(ih(),me===Pe){M=xf(A,M,Z);break e}Gl(A,M,me,Z)}M=M.child}return M;case 5:return C8(M),A===null&&du(M),me=M.type,Pe=M.pendingProps,He=A!==null?A.memoizedProps:null,St=Pe.children,T2(me,Pe)?St=null:He!==null&&T2(me,He)&&(M.flags|=32),B8(A,M),Gl(A,M,St,Z),M.child;case 6:return A===null&&du(M),null;case 13:return u6(A,M,Z);case 4:return w8(M,M.stateNode.containerInfo),me=M.pendingProps,A===null?M.child=No(M,null,me,Z):Gl(A,M,me,Z),M.child;case 11:return me=M.type,Pe=M.pendingProps,Pe=M.elementType===me?Pe:_d(me,Pe),YT(A,M,me,Pe,Z);case 7:return Gl(A,M,M.pendingProps,Z),M.child;case 8:return Gl(A,M,M.pendingProps.children,Z),M.child;case 12:return Gl(A,M,M.pendingProps.children,Z),M.child;case 10:e:{if(me=M.type._context,Pe=M.pendingProps,He=M.memoizedProps,St=Pe.value,$a(M2,me._currentValue),me._currentValue=St,He!==null)if(Kt(He.value,St)){if(He.children===Pe.children&&!cu.current){M=xf(A,M,Z);break e}}else for(He=M.child,He!==null&&(He.return=M);He!==null;){var hn=He.dependencies;if(hn!==null){St=He.child;for(var _n=hn.firstContext;_n!==null;){if(_n.context===me){if(He.tag===1){_n=wp(-1,Z&-Z),_n.tag=2;var ar=He.updateQueue;if(ar!==null){ar=ar.shared;var Ur=ar.pending;Ur===null?_n.next=_n:(_n.next=Ur.next,Ur.next=_n),ar.pending=_n}}He.lanes|=Z,_n=He.alternate,_n!==null&&(_n.lanes|=Z),ql(He.return,Z,M),hn.lanes|=Z;break}_n=_n.next}}else if(He.tag===10)St=He.type===M.type?null:He.child;else if(He.tag===18){if(St=He.return,St===null)throw Error(n(341));St.lanes|=Z,hn=St.alternate,hn!==null&&(hn.lanes|=Z),ql(St,Z,M),St=He.sibling}else St=He.child;if(St!==null)St.return=He;else for(St=He;St!==null;){if(St===M){St=null;break}if(He=St.sibling,He!==null){He.return=St.return,St=He;break}St=St.return}He=St}Gl(A,M,Pe.children,Z),M=M.child}return M;case 9:return Pe=M.type,me=M.pendingProps.children,Rm(M,Z),Pe=Nd(Pe),me=me(Pe),M.flags|=1,Gl(A,M,me,Z),M.child;case 14:return me=M.type,Pe=_d(me,M.pendingProps),Pe=_d(me.type,Pe),L8(A,M,me,Pe,Z);case 15:return uh(A,M,M.type,M.pendingProps,Z);case 17:return me=M.type,Pe=M.pendingProps,Pe=M.elementType===me?Pe:_d(me,Pe),d6(A,M),M.tag=1,uu(me)?(A=!0,wd(M)):A=!1,Rm(M,Z),Ex(M,me,Pe),M8(M,me,Pe,Z),z8(null,M,me,!0,A,Z);case 19:return Bm(A,M,Z);case 22:return D8(A,M,Z)}throw Error(n(156,M.tag))};function fI(A,M){return zn(A,M)}function HU(A,M,Z,me){this.tag=A,this.key=Z,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=M,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=me,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Td(A,M,Z,me){return new HU(A,M,Z,me)}function N6(A){return A=A.prototype,!(!A||!A.isReactComponent)}function VU(A){if(typeof A=="function")return N6(A)?1:0;if(A!=null){if(A=A.$$typeof,A===X)return 11;if(A===Y)return 14}return 2}function wf(A,M){var Z=A.alternate;return Z===null?(Z=Td(A.tag,M,A.key,A.mode),Z.elementType=A.elementType,Z.type=A.type,Z.stateNode=A.stateNode,Z.alternate=A,A.alternate=Z):(Z.pendingProps=M,Z.type=A.type,Z.flags=0,Z.subtreeFlags=0,Z.deletions=null),Z.flags=A.flags&14680064,Z.childLanes=A.childLanes,Z.lanes=A.lanes,Z.child=A.child,Z.memoizedProps=A.memoizedProps,Z.memoizedState=A.memoizedState,Z.updateQueue=A.updateQueue,M=A.dependencies,Z.dependencies=M===null?null:{lanes:M.lanes,firstContext:M.firstContext},Z.sibling=A.sibling,Z.index=A.index,Z.ref=A.ref,Z}function A6(A,M,Z,me,Pe,He){var St=2;if(me=A,typeof A=="function")N6(A)&&(St=1);else if(typeof A=="string")St=5;else e:switch(A){case L:return Fx(Z.children,Pe,He,M);case z:St=8,Pe|=8;break;case Q:return A=Td(12,Z,M,Pe|2),A.elementType=Q,A.lanes=He,A;case re:return A=Td(13,Z,M,Pe),A.elementType=re,A.lanes=He,A;case pe:return A=Td(19,Z,M,Pe),A.elementType=pe,A.lanes=He,A;case oe:return j6(Z,Pe,He,M);default:if(typeof A=="object"&&A!==null)switch(A.$$typeof){case ne:St=10;break e;case J:St=9;break e;case X:St=11;break e;case Y:St=14;break e;case ie:St=16,me=null;break e}throw Error(n(130,A==null?A:typeof A,""))}return M=Td(St,Z,M,Pe),M.elementType=A,M.type=me,M.lanes=He,M}function Fx(A,M,Z,me){return A=Td(7,A,me,M),A.lanes=Z,A}function j6(A,M,Z,me){return A=Td(22,A,me,M),A.elementType=oe,A.lanes=Z,A.stateNode={isHidden:!1},A}function s7(A,M,Z){return A=Td(6,A,null,M),A.lanes=Z,A}function i7(A,M,Z){return M=Td(4,A.children!==null?A.children:[],A.key,M),M.lanes=Z,M.stateNode={containerInfo:A.containerInfo,pendingChildren:null,implementation:A.implementation},M}function WU(A,M,Z,me,Pe){this.tag=M,this.containerInfo=A,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=De(0),this.expirationTimes=De(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=De(0),this.identifierPrefix=me,this.onRecoverableError=Pe,this.mutableSourceEagerHydrationData=null}function a7(A,M,Z,me,Pe,He,St,hn,_n){return A=new WU(A,M,Z,hn,_n),M===1?(M=1,He===!0&&(M|=8)):M=0,He=Td(3,null,null,M),A.current=He,He.stateNode=A,He.memoizedState={element:me,isDehydrated:Z,cache:null,transitions:null,pendingSuspenseBoundaries:null},K5(He),A}function qU(A,M,Z){var me=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:U,key:me==null?null:""+me,children:A,containerInfo:M,implementation:Z}}function hI(A){if(!A)return Fm;A=A._reactInternals;e:{if(tn(A)!==A||A.tag!==1)throw Error(n(170));var M=A;do{switch(M.tag){case 3:M=M.stateNode.context;break e;case 1:if(uu(M.type)){M=M.stateNode.__reactInternalMemoizedMergedChildContext;break e}}M=M.return}while(M!==null);throw Error(n(171))}if(A.tag===1){var Z=A.type;if(uu(Z))return PT(A,Z,M)}return M}function pI(A,M,Z,me,Pe,He,St,hn,_n){return A=a7(Z,me,!0,A,Pe,He,St,hn,_n),A.context=hI(null),Z=A.current,me=Hc(),Pe=Vm(Z),He=wp(me,Pe),He.callback=M??null,jd(Z,He,Pe),A.current.lanes=Pe,_e(A,Pe,me),pu(A,me),A}function E6(A,M,Z,me){var Pe=M.current,He=Hc(),St=Vm(Pe);return Z=hI(Z),M.context===null?M.context=Z:M.pendingContext=Z,M=wp(He,St),M.payload={element:A},me=me===void 0?null:me,me!==null&&(M.callback=me),A=jd(Pe,M,St),A!==null&&(vf(A,Pe,St,He),Y5(A,Pe,St)),St}function _6(A){if(A=A.current,!A.child)return null;switch(A.child.tag){case 5:return A.child.stateNode;default:return A.child.stateNode}}function mI(A,M){if(A=A.memoizedState,A!==null&&A.dehydrated!==null){var Z=A.retryLane;A.retryLane=Z!==0&&Z<M?Z:M}}function o7(A,M){mI(A,M),(A=A.alternate)&&mI(A,M)}var xI=typeof reportError=="function"?reportError:function(A){console.error(A)};function l7(A){this._internalRoot=A}rv.prototype.render=l7.prototype.render=function(A){var M=this._internalRoot;if(M===null)throw Error(n(409));E6(A,M,null,null)},rv.prototype.unmount=l7.prototype.unmount=function(){var A=this._internalRoot;if(A!==null){this._internalRoot=null;var M=A.containerInfo;Tx(function(){E6(null,A,null,null)}),M[Uu]=null}};function rv(A){this._internalRoot=A}rv.prototype.unstable_scheduleHydration=function(A){if(A){var M=bt();A={blockedOn:null,target:A,priority:M};for(var Z=0;Z<$n.length&&M!==0&&M<$n[Z].priority;Z++);$n.splice(Z,0,A),Z===0&&Rr(A)}};function k6(A){return!(!A||A.nodeType!==1&&A.nodeType!==9&&A.nodeType!==11)}function T6(A){return!(!A||A.nodeType!==1&&A.nodeType!==9&&A.nodeType!==11&&(A.nodeType!==8||A.nodeValue!==" react-mount-point-unstable "))}function gI(){}function GU(A,M,Z,me,Pe){if(Pe){if(typeof me=="function"){var He=me;me=function(){var ar=_6(St);He.call(ar)}}var St=pI(M,me,A,0,null,!1,!1,"",gI);return A._reactRootContainer=St,A[Uu]=St.current,km(A.nodeType===8?A.parentNode:A),Tx(),St}for(;Pe=A.lastChild;)A.removeChild(Pe);if(typeof me=="function"){var hn=me;me=function(){var ar=_6(_n);hn.call(ar)}}var _n=a7(A,0,!1,null,null,!1,!1,"",gI);return A._reactRootContainer=_n,A[Uu]=_n.current,km(A.nodeType===8?A.parentNode:A),Tx(function(){E6(M,_n,Z,me)}),_n}function I6(A,M,Z,me,Pe){var He=Z._reactRootContainer;if(He){var St=He;if(typeof Pe=="function"){var hn=Pe;Pe=function(){var _n=_6(St);hn.call(_n)}}E6(M,St,A,Pe)}else St=GU(Z,M,A,Pe,me);return _6(St)}wt=function(A){switch(A.tag){case 3:var M=A.stateNode;if(M.current.memoizedState.isDehydrated){var Z=Ge(M.pendingLanes);Z!==0&&(ct(M,Z|1),pu(M,Ee()),!(Yi&6)&&(kx=Ee()+500,Om()))}break;case 13:Tx(function(){var me=vp(A,1);if(me!==null){var Pe=Hc();vf(me,A,1,Pe)}}),o7(A,1)}},Xe=function(A){if(A.tag===13){var M=vp(A,134217728);if(M!==null){var Z=Hc();vf(M,A,134217728,Z)}o7(A,134217728)}},Oe=function(A){if(A.tag===13){var M=Vm(A),Z=vp(A,M);if(Z!==null){var me=Hc();vf(Z,A,M,me)}o7(A,M)}},bt=function(){return gt},kt=function(A,M){var Z=gt;try{return gt=A,M()}finally{gt=Z}},Dt=function(A,M,Z){switch(M){case"input":if(ut(A,Z),M=Z.name,Z.type==="radio"&&M!=null){for(Z=A;Z.parentNode;)Z=Z.parentNode;for(Z=Z.querySelectorAll("input[name="+JSON.stringify(""+M)+'][type="radio"]'),M=0;M<Z.length;M++){var me=Z[M];if(me!==A&&me.form===A.form){var Pe=B5(me);if(!Pe)throw Error(n(90));$e(me),ut(me,Pe)}}}break;case"textarea":Ft(A,Z);break;case"select":M=Z.value,M!=null&&jt(A,!!Z.multiple,M,!1)}},kn=t7,yn=Tx;var P6={usingClientEntryPoint:!1,Events:[hc,Ci,B5,gn,Nn,t7]},sv={findFiberByHostInstance:th,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},KU={bundleType:sv.bundleType,version:sv.version,rendererPackageName:sv.rendererPackageName,rendererConfig:sv.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:R.ReactCurrentDispatcher,findHostInstanceByFiber:function(A){return A=lr(A),A===null?null:A.stateNode},findFiberByHostInstance:sv.findFiberByHostInstance,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var F6=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!F6.isDisabled&&F6.supportsFiber)try{B=F6.inject(KU),q=F6}catch{}}return Od.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=P6,Od.createPortal=function(A,M){var Z=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!k6(M))throw Error(n(200));return qU(A,M,null,Z)},Od.createRoot=function(A,M){if(!k6(A))throw Error(n(299));var Z=!1,me="",Pe=xI;return M!=null&&(M.unstable_strictMode===!0&&(Z=!0),M.identifierPrefix!==void 0&&(me=M.identifierPrefix),M.onRecoverableError!==void 0&&(Pe=M.onRecoverableError)),M=a7(A,1,!1,null,null,Z,!1,me,Pe),A[Uu]=M.current,km(A.nodeType===8?A.parentNode:A),new l7(M)},Od.findDOMNode=function(A){if(A==null)return null;if(A.nodeType===1)return A;var M=A._reactInternals;if(M===void 0)throw typeof A.render=="function"?Error(n(188)):(A=Object.keys(A).join(","),Error(n(268,A)));return A=lr(M),A=A===null?null:A.stateNode,A},Od.flushSync=function(A){return Tx(A)},Od.hydrate=function(A,M,Z){if(!T6(M))throw Error(n(200));return I6(null,A,M,!0,Z)},Od.hydrateRoot=function(A,M,Z){if(!k6(A))throw Error(n(405));var me=Z!=null&&Z.hydratedSources||null,Pe=!1,He="",St=xI;if(Z!=null&&(Z.unstable_strictMode===!0&&(Pe=!0),Z.identifierPrefix!==void 0&&(He=Z.identifierPrefix),Z.onRecoverableError!==void 0&&(St=Z.onRecoverableError)),M=pI(M,null,A,1,Z??null,Pe,!1,He,St),A[Uu]=M.current,km(A),me)for(A=0;A<me.length;A++)Z=me[A],Pe=Z._getVersion,Pe=Pe(Z._source),M.mutableSourceEagerHydrationData==null?M.mutableSourceEagerHydrationData=[Z,Pe]:M.mutableSourceEagerHydrationData.push(Z,Pe);return new rv(M)},Od.render=function(A,M,Z){if(!T6(M))throw Error(n(200));return I6(null,A,M,!1,Z)},Od.unmountComponentAtNode=function(A){if(!T6(A))throw Error(n(40));return A._reactRootContainer?(Tx(function(){I6(null,null,A,!1,function(){A._reactRootContainer=null,A[Uu]=null})}),!0):!1},Od.unstable_batchedUpdates=t7,Od.unstable_renderSubtreeIntoContainer=function(A,M,Z,me){if(!T6(Z))throw Error(n(200));if(A==null||A._reactInternals===void 0)throw Error(n(38));return I6(A,M,Z,!1,me)},Od.version="18.3.1-next-f1338f8080-20240426",Od}var Sde;function ONe(){if(Sde)return uz.exports;Sde=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),uz.exports=nKe(),uz.exports}var Nde;function rKe(){if(Nde)return wI;Nde=1;var e=ONe();return wI.createRoot=e.createRoot,wI.hydrateRoot=e.hydrateRoot,wI}var MNe=rKe(),m=ax();const Ae=Ti(m),Iy=FNe({__proto__:null,default:Ae},[m]);var Na=ONe();const vre=Ti(Na);/**
* @remix-run/router v1.19.2
*
* Copyright (c) Remix Software Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE.md file in the root directory of this source tree.
*
* @license MIT
*/function b9(){return b9=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},b9.apply(this,arguments)}var uy;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(uy||(uy={}));const Ade="popstate";function sKe(e){e===void 0&&(e={});function t(r,s){let{pathname:a,search:o,hash:l}=r.location;return lQ("",{pathname:a,search:o,hash:l},s.state&&s.state.usr||null,s.state&&s.state.key||"default")}function n(r,s){return typeof s=="string"?s:OO(s)}return aKe(t,n,null,e)}function Ho(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function RNe(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function iKe(){return Math.random().toString(36).substr(2,8)}function jde(e,t){return{usr:e.state,key:e.key,idx:t}}function lQ(e,t,n,r){return n===void 0&&(n=null),b9({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?JN(t):t,{state:n,key:t&&t.key||r||iKe()})}function OO(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function JN(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function aKe(e,t,n,r){r===void 0&&(r={});let{window:s=document.defaultView,v5Compat:a=!1}=r,o=s.history,l=uy.Pop,c=null,u=d();u==null&&(u=0,o.replaceState(b9({},o.state,{idx:u}),""));function d(){return(o.state||{idx:null}).idx}function f(){l=uy.Pop;let C=d(),N=C==null?null:C-u;u=C,c&&c({action:l,location:w.location,delta:N})}function x(C,N){l=uy.Push;let P=lQ(w.location,C,N);u=d()+1;let I=jde(P,u),R=w.createHref(P);try{o.pushState(I,"",R)}catch(F){if(F instanceof DOMException&&F.name==="DataCloneError")throw F;s.location.assign(R)}a&&c&&c({action:l,location:w.location,delta:1})}function g(C,N){l=uy.Replace;let P=lQ(w.location,C,N);u=d();let I=jde(P,u),R=w.createHref(P);o.replaceState(I,"",R),a&&c&&c({action:l,location:w.location,delta:0})}function v(C){let N=s.location.origin!=="null"?s.location.origin:s.location.href,P=typeof C=="string"?C:OO(C);return P=P.replace(/ $/,"%20"),Ho(N,"No window.location.(origin|href) available to create URL for href: "+P),new URL(P,N)}let w={get action(){return l},get location(){return e(s,o)},listen(C){if(c)throw new Error("A history only accepts one active listener");return s.addEventListener(Ade,f),c=C,()=>{s.removeEventListener(Ade,f),c=null}},createHref(C){return t(s,C)},createURL:v,encodeLocation(C){let N=v(C);return{pathname:N.pathname,search:N.search,hash:N.hash}},push:x,replace:g,go(C){return o.go(C)}};return w}var Ede;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Ede||(Ede={}));function oKe(e,t,n){return n===void 0&&(n="/"),lKe(e,t,n)}function lKe(e,t,n,r){let s=typeof t=="string"?JN(t):t,a=CS(s.pathname||"/",n);if(a==null)return null;let o=LNe(e);cKe(o);let l=null;for(let c=0;l==null&&c<o.length;++c){let u=vKe(a);l=bKe(o[c],u)}return l}function LNe(e,t,n,r){t===void 0&&(t=[]),n===void 0&&(n=[]),r===void 0&&(r="");let s=(a,o,l)=>{let c={relativePath:l===void 0?a.path||"":l,caseSensitive:a.caseSensitive===!0,childrenIndex:o,route:a};c.relativePath.startsWith("/")&&(Ho(c.relativePath.startsWith(r),'Absolute route path "'+c.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),c.relativePath=c.relativePath.slice(r.length));let u=vy([r,c.relativePath]),d=n.concat(c);a.children&&a.children.length>0&&(Ho(a.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),LNe(a.children,t,d,u)),!(a.path==null&&!a.index)&&t.push({path:u,score:xKe(u,a.index),routesMeta:d})};return e.forEach((a,o)=>{var l;if(a.path===""||!((l=a.path)!=null&&l.includes("?")))s(a,o);else for(let c of DNe(a.path))s(a,o,c)}),t}function DNe(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,s=n.endsWith("?"),a=n.replace(/\?$/,"");if(r.length===0)return s?[a,""]:[a];let o=DNe(r.join("/")),l=[];return l.push(...o.map(c=>c===""?a:[a,c].join("/"))),s&&l.push(...o),l.map(c=>e.startsWith("/")&&c===""?"/":c)}function cKe(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:gKe(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const uKe=/^:[\w-]+$/,dKe=3,fKe=2,hKe=1,pKe=10,mKe=-2,_de=e=>e==="*";function xKe(e,t){let n=e.split("/"),r=n.length;return n.some(_de)&&(r+=mKe),t&&(r+=fKe),n.filter(s=>!_de(s)).reduce((s,a)=>s+(uKe.test(a)?dKe:a===""?hKe:pKe),r)}function gKe(e,t){return e.length===t.length&&e.slice(0,-1).every((r,s)=>r===t[s])?e[e.length-1]-t[t.length-1]:0}function bKe(e,t,n){let{routesMeta:r}=e,s={},a="/",o=[];for(let l=0;l<r.length;++l){let c=r[l],u=l===r.length-1,d=a==="/"?t:t.slice(a.length)||"/",f=cQ({path:c.relativePath,caseSensitive:c.caseSensitive,end:u},d),x=c.route;if(!f)return null;Object.assign(s,f.params),o.push({params:s,pathname:vy([a,f.pathname]),pathnameBase:NKe(vy([a,f.pathnameBase])),route:x}),f.pathnameBase!=="/"&&(a=vy([a,f.pathnameBase]))}return o}function cQ(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=yKe(e.path,e.caseSensitive,e.end),s=t.match(n);if(!s)return null;let a=s[0],o=a.replace(/(.)\/+$/,"$1"),l=s.slice(1);return{params:r.reduce((u,d,f)=>{let{paramName:x,isOptional:g}=d;if(x==="*"){let w=l[f]||"";o=a.slice(0,a.length-w.length).replace(/(.)\/+$/,"$1")}const v=l[f];return g&&!v?u[x]=void 0:u[x]=(v||"").replace(/%2F/g,"/"),u},{}),pathname:a,pathnameBase:o,pattern:e}}function yKe(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),RNe(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],s="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,l,c)=>(r.push({paramName:l,isOptional:c!=null}),c?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),s+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?s+="\\/*$":e!==""&&e!=="/"&&(s+="(?:(?=\\/|$))"),[new RegExp(s,t?void 0:"i"),r]}function vKe(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return RNe(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function CS(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function wKe(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:s=""}=typeof e=="string"?JN(e):e;return{pathname:n?n.startsWith("/")?n:CKe(n,t):t,search:AKe(r),hash:jKe(s)}}function CKe(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(s=>{s===".."?n.length>1&&n.pop():s!=="."&&n.push(s)}),n.length>1?n.join("/"):"/"}function hz(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function SKe(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function wre(e,t){let n=SKe(e);return t?n.map((r,s)=>s===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function Cre(e,t,n,r){r===void 0&&(r=!1);let s;typeof e=="string"?s=JN(e):(s=b9({},e),Ho(!s.pathname||!s.pathname.includes("?"),hz("?","pathname","search",s)),Ho(!s.pathname||!s.pathname.includes("#"),hz("#","pathname","hash",s)),Ho(!s.search||!s.search.includes("#"),hz("#","search","hash",s)));let a=e===""||s.pathname==="",o=a?"/":s.pathname,l;if(o==null)l=n;else{let f=t.length-1;if(!r&&o.startsWith("..")){let x=o.split("/");for(;x[0]==="..";)x.shift(),f-=1;s.pathname=x.join("/")}l=f>=0?t[f]:"/"}let c=wKe(s,l),u=o&&o!=="/"&&o.endsWith("/"),d=(a||o===".")&&n.endsWith("/");return!c.pathname.endsWith("/")&&(u||d)&&(c.pathname+="/"),c}const vy=e=>e.join("/").replace(/\/\/+/g,"/"),NKe=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),AKe=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,jKe=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function EKe(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const BNe=["post","put","patch","delete"];new Set(BNe);const _Ke=["get",...BNe];new Set(_Ke);/**
* React Router v6.26.2
*
* Copyright (c) Remix Software Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE.md file in the root directory of this source tree.
*
* @license MIT
*/function y9(){return y9=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},y9.apply(this,arguments)}const gD=m.createContext(null),$Ne=m.createContext(null),v1=m.createContext(null),bD=m.createContext(null),ox=m.createContext({outlet:null,matches:[],isDataRoute:!1}),UNe=m.createContext(null);function kKe(e,t){let{relative:n}=t===void 0?{}:t;eA()||Ho(!1);let{basename:r,navigator:s}=m.useContext(v1),{hash:a,pathname:o,search:l}=yD(e,{relative:n}),c=o;return r!=="/"&&(c=o==="/"?r:vy([r,o])),s.createHref({pathname:c,search:l,hash:a})}function eA(){return m.useContext(bD)!=null}function oc(){return eA()||Ho(!1),m.useContext(bD).location}function zNe(e){m.useContext(v1).static||m.useLayoutEffect(e)}function Vo(){let{isDataRoute:e}=m.useContext(ox);return e?VKe():TKe()}function TKe(){eA()||Ho(!1);let e=m.useContext(gD),{basename:t,future:n,navigator:r}=m.useContext(v1),{matches:s}=m.useContext(ox),{pathname:a}=oc(),o=JSON.stringify(wre(s,n.v7_relativeSplatPath)),l=m.useRef(!1);return zNe(()=>{l.current=!0}),m.useCallback(function(u,d){if(d===void 0&&(d={}),!l.current)return;if(typeof u=="number"){r.go(u);return}let f=Cre(u,JSON.parse(o),a,d.relative==="path");e==null&&t!=="/"&&(f.pathname=f.pathname==="/"?t:vy([t,f.pathname])),(d.replace?r.replace:r.push)(f,d.state,d)},[t,r,o,a,e])}const IKe=m.createContext(null);function PKe(e){let t=m.useContext(ox).outlet;return t&&m.createElement(IKe.Provider,{value:e},t)}function t5(){let{matches:e}=m.useContext(ox),t=e[e.length-1];return t?t.params:{}}function yD(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=m.useContext(v1),{matches:s}=m.useContext(ox),{pathname:a}=oc(),o=JSON.stringify(wre(s,r.v7_relativeSplatPath));return m.useMemo(()=>Cre(e,JSON.parse(o),a,n==="path"),[e,o,a,n])}function FKe(e,t){return OKe(e,t)}function OKe(e,t,n,r){eA()||Ho(!1);let{navigator:s}=m.useContext(v1),{matches:a}=m.useContext(ox),o=a[a.length-1],l=o?o.params:{};o&&o.pathname;let c=o?o.pathnameBase:"/";o&&o.route;let u=oc(),d;if(t){var f;let C=typeof t=="string"?JN(t):t;c==="/"||(f=C.pathname)!=null&&f.startsWith(c)||Ho(!1),d=C}else d=u;let x=d.pathname||"/",g=x;if(c!=="/"){let C=c.replace(/^\//,"").split("/");g="/"+x.replace(/^\//,"").split("/").slice(C.length).join("/")}let v=oKe(e,{pathname:g}),w=BKe(v&&v.map(C=>Object.assign({},C,{params:Object.assign({},l,C.params),pathname:vy([c,s.encodeLocation?s.encodeLocation(C.pathname).pathname:C.pathname]),pathnameBase:C.pathnameBase==="/"?c:vy([c,s.encodeLocation?s.encodeLocation(C.pathnameBase).pathname:C.pathnameBase])})),a,n,r);return t&&w?m.createElement(bD.Provider,{value:{location:y9({pathname:"/",search:"",hash:"",state:null,key:"default"},d),navigationType:uy.Pop}},w):w}function MKe(){let e=HKe(),t=EKe(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,s={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return m.createElement(m.Fragment,null,m.createElement("h2",null,"Unexpected Application Error!"),m.createElement("h3",{style:{fontStyle:"italic"}},t),n?m.createElement("pre",{style:s},n):null,null)}const RKe=m.createElement(MKe,null);class LKe extends m.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?m.createElement(ox.Provider,{value:this.props.routeContext},m.createElement(UNe.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function DKe(e){let{routeContext:t,match:n,children:r}=e,s=m.useContext(gD);return s&&s.static&&s.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=n.route.id),m.createElement(ox.Provider,{value:t},r)}function BKe(e,t,n,r){var s;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var a;if(!n)return null;if(n.errors)e=n.matches;else if((a=r)!=null&&a.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let o=e,l=(s=n)==null?void 0:s.errors;if(l!=null){let d=o.findIndex(f=>f.route.id&&(l==null?void 0:l[f.route.id])!==void 0);d>=0||Ho(!1),o=o.slice(0,Math.min(o.length,d+1))}let c=!1,u=-1;if(n&&r&&r.v7_partialHydration)for(let d=0;d<o.length;d++){let f=o[d];if((f.route.HydrateFallback||f.route.hydrateFallbackElement)&&(u=d),f.route.id){let{loaderData:x,errors:g}=n,v=f.route.loader&&x[f.route.id]===void 0&&(!g||g[f.route.id]===void 0);if(f.route.lazy||v){c=!0,u>=0?o=o.slice(0,u+1):o=[o[0]];break}}}return o.reduceRight((d,f,x)=>{let g,v=!1,w=null,C=null;n&&(g=l&&f.route.id?l[f.route.id]:void 0,w=f.route.errorElement||RKe,c&&(u<0&&x===0?(v=!0,C=null):u===x&&(v=!0,C=f.route.hydrateFallbackElement||null)));let N=t.concat(o.slice(0,x+1)),P=()=>{let I;return g?I=w:v?I=C:f.route.Component?I=m.createElement(f.route.Component,null):f.route.element?I=f.route.element:I=d,m.createElement(DKe,{match:f,routeContext:{outlet:d,matches:N,isDataRoute:n!=null},children:I})};return n&&(f.route.ErrorBoundary||f.route.errorElement||x===0)?m.createElement(LKe,{location:n.location,revalidation:n.revalidation,component:w,error:g,children:P(),routeContext:{outlet:null,matches:N,isDataRoute:!0}}):P()},null)}var HNe=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(HNe||{}),MO=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(MO||{});function $Ke(e){let t=m.useContext(gD);return t||Ho(!1),t}function UKe(e){let t=m.useContext($Ne);return t||Ho(!1),t}function zKe(e){let t=m.useContext(ox);return t||Ho(!1),t}function VNe(e){let t=zKe(),n=t.matches[t.matches.length-1];return n.route.id||Ho(!1),n.route.id}function HKe(){var e;let t=m.useContext(UNe),n=UKe(MO.UseRouteError),r=VNe(MO.UseRouteError);return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function VKe(){let{router:e}=$Ke(HNe.UseNavigateStable),t=VNe(MO.UseNavigateStable),n=m.useRef(!1);return zNe(()=>{n.current=!0}),m.useCallback(function(s,a){a===void 0&&(a={}),n.current&&(typeof s=="number"?e.navigate(s):e.navigate(s,y9({fromRouteId:t},a)))},[e,t])}function kde(e){let{to:t,replace:n,state:r,relative:s}=e;eA()||Ho(!1);let{future:a,static:o}=m.useContext(v1),{matches:l}=m.useContext(ox),{pathname:c}=oc(),u=Vo(),d=Cre(t,wre(l,a.v7_relativeSplatPath),c,s==="path"),f=JSON.stringify(d);return m.useEffect(()=>u(JSON.parse(f),{replace:n,state:r,relative:s}),[u,f,s,n,r]),null}function WKe(e){return PKe(e.context)}function ya(e){Ho(!1)}function qKe(e){let{basename:t="/",children:n=null,location:r,navigationType:s=uy.Pop,navigator:a,static:o=!1,future:l}=e;eA()&&Ho(!1);let c=t.replace(/^\/*/,"/"),u=m.useMemo(()=>({basename:c,navigator:a,static:o,future:y9({v7_relativeSplatPath:!1},l)}),[c,l,a,o]);typeof r=="string"&&(r=JN(r));let{pathname:d="/",search:f="",hash:x="",state:g=null,key:v="default"}=r,w=m.useMemo(()=>{let C=CS(d,c);return C==null?null:{location:{pathname:C,search:f,hash:x,state:g,key:v},navigationType:s}},[c,d,f,x,g,v,s]);return w==null?null:m.createElement(v1.Provider,{value:u},m.createElement(bD.Provider,{children:n,value:w}))}function GKe(e){let{children:t,location:n}=e;return FKe(uQ(t),n)}new Promise(()=>{});function uQ(e,t){t===void 0&&(t=[]);let n=[];return m.Children.forEach(e,(r,s)=>{if(!m.isValidElement(r))return;let a=[...t,s];if(r.type===m.Fragment){n.push.apply(n,uQ(r.props.children,a));return}r.type!==ya&&Ho(!1),!r.props.index||!r.props.children||Ho(!1);let o={id:r.props.id||a.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(o.children=uQ(r.props.children,a)),n.push(o)}),n}/**
* React Router DOM v6.26.2
*
* Copyright (c) Remix Software Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE.md file in the root directory of this source tree.
*
* @license MIT
*/function RO(){return RO=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},RO.apply(this,arguments)}function WNe(e,t){if(e==null)return{};var n={},r=Object.keys(e),s,a;for(a=0;a<r.length;a++)s=r[a],!(t.indexOf(s)>=0)&&(n[s]=e[s]);return n}function KKe(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function YKe(e,t){return e.button===0&&(!t||t==="_self")&&!KKe(e)}function dQ(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(s=>[n,s]):[[n,r]])},[]))}function XKe(e,t){let n=dQ(e);return t&&t.forEach((r,s)=>{n.has(s)||t.getAll(s).forEach(a=>{n.append(s,a)})}),n}const QKe=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","unstable_viewTransition"],ZKe=["aria-current","caseSensitive","className","end","style","to","unstable_viewTransition","children"],JKe="6";try{window.__reactRouterVersion=JKe}catch{}const eYe=m.createContext({isTransitioning:!1}),tYe="startTransition",Tde=Iy[tYe];function nYe(e){let{basename:t,children:n,future:r,window:s}=e,a=m.useRef();a.current==null&&(a.current=sKe({window:s,v5Compat:!0}));let o=a.current,[l,c]=m.useState({action:o.action,location:o.location}),{v7_startTransition:u}=r||{},d=m.useCallback(f=>{u&&Tde?Tde(()=>c(f)):c(f)},[c,u]);return m.useLayoutEffect(()=>o.listen(d),[o,d]),m.createElement(qKe,{basename:t,children:n,location:l.location,navigationType:l.action,navigator:o,future:r})}const rYe=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",sYe=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,hl=m.forwardRef(function(t,n){let{onClick:r,relative:s,reloadDocument:a,replace:o,state:l,target:c,to:u,preventScrollReset:d,unstable_viewTransition:f}=t,x=WNe(t,QKe),{basename:g}=m.useContext(v1),v,w=!1;if(typeof u=="string"&&sYe.test(u)&&(v=u,rYe))try{let I=new URL(window.location.href),R=u.startsWith("//")?new URL(I.protocol+u):new URL(u),F=CS(R.pathname,g);R.origin===I.origin&&F!=null?u=F+R.search+R.hash:w=!0}catch{}let C=kKe(u,{relative:s}),N=aYe(u,{replace:o,state:l,target:c,preventScrollReset:d,relative:s,unstable_viewTransition:f});function P(I){r&&r(I),I.defaultPrevented||N(I)}return m.createElement("a",RO({},x,{href:v||C,onClick:w||a?r:P,ref:n,target:c}))}),Ide=m.forwardRef(function(t,n){let{"aria-current":r="page",caseSensitive:s=!1,className:a="",end:o=!1,style:l,to:c,unstable_viewTransition:u,children:d}=t,f=WNe(t,ZKe),x=yD(c,{relative:f.relative}),g=oc(),v=m.useContext($Ne),{navigator:w,basename:C}=m.useContext(v1),N=v!=null&&oYe(x)&&u===!0,P=w.encodeLocation?w.encodeLocation(x).pathname:x.pathname,I=g.pathname,R=v&&v.navigation&&v.navigation.location?v.navigation.location.pathname:null;s||(I=I.toLowerCase(),R=R?R.toLowerCase():null,P=P.toLowerCase()),R&&C&&(R=CS(R,C)||R);const F=P!=="/"&&P.endsWith("/")?P.length-1:P.length;let U=I===P||!o&&I.startsWith(P)&&I.charAt(F)==="/",L=R!=null&&(R===P||!o&&R.startsWith(P)&&R.charAt(P.length)==="/"),z={isActive:U,isPending:L,isTransitioning:N},Q=U?r:void 0,ne;typeof a=="function"?ne=a(z):ne=[a,U?"active":null,L?"pending":null,N?"transitioning":null].filter(Boolean).join(" ");let J=typeof l=="function"?l(z):l;return m.createElement(hl,RO({},f,{"aria-current":Q,className:ne,ref:n,style:J,to:c,unstable_viewTransition:u}),typeof d=="function"?d(z):d)});var fQ;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(fQ||(fQ={}));var Pde;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Pde||(Pde={}));function iYe(e){let t=m.useContext(gD);return t||Ho(!1),t}function aYe(e,t){let{target:n,replace:r,state:s,preventScrollReset:a,relative:o,unstable_viewTransition:l}=t===void 0?{}:t,c=Vo(),u=oc(),d=yD(e,{relative:o});return m.useCallback(f=>{if(YKe(f,n)){f.preventDefault();let x=r!==void 0?r:OO(u)===OO(d);c(e,{replace:x,state:s,preventScrollReset:a,relative:o,unstable_viewTransition:l})}},[u,c,d,r,s,n,e,a,o,l])}function qNe(e){let t=m.useRef(dQ(e)),n=m.useRef(!1),r=oc(),s=m.useMemo(()=>XKe(r.search,n.current?null:t.current),[r.search]),a=Vo(),o=m.useCallback((l,c)=>{const u=dQ(typeof l=="function"?l(s):l);n.current=!0,a("?"+u,c)},[a,s]);return[s,o]}function oYe(e,t){t===void 0&&(t={});let n=m.useContext(eYe);n==null&&Ho(!1);let{basename:r}=iYe(fQ.useViewTransitionState),s=yD(e,{relative:t.relative});if(!n.isTransitioning)return!1;let a=CS(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=CS(n.nextLocation.pathname,r)||n.nextLocation.pathname;return cQ(s.pathname,o)!=null||cQ(s.pathname,a)!=null}let lYe={data:""},cYe=e=>typeof window=="object"?((e?e.querySelector("#_goober"):window._goober)||Object.assign((e||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:e||lYe,uYe=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,dYe=/\/\*[^]*?\*\/| +/g,Fde=/\n+/g,Pb=(e,t)=>{let n="",r="",s="";for(let a in e){let o=e[a];a[0]=="@"?a[1]=="i"?n=a+" "+o+";":r+=a[1]=="f"?Pb(o,a):a+"{"+Pb(o,a[1]=="k"?"":t)+"}":typeof o=="object"?r+=Pb(o,t?t.replace(/([^,])+/g,l=>a.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g,c=>/&/.test(c)?c.replace(/&/g,l):l?l+" "+c:c)):a):o!=null&&(a=/^--/.test(a)?a:a.replace(/[A-Z]/g,"-$&").toLowerCase(),s+=Pb.p?Pb.p(a,o):a+":"+o+";")}return n+(t&&s?t+"{"+s+"}":s)+r},Lx={},GNe=e=>{if(typeof e=="object"){let t="";for(let n in e)t+=n+GNe(e[n]);return t}return e},fYe=(e,t,n,r,s)=>{let a=GNe(e),o=Lx[a]||(Lx[a]=(c=>{let u=0,d=11;for(;u<c.length;)d=101*d+c.charCodeAt(u++)>>>0;return"go"+d})(a));if(!Lx[o]){let c=a!==e?e:(u=>{let d,f,x=[{}];for(;d=uYe.exec(u.replace(dYe,""));)d[4]?x.shift():d[3]?(f=d[3].replace(Fde," ").trim(),x.unshift(x[0][f]=x[0][f]||{})):x[0][d[1]]=d[2].replace(Fde," ").trim();return x[0]})(e);Lx[o]=Pb(s?{["@keyframes "+o]:c}:c,n?"":"."+o)}let l=n&&Lx.g?Lx.g:null;return n&&(Lx.g=Lx[o]),((c,u,d,f)=>{f?u.data=u.data.replace(f,c):u.data.indexOf(c)===-1&&(u.data=d?c+u.data:u.data+c)})(Lx[o],t,r,l),o},hYe=(e,t,n)=>e.reduce((r,s,a)=>{let o=t[a];if(o&&o.call){let l=o(n),c=l&&l.props&&l.props.className||/^go/.test(l)&&l;o=c?"."+c:l&&typeof l=="object"?l.props?"":Pb(l,""):l===!1?"":l}return r+s+(o??"")},"");function vD(e){let t=this||{},n=e.call?e(t.p):e;return fYe(n.unshift?n.raw?hYe(n,[].slice.call(arguments,1),t.p):n.reduce((r,s)=>Object.assign(r,s&&s.call?s(t.p):s),{}):n,cYe(t.target),t.g,t.o,t.k)}let KNe,hQ,pQ;vD.bind({g:1});let t1=vD.bind({k:1});function pYe(e,t,n,r){Pb.p=t,KNe=e,hQ=n,pQ=r}function e2(e,t){let n=this||{};return function(){let r=arguments;function s(a,o){let l=Object.assign({},a),c=l.className||s.className;n.p=Object.assign({theme:hQ&&hQ()},l),n.o=/ *go\d+/.test(c),l.className=vD.apply(n,r)+(c?" "+c:"");let u=e;return e[0]&&(u=l.as||e,delete l.as),pQ&&u[0]&&pQ(l),KNe(u,l)}return s}}var mYe=e=>typeof e=="function",LO=(e,t)=>mYe(e)?e(t):e,xYe=(()=>{let e=0;return()=>(++e).toString()})(),YNe=(()=>{let e;return()=>{if(e===void 0&&typeof window<"u"){let t=matchMedia("(prefers-reduced-motion: reduce)");e=!t||t.matches}return e}})(),gYe=20,NF=new Map,bYe=1e3,Ode=e=>{if(NF.has(e))return;let t=setTimeout(()=>{NF.delete(e),n5({type:4,toastId:e})},bYe);NF.set(e,t)},yYe=e=>{let t=NF.get(e);t&&clearTimeout(t)},mQ=(e,t)=>{switch(t.type){case 0:return{...e,toasts:[t.toast,...e.toasts].slice(0,gYe)};case 1:return t.toast.id&&yYe(t.toast.id),{...e,toasts:e.toasts.map(a=>a.id===t.toast.id?{...a,...t.toast}:a)};case 2:let{toast:n}=t;return e.toasts.find(a=>a.id===n.id)?mQ(e,{type:1,toast:n}):mQ(e,{type:0,toast:n});case 3:let{toastId:r}=t;return r?Ode(r):e.toasts.forEach(a=>{Ode(a.id)}),{...e,toasts:e.toasts.map(a=>a.id===r||r===void 0?{...a,visible:!1}:a)};case 4:return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(a=>a.id!==t.toastId)};case 5:return{...e,pausedAt:t.time};case 6:let s=t.time-(e.pausedAt||0);return{...e,pausedAt:void 0,toasts:e.toasts.map(a=>({...a,pauseDuration:a.pauseDuration+s}))}}},AF=[],jF={toasts:[],pausedAt:void 0},n5=e=>{jF=mQ(jF,e),AF.forEach(t=>{t(jF)})},vYe={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3},wYe=(e={})=>{let[t,n]=m.useState(jF);m.useEffect(()=>(AF.push(n),()=>{let s=AF.indexOf(n);s>-1&&AF.splice(s,1)}),[t]);let r=t.toasts.map(s=>{var a,o;return{...e,...e[s.type],...s,duration:s.duration||((a=e[s.type])==null?void 0:a.duration)||(e==null?void 0:e.duration)||vYe[s.type],style:{...e.style,...(o=e[s.type])==null?void 0:o.style,...s.style}}});return{...t,toasts:r}},CYe=(e,t="blank",n)=>({createdAt:Date.now(),visible:!0,type:t,ariaProps:{role:"status","aria-live":"polite"},message:e,pauseDuration:0,...n,id:(n==null?void 0:n.id)||xYe()}),pk=e=>(t,n)=>{let r=CYe(t,e,n);return n5({type:2,toast:r}),r.id},Bf=(e,t)=>pk("blank")(e,t);Bf.error=pk("error");Bf.success=pk("success");Bf.loading=pk("loading");Bf.custom=pk("custom");Bf.dismiss=e=>{n5({type:3,toastId:e})};Bf.remove=e=>n5({type:4,toastId:e});Bf.promise=(e,t,n)=>{let r=Bf.loading(t.loading,{...n,...n==null?void 0:n.loading});return e.then(s=>(Bf.success(LO(t.success,s),{id:r,...n,...n==null?void 0:n.success}),s)).catch(s=>{Bf.error(LO(t.error,s),{id:r,...n,...n==null?void 0:n.error})}),e};var SYe=(e,t)=>{n5({type:1,toast:{id:e,height:t}})},NYe=()=>{n5({type:5,time:Date.now()})},AYe=e=>{let{toasts:t,pausedAt:n}=wYe(e);m.useEffect(()=>{if(n)return;let a=Date.now(),o=t.map(l=>{if(l.duration===1/0)return;let c=(l.duration||0)+l.pauseDuration-(a-l.createdAt);if(c<0){l.visible&&Bf.dismiss(l.id);return}return setTimeout(()=>Bf.dismiss(l.id),c)});return()=>{o.forEach(l=>l&&clearTimeout(l))}},[t,n]);let r=m.useCallback(()=>{n&&n5({type:6,time:Date.now()})},[n]),s=m.useCallback((a,o)=>{let{reverseOrder:l=!1,gutter:c=8,defaultPosition:u}=o||{},d=t.filter(g=>(g.position||u)===(a.position||u)&&g.height),f=d.findIndex(g=>g.id===a.id),x=d.filter((g,v)=>v<f&&g.visible).length;return d.filter(g=>g.visible).slice(...l?[x+1]:[0,x]).reduce((g,v)=>g+(v.height||0)+c,0)},[t]);return{toasts:t,handlers:{updateHeight:SYe,startPause:NYe,endPause:r,calculateOffset:s}}},jYe=t1`
from {
transform: scale(0) rotate(45deg);
opacity: 0;
}
to {
transform: scale(1) rotate(45deg);
opacity: 1;
}`,EYe=t1`
from {
transform: scale(0);
opacity: 0;
}
to {
transform: scale(1);
opacity: 1;
}`,_Ye=t1`
from {
transform: scale(0) rotate(90deg);
opacity: 0;
}
to {
transform: scale(1) rotate(90deg);
opacity: 1;
}`,kYe=e2("div")`
width: 20px;
opacity: 0;
height: 20px;
border-radius: 10px;
background: ${e=>e.primary||"#ff4b4b"};
position: relative;
transform: rotate(45deg);
animation: ${jYe} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)
forwards;
animation-delay: 100ms;
&:after,
&:before {
content: '';
animation: ${EYe} 0.15s ease-out forwards;
animation-delay: 150ms;
position: absolute;
border-radius: 3px;
opacity: 0;
background: ${e=>e.secondary||"#fff"};
bottom: 9px;
left: 4px;
height: 2px;
width: 12px;
}
&:before {
animation: ${_Ye} 0.15s ease-out forwards;
animation-delay: 180ms;
transform: rotate(90deg);
}
`,TYe=t1`
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
`,XNe=e2("div")`
width: 12px;
height: 12px;
box-sizing: border-box;
border: 2px solid;
border-radius: 100%;
border-color: ${e=>e.secondary||"#e0e0e0"};
border-right-color: ${e=>e.primary||"#616161"};
animation: ${TYe} 1s linear infinite;
`,IYe=t1`
from {
transform: scale(0) rotate(45deg);
opacity: 0;
}
to {
transform: scale(1) rotate(45deg);
opacity: 1;
}`,PYe=t1`
0% {
height: 0;
width: 0;
opacity: 0;
}
40% {
height: 0;
width: 6px;
opacity: 1;
}
100% {
opacity: 1;
height: 10px;
}`,FYe=e2("div")`
width: 20px;
opacity: 0;
height: 20px;
border-radius: 10px;
background: ${e=>e.primary||"#61d345"};
position: relative;
transform: rotate(45deg);
animation: ${IYe} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)
forwards;
animation-delay: 100ms;
&:after {
content: '';
box-sizing: border-box;
animation: ${PYe} 0.2s ease-out forwards;
opacity: 0;
animation-delay: 200ms;
position: absolute;
border-right: 2px solid;
border-bottom: 2px solid;
border-color: ${e=>e.secondary||"#fff"};
bottom: 6px;
left: 6px;
height: 10px;
width: 6px;
}
`,OYe=e2("div")`
position: absolute;
`,MYe=e2("div")`
position: relative;
display: flex;
justify-content: center;
align-items: center;
min-width: 20px;
min-height: 20px;
`,RYe=t1`
from {
transform: scale(0.6);
opacity: 0.4;
}
to {
transform: scale(1);
opacity: 1;
}`,LYe=e2("div")`
position: relative;
transform: scale(0.6);
opacity: 0.4;
min-width: 20px;
animation: ${RYe} 0.3s 0.12s cubic-bezier(0.175, 0.885, 0.32, 1.275)
forwards;
`,DYe=({toast:e})=>{let{icon:t,type:n,iconTheme:r}=e;return t!==void 0?typeof t=="string"?m.createElement(LYe,null,t):t:n==="blank"?null:m.createElement(MYe,null,m.createElement(XNe,{...r}),n!=="loading"&&m.createElement(OYe,null,n==="error"?m.createElement(kYe,{...r}):m.createElement(FYe,{...r})))},BYe=e=>`
0% {transform: translate3d(0,${e*-200}%,0) scale(.6); opacity:.5;}
100% {transform: translate3d(0,0,0) scale(1); opacity:1;}
`,$Ye=e=>`
0% {transform: translate3d(0,0,-1px) scale(1); opacity:1;}
100% {transform: translate3d(0,${e*-150}%,-1px) scale(.6); opacity:0;}
`,UYe="0%{opacity:0;} 100%{opacity:1;}",zYe="0%{opacity:1;} 100%{opacity:0;}",HYe=e2("div")`
display: flex;
align-items: center;
background: #fff;
color: #363636;
line-height: 1.3;
will-change: transform;
box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1), 0 3px 3px rgba(0, 0, 0, 0.05);
max-width: 350px;
pointer-events: auto;
padding: 8px 10px;
border-radius: 8px;
`,VYe=e2("div")`
display: flex;
justify-content: center;
margin: 4px 10px;
color: inherit;
flex: 1 1 auto;
white-space: pre-line;
`,WYe=(e,t)=>{let n=e.includes("top")?1:-1,[r,s]=YNe()?[UYe,zYe]:[BYe(n),$Ye(n)];return{animation:t?`${t1(r)} 0.35s cubic-bezier(.21,1.02,.73,1) forwards`:`${t1(s)} 0.4s forwards cubic-bezier(.06,.71,.55,1)`}},qYe=m.memo(({toast:e,position:t,style:n,children:r})=>{let s=e.height?WYe(e.position||t||"top-center",e.visible):{opacity:0},a=m.createElement(DYe,{toast:e}),o=m.createElement(VYe,{...e.ariaProps},LO(e.message,e));return m.createElement(HYe,{className:e.className,style:{...s,...n,...e.style}},typeof r=="function"?r({icon:a,message:o}):m.createElement(m.Fragment,null,a,o))});pYe(m.createElement);var GYe=({id:e,className:t,style:n,onHeightUpdate:r,children:s})=>{let a=m.useCallback(o=>{if(o){let l=()=>{let c=o.getBoundingClientRect().height;r(e,c)};l(),new MutationObserver(l).observe(o,{subtree:!0,childList:!0,characterData:!0})}},[e,r]);return m.createElement("div",{ref:a,className:t,style:n},s)},KYe=(e,t)=>{let n=e.includes("top"),r=n?{top:0}:{bottom:0},s=e.includes("center")?{justifyContent:"center"}:e.includes("right")?{justifyContent:"flex-end"}:{};return{left:0,right:0,display:"flex",position:"absolute",transition:YNe()?void 0:"all 230ms cubic-bezier(.21,1.02,.73,1)",transform:`translateY(${t*(n?1:-1)}px)`,...r,...s}},YYe=vD`
z-index: 9999;
> * {
pointer-events: auto;
}
`,CI=16,XYe=({reverseOrder:e,position:t="top-center",toastOptions:n,gutter:r,children:s,containerStyle:a,containerClassName:o})=>{let{toasts:l,handlers:c}=AYe(n);return m.createElement("div",{style:{position:"fixed",zIndex:9999,top:CI,left:CI,right:CI,bottom:CI,pointerEvents:"none",...a},className:o,onMouseEnter:c.startPause,onMouseLeave:c.endPause},l.map(u=>{let d=u.position||t,f=c.calculateOffset(u,{reverseOrder:e,gutter:r,defaultPosition:t}),x=KYe(d,f);return m.createElement(GYe,{id:u.id,key:u.id,onHeightUpdate:c.updateHeight,className:u.visible?YYe:"",style:x},u.type==="custom"?LO(u.message,u):s?s(u):m.createElement(qYe,{toast:u,position:d}))}))},rn=Bf;const QNe=typeof document<"u"?Ae.useLayoutEffect:()=>{};function QYe(e){const t=m.useRef(null);return QNe(()=>{t.current=e},[e]),m.useCallback((...n)=>{const r=t.current;return r==null?void 0:r(...n)},[])}const mk=e=>{var t;return(t=e==null?void 0:e.ownerDocument)!==null&&t!==void 0?t:document},Uv=e=>e&&"window"in e&&e.window===e?e:mk(e).defaultView||window;function ZYe(e){var t;return typeof window>"u"||window.navigator==null?!1:((t=window.navigator.userAgentData)===null||t===void 0?void 0:t.brands.some(n=>e.test(n.brand)))||e.test(window.navigator.userAgent)}function JYe(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 ZNe(e){let t=null;return()=>(t==null&&(t=e()),t)}const eXe=ZNe(function(){return JYe(/^Mac/i)}),tXe=ZNe(function(){return ZYe(/Android/i)});function nXe(e){return e.mozInputSource===0&&e.isTrusted?!0:tXe()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}class rXe{isDefaultPrevented(){return this.nativeEvent.defaultPrevented}preventDefault(){this.defaultPrevented=!0,this.nativeEvent.preventDefault()}stopPropagation(){this.nativeEvent.stopPropagation(),this.isPropagationStopped=()=>!0}isPropagationStopped(){return!1}persist(){}constructor(t,n){this.nativeEvent=n,this.target=n.target,this.currentTarget=n.currentTarget,this.relatedTarget=n.relatedTarget,this.bubbles=n.bubbles,this.cancelable=n.cancelable,this.defaultPrevented=n.defaultPrevented,this.eventPhase=n.eventPhase,this.isTrusted=n.isTrusted,this.timeStamp=n.timeStamp,this.type=t}}function JNe(e){let t=m.useRef({isFocused:!1,observer:null});QNe(()=>{const r=t.current;return()=>{r.observer&&(r.observer.disconnect(),r.observer=null)}},[]);let n=QYe(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 s=r.target,a=o=>{t.current.isFocused=!1,s.disabled&&n(new rXe("blur",o)),t.current.observer&&(t.current.observer.disconnect(),t.current.observer=null)};s.addEventListener("focusout",a,{once:!0}),t.current.observer=new MutationObserver(()=>{if(t.current.isFocused&&s.disabled){var o;(o=t.current.observer)===null||o===void 0||o.disconnect();let l=s===document.activeElement?null:document.activeElement;s.dispatchEvent(new FocusEvent("blur",{relatedTarget:l})),s.dispatchEvent(new FocusEvent("focusout",{bubbles:!0,relatedTarget:l}))}}),t.current.observer.observe(s,{attributes:!0,attributeFilter:["disabled"]})}},[n])}function sXe(e){let{isDisabled:t,onFocus:n,onBlur:r,onFocusChange:s}=e;const a=m.useCallback(c=>{if(c.target===c.currentTarget)return r&&r(c),s&&s(!1),!0},[r,s]),o=JNe(a),l=m.useCallback(c=>{const u=mk(c.target);c.target===c.currentTarget&&u.activeElement===c.target&&(n&&n(c),s&&s(!0),o(c))},[s,n,o]);return{focusProps:{onFocus:!t&&(n||s||r)?l:void 0,onBlur:!t&&(r||s)?a:void 0}}}let xk=null,xQ=new Set,Rj=new Map,d3=!1,gQ=!1;const iXe={Tab:!0,Escape:!0};function Sre(e,t){for(let n of xQ)n(e,t)}function aXe(e){return!(e.metaKey||!eXe()&&e.altKey||e.ctrlKey||e.key==="Control"||e.key==="Shift"||e.key==="Meta")}function DO(e){d3=!0,aXe(e)&&(xk="keyboard",Sre("keyboard",e))}function Vh(e){xk="pointer",(e.type==="mousedown"||e.type==="pointerdown")&&(d3=!0,Sre("pointer",e))}function eAe(e){nXe(e)&&(d3=!0,xk="virtual")}function tAe(e){e.target===window||e.target===document||(!d3&&!gQ&&(xk="virtual",Sre("virtual",e)),d3=!1,gQ=!1)}function nAe(){d3=!1,gQ=!0}function bQ(e){if(typeof window>"u"||Rj.get(Uv(e)))return;const t=Uv(e),n=mk(e);let r=t.HTMLElement.prototype.focus;t.HTMLElement.prototype.focus=function(){d3=!0,r.apply(this,arguments)},n.addEventListener("keydown",DO,!0),n.addEventListener("keyup",DO,!0),n.addEventListener("click",eAe,!0),t.addEventListener("focus",tAe,!0),t.addEventListener("blur",nAe,!1),typeof PointerEvent<"u"?(n.addEventListener("pointerdown",Vh,!0),n.addEventListener("pointermove",Vh,!0),n.addEventListener("pointerup",Vh,!0)):(n.addEventListener("mousedown",Vh,!0),n.addEventListener("mousemove",Vh,!0),n.addEventListener("mouseup",Vh,!0)),t.addEventListener("beforeunload",()=>{rAe(e)},{once:!0}),Rj.set(t,{focus:r})}const rAe=(e,t)=>{const n=Uv(e),r=mk(e);t&&r.removeEventListener("DOMContentLoaded",t),Rj.has(n)&&(n.HTMLElement.prototype.focus=Rj.get(n).focus,r.removeEventListener("keydown",DO,!0),r.removeEventListener("keyup",DO,!0),r.removeEventListener("click",eAe,!0),n.removeEventListener("focus",tAe,!0),n.removeEventListener("blur",nAe,!1),typeof PointerEvent<"u"?(r.removeEventListener("pointerdown",Vh,!0),r.removeEventListener("pointermove",Vh,!0),r.removeEventListener("pointerup",Vh,!0)):(r.removeEventListener("mousedown",Vh,!0),r.removeEventListener("mousemove",Vh,!0),r.removeEventListener("mouseup",Vh,!0)),Rj.delete(n))};function oXe(e){const t=mk(e);let n;return t.readyState!=="loading"?bQ(e):(n=()=>{bQ(e)},t.addEventListener("DOMContentLoaded",n)),()=>rAe(e,n)}typeof document<"u"&&oXe();function sAe(){return xk!=="pointer"}const lXe=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function cXe(e,t,n){var r;const s=typeof window<"u"?Uv(n==null?void 0:n.target).HTMLInputElement:HTMLInputElement,a=typeof window<"u"?Uv(n==null?void 0:n.target).HTMLTextAreaElement:HTMLTextAreaElement,o=typeof window<"u"?Uv(n==null?void 0:n.target).HTMLElement:HTMLElement,l=typeof window<"u"?Uv(n==null?void 0:n.target).KeyboardEvent:KeyboardEvent;return e=e||(n==null?void 0:n.target)instanceof s&&!lXe.has(n==null||(r=n.target)===null||r===void 0?void 0:r.type)||(n==null?void 0:n.target)instanceof a||(n==null?void 0:n.target)instanceof o&&(n==null?void 0:n.target.isContentEditable),!(e&&t==="keyboard"&&n instanceof l&&!iXe[n.key])}function uXe(e,t,n){bQ(),m.useEffect(()=>{let r=(s,a)=>{cXe(!!(n!=null&&n.isTextInput),s,a)&&e(sAe())};return xQ.add(r),()=>{xQ.delete(r)}},t)}function dXe(e){let{isDisabled:t,onBlurWithin:n,onFocusWithin:r,onFocusWithinChange:s}=e,a=m.useRef({isFocusWithin:!1}),o=m.useCallback(u=>{a.current.isFocusWithin&&!u.currentTarget.contains(u.relatedTarget)&&(a.current.isFocusWithin=!1,n&&n(u),s&&s(!1))},[n,s,a]),l=JNe(o),c=m.useCallback(u=>{!a.current.isFocusWithin&&document.activeElement===u.target&&(r&&r(u),s&&s(!0),a.current.isFocusWithin=!0,l(u))},[r,s,l]);return t?{focusWithinProps:{onFocus:void 0,onBlur:void 0}}:{focusWithinProps:{onFocus:c,onBlur:o}}}let BO=!1,pz=0;function yQ(){BO=!0,setTimeout(()=>{BO=!1},50)}function Mde(e){e.pointerType==="touch"&&yQ()}function fXe(){if(!(typeof document>"u"))return typeof PointerEvent<"u"?document.addEventListener("pointerup",Mde):document.addEventListener("touchend",yQ),pz++,()=>{pz--,!(pz>0)&&(typeof PointerEvent<"u"?document.removeEventListener("pointerup",Mde):document.removeEventListener("touchend",yQ))}}function Nre(e){let{onHoverStart:t,onHoverChange:n,onHoverEnd:r,isDisabled:s}=e,[a,o]=m.useState(!1),l=m.useRef({isHovered:!1,ignoreEmulatedMouseEvents:!1,pointerType:"",target:null}).current;m.useEffect(fXe,[]);let{hoverProps:c,triggerHoverEnd:u}=m.useMemo(()=>{let d=(g,v)=>{if(l.pointerType=v,s||v==="touch"||l.isHovered||!g.currentTarget.contains(g.target))return;l.isHovered=!0;let w=g.currentTarget;l.target=w,t&&t({type:"hoverstart",target:w,pointerType:v}),n&&n(!0),o(!0)},f=(g,v)=>{if(l.pointerType="",l.target=null,v==="touch"||!l.isHovered)return;l.isHovered=!1;let w=g.currentTarget;r&&r({type:"hoverend",target:w,pointerType:v}),n&&n(!1),o(!1)},x={};return typeof PointerEvent<"u"?(x.onPointerEnter=g=>{BO&&g.pointerType==="mouse"||d(g,g.pointerType)},x.onPointerLeave=g=>{!s&&g.currentTarget.contains(g.target)&&f(g,g.pointerType)}):(x.onTouchStart=()=>{l.ignoreEmulatedMouseEvents=!0},x.onMouseEnter=g=>{!l.ignoreEmulatedMouseEvents&&!BO&&d(g,"mouse"),l.ignoreEmulatedMouseEvents=!1},x.onMouseLeave=g=>{!s&&g.currentTarget.contains(g.target)&&f(g,"mouse")}),{hoverProps:x,triggerHoverEnd:f}},[t,n,r,s,l]);return m.useEffect(()=>{s&&u({currentTarget:l.target},l.pointerType)},[s]),{hoverProps:c,isHovered:a}}function Are(e={}){let{autoFocus:t=!1,isTextInput:n,within:r}=e,s=m.useRef({isFocused:!1,isFocusVisible:t||sAe()}),[a,o]=m.useState(!1),[l,c]=m.useState(()=>s.current.isFocused&&s.current.isFocusVisible),u=m.useCallback(()=>c(s.current.isFocused&&s.current.isFocusVisible),[]),d=m.useCallback(g=>{s.current.isFocused=g,o(g),u()},[u]);uXe(g=>{s.current.isFocusVisible=g,u()},[],{isTextInput:n});let{focusProps:f}=sXe({isDisabled:r,onFocusChange:d}),{focusWithinProps:x}=dXe({isDisabled:!r,onFocusWithinChange:d});return{isFocused:a,isFocusVisible:l,focusProps:r?x:f}}var hXe=Object.defineProperty,pXe=(e,t,n)=>t in e?hXe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,mz=(e,t,n)=>(pXe(e,typeof t!="symbol"?t+"":t,n),n);let mXe=class{constructor(){mz(this,"current",this.detect()),mz(this,"handoffState","pending"),mz(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"}},zw=new mXe;function t2(e){return zw.isServer?null:e instanceof Node?e.ownerDocument:e!=null&&e.hasOwnProperty("current")&&e.current instanceof Node?e.current.ownerDocument:document}function wD(e){typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e).catch(t=>setTimeout(()=>{throw t}))}function lx(){let e=[],t={addEventListener(n,r,s,a){return n.addEventListener(r,s,a),t.add(()=>n.removeEventListener(r,s,a))},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 wD(()=>{r.current&&n[0]()}),t.add(()=>{r.current=!1})},style(n,r,s){let a=n.style.getPropertyValue(r);return Object.assign(n.style,{[r]:s}),this.add(()=>{Object.assign(n.style,{[r]:a})})},group(n){let r=lx();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 s of e.splice(r,1))s()}},dispose(){for(let n of e.splice(0))n()}};return t}function n2(){let[e]=m.useState(lx);return m.useEffect(()=>()=>e.dispose(),[e]),e}let Qa=(e,t)=>{zw.isServer?m.useEffect(e,t):m.useLayoutEffect(e,t)};function r5(e){let t=m.useRef(e);return Qa(()=>{t.current=e},[e]),t}let Us=function(e){let t=r5(e);return Ae.useCallback((...n)=>t.current(...n),[t])};function xXe(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 gXe(e,t){return!(!e||!t||e.right<t.left||e.left>t.right||e.bottom<t.top||e.top>t.bottom)}function jre({disabled:e=!1}={}){let t=m.useRef(null),[n,r]=m.useState(!1),s=n2(),a=Us(()=>{t.current=null,r(!1),s.dispose()}),o=Us(l=>{if(s.dispose(),t.current===null){t.current=l.currentTarget,r(!0);{let c=t2(l.currentTarget);s.addEventListener(c,"pointerup",a,!1),s.addEventListener(c,"pointermove",u=>{if(t.current){let d=xXe(u);r(gXe(d,t.current.getBoundingClientRect()))}},!1),s.addEventListener(c,"pointercancel",a,!1)}}});return{pressed:n,pressProps:e?{}:{onPointerDown:o,onPointerUp:a,onClick:a}}}let bXe=m.createContext(void 0);function Ere(){return m.useContext(bXe)}function vQ(...e){return Array.from(new Set(e.flatMap(t=>typeof t=="string"?t.split(" "):[]))).filter(Boolean).join(" ")}function qf(e,t,...n){if(e in t){let s=t[e];return typeof s=="function"?s(...n):s}let r=new Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(t).map(s=>`"${s}"`).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,qf),r}var Py=(e=>(e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static",e))(Py||{}),dy=(e=>(e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden",e))(dy||{});function Co(){let e=vXe();return m.useCallback(t=>yXe({mergeRefs:e,...t}),[e])}function yXe({ourProps:e,theirProps:t,slot:n,defaultTag:r,features:s,visible:a=!0,name:o,mergeRefs:l}){l=l??wXe;let c=iAe(t,e);if(a)return SI(c,n,r,o,l);let u=s??0;if(u&2){let{static:d=!1,...f}=c;if(d)return SI(f,n,r,o,l)}if(u&1){let{unmount:d=!0,...f}=c;return qf(d?0:1,{0(){return null},1(){return SI({...f,hidden:!0,style:{display:"none"}},n,r,o,l)}})}return SI(c,n,r,o,l)}function SI(e,t={},n,r,s){let{as:a=n,children:o,refName:l="ref",...c}=xz(e,["unmount","static"]),u=e.ref!==void 0?{[l]:e.ref}:{},d=typeof o=="function"?o(t):o;"className"in c&&c.className&&typeof c.className=="function"&&(c.className=c.className(t)),c["aria-labelledby"]&&c["aria-labelledby"]===c.id&&(c["aria-labelledby"]=void 0);let f={};if(t){let x=!1,g=[];for(let[v,w]of Object.entries(t))typeof w=="boolean"&&(x=!0),w===!0&&g.push(v.replace(/([A-Z])/g,C=>`-${C.toLowerCase()}`));if(x){f["data-headlessui-state"]=g.join(" ");for(let v of g)f[`data-${v}`]=""}}if(a===m.Fragment&&(Object.keys(Tb(c)).length>0||Object.keys(Tb(f)).length>0))if(!m.isValidElement(d)||Array.isArray(d)&&d.length>1){if(Object.keys(Tb(c)).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(Tb(c)).concat(Object.keys(Tb(f))).map(x=>` - ${x}`).join(`
`),"","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(x=>` - ${x}`).join(`
`)].join(`
`))}else{let x=d.props,g=x==null?void 0:x.className,v=typeof g=="function"?(...N)=>vQ(g(...N),c.className):vQ(g,c.className),w=v?{className:v}:{},C=iAe(d.props,Tb(xz(c,["ref"])));for(let N in f)N in C&&delete f[N];return m.cloneElement(d,Object.assign({},C,f,u,{ref:s(CXe(d),u.ref)},w))}return m.createElement(a,Object.assign({},xz(c,["ref"]),a!==m.Fragment&&u,a!==m.Fragment&&f),d)}function vXe(){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 wXe(...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 iAe(...e){if(e.length===0)return{};if(e.length===1)return e[0];let t={},n={};for(let r of e)for(let s in r)s.startsWith("on")&&typeof r[s]=="function"?(n[s]!=null||(n[s]=[]),n[s].push(r[s])):t[s]=r[s];if(t.disabled||t["aria-disabled"])for(let r in n)/^(on(?:Click|Pointer|Mouse|Key)(?:Down|Up|Press)?)$/.test(r)&&(n[r]=[s=>{var a;return(a=s==null?void 0:s.preventDefault)==null?void 0:a.call(s)}]);for(let r in n)Object.assign(t,{[r](s,...a){let o=n[r];for(let l of o){if((s instanceof Event||(s==null?void 0:s.nativeEvent)instanceof Event)&&s.defaultPrevented)return;l(s,...a)}}});return t}function v9(...e){if(e.length===0)return{};if(e.length===1)return e[0];let t={},n={};for(let r of e)for(let s in r)s.startsWith("on")&&typeof r[s]=="function"?(n[s]!=null||(n[s]=[]),n[s].push(r[s])):t[s]=r[s];for(let r in n)Object.assign(t,{[r](...s){let a=n[r];for(let o of a)o==null||o(...s)}});return t}function uo(e){var t;return Object.assign(m.forwardRef(e),{displayName:(t=e.displayName)!=null?t:e.name})}function Tb(e){let t=Object.assign({},e);for(let n in t)t[n]===void 0&&delete t[n];return t}function xz(e,t=[]){let n=Object.assign({},e);for(let r of t)r in n&&delete n[r];return n}function CXe(e){return Ae.version.split(".")[0]>="19"?e.props.ref:e.ref}function SXe(e,t,n){let[r,s]=m.useState(n),a=e!==void 0,o=m.useRef(a),l=m.useRef(!1),c=m.useRef(!1);return a&&!o.current&&!l.current?(l.current=!0,o.current=a,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.")):!a&&o.current&&!c.current&&(c.current=!0,o.current=a,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.")),[a?e:r,Us(u=>(a||s(u),t==null?void 0:t(u)))]}function NXe(e){let[t]=m.useState(e);return t}function aAe(e={},t=null,n=[]){for(let[r,s]of Object.entries(e))lAe(n,oAe(t,r),s);return n}function oAe(e,t){return e?e+"["+t+"]":t}function lAe(e,t,n){if(Array.isArray(n))for(let[r,s]of n.entries())lAe(e,oAe(t,r.toString()),s);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,""]):aAe(n,t,e)}function AXe(e){var t,n;let r=(t=e==null?void 0:e.form)!=null?t:e.closest("form");if(r){for(let s of r.elements)if(s!==e&&(s.tagName==="INPUT"&&s.type==="submit"||s.tagName==="BUTTON"&&s.type==="submit"||s.nodeName==="INPUT"&&s.type==="image")){s.click();return}(n=r.requestSubmit)==null||n.call(r)}}let jXe="span";var SS=(e=>(e[e.None=1]="None",e[e.Focusable=2]="Focusable",e[e.Hidden=4]="Hidden",e))(SS||{});function EXe(e,t){var n;let{features:r=1,...s}=e,a={ref:t,"aria-hidden":(r&2)===2?!0:(n=s["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 Co()({ourProps:a,theirProps:s,slot:{},defaultTag:jXe,name:"Hidden"})}let w9=uo(EXe),_Xe=m.createContext(null);function kXe({children:e}){let t=m.useContext(_Xe);if(!t)return Ae.createElement(Ae.Fragment,null,e);let{target:n}=t;return n?Na.createPortal(Ae.createElement(Ae.Fragment,null,e),n):null}function TXe({data:e,form:t,disabled:n,onReset:r,overrides:s}){let[a,o]=m.useState(null),l=n2();return m.useEffect(()=>{if(r&&a)return l.addEventListener(a,"reset",r)},[a,t,r]),Ae.createElement(kXe,null,Ae.createElement(IXe,{setForm:o,formId:t}),aAe(e).map(([c,u])=>Ae.createElement(w9,{features:SS.Hidden,...Tb({key:c,as:"input",type:"hidden",hidden:!0,readOnly:!0,form:t,disabled:n,name:c,value:u,...s})})))}function IXe({setForm:e,formId:t}){return m.useEffect(()=>{if(t){let n=document.getElementById(t);n&&e(n)}},[e,t]),t?null:Ae.createElement(w9,{features:SS.Hidden,as:"input",type:"hidden",hidden:!0,readOnly:!0,ref:n=>{if(!n)return;let r=n.closest("form");r&&e(r)}})}let PXe=m.createContext(void 0);function cAe(){return m.useContext(PXe)}function _re(e){let t=e.parentElement,n=null;for(;t&&!(t instanceof HTMLFieldSetElement);)t instanceof HTMLLegendElement&&(n=t),t=t.parentElement;let r=(t==null?void 0:t.getAttribute("disabled"))==="";return r&&FXe(n)?!1:r}function FXe(e){if(!e)return!1;let t=e.previousElementSibling;for(;t!==null;){if(t instanceof HTMLLegendElement)return!1;t=t.previousElementSibling}return!0}let uAe=Symbol();function dAe(e,t=!0){return Object.assign(e,{[uAe]:t})}function lc(...e){let t=m.useRef(e);m.useEffect(()=>{t.current=e},[e]);let n=Us(r=>{for(let s of t.current)s!=null&&(typeof s=="function"?s(r):s.current=r)});return e.every(r=>r==null||(r==null?void 0:r[uAe]))?void 0:n}let CD=m.createContext(null);CD.displayName="DescriptionContext";function fAe(){let e=m.useContext(CD);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,fAe),t}return e}function OXe(){var e,t;return(t=(e=m.useContext(CD))==null?void 0:e.value)!=null?t:void 0}function kre(){let[e,t]=m.useState([]);return[e.length>0?e.join(" "):void 0,m.useMemo(()=>function(n){let r=Us(a=>(t(o=>[...o,a]),()=>t(o=>{let l=o.slice(),c=l.indexOf(a);return c!==-1&&l.splice(c,1),l}))),s=m.useMemo(()=>({register:r,slot:n.slot,name:n.name,props:n.props,value:n.value}),[r,n.slot,n.name,n.props,n.value]);return Ae.createElement(CD.Provider,{value:s},n.children)},[t])]}let MXe="p";function RXe(e,t){let n=m.useId(),r=Ere(),{id:s=`headlessui-description-${n}`,...a}=e,o=fAe(),l=lc(t);Qa(()=>o.register(s),[s,o.register]);let c=r||!1,u=m.useMemo(()=>({...o.slot,disabled:c}),[o.slot,c]),d={ref:l,...o.props,id:s};return Co()({ourProps:d,theirProps:a,slot:u,defaultTag:MXe,name:o.name||"Description"})}let LXe=uo(RXe),hAe=Object.assign(LXe,{});var xo=(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))(xo||{});let SD=m.createContext(null);SD.displayName="LabelContext";function Tre(){let e=m.useContext(SD);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,Tre),t}return e}function pAe(e){var t,n,r;let s=(n=(t=m.useContext(SD))==null?void 0:t.value)!=null?n:void 0;return((r=void 0)!=null?r:0)>0?[s,...e].filter(Boolean).join(" "):s}function Ire({inherit:e=!1}={}){let t=pAe(),[n,r]=m.useState([]),s=e?[t,...n].filter(Boolean):n;return[s.length>0?s.join(" "):void 0,m.useMemo(()=>function(a){let o=Us(c=>(r(u=>[...u,c]),()=>r(u=>{let d=u.slice(),f=d.indexOf(c);return f!==-1&&d.splice(f,1),d}))),l=m.useMemo(()=>({register:o,slot:a.slot,name:a.name,props:a.props,value:a.value}),[o,a.slot,a.name,a.props,a.value]);return Ae.createElement(SD.Provider,{value:l},a.children)},[r])]}let DXe="label";function BXe(e,t){var n;let r=m.useId(),s=Tre(),a=cAe(),o=Ere(),{id:l=`headlessui-label-${r}`,htmlFor:c=a??((n=s.props)==null?void 0:n.htmlFor),passive:u=!1,...d}=e,f=lc(t);Qa(()=>s.register(l),[l,s.register]);let x=Us(C=>{let N=C.currentTarget;if(N instanceof HTMLLabelElement&&C.preventDefault(),s.props&&"onClick"in s.props&&typeof s.props.onClick=="function"&&s.props.onClick(C),N instanceof HTMLLabelElement){let P=document.getElementById(N.htmlFor);if(P){let I=P.getAttribute("disabled");if(I==="true"||I==="")return;let R=P.getAttribute("aria-disabled");if(R==="true"||R==="")return;(P instanceof HTMLInputElement&&(P.type==="radio"||P.type==="checkbox")||P.role==="radio"||P.role==="checkbox"||P.role==="switch")&&P.click(),P.focus({preventScroll:!0})}}}),g=o||!1,v=m.useMemo(()=>({...s.slot,disabled:g}),[s.slot,g]),w={ref:f,...s.props,id:l,htmlFor:c,onClick:x};return u&&("onClick"in w&&(delete w.htmlFor,delete w.onClick),"onClick"in d&&delete d.onClick),Co()({ourProps:w,theirProps:d,slot:v,defaultTag:c?DXe:"div",name:s.name||"Label"})}let $Xe=uo(BXe),UXe=Object.assign($Xe,{}),zXe=m.createContext(()=>{});function mAe({value:e,children:t}){return Ae.createElement(zXe.Provider,{value:e},t)}function HXe(e){if(e===null)return{width:0,height:0};let{width:t,height:n}=e.getBoundingClientRect();return{width:t,height:n}}function VXe(e,t=!1){let[n,r]=m.useReducer(()=>({}),{}),s=m.useMemo(()=>HXe(e),[e,n]);return Qa(()=>{if(!e)return;let a=new ResizeObserver(r);return a.observe(e),()=>{a.disconnect()}},[e]),t?{width:`${s.width}px`,height:`${s.height}px`}:s}let WXe=class extends Map{constructor(t){super(),this.factory=t}get(t){let n=super.get(t);return n===void 0&&(n=this.factory(t),this.set(t,n)),n}};function xAe(e,t){let n=e(),r=new Set;return{getSnapshot(){return n},subscribe(s){return r.add(s),()=>r.delete(s)},dispatch(s,...a){let o=t[s].call(n,...a);o&&(n=o,r.forEach(l=>l()))}}}function gAe(e){return m.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot)}let qXe=new WXe(()=>xAe(()=>[],{ADD(e){return this.includes(e)?this:[...this,e]},REMOVE(e){let t=this.indexOf(e);if(t===-1)return this;let n=this.slice();return n.splice(t,1),n}}));function tA(e,t){let n=qXe.get(t),r=m.useId(),s=gAe(n);if(Qa(()=>{if(e)return n.dispatch("ADD",r),()=>n.dispatch("REMOVE",r)},[n,e]),!e)return!1;let a=s.indexOf(r),o=s.length;return a===-1&&(a=o,o+=1),a===o-1}let wQ=new Map,Lj=new Map;function Rde(e){var t;let n=(t=Lj.get(e))!=null?t:0;return Lj.set(e,n+1),n!==0?()=>Lde(e):(wQ.set(e,{"aria-hidden":e.getAttribute("aria-hidden"),inert:e.inert}),e.setAttribute("aria-hidden","true"),e.inert=!0,()=>Lde(e))}function Lde(e){var t;let n=(t=Lj.get(e))!=null?t:1;if(n===1?Lj.delete(e):Lj.set(e,n-1),n!==1)return;let r=wQ.get(e);r&&(r["aria-hidden"]===null?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden",r["aria-hidden"]),e.inert=r.inert,wQ.delete(e))}function bAe(e,{allowed:t,disallowed:n}={}){let r=tA(e,"inert-others");Qa(()=>{var s,a;if(!r)return;let o=lx();for(let c of(s=n==null?void 0:n())!=null?s:[])c&&o.add(Rde(c));let l=(a=t==null?void 0:t())!=null?a:[];for(let c of l){if(!c)continue;let u=t2(c);if(!u)continue;let d=c.parentElement;for(;d&&d!==u.body;){for(let f of d.children)l.some(x=>f.contains(x))||o.add(Rde(f));d=d.parentElement}}return o.dispose},[r,t,n])}function yAe(e,t,n){let r=r5(s=>{let a=s.getBoundingClientRect();a.x===0&&a.y===0&&a.width===0&&a.height===0&&n()});m.useEffect(()=>{if(!e)return;let s=t===null?null:t instanceof HTMLElement?t:t.current;if(!s)return;let a=lx();if(typeof ResizeObserver<"u"){let o=new ResizeObserver(()=>r.current(s));o.observe(s),a.add(()=>o.disconnect())}if(typeof IntersectionObserver<"u"){let o=new IntersectionObserver(()=>r.current(s));o.observe(s),a.add(()=>o.disconnect())}return()=>a.dispose()},[t,r,e])}let $O=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].map(e=>`${e}:not([tabindex='-1'])`).join(","),GXe=["[data-autofocus]"].map(e=>`${e}:not([tabindex='-1'])`).join(",");var tm=(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))(tm||{}),CQ=(e=>(e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow",e))(CQ||{}),KXe=(e=>(e[e.Previous=-1]="Previous",e[e.Next=1]="Next",e))(KXe||{});function vAe(e=document.body){return e==null?[]:Array.from(e.querySelectorAll($O)).sort((t,n)=>Math.sign((t.tabIndex||Number.MAX_SAFE_INTEGER)-(n.tabIndex||Number.MAX_SAFE_INTEGER)))}function YXe(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(GXe)).sort((t,n)=>Math.sign((t.tabIndex||Number.MAX_SAFE_INTEGER)-(n.tabIndex||Number.MAX_SAFE_INTEGER)))}var Pre=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))(Pre||{});function Fre(e,t=0){var n;return e===((n=t2(e))==null?void 0:n.body)?!1:qf(t,{0(){return e.matches($O)},1(){let r=e;for(;r!==null;){if(r.matches($O))return!0;r=r.parentElement}return!1}})}function wAe(e){let t=t2(e);lx().nextFrame(()=>{t&&!Fre(t.activeElement,0)&&O0(e)})}var XXe=(e=>(e[e.Keyboard=0]="Keyboard",e[e.Mouse=1]="Mouse",e))(XXe||{});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));function O0(e){e==null||e.focus({preventScroll:!0})}let QXe=["textarea","input"].join(",");function ZXe(e){var t,n;return(n=(t=e==null?void 0:e.matches)==null?void 0:t.call(e,QXe))!=null?n:!1}function CAe(e,t=n=>n){return e.slice().sort((n,r)=>{let s=t(n),a=t(r);if(s===null||a===null)return 0;let o=s.compareDocumentPosition(a);return o&Node.DOCUMENT_POSITION_FOLLOWING?-1:o&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function JXe(e,t){return KC(vAe(),t,{relativeTo:e})}function KC(e,t,{sorted:n=!0,relativeTo:r=null,skipElements:s=[]}={}){let a=Array.isArray(e)?e.length>0?e[0].ownerDocument:document:e.ownerDocument,o=Array.isArray(e)?n?CAe(e):e:t&64?YXe(e):vAe(e);s.length>0&&o.length>1&&(o=o.filter(g=>!s.some(v=>v!=null&&"current"in v?(v==null?void 0:v.current)===g:v===g))),r=r??a.activeElement;let l=(()=>{if(t&5)return 1;if(t&10)return-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),c=(()=>{if(t&1)return 0;if(t&2)return Math.max(0,o.indexOf(r))-1;if(t&4)return Math.max(0,o.indexOf(r))+1;if(t&8)return o.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),u=t&32?{preventScroll:!0}:{},d=0,f=o.length,x;do{if(d>=f||d+f<=0)return 0;let g=c+d;if(t&16)g=(g+f)%f;else{if(g<0)return 3;if(g>=f)return 1}x=o[g],x==null||x.focus(u),d+=l}while(x!==a.activeElement);return t&6&&ZXe(x)&&x.select(),2}function SAe(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function eQe(){return/Android/gi.test(window.navigator.userAgent)}function tQe(){return SAe()||eQe()}function d7(e,t,n,r){let s=r5(n);m.useEffect(()=>{if(!e)return;function a(o){s.current(o)}return document.addEventListener(t,a,r),()=>document.removeEventListener(t,a,r)},[e,t,r])}function NAe(e,t,n,r){let s=r5(n);m.useEffect(()=>{if(!e)return;function a(o){s.current(o)}return window.addEventListener(t,a,r),()=>window.removeEventListener(t,a,r)},[e,t,r])}const Dde=30;function AAe(e,t,n){let r=tA(e,"outside-click"),s=r5(n),a=m.useCallback(function(c,u){if(c.defaultPrevented)return;let d=u(c);if(d===null||!d.getRootNode().contains(d)||!d.isConnected)return;let f=function x(g){return typeof g=="function"?x(g()):Array.isArray(g)||g instanceof Set?g:[g]}(t);for(let x of f)if(x!==null&&(x.contains(d)||c.composed&&c.composedPath().includes(x)))return;return!Fre(d,Pre.Loose)&&d.tabIndex!==-1&&c.preventDefault(),s.current(c,d)},[s,t]),o=m.useRef(null);d7(r,"pointerdown",c=>{var u,d;o.current=((d=(u=c.composedPath)==null?void 0:u.call(c))==null?void 0:d[0])||c.target},!0),d7(r,"mousedown",c=>{var u,d;o.current=((d=(u=c.composedPath)==null?void 0:u.call(c))==null?void 0:d[0])||c.target},!0),d7(r,"click",c=>{tQe()||o.current&&(a(c,()=>o.current),o.current=null)},!0);let l=m.useRef({x:0,y:0});d7(r,"touchstart",c=>{l.current.x=c.touches[0].clientX,l.current.y=c.touches[0].clientY},!0),d7(r,"touchend",c=>{let u={x:c.changedTouches[0].clientX,y:c.changedTouches[0].clientY};if(!(Math.abs(u.x-l.current.x)>=Dde||Math.abs(u.y-l.current.y)>=Dde))return a(c,()=>c.target instanceof HTMLElement?c.target:null)},!0),NAe(r,"blur",c=>a(c,()=>window.document.activeElement instanceof HTMLIFrameElement?window.document.activeElement:null),!0)}function nA(...e){return m.useMemo(()=>t2(...e),[...e])}function jAe(e,t,n,r){let s=r5(n);m.useEffect(()=>{e=e??window;function a(o){s.current(o)}return e.addEventListener(t,a,r),()=>e.removeEventListener(t,a,r)},[e,t,r])}function Ore(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 nQe(){let e;return{before({doc:t}){var n;let r=t.documentElement,s=(n=t.defaultView)!=null?n:window;e=Math.max(0,s.innerWidth-r.clientWidth)},after({doc:t,d:n}){let r=t.documentElement,s=Math.max(0,r.clientWidth-r.offsetWidth),a=Math.max(0,e-s);n.style(r,"paddingRight",`${a}px`)}}}function rQe(){return SAe()?{before({doc:e,d:t,meta:n}){function r(s){return n.containers.flatMap(a=>a()).some(a=>a.contains(s))}t.microTask(()=>{var s;if(window.getComputedStyle(e.documentElement).scrollBehavior!=="auto"){let l=lx();l.style(e.documentElement,"scrollBehavior","auto"),t.add(()=>t.microTask(()=>l.dispose()))}let a=(s=window.scrollY)!=null?s:window.pageYOffset,o=null;t.addEventListener(e,"click",l=>{if(l.target instanceof HTMLElement)try{let c=l.target.closest("a");if(!c)return;let{hash:u}=new URL(c.href),d=e.querySelector(u);d&&!r(d)&&(o=d)}catch{}},!0),t.addEventListener(e,"touchstart",l=>{if(l.target instanceof HTMLElement)if(r(l.target)){let c=l.target;for(;c.parentElement&&r(c.parentElement);)c=c.parentElement;t.style(c,"overscrollBehavior","contain")}else t.style(l.target,"touchAction","none")}),t.addEventListener(e,"touchmove",l=>{if(l.target instanceof HTMLElement){if(l.target.tagName==="INPUT")return;if(r(l.target)){let c=l.target;for(;c.parentElement&&c.dataset.headlessuiPortal!==""&&!(c.scrollHeight>c.clientHeight||c.scrollWidth>c.clientWidth);)c=c.parentElement;c.dataset.headlessuiPortal===""&&l.preventDefault()}else l.preventDefault()}},{passive:!1}),t.add(()=>{var l;let c=(l=window.scrollY)!=null?l:window.pageYOffset;a!==c&&window.scrollTo(0,a),o&&o.isConnected&&(o.scrollIntoView({block:"nearest"}),o=null)})})}}:{}}function sQe(){return{before({doc:e,d:t}){t.style(e.documentElement,"overflow","hidden")}}}function iQe(e){let t={};for(let n of e)Object.assign(t,n(t));return t}let zv=xAe(()=>new Map,{PUSH(e,t){var n;let r=(n=this.get(e))!=null?n:{doc:e,count:0,d:lx(),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:iQe(n)},s=[rQe(),nQe(),sQe()];s.forEach(({before:a})=>a==null?void 0:a(r)),s.forEach(({after:a})=>a==null?void 0:a(r))},SCROLL_ALLOW({d:e}){e.dispose()},TEARDOWN({doc:e}){this.delete(e)}});zv.subscribe(()=>{let e=zv.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",s=n.count!==0;(s&&!r||!s&&r)&&zv.dispatch(n.count>0?"SCROLL_PREVENT":"SCROLL_ALLOW",n),n.count===0&&zv.dispatch("TEARDOWN",n)}});function aQe(e,t,n=()=>({containers:[]})){let r=gAe(zv),s=t?r.get(t):void 0,a=s?s.count>0:!1;return Qa(()=>{if(!(!t||!e))return zv.dispatch("PUSH",t,n),()=>zv.dispatch("POP",t,n)},[e,t]),a}function EAe(e,t,n=()=>[document.body]){let r=tA(e,"scroll-lock");aQe(r,t,s=>{var a;return{containers:[...(a=s.containers)!=null?a:[],n]}})}function Bde(e){return[e.screenX,e.screenY]}function oQe(){let e=m.useRef([-1,-1]);return{wasMoved(t){let n=Bde(t);return e.current[0]===n[0]&&e.current[1]===n[1]?!1:(e.current=n,!0)},update(t){e.current=Bde(t)}}}function lQe(e=0){let[t,n]=m.useState(e),r=m.useCallback(c=>n(c),[t]),s=m.useCallback(c=>n(u=>u|c),[t]),a=m.useCallback(c=>(t&c)===c,[t]),o=m.useCallback(c=>n(u=>u&~c),[n]),l=m.useCallback(c=>n(u=>u^c),[n]);return{flags:t,setFlag:r,addFlag:s,hasFlag:a,removeFlag:o,toggleFlag:l}}var cQe={},$de,Ude;typeof process<"u"&&typeof globalThis<"u"&&typeof Element<"u"&&(($de=process==null?void 0:cQe)==null?void 0:$de.NODE_ENV)==="test"&&typeof((Ude=Element==null?void 0:Element.prototype)==null?void 0:Ude.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(`
`)),[]});var uQe=(e=>(e[e.None=0]="None",e[e.Closed=1]="Closed",e[e.Enter=2]="Enter",e[e.Leave=4]="Leave",e))(uQe||{});function Mre(e){let t={};for(let n in e)e[n]===!0&&(t[`data-${n}`]="");return t}function Rre(e,t,n,r){let[s,a]=m.useState(n),{hasFlag:o,addFlag:l,removeFlag:c}=lQe(e&&s?3:0),u=m.useRef(!1),d=m.useRef(!1),f=n2();return Qa(()=>{var x;if(e){if(n&&a(!0),!t){n&&l(3);return}return(x=r==null?void 0:r.start)==null||x.call(r,n),dQe(t,{inFlight:u,prepare(){d.current?d.current=!1:d.current=u.current,u.current=!0,!d.current&&(n?(l(3),c(4)):(l(4),c(2)))},run(){d.current?n?(c(3),l(4)):(c(4),l(3)):n?c(1):l(1)},done(){var g;d.current&&typeof t.getAnimations=="function"&&t.getAnimations().length>0||(u.current=!1,c(7),n||a(!1),(g=r==null?void 0:r.end)==null||g.call(r,n))}})}},[e,n,t,f]),e?[s,{closed:o(1),enter:o(2),leave:o(4),transition:o(2)||o(4)}]:[n,{closed:void 0,enter:void 0,leave:void 0,transition:void 0}]}function dQe(e,{prepare:t,run:n,done:r,inFlight:s}){let a=lx();return hQe(e,{prepare:t,inFlight:s}),a.nextFrame(()=>{n(),a.requestAnimationFrame(()=>{a.add(fQe(e,r))})}),a.dispose}function fQe(e,t){var n,r;let s=lx();if(!e)return s.dispose;let a=!1;s.add(()=>{a=!0});let o=(r=(n=e.getAnimations)==null?void 0:n.call(e).filter(l=>l instanceof CSSTransition))!=null?r:[];return o.length===0?(t(),s.dispose):(Promise.allSettled(o.map(l=>l.finished)).then(()=>{a||t()}),s.dispose)}function hQe(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 pQe(e,{container:t,accept:n,walk:r}){let s=m.useRef(n),a=m.useRef(r);m.useEffect(()=>{s.current=n,a.current=r},[n,r]),Qa(()=>{if(!t||!e)return;let o=t2(t);if(!o)return;let l=s.current,c=a.current,u=Object.assign(f=>l(f),{acceptNode:l}),d=o.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,u,!1);for(;d.nextNode();)c(d.currentNode)},[t,e,s,a])}function Lre(e,t){let n=m.useRef([]),r=Us(e);m.useEffect(()=>{let s=[...n.current];for(let[a,o]of t.entries())if(n.current[a]!==o){let l=r(t,s);return n.current=t,l}},[r,...t])}function ND(){return typeof window<"u"}function rA(e){return _Ae(e)?(e.nodeName||"").toLowerCase():"#document"}function Uf(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function cx(e){var t;return(t=(_Ae(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function _Ae(e){return ND()?e instanceof Node||e instanceof Uf(e).Node:!1}function rd(e){return ND()?e instanceof Element||e instanceof Uf(e).Element:!1}function q0(e){return ND()?e instanceof HTMLElement||e instanceof Uf(e).HTMLElement:!1}function zde(e){return!ND()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Uf(e).ShadowRoot}function gk(e){const{overflow:t,overflowX:n,overflowY:r,display:s}=mm(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(s)}function mQe(e){return["table","td","th"].includes(rA(e))}function AD(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function Dre(e){const t=Bre(),n=rd(e)?mm(e):e;return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function xQe(e){let t=Fy(e);for(;q0(t)&&!NS(t);){if(Dre(t))return t;if(AD(t))return null;t=Fy(t)}return null}function Bre(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function NS(e){return["html","body","#document"].includes(rA(e))}function mm(e){return Uf(e).getComputedStyle(e)}function jD(e){return rd(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Fy(e){if(rA(e)==="html")return e;const t=e.assignedSlot||e.parentNode||zde(e)&&e.host||cx(e);return zde(t)?t.host:t}function kAe(e){const t=Fy(e);return NS(t)?e.ownerDocument?e.ownerDocument.body:e.body:q0(t)&&gk(t)?t:kAe(t)}function C9(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const s=kAe(e),a=s===((r=e.ownerDocument)==null?void 0:r.body),o=Uf(s);if(a){const l=SQ(o);return t.concat(o,o.visualViewport||[],gk(s)?s:[],l&&n?C9(l):[])}return t.concat(s,C9(s,[],n))}function SQ(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function gQe(){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 bQe=["top","right","bottom","left"],Oy=Math.min,Au=Math.max,S9=Math.round,NI=Math.floor,My=e=>({x:e,y:e}),yQe={left:"right",right:"left",bottom:"top",top:"bottom"},vQe={start:"end",end:"start"};function NQ(e,t,n){return Au(e,Oy(t,n))}function G0(e,t){return typeof e=="function"?e(t):e}function n1(e){return e.split("-")[0]}function sA(e){return e.split("-")[1]}function $re(e){return e==="x"?"y":"x"}function Ure(e){return e==="y"?"height":"width"}function Ry(e){return["top","bottom"].includes(n1(e))?"y":"x"}function zre(e){return $re(Ry(e))}function wQe(e,t,n){n===void 0&&(n=!1);const r=sA(e),s=zre(e),a=Ure(s);let o=s==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[a]>t.floating[a]&&(o=UO(o)),[o,UO(o)]}function CQe(e){const t=UO(e);return[AQ(e),t,AQ(t)]}function AQ(e){return e.replace(/start|end/g,t=>vQe[t])}function SQe(e,t,n){const r=["left","right"],s=["right","left"],a=["top","bottom"],o=["bottom","top"];switch(e){case"top":case"bottom":return n?t?s:r:t?r:s;case"left":case"right":return t?a:o;default:return[]}}function NQe(e,t,n,r){const s=sA(e);let a=SQe(n1(e),n==="start",r);return s&&(a=a.map(o=>o+"-"+s),t&&(a=a.concat(a.map(AQ)))),a}function UO(e){return e.replace(/left|right|bottom|top/g,t=>yQe[t])}function AQe(e){return{top:0,right:0,bottom:0,left:0,...e}}function TAe(e){return typeof e!="number"?AQe(e):{top:e,right:e,bottom:e,left:e}}function N9(e){const{x:t,y:n,width:r,height:s}=e;return{width:r,height:s,top:n,left:t,right:t+r,bottom:n+s,x:t,y:n}}function Hde(e,t,n){let{reference:r,floating:s}=e;const a=Ry(t),o=zre(t),l=Ure(o),c=n1(t),u=a==="y",d=r.x+r.width/2-s.width/2,f=r.y+r.height/2-s.height/2,x=r[l]/2-s[l]/2;let g;switch(c){case"top":g={x:d,y:r.y-s.height};break;case"bottom":g={x:d,y:r.y+r.height};break;case"right":g={x:r.x+r.width,y:f};break;case"left":g={x:r.x-s.width,y:f};break;default:g={x:r.x,y:r.y}}switch(sA(t)){case"start":g[o]-=x*(n&&u?-1:1);break;case"end":g[o]+=x*(n&&u?-1:1);break}return g}const jQe=async(e,t,n)=>{const{placement:r="bottom",strategy:s="absolute",middleware:a=[],platform:o}=n,l=a.filter(Boolean),c=await(o.isRTL==null?void 0:o.isRTL(t));let u=await o.getElementRects({reference:e,floating:t,strategy:s}),{x:d,y:f}=Hde(u,r,c),x=r,g={},v=0;for(let w=0;w<l.length;w++){const{name:C,fn:N}=l[w],{x:P,y:I,data:R,reset:F}=await N({x:d,y:f,initialPlacement:r,placement:x,strategy:s,middlewareData:g,rects:u,platform:o,elements:{reference:e,floating:t}});d=P??d,f=I??f,g={...g,[C]:{...g[C],...R}},F&&v<=50&&(v++,typeof F=="object"&&(F.placement&&(x=F.placement),F.rects&&(u=F.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:s}):F.rects),{x:d,y:f}=Hde(u,x,c)),w=-1)}return{x:d,y:f,placement:x,strategy:s,middlewareData:g}};async function AS(e,t){var n;t===void 0&&(t={});const{x:r,y:s,platform:a,rects:o,elements:l,strategy:c}=e,{boundary:u="clippingAncestors",rootBoundary:d="viewport",elementContext:f="floating",altBoundary:x=!1,padding:g=0}=G0(t,e),v=TAe(g),C=l[x?f==="floating"?"reference":"floating":f],N=N9(await a.getClippingRect({element:(n=await(a.isElement==null?void 0:a.isElement(C)))==null||n?C:C.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(l.floating)),boundary:u,rootBoundary:d,strategy:c})),P=f==="floating"?{x:r,y:s,width:o.floating.width,height:o.floating.height}:o.reference,I=await(a.getOffsetParent==null?void 0:a.getOffsetParent(l.floating)),R=await(a.isElement==null?void 0:a.isElement(I))?await(a.getScale==null?void 0:a.getScale(I))||{x:1,y:1}:{x:1,y:1},F=N9(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:P,offsetParent:I,strategy:c}):P);return{top:(N.top-F.top+v.top)/R.y,bottom:(F.bottom-N.bottom+v.bottom)/R.y,left:(N.left-F.left+v.left)/R.x,right:(F.right-N.right+v.right)/R.x}}const EQe=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:s,rects:a,platform:o,elements:l,middlewareData:c}=t,{element:u,padding:d=0}=G0(e,t)||{};if(u==null)return{};const f=TAe(d),x={x:n,y:r},g=zre(s),v=Ure(g),w=await o.getDimensions(u),C=g==="y",N=C?"top":"left",P=C?"bottom":"right",I=C?"clientHeight":"clientWidth",R=a.reference[v]+a.reference[g]-x[g]-a.floating[v],F=x[g]-a.reference[g],U=await(o.getOffsetParent==null?void 0:o.getOffsetParent(u));let L=U?U[I]:0;(!L||!await(o.isElement==null?void 0:o.isElement(U)))&&(L=l.floating[I]||a.floating[v]);const z=R/2-F/2,Q=L/2-w[v]/2-1,ne=Oy(f[N],Q),J=Oy(f[P],Q),X=ne,re=L-w[v]-J,pe=L/2-w[v]/2+z,Y=NQ(X,pe,re),ie=!c.arrow&&sA(s)!=null&&pe!==Y&&a.reference[v]/2-(pe<X?ne:J)-w[v]/2<0,oe=ie?pe<X?pe-X:pe-re:0;return{[g]:x[g]+oe,data:{[g]:Y,centerOffset:pe-Y-oe,...ie&&{alignmentOffset:oe}},reset:ie}}}),_Qe=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:s,middlewareData:a,rects:o,initialPlacement:l,platform:c,elements:u}=t,{mainAxis:d=!0,crossAxis:f=!0,fallbackPlacements:x,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:w=!0,...C}=G0(e,t);if((n=a.arrow)!=null&&n.alignmentOffset)return{};const N=n1(s),P=Ry(l),I=n1(l)===l,R=await(c.isRTL==null?void 0:c.isRTL(u.floating)),F=x||(I||!w?[UO(l)]:CQe(l)),U=v!=="none";!x&&U&&F.push(...NQe(l,w,v,R));const L=[l,...F],z=await AS(t,C),Q=[];let ne=((r=a.flip)==null?void 0:r.overflows)||[];if(d&&Q.push(z[N]),f){const pe=wQe(s,o,R);Q.push(z[pe[0]],z[pe[1]])}if(ne=[...ne,{placement:s,overflows:Q}],!Q.every(pe=>pe<=0)){var J,X;const pe=(((J=a.flip)==null?void 0:J.index)||0)+1,Y=L[pe];if(Y)return{data:{index:pe,overflows:ne},reset:{placement:Y}};let ie=(X=ne.filter(oe=>oe.overflows[0]<=0).sort((oe,G)=>oe.overflows[1]-G.overflows[1])[0])==null?void 0:X.placement;if(!ie)switch(g){case"bestFit":{var re;const oe=(re=ne.filter(G=>{if(U){const V=Ry(G.placement);return V===P||V==="y"}return!0}).map(G=>[G.placement,G.overflows.filter(V=>V>0).reduce((V,ee)=>V+ee,0)]).sort((G,V)=>G[1]-V[1])[0])==null?void 0:re[0];oe&&(ie=oe);break}case"initialPlacement":ie=l;break}if(s!==ie)return{reset:{placement:ie}}}return{}}}};function Vde(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Wde(e){return bQe.some(t=>e[t]>=0)}const kQe=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...s}=G0(e,t);switch(r){case"referenceHidden":{const a=await AS(t,{...s,elementContext:"reference"}),o=Vde(a,n.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:Wde(o)}}}case"escaped":{const a=await AS(t,{...s,altBoundary:!0}),o=Vde(a,n.floating);return{data:{escapedOffsets:o,escaped:Wde(o)}}}default:return{}}}}};async function TQe(e,t){const{placement:n,platform:r,elements:s}=e,a=await(r.isRTL==null?void 0:r.isRTL(s.floating)),o=n1(n),l=sA(n),c=Ry(n)==="y",u=["left","top"].includes(o)?-1:1,d=a&&c?-1:1,f=G0(t,e);let{mainAxis:x,crossAxis:g,alignmentAxis:v}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return l&&typeof v=="number"&&(g=l==="end"?v*-1:v),c?{x:g*d,y:x*u}:{x:x*u,y:g*d}}const IQe=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:s,y:a,placement:o,middlewareData:l}=t,c=await TQe(t,e);return o===((n=l.offset)==null?void 0:n.placement)&&(r=l.arrow)!=null&&r.alignmentOffset?{}:{x:s+c.x,y:a+c.y,data:{...c,placement:o}}}}},PQe=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:s}=t,{mainAxis:a=!0,crossAxis:o=!1,limiter:l={fn:C=>{let{x:N,y:P}=C;return{x:N,y:P}}},...c}=G0(e,t),u={x:n,y:r},d=await AS(t,c),f=Ry(n1(s)),x=$re(f);let g=u[x],v=u[f];if(a){const C=x==="y"?"top":"left",N=x==="y"?"bottom":"right",P=g+d[C],I=g-d[N];g=NQ(P,g,I)}if(o){const C=f==="y"?"top":"left",N=f==="y"?"bottom":"right",P=v+d[C],I=v-d[N];v=NQ(P,v,I)}const w=l.fn({...t,[x]:g,[f]:v});return{...w,data:{x:w.x-n,y:w.y-r,enabled:{[x]:a,[f]:o}}}}}},FQe=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:s,rects:a,middlewareData:o}=t,{offset:l=0,mainAxis:c=!0,crossAxis:u=!0}=G0(e,t),d={x:n,y:r},f=Ry(s),x=$re(f);let g=d[x],v=d[f];const w=G0(l,t),C=typeof w=="number"?{mainAxis:w,crossAxis:0}:{mainAxis:0,crossAxis:0,...w};if(c){const I=x==="y"?"height":"width",R=a.reference[x]-a.floating[I]+C.mainAxis,F=a.reference[x]+a.reference[I]-C.mainAxis;g<R?g=R:g>F&&(g=F)}if(u){var N,P;const I=x==="y"?"width":"height",R=["top","left"].includes(n1(s)),F=a.reference[f]-a.floating[I]+(R&&((N=o.offset)==null?void 0:N[f])||0)+(R?0:C.crossAxis),U=a.reference[f]+a.reference[I]+(R?0:((P=o.offset)==null?void 0:P[f])||0)-(R?C.crossAxis:0);v<F?v=F:v>U&&(v=U)}return{[x]:g,[f]:v}}}},OQe=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:s,rects:a,platform:o,elements:l}=t,{apply:c=()=>{},...u}=G0(e,t),d=await AS(t,u),f=n1(s),x=sA(s),g=Ry(s)==="y",{width:v,height:w}=a.floating;let C,N;f==="top"||f==="bottom"?(C=f,N=x===(await(o.isRTL==null?void 0:o.isRTL(l.floating))?"start":"end")?"left":"right"):(N=f,C=x==="end"?"top":"bottom");const P=w-d.top-d.bottom,I=v-d.left-d.right,R=Oy(w-d[C],P),F=Oy(v-d[N],I),U=!t.middlewareData.shift;let L=R,z=F;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(z=I),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(L=P),U&&!x){const ne=Au(d.left,0),J=Au(d.right,0),X=Au(d.top,0),re=Au(d.bottom,0);g?z=v-2*(ne!==0||J!==0?ne+J:Au(d.left,d.right)):L=w-2*(X!==0||re!==0?X+re:Au(d.top,d.bottom))}await c({...t,availableWidth:z,availableHeight:L});const Q=await o.getDimensions(l.floating);return v!==Q.width||w!==Q.height?{reset:{rects:!0}}:{}}}};function IAe(e){const t=mm(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const s=q0(e),a=s?e.offsetWidth:n,o=s?e.offsetHeight:r,l=S9(n)!==a||S9(r)!==o;return l&&(n=a,r=o),{width:n,height:r,$:l}}function Hre(e){return rd(e)?e:e.contextElement}function YC(e){const t=Hre(e);if(!q0(t))return My(1);const n=t.getBoundingClientRect(),{width:r,height:s,$:a}=IAe(t);let o=(a?S9(n.width):n.width)/r,l=(a?S9(n.height):n.height)/s;return(!o||!Number.isFinite(o))&&(o=1),(!l||!Number.isFinite(l))&&(l=1),{x:o,y:l}}const MQe=My(0);function PAe(e){const t=Uf(e);return!Bre()||!t.visualViewport?MQe:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function RQe(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Uf(e)?!1:t}function f3(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const s=e.getBoundingClientRect(),a=Hre(e);let o=My(1);t&&(r?rd(r)&&(o=YC(r)):o=YC(e));const l=RQe(a,n,r)?PAe(a):My(0);let c=(s.left+l.x)/o.x,u=(s.top+l.y)/o.y,d=s.width/o.x,f=s.height/o.y;if(a){const x=Uf(a),g=r&&rd(r)?Uf(r):r;let v=x,w=SQ(v);for(;w&&r&&g!==v;){const C=YC(w),N=w.getBoundingClientRect(),P=mm(w),I=N.left+(w.clientLeft+parseFloat(P.paddingLeft))*C.x,R=N.top+(w.clientTop+parseFloat(P.paddingTop))*C.y;c*=C.x,u*=C.y,d*=C.x,f*=C.y,c+=I,u+=R,v=Uf(w),w=SQ(v)}}return N9({width:d,height:f,x:c,y:u})}function LQe(e){let{elements:t,rect:n,offsetParent:r,strategy:s}=e;const a=s==="fixed",o=cx(r),l=t?AD(t.floating):!1;if(r===o||l&&a)return n;let c={scrollLeft:0,scrollTop:0},u=My(1);const d=My(0),f=q0(r);if((f||!f&&!a)&&((rA(r)!=="body"||gk(o))&&(c=jD(r)),q0(r))){const x=f3(r);u=YC(r),d.x=x.x+r.clientLeft,d.y=x.y+r.clientTop}return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-c.scrollLeft*u.x+d.x,y:n.y*u.y-c.scrollTop*u.y+d.y}}function DQe(e){return Array.from(e.getClientRects())}function jQ(e,t){const n=jD(e).scrollLeft;return t?t.left+n:f3(cx(e)).left+n}function BQe(e){const t=cx(e),n=jD(e),r=e.ownerDocument.body,s=Au(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=Au(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let o=-n.scrollLeft+jQ(e);const l=-n.scrollTop;return mm(r).direction==="rtl"&&(o+=Au(t.clientWidth,r.clientWidth)-s),{width:s,height:a,x:o,y:l}}function $Qe(e,t){const n=Uf(e),r=cx(e),s=n.visualViewport;let a=r.clientWidth,o=r.clientHeight,l=0,c=0;if(s){a=s.width,o=s.height;const u=Bre();(!u||u&&t==="fixed")&&(l=s.offsetLeft,c=s.offsetTop)}return{width:a,height:o,x:l,y:c}}function UQe(e,t){const n=f3(e,!0,t==="fixed"),r=n.top+e.clientTop,s=n.left+e.clientLeft,a=q0(e)?YC(e):My(1),o=e.clientWidth*a.x,l=e.clientHeight*a.y,c=s*a.x,u=r*a.y;return{width:o,height:l,x:c,y:u}}function qde(e,t,n){let r;if(t==="viewport")r=$Qe(e,n);else if(t==="document")r=BQe(cx(e));else if(rd(t))r=UQe(t,n);else{const s=PAe(e);r={...t,x:t.x-s.x,y:t.y-s.y}}return N9(r)}function FAe(e,t){const n=Fy(e);return n===t||!rd(n)||NS(n)?!1:mm(n).position==="fixed"||FAe(n,t)}function zQe(e,t){const n=t.get(e);if(n)return n;let r=C9(e,[],!1).filter(l=>rd(l)&&rA(l)!=="body"),s=null;const a=mm(e).position==="fixed";let o=a?Fy(e):e;for(;rd(o)&&!NS(o);){const l=mm(o),c=Dre(o);!c&&l.position==="fixed"&&(s=null),(a?!c&&!s:!c&&l.position==="static"&&!!s&&["absolute","fixed"].includes(s.position)||gk(o)&&!c&&FAe(e,o))?r=r.filter(d=>d!==o):s=l,o=Fy(o)}return t.set(e,r),r}function HQe(e){let{element:t,boundary:n,rootBoundary:r,strategy:s}=e;const o=[...n==="clippingAncestors"?AD(t)?[]:zQe(t,this._c):[].concat(n),r],l=o[0],c=o.reduce((u,d)=>{const f=qde(t,d,s);return u.top=Au(f.top,u.top),u.right=Oy(f.right,u.right),u.bottom=Oy(f.bottom,u.bottom),u.left=Au(f.left,u.left),u},qde(t,l,s));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function VQe(e){const{width:t,height:n}=IAe(e);return{width:t,height:n}}function WQe(e,t,n){const r=q0(t),s=cx(t),a=n==="fixed",o=f3(e,!0,a,t);let l={scrollLeft:0,scrollTop:0};const c=My(0);if(r||!r&&!a)if((rA(t)!=="body"||gk(s))&&(l=jD(t)),r){const g=f3(t,!0,a,t);c.x=g.x+t.clientLeft,c.y=g.y+t.clientTop}else s&&(c.x=jQ(s));let u=0,d=0;if(s&&!r&&!a){const g=s.getBoundingClientRect();d=g.top+l.scrollTop,u=g.left+l.scrollLeft-jQ(s,g)}const f=o.left+l.scrollLeft-c.x-u,x=o.top+l.scrollTop-c.y-d;return{x:f,y:x,width:o.width,height:o.height}}function gz(e){return mm(e).position==="static"}function Gde(e,t){if(!q0(e)||mm(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return cx(e)===n&&(n=n.ownerDocument.body),n}function OAe(e,t){const n=Uf(e);if(AD(e))return n;if(!q0(e)){let s=Fy(e);for(;s&&!NS(s);){if(rd(s)&&!gz(s))return s;s=Fy(s)}return n}let r=Gde(e,t);for(;r&&mQe(r)&&gz(r);)r=Gde(r,t);return r&&NS(r)&&gz(r)&&!Dre(r)?n:r||xQe(e)||n}const qQe=async function(e){const t=this.getOffsetParent||OAe,n=this.getDimensions,r=await n(e.floating);return{reference:WQe(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function GQe(e){return mm(e).direction==="rtl"}const KQe={convertOffsetParentRelativeRectToViewportRelativeRect:LQe,getDocumentElement:cx,getClippingRect:HQe,getOffsetParent:OAe,getElementRects:qQe,getClientRects:DQe,getDimensions:VQe,getScale:YC,isElement:rd,isRTL:GQe};function YQe(e,t){let n=null,r;const s=cx(e);function a(){var l;clearTimeout(r),(l=n)==null||l.disconnect(),n=null}function o(l,c){l===void 0&&(l=!1),c===void 0&&(c=1),a();const{left:u,top:d,width:f,height:x}=e.getBoundingClientRect();if(l||t(),!f||!x)return;const g=NI(d),v=NI(s.clientWidth-(u+f)),w=NI(s.clientHeight-(d+x)),C=NI(u),P={rootMargin:-g+"px "+-v+"px "+-w+"px "+-C+"px",threshold:Au(0,Oy(1,c))||1};let I=!0;function R(F){const U=F[0].intersectionRatio;if(U!==c){if(!I)return o();U?o(!1,U):r=setTimeout(()=>{o(!1,1e-7)},1e3)}I=!1}try{n=new IntersectionObserver(R,{...P,root:s.ownerDocument})}catch{n=new IntersectionObserver(R,P)}n.observe(e)}return o(!0),a}function MAe(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:s=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,u=Hre(e),d=s||a?[...u?C9(u):[],...C9(t)]:[];d.forEach(N=>{s&&N.addEventListener("scroll",n,{passive:!0}),a&&N.addEventListener("resize",n)});const f=u&&l?YQe(u,n):null;let x=-1,g=null;o&&(g=new ResizeObserver(N=>{let[P]=N;P&&P.target===u&&g&&(g.unobserve(t),cancelAnimationFrame(x),x=requestAnimationFrame(()=>{var I;(I=g)==null||I.observe(t)})),n()}),u&&!c&&g.observe(u),g.observe(t));let v,w=c?f3(e):null;c&&C();function C(){const N=f3(e);w&&(N.x!==w.x||N.y!==w.y||N.width!==w.width||N.height!==w.height)&&n(),w=N,v=requestAnimationFrame(C)}return n(),()=>{var N;d.forEach(P=>{s&&P.removeEventListener("scroll",n),a&&P.removeEventListener("resize",n)}),f==null||f(),(N=g)==null||N.disconnect(),g=null,c&&cancelAnimationFrame(v)}}const bz=AS,RAe=IQe,LAe=PQe,DAe=_Qe,BAe=OQe,XQe=kQe,Kde=EQe,QQe=FQe,$Ae=(e,t,n)=>{const r=new Map,s={platform:KQe,...n},a={...s.platform,_c:r};return jQe(e,t,{...s,platform:a})};var EF=typeof document<"u"?m.useLayoutEffect:m.useEffect;function zO(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,s;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(!zO(e[r],t[r]))return!1;return!0}if(s=Object.keys(e),n=s.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,s[r]))return!1;for(r=n;r--!==0;){const a=s[r];if(!(a==="_owner"&&e.$$typeof)&&!zO(e[a],t[a]))return!1}return!0}return e!==e&&t!==t}function UAe(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Yde(e,t){const n=UAe(e);return Math.round(t*n)/n}function yz(e){const t=m.useRef(e);return EF(()=>{t.current=e}),t}function ZQe(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:s,elements:{reference:a,floating:o}={},transform:l=!0,whileElementsMounted:c,open:u}=e,[d,f]=m.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[x,g]=m.useState(r);zO(x,r)||g(r);const[v,w]=m.useState(null),[C,N]=m.useState(null),P=m.useCallback(G=>{G!==U.current&&(U.current=G,w(G))},[]),I=m.useCallback(G=>{G!==L.current&&(L.current=G,N(G))},[]),R=a||v,F=o||C,U=m.useRef(null),L=m.useRef(null),z=m.useRef(d),Q=c!=null,ne=yz(c),J=yz(s),X=yz(u),re=m.useCallback(()=>{if(!U.current||!L.current)return;const G={placement:t,strategy:n,middleware:x};J.current&&(G.platform=J.current),$Ae(U.current,L.current,G).then(V=>{const ee={...V,isPositioned:X.current!==!1};pe.current&&!zO(z.current,ee)&&(z.current=ee,Na.flushSync(()=>{f(ee)}))})},[x,t,n,J,X]);EF(()=>{u===!1&&z.current.isPositioned&&(z.current.isPositioned=!1,f(G=>({...G,isPositioned:!1})))},[u]);const pe=m.useRef(!1);EF(()=>(pe.current=!0,()=>{pe.current=!1}),[]),EF(()=>{if(R&&(U.current=R),F&&(L.current=F),R&&F){if(ne.current)return ne.current(R,F,re);re()}},[R,F,re,ne,Q]);const Y=m.useMemo(()=>({reference:U,floating:L,setReference:P,setFloating:I}),[P,I]),ie=m.useMemo(()=>({reference:R,floating:F}),[R,F]),oe=m.useMemo(()=>{const G={position:n,left:0,top:0};if(!ie.floating)return G;const V=Yde(ie.floating,d.x),ee=Yde(ie.floating,d.y);return l?{...G,transform:"translate("+V+"px, "+ee+"px)",...UAe(ie.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:V,top:ee}},[n,l,ie.floating,d.x,d.y]);return m.useMemo(()=>({...d,update:re,refs:Y,elements:ie,floatingStyles:oe}),[d,re,Y,ie,oe])}const zAe=(e,t)=>({...RAe(e),options:[e,t]}),JQe=(e,t)=>({...LAe(e),options:[e,t]}),eZe=(e,t)=>({...DAe(e),options:[e,t]}),tZe=(e,t)=>({...BAe(e),options:[e,t]}),HAe={...Iy},nZe=HAe.useInsertionEffect,rZe=nZe||(e=>e());function VAe(e){const t=m.useRef(()=>{});return rZe(()=>{t.current=e}),m.useCallback(function(){for(var n=arguments.length,r=new Array(n),s=0;s<n;s++)r[s]=arguments[s];return t.current==null?void 0:t.current(...r)},[])}var EQ=typeof document<"u"?m.useLayoutEffect:m.useEffect;let Xde=!1,sZe=0;const Qde=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+sZe++;function iZe(){const[e,t]=m.useState(()=>Xde?Qde():void 0);return EQ(()=>{e==null&&t(Qde())},[]),m.useEffect(()=>{Xde=!0},[]),e}const aZe=HAe.useId,oZe=aZe||iZe;function lZe(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(s=>s(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(s=>s!==n))||[])}}}const cZe=m.createContext(null),uZe=m.createContext(null),dZe=()=>{var e;return((e=m.useContext(cZe))==null?void 0:e.id)||null},fZe=()=>m.useContext(uZe),hZe="data-floating-ui-focusable";function pZe(e){const{open:t=!1,onOpenChange:n,elements:r}=e,s=oZe(),a=m.useRef({}),[o]=m.useState(()=>lZe()),l=dZe()!=null,[c,u]=m.useState(r.reference),d=VAe((g,v,w)=>{a.current.openEvent=g?v:void 0,o.emit("openchange",{open:g,event:v,reason:w,nested:l}),n==null||n(g,v,w)}),f=m.useMemo(()=>({setPositionReference:u}),[]),x=m.useMemo(()=>({reference:c||r.reference||null,floating:r.floating||null,domReference:r.reference}),[c,r.reference,r.floating]);return m.useMemo(()=>({dataRef:a,open:t,onOpenChange:d,elements:x,events:o,floatingId:s,refs:f}),[t,d,x,o,s,f])}function mZe(e){e===void 0&&(e={});const{nodeId:t}=e,n=pZe({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,s=r.elements,[a,o]=m.useState(null),[l,c]=m.useState(null),d=(s==null?void 0:s.reference)||a,f=m.useRef(null),x=fZe();EQ(()=>{d&&(f.current=d)},[d]);const g=ZQe({...e,elements:{...s,...l&&{reference:l}}}),v=m.useCallback(I=>{const R=rd(I)?{getBoundingClientRect:()=>I.getBoundingClientRect(),contextElement:I}:I;c(R),g.refs.setReference(R)},[g.refs]),w=m.useCallback(I=>{(rd(I)||I===null)&&(f.current=I,o(I)),(rd(g.refs.reference.current)||g.refs.reference.current===null||I!==null&&!rd(I))&&g.refs.setReference(I)},[g.refs]),C=m.useMemo(()=>({...g.refs,setReference:w,setPositionReference:v,domReference:f}),[g.refs,w,v]),N=m.useMemo(()=>({...g.elements,domReference:d}),[g.elements,d]),P=m.useMemo(()=>({...g,...r,refs:C,elements:N,nodeId:t}),[g,C,N,t,r]);return EQ(()=>{r.dataRef.current.floatingContext=P;const I=x==null?void 0:x.nodesRef.current.find(R=>R.id===t);I&&(I.context=P)}),m.useMemo(()=>({...g,context:P,refs:C,elements:N}),[g,C,N,P])}const Zde="active",Jde="selected";function vz(e,t,n){const r=new Map,s=n==="item";let a=e;if(s&&e){const{[Zde]:o,[Jde]:l,...c}=e;a=c}return{...n==="floating"&&{tabIndex:-1,[hZe]:""},...a,...t.map(o=>{const l=o?o[n]:null;return typeof l=="function"?e?l(e):null:l}).concat(e).reduce((o,l)=>(l&&Object.entries(l).forEach(c=>{let[u,d]=c;if(!(s&&[Zde,Jde].includes(u)))if(u.indexOf("on")===0){if(r.has(u)||r.set(u,[]),typeof d=="function"){var f;(f=r.get(u))==null||f.push(d),o[u]=function(){for(var x,g=arguments.length,v=new Array(g),w=0;w<g;w++)v[w]=arguments[w];return(x=r.get(u))==null?void 0:x.map(C=>C(...v)).find(C=>C!==void 0)}}}else o[u]=d}),o),{})}}function xZe(e){e===void 0&&(e=[]);const t=e.map(l=>l==null?void 0:l.reference),n=e.map(l=>l==null?void 0:l.floating),r=e.map(l=>l==null?void 0:l.item),s=m.useCallback(l=>vz(l,e,"reference"),t),a=m.useCallback(l=>vz(l,e,"floating"),n),o=m.useCallback(l=>vz(l,e,"item"),r);return m.useMemo(()=>({getReferenceProps:s,getFloatingProps:a,getItemProps:o}),[s,a,o])}function efe(e,t){return{...e,rects:{...e.rects,floating:{...e.rects.floating,height:t}}}}const gZe=e=>({name:"inner",options:e,async fn(t){const{listRef:n,overflowRef:r,onFallbackChange:s,offset:a=0,index:o=0,minItemsVisible:l=4,referenceOverflowThreshold:c=0,scrollRef:u,...d}=G0(e,t),{rects:f,elements:{floating:x}}=t,g=n.current[o],v=(u==null?void 0:u.current)||x,w=x.clientTop||v.clientTop,C=x.clientTop!==0,N=v.clientTop!==0,P=x===v;if(!g)return{};const I={...t,...await zAe(-g.offsetTop-x.clientTop-f.reference.height/2-g.offsetHeight/2-a).fn(t)},R=await bz(efe(I,v.scrollHeight+w+x.clientTop),d),F=await bz(I,{...d,elementContext:"reference"}),U=Au(0,R.top),L=I.y+U,z=v.scrollHeight>v.clientHeight,ne=(z?J=>J:S9)(Au(0,v.scrollHeight+(C&&P||N?w*2:0)-U-Au(0,R.bottom)));if(v.style.maxHeight=ne+"px",v.scrollTop=U,s){const J=z&&v.offsetHeight<g.offsetHeight*l-1||F.top>=-c||F.bottom>=-c;Na.flushSync(()=>s(J))}return r&&(r.current=await bz(efe({...I,y:L},v.offsetHeight+w+x.clientTop),d)),{y:L}}});function bZe(e,t){const{open:n,elements:r}=e,{enabled:s=!0,overflowRef:a,scrollRef:o,onChange:l}=t,c=VAe(l),u=m.useRef(!1),d=m.useRef(null),f=m.useRef(null);m.useEffect(()=>{if(!s)return;function g(w){if(w.ctrlKey||!v||a.current==null)return;const C=w.deltaY,N=a.current.top>=-.5,P=a.current.bottom>=-.5,I=v.scrollHeight-v.clientHeight,R=C<0?-1:1,F=C<0?"max":"min";v.scrollHeight<=v.clientHeight||(!N&&C>0||!P&&C<0?(w.preventDefault(),Na.flushSync(()=>{c(U=>U+Math[F](C,I*R))})):/firefox/i.test(gQe())&&(v.scrollTop+=C))}const v=(o==null?void 0:o.current)||r.floating;if(n&&v)return v.addEventListener("wheel",g),requestAnimationFrame(()=>{d.current=v.scrollTop,a.current!=null&&(f.current={...a.current})}),()=>{d.current=null,f.current=null,v.removeEventListener("wheel",g)}},[s,n,r.floating,a,o,c]);const x=m.useMemo(()=>({onKeyDown(){u.current=!0},onWheel(){u.current=!1},onPointerMove(){u.current=!1},onScroll(){const g=(o==null?void 0:o.current)||r.floating;if(!(!a.current||!g||!u.current)){if(d.current!==null){const v=g.scrollTop-d.current;(a.current.bottom<-.5&&v<-1||a.current.top<-.5&&v>1)&&Na.flushSync(()=>c(w=>w+v))}requestAnimationFrame(()=>{d.current=g.scrollTop})}}}),[r.floating,c,a,o]);return m.useMemo(()=>s?{floating:x}:{},[s,x])}let iA=m.createContext({styles:void 0,setReference:()=>{},setFloating:()=>{},getReferenceProps:()=>({}),getFloatingProps:()=>({}),slot:{}});iA.displayName="FloatingContext";let Vre=m.createContext(null);Vre.displayName="PlacementContext";function yZe(e){return m.useMemo(()=>e?typeof e=="string"?{to:e}:e:null,[e])}function vZe(){return m.useContext(iA).setReference}function wZe(){return m.useContext(iA).getReferenceProps}function CZe(){let{getFloatingProps:e,slot:t}=m.useContext(iA);return m.useCallback((...n)=>Object.assign({},e(...n),{"data-anchor":t.anchor}),[e,t])}function SZe(e=null){e===!1&&(e=null),typeof e=="string"&&(e={to:e});let t=m.useContext(Vre),n=m.useMemo(()=>e,[JSON.stringify(e,(s,a)=>{var o;return(o=a==null?void 0:a.outerHTML)!=null?o:a})]);Qa(()=>{t==null||t(n??null)},[t,n]);let r=m.useContext(iA);return m.useMemo(()=>[r.setFloating,e?r.styles:{}],[r.setFloating,e,r.styles])}let tfe=4;function NZe({children:e,enabled:t=!0}){let[n,r]=m.useState(null),[s,a]=m.useState(0),o=m.useRef(null),[l,c]=m.useState(null);AZe(l);let u=t&&n!==null&&l!==null,{to:d="bottom",gap:f=0,offset:x=0,padding:g=0,inner:v}=jZe(n,l),[w,C="center"]=d.split(" ");Qa(()=>{u&&a(0)},[u]);let{refs:N,floatingStyles:P,context:I}=mZe({open:u,placement:w==="selection"?C==="center"?"bottom":`bottom-${C}`:C==="center"?`${w}`:`${w}-${C}`,strategy:"absolute",transform:!1,middleware:[zAe({mainAxis:w==="selection"?0:f,crossAxis:x}),JQe({padding:g}),w!=="selection"&&eZe({padding:g}),w==="selection"&&v?gZe({...v,padding:g,overflowRef:o,offset:s,minItemsVisible:tfe,referenceOverflowThreshold:g,onFallbackChange(J){var X,re;if(!J)return;let pe=I.elements.floating;if(!pe)return;let Y=parseFloat(getComputedStyle(pe).scrollPaddingBottom)||0,ie=Math.min(tfe,pe.childElementCount),oe=0,G=0;for(let V of(re=(X=I.elements.floating)==null?void 0:X.childNodes)!=null?re:[])if(V instanceof HTMLElement){let ee=V.offsetTop,ae=ee+V.clientHeight+Y,fe=pe.scrollTop,Ne=fe+pe.clientHeight;if(ee>=fe&&ae<=Ne)ie--;else{G=Math.max(0,Math.min(ae,Ne)-Math.max(ee,fe)),oe=V.clientHeight;break}}ie>=1&&a(V=>{let ee=oe*ie-G+Y;return V>=ee?V:ee})}}):null,tZe({padding:g,apply({availableWidth:J,availableHeight:X,elements:re}){Object.assign(re.floating.style,{overflow:"auto",maxWidth:`${J}px`,maxHeight:`min(var(--anchor-max-height, 100vh), ${X}px)`})}})].filter(Boolean),whileElementsMounted:MAe}),[R=w,F=C]=I.placement.split("-");w==="selection"&&(R="selection");let U=m.useMemo(()=>({anchor:[R,F].filter(Boolean).join(" ")}),[R,F]),L=bZe(I,{overflowRef:o,onChange:a}),{getReferenceProps:z,getFloatingProps:Q}=xZe([L]),ne=Us(J=>{c(J),N.setFloating(J)});return m.createElement(Vre.Provider,{value:r},m.createElement(iA.Provider,{value:{setFloating:ne,setReference:N.setReference,styles:P,getReferenceProps:z,getFloatingProps:Q,slot:U}},e))}function AZe(e){Qa(()=>{if(!e)return;let t=new MutationObserver(()=>{let n=window.getComputedStyle(e).maxHeight,r=parseFloat(n);if(isNaN(r))return;let s=parseInt(n);isNaN(s)||r!==s&&(e.style.maxHeight=`${Math.ceil(r)}px`)});return t.observe(e,{attributes:!0,attributeFilter:["style"]}),()=>{t.disconnect()}},[e])}function jZe(e,t){var n,r,s;let a=wz((n=e==null?void 0:e.gap)!=null?n:"var(--anchor-gap, 0)",t),o=wz((r=e==null?void 0:e.offset)!=null?r:"var(--anchor-offset, 0)",t),l=wz((s=e==null?void 0:e.padding)!=null?s:"var(--anchor-padding, 0)",t);return{...e,gap:a,offset:o,padding:l}}function wz(e,t,n=void 0){let r=n2(),s=Us((c,u)=>{if(c==null)return[n,null];if(typeof c=="number")return[c,null];if(typeof c=="string"){if(!u)return[n,null];let d=nfe(c,u);return[d,f=>{let x=WAe(c);{let g=x.map(v=>window.getComputedStyle(u).getPropertyValue(v));r.requestAnimationFrame(function v(){r.nextFrame(v);let w=!1;for(let[N,P]of x.entries()){let I=window.getComputedStyle(u).getPropertyValue(P);if(g[N]!==I){g[N]=I,w=!0;break}}if(!w)return;let C=nfe(c,u);d!==C&&(f(C),d=C)})}return r.dispose}]}return[n,null]}),a=m.useMemo(()=>s(e,t)[0],[e,t]),[o=a,l]=m.useState();return Qa(()=>{let[c,u]=s(e,t);if(l(c),!!u)return u(l)},[e,t]),o}function WAe(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(),s=t[1].slice(n+1).trim();return s?[r,...WAe(s)]:[r]}return[]}function nfe(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}let ED=m.createContext(null);ED.displayName="OpenClosedContext";var tc=(e=>(e[e.Open=1]="Open",e[e.Closed=2]="Closed",e[e.Closing=4]="Closing",e[e.Opening=8]="Opening",e))(tc||{});function aA(){return m.useContext(ED)}function Wre({value:e,children:t}){return Ae.createElement(ED.Provider,{value:e},t)}function qAe({children:e}){return Ae.createElement(ED.Provider,{value:null},e)}function EZe(e){function t(){document.readyState!=="loading"&&(e(),document.removeEventListener("DOMContentLoaded",t))}typeof window<"u"&&typeof document<"u"&&(document.addEventListener("DOMContentLoaded",t),t())}let Fb=[];EZe(()=>{function e(t){if(!(t.target instanceof HTMLElement)||t.target===document.body||Fb[0]===t.target)return;let n=t.target;n=n.closest($O),Fb.unshift(n??t.target),Fb=Fb.filter(r=>r!=null&&r.isConnected),Fb.splice(10)}window.addEventListener("click",e,{capture:!0}),window.addEventListener("mousedown",e,{capture:!0}),window.addEventListener("focus",e,{capture:!0}),document.body.addEventListener("click",e,{capture:!0}),document.body.addEventListener("mousedown",e,{capture:!0}),document.body.addEventListener("focus",e,{capture:!0})});function _Ze(e){throw new Error("Unexpected object: "+e)}var _u=(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))(_u||{});function Cz(e,t){let n=t.resolveItems();if(n.length<=0)return null;let r=t.resolveActiveIndex(),s=r??-1;switch(e.focus){case 0:{for(let a=0;a<n.length;++a)if(!t.resolveDisabled(n[a],a,n))return a;return r}case 1:{s===-1&&(s=n.length);for(let a=s-1;a>=0;--a)if(!t.resolveDisabled(n[a],a,n))return a;return r}case 2:{for(let a=s+1;a<n.length;++a)if(!t.resolveDisabled(n[a],a,n))return a;return r}case 3:{for(let a=n.length-1;a>=0;--a)if(!t.resolveDisabled(n[a],a,n))return a;return r}case 4:{for(let a=0;a<n.length;++a)if(t.resolveId(n[a],a,n)===e.id)return a;return r}case 5:return null;default:_Ze(e)}}function GAe(e){let t=Us(e),n=m.useRef(!1);m.useEffect(()=>(n.current=!1,()=>{n.current=!0,wD(()=>{n.current&&t()})}),[t])}function kZe(){let e=typeof document>"u";return"useSyncExternalStore"in Iy?(t=>t.useSyncExternalStore)(Iy)(()=>()=>{},()=>!1,()=>!e):!1}function bk(){let e=kZe(),[t,n]=m.useState(zw.isHandoffComplete);return t&&zw.isHandoffComplete===!1&&n(!1),m.useEffect(()=>{t!==!0&&n(!0)},[t]),m.useEffect(()=>zw.handoff(),[]),e?!1:t}let KAe=m.createContext(!1);function TZe(){return m.useContext(KAe)}function rfe(e){return Ae.createElement(KAe.Provider,{value:e.force},e.children)}function IZe(e){let t=TZe(),n=m.useContext(XAe),r=nA(e),[s,a]=m.useState(()=>{var o;if(!t&&n!==null)return(o=n.current)!=null?o:null;if(zw.isServer)return null;let l=r==null?void 0:r.getElementById("headlessui-portal-root");if(l)return l;if(r===null)return null;let c=r.createElement("div");return c.setAttribute("id","headlessui-portal-root"),r.body.appendChild(c)});return m.useEffect(()=>{s!==null&&(r!=null&&r.body.contains(s)||r==null||r.body.appendChild(s))},[s,r]),m.useEffect(()=>{t||n!==null&&a(n.current)},[n,a,t]),s}let YAe=m.Fragment,PZe=uo(function(e,t){let n=e,r=m.useRef(null),s=lc(dAe(f=>{r.current=f}),t),a=nA(r),o=IZe(r),[l]=m.useState(()=>{var f;return zw.isServer?null:(f=a==null?void 0:a.createElement("div"))!=null?f:null}),c=m.useContext(_Q),u=bk();Qa(()=>{!o||!l||o.contains(l)||(l.setAttribute("data-headlessui-portal",""),o.appendChild(l))},[o,l]),Qa(()=>{if(l&&c)return c.register(l)},[c,l]),GAe(()=>{var f;!o||!l||(l instanceof Node&&o.contains(l)&&o.removeChild(l),o.childNodes.length<=0&&((f=o.parentElement)==null||f.removeChild(o)))});let d=Co();return u?!o||!l?null:Na.createPortal(d({ourProps:{ref:s},theirProps:n,slot:{},defaultTag:YAe,name:"Portal"}),l):null});function FZe(e,t){let n=lc(t),{enabled:r=!0,...s}=e,a=Co();return r?Ae.createElement(PZe,{...s,ref:n}):a({ourProps:{ref:n},theirProps:s,slot:{},defaultTag:YAe,name:"Portal"})}let OZe=m.Fragment,XAe=m.createContext(null);function MZe(e,t){let{target:n,...r}=e,s={ref:lc(t)},a=Co();return Ae.createElement(XAe.Provider,{value:n},a({ourProps:s,theirProps:r,defaultTag:OZe,name:"Popover.Group"}))}let _Q=m.createContext(null);function RZe(){let e=m.useContext(_Q),t=m.useRef([]),n=Us(a=>(t.current.push(a),e&&e.register(a),()=>r(a))),r=Us(a=>{let o=t.current.indexOf(a);o!==-1&&t.current.splice(o,1),e&&e.unregister(a)}),s=m.useMemo(()=>({register:n,unregister:r,portals:t}),[n,r,t]);return[t,m.useMemo(()=>function({children:a}){return Ae.createElement(_Q.Provider,{value:s},a)},[s])]}let LZe=uo(FZe),QAe=uo(MZe),ZAe=Object.assign(LZe,{Group:QAe});function DZe(e,t=typeof document<"u"?document.defaultView:null,n){let r=tA(e,"escape");jAe(t,"keydown",s=>{r&&(s.defaultPrevented||s.key===xo.Escape&&n(s))})}function BZe(){var e;let[t]=m.useState(()=>typeof window<"u"&&typeof window.matchMedia=="function"?window.matchMedia("(pointer: coarse)"):null),[n,r]=m.useState((e=t==null?void 0:t.matches)!=null?e:!1);return Qa(()=>{if(!t)return;function s(a){r(a.matches)}return t.addEventListener("change",s),()=>t.removeEventListener("change",s)},[t]),n}function $Ze({defaultContainers:e=[],portals:t,mainTreeNode:n}={}){let r=nA(n),s=Us(()=>{var a,o;let l=[];for(let c of e)c!==null&&(c instanceof HTMLElement?l.push(c):"current"in c&&c.current instanceof HTMLElement&&l.push(c.current));if(t!=null&&t.current)for(let c of t.current)l.push(c);for(let c of(a=r==null?void 0:r.querySelectorAll("html > *, body > *"))!=null?a:[])c!==document.body&&c!==document.head&&c instanceof HTMLElement&&c.id!=="headlessui-portal-root"&&(n&&(c.contains(n)||c.contains((o=n==null?void 0:n.getRootNode())==null?void 0:o.host))||l.some(u=>c.contains(u))||l.push(c));return l});return{resolveContainers:s,contains:Us(a=>s().some(o=>o.contains(a)))}}let JAe=m.createContext(null);function sfe({children:e,node:t}){let[n,r]=m.useState(null),s=e8e(t??n);return Ae.createElement(JAe.Provider,{value:s},e,s===null&&Ae.createElement(w9,{features:SS.Hidden,ref:a=>{var o,l;if(a){for(let c of(l=(o=t2(a))==null?void 0:o.querySelectorAll("html > *, body > *"))!=null?l:[])if(c!==document.body&&c!==document.head&&c instanceof HTMLElement&&c!=null&&c.contains(a)){r(c);break}}}}))}function e8e(e=null){var t;return(t=m.useContext(JAe))!=null?t:e}function qre(){let e=m.useRef(!1);return Qa(()=>(e.current=!0,()=>{e.current=!1}),[]),e}var oj=(e=>(e[e.Forwards=0]="Forwards",e[e.Backwards=1]="Backwards",e))(oj||{});function UZe(){let e=m.useRef(0);return NAe(!0,"keydown",t=>{t.key==="Tab"&&(e.current=t.shiftKey?1:0)},!0),e}function t8e(e){if(!e)return new Set;if(typeof e=="function")return new Set(e());let t=new Set;for(let n of e.current)n.current instanceof HTMLElement&&t.add(n.current);return t}let zZe="div";var Fv=(e=>(e[e.None=0]="None",e[e.InitialFocus=1]="InitialFocus",e[e.TabLock=2]="TabLock",e[e.FocusLock=4]="FocusLock",e[e.RestoreFocus=8]="RestoreFocus",e[e.AutoFocus=16]="AutoFocus",e))(Fv||{});function HZe(e,t){let n=m.useRef(null),r=lc(n,t),{initialFocus:s,initialFocusFallback:a,containers:o,features:l=15,...c}=e;bk()||(l=0);let u=nA(n);GZe(l,{ownerDocument:u});let d=KZe(l,{ownerDocument:u,container:n,initialFocus:s,initialFocusFallback:a});YZe(l,{ownerDocument:u,container:n,containers:o,previousActiveElement:d});let f=UZe(),x=Us(P=>{let I=n.current;I&&(R=>R())(()=>{qf(f.current,{[oj.Forwards]:()=>{KC(I,tm.First,{skipElements:[P.relatedTarget,a]})},[oj.Backwards]:()=>{KC(I,tm.Last,{skipElements:[P.relatedTarget,a]})}})})}),g=tA(!!(l&2),"focus-trap#tab-lock"),v=n2(),w=m.useRef(!1),C={ref:r,onKeyDown(P){P.key=="Tab"&&(w.current=!0,v.requestAnimationFrame(()=>{w.current=!1}))},onBlur(P){if(!(l&4))return;let I=t8e(o);n.current instanceof HTMLElement&&I.add(n.current);let R=P.relatedTarget;R instanceof HTMLElement&&R.dataset.headlessuiFocusGuard!=="true"&&(n8e(I,R)||(w.current?KC(n.current,qf(f.current,{[oj.Forwards]:()=>tm.Next,[oj.Backwards]:()=>tm.Previous})|tm.WrapAround,{relativeTo:P.target}):P.target instanceof HTMLElement&&O0(P.target)))}},N=Co();return Ae.createElement(Ae.Fragment,null,g&&Ae.createElement(w9,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:x,features:SS.Focusable}),N({ourProps:C,theirProps:c,defaultTag:zZe,name:"FocusTrap"}),g&&Ae.createElement(w9,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:x,features:SS.Focusable}))}let VZe=uo(HZe),WZe=Object.assign(VZe,{features:Fv});function qZe(e=!0){let t=m.useRef(Fb.slice());return Lre(([n],[r])=>{r===!0&&n===!1&&wD(()=>{t.current.splice(0)}),r===!1&&n===!0&&(t.current=Fb.slice())},[e,Fb,t]),Us(()=>{var n;return(n=t.current.find(r=>r!=null&&r.isConnected))!=null?n:null})}function GZe(e,{ownerDocument:t}){let n=!!(e&8),r=qZe(n);Lre(()=>{n||(t==null?void 0:t.activeElement)===(t==null?void 0:t.body)&&O0(r())},[n]),GAe(()=>{n&&O0(r())})}function KZe(e,{ownerDocument:t,container:n,initialFocus:r,initialFocusFallback:s}){let a=m.useRef(null),o=tA(!!(e&1),"focus-trap#initial-focus"),l=qre();return Lre(()=>{if(e===0)return;if(!o){s!=null&&s.current&&O0(s.current);return}let c=n.current;c&&wD(()=>{if(!l.current)return;let u=t==null?void 0:t.activeElement;if(r!=null&&r.current){if((r==null?void 0:r.current)===u){a.current=u;return}}else if(c.contains(u)){a.current=u;return}if(r!=null&&r.current)O0(r.current);else{if(e&16){if(KC(c,tm.First|tm.AutoFocus)!==CQ.Error)return}else if(KC(c,tm.First)!==CQ.Error)return;if(s!=null&&s.current&&(O0(s.current),(t==null?void 0:t.activeElement)===s.current))return;console.warn("There are no focusable elements inside the <FocusTrap />")}a.current=t==null?void 0:t.activeElement})},[s,o,e]),a}function YZe(e,{ownerDocument:t,container:n,containers:r,previousActiveElement:s}){let a=qre(),o=!!(e&4);jAe(t==null?void 0:t.defaultView,"focus",l=>{if(!o||!a.current)return;let c=t8e(r);n.current instanceof HTMLElement&&c.add(n.current);let u=s.current;if(!u)return;let d=l.target;d&&d instanceof HTMLElement?n8e(c,d)?(s.current=d,O0(d)):(l.preventDefault(),l.stopPropagation(),O0(u)):O0(s.current)},!0)}function n8e(e,t){for(let n of e)if(n.contains(t))return!0;return!1}function r8e(e){var t;return!!(e.enter||e.enterFrom||e.enterTo||e.leave||e.leaveFrom||e.leaveTo)||((t=e.as)!=null?t:i8e)!==m.Fragment||Ae.Children.count(e.children)===1}let _D=m.createContext(null);_D.displayName="TransitionContext";var XZe=(e=>(e.Visible="visible",e.Hidden="hidden",e))(XZe||{});function QZe(){let e=m.useContext(_D);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}function ZZe(){let e=m.useContext(kD);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}let kD=m.createContext(null);kD.displayName="NestingContext";function TD(e){return"children"in e?TD(e.children):e.current.filter(({el:t})=>t.current!==null).filter(({state:t})=>t==="visible").length>0}function s8e(e,t){let n=r5(e),r=m.useRef([]),s=qre(),a=n2(),o=Us((g,v=dy.Hidden)=>{let w=r.current.findIndex(({el:C})=>C===g);w!==-1&&(qf(v,{[dy.Unmount](){r.current.splice(w,1)},[dy.Hidden](){r.current[w].state="hidden"}}),a.microTask(()=>{var C;!TD(r)&&s.current&&((C=n.current)==null||C.call(n))}))}),l=Us(g=>{let v=r.current.find(({el:w})=>w===g);return v?v.state!=="visible"&&(v.state="visible"):r.current.push({el:g,state:"visible"}),()=>o(g,dy.Unmount)}),c=m.useRef([]),u=m.useRef(Promise.resolve()),d=m.useRef({enter:[],leave:[]}),f=Us((g,v,w)=>{c.current.splice(0),t&&(t.chains.current[v]=t.chains.current[v].filter(([C])=>C!==g)),t==null||t.chains.current[v].push([g,new Promise(C=>{c.current.push(C)})]),t==null||t.chains.current[v].push([g,new Promise(C=>{Promise.all(d.current[v].map(([N,P])=>P)).then(()=>C())})]),v==="enter"?u.current=u.current.then(()=>t==null?void 0:t.wait.current).then(()=>w(v)):w(v)}),x=Us((g,v,w)=>{Promise.all(d.current[v].splice(0).map(([C,N])=>N)).then(()=>{var C;(C=c.current.shift())==null||C()}).then(()=>w(v))});return m.useMemo(()=>({children:r,register:l,unregister:o,onStart:f,onStop:x,wait:u,chains:d}),[l,o,r,f,x,d,u])}let i8e=m.Fragment,a8e=Py.RenderStrategy;function JZe(e,t){var n,r;let{transition:s=!0,beforeEnter:a,afterEnter:o,beforeLeave:l,afterLeave:c,enter:u,enterFrom:d,enterTo:f,entered:x,leave:g,leaveFrom:v,leaveTo:w,...C}=e,[N,P]=m.useState(null),I=m.useRef(null),R=r8e(e),F=lc(...R?[I,t,P]:t===null?[]:[t]),U=(n=C.unmount)==null||n?dy.Unmount:dy.Hidden,{show:L,appear:z,initial:Q}=QZe(),[ne,J]=m.useState(L?"visible":"hidden"),X=ZZe(),{register:re,unregister:pe}=X;Qa(()=>re(I),[re,I]),Qa(()=>{if(U===dy.Hidden&&I.current){if(L&&ne!=="visible"){J("visible");return}return qf(ne,{hidden:()=>pe(I),visible:()=>re(I)})}},[ne,I,re,pe,L,U]);let Y=bk();Qa(()=>{if(R&&Y&&ne==="visible"&&I.current===null)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[I,ne,Y,R]);let ie=Q&&!z,oe=z&&L&&Q,G=m.useRef(!1),V=s8e(()=>{G.current||(J("hidden"),pe(I))},X),ee=Us(ve=>{G.current=!0;let je=ve?"enter":"leave";V.onStart(I,je,Ie=>{Ie==="enter"?a==null||a():Ie==="leave"&&(l==null||l())})}),ae=Us(ve=>{let je=ve?"enter":"leave";G.current=!1,V.onStop(I,je,Ie=>{Ie==="enter"?o==null||o():Ie==="leave"&&(c==null||c())}),je==="leave"&&!TD(V)&&(J("hidden"),pe(I))});m.useEffect(()=>{R&&s||(ee(L),ae(L))},[L,R,s]);let fe=!(!s||!R||!Y||ie),[,Ne]=Rre(fe,N,L,{start:ee,end:ae}),he=Tb({ref:F,className:((r=vQ(C.className,oe&&u,oe&&d,Ne.enter&&u,Ne.enter&&Ne.closed&&d,Ne.enter&&!Ne.closed&&f,Ne.leave&&g,Ne.leave&&!Ne.closed&&v,Ne.leave&&Ne.closed&&w,!Ne.transition&&L&&x))==null?void 0:r.trim())||void 0,...Mre(Ne)}),ge=0;ne==="visible"&&(ge|=tc.Open),ne==="hidden"&&(ge|=tc.Closed),Ne.enter&&(ge|=tc.Opening),Ne.leave&&(ge|=tc.Closing);let ye=Co();return Ae.createElement(kD.Provider,{value:V},Ae.createElement(Wre,{value:ge},ye({ourProps:he,theirProps:C,defaultTag:i8e,features:a8e,visible:ne==="visible",name:"Transition.Child"})))}function eJe(e,t){let{show:n,appear:r=!1,unmount:s=!0,...a}=e,o=m.useRef(null),l=r8e(e),c=lc(...l?[o,t]:t===null?[]:[t]);bk();let u=aA();if(n===void 0&&u!==null&&(n=(u&tc.Open)===tc.Open),n===void 0)throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");let[d,f]=m.useState(n?"visible":"hidden"),x=s8e(()=>{n||f("hidden")}),[g,v]=m.useState(!0),w=m.useRef([n]);Qa(()=>{g!==!1&&w.current[w.current.length-1]!==n&&(w.current.push(n),v(!1))},[w,n]);let C=m.useMemo(()=>({show:n,appear:r,initial:g}),[n,r,g]);Qa(()=>{n?f("visible"):!TD(x)&&o.current!==null&&f("hidden")},[n,x]);let N={unmount:s},P=Us(()=>{var F;g&&v(!1),(F=e.beforeEnter)==null||F.call(e)}),I=Us(()=>{var F;g&&v(!1),(F=e.beforeLeave)==null||F.call(e)}),R=Co();return Ae.createElement(kD.Provider,{value:x},Ae.createElement(_D.Provider,{value:C},R({ourProps:{...N,as:m.Fragment,children:Ae.createElement(o8e,{ref:c,...N,...a,beforeEnter:P,beforeLeave:I})},theirProps:{},defaultTag:m.Fragment,features:a8e,visible:d==="visible",name:"Transition"})))}function tJe(e,t){let n=m.useContext(_D)!==null,r=aA()!==null;return Ae.createElement(Ae.Fragment,null,!n&&r?Ae.createElement(kQ,{ref:t,...e}):Ae.createElement(o8e,{ref:t,...e}))}let kQ=uo(eJe),o8e=uo(JZe),Gre=uo(tJe),l8e=Object.assign(kQ,{Child:Gre,Root:kQ});var nJe=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(nJe||{}),rJe=(e=>(e[e.SetTitleId=0]="SetTitleId",e))(rJe||{});let sJe={0(e,t){return e.titleId===t.id?e:{...e,titleId:t.id}}},Kre=m.createContext(null);Kre.displayName="DialogContext";function ID(e){let t=m.useContext(Kre);if(t===null){let n=new Error(`<${e} /> is missing a parent <Dialog /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,ID),n}return t}function iJe(e,t){return qf(t.type,sJe,e,t)}let ife=uo(function(e,t){let n=m.useId(),{id:r=`headlessui-dialog-${n}`,open:s,onClose:a,initialFocus:o,role:l="dialog",autoFocus:c=!0,__demoMode:u=!1,unmount:d=!1,...f}=e,x=m.useRef(!1);l=function(){return l==="dialog"||l==="alertdialog"?l:(x.current||(x.current=!0,console.warn(`Invalid role [${l}] passed to <Dialog />. Only \`dialog\` and and \`alertdialog\` are supported. Using \`dialog\` instead.`)),"dialog")}();let g=aA();s===void 0&&g!==null&&(s=(g&tc.Open)===tc.Open);let v=m.useRef(null),w=lc(v,t),C=nA(v),N=s?0:1,[P,I]=m.useReducer(iJe,{titleId:null,descriptionId:null,panelRef:m.createRef()}),R=Us(()=>a(!1)),F=Us(ae=>I({type:0,id:ae})),U=bk()?N===0:!1,[L,z]=RZe(),Q={get current(){var ae;return(ae=P.panelRef.current)!=null?ae:v.current}},ne=e8e(),{resolveContainers:J}=$Ze({mainTreeNode:ne,portals:L,defaultContainers:[Q]}),X=g!==null?(g&tc.Closing)===tc.Closing:!1;bAe(u||X?!1:U,{allowed:Us(()=>{var ae,fe;return[(fe=(ae=v.current)==null?void 0:ae.closest("[data-headlessui-portal]"))!=null?fe:null]}),disallowed:Us(()=>{var ae;return[(ae=ne==null?void 0:ne.closest("body > *:not(#headlessui-portal-root)"))!=null?ae:null]})}),AAe(U,J,ae=>{ae.preventDefault(),R()}),DZe(U,C==null?void 0:C.defaultView,ae=>{ae.preventDefault(),ae.stopPropagation(),document.activeElement&&"blur"in document.activeElement&&typeof document.activeElement.blur=="function"&&document.activeElement.blur(),R()}),EAe(u||X?!1:U,C,J),yAe(U,v,R);let[re,pe]=kre(),Y=m.useMemo(()=>[{dialogState:N,close:R,setTitleId:F,unmount:d},P],[N,P,R,F,d]),ie=m.useMemo(()=>({open:N===0}),[N]),oe={ref:w,id:r,role:l,tabIndex:-1,"aria-modal":u?void 0:N===0?!0:void 0,"aria-labelledby":P.titleId,"aria-describedby":re,unmount:d},G=!BZe(),V=Fv.None;U&&!u&&(V|=Fv.RestoreFocus,V|=Fv.TabLock,c&&(V|=Fv.AutoFocus),G&&(V|=Fv.InitialFocus));let ee=Co();return Ae.createElement(qAe,null,Ae.createElement(rfe,{force:!0},Ae.createElement(ZAe,null,Ae.createElement(Kre.Provider,{value:Y},Ae.createElement(QAe,{target:v},Ae.createElement(rfe,{force:!1},Ae.createElement(pe,{slot:ie},Ae.createElement(z,null,Ae.createElement(WZe,{initialFocus:o,initialFocusFallback:v,containers:J,features:V},Ae.createElement(mAe,{value:R},ee({ourProps:oe,theirProps:f,slot:ie,defaultTag:aJe,features:oJe,visible:N===0,name:"Dialog"})))))))))))}),aJe="div",oJe=Py.RenderStrategy|Py.Static;function lJe(e,t){let{transition:n=!1,open:r,...s}=e,a=aA(),o=e.hasOwnProperty("open")||a!==null,l=e.hasOwnProperty("onClose");if(!o&&!l)throw new Error("You have to provide an `open` and an `onClose` prop to the `Dialog` component.");if(!o)throw new Error("You provided an `onClose` prop to the `Dialog`, but forgot an `open` prop.");if(!l)throw new Error("You provided an `open` prop to the `Dialog`, but forgot an `onClose` prop.");if(!a&&typeof e.open!="boolean")throw new Error(`You provided an \`open\` prop to the \`Dialog\`, but the value is not a boolean. Received: ${e.open}`);if(typeof e.onClose!="function")throw new Error(`You provided an \`onClose\` prop to the \`Dialog\`, but the value is not a function. Received: ${e.onClose}`);return(r!==void 0||n)&&!s.static?Ae.createElement(sfe,null,Ae.createElement(l8e,{show:r,transition:n,unmount:s.unmount},Ae.createElement(ife,{ref:t,...s}))):Ae.createElement(sfe,null,Ae.createElement(ife,{ref:t,open:r,...s}))}let cJe="div";function uJe(e,t){let n=m.useId(),{id:r=`headlessui-dialog-panel-${n}`,transition:s=!1,...a}=e,[{dialogState:o,unmount:l},c]=ID("Dialog.Panel"),u=lc(t,c.panelRef),d=m.useMemo(()=>({open:o===0}),[o]),f=Us(C=>{C.stopPropagation()}),x={ref:u,id:r,onClick:f},g=s?Gre:m.Fragment,v=s?{unmount:l}:{},w=Co();return Ae.createElement(g,{...v},w({ourProps:x,theirProps:a,slot:d,defaultTag:cJe,name:"Dialog.Panel"}))}let dJe="div";function fJe(e,t){let{transition:n=!1,...r}=e,[{dialogState:s,unmount:a}]=ID("Dialog.Backdrop"),o=m.useMemo(()=>({open:s===0}),[s]),l={ref:t,"aria-hidden":!0},c=n?Gre:m.Fragment,u=n?{unmount:a}:{},d=Co();return Ae.createElement(c,{...u},d({ourProps:l,theirProps:r,slot:o,defaultTag:dJe,name:"Dialog.Backdrop"}))}let hJe="h2";function pJe(e,t){let n=m.useId(),{id:r=`headlessui-dialog-title-${n}`,...s}=e,[{dialogState:a,setTitleId:o}]=ID("Dialog.Title"),l=lc(t);m.useEffect(()=>(o(r),()=>o(null)),[r,o]);let c=m.useMemo(()=>({open:a===0}),[a]),u={ref:l,id:r};return Co()({ourProps:u,theirProps:s,slot:c,defaultTag:hJe,name:"Dialog.Title"})}let mJe=uo(lJe),xa=uo(uJe),ja=uo(fJe),xJe=uo(pJe),Ea=Object.assign(mJe,{Panel:xa,Title:xJe,Description:hAe});var afe;let gJe=(afe=Ae.startTransition)!=null?afe:function(e){e()};var bJe=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(bJe||{}),yJe=(e=>(e[e.ToggleDisclosure=0]="ToggleDisclosure",e[e.CloseDisclosure=1]="CloseDisclosure",e[e.SetButtonId=2]="SetButtonId",e[e.SetPanelId=3]="SetPanelId",e[e.SetButtonElement=4]="SetButtonElement",e[e.SetPanelElement=5]="SetPanelElement",e))(yJe||{});let vJe={0:e=>({...e,disclosureState:qf(e.disclosureState,{0:1,1:0})}),1:e=>e.disclosureState===1?e:{...e,disclosureState:1},2(e,t){return e.buttonId===t.buttonId?e:{...e,buttonId:t.buttonId}},3(e,t){return e.panelId===t.panelId?e:{...e,panelId:t.panelId}},4(e,t){return e.buttonElement===t.element?e:{...e,buttonElement:t.element}},5(e,t){return e.panelElement===t.element?e:{...e,panelElement:t.element}}},Yre=m.createContext(null);Yre.displayName="DisclosureContext";function Xre(e){let t=m.useContext(Yre);if(t===null){let n=new Error(`<${e} /> is missing a parent <Disclosure /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,Xre),n}return t}let Qre=m.createContext(null);Qre.displayName="DisclosureAPIContext";function c8e(e){let t=m.useContext(Qre);if(t===null){let n=new Error(`<${e} /> is missing a parent <Disclosure /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,c8e),n}return t}let Zre=m.createContext(null);Zre.displayName="DisclosurePanelContext";function wJe(){return m.useContext(Zre)}function CJe(e,t){return qf(t.type,vJe,e,t)}let SJe=m.Fragment;function NJe(e,t){let{defaultOpen:n=!1,...r}=e,s=m.useRef(null),a=lc(t,dAe(w=>{s.current=w},e.as===void 0||e.as===m.Fragment)),o=m.useReducer(CJe,{disclosureState:n?0:1,buttonElement:null,panelElement:null,buttonId:null,panelId:null}),[{disclosureState:l,buttonId:c},u]=o,d=Us(w=>{u({type:1});let C=t2(s);if(!C||!c)return;let N=w?w instanceof HTMLElement?w:w.current instanceof HTMLElement?w.current:C.getElementById(c):C.getElementById(c);N==null||N.focus()}),f=m.useMemo(()=>({close:d}),[d]),x=m.useMemo(()=>({open:l===0,close:d}),[l,d]),g={ref:a},v=Co();return Ae.createElement(Yre.Provider,{value:o},Ae.createElement(Qre.Provider,{value:f},Ae.createElement(mAe,{value:d},Ae.createElement(Wre,{value:qf(l,{0:tc.Open,1:tc.Closed})},v({ourProps:g,theirProps:r,slot:x,defaultTag:SJe,name:"Disclosure"})))))}let AJe="button";function jJe(e,t){let n=m.useId(),{id:r=`headlessui-disclosure-button-${n}`,disabled:s=!1,autoFocus:a=!1,...o}=e,[l,c]=Xre("Disclosure.Button"),u=wJe(),d=u===null?!1:u===l.panelId,f=m.useRef(null),x=lc(f,t,Us(Q=>{if(!d)return c({type:4,element:Q})}));m.useEffect(()=>{if(!d)return c({type:2,buttonId:r}),()=>{c({type:2,buttonId:null})}},[r,c,d]);let g=Us(Q=>{var ne;if(d){if(l.disclosureState===1)return;switch(Q.key){case xo.Space:case xo.Enter:Q.preventDefault(),Q.stopPropagation(),c({type:0}),(ne=l.buttonElement)==null||ne.focus();break}}else switch(Q.key){case xo.Space:case xo.Enter:Q.preventDefault(),Q.stopPropagation(),c({type:0});break}}),v=Us(Q=>{switch(Q.key){case xo.Space:Q.preventDefault();break}}),w=Us(Q=>{var ne;_re(Q.currentTarget)||s||(d?(c({type:0}),(ne=l.buttonElement)==null||ne.focus()):c({type:0}))}),{isFocusVisible:C,focusProps:N}=Are({autoFocus:a}),{isHovered:P,hoverProps:I}=Nre({isDisabled:s}),{pressed:R,pressProps:F}=jre({disabled:s}),U=m.useMemo(()=>({open:l.disclosureState===0,hover:P,active:R,disabled:s,focus:C,autofocus:a}),[l,P,R,C,s,a]),L=Ore(e,l.buttonElement),z=v9(d?{ref:x,type:L,disabled:s||void 0,autoFocus:a,onKeyDown:g,onClick:w}:{ref:x,id:r,type:L,"aria-expanded":l.disclosureState===0,"aria-controls":l.panelElement?l.panelId:void 0,disabled:s||void 0,autoFocus:a,onKeyDown:g,onKeyUp:v,onClick:w},N,I,F);return Co()({ourProps:z,theirProps:o,slot:U,defaultTag:AJe,name:"Disclosure.Button"})}let EJe="div",_Je=Py.RenderStrategy|Py.Static;function kJe(e,t){let n=m.useId(),{id:r=`headlessui-disclosure-panel-${n}`,transition:s=!1,...a}=e,[o,l]=Xre("Disclosure.Panel"),{close:c}=c8e("Disclosure.Panel"),[u,d]=m.useState(null),f=lc(t,Us(P=>{gJe(()=>l({type:5,element:P}))}),d);m.useEffect(()=>(l({type:3,panelId:r}),()=>{l({type:3,panelId:null})}),[r,l]);let x=aA(),[g,v]=Rre(s,u,x!==null?(x&tc.Open)===tc.Open:o.disclosureState===0),w=m.useMemo(()=>({open:o.disclosureState===0,close:c}),[o.disclosureState,c]),C={ref:f,id:r,...Mre(v)},N=Co();return Ae.createElement(qAe,null,Ae.createElement(Zre.Provider,{value:o.panelId},N({ourProps:C,theirProps:a,slot:w,defaultTag:EJe,features:_Je,visible:g,name:"Disclosure.Panel"})))}let TJe=uo(NJe),Jre=uo(jJe),ese=uo(kJe),u8e=Object.assign(TJe,{Button:Jre,Panel:ese});function IJe(e,t){let n=m.useRef({left:0,top:0});if(Qa(()=>{if(!t)return;let s=t.getBoundingClientRect();s&&(n.current=s)},[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 ofe=/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g;function lfe(e){var t,n;let r=(t=e.innerText)!=null?t:"",s=e.cloneNode(!0);if(!(s instanceof HTMLElement))return r;let a=!1;for(let l of s.querySelectorAll('[hidden],[aria-hidden],[role="img"]'))l.remove(),a=!0;let o=a?(n=s.innerText)!=null?n:"":r;return ofe.test(o)&&(o=o.replace(ofe,"")),o}function PJe(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(s=>{let a=document.getElementById(s);if(a){let o=a.getAttribute("aria-label");return typeof o=="string"?o.trim():lfe(a).trim()}return null}).filter(Boolean);if(r.length>0)return r.join(", ")}return lfe(e).trim()}function FJe(e){let t=m.useRef(""),n=m.useRef("");return Us(()=>{let r=e.current;if(!r)return"";let s=r.innerText;if(t.current===s)return n.current;let a=PJe(r).trim().toLowerCase();return t.current=s,n.current=a,a})}var OJe=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(OJe||{}),MJe=(e=>(e[e.Pointer=0]="Pointer",e[e.Other=1]="Other",e))(MJe||{}),RJe=(e=>(e[e.OpenMenu=0]="OpenMenu",e[e.CloseMenu=1]="CloseMenu",e[e.GoToItem=2]="GoToItem",e[e.Search=3]="Search",e[e.ClearSearch=4]="ClearSearch",e[e.RegisterItem=5]="RegisterItem",e[e.UnregisterItem=6]="UnregisterItem",e[e.SetButtonElement=7]="SetButtonElement",e[e.SetItemsElement=8]="SetItemsElement",e))(RJe||{});function Sz(e,t=n=>n){let n=e.activeItemIndex!==null?e.items[e.activeItemIndex]:null,r=CAe(t(e.items.slice()),a=>a.dataRef.current.domRef.current),s=n?r.indexOf(n):null;return s===-1&&(s=null),{items:r,activeItemIndex:s}}let LJe={1(e){return e.menuState===1?e:{...e,activeItemIndex:null,menuState:1}},0(e){return e.menuState===0?e:{...e,__demoMode:!1,menuState:0}},2:(e,t)=>{var n,r,s,a,o;if(e.menuState===1)return e;let l={...e,searchQuery:"",activationTrigger:(n=t.trigger)!=null?n:1,__demoMode:!1};if(t.focus===_u.Nothing)return{...l,activeItemIndex:null};if(t.focus===_u.Specific)return{...l,activeItemIndex:e.items.findIndex(d=>d.id===t.id)};if(t.focus===_u.Previous){let d=e.activeItemIndex;if(d!==null){let f=e.items[d].dataRef.current.domRef,x=Cz(t,{resolveItems:()=>e.items,resolveActiveIndex:()=>e.activeItemIndex,resolveId:g=>g.id,resolveDisabled:g=>g.dataRef.current.disabled});if(x!==null){let g=e.items[x].dataRef.current.domRef;if(((r=f.current)==null?void 0:r.previousElementSibling)===g.current||((s=g.current)==null?void 0:s.previousElementSibling)===null)return{...l,activeItemIndex:x}}}}else if(t.focus===_u.Next){let d=e.activeItemIndex;if(d!==null){let f=e.items[d].dataRef.current.domRef,x=Cz(t,{resolveItems:()=>e.items,resolveActiveIndex:()=>e.activeItemIndex,resolveId:g=>g.id,resolveDisabled:g=>g.dataRef.current.disabled});if(x!==null){let g=e.items[x].dataRef.current.domRef;if(((a=f.current)==null?void 0:a.nextElementSibling)===g.current||((o=g.current)==null?void 0:o.nextElementSibling)===null)return{...l,activeItemIndex:x}}}}let c=Sz(e),u=Cz(t,{resolveItems:()=>c.items,resolveActiveIndex:()=>c.activeItemIndex,resolveId:d=>d.id,resolveDisabled:d=>d.dataRef.current.disabled});return{...l,...c,activeItemIndex:u}},3:(e,t)=>{let n=e.searchQuery!==""?0:1,r=e.searchQuery+t.value.toLowerCase(),s=(e.activeItemIndex!==null?e.items.slice(e.activeItemIndex+n).concat(e.items.slice(0,e.activeItemIndex+n)):e.items).find(o=>{var l;return((l=o.dataRef.current.textValue)==null?void 0:l.startsWith(r))&&!o.dataRef.current.disabled}),a=s?e.items.indexOf(s):-1;return a===-1||a===e.activeItemIndex?{...e,searchQuery:r}:{...e,searchQuery:r,activeItemIndex:a,activationTrigger:1}},4(e){return e.searchQuery===""?e:{...e,searchQuery:"",searchActiveItemIndex:null}},5:(e,t)=>{let n=Sz(e,r=>[...r,{id:t.id,dataRef:t.dataRef}]);return{...e,...n}},6:(e,t)=>{let n=Sz(e,r=>{let s=r.findIndex(a=>a.id===t.id);return s!==-1&&r.splice(s,1),r});return{...e,...n,activationTrigger:1}},7:(e,t)=>e.buttonElement===t.element?e:{...e,buttonElement:t.element},8:(e,t)=>e.itemsElement===t.element?e:{...e,itemsElement:t.element}},tse=m.createContext(null);tse.displayName="MenuContext";function PD(e){let t=m.useContext(tse);if(t===null){let n=new Error(`<${e} /> is missing a parent <Menu /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,PD),n}return t}function DJe(e,t){return qf(t.type,LJe,e,t)}let BJe=m.Fragment;function $Je(e,t){let{__demoMode:n=!1,...r}=e,s=m.useReducer(DJe,{__demoMode:n,menuState:n?0:1,buttonElement:null,itemsElement:null,items:[],searchQuery:"",activeItemIndex:null,activationTrigger:1}),[{menuState:a,itemsElement:o,buttonElement:l},c]=s,u=lc(t);AAe(a===0,[l,o],(v,w)=>{c({type:1}),Fre(w,Pre.Loose)||(v.preventDefault(),l==null||l.focus())});let d=Us(()=>{c({type:1})}),f=m.useMemo(()=>({open:a===0,close:d}),[a,d]),x={ref:u},g=Co();return Ae.createElement(NZe,null,Ae.createElement(tse.Provider,{value:s},Ae.createElement(Wre,{value:qf(a,{0:tc.Open,1:tc.Closed})},g({ourProps:x,theirProps:r,slot:f,defaultTag:BJe,name:"Menu"}))))}let UJe="button";function zJe(e,t){var n;let r=m.useId(),{id:s=`headlessui-menu-button-${r}`,disabled:a=!1,autoFocus:o=!1,...l}=e,[c,u]=PD("Menu.Button"),d=wZe(),f=lc(t,vZe(),Us(L=>u({type:7,element:L}))),x=Us(L=>{switch(L.key){case xo.Space:case xo.Enter:case xo.ArrowDown:L.preventDefault(),L.stopPropagation(),Na.flushSync(()=>u({type:0})),u({type:2,focus:_u.First});break;case xo.ArrowUp:L.preventDefault(),L.stopPropagation(),Na.flushSync(()=>u({type:0})),u({type:2,focus:_u.Last});break}}),g=Us(L=>{switch(L.key){case xo.Space:L.preventDefault();break}}),v=Us(L=>{var z;if(_re(L.currentTarget))return L.preventDefault();a||(c.menuState===0?(Na.flushSync(()=>u({type:1})),(z=c.buttonElement)==null||z.focus({preventScroll:!0})):(L.preventDefault(),u({type:0})))}),{isFocusVisible:w,focusProps:C}=Are({autoFocus:o}),{isHovered:N,hoverProps:P}=Nre({isDisabled:a}),{pressed:I,pressProps:R}=jre({disabled:a}),F=m.useMemo(()=>({open:c.menuState===0,active:I||c.menuState===0,disabled:a,hover:N,focus:w,autofocus:o}),[c,N,w,I,a,o]),U=v9(d(),{ref:f,id:s,type:Ore(e,c.buttonElement),"aria-haspopup":"menu","aria-controls":(n=c.itemsElement)==null?void 0:n.id,"aria-expanded":c.menuState===0,disabled:a||void 0,autoFocus:o,onKeyDown:x,onKeyUp:g,onClick:v},C,P,R);return Co()({ourProps:U,theirProps:l,slot:F,defaultTag:UJe,name:"Menu.Button"})}let HJe="div",VJe=Py.RenderStrategy|Py.Static;function WJe(e,t){var n,r;let s=m.useId(),{id:a=`headlessui-menu-items-${s}`,anchor:o,portal:l=!1,modal:c=!0,transition:u=!1,...d}=e,f=yZe(o),[x,g]=PD("Menu.Items"),[v,w]=SZe(f),C=CZe(),[N,P]=m.useState(null),I=lc(t,f?v:null,Us(G=>g({type:8,element:G})),P),R=nA(x.itemsElement);f&&(l=!0);let F=aA(),[U,L]=Rre(u,N,F!==null?(F&tc.Open)===tc.Open:x.menuState===0);yAe(U,x.buttonElement,()=>{g({type:1})});let z=x.__demoMode?!1:c&&x.menuState===0;EAe(z,R);let Q=x.__demoMode?!1:c&&x.menuState===0;bAe(Q,{allowed:m.useCallback(()=>[x.buttonElement,x.itemsElement],[x.buttonElement,x.itemsElement])});let ne=x.menuState!==0,J=IJe(ne,x.buttonElement)?!1:U;m.useEffect(()=>{let G=x.itemsElement;G&&x.menuState===0&&G!==(R==null?void 0:R.activeElement)&&G.focus({preventScroll:!0})},[x.menuState,x.itemsElement,R]),pQe(x.menuState===0,{container:x.itemsElement,accept(G){return G.getAttribute("role")==="menuitem"?NodeFilter.FILTER_REJECT:G.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT},walk(G){G.setAttribute("role","none")}});let X=n2(),re=Us(G=>{var V,ee,ae;switch(X.dispose(),G.key){case xo.Space:if(x.searchQuery!=="")return G.preventDefault(),G.stopPropagation(),g({type:3,value:G.key});case xo.Enter:if(G.preventDefault(),G.stopPropagation(),g({type:1}),x.activeItemIndex!==null){let{dataRef:fe}=x.items[x.activeItemIndex];(ee=(V=fe.current)==null?void 0:V.domRef.current)==null||ee.click()}wAe(x.buttonElement);break;case xo.ArrowDown:return G.preventDefault(),G.stopPropagation(),g({type:2,focus:_u.Next});case xo.ArrowUp:return G.preventDefault(),G.stopPropagation(),g({type:2,focus:_u.Previous});case xo.Home:case xo.PageUp:return G.preventDefault(),G.stopPropagation(),g({type:2,focus:_u.First});case xo.End:case xo.PageDown:return G.preventDefault(),G.stopPropagation(),g({type:2,focus:_u.Last});case xo.Escape:G.preventDefault(),G.stopPropagation(),Na.flushSync(()=>g({type:1})),(ae=x.buttonElement)==null||ae.focus({preventScroll:!0});break;case xo.Tab:G.preventDefault(),G.stopPropagation(),Na.flushSync(()=>g({type:1})),JXe(x.buttonElement,G.shiftKey?tm.Previous:tm.Next);break;default:G.key.length===1&&(g({type:3,value:G.key}),X.setTimeout(()=>g({type:4}),350));break}}),pe=Us(G=>{switch(G.key){case xo.Space:G.preventDefault();break}}),Y=m.useMemo(()=>({open:x.menuState===0}),[x.menuState]),ie=v9(f?C():{},{"aria-activedescendant":x.activeItemIndex===null||(n=x.items[x.activeItemIndex])==null?void 0:n.id,"aria-labelledby":(r=x.buttonElement)==null?void 0:r.id,id:a,onKeyDown:re,onKeyUp:pe,role:"menu",tabIndex:x.menuState===0?0:void 0,ref:I,style:{...d.style,...w,"--button-width":VXe(x.buttonElement,!0).width},...Mre(L)}),oe=Co();return Ae.createElement(ZAe,{enabled:l?e.static||U:!1},oe({ourProps:ie,theirProps:d,slot:Y,defaultTag:HJe,features:VJe,visible:J,name:"Menu.Items"}))}let qJe=m.Fragment;function GJe(e,t){let n=m.useId(),{id:r=`headlessui-menu-item-${n}`,disabled:s=!1,...a}=e,[o,l]=PD("Menu.Item"),c=o.activeItemIndex!==null?o.items[o.activeItemIndex].id===r:!1,u=m.useRef(null),d=lc(t,u);Qa(()=>{if(!o.__demoMode&&o.menuState===0&&c&&o.activationTrigger!==0)return lx().requestAnimationFrame(()=>{var J,X;(X=(J=u.current)==null?void 0:J.scrollIntoView)==null||X.call(J,{block:"nearest"})})},[o.__demoMode,u,c,o.menuState,o.activationTrigger,o.activeItemIndex]);let f=FJe(u),x=m.useRef({disabled:s,domRef:u,get textValue(){return f()}});Qa(()=>{x.current.disabled=s},[x,s]),Qa(()=>(l({type:5,id:r,dataRef:x}),()=>l({type:6,id:r})),[x,r]);let g=Us(()=>{l({type:1})}),v=Us(J=>{if(s)return J.preventDefault();l({type:1}),wAe(o.buttonElement)}),w=Us(()=>{if(s)return l({type:2,focus:_u.Nothing});l({type:2,focus:_u.Specific,id:r})}),C=oQe(),N=Us(J=>{C.update(J),!s&&(c||l({type:2,focus:_u.Specific,id:r,trigger:0}))}),P=Us(J=>{C.wasMoved(J)&&(s||c||l({type:2,focus:_u.Specific,id:r,trigger:0}))}),I=Us(J=>{C.wasMoved(J)&&(s||c&&l({type:2,focus:_u.Nothing}))}),[R,F]=Ire(),[U,L]=kre(),z=m.useMemo(()=>({active:c,focus:c,disabled:s,close:g}),[c,s,g]),Q={id:r,ref:d,role:"menuitem",tabIndex:s===!0?void 0:-1,"aria-disabled":s===!0?!0:void 0,"aria-labelledby":R,"aria-describedby":U,disabled:void 0,onClick:v,onFocus:w,onPointerEnter:N,onMouseEnter:N,onPointerMove:P,onMouseMove:P,onPointerLeave:I,onMouseLeave:I},ne=Co();return Ae.createElement(F,null,Ae.createElement(L,null,ne({ourProps:Q,theirProps:a,slot:z,defaultTag:qJe,name:"Menu.Item"})))}let KJe="div";function YJe(e,t){let[n,r]=Ire(),s=e,a={ref:t,"aria-labelledby":n,role:"group"},o=Co();return Ae.createElement(r,null,o({ourProps:a,theirProps:s,slot:{},defaultTag:KJe,name:"Menu.Section"}))}let XJe="header";function QJe(e,t){let n=m.useId(),{id:r=`headlessui-menu-heading-${n}`,...s}=e,a=Tre();Qa(()=>a.register(r),[r,a.register]);let o={id:r,ref:t,role:"presentation",...a.props};return Co()({ourProps:o,theirProps:s,slot:{},defaultTag:XJe,name:"Menu.Heading"})}let ZJe="div";function JJe(e,t){let n=e,r={ref:t,role:"separator"};return Co()({ourProps:r,theirProps:n,slot:{},defaultTag:ZJe,name:"Menu.Separator"})}let eet=uo($Je),FD=uo(zJe),OD=uo(WJe),EC=uo(GJe),tet=uo(YJe),net=uo(QJe),ret=uo(JJe),MD=Object.assign(eet,{Button:FD,Items:OD,Item:EC,Section:tet,Heading:net,Separator:ret}),nse=m.createContext(null);nse.displayName="GroupContext";let set=m.Fragment;function iet(e){var t;let[n,r]=m.useState(null),[s,a]=Ire(),[o,l]=kre(),c=m.useMemo(()=>({switch:n,setSwitch:r}),[n,r]),u={},d=e,f=Co();return Ae.createElement(l,{name:"Switch.Description",value:o},Ae.createElement(a,{name:"Switch.Label",value:s,props:{htmlFor:(t=c.switch)==null?void 0:t.id,onClick(x){n&&(x.currentTarget instanceof HTMLLabelElement&&x.preventDefault(),n.click(),n.focus({preventScroll:!0}))}}},Ae.createElement(nse.Provider,{value:c},f({ourProps:u,theirProps:d,slot:{},defaultTag:set,name:"Switch.Group"}))))}let aet="button";function oet(e,t){var n;let r=m.useId(),s=cAe(),a=Ere(),{id:o=s||`headlessui-switch-${r}`,disabled:l=a||!1,checked:c,defaultChecked:u,onChange:d,name:f,value:x,form:g,autoFocus:v=!1,...w}=e,C=m.useContext(nse),[N,P]=m.useState(null),I=m.useRef(null),R=lc(I,t,C===null?null:C.setSwitch,P),F=NXe(u),[U,L]=SXe(c,d,F??!1),z=n2(),[Q,ne]=m.useState(!1),J=Us(()=>{ne(!0),L==null||L(!U),z.nextFrame(()=>{ne(!1)})}),X=Us(ve=>{if(_re(ve.currentTarget))return ve.preventDefault();ve.preventDefault(),J()}),re=Us(ve=>{ve.key===xo.Space?(ve.preventDefault(),J()):ve.key===xo.Enter&&AXe(ve.currentTarget)}),pe=Us(ve=>ve.preventDefault()),Y=pAe(),ie=OXe(),{isFocusVisible:oe,focusProps:G}=Are({autoFocus:v}),{isHovered:V,hoverProps:ee}=Nre({isDisabled:l}),{pressed:ae,pressProps:fe}=jre({disabled:l}),Ne=m.useMemo(()=>({checked:U,disabled:l,hover:V,focus:oe,active:ae,autofocus:v,changing:Q}),[U,V,oe,ae,l,Q,v]),he=v9({id:o,ref:R,role:"switch",type:Ore(e,N),tabIndex:e.tabIndex===-1?0:(n=e.tabIndex)!=null?n:0,"aria-checked":U,"aria-labelledby":Y,"aria-describedby":ie,disabled:l||void 0,autoFocus:v,onClick:X,onKeyUp:re,onKeyPress:pe},G,ee,fe),ge=m.useCallback(()=>{if(F!==void 0)return L==null?void 0:L(F)},[L,F]),ye=Co();return Ae.createElement(Ae.Fragment,null,f!=null&&Ae.createElement(TXe,{disabled:l,data:{[f]:x||"on"},overrides:{type:"checkbox",checked:U},form:g,onReset:ge}),ye({ourProps:he,theirProps:w,slot:Ne,defaultTag:aet,name:"Switch"}))}let cet=uo(oet),uet=iet,det=UXe,fet=hAe,Eo=Object.assign(cet,{Group:uet,Label:det,Description:fet});function het({title:e,titleId:t,...n},r){return m.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?m.createElement("title",{id:t},e):null,m.createElement("path",{fillRule:"evenodd",d:"M10 3a.75.75 0 0 1 .75.75v10.638l3.96-4.158a.75.75 0 1 1 1.08 1.04l-5.25 5.5a.75.75 0 0 1-1.08 0l-5.25-5.5a.75.75 0 1 1 1.08-1.04l3.96 4.158V3.75A.75.75 0 0 1 10 3Z",clipRule:"evenodd"}))}const Bl=m.forwardRef(het);function pet({title:e,titleId:t,...n},r){return m.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?m.createElement("title",{id:t},e):null,m.createElement("path",{fillRule:"evenodd",d:"M15.312 11.424a5.5 5.5 0 0 1-9.201 2.466l-.312-.311h2.433a.75.75 0 0 0 0-1.5H3.989a.75.75 0 0 0-.75.75v4.242a.75.75 0 0 0 1.5 0v-2.43l.31.31a7 7 0 0 0 11.712-3.138.75.75 0 0 0-1.449-.39Zm1.23-3.723a.75.75 0 0 0 .219-.53V2.929a.75.75 0 0 0-1.5 0V5.36l-.31-.31A7 7 0 0 0 3.239 8.188a.75.75 0 1 0 1.448.389A5.5 5.5 0 0 1 13.89 6.11l.311.31h-2.432a.75.75 0 0 0 0 1.5h4.243a.75.75 0 0 0 .53-.219Z",clipRule:"evenodd"}))}const jS=m.forwardRef(pet);function met({title:e,titleId:t,...n},r){return m.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?m.createElement("title",{id:t},e):null,m.createElement("path",{fillRule:"evenodd",d:"M4.25 5.5a.75.75 0 0 0-.75.75v8.5c0 .414.336.75.75.75h8.5a.75.75 0 0 0 .75-.75v-4a.75.75 0 0 1 1.5 0v4A2.25 2.25 0 0 1 12.75 17h-8.5A2.25 2.25 0 0 1 2 14.75v-8.5A2.25 2.25 0 0 1 4.25 4h5a.75.75 0 0 1 0 1.5h-5Z",clipRule:"evenodd"}),m.createElement("path",{fillRule:"evenodd",d:"M6.194 12.753a.75.75 0 0 0 1.06.053L16.5 4.44v2.81a.75.75 0 0 0 1.5 0v-4.5a.75.75 0 0 0-.75-.75h-4.5a.75.75 0 0 0 0 1.5h2.553l-9.056 8.194a.75.75 0 0 0-.053 1.06Z",clipRule:"evenodd"}))}const xet=m.forwardRef(met);function get({title:e,titleId:t,...n},r){return m.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?m.createElement("title",{id:t},e):null,m.createElement("path",{fillRule:"evenodd",d:"M10 17a.75.75 0 0 1-.75-.75V5.612L5.29 9.77a.75.75 0 0 1-1.08-1.04l5.25-5.5a.75.75 0 0 1 1.08 0l5.25 5.5a.75.75 0 1 1-1.08 1.04l-3.96-4.158V16.25A.75.75 0 0 1 10 17Z",clipRule:"evenodd"}))}const rse=m.forwardRef(get);function bet({title:e,titleId:t,...n},r){return m.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?m.createElement("title",{id:t},e):null,m.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 1 0 0-16 8 8 0 0 0 0 16Zm3.857-9.809a.75.75 0 0 0-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 1 0-1.06 1.061l2.5 2.5a.75.75 0 0 0 1.137-.089l4-5.5Z",clipRule:"evenodd"}))}const yet=m.forwardRef(bet);function vet({title:e,titleId:t,...n},r){return m.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?m.createElement("title",{id:t},e):null,m.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 d8e=m.forwardRef(vet);function wet({title:e,titleId:t,...n},r){return m.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?m.createElement("title",{id:t},e):null,m.createElement("path",{fillRule:"evenodd",d:"M5.22 8.22a.75.75 0 0 1 1.06 0L10 11.94l3.72-3.72a.75.75 0 1 1 1.06 1.06l-4.25 4.25a.75.75 0 0 1-1.06 0L5.22 9.28a.75.75 0 0 1 0-1.06Z",clipRule:"evenodd"}))}const A9=m.forwardRef(wet);function Cet({title:e,titleId:t,...n},r){return m.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?m.createElement("title",{id:t},e):null,m.createElement("path",{fillRule:"evenodd",d:"M9.47 6.47a.75.75 0 0 1 1.06 0l4.25 4.25a.75.75 0 1 1-1.06 1.06L10 8.06l-3.72 3.72a.75.75 0 0 1-1.06-1.06l4.25-4.25Z",clipRule:"evenodd"}))}const sse=m.forwardRef(Cet);function Net({title:e,titleId:t,...n},r){return m.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?m.createElement("title",{id:t},e):null,m.createElement("path",{fillRule:"evenodd",d:"M10 1c3.866 0 7 1.79 7 4s-3.134 4-7 4-7-1.79-7-4 3.134-4 7-4Zm5.694 8.13c.464-.264.91-.583 1.306-.952V10c0 2.21-3.134 4-7 4s-7-1.79-7-4V8.178c.396.37.842.688 1.306.953C5.838 10.006 7.854 10.5 10 10.5s4.162-.494 5.694-1.37ZM3 13.179V15c0 2.21 3.134 4 7 4s7-1.79 7-4v-1.822c-.396.37-.842.688-1.306.953-1.532.875-3.548 1.369-5.694 1.369s-4.162-.494-5.694-1.37A7.009 7.009 0 0 1 3 13.179Z",clipRule:"evenodd"}))}const s5=m.forwardRef(Net);function Aet({title:e,titleId:t,...n},r){return m.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?m.createElement("title",{id:t},e):null,m.createElement("path",{fillRule:"evenodd",d:"M3.28 2.22a.75.75 0 0 0-1.06 1.06l14.5 14.5a.75.75 0 1 0 1.06-1.06l-1.745-1.745a10.029 10.029 0 0 0 3.3-4.38 1.651 1.651 0 0 0 0-1.185A10.004 10.004 0 0 0 9.999 3a9.956 9.956 0 0 0-4.744 1.194L3.28 2.22ZM7.752 6.69l1.092 1.092a2.5 2.5 0 0 1 3.374 3.373l1.091 1.092a4 4 0 0 0-5.557-5.557Z",clipRule:"evenodd"}),m.createElement("path",{d:"m10.748 13.93 2.523 2.523a9.987 9.987 0 0 1-3.27.547c-4.258 0-7.894-2.66-9.337-6.41a1.651 1.651 0 0 1 0-1.186A10.007 10.007 0 0 1 2.839 6.02L6.07 9.252a4 4 0 0 0 4.678 4.678Z"}))}const jet=m.forwardRef(Aet);function Eet({title:e,titleId:t,...n},r){return m.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?m.createElement("title",{id:t},e):null,m.createElement("path",{d:"M10 12.5a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5Z"}),m.createElement("path",{fillRule:"evenodd",d:"M.664 10.59a1.651 1.651 0 0 1 0-1.186A10.004 10.004 0 0 1 10 3c4.257 0 7.893 2.66 9.336 6.41.147.381.146.804 0 1.186A10.004 10.004 0 0 1 10 17c-4.257 0-7.893-2.66-9.336-6.41ZM14 10a4 4 0 1 1-8 0 4 4 0 0 1 8 0Z",clipRule:"evenodd"}))}const _et=m.forwardRef(Eet);function ket({title:e,titleId:t,...n},r){return m.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?m.createElement("title",{id:t},e):null,m.createElement("path",{fillRule:"evenodd",d:"M4 10a.75.75 0 0 1 .75-.75h10.5a.75.75 0 0 1 0 1.5H4.75A.75.75 0 0 1 4 10Z",clipRule:"evenodd"}))}const f8e=m.forwardRef(ket);function Tet({title:e,titleId:t,...n},r){return m.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?m.createElement("title",{id:t},e):null,m.createElement("path",{d:"M13 4.5a2.5 2.5 0 1 1 .702 1.737L6.97 9.604a2.518 2.518 0 0 1 0 .792l6.733 3.367a2.5 2.5 0 1 1-.671 1.341l-6.733-3.367a2.5 2.5 0 1 1 0-3.475l6.733-3.366A2.52 2.52 0 0 1 13 4.5Z"}))}const Iet=m.forwardRef(Tet);function Pet({title:e,titleId:t,...n},r){return m.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?m.createElement("title",{id:t},e):null,m.createElement("path",{d:"M6.28 5.22a.75.75 0 0 0-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 1 0 1.06 1.06L10 11.06l3.72 3.72a.75.75 0 1 0 1.06-1.06L11.06 10l3.72-3.72a.75.75 0 0 0-1.06-1.06L10 8.94 6.28 5.22Z"}))}const h8e=m.forwardRef(Pet),p8e=m.createContext({});function Fet(e){const t=m.useRef(null);return t.current===null&&(t.current=e()),t.current}const ise=typeof window<"u",Oet=ise?m.useLayoutEffect:m.useEffect,ase=m.createContext(null);function yk(e,t){e.indexOf(t)===-1&&e.push(t)}function vk(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const Fc=(e,t,n)=>n>t?t:n<e?e:n;let ES=()=>{};const Oc={},RD=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function LD(e){return typeof e=="object"&&e!==null}const DD=e=>/^0[^.\s]+$/u.test(e);function oA(e){let t;return()=>(t===void 0&&(t=e()),t)}const al=e=>e,Met=(e,t)=>n=>t(e(n)),ux=(...e)=>e.reduce(Met),K0=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r};class lA{constructor(){this.subscriptions=[]}add(t){return yk(this.subscriptions,t),()=>vk(this.subscriptions,t)}notify(t,n,r){const s=this.subscriptions.length;if(s)if(s===1)this.subscriptions[0](t,n,r);else for(let a=0;a<s;a++){const o=this.subscriptions[a];o&&o(t,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const Hl=e=>e*1e3,rl=e=>e/1e3;function BD(e,t){return t?e*(1e3/t):0}const m8e=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,Ret=1e-7,Let=12;function Det(e,t,n,r,s){let a,o,l=0;do o=t+(n-t)/2,a=m8e(o,r,s)-e,a>0?n=o:t=o;while(Math.abs(a)>Ret&&++l<Let);return o}function wk(e,t,n,r){if(e===t&&n===r)return al;const s=a=>Det(a,0,1,e,n);return a=>a===0||a===1?a:m8e(s(a),t,r)}const x8e=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,g8e=e=>t=>1-e(1-t),b8e=wk(.33,1.53,.69,.99),ose=g8e(b8e),lse=x8e(ose),cse=e=>(e*=2)<1?.5*ose(e):.5*(2-Math.pow(2,-10*(e-1))),use=e=>1-Math.sin(Math.acos(e)),dse=g8e(use),fse=x8e(use),Bet=wk(.42,0,1,1),$et=wk(0,0,.58,1),hse=wk(.42,0,.58,1),y8e=e=>Array.isArray(e)&&typeof e[0]!="number",pse=e=>Array.isArray(e)&&typeof e[0]=="number",cfe={linear:al,easeIn:Bet,easeInOut:hse,easeOut:$et,circIn:use,circInOut:fse,circOut:dse,backIn:ose,backInOut:lse,backOut:b8e,anticipate:cse},Uet=e=>typeof e=="string",HO=e=>{if(pse(e)){ES(e.length===4);const[t,n,r,s]=e;return wk(t,n,r,s)}else if(Uet(e))return ES(cfe[e]!==void 0),cfe[e];return e},AI=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function zet(e,t){let n=new Set,r=new Set,s=!1,a=!1;const o=new WeakSet;let l={delta:0,timestamp:0,isProcessing:!1};function c(d){o.has(d)&&(u.schedule(d),e()),d(l)}const u={schedule:(d,f=!1,x=!1)=>{const v=x&&s?n:r;return f&&o.add(d),v.has(d)||v.add(d),d},cancel:d=>{r.delete(d),o.delete(d)},process:d=>{if(l=d,s){a=!0;return}s=!0,[n,r]=[r,n],n.forEach(c),n.clear(),s=!1,a&&(a=!1,u.process(d))}};return u}const Het=40;function v8e(e,t){let n=!1,r=!0;const s={delta:0,timestamp:0,isProcessing:!1},a=()=>n=!0,o=AI.reduce((I,R)=>(I[R]=zet(a),I),{}),{setup:l,read:c,resolveKeyframes:u,preUpdate:d,update:f,preRender:x,render:g,postRender:v}=o,w=()=>{const I=Oc.useManualTiming?s.timestamp:performance.now();n=!1,Oc.useManualTiming||(s.delta=r?1e3/60:Math.max(Math.min(I-s.timestamp,Het),1)),s.timestamp=I,s.isProcessing=!0,l.process(s),c.process(s),u.process(s),d.process(s),f.process(s),x.process(s),g.process(s),v.process(s),s.isProcessing=!1,n&&t&&(r=!1,e(w))},C=()=>{n=!0,r=!0,s.isProcessing||e(w)};return{schedule:AI.reduce((I,R)=>{const F=o[R];return I[R]=(U,L=!1,z=!1)=>(n||C(),F.schedule(U,L,z)),I},{}),cancel:I=>{for(let R=0;R<AI.length;R++)o[AI[R]].cancel(I)},state:s,steps:o}}const{schedule:Po,cancel:Ly,state:Gc,steps:Nz}=v8e(typeof requestAnimationFrame<"u"?requestAnimationFrame:al,!0);let _F;function Vet(){_F=void 0}const Yd={now:()=>(_F===void 0&&Yd.set(Gc.isProcessing||Oc.useManualTiming?Gc.timestamp:performance.now()),_F),set:e=>{_F=e,queueMicrotask(Vet)}},w8e=e=>t=>typeof t=="string"&&t.startsWith(e),mse=w8e("--"),Wet=w8e("var(--"),xse=e=>Wet(e)?qet.test(e.split("/*")[0].trim()):!1,qet=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,cA={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},j9={...cA,transform:e=>Fc(0,1,e)},jI={...cA,default:1},Dj=e=>Math.round(e*1e5)/1e5,gse=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function Get(e){return e==null}const Ket=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,bse=(e,t)=>n=>!!(typeof n=="string"&&Ket.test(n)&&n.startsWith(e)||t&&!Get(n)&&Object.prototype.hasOwnProperty.call(n,t)),C8e=(e,t,n)=>r=>{if(typeof r!="string")return r;const[s,a,o,l]=r.match(gse);return{[e]:parseFloat(s),[t]:parseFloat(a),[n]:parseFloat(o),alpha:l!==void 0?parseFloat(l):1}},Yet=e=>Fc(0,255,e),Az={...cA,transform:e=>Math.round(Yet(e))},Hv={test:bse("rgb","red"),parse:C8e("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+Az.transform(e)+", "+Az.transform(t)+", "+Az.transform(n)+", "+Dj(j9.transform(r))+")"};function Xet(e){let t="",n="",r="",s="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),s=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),s=e.substring(4,5),t+=t,n+=n,r+=r,s+=s),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:s?parseInt(s,16)/255:1}}const TQ={test:bse("#"),parse:Xet,transform:Hv.transform},Ck=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Sb=Ck("deg"),M0=Ck("%"),oi=Ck("px"),Qet=Ck("vh"),Zet=Ck("vw"),ufe={...M0,parse:e=>M0.parse(e)/100,transform:e=>M0.transform(e*100)},_C={test:bse("hsl","hue"),parse:C8e("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+M0.transform(Dj(t))+", "+M0.transform(Dj(n))+", "+Dj(j9.transform(r))+")"},Ll={test:e=>Hv.test(e)||TQ.test(e)||_C.test(e),parse:e=>Hv.test(e)?Hv.parse(e):_C.test(e)?_C.parse(e):TQ.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?Hv.transform(e):_C.transform(e),getAnimatableNone:e=>{const t=Ll.parse(e);return t.alpha=0,Ll.transform(t)}},Jet=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function ett(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(gse))==null?void 0:t.length)||0)+(((n=e.match(Jet))==null?void 0:n.length)||0)>0}const S8e="number",N8e="color",ttt="var",ntt="var(",dfe="${}",rtt=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function E9(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},s=[];let a=0;const l=t.replace(rtt,c=>(Ll.test(c)?(r.color.push(a),s.push(N8e),n.push(Ll.parse(c))):c.startsWith(ntt)?(r.var.push(a),s.push(ttt),n.push(c)):(r.number.push(a),s.push(S8e),n.push(parseFloat(c))),++a,dfe)).split(dfe);return{values:n,split:l,indexes:r,types:s}}function A8e(e){return E9(e).values}function j8e(e){const{split:t,types:n}=E9(e),r=t.length;return s=>{let a="";for(let o=0;o<r;o++)if(a+=t[o],s[o]!==void 0){const l=n[o];l===S8e?a+=Dj(s[o]):l===N8e?a+=Ll.transform(s[o]):a+=s[o]}return a}}const stt=e=>typeof e=="number"?0:Ll.test(e)?Ll.getAnimatableNone(e):e;function itt(e){const t=A8e(e);return j8e(e)(t.map(stt))}const Dy={test:ett,parse:A8e,createTransformer:j8e,getAnimatableNone:itt};function jz(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function att({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let s=0,a=0,o=0;if(!t)s=a=o=n;else{const l=n<.5?n*(1+t):n+t-n*t,c=2*n-l;s=jz(c,l,e+1/3),a=jz(c,l,e),o=jz(c,l,e-1/3)}return{red:Math.round(s*255),green:Math.round(a*255),blue:Math.round(o*255),alpha:r}}function VO(e,t){return n=>n>0?t:e}const Uo=(e,t,n)=>e+(t-e)*n,Ez=(e,t,n)=>{const r=e*e,s=n*(t*t-r)+r;return s<0?0:Math.sqrt(s)},ott=[TQ,Hv,_C],ltt=e=>ott.find(t=>t.test(e));function ffe(e){const t=ltt(e);if(!t)return!1;let n=t.parse(e);return t===_C&&(n=att(n)),n}const hfe=(e,t)=>{const n=ffe(e),r=ffe(t);if(!n||!r)return VO(e,t);const s={...n};return a=>(s.red=Ez(n.red,r.red,a),s.green=Ez(n.green,r.green,a),s.blue=Ez(n.blue,r.blue,a),s.alpha=Uo(n.alpha,r.alpha,a),Hv.transform(s))},IQ=new Set(["none","hidden"]);function ctt(e,t){return IQ.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function utt(e,t){return n=>Uo(e,t,n)}function yse(e){return typeof e=="number"?utt:typeof e=="string"?xse(e)?VO:Ll.test(e)?hfe:htt:Array.isArray(e)?E8e:typeof e=="object"?Ll.test(e)?hfe:dtt:VO}function E8e(e,t){const n=[...e],r=n.length,s=e.map((a,o)=>yse(a)(a,t[o]));return a=>{for(let o=0;o<r;o++)n[o]=s[o](a);return n}}function dtt(e,t){const n={...e,...t},r={};for(const s in n)e[s]!==void 0&&t[s]!==void 0&&(r[s]=yse(e[s])(e[s],t[s]));return s=>{for(const a in r)n[a]=r[a](s);return n}}function ftt(e,t){const n=[],r={color:0,var:0,number:0};for(let s=0;s<t.values.length;s++){const a=t.types[s],o=e.indexes[a][r[a]],l=e.values[o]??0;n[s]=l,r[a]++}return n}const htt=(e,t)=>{const n=Dy.createTransformer(t),r=E9(e),s=E9(t);return r.indexes.var.length===s.indexes.var.length&&r.indexes.color.length===s.indexes.color.length&&r.indexes.number.length>=s.indexes.number.length?IQ.has(e)&&!s.values.length||IQ.has(t)&&!r.values.length?ctt(e,t):ux(E8e(ftt(r,s),s.values),n):VO(e,t)};function _8e(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?Uo(e,t,n):yse(e)(e,t)}const ptt=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>Po.update(t,n),stop:()=>Ly(t),now:()=>Gc.isProcessing?Gc.timestamp:Yd.now()}},k8e=(e,t,n=10)=>{let r="";const s=Math.max(Math.round(t/n),2);for(let a=0;a<s;a++)r+=Math.round(e(a/(s-1))*1e4)/1e4+", ";return`linear(${r.substring(0,r.length-2)})`},WO=2e4;function vse(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<WO;)t+=n,r=e.next(t);return t>=WO?1/0:t}function mtt(e,t=100,n){const r=n({...e,keyframes:[0,t]}),s=Math.min(vse(r),WO);return{type:"keyframes",ease:a=>r.next(s*a).value/t,duration:rl(s)}}const xtt=5;function T8e(e,t,n){const r=Math.max(t-xtt,0);return BD(n-e(r),t-r)}const Jo={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},pfe=.001;function gtt({duration:e=Jo.duration,bounce:t=Jo.bounce,velocity:n=Jo.velocity,mass:r=Jo.mass}){let s,a,o=1-t;o=Fc(Jo.minDamping,Jo.maxDamping,o),e=Fc(Jo.minDuration,Jo.maxDuration,rl(e)),o<1?(s=u=>{const d=u*o,f=d*e,x=d-n,g=PQ(u,o),v=Math.exp(-f);return pfe-x/g*v},a=u=>{const f=u*o*e,x=f*n+n,g=Math.pow(o,2)*Math.pow(u,2)*e,v=Math.exp(-f),w=PQ(Math.pow(u,2),o);return(-s(u)+pfe>0?-1:1)*((x-g)*v)/w}):(s=u=>{const d=Math.exp(-u*e),f=(u-n)*e+1;return-.001+d*f},a=u=>{const d=Math.exp(-u*e),f=(n-u)*(e*e);return d*f});const l=5/e,c=ytt(s,a,l);if(e=Hl(e),isNaN(c))return{stiffness:Jo.stiffness,damping:Jo.damping,duration:e};{const u=Math.pow(c,2)*r;return{stiffness:u,damping:o*2*Math.sqrt(r*u),duration:e}}}const btt=12;function ytt(e,t,n){let r=n;for(let s=1;s<btt;s++)r=r-e(r)/t(r);return r}function PQ(e,t){return e*Math.sqrt(1-t*t)}const vtt=["duration","bounce"],wtt=["stiffness","damping","mass"];function mfe(e,t){return t.some(n=>e[n]!==void 0)}function Ctt(e){let t={velocity:Jo.velocity,stiffness:Jo.stiffness,damping:Jo.damping,mass:Jo.mass,isResolvedFromDuration:!1,...e};if(!mfe(e,wtt)&&mfe(e,vtt))if(e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),s=r*r,a=2*Fc(.05,1,1-(e.bounce||0))*Math.sqrt(s);t={...t,mass:Jo.mass,stiffness:s,damping:a}}else{const n=gtt(e);t={...t,...n,mass:Jo.mass},t.isResolvedFromDuration=!0}return t}function qO(e=Jo.visualDuration,t=Jo.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:s}=n;const a=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],l={done:!1,value:a},{stiffness:c,damping:u,mass:d,duration:f,velocity:x,isResolvedFromDuration:g}=Ctt({...n,velocity:-rl(n.velocity||0)}),v=x||0,w=u/(2*Math.sqrt(c*d)),C=o-a,N=rl(Math.sqrt(c/d)),P=Math.abs(C)<5;r||(r=P?Jo.restSpeed.granular:Jo.restSpeed.default),s||(s=P?Jo.restDelta.granular:Jo.restDelta.default);let I;if(w<1){const F=PQ(N,w);I=U=>{const L=Math.exp(-w*N*U);return o-L*((v+w*N*C)/F*Math.sin(F*U)+C*Math.cos(F*U))}}else if(w===1)I=F=>o-Math.exp(-N*F)*(C+(v+N*C)*F);else{const F=N*Math.sqrt(w*w-1);I=U=>{const L=Math.exp(-w*N*U),z=Math.min(F*U,300);return o-L*((v+w*N*C)*Math.sinh(z)+F*C*Math.cosh(z))/F}}const R={calculatedDuration:g&&f||null,next:F=>{const U=I(F);if(g)l.done=F>=f;else{let L=F===0?v:0;w<1&&(L=F===0?Hl(v):T8e(I,F,U));const z=Math.abs(L)<=r,Q=Math.abs(o-U)<=s;l.done=z&&Q}return l.value=l.done?o:U,l},toString:()=>{const F=Math.min(vse(R),WO),U=k8e(L=>R.next(F*L).value,F,30);return F+"ms "+U},toTransition:()=>{}};return R}qO.applyToOptions=e=>{const t=mtt(e,100,qO);return e.ease=t.ease,e.duration=Hl(t.duration),e.type="keyframes",e};function FQ({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:s=10,bounceStiffness:a=500,modifyTarget:o,min:l,max:c,restDelta:u=.5,restSpeed:d}){const f=e[0],x={done:!1,value:f},g=z=>l!==void 0&&z<l||c!==void 0&&z>c,v=z=>l===void 0?c:c===void 0||Math.abs(l-z)<Math.abs(c-z)?l:c;let w=n*t;const C=f+w,N=o===void 0?C:o(C);N!==C&&(w=N-f);const P=z=>-w*Math.exp(-z/r),I=z=>N+P(z),R=z=>{const Q=P(z),ne=I(z);x.done=Math.abs(Q)<=u,x.value=x.done?N:ne};let F,U;const L=z=>{g(x.value)&&(F=z,U=qO({keyframes:[x.value,v(x.value)],velocity:T8e(I,z,x.value),damping:s,stiffness:a,restDelta:u,restSpeed:d}))};return L(0),{calculatedDuration:null,next:z=>{let Q=!1;return!U&&F===void 0&&(Q=!0,R(z),L(z)),F!==void 0&&z>=F?U.next(z-F):(!Q&&R(z),x)}}}function Stt(e,t,n){const r=[],s=n||Oc.mix||_8e,a=e.length-1;for(let o=0;o<a;o++){let l=s(e[o],e[o+1]);if(t){const c=Array.isArray(t)?t[o]||al:t;l=ux(c,l)}r.push(l)}return r}function Ntt(e,t,{clamp:n=!0,ease:r,mixer:s}={}){const a=e.length;if(ES(a===t.length),a===1)return()=>t[0];if(a===2&&t[0]===t[1])return()=>t[1];const o=e[0]===e[1];e[0]>e[a-1]&&(e=[...e].reverse(),t=[...t].reverse());const l=Stt(t,r,s),c=l.length,u=d=>{if(o&&d<e[0])return t[0];let f=0;if(c>1)for(;f<e.length-2&&!(d<e[f+1]);f++);const x=K0(e[f],e[f+1],d);return l[f](x)};return n?d=>u(Fc(e[0],e[a-1],d)):u}function Att(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const s=K0(0,t,r);e.push(Uo(n,1,s))}}function jtt(e){const t=[0];return Att(t,e.length-1),t}function Ett(e,t){return e.map(n=>n*t)}function _tt(e,t){return e.map(()=>t||hse).splice(0,e.length-1)}function Bj({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const s=y8e(r)?r.map(HO):HO(r),a={done:!1,value:t[0]},o=Ett(n&&n.length===t.length?n:jtt(t),e),l=Ntt(o,t,{ease:Array.isArray(s)?s:_tt(t,s)});return{calculatedDuration:e,next:c=>(a.value=l(c),a.done=c>=e,a)}}const ktt=e=>e!==null;function wse(e,{repeat:t,repeatType:n="loop"},r,s=1){const a=e.filter(ktt),l=s<0||t&&n!=="loop"&&t%2===1?0:a.length-1;return!l||r===void 0?a[l]:r}const Ttt={decay:FQ,inertia:FQ,tween:Bj,keyframes:Bj,spring:qO};function I8e(e){typeof e.type=="string"&&(e.type=Ttt[e.type])}let Cse=class{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,n){return this.finished.then(t,n)}};const Itt=e=>e/100;let Sse=class extends Cse{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{var r,s;const{motionValue:n}=this.options;n&&n.updatedAt!==Yd.now()&&this.tick(Yd.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(s=(r=this.options).onStop)==null||s.call(r))},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){const{options:t}=this;I8e(t);const{type:n=Bj,repeat:r=0,repeatDelay:s=0,repeatType:a,velocity:o=0}=t;let{keyframes:l}=t;const c=n||Bj;c!==Bj&&typeof l[0]!="number"&&(this.mixKeyframes=ux(Itt,_8e(l[0],l[1])),l=[0,100]);const u=c({...t,keyframes:l});a==="mirror"&&(this.mirroredGenerator=c({...t,keyframes:[...l].reverse(),velocity:-o})),u.calculatedDuration===null&&(u.calculatedDuration=vse(u));const{calculatedDuration:d}=u;this.calculatedDuration=d,this.resolvedDuration=d+s,this.totalDuration=this.resolvedDuration*(r+1)-s,this.generator=u}updateTime(t){const n=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(t,n=!1){const{generator:r,totalDuration:s,mixKeyframes:a,mirroredGenerator:o,resolvedDuration:l,calculatedDuration:c}=this;if(this.startTime===null)return r.next(0);const{delay:u=0,keyframes:d,repeat:f,repeatType:x,repeatDelay:g,type:v,onUpdate:w,finalKeyframe:C}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-s/this.speed,this.startTime)),n?this.currentTime=t:this.updateTime(t);const N=this.currentTime-u*(this.playbackSpeed>=0?1:-1),P=this.playbackSpeed>=0?N<0:N>s;this.currentTime=Math.max(N,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=s);let I=this.currentTime,R=r;if(f){const z=Math.min(this.currentTime,s)/l;let Q=Math.floor(z),ne=z%1;!ne&&z>=1&&(ne=1),ne===1&&Q--,Q=Math.min(Q,f+1),!!(Q%2)&&(x==="reverse"?(ne=1-ne,g&&(ne-=g/l)):x==="mirror"&&(R=o)),I=Fc(0,1,ne)*l}const F=P?{done:!1,value:d[0]}:R.next(I);a&&(F.value=a(F.value));let{done:U}=F;!P&&c!==null&&(U=this.playbackSpeed>=0?this.currentTime>=s:this.currentTime<=0);const L=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&U);return L&&v!==FQ&&(F.value=wse(d,this.options,C,this.speed)),w&&w(F.value),L&&this.finish(),F}then(t,n){return this.finished.then(t,n)}get duration(){return rl(this.calculatedDuration)}get time(){return rl(this.currentTime)}set time(t){var n;t=Hl(t),this.currentTime=t,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),(n=this.driver)==null||n.start(!1)}get speed(){return this.playbackSpeed}set speed(t){this.updateTime(Yd.now());const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=rl(this.currentTime))}play(){var s,a;if(this.isStopped)return;const{driver:t=ptt,startTime:n}=this.options;this.driver||(this.driver=t(o=>this.tick(o))),(a=(s=this.options).onPlay)==null||a.call(s);const r=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=r):this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime||(this.startTime=n??r),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(Yd.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var t,n;this.notifyFinished(),this.teardown(),this.state="finished",(n=(t=this.options).onComplete)==null||n.call(t)}cancel(){var t,n;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(n=(t=this.options).onCancel)==null||n.call(t)}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){var n;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(n=this.driver)==null||n.stop(),t.observe(this)}};function Ptt(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const Vv=e=>e*180/Math.PI,OQ=e=>{const t=Vv(Math.atan2(e[1],e[0]));return MQ(t)},Ftt={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:OQ,rotateZ:OQ,skewX:e=>Vv(Math.atan(e[1])),skewY:e=>Vv(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},MQ=e=>(e=e%360,e<0&&(e+=360),e),xfe=OQ,gfe=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),bfe=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),Ott={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:gfe,scaleY:bfe,scale:e=>(gfe(e)+bfe(e))/2,rotateX:e=>MQ(Vv(Math.atan2(e[6],e[5]))),rotateY:e=>MQ(Vv(Math.atan2(-e[2],e[0]))),rotateZ:xfe,rotate:xfe,skewX:e=>Vv(Math.atan(e[4])),skewY:e=>Vv(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function RQ(e){return e.includes("scale")?1:0}function LQ(e,t){if(!e||e==="none")return RQ(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,s;if(n)r=Ott,s=n;else{const l=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=Ftt,s=l}if(!s)return RQ(t);const a=r[t],o=s[1].split(",").map(Rtt);return typeof a=="function"?a(o):o[a]}const Mtt=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return LQ(n,t)};function Rtt(e){return parseFloat(e.trim())}const uA=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],dA=new Set(uA),yfe=e=>e===cA||e===oi,Ltt=new Set(["x","y","z"]),Dtt=uA.filter(e=>!Ltt.has(e));function Btt(e){const t=[];return Dtt.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const Hw={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>LQ(t,"x"),y:(e,{transform:t})=>LQ(t,"y")};Hw.translateX=Hw.x;Hw.translateY=Hw.y;const Vw=new Set;let DQ=!1,BQ=!1,$Q=!1;function P8e(){if(BQ){const e=Array.from(Vw).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const s=Btt(r);s.length&&(n.set(r,s),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const s=n.get(r);s&&s.forEach(([a,o])=>{var l;(l=r.getValue(a))==null||l.set(o)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}BQ=!1,DQ=!1,Vw.forEach(e=>e.complete($Q)),Vw.clear()}function F8e(){Vw.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(BQ=!0)})}function $tt(){$Q=!0,F8e(),P8e(),$Q=!1}let Nse=class{constructor(t,n,r,s,a,o=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=s,this.element=a,this.isAsync=o}scheduleResolve(){this.state="scheduled",this.isAsync?(Vw.add(this),DQ||(DQ=!0,Po.read(F8e),Po.resolveKeyframes(P8e))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:s}=this;if(t[0]===null){const a=s==null?void 0:s.get(),o=t[t.length-1];if(a!==void 0)t[0]=a;else if(r&&n){const l=r.readValue(n,o);l!=null&&(t[0]=l)}t[0]===void 0&&(t[0]=o),s&&a===void 0&&s.set(t[0])}Ptt(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),Vw.delete(this)}cancel(){this.state==="scheduled"&&(Vw.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}};const Utt=e=>e.startsWith("--");function ztt(e,t,n){Utt(t)?e.style.setProperty(t,n):e.style[t]=n}const Htt=oA(()=>window.ScrollTimeline!==void 0),Vtt={};function Wtt(e,t){const n=oA(e);return()=>Vtt[t]??n()}const O8e=Wtt(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),lj=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,vfe={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:lj([0,.65,.55,1]),circOut:lj([.55,0,1,.45]),backIn:lj([.31,.01,.66,-.59]),backOut:lj([.33,1.53,.69,.99])};function M8e(e,t){if(e)return typeof e=="function"?O8e()?k8e(e,t):"ease-out":pse(e)?lj(e):Array.isArray(e)?e.map(n=>M8e(n,t)||vfe.easeOut):vfe[e]}function qtt(e,t,n,{delay:r=0,duration:s=300,repeat:a=0,repeatType:o="loop",ease:l="easeOut",times:c}={},u=void 0){const d={[t]:n};c&&(d.offset=c);const f=M8e(l,s);Array.isArray(f)&&(d.easing=f);const x={delay:r,duration:s,easing:Array.isArray(f)?"linear":f,fill:"both",iterations:a+1,direction:o==="reverse"?"alternate":"normal"};return u&&(x.pseudoElement=u),e.animate(d,x)}function R8e(e){return typeof e=="function"&&"applyToOptions"in e}function Gtt({type:e,...t}){return R8e(e)&&O8e()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}let Ktt=class extends Cse{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,!t)return;const{element:n,name:r,keyframes:s,pseudoElement:a,allowFlatten:o=!1,finalKeyframe:l,onComplete:c}=t;this.isPseudoElement=!!a,this.allowFlatten=o,this.options=t,ES(typeof t.type!="string");const u=Gtt(t);this.animation=qtt(n,r,s,u,a),u.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!a){const d=wse(s,this.options,l,this.speed);this.updateMotionValue?this.updateMotionValue(d):ztt(n,r,d),this.animation.cancel()}c==null||c(),this.notifyFinished()}}play(){this.isStopped||(this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){var t,n;(n=(t=this.animation).finish)==null||n.call(t)}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;t==="idle"||t==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var t,n;this.isPseudoElement||(n=(t=this.animation).commitStyles)==null||n.call(t)}get duration(){var n,r;const t=((r=(n=this.animation.effect)==null?void 0:n.getComputedTiming)==null?void 0:r.call(n).duration)||0;return rl(Number(t))}get time(){return rl(Number(this.animation.currentTime)||0)}set time(t){this.finishedTime=null,this.animation.currentTime=Hl(t)}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return Number(this.animation.startTime)}set startTime(t){this.animation.startTime=t}attachTimeline({timeline:t,observe:n}){var r;return this.allowFlatten&&((r=this.animation.effect)==null||r.updateTiming({easing:"linear"})),this.animation.onfinish=null,t&&Htt()?(this.animation.timeline=t,al):n(this)}};const L8e={anticipate:cse,backInOut:lse,circInOut:fse};function Ytt(e){return e in L8e}function Xtt(e){typeof e.ease=="string"&&Ytt(e.ease)&&(e.ease=L8e[e.ease])}const wfe=10;let Qtt=class extends Ktt{constructor(t){Xtt(t),I8e(t),super(t),t.startTime&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:n,onUpdate:r,onComplete:s,element:a,...o}=this.options;if(!n)return;if(t!==void 0){n.set(t);return}const l=new Sse({...o,autoplay:!1}),c=Hl(this.finishedTime??this.time);n.setWithVelocity(l.sample(c-wfe).value,l.sample(c).value,wfe),l.stop()}};const Cfe=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Dy.test(e)||e==="0")&&!e.startsWith("url("));function Ztt(e){const t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function Jtt(e,t,n,r){const s=e[0];if(s===null)return!1;if(t==="display"||t==="visibility")return!0;const a=e[e.length-1],o=Cfe(s,t),l=Cfe(a,t);return!o||!l?!1:Ztt(e)||(n==="spring"||R8e(n))&&r}function UQ(e){e.duration=0,e.type}const ent=new Set(["opacity","clipPath","filter","transform"]),tnt=oA(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function nnt(e){var d;const{motionValue:t,name:n,repeatDelay:r,repeatType:s,damping:a,type:o}=e;if(!(((d=t==null?void 0:t.owner)==null?void 0:d.current)instanceof HTMLElement))return!1;const{onUpdate:c,transformTemplate:u}=t.owner.getProps();return tnt()&&n&&ent.has(n)&&(n!=="transform"||!u)&&!c&&!r&&s!=="mirror"&&a!==0&&o!=="inertia"}const rnt=40;let snt=class extends Cse{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:s=0,repeatDelay:a=0,repeatType:o="loop",keyframes:l,name:c,motionValue:u,element:d,...f}){var v;super(),this.stop=()=>{var w,C;this._animation&&(this._animation.stop(),(w=this.stopTimeline)==null||w.call(this)),(C=this.keyframeResolver)==null||C.cancel()},this.createdAt=Yd.now();const x={autoplay:t,delay:n,type:r,repeat:s,repeatDelay:a,repeatType:o,name:c,motionValue:u,element:d,...f},g=(d==null?void 0:d.KeyframeResolver)||Nse;this.keyframeResolver=new g(l,(w,C,N)=>this.onKeyframesResolved(w,C,x,!N),c,u,d),(v=this.keyframeResolver)==null||v.scheduleResolve()}onKeyframesResolved(t,n,r,s){this.keyframeResolver=void 0;const{name:a,type:o,velocity:l,delay:c,isHandoff:u,onUpdate:d}=r;this.resolvedAt=Yd.now(),Jtt(t,a,o,l)||((Oc.instantAnimations||!c)&&(d==null||d(wse(t,r,n))),t[0]=t[t.length-1],UQ(r),r.repeat=0);const x={startTime:s?this.resolvedAt?this.resolvedAt-this.createdAt>rnt?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:t},g=!u&&nnt(x)?new Qtt({...x,element:x.motionValue.owner.current}):new Sse(x);g.finished.then(()=>this.notifyFinished()).catch(al),this.pendingTimeline&&(this.stopTimeline=g.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=g}get finished(){return this._animation?this.animation.finished:this._finished}then(t,n){return this.finished.finally(t).then(()=>{})}get animation(){var t;return this._animation||((t=this.keyframeResolver)==null||t.resume(),$tt()),this._animation}get duration(){return this.animation.duration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){var t;this._animation&&this.animation.cancel(),(t=this.keyframeResolver)==null||t.cancel()}};const int=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function ant(e){const t=int.exec(e);if(!t)return[,];const[,n,r,s]=t;return[`--${n??r}`,s]}function D8e(e,t,n=1){const[r,s]=ant(e);if(!r)return;const a=window.getComputedStyle(t).getPropertyValue(r);if(a){const o=a.trim();return RD(o)?parseFloat(o):o}return xse(s)?D8e(s,t,n+1):s}function Ase(e,t){return(e==null?void 0:e[t])??(e==null?void 0:e.default)??e}const B8e=new Set(["width","height","top","left","right","bottom",...uA]),ont={test:e=>e==="auto",parse:e=>e},$8e=e=>t=>t.test(e),U8e=[cA,oi,M0,Sb,Zet,Qet,ont],Sfe=e=>U8e.find($8e(e));function lnt(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||DD(e):!0}const cnt=new Set(["brightness","contrast","saturate","opacity"]);function unt(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(gse)||[];if(!r)return e;const s=n.replace(r,"");let a=cnt.has(t)?1:0;return r!==n&&(a*=100),t+"("+a+s+")"}const dnt=/\b([a-z-]*)\(.*?\)/gu,zQ={...Dy,getAnimatableNone:e=>{const t=e.match(dnt);return t?t.map(unt).join(" "):e}},Nfe={...cA,transform:Math.round},fnt={rotate:Sb,rotateX:Sb,rotateY:Sb,rotateZ:Sb,scale:jI,scaleX:jI,scaleY:jI,scaleZ:jI,skew:Sb,skewX:Sb,skewY:Sb,distance:oi,translateX:oi,translateY:oi,translateZ:oi,x:oi,y:oi,z:oi,perspective:oi,transformPerspective:oi,opacity:j9,originX:ufe,originY:ufe,originZ:oi},jse={borderWidth:oi,borderTopWidth:oi,borderRightWidth:oi,borderBottomWidth:oi,borderLeftWidth:oi,borderRadius:oi,radius:oi,borderTopLeftRadius:oi,borderTopRightRadius:oi,borderBottomRightRadius:oi,borderBottomLeftRadius:oi,width:oi,maxWidth:oi,height:oi,maxHeight:oi,top:oi,right:oi,bottom:oi,left:oi,padding:oi,paddingTop:oi,paddingRight:oi,paddingBottom:oi,paddingLeft:oi,margin:oi,marginTop:oi,marginRight:oi,marginBottom:oi,marginLeft:oi,backgroundPositionX:oi,backgroundPositionY:oi,...fnt,zIndex:Nfe,fillOpacity:j9,strokeOpacity:j9,numOctaves:Nfe},hnt={...jse,color:Ll,backgroundColor:Ll,outlineColor:Ll,fill:Ll,stroke:Ll,borderColor:Ll,borderTopColor:Ll,borderRightColor:Ll,borderBottomColor:Ll,borderLeftColor:Ll,filter:zQ,WebkitFilter:zQ},z8e=e=>hnt[e];function H8e(e,t){let n=z8e(e);return n!==zQ&&(n=Dy),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const pnt=new Set(["auto","none","0"]);function mnt(e,t,n){let r=0,s;for(;r<e.length&&!s;){const a=e[r];typeof a=="string"&&!pnt.has(a)&&E9(a).values.length&&(s=e[r]),r++}if(s&&n)for(const a of t)e[a]=H8e(n,s)}let xnt=class extends Nse{constructor(t,n,r,s,a){super(t,n,r,s,a,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let c=0;c<t.length;c++){let u=t[c];if(typeof u=="string"&&(u=u.trim(),xse(u))){const d=D8e(u,n.current);d!==void 0&&(t[c]=d),c===t.length-1&&(this.finalKeyframe=u)}}if(this.resolveNoneKeyframes(),!B8e.has(r)||t.length!==2)return;const[s,a]=t,o=Sfe(s),l=Sfe(a);if(o!==l)if(yfe(o)&&yfe(l))for(let c=0;c<t.length;c++){const u=t[c];typeof u=="string"&&(t[c]=parseFloat(u))}else Hw[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,r=[];for(let s=0;s<t.length;s++)(t[s]===null||lnt(t[s]))&&r.push(s);r.length&&mnt(t,r,n)}measureInitialState(){const{element:t,unresolvedKeyframes:n,name:r}=this;if(!t||!t.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Hw[r](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const s=n[n.length-1];s!==void 0&&t.getValue(r,s).jump(s,!1)}measureEndState(){var l;const{element:t,name:n,unresolvedKeyframes:r}=this;if(!t||!t.current)return;const s=t.getValue(n);s&&s.jump(this.measuredOrigin,!1);const a=r.length-1,o=r[a];r[a]=Hw[n](t.measureViewportBox(),window.getComputedStyle(t.current)),o!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=o),(l=this.removedTransforms)!=null&&l.length&&this.removedTransforms.forEach(([c,u])=>{t.getValue(c).set(u)}),this.resolveNoneKeyframes()}};function gnt(e,t,n){if(e instanceof EventTarget)return[e];if(typeof e=="string"){const s=document.querySelectorAll(e);return s?Array.from(s):[]}return Array.from(e)}const V8e=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function bnt(e){return LD(e)&&"offsetHeight"in e}const Afe=30,ynt=e=>!isNaN(parseFloat(e));let vnt=class{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{var a;const s=Yd.now();if(this.updatedAt!==s&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&((a=this.events.change)==null||a.notify(this.current),this.dependents))for(const o of this.dependents)o.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=Yd.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=ynt(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new lA);const r=this.events[t].add(n);return t==="change"?()=>{r(),Po.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-r}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){var t;(t=this.events.change)==null||t.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=Yd.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>Afe)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,Afe);return BD(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){var t,n;(t=this.dependents)==null||t.clear(),(n=this.events.destroy)==null||n.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}};function _S(e,t){return new vnt(e,t)}const{schedule:Ese,cancel:x2n}=v8e(queueMicrotask,!1),Op={x:!1,y:!1};function W8e(){return Op.x||Op.y}function wnt(e){return e==="x"||e==="y"?Op[e]?null:(Op[e]=!0,()=>{Op[e]=!1}):Op.x||Op.y?null:(Op.x=Op.y=!0,()=>{Op.x=Op.y=!1})}function q8e(e,t){const n=gnt(e),r=new AbortController,s={passive:!0,...t,signal:r.signal};return[n,s,()=>r.abort()]}function jfe(e){return!(e.pointerType==="touch"||W8e())}function Cnt(e,t,n={}){const[r,s,a]=q8e(e,n),o=l=>{if(!jfe(l))return;const{target:c}=l,u=t(c,l);if(typeof u!="function"||!c)return;const d=f=>{jfe(f)&&(u(f),c.removeEventListener("pointerleave",d))};c.addEventListener("pointerleave",d,s)};return r.forEach(l=>{l.addEventListener("pointerenter",o,s)}),a}const G8e=(e,t)=>t?e===t?!0:G8e(e,t.parentElement):!1,_se=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,Snt=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function Nnt(e){return Snt.has(e.tagName)||e.tabIndex!==-1}const kF=new WeakSet;function Efe(e){return t=>{t.key==="Enter"&&e(t)}}function _z(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const Ant=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=Efe(()=>{if(kF.has(n))return;_z(n,"down");const s=Efe(()=>{_z(n,"up")}),a=()=>_z(n,"cancel");n.addEventListener("keyup",s,t),n.addEventListener("blur",a,t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)};function _fe(e){return _se(e)&&!W8e()}function jnt(e,t,n={}){const[r,s,a]=q8e(e,n),o=l=>{const c=l.currentTarget;if(!_fe(l))return;kF.add(c);const u=t(c,l),d=(g,v)=>{window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",x),kF.has(c)&&kF.delete(c),_fe(g)&&typeof u=="function"&&u(g,{success:v})},f=g=>{d(g,c===window||c===document||n.useGlobalTarget||G8e(c,g.target))},x=g=>{d(g,!1)};window.addEventListener("pointerup",f,s),window.addEventListener("pointercancel",x,s)};return r.forEach(l=>{(n.useGlobalTarget?window:l).addEventListener("pointerdown",o,s),bnt(l)&&(l.addEventListener("focus",u=>Ant(u,s)),!Nnt(l)&&!l.hasAttribute("tabindex")&&(l.tabIndex=0))}),a}function K8e(e){return LD(e)&&"ownerSVGElement"in e}function Ent(e){return K8e(e)&&e.tagName==="svg"}const Iu=e=>!!(e&&e.getVelocity),_nt=[...U8e,Ll,Dy],knt=e=>_nt.find($8e(e)),Y8e=m.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function Tnt(e=!0){const t=m.useContext(ase);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:s}=t,a=m.useId();m.useEffect(()=>{if(e)return s(a)},[e]);const o=m.useCallback(()=>e&&r&&r(a),[a,r,e]);return!n&&r?[!1,o]:[!0]}const X8e=m.createContext({strict:!1}),kfe={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},kS={};for(const e in kfe)kS[e]={isEnabled:t=>kfe[e].some(n=>!!t[n])};function Int(e){for(const t in e)kS[t]={...kS[t],...e[t]}}const Pnt=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function GO(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||Pnt.has(e)}let Q8e=e=>!GO(e);function Fnt(e){typeof e=="function"&&(Q8e=t=>t.startsWith("on")?!GO(t):e(t))}try{Fnt(require("@emotion/is-prop-valid").default)}catch{}function Ont(e,t,n){const r={};for(const s in e)s==="values"&&typeof e.values=="object"||(Q8e(s)||n===!0&&GO(s)||!t&&!GO(s)||e.draggable&&s.startsWith("onDrag"))&&(r[s]=e[s]);return r}const $D=m.createContext({});function UD(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function _9(e){return typeof e=="string"||Array.isArray(e)}const kse=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Tse=["initial",...kse];function zD(e){return UD(e.animate)||Tse.some(t=>_9(e[t]))}function Z8e(e){return!!(zD(e)||e.variants)}function Mnt(e,t){if(zD(e)){const{initial:n,animate:r}=e;return{initial:n===!1||_9(n)?n:void 0,animate:_9(r)?r:void 0}}return e.inherit!==!1?t:{}}function Rnt(e){const{initial:t,animate:n}=Mnt(e,m.useContext($D));return m.useMemo(()=>({initial:t,animate:n}),[Tfe(t),Tfe(n)])}function Tfe(e){return Array.isArray(e)?e.join(" "):e}const k9={};function Lnt(e){for(const t in e)k9[t]=e[t],mse(t)&&(k9[t].isCSSVariable=!0)}function J8e(e,{layout:t,layoutId:n}){return dA.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!k9[e]||e==="opacity")}const Dnt={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Bnt=uA.length;function $nt(e,t,n){let r="",s=!0;for(let a=0;a<Bnt;a++){const o=uA[a],l=e[o];if(l===void 0)continue;let c=!0;if(typeof l=="number"?c=l===(o.startsWith("scale")?1:0):c=parseFloat(l)===0,!c||n){const u=V8e(l,jse[o]);if(!c){s=!1;const d=Dnt[o]||o;r+=`${d}(${u}) `}n&&(t[o]=u)}}return r=r.trim(),n?r=n(t,s?"":r):s&&(r="none"),r}function Ise(e,t,n){const{style:r,vars:s,transformOrigin:a}=e;let o=!1,l=!1;for(const c in t){const u=t[c];if(dA.has(c)){o=!0;continue}else if(mse(c)){s[c]=u;continue}else{const d=V8e(u,jse[c]);c.startsWith("origin")?(l=!0,a[c]=d):r[c]=d}}if(t.transform||(o||n?r.transform=$nt(t,e.transform,n):r.transform&&(r.transform="none")),l){const{originX:c="50%",originY:u="50%",originZ:d=0}=a;r.transformOrigin=`${c} ${u} ${d}`}}const Pse=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function e7e(e,t,n){for(const r in t)!Iu(t[r])&&!J8e(r,n)&&(e[r]=t[r])}function Unt({transformTemplate:e},t){return m.useMemo(()=>{const n=Pse();return Ise(n,t,e),Object.assign({},n.vars,n.style)},[t])}function znt(e,t){const n=e.style||{},r={};return e7e(r,n,e),Object.assign(r,Unt(e,t)),r}function Hnt(e,t){const n={},r=znt(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}const Vnt={offset:"stroke-dashoffset",array:"stroke-dasharray"},Wnt={offset:"strokeDashoffset",array:"strokeDasharray"};function qnt(e,t,n=1,r=0,s=!0){e.pathLength=1;const a=s?Vnt:Wnt;e[a.offset]=oi.transform(-r);const o=oi.transform(t),l=oi.transform(n);e[a.array]=`${o} ${l}`}function t7e(e,{attrX:t,attrY:n,attrScale:r,pathLength:s,pathSpacing:a=1,pathOffset:o=0,...l},c,u,d){if(Ise(e,l,u),c){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:f,style:x}=e;f.transform&&(x.transform=f.transform,delete f.transform),(x.transform||f.transformOrigin)&&(x.transformOrigin=f.transformOrigin??"50% 50%",delete f.transformOrigin),x.transform&&(x.transformBox=(d==null?void 0:d.transformBox)??"fill-box",delete f.transformBox),t!==void 0&&(f.x=t),n!==void 0&&(f.y=n),r!==void 0&&(f.scale=r),s!==void 0&&qnt(f,s,a,o,!1)}const n7e=()=>({...Pse(),attrs:{}}),r7e=e=>typeof e=="string"&&e.toLowerCase()==="svg";function Gnt(e,t,n,r){const s=m.useMemo(()=>{const a=n7e();return t7e(a,t,r7e(r),e.transformTemplate,e.style),{...a.attrs,style:{...a.style}}},[t]);if(e.style){const a={};e7e(a,e.style,e),s.style={...a,...s.style}}return s}const Knt=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function Fse(e){return typeof e!="string"||e.includes("-")?!1:!!(Knt.indexOf(e)>-1||/[A-Z]/u.test(e))}function Ynt(e,t,n,{latestValues:r},s,a=!1){const l=(Fse(e)?Gnt:Hnt)(t,r,s,e),c=Ont(t,typeof e=="string",a),u=e!==m.Fragment?{...c,...l,ref:n}:{},{children:d}=t,f=m.useMemo(()=>Iu(d)?d.get():d,[d]);return m.createElement(e,{...u,children:f})}function Ife(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function Ose(e,t,n,r){if(typeof t=="function"){const[s,a]=Ife(r);t=t(n!==void 0?n:e.custom,s,a)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[s,a]=Ife(r);t=t(n!==void 0?n:e.custom,s,a)}return t}function TF(e){return Iu(e)?e.get():e}function Xnt({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,s){return{latestValues:Qnt(n,r,s,e),renderState:t()}}function Qnt(e,t,n,r){const s={},a=r(e,{});for(const x in a)s[x]=TF(a[x]);let{initial:o,animate:l}=e;const c=zD(e),u=Z8e(e);t&&u&&!c&&e.inherit!==!1&&(o===void 0&&(o=t.initial),l===void 0&&(l=t.animate));let d=n?n.initial===!1:!1;d=d||o===!1;const f=d?l:o;if(f&&typeof f!="boolean"&&!UD(f)){const x=Array.isArray(f)?f:[f];for(let g=0;g<x.length;g++){const v=Ose(e,x[g]);if(v){const{transitionEnd:w,transition:C,...N}=v;for(const P in N){let I=N[P];if(Array.isArray(I)){const R=d?I.length-1:0;I=I[R]}I!==null&&(s[P]=I)}for(const P in w)s[P]=w[P]}}}return s}const s7e=e=>(t,n)=>{const r=m.useContext($D),s=m.useContext(ase),a=()=>Xnt(e,t,r,s);return n?a():Fet(a)};function Mse(e,t,n){var a;const{style:r}=e,s={};for(const o in r)(Iu(r[o])||t.style&&Iu(t.style[o])||J8e(o,e)||((a=n==null?void 0:n.getValue(o))==null?void 0:a.liveStyle)!==void 0)&&(s[o]=r[o]);return s}const Znt=s7e({scrapeMotionValuesFromProps:Mse,createRenderState:Pse});function i7e(e,t,n){const r=Mse(e,t,n);for(const s in e)if(Iu(e[s])||Iu(t[s])){const a=uA.indexOf(s)!==-1?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s;r[a]=e[s]}return r}const Jnt=s7e({scrapeMotionValuesFromProps:i7e,createRenderState:n7e}),ert=Symbol.for("motionComponentSymbol");function kC(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function trt(e,t,n){return m.useCallback(r=>{r&&e.onMount&&e.onMount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):kC(n)&&(n.current=r))},[t])}const Rse=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),nrt="framerAppearId",a7e="data-"+Rse(nrt),o7e=m.createContext({});function rrt(e,t,n,r,s){var w,C;const{visualElement:a}=m.useContext($D),o=m.useContext(X8e),l=m.useContext(ase),c=m.useContext(Y8e).reducedMotion,u=m.useRef(null);r=r||o.renderer,!u.current&&r&&(u.current=r(e,{visualState:t,parent:a,props:n,presenceContext:l,blockInitialAnimation:l?l.initial===!1:!1,reducedMotionConfig:c}));const d=u.current,f=m.useContext(o7e);d&&!d.projection&&s&&(d.type==="html"||d.type==="svg")&&srt(u.current,n,s,f);const x=m.useRef(!1);m.useInsertionEffect(()=>{d&&x.current&&d.update(n,l)});const g=n[a7e],v=m.useRef(!!g&&!((w=window.MotionHandoffIsComplete)!=null&&w.call(window,g))&&((C=window.MotionHasOptimisedAnimation)==null?void 0:C.call(window,g)));return Oet(()=>{d&&(x.current=!0,window.MotionIsMounted=!0,d.updateFeatures(),d.scheduleRenderMicrotask(),v.current&&d.animationState&&d.animationState.animateChanges())}),m.useEffect(()=>{d&&(!v.current&&d.animationState&&d.animationState.animateChanges(),v.current&&(queueMicrotask(()=>{var N;(N=window.MotionHandoffMarkAsComplete)==null||N.call(window,g)}),v.current=!1),d.enteringChildren=void 0)}),d}function srt(e,t,n,r){const{layoutId:s,layout:a,drag:o,dragConstraints:l,layoutScroll:c,layoutRoot:u,layoutCrossfade:d}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:l7e(e.parent)),e.projection.setOptions({layoutId:s,layout:a,alwaysMeasureLayout:!!o||l&&kC(l),visualElement:e,animationType:typeof a=="string"?a:"both",initialPromotionConfig:r,crossfade:d,layoutScroll:c,layoutRoot:u})}function l7e(e){if(e)return e.options.allowProjection!==!1?e.projection:l7e(e.parent)}function kz(e,{forwardMotionProps:t=!1}={},n,r){n&&Int(n);const s=Fse(e)?Jnt:Znt;function a(l,c){let u;const d={...m.useContext(Y8e),...l,layoutId:irt(l)},{isStatic:f}=d,x=Rnt(l),g=s(l,f);if(!f&&ise){art();const v=ort(d);u=v.MeasureLayout,x.visualElement=rrt(e,g,d,r,v.ProjectionNode)}return i.jsxs($D.Provider,{value:x,children:[u&&x.visualElement?i.jsx(u,{visualElement:x.visualElement,...d}):null,Ynt(e,l,trt(g,x.visualElement,c),g,f,t)]})}a.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const o=m.forwardRef(a);return o[ert]=e,o}function irt({layoutId:e}){const t=m.useContext(p8e).id;return t&&e!==void 0?t+"-"+e:e}function art(e,t){m.useContext(X8e).strict}function ort(e){const{drag:t,layout:n}=kS;if(!t&&!n)return{};const r={...t,...n};return{MeasureLayout:t!=null&&t.isEnabled(e)||n!=null&&n.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}function lrt(e,t){if(typeof Proxy>"u")return kz;const n=new Map,r=(a,o)=>kz(a,o,e,t),s=(a,o)=>r(a,o);return new Proxy(s,{get:(a,o)=>o==="create"?r:(n.has(o)||n.set(o,kz(o,void 0,e,t)),n.get(o))})}function c7e({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function crt({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function urt(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function Tz(e){return e===void 0||e===1}function HQ({scale:e,scaleX:t,scaleY:n}){return!Tz(e)||!Tz(t)||!Tz(n)}function Cv(e){return HQ(e)||u7e(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function u7e(e){return Pfe(e.x)||Pfe(e.y)}function Pfe(e){return e&&e!=="0%"}function KO(e,t,n){const r=e-n,s=t*r;return n+s}function Ffe(e,t,n,r,s){return s!==void 0&&(e=KO(e,s,r)),KO(e,n,r)+t}function VQ(e,t=0,n=1,r,s){e.min=Ffe(e.min,t,n,r,s),e.max=Ffe(e.max,t,n,r,s)}function d7e(e,{x:t,y:n}){VQ(e.x,t.translate,t.scale,t.originPoint),VQ(e.y,n.translate,n.scale,n.originPoint)}const Ofe=.999999999999,Mfe=1.0000000000001;function drt(e,t,n,r=!1){const s=n.length;if(!s)return;t.x=t.y=1;let a,o;for(let l=0;l<s;l++){a=n[l],o=a.projectionDelta;const{visualElement:c}=a.options;c&&c.props.style&&c.props.style.display==="contents"||(r&&a.options.layoutScroll&&a.scroll&&a!==a.root&&IC(e,{x:-a.scroll.offset.x,y:-a.scroll.offset.y}),o&&(t.x*=o.x.scale,t.y*=o.y.scale,d7e(e,o)),r&&Cv(a.latestValues)&&IC(e,a.latestValues))}t.x<Mfe&&t.x>Ofe&&(t.x=1),t.y<Mfe&&t.y>Ofe&&(t.y=1)}function TC(e,t){e.min=e.min+t,e.max=e.max+t}function Rfe(e,t,n,r,s=.5){const a=Uo(e.min,e.max,s);VQ(e,t,n,a,r)}function IC(e,t){Rfe(e.x,t.x,t.scaleX,t.scale,t.originX),Rfe(e.y,t.y,t.scaleY,t.scale,t.originY)}function f7e(e,t){return c7e(urt(e.getBoundingClientRect(),t))}function frt(e,t,n){const r=f7e(e,n),{scroll:s}=t;return s&&(TC(r.x,s.offset.x),TC(r.y,s.offset.y)),r}const Lfe=()=>({translate:0,scale:1,origin:0,originPoint:0}),PC=()=>({x:Lfe(),y:Lfe()}),Dfe=()=>({min:0,max:0}),pl=()=>({x:Dfe(),y:Dfe()}),WQ={current:null},h7e={current:!1};function hrt(){if(h7e.current=!0,!!ise)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>WQ.current=e.matches;e.addEventListener("change",t),t()}else WQ.current=!1}const prt=new WeakMap;function mrt(e,t,n){for(const r in t){const s=t[r],a=n[r];if(Iu(s))e.addValue(r,s);else if(Iu(a))e.addValue(r,_S(s,{owner:e}));else if(a!==s)if(e.hasValue(r)){const o=e.getValue(r);o.liveStyle===!0?o.jump(s):o.hasAnimated||o.set(s)}else{const o=e.getStaticValue(r);e.addValue(r,_S(o!==void 0?o:s,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const Bfe=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let xrt=class{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:s,blockInitialAnimation:a,visualState:o},l={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Nse,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const x=Yd.now();this.renderScheduledAt<x&&(this.renderScheduledAt=x,Po.render(this.render,!1,!0))};const{latestValues:c,renderState:u}=o;this.latestValues=c,this.baseTarget={...c},this.initialValues=n.initial?{...c}:{},this.renderState=u,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=s,this.options=l,this.blockInitialAnimation=!!a,this.isControllingVariants=zD(n),this.isVariantNode=Z8e(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:d,...f}=this.scrapeMotionValuesFromProps(n,{},this);for(const x in f){const g=f[x];c[x]!==void 0&&Iu(g)&&g.set(c[x])}}mount(t){var n;this.current=t,prt.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((r,s)=>this.bindToMotionValue(s,r)),h7e.current||hrt(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:WQ.current,(n=this.parent)==null||n.addChild(this),this.update(this.props,this.presenceContext)}unmount(){var t;this.projection&&this.projection.unmount(),Ly(this.notifyUpdate),Ly(this.render),this.valueSubscriptions.forEach(n=>n()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),(t=this.parent)==null||t.removeChild(this);for(const n in this.events)this.events[n].clear();for(const n in this.features){const r=this.features[n];r&&(r.unmount(),r.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,n){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const r=dA.has(t);r&&this.onBindTransform&&this.onBindTransform();const s=n.on("change",o=>{this.latestValues[t]=o,this.props.onUpdate&&Po.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let a;window.MotionCheckAppearSync&&(a=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{s(),a&&a(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in kS){const n=kS[t];if(!n)continue;const{isEnabled:r,Feature:s}=n;if(!this.features[t]&&s&&r(this.props)&&(this.features[t]=new s(this)),this.features[t]){const a=this.features[t];a.isMounted?a.update():(a.mount(),a.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):pl()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<Bfe.length;r++){const s=Bfe[r];this.propEventSubscriptions[s]&&(this.propEventSubscriptions[s](),delete this.propEventSubscriptions[s]);const a="on"+s,o=t[a];o&&(this.propEventSubscriptions[s]=this.on(s,o))}this.prevMotionValues=mrt(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const r=this.values.get(t);n!==r&&(r&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=_S(n===null?void 0:n,{owner:this}),this.addValue(t,r)),r}readValue(t,n){let r=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return r!=null&&(typeof r=="string"&&(RD(r)||DD(r))?r=parseFloat(r):!knt(r)&&Dy.test(n)&&(r=H8e(t,n)),this.setBaseTarget(t,Iu(r)?r.get():r)),Iu(r)?r.get():r}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var a;const{initial:n}=this.props;let r;if(typeof n=="string"||typeof n=="object"){const o=Ose(this.props,n,(a=this.presenceContext)==null?void 0:a.custom);o&&(r=o[t])}if(n&&r!==void 0)return r;const s=this.getBaseTargetFromProps(this.props,t);return s!==void 0&&!Iu(s)?s:this.initialValues[t]!==void 0&&r===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new lA),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){Ese.render(this.render)}},p7e=class extends xrt{constructor(){super(...arguments),this.KeyframeResolver=xnt}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Iu(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}};function m7e(e,{style:t,vars:n},r,s){const a=e.style;let o;for(o in t)a[o]=t[o];s==null||s.applyProjectionStyles(a,r);for(o in n)a.setProperty(o,n[o])}function grt(e){return window.getComputedStyle(e)}let brt=class extends p7e{constructor(){super(...arguments),this.type="html",this.renderInstance=m7e}readValueFromInstance(t,n){var r;if(dA.has(n))return(r=this.projection)!=null&&r.isProjecting?RQ(n):Mtt(t,n);{const s=grt(t),a=(mse(n)?s.getPropertyValue(n):s[n])||0;return typeof a=="string"?a.trim():a}}measureInstanceViewportBox(t,{transformPagePoint:n}){return f7e(t,n)}build(t,n,r){Ise(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return Mse(t,n,r)}};const x7e=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function yrt(e,t,n,r){m7e(e,t,void 0,r);for(const s in t.attrs)e.setAttribute(x7e.has(s)?s:Rse(s),t.attrs[s])}let vrt=class extends p7e{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=pl}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(dA.has(n)){const r=z8e(n);return r&&r.default||0}return n=x7e.has(n)?n:Rse(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return i7e(t,n,r)}build(t,n,r){t7e(t,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(t,n,r,s){yrt(t,n,r,s)}mount(t){this.isSVGTag=r7e(t.tagName),super.mount(t)}};const wrt=(e,t)=>Fse(e)?new vrt(t):new brt(t,{allowProjection:e!==m.Fragment});function XC(e,t,n){const r=e.getProps();return Ose(r,t,n!==void 0?n:r.custom,e)}const qQ=e=>Array.isArray(e);function Crt(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,_S(n))}function Srt(e){return qQ(e)?e[e.length-1]||0:e}function Nrt(e,t){const n=XC(e,t);let{transitionEnd:r={},transition:s={},...a}=n||{};a={...a,...r};for(const o in a){const l=Srt(a[o]);Crt(e,o,l)}}function Art(e){return!!(Iu(e)&&e.add)}function GQ(e,t){const n=e.getValue("willChange");if(Art(n))return n.add(t);if(!n&&Oc.WillChange){const r=new Oc.WillChange("auto");e.addValue("willChange",r),r.add(t)}}function g7e(e){return e.props[a7e]}const jrt=e=>e!==null;function Ert(e,{repeat:t,repeatType:n="loop"},r){const s=e.filter(jrt),a=t&&n!=="loop"&&t%2===1?0:s.length-1;return s[a]}const _rt={type:"spring",stiffness:500,damping:25,restSpeed:10},krt=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),Trt={type:"keyframes",duration:.8},Irt={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Prt=(e,{keyframes:t})=>t.length>2?Trt:dA.has(e)?e.startsWith("scale")?krt(t[1]):_rt:Irt;function Frt({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:s,repeat:a,repeatType:o,repeatDelay:l,from:c,elapsed:u,...d}){return!!Object.keys(d).length}const Lse=(e,t,n,r={},s,a)=>o=>{const l=Ase(r,e)||{},c=l.delay||r.delay||0;let{elapsed:u=0}=r;u=u-Hl(c);const d={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...l,delay:-u,onUpdate:x=>{t.set(x),l.onUpdate&&l.onUpdate(x)},onComplete:()=>{o(),l.onComplete&&l.onComplete()},name:e,motionValue:t,element:a?void 0:s};Frt(l)||Object.assign(d,Prt(e,d)),d.duration&&(d.duration=Hl(d.duration)),d.repeatDelay&&(d.repeatDelay=Hl(d.repeatDelay)),d.from!==void 0&&(d.keyframes[0]=d.from);let f=!1;if((d.type===!1||d.duration===0&&!d.repeatDelay)&&(UQ(d),d.delay===0&&(f=!0)),(Oc.instantAnimations||Oc.skipAnimations)&&(f=!0,UQ(d),d.delay=0),d.allowFlatten=!l.type&&!l.ease,f&&!a&&t.get()!==void 0){const x=Ert(d.keyframes,l);if(x!==void 0){Po.update(()=>{d.onUpdate(x),d.onComplete()});return}}return l.isSync?new Sse(d):new snt(d)};function Ort({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function b7e(e,t,{delay:n=0,transitionOverride:r,type:s}={}){let{transition:a=e.getDefaultTransition(),transitionEnd:o,...l}=t;r&&(a=r);const c=[],u=s&&e.animationState&&e.animationState.getState()[s];for(const d in l){const f=e.getValue(d,e.latestValues[d]??null),x=l[d];if(x===void 0||u&&Ort(u,d))continue;const g={delay:n,...Ase(a||{},d)},v=f.get();if(v!==void 0&&!f.isAnimating&&!Array.isArray(x)&&x===v&&!g.velocity)continue;let w=!1;if(window.MotionHandoffAnimation){const N=g7e(e);if(N){const P=window.MotionHandoffAnimation(N,d,Po);P!==null&&(g.startTime=P,w=!0)}}GQ(e,d),f.start(Lse(d,f,x,e.shouldReduceMotion&&B8e.has(d)?{type:!1}:g,e,w));const C=f.animation;C&&c.push(C)}return o&&Promise.all(c).then(()=>{Po.update(()=>{o&&Nrt(e,o)})}),c}function y7e(e,t,n,r=0,s=1){const a=Array.from(e).sort((u,d)=>u.sortNodePosition(d)).indexOf(t),o=e.size,l=(o-1)*r;return typeof n=="function"?n(a,o):s===1?a*r:l-a*r}function KQ(e,t,n={}){var c;const r=XC(e,t,n.type==="exit"?(c=e.presenceContext)==null?void 0:c.custom:void 0);let{transition:s=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(s=n.transitionOverride);const a=r?()=>Promise.all(b7e(e,r,n)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(u=0)=>{const{delayChildren:d=0,staggerChildren:f,staggerDirection:x}=s;return Mrt(e,t,u,d,f,x,n)}:()=>Promise.resolve(),{when:l}=s;if(l){const[u,d]=l==="beforeChildren"?[a,o]:[o,a];return u().then(()=>d())}else return Promise.all([a(),o(n.delay)])}function Mrt(e,t,n=0,r=0,s=0,a=1,o){const l=[];for(const c of e.variantChildren)c.notify("AnimationStart",t),l.push(KQ(c,t,{...o,delay:n+(typeof r=="function"?0:r)+y7e(e.variantChildren,c,r,s,a)}).then(()=>c.notify("AnimationComplete",t)));return Promise.all(l)}function Rrt(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const s=t.map(a=>KQ(e,a,n));r=Promise.all(s)}else if(typeof t=="string")r=KQ(e,t,n);else{const s=typeof t=="function"?XC(e,t,n.custom):t;r=Promise.all(b7e(e,s,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}function v7e(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}const Lrt=Tse.length;function w7e(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?w7e(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<Lrt;n++){const r=Tse[n],s=e.props[r];(_9(s)||s===!1)&&(t[r]=s)}return t}const Drt=[...kse].reverse(),Brt=kse.length;function $rt(e){return t=>Promise.all(t.map(({animation:n,options:r})=>Rrt(e,n,r)))}function Urt(e){let t=$rt(e),n=$fe(),r=!0;const s=c=>(u,d)=>{var x;const f=XC(e,d,c==="exit"?(x=e.presenceContext)==null?void 0:x.custom:void 0);if(f){const{transition:g,transitionEnd:v,...w}=f;u={...u,...w,...v}}return u};function a(c){t=c(e)}function o(c){const{props:u}=e,d=w7e(e.parent)||{},f=[],x=new Set;let g={},v=1/0;for(let C=0;C<Brt;C++){const N=Drt[C],P=n[N],I=u[N]!==void 0?u[N]:d[N],R=_9(I),F=N===c?P.isActive:null;F===!1&&(v=C);let U=I===d[N]&&I!==u[N]&&R;if(U&&r&&e.manuallyAnimateOnMount&&(U=!1),P.protectedKeys={...g},!P.isActive&&F===null||!I&&!P.prevProp||UD(I)||typeof I=="boolean")continue;const L=zrt(P.prevProp,I);let z=L||N===c&&P.isActive&&!U&&R||C>v&&R,Q=!1;const ne=Array.isArray(I)?I:[I];let J=ne.reduce(s(N),{});F===!1&&(J={});const{prevResolvedValues:X={}}=P,re={...X,...J},pe=oe=>{z=!0,x.has(oe)&&(Q=!0,x.delete(oe)),P.needsAnimating[oe]=!0;const G=e.getValue(oe);G&&(G.liveStyle=!1)};for(const oe in re){const G=J[oe],V=X[oe];if(g.hasOwnProperty(oe))continue;let ee=!1;qQ(G)&&qQ(V)?ee=!v7e(G,V):ee=G!==V,ee?G!=null?pe(oe):x.add(oe):G!==void 0&&x.has(oe)?pe(oe):P.protectedKeys[oe]=!0}P.prevProp=I,P.prevResolvedValues=J,P.isActive&&(g={...g,...J}),r&&e.blockInitialAnimation&&(z=!1);const Y=U&&L;z&&(!Y||Q)&&f.push(...ne.map(oe=>{const G={type:N};if(typeof oe=="string"&&r&&!Y&&e.manuallyAnimateOnMount&&e.parent){const{parent:V}=e,ee=XC(V,oe);if(V.enteringChildren&&ee){const{delayChildren:ae}=ee.transition||{};G.delay=y7e(V.enteringChildren,e,ae)}}return{animation:oe,options:G}}))}if(x.size){const C={};if(typeof u.initial!="boolean"){const N=XC(e,Array.isArray(u.initial)?u.initial[0]:u.initial);N&&N.transition&&(C.transition=N.transition)}x.forEach(N=>{const P=e.getBaseTarget(N),I=e.getValue(N);I&&(I.liveStyle=!0),C[N]=P??null}),f.push({animation:C})}let w=!!f.length;return r&&(u.initial===!1||u.initial===u.animate)&&!e.manuallyAnimateOnMount&&(w=!1),r=!1,w?t(f):Promise.resolve()}function l(c,u){var f;if(n[c].isActive===u)return Promise.resolve();(f=e.variantChildren)==null||f.forEach(x=>{var g;return(g=x.animationState)==null?void 0:g.setActive(c,u)}),n[c].isActive=u;const d=o(c);for(const x in n)n[x].protectedKeys={};return d}return{animateChanges:o,setActive:l,setAnimateFunction:a,getState:()=>n,reset:()=>{n=$fe(),r=!0}}}function zrt(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!v7e(t,e):!1}function av(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function $fe(){return{animate:av(!0),whileInView:av(),whileHover:av(),whileTap:av(),whileDrag:av(),whileFocus:av(),exit:av()}}let r2=class{constructor(t){this.isMounted=!1,this.node=t}update(){}},Hrt=class extends r2{constructor(t){super(t),t.animationState||(t.animationState=Urt(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();UD(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)==null||t.call(this)}},Vrt=0,Wrt=class extends r2{constructor(){super(...arguments),this.id=Vrt++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;const s=this.node.animationState.setActive("exit",!t);n&&!t&&s.then(()=>{n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}};const qrt={animation:{Feature:Hrt},exit:{Feature:Wrt}};function T9(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function Sk(e){return{point:{x:e.pageX,y:e.pageY}}}const Grt=e=>t=>_se(t)&&e(t,Sk(t));function $j(e,t,n,r){return T9(e,t,Grt(n),r)}const C7e=1e-4,Krt=1-C7e,Yrt=1+C7e,S7e=.01,Xrt=0-S7e,Qrt=0+S7e;function sd(e){return e.max-e.min}function Zrt(e,t,n){return Math.abs(e-t)<=n}function Ufe(e,t,n,r=.5){e.origin=r,e.originPoint=Uo(t.min,t.max,e.origin),e.scale=sd(n)/sd(t),e.translate=Uo(n.min,n.max,e.origin)-e.originPoint,(e.scale>=Krt&&e.scale<=Yrt||isNaN(e.scale))&&(e.scale=1),(e.translate>=Xrt&&e.translate<=Qrt||isNaN(e.translate))&&(e.translate=0)}function Uj(e,t,n,r){Ufe(e.x,t.x,n.x,r?r.originX:void 0),Ufe(e.y,t.y,n.y,r?r.originY:void 0)}function zfe(e,t,n){e.min=n.min+t.min,e.max=e.min+sd(t)}function Jrt(e,t,n){zfe(e.x,t.x,n.x),zfe(e.y,t.y,n.y)}function Hfe(e,t,n){e.min=t.min-n.min,e.max=e.min+sd(t)}function zj(e,t,n){Hfe(e.x,t.x,n.x),Hfe(e.y,t.y,n.y)}function kh(e){return[e("x"),e("y")]}const N7e=({current:e})=>e?e.ownerDocument.defaultView:null,Vfe=(e,t)=>Math.abs(e-t);function est(e,t){const n=Vfe(e.x,t.x),r=Vfe(e.y,t.y);return Math.sqrt(n**2+r**2)}let A7e=class{constructor(t,n,{transformPagePoint:r,contextWindow:s=window,dragSnapToOrigin:a=!1,distanceThreshold:o=3}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const x=Pz(this.lastMoveEventInfo,this.history),g=this.startEvent!==null,v=est(x.offset,{x:0,y:0})>=this.distanceThreshold;if(!g&&!v)return;const{point:w}=x,{timestamp:C}=Gc;this.history.push({...w,timestamp:C});const{onStart:N,onMove:P}=this.handlers;g||(N&&N(this.lastMoveEvent,x),this.startEvent=this.lastMoveEvent),P&&P(this.lastMoveEvent,x)},this.handlePointerMove=(x,g)=>{this.lastMoveEvent=x,this.lastMoveEventInfo=Iz(g,this.transformPagePoint),Po.update(this.updatePoint,!0)},this.handlePointerUp=(x,g)=>{this.end();const{onEnd:v,onSessionEnd:w,resumeAnimation:C}=this.handlers;if(this.dragSnapToOrigin&&C&&C(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const N=Pz(x.type==="pointercancel"?this.lastMoveEventInfo:Iz(g,this.transformPagePoint),this.history);this.startEvent&&v&&v(x,N),w&&w(x,N)},!_se(t))return;this.dragSnapToOrigin=a,this.handlers=n,this.transformPagePoint=r,this.distanceThreshold=o,this.contextWindow=s||window;const l=Sk(t),c=Iz(l,this.transformPagePoint),{point:u}=c,{timestamp:d}=Gc;this.history=[{...u,timestamp:d}];const{onSessionStart:f}=n;f&&f(t,Pz(c,this.history)),this.removeListeners=ux($j(this.contextWindow,"pointermove",this.handlePointerMove),$j(this.contextWindow,"pointerup",this.handlePointerUp),$j(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),Ly(this.updatePoint)}};function Iz(e,t){return t?{point:t(e.point)}:e}function Wfe(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Pz({point:e},t){return{point:e,delta:Wfe(e,j7e(t)),offset:Wfe(e,tst(t)),velocity:nst(t,.1)}}function tst(e){return e[0]}function j7e(e){return e[e.length-1]}function nst(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const s=j7e(e);for(;n>=0&&(r=e[n],!(s.timestamp-r.timestamp>Hl(t)));)n--;if(!r)return{x:0,y:0};const a=rl(s.timestamp-r.timestamp);if(a===0)return{x:0,y:0};const o={x:(s.x-r.x)/a,y:(s.y-r.y)/a};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function rst(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?Uo(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?Uo(n,e,r.max):Math.min(e,n)),e}function qfe(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function sst(e,{top:t,left:n,bottom:r,right:s}){return{x:qfe(e.x,n,s),y:qfe(e.y,t,r)}}function Gfe(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function ist(e,t){return{x:Gfe(e.x,t.x),y:Gfe(e.y,t.y)}}function ast(e,t){let n=.5;const r=sd(e),s=sd(t);return s>r?n=K0(t.min,t.max-r,e.min):r>s&&(n=K0(e.min,e.max-s,t.min)),Fc(0,1,n)}function ost(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const YQ=.35;function lst(e=YQ){return e===!1?e=0:e===!0&&(e=YQ),{x:Kfe(e,"left","right"),y:Kfe(e,"top","bottom")}}function Kfe(e,t,n){return{min:Yfe(e,t),max:Yfe(e,n)}}function Yfe(e,t){return typeof e=="number"?e:e[t]||0}const cst=new WeakMap;let ust=class{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=pl(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:n=!1,distanceThreshold:r}={}){const{presenceContext:s}=this.visualElement;if(s&&s.isPresent===!1)return;const a=f=>{const{dragSnapToOrigin:x}=this.getProps();x?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(Sk(f).point)},o=(f,x)=>{const{drag:g,dragPropagation:v,onDragStart:w}=this.getProps();if(g&&!v&&(this.openDragLock&&this.openDragLock(),this.openDragLock=wnt(g),!this.openDragLock))return;this.latestPointerEvent=f,this.latestPanInfo=x,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),kh(N=>{let P=this.getAxisMotionValue(N).get()||0;if(M0.test(P)){const{projection:I}=this.visualElement;if(I&&I.layout){const R=I.layout.layoutBox[N];R&&(P=sd(R)*(parseFloat(P)/100))}}this.originPoint[N]=P}),w&&Po.postRender(()=>w(f,x)),GQ(this.visualElement,"transform");const{animationState:C}=this.visualElement;C&&C.setActive("whileDrag",!0)},l=(f,x)=>{this.latestPointerEvent=f,this.latestPanInfo=x;const{dragPropagation:g,dragDirectionLock:v,onDirectionLock:w,onDrag:C}=this.getProps();if(!g&&!this.openDragLock)return;const{offset:N}=x;if(v&&this.currentDirection===null){this.currentDirection=dst(N),this.currentDirection!==null&&w&&w(this.currentDirection);return}this.updateAxis("x",x.point,N),this.updateAxis("y",x.point,N),this.visualElement.render(),C&&C(f,x)},c=(f,x)=>{this.latestPointerEvent=f,this.latestPanInfo=x,this.stop(f,x),this.latestPointerEvent=null,this.latestPanInfo=null},u=()=>kh(f=>{var x;return this.getAnimationState(f)==="paused"&&((x=this.getAxisMotionValue(f).animation)==null?void 0:x.play())}),{dragSnapToOrigin:d}=this.getProps();this.panSession=new A7e(t,{onSessionStart:a,onStart:o,onMove:l,onSessionEnd:c,resumeAnimation:u},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:d,distanceThreshold:r,contextWindow:N7e(this.visualElement)})}stop(t,n){const r=t||this.latestPointerEvent,s=n||this.latestPanInfo,a=this.isDragging;if(this.cancel(),!a||!s||!r)return;const{velocity:o}=s;this.startAnimation(o);const{onDragEnd:l}=this.getProps();l&&Po.postRender(()=>l(r,s))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,r){const{drag:s}=this.getProps();if(!r||!EI(t,s,this.currentDirection))return;const a=this.getAxisMotionValue(t);let o=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(o=rst(o,this.constraints[t],this.elastic[t])),a.set(o)}resolveConstraints(){var a;const{dragConstraints:t,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(a=this.visualElement.projection)==null?void 0:a.layout,s=this.constraints;t&&kC(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=sst(r.layoutBox,t):this.constraints=!1,this.elastic=lst(n),s!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&kh(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=ost(r.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!kC(t))return!1;const r=t.current,{projection:s}=this.visualElement;if(!s||!s.layout)return!1;const a=frt(r,s.root,this.visualElement.getTransformPagePoint());let o=ist(s.layout.layoutBox,a);if(n){const l=n(crt(o));this.hasMutatedConstraints=!!l,l&&(o=c7e(l))}return o}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:s,dragTransition:a,dragSnapToOrigin:o,onDragTransitionEnd:l}=this.getProps(),c=this.constraints||{},u=kh(d=>{if(!EI(d,n,this.currentDirection))return;let f=c[d]||{};o&&(f={min:0,max:0});const x=s?200:1e6,g=s?40:1e7,v={type:"inertia",velocity:r?t[d]:0,bounceStiffness:x,bounceDamping:g,timeConstant:750,restDelta:1,restSpeed:10,...a,...f};return this.startAxisValueAnimation(d,v)});return Promise.all(u).then(l)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return GQ(this.visualElement,t),r.start(Lse(t,r,0,n,this.visualElement,!1))}stopAnimation(){kh(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){kh(t=>{var n;return(n=this.getAxisMotionValue(t).animation)==null?void 0:n.pause()})}getAnimationState(t){var n;return(n=this.getAxisMotionValue(t).animation)==null?void 0:n.state}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,r=this.visualElement.getProps(),s=r[n];return s||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){kh(n=>{const{drag:r}=this.getProps();if(!EI(n,r,this.currentDirection))return;const{projection:s}=this.visualElement,a=this.getAxisMotionValue(n);if(s&&s.layout){const{min:o,max:l}=s.layout.layoutBox[n];a.set(t[n]-Uo(o,l,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!kC(n)||!r||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};kh(o=>{const l=this.getAxisMotionValue(o);if(l&&this.constraints!==!1){const c=l.get();s[o]=ast({min:c,max:c},this.constraints[o])}});const{transformTemplate:a}=this.visualElement.getProps();this.visualElement.current.style.transform=a?a({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),kh(o=>{if(!EI(o,t,null))return;const l=this.getAxisMotionValue(o),{min:c,max:u}=this.constraints[o];l.set(Uo(c,u,s[o]))})}addListeners(){if(!this.visualElement.current)return;cst.set(this.visualElement,this);const t=this.visualElement.current,n=$j(t,"pointerdown",c=>{const{drag:u,dragListener:d=!0}=this.getProps();u&&d&&this.start(c)}),r=()=>{const{dragConstraints:c}=this.getProps();kC(c)&&c.current&&(this.constraints=this.resolveRefConstraints())},{projection:s}=this.visualElement,a=s.addEventListener("measure",r);s&&!s.layout&&(s.root&&s.root.updateScroll(),s.updateLayout()),Po.read(r);const o=T9(window,"resize",()=>this.scalePositionWithinConstraints()),l=s.addEventListener("didUpdate",({delta:c,hasLayoutChanged:u})=>{this.isDragging&&u&&(kh(d=>{const f=this.getAxisMotionValue(d);f&&(this.originPoint[d]+=c[d].translate,f.set(f.get()+c[d].translate))}),this.visualElement.render())});return()=>{o(),n(),a(),l&&l()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:s=!1,dragConstraints:a=!1,dragElastic:o=YQ,dragMomentum:l=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:s,dragConstraints:a,dragElastic:o,dragMomentum:l}}};function EI(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function dst(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}let fst=class extends r2{constructor(t){super(t),this.removeGroupControls=al,this.removeListeners=al,this.controls=new ust(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||al}unmount(){this.removeGroupControls(),this.removeListeners()}};const Xfe=e=>(t,n)=>{e&&Po.postRender(()=>e(t,n))};let hst=class extends r2{constructor(){super(...arguments),this.removePointerDownListener=al}onPointerDown(t){this.session=new A7e(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:N7e(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:s}=this.node.getProps();return{onSessionStart:Xfe(t),onStart:Xfe(n),onMove:r,onEnd:(a,o)=>{delete this.session,s&&Po.postRender(()=>s(a,o))}}}mount(){this.removePointerDownListener=$j(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}};const IF={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function Qfe(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const f7={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(oi.test(e))e=parseFloat(e);else return e;const n=Qfe(e,t.target.x),r=Qfe(e,t.target.y);return`${n}% ${r}%`}},pst={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,s=Dy.parse(e);if(s.length>5)return r;const a=Dy.createTransformer(e),o=typeof s[0]!="number"?1:0,l=n.x.scale*t.x,c=n.y.scale*t.y;s[0+o]/=l,s[1+o]/=c;const u=Uo(l,c,.5);return typeof s[2+o]=="number"&&(s[2+o]/=u),typeof s[3+o]=="number"&&(s[3+o]/=u),a(s)}};let Fz=!1,mst=class extends m.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:s}=this.props,{projection:a}=t;Lnt(xst),a&&(n.group&&n.group.add(a),r&&r.register&&s&&r.register(a),Fz&&a.root.didUpdate(),a.addEventListener("animationComplete",()=>{this.safeToRemove()}),a.setOptions({...a.options,onExitComplete:()=>this.safeToRemove()})),IF.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:s,isPresent:a}=this.props,{projection:o}=r;return o&&(o.isPresent=a,Fz=!0,s||t.layoutDependency!==n||n===void 0||t.isPresent!==a?o.willUpdate():this.safeToRemove(),t.isPresent!==a&&(a?o.promote():o.relegate()||Po.postRender(()=>{const l=o.getStack();(!l||!l.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),Ese.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:s}=t;Fz=!0,s&&(s.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(s),r&&r.deregister&&r.deregister(s))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}};function E7e(e){const[t,n]=Tnt(),r=m.useContext(p8e);return i.jsx(mst,{...e,layoutGroup:r,switchLayoutGroup:m.useContext(o7e),isPresent:t,safeToRemove:n})}const xst={borderRadius:{...f7,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:f7,borderTopRightRadius:f7,borderBottomLeftRadius:f7,borderBottomRightRadius:f7,boxShadow:pst};function gst(e,t,n){const r=Iu(e)?e:_S(e);return r.start(Lse("",r,t,n)),r.animation}const bst=(e,t)=>e.depth-t.depth;let yst=class{constructor(){this.children=[],this.isDirty=!1}add(t){yk(this.children,t),this.isDirty=!0}remove(t){vk(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(bst),this.isDirty=!1,this.children.forEach(t)}};function vst(e,t){const n=Yd.now(),r=({timestamp:s})=>{const a=s-n;a>=t&&(Ly(r),e(a-t))};return Po.setup(r,!0),()=>Ly(r)}const _7e=["TopLeft","TopRight","BottomLeft","BottomRight"],wst=_7e.length,Zfe=e=>typeof e=="string"?parseFloat(e):e,Jfe=e=>typeof e=="number"||oi.test(e);function Cst(e,t,n,r,s,a){s?(e.opacity=Uo(0,n.opacity??1,Sst(r)),e.opacityExit=Uo(t.opacity??1,0,Nst(r))):a&&(e.opacity=Uo(t.opacity??1,n.opacity??1,r));for(let o=0;o<wst;o++){const l=`border${_7e[o]}Radius`;let c=ehe(t,l),u=ehe(n,l);if(c===void 0&&u===void 0)continue;c||(c=0),u||(u=0),c===0||u===0||Jfe(c)===Jfe(u)?(e[l]=Math.max(Uo(Zfe(c),Zfe(u),r),0),(M0.test(u)||M0.test(c))&&(e[l]+="%")):e[l]=u}(t.rotate||n.rotate)&&(e.rotate=Uo(t.rotate||0,n.rotate||0,r))}function ehe(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const Sst=k7e(0,.5,dse),Nst=k7e(.5,.95,al);function k7e(e,t,n){return r=>r<e?0:r>t?1:n(K0(e,t,r))}function the(e,t){e.min=t.min,e.max=t.max}function ph(e,t){the(e.x,t.x),the(e.y,t.y)}function nhe(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function rhe(e,t,n,r,s){return e-=t,e=KO(e,1/n,r),s!==void 0&&(e=KO(e,1/s,r)),e}function Ast(e,t=0,n=1,r=.5,s,a=e,o=e){if(M0.test(t)&&(t=parseFloat(t),t=Uo(o.min,o.max,t/100)-o.min),typeof t!="number")return;let l=Uo(a.min,a.max,r);e===a&&(l-=t),e.min=rhe(e.min,t,n,l,s),e.max=rhe(e.max,t,n,l,s)}function she(e,t,[n,r,s],a,o){Ast(e,t[n],t[r],t[s],t.scale,a,o)}const jst=["x","scaleX","originX"],Est=["y","scaleY","originY"];function ihe(e,t,n,r){she(e.x,t,jst,n?n.x:void 0,r?r.x:void 0),she(e.y,t,Est,n?n.y:void 0,r?r.y:void 0)}function ahe(e){return e.translate===0&&e.scale===1}function T7e(e){return ahe(e.x)&&ahe(e.y)}function ohe(e,t){return e.min===t.min&&e.max===t.max}function _st(e,t){return ohe(e.x,t.x)&&ohe(e.y,t.y)}function lhe(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function I7e(e,t){return lhe(e.x,t.x)&&lhe(e.y,t.y)}function che(e){return sd(e.x)/sd(e.y)}function uhe(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}let kst=class{constructor(){this.members=[]}add(t){yk(this.members,t),t.scheduleRender()}remove(t){if(vk(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(s=>t===s);if(n===0)return!1;let r;for(let s=n;s>=0;s--){const a=this.members[s];if(a.isPresent!==!1){r=a;break}}return r?(this.promote(r),!0):!1}promote(t,n){const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.instance&&r.scheduleRender(),t.scheduleRender(),t.resumeFrom=r,n&&(t.resumeFrom.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:s}=t.options;s===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:r}=t;n.onExitComplete&&n.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}};function Tst(e,t,n){let r="";const s=e.x.translate/t.x,a=e.y.translate/t.y,o=(n==null?void 0:n.z)||0;if((s||a||o)&&(r=`translate3d(${s}px, ${a}px, ${o}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:u,rotate:d,rotateX:f,rotateY:x,skewX:g,skewY:v}=n;u&&(r=`perspective(${u}px) ${r}`),d&&(r+=`rotate(${d}deg) `),f&&(r+=`rotateX(${f}deg) `),x&&(r+=`rotateY(${x}deg) `),g&&(r+=`skewX(${g}deg) `),v&&(r+=`skewY(${v}deg) `)}const l=e.x.scale*t.x,c=e.y.scale*t.y;return(l!==1||c!==1)&&(r+=`scale(${l}, ${c})`),r||"none"}const Oz=["","X","Y","Z"],Ist=1e3;let Pst=0;function Mz(e,t,n,r){const{latestValues:s}=t;s[e]&&(n[e]=s[e],t.setStaticValue(e,0),r&&(r[e]=0))}function P7e(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=g7e(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:s,layoutId:a}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",Po,!(s||a))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&P7e(r)}function F7e({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:s}){return class{constructor(o={},l=t==null?void 0:t()){this.id=Pst++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(Mst),this.nodes.forEach(Bst),this.nodes.forEach($st),this.nodes.forEach(Rst)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=l?l.root||l:this,this.path=l?[...l.path,l]:[],this.parent=l,this.depth=l?l.depth+1:0;for(let c=0;c<this.path.length;c++)this.path[c].shouldResetTransform=!0;this.root===this&&(this.nodes=new yst)}addEventListener(o,l){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new lA),this.eventHandlers.get(o).add(l)}notifyListeners(o,...l){const c=this.eventHandlers.get(o);c&&c.notify(...l)}hasListeners(o){return this.eventHandlers.has(o)}mount(o){if(this.instance)return;this.isSVG=K8e(o)&&!Ent(o),this.instance=o;const{layoutId:l,layout:c,visualElement:u}=this.options;if(u&&!u.current&&u.mount(o),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(c||l)&&(this.isLayoutDirty=!0),e){let d,f=0;const x=()=>this.root.updateBlockedByResize=!1;Po.read(()=>{f=window.innerWidth}),e(o,()=>{const g=window.innerWidth;g!==f&&(f=g,this.root.updateBlockedByResize=!0,d&&d(),d=vst(x,250),IF.hasAnimatedSinceResize&&(IF.hasAnimatedSinceResize=!1,this.nodes.forEach(hhe)))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&u&&(l||c)&&this.addEventListener("didUpdate",({delta:d,hasLayoutChanged:f,hasRelativeLayoutChanged:x,layout:g})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const v=this.options.transition||u.getDefaultTransition()||Wst,{onLayoutAnimationStart:w,onLayoutAnimationComplete:C}=u.getProps(),N=!this.targetLayout||!I7e(this.targetLayout,g),P=!f&&x;if(this.options.layoutRoot||this.resumeFrom||P||f&&(N||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const I={...Ase(v,"layout"),onPlay:w,onComplete:C};(u.shouldReduceMotion||this.options.layoutRoot)&&(I.delay=0,I.type=!1),this.startAnimation(I),this.setAnimationOrigin(d,P)}else f||hhe(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=g})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),Ly(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(Ust),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&P7e(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let d=0;d<this.path.length;d++){const f=this.path[d];f.shouldResetTransform=!0,f.updateScroll("snapshot"),f.options.layoutRoot&&f.willUpdate(!1)}const{layoutId:l,layout:c}=this.options;if(l===void 0&&!c)return;const u=this.getTransformTemplate();this.prevTransformTemplateValue=u?u(this.latestValues,""):void 0,this.updateSnapshot(),o&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(dhe);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(fhe);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(Dst),this.nodes.forEach(Fst),this.nodes.forEach(Ost)):this.nodes.forEach(fhe),this.clearAllSnapshots();const l=Yd.now();Gc.delta=Fc(0,1e3/60,l-Gc.timestamp),Gc.timestamp=l,Gc.isProcessing=!0,Nz.update.process(Gc),Nz.preRender.process(Gc),Nz.render.process(Gc),Gc.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Ese.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Lst),this.sharedNodes.forEach(zst)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Po.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Po.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!sd(this.snapshot.measuredBox.x)&&!sd(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let c=0;c<this.path.length;c++)this.path[c].updateScroll();const o=this.layout;this.layout=this.measure(!1),this.layoutCorrected=pl(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:l}=this.options;l&&l.notify("LayoutMeasure",this.layout.layoutBox,o?o.layoutBox:void 0)}updateScroll(o="measure"){let l=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===o&&(l=!1),l&&this.instance){const c=r(this.instance);this.scroll={animationId:this.root.animationId,phase:o,isRoot:c,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:c}}}resetTransform(){if(!s)return;const o=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,l=this.projectionDelta&&!T7e(this.projectionDelta),c=this.getTransformTemplate(),u=c?c(this.latestValues,""):void 0,d=u!==this.prevTransformTemplateValue;o&&this.instance&&(l||Cv(this.latestValues)||d)&&(s(this.instance,u),this.shouldResetTransform=!1,this.scheduleRender())}measure(o=!0){const l=this.measurePageBox();let c=this.removeElementScroll(l);return o&&(c=this.removeTransform(c)),qst(c),{animationId:this.root.animationId,measuredBox:l,layoutBox:c,latestValues:{},source:this.id}}measurePageBox(){var u;const{visualElement:o}=this.options;if(!o)return pl();const l=o.measureViewportBox();if(!(((u=this.scroll)==null?void 0:u.wasRoot)||this.path.some(Gst))){const{scroll:d}=this.root;d&&(TC(l.x,d.offset.x),TC(l.y,d.offset.y))}return l}removeElementScroll(o){var c;const l=pl();if(ph(l,o),(c=this.scroll)!=null&&c.wasRoot)return l;for(let u=0;u<this.path.length;u++){const d=this.path[u],{scroll:f,options:x}=d;d!==this.root&&f&&x.layoutScroll&&(f.wasRoot&&ph(l,o),TC(l.x,f.offset.x),TC(l.y,f.offset.y))}return l}applyTransform(o,l=!1){const c=pl();ph(c,o);for(let u=0;u<this.path.length;u++){const d=this.path[u];!l&&d.options.layoutScroll&&d.scroll&&d!==d.root&&IC(c,{x:-d.scroll.offset.x,y:-d.scroll.offset.y}),Cv(d.latestValues)&&IC(c,d.latestValues)}return Cv(this.latestValues)&&IC(c,this.latestValues),c}removeTransform(o){const l=pl();ph(l,o);for(let c=0;c<this.path.length;c++){const u=this.path[c];if(!u.instance||!Cv(u.latestValues))continue;HQ(u.latestValues)&&u.updateSnapshot();const d=pl(),f=u.measurePageBox();ph(d,f),ihe(l,u.latestValues,u.snapshot?u.snapshot.layoutBox:void 0,d)}return Cv(this.latestValues)&&ihe(l,this.latestValues),l}setTargetDelta(o){this.targetDelta=o,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(o){this.options={...this.options,...o,crossfade:o.crossfade!==void 0?o.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==Gc.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(o=!1){var x;const l=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=l.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=l.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=l.isSharedProjectionDirty);const c=!!this.resumingFrom||this!==l;if(!(o||c&&this.isSharedProjectionDirty||this.isProjectionDirty||(x=this.parent)!=null&&x.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:d,layoutId:f}=this.options;if(!(!this.layout||!(d||f))){if(this.resolvedRelativeTargetAt=Gc.timestamp,!this.targetDelta&&!this.relativeTarget){const g=this.getClosestProjectingParent();g&&g.layout&&this.animationProgress!==1?(this.relativeParent=g,this.forceRelativeParentToResolveTarget(),this.relativeTarget=pl(),this.relativeTargetOrigin=pl(),zj(this.relativeTargetOrigin,this.layout.layoutBox,g.layout.layoutBox),ph(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=pl(),this.targetWithTransforms=pl()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),Jrt(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):ph(this.target,this.layout.layoutBox),d7e(this.target,this.targetDelta)):ph(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget)){this.attemptToResolveRelativeTarget=!1;const g=this.getClosestProjectingParent();g&&!!g.resumingFrom==!!this.resumingFrom&&!g.options.layoutScroll&&g.target&&this.animationProgress!==1?(this.relativeParent=g,this.forceRelativeParentToResolveTarget(),this.relativeTarget=pl(),this.relativeTargetOrigin=pl(),zj(this.relativeTargetOrigin,this.target,g.target),ph(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}}}getClosestProjectingParent(){if(!(!this.parent||HQ(this.parent.latestValues)||u7e(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var v;const o=this.getLead(),l=!!this.resumingFrom||this!==o;let c=!0;if((this.isProjectionDirty||(v=this.parent)!=null&&v.isProjectionDirty)&&(c=!1),l&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(c=!1),this.resolvedRelativeTargetAt===Gc.timestamp&&(c=!1),c)return;const{layout:u,layoutId:d}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(u||d))return;ph(this.layoutCorrected,this.layout.layoutBox);const f=this.treeScale.x,x=this.treeScale.y;drt(this.layoutCorrected,this.treeScale,this.path,l),o.layout&&!o.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(o.target=o.layout.layoutBox,o.targetWithTransforms=pl());const{target:g}=o;if(!g){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(nhe(this.prevProjectionDelta.x,this.projectionDelta.x),nhe(this.prevProjectionDelta.y,this.projectionDelta.y)),Uj(this.projectionDelta,this.layoutCorrected,g,this.latestValues),(this.treeScale.x!==f||this.treeScale.y!==x||!uhe(this.projectionDelta.x,this.prevProjectionDelta.x)||!uhe(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",g))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(o=!0){var l;if((l=this.options.visualElement)==null||l.scheduleRender(),o){const c=this.getStack();c&&c.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=PC(),this.projectionDelta=PC(),this.projectionDeltaWithTransform=PC()}setAnimationOrigin(o,l=!1){const c=this.snapshot,u=c?c.latestValues:{},d={...this.latestValues},f=PC();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!l;const x=pl(),g=c?c.source:void 0,v=this.layout?this.layout.source:void 0,w=g!==v,C=this.getStack(),N=!C||C.members.length<=1,P=!!(w&&!N&&this.options.crossfade===!0&&!this.path.some(Vst));this.animationProgress=0;let I;this.mixTargetDelta=R=>{const F=R/1e3;phe(f.x,o.x,F),phe(f.y,o.y,F),this.setTargetDelta(f),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(zj(x,this.layout.layoutBox,this.relativeParent.layout.layoutBox),Hst(this.relativeTarget,this.relativeTargetOrigin,x,F),I&&_st(this.relativeTarget,I)&&(this.isProjectionDirty=!1),I||(I=pl()),ph(I,this.relativeTarget)),w&&(this.animationValues=d,Cst(d,u,this.latestValues,F,P,N)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=F},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){var l,c,u;this.notifyListeners("animationStart"),(l=this.currentAnimation)==null||l.stop(),(u=(c=this.resumingFrom)==null?void 0:c.currentAnimation)==null||u.stop(),this.pendingAnimation&&(Ly(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Po.update(()=>{IF.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=_S(0)),this.currentAnimation=gst(this.motionValue,[0,1e3],{...o,velocity:0,isSync:!0,onUpdate:d=>{this.mixTargetDelta(d),o.onUpdate&&o.onUpdate(d)},onStop:()=>{},onComplete:()=>{o.onComplete&&o.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(Ist),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:l,target:c,layout:u,latestValues:d}=o;if(!(!l||!c||!u)){if(this!==o&&this.layout&&u&&O7e(this.options.animationType,this.layout.layoutBox,u.layoutBox)){c=this.target||pl();const f=sd(this.layout.layoutBox.x);c.x.min=o.target.x.min,c.x.max=c.x.min+f;const x=sd(this.layout.layoutBox.y);c.y.min=o.target.y.min,c.y.max=c.y.min+x}ph(l,c),IC(l,d),Uj(this.projectionDeltaWithTransform,this.layoutCorrected,l,d)}}registerSharedNode(o,l){this.sharedNodes.has(o)||this.sharedNodes.set(o,new kst),this.sharedNodes.get(o).add(l);const u=l.options.initialPromotionConfig;l.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(l):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var l;const{layoutId:o}=this.options;return o?((l=this.getStack())==null?void 0:l.lead)||this:this}getPrevLead(){var l;const{layoutId:o}=this.options;return o?(l=this.getStack())==null?void 0:l.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:l,preserveFollowOpacity:c}={}){const u=this.getStack();u&&u.promote(this,c),o&&(this.projectionDelta=void 0,this.needsReset=!0),l&&this.setOptions({transition:l})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let l=!1;const{latestValues:c}=o;if((c.z||c.rotate||c.rotateX||c.rotateY||c.rotateZ||c.skewX||c.skewY)&&(l=!0),!l)return;const u={};c.z&&Mz("z",o,u,this.animationValues);for(let d=0;d<Oz.length;d++)Mz(`rotate${Oz[d]}`,o,u,this.animationValues),Mz(`skew${Oz[d]}`,o,u,this.animationValues);o.render();for(const d in u)o.setStaticValue(d,u[d]),this.animationValues&&(this.animationValues[d]=u[d]);o.scheduleRender()}applyProjectionStyles(o,l){if(!this.instance||this.isSVG)return;if(!this.isVisible){o.visibility="hidden";return}const c=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,o.visibility="",o.opacity="",o.pointerEvents=TF(l==null?void 0:l.pointerEvents)||"",o.transform=c?c(this.latestValues,""):"none";return}const u=this.getLead();if(!this.projectionDelta||!this.layout||!u.target){this.options.layoutId&&(o.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,o.pointerEvents=TF(l==null?void 0:l.pointerEvents)||""),this.hasProjected&&!Cv(this.latestValues)&&(o.transform=c?c({},""):"none",this.hasProjected=!1);return}o.visibility="";const d=u.animationValues||u.latestValues;this.applyTransformsToTarget();let f=Tst(this.projectionDeltaWithTransform,this.treeScale,d);c&&(f=c(d,f)),o.transform=f;const{x,y:g}=this.projectionDelta;o.transformOrigin=`${x.origin*100}% ${g.origin*100}% 0`,u.animationValues?o.opacity=u===this?d.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:d.opacityExit:o.opacity=u===this?d.opacity!==void 0?d.opacity:"":d.opacityExit!==void 0?d.opacityExit:0;for(const v in k9){if(d[v]===void 0)continue;const{correct:w,applyTo:C,isCSSVariable:N}=k9[v],P=f==="none"?d[v]:w(d[v],u);if(C){const I=C.length;for(let R=0;R<I;R++)o[C[R]]=P}else N?this.options.visualElement.renderState.vars[v]=P:o[v]=P}this.options.layoutId&&(o.pointerEvents=u===this?TF(l==null?void 0:l.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(o=>{var l;return(l=o.currentAnimation)==null?void 0:l.stop()}),this.root.nodes.forEach(dhe),this.root.sharedNodes.clear()}}}function Fst(e){e.updateLayout()}function Ost(e){var n;const t=((n=e.resumeFrom)==null?void 0:n.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:s}=e.layout,{animationType:a}=e.options,o=t.source!==e.layout.source;a==="size"?kh(f=>{const x=o?t.measuredBox[f]:t.layoutBox[f],g=sd(x);x.min=r[f].min,x.max=x.min+g}):O7e(a,t.layoutBox,r)&&kh(f=>{const x=o?t.measuredBox[f]:t.layoutBox[f],g=sd(r[f]);x.max=x.min+g,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[f].max=e.relativeTarget[f].min+g)});const l=PC();Uj(l,r,t.layoutBox);const c=PC();o?Uj(c,e.applyTransform(s,!0),t.measuredBox):Uj(c,r,t.layoutBox);const u=!T7e(l);let d=!1;if(!e.resumeFrom){const f=e.getClosestProjectingParent();if(f&&!f.resumeFrom){const{snapshot:x,layout:g}=f;if(x&&g){const v=pl();zj(v,t.layoutBox,x.layoutBox);const w=pl();zj(w,r,g.layoutBox),I7e(v,w)||(d=!0),f.options.layoutRoot&&(e.relativeTarget=w,e.relativeTargetOrigin=v,e.relativeParent=f)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:t,delta:c,layoutDelta:l,hasLayoutChanged:u,hasRelativeLayoutChanged:d})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function Mst(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function Rst(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function Lst(e){e.clearSnapshot()}function dhe(e){e.clearMeasurements()}function fhe(e){e.isLayoutDirty=!1}function Dst(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function hhe(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function Bst(e){e.resolveTargetDelta()}function $st(e){e.calcProjection()}function Ust(e){e.resetSkewAndRotation()}function zst(e){e.removeLeadSnapshot()}function phe(e,t,n){e.translate=Uo(t.translate,0,n),e.scale=Uo(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function mhe(e,t,n,r){e.min=Uo(t.min,n.min,r),e.max=Uo(t.max,n.max,r)}function Hst(e,t,n,r){mhe(e.x,t.x,n.x,r),mhe(e.y,t.y,n.y,r)}function Vst(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const Wst={duration:.45,ease:[.4,0,.1,1]},xhe=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),ghe=xhe("applewebkit/")&&!xhe("chrome/")?Math.round:al;function bhe(e){e.min=ghe(e.min),e.max=ghe(e.max)}function qst(e){bhe(e.x),bhe(e.y)}function O7e(e,t,n){return e==="position"||e==="preserve-aspect"&&!Zrt(che(t),che(n),.2)}function Gst(e){var t;return e!==e.root&&((t=e.scroll)==null?void 0:t.wasRoot)}const Kst=F7e({attachResizeListener:(e,t)=>T9(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Rz={current:void 0},M7e=F7e({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Rz.current){const e=new Kst({});e.mount(window),e.setOptions({layoutScroll:!0}),Rz.current=e}return Rz.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),Yst={pan:{Feature:hst},drag:{Feature:fst,ProjectionNode:M7e,MeasureLayout:E7e}};function yhe(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const s="onHover"+n,a=r[s];a&&Po.postRender(()=>a(t,Sk(t)))}let Xst=class extends r2{mount(){const{current:t}=this.node;t&&(this.unmount=Cnt(t,(n,r)=>(yhe(this.node,r,"Start"),s=>yhe(this.node,s,"End"))))}unmount(){}},Qst=class extends r2{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=ux(T9(this.node.current,"focus",()=>this.onFocus()),T9(this.node.current,"blur",()=>this.onBlur()))}unmount(){}};function vhe(e,t,n){const{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap",n==="Start");const s="onTap"+(n==="End"?"":n),a=r[s];a&&Po.postRender(()=>a(t,Sk(t)))}let Zst=class extends r2{mount(){const{current:t}=this.node;t&&(this.unmount=jnt(t,(n,r)=>(vhe(this.node,r,"Start"),(s,{success:a})=>vhe(this.node,s,a?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}};const XQ=new WeakMap,Lz=new WeakMap,Jst=e=>{const t=XQ.get(e.target);t&&t(e)},eit=e=>{e.forEach(Jst)};function tit({root:e,...t}){const n=e||document;Lz.has(n)||Lz.set(n,{});const r=Lz.get(n),s=JSON.stringify(t);return r[s]||(r[s]=new IntersectionObserver(eit,{root:e,...t})),r[s]}function nit(e,t,n){const r=tit(t);return XQ.set(e,n),r.observe(e),()=>{XQ.delete(e),r.unobserve(e)}}const rit={some:0,all:1};let sit=class extends r2{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:s="some",once:a}=t,o={root:n?n.current:void 0,rootMargin:r,threshold:typeof s=="number"?s:rit[s]},l=c=>{const{isIntersecting:u}=c;if(this.isInView===u||(this.isInView=u,a&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);const{onViewportEnter:d,onViewportLeave:f}=this.node.getProps(),x=u?d:f;x&&x(c)};return nit(this.node.current,o,l)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(iit(t,n))&&this.startObserver()}unmount(){}};function iit({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const ait={inView:{Feature:sit},tap:{Feature:Zst},focus:{Feature:Qst},hover:{Feature:Xst}},oit={layout:{ProjectionNode:M7e,MeasureLayout:E7e}},lit={...qrt,...ait,...Yst,...oit},im=lrt(lit,wrt),whe={yellow:"bg-yellow-300",red:"bg-red-300",purple:"bg-purple-300",emerald:"bg-emerald-300",blue:"bg-sky-300",orange:"bg-orange-300"};function v0({label:e="NEW",tone:t="yellow"}){const n=whe[t]??whe.yellow;return i.jsxs("span",{className:"relative inline-flex h-4 items-center rounded-full px-2 text-[9px] font-semibold uppercase tracking-[0.08em] text-black overflow-hidden select-none ml-1 mt-[1px]",children:[i.jsx("span",{className:`absolute inset-[1px] rounded-full ${n}`}),i.jsx(im.span,{className:"absolute -inset-y-2 left-[-40%] h-[200%] w-[40%] rotate-[18deg] bg-gradient-to-r from-transparent via-white/70 to-transparent opacity-80",animate:{x:["0%","300%"]},transition:{duration:3.2,ease:"linear",repeat:1/0}}),i.jsx("span",{className:"relative z-10",children:e})]})}function cit({label:e,items:t=[],activePaths:n=[],badgeLabel:r,badgeTone:s="yellow",align:a="left"}){var d;const{pathname:o}=oc(),l=(d=n==null?void 0:n.some)==null?void 0:d.call(n,f=>o.startsWith(f)),c=a==="right"?"right-0":"left-0",u=f=>{if(!f)return null;if(typeof f=="string")return i.jsx("img",{src:f,alt:"",className:"w-4 h-4 object-contain shrink-0",loading:"lazy"});if(Ae.isValidElement(f))return f;if(typeof f=="function"){const x=f;return i.jsx(x,{className:"w-4 h-4 shrink-0"})}return null};return i.jsxs(MD,{as:"div",className:"relative hidden sm:inline-block text-left",children:[i.jsxs(FD,{className:`${l?"bg-[#232323]":"bg-transparent"} h-8 px-2 py-2 hover:bg-[#232323] rounded-[256px] inline-flex items-center focus:outline-none focus:ring-0`,children:[i.jsx("div",{className:"text-white text-[13px] font-semibold font-manrope leading-none",children:e}),r?i.jsx(v0,{label:r,tone:s}):null,i.jsx(A9,{"aria-hidden":"true",className:"-mr-1 size-5 text-gray-400"})]}),i.jsx(OD,{transition:!0,className:`absolute ${c} z-50 mt-1 origin-top-right ring-1 ring-black/5 transition focus:outline-none data-[closed]:scale-95 data-[closed]:transform data-[closed]:opacity-0 data-[enter]:duration-100 data-[leave]:duration-75 data-[enter]:ease-out data-[leave]:ease-in w-max min-w-[220px] bg-[#1A1A1A] rounded-2xl shadow border border-[#242424]`,children:i.jsx("div",{className:"flex flex-col items-start gap-1.5 p-1.5",children:t.map((f,x)=>{if(f.flyout&&f.submenu)return i.jsxs(EC,{as:"div",className:"relative group w-full",children:[i.jsxs("div",{className:"w-full p-2.5 hover:bg-[#111111] rounded-2xl flex justify-between items-center cursor-pointer",children:[i.jsx("span",{className:"text-white text-[13px] font-semibold font-manrope",children:f.label}),i.jsx(A9,{className:"size-4 -rotate-90 text-gray-400"})]}),i.jsx("div",{className:"absolute top-0 left-full hidden group-hover:block z-50 px-2",children:i.jsx("div",{className:"min-w-[220px] bg-[#1A1A1A] rounded-2xl shadow border border-[#242424] p-1.5",children:f.submenu.map((v,w)=>v.to?i.jsx(Ide,{to:v.to,className:"w-full p-2.5 hover:bg-[#111111] rounded-2xl flex justify-between items-center",children:i.jsx("span",{className:"text-white text-[13px] font-semibold font-manrope",children:v.label})},`sub-to-${w}`):i.jsxs("button",{onClick:v.onClick,className:"w-full p-2.5 hover:bg-[#111111] rounded-2xl flex justify-start items-center",children:[i.jsx("span",{className:"text-white text-[13px] font-semibold font-manrope",children:v.label}),v.badge&&i.jsx(v0,{tone:"emerald",label:v.badge})]},`sub-btn-${w}`))})})]},`flyout-${x}`);const g=()=>i.jsx("div",{className:"flex justify-between items-center gap-6 w-full",children:i.jsxs("div",{className:"text-white text-[13px] font-semibold font-manrope flex items-center gap-2",children:[u(f.icon),f.label,f.badge&&i.jsx(v0,{tone:"emerald",label:f.badge})]})});return f.to?i.jsx(EC,{children:i.jsx(Ide,{to:f.to,className:"w-full p-2.5 hover:bg-[#111111] rounded-2xl block",children:i.jsx(g,{})})},`to-${f.to}-${x}`):f.href?i.jsx(EC,{children:i.jsx("a",{href:f.href,target:f.external?"_blank":void 0,rel:f.external?"noreferrer":void 0,className:"w-full p-2.5 hover:bg-[#111111] rounded-2xl block",children:i.jsx(g,{})})},`href-${f.href}-${x}`):i.jsx(EC,{children:i.jsx("button",{className:"w-full p-2.5 hover:bg-[#111111] rounded-2xl",onClick:f.onClick,children:i.jsx(g,{})})},`btn-${x}`)})})})]})}const Mg=({className:e})=>i.jsxs("svg",{viewBox:"0 0 53 96",fill:"currentColor",stroke:"currentColor",xmlns:"http://www.w3.org/2000/svg",className:`size-full ${e}`,children:[i.jsx("path",{d:"M23 76.3751L0 96V20.687L23 0V76.3751Z"}),i.jsx("path",{d:"M53 76.4219L30 96V66.6279L53 46V76.4219Z"})]}),uit=[{type:"link",label:"Terminal",to:"/terminal/BTC"},{type:"dropdown",label:"Copy Trade",activePaths:["/copy-trade","/wallet-management","/discover-wallets","/hyperliquid-vaults","/back-testing","/hyperliquid-whale-trades","/hyperliquid-fee-calculator"],items:[{label:"Discover Wallets",to:"/discover-wallets"},{label:"My Copy Trading",to:"/copy-trade"},{label:"Wallet Management",to:"/wallet-management"},{label:"Discover Vaults",to:"/hyperliquid-vaults"},{label:"Backtest",to:"/back-testing"},{label:"Whale Trades",to:"/hyperliquid-whale-trades"},{label:"HL Fee Calculator",to:"/hyperliquid-fee-calculator"},{label:"Ticker",to:"ticker"}]},{type:"dropdown",label:"Leaderboard",activePaths:["/leaderboard","/referral"],items:[{label:"Leaderboard",to:"/leaderboard"},{label:"Referral",to:"/referral"}]},{type:"dropdown",label:"Tracker",activePaths:["/tracked-wallets","/tracker"],items:[{label:"Tracked Wallets",to:"/tracked-wallets"},{label:"My Activities",to:"/tracker"}]},{type:"dropdown",label:"Trading Bots",activePaths:[""],badgeTone:"yellow",items:[{label:"Extended Grid Bot",to:"/terminal/extended/BTC#gridbot",icon:"https://app.extended.exchange/assets/logo/extended.svg"},{label:"Extended DCA Bot",to:"/dca-bot",icon:"https://app.extended.exchange/assets/logo/extended.svg"},{label:"Extended Farming",action:"openExtended",badge:"SMART",icon:"https://app.extended.exchange/assets/logo/extended.svg"},{label:"Lighter Grid Bot",to:"/terminal/lighter/BTC#gridbot",icon:Mg},{label:"HL Grid Bot",to:"/terminal/hyperliquid/BTC#gridbot",icon:"https://app.hyperliquid.xyz/coins/HYPE.svg"},{label:"HL Market Maker Bot",to:"/market-maker",icon:"https://app.hyperliquid.xyz/coins/HYPE.svg"},{label:"Farming Bots",flyout:!0,submenu:[{label:"Aster Farming",action:"openAster"},{label:"BasedApp Farming",action:"openFarm"},{label:"Lighter Farming",action:"openLighter"},{label:"Apex Farming",action:"openApex"},{label:"Variational Farming",action:"openVariational"},{label:"Paradex Farming",action:"openParadex"},{label:"Pacifica Farming",action:"openPacifica"}]}]}];function h3(e){"@babel/helpers - typeof";return h3=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},h3(e)}function dit(e,t){if(h3(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(h3(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function R7e(e){var t=dit(e,"string");return h3(t)=="symbol"?t:t+""}function cj(e,t,n){return(t=R7e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Che(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function Ks(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Che(Object(n),!0).forEach(function(r){cj(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Che(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function fit(e){if(Array.isArray(e))return e}function hit(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,s,a,o,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(d){u=!0,s=d}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw s}}return l}}function QQ(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function L7e(e,t){if(e){if(typeof e=="string")return QQ(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?QQ(e,t):void 0}}function pit(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Hg(e,t){return fit(e)||hit(e,t)||L7e(e,t)||pit()}function mit(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.includes(r))continue;n[r]=e[r]}return n}function w1(e,t){if(e==null)return{};var n,r,s=mit(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.includes(n)||{}.propertyIsEnumerable.call(e,n)&&(s[n]=e[n])}return s}var xit=["defaultInputValue","defaultMenuIsOpen","defaultValue","inputValue","menuIsOpen","onChange","onInputChange","onMenuClose","onMenuOpen","value"];function git(e){var t=e.defaultInputValue,n=t===void 0?"":t,r=e.defaultMenuIsOpen,s=r===void 0?!1:r,a=e.defaultValue,o=a===void 0?null:a,l=e.inputValue,c=e.menuIsOpen,u=e.onChange,d=e.onInputChange,f=e.onMenuClose,x=e.onMenuOpen,g=e.value,v=w1(e,xit),w=m.useState(l!==void 0?l:n),C=Hg(w,2),N=C[0],P=C[1],I=m.useState(c!==void 0?c:s),R=Hg(I,2),F=R[0],U=R[1],L=m.useState(g!==void 0?g:o),z=Hg(L,2),Q=z[0],ne=z[1],J=m.useCallback(function(G,V){typeof u=="function"&&u(G,V),ne(G)},[u]),X=m.useCallback(function(G,V){var ee;typeof d=="function"&&(ee=d(G,V)),P(ee!==void 0?ee:G)},[d]),re=m.useCallback(function(){typeof x=="function"&&x(),U(!0)},[x]),pe=m.useCallback(function(){typeof f=="function"&&f(),U(!1)},[f]),Y=l!==void 0?l:N,ie=c!==void 0?c:F,oe=g!==void 0?g:Q;return Ks(Ks({},v),{},{inputValue:Y,menuIsOpen:ie,onChange:J,onInputChange:X,onMenuClose:pe,onMenuOpen:re,value:oe})}function ti(){return ti=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ti.apply(null,arguments)}function bit(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function She(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,R7e(r.key),r)}}function yit(e,t,n){return She(e.prototype,t),She(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function ZQ(e,t){return ZQ=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},ZQ(e,t)}function vit(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&&ZQ(e,t)}function YO(e){return YO=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},YO(e)}function D7e(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(D7e=function(){return!!e})()}function wit(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Cit(e,t){if(t&&(h3(t)=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return wit(e)}function Sit(e){var t=D7e();return function(){var n,r=YO(e);if(t){var s=YO(this).constructor;n=Reflect.construct(r,arguments,s)}else n=r.apply(this,arguments);return Cit(this,n)}}function Nit(e){if(Array.isArray(e))return QQ(e)}function Ait(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function jit(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Dse(e){return Nit(e)||Ait(e)||L7e(e)||jit()}function Eit(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}function _it(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),e.nonce!==void 0&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}var kit=function(){function e(n){var r=this;this._insertTag=function(s){var a;r.tags.length===0?r.insertionPoint?a=r.insertionPoint.nextSibling:r.prepend?a=r.container.firstChild:a=r.before:a=r.tags[r.tags.length-1].nextSibling,r.container.insertBefore(s,a),r.tags.push(s)},this.isSpeedy=n.speedy===void 0?!0:n.speedy,this.tags=[],this.ctr=0,this.nonce=n.nonce,this.key=n.key,this.container=n.container,this.prepend=n.prepend,this.insertionPoint=n.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(r){r.forEach(this._insertTag)},t.insert=function(r){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(_it(this));var s=this.tags[this.tags.length-1];if(this.isSpeedy){var a=Eit(s);try{a.insertRule(r,a.cssRules.length)}catch{}}else s.appendChild(document.createTextNode(r));this.ctr++},t.flush=function(){this.tags.forEach(function(r){var s;return(s=r.parentNode)==null?void 0:s.removeChild(r)}),this.tags=[],this.ctr=0},e}(),mu="-ms-",XO="-moz-",va="-webkit-",B7e="comm",Bse="rule",$se="decl",Tit="@import",$7e="@keyframes",Iit="@layer",Pit=Math.abs,HD=String.fromCharCode,Fit=Object.assign;function Oit(e,t){return Xc(e,0)^45?(((t<<2^Xc(e,0))<<2^Xc(e,1))<<2^Xc(e,2))<<2^Xc(e,3):0}function U7e(e){return e.trim()}function Mit(e,t){return(e=t.exec(e))?e[0]:e}function wa(e,t,n){return e.replace(t,n)}function JQ(e,t){return e.indexOf(t)}function Xc(e,t){return e.charCodeAt(t)|0}function I9(e,t,n){return e.slice(t,n)}function x0(e){return e.length}function Use(e){return e.length}function _I(e,t){return t.push(e),e}function Rit(e,t){return e.map(t).join("")}var VD=1,TS=1,z7e=0,of=0,$l=0,fA="";function WD(e,t,n,r,s,a,o){return{value:e,root:t,parent:n,type:r,props:s,children:a,line:VD,column:TS,length:o,return:""}}function h7(e,t){return Fit(WD("",null,null,"",null,null,0),e,{length:-e.length},t)}function Lit(){return $l}function Dit(){return $l=of>0?Xc(fA,--of):0,TS--,$l===10&&(TS=1,VD--),$l}function zf(){return $l=of<z7e?Xc(fA,of++):0,TS++,$l===10&&(TS=1,VD++),$l}function R0(){return Xc(fA,of)}function PF(){return of}function Nk(e,t){return I9(fA,e,t)}function P9(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function H7e(e){return VD=TS=1,z7e=x0(fA=e),of=0,[]}function V7e(e){return fA="",e}function FF(e){return U7e(Nk(of-1,eZ(e===91?e+2:e===40?e+1:e)))}function Bit(e){for(;($l=R0())&&$l<33;)zf();return P9(e)>2||P9($l)>3?"":" "}function $it(e,t){for(;--t&&zf()&&!($l<48||$l>102||$l>57&&$l<65||$l>70&&$l<97););return Nk(e,PF()+(t<6&&R0()==32&&zf()==32))}function eZ(e){for(;zf();)switch($l){case e:return of;case 34:case 39:e!==34&&e!==39&&eZ($l);break;case 40:e===41&&eZ(e);break;case 92:zf();break}return of}function Uit(e,t){for(;zf()&&e+$l!==57;)if(e+$l===84&&R0()===47)break;return"/*"+Nk(t,of-1)+"*"+HD(e===47?e:zf())}function zit(e){for(;!P9(R0());)zf();return Nk(e,of)}function Hit(e){return V7e(OF("",null,null,null,[""],e=H7e(e),0,[0],e))}function OF(e,t,n,r,s,a,o,l,c){for(var u=0,d=0,f=o,x=0,g=0,v=0,w=1,C=1,N=1,P=0,I="",R=s,F=a,U=r,L=I;C;)switch(v=P,P=zf()){case 40:if(v!=108&&Xc(L,f-1)==58){JQ(L+=wa(FF(P),"&","&\f"),"&\f")!=-1&&(N=-1);break}case 34:case 39:case 91:L+=FF(P);break;case 9:case 10:case 13:case 32:L+=Bit(v);break;case 92:L+=$it(PF()-1,7);continue;case 47:switch(R0()){case 42:case 47:_I(Vit(Uit(zf(),PF()),t,n),c);break;default:L+="/"}break;case 123*w:l[u++]=x0(L)*N;case 125*w:case 59:case 0:switch(P){case 0:case 125:C=0;case 59+d:N==-1&&(L=wa(L,/\f/g,"")),g>0&&x0(L)-f&&_I(g>32?Ahe(L+";",r,n,f-1):Ahe(wa(L," ","")+";",r,n,f-2),c);break;case 59:L+=";";default:if(_I(U=Nhe(L,t,n,u,d,s,l,I,R=[],F=[],f),a),P===123)if(d===0)OF(L,t,U,U,R,a,f,l,F);else switch(x===99&&Xc(L,3)===110?100:x){case 100:case 108:case 109:case 115:OF(e,U,U,r&&_I(Nhe(e,U,U,0,0,s,l,I,s,R=[],f),F),s,F,f,l,r?R:F);break;default:OF(L,U,U,U,[""],F,0,l,F)}}u=d=g=0,w=N=1,I=L="",f=o;break;case 58:f=1+x0(L),g=v;default:if(w<1){if(P==123)--w;else if(P==125&&w++==0&&Dit()==125)continue}switch(L+=HD(P),P*w){case 38:N=d>0?1:(L+="\f",-1);break;case 44:l[u++]=(x0(L)-1)*N,N=1;break;case 64:R0()===45&&(L+=FF(zf())),x=R0(),d=f=x0(I=L+=zit(PF())),P++;break;case 45:v===45&&x0(L)==2&&(w=0)}}return a}function Nhe(e,t,n,r,s,a,o,l,c,u,d){for(var f=s-1,x=s===0?a:[""],g=Use(x),v=0,w=0,C=0;v<r;++v)for(var N=0,P=I9(e,f+1,f=Pit(w=o[v])),I=e;N<g;++N)(I=U7e(w>0?x[N]+" "+P:wa(P,/&\f/g,x[N])))&&(c[C++]=I);return WD(e,t,n,s===0?Bse:l,c,u,d)}function Vit(e,t,n){return WD(e,t,n,B7e,HD(Lit()),I9(e,2,-2),0)}function Ahe(e,t,n,r){return WD(e,t,n,$se,I9(e,0,r),I9(e,r+1,-1),r)}function QC(e,t){for(var n="",r=Use(e),s=0;s<r;s++)n+=t(e[s],s,e,t)||"";return n}function Wit(e,t,n,r){switch(e.type){case Iit:if(e.children.length)break;case Tit:case $se:return e.return=e.return||e.value;case B7e:return"";case $7e:return e.return=e.value+"{"+QC(e.children,r)+"}";case Bse:e.value=e.props.join(",")}return x0(n=QC(e.children,r))?e.return=e.value+"{"+n+"}":""}function qit(e){var t=Use(e);return function(n,r,s,a){for(var o="",l=0;l<t;l++)o+=e[l](n,r,s,a)||"";return o}}function Git(e){return function(t){t.root||(t=t.return)&&e(t)}}function Kit(e){var t=Object.create(null);return function(n){return t[n]===void 0&&(t[n]=e(n)),t[n]}}var Yit=function(t,n,r){for(var s=0,a=0;s=a,a=R0(),s===38&&a===12&&(n[r]=1),!P9(a);)zf();return Nk(t,of)},Xit=function(t,n){var r=-1,s=44;do switch(P9(s)){case 0:s===38&&R0()===12&&(n[r]=1),t[r]+=Yit(of-1,n,r);break;case 2:t[r]+=FF(s);break;case 4:if(s===44){t[++r]=R0()===58?"&\f":"",n[r]=t[r].length;break}default:t[r]+=HD(s)}while(s=zf());return t},Qit=function(t,n){return V7e(Xit(H7e(t),n))},jhe=new WeakMap,Zit=function(t){if(!(t.type!=="rule"||!t.parent||t.length<1)){for(var n=t.value,r=t.parent,s=t.column===r.column&&t.line===r.line;r.type!=="rule";)if(r=r.parent,!r)return;if(!(t.props.length===1&&n.charCodeAt(0)!==58&&!jhe.get(r))&&!s){jhe.set(t,!0);for(var a=[],o=Qit(n,a),l=r.props,c=0,u=0;c<o.length;c++)for(var d=0;d<l.length;d++,u++)t.props[u]=a[c]?o[c].replace(/&\f/g,l[d]):l[d]+" "+o[c]}}},Jit=function(t){if(t.type==="decl"){var n=t.value;n.charCodeAt(0)===108&&n.charCodeAt(2)===98&&(t.return="",t.value="")}};function W7e(e,t){switch(Oit(e,t)){case 5103:return va+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return va+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return va+e+XO+e+mu+e+e;case 6828:case 4268:return va+e+mu+e+e;case 6165:return va+e+mu+"flex-"+e+e;case 5187:return va+e+wa(e,/(\w+).+(:[^]+)/,va+"box-$1$2"+mu+"flex-$1$2")+e;case 5443:return va+e+mu+"flex-item-"+wa(e,/flex-|-self/,"")+e;case 4675:return va+e+mu+"flex-line-pack"+wa(e,/align-content|flex-|-self/,"")+e;case 5548:return va+e+mu+wa(e,"shrink","negative")+e;case 5292:return va+e+mu+wa(e,"basis","preferred-size")+e;case 6060:return va+"box-"+wa(e,"-grow","")+va+e+mu+wa(e,"grow","positive")+e;case 4554:return va+wa(e,/([^-])(transform)/g,"$1"+va+"$2")+e;case 6187:return wa(wa(wa(e,/(zoom-|grab)/,va+"$1"),/(image-set)/,va+"$1"),e,"")+e;case 5495:case 3959:return wa(e,/(image-set\([^]*)/,va+"$1$`$1");case 4968:return wa(wa(e,/(.+:)(flex-)?(.*)/,va+"box-pack:$3"+mu+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+va+e+e;case 4095:case 3583:case 4068:case 2532:return wa(e,/(.+)-inline(.+)/,va+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(x0(e)-1-t>6)switch(Xc(e,t+1)){case 109:if(Xc(e,t+4)!==45)break;case 102:return wa(e,/(.+:)(.+)-([^]+)/,"$1"+va+"$2-$3$1"+XO+(Xc(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~JQ(e,"stretch")?W7e(wa(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(Xc(e,t+1)!==115)break;case 6444:switch(Xc(e,x0(e)-3-(~JQ(e,"!important")&&10))){case 107:return wa(e,":",":"+va)+e;case 101:return wa(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+va+(Xc(e,14)===45?"inline-":"")+"box$3$1"+va+"$2$3$1"+mu+"$2box$3")+e}break;case 5936:switch(Xc(e,t+11)){case 114:return va+e+mu+wa(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return va+e+mu+wa(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return va+e+mu+wa(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return va+e+mu+e+e}return e}var eat=function(t,n,r,s){if(t.length>-1&&!t.return)switch(t.type){case $se:t.return=W7e(t.value,t.length);break;case $7e:return QC([h7(t,{value:wa(t.value,"@","@"+va)})],s);case Bse:if(t.length)return Rit(t.props,function(a){switch(Mit(a,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return QC([h7(t,{props:[wa(a,/:(read-\w+)/,":"+XO+"$1")]})],s);case"::placeholder":return QC([h7(t,{props:[wa(a,/:(plac\w+)/,":"+va+"input-$1")]}),h7(t,{props:[wa(a,/:(plac\w+)/,":"+XO+"$1")]}),h7(t,{props:[wa(a,/:(plac\w+)/,mu+"input-$1")]})],s)}return""})}},tat=[eat],nat=function(t){var n=t.key;if(n==="css"){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(r,function(w){var C=w.getAttribute("data-emotion");C.indexOf(" ")!==-1&&(document.head.appendChild(w),w.setAttribute("data-s",""))})}var s=t.stylisPlugins||tat,a={},o,l=[];o=t.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+n+' "]'),function(w){for(var C=w.getAttribute("data-emotion").split(" "),N=1;N<C.length;N++)a[C[N]]=!0;l.push(w)});var c,u=[Zit,Jit];{var d,f=[Wit,Git(function(w){d.insert(w)})],x=qit(u.concat(s,f)),g=function(C){return QC(Hit(C),x)};c=function(C,N,P,I){d=P,g(C?C+"{"+N.styles+"}":N.styles),I&&(v.inserted[N.name]=!0)}}var v={key:n,sheet:new kit({key:n,container:o,nonce:t.nonce,speedy:t.speedy,prepend:t.prepend,insertionPoint:t.insertionPoint}),nonce:t.nonce,inserted:a,registered:{},insert:c};return v.sheet.hydrate(l),v},Dz={exports:{}},Ta={};/** @license React v16.13.1
* react-is.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var Ehe;function rat(){if(Ehe)return Ta;Ehe=1;var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,s=e?Symbol.for("react.strict_mode"):60108,a=e?Symbol.for("react.profiler"):60114,o=e?Symbol.for("react.provider"):60109,l=e?Symbol.for("react.context"):60110,c=e?Symbol.for("react.async_mode"):60111,u=e?Symbol.for("react.concurrent_mode"):60111,d=e?Symbol.for("react.forward_ref"):60112,f=e?Symbol.for("react.suspense"):60113,x=e?Symbol.for("react.suspense_list"):60120,g=e?Symbol.for("react.memo"):60115,v=e?Symbol.for("react.lazy"):60116,w=e?Symbol.for("react.block"):60121,C=e?Symbol.for("react.fundamental"):60117,N=e?Symbol.for("react.responder"):60118,P=e?Symbol.for("react.scope"):60119;function I(F){if(typeof F=="object"&&F!==null){var U=F.$$typeof;switch(U){case t:switch(F=F.type,F){case c:case u:case r:case a:case s:case f:return F;default:switch(F=F&&F.$$typeof,F){case l:case d:case v:case g:case o:return F;default:return U}}case n:return U}}}function R(F){return I(F)===u}return Ta.AsyncMode=c,Ta.ConcurrentMode=u,Ta.ContextConsumer=l,Ta.ContextProvider=o,Ta.Element=t,Ta.ForwardRef=d,Ta.Fragment=r,Ta.Lazy=v,Ta.Memo=g,Ta.Portal=n,Ta.Profiler=a,Ta.StrictMode=s,Ta.Suspense=f,Ta.isAsyncMode=function(F){return R(F)||I(F)===c},Ta.isConcurrentMode=R,Ta.isContextConsumer=function(F){return I(F)===l},Ta.isContextProvider=function(F){return I(F)===o},Ta.isElement=function(F){return typeof F=="object"&&F!==null&&F.$$typeof===t},Ta.isForwardRef=function(F){return I(F)===d},Ta.isFragment=function(F){return I(F)===r},Ta.isLazy=function(F){return I(F)===v},Ta.isMemo=function(F){return I(F)===g},Ta.isPortal=function(F){return I(F)===n},Ta.isProfiler=function(F){return I(F)===a},Ta.isStrictMode=function(F){return I(F)===s},Ta.isSuspense=function(F){return I(F)===f},Ta.isValidElementType=function(F){return typeof F=="string"||typeof F=="function"||F===r||F===u||F===a||F===s||F===f||F===x||typeof F=="object"&&F!==null&&(F.$$typeof===v||F.$$typeof===g||F.$$typeof===o||F.$$typeof===l||F.$$typeof===d||F.$$typeof===C||F.$$typeof===N||F.$$typeof===P||F.$$typeof===w)},Ta.typeOf=I,Ta}var _he;function sat(){return _he||(_he=1,Dz.exports=rat()),Dz.exports}var Bz,khe;function iat(){if(khe)return Bz;khe=1;var e=sat(),t={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},n={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},r={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},s={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},a={};a[e.ForwardRef]=r,a[e.Memo]=s;function o(v){return e.isMemo(v)?s:a[v.$$typeof]||t}var l=Object.defineProperty,c=Object.getOwnPropertyNames,u=Object.getOwnPropertySymbols,d=Object.getOwnPropertyDescriptor,f=Object.getPrototypeOf,x=Object.prototype;function g(v,w,C){if(typeof w!="string"){if(x){var N=f(w);N&&N!==x&&g(v,N,C)}var P=c(w);u&&(P=P.concat(u(w)));for(var I=o(v),R=o(w),F=0;F<P.length;++F){var U=P[F];if(!n[U]&&!(C&&C[U])&&!(R&&R[U])&&!(I&&I[U])){var L=d(w,U);try{l(v,U,L)}catch{}}}}return v}return Bz=g,Bz}iat();var aat=!0;function oat(e,t,n){var r="";return n.split(" ").forEach(function(s){e[s]!==void 0?t.push(e[s]+";"):s&&(r+=s+" ")}),r}var q7e=function(t,n,r){var s=t.key+"-"+n.name;(r===!1||aat===!1)&&t.registered[s]===void 0&&(t.registered[s]=n.styles)},lat=function(t,n,r){q7e(t,n,r);var s=t.key+"-"+n.name;if(t.inserted[n.name]===void 0){var a=n;do t.insert(n===a?"."+s:"",a,t.sheet,!0),a=a.next;while(a!==void 0)}};function cat(e){for(var t=0,n,r=0,s=e.length;s>=4;++r,s-=4)n=e.charCodeAt(r)&255|(e.charCodeAt(++r)&255)<<8|(e.charCodeAt(++r)&255)<<16|(e.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,t=(n&65535)*1540483477+((n>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(s){case 3:t^=(e.charCodeAt(r+2)&255)<<16;case 2:t^=(e.charCodeAt(r+1)&255)<<8;case 1:t^=e.charCodeAt(r)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}var uat={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},dat=/[A-Z]|^ms/g,fat=/_EMO_([^_]+?)_([^]*?)_EMO_/g,G7e=function(t){return t.charCodeAt(1)===45},The=function(t){return t!=null&&typeof t!="boolean"},$z=Kit(function(e){return G7e(e)?e:e.replace(dat,"-$&").toLowerCase()}),Ihe=function(t,n){switch(t){case"animation":case"animationName":if(typeof n=="string")return n.replace(fat,function(r,s,a){return g0={name:s,styles:a,next:g0},s})}return uat[t]!==1&&!G7e(t)&&typeof n=="number"&&n!==0?n+"px":n};function F9(e,t,n){if(n==null)return"";var r=n;if(r.__emotion_styles!==void 0)return r;switch(typeof n){case"boolean":return"";case"object":{var s=n;if(s.anim===1)return g0={name:s.name,styles:s.styles,next:g0},s.name;var a=n;if(a.styles!==void 0){var o=a.next;if(o!==void 0)for(;o!==void 0;)g0={name:o.name,styles:o.styles,next:g0},o=o.next;var l=a.styles+";";return l}return hat(e,t,n)}case"function":{if(e!==void 0){var c=g0,u=n(e);return g0=c,F9(e,t,u)}break}}var d=n;return d}function hat(e,t,n){var r="";if(Array.isArray(n))for(var s=0;s<n.length;s++)r+=F9(e,t,n[s])+";";else for(var a in n){var o=n[a];if(typeof o!="object"){var l=o;The(l)&&(r+=$z(a)+":"+Ihe(a,l)+";")}else if(Array.isArray(o)&&typeof o[0]=="string"&&t==null)for(var c=0;c<o.length;c++)The(o[c])&&(r+=$z(a)+":"+Ihe(a,o[c])+";");else{var u=F9(e,t,o);switch(a){case"animation":case"animationName":{r+=$z(a)+":"+u+";";break}default:r+=a+"{"+u+"}"}}}return r}var Phe=/label:\s*([^\s;{]+)\s*(;|$)/g,g0;function K7e(e,t,n){if(e.length===1&&typeof e[0]=="object"&&e[0]!==null&&e[0].styles!==void 0)return e[0];var r=!0,s="";g0=void 0;var a=e[0];if(a==null||a.raw===void 0)r=!1,s+=F9(n,t,a);else{var o=a;s+=o[0]}for(var l=1;l<e.length;l++)if(s+=F9(n,t,e[l]),r){var c=a;s+=c[l]}Phe.lastIndex=0;for(var u="",d;(d=Phe.exec(s))!==null;)u+="-"+d[1];var f=cat(s)+u;return{name:f,styles:s,next:g0}}var pat=function(t){return t()},mat=Iy.useInsertionEffect?Iy.useInsertionEffect:!1,xat=mat||pat,Y7e=m.createContext(typeof HTMLElement<"u"?nat({key:"css"}):null);Y7e.Provider;var gat=function(t){return m.forwardRef(function(n,r){var s=m.useContext(Y7e);return t(n,s,r)})},bat=m.createContext({}),zse={}.hasOwnProperty,tZ="__EMOTION_TYPE_PLEASE_DO_NOT_USE__",yat=function(t,n){var r={};for(var s in n)zse.call(n,s)&&(r[s]=n[s]);return r[tZ]=t,r},vat=function(t){var n=t.cache,r=t.serialized,s=t.isStringTag;return q7e(n,r,s),xat(function(){return lat(n,r,s)}),null},wat=gat(function(e,t,n){var r=e.css;typeof r=="string"&&t.registered[r]!==void 0&&(r=t.registered[r]);var s=e[tZ],a=[r],o="";typeof e.className=="string"?o=oat(t.registered,a,e.className):e.className!=null&&(o=e.className+" ");var l=K7e(a,void 0,m.useContext(bat));o+=t.key+"-"+l.name;var c={};for(var u in e)zse.call(e,u)&&u!=="css"&&u!==tZ&&(c[u]=e[u]);return c.className=o,n&&(c.ref=n),m.createElement(m.Fragment,null,m.createElement(vat,{cache:t,serialized:l,isStringTag:typeof s=="string"}),m.createElement(s,c))}),Cat=wat,Vs=function(t,n){var r=arguments;if(n==null||!zse.call(n,"css"))return m.createElement.apply(void 0,r);var s=r.length,a=new Array(s);a[0]=Cat,a[1]=yat(t,n);for(var o=2;o<s;o++)a[o]=r[o];return m.createElement.apply(null,a)};(function(e){var t;t||(t=e.JSX||(e.JSX={}))})(Vs);function Hse(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return K7e(t)}function Sat(){var e=Hse.apply(void 0,arguments),t="animation-"+e.name;return{name:t,styles:"@keyframes "+t+"{"+e.styles+"}",anim:1,toString:function(){return"_EMO_"+this.name+"_"+this.styles+"_EMO_"}}}function Nat(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}const Aat=Math.min,jat=Math.max,QO=Math.round,kI=Math.floor,ZO=e=>({x:e,y:e});function qD(){return typeof window<"u"}function X7e(e){return Z7e(e)?(e.nodeName||"").toLowerCase():"#document"}function r1(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Q7e(e){var t;return(t=(Z7e(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Z7e(e){return qD()?e instanceof Node||e instanceof r1(e).Node:!1}function Eat(e){return qD()?e instanceof Element||e instanceof r1(e).Element:!1}function Vse(e){return qD()?e instanceof HTMLElement||e instanceof r1(e).HTMLElement:!1}function Fhe(e){return!qD()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof r1(e).ShadowRoot}function J7e(e){const{overflow:t,overflowX:n,overflowY:r,display:s}=Wse(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(s)}function _at(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function kat(e){return["html","body","#document"].includes(X7e(e))}function Wse(e){return r1(e).getComputedStyle(e)}function Tat(e){if(X7e(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Fhe(e)&&e.host||Q7e(e);return Fhe(t)?t.host:t}function eje(e){const t=Tat(e);return kat(t)?e.ownerDocument?e.ownerDocument.body:e.body:Vse(t)&&J7e(t)?t:eje(t)}function JO(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const s=eje(e),a=s===((r=e.ownerDocument)==null?void 0:r.body),o=r1(s);if(a){const l=nZ(o);return t.concat(o,o.visualViewport||[],J7e(s)?s:[],l&&n?JO(l):[])}return t.concat(s,JO(s,[],n))}function nZ(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Iat(e){const t=Wse(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const s=Vse(e),a=s?e.offsetWidth:n,o=s?e.offsetHeight:r,l=QO(n)!==a||QO(r)!==o;return l&&(n=a,r=o),{width:n,height:r,$:l}}function qse(e){return Eat(e)?e:e.contextElement}function Ohe(e){const t=qse(e);if(!Vse(t))return ZO(1);const n=t.getBoundingClientRect(),{width:r,height:s,$:a}=Iat(t);let o=(a?QO(n.width):n.width)/r,l=(a?QO(n.height):n.height)/s;return(!o||!Number.isFinite(o))&&(o=1),(!l||!Number.isFinite(l))&&(l=1),{x:o,y:l}}const Pat=ZO(0);function Fat(e){const t=r1(e);return!_at()||!t.visualViewport?Pat:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Oat(e,t,n){return!1}function Mhe(e,t,n,r){t===void 0&&(t=!1);const s=e.getBoundingClientRect(),a=qse(e);let o=ZO(1);t&&(o=Ohe(e));const l=Oat()?Fat(a):ZO(0);let c=(s.left+l.x)/o.x,u=(s.top+l.y)/o.y,d=s.width/o.x,f=s.height/o.y;if(a){const x=r1(a),g=r;let v=x,w=nZ(v);for(;w&&r&&g!==v;){const C=Ohe(w),N=w.getBoundingClientRect(),P=Wse(w),I=N.left+(w.clientLeft+parseFloat(P.paddingLeft))*C.x,R=N.top+(w.clientTop+parseFloat(P.paddingTop))*C.y;c*=C.x,u*=C.y,d*=C.x,f*=C.y,c+=I,u+=R,v=r1(w),w=nZ(v)}}return N9({width:d,height:f,x:c,y:u})}function tje(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Mat(e,t){let n=null,r;const s=Q7e(e);function a(){var l;clearTimeout(r),(l=n)==null||l.disconnect(),n=null}function o(l,c){l===void 0&&(l=!1),c===void 0&&(c=1),a();const u=e.getBoundingClientRect(),{left:d,top:f,width:x,height:g}=u;if(l||t(),!x||!g)return;const v=kI(f),w=kI(s.clientWidth-(d+x)),C=kI(s.clientHeight-(f+g)),N=kI(d),I={rootMargin:-v+"px "+-w+"px "+-C+"px "+-N+"px",threshold:jat(0,Aat(1,c))||1};let R=!0;function F(U){const L=U[0].intersectionRatio;if(L!==c){if(!R)return o();L?o(!1,L):r=setTimeout(()=>{o(!1,1e-7)},1e3)}L===1&&!tje(u,e.getBoundingClientRect())&&o(),R=!1}try{n=new IntersectionObserver(F,{...I,root:s.ownerDocument})}catch{n=new IntersectionObserver(F,I)}n.observe(e)}return o(!0),a}function Rat(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:s=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,u=qse(e),d=s||a?[...u?JO(u):[],...JO(t)]:[];d.forEach(N=>{s&&N.addEventListener("scroll",n,{passive:!0}),a&&N.addEventListener("resize",n)});const f=u&&l?Mat(u,n):null;let x=-1,g=null;o&&(g=new ResizeObserver(N=>{let[P]=N;P&&P.target===u&&g&&(g.unobserve(t),cancelAnimationFrame(x),x=requestAnimationFrame(()=>{var I;(I=g)==null||I.observe(t)})),n()}),u&&!c&&g.observe(u),g.observe(t));let v,w=c?Mhe(e):null;c&&C();function C(){const N=Mhe(e);w&&!tje(w,N)&&n(),w=N,v=requestAnimationFrame(C)}return n(),()=>{var N;d.forEach(P=>{s&&P.removeEventListener("scroll",n),a&&P.removeEventListener("resize",n)}),f==null||f(),(N=g)==null||N.disconnect(),g=null,c&&cancelAnimationFrame(v)}}var rZ=m.useLayoutEffect,Lat=["className","clearValue","cx","getStyles","getClassNames","getValue","hasValue","isMulti","isRtl","options","selectOption","selectProps","setValue","theme"],eM=function(){};function Dat(e,t){return t?t[0]==="-"?e+t:e+"__"+t:e}function Bat(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),s=2;s<n;s++)r[s-2]=arguments[s];var a=[].concat(r);if(t&&e)for(var o in t)t.hasOwnProperty(o)&&t[o]&&a.push("".concat(Dat(e,o)));return a.filter(function(l){return l}).map(function(l){return String(l).trim()}).join(" ")}var Rhe=function(t){return Kat(t)?t.filter(Boolean):h3(t)==="object"&&t!==null?[t]:[]},nje=function(t){t.className,t.clearValue,t.cx,t.getStyles,t.getClassNames,t.getValue,t.hasValue,t.isMulti,t.isRtl,t.options,t.selectOption,t.selectProps,t.setValue,t.theme;var n=w1(t,Lat);return Ks({},n)},ol=function(t,n,r){var s=t.cx,a=t.getStyles,o=t.getClassNames,l=t.className;return{css:a(n,t),className:s(r??{},o(n,t),l)}};function GD(e){return[document.documentElement,document.body,window].indexOf(e)>-1}function $at(e){return GD(e)?window.innerHeight:e.clientHeight}function rje(e){return GD(e)?window.pageYOffset:e.scrollTop}function tM(e,t){if(GD(e)){window.scrollTo(0,t);return}e.scrollTop=t}function Uat(e){var t=getComputedStyle(e),n=t.position==="absolute",r=/(auto|scroll)/;if(t.position==="fixed")return document.documentElement;for(var s=e;s=s.parentElement;)if(t=getComputedStyle(s),!(n&&t.position==="static")&&r.test(t.overflow+t.overflowY+t.overflowX))return s;return document.documentElement}function zat(e,t,n,r){return n*((e=e/r-1)*e*e+1)+t}function TI(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:200,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:eM,s=rje(e),a=t-s,o=10,l=0;function c(){l+=o;var u=zat(l,s,a,n);tM(e,u),l<n?window.requestAnimationFrame(c):r(e)}c()}function Lhe(e,t){var n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),s=t.offsetHeight/3;r.bottom+s>n.bottom?tM(e,Math.min(t.offsetTop+t.clientHeight-e.offsetHeight+s,e.scrollHeight)):r.top-s<n.top&&tM(e,Math.max(t.offsetTop-s,0))}function Hat(e){var t=e.getBoundingClientRect();return{bottom:t.bottom,height:t.height,left:t.left,right:t.right,top:t.top,width:t.width}}function Dhe(){try{return document.createEvent("TouchEvent"),!0}catch{return!1}}function Vat(){try{return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}catch{return!1}}var sje=!1,Wat={get passive(){return sje=!0}},II=typeof window<"u"?window:{};II.addEventListener&&II.removeEventListener&&(II.addEventListener("p",eM,Wat),II.removeEventListener("p",eM,!1));var qat=sje;function Gat(e){return e!=null}function Kat(e){return Array.isArray(e)}function PI(e,t,n){return e?t:n}var Yat=function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),s=1;s<n;s++)r[s-1]=arguments[s];var a=Object.entries(t).filter(function(o){var l=Hg(o,1),c=l[0];return!r.includes(c)});return a.reduce(function(o,l){var c=Hg(l,2),u=c[0],d=c[1];return o[u]=d,o},{})},Xat=["children","innerProps"],Qat=["children","innerProps"];function Zat(e){var t=e.maxHeight,n=e.menuEl,r=e.minHeight,s=e.placement,a=e.shouldScroll,o=e.isFixedPosition,l=e.controlHeight,c=Uat(n),u={placement:"bottom",maxHeight:t};if(!n||!n.offsetParent)return u;var d=c.getBoundingClientRect(),f=d.height,x=n.getBoundingClientRect(),g=x.bottom,v=x.height,w=x.top,C=n.offsetParent.getBoundingClientRect(),N=C.top,P=o?window.innerHeight:$at(c),I=rje(c),R=parseInt(getComputedStyle(n).marginBottom,10),F=parseInt(getComputedStyle(n).marginTop,10),U=N-F,L=P-w,z=U+I,Q=f-I-w,ne=g-P+I+R,J=I+w-F,X=160;switch(s){case"auto":case"bottom":if(L>=v)return{placement:"bottom",maxHeight:t};if(Q>=v&&!o)return a&&TI(c,ne,X),{placement:"bottom",maxHeight:t};if(!o&&Q>=r||o&&L>=r){a&&TI(c,ne,X);var re=o?L-R:Q-R;return{placement:"bottom",maxHeight:re}}if(s==="auto"||o){var pe=t,Y=o?U:z;return Y>=r&&(pe=Math.min(Y-R-l,t)),{placement:"top",maxHeight:pe}}if(s==="bottom")return a&&tM(c,ne),{placement:"bottom",maxHeight:t};break;case"top":if(U>=v)return{placement:"top",maxHeight:t};if(z>=v&&!o)return a&&TI(c,J,X),{placement:"top",maxHeight:t};if(!o&&z>=r||o&&U>=r){var ie=t;return(!o&&z>=r||o&&U>=r)&&(ie=o?U-F:z-F),a&&TI(c,J,X),{placement:"top",maxHeight:ie}}return{placement:"bottom",maxHeight:t};default:throw new Error('Invalid placement provided "'.concat(s,'".'))}return u}function Jat(e){var t={bottom:"top",top:"bottom"};return e?t[e]:"bottom"}var ije=function(t){return t==="auto"?"bottom":t},eot=function(t,n){var r,s=t.placement,a=t.theme,o=a.borderRadius,l=a.spacing,c=a.colors;return Ks((r={label:"menu"},cj(r,Jat(s),"100%"),cj(r,"position","absolute"),cj(r,"width","100%"),cj(r,"zIndex",1),r),n?{}:{backgroundColor:c.neutral0,borderRadius:o,boxShadow:"0 0 0 1px hsla(0, 0%, 0%, 0.1), 0 4px 11px hsla(0, 0%, 0%, 0.1)",marginBottom:l.menuGutter,marginTop:l.menuGutter})},aje=m.createContext(null),tot=function(t){var n=t.children,r=t.minMenuHeight,s=t.maxMenuHeight,a=t.menuPlacement,o=t.menuPosition,l=t.menuShouldScrollIntoView,c=t.theme,u=m.useContext(aje)||{},d=u.setPortalPlacement,f=m.useRef(null),x=m.useState(s),g=Hg(x,2),v=g[0],w=g[1],C=m.useState(null),N=Hg(C,2),P=N[0],I=N[1],R=c.spacing.controlHeight;return rZ(function(){var F=f.current;if(F){var U=o==="fixed",L=l&&!U,z=Zat({maxHeight:s,menuEl:F,minHeight:r,placement:a,shouldScroll:L,isFixedPosition:U,controlHeight:R});w(z.maxHeight),I(z.placement),d==null||d(z.placement)}},[s,a,o,l,r,d,R]),n({ref:f,placerProps:Ks(Ks({},t),{},{placement:P||ije(a),maxHeight:v})})},not=function(t){var n=t.children,r=t.innerRef,s=t.innerProps;return Vs("div",ti({},ol(t,"menu",{menu:!0}),{ref:r},s),n)},rot=not,sot=function(t,n){var r=t.maxHeight,s=t.theme.spacing.baseUnit;return Ks({maxHeight:r,overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},n?{}:{paddingBottom:s,paddingTop:s})},iot=function(t){var n=t.children,r=t.innerProps,s=t.innerRef,a=t.isMulti;return Vs("div",ti({},ol(t,"menuList",{"menu-list":!0,"menu-list--is-multi":a}),{ref:s},r),n)},oje=function(t,n){var r=t.theme,s=r.spacing.baseUnit,a=r.colors;return Ks({textAlign:"center"},n?{}:{color:a.neutral40,padding:"".concat(s*2,"px ").concat(s*3,"px")})},aot=oje,oot=oje,lot=function(t){var n=t.children,r=n===void 0?"No options":n,s=t.innerProps,a=w1(t,Xat);return Vs("div",ti({},ol(Ks(Ks({},a),{},{children:r,innerProps:s}),"noOptionsMessage",{"menu-notice":!0,"menu-notice--no-options":!0}),s),r)},cot=function(t){var n=t.children,r=n===void 0?"Loading...":n,s=t.innerProps,a=w1(t,Qat);return Vs("div",ti({},ol(Ks(Ks({},a),{},{children:r,innerProps:s}),"loadingMessage",{"menu-notice":!0,"menu-notice--loading":!0}),s),r)},uot=function(t){var n=t.rect,r=t.offset,s=t.position;return{left:n.left,position:s,top:r,width:n.width,zIndex:1}},dot=function(t){var n=t.appendTo,r=t.children,s=t.controlElement,a=t.innerProps,o=t.menuPlacement,l=t.menuPosition,c=m.useRef(null),u=m.useRef(null),d=m.useState(ije(o)),f=Hg(d,2),x=f[0],g=f[1],v=m.useMemo(function(){return{setPortalPlacement:g}},[]),w=m.useState(null),C=Hg(w,2),N=C[0],P=C[1],I=m.useCallback(function(){if(s){var L=Hat(s),z=l==="fixed"?0:window.pageYOffset,Q=L[x]+z;(Q!==(N==null?void 0:N.offset)||L.left!==(N==null?void 0:N.rect.left)||L.width!==(N==null?void 0:N.rect.width))&&P({offset:Q,rect:L})}},[s,l,x,N==null?void 0:N.offset,N==null?void 0:N.rect.left,N==null?void 0:N.rect.width]);rZ(function(){I()},[I]);var R=m.useCallback(function(){typeof u.current=="function"&&(u.current(),u.current=null),s&&c.current&&(u.current=Rat(s,c.current,I,{elementResize:"ResizeObserver"in window}))},[s,I]);rZ(function(){R()},[R]);var F=m.useCallback(function(L){c.current=L,R()},[R]);if(!n&&l!=="fixed"||!N)return null;var U=Vs("div",ti({ref:F},ol(Ks(Ks({},t),{},{offset:N.offset,position:l,rect:N.rect}),"menuPortal",{"menu-portal":!0}),a),r);return Vs(aje.Provider,{value:v},n?Na.createPortal(U,n):U)},fot=function(t){var n=t.isDisabled,r=t.isRtl;return{label:"container",direction:r?"rtl":void 0,pointerEvents:n?"none":void 0,position:"relative"}},hot=function(t){var n=t.children,r=t.innerProps,s=t.isDisabled,a=t.isRtl;return Vs("div",ti({},ol(t,"container",{"--is-disabled":s,"--is-rtl":a}),r),n)},pot=function(t,n){var r=t.theme.spacing,s=t.isMulti,a=t.hasValue,o=t.selectProps.controlShouldRenderValue;return Ks({alignItems:"center",display:s&&a&&o?"flex":"grid",flex:1,flexWrap:"wrap",WebkitOverflowScrolling:"touch",position:"relative",overflow:"hidden"},n?{}:{padding:"".concat(r.baseUnit/2,"px ").concat(r.baseUnit*2,"px")})},mot=function(t){var n=t.children,r=t.innerProps,s=t.isMulti,a=t.hasValue;return Vs("div",ti({},ol(t,"valueContainer",{"value-container":!0,"value-container--is-multi":s,"value-container--has-value":a}),r),n)},xot=function(){return{alignItems:"center",alignSelf:"stretch",display:"flex",flexShrink:0}},got=function(t){var n=t.children,r=t.innerProps;return Vs("div",ti({},ol(t,"indicatorsContainer",{indicators:!0}),r),n)},Bhe,bot=["size"],yot=["innerProps","isRtl","size"],vot={name:"8mmkcg",styles:"display:inline-block;fill:currentColor;line-height:1;stroke:currentColor;stroke-width:0"},lje=function(t){var n=t.size,r=w1(t,bot);return Vs("svg",ti({height:n,width:n,viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",css:vot},r))},Gse=function(t){return Vs(lje,ti({size:20},t),Vs("path",{d:"M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z"}))},cje=function(t){return Vs(lje,ti({size:20},t),Vs("path",{d:"M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z"}))},uje=function(t,n){var r=t.isFocused,s=t.theme,a=s.spacing.baseUnit,o=s.colors;return Ks({label:"indicatorContainer",display:"flex",transition:"color 150ms"},n?{}:{color:r?o.neutral60:o.neutral20,padding:a*2,":hover":{color:r?o.neutral80:o.neutral40}})},wot=uje,Cot=function(t){var n=t.children,r=t.innerProps;return Vs("div",ti({},ol(t,"dropdownIndicator",{indicator:!0,"dropdown-indicator":!0}),r),n||Vs(cje,null))},Sot=uje,Not=function(t){var n=t.children,r=t.innerProps;return Vs("div",ti({},ol(t,"clearIndicator",{indicator:!0,"clear-indicator":!0}),r),n||Vs(Gse,null))},Aot=function(t,n){var r=t.isDisabled,s=t.theme,a=s.spacing.baseUnit,o=s.colors;return Ks({label:"indicatorSeparator",alignSelf:"stretch",width:1},n?{}:{backgroundColor:r?o.neutral10:o.neutral20,marginBottom:a*2,marginTop:a*2})},jot=function(t){var n=t.innerProps;return Vs("span",ti({},n,ol(t,"indicatorSeparator",{"indicator-separator":!0})))},Eot=Sat(Bhe||(Bhe=Nat([`
0%, 80%, 100% { opacity: 0; }
40% { opacity: 1; }
`]))),_ot=function(t,n){var r=t.isFocused,s=t.size,a=t.theme,o=a.colors,l=a.spacing.baseUnit;return Ks({label:"loadingIndicator",display:"flex",transition:"color 150ms",alignSelf:"center",fontSize:s,lineHeight:1,marginRight:s,textAlign:"center",verticalAlign:"middle"},n?{}:{color:r?o.neutral60:o.neutral20,padding:l*2})},Uz=function(t){var n=t.delay,r=t.offset;return Vs("span",{css:Hse({animation:"".concat(Eot," 1s ease-in-out ").concat(n,"ms infinite;"),backgroundColor:"currentColor",borderRadius:"1em",display:"inline-block",marginLeft:r?"1em":void 0,height:"1em",verticalAlign:"top",width:"1em"},"","")})},kot=function(t){var n=t.innerProps,r=t.isRtl,s=t.size,a=s===void 0?4:s,o=w1(t,yot);return Vs("div",ti({},ol(Ks(Ks({},o),{},{innerProps:n,isRtl:r,size:a}),"loadingIndicator",{indicator:!0,"loading-indicator":!0}),n),Vs(Uz,{delay:0,offset:r}),Vs(Uz,{delay:160,offset:!0}),Vs(Uz,{delay:320,offset:!r}))},Tot=function(t,n){var r=t.isDisabled,s=t.isFocused,a=t.theme,o=a.colors,l=a.borderRadius,c=a.spacing;return Ks({label:"control",alignItems:"center",cursor:"default",display:"flex",flexWrap:"wrap",justifyContent:"space-between",minHeight:c.controlHeight,outline:"0 !important",position:"relative",transition:"all 100ms"},n?{}:{backgroundColor:r?o.neutral5:o.neutral0,borderColor:r?o.neutral10:s?o.primary:o.neutral20,borderRadius:l,borderStyle:"solid",borderWidth:1,boxShadow:s?"0 0 0 1px ".concat(o.primary):void 0,"&:hover":{borderColor:s?o.primary:o.neutral30}})},Iot=function(t){var n=t.children,r=t.isDisabled,s=t.isFocused,a=t.innerRef,o=t.innerProps,l=t.menuIsOpen;return Vs("div",ti({ref:a},ol(t,"control",{control:!0,"control--is-disabled":r,"control--is-focused":s,"control--menu-is-open":l}),o,{"aria-disabled":r||void 0}),n)},Pot=Iot,Fot=["data"],Oot=function(t,n){var r=t.theme.spacing;return n?{}:{paddingBottom:r.baseUnit*2,paddingTop:r.baseUnit*2}},Mot=function(t){var n=t.children,r=t.cx,s=t.getStyles,a=t.getClassNames,o=t.Heading,l=t.headingProps,c=t.innerProps,u=t.label,d=t.theme,f=t.selectProps;return Vs("div",ti({},ol(t,"group",{group:!0}),c),Vs(o,ti({},l,{selectProps:f,theme:d,getStyles:s,getClassNames:a,cx:r}),u),Vs("div",null,n))},Rot=function(t,n){var r=t.theme,s=r.colors,a=r.spacing;return Ks({label:"group",cursor:"default",display:"block"},n?{}:{color:s.neutral40,fontSize:"75%",fontWeight:500,marginBottom:"0.25em",paddingLeft:a.baseUnit*3,paddingRight:a.baseUnit*3,textTransform:"uppercase"})},Lot=function(t){var n=nje(t);n.data;var r=w1(n,Fot);return Vs("div",ti({},ol(t,"groupHeading",{"group-heading":!0}),r))},Dot=Mot,Bot=["innerRef","isDisabled","isHidden","inputClassName"],$ot=function(t,n){var r=t.isDisabled,s=t.value,a=t.theme,o=a.spacing,l=a.colors;return Ks(Ks({visibility:r?"hidden":"visible",transform:s?"translateZ(0)":""},Uot),n?{}:{margin:o.baseUnit/2,paddingBottom:o.baseUnit/2,paddingTop:o.baseUnit/2,color:l.neutral80})},dje={gridArea:"1 / 2",font:"inherit",minWidth:"2px",border:0,margin:0,outline:0,padding:0},Uot={flex:"1 1 auto",display:"inline-grid",gridArea:"1 / 1 / 2 / 3",gridTemplateColumns:"0 min-content","&:after":Ks({content:'attr(data-value) " "',visibility:"hidden",whiteSpace:"pre"},dje)},zot=function(t){return Ks({label:"input",color:"inherit",background:0,opacity:t?0:1,width:"100%"},dje)},Hot=function(t){var n=t.cx,r=t.value,s=nje(t),a=s.innerRef,o=s.isDisabled,l=s.isHidden,c=s.inputClassName,u=w1(s,Bot);return Vs("div",ti({},ol(t,"input",{"input-container":!0}),{"data-value":r||""}),Vs("input",ti({className:n({input:!0},c),ref:a,style:zot(l),disabled:o},u)))},Vot=Hot,Wot=function(t,n){var r=t.theme,s=r.spacing,a=r.borderRadius,o=r.colors;return Ks({label:"multiValue",display:"flex",minWidth:0},n?{}:{backgroundColor:o.neutral10,borderRadius:a/2,margin:s.baseUnit/2})},qot=function(t,n){var r=t.theme,s=r.borderRadius,a=r.colors,o=t.cropWithEllipsis;return Ks({overflow:"hidden",textOverflow:o||o===void 0?"ellipsis":void 0,whiteSpace:"nowrap"},n?{}:{borderRadius:s/2,color:a.neutral80,fontSize:"85%",padding:3,paddingLeft:6})},Got=function(t,n){var r=t.theme,s=r.spacing,a=r.borderRadius,o=r.colors,l=t.isFocused;return Ks({alignItems:"center",display:"flex"},n?{}:{borderRadius:a/2,backgroundColor:l?o.dangerLight:void 0,paddingLeft:s.baseUnit,paddingRight:s.baseUnit,":hover":{backgroundColor:o.dangerLight,color:o.danger}})},fje=function(t){var n=t.children,r=t.innerProps;return Vs("div",r,n)},Kot=fje,Yot=fje;function Xot(e){var t=e.children,n=e.innerProps;return Vs("div",ti({role:"button"},n),t||Vs(Gse,{size:14}))}var Qot=function(t){var n=t.children,r=t.components,s=t.data,a=t.innerProps,o=t.isDisabled,l=t.removeProps,c=t.selectProps,u=r.Container,d=r.Label,f=r.Remove;return Vs(u,{data:s,innerProps:Ks(Ks({},ol(t,"multiValue",{"multi-value":!0,"multi-value--is-disabled":o})),a),selectProps:c},Vs(d,{data:s,innerProps:Ks({},ol(t,"multiValueLabel",{"multi-value__label":!0})),selectProps:c},n),Vs(f,{data:s,innerProps:Ks(Ks({},ol(t,"multiValueRemove",{"multi-value__remove":!0})),{},{"aria-label":"Remove ".concat(n||"option")},l),selectProps:c}))},Zot=Qot,Jot=function(t,n){var r=t.isDisabled,s=t.isFocused,a=t.isSelected,o=t.theme,l=o.spacing,c=o.colors;return Ks({label:"option",cursor:"default",display:"block",fontSize:"inherit",width:"100%",userSelect:"none",WebkitTapHighlightColor:"rgba(0, 0, 0, 0)"},n?{}:{backgroundColor:a?c.primary:s?c.primary25:"transparent",color:r?c.neutral20:a?c.neutral0:"inherit",padding:"".concat(l.baseUnit*2,"px ").concat(l.baseUnit*3,"px"),":active":{backgroundColor:r?void 0:a?c.primary:c.primary50}})},elt=function(t){var n=t.children,r=t.isDisabled,s=t.isFocused,a=t.isSelected,o=t.innerRef,l=t.innerProps;return Vs("div",ti({},ol(t,"option",{option:!0,"option--is-disabled":r,"option--is-focused":s,"option--is-selected":a}),{ref:o,"aria-disabled":r},l),n)},tlt=elt,nlt=function(t,n){var r=t.theme,s=r.spacing,a=r.colors;return Ks({label:"placeholder",gridArea:"1 / 1 / 2 / 3"},n?{}:{color:a.neutral50,marginLeft:s.baseUnit/2,marginRight:s.baseUnit/2})},rlt=function(t){var n=t.children,r=t.innerProps;return Vs("div",ti({},ol(t,"placeholder",{placeholder:!0}),r),n)},slt=rlt,ilt=function(t,n){var r=t.isDisabled,s=t.theme,a=s.spacing,o=s.colors;return Ks({label:"singleValue",gridArea:"1 / 1 / 2 / 3",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},n?{}:{color:r?o.neutral40:o.neutral80,marginLeft:a.baseUnit/2,marginRight:a.baseUnit/2})},alt=function(t){var n=t.children,r=t.isDisabled,s=t.innerProps;return Vs("div",ti({},ol(t,"singleValue",{"single-value":!0,"single-value--is-disabled":r}),s),n)},olt=alt,Ca={ClearIndicator:Not,Control:Pot,DropdownIndicator:Cot,DownChevron:cje,CrossIcon:Gse,Group:Dot,GroupHeading:Lot,IndicatorsContainer:got,IndicatorSeparator:jot,Input:Vot,LoadingIndicator:kot,Menu:rot,MenuList:iot,MenuPortal:dot,LoadingMessage:cot,NoOptionsMessage:lot,MultiValue:Zot,MultiValueContainer:Kot,MultiValueLabel:Yot,MultiValueRemove:Xot,Option:tlt,Placeholder:slt,SelectContainer:hot,SingleValue:olt,ValueContainer:mot},llt=function(t){return Ks(Ks({},Ca),t.components)},$he=Number.isNaN||function(t){return typeof t=="number"&&t!==t};function clt(e,t){return!!(e===t||$he(e)&&$he(t))}function ult(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(!clt(e[n],t[n]))return!1;return!0}function dlt(e,t){t===void 0&&(t=ult);var n=null;function r(){for(var s=[],a=0;a<arguments.length;a++)s[a]=arguments[a];if(n&&n.lastThis===this&&t(s,n.lastArgs))return n.lastResult;var o=e.apply(this,s);return n={lastResult:o,lastArgs:s,lastThis:this},o}return r.clear=function(){n=null},r}var flt={name:"7pg0cj-a11yText",styles:"label:a11yText;z-index:9999;border:0;clip:rect(1px, 1px, 1px, 1px);height:1px;width:1px;position:absolute;overflow:hidden;padding:0;white-space:nowrap"},hlt=function(t){return Vs("span",ti({css:flt},t))},Uhe=hlt,plt={guidance:function(t){var n=t.isSearchable,r=t.isMulti,s=t.tabSelectsValue,a=t.context,o=t.isInitialFocus;switch(a){case"menu":return"Use Up and Down to choose options, press Enter to select the currently focused option, press Escape to exit the menu".concat(s?", press Tab to select the option and exit the menu":"",".");case"input":return o?"".concat(t["aria-label"]||"Select"," is focused ").concat(n?",type to refine list":"",", press Down to open the menu, ").concat(r?" press left to focus selected values":""):"";case"value":return"Use left and right to toggle between focused values, press Backspace to remove the currently focused value";default:return""}},onChange:function(t){var n=t.action,r=t.label,s=r===void 0?"":r,a=t.labels,o=t.isDisabled;switch(n){case"deselect-option":case"pop-value":case"remove-value":return"option ".concat(s,", deselected.");case"clear":return"All selected options have been cleared.";case"initial-input-focus":return"option".concat(a.length>1?"s":""," ").concat(a.join(","),", selected.");case"select-option":return o?"option ".concat(s," is disabled. Select another option."):"option ".concat(s,", selected.");default:return""}},onFocus:function(t){var n=t.context,r=t.focused,s=t.options,a=t.label,o=a===void 0?"":a,l=t.selectValue,c=t.isDisabled,u=t.isSelected,d=t.isAppleDevice,f=function(w,C){return w&&w.length?"".concat(w.indexOf(C)+1," of ").concat(w.length):""};if(n==="value"&&l)return"value ".concat(o," focused, ").concat(f(l,r),".");if(n==="menu"&&d){var x=c?" disabled":"",g="".concat(u?" selected":"").concat(x);return"".concat(o).concat(g,", ").concat(f(s,r),".")}return""},onFilter:function(t){var n=t.inputValue,r=t.resultsMessage;return"".concat(r).concat(n?" for search term "+n:"",".")}},mlt=function(t){var n=t.ariaSelection,r=t.focusedOption,s=t.focusedValue,a=t.focusableOptions,o=t.isFocused,l=t.selectValue,c=t.selectProps,u=t.id,d=t.isAppleDevice,f=c.ariaLiveMessages,x=c.getOptionLabel,g=c.inputValue,v=c.isMulti,w=c.isOptionDisabled,C=c.isSearchable,N=c.menuIsOpen,P=c.options,I=c.screenReaderStatus,R=c.tabSelectsValue,F=c.isLoading,U=c["aria-label"],L=c["aria-live"],z=m.useMemo(function(){return Ks(Ks({},plt),f||{})},[f]),Q=m.useMemo(function(){var Y="";if(n&&z.onChange){var ie=n.option,oe=n.options,G=n.removedValue,V=n.removedValues,ee=n.value,ae=function(je){return Array.isArray(je)?null:je},fe=G||ie||ae(ee),Ne=fe?x(fe):"",he=oe||V||void 0,ge=he?he.map(x):[],ye=Ks({isDisabled:fe&&w(fe,l),label:Ne,labels:ge},n);Y=z.onChange(ye)}return Y},[n,z,w,l,x]),ne=m.useMemo(function(){var Y="",ie=r||s,oe=!!(r&&l&&l.includes(r));if(ie&&z.onFocus){var G={focused:ie,label:x(ie),isDisabled:w(ie,l),isSelected:oe,options:a,context:ie===r?"menu":"value",selectValue:l,isAppleDevice:d};Y=z.onFocus(G)}return Y},[r,s,x,w,z,a,l,d]),J=m.useMemo(function(){var Y="";if(N&&P.length&&!F&&z.onFilter){var ie=I({count:a.length});Y=z.onFilter({inputValue:g,resultsMessage:ie})}return Y},[a,g,N,z,P,I,F]),X=(n==null?void 0:n.action)==="initial-input-focus",re=m.useMemo(function(){var Y="";if(z.guidance){var ie=s?"value":N?"menu":"input";Y=z.guidance({"aria-label":U,context:ie,isDisabled:r&&w(r,l),isMulti:v,isSearchable:C,tabSelectsValue:R,isInitialFocus:X})}return Y},[U,r,s,v,w,C,N,z,l,R,X]),pe=Vs(m.Fragment,null,Vs("span",{id:"aria-selection"},Q),Vs("span",{id:"aria-focused"},ne),Vs("span",{id:"aria-results"},J),Vs("span",{id:"aria-guidance"},re));return Vs(m.Fragment,null,Vs(Uhe,{id:u},X&&pe),Vs(Uhe,{"aria-live":L,"aria-atomic":"false","aria-relevant":"additions text",role:"log"},o&&!X&&pe))},xlt=mlt,sZ=[{base:"A",letters:"AⒶAÀÁÂẦẤẪẨÃĀĂẰẮẴẲȦǠÄǞẢÅǺǍȀȂẠẬẶḀĄȺⱯ"},{base:"AA",letters:"Ꜳ"},{base:"AE",letters:"ÆǼǢ"},{base:"AO",letters:"Ꜵ"},{base:"AU",letters:"Ꜷ"},{base:"AV",letters:"ꜸꜺ"},{base:"AY",letters:"Ꜽ"},{base:"B",letters:"BⒷBḂḄḆɃƂƁ"},{base:"C",letters:"CⒸCĆĈĊČÇḈƇȻꜾ"},{base:"D",letters:"DⒹDḊĎḌḐḒḎĐƋƊƉꝹ"},{base:"DZ",letters:"DZDŽ"},{base:"Dz",letters:"DzDž"},{base:"E",letters:"EⒺEÈÉÊỀẾỄỂẼĒḔḖĔĖËẺĚȄȆẸỆȨḜĘḘḚƐƎ"},{base:"F",letters:"FⒻFḞƑꝻ"},{base:"G",letters:"GⒼGǴĜḠĞĠǦĢǤƓꞠꝽꝾ"},{base:"H",letters:"HⒽHĤḢḦȞḤḨḪĦⱧⱵꞍ"},{base:"I",letters:"IⒾIÌÍÎĨĪĬİÏḮỈǏȈȊỊĮḬƗ"},{base:"J",letters:"JⒿJĴɈ"},{base:"K",letters:"KⓀKḰǨḲĶḴƘⱩꝀꝂꝄꞢ"},{base:"L",letters:"LⓁLĿĹĽḶḸĻḼḺŁȽⱢⱠꝈꝆꞀ"},{base:"LJ",letters:"LJ"},{base:"Lj",letters:"Lj"},{base:"M",letters:"MⓂMḾṀṂⱮƜ"},{base:"N",letters:"NⓃNǸŃÑṄŇṆŅṊṈȠƝꞐꞤ"},{base:"NJ",letters:"NJ"},{base:"Nj",letters:"Nj"},{base:"O",letters:"OⓄOÒÓÔỒỐỖỔÕṌȬṎŌṐṒŎȮȰÖȪỎŐǑȌȎƠỜỚỠỞỢỌỘǪǬØǾƆƟꝊꝌ"},{base:"OI",letters:"Ƣ"},{base:"OO",letters:"Ꝏ"},{base:"OU",letters:"Ȣ"},{base:"P",letters:"PⓅPṔṖƤⱣꝐꝒꝔ"},{base:"Q",letters:"QⓆQꝖꝘɊ"},{base:"R",letters:"RⓇRŔṘŘȐȒṚṜŖṞɌⱤꝚꞦꞂ"},{base:"S",letters:"SⓈSẞŚṤŜṠŠṦṢṨȘŞⱾꞨꞄ"},{base:"T",letters:"TⓉTṪŤṬȚŢṰṮŦƬƮȾꞆ"},{base:"TZ",letters:"Ꜩ"},{base:"U",letters:"UⓊUÙÚÛŨṸŪṺŬÜǛǗǕǙỦŮŰǓȔȖƯỪỨỮỬỰỤṲŲṶṴɄ"},{base:"V",letters:"VⓋVṼṾƲꝞɅ"},{base:"VY",letters:"Ꝡ"},{base:"W",letters:"WⓌWẀẂŴẆẄẈⱲ"},{base:"X",letters:"XⓍXẊẌ"},{base:"Y",letters:"YⓎYỲÝŶỸȲẎŸỶỴƳɎỾ"},{base:"Z",letters:"ZⓏZŹẐŻŽẒẔƵȤⱿⱫꝢ"},{base:"a",letters:"aⓐaẚàáâầấẫẩãāăằắẵẳȧǡäǟảåǻǎȁȃạậặḁąⱥɐ"},{base:"aa",letters:"ꜳ"},{base:"ae",letters:"æǽǣ"},{base:"ao",letters:"ꜵ"},{base:"au",letters:"ꜷ"},{base:"av",letters:"ꜹꜻ"},{base:"ay",letters:"ꜽ"},{base:"b",letters:"bⓑbḃḅḇƀƃɓ"},{base:"c",letters:"cⓒcćĉċčçḉƈȼꜿↄ"},{base:"d",letters:"dⓓdḋďḍḑḓḏđƌɖɗꝺ"},{base:"dz",letters:"dzdž"},{base:"e",letters:"eⓔeèéêềếễểẽēḕḗĕėëẻěȅȇẹệȩḝęḙḛɇɛǝ"},{base:"f",letters:"fⓕfḟƒꝼ"},{base:"g",letters:"gⓖgǵĝḡğġǧģǥɠꞡᵹꝿ"},{base:"h",letters:"hⓗhĥḣḧȟḥḩḫẖħⱨⱶɥ"},{base:"hv",letters:"ƕ"},{base:"i",letters:"iⓘiìíîĩīĭïḯỉǐȉȋịįḭɨı"},{base:"j",letters:"jⓙjĵǰɉ"},{base:"k",letters:"kⓚkḱǩḳķḵƙⱪꝁꝃꝅꞣ"},{base:"l",letters:"lⓛlŀĺľḷḹļḽḻſłƚɫⱡꝉꞁꝇ"},{base:"lj",letters:"lj"},{base:"m",letters:"mⓜmḿṁṃɱɯ"},{base:"n",letters:"nⓝnǹńñṅňṇņṋṉƞɲʼnꞑꞥ"},{base:"nj",letters:"nj"},{base:"o",letters:"oⓞoòóôồốỗổõṍȭṏōṑṓŏȯȱöȫỏőǒȍȏơờớỡởợọộǫǭøǿɔꝋꝍɵ"},{base:"oi",letters:"ƣ"},{base:"ou",letters:"ȣ"},{base:"oo",letters:"ꝏ"},{base:"p",letters:"pⓟpṕṗƥᵽꝑꝓꝕ"},{base:"q",letters:"qⓠqɋꝗꝙ"},{base:"r",letters:"rⓡrŕṙřȑȓṛṝŗṟɍɽꝛꞧꞃ"},{base:"s",letters:"sⓢsßśṥŝṡšṧṣṩșşȿꞩꞅẛ"},{base:"t",letters:"tⓣtṫẗťṭțţṱṯŧƭʈⱦꞇ"},{base:"tz",letters:"ꜩ"},{base:"u",letters:"uⓤuùúûũṹūṻŭüǜǘǖǚủůűǔȕȗưừứữửựụṳųṷṵʉ"},{base:"v",letters:"vⓥvṽṿʋꝟʌ"},{base:"vy",letters:"ꝡ"},{base:"w",letters:"wⓦwẁẃŵẇẅẘẉⱳ"},{base:"x",letters:"xⓧxẋẍ"},{base:"y",letters:"yⓨyỳýŷỹȳẏÿỷẙỵƴɏỿ"},{base:"z",letters:"zⓩzźẑżžẓẕƶȥɀⱬꝣ"}],glt=new RegExp("["+sZ.map(function(e){return e.letters}).join("")+"]","g"),hje={};for(var zz=0;zz<sZ.length;zz++)for(var Hz=sZ[zz],Vz=0;Vz<Hz.letters.length;Vz++)hje[Hz.letters[Vz]]=Hz.base;var pje=function(t){return t.replace(glt,function(n){return hje[n]})},blt=dlt(pje),zhe=function(t){return t.replace(/^\s+|\s+$/g,"")},ylt=function(t){return"".concat(t.label," ").concat(t.value)},vlt=function(t){return function(n,r){if(n.data.__isNew__)return!0;var s=Ks({ignoreCase:!0,ignoreAccents:!0,stringify:ylt,trim:!0,matchFrom:"any"},t),a=s.ignoreCase,o=s.ignoreAccents,l=s.stringify,c=s.trim,u=s.matchFrom,d=c?zhe(r):r,f=c?zhe(l(n)):l(n);return a&&(d=d.toLowerCase(),f=f.toLowerCase()),o&&(d=blt(d),f=pje(f)),u==="start"?f.substr(0,d.length)===d:f.indexOf(d)>-1}},wlt=["innerRef"];function Clt(e){var t=e.innerRef,n=w1(e,wlt),r=Yat(n,"onExited","in","enter","exit","appear");return Vs("input",ti({ref:t},r,{css:Hse({label:"dummyInput",background:0,border:0,caretColor:"transparent",fontSize:"inherit",gridArea:"1 / 1 / 2 / 3",outline:0,padding:0,width:1,color:"transparent",left:-100,opacity:0,position:"relative",transform:"scale(.01)"},"","")}))}var Slt=function(t){t.cancelable&&t.preventDefault(),t.stopPropagation()};function Nlt(e){var t=e.isEnabled,n=e.onBottomArrive,r=e.onBottomLeave,s=e.onTopArrive,a=e.onTopLeave,o=m.useRef(!1),l=m.useRef(!1),c=m.useRef(0),u=m.useRef(null),d=m.useCallback(function(C,N){if(u.current!==null){var P=u.current,I=P.scrollTop,R=P.scrollHeight,F=P.clientHeight,U=u.current,L=N>0,z=R-F-I,Q=!1;z>N&&o.current&&(r&&r(C),o.current=!1),L&&l.current&&(a&&a(C),l.current=!1),L&&N>z?(n&&!o.current&&n(C),U.scrollTop=R,Q=!0,o.current=!0):!L&&-N>I&&(s&&!l.current&&s(C),U.scrollTop=0,Q=!0,l.current=!0),Q&&Slt(C)}},[n,r,s,a]),f=m.useCallback(function(C){d(C,C.deltaY)},[d]),x=m.useCallback(function(C){c.current=C.changedTouches[0].clientY},[]),g=m.useCallback(function(C){var N=c.current-C.changedTouches[0].clientY;d(C,N)},[d]),v=m.useCallback(function(C){if(C){var N=qat?{passive:!1}:!1;C.addEventListener("wheel",f,N),C.addEventListener("touchstart",x,N),C.addEventListener("touchmove",g,N)}},[g,x,f]),w=m.useCallback(function(C){C&&(C.removeEventListener("wheel",f,!1),C.removeEventListener("touchstart",x,!1),C.removeEventListener("touchmove",g,!1))},[g,x,f]);return m.useEffect(function(){if(t){var C=u.current;return v(C),function(){w(C)}}},[t,v,w]),function(C){u.current=C}}var Hhe=["boxSizing","height","overflow","paddingRight","position"],Vhe={boxSizing:"border-box",overflow:"hidden",position:"relative",height:"100%"};function Whe(e){e.cancelable&&e.preventDefault()}function qhe(e){e.stopPropagation()}function Ghe(){var e=this.scrollTop,t=this.scrollHeight,n=e+this.offsetHeight;e===0?this.scrollTop=1:n===t&&(this.scrollTop=e-1)}function Khe(){return"ontouchstart"in window||navigator.maxTouchPoints}var Yhe=!!(typeof window<"u"&&window.document&&window.document.createElement),p7=0,R6={capture:!1,passive:!1};function Alt(e){var t=e.isEnabled,n=e.accountForScrollbars,r=n===void 0?!0:n,s=m.useRef({}),a=m.useRef(null),o=m.useCallback(function(c){if(Yhe){var u=document.body,d=u&&u.style;if(r&&Hhe.forEach(function(v){var w=d&&d[v];s.current[v]=w}),r&&p7<1){var f=parseInt(s.current.paddingRight,10)||0,x=document.body?document.body.clientWidth:0,g=window.innerWidth-x+f||0;Object.keys(Vhe).forEach(function(v){var w=Vhe[v];d&&(d[v]=w)}),d&&(d.paddingRight="".concat(g,"px"))}u&&Khe()&&(u.addEventListener("touchmove",Whe,R6),c&&(c.addEventListener("touchstart",Ghe,R6),c.addEventListener("touchmove",qhe,R6))),p7+=1}},[r]),l=m.useCallback(function(c){if(Yhe){var u=document.body,d=u&&u.style;p7=Math.max(p7-1,0),r&&p7<1&&Hhe.forEach(function(f){var x=s.current[f];d&&(d[f]=x)}),u&&Khe()&&(u.removeEventListener("touchmove",Whe,R6),c&&(c.removeEventListener("touchstart",Ghe,R6),c.removeEventListener("touchmove",qhe,R6)))}},[r]);return m.useEffect(function(){if(t){var c=a.current;return o(c),function(){l(c)}}},[t,o,l]),function(c){a.current=c}}var jlt=function(t){var n=t.target;return n.ownerDocument.activeElement&&n.ownerDocument.activeElement.blur()},Elt={name:"1kfdb0e",styles:"position:fixed;left:0;bottom:0;right:0;top:0"};function _lt(e){var t=e.children,n=e.lockEnabled,r=e.captureEnabled,s=r===void 0?!0:r,a=e.onBottomArrive,o=e.onBottomLeave,l=e.onTopArrive,c=e.onTopLeave,u=Nlt({isEnabled:s,onBottomArrive:a,onBottomLeave:o,onTopArrive:l,onTopLeave:c}),d=Alt({isEnabled:n}),f=function(g){u(g),d(g)};return Vs(m.Fragment,null,n&&Vs("div",{onClick:jlt,css:Elt}),t(f))}var klt={name:"1a0ro4n-requiredInput",styles:"label:requiredInput;opacity:0;pointer-events:none;position:absolute;bottom:0;left:0;right:0;width:100%"},Tlt=function(t){var n=t.name,r=t.onFocus;return Vs("input",{required:!0,name:n,tabIndex:-1,"aria-hidden":"true",onFocus:r,css:klt,value:"",onChange:function(){}})},Ilt=Tlt;function Kse(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 Plt(){return Kse(/^iPhone/i)}function mje(){return Kse(/^Mac/i)}function Flt(){return Kse(/^iPad/i)||mje()&&navigator.maxTouchPoints>1}function Olt(){return Plt()||Flt()}function Mlt(){return mje()||Olt()}var Rlt=function(t){return t.label},Llt=function(t){return t.label},Dlt=function(t){return t.value},Blt=function(t){return!!t.isDisabled},$lt={clearIndicator:Sot,container:fot,control:Tot,dropdownIndicator:wot,group:Oot,groupHeading:Rot,indicatorsContainer:xot,indicatorSeparator:Aot,input:$ot,loadingIndicator:_ot,loadingMessage:oot,menu:eot,menuList:sot,menuPortal:uot,multiValue:Wot,multiValueLabel:qot,multiValueRemove:Got,noOptionsMessage:aot,option:Jot,placeholder:nlt,singleValue:ilt,valueContainer:pot},Ult={primary:"#2684FF",primary75:"#4C9AFF",primary50:"#B2D4FF",primary25:"#DEEBFF",danger:"#DE350B",dangerLight:"#FFBDAD",neutral0:"hsl(0, 0%, 100%)",neutral5:"hsl(0, 0%, 95%)",neutral10:"hsl(0, 0%, 90%)",neutral20:"hsl(0, 0%, 80%)",neutral30:"hsl(0, 0%, 70%)",neutral40:"hsl(0, 0%, 60%)",neutral50:"hsl(0, 0%, 50%)",neutral60:"hsl(0, 0%, 40%)",neutral70:"hsl(0, 0%, 30%)",neutral80:"hsl(0, 0%, 20%)",neutral90:"hsl(0, 0%, 10%)"},zlt=4,xje=4,Hlt=38,Vlt=xje*2,Wlt={baseUnit:xje,controlHeight:Hlt,menuGutter:Vlt},Wz={borderRadius:zlt,colors:Ult,spacing:Wlt},qlt={"aria-live":"polite",backspaceRemovesValue:!0,blurInputOnSelect:Dhe(),captureMenuScroll:!Dhe(),classNames:{},closeMenuOnSelect:!0,closeMenuOnScroll:!1,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:vlt(),formatGroupLabel:Rlt,getOptionLabel:Llt,getOptionValue:Dlt,isDisabled:!1,isLoading:!1,isMulti:!1,isRtl:!1,isSearchable:!0,isOptionDisabled:Blt,loadingMessage:function(){return"Loading..."},maxMenuHeight:300,minMenuHeight:140,menuIsOpen:!1,menuPlacement:"bottom",menuPosition:"absolute",menuShouldBlockScroll:!1,menuShouldScrollIntoView:!Vat(),noOptionsMessage:function(){return"No options"},openMenuOnFocus:!1,openMenuOnClick:!0,options:[],pageSize:5,placeholder:"Select...",screenReaderStatus:function(t){var n=t.count;return"".concat(n," result").concat(n!==1?"s":""," available")},styles:{},tabIndex:0,tabSelectsValue:!0,unstyled:!1};function Xhe(e,t,n,r){var s=yje(e,t,n),a=vje(e,t,n),o=bje(e,t),l=nM(e,t);return{type:"option",data:t,isDisabled:s,isSelected:a,label:o,value:l,index:r}}function MF(e,t){return e.options.map(function(n,r){if("options"in n){var s=n.options.map(function(o,l){return Xhe(e,o,t,l)}).filter(function(o){return Zhe(e,o)});return s.length>0?{type:"group",data:n,options:s,index:r}:void 0}var a=Xhe(e,n,t,r);return Zhe(e,a)?a:void 0}).filter(Gat)}function gje(e){return e.reduce(function(t,n){return n.type==="group"?t.push.apply(t,Dse(n.options.map(function(r){return r.data}))):t.push(n.data),t},[])}function Qhe(e,t){return e.reduce(function(n,r){return r.type==="group"?n.push.apply(n,Dse(r.options.map(function(s){return{data:s.data,id:"".concat(t,"-").concat(r.index,"-").concat(s.index)}}))):n.push({data:r.data,id:"".concat(t,"-").concat(r.index)}),n},[])}function Glt(e,t){return gje(MF(e,t))}function Zhe(e,t){var n=e.inputValue,r=n===void 0?"":n,s=t.data,a=t.isSelected,o=t.label,l=t.value;return(!Cje(e)||!a)&&wje(e,{label:o,value:l,data:s},r)}function Klt(e,t){var n=e.focusedValue,r=e.selectValue,s=r.indexOf(n);if(s>-1){var a=t.indexOf(n);if(a>-1)return n;if(s<t.length)return t[s]}return null}function Ylt(e,t){var n=e.focusedOption;return n&&t.indexOf(n)>-1?n:t[0]}var qz=function(t,n){var r,s=(r=t.find(function(a){return a.data===n}))===null||r===void 0?void 0:r.id;return s||null},bje=function(t,n){return t.getOptionLabel(n)},nM=function(t,n){return t.getOptionValue(n)};function yje(e,t,n){return typeof e.isOptionDisabled=="function"?e.isOptionDisabled(t,n):!1}function vje(e,t,n){if(n.indexOf(t)>-1)return!0;if(typeof e.isOptionSelected=="function")return e.isOptionSelected(t,n);var r=nM(e,t);return n.some(function(s){return nM(e,s)===r})}function wje(e,t,n){return e.filterOption?e.filterOption(t,n):!0}var Cje=function(t){var n=t.hideSelectedOptions,r=t.isMulti;return n===void 0?r:n},Xlt=1,Sje=function(e){vit(n,e);var t=Sit(n);function n(r){var s;if(bit(this,n),s=t.call(this,r),s.state={ariaSelection:null,focusedOption:null,focusedOptionId:null,focusableOptionsWithIds:[],focusedValue:null,inputIsHidden:!1,isFocused:!1,selectValue:[],clearFocusValueOnUpdate:!1,prevWasFocused:!1,inputIsHiddenAfterUpdate:void 0,prevProps:void 0,instancePrefix:""},s.blockOptionHover=!1,s.isComposing=!1,s.commonProps=void 0,s.initialTouchX=0,s.initialTouchY=0,s.openAfterFocus=!1,s.scrollToFocusedOptionOnUpdate=!1,s.userIsDragging=void 0,s.isAppleDevice=Mlt(),s.controlRef=null,s.getControlRef=function(c){s.controlRef=c},s.focusedOptionRef=null,s.getFocusedOptionRef=function(c){s.focusedOptionRef=c},s.menuListRef=null,s.getMenuListRef=function(c){s.menuListRef=c},s.inputRef=null,s.getInputRef=function(c){s.inputRef=c},s.focus=s.focusInput,s.blur=s.blurInput,s.onChange=function(c,u){var d=s.props,f=d.onChange,x=d.name;u.name=x,s.ariaOnChange(c,u),f(c,u)},s.setValue=function(c,u,d){var f=s.props,x=f.closeMenuOnSelect,g=f.isMulti,v=f.inputValue;s.onInputChange("",{action:"set-value",prevInputValue:v}),x&&(s.setState({inputIsHiddenAfterUpdate:!g}),s.onMenuClose()),s.setState({clearFocusValueOnUpdate:!0}),s.onChange(c,{action:u,option:d})},s.selectOption=function(c){var u=s.props,d=u.blurInputOnSelect,f=u.isMulti,x=u.name,g=s.state.selectValue,v=f&&s.isOptionSelected(c,g),w=s.isOptionDisabled(c,g);if(v){var C=s.getOptionValue(c);s.setValue(g.filter(function(N){return s.getOptionValue(N)!==C}),"deselect-option",c)}else if(!w)f?s.setValue([].concat(Dse(g),[c]),"select-option",c):s.setValue(c,"select-option");else{s.ariaOnChange(c,{action:"select-option",option:c,name:x});return}d&&s.blurInput()},s.removeValue=function(c){var u=s.props.isMulti,d=s.state.selectValue,f=s.getOptionValue(c),x=d.filter(function(v){return s.getOptionValue(v)!==f}),g=PI(u,x,x[0]||null);s.onChange(g,{action:"remove-value",removedValue:c}),s.focusInput()},s.clearValue=function(){var c=s.state.selectValue;s.onChange(PI(s.props.isMulti,[],null),{action:"clear",removedValues:c})},s.popValue=function(){var c=s.props.isMulti,u=s.state.selectValue,d=u[u.length-1],f=u.slice(0,u.length-1),x=PI(c,f,f[0]||null);d&&s.onChange(x,{action:"pop-value",removedValue:d})},s.getFocusedOptionId=function(c){return qz(s.state.focusableOptionsWithIds,c)},s.getFocusableOptionsWithIds=function(){return Qhe(MF(s.props,s.state.selectValue),s.getElementId("option"))},s.getValue=function(){return s.state.selectValue},s.cx=function(){for(var c=arguments.length,u=new Array(c),d=0;d<c;d++)u[d]=arguments[d];return Bat.apply(void 0,[s.props.classNamePrefix].concat(u))},s.getOptionLabel=function(c){return bje(s.props,c)},s.getOptionValue=function(c){return nM(s.props,c)},s.getStyles=function(c,u){var d=s.props.unstyled,f=$lt[c](u,d);f.boxSizing="border-box";var x=s.props.styles[c];return x?x(f,u):f},s.getClassNames=function(c,u){var d,f;return(d=(f=s.props.classNames)[c])===null||d===void 0?void 0:d.call(f,u)},s.getElementId=function(c){return"".concat(s.state.instancePrefix,"-").concat(c)},s.getComponents=function(){return llt(s.props)},s.buildCategorizedOptions=function(){return MF(s.props,s.state.selectValue)},s.getCategorizedOptions=function(){return s.props.menuIsOpen?s.buildCategorizedOptions():[]},s.buildFocusableOptions=function(){return gje(s.buildCategorizedOptions())},s.getFocusableOptions=function(){return s.props.menuIsOpen?s.buildFocusableOptions():[]},s.ariaOnChange=function(c,u){s.setState({ariaSelection:Ks({value:c},u)})},s.onMenuMouseDown=function(c){c.button===0&&(c.stopPropagation(),c.preventDefault(),s.focusInput())},s.onMenuMouseMove=function(c){s.blockOptionHover=!1},s.onControlMouseDown=function(c){if(!c.defaultPrevented){var u=s.props.openMenuOnClick;s.state.isFocused?s.props.menuIsOpen?c.target.tagName!=="INPUT"&&c.target.tagName!=="TEXTAREA"&&s.onMenuClose():u&&s.openMenu("first"):(u&&(s.openAfterFocus=!0),s.focusInput()),c.target.tagName!=="INPUT"&&c.target.tagName!=="TEXTAREA"&&c.preventDefault()}},s.onDropdownIndicatorMouseDown=function(c){if(!(c&&c.type==="mousedown"&&c.button!==0)&&!s.props.isDisabled){var u=s.props,d=u.isMulti,f=u.menuIsOpen;s.focusInput(),f?(s.setState({inputIsHiddenAfterUpdate:!d}),s.onMenuClose()):s.openMenu("first"),c.preventDefault()}},s.onClearIndicatorMouseDown=function(c){c&&c.type==="mousedown"&&c.button!==0||(s.clearValue(),c.preventDefault(),s.openAfterFocus=!1,c.type==="touchend"?s.focusInput():setTimeout(function(){return s.focusInput()}))},s.onScroll=function(c){typeof s.props.closeMenuOnScroll=="boolean"?c.target instanceof HTMLElement&&GD(c.target)&&s.props.onMenuClose():typeof s.props.closeMenuOnScroll=="function"&&s.props.closeMenuOnScroll(c)&&s.props.onMenuClose()},s.onCompositionStart=function(){s.isComposing=!0},s.onCompositionEnd=function(){s.isComposing=!1},s.onTouchStart=function(c){var u=c.touches,d=u&&u.item(0);d&&(s.initialTouchX=d.clientX,s.initialTouchY=d.clientY,s.userIsDragging=!1)},s.onTouchMove=function(c){var u=c.touches,d=u&&u.item(0);if(d){var f=Math.abs(d.clientX-s.initialTouchX),x=Math.abs(d.clientY-s.initialTouchY),g=5;s.userIsDragging=f>g||x>g}},s.onTouchEnd=function(c){s.userIsDragging||(s.controlRef&&!s.controlRef.contains(c.target)&&s.menuListRef&&!s.menuListRef.contains(c.target)&&s.blurInput(),s.initialTouchX=0,s.initialTouchY=0)},s.onControlTouchEnd=function(c){s.userIsDragging||s.onControlMouseDown(c)},s.onClearIndicatorTouchEnd=function(c){s.userIsDragging||s.onClearIndicatorMouseDown(c)},s.onDropdownIndicatorTouchEnd=function(c){s.userIsDragging||s.onDropdownIndicatorMouseDown(c)},s.handleInputChange=function(c){var u=s.props.inputValue,d=c.currentTarget.value;s.setState({inputIsHiddenAfterUpdate:!1}),s.onInputChange(d,{action:"input-change",prevInputValue:u}),s.props.menuIsOpen||s.onMenuOpen()},s.onInputFocus=function(c){s.props.onFocus&&s.props.onFocus(c),s.setState({inputIsHiddenAfterUpdate:!1,isFocused:!0}),(s.openAfterFocus||s.props.openMenuOnFocus)&&s.openMenu("first"),s.openAfterFocus=!1},s.onInputBlur=function(c){var u=s.props.inputValue;if(s.menuListRef&&s.menuListRef.contains(document.activeElement)){s.inputRef.focus();return}s.props.onBlur&&s.props.onBlur(c),s.onInputChange("",{action:"input-blur",prevInputValue:u}),s.onMenuClose(),s.setState({focusedValue:null,isFocused:!1})},s.onOptionHover=function(c){if(!(s.blockOptionHover||s.state.focusedOption===c)){var u=s.getFocusableOptions(),d=u.indexOf(c);s.setState({focusedOption:c,focusedOptionId:d>-1?s.getFocusedOptionId(c):null})}},s.shouldHideSelectedOptions=function(){return Cje(s.props)},s.onValueInputFocus=function(c){c.preventDefault(),c.stopPropagation(),s.focus()},s.onKeyDown=function(c){var u=s.props,d=u.isMulti,f=u.backspaceRemovesValue,x=u.escapeClearsValue,g=u.inputValue,v=u.isClearable,w=u.isDisabled,C=u.menuIsOpen,N=u.onKeyDown,P=u.tabSelectsValue,I=u.openMenuOnFocus,R=s.state,F=R.focusedOption,U=R.focusedValue,L=R.selectValue;if(!w&&!(typeof N=="function"&&(N(c),c.defaultPrevented))){switch(s.blockOptionHover=!0,c.key){case"ArrowLeft":if(!d||g)return;s.focusValue("previous");break;case"ArrowRight":if(!d||g)return;s.focusValue("next");break;case"Delete":case"Backspace":if(g)return;if(U)s.removeValue(U);else{if(!f)return;d?s.popValue():v&&s.clearValue()}break;case"Tab":if(s.isComposing||c.shiftKey||!C||!P||!F||I&&s.isOptionSelected(F,L))return;s.selectOption(F);break;case"Enter":if(c.keyCode===229)break;if(C){if(!F||s.isComposing)return;s.selectOption(F);break}return;case"Escape":C?(s.setState({inputIsHiddenAfterUpdate:!1}),s.onInputChange("",{action:"menu-close",prevInputValue:g}),s.onMenuClose()):v&&x&&s.clearValue();break;case" ":if(g)return;if(!C){s.openMenu("first");break}if(!F)return;s.selectOption(F);break;case"ArrowUp":C?s.focusOption("up"):s.openMenu("last");break;case"ArrowDown":C?s.focusOption("down"):s.openMenu("first");break;case"PageUp":if(!C)return;s.focusOption("pageup");break;case"PageDown":if(!C)return;s.focusOption("pagedown");break;case"Home":if(!C)return;s.focusOption("first");break;case"End":if(!C)return;s.focusOption("last");break;default:return}c.preventDefault()}},s.state.instancePrefix="react-select-"+(s.props.instanceId||++Xlt),s.state.selectValue=Rhe(r.value),r.menuIsOpen&&s.state.selectValue.length){var a=s.getFocusableOptionsWithIds(),o=s.buildFocusableOptions(),l=o.indexOf(s.state.selectValue[0]);s.state.focusableOptionsWithIds=a,s.state.focusedOption=o[l],s.state.focusedOptionId=qz(a,o[l])}return s}return yit(n,[{key:"componentDidMount",value:function(){this.startListeningComposition(),this.startListeningToTouch(),this.props.closeMenuOnScroll&&document&&document.addEventListener&&document.addEventListener("scroll",this.onScroll,!0),this.props.autoFocus&&this.focusInput(),this.props.menuIsOpen&&this.state.focusedOption&&this.menuListRef&&this.focusedOptionRef&&Lhe(this.menuListRef,this.focusedOptionRef)}},{key:"componentDidUpdate",value:function(s){var a=this.props,o=a.isDisabled,l=a.menuIsOpen,c=this.state.isFocused;(c&&!o&&s.isDisabled||c&&l&&!s.menuIsOpen)&&this.focusInput(),c&&o&&!s.isDisabled?this.setState({isFocused:!1},this.onMenuClose):!c&&!o&&s.isDisabled&&this.inputRef===document.activeElement&&this.setState({isFocused:!0}),this.menuListRef&&this.focusedOptionRef&&this.scrollToFocusedOptionOnUpdate&&(Lhe(this.menuListRef,this.focusedOptionRef),this.scrollToFocusedOptionOnUpdate=!1)}},{key:"componentWillUnmount",value:function(){this.stopListeningComposition(),this.stopListeningToTouch(),document.removeEventListener("scroll",this.onScroll,!0)}},{key:"onMenuOpen",value:function(){this.props.onMenuOpen()}},{key:"onMenuClose",value:function(){this.onInputChange("",{action:"menu-close",prevInputValue:this.props.inputValue}),this.props.onMenuClose()}},{key:"onInputChange",value:function(s,a){this.props.onInputChange(s,a)}},{key:"focusInput",value:function(){this.inputRef&&this.inputRef.focus()}},{key:"blurInput",value:function(){this.inputRef&&this.inputRef.blur()}},{key:"openMenu",value:function(s){var a=this,o=this.state,l=o.selectValue,c=o.isFocused,u=this.buildFocusableOptions(),d=s==="first"?0:u.length-1;if(!this.props.isMulti){var f=u.indexOf(l[0]);f>-1&&(d=f)}this.scrollToFocusedOptionOnUpdate=!(c&&this.menuListRef),this.setState({inputIsHiddenAfterUpdate:!1,focusedValue:null,focusedOption:u[d],focusedOptionId:this.getFocusedOptionId(u[d])},function(){return a.onMenuOpen()})}},{key:"focusValue",value:function(s){var a=this.state,o=a.selectValue,l=a.focusedValue;if(this.props.isMulti){this.setState({focusedOption:null});var c=o.indexOf(l);l||(c=-1);var u=o.length-1,d=-1;if(o.length){switch(s){case"previous":c===0?d=0:c===-1?d=u:d=c-1;break;case"next":c>-1&&c<u&&(d=c+1);break}this.setState({inputIsHidden:d!==-1,focusedValue:o[d]})}}}},{key:"focusOption",value:function(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"first",a=this.props.pageSize,o=this.state.focusedOption,l=this.getFocusableOptions();if(l.length){var c=0,u=l.indexOf(o);o||(u=-1),s==="up"?c=u>0?u-1:l.length-1:s==="down"?c=(u+1)%l.length:s==="pageup"?(c=u-a,c<0&&(c=0)):s==="pagedown"?(c=u+a,c>l.length-1&&(c=l.length-1)):s==="last"&&(c=l.length-1),this.scrollToFocusedOptionOnUpdate=!0,this.setState({focusedOption:l[c],focusedValue:null,focusedOptionId:this.getFocusedOptionId(l[c])})}}},{key:"getTheme",value:function(){return this.props.theme?typeof this.props.theme=="function"?this.props.theme(Wz):Ks(Ks({},Wz),this.props.theme):Wz}},{key:"getCommonProps",value:function(){var s=this.clearValue,a=this.cx,o=this.getStyles,l=this.getClassNames,c=this.getValue,u=this.selectOption,d=this.setValue,f=this.props,x=f.isMulti,g=f.isRtl,v=f.options,w=this.hasValue();return{clearValue:s,cx:a,getStyles:o,getClassNames:l,getValue:c,hasValue:w,isMulti:x,isRtl:g,options:v,selectOption:u,selectProps:f,setValue:d,theme:this.getTheme()}}},{key:"hasValue",value:function(){var s=this.state.selectValue;return s.length>0}},{key:"hasOptions",value:function(){return!!this.getFocusableOptions().length}},{key:"isClearable",value:function(){var s=this.props,a=s.isClearable,o=s.isMulti;return a===void 0?o:a}},{key:"isOptionDisabled",value:function(s,a){return yje(this.props,s,a)}},{key:"isOptionSelected",value:function(s,a){return vje(this.props,s,a)}},{key:"filterOption",value:function(s,a){return wje(this.props,s,a)}},{key:"formatOptionLabel",value:function(s,a){if(typeof this.props.formatOptionLabel=="function"){var o=this.props.inputValue,l=this.state.selectValue;return this.props.formatOptionLabel(s,{context:a,inputValue:o,selectValue:l})}else return this.getOptionLabel(s)}},{key:"formatGroupLabel",value:function(s){return this.props.formatGroupLabel(s)}},{key:"startListeningComposition",value:function(){document&&document.addEventListener&&(document.addEventListener("compositionstart",this.onCompositionStart,!1),document.addEventListener("compositionend",this.onCompositionEnd,!1))}},{key:"stopListeningComposition",value:function(){document&&document.removeEventListener&&(document.removeEventListener("compositionstart",this.onCompositionStart),document.removeEventListener("compositionend",this.onCompositionEnd))}},{key:"startListeningToTouch",value:function(){document&&document.addEventListener&&(document.addEventListener("touchstart",this.onTouchStart,!1),document.addEventListener("touchmove",this.onTouchMove,!1),document.addEventListener("touchend",this.onTouchEnd,!1))}},{key:"stopListeningToTouch",value:function(){document&&document.removeEventListener&&(document.removeEventListener("touchstart",this.onTouchStart),document.removeEventListener("touchmove",this.onTouchMove),document.removeEventListener("touchend",this.onTouchEnd))}},{key:"renderInput",value:function(){var s=this.props,a=s.isDisabled,o=s.isSearchable,l=s.inputId,c=s.inputValue,u=s.tabIndex,d=s.form,f=s.menuIsOpen,x=s.required,g=this.getComponents(),v=g.Input,w=this.state,C=w.inputIsHidden,N=w.ariaSelection,P=this.commonProps,I=l||this.getElementId("input"),R=Ks(Ks(Ks({"aria-autocomplete":"list","aria-expanded":f,"aria-haspopup":!0,"aria-errormessage":this.props["aria-errormessage"],"aria-invalid":this.props["aria-invalid"],"aria-label":this.props["aria-label"],"aria-labelledby":this.props["aria-labelledby"],"aria-required":x,role:"combobox","aria-activedescendant":this.isAppleDevice?void 0:this.state.focusedOptionId||""},f&&{"aria-controls":this.getElementId("listbox")}),!o&&{"aria-readonly":!0}),this.hasValue()?(N==null?void 0:N.action)==="initial-input-focus"&&{"aria-describedby":this.getElementId("live-region")}:{"aria-describedby":this.getElementId("placeholder")});return o?m.createElement(v,ti({},P,{autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",id:I,innerRef:this.getInputRef,isDisabled:a,isHidden:C,onBlur:this.onInputBlur,onChange:this.handleInputChange,onFocus:this.onInputFocus,spellCheck:"false",tabIndex:u,form:d,type:"text",value:c},R)):m.createElement(Clt,ti({id:I,innerRef:this.getInputRef,onBlur:this.onInputBlur,onChange:eM,onFocus:this.onInputFocus,disabled:a,tabIndex:u,inputMode:"none",form:d,value:""},R))}},{key:"renderPlaceholderOrValue",value:function(){var s=this,a=this.getComponents(),o=a.MultiValue,l=a.MultiValueContainer,c=a.MultiValueLabel,u=a.MultiValueRemove,d=a.SingleValue,f=a.Placeholder,x=this.commonProps,g=this.props,v=g.controlShouldRenderValue,w=g.isDisabled,C=g.isMulti,N=g.inputValue,P=g.placeholder,I=this.state,R=I.selectValue,F=I.focusedValue,U=I.isFocused;if(!this.hasValue()||!v)return N?null:m.createElement(f,ti({},x,{key:"placeholder",isDisabled:w,isFocused:U,innerProps:{id:this.getElementId("placeholder")}}),P);if(C)return R.map(function(z,Q){var ne=z===F,J="".concat(s.getOptionLabel(z),"-").concat(s.getOptionValue(z));return m.createElement(o,ti({},x,{components:{Container:l,Label:c,Remove:u},isFocused:ne,isDisabled:w,key:J,index:Q,removeProps:{onClick:function(){return s.removeValue(z)},onTouchEnd:function(){return s.removeValue(z)},onMouseDown:function(re){re.preventDefault()}},data:z}),s.formatOptionLabel(z,"value"))});if(N)return null;var L=R[0];return m.createElement(d,ti({},x,{data:L,isDisabled:w}),this.formatOptionLabel(L,"value"))}},{key:"renderClearIndicator",value:function(){var s=this.getComponents(),a=s.ClearIndicator,o=this.commonProps,l=this.props,c=l.isDisabled,u=l.isLoading,d=this.state.isFocused;if(!this.isClearable()||!a||c||!this.hasValue()||u)return null;var f={onMouseDown:this.onClearIndicatorMouseDown,onTouchEnd:this.onClearIndicatorTouchEnd,"aria-hidden":"true"};return m.createElement(a,ti({},o,{innerProps:f,isFocused:d}))}},{key:"renderLoadingIndicator",value:function(){var s=this.getComponents(),a=s.LoadingIndicator,o=this.commonProps,l=this.props,c=l.isDisabled,u=l.isLoading,d=this.state.isFocused;if(!a||!u)return null;var f={"aria-hidden":"true"};return m.createElement(a,ti({},o,{innerProps:f,isDisabled:c,isFocused:d}))}},{key:"renderIndicatorSeparator",value:function(){var s=this.getComponents(),a=s.DropdownIndicator,o=s.IndicatorSeparator;if(!a||!o)return null;var l=this.commonProps,c=this.props.isDisabled,u=this.state.isFocused;return m.createElement(o,ti({},l,{isDisabled:c,isFocused:u}))}},{key:"renderDropdownIndicator",value:function(){var s=this.getComponents(),a=s.DropdownIndicator;if(!a)return null;var o=this.commonProps,l=this.props.isDisabled,c=this.state.isFocused,u={onMouseDown:this.onDropdownIndicatorMouseDown,onTouchEnd:this.onDropdownIndicatorTouchEnd,"aria-hidden":"true"};return m.createElement(a,ti({},o,{innerProps:u,isDisabled:l,isFocused:c}))}},{key:"renderMenu",value:function(){var s=this,a=this.getComponents(),o=a.Group,l=a.GroupHeading,c=a.Menu,u=a.MenuList,d=a.MenuPortal,f=a.LoadingMessage,x=a.NoOptionsMessage,g=a.Option,v=this.commonProps,w=this.state.focusedOption,C=this.props,N=C.captureMenuScroll,P=C.inputValue,I=C.isLoading,R=C.loadingMessage,F=C.minMenuHeight,U=C.maxMenuHeight,L=C.menuIsOpen,z=C.menuPlacement,Q=C.menuPosition,ne=C.menuPortalTarget,J=C.menuShouldBlockScroll,X=C.menuShouldScrollIntoView,re=C.noOptionsMessage,pe=C.onMenuScrollToTop,Y=C.onMenuScrollToBottom;if(!L)return null;var ie=function(Ne,he){var ge=Ne.type,ye=Ne.data,ve=Ne.isDisabled,je=Ne.isSelected,Ie=Ne.label,Le=Ne.value,Qe=w===ye,$e=ve?void 0:function(){return s.onOptionHover(ye)},it=ve?void 0:function(){return s.selectOption(ye)},tt="".concat(s.getElementId("option"),"-").concat(he),lt={id:tt,onClick:it,onMouseMove:$e,onMouseOver:$e,tabIndex:-1,role:"option","aria-selected":s.isAppleDevice?void 0:je};return m.createElement(g,ti({},v,{innerProps:lt,data:ye,isDisabled:ve,isSelected:je,key:tt,label:Ie,type:ge,value:Le,isFocused:Qe,innerRef:Qe?s.getFocusedOptionRef:void 0}),s.formatOptionLabel(Ne.data,"menu"))},oe;if(this.hasOptions())oe=this.getCategorizedOptions().map(function(fe){if(fe.type==="group"){var Ne=fe.data,he=fe.options,ge=fe.index,ye="".concat(s.getElementId("group"),"-").concat(ge),ve="".concat(ye,"-heading");return m.createElement(o,ti({},v,{key:ye,data:Ne,options:he,Heading:l,headingProps:{id:ve,data:fe.data},label:s.formatGroupLabel(fe.data)}),fe.options.map(function(je){return ie(je,"".concat(ge,"-").concat(je.index))}))}else if(fe.type==="option")return ie(fe,"".concat(fe.index))});else if(I){var G=R({inputValue:P});if(G===null)return null;oe=m.createElement(f,v,G)}else{var V=re({inputValue:P});if(V===null)return null;oe=m.createElement(x,v,V)}var ee={minMenuHeight:F,maxMenuHeight:U,menuPlacement:z,menuPosition:Q,menuShouldScrollIntoView:X},ae=m.createElement(tot,ti({},v,ee),function(fe){var Ne=fe.ref,he=fe.placerProps,ge=he.placement,ye=he.maxHeight;return m.createElement(c,ti({},v,ee,{innerRef:Ne,innerProps:{onMouseDown:s.onMenuMouseDown,onMouseMove:s.onMenuMouseMove},isLoading:I,placement:ge}),m.createElement(_lt,{captureEnabled:N,onTopArrive:pe,onBottomArrive:Y,lockEnabled:J},function(ve){return m.createElement(u,ti({},v,{innerRef:function(Ie){s.getMenuListRef(Ie),ve(Ie)},innerProps:{role:"listbox","aria-multiselectable":v.isMulti,id:s.getElementId("listbox")},isLoading:I,maxHeight:ye,focusedOption:w}),oe)}))});return ne||Q==="fixed"?m.createElement(d,ti({},v,{appendTo:ne,controlElement:this.controlRef,menuPlacement:z,menuPosition:Q}),ae):ae}},{key:"renderFormField",value:function(){var s=this,a=this.props,o=a.delimiter,l=a.isDisabled,c=a.isMulti,u=a.name,d=a.required,f=this.state.selectValue;if(d&&!this.hasValue()&&!l)return m.createElement(Ilt,{name:u,onFocus:this.onValueInputFocus});if(!(!u||l))if(c)if(o){var x=f.map(function(w){return s.getOptionValue(w)}).join(o);return m.createElement("input",{name:u,type:"hidden",value:x})}else{var g=f.length>0?f.map(function(w,C){return m.createElement("input",{key:"i-".concat(C),name:u,type:"hidden",value:s.getOptionValue(w)})}):m.createElement("input",{name:u,type:"hidden",value:""});return m.createElement("div",null,g)}else{var v=f[0]?this.getOptionValue(f[0]):"";return m.createElement("input",{name:u,type:"hidden",value:v})}}},{key:"renderLiveRegion",value:function(){var s=this.commonProps,a=this.state,o=a.ariaSelection,l=a.focusedOption,c=a.focusedValue,u=a.isFocused,d=a.selectValue,f=this.getFocusableOptions();return m.createElement(xlt,ti({},s,{id:this.getElementId("live-region"),ariaSelection:o,focusedOption:l,focusedValue:c,isFocused:u,selectValue:d,focusableOptions:f,isAppleDevice:this.isAppleDevice}))}},{key:"render",value:function(){var s=this.getComponents(),a=s.Control,o=s.IndicatorsContainer,l=s.SelectContainer,c=s.ValueContainer,u=this.props,d=u.className,f=u.id,x=u.isDisabled,g=u.menuIsOpen,v=this.state.isFocused,w=this.commonProps=this.getCommonProps();return m.createElement(l,ti({},w,{className:d,innerProps:{id:f,onKeyDown:this.onKeyDown},isDisabled:x,isFocused:v}),this.renderLiveRegion(),m.createElement(a,ti({},w,{innerRef:this.getControlRef,innerProps:{onMouseDown:this.onControlMouseDown,onTouchEnd:this.onControlTouchEnd},isDisabled:x,isFocused:v,menuIsOpen:g}),m.createElement(c,ti({},w,{isDisabled:x}),this.renderPlaceholderOrValue(),this.renderInput()),m.createElement(o,ti({},w,{isDisabled:x}),this.renderClearIndicator(),this.renderLoadingIndicator(),this.renderIndicatorSeparator(),this.renderDropdownIndicator())),this.renderMenu(),this.renderFormField())}}],[{key:"getDerivedStateFromProps",value:function(s,a){var o=a.prevProps,l=a.clearFocusValueOnUpdate,c=a.inputIsHiddenAfterUpdate,u=a.ariaSelection,d=a.isFocused,f=a.prevWasFocused,x=a.instancePrefix,g=s.options,v=s.value,w=s.menuIsOpen,C=s.inputValue,N=s.isMulti,P=Rhe(v),I={};if(o&&(v!==o.value||g!==o.options||w!==o.menuIsOpen||C!==o.inputValue)){var R=w?Glt(s,P):[],F=w?Qhe(MF(s,P),"".concat(x,"-option")):[],U=l?Klt(a,P):null,L=Ylt(a,R),z=qz(F,L);I={selectValue:P,focusedOption:L,focusedOptionId:z,focusableOptionsWithIds:F,focusedValue:U,clearFocusValueOnUpdate:!1}}var Q=c!=null&&s!==o?{inputIsHidden:c,inputIsHiddenAfterUpdate:void 0}:{},ne=u,J=d&&f;return d&&!J&&(ne={value:PI(N,P,P[0]||null),options:P,action:"initial-input-focus"},J=!f),(u==null?void 0:u.action)==="initial-input-focus"&&(ne=null),Ks(Ks(Ks({},I),Q),{},{prevProps:s,ariaSelection:ne,prevWasFocused:J})}}]),n}(m.Component);Sje.defaultProps=qlt;var Qlt=m.forwardRef(function(e,t){var n=git(e);return m.createElement(Sje,ti({ref:t},n))}),Cl=Qlt;function su(e){if(!e)return"--/--/--";const t=new Date(e),n=t.toLocaleString("en-US",{month:"short"}),r=t.getDate(),s=t.getFullYear(),a=String(t.getHours()%12||12).padStart(2,"0"),o=String(t.getMinutes()).padStart(2,"0");String(t.getSeconds()).padStart(2,"0");const l=t.getHours()>=12?" PM":" AM";return`${n} ${r}, ${s}, ${a}:${o} ${l}`}function p3(e){const t=new Date(e),n=t.toLocaleString("en-US",{month:"short"}),r=t.getDate(),s=t.getFullYear();return String(t.getHours()%12||12).padStart(2,"0"),String(t.getMinutes()).padStart(2,"0"),String(t.getSeconds()).padStart(2,"0"),t.getHours()>=12,`${n} ${r}, ${s}`}function Mo(e){const t=new Date(e),r=Math.floor((new Date().getTime()-t.getTime())/1e3),s=Math.floor(r/60),a=Math.floor(r/3600),o=Math.floor(r/86400),l=Math.floor(r/31536e3),c=s%60,u=a%24,d=o%365;return{dateTime:r<60?`${r} seconds ago`:r<3600?`${s} minutes ago`:r<86400?c>0?`${a} hours ${c} minutes ago`:`${a} hours ago`:r<31536e3?u>0?`${o} days ${u} hours ago`:`${o} days ago`:d>0?`${l} years ${d} days ago`:`${l} years ago`}}function Zlt(e){const t=new Date(Number(e)),n=String(t.getDate()).padStart(2,"0"),r=String(t.getMonth()+1).padStart(2,"0"),s=t.getFullYear(),a=String(t.getHours()).padStart(2,"0"),o=String(t.getMinutes()).padStart(2,"0");String(t.getSeconds()).padStart(2,"0");const l=t.getHours()>=12?" PM":" AM";return`${n}/${r}/${s} ${a}:${o} ${l}`}function FI(e){if(!e)return"--";const t=new Date(Number(e)),n=String(t.getDate()).padStart(2,"0"),r=String(t.getMonth()+1).padStart(2,"0"),s=t.getFullYear();return String(t.getHours()).padStart(2,"0"),String(t.getMinutes()).padStart(2,"0"),String(t.getSeconds()).padStart(2,"0"),`${n}/${r}/${s}`}function Jlt(e){const t=new Date(e),n=String(t.getDate()).padStart(2,"0"),r=String(t.getMonth()+1).padStart(2,"0"),s=t.getFullYear();return String(t.getHours()).padStart(2,"0"),String(t.getMinutes()).padStart(2,"0"),`${n}/${r}/${s}`}function Fs(e){if(e==null||isNaN(e))return"-";const t=e.toString();if(t.includes(".")){const n=t.split(".")[0];return new Intl.NumberFormat("en-US").format(parseInt(n))}return new Intl.NumberFormat("en-US").format(parseInt(e))}function ect(e){try{var t=e.split(".")[1],n=t.replace(/-/g,"+").replace(/_/g,"/"),r=decodeURIComponent(atob(n).split("").map(function(s){return"%"+("00"+s.charCodeAt(0).toString(16)).slice(-2)}).join(""));return JSON.parse(r)}catch{return JSON.parse(!1)}}function Er(e){if(e==null||isNaN(e))return"--";const t=parseFloat(e),n=Math.floor(t)===0;let r=t.toLocaleString("en-US",{minimumFractionDigits:0,maximumFractionDigits:n?4:2,useGrouping:!0});if(r.includes(".")){const[s,a]=r.split("."),o=a.replace(/0+$/,"");r=o?`${s}.${o}`:s}return r}function tct(e){if(e==null||isNaN(e))return"--";const t=parseFloat(e),n=Math.floor(t)===0,r=t>=1e3;let s=t.toLocaleString("en-US",{minimumFractionDigits:0,maximumFractionDigits:r?0:n?4:2,useGrouping:!0});if(!r&&s.includes(".")){const[a,o]=s.split("."),l=o.replace(/0+$/,"");s=l?`${a}.${l}`:a}return s}function ao(e){if(e==null||isNaN(e)||e===0)return"--";const t=parseFloat(e),n=t>=1e3;let r=t.toLocaleString("en-US",{minimumFractionDigits:n?2:0,maximumFractionDigits:n?2:4,useGrouping:!0});if(r.includes(".")){const[s,a]=r.split(".");r=`${s}.${a.replace(/0+$/,"")}`}return r.replace(/\.$/,"")}function fy(e){if(e==null||isNaN(e)||e===0)return"--";const t=parseFloat(e),n=t%1!==0;return t.toLocaleString("en-US",{minimumFractionDigits:n?4:0,maximumFractionDigits:4,useGrouping:!0})}function Sv(e){if(e==null||isNaN(e)||e===0)return"--";const t=parseFloat(e),n=t>=1e3;let r=t.toLocaleString("en-US",{minimumFractionDigits:0,maximumFractionDigits:n?2:4,useGrouping:!0});if(r.includes(".")){const[s,a]=r.split(".");r=`${s}.${a.slice(0,2)}`}return r.replace(/(\.\d*?)0+$/,"$1").replace(/\.$/,"")}const KD=e=>e?`${e.slice(0,4)}..${e.slice(-4)}`:"-";function ed(e){const t=parseFloat(e);return isNaN(t)?"0.00":t>=1e9?(t/1e9).toFixed(2).replace(/\.00$/,"")+"B":t>=1e6?(t/1e6).toFixed(2).replace(/\.00$/,"")+"M":t>=1e3?(t/1e3).toFixed(2).replace(/\.00$/,"")+"K":t.toFixed(2).replace(/\.00$/,"")}function Ww(e){if(isNaN(e))return;const t=e.toString().replace(".",",");return Number(t.replace(",",".")).toLocaleString("en-US",{maximumFractionDigits:20})}const Nje="2.28.0";let m7={getDocsUrl:({docsBaseUrl:e,docsPath:t="",docsSlug:n})=>t?`${e??"https://viem.sh"}${t}${n?`#${n}`:""}`:void 0,version:`viem@${Nje}`},Dr=class iZ extends Error{constructor(t,n={}){var l;const r=(()=>{var c;return n.cause instanceof iZ?n.cause.details:(c=n.cause)!=null&&c.message?n.cause.message:n.details})(),s=n.cause instanceof iZ&&n.cause.docsPath||n.docsPath,a=(l=m7.getDocsUrl)==null?void 0:l.call(m7,{...n,docsPath:s}),o=[t||"An error occurred.","",...n.metaMessages?[...n.metaMessages,""]:[],...a?[`Docs: ${a}`]:[],...r?[`Details: ${r}`]:[],...m7.version?[`Version: ${m7.version}`]:[]].join(`
`);super(o,n.cause?{cause:n.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),this.details=r,this.docsPath=s,this.metaMessages=n.metaMessages,this.name=n.name??this.name,this.shortMessage=t,this.version=Nje}walk(t){return Aje(this,t)}};function Aje(e,t){return t!=null&&t(e)?e:e&&typeof e=="object"&&"cause"in e&&e.cause!==void 0?Aje(e.cause,t):t?null:e}let jje=class extends Dr{constructor({max:t,min:n,signed:r,size:s,value:a}){super(`Number "${a}" is not in safe ${s?`${s*8}-bit ${r?"signed":"unsigned"} `:""}integer range ${t?`(${n} to ${t})`:`(above ${n})`}`,{name:"IntegerOutOfRangeError"})}};class nct extends Dr{constructor(t){super(`Bytes value "${t}" is not a valid boolean. The bytes array must contain a single byte of either a 0 or 1 value.`,{name:"InvalidBytesBooleanError"})}}class rct extends Dr{constructor(t){super(`Hex value "${t}" is not a valid boolean. The hex value must be "0x0" (false) or "0x1" (true).`,{name:"InvalidHexBooleanError"})}}let sct=class extends Dr{constructor({givenSize:t,maxSize:n}){super(`Size cannot exceed ${n} bytes. Given size: ${t} bytes.`,{name:"SizeOverflowError"})}},Eje=class extends Dr{constructor({offset:t,position:n,size:r}){super(`Slice ${n==="start"?"starting":"ending"} at offset "${t}" is out-of-bounds (size: ${r}).`,{name:"SliceOffsetOutOfBoundsError"})}},_je=class extends Dr{constructor({size:t,targetSize:n,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} size (${t}) exceeds padding size (${n}).`,{name:"SizeExceedsPaddingSizeError"})}};class Jhe extends Dr{constructor({size:t,targetSize:n,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} is expected to be ${n} ${r} long, but is ${t} ${r} long.`,{name:"InvalidBytesLengthError"})}}function hA(e,{dir:t,size:n=32}={}){return typeof e=="string"?wy(e,{dir:t,size:n}):ict(e,{dir:t,size:n})}function wy(e,{dir:t,size:n=32}={}){if(n===null)return e;const r=e.replace("0x","");if(r.length>n*2)throw new _je({size:Math.ceil(r.length/2),targetSize:n,type:"hex"});return`0x${r[t==="right"?"padEnd":"padStart"](n*2,"0")}`}function ict(e,{dir:t,size:n=32}={}){if(n===null)return e;if(e.length>n)throw new _je({size:e.length,targetSize:n,type:"bytes"});const r=new Uint8Array(n);for(let s=0;s<n;s++){const a=t==="right";r[a?s:n-s-1]=e[a?s:e.length-s-1]}return r}function Y0(e,{strict:t=!0}={}){return!e||typeof e!="string"?!1:t?/^0x[0-9a-fA-F]*$/.test(e):e.startsWith("0x")}function sl(e){return Y0(e,{strict:!1})?Math.ceil((e.length-2)/2):e.length}function Hf(e,{dir:t="left"}={}){let n=typeof e=="string"?e.replace("0x",""):e,r=0;for(let s=0;s<n.length-1&&n[t==="left"?s:n.length-s-1].toString()==="0";s++)r++;return n=t==="left"?n.slice(r):n.slice(0,n.length-r),typeof e=="string"?(n.length===1&&t==="right"&&(n=`${n}0`),`0x${n.length%2===1?`0${n}`:n}`):n}const act=new TextEncoder;function pA(e,t={}){return typeof e=="number"||typeof e=="bigint"?lct(e,t):typeof e=="boolean"?oct(e,t):Y0(e)?sp(e,t):qw(e,t)}function oct(e,t={}){const n=new Uint8Array(1);return n[0]=Number(e),typeof t.size=="number"?(hp(n,{size:t.size}),hA(n,{size:t.size})):n}const Dx={zero:48,nine:57,A:65,F:70,a:97,f:102};function epe(e){if(e>=Dx.zero&&e<=Dx.nine)return e-Dx.zero;if(e>=Dx.A&&e<=Dx.F)return e-(Dx.A-10);if(e>=Dx.a&&e<=Dx.f)return e-(Dx.a-10)}function sp(e,t={}){let n=e;t.size&&(hp(n,{size:t.size}),n=hA(n,{dir:"right",size:t.size}));let r=n.slice(2);r.length%2&&(r=`0${r}`);const s=r.length/2,a=new Uint8Array(s);for(let o=0,l=0;o<s;o++){const c=epe(r.charCodeAt(l++)),u=epe(r.charCodeAt(l++));if(c===void 0||u===void 0)throw new Dr(`Invalid byte sequence ("${r[l-2]}${r[l-1]}" in "${r}").`);a[o]=c*16+u}return a}function lct(e,t){const n=$s(e,t);return sp(n)}function qw(e,t={}){const n=act.encode(e);return typeof t.size=="number"?(hp(n,{size:t.size}),hA(n,{dir:"right",size:t.size})):n}function hp(e,{size:t}){if(sl(e)>t)throw new sct({givenSize:sl(e),maxSize:t})}function nd(e,t={}){const{signed:n}=t;t.size&&hp(e,{size:t.size});const r=BigInt(e);if(!n)return r;const s=(e.length-2)/2,a=(1n<<BigInt(s)*8n-1n)-1n;return r<=a?r:r-BigInt(`0x${"f".padStart(s*2,"f")}`)-1n}function cct(e,t={}){let n=e;if(t.size&&(hp(n,{size:t.size}),n=Hf(n)),Hf(n)==="0x00")return!1;if(Hf(n)==="0x01")return!0;throw new rct(n)}function X0(e,t={}){return Number(nd(e,t))}function uct(e,t={}){let n=sp(e);return t.size&&(hp(n,{size:t.size}),n=Hf(n,{dir:"right"})),new TextDecoder().decode(n)}const dct=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function ci(e,t={}){return typeof e=="number"||typeof e=="bigint"?$s(e,t):typeof e=="string"?IS(e,t):typeof e=="boolean"?kje(e,t):Wl(e,t)}function kje(e,t={}){const n=`0x${Number(e)}`;return typeof t.size=="number"?(hp(n,{size:t.size}),hA(n,{size:t.size})):n}function Wl(e,t={}){let n="";for(let s=0;s<e.length;s++)n+=dct[e[s]];const r=`0x${n}`;return typeof t.size=="number"?(hp(r,{size:t.size}),hA(r,{dir:"right",size:t.size})):r}function $s(e,t={}){const{signed:n,size:r}=t,s=BigInt(e);let a;r?n?a=(1n<<BigInt(r)*8n-1n)-1n:a=2n**(BigInt(r)*8n)-1n:typeof e=="number"&&(a=BigInt(Number.MAX_SAFE_INTEGER));const o=typeof a=="bigint"&&n?-a-1n:0;if(a&&s>a||s<o){const c=typeof e=="bigint"?"n":"";throw new jje({max:a?`${a}${c}`:void 0,min:`${o}${c}`,signed:n,size:r,value:`${e}${c}`})}const l=`0x${(n&&s<0?(1n<<BigInt(r*8))+BigInt(s):s).toString(16)}`;return r?hA(l,{size:r}):l}const fct=new TextEncoder;function IS(e,t={}){const n=fct.encode(e);return Wl(n,t)}function xm(e,{includeName:t=!1}={}){if(e.type!=="function"&&e.type!=="event"&&e.type!=="error")throw new Act(e.type);return`${e.name}(${YD(e.inputs,{includeName:t})})`}function YD(e,{includeName:t=!1}={}){return e?e.map(n=>hct(n,{includeName:t})).join(t?", ":","):""}function hct(e,{includeName:t}){return e.type.startsWith("tuple")?`(${YD(e.components,{includeName:t})})${e.type.slice(5)}`:e.type+(t&&e.name?` ${e.name}`:"")}class pct extends Dr{constructor({docsPath:t}){super(["A constructor was not found on the ABI.","Make sure you are using the correct ABI and that the constructor exists on it."].join(`
`),{docsPath:t,name:"AbiConstructorNotFoundError"})}}class tpe extends Dr{constructor({docsPath:t}){super(["Constructor arguments were provided (`args`), but a constructor parameters (`inputs`) were not found on the ABI.","Make sure you are using the correct ABI, and that the `inputs` attribute on the constructor exists."].join(`
`),{docsPath:t,name:"AbiConstructorParamsNotFoundError"})}}class Tje extends Dr{constructor({data:t,params:n,size:r}){super([`Data size of ${r} bytes is too small for given parameters.`].join(`
`),{metaMessages:[`Params: (${YD(n,{includeName:!0})})`,`Data: ${t} (${r} bytes)`],name:"AbiDecodingDataSizeTooSmallError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"params",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"size",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=t,this.params=n,this.size=r}}class Ak extends Dr{constructor(){super('Cannot decode zero data ("0x") with ABI parameters.',{name:"AbiDecodingZeroDataError"})}}class mct extends Dr{constructor({expectedLength:t,givenLength:n,type:r}){super([`ABI encoding array length mismatch for type ${r}.`,`Expected length: ${t}`,`Given length: ${n}`].join(`
`),{name:"AbiEncodingArrayLengthMismatchError"})}}class xct extends Dr{constructor({expectedSize:t,value:n}){super(`Size of bytes "${n}" (bytes${sl(n)}) does not match expected size (bytes${t}).`,{name:"AbiEncodingBytesSizeMismatchError"})}}class gct extends Dr{constructor({expectedLength:t,givenLength:n}){super(["ABI encoding params/values length mismatch.",`Expected length (params): ${t}`,`Given length (values): ${n}`].join(`
`),{name:"AbiEncodingLengthMismatchError"})}}class bct extends Dr{constructor(t,{docsPath:n}){super([`Arguments (\`args\`) were provided to "${t}", but "${t}" on the ABI does not contain any parameters (\`inputs\`).`,"Cannot encode error result without knowing what the parameter types are.","Make sure you are using the correct ABI and that the inputs exist on it."].join(`
`),{docsPath:n,name:"AbiErrorInputsNotFoundError"})}}class npe extends Dr{constructor(t,{docsPath:n}={}){super([`Error ${t?`"${t}" `:""}not found on ABI.`,"Make sure you are using the correct ABI and that the error exists on it."].join(`
`),{docsPath:n,name:"AbiErrorNotFoundError"})}}class Ije extends Dr{constructor(t,{docsPath:n}){super([`Encoded error signature "${t}" not found on ABI.`,"Make sure you are using the correct ABI and that the error exists on it.",`You can look up the decoded signature here: https://openchain.xyz/signatures?query=${t}.`].join(`
`),{docsPath:n,name:"AbiErrorSignatureNotFoundError"}),Object.defineProperty(this,"signature",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.signature=t}}class yct extends Dr{constructor({docsPath:t}){super("Cannot extract event signature from empty topics.",{docsPath:t,name:"AbiEventSignatureEmptyTopicsError"})}}class Pje extends Dr{constructor(t,{docsPath:n}){super([`Encoded event signature "${t}" not found on ABI.`,"Make sure you are using the correct ABI and that the event exists on it.",`You can look up the signature here: https://openchain.xyz/signatures?query=${t}.`].join(`
`),{docsPath:n,name:"AbiEventSignatureNotFoundError"})}}class rpe extends Dr{constructor(t,{docsPath:n}={}){super([`Event ${t?`"${t}" `:""}not found on ABI.`,"Make sure you are using the correct ABI and that the event exists on it."].join(`
`),{docsPath:n,name:"AbiEventNotFoundError"})}}class PS extends Dr{constructor(t,{docsPath:n}={}){super([`Function ${t?`"${t}" `:""}not found on ABI.`,"Make sure you are using the correct ABI and that the function exists on it."].join(`
`),{docsPath:n,name:"AbiFunctionNotFoundError"})}}class Fje extends Dr{constructor(t,{docsPath:n}){super([`Function "${t}" does not contain any \`outputs\` on ABI.`,"Cannot decode function result without knowing what the parameter types are.","Make sure you are using the correct ABI and that the function exists on it."].join(`
`),{docsPath:n,name:"AbiFunctionOutputsNotFoundError"})}}class vct extends Dr{constructor(t,{docsPath:n}){super([`Encoded function signature "${t}" not found on ABI.`,"Make sure you are using the correct ABI and that the function exists on it.",`You can look up the signature here: https://openchain.xyz/signatures?query=${t}.`].join(`
`),{docsPath:n,name:"AbiFunctionSignatureNotFoundError"})}}class wct extends Dr{constructor(t,n){super("Found ambiguous types in overloaded ABI items.",{metaMessages:[`\`${t.type}\` in \`${xm(t.abiItem)}\`, and`,`\`${n.type}\` in \`${xm(n.abiItem)}\``,"","These types encode differently and cannot be distinguished at runtime.","Remove one of the ambiguous items in the ABI."],name:"AbiItemAmbiguityError"})}}let Cct=class extends Dr{constructor({expectedSize:t,givenSize:n}){super(`Expected bytes${t}, got bytes${n}.`,{name:"BytesSizeMismatchError"})}};class O9 extends Dr{constructor({abiItem:t,data:n,params:r,size:s}){super([`Data size of ${s} bytes is too small for non-indexed event parameters.`].join(`
`),{metaMessages:[`Params: (${YD(r,{includeName:!0})})`,`Data: ${n} (${s} bytes)`],name:"DecodeLogDataMismatch"}),Object.defineProperty(this,"abiItem",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"params",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"size",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abiItem=t,this.data=n,this.params=r,this.size=s}}class XD extends Dr{constructor({abiItem:t,param:n}){super([`Expected a topic for indexed event parameter${n.name?` "${n.name}"`:""} on event "${xm(t,{includeName:!0})}".`].join(`
`),{name:"DecodeLogTopicsMismatch"}),Object.defineProperty(this,"abiItem",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abiItem=t}}class Sct extends Dr{constructor(t,{docsPath:n}){super([`Type "${t}" is not a valid encoding type.`,"Please provide a valid ABI type."].join(`
`),{docsPath:n,name:"InvalidAbiEncodingType"})}}class Nct extends Dr{constructor(t,{docsPath:n}){super([`Type "${t}" is not a valid decoding type.`,"Please provide a valid ABI type."].join(`
`),{docsPath:n,name:"InvalidAbiDecodingType"})}}let Oje=class extends Dr{constructor(t){super([`Value "${t}" is not a valid array.`].join(`
`),{name:"InvalidArrayError"})}};class Act extends Dr{constructor(t){super([`"${t}" is not a valid definition type.`,'Valid types: "function", "event", "error"'].join(`
`),{name:"InvalidDefinitionTypeError"})}}function s1(e){return typeof e[0]=="string"?Sm(e):jct(e)}function jct(e){let t=0;for(const s of e)t+=s.length;const n=new Uint8Array(t);let r=0;for(const s of e)n.set(s,r),r+=s.length;return n}function Sm(e){return`0x${e.reduce((t,n)=>t+n.replace("0x",""),"")}`}let pd=class extends Dr{constructor({address:t}){super(`Address "${t}" is invalid.`,{metaMessages:["- Address must be a hex value of 20 bytes (40 hex characters).","- Address must match its checksum counterpart."],name:"InvalidAddressError"})}},QD=class extends Map{constructor(t){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=t}get(t){const n=super.get(t);return super.has(t)&&n!==void 0&&(this.delete(t),super.set(t,n)),n}set(t,n){if(super.set(t,n),this.maxSize&&this.size>this.maxSize){const r=this.keys().next().value;r&&this.delete(r)}return this}};function rM(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function Ect(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function jk(e,...t){if(!Ect(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error("Uint8Array expected of length "+t+", got length="+e.length)}function _ct(e){if(typeof e!="function"||typeof e.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");rM(e.outputLen),rM(e.blockLen)}function FS(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function Mje(e,t){jk(e);const n=t.outputLen;if(e.length<n)throw new Error("digestInto() expects output buffer of length at least "+n)}const OI=BigInt(2**32-1),spe=BigInt(32);function kct(e,t=!1){return t?{h:Number(e&OI),l:Number(e>>spe&OI)}:{h:Number(e>>spe&OI)|0,l:Number(e&OI)|0}}function Tct(e,t=!1){let n=new Uint32Array(e.length),r=new Uint32Array(e.length);for(let s=0;s<e.length;s++){const{h:a,l:o}=kct(e[s],t);[n[s],r[s]]=[a,o]}return[n,r]}const Ict=(e,t,n)=>e<<n|t>>>32-n,Pct=(e,t,n)=>t<<n|e>>>32-n,Fct=(e,t,n)=>t<<n-32|e>>>64-n,Oct=(e,t,n)=>e<<n-32|t>>>64-n,L6=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */function Mct(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function Gz(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function Gm(e,t){return e<<32-t|e>>>t}const ipe=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function Rct(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}function ape(e){for(let t=0;t<e.length;t++)e[t]=Rct(e[t])}typeof Uint8Array.from([]).toHex=="function"&&Uint8Array.fromHex;function Lct(e){if(typeof e!="string")throw new Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array(new TextEncoder().encode(e))}function ZD(e){return typeof e=="string"&&(e=Lct(e)),jk(e),e}function Dct(...e){let t=0;for(let r=0;r<e.length;r++){const s=e[r];jk(s),t+=s.length}const n=new Uint8Array(t);for(let r=0,s=0;r<e.length;r++){const a=e[r];n.set(a,s),s+=a.length}return n}let Yse=class{clone(){return this._cloneInto()}};function Rje(e){const t=r=>e().update(ZD(r)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}function Bct(e=32){if(L6&&typeof L6.getRandomValues=="function")return L6.getRandomValues(new Uint8Array(e));if(L6&&typeof L6.randomBytes=="function")return Uint8Array.from(L6.randomBytes(e));throw new Error("crypto.getRandomValues must be defined")}const Lje=[],Dje=[],Bje=[],$ct=BigInt(0),x7=BigInt(1),Uct=BigInt(2),zct=BigInt(7),Hct=BigInt(256),Vct=BigInt(113);for(let e=0,t=x7,n=1,r=0;e<24;e++){[n,r]=[r,(2*n+3*r)%5],Lje.push(2*(5*r+n)),Dje.push((e+1)*(e+2)/2%64);let s=$ct;for(let a=0;a<7;a++)t=(t<<x7^(t>>zct)*Vct)%Hct,t&Uct&&(s^=x7<<(x7<<BigInt(a))-x7);Bje.push(s)}const[Wct,qct]=Tct(Bje,!0),ope=(e,t,n)=>n>32?Fct(e,t,n):Ict(e,t,n),lpe=(e,t,n)=>n>32?Oct(e,t,n):Pct(e,t,n);function Gct(e,t=24){const n=new Uint32Array(10);for(let r=24-t;r<24;r++){for(let o=0;o<10;o++)n[o]=e[o]^e[o+10]^e[o+20]^e[o+30]^e[o+40];for(let o=0;o<10;o+=2){const l=(o+8)%10,c=(o+2)%10,u=n[c],d=n[c+1],f=ope(u,d,1)^n[l],x=lpe(u,d,1)^n[l+1];for(let g=0;g<50;g+=10)e[o+g]^=f,e[o+g+1]^=x}let s=e[2],a=e[3];for(let o=0;o<24;o++){const l=Dje[o],c=ope(s,a,l),u=lpe(s,a,l),d=Lje[o];s=e[d],a=e[d+1],e[d]=c,e[d+1]=u}for(let o=0;o<50;o+=10){for(let l=0;l<10;l++)n[l]=e[o+l];for(let l=0;l<10;l++)e[o+l]^=~n[(l+2)%10]&n[(l+4)%10]}e[0]^=Wct[r],e[1]^=qct[r]}n.fill(0)}let Kct=class $je extends Yse{constructor(t,n,r,s=!1,a=24){if(super(),this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,this.enableXOF=!1,this.blockLen=t,this.suffix=n,this.outputLen=r,this.enableXOF=s,this.rounds=a,rM(r),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=Mct(this.state)}keccak(){ipe||ape(this.state32),Gct(this.state32,this.rounds),ipe||ape(this.state32),this.posOut=0,this.pos=0}update(t){FS(this);const{blockLen:n,state:r}=this;t=ZD(t);const s=t.length;for(let a=0;a<s;){const o=Math.min(n-this.pos,s-a);for(let l=0;l<o;l++)r[this.pos++]^=t[a++];this.pos===n&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:t,suffix:n,pos:r,blockLen:s}=this;t[r]^=n,n&128&&r===s-1&&this.keccak(),t[s-1]^=128,this.keccak()}writeInto(t){FS(this,!1),jk(t),this.finish();const n=this.state,{blockLen:r}=this;for(let s=0,a=t.length;s<a;){this.posOut>=r&&this.keccak();const o=Math.min(r-this.posOut,a-s);t.set(n.subarray(this.posOut,this.posOut+o),s),this.posOut+=o,s+=o}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return rM(t),this.xofInto(new Uint8Array(t))}digestInto(t){if(Mje(t,this),this.finished)throw new Error("digest() was already called");return this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(t){const{blockLen:n,suffix:r,outputLen:s,rounds:a,enableXOF:o}=this;return t||(t=new $je(n,r,s,o,a)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=a,t.suffix=r,t.outputLen=s,t.enableXOF=o,t.destroyed=this.destroyed,t}};const Yct=(e,t,n)=>Rje(()=>new Kct(t,e,n)),Xct=Yct(1,136,256/8);function eu(e,t){const n=t||"hex",r=Xct(Y0(e,{strict:!1})?pA(e):e);return n==="bytes"?r:ci(r)}const Kz=new QD(8192);function JD(e,t){if(Kz.has(`${e}.${t}`))return Kz.get(`${e}.${t}`);const n=t?`${t}${e.toLowerCase()}`:e.substring(2).toLowerCase(),r=eu(qw(n),"bytes"),s=(t?n.substring(`${t}0x`.length):n).split("");for(let o=0;o<40;o+=2)r[o>>1]>>4>=8&&s[o]&&(s[o]=s[o].toUpperCase()),(r[o>>1]&15)>=8&&s[o+1]&&(s[o+1]=s[o+1].toUpperCase());const a=`0x${s.join("")}`;return Kz.set(`${e}.${t}`,a),a}function jc(e,t){if(!ic(e,{strict:!1}))throw new pd({address:e});return JD(e,t)}const Qct=/^0x[a-fA-F0-9]{40}$/,Yz=new QD(8192);function ic(e,t){const{strict:n=!0}=t??{},r=`${e}.${n}`;if(Yz.has(r))return Yz.get(r);const s=Qct.test(e)?e.toLowerCase()===e?!0:n?JD(e)===e:!0:!1;return Yz.set(r,s),s}function m3(e,t,n,{strict:r}={}){return Y0(e,{strict:!1})?Vje(e,t,n,{strict:r}):Hje(e,t,n,{strict:r})}function Uje(e,t){if(typeof t=="number"&&t>0&&t>sl(e)-1)throw new Eje({offset:t,position:"start",size:sl(e)})}function zje(e,t,n){if(typeof t=="number"&&typeof n=="number"&&sl(e)!==n-t)throw new Eje({offset:n,position:"end",size:sl(e)})}function Hje(e,t,n,{strict:r}={}){Uje(e,t);const s=e.slice(t,n);return r&&zje(s,t,n),s}function Vje(e,t,n,{strict:r}={}){Uje(e,t);const s=`0x${e.replace("0x","").slice((t??0)*2,(n??e.length)*2)}`;return r&&zje(s,t,n),s}const Zct=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,Wje=/^(u?int)(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/;function s2(e,t){if(e.length!==t.length)throw new gct({expectedLength:e.length,givenLength:t.length});const n=Jct({params:e,values:t}),r=Qse(n);return r.length===0?"0x":r}function Jct({params:e,values:t}){const n=[];for(let r=0;r<e.length;r++)n.push(Xse({param:e[r],value:t[r]}));return n}function Xse({param:e,value:t}){const n=Zse(e.type);if(n){const[r,s]=n;return tut(t,{length:r,param:{...e,type:s}})}if(e.type==="tuple")return aut(t,{param:e});if(e.type==="address")return eut(t);if(e.type==="bool")return rut(t);if(e.type.startsWith("uint")||e.type.startsWith("int")){const r=e.type.startsWith("int"),[,,s="256"]=Wje.exec(e.type)??[];return sut(t,{signed:r,size:Number(s)})}if(e.type.startsWith("bytes"))return nut(t,{param:e});if(e.type==="string")return iut(t);throw new Sct(e.type,{docsPath:"/docs/contract/encodeAbiParameters"})}function Qse(e){let t=0;for(let a=0;a<e.length;a++){const{dynamic:o,encoded:l}=e[a];o?t+=32:t+=sl(l)}const n=[],r=[];let s=0;for(let a=0;a<e.length;a++){const{dynamic:o,encoded:l}=e[a];o?(n.push($s(t+s,{size:32})),r.push(l),s+=sl(l)):n.push(l)}return s1([...n,...r])}function eut(e){if(!ic(e))throw new pd({address:e});return{dynamic:!1,encoded:wy(e.toLowerCase())}}function tut(e,{length:t,param:n}){const r=t===null;if(!Array.isArray(e))throw new Oje(e);if(!r&&e.length!==t)throw new mct({expectedLength:t,givenLength:e.length,type:`${n.type}[${t}]`});let s=!1;const a=[];for(let o=0;o<e.length;o++){const l=Xse({param:n,value:e[o]});l.dynamic&&(s=!0),a.push(l)}if(r||s){const o=Qse(a);if(r){const l=$s(a.length,{size:32});return{dynamic:!0,encoded:a.length>0?s1([l,o]):l}}if(s)return{dynamic:!0,encoded:o}}return{dynamic:!1,encoded:s1(a.map(({encoded:o})=>o))}}function nut(e,{param:t}){const[,n]=t.type.split("bytes"),r=sl(e);if(!n){let s=e;return r%32!==0&&(s=wy(s,{dir:"right",size:Math.ceil((e.length-2)/2/32)*32})),{dynamic:!0,encoded:s1([wy($s(r,{size:32})),s])}}if(r!==Number.parseInt(n))throw new xct({expectedSize:Number.parseInt(n),value:e});return{dynamic:!1,encoded:wy(e,{dir:"right"})}}function rut(e){if(typeof e!="boolean")throw new Dr(`Invalid boolean value: "${e}" (type: ${typeof e}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:wy(kje(e))}}function sut(e,{signed:t,size:n=256}){if(typeof n=="number"){const r=2n**(BigInt(n)-(t?1n:0n))-1n,s=t?-r-1n:0n;if(e>r||e<s)throw new jje({max:r.toString(),min:s.toString(),signed:t,size:n/8,value:e.toString()})}return{dynamic:!1,encoded:$s(e,{size:32,signed:t})}}function iut(e){const t=IS(e),n=Math.ceil(sl(t)/32),r=[];for(let s=0;s<n;s++)r.push(wy(m3(t,s*32,(s+1)*32),{dir:"right"}));return{dynamic:!0,encoded:s1([wy($s(sl(t),{size:32})),...r])}}function aut(e,{param:t}){let n=!1;const r=[];for(let s=0;s<t.components.length;s++){const a=t.components[s],o=Array.isArray(e)?s:a.name,l=Xse({param:a,value:e[o]});r.push(l),l.dynamic&&(n=!0)}return{dynamic:n,encoded:n?Qse(r):s1(r.map(({encoded:s})=>s))}}function Zse(e){const t=e.match(/^(.*)\[(\d+)?\]$/);return t?[t[2]?Number(t[2]):null,t[1]]:void 0}const Xz="/docs/contract/encodeDeployData";function Jse(e){const{abi:t,args:n,bytecode:r}=e;if(!n||n.length===0)return r;const s=t.find(o=>"type"in o&&o.type==="constructor");if(!s)throw new pct({docsPath:Xz});if(!("inputs"in s))throw new tpe({docsPath:Xz});if(!s.inputs||s.inputs.length===0)throw new tpe({docsPath:Xz});const a=s2(s.inputs,n);return Sm([r,a])}function Du(e){return typeof e=="string"?{address:e,type:"json-rpc"}:e}class eB extends Dr{constructor({docsPath:t}={}){super(["Could not find an Account to execute with this Action.","Please provide an Account with the `account` argument on the Action, or by supplying an `account` to the Client."].join(`
`),{docsPath:t,docsSlug:"account",name:"AccountNotFoundError"})}}class Qz extends Dr{constructor({docsPath:t,metaMessages:n,type:r}){super(`Account type "${r}" is not supported.`,{docsPath:t,metaMessages:n,name:"AccountTypeNotSupportedError"})}}function out(e){const t=eu(`0x${e.substring(4)}`).substring(26);return JD(`0x${t}`)}const lut="modulepreload",cut=function(e){return"/"+e},cpe={},as=function(t,n,r){let s=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),l=(o==null?void 0:o.nonce)||(o==null?void 0:o.getAttribute("nonce"));s=Promise.allSettled(n.map(c=>{if(c=cut(c),c in cpe)return;cpe[c]=!0;const u=c.endsWith(".css"),d=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${d}`))return;const f=document.createElement("link");if(f.rel=u?"stylesheet":lut,u||(f.as="script"),f.crossOrigin="",f.href=c,l&&f.setAttribute("nonce",l),document.head.appendChild(f),u)return new Promise((x,g)=>{f.addEventListener("load",x),f.addEventListener("error",()=>g(new Error(`Unable to preload CSS for ${c}`)))})}))}function a(o){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=o,window.dispatchEvent(l),!l.defaultPrevented)throw o}return s.then(o=>{for(const l of o||[])l.status==="rejected"&&a(l.reason);return t().catch(a)})};async function uut({hash:e,signature:t}){const n=Y0(e)?e:ci(e),{secp256k1:r}=await as(async()=>{const{secp256k1:o}=await Promise.resolve().then(()=>qmt);return{secp256k1:o}},void 0);return`0x${(()=>{if(typeof t=="object"&&"r"in t&&"s"in t){const{r:u,s:d,v:f,yParity:x}=t,g=Number(x??f),v=upe(g);return new r.Signature(nd(u),nd(d)).addRecoveryBit(v)}const o=Y0(t)?t:ci(t),l=X0(`0x${o.slice(130)}`),c=upe(l);return r.Signature.fromCompact(o.substring(2,130)).addRecoveryBit(c)})().recoverPublicKey(n.substring(2)).toHex(!1)}`}function upe(e){if(e===0||e===1)return e;if(e===27)return 0;if(e===28)return 1;throw new Error("Invalid yParityOrV value")}async function qje({hash:e,signature:t}){return out(await uut({hash:e,signature:t}))}class dpe extends Dr{constructor({offset:t}){super(`Offset \`${t}\` cannot be negative.`,{name:"NegativeOffsetError"})}}class Gje extends Dr{constructor({length:t,position:n}){super(`Position \`${n}\` is out of bounds (\`0 < position < ${t}\`).`,{name:"PositionOutOfBoundsError"})}}class dut extends Dr{constructor({count:t,limit:n}){super(`Recursive read limit of \`${n}\` exceeded (recursive read count: \`${t}\`).`,{name:"RecursiveReadLimitExceededError"})}}const fut={bytes:new Uint8Array,dataView:new DataView(new ArrayBuffer(0)),position:0,positionReadCount:new Map,recursiveReadCount:0,recursiveReadLimit:Number.POSITIVE_INFINITY,assertReadLimit(){if(this.recursiveReadCount>=this.recursiveReadLimit)throw new dut({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(e){if(e<0||e>this.bytes.length-1)throw new Gje({length:this.bytes.length,position:e})},decrementPosition(e){if(e<0)throw new dpe({offset:e});const t=this.position-e;this.assertPosition(t),this.position=t},getReadCount(e){return this.positionReadCount.get(e||this.position)||0},incrementPosition(e){if(e<0)throw new dpe({offset:e});const t=this.position+e;this.assertPosition(t),this.position=t},inspectByte(e){const t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectBytes(e,t){const n=t??this.position;return this.assertPosition(n+e-1),this.bytes.subarray(n,n+e)},inspectUint8(e){const t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectUint16(e){const t=e??this.position;return this.assertPosition(t+1),this.dataView.getUint16(t)},inspectUint24(e){const t=e??this.position;return this.assertPosition(t+2),(this.dataView.getUint16(t)<<8)+this.dataView.getUint8(t+2)},inspectUint32(e){const t=e??this.position;return this.assertPosition(t+3),this.dataView.getUint32(t)},pushByte(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushBytes(e){this.assertPosition(this.position+e.length-1),this.bytes.set(e,this.position),this.position+=e.length},pushUint8(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushUint16(e){this.assertPosition(this.position+1),this.dataView.setUint16(this.position,e),this.position+=2},pushUint24(e){this.assertPosition(this.position+2),this.dataView.setUint16(this.position,e>>8),this.dataView.setUint8(this.position+2,e&255),this.position+=3},pushUint32(e){this.assertPosition(this.position+3),this.dataView.setUint32(this.position,e),this.position+=4},readByte(){this.assertReadLimit(),this._touch();const e=this.inspectByte();return this.position++,e},readBytes(e,t){this.assertReadLimit(),this._touch();const n=this.inspectBytes(e);return this.position+=t??e,n},readUint8(){this.assertReadLimit(),this._touch();const e=this.inspectUint8();return this.position+=1,e},readUint16(){this.assertReadLimit(),this._touch();const e=this.inspectUint16();return this.position+=2,e},readUint24(){this.assertReadLimit(),this._touch();const e=this.inspectUint24();return this.position+=3,e},readUint32(){this.assertReadLimit(),this._touch();const e=this.inspectUint32();return this.position+=4,e},get remaining(){return this.bytes.length-this.position},setPosition(e){const t=this.position;return this.assertPosition(e),this.position=e,()=>this.position=t},_touch(){if(this.recursiveReadLimit===Number.POSITIVE_INFINITY)return;const e=this.getReadCount();this.positionReadCount.set(this.position,e+1),e>0&&this.recursiveReadCount++}};function eie(e,{recursiveReadLimit:t=8192}={}){const n=Object.create(fut);return n.bytes=e,n.dataView=new DataView(e.buffer,e.byteOffset,e.byteLength),n.positionReadCount=new Map,n.recursiveReadLimit=t,n}function By(e,t="hex"){const n=Kje(e),r=eie(new Uint8Array(n.length));return n.encode(r),t==="hex"?Wl(r.bytes):r.bytes}function Kje(e){return Array.isArray(e)?hut(e.map(t=>Kje(t))):put(e)}function hut(e){const t=e.reduce((s,a)=>s+a.length,0),n=Yje(t);return{length:t<=55?1+t:1+n+t,encode(s){t<=55?s.pushByte(192+t):(s.pushByte(247+n),n===1?s.pushUint8(t):n===2?s.pushUint16(t):n===3?s.pushUint24(t):s.pushUint32(t));for(const{encode:a}of e)a(s)}}}function put(e){const t=typeof e=="string"?sp(e):e,n=Yje(t.length);return{length:t.length===1&&t[0]<128?1:t.length<=55?1+t.length:1+n+t.length,encode(s){t.length===1&&t[0]<128?s.pushBytes(t):t.length<=55?(s.pushByte(128+t.length),s.pushBytes(t)):(s.pushByte(183+n),n===1?s.pushUint8(t.length):n===2?s.pushUint16(t.length):n===3?s.pushUint24(t.length):s.pushUint32(t.length),s.pushBytes(t))}}}function Yje(e){if(e<2**8)return 1;if(e<2**16)return 2;if(e<2**24)return 3;if(e<2**32)return 4;throw new Dr("Length is too large.")}function mut(e){const{chainId:t,nonce:n,to:r}=e,s=e.contractAddress??e.address,a=eu(Sm(["0x05",By([t?$s(t):"0x",s,n?$s(n):"0x"])]));return r==="bytes"?sp(a):a}async function Xje(e){const{authorization:t,signature:n}=e;return qje({hash:mut(t),signature:n??t})}class aZ extends Dr{constructor({blockNumber:t,chain:n,contract:r}){super(`Chain "${n.name}" does not support contract "${r.name}".`,{metaMessages:["This could be due to any of the following:",...t&&r.blockCreated&&r.blockCreated>t?[`- The contract "${r.name}" was not deployed until block ${r.blockCreated} (current block ${t}).`]:[`- The chain does not have the contract "${r.name}" configured.`]],name:"ChainDoesNotSupportContract"})}}let xut=class extends Dr{constructor({chain:t,currentChainId:n}){super(`The current chain of the wallet (id: ${n}) does not match the target chain for the transaction (id: ${t.id} – ${t.name}).`,{metaMessages:[`Current Chain ID: ${n}`,`Expected Chain ID: ${t.id} – ${t.name}`],name:"ChainMismatchError"})}};class gut extends Dr{constructor(){super(["No chain was provided to the request.","Please provide a chain with the `chain` argument on the Action, or by supplying a `chain` to WalletClient."].join(`
`),{name:"ChainNotFoundError"})}}class Qje extends Dr{constructor(){super("No chain was provided to the Client.",{name:"ClientChainNotConfiguredError"})}}class tB extends Dr{constructor({chainId:t}){super(typeof t=="number"?`Chain ID "${t}" is invalid.`:"Chain ID is invalid.",{name:"InvalidChainIdError"})}}function but({chain:e,currentChainId:t}){if(!e)throw new gut;if(t!==e.id)throw new xut({chain:e,currentChainId:t})}const yut={gwei:9,wei:18},vut={ether:-9,wei:9},wut={ether:-18,gwei:-9};function Ek(e,t){let n=e.toString();const r=n.startsWith("-");r&&(n=n.slice(1)),n=n.padStart(t,"0");let[s,a]=[n.slice(0,n.length-t),n.slice(n.length-t)];return a=a.replace(/(0+)$/,""),`${r?"-":""}${s||"0"}${a?`.${a}`:""}`}function ef(e,t="wei"){return Ek(e,vut[t])}class FC extends Dr{constructor({cause:t,message:n}={}){var s;const r=(s=n==null?void 0:n.replace("execution reverted: ",""))==null?void 0:s.replace("execution reverted","");super(`Execution reverted ${r?`with reason: ${r}`:"for an unknown reason"}.`,{cause:t,name:"ExecutionRevertedError"})}}Object.defineProperty(FC,"code",{enumerable:!0,configurable:!0,writable:!0,value:3});Object.defineProperty(FC,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/execution reverted/});class x3 extends Dr{constructor({cause:t,maxFeePerGas:n}={}){super(`The fee cap (\`maxFeePerGas\`${n?` = ${ef(n)} gwei`:""}) cannot be higher than the maximum allowed value (2^256-1).`,{cause:t,name:"FeeCapTooHighError"})}}Object.defineProperty(x3,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas higher than 2\^256-1|fee cap higher than 2\^256-1/});class oZ extends Dr{constructor({cause:t,maxFeePerGas:n}={}){super(`The fee cap (\`maxFeePerGas\`${n?` = ${ef(n)}`:""} gwei) cannot be lower than the block base fee.`,{cause:t,name:"FeeCapTooLowError"})}}Object.defineProperty(oZ,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas less than block base fee|fee cap less than block base fee|transaction is outdated/});class lZ extends Dr{constructor({cause:t,nonce:n}={}){super(`Nonce provided for the transaction ${n?`(${n}) `:""}is higher than the next one expected.`,{cause:t,name:"NonceTooHighError"})}}Object.defineProperty(lZ,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too high/});class cZ extends Dr{constructor({cause:t,nonce:n}={}){super([`Nonce provided for the transaction ${n?`(${n}) `:""}is lower than the current nonce of the account.`,"Try increasing the nonce or find the latest nonce with `getTransactionCount`."].join(`
`),{cause:t,name:"NonceTooLowError"})}}Object.defineProperty(cZ,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too low|transaction already imported|already known/});class uZ extends Dr{constructor({cause:t,nonce:n}={}){super(`Nonce provided for the transaction ${n?`(${n}) `:""}exceeds the maximum allowed nonce.`,{cause:t,name:"NonceMaxValueError"})}}Object.defineProperty(uZ,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce has max value/});class dZ extends Dr{constructor({cause:t}={}){super(["The total cost (gas * gas fee + value) of executing this transaction exceeds the balance of the account."].join(`
`),{cause:t,metaMessages:["This error could arise when the account does not have enough funds to:"," - pay for the total gas fee,"," - pay for the value to send."," ","The cost of the transaction is calculated as `gas * gas fee + value`, where:"," - `gas` is the amount of gas needed for transaction to execute,"," - `gas fee` is the gas fee,"," - `value` is the amount of ether to send to the recipient."],name:"InsufficientFundsError"})}}Object.defineProperty(dZ,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/insufficient funds|exceeds transaction sender account balance/});class fZ extends Dr{constructor({cause:t,gas:n}={}){super(`The amount of gas ${n?`(${n}) `:""}provided for the transaction exceeds the limit allowed for the block.`,{cause:t,name:"IntrinsicGasTooHighError"})}}Object.defineProperty(fZ,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too high|gas limit reached/});class hZ extends Dr{constructor({cause:t,gas:n}={}){super(`The amount of gas ${n?`(${n}) `:""}provided for the transaction is too low.`,{cause:t,name:"IntrinsicGasTooLowError"})}}Object.defineProperty(hZ,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too low/});class pZ extends Dr{constructor({cause:t}){super("The transaction type is not supported for this chain.",{cause:t,name:"TransactionTypeNotSupportedError"})}}Object.defineProperty(pZ,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/transaction type not valid/});class M9 extends Dr{constructor({cause:t,maxPriorityFeePerGas:n,maxFeePerGas:r}={}){super([`The provided tip (\`maxPriorityFeePerGas\`${n?` = ${ef(n)} gwei`:""}) cannot be higher than the fee cap (\`maxFeePerGas\`${r?` = ${ef(r)} gwei`:""}).`].join(`
`),{cause:t,name:"TipAboveFeeCapError"})}}Object.defineProperty(M9,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max priority fee per gas higher than max fee per gas|tip higher than fee cap/});class _k extends Dr{constructor({cause:t}){super(`An error occurred while executing: ${t==null?void 0:t.shortMessage}`,{cause:t,name:"UnknownNodeError"})}}function tie(e,t="wei"){return Ek(e,yut[t])}function kk(e){const t=Object.entries(e).map(([r,s])=>s===void 0||s===!1?null:[r,s]).filter(Boolean),n=t.reduce((r,[s])=>Math.max(r,s.length),0);return t.map(([r,s])=>` ${`${r}:`.padEnd(n+1)} ${s}`).join(`
`)}class Cut extends Dr{constructor(){super(["Cannot specify both a `gasPrice` and a `maxFeePerGas`/`maxPriorityFeePerGas`.","Use `maxFeePerGas`/`maxPriorityFeePerGas` for EIP-1559 compatible networks, and `gasPrice` for others."].join(`
`),{name:"FeeConflictError"})}}class Sut extends Dr{constructor({v:t}){super(`Invalid \`v\` value "${t}". Expected 27 or 28.`,{name:"InvalidLegacyVError"})}}class Nut extends Dr{constructor({transaction:t}){super("Cannot infer a transaction type from provided transaction.",{metaMessages:["Provided Transaction:","{",kk(t),"}","","To infer the type, either provide:","- a `type` to the Transaction, or","- an EIP-1559 Transaction with `maxFeePerGas`, or","- an EIP-2930 Transaction with `gasPrice` & `accessList`, or","- an EIP-4844 Transaction with `blobs`, `blobVersionedHashes`, `sidecars`, or","- an EIP-7702 Transaction with `authorizationList`, or","- a Legacy Transaction with `gasPrice`"],name:"InvalidSerializableTransactionError"})}}class Aut extends Dr{constructor({storageKey:t}){super(`Size for storage key "${t}" is invalid. Expected 32 bytes. Got ${Math.floor((t.length-2)/2)} bytes.`,{name:"InvalidStorageKeySizeError"})}}class jut extends Dr{constructor(t,{account:n,docsPath:r,chain:s,data:a,gas:o,gasPrice:l,maxFeePerGas:c,maxPriorityFeePerGas:u,nonce:d,to:f,value:x}){var v;const g=kk({chain:s&&`${s==null?void 0:s.name} (id: ${s==null?void 0:s.id})`,from:n==null?void 0:n.address,to:f,value:typeof x<"u"&&`${tie(x)} ${((v=s==null?void 0:s.nativeCurrency)==null?void 0:v.symbol)||"ETH"}`,data:a,gas:o,gasPrice:typeof l<"u"&&`${ef(l)} gwei`,maxFeePerGas:typeof c<"u"&&`${ef(c)} gwei`,maxPriorityFeePerGas:typeof u<"u"&&`${ef(u)} gwei`,nonce:d});super(t.shortMessage,{cause:t,docsPath:r,metaMessages:[...t.metaMessages?[...t.metaMessages," "]:[],"Request Arguments:",g].filter(Boolean),name:"TransactionExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=t}}class Zje extends Dr{constructor({blockHash:t,blockNumber:n,blockTag:r,hash:s,index:a}){let o="Transaction";r&&a!==void 0&&(o=`Transaction at block time "${r}" at index "${a}"`),t&&a!==void 0&&(o=`Transaction at block hash "${t}" at index "${a}"`),n&&a!==void 0&&(o=`Transaction at block number "${n}" at index "${a}"`),s&&(o=`Transaction with hash "${s}"`),super(`${o} could not be found.`,{name:"TransactionNotFoundError"})}}class Jje extends Dr{constructor({hash:t}){super(`Transaction receipt with hash "${t}" could not be found. The Transaction may not be processed on a block yet.`,{name:"TransactionReceiptNotFoundError"})}}class Eut extends Dr{constructor({hash:t}){super(`Timed out while waiting for transaction with hash "${t}" to be confirmed.`,{name:"WaitForTransactionReceiptTimeoutError"})}}const Ic=(e,t,n)=>JSON.stringify(e,(r,s)=>typeof s=="bigint"?s.toString():s,n),_ut=e=>e,nie=e=>e;class Hj extends Dr{constructor({body:t,cause:n,details:r,headers:s,status:a,url:o}){super("HTTP request failed.",{cause:n,details:r,metaMessages:[a&&`Status: ${a}`,`URL: ${nie(o)}`,t&&`Request body: ${Ic(t)}`].filter(Boolean),name:"HttpRequestError"}),Object.defineProperty(this,"body",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"headers",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"status",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.body=t,this.headers=s,this.status=a,this.url=o}}class rie extends Dr{constructor({body:t,error:n,url:r}){super("RPC Request failed.",{cause:n,details:n.message,metaMessages:[`URL: ${nie(r)}`,`Request body: ${Ic(t)}`],name:"RpcRequestError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.code=n.code,this.data=n.data}}class fpe extends Dr{constructor({body:t,url:n}){super("The request took too long to respond.",{details:"The request timed out.",metaMessages:[`URL: ${nie(n)}`,`Request body: ${Ic(t)}`],name:"TimeoutError"})}}const kut=-1;let uf=class extends Dr{constructor(t,{code:n,docsPath:r,metaMessages:s,name:a,shortMessage:o}){super(o,{cause:t,docsPath:r,metaMessages:s||(t==null?void 0:t.metaMessages),name:a||"RpcError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name=a||t.name,this.code=t instanceof rie?t.code:n??kut}};class Qf extends uf{constructor(t,n){super(t,n),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=n.data}}class R9 extends uf{constructor(t){super(t,{code:R9.code,name:"ParseRpcError",shortMessage:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."})}}Object.defineProperty(R9,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32700});class L9 extends uf{constructor(t){super(t,{code:L9.code,name:"InvalidRequestRpcError",shortMessage:"JSON is not a valid request object."})}}Object.defineProperty(L9,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32600});class D9 extends uf{constructor(t,{method:n}={}){super(t,{code:D9.code,name:"MethodNotFoundRpcError",shortMessage:`The method${n?` "${n}"`:""} does not exist / is not available.`})}}Object.defineProperty(D9,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32601});class B9 extends uf{constructor(t){super(t,{code:B9.code,name:"InvalidParamsRpcError",shortMessage:["Invalid parameters were provided to the RPC method.","Double check you have provided the correct parameters."].join(`
`)})}}Object.defineProperty(B9,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32602});class g3 extends uf{constructor(t){super(t,{code:g3.code,name:"InternalRpcError",shortMessage:"An internal error was received."})}}Object.defineProperty(g3,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32603});class b3 extends uf{constructor(t){super(t,{code:b3.code,name:"InvalidInputRpcError",shortMessage:["Missing or invalid parameters.","Double check you have provided the correct parameters."].join(`
`)})}}Object.defineProperty(b3,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32e3});class $9 extends uf{constructor(t){super(t,{code:$9.code,name:"ResourceNotFoundRpcError",shortMessage:"Requested resource not found."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ResourceNotFoundRpcError"})}}Object.defineProperty($9,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32001});class Cy extends uf{constructor(t){super(t,{code:Cy.code,name:"ResourceUnavailableRpcError",shortMessage:"Requested resource not available."})}}Object.defineProperty(Cy,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32002});class U9 extends uf{constructor(t){super(t,{code:U9.code,name:"TransactionRejectedRpcError",shortMessage:"Transaction creation failed."})}}Object.defineProperty(U9,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32003});class Wv extends uf{constructor(t,{method:n}={}){super(t,{code:Wv.code,name:"MethodNotSupportedRpcError",shortMessage:`Method${n?` "${n}"`:""} is not supported.`})}}Object.defineProperty(Wv,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32004});class OS extends uf{constructor(t){super(t,{code:OS.code,name:"LimitExceededRpcError",shortMessage:"Request exceeds defined limit."})}}Object.defineProperty(OS,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32005});class z9 extends uf{constructor(t){super(t,{code:z9.code,name:"JsonRpcVersionUnsupportedError",shortMessage:"Version of JSON-RPC protocol is not supported."})}}Object.defineProperty(z9,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32006});class bo extends Qf{constructor(t){super(t,{code:bo.code,name:"UserRejectedRequestError",shortMessage:"User rejected the request."})}}Object.defineProperty(bo,"code",{enumerable:!0,configurable:!0,writable:!0,value:4001});class H9 extends Qf{constructor(t){super(t,{code:H9.code,name:"UnauthorizedProviderError",shortMessage:"The requested method and/or account has not been authorized by the user."})}}Object.defineProperty(H9,"code",{enumerable:!0,configurable:!0,writable:!0,value:4100});class V9 extends Qf{constructor(t,{method:n}={}){super(t,{code:V9.code,name:"UnsupportedProviderMethodError",shortMessage:`The Provider does not support the requested method${n?` " ${n}"`:""}.`})}}Object.defineProperty(V9,"code",{enumerable:!0,configurable:!0,writable:!0,value:4200});class W9 extends Qf{constructor(t){super(t,{code:W9.code,name:"ProviderDisconnectedError",shortMessage:"The Provider is disconnected from all chains."})}}Object.defineProperty(W9,"code",{enumerable:!0,configurable:!0,writable:!0,value:4900});class q9 extends Qf{constructor(t){super(t,{code:q9.code,name:"ChainDisconnectedError",shortMessage:"The Provider is not connected to the requested chain."})}}Object.defineProperty(q9,"code",{enumerable:!0,configurable:!0,writable:!0,value:4901});class ip extends Qf{constructor(t){super(t,{code:ip.code,name:"SwitchChainError",shortMessage:"An error occurred when attempting to switch chain."})}}Object.defineProperty(ip,"code",{enumerable:!0,configurable:!0,writable:!0,value:4902});class G9 extends Qf{constructor(t){super(t,{code:G9.code,name:"UnsupportedNonOptionalCapabilityError",shortMessage:"This Wallet does not support a capability that was not marked as optional."})}}Object.defineProperty(G9,"code",{enumerable:!0,configurable:!0,writable:!0,value:5700});class K9 extends Qf{constructor(t){super(t,{code:K9.code,name:"UnsupportedChainIdError",shortMessage:"This Wallet does not support the requested chain ID."})}}Object.defineProperty(K9,"code",{enumerable:!0,configurable:!0,writable:!0,value:5710});class Y9 extends Qf{constructor(t){super(t,{code:Y9.code,name:"DuplicateIdError",shortMessage:"There is already a bundle submitted with this ID."})}}Object.defineProperty(Y9,"code",{enumerable:!0,configurable:!0,writable:!0,value:5720});class X9 extends Qf{constructor(t){super(t,{code:X9.code,name:"UnknownBundleIdError",shortMessage:"This bundle id is unknown / has not been submitted"})}}Object.defineProperty(X9,"code",{enumerable:!0,configurable:!0,writable:!0,value:5730});class Q9 extends Qf{constructor(t){super(t,{code:Q9.code,name:"BundleTooLargeError",shortMessage:"The call bundle is too large for the Wallet to process."})}}Object.defineProperty(Q9,"code",{enumerable:!0,configurable:!0,writable:!0,value:5740});class Z9 extends Qf{constructor(t){super(t,{code:Z9.code,name:"AtomicReadyWalletRejectedUpgradeError",shortMessage:"The Wallet can support atomicity after an upgrade, but the user rejected the upgrade."})}}Object.defineProperty(Z9,"code",{enumerable:!0,configurable:!0,writable:!0,value:5750});class J9 extends Qf{constructor(t){super(t,{code:J9.code,name:"AtomicityNotSupportedError",shortMessage:"The wallet does not support atomic execution but the request requires it."})}}Object.defineProperty(J9,"code",{enumerable:!0,configurable:!0,writable:!0,value:5760});class Tut extends uf{constructor(t){super(t,{name:"UnknownRpcError",shortMessage:"An unknown RPC error occurred."})}}function nB(e,t){const n=(e.details||"").toLowerCase(),r=e instanceof Dr?e.walk(s=>(s==null?void 0:s.code)===FC.code):e;return r instanceof Dr?new FC({cause:e,message:r.details}):FC.nodeMessage.test(n)?new FC({cause:e,message:e.details}):x3.nodeMessage.test(n)?new x3({cause:e,maxFeePerGas:t==null?void 0:t.maxFeePerGas}):oZ.nodeMessage.test(n)?new oZ({cause:e,maxFeePerGas:t==null?void 0:t.maxFeePerGas}):lZ.nodeMessage.test(n)?new lZ({cause:e,nonce:t==null?void 0:t.nonce}):cZ.nodeMessage.test(n)?new cZ({cause:e,nonce:t==null?void 0:t.nonce}):uZ.nodeMessage.test(n)?new uZ({cause:e,nonce:t==null?void 0:t.nonce}):dZ.nodeMessage.test(n)?new dZ({cause:e}):fZ.nodeMessage.test(n)?new fZ({cause:e,gas:t==null?void 0:t.gas}):hZ.nodeMessage.test(n)?new hZ({cause:e,gas:t==null?void 0:t.gas}):pZ.nodeMessage.test(n)?new pZ({cause:e}):M9.nodeMessage.test(n)?new M9({cause:e,maxFeePerGas:t==null?void 0:t.maxFeePerGas,maxPriorityFeePerGas:t==null?void 0:t.maxPriorityFeePerGas}):new _k({cause:e})}function Iut(e,{docsPath:t,...n}){const r=(()=>{const s=nB(e,n);return s instanceof _k?e:s})();return new jut(r,{docsPath:t,...n})}function rB(e,{format:t}){if(!t)return{};const n={};function r(a){const o=Object.keys(a);for(const l of o)l in e&&(n[l]=e[l]),a[l]&&typeof a[l]=="object"&&!Array.isArray(a[l])&&r(a[l])}const s=t(e||{});return r(s),n}function sie(e,t){return({exclude:n,format:r})=>({exclude:n,format:s=>{const a=t(s);if(n)for(const o of n)delete a[o];return{...a,...r(s)}},type:e})}const Put={legacy:"0x0",eip2930:"0x1",eip1559:"0x2",eip4844:"0x3",eip7702:"0x4"};function Tk(e){const t={};return typeof e.authorizationList<"u"&&(t.authorizationList=Fut(e.authorizationList)),typeof e.accessList<"u"&&(t.accessList=e.accessList),typeof e.blobVersionedHashes<"u"&&(t.blobVersionedHashes=e.blobVersionedHashes),typeof e.blobs<"u"&&(typeof e.blobs[0]!="string"?t.blobs=e.blobs.map(n=>Wl(n)):t.blobs=e.blobs),typeof e.data<"u"&&(t.data=e.data),typeof e.from<"u"&&(t.from=e.from),typeof e.gas<"u"&&(t.gas=$s(e.gas)),typeof e.gasPrice<"u"&&(t.gasPrice=$s(e.gasPrice)),typeof e.maxFeePerBlobGas<"u"&&(t.maxFeePerBlobGas=$s(e.maxFeePerBlobGas)),typeof e.maxFeePerGas<"u"&&(t.maxFeePerGas=$s(e.maxFeePerGas)),typeof e.maxPriorityFeePerGas<"u"&&(t.maxPriorityFeePerGas=$s(e.maxPriorityFeePerGas)),typeof e.nonce<"u"&&(t.nonce=$s(e.nonce)),typeof e.to<"u"&&(t.to=e.to),typeof e.type<"u"&&(t.type=Put[e.type]),typeof e.value<"u"&&(t.value=$s(e.value)),t}function Fut(e){return e.map(t=>({address:t.address,r:t.r?$s(BigInt(t.r)):t.r,s:t.s?$s(BigInt(t.s)):t.s,chainId:$s(t.chainId),nonce:$s(t.nonce),...typeof t.yParity<"u"?{yParity:$s(t.yParity)}:{},...typeof t.v<"u"&&typeof t.yParity>"u"?{v:$s(t.v)}:{}}))}function si(e,t,n){const r=e[t.name];if(typeof r=="function")return r;const s=e[n];return typeof s=="function"?s:a=>t(e,a)}const sB=2n**256n-1n;function mA(e){const{account:t,gasPrice:n,maxFeePerGas:r,maxPriorityFeePerGas:s,to:a}=e,o=t?Du(t):void 0;if(o&&!ic(o.address))throw new pd({address:o.address});if(a&&!ic(a))throw new pd({address:a});if(typeof n<"u"&&(typeof r<"u"||typeof s<"u"))throw new Cut;if(r&&r>sB)throw new x3({maxFeePerGas:r});if(s&&r&&s>r)throw new M9({maxFeePerGas:r,maxPriorityFeePerGas:s})}async function iie(e){const t=await e.request({method:"eth_chainId"},{dedupe:!0});return X0(t)}class Out extends Dr{constructor(){super("`baseFeeMultiplier` must be greater than 1.",{name:"BaseFeeScalarError"})}}class aie extends Dr{constructor(){super("Chain does not support EIP-1559 fees.",{name:"Eip1559FeesNotSupportedError"})}}class Mut extends Dr{constructor({maxPriorityFeePerGas:t}){super(`\`maxFeePerGas\` cannot be less than the \`maxPriorityFeePerGas\` (${ef(t)} gwei).`,{name:"MaxFeePerGasTooLowError"})}}class e9e extends Dr{constructor({blockHash:t,blockNumber:n}){let r="Block";t&&(r=`Block at hash "${t}"`),n&&(r=`Block at number "${n}"`),super(`${r} could not be found.`,{name:"BlockNotFoundError"})}}const t9e={"0x0":"legacy","0x1":"eip2930","0x2":"eip1559","0x3":"eip4844","0x4":"eip7702"};function iB(e){const t={...e,blockHash:e.blockHash?e.blockHash:null,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,chainId:e.chainId?X0(e.chainId):void 0,gas:e.gas?BigInt(e.gas):void 0,gasPrice:e.gasPrice?BigInt(e.gasPrice):void 0,maxFeePerBlobGas:e.maxFeePerBlobGas?BigInt(e.maxFeePerBlobGas):void 0,maxFeePerGas:e.maxFeePerGas?BigInt(e.maxFeePerGas):void 0,maxPriorityFeePerGas:e.maxPriorityFeePerGas?BigInt(e.maxPriorityFeePerGas):void 0,nonce:e.nonce?X0(e.nonce):void 0,to:e.to?e.to:null,transactionIndex:e.transactionIndex?Number(e.transactionIndex):null,type:e.type?t9e[e.type]:void 0,typeHex:e.type?e.type:void 0,value:e.value?BigInt(e.value):void 0,v:e.v?BigInt(e.v):void 0};return e.authorizationList&&(t.authorizationList=Lut(e.authorizationList)),t.yParity=(()=>{if(e.yParity)return Number(e.yParity);if(typeof t.v=="bigint"){if(t.v===0n||t.v===27n)return 0;if(t.v===1n||t.v===28n)return 1;if(t.v>=35n)return t.v%2n===0n?1:0}})(),t.type==="legacy"&&(delete t.accessList,delete t.maxFeePerBlobGas,delete t.maxFeePerGas,delete t.maxPriorityFeePerGas,delete t.yParity),t.type==="eip2930"&&(delete t.maxFeePerBlobGas,delete t.maxFeePerGas,delete t.maxPriorityFeePerGas),t.type==="eip1559"&&delete t.maxFeePerBlobGas,t}const Rut=sie("transaction",iB);function Lut(e){return e.map(t=>({address:t.address,chainId:Number(t.chainId),nonce:Number(t.nonce),r:t.r,s:t.s,yParity:Number(t.yParity)}))}function oie(e){const t=(e.transactions??[]).map(n=>typeof n=="string"?n:iB(n));return{...e,baseFeePerGas:e.baseFeePerGas?BigInt(e.baseFeePerGas):null,blobGasUsed:e.blobGasUsed?BigInt(e.blobGasUsed):void 0,difficulty:e.difficulty?BigInt(e.difficulty):void 0,excessBlobGas:e.excessBlobGas?BigInt(e.excessBlobGas):void 0,gasLimit:e.gasLimit?BigInt(e.gasLimit):void 0,gasUsed:e.gasUsed?BigInt(e.gasUsed):void 0,hash:e.hash?e.hash:null,logsBloom:e.logsBloom?e.logsBloom:null,nonce:e.nonce?e.nonce:null,number:e.number?BigInt(e.number):null,size:e.size?BigInt(e.size):void 0,timestamp:e.timestamp?BigInt(e.timestamp):void 0,transactions:t,totalDifficulty:e.totalDifficulty?BigInt(e.totalDifficulty):null}}const Dut=sie("block",oie);async function j0(e,{blockHash:t,blockNumber:n,blockTag:r,includeTransactions:s}={}){var d,f,x;const a=r??"latest",o=s??!1,l=n!==void 0?$s(n):void 0;let c=null;if(t?c=await e.request({method:"eth_getBlockByHash",params:[t,o]},{dedupe:!0}):c=await e.request({method:"eth_getBlockByNumber",params:[l||a,o]},{dedupe:!!l}),!c)throw new e9e({blockHash:t,blockNumber:n});return(((x=(f=(d=e.chain)==null?void 0:d.formatters)==null?void 0:f.block)==null?void 0:x.format)||oie)(c)}async function lie(e){const t=await e.request({method:"eth_gasPrice"});return BigInt(t)}async function But(e,t){return n9e(e,t)}async function n9e(e,t){var a,o;const{block:n,chain:r=e.chain,request:s}=t||{};try{const l=((a=r==null?void 0:r.fees)==null?void 0:a.maxPriorityFeePerGas)??((o=r==null?void 0:r.fees)==null?void 0:o.defaultPriorityFee);if(typeof l=="function"){const u=n||await si(e,j0,"getBlock")({}),d=await l({block:u,client:e,request:s});if(d===null)throw new Error;return d}if(typeof l<"u")return l;const c=await e.request({method:"eth_maxPriorityFeePerGas"});return nd(c)}catch{const[l,c]=await Promise.all([n?Promise.resolve(n):si(e,j0,"getBlock")({}),si(e,lie,"getGasPrice")({})]);if(typeof l.baseFeePerGas!="bigint")throw new aie;const u=c-l.baseFeePerGas;return u<0n?0n:u}}async function $ut(e,t){return mZ(e,t)}async function mZ(e,t){var x,g;const{block:n,chain:r=e.chain,request:s,type:a="eip1559"}=t||{},o=await(async()=>{var v,w;return typeof((v=r==null?void 0:r.fees)==null?void 0:v.baseFeeMultiplier)=="function"?r.fees.baseFeeMultiplier({block:n,client:e,request:s}):((w=r==null?void 0:r.fees)==null?void 0:w.baseFeeMultiplier)??1.2})();if(o<1)throw new Out;const c=10**(((x=o.toString().split(".")[1])==null?void 0:x.length)??0),u=v=>v*BigInt(Math.ceil(o*c))/BigInt(c),d=n||await si(e,j0,"getBlock")({});if(typeof((g=r==null?void 0:r.fees)==null?void 0:g.estimateFeesPerGas)=="function"){const v=await r.fees.estimateFeesPerGas({block:n,client:e,multiply:u,request:s,type:a});if(v!==null)return v}if(a==="eip1559"){if(typeof d.baseFeePerGas!="bigint")throw new aie;const v=typeof(s==null?void 0:s.maxPriorityFeePerGas)=="bigint"?s.maxPriorityFeePerGas:await n9e(e,{block:d,chain:r,request:s}),w=u(d.baseFeePerGas);return{maxFeePerGas:(s==null?void 0:s.maxFeePerGas)??w+v,maxPriorityFeePerGas:v}}return{gasPrice:(s==null?void 0:s.gasPrice)??u(await si(e,lie,"getGasPrice")({}))}}class Uut extends Dr{constructor(t,{account:n,docsPath:r,chain:s,data:a,gas:o,gasPrice:l,maxFeePerGas:c,maxPriorityFeePerGas:u,nonce:d,to:f,value:x}){var v;const g=kk({from:n==null?void 0:n.address,to:f,value:typeof x<"u"&&`${tie(x)} ${((v=s==null?void 0:s.nativeCurrency)==null?void 0:v.symbol)||"ETH"}`,data:a,gas:o,gasPrice:typeof l<"u"&&`${ef(l)} gwei`,maxFeePerGas:typeof c<"u"&&`${ef(c)} gwei`,maxPriorityFeePerGas:typeof u<"u"&&`${ef(u)} gwei`,nonce:d});super(t.shortMessage,{cause:t,docsPath:r,metaMessages:[...t.metaMessages?[...t.metaMessages," "]:[],"Estimate Gas Arguments:",g].filter(Boolean),name:"EstimateGasExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=t}}function zut(e,{docsPath:t,...n}){const r=(()=>{const s=nB(e,n);return s instanceof _k?e:s})();return new Uut(r,{docsPath:t,...n})}class Hut extends Dr{constructor({address:t}){super(`State for account "${t}" is set multiple times.`,{name:"AccountStateConflictError"})}}class Vut extends Dr{constructor(){super("state and stateDiff are set on the same account.",{name:"StateAssignmentConflictError"})}}function hpe(e){return e.reduce((t,{slot:n,value:r})=>`${t} ${n}: ${r}
`,"")}function Wut(e){return e.reduce((t,{address:n,...r})=>{let s=`${t} ${n}:
`;return r.nonce&&(s+=` nonce: ${r.nonce}
`),r.balance&&(s+=` balance: ${r.balance}
`),r.code&&(s+=` code: ${r.code}
`),r.state&&(s+=` state:
`,s+=hpe(r.state)),r.stateDiff&&(s+=` stateDiff:
`,s+=hpe(r.stateDiff)),s},` State Override:
`).slice(0,-1)}function ppe(e){if(!(!e||e.length===0))return e.reduce((t,{slot:n,value:r})=>{if(n.length!==66)throw new Jhe({size:n.length,targetSize:66,type:"hex"});if(r.length!==66)throw new Jhe({size:r.length,targetSize:66,type:"hex"});return t[n]=r,t},{})}function qut(e){const{balance:t,nonce:n,state:r,stateDiff:s,code:a}=e,o={};if(a!==void 0&&(o.code=a),t!==void 0&&(o.balance=$s(t)),n!==void 0&&(o.nonce=$s(n)),r!==void 0&&(o.state=ppe(r)),s!==void 0){if(o.state)throw new Vut;o.stateDiff=ppe(s)}return o}function cie(e){if(!e)return;const t={};for(const{address:n,...r}of e){if(!ic(n,{strict:!1}))throw new pd({address:n});if(t[n])throw new Hut({address:n});t[n]=qut(r)}return t}async function uie(e,{address:t,blockNumber:n,blockTag:r="latest"}){const s=n?$s(n):void 0,a=await e.request({method:"eth_getBalance",params:[t,s||r]});return BigInt(a)}async function die(e,t){var s,a,o;const{account:n=e.account}=t,r=n?Du(n):void 0;try{let pe=function(ie){const{block:oe,request:G,rpcStateOverride:V}=ie;return e.request({method:"eth_estimateGas",params:V?[G,oe??"latest",V]:oe?[G,oe]:[G]})};const{accessList:l,authorizationList:c,blobs:u,blobVersionedHashes:d,blockNumber:f,blockTag:x,data:g,gas:v,gasPrice:w,maxFeePerBlobGas:C,maxFeePerGas:N,maxPriorityFeePerGas:P,nonce:I,value:R,stateOverride:F,...U}=await mie(e,{...t,parameters:(r==null?void 0:r.type)==="local"?void 0:["blobVersionedHashes"]}),z=(f?$s(f):void 0)||x,Q=cie(F),ne=await(async()=>{if(U.to)return U.to;if(c&&c.length>0)return await Xje({authorization:c[0]}).catch(()=>{throw new Dr("`to` is required. Could not infer from `authorizationList`")})})();mA(t);const J=(o=(a=(s=e.chain)==null?void 0:s.formatters)==null?void 0:a.transactionRequest)==null?void 0:o.format,re=(J||Tk)({...rB(U,{format:J}),from:r==null?void 0:r.address,accessList:l,authorizationList:c,blobs:u,blobVersionedHashes:d,data:g,gas:v,gasPrice:w,maxFeePerBlobGas:C,maxFeePerGas:N,maxPriorityFeePerGas:P,nonce:I,to:ne,value:R});let Y=BigInt(await pe({block:z,request:re,rpcStateOverride:Q}));if(c){const ie=await uie(e,{address:re.from}),oe=await Promise.all(c.map(async G=>{const{address:V}=G,ee=await pe({block:z,request:{authorizationList:void 0,data:g,from:r==null?void 0:r.address,to:V,value:$s(ie)},rpcStateOverride:Q}).catch(()=>100000n);return 2n*BigInt(ee)}));Y+=oe.reduce((G,V)=>G+V,0n)}return Y}catch(l){throw zut(l,{...t,account:r,chain:e.chain})}}async function r9e(e,{address:t,blockTag:n="latest",blockNumber:r}){const s=await e.request({method:"eth_getTransactionCount",params:[t,r?$s(r):n]},{dedupe:!!r});return X0(s)}function fie(e){const{kzg:t}=e,n=e.to??(typeof e.blobs[0]=="string"?"hex":"bytes"),r=typeof e.blobs[0]=="string"?e.blobs.map(a=>sp(a)):e.blobs,s=[];for(const a of r)s.push(Uint8Array.from(t.blobToKzgCommitment(a)));return n==="bytes"?s:s.map(a=>Wl(a))}function hie(e){const{kzg:t}=e,n=e.to??(typeof e.blobs[0]=="string"?"hex":"bytes"),r=typeof e.blobs[0]=="string"?e.blobs.map(o=>sp(o)):e.blobs,s=typeof e.commitments[0]=="string"?e.commitments.map(o=>sp(o)):e.commitments,a=[];for(let o=0;o<r.length;o++){const l=r[o],c=s[o];a.push(Uint8Array.from(t.computeBlobKzgProof(l,c)))}return n==="bytes"?a:a.map(o=>Wl(o))}function Gut(e,t,n,r){if(typeof e.setBigUint64=="function")return e.setBigUint64(t,n,r);const s=BigInt(32),a=BigInt(4294967295),o=Number(n>>s&a),l=Number(n&a),c=r?4:0,u=r?0:4;e.setUint32(t+c,o,r),e.setUint32(t+u,l,r)}function Kut(e,t,n){return e&t^~e&n}function Yut(e,t,n){return e&t^e&n^t&n}let Xut=class extends Yse{constructor(t,n,r,s){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=t,this.outputLen=n,this.padOffset=r,this.isLE=s,this.buffer=new Uint8Array(t),this.view=Gz(this.buffer)}update(t){FS(this);const{view:n,buffer:r,blockLen:s}=this;t=ZD(t);const a=t.length;for(let o=0;o<a;){const l=Math.min(s-this.pos,a-o);if(l===s){const c=Gz(t);for(;s<=a-o;o+=s)this.process(c,o);continue}r.set(t.subarray(o,o+l),this.pos),this.pos+=l,o+=l,this.pos===s&&(this.process(n,0),this.pos=0)}return this.length+=t.length,this.roundClean(),this}digestInto(t){FS(this),Mje(t,this),this.finished=!0;const{buffer:n,view:r,blockLen:s,isLE:a}=this;let{pos:o}=this;n[o++]=128,this.buffer.subarray(o).fill(0),this.padOffset>s-o&&(this.process(r,0),o=0);for(let f=o;f<s;f++)n[f]=0;Gut(r,s-8,BigInt(this.length*8),a),this.process(r,0);const l=Gz(t),c=this.outputLen;if(c%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const u=c/4,d=this.get();if(u>d.length)throw new Error("_sha2: outputLen bigger than state");for(let f=0;f<u;f++)l.setUint32(4*f,d[f],a)}digest(){const{buffer:t,outputLen:n}=this;this.digestInto(t);const r=t.slice(0,n);return this.destroy(),r}_cloneInto(t){t||(t=new this.constructor),t.set(...this.get());const{blockLen:n,buffer:r,length:s,finished:a,destroyed:o,pos:l}=this;return t.length=s,t.pos=l,t.finished=a,t.destroyed=o,s%n&&t.buffer.set(r),t}};const Qut=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),ab=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),ob=new Uint32Array(64);let Zut=class extends Xut{constructor(t=32){super(64,t,8,!1),this.A=ab[0]|0,this.B=ab[1]|0,this.C=ab[2]|0,this.D=ab[3]|0,this.E=ab[4]|0,this.F=ab[5]|0,this.G=ab[6]|0,this.H=ab[7]|0}get(){const{A:t,B:n,C:r,D:s,E:a,F:o,G:l,H:c}=this;return[t,n,r,s,a,o,l,c]}set(t,n,r,s,a,o,l,c){this.A=t|0,this.B=n|0,this.C=r|0,this.D=s|0,this.E=a|0,this.F=o|0,this.G=l|0,this.H=c|0}process(t,n){for(let f=0;f<16;f++,n+=4)ob[f]=t.getUint32(n,!1);for(let f=16;f<64;f++){const x=ob[f-15],g=ob[f-2],v=Gm(x,7)^Gm(x,18)^x>>>3,w=Gm(g,17)^Gm(g,19)^g>>>10;ob[f]=w+ob[f-7]+v+ob[f-16]|0}let{A:r,B:s,C:a,D:o,E:l,F:c,G:u,H:d}=this;for(let f=0;f<64;f++){const x=Gm(l,6)^Gm(l,11)^Gm(l,25),g=d+x+Kut(l,c,u)+Qut[f]+ob[f]|0,w=(Gm(r,2)^Gm(r,13)^Gm(r,22))+Yut(r,s,a)|0;d=u,u=c,c=l,l=o+g|0,o=a,a=s,s=r,r=g+w|0}r=r+this.A|0,s=s+this.B|0,a=a+this.C|0,o=o+this.D|0,l=l+this.E|0,c=c+this.F|0,u=u+this.G|0,d=d+this.H|0,this.set(r,s,a,o,l,c,u,d)}roundClean(){ob.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}};const s9e=Rje(()=>new Zut);function Jut(e,t){return s9e(Y0(e,{strict:!1})?pA(e):e)}function edt(e){const{commitment:t,version:n=1}=e,r=e.to??(typeof t=="string"?"hex":"bytes"),s=Jut(t);return s.set([n],0),r==="bytes"?s:Wl(s)}function i9e(e){const{commitments:t,version:n}=e,r=e.to??(typeof t[0]=="string"?"hex":"bytes"),s=[];for(const a of t)s.push(edt({commitment:a,to:r,version:n}));return s}const mpe=6,a9e=32,pie=4096,o9e=a9e*pie,xpe=o9e*mpe-1-1*pie*mpe,l9e=1;class tdt extends Dr{constructor({maxSize:t,size:n}){super("Blob size is too large.",{metaMessages:[`Max: ${t} bytes`,`Given: ${n} bytes`],name:"BlobSizeTooLargeError"})}}class c9e extends Dr{constructor(){super("Blob data must not be empty.",{name:"EmptyBlobError"})}}class ndt extends Dr{constructor({hash:t,size:n}){super(`Versioned hash "${t}" size is invalid.`,{metaMessages:["Expected: 32",`Received: ${n}`],name:"InvalidVersionedHashSizeError"})}}class rdt extends Dr{constructor({hash:t,version:n}){super(`Versioned hash "${t}" version is invalid.`,{metaMessages:[`Expected: ${l9e}`,`Received: ${n}`],name:"InvalidVersionedHashVersionError"})}}function sdt(e){const t=e.to??(typeof e.data=="string"?"hex":"bytes"),n=typeof e.data=="string"?sp(e.data):e.data,r=sl(n);if(!r)throw new c9e;if(r>xpe)throw new tdt({maxSize:xpe,size:r});const s=[];let a=!0,o=0;for(;a;){const l=eie(new Uint8Array(o9e));let c=0;for(;c<pie;){const u=n.slice(o,o+(a9e-1));if(l.pushByte(0),l.pushBytes(u),u.length<31){l.pushByte(128),a=!1;break}c++,o+=31}s.push(l)}return t==="bytes"?s.map(l=>l.bytes):s.map(l=>Wl(l.bytes))}function u9e(e){const{data:t,kzg:n,to:r}=e,s=e.blobs??sdt({data:t,to:r}),a=e.commitments??fie({blobs:s,kzg:n,to:r}),o=e.proofs??hie({blobs:s,commitments:a,kzg:n,to:r}),l=[];for(let c=0;c<s.length;c++)l.push({blob:s[c],commitment:a[c],proof:o[c]});return l}function d9e(e){if(e.type)return e.type;if(typeof e.authorizationList<"u")return"eip7702";if(typeof e.blobs<"u"||typeof e.blobVersionedHashes<"u"||typeof e.maxFeePerBlobGas<"u"||typeof e.sidecars<"u")return"eip4844";if(typeof e.maxFeePerGas<"u"||typeof e.maxPriorityFeePerGas<"u")return"eip1559";if(typeof e.gasPrice<"u")return typeof e.accessList<"u"?"eip2930":"legacy";throw new Nut({transaction:e})}const f9e=["blobVersionedHashes","chainId","fees","gas","nonce","type"],gpe=new Map;async function mie(e,t){const{account:n=e.account,blobs:r,chain:s,gas:a,kzg:o,nonce:l,nonceManager:c,parameters:u=f9e,type:d}=t,f=n&&Du(n),x={...t,...f?{from:f==null?void 0:f.address}:{}};let g;async function v(){return g||(g=await si(e,j0,"getBlock")({blockTag:"latest"}),g)}let w;async function C(){return w||(s?s.id:typeof t.chainId<"u"?t.chainId:(w=await si(e,iie,"getChainId")({}),w))}if(u.includes("nonce")&&typeof l>"u"&&f)if(c){const N=await C();x.nonce=await c.consume({address:f.address,chainId:N,client:e})}else x.nonce=await si(e,r9e,"getTransactionCount")({address:f.address,blockTag:"pending"});if((u.includes("blobVersionedHashes")||u.includes("sidecars"))&&r&&o){const N=fie({blobs:r,kzg:o});if(u.includes("blobVersionedHashes")){const P=i9e({commitments:N,to:"hex"});x.blobVersionedHashes=P}if(u.includes("sidecars")){const P=hie({blobs:r,commitments:N,kzg:o}),I=u9e({blobs:r,commitments:N,proofs:P,to:"hex"});x.sidecars=I}}if(u.includes("chainId")&&(x.chainId=await C()),(u.includes("fees")||u.includes("type"))&&typeof d>"u")try{x.type=d9e(x)}catch{let N=gpe.get(e.uid);if(typeof N>"u"){const P=await v();N=typeof(P==null?void 0:P.baseFeePerGas)=="bigint",gpe.set(e.uid,N)}x.type=N?"eip1559":"legacy"}if(u.includes("fees"))if(x.type!=="legacy"&&x.type!=="eip2930"){if(typeof x.maxFeePerGas>"u"||typeof x.maxPriorityFeePerGas>"u"){const N=await v(),{maxFeePerGas:P,maxPriorityFeePerGas:I}=await mZ(e,{block:N,chain:s,request:x});if(typeof t.maxPriorityFeePerGas>"u"&&t.maxFeePerGas&&t.maxFeePerGas<I)throw new Mut({maxPriorityFeePerGas:I});x.maxPriorityFeePerGas=I,x.maxFeePerGas=P}}else{if(typeof t.maxFeePerGas<"u"||typeof t.maxPriorityFeePerGas<"u")throw new aie;if(typeof t.gasPrice>"u"){const N=await v(),{gasPrice:P}=await mZ(e,{block:N,chain:s,request:x,type:"legacy"});x.gasPrice=P}}return u.includes("gas")&&typeof a>"u"&&(x.gas=await si(e,die,"estimateGas")({...x,account:f&&{address:f.address,type:"json-rpc"}})),mA(x),delete x.parameters,x}async function h9e(e,{serializedTransaction:t}){return e.request({method:"eth_sendRawTransaction",params:[t]},{retryCount:0})}const Zz=new QD(128);async function idt(e,t){var N,P,I,R;const{account:n=e.account,chain:r=e.chain,accessList:s,authorizationList:a,blobs:o,data:l,gas:c,gasPrice:u,maxFeePerBlobGas:d,maxFeePerGas:f,maxPriorityFeePerGas:x,nonce:g,value:v,...w}=t;if(typeof n>"u")throw new eB({docsPath:"/docs/actions/wallet/sendTransaction"});const C=n?Du(n):null;try{mA(t);const F=await(async()=>{if(t.to)return t.to;if(t.to!==null&&a&&a.length>0)return await Xje({authorization:a[0]}).catch(()=>{throw new Dr("`to` is required. Could not infer from `authorizationList`.")})})();if((C==null?void 0:C.type)==="json-rpc"||C===null){let U;r!==null&&(U=await si(e,iie,"getChainId")({}),but({currentChainId:U,chain:r}));const L=(I=(P=(N=e.chain)==null?void 0:N.formatters)==null?void 0:P.transactionRequest)==null?void 0:I.format,Q=(L||Tk)({...rB(w,{format:L}),accessList:s,authorizationList:a,blobs:o,chainId:U,data:l,from:C==null?void 0:C.address,gas:c,gasPrice:u,maxFeePerBlobGas:d,maxFeePerGas:f,maxPriorityFeePerGas:x,nonce:g,to:F,value:v}),ne=Zz.get(e.uid),J=ne?"wallet_sendTransaction":"eth_sendTransaction";try{return await e.request({method:J,params:[Q]},{retryCount:0})}catch(X){if(ne===!1)throw X;const re=X;if(re.name==="InvalidInputRpcError"||re.name==="InvalidParamsRpcError"||re.name==="MethodNotFoundRpcError"||re.name==="MethodNotSupportedRpcError")return await e.request({method:"wallet_sendTransaction",params:[Q]},{retryCount:0}).then(pe=>(Zz.set(e.uid,!0),pe)).catch(pe=>{const Y=pe;throw Y.name==="MethodNotFoundRpcError"||Y.name==="MethodNotSupportedRpcError"?(Zz.set(e.uid,!1),re):Y});throw re}}if((C==null?void 0:C.type)==="local"){const U=await si(e,mie,"prepareTransactionRequest")({account:C,accessList:s,authorizationList:a,blobs:o,chain:r,data:l,gas:c,gasPrice:u,maxFeePerBlobGas:d,maxFeePerGas:f,maxPriorityFeePerGas:x,nonce:g,nonceManager:C.nonceManager,parameters:[...f9e,"sidecars"],value:v,...w,to:F}),L=(R=r==null?void 0:r.serializers)==null?void 0:R.transaction,z=await C.signTransaction(U,{serializer:L});return await si(e,h9e,"sendRawTransaction")({serializedTransaction:z})}throw(C==null?void 0:C.type)==="smart"?new Qz({metaMessages:["Consider using the `sendUserOperation` Action instead."],docsPath:"/docs/actions/bundler/sendUserOperation",type:"smart"}):new Qz({docsPath:"/docs/actions/wallet/sendTransaction",type:C==null?void 0:C.type})}catch(F){throw F instanceof Qz?F:Iut(F,{...t,account:C,chain:t.chain||void 0})}}const xZ=[{inputs:[{components:[{name:"target",type:"address"},{name:"allowFailure",type:"bool"},{name:"callData",type:"bytes"}],name:"calls",type:"tuple[]"}],name:"aggregate3",outputs:[{components:[{name:"success",type:"bool"},{name:"returnData",type:"bytes"}],name:"returnData",type:"tuple[]"}],stateMutability:"view",type:"function"}],gZ=[{name:"query",type:"function",stateMutability:"view",inputs:[{type:"tuple[]",name:"queries",components:[{type:"address",name:"sender"},{type:"string[]",name:"urls"},{type:"bytes",name:"data"}]}],outputs:[{type:"bool[]",name:"failures"},{type:"bytes[]",name:"responses"}]},{name:"HttpError",type:"error",inputs:[{type:"uint16",name:"status"},{type:"string",name:"message"}]}],p9e=[{inputs:[],name:"ResolverNotFound",type:"error"},{inputs:[],name:"ResolverWildcardNotSupported",type:"error"},{inputs:[],name:"ResolverNotContract",type:"error"},{inputs:[{name:"returnData",type:"bytes"}],name:"ResolverError",type:"error"},{inputs:[{components:[{name:"status",type:"uint16"},{name:"message",type:"string"}],name:"errors",type:"tuple[]"}],name:"HttpError",type:"error"}],m9e=[...p9e,{name:"resolve",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes"},{name:"data",type:"bytes"}],outputs:[{name:"",type:"bytes"},{name:"address",type:"address"}]},{name:"resolve",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes"},{name:"data",type:"bytes"},{name:"gateways",type:"string[]"}],outputs:[{name:"",type:"bytes"},{name:"address",type:"address"}]}],adt=[...p9e,{name:"reverse",type:"function",stateMutability:"view",inputs:[{type:"bytes",name:"reverseName"}],outputs:[{type:"string",name:"resolvedName"},{type:"address",name:"resolvedAddress"},{type:"address",name:"reverseResolver"},{type:"address",name:"resolver"}]},{name:"reverse",type:"function",stateMutability:"view",inputs:[{type:"bytes",name:"reverseName"},{type:"string[]",name:"gateways"}],outputs:[{type:"string",name:"resolvedName"},{type:"address",name:"resolvedAddress"},{type:"address",name:"reverseResolver"},{type:"address",name:"resolver"}]}],bpe=[{name:"text",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"key",type:"string"}],outputs:[{name:"",type:"string"}]}],ype=[{name:"addr",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"}],outputs:[{name:"",type:"address"}]},{name:"addr",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"coinType",type:"uint256"}],outputs:[{name:"",type:"bytes"}]}],vpe=[{inputs:[{name:"_signer",type:"address"},{name:"_hash",type:"bytes32"},{name:"_signature",type:"bytes"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[{name:"_signer",type:"address"},{name:"_hash",type:"bytes32"},{name:"_signature",type:"bytes"}],outputs:[{type:"bool"}],stateMutability:"nonpayable",type:"function",name:"isValidSig"}];function odt(e,t={}){typeof t.size<"u"&&hp(e,{size:t.size});const n=Wl(e,t);return nd(n,t)}function ldt(e,t={}){let n=e;if(typeof t.size<"u"&&(hp(n,{size:t.size}),n=Hf(n)),n.length>1||n[0]>1)throw new nct(n);return!!n[0]}function Vg(e,t={}){typeof t.size<"u"&&hp(e,{size:t.size});const n=Wl(e,t);return X0(n,t)}function cdt(e,t={}){let n=e;return typeof t.size<"u"&&(hp(n,{size:t.size}),n=Hf(n,{dir:"right"})),new TextDecoder().decode(n)}function Ik(e,t){const n=typeof t=="string"?sp(t):t,r=eie(n);if(sl(n)===0&&e.length>0)throw new Ak;if(sl(t)&&sl(t)<32)throw new Tje({data:typeof t=="string"?t:Wl(t),params:e,size:sl(t)});let s=0;const a=[];for(let o=0;o<e.length;++o){const l=e[o];r.setPosition(s);const[c,u]=ZC(r,l,{staticPosition:0});s+=u,a.push(c)}return a}function ZC(e,t,{staticPosition:n}){const r=Zse(t.type);if(r){const[s,a]=r;return ddt(e,{...t,type:a},{length:s,staticPosition:n})}if(t.type==="tuple")return mdt(e,t,{staticPosition:n});if(t.type==="address")return udt(e);if(t.type==="bool")return fdt(e);if(t.type.startsWith("bytes"))return hdt(e,t,{staticPosition:n});if(t.type.startsWith("uint")||t.type.startsWith("int"))return pdt(e,t);if(t.type==="string")return xdt(e,{staticPosition:n});throw new Nct(t.type,{docsPath:"/docs/contract/decodeAbiParameters"})}const wpe=32,bZ=32;function udt(e){const t=e.readBytes(32);return[JD(Wl(Hje(t,-20))),32]}function ddt(e,t,{length:n,staticPosition:r}){if(!n){const o=Vg(e.readBytes(bZ)),l=r+o,c=l+wpe;e.setPosition(l);const u=Vg(e.readBytes(wpe)),d=eE(t);let f=0;const x=[];for(let g=0;g<u;++g){e.setPosition(c+(d?g*32:f));const[v,w]=ZC(e,t,{staticPosition:c});f+=w,x.push(v)}return e.setPosition(r+32),[x,32]}if(eE(t)){const o=Vg(e.readBytes(bZ)),l=r+o,c=[];for(let u=0;u<n;++u){e.setPosition(l+u*32);const[d]=ZC(e,t,{staticPosition:l});c.push(d)}return e.setPosition(r+32),[c,32]}let s=0;const a=[];for(let o=0;o<n;++o){const[l,c]=ZC(e,t,{staticPosition:r+s});s+=c,a.push(l)}return[a,s]}function fdt(e){return[ldt(e.readBytes(32),{size:32}),32]}function hdt(e,t,{staticPosition:n}){const[r,s]=t.type.split("bytes");if(!s){const o=Vg(e.readBytes(32));e.setPosition(n+o);const l=Vg(e.readBytes(32));if(l===0)return e.setPosition(n+32),["0x",32];const c=e.readBytes(l);return e.setPosition(n+32),[Wl(c),32]}return[Wl(e.readBytes(Number.parseInt(s),32)),32]}function pdt(e,t){const n=t.type.startsWith("int"),r=Number.parseInt(t.type.split("int")[1]||"256"),s=e.readBytes(32);return[r>48?odt(s,{signed:n}):Vg(s,{signed:n}),32]}function mdt(e,t,{staticPosition:n}){const r=t.components.length===0||t.components.some(({name:o})=>!o),s=r?[]:{};let a=0;if(eE(t)){const o=Vg(e.readBytes(bZ)),l=n+o;for(let c=0;c<t.components.length;++c){const u=t.components[c];e.setPosition(l+a);const[d,f]=ZC(e,u,{staticPosition:l});a+=f,s[r?c:u==null?void 0:u.name]=d}return e.setPosition(n+32),[s,32]}for(let o=0;o<t.components.length;++o){const l=t.components[o],[c,u]=ZC(e,l,{staticPosition:n});s[r?o:l==null?void 0:l.name]=c,a+=u}return[s,a]}function xdt(e,{staticPosition:t}){const n=Vg(e.readBytes(32)),r=t+n;e.setPosition(r);const s=Vg(e.readBytes(32));if(s===0)return e.setPosition(t+32),["",32];const a=e.readBytes(s,32),o=cdt(Hf(a));return e.setPosition(t+32),[o,32]}function eE(e){var r;const{type:t}=e;if(t==="string"||t==="bytes"||t.endsWith("[]"))return!0;if(t==="tuple")return(r=e.components)==null?void 0:r.some(eE);const n=Zse(e.type);return!!(n&&eE({...e,type:n[1]}))}const gdt=e=>eu(pA(e));function bdt(e){return gdt(e)}const ydt="1.0.8";let Zf=class yZ extends Error{constructor(t,n={}){var o;const r=n.cause instanceof yZ?n.cause.details:(o=n.cause)!=null&&o.message?n.cause.message:n.details,s=n.cause instanceof yZ&&n.cause.docsPath||n.docsPath,a=[t||"An error occurred.","",...n.metaMessages?[...n.metaMessages,""]:[],...s?[`Docs: https://abitype.dev${s}`]:[],...r?[`Details: ${r}`]:[],`Version: abitype@${ydt}`].join(`
`);super(a),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiTypeError"}),n.cause&&(this.cause=n.cause),this.details=r,this.docsPath=s,this.metaMessages=n.metaMessages,this.shortMessage=t}};function C1(e,t){const n=e.exec(t);return n==null?void 0:n.groups}const x9e=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,g9e=/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/,b9e=/^\(.+?\).*?$/,Cpe=/^tuple(?<array>(\[(\d*)\])*)$/;function vZ(e){let t=e.type;if(Cpe.test(e.type)&&"components"in e){t="(";const n=e.components.length;for(let s=0;s<n;s++){const a=e.components[s];t+=vZ(a),s<n-1&&(t+=", ")}const r=C1(Cpe,e.type);return t+=`)${(r==null?void 0:r.array)??""}`,vZ({...e,type:t})}return"indexed"in e&&e.indexed&&(t=`${t} indexed`),e.name?`${t} ${e.name}`:t}function g7(e){let t="";const n=e.length;for(let r=0;r<n;r++){const s=e[r];t+=vZ(s),r!==n-1&&(t+=", ")}return t}function sM(e){var t;return e.type==="function"?`function ${e.name}(${g7(e.inputs)})${e.stateMutability&&e.stateMutability!=="nonpayable"?` ${e.stateMutability}`:""}${(t=e.outputs)!=null&&t.length?` returns (${g7(e.outputs)})`:""}`:e.type==="event"?`event ${e.name}(${g7(e.inputs)})`:e.type==="error"?`error ${e.name}(${g7(e.inputs)})`:e.type==="constructor"?`constructor(${g7(e.inputs)})${e.stateMutability==="payable"?" payable":""}`:e.type==="fallback"?`fallback() external${e.stateMutability==="payable"?" payable":""}`:"receive() external payable"}const y9e=/^error (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;function vdt(e){return y9e.test(e)}function wdt(e){return C1(y9e,e)}const v9e=/^event (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;function Cdt(e){return v9e.test(e)}function Sdt(e){return C1(v9e,e)}const w9e=/^function (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)(?: (?<scope>external|public{1}))?(?: (?<stateMutability>pure|view|nonpayable|payable{1}))?(?: returns\s?\((?<returns>.*?)\))?$/;function Ndt(e){return w9e.test(e)}function Adt(e){return C1(w9e,e)}const C9e=/^struct (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*) \{(?<properties>.*?)\}$/;function xie(e){return C9e.test(e)}function jdt(e){return C1(C9e,e)}const S9e=/^constructor\((?<parameters>.*?)\)(?:\s(?<stateMutability>payable{1}))?$/;function Edt(e){return S9e.test(e)}function _dt(e){return C1(S9e,e)}const N9e=/^fallback\(\) external(?:\s(?<stateMutability>payable{1}))?$/;function kdt(e){return N9e.test(e)}function Tdt(e){return C1(N9e,e)}const Idt=/^receive\(\) external payable$/;function Pdt(e){return Idt.test(e)}const Fdt=new Set(["indexed"]),wZ=new Set(["calldata","memory","storage"]);class Odt extends Zf{constructor({signature:t}){super("Failed to parse ABI item.",{details:`parseAbiItem(${JSON.stringify(t,null,2)})`,docsPath:"/api/human#parseabiitem-1"}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiItemError"})}}class Mdt extends Zf{constructor({type:t}){super("Unknown type.",{metaMessages:[`Type "${t}" is not a valid ABI type. Perhaps you forgot to include a struct signature?`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownTypeError"})}}class Rdt extends Zf{constructor({type:t}){super("Unknown type.",{metaMessages:[`Type "${t}" is not a valid ABI type.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSolidityTypeError"})}}class Ldt extends Zf{constructor({param:t}){super("Invalid ABI parameter.",{details:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParameterError"})}}class Ddt extends Zf{constructor({param:t,name:n}){super("Invalid ABI parameter.",{details:t,metaMessages:[`"${n}" is a protected Solidity keyword. More info: https://docs.soliditylang.org/en/latest/cheatsheet.html`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SolidityProtectedKeywordError"})}}class Bdt extends Zf{constructor({param:t,type:n,modifier:r}){super("Invalid ABI parameter.",{details:t,metaMessages:[`Modifier "${r}" not allowed${n?` in "${n}" type`:""}.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidModifierError"})}}class $dt extends Zf{constructor({param:t,type:n,modifier:r}){super("Invalid ABI parameter.",{details:t,metaMessages:[`Modifier "${r}" not allowed${n?` in "${n}" type`:""}.`,`Data location can only be specified for array, struct, or mapping types, but "${r}" was given.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidFunctionModifierError"})}}class Udt extends Zf{constructor({abiParameter:t}){super("Invalid ABI parameter.",{details:JSON.stringify(t,null,2),metaMessages:["ABI parameter type is invalid."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiTypeParameterError"})}}let xA=class extends Zf{constructor({signature:t,type:n}){super(`Invalid ${n} signature.`,{details:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidSignatureError"})}};class zdt extends Zf{constructor({signature:t}){super("Unknown signature.",{details:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSignatureError"})}}class Hdt extends Zf{constructor({signature:t}){super("Invalid struct signature.",{details:t,metaMessages:["No properties exist."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidStructSignatureError"})}}class Vdt extends Zf{constructor({type:t}){super("Circular reference detected.",{metaMessages:[`Struct "${t}" is a circular reference.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"CircularReferenceError"})}}class Wdt extends Zf{constructor({current:t,depth:n}){super("Unbalanced parentheses.",{metaMessages:[`"${t.trim()}" has too many ${n>0?"opening":"closing"} parentheses.`],details:`Depth "${n}"`}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParenthesisError"})}}function qdt(e,t,n){let r="";if(n)for(const s of Object.entries(n)){if(!s)continue;let a="";for(const o of s[1])a+=`[${o.type}${o.name?`:${o.name}`:""}]`;r+=`(${s[0]}{${a}})`}return t?`${t}:${e}${r}`:e}const Jz=new Map([["address",{type:"address"}],["bool",{type:"bool"}],["bytes",{type:"bytes"}],["bytes32",{type:"bytes32"}],["int",{type:"int256"}],["int256",{type:"int256"}],["string",{type:"string"}],["uint",{type:"uint256"}],["uint8",{type:"uint8"}],["uint16",{type:"uint16"}],["uint24",{type:"uint24"}],["uint32",{type:"uint32"}],["uint64",{type:"uint64"}],["uint96",{type:"uint96"}],["uint112",{type:"uint112"}],["uint160",{type:"uint160"}],["uint192",{type:"uint192"}],["uint256",{type:"uint256"}],["address owner",{type:"address",name:"owner"}],["address to",{type:"address",name:"to"}],["bool approved",{type:"bool",name:"approved"}],["bytes _data",{type:"bytes",name:"_data"}],["bytes data",{type:"bytes",name:"data"}],["bytes signature",{type:"bytes",name:"signature"}],["bytes32 hash",{type:"bytes32",name:"hash"}],["bytes32 r",{type:"bytes32",name:"r"}],["bytes32 root",{type:"bytes32",name:"root"}],["bytes32 s",{type:"bytes32",name:"s"}],["string name",{type:"string",name:"name"}],["string symbol",{type:"string",name:"symbol"}],["string tokenURI",{type:"string",name:"tokenURI"}],["uint tokenId",{type:"uint256",name:"tokenId"}],["uint8 v",{type:"uint8",name:"v"}],["uint256 balance",{type:"uint256",name:"balance"}],["uint256 tokenId",{type:"uint256",name:"tokenId"}],["uint256 value",{type:"uint256",name:"value"}],["event:address indexed from",{type:"address",name:"from",indexed:!0}],["event:address indexed to",{type:"address",name:"to",indexed:!0}],["event:uint indexed tokenId",{type:"uint256",name:"tokenId",indexed:!0}],["event:uint256 indexed tokenId",{type:"uint256",name:"tokenId",indexed:!0}]]);function CZ(e,t={}){if(Ndt(e))return Gdt(e,t);if(Cdt(e))return Kdt(e,t);if(vdt(e))return Ydt(e,t);if(Edt(e))return Xdt(e,t);if(kdt(e))return Qdt(e);if(Pdt(e))return{type:"receive",stateMutability:"payable"};throw new zdt({signature:e})}function Gdt(e,t={}){const n=Adt(e);if(!n)throw new xA({signature:e,type:"function"});const r=nm(n.parameters),s=[],a=r.length;for(let l=0;l<a;l++)s.push(y3(r[l],{modifiers:wZ,structs:t,type:"function"}));const o=[];if(n.returns){const l=nm(n.returns),c=l.length;for(let u=0;u<c;u++)o.push(y3(l[u],{modifiers:wZ,structs:t,type:"function"}))}return{name:n.name,type:"function",stateMutability:n.stateMutability??"nonpayable",inputs:s,outputs:o}}function Kdt(e,t={}){const n=Sdt(e);if(!n)throw new xA({signature:e,type:"event"});const r=nm(n.parameters),s=[],a=r.length;for(let o=0;o<a;o++)s.push(y3(r[o],{modifiers:Fdt,structs:t,type:"event"}));return{name:n.name,type:"event",inputs:s}}function Ydt(e,t={}){const n=wdt(e);if(!n)throw new xA({signature:e,type:"error"});const r=nm(n.parameters),s=[],a=r.length;for(let o=0;o<a;o++)s.push(y3(r[o],{structs:t,type:"error"}));return{name:n.name,type:"error",inputs:s}}function Xdt(e,t={}){const n=_dt(e);if(!n)throw new xA({signature:e,type:"constructor"});const r=nm(n.parameters),s=[],a=r.length;for(let o=0;o<a;o++)s.push(y3(r[o],{structs:t,type:"constructor"}));return{type:"constructor",stateMutability:n.stateMutability??"nonpayable",inputs:s}}function Qdt(e){const t=Tdt(e);if(!t)throw new xA({signature:e,type:"fallback"});return{type:"fallback",stateMutability:t.stateMutability??"nonpayable"}}const Zdt=/^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,Jdt=/^\((?<type>.+?)\)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,eft=/^u?int$/;function y3(e,t){var f,x;const n=qdt(e,t==null?void 0:t.type,t==null?void 0:t.structs);if(Jz.has(n))return Jz.get(n);const r=b9e.test(e),s=C1(r?Jdt:Zdt,e);if(!s)throw new Ldt({param:e});if(s.name&&nft(s.name))throw new Ddt({param:e,name:s.name});const a=s.name?{name:s.name}:{},o=s.modifier==="indexed"?{indexed:!0}:{},l=(t==null?void 0:t.structs)??{};let c,u={};if(r){c="tuple";const g=nm(s.type),v=[],w=g.length;for(let C=0;C<w;C++)v.push(y3(g[C],{structs:l}));u={components:v}}else if(s.type in l)c="tuple",u={components:l[s.type]};else if(eft.test(s.type))c=`${s.type}256`;else if(c=s.type,(t==null?void 0:t.type)!=="struct"&&!A9e(c))throw new Rdt({type:c});if(s.modifier){if(!((x=(f=t==null?void 0:t.modifiers)==null?void 0:f.has)!=null&&x.call(f,s.modifier)))throw new Bdt({param:e,type:t==null?void 0:t.type,modifier:s.modifier});if(wZ.has(s.modifier)&&!rft(c,!!s.array))throw new $dt({param:e,type:t==null?void 0:t.type,modifier:s.modifier})}const d={type:`${c}${s.array??""}`,...a,...o,...u};return Jz.set(n,d),d}function nm(e,t=[],n="",r=0){const s=e.trim().length;for(let a=0;a<s;a++){const o=e[a],l=e.slice(a+1);switch(o){case",":return r===0?nm(l,[...t,n.trim()]):nm(l,t,`${n}${o}`,r);case"(":return nm(l,t,`${n}${o}`,r+1);case")":return nm(l,t,`${n}${o}`,r-1);default:return nm(l,t,`${n}${o}`,r)}}if(n==="")return t;if(r!==0)throw new Wdt({current:n,depth:r});return t.push(n.trim()),t}function A9e(e){return e==="address"||e==="bool"||e==="function"||e==="string"||x9e.test(e)||g9e.test(e)}const tft=/^(?:after|alias|anonymous|apply|auto|byte|calldata|case|catch|constant|copyof|default|defined|error|event|external|false|final|function|immutable|implements|in|indexed|inline|internal|let|mapping|match|memory|mutable|null|of|override|partial|private|promise|public|pure|reference|relocatable|return|returns|sizeof|static|storage|struct|super|supports|switch|this|true|try|typedef|typeof|var|view|virtual)$/;function nft(e){return e==="address"||e==="bool"||e==="function"||e==="string"||e==="tuple"||x9e.test(e)||g9e.test(e)||tft.test(e)}function rft(e,t){return t||e==="bytes"||e==="string"||e==="tuple"}function j9e(e){const t={},n=e.length;for(let o=0;o<n;o++){const l=e[o];if(!xie(l))continue;const c=jdt(l);if(!c)throw new xA({signature:l,type:"struct"});const u=c.properties.split(";"),d=[],f=u.length;for(let x=0;x<f;x++){const v=u[x].trim();if(!v)continue;const w=y3(v,{type:"struct"});d.push(w)}if(!d.length)throw new Hdt({signature:l});t[c.name]=d}const r={},s=Object.entries(t),a=s.length;for(let o=0;o<a;o++){const[l,c]=s[o];r[l]=E9e(c,t)}return r}const sft=/^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*)(?<array>(?:\[\d*?\])+?)?$/;function E9e(e,t,n=new Set){const r=[],s=e.length;for(let a=0;a<s;a++){const o=e[a];if(b9e.test(o.type))r.push(o);else{const c=C1(sft,o.type);if(!(c!=null&&c.type))throw new Udt({abiParameter:o});const{array:u,type:d}=c;if(d in t){if(n.has(d))throw new Vdt({type:d});r.push({...o,type:`tuple${u??""}`,components:E9e(t[d]??[],t,new Set([...n,d]))})}else if(A9e(d))r.push(o);else throw new Mdt({type:d})}}return r}function _9e(e){const t=j9e(e),n=[],r=e.length;for(let s=0;s<r;s++){const a=e[s];xie(a)||n.push(CZ(a,t))}return n}function Spe(e){let t;if(typeof e=="string")t=CZ(e);else{const n=j9e(e),r=e.length;for(let s=0;s<r;s++){const a=e[s];if(!xie(a)){t=CZ(a,n);break}}}if(!t)throw new Odt({signature:e});return t}function ift(e){let t=!0,n="",r=0,s="",a=!1;for(let o=0;o<e.length;o++){const l=e[o];if(["(",")",","].includes(l)&&(t=!0),l==="("&&r++,l===")"&&r--,!!t){if(r===0){if(l===" "&&["event","function",""].includes(s))s="";else if(s+=l,l===")"){a=!0;break}continue}if(l===" "){e[o-1]!==","&&n!==","&&n!==",("&&(n="",t=!1);continue}s+=l,n+=l}}if(!a)throw new Dr("Unable to normalize signature.");return s}const aft=e=>{const t=typeof e=="string"?e:sM(e);return ift(t)};function k9e(e){return bdt(aft(e))}const aB=k9e,Pk=e=>m3(k9e(e),0,4);function i5(e){const{abi:t,args:n=[],name:r}=e,s=Y0(r,{strict:!1}),a=t.filter(l=>s?l.type==="function"?Pk(l)===r:l.type==="event"?aB(l)===r:!1:"name"in l&&l.name===r);if(a.length===0)return;if(a.length===1)return a[0];let o;for(const l of a){if(!("inputs"in l))continue;if(!n||n.length===0){if(!l.inputs||l.inputs.length===0)return l;continue}if(!l.inputs||l.inputs.length===0||l.inputs.length!==n.length)continue;if(n.every((u,d)=>{const f="inputs"in l&&l.inputs[d];return f?SZ(u,f):!1})){if(o&&"inputs"in o&&o.inputs){const u=T9e(l.inputs,o.inputs,n);if(u)throw new wct({abiItem:l,type:u[0]},{abiItem:o,type:u[1]})}o=l}}return o||a[0]}function SZ(e,t){const n=typeof e,r=t.type;switch(r){case"address":return ic(e,{strict:!1});case"bool":return n==="boolean";case"function":return n==="string";case"string":return n==="string";default:return r==="tuple"&&"components"in t?Object.values(t.components).every((s,a)=>SZ(Object.values(e)[a],s)):/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/.test(r)?n==="number"||n==="bigint":/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(r)?n==="string"||e instanceof Uint8Array:/[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(r)?Array.isArray(e)&&e.every(s=>SZ(s,{...t,type:r.replace(/(\[[0-9]{0,}\])$/,"")})):!1}}function T9e(e,t,n){for(const r in e){const s=e[r],a=t[r];if(s.type==="tuple"&&a.type==="tuple"&&"components"in s&&"components"in a)return T9e(s.components,a.components,n[r]);const o=[s.type,a.type];if(o.includes("address")&&o.includes("bytes20")?!0:o.includes("address")&&o.includes("string")?ic(n[r],{strict:!1}):o.includes("address")&&o.includes("bytes")?ic(n[r],{strict:!1}):!1)return o}}const eH="/docs/contract/decodeFunctionResult";function a5(e){const{abi:t,args:n,functionName:r,data:s}=e;let a=t[0];if(r){const l=i5({abi:t,args:n,name:r});if(!l)throw new PS(r,{docsPath:eH});a=l}if(a.type!=="function")throw new PS(void 0,{docsPath:eH});if(!a.outputs)throw new Fje(a.name,{docsPath:eH});const o=Ik(a.outputs,s);if(o.length>1)return o;if(o.length===1)return o[0]}const Npe="/docs/contract/encodeFunctionData";function oft(e){const{abi:t,args:n,functionName:r}=e;let s=t[0];if(r){const a=i5({abi:t,args:n,name:r});if(!a)throw new PS(r,{docsPath:Npe});s=a}if(s.type!=="function")throw new PS(void 0,{docsPath:Npe});return{abi:[s],functionName:Pk(xm(s))}}function Nm(e){const{args:t}=e,{abi:n,functionName:r}=(()=>{var l;return e.abi.length===1&&((l=e.functionName)!=null&&l.startsWith("0x"))?e:oft(e)})(),s=n[0],a=r,o="inputs"in s&&s.inputs?s2(s.inputs,t??[]):void 0;return Sm([a,o??"0x"])}function gA({blockNumber:e,chain:t,contract:n}){var s;const r=(s=t==null?void 0:t.contracts)==null?void 0:s[n];if(!r)throw new aZ({chain:t,contract:{name:n}});if(e&&r.blockCreated&&r.blockCreated>e)throw new aZ({blockNumber:e,chain:t,contract:{name:n,blockCreated:r.blockCreated}});return r.address}const I9e={1:"An `assert` condition failed.",17:"Arithmetic operation resulted in underflow or overflow.",18:"Division or modulo by zero (e.g. `5 / 0` or `23 % 0`).",33:"Attempted to convert to an invalid type.",34:"Attempted to access a storage byte array that is incorrectly encoded.",49:"Performed `.pop()` on an empty array",50:"Array index is out of bounds.",65:"Allocated too much memory or created an array which is too large.",81:"Attempted to call a zero-initialized variable of internal function type."},P9e={inputs:[{name:"message",type:"string"}],name:"Error",type:"error"},lft={inputs:[{name:"reason",type:"uint256"}],name:"Panic",type:"error"};function cft(e){const{abi:t,data:n}=e,r=m3(n,0,4);if(r==="0x")throw new Ak;const a=[...t||[],P9e,lft].find(o=>o.type==="error"&&r===Pk(xm(o)));if(!a)throw new Ije(r,{docsPath:"/docs/contract/decodeErrorResult"});return{abiItem:a,args:"inputs"in a&&a.inputs&&a.inputs.length>0?Ik(a.inputs,m3(n,4)):void 0,errorName:a.name}}function F9e({abiItem:e,args:t,includeFunctionName:n=!0,includeName:r=!1}){if("name"in e&&"inputs"in e&&e.inputs)return`${n?e.name:""}(${e.inputs.map((s,a)=>`${r&&s.name?`${s.name}: `:""}${typeof t[a]=="object"?Ic(t[a]):t[a]}`).join(", ")})`}class O9e extends Dr{constructor(t,{account:n,docsPath:r,chain:s,data:a,gas:o,gasPrice:l,maxFeePerGas:c,maxPriorityFeePerGas:u,nonce:d,to:f,value:x,stateOverride:g}){var C;const v=n?Du(n):void 0;let w=kk({from:v==null?void 0:v.address,to:f,value:typeof x<"u"&&`${tie(x)} ${((C=s==null?void 0:s.nativeCurrency)==null?void 0:C.symbol)||"ETH"}`,data:a,gas:o,gasPrice:typeof l<"u"&&`${ef(l)} gwei`,maxFeePerGas:typeof c<"u"&&`${ef(c)} gwei`,maxPriorityFeePerGas:typeof u<"u"&&`${ef(u)} gwei`,nonce:d});g&&(w+=`
${Wut(g)}`),super(t.shortMessage,{cause:t,docsPath:r,metaMessages:[...t.metaMessages?[...t.metaMessages," "]:[],"Raw Call Arguments:",w].filter(Boolean),name:"CallExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=t}}class M9e extends Dr{constructor(t,{abi:n,args:r,contractAddress:s,docsPath:a,functionName:o,sender:l}){const c=i5({abi:n,args:r,name:o}),u=c?F9e({abiItem:c,args:r,includeFunctionName:!1,includeName:!1}):void 0,d=c?xm(c,{includeName:!0}):void 0,f=kk({address:s&&_ut(s),function:d,args:u&&u!=="()"&&`${[...Array((o==null?void 0:o.length)??0).keys()].map(()=>" ").join("")}${u}`,sender:l});super(t.shortMessage||`An unknown error occurred while executing the contract function "${o}".`,{cause:t,docsPath:a,metaMessages:[...t.metaMessages?[...t.metaMessages," "]:[],f&&"Contract Call:",f].filter(Boolean),name:"ContractFunctionExecutionError"}),Object.defineProperty(this,"abi",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"args",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"contractAddress",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"formattedArgs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"functionName",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sender",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abi=n,this.args=r,this.cause=t,this.contractAddress=s,this.functionName=o,this.sender=l}}class NZ extends Dr{constructor({abi:t,data:n,functionName:r,message:s}){let a,o,l,c;if(n&&n!=="0x")try{o=cft({abi:t,data:n});const{abiItem:d,errorName:f,args:x}=o;if(f==="Error")c=x[0];else if(f==="Panic"){const[g]=x;c=I9e[g]}else{const g=d?xm(d,{includeName:!0}):void 0,v=d&&x?F9e({abiItem:d,args:x,includeFunctionName:!1,includeName:!1}):void 0;l=[g?`Error: ${g}`:"",v&&v!=="()"?` ${[...Array((f==null?void 0:f.length)??0).keys()].map(()=>" ").join("")}${v}`:""]}}catch(d){a=d}else s&&(c=s);let u;a instanceof Ije&&(u=a.signature,l=[`Unable to decode signature "${u}" as it was not found on the provided ABI.`,"Make sure you are using the correct ABI and that the error exists on it.",`You can look up the decoded signature here: https://openchain.xyz/signatures?query=${u}.`]),super(c&&c!=="execution reverted"||u?[`The contract function "${r}" reverted with the following ${u?"signature":"reason"}:`,c||u].join(`
`):`The contract function "${r}" reverted.`,{cause:a,metaMessages:l,name:"ContractFunctionRevertedError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"raw",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"reason",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"signature",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=o,this.raw=n,this.reason=c,this.signature=u}}class uft extends Dr{constructor({functionName:t}){super(`The contract function "${t}" returned no data ("0x").`,{metaMessages:["This could be due to any of the following:",` - The contract does not have the function "${t}",`," - The parameters passed to the contract function may be invalid, or"," - The address is not a contract."],name:"ContractFunctionZeroDataError"})}}class dft extends Dr{constructor({factory:t}){super(`Deployment for counterfactual contract call failed${t?` for factory "${t}".`:""}`,{metaMessages:["Please ensure:","- The `factory` is a valid contract deployment factory (ie. Create2 Factory, ERC-4337 Factory, etc).","- The `factoryData` is a valid encoded function call for contract deployment function on the factory."],name:"CounterfactualDeploymentFailedError"})}}class oB extends Dr{constructor({data:t,message:n}){super(n||"",{name:"RawContractError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:3}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=t}}function gie(e,t){var r,s,a,o,l,c;if(!(e instanceof Dr))return!1;const n=e.walk(u=>u instanceof NZ);return n instanceof NZ?!!(((r=n.data)==null?void 0:r.errorName)==="ResolverNotFound"||((s=n.data)==null?void 0:s.errorName)==="ResolverWildcardNotSupported"||((a=n.data)==null?void 0:a.errorName)==="ResolverNotContract"||((o=n.data)==null?void 0:o.errorName)==="ResolverError"||((l=n.data)==null?void 0:l.errorName)==="HttpError"||(c=n.reason)!=null&&c.includes("Wildcard on non-extended resolvers is not supported")||t==="reverse"&&n.reason===I9e[50]):!1}function fft(e){const{abi:t,data:n}=e,r=m3(n,0,4),s=t.find(a=>a.type==="function"&&r===Pk(xm(a)));if(!s)throw new vct(r,{docsPath:"/docs/contract/decodeFunctionData"});return{functionName:s.name,args:"inputs"in s&&s.inputs&&s.inputs.length>0?Ik(s.inputs,m3(n,4)):void 0}}const tH="/docs/contract/encodeErrorResult";function Ape(e){const{abi:t,errorName:n,args:r}=e;let s=t[0];if(n){const c=i5({abi:t,args:r,name:n});if(!c)throw new npe(n,{docsPath:tH});s=c}if(s.type!=="error")throw new npe(void 0,{docsPath:tH});const a=xm(s),o=Pk(a);let l="0x";if(r&&r.length>0){if(!s.inputs)throw new bct(s.name,{docsPath:tH});l=s2(s.inputs,r)}return Sm([o,l])}const nH="/docs/contract/encodeFunctionResult";function hft(e){const{abi:t,functionName:n,result:r}=e;let s=t[0];if(n){const o=i5({abi:t,name:n});if(!o)throw new PS(n,{docsPath:nH});s=o}if(s.type!=="function")throw new PS(void 0,{docsPath:nH});if(!s.outputs)throw new Fje(s.name,{docsPath:nH});const a=(()=>{if(s.outputs.length===0)return[];if(s.outputs.length===1)return[r];if(Array.isArray(r))return r;throw new Oje(r)})();return s2(s.outputs,a)}const R9e="x-batch-gateway:true";async function X2n(e){const{data:t,ccipRequest:n}=e,{args:[r]}=fft({abi:gZ,data:t}),s=[],a=[];return await Promise.all(r.map(async(o,l)=>{try{a[l]=await n(o),s[l]=!1}catch(c){s[l]=!0,a[l]=pft(c)}})),hft({abi:gZ,functionName:"query",result:[s,a]})}function pft(e){return e.name==="HttpRequestError"&&e.status?Ape({abi:gZ,errorName:"HttpError",args:[e.status,e.shortMessage]}):Ape({abi:[P9e],errorName:"Error",args:["shortMessage"in e?e.shortMessage:e.message]})}function L9e(e){if(e.length!==66||e.indexOf("[")!==0||e.indexOf("]")!==65)return null;const t=`0x${e.slice(1,65)}`;return Y0(t)?t:null}function RF(e){let t=new Uint8Array(32).fill(0);if(!e)return Wl(t);const n=e.split(".");for(let r=n.length-1;r>=0;r-=1){const s=L9e(n[r]),a=s?pA(s):eu(qw(n[r]),"bytes");t=eu(s1([t,a]),"bytes")}return Wl(t)}function mft(e){return`[${e.slice(2)}]`}function xft(e){const t=new Uint8Array(32).fill(0);return e?L9e(e)||eu(qw(e)):Wl(t)}function lB(e){const t=e.replace(/^\.|\.$/gm,"");if(t.length===0)return new Uint8Array(1);const n=new Uint8Array(qw(t).byteLength+2);let r=0;const s=t.split(".");for(let a=0;a<s.length;a++){let o=qw(s[a]);o.byteLength>255&&(o=qw(mft(xft(s[a])))),n[r]=o.length,n.set(o,r+1),r+=o.length+1}return n.byteLength!==r+1?n.slice(0,r+1):n}const gft=3;function v3(e,{abi:t,address:n,args:r,docsPath:s,functionName:a,sender:o}){const l=e instanceof oB?e:e instanceof Dr?e.walk(v=>"data"in v)||e.walk():{},{code:c,data:u,details:d,message:f,shortMessage:x}=l,g=e instanceof Ak?new uft({functionName:a}):[gft,g3.code].includes(c)&&(u||d||f||x)?new NZ({abi:t,data:typeof u=="object"?u.data:u,functionName:a,message:l instanceof rie?d:x??f}):e;return new M9e(g,{abi:t,args:r,contractAddress:n,docsPath:s,functionName:a,sender:o})}const bft="0x82ad56cb",D9e="0x608060405234801561001057600080fd5b5060405161018e38038061018e83398101604081905261002f91610124565b6000808351602085016000f59050803b61004857600080fd5b6000808351602085016000855af16040513d6000823e81610067573d81fd5b3d81f35b634e487b7160e01b600052604160045260246000fd5b600082601f83011261009257600080fd5b81516001600160401b038111156100ab576100ab61006b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156100d9576100d961006b565b6040528181528382016020018510156100f157600080fd5b60005b82811015610110576020818601810151838301820152016100f4565b506000918101602001919091529392505050565b6000806040838503121561013757600080fd5b82516001600160401b0381111561014d57600080fd5b61015985828601610081565b602085015190935090506001600160401b0381111561017757600080fd5b61018385828601610081565b915050925092905056fe",yft="0x608060405234801561001057600080fd5b506040516102c03803806102c083398101604081905261002f916101e6565b836001600160a01b03163b6000036100e457600080836001600160a01b03168360405161005c9190610270565b6000604051808303816000865af19150503d8060008114610099576040519150601f19603f3d011682016040523d82523d6000602084013e61009e565b606091505b50915091508115806100b857506001600160a01b0386163b155b156100e1578060405163101bb98d60e01b81526004016100d8919061028c565b60405180910390fd5b50505b6000808451602086016000885af16040513d6000823e81610103573d81fd5b3d81f35b80516001600160a01b038116811461011e57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561015457818101518382015260200161013c565b50506000910152565b600082601f83011261016e57600080fd5b81516001600160401b0381111561018757610187610123565b604051601f8201601f19908116603f011681016001600160401b03811182821017156101b5576101b5610123565b6040528181528382016020018510156101cd57600080fd5b6101de826020830160208701610139565b949350505050565b600080600080608085870312156101fc57600080fd5b61020585610107565b60208601519094506001600160401b0381111561022157600080fd5b61022d8782880161015d565b93505061023c60408601610107565b60608601519092506001600160401b0381111561025857600080fd5b6102648782880161015d565b91505092959194509250565b60008251610282818460208701610139565b9190910192915050565b60208152600082518060208401526102ab816040850160208701610139565b601f01601f1916919091016040019291505056fe",vft="0x608060405234801561001057600080fd5b5060405161069438038061069483398101604081905261002f9161051e565b600061003c848484610048565b9050806000526001601ff35b60007f64926492649264926492649264926492649264926492649264926492649264926100748361040c565b036101e7576000606080848060200190518101906100929190610577565b60405192955090935091506000906001600160a01b038516906100b69085906105dd565b6000604051808303816000865af19150503d80600081146100f3576040519150601f19603f3d011682016040523d82523d6000602084013e6100f8565b606091505b50509050876001600160a01b03163b60000361016057806101605760405162461bcd60e51b815260206004820152601e60248201527f5369676e617475726556616c696461746f723a206465706c6f796d656e74000060448201526064015b60405180910390fd5b604051630b135d3f60e11b808252906001600160a01b038a1690631626ba7e90610190908b9087906004016105f9565b602060405180830381865afa1580156101ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101d19190610633565b6001600160e01b03191614945050505050610405565b6001600160a01b0384163b1561027a57604051630b135d3f60e11b808252906001600160a01b03861690631626ba7e9061022790879087906004016105f9565b602060405180830381865afa158015610244573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102689190610633565b6001600160e01b031916149050610405565b81516041146102df5760405162461bcd60e51b815260206004820152603a602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e6174757265206c656e6774680000000000006064820152608401610157565b6102e7610425565b5060208201516040808401518451859392600091859190811061030c5761030c61065d565b016020015160f81c9050601b811480159061032b57508060ff16601c14155b1561038c5760405162461bcd60e51b815260206004820152603b602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e617475726520762076616c756500000000006064820152608401610157565b60408051600081526020810180835289905260ff83169181019190915260608101849052608081018390526001600160a01b0389169060019060a0016020604051602081039080840390855afa1580156103ea573d6000803e3d6000fd5b505050602060405103516001600160a01b0316149450505050505b9392505050565b600060208251101561041d57600080fd5b508051015190565b60405180606001604052806003906020820280368337509192915050565b6001600160a01b038116811461045857600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561048c578181015183820152602001610474565b50506000910152565b600082601f8301126104a657600080fd5b81516001600160401b038111156104bf576104bf61045b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156104ed576104ed61045b565b60405281815283820160200185101561050557600080fd5b610516826020830160208701610471565b949350505050565b60008060006060848603121561053357600080fd5b835161053e81610443565b6020850151604086015191945092506001600160401b0381111561056157600080fd5b61056d86828701610495565b9150509250925092565b60008060006060848603121561058c57600080fd5b835161059781610443565b60208501519093506001600160401b038111156105b357600080fd5b6105bf86828701610495565b604086015190935090506001600160401b0381111561056157600080fd5b600082516105ef818460208701610471565b9190910192915050565b828152604060208201526000825180604084015261061e816060850160208701610471565b601f01601f1916919091016060019392505050565b60006020828403121561064557600080fd5b81516001600160e01b03198116811461040557600080fd5b634e487b7160e01b600052603260045260246000fdfe5369676e617475726556616c696461746f72237265636f7665725369676e6572";function B9e(e,{docsPath:t,...n}){const r=(()=>{const s=nB(e,n);return s instanceof _k?e:s})();return new O9e(r,{docsPath:t,...n})}function $9e(){let e=()=>{},t=()=>{};return{promise:new Promise((r,s)=>{e=r,t=s}),resolve:e,reject:t}}const rH=new Map;function U9e({fn:e,id:t,shouldSplitBatch:n,wait:r=0,sort:s}){const a=async()=>{const d=c();o();const f=d.map(({args:x})=>x);f.length!==0&&e(f).then(x=>{s&&Array.isArray(x)&&x.sort(s);for(let g=0;g<d.length;g++){const{resolve:v}=d[g];v==null||v([x[g],x])}}).catch(x=>{for(let g=0;g<d.length;g++){const{reject:v}=d[g];v==null||v(x)}})},o=()=>rH.delete(t),l=()=>c().map(({args:d})=>d),c=()=>rH.get(t)||[],u=d=>rH.set(t,[...c(),d]);return{flush:o,async schedule(d){const{promise:f,resolve:x,reject:g}=$9e();return(n==null?void 0:n([...l(),d]))&&a(),c().length>0?(u({args:d,resolve:x,reject:g}),f):(u({args:d,resolve:x,reject:g}),setTimeout(a,r),f)}}}async function cB(e,t){var J,X,re,pe;const{account:n=e.account,batch:r=!!((J=e.batch)!=null&&J.multicall),blockNumber:s,blockTag:a="latest",accessList:o,blobs:l,code:c,data:u,factory:d,factoryData:f,gas:x,gasPrice:g,maxFeePerBlobGas:v,maxFeePerGas:w,maxPriorityFeePerGas:C,nonce:N,to:P,value:I,stateOverride:R,...F}=t,U=n?Du(n):void 0;if(c&&(d||f))throw new Dr("Cannot provide both `code` & `factory`/`factoryData` as parameters.");if(c&&P)throw new Dr("Cannot provide both `code` & `to` as parameters.");const L=c&&u,z=d&&f&&P&&u,Q=L||z,ne=L?Sft({code:c,data:u}):z?Nft({data:u,factory:d,factoryData:f,to:P}):u;try{mA(t);const ie=(s?$s(s):void 0)||a,oe=cie(R),G=(pe=(re=(X=e.chain)==null?void 0:X.formatters)==null?void 0:re.transactionRequest)==null?void 0:pe.format,ee=(G||Tk)({...rB(F,{format:G}),from:U==null?void 0:U.address,accessList:o,blobs:l,data:ne,gas:x,gasPrice:g,maxFeePerBlobGas:v,maxFeePerGas:w,maxPriorityFeePerGas:C,nonce:N,to:Q?void 0:P,value:I});if(r&&wft({request:ee})&&!oe)try{return await Cft(e,{...ee,blockNumber:s,blockTag:a})}catch(fe){if(!(fe instanceof Qje)&&!(fe instanceof aZ))throw fe}const ae=await e.request({method:"eth_call",params:oe?[ee,ie,oe]:[ee,ie]});return ae==="0x"?{data:void 0}:{data:ae}}catch(Y){const ie=Aft(Y),{offchainLookup:oe,offchainLookupSignature:G}=await as(async()=>{const{offchainLookup:V,offchainLookupSignature:ee}=await import("./ccip-B17vWkNq.js");return{offchainLookup:V,offchainLookupSignature:ee}},[]);if(e.ccipRead!==!1&&(ie==null?void 0:ie.slice(0,10))===G&&P)return{data:await oe(e,{data:ie,to:P})};throw Q&&(ie==null?void 0:ie.slice(0,10))==="0x101bb98d"?new dft({factory:d}):B9e(Y,{...t,account:U,chain:e.chain})}}function wft({request:e}){const{data:t,to:n,...r}=e;return!(!t||t.startsWith(bft)||!n||Object.values(r).filter(s=>typeof s<"u").length>0)}async function Cft(e,t){var w;const{batchSize:n=1024,wait:r=0}=typeof((w=e.batch)==null?void 0:w.multicall)=="object"?e.batch.multicall:{},{blockNumber:s,blockTag:a="latest",data:o,multicallAddress:l,to:c}=t;let u=l;if(!u){if(!e.chain)throw new Qje;u=gA({blockNumber:s,chain:e.chain,contract:"multicall3"})}const f=(s?$s(s):void 0)||a,{schedule:x}=U9e({id:`${e.uid}.${f}`,wait:r,shouldSplitBatch(C){return C.reduce((P,{data:I})=>P+(I.length-2),0)>n*2},fn:async C=>{const N=C.map(R=>({allowFailure:!0,callData:R.data,target:R.to})),P=Nm({abi:xZ,args:[N],functionName:"aggregate3"}),I=await e.request({method:"eth_call",params:[{data:P,to:u},f]});return a5({abi:xZ,args:[N],functionName:"aggregate3",data:I||"0x"})}}),[{returnData:g,success:v}]=await x({data:o,to:c});if(!v)throw new oB({data:g});return g==="0x"?{data:void 0}:{data:g}}function Sft(e){const{code:t,data:n}=e;return Jse({abi:_9e(["constructor(bytes, bytes)"]),bytecode:D9e,args:[t,n]})}function Nft(e){const{data:t,factory:n,factoryData:r,to:s}=e;return Jse({abi:_9e(["constructor(address, bytes, address, bytes)"]),bytecode:yft,args:[s,t,n,r]})}function Aft(e){var n;if(!(e instanceof Dr))return;const t=e.walk();return typeof(t==null?void 0:t.data)=="object"?(n=t.data)==null?void 0:n.data:t.data}async function Q0(e,t){const{abi:n,address:r,args:s,functionName:a,...o}=t,l=Nm({abi:n,args:s,functionName:a});try{const{data:c}=await si(e,cB,"call")({...o,data:l,to:r});return a5({abi:n,args:s,functionName:a,data:c||"0x"})}catch(c){throw v3(c,{abi:n,address:r,args:s,docsPath:"/docs/contract/readContract",functionName:a})}}async function jft(e,t){const{blockNumber:n,blockTag:r,coinType:s,name:a,gatewayUrls:o,strict:l}=t,{chain:c}=e,u=(()=>{if(t.universalResolverAddress)return t.universalResolverAddress;if(!c)throw new Error("client chain not configured. universalResolverAddress is required.");return gA({blockNumber:n,chain:c,contract:"ensUniversalResolver"})})(),d=c==null?void 0:c.ensTlds;if(d&&!d.some(f=>a.endsWith(f)))return null;try{const f=Nm({abi:ype,functionName:"addr",...s!=null?{args:[RF(a),BigInt(s)]}:{args:[RF(a)]}}),x={address:u,abi:m9e,functionName:"resolve",args:[ci(lB(a)),f,o??[R9e]],blockNumber:n,blockTag:r},v=await si(e,Q0,"readContract")(x);if(v[0]==="0x")return null;const w=a5({abi:ype,args:s!=null?[RF(a),BigInt(s)]:void 0,functionName:"addr",data:v[0]});return w==="0x"||Hf(w)==="0x00"?null:w}catch(f){if(l)throw f;if(gie(f,"resolve"))return null;throw f}}class Eft extends Dr{constructor({data:t}){super("Unable to extract image from metadata. The metadata may be malformed or invalid.",{metaMessages:["- Metadata must be a JSON object with at least an `image`, `image_url` or `image_data` property.","",`Provided data: ${JSON.stringify(t)}`],name:"EnsAvatarInvalidMetadataError"})}}class b7 extends Dr{constructor({reason:t}){super(`ENS NFT avatar URI is invalid. ${t}`,{name:"EnsAvatarInvalidNftUriError"})}}class bie extends Dr{constructor({uri:t}){super(`Unable to resolve ENS avatar URI "${t}". The URI may be malformed, invalid, or does not respond with a valid image.`,{name:"EnsAvatarUriResolutionError"})}}class _ft extends Dr{constructor({namespace:t}){super(`ENS NFT avatar namespace "${t}" is not supported. Must be "erc721" or "erc1155".`,{name:"EnsAvatarUnsupportedNamespaceError"})}}const kft=/(?<protocol>https?:\/\/[^\/]*|ipfs:\/|ipns:\/|ar:\/)?(?<root>\/)?(?<subpath>ipfs\/|ipns\/)?(?<target>[\w\-.]+)(?<subtarget>\/.*)?/,Tft=/^(Qm[1-9A-HJ-NP-Za-km-z]{44,}|b[A-Za-z2-7]{58,}|B[A-Z2-7]{58,}|z[1-9A-HJ-NP-Za-km-z]{48,}|F[0-9A-F]{50,})(\/(?<target>[\w\-.]+))?(?<subtarget>\/.*)?$/,Ift=/^data:([a-zA-Z\-/+]*);base64,([^"].*)/,Pft=/^data:([a-zA-Z\-/+]*)?(;[a-zA-Z0-9].*?)?(,)/;async function Fft(e){try{const t=await fetch(e,{method:"HEAD"});if(t.status===200){const n=t.headers.get("content-type");return n==null?void 0:n.startsWith("image/")}return!1}catch(t){return typeof t=="object"&&typeof t.response<"u"||!globalThis.hasOwnProperty("Image")?!1:new Promise(n=>{const r=new Image;r.onload=()=>{n(!0)},r.onerror=()=>{n(!1)},r.src=e})}}function jpe(e,t){return e?e.endsWith("/")?e.slice(0,-1):e:t}function z9e({uri:e,gatewayUrls:t}){const n=Ift.test(e);if(n)return{uri:e,isOnChain:!0,isEncoded:n};const r=jpe(t==null?void 0:t.ipfs,"https://ipfs.io"),s=jpe(t==null?void 0:t.arweave,"https://arweave.net"),a=e.match(kft),{protocol:o,subpath:l,target:c,subtarget:u=""}=(a==null?void 0:a.groups)||{},d=o==="ipns:/"||l==="ipns/",f=o==="ipfs:/"||l==="ipfs/"||Tft.test(e);if(e.startsWith("http")&&!d&&!f){let g=e;return t!=null&&t.arweave&&(g=e.replace(/https:\/\/arweave.net/g,t==null?void 0:t.arweave)),{uri:g,isOnChain:!1,isEncoded:!1}}if((d||f)&&c)return{uri:`${r}/${d?"ipns":"ipfs"}/${c}${u}`,isOnChain:!1,isEncoded:!1};if(o==="ar:/"&&c)return{uri:`${s}/${c}${u||""}`,isOnChain:!1,isEncoded:!1};let x=e.replace(Pft,"");if(x.startsWith("<svg")&&(x=`data:image/svg+xml;base64,${btoa(x)}`),x.startsWith("data:")||x.startsWith("{"))return{uri:x,isOnChain:!0,isEncoded:!1};throw new bie({uri:e})}function H9e(e){if(typeof e!="object"||!("image"in e)&&!("image_url"in e)&&!("image_data"in e))throw new Eft({data:e});return e.image||e.image_url||e.image_data}async function Oft({gatewayUrls:e,uri:t}){try{const n=await fetch(t).then(s=>s.json());return await yie({gatewayUrls:e,uri:H9e(n)})}catch{throw new bie({uri:t})}}async function yie({gatewayUrls:e,uri:t}){const{uri:n,isOnChain:r}=z9e({uri:t,gatewayUrls:e});if(r||await Fft(n))return n;throw new bie({uri:t})}function Mft(e){let t=e;t.startsWith("did:nft:")&&(t=t.replace("did:nft:","").replace(/_/g,"/"));const[n,r,s]=t.split("/"),[a,o]=n.split(":"),[l,c]=r.split(":");if(!a||a.toLowerCase()!=="eip155")throw new b7({reason:"Only EIP-155 supported"});if(!o)throw new b7({reason:"Chain ID not found"});if(!c)throw new b7({reason:"Contract address not found"});if(!s)throw new b7({reason:"Token ID not found"});if(!l)throw new b7({reason:"ERC namespace not found"});return{chainID:Number.parseInt(o),namespace:l.toLowerCase(),contractAddress:c,tokenID:s}}async function Rft(e,{nft:t}){if(t.namespace==="erc721")return Q0(e,{address:t.contractAddress,abi:[{name:"tokenURI",type:"function",stateMutability:"view",inputs:[{name:"tokenId",type:"uint256"}],outputs:[{name:"",type:"string"}]}],functionName:"tokenURI",args:[BigInt(t.tokenID)]});if(t.namespace==="erc1155")return Q0(e,{address:t.contractAddress,abi:[{name:"uri",type:"function",stateMutability:"view",inputs:[{name:"_id",type:"uint256"}],outputs:[{name:"",type:"string"}]}],functionName:"uri",args:[BigInt(t.tokenID)]});throw new _ft({namespace:t.namespace})}async function Lft(e,{gatewayUrls:t,record:n}){return/eip155:/i.test(n)?Dft(e,{gatewayUrls:t,record:n}):yie({uri:n,gatewayUrls:t})}async function Dft(e,{gatewayUrls:t,record:n}){const r=Mft(n),s=await Rft(e,{nft:r}),{uri:a,isOnChain:o,isEncoded:l}=z9e({uri:s,gatewayUrls:t});if(o&&(a.includes("data:application/json;base64,")||a.startsWith("{"))){const u=l?atob(a.replace("data:application/json;base64,","")):a,d=JSON.parse(u);return yie({uri:H9e(d),gatewayUrls:t})}let c=r.tokenID;return r.namespace==="erc1155"&&(c=c.replace("0x","").padStart(64,"0")),Oft({gatewayUrls:t,uri:a.replace(/(?:0x)?{id}/,c)})}async function V9e(e,t){const{blockNumber:n,blockTag:r,key:s,name:a,gatewayUrls:o,strict:l}=t,{chain:c}=e,u=(()=>{if(t.universalResolverAddress)return t.universalResolverAddress;if(!c)throw new Error("client chain not configured. universalResolverAddress is required.");return gA({blockNumber:n,chain:c,contract:"ensUniversalResolver"})})(),d=c==null?void 0:c.ensTlds;if(d&&!d.some(f=>a.endsWith(f)))return null;try{const f={address:u,abi:m9e,functionName:"resolve",args:[ci(lB(a)),Nm({abi:bpe,functionName:"text",args:[RF(a),s]}),o??[R9e]],blockNumber:n,blockTag:r},g=await si(e,Q0,"readContract")(f);if(g[0]==="0x")return null;const v=a5({abi:bpe,functionName:"text",data:g[0]});return v===""?null:v}catch(f){if(l)throw f;if(gie(f,"resolve"))return null;throw f}}async function W9e(e,{blockNumber:t,blockTag:n,assetGatewayUrls:r,name:s,gatewayUrls:a,strict:o,universalResolverAddress:l}){const c=await si(e,V9e,"getEnsText")({blockNumber:t,blockTag:n,key:"avatar",name:s,universalResolverAddress:l,gatewayUrls:a,strict:o});if(!c)return null;try{return await Lft(e,{record:c,gatewayUrls:r})}catch{return null}}async function q9e(e,{address:t,blockNumber:n,blockTag:r,gatewayUrls:s,strict:a,universalResolverAddress:o}){let l=o;if(!l){if(!e.chain)throw new Error("client chain not configured. universalResolverAddress is required.");l=gA({blockNumber:n,chain:e.chain,contract:"ensUniversalResolver"})}const c=`${t.toLowerCase().substring(2)}.addr.reverse`;try{const u={address:l,abi:adt,functionName:"reverse",args:[ci(lB(c))],blockNumber:n,blockTag:r},d=si(e,Q0,"readContract"),[f,x]=s?await d({...u,args:[...u.args,s]}):await d(u);return t.toLowerCase()!==x.toLowerCase()?null:f}catch(u){if(a)throw u;if(gie(u,"reverse"))return null;throw u}}async function Bft(e,t){const{blockNumber:n,blockTag:r,name:s}=t,{chain:a}=e,o=(()=>{if(t.universalResolverAddress)return t.universalResolverAddress;if(!a)throw new Error("client chain not configured. universalResolverAddress is required.");return gA({blockNumber:n,chain:a,contract:"ensUniversalResolver"})})(),l=a==null?void 0:a.ensTlds;if(l&&!l.some(u=>s.endsWith(u)))throw new Error(`${s} is not a valid ENS TLD (${l==null?void 0:l.join(", ")}) for chain "${a.name}" (id: ${a.id}).`);const[c]=await si(e,Q0,"readContract")({address:o,abi:[{inputs:[{type:"bytes"}],name:"findResolver",outputs:[{type:"address"},{type:"bytes32"}],stateMutability:"view",type:"function"}],functionName:"findResolver",args:[ci(lB(s))],blockNumber:n,blockTag:r});return c}async function G9e(e,t){var C,N,P;const{account:n=e.account,blockNumber:r,blockTag:s="latest",blobs:a,data:o,gas:l,gasPrice:c,maxFeePerBlobGas:u,maxFeePerGas:d,maxPriorityFeePerGas:f,to:x,value:g,...v}=t,w=n?Du(n):void 0;try{mA(t);const R=(r?$s(r):void 0)||s,F=(P=(N=(C=e.chain)==null?void 0:C.formatters)==null?void 0:N.transactionRequest)==null?void 0:P.format,L=(F||Tk)({...rB(v,{format:F}),from:w==null?void 0:w.address,blobs:a,data:o,gas:l,gasPrice:c,maxFeePerBlobGas:u,maxFeePerGas:d,maxPriorityFeePerGas:f,to:x,value:g}),z=await e.request({method:"eth_createAccessList",params:[L,R]});return{accessList:z.accessList,gasUsed:BigInt(z.gasUsed)}}catch(I){throw B9e(I,{...t,account:w,chain:e.chain})}}function uB(e,{method:t}){var r,s;const n={};return e.transport.type==="fallback"&&((s=(r=e.transport).onResponse)==null||s.call(r,({method:a,response:o,status:l,transport:c})=>{l==="success"&&t===a&&(n[o]=c.request)})),a=>n[a]||e.request}async function $ft(e){const t=uB(e,{method:"eth_newBlockFilter"}),n=await e.request({method:"eth_newBlockFilter"});return{id:n,request:t(n),type:"block"}}class Uft extends Dr{constructor(t){super(`Filter type "${t}" is not supported.`,{name:"FilterTypeNotSupportedError"})}}const Epe="/docs/contract/encodeEventTopics";function Fk(e){var c;const{abi:t,eventName:n,args:r}=e;let s=t[0];if(n){const u=i5({abi:t,name:n});if(!u)throw new rpe(n,{docsPath:Epe});s=u}if(s.type!=="event")throw new rpe(void 0,{docsPath:Epe});const a=xm(s),o=aB(a);let l=[];if(r&&"inputs"in s){const u=(c=s.inputs)==null?void 0:c.filter(f=>"indexed"in f&&f.indexed),d=Array.isArray(r)?r:Object.values(r).length>0?(u==null?void 0:u.map(f=>r[f.name]))??[]:[];d.length>0&&(l=(u==null?void 0:u.map((f,x)=>Array.isArray(d[x])?d[x].map((g,v)=>_pe({param:f,value:d[x][v]})):typeof d[x]<"u"&&d[x]!==null?_pe({param:f,value:d[x]}):null))??[])}return[o,...l]}function _pe({param:e,value:t}){if(e.type==="string"||e.type==="bytes")return eu(pA(t));if(e.type==="tuple"||e.type.match(/^(.*)\[(\d+)?\]$/))throw new Uft(e.type);return s2([e],[t])}async function K9e(e,t){const{address:n,abi:r,args:s,eventName:a,fromBlock:o,strict:l,toBlock:c}=t,u=uB(e,{method:"eth_newFilter"}),d=a?Fk({abi:r,args:s,eventName:a}):void 0,f=await e.request({method:"eth_newFilter",params:[{address:n,fromBlock:typeof o=="bigint"?$s(o):o,toBlock:typeof c=="bigint"?$s(c):c,topics:d}]});return{abi:r,args:s,eventName:a,id:f,request:u(f),strict:!!l,type:"event"}}async function Y9e(e,{address:t,args:n,event:r,events:s,fromBlock:a,strict:o,toBlock:l}={}){const c=s??(r?[r]:void 0),u=uB(e,{method:"eth_newFilter"});let d=[];c&&(d=[c.flatMap(g=>Fk({abi:[g],eventName:g.name,args:n}))],r&&(d=d[0]));const f=await e.request({method:"eth_newFilter",params:[{address:t,fromBlock:typeof a=="bigint"?$s(a):a,toBlock:typeof l=="bigint"?$s(l):l,...d.length?{topics:d}:{}}]});return{abi:c,args:n,eventName:r?r.name:void 0,fromBlock:a,id:f,request:u(f),strict:!!o,toBlock:l,type:"event"}}async function X9e(e){const t=uB(e,{method:"eth_newPendingTransactionFilter"}),n=await e.request({method:"eth_newPendingTransactionFilter"});return{id:n,request:t(n),type:"transaction"}}async function zft(e,t){const{abi:n,address:r,args:s,functionName:a,dataSuffix:o,...l}=t,c=Nm({abi:n,args:s,functionName:a});try{return await si(e,die,"estimateGas")({data:`${c}${o?o.replace("0x",""):""}`,to:r,...l})}catch(u){const d=l.account?Du(l.account):void 0;throw v3(u,{abi:n,address:r,args:s,docsPath:"/docs/contract/estimateContractGas",functionName:a,sender:d==null?void 0:d.address})}}async function Hft(e){const t=await e.request({method:"eth_blobBaseFee"});return BigInt(t)}const Vft=new Map,Wft=new Map;function qft(e){const t=(s,a)=>({clear:()=>a.delete(s),get:()=>a.get(s),set:o=>a.set(s,o)}),n=t(e,Vft),r=t(e,Wft);return{clear:()=>{n.clear(),r.clear()},promise:n,response:r}}async function Gft(e,{cacheKey:t,cacheTime:n=Number.POSITIVE_INFINITY}){const r=qft(t),s=r.response.get();if(s&&n>0&&new Date().getTime()-s.created.getTime()<n)return s.data;let a=r.promise.get();a||(a=e(),r.promise.set(a));try{const o=await a;return r.response.set({created:new Date,data:o}),o}finally{r.promise.clear()}}const Kft=e=>`blockNumber.${e}`;async function Ok(e,{cacheTime:t=e.cacheTime}={}){const n=await Gft(()=>e.request({method:"eth_blockNumber"}),{cacheKey:Kft(e.uid),cacheTime:t});return BigInt(n)}async function Yft(e,{blockHash:t,blockNumber:n,blockTag:r="latest"}={}){const s=n!==void 0?$s(n):void 0;let a;return t?a=await e.request({method:"eth_getBlockTransactionCountByHash",params:[t]},{dedupe:!0}):a=await e.request({method:"eth_getBlockTransactionCountByNumber",params:[s||r]},{dedupe:!!s}),X0(a)}async function kpe(e,{address:t,blockNumber:n,blockTag:r="latest"}){const s=n!==void 0?$s(n):void 0,a=await e.request({method:"eth_getCode",params:[t,s||r]},{dedupe:!!s});if(a!=="0x")return a}function vie(e,t){if(!ic(e,{strict:!1}))throw new pd({address:e});if(!ic(t,{strict:!1}))throw new pd({address:t});return e.toLowerCase()===t.toLowerCase()}const Tpe="/docs/contract/decodeEventLog";function wie(e){const{abi:t,data:n,strict:r,topics:s}=e,a=r??!0,[o,...l]=s;if(!o)throw new yct({docsPath:Tpe});const c=t.length===1?t[0]:t.find(w=>w.type==="event"&&o===aB(xm(w)));if(!(c&&"name"in c)||c.type!=="event")throw new Pje(o,{docsPath:Tpe});const{name:u,inputs:d}=c,f=d==null?void 0:d.some(w=>!("name"in w&&w.name));let x=f?[]:{};const g=d.filter(w=>"indexed"in w&&w.indexed);for(let w=0;w<g.length;w++){const C=g[w],N=l[w];if(!N)throw new XD({abiItem:c,param:C});x[f?w:C.name||w]=Xft({param:C,value:N})}const v=d.filter(w=>!("indexed"in w&&w.indexed));if(v.length>0){if(n&&n!=="0x")try{const w=Ik(v,n);if(w)if(f)x=[...x,...w];else for(let C=0;C<v.length;C++)x[v[C].name]=w[C]}catch(w){if(a)throw w instanceof Tje||w instanceof Gje?new O9({abiItem:c,data:n,params:v,size:sl(n)}):w}else if(a)throw new O9({abiItem:c,data:"0x",params:v,size:0})}return{eventName:u,args:Object.values(x).length>0?x:void 0}}function Xft({param:e,value:t}){return e.type==="string"||e.type==="bytes"||e.type==="tuple"||e.type.match(/^(.*)\[(\d+)?\]$/)?t:Ik([e],t)[0]}function Cie(e){const{abi:t,args:n,logs:r,strict:s=!0}=e,a=(()=>{if(e.eventName)return Array.isArray(e.eventName)?e.eventName:[e.eventName]})();return r.map(o=>{var l;try{const c=t.find(d=>d.type==="event"&&o.topics[0]===aB(d));if(!c)return null;const u=wie({...o,abi:[c],strict:s});return a&&!a.includes(u.eventName)||!Qft({args:u.args,inputs:c.inputs,matchArgs:n})?null:{...u,...o}}catch(c){let u,d;if(c instanceof Pje)return null;if(c instanceof O9||c instanceof XD){if(s)return null;u=c.abiItem.name,d=(l=c.abiItem.inputs)==null?void 0:l.some(f=>!("name"in f&&f.name))}return{...o,args:d?[]:{},eventName:u}}}).filter(Boolean)}function Qft(e){const{args:t,inputs:n,matchArgs:r}=e;if(!r)return!0;if(!t)return!1;function s(a,o,l){try{return a.type==="address"?vie(o,l):a.type==="string"||a.type==="bytes"?eu(pA(o))===l:o===l}catch{return!1}}return Array.isArray(t)&&Array.isArray(r)?r.every((a,o)=>{if(a==null)return!0;const l=n[o];return l?(Array.isArray(a)?a:[a]).some(u=>s(l,u,t[o])):!1}):typeof t=="object"&&!Array.isArray(t)&&typeof r=="object"&&!Array.isArray(r)?Object.entries(r).every(([a,o])=>{if(o==null)return!0;const l=n.find(u=>u.name===a);return l?(Array.isArray(o)?o:[o]).some(u=>s(l,u,t[a])):!1}):!1}function i1(e,{args:t,eventName:n}={}){return{...e,blockHash:e.blockHash?e.blockHash:null,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,logIndex:e.logIndex?Number(e.logIndex):null,transactionHash:e.transactionHash?e.transactionHash:null,transactionIndex:e.transactionIndex?Number(e.transactionIndex):null,...n?{args:t,eventName:n}:{}}}async function Sie(e,{address:t,blockHash:n,fromBlock:r,toBlock:s,event:a,events:o,args:l,strict:c}={}){const u=c??!1,d=o??(a?[a]:void 0);let f=[];d&&(f=[d.flatMap(w=>Fk({abi:[w],eventName:w.name,args:o?void 0:l}))],a&&(f=f[0]));let x;n?x=await e.request({method:"eth_getLogs",params:[{address:t,topics:f,blockHash:n}]}):x=await e.request({method:"eth_getLogs",params:[{address:t,topics:f,fromBlock:typeof r=="bigint"?$s(r):r,toBlock:typeof s=="bigint"?$s(s):s}]});const g=x.map(v=>i1(v));return d?Cie({abi:d,args:l,logs:g,strict:u}):g}async function Q9e(e,t){const{abi:n,address:r,args:s,blockHash:a,eventName:o,fromBlock:l,toBlock:c,strict:u}=t,d=o?i5({abi:n,name:o}):void 0,f=d?void 0:n.filter(x=>x.type==="event");return si(e,Sie,"getLogs")({address:r,args:s,blockHash:a,event:d,events:f,fromBlock:l,toBlock:c,strict:u})}class Zft extends Dr{constructor({address:t}){super(`No EIP-712 domain found on contract "${t}".`,{metaMessages:["Ensure that:",`- The contract is deployed at the address "${t}".`,"- `eip712Domain()` function exists on the contract.","- `eip712Domain()` function matches signature to ERC-5267 specification."],name:"Eip712DomainNotFoundError"})}}async function Jft(e,t){const{address:n,factory:r,factoryData:s}=t;try{const[a,o,l,c,u,d,f]=await si(e,Q0,"readContract")({abi:eht,address:n,functionName:"eip712Domain",factory:r,factoryData:s});return{domain:{name:o,version:l,chainId:Number(c),verifyingContract:u,salt:d},extensions:f,fields:a}}catch(a){const o=a;throw o.name==="ContractFunctionExecutionError"&&o.cause.name==="ContractFunctionZeroDataError"?new Zft({address:n}):o}}const eht=[{inputs:[],name:"eip712Domain",outputs:[{name:"fields",type:"bytes1"},{name:"name",type:"string"},{name:"version",type:"string"},{name:"chainId",type:"uint256"},{name:"verifyingContract",type:"address"},{name:"salt",type:"bytes32"},{name:"extensions",type:"uint256[]"}],stateMutability:"view",type:"function"}];function tht(e){var t;return{baseFeePerGas:e.baseFeePerGas.map(n=>BigInt(n)),gasUsedRatio:e.gasUsedRatio,oldestBlock:BigInt(e.oldestBlock),reward:(t=e.reward)==null?void 0:t.map(n=>n.map(r=>BigInt(r)))}}async function nht(e,{blockCount:t,blockNumber:n,blockTag:r="latest",rewardPercentiles:s}){const a=n?$s(n):void 0,o=await e.request({method:"eth_feeHistory",params:[$s(t),a||r,s]},{dedupe:!!a});return tht(o)}async function dB(e,{filter:t}){const n="strict"in t&&t.strict,r=await t.request({method:"eth_getFilterChanges",params:[t.id]});if(typeof r[0]=="string")return r;const s=r.map(a=>i1(a));return!("abi"in t)||!t.abi?s:Cie({abi:t.abi,logs:s,strict:n})}async function rht(e,{filter:t}){const n=t.strict??!1,s=(await t.request({method:"eth_getFilterLogs",params:[t.id]})).map(a=>i1(a));return t.abi?Cie({abi:t.abi,logs:s,strict:n}):s}async function sht(e,{address:t,blockNumber:n,blockTag:r="latest",slot:s}){const a=n!==void 0?$s(n):void 0;return await e.request({method:"eth_getStorageAt",params:[t,s,a||r]})}async function Nie(e,{blockHash:t,blockNumber:n,blockTag:r,hash:s,index:a}){var d,f,x;const o=r||"latest",l=n!==void 0?$s(n):void 0;let c=null;if(s?c=await e.request({method:"eth_getTransactionByHash",params:[s]},{dedupe:!0}):t?c=await e.request({method:"eth_getTransactionByBlockHashAndIndex",params:[t,$s(a)]},{dedupe:!0}):(l||o)&&(c=await e.request({method:"eth_getTransactionByBlockNumberAndIndex",params:[l||o,$s(a)]},{dedupe:!!l})),!c)throw new Zje({blockHash:t,blockNumber:n,blockTag:o,hash:s,index:a});return(((x=(f=(d=e.chain)==null?void 0:d.formatters)==null?void 0:f.transaction)==null?void 0:x.format)||iB)(c)}async function iht(e,{hash:t,transactionReceipt:n}){const[r,s]=await Promise.all([si(e,Ok,"getBlockNumber")({}),t?si(e,Nie,"getTransaction")({hash:t}):void 0]),a=(n==null?void 0:n.blockNumber)||(s==null?void 0:s.blockNumber);return a?r-a+1n:0n}const aht={"0x0":"reverted","0x1":"success"};function Z9e(e){const t={...e,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,contractAddress:e.contractAddress?e.contractAddress:null,cumulativeGasUsed:e.cumulativeGasUsed?BigInt(e.cumulativeGasUsed):null,effectiveGasPrice:e.effectiveGasPrice?BigInt(e.effectiveGasPrice):null,gasUsed:e.gasUsed?BigInt(e.gasUsed):null,logs:e.logs?e.logs.map(n=>i1(n)):null,to:e.to?e.to:null,transactionIndex:e.transactionIndex?X0(e.transactionIndex):null,status:e.status?aht[e.status]:null,type:e.type?t9e[e.type]||e.type:null};return e.blobGasPrice&&(t.blobGasPrice=BigInt(e.blobGasPrice)),e.blobGasUsed&&(t.blobGasUsed=BigInt(e.blobGasUsed)),t}const oht=sie("transactionReceipt",Z9e);async function AZ(e,{hash:t}){var s,a,o;const n=await e.request({method:"eth_getTransactionReceipt",params:[t]},{dedupe:!0});if(!n)throw new Jje({hash:t});return(((o=(a=(s=e.chain)==null?void 0:s.formatters)==null?void 0:a.transactionReceipt)==null?void 0:o.format)||Z9e)(n)}async function J9e(e,t){var C;const{allowFailure:n=!0,batchSize:r,blockNumber:s,blockTag:a,multicallAddress:o,stateOverride:l}=t,c=t.contracts,u=r??(typeof((C=e.batch)==null?void 0:C.multicall)=="object"&&e.batch.multicall.batchSize||1024);let d=o;if(!d){if(!e.chain)throw new Error("client chain not configured. multicallAddress is required.");d=gA({blockNumber:s,chain:e.chain,contract:"multicall3"})}const f=[[]];let x=0,g=0;for(let N=0;N<c.length;N++){const{abi:P,address:I,args:R,functionName:F}=c[N];try{const U=Nm({abi:P,args:R,functionName:F});g+=(U.length-2)/2,u>0&&g>u&&f[x].length>0&&(x++,g=(U.length-2)/2,f[x]=[]),f[x]=[...f[x],{allowFailure:!0,callData:U,target:I}]}catch(U){const L=v3(U,{abi:P,address:I,args:R,docsPath:"/docs/contract/multicall",functionName:F});if(!n)throw L;f[x]=[...f[x],{allowFailure:!0,callData:"0x",target:I}]}}const v=await Promise.allSettled(f.map(N=>si(e,Q0,"readContract")({abi:xZ,address:d,args:[N],blockNumber:s,blockTag:a,functionName:"aggregate3",stateOverride:l}))),w=[];for(let N=0;N<v.length;N++){const P=v[N];if(P.status==="rejected"){if(!n)throw P.reason;for(let R=0;R<f[N].length;R++)w.push({status:"failure",error:P.reason,result:void 0});continue}const I=P.value;for(let R=0;R<I.length;R++){const{returnData:F,success:U}=I[R],{callData:L}=f[N][R],{abi:z,address:Q,functionName:ne,args:J}=c[w.length];try{if(L==="0x")throw new Ak;if(!U)throw new oB({data:F});const X=a5({abi:z,args:J,data:F,functionName:ne});w.push(n?{result:X,status:"success"}:X)}catch(X){const re=v3(X,{abi:z,address:Q,args:J,docsPath:"/docs/contract/multicall",functionName:ne});if(!n)throw re;w.push({error:re,result:void 0,status:"failure"})}}}if(w.length!==c.length)throw new Dr("multicall results mismatch");return w}const lht="0.1.1";function cht(){return lht}let Nl=class jZ extends Error{constructor(t,n={}){const r=(()=>{var c;if(n.cause instanceof jZ){if(n.cause.details)return n.cause.details;if(n.cause.shortMessage)return n.cause.shortMessage}return(c=n.cause)!=null&&c.message?n.cause.message:n.details})(),s=n.cause instanceof jZ&&n.cause.docsPath||n.docsPath,o=`https://oxlib.sh${s??""}`,l=[t||"An error occurred.",...n.metaMessages?["",...n.metaMessages]:[],...r||s?["",r?`Details: ${r}`:void 0,s?`See: ${o}`:void 0]:[]].filter(c=>typeof c=="string").join(`
`);super(l,n.cause?{cause:n.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:`ox@${cht()}`}),this.cause=n.cause,this.details=r,this.docs=o,this.docsPath=s,this.shortMessage=t}walk(t){return eEe(this,t)}};function eEe(e,t){return t!=null&&t(e)?e:e&&typeof e=="object"&&"cause"in e&&e.cause?eEe(e.cause,t):t?null:e}const uht="#__bigint";function dht(e,t,n){return JSON.stringify(e,(r,s)=>typeof s=="bigint"?s.toString()+uht:s,n)}function fht(e,t){if(Ppe(e)>t)throw new Cht({givenSize:Ppe(e),maxSize:t})}const Bx={zero:48,nine:57,A:65,F:70,a:97,f:102};function Ipe(e){if(e>=Bx.zero&&e<=Bx.nine)return e-Bx.zero;if(e>=Bx.A&&e<=Bx.F)return e-(Bx.A-10);if(e>=Bx.a&&e<=Bx.f)return e-(Bx.a-10)}function hht(e,t={}){const{dir:n,size:r=32}=t;if(r===0)return e;if(e.length>r)throw new Sht({size:e.length,targetSize:r,type:"Bytes"});const s=new Uint8Array(r);for(let a=0;a<r;a++){const o=n==="right";s[o?a:r-a-1]=e[o?a:e.length-a-1]}return s}function Aie(e,t){if(ap(e)>t)throw new _ht({givenSize:ap(e),maxSize:t})}function pht(e,t){if(typeof t=="number"&&t>0&&t>ap(e)-1)throw new iEe({offset:t,position:"start",size:ap(e)})}function mht(e,t,n){if(typeof t=="number"&&typeof n=="number"&&ap(e)!==n-t)throw new iEe({offset:n,position:"end",size:ap(e)})}function tEe(e,t={}){const{dir:n,size:r=32}=t;if(r===0)return e;const s=e.replace("0x","");if(s.length>r*2)throw new kht({size:Math.ceil(s.length/2),targetSize:r,type:"Hex"});return`0x${s[n==="right"?"padEnd":"padStart"](r*2,"0")}`}const xht=new TextEncoder;function ght(e){return e instanceof Uint8Array?e:typeof e=="string"?yht(e):bht(e)}function bht(e){return e instanceof Uint8Array?e:new Uint8Array(e)}function yht(e,t={}){const{size:n}=t;let r=e;n&&(Aie(e,n),r=C3(e,n));let s=r.slice(2);s.length%2&&(s=`0${s}`);const a=s.length/2,o=new Uint8Array(a);for(let l=0,c=0;l<a;l++){const u=Ipe(s.charCodeAt(c++)),d=Ipe(s.charCodeAt(c++));if(u===void 0||d===void 0)throw new Nl(`Invalid byte sequence ("${s[c-2]}${s[c-1]}" in "${s}").`);o[l]=u*16+d}return o}function vht(e,t={}){const{size:n}=t,r=xht.encode(e);return typeof n=="number"?(fht(r,n),wht(r,n)):r}function wht(e,t){return hht(e,{dir:"right",size:t})}function Ppe(e){return e.length}let Cht=class extends Nl{constructor({givenSize:t,maxSize:n}){super(`Size cannot exceed \`${n}\` bytes. Given size: \`${t}\` bytes.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.SizeOverflowError"})}},Sht=class extends Nl{constructor({size:t,targetSize:n,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} size (\`${t}\`) exceeds padding size (\`${n}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.SizeExceedsPaddingSizeError"})}};const Nht=new TextEncoder,Aht=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function jht(e,t={}){const{strict:n=!1}=t;if(!e)throw new Fpe(e);if(typeof e!="string")throw new Fpe(e);if(n&&!/^0x[0-9a-fA-F]*$/.test(e))throw new Ope(e);if(!e.startsWith("0x"))throw new Ope(e)}function Z0(...e){return`0x${e.reduce((t,n)=>t+n.replace("0x",""),"")}`}function nEe(e,t={}){const n=`0x${Number(e)}`;return typeof t.size=="number"?(Aie(n,t.size),w3(n,t.size)):n}function rEe(e,t={}){let n="";for(let s=0;s<e.length;s++)n+=Aht[e[s]];const r=`0x${n}`;return typeof t.size=="number"?(Aie(r,t.size),C3(r,t.size)):r}function td(e,t={}){const{signed:n,size:r}=t,s=BigInt(e);let a;r?n?a=(1n<<BigInt(r)*8n-1n)-1n:a=2n**(BigInt(r)*8n)-1n:typeof e=="number"&&(a=BigInt(Number.MAX_SAFE_INTEGER));const o=typeof a=="bigint"&&n?-a-1n:0;if(a&&s>a||s<o){const u=typeof e=="bigint"?"n":"";throw new sEe({max:a?`${a}${u}`:void 0,min:`${o}${u}`,signed:n,size:r,value:`${e}${u}`})}const c=`0x${(n&&s<0?(1n<<BigInt(r*8))+BigInt(s):s).toString(16)}`;return r?w3(c,r):c}function jie(e,t={}){return rEe(Nht.encode(e),t)}function w3(e,t){return tEe(e,{dir:"left",size:t})}function C3(e,t){return tEe(e,{dir:"right",size:t})}function Eie(e,t,n,r={}){const{strict:s}=r;pht(e,t);const a=`0x${e.replace("0x","").slice((t??0)*2,(n??e.length)*2)}`;return s&&mht(a,t,n),a}function ap(e){return Math.ceil((e.length-2)/2)}function Eht(e,t={}){const{strict:n=!1}=t;try{return jht(e,{strict:n}),!0}catch{return!1}}class sEe extends Nl{constructor({max:t,min:n,signed:r,size:s,value:a}){super(`Number \`${a}\` is not in safe${s?` ${s*8}-bit`:""}${r?" signed":" unsigned"} integer range ${t?`(\`${n}\` to \`${t}\`)`:`(above \`${n}\`)`}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.IntegerOutOfRangeError"})}}class Fpe extends Nl{constructor(t){super(`Value \`${typeof t=="object"?dht(t):t}\` of type \`${typeof t}\` is an invalid hex type.`,{metaMessages:['Hex types must be represented as `"0x${string}"`.']}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.InvalidHexTypeError"})}}class Ope extends Nl{constructor(t){super(`Value \`${t}\` is an invalid hex value.`,{metaMessages:['Hex values must start with `"0x"` and contain only hexadecimal characters (0-9, a-f, A-F).']}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.InvalidHexValueError"})}}class _ht extends Nl{constructor({givenSize:t,maxSize:n}){super(`Size cannot exceed \`${n}\` bytes. Given size: \`${t}\` bytes.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SizeOverflowError"})}}class iEe extends Nl{constructor({offset:t,position:n,size:r}){super(`Slice ${n==="start"?"starting":"ending"} at offset \`${t}\` is out-of-bounds (size: \`${r}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SliceOffsetOutOfBoundsError"})}}class kht extends Nl{constructor({size:t,targetSize:n,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} size (\`${t}\`) exceeds padding size (\`${n}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SizeExceedsPaddingSizeError"})}}function Tht(e){return{address:e.address,amount:td(e.amount),index:td(e.index),validatorIndex:td(e.validatorIndex)}}function Iht(e){return{...typeof e.baseFeePerGas=="bigint"&&{baseFeePerGas:td(e.baseFeePerGas)},...typeof e.blobBaseFee=="bigint"&&{blobBaseFee:td(e.blobBaseFee)},...typeof e.feeRecipient=="string"&&{feeRecipient:e.feeRecipient},...typeof e.gasLimit=="bigint"&&{gasLimit:td(e.gasLimit)},...typeof e.number=="bigint"&&{number:td(e.number)},...typeof e.prevRandao=="bigint"&&{prevRandao:td(e.prevRandao)},...typeof e.time=="bigint"&&{time:td(e.time)},...e.withdrawals&&{withdrawals:e.withdrawals.map(Tht)}}}async function EZ(e,t){const{blockNumber:n,blockTag:r="latest",blocks:s,returnFullTransactions:a,traceTransfers:o,validation:l}=t;try{const c=[];for(const x of s){const g=x.blockOverrides?Iht(x.blockOverrides):void 0,v=x.calls.map(C=>{const N=C,P=N.account?Du(N.account):void 0,I={...N,data:N.abi?Nm(N):N.data,from:N.from??(P==null?void 0:P.address)};return mA(I),Tk(I)}),w=x.stateOverrides?cie(x.stateOverrides):void 0;c.push({blockOverrides:g,calls:v,stateOverrides:w})}const d=(n?$s(n):void 0)||r;return(await e.request({method:"eth_simulateV1",params:[{blockStateCalls:c,returnFullTransactions:a,traceTransfers:o,validation:l},d]})).map((x,g)=>({...oie(x),calls:x.calls.map((v,w)=>{var ne,J;const{abi:C,args:N,functionName:P,to:I}=s[g].calls[w],R=((ne=v.error)==null?void 0:ne.data)??v.returnData,F=BigInt(v.gasUsed),U=(J=v.logs)==null?void 0:J.map(X=>i1(X)),L=v.status==="0x1"?"success":"failure",z=C&&L==="success"&&R!=="0x"?a5({abi:C,data:R,functionName:P}):null,Q=(()=>{var re;if(L==="success")return;let X;if(((re=v.error)==null?void 0:re.data)==="0x"?X=new Ak:v.error&&(X=new oB(v.error)),!!X)return v3(X,{abi:C??[],address:I,args:N,functionName:P??"<unknown>"})})();return{data:R,gasUsed:F,logs:U,status:L,...L==="success"?{result:z}:{error:Q}}})}))}catch(c){const u=c,d=nB(u,{});throw d instanceof _k?u:d}}function Mpe(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function Pht(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function _ie(e,...t){if(!Pht(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error("Uint8Array expected of length "+t+", got length="+e.length)}function Rpe(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function Fht(e,t){_ie(e);const n=t.outputLen;if(e.length<n)throw new Error("digestInto() expects output buffer of length at least "+n)}/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Oht=e=>new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4)),Lpe=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68,Mht=e=>e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255;function Dpe(e){for(let t=0;t<e.length;t++)e[t]=Mht(e[t])}function Rht(e){if(typeof e!="string")throw new Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array(new TextEncoder().encode(e))}function aEe(e){return typeof e=="string"&&(e=Rht(e)),_ie(e),e}let Lht=class{clone(){return this._cloneInto()}};function Dht(e){const t=r=>e().update(aEe(r)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}const MI=BigInt(2**32-1),Bpe=BigInt(32);function Bht(e,t=!1){return t?{h:Number(e&MI),l:Number(e>>Bpe&MI)}:{h:Number(e>>Bpe&MI)|0,l:Number(e&MI)|0}}function $ht(e,t=!1){let n=new Uint32Array(e.length),r=new Uint32Array(e.length);for(let s=0;s<e.length;s++){const{h:a,l:o}=Bht(e[s],t);[n[s],r[s]]=[a,o]}return[n,r]}const Uht=(e,t,n)=>e<<n|t>>>32-n,zht=(e,t,n)=>t<<n|e>>>32-n,Hht=(e,t,n)=>t<<n-32|e>>>64-n,Vht=(e,t,n)=>e<<n-32|t>>>64-n,oEe=[],lEe=[],cEe=[],Wht=BigInt(0),y7=BigInt(1),qht=BigInt(2),Ght=BigInt(7),Kht=BigInt(256),Yht=BigInt(113);for(let e=0,t=y7,n=1,r=0;e<24;e++){[n,r]=[r,(2*n+3*r)%5],oEe.push(2*(5*r+n)),lEe.push((e+1)*(e+2)/2%64);let s=Wht;for(let a=0;a<7;a++)t=(t<<y7^(t>>Ght)*Yht)%Kht,t&qht&&(s^=y7<<(y7<<BigInt(a))-y7);cEe.push(s)}const[Xht,Qht]=$ht(cEe,!0),$pe=(e,t,n)=>n>32?Hht(e,t,n):Uht(e,t,n),Upe=(e,t,n)=>n>32?Vht(e,t,n):zht(e,t,n);function Zht(e,t=24){const n=new Uint32Array(10);for(let r=24-t;r<24;r++){for(let o=0;o<10;o++)n[o]=e[o]^e[o+10]^e[o+20]^e[o+30]^e[o+40];for(let o=0;o<10;o+=2){const l=(o+8)%10,c=(o+2)%10,u=n[c],d=n[c+1],f=$pe(u,d,1)^n[l],x=Upe(u,d,1)^n[l+1];for(let g=0;g<50;g+=10)e[o+g]^=f,e[o+g+1]^=x}let s=e[2],a=e[3];for(let o=0;o<24;o++){const l=lEe[o],c=$pe(s,a,l),u=Upe(s,a,l),d=oEe[o];s=e[d],a=e[d+1],e[d]=c,e[d+1]=u}for(let o=0;o<50;o+=10){for(let l=0;l<10;l++)n[l]=e[o+l];for(let l=0;l<10;l++)e[o+l]^=~n[(l+2)%10]&n[(l+4)%10]}e[0]^=Xht[r],e[1]^=Qht[r]}n.fill(0)}let Jht=class uEe extends Lht{constructor(t,n,r,s=!1,a=24){if(super(),this.blockLen=t,this.suffix=n,this.outputLen=r,this.enableXOF=s,this.rounds=a,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,Mpe(r),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=Oht(this.state)}keccak(){Lpe||Dpe(this.state32),Zht(this.state32,this.rounds),Lpe||Dpe(this.state32),this.posOut=0,this.pos=0}update(t){Rpe(this);const{blockLen:n,state:r}=this;t=aEe(t);const s=t.length;for(let a=0;a<s;){const o=Math.min(n-this.pos,s-a);for(let l=0;l<o;l++)r[this.pos++]^=t[a++];this.pos===n&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:t,suffix:n,pos:r,blockLen:s}=this;t[r]^=n,n&128&&r===s-1&&this.keccak(),t[s-1]^=128,this.keccak()}writeInto(t){Rpe(this,!1),_ie(t),this.finish();const n=this.state,{blockLen:r}=this;for(let s=0,a=t.length;s<a;){this.posOut>=r&&this.keccak();const o=Math.min(r-this.posOut,a-s);t.set(n.subarray(this.posOut,this.posOut+o),s),this.posOut+=o,s+=o}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return Mpe(t),this.xofInto(new Uint8Array(t))}digestInto(t){if(Fht(t,this),this.finished)throw new Error("digest() was already called");return this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(t){const{blockLen:n,suffix:r,outputLen:s,rounds:a,enableXOF:o}=this;return t||(t=new uEe(n,r,s,o,a)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=a,t.suffix=r,t.outputLen=s,t.enableXOF=o,t.destroyed=this.destroyed,t}};const ept=(e,t,n)=>Dht(()=>new Jht(t,e,n)),tpt=ept(1,136,256/8);function dEe(e,t={}){const{as:n=typeof e=="string"?"Hex":"Bytes"}=t,r=tpt(ght(e));return n==="Bytes"?r:rEe(r)}class npt extends Map{constructor(t){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=t}get(t){const n=super.get(t);return super.has(t)&&n!==void 0&&(this.delete(t),super.set(t,n)),n}set(t,n){if(super.set(t,n),this.maxSize&&this.size>this.maxSize){const r=this.keys().next().value;r&&this.delete(r)}return this}}const rpt={checksum:new npt(8192)},sH=rpt.checksum,spt=/^0x[a-fA-F0-9]{40}$/;function fB(e,t={}){const{strict:n=!0}=t;if(!spt.test(e))throw new zpe({address:e,cause:new apt});if(n){if(e.toLowerCase()===e)return;if(ipt(e)!==e)throw new zpe({address:e,cause:new opt})}}function ipt(e){if(sH.has(e))return sH.get(e);fB(e,{strict:!1});const t=e.substring(2).toLowerCase(),n=dEe(vht(t),{as:"Bytes"}),r=t.split("");for(let a=0;a<40;a+=2)n[a>>1]>>4>=8&&r[a]&&(r[a]=r[a].toUpperCase()),(n[a>>1]&15)>=8&&r[a+1]&&(r[a+1]=r[a+1].toUpperCase());const s=`0x${r.join("")}`;return sH.set(e,s),s}function _Z(e,t={}){const{strict:n=!0}=t??{};try{return fB(e,{strict:n}),!0}catch{return!1}}let zpe=class extends Nl{constructor({address:t,cause:n}){super(`Address "${t}" is invalid.`,{cause:n}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidAddressError"})}},apt=class extends Nl{constructor(){super("Address is not a 20 byte (40 hexadecimal character) value."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidInputError"})}};class opt extends Nl{constructor(){super("Address does not match its checksum counterpart."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidChecksumError"})}}function kZ(e){let t=!0,n="",r=0,s="",a=!1;for(let o=0;o<e.length;o++){const l=e[o];if(["(",")",","].includes(l)&&(t=!0),l==="("&&r++,l===")"&&r--,!!t){if(r===0){if(l===" "&&["event","function","error",""].includes(s))s="";else if(s+=l,l===")"){a=!0;break}continue}if(l===" "){e[o-1]!==","&&n!==","&&n!==",("&&(n="",t=!1);continue}s+=l,n+=l}}if(!a)throw new Nl("Unable to normalize signature.");return s}function TZ(e,t){const n=typeof e,r=t.type;switch(r){case"address":return _Z(e,{strict:!1});case"bool":return n==="boolean";case"function":return n==="string";case"string":return n==="string";default:return r==="tuple"&&"components"in t?Object.values(t.components).every((s,a)=>TZ(Object.values(e)[a],s)):/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/.test(r)?n==="number"||n==="bigint":/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(r)?n==="string"||e instanceof Uint8Array:/[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(r)?Array.isArray(e)&&e.every(s=>TZ(s,{...t,type:r.replace(/(\[[0-9]{0,}\])$/,"")})):!1}}function fEe(e,t,n){for(const r in e){const s=e[r],a=t[r];if(s.type==="tuple"&&a.type==="tuple"&&"components"in s&&"components"in a)return fEe(s.components,a.components,n[r]);const o=[s.type,a.type];if(o.includes("address")&&o.includes("bytes20")?!0:o.includes("address")&&o.includes("string")?_Z(n[r],{strict:!1}):o.includes("address")&&o.includes("bytes")?_Z(n[r],{strict:!1}):!1)return o}}function hEe(e,t={}){const{prepare:n=!0}=t,r=Array.isArray(e)||typeof e=="string"?Spe(e):e;return{...r,...n?{hash:OC(r)}:{}}}function lpt(e,t,n){const{args:r=[],prepare:s=!0}=n,a=Eht(t,{strict:!1}),o=e.filter(u=>a?u.type==="function"||u.type==="error"?pEe(u)===Eie(t,0,4):u.type==="event"?OC(u)===t:!1:"name"in u&&u.name===t);if(o.length===0)throw new IZ({name:t});if(o.length===1)return{...o[0],...s?{hash:OC(o[0])}:{}};let l;for(const u of o){if(!("inputs"in u))continue;if(!r||r.length===0){if(!u.inputs||u.inputs.length===0)return{...u,...s?{hash:OC(u)}:{}};continue}if(!u.inputs||u.inputs.length===0||u.inputs.length!==r.length)continue;if(r.every((f,x)=>{const g="inputs"in u&&u.inputs[x];return g?TZ(f,g):!1})){if(l&&"inputs"in l&&l.inputs){const f=fEe(u.inputs,l.inputs,r);if(f)throw new upt({abiItem:u,type:f[0]},{abiItem:l,type:f[1]})}l=u}}const c=(()=>{if(l)return l;const[u,...d]=o;return{...u,overloads:d}})();if(!c)throw new IZ({name:t});return{...c,...s?{hash:OC(c)}:{}}}function pEe(e){return Eie(OC(e),0,4)}function cpt(e){const t=typeof e=="string"?e:sM(e);return kZ(t)}function OC(e){return typeof e!="string"&&"hash"in e&&e.hash?e.hash:dEe(jie(cpt(e)))}class upt extends Nl{constructor(t,n){super("Found ambiguous types in overloaded ABI Items.",{metaMessages:[`\`${t.type}\` in \`${kZ(sM(t.abiItem))}\`, and`,`\`${n.type}\` in \`${kZ(sM(n.abiItem))}\``,"","These types encode differently and cannot be distinguished at runtime.","Remove one of the ambiguous items in the ABI."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiItem.AmbiguityError"})}}class IZ extends Nl{constructor({name:t,data:n,type:r="item"}){const s=t?` with name "${t}"`:n?` with data "${n}"`:"";super(`ABI ${r}${s} not found.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiItem.NotFoundError"})}}const dpt=/^(.*)\[([0-9]*)\]$/,fpt=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,mEe=/^(u?int)(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/;function hpt({checksumAddress:e,parameters:t,values:n}){const r=[];for(let s=0;s<t.length;s++)r.push(kie({checksumAddress:e,parameter:t[s],value:n[s]}));return r}function kie({checksumAddress:e=!1,parameter:t,value:n}){const r=t,s=wpt(r.type);if(s){const[a,o]=s;return mpt(n,{checksumAddress:e,length:a,parameter:{...r,type:o}})}if(r.type==="tuple")return vpt(n,{checksumAddress:e,parameter:r});if(r.type==="address")return ppt(n,{checksum:e});if(r.type==="bool")return gpt(n);if(r.type.startsWith("uint")||r.type.startsWith("int")){const a=r.type.startsWith("int"),[,,o="256"]=mEe.exec(r.type)??[];return bpt(n,{signed:a,size:Number(o)})}if(r.type.startsWith("bytes"))return xpt(n,{type:r.type});if(r.type==="string")return ypt(n);throw new vEe(r.type)}function Tie(e){let t=0;for(let a=0;a<e.length;a++){const{dynamic:o,encoded:l}=e[a];o?t+=32:t+=ap(l)}const n=[],r=[];let s=0;for(let a=0;a<e.length;a++){const{dynamic:o,encoded:l}=e[a];o?(n.push(td(t+s,{size:32})),r.push(l),s+=ap(l)):n.push(l)}return Z0(...n,...r)}function ppt(e,t){const{checksum:n=!1}=t;return fB(e,{strict:n}),{dynamic:!1,encoded:w3(e.toLowerCase())}}function mpt(e,t){const{checksumAddress:n,length:r,parameter:s}=t,a=r===null;if(!Array.isArray(e))throw new Spt(e);if(!a&&e.length!==r)throw new Cpt({expectedLength:r,givenLength:e.length,type:`${s.type}[${r}]`});let o=!1;const l=[];for(let c=0;c<e.length;c++){const u=kie({checksumAddress:n,parameter:s,value:e[c]});u.dynamic&&(o=!0),l.push(u)}if(a||o){const c=Tie(l);if(a){const u=td(l.length,{size:32});return{dynamic:!0,encoded:l.length>0?Z0(u,c):u}}if(o)return{dynamic:!0,encoded:c}}return{dynamic:!1,encoded:Z0(...l.map(({encoded:c})=>c))}}function xpt(e,{type:t}){const[,n]=t.split("bytes"),r=ap(e);if(!n){let s=e;return r%32!==0&&(s=C3(s,Math.ceil((e.length-2)/2/32)*32)),{dynamic:!0,encoded:Z0(w3(td(r,{size:32})),s)}}if(r!==Number.parseInt(n))throw new bEe({expectedSize:Number.parseInt(n),value:e});return{dynamic:!1,encoded:C3(e)}}function gpt(e){if(typeof e!="boolean")throw new Nl(`Invalid boolean value: "${e}" (type: ${typeof e}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:w3(nEe(e))}}function bpt(e,{signed:t,size:n}){if(typeof n=="number"){const r=2n**(BigInt(n)-(t?1n:0n))-1n,s=t?-r-1n:0n;if(e>r||e<s)throw new sEe({max:r.toString(),min:s.toString(),signed:t,size:n/8,value:e.toString()})}return{dynamic:!1,encoded:td(e,{size:32,signed:t})}}function ypt(e){const t=jie(e),n=Math.ceil(ap(t)/32),r=[];for(let s=0;s<n;s++)r.push(C3(Eie(t,s*32,(s+1)*32)));return{dynamic:!0,encoded:Z0(C3(td(ap(t),{size:32})),...r)}}function vpt(e,t){const{checksumAddress:n,parameter:r}=t;let s=!1;const a=[];for(let o=0;o<r.components.length;o++){const l=r.components[o],c=Array.isArray(e)?o:l.name,u=kie({checksumAddress:n,parameter:l,value:e[c]});a.push(u),u.dynamic&&(s=!0)}return{dynamic:s,encoded:s?Tie(a):Z0(...a.map(({encoded:o})=>o))}}function wpt(e){const t=e.match(/^(.*)\[(\d+)?\]$/);return t?[t[2]?Number(t[2]):null,t[1]]:void 0}function xEe(e,t,n){const{checksumAddress:r=!1}={};if(e.length!==t.length)throw new yEe({expectedLength:e.length,givenLength:t.length});const s=hpt({checksumAddress:r,parameters:e,values:t}),a=Tie(s);return a.length===0?"0x":a}function gEe(e,t){if(e.length!==t.length)throw new yEe({expectedLength:e.length,givenLength:t.length});const n=[];for(let r=0;r<e.length;r++){const s=e[r],a=t[r];n.push(gEe.encode(s,a))}return Z0(...n)}(function(e){function t(n,r,s=!1){if(n==="address"){const c=r;return fB(c),w3(c.toLowerCase(),s?32:0)}if(n==="string")return jie(r);if(n==="bytes")return r;if(n==="bool")return w3(nEe(r),s?32:1);const a=n.match(mEe);if(a){const[c,u,d="256"]=a,f=Number.parseInt(d)/8;return td(r,{size:s?32:f,signed:u==="int"})}const o=n.match(fpt);if(o){const[c,u]=o;if(Number.parseInt(u)!==(r.length-2)/2)throw new bEe({expectedSize:Number.parseInt(u),value:r});return C3(r,s?32:0)}const l=n.match(dpt);if(l&&Array.isArray(r)){const[c,u]=l,d=[];for(let f=0;f<r.length;f++)d.push(t(u,r[f],!0));return d.length===0?"0x":Z0(...d)}throw new vEe(n)}e.encode=t})(gEe);class Cpt extends Nl{constructor({expectedLength:t,givenLength:n,type:r}){super(`Array length mismatch for type \`${r}\`. Expected: \`${t}\`. Given: \`${n}\`.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.ArrayLengthMismatchError"})}}class bEe extends Nl{constructor({expectedSize:t,value:n}){super(`Size of bytes "${n}" (bytes${ap(n)}) does not match expected size (bytes${t}).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.BytesSizeMismatchError"})}}class yEe extends Nl{constructor({expectedLength:t,givenLength:n}){super(["ABI encoding parameters/values length mismatch.",`Expected length (parameters): ${t}`,`Given length (values): ${n}`].join(`
`)),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.LengthMismatchError"})}}class Spt extends Nl{constructor(t){super(`Value \`${t}\` is not a valid array.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.InvalidArrayError"})}}class vEe extends Nl{constructor(t){super(`Type \`${t}\` is not a valid ABI Type.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.InvalidTypeError"})}}function Npt(e,t){var s;const{bytecode:n,args:r}=t;return Z0(n,(s=e.inputs)!=null&&s.length&&(r!=null&&r.length)?xEe(e.inputs,r):"0x")}function Apt(e){return hEe(e)}function jpt(e,...t){const{overloads:n}=e,r=n?Ept([e,...n],e.name,{args:t[0]}):e,s=_pt(r),a=t.length>0?xEe(r.inputs,t[0]):void 0;return a?Z0(s,a):s}function D6(e,t={}){return hEe(e,t)}function Ept(e,t,n){const r=lpt(e,t,n);if(r.type!=="function")throw new IZ({name:t,type:"function"});return r}function _pt(e){return pEe(e)}const kpt="0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",Km="0x0000000000000000000000000000000000000000",RI=new QD(8192);function Tpt(e,{enabled:t=!0,id:n}){if(!t||!n)return e();if(RI.get(n))return RI.get(n);const r=e().finally(()=>RI.delete(n));return RI.set(n,r),r}async function PZ(e){return new Promise(t=>setTimeout(t,e))}function iM(e,{delay:t=100,retryCount:n=2,shouldRetry:r=()=>!0}={}){return new Promise((s,a)=>{const o=async({count:l=0}={})=>{const c=async({error:u})=>{const d=typeof t=="function"?t({count:l,error:u}):t;d&&await PZ(d),o({count:l+1})};try{const u=await e();s(u)}catch(u){if(l<n&&await r({count:l,error:u}))return c({error:u});a(u)}};o()})}function Ipt(e,t={}){return async(n,r={})=>{var f;const{dedupe:s=!1,methods:a,retryDelay:o=150,retryCount:l=3,uid:c}={...t,...r},{method:u}=n;if((f=a==null?void 0:a.exclude)!=null&&f.includes(u))throw new Wv(new Error("method not supported"),{method:u});if(a!=null&&a.include&&!a.include.includes(u))throw new Wv(new Error("method not supported"),{method:u});const d=s?IS(`${c}.${Ic(n)}`):void 0;return Tpt(()=>iM(async()=>{try{return await e(n)}catch(x){const g=x;switch(g.code){case R9.code:throw new R9(g);case L9.code:throw new L9(g);case D9.code:throw new D9(g,{method:n.method});case B9.code:throw new B9(g);case g3.code:throw new g3(g);case b3.code:throw new b3(g);case $9.code:throw new $9(g);case Cy.code:throw new Cy(g);case U9.code:throw new U9(g);case Wv.code:throw new Wv(g,{method:n.method});case OS.code:throw new OS(g);case z9.code:throw new z9(g);case bo.code:throw new bo(g);case H9.code:throw new H9(g);case V9.code:throw new V9(g);case W9.code:throw new W9(g);case q9.code:throw new q9(g);case ip.code:throw new ip(g);case G9.code:throw new G9(g);case K9.code:throw new K9(g);case Y9.code:throw new Y9(g);case X9.code:throw new X9(g);case Q9.code:throw new Q9(g);case Z9.code:throw new Z9(g);case J9.code:throw new J9(g);case 5e3:throw new bo(g);default:throw x instanceof Dr?x:new Tut(g)}}},{delay:({count:x,error:g})=>{var v;if(g&&g instanceof Hj){const w=(v=g==null?void 0:g.headers)==null?void 0:v.get("Retry-After");if(w!=null&&w.match(/\d/))return Number.parseInt(w)*1e3}return~~(1<<x)*o},retryCount:l,shouldRetry:({error:x})=>Ppt(x)}),{enabled:s,id:d})}}function Ppt(e){return"code"in e&&typeof e.code=="number"?e.code===-1||e.code===OS.code||e.code===g3.code:e instanceof Hj&&e.status?e.status===403||e.status===408||e.status===413||e.status===429||e.status===500||e.status===502||e.status===503||e.status===504:!0}function hB(e){return{formatters:void 0,fees:void 0,serializers:void 0,...e}}function Iie(e,{errorInstance:t=new Error("timed out"),timeout:n,signal:r}){return new Promise((s,a)=>{(async()=>{let o;try{const l=new AbortController;n>0&&(o=setTimeout(()=>{r?l.abort():a(t)},n)),s(await e({signal:(l==null?void 0:l.signal)||null}))}catch(l){(l==null?void 0:l.name)==="AbortError"&&a(t),a(l)}finally{clearTimeout(o)}})()})}function Fpt(){return{current:0,take(){return this.current++},reset(){this.current=0}}}const Hpe=Fpt();function Opt(e,t={}){return{async request(n){var f;const{body:r,onRequest:s=t.onRequest,onResponse:a=t.onResponse,timeout:o=t.timeout??1e4}=n,l={...t.fetchOptions??{},...n.fetchOptions??{}},{headers:c,method:u,signal:d}=l;try{const x=await Iie(async({signal:v})=>{const w={...l,body:Array.isArray(r)?Ic(r.map(I=>({jsonrpc:"2.0",id:I.id??Hpe.take(),...I}))):Ic({jsonrpc:"2.0",id:r.id??Hpe.take(),...r}),headers:{"Content-Type":"application/json",...c},method:u||"POST",signal:d||(o>0?v:null)},C=new Request(e,w),N=await(s==null?void 0:s(C,w))??{...w,url:e};return await fetch(N.url??e,N)},{errorInstance:new fpe({body:r,url:e}),timeout:o,signal:!0});a&&await a(x);let g;if((f=x.headers.get("Content-Type"))!=null&&f.startsWith("application/json"))g=await x.json();else{g=await x.text();try{g=JSON.parse(g||"{}")}catch(v){if(x.ok)throw v;g={error:g}}}if(!x.ok)throw new Hj({body:r,details:Ic(g.error)||x.statusText,headers:x.headers,status:x.status,url:e});return g}catch(x){throw x instanceof Hj||x instanceof fpe?x:new Hj({body:r,cause:x,url:e})}}}}class Mpt extends Dr{constructor({domain:t}){super(`Invalid domain "${Ic(t)}".`,{metaMessages:["Must be a valid EIP-712 domain."]})}}class Rpt extends Dr{constructor({primaryType:t,types:n}){super(`Invalid primary type \`${t}\` must be one of \`${JSON.stringify(Object.keys(n))}\`.`,{docsPath:"/api/glossary/Errors#typeddatainvalidprimarytypeerror",metaMessages:["Check that the primary type is a key in `types`."]})}}class Lpt extends Dr{constructor({type:t}){super(`Struct type "${t}" is invalid.`,{metaMessages:["Struct type must not be a Solidity type."],name:"InvalidStructTypeError"})}}function Dpt(e){const{domain:t={},message:n,primaryType:r}=e,s={EIP712Domain:jEe({domain:t}),...e.types};AEe({domain:t,message:n,primaryType:r,types:s});const a=["0x1901"];return t&&a.push(Bpt({domain:t,types:s})),r!=="EIP712Domain"&&a.push(wEe({data:n,primaryType:r,types:s})),eu(s1(a))}function Bpt({domain:e,types:t}){return wEe({data:e,primaryType:"EIP712Domain",types:t})}function wEe({data:e,primaryType:t,types:n}){const r=CEe({data:e,primaryType:t,types:n});return eu(r)}function CEe({data:e,primaryType:t,types:n}){const r=[{type:"bytes32"}],s=[$pt({primaryType:t,types:n})];for(const a of n[t]){const[o,l]=NEe({types:n,name:a.name,type:a.type,value:e[a.name]});r.push(o),s.push(l)}return s2(r,s)}function $pt({primaryType:e,types:t}){const n=ci(Upt({primaryType:e,types:t}));return eu(n)}function Upt({primaryType:e,types:t}){let n="";const r=SEe({primaryType:e,types:t});r.delete(e);const s=[e,...Array.from(r).sort()];for(const a of s)n+=`${a}(${t[a].map(({name:o,type:l})=>`${l} ${o}`).join(",")})`;return n}function SEe({primaryType:e,types:t},n=new Set){const r=e.match(/^\w*/u),s=r==null?void 0:r[0];if(n.has(s)||t[s]===void 0)return n;n.add(s);for(const a of t[s])SEe({primaryType:a.type,types:t},n);return n}function NEe({types:e,name:t,type:n,value:r}){if(e[n]!==void 0)return[{type:"bytes32"},eu(CEe({data:r,primaryType:n,types:e}))];if(n==="bytes")return r=`0x${(r.length%2?"0":"")+r.slice(2)}`,[{type:"bytes32"},eu(r)];if(n==="string")return[{type:"bytes32"},eu(ci(r))];if(n.lastIndexOf("]")===n.length-1){const s=n.slice(0,n.lastIndexOf("[")),a=r.map(o=>NEe({name:t,type:s,types:e,value:o}));return[{type:"bytes32"},eu(s2(a.map(([o])=>o),a.map(([,o])=>o)))]}return[{type:n},r]}function zpt(e){const{domain:t,message:n,primaryType:r,types:s}=e,a=(c,u)=>{const d={...u};for(const f of c){const{name:x,type:g}=f;g==="address"&&(d[x]=d[x].toLowerCase())}return d},o=s.EIP712Domain?t?a(s.EIP712Domain,t):{}:{},l=(()=>{if(r!=="EIP712Domain")return a(s[r],n)})();return Ic({domain:o,message:l,primaryType:r,types:s})}function AEe(e){const{domain:t,message:n,primaryType:r,types:s}=e,a=(o,l)=>{for(const c of o){const{name:u,type:d}=c,f=l[u],x=d.match(Wje);if(x&&(typeof f=="number"||typeof f=="bigint")){const[w,C,N]=x;$s(f,{signed:C==="int",size:Number.parseInt(N)/8})}if(d==="address"&&typeof f=="string"&&!ic(f))throw new pd({address:f});const g=d.match(Zct);if(g){const[w,C]=g;if(C&&sl(f)!==Number.parseInt(C))throw new Cct({expectedSize:Number.parseInt(C),givenSize:sl(f)})}const v=s[d];v&&(Hpt(d),a(v,f))}};if(s.EIP712Domain&&t){if(typeof t!="object")throw new Mpt({domain:t});a(s.EIP712Domain,t)}if(r!=="EIP712Domain")if(s[r])a(s[r],n);else throw new Rpt({primaryType:r,types:s})}function jEe({domain:e}){return[typeof(e==null?void 0:e.name)=="string"&&{name:"name",type:"string"},(e==null?void 0:e.version)&&{name:"version",type:"string"},(typeof(e==null?void 0:e.chainId)=="number"||typeof(e==null?void 0:e.chainId)=="bigint")&&{name:"chainId",type:"uint256"},(e==null?void 0:e.verifyingContract)&&{name:"verifyingContract",type:"address"},(e==null?void 0:e.salt)&&{name:"salt",type:"bytes32"}].filter(Boolean)}function Hpt(e){if(e==="address"||e==="bool"||e==="string"||e.startsWith("bytes")||e.startsWith("uint")||e.startsWith("int"))throw new Lpt({type:e})}function Vpt(e){const{authorizationList:t}=e;if(t)for(const n of t){const{chainId:r}=n,s=n.address;if(!ic(s))throw new pd({address:s});if(r<0)throw new tB({chainId:r})}Pie(e)}function Wpt(e){const{blobVersionedHashes:t}=e;if(t){if(t.length===0)throw new c9e;for(const n of t){const r=sl(n),s=X0(m3(n,0,1));if(r!==32)throw new ndt({hash:n,size:r});if(s!==l9e)throw new rdt({hash:n,version:s})}}Pie(e)}function Pie(e){const{chainId:t,maxPriorityFeePerGas:n,maxFeePerGas:r,to:s}=e;if(t<=0)throw new tB({chainId:t});if(s&&!ic(s))throw new pd({address:s});if(r&&r>sB)throw new x3({maxFeePerGas:r});if(n&&r&&n>r)throw new M9({maxFeePerGas:r,maxPriorityFeePerGas:n})}function qpt(e){const{chainId:t,maxPriorityFeePerGas:n,gasPrice:r,maxFeePerGas:s,to:a}=e;if(t<=0)throw new tB({chainId:t});if(a&&!ic(a))throw new pd({address:a});if(n||s)throw new Dr("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid EIP-2930 Transaction attribute.");if(r&&r>sB)throw new x3({maxFeePerGas:r})}function Gpt(e){const{chainId:t,maxPriorityFeePerGas:n,gasPrice:r,maxFeePerGas:s,to:a}=e;if(a&&!ic(a))throw new pd({address:a});if(typeof t<"u"&&t<=0)throw new tB({chainId:t});if(n||s)throw new Dr("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid Legacy Transaction attribute.");if(r&&r>sB)throw new x3({maxFeePerGas:r})}function pB(e){if(!e||e.length===0)return[];const t=[];for(let n=0;n<e.length;n++){const{address:r,storageKeys:s}=e[n];for(let a=0;a<s.length;a++)if(s[a].length-2!==64)throw new Aut({storageKey:s[a]});if(!ic(r,{strict:!1}))throw new pd({address:r});t.push([r,s])}return t}function Kpt(e,t){const n=d9e(e);return n==="eip1559"?Qpt(e,t):n==="eip2930"?Zpt(e,t):n==="eip4844"?Xpt(e,t):n==="eip7702"?Ypt(e,t):Jpt(e,t)}function Ypt(e,t){const{authorizationList:n,chainId:r,gas:s,nonce:a,to:o,value:l,maxFeePerGas:c,maxPriorityFeePerGas:u,accessList:d,data:f}=e;Vpt(e);const x=pB(d),g=emt(n);return Sm(["0x04",By([ci(r),a?ci(a):"0x",u?ci(u):"0x",c?ci(c):"0x",s?ci(s):"0x",o??"0x",l?ci(l):"0x",f??"0x",x,g,...Mk(e,t)])])}function Xpt(e,t){const{chainId:n,gas:r,nonce:s,to:a,value:o,maxFeePerBlobGas:l,maxFeePerGas:c,maxPriorityFeePerGas:u,accessList:d,data:f}=e;Wpt(e);let x=e.blobVersionedHashes,g=e.sidecars;if(e.blobs&&(typeof x>"u"||typeof g>"u")){const I=typeof e.blobs[0]=="string"?e.blobs:e.blobs.map(U=>Wl(U)),R=e.kzg,F=fie({blobs:I,kzg:R});if(typeof x>"u"&&(x=i9e({commitments:F})),typeof g>"u"){const U=hie({blobs:I,commitments:F,kzg:R});g=u9e({blobs:I,commitments:F,proofs:U})}}const v=pB(d),w=[ci(n),s?ci(s):"0x",u?ci(u):"0x",c?ci(c):"0x",r?ci(r):"0x",a??"0x",o?ci(o):"0x",f??"0x",v,l?ci(l):"0x",x??[],...Mk(e,t)],C=[],N=[],P=[];if(g)for(let I=0;I<g.length;I++){const{blob:R,commitment:F,proof:U}=g[I];C.push(R),N.push(F),P.push(U)}return Sm(["0x03",By(g?[w,C,N,P]:w)])}function Qpt(e,t){const{chainId:n,gas:r,nonce:s,to:a,value:o,maxFeePerGas:l,maxPriorityFeePerGas:c,accessList:u,data:d}=e;Pie(e);const f=pB(u),x=[ci(n),s?ci(s):"0x",c?ci(c):"0x",l?ci(l):"0x",r?ci(r):"0x",a??"0x",o?ci(o):"0x",d??"0x",f,...Mk(e,t)];return Sm(["0x02",By(x)])}function Zpt(e,t){const{chainId:n,gas:r,data:s,nonce:a,to:o,value:l,accessList:c,gasPrice:u}=e;qpt(e);const d=pB(c),f=[ci(n),a?ci(a):"0x",u?ci(u):"0x",r?ci(r):"0x",o??"0x",l?ci(l):"0x",s??"0x",d,...Mk(e,t)];return Sm(["0x01",By(f)])}function Jpt(e,t){const{chainId:n=0,gas:r,data:s,nonce:a,to:o,value:l,gasPrice:c}=e;Gpt(e);let u=[a?ci(a):"0x",c?ci(c):"0x",r?ci(r):"0x",o??"0x",l?ci(l):"0x",s??"0x"];if(t){const d=(()=>{if(t.v>=35n)return(t.v-35n)/2n>0?t.v:27n+(t.v===35n?0n:1n);if(n>0)return BigInt(n*2)+BigInt(35n+t.v-27n);const g=27n+(t.v===27n?0n:1n);if(t.v!==g)throw new Sut({v:t.v});return g})(),f=Hf(t.r),x=Hf(t.s);u=[...u,ci(d),f==="0x00"?"0x":f,x==="0x00"?"0x":x]}else n>0&&(u=[...u,ci(n),"0x","0x"]);return By(u)}function Mk(e,t){const n=t??e,{v:r,yParity:s}=n;if(typeof n.r>"u")return[];if(typeof n.s>"u")return[];if(typeof r>"u"&&typeof s>"u")return[];const a=Hf(n.r),o=Hf(n.s);return[typeof s=="number"?s?ci(1):"0x":r===0n?"0x":r===1n?ci(1):r===27n?"0x":ci(1),a==="0x00"?"0x":a,o==="0x00"?"0x":o]}function emt(e){if(!e||e.length===0)return[];const t=[];for(const n of e){const{chainId:r,nonce:s,...a}=n,o=n.address;t.push([r?ci(r):"0x",o,s?ci(s):"0x",...Mk({},a)])}return t}const tmt=`Ethereum Signed Message:
`;function nmt(e){const t=typeof e=="string"?IS(e):typeof e.raw=="string"?e.raw:Wl(e.raw),n=IS(`${tmt}${sl(t)}`);return s1([n,t])}function EEe(e,t){return eu(nmt(e),t)}const _Ee="0x6492649264926492649264926492649264926492649264926492649264926492";function rmt(e){return Vje(e,-32)===_Ee}function smt(e){const{address:t,data:n,signature:r,to:s="hex"}=e,a=Sm([s2([{type:"address"},{type:"bytes"},{type:"bytes"}],[t,n,r]),_Ee]);return s==="hex"?a:sp(a)}class imt extends Dr{constructor({value:t}){super(`Number \`${t}\` is not a valid decimal number.`,{name:"InvalidDecimalNumberError"})}}function amt(e,t){if(!/^(-?)([0-9]*)\.?([0-9]*)$/.test(e))throw new imt({value:e});let[n,r="0"]=e.split(".");const s=n.startsWith("-");if(s&&(n=n.slice(1)),r=r.replace(/(0+)$/,""),t===0)Math.round(+`.${r}`)===1&&(n=`${BigInt(n)+1n}`),r="";else if(r.length>t){const[a,o,l]=[r.slice(0,t-1),r.slice(t-1,t),r.slice(t)],c=Math.round(+`${o}.${l}`);c>9?r=`${BigInt(a)+BigInt(1)}0`.padStart(a.length+1,"0"):r=`${a}${c}`,r.length>t&&(r=r.slice(1),n=`${BigInt(n)+1n}`),r=r.slice(0,t)}else r=r.padEnd(t,"0");return BigInt(`${s?"-":""}${n}${r}`)}const omt="0x6080604052348015600e575f80fd5b5061016d8061001c5f395ff3fe608060405234801561000f575f80fd5b5060043610610029575f3560e01c8063f8b2cb4f1461002d575b5f80fd5b610047600480360381019061004291906100db565b61005d565b604051610054919061011e565b60405180910390f35b5f8173ffffffffffffffffffffffffffffffffffffffff16319050919050565b5f80fd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f6100aa82610081565b9050919050565b6100ba816100a0565b81146100c4575f80fd5b50565b5f813590506100d5816100b1565b92915050565b5f602082840312156100f0576100ef61007d565b5b5f6100fd848285016100c7565b91505092915050565b5f819050919050565b61011881610106565b82525050565b5f6020820190506101315f83018461010f565b9291505056fea26469706673582212203b9fe929fe995c7cf9887f0bdba8a36dd78e8b73f149b17d2d9ad7cd09d2dc6264736f6c634300081a0033";async function lmt(e,t){const{blockNumber:n,blockTag:r,calls:s,stateOverrides:a,traceAssetChanges:o,traceTransfers:l,validation:c}=t,u=t.account?Du(t.account):void 0;if(o&&!u)throw new Dr("`account` is required when `traceAssetChanges` is true");const d=u?Npt(Apt("constructor(bytes, bytes)"),{bytecode:D9e,args:[omt,jpt(D6("function getBalance(address)"),[u.address])]}):void 0,f=o?await Promise.all(t.calls.map(async V=>{if(!V.data&&!V.abi)return;const{accessList:ee}=await G9e(e,{account:u.address,...V,data:V.abi?Nm(V):V.data});return ee.map(({address:ae,storageKeys:fe})=>fe.length>0?ae:null)})).then(V=>V.flat().filter(Boolean)):[],x=a==null?void 0:a.map(V=>V.address===(u==null?void 0:u.address)?{...V,nonce:0}:V),g=await EZ(e,{blockNumber:n,blockTag:r,blocks:[...o?[{calls:[{data:d}],stateOverrides:a},{calls:f.map((V,ee)=>({abi:[D6("function balanceOf(address) returns (uint256)")],functionName:"balanceOf",args:[u.address],to:V,from:Km,nonce:ee})),stateOverrides:[{address:Km,nonce:0}]}]:[],{calls:[...s,{}].map((V,ee)=>({...V,from:u==null?void 0:u.address,nonce:ee})),stateOverrides:x},...o?[{calls:[{data:d}]},{calls:f.map((V,ee)=>({abi:[D6("function balanceOf(address) returns (uint256)")],functionName:"balanceOf",args:[u.address],to:V,from:Km,nonce:ee})),stateOverrides:[{address:Km,nonce:0}]},{calls:f.map((V,ee)=>({to:V,abi:[D6("function decimals() returns (uint256)")],functionName:"decimals",from:Km,nonce:ee})),stateOverrides:[{address:Km,nonce:0}]},{calls:f.map((V,ee)=>({to:V,abi:[D6("function tokenURI(uint256) returns (string)")],functionName:"tokenURI",args:[0n],from:Km,nonce:ee})),stateOverrides:[{address:Km,nonce:0}]},{calls:f.map((V,ee)=>({to:V,abi:[D6("function symbol() returns (string)")],functionName:"symbol",from:Km,nonce:ee})),stateOverrides:[{address:Km,nonce:0}]}]:[]],traceTransfers:l,validation:c}),v=o?g[2]:g[0],[w,C,,N,P,I,R,F]=o?g:[],{calls:U,...L}=v,z=U.slice(0,-1)??[],Q=(w==null?void 0:w.calls)??[],ne=(C==null?void 0:C.calls)??[],J=[...Q,...ne].map(V=>V.status==="success"?nd(V.data):null),X=(N==null?void 0:N.calls)??[],re=(P==null?void 0:P.calls)??[],pe=[...X,...re].map(V=>V.status==="success"?nd(V.data):null),Y=((I==null?void 0:I.calls)??[]).map(V=>V.status==="success"?V.result:null),ie=((F==null?void 0:F.calls)??[]).map(V=>V.status==="success"?V.result:null),oe=((R==null?void 0:R.calls)??[]).map(V=>V.status==="success"?V.result:null),G=[];for(const[V,ee]of pe.entries()){const ae=J[V];if(typeof ee!="bigint"||typeof ae!="bigint")continue;const fe=Y[V-1],Ne=ie[V-1],he=oe[V-1],ge=V===0?{address:kpt,decimals:18,symbol:"ETH"}:{address:f[V-1],decimals:he||fe?Number(fe??1):void 0,symbol:Ne??void 0};G.some(ye=>ye.token.address===ge.address)||G.push({token:ge,value:{pre:ae,post:ee,diff:ee-ae}})}return{assetChanges:G,block:L,results:z}}const iH=new Map,Vpe=new Map;let cmt=0;function $y(e,t,n){const r=++cmt,s=()=>iH.get(e)||[],a=()=>{const d=s();iH.set(e,d.filter(f=>f.id!==r))},o=()=>{const d=s();if(!d.some(x=>x.id===r))return;const f=Vpe.get(e);d.length===1&&f&&f(),a()},l=s();if(iH.set(e,[...l,{id:r,fns:t}]),l.length>0)return o;const c={};for(const d in t)c[d]=(...f)=>{var g,v;const x=s();if(x.length!==0)for(const w of x)(v=(g=w.fns)[d])==null||v.call(g,...f)};const u=n(c);return typeof u=="function"&&Vpe.set(e,u),o}function Rk(e,{emitOnBegin:t,initialWaitTime:n,interval:r}){let s=!0;const a=()=>s=!1;return(async()=>{let l;t&&(l=await e({unpoll:a}));const c=await(n==null?void 0:n(l))??r;await PZ(c);const u=async()=>{s&&(await e({unpoll:a}),await PZ(r),u())};u()})(),a}function umt(e,{blockTag:t="latest",emitMissed:n=!1,emitOnBegin:r=!1,onBlock:s,onError:a,includeTransactions:o,poll:l,pollingInterval:c=e.pollingInterval}){const u=typeof l<"u"?l:!(e.transport.type==="webSocket"||e.transport.type==="fallback"&&e.transport.transports[0].config.type==="webSocket"),d=o??!1;let f;return u?(()=>{const v=Ic(["watchBlocks",e.uid,t,n,r,d,c]);return $y(v,{onBlock:s,onError:a},w=>Rk(async()=>{var C;try{const N=await si(e,j0,"getBlock")({blockTag:t,includeTransactions:d});if(N.number&&(f!=null&&f.number)){if(N.number===f.number)return;if(N.number-f.number>1&&n)for(let P=(f==null?void 0:f.number)+1n;P<N.number;P++){const I=await si(e,j0,"getBlock")({blockNumber:P,includeTransactions:d});w.onBlock(I,f),f=I}}(!(f!=null&&f.number)||t==="pending"&&!(N!=null&&N.number)||N.number&&N.number>f.number)&&(w.onBlock(N,f),f=N)}catch(N){(C=w.onError)==null||C.call(w,N)}},{emitOnBegin:r,interval:c}))})():(()=>{let v=!0,w=!0,C=()=>v=!1;return(async()=>{try{r&&si(e,j0,"getBlock")({blockTag:t,includeTransactions:d}).then(I=>{v&&w&&(s(I,void 0),w=!1)});const N=(()=>{if(e.transport.type==="fallback"){const I=e.transport.transports.find(R=>R.config.type==="webSocket");return I?I.value:e.transport}return e.transport})(),{unsubscribe:P}=await N.subscribe({params:["newHeads"],async onData(I){if(!v)return;const R=await si(e,j0,"getBlock")({blockNumber:I.blockNumber,includeTransactions:d}).catch(()=>{});v&&(s(R,f),w=!1,f=R)},onError(I){a==null||a(I)}});C=P,v||C()}catch(N){a==null||a(N)}})(),()=>C()})()}function kEe(e,{emitOnBegin:t=!1,emitMissed:n=!1,onBlockNumber:r,onError:s,poll:a,pollingInterval:o=e.pollingInterval}){const l=typeof a<"u"?a:!(e.transport.type==="webSocket"||e.transport.type==="fallback"&&e.transport.transports[0].config.type==="webSocket");let c;return l?(()=>{const f=Ic(["watchBlockNumber",e.uid,t,n,o]);return $y(f,{onBlockNumber:r,onError:s},x=>Rk(async()=>{var g;try{const v=await si(e,Ok,"getBlockNumber")({cacheTime:0});if(c){if(v===c)return;if(v-c>1&&n)for(let w=c+1n;w<v;w++)x.onBlockNumber(w,c),c=w}(!c||v>c)&&(x.onBlockNumber(v,c),c=v)}catch(v){(g=x.onError)==null||g.call(x,v)}},{emitOnBegin:t,interval:o}))})():(()=>{const f=Ic(["watchBlockNumber",e.uid,t,n]);return $y(f,{onBlockNumber:r,onError:s},x=>{let g=!0,v=()=>g=!1;return(async()=>{try{const w=(()=>{if(e.transport.type==="fallback"){const N=e.transport.transports.find(P=>P.config.type==="webSocket");return N?N.value:e.transport}return e.transport})(),{unsubscribe:C}=await w.subscribe({params:["newHeads"],onData(N){var I;if(!g)return;const P=nd((I=N.result)==null?void 0:I.number);x.onBlockNumber(P,c),c=P},onError(N){var P;(P=x.onError)==null||P.call(x,N)}});v=C,g||v()}catch(w){s==null||s(w)}})(),()=>v()})})()}async function mB(e,{filter:t}){return t.request({method:"eth_uninstallFilter",params:[t.id]})}function dmt(e,{address:t,args:n,batch:r=!0,event:s,events:a,fromBlock:o,onError:l,onLogs:c,poll:u,pollingInterval:d=e.pollingInterval,strict:f}){const x=typeof u<"u"?u:typeof o=="bigint"?!0:!(e.transport.type==="webSocket"||e.transport.type==="fallback"&&e.transport.transports[0].config.type==="webSocket"),g=f??!1;return x?(()=>{const C=Ic(["watchEvent",t,n,r,e.uid,s,d,o]);return $y(C,{onLogs:c,onError:l},N=>{let P;o!==void 0&&(P=o-1n);let I,R=!1;const F=Rk(async()=>{var U;if(!R){try{I=await si(e,Y9e,"createEventFilter")({address:t,args:n,event:s,events:a,strict:g,fromBlock:o})}catch{}R=!0;return}try{let L;if(I)L=await si(e,dB,"getFilterChanges")({filter:I});else{const z=await si(e,Ok,"getBlockNumber")({});P&&P!==z?L=await si(e,Sie,"getLogs")({address:t,args:n,event:s,events:a,fromBlock:P+1n,toBlock:z}):L=[],P=z}if(L.length===0)return;if(r)N.onLogs(L);else for(const z of L)N.onLogs([z])}catch(L){I&&L instanceof b3&&(R=!1),(U=N.onError)==null||U.call(N,L)}},{emitOnBegin:!0,interval:d});return async()=>{I&&await si(e,mB,"uninstallFilter")({filter:I}),F()}})})():(()=>{let C=!0,N=()=>C=!1;return(async()=>{try{const P=(()=>{if(e.transport.type==="fallback"){const U=e.transport.transports.find(L=>L.config.type==="webSocket");return U?U.value:e.transport}return e.transport})(),I=a??(s?[s]:void 0);let R=[];I&&(R=[I.flatMap(L=>Fk({abi:[L],eventName:L.name,args:n}))],s&&(R=R[0]));const{unsubscribe:F}=await P.subscribe({params:["logs",{address:t,topics:R}],onData(U){var z;if(!C)return;const L=U.result;try{const{eventName:Q,args:ne}=wie({abi:I??[],data:L.data,topics:L.topics,strict:g}),J=i1(L,{args:ne,eventName:Q});c([J])}catch(Q){let ne,J;if(Q instanceof O9||Q instanceof XD){if(f)return;ne=Q.abiItem.name,J=(z=Q.abiItem.inputs)==null?void 0:z.some(re=>!("name"in re&&re.name))}const X=i1(L,{args:J?[]:{},eventName:ne});c([X])}},onError(U){l==null||l(U)}});N=F,C||N()}catch(P){l==null||l(P)}})(),()=>N()})()}function fmt(e,{batch:t=!0,onError:n,onTransactions:r,poll:s,pollingInterval:a=e.pollingInterval}){return(typeof s<"u"?s:e.transport.type!=="webSocket")?(()=>{const u=Ic(["watchPendingTransactions",e.uid,t,a]);return $y(u,{onTransactions:r,onError:n},d=>{let f;const x=Rk(async()=>{var g;try{if(!f)try{f=await si(e,X9e,"createPendingTransactionFilter")({});return}catch(w){throw x(),w}const v=await si(e,dB,"getFilterChanges")({filter:f});if(v.length===0)return;if(t)d.onTransactions(v);else for(const w of v)d.onTransactions([w])}catch(v){(g=d.onError)==null||g.call(d,v)}},{emitOnBegin:!0,interval:a});return async()=>{f&&await si(e,mB,"uninstallFilter")({filter:f}),x()}})})():(()=>{let u=!0,d=()=>u=!1;return(async()=>{try{const{unsubscribe:f}=await e.transport.subscribe({params:["newPendingTransactions"],onData(x){if(!u)return;const g=x.result;r([g])},onError(x){n==null||n(x)}});d=f,u||d()}catch(f){n==null||n(f)}})(),()=>d()})()}function hmt(e){return e.map(t=>({...t,value:BigInt(t.value)}))}function pmt(e){return{...e,balance:e.balance?BigInt(e.balance):void 0,nonce:e.nonce?X0(e.nonce):void 0,storageProof:e.storageProof?hmt(e.storageProof):void 0}}async function mmt(e,{address:t,blockNumber:n,blockTag:r,storageKeys:s}){const a=r??"latest",o=n!==void 0?$s(n):void 0,l=await e.request({method:"eth_getProof",params:[t,s,o||a]});return pmt(l)}async function xmt(e,{confirmations:t=1,hash:n,onReplaced:r,pollingInterval:s=e.pollingInterval,retryCount:a=6,retryDelay:o=({count:c})=>~~(1<<c)*200,timeout:l=18e4}){const c=Ic(["waitForTransactionReceipt",e.uid,n]);let u,d,f,x=!1;const{promise:g,resolve:v,reject:w}=$9e(),C=l?setTimeout(()=>w(new Eut({hash:n})),l):void 0,N=$y(c,{onReplaced:r,resolve:v,reject:w},P=>{const I=si(e,kEe,"watchBlockNumber")({emitMissed:!0,emitOnBegin:!0,poll:!0,pollingInterval:s,async onBlockNumber(R){const F=L=>{clearTimeout(C),I(),L(),N()};let U=R;if(!x)try{if(f){if(t>1&&(!f.blockNumber||U-f.blockNumber+1n<t))return;F(()=>P.resolve(f));return}if(u||(x=!0,await iM(async()=>{u=await si(e,Nie,"getTransaction")({hash:n}),u.blockNumber&&(U=u.blockNumber)},{delay:o,retryCount:a}),x=!1),f=await si(e,AZ,"getTransactionReceipt")({hash:n}),t>1&&(!f.blockNumber||U-f.blockNumber+1n<t))return;F(()=>P.resolve(f))}catch(L){if(L instanceof Zje||L instanceof Jje){if(!u){x=!1;return}try{d=u,x=!0;const z=await iM(()=>si(e,j0,"getBlock")({blockNumber:U,includeTransactions:!0}),{delay:o,retryCount:a,shouldRetry:({error:J})=>J instanceof e9e});x=!1;const Q=z.transactions.find(({from:J,nonce:X})=>J===d.from&&X===d.nonce);if(!Q||(f=await si(e,AZ,"getTransactionReceipt")({hash:Q.hash}),t>1&&(!f.blockNumber||U-f.blockNumber+1n<t)))return;let ne="replaced";Q.to===d.to&&Q.value===d.value&&Q.input===d.input?ne="repriced":Q.from===Q.to&&Q.value===0n&&(ne="cancelled"),F(()=>{var J;(J=P.onReplaced)==null||J.call(P,{reason:ne,replacedTransaction:d,transaction:Q,transactionReceipt:f}),P.resolve(f)})}catch(z){F(()=>P.reject(z))}}else F(()=>P.reject(L))}}})});return g}async function gmt(e,{account:t=e.account,message:n}){if(!t)throw new eB({docsPath:"/docs/actions/wallet/signMessage"});const r=Du(t);if(r.signMessage)return r.signMessage({message:n});const s=typeof n=="string"?IS(n):n.raw instanceof Uint8Array?ci(n.raw):n.raw;return e.request({method:"personal_sign",params:[s,r.address]},{retryCount:0})}async function bmt(e,t){const{account:n=e.account,domain:r,message:s,primaryType:a}=t;if(!n)throw new eB({docsPath:"/docs/actions/wallet/signTypedData"});const o=Du(n),l={EIP712Domain:jEe({domain:r}),...t.types};if(AEe({domain:r,message:s,primaryType:a,types:l}),o.signTypedData)return o.signTypedData({domain:r,message:s,primaryType:a,types:l});const c=zpt({domain:r,message:s,primaryType:a,types:l});return e.request({method:"eth_signTypedData_v4",params:[o.address,c]},{retryCount:0})}async function ymt(e,t){const{abi:n,address:r,args:s,dataSuffix:a,functionName:o,...l}=t,c=l.account?Du(l.account):e.account,u=Nm({abi:n,args:s,functionName:o});try{const{data:d}=await si(e,cB,"call")({batch:!1,data:`${u}${a?a.replace("0x",""):""}`,to:r,...l,account:c}),f=a5({abi:n,args:s,functionName:o,data:d||"0x"}),x=n.filter(g=>"name"in g&&g.name===t.functionName);return{result:f,request:{abi:x,address:r,args:s,dataSuffix:a,functionName:o,...l,account:c}}}catch(d){throw v3(d,{abi:n,address:r,args:s,docsPath:"/docs/contract/simulateContract",functionName:o,sender:c==null?void 0:c.address})}}let TEe=class extends Yse{constructor(t,n){super(),this.finished=!1,this.destroyed=!1,_ct(t);const r=ZD(n);if(this.iHash=t.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const s=this.blockLen,a=new Uint8Array(s);a.set(r.length>s?t.create().update(r).digest():r);for(let o=0;o<a.length;o++)a[o]^=54;this.iHash.update(a),this.oHash=t.create();for(let o=0;o<a.length;o++)a[o]^=106;this.oHash.update(a),a.fill(0)}update(t){return FS(this),this.iHash.update(t),this}digestInto(t){FS(this),jk(t,this.outputLen),this.finished=!0,this.iHash.digestInto(t),this.oHash.update(t),this.oHash.digestInto(t),this.destroy()}digest(){const t=new Uint8Array(this.oHash.outputLen);return this.digestInto(t),t}_cloneInto(t){t||(t=Object.create(Object.getPrototypeOf(this),{}));const{oHash:n,iHash:r,finished:s,destroyed:a,blockLen:o,outputLen:l}=this;return t=t,t.finished=s,t.destroyed=a,t.blockLen=o,t.outputLen=l,t.oHash=n._cloneInto(t.oHash),t.iHash=r._cloneInto(t.iHash),t}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}};const IEe=(e,t,n)=>new TEe(e,t).update(n).digest();IEe.create=(e,t)=>new TEe(e,t);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Fie=BigInt(0),FZ=BigInt(1);function MS(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function Oie(e){if(!MS(e))throw new Error("Uint8Array expected")}function tE(e,t){if(typeof t!="boolean")throw new Error(e+" boolean expected, got "+t)}function LI(e){const t=e.toString(16);return t.length&1?"0"+t:t}function PEe(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);return e===""?Fie:BigInt("0x"+e)}const FEe=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",vmt=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function nE(e){if(Oie(e),FEe)return e.toHex();let t="";for(let n=0;n<e.length;n++)t+=vmt[e[n]];return t}const $x={_0:48,_9:57,A:65,F:70,a:97,f:102};function Wpe(e){if(e>=$x._0&&e<=$x._9)return e-$x._0;if(e>=$x.A&&e<=$x.F)return e-($x.A-10);if(e>=$x.a&&e<=$x.f)return e-($x.a-10)}function aM(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);if(FEe)return Uint8Array.fromHex(e);const t=e.length,n=t/2;if(t%2)throw new Error("hex string expected, got unpadded hex of length "+t);const r=new Uint8Array(n);for(let s=0,a=0;s<n;s++,a+=2){const o=Wpe(e.charCodeAt(a)),l=Wpe(e.charCodeAt(a+1));if(o===void 0||l===void 0){const c=e[a]+e[a+1];throw new Error('hex string expected, got non-hex character "'+c+'" at index '+a)}r[s]=o*16+l}return r}function Gw(e){return PEe(nE(e))}function OEe(e){return Oie(e),PEe(nE(Uint8Array.from(e).reverse()))}function rE(e,t){return aM(e.toString(16).padStart(t*2,"0"))}function MEe(e,t){return rE(e,t).reverse()}function Dp(e,t,n){let r;if(typeof t=="string")try{r=aM(t)}catch(a){throw new Error(e+" must be hex string or Uint8Array, cause: "+a)}else if(MS(t))r=Uint8Array.from(t);else throw new Error(e+" must be hex string or Uint8Array");const s=r.length;if(typeof n=="number"&&s!==n)throw new Error(e+" of length "+n+" expected, got "+s);return r}function oM(...e){let t=0;for(let r=0;r<e.length;r++){const s=e[r];Oie(s),t+=s.length}const n=new Uint8Array(t);for(let r=0,s=0;r<e.length;r++){const a=e[r];n.set(a,s),s+=a.length}return n}const aH=e=>typeof e=="bigint"&&Fie<=e;function Mie(e,t,n){return aH(e)&&aH(t)&&aH(n)&&t<=e&&e<n}function JC(e,t,n,r){if(!Mie(t,n,r))throw new Error("expected valid "+e+": "+n+" <= n < "+r+", got "+t)}function wmt(e){let t;for(t=0;e>Fie;e>>=FZ,t+=1);return t}const xB=e=>(FZ<<BigInt(e))-FZ,oH=e=>new Uint8Array(e),qpe=e=>Uint8Array.from(e);function Cmt(e,t,n){if(typeof e!="number"||e<2)throw new Error("hashLen must be a number");if(typeof t!="number"||t<2)throw new Error("qByteLen must be a number");if(typeof n!="function")throw new Error("hmacFn must be a function");let r=oH(e),s=oH(e),a=0;const o=()=>{r.fill(1),s.fill(0),a=0},l=(...f)=>n(s,r,...f),c=(f=oH(0))=>{s=l(qpe([0]),f),r=l(),f.length!==0&&(s=l(qpe([1]),f),r=l())},u=()=>{if(a++>=1e3)throw new Error("drbg: tried 1000 values");let f=0;const x=[];for(;f<t;){r=l();const g=r.slice();x.push(g),f+=r.length}return oM(...x)};return(f,x)=>{o(),c(f);let g;for(;!(g=x(u()));)c();return o(),g}}const Smt={bigint:e=>typeof e=="bigint",function:e=>typeof e=="function",boolean:e=>typeof e=="boolean",string:e=>typeof e=="string",stringOrUint8Array:e=>typeof e=="string"||MS(e),isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,t)=>t.Fp.isValid(e),hash:e=>typeof e=="function"&&Number.isSafeInteger(e.outputLen)};function gB(e,t,n={}){const r=(s,a,o)=>{const l=Smt[a];if(typeof l!="function")throw new Error("invalid validator function");const c=e[s];if(!(o&&c===void 0)&&!l(c,e))throw new Error("param "+String(s)+" is invalid. Expected "+a+", got "+c)};for(const[s,a]of Object.entries(t))r(s,a,!1);for(const[s,a]of Object.entries(n))r(s,a,!0);return e}function Gpe(e){const t=new WeakMap;return(n,...r)=>{const s=t.get(n);if(s!==void 0)return s;const a=e(n,...r);return t.set(n,a),a}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Ec=BigInt(0),bl=BigInt(1),Ov=BigInt(2),Nmt=BigInt(3),OZ=BigInt(4),Kpe=BigInt(5),Ype=BigInt(8);function Ud(e,t){const n=e%t;return n>=Ec?n:t+n}function Amt(e,t,n){if(t<Ec)throw new Error("invalid exponent, negatives unsupported");if(n<=Ec)throw new Error("invalid modulus");if(n===bl)return Ec;let r=bl;for(;t>Ec;)t&bl&&(r=r*e%n),e=e*e%n,t>>=bl;return r}function mh(e,t,n){let r=e;for(;t-- >Ec;)r*=r,r%=n;return r}function MZ(e,t){if(e===Ec)throw new Error("invert: expected non-zero number");if(t<=Ec)throw new Error("invert: expected positive modulus, got "+t);let n=Ud(e,t),r=t,s=Ec,a=bl;for(;n!==Ec;){const l=r/n,c=r%n,u=s-a*l;r=n,n=c,s=a,a=u}if(r!==bl)throw new Error("invert: does not exist");return Ud(s,t)}function jmt(e){const t=(e-bl)/Ov;let n,r,s;for(n=e-bl,r=0;n%Ov===Ec;n/=Ov,r++);for(s=Ov;s<e&&Amt(s,t,e)!==e-bl;s++)if(s>1e3)throw new Error("Cannot find square root: likely non-prime P");if(r===1){const o=(e+bl)/OZ;return function(c,u){const d=c.pow(u,o);if(!c.eql(c.sqr(d),u))throw new Error("Cannot find square root");return d}}const a=(n+bl)/Ov;return function(l,c){if(l.pow(c,t)===l.neg(l.ONE))throw new Error("Cannot find square root");let u=r,d=l.pow(l.mul(l.ONE,s),n),f=l.pow(c,a),x=l.pow(c,n);for(;!l.eql(x,l.ONE);){if(l.eql(x,l.ZERO))return l.ZERO;let g=1;for(let w=l.sqr(x);g<u&&!l.eql(w,l.ONE);g++)w=l.sqr(w);const v=l.pow(d,bl<<BigInt(u-g-1));d=l.sqr(v),f=l.mul(f,v),x=l.mul(x,d),u=g}return f}}function Emt(e){if(e%OZ===Nmt){const t=(e+bl)/OZ;return function(r,s){const a=r.pow(s,t);if(!r.eql(r.sqr(a),s))throw new Error("Cannot find square root");return a}}if(e%Ype===Kpe){const t=(e-Kpe)/Ype;return function(r,s){const a=r.mul(s,Ov),o=r.pow(a,t),l=r.mul(s,o),c=r.mul(r.mul(l,Ov),o),u=r.mul(l,r.sub(c,r.ONE));if(!r.eql(r.sqr(u),s))throw new Error("Cannot find square root");return u}}return jmt(e)}const _mt=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function kmt(e){const t={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},n=_mt.reduce((r,s)=>(r[s]="function",r),t);return gB(e,n)}function Tmt(e,t,n){if(n<Ec)throw new Error("invalid exponent, negatives unsupported");if(n===Ec)return e.ONE;if(n===bl)return t;let r=e.ONE,s=t;for(;n>Ec;)n&bl&&(r=e.mul(r,s)),s=e.sqr(s),n>>=bl;return r}function Imt(e,t){const n=new Array(t.length),r=t.reduce((a,o,l)=>e.is0(o)?a:(n[l]=a,e.mul(a,o)),e.ONE),s=e.inv(r);return t.reduceRight((a,o,l)=>e.is0(o)?a:(n[l]=e.mul(a,n[l]),e.mul(a,o)),s),n}function REe(e,t){const n=t!==void 0?t:e.toString(2).length,r=Math.ceil(n/8);return{nBitLength:n,nByteLength:r}}function LEe(e,t,n=!1,r={}){if(e<=Ec)throw new Error("invalid field: expected ORDER > 0, got "+e);const{nBitLength:s,nByteLength:a}=REe(e,t);if(a>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let o;const l=Object.freeze({ORDER:e,isLE:n,BITS:s,BYTES:a,MASK:xB(s),ZERO:Ec,ONE:bl,create:c=>Ud(c,e),isValid:c=>{if(typeof c!="bigint")throw new Error("invalid field element: expected bigint, got "+typeof c);return Ec<=c&&c<e},is0:c=>c===Ec,isOdd:c=>(c&bl)===bl,neg:c=>Ud(-c,e),eql:(c,u)=>c===u,sqr:c=>Ud(c*c,e),add:(c,u)=>Ud(c+u,e),sub:(c,u)=>Ud(c-u,e),mul:(c,u)=>Ud(c*u,e),pow:(c,u)=>Tmt(l,c,u),div:(c,u)=>Ud(c*MZ(u,e),e),sqrN:c=>c*c,addN:(c,u)=>c+u,subN:(c,u)=>c-u,mulN:(c,u)=>c*u,inv:c=>MZ(c,e),sqrt:r.sqrt||(c=>(o||(o=Emt(e)),o(l,c))),invertBatch:c=>Imt(l,c),cmov:(c,u,d)=>d?u:c,toBytes:c=>n?MEe(c,a):rE(c,a),fromBytes:c=>{if(c.length!==a)throw new Error("Field.fromBytes: expected "+a+" bytes, got "+c.length);return n?OEe(c):Gw(c)}});return Object.freeze(l)}function DEe(e){if(typeof e!="bigint")throw new Error("field order must be bigint");const t=e.toString(2).length;return Math.ceil(t/8)}function BEe(e){const t=DEe(e);return t+Math.ceil(t/2)}function Pmt(e,t,n=!1){const r=e.length,s=DEe(t),a=BEe(t);if(r<16||r<a||r>1024)throw new Error("expected "+a+"-1024 bytes of input, got "+r);const o=n?OEe(e):Gw(e),l=Ud(o,t-bl)+bl;return n?MEe(l,s):rE(l,s)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Xpe=BigInt(0),RZ=BigInt(1);function lH(e,t){const n=t.negate();return e?n:t}function $Ee(e,t){if(!Number.isSafeInteger(e)||e<=0||e>t)throw new Error("invalid window size, expected [1.."+t+"], got W="+e)}function cH(e,t){$Ee(e,t);const n=Math.ceil(t/e)+1,r=2**(e-1),s=2**e,a=xB(e),o=BigInt(e);return{windows:n,windowSize:r,mask:a,maxNumber:s,shiftBy:o}}function Qpe(e,t,n){const{windowSize:r,mask:s,maxNumber:a,shiftBy:o}=n;let l=Number(e&s),c=e>>o;l>r&&(l-=a,c+=RZ);const u=t*r,d=u+Math.abs(l)-1,f=l===0,x=l<0,g=t%2!==0;return{nextN:c,offset:d,isZero:f,isNeg:x,isNegF:g,offsetF:u}}function Fmt(e,t){if(!Array.isArray(e))throw new Error("array expected");e.forEach((n,r)=>{if(!(n instanceof t))throw new Error("invalid point at index "+r)})}function Omt(e,t){if(!Array.isArray(e))throw new Error("array of scalars expected");e.forEach((n,r)=>{if(!t.isValid(n))throw new Error("invalid scalar at index "+r)})}const uH=new WeakMap,UEe=new WeakMap;function dH(e){return UEe.get(e)||1}function Mmt(e,t){return{constTimeNegate:lH,hasPrecomputes(n){return dH(n)!==1},unsafeLadder(n,r,s=e.ZERO){let a=n;for(;r>Xpe;)r&RZ&&(s=s.add(a)),a=a.double(),r>>=RZ;return s},precomputeWindow(n,r){const{windows:s,windowSize:a}=cH(r,t),o=[];let l=n,c=l;for(let u=0;u<s;u++){c=l,o.push(c);for(let d=1;d<a;d++)c=c.add(l),o.push(c);l=c.double()}return o},wNAF(n,r,s){let a=e.ZERO,o=e.BASE;const l=cH(n,t);for(let c=0;c<l.windows;c++){const{nextN:u,offset:d,isZero:f,isNeg:x,isNegF:g,offsetF:v}=Qpe(s,c,l);s=u,f?o=o.add(lH(g,r[v])):a=a.add(lH(x,r[d]))}return{p:a,f:o}},wNAFUnsafe(n,r,s,a=e.ZERO){const o=cH(n,t);for(let l=0;l<o.windows&&s!==Xpe;l++){const{nextN:c,offset:u,isZero:d,isNeg:f}=Qpe(s,l,o);if(s=c,!d){const x=r[u];a=a.add(f?x.negate():x)}}return a},getPrecomputes(n,r,s){let a=uH.get(r);return a||(a=this.precomputeWindow(r,n),n!==1&&uH.set(r,s(a))),a},wNAFCached(n,r,s){const a=dH(n);return this.wNAF(a,this.getPrecomputes(a,n,s),r)},wNAFCachedUnsafe(n,r,s,a){const o=dH(n);return o===1?this.unsafeLadder(n,r,a):this.wNAFUnsafe(o,this.getPrecomputes(o,n,s),r,a)},setWindowSize(n,r){$Ee(r,t),UEe.set(n,r),uH.delete(n)}}}function Rmt(e,t,n,r){if(Fmt(n,e),Omt(r,t),n.length!==r.length)throw new Error("arrays of points and scalars must have equal length");const s=e.ZERO,a=wmt(BigInt(n.length)),o=a>12?a-3:a>4?a-2:a?2:1,l=xB(o),c=new Array(Number(l)+1).fill(s),u=Math.floor((t.BITS-1)/o)*o;let d=s;for(let f=u;f>=0;f-=o){c.fill(s);for(let g=0;g<r.length;g++){const v=r[g],w=Number(v>>BigInt(f)&l);c[w]=c[w].add(n[g])}let x=s;for(let g=c.length-1,v=s;g>0;g--)v=v.add(c[g]),x=x.add(v);if(d=d.add(x),f!==0)for(let g=0;g<o;g++)d=d.double()}return d}function zEe(e){return kmt(e.Fp),gB(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...REe(e.n,e.nBitLength),...e,p:e.Fp.ORDER})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function Zpe(e){e.lowS!==void 0&&tE("lowS",e.lowS),e.prehash!==void 0&&tE("prehash",e.prehash)}function Lmt(e){const t=zEe(e);gB(t,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:n,Fp:r,a:s}=t;if(n){if(!r.eql(s,r.ZERO))throw new Error("invalid endomorphism, can only be defined for Koblitz curves that have a=0");if(typeof n!="object"||typeof n.beta!="bigint"||typeof n.splitScalar!="function")throw new Error("invalid endomorphism, expected beta: bigint and splitScalar: function")}return Object.freeze({...t})}class Dmt extends Error{constructor(t=""){super(t)}}const ug={Err:Dmt,_tlv:{encode:(e,t)=>{const{Err:n}=ug;if(e<0||e>256)throw new n("tlv.encode: wrong tag");if(t.length&1)throw new n("tlv.encode: unpadded data");const r=t.length/2,s=LI(r);if(s.length/2&128)throw new n("tlv.encode: long form length too big");const a=r>127?LI(s.length/2|128):"";return LI(e)+a+s+t},decode(e,t){const{Err:n}=ug;let r=0;if(e<0||e>256)throw new n("tlv.encode: wrong tag");if(t.length<2||t[r++]!==e)throw new n("tlv.decode: wrong tlv");const s=t[r++],a=!!(s&128);let o=0;if(!a)o=s;else{const c=s&127;if(!c)throw new n("tlv.decode(long): indefinite length not supported");if(c>4)throw new n("tlv.decode(long): byte length is too big");const u=t.subarray(r,r+c);if(u.length!==c)throw new n("tlv.decode: length bytes not complete");if(u[0]===0)throw new n("tlv.decode(long): zero leftmost byte");for(const d of u)o=o<<8|d;if(r+=c,o<128)throw new n("tlv.decode(long): not minimal encoding")}const l=t.subarray(r,r+o);if(l.length!==o)throw new n("tlv.decode: wrong value length");return{v:l,l:t.subarray(r+o)}}},_int:{encode(e){const{Err:t}=ug;if(e<_g)throw new t("integer: negative integers are not allowed");let n=LI(e);if(Number.parseInt(n[0],16)&8&&(n="00"+n),n.length&1)throw new t("unexpected DER parsing assertion: unpadded hex");return n},decode(e){const{Err:t}=ug;if(e[0]&128)throw new t("invalid signature integer: negative");if(e[0]===0&&!(e[1]&128))throw new t("invalid signature integer: unnecessary leading zero");return Gw(e)}},toSig(e){const{Err:t,_int:n,_tlv:r}=ug,s=Dp("signature",e),{v:a,l:o}=r.decode(48,s);if(o.length)throw new t("invalid signature: left bytes after parsing");const{v:l,l:c}=r.decode(2,a),{v:u,l:d}=r.decode(2,c);if(d.length)throw new t("invalid signature: left bytes after parsing");return{r:n.decode(l),s:n.decode(u)}},hexFromSig(e){const{_tlv:t,_int:n}=ug,r=t.encode(2,n.encode(e.r)),s=t.encode(2,n.encode(e.s)),a=r+s;return t.encode(48,a)}},_g=BigInt(0),Sc=BigInt(1);BigInt(2);const Jpe=BigInt(3);BigInt(4);function Bmt(e){const t=Lmt(e),{Fp:n}=t,r=LEe(t.n,t.nBitLength),s=t.toBytes||((w,C,N)=>{const P=C.toAffine();return oM(Uint8Array.from([4]),n.toBytes(P.x),n.toBytes(P.y))}),a=t.fromBytes||(w=>{const C=w.subarray(1),N=n.fromBytes(C.subarray(0,n.BYTES)),P=n.fromBytes(C.subarray(n.BYTES,2*n.BYTES));return{x:N,y:P}});function o(w){const{a:C,b:N}=t,P=n.sqr(w),I=n.mul(P,w);return n.add(n.add(I,n.mul(w,C)),N)}if(!n.eql(n.sqr(t.Gy),o(t.Gx)))throw new Error("bad generator point: equation left != right");function l(w){return Mie(w,Sc,t.n)}function c(w){const{allowedPrivateKeyLengths:C,nByteLength:N,wrapPrivateKey:P,n:I}=t;if(C&&typeof w!="bigint"){if(MS(w)&&(w=nE(w)),typeof w!="string"||!C.includes(w.length))throw new Error("invalid private key");w=w.padStart(N*2,"0")}let R;try{R=typeof w=="bigint"?w:Gw(Dp("private key",w,N))}catch{throw new Error("invalid private key, expected hex or "+N+" bytes, got "+typeof w)}return P&&(R=Ud(R,I)),JC("private key",R,Sc,I),R}function u(w){if(!(w instanceof x))throw new Error("ProjectivePoint expected")}const d=Gpe((w,C)=>{const{px:N,py:P,pz:I}=w;if(n.eql(I,n.ONE))return{x:N,y:P};const R=w.is0();C==null&&(C=R?n.ONE:n.inv(I));const F=n.mul(N,C),U=n.mul(P,C),L=n.mul(I,C);if(R)return{x:n.ZERO,y:n.ZERO};if(!n.eql(L,n.ONE))throw new Error("invZ was invalid");return{x:F,y:U}}),f=Gpe(w=>{if(w.is0()){if(t.allowInfinityPoint&&!n.is0(w.py))return;throw new Error("bad point: ZERO")}const{x:C,y:N}=w.toAffine();if(!n.isValid(C)||!n.isValid(N))throw new Error("bad point: x or y not FE");const P=n.sqr(N),I=o(C);if(!n.eql(P,I))throw new Error("bad point: equation left != right");if(!w.isTorsionFree())throw new Error("bad point: not in prime-order subgroup");return!0});class x{constructor(C,N,P){if(C==null||!n.isValid(C))throw new Error("x required");if(N==null||!n.isValid(N))throw new Error("y required");if(P==null||!n.isValid(P))throw new Error("z required");this.px=C,this.py=N,this.pz=P,Object.freeze(this)}static fromAffine(C){const{x:N,y:P}=C||{};if(!C||!n.isValid(N)||!n.isValid(P))throw new Error("invalid affine point");if(C instanceof x)throw new Error("projective point not allowed");const I=R=>n.eql(R,n.ZERO);return I(N)&&I(P)?x.ZERO:new x(N,P,n.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(C){const N=n.invertBatch(C.map(P=>P.pz));return C.map((P,I)=>P.toAffine(N[I])).map(x.fromAffine)}static fromHex(C){const N=x.fromAffine(a(Dp("pointHex",C)));return N.assertValidity(),N}static fromPrivateKey(C){return x.BASE.multiply(c(C))}static msm(C,N){return Rmt(x,r,C,N)}_setWindowSize(C){v.setWindowSize(this,C)}assertValidity(){f(this)}hasEvenY(){const{y:C}=this.toAffine();if(n.isOdd)return!n.isOdd(C);throw new Error("Field doesn't support isOdd")}equals(C){u(C);const{px:N,py:P,pz:I}=this,{px:R,py:F,pz:U}=C,L=n.eql(n.mul(N,U),n.mul(R,I)),z=n.eql(n.mul(P,U),n.mul(F,I));return L&&z}negate(){return new x(this.px,n.neg(this.py),this.pz)}double(){const{a:C,b:N}=t,P=n.mul(N,Jpe),{px:I,py:R,pz:F}=this;let U=n.ZERO,L=n.ZERO,z=n.ZERO,Q=n.mul(I,I),ne=n.mul(R,R),J=n.mul(F,F),X=n.mul(I,R);return X=n.add(X,X),z=n.mul(I,F),z=n.add(z,z),U=n.mul(C,z),L=n.mul(P,J),L=n.add(U,L),U=n.sub(ne,L),L=n.add(ne,L),L=n.mul(U,L),U=n.mul(X,U),z=n.mul(P,z),J=n.mul(C,J),X=n.sub(Q,J),X=n.mul(C,X),X=n.add(X,z),z=n.add(Q,Q),Q=n.add(z,Q),Q=n.add(Q,J),Q=n.mul(Q,X),L=n.add(L,Q),J=n.mul(R,F),J=n.add(J,J),Q=n.mul(J,X),U=n.sub(U,Q),z=n.mul(J,ne),z=n.add(z,z),z=n.add(z,z),new x(U,L,z)}add(C){u(C);const{px:N,py:P,pz:I}=this,{px:R,py:F,pz:U}=C;let L=n.ZERO,z=n.ZERO,Q=n.ZERO;const ne=t.a,J=n.mul(t.b,Jpe);let X=n.mul(N,R),re=n.mul(P,F),pe=n.mul(I,U),Y=n.add(N,P),ie=n.add(R,F);Y=n.mul(Y,ie),ie=n.add(X,re),Y=n.sub(Y,ie),ie=n.add(N,I);let oe=n.add(R,U);return ie=n.mul(ie,oe),oe=n.add(X,pe),ie=n.sub(ie,oe),oe=n.add(P,I),L=n.add(F,U),oe=n.mul(oe,L),L=n.add(re,pe),oe=n.sub(oe,L),Q=n.mul(ne,ie),L=n.mul(J,pe),Q=n.add(L,Q),L=n.sub(re,Q),Q=n.add(re,Q),z=n.mul(L,Q),re=n.add(X,X),re=n.add(re,X),pe=n.mul(ne,pe),ie=n.mul(J,ie),re=n.add(re,pe),pe=n.sub(X,pe),pe=n.mul(ne,pe),ie=n.add(ie,pe),X=n.mul(re,ie),z=n.add(z,X),X=n.mul(oe,ie),L=n.mul(Y,L),L=n.sub(L,X),X=n.mul(Y,re),Q=n.mul(oe,Q),Q=n.add(Q,X),new x(L,z,Q)}subtract(C){return this.add(C.negate())}is0(){return this.equals(x.ZERO)}wNAF(C){return v.wNAFCached(this,C,x.normalizeZ)}multiplyUnsafe(C){const{endo:N,n:P}=t;JC("scalar",C,_g,P);const I=x.ZERO;if(C===_g)return I;if(this.is0()||C===Sc)return this;if(!N||v.hasPrecomputes(this))return v.wNAFCachedUnsafe(this,C,x.normalizeZ);let{k1neg:R,k1:F,k2neg:U,k2:L}=N.splitScalar(C),z=I,Q=I,ne=this;for(;F>_g||L>_g;)F&Sc&&(z=z.add(ne)),L&Sc&&(Q=Q.add(ne)),ne=ne.double(),F>>=Sc,L>>=Sc;return R&&(z=z.negate()),U&&(Q=Q.negate()),Q=new x(n.mul(Q.px,N.beta),Q.py,Q.pz),z.add(Q)}multiply(C){const{endo:N,n:P}=t;JC("scalar",C,Sc,P);let I,R;if(N){const{k1neg:F,k1:U,k2neg:L,k2:z}=N.splitScalar(C);let{p:Q,f:ne}=this.wNAF(U),{p:J,f:X}=this.wNAF(z);Q=v.constTimeNegate(F,Q),J=v.constTimeNegate(L,J),J=new x(n.mul(J.px,N.beta),J.py,J.pz),I=Q.add(J),R=ne.add(X)}else{const{p:F,f:U}=this.wNAF(C);I=F,R=U}return x.normalizeZ([I,R])[0]}multiplyAndAddUnsafe(C,N,P){const I=x.BASE,R=(U,L)=>L===_g||L===Sc||!U.equals(I)?U.multiplyUnsafe(L):U.multiply(L),F=R(this,N).add(R(C,P));return F.is0()?void 0:F}toAffine(C){return d(this,C)}isTorsionFree(){const{h:C,isTorsionFree:N}=t;if(C===Sc)return!0;if(N)return N(x,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:C,clearCofactor:N}=t;return C===Sc?this:N?N(x,this):this.multiplyUnsafe(t.h)}toRawBytes(C=!0){return tE("isCompressed",C),this.assertValidity(),s(x,this,C)}toHex(C=!0){return tE("isCompressed",C),nE(this.toRawBytes(C))}}x.BASE=new x(t.Gx,t.Gy,n.ONE),x.ZERO=new x(n.ZERO,n.ONE,n.ZERO);const g=t.nBitLength,v=Mmt(x,t.endo?Math.ceil(g/2):g);return{CURVE:t,ProjectivePoint:x,normPrivateKeyToScalar:c,weierstrassEquation:o,isWithinCurveOrder:l}}function $mt(e){const t=zEe(e);return gB(t,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...t})}function Umt(e){const t=$mt(e),{Fp:n,n:r}=t,s=n.BYTES+1,a=2*n.BYTES+1;function o(pe){return Ud(pe,r)}function l(pe){return MZ(pe,r)}const{ProjectivePoint:c,normPrivateKeyToScalar:u,weierstrassEquation:d,isWithinCurveOrder:f}=Bmt({...t,toBytes(pe,Y,ie){const oe=Y.toAffine(),G=n.toBytes(oe.x),V=oM;return tE("isCompressed",ie),ie?V(Uint8Array.from([Y.hasEvenY()?2:3]),G):V(Uint8Array.from([4]),G,n.toBytes(oe.y))},fromBytes(pe){const Y=pe.length,ie=pe[0],oe=pe.subarray(1);if(Y===s&&(ie===2||ie===3)){const G=Gw(oe);if(!Mie(G,Sc,n.ORDER))throw new Error("Point is not on curve");const V=d(G);let ee;try{ee=n.sqrt(V)}catch(Ne){const he=Ne instanceof Error?": "+Ne.message:"";throw new Error("Point is not on curve"+he)}const ae=(ee&Sc)===Sc;return(ie&1)===1!==ae&&(ee=n.neg(ee)),{x:G,y:ee}}else if(Y===a&&ie===4){const G=n.fromBytes(oe.subarray(0,n.BYTES)),V=n.fromBytes(oe.subarray(n.BYTES,2*n.BYTES));return{x:G,y:V}}else{const G=s,V=a;throw new Error("invalid Point, expected length of "+G+", or uncompressed "+V+", got "+Y)}}}),x=pe=>nE(rE(pe,t.nByteLength));function g(pe){const Y=r>>Sc;return pe>Y}function v(pe){return g(pe)?o(-pe):pe}const w=(pe,Y,ie)=>Gw(pe.slice(Y,ie));class C{constructor(Y,ie,oe){JC("r",Y,Sc,r),JC("s",ie,Sc,r),this.r=Y,this.s=ie,oe!=null&&(this.recovery=oe),Object.freeze(this)}static fromCompact(Y){const ie=t.nByteLength;return Y=Dp("compactSignature",Y,ie*2),new C(w(Y,0,ie),w(Y,ie,2*ie))}static fromDER(Y){const{r:ie,s:oe}=ug.toSig(Dp("DER",Y));return new C(ie,oe)}assertValidity(){}addRecoveryBit(Y){return new C(this.r,this.s,Y)}recoverPublicKey(Y){const{r:ie,s:oe,recovery:G}=this,V=U(Dp("msgHash",Y));if(G==null||![0,1,2,3].includes(G))throw new Error("recovery id invalid");const ee=G===2||G===3?ie+t.n:ie;if(ee>=n.ORDER)throw new Error("recovery id 2 or 3 invalid");const ae=G&1?"03":"02",fe=c.fromHex(ae+x(ee)),Ne=l(ee),he=o(-V*Ne),ge=o(oe*Ne),ye=c.BASE.multiplyAndAddUnsafe(fe,he,ge);if(!ye)throw new Error("point at infinify");return ye.assertValidity(),ye}hasHighS(){return g(this.s)}normalizeS(){return this.hasHighS()?new C(this.r,o(-this.s),this.recovery):this}toDERRawBytes(){return aM(this.toDERHex())}toDERHex(){return ug.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return aM(this.toCompactHex())}toCompactHex(){return x(this.r)+x(this.s)}}const N={isValidPrivateKey(pe){try{return u(pe),!0}catch{return!1}},normPrivateKeyToScalar:u,randomPrivateKey:()=>{const pe=BEe(t.n);return Pmt(t.randomBytes(pe),t.n)},precompute(pe=8,Y=c.BASE){return Y._setWindowSize(pe),Y.multiply(BigInt(3)),Y}};function P(pe,Y=!0){return c.fromPrivateKey(pe).toRawBytes(Y)}function I(pe){const Y=MS(pe),ie=typeof pe=="string",oe=(Y||ie)&&pe.length;return Y?oe===s||oe===a:ie?oe===2*s||oe===2*a:pe instanceof c}function R(pe,Y,ie=!0){if(I(pe))throw new Error("first arg must be private key");if(!I(Y))throw new Error("second arg must be public key");return c.fromHex(Y).multiply(u(pe)).toRawBytes(ie)}const F=t.bits2int||function(pe){if(pe.length>8192)throw new Error("input is too large");const Y=Gw(pe),ie=pe.length*8-t.nBitLength;return ie>0?Y>>BigInt(ie):Y},U=t.bits2int_modN||function(pe){return o(F(pe))},L=xB(t.nBitLength);function z(pe){return JC("num < 2^"+t.nBitLength,pe,_g,L),rE(pe,t.nByteLength)}function Q(pe,Y,ie=ne){if(["recovered","canonical"].some(je=>je in ie))throw new Error("sign() legacy options not supported");const{hash:oe,randomBytes:G}=t;let{lowS:V,prehash:ee,extraEntropy:ae}=ie;V==null&&(V=!0),pe=Dp("msgHash",pe),Zpe(ie),ee&&(pe=Dp("prehashed msgHash",oe(pe)));const fe=U(pe),Ne=u(Y),he=[z(Ne),z(fe)];if(ae!=null&&ae!==!1){const je=ae===!0?G(n.BYTES):ae;he.push(Dp("extraEntropy",je))}const ge=oM(...he),ye=fe;function ve(je){const Ie=F(je);if(!f(Ie))return;const Le=l(Ie),Qe=c.BASE.multiply(Ie).toAffine(),$e=o(Qe.x);if($e===_g)return;const it=o(Le*o(ye+$e*Ne));if(it===_g)return;let tt=(Qe.x===$e?0:2)|Number(Qe.y&Sc),lt=it;return V&&g(it)&&(lt=v(it),tt^=1),new C($e,lt,tt)}return{seed:ge,k2sig:ve}}const ne={lowS:t.lowS,prehash:!1},J={lowS:t.lowS,prehash:!1};function X(pe,Y,ie=ne){const{seed:oe,k2sig:G}=Q(pe,Y,ie),V=t;return Cmt(V.hash.outputLen,V.nByteLength,V.hmac)(oe,G)}c.BASE._setWindowSize(8);function re(pe,Y,ie,oe=J){var tt;const G=pe;Y=Dp("msgHash",Y),ie=Dp("publicKey",ie);const{lowS:V,prehash:ee,format:ae}=oe;if(Zpe(oe),"strict"in oe)throw new Error("options.strict was renamed to lowS");if(ae!==void 0&&ae!=="compact"&&ae!=="der")throw new Error("format must be compact or der");const fe=typeof G=="string"||MS(G),Ne=!fe&&!ae&&typeof G=="object"&&G!==null&&typeof G.r=="bigint"&&typeof G.s=="bigint";if(!fe&&!Ne)throw new Error("invalid signature, expected Uint8Array, hex string or Signature instance");let he,ge;try{if(Ne&&(he=new C(G.r,G.s)),fe){try{ae!=="compact"&&(he=C.fromDER(G))}catch(lt){if(!(lt instanceof ug.Err))throw lt}!he&&ae!=="der"&&(he=C.fromCompact(G))}ge=c.fromHex(ie)}catch{return!1}if(!he||V&&he.hasHighS())return!1;ee&&(Y=t.hash(Y));const{r:ye,s:ve}=he,je=U(Y),Ie=l(ve),Le=o(je*Ie),Qe=o(ye*Ie),$e=(tt=c.BASE.multiplyAndAddUnsafe(ge,Le,Qe))==null?void 0:tt.toAffine();return $e?o($e.x)===ye:!1}return{CURVE:t,getPublicKey:P,getSharedSecret:R,sign:X,verify:re,ProjectivePoint:c,Signature:C,utils:N}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function zmt(e){return{hash:e,hmac:(t,...n)=>IEe(e,t,Dct(...n)),randomBytes:Bct}}function Hmt(e,t){const n=r=>Umt({...e,...zmt(r)});return{...n(t),create:n}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const HEe=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),eme=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),Vmt=BigInt(1),LZ=BigInt(2),tme=(e,t)=>(e+t/LZ)/t;function Wmt(e){const t=HEe,n=BigInt(3),r=BigInt(6),s=BigInt(11),a=BigInt(22),o=BigInt(23),l=BigInt(44),c=BigInt(88),u=e*e*e%t,d=u*u*e%t,f=mh(d,n,t)*d%t,x=mh(f,n,t)*d%t,g=mh(x,LZ,t)*u%t,v=mh(g,s,t)*g%t,w=mh(v,a,t)*v%t,C=mh(w,l,t)*w%t,N=mh(C,c,t)*C%t,P=mh(N,l,t)*w%t,I=mh(P,n,t)*d%t,R=mh(I,o,t)*v%t,F=mh(R,r,t)*u%t,U=mh(F,LZ,t);if(!DZ.eql(DZ.sqr(U),e))throw new Error("Cannot find square root");return U}const DZ=LEe(HEe,void 0,void 0,{sqrt:Wmt}),Rie=Hmt({a:BigInt(0),b:BigInt(7),Fp:DZ,n:eme,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:e=>{const t=eme,n=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),r=-Vmt*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),s=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),a=n,o=BigInt("0x100000000000000000000000000000000"),l=tme(a*e,t),c=tme(-r*e,t);let u=Ud(e-l*n-c*s,t),d=Ud(-l*r-c*a,t);const f=u>o,x=d>o;if(f&&(u=t-u),x&&(d=t-d),u>o||d>o)throw new Error("splitScalar: Endomorphism failed, k="+e);return{k1neg:f,k1:u,k2neg:x,k2:d}}}},s9e);BigInt(0);Rie.ProjectivePoint;const qmt=Object.freeze(Object.defineProperty({__proto__:null,secp256k1:Rie},Symbol.toStringTag,{value:"Module"}));function Gmt({r:e,s:t,to:n="hex",v:r,yParity:s}){const a=(()=>{if(s===0||s===1)return s;if(r&&(r===27n||r===28n||r>=35n))return r%2n===0n?1:0;throw new Error("Invalid `v` or `yParity` value")})(),o=`0x${new Rie.Signature(nd(e),nd(t)).toCompactHex()}${a===0?"1b":"1c"}`;return n==="hex"?o:sp(o)}async function Lie(e,t){var f,x,g;const{address:n,factory:r,factoryData:s,hash:a,signature:o,universalSignatureVerifierAddress:l=(g=(x=(f=e.chain)==null?void 0:f.contracts)==null?void 0:x.universalSignatureVerifier)==null?void 0:g.address,...c}=t,u=Y0(o)?o:typeof o=="object"&&"r"in o&&"s"in o?Gmt(o):Wl(o),d=await(async()=>!r&&!s||rmt(u)?u:smt({address:r,data:s,signature:u}))();try{const v=l?{to:l,data:Nm({abi:vpe,functionName:"isValidSig",args:[n,a,d]}),...c}:{data:Jse({abi:vpe,args:[n,a,d],bytecode:vft}),...c},{data:w}=await si(e,cB,"call")(v);return cct(w??"0x0")}catch(v){try{if(vie(jc(n),await qje({hash:a,signature:o})))return!0}catch{}if(v instanceof O9e)return!1;throw v}}async function Kmt(e,{address:t,message:n,factory:r,factoryData:s,signature:a,...o}){const l=EEe(n);return Lie(e,{address:t,factory:r,factoryData:s,hash:l,signature:a,...o})}async function Ymt(e,t){const{address:n,factory:r,factoryData:s,signature:a,message:o,primaryType:l,types:c,domain:u,...d}=t,f=Dpt({message:o,primaryType:l,types:c,domain:u});return Lie(e,{address:n,factory:r,factoryData:s,hash:f,signature:a,...d})}function Xmt(e,t){const{abi:n,address:r,args:s,batch:a=!0,eventName:o,fromBlock:l,onError:c,onLogs:u,poll:d,pollingInterval:f=e.pollingInterval,strict:x}=t;return(typeof d<"u"?d:typeof l=="bigint"?!0:!(e.transport.type==="webSocket"||e.transport.type==="fallback"&&e.transport.transports[0].config.type==="webSocket"))?(()=>{const C=x??!1,N=Ic(["watchContractEvent",r,s,a,e.uid,o,f,C,l]);return $y(N,{onLogs:u,onError:c},P=>{let I;l!==void 0&&(I=l-1n);let R,F=!1;const U=Rk(async()=>{var L;if(!F){try{R=await si(e,K9e,"createContractEventFilter")({abi:n,address:r,args:s,eventName:o,strict:C,fromBlock:l})}catch{}F=!0;return}try{let z;if(R)z=await si(e,dB,"getFilterChanges")({filter:R});else{const Q=await si(e,Ok,"getBlockNumber")({});I&&I<Q?z=await si(e,Q9e,"getContractEvents")({abi:n,address:r,args:s,eventName:o,fromBlock:I+1n,toBlock:Q,strict:C}):z=[],I=Q}if(z.length===0)return;if(a)P.onLogs(z);else for(const Q of z)P.onLogs([Q])}catch(z){R&&z instanceof b3&&(F=!1),(L=P.onError)==null||L.call(P,z)}},{emitOnBegin:!0,interval:f});return async()=>{R&&await si(e,mB,"uninstallFilter")({filter:R}),U()}})})():(()=>{const C=x??!1,N=Ic(["watchContractEvent",r,s,a,e.uid,o,f,C]);let P=!0,I=()=>P=!1;return $y(N,{onLogs:u,onError:c},R=>((async()=>{try{const F=(()=>{if(e.transport.type==="fallback"){const z=e.transport.transports.find(Q=>Q.config.type==="webSocket");return z?z.value:e.transport}return e.transport})(),U=o?Fk({abi:n,eventName:o,args:s}):[],{unsubscribe:L}=await F.subscribe({params:["logs",{address:r,topics:U}],onData(z){var ne;if(!P)return;const Q=z.result;try{const{eventName:J,args:X}=wie({abi:n,data:Q.data,topics:Q.topics,strict:x}),re=i1(Q,{args:X,eventName:J});R.onLogs([re])}catch(J){let X,re;if(J instanceof O9||J instanceof XD){if(x)return;X=J.abiItem.name,re=(ne=J.abiItem.inputs)==null?void 0:ne.some(Y=>!("name"in Y&&Y.name))}const pe=i1(Q,{args:re?[]:{},eventName:X});R.onLogs([pe])}},onError(z){var Q;(Q=R.onError)==null||Q.call(R,z)}});I=L,P||I()}catch(F){c==null||c(F)}})(),()=>I()))})()}async function Qmt(e,t){const{abi:n,account:r=e.account,address:s,args:a,dataSuffix:o,functionName:l,...c}=t;if(typeof r>"u")throw new eB({docsPath:"/docs/contract/writeContract"});const u=r?Du(r):null,d=Nm({abi:n,args:a,functionName:l});try{return await si(e,idt,"sendTransaction")({data:`${d}${o?o.replace("0x",""):""}`,to:s,account:u,...c})}catch(f){throw v3(f,{abi:n,address:s,args:a,docsPath:"/docs/contract/writeContract",functionName:l,sender:u==null?void 0:u.address})}}function i2(e,t,n){const r=e[t.name];if(typeof r=="function")return r;const s=e[n];return typeof s=="function"?s:a=>t(e,a)}const LF="2.16.7",Zmt=()=>`@wagmi/core@${LF}`;var VEe=function(e,t,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(e):r?r.value:t.get(e)},lM,WEe;let S1=class BZ extends Error{get docsBaseUrl(){return"https://wagmi.sh/core"}get version(){return Zmt()}constructor(t,n={}){var a;super(),lM.add(this),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"WagmiCoreError"});const r=n.cause instanceof BZ?n.cause.details:(a=n.cause)!=null&&a.message?n.cause.message:n.details,s=n.cause instanceof BZ&&n.cause.docsPath||n.docsPath;this.message=[t||"An error occurred.","",...n.metaMessages?[...n.metaMessages,""]:[],...s?[`Docs: ${this.docsBaseUrl}${s}.html${n.docsSlug?`#${n.docsSlug}`:""}`]:[],...r?[`Details: ${r}`]:[],`Version: ${this.version}`].join(`
`),n.cause&&(this.cause=n.cause),this.details=r,this.docsPath=s,this.metaMessages=n.metaMessages,this.shortMessage=t}walk(t){return VEe(this,lM,"m",WEe).call(this,this,t)}};lM=new WeakSet,WEe=function e(t,n){return n!=null&&n(t)?t:t.cause?VEe(this,lM,"m",e).call(this,t.cause,n):t};class S3 extends S1{constructor(){super("Chain not configured."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ChainNotConfiguredError"})}}class Jmt extends S1{constructor(){super("Connector already connected."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorAlreadyConnectedError"})}}class e0t extends S1{constructor(){super("Connector not connected."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorNotConnectedError"})}}class t0t extends S1{constructor({address:t,connector:n}){super(`Account "${t}" not found for connector "${n.name}".`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorAccountNotFoundError"})}}class n0t extends S1{constructor({connectionChainId:t,connectorChainId:n}){super(`The current chain of the connector (id: ${n}) does not match the connection's chain (id: ${t}).`,{metaMessages:[`Current Chain ID: ${n}`,`Expected Chain ID: ${t}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorChainMismatchError"})}}class r0t extends S1{constructor({connector:t}){super(`Connector "${t.name}" unavailable while reconnecting.`,{details:["During the reconnection step, the only connector methods guaranteed to be available are: `id`, `name`, `type`, `uid`.","All other methods are not guaranteed to be available until reconnection completes and connectors are fully restored.","This error commonly occurs for connectors that asynchronously inject after reconnection has already started."].join(" ")}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorUnavailableReconnectingError"})}}async function s0t(e,t){var r;let n;if(typeof t.connector=="function"?n=e._internal.connectors.setup(t.connector):n=t.connector,n.uid===e.state.current)throw new Jmt;try{e.setState(c=>({...c,status:"connecting"})),n.emitter.emit("message",{type:"connecting"});const{connector:s,...a}=t,o=await n.connect(a),l=o.accounts;return n.emitter.off("connect",e._internal.events.connect),n.emitter.on("change",e._internal.events.change),n.emitter.on("disconnect",e._internal.events.disconnect),await((r=e.storage)==null?void 0:r.setItem("recentConnectorId",n.id)),e.setState(c=>({...c,connections:new Map(c.connections).set(n.uid,{accounts:l,chainId:o.chainId,connector:n}),current:n.uid,status:"connected"})),{accounts:l,chainId:o.chainId}}catch(s){throw e.setState(a=>({...a,status:a.current?"connected":"disconnected"})),s}}const $Z=256;let DI=$Z,BI;function qEe(e=11){if(!BI||DI+e>$Z*2){BI="",DI=0;for(let t=0;t<$Z;t++)BI+=(256+Math.random()*256|0).toString(16).substring(1)}return BI.substring(DI,DI+++e)}function GEe(e){const{batch:t,cacheTime:n=e.pollingInterval??4e3,ccipRead:r,key:s="base",name:a="Base Client",pollingInterval:o=4e3,type:l="base"}=e,c=e.chain,u=e.account?Du(e.account):void 0,{config:d,request:f,value:x}=e.transport({chain:c,pollingInterval:o}),g={...d,...x},v={account:u,batch:t,cacheTime:n,ccipRead:r,chain:c,key:s,name:a,pollingInterval:o,request:f,transport:g,type:l,uid:qEe()};function w(C){return N=>{const P=N(C);for(const R in v)delete P[R];const I={...C,...P};return Object.assign(I,{extend:w(I)})}}return Object.assign(v,{extend:w(v)})}function KEe({key:e,methods:t,name:n,request:r,retryCount:s=3,retryDelay:a=150,timeout:o,type:l},c){const u=qEe();return{config:{key:e,methods:t,name:n,request:r,retryCount:s,retryDelay:a,timeout:o,type:l},request:Ipt(r,{methods:t,retryCount:s,retryDelay:a,uid:u}),value:c}}function i0t(e,t={}){const{key:n="custom",methods:r,name:s="Custom Provider",retryDelay:a}=t;return({retryCount:o})=>KEe({key:n,methods:r,name:s,request:e.request.bind(e),retryCount:t.retryCount??o,retryDelay:a,type:"custom"})}class a0t extends Dr{constructor(){super("No URL was provided to the Transport. Please provide a valid RPC URL to the Transport.",{docsPath:"/docs/clients/intro",name:"UrlRequiredError"})}}function uj(e,t={}){const{batch:n,fetchOptions:r,key:s="http",methods:a,name:o="HTTP JSON-RPC",onFetchRequest:l,onFetchResponse:c,retryDelay:u,raw:d}=t;return({chain:f,retryCount:x,timeout:g})=>{const{batchSize:v=1e3,wait:w=0}=typeof n=="object"?n:{},C=t.retryCount??x,N=g??t.timeout??1e4,P=f==null?void 0:f.rpcUrls.default.http[0];if(!P)throw new a0t;const I=Opt(P,{fetchOptions:r,onRequest:l,onResponse:c,timeout:N});return KEe({key:s,methods:a,name:o,async request({method:R,params:F}){const U={method:R,params:F},{schedule:L}=U9e({id:P,wait:w,shouldSplitBatch(J){return J.length>v},fn:J=>I.request({body:J}),sort:(J,X)=>J.id-X.id}),z=async J=>n?L(J):[await I.request({body:J})],[{error:Q,result:ne}]=await z(U);if(d)return{error:Q,result:ne};if(Q)throw new rie({body:U,error:Q,url:P});return ne},retryCount:C,retryDelay:u,timeout:N,type:"http"},{fetchOptions:r,url:P})}}function o0t(e){var f,x,g;const{scheme:t,statement:n,...r}=((f=e.match(l0t))==null?void 0:f.groups)??{},{chainId:s,expirationTime:a,issuedAt:o,notBefore:l,requestId:c,...u}=((x=e.match(c0t))==null?void 0:x.groups)??{},d=(g=e.split("Resources:")[1])==null?void 0:g.split(`
- `).slice(1);return{...r,...u,...s?{chainId:Number(s)}:{},...a?{expirationTime:new Date(a)}:{},...o?{issuedAt:new Date(o)}:{},...l?{notBefore:new Date(l)}:{},...c?{requestId:c}:{},...d?{resources:d}:{},...t?{scheme:t}:{},...n?{statement:n}:{}}}const l0t=/^(?:(?<scheme>[a-zA-Z][a-zA-Z0-9+-.]*):\/\/)?(?<domain>[a-zA-Z0-9+-.]*(?::[0-9]{1,5})?) (?:wants you to sign in with your Ethereum account:\n)(?<address>0x[a-fA-F0-9]{40})\n\n(?:(?<statement>.*)\n\n)?/,c0t=/(?:URI: (?<uri>.+))\n(?:Version: (?<version>.+))\n(?:Chain ID: (?<chainId>\d+))\n(?:Nonce: (?<nonce>[a-zA-Z0-9]+))\n(?:Issued At: (?<issuedAt>.+))(?:\nExpiration Time: (?<expirationTime>.+))?(?:\nNot Before: (?<notBefore>.+))?(?:\nRequest ID: (?<requestId>.+))?/;function u0t(e){const{address:t,domain:n,message:r,nonce:s,scheme:a,time:o=new Date}=e;if(n&&r.domain!==n||s&&r.nonce!==s||a&&r.scheme!==a||r.expirationTime&&o>=r.expirationTime||r.notBefore&&o<r.notBefore)return!1;try{if(!r.address||t&&!vie(r.address,t))return!1}catch{return!1}return!0}async function d0t(e,t){const{address:n,domain:r,message:s,nonce:a,scheme:o,signature:l,time:c=new Date,...u}=t,d=o0t(s);if(!d.address||!u0t({address:n,domain:r,message:d,nonce:a,scheme:o,time:c}))return!1;const x=EEe(s);return Lie(e,{address:d.address,hash:x,signature:l,...u})}function f0t(e){return{call:t=>cB(e,t),createAccessList:t=>G9e(e,t),createBlockFilter:()=>$ft(e),createContractEventFilter:t=>K9e(e,t),createEventFilter:t=>Y9e(e,t),createPendingTransactionFilter:()=>X9e(e),estimateContractGas:t=>zft(e,t),estimateGas:t=>die(e,t),getBalance:t=>uie(e,t),getBlobBaseFee:()=>Hft(e),getBlock:t=>j0(e,t),getBlockNumber:t=>Ok(e,t),getBlockTransactionCount:t=>Yft(e,t),getBytecode:t=>kpe(e,t),getChainId:()=>iie(e),getCode:t=>kpe(e,t),getContractEvents:t=>Q9e(e,t),getEip712Domain:t=>Jft(e,t),getEnsAddress:t=>jft(e,t),getEnsAvatar:t=>W9e(e,t),getEnsName:t=>q9e(e,t),getEnsResolver:t=>Bft(e,t),getEnsText:t=>V9e(e,t),getFeeHistory:t=>nht(e,t),estimateFeesPerGas:t=>$ut(e,t),getFilterChanges:t=>dB(e,t),getFilterLogs:t=>rht(e,t),getGasPrice:()=>lie(e),getLogs:t=>Sie(e,t),getProof:t=>mmt(e,t),estimateMaxPriorityFeePerGas:t=>But(e,t),getStorageAt:t=>sht(e,t),getTransaction:t=>Nie(e,t),getTransactionConfirmations:t=>iht(e,t),getTransactionCount:t=>r9e(e,t),getTransactionReceipt:t=>AZ(e,t),multicall:t=>J9e(e,t),prepareTransactionRequest:t=>mie(e,t),readContract:t=>Q0(e,t),sendRawTransaction:t=>h9e(e,t),simulate:t=>EZ(e,t),simulateBlocks:t=>EZ(e,t),simulateCalls:t=>lmt(e,t),simulateContract:t=>ymt(e,t),verifyMessage:t=>Kmt(e,t),verifySiweMessage:t=>d0t(e,t),verifyTypedData:t=>Ymt(e,t),uninstallFilter:t=>mB(e,t),waitForTransactionReceipt:t=>xmt(e,t),watchBlocks:t=>umt(e,t),watchBlockNumber:t=>kEe(e,t),watchContractEvent:t=>Xmt(e,t),watchEvent:t=>dmt(e,t),watchPendingTransactions:t=>fmt(e,t)}}async function Die(e,t={}){let n;if(t.connector){const{connector:u}=t;if(e.state.status==="reconnecting"&&!u.getAccounts&&!u.getChainId)throw new r0t({connector:u});const[d,f]=await Promise.all([u.getAccounts().catch(x=>{if(t.account===null)return[];throw x}),u.getChainId()]);n={accounts:d,chainId:f,connector:u}}else n=e.state.connections.get(e.state.current);if(!n)throw new e0t;const r=t.chainId??n.chainId,s=await n.connector.getChainId();if(s!==n.chainId)throw new n0t({connectionChainId:n.chainId,connectorChainId:s});const a=n.connector;if(a.getClient)return a.getClient({chainId:r});const o=Du(t.account??n.accounts[0]);if(o&&(o.address=jc(o.address)),t.account&&!n.accounts.some(u=>u.toLowerCase()===o.address.toLowerCase()))throw new t0t({address:o.address,connector:a});const l=e.chains.find(u=>u.id===r),c=await n.connector.getProvider({chainId:r});return GEe({account:o,chain:l,name:"Connector Client",transport:u=>i0t(c)({...u,retryCount:0})})}async function h0t(e,t={}){var s,a;let n;if(t.connector)n=t.connector;else{const{connections:o,current:l}=e.state,c=o.get(l);n=c==null?void 0:c.connector}const r=e.state.connections;n&&(await n.disconnect(),n.emitter.off("change",e._internal.events.change),n.emitter.off("disconnect",e._internal.events.disconnect),n.emitter.on("connect",e._internal.events.connect),r.delete(n.uid)),e.setState(o=>{if(r.size===0)return{...o,connections:new Map,current:null,status:"disconnected"};const l=r.values().next().value;return{...o,connections:new Map(r),current:l.connector.uid}});{const o=e.state.current;if(!o)return;const l=(s=e.state.connections.get(o))==null?void 0:s.connector;if(!l)return;await((a=e.storage)==null?void 0:a.setItem("recentConnectorId",l.id))}}function YEe(e){return typeof e=="number"?e:e==="wei"?0:Math.abs(wut[e])}function XEe(e){const t=e.state.current,n=e.state.connections.get(t),r=n==null?void 0:n.accounts,s=r==null?void 0:r[0],a=e.chains.find(l=>l.id===(n==null?void 0:n.chainId)),o=e.state.status;switch(o){case"connected":return{address:s,addresses:r,chain:a,chainId:n==null?void 0:n.chainId,connector:n==null?void 0:n.connector,isConnected:!0,isConnecting:!1,isDisconnected:!1,isReconnecting:!1,status:o};case"reconnecting":return{address:s,addresses:r,chain:a,chainId:n==null?void 0:n.chainId,connector:n==null?void 0:n.connector,isConnected:!!s,isConnecting:!1,isDisconnected:!1,isReconnecting:!0,status:o};case"connecting":return{address:s,addresses:r,chain:a,chainId:n==null?void 0:n.chainId,connector:n==null?void 0:n.connector,isConnected:!1,isConnecting:!0,isDisconnected:!1,isReconnecting:!1,status:o};case"disconnected":return{address:void 0,addresses:void 0,chain:void 0,chainId:void 0,connector:void 0,isConnected:!1,isConnecting:!1,isDisconnected:!0,isReconnecting:!1,status:o}}}async function p0t(e,t){const{allowFailure:n=!0,chainId:r,contracts:s,...a}=t,o=e.getClient({chainId:r});return i2(o,J9e,"multicall")({allowFailure:n,contracts:s,...a})}function QEe(e,t){const{chainId:n,...r}=t,s=e.getClient({chainId:n});return i2(s,Q0,"readContract")(r)}async function m0t(e,t){var l;const{allowFailure:n=!0,blockNumber:r,blockTag:s,...a}=t,o=t.contracts;try{const c={};for(const[x,g]of o.entries()){const v=g.chainId??e.state.chainId;c[v]||(c[v]=[]),(l=c[v])==null||l.push({contract:g,index:x})}const u=()=>Object.entries(c).map(([x,g])=>p0t(e,{...a,allowFailure:n,blockNumber:r,blockTag:s,chainId:Number.parseInt(x),contracts:g.map(({contract:v})=>v)})),d=(await Promise.all(u())).flat(),f=Object.values(c).flatMap(x=>x.map(({index:g})=>g));return d.reduce((x,g,v)=>(x&&(x[f[v]]=g),x),[])}catch(c){if(c instanceof M9e)throw c;const u=()=>o.map(d=>QEe(e,{...d,blockNumber:r,blockTag:s}));return n?(await Promise.allSettled(u())).map(d=>d.status==="fulfilled"?{result:d.value,status:"success"}:{error:d.reason,result:void 0,status:"failure"}):await Promise.all(u())}}async function x0t(e,t){const{address:n,blockNumber:r,blockTag:s,chainId:a,token:o,unit:l="ether"}=t;if(o)try{return await nme(e,{balanceAddress:n,chainId:a,symbolType:"string",tokenAddress:o})}catch(x){if(x.name==="ContractFunctionExecutionError"){const g=await nme(e,{balanceAddress:n,chainId:a,symbolType:"bytes32",tokenAddress:o}),v=uct(Hf(g.symbol,{dir:"right"}));return{...g,symbol:v}}throw x}const c=e.getClient({chainId:a}),d=await i2(c,uie,"getBalance")(r?{address:n,blockNumber:r}:{address:n,blockTag:s}),f=e.chains.find(x=>x.id===a)??c.chain;return{decimals:f.nativeCurrency.decimals,formatted:Ek(d,YEe(l)),symbol:f.nativeCurrency.symbol,value:d}}async function nme(e,t){const{balanceAddress:n,chainId:r,symbolType:s,tokenAddress:a,unit:o}=t,l={abi:[{type:"function",name:"balanceOf",stateMutability:"view",inputs:[{type:"address"}],outputs:[{type:"uint256"}]},{type:"function",name:"decimals",stateMutability:"view",inputs:[],outputs:[{type:"uint8"}]},{type:"function",name:"symbol",stateMutability:"view",inputs:[],outputs:[{type:s}]}],address:a},[c,u,d]=await m0t(e,{allowFailure:!1,contracts:[{...l,functionName:"balanceOf",args:[n],chainId:r},{...l,functionName:"decimals",chainId:r},{...l,functionName:"symbol",chainId:r}]}),f=Ek(c??"0",YEe(o??u));return{decimals:u,formatted:f,symbol:d,value:c}}function rme(e){return e.state.chainId}function Uy(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;let n,r;if(Array.isArray(e)&&Array.isArray(t)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Uy(e[r],t[r]))return!1;return!0}if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===t.toString();const s=Object.keys(e);if(n=s.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!Object.prototype.hasOwnProperty.call(t,s[r]))return!1;for(r=n;r--!==0;){const a=s[r];if(a&&!Uy(e[a],t[a]))return!1}return!0}return e!==e&&t!==t}let fH=[];function sme(e){const t=e.chains;return Uy(fH,t)?fH:(fH=t,t)}function g0t(e,t={}){let n;try{n=e.getClient(t)}catch{}return n}let $I=[];function UZ(e){const t=[...e.state.connections.values()];return e.state.status==="reconnecting"||Uy($I,t)?$I:($I=t,t)}let hH=[];function ime(e){const t=e.connectors;return Uy(hH,t)?hH:(hH=t,t)}function b0t(e,t){const{chainId:n,...r}=t,s=e.getClient({chainId:n});return i2(s,W9e,"getEnsAvatar")(r)}function y0t(e,t){const{chainId:n,...r}=t,s=e.getClient({chainId:n});return i2(s,q9e,"getEnsName")(r)}function zZ(e,t={}){const n=g0t(e,t);return n==null?void 0:n.extend(f0t)}let pH=!1;async function v0t(e,t={}){var u,d;if(pH)return[];pH=!0,e.setState(f=>({...f,status:f.current?"reconnecting":"connecting"}));const n=[];if((u=t.connectors)!=null&&u.length)for(const f of t.connectors){let x;typeof f=="function"?x=e._internal.connectors.setup(f):x=f,n.push(x)}else n.push(...e.connectors);let r;try{r=await((d=e.storage)==null?void 0:d.getItem("recentConnectorId"))}catch{}const s={};for(const[,f]of e.state.connections)s[f.connector.id]=1;r&&(s[r]=0);const a=Object.keys(s).length>0?[...n].sort((f,x)=>(s[f.id]??10)-(s[x.id]??10)):n;let o=!1;const l=[],c=[];for(const f of a){const x=await f.getProvider().catch(()=>{});if(!x||c.some(w=>w===x)||!await f.isAuthorized())continue;const v=await f.connect({isReconnecting:!0}).catch(()=>null);v&&(f.emitter.off("connect",e._internal.events.connect),f.emitter.on("change",e._internal.events.change),f.emitter.on("disconnect",e._internal.events.disconnect),e.setState(w=>{const C=new Map(o?w.connections:new Map).set(f.uid,{accounts:v.accounts,chainId:v.chainId,connector:f});return{...w,current:o?w.current:f.uid,connections:C}}),l.push({accounts:v.accounts,chainId:v.chainId,connector:f}),c.push(x),o=!0)}return(e.state.status==="reconnecting"||e.state.status==="connecting")&&(o?e.setState(f=>({...f,status:"connected"})):e.setState(f=>({...f,connections:new Map,current:null,status:"disconnected"}))),pH=!1,l}async function w0t(e,t){const{account:n,connector:r,...s}=t;let a;return typeof n=="object"&&n.type==="local"?a=e.getClient():a=await Die(e,{account:n,connector:r}),i2(a,gmt,"signMessage")({...s,...n?{account:n}:{}})}async function C0t(e,t){const{account:n,connector:r,...s}=t;let a;return typeof n=="object"&&n.type==="local"?a=e.getClient():a=await Die(e,{account:n,connector:r}),i2(a,bmt,"signTypedData")({...s,...n?{account:n}:{}})}class Wh extends S1{constructor(){super("Provider not found."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ProviderNotFoundError"})}}class S0t extends S1{constructor({connector:t}){super(`"${t.name}" does not support programmatic chain switching.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SwitchChainNotSupportedError"})}}async function N0t(e,t){var o;const{addEthereumChainParameter:n,chainId:r}=t,s=e.state.connections.get(((o=t.connector)==null?void 0:o.uid)??e.state.current);if(s){const l=s.connector;if(!l.switchChain)throw new S0t({connector:l});return await l.switchChain({addEthereumChainParameter:n,chainId:r})}const a=e.chains.find(l=>l.id===r);if(!a)throw new S3;return e.setState(l=>({...l,chainId:r})),a}function ZEe(e,t){const{onChange:n}=t;return e.subscribe(()=>XEe(e),n,{equalityFn(r,s){const{connector:a,...o}=r,{connector:l,...c}=s;return Uy(o,c)&&(a==null?void 0:a.id)===(l==null?void 0:l.id)&&(a==null?void 0:a.uid)===(l==null?void 0:l.uid)}})}function A0t(e,t){const{onChange:n}=t;return e.subscribe(r=>r.chainId,n)}function j0t(e,t){const{onChange:n}=t;return e.subscribe(()=>UZ(e),n,{equalityFn:Uy})}function E0t(e,t){const{onChange:n}=t;return e._internal.connectors.subscribe((r,s)=>{n(Object.values(r),s)})}function _0t(e,t){const{onChange:n}=t;return e.subscribe(()=>zZ(e),n,{equalityFn(r,s){return(r==null?void 0:r.uid)===(s==null?void 0:s.uid)}})}async function k0t(e,t){const{account:n,chainId:r,connector:s,...a}=t;let o;return typeof n=="object"&&(n==null?void 0:n.type)==="local"?o=e.getClient({chainId:r}):o=await Die(e,{account:n??void 0,chainId:r,connector:s}),await i2(o,Qmt,"writeContract")({...a,...n?{account:n}:{},chain:r?{id:r}:null})}bB.type="injected";function bB(e={}){const{shimDisconnect:t=!0,unstable_shimAsyncInject:n}=e;function r(){const c=e.target;if(typeof c=="function"){const u=c();if(u)return u}return typeof c=="object"?c:typeof c=="string"?{...T0t[c]??{id:c,name:`${c[0].toUpperCase()}${c.slice(1)}`,provider:`is${c[0].toUpperCase()}${c.slice(1)}`}}:{id:"injected",name:"Injected",provider(u){return u==null?void 0:u.ethereum}}}let s,a,o,l;return c=>({get icon(){return r().icon},get id(){return r().id},get name(){return r().name},get supportsSimulation(){return!0},type:bB.type,async setup(){const u=await this.getProvider();u!=null&&u.on&&e.target&&(o||(o=this.onConnect.bind(this),u.on("connect",o)),s||(s=this.onAccountsChanged.bind(this),u.on("accountsChanged",s)))},async connect({chainId:u,isReconnecting:d}={}){var g,v,w,C,N,P;const f=await this.getProvider();if(!f)throw new Wh;let x=[];if(d)x=await this.getAccounts().catch(()=>[]);else if(t)try{x=(C=(w=(v=(g=(await f.request({method:"wallet_requestPermissions",params:[{eth_accounts:{}}]}))[0])==null?void 0:g.caveats)==null?void 0:v[0])==null?void 0:w.value)==null?void 0:C.map(R=>jc(R)),x.length>0&&(x=await this.getAccounts())}catch(I){const R=I;if(R.code===bo.code)throw new bo(R);if(R.code===Cy.code)throw R}try{!(x!=null&&x.length)&&!d&&(x=(await f.request({method:"eth_requestAccounts"})).map(F=>jc(F))),o&&(f.removeListener("connect",o),o=void 0),s||(s=this.onAccountsChanged.bind(this),f.on("accountsChanged",s)),a||(a=this.onChainChanged.bind(this),f.on("chainChanged",a)),l||(l=this.onDisconnect.bind(this),f.on("disconnect",l));let I=await this.getChainId();if(u&&I!==u){const R=await this.switchChain({chainId:u}).catch(F=>{if(F.code===bo.code)throw F;return{id:I}});I=(R==null?void 0:R.id)??I}return t&&await((N=c.storage)==null?void 0:N.removeItem(`${this.id}.disconnected`)),e.target||await((P=c.storage)==null?void 0:P.setItem("injected.connected",!0)),{accounts:x,chainId:I}}catch(I){const R=I;throw R.code===bo.code?new bo(R):R.code===Cy.code?new Cy(R):R}},async disconnect(){var d,f;const u=await this.getProvider();if(!u)throw new Wh;a&&(u.removeListener("chainChanged",a),a=void 0),l&&(u.removeListener("disconnect",l),l=void 0),o||(o=this.onConnect.bind(this),u.on("connect",o));try{await Iie(()=>u.request({method:"wallet_revokePermissions",params:[{eth_accounts:{}}]}),{timeout:100})}catch{}t&&await((d=c.storage)==null?void 0:d.setItem(`${this.id}.disconnected`,!0)),e.target||await((f=c.storage)==null?void 0:f.removeItem("injected.connected"))},async getAccounts(){const u=await this.getProvider();if(!u)throw new Wh;return(await u.request({method:"eth_accounts"})).map(f=>jc(f))},async getChainId(){const u=await this.getProvider();if(!u)throw new Wh;const d=await u.request({method:"eth_chainId"});return Number(d)},async getProvider(){if(typeof window>"u")return;let u;const d=r();return typeof d.provider=="function"?u=d.provider(window):typeof d.provider=="string"?u=DF(window,d.provider):u=d.provider,u&&!u.removeListener&&("off"in u&&typeof u.off=="function"?u.removeListener=u.off:u.removeListener=()=>{}),u},async isAuthorized(){var u,d;try{if(t&&await((u=c.storage)==null?void 0:u.getItem(`${this.id}.disconnected`))||!e.target&&!await((d=c.storage)==null?void 0:d.getItem("injected.connected")))return!1;if(!await this.getProvider()){if(n!==void 0&&n!==!1){const v=async()=>(typeof window<"u"&&window.removeEventListener("ethereum#initialized",v),!!await this.getProvider()),w=typeof n=="number"?n:1e3;if(await Promise.race([...typeof window<"u"?[new Promise(N=>window.addEventListener("ethereum#initialized",()=>N(v()),{once:!0}))]:[],new Promise(N=>setTimeout(()=>N(v()),w))]))return!0}throw new Wh}return!!(await iM(()=>this.getAccounts())).length}catch{return!1}},async switchChain({addEthereumChainParameter:u,chainId:d}){var v,w,C,N;const f=await this.getProvider();if(!f)throw new Wh;const x=c.chains.find(P=>P.id===d);if(!x)throw new ip(new S3);const g=new Promise(P=>{const I=R=>{"chainId"in R&&R.chainId===d&&(c.emitter.off("change",I),P())};c.emitter.on("change",I)});try{return await Promise.all([f.request({method:"wallet_switchEthereumChain",params:[{chainId:$s(d)}]}).then(async()=>{await this.getChainId()===d&&c.emitter.emit("change",{chainId:d})}),g]),x}catch(P){const I=P;if(I.code===4902||((w=(v=I==null?void 0:I.data)==null?void 0:v.originalError)==null?void 0:w.code)===4902)try{const{default:R,...F}=x.blockExplorers??{};let U;u!=null&&u.blockExplorerUrls?U=u.blockExplorerUrls:R&&(U=[R.url,...Object.values(F).map(Q=>Q.url)]);let L;(C=u==null?void 0:u.rpcUrls)!=null&&C.length?L=u.rpcUrls:L=[((N=x.rpcUrls.default)==null?void 0:N.http[0])??""];const z={blockExplorerUrls:U,chainId:$s(d),chainName:(u==null?void 0:u.chainName)??x.name,iconUrls:u==null?void 0:u.iconUrls,nativeCurrency:(u==null?void 0:u.nativeCurrency)??x.nativeCurrency,rpcUrls:L};return await Promise.all([f.request({method:"wallet_addEthereumChain",params:[z]}).then(async()=>{if(await this.getChainId()===d)c.emitter.emit("change",{chainId:d});else throw new bo(new Error("User rejected switch after adding network."))}),g]),x}catch(R){throw new bo(R)}throw I.code===bo.code?new bo(I):new ip(I)}},async onAccountsChanged(u){var d;if(u.length===0)this.onDisconnect();else if(c.emitter.listenerCount("connect")){const f=(await this.getChainId()).toString();this.onConnect({chainId:f}),t&&await((d=c.storage)==null?void 0:d.removeItem(`${this.id}.disconnected`))}else c.emitter.emit("change",{accounts:u.map(f=>jc(f))})},onChainChanged(u){const d=Number(u);c.emitter.emit("change",{chainId:d})},async onConnect(u){const d=await this.getAccounts();if(d.length===0)return;const f=Number(u.chainId);c.emitter.emit("connect",{accounts:d,chainId:f});const x=await this.getProvider();x&&(o&&(x.removeListener("connect",o),o=void 0),s||(s=this.onAccountsChanged.bind(this),x.on("accountsChanged",s)),a||(a=this.onChainChanged.bind(this),x.on("chainChanged",a)),l||(l=this.onDisconnect.bind(this),x.on("disconnect",l)))},async onDisconnect(u){const d=await this.getProvider();u&&u.code===1013&&d&&(await this.getAccounts()).length||(c.emitter.emit("disconnect"),d&&(a&&(d.removeListener("chainChanged",a),a=void 0),l&&(d.removeListener("disconnect",l),l=void 0),o||(o=this.onConnect.bind(this),d.on("connect",o))))}})}const T0t={coinbaseWallet:{id:"coinbaseWallet",name:"Coinbase Wallet",provider(e){return e!=null&&e.coinbaseWalletExtension?e.coinbaseWalletExtension:DF(e,"isCoinbaseWallet")}},metaMask:{id:"metaMask",name:"MetaMask",provider(e){return DF(e,t=>{if(!t.isMetaMask||t.isBraveWallet&&!t._events&&!t._state)return!1;const n=["isApexWallet","isAvalanche","isBitKeep","isBlockWallet","isKuCoinWallet","isMathWallet","isOkxWallet","isOKExWallet","isOneInchIOSWallet","isOneInchAndroidWallet","isOpera","isPhantom","isPortal","isRabby","isTokenPocket","isTokenary","isUniswapWallet","isZerion"];for(const r of n)if(t[r])return!1;return!0})}},phantom:{id:"phantom",name:"Phantom",provider(e){var t,n;return(t=e==null?void 0:e.phantom)!=null&&t.ethereum?(n=e.phantom)==null?void 0:n.ethereum:DF(e,"isPhantom")}}};function DF(e,t){function n(s){return typeof t=="function"?t(s):typeof t=="string"?s[t]:!0}const r=e.ethereum;if(r!=null&&r.providers)return r.providers.find(s=>n(s));if(r&&n(r))return r}function I0t(e){if(typeof window>"u")return;const t=n=>e(n.detail);return window.addEventListener("eip6963:announceProvider",t),window.dispatchEvent(new CustomEvent("eip6963:requestProvider")),()=>window.removeEventListener("eip6963:announceProvider",t)}function P0t(){const e=new Set;let t=[];const n=()=>I0t(s=>{t.some(({info:a})=>a.uuid===s.info.uuid)||(t=[...t,s],e.forEach(a=>a(t,{added:[s]})))});let r=n();return{_listeners(){return e},clear(){e.forEach(s=>s([],{removed:[...t]})),t=[]},destroy(){this.clear(),e.clear(),r==null||r()},findProvider({rdns:s}){return t.find(a=>a.info.rdns===s)},getProviders(){return t},reset(){this.clear(),r==null||r(),r=n()},subscribe(s,{emitImmediately:a}={}){return e.add(s),a&&s(t,{added:t}),()=>e.delete(s)}}}const F0t=e=>(t,n,r)=>{const s=r.subscribe;return r.subscribe=(o,l,c)=>{let u=o;if(l){const d=(c==null?void 0:c.equalityFn)||Object.is;let f=o(r.getState());u=x=>{const g=o(x);if(!d(f,g)){const v=f;l(f=g,v)}},c!=null&&c.fireImmediately&&l(f,f)}return s(u)},e(t,n,r)},O0t=F0t;function M0t(e,t){let n;try{n=e()}catch{return}return{getItem:s=>{var a;const o=c=>c===null?null:JSON.parse(c,void 0),l=(a=n.getItem(s))!=null?a:null;return l instanceof Promise?l.then(o):o(l)},setItem:(s,a)=>n.setItem(s,JSON.stringify(a,void 0)),removeItem:s=>n.removeItem(s)}}const HZ=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then(r){return HZ(r)(n)},catch(r){return this}}}catch(n){return{then(r){return this},catch(r){return HZ(r)(n)}}}},R0t=(e,t)=>(n,r,s)=>{let a={storage:M0t(()=>localStorage),partialize:w=>w,version:0,merge:(w,C)=>({...C,...w}),...t},o=!1;const l=new Set,c=new Set;let u=a.storage;if(!u)return e((...w)=>{console.warn(`[zustand persist middleware] Unable to update item '${a.name}', the given storage is currently unavailable.`),n(...w)},r,s);const d=()=>{const w=a.partialize({...r()});return u.setItem(a.name,{state:w,version:a.version})},f=s.setState;s.setState=(w,C)=>{f(w,C),d()};const x=e((...w)=>{n(...w),d()},r,s);s.getInitialState=()=>x;let g;const v=()=>{var w,C;if(!u)return;o=!1,l.forEach(P=>{var I;return P((I=r())!=null?I:x)});const N=((C=a.onRehydrateStorage)==null?void 0:C.call(a,(w=r())!=null?w:x))||void 0;return HZ(u.getItem.bind(u))(a.name).then(P=>{if(P)if(typeof P.version=="number"&&P.version!==a.version){if(a.migrate)return[!0,a.migrate(P.state,P.version)];console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,P.state];return[!1,void 0]}).then(P=>{var I;const[R,F]=P;if(g=a.merge(F,(I=r())!=null?I:x),n(g,!0),R)return d()}).then(()=>{N==null||N(g,void 0),g=r(),o=!0,c.forEach(P=>P(g))}).catch(P=>{N==null||N(void 0,P)})};return s.persist={setOptions:w=>{a={...a,...w},w.storage&&(u=w.storage)},clearStorage:()=>{u==null||u.removeItem(a.name)},getOptions:()=>a,rehydrate:()=>v(),hasHydrated:()=>o,onHydrate:w=>(l.add(w),()=>{l.delete(w)}),onFinishHydration:w=>(c.add(w),()=>{c.delete(w)})},a.skipHydration||v(),g||x},L0t=R0t,ame=e=>{let t;const n=new Set,r=(u,d)=>{const f=typeof u=="function"?u(t):u;if(!Object.is(f,t)){const x=t;t=d??(typeof f!="object"||f===null)?f:Object.assign({},t,f),n.forEach(g=>g(t,x))}},s=()=>t,l={setState:r,getState:s,getInitialState:()=>c,subscribe:u=>(n.add(u),()=>n.delete(u))},c=t=e(r,s,l);return l},mH=e=>e?ame(e):ame;var xH={exports:{}},ome;function D0t(){return ome||(ome=1,function(e){var t=Object.prototype.hasOwnProperty,n="~";function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(n=!1));function s(c,u,d){this.fn=c,this.context=u,this.once=d||!1}function a(c,u,d,f,x){if(typeof d!="function")throw new TypeError("The listener must be a function");var g=new s(d,f||c,x),v=n?n+u:u;return c._events[v]?c._events[v].fn?c._events[v]=[c._events[v],g]:c._events[v].push(g):(c._events[v]=g,c._eventsCount++),c}function o(c,u){--c._eventsCount===0?c._events=new r:delete c._events[u]}function l(){this._events=new r,this._eventsCount=0}l.prototype.eventNames=function(){var u=[],d,f;if(this._eventsCount===0)return u;for(f in d=this._events)t.call(d,f)&&u.push(n?f.slice(1):f);return Object.getOwnPropertySymbols?u.concat(Object.getOwnPropertySymbols(d)):u},l.prototype.listeners=function(u){var d=n?n+u:u,f=this._events[d];if(!f)return[];if(f.fn)return[f.fn];for(var x=0,g=f.length,v=new Array(g);x<g;x++)v[x]=f[x].fn;return v},l.prototype.listenerCount=function(u){var d=n?n+u:u,f=this._events[d];return f?f.fn?1:f.length:0},l.prototype.emit=function(u,d,f,x,g,v){var w=n?n+u:u;if(!this._events[w])return!1;var C=this._events[w],N=arguments.length,P,I;if(C.fn){switch(C.once&&this.removeListener(u,C.fn,void 0,!0),N){case 1:return C.fn.call(C.context),!0;case 2:return C.fn.call(C.context,d),!0;case 3:return C.fn.call(C.context,d,f),!0;case 4:return C.fn.call(C.context,d,f,x),!0;case 5:return C.fn.call(C.context,d,f,x,g),!0;case 6:return C.fn.call(C.context,d,f,x,g,v),!0}for(I=1,P=new Array(N-1);I<N;I++)P[I-1]=arguments[I];C.fn.apply(C.context,P)}else{var R=C.length,F;for(I=0;I<R;I++)switch(C[I].once&&this.removeListener(u,C[I].fn,void 0,!0),N){case 1:C[I].fn.call(C[I].context);break;case 2:C[I].fn.call(C[I].context,d);break;case 3:C[I].fn.call(C[I].context,d,f);break;case 4:C[I].fn.call(C[I].context,d,f,x);break;default:if(!P)for(F=1,P=new Array(N-1);F<N;F++)P[F-1]=arguments[F];C[I].fn.apply(C[I].context,P)}}return!0},l.prototype.on=function(u,d,f){return a(this,u,d,f,!1)},l.prototype.once=function(u,d,f){return a(this,u,d,f,!0)},l.prototype.removeListener=function(u,d,f,x){var g=n?n+u:u;if(!this._events[g])return this;if(!d)return o(this,g),this;var v=this._events[g];if(v.fn)v.fn===d&&(!x||v.once)&&(!f||v.context===f)&&o(this,g);else{for(var w=0,C=[],N=v.length;w<N;w++)(v[w].fn!==d||x&&!v[w].once||f&&v[w].context!==f)&&C.push(v[w]);C.length?this._events[g]=C.length===1?C[0]:C:o(this,g)}return this},l.prototype.removeAllListeners=function(u){var d;return u?(d=n?n+u:u,this._events[d]&&o(this,d)):(this._events=new r,this._eventsCount=0),this},l.prototype.off=l.prototype.removeListener,l.prototype.addListener=l.prototype.on,l.prefixed=n,l.EventEmitter=l,e.exports=l}(xH)),xH.exports}var B0t=D0t();const Bie=Ti(B0t);let $0t=class{constructor(t){Object.defineProperty(this,"uid",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"_emitter",{enumerable:!0,configurable:!0,writable:!0,value:new Bie})}on(t,n){this._emitter.on(t,n)}once(t,n){this._emitter.once(t,n)}off(t,n){this._emitter.off(t,n)}emit(t,...n){const r=n[0];this._emitter.emit(t,{uid:this.uid,...r})}listenerCount(t){return this._emitter.listenerCount(t)}};function U0t(e){return new $0t(e)}function z0t(e,t){return JSON.parse(e,(n,r)=>{let s=r;return(s==null?void 0:s.__type)==="bigint"&&(s=BigInt(s.value)),(s==null?void 0:s.__type)==="Map"&&(s=new Map(s.value)),(t==null?void 0:t(n,s))??s})}function lme(e,t){return e.slice(0,t).join(".")||"."}function cme(e,t){const{length:n}=e;for(let r=0;r<n;++r)if(e[r]===t)return r+1;return 0}function H0t(e,t){const n=typeof e=="function",r=typeof t=="function",s=[],a=[];return function(l,c){if(typeof c=="object")if(s.length){const u=cme(s,this);u===0?s[s.length]=this:(s.splice(u),a.splice(u)),a[a.length]=l;const d=cme(s,c);if(d!==0)return r?t.call(this,l,c,lme(a,d)):`[ref=${lme(a,d)}]`}else s[0]=c,a[0]=l;return n?e.call(this,l,c):c}}function V0t(e,t,n,r){return JSON.stringify(e,H0t((s,a)=>{let o=a;return typeof o=="bigint"&&(o={__type:"bigint",value:a.toString()}),o instanceof Map&&(o={__type:"Map",value:Array.from(a.entries())}),(t==null?void 0:t(s,o))??o},r),n??void 0)}function W0t(e){const{deserialize:t=z0t,key:n="wagmi",serialize:r=V0t,storage:s=JEe}=e;function a(o){return o instanceof Promise?o.then(l=>l).catch(()=>null):o}return{...s,key:n,async getItem(o,l){const c=s.getItem(`${n}.${o}`),u=await a(c);return u?t(u)??null:l??null},async setItem(o,l){const c=`${n}.${o}`;l===null?await a(s.removeItem(c)):await a(s.setItem(c,r(l)))},async removeItem(o){await a(s.removeItem(`${n}.${o}`))}}}const JEe={getItem:()=>null,setItem:()=>{},removeItem:()=>{}};function q0t(){const e=typeof window<"u"&&window.localStorage?window.localStorage:JEe;return{getItem(t){return e.getItem(t)},removeItem(t){e.removeItem(t)},setItem(t,n){try{e.setItem(t,n)}catch{}}}}const VZ=256;let UI=VZ,zI;function G0t(e=11){if(!zI||UI+e>VZ*2){zI="",UI=0;for(let t=0;t<VZ;t++)zI+=(256+Math.random()*256|0).toString(16).substring(1)}return zI.substring(UI,UI+++e)}function K0t(e){const{multiInjectedProviderDiscovery:t=!0,storage:n=W0t({storage:q0t()}),syncConnectedChain:r=!0,ssr:s=!1,...a}=e,o=typeof window<"u"&&t?P0t():void 0,l=mH(()=>a.chains),c=mH(()=>{const F=[],U=new Set;for(const L of a.connectors??[]){const z=u(L);if(F.push(z),!s&&z.rdns){const Q=typeof z.rdns=="string"?[z.rdns]:z.rdns;for(const ne of Q)U.add(ne)}}if(!s&&o){const L=o.getProviders();for(const z of L)U.has(z.info.rdns)||F.push(u(d(z)))}return F});function u(F){var z;const U=U0t(G0t()),L={...F({emitter:U,chains:l.getState(),storage:n,transports:a.transports}),emitter:U,uid:U.uid};return U.on("connect",I),(z=L.setup)==null||z.call(L),L}function d(F){const{info:U}=F,L=F.provider;return bB({target:{...U,id:U.rdns,provider:L}})}const f=new Map;function x(F={}){const U=F.chainId??C.getState().chainId,L=l.getState().find(Q=>Q.id===U);if(F.chainId&&!L)throw new S3;{const Q=f.get(C.getState().chainId);if(Q&&!L)return Q;if(!L)throw new S3}{const Q=f.get(U);if(Q)return Q}let z;if(a.client)z=a.client({chain:L});else{const Q=L.id,ne=l.getState().map(re=>re.id),J={},X=Object.entries(a);for(const[re,pe]of X)if(!(re==="chains"||re==="client"||re==="connectors"||re==="transports"))if(typeof pe=="object")if(Q in pe)J[re]=pe[Q];else{if(ne.some(ie=>ie in pe))continue;J[re]=pe}else J[re]=pe;z=GEe({...J,chain:L,batch:J.batch??{multicall:!0},transport:re=>a.transports[Q]({...re,connectors:c})})}return f.set(U,z),z}function g(){return{chainId:l.getState()[0].id,connections:new Map,current:null,status:"disconnected"}}let v;const w="0.0.0-canary-";LF.startsWith(w)?v=Number.parseInt(LF.replace(w,"")):v=Number.parseInt(LF.split(".")[0]??"0");const C=mH(O0t(n?L0t(g,{migrate(F,U){if(U===v)return F;const L=g(),z=N(F,L.chainId);return{...L,chainId:z}},name:"store",partialize(F){return{connections:{__type:"Map",value:Array.from(F.connections.entries()).map(([U,L])=>{const{id:z,name:Q,type:ne,uid:J}=L.connector;return[U,{...L,connector:{id:z,name:Q,type:ne,uid:J}}]})},chainId:F.chainId,current:F.current}},merge(F,U){typeof F=="object"&&F&&"status"in F&&delete F.status;const L=N(F,U.chainId);return{...U,...F,chainId:L}},skipHydration:s,storage:n,version:v}):g));C.setState(g());function N(F,U){return F&&typeof F=="object"&&"chainId"in F&&typeof F.chainId=="number"&&l.getState().some(L=>L.id===F.chainId)?F.chainId:U}r&&C.subscribe(({connections:F,current:U})=>{var L;return U?(L=F.get(U))==null?void 0:L.chainId:void 0},F=>{if(l.getState().some(L=>L.id===F))return C.setState(L=>({...L,chainId:F??L.chainId}))}),o==null||o.subscribe(F=>{const U=new Set,L=new Set;for(const Q of c.getState())if(U.add(Q.id),Q.rdns){const ne=typeof Q.rdns=="string"?[Q.rdns]:Q.rdns;for(const J of ne)L.add(J)}const z=[];for(const Q of F){if(L.has(Q.info.rdns))continue;const ne=u(d(Q));U.has(ne.id)||z.push(ne)}n&&!C.persist.hasHydrated()||c.setState(Q=>[...Q,...z],!0)});function P(F){C.setState(U=>{const L=U.connections.get(F.uid);return L?{...U,connections:new Map(U.connections).set(F.uid,{accounts:F.accounts??L.accounts,chainId:F.chainId??L.chainId,connector:L.connector})}:U})}function I(F){C.getState().status==="connecting"||C.getState().status==="reconnecting"||C.setState(U=>{const L=c.getState().find(z=>z.uid===F.uid);return L?(L.emitter.listenerCount("connect")&&L.emitter.off("connect",P),L.emitter.listenerCount("change")||L.emitter.on("change",P),L.emitter.listenerCount("disconnect")||L.emitter.on("disconnect",R),{...U,connections:new Map(U.connections).set(F.uid,{accounts:F.accounts,chainId:F.chainId,connector:L}),current:F.uid,status:"connected"}):U})}function R(F){C.setState(U=>{const L=U.connections.get(F.uid);if(L){const Q=L.connector;Q.emitter.listenerCount("change")&&L.connector.emitter.off("change",P),Q.emitter.listenerCount("disconnect")&&L.connector.emitter.off("disconnect",R),Q.emitter.listenerCount("connect")||L.connector.emitter.on("connect",I)}if(U.connections.delete(F.uid),U.connections.size===0)return{...U,connections:new Map,current:null,status:"disconnected"};const z=U.connections.values().next().value;return{...U,connections:new Map(U.connections),current:z.connector.uid}})}return{get chains(){return l.getState()},get connectors(){return c.getState()},storage:n,getClient:x,get state(){return C.getState()},setState(F){let U;typeof F=="function"?U=F(C.getState()):U=F;const L=g();typeof U!="object"&&(U=L),Object.keys(L).some(Q=>!(Q in U))&&(U=L),C.setState(U,!0)},subscribe(F,U,L){return C.subscribe(F,U,L?{...L,fireImmediately:L.emitImmediately}:void 0)},_internal:{mipd:o,store:C,ssr:!!s,syncConnectedChain:r,transports:a.transports,chains:{setState(F){const U=typeof F=="function"?F(l.getState()):F;if(U.length!==0)return l.setState(U,!0)},subscribe(F){return l.subscribe(F)}},connectors:{providerDetailToConnector:d,setup:u,setState(F){return c.setState(typeof F=="function"?F(c.getState()):F,!0)},subscribe(F){return c.subscribe(F)}},events:{change:P,connect:I,disconnect:R}}}}function Y0t(e,t){const{initialState:n,reconnectOnMount:r}=t;return n&&!e._internal.store.persist.hasHydrated()&&e.setState({...n,chainId:e.chains.some(s=>s.id===n.chainId)?n.chainId:e.chains[0].id,connections:r?n.connections:new Map,status:r?"reconnecting":"disconnected"}),{async onMount(){e._internal.ssr&&(await e._internal.store.persist.rehydrate(),e._internal.mipd&&e._internal.connectors.setState(s=>{var c;const a=new Set;for(const u of s??[])if(u.rdns){const d=Array.isArray(u.rdns)?u.rdns:[u.rdns];for(const f of d)a.add(f)}const o=[],l=((c=e._internal.mipd)==null?void 0:c.getProviders())??[];for(const u of l){if(a.has(u.info.rdns))continue;const d=e._internal.connectors.providerDetailToConnector(u),f=e._internal.connectors.setup(d);o.push(f)}return[...s,...o]})),r?v0t(e):e.storage&&e.setState(s=>({...s,connections:new Map}))}}}function X0t(e){var a,o,l;const{chain:t}=e,n=t.rpcUrls.default.http[0];if(!e.transports)return[n];const r=(o=(a=e.transports)==null?void 0:a[t.id])==null?void 0:o.call(a,{chain:t});return(((l=r==null?void 0:r.value)==null?void 0:l.transports)||[r]).map(({value:c})=>(c==null?void 0:c.url)||n)}function Q0t(e){const{children:t,config:n,initialState:r,reconnectOnMount:s=!0}=e,{onMount:a}=Y0t(n,{initialState:r,reconnectOnMount:s});n._internal.ssr||a();const o=m.useRef(!0);return m.useEffect(()=>{if(o.current&&n._internal.ssr)return a(),()=>{o.current=!1}},[]),t}const e_e=m.createContext(void 0);function Z0t(e){const{children:t,config:n}=e,r={value:n};return m.createElement(Q0t,e,m.createElement(e_e.Provider,r,t))}const J0t="2.14.16",ext=()=>`wagmi@${J0t}`;let txt=class extends S1{constructor(){super(...arguments),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"WagmiError"})}get docsBaseUrl(){return"https://wagmi.sh/react"}get version(){return ext()}};class nxt extends txt{constructor(){super("`useConfig` must be used within `WagmiProvider`.",{docsPath:"/api/WagmiProvider"}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"WagmiProviderNotFoundError"})}}function Al(e={}){const t=e.config??m.useContext(e_e);if(!t)throw new nxt;return t}function rxt(e,t){const{onChange:n}=t;return e._internal.chains.subscribe((r,s)=>{n(r,s)})}var gH={exports:{}},bH={},yH={exports:{}},vH={};/**
* @license React
* use-sync-external-store-shim.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var ume;function sxt(){if(ume)return vH;ume=1;var e=ax();function t(f,x){return f===x&&(f!==0||1/f===1/x)||f!==f&&x!==x}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,s=e.useEffect,a=e.useLayoutEffect,o=e.useDebugValue;function l(f,x){var g=x(),v=r({inst:{value:g,getSnapshot:x}}),w=v[0].inst,C=v[1];return a(function(){w.value=g,w.getSnapshot=x,c(w)&&C({inst:w})},[f,g,x]),s(function(){return c(w)&&C({inst:w}),f(function(){c(w)&&C({inst:w})})},[f]),o(g),g}function c(f){var x=f.getSnapshot;f=f.value;try{var g=x();return!n(f,g)}catch{return!0}}function u(f,x){return x()}var d=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?u:l;return vH.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:d,vH}var dme;function ixt(){return dme||(dme=1,yH.exports=sxt()),yH.exports}/**
* @license React
* use-sync-external-store-shim/with-selector.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var fme;function axt(){if(fme)return bH;fme=1;var e=ax(),t=ixt();function n(u,d){return u===d&&(u!==0||1/u===1/d)||u!==u&&d!==d}var r=typeof Object.is=="function"?Object.is:n,s=t.useSyncExternalStore,a=e.useRef,o=e.useEffect,l=e.useMemo,c=e.useDebugValue;return bH.useSyncExternalStoreWithSelector=function(u,d,f,x,g){var v=a(null);if(v.current===null){var w={hasValue:!1,value:null};v.current=w}else w=v.current;v=l(function(){function N(U){if(!P){if(P=!0,I=U,U=x(U),g!==void 0&&w.hasValue){var L=w.value;if(g(L,U))return R=L}return R=U}if(L=R,r(I,U))return L;var z=x(U);return g!==void 0&&g(L,z)?(I=U,L):(I=U,R=z)}var P=!1,I,R,F=f===void 0?null:f;return[function(){return N(d())},F===null?void 0:function(){return N(F())}]},[d,f,x,g]);var C=s(u,v[0],v[1]);return o(function(){w.hasValue=!0,w.value=C},[C]),c(C),C},bH}var hme;function oxt(){return hme||(hme=1,gH.exports=axt()),gH.exports}var t_e=oxt();const wH=e=>typeof e=="object"&&!Array.isArray(e);function lxt(e,t,n=t,r=Uy){const s=m.useRef([]),a=t_e.useSyncExternalStoreWithSelector(e,t,n,o=>o,(o,l)=>{if(wH(o)&&wH(l)&&s.current.length){for(const c of s.current)if(!r(o[c],l[c]))return!1;return!0}return r(o,l)});return m.useMemo(()=>{if(wH(a)){const o={...a};let l={};for(const[c,u]of Object.entries(o))l={...l,[c]:{configurable:!1,enumerable:!0,get:()=>(s.current.includes(c)||s.current.push(c),u)}};return Object.defineProperties(o,l),o}return a},[a])}function ns(e={}){const t=Al(e);return lxt(n=>ZEe(t,{onChange:n}),()=>XEe(t))}function n_e(e={}){const{onConnect:t,onDisconnect:n}=e,r=Al(e);m.useEffect(()=>ZEe(r,{onChange(s,a){if((a.status==="reconnecting"||a.status==="connecting"&&a.address===void 0)&&s.status==="connected"){const{address:o,addresses:l,chain:c,chainId:u,connector:d}=s,f=a.status==="reconnecting"||a.status===void 0;t==null||t({address:o,addresses:l,chain:c,chainId:u,connector:d,isReconnected:f})}else a.status==="connected"&&s.status==="disconnected"&&(n==null||n())}}),[r,t,n])}var bA=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},N3=typeof window>"u"||"Deno"in globalThis;function Uh(){}function cxt(e,t){return typeof e=="function"?e(t):e}function WZ(e){return typeof e=="number"&&e>=0&&e!==1/0}function r_e(e,t){return Math.max(e+(t||0)-Date.now(),0)}function e4(e,t){return typeof e=="function"?e(t):e}function Jp(e,t){return typeof e=="function"?e(t):e}function pme(e,t){const{type:n="all",exact:r,fetchStatus:s,predicate:a,queryKey:o,stale:l}=e;if(o){if(r){if(t.queryHash!==$ie(o,t.options))return!1}else if(!sE(t.queryKey,o))return!1}if(n!=="all"){const c=t.isActive();if(n==="active"&&!c||n==="inactive"&&c)return!1}return!(typeof l=="boolean"&&t.isStale()!==l||s&&s!==t.state.fetchStatus||a&&!a(t))}function mme(e,t){const{exact:n,status:r,predicate:s,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(A3(t.options.mutationKey)!==A3(a))return!1}else if(!sE(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||s&&!s(t))}function $ie(e,t){return((t==null?void 0:t.queryKeyHashFn)||A3)(e)}function A3(e){return JSON.stringify(e,(t,n)=>qZ(n)?Object.keys(n).sort().reduce((r,s)=>(r[s]=n[s],r),{}):n)}function sE(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>sE(e[n],t[n])):!1}function Uie(e,t){if(e===t)return e;const n=xme(e)&&xme(t);if(n||qZ(e)&&qZ(t)){const r=n?e:Object.keys(e),s=r.length,a=n?t:Object.keys(t),o=a.length,l=n?[]:{};let c=0;for(let u=0;u<o;u++){const d=n?u:a[u];(!n&&r.includes(d)||n)&&e[d]===void 0&&t[d]===void 0?(l[d]=void 0,c++):(l[d]=Uie(e[d],t[d]),l[d]===e[d]&&e[d]!==void 0&&c++)}return s===o&&c===s?e:l}return t}function cM(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function xme(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function qZ(e){if(!gme(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!gme(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function gme(e){return Object.prototype.toString.call(e)==="[object Object]"}function uxt(e){return new Promise(t=>{setTimeout(t,e)})}function GZ(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?Uie(e,t):t}function dxt(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function fxt(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var zie=Symbol();function s_e(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===zie?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}var dw,Lb,v4,CNe,hxt=(CNe=class extends bA{constructor(){super();Rn(this,dw);Rn(this,Lb);Rn(this,v4);Wt(this,v4,t=>{if(!N3&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){ze(this,Lb)||this.setEventListener(ze(this,v4))}onUnsubscribe(){var t;this.hasListeners()||((t=ze(this,Lb))==null||t.call(this),Wt(this,Lb,void 0))}setEventListener(t){var n;Wt(this,v4,t),(n=ze(this,Lb))==null||n.call(this),Wt(this,Lb,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){ze(this,dw)!==t&&(Wt(this,dw,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof ze(this,dw)=="boolean"?ze(this,dw):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},dw=new WeakMap,Lb=new WeakMap,v4=new WeakMap,CNe),Hie=new hxt,w4,Db,C4,SNe,pxt=(SNe=class extends bA{constructor(){super();Rn(this,w4,!0);Rn(this,Db);Rn(this,C4);Wt(this,C4,t=>{if(!N3&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){ze(this,Db)||this.setEventListener(ze(this,C4))}onUnsubscribe(){var t;this.hasListeners()||((t=ze(this,Db))==null||t.call(this),Wt(this,Db,void 0))}setEventListener(t){var n;Wt(this,C4,t),(n=ze(this,Db))==null||n.call(this),Wt(this,Db,t(this.setOnline.bind(this)))}setOnline(t){ze(this,w4)!==t&&(Wt(this,w4,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return ze(this,w4)}},w4=new WeakMap,Db=new WeakMap,C4=new WeakMap,SNe),uM=new pxt;function KZ(){let e,t;const n=new Promise((s,a)=>{e=s,t=a});n.status="pending",n.catch(()=>{});function r(s){Object.assign(n,s),delete n.resolve,delete n.reject}return n.resolve=s=>{r({status:"fulfilled",value:s}),e(s)},n.reject=s=>{r({status:"rejected",reason:s}),t(s)},n}function mxt(e){return Math.min(1e3*2**e,3e4)}function i_e(e){return(e??"online")==="online"?uM.isOnline():!0}var a_e=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function CH(e){return e instanceof a_e}function o_e(e){let t=!1,n=0,r=!1,s;const a=KZ(),o=w=>{var C;r||(x(new a_e(w)),(C=e.abort)==null||C.call(e))},l=()=>{t=!0},c=()=>{t=!1},u=()=>Hie.isFocused()&&(e.networkMode==="always"||uM.isOnline())&&e.canRun(),d=()=>i_e(e.networkMode)&&e.canRun(),f=w=>{var C;r||(r=!0,(C=e.onSuccess)==null||C.call(e,w),s==null||s(),a.resolve(w))},x=w=>{var C;r||(r=!0,(C=e.onError)==null||C.call(e,w),s==null||s(),a.reject(w))},g=()=>new Promise(w=>{var C;s=N=>{(r||u())&&w(N)},(C=e.onPause)==null||C.call(e)}).then(()=>{var w;s=void 0,r||(w=e.onContinue)==null||w.call(e)}),v=()=>{if(r)return;let w;const C=n===0?e.initialPromise:void 0;try{w=C??e.fn()}catch(N){w=Promise.reject(N)}Promise.resolve(w).then(f).catch(N=>{var U;if(r)return;const P=e.retry??(N3?0:3),I=e.retryDelay??mxt,R=typeof I=="function"?I(n,N):I,F=P===!0||typeof P=="number"&&n<P||typeof P=="function"&&P(n,N);if(t||!F){x(N);return}n++,(U=e.onFail)==null||U.call(e,n,N),uxt(R).then(()=>u()?void 0:g()).then(()=>{t?x(N):v()})})};return{promise:a,cancel:o,continue:()=>(s==null||s(),a),cancelRetry:l,continueRetry:c,canStart:d,start:()=>(d()?v():g().then(v),a)}}var xxt=e=>setTimeout(e,0);function gxt(){let e=[],t=0,n=l=>{l()},r=l=>{l()},s=xxt;const a=l=>{t?e.push(l):s(()=>{n(l)})},o=()=>{const l=e;e=[],l.length&&s(()=>{r(()=>{l.forEach(c=>{n(c)})})})};return{batch:l=>{let c;t++;try{c=l()}finally{t--,t||o()}return c},batchCalls:l=>(...c)=>{a(()=>{l(...c)})},schedule:a,setNotifyFunction:l=>{n=l},setBatchNotifyFunction:l=>{r=l},setScheduler:l=>{s=l}}}var Jl=gxt(),fw,NNe,l_e=(NNe=class{constructor(){Rn(this,fw)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),WZ(this.gcTime)&&Wt(this,fw,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(N3?1/0:5*60*1e3))}clearGcTimeout(){ze(this,fw)&&(clearTimeout(ze(this,fw)),Wt(this,fw,void 0))}},fw=new WeakMap,NNe),S4,N4,Rh,hw,bu,K_,pw,Up,rg,ANe,bxt=(ANe=class extends l_e{constructor(t){super();Rn(this,Up);Rn(this,S4);Rn(this,N4);Rn(this,Rh);Rn(this,hw);Rn(this,bu);Rn(this,K_);Rn(this,pw);Wt(this,pw,!1),Wt(this,K_,t.defaultOptions),this.setOptions(t.options),this.observers=[],Wt(this,hw,t.client),Wt(this,Rh,ze(this,hw).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,Wt(this,S4,yxt(this.options)),this.state=t.state??ze(this,S4),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=ze(this,bu))==null?void 0:t.promise}setOptions(t){this.options={...ze(this,K_),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&ze(this,Rh).remove(this)}setData(t,n){const r=GZ(this.state.data,t,this.options);return vr(this,Up,rg).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){vr(this,Up,rg).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,s;const n=(r=ze(this,bu))==null?void 0:r.promise;return(s=ze(this,bu))==null||s.cancel(t),n?n.then(Uh).catch(Uh):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(ze(this,S4))}isActive(){return this.observers.some(t=>Jp(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===zie||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(t=0){return this.state.isInvalidated||this.state.data===void 0||!r_e(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=ze(this,bu))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=ze(this,bu))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),ze(this,Rh).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(ze(this,bu)&&(ze(this,pw)?ze(this,bu).cancel({revert:!0}):ze(this,bu).cancelRetry()),this.scheduleGc()),ze(this,Rh).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||vr(this,Up,rg).call(this,{type:"invalidate"})}fetch(t,n){var c,u,d;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(ze(this,bu))return ze(this,bu).continueRetry(),ze(this,bu).promise}if(t&&this.setOptions(t),!this.options.queryFn){const f=this.observers.find(x=>x.options.queryFn);f&&this.setOptions(f.options)}const r=new AbortController,s=f=>{Object.defineProperty(f,"signal",{enumerable:!0,get:()=>(Wt(this,pw,!0),r.signal)})},a=()=>{const f=s_e(this.options,n),x={client:ze(this,hw),queryKey:this.queryKey,meta:this.meta};return s(x),Wt(this,pw,!1),this.options.persister?this.options.persister(f,x,this):f(x)},o={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:ze(this,hw),state:this.state,fetchFn:a};s(o),(c=this.options.behavior)==null||c.onFetch(o,this),Wt(this,N4,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((u=o.fetchOptions)==null?void 0:u.meta))&&vr(this,Up,rg).call(this,{type:"fetch",meta:(d=o.fetchOptions)==null?void 0:d.meta});const l=f=>{var x,g,v,w;CH(f)&&f.silent||vr(this,Up,rg).call(this,{type:"error",error:f}),CH(f)||((g=(x=ze(this,Rh).config).onError)==null||g.call(x,f,this),(w=(v=ze(this,Rh).config).onSettled)==null||w.call(v,this.state.data,f,this)),this.scheduleGc()};return Wt(this,bu,o_e({initialPromise:n==null?void 0:n.initialPromise,fn:o.fetchFn,abort:r.abort.bind(r),onSuccess:f=>{var x,g,v,w;if(f===void 0){l(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(f)}catch(C){l(C);return}(g=(x=ze(this,Rh).config).onSuccess)==null||g.call(x,f,this),(w=(v=ze(this,Rh).config).onSettled)==null||w.call(v,f,this.state.error,this),this.scheduleGc()},onError:l,onFail:(f,x)=>{vr(this,Up,rg).call(this,{type:"failed",failureCount:f,error:x})},onPause:()=>{vr(this,Up,rg).call(this,{type:"pause"})},onContinue:()=>{vr(this,Up,rg).call(this,{type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0})),ze(this,bu).start()}},S4=new WeakMap,N4=new WeakMap,Rh=new WeakMap,hw=new WeakMap,bu=new WeakMap,K_=new WeakMap,pw=new WeakMap,Up=new WeakSet,rg=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...c_e(r.data,this.options),fetchMeta:t.meta??null};case"success":return{...r,data:t.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const s=t.error;return CH(s)&&s.revert&&ze(this,N4)?{...ze(this,N4),fetchStatus:"idle"}:{...r,error:s,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),Jl.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),ze(this,Rh).notify({query:this,type:"updated",action:t})})},ANe);function c_e(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:i_e(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function yxt(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var s0,jNe,vxt=(jNe=class extends bA{constructor(t={}){super();Rn(this,s0);this.config=t,Wt(this,s0,new Map)}build(t,n,r){const s=n.queryKey,a=n.queryHash??$ie(s,n);let o=this.get(a);return o||(o=new bxt({client:t,queryKey:s,queryHash:a,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(s)}),this.add(o)),o}add(t){ze(this,s0).has(t.queryHash)||(ze(this,s0).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=ze(this,s0).get(t.queryHash);n&&(t.destroy(),n===t&&ze(this,s0).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Jl.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return ze(this,s0).get(t)}getAll(){return[...ze(this,s0).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>pme(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>pme(t,r)):n}notify(t){Jl.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){Jl.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Jl.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},s0=new WeakMap,jNe),i0,Yu,mw,a0,Nb,ENe,wxt=(ENe=class extends l_e{constructor(t){super();Rn(this,a0);Rn(this,i0);Rn(this,Yu);Rn(this,mw);this.mutationId=t.mutationId,Wt(this,Yu,t.mutationCache),Wt(this,i0,[]),this.state=t.state||u_e(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){ze(this,i0).includes(t)||(ze(this,i0).push(t),this.clearGcTimeout(),ze(this,Yu).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){Wt(this,i0,ze(this,i0).filter(n=>n!==t)),this.scheduleGc(),ze(this,Yu).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){ze(this,i0).length||(this.state.status==="pending"?this.scheduleGc():ze(this,Yu).remove(this))}continue(){var t;return((t=ze(this,mw))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var a,o,l,c,u,d,f,x,g,v,w,C,N,P,I,R,F,U,L,z;const n=()=>{vr(this,a0,Nb).call(this,{type:"continue"})};Wt(this,mw,o_e({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(Q,ne)=>{vr(this,a0,Nb).call(this,{type:"failed",failureCount:Q,error:ne})},onPause:()=>{vr(this,a0,Nb).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>ze(this,Yu).canRun(this)}));const r=this.state.status==="pending",s=!ze(this,mw).canStart();try{if(r)n();else{vr(this,a0,Nb).call(this,{type:"pending",variables:t,isPaused:s}),await((o=(a=ze(this,Yu).config).onMutate)==null?void 0:o.call(a,t,this));const ne=await((c=(l=this.options).onMutate)==null?void 0:c.call(l,t));ne!==this.state.context&&vr(this,a0,Nb).call(this,{type:"pending",context:ne,variables:t,isPaused:s})}const Q=await ze(this,mw).start();return await((d=(u=ze(this,Yu).config).onSuccess)==null?void 0:d.call(u,Q,t,this.state.context,this)),await((x=(f=this.options).onSuccess)==null?void 0:x.call(f,Q,t,this.state.context)),await((v=(g=ze(this,Yu).config).onSettled)==null?void 0:v.call(g,Q,null,this.state.variables,this.state.context,this)),await((C=(w=this.options).onSettled)==null?void 0:C.call(w,Q,null,t,this.state.context)),vr(this,a0,Nb).call(this,{type:"success",data:Q}),Q}catch(Q){try{throw await((P=(N=ze(this,Yu).config).onError)==null?void 0:P.call(N,Q,t,this.state.context,this)),await((R=(I=this.options).onError)==null?void 0:R.call(I,Q,t,this.state.context)),await((U=(F=ze(this,Yu).config).onSettled)==null?void 0:U.call(F,void 0,Q,this.state.variables,this.state.context,this)),await((z=(L=this.options).onSettled)==null?void 0:z.call(L,void 0,Q,t,this.state.context)),Q}finally{vr(this,a0,Nb).call(this,{type:"error",error:Q})}}finally{ze(this,Yu).runNext(this)}}},i0=new WeakMap,Yu=new WeakMap,mw=new WeakMap,a0=new WeakSet,Nb=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),Jl.batch(()=>{ze(this,i0).forEach(r=>{r.onMutationUpdate(t)}),ze(this,Yu).notify({mutation:this,type:"updated",action:t})})},ENe);function u_e(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var mg,zp,Y_,_Ne,Cxt=(_Ne=class extends bA{constructor(t={}){super();Rn(this,mg);Rn(this,zp);Rn(this,Y_);this.config=t,Wt(this,mg,new Set),Wt(this,zp,new Map),Wt(this,Y_,0)}build(t,n,r){const s=new wxt({mutationCache:this,mutationId:++ib(this,Y_)._,options:t.defaultMutationOptions(n),state:r});return this.add(s),s}add(t){ze(this,mg).add(t);const n=HI(t);if(typeof n=="string"){const r=ze(this,zp).get(n);r?r.push(t):ze(this,zp).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(ze(this,mg).delete(t)){const n=HI(t);if(typeof n=="string"){const r=ze(this,zp).get(n);if(r)if(r.length>1){const s=r.indexOf(t);s!==-1&&r.splice(s,1)}else r[0]===t&&ze(this,zp).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=HI(t);if(typeof n=="string"){const r=ze(this,zp).get(n),s=r==null?void 0:r.find(a=>a.state.status==="pending");return!s||s===t}else return!0}runNext(t){var r;const n=HI(t);if(typeof n=="string"){const s=(r=ze(this,zp).get(n))==null?void 0:r.find(a=>a!==t&&a.state.isPaused);return(s==null?void 0:s.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Jl.batch(()=>{ze(this,mg).forEach(t=>{this.notify({type:"removed",mutation:t})}),ze(this,mg).clear(),ze(this,zp).clear()})}getAll(){return Array.from(ze(this,mg))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>mme(n,r))}findAll(t={}){return this.getAll().filter(n=>mme(t,n))}notify(t){Jl.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return Jl.batch(()=>Promise.all(t.map(n=>n.continue().catch(Uh))))}},mg=new WeakMap,zp=new WeakMap,Y_=new WeakMap,_Ne);function HI(e){var t;return(t=e.options.scope)==null?void 0:t.id}function bme(e){return{onFetch:(t,n)=>{var d,f,x,g,v;const r=t.options,s=(x=(f=(d=t.fetchOptions)==null?void 0:d.meta)==null?void 0:f.fetchMore)==null?void 0:x.direction,a=((g=t.state.data)==null?void 0:g.pages)||[],o=((v=t.state.data)==null?void 0:v.pageParams)||[];let l={pages:[],pageParams:[]},c=0;const u=async()=>{let w=!1;const C=I=>{Object.defineProperty(I,"signal",{enumerable:!0,get:()=>(t.signal.aborted?w=!0:t.signal.addEventListener("abort",()=>{w=!0}),t.signal)})},N=s_e(t.options,t.fetchOptions),P=async(I,R,F)=>{if(w)return Promise.reject();if(R==null&&I.pages.length)return Promise.resolve(I);const U={client:t.client,queryKey:t.queryKey,pageParam:R,direction:F?"backward":"forward",meta:t.options.meta};C(U);const L=await N(U),{maxPages:z}=t.options,Q=F?fxt:dxt;return{pages:Q(I.pages,L,z),pageParams:Q(I.pageParams,R,z)}};if(s&&a.length){const I=s==="backward",R=I?Sxt:yme,F={pages:a,pageParams:o},U=R(r,F);l=await P(F,U,I)}else{const I=e??a.length;do{const R=c===0?o[0]??r.initialPageParam:yme(r,l);if(c>0&&R==null)break;l=await P(l,R),c++}while(c<I)}return l};t.options.persister?t.fetchFn=()=>{var w,C;return(C=(w=t.options).persister)==null?void 0:C.call(w,u,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=u}}}function yme(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function Sxt(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}var Xo,Bb,$b,A4,j4,Ub,E4,_4,kNe,Nxt=(kNe=class{constructor(e={}){Rn(this,Xo);Rn(this,Bb);Rn(this,$b);Rn(this,A4);Rn(this,j4);Rn(this,Ub);Rn(this,E4);Rn(this,_4);Wt(this,Xo,e.queryCache||new vxt),Wt(this,Bb,e.mutationCache||new Cxt),Wt(this,$b,e.defaultOptions||{}),Wt(this,A4,new Map),Wt(this,j4,new Map),Wt(this,Ub,0)}mount(){ib(this,Ub)._++,ze(this,Ub)===1&&(Wt(this,E4,Hie.subscribe(async e=>{e&&(await this.resumePausedMutations(),ze(this,Xo).onFocus())})),Wt(this,_4,uM.subscribe(async e=>{e&&(await this.resumePausedMutations(),ze(this,Xo).onOnline())})))}unmount(){var e,t;ib(this,Ub)._--,ze(this,Ub)===0&&((e=ze(this,E4))==null||e.call(this),Wt(this,E4,void 0),(t=ze(this,_4))==null||t.call(this),Wt(this,_4,void 0))}isFetching(e){return ze(this,Xo).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return ze(this,Bb).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=ze(this,Xo).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=ze(this,Xo).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(e4(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return ze(this,Xo).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),s=ze(this,Xo).get(r.queryHash),a=s==null?void 0:s.state.data,o=cxt(t,a);if(o!==void 0)return ze(this,Xo).build(this,r).setData(o,{...n,manual:!0})}setQueriesData(e,t,n){return Jl.batch(()=>ze(this,Xo).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=ze(this,Xo).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=ze(this,Xo);Jl.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=ze(this,Xo);return Jl.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=Jl.batch(()=>ze(this,Xo).findAll(e).map(s=>s.cancel(n)));return Promise.all(r).then(Uh).catch(Uh)}invalidateQueries(e,t={}){return Jl.batch(()=>(ze(this,Xo).findAll(e).forEach(n=>{n.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=Jl.batch(()=>ze(this,Xo).findAll(e).filter(s=>!s.isDisabled()).map(s=>{let a=s.fetch(void 0,n);return n.throwOnError||(a=a.catch(Uh)),s.state.fetchStatus==="paused"?Promise.resolve():a}));return Promise.all(r).then(Uh)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=ze(this,Xo).build(this,t);return n.isStaleByTime(e4(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Uh).catch(Uh)}fetchInfiniteQuery(e){return e.behavior=bme(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Uh).catch(Uh)}ensureInfiniteQueryData(e){return e.behavior=bme(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return uM.isOnline()?ze(this,Bb).resumePausedMutations():Promise.resolve()}getQueryCache(){return ze(this,Xo)}getMutationCache(){return ze(this,Bb)}getDefaultOptions(){return ze(this,$b)}setDefaultOptions(e){Wt(this,$b,e)}setQueryDefaults(e,t){ze(this,A4).set(A3(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...ze(this,A4).values()],n={};return t.forEach(r=>{sE(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){ze(this,j4).set(A3(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...ze(this,j4).values()],n={};return t.forEach(r=>{sE(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...ze(this,$b).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=$ie(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===zie&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...ze(this,$b).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){ze(this,Xo).clear(),ze(this,Bb).clear()}},Xo=new WeakMap,Bb=new WeakMap,$b=new WeakMap,A4=new WeakMap,j4=new WeakMap,Ub=new WeakMap,E4=new WeakMap,_4=new WeakMap,kNe),Ld,Zi,X_,Xu,xw,k4,zb,Hb,Q_,T4,I4,gw,bw,Vb,P4,Ma,dj,YZ,XZ,QZ,ZZ,JZ,eJ,tJ,d_e,TNe,Axt=(TNe=class extends bA{constructor(t,n){super();Rn(this,Ma);Rn(this,Ld);Rn(this,Zi);Rn(this,X_);Rn(this,Xu);Rn(this,xw);Rn(this,k4);Rn(this,zb);Rn(this,Hb);Rn(this,Q_);Rn(this,T4);Rn(this,I4);Rn(this,gw);Rn(this,bw);Rn(this,Vb);Rn(this,P4,new Set);this.options=n,Wt(this,Ld,t),Wt(this,Hb,null),Wt(this,zb,KZ()),this.options.experimental_prefetchInRender||ze(this,zb).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(ze(this,Zi).addObserver(this),vme(ze(this,Zi),this.options)?vr(this,Ma,dj).call(this):this.updateResult(),vr(this,Ma,ZZ).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return nJ(ze(this,Zi),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return nJ(ze(this,Zi),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,vr(this,Ma,JZ).call(this),vr(this,Ma,eJ).call(this),ze(this,Zi).removeObserver(this)}setOptions(t){const n=this.options,r=ze(this,Zi);if(this.options=ze(this,Ld).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Jp(this.options.enabled,ze(this,Zi))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");vr(this,Ma,tJ).call(this),ze(this,Zi).setOptions(this.options),n._defaulted&&!cM(this.options,n)&&ze(this,Ld).getQueryCache().notify({type:"observerOptionsUpdated",query:ze(this,Zi),observer:this});const s=this.hasListeners();s&&wme(ze(this,Zi),r,this.options,n)&&vr(this,Ma,dj).call(this),this.updateResult(),s&&(ze(this,Zi)!==r||Jp(this.options.enabled,ze(this,Zi))!==Jp(n.enabled,ze(this,Zi))||e4(this.options.staleTime,ze(this,Zi))!==e4(n.staleTime,ze(this,Zi)))&&vr(this,Ma,YZ).call(this);const a=vr(this,Ma,XZ).call(this);s&&(ze(this,Zi)!==r||Jp(this.options.enabled,ze(this,Zi))!==Jp(n.enabled,ze(this,Zi))||a!==ze(this,Vb))&&vr(this,Ma,QZ).call(this,a)}getOptimisticResult(t){const n=ze(this,Ld).getQueryCache().build(ze(this,Ld),t),r=this.createResult(n,t);return Ext(this,r)&&(Wt(this,Xu,r),Wt(this,k4,this.options),Wt(this,xw,ze(this,Zi).state)),r}getCurrentResult(){return ze(this,Xu)}trackResult(t,n){const r={};return Object.keys(t).forEach(s=>{Object.defineProperty(r,s,{configurable:!1,enumerable:!0,get:()=>(this.trackProp(s),n==null||n(s),t[s])})}),r}trackProp(t){ze(this,P4).add(t)}getCurrentQuery(){return ze(this,Zi)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=ze(this,Ld).defaultQueryOptions(t),r=ze(this,Ld).getQueryCache().build(ze(this,Ld),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return vr(this,Ma,dj).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),ze(this,Xu)))}createResult(t,n){var Q;const r=ze(this,Zi),s=this.options,a=ze(this,Xu),o=ze(this,xw),l=ze(this,k4),u=t!==r?t.state:ze(this,X_),{state:d}=t;let f={...d},x=!1,g;if(n._optimisticResults){const ne=this.hasListeners(),J=!ne&&vme(t,n),X=ne&&wme(t,r,n,s);(J||X)&&(f={...f,...c_e(d.data,t.options)}),n._optimisticResults==="isRestoring"&&(f.fetchStatus="idle")}let{error:v,errorUpdatedAt:w,status:C}=f;g=f.data;let N=!1;if(n.placeholderData!==void 0&&g===void 0&&C==="pending"){let ne;a!=null&&a.isPlaceholderData&&n.placeholderData===(l==null?void 0:l.placeholderData)?(ne=a.data,N=!0):ne=typeof n.placeholderData=="function"?n.placeholderData((Q=ze(this,I4))==null?void 0:Q.state.data,ze(this,I4)):n.placeholderData,ne!==void 0&&(C="success",g=GZ(a==null?void 0:a.data,ne,n),x=!0)}if(n.select&&g!==void 0&&!N)if(a&&g===(o==null?void 0:o.data)&&n.select===ze(this,Q_))g=ze(this,T4);else try{Wt(this,Q_,n.select),g=n.select(g),g=GZ(a==null?void 0:a.data,g,n),Wt(this,T4,g),Wt(this,Hb,null)}catch(ne){Wt(this,Hb,ne)}ze(this,Hb)&&(v=ze(this,Hb),g=ze(this,T4),w=Date.now(),C="error");const P=f.fetchStatus==="fetching",I=C==="pending",R=C==="error",F=I&&P,U=g!==void 0,z={status:C,fetchStatus:f.fetchStatus,isPending:I,isSuccess:C==="success",isError:R,isInitialLoading:F,isLoading:F,data:g,dataUpdatedAt:f.dataUpdatedAt,error:v,errorUpdatedAt:w,failureCount:f.fetchFailureCount,failureReason:f.fetchFailureReason,errorUpdateCount:f.errorUpdateCount,isFetched:f.dataUpdateCount>0||f.errorUpdateCount>0,isFetchedAfterMount:f.dataUpdateCount>u.dataUpdateCount||f.errorUpdateCount>u.errorUpdateCount,isFetching:P,isRefetching:P&&!I,isLoadingError:R&&!U,isPaused:f.fetchStatus==="paused",isPlaceholderData:x,isRefetchError:R&&U,isStale:Vie(t,n),refetch:this.refetch,promise:ze(this,zb)};if(this.options.experimental_prefetchInRender){const ne=re=>{z.status==="error"?re.reject(z.error):z.data!==void 0&&re.resolve(z.data)},J=()=>{const re=Wt(this,zb,z.promise=KZ());ne(re)},X=ze(this,zb);switch(X.status){case"pending":t.queryHash===r.queryHash&&ne(X);break;case"fulfilled":(z.status==="error"||z.data!==X.value)&&J();break;case"rejected":(z.status!=="error"||z.error!==X.reason)&&J();break}}return z}updateResult(){const t=ze(this,Xu),n=this.createResult(ze(this,Zi),this.options);if(Wt(this,xw,ze(this,Zi).state),Wt(this,k4,this.options),ze(this,xw).data!==void 0&&Wt(this,I4,ze(this,Zi)),cM(n,t))return;Wt(this,Xu,n);const r=()=>{if(!t)return!0;const{notifyOnChangeProps:s}=this.options,a=typeof s=="function"?s():s;if(a==="all"||!a&&!ze(this,P4).size)return!0;const o=new Set(a??ze(this,P4));return this.options.throwOnError&&o.add("error"),Object.keys(ze(this,Xu)).some(l=>{const c=l;return ze(this,Xu)[c]!==t[c]&&o.has(c)})};vr(this,Ma,d_e).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&vr(this,Ma,ZZ).call(this)}},Ld=new WeakMap,Zi=new WeakMap,X_=new WeakMap,Xu=new WeakMap,xw=new WeakMap,k4=new WeakMap,zb=new WeakMap,Hb=new WeakMap,Q_=new WeakMap,T4=new WeakMap,I4=new WeakMap,gw=new WeakMap,bw=new WeakMap,Vb=new WeakMap,P4=new WeakMap,Ma=new WeakSet,dj=function(t){vr(this,Ma,tJ).call(this);let n=ze(this,Zi).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(Uh)),n},YZ=function(){vr(this,Ma,JZ).call(this);const t=e4(this.options.staleTime,ze(this,Zi));if(N3||ze(this,Xu).isStale||!WZ(t))return;const r=r_e(ze(this,Xu).dataUpdatedAt,t)+1;Wt(this,gw,setTimeout(()=>{ze(this,Xu).isStale||this.updateResult()},r))},XZ=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(ze(this,Zi)):this.options.refetchInterval)??!1},QZ=function(t){vr(this,Ma,eJ).call(this),Wt(this,Vb,t),!(N3||Jp(this.options.enabled,ze(this,Zi))===!1||!WZ(ze(this,Vb))||ze(this,Vb)===0)&&Wt(this,bw,setInterval(()=>{(this.options.refetchIntervalInBackground||Hie.isFocused())&&vr(this,Ma,dj).call(this)},ze(this,Vb)))},ZZ=function(){vr(this,Ma,YZ).call(this),vr(this,Ma,QZ).call(this,vr(this,Ma,XZ).call(this))},JZ=function(){ze(this,gw)&&(clearTimeout(ze(this,gw)),Wt(this,gw,void 0))},eJ=function(){ze(this,bw)&&(clearInterval(ze(this,bw)),Wt(this,bw,void 0))},tJ=function(){const t=ze(this,Ld).getQueryCache().build(ze(this,Ld),this.options);if(t===ze(this,Zi))return;const n=ze(this,Zi);Wt(this,Zi,t),Wt(this,X_,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},d_e=function(t){Jl.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(ze(this,Xu))}),ze(this,Ld).getQueryCache().notify({query:ze(this,Zi),type:"observerResultsUpdated"})})},TNe);function jxt(e,t){return Jp(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function vme(e,t){return jxt(e,t)||e.state.data!==void 0&&nJ(e,t,t.refetchOnMount)}function nJ(e,t,n){if(Jp(t.enabled,e)!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&Vie(e,t)}return!1}function wme(e,t,n,r){return(e!==t||Jp(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&Vie(e,n)}function Vie(e,t){return Jp(t.enabled,e)!==!1&&e.isStaleByTime(e4(t.staleTime,e))}function Ext(e,t){return!cM(e.getCurrentResult(),t)}var Wb,qb,Dd,xg,e1,BF,rJ,INe,_xt=(INe=class extends bA{constructor(n,r){super();Rn(this,e1);Rn(this,Wb);Rn(this,qb);Rn(this,Dd);Rn(this,xg);Wt(this,Wb,n),this.setOptions(r),this.bindMethods(),vr(this,e1,BF).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var s;const r=this.options;this.options=ze(this,Wb).defaultMutationOptions(n),cM(this.options,r)||ze(this,Wb).getMutationCache().notify({type:"observerOptionsUpdated",mutation:ze(this,Dd),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&A3(r.mutationKey)!==A3(this.options.mutationKey)?this.reset():((s=ze(this,Dd))==null?void 0:s.state.status)==="pending"&&ze(this,Dd).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=ze(this,Dd))==null||n.removeObserver(this)}onMutationUpdate(n){vr(this,e1,BF).call(this),vr(this,e1,rJ).call(this,n)}getCurrentResult(){return ze(this,qb)}reset(){var n;(n=ze(this,Dd))==null||n.removeObserver(this),Wt(this,Dd,void 0),vr(this,e1,BF).call(this),vr(this,e1,rJ).call(this)}mutate(n,r){var s;return Wt(this,xg,r),(s=ze(this,Dd))==null||s.removeObserver(this),Wt(this,Dd,ze(this,Wb).getMutationCache().build(ze(this,Wb),this.options)),ze(this,Dd).addObserver(this),ze(this,Dd).execute(n)}},Wb=new WeakMap,qb=new WeakMap,Dd=new WeakMap,xg=new WeakMap,e1=new WeakSet,BF=function(){var r;const n=((r=ze(this,Dd))==null?void 0:r.state)??u_e();Wt(this,qb,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},rJ=function(n){Jl.batch(()=>{var r,s,a,o,l,c,u,d;if(ze(this,xg)&&this.hasListeners()){const f=ze(this,qb).variables,x=ze(this,qb).context;(n==null?void 0:n.type)==="success"?((s=(r=ze(this,xg)).onSuccess)==null||s.call(r,n.data,f,x),(o=(a=ze(this,xg)).onSettled)==null||o.call(a,n.data,null,f,x)):(n==null?void 0:n.type)==="error"&&((c=(l=ze(this,xg)).onError)==null||c.call(l,n.error,f,x),(d=(u=ze(this,xg)).onSettled)==null||d.call(u,void 0,n.error,f,x))}this.listeners.forEach(f=>{f(ze(this,qb))})})},INe);function kxt(e,t){return Uie(e,t)}function Txt(e){return JSON.stringify(e,(t,n)=>Ixt(n)?Object.keys(n).sort().reduce((r,s)=>(r[s]=n[s],r),{}):typeof n=="bigint"?n.toString():n)}function Ixt(e){if(!Cme(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const n=t.prototype;return!(!Cme(n)||!n.hasOwnProperty("isPrototypeOf"))}function Cme(e){return Object.prototype.toString.call(e)==="[object Object]"}function yB(e){const{_defaulted:t,behavior:n,gcTime:r,initialData:s,initialDataUpdatedAt:a,maxPages:o,meta:l,networkMode:c,queryFn:u,queryHash:d,queryKey:f,queryKeyHashFn:x,retry:g,retryDelay:v,structuralSharing:w,getPreviousPageParam:C,getNextPageParam:N,initialPageParam:P,_optimisticResults:I,enabled:R,notifyOnChangeProps:F,placeholderData:U,refetchInterval:L,refetchIntervalInBackground:z,refetchOnMount:Q,refetchOnReconnect:ne,refetchOnWindowFocus:J,retryOnMount:X,select:re,staleTime:pe,suspense:Y,throwOnError:ie,config:oe,connector:G,query:V,...ee}=e;return ee}function Pxt(e){return{mutationFn(t){return s0t(e,t)},mutationKey:["connect"]}}function Fxt(e){return{mutationFn(t){return h0t(e,t)},mutationKey:["disconnect"]}}function Oxt(e,t={}){return{async queryFn({queryKey:n}){const{address:r,scopeKey:s,...a}=n[1];if(!r)throw new Error("address is required");return await x0t(e,{...a,address:r})??null},queryKey:Mxt(t)}}function Mxt(e={}){return["balance",yB(e)]}function Rxt(e,t={}){return{async queryFn({queryKey:n}){const{name:r,scopeKey:s,...a}=n[1];if(!r)throw new Error("name is required");return b0t(e,{...a,name:r})},queryKey:Lxt(t)}}function Lxt(e={}){return["ensAvatar",yB(e)]}function Dxt(e,t={}){return{async queryFn({queryKey:n}){const{address:r,scopeKey:s,...a}=n[1];if(!r)throw new Error("address is required");return y0t(e,{...a,address:r})},queryKey:Bxt(t)}}function Bxt(e={}){return["ensName",yB(e)]}function $xt(e,t={}){return{async queryFn({queryKey:n}){const r=t.abi;if(!r)throw new Error("abi is required");const{functionName:s,scopeKey:a,...o}=n[1],l=(()=>{const c=n[1];if(c.address)return{address:c.address};if(c.code)return{code:c.code};throw new Error("address or code is required")})();if(!s)throw new Error("functionName is required");return QEe(e,{abi:r,functionName:s,args:o.args,...l,...o})},queryKey:Uxt(t)}}function Uxt(e={}){const{abi:t,...n}=e;return["readContract",yB(n)]}function zxt(e){return{mutationFn(t){return w0t(e,t)},mutationKey:["signMessage"]}}function Hxt(e){return{mutationFn(t){return C0t(e,t)},mutationKey:["signTypedData"]}}function Vxt(e){return{mutationFn(t){return N0t(e,t)},mutationKey:["switchChain"]}}function Wxt(e){return{mutationFn(t){return k0t(e,t)},mutationKey:["writeContract"]}}var f_e=m.createContext(void 0),h_e=e=>{const t=m.useContext(f_e);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},qxt=({client:e,children:t})=>(m.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),i.jsx(f_e.Provider,{value:e,children:t})),p_e=m.createContext(!1),Gxt=()=>m.useContext(p_e);p_e.Provider;function Kxt(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Yxt=m.createContext(Kxt()),Xxt=()=>m.useContext(Yxt);function m_e(e,t){return typeof e=="function"?e(...t):!!e}function sJ(){}var Qxt=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},Zxt=e=>{m.useEffect(()=>{e.clearReset()},[e])},Jxt=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:s})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(s&&e.data===void 0||m_e(n,[e.error,r])),egt=e=>{const t=e.staleTime;e.suspense&&(e.staleTime=typeof t=="function"?(...n)=>Math.max(t(...n),1e3):Math.max(t??1e3,1e3),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3)))},tgt=(e,t)=>e.isLoading&&e.isFetching&&!t,ngt=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,Sme=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function rgt(e,t,n){var f,x,g,v,w;const r=h_e(),s=Gxt(),a=Xxt(),o=r.defaultQueryOptions(e);(x=(f=r.getDefaultOptions().queries)==null?void 0:f._experimental_beforeQuery)==null||x.call(f,o),o._optimisticResults=s?"isRestoring":"optimistic",egt(o),Qxt(o,a),Zxt(a);const l=!r.getQueryCache().get(o.queryHash),[c]=m.useState(()=>new t(r,o)),u=c.getOptimisticResult(o),d=!s&&e.subscribed!==!1;if(m.useSyncExternalStore(m.useCallback(C=>{const N=d?c.subscribe(Jl.batchCalls(C)):sJ;return c.updateResult(),N},[c,d]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),m.useEffect(()=>{c.setOptions(o)},[o,c]),ngt(o,u))throw Sme(o,c,a);if(Jxt({result:u,errorResetBoundary:a,throwOnError:o.throwOnError,query:r.getQueryCache().get(o.queryHash),suspense:o.suspense}))throw u.error;if((v=(g=r.getDefaultOptions().queries)==null?void 0:g._experimental_afterQuery)==null||v.call(g,o,u),o.experimental_prefetchInRender&&!N3&&tgt(u,s)){const C=l?Sme(o,c,a):(w=r.getQueryCache().get(o.queryHash))==null?void 0:w.promise;C==null||C.catch(sJ).finally(()=>{c.updateResult()})}return o.notifyOnChangeProps?u:c.trackResult(u)}function x_e(e,t){return rgt(e,Axt)}function yA(e,t){const n=h_e(),[r]=m.useState(()=>new _xt(n,e));m.useEffect(()=>{r.setOptions(e)},[r,e]);const s=m.useSyncExternalStore(m.useCallback(o=>r.subscribe(Jl.batchCalls(o)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=m.useCallback((o,l)=>{r.mutate(o,l).catch(sJ)},[r]);if(s.error&&m_e(r.options.throwOnError,[s.error]))throw s.error;return{...s,mutate:a,mutateAsync:s.mutate}}function vB(e){const t=x_e({...e,queryKeyHashFn:Txt});return t.queryKey=e.queryKey,t}function vA(e={}){const t=Al(e);return m.useSyncExternalStore(n=>A0t(t,{onChange:n}),()=>rme(t),()=>rme(t))}function g_e(e={}){const{address:t,query:n={}}=e,r=Al(e),s=vA({config:r}),a=Oxt(r,{...e,chainId:e.chainId??s}),o=!!(t&&(n.enabled??!0));return vB({...n,...a,enabled:o})}function sgt(e={}){const t=Al(e);return m.useSyncExternalStore(n=>rxt(t,{onChange:n}),()=>sme(t),()=>sme(t))}function igt(e={}){const t=Al(e);return m.useSyncExternalStore(n=>E0t(t,{onChange:n}),()=>ime(t),()=>ime(t))}function agt(e={}){const{mutation:t}=e,n=Al(e),r=Pxt(n),{mutate:s,mutateAsync:a,...o}=yA({...t,...r});return m.useEffect(()=>n.subscribe(({status:l})=>l,(l,c)=>{c==="connected"&&l==="disconnected"&&o.reset()}),[n,o.reset]),{...o,connect:s,connectAsync:a,connectors:igt({config:n})}}function ogt(e={}){const t=Al(e);return m.useSyncExternalStore(n=>j0t(t,{onChange:n}),()=>UZ(t),()=>UZ(t))}function wB(e={}){const{mutation:t}=e,n=Al(e),r=Fxt(n),{mutate:s,mutateAsync:a,...o}=yA({...t,...r});return{...o,connectors:ogt({config:n}).map(l=>l.connector),disconnect:s,disconnectAsync:a}}function lgt(e={}){const{name:t,query:n={}}=e,r=Al(e),s=vA({config:r}),a=Rxt(r,{...e,chainId:e.chainId??s}),o=!!(t&&(n.enabled??!0));return vB({...n,...a,enabled:o})}function cgt(e={}){const{address:t,query:n={}}=e,r=Al(e),s=vA({config:r}),a=Dxt(r,{...e,chainId:e.chainId??s}),o=!!(t&&(n.enabled??!0));return vB({...n,...a,enabled:o})}function b_e(e={}){const t=Al(e);return t_e.useSyncExternalStoreWithSelector(n=>_0t(t,{onChange:n}),()=>zZ(t,e),()=>zZ(t,e),n=>n,(n,r)=>(n==null?void 0:n.uid)===(r==null?void 0:r.uid))}function Nme(e={}){const{abi:t,address:n,functionName:r,query:s={}}=e,a=e.code,o=Al(e),l=vA({config:o}),c=$xt(o,{...e,chainId:e.chainId??l}),u=!!((n||a)&&t&&r&&(s.enabled??!0));return vB({...s,...c,enabled:u,structuralSharing:s.structuralSharing??kxt})}function y_e(e={}){const{mutation:t}=e,n=Al(e),r=zxt(n),{mutate:s,mutateAsync:a,...o}=yA({...t,...r});return{...o,signMessage:s,signMessageAsync:a}}function ugt(e={}){const{mutation:t}=e,n=Al(e),r=Hxt(n),{mutate:s,mutateAsync:a,...o}=yA({...t,...r});return{...o,signTypedData:s,signTypedDataAsync:a}}function Wie(e={}){const{mutation:t}=e,n=Al(e),r=Vxt(n),{mutate:s,mutateAsync:a,...o}=yA({...t,...r});return{...o,chains:sgt({config:n}),switchChain:s,switchChainAsync:a}}function dgt(e={}){const{mutation:t}=e,n=Al(e),r=Wxt(n),{mutate:s,mutateAsync:a,...o}=yA({...t,...r});return{...o,writeContract:s,writeContractAsync:a}}const J0=Object.create(null);J0.open="0";J0.close="1";J0.ping="2";J0.pong="3";J0.message="4";J0.upgrade="5";J0.noop="6";const $F=Object.create(null);Object.keys(J0).forEach(e=>{$F[J0[e]]=e});const iJ={type:"error",data:"parser error"},v_e=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",w_e=typeof ArrayBuffer=="function",C_e=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,qie=({type:e,data:t},n,r)=>v_e&&t instanceof Blob?n?r(t):Ame(t,r):w_e&&(t instanceof ArrayBuffer||C_e(t))?n?r(t):Ame(new Blob([t]),r):r(J0[e]+(t||"")),Ame=(e,t)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];t("b"+(r||""))},n.readAsDataURL(e)};function jme(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let SH;function fgt(e,t){if(v_e&&e.data instanceof Blob)return e.data.arrayBuffer().then(jme).then(t);if(w_e&&(e.data instanceof ArrayBuffer||C_e(e.data)))return t(jme(e.data));qie(e,!1,n=>{SH||(SH=new TextEncoder),t(SH.encode(n))})}const Eme="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",fj=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<Eme.length;e++)fj[Eme.charCodeAt(e)]=e;const hgt=e=>{let t=e.length*.75,n=e.length,r,s=0,a,o,l,c;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);const u=new ArrayBuffer(t),d=new Uint8Array(u);for(r=0;r<n;r+=4)a=fj[e.charCodeAt(r)],o=fj[e.charCodeAt(r+1)],l=fj[e.charCodeAt(r+2)],c=fj[e.charCodeAt(r+3)],d[s++]=a<<2|o>>4,d[s++]=(o&15)<<4|l>>2,d[s++]=(l&3)<<6|c&63;return u},pgt=typeof ArrayBuffer=="function",Gie=(e,t)=>{if(typeof e!="string")return{type:"message",data:S_e(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:mgt(e.substring(1),t)}:$F[n]?e.length>1?{type:$F[n],data:e.substring(1)}:{type:$F[n]}:iJ},mgt=(e,t)=>{if(pgt){const n=hgt(e);return S_e(n,t)}else return{base64:!0,data:e}},S_e=(e,t)=>{switch(t){case"blob":return e instanceof Blob?e:new Blob([e]);case"arraybuffer":default:return e instanceof ArrayBuffer?e:e.buffer}},N_e="",xgt=(e,t)=>{const n=e.length,r=new Array(n);let s=0;e.forEach((a,o)=>{qie(a,!1,l=>{r[o]=l,++s===n&&t(r.join(N_e))})})},ggt=(e,t)=>{const n=e.split(N_e),r=[];for(let s=0;s<n.length;s++){const a=Gie(n[s],t);if(r.push(a),a.type==="error")break}return r};function bgt(){return new TransformStream({transform(e,t){fgt(e,n=>{const r=n.length;let s;if(r<126)s=new Uint8Array(1),new DataView(s.buffer).setUint8(0,r);else if(r<65536){s=new Uint8Array(3);const a=new DataView(s.buffer);a.setUint8(0,126),a.setUint16(1,r)}else{s=new Uint8Array(9);const a=new DataView(s.buffer);a.setUint8(0,127),a.setBigUint64(1,BigInt(r))}e.data&&typeof e.data!="string"&&(s[0]|=128),t.enqueue(s),t.enqueue(n)})}})}let NH;function VI(e){return e.reduce((t,n)=>t+n.length,0)}function WI(e,t){if(e[0].length===t)return e.shift();const n=new Uint8Array(t);let r=0;for(let s=0;s<t;s++)n[s]=e[0][r++],r===e[0].length&&(e.shift(),r=0);return e.length&&r<e[0].length&&(e[0]=e[0].slice(r)),n}function ygt(e,t){NH||(NH=new TextDecoder);const n=[];let r=0,s=-1,a=!1;return new TransformStream({transform(o,l){for(n.push(o);;){if(r===0){if(VI(n)<1)break;const c=WI(n,1);a=(c[0]&128)===128,s=c[0]&127,s<126?r=3:s===126?r=1:r=2}else if(r===1){if(VI(n)<2)break;const c=WI(n,2);s=new DataView(c.buffer,c.byteOffset,c.length).getUint16(0),r=3}else if(r===2){if(VI(n)<8)break;const c=WI(n,8),u=new DataView(c.buffer,c.byteOffset,c.length),d=u.getUint32(0);if(d>Math.pow(2,21)-1){l.enqueue(iJ);break}s=d*Math.pow(2,32)+u.getUint32(4),r=3}else{if(VI(n)<s)break;const c=WI(n,s);l.enqueue(Gie(a?c:NH.decode(c),t)),r=0}if(s===0||s>e){l.enqueue(iJ);break}}}})}const A_e=4;function Ul(e){if(e)return vgt(e)}function vgt(e){for(var t in Ul.prototype)e[t]=Ul.prototype[t];return e}Ul.prototype.on=Ul.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this};Ul.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this};Ul.prototype.off=Ul.prototype.removeListener=Ul.prototype.removeAllListeners=Ul.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var n=this._callbacks["$"+e];if(!n)return this;if(arguments.length==1)return delete this._callbacks["$"+e],this;for(var r,s=0;s<n.length;s++)if(r=n[s],r===t||r.fn===t){n.splice(s,1);break}return n.length===0&&delete this._callbacks["$"+e],this};Ul.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),n=this._callbacks["$"+e],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(n){n=n.slice(0);for(var r=0,s=n.length;r<s;++r)n[r].apply(this,t)}return this};Ul.prototype.emitReserved=Ul.prototype.emit;Ul.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]};Ul.prototype.hasListeners=function(e){return!!this.listeners(e).length};const CB=typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,n)=>n(t,0),qh=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),wgt="arraybuffer";function j_e(e,...t){return t.reduce((n,r)=>(e.hasOwnProperty(r)&&(n[r]=e[r]),n),{})}const Cgt=qh.setTimeout,Sgt=qh.clearTimeout;function SB(e,t){t.useNativeTimers?(e.setTimeoutFn=Cgt.bind(qh),e.clearTimeoutFn=Sgt.bind(qh)):(e.setTimeoutFn=qh.setTimeout.bind(qh),e.clearTimeoutFn=qh.clearTimeout.bind(qh))}const Ngt=1.33;function Agt(e){return typeof e=="string"?jgt(e):Math.ceil((e.byteLength||e.size)*Ngt)}function jgt(e){let t=0,n=0;for(let r=0,s=e.length;r<s;r++)t=e.charCodeAt(r),t<128?n+=1:t<2048?n+=2:t<55296||t>=57344?n+=3:(r++,n+=4);return n}function E_e(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function Egt(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}function _gt(e){let t={},n=e.split("&");for(let r=0,s=n.length;r<s;r++){let a=n[r].split("=");t[decodeURIComponent(a[0])]=decodeURIComponent(a[1])}return t}class kgt extends Error{constructor(t,n,r){super(t),this.description=n,this.context=r,this.type="TransportError"}}let Kie=class extends Ul{constructor(t){super(),this.writable=!1,SB(this,t),this.opts=t,this.query=t.query,this.socket=t.socket,this.supportsBinary=!t.forceBase64}onError(t,n,r){return super.emitReserved("error",new kgt(t,n,r)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(t){this.readyState==="open"&&this.write(t)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(t){const n=Gie(t,this.socket.binaryType);this.onPacket(n)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}pause(t){}createUri(t,n={}){return t+"://"+this._hostname()+this._port()+this.opts.path+this._query(n)}_hostname(){const t=this.opts.hostname;return t.indexOf(":")===-1?t:"["+t+"]"}_port(){return this.opts.port&&(this.opts.secure&&+(this.opts.port!==443)||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(t){const n=Egt(t);return n.length?"?"+n:""}};class Tgt extends Kie{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(t){this.readyState="pausing";const n=()=>{this.readyState="paused",t()};if(this._polling||!this.writable){let r=0;this._polling&&(r++,this.once("pollComplete",function(){--r||n()})),this.writable||(r++,this.once("drain",function(){--r||n()}))}else n()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){const n=r=>{if(this.readyState==="opening"&&r.type==="open"&&this.onOpen(),r.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(r)};ggt(t,this.socket.binaryType).forEach(n),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const t=()=>{this.write([{type:"close"}])};this.readyState==="open"?t():this.once("open",t)}write(t){this.writable=!1,xgt(t,n=>{this.doWrite(n,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const t=this.opts.secure?"https":"http",n=this.query||{};return this.opts.timestampRequests!==!1&&(n[this.opts.timestampParam]=E_e()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(t,n)}}let __e=!1;try{__e=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const Igt=__e;function Pgt(){}class Fgt extends Tgt{constructor(t){if(super(t),typeof location<"u"){const n=location.protocol==="https:";let r=location.port;r||(r=n?"443":"80"),this.xd=typeof location<"u"&&t.hostname!==location.hostname||r!==t.port}}doWrite(t,n){const r=this.request({method:"POST",data:t});r.on("success",n),r.on("error",(s,a)=>{this.onError("xhr post error",s,a)})}doPoll(){const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(n,r)=>{this.onError("xhr poll error",n,r)}),this.pollXhr=t}}let t4=class UF extends Ul{constructor(t,n,r){super(),this.createRequest=t,SB(this,r),this._opts=r,this._method=r.method||"GET",this._uri=n,this._data=r.data!==void 0?r.data:null,this._create()}_create(){var t;const n=j_e(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");n.xdomain=!!this._opts.xd;const r=this._xhr=this.createRequest(n);try{r.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0);for(let s in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(s)&&r.setRequestHeader(s,this._opts.extraHeaders[s])}}catch{}if(this._method==="POST")try{r.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{r.setRequestHeader("Accept","*/*")}catch{}(t=this._opts.cookieJar)===null||t===void 0||t.addCookies(r),"withCredentials"in r&&(r.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(r.timeout=this._opts.requestTimeout),r.onreadystatechange=()=>{var s;r.readyState===3&&((s=this._opts.cookieJar)===null||s===void 0||s.parseCookies(r.getResponseHeader("set-cookie"))),r.readyState===4&&(r.status===200||r.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof r.status=="number"?r.status:0)},0))},r.send(this._data)}catch(s){this.setTimeoutFn(()=>{this._onError(s)},0);return}typeof document<"u"&&(this._index=UF.requestsCount++,UF.requests[this._index]=this)}_onError(t){this.emitReserved("error",t,this._xhr),this._cleanup(!0)}_cleanup(t){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=Pgt,t)try{this._xhr.abort()}catch{}typeof document<"u"&&delete UF.requests[this._index],this._xhr=null}}_onLoad(){const t=this._xhr.responseText;t!==null&&(this.emitReserved("data",t),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}};t4.requestsCount=0;t4.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",_me);else if(typeof addEventListener=="function"){const e="onpagehide"in qh?"pagehide":"unload";addEventListener(e,_me,!1)}}function _me(){for(let e in t4.requests)t4.requests.hasOwnProperty(e)&&t4.requests[e].abort()}const Ogt=function(){const e=k_e({xdomain:!1});return e&&e.responseType!==null}();class Mgt extends Fgt{constructor(t){super(t);const n=t&&t.forceBase64;this.supportsBinary=Ogt&&!n}request(t={}){return Object.assign(t,{xd:this.xd},this.opts),new t4(k_e,this.uri(),t)}}function k_e(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||Igt))return new XMLHttpRequest}catch{}if(!t)try{return new qh[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const T_e=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class Rgt extends Kie{get name(){return"websocket"}doOpen(){const t=this.uri(),n=this.opts.protocols,r=T_e?{}:j_e(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(t,n,r)}catch(s){return this.emitReserved("error",s)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],s=n===t.length-1;qie(r,this.supportsBinary,a=>{try{this.doWrite(r,a)}catch{}s&&CB(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.close(),this.ws=null)}uri(){const t=this.opts.secure?"wss":"ws",n=this.query||{};return this.opts.timestampRequests&&(n[this.opts.timestampParam]=E_e()),this.supportsBinary||(n.b64=1),this.createUri(t,n)}}const AH=qh.WebSocket||qh.MozWebSocket;let Lgt=class extends Rgt{createSocket(t,n,r){return T_e?new AH(t,n,r):n?new AH(t,n):new AH(t)}doWrite(t,n){this.ws.send(n)}};class Dgt extends Kie{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(t){return this.emitReserved("error",t)}this._transport.closed.then(()=>{this.onClose()}).catch(t=>{this.onError("webtransport error",t)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(t=>{const n=ygt(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=t.readable.pipeThrough(n).getReader(),s=bgt();s.readable.pipeTo(t.writable),this._writer=s.writable.getWriter();const a=()=>{r.read().then(({done:l,value:c})=>{l||(this.onPacket(c),a())}).catch(l=>{})};a();const o={type:"open"};this.query.sid&&(o.data=`{"sid":"${this.query.sid}"}`),this._writer.write(o).then(()=>this.onOpen())})})}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],s=n===t.length-1;this._writer.write(r).then(()=>{s&&CB(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this._transport)===null||t===void 0||t.close()}}const Bgt={websocket:Lgt,webtransport:Dgt,polling:Mgt},$gt=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,Ugt=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function aJ(e){if(e.length>8e3)throw"URI too long";const t=e,n=e.indexOf("["),r=e.indexOf("]");n!=-1&&r!=-1&&(e=e.substring(0,n)+e.substring(n,r).replace(/:/g,";")+e.substring(r,e.length));let s=$gt.exec(e||""),a={},o=14;for(;o--;)a[Ugt[o]]=s[o]||"";return n!=-1&&r!=-1&&(a.source=t,a.host=a.host.substring(1,a.host.length-1).replace(/;/g,":"),a.authority=a.authority.replace("[","").replace("]","").replace(/;/g,":"),a.ipv6uri=!0),a.pathNames=zgt(a,a.path),a.queryKey=Hgt(a,a.query),a}function zgt(e,t){const n=/\/{2,9}/g,r=t.replace(n,"/").split("/");return(t.slice(0,1)=="/"||t.length===0)&&r.splice(0,1),t.slice(-1)=="/"&&r.splice(r.length-1,1),r}function Hgt(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,s,a){s&&(n[s]=a)}),n}const oJ=typeof addEventListener=="function"&&typeof removeEventListener=="function",zF=[];oJ&&addEventListener("offline",()=>{zF.forEach(e=>e())},!1);class Sy extends Ul{constructor(t,n){if(super(),this.binaryType=wgt,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,t&&typeof t=="object"&&(n=t,t=null),t){const r=aJ(t);n.hostname=r.host,n.secure=r.protocol==="https"||r.protocol==="wss",n.port=r.port,r.query&&(n.query=r.query)}else n.host&&(n.hostname=aJ(n.host).host);SB(this,n),this.secure=n.secure!=null?n.secure:typeof location<"u"&&location.protocol==="https:",n.hostname&&!n.port&&(n.port=this.secure?"443":"80"),this.hostname=n.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=n.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},n.transports.forEach(r=>{const s=r.prototype.name;this.transports.push(s),this._transportsByName[s]=r}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},n),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=_gt(this.opts.query)),oJ&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},zF.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(t){const n=Object.assign({},this.opts.query);n.EIO=A_e,n.transport=t,this.id&&(n.sid=this.id);const r=Object.assign({},this.opts,{query:n,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[t]);return new this._transportsByName[t](r)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const t=this.opts.rememberUpgrade&&Sy.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const n=this.createTransport(t);n.open(),this.setTransport(n)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",n=>this._onClose("transport close",n))}onOpen(){this.readyState="open",Sy.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",t),this.emitReserved("heartbeat"),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const n=new Error("server error");n.code=t.data,this._onError(n);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data);break}}onHandshake(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this._pingInterval=t.pingInterval,this._pingTimeout=t.pingTimeout,this._maxPayload=t.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const t=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+t,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},t),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const t=this._getWritablePackets();this.transport.send(t),this._prevBufferLen=t.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let n=1;for(let r=0;r<this.writeBuffer.length;r++){const s=this.writeBuffer[r].data;if(s&&(n+=Agt(s)),r>0&&n>this._maxPayload)return this.writeBuffer.slice(0,r);n+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const t=Date.now()>this._pingTimeoutTime;return t&&(this._pingTimeoutTime=0,CB(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),t}write(t,n,r){return this._sendPacket("message",t,n,r),this}send(t,n,r){return this._sendPacket("message",t,n,r),this}_sendPacket(t,n,r,s){if(typeof n=="function"&&(s=n,n=void 0),typeof r=="function"&&(s=r,r=null),this.readyState==="closing"||this.readyState==="closed")return;r=r||{},r.compress=r.compress!==!1;const a={type:t,data:n,options:r};this.emitReserved("packetCreate",a),this.writeBuffer.push(a),s&&this.once("flush",s),this.flush()}close(){const t=()=>{this._onClose("forced close"),this.transport.close()},n=()=>{this.off("upgrade",n),this.off("upgradeError",n),t()},r=()=>{this.once("upgrade",n),this.once("upgradeError",n)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():t()}):this.upgrading?r():t()),this}_onError(t){if(Sy.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",t),this._onClose("transport error",t)}_onClose(t,n){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),oJ&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const r=zF.indexOf(this._offlineEventListener);r!==-1&&zF.splice(r,1)}this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this._prevBufferLen=0}}}Sy.protocol=A_e;class Vgt extends Sy{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let t=0;t<this._upgrades.length;t++)this._probe(this._upgrades[t])}_probe(t){let n=this.createTransport(t),r=!1;Sy.priorWebsocketSuccess=!1;const s=()=>{r||(n.send([{type:"ping",data:"probe"}]),n.once("packet",f=>{if(!r)if(f.type==="pong"&&f.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;Sy.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{r||this.readyState!=="closed"&&(d(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const x=new Error("probe error");x.transport=n.name,this.emitReserved("upgradeError",x)}}))};function a(){r||(r=!0,d(),n.close(),n=null)}const o=f=>{const x=new Error("probe error: "+f);x.transport=n.name,a(),this.emitReserved("upgradeError",x)};function l(){o("transport closed")}function c(){o("socket closed")}function u(f){n&&f.name!==n.name&&a()}const d=()=>{n.removeListener("open",s),n.removeListener("error",o),n.removeListener("close",l),this.off("close",c),this.off("upgrading",u)};n.once("open",s),n.once("error",o),n.once("close",l),this.once("close",c),this.once("upgrading",u),this._upgrades.indexOf("webtransport")!==-1&&t!=="webtransport"?this.setTimeoutFn(()=>{r||n.open()},200):n.open()}onHandshake(t){this._upgrades=this._filterUpgrades(t.upgrades),super.onHandshake(t)}_filterUpgrades(t){const n=[];for(let r=0;r<t.length;r++)~this.transports.indexOf(t[r])&&n.push(t[r]);return n}}let Wgt=class extends Vgt{constructor(t,n={}){const r=typeof t=="object"?t:n;(!r.transports||r.transports&&typeof r.transports[0]=="string")&&(r.transports=(r.transports||["polling","websocket","webtransport"]).map(s=>Bgt[s]).filter(s=>!!s)),super(t,r)}};function qgt(e,t="",n){let r=e;n=n||typeof location<"u"&&location,e==null&&(e=n.protocol+"//"+n.host),typeof e=="string"&&(e.charAt(0)==="/"&&(e.charAt(1)==="/"?e=n.protocol+e:e=n.host+e),/^(https?|wss?):\/\//.test(e)||(typeof n<"u"?e=n.protocol+"//"+e:e="https://"+e),r=aJ(e)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";const a=r.host.indexOf(":")!==-1?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+a+":"+r.port+t,r.href=r.protocol+"://"+a+(n&&n.port===r.port?"":":"+r.port),r}const Ggt=typeof ArrayBuffer=="function",Kgt=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,I_e=Object.prototype.toString,Ygt=typeof Blob=="function"||typeof Blob<"u"&&I_e.call(Blob)==="[object BlobConstructor]",Xgt=typeof File=="function"||typeof File<"u"&&I_e.call(File)==="[object FileConstructor]";function Yie(e){return Ggt&&(e instanceof ArrayBuffer||Kgt(e))||Ygt&&e instanceof Blob||Xgt&&e instanceof File}function HF(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,r=e.length;n<r;n++)if(HF(e[n]))return!0;return!1}if(Yie(e))return!0;if(e.toJSON&&typeof e.toJSON=="function"&&arguments.length===1)return HF(e.toJSON(),!0);for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&HF(e[n]))return!0;return!1}function Qgt(e){const t=[],n=e.data,r=e;return r.data=lJ(n,t),r.attachments=t.length,{packet:r,buffers:t}}function lJ(e,t){if(!e)return e;if(Yie(e)){const n={_placeholder:!0,num:t.length};return t.push(e),n}else if(Array.isArray(e)){const n=new Array(e.length);for(let r=0;r<e.length;r++)n[r]=lJ(e[r],t);return n}else if(typeof e=="object"&&!(e instanceof Date)){const n={};for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=lJ(e[r],t));return n}return e}function Zgt(e,t){return e.data=cJ(e.data,t),delete e.attachments,e}function cJ(e,t){if(!e)return e;if(e&&e._placeholder===!0){if(typeof e.num=="number"&&e.num>=0&&e.num<t.length)return t[e.num];throw new Error("illegal attachments")}else if(Array.isArray(e))for(let n=0;n<e.length;n++)e[n]=cJ(e[n],t);else if(typeof e=="object")for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=cJ(e[n],t));return e}const Jgt=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],e1t=5;var Ji;(function(e){e[e.CONNECT=0]="CONNECT",e[e.DISCONNECT=1]="DISCONNECT",e[e.EVENT=2]="EVENT",e[e.ACK=3]="ACK",e[e.CONNECT_ERROR=4]="CONNECT_ERROR",e[e.BINARY_EVENT=5]="BINARY_EVENT",e[e.BINARY_ACK=6]="BINARY_ACK"})(Ji||(Ji={}));let t1t=class{constructor(t){this.replacer=t}encode(t){return(t.type===Ji.EVENT||t.type===Ji.ACK)&&HF(t)?this.encodeAsBinary({type:t.type===Ji.EVENT?Ji.BINARY_EVENT:Ji.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id}):[this.encodeAsString(t)]}encodeAsString(t){let n=""+t.type;return(t.type===Ji.BINARY_EVENT||t.type===Ji.BINARY_ACK)&&(n+=t.attachments+"-"),t.nsp&&t.nsp!=="/"&&(n+=t.nsp+","),t.id!=null&&(n+=t.id),t.data!=null&&(n+=JSON.stringify(t.data,this.replacer)),n}encodeAsBinary(t){const n=Qgt(t),r=this.encodeAsString(n.packet),s=n.buffers;return s.unshift(r),s}};function kme(e){return Object.prototype.toString.call(e)==="[object Object]"}class Xie extends Ul{constructor(t){super(),this.reviver=t}add(t){let n;if(typeof t=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");n=this.decodeString(t);const r=n.type===Ji.BINARY_EVENT;r||n.type===Ji.BINARY_ACK?(n.type=r?Ji.EVENT:Ji.ACK,this.reconstructor=new n1t(n),n.attachments===0&&super.emitReserved("decoded",n)):super.emitReserved("decoded",n)}else if(Yie(t)||t.base64)if(this.reconstructor)n=this.reconstructor.takeBinaryData(t),n&&(this.reconstructor=null,super.emitReserved("decoded",n));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+t)}decodeString(t){let n=0;const r={type:Number(t.charAt(0))};if(Ji[r.type]===void 0)throw new Error("unknown packet type "+r.type);if(r.type===Ji.BINARY_EVENT||r.type===Ji.BINARY_ACK){const a=n+1;for(;t.charAt(++n)!=="-"&&n!=t.length;);const o=t.substring(a,n);if(o!=Number(o)||t.charAt(n)!=="-")throw new Error("Illegal attachments");r.attachments=Number(o)}if(t.charAt(n+1)==="/"){const a=n+1;for(;++n&&!(t.charAt(n)===","||n===t.length););r.nsp=t.substring(a,n)}else r.nsp="/";const s=t.charAt(n+1);if(s!==""&&Number(s)==s){const a=n+1;for(;++n;){const o=t.charAt(n);if(o==null||Number(o)!=o){--n;break}if(n===t.length)break}r.id=Number(t.substring(a,n+1))}if(t.charAt(++n)){const a=this.tryParse(t.substr(n));if(Xie.isPayloadValid(r.type,a))r.data=a;else throw new Error("invalid payload")}return r}tryParse(t){try{return JSON.parse(t,this.reviver)}catch{return!1}}static isPayloadValid(t,n){switch(t){case Ji.CONNECT:return kme(n);case Ji.DISCONNECT:return n===void 0;case Ji.CONNECT_ERROR:return typeof n=="string"||kme(n);case Ji.EVENT:case Ji.BINARY_EVENT:return Array.isArray(n)&&(typeof n[0]=="number"||typeof n[0]=="string"&&Jgt.indexOf(n[0])===-1);case Ji.ACK:case Ji.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class n1t{constructor(t){this.packet=t,this.buffers=[],this.reconPack=t}takeBinaryData(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){const n=Zgt(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const r1t=Object.freeze(Object.defineProperty({__proto__:null,Decoder:Xie,Encoder:t1t,get PacketType(){return Ji},protocol:e1t},Symbol.toStringTag,{value:"Module"}));function Kp(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const s1t=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class P_e extends Ul{constructor(t,n,r){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=t,this.nsp=n,r&&r.auth&&(this.auth=r.auth),this._opts=Object.assign({},r),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const t=this.io;this.subs=[Kp(t,"open",this.onopen.bind(this)),Kp(t,"packet",this.onpacket.bind(this)),Kp(t,"error",this.onerror.bind(this)),Kp(t,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...n){var r,s,a;if(s1t.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');if(n.unshift(t),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(n),this;const o={type:Ji.EVENT,data:n};if(o.options={},o.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const d=this.ids++,f=n.pop();this._registerAckCallback(d,f),o.id=d}const l=(s=(r=this.io.engine)===null||r===void 0?void 0:r.transport)===null||s===void 0?void 0:s.writable,c=this.connected&&!(!((a=this.io.engine)===null||a===void 0)&&a._hasPingExpired());return this.flags.volatile&&!l||(c?(this.notifyOutgoingListeners(o),this.packet(o)):this.sendBuffer.push(o)),this.flags={},this}_registerAckCallback(t,n){var r;const s=(r=this.flags.timeout)!==null&&r!==void 0?r:this._opts.ackTimeout;if(s===void 0){this.acks[t]=n;return}const a=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let l=0;l<this.sendBuffer.length;l++)this.sendBuffer[l].id===t&&this.sendBuffer.splice(l,1);n.call(this,new Error("operation has timed out"))},s),o=(...l)=>{this.io.clearTimeoutFn(a),n.apply(this,l)};o.withError=!0,this.acks[t]=o}emitWithAck(t,...n){return new Promise((r,s)=>{const a=(o,l)=>o?s(o):r(l);a.withError=!0,n.push(a),this.emit(t,...n)})}_addToQueue(t){let n;typeof t[t.length-1]=="function"&&(n=t.pop());const r={id:this._queueSeq++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push((s,...a)=>r!==this._queue[0]?void 0:(s!==null?r.tryCount>this._opts.retries&&(this._queue.shift(),n&&n(s)):(this._queue.shift(),n&&n(null,...a)),r.pending=!1,this._drainQueue())),this._queue.push(r),this._drainQueue()}_drainQueue(t=!1){if(!this.connected||this._queue.length===0)return;const n=this._queue[0];n.pending&&!t||(n.pending=!0,n.tryCount++,this.flags=n.flags,this.emit.apply(this,n.args))}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){typeof this.auth=="function"?this.auth(t=>{this._sendConnectPacket(t)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(t){this.packet({type:Ji.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},t):t})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,n){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,n),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(t=>{if(!this.sendBuffer.some(r=>String(r.id)===t)){const r=this.acks[t];delete this.acks[t],r.withError&&r.call(this,new Error("socket has been disconnected"))}})}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case Ji.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case Ji.EVENT:case Ji.BINARY_EVENT:this.onevent(t);break;case Ji.ACK:case Ji.BINARY_ACK:this.onack(t);break;case Ji.DISCONNECT:this.ondisconnect();break;case Ji.CONNECT_ERROR:this.destroy();const r=new Error(t.data.message);r.data=t.data.data,this.emitReserved("connect_error",r);break}}onevent(t){const n=t.data||[];t.id!=null&&n.push(this.ack(t.id)),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const n=this._anyListeners.slice();for(const r of n)r.apply(this,t)}super.emit.apply(this,t),this._pid&&t.length&&typeof t[t.length-1]=="string"&&(this._lastOffset=t[t.length-1])}ack(t){const n=this;let r=!1;return function(...s){r||(r=!0,n.packet({type:Ji.ACK,id:t,data:s}))}}onack(t){const n=this.acks[t.id];typeof n=="function"&&(delete this.acks[t.id],n.withError&&t.data.unshift(null),n.apply(this,t.data))}onconnect(t,n){this.id=t,this.recovered=n&&this._pid===n,this._pid=n,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:Ji.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){const n=this._anyListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(t),this}prependAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(t),this}offAnyOutgoing(t){if(!this._anyOutgoingListeners)return this;if(t){const n=this._anyOutgoingListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(t){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const n=this._anyOutgoingListeners.slice();for(const r of n)r.apply(this,t.data)}}}function wA(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}wA.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=Math.floor(t*10)&1?e+n:e-n}return Math.min(e,this.max)|0};wA.prototype.reset=function(){this.attempts=0};wA.prototype.setMin=function(e){this.ms=e};wA.prototype.setMax=function(e){this.max=e};wA.prototype.setJitter=function(e){this.jitter=e};class uJ extends Ul{constructor(t,n){var r;super(),this.nsps={},this.subs=[],t&&typeof t=="object"&&(n=t,t=void 0),n=n||{},n.path=n.path||"/socket.io",this.opts=n,SB(this,n),this.reconnection(n.reconnection!==!1),this.reconnectionAttempts(n.reconnectionAttempts||1/0),this.reconnectionDelay(n.reconnectionDelay||1e3),this.reconnectionDelayMax(n.reconnectionDelayMax||5e3),this.randomizationFactor((r=n.randomizationFactor)!==null&&r!==void 0?r:.5),this.backoff=new wA({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=t;const s=n.parser||r1t;this.encoder=new s.Encoder,this.decoder=new s.Decoder,this._autoConnect=n.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,t||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(t){return t===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var n;return t===void 0?this._reconnectionDelay:(this._reconnectionDelay=t,(n=this.backoff)===null||n===void 0||n.setMin(t),this)}randomizationFactor(t){var n;return t===void 0?this._randomizationFactor:(this._randomizationFactor=t,(n=this.backoff)===null||n===void 0||n.setJitter(t),this)}reconnectionDelayMax(t){var n;return t===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,(n=this.backoff)===null||n===void 0||n.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(t){if(~this._readyState.indexOf("open"))return this;this.engine=new Wgt(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const s=Kp(n,"open",function(){r.onopen(),t&&t()}),a=l=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",l),t?t(l):this.maybeReconnectOnOpen()},o=Kp(n,"error",a);if(this._timeout!==!1){const l=this._timeout,c=this.setTimeoutFn(()=>{s(),a(new Error("timeout")),n.close()},l);this.opts.autoUnref&&c.unref(),this.subs.push(()=>{this.clearTimeoutFn(c)})}return this.subs.push(s),this.subs.push(o),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(Kp(t,"ping",this.onping.bind(this)),Kp(t,"data",this.ondata.bind(this)),Kp(t,"error",this.onerror.bind(this)),Kp(t,"close",this.onclose.bind(this)),Kp(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(n){this.onclose("parse error",n)}}ondecoded(t){CB(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,n){let r=this.nsps[t];return r?this._autoConnect&&!r.active&&r.connect():(r=new P_e(this,t,n),this.nsps[t]=r),r}_destroy(t){const n=Object.keys(this.nsps);for(const r of n)if(this.nsps[r].active)return;this._close()}_packet(t){const n=this.encoder.encode(t);for(let r=0;r<n.length;r++)this.engine.write(n[r],t.options)}cleanup(){this.subs.forEach(t=>t()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(t,n){var r;this.cleanup(),(r=this.engine)===null||r===void 0||r.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,n),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const n=this.backoff.duration();this._reconnecting=!0;const r=this.setTimeoutFn(()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),!t.skipReconnect&&t.open(s=>{s?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",s)):t.onreconnect()}))},n);this.opts.autoUnref&&r.unref(),this.subs.push(()=>{this.clearTimeoutFn(r)})}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}const v7={};function Ny(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=qgt(e,t.path||"/socket.io"),r=n.source,s=n.id,a=n.path,o=v7[s]&&a in v7[s].nsps,l=t.forceNew||t["force new connection"]||t.multiplex===!1||o;let c;return l?c=new uJ(r,t):(v7[s]||(v7[s]=new uJ(r,t)),c=v7[s]),n.query&&!t.query&&(t.query=n.queryKey),c.socket(n.path,t)}Object.assign(Ny,{Manager:uJ,Socket:P_e,io:Ny,connect:Ny});function F_e(e,t){return function(){return e.apply(t,arguments)}}const{toString:i1t}=Object.prototype,{getPrototypeOf:Qie}=Object,NB=(e=>t=>{const n=i1t.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),Am=e=>(e=e.toLowerCase(),t=>NB(t)===e),AB=e=>t=>typeof t===e,{isArray:CA}=Array,iE=AB("undefined");function a1t(e){return e!==null&&!iE(e)&&e.constructor!==null&&!iE(e.constructor)&&Vf(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const O_e=Am("ArrayBuffer");function o1t(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&O_e(e.buffer),t}const l1t=AB("string"),Vf=AB("function"),M_e=AB("number"),jB=e=>e!==null&&typeof e=="object",c1t=e=>e===!0||e===!1,VF=e=>{if(NB(e)!=="object")return!1;const t=Qie(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},u1t=Am("Date"),d1t=Am("File"),f1t=Am("Blob"),h1t=Am("FileList"),p1t=e=>jB(e)&&Vf(e.pipe),m1t=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||Vf(e.append)&&((t=NB(e))==="formdata"||t==="object"&&Vf(e.toString)&&e.toString()==="[object FormData]"))},x1t=Am("URLSearchParams"),[g1t,b1t,y1t,v1t]=["ReadableStream","Request","Response","Headers"].map(Am),w1t=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Lk(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,s;if(typeof e!="object"&&(e=[e]),CA(e))for(r=0,s=e.length;r<s;r++)t.call(null,e[r],r,e);else{const a=n?Object.getOwnPropertyNames(e):Object.keys(e),o=a.length;let l;for(r=0;r<o;r++)l=a[r],t.call(null,e[l],l,e)}}function R_e(e,t){t=t.toLowerCase();const n=Object.keys(e);let r=n.length,s;for(;r-- >0;)if(s=n[r],t===s.toLowerCase())return s;return null}const qv=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,L_e=e=>!iE(e)&&e!==qv;function dJ(){const{caseless:e}=L_e(this)&&this||{},t={},n=(r,s)=>{const a=e&&R_e(t,s)||s;VF(t[a])&&VF(r)?t[a]=dJ(t[a],r):VF(r)?t[a]=dJ({},r):CA(r)?t[a]=r.slice():t[a]=r};for(let r=0,s=arguments.length;r<s;r++)arguments[r]&&Lk(arguments[r],n);return t}const C1t=(e,t,n,{allOwnKeys:r}={})=>(Lk(t,(s,a)=>{n&&Vf(s)?e[a]=F_e(s,n):e[a]=s},{allOwnKeys:r}),e),S1t=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),N1t=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},A1t=(e,t,n,r)=>{let s,a,o;const l={};if(t=t||{},e==null)return t;do{for(s=Object.getOwnPropertyNames(e),a=s.length;a-- >0;)o=s[a],(!r||r(o,e,t))&&!l[o]&&(t[o]=e[o],l[o]=!0);e=n!==!1&&Qie(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},j1t=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},E1t=e=>{if(!e)return null;if(CA(e))return e;let t=e.length;if(!M_e(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},_1t=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Qie(Uint8Array)),k1t=(e,t)=>{const r=(e&&e[Symbol.iterator]).call(e);let s;for(;(s=r.next())&&!s.done;){const a=s.value;t.call(e,a[0],a[1])}},T1t=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},I1t=Am("HTMLFormElement"),P1t=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,s){return r.toUpperCase()+s}),Tme=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),F1t=Am("RegExp"),D_e=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};Lk(n,(s,a)=>{let o;(o=t(s,a,e))!==!1&&(r[a]=o||s)}),Object.defineProperties(e,r)},O1t=e=>{D_e(e,(t,n)=>{if(Vf(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(Vf(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},M1t=(e,t)=>{const n={},r=s=>{s.forEach(a=>{n[a]=!0})};return CA(e)?r(e):r(String(e).split(t)),n},R1t=()=>{},L1t=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t,jH="abcdefghijklmnopqrstuvwxyz",Ime="0123456789",B_e={DIGIT:Ime,ALPHA:jH,ALPHA_DIGIT:jH+jH.toUpperCase()+Ime},D1t=(e=16,t=B_e.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n};function B1t(e){return!!(e&&Vf(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const $1t=e=>{const t=new Array(10),n=(r,s)=>{if(jB(r)){if(t.indexOf(r)>=0)return;if(!("toJSON"in r)){t[s]=r;const a=CA(r)?[]:{};return Lk(r,(o,l)=>{const c=n(o,s+1);!iE(c)&&(a[l]=c)}),t[s]=void 0,a}}return r};return n(e,0)},U1t=Am("AsyncFunction"),z1t=e=>e&&(jB(e)||Vf(e))&&Vf(e.then)&&Vf(e.catch),$_e=((e,t)=>e?setImmediate:t?((n,r)=>(qv.addEventListener("message",({source:s,data:a})=>{s===qv&&a===n&&r.length&&r.shift()()},!1),s=>{r.push(s),qv.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",Vf(qv.postMessage)),H1t=typeof queueMicrotask<"u"?queueMicrotask.bind(qv):typeof process<"u"&&process.nextTick||$_e,br={isArray:CA,isArrayBuffer:O_e,isBuffer:a1t,isFormData:m1t,isArrayBufferView:o1t,isString:l1t,isNumber:M_e,isBoolean:c1t,isObject:jB,isPlainObject:VF,isReadableStream:g1t,isRequest:b1t,isResponse:y1t,isHeaders:v1t,isUndefined:iE,isDate:u1t,isFile:d1t,isBlob:f1t,isRegExp:F1t,isFunction:Vf,isStream:p1t,isURLSearchParams:x1t,isTypedArray:_1t,isFileList:h1t,forEach:Lk,merge:dJ,extend:C1t,trim:w1t,stripBOM:S1t,inherits:N1t,toFlatObject:A1t,kindOf:NB,kindOfTest:Am,endsWith:j1t,toArray:E1t,forEachEntry:k1t,matchAll:T1t,isHTMLForm:I1t,hasOwnProperty:Tme,hasOwnProp:Tme,reduceDescriptors:D_e,freezeMethods:O1t,toObjectSet:M1t,toCamelCase:P1t,noop:R1t,toFiniteNumber:L1t,findKey:R_e,global:qv,isContextDefined:L_e,ALPHABET:B_e,generateString:D1t,isSpecCompliantForm:B1t,toJSONObject:$1t,isAsyncFn:U1t,isThenable:z1t,setImmediate:$_e,asap:H1t};function _i(e,t,n,r,s){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),s&&(this.response=s,this.status=s.status?s.status:null)}br.inherits(_i,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:br.toJSONObject(this.config),code:this.code,status:this.status}}});const U_e=_i.prototype,z_e={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{z_e[e]={value:e}});Object.defineProperties(_i,z_e);Object.defineProperty(U_e,"isAxiosError",{value:!0});_i.from=(e,t,n,r,s,a)=>{const o=Object.create(U_e);return br.toFlatObject(e,o,function(c){return c!==Error.prototype},l=>l!=="isAxiosError"),_i.call(o,e.message,t,n,r,s),o.cause=e,o.name=e.name,a&&Object.assign(o,a),o};const V1t=null;function fJ(e){return br.isPlainObject(e)||br.isArray(e)}function H_e(e){return br.endsWith(e,"[]")?e.slice(0,-2):e}function Pme(e,t,n){return e?e.concat(t).map(function(s,a){return s=H_e(s),!n&&a?"["+s+"]":s}).join(n?".":""):t}function W1t(e){return br.isArray(e)&&!e.some(fJ)}const q1t=br.toFlatObject(br,{},null,function(t){return/^is[A-Z]/.test(t)});function EB(e,t,n){if(!br.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=br.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(w,C){return!br.isUndefined(C[w])});const r=n.metaTokens,s=n.visitor||d,a=n.dots,o=n.indexes,c=(n.Blob||typeof Blob<"u"&&Blob)&&br.isSpecCompliantForm(t);if(!br.isFunction(s))throw new TypeError("visitor must be a function");function u(v){if(v===null)return"";if(br.isDate(v))return v.toISOString();if(!c&&br.isBlob(v))throw new _i("Blob is not supported. Use a Buffer instead.");return br.isArrayBuffer(v)||br.isTypedArray(v)?c&&typeof Blob=="function"?new Blob([v]):Buffer.from(v):v}function d(v,w,C){let N=v;if(v&&!C&&typeof v=="object"){if(br.endsWith(w,"{}"))w=r?w:w.slice(0,-2),v=JSON.stringify(v);else if(br.isArray(v)&&W1t(v)||(br.isFileList(v)||br.endsWith(w,"[]"))&&(N=br.toArray(v)))return w=H_e(w),N.forEach(function(I,R){!(br.isUndefined(I)||I===null)&&t.append(o===!0?Pme([w],R,a):o===null?w:w+"[]",u(I))}),!1}return fJ(v)?!0:(t.append(Pme(C,w,a),u(v)),!1)}const f=[],x=Object.assign(q1t,{defaultVisitor:d,convertValue:u,isVisitable:fJ});function g(v,w){if(!br.isUndefined(v)){if(f.indexOf(v)!==-1)throw Error("Circular reference detected in "+w.join("."));f.push(v),br.forEach(v,function(N,P){(!(br.isUndefined(N)||N===null)&&s.call(t,N,br.isString(P)?P.trim():P,w,x))===!0&&g(N,w?w.concat(P):[P])}),f.pop()}}if(!br.isObject(e))throw new TypeError("data must be an object");return g(e),t}function Fme(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function Zie(e,t){this._pairs=[],e&&EB(e,this,t)}const V_e=Zie.prototype;V_e.append=function(t,n){this._pairs.push([t,n])};V_e.toString=function(t){const n=t?function(r){return t.call(this,r,Fme)}:Fme;return this._pairs.map(function(s){return n(s[0])+"="+n(s[1])},"").join("&")};function G1t(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function W_e(e,t,n){if(!t)return e;const r=n&&n.encode||G1t;br.isFunction(n)&&(n={serialize:n});const s=n&&n.serialize;let a;if(s?a=s(t,n):a=br.isURLSearchParams(t)?t.toString():new Zie(t,n).toString(r),a){const o=e.indexOf("#");o!==-1&&(e=e.slice(0,o)),e+=(e.indexOf("?")===-1?"?":"&")+a}return e}class Ome{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){br.forEach(this.handlers,function(r){r!==null&&t(r)})}}const q_e={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},K1t=typeof URLSearchParams<"u"?URLSearchParams:Zie,Y1t=typeof FormData<"u"?FormData:null,X1t=typeof Blob<"u"?Blob:null,Q1t={isBrowser:!0,classes:{URLSearchParams:K1t,FormData:Y1t,Blob:X1t},protocols:["http","https","file","blob","url","data"]},Jie=typeof window<"u"&&typeof document<"u",hJ=typeof navigator=="object"&&navigator||void 0,Z1t=Jie&&(!hJ||["ReactNative","NativeScript","NS"].indexOf(hJ.product)<0),J1t=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",ebt=Jie&&window.location.href||"http://localhost",tbt=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Jie,hasStandardBrowserEnv:Z1t,hasStandardBrowserWebWorkerEnv:J1t,navigator:hJ,origin:ebt},Symbol.toStringTag,{value:"Module"})),ku={...tbt,...Q1t};function nbt(e,t){return EB(e,new ku.classes.URLSearchParams,Object.assign({visitor:function(n,r,s,a){return ku.isNode&&br.isBuffer(n)?(this.append(r,n.toString("base64")),!1):a.defaultVisitor.apply(this,arguments)}},t))}function rbt(e){return br.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function sbt(e){const t={},n=Object.keys(e);let r;const s=n.length;let a;for(r=0;r<s;r++)a=n[r],t[a]=e[a];return t}function G_e(e){function t(n,r,s,a){let o=n[a++];if(o==="__proto__")return!0;const l=Number.isFinite(+o),c=a>=n.length;return o=!o&&br.isArray(s)?s.length:o,c?(br.hasOwnProp(s,o)?s[o]=[s[o],r]:s[o]=r,!l):((!s[o]||!br.isObject(s[o]))&&(s[o]=[]),t(n,r,s[o],a)&&br.isArray(s[o])&&(s[o]=sbt(s[o])),!l)}if(br.isFormData(e)&&br.isFunction(e.entries)){const n={};return br.forEachEntry(e,(r,s)=>{t(rbt(r),s,n,0)}),n}return null}function ibt(e,t,n){if(br.isString(e))try{return(t||JSON.parse)(e),br.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(0,JSON.stringify)(e)}const Dk={transitional:q_e,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",s=r.indexOf("application/json")>-1,a=br.isObject(t);if(a&&br.isHTMLForm(t)&&(t=new FormData(t)),br.isFormData(t))return s?JSON.stringify(G_e(t)):t;if(br.isArrayBuffer(t)||br.isBuffer(t)||br.isStream(t)||br.isFile(t)||br.isBlob(t)||br.isReadableStream(t))return t;if(br.isArrayBufferView(t))return t.buffer;if(br.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let l;if(a){if(r.indexOf("application/x-www-form-urlencoded")>-1)return nbt(t,this.formSerializer).toString();if((l=br.isFileList(t))||r.indexOf("multipart/form-data")>-1){const c=this.env&&this.env.FormData;return EB(l?{"files[]":t}:t,c&&new c,this.formSerializer)}}return a||s?(n.setContentType("application/json",!1),ibt(t)):t}],transformResponse:[function(t){const n=this.transitional||Dk.transitional,r=n&&n.forcedJSONParsing,s=this.responseType==="json";if(br.isResponse(t)||br.isReadableStream(t))return t;if(t&&br.isString(t)&&(r&&!this.responseType||s)){const o=!(n&&n.silentJSONParsing)&&s;try{return JSON.parse(t)}catch(l){if(o)throw l.name==="SyntaxError"?_i.from(l,_i.ERR_BAD_RESPONSE,this,null,this.response):l}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:ku.classes.FormData,Blob:ku.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};br.forEach(["delete","get","head","post","put","patch"],e=>{Dk.headers[e]={}});const abt=br.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),obt=e=>{const t={};let n,r,s;return e&&e.split(`
`).forEach(function(o){s=o.indexOf(":"),n=o.substring(0,s).trim().toLowerCase(),r=o.substring(s+1).trim(),!(!n||t[n]&&abt[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},Mme=Symbol("internals");function w7(e){return e&&String(e).trim().toLowerCase()}function WF(e){return e===!1||e==null?e:br.isArray(e)?e.map(WF):String(e)}function lbt(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}const cbt=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function EH(e,t,n,r,s){if(br.isFunction(r))return r.call(this,t,n);if(s&&(t=n),!!br.isString(t)){if(br.isString(r))return t.indexOf(r)!==-1;if(br.isRegExp(r))return r.test(t)}}function ubt(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function dbt(e,t){const n=br.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(s,a,o){return this[r].call(this,t,s,a,o)},configurable:!0})})}class tf{constructor(t){t&&this.set(t)}set(t,n,r){const s=this;function a(l,c,u){const d=w7(c);if(!d)throw new Error("header name must be a non-empty string");const f=br.findKey(s,d);(!f||s[f]===void 0||u===!0||u===void 0&&s[f]!==!1)&&(s[f||c]=WF(l))}const o=(l,c)=>br.forEach(l,(u,d)=>a(u,d,c));if(br.isPlainObject(t)||t instanceof this.constructor)o(t,n);else if(br.isString(t)&&(t=t.trim())&&!cbt(t))o(obt(t),n);else if(br.isHeaders(t))for(const[l,c]of t.entries())a(c,l,r);else t!=null&&a(n,t,r);return this}get(t,n){if(t=w7(t),t){const r=br.findKey(this,t);if(r){const s=this[r];if(!n)return s;if(n===!0)return lbt(s);if(br.isFunction(n))return n.call(this,s,r);if(br.isRegExp(n))return n.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=w7(t),t){const r=br.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||EH(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let s=!1;function a(o){if(o=w7(o),o){const l=br.findKey(r,o);l&&(!n||EH(r,r[l],l,n))&&(delete r[l],s=!0)}}return br.isArray(t)?t.forEach(a):a(t),s}clear(t){const n=Object.keys(this);let r=n.length,s=!1;for(;r--;){const a=n[r];(!t||EH(this,this[a],a,t,!0))&&(delete this[a],s=!0)}return s}normalize(t){const n=this,r={};return br.forEach(this,(s,a)=>{const o=br.findKey(r,a);if(o){n[o]=WF(s),delete n[a];return}const l=t?ubt(a):String(a).trim();l!==a&&delete n[a],n[l]=WF(s),r[l]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return br.forEach(this,(r,s)=>{r!=null&&r!==!1&&(n[s]=t&&br.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(`
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(s=>r.set(s)),r}static accessor(t){const r=(this[Mme]=this[Mme]={accessors:{}}).accessors,s=this.prototype;function a(o){const l=w7(o);r[l]||(dbt(s,o),r[l]=!0)}return br.isArray(t)?t.forEach(a):a(t),this}}tf.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);br.reduceDescriptors(tf.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}});br.freezeMethods(tf);function _H(e,t){const n=this||Dk,r=t||n,s=tf.from(r.headers);let a=r.data;return br.forEach(e,function(l){a=l.call(n,a,s.normalize(),t?t.status:void 0)}),s.normalize(),a}function K_e(e){return!!(e&&e.__CANCEL__)}function SA(e,t,n){_i.call(this,e??"canceled",_i.ERR_CANCELED,t,n),this.name="CanceledError"}br.inherits(SA,_i,{__CANCEL__:!0});function Y_e(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new _i("Request failed with status code "+n.status,[_i.ERR_BAD_REQUEST,_i.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function fbt(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function hbt(e,t){e=e||10;const n=new Array(e),r=new Array(e);let s=0,a=0,o;return t=t!==void 0?t:1e3,function(c){const u=Date.now(),d=r[a];o||(o=u),n[s]=c,r[s]=u;let f=a,x=0;for(;f!==s;)x+=n[f++],f=f%e;if(s=(s+1)%e,s===a&&(a=(a+1)%e),u-o<t)return;const g=d&&u-d;return g?Math.round(x*1e3/g):void 0}}function pbt(e,t){let n=0,r=1e3/t,s,a;const o=(u,d=Date.now())=>{n=d,s=null,a&&(clearTimeout(a),a=null),e.apply(null,u)};return[(...u)=>{const d=Date.now(),f=d-n;f>=r?o(u,d):(s=u,a||(a=setTimeout(()=>{a=null,o(s)},r-f)))},()=>s&&o(s)]}const dM=(e,t,n=3)=>{let r=0;const s=hbt(50,250);return pbt(a=>{const o=a.loaded,l=a.lengthComputable?a.total:void 0,c=o-r,u=s(c),d=o<=l;r=o;const f={loaded:o,total:l,progress:l?o/l:void 0,bytes:c,rate:u||void 0,estimated:u&&l&&d?(l-o)/u:void 0,event:a,lengthComputable:l!=null,[t?"download":"upload"]:!0};e(f)},n)},Rme=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},Lme=e=>(...t)=>br.asap(()=>e(...t)),mbt=ku.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,ku.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(ku.origin),ku.navigator&&/(msie|trident)/i.test(ku.navigator.userAgent)):()=>!0,xbt=ku.hasStandardBrowserEnv?{write(e,t,n,r,s,a){const o=[e+"="+encodeURIComponent(t)];br.isNumber(n)&&o.push("expires="+new Date(n).toGMTString()),br.isString(r)&&o.push("path="+r),br.isString(s)&&o.push("domain="+s),a===!0&&o.push("secure"),document.cookie=o.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function gbt(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function bbt(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function X_e(e,t){return e&&!gbt(t)?bbt(e,t):t}const Dme=e=>e instanceof tf?{...e}:e;function j3(e,t){t=t||{};const n={};function r(u,d,f,x){return br.isPlainObject(u)&&br.isPlainObject(d)?br.merge.call({caseless:x},u,d):br.isPlainObject(d)?br.merge({},d):br.isArray(d)?d.slice():d}function s(u,d,f,x){if(br.isUndefined(d)){if(!br.isUndefined(u))return r(void 0,u,f,x)}else return r(u,d,f,x)}function a(u,d){if(!br.isUndefined(d))return r(void 0,d)}function o(u,d){if(br.isUndefined(d)){if(!br.isUndefined(u))return r(void 0,u)}else return r(void 0,d)}function l(u,d,f){if(f in t)return r(u,d);if(f in e)return r(void 0,u)}const c={url:a,method:a,data:a,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:l,headers:(u,d,f)=>s(Dme(u),Dme(d),f,!0)};return br.forEach(Object.keys(Object.assign({},e,t)),function(d){const f=c[d]||s,x=f(e[d],t[d],d);br.isUndefined(x)&&f!==l||(n[d]=x)}),n}const Q_e=e=>{const t=j3({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:s,xsrfCookieName:a,headers:o,auth:l}=t;t.headers=o=tf.from(o),t.url=W_e(X_e(t.baseURL,t.url),e.params,e.paramsSerializer),l&&o.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):"")));let c;if(br.isFormData(n)){if(ku.hasStandardBrowserEnv||ku.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if((c=o.getContentType())!==!1){const[u,...d]=c?c.split(";").map(f=>f.trim()).filter(Boolean):[];o.setContentType([u||"multipart/form-data",...d].join("; "))}}if(ku.hasStandardBrowserEnv&&(r&&br.isFunction(r)&&(r=r(t)),r||r!==!1&&mbt(t.url))){const u=s&&a&&xbt.read(a);u&&o.set(s,u)}return t},ybt=typeof XMLHttpRequest<"u",vbt=ybt&&function(e){return new Promise(function(n,r){const s=Q_e(e);let a=s.data;const o=tf.from(s.headers).normalize();let{responseType:l,onUploadProgress:c,onDownloadProgress:u}=s,d,f,x,g,v;function w(){g&&g(),v&&v(),s.cancelToken&&s.cancelToken.unsubscribe(d),s.signal&&s.signal.removeEventListener("abort",d)}let C=new XMLHttpRequest;C.open(s.method.toUpperCase(),s.url,!0),C.timeout=s.timeout;function N(){if(!C)return;const I=tf.from("getAllResponseHeaders"in C&&C.getAllResponseHeaders()),F={data:!l||l==="text"||l==="json"?C.responseText:C.response,status:C.status,statusText:C.statusText,headers:I,config:e,request:C};Y_e(function(L){n(L),w()},function(L){r(L),w()},F),C=null}"onloadend"in C?C.onloadend=N:C.onreadystatechange=function(){!C||C.readyState!==4||C.status===0&&!(C.responseURL&&C.responseURL.indexOf("file:")===0)||setTimeout(N)},C.onabort=function(){C&&(r(new _i("Request aborted",_i.ECONNABORTED,e,C)),C=null)},C.onerror=function(){r(new _i("Network Error",_i.ERR_NETWORK,e,C)),C=null},C.ontimeout=function(){let R=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const F=s.transitional||q_e;s.timeoutErrorMessage&&(R=s.timeoutErrorMessage),r(new _i(R,F.clarifyTimeoutError?_i.ETIMEDOUT:_i.ECONNABORTED,e,C)),C=null},a===void 0&&o.setContentType(null),"setRequestHeader"in C&&br.forEach(o.toJSON(),function(R,F){C.setRequestHeader(F,R)}),br.isUndefined(s.withCredentials)||(C.withCredentials=!!s.withCredentials),l&&l!=="json"&&(C.responseType=s.responseType),u&&([x,v]=dM(u,!0),C.addEventListener("progress",x)),c&&C.upload&&([f,g]=dM(c),C.upload.addEventListener("progress",f),C.upload.addEventListener("loadend",g)),(s.cancelToken||s.signal)&&(d=I=>{C&&(r(!I||I.type?new SA(null,e,C):I),C.abort(),C=null)},s.cancelToken&&s.cancelToken.subscribe(d),s.signal&&(s.signal.aborted?d():s.signal.addEventListener("abort",d)));const P=fbt(s.url);if(P&&ku.protocols.indexOf(P)===-1){r(new _i("Unsupported protocol "+P+":",_i.ERR_BAD_REQUEST,e));return}C.send(a||null)})},wbt=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,s;const a=function(u){if(!s){s=!0,l();const d=u instanceof Error?u:this.reason;r.abort(d instanceof _i?d:new SA(d instanceof Error?d.message:d))}};let o=t&&setTimeout(()=>{o=null,a(new _i(`timeout ${t} of ms exceeded`,_i.ETIMEDOUT))},t);const l=()=>{e&&(o&&clearTimeout(o),o=null,e.forEach(u=>{u.unsubscribe?u.unsubscribe(a):u.removeEventListener("abort",a)}),e=null)};e.forEach(u=>u.addEventListener("abort",a));const{signal:c}=r;return c.unsubscribe=()=>br.asap(l),c}},Cbt=function*(e,t){let n=e.byteLength;if(n<t){yield e;return}let r=0,s;for(;r<n;)s=r+t,yield e.slice(r,s),r=s},Sbt=async function*(e,t){for await(const n of Nbt(e))yield*Cbt(n,t)},Nbt=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:n,value:r}=await t.read();if(n)break;yield r}}finally{await t.cancel()}},Bme=(e,t,n,r)=>{const s=Sbt(e,t);let a=0,o,l=c=>{o||(o=!0,r&&r(c))};return new ReadableStream({async pull(c){try{const{done:u,value:d}=await s.next();if(u){l(),c.close();return}let f=d.byteLength;if(n){let x=a+=f;n(x)}c.enqueue(new Uint8Array(d))}catch(u){throw l(u),u}},cancel(c){return l(c),s.return()}},{highWaterMark:2})},_B=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",Z_e=_B&&typeof ReadableStream=="function",Abt=_B&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),J_e=(e,...t)=>{try{return!!e(...t)}catch{return!1}},jbt=Z_e&&J_e(()=>{let e=!1;const t=new Request(ku.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),$me=64*1024,pJ=Z_e&&J_e(()=>br.isReadableStream(new Response("").body)),fM={stream:pJ&&(e=>e.body)};_B&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!fM[t]&&(fM[t]=br.isFunction(e[t])?n=>n[t]():(n,r)=>{throw new _i(`Response type '${t}' is not supported`,_i.ERR_NOT_SUPPORT,r)})})})(new Response);const Ebt=async e=>{if(e==null)return 0;if(br.isBlob(e))return e.size;if(br.isSpecCompliantForm(e))return(await new Request(ku.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(br.isArrayBufferView(e)||br.isArrayBuffer(e))return e.byteLength;if(br.isURLSearchParams(e)&&(e=e+""),br.isString(e))return(await Abt(e)).byteLength},_bt=async(e,t)=>{const n=br.toFiniteNumber(e.getContentLength());return n??Ebt(t)},kbt=_B&&(async e=>{let{url:t,method:n,data:r,signal:s,cancelToken:a,timeout:o,onDownloadProgress:l,onUploadProgress:c,responseType:u,headers:d,withCredentials:f="same-origin",fetchOptions:x}=Q_e(e);u=u?(u+"").toLowerCase():"text";let g=wbt([s,a&&a.toAbortSignal()],o),v;const w=g&&g.unsubscribe&&(()=>{g.unsubscribe()});let C;try{if(c&&jbt&&n!=="get"&&n!=="head"&&(C=await _bt(d,r))!==0){let F=new Request(t,{method:"POST",body:r,duplex:"half"}),U;if(br.isFormData(r)&&(U=F.headers.get("content-type"))&&d.setContentType(U),F.body){const[L,z]=Rme(C,dM(Lme(c)));r=Bme(F.body,$me,L,z)}}br.isString(f)||(f=f?"include":"omit");const N="credentials"in Request.prototype;v=new Request(t,{...x,signal:g,method:n.toUpperCase(),headers:d.normalize().toJSON(),body:r,duplex:"half",credentials:N?f:void 0});let P=await fetch(v);const I=pJ&&(u==="stream"||u==="response");if(pJ&&(l||I&&w)){const F={};["status","statusText","headers"].forEach(Q=>{F[Q]=P[Q]});const U=br.toFiniteNumber(P.headers.get("content-length")),[L,z]=l&&Rme(U,dM(Lme(l),!0))||[];P=new Response(Bme(P.body,$me,L,()=>{z&&z(),w&&w()}),F)}u=u||"text";let R=await fM[br.findKey(fM,u)||"text"](P,e);return!I&&w&&w(),await new Promise((F,U)=>{Y_e(F,U,{data:R,headers:tf.from(P.headers),status:P.status,statusText:P.statusText,config:e,request:v})})}catch(N){throw w&&w(),N&&N.name==="TypeError"&&/fetch/i.test(N.message)?Object.assign(new _i("Network Error",_i.ERR_NETWORK,e,v),{cause:N.cause||N}):_i.from(N,N&&N.code,e,v)}}),mJ={http:V1t,xhr:vbt,fetch:kbt};br.forEach(mJ,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const Ume=e=>`- ${e}`,Tbt=e=>br.isFunction(e)||e===null||e===!1,eke={getAdapter:e=>{e=br.isArray(e)?e:[e];const{length:t}=e;let n,r;const s={};for(let a=0;a<t;a++){n=e[a];let o;if(r=n,!Tbt(n)&&(r=mJ[(o=String(n)).toLowerCase()],r===void 0))throw new _i(`Unknown adapter '${o}'`);if(r)break;s[o||"#"+a]=r}if(!r){const a=Object.entries(s).map(([l,c])=>`adapter ${l} `+(c===!1?"is not supported by the environment":"is not available in the build"));let o=t?a.length>1?`since :
`+a.map(Ume).join(`
`):" "+Ume(a[0]):"as no adapter specified";throw new _i("There is no suitable adapter to dispatch the request "+o,"ERR_NOT_SUPPORT")}return r},adapters:mJ};function kH(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new SA(null,e)}function zme(e){return kH(e),e.headers=tf.from(e.headers),e.data=_H.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),eke.getAdapter(e.adapter||Dk.adapter)(e).then(function(r){return kH(e),r.data=_H.call(e,e.transformResponse,r),r.headers=tf.from(r.headers),r},function(r){return K_e(r)||(kH(e),r&&r.response&&(r.response.data=_H.call(e,e.transformResponse,r.response),r.response.headers=tf.from(r.response.headers))),Promise.reject(r)})}const tke="1.7.9",kB={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{kB[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const Hme={};kB.transitional=function(t,n,r){function s(a,o){return"[Axios v"+tke+"] Transitional option '"+a+"'"+o+(r?". "+r:"")}return(a,o,l)=>{if(t===!1)throw new _i(s(o," has been removed"+(n?" in "+n:"")),_i.ERR_DEPRECATED);return n&&!Hme[o]&&(Hme[o]=!0,console.warn(s(o," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(a,o,l):!0}};kB.spelling=function(t){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function Ibt(e,t,n){if(typeof e!="object")throw new _i("options must be an object",_i.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let s=r.length;for(;s-- >0;){const a=r[s],o=t[a];if(o){const l=e[a],c=l===void 0||o(l,a,e);if(c!==!0)throw new _i("option "+a+" must be "+c,_i.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new _i("Unknown option "+a,_i.ERR_BAD_OPTION)}}const qF={assertOptions:Ibt,validators:kB},Ym=qF.validators;class Kw{constructor(t){this.defaults=t,this.interceptors={request:new Ome,response:new Ome}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let s={};Error.captureStackTrace?Error.captureStackTrace(s):s=new Error;const a=s.stack?s.stack.replace(/^.+\n/,""):"";try{r.stack?a&&!String(r.stack).endsWith(a.replace(/^.+\n.+\n/,""))&&(r.stack+=`
`+a):r.stack=a}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=j3(this.defaults,n);const{transitional:r,paramsSerializer:s,headers:a}=n;r!==void 0&&qF.assertOptions(r,{silentJSONParsing:Ym.transitional(Ym.boolean),forcedJSONParsing:Ym.transitional(Ym.boolean),clarifyTimeoutError:Ym.transitional(Ym.boolean)},!1),s!=null&&(br.isFunction(s)?n.paramsSerializer={serialize:s}:qF.assertOptions(s,{encode:Ym.function,serialize:Ym.function},!0)),qF.assertOptions(n,{baseUrl:Ym.spelling("baseURL"),withXsrfToken:Ym.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let o=a&&br.merge(a.common,a[n.method]);a&&br.forEach(["delete","get","head","post","put","patch","common"],v=>{delete a[v]}),n.headers=tf.concat(o,a);const l=[];let c=!0;this.interceptors.request.forEach(function(w){typeof w.runWhen=="function"&&w.runWhen(n)===!1||(c=c&&w.synchronous,l.unshift(w.fulfilled,w.rejected))});const u=[];this.interceptors.response.forEach(function(w){u.push(w.fulfilled,w.rejected)});let d,f=0,x;if(!c){const v=[zme.bind(this),void 0];for(v.unshift.apply(v,l),v.push.apply(v,u),x=v.length,d=Promise.resolve(n);f<x;)d=d.then(v[f++],v[f++]);return d}x=l.length;let g=n;for(f=0;f<x;){const v=l[f++],w=l[f++];try{g=v(g)}catch(C){w.call(this,C);break}}try{d=zme.call(this,g)}catch(v){return Promise.reject(v)}for(f=0,x=u.length;f<x;)d=d.then(u[f++],u[f++]);return d}getUri(t){t=j3(this.defaults,t);const n=X_e(t.baseURL,t.url);return W_e(n,t.params,t.paramsSerializer)}}br.forEach(["delete","get","head","options"],function(t){Kw.prototype[t]=function(n,r){return this.request(j3(r||{},{method:t,url:n,data:(r||{}).data}))}});br.forEach(["post","put","patch"],function(t){function n(r){return function(a,o,l){return this.request(j3(l||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:a,data:o}))}}Kw.prototype[t]=n(),Kw.prototype[t+"Form"]=n(!0)});class eae{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(a){n=a});const r=this;this.promise.then(s=>{if(!r._listeners)return;let a=r._listeners.length;for(;a-- >0;)r._listeners[a](s);r._listeners=null}),this.promise.then=s=>{let a;const o=new Promise(l=>{r.subscribe(l),a=l}).then(s);return o.cancel=function(){r.unsubscribe(a)},o},t(function(a,o,l){r.reason||(r.reason=new SA(a,o,l),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new eae(function(s){t=s}),cancel:t}}}function Pbt(e){return function(n){return e.apply(null,n)}}function Fbt(e){return br.isObject(e)&&e.isAxiosError===!0}const xJ={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(xJ).forEach(([e,t])=>{xJ[t]=e});function nke(e){const t=new Kw(e),n=F_e(Kw.prototype.request,t);return br.extend(n,Kw.prototype,t,{allOwnKeys:!0}),br.extend(n,t,null,{allOwnKeys:!0}),n.create=function(s){return nke(j3(e,s))},n}const fs=nke(Dk);fs.Axios=Kw;fs.CanceledError=SA;fs.CancelToken=eae;fs.isCancel=K_e;fs.VERSION=tke;fs.toFormData=EB;fs.AxiosError=_i;fs.Cancel=fs.CanceledError;fs.all=function(t){return Promise.all(t)};fs.spread=Pbt;fs.isAxiosError=Fbt;fs.mergeConfig=j3;fs.AxiosHeaders=tf;fs.formToJSON=e=>G_e(br.isHTMLForm(e)?new FormData(e):e);fs.getAdapter=eke.getAdapter;fs.HttpStatusCode=xJ;fs.default=fs;var zy="https://dextrabothypev2.nftinit.io/";async function Obt(e,t){if(t==1||t==null)return fetch(zy+"api/subscriber/sign_start/",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:e})}).then(n=>n.json());if(t>1)return fetch(zy+"api/subscriber/sign_start/",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:e,token_slot:t})}).then(n=>n.json())}async function Mbt(e,t,n,r){if(r==1||r==null)return fetch(zy+"api/subscriber/sign_complete_v2/",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:e,temp_password:t,signature:n})}).then(s=>s.json());if(r>1)return fetch(zy+"api/subscriber/sign_complete_v2/",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:e,temp_password:t,signature:n,token_slot:r})}).then(s=>s.json())}async function Ei(e,t){if(e)return await fetch(zy+"api/subscriber/check_account/",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:e,token:t})}).then(n=>n.json())}async function Rbt(e,t){if(e)return await fetch(zy+"api/subscriber/telegram_start/",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:e,token:t})}).then(n=>n.json())}async function Lbt(e,t){if(e)return await fetch(zy+"api/hyper/following/list/",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:e,token:t})}).then(n=>n.json())}async function Dbt(e,t){if(e)return await fetch(zy+"api/hyper/tracker/list/",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:e,token:t})}).then(n=>n.json())}async function Bbt(e){try{const t=await fetch(`${API_URL}/refresh_token/`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({address:e})});if(!t.ok)throw new Error("Refresh token failed");const n=await t.json();if(n.success&&n.trade_token)return localStorage.setItem("hyperTradeToken",n.trade_token),localStorage.setItem("hyperAddress",n.address),n.trade_token;throw new Error("Refresh response invalid")}catch(t){return console.error("Token refresh error:",t),null}}let TH=null;function $bt(e){TH&&clearInterval(TH),TH=setInterval(async()=>{const t=localStorage.getItem("hyperTradeTokenExp"),n=Date.now()/1e3;(!t||t-n<600)&&await Bbt(e)&&(localStorage.setItem("hyperTradeTokenExp",n+259200),console.log("Trade token refreshed"))},5*60*1e3)}const Ubt=e=>{const t=[...e].sort((r,s)=>s.time-r.time),n=new Map;return t.forEach(r=>{var a;const s=r.oid;if(!n.has(s)){const o=t.filter(v=>v.oid===r.oid),l=o.reduce((v,w)=>v+parseFloat(w.sz),0),c=o.map(v=>parseFloat(v.startPosition));let u;c.includes(0)?u=0:c.every(v=>v>0)?u=Math.max(...c):c.every(v=>v<0)?u=Math.min(...c):u=o.reduce((v,w)=>v+parseFloat(w.startPosition),0);const d=o.reduce((v,w)=>v+parseFloat(w.sz)*parseFloat(w.px),0),f=o.reduce((v,w)=>v+parseFloat(w.closedPnl||0),0),x=o.reduce((v,w)=>v+parseFloat(w.fee||0),0),g=((a=o.find(v=>v.dir==="Long > Short"||v.dir==="Short > Long"))==null?void 0:a.dir)||"";n.set(s,{oid:r.oid,asset:r.coin,direction:g===""?r.dir:g,fills:o,totalSize:l,totalStartPositions:u,totalValue:d,pnl:f-x,latestFill:r.time})}}),Array.from(n.values()).sort((r,s)=>s.latestFill-r.latestFill)},Qr=m.createContext(),zbt=({children:e})=>{const t=oc(),{isConnected:n,address:r}=ns(),{signMessageAsync:s}=y_e(),[a,o]=m.useState("user"),[l,c]=m.useState(null),[u,d]=m.useState(0),[f,x]=m.useState(0),[g,v]=m.useState(!1),[w,C]=m.useState(!1),[N,P]=m.useState(!1),[I,R]=m.useState(0),[F,U]=m.useState(window.localStorage.getItem("hyperToken")),[L,z]=m.useState(window.localStorage.getItem("hyperAddress")),[Q,ne]=m.useState(!1),[J,X]=m.useState(!1),[re,pe]=m.useState(!1),[Y,ie]=m.useState(null),[oe,G]=m.useState(!1),[V,ee]=m.useState(null),[ae,fe]=m.useState(null),[Ne,he]=m.useState([]),[ge,ye]=m.useState([]),[ve,je]=m.useState([]),[Ie,Le]=m.useState(""),[Qe,$e]=m.useState({activeRange:"",day:0,week:0,month:0}),[it,tt]=m.useState([]),lt=m.useCallback(async()=>{const Ke=window.localStorage.getItem("hyperToken"),Bt=window.localStorage.getItem("hyperAddress");if(!Ke||!Bt){tt([]);return}try{const $t=await Ei(Bt.toLowerCase(),Ke);$t!=null&&$t.success&&tt(($t==null?void 0:$t.bot_slots_info)||[])}catch{}},[]);async function ft(){var qe,Ye;const Ke=window.localStorage.getItem("hyperToken"),Bt=window.localStorage.getItem("hyperAddress"),$t=ect(Ke);if(Ke&&$t!==!1){const ht=await Ei(Bt,Ke);ht.success?(tt((ht==null?void 0:ht.bot_slots_info)||[]),c(ht.telegram_chat_id),o(ht.subscriber_role),d((qe=ht==null?void 0:ht.mushboomer_counts)==null?void 0:qe.eth),x((Ye=ht==null?void 0:ht.mushboomer_counts)==null?void 0:Ye.sol),v(ht==null?void 0:ht.referral_code),C(ht==null?void 0:ht.refcode),P(ht==null?void 0:ht.whitelist),R(ht==null?void 0:ht.subs_expire_day),U(localStorage.getItem("hyperToken")),z(localStorage.getItem("hyperAddress")),un(),nn()):tt([])}else ut(1)}async function ut(Ke){try{if(!r)throw new Error("No accounts found. Please connect your wallet.");const Bt=await Obt(r,Ke);if(!Bt.success)return{success:!1,message:Bt.error_message};const $t=Bt.temp_password,qe=`dextrabot.io verification code : ${$t}`,Ye=await s({message:qe}),ht=await Mbt(Bt.address,$t,Ye,Ke);if(ht&&ht.token){if(window.localStorage.setItem("hyperAddress",ht.address),window.localStorage.setItem("hyperToken",ht.token),ht.trade_token){window.localStorage.setItem("hyperTradeToken",ht.trade_token);const Zt=Date.now()/1e3;window.localStorage.setItem("hyperTradeTokenExp",Zt+(ht.expires_in||259200)),$bt(ht.address)}return ft(),window.dispatchEvent(new Event("localStorageUpdated")),{success:!0,initToken:ht.token}}else throw new Error("Failed to complete the signing process.")}catch(Bt){return console.error("Error during sign-in:",Bt),{success:!1,message:Bt.message||"An unknown error occurred."}}}const[qt,It]=m.useState([]);async function nn(){const Ke=window.localStorage.getItem("hyperToken"),Bt=window.localStorage.getItem("hyperAddress");try{pe(!0);const $t=await Lbt(r||Bt,Ke);if(!$t.success){$t.error_message!="User not verified"&&rn.error($t.error_message),$t.error_message=="User not verified";return}$t.success?It($t==null?void 0:$t.data):It([])}catch($t){$t.name!=="AbortError"&&(ie($t.message),rn.error($t.message)),It([])}finally{pe(!1)}}const[jt,cn]=m.useState([]);async function un(){const Ke=window.localStorage.getItem("hyperToken"),Bt=window.localStorage.getItem("hyperAddress");try{G(!0);const $t=await Dbt(r||Bt,Ke);if(!$t.success){$t.error_message!="User not verified"&&rn.error($t.error_message),$t.error_message=="User not verified";return}$t.success?cn($t==null?void 0:$t.data):cn([])}catch($t){$t.name!=="AbortError"&&(ee($t.message),rn.error($t.message)),cn([])}finally{G(!1)}}m.useEffect(()=>{window.localStorage.getItem("hyperToken")==null&&t.pathname!="/tracked-wallets"&&J&&ne(!0)},[n]),m.useEffect(()=>{!n&&!F||(t.pathname=="/wallet-management"||t.pathname.includes("referral")||t.pathname=="/leaderboard")&&F!=null&&F&&nn()},[F]),m.useRef(!1),m.useEffect(()=>{if(t.pathname==="/"||t.pathname==="/sitemap"||t.pathname==="/videos"||!window.localStorage.getItem("hyperToken"))return;const $t=`notificationsFeedSocket_${r==null?void 0:r.toLowerCase()}`,qe=localStorage.getItem($t);he(qe?JSON.parse(qe):[]);const Ye=Ny("https://dextrabothypesocketv2.nftinit.io/");return fe(Ye),Ye.on("connect",()=>{console.log("Socket connected")}),Ye.on("disconnect",()=>{console.log("Socket disconnected")}),Ye.on("hyper_get_trade_message",async ht=>{const Zt=(Array.isArray(ht)?ht:[ht]).map(nt=>({...nt,is_read:!1,trader_pnl:null}));he(nt=>{const Ue=new Set(nt.map(at=>at==null?void 0:at.oid)),We=[...Zt==null?void 0:Zt.filter(at=>!(Ue!=null&&Ue.has(at==null?void 0:at.oid))),...nt].slice(0,100);return localStorage.setItem($t,JSON.stringify(We)),We});const zt=window.localStorage.getItem("hyperToken");if(!r||!zt){console.log("User logged out before timeout - skipping PNL fetch.");return}const Et=Zt.map(nt=>nt==null?void 0:nt.trader_wallet).filter(Boolean)[0];try{const nt=await fs.post("https://api-ui.hyperliquid.xyz/info",{aggregateByTime:!0,type:"userFills",user:Et});if(nt.data){const Ue=Ubt(nt.data),Rt=new Map(Ue==null?void 0:Ue.map(We=>[We==null?void 0:We.oid,We==null?void 0:We.pnl]));he(We=>{const at=We==null?void 0:We.map(mt=>Rt!=null&&Rt.has(mt==null?void 0:mt.trader_oid)?{...mt,trader_pnl:Rt==null?void 0:Rt.get(mt==null?void 0:mt.trader_oid)}:mt);return localStorage.setItem($t,JSON.stringify(at)),at})}else console.log("Unexpected API response")}catch(nt){console.error("PNL API error:",nt)}}),()=>{Ye.disconnect()}},[F]),m.useEffect(()=>{if(!ae||!r||!qt||qt.length===0)return;qt.map(Bt=>Bt.wallet_address);const Ke=window.localStorage.getItem("hyperToken");return ae.emit("subscribe",{login:r==null?void 0:r.toLowerCase(),token:Ke}),()=>{}},[ae,r,qt]);const Ft=async()=>{try{const Ke=window.localStorage.getItem("hyperToken"),Bt="https://dextrabothypev2.nftinit.io/api/subscriber/announcement/getannouncements/";let $t={};r&&Ke&&($t={address:r.toLowerCase(),token:Ke});const qe=await fetch(Bt,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify($t)});if(!qe.ok)throw new Error(`Server responded with status ${qe.status}`);const Ye=await qe.json();Ye.success?ye(Ye):console.log(Ye.error_message)}catch(Ke){console.error("Error in handleAnnouncement:",Ke)}};return m.useEffect(()=>{Ft();const Ke=setInterval(()=>{Ft()},6e4);return()=>clearInterval(Ke)},[n,F]),m.useEffect(()=>{(async()=>{try{const qe=(await(await fetch("https://dextradata.nftinit.io/api/hyper/terminal_coins/v2/")).json()).coins;je(qe)}catch(Bt){console.error("Data retrieval error:",Bt),Le(Bt.message)}})()},[]),i.jsx(Qr.Provider,{value:{subscriberRole:a,setSubscriberRole:o,subsExpireDay:I,setSubsExpireDay:R,hyperToken:F,setHyperToken:U,hyperAddress:L,setHyperAddress:z,signModalOpen:Q,setSignModalOpen:ne,walletLogin:ft,signIn:ut,copyTradeWatchList:qt,setCopyTradeWatchList:It,trackedWatchList:jt,setTrackedWatchList:cn,getCopyTradeWatchList:nn,getTrackedWatchList:un,copyWatchListLoading:re,setCopyWatchListLoading:pe,trackedWatchListLoading:oe,setTrackedWatchListLoading:G,copyWatchListError:Y,setCopyWatchListError:ie,trackedWatchListError:V,setTrackedWatchListError:ee,signInConnectButtonOpen:J,setSignInConnectButtonOpen:X,telegramChatId:l,setTelegramChatId:c,mushboomerETH:u,setMushboomerETH:d,isWhitelist:N,setIsWhitelist:P,mushboomerSOL:f,setMushboomerSOL:x,isReferralCode:g,setIsReferralCode:v,isReferralCodeName:w,setIsReferralCodeName:C,latestPnL:Qe,setLatestPnL:$e,notificationData:Ne,setNotificationData:he,announcementData:ge,setAnnouncementData:ye,handleAnnouncement:Ft,searchTerminalCoin:ve,setSearchTerminalCoin:je,isSearchTerminalError:Ie,setIsSearchTerminalError:Le,botSlotsInfo:it,setBotSlotsInfo:tt,refreshBotSlots:lt},children:e})},Hbt="data:image/svg+xml,%3csvg%20width='21'%20height='20'%20viewBox='0%200%2021%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M10.6758%2020C16.1986%2020%2020.6758%2015.5228%2020.6758%2010C20.6758%204.47715%2016.1986%200%2010.6758%200C5.15293%200%200.675781%204.47715%200.675781%2010C0.675781%2015.5228%205.15293%2020%2010.6758%2020Z'%20fill='url(%23paint0_linear_26_4024)'/%3e%3cpath%20d='M15.667%205.86343C15.756%205.28809%2015.209%204.83396%2014.6975%205.05857L4.50863%209.532C4.14178%209.69307%204.16862%2010.2488%204.5491%2010.3699L6.65026%2011.0391C7.05133%2011.1668%207.48554%2011.1007%207.83576%2010.8588L12.573%207.58593C12.7159%207.48721%2012.8716%207.69036%2012.7495%207.81614L9.33954%2011.3319C9.00876%2011.6729%209.0744%2012.2509%209.47233%2012.5004L13.2902%2014.8945C13.7184%2015.163%2014.2693%2014.8933%2014.3493%2014.3758L15.667%205.86343Z'%20fill='white'/%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_26_4024'%20x1='10.6758'%20y1='0'%20x2='10.6758'%20y2='20'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%2337BBFE'/%3e%3cstop%20offset='1'%20stop-color='%23007DBB'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e",Gi="/assets/dextrabotIcon-B5aLRkPC.png",Vbt="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fillRule='evenodd'%20clipRule='evenodd'%20d='M9.72943%203.99268C10.8214%202.39501%2013.1782%202.39502%2014.2702%203.99268L14.7021%204.62463C17.4081%208.58385%2019.7331%2012.7905%2021.6458%2017.1881L21.736%2017.3956C22.4101%2018.9453%2021.3917%2020.705%2019.7122%2020.8927C14.5865%2021.4656%209.41304%2021.4656%204.28741%2020.8927C2.60787%2020.705%201.5895%2018.9453%202.26356%2017.3956L2.35377%2017.1881C4.2665%2012.7905%206.59147%208.58384%209.29751%204.62463L9.72943%203.99268ZM12.9998%209.00005C12.9998%209.55233%2012.5521%2010%2011.9998%2010C11.4475%2010%2010.9998%209.55233%2010.9998%209.00005C10.9998%208.44776%2011.4475%208.00005%2011.9998%208.00005C12.5521%208.00005%2012.9998%208.44776%2012.9998%209.00005ZM11.9998%2011.75C12.414%2011.75%2012.7498%2012.0858%2012.7498%2012.5V17.5C12.7498%2017.9143%2012.414%2018.25%2011.9998%2018.25C11.5856%2018.25%2011.2498%2017.9143%2011.2498%2017.5V12.5C11.2498%2012.0858%2011.5856%2011.75%2011.9998%2011.75Z'%20fill='%23FF3566'/%3e%3c/svg%3e",Wbt="data:image/svg+xml,%3csvg%20width='32'%20height='32'%20viewBox='0%200%2032%2032'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M29.2932%209.61329C28.9198%205.97329%2026.0265%203.07996%2022.3865%202.70663C22.1198%202.67996%2021.8532%202.66663%2021.5865%202.66663H10.4132C10.1465%202.66663%209.87984%202.67996%209.61317%202.70663C5.97317%203.07996%203.07984%205.97329%202.7065%209.61329C2.67984%209.87996%202.6665%2010.1466%202.6665%2010.4133V21.5866C2.6665%2021.8533%202.67984%2022.12%202.7065%2022.3866C3.07984%2026.0266%205.97317%2028.92%209.61317%2029.2933C9.87984%2029.32%2010.1465%2029.3333%2010.4132%2029.3333H18.6665C19.3998%2029.3333%2019.9998%2028.7333%2019.9998%2028V24.04C19.9998%2021.8133%2021.8132%2020%2024.0398%2020H27.9998C28.7332%2020%2029.3332%2019.4%2029.3332%2018.6666V10.4133C29.3332%2010.1466%2029.3198%209.87996%2029.2932%209.61329ZM10.3332%2018C10.3332%2018.5466%209.87984%2019%209.33317%2019C8.7865%2019%208.33317%2018.5466%208.33317%2018V14C8.33317%2013.4533%208.7865%2013%209.33317%2013C9.87984%2013%2010.3332%2013.4533%2010.3332%2014V18ZM16.9998%2018C16.9998%2018.5466%2016.5465%2019%2015.9998%2019C15.4532%2019%2014.9998%2018.5466%2014.9998%2018V14C14.9998%2013.4533%2015.4532%2013%2015.9998%2013C16.5465%2013%2016.9998%2013.4533%2016.9998%2014V18Z'%20fill='%23FFA756'/%3e%3cpath%20d='M27.9602%2021.3334H24.0402C22.3468%2021.3334%2021.3335%2022.3467%2021.3335%2024.04V27.96C21.3335%2029.6534%2022.3468%2030.6667%2024.0402%2030.6667H27.9602C29.6535%2030.6667%2030.6668%2029.6534%2030.6668%2027.96V24.04C30.6668%2022.3467%2029.6535%2021.3334%2027.9602%2021.3334ZM28.6268%2027.4134C28.9602%2027.7467%2028.9602%2028.2934%2028.6268%2028.6267C28.4535%2028.7867%2028.2268%2028.8667%2028.0135%2028.8667C27.8002%2028.8667%2027.5735%2028.7867%2027.4002%2028.6267L25.9868%2027.2134L24.6002%2028.6267C24.4268%2028.7867%2024.2135%2028.8667%2023.9735%2028.8667C23.7735%2028.8667%2023.5468%2028.7867%2023.3868%2028.6267C23.0535%2028.2934%2023.0535%2027.7467%2023.3868%2027.4134L24.8002%2026L23.3868%2024.6C23.0535%2024.2667%2023.0535%2023.72%2023.3868%2023.3867C23.7202%2023.0534%2024.2668%2023.0534%2024.6002%2023.3867L25.9868%2024.8L27.4002%2023.3867C27.7335%2023.0534%2028.2935%2023.0534%2028.6268%2023.3867C28.9602%2023.72%2028.9602%2024.2667%2028.6268%2024.6L27.2135%2026L28.6268%2027.4134Z'%20fill='%23FFA756'/%3e%3c/svg%3e",Va="data:image/svg+xml,%3csvg%20width='40'%20height='40'%20viewBox='0%200%2040%2040'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20x='0.5'%20y='0.5'%20width='39'%20height='39'%20rx='19.5'%20fill='%23232323'/%3e%3crect%20x='0.5'%20y='0.5'%20width='39'%20height='39'%20rx='19.5'%20stroke='%23ACACAC'%20style='mix-blend-mode:color-dodge'/%3e%3cpath%20d='M21.1515%2013.9091C21.1515%2012.3024%2022.454%2011%2024.0606%2011C25.6673%2011%2026.9697%2012.3024%2026.9697%2013.9091C26.9697%2015.5157%2025.6673%2016.8182%2024.0606%2016.8182C22.454%2016.8182%2021.1515%2015.5157%2021.1515%2013.9091Z'%20fill='%236C6C6C'/%3e%3cpath%20d='M17.5365%2017.017C17.2707%2016.5917%2016.8045%2016.3333%2016.303%2016.3333C15.8015%2016.3333%2015.3354%2016.5917%2015.0696%2017.017L10.2211%2024.7745C9.94085%2025.2229%209.92601%2025.7881%2010.1823%2026.2506C10.4387%2026.7131%2010.9258%2027%2011.4545%2027H26.9697C27.5206%2027%2028.0243%2026.6887%2028.2707%2026.1959C28.5171%2025.7032%2028.4639%2025.1135%2028.1333%2024.6727L25.2243%2020.7939C24.9496%2020.4277%2024.5184%2020.2121%2024.0606%2020.2121C23.6028%2020.2121%2023.1717%2020.4277%2022.897%2020.7939L21.2607%2022.9757L17.5365%2017.017Z'%20fill='%236C6C6C'/%3e%3c/svg%3e",Ba="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M17.6568%2017.6568L6.34314%206.34314'%20stroke='white'%20stroke-width='2'%20stroke-linecap='round'%20/%3e%3cpath%20d='M17.6569%206.34314L6.34315%2017.6568'%20stroke='white'%20stroke-width='2'%20stroke-linecap='round'%20/%3e%3c/svg%3e",wo="data:image/svg+xml,%3csvg%20width='14'%20height='14'%20viewBox='0%200%2014%2014'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M9.33342%207.52484V9.97484C9.33342%2012.0165%208.51675%2012.8332%206.47508%2012.8332H4.02508C1.98341%2012.8332%201.16675%2012.0165%201.16675%209.97484V7.52484C1.16675%205.48317%201.98341%204.6665%204.02508%204.6665H6.47508C8.51675%204.6665%209.33342%205.48317%209.33342%207.52484Z'%20fill='%23989898'/%3e%3cpath%20d='M9.97511%201.1665H7.52511C5.89748%201.1665%205.05203%201.68923%204.77585%202.93218C4.65505%203.47584%205.1276%203.93734%205.68451%203.93734H6.47511C8.92511%203.93734%2010.0626%205.07484%2010.0626%207.52484V8.31543C10.0626%208.87235%2010.5241%209.34489%2011.0678%209.22409C12.3107%208.94791%2012.8334%208.10247%2012.8334%206.47484V4.02484C12.8334%201.98317%2012.0168%201.1665%209.97511%201.1665Z'%20fill='%23989898'/%3e%3c/svg%3e",qbt="data:image/svg+xml,%3csvg%20width='18'%20height='18'%20viewBox='0%200%2018%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M13.53%2010.1625C13.215%2010.47%2013.035%2010.9125%2013.08%2011.385C13.1475%2012.195%2013.89%2012.7875%2014.7%2012.7875H16.125V13.68C16.125%2015.2325%2014.8575%2016.5%2013.305%2016.5H4.695C3.1425%2016.5%201.875%2015.2325%201.875%2013.68V8.63251C1.875%207.08001%203.1425%205.8125%204.695%205.8125H13.305C14.8575%205.8125%2016.125%207.08001%2016.125%208.63251V9.71251H14.61C14.19%209.71251%2013.8075%209.87749%2013.53%2010.1625Z'%20stroke='white'%20stroke-width='1.2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M1.875%209.30748V5.88002C1.875%204.98752%202.4225%204.19248%203.255%203.87748L9.21%201.62748C10.14%201.27498%2011.1375%201.96501%2011.1375%202.96251V5.8125'%20stroke='white'%20stroke-width='1.2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M16.9191%2010.4776V12.0227C16.9191%2012.4352%2016.5891%2012.7726%2016.1691%2012.7876H14.6991C13.8891%2012.7876%2013.1466%2012.1951%2013.0791%2011.3851C13.0341%2010.9126%2013.2141%2010.4701%2013.5291%2010.1626C13.8066%209.87763%2014.1891%209.71265%2014.6091%209.71265H16.1691C16.5891%209.72765%2016.9191%2010.0651%2016.9191%2010.4776Z'%20stroke='white'%20stroke-width='1.2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M5.25%209H10.5'%20stroke='white'%20stroke-width='1.2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",dx="data:image/svg+xml,%3csvg%20width='14'%20height='14'%20viewBox='0%200%2014%2014'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M14%206.97075C14%2011.5992%2011.1675%2013.0844%209.67513%2011.762C8.44671%2010.6837%208.08122%208.40507%206.2335%208.17111C3.88832%207.87611%203.68528%2010.999%202.14214%2010.999C0.345178%2010.999%200%208.38472%200%207.04196C0%205.66867%200.385787%203.79694%201.91878%203.79694C3.70559%203.79694%203.80711%206.4723%206.04061%206.32988C8.26396%206.1773%208.30457%203.39004%209.74624%202.19986C11.0051%201.17244%2014%202.28124%2014%206.97075Z'%20fill='%2397FCE4'/%3e%3c/svg%3e",rke="data:image/svg+xml,%3csvg%20width='14'%20height='9'%20viewBox='0%200%2014%209'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M4.33013%201.5C5.48483%20-0.500002%208.37158%20-0.5%209.52628%201.5L13.8564%209H0L4.33013%201.5Z'%20fill='%23404040'/%3e%3c/svg%3e",Gbt="data:image/svg+xml,%3csvg%20width='14'%20height='14'%20viewBox='0%200%2014%2014'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20x='4'%20y='4'%20width='6'%20height='6'%20rx='3'%20fill='%23D35B5B'/%3e%3c/svg%3e",Kbt="data:image/svg+xml,%3csvg%20width='14'%20height='14'%20viewBox='0%200%2014%2014'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20x='4'%20y='4'%20width='6'%20height='6'%20rx='3'%20fill='%230BAA60'/%3e%3c/svg%3e",ac="/assets/noDataNewIcon-D33nv6-9.svg",NA="data:image/svg+xml,%3csvg%20width='18'%20height='18'%20viewBox='0%200%2018%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M10.2967%202.63297L11.6167%205.27297C11.7967%205.64047%2012.2767%205.99297%2012.6817%206.06047L15.0742%206.45797C16.6042%206.71297%2016.9642%207.82297%2015.8617%208.91797L14.0017%2010.778C13.6867%2011.093%2013.5142%2011.7005%2013.6117%2012.1355L14.1442%2014.438C14.5642%2016.2605%2013.5967%2016.9655%2011.9842%2016.013L9.7417%2014.6855C9.3367%2014.4455%208.6692%2014.4455%208.2567%2014.6855L6.0142%2016.013C4.4092%2016.9655%203.4342%2016.253%203.8542%2014.438L4.3867%2012.1355C4.4842%2011.7005%204.3117%2011.093%203.9967%2010.778L2.1367%208.91797C1.0417%207.82297%201.3942%206.71297%202.9242%206.45797L5.3167%206.06047C5.7142%205.99297%206.1942%205.64047%206.3742%205.27297L7.6942%202.63297C8.4142%201.20047%209.5842%201.20047%2010.2967%202.63297Z'%20stroke='%239B9B9B'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",o5="data:image/svg+xml,%3csvg%20width='18'%20height='18'%20viewBox='0%200%2018%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M10.2967%202.63297L11.6167%205.27297C11.7967%205.64047%2012.2767%205.99297%2012.6817%206.06047L15.0742%206.45797C16.6042%206.71297%2016.9642%207.82297%2015.8617%208.91797L14.0017%2010.778C13.6867%2011.093%2013.5142%2011.7005%2013.6117%2012.1355L14.1442%2014.438C14.5642%2016.2605%2013.5967%2016.9655%2011.9842%2016.013L9.7417%2014.6855C9.3367%2014.4455%208.6692%2014.4455%208.2567%2014.6855L6.0142%2016.013C4.4092%2016.9655%203.4342%2016.253%203.8542%2014.438L4.3867%2012.1355C4.4842%2011.7005%204.3117%2011.093%203.9967%2010.778L2.1367%208.91797C1.0417%207.82297%201.3942%206.71297%202.9242%206.45797L5.3167%206.06047C5.7142%205.99297%206.1942%205.64047%206.3742%205.27297L7.6942%202.63297C8.4142%201.20047%209.5842%201.20047%2010.2967%202.63297Z'%20fill='%23FFC01F'/%3e%3c/svg%3e",Ybt="/assets/referralBgIcon-C-Csekzm.svg",l5="data:image/svg+xml,%3csvg%20width='18'%20height='18'%20viewBox='0%200%2018%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_1635_11489)'%3e%3cpath%20d='M7.58763%209.47632C8.45415%209.97644%208.8874%2010.2265%209.36324%2010.2269C9.83905%2010.2273%2010.2727%209.97802%2011.1401%209.47942L16.6693%206.30109C16.9189%206.15761%2017.0728%205.89166%2017.0728%205.60374C17.0728%205.31582%2016.9189%205.04987%2016.6693%204.90639L11.1381%201.7269C10.2717%201.22883%209.83844%200.979795%209.3631%200.979981C8.88773%200.980166%208.45471%201.22954%207.58863%201.72828L2.83367%204.4665C2.79841%204.4868%202.7808%204.49696%202.76438%204.50657C1.14012%205.45741%200.136601%207.19333%200.123183%209.07539C0.123047%209.09441%200.123047%209.11474%200.123047%209.15542C0.123047%209.19601%200.123047%209.21634%200.123182%209.23534C0.136571%2011.1153%201.13785%2012.8496%202.75921%2013.8012C2.7756%2013.8108%202.79321%2013.8209%202.82838%2013.8413L5.80688%2015.561C7.54244%2016.563%208.41021%2017.064%209.36318%2017.0644C10.3161%2017.0647%2011.1843%2016.5642%2012.9205%2015.5633L16.0647%2013.7508C16.9341%2013.2496%2017.3688%2012.9991%2017.6074%2012.5859C17.8461%2012.1728%2017.8461%2011.6711%2017.8461%2010.6676V8.72907C17.8461%208.4507%2017.6954%208.19416%2017.4521%208.05869C17.2168%207.92762%2016.9299%207.92956%2016.6964%208.06381L10.2491%2011.7699C9.81659%2012.0185%209.60028%2012.1429%209.36296%2012.1429C9.12561%2012.143%208.90925%2012.0188%208.47653%2011.7704L4.11289%209.2656C3.89431%209.14013%203.78501%209.07738%203.69722%209.06605C3.49709%209.04022%203.30466%209.15234%203.22842%209.33918C3.195%209.42113%203.19566%209.54715%203.19702%209.79918C3.19802%209.98472%203.19851%2010.0775%203.21585%2010.1628C3.2547%2010.3539%203.35522%2010.527%203.50202%2010.6553C3.56757%2010.7127%203.6479%2010.7591%203.80863%2010.8518L8.47406%2013.5445C8.90792%2013.7949%209.12483%2013.9201%209.36302%2013.9202C9.60122%2013.9202%209.81822%2013.7952%2010.2522%2013.545L15.9706%2010.2487C16.1189%2010.1632%2016.193%2010.1205%2016.2486%2010.1526C16.3041%2010.1847%2016.3041%2010.2703%2016.3041%2010.4414V11.3206C16.3041%2011.5715%2016.3041%2011.6969%2016.2445%2011.8002C16.1848%2011.9035%2016.0761%2011.9661%2015.8588%2012.0914L11.1422%2014.8103C10.2738%2015.3108%209.83968%2015.5611%209.36313%2015.5608C8.88654%2015.5606%208.4526%2015.31%207.58475%2014.8086L3.17196%2012.2596C3.15794%2012.2514%203.15094%2012.2474%203.1444%2012.2436C2.21916%2011.7029%201.64824%2010.7138%201.64288%209.64217C1.64285%209.63461%201.64285%209.62652%201.64285%209.61032V8.8032C1.64285%208.21161%201.95792%207.6648%202.46974%207.36813C2.92201%207.10599%203.47987%207.10547%203.93261%207.36677L7.58763%209.47632Z'%20fill='%23F2F7F7'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_1635_11489'%3e%3crect%20width='18'%20height='18'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",gm="data:image/svg+xml,%3csvg%20width='18'%20height='18'%20viewBox='0%200%2018%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M9.75%208.24998L15.9%202.09998'%20stroke='white'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M16.5%205.1V1.5H12.9'%20stroke='white'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M8.25%201.5H6.75C3%201.5%201.5%203%201.5%206.75V11.25C1.5%2015%203%2016.5%206.75%2016.5H11.25C15%2016.5%2016.5%2015%2016.5%2011.25V9.75'%20stroke='white'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",hM="data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M10.6668%208.60016V11.4002C10.6668%2013.7335%209.7335%2014.6668%207.40016%2014.6668H4.60016C2.26683%2014.6668%201.3335%2013.7335%201.3335%2011.4002V8.60016C1.3335%206.26683%202.26683%205.3335%204.60016%205.3335H7.40016C9.7335%205.3335%2010.6668%206.26683%2010.6668%208.60016Z'%20stroke='white'%20stroke-width='1.2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M14.6668%204.60016V7.40016C14.6668%209.7335%2013.7335%2010.6668%2011.4002%2010.6668H10.6668V8.60016C10.6668%206.26683%209.7335%205.3335%207.40016%205.3335H5.3335V4.60016C5.3335%202.26683%206.26683%201.3335%208.60016%201.3335H11.4002C13.7335%201.3335%2014.6668%202.26683%2014.6668%204.60016Z'%20stroke='white'%20stroke-width='1.2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",Xbt="data:image/svg+xml,%3csvg%20width='48'%20height='48'%20viewBox='0%200%2048%2048'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M35.0601%2015.54C34.9201%2015.52%2034.7801%2015.52%2034.6401%2015.54C31.5401%2015.44%2029.0801%2012.9%2029.0801%209.78C29.0801%206.6%2031.6601%204%2034.8601%204C38.0401%204%2040.6401%206.58%2040.6401%209.78C40.6201%2012.9%2038.1601%2015.44%2035.0601%2015.54Z'%20fill='white'/%3e%3cpath%20d='M41.58%2029.3998C39.34%2030.8998%2036.1999%2031.4598%2033.2999%2031.0798C34.0599%2029.4398%2034.4599%2027.6198%2034.4799%2025.6998C34.4799%2023.6998%2034.04%2021.7998%2033.2%2020.1398C36.16%2019.7398%2039.3%2020.2998%2041.56%2021.7998C44.72%2023.8798%2044.72%2027.2998%2041.58%2029.3998Z'%20fill='white'/%3e%3cpath%20d='M12.8801%2015.54C13.0201%2015.52%2013.1601%2015.52%2013.3001%2015.54C16.4001%2015.44%2018.8601%2012.9%2018.8601%209.78C18.8601%206.58%2016.2801%204%2013.0801%204C9.90007%204%207.32007%206.58%207.32007%209.78C7.32007%2012.9%209.78007%2015.44%2012.8801%2015.54Z'%20fill='white'/%3e%3cpath%20d='M13.1%2025.7002C13.1%2027.6402%2013.52%2029.4802%2014.28%2031.1402C11.46%2031.4402%208.51999%2030.8402%206.35999%2029.4202C3.19999%2027.3202%203.19999%2023.9002%206.35999%2021.8002C8.49999%2020.3602%2011.52%2019.7802%2014.36%2020.1002C13.54%2021.7802%2013.1%2023.6802%2013.1%2025.7002Z'%20fill='white'/%3e%3cpath%20d='M24.2401%2031.74C24.0801%2031.72%2023.9001%2031.72%2023.7201%2031.74C20.0401%2031.62%2017.1001%2028.6%2017.1001%2024.88C17.1201%2021.08%2020.1801%2018%2024.0001%2018C27.8001%2018%2030.8801%2021.08%2030.8801%2024.88C30.8601%2028.6%2027.9401%2031.62%2024.2401%2031.74Z'%20fill='white'/%3e%3cpath%20d='M17.7401%2035.8798C14.7201%2037.8998%2014.7201%2041.2198%2017.7401%2043.2198C21.1801%2045.5198%2026.8201%2045.5198%2030.2601%2043.2198C33.2801%2041.1998%2033.2801%2037.8798%2030.2601%2035.8798C26.8401%2033.5798%2021.2001%2033.5798%2017.7401%2035.8798Z'%20fill='white'/%3e%3c/svg%3e",Qbt="data:image/svg+xml,%3csvg%20width='48'%20height='48'%20viewBox='0%200%2048%2048'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M24%204C12.98%204%204%2012.98%204%2024C4%2035.02%2012.98%2044%2024%2044C35.02%2044%2044%2035.02%2044%2024C44%2012.98%2035.02%204%2024%204ZM33.56%2019.4L22.22%2030.74C21.94%2031.02%2021.56%2031.18%2021.16%2031.18C20.76%2031.18%2020.38%2031.02%2020.1%2030.74L14.44%2025.08C13.86%2024.5%2013.86%2023.54%2014.44%2022.96C15.02%2022.38%2015.98%2022.38%2016.56%2022.96L21.16%2027.56L31.44%2017.28C32.02%2016.7%2032.98%2016.7%2033.56%2017.28C34.14%2017.86%2034.14%2018.8%2033.56%2019.4Z'%20fill='%231DE6A3'/%3e%3c/svg%3e",Zbt="data:image/svg+xml,%3csvg%20width='64'%20height='64'%20viewBox='0%200%2064%2064'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M48.107%2039.1333C46.987%2040.2266%2046.347%2041.8%2046.507%2043.48C46.747%2046.36%2049.387%2048.4666%2052.267%2048.4666H57.3337V51.64C57.3337%2057.16%2052.827%2061.6667%2047.307%2061.6667H16.6937C11.1737%2061.6667%206.66699%2057.16%206.66699%2051.64V33.6933C6.66699%2028.1733%2011.1737%2023.6667%2016.6937%2023.6667H47.307C52.827%2023.6667%2057.3337%2028.1733%2057.3337%2033.6933V37.5334H51.947C50.4537%2037.5334%2049.0937%2038.12%2048.107%2039.1333Z'%20stroke='white'%20stroke-width='2.4'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M6.66699%2036.0933V23.9068C6.66699%2020.7334%208.61366%2017.9067%2011.5737%2016.7867L32.747%208.78666C36.0537%207.53333%2039.6003%209.98674%2039.6003%2013.5334V23.6667'%20stroke='white'%20stroke-width='2.4'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M60.1572%2040.2537V45.7472C60.1572%2047.2139%2058.9838%2048.4138%2057.4905%2048.4671H52.2638C49.3838%2048.4671%2046.7438%2046.3605%2046.5038%2043.4805C46.3438%2041.8005%2046.9838%2040.2271%2048.1038%2039.1338C49.0905%2038.1205%2050.4505%2037.5339%2051.9438%2037.5339H57.4905C58.9838%2037.5872%2060.1572%2038.7871%2060.1572%2040.2537Z'%20stroke='white'%20stroke-width='2.4'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M18.667%2035H37.3337'%20stroke='white'%20stroke-width='2.4'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",Jbt="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M12%2021C5.50558%2021%202.95666%2020.5387%202.54353%2018.2033C2.13039%2015.8679%204.77383%2011.4774%205.58842%2010.0285C8.31257%205.18408%2010.1637%203%2012%203C13.8363%203%2015.6874%205.18408%2018.4116%2010.0285C19.2262%2011.4774%2021.8696%2015.8679%2021.4565%2018.2033C21.0444%2020.5387%2018.4944%2021%2012%2021Z'%20stroke='%23FF9900'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M12%208.5V12.395'%20stroke='%23FF9900'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M11.9955%2015.8945H12.0045'%20stroke='%23FF9900'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",pM="data:image/svg+xml,%3csvg%20width='21'%20height='21'%20viewBox='0%200%2021%2021'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M9.75764%205.18999L14.1826%207.15499C15.4576%207.71749%2015.4576%208.64749%2014.1826%209.20999L9.75764%2011.175C9.25514%2011.4%208.43014%2011.4%207.92764%2011.175L3.50264%209.20999C2.22764%208.64749%202.22764%207.71749%203.50264%207.15499L7.92764%205.18999C8.43014%204.96499%209.25514%204.96499%209.75764%205.18999Z'%20stroke='%2367FFBD'%20stroke-width='1.2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M2.25%2011.25C2.25%2011.88%202.7225%2012.6075%203.3%2012.8625L8.3925%2015.1275C8.7825%2015.3%209.225%2015.3%209.6075%2015.1275L14.7%2012.8625C15.2775%2012.6075%2015.75%2011.88%2015.75%2011.25'%20stroke='%2367FFBD'%20stroke-width='1.2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M2.25%2015C2.25%2015.6975%202.6625%2016.3275%203.3%2016.6125L8.3925%2018.8775C8.7825%2019.05%209.225%2019.05%209.6075%2018.8775L14.7%2016.6125C15.3375%2016.3275%2015.75%2015.6975%2015.75%2015'%20stroke='%2367FFBD'%20stroke-width='1.2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3ccircle%20cx='16'%20cy='5'%20r='4.5'%20fill='%2367FFBD'%20stroke='%23273F35'/%3e%3c/svg%3e",mM="data:image/svg+xml,%3csvg%20width='21'%20height='21'%20viewBox='0%200%2021%2021'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M9.75764%205.18999L14.1826%207.15499C15.4576%207.71749%2015.4576%208.64749%2014.1826%209.20999L9.75764%2011.175C9.25514%2011.4%208.43014%2011.4%207.92764%2011.175L3.50264%209.20999C2.22764%208.64749%202.22764%207.71749%203.50264%207.15499L7.92764%205.18999C8.43014%204.96499%209.25514%204.96499%209.75764%205.18999Z'%20stroke='%23FF797C'%20stroke-width='1.2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M2.25%2011.25C2.25%2011.88%202.7225%2012.6075%203.3%2012.8625L8.3925%2015.1275C8.7825%2015.3%209.225%2015.3%209.6075%2015.1275L14.7%2012.8625C15.2775%2012.6075%2015.75%2011.88%2015.75%2011.25'%20stroke='%23FF797C'%20stroke-width='1.2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M2.25%2015C2.25%2015.6975%202.6625%2016.3275%203.3%2016.6125L8.3925%2018.8775C8.7825%2019.05%209.225%2019.05%209.6075%2018.8775L14.7%2016.6125C15.3375%2016.3275%2015.75%2015.6975%2015.75%2015'%20stroke='%23FF797C'%20stroke-width='1.2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3ccircle%20cx='16'%20cy='5'%20r='4.5'%20fill='%23FF797C'%20stroke='%233F2A2B'/%3e%3c/svg%3e",AA="/assets/sharePnlGreenIcon-CwGFUwvO.svg",jA="/assets/sharePnlRedIcon-NsgQBTQF.svg",EA="/assets/dextrabotShareIcon-DbUzC8hq.png",eyt="/assets/buttonHyperrIcon-BEIlirim.png",Vme="/assets/mushroomRed-DlifwotO.svg",Wme="/assets/mushroomBlue-DU8qWKKQ.svg",Yc="data:image/svg+xml,%3csvg%20width='11'%20height='8'%20viewBox='0%200%2011%208'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M1%203.83L3.83%206.66L9.5%201'%20stroke='white'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",tyt="data:image/svg+xml,%3csvg%20width='28'%20height='32'%20viewBox='0%200%2028%2032'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20filter='url(%23filter0_d_92_32471)'%3e%3cpath%20d='M18.4324%2015.0402H16.1149V9.64023C16.1149%208.38023%2015.4324%208.12523%2014.5999%209.07023L13.9999%209.75273L8.92239%2015.5277C8.22489%2016.3152%208.51739%2016.9602%209.56739%2016.9602H11.8849V22.3602C11.8849%2023.6202%2012.5674%2023.8752%2013.3999%2022.9302L13.9999%2022.2477L19.0774%2016.4727C19.7749%2015.6852%2019.4824%2015.0402%2018.4324%2015.0402Z'%20fill='%2367FFBD'/%3e%3c/g%3e%3cdefs%3e%3cfilter%20id='filter0_d_92_32471'%20x='-3'%20y='-0.999756'%20width='34'%20height='34'%20filterUnits='userSpaceOnUse'%20color-interpolation-filters='sRGB'%3e%3cfeFlood%20flood-opacity='0'%20result='BackgroundImageFix'/%3e%3cfeColorMatrix%20in='SourceAlpha'%20type='matrix'%20values='0%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%20127%200'%20result='hardAlpha'/%3e%3cfeOffset/%3e%3cfeGaussianBlur%20stdDeviation='4'/%3e%3cfeComposite%20in2='hardAlpha'%20operator='out'/%3e%3cfeColorMatrix%20type='matrix'%20values='0%200%200%200%200.403922%200%200%200%200%201%200%200%200%200%200.741176%200%200%200%200.48%200'/%3e%3cfeBlend%20mode='normal'%20in2='BackgroundImageFix'%20result='effect1_dropShadow_92_32471'/%3e%3cfeBlend%20mode='normal'%20in='SourceGraphic'%20in2='effect1_dropShadow_92_32471'%20result='shape'/%3e%3c/filter%3e%3c/defs%3e%3c/svg%3e",nyt="data:image/svg+xml,%3csvg%20width='35'%20height='30'%20viewBox='0%200%2035%2030'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20filter='url(%23filter0_d_92_32478)'%3e%3cpath%20d='M20.4658%209.05899L21.6995%2011.5265C21.8658%2011.8677%2022.312%2012.1915%2022.6883%2012.2615L24.9195%2012.629C26.3458%2012.8652%2026.6783%2013.8977%2025.6545%2014.9302L23.9133%2016.6715C23.6245%2016.9602%2023.4583%2017.529%2023.5545%2017.9402L24.0533%2020.0927C24.447%2021.7902%2023.537%2022.4552%2022.0408%2021.5627L19.9495%2020.3202C19.5733%2020.0927%2018.9433%2020.0927%2018.567%2020.3202L16.4758%2021.5627C14.9795%2022.4465%2014.0695%2021.7902%2014.4633%2020.0927L14.962%2017.9402C15.0408%2017.5202%2014.8745%2016.9515%2014.5858%2016.6627L12.8445%2014.9215C11.8208%2013.8977%2012.1533%2012.8652%2013.5795%2012.6202L15.8108%2012.2527C16.187%2012.1915%2016.6333%2011.859%2016.7995%2011.5177L18.0333%209.05024C18.707%207.72024%2019.792%207.72024%2020.4658%209.05899Z'%20fill='%23D65AFF'/%3e%3cpath%20d='M14%209.53149H8.75C8.39125%209.53149%208.09375%209.23399%208.09375%208.87524C8.09375%208.51649%208.39125%208.21899%208.75%208.21899H14C14.3587%208.21899%2014.6562%208.51649%2014.6562%208.87524C14.6562%209.23399%2014.3587%209.53149%2014%209.53149Z'%20fill='%23D65AFF'/%3e%3cpath%20d='M11.375%2021.7815H8.75C8.39125%2021.7815%208.09375%2021.484%208.09375%2021.1252C8.09375%2020.7665%208.39125%2020.469%208.75%2020.469H11.375C11.7338%2020.469%2012.0312%2020.7665%2012.0312%2021.1252C12.0312%2021.484%2011.7338%2021.7815%2011.375%2021.7815Z'%20fill='%23D65AFF'/%3e%3cpath%20d='M9.625%2015.6565H8.75C8.39125%2015.6565%208.09375%2015.359%208.09375%2015.0002C8.09375%2014.6415%208.39125%2014.344%208.75%2014.344H9.625C9.98375%2014.344%2010.2812%2014.6415%2010.2812%2015.0002C10.2812%2015.359%209.98375%2015.6565%209.625%2015.6565Z'%20fill='%23D65AFF'/%3e%3c/g%3e%3cdefs%3e%3cfilter%20id='filter0_d_92_32478'%20x='-1'%20y='-3.49976'%20width='37'%20height='37'%20filterUnits='userSpaceOnUse'%20color-interpolation-filters='sRGB'%3e%3cfeFlood%20flood-opacity='0'%20result='BackgroundImageFix'/%3e%3cfeColorMatrix%20in='SourceAlpha'%20type='matrix'%20values='0%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%20127%200'%20result='hardAlpha'/%3e%3cfeOffset/%3e%3cfeGaussianBlur%20stdDeviation='4'/%3e%3cfeComposite%20in2='hardAlpha'%20operator='out'/%3e%3cfeColorMatrix%20type='matrix'%20values='0%200%200%200%200.839216%200%200%200%200%200.352941%200%200%200%200%201%200%200%200%200.48%200'/%3e%3cfeBlend%20mode='normal'%20in2='BackgroundImageFix'%20result='effect1_dropShadow_92_32478'/%3e%3cfeBlend%20mode='normal'%20in='SourceGraphic'%20in2='effect1_dropShadow_92_32478'%20result='shape'/%3e%3c/filter%3e%3c/defs%3e%3c/svg%3e",ec="data:image/svg+xml,%3csvg%20width='18'%20height='18'%20viewBox='0%200%2018%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M9%206.75V10.5'%20stroke='%23FF797C'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M8.99958%2016.0575H4.45458C1.85208%2016.0575%200.764583%2014.1975%202.02458%2011.925L4.36458%207.70996L6.56958%203.74996C7.90458%201.34246%2010.0946%201.34246%2011.4296%203.74996L13.6346%207.71746L15.9746%2011.9325C17.2346%2014.205%2016.1396%2016.065%2013.5446%2016.065H8.99958V16.0575Z'%20stroke='%23FF797C'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M8.99609%2012.75H9.00283'%20stroke='%23FF797C'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",tae="data:image/svg+xml,%3csvg%20width='86'%20height='86'%20viewBox='0%200%2086%2086'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3ccircle%20cx='43'%20cy='43'%20r='43'%20fill='%231DE6A3'%20fill-opacity='0.16'/%3e%3cpath%20d='M42.9987%2016.3335C28.3054%2016.3335%2016.332%2028.3068%2016.332%2043.0002C16.332%2057.6935%2028.3054%2069.6668%2042.9987%2069.6668C57.692%2069.6668%2069.6654%2057.6935%2069.6654%2043.0002C69.6654%2028.3068%2057.692%2016.3335%2042.9987%2016.3335ZM55.7454%2036.8668L40.6254%2051.9868C40.252%2052.3602%2039.7454%2052.5735%2039.212%2052.5735C38.6787%2052.5735%2038.172%2052.3602%2037.7987%2051.9868L30.252%2044.4402C29.4787%2043.6668%2029.4787%2042.3868%2030.252%2041.6135C31.0254%2040.8402%2032.3054%2040.8402%2033.0787%2041.6135L39.212%2047.7468L52.9187%2034.0402C53.692%2033.2668%2054.972%2033.2668%2055.7454%2034.0402C56.5187%2034.8135%2056.5187%2036.0668%2055.7454%2036.8668Z'%20fill='%231DE6A3'/%3e%3c/svg%3e",ryt="/assets/copyTradeBanner-Bzh6f0rX.svg",syt="data:image/svg+xml,%3csvg%20width='18'%20height='18'%20viewBox='0%200%2018%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M9%2016.5C13.1421%2016.5%2016.5%2013.1421%2016.5%209C16.5%204.85786%2013.1421%201.5%209%201.5C4.85786%201.5%201.5%204.85786%201.5%209C1.5%2013.1421%204.85786%2016.5%209%2016.5Z'%20stroke='%23FFD979'%20stroke-width='1.2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M6.375%209H10.875'%20stroke='%23FFD979'%20stroke-width='1.2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M9.375%2011.25L11.625%209L9.375%206.75'%20stroke='%23FFD979'%20stroke-width='1.2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",qme="data:image/svg+xml,%3csvg%20width='12'%20height='12'%20viewBox='0%200%2012%2012'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_2782_17351)'%3e%3cpath%20d='M5.05842%206.31754C5.6361%206.65096%205.92493%206.81767%206.24216%206.81794C6.55936%206.81822%206.84849%206.65201%207.42676%206.31961L11.1129%204.20073C11.2793%204.10508%2011.3819%203.92777%2011.3819%203.73583C11.3819%203.54388%2011.2793%203.36658%2011.1129%203.27093L7.42543%201.15127C6.84779%200.81922%206.55896%200.653197%206.24207%200.65332C5.92515%200.653444%205.63647%200.819692%205.05909%201.15219L1.88911%202.97767C1.86561%202.9912%201.85387%202.99797%201.84292%203.00438C0.76008%203.63828%200.0910671%204.79556%200.0821217%206.05026C0.0820312%206.06294%200.0820313%206.07649%200.0820313%206.10361C0.0820313%206.13068%200.0820312%206.14423%200.0821215%206.15689C0.0910473%207.41019%200.758568%208.56638%201.83948%209.20078C1.8504%209.20718%201.86214%209.21396%201.88559%209.22751L3.87125%2010.374C5.02829%2011.042%205.6068%2011.376%206.24212%2011.3762C6.87742%2011.3764%207.45617%2011.0428%208.61365%2010.3756L10.7098%209.16719C11.2894%208.83308%2011.5792%208.66604%2011.7383%208.39063C11.8974%208.11522%2011.8974%207.78073%2011.8974%207.11174V5.81938C11.8974%205.6338%2011.7969%205.46278%2011.6348%205.37246C11.4779%205.28508%2011.2866%205.28638%2011.1309%205.37588L6.83276%207.84658C6.54439%208.01235%206.40019%208.09524%206.24197%208.0953C6.08374%208.09533%205.9395%208.01253%205.65102%207.84695L2.74192%206.17707C2.59621%206.09342%202.52334%206.05159%202.46482%206.04404C2.33139%206.02681%202.20311%206.10156%202.15228%206.22612C2.13%206.28075%202.13044%206.36477%202.13135%206.53279C2.13201%206.65648%202.13234%206.71833%202.1439%206.77522C2.1698%206.90263%202.23682%207.01797%202.33468%207.10356C2.37838%207.14178%202.43194%207.1727%202.53909%207.23453L5.64938%209.02967C5.93861%209.1966%206.08322%209.28007%206.24201%209.28012C6.40082%209.28016%206.54548%209.19677%206.83479%209.03001L10.6471%206.83244C10.7459%206.77546%2010.7953%206.74698%2010.8324%206.76839C10.8694%206.78981%2010.8694%206.84684%2010.8694%206.96091V7.54708C10.8694%207.71434%2010.8694%207.79796%2010.8296%207.86682C10.7899%207.93566%2010.7174%207.97742%2010.5725%208.06096L7.42811%209.87351C6.84923%2010.2072%206.55979%2010.374%206.24208%2010.3739C5.92436%2010.3737%205.63507%2010.2067%205.0565%209.87242L2.11464%208.17304C2.1053%208.16763%202.10063%208.16494%202.09627%208.16239C1.47944%207.80194%201.09883%207.14254%201.09526%206.42811C1.09523%206.42307%201.09523%206.41768%201.09523%206.40688V5.8688C1.09523%205.47441%201.30528%205.10986%201.6465%204.91209C1.948%204.73733%202.31991%204.73698%202.62174%204.91118L5.05842%206.31754Z'%20fill='%23F2F7F7'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_2782_17351'%3e%3crect%20width='12'%20height='12'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",nae="data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M11.939%207.14668H9.87903V2.34668C9.87903%201.22668%209.27236%201.00001%208.53236%201.84001L7.99903%202.44668L3.4857%207.58001C2.8657%208.28001%203.1257%208.85335%204.05903%208.85335H6.11903V13.6533C6.11903%2014.7733%206.7257%2015%207.4657%2014.16L7.99903%2013.5533L12.5124%208.42001C13.1324%207.72001%2012.8724%207.14668%2011.939%207.14668Z'%20fill='%2367FFBD'/%3e%3c/svg%3e",iyt="/assets/introductionModalIcon-C3qCLVbZ.svg",ayt="data:image/svg+xml,%3csvg%20width='48'%20height='48'%20viewBox='0%200%2048%2048'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3ccircle%20opacity='0.4'%20cx='24'%20cy='24'%20r='20'%20fill='%23868686'/%3e%3cpath%20d='M34%2020C34%2021.1046%2033.1046%2022%2032%2022C30.8954%2022%2030%2021.1046%2030%2020C30%2018.8954%2030.8954%2018%2032%2018C33.1046%2018%2034%2018.8954%2034%2020Z'%20fill='%23868686'/%3e%3cpath%20d='M18%2020C18%2021.1046%2017.1046%2022%2016%2022C14.8954%2022%2014%2021.1046%2014%2020C14%2018.8954%2014.8954%2018%2016%2018C17.1046%2018%2018%2018.8954%2018%2020Z'%20fill='%23868686'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M18.9891%2028.8723C18.3698%2028.329%2017.4271%2028.3868%2016.8789%2029.0035C16.3285%2029.6226%2016.3843%2030.5708%2017.0035%2031.1211L18%2030C17.0035%2031.1211%2017.003%2031.1207%2017.0035%2031.1211L17.0054%2031.1228L17.0075%2031.1247L17.0124%2031.1291L17.0249%2031.1399L17.06%2031.1698C17.088%2031.1934%2017.125%2031.224%2017.171%2031.2605C17.263%2031.3335%2017.391%2031.4308%2017.5536%2031.5439C17.8782%2031.7697%2018.3441%2032.0611%2018.9394%2032.3497C20.13%2032.927%2021.8535%2033.5%2024%2033.5C26.1465%2033.5%2027.87%2032.927%2029.0607%2032.3497C29.656%2032.0611%2030.1218%2031.7697%2030.4465%2031.5439C30.609%2031.4308%2030.737%2031.3335%2030.829%2031.2605C30.875%2031.224%2030.9121%2031.1934%2030.94%2031.1698L30.9752%2031.1399L30.9876%2031.1291L30.9925%2031.1247L30.9946%2031.1228C30.9951%2031.1224%2030.9966%2031.1211%2030%2030L30.9966%2031.1211C31.6157%2030.5708%2031.6715%2029.6226%2031.1211%2029.0035C30.573%2028.3868%2029.6302%2028.329%2029.0109%2028.8723L29.0092%2028.8739C29.0023%2028.8796%2028.9859%2028.8933%2028.963%2028.9114C28.9173%2028.9477%2028.8402%2029.0068%2028.7333%2029.0812C28.5189%2029.2303%2028.1878%2029.4389%2027.7519%2029.6503C26.88%2030.073%2025.6035%2030.5%2024%2030.5C22.3965%2030.5%2021.12%2030.073%2020.2482%2029.6503C19.8122%2029.4389%2019.4812%2029.2303%2019.2668%2029.0812C19.1598%2029.0068%2019.0827%2028.9477%2019.037%2028.9114C19.0142%2028.8933%2018.9992%2028.8809%2018.9924%2028.8751C18.9909%2028.8739%2018.9898%2028.8729%2018.9891%2028.8723C18.9891%2028.8723%2018.9891%2028.8723%2018.9891%2028.8723ZM29.0109%2028.8723L29.0092%2028.8739L29.0067%2028.876L29.0052%2028.8774C29.0074%2028.8754%2029.0087%2028.8743%2029.0109%2028.8723Z'%20fill='%23868686'/%3e%3c/svg%3e",oyt="data:image/svg+xml,%3csvg%20width='10'%20height='10'%20viewBox='0%200%2010%2010'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M5.41602%204.58334L8.83268%201.16667'%20stroke='%2367FFBD'%20stroke-width='1.2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M9.16602%202.83333V0.833328H7.16602'%20stroke='%2367FFBD'%20stroke-width='1.2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M4.58398%200.833328H3.75065C1.66732%200.833328%200.833984%201.66666%200.833984%203.74999V6.24999C0.833984%208.33333%201.66732%209.16666%203.75065%209.16666H6.25065C8.33398%209.16666%209.16732%208.33333%209.16732%206.24999V5.41666'%20stroke='%2367FFBD'%20stroke-width='1.2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",lyt="/assets/dextrabot-copy-trade-hyperliquid-BgdeQSj5.png",cyt="/assets/dextrabot-position-copy-Ph5ntD17.png",uyt="/assets/dextrabot-referral-rewards-CvRzGBKC.png",dyt="/assets/hyperliquid-discover-wallets-CgeXGTl5.svg",fyt="/assets/dextrabot-telegram-alerts-CJHcZn29.png",hyt="/assets/hyperliquid-wallet-analysis-DwEnicpm.png",pyt="/assets/dextrabot-discover-wallets-filters-BSnYa19g.svg",myt="/assets/hyperliquid-trading-metrics-Cwsy4rqz.svg",xyt="/assets/dextrabot-risk-parameters-DzTb7mB0.svg",gyt="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M14.4297%205.92999L20.4997%2012L14.4297%2018.07'%20stroke='%2367FFBD'%20stroke-width='1.5'%20stroke-miterlimit='10'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M3.5%2012H20.33'%20stroke='%2367FFBD'%20stroke-width='1.5'%20stroke-miterlimit='10'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",IH="data:image/svg+xml,%3csvg%20width='64'%20height='64'%20viewBox='0%200%2064%2064'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3ccircle%20cx='32'%20cy='32'%20r='32'%20fill='%233D3D3D'/%3e%3c/svg%3e",byt="/assets/dextrabotNewLogoIcon-V6eDxoac.png",rae="data:image/svg+xml,%3csvg%20width='18'%20height='18'%20viewBox='0%200%2018%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M12.1425%201.5H5.8575C3.1275%201.5%201.5%203.1275%201.5%205.8575V12.135C1.5%2014.8725%203.1275%2016.5%205.8575%2016.5H12.135C14.865%2016.5%2016.4925%2014.8725%2016.4925%2012.1425V5.8575C16.5%203.1275%2014.8725%201.5%2012.1425%201.5ZM12.9375%209.2475C12.9375%209.555%2012.6825%209.81%2012.375%209.81C12.0675%209.81%2011.8125%209.555%2011.8125%209.2475V6.9825L6.0225%2012.7725C5.91%2012.885%205.7675%2012.9375%205.625%2012.9375C5.4825%2012.9375%205.34%2012.885%205.2275%2012.7725C5.01%2012.555%205.01%2012.195%205.2275%2011.9775L11.0175%206.1875H8.7525C8.445%206.1875%208.19%205.9325%208.19%205.625C8.19%205.3175%208.445%205.0625%208.7525%205.0625H12.375C12.6825%205.0625%2012.9375%205.3175%2012.9375%205.625V9.2475Z'%20fill='white'%20fill-opacity='0.32'/%3e%3c/svg%3e",yyt="data:image/svg+xml,%3csvg%20width='18'%20height='18'%20viewBox='0%200%2018%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M15%205.0625C16.1391%205.0625%2017.0625%204.13909%2017.0625%203C17.0625%201.86091%2016.1391%200.9375%2015%200.9375C13.8609%200.9375%2012.9375%201.86091%2012.9375%203C12.9375%204.13909%2013.8609%205.0625%2015%205.0625Z'%20fill='white'/%3e%3cpath%20d='M14.28%206.1125C13.1025%205.8575%2012.1425%204.8975%2011.8875%203.72C11.79%203.2625%2011.7825%202.82%2011.865%202.4C11.9625%201.935%2011.6175%201.5%2011.1375%201.5H5.25C3.18%201.5%201.5%203.18%201.5%205.25V10.4625C1.5%2012.5325%203.18%2014.2125%205.25%2014.2125H6.375C6.585%2014.2125%206.855%2014.3475%206.975%2014.5125L8.1%2016.005C8.595%2016.665%209.405%2016.665%209.9%2016.005L11.025%2014.5125C11.1675%2014.325%2011.385%2014.2125%2011.625%2014.2125H12.7575C14.8275%2014.2125%2016.5%2012.54%2016.5%2010.47V6.8625C16.5%206.39%2016.065%206.045%2015.6%206.135C15.18%206.21%2014.7375%206.21%2014.28%206.1125ZM6%209C5.58%209%205.25%208.6625%205.25%208.25C5.25%207.8375%205.58%207.5%206%207.5C6.4125%207.5%206.75%207.8375%206.75%208.25C6.75%208.6625%206.42%209%206%209ZM9%209C8.58%209%208.25%208.6625%208.25%208.25C8.25%207.8375%208.58%207.5%209%207.5C9.4125%207.5%209.75%207.8375%209.75%208.25C9.75%208.6625%209.42%209%209%209ZM12%209C11.58%209%2011.25%208.6625%2011.25%208.25C11.25%207.8375%2011.58%207.5%2012%207.5C12.4125%207.5%2012.75%207.8375%2012.75%208.25C12.75%208.6625%2012.42%209%2012%209Z'%20fill='white'/%3e%3c/svg%3e",vyt="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M12.0199%2020.5299C9.68987%2020.5299%207.35987%2020.1599%205.14987%2019.4199C4.30987%2019.1299%203.66987%2018.5399%203.38987%2017.7699C3.09987%2016.9999%203.19987%2016.1499%203.65987%2015.3899L4.80987%2013.4799C5.04987%2013.0799%205.26987%2012.2799%205.26987%2011.8099V8.91992C5.26987%205.19992%208.29987%202.16992%2012.0199%202.16992C15.7399%202.16992%2018.7699%205.19992%2018.7699%208.91992V11.8099C18.7699%2012.2699%2018.9899%2013.0799%2019.2299%2013.4899L20.3699%2015.3899C20.7999%2016.1099%2020.8799%2016.9799%2020.5899%2017.7699C20.2999%2018.5599%2019.6699%2019.1599%2018.8799%2019.4199C16.6799%2020.1599%2014.3499%2020.5299%2012.0199%2020.5299ZM12.0199%203.66992C9.12987%203.66992%206.76987%206.01992%206.76987%208.91992V11.8099C6.76987%2012.5399%206.46987%2013.6199%206.09987%2014.2499L4.94987%2016.1599C4.72987%2016.5299%204.66987%2016.9199%204.79987%2017.2499C4.91987%2017.5899%205.21987%2017.8499%205.62987%2017.9899C9.80987%2019.3899%2014.2399%2019.3899%2018.4199%2017.9899C18.7799%2017.8699%2019.0599%2017.5999%2019.1899%2017.2399C19.3199%2016.8799%2019.2899%2016.4899%2019.0899%2016.1599L17.9399%2014.2499C17.5599%2013.5999%2017.2699%2012.5299%2017.2699%2011.7999V8.91992C17.2699%206.01992%2014.9199%203.66992%2012.0199%203.66992Z'%20fill='white'/%3e%3cpath%20d='M13.8806%203.94018C13.8106%203.94018%2013.7406%203.93018%2013.6706%203.91018C13.3806%203.83018%2013.1006%203.77018%2012.8306%203.73018C11.9806%203.62018%2011.1606%203.68018%2010.3906%203.91018C10.1106%204.00018%209.8106%203.91018%209.6206%203.70018C9.4306%203.49018%209.3706%203.19018%209.4806%202.92018C9.8906%201.87018%2010.8906%201.18018%2012.0306%201.18018C13.1706%201.18018%2014.1706%201.86018%2014.5806%202.92018C14.6806%203.19018%2014.6306%203.49018%2014.4406%203.70018C14.2906%203.86018%2014.0806%203.94018%2013.8806%203.94018Z'%20fill='white'/%3e%3cpath%20d='M12.0195%2022.8101C11.0295%2022.8101%2010.0695%2022.4101%209.36953%2021.7101C8.66953%2021.0101%208.26953%2020.0501%208.26953%2019.0601H9.76953C9.76953%2019.6501%2010.0095%2020.2301%2010.4295%2020.6501C10.8495%2021.0701%2011.4295%2021.3101%2012.0195%2021.3101C13.2595%2021.3101%2014.2695%2020.3001%2014.2695%2019.0601H15.7695C15.7695%2021.1301%2014.0895%2022.8101%2012.0195%2022.8101Z'%20fill='white'/%3e%3c/svg%3e",wyt="data:image/svg+xml,%3csvg%20width='14'%20height='13'%20viewBox='0%200%2014%2013'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_378_2345)'%3e%3cpath%20d='M10.9574%200H13.0931L8.40386%205.51661L13.8824%2013H9.58315L6.21708%208.4524L2.3635%2013H0.22779L5.19565%207.09963L-0.0507812%200H4.35529L7.39636%204.15424L10.9574%200ZM10.2099%2011.7048H11.3939L3.73315%201.24723H2.461L10.2099%2011.7048Z'%20fill='white'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_378_2345'%3e%3crect%20width='13.9286'%20height='13'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",Cyt="data:image/svg+xml,%3csvg%20width='10'%20height='12'%20viewBox='0%200%2010%2012'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M0%2012L10%206.00005L0%200V12Z'%20fill='white'/%3e%3c/svg%3e",ske="data:image/svg+xml,%3csvg%20width='10'%20height='12'%20viewBox='0%200%2010%2012'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M9.67166%207.49665C9.67295%208.13961%209.54358%208.77482%209.29002%209.36475C9.0481%209.93526%208.6988%2010.4489%208.25377%2010.8887C7.81262%2011.3273%207.28996%2011.6753%206.71686%2011.9146C6.64441%2011.9444%206.57196%2011.9728%206.49952%2012C6.54609%2011.9599%206.59137%2011.9185%206.63407%2011.8758C6.86823%2011.6442%207.05193%2011.3738%207.18%2011.0737C7.31326%2010.7632%207.38182%2010.4282%207.38052%2010.0905C7.38052%209.73733%207.30808%209.39579%207.16448%209.07237C7.02476%208.75671%206.82036%208.47209%206.5655%208.23923L6.35463%208.04647C6.33134%208.02448%206.29383%208.02706%206.27183%208.05035C6.26665%208.05682%206.26278%208.06329%206.26019%208.06976L6.16704%208.34013C6.10883%208.50832%206.00015%208.68167%205.8475%208.85114C5.83844%208.86279%205.8268%208.86538%205.81775%208.86538C5.80998%208.86667%205.79834%208.86538%205.78669%208.85503C5.77764%208.84597%205.77246%208.83304%205.77246%208.8201C5.79963%208.38542%205.66897%207.89382%205.38435%207.35952C5.1489%206.91578%204.8216%206.57036%204.41279%206.32844L4.11395%206.1525C4.07514%206.12922%204.02468%206.16026%204.02727%206.20554L4.04279%206.55226C4.05315%206.789%204.02598%206.99987%203.96129%207.17323C3.88108%207.38668%203.76724%207.58462%203.62105%207.76315C3.52014%207.88605%203.405%207.9986%203.27822%208.09563C2.97291%208.32979%202.72452%208.63122%202.55246%208.97405C2.3804%209.32076%202.29114%209.7024%202.29114%2010.0905C2.29114%2010.4307%202.3584%2010.7619%202.49166%2011.0737C2.61973%2011.3738%202.80473%2011.6455%203.03759%2011.8745C3.08158%2011.9185%203.12686%2011.9599%203.17344%2011.9987C3.09969%2011.9728%203.02725%2011.9444%202.9548%2011.9133C2.37911%2011.6727%201.86292%2011.3273%201.41789%2010.8874C0.976737%2010.4514%200.624856%209.93397%200.381641%209.36345C0.128074%208.77223%200%208.1435%200%207.49536C0.00129499%206.76054%200.170768%206.03478%200.498069%205.37628C0.825378%204.72297%201.29628%204.15245%201.87586%203.70742C2.11648%203.52112%202.33512%203.30896%202.52788%203.07351C2.80602%202.73586%203.02207%202.35939%203.17344%201.95446C3.29763%201.62328%203.34938%201.22482%203.32867%200.774614L3.29892%200.114833C3.29504%200.0281497%203.38948%20-0.0287652%203.46322%200.015216L4.03116%200.348991C4.80866%200.806956%205.43092%201.46545%205.87855%202.30893C6.41931%203.32449%206.66641%204.25724%206.61595%205.08391C6.61466%205.10849%206.62371%205.13307%206.64312%205.14989C6.66382%205.1693%206.68711%205.17188%206.70263%205.17058C6.71815%205.1693%206.74014%205.16282%206.75955%205.14213C7.04934%204.82%207.25374%204.49139%207.365%204.17056L7.54353%203.65826C7.5487%203.64403%207.55518%203.63239%207.56552%203.62074C7.60562%203.57546%207.67549%203.57158%207.72206%203.61298L8.12182%203.9791C8.60566%204.42283%208.99376%204.96101%209.26026%205.56128C9.53323%206.17579%209.67166%206.82652%209.67166%207.49665Z'%20fill='white'/%3e%3c/svg%3e",Syt="data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M13.5733%208.48671C13.3267%208.48671%2013.12%208.30005%2013.0933%208.05338C12.9333%206.58671%2012.1467%205.26671%2010.9333%204.42671C10.7133%204.27338%2010.66%203.97338%2010.8133%203.75338C10.9667%203.53338%2011.2667%203.48005%2011.4867%203.63338C12.9333%204.64005%2013.8667%206.21338%2014.06%207.95338C14.0867%208.22005%2013.8933%208.46005%2013.6267%208.48671C13.6067%208.48671%2013.5933%208.48671%2013.5733%208.48671Z'%20fill='white'/%3e%3cpath%20d='M2.49333%208.51989C2.48%208.51989%202.46%208.51989%202.44666%208.51989C2.18%208.49322%201.98666%208.25322%202.01333%207.98656C2.19333%206.24656%203.11333%204.67322%204.54666%203.65989C4.76%203.50656%205.06666%203.55989%205.22%203.77322C5.37333%203.99322%205.32%204.29322%205.10666%204.44656C3.90666%205.29989%203.12666%206.61989%202.98%208.07989C2.95333%208.33322%202.74%208.51989%202.49333%208.51989Z'%20fill='white'/%3e%3cpath%20d='M10.66%2014.0666C9.84%2014.4599%208.96%2014.6599%208.04%2014.6599C7.08%2014.6599%206.16666%2014.4466%205.31333%2014.0132C5.07333%2013.8999%204.98%2013.6066%205.1%2013.3666C5.21333%2013.1266%205.50667%2013.0332%205.74667%2013.1466C6.16667%2013.3599%206.61333%2013.5066%207.06667%2013.5932C7.68%2013.7132%208.30667%2013.7199%208.92%2013.6132C9.37333%2013.5332%209.82%2013.3932%2010.2333%2013.1932C10.48%2013.0799%2010.7733%2013.1732%2010.88%2013.4199C11%2013.6599%2010.9067%2013.9532%2010.66%2014.0666Z'%20fill='white'/%3e%3cpath%20d='M8.03333%201.34009C7%201.34009%206.15333%202.18009%206.15333%203.22009C6.15333%204.26009%206.99333%205.10009%208.03333%205.10009C9.07333%205.10009%209.91333%204.26009%209.91333%203.22009C9.91333%202.18009%209.07333%201.34009%208.03333%201.34009Z'%20fill='white'/%3e%3cpath%20d='M3.36666%209.24658C2.33333%209.24658%201.48666%2010.0866%201.48666%2011.1266C1.48666%2012.1666%202.32666%2013.0066%203.36666%2013.0066C4.40666%2013.0066%205.24666%2012.1666%205.24666%2011.1266C5.24666%2010.0866%204.4%209.24658%203.36666%209.24658Z'%20fill='white'/%3e%3cpath%20d='M12.6333%209.24658C11.6%209.24658%2010.7533%2010.0866%2010.7533%2011.1266C10.7533%2012.1666%2011.5933%2013.0066%2012.6333%2013.0066C13.6733%2013.0066%2014.5133%2012.1666%2014.5133%2011.1266C14.5133%2010.0866%2013.6733%209.24658%2012.6333%209.24658Z'%20fill='white'/%3e%3c/svg%3e",ike="data:image/svg+xml,%3csvg%20width='18'%20height='14'%20viewBox='0%200%2018%2014'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_3194_16457)'%3e%3cpath%20d='M11.5339%200C11.358%200.32044%2011.2001%200.651933%2011.0565%200.990792C9.69238%200.78085%208.30315%200.78085%206.93547%200.990792C6.79547%200.651933%206.63392%200.32044%206.45804%200C5.1765%200.224685%203.92727%200.618785%202.74267%201.17495C0.394982%204.74402%20-0.240399%208.22099%200.075501%2011.6501C1.45036%2012.6924%202.99036%2013.488%204.63086%2013.9963C5.0006%2013.488%205.32727%2012.9466%205.60727%2012.3831C5.07599%2012.1805%204.56265%2011.9263%204.07087%2011.6317C4.20009%2011.5359%204.32573%2011.4365%204.44778%2011.3407C7.33034%2012.733%2010.6688%2012.733%2013.5549%2011.3407C13.677%2011.4438%2013.8026%2011.5433%2013.9318%2011.6317C13.4401%2011.93%2012.9267%2012.1805%2012.3919%2012.3867C12.6718%2012.9503%2012.9985%2013.4917%2013.3683%2014C15.0087%2013.4917%2016.5487%2012.6998%2017.9237%2011.6575C18.2969%207.67955%2017.2847%204.23204%2015.2492%201.17864C14.0683%200.622475%2012.819%200.22836%2011.5375%200.00736458L11.5339%200ZM6.00932%209.5396C5.12266%209.5396%204.38677%208.71455%204.38677%207.6943C4.38677%206.67405%205.09394%205.84531%206.00573%205.84531C6.91753%205.84531%207.64264%206.67772%207.62828%207.6943C7.61393%208.71087%206.91394%209.5396%206.00932%209.5396ZM11.9898%209.5396C11.0995%209.5396%2010.3708%208.71455%2010.3708%207.6943C10.3708%206.67405%2011.078%205.84531%2011.9898%205.84531C12.9016%205.84531%2013.6231%206.67772%2013.6088%207.6943C13.5944%208.71087%2012.8944%209.5396%2011.9898%209.5396Z'%20fill='white'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_3194_16457'%3e%3crect%20width='18'%20height='14'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",Nyt="data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M12.1626%201.5H14.3679L9.54994%207.00667L15.2179%2014.5H10.7799L7.30394%209.95533L3.3266%2014.5H1.11994L6.27327%208.61L0.835938%201.5H5.3866L8.5286%205.654L12.1626%201.5ZM11.3886%2013.18H12.6106L4.7226%202.75067H3.41127L11.3886%2013.18Z'%20fill='white'/%3e%3c/svg%3e",Ayt="data:image/svg+xml,%3csvg%20width='18'%20height='16'%20viewBox='0%200%2018%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M1.24334%206.83119C5.90766%204.79901%209.01794%203.45928%2010.5742%202.81199C15.0175%200.963838%2015.9408%200.642794%2016.5426%200.632193C16.675%200.629862%2016.9709%200.662664%2017.1626%200.818215C17.3245%200.949559%2017.369%201.12699%2017.3903%201.25151C17.4117%201.37604%2017.4382%201.65972%2017.4171%201.88138C17.1763%204.41136%2016.1344%2010.5509%2015.6044%2013.3846C15.3801%2014.5836%2014.9385%2014.9856%2014.5109%2015.0249C13.5818%2015.1104%2012.8762%2014.4109%2011.9763%2013.821C10.5681%2012.8979%209.77254%2012.3233%208.40563%2011.4225C6.82593%2010.3815%207.84998%209.80933%208.75025%208.87427C8.98585%208.62956%2013.0797%204.90589%2013.1589%204.56809C13.1689%204.52584%2013.1781%204.36837%2013.0845%204.28521C12.9909%204.20206%2012.8529%204.2305%2012.7532%204.25311C12.612%204.28517%2010.3624%205.77209%206.00433%208.71388C5.36578%209.15236%204.7874%209.366%204.2692%209.3548C3.69791%209.34246%202.599%209.03179%201.78206%208.76624C0.780062%208.44052%20-0.0163084%208.26832%200.0530376%207.71516C0.0891573%207.42704%200.485924%207.13238%201.24334%206.83119Z'%20fill='white'/%3e%3c/svg%3e",jyt="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M19.3697%204.89012L13.5097%202.28012C12.6497%201.90012%2011.3497%201.90012%2010.4897%202.28012L4.62969%204.89012C3.14969%205.55012%202.92969%206.45012%202.92969%206.93012C2.92969%207.41012%203.14969%208.31012%204.62969%208.97012L10.4897%2011.5801C10.9197%2011.7701%2011.4597%2011.8701%2011.9997%2011.8701C12.5397%2011.8701%2013.0797%2011.7701%2013.5097%2011.5801L19.3697%208.97012C20.8497%208.31012%2021.0697%207.41012%2021.0697%206.93012C21.0697%206.45012%2020.8597%205.55012%2019.3697%204.89012Z'%20fill='%23083C26'/%3e%3cpath%20d='M12.0003%2017.04C11.6203%2017.04%2011.2403%2016.96%2010.8903%2016.81L4.15031%2013.81C3.12031%2013.35%202.32031%2012.12%202.32031%2010.99C2.32031%2010.58%202.65031%2010.25%203.06031%2010.25C3.47031%2010.25%203.80031%2010.58%203.80031%2010.99C3.80031%2011.53%204.25031%2012.23%204.75031%2012.45L11.4903%2015.45C11.8103%2015.59%2012.1803%2015.59%2012.5003%2015.45L19.2403%2012.45C19.7403%2012.23%2020.1903%2011.54%2020.1903%2010.99C20.1903%2010.58%2020.5203%2010.25%2020.9303%2010.25C21.3403%2010.25%2021.6703%2010.58%2021.6703%2010.99C21.6703%2012.11%2020.8703%2013.35%2019.8403%2013.81L13.1003%2016.81C12.7603%2016.96%2012.3803%2017.04%2012.0003%2017.04Z'%20fill='%23083C26'/%3e%3cpath%20d='M12.0003%2022C11.6203%2022%2011.2403%2021.92%2010.8903%2021.77L4.15031%2018.77C3.04031%2018.28%202.32031%2017.17%202.32031%2015.95C2.32031%2015.54%202.65031%2015.21%203.06031%2015.21C3.47031%2015.21%203.80031%2015.54%203.80031%2015.95C3.80031%2016.58%204.17031%2017.15%204.75031%2017.41L11.4903%2020.41C11.8103%2020.55%2012.1803%2020.55%2012.5003%2020.41L19.2403%2017.41C19.8103%2017.16%2020.1903%2016.58%2020.1903%2015.95C20.1903%2015.54%2020.5203%2015.21%2020.9303%2015.21C21.3403%2015.21%2021.6703%2015.54%2021.6703%2015.95C21.6703%2017.17%2020.9503%2018.27%2019.8403%2018.77L13.1003%2021.77C12.7603%2021.92%2012.3803%2022%2012.0003%2022Z'%20fill='%23083C26'/%3e%3c/svg%3e",Eyt="data:image/svg+xml,%3csvg%20width='14'%20height='14'%20viewBox='0%200%2014%2014'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M11.299%202.85232L7.88065%201.32982C7.37898%201.10816%206.62065%201.10816%206.11898%201.32982L2.70065%202.85232C1.83732%203.23732%201.70898%203.76232%201.70898%204.04232C1.70898%204.32232%201.83732%204.84732%202.70065%205.23232L6.11898%206.75482C6.36982%206.86566%206.68482%206.92399%206.99982%206.92399C7.31482%206.92399%207.62982%206.86566%207.88065%206.75482L11.299%205.23232C12.1623%204.84732%2012.2907%204.32232%2012.2907%204.04232C12.2907%203.76232%2012.1682%203.23732%2011.299%202.85232Z'%20fill='%2367FFBD'/%3e%3cpath%20d='M7.00018%209.93984C6.77852%209.93984%206.55685%209.89317%206.35268%209.80567L2.42102%208.05567C1.82018%207.78734%201.35352%207.06984%201.35352%206.41067C1.35352%206.1715%201.54602%205.979%201.78518%205.979C2.02435%205.979%202.21685%206.1715%202.21685%206.41067C2.21685%206.72567%202.47935%207.134%202.77102%207.26234L6.70268%209.01234C6.88935%209.094%207.10518%209.094%207.29185%209.01234L11.2235%207.26234C11.5152%207.134%2011.7777%206.7315%2011.7777%206.41067C11.7777%206.1715%2011.9702%205.979%2012.2093%205.979C12.4485%205.979%2012.641%206.1715%2012.641%206.41067C12.641%207.064%2012.1743%207.78734%2011.5735%208.05567L7.64185%209.80567C7.44352%209.89317%207.22185%209.93984%207.00018%209.93984Z'%20fill='%2367FFBD'/%3e%3cpath%20d='M7.00018%2012.8334C6.77852%2012.8334%206.55685%2012.7867%206.35268%2012.6992L2.42102%2010.9492C1.77352%2010.6634%201.35352%2010.0159%201.35352%209.30423C1.35352%209.06506%201.54602%208.87256%201.78518%208.87256C2.02435%208.87256%202.21685%209.06506%202.21685%209.30423C2.21685%209.67173%202.43268%2010.0042%202.77102%2010.1559L6.70268%2011.9059C6.88935%2011.9876%207.10518%2011.9876%207.29185%2011.9059L11.2235%2010.1559C11.556%2010.0101%2011.7777%209.67173%2011.7777%209.30423C11.7777%209.06506%2011.9702%208.87256%2012.2093%208.87256C12.4485%208.87256%2012.641%209.06506%2012.641%209.30423C12.641%2010.0159%2012.221%2010.6576%2011.5735%2010.9492L7.64185%2012.6992C7.44352%2012.7867%207.22185%2012.8334%207.00018%2012.8334Z'%20fill='%2367FFBD'/%3e%3c/svg%3e",ake="data:image/webp;base64,UklGRjQFAABXRUJQVlA4WAoAAAAQAAAATwAATwAAQUxQSH0BAAABkFZtb91IHwRBEJRAMAQzmDCoGTQMXAaBYAiG8EEQBM3s9uLY2svPiJgAXC1pr410d7featkEC0u60weyJlljO83H1zSd3MwvZtaZ5GY+IW/zZPqkzHNo84lPneDLfGrLV8ndp79fo90X7HqB0pekDlP6otRBSl+WOkTpC1NHdF+6y2d3X/z+Ufbl9w/U1jN97/QA21vZQ8zvMAbKq5sHWV4oozB5lj3M8oxx2JPkgW6/1UhOAOKRmgApFE9AjeUAGAshHqxs0aQSzf6IprZoWo+GFo7/92U0Fk5v0bRHNHWPpqRoNolGwFgIHLFUIMWSALFQBMAZSQWALZL0GywO4mmJIz8Ti4L6DCWKgpfCGIg3cwz5HbQITryttp7pe9jXy/j0WO3Ax9LX6hioXIk6Asp1qBirXIWK0co1qBivfYWuuPSY7xBcnG0u23G9njM1xZSZszBj2sIZrAgm1syrrAhmT48L7NywpKQHR/BIgoVlK7V1+41sdU+CqwEAVlA4IJADAABwEwCdASpQAFAAPoU2lUelIyIhNbWt+KAQiWgAwcQmjtEXOZ5HT3EdLOAefDpgG8d/ufJgCf6jCvGt9C+wF+svVj9Cn9MGb35/r/3vvZgfMSDVHeAiajfoFCV6cakAkwXuHIdi1jVLDZWi77j8sJk+JjxDWiXlDvt6I8wpx4M78xMLipwjRr4qS7zgj/mcsZ7+N9mFpGVH+u8uucq/VUIgbo8haAD+9nv//1lX/+sXv//V1BzpNxdi//pSQKliFbd/die8+PJljk1dSETv/4Dv//V9v/6xe//9X4vt/T1CpqMx/9Jrs3+i7wjIfqVj0ir9/fLIHPFE/n+4kRR0tZ/6/Nz2DIp8r6foLt/8YWQ3TXVGe5Agwsl+1h/8vQHA/mhjtDMKMNJHVELwPr/sRxHahr2rUd5f6Jo2mSF/HB/3VcOqJOkapGgKidoRI6QH2gLTGlK1hC/jcfJbEmVE6ymGrd945Qw6B3neGhuFvVvX4SojZ6xzO/CzIbCO/2X7p7UPxPOEo2SxBD+I17Rl8Q6EuwFnKc2wK3x20D98b69igUaZM+cJyP9CbW270jv/PUK4CuwPXktb8oK+6kVs9P/jnHw//fuE2v1W91zgCuInucSU+hOVEXKMk+e1qYbdONQSmOug0bzt7gx94aJ6a0CQKuH90O03DvmSWJk1kGLJHXloJlj4rZLImdggYgr/kyRqAJ91d6EkOkYmBF7cPbmbx3ZK0RcjZLGBZpxXPO4VlfR3aSZqLHYMM4j0J5/PFZXvLhPP4zZbimGJ0rHCeDH2zPOAxPVxMPFX9je/PArcoYy2MF7utYELr0I0N16B0cFSuGM39Ya0jv+XoNZzMiRLJ94xOrAlE5mc9MLobRQb91AvrGdbFck8hQS5s6umsNJ/reb5eLgMGyBZOko+RT2uDpQ7eXjMuJdlVrdilTJxEMxui5E4H2R2+w30l9Ge4IJugTERWfY/dWK5IPAGneaeMvBupdYOkxAbZf+JDjYDkFw9MCWQ6qD9XvjxLBrzzvkWkVq9vYS1jjXxt52QWo/GoqTBhQfuTXxr5L/9+sehGnbJ7f8fVWUNUbjUW0j4N/qn7RyiWdXShQYKeh/FGLQSqLLqiVSu+XV8RIkoRpiXfBVFL3JChg1ifmXaGvCvGKfsiQ0f4wrAPxHL15eWF8EM9EQM/+XMNRXxz89P85wJOVelt87VZ+65wJOaz1aQyAA=",_yt="data:image/svg+xml,%3csvg%20width='14'%20height='10'%20viewBox='0%200%2014%2010'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M13.0572%204.79065C13.0572%205.66981%2012.3474%206.38537%2011.4753%206.38537C10.6034%206.38537%209.8961%205.66981%209.8961%204.79065C9.8961%203.90784%2010.6034%203.19229%2011.4753%203.19229C12.3455%203.19229%2013.0572%203.90911%2013.0572%204.79065ZM2.52608%203.19229C1.65388%203.19229%200.944177%203.90784%200.944177%204.79065C0.944177%205.66981%201.65388%206.38537%202.52608%206.38537C3.39561%206.38537%204.10532%205.66981%204.10532%204.79065C4.10532%203.90911%203.39561%203.19229%202.52608%203.19229ZM6.99882%200C5.71126%200%204.6618%201.0588%204.6618%202.36126C4.6618%203.66355%205.71016%204.72426%206.99882%204.72426C8.28795%204.72426%209.33648%203.66355%209.33648%202.36126C9.33726%201.0588%208.28779%200%206.99882%200ZM13.9998%209.63452C13.9998%208.1818%2012.865%207.00276%2011.473%207.00276C11.2247%207.00276%2010.9875%207.05216%2010.7619%207.12205C11.0592%207.72451%2011.2412%208.39639%2011.2412%209.1191V10H14L13.9998%209.63452ZM3.23516%207.12205C3.01027%207.05216%202.77548%207.00276%202.52718%207.00276C1.13323%207.00276%200%208.18387%200%209.63452V10H2.75584V9.1191C2.75584%208.39639%202.93892%207.72451%203.23516%207.12205ZM3.33495%2010H10.6621V9.16246C10.6621%207.06169%209.01746%205.35262%206.99882%205.35262C4.97689%205.35262%203.33511%207.06185%203.33511%209.16246L3.33495%2010Z'%20fill='%2367FFBD'/%3e%3c/svg%3e",kyt="data:image/svg+xml,%3csvg%20width='12'%20height='12'%20viewBox='0%200%2012%2012'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M6%2011C8.75%2011%2011%208.75%2011%206C11%203.25%208.75%201%206%201C3.25%201%201%203.25%201%206C1%208.75%203.25%2011%206%2011Z'%20stroke='%23FFAA47'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M6%204V6.5'%20stroke='%23FFAA47'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M5.99725%208H6.00174'%20stroke='%23FFAA47'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",Tyt="data:image/svg+xml,%3csvg%20width='14'%20height='14'%20viewBox='0%200%2014%2014'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M8.68583%202.96336C8.17833%202.81169%207.61833%202.71252%207%202.71252C4.20583%202.71252%201.9425%204.97586%201.9425%207.77002C1.9425%2010.57%204.20583%2012.8334%207%2012.8334C9.79416%2012.8334%2012.0575%2010.57%2012.0575%207.77586C12.0575%206.73752%2011.7425%205.76919%2011.2058%204.96419'%20stroke='%23FFAA47'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M9.40917%203.10335L7.72334%201.16669'%20stroke='%23FFAA47'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M9.40917%203.10333L7.44334%204.53833'%20stroke='%23FFAA47'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",Gme="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M4.125%2019.5V12.75H9.375'%20stroke='%2334D399'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M21.375%2019.5H2.625'%20stroke='%2334D399'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M9.375%2019.5V8.25H14.625'%20stroke='%2334D399'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M19.875%203.75H14.625V19.5H19.875V3.75Z'%20stroke='%2334D399'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",gJ="data:image/svg+xml,%3csvg%20width='11'%20height='7'%20viewBox='0%200%2011%207'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M9.83097%200.791748L6.66431%204.00789C6.6074%204.06569%206.57869%204.09459%206.55322%204.11738C6.1419%204.48554%205.51967%204.48554%205.10835%204.11738C5.08288%204.09459%205.05417%204.06568%204.99726%204.00789C4.94036%203.95009%204.9119%203.92119%204.88643%203.8984C4.47511%203.53024%203.85288%203.53024%203.44156%203.8984C3.41609%203.92119%203.38764%203.9501%203.33073%204.00789L1.16406%206.20841M9.83097%200.791748L9.83073%204.04175M9.83097%200.791748H6.58073'%20stroke='%2334D399'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",bJ="data:image/svg+xml,%3csvg%20width='11'%20height='7'%20viewBox='0%200%2011%207'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M1.00496%206.41675L4.17163%203.2006C4.22854%203.14281%204.25725%203.1139%204.28271%203.09111C4.69404%202.72296%205.31627%202.72296%205.72759%203.09111C5.75306%203.1139%205.78177%203.14281%205.83868%203.20061C5.89558%203.2584%205.92404%203.28731%205.9495%203.3101C6.36083%203.67826%206.98306%203.67826%207.39438%203.3101C7.41984%203.28731%207.4483%203.2584%207.50521%203.2006L9.67188%201.00008M1.00496%206.41675L1.00521%203.16675M1.00496%206.41675L4.25521%206.41675'%20stroke='%23FB7184'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",Iyt="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='21'%20height='22'%20viewBox='0%200%2021%2022'%20fill='none'%3e%3cpath%20d='M2.625%206.625H18.375'%20stroke='white'%20stroke-width='1.5'%20stroke-linecap='round'/%3e%3cpath%20d='M5.25%2011H15.75'%20stroke='white'%20stroke-width='1.5'%20stroke-linecap='round'/%3e%3cpath%20d='M8.75%2015.375H12.25'%20stroke='white'%20stroke-width='1.5'%20stroke-linecap='round'/%3e%3c/svg%3e",Pyt="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='21'%20height='22'%20viewBox='0%200%2021%2022'%20fill='none'%3e%3cpath%20d='M2.625%206.625H18.375'%20stroke='%2367FFBD'%20stroke-width='1.5'%20stroke-linecap='round'/%3e%3cpath%20d='M5.25%2011H15.75'%20stroke='%2367FFBD'%20stroke-width='1.5'%20stroke-linecap='round'/%3e%3cpath%20d='M8.75%2015.375H12.25'%20stroke='%2367FFBD'%20stroke-width='1.5'%20stroke-linecap='round'/%3e%3c/svg%3e",_A="/assets/dextrabotIcon64x64-CGBWeHNW.png",Fyt="/assets/telegramfilterIcon-D3R-nSo1.svg",Oyt="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='21'%20height='21'%20viewBox='0%200%2021%2021'%20fill='none'%3e%3cpath%20d='M10.5%2019.25C15.3325%2019.25%2019.25%2015.3325%2019.25%2010.5C19.25%205.66751%2015.3325%201.75%2010.5%201.75C5.66751%201.75%201.75%205.66751%201.75%2010.5C1.75%2015.3325%205.66751%2019.25%2010.5%2019.25Z'%20stroke='%236A6A6A'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M7.00039%202.625H7.87539C6.16914%207.735%206.16914%2013.265%207.87539%2018.375H7.00039'%20stroke='%236A6A6A'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M13.125%202.625C14.8313%207.735%2014.8313%2013.265%2013.125%2018.375'%20stroke='%236A6A6A'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M2.625%2014V13.125C7.735%2014.8313%2013.265%2014.8313%2018.375%2013.125V14'%20stroke='%236A6A6A'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M2.625%207.8749C7.735%206.16865%2013.265%206.16865%2018.375%207.8749'%20stroke='%236A6A6A'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",aE="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='9'%20height='8'%20viewBox='0%200%209%208'%20fill='none'%3e%3cpath%20d='M4.5%200L0%208L9%208L4.5%200Z'%20fill='%233DB380'/%3e%3c/svg%3e",oE="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='9'%20height='8'%20viewBox='0%200%209%208'%20fill='none'%3e%3cpath%20d='M4.5%208L9%200L0%202.0772e-08L4.5%208Z'%20fill='%23FF797C'/%3e%3c/svg%3e",E0="data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M14.3726%207.16021L13.4726%206.10688C13.3059%205.90688%2013.1659%205.53355%2013.1659%205.26688V4.13355C13.1659%203.42688%2012.5859%202.84688%2011.8793%202.84688H10.7459C10.4793%202.84688%2010.0993%202.70688%209.89927%202.54021L8.84594%201.64021C8.38594%201.24688%207.6326%201.24688%207.1726%201.64021L6.10594%202.54021C5.90594%202.70688%205.5326%202.84688%205.26594%202.84688H4.1126C3.40594%202.84688%202.82594%203.42688%202.82594%204.13355V5.26688C2.82594%205.52688%202.6926%205.90021%202.52594%206.10021L1.62594%207.16021C1.23927%207.62688%201.23927%208.37355%201.62594%208.82688L2.52594%209.88688C2.6926%2010.0802%202.82594%2010.4602%202.82594%2010.7202V11.8602C2.82594%2012.5669%203.40594%2013.1469%204.1126%2013.1469H5.2726C5.5326%2013.1469%205.9126%2013.2869%206.1126%2013.4535L7.16594%2014.3535C7.62594%2014.7469%208.37927%2014.7469%208.83927%2014.3535L9.8926%2013.4535C10.0926%2013.2869%2010.4659%2013.1469%2010.7326%2013.1469H11.8659C12.5726%2013.1469%2013.1526%2012.5669%2013.1526%2011.8602V10.7269C13.1526%2010.4602%2013.2926%2010.0869%2013.4593%209.88688L14.3593%208.83355C14.7659%208.38022%2014.7659%207.62688%2014.3726%207.16021ZM7.49927%205.42022C7.49927%205.14688%207.72594%204.92022%207.99927%204.92022C8.2726%204.92022%208.49927%205.14688%208.49927%205.42022V8.64021C8.49927%208.91355%208.2726%209.14021%207.99927%209.14021C7.72594%209.14021%207.49927%208.91355%207.49927%208.64021V5.42022ZM7.99927%2011.2469C7.6326%2011.2469%207.3326%2010.9469%207.3326%2010.5802C7.3326%2010.2135%207.62594%209.91355%207.99927%209.91355C8.36594%209.91355%208.66594%2010.2135%208.66594%2010.5802C8.66594%2010.9469%208.3726%2011.2469%207.99927%2011.2469Z'%20fill='%23636363'/%3e%3c/svg%3e",Myt="data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_257_8126)'%3e%3cpath%20d='M1.5%201C1.36739%201%201.24021%201.05268%201.14645%201.14645C1.05268%201.24021%201%201.36739%201%201.5V5.5C1%205.63261%200.947322%205.75979%200.853553%205.85355C0.759785%205.94732%200.632608%206%200.5%206C0.367392%206%200.240215%205.94732%200.146447%205.85355C0.0526784%205.75979%200%205.63261%200%205.5V1.5C0%201.10218%200.158035%200.720644%200.43934%200.43934C0.720644%200.158035%201.10218%200%201.5%200L5.5%200C5.63261%200%205.75979%200.0526784%205.85355%200.146447C5.94732%200.240215%206%200.367392%206%200.5C6%200.632608%205.94732%200.759785%205.85355%200.853553C5.75979%200.947322%205.63261%201%205.5%201H1.5ZM10%200.5C10%200.367392%2010.0527%200.240215%2010.1464%200.146447C10.2402%200.0526784%2010.3674%200%2010.5%200L14.5%200C14.8978%200%2015.2794%200.158035%2015.5607%200.43934C15.842%200.720644%2016%201.10218%2016%201.5V5.5C16%205.63261%2015.9473%205.75979%2015.8536%205.85355C15.7598%205.94732%2015.6326%206%2015.5%206C15.3674%206%2015.2402%205.94732%2015.1464%205.85355C15.0527%205.75979%2015%205.63261%2015%205.5V1.5C15%201.36739%2014.9473%201.24021%2014.8536%201.14645C14.7598%201.05268%2014.6326%201%2014.5%201H10.5C10.3674%201%2010.2402%200.947322%2010.1464%200.853553C10.0527%200.759785%2010%200.632608%2010%200.5ZM0.5%2010C0.632608%2010%200.759785%2010.0527%200.853553%2010.1464C0.947322%2010.2402%201%2010.3674%201%2010.5V14.5C1%2014.6326%201.05268%2014.7598%201.14645%2014.8536C1.24021%2014.9473%201.36739%2015%201.5%2015H5.5C5.63261%2015%205.75979%2015.0527%205.85355%2015.1464C5.94732%2015.2402%206%2015.3674%206%2015.5C6%2015.6326%205.94732%2015.7598%205.85355%2015.8536C5.75979%2015.9473%205.63261%2016%205.5%2016H1.5C1.10218%2016%200.720644%2015.842%200.43934%2015.5607C0.158035%2015.2794%200%2014.8978%200%2014.5L0%2010.5C0%2010.3674%200.0526784%2010.2402%200.146447%2010.1464C0.240215%2010.0527%200.367392%2010%200.5%2010ZM15.5%2010C15.6326%2010%2015.7598%2010.0527%2015.8536%2010.1464C15.9473%2010.2402%2016%2010.3674%2016%2010.5V14.5C16%2014.8978%2015.842%2015.2794%2015.5607%2015.5607C15.2794%2015.842%2014.8978%2016%2014.5%2016H10.5C10.3674%2016%2010.2402%2015.9473%2010.1464%2015.8536C10.0527%2015.7598%2010%2015.6326%2010%2015.5C10%2015.3674%2010.0527%2015.2402%2010.1464%2015.1464C10.2402%2015.0527%2010.3674%2015%2010.5%2015H14.5C14.6326%2015%2014.7598%2014.9473%2014.8536%2014.8536C14.9473%2014.7598%2015%2014.6326%2015%2014.5V10.5C15%2010.3674%2015.0527%2010.2402%2015.1464%2010.1464C15.2402%2010.0527%2015.3674%2010%2015.5%2010Z'%20fill='%23929292'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_257_8126'%3e%3crect%20width='16'%20height='16'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",Ryt="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%3e%3cpath%20d='M24%2011.9499C24%2019.8843%2019.1443%2022.4303%2016.5859%2020.1633C14.4801%2018.3148%2013.8535%2014.4087%2010.686%2014.0076C6.6657%2013.5019%206.31762%2018.8555%203.67223%2018.8555C0.591733%2018.8555%200%2014.3738%200%2012.0719C0%209.71772%200.661348%206.50904%203.28933%206.50904C6.35243%206.50904%206.52647%2011.0954%2010.3553%2010.8512C14.1668%2010.5897%2014.2364%205.81149%2016.7078%203.77119C18.8658%202.00989%2024%203.91069%2024%2011.9499Z'%20fill='%2397FCE4'/%3e%3c/svg%3e",Lyt="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='21'%20height='21'%20viewBox='0%200%2021%2021'%20fill='none'%3e%3cpath%20d='M14.1663%201.75H6.83375C3.64875%201.75%201.75%203.64875%201.75%206.83375V14.1575C1.75%2017.3513%203.64875%2019.25%206.83375%2019.25H14.1575C17.3425%2019.25%2019.2412%2017.3513%2019.2412%2014.1663V6.83375C19.25%203.64875%2017.3513%201.75%2014.1663%201.75ZM15.0938%2010.7887C15.0938%2011.1475%2014.7963%2011.445%2014.4375%2011.445C14.0787%2011.445%2013.7812%2011.1475%2013.7812%2010.7887V8.14625L7.02625%2014.9013C6.895%2015.0325%206.72875%2015.0938%206.5625%2015.0938C6.39625%2015.0938%206.23%2015.0325%206.09875%2014.9013C5.845%2014.6475%205.845%2014.2275%206.09875%2013.9738L12.8537%207.21875H10.2113C9.8525%207.21875%209.555%206.92125%209.555%206.5625C9.555%206.20375%209.8525%205.90625%2010.2113%205.90625H14.4375C14.7963%205.90625%2015.0938%206.20375%2015.0938%206.5625V10.7887Z'%20fill='%2300FF91'/%3e%3c/svg%3e",Dyt="/assets/telegramModalIcon-CwWiyADO.png",oke="data:image/svg+xml,%3csvg%20width='48'%20height='48'%20viewBox='0%200%2048%2048'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M43.1198%2021.48L40.3998%2018.32C39.8798%2017.72%2039.4598%2016.6%2039.4598%2015.8V12.4C39.4598%2010.28%2037.7198%208.53999%2035.5998%208.53999H32.1998C31.4198%208.53999%2030.2798%208.12%2029.6798%207.59999L26.5198%204.88C25.1398%203.7%2022.8798%203.7%2021.4798%204.88L18.3398%207.61999C17.7398%208.12%2016.5998%208.53999%2015.8198%208.53999H12.3598C10.2398%208.53999%208.49977%2010.28%208.49977%2012.4V15.82C8.49977%2016.6%208.07977%2017.72%207.57977%2018.32L4.87977%2021.5C3.71977%2022.88%203.71977%2025.12%204.87977%2026.5L7.57977%2029.68C8.07977%2030.28%208.49977%2031.4%208.49977%2032.18V35.6C8.49977%2037.72%2010.2398%2039.46%2012.3598%2039.46H15.8198C16.5998%2039.46%2017.7398%2039.88%2018.3398%2040.4L21.4998%2043.12C22.8798%2044.3%2025.1398%2044.3%2026.5398%2043.12L29.6998%2040.4C30.2998%2039.88%2031.4198%2039.46%2032.2198%2039.46H35.6198C37.7398%2039.46%2039.4798%2037.72%2039.4798%2035.6V32.2C39.4798%2031.42%2039.8998%2030.28%2040.4198%2029.68L43.1398%2026.52C44.2998%2025.14%2044.2998%2022.86%2043.1198%2021.48ZM32.3198%2020.22L22.6598%2029.88C22.3798%2030.16%2021.9998%2030.32%2021.5998%2030.32C21.1998%2030.32%2020.8198%2030.16%2020.5398%2029.88L15.6998%2025.04C15.1198%2024.46%2015.1198%2023.5%2015.6998%2022.92C16.2798%2022.34%2017.2398%2022.34%2017.8198%2022.92L21.5998%2026.7L30.1998%2018.1C30.7798%2017.52%2031.7398%2017.52%2032.3198%2018.1C32.8998%2018.68%2032.8998%2019.64%2032.3198%2020.22Z'%20fill='%231DE674'/%3e%3c/svg%3e",lke="data:image/svg+xml,%3csvg%20width='21'%20height='22'%20viewBox='0%200%2021%2022'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_3765_9549)'%3e%3cpath%20d='M10.5%2021.5C16.299%2021.5%2021%2016.799%2021%2011C21%205.20101%2016.299%200.5%2010.5%200.5C4.70101%200.5%200%205.20101%200%2011C0%2016.799%204.70101%2021.5%2010.5%2021.5Z'%20fill='url(%23paint0_linear_3765_9549)'/%3e%3cpath%20d='M7.10742%2011.7675L8.35316%2015.2156C8.35316%2015.2156%208.50891%2015.5382%208.67568%2015.5382C8.84246%2015.5382%2011.323%2012.9576%2011.323%2012.9576L14.0814%207.62976L7.15187%2010.8775L7.10742%2011.7675Z'%20fill='%23C8DAEA'/%3e%3cpath%20d='M8.75895%2012.6519L8.51981%2015.1934C8.51981%2015.1934%208.41971%2015.9721%209.19829%2015.1934C9.97686%2014.4146%2010.7221%2013.8141%2010.7221%2013.8141'%20fill='%23A9C6D8'/%3e%3cpath%20d='M7.12957%2011.8906L4.56705%2011.0557C4.56705%2011.0557%204.2608%2010.9315%204.35941%2010.6497C4.37971%2010.5916%204.42066%2010.5422%204.54316%2010.4572C5.11095%2010.0614%2015.0524%206.4882%2015.0524%206.4882C15.0524%206.4882%2015.3331%206.39362%2015.4987%206.45653C15.5396%206.46921%2015.5765%206.49254%2015.6055%206.52413C15.6344%206.55572%2015.6545%206.59445%2015.6636%206.63634C15.6815%206.71034%2015.689%206.78647%2015.6858%206.86253C15.6851%206.92833%2015.6771%206.98932%2015.6711%207.08495C15.6105%208.06189%2013.7986%2015.3531%2013.7986%2015.3531C13.7986%2015.3531%2013.6901%2015.7797%2013.3017%2015.7944C13.2063%2015.7974%2013.1112%2015.7813%2013.0221%2015.7468C12.933%2015.7124%2012.8518%2015.6603%2012.7833%2015.5938C12.0211%2014.9382%209.38663%2013.1677%208.8045%2012.7783C8.79136%2012.7694%208.78031%2012.7577%208.77206%2012.7441C8.76382%2012.7305%208.75859%2012.7153%208.75672%2012.6996C8.74858%2012.6585%208.79321%2012.6077%208.79321%2012.6077C8.79321%2012.6077%2013.3805%208.53019%2013.5025%208.10214C13.512%208.06898%2013.4763%208.05262%2013.4283%208.06714C13.1237%208.17923%207.842%2011.5146%207.25907%2011.8828C7.21711%2011.8954%207.17276%2011.8981%207.12957%2011.8906Z'%20fill='white'/%3e%3c/g%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_3765_9549'%20x1='10.5'%20y1='21.5'%20x2='10.5'%20y2='0.5'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%231D93D2'/%3e%3cstop%20offset='1'%20stop-color='%2338B0E3'/%3e%3c/linearGradient%3e%3cclipPath%20id='clip0_3765_9549'%3e%3crect%20width='21'%20height='21'%20fill='white'%20transform='translate(0%200.5)'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",Kme="data:image/svg+xml,%3csvg%20width='18'%20height='18'%20viewBox='0%200%2018%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M9%201.5C4.8675%201.5%201.5%204.8675%201.5%209C1.5%2013.1325%204.8675%2016.5%209%2016.5C13.1325%2016.5%2016.5%2013.1325%2016.5%209C16.5%204.8675%2013.1325%201.5%209%201.5ZM12.585%207.275L8.3325%2011.5275C8.2275%2011.6325%208.085%2011.6925%207.935%2011.6925C7.785%2011.6925%207.6425%2011.6325%207.5375%2011.5275L5.415%209.405C5.1975%209.1875%205.1975%208.8275%205.415%208.61C5.6325%208.3925%205.9925%208.3925%206.21%208.61L7.935%2010.335L11.79%206.48C12.0075%206.2625%2012.3675%206.2625%2012.585%206.48C12.8025%206.6975%2012.8025%207.05%2012.585%207.275Z'%20fill='%231DE674'/%3e%3c/svg%3e",cke="/assets/basedLogoSvgIcon-C71QETXb.png",uke="/assets/variationalIcon-VFI-7A--.png",dke="/assets/apexIcon-pUC7_jPm.png",fke="/assets/paradexIcon-gNYlng5D.jpg",Byt="/assets/basedAppIcon-xn9d9rQz.jpg",$yt="/assets/pacificaErrorImage-BKGQKjSV.jpeg";function Uyt({open:e,setOpen:t,setGenModalOpen:n,setGenWalletSuccess:r,setGenWalletData:s,setShowPrivateKey:a}){return i.jsx(i.Fragment,{children:i.jsxs(Ea,{open:e,onClose:()=>{},className:"relative z-[9999999999] font-manrope",children:[i.jsx(ja,{transition:!0,style:{backgroundColor:"rgba(0, 0, 0, 0.48)"},className:"fixed inset-0 transition-opacity data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in"}),i.jsx("div",{className:"fixed inset-0 z-[9999999999] w-screen overflow-y-auto",children:i.jsx("div",{className:"flex min-h-full justify-center p-4 text-center items-center sm:p-0",children:i.jsx(xa,{transition:!0,className:"relative transform overflow-hidden bg-[#101010] text-left shadow-xl transition-all data-[closed]:translate-y-4 data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in data-[closed]:sm:translate-y-0 data-[closed]:sm:scale-95 rounded-3xl",children:i.jsx("div",{className:"flex flex-col justify-start items-center gap-8 w-[300px] sm:w-[480px] h-max relative bg-[#252525] rounded-3xl py-4 text-white",children:i.jsxs(i.Fragment,{children:[i.jsx("div",{onClick:()=>{t(!1)},className:"cursor-pointer flex w-full items-center justify-end absolute right-2 top-1",children:i.jsx("span",{className:"absolute top-2 right-2 w-9 h-9 rounded-full p-1 flex justify-center items-center hover:bg-[#7535FE]",children:i.jsx("img",{className:"p-1",src:Ba})})}),i.jsx("div",{className:"pt-4",children:i.jsx("img",{src:Gi,alt:"",className:"w-[86px h-[86px]"})}),i.jsxs("div",{className:"flex flex-col justify-start items-center gap-2",children:[i.jsx("div",{className:"text-center text-white text-xl sm:text-2xl font-semibold font-manrope leading-7",children:"Last Chance to Save Your Private Key"}),i.jsx("div",{className:"w-[248px] sm:w-[348px] text-center text-white/60 text-[16px] font-medium font-manrope leading-5",children:"You will not be able to recover it later."})]}),i.jsxs("div",{className:"flex items-center justify-center gap-4",children:[i.jsx("div",{onClick:()=>{t(!1)},className:"h-8 px-4 py-3 rounded-xl shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-white justify-center items-center gap-2.5 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px]",children:"Cancel"})}),i.jsxs("div",{onClick:()=>{t(!1),r(!1),s([]),a(!1),rn.success(i.jsx(i.Fragment,{children:i.jsx("span",{style:{color:"#67ffbd",paddingLeft:"5px"},children:"The process is successful."})}),{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(103, 255, 189, 0.32)",width:"340px",minWidth:"340px",height:"40px",backdropFilter:"blur(48px)"},iconTheme:{primary:"#67FFBD",secondary:"#276047"}})},className:"h-8 pl-2 pr-3.5 py-3 bg-[#7445ff] rounded-[10px] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-[#8860ff] justify-center items-center gap-1.5 inline-flex cursor-pointer",children:[i.jsx("div",{"data-svg-wrapper":!0,children:i.jsxs("svg",{width:"19",height:"18",viewBox:"0 0 19 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("path",{d:"M5 9H14",stroke:"white",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),i.jsx("path",{d:"M9.5 13.5V4.5",stroke:"white",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})}),i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px]",children:"I Already Saved It"})]})]})]})})})})})]})})}const zyt=()=>i.jsxs("div",{className:"w-full flex flex-col items-center justify-center h-full gap-4 font-manrope",children:[i.jsxs("div",{role:"status",className:"flex justify-center items-center w-full",children:[i.jsxs("svg",{"aria-hidden":"true",className:"w-[48px] h-[48px] animate-spin text-gray-600 fill-white",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),i.jsx("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]}),i.jsx("span",{className:"sr-only",children:"Loading..."})]}),i.jsx("div",{className:"font-manrope font-medium text-sm sm:text-lg leading-5.5 text-gray-600",children:"Loading"})]}),Da=Ae.memo(zyt),Hyt=({loading:e,genWalletSuccess:t,genWalletData:n,showPrivateKey:r,genWalletName:s,setGenWalletName:a,errorMessage:o,setShowPrivateKey:l,setGenWalletData:c,setGenWalletSuccess:u,setErrorMessage:d,setLoading:f,handleListRequest:x,handlePageChange:g})=>{const{setSignModalOpen:v}=m.useContext(Qr),{address:w}=ns(),C=async()=>{const P=window.localStorage.getItem("hyperToken");if(!P){v(!0);return}if(!s){d("Please enter a name.");return}f(!0),d("");const I=window.localStorage.getItem("hyperAddress");try{const F=await(await fetch("https://dextrabothypev2.nftinit.io/api/wallet/generate",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:w?w.toLowerCase():I,token:P,wallet_name:s})})).json();F.success?(c(F==null?void 0:F.wallet),u(!0),a(""),x(),g(1)):(console.log("An error has occurred. Please try again."),d(F==null?void 0:F.error_message))}catch(R){console.error("An error has occurred:",R.message),d(R==null?void 0:R.message)}finally{f(!1)}},N=()=>{l(P=>!P)};return i.jsx(i.Fragment,{children:e?i.jsx("div",{role:"status",className:"flex justify-center items-center w-full my-[30px]",children:i.jsx(Da,{})}):t&&Object.keys(n).length>0?i.jsxs("div",{className:"flex flex-col items-start justify-start gap-4",children:[i.jsx("div",{className:"w-full flex justify-center items-center",children:i.jsx("span",{className:"flex justify-center items-center w-[286px] sm:w-[480px] text-center text-white/60 text-[16px] leading-5 font-medium font-['Inter'] tracking-tight",children:"Please copy the private key below and store it in a secure location. This private key will not be shown again."})}),i.jsxs("div",{className:"flex flex-col justify-start items-start gap-4 py-4 text-white w-full",children:[i.jsxs("div",{className:"flex flex-col items-start justify-center gap-2",children:[i.jsx("div",{className:"text-[#b1b1b1] text-[16px] font-medium font-inter leading-none",children:"Label"}),i.jsx("div",{className:"text-white text-[16px] font-medium font-inter leading-none",children:n==null?void 0:n.wallet_name})]}),i.jsx("div",{className:"w-full h-px bg-[#353535]"}),i.jsxs("div",{className:"flex flex-col items-start justify-center gap-2 w-[286px] sm:w-[400px]",children:[i.jsx("div",{className:"text-[#b1b1b1] text-[16px] font-medium font-inter leading-none",children:"Address"}),i.jsxs("div",{className:"flex justify-start items-center gap-2",children:[i.jsx("div",{className:"text-white text-[16px] font-medium font-inter leading-none break-all",children:n==null?void 0:n.address}),i.jsx("img",{onClick:P=>{P.stopPropagation(),navigator.clipboard.writeText(n==null?void 0:n.address),rn.success("Successfully copied.",{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(103, 255, 189, 0.16)",width:"280px",minWidth:"280px",height:"40px",backdropFilter:"blur(16px)"},iconTheme:{primary:"#67FFBD",secondary:"#276047"}})},src:wo,alt:"",className:"cursor-pointer"})]})]}),i.jsx("div",{className:"w-full h-px bg-[#353535]"}),i.jsxs("div",{className:"flex flex-col items-start justify-center gap-2",children:[i.jsx("div",{className:"text-[#b1b1b1] text-[16px] font-medium font-inter leading-none",children:"Private Key"}),i.jsxs("div",{className:"flex justify-start items-center gap-2",children:[i.jsx("div",{className:"text-white text-[16px] font-medium font-inter leading-none max-w-[280px] sm:max-w-[380px] break-all",children:r?n==null?void 0:n.private_key:"••••••••••••••••••"}),i.jsx("img",{onClick:P=>{P.stopPropagation(),navigator.clipboard.writeText(n==null?void 0:n.private_key),rn.success("Successfully copied.",{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(103, 255, 189, 0.16)",width:"280px",minWidth:"280px",height:"40px",backdropFilter:"blur(16px)"},iconTheme:{primary:"#67FFBD",secondary:"#276047"}})},src:wo,alt:"",className:"cursor-pointer"}),i.jsx("span",{onClick:()=>{N()},className:"p-1 rounded cursor-pointer",children:r?i.jsx(_et,{className:"w-4 h-4"}):i.jsx(jet,{className:"w-4 h-4"})})]})]})]})]}):i.jsxs("div",{className:"flex flex-col items-start justify-start gap-2 w-full -mt-2",children:[i.jsx("div",{className:"text-white text-sm font-medium leading-normal tracking-[-0.14px] w-full",children:"Enter a name for your follower wallet"}),i.jsx("div",{className:"w-full",children:i.jsx("input",{type:"text",value:s,onChange:P=>a(P.target.value),placeholder:"Wallet Name",className:"px-4 py-2 focus:outline-none focus:ring-0 w-full h-10 bg-[#1b1b1b] rounded-xl border border-[#303030] text-white text-sm font-medium font-['Inter'] leading-[8px] placeholder:text-[14px] placeholder:font-medium placeholder:tracking-[-0.28px] placeholder:leading-[8px] placeholder:font-inter focus:placeholder:text-white"})}),i.jsx("button",{onClick:()=>{C()},disabled:e,className:"w-full h-10 pl-2 pr-3.5 py-3 bg-[#7445ff] rounded-xl shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-[#8860ff] focus:ring-0 focus:outline-none justify-center items-center gap-1.5 inline-flex mt-2.5",children:i.jsx("div",{className:"text-white text-[14px] font-medium font-inter leading-[8px]",children:"Generate"})}),o&&i.jsxs("div",{className:"mt-2 w-full h-10 p-3 bg-[#ff7171]/20 rounded-xl shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] flex justify-start items-center gap-2.5",children:[i.jsx("img",{src:ec,alt:"Dextrabot"}),i.jsx("p",{className:"text-[#ff7171] text-[13px] font-normal font-['Inter'] leading-4",children:o})]})]})})},Vyt=({agentWalletData:e,setAgentWalletData:t,agentWalletName:n,setAgentWalletName:r,errorAgentMessage:s,setErrorAgentMessage:a,loadingAgent:o,setLoadingAgent:l,handleListRequest:c,handlePageChange:u,agentWalletAddress:d,setAgentWalletAddress:f,agentWalletPkey:x,setAgentWalletPkey:g})=>{const{setSignModalOpen:v}=m.useContext(Qr),{address:w}=ns(),C=async()=>{const N=window.localStorage.getItem("hyperToken");if(!N){v(!0);return}if(!n||!d||!x){n?d?x||a("Please enter the agent wallet private key."):a("Please enter the main public address."):a("Please enter a name.");return}l(!0),a("");const P=window.localStorage.getItem("hyperAddress");try{const R=await(await fetch("https://dextrabothypev2.nftinit.io/api/wallet/generate",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:w?w.toLowerCase():P,token:N,name:n,connet_wallet_address:d,agent_wallet_pkey:x})})).json();R.success?(t(R==null?void 0:R.wallet),r(""),c(),u(1)):(console.log("An error has occurred. Please try again."),a(R==null?void 0:R.error_message))}catch(I){console.error("An error has occurred:",I.message),a(I==null?void 0:I.message)}finally{l(!1)}};return i.jsx(i.Fragment,{children:o?i.jsx("div",{role:"status",className:"flex justify-center items-center w-full my-[30px]",children:i.jsx(Da,{})}):Object.keys(e).length>0?i.jsxs("div",{className:"flex flex-col items-start justify-start gap-4",children:[i.jsx("div",{className:"w-full flex justify-center items-center",children:i.jsx("span",{className:"flex justify-center items-center w-[400px] text-center text-white/60 text-[16px] leading-5 font-medium font-manrope tracking-tight",children:"Please copy the private key below and store it in a secure location. This private key will not be shown again."})}),i.jsxs("div",{className:"flex flex-col justify-start items-start gap-4 p-4 text-white",children:[i.jsxs("div",{className:"flex flex-col items-start justify-center gap-2",children:[i.jsx("div",{className:"text-[#b1b1b1] text-[16px] font-medium font-inter leading-none",children:"Label"}),i.jsx("div",{className:"text-white text-[16px] font-medium font-inter leading-none",children:e==null?void 0:e.wallet_name})]}),i.jsx("div",{className:"w-[440px] h-px bg-[#353535]"}),i.jsxs("div",{className:"flex flex-col items-start justify-center gap-2",children:[i.jsx("div",{className:"text-[#b1b1b1] text-[16px] font-medium font-inter leading-none",children:"Address"}),i.jsx("div",{className:"flex justify-start items-center gap-2",children:i.jsx("div",{className:"text-white text-[16px] font-medium font-inter leading-none",children:e==null?void 0:e.address})})]}),i.jsx("div",{className:"w-[440px] h-px bg-[#353535]"})]})]}):i.jsxs("div",{className:"flex flex-col items-center justify-start gap-2",children:[i.jsx("div",{className:"font-bold text-white",children:"Manually add api & secret key"}),i.jsxs("div",{className:"flex flex-col items-start justify-start gap-2",children:[i.jsx("input",{type:"text",value:n,onChange:N=>r(N.target.value),placeholder:"Wallet Name",className:"px-4 py-2 focus:outline-none focus:ring-2 focus:ring-blue-500 w-[286px] h-8 bg-[#1b1b1b] rounded-[10px] border border-[#303030] text-white"}),i.jsx("input",{type:"text",value:d,onChange:N=>f(N.target.value),placeholder:"Main Public Address",className:"px-4 py-2 focus:outline-none focus:ring-2 focus:ring-blue-500 w-[286px] h-8 bg-[#1b1b1b] rounded-[10px] border border-[#303030] text-white"}),i.jsx("input",{type:"text",value:x,onChange:N=>g(N.target.value),placeholder:"Agent Wallet Private Key",className:"px-4 py-2 focus:outline-none focus:ring-2 focus:ring-blue-500 w-[286px] h-8 bg-[#1b1b1b] rounded-[10px] border border-[#303030] text-white"})]}),i.jsxs("button",{onClick:()=>{C()},disabled:o,className:"w-[285px] h-8 pl-2 pr-3.5 py-3 bg-[#7445ff] rounded-[10px] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-[#8860ff] justify-center items-center gap-1.5 inline-flex",children:[i.jsx("div",{"data-svg-wrapper":!0,children:i.jsxs("svg",{width:"19",height:"18",viewBox:"0 0 19 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("path",{d:"M5 9H14",stroke:"white",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),i.jsx("path",{d:"M9.5 13.5V4.5",stroke:"white",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})}),i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px]",children:"Connect"})]}),s&&i.jsx("p",{className:"mt-2 text-sm text-red-500",children:s})]})})},hke="6.15.0";function Wyt(e,t,n){const r=t.split("|").map(a=>a.trim());for(let a=0;a<r.length;a++)switch(t){case"any":return;case"bigint":case"boolean":case"number":case"string":if(typeof e===t)return}const s=new Error(`invalid value for type ${t}`);throw s.code="INVALID_ARGUMENT",s.argument=`value.${n}`,s.value=e,s}async function Su(e){const t=Object.keys(e);return(await Promise.all(t.map(r=>Promise.resolve(e[r])))).reduce((r,s,a)=>(r[t[a]]=s,r),{})}function Ds(e,t,n){for(let r in t){let s=t[r];const a=n?n[r]:null;a&&Wyt(s,a,r),Object.defineProperty(e,r,{enumerable:!0,value:s,writable:!1})}}function MC(e,t){if(e==null)return"null";if(t==null&&(t=new Set),typeof e=="object"){if(t.has(e))return"[Circular]";t.add(e)}if(Array.isArray(e))return"[ "+e.map(n=>MC(n,t)).join(", ")+" ]";if(e instanceof Uint8Array){const n="0123456789abcdef";let r="0x";for(let s=0;s<e.length;s++)r+=n[e[s]>>4],r+=n[e[s]&15];return r}if(typeof e=="object"&&typeof e.toJSON=="function")return MC(e.toJSON(),t);switch(typeof e){case"boolean":case"number":case"symbol":return e.toString();case"bigint":return BigInt(e).toString();case"string":return JSON.stringify(e);case"object":{const n=Object.keys(e);return n.sort(),"{ "+n.map(r=>`${MC(r,t)}: ${MC(e[r],t)}`).join(", ")+" }"}}return"[ COULD NOT SERIALIZE ]"}function Zc(e,t){return e&&e.code===t}function sae(e){return Zc(e,"CALL_EXCEPTION")}function _o(e,t,n){let r=e;{const a=[];if(n){if("message"in n||"code"in n||"name"in n)throw new Error(`value will overwrite populated values: ${MC(n)}`);for(const o in n){if(o==="shortMessage")continue;const l=n[o];a.push(o+"="+MC(l))}}a.push(`code=${t}`),a.push(`version=${hke}`),a.length&&(e+=" ("+a.join(", ")+")")}let s;switch(t){case"INVALID_ARGUMENT":s=new TypeError(e);break;case"NUMERIC_FAULT":case"BUFFER_OVERRUN":s=new RangeError(e);break;default:s=new Error(e)}return Ds(s,{code:t}),n&&Object.assign(s,n),s.shortMessage==null&&Ds(s,{shortMessage:r}),s}function Lr(e,t,n,r){if(!e)throw _o(t,n,r)}function bn(e,t,n,r){Lr(e,t,"INVALID_ARGUMENT",{argument:n,value:r})}function pke(e,t,n){n==null&&(n=""),n&&(n=": "+n),Lr(e>=t,"missing argument"+n,"MISSING_ARGUMENT",{count:e,expectedCount:t}),Lr(e<=t,"too many arguments"+n,"UNEXPECTED_ARGUMENT",{count:e,expectedCount:t})}const qyt=["NFD","NFC","NFKD","NFKC"].reduce((e,t)=>{try{if("test".normalize(t)!=="test")throw new Error("bad");if(t==="NFD"&&"é".normalize("NFD")!=="é")throw new Error("broken");e.push(t)}catch{}return e},[]);function mke(e){Lr(qyt.indexOf(e)>=0,"platform missing String.prototype.normalize","UNSUPPORTED_OPERATION",{operation:"String.prototype.normalize",info:{form:e}})}function c5(e,t,n){if(n==null&&(n=""),e!==t){let r=n,s="new";n&&(r+=".",s+=" "+n),Lr(!1,`private constructor; use ${r}from* methods`,"UNSUPPORTED_OPERATION",{operation:s})}}function xke(e,t,n){if(e instanceof Uint8Array)return n?new Uint8Array(e):e;if(typeof e=="string"&&e.match(/^0x(?:[0-9a-f][0-9a-f])*$/i)){const r=new Uint8Array((e.length-2)/2);let s=2;for(let a=0;a<r.length;a++)r[a]=parseInt(e.substring(s,s+2),16),s+=2;return r}bn(!1,"invalid BytesLike value",t||"value",e)}function hs(e,t){return xke(e,t,!1)}function Jc(e,t){return xke(e,t,!0)}function co(e,t){return!(typeof e!="string"||!e.match(/^0x[0-9A-Fa-f]*$/)||typeof t=="number"&&e.length!==2+2*t||t===!0&&e.length%2!==0)}function TB(e){return co(e,!0)||e instanceof Uint8Array}const Yme="0123456789abcdef";function Kr(e){const t=hs(e);let n="0x";for(let r=0;r<t.length;r++){const s=t[r];n+=Yme[(s&240)>>4]+Yme[s&15]}return n}function Ra(e){return"0x"+e.map(t=>Kr(t).substring(2)).join("")}function n4(e){return co(e,!0)?(e.length-2)/2:hs(e).length}function go(e,t,n){const r=hs(e);return n!=null&&n>r.length&&Lr(!1,"cannot slice beyond data bounds","BUFFER_OVERRUN",{buffer:r,length:r.length,offset:n}),Kr(r.slice(t??0,n??r.length))}function gke(e,t,n){const r=hs(e);Lr(t>=r.length,"padding exceeds data length","BUFFER_OVERRUN",{buffer:new Uint8Array(r),length:t,offset:t+1});const s=new Uint8Array(t);return s.fill(0),n?s.set(r,t-r.length):s.set(r,0),Kr(s)}function a1(e,t){return gke(e,t,!0)}function Gyt(e,t){return gke(e,t,!1)}const IB=BigInt(0),rm=BigInt(1),yJ=9007199254740991;function Kyt(e,t){const n=PB(e,"value"),r=BigInt(Di(t,"width"));if(Lr(n>>r===IB,"overflow","NUMERIC_FAULT",{operation:"fromTwos",fault:"overflow",value:e}),n>>r-rm){const s=(rm<<r)-rm;return-((~n&s)+rm)}return n}function bke(e,t){let n=js(e,"value");const r=BigInt(Di(t,"width")),s=rm<<r-rm;if(n<IB){n=-n,Lr(n<=s,"too low","NUMERIC_FAULT",{operation:"toTwos",fault:"overflow",value:e});const a=(rm<<r)-rm;return(~n&a)+rm}else Lr(n<s,"too high","NUMERIC_FAULT",{operation:"toTwos",fault:"overflow",value:e});return n}function hj(e,t){const n=PB(e,"value"),r=BigInt(Di(t,"bits"));return n&(rm<<r)-rm}function js(e,t){switch(typeof e){case"bigint":return e;case"number":return bn(Number.isInteger(e),"underflow",t||"value",e),bn(e>=-9007199254740991&&e<=yJ,"overflow",t||"value",e),BigInt(e);case"string":try{if(e==="")throw new Error("empty string");return e[0]==="-"&&e[1]!=="-"?-BigInt(e.substring(1)):BigInt(e)}catch(n){bn(!1,`invalid BigNumberish string: ${n.message}`,t||"value",e)}}bn(!1,"invalid BigNumberish value",t||"value",e)}function PB(e,t){const n=js(e,t);return Lr(n>=IB,"unsigned value cannot be negative","NUMERIC_FAULT",{fault:"overflow",operation:"getUint",value:e}),n}const Xme="0123456789abcdef";function FB(e){if(e instanceof Uint8Array){let t="0x0";for(const n of e)t+=Xme[n>>4],t+=Xme[n&15];return BigInt(t)}return js(e)}function Di(e,t){switch(typeof e){case"bigint":return bn(e>=-9007199254740991&&e<=yJ,"overflow",t||"value",e),Number(e);case"number":return bn(Number.isInteger(e),"underflow",t||"value",e),bn(e>=-9007199254740991&&e<=yJ,"overflow",t||"value",e),e;case"string":try{if(e==="")throw new Error("empty string");return Di(BigInt(e),t)}catch(n){bn(!1,`invalid numeric string: ${n.message}`,t||"value",e)}}bn(!1,"invalid numeric value",t||"value",e)}function Yyt(e){return Di(FB(e))}function o1(e,t){let r=PB(e,"value").toString(16);if(t==null)r.length%2&&(r="0"+r);else{const s=Di(t,"width");for(Lr(s*2>=r.length,`value exceeds width (${s} bytes)`,"NUMERIC_FAULT",{operation:"toBeHex",fault:"overflow",value:e});r.length<s*2;)r="0"+r}return"0x"+r}function il(e){const t=PB(e,"value");if(t===IB)return new Uint8Array([]);let n=t.toString(16);n.length%2&&(n="0"+n);const r=new Uint8Array(n.length/2);for(let s=0;s<r.length;s++){const a=s*2;r[s]=parseInt(n.substring(a,a+2),16)}return r}function em(e){let t=Kr(TB(e)?e:il(e)).substring(2);for(;t.startsWith("0");)t=t.substring(1);return t===""&&(t="0"),"0x"+t}const xM="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";let qI=null;function Xyt(e){if(qI==null){qI={};for(let n=0;n<xM.length;n++)qI[xM[n]]=BigInt(n)}const t=qI[e];return bn(t!=null,"invalid base58 value","letter",e),t}const Qyt=BigInt(0),vJ=BigInt(58);function yke(e){const t=hs(e);let n=FB(t),r="";for(;n;)r=xM[Number(n%vJ)]+r,n/=vJ;for(let s=0;s<t.length&&!t[s];s++)r=xM[0]+r;return r}function Zyt(e){let t=Qyt;for(let n=0;n<e.length;n++)t*=vJ,t+=Xyt(e[n]);return t}function Jyt(e){e=atob(e);const t=new Uint8Array(e.length);for(let n=0;n<e.length;n++)t[n]=e.charCodeAt(n);return hs(t)}function e2t(e){const t=hs(e);let n="";for(let r=0;r<t.length;r++)n+=String.fromCharCode(t[r]);return btoa(n)}var F4;class vke{constructor(t,n,r){Un(this,"filter");Un(this,"emitter");Rn(this,F4);Wt(this,F4,n),Ds(this,{emitter:t,filter:r})}async removeListener(){ze(this,F4)!=null&&await this.emitter.off(this.filter,ze(this,F4))}}F4=new WeakMap;function t2t(e,t,n,r,s){bn(!1,`invalid codepoint at offset ${t}; ${e}`,"bytes",n)}function wke(e,t,n,r,s){if(e==="BAD_PREFIX"||e==="UNEXPECTED_CONTINUE"){let a=0;for(let o=t+1;o<n.length&&n[o]>>6===2;o++)a++;return a}return e==="OVERRUN"?n.length-t-1:0}function n2t(e,t,n,r,s){return e==="OVERLONG"?(bn(typeof s=="number","invalid bad code point for replacement","badCodepoint",s),r.push(s),0):(r.push(65533),wke(e,t,n))}const r2t=Object.freeze({error:t2t,ignore:wke,replace:n2t});function s2t(e,t){t==null&&(t=r2t.error);const n=hs(e,"bytes"),r=[];let s=0;for(;s<n.length;){const a=n[s++];if(!(a>>7)){r.push(a);continue}let o=null,l=null;if((a&224)===192)o=1,l=127;else if((a&240)===224)o=2,l=2047;else if((a&248)===240)o=3,l=65535;else{(a&192)===128?s+=t("UNEXPECTED_CONTINUE",s-1,n,r):s+=t("BAD_PREFIX",s-1,n,r);continue}if(s-1+o>=n.length){s+=t("OVERRUN",s-1,n,r);continue}let c=a&(1<<8-o-1)-1;for(let u=0;u<o;u++){let d=n[s];if((d&192)!=128){s+=t("MISSING_CONTINUE",s,n,r),c=null;break}c=c<<6|d&63,s++}if(c!==null){if(c>1114111){s+=t("OUT_OF_RANGE",s-1-o,n,r,c);continue}if(c>=55296&&c<=57343){s+=t("UTF16_SURROGATE",s-1-o,n,r,c);continue}if(c<=l){s+=t("OVERLONG",s-1-o,n,r,c);continue}r.push(c)}}return r}function ud(e,t){bn(typeof e=="string","invalid string value","str",e),t!=null&&(mke(t),e=e.normalize(t));let n=[];for(let r=0;r<e.length;r++){const s=e.charCodeAt(r);if(s<128)n.push(s);else if(s<2048)n.push(s>>6|192),n.push(s&63|128);else if((s&64512)==55296){r++;const a=e.charCodeAt(r);bn(r<e.length&&(a&64512)===56320,"invalid surrogate pair","str",e);const o=65536+((s&1023)<<10)+(a&1023);n.push(o>>18|240),n.push(o>>12&63|128),n.push(o>>6&63|128),n.push(o&63|128)}else n.push(s>>12|224),n.push(s>>6&63|128),n.push(s&63|128)}return new Uint8Array(n)}function i2t(e){return e.map(t=>t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode((t>>10&1023)+55296,(t&1023)+56320))).join("")}function gM(e,t){return i2t(s2t(e,t))}function Cke(e){async function t(n,r){Lr(r==null||!r.cancelled,"request cancelled before sending","CANCELLED");const s=n.url.split(":")[0].toLowerCase();Lr(s==="http"||s==="https",`unsupported protocol ${s}`,"UNSUPPORTED_OPERATION",{info:{protocol:s},operation:"request"}),Lr(s==="https"||!n.credentials||n.allowInsecureAuthentication,"insecure authorized connections unsupported","UNSUPPORTED_OPERATION",{operation:"request"});let a=null;const o=new AbortController,l=setTimeout(()=>{a=_o("request timeout","TIMEOUT"),o.abort()},n.timeout);r&&r.addListener(()=>{a=_o("request cancelled","CANCELLED"),o.abort()});const c=Object.assign({},e,{method:n.method,headers:new Headers(Array.from(n)),body:n.body||void 0,signal:o.signal});let u;try{u=await fetch(n.url,c)}catch(g){throw clearTimeout(l),a||g}clearTimeout(l);const d={};u.headers.forEach((g,v)=>{d[v.toLowerCase()]=g});const f=await u.arrayBuffer(),x=f==null?null:new Uint8Array(f);return{statusCode:u.status,statusMessage:u.statusText,headers:d,body:x}}return t}const a2t=12,o2t=250;let Qme=Cke();const l2t=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),c2t=new RegExp("^ipfs://(ipfs/)?(.*)$","i");let PH=!1;async function Ske(e,t){try{const n=e.match(l2t);if(!n)throw new Error("invalid data");return new Ay(200,"OK",{"content-type":n[1]||"text/plain"},n[2]?Jyt(n[3]):d2t(n[3]))}catch{return new Ay(599,"BAD REQUEST (invalid data: URI)",{},null,new Hy(e))}}function Nke(e){async function t(n,r){try{const s=n.match(c2t);if(!s)throw new Error("invalid link");return new Hy(`${e}${s[2]}`)}catch{return new Ay(599,"BAD REQUEST (invalid IPFS URI)",{},null,new Hy(n))}}return t}const GI={data:Ske,ipfs:Nke("https://gateway.ipfs.io/ipfs/")},Ake=new WeakMap;var yw,Gb;class u2t{constructor(t){Rn(this,yw);Rn(this,Gb);Wt(this,yw,[]),Wt(this,Gb,!1),Ake.set(t,()=>{if(!ze(this,Gb)){Wt(this,Gb,!0);for(const n of ze(this,yw))setTimeout(()=>{n()},0);Wt(this,yw,[])}})}addListener(t){Lr(!ze(this,Gb),"singal already cancelled","UNSUPPORTED_OPERATION",{operation:"fetchCancelSignal.addCancelListener"}),ze(this,yw).push(t)}get cancelled(){return ze(this,Gb)}checkSignal(){Lr(!this.cancelled,"cancelled","CANCELLED",{})}}yw=new WeakMap,Gb=new WeakMap;function KI(e){if(e==null)throw new Error("missing signal; should not happen");return e.checkSignal(),e}var O4,M4,Hp,gg,R4,L4,wc,If,bg,vw,ww,Cw,o0,Vp,Kb,Sw,pj;const uD=class uD{constructor(t){Rn(this,Sw);Rn(this,O4);Rn(this,M4);Rn(this,Hp);Rn(this,gg);Rn(this,R4);Rn(this,L4);Rn(this,wc);Rn(this,If);Rn(this,bg);Rn(this,vw);Rn(this,ww);Rn(this,Cw);Rn(this,o0);Rn(this,Vp);Rn(this,Kb);Wt(this,L4,String(t)),Wt(this,O4,!1),Wt(this,M4,!0),Wt(this,Hp,{}),Wt(this,gg,""),Wt(this,R4,3e5),Wt(this,Vp,{slotInterval:o2t,maxAttempts:a2t}),Wt(this,Kb,null)}get url(){return ze(this,L4)}set url(t){Wt(this,L4,String(t))}get body(){return ze(this,wc)==null?null:new Uint8Array(ze(this,wc))}set body(t){if(t==null)Wt(this,wc,void 0),Wt(this,If,void 0);else if(typeof t=="string")Wt(this,wc,ud(t)),Wt(this,If,"text/plain");else if(t instanceof Uint8Array)Wt(this,wc,t),Wt(this,If,"application/octet-stream");else if(typeof t=="object")Wt(this,wc,ud(JSON.stringify(t))),Wt(this,If,"application/json");else throw new Error("invalid body")}hasBody(){return ze(this,wc)!=null}get method(){return ze(this,gg)?ze(this,gg):this.hasBody()?"POST":"GET"}set method(t){t==null&&(t=""),Wt(this,gg,String(t).toUpperCase())}get headers(){const t=Object.assign({},ze(this,Hp));return ze(this,bg)&&(t.authorization=`Basic ${e2t(ud(ze(this,bg)))}`),this.allowGzip&&(t["accept-encoding"]="gzip"),t["content-type"]==null&&ze(this,If)&&(t["content-type"]=ze(this,If)),this.body&&(t["content-length"]=String(this.body.length)),t}getHeader(t){return this.headers[t.toLowerCase()]}setHeader(t,n){ze(this,Hp)[String(t).toLowerCase()]=String(n)}clearHeaders(){Wt(this,Hp,{})}[Symbol.iterator](){const t=this.headers,n=Object.keys(t);let r=0;return{next:()=>{if(r<n.length){const s=n[r++];return{value:[s,t[s]],done:!1}}return{value:void 0,done:!0}}}}get credentials(){return ze(this,bg)||null}setCredentials(t,n){bn(!t.match(/:/),"invalid basic authentication username","username","[REDACTED]"),Wt(this,bg,`${t}:${n}`)}get allowGzip(){return ze(this,M4)}set allowGzip(t){Wt(this,M4,!!t)}get allowInsecureAuthentication(){return!!ze(this,O4)}set allowInsecureAuthentication(t){Wt(this,O4,!!t)}get timeout(){return ze(this,R4)}set timeout(t){bn(t>=0,"timeout must be non-zero","timeout",t),Wt(this,R4,t)}get preflightFunc(){return ze(this,vw)||null}set preflightFunc(t){Wt(this,vw,t)}get processFunc(){return ze(this,ww)||null}set processFunc(t){Wt(this,ww,t)}get retryFunc(){return ze(this,Cw)||null}set retryFunc(t){Wt(this,Cw,t)}get getUrlFunc(){return ze(this,Kb)||Qme}set getUrlFunc(t){Wt(this,Kb,t)}toString(){return`<FetchRequest method=${JSON.stringify(this.method)} url=${JSON.stringify(this.url)} headers=${JSON.stringify(this.headers)} body=${ze(this,wc)?Kr(ze(this,wc)):"null"}>`}setThrottleParams(t){t.slotInterval!=null&&(ze(this,Vp).slotInterval=t.slotInterval),t.maxAttempts!=null&&(ze(this,Vp).maxAttempts=t.maxAttempts)}send(){return Lr(ze(this,o0)==null,"request already sent","UNSUPPORTED_OPERATION",{operation:"fetchRequest.send"}),Wt(this,o0,new u2t(this)),vr(this,Sw,pj).call(this,0,Zme()+this.timeout,0,this,new Ay(0,"",{},null,this))}cancel(){Lr(ze(this,o0)!=null,"request has not been sent","UNSUPPORTED_OPERATION",{operation:"fetchRequest.cancel"});const t=Ake.get(this);if(!t)throw new Error("missing signal; should not happen");t()}redirect(t){const n=this.url.split(":")[0].toLowerCase(),r=t.split(":")[0].toLowerCase();Lr(this.method==="GET"&&(n!=="https"||r!=="http")&&t.match(/^https?:/),"unsupported redirect","UNSUPPORTED_OPERATION",{operation:`redirect(${this.method} ${JSON.stringify(this.url)} => ${JSON.stringify(t)})`});const s=new uD(t);return s.method="GET",s.allowGzip=this.allowGzip,s.timeout=this.timeout,Wt(s,Hp,Object.assign({},ze(this,Hp))),ze(this,wc)&&Wt(s,wc,new Uint8Array(ze(this,wc))),Wt(s,If,ze(this,If)),s}clone(){const t=new uD(this.url);return Wt(t,gg,ze(this,gg)),ze(this,wc)&&Wt(t,wc,ze(this,wc)),Wt(t,If,ze(this,If)),Wt(t,Hp,Object.assign({},ze(this,Hp))),Wt(t,bg,ze(this,bg)),this.allowGzip&&(t.allowGzip=!0),t.timeout=this.timeout,this.allowInsecureAuthentication&&(t.allowInsecureAuthentication=!0),Wt(t,vw,ze(this,vw)),Wt(t,ww,ze(this,ww)),Wt(t,Cw,ze(this,Cw)),Wt(t,Vp,Object.assign({},ze(this,Vp))),Wt(t,Kb,ze(this,Kb)),t}static lockConfig(){PH=!0}static getGateway(t){return GI[t.toLowerCase()]||null}static registerGateway(t,n){if(t=t.toLowerCase(),t==="http"||t==="https")throw new Error(`cannot intercept ${t}; use registerGetUrl`);if(PH)throw new Error("gateways locked");GI[t]=n}static registerGetUrl(t){if(PH)throw new Error("gateways locked");Qme=t}static createGetUrlFunc(t){return Cke(t)}static createDataGateway(){return Ske}static createIpfsGatewayFunc(t){return Nke(t)}};O4=new WeakMap,M4=new WeakMap,Hp=new WeakMap,gg=new WeakMap,R4=new WeakMap,L4=new WeakMap,wc=new WeakMap,If=new WeakMap,bg=new WeakMap,vw=new WeakMap,ww=new WeakMap,Cw=new WeakMap,o0=new WeakMap,Vp=new WeakMap,Kb=new WeakMap,Sw=new WeakSet,pj=async function(t,n,r,s,a){var d,f,x;if(t>=ze(this,Vp).maxAttempts)return a.makeServerError("exceeded maximum retry limit");Lr(Zme()<=n,"timeout","TIMEOUT",{operation:"request.send",reason:"timeout",request:s}),r>0&&await f2t(r);let o=this.clone();const l=(o.url.split(":")[0]||"").toLowerCase();if(l in GI){const g=await GI[l](o.url,KI(ze(s,o0)));if(g instanceof Ay){let v=g;if(this.processFunc){KI(ze(s,o0));try{v=await this.processFunc(o,v)}catch(w){(w.throttle==null||typeof w.stall!="number")&&v.makeServerError("error in post-processing function",w).assertOk()}}return v}o=g}this.preflightFunc&&(o=await this.preflightFunc(o));const c=await this.getUrlFunc(o,KI(ze(s,o0)));let u=new Ay(c.statusCode,c.statusMessage,c.headers,c.body,s);if(u.statusCode===301||u.statusCode===302){try{const g=u.headers.location||"";return vr(d=o.redirect(g),Sw,pj).call(d,t+1,n,0,s,u)}catch{}return u}else if(u.statusCode===429&&(this.retryFunc==null||await this.retryFunc(o,u,t))){const g=u.headers["retry-after"];let v=ze(this,Vp).slotInterval*Math.trunc(Math.random()*Math.pow(2,t));return typeof g=="string"&&g.match(/^[1-9][0-9]*$/)&&(v=parseInt(g)),vr(f=o.clone(),Sw,pj).call(f,t+1,n,v,s,u)}if(this.processFunc){KI(ze(s,o0));try{u=await this.processFunc(o,u)}catch(g){(g.throttle==null||typeof g.stall!="number")&&u.makeServerError("error in post-processing function",g).assertOk();let v=ze(this,Vp).slotInterval*Math.trunc(Math.random()*Math.pow(2,t));return g.stall>=0&&(v=g.stall),vr(x=o.clone(),Sw,pj).call(x,t+1,n,v,s,u)}}return u};let Hy=uD;var Z_,J_,ek,Pf,D4,Nw;const que=class que{constructor(t,n,r,s,a){Rn(this,Z_);Rn(this,J_);Rn(this,ek);Rn(this,Pf);Rn(this,D4);Rn(this,Nw);Wt(this,Z_,t),Wt(this,J_,n),Wt(this,ek,Object.keys(r).reduce((o,l)=>(o[l.toLowerCase()]=String(r[l]),o),{})),Wt(this,Pf,s==null?null:new Uint8Array(s)),Wt(this,D4,a||null),Wt(this,Nw,{message:""})}toString(){return`<FetchResponse status=${this.statusCode} body=${ze(this,Pf)?Kr(ze(this,Pf)):"null"}>`}get statusCode(){return ze(this,Z_)}get statusMessage(){return ze(this,J_)}get headers(){return Object.assign({},ze(this,ek))}get body(){return ze(this,Pf)==null?null:new Uint8Array(ze(this,Pf))}get bodyText(){try{return ze(this,Pf)==null?"":gM(ze(this,Pf))}catch{Lr(!1,"response body is not valid UTF-8 data","UNSUPPORTED_OPERATION",{operation:"bodyText",info:{response:this}})}}get bodyJson(){try{return JSON.parse(this.bodyText)}catch{Lr(!1,"response body is not valid JSON","UNSUPPORTED_OPERATION",{operation:"bodyJson",info:{response:this}})}}[Symbol.iterator](){const t=this.headers,n=Object.keys(t);let r=0;return{next:()=>{if(r<n.length){const s=n[r++];return{value:[s,t[s]],done:!1}}return{value:void 0,done:!0}}}}makeServerError(t,n){let r;t?r=`CLIENT ESCALATED SERVER ERROR (${this.statusCode} ${this.statusMessage}; ${t})`:(t=`${this.statusCode} ${this.statusMessage}`,r=`CLIENT ESCALATED SERVER ERROR (${t})`);const s=new que(599,r,this.headers,this.body,ze(this,D4)||void 0);return Wt(s,Nw,{message:t,error:n}),s}throwThrottleError(t,n){n==null?n=-1:bn(Number.isInteger(n)&&n>=0,"invalid stall timeout","stall",n);const r=new Error(t||"throttling requests");throw Ds(r,{stall:n,throttle:!0}),r}getHeader(t){return this.headers[t.toLowerCase()]}hasBody(){return ze(this,Pf)!=null}get request(){return ze(this,D4)}ok(){return ze(this,Nw).message===""&&this.statusCode>=200&&this.statusCode<300}assertOk(){if(this.ok())return;let{message:t,error:n}=ze(this,Nw);t===""&&(t=`server response ${this.statusCode} ${this.statusMessage}`);let r=null;this.request&&(r=this.request.url);let s=null;try{ze(this,Pf)&&(s=gM(ze(this,Pf)))}catch{}Lr(!1,t,"SERVER_ERROR",{request:this.request||"unknown request",response:this,error:n,info:{requestUrl:r,responseBody:s,responseStatus:`${this.statusCode} ${this.statusMessage}`}})}};Z_=new WeakMap,J_=new WeakMap,ek=new WeakMap,Pf=new WeakMap,D4=new WeakMap,Nw=new WeakMap;let Ay=que;function Zme(){return new Date().getTime()}function d2t(e){return ud(e.replace(/%([0-9a-f][0-9a-f])/gi,(t,n)=>String.fromCharCode(parseInt(n,16))))}function f2t(e){return new Promise(t=>setTimeout(t,e))}function h2t(e){let t=e.toString(16);for(;t.length<2;)t="0"+t;return"0x"+t}function Jme(e,t,n){let r=0;for(let s=0;s<n;s++)r=r*256+e[t+s];return r}function e0e(e,t,n,r){const s=[];for(;n<t+1+r;){const a=jke(e,n);s.push(a.result),n+=a.consumed,Lr(n<=t+1+r,"child data too short","BUFFER_OVERRUN",{buffer:e,length:r,offset:t})}return{consumed:1+r,result:s}}function jke(e,t){Lr(e.length!==0,"data too short","BUFFER_OVERRUN",{buffer:e,length:0,offset:1});const n=r=>{Lr(r<=e.length,"data short segment too short","BUFFER_OVERRUN",{buffer:e,length:e.length,offset:r})};if(e[t]>=248){const r=e[t]-247;n(t+1+r);const s=Jme(e,t+1,r);return n(t+1+r+s),e0e(e,t,t+1+r,r+s)}else if(e[t]>=192){const r=e[t]-192;return n(t+1+r),e0e(e,t,t+1,r)}else if(e[t]>=184){const r=e[t]-183;n(t+1+r);const s=Jme(e,t+1,r);n(t+1+r+s);const a=Kr(e.slice(t+1+r,t+1+r+s));return{consumed:1+r+s,result:a}}else if(e[t]>=128){const r=e[t]-128;n(t+1+r);const s=Kr(e.slice(t+1,t+1+r));return{consumed:1+r,result:s}}return{consumed:1,result:h2t(e[t])}}function Bk(e){const t=hs(e,"data"),n=jke(t,0);return bn(n.consumed===t.length,"unexpected junk after rlp payload","data",e),n.result}function t0e(e){const t=[];for(;e;)t.unshift(e&255),e>>=8;return t}function Eke(e){if(Array.isArray(e)){let r=[];if(e.forEach(function(a){r=r.concat(Eke(a))}),r.length<=55)return r.unshift(192+r.length),r;const s=t0e(r.length);return s.unshift(247+s.length),s.concat(r)}const t=Array.prototype.slice.call(hs(e,"object"));if(t.length===1&&t[0]<=127)return t;if(t.length<=55)return t.unshift(128+t.length),t;const n=t0e(t.length);return n.unshift(183+n.length),n.concat(t)}const n0e="0123456789abcdef";function l1(e){let t="0x";for(const n of Eke(e))t+=n0e[n>>4],t+=n0e[n&15];return t}function p2t(e){const t=hs(e,"randomBytes");t[6]=t[6]&15|64,t[8]=t[8]&63|128;const n=Kr(t);return[n.substring(2,10),n.substring(10,14),n.substring(14,18),n.substring(18,22),n.substring(22,34)].join("-")}const id=32,wJ=new Uint8Array(id),m2t=["then"],YI={},_ke=new WeakMap;function Mv(e){return _ke.get(e)}function r0e(e,t){_ke.set(e,t)}function C7(e,t){const n=new Error(`deferred error during ABI decoding triggered accessing ${e}`);throw n.error=t,n}function CJ(e,t,n){return e.indexOf(null)>=0?t.map((r,s)=>r instanceof bM?CJ(Mv(r),r,n):r):e.reduce((r,s,a)=>{let o=t.getValue(s);return s in r||(n&&o instanceof bM&&(o=CJ(Mv(o),o,n)),r[s]=o),r},{})}var B4,Ug;let bM=(Ug=class extends Array{constructor(...n){const r=n[0];let s=n[1],a=(n[2]||[]).slice(),o=!0;r!==YI&&(s=n,a=[],o=!1);super(s.length);Rn(this,B4);s.forEach((u,d)=>{this[d]=u});const l=a.reduce((u,d)=>(typeof d=="string"&&u.set(d,(u.get(d)||0)+1),u),new Map);if(r0e(this,Object.freeze(s.map((u,d)=>{const f=a[d];return f!=null&&l.get(f)===1?f:null}))),Wt(this,B4,[]),ze(this,B4)==null&&ze(this,B4),!o)return;Object.freeze(this);const c=new Proxy(this,{get:(u,d,f)=>{if(typeof d=="string"){if(d.match(/^[0-9]+$/)){const g=Di(d,"%index");if(g<0||g>=this.length)throw new RangeError("out of result range");const v=u[g];return v instanceof Error&&C7(`index ${g}`,v),v}if(m2t.indexOf(d)>=0)return Reflect.get(u,d,f);const x=u[d];if(x instanceof Function)return function(...g){return x.apply(this===f?u:this,g)};if(!(d in u))return u.getValue.apply(this===f?u:this,[d])}return Reflect.get(u,d,f)}});return r0e(c,Mv(this)),c}toArray(n){const r=[];return this.forEach((s,a)=>{s instanceof Error&&C7(`index ${a}`,s),n&&s instanceof Ug&&(s=s.toArray(n)),r.push(s)}),r}toObject(n){const r=Mv(this);return r.reduce((s,a,o)=>(Lr(a!=null,`value at index ${o} unnamed`,"UNSUPPORTED_OPERATION",{operation:"toObject()"}),CJ(r,this,n)),{})}slice(n,r){n==null&&(n=0),n<0&&(n+=this.length,n<0&&(n=0)),r==null&&(r=this.length),r<0&&(r+=this.length,r<0&&(r=0)),r>this.length&&(r=this.length);const s=Mv(this),a=[],o=[];for(let l=n;l<r;l++)a.push(this[l]),o.push(s[l]);return new Ug(YI,a,o)}filter(n,r){const s=Mv(this),a=[],o=[];for(let l=0;l<this.length;l++){const c=this[l];c instanceof Error&&C7(`index ${l}`,c),n.call(r,c,l,this)&&(a.push(c),o.push(s[l]))}return new Ug(YI,a,o)}map(n,r){const s=[];for(let a=0;a<this.length;a++){const o=this[a];o instanceof Error&&C7(`index ${a}`,o),s.push(n.call(r,o,a,this))}return s}getValue(n){const r=Mv(this).indexOf(n);if(r===-1)return;const s=this[r];return s instanceof Error&&C7(`property ${JSON.stringify(n)}`,s.error),s}static fromItems(n,r){return new Ug(YI,n,r)}},B4=new WeakMap,Ug);function s0e(e){let t=il(e);return Lr(t.length<=id,"value out-of-bounds","BUFFER_OVERRUN",{buffer:t,length:id,offset:t.length}),t.length!==id&&(t=Jc(Ra([wJ.slice(t.length%id),t]))),t}class N1{constructor(t,n,r,s){Un(this,"name");Un(this,"type");Un(this,"localName");Un(this,"dynamic");Ds(this,{name:t,type:n,localName:r,dynamic:s},{name:"string",type:"string",localName:"string",dynamic:"boolean"})}_throwError(t,n){bn(!1,t,this.localName,n)}}var yg,Aw,$4,GF;class SJ{constructor(){Rn(this,$4);Rn(this,yg);Rn(this,Aw);Wt(this,yg,[]),Wt(this,Aw,0)}get data(){return Ra(ze(this,yg))}get length(){return ze(this,Aw)}appendWriter(t){return vr(this,$4,GF).call(this,Jc(t.data))}writeBytes(t){let n=Jc(t);const r=n.length%id;return r&&(n=Jc(Ra([n,wJ.slice(r)]))),vr(this,$4,GF).call(this,n)}writeValue(t){return vr(this,$4,GF).call(this,s0e(t))}writeUpdatableValue(){const t=ze(this,yg).length;return ze(this,yg).push(wJ),Wt(this,Aw,ze(this,Aw)+id),n=>{ze(this,yg)[t]=s0e(n)}}}yg=new WeakMap,Aw=new WeakMap,$4=new WeakSet,GF=function(t){return ze(this,yg).push(t),Wt(this,Aw,ze(this,Aw)+t.length),t.length};var Bd,Ff,jw,Ew,Yb,e5,AJ,kke;const Gue=class Gue{constructor(t,n,r){Rn(this,e5);Un(this,"allowLoose");Rn(this,Bd);Rn(this,Ff);Rn(this,jw);Rn(this,Ew);Rn(this,Yb);Ds(this,{allowLoose:!!n}),Wt(this,Bd,Jc(t)),Wt(this,jw,0),Wt(this,Ew,null),Wt(this,Yb,r??1024),Wt(this,Ff,0)}get data(){return Kr(ze(this,Bd))}get dataLength(){return ze(this,Bd).length}get consumed(){return ze(this,Ff)}get bytes(){return new Uint8Array(ze(this,Bd))}subReader(t){const n=new Gue(ze(this,Bd).slice(ze(this,Ff)+t),this.allowLoose,ze(this,Yb));return Wt(n,Ew,this),n}readBytes(t,n){let r=vr(this,e5,kke).call(this,0,t,!!n);return vr(this,e5,AJ).call(this,t),Wt(this,Ff,ze(this,Ff)+r.length),r.slice(0,t)}readValue(){return FB(this.readBytes(id))}readIndex(){return Yyt(this.readBytes(id))}};Bd=new WeakMap,Ff=new WeakMap,jw=new WeakMap,Ew=new WeakMap,Yb=new WeakMap,e5=new WeakSet,AJ=function(t){var n;if(ze(this,Ew))return vr(n=ze(this,Ew),e5,AJ).call(n,t);Wt(this,jw,ze(this,jw)+t),Lr(ze(this,Yb)<1||ze(this,jw)<=ze(this,Yb)*this.dataLength,`compressed ABI data exceeds inflation ratio of ${ze(this,Yb)} ( see: https://github.com/ethers-io/ethers.js/issues/4537 )`,"BUFFER_OVERRUN",{buffer:Jc(ze(this,Bd)),offset:ze(this,Ff),length:t,info:{bytesRead:ze(this,jw),dataLength:this.dataLength}})},kke=function(t,n,r){let s=Math.ceil(n/id)*id;return ze(this,Ff)+s>ze(this,Bd).length&&(this.allowLoose&&r&&ze(this,Ff)+n<=ze(this,Bd).length?s=n:Lr(!1,"data out-of-bounds","BUFFER_OVERRUN",{buffer:Jc(ze(this,Bd)),length:ze(this,Bd).length,offset:ze(this,Ff)+s})),ze(this,Bd).slice(ze(this,Ff),ze(this,Ff)+s)};let NJ=Gue;function Lf(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`Wrong positive integer: ${e}`)}function iae(e,...t){if(!(e instanceof Uint8Array))throw new Error("Expected Uint8Array");if(t.length>0&&!t.includes(e.length))throw new Error(`Expected Uint8Array of length ${t}, not of length=${e.length}`)}function Tke(e){if(typeof e!="function"||typeof e.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");Lf(e.outputLen),Lf(e.blockLen)}function RS(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function Ike(e,t){iae(e);const n=t.outputLen;if(e.length<n)throw new Error(`digestInto() expects output buffer of length at least ${n}`)}const FH=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Pke=e=>e instanceof Uint8Array,KF=e=>new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4)),YF=e=>new DataView(e.buffer,e.byteOffset,e.byteLength),Xm=(e,t)=>e<<32-t|e>>>t,x2t=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!x2t)throw new Error("Non little-endian hardware is not supported");const g2t=async()=>{};async function i0e(e,t,n){let r=Date.now();for(let s=0;s<e;s++){n(s);const a=Date.now()-r;a>=0&&a<t||(await g2t(),r+=a)}}function b2t(e){if(typeof e!="string")throw new Error(`utf8ToBytes expected string, got ${typeof e}`);return new Uint8Array(new TextEncoder().encode(e))}function LS(e){if(typeof e=="string"&&(e=b2t(e)),!Pke(e))throw new Error(`expected Uint8Array, got ${typeof e}`);return e}function y2t(...e){const t=new Uint8Array(e.reduce((r,s)=>r+s.length,0));let n=0;return e.forEach(r=>{if(!Pke(r))throw new Error("Uint8Array expected");t.set(r,n),n+=r.length}),t}let aae=class{clone(){return this._cloneInto()}};const v2t={}.toString;function Fke(e,t){if(t!==void 0&&v2t.call(t)!=="[object Object]")throw new Error("Options should be object or undefined");return Object.assign(e,t)}function OB(e){const t=r=>e().update(LS(r)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}function w2t(e=32){if(FH&&typeof FH.getRandomValues=="function")return FH.getRandomValues(new Uint8Array(e));throw new Error("crypto.getRandomValues must be defined")}let Oke=class extends aae{constructor(t,n){super(),this.finished=!1,this.destroyed=!1,Tke(t);const r=LS(n);if(this.iHash=t.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const s=this.blockLen,a=new Uint8Array(s);a.set(r.length>s?t.create().update(r).digest():r);for(let o=0;o<a.length;o++)a[o]^=54;this.iHash.update(a),this.oHash=t.create();for(let o=0;o<a.length;o++)a[o]^=106;this.oHash.update(a),a.fill(0)}update(t){return RS(this),this.iHash.update(t),this}digestInto(t){RS(this),iae(t,this.outputLen),this.finished=!0,this.iHash.digestInto(t),this.oHash.update(t),this.oHash.digestInto(t),this.destroy()}digest(){const t=new Uint8Array(this.oHash.outputLen);return this.digestInto(t),t}_cloneInto(t){t||(t=Object.create(Object.getPrototypeOf(this),{}));const{oHash:n,iHash:r,finished:s,destroyed:a,blockLen:o,outputLen:l}=this;return t=t,t.finished=s,t.destroyed=a,t.blockLen=o,t.outputLen=l,t.oHash=n._cloneInto(t.oHash),t.iHash=r._cloneInto(t.iHash),t}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}};const MB=(e,t,n)=>new Oke(e,t).update(n).digest();MB.create=(e,t)=>new Oke(e,t);function C2t(e,t,n,r){Tke(e);const s=Fke({dkLen:32,asyncTick:10},r),{c:a,dkLen:o,asyncTick:l}=s;if(Lf(a),Lf(o),Lf(l),a<1)throw new Error("PBKDF2: iterations (c) should be >= 1");const c=LS(t),u=LS(n),d=new Uint8Array(o),f=MB.create(e,c),x=f._cloneInto().update(u);return{c:a,dkLen:o,asyncTick:l,DK:d,PRF:f,PRFSalt:x}}function S2t(e,t,n,r,s){return e.destroy(),t.destroy(),r&&r.destroy(),s.fill(0),n}function oae(e,t,n,r){const{c:s,dkLen:a,DK:o,PRF:l,PRFSalt:c}=C2t(e,t,n,r);let u;const d=new Uint8Array(4),f=YF(d),x=new Uint8Array(l.outputLen);for(let g=1,v=0;v<a;g++,v+=l.outputLen){const w=o.subarray(v,v+l.outputLen);f.setInt32(0,g,!1),(u=c._cloneInto(u)).update(d).digestInto(x),w.set(x.subarray(0,w.length));for(let C=1;C<s;C++){l._cloneInto(u).update(x).digestInto(x);for(let N=0;N<w.length;N++)w[N]^=x[N]}}return S2t(l,c,o,u,x)}function N2t(e,t,n,r){if(typeof e.setBigUint64=="function")return e.setBigUint64(t,n,r);const s=BigInt(32),a=BigInt(4294967295),o=Number(n>>s&a),l=Number(n&a),c=r?4:0,u=r?0:4;e.setUint32(t+c,o,r),e.setUint32(t+u,l,r)}class lae extends aae{constructor(t,n,r,s){super(),this.blockLen=t,this.outputLen=n,this.padOffset=r,this.isLE=s,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(t),this.view=YF(this.buffer)}update(t){RS(this);const{view:n,buffer:r,blockLen:s}=this;t=LS(t);const a=t.length;for(let o=0;o<a;){const l=Math.min(s-this.pos,a-o);if(l===s){const c=YF(t);for(;s<=a-o;o+=s)this.process(c,o);continue}r.set(t.subarray(o,o+l),this.pos),this.pos+=l,o+=l,this.pos===s&&(this.process(n,0),this.pos=0)}return this.length+=t.length,this.roundClean(),this}digestInto(t){RS(this),Ike(t,this),this.finished=!0;const{buffer:n,view:r,blockLen:s,isLE:a}=this;let{pos:o}=this;n[o++]=128,this.buffer.subarray(o).fill(0),this.padOffset>s-o&&(this.process(r,0),o=0);for(let f=o;f<s;f++)n[f]=0;N2t(r,s-8,BigInt(this.length*8),a),this.process(r,0);const l=YF(t),c=this.outputLen;if(c%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const u=c/4,d=this.get();if(u>d.length)throw new Error("_sha2: outputLen bigger than state");for(let f=0;f<u;f++)l.setUint32(4*f,d[f],a)}digest(){const{buffer:t,outputLen:n}=this;this.digestInto(t);const r=t.slice(0,n);return this.destroy(),r}_cloneInto(t){t||(t=new this.constructor),t.set(...this.get());const{blockLen:n,buffer:r,length:s,finished:a,destroyed:o,pos:l}=this;return t.length=s,t.pos=l,t.finished=a,t.destroyed=o,s%n&&t.buffer.set(r),t}}const A2t=(e,t,n)=>e&t^~e&n,j2t=(e,t,n)=>e&t^e&n^t&n,E2t=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),lb=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),cb=new Uint32Array(64);let _2t=class extends lae{constructor(){super(64,32,8,!1),this.A=lb[0]|0,this.B=lb[1]|0,this.C=lb[2]|0,this.D=lb[3]|0,this.E=lb[4]|0,this.F=lb[5]|0,this.G=lb[6]|0,this.H=lb[7]|0}get(){const{A:t,B:n,C:r,D:s,E:a,F:o,G:l,H:c}=this;return[t,n,r,s,a,o,l,c]}set(t,n,r,s,a,o,l,c){this.A=t|0,this.B=n|0,this.C=r|0,this.D=s|0,this.E=a|0,this.F=o|0,this.G=l|0,this.H=c|0}process(t,n){for(let f=0;f<16;f++,n+=4)cb[f]=t.getUint32(n,!1);for(let f=16;f<64;f++){const x=cb[f-15],g=cb[f-2],v=Xm(x,7)^Xm(x,18)^x>>>3,w=Xm(g,17)^Xm(g,19)^g>>>10;cb[f]=w+cb[f-7]+v+cb[f-16]|0}let{A:r,B:s,C:a,D:o,E:l,F:c,G:u,H:d}=this;for(let f=0;f<64;f++){const x=Xm(l,6)^Xm(l,11)^Xm(l,25),g=d+x+A2t(l,c,u)+E2t[f]+cb[f]|0,w=(Xm(r,2)^Xm(r,13)^Xm(r,22))+j2t(r,s,a)|0;d=u,u=c,c=l,l=o+g|0,o=a,a=s,s=r,r=g+w|0}r=r+this.A|0,s=s+this.B|0,a=a+this.C|0,o=o+this.D|0,l=l+this.E|0,c=c+this.F|0,u=u+this.G|0,d=d+this.H|0,this.set(r,s,a,o,l,c,u,d)}roundClean(){cb.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}};const kA=OB(()=>new _2t),XI=BigInt(2**32-1),jJ=BigInt(32);function Mke(e,t=!1){return t?{h:Number(e&XI),l:Number(e>>jJ&XI)}:{h:Number(e>>jJ&XI)|0,l:Number(e&XI)|0}}function Rke(e,t=!1){let n=new Uint32Array(e.length),r=new Uint32Array(e.length);for(let s=0;s<e.length;s++){const{h:a,l:o}=Mke(e[s],t);[n[s],r[s]]=[a,o]}return[n,r]}const k2t=(e,t)=>BigInt(e>>>0)<<jJ|BigInt(t>>>0),T2t=(e,t,n)=>e>>>n,I2t=(e,t,n)=>e<<32-n|t>>>n,P2t=(e,t,n)=>e>>>n|t<<32-n,F2t=(e,t,n)=>e<<32-n|t>>>n,O2t=(e,t,n)=>e<<64-n|t>>>n-32,M2t=(e,t,n)=>e>>>n-32|t<<64-n,R2t=(e,t)=>t,L2t=(e,t)=>e,Lke=(e,t,n)=>e<<n|t>>>32-n,Dke=(e,t,n)=>t<<n|e>>>32-n,Bke=(e,t,n)=>t<<n-32|e>>>64-n,$ke=(e,t,n)=>e<<n-32|t>>>64-n;function D2t(e,t,n,r){const s=(t>>>0)+(r>>>0);return{h:e+n+(s/2**32|0)|0,l:s|0}}const B2t=(e,t,n)=>(e>>>0)+(t>>>0)+(n>>>0),$2t=(e,t,n,r)=>t+n+r+(e/2**32|0)|0,U2t=(e,t,n,r)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0),z2t=(e,t,n,r,s)=>t+n+r+s+(e/2**32|0)|0,H2t=(e,t,n,r,s)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0)+(s>>>0),V2t=(e,t,n,r,s,a)=>t+n+r+s+a+(e/2**32|0)|0,Ri={fromBig:Mke,split:Rke,toBig:k2t,shrSH:T2t,shrSL:I2t,rotrSH:P2t,rotrSL:F2t,rotrBH:O2t,rotrBL:M2t,rotr32H:R2t,rotr32L:L2t,rotlSH:Lke,rotlSL:Dke,rotlBH:Bke,rotlBL:$ke,add:D2t,add3L:B2t,add3H:$2t,add4L:U2t,add4H:z2t,add5H:V2t,add5L:H2t},[W2t,q2t]=Ri.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(e=>BigInt(e))),ub=new Uint32Array(80),db=new Uint32Array(80);class G2t extends lae{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){const{Ah:t,Al:n,Bh:r,Bl:s,Ch:a,Cl:o,Dh:l,Dl:c,Eh:u,El:d,Fh:f,Fl:x,Gh:g,Gl:v,Hh:w,Hl:C}=this;return[t,n,r,s,a,o,l,c,u,d,f,x,g,v,w,C]}set(t,n,r,s,a,o,l,c,u,d,f,x,g,v,w,C){this.Ah=t|0,this.Al=n|0,this.Bh=r|0,this.Bl=s|0,this.Ch=a|0,this.Cl=o|0,this.Dh=l|0,this.Dl=c|0,this.Eh=u|0,this.El=d|0,this.Fh=f|0,this.Fl=x|0,this.Gh=g|0,this.Gl=v|0,this.Hh=w|0,this.Hl=C|0}process(t,n){for(let I=0;I<16;I++,n+=4)ub[I]=t.getUint32(n),db[I]=t.getUint32(n+=4);for(let I=16;I<80;I++){const R=ub[I-15]|0,F=db[I-15]|0,U=Ri.rotrSH(R,F,1)^Ri.rotrSH(R,F,8)^Ri.shrSH(R,F,7),L=Ri.rotrSL(R,F,1)^Ri.rotrSL(R,F,8)^Ri.shrSL(R,F,7),z=ub[I-2]|0,Q=db[I-2]|0,ne=Ri.rotrSH(z,Q,19)^Ri.rotrBH(z,Q,61)^Ri.shrSH(z,Q,6),J=Ri.rotrSL(z,Q,19)^Ri.rotrBL(z,Q,61)^Ri.shrSL(z,Q,6),X=Ri.add4L(L,J,db[I-7],db[I-16]),re=Ri.add4H(X,U,ne,ub[I-7],ub[I-16]);ub[I]=re|0,db[I]=X|0}let{Ah:r,Al:s,Bh:a,Bl:o,Ch:l,Cl:c,Dh:u,Dl:d,Eh:f,El:x,Fh:g,Fl:v,Gh:w,Gl:C,Hh:N,Hl:P}=this;for(let I=0;I<80;I++){const R=Ri.rotrSH(f,x,14)^Ri.rotrSH(f,x,18)^Ri.rotrBH(f,x,41),F=Ri.rotrSL(f,x,14)^Ri.rotrSL(f,x,18)^Ri.rotrBL(f,x,41),U=f&g^~f&w,L=x&v^~x&C,z=Ri.add5L(P,F,L,q2t[I],db[I]),Q=Ri.add5H(z,N,R,U,W2t[I],ub[I]),ne=z|0,J=Ri.rotrSH(r,s,28)^Ri.rotrBH(r,s,34)^Ri.rotrBH(r,s,39),X=Ri.rotrSL(r,s,28)^Ri.rotrBL(r,s,34)^Ri.rotrBL(r,s,39),re=r&a^r&l^a&l,pe=s&o^s&c^o&c;N=w|0,P=C|0,w=g|0,C=v|0,g=f|0,v=x|0,{h:f,l:x}=Ri.add(u|0,d|0,Q|0,ne|0),u=l|0,d=c|0,l=a|0,c=o|0,a=r|0,o=s|0;const Y=Ri.add3L(ne,X,pe);r=Ri.add3H(Y,Q,J,re),s=Y|0}({h:r,l:s}=Ri.add(this.Ah|0,this.Al|0,r|0,s|0)),{h:a,l:o}=Ri.add(this.Bh|0,this.Bl|0,a|0,o|0),{h:l,l:c}=Ri.add(this.Ch|0,this.Cl|0,l|0,c|0),{h:u,l:d}=Ri.add(this.Dh|0,this.Dl|0,u|0,d|0),{h:f,l:x}=Ri.add(this.Eh|0,this.El|0,f|0,x|0),{h:g,l:v}=Ri.add(this.Fh|0,this.Fl|0,g|0,v|0),{h:w,l:C}=Ri.add(this.Gh|0,this.Gl|0,w|0,C|0),{h:N,l:P}=Ri.add(this.Hh|0,this.Hl|0,N|0,P|0),this.set(r,s,a,o,l,c,u,d,f,x,g,v,w,C,N,P)}roundClean(){ub.fill(0),db.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}const cae=OB(()=>new G2t);function K2t(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("unable to locate global object")}const a0e=K2t(),o0e=a0e.crypto||a0e.msCrypto;function Y2t(e){switch(e){case"sha256":return kA.create();case"sha512":return cae.create()}bn(!1,"invalid hashing algorithm name","algorithm",e)}function X2t(e,t){const n={sha256:kA,sha512:cae}[e];return bn(n!=null,"invalid hmac algorithm","algorithm",e),MB.create(n,t)}function Q2t(e,t,n,r,s){const a={sha256:kA,sha512:cae}[s];return bn(a!=null,"invalid pbkdf2 algorithm","algorithm",s),oae(a,e,t,{c:n,dkLen:r})}function Z2t(e){Lr(o0e!=null,"platform does not support secure random numbers","UNSUPPORTED_OPERATION",{operation:"randomBytes"}),bn(Number.isInteger(e)&&e>0&&e<=1024,"invalid length","length",e);const t=new Uint8Array(e);return o0e.getRandomValues(t),t}let Uke=!1;const zke=function(e,t,n){return X2t(e,t).update(n).digest()};let Hke=zke;function TA(e,t,n){const r=hs(t,"key"),s=hs(n,"data");return Kr(Hke(e,r,s))}TA._=zke;TA.lock=function(){Uke=!0};TA.register=function(e){if(Uke)throw new Error("computeHmac is locked");Hke=e};Object.freeze(TA);const[Vke,Wke,qke]=[[],[],[]],J2t=BigInt(0),S7=BigInt(1),evt=BigInt(2),tvt=BigInt(7),nvt=BigInt(256),rvt=BigInt(113);for(let e=0,t=S7,n=1,r=0;e<24;e++){[n,r]=[r,(2*n+3*r)%5],Vke.push(2*(5*r+n)),Wke.push((e+1)*(e+2)/2%64);let s=J2t;for(let a=0;a<7;a++)t=(t<<S7^(t>>tvt)*rvt)%nvt,t&evt&&(s^=S7<<(S7<<BigInt(a))-S7);qke.push(s)}const[svt,ivt]=Rke(qke,!0),l0e=(e,t,n)=>n>32?Bke(e,t,n):Lke(e,t,n),c0e=(e,t,n)=>n>32?$ke(e,t,n):Dke(e,t,n);function avt(e,t=24){const n=new Uint32Array(10);for(let r=24-t;r<24;r++){for(let o=0;o<10;o++)n[o]=e[o]^e[o+10]^e[o+20]^e[o+30]^e[o+40];for(let o=0;o<10;o+=2){const l=(o+8)%10,c=(o+2)%10,u=n[c],d=n[c+1],f=l0e(u,d,1)^n[l],x=c0e(u,d,1)^n[l+1];for(let g=0;g<50;g+=10)e[o+g]^=f,e[o+g+1]^=x}let s=e[2],a=e[3];for(let o=0;o<24;o++){const l=Wke[o],c=l0e(s,a,l),u=c0e(s,a,l),d=Vke[o];s=e[d],a=e[d+1],e[d]=c,e[d+1]=u}for(let o=0;o<50;o+=10){for(let l=0;l<10;l++)n[l]=e[o+l];for(let l=0;l<10;l++)e[o+l]^=~n[(l+2)%10]&n[(l+4)%10]}e[0]^=svt[r],e[1]^=ivt[r]}n.fill(0)}let ovt=class Gke extends aae{constructor(t,n,r,s=!1,a=24){if(super(),this.blockLen=t,this.suffix=n,this.outputLen=r,this.enableXOF=s,this.rounds=a,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,Lf(r),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=KF(this.state)}keccak(){avt(this.state32,this.rounds),this.posOut=0,this.pos=0}update(t){RS(this);const{blockLen:n,state:r}=this;t=LS(t);const s=t.length;for(let a=0;a<s;){const o=Math.min(n-this.pos,s-a);for(let l=0;l<o;l++)r[this.pos++]^=t[a++];this.pos===n&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:t,suffix:n,pos:r,blockLen:s}=this;t[r]^=n,n&128&&r===s-1&&this.keccak(),t[s-1]^=128,this.keccak()}writeInto(t){RS(this,!1),iae(t),this.finish();const n=this.state,{blockLen:r}=this;for(let s=0,a=t.length;s<a;){this.posOut>=r&&this.keccak();const o=Math.min(r-this.posOut,a-s);t.set(n.subarray(this.posOut,this.posOut+o),s),this.posOut+=o,s+=o}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return Lf(t),this.xofInto(new Uint8Array(t))}digestInto(t){if(Ike(t,this),this.finished)throw new Error("digest() was already called");return this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(t){const{blockLen:n,suffix:r,outputLen:s,rounds:a,enableXOF:o}=this;return t||(t=new Gke(n,r,s,o,a)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=a,t.suffix=r,t.outputLen=s,t.enableXOF=o,t.destroyed=this.destroyed,t}};const lvt=(e,t,n)=>OB(()=>new ovt(t,e,n)),cvt=lvt(1,136,256/8);let Kke=!1;const Yke=function(e){return cvt(e)};let Xke=Yke;function lo(e){const t=hs(e,"data");return Kr(Xke(t))}lo._=Yke;lo.lock=function(){Kke=!0};lo.register=function(e){if(Kke)throw new TypeError("keccak256 is locked");Xke=e};Object.freeze(lo);const uvt=new Uint8Array([7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8]),Qke=Uint8Array.from({length:16},(e,t)=>t),dvt=Qke.map(e=>(9*e+5)%16);let uae=[Qke],dae=[dvt];for(let e=0;e<4;e++)for(let t of[uae,dae])t.push(t[e].map(n=>uvt[n]));const Zke=[[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8],[12,13,11,15,6,9,9,7,12,15,11,13,7,8,7,7],[13,15,14,11,7,7,6,8,13,14,13,12,5,5,6,9],[14,11,12,14,8,6,5,5,15,12,15,14,9,9,8,6],[15,12,13,13,9,5,8,6,14,11,12,11,8,6,5,5]].map(e=>new Uint8Array(e)),fvt=uae.map((e,t)=>e.map(n=>Zke[t][n])),hvt=dae.map((e,t)=>e.map(n=>Zke[t][n])),pvt=new Uint32Array([0,1518500249,1859775393,2400959708,2840853838]),mvt=new Uint32Array([1352829926,1548603684,1836072691,2053994217,0]),QI=(e,t)=>e<<t|e>>>32-t;function u0e(e,t,n,r){return e===0?t^n^r:e===1?t&n|~t&r:e===2?(t|~n)^r:e===3?t&r|n&~r:t^(n|~r)}const ZI=new Uint32Array(16);class xvt extends lae{constructor(){super(64,20,8,!0),this.h0=1732584193,this.h1=-271733879,this.h2=-1732584194,this.h3=271733878,this.h4=-1009589776}get(){const{h0:t,h1:n,h2:r,h3:s,h4:a}=this;return[t,n,r,s,a]}set(t,n,r,s,a){this.h0=t|0,this.h1=n|0,this.h2=r|0,this.h3=s|0,this.h4=a|0}process(t,n){for(let g=0;g<16;g++,n+=4)ZI[g]=t.getUint32(n,!0);let r=this.h0|0,s=r,a=this.h1|0,o=a,l=this.h2|0,c=l,u=this.h3|0,d=u,f=this.h4|0,x=f;for(let g=0;g<5;g++){const v=4-g,w=pvt[g],C=mvt[g],N=uae[g],P=dae[g],I=fvt[g],R=hvt[g];for(let F=0;F<16;F++){const U=QI(r+u0e(g,a,l,u)+ZI[N[F]]+w,I[F])+f|0;r=f,f=u,u=QI(l,10)|0,l=a,a=U}for(let F=0;F<16;F++){const U=QI(s+u0e(v,o,c,d)+ZI[P[F]]+C,R[F])+x|0;s=x,x=d,d=QI(c,10)|0,c=o,o=U}}this.set(this.h1+l+d|0,this.h2+u+x|0,this.h3+f+s|0,this.h4+r+o|0,this.h0+a+c|0)}roundClean(){ZI.fill(0)}destroy(){this.destroyed=!0,this.buffer.fill(0),this.set(0,0,0,0,0)}}const gvt=OB(()=>new xvt);let Jke=!1;const eTe=function(e){return gvt(e)};let tTe=eTe;function IA(e){const t=hs(e,"data");return Kr(tTe(t))}IA._=eTe;IA.lock=function(){Jke=!0};IA.register=function(e){if(Jke)throw new TypeError("ripemd160 is locked");tTe=e};Object.freeze(IA);let nTe=!1;const rTe=function(e,t,n,r,s){return Q2t(e,t,n,r,s)};let sTe=rTe;function a2(e,t,n,r,s){const a=hs(e,"password"),o=hs(t,"salt");return Kr(sTe(a,o,n,r,s))}a2._=rTe;a2.lock=function(){nTe=!0};a2.register=function(e){if(nTe)throw new Error("pbkdf2 is locked");sTe=e};Object.freeze(a2);let iTe=!1;const aTe=function(e){return new Uint8Array(Z2t(e))};let oTe=aTe;function Wg(e){return oTe(e)}Wg._=aTe;Wg.lock=function(){iTe=!0};Wg.register=function(e){if(iTe)throw new Error("randomBytes is locked");oTe=e};Object.freeze(Wg);const fa=(e,t)=>e<<t|e>>>32-t;function d0e(e,t,n,r,s,a){let o=e[t++]^n[r++],l=e[t++]^n[r++],c=e[t++]^n[r++],u=e[t++]^n[r++],d=e[t++]^n[r++],f=e[t++]^n[r++],x=e[t++]^n[r++],g=e[t++]^n[r++],v=e[t++]^n[r++],w=e[t++]^n[r++],C=e[t++]^n[r++],N=e[t++]^n[r++],P=e[t++]^n[r++],I=e[t++]^n[r++],R=e[t++]^n[r++],F=e[t++]^n[r++],U=o,L=l,z=c,Q=u,ne=d,J=f,X=x,re=g,pe=v,Y=w,ie=C,oe=N,G=P,V=I,ee=R,ae=F;for(let fe=0;fe<8;fe+=2)ne^=fa(U+G|0,7),pe^=fa(ne+U|0,9),G^=fa(pe+ne|0,13),U^=fa(G+pe|0,18),Y^=fa(J+L|0,7),V^=fa(Y+J|0,9),L^=fa(V+Y|0,13),J^=fa(L+V|0,18),ee^=fa(ie+X|0,7),z^=fa(ee+ie|0,9),X^=fa(z+ee|0,13),ie^=fa(X+z|0,18),Q^=fa(ae+oe|0,7),re^=fa(Q+ae|0,9),oe^=fa(re+Q|0,13),ae^=fa(oe+re|0,18),L^=fa(U+Q|0,7),z^=fa(L+U|0,9),Q^=fa(z+L|0,13),U^=fa(Q+z|0,18),X^=fa(J+ne|0,7),re^=fa(X+J|0,9),ne^=fa(re+X|0,13),J^=fa(ne+re|0,18),oe^=fa(ie+Y|0,7),pe^=fa(oe+ie|0,9),Y^=fa(pe+oe|0,13),ie^=fa(Y+pe|0,18),G^=fa(ae+ee|0,7),V^=fa(G+ae|0,9),ee^=fa(V+G|0,13),ae^=fa(ee+V|0,18);s[a++]=o+U|0,s[a++]=l+L|0,s[a++]=c+z|0,s[a++]=u+Q|0,s[a++]=d+ne|0,s[a++]=f+J|0,s[a++]=x+X|0,s[a++]=g+re|0,s[a++]=v+pe|0,s[a++]=w+Y|0,s[a++]=C+ie|0,s[a++]=N+oe|0,s[a++]=P+G|0,s[a++]=I+V|0,s[a++]=R+ee|0,s[a++]=F+ae|0}function r4(e,t,n,r,s){let a=r+0,o=r+16*s;for(let l=0;l<16;l++)n[o+l]=e[t+(2*s-1)*16+l];for(let l=0;l<s;l++,a+=16,t+=16)d0e(n,o,e,t,n,a),l>0&&(o+=16),d0e(n,a,e,t+=16,n,o)}function lTe(e,t,n){const r=Fke({dkLen:32,asyncTick:10,maxmem:1073742848},n),{N:s,r:a,p:o,dkLen:l,asyncTick:c,maxmem:u,onProgress:d}=r;if(Lf(s),Lf(a),Lf(o),Lf(l),Lf(c),Lf(u),d!==void 0&&typeof d!="function")throw new Error("progressCb should be function");const f=128*a,x=f/4;if(s<=1||s&s-1||s>=2**(f/8)||s>2**32)throw new Error("Scrypt: N must be larger than 1, a power of 2, less than 2^(128 * r / 8) and less than 2^32");if(o<0||o>(2**32-1)*32/f)throw new Error("Scrypt: p must be a positive integer less than or equal to ((2^32 - 1) * 32) / (128 * r)");if(l<0||l>(2**32-1)*32)throw new Error("Scrypt: dkLen should be positive integer less than or equal to (2^32 - 1) * 32");const g=f*(s+o);if(g>u)throw new Error(`Scrypt: parameters too large, ${g} (128 * r * (N + p)) > ${u} (maxmem)`);const v=oae(kA,e,t,{c:1,dkLen:f*o}),w=KF(v),C=KF(new Uint8Array(f*s)),N=KF(new Uint8Array(f));let P=()=>{};if(d){const I=2*s*o,R=Math.max(Math.floor(I/1e4),1);let F=0;P=()=>{F++,d&&(!(F%R)||F===I)&&d(F/I)}}return{N:s,r:a,p:o,dkLen:l,blockSize32:x,V:C,B32:w,B:v,tmp:N,blockMixCb:P,asyncTick:c}}function cTe(e,t,n,r,s){const a=oae(kA,e,n,{c:1,dkLen:t});return n.fill(0),r.fill(0),s.fill(0),a}function bvt(e,t,n){const{N:r,r:s,p:a,dkLen:o,blockSize32:l,V:c,B32:u,B:d,tmp:f,blockMixCb:x}=lTe(e,t,n);for(let g=0;g<a;g++){const v=l*g;for(let w=0;w<l;w++)c[w]=u[v+w];for(let w=0,C=0;w<r-1;w++)r4(c,C,c,C+=l,s),x();r4(c,(r-1)*l,u,v,s),x();for(let w=0;w<r;w++){const C=u[v+l-16]%r;for(let N=0;N<l;N++)f[N]=u[v+N]^c[C*l+N];r4(f,0,u,v,s),x()}}return cTe(e,o,d,c,f)}async function yvt(e,t,n){const{N:r,r:s,p:a,dkLen:o,blockSize32:l,V:c,B32:u,B:d,tmp:f,blockMixCb:x,asyncTick:g}=lTe(e,t,n);for(let v=0;v<a;v++){const w=l*v;for(let N=0;N<l;N++)c[N]=u[w+N];let C=0;await i0e(r-1,g,()=>{r4(c,C,c,C+=l,s),x()}),r4(c,(r-1)*l,u,w,s),x(),await i0e(r,g,()=>{const N=u[w+l-16]%r;for(let P=0;P<l;P++)f[P]=u[w+P]^c[N*l+P];r4(f,0,u,w,s),x()})}return cTe(e,o,d,c,f)}let uTe=!1,dTe=!1;const fTe=async function(e,t,n,r,s,a,o){return await yvt(e,t,{N:n,r,p:s,dkLen:a,onProgress:o})},hTe=function(e,t,n,r,s,a){return bvt(e,t,{N:n,r,p:s,dkLen:a})};let pTe=fTe,mTe=hTe;async function PA(e,t,n,r,s,a,o){const l=hs(e,"passwd"),c=hs(t,"salt");return Kr(await pTe(l,c,n,r,s,a,o))}PA._=fTe;PA.lock=function(){dTe=!0};PA.register=function(e){if(dTe)throw new Error("scrypt is locked");pTe=e};Object.freeze(PA);function FA(e,t,n,r,s,a){const o=hs(e,"passwd"),l=hs(t,"salt");return Kr(mTe(o,l,n,r,s,a))}FA._=hTe;FA.lock=function(){uTe=!0};FA.register=function(e){if(uTe)throw new Error("scryptSync is locked");mTe=e};Object.freeze(FA);const xTe=function(e){return Y2t("sha256").update(e).digest()};let gTe=xTe,bTe=!1;function op(e){const t=hs(e,"data");return Kr(gTe(t))}op._=xTe;op.lock=function(){bTe=!0};op.register=function(e){if(bTe)throw new Error("sha256 is locked");gTe=e};Object.freeze(op);Object.freeze(op);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const yTe=BigInt(0),RB=BigInt(1),vvt=BigInt(2),LB=e=>e instanceof Uint8Array,wvt=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function DS(e){if(!LB(e))throw new Error("Uint8Array expected");let t="";for(let n=0;n<e.length;n++)t+=wvt[e[n]];return t}function vTe(e){const t=e.toString(16);return t.length&1?`0${t}`:t}function fae(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);return BigInt(e===""?"0":`0x${e}`)}function BS(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);const t=e.length;if(t%2)throw new Error("padded hex string expected, got unpadded hex of length "+t);const n=new Uint8Array(t/2);for(let r=0;r<n.length;r++){const s=r*2,a=e.slice(s,s+2),o=Number.parseInt(a,16);if(Number.isNaN(o)||o<0)throw new Error("Invalid byte sequence");n[r]=o}return n}function Yw(e){return fae(DS(e))}function hae(e){if(!LB(e))throw new Error("Uint8Array expected");return fae(DS(Uint8Array.from(e).reverse()))}function $S(e,t){return BS(e.toString(16).padStart(t*2,"0"))}function pae(e,t){return $S(e,t).reverse()}function Cvt(e){return BS(vTe(e))}function Bp(e,t,n){let r;if(typeof t=="string")try{r=BS(t)}catch(a){throw new Error(`${e} must be valid hex string, got "${t}". Cause: ${a}`)}else if(LB(t))r=Uint8Array.from(t);else throw new Error(`${e} must be hex string or Uint8Array`);const s=r.length;if(typeof n=="number"&&s!==n)throw new Error(`${e} expected ${n} bytes, got ${s}`);return r}function lE(...e){const t=new Uint8Array(e.reduce((r,s)=>r+s.length,0));let n=0;return e.forEach(r=>{if(!LB(r))throw new Error("Uint8Array expected");t.set(r,n),n+=r.length}),t}function Svt(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function Nvt(e){if(typeof e!="string")throw new Error(`utf8ToBytes expected string, got ${typeof e}`);return new Uint8Array(new TextEncoder().encode(e))}function Avt(e){let t;for(t=0;e>yTe;e>>=RB,t+=1);return t}function jvt(e,t){return e>>BigInt(t)&RB}const Evt=(e,t,n)=>e|(n?RB:yTe)<<BigInt(t),mae=e=>(vvt<<BigInt(e-1))-RB,OH=e=>new Uint8Array(e),f0e=e=>Uint8Array.from(e);function wTe(e,t,n){if(typeof e!="number"||e<2)throw new Error("hashLen must be a number");if(typeof t!="number"||t<2)throw new Error("qByteLen must be a number");if(typeof n!="function")throw new Error("hmacFn must be a function");let r=OH(e),s=OH(e),a=0;const o=()=>{r.fill(1),s.fill(0),a=0},l=(...f)=>n(s,r,...f),c=(f=OH())=>{s=l(f0e([0]),f),r=l(),f.length!==0&&(s=l(f0e([1]),f),r=l())},u=()=>{if(a++>=1e3)throw new Error("drbg: tried 1000 values");let f=0;const x=[];for(;f<t;){r=l();const g=r.slice();x.push(g),f+=r.length}return lE(...x)};return(f,x)=>{o(),c(f);let g;for(;!(g=x(u()));)c();return o(),g}}const _vt={bigint:e=>typeof e=="bigint",function:e=>typeof e=="function",boolean:e=>typeof e=="boolean",string:e=>typeof e=="string",stringOrUint8Array:e=>typeof e=="string"||e instanceof Uint8Array,isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,t)=>t.Fp.isValid(e),hash:e=>typeof e=="function"&&Number.isSafeInteger(e.outputLen)};function $k(e,t,n={}){const r=(s,a,o)=>{const l=_vt[a];if(typeof l!="function")throw new Error(`Invalid validator "${a}", expected function`);const c=e[s];if(!(o&&c===void 0)&&!l(c,e))throw new Error(`Invalid param ${String(s)}=${c} (${typeof c}), expected ${a}`)};for(const[s,a]of Object.entries(t))r(s,a,!1);for(const[s,a]of Object.entries(n))r(s,a,!0);return e}const kvt=Object.freeze(Object.defineProperty({__proto__:null,bitGet:jvt,bitLen:Avt,bitMask:mae,bitSet:Evt,bytesToHex:DS,bytesToNumberBE:Yw,bytesToNumberLE:hae,concatBytes:lE,createHmacDrbg:wTe,ensureBytes:Bp,equalBytes:Svt,hexToBytes:BS,hexToNumber:fae,numberToBytesBE:$S,numberToBytesLE:pae,numberToHexUnpadded:vTe,numberToVarBytesBE:Cvt,utf8ToBytes:Nvt,validateObject:$k},Symbol.toStringTag,{value:"Module"}));/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const _c=BigInt(0),yl=BigInt(1),Rv=BigInt(2),Tvt=BigInt(3),EJ=BigInt(4),h0e=BigInt(5),p0e=BigInt(8);BigInt(9);BigInt(16);function zd(e,t){const n=e%t;return n>=_c?n:t+n}function Ivt(e,t,n){if(n<=_c||t<_c)throw new Error("Expected power/modulo > 0");if(n===yl)return _c;let r=yl;for(;t>_c;)t&yl&&(r=r*e%n),e=e*e%n,t>>=yl;return r}function xh(e,t,n){let r=e;for(;t-- >_c;)r*=r,r%=n;return r}function _J(e,t){if(e===_c||t<=_c)throw new Error(`invert: expected positive integers, got n=${e} mod=${t}`);let n=zd(e,t),r=t,s=_c,a=yl;for(;n!==_c;){const l=r/n,c=r%n,u=s-a*l;r=n,n=c,s=a,a=u}if(r!==yl)throw new Error("invert: does not exist");return zd(s,t)}function Pvt(e){const t=(e-yl)/Rv;let n,r,s;for(n=e-yl,r=0;n%Rv===_c;n/=Rv,r++);for(s=Rv;s<e&&Ivt(s,t,e)!==e-yl;s++);if(r===1){const o=(e+yl)/EJ;return function(c,u){const d=c.pow(u,o);if(!c.eql(c.sqr(d),u))throw new Error("Cannot find square root");return d}}const a=(n+yl)/Rv;return function(l,c){if(l.pow(c,t)===l.neg(l.ONE))throw new Error("Cannot find square root");let u=r,d=l.pow(l.mul(l.ONE,s),n),f=l.pow(c,a),x=l.pow(c,n);for(;!l.eql(x,l.ONE);){if(l.eql(x,l.ZERO))return l.ZERO;let g=1;for(let w=l.sqr(x);g<u&&!l.eql(w,l.ONE);g++)w=l.sqr(w);const v=l.pow(d,yl<<BigInt(u-g-1));d=l.sqr(v),f=l.mul(f,v),x=l.mul(x,d),u=g}return f}}function Fvt(e){if(e%EJ===Tvt){const t=(e+yl)/EJ;return function(r,s){const a=r.pow(s,t);if(!r.eql(r.sqr(a),s))throw new Error("Cannot find square root");return a}}if(e%p0e===h0e){const t=(e-h0e)/p0e;return function(r,s){const a=r.mul(s,Rv),o=r.pow(a,t),l=r.mul(s,o),c=r.mul(r.mul(l,Rv),o),u=r.mul(l,r.sub(c,r.ONE));if(!r.eql(r.sqr(u),s))throw new Error("Cannot find square root");return u}}return Pvt(e)}const Ovt=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function Mvt(e){const t={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},n=Ovt.reduce((r,s)=>(r[s]="function",r),t);return $k(e,n)}function Rvt(e,t,n){if(n<_c)throw new Error("Expected power > 0");if(n===_c)return e.ONE;if(n===yl)return t;let r=e.ONE,s=t;for(;n>_c;)n&yl&&(r=e.mul(r,s)),s=e.sqr(s),n>>=yl;return r}function Lvt(e,t){const n=new Array(t.length),r=t.reduce((a,o,l)=>e.is0(o)?a:(n[l]=a,e.mul(a,o)),e.ONE),s=e.inv(r);return t.reduceRight((a,o,l)=>e.is0(o)?a:(n[l]=e.mul(a,n[l]),e.mul(a,o)),s),n}function CTe(e,t){const n=t!==void 0?t:e.toString(2).length,r=Math.ceil(n/8);return{nBitLength:n,nByteLength:r}}function Dvt(e,t,n=!1,r={}){if(e<=_c)throw new Error(`Expected Field ORDER > 0, got ${e}`);const{nBitLength:s,nByteLength:a}=CTe(e,t);if(a>2048)throw new Error("Field lengths over 2048 bytes are not supported");const o=Fvt(e),l=Object.freeze({ORDER:e,BITS:s,BYTES:a,MASK:mae(s),ZERO:_c,ONE:yl,create:c=>zd(c,e),isValid:c=>{if(typeof c!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof c}`);return _c<=c&&c<e},is0:c=>c===_c,isOdd:c=>(c&yl)===yl,neg:c=>zd(-c,e),eql:(c,u)=>c===u,sqr:c=>zd(c*c,e),add:(c,u)=>zd(c+u,e),sub:(c,u)=>zd(c-u,e),mul:(c,u)=>zd(c*u,e),pow:(c,u)=>Rvt(l,c,u),div:(c,u)=>zd(c*_J(u,e),e),sqrN:c=>c*c,addN:(c,u)=>c+u,subN:(c,u)=>c-u,mulN:(c,u)=>c*u,inv:c=>_J(c,e),sqrt:r.sqrt||(c=>o(l,c)),invertBatch:c=>Lvt(l,c),cmov:(c,u,d)=>d?u:c,toBytes:c=>n?pae(c,a):$S(c,a),fromBytes:c=>{if(c.length!==a)throw new Error(`Fp.fromBytes: expected ${a}, got ${c.length}`);return n?hae(c):Yw(c)}});return Object.freeze(l)}function STe(e){if(typeof e!="bigint")throw new Error("field order must be bigint");const t=e.toString(2).length;return Math.ceil(t/8)}function NTe(e){const t=STe(e);return t+Math.ceil(t/2)}function Bvt(e,t,n=!1){const r=e.length,s=STe(t),a=NTe(t);if(r<16||r<a||r>1024)throw new Error(`expected ${a}-1024 bytes of input, got ${r}`);const o=n?Yw(e):hae(e),l=zd(o,t-yl)+yl;return n?pae(l,s):$S(l,s)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const $vt=BigInt(0),MH=BigInt(1);function Uvt(e,t){const n=(s,a)=>{const o=a.negate();return s?o:a},r=s=>{const a=Math.ceil(t/s)+1,o=2**(s-1);return{windows:a,windowSize:o}};return{constTimeNegate:n,unsafeLadder(s,a){let o=e.ZERO,l=s;for(;a>$vt;)a&MH&&(o=o.add(l)),l=l.double(),a>>=MH;return o},precomputeWindow(s,a){const{windows:o,windowSize:l}=r(a),c=[];let u=s,d=u;for(let f=0;f<o;f++){d=u,c.push(d);for(let x=1;x<l;x++)d=d.add(u),c.push(d);u=d.double()}return c},wNAF(s,a,o){const{windows:l,windowSize:c}=r(s);let u=e.ZERO,d=e.BASE;const f=BigInt(2**s-1),x=2**s,g=BigInt(s);for(let v=0;v<l;v++){const w=v*c;let C=Number(o&f);o>>=g,C>c&&(C-=x,o+=MH);const N=w,P=w+Math.abs(C)-1,I=v%2!==0,R=C<0;C===0?d=d.add(n(I,a[N])):u=u.add(n(R,a[P]))}return{p:u,f:d}},wNAFCached(s,a,o,l){const c=s._WINDOW_SIZE||1;let u=a.get(s);return u||(u=this.precomputeWindow(s,c),c!==1&&a.set(s,l(u))),this.wNAF(c,u,o)}}}function ATe(e){return Mvt(e.Fp),$k(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...CTe(e.n,e.nBitLength),...e,p:e.Fp.ORDER})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function zvt(e){const t=ATe(e);$k(t,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:n,Fp:r,a:s}=t;if(n){if(!r.eql(s,r.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if(typeof n!="object"||typeof n.beta!="bigint"||typeof n.splitScalar!="function")throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...t})}const{bytesToNumberBE:Hvt,hexToBytes:Vvt}=kvt,Gv={Err:class extends Error{constructor(t=""){super(t)}},_parseInt(e){const{Err:t}=Gv;if(e.length<2||e[0]!==2)throw new t("Invalid signature integer tag");const n=e[1],r=e.subarray(2,n+2);if(!n||r.length!==n)throw new t("Invalid signature integer: wrong length");if(r[0]&128)throw new t("Invalid signature integer: negative");if(r[0]===0&&!(r[1]&128))throw new t("Invalid signature integer: unnecessary leading zero");return{d:Hvt(r),l:e.subarray(n+2)}},toSig(e){const{Err:t}=Gv,n=typeof e=="string"?Vvt(e):e;if(!(n instanceof Uint8Array))throw new Error("ui8a expected");let r=n.length;if(r<2||n[0]!=48)throw new t("Invalid signature tag");if(n[1]!==r-2)throw new t("Invalid signature: incorrect length");const{d:s,l:a}=Gv._parseInt(n.subarray(2)),{d:o,l}=Gv._parseInt(a);if(l.length)throw new t("Invalid signature: left bytes after parsing");return{r:s,s:o}},hexFromSig(e){const t=u=>Number.parseInt(u[0],16)&8?"00"+u:u,n=u=>{const d=u.toString(16);return d.length&1?`0${d}`:d},r=t(n(e.s)),s=t(n(e.r)),a=r.length/2,o=s.length/2,l=n(a),c=n(o);return`30${n(o+a+4)}02${c}${s}02${l}${r}`}},kg=BigInt(0),zh=BigInt(1);BigInt(2);const m0e=BigInt(3);BigInt(4);function Wvt(e){const t=zvt(e),{Fp:n}=t,r=t.toBytes||((v,w,C)=>{const N=w.toAffine();return lE(Uint8Array.from([4]),n.toBytes(N.x),n.toBytes(N.y))}),s=t.fromBytes||(v=>{const w=v.subarray(1),C=n.fromBytes(w.subarray(0,n.BYTES)),N=n.fromBytes(w.subarray(n.BYTES,2*n.BYTES));return{x:C,y:N}});function a(v){const{a:w,b:C}=t,N=n.sqr(v),P=n.mul(N,v);return n.add(n.add(P,n.mul(v,w)),C)}if(!n.eql(n.sqr(t.Gy),a(t.Gx)))throw new Error("bad generator point: equation left != right");function o(v){return typeof v=="bigint"&&kg<v&&v<t.n}function l(v){if(!o(v))throw new Error("Expected valid bigint: 0 < bigint < curve.n")}function c(v){const{allowedPrivateKeyLengths:w,nByteLength:C,wrapPrivateKey:N,n:P}=t;if(w&&typeof v!="bigint"){if(v instanceof Uint8Array&&(v=DS(v)),typeof v!="string"||!w.includes(v.length))throw new Error("Invalid key");v=v.padStart(C*2,"0")}let I;try{I=typeof v=="bigint"?v:Yw(Bp("private key",v,C))}catch{throw new Error(`private key must be ${C} bytes, hex or bigint, not ${typeof v}`)}return N&&(I=zd(I,P)),l(I),I}const u=new Map;function d(v){if(!(v instanceof f))throw new Error("ProjectivePoint expected")}class f{constructor(w,C,N){if(this.px=w,this.py=C,this.pz=N,w==null||!n.isValid(w))throw new Error("x required");if(C==null||!n.isValid(C))throw new Error("y required");if(N==null||!n.isValid(N))throw new Error("z required")}static fromAffine(w){const{x:C,y:N}=w||{};if(!w||!n.isValid(C)||!n.isValid(N))throw new Error("invalid affine point");if(w instanceof f)throw new Error("projective point not allowed");const P=I=>n.eql(I,n.ZERO);return P(C)&&P(N)?f.ZERO:new f(C,N,n.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(w){const C=n.invertBatch(w.map(N=>N.pz));return w.map((N,P)=>N.toAffine(C[P])).map(f.fromAffine)}static fromHex(w){const C=f.fromAffine(s(Bp("pointHex",w)));return C.assertValidity(),C}static fromPrivateKey(w){return f.BASE.multiply(c(w))}_setWindowSize(w){this._WINDOW_SIZE=w,u.delete(this)}assertValidity(){if(this.is0()){if(t.allowInfinityPoint&&!n.is0(this.py))return;throw new Error("bad point: ZERO")}const{x:w,y:C}=this.toAffine();if(!n.isValid(w)||!n.isValid(C))throw new Error("bad point: x or y not FE");const N=n.sqr(C),P=a(w);if(!n.eql(N,P))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){const{y:w}=this.toAffine();if(n.isOdd)return!n.isOdd(w);throw new Error("Field doesn't support isOdd")}equals(w){d(w);const{px:C,py:N,pz:P}=this,{px:I,py:R,pz:F}=w,U=n.eql(n.mul(C,F),n.mul(I,P)),L=n.eql(n.mul(N,F),n.mul(R,P));return U&&L}negate(){return new f(this.px,n.neg(this.py),this.pz)}double(){const{a:w,b:C}=t,N=n.mul(C,m0e),{px:P,py:I,pz:R}=this;let F=n.ZERO,U=n.ZERO,L=n.ZERO,z=n.mul(P,P),Q=n.mul(I,I),ne=n.mul(R,R),J=n.mul(P,I);return J=n.add(J,J),L=n.mul(P,R),L=n.add(L,L),F=n.mul(w,L),U=n.mul(N,ne),U=n.add(F,U),F=n.sub(Q,U),U=n.add(Q,U),U=n.mul(F,U),F=n.mul(J,F),L=n.mul(N,L),ne=n.mul(w,ne),J=n.sub(z,ne),J=n.mul(w,J),J=n.add(J,L),L=n.add(z,z),z=n.add(L,z),z=n.add(z,ne),z=n.mul(z,J),U=n.add(U,z),ne=n.mul(I,R),ne=n.add(ne,ne),z=n.mul(ne,J),F=n.sub(F,z),L=n.mul(ne,Q),L=n.add(L,L),L=n.add(L,L),new f(F,U,L)}add(w){d(w);const{px:C,py:N,pz:P}=this,{px:I,py:R,pz:F}=w;let U=n.ZERO,L=n.ZERO,z=n.ZERO;const Q=t.a,ne=n.mul(t.b,m0e);let J=n.mul(C,I),X=n.mul(N,R),re=n.mul(P,F),pe=n.add(C,N),Y=n.add(I,R);pe=n.mul(pe,Y),Y=n.add(J,X),pe=n.sub(pe,Y),Y=n.add(C,P);let ie=n.add(I,F);return Y=n.mul(Y,ie),ie=n.add(J,re),Y=n.sub(Y,ie),ie=n.add(N,P),U=n.add(R,F),ie=n.mul(ie,U),U=n.add(X,re),ie=n.sub(ie,U),z=n.mul(Q,Y),U=n.mul(ne,re),z=n.add(U,z),U=n.sub(X,z),z=n.add(X,z),L=n.mul(U,z),X=n.add(J,J),X=n.add(X,J),re=n.mul(Q,re),Y=n.mul(ne,Y),X=n.add(X,re),re=n.sub(J,re),re=n.mul(Q,re),Y=n.add(Y,re),J=n.mul(X,Y),L=n.add(L,J),J=n.mul(ie,Y),U=n.mul(pe,U),U=n.sub(U,J),J=n.mul(pe,X),z=n.mul(ie,z),z=n.add(z,J),new f(U,L,z)}subtract(w){return this.add(w.negate())}is0(){return this.equals(f.ZERO)}wNAF(w){return g.wNAFCached(this,u,w,C=>{const N=n.invertBatch(C.map(P=>P.pz));return C.map((P,I)=>P.toAffine(N[I])).map(f.fromAffine)})}multiplyUnsafe(w){const C=f.ZERO;if(w===kg)return C;if(l(w),w===zh)return this;const{endo:N}=t;if(!N)return g.unsafeLadder(this,w);let{k1neg:P,k1:I,k2neg:R,k2:F}=N.splitScalar(w),U=C,L=C,z=this;for(;I>kg||F>kg;)I&zh&&(U=U.add(z)),F&zh&&(L=L.add(z)),z=z.double(),I>>=zh,F>>=zh;return P&&(U=U.negate()),R&&(L=L.negate()),L=new f(n.mul(L.px,N.beta),L.py,L.pz),U.add(L)}multiply(w){l(w);let C=w,N,P;const{endo:I}=t;if(I){const{k1neg:R,k1:F,k2neg:U,k2:L}=I.splitScalar(C);let{p:z,f:Q}=this.wNAF(F),{p:ne,f:J}=this.wNAF(L);z=g.constTimeNegate(R,z),ne=g.constTimeNegate(U,ne),ne=new f(n.mul(ne.px,I.beta),ne.py,ne.pz),N=z.add(ne),P=Q.add(J)}else{const{p:R,f:F}=this.wNAF(C);N=R,P=F}return f.normalizeZ([N,P])[0]}multiplyAndAddUnsafe(w,C,N){const P=f.BASE,I=(F,U)=>U===kg||U===zh||!F.equals(P)?F.multiplyUnsafe(U):F.multiply(U),R=I(this,C).add(I(w,N));return R.is0()?void 0:R}toAffine(w){const{px:C,py:N,pz:P}=this,I=this.is0();w==null&&(w=I?n.ONE:n.inv(P));const R=n.mul(C,w),F=n.mul(N,w),U=n.mul(P,w);if(I)return{x:n.ZERO,y:n.ZERO};if(!n.eql(U,n.ONE))throw new Error("invZ was invalid");return{x:R,y:F}}isTorsionFree(){const{h:w,isTorsionFree:C}=t;if(w===zh)return!0;if(C)return C(f,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:w,clearCofactor:C}=t;return w===zh?this:C?C(f,this):this.multiplyUnsafe(t.h)}toRawBytes(w=!0){return this.assertValidity(),r(f,this,w)}toHex(w=!0){return DS(this.toRawBytes(w))}}f.BASE=new f(t.Gx,t.Gy,n.ONE),f.ZERO=new f(n.ZERO,n.ONE,n.ZERO);const x=t.nBitLength,g=Uvt(f,t.endo?Math.ceil(x/2):x);return{CURVE:t,ProjectivePoint:f,normPrivateKeyToScalar:c,weierstrassEquation:a,isWithinCurveOrder:o}}function qvt(e){const t=ATe(e);return $k(t,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...t})}function Gvt(e){const t=qvt(e),{Fp:n,n:r}=t,s=n.BYTES+1,a=2*n.BYTES+1;function o(Y){return kg<Y&&Y<n.ORDER}function l(Y){return zd(Y,r)}function c(Y){return _J(Y,r)}const{ProjectivePoint:u,normPrivateKeyToScalar:d,weierstrassEquation:f,isWithinCurveOrder:x}=Wvt({...t,toBytes(Y,ie,oe){const G=ie.toAffine(),V=n.toBytes(G.x),ee=lE;return oe?ee(Uint8Array.from([ie.hasEvenY()?2:3]),V):ee(Uint8Array.from([4]),V,n.toBytes(G.y))},fromBytes(Y){const ie=Y.length,oe=Y[0],G=Y.subarray(1);if(ie===s&&(oe===2||oe===3)){const V=Yw(G);if(!o(V))throw new Error("Point is not on curve");const ee=f(V);let ae=n.sqrt(ee);const fe=(ae&zh)===zh;return(oe&1)===1!==fe&&(ae=n.neg(ae)),{x:V,y:ae}}else if(ie===a&&oe===4){const V=n.fromBytes(G.subarray(0,n.BYTES)),ee=n.fromBytes(G.subarray(n.BYTES,2*n.BYTES));return{x:V,y:ee}}else throw new Error(`Point of length ${ie} was invalid. Expected ${s} compressed bytes or ${a} uncompressed bytes`)}}),g=Y=>DS($S(Y,t.nByteLength));function v(Y){const ie=r>>zh;return Y>ie}function w(Y){return v(Y)?l(-Y):Y}const C=(Y,ie,oe)=>Yw(Y.slice(ie,oe));class N{constructor(ie,oe,G){this.r=ie,this.s=oe,this.recovery=G,this.assertValidity()}static fromCompact(ie){const oe=t.nByteLength;return ie=Bp("compactSignature",ie,oe*2),new N(C(ie,0,oe),C(ie,oe,2*oe))}static fromDER(ie){const{r:oe,s:G}=Gv.toSig(Bp("DER",ie));return new N(oe,G)}assertValidity(){if(!x(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!x(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(ie){return new N(this.r,this.s,ie)}recoverPublicKey(ie){const{r:oe,s:G,recovery:V}=this,ee=L(Bp("msgHash",ie));if(V==null||![0,1,2,3].includes(V))throw new Error("recovery id invalid");const ae=V===2||V===3?oe+t.n:oe;if(ae>=n.ORDER)throw new Error("recovery id 2 or 3 invalid");const fe=V&1?"03":"02",Ne=u.fromHex(fe+g(ae)),he=c(ae),ge=l(-ee*he),ye=l(G*he),ve=u.BASE.multiplyAndAddUnsafe(Ne,ge,ye);if(!ve)throw new Error("point at infinify");return ve.assertValidity(),ve}hasHighS(){return v(this.s)}normalizeS(){return this.hasHighS()?new N(this.r,l(-this.s),this.recovery):this}toDERRawBytes(){return BS(this.toDERHex())}toDERHex(){return Gv.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return BS(this.toCompactHex())}toCompactHex(){return g(this.r)+g(this.s)}}const P={isValidPrivateKey(Y){try{return d(Y),!0}catch{return!1}},normPrivateKeyToScalar:d,randomPrivateKey:()=>{const Y=NTe(t.n);return Bvt(t.randomBytes(Y),t.n)},precompute(Y=8,ie=u.BASE){return ie._setWindowSize(Y),ie.multiply(BigInt(3)),ie}};function I(Y,ie=!0){return u.fromPrivateKey(Y).toRawBytes(ie)}function R(Y){const ie=Y instanceof Uint8Array,oe=typeof Y=="string",G=(ie||oe)&&Y.length;return ie?G===s||G===a:oe?G===2*s||G===2*a:Y instanceof u}function F(Y,ie,oe=!0){if(R(Y))throw new Error("first arg must be private key");if(!R(ie))throw new Error("second arg must be public key");return u.fromHex(ie).multiply(d(Y)).toRawBytes(oe)}const U=t.bits2int||function(Y){const ie=Yw(Y),oe=Y.length*8-t.nBitLength;return oe>0?ie>>BigInt(oe):ie},L=t.bits2int_modN||function(Y){return l(U(Y))},z=mae(t.nBitLength);function Q(Y){if(typeof Y!="bigint")throw new Error("bigint expected");if(!(kg<=Y&&Y<z))throw new Error(`bigint expected < 2^${t.nBitLength}`);return $S(Y,t.nByteLength)}function ne(Y,ie,oe=J){if(["recovered","canonical"].some(Ie=>Ie in oe))throw new Error("sign() legacy options not supported");const{hash:G,randomBytes:V}=t;let{lowS:ee,prehash:ae,extraEntropy:fe}=oe;ee==null&&(ee=!0),Y=Bp("msgHash",Y),ae&&(Y=Bp("prehashed msgHash",G(Y)));const Ne=L(Y),he=d(ie),ge=[Q(he),Q(Ne)];if(fe!=null){const Ie=fe===!0?V(n.BYTES):fe;ge.push(Bp("extraEntropy",Ie))}const ye=lE(...ge),ve=Ne;function je(Ie){const Le=U(Ie);if(!x(Le))return;const Qe=c(Le),$e=u.BASE.multiply(Le).toAffine(),it=l($e.x);if(it===kg)return;const tt=l(Qe*l(ve+it*he));if(tt===kg)return;let lt=($e.x===it?0:2)|Number($e.y&zh),ft=tt;return ee&&v(tt)&&(ft=w(tt),lt^=1),new N(it,ft,lt)}return{seed:ye,k2sig:je}}const J={lowS:t.lowS,prehash:!1},X={lowS:t.lowS,prehash:!1};function re(Y,ie,oe=J){const{seed:G,k2sig:V}=ne(Y,ie,oe),ee=t;return wTe(ee.hash.outputLen,ee.nByteLength,ee.hmac)(G,V)}u.BASE._setWindowSize(8);function pe(Y,ie,oe,G=X){var $e;const V=Y;if(ie=Bp("msgHash",ie),oe=Bp("publicKey",oe),"strict"in G)throw new Error("options.strict was renamed to lowS");const{lowS:ee,prehash:ae}=G;let fe,Ne;try{if(typeof V=="string"||V instanceof Uint8Array)try{fe=N.fromDER(V)}catch(it){if(!(it instanceof Gv.Err))throw it;fe=N.fromCompact(V)}else if(typeof V=="object"&&typeof V.r=="bigint"&&typeof V.s=="bigint"){const{r:it,s:tt}=V;fe=new N(it,tt)}else throw new Error("PARSE");Ne=u.fromHex(oe)}catch(it){if(it.message==="PARSE")throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(ee&&fe.hasHighS())return!1;ae&&(ie=t.hash(ie));const{r:he,s:ge}=fe,ye=L(ie),ve=c(ge),je=l(ye*ve),Ie=l(he*ve),Le=($e=u.BASE.multiplyAndAddUnsafe(Ne,je,Ie))==null?void 0:$e.toAffine();return Le?l(Le.x)===he:!1}return{CURVE:t,getPublicKey:I,getSharedSecret:F,sign:re,verify:pe,ProjectivePoint:u,Signature:N,utils:P}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function Kvt(e){return{hash:e,hmac:(t,...n)=>MB(e,t,y2t(...n)),randomBytes:w2t}}function Yvt(e,t){const n=r=>Gvt({...e,...Kvt(r)});return Object.freeze({...n(t),create:n})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const jTe=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),x0e=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),Xvt=BigInt(1),kJ=BigInt(2),g0e=(e,t)=>(e+t/kJ)/t;function Qvt(e){const t=jTe,n=BigInt(3),r=BigInt(6),s=BigInt(11),a=BigInt(22),o=BigInt(23),l=BigInt(44),c=BigInt(88),u=e*e*e%t,d=u*u*e%t,f=xh(d,n,t)*d%t,x=xh(f,n,t)*d%t,g=xh(x,kJ,t)*u%t,v=xh(g,s,t)*g%t,w=xh(v,a,t)*v%t,C=xh(w,l,t)*w%t,N=xh(C,c,t)*C%t,P=xh(N,l,t)*w%t,I=xh(P,n,t)*d%t,R=xh(I,o,t)*v%t,F=xh(R,r,t)*u%t,U=xh(F,kJ,t);if(!TJ.eql(TJ.sqr(U),e))throw new Error("Cannot find square root");return U}const TJ=Dvt(jTe,void 0,void 0,{sqrt:Qvt}),Ab=Yvt({a:BigInt(0),b:BigInt(7),Fp:TJ,n:x0e,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:e=>{const t=x0e,n=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),r=-Xvt*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),s=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),a=n,o=BigInt("0x100000000000000000000000000000000"),l=g0e(a*e,t),c=g0e(-r*e,t);let u=zd(e-l*n-c*s,t),d=zd(-l*r-c*a,t);const f=u>o,x=d>o;if(f&&(u=t-u),x&&(d=t-d),u>o||d>o)throw new Error("splitScalar: Endomorphism failed, k="+e);return{k1neg:f,k1:u,k2neg:x,k2:d}}}},kA);BigInt(0);Ab.ProjectivePoint;const cE="0x0000000000000000000000000000000000000000",b0e="0x0000000000000000000000000000000000000000000000000000000000000000",Zvt=`Ethereum Signed Message:
`,y0e=BigInt(0),v0e=BigInt(1),w0e=BigInt(2),C0e=BigInt(27),S0e=BigInt(28),JI=BigInt(35),B6={};function N0e(e){return a1(il(e),32)}var U4,l0,z4,_w;const Rp=class Rp{constructor(t,n,r,s){Rn(this,U4);Rn(this,l0);Rn(this,z4);Rn(this,_w);c5(t,B6,"Signature"),Wt(this,U4,n),Wt(this,l0,r),Wt(this,z4,s),Wt(this,_w,null)}get r(){return ze(this,U4)}set r(t){bn(n4(t)===32,"invalid r","value",t),Wt(this,U4,Kr(t))}get s(){return bn(parseInt(ze(this,l0).substring(0,3))<8,"non-canonical s; use ._s","s",ze(this,l0)),ze(this,l0)}set s(t){bn(n4(t)===32,"invalid s","value",t),Wt(this,l0,Kr(t))}get _s(){return ze(this,l0)}isValid(){return parseInt(ze(this,l0).substring(0,3))<8}get v(){return ze(this,z4)}set v(t){const n=Di(t,"value");bn(n===27||n===28,"invalid v","v",t),Wt(this,z4,n)}get networkV(){return ze(this,_w)}get legacyChainId(){const t=this.networkV;return t==null?null:Rp.getChainId(t)}get yParity(){return this.v===27?0:1}get yParityAndS(){const t=hs(this.s);return this.yParity&&(t[0]|=128),Kr(t)}get compactSerialized(){return Ra([this.r,this.yParityAndS])}get serialized(){return Ra([this.r,this.s,this.yParity?"0x1c":"0x1b"])}[Symbol.for("nodejs.util.inspect.custom")](){return`Signature { r: "${this.r}", s: "${this._s}"${this.isValid()?"":', valid: "false"'}, yParity: ${this.yParity}, networkV: ${this.networkV} }`}clone(){const t=new Rp(B6,this.r,this._s,this.v);return this.networkV&&Wt(t,_w,this.networkV),t}toJSON(){const t=this.networkV;return{_type:"signature",networkV:t!=null?t.toString():null,r:this.r,s:this._s,v:this.v}}static getChainId(t){const n=js(t,"v");return n==C0e||n==S0e?y0e:(bn(n>=JI,"invalid EIP-155 v","v",t),(n-JI)/w0e)}static getChainIdV(t,n){return js(t)*w0e+BigInt(35+n-27)}static getNormalizedV(t){const n=js(t);return n===y0e||n===C0e?27:n===v0e||n===S0e?28:(bn(n>=JI,"invalid v","v",t),n&v0e?27:28)}static from(t){function n(u,d){bn(u,d,"signature",t)}if(t==null)return new Rp(B6,b0e,b0e,27);if(typeof t=="string"){const u=hs(t,"signature");if(u.length===64){const d=Kr(u.slice(0,32)),f=u.slice(32,64),x=f[0]&128?28:27;return f[0]&=127,new Rp(B6,d,Kr(f),x)}if(u.length===65){const d=Kr(u.slice(0,32)),f=Kr(u.slice(32,64)),x=Rp.getNormalizedV(u[64]);return new Rp(B6,d,f,x)}n(!1,"invalid raw signature length")}if(t instanceof Rp)return t.clone();const r=t.r;n(r!=null,"missing r");const s=N0e(r),a=function(u,d){if(u!=null)return N0e(u);if(d!=null){n(co(d,32),"invalid yParityAndS");const f=hs(d);return f[0]&=127,Kr(f)}n(!1,"missing s")}(t.s,t.yParityAndS),{networkV:o,v:l}=function(u,d,f){if(u!=null){const x=js(u);return{networkV:x>=JI?x:void 0,v:Rp.getNormalizedV(x)}}if(d!=null)return n(co(d,32),"invalid yParityAndS"),{v:hs(d)[0]&128?28:27};if(f!=null){switch(Di(f,"sig.yParity")){case 0:return{v:27};case 1:return{v:28}}n(!1,"invalid yParity")}n(!1,"missing v")}(t.v,t.yParityAndS,t.yParity),c=new Rp(B6,s,a,l);return o&&Wt(c,_w,o),n(t.yParity==null||Di(t.yParity,"sig.yParity")===c.yParity,"yParity mismatch"),n(t.yParityAndS==null||t.yParityAndS===c.yParityAndS,"yParityAndS mismatch"),c}};U4=new WeakMap,l0=new WeakMap,z4=new WeakMap,_w=new WeakMap;let nu=Rp;var vg;const Dv=class Dv{constructor(t){Rn(this,vg);bn(n4(t)===32,"invalid private key","privateKey","[REDACTED]"),Wt(this,vg,Kr(t))}get privateKey(){return ze(this,vg)}get publicKey(){return Dv.computePublicKey(ze(this,vg))}get compressedPublicKey(){return Dv.computePublicKey(ze(this,vg),!0)}sign(t){bn(n4(t)===32,"invalid digest length","digest",t);const n=Ab.sign(Jc(t),Jc(ze(this,vg)),{lowS:!0});return nu.from({r:o1(n.r,32),s:o1(n.s,32),v:n.recovery?28:27})}computeSharedSecret(t){const n=Dv.computePublicKey(t);return Kr(Ab.getSharedSecret(Jc(ze(this,vg)),hs(n),!1))}static computePublicKey(t,n){let r=hs(t,"key");if(r.length===32){const a=Ab.getPublicKey(r,!!n);return Kr(a)}if(r.length===64){const a=new Uint8Array(65);a[0]=4,a.set(r,1),r=a}const s=Ab.ProjectivePoint.fromHex(r);return Kr(s.toRawBytes(n))}static recoverPublicKey(t,n){bn(n4(t)===32,"invalid digest length","digest",t);const r=nu.from(n);let s=Ab.Signature.fromCompact(Jc(Ra([r.r,r.s])));s=s.addRecoveryBit(r.yParity);const a=s.recoverPublicKey(Jc(t));return bn(a!=null,"invalid signature for digest","signature",n),"0x"+a.toHex(!1)}static addPoints(t,n,r){const s=Ab.ProjectivePoint.fromHex(Dv.computePublicKey(t).substring(2)),a=Ab.ProjectivePoint.fromHex(Dv.computePublicKey(n).substring(2));return"0x"+s.add(a).toHex(!!r)}};vg=new WeakMap;let L0=Dv;const Jvt=BigInt(0),ewt=BigInt(36);function A0e(e){e=e.toLowerCase();const t=e.substring(2).split(""),n=new Uint8Array(40);for(let s=0;s<40;s++)n[s]=t[s].charCodeAt(0);const r=hs(lo(n));for(let s=0;s<40;s+=2)r[s>>1]>>4>=8&&(t[s]=t[s].toUpperCase()),(r[s>>1]&15)>=8&&(t[s+1]=t[s+1].toUpperCase());return"0x"+t.join("")}const xae={};for(let e=0;e<10;e++)xae[String(e)]=String(e);for(let e=0;e<26;e++)xae[String.fromCharCode(65+e)]=String(10+e);const j0e=15;function twt(e){e=e.toUpperCase(),e=e.substring(4)+e.substring(0,2)+"00";let t=e.split("").map(r=>xae[r]).join("");for(;t.length>=j0e;){let r=t.substring(0,j0e);t=parseInt(r,10)%97+t.substring(r.length)}let n=String(98-parseInt(t,10)%97);for(;n.length<2;)n="0"+n;return n}const nwt=function(){const e={};for(let t=0;t<36;t++){const n="0123456789abcdefghijklmnopqrstuvwxyz"[t];e[n]=BigInt(t)}return e}();function rwt(e){e=e.toLowerCase();let t=Jvt;for(let n=0;n<e.length;n++)t=t*ewt+nwt[e[n]];return t}function na(e){if(bn(typeof e=="string","invalid address","address",e),e.match(/^(0x)?[0-9a-fA-F]{40}$/)){e.startsWith("0x")||(e="0x"+e);const t=A0e(e);return bn(!e.match(/([A-F].*[a-f])|([a-f].*[A-F])/)||t===e,"bad address checksum","address",e),t}if(e.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){bn(e.substring(2,4)===twt(e),"bad icap checksum","address",e);let t=rwt(e.substring(4)).toString(16);for(;t.length<40;)t="0"+t;return A0e("0x"+t)}bn(!1,"invalid address","address",e)}function swt(e){const t=na(e.from);let r=js(e.nonce,"tx.nonce").toString(16);return r==="0"?r="0x":r.length%2?r="0x0"+r:r="0x"+r,na(go(lo(l1([t,r])),12))}function ETe(e){return e&&typeof e.getAddress=="function"}async function RH(e,t){const n=await t;return(n==null||n==="0x0000000000000000000000000000000000000000")&&(Lr(typeof e!="string","unconfigured name","UNCONFIGURED_NAME",{value:e}),bn(!1,"invalid AddressLike value; did not resolve to a value address","target",e)),na(n)}function kc(e,t){if(typeof e=="string")return e.match(/^0x[0-9a-f]{40}$/i)?na(e):(Lr(t!=null,"ENS resolution requires a provider","UNSUPPORTED_OPERATION",{operation:"resolveName"}),RH(e,t.resolveName(e)));if(ETe(e))return RH(e,e.getAddress());if(e&&typeof e.then=="function")return RH(e,e);bn(!1,"unsupported addressable value","target",e)}const og={};function _s(e,t){let n=!1;return t<0&&(n=!0,t*=-1),new Mu(og,`${n?"":"u"}int${t}`,e,{signed:n,width:t})}function ha(e,t){return new Mu(og,`bytes${t||""}`,e,{size:t})}const E0e=Symbol.for("_ethers_typed");var kw;const cg=class cg{constructor(t,n,r,s){Un(this,"type");Un(this,"value");Rn(this,kw);Un(this,"_typedSymbol");s==null&&(s=null),c5(og,t,"Typed"),Ds(this,{_typedSymbol:E0e,type:n,value:r}),Wt(this,kw,s),this.format()}format(){if(this.type==="array")throw new Error("");if(this.type==="dynamicArray")throw new Error("");return this.type==="tuple"?`tuple(${this.value.map(t=>t.format()).join(",")})`:this.type}defaultValue(){return 0}minValue(){return 0}maxValue(){return 0}isBigInt(){return!!this.type.match(/^u?int[0-9]+$/)}isData(){return this.type.startsWith("bytes")}isString(){return this.type==="string"}get tupleName(){if(this.type!=="tuple")throw TypeError("not a tuple");return ze(this,kw)}get arrayLength(){if(this.type!=="array")throw TypeError("not an array");return ze(this,kw)===!0?-1:ze(this,kw)===!1?this.value.length:null}static from(t,n){return new cg(og,t,n)}static uint8(t){return _s(t,8)}static uint16(t){return _s(t,16)}static uint24(t){return _s(t,24)}static uint32(t){return _s(t,32)}static uint40(t){return _s(t,40)}static uint48(t){return _s(t,48)}static uint56(t){return _s(t,56)}static uint64(t){return _s(t,64)}static uint72(t){return _s(t,72)}static uint80(t){return _s(t,80)}static uint88(t){return _s(t,88)}static uint96(t){return _s(t,96)}static uint104(t){return _s(t,104)}static uint112(t){return _s(t,112)}static uint120(t){return _s(t,120)}static uint128(t){return _s(t,128)}static uint136(t){return _s(t,136)}static uint144(t){return _s(t,144)}static uint152(t){return _s(t,152)}static uint160(t){return _s(t,160)}static uint168(t){return _s(t,168)}static uint176(t){return _s(t,176)}static uint184(t){return _s(t,184)}static uint192(t){return _s(t,192)}static uint200(t){return _s(t,200)}static uint208(t){return _s(t,208)}static uint216(t){return _s(t,216)}static uint224(t){return _s(t,224)}static uint232(t){return _s(t,232)}static uint240(t){return _s(t,240)}static uint248(t){return _s(t,248)}static uint256(t){return _s(t,256)}static uint(t){return _s(t,256)}static int8(t){return _s(t,-8)}static int16(t){return _s(t,-16)}static int24(t){return _s(t,-24)}static int32(t){return _s(t,-32)}static int40(t){return _s(t,-40)}static int48(t){return _s(t,-48)}static int56(t){return _s(t,-56)}static int64(t){return _s(t,-64)}static int72(t){return _s(t,-72)}static int80(t){return _s(t,-80)}static int88(t){return _s(t,-88)}static int96(t){return _s(t,-96)}static int104(t){return _s(t,-104)}static int112(t){return _s(t,-112)}static int120(t){return _s(t,-120)}static int128(t){return _s(t,-128)}static int136(t){return _s(t,-136)}static int144(t){return _s(t,-144)}static int152(t){return _s(t,-152)}static int160(t){return _s(t,-160)}static int168(t){return _s(t,-168)}static int176(t){return _s(t,-176)}static int184(t){return _s(t,-184)}static int192(t){return _s(t,-192)}static int200(t){return _s(t,-200)}static int208(t){return _s(t,-208)}static int216(t){return _s(t,-216)}static int224(t){return _s(t,-224)}static int232(t){return _s(t,-232)}static int240(t){return _s(t,-240)}static int248(t){return _s(t,-248)}static int256(t){return _s(t,-256)}static int(t){return _s(t,-256)}static bytes1(t){return ha(t,1)}static bytes2(t){return ha(t,2)}static bytes3(t){return ha(t,3)}static bytes4(t){return ha(t,4)}static bytes5(t){return ha(t,5)}static bytes6(t){return ha(t,6)}static bytes7(t){return ha(t,7)}static bytes8(t){return ha(t,8)}static bytes9(t){return ha(t,9)}static bytes10(t){return ha(t,10)}static bytes11(t){return ha(t,11)}static bytes12(t){return ha(t,12)}static bytes13(t){return ha(t,13)}static bytes14(t){return ha(t,14)}static bytes15(t){return ha(t,15)}static bytes16(t){return ha(t,16)}static bytes17(t){return ha(t,17)}static bytes18(t){return ha(t,18)}static bytes19(t){return ha(t,19)}static bytes20(t){return ha(t,20)}static bytes21(t){return ha(t,21)}static bytes22(t){return ha(t,22)}static bytes23(t){return ha(t,23)}static bytes24(t){return ha(t,24)}static bytes25(t){return ha(t,25)}static bytes26(t){return ha(t,26)}static bytes27(t){return ha(t,27)}static bytes28(t){return ha(t,28)}static bytes29(t){return ha(t,29)}static bytes30(t){return ha(t,30)}static bytes31(t){return ha(t,31)}static bytes32(t){return ha(t,32)}static address(t){return new cg(og,"address",t)}static bool(t){return new cg(og,"bool",!!t)}static bytes(t){return new cg(og,"bytes",t)}static string(t){return new cg(og,"string",t)}static array(t,n){throw new Error("not implemented yet")}static tuple(t,n){throw new Error("not implemented yet")}static overrides(t){return new cg(og,"overrides",Object.assign({},t))}static isTyped(t){return t&&typeof t=="object"&&"_typedSymbol"in t&&t._typedSymbol===E0e}static dereference(t,n){if(cg.isTyped(t)){if(t.type!==n)throw new Error(`invalid type: expecetd ${n}, got ${t.type}`);return t.value}return t}};kw=new WeakMap;let Mu=cg;class iwt extends N1{constructor(t){super("address","address",t,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(t,n){let r=Mu.dereference(n,"string");try{r=na(r)}catch(s){return this._throwError(s.message,n)}return t.writeValue(r)}decode(t){return na(o1(t.readValue(),20))}}class awt extends N1{constructor(n){super(n.name,n.type,"_",n.dynamic);Un(this,"coder");this.coder=n}defaultValue(){return this.coder.defaultValue()}encode(n,r){return this.coder.encode(n,r)}decode(n){return this.coder.decode(n)}}function _Te(e,t,n){let r=[];if(Array.isArray(n))r=n;else if(n&&typeof n=="object"){let c={};r=t.map(u=>{const d=u.localName;return Lr(d,"cannot encode object for signature with missing names","INVALID_ARGUMENT",{argument:"values",info:{coder:u},value:n}),Lr(!c[d],"cannot encode object for signature with duplicate names","INVALID_ARGUMENT",{argument:"values",info:{coder:u},value:n}),c[d]=!0,n[d]})}else bn(!1,"invalid tuple value","tuple",n);bn(t.length===r.length,"types/value length mismatch","tuple",n);let s=new SJ,a=new SJ,o=[];t.forEach((c,u)=>{let d=r[u];if(c.dynamic){let f=a.length;c.encode(a,d);let x=s.writeUpdatableValue();o.push(g=>{x(g+f)})}else c.encode(s,d)}),o.forEach(c=>{c(s.length)});let l=e.appendWriter(s);return l+=e.appendWriter(a),l}function kTe(e,t){let n=[],r=[],s=e.subReader(0);return t.forEach(a=>{let o=null;if(a.dynamic){let l=e.readIndex(),c=s.subReader(l);try{o=a.decode(c)}catch(u){if(Zc(u,"BUFFER_OVERRUN"))throw u;o=u,o.baseType=a.name,o.name=a.localName,o.type=a.type}}else try{o=a.decode(e)}catch(l){if(Zc(l,"BUFFER_OVERRUN"))throw l;o=l,o.baseType=a.name,o.name=a.localName,o.type=a.type}if(o==null)throw new Error("investigate");n.push(o),r.push(a.localName||null)}),bM.fromItems(n,r)}class owt extends N1{constructor(n,r,s){const a=n.type+"["+(r>=0?r:"")+"]",o=r===-1||n.dynamic;super("array",a,s,o);Un(this,"coder");Un(this,"length");Ds(this,{coder:n,length:r})}defaultValue(){const n=this.coder.defaultValue(),r=[];for(let s=0;s<this.length;s++)r.push(n);return r}encode(n,r){const s=Mu.dereference(r,"array");Array.isArray(s)||this._throwError("expected array value",s);let a=this.length;a===-1&&(a=s.length,n.writeValue(s.length)),pke(s.length,a,"coder array"+(this.localName?" "+this.localName:""));let o=[];for(let l=0;l<s.length;l++)o.push(this.coder);return _Te(n,o,s)}decode(n){let r=this.length;r===-1&&(r=n.readIndex(),Lr(r*id<=n.dataLength,"insufficient data length","BUFFER_OVERRUN",{buffer:n.bytes,offset:r*id,length:n.dataLength}));let s=[];for(let a=0;a<r;a++)s.push(new awt(this.coder));return kTe(n,s)}}class lwt extends N1{constructor(t){super("bool","bool",t,!1)}defaultValue(){return!1}encode(t,n){const r=Mu.dereference(n,"bool");return t.writeValue(r?1:0)}decode(t){return!!t.readValue()}}class TTe extends N1{constructor(t,n){super(t,t,n,!0)}defaultValue(){return"0x"}encode(t,n){n=Jc(n);let r=t.writeValue(n.length);return r+=t.writeBytes(n),r}decode(t){return t.readBytes(t.readIndex(),!0)}}class cwt extends TTe{constructor(t){super("bytes",t)}decode(t){return Kr(super.decode(t))}}class uwt extends N1{constructor(n,r){let s="bytes"+String(n);super(s,s,r,!1);Un(this,"size");Ds(this,{size:n},{size:"number"})}defaultValue(){return"0x0000000000000000000000000000000000000000000000000000000000000000".substring(0,2+this.size*2)}encode(n,r){let s=Jc(Mu.dereference(r,this.type));return s.length!==this.size&&this._throwError("incorrect data length",r),n.writeBytes(s)}decode(n){return Kr(n.readBytes(this.size))}}const dwt=new Uint8Array([]);class fwt extends N1{constructor(t){super("null","",t,!1)}defaultValue(){return null}encode(t,n){return n!=null&&this._throwError("not null",n),t.writeBytes(dwt)}decode(t){return t.readBytes(0),null}}const hwt=BigInt(0),pwt=BigInt(1),mwt=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");class xwt extends N1{constructor(n,r,s){const a=(r?"int":"uint")+n*8;super(a,a,s,!1);Un(this,"size");Un(this,"signed");Ds(this,{size:n,signed:r},{size:"number",signed:"boolean"})}defaultValue(){return 0}encode(n,r){let s=js(Mu.dereference(r,this.type)),a=hj(mwt,id*8);if(this.signed){let o=hj(a,this.size*8-1);(s>o||s<-(o+pwt))&&this._throwError("value out-of-bounds",r),s=bke(s,8*id)}else(s<hwt||s>hj(a,this.size*8))&&this._throwError("value out-of-bounds",r);return n.writeValue(s)}decode(n){let r=hj(n.readValue(),this.size*8);return this.signed&&(r=Kyt(r,this.size*8)),r}}class gwt extends TTe{constructor(t){super("string",t)}defaultValue(){return""}encode(t,n){return super.encode(t,ud(Mu.dereference(n,"string")))}decode(t){return gM(super.decode(t))}}class eP extends N1{constructor(n,r){let s=!1;const a=[];n.forEach(l=>{l.dynamic&&(s=!0),a.push(l.type)});const o="tuple("+a.join(",")+")";super("tuple",o,r,s);Un(this,"coders");Ds(this,{coders:Object.freeze(n.slice())})}defaultValue(){const n=[];this.coders.forEach(s=>{n.push(s.defaultValue())});const r=this.coders.reduce((s,a)=>{const o=a.localName;return o&&(s[o]||(s[o]=0),s[o]++),s},{});return this.coders.forEach((s,a)=>{let o=s.localName;!o||r[o]!==1||(o==="length"&&(o="_length"),n[o]==null&&(n[o]=n[a]))}),Object.freeze(n)}encode(n,r){const s=Mu.dereference(r,"tuple");return _Te(n,this.coders,s)}decode(n){return kTe(n,this.coders)}}function LH(e,t){return{address:na(e),storageKeys:t.map((n,r)=>(bn(co(n,32),"invalid slot",`storageKeys[${r}]`,n),n.toLowerCase()))}}function u5(e){if(Array.isArray(e))return e.map((n,r)=>Array.isArray(n)?(bn(n.length===2,"invalid slot set",`value[${r}]`,n),LH(n[0],n[1])):(bn(n!=null&&typeof n=="object","invalid address-slot set","value",e),LH(n.address,n.storageKeys)));bn(e!=null&&typeof e=="object","invalid access list","value",e);const t=Object.keys(e).map(n=>{const r=e[n].reduce((s,a)=>(s[a]=!0,s),{});return LH(n,Object.keys(r).sort())});return t.sort((n,r)=>n.address.localeCompare(r.address)),t}function ITe(e){return{address:na(e.address),nonce:js(e.nonce!=null?e.nonce:0),chainId:js(e.chainId!=null?e.chainId:0),signature:nu.from(e.signature)}}function Uk(e){let t;return typeof e=="string"?t=L0.computePublicKey(e,!1):t=e.publicKey,na(lo("0x"+t.substring(4)).substring(26))}function bwt(e,t){return Uk(L0.recoverPublicKey(e,t))}const Ac=BigInt(0),ywt=BigInt(2),vwt=BigInt(27),wwt=BigInt(28),Cwt=BigInt(35),Swt=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),DH=4096*32;function Nwt(e){return{blobToKzgCommitment:r=>{if("computeBlobProof"in e){if("blobToKzgCommitment"in e&&typeof e.blobToKzgCommitment=="function")return hs(e.blobToKzgCommitment(Kr(r)))}else if("blobToKzgCommitment"in e&&typeof e.blobToKzgCommitment=="function")return hs(e.blobToKzgCommitment(r));if("blobToKZGCommitment"in e&&typeof e.blobToKZGCommitment=="function")return hs(e.blobToKZGCommitment(Kr(r)));bn(!1,"unsupported KZG library","kzg",e)},computeBlobKzgProof:(r,s)=>{if("computeBlobProof"in e&&typeof e.computeBlobProof=="function")return hs(e.computeBlobProof(Kr(r),Kr(s)));if("computeBlobKzgProof"in e&&typeof e.computeBlobKzgProof=="function")return e.computeBlobKzgProof(r,s);if("computeBlobKZGProof"in e&&typeof e.computeBlobKZGProof=="function")return hs(e.computeBlobKZGProof(Kr(r),Kr(s)));bn(!1,"unsupported KZG library","kzg",e)}}}function _0e(e,t){let n=e.toString(16);for(;n.length<2;)n="0"+n;return n+=op(t).substring(4),"0x"+n}function OA(e){return e==="0x"?null:na(e)}function DB(e,t){try{return u5(e)}catch(n){bn(!1,n.message,t,e)}}function Awt(e,t){try{if(!Array.isArray(e))throw new Error("authorizationList: invalid array");const n=[];for(let r=0;r<e.length;r++){const s=e[r];if(!Array.isArray(s))throw new Error(`authorization[${r}]: invalid array`);if(s.length!==6)throw new Error(`authorization[${r}]: wrong length`);if(!s[1])throw new Error(`authorization[${r}]: null address`);n.push({address:OA(s[1]),nonce:Ha(s[2],"nonce"),chainId:Ha(s[0],"chainId"),signature:nu.from({yParity:d5(s[3],"yParity"),r:a1(s[4],32),s:a1(s[5],32)})})}return n}catch(n){bn(!1,n.message,t,e)}}function d5(e,t){return e==="0x"?0:Di(e,t)}function Ha(e,t){if(e==="0x")return Ac;const n=js(e,t);return bn(n<=Swt,"value exceeds uint size",t,n),n}function ta(e,t){const n=js(e,"value"),r=il(n);return bn(r.length<=32,"value too large",`tx.${t}`,n),r}function BB(e){return u5(e).map(t=>[t.address,t.storageKeys])}function jwt(e){return e.map(t=>[ta(t.chainId,"chainId"),t.address,ta(t.nonce,"nonce"),ta(t.signature.yParity,"yParity"),il(t.signature.r),il(t.signature.s)])}function Ewt(e,t){bn(Array.isArray(e),`invalid ${t}`,"value",e);for(let n=0;n<e.length;n++)bn(co(e[n],32),"invalid ${ param } hash",`value[${n}]`,e[n]);return e}function _wt(e){const t=Bk(e);bn(Array.isArray(t)&&(t.length===9||t.length===6),"invalid field count for legacy transaction","data",e);const n={type:0,nonce:d5(t[0],"nonce"),gasPrice:Ha(t[1],"gasPrice"),gasLimit:Ha(t[2],"gasLimit"),to:OA(t[3]),value:Ha(t[4],"value"),data:Kr(t[5]),chainId:Ac};if(t.length===6)return n;const r=Ha(t[6],"v"),s=Ha(t[7],"r"),a=Ha(t[8],"s");if(s===Ac&&a===Ac)n.chainId=r;else{let o=(r-Cwt)/ywt;o<Ac&&(o=Ac),n.chainId=o,bn(o!==Ac||r===vwt||r===wwt,"non-canonical legacy v","v",t[6]),n.signature=nu.from({r:a1(t[7],32),s:a1(t[8],32),v:r})}return n}function kwt(e,t){const n=[ta(e.nonce,"nonce"),ta(e.gasPrice||0,"gasPrice"),ta(e.gasLimit,"gasLimit"),e.to||"0x",ta(e.value,"value"),e.data];let r=Ac;if(e.chainId!=Ac)r=js(e.chainId,"tx.chainId"),bn(!t||t.networkV==null||t.legacyChainId===r,"tx.chainId/sig.v mismatch","sig",t);else if(e.signature){const a=e.signature.legacyChainId;a!=null&&(r=a)}if(!t)return r!==Ac&&(n.push(il(r)),n.push("0x"),n.push("0x")),l1(n);let s=BigInt(27+t.yParity);return r!==Ac?s=nu.getChainIdV(r,t.v):BigInt(t.v)!==s&&bn(!1,"tx.chainId/sig.v mismatch","sig",t),n.push(il(s)),n.push(il(t.r)),n.push(il(t.s)),l1(n)}function $B(e,t){let n;try{if(n=d5(t[0],"yParity"),n!==0&&n!==1)throw new Error("bad yParity")}catch{bn(!1,"invalid yParity","yParity",t[0])}const r=a1(t[1],32),s=a1(t[2],32),a=nu.from({r,s,yParity:n});e.signature=a}function Twt(e){const t=Bk(hs(e).slice(1));bn(Array.isArray(t)&&(t.length===9||t.length===12),"invalid field count for transaction type: 2","data",Kr(e));const n={type:2,chainId:Ha(t[0],"chainId"),nonce:d5(t[1],"nonce"),maxPriorityFeePerGas:Ha(t[2],"maxPriorityFeePerGas"),maxFeePerGas:Ha(t[3],"maxFeePerGas"),gasPrice:null,gasLimit:Ha(t[4],"gasLimit"),to:OA(t[5]),value:Ha(t[6],"value"),data:Kr(t[7]),accessList:DB(t[8],"accessList")};return t.length===9||$B(n,t.slice(9)),n}function Iwt(e,t){const n=[ta(e.chainId,"chainId"),ta(e.nonce,"nonce"),ta(e.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),ta(e.maxFeePerGas||0,"maxFeePerGas"),ta(e.gasLimit,"gasLimit"),e.to||"0x",ta(e.value,"value"),e.data,BB(e.accessList||[])];return t&&(n.push(ta(t.yParity,"yParity")),n.push(il(t.r)),n.push(il(t.s))),Ra(["0x02",l1(n)])}function Pwt(e){const t=Bk(hs(e).slice(1));bn(Array.isArray(t)&&(t.length===8||t.length===11),"invalid field count for transaction type: 1","data",Kr(e));const n={type:1,chainId:Ha(t[0],"chainId"),nonce:d5(t[1],"nonce"),gasPrice:Ha(t[2],"gasPrice"),gasLimit:Ha(t[3],"gasLimit"),to:OA(t[4]),value:Ha(t[5],"value"),data:Kr(t[6]),accessList:DB(t[7],"accessList")};return t.length===8||$B(n,t.slice(8)),n}function Fwt(e,t){const n=[ta(e.chainId,"chainId"),ta(e.nonce,"nonce"),ta(e.gasPrice||0,"gasPrice"),ta(e.gasLimit,"gasLimit"),e.to||"0x",ta(e.value,"value"),e.data,BB(e.accessList||[])];return t&&(n.push(ta(t.yParity,"recoveryParam")),n.push(il(t.r)),n.push(il(t.s))),Ra(["0x01",l1(n)])}function Owt(e){let t=Bk(hs(e).slice(1)),n="3",r=null;if(t.length===4&&Array.isArray(t[0])){n="3 (network format)";const a=t[1],o=t[2],l=t[3];bn(Array.isArray(a),"invalid network format: blobs not an array","fields[1]",a),bn(Array.isArray(o),"invalid network format: commitments not an array","fields[2]",o),bn(Array.isArray(l),"invalid network format: proofs not an array","fields[3]",l),bn(a.length===o.length,"invalid network format: blobs/commitments length mismatch","fields",t),bn(a.length===l.length,"invalid network format: blobs/proofs length mismatch","fields",t),r=[];for(let c=0;c<t[1].length;c++)r.push({data:a[c],commitment:o[c],proof:l[c]});t=t[0]}bn(Array.isArray(t)&&(t.length===11||t.length===14),`invalid field count for transaction type: ${n}`,"data",Kr(e));const s={type:3,chainId:Ha(t[0],"chainId"),nonce:d5(t[1],"nonce"),maxPriorityFeePerGas:Ha(t[2],"maxPriorityFeePerGas"),maxFeePerGas:Ha(t[3],"maxFeePerGas"),gasPrice:null,gasLimit:Ha(t[4],"gasLimit"),to:OA(t[5]),value:Ha(t[6],"value"),data:Kr(t[7]),accessList:DB(t[8],"accessList"),maxFeePerBlobGas:Ha(t[9],"maxFeePerBlobGas"),blobVersionedHashes:t[10]};r&&(s.blobs=r),bn(s.to!=null,`invalid address for transaction type: ${n}`,"data",e),bn(Array.isArray(s.blobVersionedHashes),"invalid blobVersionedHashes: must be an array","data",e);for(let a=0;a<s.blobVersionedHashes.length;a++)bn(co(s.blobVersionedHashes[a],32),`invalid blobVersionedHash at index ${a}: must be length 32`,"data",e);return t.length===11||$B(s,t.slice(11)),s}function Mwt(e,t,n){const r=[ta(e.chainId,"chainId"),ta(e.nonce,"nonce"),ta(e.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),ta(e.maxFeePerGas||0,"maxFeePerGas"),ta(e.gasLimit,"gasLimit"),e.to||cE,ta(e.value,"value"),e.data,BB(e.accessList||[]),ta(e.maxFeePerBlobGas||0,"maxFeePerBlobGas"),Ewt(e.blobVersionedHashes||[],"blobVersionedHashes")];return t&&(r.push(ta(t.yParity,"yParity")),r.push(il(t.r)),r.push(il(t.s)),n)?Ra(["0x03",l1([r,n.map(s=>s.data),n.map(s=>s.commitment),n.map(s=>s.proof)])]):Ra(["0x03",l1(r)])}function Rwt(e){const t=Bk(hs(e).slice(1));bn(Array.isArray(t)&&(t.length===10||t.length===13),"invalid field count for transaction type: 4","data",Kr(e));const n={type:4,chainId:Ha(t[0],"chainId"),nonce:d5(t[1],"nonce"),maxPriorityFeePerGas:Ha(t[2],"maxPriorityFeePerGas"),maxFeePerGas:Ha(t[3],"maxFeePerGas"),gasPrice:null,gasLimit:Ha(t[4],"gasLimit"),to:OA(t[5]),value:Ha(t[6],"value"),data:Kr(t[7]),accessList:DB(t[8],"accessList"),authorizationList:Awt(t[9],"authorizationList")};return t.length===10||$B(n,t.slice(10)),n}function Lwt(e,t){const n=[ta(e.chainId,"chainId"),ta(e.nonce,"nonce"),ta(e.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),ta(e.maxFeePerGas||0,"maxFeePerGas"),ta(e.gasLimit,"gasLimit"),e.to||"0x",ta(e.value,"value"),e.data,BB(e.accessList||[]),jwt(e.authorizationList||[])];return t&&(n.push(ta(t.yParity,"yParity")),n.push(il(t.r)),n.push(il(t.s))),Ra(["0x04",l1(n)])}var Wp,H4,V4,W4,q4,G4,K4,Y4,X4,Q4,Z4,J4,Tw,Xb,c0,Qb,eS,tS,XF,Rf;let gae=(Rf=class{constructor(){Rn(this,tS);Rn(this,Wp);Rn(this,H4);Rn(this,V4);Rn(this,W4);Rn(this,q4);Rn(this,G4);Rn(this,K4);Rn(this,Y4);Rn(this,X4);Rn(this,Q4);Rn(this,Z4);Rn(this,J4);Rn(this,Tw);Rn(this,Xb);Rn(this,c0);Rn(this,Qb);Rn(this,eS);Wt(this,Wp,null),Wt(this,H4,null),Wt(this,W4,0),Wt(this,q4,Ac),Wt(this,G4,null),Wt(this,K4,null),Wt(this,Y4,null),Wt(this,V4,"0x"),Wt(this,X4,Ac),Wt(this,Q4,Ac),Wt(this,Z4,null),Wt(this,J4,null),Wt(this,Tw,null),Wt(this,Xb,null),Wt(this,c0,null),Wt(this,Qb,null),Wt(this,eS,null)}get type(){return ze(this,Wp)}set type(t){switch(t){case null:Wt(this,Wp,null);break;case 0:case"legacy":Wt(this,Wp,0);break;case 1:case"berlin":case"eip-2930":Wt(this,Wp,1);break;case 2:case"london":case"eip-1559":Wt(this,Wp,2);break;case 3:case"cancun":case"eip-4844":Wt(this,Wp,3);break;case 4:case"pectra":case"eip-7702":Wt(this,Wp,4);break;default:bn(!1,"unsupported transaction type","type",t)}}get typeName(){switch(this.type){case 0:return"legacy";case 1:return"eip-2930";case 2:return"eip-1559";case 3:return"eip-4844";case 4:return"eip-7702"}return null}get to(){const t=ze(this,H4);return t==null&&this.type===3?cE:t}set to(t){Wt(this,H4,t==null?null:na(t))}get nonce(){return ze(this,W4)}set nonce(t){Wt(this,W4,Di(t,"value"))}get gasLimit(){return ze(this,q4)}set gasLimit(t){Wt(this,q4,js(t))}get gasPrice(){const t=ze(this,G4);return t==null&&(this.type===0||this.type===1)?Ac:t}set gasPrice(t){Wt(this,G4,t==null?null:js(t,"gasPrice"))}get maxPriorityFeePerGas(){const t=ze(this,K4);return t??(this.type===2||this.type===3?Ac:null)}set maxPriorityFeePerGas(t){Wt(this,K4,t==null?null:js(t,"maxPriorityFeePerGas"))}get maxFeePerGas(){const t=ze(this,Y4);return t??(this.type===2||this.type===3?Ac:null)}set maxFeePerGas(t){Wt(this,Y4,t==null?null:js(t,"maxFeePerGas"))}get data(){return ze(this,V4)}set data(t){Wt(this,V4,Kr(t))}get value(){return ze(this,X4)}set value(t){Wt(this,X4,js(t,"value"))}get chainId(){return ze(this,Q4)}set chainId(t){Wt(this,Q4,js(t))}get signature(){return ze(this,Z4)||null}set signature(t){Wt(this,Z4,t==null?null:nu.from(t))}get accessList(){const t=ze(this,J4)||null;return t??(this.type===1||this.type===2||this.type===3?[]:null)}set accessList(t){Wt(this,J4,t==null?null:u5(t))}get authorizationList(){const t=ze(this,eS)||null;return t==null&&this.type===4?[]:t}set authorizationList(t){Wt(this,eS,t==null?null:t.map(n=>ITe(n)))}get maxFeePerBlobGas(){const t=ze(this,Tw);return t==null&&this.type===3?Ac:t}set maxFeePerBlobGas(t){Wt(this,Tw,t==null?null:js(t,"maxFeePerBlobGas"))}get blobVersionedHashes(){let t=ze(this,Xb);return t==null&&this.type===3?[]:t}set blobVersionedHashes(t){if(t!=null){bn(Array.isArray(t),"blobVersionedHashes must be an Array","value",t),t=t.slice();for(let n=0;n<t.length;n++)bn(co(t[n],32),"invalid blobVersionedHash",`value[${n}]`,t[n])}Wt(this,Xb,t)}get blobs(){return ze(this,Qb)==null?null:ze(this,Qb).map(t=>Object.assign({},t))}set blobs(t){if(t==null){Wt(this,Qb,null);return}const n=[],r=[];for(let s=0;s<t.length;s++){const a=t[s];if(TB(a)){Lr(ze(this,c0),"adding a raw blob requires a KZG library","UNSUPPORTED_OPERATION",{operation:"set blobs()"});let o=hs(a);if(bn(o.length<=DH,"blob is too large",`blobs[${s}]`,a),o.length!==DH){const u=new Uint8Array(DH);u.set(o),o=u}const l=ze(this,c0).blobToKzgCommitment(o),c=Kr(ze(this,c0).computeBlobKzgProof(o,l));n.push({data:Kr(o),commitment:Kr(l),proof:c}),r.push(_0e(1,l))}else{const o=Kr(a.commitment);n.push({data:Kr(a.data),commitment:o,proof:Kr(a.proof)}),r.push(_0e(1,o))}}Wt(this,Qb,n),Wt(this,Xb,r)}get kzg(){return ze(this,c0)}set kzg(t){t==null?Wt(this,c0,null):Wt(this,c0,Nwt(t))}get hash(){return this.signature==null?null:lo(vr(this,tS,XF).call(this,!0,!1))}get unsignedHash(){return lo(this.unsignedSerialized)}get from(){return this.signature==null?null:bwt(this.unsignedHash,this.signature)}get fromPublicKey(){return this.signature==null?null:L0.recoverPublicKey(this.unsignedHash,this.signature)}isSigned(){return this.signature!=null}get serialized(){return vr(this,tS,XF).call(this,!0,!0)}get unsignedSerialized(){return vr(this,tS,XF).call(this,!1,!1)}inferType(){const t=this.inferTypes();return t.indexOf(2)>=0?2:t.pop()}inferTypes(){const t=this.gasPrice!=null,n=this.maxFeePerGas!=null||this.maxPriorityFeePerGas!=null,r=this.accessList!=null,s=ze(this,Tw)!=null||ze(this,Xb);this.maxFeePerGas!=null&&this.maxPriorityFeePerGas!=null&&Lr(this.maxFeePerGas>=this.maxPriorityFeePerGas,"priorityFee cannot be more than maxFee","BAD_DATA",{value:this}),Lr(!n||this.type!==0&&this.type!==1,"transaction type cannot have maxFeePerGas or maxPriorityFeePerGas","BAD_DATA",{value:this}),Lr(this.type!==0||!r,"legacy transaction cannot have accessList","BAD_DATA",{value:this});const a=[];return this.type!=null?a.push(this.type):this.authorizationList&&this.authorizationList.length?a.push(4):n?a.push(2):t?(a.push(1),r||a.push(0)):r?(a.push(1),a.push(2)):(s&&this.to||(a.push(0),a.push(1),a.push(2)),a.push(3)),a.sort(),a}isLegacy(){return this.type===0}isBerlin(){return this.type===1}isLondon(){return this.type===2}isCancun(){return this.type===3}clone(){return Rf.from(this)}toJSON(){const t=n=>n==null?null:n.toString();return{type:this.type,to:this.to,data:this.data,nonce:this.nonce,gasLimit:t(this.gasLimit),gasPrice:t(this.gasPrice),maxPriorityFeePerGas:t(this.maxPriorityFeePerGas),maxFeePerGas:t(this.maxFeePerGas),value:t(this.value),chainId:t(this.chainId),sig:this.signature?this.signature.toJSON():null,accessList:this.accessList}}static from(t){if(t==null)return new Rf;if(typeof t=="string"){const r=hs(t);if(r[0]>=127)return Rf.from(_wt(r));switch(r[0]){case 1:return Rf.from(Pwt(r));case 2:return Rf.from(Twt(r));case 3:return Rf.from(Owt(r));case 4:return Rf.from(Rwt(r))}Lr(!1,"unsupported transaction type","UNSUPPORTED_OPERATION",{operation:"from"})}const n=new Rf;return t.type!=null&&(n.type=t.type),t.to!=null&&(n.to=t.to),t.nonce!=null&&(n.nonce=t.nonce),t.gasLimit!=null&&(n.gasLimit=t.gasLimit),t.gasPrice!=null&&(n.gasPrice=t.gasPrice),t.maxPriorityFeePerGas!=null&&(n.maxPriorityFeePerGas=t.maxPriorityFeePerGas),t.maxFeePerGas!=null&&(n.maxFeePerGas=t.maxFeePerGas),t.maxFeePerBlobGas!=null&&(n.maxFeePerBlobGas=t.maxFeePerBlobGas),t.data!=null&&(n.data=t.data),t.value!=null&&(n.value=t.value),t.chainId!=null&&(n.chainId=t.chainId),t.signature!=null&&(n.signature=nu.from(t.signature)),t.accessList!=null&&(n.accessList=t.accessList),t.authorizationList!=null&&(n.authorizationList=t.authorizationList),t.blobVersionedHashes!=null&&(n.blobVersionedHashes=t.blobVersionedHashes),t.kzg!=null&&(n.kzg=t.kzg),t.blobs!=null&&(n.blobs=t.blobs),t.hash!=null&&(bn(n.isSigned(),"unsigned transaction cannot define '.hash'","tx",t),bn(n.hash===t.hash,"hash mismatch","tx",t)),t.from!=null&&(bn(n.isSigned(),"unsigned transaction cannot define '.from'","tx",t),bn(n.from.toLowerCase()===(t.from||"").toLowerCase(),"from mismatch","tx",t)),n}},Wp=new WeakMap,H4=new WeakMap,V4=new WeakMap,W4=new WeakMap,q4=new WeakMap,G4=new WeakMap,K4=new WeakMap,Y4=new WeakMap,X4=new WeakMap,Q4=new WeakMap,Z4=new WeakMap,J4=new WeakMap,Tw=new WeakMap,Xb=new WeakMap,c0=new WeakMap,Qb=new WeakMap,eS=new WeakMap,tS=new WeakSet,XF=function(t,n){Lr(!t||this.signature!=null,"cannot serialize unsigned transaction; maybe you meant .unsignedSerialized","UNSUPPORTED_OPERATION",{operation:".serialized"});const r=t?this.signature:null;switch(this.inferType()){case 0:return kwt(this,r);case 1:return Fwt(this,r);case 2:return Iwt(this,r);case 3:return Mwt(this,r,n?this.blobs:null);case 4:return Lwt(this,r)}Lr(!1,"unsupported transaction type","UNSUPPORTED_OPERATION",{operation:".serialized"})},Rf);function Dwt(e){return bn(typeof e.address=="string","invalid address for hashAuthorization","auth.address",e),lo(Ra(["0x05",l1([e.chainId!=null?il(e.chainId):"0x",na(e.address),e.nonce!=null?il(e.nonce):"0x"])]))}function c1(e){return lo(ud(e))}var Bwt="AEEUdwmgDS8BxQKKAP4BOgDjATAAngDUAIMAoABoAOAAagCOAEQAhABMAHIAOwA9ACsANgAmAGIAHgAuACgAJwAXAC0AGgAjAB8ALwAUACkAEgAeAAkAGwARABkAFgA5ACgALQArADcAFQApABAAHgAiABAAGgAeABMAGAUhBe8BFxREN8sF2wC5AK5HAW8ArQkDzQCuhzc3NzcBP68NEfMABQdHBuw5BV8FYAA9MzkI9r4ZBg7QyQAWA9CeOwLNCjcCjqkChuA/lm+RAsXTAoP6ASfnEQDytQFJAjWVCkeXAOsA6godAB/cwdAUE0WlBCN/AQUCQRjFD/MRBjHxDQSJbw0jBzUAswBxme+tnIcAYwabAysG8QAjAEMMmxcDqgPKQyDXCMMxA7kUQwD3NXOrAKmFIAAfBC0D3x4BJQDBGdUFAhEgVD8JnwmQJiNWYUzrg0oAGwAUAB0AFnNcACkAFgBP9h3gPfsDOWDKneY2ChglX1UDYD30ABsAFAAdABZzIGRAnwDD8wAjAEEMzRbDqgMB2sAFYwXqAtCnAsS4AwpUJKRtFHsadUz9AMMVbwLpABM1NJEX0ZkCgYMBEyMAxRVvAukAEzUBUFAtmUwSAy4DBTER33EftQHfSwB5MxJ/AjkWKQLzL8E/cwBB6QH9LQDPDtO9ASNriQC5DQANAwCK21EFI91zHwCoL9kBqQcHBwcHKzUDowBvAQohPvU3fAQgHwCyAc8CKQMA5zMSezr7ULgFmDp/LzVQBgEGAi8FYQVgt8AFcTtlQhpCWEmfe5tmZ6IAExsDzQ8t+X8rBKtTAltbAn0jsy8Bl6utPWMDTR8Ei2kRANkDBrNHNysDBzECQWUAcwFpJ3kAiyUhAJ0BUb8AL3EfAbfNAz81KUsFWwF3YQZtAm0A+VEfAzEJDQBRSQCzAQBlAHsAM70GD/v3IZWHBwARKQAxALsjTwHZAeMPEzmXgIHwABIAGQA8AEUAQDt3gdvIEGcQZAkGTRFMdEIVEwK0D64L7REdDNkq09PgADSxB/MDWwfzA1sDWwfzB/MDWwfzA1sDWwNbA1scEvAi28gQZw9QBHUFlgWTBN4IiyZREYkHMAjaVBV0JhxPA00BBCMtSSQ7mzMTJUpMFE0LCAQ2SmyvfUADTzGzVP2QqgPTMlc5dAkGHnkSqAAyD3skNb1OhnpPcagKU0+2tYdJak5vAsY6sEAACikJm2/Dd1YGRRAfJ6kQ+ww3AbkBPw3xS9wE9QY/BM0fgRkdD9GVoAipLeEM8SbnLqWAXiP5KocF8Uv4POELUVFsD10LaQnnOmeBUgMlAREijwrhDT0IcRD3Cs1vDekRSQc9A9lJngCpBwULFR05FbkmFGKwCw05ewb/GvoLkyazEy17AAXXGiUGUQEtGwMA0y7rhbRaNVwgT2MGBwspI8sUrFAkDSlAu3hMGh8HGSWtApVDdEqLUToelyH6PEENai4XUYAH+TwJGVMLhTyiRq9FEhHWPpE9TCJNTDAEOYMsMyePCdMPiQy9fHYBXQklCbUMdRM1ERs3yQg9Bx0xlygnGQglRplgngT7owP3E9UDDwVDCUUHFwO5HDETMhUtBRGBKNsC9zbZLrcCk1aEARsFzw8pH+MQVEfkDu0InwJpA4cl7wAxFSUAGyKfCEdnAGOP3FMJLs8Iy2pwI3gDaxTrZRF3B5UOWwerHDcVwxzlcMxeD4YMKKezCV8BeQmdAWME5wgNNV+MpCBFZ1eLXBifIGVBQ14AAjUMaRWjRMGHfAKPD28SHwE5AXcHPQ0FAnsR8RFvEJkI74YINbkz/DopBFMhhyAVCisDU2zSCysm/Qz8bQGnEmYDEDRBd/Jnr2C6KBgBBx0yyUFkIfULlk/RDKAaxRhGVDIZ6AfDA/ca9yfuQVsGAwOnBxc6UTPyBMELbQiPCUMATQ6nGwfbGG4KdYzUATWPAbudA1uVhwJzkwY7Bw8Aaw+LBX3pACECqwinAAkA0wNbAD0CsQehAB0AiUUBQQMrMwEl6QKTA5cINc8BmTMB9y0EH8cMGQD7O25OAsO1AoBuZqYF4VwCkgJNOQFRKQQJUktVA7N15QDfAE8GF+NLARmvTs8e50cB43MvAMsA/wAJOQcJRQHRAfdxALsBYws1Caa3uQFR7S0AhwAZbwHbAo0A4QA5AIP1AVcAUQVd/QXXAlNNARU1HC9bZQG/AyMBNwERAH0Gz5GpzQsjBHEH1wIQHxXlAu8yB7kFAyLjE9FCyQK94lkAMhoKPAqrCqpgX2Q3CjV2PVQAEh+sPss/UgVVO1c7XDtXO1w7VztcO1c7XDtXO1wDm8Pmw+YKcF9JYe8Mqg3YRMw6TRPfYFVgNhPMLbsUxRXSJVoZQRrAJwkl6FUNDwgt12Y0CDA0eRfAAEMpbINFY4oeNApPHOtTlVT8LR8AtUumM7MNsBsZREQFS3XxYi4WEgomAmSFAmJGX1GzAV83JAKh+wJonAJmDQKfiDgfDwJmPwJmKgRyBIMDfxcDfpY5Cjl7GzmGOicnAmwhAjI6OA4CbcsCbbLzjgM3a0kvAWsA4gDlAE4JB5wMkQECD8YAEbkCdzMCdqZDAnlPRwJ4viFg30WyRvcCfEMCeswCfQ0CfPRIBEiBZygALxlJXEpfGRtK0ALRBQLQ0EsrA4hTA4fqRMmRNgLypV0HAwOyS9JMMSkH001QTbMCi0MCitzFHwshR2sJuwKOOwKOYESbhQKO3QKOYHxRuFM5AQ5S2FSJApP/ApMQAO0AIFUiVbNV1AosHymZijLleGpFPz0Cl6MC77ZYJawAXSkClpMCloCgAK1ZsFoNhVEAPwKWuQKWUlxIXNUCmc8CmWhczl0LHQKcnznGOqECnBoCn58CnryOACETNS4TAp31Ap6WALlBYThh8wKe1wKgcgGtAp6jIwKeUqljzGQrKS8CJ7MCJoICoP8CoFDbAqYzAqXSAqgDAIECp/ZogGi1AAdNaiBq1QKs5wKssgKtawKtBgJXIQJV4AKx5dsDH1JsmwKywRECsuwbbORtZ21MYwMl0QK2YD9DbpQDKUkCuGICuUsZArkue3A6cOUCvR0DLbYDMhUCvoxyBgMzdQK+HnMmc1MCw88CwwhzhnRPOUl05AM8qwEDPJ4DPcMCxYACxksCxhSNAshtVQLISALJUwLJMgJkoQLd1nh9ZXiyeSlL1AMYp2cGAmH4GfeVKHsPXpZevxUCz28Cz3AzT1fW9xejAMqxAs93AS3uA04Wfk8JAtwrAtuOAtJTA1JgA1NjAQUDVZCAjUMEzxrxZEl5A4LSg5EC2ssC2eKEFIRNp0ADhqkAMwNkEoZ1Xf0AWQLfaQLevHd7AuIz7RgB8zQrAfSfAfLWiwLr9wLpdH0DAur9AuroAP1LAb0C7o0C66CWrpcHAu5DA4XkmH1w5HGlAvMHAG0DjhqZlwL3FwORcgOSiwL3nAL53QL4apogmq+/O5siA52HAv7+AR8APZ8gAZ+3AwWRA6ZuA6bdANXJAwZuoYyiCQ0DDE0BEwEjB3EGZb1rCQC/BG/DFY8etxEAG3k9ACcDNxJRA42DAWcrJQCM8wAlAOanC6OVCLsGI6fJBgCvBRnDBvElRUYFFoAFcD9GSDNCKUK8X3kZX8QAls0FOgCQVCGbwTsuYDoZutcONxjOGJHJ/gVfBWAFXwVgBWsFYAVfBWAFXwVgBV8FYAVfBWBOHQjfjW8KCgoKbF7xMwTRA7kGN8PDAMMEr8MA70gxFroFTj5xPnhCR0K+X30/X/AAWBkzswCNBsxzzASm70aCRS4rDDMeLz49fnXfcsH5GcoscQFz13Y4HwVnBXLJycnACNdRYwgICAqEXoWTxgA7P4kACxbZBu21Kw0AjMsTAwkVAOVtJUUsJ1JCuULESUArXy9gPi9AKwnJRQYKTD9LPoA+iT54PnkCkULEUUpDX9NWV3JVEjQAc1w3A3IBE3YnX+g7QiMJb6MKaiszRCUuQrNCxDPMCcwEX9EWJzYREBEEBwIHKn6l33JCNVIfybPJtAltydPUCmhBZw/tEKsZAJOVJU1CLRuxbUHOQAo7P0s+eEJHHA8SJVRPdGM0NVrpvBoKhfUlM0JHHGUQUhEWO1xLSj8MO0ucNAqJIzVCRxv9EFsqKyA4OQgNj2nwZgp5ZNFgE2A1K3YHS2AhQQojJmC7DgpzGG1WYFUZCQYHZO9gHWCdYIVgu2BTYJlwFh8GvRbcXbG8YgtDHrMBwzPVyQonHQgkCyYBgQJ0Ajc4nVqIAwGSCsBPIgDsK3SWEtIVBa5N8gGjAo+kVwVIZwD/AEUSCDweX4ITrRQsJ8K3TwBXFDwEAB0TvzVcAtoTS20RIwDgVgZ9BBImYgA5AL4Coi8LFnezOkCnIQFjAY4KBAPh9RcGsgZSBsEAJctdsWIRu2kTkQstRw7DAcMBKgpPBGIGMDAwKCYnKTQaLg4AKRSVAFwCdl+YUZ0JdicFD3lPAdt1F9ZZKCGxuE3yBxkFVGcA/wBFEgiCBwAOLHQSjxOtQDg1z7deFRMAZ8QTAGtKb1ApIiPHADkAvgKiLy1DFtYCmBiDAlDDWNB0eo7fpaMO/aEVRRv0ATEQZBIODyMEAc8JQhCbDRgzFD4TAEMAu9YBCgCsAOkAm5I3ABwAYxvONnR+MhXJAxgKQyxL2+kkJhMbhQKDBMkSsvF0AD9BNQ6uQC7WqSQHwxEAEEIu1hkhAH2z4iQPwyJPHNWpdyYBRSpnJALzoBAEVPPsH20MxA0CCEQKRgAFyAtFAlMNwwjEDUQJRArELtapMg7DDZgJIw+TGukEIwvDFkMAqAtDEMMMBhioe+QAO3MMRAACrgnEBSPY9Q0FDnbSBoMAB8MSYxkSxAEJAPIJAAB8FWMOFtMc/HcXwxhDAC7DAvOowwAewwJdKDKHAAHDAALrFUQVwwAbwyvzpWMWv8wA/ABpAy++bcYDUKPD0KhDCwKmJ1MAAmMA5+UZwxAagwipBRL/eADfw6fDGOMCGsOjk3l6BwOpo4sAEsMOGxMAA5sAbcMOAAvDp0MJGkMDwgipnNIPAwfIqUMGAOGDAAPzABXDAAcDAAnDAGmTABrDAA7DChjDjnEWAwABYwAOcwAuUyYABsMAF8MIKQANUgC6wy4AA8MADqMq8wCyYgAcIwAB8wqpAAXOCx0V4wAHowBCwwEKAGnDAAuDAB3DAAjDCakABdIAbqcZ3QCZCCkABdIAAAFDAAfjAB2jCCkABqIACYMAGzMAbSMA5sOIAAhjAAhDABTDBAkpAAbSAOOTAAlDC6kOzPtnAAdDAG6kQFAATwAKwwwAA0MACbUDPwAHIwAZgwACE6cDAAojAApDAAoDp/MGwwAJIwADEwAQQwgAFEMAEXMAD5MADfMADcMAGRMOFiMAFUMAbqMWuwHDAMIAE0MLAGkzEgDhUwACQwAEWgAXgwUjAAbYABjDBSYBgzBaAEFNALcQBxUMegAwMngBrA0IZgJ0KxQHBREPd1N0ZzKRJwaIHAZqNT4DqQq8BwngAB4DAwt2AX56T1ocKQNXAh1GATQGC3tOxYNagkgAMQA5CQADAQEAWxLjAIOYNAEzAH7tFRk6TglSAF8NAAlYAQ+S1ACAQwQorQBiAN4dAJ1wPyeTANVzuQDX3AIeEMp9eyMgXiUAEdkBkJizKltbVVAaRMqRAAEAhyQ/SDEz6BmfVwB6ATEsOClKIRcDOF0E/832AFNt5AByAnkCRxGCOs94NjXdAwINGBonDBwPALW2AwICAgAAAAAAAAYDBQMDARrUAwAtAAAAAgEGBgYGBgYFBQUFBQUEBQYHCAkEBQUFBQQAAAICAAAAIgCNAJAAlT0A6gC7ANwApEQAwgCyAK0AqADuAKYA2gCjAOcBCAEDAMcAgQBiANIA1AEDAN4A8gCQAKkBMQDqAN8A3AsBCQ8yO9ra2tq8xuLT1tRJOB0BUgFcNU0BWgFpAWgBWwFMUUlLbhMBUxsNEAs6PhMOACcUKy0vMj5AQENDQ0RFFEYGJFdXV1dZWVhZL1pbXVxcI2NnZ2ZoZypsbnZ1eHh4eHh4enp6enp6enp6enp8fH18e2IARPIASQCaAHgAMgBm+ACOAFcAVwA3AnbvAIsABfj4AGQAk/IAnwBPAGIAZP//sACFAIUAaQBWALEAJAC2AIMCQAJDAPwA5wD+AP4A6AD/AOkA6QDoAOYALwJ7AVEBQAE+AVQBPgE+AT4BOQE4ATgBOAEcAVgXADEQCAEAUx8SHgsdHhYAjgCWAKYAUQBqIAIxAHYAbwCXAxUDJzIDIUlGTzEAkQJPAMcCVwKkAMAClgKWApYClgKWApYCiwKWApYClgKWApYClgKVApUCmAKgApcClgKWApQClAKUApQCkgKVAnUB1AKXAp8ClgKWApUeAIETBQD+DQOfAmECOh8BVBg9AuIZEjMbAU4/G1WZAXusRAFpYQEFA0FPAQYAmTEeIJdyADFoAHEANgCRA5zMk/C2jGINwjMWygIZCaXdfDILBCs5dAE7YnQBugDlhoiHhoiGiYqKhouOjIaNkI6Ij4qQipGGkoaThpSSlYaWhpeKmIaZhpqGm4aci52QnoqfhuIC4XTpAt90AIp0LHSoAIsAdHQEQwRABEIERQRDBEkERgRBBEcESQRIBEQERgRJAJ5udACrA490ALxuAQ10ANFZdHQA13QCFHQA/mJ0AP4BIQD+APwA/AD9APwDhGZ03ASMK23HAP4A/AD8AP0A/CR0dACRYnQA/gCRASEA/gCRAvQA/gCRA4RmdNwEjCttxyR0AP9idAEhAP4A/gD8APwA/QD8AP8A/AD8AP0A/AOEZnTcBIwrbcckdHQAkWJ0ASEA/gCRAP4AkQL0AP4AkQOEZnTcBIwrbcckdAJLAT50AlIBQXQCU8l0dAJfdHQDpgL0A6YDpgOnA6cDpwOnA4RmdNwEjCttxyR0dACRYnQBIQOmAJEDpgCRAvQDpgCRA4RmdNwEjCttxyR0BDh0AJEEOQCRDpU5dSgCADR03gV2CwArdAEFAM5iCnR0AF1iAAYcOgp0dACRCnQAXAEIwWZ0CnRmdHQAkWZ0CnRmdEXgAFF03gp0dEY0tlT2u3SOAQTwscwhjZZKrhYcBSfFp9XNbKiVDOD2b+cpe4/Z17mQnbtzzhaeQtE2GGj0IDNTjRUSyTxxw/RPHW/+vS7d1NfRt9z9QPZg4X7QFfhCnkvgNPIItOsC2eV6hPannZNHlZ9xrwZXIMOlu3jSoQSq78WEjwLjw1ELSlF1aBvfzwk5ZX7AUvQzjPQKbDuQ+sm4wNOp4A6AdVuRS0t1y/DZpg4R6m7FNjM9HgvW7Bi88zaMjOo6lM8wtBBdj8LP4ylv3zCXPhebMKJc066o9sF71oFW/8JXu86HJbwDID5lzw5GWLR/LhT0Qqnp2JQxNZNfcbLIzPy+YypqRm/lBmGmex+82+PisxUumSeJkALIT6rJezxMH+CTJmQtt5uwTVbL3ptmjDUQzlSIvWi8Tl7ng1NpuRn1Ng4n14Qc+3Iil7OwkvNWogLSPkn3pihIFytyIGmMhOe3n1tWsuMy9BdKyqF4Z3v2SgggTL9KVvMXPnCbRe+oOuFFP3HejBG/w9gvmfNYvg6JuWia2lcSSN1uIjBktzoIazOHPJZ7kKHPz8mRWVdW3lA8WGF9dQF6Bm673boov3BUWDU2JNcahR23GtfHKLOz/viZ+rYnZFaIznXO67CYEJ1fXuTRpZhYZkKe54xeoagkNGLs+NTZHE0rX45/XvQ2RGADX6vcAvdxIUBV27wxGm2zjZo4X3ILgAlrOFheuZ6wtsvaIj4yLY7qqawlliaIcrz2G+c3vscAnCkCuMzMmZvMfu9lLwTvfX+3cVSyPdN9ZwgDZhfjRgNJcLiJ67b9xx8JHswprbiE3v9UphotAPIgnXVIN5KmMc0piXhc6cChPnN+MRhG9adtdttQTTwSIpl8I4/j//d3sz1326qTBTpPRM/Hgh3kzqEXs8ZAk4ErQhNO8hzrQ0DLkWMA/N+91tn2MdOJnWC2FCZehkQrwzwbKOjhvZsbM95QoeL9skYyMf4srVPVJSgg7pOLUtr/n9eT99oe9nLtFRpjA9okV2Kj8h9k5HaC0oivRD8VyXkJ81tcd4fHNXPCfloIQasxsuO18/46dR2jgul/UIet2G0kRvnyONMKhHs6J26FEoqSqd+rfYjeEGwHWVDpX1fh1jBBcKGMqRepju9Y00mDVHC+Xdij/j44rKfvfjGinNs1jO/0F3jB83XCDINN/HB84axlP+3E/klktRo+vl3U/aiyMJbIodE1XSsDn6UAzIoMtUObY2+k/4gY/l+AkZJ5Sj2vQrkyLm3FoxjhDX+31UXBFf9XrAH31fFqoBmDEZvhvvpnZ87N+oZEu7U9O/nnk+QWj3x8uyoRbEnf+O5UMr9i0nHP38IF5AvzrBW8YWBUR0mIAzIvndQq9N3v/Jto3aPjPXUPl8ASdPPyAp7jENf8bk7VMM9ol9XGmlBmeDMuGqt+WzuL6CXAxXjIhCPM5vACchgMJ/8XBGLO/D1isVvGhwwHHr1DLaI5mn2Jr/b1pUD90uciDaS8cXNDzCWvNmT/PhQe5e8nTnnnkt8Ds/SIjibcum/fqDhKopxAY8AkSrPn+IGDEKOO+U3XOP6djFs2H5N9+orhOahiQk5KnEUWa+CzkVzhp8bMHRbg81qhjjXuIKbHjSLSIBKWqockGtKinY+z4/RdBUF6pcc3JmnlxVcNgrI4SEzKUZSwcD2QCyxzKve+gAmg6ZuSRkpPFa6mfThu7LJNu3H5K42uCpNvPAsoedolKV/LHe/eJ+BbaG5MG0NaSGVPRUmNFMFFSSpXEcXwbVh7UETOZZtoVNRGOIbbkig3McEtR68cG0RZAoJevWYo7Dg/lZ1CQzblWeUvVHmr8fY4Nqd9JJiH/zEX24mJviH60fAyFr0A3c4bC1j3yZU60VgJxXn8JgJXLUIsiBnmKmMYz+7yBQFBvqb2eYnuW59joZBf56/wXvWIR4R8wTmV80i1mZy+S4+BUES+hzjk0uXpC///z/IlqHZ1monzlXp8aCfhGKMti73FI1KbL1q6IKO4fuBuZ59gagjn5xU79muMpHXg6S+e+gDM/U9BKLHbl9l6o8czQKl4RUkJJiqftQG2i3BMg/TQlUYFkJDYBOOvAugYuzYSDnZbDDd/aSd9x0Oe6F+bJcHfl9+gp6L5/TgA+BdFFovbfCrQ40s5vMPw8866pNX8zyFGeFWdxIpPVp9Rg1UPOVFbFZrvaFq/YAzHQgqMWpahMYfqHpmwXfHL1/kpYmGuHFwT55mQu0dylfNuq2Oq0hTMCPwqfxnuBIPLXfci4Y1ANy+1CUipQxld/izVh16WyG2Q0CQQ9NqtAnx1HCHwDj7sYxOSB0wopZSnOzxQOcExmxrVTF2BkOthVpGfuhaGECfCJpJKpjnihY+xOT2QJxN61+9K6QSqtv2Shr82I3jgJrqBg0wELFZPjvHpvzTtaJnLK6Vb97Yn933koO/saN7fsjwNKzp4l2lJVx2orjCGzC/4ZL4zCver6aQYtC5sdoychuFE6ufOiog+VWi5UDkbmvmtah/3aArEBIi39s5ILUnlFLgilcGuz9CQshEY7fw2ouoILAYPVT/gyAIq3TFAIwVsl+ktkRz/qGfnCDGrm5gsl/l9QdvCWGsjPz3dU7XuqKfdUrr/6XIgjp4rey6AJBmCmUJMjITHVdFb5m1p+dLMCL8t55zD42cmftmLEJC0Da04YiRCVUBLLa8D071/N5UBNBXDh0LFsmhV/5B5ExOB4j3WVG/S3lfK5o+V6ELHvy6RR9n4ac+VsK4VE4yphPvV+kG9FegTBH4ZRXL2HytUHCduJazB/KykjfetYxOXTLws267aGOd+I+JhKP//+VnXmS90OD/jvLcVu0asyqcuYN1mSb6XTlCkqv1vigZPIYwNF/zpWcT1GR/6aEIRjkh0yhg4LXJfaGobYJTY4JI58KiAKgmmgAKWdl5nYCeLqavRJGQNuYuZtZFGx+IkI4w4NS2xwbetNMunOjBu/hmKCI/w7tfiiyUd//4rbTeWt4izBY8YvGIN6vyKYmP/8X8wHKCeN+WRcKM70+tXKNGyevU9H2Dg5BsljnTf8YbsJ1TmMs74Ce2XlHisleguhyeg44rQOHZuw/6HTkhnnurK2d62q6yS7210SsAIaR+jXMQA+svkrLpsUY+F30Uw89uOdGAR6vo4FIME0EfVVeHTu6eKicfhSqOeXJhbftcd08sWEnNUL1C9fnprTgd83IMut8onVUF0hvqzZfHduPjbjwEXIcoYmy+P6tcJZHmeOv6VrvEdkHDJecjHuHeWANe79VG662qTjA/HCvumVv3qL+LrOcpqGps2ZGwQdFJ7PU4iuyRlBrwfO+xnPyr47s2cXVbWzAyznDiBGjCM3ksxjjqM62GE9C8f5U38kB3VjtabKp/nRdvMESPGDG90bWRLAt1Qk5DyLuazRR1YzdC1c+hZXvAWV8xA72S4A8B67vjVhbba3MMop293FeEXpe7zItMWrJG/LOH9ByOXmYnNJfjmfuX9KbrpgLOba4nZ+fl8Gbdv/ihv+6wFGKHCYrVwmhFC0J3V2bn2tIB1wCc1CST3d3X2OyxhguXcs4sm679UngzofuSeBewMFJboIQHbUh/m2JhW2hG9DIvG2t7yZIzKBTz9wBtnNC+2pCRYhSIuQ1j8xsz5VvqnyUIthvuoyyu7fNIrg/KQUVmGQaqkqZk/Vx5b33/gsEs8yX7SC1J+NV4icz6bvIE7C5G6McBaI8rVg56q5QBJWxn/87Q1sPK4+sQa8fLU5gXo4paaq4cOcQ4wR0VBHPGjKh+UlPCbA1nLXyEUX45qZ8J7/Ln4FPJE2TdzD0Z8MLSNQiykMMmSyOCiFfy84Rq60emYB2vD09KjYwsoIpeDcBDTElBbXxND72yhd9pC/1CMid/5HUMvAL27OtcIJDzNKpRPNqPOpyt2aPGz9QWIs9hQ9LiX5s8m9hjTUu/f7MyIatjjd+tSfQ3ufZxPpmJhTaBtZtKLUcfOCUqADuO+QoH8B9v6U+P0HV1GLQmtoNFTb3s74ivZgjES0qfK+8RdGgBbcCMSy8eBvh98+et1KIFqSe1KQPyXULBMTsIYnysIwiZBJYdI20vseV+wuJkcqGemehKjaAb9L57xZm3g2zX0bZ2xk/fU+bCo7TlnbW7JuF1YdURo/2Gw7VclDG1W7LOtas2LX4upifZ/23rzpsnY/ALfRgrcWP5hYmV9VxVOQA1fZvp9F2UNU+7d7xRyVm5wiLp3/0dlV7vdw1PMiZrbDAYzIVqEjRY2YU03sJhPnlwIPcZUG5ltL6S8XCxU1eYS5cjr34veBmXAvy7yN4ZjArIG0dfD/5UpBNlX1ZPoxJOwyqRi3wQWtOzd4oNKh0LkoTm8cwqgIfKhqqGOhwo71I+zXnMemTv2B2AUzABWyFztGgGULjDDzWYwJUVBTjKCn5K2QGMK1CQT7SzziOjo+BhAmqBjzuc3xYym2eedGeOIRJVyTwDw37iCMe4g5Vbnsb5ZBdxOAnMT7HU4DHpxWGuQ7GeiY30Cpbvzss55+5Km1YsbD5ea3NI9QNYIXol5apgSu9dZ8f8xS5dtHpido5BclDuLWY4lhik0tbJa07yJhH0BOyEut/GRbYTS6RfiTYWGMCkNpfSHi7HvdiTglEVHKZXaVhezH4kkXiIvKopYAlPusftpE4a5IZwvw1x/eLvoDIh/zpo9FiQInsTb2SAkKHV42XYBjpJDg4374XiVb3ws4qM0s9eSQ5HzsMU4OZJKuopFjBM+dAZEl8RUMx5uU2N486Kr141tVsGQfGjORYMCJAMsxELeNT4RmWjRcpdTGBwcx6XN9drWqPmJzcrGrH4+DRc7+n1w3kPZwu0BkNr6hQrqgo7JTB9A5kdJ/H7P4cWBMwsmuixAzJB3yrQpnGIq90lxAXLzDCdn1LPibsRt7rHNjgQBklRgPZ8vTbjXdgXrTWQsK5MdrXXQVPp0Rinq3frzZKJ0qD6Qhc40VzAraUXlob1gvkhK3vpmHgI6FRlQZNx6eRqkp0zy4AQlX813fAPtL3jMRaitGFFjo0zmErloC+h+YYdVQ6k4F/epxAoF0BmqEoKNTt6j4vQZNQ2BoqF9Vj53TOIoNmDiu9Xp15RkIgQIGcoLpfoIbenzpGUAtqFJp5W+LLnx38jHeECTJ/navKY1NWfN0sY1T8/pB8kIH3DU3DX+u6W3YwpypBMYOhbSxGjq84RZ84fWJow8pyHqn4S/9J15EcCMsXqrfwyd9mhiu3+rEo9pPpoJkdZqHjra4NvzFwuThNKy6hao/SlLw3ZADUcUp3w3SRVfW2rhl80zOgTYnKE0Hs2qp1J6H3xqPqIkvUDRMFDYyRbsFI3M9MEyovPk8rlw7/0a81cDVLmBsR2ze2pBuKb23fbeZC0uXoIvDppfTwIDxk1Oq2dGesGc+oJXWJLGkOha3CX+DUnzgAp9HGH9RsPZN63Hn4RMA5eSVhPHO+9RcRb/IOgtW31V1Q5IPGtoxPjC+MEJbVlIMYADd9aHYWUIQKopuPOHmoqSkubnAKnzgKHqgIOfW5RdAgotN6BN+O2ZYHkuemLnvQ8U9THVrS1RtLmKbcC7PeeDsYznvqzeg6VCNwmr0Yyx1wnLjyT84BZz3EJyCptD3yeueAyDWIs0L2qs/VQ3HUyqfrja0V1LdDzqAikeWuV4sc7RLIB69jEIBjCkyZedoUHqCrOvShVzyd73OdrJW0hPOuQv2qOoHDc9xVb6Yu6uq3Xqp2ZaH46A7lzevbxQEmfrzvAYSJuZ4WDk1Hz3QX1LVdiUK0EvlAGAYlG3Md30r7dcPN63yqBCIj25prpvZP0nI4+EgWoFG95V596CurXpKRBGRjQlHCvy5Ib/iW8nZJWwrET3mgd6mEhfP4KCuaLjopWs7h+MdXFdIv8dHQJgg1xi1eYqB0uDYjxwVmri0Sv5XKut/onqapC+FQiC2C1lvYJ9MVco6yDYsS3AANUfMtvtbYI2hfwZatiSsnoUeMZd34GVjkMMKA+XnjJpXgRW2SHTZplVowPmJsvXy6w3cfO1AK2dvtZEKTkC/TY9LFiKHCG0DnrMQdGm2lzlBHM9iEYynH2UcVMhUEjsc0oDBTgo2ZSQ1gzkAHeWeBXYFjYLuuf8yzTCy7/RFR81WDjXMbq2BOH5dURnxo6oivmxL3cKzKInlZkD31nvpHB9Kk7GfcfE1t+1V64b9LtgeJGlpRFxQCAqWJ5DoY77ski8gsOEOr2uywZaoO/NGa0X0y1pNQHBi3b2SUGNpcZxDT7rLbBf1FSnQ8guxGW3W+36BW0gBje4DOz6Ba6SVk0xiKgt+q2JOFyr4SYfnu+Ic1QZYIuwHBrgzr6UvOcSCzPTOo7D6IC4ISeS7zkl4h+2VoeHpnG/uWR3+ysNgPcOIXQbv0n4mr3BwQcdKJxgPSeyuP/z1Jjg4e9nUvoXegqQVIE30EHx5GHv+FAVUNTowYDJgyFhf5IvlYmEqRif6+WN1MkEJmDcQITx9FX23a4mxy1AQRsOHO/+eImX9l8EMJI3oPWzVXxSOeHU1dUWYr2uAA7AMb+vAEZSbU3qob9ibCyXeypEMpZ6863o6QPqlqGHZkuWABSTVNd4cOh9hv3qEpSx2Zy/DJMP6cItEmiBJ5PFqQnDEIt3NrA3COlOSgz43D7gpNFNJ5MBh4oFzhDPiglC2ypsNU4ISywY2erkyb1NC3Qh/IfWj0eDgZI4/ln8WPfBsT3meTjq1Uqt1E7Zl/qftqkx6aM9KueMCekSnMrcHj1CqTWWzEzPsZGcDe3Ue4Ws+XFYVxNbOFF8ezkvQGR6ZOtOLU2lQEnMBStx47vE6Pb7AYMBRj2OOfZXfisjJnpTfSNjo6sZ6qSvNxZNmDeS7Gk3yYyCk1HtKN2UnhMIjOXUzAqDv90lx9O/q/AT1ZMnit5XQe9wmQxnE/WSH0CqZ9/2Hy+Sfmpeg8RwsHI5Z8kC8H293m/LHVVM/BA7HaTJYg5Enk7M/xWpq0192ACfBai2LA/qrCjCr6Dh1BIMzMXINBmX96MJ5Hn2nxln/RXPFhwHxUmSV0EV2V0jm86/dxxuYSU1W7sVkEbN9EzkG0QFwPhyHKyb3t+Fj5WoUUTErcazE/N6EW6Lvp0d//SDPj7EV9UdJN+Amnf3Wwk3A0SlJ9Z00yvXZ7n3z70G47Hfsow8Wq1JXcfwnA+Yxa5mFsgV464KKP4T31wqIgzFPd3eCe3j5ory5fBF2hgCFyVFrLzI9eetNXvM7oQqyFgDo4CTp/hDV9NMX9JDHQ/nyHTLvZLNLF6ftn2OxjGm8+PqOwhxnPHWipkE/8wbtyri80Sr7pMNkQGMfo4ZYK9OcCC4ESVFFbLMIvlxSoRqWie0wxqnLfcLSXMSpMMQEJYDVObYsXIQNv4TGNwjq1kvT1UOkicTrG3IaBZ3XdScS3u8sgeZPVpOLkbiF940FjbCeNRINNvDbd01EPBrTCPpm12m43ze1bBB59Ia6Ovhnur/Nvx3IxwSWol+3H2qfCJR8df6aQf4v6WiONxkK+IqT4pKQrZK/LplgDI/PJZbOep8dtbV7oCr6CgfpWa8NczOkPx81iSHbsNhVSJBOtrLIMrL31LK9TqHqAbAHe0RLmmV806kRLDLNEhUEJfm9u0sxpkL93Zgd6rw+tqBfTMi59xqXHLXSHwSbSBl0EK0+loECOPtrl+/nsaFe197di4yUgoe4jKoAJDXc6DGDjrQOoFDWZJ9HXwt8xDrQP+7aRwWKWI1GF8s8O4KzxWBBcwnl3vnl1Oez3oh6Ea1vjR7/z7DDTrFtqU2W/KAEzAuXDNZ7MY73MF216dzdSbWmUp4lcm7keJfWaMHgut9x5C9mj66Z0lJ+yhsjVvyiWrfk1lzPOTdhG15Y7gQlXtacvI7qv/XNSscDwqkgwHT/gUsD5yB7LdRRvJxQGYINn9hTpodKFVSTPrtGvyQw+HlRFXIkodErAGu9Iy1YpfSPc3jkFh5CX3lPxv7aqjE/JAfTIpEjGb/H7MO0e2vsViSW1qa/Lmi4/n4DEI3g7lYrcanspDfEpKkdV1OjSLOy0BCUqVoECaB55vs06rXl4jqmLsPsFM/7vYJ0vrBhDCm/00A/H81l1uekJ/6Lml3Hb9+NKiLqATJmDpyzfYZFHumEjC662L0Bwkxi7E9U4cQA0XMVDuMYAIeLMPgQaMVOd8fmt5SflFIfuBoszeAw7ow5gXPE2Y/yBc/7jExARUf/BxIHQBF5Sn3i61w4z5xJdCyO1F1X3+3ax+JSvMeZ7S6QSKp1Fp/sjYz6Z+VgCZzibGeEoujryfMulH7Rai5kAft9ebcW50DyJr2uo2z97mTWIu45YsSnNSMrrNUuG1XsYBtD9TDYzQffKB87vWbkM4EbPAFgoBV4GQS+vtFDUqOFAoi1nTtmIOvg38N4hT2Sn8r8clmBCXspBlMBYTnrqFJGBT3wZOzAyJDre9dHH7+x7qaaKDOB4UQALD5ecS0DE4obubQEiuJZ0EpBVpLuYcce8Aa4PYd/V4DLDAJBYKQPCWTcrEaZ5HYbJi11Gd6hjGom1ii18VHYnG28NKpkz2UKVPxlhYSp8uZr367iOmoy7zsxehW9wzcy2zG0a80PBMCRQMb32hnaHeOR8fnNDzZhaNYhkOdDsBUZ3loDMa1YP0uS0cjUP3b/6DBlqmZOeNABDsLl5BI5QJups8uxAuWJdkUB/pO6Zax6tsg7fN5mjjDgMGngO+DPcKqiHIDbFIGudxtPTIyDi9SFMKBDcfdGQRv41q1AqmxgkVfJMnP8w/Bc7N9/TR6C7mGObFqFkIEom8sKi2xYqJLTCHK7cxzaZvqODo22c3wisBCP4HeAgcRbNPAsBkNRhSmD48dHupdBRw4mIvtS5oeF6zeT1KMCyhMnmhpkFAGWnGscoNkwvQ8ZM5lE/vgTHFYL99OuNxdFBxTEDd5v2qLR8y9WkXsWgG6kZNndFG+pO/UAkOCipqIhL3hq7cRSdrCq7YhUsTocEcnaFa6nVkhnSeRYUA1YO0z5itF9Sly3VlxYDw239TJJH6f3EUfYO5lb7bcFcz8Bp7Oo8QmnsUHOz/fagVUBtKEw1iT88j+aKkv8cscKNkMxjYr8344D1kFoZ7/td1W6LCNYN594301tUGRmFjAzeRg5vyoM1F6+bJZ/Q54jN/k8SFd3DxPTYaAUsivsBfgTn7Mx8H2SpPt4GOdYRnEJOH6jHM2p6SgB0gzIRq6fHxGMmSmqaPCmlfwxiuloaVIitLGN8wie2CDWhkzLoCJcODh7KIOAqbHEvXdUxaS4TTTs07Clzj/6GmVs9kiZDerMxEnhUB6QQPlcfqkG9882RqHoLiHGBoHfQuXIsAG8GTAtao2KVwRnvvam8jo1e312GQAKWEa4sUVEAMG4G6ckcONDwRcg1e2D3+ohXgY4UAWF8wHKQMrSnzCgfFpsxh+aHXMGtPQroQasRY4U6UdG0rz1Vjbka0MekOGRZQEvqQFlxseFor8zWFgHek3v29+WqN6gaK5gZOTOMZzpQIC1201LkMCXild3vWXSc5UX9xcFYfbRPzGFa1FDcPfPB/jUEq/FeGt419CI3YmBlVoHsa4KdcwQP5ZSwHHhFJ7/Ph/Rap/4vmG91eDwPP0lDfCDRCLszTqfzM71xpmiKi2HwS4WlqvGNwtvwF5Dqpn6KTq8ax00UMPkxDcZrEEEsIvHiUXXEphdb4GB4FymlPwBz4Gperqq5pW7TQ6/yNRhW8VT5NhuP0udlxo4gILq5ZxAZk8ZGh3g4CqxJlPKY7AQxupfUcVpWT5VItp1+30UqoyP4wWsRo3olRRgkWZZ2ZN6VC3OZFeXB8NbnUrSdikNptD1QiGuKkr8EmSR/AK9Rw+FF3s5uwuPbvHGiPeFOViltMK7AUaOsq9+x9cndk3iJEE5LKZRlWJbKOZweROzmPNVPkjE3K/TyA57Rs68TkZ3MR8akKpm7cFjnjPd/DdkWjgYoKHSr5Wu5ssoBYU4acRs5g2DHxUmdq8VXOXRbunD8QN0LhgkssgahcdoYsNvuXGUK/KXD/7oFb+VGdhqIn02veuM5bLudJOc2Ky0GMaG4W/xWBxIJcL7yliJOXOpx0AkBqUgzlDczmLT4iILXDxxtRR1oZa2JWFgiAb43obrJnG/TZC2KSK2wqOzRZTXavZZFMb1f3bXvVaNaK828w9TO610gk8JNf3gMfETzXXsbcvRGCG9JWQZ6+cDPqc4466Yo2RcKH+PILeKOqtnlbInR3MmBeGG3FH10yzkybuqEC2HSQwpA0An7d9+73BkDUTm30bZmoP/RGbgFN+GrCOfADgqr0WbI1a1okpFms8iHYw9hm0zUvlEMivBRxModrbJJ+9/p3jUdQQ9BCtQdxnOGrT5dzRUmw0593/mbRSdBg0nRvRZM5/E16m7ZHmDEtWhwvfdZCZ8J8M12W0yRMszXamWfQTwIZ4ayYktrnscQuWr8idp3PjT2eF/jmtdhIfcpMnb+IfZY2FebW6UY/AK3jP4u3Tu4zE4qlnQgLFbM19EBIsNf7KhjdbqQ/D6yiDb+NlEi2SKD+ivXVUK8ib0oBo366gXkR8ZxGjpJIDcEgZPa9TcYe0TIbiPl/rPUQDu3XBJ9X/GNq3FAUsKsll57DzaGMrjcT+gctp+9MLYXCq+sqP81eVQ0r9lt+gcQfZbACRbEjvlMskztZG8gbC8Qn9tt26Q7y7nDrbZq/LEz7kR6Jc6pg3N9rVX8Y5MJrGlML9p9lU4jbTkKqCveeZUJjHB03m2KRKR2TytoFkTXOLg7keU1s1lrPMQJpoOKLuAAC+y1HlJucU6ysB5hsXhvSPPLq5J7JtnqHKZ4vYjC4Vy8153QY+6780xDuGARsGbOs1WqzH0QS765rnSKEbbKlkO8oI/VDwUd0is13tKpqILu1mDJFNy/iJAWcvDgjxvusIT+PGz3ST/J9r9Mtfd0jpaGeiLYIqXc7DiHSS8TcjFVksi66PEkxW1z6ujbLLUGNNYnzOWpH8BZGK4bCK7iR+MbIv8ncDAz1u4StN3vTTzewr9IQjk9wxFxn+6N1ddKs0vffJiS08N3a4G1SVrlZ97Q/M+8G9fe5AP6d9/Qq4WRnORVhofPIKEdCr3llspUfE0oKIIYoByBRPh+bX1HLS3JWGJRhIvE1aW4NTd8ePi4Z+kXb+Z8snYfSNcqijhAgVsx4RCM54cXUiYkjeBmmC4ajOHrChoELscJJC7+9jjMjw5BagZKlgRMiSNYz7h7vvZIoQqbtQmspc0cUk1G/73iXtSpROl5wtLgQi0mW2Ex8i3WULhcggx6E1LMVHUsdc9GHI1PH3U2Ko0PyGdn9KdVOLm7FPBui0i9a0HpA60MsewVE4z8CAt5d401Gv6zXlIT5Ybit1VIA0FCs7wtvYreru1fUyW3oLAZ/+aTnZrOcYRNVA8spoRtlRoWflsRClFcgzkqiHOrf0/SVw+EpVaFlJ0g4Kxq1MMOmiQdpMNpte8lMMQqm6cIFXlnGbfJllysKDi+0JJMotkqgIxOSQgU9dn/lWkeVf8nUm3iwX2Nl3WDw9i6AUK3vBAbZZrcJpDQ/N64AVwjT07Jef30GSSmtNu2WlW7YoyW2FlWfZFQUwk867EdLYKk9VG6JgEnBiBxkY7LMo4YLQJJlAo9l/oTvJkSARDF/XtyAzM8O2t3eT/iXa6wDN3WewNmQHdPfsxChU/KtLG2Mn8i4ZqKdSlIaBZadxJmRzVS/o4yA65RTSViq60oa395Lqw0pzY4SipwE0SXXsKV+GZraGSkr/RW08wPRvqvSUkYBMA9lPx4m24az+IHmCbXA+0faxTRE9wuGeO06DIXa6QlKJ3puIyiuAVfPr736vzo2pBirS+Vxel3TMm3JKhz9o2ZoRvaFVpIkykb0Hcm4oHFBMcNSNj7/4GJt43ogonY2Vg4nsDQIWxAcorpXACzgBqQPjYsE/VUpXpwNManEru4NwMCFPkXvMoqvoeLN3qyu/N1eWEHttMD65v19l/0kH2mR35iv/FI+yjoHJ9gPMz67af3Mq/BoWXqu3rphiWMXVkmnPSEkpGpUI2h1MThideGFEOK6YZHPwYzMBvpNC7+ZHxPb7epfefGyIB4JzO9DTNEYnDLVVHdQyvOEVefrk6Uv5kTQYVYWWdqrdcIl7yljwwIWdfQ/y+2QB3eR/qxYObuYyB4gTbo2in4PzarU1sO9nETkmj9/AoxDA+JM3GMqQtJR4jtduHtnoCLxd1gQUscHRB/MoRYIEsP2pDZ9KvHgtlk1iTbWWbHhohwFEYX7y51fUV2nuUmnoUcqnWIQAAgl9LTVX+Bc0QGNEhChxHR4YjfE51PUdGfsSFE6ck7BL3/hTf9jLq4G1IafINxOLKeAtO7quulYvH5YOBc+zX7CrMgWnW47/jfRsWnJjYYoE7xMfWV2HN2iyIqLI";const k0e=new Map([[8217,"apostrophe"],[8260,"fraction slash"],[12539,"middle dot"]]),T0e=4;function $wt(e){let t=0;function n(){return e[t++]<<8|e[t++]}let r=n(),s=1,a=[0,1];for(let F=1;F<r;F++)a.push(s+=n());let o=n(),l=t;t+=o;let c=0,u=0;function d(){return c==0&&(u=u<<8|e[t++],c=8),u>>--c&1}const f=31,x=2**f,g=x>>>1,v=g>>1,w=x-1;let C=0;for(let F=0;F<f;F++)C=C<<1|d();let N=[],P=0,I=x;for(;;){let F=Math.floor(((C-P+1)*s-1)/I),U=0,L=r;for(;L-U>1;){let ne=U+L>>>1;F<a[ne]?L=ne:U=ne}if(U==0)break;N.push(U);let z=P+Math.floor(I*a[U]/s),Q=P+Math.floor(I*a[U+1]/s)-1;for(;!((z^Q)&g);)C=C<<1&w|d(),z=z<<1&w,Q=Q<<1&w|1;for(;z&~Q&v;)C=C&g|C<<1&w>>>1|d(),z=z<<1^g,Q=(Q^g)<<1|g|1;P=z,I=1+Q-z}let R=r-4;return N.map(F=>{switch(F-R){case 3:return R+65792+(e[l++]<<16|e[l++]<<8|e[l++]);case 2:return R+256+(e[l++]<<8|e[l++]);case 1:return R+e[l++];default:return F-1}})}function Uwt(e){let t=0;return()=>e[t++]}function PTe(e){return Uwt($wt(zwt(e)))}function zwt(e){let t=[];[..."ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"].forEach((s,a)=>t[s.charCodeAt(0)]=a);let n=e.length,r=new Uint8Array(6*n>>3);for(let s=0,a=0,o=0,l=0;s<n;s++)l=l<<6|t[e.charCodeAt(s)],o+=6,o>=8&&(r[a++]=l>>(o-=8));return r}function Hwt(e){return e&1?~e>>1:e>>1}function Vwt(e,t){let n=Array(e);for(let r=0,s=0;r<e;r++)n[r]=s+=Hwt(t());return n}function uE(e,t=0){let n=[];for(;;){let r=e(),s=e();if(!s)break;t+=r;for(let a=0;a<s;a++)n.push(t+a);t+=s+1}return n}function FTe(e){return dE(()=>{let t=uE(e);if(t.length)return t})}function OTe(e){let t=[];for(;;){let n=e();if(n==0)break;t.push(Wwt(n,e))}for(;;){let n=e()-1;if(n<0)break;t.push(qwt(n,e))}return t.flat()}function dE(e){let t=[];for(;;){let n=e(t.length);if(!n)break;t.push(n)}return t}function MTe(e,t,n){let r=Array(e).fill().map(()=>[]);for(let s=0;s<t;s++)Vwt(e,n).forEach((a,o)=>r[o].push(a));return r}function Wwt(e,t){let n=1+t(),r=t(),s=dE(t);return MTe(s.length,1+e,t).flatMap((o,l)=>{let[c,...u]=o;return Array(s[l]).fill().map((d,f)=>{let x=f*r;return[c+f*n,u.map(g=>g+x)]})})}function qwt(e,t){let n=1+t();return MTe(n,1+e,t).map(s=>[s[0],s.slice(1)])}function Gwt(e){let t=[],n=uE(e);return s(r([]),[]),t;function r(a){let o=e(),l=dE(()=>{let c=uE(e).map(u=>n[u]);if(c.length)return r(c)});return{S:o,B:l,Q:a}}function s({S:a,B:o},l,c){if(!(a&4&&c===l[l.length-1])){a&2&&(c=l[l.length-1]),a&1&&t.push(l);for(let u of o)for(let d of u.Q)s(u,[...l,d],c)}}}function Kwt(e){return e.toString(16).toUpperCase().padStart(2,"0")}function RTe(e){return`{${Kwt(e)}}`}function Ywt(e){let t=[];for(let n=0,r=e.length;n<r;){let s=e.codePointAt(n);n+=s<65536?1:2,t.push(s)}return t}function US(e){let n=e.length;if(n<4096)return String.fromCodePoint(...e);let r=[];for(let s=0;s<n;)r.push(String.fromCodePoint(...e.slice(s,s+=4096)));return r.join("")}function Xwt(e,t){let n=e.length,r=n-t.length;for(let s=0;r==0&&s<n;s++)r=e[s]-t[s];return r}var Qwt="AEUDTAHBCFQATQDRADAAcgAgADQAFAAsABQAHwAOACQADQARAAoAFwAHABIACAAPAAUACwAFAAwABAAQAAMABwAEAAoABQAIAAIACgABAAQAFAALAAIACwABAAIAAQAHAAMAAwAEAAsADAAMAAwACgANAA0AAwAKAAkABAAdAAYAZwDSAdsDJgC0CkMB8xhZAqfoC190UGcThgBurwf7PT09Pb09AjgJum8OjDllxHYUKXAPxzq6tABAxgK8ysUvWAgMPT09PT09PSs6LT2HcgWXWwFLoSMEEEl5RFVMKvO0XQ8ExDdJMnIgsj26PTQyy8FfEQ8AY8IPAGcEbwRwBHEEcgRzBHQEdQR2BHcEeAR6BHsEfAR+BIAEgfndBQoBYgULAWIFDAFiBNcE2ATZBRAFEQUvBdALFAsVDPcNBw13DYcOMA4xDjMB4BllHI0B2grbAMDpHLkQ7QHVAPRNQQFnGRUEg0yEB2uaJF8AJpIBpob5AERSMAKNoAXqaQLUBMCzEiACnwRZEkkVsS7tANAsBG0RuAQLEPABv9HICTUBXigPZwRBApMDOwAamhtaABqEAY8KvKx3LQ4ArAB8UhwEBAVSagD8AEFZADkBIadVj2UMUgx5Il4ANQC9AxIB1BlbEPMAs30CGxlXAhwZKQIECBc6EbsCoxngzv7UzRQA8M0BawL6ZwkN7wABAD33OQRcsgLJCjMCjqUChtw/km+NAsXPAoP2BT84PwURAK0RAvptb6cApQS/OMMey5HJS84UdxpxTPkCogVFITaTOwERAK5pAvkNBOVyA7q3BKlOJSALAgUIBRcEdASpBXqzABXFSWZOawLCOqw//AolCZdvv3dSBkEQGyelEPcMMwG1ATsN7UvYBPEGOwTJH30ZGQ/NlZwIpS3dDO0m4y6hgFoj9SqDBe1L9DzdC01RaA9ZC2UJ4zpjgU4DIQENIosK3Q05CG0Q8wrJaw3lEUUHOQPVSZoApQcBCxEdNRW1JhBirAsJOXcG+xr2C48mrxMpevwF0xohBk0BKRr/AM8u54WwWjFcHE9fBgMLJSPHFKhQIA0lQLd4SBobBxUlqQKRQ3BKh1E2HpMh9jw9DWYuE1F8B/U8BRlPC4E8nkarRQ4R0j6NPUgiSUwsBDV/LC8niwnPD4UMuXxyAVkJIQmxDHETMREXN8UIOQcZLZckJxUIIUaVYJoE958D8xPRAwsFPwlBBxMDtRwtEy4VKQUNgSTXAvM21S6zAo9WgAEXBcsPJR/fEFBH4A7pCJsCZQODJesALRUhABcimwhDYwBfj9hTBS7LCMdqbCN0A2cU52ERcweRDlcHpxwzFb8c4XDIXguGCCijrwlbAXUJmQFfBOMICTVbjKAgQWdTi1gYmyBhQT9d/AIxDGUVn0S9h3gCiw9rEhsBNQFzBzkNAQJ3Ee0RaxCVCOuGBDW1M/g6JQRPIYMgEQonA09szgsnJvkM+GkBoxJiAww0PXfuZ6tgtiQX/QcZMsVBYCHxC5JPzQycGsEYQlQuGeQHvwPzGvMn6kFXBf8DowMTOk0z7gS9C2kIiwk/AEkOoxcH1xhqCnGM0AExiwG3mQNXkYMCb48GNwcLAGcLhwV55QAdAqcIowAFAM8DVwA5Aq0HnQAZAIVBAT0DJy8BIeUCjwOTCDHLAZUvAfMpBBvDDBUA9zduSgLDsQKAamaiBd1YAo4CSTUBTSUEBU5HUQOvceEA2wBLBhPfRwEVq0rLGuNDAd9vKwDHAPsABTUHBUEBzQHzbQC3AV8LMQmis7UBTekpAIMAFWsB1wKJAN0ANQB/8QFTAE0FWfkF0wJPSQERMRgrV2EBuwMfATMBDQB5BsuNpckHHwRtB9MCEBsV4QLvLge1AQMi3xPNQsUCvd5VoWACZIECYkJbTa9bNyACofcCaJgCZgkCn4Q4GwsCZjsCZiYEbgR/A38TA36SOQY5dxc5gjojIwJsHQIyNjgKAm3HAm2u74ozZ0UrAWcA3gDhAEoFB5gMjQD+C8IADbUCdy8CdqI/AnlLQwJ4uh1c20WuRtcCfD8CesgCfQkCfPAFWQUgSABIfWMkAoFtAoAAAoAFAn+uSVhKWxUXSswC0QEC0MxLJwOITwOH5kTFkTIC8qFdAwMDrkvOTC0lA89NTE2vAos/AorYwRsHHUNnBbcCjjcCjlxAl4ECjtkCjlx4UbRTNQpS1FSFApP7ApMMAOkAHFUeVa9V0AYsGymVhjLheGZFOzkCl58C77JYIagAWSUClo8ClnycAKlZrFoJgU0AOwKWtQKWTlxEXNECmcsCmWRcyl0HGQKcmznCOp0CnBYCn5sCnriKAB0PMSoPAp3xAp6SALU9YTRh7wKe0wKgbgGpAp6fHwKeTqVjyGQnJSsCJ68CJn4CoPsCoEwCot0CocQCpi8Cpc4Cp/8AfQKn8mh8aLEAA0lqHGrRAqzjAqyuAq1nAq0CAlcdAlXcArHh1wMfTmyXArK9DQKy6Bds4G1jbUhfAyXNArZcOz9ukAMpRQK4XgK5RxUCuSp3cDZw4QK9GQK72nCWAzIRAr6IcgIDM3ECvhpzInNPAsPLAsMEc4J0SzVFdOADPKcDPJoDPb8CxXwCxkcCxhCJAshpUQLIRALJTwLJLgJknQLd0nh5YXiueSVL0AMYo2cCAmH0GfOVJHsLXpJeuxECz2sCz2wvS1PS8xOfAMatAs9zASnqA04SfksFAtwnAtuKAtJPA1JcA1NfAQEDVYyAiT8AyxbtYEWCHILTgs6DjQLaxwLZ3oQQhEmnPAOGpQAvA2QOhnFZ+QBVAt9lAt64c3cC4i/tFAHzMCcB9JsB8tKHAuvzAulweQLq+QLq5AD5RwG5Au6JAuuclqqXAwLuPwOF4Jh5cOBxoQLzAwBpA44WmZMC9xMDkW4DkocC95gC+dkC+GaaHJqruzebHgOdgwL++gEbADmfHJ+zAwWNA6ZqA6bZANHFAwZqoYiiBQkDDEkCwAA/AwDhQRdTARHzA2sHl2cFAJMtK7evvdsBiZkUfxEEOQH7KQUhDp0JnwCS/SlXxQL3AZ0AtwW5AG8LbUEuFCaNLgFDAYD8AbUmAHUDDgRtACwCFgyhAAAKAj0CagPdA34EkQEgRQUhfAoABQBEABMANhICdwEABdUDa+8KxQIA9wqfJ7+xt+UBkSFBQgHpFH8RNMCJAAQAGwBaAkUChIsABjpTOpSNbQC4Oo860ACNOME63AClAOgAywE6gTo7Ofw5+Tt2iTpbO56JOm85GAFWATMBbAUvNV01njWtNWY1dTW2NcU1gjWRNdI14TWeNa017jX9NbI1wTYCNhE1xjXVNhY2JzXeNe02LjY9Ni41LSE2OjY9Njw2yTcIBJA8VzY4Nt03IDcPNsogN4k3MAoEsDxnNiQ3GTdsOo03IULUQwdC4EMLHA8PCZsobShRVQYA6X8A6bABFCnXAukBowC9BbcAbwNzBL8MDAMMAQgDAAkKCwsLCQoGBAVVBI/DvwDz9b29kaUCb0QtsRTNLt4eGBcSHAMZFhYZEhYEARAEBUEcQRxBHEEcQRxBHEEaQRxBHEFCSTxBPElISUhBNkM2QTYbNklISVmBVIgBFLWZAu0BhQCjBcEAbykBvwGJAaQcEZ0ePCklMAAhMvAIMAL54gC7Bm8EescjzQMpARQpKgDUABavAj626xQAJP0A3etzuf4NNRA7efy2Z9NQrCnC0OSyANz5BBIbJ5IFDR6miIavYS6tprjjmuKebxm5C74Q225X1pkaYYPb6f1DK4k3xMEBb9S2WMjEibTNWhsRJIA+vwNVEiXTE5iXs/wezV66oFLfp9NZGYW+Gk19J2+bCT6Ye2w6LDYdgzKMUabk595eLBCXANz9HUpWbATq9vqXVx9XDg+Pc9Xp4+bsS005SVM/BJBM4687WUuf+Uj9dEi8aDNaPxtpbDxcG1THTImUMZq4UCaaNYpsVqraNyKLJXDYsFZ/5jl7bLRtO88t7P3xZaAxhb5OdPMXqsSkp1WCieG8jXm1U99+blvLlXzPCS+M93VnJCiK+09LfaSaBAVBomyDgJua8dfUzR7ga34IvR2Nvj+A9heJ6lsl1KG4NkI1032Cnff1m1wof2B9oHJK4bi6JkEdSqeNeiuo6QoZZincoc73/TH9SXF8sCE7XyuYyW8WSgbGFCjPV0ihLKhdPs08Tx82fYAkLLc4I2wdl4apY7GU5lHRFzRWJep7Ww3wbeA3qmd59/86P4xuNaqDpygXt6M85glSBHOCGgJDnt+pN9bK7HApMguX6+06RZNjzVmcZJ+wcUrJ9//bpRNxNuKpNl9uFds+S9tdx7LaM5ZkIrPj6nIU9mnbFtVbs9s/uLgl8MVczAwet+iOEzzBlYW7RCMgE6gyNLeq6+1tIx4dpgZnd0DksJS5f+JNDpwwcPNXaaVspq1fbQajOrJgK0ofKtJ1Ne90L6VO4MOl5S886p7u6xo7OLjG8TGL+HU1JXGJgppg4nNbNJ5nlzSpuPYy21JUEcUA94PoFiZfjZue+QnyQ80ekOuZVkxx4g+cvhJfHgNl4hy1/a6+RKcKlar/J29y//EztlbVPHVUeQ1zX86eQVAjR/M3dA9w4W8LfaXp4EgM85wOWasli837PzVMOnsLzR+k3o75/lRPAJSE1xAKQzEi5v10ke+VBvRt1cwQRMd+U5mLCTGVd6XiZtgBG5cDi0w22GKcVNvHiu5LQbZEDVtz0onn7k5+heuKXVsZtSzilkLRAUmjMXEMB3J9YC50XBxPiz53SC+EhnPl9WsKCv92SM/OFFIMJZYfl0WW8tIO3UxYcwdMAj7FSmgrsZ2aAZO03BOhP1bNNZItyXYQFTpC3SG1VuPDqH9GkiCDmE+JwxyIVSO5siDErAOpEXFgjy6PQtOVDj+s6e1r8heWVvmZnTciuf4EiNZzCAd7SOMhXERIOlsHIMG399i9aLTy3m2hRLZjJVDNLS53iGIK11dPqQt0zBDyg6qc7YqkDm2M5Ve6dCWCaCbTXX2rToaIgz6+zh4lYUi/+6nqcFMAkQJKHYLK0wYk5N9szV6xihDbDDFr45lN1K4aCXBq/FitPSud9gLt5ZVn+ZqGX7cwm2z5EGMgfFpIFyhGGuDPmso6TItTMwny+7uPnLCf4W6goFQFV0oQSsc9VfMmVLcLr6ZetDZbaSFTLqnSO/bIPjA3/zAUoqgGFAEQS4IhuMzEp2I3jJzbzkk/IEmyax+rhZTwd6f+CGtwPixu8IvzACquPWPREu9ZvGkUzpRwvRRuaNN6cr0W1wWits9ICdYJ7ltbgMiSL3sTPeufgNcVqMVWFkCPDH4jG2jA0XcVgQj62Cb29v9f/z/+2KbYvIv/zzjpQAPkliaVDzNrW57TZ/ZOyZD0nlfMmAIBIAGAI0D3k/mdN4xr9v85ZbZbbqfH2jGd5hUqNZWwl5SPfoGmfElmazUIeNL1j/mkF7VNAzTq4jNt8JoQ11NQOcmhprXoxSxfRGJ9LDEOAQ+dmxAQH90iti9e2u/MoeuaGcDTHoC+xsmEeWmxEKefQuIzHbpw5Tc5cEocboAD09oipWQhtTO1wivf/O+DRe2rpl/E9wlrzBorjJsOeG1B/XPW4EaJEFdNlECEZga5ZoGRHXgYouGRuVkm8tDESiEyFNo+3s5M5puSdTyUL2llnINVHEt91XUNW4ewdMgJ4boJfEyt/iY5WXqbA+A2Fkt5Z0lutiWhe9nZIyIUjyXDC3UsaG1t+eNx6z4W/OYoTB7A6x+dNSTOi9AInctbESqm5gvOLww7OWXPrmHwVZasrl4eD113pm+JtT7JVOvnCXqdzzdTRHgJ0PiGTFYW5Gvt9R9LD6Lzfs0v/TZZHSmyVNq7viIHE6DBK7Qp07Iz55EM8SYtQvZf/obBniTWi5C2/ovHfw4VndkE5XYdjOhCMRjDeOEfXeN/CwfGduiUIfsoFeUxXeQXba7c7972XNv8w+dTjjUM0QeNAReW+J014dKAD/McQYXT7c0GQPIkn3Ll6R7gGjuiQoZD0TEeEqQpKoZ15g/0OPQI17QiSv9AUROa/V/TQN3dvLArec3RrsYlvBm1b8LWzltdugsC50lNKYLEp2a+ZZYqPejULRlOJh5zj/LVMyTDvwKhMxxwuDkxJ1QpoNI0OTWLom4Z71SNzI9TV1iXJrIu9Wcnd+MCaAw8o1jSXd94YU/1gnkrC9BUEOtQvEIQ7g0i6h+KL2JKk8Ydl7HruvgWMSAmNe+LshGhV4qnWHhO9/RIPQzY1tHRj2VqOyNsDpK0cww+56AdDC4gsWwY0XxoucIWIqs/GcwnWqlaT0KPr8mbK5U94/301i1WLt4YINTVvCFBrFZbIbY8eycOdeJ2teD5IfPLCRg7jjcFTwlMFNl9zdh/o3E/hHPwj7BWg0MU09pPrBLbrCgm54A6H+I6v27+jL5gkjWg/iYdks9jbfVP5y/n0dlgWEMlKasl7JvFZd56LfybW1eeaVO0gxTfXZwD8G4SI116yx7UKVRgui6Ya1YpixqXeNLc8IxtAwCU5IhwQgn+NqHnRaDv61CxKhOq4pOX7M6pkA+Pmpd4j1vn6ACUALoLLc4vpXci8VidLxzm7qFBe7s+quuJs6ETYmnpgS3LwSZxPIltgBDXz8M1k/W2ySNv2f9/NPhxLGK2D21dkHeSGmenRT3Yqcdl0m/h3OYr8V+lXNYGf8aCCpd4bWjE4QIPj7vUKN4Nrfs7ML6Y2OyS830JCnofg/k7lpFpt4SqZc5HGg1HCOrHvOdC8bP6FGDbE/VV0mX4IakzbdS/op+Kt3G24/8QbBV7y86sGSQ/vZzU8FXs7u6jIvwchsEP2BpIhW3G8uWNwa3HmjfH/ZjhhCWvluAcF+nMf14ClKg5hGgtPLJ98ueNAkc5Hs2WZlk2QHvfreCK1CCGO6nMZVSb99VM/ajr8WHTte9JSmkXq/i/U943HEbdzW6Re/S88dKgg8pGOLlAeNiqrcLkUR3/aClFpMXcOUP3rmETcWSfMXZE3TUOi8i+fqRnTYLflVx/Vb/6GJ7eIRZUA6k3RYR3iFSK9c4iDdNwJuZL2FKz/IK5VimcNWEqdXjSoxSgmF0UPlDoUlNrPcM7ftmA8Y9gKiqKEHuWN+AZRIwtVSxye2Kf8rM3lhJ5XcBXU9n4v0Oy1RU2M+4qM8AQPVwse8ErNSob5oFPWxuqZnVzo1qB/IBxkM3EVUKFUUlO3e51259GgNcJbCmlvrdjtoTW7rChm1wyCKzpCTwozUUEOIcWLneRLgMXh+SjGSFkAllzbGS5HK7LlfCMRNRDSvbQPjcXaenNYxCvu2Qyznz6StuxVj66SgI0T8B6/sfHAJYZaZ78thjOSIFumNWLQbeZixDCCC+v0YBtkxiBB3jefHqZ/dFHU+crbj6OvS1x/JDD7vlm7zOVPwpUC01nhxZuY/63E7g";const fE=44032,yM=4352,vM=4449,wM=4519,LTe=19,DTe=21,zS=28,CM=DTe*zS,Zwt=LTe*CM,Jwt=fE+Zwt,e3t=yM+LTe,t3t=vM+DTe,n3t=wM+zS;function mj(e){return e>>24&255}function BTe(e){return e&16777215}let IJ,I0e,PJ,QF;function r3t(){let e=PTe(Qwt);IJ=new Map(FTe(e).flatMap((t,n)=>t.map(r=>[r,n+1<<24]))),I0e=new Set(uE(e)),PJ=new Map,QF=new Map;for(let[t,n]of OTe(e)){if(!I0e.has(t)&&n.length==2){let[r,s]=n,a=QF.get(r);a||(a=new Map,QF.set(r,a)),a.set(s,t)}PJ.set(t,n.reverse())}}function $Te(e){return e>=fE&&e<Jwt}function s3t(e,t){if(e>=yM&&e<e3t&&t>=vM&&t<t3t)return fE+(e-yM)*CM+(t-vM)*zS;if($Te(e)&&t>wM&&t<n3t&&(e-fE)%zS==0)return e+(t-wM);{let n=QF.get(e);return n&&(n=n.get(t),n)?n:-1}}function UTe(e){IJ||r3t();let t=[],n=[],r=!1;function s(a){let o=IJ.get(a);o&&(r=!0,a|=o),t.push(a)}for(let a of e)for(;;){if(a<128)t.push(a);else if($Te(a)){let o=a-fE,l=o/CM|0,c=o%CM/zS|0,u=o%zS;s(yM+l),s(vM+c),u>0&&s(wM+u)}else{let o=PJ.get(a);o?n.push(...o):s(a)}if(!n.length)break;a=n.pop()}if(r&&t.length>1){let a=mj(t[0]);for(let o=1;o<t.length;o++){let l=mj(t[o]);if(l==0||a<=l){a=l;continue}let c=o-1;for(;;){let u=t[c+1];if(t[c+1]=t[c],t[c]=u,!c||(a=mj(t[--c]),a<=l))break}a=mj(t[o])}}return t}function i3t(e){let t=[],n=[],r=-1,s=0;for(let a of e){let o=mj(a),l=BTe(a);if(r==-1)o==0?r=l:t.push(l);else if(s>0&&s>=o)o==0?(t.push(r,...n),n.length=0,r=l):n.push(l),s=o;else{let c=s3t(r,l);c>=0?r=c:s==0&&o==0?(t.push(r),r=l):(n.push(l),s=o)}}return r>=0&&t.push(r,...n),t}function zTe(e){return UTe(e).map(BTe)}function a3t(e){return i3t(UTe(e))}const P0e=45,HTe=".",VTe=65039,WTe=1,SM=e=>Array.from(e);function hE(e,t){return e.P.has(t)||e.Q.has(t)}let o3t=class extends Array{get is_emoji(){return!0}},FJ,qTe,Kv,OJ,GTe,s4,BH,bC,Nv,F0e,MJ;function bae(){if(FJ)return;let e=PTe(Bwt);const t=()=>uE(e),n=()=>new Set(t()),r=(d,f)=>f.forEach(x=>d.add(x));FJ=new Map(OTe(e)),qTe=n(),Kv=t(),OJ=new Set(t().map(d=>Kv[d])),Kv=new Set(Kv),GTe=n(),n();let s=FTe(e),a=e();const o=()=>{let d=new Set;return t().forEach(f=>r(d,s[f])),r(d,t()),d};s4=dE(d=>{let f=dE(e).map(x=>x+96);if(f.length){let x=d>=a;f[0]-=32,f=US(f),x&&(f=`Restricted[${f}]`);let g=o(),v=o(),w=!e();return{N:f,P:g,Q:v,M:w,R:x}}}),BH=n(),bC=new Map;let l=t().concat(SM(BH)).sort((d,f)=>d-f);l.forEach((d,f)=>{let x=e(),g=l[f]=x?l[f-x]:{V:[],M:new Map};g.V.push(d),BH.has(d)||bC.set(d,g)});for(let{V:d,M:f}of new Set(bC.values())){let x=[];for(let v of d){let w=s4.filter(N=>hE(N,v)),C=x.find(({G:N})=>w.some(P=>N.has(P)));C||(C={G:new Set,V:[]},x.push(C)),C.V.push(v),r(C.G,w)}let g=x.flatMap(v=>SM(v.G));for(let{G:v,V:w}of x){let C=new Set(g.filter(N=>!v.has(N)));for(let N of w)f.set(N,C)}}Nv=new Set;let c=new Set;const u=d=>Nv.has(d)?c.add(d):Nv.add(d);for(let d of s4){for(let f of d.P)u(f);for(let f of d.Q)u(f)}for(let d of Nv)!bC.has(d)&&!c.has(d)&&bC.set(d,WTe);r(Nv,zTe(Nv)),F0e=Gwt(e).map(d=>o3t.from(d)).sort(Xwt),MJ=new Map;for(let d of F0e){let f=[MJ];for(let x of d){let g=f.map(v=>{let w=v.get(x);return w||(w=new Map,v.set(x,w)),w});x===VTe?f.push(...g):f=g}for(let x of f)x.V=d}}function yae(e){return(KTe(e)?"":`${vae(UB([e]))} `)+RTe(e)}function vae(e){return`"${e}"`}function l3t(e){if(e.length>=4&&e[2]==P0e&&e[3]==P0e)throw new Error(`invalid label extension: "${US(e.slice(0,4))}"`)}function c3t(e){for(let n=e.lastIndexOf(95);n>0;)if(e[--n]!==95)throw new Error("underscore allowed only at start")}function u3t(e){let t=e[0],n=k0e.get(t);if(n)throw Vj(`leading ${n}`);let r=e.length,s=-1;for(let a=1;a<r;a++){t=e[a];let o=k0e.get(t);if(o){if(s==a)throw Vj(`${n} + ${o}`);s=a+1,n=o}}if(s==r)throw Vj(`trailing ${n}`)}function UB(e,t=1/0,n=RTe){let r=[];d3t(e[0])&&r.push("◌"),e.length>t&&(t>>=1,e=[...e.slice(0,t),8230,...e.slice(-t)]);let s=0,a=e.length;for(let o=0;o<a;o++){let l=e[o];KTe(l)&&(r.push(US(e.slice(s,o))),r.push(n(l)),s=o+1)}return r.push(US(e.slice(s,a))),r.join("")}function d3t(e){return bae(),Kv.has(e)}function KTe(e){return bae(),GTe.has(e)}function f3t(e){return x3t(h3t(e,a3t,y3t))}function h3t(e,t,n){if(!e)return[];bae();let r=0;return e.split(HTe).map(s=>{let a=Ywt(s),o={input:a,offset:r};r+=a.length+1;try{let l=o.tokens=b3t(a,t,n),c=l.length,u;if(!c)throw new Error("empty label");let d=o.output=l.flat();if(c3t(d),!(o.emoji=c>1||l[0].is_emoji)&&d.every(x=>x<128))l3t(d),u="ASCII";else{let x=l.flatMap(g=>g.is_emoji?[]:g);if(!x.length)u="Emoji";else{if(Kv.has(d[0]))throw Vj("leading combining mark");for(let w=1;w<c;w++){let C=l[w];if(!C.is_emoji&&Kv.has(C[0]))throw Vj(`emoji + combining mark: "${US(l[w-1])} + ${UB([C[0]])}"`)}u3t(d);let g=SM(new Set(x)),[v]=m3t(g);g3t(v,x),p3t(v,g),u=v.N}}o.type=u}catch(l){o.error=l}return o})}function p3t(e,t){let n,r=[];for(let s of t){let a=bC.get(s);if(a===WTe)return;if(a){let o=a.M.get(s);if(n=n?n.filter(l=>o.has(l)):SM(o),!n.length)return}else r.push(s)}if(n){for(let s of n)if(r.every(a=>hE(s,a)))throw new Error(`whole-script confusable: ${e.N}/${s.N}`)}}function m3t(e){let t=s4;for(let n of e){let r=t.filter(s=>hE(s,n));if(!r.length)throw s4.some(s=>hE(s,n))?XTe(t[0],n):YTe(n);if(t=r,r.length==1)break}return t}function x3t(e){return e.map(({input:t,error:n,output:r})=>{if(n){let s=n.message;throw new Error(e.length==1?s:`Invalid label ${vae(UB(t,63))}: ${s}`)}return US(r)}).join(HTe)}function YTe(e){return new Error(`disallowed character: ${yae(e)}`)}function XTe(e,t){let n=yae(t),r=s4.find(s=>s.P.has(t));return r&&(n=`${r.N} ${n}`),new Error(`illegal mixture: ${e.N} + ${n}`)}function Vj(e){return new Error(`illegal placement: ${e}`)}function g3t(e,t){for(let n of t)if(!hE(e,n))throw XTe(e,n);if(e.M){let n=zTe(t);for(let r=1,s=n.length;r<s;r++)if(OJ.has(n[r])){let a=r+1;for(let o;a<s&&OJ.has(o=n[a]);a++)for(let l=r;l<a;l++)if(n[l]==o)throw new Error(`duplicate non-spacing marks: ${yae(o)}`);if(a-r>T0e)throw new Error(`excessive non-spacing marks: ${vae(UB(n.slice(r-1,a)))} (${a-r}/${T0e})`);r=a}}}function b3t(e,t,n){let r=[],s=[];for(e=e.slice().reverse();e.length;){let a=v3t(e);if(a)s.length&&(r.push(t(s)),s=[]),r.push(n(a));else{let o=e.pop();if(Nv.has(o))s.push(o);else{let l=FJ.get(o);if(l)s.push(...l);else if(!qTe.has(o))throw YTe(o)}}}return s.length&&r.push(t(s)),r}function y3t(e){return e.filter(t=>t!=VTe)}function v3t(e,t){let n=MJ,r,s=e.length;for(;s&&(n=n.get(e[--s]),!!n);){let{V:a}=n;a&&(r=a,e.length=s)}return r}const QTe=new Uint8Array(32);QTe.fill(0);function O0e(e){return bn(e.length!==0,"invalid ENS name; empty component","comp",e),e}function ZTe(e){const t=ud(w3t(e)),n=[];if(e.length===0)return n;let r=0;for(let s=0;s<t.length;s++)t[s]===46&&(n.push(O0e(t.slice(r,s))),r=s+1);return bn(r<t.length,"invalid ENS name; empty component","name",e),n.push(O0e(t.slice(r))),n}function w3t(e){try{if(e.length===0)throw new Error("empty label");return f3t(e)}catch(t){bn(!1,`invalid ENS name (${t.message})`,"name",e)}}function RJ(e){bn(typeof e=="string","invalid ENS name; not a string","name",e),bn(e.length,"invalid ENS name (empty label)","name",e);let t=QTe;const n=ZTe(e);for(;n.length;)t=lo(Ra([t,lo(n.pop())]));return Kr(t)}function C3t(e,t){const n=t;return bn(n<=255,"DNS encoded label cannot exceed 255","length",n),Kr(Ra(ZTe(e).map(r=>{bn(r.length<=n,`label ${JSON.stringify(e)} exceeds ${n} bytes`,"name",e);const s=new Uint8Array(r.length+1);return s.set(r,1),s[0]=s.length-1,s})))+"00"}function S3t(e){return typeof e=="string"&&(e=ud(e)),lo(Ra([ud(Zvt),ud(String(e.length)),e]))}const JTe=new Uint8Array(32);JTe.fill(0);const N3t=BigInt(-1),eIe=BigInt(0),tIe=BigInt(1),A3t=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function j3t(e){const t=hs(e),n=t.length%32;return n?Ra([t,JTe.slice(n)]):Kr(t)}const E3t=o1(tIe,32),_3t=o1(eIe,32),M0e={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},$H=["name","version","chainId","verifyingContract","salt"];function R0e(e){return function(t){return bn(typeof t=="string",`invalid domain value for ${JSON.stringify(e)}`,`domain.${e}`,t),t}}const k3t={name:R0e("name"),version:R0e("version"),chainId:function(e){const t=js(e,"domain.chainId");return bn(t>=0,"invalid chain ID","domain.chainId",e),Number.isSafeInteger(t)?Number(t):em(t)},verifyingContract:function(e){try{return na(e).toLowerCase()}catch{}bn(!1,'invalid domain value "verifyingContract"',"domain.verifyingContract",e)},salt:function(e){const t=hs(e,"domain.salt");return bn(t.length===32,'invalid domain value "salt"',"domain.salt",e),Kr(t)}};function UH(e){{const t=e.match(/^(u?)int(\d+)$/);if(t){const n=t[1]==="",r=parseInt(t[2]);bn(r%8===0&&r!==0&&r<=256&&t[2]===String(r),"invalid numeric width","type",e);const s=hj(A3t,n?r-1:r),a=n?(s+tIe)*N3t:eIe;return function(o){const l=js(o,"value");return bn(l>=a&&l<=s,`value out-of-bounds for ${e}`,"value",l),o1(n?bke(l,256):l,32)}}}{const t=e.match(/^bytes(\d+)$/);if(t){const n=parseInt(t[1]);return bn(n!==0&&n<=32&&t[1]===String(n),"invalid bytes width","type",e),function(r){const s=hs(r);return bn(s.length===n,`invalid length for ${e}`,"value",r),j3t(r)}}}switch(e){case"address":return function(t){return a1(na(t),32)};case"bool":return function(t){return t?E3t:_3t};case"bytes":return function(t){return lo(t)};case"string":return function(t){return c1(t)}}return null}function L0e(e,t){return`${e}(${t.map(({name:n,type:r})=>r+" "+n).join(",")})`}function tP(e){const t=e.match(/^([^\x5b]*)((\x5b\d*\x5d)*)(\x5b(\d*)\x5d)$/);return t?{base:t[1],index:t[2]+t[4],array:{base:t[1],prefix:t[1]+t[2],count:t[5]?parseInt(t[5]):-1}}:{base:e}}var tk,wg,nS,dD,nIe;const Ph=class Ph{constructor(t){Rn(this,dD);Un(this,"primaryType");Rn(this,tk);Rn(this,wg);Rn(this,nS);Wt(this,wg,new Map),Wt(this,nS,new Map);const n=new Map,r=new Map,s=new Map,a={};Object.keys(t).forEach(c=>{a[c]=t[c].map(({name:u,type:d})=>{let{base:f,index:x}=tP(d);return f==="int"&&!t.int&&(f="int256"),f==="uint"&&!t.uint&&(f="uint256"),{name:u,type:f+(x||"")}}),n.set(c,new Set),r.set(c,[]),s.set(c,new Set)}),Wt(this,tk,JSON.stringify(a));for(const c in a){const u=new Set;for(const d of a[c]){bn(!u.has(d.name),`duplicate variable name ${JSON.stringify(d.name)} in ${JSON.stringify(c)}`,"types",t),u.add(d.name);const f=tP(d.type).base;bn(f!==c,`circular type reference to ${JSON.stringify(f)}`,"types",t),!UH(f)&&(bn(r.has(f),`unknown type ${JSON.stringify(f)}`,"types",t),r.get(f).push(c),n.get(c).add(f))}}const o=Array.from(r.keys()).filter(c=>r.get(c).length===0);bn(o.length!==0,"missing primary type","types",t),bn(o.length===1,`ambiguous primary types or unused types: ${o.map(c=>JSON.stringify(c)).join(", ")}`,"types",t),Ds(this,{primaryType:o[0]});function l(c,u){bn(!u.has(c),`circular type reference to ${JSON.stringify(c)}`,"types",t),u.add(c);for(const d of n.get(c))if(r.has(d)){l(d,u);for(const f of u)s.get(f).add(d)}u.delete(c)}l(this.primaryType,new Set);for(const[c,u]of s){const d=Array.from(u);d.sort(),ze(this,wg).set(c,L0e(c,a[c])+d.map(f=>L0e(f,a[f])).join(""))}}get types(){return JSON.parse(ze(this,tk))}getEncoder(t){let n=ze(this,nS).get(t);return n||(n=vr(this,dD,nIe).call(this,t),ze(this,nS).set(t,n)),n}encodeType(t){const n=ze(this,wg).get(t);return bn(n,`unknown type: ${JSON.stringify(t)}`,"name",t),n}encodeData(t,n){return this.getEncoder(t)(n)}hashStruct(t,n){return lo(this.encodeData(t,n))}encode(t){return this.encodeData(this.primaryType,t)}hash(t){return this.hashStruct(this.primaryType,t)}_visit(t,n,r){if(UH(t))return r(t,n);const s=tP(t).array;if(s)return bn(s.count===-1||s.count===n.length,`array length mismatch; expected length ${s.count}`,"value",n),n.map(o=>this._visit(s.prefix,o,r));const a=this.types[t];if(a)return a.reduce((o,{name:l,type:c})=>(o[l]=this._visit(c,n[l],r),o),{});bn(!1,`unknown type: ${t}`,"type",t)}visit(t,n){return this._visit(this.primaryType,t,n)}static from(t){return new Ph(t)}static getPrimaryType(t){return Ph.from(t).primaryType}static hashStruct(t,n,r){return Ph.from(n).hashStruct(t,r)}static hashDomain(t){const n=[];for(const r in t){if(t[r]==null)continue;const s=M0e[r];bn(s,`invalid typed-data domain key: ${JSON.stringify(r)}`,"domain",t),n.push({name:r,type:s})}return n.sort((r,s)=>$H.indexOf(r.name)-$H.indexOf(s.name)),Ph.hashStruct("EIP712Domain",{EIP712Domain:n},t)}static encode(t,n,r){return Ra(["0x1901",Ph.hashDomain(t),Ph.from(n).hash(r)])}static hash(t,n,r){return lo(Ph.encode(t,n,r))}static async resolveNames(t,n,r,s){t=Object.assign({},t);for(const l in t)t[l]==null&&delete t[l];const a={};t.verifyingContract&&!co(t.verifyingContract,20)&&(a[t.verifyingContract]="0x");const o=Ph.from(n);o.visit(r,(l,c)=>(l==="address"&&!co(c,20)&&(a[c]="0x"),c));for(const l in a)a[l]=await s(l);return t.verifyingContract&&a[t.verifyingContract]&&(t.verifyingContract=a[t.verifyingContract]),r=o.visit(r,(l,c)=>l==="address"&&a[c]?a[c]:c),{domain:t,value:r}}static getPayload(t,n,r){Ph.hashDomain(t);const s={},a=[];$H.forEach(c=>{const u=t[c];u!=null&&(s[c]=k3t[c](u),a.push({name:c,type:M0e[c]}))});const o=Ph.from(n);n=o.types;const l=Object.assign({},n);return bn(l.EIP712Domain==null,"types must not contain EIP712Domain type","types.EIP712Domain",n),l.EIP712Domain=a,o.encode(r),{types:l,domain:s,primaryType:o.primaryType,message:o.visit(r,(c,u)=>{if(c.match(/^bytes(\d*)/))return Kr(hs(u));if(c.match(/^u?int/))return js(u).toString();switch(c){case"address":return u.toLowerCase();case"bool":return!!u;case"string":return bn(typeof u=="string","invalid string","value",u),u}bn(!1,"unsupported type","type",c)})}}};tk=new WeakMap,wg=new WeakMap,nS=new WeakMap,dD=new WeakSet,nIe=function(t){{const s=UH(t);if(s)return s}const n=tP(t).array;if(n){const s=n.prefix,a=this.getEncoder(s);return o=>{bn(n.count===-1||n.count===o.length,`array length mismatch; expected length ${n.count}`,"value",o);let l=o.map(a);return ze(this,wg).has(s)&&(l=l.map(lo)),lo(Ra(l))}}const r=this.types[t];if(r){const s=c1(ze(this,wg).get(t));return a=>{const o=r.map(({name:l,type:c})=>{const u=this.getEncoder(c)(a[l]);return ze(this,wg).has(c)?lo(u):u});return o.unshift(s),Ra(o)}}bn(!1,`unknown type: ${t}`,"type",t)};let HS=Ph;function ad(e){const t=new Set;return e.forEach(n=>t.add(n)),Object.freeze(t)}const T3t="external public payable override",I3t=ad(T3t.split(" ")),rIe="constant external internal payable private public pure view override",P3t=ad(rIe.split(" ")),sIe="constructor error event fallback function receive struct",iIe=ad(sIe.split(" ")),aIe="calldata memory storage payable indexed",F3t=ad(aIe.split(" ")),O3t="tuple returns",M3t=[sIe,aIe,O3t,rIe].join(" "),R3t=ad(M3t.split(" ")),L3t={"(":"OPEN_PAREN",")":"CLOSE_PAREN","[":"OPEN_BRACKET","]":"CLOSE_BRACKET",",":"COMMA","@":"AT"},D3t=new RegExp("^(\\s*)"),B3t=new RegExp("^([0-9]+)"),$3t=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)"),oIe=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)$"),lIe=new RegExp("^(address|bool|bytes([0-9]*)|string|u?int([0-9]*))$");var Wc,qp,nk,LJ;const fD=class fD{constructor(t){Rn(this,nk);Rn(this,Wc);Rn(this,qp);Wt(this,Wc,0),Wt(this,qp,t.slice())}get offset(){return ze(this,Wc)}get length(){return ze(this,qp).length-ze(this,Wc)}clone(){return new fD(ze(this,qp))}reset(){Wt(this,Wc,0)}popKeyword(t){const n=this.peek();if(n.type!=="KEYWORD"||!t.has(n.text))throw new Error(`expected keyword ${n.text}`);return this.pop().text}popType(t){if(this.peek().type!==t){const n=this.peek();throw new Error(`expected ${t}; got ${n.type} ${JSON.stringify(n.text)}`)}return this.pop().text}popParen(){const t=this.peek();if(t.type!=="OPEN_PAREN")throw new Error("bad start");const n=vr(this,nk,LJ).call(this,ze(this,Wc)+1,t.match+1);return Wt(this,Wc,t.match+1),n}popParams(){const t=this.peek();if(t.type!=="OPEN_PAREN")throw new Error("bad start");const n=[];for(;ze(this,Wc)<t.match-1;){const r=this.peek().linkNext;n.push(vr(this,nk,LJ).call(this,ze(this,Wc)+1,r)),Wt(this,Wc,r)}return Wt(this,Wc,t.match+1),n}peek(){if(ze(this,Wc)>=ze(this,qp).length)throw new Error("out-of-bounds");return ze(this,qp)[ze(this,Wc)]}peekKeyword(t){const n=this.peekType("KEYWORD");return n!=null&&t.has(n)?n:null}peekType(t){if(this.length===0)return null;const n=this.peek();return n.type===t?n.text:null}pop(){const t=this.peek();return ib(this,Wc)._++,t}toString(){const t=[];for(let n=ze(this,Wc);n<ze(this,qp).length;n++){const r=ze(this,qp)[n];t.push(`${r.type}:${r.text}`)}return`<TokenString ${t.join(" ")}>`}};Wc=new WeakMap,qp=new WeakMap,nk=new WeakSet,LJ=function(t=0,n=0){return new fD(ze(this,qp).slice(t,n).map(r=>Object.freeze(Object.assign({},r,{match:r.match-t,linkBack:r.linkBack-t,linkNext:r.linkNext-t}))))};let bm=fD;function o2(e){const t=[],n=o=>{const l=a<e.length?JSON.stringify(e[a]):"$EOI";throw new Error(`invalid token ${l} at ${a}: ${o}`)};let r=[],s=[],a=0;for(;a<e.length;){let o=e.substring(a),l=o.match(D3t);l&&(a+=l[1].length,o=e.substring(a));const c={depth:r.length,linkBack:-1,linkNext:-1,match:-1,type:"",text:"",offset:a,value:-1};t.push(c);let u=L3t[o[0]]||"";if(u){if(c.type=u,c.text=o[0],a++,u==="OPEN_PAREN")r.push(t.length-1),s.push(t.length-1);else if(u=="CLOSE_PAREN")r.length===0&&n("no matching open bracket"),c.match=r.pop(),t[c.match].match=t.length-1,c.depth--,c.linkBack=s.pop(),t[c.linkBack].linkNext=t.length-1;else if(u==="COMMA")c.linkBack=s.pop(),t[c.linkBack].linkNext=t.length-1,s.push(t.length-1);else if(u==="OPEN_BRACKET")c.type="BRACKET";else if(u==="CLOSE_BRACKET"){let d=t.pop().text;if(t.length>0&&t[t.length-1].type==="NUMBER"){const f=t.pop().text;d=f+d,t[t.length-1].value=Di(f)}if(t.length===0||t[t.length-1].type!=="BRACKET")throw new Error("missing opening bracket");t[t.length-1].text+=d}continue}if(l=o.match($3t),l){if(c.text=l[1],a+=c.text.length,R3t.has(c.text)){c.type="KEYWORD";continue}if(c.text.match(lIe)){c.type="TYPE";continue}c.type="ID";continue}if(l=o.match(B3t),l){c.text=l[1],c.type="NUMBER",a+=c.text.length;continue}throw new Error(`unexpected token ${JSON.stringify(o[0])} at position ${a}`)}return new bm(t.map(o=>Object.freeze(o)))}function D0e(e,t){let n=[];for(const r in t.keys())e.has(r)&&n.push(r);if(n.length>1)throw new Error(`conflicting types: ${n.join(", ")}`)}function zB(e,t){if(t.peekKeyword(iIe)){const n=t.pop().text;if(n!==e)throw new Error(`expected ${e}, got ${n}`)}return t.popType("ID")}function u1(e,t){const n=new Set;for(;;){const r=e.peekType("KEYWORD");if(r==null||t&&!t.has(r))break;if(e.pop(),n.has(r))throw new Error(`duplicate keywords: ${JSON.stringify(r)}`);n.add(r)}return Object.freeze(n)}function cIe(e){let t=u1(e,P3t);return D0e(t,ad("constant payable nonpayable".split(" "))),D0e(t,ad("pure view payable nonpayable".split(" "))),t.has("view")?"view":t.has("pure")?"pure":t.has("payable")?"payable":t.has("nonpayable")?"nonpayable":t.has("constant")?"view":"nonpayable"}function qg(e,t){return e.popParams().map(n=>ru.from(n,t))}function uIe(e){if(e.peekType("AT")){if(e.pop(),e.peekType("NUMBER"))return js(e.pop().text);throw new Error("invalid gas")}return null}function E3(e){if(e.length)throw new Error(`unexpected tokens at offset ${e.offset}: ${e.toString()}`)}const U3t=new RegExp(/^(.*)\[([0-9]*)\]$/);function B0e(e){const t=e.match(lIe);if(bn(t,"invalid type","type",e),e==="uint")return"uint256";if(e==="int")return"int256";if(t[2]){const n=parseInt(t[2]);bn(n!==0&&n<=32,"invalid bytes length","type",e)}else if(t[3]){const n=parseInt(t[3]);bn(n!==0&&n<=256&&n%8===0,"invalid numeric width","type",e)}return e}const $o={},lf=Symbol.for("_ethers_internal"),$0e="_ParamTypeInternal",U0e="_ErrorInternal",z0e="_EventInternal",H0e="_ConstructorInternal",V0e="_FallbackInternal",W0e="_FunctionInternal",q0e="_StructInternal";var rS,ZF;const Fh=class Fh{constructor(t,n,r,s,a,o,l,c){Rn(this,rS);Un(this,"name");Un(this,"type");Un(this,"baseType");Un(this,"indexed");Un(this,"components");Un(this,"arrayLength");Un(this,"arrayChildren");if(c5(t,$o,"ParamType"),Object.defineProperty(this,lf,{value:$0e}),o&&(o=Object.freeze(o.slice())),s==="array"){if(l==null||c==null)throw new Error("")}else if(l!=null||c!=null)throw new Error("");if(s==="tuple"){if(o==null)throw new Error("")}else if(o!=null)throw new Error("");Ds(this,{name:n,type:r,baseType:s,indexed:a,components:o,arrayLength:l,arrayChildren:c})}format(t){if(t==null&&(t="sighash"),t==="json"){const r=this.name||"";if(this.isArray()){const a=JSON.parse(this.arrayChildren.format("json"));return a.name=r,a.type+=`[${this.arrayLength<0?"":String(this.arrayLength)}]`,JSON.stringify(a)}const s={type:this.baseType==="tuple"?"tuple":this.type,name:r};return typeof this.indexed=="boolean"&&(s.indexed=this.indexed),this.isTuple()&&(s.components=this.components.map(a=>JSON.parse(a.format(t)))),JSON.stringify(s)}let n="";return this.isArray()?(n+=this.arrayChildren.format(t),n+=`[${this.arrayLength<0?"":String(this.arrayLength)}]`):this.isTuple()?n+="("+this.components.map(r=>r.format(t)).join(t==="full"?", ":",")+")":n+=this.type,t!=="sighash"&&(this.indexed===!0&&(n+=" indexed"),t==="full"&&this.name&&(n+=" "+this.name)),n}isArray(){return this.baseType==="array"}isTuple(){return this.baseType==="tuple"}isIndexable(){return this.indexed!=null}walk(t,n){if(this.isArray()){if(!Array.isArray(t))throw new Error("invalid array value");if(this.arrayLength!==-1&&t.length!==this.arrayLength)throw new Error("array is wrong length");const r=this;return t.map(s=>r.arrayChildren.walk(s,n))}if(this.isTuple()){if(!Array.isArray(t))throw new Error("invalid tuple value");if(t.length!==this.components.length)throw new Error("array is wrong length");const r=this;return t.map((s,a)=>r.components[a].walk(s,n))}return n(this.type,t)}async walkAsync(t,n){const r=[],s=[t];return vr(this,rS,ZF).call(this,r,t,n,a=>{s[0]=a}),r.length&&await Promise.all(r),s[0]}static from(t,n){if(Fh.isParamType(t))return t;if(typeof t=="string")try{return Fh.from(o2(t),n)}catch{bn(!1,"invalid param type","obj",t)}else if(t instanceof bm){let l="",c="",u=null;u1(t,ad(["tuple"])).has("tuple")||t.peekType("OPEN_PAREN")?(c="tuple",u=t.popParams().map(w=>Fh.from(w)),l=`tuple(${u.map(w=>w.format()).join(",")})`):(l=B0e(t.popType("TYPE")),c=l);let d=null,f=null;for(;t.length&&t.peekType("BRACKET");){const w=t.pop();d=new Fh($o,"",l,c,null,u,f,d),f=w.value,l+=w.text,c="array",u=null}let x=null;if(u1(t,F3t).has("indexed")){if(!n)throw new Error("");x=!0}const v=t.peekType("ID")?t.pop().text:"";if(t.length)throw new Error("leftover tokens");return new Fh($o,v,l,c,x,u,f,d)}const r=t.name;bn(!r||typeof r=="string"&&r.match(oIe),"invalid name","obj.name",r);let s=t.indexed;s!=null&&(bn(n,"parameter cannot be indexed","obj.indexed",t.indexed),s=!!s);let a=t.type,o=a.match(U3t);if(o){const l=parseInt(o[2]||"-1"),c=Fh.from({type:o[1],components:t.components});return new Fh($o,r||"",a,"array",s,null,l,c)}if(a==="tuple"||a.startsWith("tuple(")||a.startsWith("(")){const l=t.components!=null?t.components.map(u=>Fh.from(u)):null;return new Fh($o,r||"",a,"tuple",s,l,null,null)}return a=B0e(t.type),new Fh($o,r||"",a,a,s,null,null,null)}static isParamType(t){return t&&t[lf]===$0e}};rS=new WeakSet,ZF=function(t,n,r,s){if(this.isArray()){if(!Array.isArray(n))throw new Error("invalid array value");if(this.arrayLength!==-1&&n.length!==this.arrayLength)throw new Error("array is wrong length");const o=this.arrayChildren,l=n.slice();l.forEach((c,u)=>{var d;vr(d=o,rS,ZF).call(d,t,c,r,f=>{l[u]=f})}),s(l);return}if(this.isTuple()){const o=this.components;let l;if(Array.isArray(n))l=n.slice();else{if(n==null||typeof n!="object")throw new Error("invalid tuple value");l=o.map(c=>{if(!c.name)throw new Error("cannot use object value with unnamed components");if(!(c.name in n))throw new Error(`missing value for component ${c.name}`);return n[c.name]})}if(l.length!==this.components.length)throw new Error("array is wrong length");l.forEach((c,u)=>{var d;vr(d=o[u],rS,ZF).call(d,t,c,r,f=>{l[u]=f})}),s(l);return}const a=r(this.type,n);a.then?t.push(async function(){s(await a)}()):s(a)};let ru=Fh;class _3{constructor(t,n,r){Un(this,"type");Un(this,"inputs");c5(t,$o,"Fragment"),r=Object.freeze(r.slice()),Ds(this,{type:n,inputs:r})}static from(t){if(typeof t=="string"){try{_3.from(JSON.parse(t))}catch{}return _3.from(o2(t))}if(t instanceof bm)switch(t.peekKeyword(iIe)){case"constructor":return Rg.from(t);case"error":return Wd.from(t);case"event":return w0.from(t);case"fallback":case"receive":return dg.from(t);case"function":return C0.from(t);case"struct":return Xw.from(t)}else if(typeof t=="object"){switch(t.type){case"constructor":return Rg.from(t);case"error":return Wd.from(t);case"event":return w0.from(t);case"fallback":case"receive":return dg.from(t);case"function":return C0.from(t);case"struct":return Xw.from(t)}Lr(!1,`unsupported type: ${t.type}`,"UNSUPPORTED_OPERATION",{operation:"Fragment.from"})}bn(!1,"unsupported frgament object","obj",t)}static isConstructor(t){return Rg.isFragment(t)}static isError(t){return Wd.isFragment(t)}static isEvent(t){return w0.isFragment(t)}static isFunction(t){return C0.isFragment(t)}static isStruct(t){return Xw.isFragment(t)}}class HB extends _3{constructor(n,r,s,a){super(n,r,a);Un(this,"name");bn(typeof s=="string"&&s.match(oIe),"invalid identifier","name",s),a=Object.freeze(a.slice()),Ds(this,{name:s})}}function pE(e,t){return"("+t.map(n=>n.format(e)).join(e==="full"?", ":",")+")"}class Wd extends HB{constructor(t,n,r){super(t,"error",n,r),Object.defineProperty(this,lf,{value:U0e})}get selector(){return c1(this.format("sighash")).substring(0,10)}format(t){if(t==null&&(t="sighash"),t==="json")return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map(r=>JSON.parse(r.format(t)))});const n=[];return t!=="sighash"&&n.push("error"),n.push(this.name+pE(t,this.inputs)),n.join(" ")}static from(t){if(Wd.isFragment(t))return t;if(typeof t=="string")return Wd.from(o2(t));if(t instanceof bm){const n=zB("error",t),r=qg(t);return E3(t),new Wd($o,n,r)}return new Wd($o,t.name,t.inputs?t.inputs.map(ru.from):[])}static isFragment(t){return t&&t[lf]===U0e}}class w0 extends HB{constructor(n,r,s,a){super(n,"event",r,s);Un(this,"anonymous");Object.defineProperty(this,lf,{value:z0e}),Ds(this,{anonymous:a})}get topicHash(){return c1(this.format("sighash"))}format(n){if(n==null&&(n="sighash"),n==="json")return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map(s=>JSON.parse(s.format(n)))});const r=[];return n!=="sighash"&&r.push("event"),r.push(this.name+pE(n,this.inputs)),n!=="sighash"&&this.anonymous&&r.push("anonymous"),r.join(" ")}static getTopicHash(n,r){return r=(r||[]).map(a=>ru.from(a)),new w0($o,n,r,!1).topicHash}static from(n){if(w0.isFragment(n))return n;if(typeof n=="string")try{return w0.from(o2(n))}catch{bn(!1,"invalid event fragment","obj",n)}else if(n instanceof bm){const r=zB("event",n),s=qg(n,!0),a=!!u1(n,ad(["anonymous"])).has("anonymous");return E3(n),new w0($o,r,s,a)}return new w0($o,n.name,n.inputs?n.inputs.map(r=>ru.from(r,!0)):[],!!n.anonymous)}static isFragment(n){return n&&n[lf]===z0e}}class Rg extends _3{constructor(n,r,s,a,o){super(n,r,s);Un(this,"payable");Un(this,"gas");Object.defineProperty(this,lf,{value:H0e}),Ds(this,{payable:a,gas:o})}format(n){if(Lr(n!=null&&n!=="sighash","cannot format a constructor for sighash","UNSUPPORTED_OPERATION",{operation:"format(sighash)"}),n==="json")return JSON.stringify({type:"constructor",stateMutability:this.payable?"payable":"undefined",payable:this.payable,gas:this.gas!=null?this.gas:void 0,inputs:this.inputs.map(s=>JSON.parse(s.format(n)))});const r=[`constructor${pE(n,this.inputs)}`];return this.payable&&r.push("payable"),this.gas!=null&&r.push(`@${this.gas.toString()}`),r.join(" ")}static from(n){if(Rg.isFragment(n))return n;if(typeof n=="string")try{return Rg.from(o2(n))}catch{bn(!1,"invalid constuctor fragment","obj",n)}else if(n instanceof bm){u1(n,ad(["constructor"]));const r=qg(n),s=!!u1(n,I3t).has("payable"),a=uIe(n);return E3(n),new Rg($o,"constructor",r,s,a)}return new Rg($o,"constructor",n.inputs?n.inputs.map(ru.from):[],!!n.payable,n.gas!=null?n.gas:null)}static isFragment(n){return n&&n[lf]===H0e}}class dg extends _3{constructor(n,r,s){super(n,"fallback",r);Un(this,"payable");Object.defineProperty(this,lf,{value:V0e}),Ds(this,{payable:s})}format(n){const r=this.inputs.length===0?"receive":"fallback";if(n==="json"){const s=this.payable?"payable":"nonpayable";return JSON.stringify({type:r,stateMutability:s})}return`${r}()${this.payable?" payable":""}`}static from(n){if(dg.isFragment(n))return n;if(typeof n=="string")try{return dg.from(o2(n))}catch{bn(!1,"invalid fallback fragment","obj",n)}else if(n instanceof bm){const r=n.toString(),s=n.peekKeyword(ad(["fallback","receive"]));if(bn(s,"type must be fallback or receive","obj",r),n.popKeyword(ad(["fallback","receive"]))==="receive"){const c=qg(n);return bn(c.length===0,"receive cannot have arguments","obj.inputs",c),u1(n,ad(["payable"])),E3(n),new dg($o,[],!0)}let o=qg(n);o.length?bn(o.length===1&&o[0].type==="bytes","invalid fallback inputs","obj.inputs",o.map(c=>c.format("minimal")).join(", ")):o=[ru.from("bytes")];const l=cIe(n);if(bn(l==="nonpayable"||l==="payable","fallback cannot be constants","obj.stateMutability",l),u1(n,ad(["returns"])).has("returns")){const c=qg(n);bn(c.length===1&&c[0].type==="bytes","invalid fallback outputs","obj.outputs",c.map(u=>u.format("minimal")).join(", "))}return E3(n),new dg($o,o,l==="payable")}if(n.type==="receive")return new dg($o,[],!0);if(n.type==="fallback"){const r=[ru.from("bytes")],s=n.stateMutability==="payable";return new dg($o,r,s)}bn(!1,"invalid fallback description","obj",n)}static isFragment(n){return n&&n[lf]===V0e}}class C0 extends HB{constructor(n,r,s,a,o,l){super(n,"function",r,a);Un(this,"constant");Un(this,"outputs");Un(this,"stateMutability");Un(this,"payable");Un(this,"gas");Object.defineProperty(this,lf,{value:W0e}),o=Object.freeze(o.slice()),Ds(this,{constant:s==="view"||s==="pure",gas:l,outputs:o,payable:s==="payable",stateMutability:s})}get selector(){return c1(this.format("sighash")).substring(0,10)}format(n){if(n==null&&(n="sighash"),n==="json")return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:this.stateMutability!=="nonpayable"?this.stateMutability:void 0,payable:this.payable,gas:this.gas!=null?this.gas:void 0,inputs:this.inputs.map(s=>JSON.parse(s.format(n))),outputs:this.outputs.map(s=>JSON.parse(s.format(n)))});const r=[];return n!=="sighash"&&r.push("function"),r.push(this.name+pE(n,this.inputs)),n!=="sighash"&&(this.stateMutability!=="nonpayable"&&r.push(this.stateMutability),this.outputs&&this.outputs.length&&(r.push("returns"),r.push(pE(n,this.outputs))),this.gas!=null&&r.push(`@${this.gas.toString()}`)),r.join(" ")}static getSelector(n,r){return r=(r||[]).map(a=>ru.from(a)),new C0($o,n,"view",r,[],null).selector}static from(n){if(C0.isFragment(n))return n;if(typeof n=="string")try{return C0.from(o2(n))}catch{bn(!1,"invalid function fragment","obj",n)}else if(n instanceof bm){const s=zB("function",n),a=qg(n),o=cIe(n);let l=[];u1(n,ad(["returns"])).has("returns")&&(l=qg(n));const c=uIe(n);return E3(n),new C0($o,s,o,a,l,c)}let r=n.stateMutability;return r==null&&(r="payable",typeof n.constant=="boolean"?(r="view",n.constant||(r="payable",typeof n.payable=="boolean"&&!n.payable&&(r="nonpayable"))):typeof n.payable=="boolean"&&!n.payable&&(r="nonpayable")),new C0($o,n.name,r,n.inputs?n.inputs.map(ru.from):[],n.outputs?n.outputs.map(ru.from):[],n.gas!=null?n.gas:null)}static isFragment(n){return n&&n[lf]===W0e}}class Xw extends HB{constructor(t,n,r){super(t,"struct",n,r),Object.defineProperty(this,lf,{value:q0e})}format(){throw new Error("@TODO")}static from(t){if(typeof t=="string")try{return Xw.from(o2(t))}catch{bn(!1,"invalid struct fragment","obj",t)}else if(t instanceof bm){const n=zB("struct",t),r=qg(t);return E3(t),new Xw($o,n,r)}return new Xw($o,t.name,t.inputs?t.inputs.map(ru.from):[])}static isFragment(t){return t&&t[lf]===q0e}}const jm=new Map;jm.set(0,"GENERIC_PANIC");jm.set(1,"ASSERT_FALSE");jm.set(17,"OVERFLOW");jm.set(18,"DIVIDE_BY_ZERO");jm.set(33,"ENUM_RANGE_ERROR");jm.set(34,"BAD_STORAGE_DATA");jm.set(49,"STACK_UNDERFLOW");jm.set(50,"ARRAY_RANGE_ERROR");jm.set(65,"OUT_OF_MEMORY");jm.set(81,"UNINITIALIZED_FUNCTION_CALL");const z3t=new RegExp(/^bytes([0-9]*)$/),H3t=new RegExp(/^(u?int)([0-9]*)$/);let zH=null,G0e=1024;function V3t(e,t,n,r){let s="missing revert data",a=null;const o=null;let l=null;if(n){s="execution reverted";const u=hs(n);if(n=Kr(n),u.length===0)s+=" (no data present; likely require(false) occurred",a="require(false)";else if(u.length%32!==4)s+=" (could not decode reason; invalid data length)";else if(Kr(u.slice(0,4))==="0x08c379a0")try{a=r.decode(["string"],u.slice(4))[0],l={signature:"Error(string)",name:"Error",args:[a]},s+=`: ${JSON.stringify(a)}`}catch{s+=" (could not decode reason; invalid string data)"}else if(Kr(u.slice(0,4))==="0x4e487b71")try{const d=Number(r.decode(["uint256"],u.slice(4))[0]);l={signature:"Panic(uint256)",name:"Panic",args:[d]},a=`Panic due to ${jm.get(d)||"UNKNOWN"}(${d})`,s+=`: ${a}`}catch{s+=" (could not decode panic code)"}else s+=" (unknown custom error)"}const c={to:t.to?na(t.to):null,data:t.data||"0x"};return t.from&&(c.from=na(t.from)),_o(s,"CALL_EXCEPTION",{action:e,data:n,reason:a,transaction:c,invocation:o,revert:l})}var Zb,yC;const hD=class hD{constructor(){Rn(this,Zb)}getDefaultValue(t){const n=t.map(s=>vr(this,Zb,yC).call(this,ru.from(s)));return new eP(n,"_").defaultValue()}encode(t,n){pke(n.length,t.length,"types/values length mismatch");const r=t.map(o=>vr(this,Zb,yC).call(this,ru.from(o))),s=new eP(r,"_"),a=new SJ;return s.encode(a,n),a.data}decode(t,n,r){const s=t.map(o=>vr(this,Zb,yC).call(this,ru.from(o)));return new eP(s,"_").decode(new NJ(n,r,G0e))}static _setDefaultMaxInflation(t){bn(typeof t=="number"&&Number.isInteger(t),"invalid defaultMaxInflation factor","value",t),G0e=t}static defaultAbiCoder(){return zH==null&&(zH=new hD),zH}static getBuiltinCallException(t,n,r){return V3t(t,n,r,hD.defaultAbiCoder())}};Zb=new WeakSet,yC=function(t){if(t.isArray())return new owt(vr(this,Zb,yC).call(this,t.arrayChildren),t.arrayLength,t.name);if(t.isTuple())return new eP(t.components.map(r=>vr(this,Zb,yC).call(this,r)),t.name);switch(t.baseType){case"address":return new iwt(t.name);case"bool":return new lwt(t.name);case"string":return new gwt(t.name);case"bytes":return new cwt(t.name);case"":return new fwt(t.name)}let n=t.type.match(H3t);if(n){let r=parseInt(n[2]||"256");return bn(r!==0&&r<=256&&r%8===0,"invalid "+n[1]+" bit length","param",t),new xwt(r/8,n[1]==="int",t.name)}if(n=t.type.match(z3t),n){let r=parseInt(n[1]);return bn(r!==0&&r<=32,"invalid bytes length","param",t),new uwt(r,t.name)}bn(!1,"invalid type","type",t.type)};let mE=hD;class W3t{constructor(t,n,r){Un(this,"fragment");Un(this,"name");Un(this,"signature");Un(this,"topic");Un(this,"args");const s=t.name,a=t.format();Ds(this,{fragment:t,name:s,signature:a,topic:n,args:r})}}class q3t{constructor(t,n,r,s){Un(this,"fragment");Un(this,"name");Un(this,"args");Un(this,"signature");Un(this,"selector");Un(this,"value");const a=t.name,o=t.format();Ds(this,{fragment:t,name:a,args:r,signature:o,selector:n,value:s})}}class G3t{constructor(t,n,r){Un(this,"fragment");Un(this,"name");Un(this,"args");Un(this,"signature");Un(this,"selector");const s=t.name,a=t.format();Ds(this,{fragment:t,name:s,args:r,signature:a,selector:n})}}class K0e{constructor(t){Un(this,"hash");Un(this,"_isIndexed");Ds(this,{hash:t,_isIndexed:!0})}static isIndexed(t){return!!(t&&t._isIndexed)}}const Y0e={0:"generic panic",1:"assert(false)",17:"arithmetic overflow",18:"division or modulo by zero",33:"enum overflow",34:"invalid encoded storage byte array accessed",49:"out-of-bounds array access; popping on an empty array",50:"out-of-bounds access of an array or bytesN",65:"out of memory",81:"uninitialized function"},X0e={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:e=>`reverted with reason string ${JSON.stringify(e)}`},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"],reason:e=>{let t="unknown panic code";return e>=0&&e<=255&&Y0e[e.toString()]&&(t=Y0e[e.toString()]),`reverted with panic code 0x${e.toString(16)} (${t})`}}};var u0,d0,f0,yu,W0,JF,eO;const Bv=class Bv{constructor(t){Rn(this,W0);Un(this,"fragments");Un(this,"deploy");Un(this,"fallback");Un(this,"receive");Rn(this,u0);Rn(this,d0);Rn(this,f0);Rn(this,yu);let n=[];typeof t=="string"?n=JSON.parse(t):n=t,Wt(this,f0,new Map),Wt(this,u0,new Map),Wt(this,d0,new Map);const r=[];for(const o of n)try{r.push(_3.from(o))}catch(l){console.log(`[Warning] Invalid Fragment ${JSON.stringify(o)}:`,l.message)}Ds(this,{fragments:Object.freeze(r)});let s=null,a=!1;Wt(this,yu,this.getAbiCoder()),this.fragments.forEach((o,l)=>{let c;switch(o.type){case"constructor":if(this.deploy){console.log("duplicate definition - constructor");return}Ds(this,{deploy:o});return;case"fallback":o.inputs.length===0?a=!0:(bn(!s||o.payable!==s.payable,"conflicting fallback fragments",`fragments[${l}]`,o),s=o,a=s.payable);return;case"function":c=ze(this,f0);break;case"event":c=ze(this,d0);break;case"error":c=ze(this,u0);break;default:return}const u=o.format();c.has(u)||c.set(u,o)}),this.deploy||Ds(this,{deploy:Rg.from("constructor()")}),Ds(this,{fallback:s,receive:a})}format(t){const n=t?"minimal":"full";return this.fragments.map(s=>s.format(n))}formatJson(){const t=this.fragments.map(n=>n.format("json"));return JSON.stringify(t.map(n=>JSON.parse(n)))}getAbiCoder(){return mE.defaultAbiCoder()}getFunctionName(t){const n=vr(this,W0,JF).call(this,t,null,!1);return bn(n,"no matching function","key",t),n.name}hasFunction(t){return!!vr(this,W0,JF).call(this,t,null,!1)}getFunction(t,n){return vr(this,W0,JF).call(this,t,n||null,!0)}forEachFunction(t){const n=Array.from(ze(this,f0).keys());n.sort((r,s)=>r.localeCompare(s));for(let r=0;r<n.length;r++){const s=n[r];t(ze(this,f0).get(s),r)}}getEventName(t){const n=vr(this,W0,eO).call(this,t,null,!1);return bn(n,"no matching event","key",t),n.name}hasEvent(t){return!!vr(this,W0,eO).call(this,t,null,!1)}getEvent(t,n){return vr(this,W0,eO).call(this,t,n||null,!0)}forEachEvent(t){const n=Array.from(ze(this,d0).keys());n.sort((r,s)=>r.localeCompare(s));for(let r=0;r<n.length;r++){const s=n[r];t(ze(this,d0).get(s),r)}}getError(t,n){if(co(t)){const s=t.toLowerCase();if(X0e[s])return Wd.from(X0e[s].signature);for(const a of ze(this,u0).values())if(s===a.selector)return a;return null}if(t.indexOf("(")===-1){const s=[];for(const[a,o]of ze(this,u0))a.split("(")[0]===t&&s.push(o);if(s.length===0)return t==="Error"?Wd.from("error Error(string)"):t==="Panic"?Wd.from("error Panic(uint256)"):null;if(s.length>1){const a=s.map(o=>JSON.stringify(o.format())).join(", ");bn(!1,`ambiguous error description (i.e. ${a})`,"name",t)}return s[0]}if(t=Wd.from(t).format(),t==="Error(string)")return Wd.from("error Error(string)");if(t==="Panic(uint256)")return Wd.from("error Panic(uint256)");const r=ze(this,u0).get(t);return r||null}forEachError(t){const n=Array.from(ze(this,u0).keys());n.sort((r,s)=>r.localeCompare(s));for(let r=0;r<n.length;r++){const s=n[r];t(ze(this,u0).get(s),r)}}_decodeParams(t,n){return ze(this,yu).decode(t,n)}_encodeParams(t,n){return ze(this,yu).encode(t,n)}encodeDeploy(t){return this._encodeParams(this.deploy.inputs,t||[])}decodeErrorResult(t,n){if(typeof t=="string"){const r=this.getError(t);bn(r,"unknown error","fragment",t),t=r}return bn(go(n,0,4)===t.selector,`data signature does not match error ${t.name}.`,"data",n),this._decodeParams(t.inputs,go(n,4))}encodeErrorResult(t,n){if(typeof t=="string"){const r=this.getError(t);bn(r,"unknown error","fragment",t),t=r}return Ra([t.selector,this._encodeParams(t.inputs,n||[])])}decodeFunctionData(t,n){if(typeof t=="string"){const r=this.getFunction(t);bn(r,"unknown function","fragment",t),t=r}return bn(go(n,0,4)===t.selector,`data signature does not match function ${t.name}.`,"data",n),this._decodeParams(t.inputs,go(n,4))}encodeFunctionData(t,n){if(typeof t=="string"){const r=this.getFunction(t);bn(r,"unknown function","fragment",t),t=r}return Ra([t.selector,this._encodeParams(t.inputs,n||[])])}decodeFunctionResult(t,n){if(typeof t=="string"){const a=this.getFunction(t);bn(a,"unknown function","fragment",t),t=a}let r="invalid length for result data";const s=Jc(n);if(s.length%32===0)try{return ze(this,yu).decode(t.outputs,s)}catch{r="could not decode result data"}Lr(!1,r,"BAD_DATA",{value:Kr(s),info:{method:t.name,signature:t.format()}})}makeError(t,n){const r=hs(t,"data"),s=mE.getBuiltinCallException("call",n,r);if(s.message.startsWith("execution reverted (unknown custom error)")){const l=Kr(r.slice(0,4)),c=this.getError(l);if(c)try{const u=ze(this,yu).decode(c.inputs,r.slice(4));s.revert={name:c.name,signature:c.format(),args:u},s.reason=s.revert.signature,s.message=`execution reverted: ${s.reason}`}catch{s.message="execution reverted (coult not decode custom error)"}}const o=this.parseTransaction(n);return o&&(s.invocation={method:o.name,signature:o.signature,args:o.args}),s}encodeFunctionResult(t,n){if(typeof t=="string"){const r=this.getFunction(t);bn(r,"unknown function","fragment",t),t=r}return Kr(ze(this,yu).encode(t.outputs,n||[]))}encodeFilterTopics(t,n){if(typeof t=="string"){const a=this.getEvent(t);bn(a,"unknown event","eventFragment",t),t=a}Lr(n.length<=t.inputs.length,`too many arguments for ${t.format()}`,"UNEXPECTED_ARGUMENT",{count:n.length,expectedCount:t.inputs.length});const r=[];t.anonymous||r.push(t.topicHash);const s=(a,o)=>a.type==="string"?c1(o):a.type==="bytes"?lo(Kr(o)):(a.type==="bool"&&typeof o=="boolean"?o=o?"0x01":"0x00":a.type.match(/^u?int/)?o=o1(o):a.type.match(/^bytes/)?o=Gyt(o,32):a.type==="address"&&ze(this,yu).encode(["address"],[o]),a1(Kr(o),32));for(n.forEach((a,o)=>{const l=t.inputs[o];if(!l.indexed){bn(a==null,"cannot filter non-indexed parameters; must be null","contract."+l.name,a);return}a==null?r.push(null):l.baseType==="array"||l.baseType==="tuple"?bn(!1,"filtering with tuples or arrays not supported","contract."+l.name,a):Array.isArray(a)?r.push(a.map(c=>s(l,c))):r.push(s(l,a))});r.length&&r[r.length-1]===null;)r.pop();return r}encodeEventLog(t,n){if(typeof t=="string"){const o=this.getEvent(t);bn(o,"unknown event","eventFragment",t),t=o}const r=[],s=[],a=[];return t.anonymous||r.push(t.topicHash),bn(n.length===t.inputs.length,"event arguments/values mismatch","values",n),t.inputs.forEach((o,l)=>{const c=n[l];if(o.indexed)if(o.type==="string")r.push(c1(c));else if(o.type==="bytes")r.push(lo(c));else{if(o.baseType==="tuple"||o.baseType==="array")throw new Error("not implemented");r.push(ze(this,yu).encode([o.type],[c]))}else s.push(o),a.push(c)}),{data:ze(this,yu).encode(s,a),topics:r}}decodeEventLog(t,n,r){if(typeof t=="string"){const g=this.getEvent(t);bn(g,"unknown event","eventFragment",t),t=g}if(r!=null&&!t.anonymous){const g=t.topicHash;bn(co(r[0],32)&&r[0].toLowerCase()===g,"fragment/topic mismatch","topics[0]",r[0]),r=r.slice(1)}const s=[],a=[],o=[];t.inputs.forEach((g,v)=>{g.indexed?g.type==="string"||g.type==="bytes"||g.baseType==="tuple"||g.baseType==="array"?(s.push(ru.from({type:"bytes32",name:g.name})),o.push(!0)):(s.push(g),o.push(!1)):(a.push(g),o.push(!1))});const l=r!=null?ze(this,yu).decode(s,Ra(r)):null,c=ze(this,yu).decode(a,n,!0),u=[],d=[];let f=0,x=0;return t.inputs.forEach((g,v)=>{let w=null;if(g.indexed)if(l==null)w=new K0e(null);else if(o[v])w=new K0e(l[x++]);else try{w=l[x++]}catch(C){w=C}else try{w=c[f++]}catch(C){w=C}u.push(w),d.push(g.name||null)}),bM.fromItems(u,d)}parseTransaction(t){const n=hs(t.data,"tx.data"),r=js(t.value!=null?t.value:0,"tx.value"),s=this.getFunction(Kr(n.slice(0,4)));if(!s)return null;const a=ze(this,yu).decode(s.inputs,n.slice(4));return new q3t(s,s.selector,a,r)}parseCallResult(t){throw new Error("@TODO")}parseLog(t){const n=this.getEvent(t.topics[0]);return!n||n.anonymous?null:new W3t(n,n.topicHash,this.decodeEventLog(n,t.data,t.topics))}parseError(t){const n=Kr(t),r=this.getError(go(n,0,4));if(!r)return null;const s=ze(this,yu).decode(r.inputs,go(n,4));return new G3t(r,r.selector,s)}static from(t){return t instanceof Bv?t:typeof t=="string"?new Bv(JSON.parse(t)):typeof t.formatJson=="function"?new Bv(t.formatJson()):typeof t.format=="function"?new Bv(t.format("json")):new Bv(t)}};u0=new WeakMap,d0=new WeakMap,f0=new WeakMap,yu=new WeakMap,W0=new WeakSet,JF=function(t,n,r){if(co(t)){const a=t.toLowerCase();for(const o of ze(this,f0).values())if(a===o.selector)return o;return null}if(t.indexOf("(")===-1){const a=[];for(const[o,l]of ze(this,f0))o.split("(")[0]===t&&a.push(l);if(n){const o=n.length>0?n[n.length-1]:null;let l=n.length,c=!0;Mu.isTyped(o)&&o.type==="overrides"&&(c=!1,l--);for(let u=a.length-1;u>=0;u--){const d=a[u].inputs.length;d!==l&&(!c||d!==l-1)&&a.splice(u,1)}for(let u=a.length-1;u>=0;u--){const d=a[u].inputs;for(let f=0;f<n.length;f++)if(Mu.isTyped(n[f])){if(f>=d.length){if(n[f].type==="overrides")continue;a.splice(u,1);break}if(n[f].type!==d[f].baseType){a.splice(u,1);break}}}}if(a.length===1&&n&&n.length!==a[0].inputs.length){const o=n[n.length-1];(o==null||Array.isArray(o)||typeof o!="object")&&a.splice(0,1)}if(a.length===0)return null;if(a.length>1&&r){const o=a.map(l=>JSON.stringify(l.format())).join(", ");bn(!1,`ambiguous function description (i.e. matches ${o})`,"key",t)}return a[0]}const s=ze(this,f0).get(C0.from(t).format());return s||null},eO=function(t,n,r){if(co(t)){const a=t.toLowerCase();for(const o of ze(this,d0).values())if(a===o.topicHash)return o;return null}if(t.indexOf("(")===-1){const a=[];for(const[o,l]of ze(this,d0))o.split("(")[0]===t&&a.push(l);if(n){for(let o=a.length-1;o>=0;o--)a[o].inputs.length<n.length&&a.splice(o,1);for(let o=a.length-1;o>=0;o--){const l=a[o].inputs;for(let c=0;c<n.length;c++)if(Mu.isTyped(n[c])&&n[c].type!==l[c].baseType){a.splice(o,1);break}}}if(a.length===0)return null;if(a.length>1&&r){const o=a.map(l=>JSON.stringify(l.format())).join(", ");bn(!1,`ambiguous event description (i.e. matches ${o})`,"key",t)}return a[0]}const s=ze(this,d0).get(w0.from(t).format());return s||null};let DJ=Bv;const dIe=BigInt(0);function i4(e){return e??null}function gl(e){return e==null?null:e.toString()}class Q0e{constructor(t,n,r){Un(this,"gasPrice");Un(this,"maxFeePerGas");Un(this,"maxPriorityFeePerGas");Ds(this,{gasPrice:i4(t),maxFeePerGas:i4(n),maxPriorityFeePerGas:i4(r)})}toJSON(){const{gasPrice:t,maxFeePerGas:n,maxPriorityFeePerGas:r}=this;return{_type:"FeeData",gasPrice:gl(t),maxFeePerGas:gl(n),maxPriorityFeePerGas:gl(r)}}}function xE(e){const t={};e.to&&(t.to=e.to),e.from&&(t.from=e.from),e.data&&(t.data=Kr(e.data));const n="chainId,gasLimit,gasPrice,maxFeePerBlobGas,maxFeePerGas,maxPriorityFeePerGas,value".split(/,/);for(const s of n)!(s in e)||e[s]==null||(t[s]=js(e[s],`request.${s}`));const r="type,nonce".split(/,/);for(const s of r)!(s in e)||e[s]==null||(t[s]=Di(e[s],`request.${s}`));return e.accessList&&(t.accessList=u5(e.accessList)),e.authorizationList&&(t.authorizationList=e.authorizationList.slice()),"blockTag"in e&&(t.blockTag=e.blockTag),"enableCcipRead"in e&&(t.enableCcipRead=!!e.enableCcipRead),"customData"in e&&(t.customData=e.customData),"blobVersionedHashes"in e&&e.blobVersionedHashes&&(t.blobVersionedHashes=e.blobVersionedHashes.slice()),"kzg"in e&&(t.kzg=e.kzg),"blobs"in e&&e.blobs&&(t.blobs=e.blobs.map(s=>TB(s)?Kr(s):Object.assign({},s))),t}var Cg;class K3t{constructor(t,n){Un(this,"provider");Un(this,"number");Un(this,"hash");Un(this,"timestamp");Un(this,"parentHash");Un(this,"parentBeaconBlockRoot");Un(this,"nonce");Un(this,"difficulty");Un(this,"gasLimit");Un(this,"gasUsed");Un(this,"stateRoot");Un(this,"receiptsRoot");Un(this,"blobGasUsed");Un(this,"excessBlobGas");Un(this,"miner");Un(this,"prevRandao");Un(this,"extraData");Un(this,"baseFeePerGas");Rn(this,Cg);Wt(this,Cg,t.transactions.map(r=>typeof r!="string"?new gE(r,n):r)),Ds(this,{provider:n,hash:i4(t.hash),number:t.number,timestamp:t.timestamp,parentHash:t.parentHash,parentBeaconBlockRoot:t.parentBeaconBlockRoot,nonce:t.nonce,difficulty:t.difficulty,gasLimit:t.gasLimit,gasUsed:t.gasUsed,blobGasUsed:t.blobGasUsed,excessBlobGas:t.excessBlobGas,miner:t.miner,prevRandao:i4(t.prevRandao),extraData:t.extraData,baseFeePerGas:i4(t.baseFeePerGas),stateRoot:t.stateRoot,receiptsRoot:t.receiptsRoot})}get transactions(){return ze(this,Cg).map(t=>typeof t=="string"?t:t.hash)}get prefetchedTransactions(){const t=ze(this,Cg).slice();return t.length===0?[]:(Lr(typeof t[0]=="object","transactions were not prefetched with block request","UNSUPPORTED_OPERATION",{operation:"transactionResponses()"}),t)}toJSON(){const{baseFeePerGas:t,difficulty:n,extraData:r,gasLimit:s,gasUsed:a,hash:o,miner:l,prevRandao:c,nonce:u,number:d,parentHash:f,parentBeaconBlockRoot:x,stateRoot:g,receiptsRoot:v,timestamp:w,transactions:C}=this;return{_type:"Block",baseFeePerGas:gl(t),difficulty:gl(n),extraData:r,gasLimit:gl(s),gasUsed:gl(a),blobGasUsed:gl(this.blobGasUsed),excessBlobGas:gl(this.excessBlobGas),hash:o,miner:l,prevRandao:c,nonce:u,number:d,parentHash:f,timestamp:w,parentBeaconBlockRoot:x,stateRoot:g,receiptsRoot:v,transactions:C}}[Symbol.iterator](){let t=0;const n=this.transactions;return{next:()=>t<this.length?{value:n[t++],done:!1}:{value:void 0,done:!0}}}get length(){return ze(this,Cg).length}get date(){return this.timestamp==null?null:new Date(this.timestamp*1e3)}async getTransaction(t){let n;if(typeof t=="number")n=ze(this,Cg)[t];else{const r=t.toLowerCase();for(const s of ze(this,Cg))if(typeof s=="string"){if(s!==r)continue;n=s;break}else{if(s.hash!==r)continue;n=s;break}}if(n==null)throw new Error("no such tx");return typeof n=="string"?await this.provider.getTransaction(n):n}getPrefetchedTransaction(t){const n=this.prefetchedTransactions;if(typeof t=="number")return n[t];t=t.toLowerCase();for(const r of n)if(r.hash===t)return r;bn(!1,"no matching transaction","indexOrHash",t)}isMined(){return!!this.hash}isLondon(){return!!this.baseFeePerGas}orphanedEvent(){if(!this.isMined())throw new Error("");return Y3t(this)}}Cg=new WeakMap;class zk{constructor(t,n){Un(this,"provider");Un(this,"transactionHash");Un(this,"blockHash");Un(this,"blockNumber");Un(this,"removed");Un(this,"address");Un(this,"data");Un(this,"topics");Un(this,"index");Un(this,"transactionIndex");this.provider=n;const r=Object.freeze(t.topics.slice());Ds(this,{transactionHash:t.transactionHash,blockHash:t.blockHash,blockNumber:t.blockNumber,removed:t.removed,address:t.address,data:t.data,topics:r,index:t.index,transactionIndex:t.transactionIndex})}toJSON(){const{address:t,blockHash:n,blockNumber:r,data:s,index:a,removed:o,topics:l,transactionHash:c,transactionIndex:u}=this;return{_type:"log",address:t,blockHash:n,blockNumber:r,data:s,index:a,removed:o,topics:l,transactionHash:c,transactionIndex:u}}async getBlock(){const t=await this.provider.getBlock(this.blockHash);return Lr(!!t,"failed to find transaction","UNKNOWN_ERROR",{}),t}async getTransaction(){const t=await this.provider.getTransaction(this.transactionHash);return Lr(!!t,"failed to find transaction","UNKNOWN_ERROR",{}),t}async getTransactionReceipt(){const t=await this.provider.getTransactionReceipt(this.transactionHash);return Lr(!!t,"failed to find transaction receipt","UNKNOWN_ERROR",{}),t}removedEvent(){return X3t(this)}}var rk;class fIe{constructor(t,n){Un(this,"provider");Un(this,"to");Un(this,"from");Un(this,"contractAddress");Un(this,"hash");Un(this,"index");Un(this,"blockHash");Un(this,"blockNumber");Un(this,"logsBloom");Un(this,"gasUsed");Un(this,"blobGasUsed");Un(this,"cumulativeGasUsed");Un(this,"gasPrice");Un(this,"blobGasPrice");Un(this,"type");Un(this,"status");Un(this,"root");Rn(this,rk);Wt(this,rk,Object.freeze(t.logs.map(s=>new zk(s,n))));let r=dIe;t.effectiveGasPrice!=null?r=t.effectiveGasPrice:t.gasPrice!=null&&(r=t.gasPrice),Ds(this,{provider:n,to:t.to,from:t.from,contractAddress:t.contractAddress,hash:t.hash,index:t.index,blockHash:t.blockHash,blockNumber:t.blockNumber,logsBloom:t.logsBloom,gasUsed:t.gasUsed,cumulativeGasUsed:t.cumulativeGasUsed,blobGasUsed:t.blobGasUsed,gasPrice:r,blobGasPrice:t.blobGasPrice,type:t.type,status:t.status,root:t.root})}get logs(){return ze(this,rk)}toJSON(){const{to:t,from:n,contractAddress:r,hash:s,index:a,blockHash:o,blockNumber:l,logsBloom:c,logs:u,status:d,root:f}=this;return{_type:"TransactionReceipt",blockHash:o,blockNumber:l,contractAddress:r,cumulativeGasUsed:gl(this.cumulativeGasUsed),from:n,gasPrice:gl(this.gasPrice),blobGasUsed:gl(this.blobGasUsed),blobGasPrice:gl(this.blobGasPrice),gasUsed:gl(this.gasUsed),hash:s,index:a,logs:u,logsBloom:c,root:f,status:d,to:t}}get length(){return this.logs.length}[Symbol.iterator](){let t=0;return{next:()=>t<this.length?{value:this.logs[t++],done:!1}:{value:void 0,done:!0}}}get fee(){return this.gasUsed*this.gasPrice}async getBlock(){const t=await this.provider.getBlock(this.blockHash);if(t==null)throw new Error("TODO");return t}async getTransaction(){const t=await this.provider.getTransaction(this.hash);if(t==null)throw new Error("TODO");return t}async getResult(){return await this.provider.getTransactionResult(this.hash)}async confirmations(){return await this.provider.getBlockNumber()-this.blockNumber+1}removedEvent(){return pIe(this)}reorderedEvent(t){return Lr(!t||t.isMined(),"unmined 'other' transction cannot be orphaned","UNSUPPORTED_OPERATION",{operation:"reorderedEvent(other)"}),hIe(this,t)}}rk=new WeakMap;var Jb;const Kue=class Kue{constructor(t,n){Un(this,"provider");Un(this,"blockNumber");Un(this,"blockHash");Un(this,"index");Un(this,"hash");Un(this,"type");Un(this,"to");Un(this,"from");Un(this,"nonce");Un(this,"gasLimit");Un(this,"gasPrice");Un(this,"maxPriorityFeePerGas");Un(this,"maxFeePerGas");Un(this,"maxFeePerBlobGas");Un(this,"data");Un(this,"value");Un(this,"chainId");Un(this,"signature");Un(this,"accessList");Un(this,"blobVersionedHashes");Un(this,"authorizationList");Rn(this,Jb);this.provider=n,this.blockNumber=t.blockNumber!=null?t.blockNumber:null,this.blockHash=t.blockHash!=null?t.blockHash:null,this.hash=t.hash,this.index=t.index,this.type=t.type,this.from=t.from,this.to=t.to||null,this.gasLimit=t.gasLimit,this.nonce=t.nonce,this.data=t.data,this.value=t.value,this.gasPrice=t.gasPrice,this.maxPriorityFeePerGas=t.maxPriorityFeePerGas!=null?t.maxPriorityFeePerGas:null,this.maxFeePerGas=t.maxFeePerGas!=null?t.maxFeePerGas:null,this.maxFeePerBlobGas=t.maxFeePerBlobGas!=null?t.maxFeePerBlobGas:null,this.chainId=t.chainId,this.signature=t.signature,this.accessList=t.accessList!=null?t.accessList:null,this.blobVersionedHashes=t.blobVersionedHashes!=null?t.blobVersionedHashes:null,this.authorizationList=t.authorizationList!=null?t.authorizationList:null,Wt(this,Jb,-1)}toJSON(){const{blockNumber:t,blockHash:n,index:r,hash:s,type:a,to:o,from:l,nonce:c,data:u,signature:d,accessList:f,blobVersionedHashes:x}=this;return{_type:"TransactionResponse",accessList:f,blockNumber:t,blockHash:n,blobVersionedHashes:x,chainId:gl(this.chainId),data:u,from:l,gasLimit:gl(this.gasLimit),gasPrice:gl(this.gasPrice),hash:s,maxFeePerGas:gl(this.maxFeePerGas),maxPriorityFeePerGas:gl(this.maxPriorityFeePerGas),maxFeePerBlobGas:gl(this.maxFeePerBlobGas),nonce:c,signature:d,to:o,index:r,type:a,value:gl(this.value)}}async getBlock(){let t=this.blockNumber;if(t==null){const r=await this.getTransaction();r&&(t=r.blockNumber)}if(t==null)return null;const n=this.provider.getBlock(t);if(n==null)throw new Error("TODO");return n}async getTransaction(){return this.provider.getTransaction(this.hash)}async confirmations(){if(this.blockNumber==null){const{tx:n,blockNumber:r}=await Su({tx:this.getTransaction(),blockNumber:this.provider.getBlockNumber()});return n==null||n.blockNumber==null?0:r-n.blockNumber+1}return await this.provider.getBlockNumber()-this.blockNumber+1}async wait(t,n){const r=t??1,s=n??0;let a=ze(this,Jb),o=-1,l=a===-1;const c=async()=>{if(l)return null;const{blockNumber:x,nonce:g}=await Su({blockNumber:this.provider.getBlockNumber(),nonce:this.provider.getTransactionCount(this.from)});if(g<this.nonce){a=x;return}if(l)return null;const v=await this.getTransaction();if(!(v&&v.blockNumber!=null))for(o===-1&&(o=a-3,o<ze(this,Jb)&&(o=ze(this,Jb)));o<=x;){if(l)return null;const w=await this.provider.getBlock(o,!0);if(w==null)return;for(const C of w)if(C===this.hash)return;for(let C=0;C<w.length;C++){const N=await w.getTransaction(C);if(N.from===this.from&&N.nonce===this.nonce){if(l)return null;const P=await this.provider.getTransactionReceipt(N.hash);if(P==null||x-P.blockNumber+1<r)return;let I="replaced";N.data===this.data&&N.to===this.to&&N.value===this.value?I="repriced":N.data==="0x"&&N.from===N.to&&N.value===dIe&&(I="cancelled"),Lr(!1,"transaction was replaced","TRANSACTION_REPLACED",{cancelled:I==="replaced"||I==="cancelled",reason:I,replacement:N.replaceableTransaction(a),hash:N.hash,receipt:P})}}o++}},u=x=>{if(x==null||x.status!==0)return x;Lr(!1,"transaction execution reverted","CALL_EXCEPTION",{action:"sendTransaction",data:null,reason:null,invocation:null,revert:null,transaction:{to:x.to,from:x.from,data:""},receipt:x})},d=await this.provider.getTransactionReceipt(this.hash);if(r===0)return u(d);if(d){if(r===1||await d.confirmations()>=r)return u(d)}else if(await c(),r===0)return null;return await new Promise((x,g)=>{const v=[],w=()=>{v.forEach(N=>N())};if(v.push(()=>{l=!0}),s>0){const N=setTimeout(()=>{w(),g(_o("wait for transaction timeout","TIMEOUT"))},s);v.push(()=>{clearTimeout(N)})}const C=async N=>{if(await N.confirmations()>=r){w();try{x(u(N))}catch(P){g(P)}}};if(v.push(()=>{this.provider.off(this.hash,C)}),this.provider.on(this.hash,C),a>=0){const N=async()=>{try{await c()}catch(P){if(Zc(P,"TRANSACTION_REPLACED")){w(),g(P);return}}l||this.provider.once("block",N)};v.push(()=>{this.provider.off("block",N)}),this.provider.once("block",N)}})}isMined(){return this.blockHash!=null}isLegacy(){return this.type===0}isBerlin(){return this.type===1}isLondon(){return this.type===2}isCancun(){return this.type===3}removedEvent(){return Lr(this.isMined(),"unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),pIe(this)}reorderedEvent(t){return Lr(this.isMined(),"unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),Lr(!t||t.isMined(),"unmined 'other' transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),hIe(this,t)}replaceableTransaction(t){bn(Number.isInteger(t)&&t>=0,"invalid startBlock","startBlock",t);const n=new Kue(this,this.provider);return Wt(n,Jb,t),n}};Jb=new WeakMap;let gE=Kue;function Y3t(e){return{orphan:"drop-block",hash:e.hash,number:e.number}}function hIe(e,t){return{orphan:"reorder-transaction",tx:e,other:t}}function pIe(e){return{orphan:"drop-transaction",tx:e}}function X3t(e){return{orphan:"drop-log",log:{transactionHash:e.transactionHash,blockHash:e.blockHash,blockNumber:e.blockNumber,address:e.address,data:e.data,topics:Object.freeze(e.topics.slice()),index:e.index}}}class wae extends zk{constructor(n,r,s){super(n,n.provider);Un(this,"interface");Un(this,"fragment");Un(this,"args");const a=r.decodeEventLog(s,n.data,n.topics);Ds(this,{args:a,fragment:s,interface:r})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}}class mIe extends zk{constructor(n,r){super(n,n.provider);Un(this,"error");Ds(this,{error:r})}}var sS;class Q3t extends fIe{constructor(n,r,s){super(s,r);Rn(this,sS);Wt(this,sS,n)}get logs(){return super.logs.map(n=>{const r=n.topics.length?ze(this,sS).getEvent(n.topics[0]):null;if(r)try{return new wae(n,ze(this,sS),r)}catch(s){return new mIe(n,s)}return n})}}sS=new WeakMap;var sk;class Cae extends gE{constructor(n,r,s){super(s,r);Rn(this,sk);Wt(this,sk,n)}async wait(n,r){const s=await super.wait(n,r);return s==null?null:new Q3t(ze(this,sk),this.provider,s)}}sk=new WeakMap;class xIe extends vke{constructor(n,r,s,a){super(n,r,s);Un(this,"log");Ds(this,{log:a})}async getBlock(){return await this.log.getBlock()}async getTransaction(){return await this.log.getTransaction()}async getTransactionReceipt(){return await this.log.getTransactionReceipt()}}class Z3t extends xIe{constructor(t,n,r,s,a){super(t,n,r,new wae(a,t.interface,s));const o=t.interface.decodeEventLog(s,this.log.data,this.log.topics);Ds(this,{args:o,fragment:s})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}}const Z0e=BigInt(0);function gIe(e){return e&&typeof e.call=="function"}function bIe(e){return e&&typeof e.estimateGas=="function"}function VB(e){return e&&typeof e.resolveName=="function"}function yIe(e){return e&&typeof e.sendTransaction=="function"}function vIe(e){if(e!=null){if(VB(e))return e;if(e.provider)return e.provider}}var ik;class J3t{constructor(t,n,r){Rn(this,ik);Un(this,"fragment");if(Ds(this,{fragment:n}),n.inputs.length<r.length)throw new Error("too many arguments");const s=k3(t.runner,"resolveName"),a=VB(s)?s:null;Wt(this,ik,async function(){const o=await Promise.all(n.inputs.map((l,c)=>r[c]==null?null:l.walkAsync(r[c],(d,f)=>d==="address"?Array.isArray(f)?Promise.all(f.map(x=>kc(x,a))):kc(f,a):f)));return t.interface.encodeFilterTopics(n,o)}())}getTopicFilter(){return ze(this,ik)}}ik=new WeakMap;function k3(e,t){return e==null?null:typeof e[t]=="function"?e:e.provider&&typeof e.provider[t]=="function"?e.provider:null}function Yv(e){return e==null?null:e.provider||null}async function wIe(e,t){const n=Mu.dereference(e,"overrides");bn(typeof n=="object","invalid overrides parameter","overrides",e);const r=xE(n);return bn(r.to==null||(t||[]).indexOf("to")>=0,"cannot override to","overrides.to",r.to),bn(r.data==null||(t||[]).indexOf("data")>=0,"cannot override data","overrides.data",r.data),r.from&&(r.from=r.from),r}async function e5t(e,t,n){const r=k3(e,"resolveName"),s=VB(r)?r:null;return await Promise.all(t.map((a,o)=>a.walkAsync(n[o],(l,c)=>(c=Mu.dereference(c,l),l==="address"?kc(c,s):c))))}function t5t(e){const t=async function(o){const l=await wIe(o,["data"]);l.to=await e.getAddress(),l.from&&(l.from=await kc(l.from,vIe(e.runner)));const c=e.interface,u=js(l.value||Z0e,"overrides.value")===Z0e,d=(l.data||"0x")==="0x";c.fallback&&!c.fallback.payable&&c.receive&&!d&&!u&&bn(!1,"cannot send data to receive or send value to non-payable fallback","overrides",o),bn(c.fallback||d,"cannot send data to receive-only contract","overrides.data",l.data);const f=c.receive||c.fallback&&c.fallback.payable;return bn(f||u,"cannot send value to non-payable fallback","overrides.value",l.value),bn(c.fallback||d,"cannot send data to receive-only contract","overrides.data",l.data),l},n=async function(o){const l=k3(e.runner,"call");Lr(gIe(l),"contract runner does not support calling","UNSUPPORTED_OPERATION",{operation:"call"});const c=await t(o);try{return await l.call(c)}catch(u){throw sae(u)&&u.data?e.interface.makeError(u.data,c):u}},r=async function(o){const l=e.runner;Lr(yIe(l),"contract runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const c=await l.sendTransaction(await t(o)),u=Yv(e.runner);return new Cae(e.interface,u,c)},s=async function(o){const l=k3(e.runner,"estimateGas");return Lr(bIe(l),"contract runner does not support gas estimation","UNSUPPORTED_OPERATION",{operation:"estimateGas"}),await l.estimateGas(await t(o))},a=async o=>await r(o);return Ds(a,{_contract:e,estimateGas:s,populateTransaction:t,send:r,staticCall:n}),a}function n5t(e,t){const n=function(...u){const d=e.interface.getFunction(t,u);return Lr(d,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:t,args:u}}),d},r=async function(...u){const d=n(...u);let f={};if(d.inputs.length+1===u.length&&(f=await wIe(u.pop()),f.from&&(f.from=await kc(f.from,vIe(e.runner)))),d.inputs.length!==u.length)throw new Error("internal error: fragment inputs doesn't match arguments; should not happen");const x=await e5t(e.runner,d.inputs,u);return Object.assign({},f,await Su({to:e.getAddress(),data:e.interface.encodeFunctionData(d,x)}))},s=async function(...u){const d=await l(...u);return d.length===1?d[0]:d},a=async function(...u){const d=e.runner;Lr(yIe(d),"contract runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const f=await d.sendTransaction(await r(...u)),x=Yv(e.runner);return new Cae(e.interface,x,f)},o=async function(...u){const d=k3(e.runner,"estimateGas");return Lr(bIe(d),"contract runner does not support gas estimation","UNSUPPORTED_OPERATION",{operation:"estimateGas"}),await d.estimateGas(await r(...u))},l=async function(...u){const d=k3(e.runner,"call");Lr(gIe(d),"contract runner does not support calling","UNSUPPORTED_OPERATION",{operation:"call"});const f=await r(...u);let x="0x";try{x=await d.call(f)}catch(v){throw sae(v)&&v.data?e.interface.makeError(v.data,f):v}const g=n(...u);return e.interface.decodeFunctionResult(g,x)},c=async(...u)=>n(...u).constant?await s(...u):await a(...u);return Ds(c,{name:e.interface.getFunctionName(t),_contract:e,_key:t,getFragment:n,estimateGas:o,populateTransaction:r,send:a,staticCall:s,staticCallResult:l}),Object.defineProperty(c,"fragment",{configurable:!1,enumerable:!0,get:()=>{const u=e.interface.getFunction(t);return Lr(u,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:t}}),u}}),c}function r5t(e,t){const n=function(...s){const a=e.interface.getEvent(t,s);return Lr(a,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:t,args:s}}),a},r=function(...s){return new J3t(e,n(...s),s)};return Ds(r,{name:e.interface.getEventName(t),_contract:e,_key:t,getFragment:n}),Object.defineProperty(r,"fragment",{configurable:!1,enumerable:!0,get:()=>{const s=e.interface.getEvent(t);return Lr(s,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:t}}),s}}),r}const NM=Symbol.for("_ethersInternal_contract"),CIe=new WeakMap;function s5t(e,t){CIe.set(e[NM],t)}function kf(e){return CIe.get(e[NM])}function i5t(e){return e&&typeof e=="object"&&"getTopicFilter"in e&&typeof e.getTopicFilter=="function"&&e.fragment}async function Sae(e,t){let n,r=null;if(Array.isArray(t)){const a=function(o){if(co(o,32))return o;const l=e.interface.getEvent(o);return bn(l,"unknown fragment","name",o),l.topicHash};n=t.map(o=>o==null?null:Array.isArray(o)?o.map(a):a(o))}else t==="*"?n=[null]:typeof t=="string"?co(t,32)?n=[t]:(r=e.interface.getEvent(t),bn(r,"unknown fragment","event",t),n=[r.topicHash]):i5t(t)?n=await t.getTopicFilter():"fragment"in t?(r=t.fragment,n=[r.topicHash]):bn(!1,"unknown event name","event",t);n=n.map(a=>{if(a==null)return null;if(Array.isArray(a)){const o=Array.from(new Set(a.map(l=>l.toLowerCase())).values());return o.length===1?o[0]:(o.sort(),o)}return a.toLowerCase()});const s=n.map(a=>a==null?"null":Array.isArray(a)?a.join("|"):a).join("&");return{fragment:r,tag:s,topics:n}}async function xj(e,t){const{subs:n}=kf(e);return n.get((await Sae(e,t)).tag)||null}async function J0e(e,t,n){const r=Yv(e.runner);Lr(r,"contract runner does not support subscribing","UNSUPPORTED_OPERATION",{operation:t});const{fragment:s,tag:a,topics:o}=await Sae(e,n),{addr:l,subs:c}=kf(e);let u=c.get(a);if(!u){const f={address:l||e,topics:o},x=C=>{let N=s;if(N==null)try{N=e.interface.getEvent(C.topics[0])}catch{}if(N){const P=N,I=s?e.interface.decodeEventLog(s,C.data,C.topics):[];$J(e,n,I,R=>new Z3t(e,R,n,P,C))}else $J(e,n,[],P=>new xIe(e,P,n,C))};let g=[];u={tag:a,listeners:[],start:()=>{g.length||g.push(r.on(f,x))},stop:async()=>{if(g.length==0)return;let C=g;g=[],await Promise.all(C),r.off(f,x)}},c.set(a,u)}return u}let BJ=Promise.resolve();async function a5t(e,t,n,r){await BJ;const s=await xj(e,t);if(!s)return!1;const a=s.listeners.length;return s.listeners=s.listeners.filter(({listener:o,once:l})=>{const c=Array.from(n);r&&c.push(r(l?null:o));try{o.call(e,...c)}catch{}return!l}),s.listeners.length===0&&(s.stop(),kf(e).subs.delete(s.tag)),a>0}async function $J(e,t,n,r){try{await BJ}catch{}const s=a5t(e,t,n,r);return BJ=s,await s}const nP=["then"];var PNe;PNe=NM;const g9=class g9{constructor(t,n,r,s){Un(this,"target");Un(this,"interface");Un(this,"runner");Un(this,"filters");Un(this,PNe);Un(this,"fallback");bn(typeof t=="string"||ETe(t),"invalid value for Contract target","target",t),r==null&&(r=null);const a=DJ.from(n);Ds(this,{target:t,runner:r,interface:a}),Object.defineProperty(this,NM,{value:{}});let o,l=null,c=null;if(s){const f=Yv(r);c=new Cae(this.interface,f,s)}let u=new Map;if(typeof t=="string")if(co(t))l=t,o=Promise.resolve(t);else{const f=k3(r,"resolveName");if(!VB(f))throw _o("contract runner does not support name resolution","UNSUPPORTED_OPERATION",{operation:"resolveName"});o=f.resolveName(t).then(x=>{if(x==null)throw _o("an ENS name used for a contract target must be correctly configured","UNCONFIGURED_NAME",{value:t});return kf(this).addr=x,x})}else o=t.getAddress().then(f=>{if(f==null)throw new Error("TODO");return kf(this).addr=f,f});s5t(this,{addrPromise:o,addr:l,deployTx:c,subs:u});const d=new Proxy({},{get:(f,x,g)=>{if(typeof x=="symbol"||nP.indexOf(x)>=0)return Reflect.get(f,x,g);try{return this.getEvent(x)}catch(v){if(!Zc(v,"INVALID_ARGUMENT")||v.argument!=="key")throw v}},has:(f,x)=>nP.indexOf(x)>=0?Reflect.has(f,x):Reflect.has(f,x)||this.interface.hasEvent(String(x))});return Ds(this,{filters:d}),Ds(this,{fallback:a.receive||a.fallback?t5t(this):null}),new Proxy(this,{get:(f,x,g)=>{if(typeof x=="symbol"||x in f||nP.indexOf(x)>=0)return Reflect.get(f,x,g);try{return f.getFunction(x)}catch(v){if(!Zc(v,"INVALID_ARGUMENT")||v.argument!=="key")throw v}},has:(f,x)=>typeof x=="symbol"||x in f||nP.indexOf(x)>=0?Reflect.has(f,x):f.interface.hasFunction(x)})}connect(t){return new g9(this.target,this.interface,t)}attach(t){return new g9(t,this.interface,this.runner)}async getAddress(){return await kf(this).addrPromise}async getDeployedCode(){const t=Yv(this.runner);Lr(t,"runner does not support .provider","UNSUPPORTED_OPERATION",{operation:"getDeployedCode"});const n=await t.getCode(await this.getAddress());return n==="0x"?null:n}async waitForDeployment(){const t=this.deploymentTransaction();if(t)return await t.wait(),this;if(await this.getDeployedCode()!=null)return this;const r=Yv(this.runner);return Lr(r!=null,"contract runner does not support .provider","UNSUPPORTED_OPERATION",{operation:"waitForDeployment"}),new Promise((s,a)=>{const o=async()=>{try{if(await this.getDeployedCode()!=null)return s(this);r.once("block",o)}catch(l){a(l)}};o()})}deploymentTransaction(){return kf(this).deployTx}getFunction(t){return typeof t!="string"&&(t=t.format()),n5t(this,t)}getEvent(t){return typeof t!="string"&&(t=t.format()),r5t(this,t)}async queryTransaction(t){throw new Error("@TODO")}async queryFilter(t,n,r){n==null&&(n=0),r==null&&(r="latest");const{addr:s,addrPromise:a}=kf(this),o=s||await a,{fragment:l,topics:c}=await Sae(this,t),u={address:o,topics:c,fromBlock:n,toBlock:r},d=Yv(this.runner);return Lr(d,"contract runner does not have a provider","UNSUPPORTED_OPERATION",{operation:"queryFilter"}),(await d.getLogs(u)).map(f=>{let x=l;if(x==null)try{x=this.interface.getEvent(f.topics[0])}catch{}if(x)try{return new wae(f,this.interface,x)}catch(g){return new mIe(f,g)}return new zk(f,d)})}async on(t,n){const r=await J0e(this,"on",t);return r.listeners.push({listener:n,once:!1}),r.start(),this}async once(t,n){const r=await J0e(this,"once",t);return r.listeners.push({listener:n,once:!0}),r.start(),this}async emit(t,...n){return await $J(this,t,n,null)}async listenerCount(t){if(t){const s=await xj(this,t);return s?s.listeners.length:0}const{subs:n}=kf(this);let r=0;for(const{listeners:s}of n.values())r+=s.length;return r}async listeners(t){if(t){const s=await xj(this,t);return s?s.listeners.map(({listener:a})=>a):[]}const{subs:n}=kf(this);let r=[];for(const{listeners:s}of n.values())r=r.concat(s.map(({listener:a})=>a));return r}async off(t,n){const r=await xj(this,t);if(!r)return this;if(n){const s=r.listeners.map(({listener:a})=>a).indexOf(n);s>=0&&r.listeners.splice(s,1)}return(n==null||r.listeners.length===0)&&(r.stop(),kf(this).subs.delete(r.tag)),this}async removeAllListeners(t){if(t){const n=await xj(this,t);if(!n)return this;n.stop(),kf(this).subs.delete(n.tag)}else{const{subs:n}=kf(this);for(const{tag:r,stop:s}of n.values())s(),n.delete(r)}return this}async addListener(t,n){return await this.on(t,n)}async removeListener(t,n){return await this.off(t,n)}static buildClass(t){class n extends g9{constructor(s,a=null){super(s,t,a)}}return n}static from(t,n,r){return r==null&&(r=null),new this(t,n,r)}};let UJ=g9;function o5t(){return UJ}let Wj=class extends o5t(){};function HH(e){return e.match(/^ipfs:\/\/ipfs\//i)?e=e.substring(12):e.match(/^ipfs:\/\//i)?e=e.substring(7):bn(!1,"unsupported IPFS format","link",e),`https://gateway.ipfs.io/ipfs/${e}`}class l5t{constructor(t){Un(this,"name");Ds(this,{name:t})}connect(t){return this}supportsCoinType(t){return!1}async encodeAddress(t,n){throw new Error("unsupported coin")}async decodeAddress(t,n){throw new Error("unsupported coin")}}const SIe=new RegExp("^(ipfs)://(.*)$","i"),exe=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),SIe,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];var ey,Iw,ty,vC,pD,NIe;const GC=class GC{constructor(t,n,r){Rn(this,ty);Un(this,"provider");Un(this,"address");Un(this,"name");Rn(this,ey);Rn(this,Iw);Ds(this,{provider:t,address:n,name:r}),Wt(this,ey,null),Wt(this,Iw,new Wj(n,["function supportsInterface(bytes4) view returns (bool)","function resolve(bytes, bytes) view returns (bytes)","function addr(bytes32) view returns (address)","function addr(bytes32, uint) view returns (bytes)","function text(bytes32, string) view returns (string)","function contenthash(bytes32) view returns (bytes)"],t))}async supportsWildcard(){return ze(this,ey)==null&&Wt(this,ey,(async()=>{try{return await ze(this,Iw).supportsInterface("0x9061b923")}catch(t){if(Zc(t,"CALL_EXCEPTION"))return!1;throw Wt(this,ey,null),t}})()),await ze(this,ey)}async getAddress(t){if(t==null&&(t=60),t===60)try{const a=await vr(this,ty,vC).call(this,"addr(bytes32)");return a==null||a===cE?null:a}catch(a){if(Zc(a,"CALL_EXCEPTION"))return null;throw a}if(t>=0&&t<2147483648){let a=t+2147483648;const o=await vr(this,ty,vC).call(this,"addr(bytes32,uint)",[a]);if(co(o,20))return na(o)}let n=null;for(const a of this.provider.plugins)if(a instanceof l5t&&a.supportsCoinType(t)){n=a;break}if(n==null)return null;const r=await vr(this,ty,vC).call(this,"addr(bytes32,uint)",[t]);if(r==null||r==="0x")return null;const s=await n.decodeAddress(t,r);if(s!=null)return s;Lr(!1,"invalid coin data","UNSUPPORTED_OPERATION",{operation:`getAddress(${t})`,info:{coinType:t,data:r}})}async getText(t){const n=await vr(this,ty,vC).call(this,"text(bytes32,string)",[t]);return n==null||n==="0x"?null:n}async getContentHash(){const t=await vr(this,ty,vC).call(this,"contenthash(bytes32)");if(t==null||t==="0x")return null;const n=t.match(/^0x(e3010170|e5010172)(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/);if(n){const s=n[1]==="e3010170"?"ipfs":"ipns",a=parseInt(n[4],16);if(n[5].length===a*2)return`${s}://${yke("0x"+n[2])}`}const r=t.match(/^0xe40101fa011b20([0-9a-f]*)$/);if(r&&r[1].length===64)return`bzz://${r[1]}`;Lr(!1,"invalid or unsupported content hash data","UNSUPPORTED_OPERATION",{operation:"getContentHash()",info:{data:t}})}async getAvatar(){return(await this._getAvatar()).url}async _getAvatar(){const t=[{type:"name",value:this.name}];try{const n=await this.getText("avatar");if(n==null)return t.push({type:"!avatar",value:""}),{url:null,linkage:t};t.push({type:"avatar",value:n});for(let r=0;r<exe.length;r++){const s=n.match(exe[r]);if(s==null)continue;const a=s[1].toLowerCase();switch(a){case"https":case"data":return t.push({type:"url",value:n}),{linkage:t,url:n};case"ipfs":{const o=HH(n);return t.push({type:"ipfs",value:n}),t.push({type:"url",value:o}),{linkage:t,url:o}}case"erc721":case"erc1155":{const o=a==="erc721"?"tokenURI(uint256)":"uri(uint256)";t.push({type:a,value:n});const l=await this.getAddress();if(l==null)return t.push({type:"!owner",value:""}),{url:null,linkage:t};const c=(s[2]||"").split("/");if(c.length!==2)return t.push({type:`!${a}caip`,value:s[2]||""}),{url:null,linkage:t};const u=c[1],d=new Wj(c[0],["function tokenURI(uint) view returns (string)","function ownerOf(uint) view returns (address)","function uri(uint) view returns (string)","function balanceOf(address, uint256) view returns (uint)"],this.provider);if(a==="erc721"){const w=await d.ownerOf(u);if(l!==w)return t.push({type:"!owner",value:w}),{url:null,linkage:t};t.push({type:"owner",value:w})}else if(a==="erc1155"){const w=await d.balanceOf(l,u);if(!w)return t.push({type:"!balance",value:"0"}),{url:null,linkage:t};t.push({type:"balance",value:w.toString()})}let f=await d[o](u);if(f==null||f==="0x")return t.push({type:"!metadata-url",value:""}),{url:null,linkage:t};t.push({type:"metadata-url-base",value:f}),a==="erc1155"&&(f=f.replace("{id}",o1(u,32).substring(2)),t.push({type:"metadata-url-expanded",value:f})),f.match(/^ipfs:/i)&&(f=HH(f)),t.push({type:"metadata-url",value:f});let x={};const g=await new Hy(f).send();g.assertOk();try{x=g.bodyJson}catch{try{t.push({type:"!metadata",value:g.bodyText})}catch{const N=g.body;return N&&t.push({type:"!metadata",value:Kr(N)}),{url:null,linkage:t}}return{url:null,linkage:t}}if(!x)return t.push({type:"!metadata",value:""}),{url:null,linkage:t};t.push({type:"metadata",value:JSON.stringify(x)});let v=x.image;if(typeof v!="string")return t.push({type:"!imageUrl",value:""}),{url:null,linkage:t};if(!v.match(/^(https:\/\/|data:)/i)){if(v.match(SIe)==null)return t.push({type:"!imageUrl-ipfs",value:v}),{url:null,linkage:t};t.push({type:"imageUrl-ipfs",value:v}),v=HH(v)}return t.push({type:"url",value:v}),{linkage:t,url:v}}}}}catch{}return{linkage:t,url:null}}static async getEnsAddress(t){const n=await t.getNetwork(),r=n.getPlugin("org.ethers.plugins.network.Ens");return Lr(r,"network does not support ENS","UNSUPPORTED_OPERATION",{operation:"getEnsAddress",info:{network:n}}),r.address}static async fromName(t,n){var s;let r=n;for(;;){if(r===""||r==="."||n!=="eth"&&r==="eth")return null;const a=await vr(s=GC,pD,NIe).call(s,t,r);if(a!=null){const o=new GC(t,a,n);return r!==n&&!await o.supportsWildcard()?null:o}r=r.split(".").slice(1).join(".")}}};ey=new WeakMap,Iw=new WeakMap,ty=new WeakSet,vC=async function(t,n){n=(n||[]).slice();const r=ze(this,Iw).interface;n.unshift(RJ(this.name));let s=null;await this.supportsWildcard()&&(s=r.getFunction(t),Lr(s,"missing fragment","UNKNOWN_ERROR",{info:{funcName:t}}),n=[C3t(this.name,255),r.encodeFunctionData(s,n)],t="resolve(bytes,bytes)"),n.push({enableCcipRead:!0});try{const a=await ze(this,Iw)[t](...n);return s?r.decodeFunctionResult(s,a)[0]:a}catch(a){if(!Zc(a,"CALL_EXCEPTION"))throw a}return null},pD=new WeakSet,NIe=async function(t,n){const r=await GC.getEnsAddress(t);try{const a=await new Wj(r,["function resolver(bytes32) view returns (address)"],t).resolver(RJ(n),{enableCcipRead:!0});return a===cE?null:a}catch(s){throw s}return null},Rn(GC,pD);let AM=GC;const txe=BigInt(0);function ea(e,t){return function(n){return n==null?t:e(n)}}function bE(e,t){return n=>{if(t&&n==null)return null;if(!Array.isArray(n))throw new Error("not an array");return n.map(r=>e(r))}}function Hk(e,t){return n=>{const r={};for(const s in e){let a=s;if(t&&s in t&&!(a in n)){for(const o of t[s])if(o in n){a=o;break}}try{const o=e[s](n[a]);o!==void 0&&(r[s]=o)}catch(o){const l=o instanceof Error?o.message:"not-an-error";Lr(!1,`invalid value for value.${s} (${l})`,"BAD_DATA",{value:n})}}return r}}function c5t(e){switch(e){case!0:case"true":return!0;case!1:case"false":return!1}bn(!1,`invalid boolean; ${JSON.stringify(e)}`,"value",e)}function VS(e){return bn(co(e,!0),"invalid data","value",e),e}function Qc(e){return bn(co(e,32),"invalid hash","value",e),e}const u5t=Hk({address:na,blockHash:Qc,blockNumber:Di,data:VS,index:Di,removed:ea(c5t,!1),topics:bE(Qc),transactionHash:Qc,transactionIndex:Di},{index:["logIndex"]});function d5t(e){return u5t(e)}const f5t=Hk({hash:ea(Qc),parentHash:Qc,parentBeaconBlockRoot:ea(Qc,null),number:Di,timestamp:Di,nonce:ea(VS),difficulty:js,gasLimit:js,gasUsed:js,stateRoot:ea(Qc,null),receiptsRoot:ea(Qc,null),blobGasUsed:ea(js,null),excessBlobGas:ea(js,null),miner:ea(na),prevRandao:ea(Qc,null),extraData:VS,baseFeePerGas:ea(js)},{prevRandao:["mixHash"]});function h5t(e){const t=f5t(e);return t.transactions=e.transactions.map(n=>typeof n=="string"?n:AIe(n)),t}const p5t=Hk({transactionIndex:Di,blockNumber:Di,transactionHash:Qc,address:na,topics:bE(Qc),data:VS,index:Di,blockHash:Qc},{index:["logIndex"]});function m5t(e){return p5t(e)}const x5t=Hk({to:ea(na,null),from:ea(na,null),contractAddress:ea(na,null),index:Di,root:ea(Kr),gasUsed:js,blobGasUsed:ea(js,null),logsBloom:ea(VS),blockHash:Qc,hash:Qc,logs:bE(m5t),blockNumber:Di,cumulativeGasUsed:js,effectiveGasPrice:ea(js),blobGasPrice:ea(js,null),status:ea(Di),type:ea(Di,0)},{effectiveGasPrice:["gasPrice"],hash:["transactionHash"],index:["transactionIndex"]});function g5t(e){return x5t(e)}function AIe(e){e.to&&js(e.to)===txe&&(e.to="0x0000000000000000000000000000000000000000");const t=Hk({hash:Qc,index:ea(Di,void 0),type:n=>n==="0x"||n==null?0:Di(n),accessList:ea(u5,null),blobVersionedHashes:ea(bE(Qc,!0),null),authorizationList:ea(bE(n=>{let r;if(n.signature)r=n.signature;else{let s=n.yParity;s==="0x1b"?s=0:s==="0x1c"&&(s=1),r=Object.assign({},n,{yParity:s})}return{address:na(n.address),chainId:js(n.chainId),nonce:js(n.nonce),signature:nu.from(r)}},!1),null),blockHash:ea(Qc,null),blockNumber:ea(Di,null),transactionIndex:ea(Di,null),from:na,gasPrice:ea(js),maxPriorityFeePerGas:ea(js),maxFeePerGas:ea(js),maxFeePerBlobGas:ea(js,null),gasLimit:js,to:ea(na,null),value:js,nonce:Di,data:VS,creates:ea(na,null),chainId:ea(js,null)},{data:["input"],gasLimit:["gas"],index:["transactionIndex"]})(e);if(t.to==null&&t.creates==null&&(t.creates=swt(t)),(e.type===1||e.type===2)&&e.accessList==null&&(t.accessList=[]),e.signature?t.signature=nu.from(e.signature):t.signature=nu.from(e),t.chainId==null){const n=t.signature.legacyChainId;n!=null&&(t.chainId=n)}return t.blockHash&&js(t.blockHash)===txe&&(t.blockHash=null),t}const b5t="0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e";class Vk{constructor(t){Un(this,"name");Ds(this,{name:t})}clone(){return new Vk(this.name)}}class WB extends Vk{constructor(n,r){n==null&&(n=0);super(`org.ethers.network.plugins.GasCost#${n||0}`);Un(this,"effectiveBlock");Un(this,"txBase");Un(this,"txCreate");Un(this,"txDataZero");Un(this,"txDataNonzero");Un(this,"txAccessListStorageKey");Un(this,"txAccessListAddress");const s={effectiveBlock:n};function a(o,l){let c=(r||{})[o];c==null&&(c=l),bn(typeof c=="number",`invalud value for ${o}`,"costs",r),s[o]=c}a("txBase",21e3),a("txCreate",32e3),a("txDataZero",4),a("txDataNonzero",16),a("txAccessListStorageKey",1900),a("txAccessListAddress",2400),Ds(this,s)}clone(){return new WB(this.effectiveBlock,this)}}class qB extends Vk{constructor(n,r){super("org.ethers.plugins.network.Ens");Un(this,"address");Un(this,"targetNetwork");Ds(this,{address:n||b5t,targetNetwork:r??1})}clone(){return new qB(this.address,this.targetNetwork)}}var ak,ok;class y5t extends Vk{constructor(n,r){super("org.ethers.plugins.network.FetchUrlFeeDataPlugin");Rn(this,ak);Rn(this,ok);Wt(this,ak,n),Wt(this,ok,r)}get url(){return ze(this,ak)}get processFunc(){return ze(this,ok)}clone(){return this}}ak=new WeakMap,ok=new WeakMap;const VH=new Map;var iS,aS,ny,zg;let hy=(zg=class{constructor(t,n){Rn(this,iS);Rn(this,aS);Rn(this,ny);Wt(this,iS,t),Wt(this,aS,js(n)),Wt(this,ny,new Map)}toJSON(){return{name:this.name,chainId:String(this.chainId)}}get name(){return ze(this,iS)}set name(t){Wt(this,iS,t)}get chainId(){return ze(this,aS)}set chainId(t){Wt(this,aS,js(t,"chainId"))}matches(t){if(t==null)return!1;if(typeof t=="string"){try{return this.chainId===js(t)}catch{}return this.name===t}if(typeof t=="number"||typeof t=="bigint"){try{return this.chainId===js(t)}catch{}return!1}if(typeof t=="object"){if(t.chainId!=null){try{return this.chainId===js(t.chainId)}catch{}return!1}return t.name!=null?this.name===t.name:!1}return!1}get plugins(){return Array.from(ze(this,ny).values())}attachPlugin(t){if(ze(this,ny).get(t.name))throw new Error(`cannot replace existing plugin: ${t.name} `);return ze(this,ny).set(t.name,t.clone()),this}getPlugin(t){return ze(this,ny).get(t)||null}getPlugins(t){return this.plugins.filter(n=>n.name.split("#")[0]===t)}clone(){const t=new zg(this.name,this.chainId);return this.plugins.forEach(n=>{t.attachPlugin(n.clone())}),t}computeIntrinsicGas(t){const n=this.getPlugin("org.ethers.plugins.network.GasCost")||new WB;let r=n.txBase;if(t.to==null&&(r+=n.txCreate),t.data)for(let s=2;s<t.data.length;s+=2)t.data.substring(s,s+2)==="00"?r+=n.txDataZero:r+=n.txDataNonzero;if(t.accessList){const s=u5(t.accessList);for(const a in s)r+=n.txAccessListAddress+n.txAccessListStorageKey*s[a].storageKeys.length}return r}static from(t){if(v5t(),t==null)return zg.from("mainnet");if(typeof t=="number"&&(t=BigInt(t)),typeof t=="string"||typeof t=="bigint"){const n=VH.get(t);if(n)return n();if(typeof t=="bigint")return new zg("unknown",t);bn(!1,"unknown network","network",t)}if(typeof t.clone=="function")return t.clone();if(typeof t=="object"){bn(typeof t.name=="string"&&typeof t.chainId=="number","invalid network object name or chainId","network",t);const n=new zg(t.name,t.chainId);return(t.ensAddress||t.ensNetwork!=null)&&n.attachPlugin(new qB(t.ensAddress,t.ensNetwork)),n}bn(!1,"invalid network","network",t)}static register(t,n){typeof t=="number"&&(t=BigInt(t));const r=VH.get(t);r&&bn(!1,`conflicting network for ${JSON.stringify(r.name)}`,"nameOrChainId",t),VH.set(t,n)}},iS=new WeakMap,aS=new WeakMap,ny=new WeakMap,zg);function nxe(e,t){const n=String(e);if(!n.match(/^[0-9.]+$/))throw new Error(`invalid gwei value: ${e}`);const r=n.split(".");if(r.length===1&&r.push(""),r.length!==2)throw new Error(`invalid gwei value: ${e}`);for(;r[1].length<t;)r[1]+="0";if(r[1].length>9){let s=BigInt(r[1].substring(0,9));r[1].substring(9).match(/^0+$/)||s++,r[1]=s.toString()}return BigInt(r[0]+r[1])}function rxe(e){return new y5t(e,async(t,n,r)=>{r.setHeader("User-Agent","ethers");let s;try{const[a,o]=await Promise.all([r.send(),t()]);s=a;const l=s.bodyJson.standard;return{gasPrice:o.gasPrice,maxFeePerGas:nxe(l.maxFee,9),maxPriorityFeePerGas:nxe(l.maxPriorityFee,9)}}catch(a){Lr(!1,`error encountered with polygon gas station (${JSON.stringify(r.url)})`,"SERVER_ERROR",{request:r,response:s,error:a})}})}let sxe=!1;function v5t(){if(sxe)return;sxe=!0;function e(t,n,r){const s=function(){const a=new hy(t,n);return r.ensNetwork!=null&&a.attachPlugin(new qB(null,r.ensNetwork)),a.attachPlugin(new WB),(r.plugins||[]).forEach(o=>{a.attachPlugin(o)}),a};hy.register(t,s),hy.register(n,s),r.altNames&&r.altNames.forEach(a=>{hy.register(a,s)})}e("mainnet",1,{ensNetwork:1,altNames:["homestead"]}),e("ropsten",3,{ensNetwork:3}),e("rinkeby",4,{ensNetwork:4}),e("goerli",5,{ensNetwork:5}),e("kovan",42,{ensNetwork:42}),e("sepolia",11155111,{ensNetwork:11155111}),e("holesky",17e3,{ensNetwork:17e3}),e("classic",61,{}),e("classicKotti",6,{}),e("arbitrum",42161,{ensNetwork:1}),e("arbitrum-goerli",421613,{}),e("arbitrum-sepolia",421614,{}),e("base",8453,{ensNetwork:1}),e("base-goerli",84531,{}),e("base-sepolia",84532,{}),e("bnb",56,{ensNetwork:1}),e("bnbt",97,{}),e("linea",59144,{ensNetwork:1}),e("linea-goerli",59140,{}),e("linea-sepolia",59141,{}),e("matic",137,{ensNetwork:1,plugins:[rxe("https://gasstation.polygon.technology/v2")]}),e("matic-amoy",80002,{}),e("matic-mumbai",80001,{altNames:["maticMumbai","maticmum"],plugins:[rxe("https://gasstation-testnet.polygon.technology/v2")]}),e("optimism",10,{ensNetwork:1,plugins:[]}),e("optimism-goerli",420,{}),e("optimism-sepolia",11155420,{}),e("xdai",100,{ensNetwork:1})}function zJ(e){return JSON.parse(JSON.stringify(e))}var Sg,Lh,ry,h0,oS,tO;class w5t{constructor(t){Rn(this,oS);Rn(this,Sg);Rn(this,Lh);Rn(this,ry);Rn(this,h0);Wt(this,Sg,t),Wt(this,Lh,null),Wt(this,ry,4e3),Wt(this,h0,-2)}get pollingInterval(){return ze(this,ry)}set pollingInterval(t){Wt(this,ry,t)}start(){ze(this,Lh)||(Wt(this,Lh,ze(this,Sg)._setTimeout(vr(this,oS,tO).bind(this),ze(this,ry))),vr(this,oS,tO).call(this))}stop(){ze(this,Lh)&&(ze(this,Sg)._clearTimeout(ze(this,Lh)),Wt(this,Lh,null))}pause(t){this.stop(),t&&Wt(this,h0,-2)}resume(){this.start()}}Sg=new WeakMap,Lh=new WeakMap,ry=new WeakMap,h0=new WeakMap,oS=new WeakSet,tO=async function(){try{const t=await ze(this,Sg).getBlockNumber();if(ze(this,h0)===-2){Wt(this,h0,t);return}if(t!==ze(this,h0)){for(let n=ze(this,h0)+1;n<=t;n++){if(ze(this,Lh)==null)return;await ze(this,Sg).emit("block",n)}Wt(this,h0,t)}}catch{}ze(this,Lh)!=null&&Wt(this,Lh,ze(this,Sg)._setTimeout(vr(this,oS,tO).bind(this),ze(this,ry)))};var Pw,Fw,sy;class Nae{constructor(t){Rn(this,Pw);Rn(this,Fw);Rn(this,sy);Wt(this,Pw,t),Wt(this,sy,!1),Wt(this,Fw,n=>{this._poll(n,ze(this,Pw))})}async _poll(t,n){throw new Error("sub-classes must override this")}start(){ze(this,sy)||(Wt(this,sy,!0),ze(this,Fw).call(this,-2),ze(this,Pw).on("block",ze(this,Fw)))}stop(){ze(this,sy)&&(Wt(this,sy,!1),ze(this,Pw).off("block",ze(this,Fw)))}pause(t){this.stop()}resume(){this.start()}}Pw=new WeakMap,Fw=new WeakMap,sy=new WeakMap;var lS,Ng;class C5t extends Nae{constructor(n,r){super(n);Rn(this,lS);Rn(this,Ng);Wt(this,lS,r),Wt(this,Ng,-2)}pause(n){n&&Wt(this,Ng,-2),super.pause(n)}async _poll(n,r){const s=await r.getBlock(ze(this,lS));s!=null&&(ze(this,Ng)===-2?Wt(this,Ng,s.number):s.number>ze(this,Ng)&&(r.emit(ze(this,lS),s.number),Wt(this,Ng,s.number)))}}lS=new WeakMap,Ng=new WeakMap;var mD;class S5t extends Nae{constructor(n,r){super(n);Rn(this,mD);Wt(this,mD,zJ(r))}async _poll(n,r){throw new Error("@TODO")}}mD=new WeakMap;var cS;class N5t extends Nae{constructor(n,r){super(n);Rn(this,cS);Wt(this,cS,r)}async _poll(n,r){const s=await r.getTransactionReceipt(ze(this,cS));s&&r.emit(ze(this,cS),s)}}cS=new WeakMap;var Ag,uS,dS,iy,Dh,xD,jIe;class Aae{constructor(t,n){Rn(this,xD);Rn(this,Ag);Rn(this,uS);Rn(this,dS);Rn(this,iy);Rn(this,Dh);Wt(this,Ag,t),Wt(this,uS,zJ(n)),Wt(this,dS,vr(this,xD,jIe).bind(this)),Wt(this,iy,!1),Wt(this,Dh,-2)}start(){ze(this,iy)||(Wt(this,iy,!0),ze(this,Dh)===-2&&ze(this,Ag).getBlockNumber().then(t=>{Wt(this,Dh,t)}),ze(this,Ag).on("block",ze(this,dS)))}stop(){ze(this,iy)&&(Wt(this,iy,!1),ze(this,Ag).off("block",ze(this,dS)))}pause(t){this.stop(),t&&Wt(this,Dh,-2)}resume(){this.start()}}Ag=new WeakMap,uS=new WeakMap,dS=new WeakMap,iy=new WeakMap,Dh=new WeakMap,xD=new WeakSet,jIe=async function(t){if(ze(this,Dh)===-2)return;const n=zJ(ze(this,uS));n.fromBlock=ze(this,Dh)+1,n.toBlock=t;const r=await ze(this,Ag).getLogs(n);if(r.length===0){ze(this,Dh)<t-60&&Wt(this,Dh,t-60);return}for(const s of r)ze(this,Ag).emit(ze(this,uS),s),Wt(this,Dh,s.blockNumber)};const A5t=BigInt(2),j5t=10;function rP(e){return e&&typeof e.then=="function"}function nO(e,t){return e+":"+JSON.stringify(t,(n,r)=>{if(r==null)return"null";if(typeof r=="bigint")return`bigint:${r.toString()}`;if(typeof r=="string")return r.toLowerCase();if(typeof r=="object"&&!Array.isArray(r)){const s=Object.keys(r);return s.sort(),s.reduce((a,o)=>(a[o]=r[o],a),{})}return r})}class EIe{constructor(t){Un(this,"name");Ds(this,{name:t})}start(){}stop(){}pause(t){}resume(){}}function E5t(e){return JSON.parse(JSON.stringify(e))}function HJ(e){return e=Array.from(new Set(e).values()),e.sort(),e}async function WH(e,t){if(e==null)throw new Error("invalid event");if(Array.isArray(e)&&(e={topics:e}),typeof e=="string")switch(e){case"block":case"debug":case"error":case"finalized":case"network":case"pending":case"safe":return{type:e,tag:e}}if(co(e,32)){const n=e.toLowerCase();return{type:"transaction",tag:nO("tx",{hash:n}),hash:n}}if(e.orphan){const n=e;return{type:"orphan",tag:nO("orphan",n),filter:E5t(n)}}if(e.address||e.topics){const n=e,r={topics:(n.topics||[]).map(s=>s==null?null:Array.isArray(s)?HJ(s.map(a=>a.toLowerCase())):s.toLowerCase())};if(n.address){const s=[],a=[],o=l=>{co(l)?s.push(l):a.push((async()=>{s.push(await kc(l,t))})())};Array.isArray(n.address)?n.address.forEach(o):o(n.address),a.length&&await Promise.all(a),r.address=HJ(s.map(l=>l.toLowerCase()))}return{filter:r,tag:nO("event",r),type:"event"}}bn(!1,"unknown ProviderEvent","event",e)}function qH(){return new Date().getTime()}const _5t={cacheTimeout:250,pollingInterval:4e3};var vu,ay,wu,fS,Of,Ow,oy,jg,lk,Bh,hS,pS,Hi,jf,VJ,WJ,gj,qJ,bj,rO;class k5t{constructor(t,n){Rn(this,Hi);Rn(this,vu);Rn(this,ay);Rn(this,wu);Rn(this,fS);Rn(this,Of);Rn(this,Ow);Rn(this,oy);Rn(this,jg);Rn(this,lk);Rn(this,Bh);Rn(this,hS);Rn(this,pS);if(Wt(this,pS,Object.assign({},_5t,n||{})),t==="any")Wt(this,Ow,!0),Wt(this,Of,null);else if(t){const r=hy.from(t);Wt(this,Ow,!1),Wt(this,Of,Promise.resolve(r)),setTimeout(()=>{this.emit("network",r,null)},0)}else Wt(this,Ow,!1),Wt(this,Of,null);Wt(this,jg,-1),Wt(this,oy,new Map),Wt(this,vu,new Map),Wt(this,ay,new Map),Wt(this,wu,null),Wt(this,fS,!1),Wt(this,lk,1),Wt(this,Bh,new Map),Wt(this,hS,!1)}get pollingInterval(){return ze(this,pS).pollingInterval}get provider(){return this}get plugins(){return Array.from(ze(this,ay).values())}attachPlugin(t){if(ze(this,ay).get(t.name))throw new Error(`cannot replace existing plugin: ${t.name} `);return ze(this,ay).set(t.name,t.connect(this)),this}getPlugin(t){return ze(this,ay).get(t)||null}get disableCcipRead(){return ze(this,hS)}set disableCcipRead(t){Wt(this,hS,!!t)}async ccipReadFetch(t,n,r){if(this.disableCcipRead||r.length===0||t.to==null)return null;const s=t.to.toLowerCase(),a=n.toLowerCase(),o=[];for(let l=0;l<r.length;l++){const c=r[l],u=c.replace("{sender}",s).replace("{data}",a),d=new Hy(u);c.indexOf("{data}")===-1&&(d.body={data:a,sender:s}),this.emit("debug",{action:"sendCcipReadFetchRequest",request:d,index:l,urls:r});let f="unknown error",x;try{x=await d.send()}catch(g){o.push(g.message),this.emit("debug",{action:"receiveCcipReadFetchError",request:d,result:{error:g}});continue}try{const g=x.bodyJson;if(g.data)return this.emit("debug",{action:"receiveCcipReadFetchResult",request:d,result:g}),g.data;g.message&&(f=g.message),this.emit("debug",{action:"receiveCcipReadFetchError",request:d,result:g})}catch{}Lr(x.statusCode<400||x.statusCode>=500,`response not found during CCIP fetch: ${f}`,"OFFCHAIN_FAULT",{reason:"404_MISSING_RESOURCE",transaction:t,info:{url:c,errorMessage:f}}),o.push(f)}Lr(!1,`error encountered during CCIP fetch: ${o.map(l=>JSON.stringify(l)).join(", ")}`,"OFFCHAIN_FAULT",{reason:"500_SERVER_ERROR",transaction:t,info:{urls:r,errorMessages:o}})}_wrapBlock(t,n){return new K3t(h5t(t),this)}_wrapLog(t,n){return new zk(d5t(t),this)}_wrapTransactionReceipt(t,n){return new fIe(g5t(t),this)}_wrapTransactionResponse(t,n){return new gE(AIe(t),this)}_detectNetwork(){Lr(!1,"sub-classes must implement this","UNSUPPORTED_OPERATION",{operation:"_detectNetwork"})}async _perform(t){Lr(!1,`unsupported method: ${t.method}`,"UNSUPPORTED_OPERATION",{operation:t.method,info:t})}async getBlockNumber(){const t=Di(await vr(this,Hi,jf).call(this,{method:"getBlockNumber"}),"%response");return ze(this,jg)>=0&&Wt(this,jg,t),t}_getAddress(t){return kc(t,this)}_getBlockTag(t){if(t==null)return"latest";switch(t){case"earliest":return"0x0";case"finalized":case"latest":case"pending":case"safe":return t}if(co(t))return co(t,32)?t:em(t);if(typeof t=="bigint"&&(t=Di(t,"blockTag")),typeof t=="number")return t>=0?em(t):ze(this,jg)>=0?em(ze(this,jg)+t):this.getBlockNumber().then(n=>em(n+t));bn(!1,"invalid blockTag","blockTag",t)}_getFilter(t){const n=(t.topics||[]).map(c=>c==null?null:Array.isArray(c)?HJ(c.map(u=>u.toLowerCase())):c.toLowerCase()),r="blockHash"in t?t.blockHash:void 0,s=(c,u,d)=>{let f;switch(c.length){case 0:break;case 1:f=c[0];break;default:c.sort(),f=c}if(r&&(u!=null||d!=null))throw new Error("invalid filter");const x={};return f&&(x.address=f),n.length&&(x.topics=n),u&&(x.fromBlock=u),d&&(x.toBlock=d),r&&(x.blockHash=r),x};let a=[];if(t.address)if(Array.isArray(t.address))for(const c of t.address)a.push(this._getAddress(c));else a.push(this._getAddress(t.address));let o;"fromBlock"in t&&(o=this._getBlockTag(t.fromBlock));let l;return"toBlock"in t&&(l=this._getBlockTag(t.toBlock)),a.filter(c=>typeof c!="string").length||o!=null&&typeof o!="string"||l!=null&&typeof l!="string"?Promise.all([Promise.all(a),o,l]).then(c=>s(c[0],c[1],c[2])):s(a,o,l)}_getTransactionRequest(t){const n=xE(t),r=[];if(["to","from"].forEach(s=>{if(n[s]==null)return;const a=kc(n[s],this);rP(a)?r.push(async function(){n[s]=await a}()):n[s]=a}),n.blockTag!=null){const s=this._getBlockTag(n.blockTag);rP(s)?r.push(async function(){n.blockTag=await s}()):n.blockTag=s}return r.length?async function(){return await Promise.all(r),n}():n}async getNetwork(){if(ze(this,Of)==null){const s=(async()=>{try{const a=await this._detectNetwork();return this.emit("network",a,null),a}catch(a){throw ze(this,Of)===s&&Wt(this,Of,null),a}})();return Wt(this,Of,s),(await s).clone()}const t=ze(this,Of),[n,r]=await Promise.all([t,this._detectNetwork()]);return n.chainId!==r.chainId&&(ze(this,Ow)?(this.emit("network",r,n),ze(this,Of)===t&&Wt(this,Of,Promise.resolve(r))):Lr(!1,`network changed: ${n.chainId} => ${r.chainId} `,"NETWORK_ERROR",{event:"changed"})),n.clone()}async getFeeData(){const t=await this.getNetwork(),n=async()=>{const{_block:s,gasPrice:a,priorityFee:o}=await Su({_block:vr(this,Hi,qJ).call(this,"latest",!1),gasPrice:(async()=>{try{const d=await vr(this,Hi,jf).call(this,{method:"getGasPrice"});return js(d,"%response")}catch{}return null})(),priorityFee:(async()=>{try{const d=await vr(this,Hi,jf).call(this,{method:"getPriorityFee"});return js(d,"%response")}catch{}return null})()});let l=null,c=null;const u=this._wrapBlock(s,t);return u&&u.baseFeePerGas&&(c=o??BigInt("1000000000"),l=u.baseFeePerGas*A5t+c),new Q0e(a,l,c)},r=t.getPlugin("org.ethers.plugins.network.FetchUrlFeeDataPlugin");if(r){const s=new Hy(r.url),a=await r.processFunc(n,this,s);return new Q0e(a.gasPrice,a.maxFeePerGas,a.maxPriorityFeePerGas)}return await n()}async estimateGas(t){let n=this._getTransactionRequest(t);return rP(n)&&(n=await n),js(await vr(this,Hi,jf).call(this,{method:"estimateGas",transaction:n}),"%response")}async call(t){const{tx:n,blockTag:r}=await Su({tx:this._getTransactionRequest(t),blockTag:this._getBlockTag(t.blockTag)});return await vr(this,Hi,WJ).call(this,vr(this,Hi,VJ).call(this,n,r,t.enableCcipRead?0:-1))}async getBalance(t,n){return js(await vr(this,Hi,gj).call(this,{method:"getBalance"},t,n),"%response")}async getTransactionCount(t,n){return Di(await vr(this,Hi,gj).call(this,{method:"getTransactionCount"},t,n),"%response")}async getCode(t,n){return Kr(await vr(this,Hi,gj).call(this,{method:"getCode"},t,n))}async getStorage(t,n,r){const s=js(n,"position");return Kr(await vr(this,Hi,gj).call(this,{method:"getStorage",position:s},t,r))}async broadcastTransaction(t){const{blockNumber:n,hash:r,network:s}=await Su({blockNumber:this.getBlockNumber(),hash:this._perform({method:"broadcastTransaction",signedTransaction:t}),network:this.getNetwork()}),a=gae.from(t);if(a.hash!==r)throw new Error("@TODO: the returned hash did not match");return this._wrapTransactionResponse(a,s).replaceableTransaction(n)}async getBlock(t,n){const{network:r,params:s}=await Su({network:this.getNetwork(),params:vr(this,Hi,qJ).call(this,t,!!n)});return s==null?null:this._wrapBlock(s,r)}async getTransaction(t){const{network:n,params:r}=await Su({network:this.getNetwork(),params:vr(this,Hi,jf).call(this,{method:"getTransaction",hash:t})});return r==null?null:this._wrapTransactionResponse(r,n)}async getTransactionReceipt(t){const{network:n,params:r}=await Su({network:this.getNetwork(),params:vr(this,Hi,jf).call(this,{method:"getTransactionReceipt",hash:t})});if(r==null)return null;if(r.gasPrice==null&&r.effectiveGasPrice==null){const s=await vr(this,Hi,jf).call(this,{method:"getTransaction",hash:t});if(s==null)throw new Error("report this; could not find tx or effectiveGasPrice");r.effectiveGasPrice=s.gasPrice}return this._wrapTransactionReceipt(r,n)}async getTransactionResult(t){const{result:n}=await Su({network:this.getNetwork(),result:vr(this,Hi,jf).call(this,{method:"getTransactionResult",hash:t})});return n==null?null:Kr(n)}async getLogs(t){let n=this._getFilter(t);rP(n)&&(n=await n);const{network:r,params:s}=await Su({network:this.getNetwork(),params:vr(this,Hi,jf).call(this,{method:"getLogs",filter:n})});return s.map(a=>this._wrapLog(a,r))}_getProvider(t){Lr(!1,"provider cannot connect to target network","UNSUPPORTED_OPERATION",{operation:"_getProvider()"})}async getResolver(t){return await AM.fromName(this,t)}async getAvatar(t){const n=await this.getResolver(t);return n?await n.getAvatar():null}async resolveName(t){const n=await this.getResolver(t);return n?await n.getAddress():null}async lookupAddress(t){t=na(t);const n=RJ(t.substring(2).toLowerCase()+".addr.reverse");try{const r=await AM.getEnsAddress(this),a=await new Wj(r,["function resolver(bytes32) view returns (address)"],this).resolver(n);if(a==null||a===cE)return null;const l=await new Wj(a,["function name(bytes32) view returns (string)"],this).name(n);return await this.resolveName(l)!==t?null:l}catch(r){if(Zc(r,"BAD_DATA")&&r.value==="0x"||Zc(r,"CALL_EXCEPTION"))return null;throw r}return null}async waitForTransaction(t,n,r){const s=n??1;return s===0?this.getTransactionReceipt(t):new Promise(async(a,o)=>{let l=null;const c=async u=>{try{const d=await this.getTransactionReceipt(t);if(d!=null&&u-d.blockNumber+1>=s){a(d),l&&(clearTimeout(l),l=null);return}}catch(d){console.log("EEE",d)}this.once("block",c)};r!=null&&(l=setTimeout(()=>{l!=null&&(l=null,this.off("block",c),o(_o("timeout","TIMEOUT",{reason:"timeout"})))},r)),c(await this.getBlockNumber())})}async waitForBlock(t){Lr(!1,"not implemented yet","NOT_IMPLEMENTED",{operation:"waitForBlock"})}_clearTimeout(t){const n=ze(this,Bh).get(t);n&&(n.timer&&clearTimeout(n.timer),ze(this,Bh).delete(t))}_setTimeout(t,n){n==null&&(n=0);const r=ib(this,lk)._++,s=()=>{ze(this,Bh).delete(r),t()};if(this.paused)ze(this,Bh).set(r,{timer:null,func:s,time:n});else{const a=setTimeout(s,n);ze(this,Bh).set(r,{timer:a,func:s,time:qH()})}return r}_forEachSubscriber(t){for(const n of ze(this,vu).values())t(n.subscriber)}_getSubscriber(t){switch(t.type){case"debug":case"error":case"network":return new EIe(t.type);case"block":{const n=new w5t(this);return n.pollingInterval=this.pollingInterval,n}case"safe":case"finalized":return new C5t(this,t.type);case"event":return new Aae(this,t.filter);case"transaction":return new N5t(this,t.hash);case"orphan":return new S5t(this,t.filter)}throw new Error(`unsupported event: ${t.type}`)}_recoverSubscriber(t,n){for(const r of ze(this,vu).values())if(r.subscriber===t){r.started&&r.subscriber.stop(),r.subscriber=n,r.started&&n.start(),ze(this,wu)!=null&&n.pause(ze(this,wu));break}}async on(t,n){const r=await vr(this,Hi,rO).call(this,t);return r.listeners.push({listener:n,once:!1}),r.started||(r.subscriber.start(),r.started=!0,ze(this,wu)!=null&&r.subscriber.pause(ze(this,wu))),this}async once(t,n){const r=await vr(this,Hi,rO).call(this,t);return r.listeners.push({listener:n,once:!0}),r.started||(r.subscriber.start(),r.started=!0,ze(this,wu)!=null&&r.subscriber.pause(ze(this,wu))),this}async emit(t,...n){const r=await vr(this,Hi,bj).call(this,t,n);if(!r||r.listeners.length===0)return!1;const s=r.listeners.length;return r.listeners=r.listeners.filter(({listener:a,once:o})=>{const l=new vke(this,o?null:a,t);try{a.call(this,...n,l)}catch{}return!o}),r.listeners.length===0&&(r.started&&r.subscriber.stop(),ze(this,vu).delete(r.tag)),s>0}async listenerCount(t){if(t){const r=await vr(this,Hi,bj).call(this,t);return r?r.listeners.length:0}let n=0;for(const{listeners:r}of ze(this,vu).values())n+=r.length;return n}async listeners(t){if(t){const r=await vr(this,Hi,bj).call(this,t);return r?r.listeners.map(({listener:s})=>s):[]}let n=[];for(const{listeners:r}of ze(this,vu).values())n=n.concat(r.map(({listener:s})=>s));return n}async off(t,n){const r=await vr(this,Hi,bj).call(this,t);if(!r)return this;if(n){const s=r.listeners.map(({listener:a})=>a).indexOf(n);s>=0&&r.listeners.splice(s,1)}return(!n||r.listeners.length===0)&&(r.started&&r.subscriber.stop(),ze(this,vu).delete(r.tag)),this}async removeAllListeners(t){if(t){const{tag:n,started:r,subscriber:s}=await vr(this,Hi,rO).call(this,t);r&&s.stop(),ze(this,vu).delete(n)}else for(const[n,{started:r,subscriber:s}]of ze(this,vu))r&&s.stop(),ze(this,vu).delete(n);return this}async addListener(t,n){return await this.on(t,n)}async removeListener(t,n){return this.off(t,n)}get destroyed(){return ze(this,fS)}destroy(){this.removeAllListeners();for(const t of ze(this,Bh).keys())this._clearTimeout(t);Wt(this,fS,!0)}get paused(){return ze(this,wu)!=null}set paused(t){!!t!==this.paused&&(this.paused?this.resume():this.pause(!1))}pause(t){if(Wt(this,jg,-1),ze(this,wu)!=null){if(ze(this,wu)==!!t)return;Lr(!1,"cannot change pause type; resume first","UNSUPPORTED_OPERATION",{operation:"pause"})}this._forEachSubscriber(n=>n.pause(t)),Wt(this,wu,!!t);for(const n of ze(this,Bh).values())n.timer&&clearTimeout(n.timer),n.time=qH()-n.time}resume(){if(ze(this,wu)!=null){this._forEachSubscriber(t=>t.resume()),Wt(this,wu,null);for(const t of ze(this,Bh).values()){let n=t.time;n<0&&(n=0),t.time=qH(),setTimeout(t.func,n)}}}}vu=new WeakMap,ay=new WeakMap,wu=new WeakMap,fS=new WeakMap,Of=new WeakMap,Ow=new WeakMap,oy=new WeakMap,jg=new WeakMap,lk=new WeakMap,Bh=new WeakMap,hS=new WeakMap,pS=new WeakMap,Hi=new WeakSet,jf=async function(t){const n=ze(this,pS).cacheTimeout;if(n<0)return await this._perform(t);const r=nO(t.method,t);let s=ze(this,oy).get(r);return s||(s=this._perform(t),ze(this,oy).set(r,s),setTimeout(()=>{ze(this,oy).get(r)===s&&ze(this,oy).delete(r)},n)),await s},VJ=async function(t,n,r){Lr(r<j5t,"CCIP read exceeded maximum redirections","OFFCHAIN_FAULT",{reason:"TOO_MANY_REDIRECTS",transaction:Object.assign({},t,{blockTag:n,enableCcipRead:!0})});const s=xE(t);try{return Kr(await this._perform({method:"call",transaction:s,blockTag:n}))}catch(a){if(!this.disableCcipRead&&sae(a)&&a.data&&r>=0&&n==="latest"&&s.to!=null&&go(a.data,0,4)==="0x556f1830"){const o=a.data,l=await kc(s.to,this);let c;try{c=O5t(go(a.data,4))}catch(f){Lr(!1,f.message,"OFFCHAIN_FAULT",{reason:"BAD_DATA",transaction:s,info:{data:o}})}Lr(c.sender.toLowerCase()===l.toLowerCase(),"CCIP Read sender mismatch","CALL_EXCEPTION",{action:"call",data:o,reason:"OffchainLookup",transaction:s,invocation:null,revert:{signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",name:"OffchainLookup",args:c.errorArgs}});const u=await this.ccipReadFetch(s,c.calldata,c.urls);Lr(u!=null,"CCIP Read failed to fetch data","OFFCHAIN_FAULT",{reason:"FETCH_FAILED",transaction:s,info:{data:a.data,errorArgs:c.errorArgs}});const d={to:l,data:Ra([c.selector,F5t([u,c.extraData])])};this.emit("debug",{action:"sendCcipReadCall",transaction:d});try{const f=await vr(this,Hi,VJ).call(this,d,n,r+1);return this.emit("debug",{action:"receiveCcipReadCallResult",transaction:Object.assign({},d),result:f}),f}catch(f){throw this.emit("debug",{action:"receiveCcipReadCallError",transaction:Object.assign({},d),error:f}),f}}throw a}},WJ=async function(t){const{value:n}=await Su({network:this.getNetwork(),value:t});return n},gj=async function(t,n,r){let s=this._getAddress(n),a=this._getBlockTag(r);return(typeof s!="string"||typeof a!="string")&&([s,a]=await Promise.all([s,a])),await vr(this,Hi,WJ).call(this,vr(this,Hi,jf).call(this,Object.assign(t,{address:s,blockTag:a})))},qJ=async function(t,n){if(co(t,32))return await vr(this,Hi,jf).call(this,{method:"getBlock",blockHash:t,includeTransactions:n});let r=this._getBlockTag(t);return typeof r!="string"&&(r=await r),await vr(this,Hi,jf).call(this,{method:"getBlock",blockTag:r,includeTransactions:n})},bj=async function(t,n){let r=await WH(t,this);return r.type==="event"&&n&&n.length>0&&n[0].removed===!0&&(r=await WH({orphan:"drop-log",log:n[0]},this)),ze(this,vu).get(r.tag)||null},rO=async function(t){const n=await WH(t,this),r=n.tag;let s=ze(this,vu).get(r);return s||(s={subscriber:this._getSubscriber(n),tag:r,addressableMap:new WeakMap,nameMap:new Map,started:!1,listeners:[]},ze(this,vu).set(r,s)),s};function T5t(e,t){try{const n=GJ(e,t);if(n)return gM(n)}catch{}return null}function GJ(e,t){if(e==="0x")return null;try{const n=Di(go(e,t,t+32)),r=Di(go(e,n,n+32));return go(e,n+32,n+32+r)}catch{}return null}function ixe(e){const t=il(e);if(t.length>32)throw new Error("internal; should not happen");const n=new Uint8Array(32);return n.set(t,32-t.length),n}function I5t(e){if(e.length%32===0)return e;const t=new Uint8Array(Math.ceil(e.length/32)*32);return t.set(e),t}const P5t=new Uint8Array([]);function F5t(e){const t=[];let n=0;for(let r=0;r<e.length;r++)t.push(P5t),n+=32;for(let r=0;r<e.length;r++){const s=hs(e[r]);t[r]=ixe(n),t.push(ixe(s.length)),t.push(I5t(s)),n+=32+Math.ceil(s.length/32)*32}return Ra(t)}const axe="0x0000000000000000000000000000000000000000000000000000000000000000";function O5t(e){const t={sender:"",urls:[],calldata:"",selector:"",extraData:"",errorArgs:[]};Lr(n4(e)>=5*32,"insufficient OffchainLookup data","OFFCHAIN_FAULT",{reason:"insufficient OffchainLookup data"});const n=go(e,0,32);Lr(go(n,0,12)===go(axe,0,12),"corrupt OffchainLookup sender","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup sender"}),t.sender=go(n,12);try{const r=[],s=Di(go(e,32,64)),a=Di(go(e,s,s+32)),o=go(e,s+32);for(let l=0;l<a;l++){const c=T5t(o,l*32);if(c==null)throw new Error("abort");r.push(c)}t.urls=r}catch{Lr(!1,"corrupt OffchainLookup urls","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup urls"})}try{const r=GJ(e,64);if(r==null)throw new Error("abort");t.calldata=r}catch{Lr(!1,"corrupt OffchainLookup calldata","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup calldata"})}Lr(go(e,100,128)===go(axe,0,28),"corrupt OffchainLookup callbaackSelector","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup callbaackSelector"}),t.selector=go(e,96,100);try{const r=GJ(e,128);if(r==null)throw new Error("abort");t.extraData=r}catch{Lr(!1,"corrupt OffchainLookup extraData","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup extraData"})}return t.errorArgs="sender,urls,calldata,selector,extraData".split(/,/).map(r=>t[r]),t}function ov(e,t){if(e.provider)return e.provider;Lr(!1,"missing provider","UNSUPPORTED_OPERATION",{operation:t})}async function oxe(e,t){let n=xE(t);if(n.to!=null&&(n.to=kc(n.to,e)),n.from!=null){const r=n.from;n.from=Promise.all([e.getAddress(),kc(r,e)]).then(([s,a])=>(bn(s.toLowerCase()===a.toLowerCase(),"transaction from mismatch","tx.from",a),s))}else n.from=e.getAddress();return await Su(n)}class jae{constructor(t){Un(this,"provider");Ds(this,{provider:t||null})}async getNonce(t){return ov(this,"getTransactionCount").getTransactionCount(await this.getAddress(),t)}async populateCall(t){return await oxe(this,t)}async populateTransaction(t){const n=ov(this,"populateTransaction"),r=await oxe(this,t);r.nonce==null&&(r.nonce=await this.getNonce("pending")),r.gasLimit==null&&(r.gasLimit=await this.estimateGas(r));const s=await this.provider.getNetwork();if(r.chainId!=null){const o=js(r.chainId);bn(o===s.chainId,"transaction chainId mismatch","tx.chainId",t.chainId)}else r.chainId=s.chainId;const a=r.maxFeePerGas!=null||r.maxPriorityFeePerGas!=null;if(r.gasPrice!=null&&(r.type===2||a)?bn(!1,"eip-1559 transaction do not support gasPrice","tx",t):(r.type===0||r.type===1)&&a&&bn(!1,"pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","tx",t),(r.type===2||r.type==null)&&r.maxFeePerGas!=null&&r.maxPriorityFeePerGas!=null)r.type=2;else if(r.type===0||r.type===1){const o=await n.getFeeData();Lr(o.gasPrice!=null,"network does not support gasPrice","UNSUPPORTED_OPERATION",{operation:"getGasPrice"}),r.gasPrice==null&&(r.gasPrice=o.gasPrice)}else{const o=await n.getFeeData();if(r.type==null)if(o.maxFeePerGas!=null&&o.maxPriorityFeePerGas!=null)if(r.authorizationList&&r.authorizationList.length?r.type=4:r.type=2,r.gasPrice!=null){const l=r.gasPrice;delete r.gasPrice,r.maxFeePerGas=l,r.maxPriorityFeePerGas=l}else r.maxFeePerGas==null&&(r.maxFeePerGas=o.maxFeePerGas),r.maxPriorityFeePerGas==null&&(r.maxPriorityFeePerGas=o.maxPriorityFeePerGas);else o.gasPrice!=null?(Lr(!a,"network does not support EIP-1559","UNSUPPORTED_OPERATION",{operation:"populateTransaction"}),r.gasPrice==null&&(r.gasPrice=o.gasPrice),r.type=0):Lr(!1,"failed to get consistent fee data","UNSUPPORTED_OPERATION",{operation:"signer.getFeeData"});else(r.type===2||r.type===3||r.type===4)&&(r.maxFeePerGas==null&&(r.maxFeePerGas=o.maxFeePerGas),r.maxPriorityFeePerGas==null&&(r.maxPriorityFeePerGas=o.maxPriorityFeePerGas))}return await Su(r)}async populateAuthorization(t){const n=Object.assign({},t);return n.chainId==null&&(n.chainId=(await ov(this,"getNetwork").getNetwork()).chainId),n.nonce==null&&(n.nonce=await this.getNonce()),n}async estimateGas(t){return ov(this,"estimateGas").estimateGas(await this.populateCall(t))}async call(t){return ov(this,"call").call(await this.populateCall(t))}async resolveName(t){return await ov(this,"resolveName").resolveName(t)}async sendTransaction(t){const n=ov(this,"sendTransaction"),r=await this.populateTransaction(t);delete r.from;const s=gae.from(r);return await n.broadcastTransaction(await this.signTransaction(s))}authorize(t){Lr(!1,"authorization not implemented for this signer","UNSUPPORTED_OPERATION",{operation:"authorize"})}}var mS,sO;const Yue=class Yue extends jae{constructor(n,r){super(r);Rn(this,mS);Un(this,"address");Ds(this,{address:n})}async getAddress(){return this.address}connect(n){return new Yue(this.address,n)}async signTransaction(n){vr(this,mS,sO).call(this,"transactions","signTransaction")}async signMessage(n){vr(this,mS,sO).call(this,"messages","signMessage")}async signTypedData(n,r,s){vr(this,mS,sO).call(this,"typed-data","signTypedData")}};mS=new WeakSet,sO=function(n,r){Lr(!1,`VoidSigner cannot sign ${n}`,"UNSUPPORTED_OPERATION",{operation:r})};let KJ=Yue;function M5t(e){return JSON.parse(JSON.stringify(e))}var Qu,p0,Mw,ly,Rw,xS,Jy,YJ,XJ;class _Ie{constructor(t){Rn(this,Jy);Rn(this,Qu);Rn(this,p0);Rn(this,Mw);Rn(this,ly);Rn(this,Rw);Rn(this,xS);Wt(this,Qu,t),Wt(this,p0,null),Wt(this,Mw,vr(this,Jy,YJ).bind(this)),Wt(this,ly,!1),Wt(this,Rw,null),Wt(this,xS,!1)}_subscribe(t){throw new Error("subclasses must override this")}_emitResults(t,n){throw new Error("subclasses must override this")}_recover(t){throw new Error("subclasses must override this")}start(){ze(this,ly)||(Wt(this,ly,!0),vr(this,Jy,YJ).call(this,-2))}stop(){ze(this,ly)&&(Wt(this,ly,!1),Wt(this,xS,!0),vr(this,Jy,XJ).call(this),ze(this,Qu).off("block",ze(this,Mw)))}pause(t){t&&vr(this,Jy,XJ).call(this),ze(this,Qu).off("block",ze(this,Mw))}resume(){this.start()}}Qu=new WeakMap,p0=new WeakMap,Mw=new WeakMap,ly=new WeakMap,Rw=new WeakMap,xS=new WeakMap,Jy=new WeakSet,YJ=async function(t){try{ze(this,p0)==null&&Wt(this,p0,this._subscribe(ze(this,Qu)));let n=null;try{n=await ze(this,p0)}catch(a){if(!Zc(a,"UNSUPPORTED_OPERATION")||a.operation!=="eth_newFilter")throw a}if(n==null){Wt(this,p0,null),ze(this,Qu)._recoverSubscriber(this,this._recover(ze(this,Qu)));return}const r=await ze(this,Qu).getNetwork();if(ze(this,Rw)||Wt(this,Rw,r),ze(this,Rw).chainId!==r.chainId)throw new Error("chaid changed");if(ze(this,xS))return;const s=await ze(this,Qu).send("eth_getFilterChanges",[n]);await this._emitResults(ze(this,Qu),s)}catch(n){console.log("@TODO",n)}ze(this,Qu).once("block",ze(this,Mw))},XJ=function(){const t=ze(this,p0);t&&(Wt(this,p0,null),t.then(n=>{ze(this,Qu).destroyed||ze(this,Qu).send("eth_uninstallFilter",[n])}))};var Lw;class R5t extends _Ie{constructor(n,r){super(n);Rn(this,Lw);Wt(this,Lw,M5t(r))}_recover(n){return new Aae(n,ze(this,Lw))}async _subscribe(n){return await n.send("eth_newFilter",[ze(this,Lw)])}async _emitResults(n,r){for(const s of r)n.emit(ze(this,Lw),n._wrapLog(s,n._network))}}Lw=new WeakMap;class L5t extends _Ie{async _subscribe(t){return await t.send("eth_newPendingTransactionFilter",[])}async _emitResults(t,n){for(const r of n)t.emit("pending",r)}}const D5t="bigint,boolean,function,number,string,symbol".split(/,/g);function iO(e){if(e==null||D5t.indexOf(typeof e)>=0||typeof e.getAddress=="function")return e;if(Array.isArray(e))return e.map(iO);if(typeof e=="object")return Object.keys(e).reduce((t,n)=>(t[n]=e[n],t),{});throw new Error(`should not happen: ${e} (${typeof e})`)}function B5t(e){return new Promise(t=>{setTimeout(t,e)})}function $6(e){return e&&e.toLowerCase()}function lxe(e){return e&&typeof e.pollingInterval=="number"}const kIe={polling:!1,staticNetwork:null,batchStallTime:10,batchMaxSize:1<<20,batchMaxCount:100,cacheTimeout:250,pollingInterval:4e3};class GH extends jae{constructor(n,r){super(n);Un(this,"address");r=na(r),Ds(this,{address:r})}connect(n){Lr(!1,"cannot reconnect JsonRpcSigner","UNSUPPORTED_OPERATION",{operation:"signer.connect"})}async getAddress(){return this.address}async populateTransaction(n){return await this.populateCall(n)}async sendUncheckedTransaction(n){const r=iO(n),s=[];if(r.from){const o=r.from;s.push((async()=>{const l=await kc(o,this.provider);bn(l!=null&&l.toLowerCase()===this.address.toLowerCase(),"from address mismatch","transaction",n),r.from=l})())}else r.from=this.address;if(r.gasLimit==null&&s.push((async()=>{r.gasLimit=await this.provider.estimateGas({...r,from:this.address})})()),r.to!=null){const o=r.to;s.push((async()=>{r.to=await kc(o,this.provider)})())}s.length&&await Promise.all(s);const a=this.provider.getRpcTransaction(r);return this.provider.send("eth_sendTransaction",[a])}async sendTransaction(n){const r=await this.provider.getBlockNumber(),s=await this.sendUncheckedTransaction(n);return await new Promise((a,o)=>{const l=[1e3,100];let c=0;const u=async()=>{try{const d=await this.provider.getTransaction(s);if(d!=null){a(d.replaceableTransaction(r));return}}catch(d){if(Zc(d,"CANCELLED")||Zc(d,"BAD_DATA")||Zc(d,"NETWORK_ERROR")||Zc(d,"UNSUPPORTED_OPERATION")){d.info==null&&(d.info={}),d.info.sendTransactionHash=s,o(d);return}if(Zc(d,"INVALID_ARGUMENT")&&(c++,d.info==null&&(d.info={}),d.info.sendTransactionHash=s,c>10)){o(d);return}this.provider.emit("error",_o("failed to fetch transation after sending (will try again)","UNKNOWN_ERROR",{error:d}))}this.provider._setTimeout(()=>{u()},l.pop()||4e3)};u()})}async signTransaction(n){const r=iO(n);if(r.from){const a=await kc(r.from,this.provider);bn(a!=null&&a.toLowerCase()===this.address.toLowerCase(),"from address mismatch","transaction",n),r.from=a}else r.from=this.address;const s=this.provider.getRpcTransaction(r);return await this.provider.send("eth_signTransaction",[s])}async signMessage(n){const r=typeof n=="string"?ud(n):n;return await this.provider.send("personal_sign",[Kr(r),this.address.toLowerCase()])}async signTypedData(n,r,s){const a=iO(s),o=await HS.resolveNames(n,r,a,async l=>{const c=await kc(l);return bn(c!=null,"TypedData does not support null address","value",l),c});return await this.provider.send("eth_signTypedData_v4",[this.address.toLowerCase(),JSON.stringify(HS.getPayload(o.domain,r,o.value))])}async unlock(n){return this.provider.send("personal_unlockAccount",[this.address.toLowerCase(),n,null])}async _legacySignMessage(n){const r=typeof n=="string"?ud(n):n;return await this.provider.send("eth_sign",[this.address.toLowerCase(),Kr(r)])}}var Dw,gS,Eg,m0,Gp,$h,$d,ck,QJ;class $5t extends k5t{constructor(n,r){super(n,r);Rn(this,ck);Rn(this,Dw);Rn(this,gS);Rn(this,Eg);Rn(this,m0);Rn(this,Gp);Rn(this,$h);Rn(this,$d);Wt(this,gS,1),Wt(this,Dw,Object.assign({},kIe,r||{})),Wt(this,Eg,[]),Wt(this,m0,null),Wt(this,$h,null),Wt(this,$d,null);{let a=null;const o=new Promise(l=>{a=l});Wt(this,Gp,{promise:o,resolve:a})}const s=this._getOption("staticNetwork");typeof s=="boolean"?(bn(!s||n!=="any","staticNetwork cannot be used on special network 'any'","options",r),s&&n!=null&&Wt(this,$h,hy.from(n))):s&&(bn(n==null||s.matches(n),"staticNetwork MUST match network object","options",r),Wt(this,$h,s))}_getOption(n){return ze(this,Dw)[n]}get _network(){return Lr(ze(this,$h),"network is not available yet","NETWORK_ERROR"),ze(this,$h)}async _perform(n){if(n.method==="call"||n.method==="estimateGas"){let s=n.transaction;if(s&&s.type!=null&&js(s.type)&&s.maxFeePerGas==null&&s.maxPriorityFeePerGas==null){const a=await this.getFeeData();a.maxFeePerGas==null&&a.maxPriorityFeePerGas==null&&(n=Object.assign({},n,{transaction:Object.assign({},s,{type:void 0})}))}}const r=this.getRpcRequest(n);return r!=null?await this.send(r.method,r.args):super._perform(n)}async _detectNetwork(){const n=this._getOption("staticNetwork");if(n)if(n===!0){if(ze(this,$h))return ze(this,$h)}else return n;return ze(this,$d)?await ze(this,$d):this.ready?(Wt(this,$d,(async()=>{try{const r=hy.from(js(await this.send("eth_chainId",[])));return Wt(this,$d,null),r}catch(r){throw Wt(this,$d,null),r}})()),await ze(this,$d)):(Wt(this,$d,(async()=>{const r={id:ib(this,gS)._++,method:"eth_chainId",params:[],jsonrpc:"2.0"};this.emit("debug",{action:"sendRpcPayload",payload:r});let s;try{s=(await this._send(r))[0],Wt(this,$d,null)}catch(a){throw Wt(this,$d,null),this.emit("debug",{action:"receiveRpcError",error:a}),a}if(this.emit("debug",{action:"receiveRpcResult",result:s}),"result"in s)return hy.from(js(s.result));throw this.getRpcError(r,s)})()),await ze(this,$d))}_start(){ze(this,Gp)==null||ze(this,Gp).resolve==null||(ze(this,Gp).resolve(),Wt(this,Gp,null),(async()=>{for(;ze(this,$h)==null&&!this.destroyed;)try{Wt(this,$h,await this._detectNetwork())}catch(n){if(this.destroyed)break;console.log("JsonRpcProvider failed to detect network and cannot start up; retry in 1s (perhaps the URL is wrong or the node is not started)"),this.emit("error",_o("failed to bootstrap network detection","NETWORK_ERROR",{event:"initial-network-discovery",info:{error:n}})),await B5t(1e3)}vr(this,ck,QJ).call(this)})())}async _waitUntilReady(){if(ze(this,Gp)!=null)return await ze(this,Gp).promise}_getSubscriber(n){return n.type==="pending"?new L5t(this):n.type==="event"?this._getOption("polling")?new Aae(this,n.filter):new R5t(this,n.filter):n.type==="orphan"&&n.filter.orphan==="drop-log"?new EIe("orphan"):super._getSubscriber(n)}get ready(){return ze(this,Gp)==null}getRpcTransaction(n){const r={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach(s=>{if(n[s]==null)return;let a=s;s==="gasLimit"&&(a="gas"),r[a]=em(js(n[s],`tx.${s}`))}),["from","to","data"].forEach(s=>{n[s]!=null&&(r[s]=Kr(n[s]))}),n.accessList&&(r.accessList=u5(n.accessList)),n.blobVersionedHashes&&(r.blobVersionedHashes=n.blobVersionedHashes.map(s=>s.toLowerCase())),n.authorizationList&&(r.authorizationList=n.authorizationList.map(s=>{const a=ITe(s);return{address:a.address,nonce:em(a.nonce),chainId:em(a.chainId),yParity:em(a.signature.yParity),r:em(a.signature.r),s:em(a.signature.s)}})),r}getRpcRequest(n){switch(n.method){case"chainId":return{method:"eth_chainId",args:[]};case"getBlockNumber":return{method:"eth_blockNumber",args:[]};case"getGasPrice":return{method:"eth_gasPrice",args:[]};case"getPriorityFee":return{method:"eth_maxPriorityFeePerGas",args:[]};case"getBalance":return{method:"eth_getBalance",args:[$6(n.address),n.blockTag]};case"getTransactionCount":return{method:"eth_getTransactionCount",args:[$6(n.address),n.blockTag]};case"getCode":return{method:"eth_getCode",args:[$6(n.address),n.blockTag]};case"getStorage":return{method:"eth_getStorageAt",args:[$6(n.address),"0x"+n.position.toString(16),n.blockTag]};case"broadcastTransaction":return{method:"eth_sendRawTransaction",args:[n.signedTransaction]};case"getBlock":if("blockTag"in n)return{method:"eth_getBlockByNumber",args:[n.blockTag,!!n.includeTransactions]};if("blockHash"in n)return{method:"eth_getBlockByHash",args:[n.blockHash,!!n.includeTransactions]};break;case"getTransaction":return{method:"eth_getTransactionByHash",args:[n.hash]};case"getTransactionReceipt":return{method:"eth_getTransactionReceipt",args:[n.hash]};case"call":return{method:"eth_call",args:[this.getRpcTransaction(n.transaction),n.blockTag]};case"estimateGas":return{method:"eth_estimateGas",args:[this.getRpcTransaction(n.transaction)]};case"getLogs":return n.filter&&n.filter.address!=null&&(Array.isArray(n.filter.address)?n.filter.address=n.filter.address.map($6):n.filter.address=$6(n.filter.address)),{method:"eth_getLogs",args:[n.filter]}}return null}getRpcError(n,r){const{method:s}=n,{error:a}=r;if(s==="eth_estimateGas"&&a.message){const c=a.message;if(!c.match(/revert/i)&&c.match(/insufficient funds/i))return _o("insufficient funds","INSUFFICIENT_FUNDS",{transaction:n.params[0],info:{payload:n,error:a}});if(c.match(/nonce/i)&&c.match(/too low/i))return _o("nonce has already been used","NONCE_EXPIRED",{transaction:n.params[0],info:{payload:n,error:a}})}if(s==="eth_call"||s==="eth_estimateGas"){const c=ZJ(a),u=mE.getBuiltinCallException(s==="eth_call"?"call":"estimateGas",n.params[0],c?c.data:null);return u.info={error:a,payload:n},u}const o=JSON.stringify(z5t(a));if(typeof a.message=="string"&&a.message.match(/user denied|ethers-user-denied/i))return _o("user rejected action","ACTION_REJECTED",{action:{eth_sign:"signMessage",personal_sign:"signMessage",eth_signTypedData_v4:"signTypedData",eth_signTransaction:"signTransaction",eth_sendTransaction:"sendTransaction",eth_requestAccounts:"requestAccess",wallet_requestAccounts:"requestAccess"}[s]||"unknown",reason:"rejected",info:{payload:n,error:a}});if(s==="eth_sendRawTransaction"||s==="eth_sendTransaction"){const c=n.params[0];if(o.match(/insufficient funds|base fee exceeds gas limit/i))return _o("insufficient funds for intrinsic transaction cost","INSUFFICIENT_FUNDS",{transaction:c,info:{error:a}});if(o.match(/nonce/i)&&o.match(/too low/i))return _o("nonce has already been used","NONCE_EXPIRED",{transaction:c,info:{error:a}});if(o.match(/replacement transaction/i)&&o.match(/underpriced/i))return _o("replacement fee too low","REPLACEMENT_UNDERPRICED",{transaction:c,info:{error:a}});if(o.match(/only replay-protected/i))return _o("legacy pre-eip-155 transactions not supported","UNSUPPORTED_OPERATION",{operation:s,info:{transaction:c,info:{error:a}}})}let l=!!o.match(/the method .* does not exist/i);return l||a&&a.details&&a.details.startsWith("Unauthorized method:")&&(l=!0),l?_o("unsupported operation","UNSUPPORTED_OPERATION",{operation:n.method,info:{error:a,payload:n}}):_o("could not coalesce error","UNKNOWN_ERROR",{error:a,payload:n})}send(n,r){if(this.destroyed)return Promise.reject(_o("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:n}));const s=ib(this,gS)._++,a=new Promise((o,l)=>{ze(this,Eg).push({resolve:o,reject:l,payload:{method:n,params:r,id:s,jsonrpc:"2.0"}})});return vr(this,ck,QJ).call(this),a}async getSigner(n){n==null&&(n=0);const r=this.send("eth_accounts",[]);if(typeof n=="number"){const a=await r;if(n>=a.length)throw new Error("no such account");return new GH(this,a[n])}const{accounts:s}=await Su({network:this.getNetwork(),accounts:r});n=na(n);for(const a of s)if(na(a)===n)return new GH(this,n);throw new Error("invalid account")}async listAccounts(){return(await this.send("eth_accounts",[])).map(r=>new GH(this,r))}destroy(){ze(this,m0)&&(clearTimeout(ze(this,m0)),Wt(this,m0,null));for(const{payload:n,reject:r}of ze(this,Eg))r(_o("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:n.method}));Wt(this,Eg,[]),super.destroy()}}Dw=new WeakMap,gS=new WeakMap,Eg=new WeakMap,m0=new WeakMap,Gp=new WeakMap,$h=new WeakMap,$d=new WeakMap,ck=new WeakSet,QJ=function(){if(ze(this,m0))return;const n=this._getOption("batchMaxCount")===1?0:this._getOption("batchStallTime");Wt(this,m0,setTimeout(()=>{Wt(this,m0,null);const r=ze(this,Eg);for(Wt(this,Eg,[]);r.length;){const s=[r.shift()];for(;r.length&&s.length!==ze(this,Dw).batchMaxCount;)if(s.push(r.shift()),JSON.stringify(s.map(o=>o.payload)).length>ze(this,Dw).batchMaxSize){r.unshift(s.pop());break}(async()=>{const a=s.length===1?s[0].payload:s.map(o=>o.payload);this.emit("debug",{action:"sendRpcPayload",payload:a});try{const o=await this._send(a);this.emit("debug",{action:"receiveRpcResult",result:o});for(const{resolve:l,reject:c,payload:u}of s){if(this.destroyed){c(_o("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:u.method}));continue}const d=o.filter(f=>f.id===u.id)[0];if(d==null){const f=_o("missing response for request","BAD_DATA",{value:o,info:{payload:u}});this.emit("error",f),c(f);continue}if("error"in d){c(this.getRpcError(u,d));continue}l(d.result)}}catch(o){this.emit("debug",{action:"receiveRpcError",error:o});for(const{reject:l}of s)l(o)}})()}},n))};var cy;class U5t extends $5t{constructor(n,r){super(n,r);Rn(this,cy);let s=this._getOption("pollingInterval");s==null&&(s=kIe.pollingInterval),Wt(this,cy,s)}_getSubscriber(n){const r=super._getSubscriber(n);return lxe(r)&&(r.pollingInterval=ze(this,cy)),r}get pollingInterval(){return ze(this,cy)}set pollingInterval(n){if(!Number.isInteger(n)||n<0)throw new Error("invalid interval");Wt(this,cy,n),this._forEachSubscriber(r=>{lxe(r)&&(r.pollingInterval=ze(this,cy))})}}cy=new WeakMap;function ZJ(e){if(e==null)return null;if(typeof e.message=="string"&&e.message.match(/revert/i)&&co(e.data))return{message:e.message,data:e.data};if(typeof e=="object"){for(const t in e){const n=ZJ(e[t]);if(n)return n}return null}if(typeof e=="string")try{return ZJ(JSON.parse(e))}catch{}return null}function JJ(e,t){if(e!=null){if(typeof e.message=="string"&&t.push(e.message),typeof e=="object")for(const n in e)JJ(e[n],t);if(typeof e=="string")try{return JJ(JSON.parse(e),t)}catch{}}}function z5t(e){const t=[];return JJ(e,t),t}var bS,yS;const $v=class $v extends U5t{constructor(n,r,s){const a=Object.assign({},s??{},{batchMaxCount:1});bn(n&&n.request,"invalid EIP-1193 provider","ethereum",n);super(r,a);Rn(this,bS);Rn(this,yS);Wt(this,yS,null),s&&s.providerInfo&&Wt(this,yS,s.providerInfo),Wt(this,bS,async(o,l)=>{const c={method:o,params:l};this.emit("debug",{action:"sendEip1193Request",payload:c});try{const u=await n.request(c);return this.emit("debug",{action:"receiveEip1193Result",result:u}),u}catch(u){const d=new Error(u.message);throw d.code=u.code,d.data=u.data,d.payload=c,this.emit("debug",{action:"receiveEip1193Error",error:d}),d}})}get providerInfo(){return ze(this,yS)}async send(n,r){return await this._start(),await super.send(n,r)}async _send(n){bn(!Array.isArray(n),"EIP-1193 does not support batch request","payload",n);try{const r=await ze(this,bS).call(this,n.method,n.params||[]);return[{id:n.id,result:r}]}catch(r){return[{id:n.id,error:{code:r.code,data:r.data,message:r.message}}]}}getRpcError(n,r){switch(r=JSON.parse(JSON.stringify(r)),r.error.code||-1){case 4001:r.error.message=`ethers-user-denied: ${r.error.message}`;break;case 4200:r.error.message=`ethers-unsupported: ${r.error.message}`;break}return super.getRpcError(n,r)}async hasSigner(n){n==null&&(n=0);const r=await this.send("eth_accounts",[]);return typeof n=="number"?r.length>n:(n=n.toLowerCase(),r.filter(s=>s.toLowerCase()===n).length!==0)}async getSigner(n){if(n==null&&(n=0),!await this.hasSigner(n))try{await ze(this,bS).call(this,"eth_requestAccounts",[])}catch(r){const s=r.payload;throw this.getRpcError(s,{id:s.id,error:r})}return await super.getSigner(n)}static async discover(n){if(n==null&&(n={}),n.provider)return new $v(n.provider);const r=n.window?n.window:typeof window<"u"?window:null;if(r==null)return null;const s=n.anyProvider;if(s&&r.ethereum)return new $v(r.ethereum);if(!("addEventListener"in r&&"dispatchEvent"in r&&"removeEventListener"in r))return null;const a=n.timeout?n.timeout:300;return a===0?null:await new Promise((o,l)=>{let c=[];const u=x=>{c.push(x.detail),s&&d()},d=()=>{if(clearTimeout(f),c.length)if(n&&n.filter){const x=n.filter(c.map(g=>Object.assign({},g.info)));if(x==null)o(null);else if(x instanceof $v)o(x);else{let g=null;if(x.uuid&&(g=c.filter(w=>x.uuid===w.info.uuid)[0]),g){const{provider:v,info:w}=g;o(new $v(v,void 0,{providerInfo:w}))}else l(_o("filter returned unknown info","UNSUPPORTED_OPERATION",{value:x}))}}else{const{provider:x,info:g}=c[0];o(new $v(x,void 0,{providerInfo:g}))}else o(null);r.removeEventListener("eip6963:announceProvider",u)},f=setTimeout(()=>{d()},a);r.addEventListener("eip6963:announceProvider",u),r.dispatchEvent(new Event("eip6963:requestProvider"))})}};bS=new WeakMap,yS=new WeakMap;let jM=$v;var vS;const Xue=class Xue extends jae{constructor(n,r){super(r);Un(this,"address");Rn(this,vS);bn(n&&typeof n.sign=="function","invalid private key","privateKey","[ REDACTED ]"),Wt(this,vS,n);const s=Uk(this.signingKey.publicKey);Ds(this,{address:s})}get signingKey(){return ze(this,vS)}get privateKey(){return this.signingKey.privateKey}async getAddress(){return this.address}connect(n){return new Xue(ze(this,vS),n)}async signTransaction(n){n=xE(n);const{to:r,from:s}=await Su({to:n.to?kc(n.to,this):void 0,from:n.from?kc(n.from,this):void 0});r!=null&&(n.to=r),s!=null&&(n.from=s),n.from!=null&&(bn(na(n.from)===this.address,"transaction from address mismatch","tx.from",n.from),delete n.from);const a=gae.from(n);return a.signature=this.signingKey.sign(a.unsignedHash),a.serialized}async signMessage(n){return this.signMessageSync(n)}signMessageSync(n){return this.signingKey.sign(S3t(n)).serialized}authorizeSync(n){bn(typeof n.address=="string","invalid address for authorizeSync","auth.address",n);const r=this.signingKey.sign(Dwt(n));return Object.assign({},{address:na(n.address),nonce:js(n.nonce||0),chainId:js(n.chainId||0)},{signature:r})}async authorize(n){return n=Object.assign({},n,{address:await kc(n.address,this)}),this.authorizeSync(await this.populateAuthorization(n))}async signTypedData(n,r,s){const a=await HS.resolveNames(n,r,s,async o=>{Lr(this.provider!=null,"cannot resolve ENS names without a provider","UNSUPPORTED_OPERATION",{operation:"resolveName",info:{name:o}});const l=await this.provider.resolveName(o);return Lr(l!=null,"unconfigured ENS name","UNCONFIGURED_NAME",{value:o}),l});return this.signingKey.sign(HS.hash(a.domain,r,a.value)).serialized}};vS=new WeakMap;let EM=Xue;const _M=" !#$%&'()*+,-./<=>?@[]^_`{|}~",H5t=/^[a-z]*$/i;function cxe(e,t){let n=97;return e.reduce((r,s)=>(s===t?n++:s.match(H5t)?r.push(String.fromCharCode(n)+s):(n=97,r.push(s)),r),[])}function V5t(e,t){for(let s=_M.length-1;s>=0;s--)e=e.split(_M[s]).join(t.substring(2*s,2*s+2));const n=[],r=e.replace(/(:|([0-9])|([A-Z][a-z]*))/g,(s,a,o,l)=>{if(o)for(let c=parseInt(o);c>=0;c--)n.push(";");else n.push(a.toLowerCase());return""});if(r)throw new Error(`leftovers: ${JSON.stringify(r)}`);return cxe(cxe(n,";"),":")}function W5t(e){return bn(e[0]==="0","unsupported auwl data","data",e),V5t(e.substring(1+2*_M.length),e.substring(1,1+2*_M.length))}class q5t{constructor(t){Un(this,"locale");Ds(this,{locale:t})}split(t){return t.toLowerCase().split(/\s+/g)}join(t){return t.join(" ")}}var wS,uk,Bw,dk,eee;class G5t extends q5t{constructor(n,r,s){super(n);Rn(this,dk);Rn(this,wS);Rn(this,uk);Rn(this,Bw);Wt(this,wS,r),Wt(this,uk,s),Wt(this,Bw,null)}get _data(){return ze(this,wS)}_decodeWords(){return W5t(ze(this,wS))}getWord(n){const r=vr(this,dk,eee).call(this);return bn(n>=0&&n<r.length,`invalid word index: ${n}`,"index",n),r[n]}getWordIndex(n){return vr(this,dk,eee).call(this).indexOf(n)}}wS=new WeakMap,uk=new WeakMap,Bw=new WeakMap,dk=new WeakSet,eee=function(){if(ze(this,Bw)==null){const n=this._decodeWords();if(c1(n.join(`
`)+`
`)!==ze(this,uk))throw new Error(`BIP39 Wordlist for ${this.locale} FAILED`);Wt(this,Bw,n)}return ze(this,Bw)};const K5t="0erleonalorenseinceregesticitStanvetearctssi#ch2Athck&tneLl0And#Il.yLeOutO=S|S%b/ra@SurdU'0Ce[Cid|CountCu'Hie=IdOu,-Qui*Ro[TT]T%T*[Tu$0AptDD-tD*[Ju,M.UltV<)Vi)0Rob-0FairF%dRaid0A(EEntRee0Ead0MRRp%tS!_rmBumCoholErtI&LLeyLowMo,O}PhaReadySoT Ways0A>urAz(gOngOuntU'd0Aly,Ch%Ci|G G!GryIm$K!Noun)Nu$O` Sw T&naTiqueXietyY1ArtOlogyPe?P!Pro=Ril1ChCt-EaEnaGueMMedM%MyOundR<+Re,Ri=RowTTefa@Ti,Tw%k0KPe@SaultSetSi,SumeThma0H!>OmTa{T&dT.udeTra@0Ct]D.Gu,NtTh%ToTumn0Era+OcadoOid0AkeA*AyEsomeFulKw?d0Is:ByChel%C#D+GL<)Lc#y~MbooN<aNn RRelyRga(R*lSeS-SketTt!3A^AnAutyCau'ComeEfF%eG(Ha=H(dLie=LowLtN^Nef./TrayTt Twe&Y#d3Cyc!DKeNdOlogyRdR`Tt _{AdeAmeAnketA,EakE[IndOodO[omOu'UeUrUsh_rdAtDyIlMbNeNusOkO,Rd R(gRrowSsTtomUn)XY_{etA(AndA[A=EadEezeI{Id+IefIghtIngIskOccoliOk&OnzeOomO` OwnUsh2Bb!DdyD+tFf$oIldLbLkL!tNd!Nk Rd&Rg R,SS(e[SyTt Y Zz:Bba+B(B!CtusGeKe~LmM aMpNN$N)lNdyNn#NoeNvasNy#Pab!P.$Pta(RRb#RdRgoRpetRryRtSeShS(o/!Su$TT$ogT^Teg%yTt!UghtU'Ut]Ve3Il(gL yM|NsusNturyRe$Rta(_irAlkAmp]An+AosApt Ar+A'AtEapE{Ee'EfErryE,I{&IefIldIm}yOi)Oo'R#-U{!UnkUrn0G?Nnam#Rc!Tiz&TyVil_imApArifyAwAyE<ErkEv I{I|IffImbIn-IpO{OgO'O`OudOwnUbUmpU, Ut^_^A,C#utDeFfeeIlInL!@L%LumnMb(eMeMf%tM-Mm#Mp<yNc tNdu@NfirmNg*[N}@Nsid NtrolNv()OkOlPp PyR$ReRnR*@/Tt#U^UntryUp!Ur'Us(V Yo>_{Ad!AftAmA}AshAt AwlAzyEamEd.EekEwI{etImeIspIt-OpO[Ou^OwdUci$UelUi'Umb!Un^UshYY,$2BeLtu*PPbo?dRiousRr|Rta(R=Sh]/omTe3C!:DMa+MpN)Ng R(gShUght WnY3AlBa>BrisCadeCemb CideCl(eC%a>C*a'ErF&'F(eFyG*eLayLiv M<dMi'Ni$Nti,NyP?tP&dPos.P`PutyRi=ScribeS tSignSkSpair/royTailTe@VelopVi)Vo>3AgramAlAm#dAryCeE'lEtFf G.$Gn.yLemmaNn NosaurRe@RtSag*eScov Sea'ShSmi[S%d Splay/<)V tVideV%)Zzy5Ct%Cum|G~Lph(Ma(Na>NkeyN%OrSeUb!Ve_ftAg#AmaA,-AwEamE[IftIllInkIpI=OpUmY2CkMbNeR(g/T^Ty1Arf1Nam-:G G!RlyRnR`Sily/Sy1HoOlogyOnomy0GeItUca>1F%t0G1GhtTh 2BowD E@r-Eg<tEm|Eph<tEvat%I>Se0B?kBodyBra)Er+Ot]PloyPow Pty0Ab!A@DD![D%'EmyErgyF%)Ga+G(eH<)JoyLi,OughR-hRollSu*T Ti*TryVelope1Isode0U$Uip0AA'OdeOs]R%Upt0CapeSayS&)Ta>0Ern$H-s1Id&)IlOkeOl=1A@Amp!Ce[Ch<+C.eCludeCu'Ecu>Erci'Hau,Hib.I!I,ItOt-P<dPe@Pi*Pla(Po'P*[T&dTra0EEbrow:Br-CeCultyDeIntI`~L'MeMilyMousNNcyNtasyRmSh]TT$Th TigueUltV%.e3Atu*Bru?yD $EEdElMa!N)/iv$T^V W3B Ct]EldGu*LeLmLt N$NdNeNg NishReRmR,Sc$ShTT}[X_gAmeAshAtAv%EeIghtIpOatO{O%Ow UidUshY_mCusGIlLd~owOdOtR)Re,R+tRkRtu}RumRw?dSsil/ UndX_gi!AmeEqu|EshI&dIn+OgOntO,OwnOz&U.2ElNNnyRna)RyTu*:D+tInLaxy~ yMePRa+Rba+Rd&Rl-Rm|SSpTeTh U+Ze3N $NiusN*Nt!Nu(e/u*2O,0AntFtGg!Ng RaffeRlVe_dAn)A*A[IdeImp'ObeOomOryO=OwUe_tDde[LdOdO'RillaSpelSsipV nWn_bA)A(AntApeA[Av.yEatE&IdIefItOc yOupOwUnt_rdE[IdeIltIt?N3M:B.IrLfMm M, NdPpyRb%RdRshR=,TVeWkZ?d3AdAl`ArtAvyD+hogIght~oLmetLpNRo3Dd&Gh~NtPRe/%y5BbyCkeyLdLeLiday~owMeNeyOdPeRnRr%R'Sp.$/TelUrV 5BGeM<Mb!M%Nd*dNgryNtRd!RryRtSb<d3Brid:1EOn0EaEntifyLe2N%e4LLeg$L}[0A+Ita>M&'Mu}Pa@Po'Pro=Pul'0ChCludeComeC*a'DexD-a>Do%Du,ryF<tFl-tF%mHa!H .Iti$Je@JuryMa>N Noc|PutQuiryS<eSe@SideSpi*/$lTa@T e,ToVe,V.eVol=3On0L<dOla>Sue0Em1Ory:CketGu?RZz3AlousAns~yWel9BInKeUr}yY5D+I)MpNg!Ni%Nk/:Ng?oo3EnEpT^upY3CkDD}yNdNgdomSsTT^&TeTt&Wi4EeIfeO{Ow:BBelB%Dd DyKeMpNgua+PtopR+T T(UghUndryVaWWnWsu.Y Zy3Ad AfArnA=Ctu*FtGG$G&dIsu*M#NdNg`NsOp?dSs#Tt Vel3ArB tyBr?yC&'FeFtGhtKeMbM.NkOnQuid/Tt!VeZ?d5AdAnB, C$CkG-NelyNgOpTt yUdUn+VeY$5CkyGga+Mb N?N^Xury3R-s:Ch(eDG-G}tIdIlInJ%KeMm$NNa+Nda>NgoNs]Nu$P!Rb!R^Rg(R(eRketRria+SkSs/ T^T i$ThTrixTt XimumZe3AdowAnAsu*AtCh<-D$DiaLodyLtMb M%yNt]NuRcyR+R.RryShSsa+T$Thod3Dd!DnightLk~]M-NdNimumN%Nu>Rac!Rr%S ySs/akeXXedXtu*5Bi!DelDifyMM|N.%NkeyN, N`OnR$ReRn(gSqu.oTh T]T%Unta(U'VeVie5ChFf(LeLtiplySc!SeumShroomS-/Tu$3Self/ yTh:I=MePk(Rrow/yT]Tu*3ArCkEdGati=G!@I` PhewR=/TTw%kUtr$V WsXt3CeGht5B!I'M(eeOd!Rm$R`SeTab!TeTh(gTi)VelW5C!?Mb R'T:K0EyJe@Li+Scu*S =Ta(Vious0CurE<Tob 0Or1FF Fi)T&2L1Ay0DI=Ymp-0It0CeEI#L(eLy1EnEraIn]Po'T]1An+B.Ch?dD D(?yG<I|Ig($Ph<0Tr-h0H 0Tdo%T TputTside0AlEnEr0NN 0Yg&0/ 0O}:CtDd!GeIrLa)LmNdaNelN-N` P RadeR|RkRrotRtySsT^ThTi|TrolTt nU'VeYm|3A)AnutArAs<tL-<NN$tyNcilOp!Pp Rfe@Rm.Rs#T2O}OtoRa'Ys-$0AnoCn-Ctu*E)GGe#~LotNkO} Pe/olT^Zza_)A}tA,-A>AyEa'Ed+U{UgUn+2EmEtIntL?LeLi)NdNyOlPul?Rt]S.]Ssib!/TatoTt yV tyWd W _@i)Ai'Ed-tEf Epa*Es|EttyEv|I)IdeIm?yIntI%.yIs#Iva>IzeOb!mO)[Odu)Of.OgramOje@Omo>OofOp tyOsp O>@OudOvide2Bl-Dd(g~LpL'Mpk(N^PilPpyR^a'R.yRpo'R'ShTZz!3Ramid:99Al.yAntumArt E,]I{ItIzO>:Bb.Cco#CeCkD?DioIlInI'~yMpN^NdomN+PidReTeTh V&WZ%3AdyAlAs#BelBuildC$lCei=CipeC%dCyc!Du)F!@F%mFu'G]G*tGul?Je@LaxLea'LiefLyMa(Memb M(dMo=Nd NewNtOp&PairPeatPla)P%tQui*ScueSemb!Si,Sour)Sp#'SultTi*T*atTurnUn]Ve$ViewW?d2Y`m0BBb#CeChDeD+F!GhtGidNgOtPp!SkTu$V$V 5AdA,BotBu,CketM<)OfOkieOmSeTa>UghUndU>Y$5Bb DeGLeNNwayR$:DDd!D}[FeIlLadLm#L#LtLu>MeMp!NdTisfyToshiU)Usa+VeY1A!AnA*Att E}HemeHoolI&)I[%sOrp]OutRapRe&RiptRub1AAr^As#AtC#dC*tCt]Cur.yEdEkGm|Le@~M(?Ni%N'Nt&)RiesRvi)Ss]Tt!TupV&_dowAftAllowA*EdEllEriffIeldIftI}IpIv O{OeOotOpOrtOuld O=RimpRugUff!Y0Bl(gCkDeE+GhtGnL|Lk~yLv Mil?Mp!N)NgR&/ Tua>XZe1A>Et^IIllInIrtUll0AbAmEepEnd I)IdeIghtImOg<OtOwUsh0AllArtI!OkeOo`0A{AkeApIffOw0ApCc Ci$CkDaFtL?Ldi LidLut]L=Me#eNgOnRryRtUlUndUpUr)U`0A)A*Ati$AwnEakEci$EedEllEndH eI)Id IkeInIr.L.OilOns%O#OrtOtRayReadR(gY0Ua*UeezeUir*l_b!AdiumAffA+AirsAmpAndArtA>AyEakEelEmEpE*oI{IllIngO{Oma^O}OolOryO=Ra>gyReetRikeR#gRugg!Ud|UffUmb!Y!0Bje@Bm.BwayC)[ChDd&Ff G?G+,ItMm NNnyN'tP PplyP*meReRfa)R+Rpri'RroundR=ySpe@/a(1AllowAmpApArmE?EetIftImIngIt^Ord1MbolMptomRup/em:B!Ck!GIlL|LkNkPeR+tSk/eTtooXi3A^Am~NN<tNnisNtRm/Xt_nkAtEmeEnE%yE*EyIngIsOughtReeRi=RowUmbUnd 0CketDeG LtMb MeNyPRedSsueT!5A,BaccoDayDdl EGe` I!tK&MatoM%rowNeNgueNightOlO`PP-Pp!R^RnadoRtoi'SsT$Uri,W?dW WnY_{AdeAff-Ag-A(Ansf ApAshA=lAyEatEeEndI$IbeI{Igg ImIpOphyOub!U{UeUlyUmpetU,U`Y2BeIt]Mb!NaN}lRkeyRnRt!1El=EntyI)InI,O1PeP-$:5Ly5B*lla0Ab!Awa*C!Cov D DoFairFoldHappyIf%mIqueItIv 'KnownLo{TilUsu$Veil1Da>GradeHoldOnP Set1B<Ge0A+EEdEfulE![U$0Il.y:C<tCuumGueLidL!yL=NNishP%Rious/Ult3H-!L=tNd%Ntu*NueRbRifyRs]RyS'lT <3Ab!Br<tCiousCt%yDeoEw~a+Nta+Ol(Rtu$RusSaS.Su$T$Vid5C$I)IdLc<oLumeTeYa+:GeG#ItLk~LnutNtRfa*RmRri%ShSp/eT VeY3Al`Ap#ArA'lA` BDd(gEk&dIrdLcome/T_!AtEatEelEnE*IpIsp 0DeD`FeLd~NNdowNeNgNkNn Nt ReSdomSeShT}[5LfM<Nd OdOlRdRkRldRryR`_pE{E,!I,I>Ong::Rd3Ar~ow9UUngU`:3BraRo9NeO",Y5t="0x3c8acc1e7b08d8e76f9fda015ef48dc8c710a73cb7e0f77b2c18a9b5a7adde60";let KH=null;class T3 extends G5t{constructor(){super("en",K5t,Y5t)}static wordlist(){return KH==null&&(KH=new T3),KH}}function TIe(e){return(1<<e)-1<<8-e&255}function X5t(e){return(1<<e)-1&255}function YH(e,t){mke("NFKD"),t==null&&(t=T3.wordlist());const n=t.split(e);bn(n.length%3===0&&n.length>=12&&n.length<=24,"invalid mnemonic length","mnemonic","[ REDACTED ]");const r=new Uint8Array(Math.ceil(11*n.length/8));let s=0;for(let u=0;u<n.length;u++){let d=t.getWordIndex(n[u].normalize("NFKD"));bn(d>=0,`invalid mnemonic word at index ${u}`,"mnemonic","[ REDACTED ]");for(let f=0;f<11;f++)d&1<<10-f&&(r[s>>3]|=1<<7-s%8),s++}const a=32*n.length/3,o=n.length/3,l=TIe(o),c=hs(op(r.slice(0,a/8)))[0]&l;return bn(c===(r[r.length-1]&l),"invalid mnemonic checksum","mnemonic","[ REDACTED ]"),Kr(r.slice(0,a/8))}function XH(e,t){bn(e.length%4===0&&e.length>=16&&e.length<=32,"invalid entropy size","entropy","[ REDACTED ]"),t==null&&(t=T3.wordlist());const n=[0];let r=11;for(let o=0;o<e.length;o++)r>8?(n[n.length-1]<<=8,n[n.length-1]|=e[o],r-=8):(n[n.length-1]<<=r,n[n.length-1]|=e[o]>>8-r,n.push(e[o]&X5t(8-r)),r+=3);const s=e.length/4,a=parseInt(op(e).substring(2,4),16)&TIe(s);return n[n.length-1]<<=s,n[n.length-1]|=a>>8-s,t.join(n.map(o=>t.getWord(o)))}const QH={};class WS{constructor(t,n,r,s,a){Un(this,"phrase");Un(this,"password");Un(this,"wordlist");Un(this,"entropy");s==null&&(s=""),a==null&&(a=T3.wordlist()),c5(t,QH,"Mnemonic"),Ds(this,{phrase:r,password:s,wordlist:a,entropy:n})}computeSeed(){const t=ud("mnemonic"+this.password,"NFKD");return a2(ud(this.phrase,"NFKD"),t,2048,64,"sha512")}static fromPhrase(t,n,r){const s=YH(t,r);return t=XH(hs(s),r),new WS(QH,s,t,n,r)}static fromEntropy(t,n,r){const s=hs(t,"entropy"),a=XH(s,r);return new WS(QH,Kr(s),a,n,r)}static entropyToPhrase(t,n){const r=hs(t,"entropy");return XH(r,n)}static phraseToEntropy(t,n){return YH(t,n)}static isValidMnemonic(t,n){try{return YH(t,n),!0}catch{}return!1}}/*! MIT License. Copyright 2015-2022 Richard Moore <me@ricmoo.com>. See LICENSE.txt. */var Vc=function(e,t,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(e):r?r.value:t.get(e)},ZH=function(e,t,n,r,s){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?s.call(e,n):s?s.value=n:t.set(e,n),n},aO,Eh,t0;const Q5t={16:10,24:12,32:14},Z5t=[1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145],gh=[99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22],sP=[82,9,106,213,48,54,165,56,191,64,163,158,129,243,215,251,124,227,57,130,155,47,255,135,52,142,67,68,196,222,233,203,84,123,148,50,166,194,35,61,238,76,149,11,66,250,195,78,8,46,161,102,40,217,36,178,118,91,162,73,109,139,209,37,114,248,246,100,134,104,152,22,212,164,92,204,93,101,182,146,108,112,72,80,253,237,185,218,94,21,70,87,167,141,157,132,144,216,171,0,140,188,211,10,247,228,88,5,184,179,69,6,208,44,30,143,202,63,15,2,193,175,189,3,1,19,138,107,58,145,17,65,79,103,220,234,151,242,207,206,240,180,230,115,150,172,116,34,231,173,53,133,226,249,55,232,28,117,223,110,71,241,26,113,29,41,197,137,111,183,98,14,170,24,190,27,252,86,62,75,198,210,121,32,154,219,192,254,120,205,90,244,31,221,168,51,136,7,199,49,177,18,16,89,39,128,236,95,96,81,127,169,25,181,74,13,45,229,122,159,147,201,156,239,160,224,59,77,174,42,245,176,200,235,187,60,131,83,153,97,23,43,4,126,186,119,214,38,225,105,20,99,85,33,12,125],J5t=[3328402341,4168907908,4000806809,4135287693,4294111757,3597364157,3731845041,2445657428,1613770832,33620227,3462883241,1445669757,3892248089,3050821474,1303096294,3967186586,2412431941,528646813,2311702848,4202528135,4026202645,2992200171,2387036105,4226871307,1101901292,3017069671,1604494077,1169141738,597466303,1403299063,3832705686,2613100635,1974974402,3791519004,1033081774,1277568618,1815492186,2118074177,4126668546,2211236943,1748251740,1369810420,3521504564,4193382664,3799085459,2883115123,1647391059,706024767,134480908,2512897874,1176707941,2646852446,806885416,932615841,168101135,798661301,235341577,605164086,461406363,3756188221,3454790438,1311188841,2142417613,3933566367,302582043,495158174,1479289972,874125870,907746093,3698224818,3025820398,1537253627,2756858614,1983593293,3084310113,2108928974,1378429307,3722699582,1580150641,327451799,2790478837,3117535592,0,3253595436,1075847264,3825007647,2041688520,3059440621,3563743934,2378943302,1740553945,1916352843,2487896798,2555137236,2958579944,2244988746,3151024235,3320835882,1336584933,3992714006,2252555205,2588757463,1714631509,293963156,2319795663,3925473552,67240454,4269768577,2689618160,2017213508,631218106,1269344483,2723238387,1571005438,2151694528,93294474,1066570413,563977660,1882732616,4059428100,1673313503,2008463041,2950355573,1109467491,537923632,3858759450,4260623118,3218264685,2177748300,403442708,638784309,3287084079,3193921505,899127202,2286175436,773265209,2479146071,1437050866,4236148354,2050833735,3362022572,3126681063,840505643,3866325909,3227541664,427917720,2655997905,2749160575,1143087718,1412049534,999329963,193497219,2353415882,3354324521,1807268051,672404540,2816401017,3160301282,369822493,2916866934,3688947771,1681011286,1949973070,336202270,2454276571,201721354,1210328172,3093060836,2680341085,3184776046,1135389935,3294782118,965841320,831886756,3554993207,4068047243,3588745010,2345191491,1849112409,3664604599,26054028,2983581028,2622377682,1235855840,3630984372,2891339514,4092916743,3488279077,3395642799,4101667470,1202630377,268961816,1874508501,4034427016,1243948399,1546530418,941366308,1470539505,1941222599,2546386513,3421038627,2715671932,3899946140,1042226977,2521517021,1639824860,227249030,260737669,3765465232,2084453954,1907733956,3429263018,2420656344,100860677,4160157185,470683154,3261161891,1781871967,2924959737,1773779408,394692241,2579611992,974986535,664706745,3655459128,3958962195,731420851,571543859,3530123707,2849626480,126783113,865375399,765172662,1008606754,361203602,3387549984,2278477385,2857719295,1344809080,2782912378,59542671,1503764984,160008576,437062935,1707065306,3622233649,2218934982,3496503480,2185314755,697932208,1512910199,504303377,2075177163,2824099068,1841019862,739644986],e6t=[2781242211,2230877308,2582542199,2381740923,234877682,3184946027,2984144751,1418839493,1348481072,50462977,2848876391,2102799147,434634494,1656084439,3863849899,2599188086,1167051466,2636087938,1082771913,2281340285,368048890,3954334041,3381544775,201060592,3963727277,1739838676,4250903202,3930435503,3206782108,4149453988,2531553906,1536934080,3262494647,484572669,2923271059,1783375398,1517041206,1098792767,49674231,1334037708,1550332980,4098991525,886171109,150598129,2481090929,1940642008,1398944049,1059722517,201851908,1385547719,1699095331,1587397571,674240536,2704774806,252314885,3039795866,151914247,908333586,2602270848,1038082786,651029483,1766729511,3447698098,2682942837,454166793,2652734339,1951935532,775166490,758520603,3000790638,4004797018,4217086112,4137964114,1299594043,1639438038,3464344499,2068982057,1054729187,1901997871,2534638724,4121318227,1757008337,0,750906861,1614815264,535035132,3363418545,3988151131,3201591914,1183697867,3647454910,1265776953,3734260298,3566750796,3903871064,1250283471,1807470800,717615087,3847203498,384695291,3313910595,3617213773,1432761139,2484176261,3481945413,283769337,100925954,2180939647,4037038160,1148730428,3123027871,3813386408,4087501137,4267549603,3229630528,2315620239,2906624658,3156319645,1215313976,82966005,3747855548,3245848246,1974459098,1665278241,807407632,451280895,251524083,1841287890,1283575245,337120268,891687699,801369324,3787349855,2721421207,3431482436,959321879,1469301956,4065699751,2197585534,1199193405,2898814052,3887750493,724703513,2514908019,2696962144,2551808385,3516813135,2141445340,1715741218,2119445034,2872807568,2198571144,3398190662,700968686,3547052216,1009259540,2041044702,3803995742,487983883,1991105499,1004265696,1449407026,1316239930,504629770,3683797321,168560134,1816667172,3837287516,1570751170,1857934291,4014189740,2797888098,2822345105,2754712981,936633572,2347923833,852879335,1133234376,1500395319,3084545389,2348912013,1689376213,3533459022,3762923945,3034082412,4205598294,133428468,634383082,2949277029,2398386810,3913789102,403703816,3580869306,2297460856,1867130149,1918643758,607656988,4049053350,3346248884,1368901318,600565992,2090982877,2632479860,557719327,3717614411,3697393085,2249034635,2232388234,2430627952,1115438654,3295786421,2865522278,3633334344,84280067,33027830,303828494,2747425121,1600795957,4188952407,3496589753,2434238086,1486471617,658119965,3106381470,953803233,334231800,3005978776,857870609,3151128937,1890179545,2298973838,2805175444,3056442267,574365214,2450884487,550103529,1233637070,4289353045,2018519080,2057691103,2399374476,4166623649,2148108681,387583245,3664101311,836232934,3330556482,3100665960,3280093505,2955516313,2002398509,287182607,3413881008,4238890068,3597515707,975967766],t6t=[1671808611,2089089148,2006576759,2072901243,4061003762,1807603307,1873927791,3310653893,810573872,16974337,1739181671,729634347,4263110654,3613570519,2883997099,1989864566,3393556426,2191335298,3376449993,2106063485,4195741690,1508618841,1204391495,4027317232,2917941677,3563566036,2734514082,2951366063,2629772188,2767672228,1922491506,3227229120,3082974647,4246528509,2477669779,644500518,911895606,1061256767,4144166391,3427763148,878471220,2784252325,3845444069,4043897329,1905517169,3631459288,827548209,356461077,67897348,3344078279,593839651,3277757891,405286936,2527147926,84871685,2595565466,118033927,305538066,2157648768,3795705826,3945188843,661212711,2999812018,1973414517,152769033,2208177539,745822252,439235610,455947803,1857215598,1525593178,2700827552,1391895634,994932283,3596728278,3016654259,695947817,3812548067,795958831,2224493444,1408607827,3513301457,0,3979133421,543178784,4229948412,2982705585,1542305371,1790891114,3410398667,3201918910,961245753,1256100938,1289001036,1491644504,3477767631,3496721360,4012557807,2867154858,4212583931,1137018435,1305975373,861234739,2241073541,1171229253,4178635257,33948674,2139225727,1357946960,1011120188,2679776671,2833468328,1374921297,2751356323,1086357568,2408187279,2460827538,2646352285,944271416,4110742005,3168756668,3066132406,3665145818,560153121,271589392,4279952895,4077846003,3530407890,3444343245,202643468,322250259,3962553324,1608629855,2543990167,1154254916,389623319,3294073796,2817676711,2122513534,1028094525,1689045092,1575467613,422261273,1939203699,1621147744,2174228865,1339137615,3699352540,577127458,712922154,2427141008,2290289544,1187679302,3995715566,3100863416,339486740,3732514782,1591917662,186455563,3681988059,3762019296,844522546,978220090,169743370,1239126601,101321734,611076132,1558493276,3260915650,3547250131,2901361580,1655096418,2443721105,2510565781,3828863972,2039214713,3878868455,3359869896,928607799,1840765549,2374762893,3580146133,1322425422,2850048425,1823791212,1459268694,4094161908,3928346602,1706019429,2056189050,2934523822,135794696,3134549946,2022240376,628050469,779246638,472135708,2800834470,3032970164,3327236038,3894660072,3715932637,1956440180,522272287,1272813131,3185336765,2340818315,2323976074,1888542832,1044544574,3049550261,1722469478,1222152264,50660867,4127324150,236067854,1638122081,895445557,1475980887,3117443513,2257655686,3243809217,489110045,2662934430,3778599393,4162055160,2561878936,288563729,1773916777,3648039385,2391345038,2493985684,2612407707,505560094,2274497927,3911240169,3460925390,1442818645,678973480,3749357023,2358182796,2717407649,2306869641,219617805,3218761151,3862026214,1120306242,1756942440,1103331905,2578459033,762796589,252780047,2966125488,1425844308,3151392187,372911126],n6t=[1667474886,2088535288,2004326894,2071694838,4075949567,1802223062,1869591006,3318043793,808472672,16843522,1734846926,724270422,4278065639,3621216949,2880169549,1987484396,3402253711,2189597983,3385409673,2105378810,4210693615,1499065266,1195886990,4042263547,2913856577,3570689971,2728590687,2947541573,2627518243,2762274643,1920112356,3233831835,3082273397,4261223649,2475929149,640051788,909531756,1061110142,4160160501,3435941763,875846760,2779116625,3857003729,4059105529,1903268834,3638064043,825316194,353713962,67374088,3351728789,589522246,3284360861,404236336,2526454071,84217610,2593830191,117901582,303183396,2155911963,3806477791,3958056653,656894286,2998062463,1970642922,151591698,2206440989,741110872,437923380,454765878,1852748508,1515908788,2694904667,1381168804,993742198,3604373943,3014905469,690584402,3823320797,791638366,2223281939,1398011302,3520161977,0,3991743681,538992704,4244381667,2981218425,1532751286,1785380564,3419096717,3200178535,960056178,1246420628,1280103576,1482221744,3486468741,3503319995,4025428677,2863326543,4227536621,1128514950,1296947098,859002214,2240123921,1162203018,4193849577,33687044,2139062782,1347481760,1010582648,2678045221,2829640523,1364325282,2745433693,1077985408,2408548869,2459086143,2644360225,943212656,4126475505,3166494563,3065430391,3671750063,555836226,269496352,4294908645,4092792573,3537006015,3452783745,202118168,320025894,3974901699,1600119230,2543297077,1145359496,387397934,3301201811,2812801621,2122220284,1027426170,1684319432,1566435258,421079858,1936954854,1616945344,2172753945,1330631070,3705438115,572679748,707427924,2425400123,2290647819,1179044492,4008585671,3099120491,336870440,3739122087,1583276732,185277718,3688593069,3772791771,842159716,976899700,168435220,1229577106,101059084,606366792,1549591736,3267517855,3553849021,2897014595,1650632388,2442242105,2509612081,3840161747,2038008818,3890688725,3368567691,926374254,1835907034,2374863873,3587531953,1313788572,2846482505,1819063512,1448540844,4109633523,3941213647,1701162954,2054852340,2930698567,134748176,3132806511,2021165296,623210314,774795868,471606328,2795958615,3031746419,3334885783,3907527627,3722280097,1953799400,522133822,1263263126,3183336545,2341176845,2324333839,1886425312,1044267644,3048588401,1718004428,1212733584,50529542,4143317495,235803164,1633788866,892690282,1465383342,3115962473,2256965911,3250673817,488449850,2661202215,3789633753,4177007595,2560144171,286339874,1768537042,3654906025,2391705863,2492770099,2610673197,505291324,2273808917,3924369609,3469625735,1431699370,673740880,3755965093,2358021891,2711746649,2307489801,218961690,3217021541,3873845719,1111672452,1751693520,1094828930,2576986153,757954394,252645662,2964376443,1414855848,3149649517,370555436],r6t=[1374988112,2118214995,437757123,975658646,1001089995,530400753,2902087851,1273168787,540080725,2910219766,2295101073,4110568485,1340463100,3307916247,641025152,3043140495,3736164937,632953703,1172967064,1576976609,3274667266,2169303058,2370213795,1809054150,59727847,361929877,3211623147,2505202138,3569255213,1484005843,1239443753,2395588676,1975683434,4102977912,2572697195,666464733,3202437046,4035489047,3374361702,2110667444,1675577880,3843699074,2538681184,1649639237,2976151520,3144396420,4269907996,4178062228,1883793496,2403728665,2497604743,1383856311,2876494627,1917518562,3810496343,1716890410,3001755655,800440835,2261089178,3543599269,807962610,599762354,33778362,3977675356,2328828971,2809771154,4077384432,1315562145,1708848333,101039829,3509871135,3299278474,875451293,2733856160,92987698,2767645557,193195065,1080094634,1584504582,3178106961,1042385657,2531067453,3711829422,1306967366,2438237621,1908694277,67556463,1615861247,429456164,3602770327,2302690252,1742315127,2968011453,126454664,3877198648,2043211483,2709260871,2084704233,4169408201,0,159417987,841739592,504459436,1817866830,4245618683,260388950,1034867998,908933415,168810852,1750902305,2606453969,607530554,202008497,2472011535,3035535058,463180190,2160117071,1641816226,1517767529,470948374,3801332234,3231722213,1008918595,303765277,235474187,4069246893,766945465,337553864,1475418501,2943682380,4003061179,2743034109,4144047775,1551037884,1147550661,1543208500,2336434550,3408119516,3069049960,3102011747,3610369226,1113818384,328671808,2227573024,2236228733,3535486456,2935566865,3341394285,496906059,3702665459,226906860,2009195472,733156972,2842737049,294930682,1206477858,2835123396,2700099354,1451044056,573804783,2269728455,3644379585,2362090238,2564033334,2801107407,2776292904,3669462566,1068351396,742039012,1350078989,1784663195,1417561698,4136440770,2430122216,775550814,2193862645,2673705150,1775276924,1876241833,3475313331,3366754619,270040487,3902563182,3678124923,3441850377,1851332852,3969562369,2203032232,3868552805,2868897406,566021896,4011190502,3135740889,1248802510,3936291284,699432150,832877231,708780849,3332740144,899835584,1951317047,4236429990,3767586992,866637845,4043610186,1106041591,2144161806,395441711,1984812685,1139781709,3433712980,3835036895,2664543715,1282050075,3240894392,1181045119,2640243204,25965917,4203181171,4211818798,3009879386,2463879762,3910161971,1842759443,2597806476,933301370,1509430414,3943906441,3467192302,3076639029,3776767469,2051518780,2631065433,1441952575,404016761,1942435775,1408749034,1610459739,3745345300,2017778566,3400528769,3110650942,941896748,3265478751,371049330,3168937228,675039627,4279080257,967311729,135050206,3635733660,1683407248,2076935265,3576870512,1215061108,3501741890],s6t=[1347548327,1400783205,3273267108,2520393566,3409685355,4045380933,2880240216,2471224067,1428173050,4138563181,2441661558,636813900,4233094615,3620022987,2149987652,2411029155,1239331162,1730525723,2554718734,3781033664,46346101,310463728,2743944855,3328955385,3875770207,2501218972,3955191162,3667219033,768917123,3545789473,692707433,1150208456,1786102409,2029293177,1805211710,3710368113,3065962831,401639597,1724457132,3028143674,409198410,2196052529,1620529459,1164071807,3769721975,2226875310,486441376,2499348523,1483753576,428819965,2274680428,3075636216,598438867,3799141122,1474502543,711349675,129166120,53458370,2592523643,2782082824,4063242375,2988687269,3120694122,1559041666,730517276,2460449204,4042459122,2706270690,3446004468,3573941694,533804130,2328143614,2637442643,2695033685,839224033,1973745387,957055980,2856345839,106852767,1371368976,4181598602,1033297158,2933734917,1179510461,3046200461,91341917,1862534868,4284502037,605657339,2547432937,3431546947,2003294622,3182487618,2282195339,954669403,3682191598,1201765386,3917234703,3388507166,0,2198438022,1211247597,2887651696,1315723890,4227665663,1443857720,507358933,657861945,1678381017,560487590,3516619604,975451694,2970356327,261314535,3535072918,2652609425,1333838021,2724322336,1767536459,370938394,182621114,3854606378,1128014560,487725847,185469197,2918353863,3106780840,3356761769,2237133081,1286567175,3152976349,4255350624,2683765030,3160175349,3309594171,878443390,1988838185,3704300486,1756818940,1673061617,3403100636,272786309,1075025698,545572369,2105887268,4174560061,296679730,1841768865,1260232239,4091327024,3960309330,3497509347,1814803222,2578018489,4195456072,575138148,3299409036,446754879,3629546796,4011996048,3347532110,3252238545,4270639778,915985419,3483825537,681933534,651868046,2755636671,3828103837,223377554,2607439820,1649704518,3270937875,3901806776,1580087799,4118987695,3198115200,2087309459,2842678573,3016697106,1003007129,2802849917,1860738147,2077965243,164439672,4100872472,32283319,2827177882,1709610350,2125135846,136428751,3874428392,3652904859,3460984630,3572145929,3593056380,2939266226,824852259,818324884,3224740454,930369212,2801566410,2967507152,355706840,1257309336,4148292826,243256656,790073846,2373340630,1296297904,1422699085,3756299780,3818836405,457992840,3099667487,2135319889,77422314,1560382517,1945798516,788204353,1521706781,1385356242,870912086,325965383,2358957921,2050466060,2388260884,2313884476,4006521127,901210569,3990953189,1014646705,1503449823,1062597235,2031621326,3212035895,3931371469,1533017514,350174575,2256028891,2177544179,1052338372,741876788,1606591296,1914052035,213705253,2334669897,1107234197,1899603969,3725069491,2631447780,2422494913,1635502980,1893020342,1950903388,1120974935],i6t=[2807058932,1699970625,2764249623,1586903591,1808481195,1173430173,1487645946,59984867,4199882800,1844882806,1989249228,1277555970,3623636965,3419915562,1149249077,2744104290,1514790577,459744698,244860394,3235995134,1963115311,4027744588,2544078150,4190530515,1608975247,2627016082,2062270317,1507497298,2200818878,567498868,1764313568,3359936201,2305455554,2037970062,1047239e3,1910319033,1337376481,2904027272,2892417312,984907214,1243112415,830661914,861968209,2135253587,2011214180,2927934315,2686254721,731183368,1750626376,4246310725,1820824798,4172763771,3542330227,48394827,2404901663,2871682645,671593195,3254988725,2073724613,145085239,2280796200,2779915199,1790575107,2187128086,472615631,3029510009,4075877127,3802222185,4107101658,3201631749,1646252340,4270507174,1402811438,1436590835,3778151818,3950355702,3963161475,4020912224,2667994737,273792366,2331590177,104699613,95345982,3175501286,2377486676,1560637892,3564045318,369057872,4213447064,3919042237,1137477952,2658625497,1119727848,2340947849,1530455833,4007360968,172466556,266959938,516552836,0,2256734592,3980931627,1890328081,1917742170,4294704398,945164165,3575528878,958871085,3647212047,2787207260,1423022939,775562294,1739656202,3876557655,2530391278,2443058075,3310321856,547512796,1265195639,437656594,3121275539,719700128,3762502690,387781147,218828297,3350065803,2830708150,2848461854,428169201,122466165,3720081049,1627235199,648017665,4122762354,1002783846,2117360635,695634755,3336358691,4234721005,4049844452,3704280881,2232435299,574624663,287343814,612205898,1039717051,840019705,2708326185,793451934,821288114,1391201670,3822090177,376187827,3113855344,1224348052,1679968233,2361698556,1058709744,752375421,2431590963,1321699145,3519142200,2734591178,188127444,2177869557,3727205754,2384911031,3215212461,2648976442,2450346104,3432737375,1180849278,331544205,3102249176,4150144569,2952102595,2159976285,2474404304,766078933,313773861,2570832044,2108100632,1668212892,3145456443,2013908262,418672217,3070356634,2594734927,1852171925,3867060991,3473416636,3907448597,2614737639,919489135,164948639,2094410160,2997825956,590424639,2486224549,1723872674,3157750862,3399941250,3501252752,3625268135,2555048196,3673637356,1343127501,4130281361,3599595085,2957853679,1297403050,81781910,3051593425,2283490410,532201772,1367295589,3926170974,895287692,1953757831,1093597963,492483431,3528626907,1446242576,1192455638,1636604631,209336225,344873464,1015671571,669961897,3375740769,3857572124,2973530695,3747192018,1933530610,3464042516,935293895,3454686199,2858115069,1863638845,3683022916,4085369519,3292445032,875313188,1080017571,3279033885,621591778,1233856572,2504130317,24197544,3017672716,3835484340,3247465558,2220981195,3060847922,1551124588,1463996600],a6t=[4104605777,1097159550,396673818,660510266,2875968315,2638606623,4200115116,3808662347,821712160,1986918061,3430322568,38544885,3856137295,718002117,893681702,1654886325,2975484382,3122358053,3926825029,4274053469,796197571,1290801793,1184342925,3556361835,2405426947,2459735317,1836772287,1381620373,3196267988,1948373848,3764988233,3385345166,3263785589,2390325492,1480485785,3111247143,3780097726,2293045232,548169417,3459953789,3746175075,439452389,1362321559,1400849762,1685577905,1806599355,2174754046,137073913,1214797936,1174215055,3731654548,2079897426,1943217067,1258480242,529487843,1437280870,3945269170,3049390895,3313212038,923313619,679998e3,3215307299,57326082,377642221,3474729866,2041877159,133361907,1776460110,3673476453,96392454,878845905,2801699524,777231668,4082475170,2330014213,4142626212,2213296395,1626319424,1906247262,1846563261,562755902,3708173718,1040559837,3871163981,1418573201,3294430577,114585348,1343618912,2566595609,3186202582,1078185097,3651041127,3896688048,2307622919,425408743,3371096953,2081048481,1108339068,2216610296,0,2156299017,736970802,292596766,1517440620,251657213,2235061775,2933202493,758720310,265905162,1554391400,1532285339,908999204,174567692,1474760595,4002861748,2610011675,3234156416,3693126241,2001430874,303699484,2478443234,2687165888,585122620,454499602,151849742,2345119218,3064510765,514443284,4044981591,1963412655,2581445614,2137062819,19308535,1928707164,1715193156,4219352155,1126790795,600235211,3992742070,3841024952,836553431,1669664834,2535604243,3323011204,1243905413,3141400786,4180808110,698445255,2653899549,2989552604,2253581325,3252932727,3004591147,1891211689,2487810577,3915653703,4237083816,4030667424,2100090966,865136418,1229899655,953270745,3399679628,3557504664,4118925222,2061379749,3079546586,2915017791,983426092,2022837584,1607244650,2118541908,2366882550,3635996816,972512814,3283088770,1568718495,3499326569,3576539503,621982671,2895723464,410887952,2623762152,1002142683,645401037,1494807662,2595684844,1335535747,2507040230,4293295786,3167684641,367585007,3885750714,1865862730,2668221674,2960971305,2763173681,1059270954,2777952454,2724642869,1320957812,2194319100,2429595872,2815956275,77089521,3973773121,3444575871,2448830231,1305906550,4021308739,2857194700,2516901860,3518358430,1787304780,740276417,1699839814,1592394909,2352307457,2272556026,188821243,1729977011,3687994002,274084841,3594982253,3613494426,2701949495,4162096729,322734571,2837966542,1640576439,484830689,1202797690,3537852828,4067639125,349075736,3342319475,4157467219,4255800159,1030690015,1155237496,2951971274,1757691577,607398968,2738905026,499347990,3794078908,1011452712,227885567,2818666809,213114376,3034881240,1455525988,3414450555,850817237,1817998408,3092726480],o6t=[0,235474187,470948374,303765277,941896748,908933415,607530554,708780849,1883793496,2118214995,1817866830,1649639237,1215061108,1181045119,1417561698,1517767529,3767586992,4003061179,4236429990,4069246893,3635733660,3602770327,3299278474,3400528769,2430122216,2664543715,2362090238,2193862645,2835123396,2801107407,3035535058,3135740889,3678124923,3576870512,3341394285,3374361702,3810496343,3977675356,4279080257,4043610186,2876494627,2776292904,3076639029,3110650942,2472011535,2640243204,2403728665,2169303058,1001089995,899835584,666464733,699432150,59727847,226906860,530400753,294930682,1273168787,1172967064,1475418501,1509430414,1942435775,2110667444,1876241833,1641816226,2910219766,2743034109,2976151520,3211623147,2505202138,2606453969,2302690252,2269728455,3711829422,3543599269,3240894392,3475313331,3843699074,3943906441,4178062228,4144047775,1306967366,1139781709,1374988112,1610459739,1975683434,2076935265,1775276924,1742315127,1034867998,866637845,566021896,800440835,92987698,193195065,429456164,395441711,1984812685,2017778566,1784663195,1683407248,1315562145,1080094634,1383856311,1551037884,101039829,135050206,437757123,337553864,1042385657,807962610,573804783,742039012,2531067453,2564033334,2328828971,2227573024,2935566865,2700099354,3001755655,3168937228,3868552805,3902563182,4203181171,4102977912,3736164937,3501741890,3265478751,3433712980,1106041591,1340463100,1576976609,1408749034,2043211483,2009195472,1708848333,1809054150,832877231,1068351396,766945465,599762354,159417987,126454664,361929877,463180190,2709260871,2943682380,3178106961,3009879386,2572697195,2538681184,2236228733,2336434550,3509871135,3745345300,3441850377,3274667266,3910161971,3877198648,4110568485,4211818798,2597806476,2497604743,2261089178,2295101073,2733856160,2902087851,3202437046,2968011453,3936291284,3835036895,4136440770,4169408201,3535486456,3702665459,3467192302,3231722213,2051518780,1951317047,1716890410,1750902305,1113818384,1282050075,1584504582,1350078989,168810852,67556463,371049330,404016761,841739592,1008918595,775550814,540080725,3969562369,3801332234,4035489047,4269907996,3569255213,3669462566,3366754619,3332740144,2631065433,2463879762,2160117071,2395588676,2767645557,2868897406,3102011747,3069049960,202008497,33778362,270040487,504459436,875451293,975658646,675039627,641025152,2084704233,1917518562,1615861247,1851332852,1147550661,1248802510,1484005843,1451044056,933301370,967311729,733156972,632953703,260388950,25965917,328671808,496906059,1206477858,1239443753,1543208500,1441952575,2144161806,1908694277,1675577880,1842759443,3610369226,3644379585,3408119516,3307916247,4011190502,3776767469,4077384432,4245618683,2809771154,2842737049,3144396420,3043140495,2673705150,2438237621,2203032232,2370213795],l6t=[0,185469197,370938394,487725847,741876788,657861945,975451694,824852259,1483753576,1400783205,1315723890,1164071807,1950903388,2135319889,1649704518,1767536459,2967507152,3152976349,2801566410,2918353863,2631447780,2547432937,2328143614,2177544179,3901806776,3818836405,4270639778,4118987695,3299409036,3483825537,3535072918,3652904859,2077965243,1893020342,1841768865,1724457132,1474502543,1559041666,1107234197,1257309336,598438867,681933534,901210569,1052338372,261314535,77422314,428819965,310463728,3409685355,3224740454,3710368113,3593056380,3875770207,3960309330,4045380933,4195456072,2471224067,2554718734,2237133081,2388260884,3212035895,3028143674,2842678573,2724322336,4138563181,4255350624,3769721975,3955191162,3667219033,3516619604,3431546947,3347532110,2933734917,2782082824,3099667487,3016697106,2196052529,2313884476,2499348523,2683765030,1179510461,1296297904,1347548327,1533017514,1786102409,1635502980,2087309459,2003294622,507358933,355706840,136428751,53458370,839224033,957055980,605657339,790073846,2373340630,2256028891,2607439820,2422494913,2706270690,2856345839,3075636216,3160175349,3573941694,3725069491,3273267108,3356761769,4181598602,4063242375,4011996048,3828103837,1033297158,915985419,730517276,545572369,296679730,446754879,129166120,213705253,1709610350,1860738147,1945798516,2029293177,1239331162,1120974935,1606591296,1422699085,4148292826,4233094615,3781033664,3931371469,3682191598,3497509347,3446004468,3328955385,2939266226,2755636671,3106780840,2988687269,2198438022,2282195339,2501218972,2652609425,1201765386,1286567175,1371368976,1521706781,1805211710,1620529459,2105887268,1988838185,533804130,350174575,164439672,46346101,870912086,954669403,636813900,788204353,2358957921,2274680428,2592523643,2441661558,2695033685,2880240216,3065962831,3182487618,3572145929,3756299780,3270937875,3388507166,4174560061,4091327024,4006521127,3854606378,1014646705,930369212,711349675,560487590,272786309,457992840,106852767,223377554,1678381017,1862534868,1914052035,2031621326,1211247597,1128014560,1580087799,1428173050,32283319,182621114,401639597,486441376,768917123,651868046,1003007129,818324884,1503449823,1385356242,1333838021,1150208456,1973745387,2125135846,1673061617,1756818940,2970356327,3120694122,2802849917,2887651696,2637442643,2520393566,2334669897,2149987652,3917234703,3799141122,4284502037,4100872472,3309594171,3460984630,3545789473,3629546796,2050466060,1899603969,1814803222,1730525723,1443857720,1560382517,1075025698,1260232239,575138148,692707433,878443390,1062597235,243256656,91341917,409198410,325965383,3403100636,3252238545,3704300486,3620022987,3874428392,3990953189,4042459122,4227665663,2460449204,2578018489,2226875310,2411029155,3198115200,3046200461,2827177882,2743944855],c6t=[0,218828297,437656594,387781147,875313188,958871085,775562294,590424639,1750626376,1699970625,1917742170,2135253587,1551124588,1367295589,1180849278,1265195639,3501252752,3720081049,3399941250,3350065803,3835484340,3919042237,4270507174,4085369519,3102249176,3051593425,2734591178,2952102595,2361698556,2177869557,2530391278,2614737639,3145456443,3060847922,2708326185,2892417312,2404901663,2187128086,2504130317,2555048196,3542330227,3727205754,3375740769,3292445032,3876557655,3926170974,4246310725,4027744588,1808481195,1723872674,1910319033,2094410160,1608975247,1391201670,1173430173,1224348052,59984867,244860394,428169201,344873464,935293895,984907214,766078933,547512796,1844882806,1627235199,2011214180,2062270317,1507497298,1423022939,1137477952,1321699145,95345982,145085239,532201772,313773861,830661914,1015671571,731183368,648017665,3175501286,2957853679,2807058932,2858115069,2305455554,2220981195,2474404304,2658625497,3575528878,3625268135,3473416636,3254988725,3778151818,3963161475,4213447064,4130281361,3599595085,3683022916,3432737375,3247465558,3802222185,4020912224,4172763771,4122762354,3201631749,3017672716,2764249623,2848461854,2331590177,2280796200,2431590963,2648976442,104699613,188127444,472615631,287343814,840019705,1058709744,671593195,621591778,1852171925,1668212892,1953757831,2037970062,1514790577,1463996600,1080017571,1297403050,3673637356,3623636965,3235995134,3454686199,4007360968,3822090177,4107101658,4190530515,2997825956,3215212461,2830708150,2779915199,2256734592,2340947849,2627016082,2443058075,172466556,122466165,273792366,492483431,1047239e3,861968209,612205898,695634755,1646252340,1863638845,2013908262,1963115311,1446242576,1530455833,1277555970,1093597963,1636604631,1820824798,2073724613,1989249228,1436590835,1487645946,1337376481,1119727848,164948639,81781910,331544205,516552836,1039717051,821288114,669961897,719700128,2973530695,3157750862,2871682645,2787207260,2232435299,2283490410,2667994737,2450346104,3647212047,3564045318,3279033885,3464042516,3980931627,3762502690,4150144569,4199882800,3070356634,3121275539,2904027272,2686254721,2200818878,2384911031,2570832044,2486224549,3747192018,3528626907,3310321856,3359936201,3950355702,3867060991,4049844452,4234721005,1739656202,1790575107,2108100632,1890328081,1402811438,1586903591,1233856572,1149249077,266959938,48394827,369057872,418672217,1002783846,919489135,567498868,752375421,209336225,24197544,376187827,459744698,945164165,895287692,574624663,793451934,1679968233,1764313568,2117360635,1933530610,1343127501,1560637892,1243112415,1192455638,3704280881,3519142200,3336358691,3419915562,3907448597,3857572124,4075877127,4294704398,3029510009,3113855344,2927934315,2744104290,2159976285,2377486676,2594734927,2544078150],u6t=[0,151849742,303699484,454499602,607398968,758720310,908999204,1059270954,1214797936,1097159550,1517440620,1400849762,1817998408,1699839814,2118541908,2001430874,2429595872,2581445614,2194319100,2345119218,3034881240,3186202582,2801699524,2951971274,3635996816,3518358430,3399679628,3283088770,4237083816,4118925222,4002861748,3885750714,1002142683,850817237,698445255,548169417,529487843,377642221,227885567,77089521,1943217067,2061379749,1640576439,1757691577,1474760595,1592394909,1174215055,1290801793,2875968315,2724642869,3111247143,2960971305,2405426947,2253581325,2638606623,2487810577,3808662347,3926825029,4044981591,4162096729,3342319475,3459953789,3576539503,3693126241,1986918061,2137062819,1685577905,1836772287,1381620373,1532285339,1078185097,1229899655,1040559837,923313619,740276417,621982671,439452389,322734571,137073913,19308535,3871163981,4021308739,4104605777,4255800159,3263785589,3414450555,3499326569,3651041127,2933202493,2815956275,3167684641,3049390895,2330014213,2213296395,2566595609,2448830231,1305906550,1155237496,1607244650,1455525988,1776460110,1626319424,2079897426,1928707164,96392454,213114376,396673818,514443284,562755902,679998e3,865136418,983426092,3708173718,3557504664,3474729866,3323011204,4180808110,4030667424,3945269170,3794078908,2507040230,2623762152,2272556026,2390325492,2975484382,3092726480,2738905026,2857194700,3973773121,3856137295,4274053469,4157467219,3371096953,3252932727,3673476453,3556361835,2763173681,2915017791,3064510765,3215307299,2156299017,2307622919,2459735317,2610011675,2081048481,1963412655,1846563261,1729977011,1480485785,1362321559,1243905413,1126790795,878845905,1030690015,645401037,796197571,274084841,425408743,38544885,188821243,3613494426,3731654548,3313212038,3430322568,4082475170,4200115116,3780097726,3896688048,2668221674,2516901860,2366882550,2216610296,3141400786,2989552604,2837966542,2687165888,1202797690,1320957812,1437280870,1554391400,1669664834,1787304780,1906247262,2022837584,265905162,114585348,499347990,349075736,736970802,585122620,972512814,821712160,2595684844,2478443234,2293045232,2174754046,3196267988,3079546586,2895723464,2777952454,3537852828,3687994002,3234156416,3385345166,4142626212,4293295786,3841024952,3992742070,174567692,57326082,410887952,292596766,777231668,660510266,1011452712,893681702,1108339068,1258480242,1343618912,1494807662,1715193156,1865862730,1948373848,2100090966,2701949495,2818666809,3004591147,3122358053,2235061775,2352307457,2535604243,2653899549,3915653703,3764988233,4219352155,4067639125,3444575871,3294430577,3746175075,3594982253,836553431,953270745,600235211,718002117,367585007,484830689,133361907,251657213,2041877159,1891211689,1806599355,1654886325,1568718495,1418573201,1335535747,1184342925];function JH(e){const t=[];for(let n=0;n<e.length;n+=4)t.push(e[n]<<24|e[n+1]<<16|e[n+2]<<8|e[n+3]);return t}class Eae{get key(){return Vc(this,aO,"f").slice()}constructor(t){if(aO.set(this,void 0),Eh.set(this,void 0),t0.set(this,void 0),!(this instanceof Eae))throw Error("AES must be instanitated with `new`");ZH(this,aO,new Uint8Array(t),"f");const n=Q5t[this.key.length];if(n==null)throw new TypeError("invalid key size (must be 16, 24 or 32 bytes)");ZH(this,t0,[],"f"),ZH(this,Eh,[],"f");for(let d=0;d<=n;d++)Vc(this,t0,"f").push([0,0,0,0]),Vc(this,Eh,"f").push([0,0,0,0]);const r=(n+1)*4,s=this.key.length/4,a=JH(this.key);let o;for(let d=0;d<s;d++)o=d>>2,Vc(this,t0,"f")[o][d%4]=a[d],Vc(this,Eh,"f")[n-o][d%4]=a[d];let l=0,c=s,u;for(;c<r;){if(u=a[s-1],a[0]^=gh[u>>16&255]<<24^gh[u>>8&255]<<16^gh[u&255]<<8^gh[u>>24&255]^Z5t[l]<<24,l+=1,s!=8)for(let g=1;g<s;g++)a[g]^=a[g-1];else{for(let g=1;g<s/2;g++)a[g]^=a[g-1];u=a[s/2-1],a[s/2]^=gh[u&255]^gh[u>>8&255]<<8^gh[u>>16&255]<<16^gh[u>>24&255]<<24;for(let g=s/2+1;g<s;g++)a[g]^=a[g-1]}let d=0,f,x;for(;d<s&&c<r;)f=c>>2,x=c%4,Vc(this,t0,"f")[f][x]=a[d],Vc(this,Eh,"f")[n-f][x]=a[d++],c++}for(let d=1;d<n;d++)for(let f=0;f<4;f++)u=Vc(this,Eh,"f")[d][f],Vc(this,Eh,"f")[d][f]=o6t[u>>24&255]^l6t[u>>16&255]^c6t[u>>8&255]^u6t[u&255]}encrypt(t){if(t.length!=16)throw new TypeError("invalid plaintext size (must be 16 bytes)");const n=Vc(this,t0,"f").length-1,r=[0,0,0,0];let s=JH(t);for(let l=0;l<4;l++)s[l]^=Vc(this,t0,"f")[0][l];for(let l=1;l<n;l++){for(let c=0;c<4;c++)r[c]=J5t[s[c]>>24&255]^e6t[s[(c+1)%4]>>16&255]^t6t[s[(c+2)%4]>>8&255]^n6t[s[(c+3)%4]&255]^Vc(this,t0,"f")[l][c];s=r.slice()}const a=new Uint8Array(16);let o=0;for(let l=0;l<4;l++)o=Vc(this,t0,"f")[n][l],a[4*l]=(gh[s[l]>>24&255]^o>>24)&255,a[4*l+1]=(gh[s[(l+1)%4]>>16&255]^o>>16)&255,a[4*l+2]=(gh[s[(l+2)%4]>>8&255]^o>>8)&255,a[4*l+3]=(gh[s[(l+3)%4]&255]^o)&255;return a}decrypt(t){if(t.length!=16)throw new TypeError("invalid ciphertext size (must be 16 bytes)");const n=Vc(this,Eh,"f").length-1,r=[0,0,0,0];let s=JH(t);for(let l=0;l<4;l++)s[l]^=Vc(this,Eh,"f")[0][l];for(let l=1;l<n;l++){for(let c=0;c<4;c++)r[c]=r6t[s[c]>>24&255]^s6t[s[(c+3)%4]>>16&255]^i6t[s[(c+2)%4]>>8&255]^a6t[s[(c+1)%4]&255]^Vc(this,Eh,"f")[l][c];s=r.slice()}const a=new Uint8Array(16);let o=0;for(let l=0;l<4;l++)o=Vc(this,Eh,"f")[n][l],a[4*l]=(sP[s[l]>>24&255]^o>>24)&255,a[4*l+1]=(sP[s[(l+3)%4]>>16&255]^o>>16)&255,a[4*l+2]=(sP[s[(l+2)%4]>>8&255]^o>>8)&255,a[4*l+3]=(sP[s[(l+1)%4]&255]^o)&255;return a}}aO=new WeakMap,Eh=new WeakMap,t0=new WeakMap;class IIe{constructor(t,n,r){if(r&&!(this instanceof r))throw new Error(`${t} must be instantiated with "new"`);Object.defineProperties(this,{aes:{enumerable:!0,value:new Eae(n)},name:{enumerable:!0,value:t}})}}var iP=function(e,t,n,r,s){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?s.call(e,n):s?s.value=n:t.set(e,n),n},U6=function(e,t,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(e):r?r.value:t.get(e)},yj,sg;class _ae extends IIe{constructor(t,n){if(super("ECC",t,_ae),yj.set(this,void 0),sg.set(this,void 0),n){if(n.length%16)throw new TypeError("invalid iv size (must be 16 bytes)");iP(this,yj,new Uint8Array(n),"f")}else iP(this,yj,new Uint8Array(16),"f");iP(this,sg,this.iv,"f")}get iv(){return new Uint8Array(U6(this,yj,"f"))}encrypt(t){if(t.length%16)throw new TypeError("invalid plaintext size (must be multiple of 16 bytes)");const n=new Uint8Array(t.length);for(let r=0;r<t.length;r+=16){for(let s=0;s<16;s++)U6(this,sg,"f")[s]^=t[r+s];iP(this,sg,this.aes.encrypt(U6(this,sg,"f")),"f"),n.set(U6(this,sg,"f"),r)}return n}decrypt(t){if(t.length%16)throw new TypeError("invalid ciphertext size (must be multiple of 16 bytes)");const n=new Uint8Array(t.length);for(let r=0;r<t.length;r+=16){const s=this.aes.decrypt(t.subarray(r,r+16));for(let a=0;a<16;a++)n[r+a]=s[a]^U6(this,sg,"f")[a],U6(this,sg,"f")[a]=t[r+a]}return n}}yj=new WeakMap,sg=new WeakMap;var z6=function(e,t,n,r,s){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?s.call(e,n):s?s.value=n:t.set(e,n),n},bh=function(e,t,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(e):r?r.value:t.get(e)},vj,Av,_h;class qS extends IIe{constructor(t,n){super("CTR",t,qS),vj.set(this,void 0),Av.set(this,void 0),_h.set(this,void 0),z6(this,_h,new Uint8Array(16),"f"),bh(this,_h,"f").fill(0),z6(this,vj,bh(this,_h,"f"),"f"),z6(this,Av,16,"f"),n==null&&(n=1),typeof n=="number"?this.setCounterValue(n):this.setCounterBytes(n)}get counter(){return new Uint8Array(bh(this,_h,"f"))}setCounterValue(t){if(!Number.isInteger(t)||t<0||t>Number.MAX_SAFE_INTEGER)throw new TypeError("invalid counter initial integer value");for(let n=15;n>=0;--n)bh(this,_h,"f")[n]=t%256,t=Math.floor(t/256)}setCounterBytes(t){if(t.length!==16)throw new TypeError("invalid counter initial Uint8Array value length");bh(this,_h,"f").set(t)}increment(){for(let t=15;t>=0;t--)if(bh(this,_h,"f")[t]===255)bh(this,_h,"f")[t]=0;else{bh(this,_h,"f")[t]++;break}}encrypt(t){var n,r;const s=new Uint8Array(t);for(let a=0;a<s.length;a++)bh(this,Av,"f")===16&&(z6(this,vj,this.aes.encrypt(bh(this,_h,"f")),"f"),z6(this,Av,0,"f"),this.increment()),s[a]^=bh(this,vj,"f")[z6(this,Av,(r=bh(this,Av,"f"),n=r++,r),"f"),n];return s}decrypt(t){return this.encrypt(t)}}vj=new WeakMap,Av=new WeakMap,_h=new WeakMap;function d6t(e){if(e.length<16)throw new TypeError("PKCS#7 invalid length");const t=e[e.length-1];if(t>16)throw new TypeError("PKCS#7 padding byte out of range");const n=e.length-t;for(let r=0;r<t;r++)if(e[n+r]!==t)throw new TypeError("PKCS#7 invalid padding byte");return new Uint8Array(e.subarray(0,n))}function PIe(e){return typeof e=="string"&&!e.startsWith("0x")&&(e="0x"+e),Jc(e)}function N7(e,t){for(e=String(e);e.length<t;)e="0"+e;return e}function Wk(e){return typeof e=="string"?ud(e,"NFKC"):Jc(e)}function xl(e,t){const n=t.match(/^([a-z0-9$_.-]*)(:([a-z]+))?(!)?$/i);bn(n!=null,"invalid path","path",t);const r=n[1],s=n[3],a=n[4]==="!";let o=e;for(const l of r.toLowerCase().split(".")){if(Array.isArray(o)){if(!l.match(/^[0-9]+$/))break;o=o[parseInt(l)]}else if(typeof o=="object"){let c=null;for(const u in o)if(u.toLowerCase()===l){c=o[u];break}o=c}else o=null;if(o==null)break}if(bn(!a||o!=null,"missing required value","path",r),s&&o!=null){if(s==="int"){if(typeof o=="string"&&o.match(/^-?[0-9]+$/))return parseInt(o);if(Number.isSafeInteger(o))return o}if(s==="number"&&typeof o=="string"&&o.match(/^-?[0-9.]*$/))return parseFloat(o);if(s==="data"&&typeof o=="string")return PIe(o);if(s==="array"&&Array.isArray(o)||s===typeof o)return o;bn(!1,`wrong type found for ${s} `,"path",r)}return o}const FIe="m/44'/60'/0'/0/0";function uxe(e){try{const t=JSON.parse(e);if((t.version!=null?parseInt(t.version):0)===3)return!0}catch{}return!1}function f6t(e,t,n){if(xl(e,"crypto.cipher:string")==="aes-128-ctr"){const s=xl(e,"crypto.cipherparams.iv:data!"),a=new qS(t,s);return Kr(a.decrypt(n))}Lr(!1,"unsupported cipher","UNSUPPORTED_OPERATION",{operation:"decrypt"})}function kM(e,t){const n=hs(t),r=xl(e,"crypto.ciphertext:data!"),s=Kr(lo(Ra([n.slice(16,32),r]))).substring(2);bn(s===xl(e,"crypto.mac:string!").toLowerCase(),"incorrect password","password","[ REDACTED ]");const a=f6t(e,n.slice(0,16),r),o=Uk(a);if(e.address){let u=e.address.toLowerCase();u.startsWith("0x")||(u="0x"+u),bn(na(u)===o,"keystore address/privateKey mismatch","address",e.address)}const l={address:o,privateKey:a};if(xl(e,"x-ethers.version:string")==="0.1"){const u=n.slice(32,64),d=xl(e,"x-ethers.mnemonicCiphertext:data!"),f=xl(e,"x-ethers.mnemonicCounter:data!"),x=new qS(u,f);l.mnemonic={path:xl(e,"x-ethers.path:string")||FIe,locale:xl(e,"x-ethers.locale:string")||"en",entropy:Kr(hs(x.decrypt(d)))}}return l}function OIe(e){const t=xl(e,"crypto.kdf:string");if(t&&typeof t=="string"){if(t.toLowerCase()==="scrypt"){const n=xl(e,"crypto.kdfparams.salt:data!"),r=xl(e,"crypto.kdfparams.n:int!"),s=xl(e,"crypto.kdfparams.r:int!"),a=xl(e,"crypto.kdfparams.p:int!");bn(r>0&&(r&r-1)===0,"invalid kdf.N","kdf.N",r),bn(s>0&&a>0,"invalid kdf","kdf",t);const o=xl(e,"crypto.kdfparams.dklen:int!");return bn(o===32,"invalid kdf.dklen","kdf.dflen",o),{name:"scrypt",salt:n,N:r,r:s,p:a,dkLen:64}}else if(t.toLowerCase()==="pbkdf2"){const n=xl(e,"crypto.kdfparams.salt:data!"),r=xl(e,"crypto.kdfparams.prf:string!"),s=r.split("-").pop();bn(s==="sha256"||s==="sha512","invalid kdf.pdf","kdf.pdf",r);const a=xl(e,"crypto.kdfparams.c:int!"),o=xl(e,"crypto.kdfparams.dklen:int!");return bn(o===32,"invalid kdf.dklen","kdf.dklen",o),{name:"pbkdf2",salt:n,count:a,dkLen:o,algorithm:s}}}bn(!1,"unsupported key-derivation function","kdf",t)}function h6t(e,t){const n=JSON.parse(e),r=Wk(t),s=OIe(n);if(s.name==="pbkdf2"){const{salt:f,count:x,dkLen:g,algorithm:v}=s,w=a2(r,f,x,g,v);return kM(n,w)}Lr(s.name==="scrypt","cannot be reached","UNKNOWN_ERROR",{params:s});const{salt:a,N:o,r:l,p:c,dkLen:u}=s,d=FA(r,a,o,l,c,u);return kM(n,d)}function dxe(e){return new Promise(t=>{setTimeout(()=>{t()},e)})}async function p6t(e,t,n){const r=JSON.parse(e),s=Wk(t),a=OIe(r);if(a.name==="pbkdf2"){n&&(n(0),await dxe(0));const{salt:x,count:g,dkLen:v,algorithm:w}=a,C=a2(s,x,g,v,w);return n&&(n(1),await dxe(0)),kM(r,C)}Lr(a.name==="scrypt","cannot be reached","UNKNOWN_ERROR",{params:a});const{salt:o,N:l,r:c,p:u,dkLen:d}=a,f=await PA(s,o,l,c,u,d,n);return kM(r,f)}function MIe(e){const t=e.salt!=null?hs(e.salt,"options.salt"):Wg(32);let n=1<<17,r=8,s=1;return e.scrypt&&(e.scrypt.N&&(n=e.scrypt.N),e.scrypt.r&&(r=e.scrypt.r),e.scrypt.p&&(s=e.scrypt.p)),bn(typeof n=="number"&&n>0&&Number.isSafeInteger(n)&&(BigInt(n)&BigInt(n-1))===BigInt(0),"invalid scrypt N parameter","options.N",n),bn(typeof r=="number"&&r>0&&Number.isSafeInteger(r),"invalid scrypt r parameter","options.r",r),bn(typeof s=="number"&&s>0&&Number.isSafeInteger(s),"invalid scrypt p parameter","options.p",s),{name:"scrypt",dkLen:32,salt:t,N:n,r,p:s}}function RIe(e,t,n,r){const s=hs(n.privateKey,"privateKey"),a=r.iv!=null?hs(r.iv,"options.iv"):Wg(16);bn(a.length===16,"invalid options.iv length","options.iv",r.iv);const o=r.uuid!=null?hs(r.uuid,"options.uuid"):Wg(16);bn(o.length===16,"invalid options.uuid length","options.uuid",r.iv);const l=e.slice(0,16),c=e.slice(16,32),u=new qS(l,a),d=hs(u.encrypt(s)),f=lo(Ra([c,d])),x={address:n.address.substring(2).toLowerCase(),id:p2t(o),version:3,Crypto:{cipher:"aes-128-ctr",cipherparams:{iv:Kr(a).substring(2)},ciphertext:Kr(d).substring(2),kdf:"scrypt",kdfparams:{salt:Kr(t.salt).substring(2),n:t.N,dklen:32,p:t.p,r:t.r},mac:f.substring(2)}};if(n.mnemonic){const g=r.client!=null?r.client:`ethers/${hke}`,v=n.mnemonic.path||FIe,w=n.mnemonic.locale||"en",C=e.slice(32,64),N=hs(n.mnemonic.entropy,"account.mnemonic.entropy"),P=Wg(16),I=new qS(C,P),R=hs(I.encrypt(N)),F=new Date,L="UTC--"+(F.getUTCFullYear()+"-"+N7(F.getUTCMonth()+1,2)+"-"+N7(F.getUTCDate(),2)+"T"+N7(F.getUTCHours(),2)+"-"+N7(F.getUTCMinutes(),2)+"-"+N7(F.getUTCSeconds(),2)+".0Z")+"--"+x.address;x["x-ethers"]={client:g,gethFilename:L,path:v,locale:w,mnemonicCounter:Kr(P).substring(2),mnemonicCiphertext:Kr(R).substring(2),version:"0.1"}}return JSON.stringify(x)}function LIe(e,t,n){n==null&&(n={});const r=Wk(t),s=MIe(n),a=FA(r,s.salt,s.N,s.r,s.p,64);return RIe(hs(a),s,e,n)}async function DIe(e,t,n){n==null&&(n={});const r=Wk(t),s=MIe(n),a=await PA(r,s.salt,s.N,s.r,s.p,64,n.progressCallback);return RIe(hs(a),s,e,n)}const eV="m/44'/60'/0'/0/0",m6t=new Uint8Array([66,105,116,99,111,105,110,32,115,101,101,100]),a4=2147483648,x6t=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),g6t="0123456789abcdef";function TM(e,t){let n="";for(;e;)n=g6t[e%16]+n,e=Math.trunc(e/16);for(;n.length<t*2;)n="0"+n;return"0x"+n}function tee(e){const t=hs(e),n=go(op(op(t)),0,4),r=Ra([t,n]);return yke(r)}const n0={};function BIe(e,t,n,r){const s=new Uint8Array(37);e&a4?(Lr(r!=null,"cannot derive child of neutered node","UNSUPPORTED_OPERATION",{operation:"deriveChild"}),s.set(hs(r),1)):s.set(hs(n));for(let o=24;o>=0;o-=8)s[33+(o>>3)]=e>>24-o&255;const a=hs(TA("sha512",t,s));return{IL:a.slice(0,32),IR:a.slice(32)}}function $Ie(e,t){const n=t.split("/");bn(n.length>0,"invalid path","path",t),n[0]==="m"&&(bn(e.depth===0,`cannot derive root path (i.e. path starting with "m/") for a node at non-zero depth ${e.depth}`,"path",t),n.shift());let r=e;for(let s=0;s<n.length;s++){const a=n[s];if(a.match(/^[0-9]+'$/)){const o=parseInt(a.substring(0,a.length-1));bn(o<a4,"invalid path index",`path[${s}]`,a),r=r.deriveChild(a4+o)}else if(a.match(/^[0-9]+$/)){const o=parseInt(a);bn(o<a4,"invalid path index",`path[${s}]`,a),r=r.deriveChild(o)}else bn(!1,"invalid path component",`path[${s}]`,a)}return r}var fk,nee,$w,wj;const Lp=class Lp extends EM{constructor(n,r,s,a,o,l,c,u,d){super(r,d);Rn(this,fk);Un(this,"publicKey");Un(this,"fingerprint");Un(this,"parentFingerprint");Un(this,"mnemonic");Un(this,"chainCode");Un(this,"path");Un(this,"index");Un(this,"depth");c5(n,n0,"HDNodeWallet"),Ds(this,{publicKey:r.compressedPublicKey});const f=go(IA(op(this.publicKey)),0,4);Ds(this,{parentFingerprint:s,fingerprint:f,chainCode:a,path:o,index:l,depth:c}),Ds(this,{mnemonic:u})}connect(n){return new Lp(n0,this.signingKey,this.parentFingerprint,this.chainCode,this.path,this.index,this.depth,this.mnemonic,n)}async encrypt(n,r){return await DIe(vr(this,fk,nee).call(this),n,{progressCallback:r})}encryptSync(n){return LIe(vr(this,fk,nee).call(this),n)}get extendedKey(){return Lr(this.depth<256,"Depth too deep","UNSUPPORTED_OPERATION",{operation:"extendedKey"}),tee(Ra(["0x0488ADE4",TM(this.depth,1),this.parentFingerprint,TM(this.index,4),this.chainCode,Ra(["0x00",this.privateKey])]))}hasPath(){return this.path!=null}neuter(){return new yE(n0,this.address,this.publicKey,this.parentFingerprint,this.chainCode,this.path,this.index,this.depth,this.provider)}deriveChild(n){const r=Di(n,"index");bn(r<=4294967295,"invalid index","index",r);let s=this.path;s&&(s+="/"+(r&2147483647),r&a4&&(s+="'"));const{IR:a,IL:o}=BIe(r,this.chainCode,this.publicKey,this.privateKey),l=new L0(o1((FB(o)+BigInt(this.privateKey))%x6t,32));return new Lp(n0,l,this.fingerprint,Kr(a),s,r,this.depth+1,this.mnemonic,this.provider)}derivePath(n){return $Ie(this,n)}static fromExtendedKey(n){const r=il(Zyt(n));bn(r.length===82||tee(r.slice(0,78))===n,"invalid extended key","extendedKey","[ REDACTED ]");const s=r[4],a=Kr(r.slice(5,9)),o=parseInt(Kr(r.slice(9,13)).substring(2),16),l=Kr(r.slice(13,45)),c=r.slice(45,78);switch(Kr(r.slice(0,4))){case"0x0488b21e":case"0x043587cf":{const u=Kr(c);return new yE(n0,Uk(u),u,a,l,null,o,s,null)}case"0x0488ade4":case"0x04358394 ":if(c[0]!==0)break;return new Lp(n0,new L0(c.slice(1)),a,l,null,o,s,null,null)}bn(!1,"invalid extended key prefix","extendedKey","[ REDACTED ]")}static createRandom(n,r,s){var o;n==null&&(n=""),r==null&&(r=eV),s==null&&(s=T3.wordlist());const a=WS.fromEntropy(Wg(16),n,s);return vr(o=Lp,$w,wj).call(o,a.computeSeed(),a).derivePath(r)}static fromMnemonic(n,r){var s;return r||(r=eV),vr(s=Lp,$w,wj).call(s,n.computeSeed(),n).derivePath(r)}static fromPhrase(n,r,s,a){var l;r==null&&(r=""),s==null&&(s=eV),a==null&&(a=T3.wordlist());const o=WS.fromPhrase(n,r,a);return vr(l=Lp,$w,wj).call(l,o.computeSeed(),o).derivePath(s)}static fromSeed(n){var r;return vr(r=Lp,$w,wj).call(r,n,null)}};fk=new WeakSet,nee=function(){const n={address:this.address,privateKey:this.privateKey},r=this.mnemonic;return this.path&&r&&r.wordlist.locale==="en"&&r.password===""&&(n.mnemonic={path:this.path,locale:"en",entropy:r.entropy}),n},$w=new WeakSet,wj=function(n,r){bn(TB(n),"invalid seed","seed","[REDACTED]");const s=hs(n,"seed");bn(s.length>=16&&s.length<=64,"invalid seed","seed","[REDACTED]");const a=hs(TA("sha512",m6t,s)),o=new L0(Kr(a.slice(0,32)));return new Lp(n0,o,"0x00000000",Kr(a.slice(32)),"m",0,0,r,null)},Rn(Lp,$w);let qj=Lp;class yE extends KJ{constructor(n,r,s,a,o,l,c,u,d){super(r,d);Un(this,"publicKey");Un(this,"fingerprint");Un(this,"parentFingerprint");Un(this,"chainCode");Un(this,"path");Un(this,"index");Un(this,"depth");c5(n,n0,"HDNodeVoidWallet"),Ds(this,{publicKey:s});const f=go(IA(op(s)),0,4);Ds(this,{publicKey:s,fingerprint:f,parentFingerprint:a,chainCode:o,path:l,index:c,depth:u})}connect(n){return new yE(n0,this.address,this.publicKey,this.parentFingerprint,this.chainCode,this.path,this.index,this.depth,n)}get extendedKey(){return Lr(this.depth<256,"Depth too deep","UNSUPPORTED_OPERATION",{operation:"extendedKey"}),tee(Ra(["0x0488B21E",TM(this.depth,1),this.parentFingerprint,TM(this.index,4),this.chainCode,this.publicKey]))}hasPath(){return this.path!=null}deriveChild(n){const r=Di(n,"index");bn(r<=4294967295,"invalid index","index",r);let s=this.path;s&&(s+="/"+(r&2147483647),r&a4&&(s+="'"));const{IR:a,IL:o}=BIe(r,this.chainCode,this.publicKey,null),l=L0.addPoints(o,this.publicKey,!0),c=Uk(l);return new yE(n0,c,l,this.fingerprint,Kr(a),s,r,this.depth+1,this.provider)}derivePath(n){return $Ie(this,n)}}function fxe(e){try{if(JSON.parse(e).encseed)return!0}catch{}return!1}function hxe(e,t){const n=JSON.parse(e),r=Wk(t),s=na(xl(n,"ethaddr:string!")),a=PIe(xl(n,"encseed:string!"));bn(a&&a.length%16===0,"invalid encseed","json",e);const o=hs(a2(r,r,2e3,32,"sha256")).slice(0,16),l=a.slice(0,16),c=a.slice(16),u=new _ae(o,l),d=d6t(hs(u.decrypt(c)));let f="";for(let x=0;x<d.length;x++)f+=String.fromCharCode(d[x]);return{address:s,privateKey:c1(f)}}function pxe(e){return new Promise(t=>{setTimeout(()=>{t()},e)})}var hk,F0,ree;let kae=(F0=class extends EM{constructor(t,n){typeof t=="string"&&!t.startsWith("0x")&&(t="0x"+t);let r=typeof t=="string"?new L0(t):t;super(r,n)}connect(t){return new F0(this.signingKey,t)}async encrypt(t,n){const r={address:this.address,privateKey:this.privateKey};return await DIe(r,t,{progressCallback:n})}encryptSync(t){const n={address:this.address,privateKey:this.privateKey};return LIe(n,t)}static async fromEncryptedJson(t,n,r){var a;let s=null;return uxe(t)?s=await p6t(t,n,r):fxe(t)&&(r&&(r(0),await pxe(0)),s=hxe(t,n),r&&(r(1),await pxe(0))),vr(a=F0,hk,ree).call(a,s)}static fromEncryptedJsonSync(t,n){var s;let r=null;return uxe(t)?r=h6t(t,n):fxe(t)?r=hxe(t,n):bn(!1,"invalid JSON wallet","json","[ REDACTED ]"),vr(s=F0,hk,ree).call(s,r)}static createRandom(t){const n=qj.createRandom();return t?n.connect(t):n}static fromPhrase(t,n){const r=qj.fromPhrase(t);return n?r.connect(n):r}},hk=new WeakSet,ree=function(t){if(bn(t,"invalid JSON wallet","json","[ REDACTED ]"),"mnemonic"in t&&t.mnemonic&&t.mnemonic.locale==="en"){const r=WS.fromEntropy(t.mnemonic.entropy),s=qj.fromMnemonic(r,t.mnemonic.path);if(s.address===t.address&&s.privateKey===t.privateKey)return s;console.log("WARNING: JSON mismatch address/privateKey != mnemonic; fallback onto private key")}const n=new F0(t.privateKey);return bn(n.address===t.address,"address/privateKey mismatch","json","[ REDACTED ]"),n},Rn(F0,hk),F0);async function mxe(e,t,n){let r;if(e===2?r=t==null?void 0:t.builder_sign_data:e===1?r=t==null?void 0:t.sign_data:r=(t==null?void 0:t.builder_sign_data)??(t==null?void 0:t.sign_data),!r)throw new Error("No data found to sign (no sign_data / builder_sign_data).");const{domain:s,types:a,message:o,primaryType:l}=r,{EIP712Domain:c,primary_type:u,...d}=a||{},f={[l]:u||[],...d},x={...o,nonce:(o==null?void 0:o.nonce)!=null?o.nonce.toString():o==null?void 0:o.nonce};if(typeof n.signTypedData!="function")throw new Error("Signer does not support EIP-712 typed data signing");const g=await n.signTypedData(s,f,x),v=nu.from(g);return{signature:{r:v.r,s:v.s,v:v.v},action:{...x,nonce:Number(x==null?void 0:x.nonce)},nonce:(x==null?void 0:x.nonce)||""}}const IM=({className:e})=>i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",className:e,children:i.jsx("path",{d:"M9 1.5C4.8675 1.5 1.5 4.8675 1.5 9C1.5 13.1325 4.8675 16.5 9 16.5C13.1325 16.5 16.5 13.1325 16.5 9C16.5 4.8675 13.1325 1.5 9 1.5ZM8.4375 6C8.4375 5.6925 8.6925 5.4375 9 5.4375C9.3075 5.4375 9.5625 5.6925 9.5625 6V9.75C9.5625 10.0575 9.3075 10.3125 9 10.3125C8.6925 10.3125 8.4375 10.0575 8.4375 9.75V6ZM9.69 12.285C9.6525 12.3825 9.6 12.4575 9.5325 12.5325C9.4575 12.6 9.375 12.6525 9.285 12.69C9.195 12.7275 9.0975 12.75 9 12.75C8.9025 12.75 8.805 12.7275 8.715 12.69C8.625 12.6525 8.5425 12.6 8.4675 12.5325C8.4 12.4575 8.3475 12.3825 8.31 12.285C8.2725 12.195 8.25 12.0975 8.25 12C8.25 11.9025 8.2725 11.805 8.31 11.715C8.3475 11.625 8.4 11.5425 8.4675 11.4675C8.5425 11.4 8.625 11.3475 8.715 11.31C8.895 11.235 9.105 11.235 9.285 11.31C9.375 11.3475 9.4575 11.4 9.5325 11.4675C9.6 11.5425 9.6525 11.625 9.69 11.715C9.7275 11.805 9.75 11.9025 9.75 12C9.75 12.0975 9.7275 12.195 9.69 12.285Z",fill:"currentColor"})});var UIe={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},xxe=Ae.createContext&&Ae.createContext(UIe),b6t=["attr","size","title"];function y6t(e,t){if(e==null)return{};var n=v6t(e,t),r,s;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(s=0;s<a.length;s++)r=a[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function v6t(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function PM(){return PM=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},PM.apply(this,arguments)}function gxe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function FM(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?gxe(Object(n),!0).forEach(function(r){w6t(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gxe(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function w6t(e,t,n){return t=C6t(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function C6t(e){var t=S6t(e,"string");return typeof t=="symbol"?t:t+""}function S6t(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function zIe(e){return e&&e.map((t,n)=>Ae.createElement(t.tag,FM({key:n},t.attr),zIe(t.child)))}function jl(e){return t=>Ae.createElement(N6t,PM({attr:FM({},e.attr)},t),zIe(e.child))}function N6t(e){var t=n=>{var{attr:r,size:s,title:a}=e,o=y6t(e,b6t),l=s||n.size||"1em",c;return n.className&&(c=n.className),e.className&&(c=(c?c+" ":"")+e.className),Ae.createElement("svg",PM({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},n.attr,r,o,{className:c,style:FM(FM({color:e.color||n.color},n.style),e.style),height:l,width:l,xmlns:"http://www.w3.org/2000/svg"}),a&&Ae.createElement("title",null,a),e.children)};return xxe!==void 0?Ae.createElement(xxe.Consumer,null,n=>t(n)):t(UIe)}function A6t(e){return jl({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M446.7 98.6l-67.6 318.8c-5.1 22.5-18.4 28.1-37.3 17.5l-103-75.9-49.7 47.8c-5.5 5.5-10.1 10.1-20.7 10.1l7.4-104.9 190.9-172.5c8.3-7.4-1.8-11.5-12.9-4.1L117.8 284 16.2 252.2c-22.1-6.9-22.5-22.1 4.6-32.7L418.2 66.4c18.4-6.9 34.5 4.1 28.5 32.2z"},child:[]}]})(e)}function qk(e){return jl({tag:"svg",attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M549.655 124.083c-6.281-23.65-24.787-42.276-48.284-48.597C458.781 64 288 64 288 64S117.22 64 74.629 75.486c-23.497 6.322-42.003 24.947-48.284 48.597-11.412 42.867-11.412 132.305-11.412 132.305s0 89.438 11.412 132.305c6.281 23.65 24.787 41.5 48.284 47.821C117.22 448 288 448 288 448s170.78 0 213.371-11.486c23.497-6.321 42.003-24.171 48.284-47.821 11.412-42.867 11.412-132.305 11.412-132.305s0-89.438-11.412-132.305zm-317.51 213.508V175.185l142.739 81.205-142.739 81.201z"},child:[]}]})(e)}function j6t(e){return jl({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M487.4 315.7l-42.6-24.6c4.3-23.2 4.3-47 0-70.2l42.6-24.6c4.9-2.8 7.1-8.6 5.5-14-11.1-35.6-30-67.8-54.7-94.6-3.8-4.1-10-5.1-14.8-2.3L380.8 110c-17.9-15.4-38.5-27.3-60.8-35.1V25.8c0-5.6-3.9-10.5-9.4-11.7-36.7-8.2-74.3-7.8-109.2 0-5.5 1.2-9.4 6.1-9.4 11.7V75c-22.2 7.9-42.8 19.8-60.8 35.1L88.7 85.5c-4.9-2.8-11-1.9-14.8 2.3-24.7 26.7-43.6 58.9-54.7 94.6-1.7 5.4.6 11.2 5.5 14L67.3 221c-4.3 23.2-4.3 47 0 70.2l-42.6 24.6c-4.9 2.8-7.1 8.6-5.5 14 11.1 35.6 30 67.8 54.7 94.6 3.8 4.1 10 5.1 14.8 2.3l42.6-24.6c17.9 15.4 38.5 27.3 60.8 35.1v49.2c0 5.6 3.9 10.5 9.4 11.7 36.7 8.2 74.3 7.8 109.2 0 5.5-1.2 9.4-6.1 9.4-11.7v-49.2c22.2-7.9 42.8-19.8 60.8-35.1l42.6 24.6c4.9 2.8 11 1.9 14.8-2.3 24.7-26.7 43.6-58.9 54.7-94.6 1.5-5.5-.7-11.3-5.6-14.1zM256 336c-44.1 0-80-35.9-80-80s35.9-80 80-80 80 35.9 80 80-35.9 80-80 80z"},child:[]}]})(e)}function Tae(e){return jl({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M0 168v-16c0-13.255 10.745-24 24-24h360V80c0-21.367 25.899-32.042 40.971-16.971l80 80c9.372 9.373 9.372 24.569 0 33.941l-80 80C409.956 271.982 384 261.456 384 240v-48H24c-13.255 0-24-10.745-24-24zm488 152H128v-48c0-21.314-25.862-32.08-40.971-16.971l-80 80c-9.372 9.373-9.372 24.569 0 33.941l80 80C102.057 463.997 128 453.437 128 432v-48h360c13.255 0 24-10.745 24-24v-16c0-13.255-10.745-24-24-24z"},child:[]}]})(e)}function la(e){return jl({tag:"svg",attr:{viewBox:"0 0 640 512"},child:[{tag:"path",attr:{d:"M320 400c-75.85 0-137.25-58.71-142.9-133.11L72.2 185.82c-13.79 17.3-26.48 35.59-36.72 55.59a32.35 32.35 0 0 0 0 29.19C89.71 376.41 197.07 448 320 448c26.91 0 52.87-4 77.89-10.46L346 397.39a144.13 144.13 0 0 1-26 2.61zm313.82 58.1l-110.55-85.44a331.25 331.25 0 0 0 81.25-102.07 32.35 32.35 0 0 0 0-29.19C550.29 135.59 442.93 64 320 64a308.15 308.15 0 0 0-147.32 37.7L45.46 3.37A16 16 0 0 0 23 6.18L3.37 31.45A16 16 0 0 0 6.18 53.9l588.36 454.73a16 16 0 0 0 22.46-2.81l19.64-25.27a16 16 0 0 0-2.82-22.45zm-183.72-142l-39.3-30.38A94.75 94.75 0 0 0 416 256a94.76 94.76 0 0 0-121.31-92.21A47.65 47.65 0 0 1 304 192a46.64 46.64 0 0 1-1.54 10l-73.61-56.89A142.31 142.31 0 0 1 320 112a143.92 143.92 0 0 1 144 144c0 21.63-5.29 41.79-13.9 60.11z"},child:[]}]})(e)}function ca(e){return jl({tag:"svg",attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M572.52 241.4C518.29 135.59 410.93 64 288 64S57.68 135.64 3.48 241.41a32.35 32.35 0 0 0 0 29.19C57.71 376.41 165.07 448 288 448s230.32-71.64 284.52-177.41a32.35 32.35 0 0 0 0-29.19zM288 400a144 144 0 1 1 144-144 143.93 143.93 0 0 1-144 144zm0-240a95.31 95.31 0 0 0-25.31 3.79 47.85 47.85 0 0 1-66.9 66.9A95.78 95.78 0 1 0 288 160z"},child:[]}]})(e)}function E6t(e){return jl({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M487.976 0H24.028C2.71 0-8.047 25.866 7.058 40.971L192 225.941V432c0 7.831 3.821 15.17 10.237 19.662l80 55.98C298.02 518.69 320 507.493 320 487.98V225.941l184.947-184.97C520.021 25.896 509.338 0 487.976 0z"},child:[]}]})(e)}function _6t(e){return jl({tag:"svg",attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M480 416v16c0 26.51-21.49 48-48 48H48c-26.51 0-48-21.49-48-48V176c0-26.51 21.49-48 48-48h16v208c0 44.112 35.888 80 80 80h336zm96-80V80c0-26.51-21.49-48-48-48H144c-26.51 0-48 21.49-48 48v256c0 26.51 21.49 48 48 48h384c26.51 0 48-21.49 48-48zM256 128c0 26.51-21.49 48-48 48s-48-21.49-48-48 21.49-48 48-48 48 21.49 48 48zm-96 144l55.515-55.515c4.686-4.686 12.284-4.686 16.971 0L272 256l135.515-135.515c4.686-4.686 12.284-4.686 16.971 0L512 208v112H160v-48z"},child:[]}]})(e)}function k6t(e){return jl({tag:"svg",attr:{viewBox:"0 0 320 512"},child:[{tag:"path",attr:{d:"M272 0H48C21.5 0 0 21.5 0 48v416c0 26.5 21.5 48 48 48h224c26.5 0 48-21.5 48-48V48c0-26.5-21.5-48-48-48zM160 480c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32zm112-108c0 6.6-5.4 12-12 12H60c-6.6 0-12-5.4-12-12V60c0-6.6 5.4-12 12-12h200c6.6 0 12 5.4 12 12v312z"},child:[]}]})(e)}function T6t(e){return jl({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M476 3.2L12.5 270.6c-18.1 10.4-15.8 35.6 2.2 43.2L121 358.4l287.3-253.2c5.5-4.9 13.3 2.6 8.6 8.3L176 407v80.5c0 23.6 28.5 32.9 42.5 15.8L282 426l124.6 52.2c14.2 6 30.4-2.9 33-18.2l72-432C515 7.8 493.3-6.8 476 3.2z"},child:[]}]})(e)}function I6t(e){return jl({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M352 320c-22.608 0-43.387 7.819-59.79 20.895l-102.486-64.054a96.551 96.551 0 0 0 0-41.683l102.486-64.054C308.613 184.181 329.392 192 352 192c53.019 0 96-42.981 96-96S405.019 0 352 0s-96 42.981-96 96c0 7.158.79 14.13 2.276 20.841L155.79 180.895C139.387 167.819 118.608 160 96 160c-53.019 0-96 42.981-96 96s42.981 96 96 96c22.608 0 43.387-7.819 59.79-20.895l102.486 64.054A96.301 96.301 0 0 0 256 416c0 53.019 42.981 96 96 96s96-42.981 96-96-42.981-96-96-96z"},child:[]}]})(e)}function I3(e){return jl({tag:"svg",attr:{viewBox:"0 0 320 512"},child:[{tag:"path",attr:{d:"M41 288h238c21.4 0 32.1 25.9 17 41L177 448c-9.4 9.4-24.6 9.4-33.9 0L24 329c-15.1-15.1-4.4-41 17-41z"},child:[]}]})(e)}function P3(e){return jl({tag:"svg",attr:{viewBox:"0 0 320 512"},child:[{tag:"path",attr:{d:"M279 224H41c-21.4 0-32.1-25.9-17-41L143 64c9.4-9.4 24.6-9.4 33.9 0l119 119c15.2 15.1 4.5 41-16.9 41z"},child:[]}]})(e)}function F3(e){return jl({tag:"svg",attr:{viewBox:"0 0 320 512"},child:[{tag:"path",attr:{d:"M41 288h238c21.4 0 32.1 25.9 17 41L177 448c-9.4 9.4-24.6 9.4-33.9 0L24 329c-15.1-15.1-4.4-41 17-41zm255-105L177 64c-9.4-9.4-24.6-9.4-33.9 0L24 183c-15.1 15.1-4.4 41 17 41h238c21.4 0 32.1-25.9 17-41z"},child:[]}]})(e)}function HIe(e){return jl({tag:"svg",attr:{viewBox:"0 0 352 512"},child:[{tag:"path",attr:{d:"M242.72 256l100.07-100.07c12.28-12.28 12.28-32.19 0-44.48l-22.24-22.24c-12.28-12.28-32.19-12.28-44.48 0L176 189.28 75.93 89.21c-12.28-12.28-32.19-12.28-44.48 0L9.21 111.45c-12.28 12.28-12.28 32.19 0 44.48L109.28 256 9.21 356.07c-12.28 12.28-12.28 32.19 0 44.48l22.24 22.24c12.28 12.28 32.2 12.28 44.48 0L176 322.72l100.07 100.07c12.28 12.28 32.2 12.28 44.48 0l22.24-22.24c12.28-12.28 12.28-32.19 0-44.48L242.72 256z"},child:[]}]})(e)}const P6t=({handleListRequest:e,isLighterInfoValue:t,handleLighterWalletInfo:n})=>{var pe;const r="https://dextrabothypev2.nftinit.io",{setSignModalOpen:s}=m.useContext(Qr),[a,o]=m.useState(""),[l,c]=m.useState(""),[u,d]=m.useState(""),[f,x]=m.useState(""),[g,v]=m.useState(!1),[w,C]=m.useState(!1),[N,P]=m.useState(""),[I,R]=m.useState(""),[F,U]=m.useState(!0),[L,z]=m.useState({}),Q=Y=>/^\d*$/.test(Y),ne=Y=>{["e","E","+","-"].includes(Y.key)&&Y.preventDefault()},J=a.trim()!==""&&l.trim()!==""&&u.trim()!==""&&f.trim()!=="",X=async()=>{if(!J){P("Please fill in all fields.");return}try{C(!0),P(""),R("");const Y=window.localStorage.getItem("hyperToken"),ie=window.localStorage.getItem("hyperAddress");if(!Y||!ie){s(!0),C(!1);return}const oe={address:ie.toLowerCase(),token:Y,wallet_name:a,main_wallet:l,api_wallet_idx:f,api_wallet_private_key:u},V=await(await fetch(`${r}/api/wallet/generate-lighter`,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(oe)})).json();V!=null&&V.success?(rn.success("Wallet created successfully.",{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(103, 255, 189, 0.16)",width:"280px",minWidth:"280px",height:"40px",backdropFilter:"blur(16px)"},iconTheme:{primary:"#67FFBD",secondary:"#276047"}}),e(),n(ie),o(""),c(""),d(""),x(""),P(""),R(V==null?void 0:V.message)):P((V==null?void 0:V.error_message)||"An error has occurred.")}catch(Y){P(Y.message||"An error has occurred.")}finally{C(!1)}},re=async(Y,ie)=>{console.log("id :>> ",Y);const oe=`${Y}_${ie}`;try{z(Ne=>({...Ne,[oe]:!0})),P(""),R("");const G=window.localStorage.getItem("hyperToken"),V=window.localStorage.getItem("hyperAddress");if(!G||!V){s(!0),z(Ne=>({...Ne,[oe]:!1}));return}const ee={address:V.toLowerCase(),token:G,wallet_id:Number(Y)},fe=await(await fetch(`${r}/api/wallet/delete-lighter`,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(ee)})).json();fe!=null&&fe.success?(rn.success("Wallet deleted successfully.",{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(103, 255, 189, 0.16)",width:"280px",minWidth:"280px",height:"40px",backdropFilter:"blur(16px)"},iconTheme:{primary:"#67FFBD",secondary:"#276047"}}),n(V),P(""),R(fe==null?void 0:fe.message)):P((fe==null?void 0:fe.error_message)||"An error has occurred.")}catch(G){P(G.message||"An error has occurred.")}finally{C(!1)}};return i.jsxs("div",{className:"flex flex-col items-start gap-2 w-full relative",children:[w&&i.jsx("div",{role:"status",className:"absolute top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 flex justify-center items-center w-full z-[60] -mt-20 h-full min-h-[450px] sm:min-h-[280px]",children:i.jsx(Da,{})}),i.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4 w-full",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"flex items-center justify-between",children:i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Wallet Name"})}),i.jsx("div",{className:"relative",children:i.jsx("input",{value:a,onChange:Y=>o(Y.target.value),autoComplete:"off",placeholder:"Wallet Name",type:"text",className:`w-full h-8 px-3 rounded-md bg-[#1b1b1b] text-white border text-[13px] outline-none placeholder:text-[#7F7F7F] ${a===""?"border-[#303030]":"border-[#303030] focus:border-[#67FFBD]"}`,disabled:w})})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"flex items-center justify-between",children:i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Login Address"})}),i.jsx("div",{className:"relative",children:i.jsx("input",{value:l,onChange:Y=>c(Y.target.value),autoComplete:"off",placeholder:"Login Address",type:"text",className:`w-full h-8 px-3 rounded-md text-white bg-[#1b1b1b] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${l===""?"border-[#303030]":"border-[#303030] focus:border-[#67FFBD]"}`,disabled:w})})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"flex items-center justify-between",children:i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"API Private Key"})}),i.jsxs("div",{className:"relative",children:[i.jsx("input",{value:u,onChange:Y=>d(Y.target.value),autoComplete:"off",placeholder:"API_PRIVATE_KEY",type:g?"text":"password",className:`w-full h-8 pl-3 pr-16 rounded-md text-white bg-[#1b1b1b] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${u===""?"border-[#303030]":"border-[#303030] focus:border-[#67FFBD]"}`,disabled:w}),i.jsx("button",{type:"button",onClick:()=>v(Y=>!Y),className:"absolute right-1 top-1/2 -translate-y-1/2 text-[11px] text-[#9B9B9B] hover:text-white h-6 flex justify-center items-center hover:border-none hover:ring-0 focus:outline-none focus:border-none bg-transparent",disabled:w,children:g?i.jsx(la,{size:14}):i.jsx(ca,{size:14})})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"API Key Index"}),i.jsx("div",{className:"relative",children:i.jsx("input",{value:f,onChange:Y=>{const ie=Y.target.value.trim();if(ie==="")return x("");Q(ie)&&x(ie)},onKeyDown:ne,inputMode:"numeric",autoComplete:"off",placeholder:"API_KEY_INDEX",className:`w-full h-8 px-3 rounded-md text-white bg-[#1b1b1b] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${f===""?"border-[#303030]":"border-[#303030] focus:border-[#67FFBD]"}`,disabled:w})})]})]}),i.jsx("button",{onClick:()=>{!w&&X()},disabled:w,className:"w-full h-10 pl-2 pr-3.5 py-3 bg-[#7445ff] rounded-xl shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-[#8860ff] focus:ring-0 focus:outline-none justify-center items-center gap-1.5 inline-flex mt-2.5",children:i.jsx("div",{className:"text-white text-[14px] font-medium font-inter leading-[8px]",children:"Generate"})}),i.jsx("div",{className:"w-full mt-2",children:(t==null?void 0:t.length)>0?i.jsxs("div",{className:"flex flex-col items-start gap-3 w-full ",children:[i.jsxs("div",{className:"flex justify-between items-center gap-2 cursor-pointer text-sm text-zinc-300 w-full",onClick:()=>U(!F),children:[i.jsx("span",{className:"text-white text-sm font-medium font-['Inter'] leading-normal",children:"Lighter Wallets"}),i.jsx(sse,{className:`w-3.5 h-3.5 transition-transform text-white ${F?"":"rotate-180"}`})]}),i.jsx("div",{className:"flex flex-col items-start gap-1 sm:gap-1.5 w-full max-h-[80px] overflow-y-auto",children:F&&((pe=[...t].sort((Y,ie)=>(ie==null?void 0:ie.wallet_created_data)-(Y==null?void 0:Y.wallet_created_data)))==null?void 0:pe.map((Y,ie)=>{var oe,G;return i.jsx("div",{className:"flex flex-col items-start w-full",children:i.jsxs("div",{className:"flex justify-between items-center gap-2 w-full",children:[i.jsx("div",{className:"flex justify-start items-center gap-2",children:i.jsx("span",{className:"text-[#929292] text-[11px] font-normal min-w-[110px]",children:((oe=Y==null?void 0:Y.wallet_name)==null?void 0:oe.length)>18?((G=Y==null?void 0:Y.wallet_name)==null?void 0:G.slice(0,18))+"...":Y==null?void 0:Y.wallet_name})}),i.jsxs("div",{className:"flex justify-start items-center w-max",children:[i.jsx("span",{className:"text-[#929292] text-[11px] font-normal min-w-[75px]",children:(Y==null?void 0:Y.wallet_address.slice(0,6))+"..."+(Y==null?void 0:Y.wallet_address.slice(-4))}),i.jsx("img",{onClick:V=>{V.stopPropagation(),navigator.clipboard.writeText(Y==null?void 0:Y.wallet_address),rn.success("Successfully copied.",{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(103, 255, 189, 0.16)",width:"280px",minWidth:"280px",height:"40px",backdropFilter:"blur(16px)"},iconTheme:{primary:"#67FFBD",secondary:"#276047"}})},src:wo,alt:"",className:"cursor-pointer"})]}),i.jsx("span",{className:"text-[#929292] text-[11px] font-normal font-['Inter'] leading-4 min-w-max hidden sm:flex",children:su(Y==null?void 0:Y.wallet_created_data)}),L[`${Y==null?void 0:Y.wallet_id}_${Y==null?void 0:Y.wallet_name.toLowerCase()}`]?i.jsxs("div",{role:"status",className:"flex justify-center items-center h-5 min-h-5 w-[90px] px-2 py-1.5 rounded-md",children:[i.jsxs("svg",{"aria-hidden":"true",className:"inline w-4 h-4 text-gray-200 animate-spin dark:text-gray-600 fill-[#67FFBD]",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),i.jsx("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]}),i.jsx("span",{className:"sr-only",children:"Loading..."})]}):i.jsx("div",{onClick:()=>{re(Y==null?void 0:Y.wallet_id,Y==null?void 0:Y.wallet_name)},className:"w-[70px] sm:w-[91px] h-[26px] px-2 py-1.5 rounded-md border border-[#353535] justify-center items-center gap-2 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-white text-[11px] font-semibold font-manrope leading-[8px] tracking-tight",children:"Delete"})})]})},ie)}))})]}):""}),N&&i.jsxs("div",{className:"mt-2 w-full min-h-10 p-3 bg-[#ff7171]/20 rounded-xl shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] flex justify-start items-center gap-2.5 max-w-[480px]",children:[i.jsx("img",{src:ec,alt:"Dextrabot"}),i.jsx("p",{className:"text-[#ff7171] text-[13px] font-normal font-['Inter'] leading-4",children:N})]}),I&&i.jsxs("div",{className:"mt-2 w-full min-h-10 p-3 bg-[#67ffbd]/20 rounded-xl shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] flex justify-start items-center gap-2.5 max-w-[480px]",children:[i.jsx("img",{src:tae,alt:"Dextrabot",className:"w-4 h-4"}),i.jsx("p",{className:"text-[#67FFBD] text-[13px] font-normal font-['Inter'] leading-4",children:I})]})]})},F6t=({handleListRequest:e,isExtendedInfoValue:t,handleExtendedWalletInfo:n})=>{var he;const r="https://dextrabothypev2.nftinit.io",{setSignModalOpen:s}=m.useContext(Qr),[a,o]=m.useState(""),[l,c]=m.useState(""),[u,d]=m.useState(""),[f,x]=m.useState(""),[g,v]=m.useState(""),[w,C]=m.useState(""),[N,P]=m.useState(!1),[I,R]=m.useState(!1),[F,U]=m.useState(!1),[L,z]=m.useState(!1),[Q,ne]=m.useState(!1),[J,X]=m.useState(""),[re,pe]=m.useState(""),[Y,ie]=m.useState(!0),[oe,G]=m.useState({}),V=ge=>/^\d*$/.test(ge),ee=ge=>{["e","E","+","-"].includes(ge.key)&&ge.preventDefault()},ae=a.trim()!==""&&l.trim()!==""&&u.trim()!==""&&f.trim()!==""&&g.trim()!==""&&w.trim()!=="",fe=async()=>{if(!ae){X("Please fill in all fields.");return}try{ne(!0),X(""),pe("");const ge=window.localStorage.getItem("hyperToken"),ye=window.localStorage.getItem("hyperAddress");if(!ge||!ye){s(!0),ne(!1);return}const ve={address:ye.toLowerCase(),token:ge,wallet_name:a,main_wallet:l,api_key:f,stark_public:u,stark_private:g,vault_number:w},Ie=await(await fetch(`${r}/api/wallet/generate-extended`,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(ve)})).json();Ie!=null&&Ie.success?(rn.success("Wallet created successfully.",{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(103, 255, 189, 0.16)",width:"280px",minWidth:"280px",height:"40px",backdropFilter:"blur(16px)"},iconTheme:{primary:"#67FFBD",secondary:"#276047"}}),e(),n(ye),o(""),c(""),d(""),x(""),v(""),C(""),X(""),pe(Ie==null?void 0:Ie.message)):X((Ie==null?void 0:Ie.error_message)||"An error has occurred.")}catch(ge){X(ge.message||"An error has occurred.")}finally{ne(!1)}},Ne=async(ge,ye)=>{console.log("id :>> ",ge);const ve=`${ge}_${ye}`;try{G(it=>({...it,[ve]:!0})),X(""),pe("");const je=window.localStorage.getItem("hyperToken"),Ie=window.localStorage.getItem("hyperAddress");if(!je||!Ie){s(!0),G(it=>({...it,[ve]:!1}));return}const Le={address:Ie.toLowerCase(),token:je,wallet_id:Number(ge)},$e=await(await fetch(`${r}/api/wallet/delete-extended`,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(Le)})).json();$e!=null&&$e.success?(e(),rn.success("Wallet deleted successfully.",{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(103, 255, 189, 0.16)",width:"280px",minWidth:"280px",height:"40px",backdropFilter:"blur(16px)"},iconTheme:{primary:"#67FFBD",secondary:"#276047"}}),n(Ie),X(""),pe($e==null?void 0:$e.message)):X(($e==null?void 0:$e.error_message)||"An error has occurred.")}catch(je){X(je.message||"An error has occurred.")}finally{ne(!1)}};return i.jsxs("div",{className:"flex flex-col items-start gap-2 w-full relative",children:[Q&&i.jsx("div",{role:"status",className:"absolute top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 flex justify-center items-center w-full z-[60] -mt-20 h-full min-h-[450px] sm:min-h-[280px]",children:i.jsx(Da,{})}),i.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4 w-full",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"flex items-center justify-between",children:i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Wallet Name"})}),i.jsx("div",{className:"relative",children:i.jsx("input",{value:a,onChange:ge=>o(ge.target.value),autoComplete:"off",placeholder:"Wallet Name",type:"text",className:`w-full h-8 px-3 rounded-md bg-[#1b1b1b] text-white border text-[13px] outline-none placeholder:text-[#7F7F7F] ${a===""?"border-[#303030]":"border-[#303030] focus:border-[#67FFBD]"}`,disabled:Q})})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"flex items-center justify-between",children:i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Login Address"})}),i.jsx("div",{className:"relative",children:i.jsx("input",{value:l,onChange:ge=>c(ge.target.value),autoComplete:"off",placeholder:"Login Address",type:"text",className:`w-full h-8 px-3 rounded-md text-white bg-[#1b1b1b] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${l===""?"border-[#303030]":"border-[#303030] focus:border-[#67FFBD]"}`,disabled:Q})})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"flex items-center justify-between",children:i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"API Key"})}),i.jsxs("div",{className:"relative",children:[i.jsx("input",{value:f,onChange:ge=>x(ge.target.value),autoComplete:"off",placeholder:"API_KEY",type:N?"text":"password",className:`w-full h-8 px-3 rounded-md text-white bg-[#1b1b1b] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${f===""?"border-[#303030]":"border-[#303030] focus:border-[#67FFBD]"}`,disabled:Q}),i.jsx("button",{type:"button",onClick:()=>P(ge=>!ge),className:"absolute right-1 top-1/2 -translate-y-1/2 text-[11px] text-[#9B9B9B] hover:text-white h-6 flex justify-center items-center hover:border-none hover:ring-0 focus:outline-none focus:border-none bg-transparent",disabled:Q,children:N?i.jsx(la,{size:14}):i.jsx(ca,{size:14})})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"flex items-center justify-between",children:i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Stark Key Public"})}),i.jsxs("div",{className:"relative",children:[i.jsx("input",{value:u,onChange:ge=>d(ge.target.value),autoComplete:"off",placeholder:"STARK_KEY_PUBLIC",type:I?"text":"password",className:`w-full h-8 px-3 rounded-md text-white bg-[#1b1b1b] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${u===""?"border-[#303030]":"border-[#303030] focus:border-[#67FFBD]"}`,disabled:Q}),i.jsx("button",{type:"button",onClick:()=>R(ge=>!ge),className:"absolute right-1 top-1/2 -translate-y-1/2 text-[11px] text-[#9B9B9B] hover:text-white h-6 flex justify-center items-center hover:border-none hover:ring-0 focus:outline-none focus:border-none bg-transparent",disabled:Q,children:I?i.jsx(la,{size:14}):i.jsx(ca,{size:14})})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"flex items-center justify-between",children:i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Stark Key Private"})}),i.jsxs("div",{className:"relative",children:[i.jsx("input",{value:g,onChange:ge=>v(ge.target.value),autoComplete:"off",placeholder:"STARK_KEY_PRIVATE",type:F?"text":"password",className:`w-full h-8 pl-3 pr-16 rounded-md text-white bg-[#1b1b1b] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${g===""?"border-[#303030]":"border-[#303030] focus:border-[#67FFBD]"}`,disabled:Q}),i.jsx("button",{type:"button",onClick:()=>U(ge=>!ge),className:"absolute right-1 top-1/2 -translate-y-1/2 text-[11px] text-[#9B9B9B] hover:text-white h-6 flex justify-center items-center hover:border-none hover:ring-0 focus:outline-none focus:border-none bg-transparent",disabled:Q,children:F?i.jsx(la,{size:14}):i.jsx(ca,{size:14})})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Vault Number"}),i.jsxs("div",{className:"relative",children:[i.jsx("input",{value:w,onChange:ge=>{const ye=ge.target.value.trim();if(ye==="")return C("");V(ye)&&C(ye)},onKeyDown:ee,inputMode:"numeric",autoComplete:"off",type:L?"text":"password",placeholder:"VAULT_NUMBER",className:`w-full h-8 px-3 rounded-md text-white bg-[#1b1b1b] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${w===""?"border-[#303030]":"border-[#303030] focus:border-[#67FFBD]"}`,disabled:Q}),i.jsx("button",{type:"button",onClick:()=>z(ge=>!ge),className:"absolute right-1 top-1/2 -translate-y-1/2 text-[11px] text-[#9B9B9B] hover:text-white h-6 flex justify-center items-center hover:border-none hover:ring-0 focus:outline-none focus:border-none bg-transparent",disabled:Q,children:L?i.jsx(la,{size:14}):i.jsx(ca,{size:14})})]})]})]}),i.jsx("button",{onClick:()=>{!Q&&fe()},disabled:Q,className:"w-full h-10 pl-2 pr-3.5 py-3 bg-[#7445ff] rounded-xl shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-[#8860ff] focus:ring-0 focus:outline-none justify-center items-center gap-1.5 inline-flex mt-2.5",children:i.jsx("div",{className:"text-white text-[14px] font-medium font-inter leading-[8px]",children:"Generate"})}),i.jsx("div",{className:"w-full mt-2",children:(t==null?void 0:t.length)>0?i.jsxs("div",{className:"flex flex-col items-start gap-3 w-full ",children:[i.jsxs("div",{className:"flex justify-between items-center gap-2 cursor-pointer text-sm text-zinc-300 w-full",onClick:()=>ie(!Y),children:[i.jsx("span",{className:"text-white text-sm font-medium font-['Inter'] leading-normal",children:"Extended Wallets"}),i.jsx(sse,{className:`w-3.5 h-3.5 transition-transform text-white ${Y?"":"rotate-180"}`})]}),i.jsx("div",{className:"flex flex-col items-start gap-1 sm:gap-1.5 w-full max-h-[80px] overflow-y-auto",children:Y&&((he=[...t].sort((ge,ye)=>(ye==null?void 0:ye.wallet_created_data)-(ge==null?void 0:ge.wallet_created_data)))==null?void 0:he.map((ge,ye)=>{var ve,je;return i.jsx("div",{className:"flex flex-col items-start w-full",children:i.jsxs("div",{className:"flex justify-between items-center gap-2 w-full",children:[i.jsx("div",{className:"flex justify-start items-center gap-2",children:i.jsx("span",{className:"text-[#929292] text-[11px] font-normal min-w-[110px]",children:((ve=ge==null?void 0:ge.wallet_name)==null?void 0:ve.length)>18?((je=ge==null?void 0:ge.wallet_name)==null?void 0:je.slice(0,18))+"...":ge==null?void 0:ge.wallet_name})}),i.jsxs("div",{className:"flex justify-start items-center w-max",children:[i.jsx("span",{className:"text-[#929292] text-[11px] font-normal min-w-[75px]",children:(ge==null?void 0:ge.wallet_address.slice(0,6))+"..."+(ge==null?void 0:ge.wallet_address.slice(-4))}),i.jsx("img",{onClick:Ie=>{Ie.stopPropagation(),navigator.clipboard.writeText(ge==null?void 0:ge.wallet_address),rn.success("Successfully copied.",{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(103, 255, 189, 0.16)",width:"280px",minWidth:"280px",height:"40px",backdropFilter:"blur(16px)"},iconTheme:{primary:"#67FFBD",secondary:"#276047"}})},src:wo,alt:"",className:"cursor-pointer"})]}),i.jsx("span",{className:"text-[#929292] text-[11px] font-normal font-['Inter'] leading-4 min-w-max hidden sm:flex",children:su(ge==null?void 0:ge.wallet_created_data)}),oe[`${ge==null?void 0:ge.wallet_id}_${ge==null?void 0:ge.wallet_name.toLowerCase()}`]?i.jsxs("div",{role:"status",className:"flex justify-center items-center h-5 min-h-5 w-[90px] px-2 py-1.5 rounded-md",children:[i.jsxs("svg",{"aria-hidden":"true",className:"inline w-4 h-4 text-gray-200 animate-spin dark:text-gray-600 fill-[#67FFBD]",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),i.jsx("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]}),i.jsx("span",{className:"sr-only",children:"Loading..."})]}):i.jsx("div",{onClick:()=>{Ne(ge==null?void 0:ge.wallet_id,ge==null?void 0:ge.wallet_name)},className:"w-[70px] sm:w-[91px] h-[26px] px-2 py-1.5 rounded-md border border-[#353535] justify-center items-center gap-2 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-white text-[11px] font-semibold font-manrope leading-[8px] tracking-tight",children:"Delete"})})]})},ye)}))})]}):""}),J&&i.jsxs("div",{className:"mt-2 w-full min-h-10 p-3 bg-[#ff7171]/20 rounded-xl shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] flex justify-start items-center gap-2.5 max-w-[480px]",children:[i.jsx("img",{src:ec,alt:"Dextrabot"}),i.jsx("p",{className:"text-[#ff7171] text-[13px] font-normal font-['Inter'] leading-4",children:J})]}),re&&i.jsxs("div",{className:"mt-2 w-full min-h-10 p-3 bg-[#67ffbd]/20 rounded-xl shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] flex justify-start items-center gap-2.5 max-w-[480px]",children:[i.jsx("img",{src:tae,alt:"Dextrabot",className:"w-4 h-4"}),i.jsx("p",{className:"text-[#67FFBD] text-[13px] font-normal font-['Inter'] leading-4",children:re})]})]})},O6t=({className:e})=>i.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e,children:i.jsx("path",{d:"M10.5001 6.31166C10.3454 6.31166 10.197 6.37312 10.0876 6.48252C9.97821 6.59191 9.91675 6.74029 9.91675 6.895V11.0833C9.91675 11.238 9.85529 11.3864 9.74589 11.4958C9.6365 11.6052 9.48812 11.6667 9.33341 11.6667H2.91675C2.76204 11.6667 2.61367 11.6052 2.50427 11.4958C2.39487 11.3864 2.33341 11.238 2.33341 11.0833V4.66666C2.33341 4.51195 2.39487 4.36358 2.50427 4.25419C2.61367 4.14479 2.76204 4.08333 2.91675 4.08333H7.10508C7.25979 4.08333 7.40816 4.02187 7.51756 3.91248C7.62696 3.80308 7.68841 3.65471 7.68841 3.5C7.68841 3.34529 7.62696 3.19691 7.51756 3.08752C7.40816 2.97812 7.25979 2.91666 7.10508 2.91666H2.91675C2.45262 2.91666 2.0075 3.10104 1.67931 3.42923C1.35112 3.75742 1.16675 4.20254 1.16675 4.66666V11.0833C1.16675 11.5475 1.35112 11.9926 1.67931 12.3208C2.0075 12.649 2.45262 12.8333 2.91675 12.8333H9.33341C9.79754 12.8333 10.2427 12.649 10.5709 12.3208C10.899 11.9926 11.0834 11.5475 11.0834 11.0833V6.895C11.0834 6.74029 11.022 6.59191 10.9126 6.48252C10.8032 6.37312 10.6548 6.31166 10.5001 6.31166ZM12.7867 1.52833C12.7276 1.38579 12.6143 1.27252 12.4717 1.21333C12.4016 1.18344 12.3263 1.16759 12.2501 1.16666H8.75008C8.59537 1.16666 8.447 1.22812 8.3376 1.33752C8.22821 1.44691 8.16675 1.59529 8.16675 1.75C8.16675 1.90471 8.22821 2.05308 8.3376 2.16248C8.447 2.27187 8.59537 2.33333 8.75008 2.33333H10.8442L4.83591 8.33583C4.78124 8.39006 4.73784 8.45458 4.70823 8.52566C4.67861 8.59675 4.66337 8.67299 4.66337 8.75C4.66337 8.827 4.67861 8.90325 4.70823 8.97433C4.73784 9.04542 4.78124 9.10994 4.83591 9.16416C4.89014 9.21884 4.95466 9.26224 5.02574 9.29185C5.09683 9.32147 5.17307 9.33671 5.25008 9.33671C5.32709 9.33671 5.40333 9.32147 5.47442 9.29185C5.5455 9.26224 5.61002 9.21884 5.66425 9.16416L11.6667 3.15583V5.25C11.6667 5.40471 11.7282 5.55308 11.8376 5.66248C11.947 5.77187 12.0954 5.83333 12.2501 5.83333C12.4048 5.83333 12.5532 5.77187 12.6626 5.66248C12.772 5.55308 12.8334 5.40471 12.8334 5.25V1.75C12.8325 1.67377 12.8166 1.59846 12.7867 1.52833Z",fill:"currentColor"})}),M6t=({errorConnectMessage:e,setErrorConnectMessage:t,loadingConnect:n,setLoadingConnect:r,handleListRequest:s,handlePageChange:a,isBalanceValue:o,isBalanceLoading:l,isAgentInfoLoading:c,isAgentInfoValue:u,handleAgentWalletInfo:d,isBuilderFeeLoading:f,isBuilderFeeValue:x,refreshAgent:g,handleBuilderFeeInfo:v,isLighterInfoValue:w,handleLighterWalletInfo:C,isExtendedInfoValue:N,handleExtendedWalletInfo:P})=>{var fe,Ne;const{setSignModalOpen:I}=m.useContext(Qr),{address:R}=ns(),F=oc(),[U,L]=m.useState(!0),[z,Q]=m.useState(!1),[ne,J]=m.useState(!1),[X,re]=m.useState("HYPERLIQUID");m.useEffect(()=>{const he=F.hash,ge=localStorage.getItem("isWalletSelectMenu");if(he){const ye=he.split("#").filter(Boolean);ye[2]&&re(ye[2].toUpperCase()),ge==="LIGHTER"?re("LIGHTER"):ge==="EXTENDED"?re("EXTENDED"):ge==="HYPER"&&re("HYPERLIQUID")}},[F.hash]),m.useEffect(()=>{(async()=>{var ve;const ge=window.localStorage.getItem("hyperToken"),ye=(ve=R||window.localStorage.getItem("hyperAddress"))==null?void 0:ve.toLowerCase();if(!ge){I(!0);return}if(ye&&ge)try{const je=await Ei(ye,ge);Q(!!(je!=null&&je.is_generated))}catch{Q(!1)}finally{J(!0)}})()},[R,I]);const pe=he=>{var Ie,Le,Qe,$e,it,tt;const ge=(he==null?void 0:he.code)||((Ie=he==null?void 0:he.error)==null?void 0:Ie.code)||((Qe=(Le=he==null?void 0:he.info)==null?void 0:Le.error)==null?void 0:Qe.code)||(($e=he==null?void 0:he.cause)==null?void 0:$e.code)||"",ye=typeof ge=="string"?ge.toUpperCase():String(ge).toUpperCase(),ve=String((he==null?void 0:he.message)||"").toUpperCase();if(ye==="ACTION_REJECTED"||ye==="4001"||ve.includes("USER REJECT")||ve.includes("USER DENIED")){t("Request cancelled by user.");return}if([typeof he=="string"?he:"",he==null?void 0:he.message,he==null?void 0:he.code,he==null?void 0:he.name,he==null?void 0:he.shortMessage,(it=he==null?void 0:he.cause)==null?void 0:it.message,(tt=he==null?void 0:he.cause)==null?void 0:tt.code].filter(Boolean).join(" ").toUpperCase().includes("UNSUPPORTED_OPERATION")){t(i.jsxs(i.Fragment,{children:[i.jsx("b",{children:"Wallet Extension Conflict Detected"})," — It looks like you are using multiple wallet extensions at the same time, which is causing a conflict."," ",i.jsx("a",{href:"https://docs.dextrabot.com/errors/wallet-extension-conflict-fix",target:"_blank",rel:"noreferrer",className:"underline",children:"Read Guide"})]}));return}t(typeof he=="string"?he:(he==null?void 0:he.message)||"Something went wrong.")},Y=()=>{if(!window.ethereum)throw new Error("MetaMask not found.");return window.ethereum.request({method:"wallet_switchEthereumChain",params:[{chainId:"0xa4b1"}]})},ie=async he=>{var ve,je;if(z)return;const ge=window.localStorage.getItem("hyperToken");if(!ge||!R){I(!0);return}r(!0),t("");const ye=window.localStorage.getItem("hyperAddress");try{await window.ethereum.request({method:"eth_chainId"})!=="0xa4b1"&&await Y();const Qe=await(await fetch("https://dextrabothypev2.nftinit.io/api/wallet/generate-agent",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:R?R.toLowerCase():ye,token:ge})})).json();if(!(Qe!=null&&Qe.success)){pe((Qe==null?void 0:Qe.error_message)||"Agent could not be produced.");return}if(!window.ethereum)throw new Error("MetaMask not found.");const it=await new jM(window.ethereum).getSigner(),tt=await mxe(he,Qe,it),ft=await(await fetch("https://dextrabothypev2.nftinit.io/api/wallet/complete-agent",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({signature:tt.signature,action:tt.action,nonce:tt.nonce,address:R?R.toLowerCase():ye,token:ge})})).json();if(ft!=null&&ft.success){if(((ve=ft==null?void 0:ft.result)==null?void 0:ve.status)==="err"){pe(((je=ft==null?void 0:ft.result)==null?void 0:je.response)||"Approval failed."),r(!1);return}s(),a(1),d(R||ye)}else pe((ft==null?void 0:ft.error_message)||"Approval failed.")}catch(Ie){pe(Ie)}finally{r(!1)}},oe=async he=>{var ve,je;if(z)return;const ge=window.localStorage.getItem("hyperToken");if(!ge||!R){I(!0);return}r(!0),t("");const ye=window.localStorage.getItem("hyperAddress");try{await window.ethereum.request({method:"eth_chainId"})!=="0xa4b1"&&await Y();const Qe=await(await fetch("https://dextrabothypev2.nftinit.io/api/wallet/generate-agent",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:R?R.toLowerCase():ye,token:ge})})).json();if(!(Qe!=null&&Qe.success))throw new Error((Qe==null?void 0:Qe.error_message)||"Generate builder fee failed");if(!window.ethereum)throw new Error("MetaMask not found.");const it=await new jM(window.ethereum).getSigner(),tt=await mxe(he,Qe,it),ft=await(await fetch("https://dextrabothypev2.nftinit.io/api/wallet/complete-builder",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({signature:tt.signature,action:tt.action,nonce:tt.nonce,address:R?R.toLowerCase():ye,token:ge})})).json();if(ft!=null&&ft.success){if(((ve=ft==null?void 0:ft.result)==null?void 0:ve.status)==="err"){pe(((je=ft==null?void 0:ft.result)==null?void 0:je.response)||"Approve builder fee failed"),r(!1);return}ie(1),v(R||ye)}else pe((ft==null?void 0:ft.error_message)||"Approval failed."),r(!1)}catch(Ie){pe(Ie),r(!1)}},G=m.useMemo(()=>u?u.some(he=>{var ge;return((ge=(he==null?void 0:he.name)??"")==null?void 0:ge.trim().toLowerCase())==="dextrabot"}):!1,[u]),V=Number(((fe=o==null?void 0:o.marginSummary)==null?void 0:fe.accountValue)??0),ee=`You can’t create an API Wallet while logged in with a Dextrabot-generated wallet.
How To Login: Log in with a non Dextrabot-generated wallet and try again.`,ae=n||c||l||f||!ne&&R;return i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"w-full",children:i.jsxs("div",{className:"flex flex-col items-start justify-center sm:flex-row sm:justify-between sm:items-center w-full gap-2",children:[i.jsxs("div",{className:"flex justify-start items-center gap-1.5 w-max h-max rounded-lg border border-[#333333] p-1",children:[i.jsx(tV,{title:"HYPERLIQUID",set_click:()=>re("HYPERLIQUID"),isSelectAPIMenu:X}),i.jsx(tV,{title:"LIGHTER",set_click:()=>re("LIGHTER"),isSelectAPIMenu:X}),i.jsx(tV,{title:"EXTENDED",set_click:()=>re("EXTENDED"),isSelectAPIMenu:X})]}),X==="EXTENDED"&&i.jsxs("button",{onClick:()=>window.open("https://app.extended.exchange/join/DEXTRABOT","_blank"),className:" group px-3 py-1.5 rounded-full border border-[#3ec78c] text-[#3ec78c] text-sm font-medium flex items-center gap-2 transition-all duration-200 hover:bg-[#3ec78c]/15 hover:border-[#3ec78c]/80 active:scale-95",children:[i.jsx("span",{children:"Go To API Page"}),i.jsx(O6t,{className:"w-4 h-4"})]})]})}),ae?i.jsx("div",{role:"status",className:"flex justify-center items-center w-full my-[30px]",children:i.jsx(Da,{})}):X==="HYPERLIQUID"?i.jsxs("div",{className:"flex flex-col items-center justify-start gap-[24px] w-full",children:[i.jsxs("div",{className:"flex flex-col items-start gap-2 -mt-[8px] w-full",children:[i.jsx("label",{htmlFor:"address",className:"text-center justify-start text-white text-sm font-medium font-['Inter']",children:"Connected Wallet"}),i.jsxs("div",{id:"address",className:"min-h-10 px-2.5 py-3 rounded-xl shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] outline outline-1 outline-offset-[-1px] outline-[#2a2a2a] gap-2 flex justify-start items-center w-full text-white text-sm font-medium font-['Inter'] leading-[16px] break-all",children:[R&&i.jsx("img",{src:Kme,alt:"agent icon"}),R||"--"]}),!z&&i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"flex justify-start items-center gap-4 w-full mt-2",children:i.jsxs("div",{className:"flex flex-col items-start gap-1.5 text-[#929292] text-[13px] font-normal font-['Inter'] leading-4 w-full",children:[i.jsxs("div",{className:"flex justify-between items-center w-full",children:[i.jsx("span",{className:"text-[#929292]",children:"USDC Available "}),i.jsxs("div",{className:"flex justify-center items-center gap-4",children:[i.jsx("div",{onClick:()=>{g()},className:"flex justify-center items-center cursor-pointer",children:i.jsx(jS,{className:"w-4 h-4 text-[#929292] hover:text-white"})}),i.jsx("span",{className:`${V>=5?"text-[#1DE674]":"text-[#929292]"} `,children:V===0||V?"$"+Er(V):"--"})]})]}),(V===0&&!G||V<5&&!G)&&i.jsxs("div",{className:"flex justify-between items-center w-full",children:[i.jsx("span",{className:"text-text-[#929292]",children:"Min. Deposit"}),i.jsx("span",{className:"text-[#929292]",children:"5 USDC"})]})]})}),i.jsx("div",{className:"w-full flex justify-center items-center mt-2",children:x!=null&&Number(x)>0?G?i.jsxs("div",{className:"px-3 py-2.5 bg-[#1de674]/20 rounded-xl shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] flex justify-start items-center gap-2.5 w-full max-w-[480px] text-[#1DE674] text-[13px] font-normal font-['Inter'] leading-4",children:[i.jsx("img",{src:Kme,alt:"agent icon"}),"You’re ready to trade!"]}):"":V>0?V>=5?"":i.jsxs("div",{className:"px-3 py-2.5 bg-[#ffb14b]/20 rounded-xl shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] flex justify-start items-center gap-2.5 w-full max-w-[480px] text-[#FFB14B] text-[13px] font-normal font-['Inter'] leading-4",children:[i.jsx(IM,{className:"text-[#FFB14B] w-[18px] h-[18px] min-w-[18px] min-h-[18px]"}),"Your Hyperliquid perps balance is $",Er(V)," USDC. A minimum of 5 USDC is required."]}):i.jsxs("div",{className:"px-3 py-2.5 bg-[#ffb14b]/20 rounded-xl shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] flex justify-start items-center gap-2.5 w-full max-w-[480px] text-[#FFB14B] text-[13px] font-normal font-['Inter'] leading-4",children:[i.jsx(IM,{className:"text-[#FFB14B] w-[18px] h-[18px] min-w-[18px] min-h-[18px]"}),"Please fund your Hyperliquid Perpetual balance to start trading"]})})]})]}),z?i.jsxs("div",{className:"-mt-2.5 w-full p-3 bg-[#ff7171]/20 rounded-xl shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] max-w-[480px] flex justify-start items-center gap-2.5",children:[i.jsx("img",{src:ec,alt:"Dextrabot"}),i.jsx("p",{className:"whitespace-pre-line text-[#ff7171] text-[13px] font-normal font-['Inter'] leading-4",children:ee})]}):i.jsxs(i.Fragment,{children:[x!=null&&Number(x)>0?G?"":i.jsx("div",{onClick:()=>{ie(1)},className:`${!n&&!c&&!f?"cursor-pointer bg-[#7445ff] border border-[#8860ff] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)]":"bg-[#6B7280] text-[#D1D5DB] cursor-auto"} w-full h-10 px-6 py-3 rounded-xl inline-flex justify-center items-center gap-2.5 text-white text-sm font-semibold font-['Inter'] leading-[8px] -mt-4`,children:i.jsx("div",{className:"text-white text-[14px] font-medium font-inter leading-[8px]",children:"Enable Trading"})}):i.jsx("div",{onClick:he=>{he.preventDefault(),V>=5&&!l&&oe(2)},className:`${V>=5&&!l?"cursor-pointer bg-[#7445ff] border border-[#8860ff] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)]":"bg-[#6B7280] text-[#D1D5DB] cursor-auto"} w-full h-10 px-6 py-3 rounded-xl inline-flex justify-center items-center gap-2.5 text-white text-sm font-semibold font-['Inter'] leading-[8px] -mt-4`,children:i.jsx("div",{className:"text-white text-[14px] font-medium font-inter leading-[8px]",children:"Enable Trading"})}),i.jsx("div",{className:"w-full",children:(u==null?void 0:u.length)>0?i.jsxs("div",{className:"flex flex-col items-start gap-3 w-full ",children:[i.jsxs("div",{className:"flex justify-between items-center gap-2 cursor-pointer text-sm text-zinc-300 w-full",onClick:()=>L(!U),children:[i.jsx("span",{className:"text-white text-sm font-medium font-['Inter'] leading-normal",children:"API Wallets"}),i.jsx(sse,{className:`w-3.5 h-3.5 transition-transform text-white ${U?"":"rotate-180"}`})]}),i.jsx("div",{className:"flex flex-col items-start gap-1 sm:gap-1.5 w-full max-h-[80px] overflow-y-auto",children:U&&((Ne=[...u].sort((he,ge)=>(ge==null?void 0:ge.validUntil)-(he==null?void 0:he.validUntil)))==null?void 0:Ne.map((he,ge)=>i.jsx("div",{className:"flex flex-col items-start w-full",children:i.jsxs("div",{className:"flex justify-between items-center gap-2 w-full",children:[i.jsx("div",{className:"flex justify-start items-center gap-2 sm:gap-6",children:i.jsx("span",{className:`${(he==null?void 0:he.name)==="dextrabot"?"text-white":"text-[#929292]"} text-[11px] font-normal min-w-[110px]`,children:he==null?void 0:he.name})}),i.jsxs("span",{className:`${(he==null?void 0:he.name)==="dextrabot"?"text-white":"text-[#929292]"} text-[11px] font-normal font-['Inter'] leading-4 min-w-max`,children:["Valid until:"," ",Zlt(he==null?void 0:he.validUntil)]})]})},ge)))})]}):""}),e&&i.jsxs("div",{className:"-mt-2.5 w-full h-10 p-3 bg-[#ff7171]/20 rounded-xl shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] max-w-[480px] flex justify-start items-center gap-2.5",children:[i.jsx("img",{src:ec,alt:"Dextrabot"}),i.jsx("p",{className:"text-[#ff7171] text-[13px] font-normal font-['Inter'] leading-4",children:e})]})]})]}):X==="LIGHTER"?i.jsx("div",{className:"flex items-center justify-start w-full",children:i.jsx(P6t,{handleListRequest:s,isLighterInfoValue:w,handleLighterWalletInfo:C})}):i.jsx("div",{className:"flex items-center justify-start w-full",children:i.jsx(F6t,{handleListRequest:s,isExtendedInfoValue:N,handleExtendedWalletInfo:P})})]})},tV=({title:e,set_click:t,isSelectAPIMenu:n})=>i.jsx("div",{onClick:t,className:`${n==e?"bg-[#67ffbd]/20 text-[#67FFBD]":"bg-transparent text-[#9b9b9b]"} text-[13px] font-medium font-manrope leading-[8px] cursor-pointer flex justify-center items-center min-w-max rounded-md px-[6px] sm:px-[10px] h-[22px]`,children:e}),bxe=({className:e})=>i.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",className:e,children:[i.jsx("path",{d:"M3.75 11.25C3.045 11.25 2.3925 11.4975 1.875 11.91C1.185 12.4575 0.75 13.305 0.75 14.25C0.75 15.9075 2.0925 17.25 3.75 17.25C4.5075 17.25 5.1975 16.965 5.73 16.5C6.3525 15.9525 6.75 15.15 6.75 14.25C6.75 12.5925 5.4075 11.25 3.75 11.25ZM4.5 14.4375C4.5 14.6325 4.395 14.82 4.23 14.9175L3.2925 15.48C3.2025 15.54 3.0975 15.5625 3 15.5625C2.8125 15.5625 2.625 15.465 2.52 15.2925C2.3625 15.0225 2.445 14.6775 2.715 14.52L3.3825 14.1225V13.3125C3.375 13.005 3.63 12.75 3.9375 12.75C4.245 12.75 4.5 13.005 4.5 13.3125V14.4375Z",fill:"currentColor"}),i.jsx("path",{d:"M11.1375 2.96251V5.81251H10.0125V2.96251C10.0125 2.76001 9.8325 2.66251 9.7125 2.66251C9.675 2.66251 9.6375 2.67001 9.6 2.68501L3.6525 4.92751C3.255 5.07751 3 5.45251 3 5.88001V6.38251C2.3175 6.89251 1.875 7.71001 1.875 8.63251V5.88001C1.875 4.98751 2.4225 4.19251 3.255 3.87751L9.21 1.62751C9.375 1.56751 9.5475 1.53751 9.7125 1.53751C10.4625 1.53751 11.1375 2.14501 11.1375 2.96251Z",fill:"currentColor"}),i.jsx("path",{d:"M16.1245 10.875V11.625C16.1245 11.8275 15.967 11.9925 15.757 12H14.662C14.2645 12 13.9045 11.7075 13.8745 11.3175C13.852 11.085 13.942 10.8675 14.092 10.7175C14.227 10.575 14.4145 10.5 14.617 10.5H15.7495C15.967 10.5075 16.1245 10.6725 16.1245 10.875Z",fill:"currentColor"}),i.jsx("path",{d:"M14.61 9.7125H15.375C15.7875 9.7125 16.125 9.375 16.125 8.9625V8.6325C16.125 7.08 14.8575 5.8125 13.305 5.8125H4.695C4.0575 5.8125 3.4725 6.0225 3 6.3825C2.3175 6.8925 1.875 7.71 1.875 8.6325V9.9675C1.875 10.2525 2.175 10.4325 2.445 10.3425C2.865 10.2 3.3075 10.125 3.75 10.125C6.0225 10.125 7.875 11.9775 7.875 14.25C7.875 14.79 7.7325 15.3825 7.5075 15.9075C7.3875 16.1775 7.575 16.5 7.8675 16.5H13.305C14.8575 16.5 16.125 15.2325 16.125 13.68V13.5375C16.125 13.125 15.7875 12.7875 15.375 12.7875H14.7225C14.0025 12.7875 13.3125 12.345 13.125 11.6475C12.975 11.0775 13.155 10.5225 13.53 10.1625C13.8075 9.8775 14.19 9.7125 14.61 9.7125ZM10.5 9.5625H6.75C6.4425 9.5625 6.1875 9.3075 6.1875 9C6.1875 8.6925 6.4425 8.4375 6.75 8.4375H10.5C10.8075 8.4375 11.0625 8.6925 11.0625 9C11.0625 9.3075 10.8075 9.5625 10.5 9.5625Z",fill:"currentColor"})]});function f5({open:e,setOpen:t,handleListRequest:n,handlePageChange:r}){const{isConnected:s,address:a}=ns(),{hyperToken:o}=m.useContext(Qr);oc();const[l,c]=m.useState([]),[u,d]=m.useState(""),[f,x]=m.useState(!1),[g,v]=m.useState(""),[w,C]=m.useState(!1),[N,P]=m.useState(!1),[I,R]=m.useState(!1),[F,U]=m.useState("account"),[L,z]=m.useState(!1),Q=m.useRef(null),[ne,J]=m.useState([]),[X,re]=m.useState(""),[pe,Y]=m.useState(""),[ie,oe]=m.useState(!1),[G,V]=m.useState(""),[ee,ae]=m.useState(""),[fe,Ne]=m.useState(""),[he,ge]=m.useState(!1),[ye,ve]=m.useState(!1),[je,Ie]=m.useState(null),[Le,Qe]=m.useState(!1),[$e,it]=m.useState([]),[tt,lt]=m.useState([]),[ft,ut]=m.useState([]),[qt,It]=m.useState(!1),[nn,jt]=m.useState(null),cn=[{id:"account",name:"Add API Wallet",href:"#account",icon:bxe},{id:"generate",name:"Generate HL Wallet",href:"#generate",icon:bxe}];function un(...ht){return ht.filter(Boolean).join(" ")}const Ft=async(ht,Zt)=>{try{Zt===1&&ve(!0);const zt=await fetch("https://api-ui.hyperliquid.xyz/info",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"clearinghouseState",user:ht})});if(!zt.ok)throw new Error("Network response was not ok");const Et=await zt.json();Et&&(Ie(Et),ve(!1))}catch(zt){console.error("Error fetching user balance info:",zt),ve(!1)}},Ke=async ht=>{try{Qe(!0);const Zt=await fetch("https://api-ui.hyperliquid.xyz/info",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"extraAgents",user:ht})});if(!Zt.ok)throw new Error("Network response was not ok");const zt=await Zt.json();zt&&(it(zt),Qe(!1))}catch(Zt){console.error("Error fetching user balance info:",Zt),Qe(!1)}},Bt=async ht=>{const Zt=window.localStorage.getItem("hyperToken"),zt=window.localStorage.getItem("hyperAddress");if(!(!Zt||!ht))try{const Et=await fetch("https://dextrabothypev2.nftinit.io/api/wallet/list-lighter",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:ht?ht.toLowerCase():zt,token:Zt})});if(!Et.ok)throw new Error("Network response was not ok");const nt=await Et.json();nt.success&<((nt==null?void 0:nt.data)||[])}catch(Et){console.error("Error fetching user balance info:",Et)}},$t=async ht=>{const Zt=window.localStorage.getItem("hyperToken"),zt=window.localStorage.getItem("hyperAddress");if(!(!Zt||!ht))try{const Et=await fetch("https://dextrabothypev2.nftinit.io/api/wallet/list-extended",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:ht?ht.toLowerCase():zt,token:Zt})});if(!Et.ok)throw new Error("Network response was not ok");const nt=await Et.json();nt.success&&ut((nt==null?void 0:nt.data)||[])}catch(Et){console.error("Error fetching user balance info:",Et)}},qe=async ht=>{try{It(!0);const Zt=await fetch("https://api-ui.hyperliquid.xyz/info",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"maxBuilderFee",user:ht,builder:"0x49ae63056b3a0be0b166813ee687309ab653c07c"})});if(!Zt.ok)throw new Error("Network response was not ok");const zt=await Zt.text(),Et=parseInt(zt,10);jt(Et),It(!1)}catch(Zt){console.error("Error fetching user balance info:",Zt),It(!1)}};m.useEffect(()=>{window.localStorage.getItem("hyperToken")&&a&&e&&(Ft(a,1),Ke(a),Bt(a),$t(a),qe(a))},[e]),m.useEffect(()=>{var zt;return!e||F!="account"||($e==null?void 0:$e.some(Et=>((Et==null?void 0:Et.name)??"").trim().toLowerCase()==="dextrabot"))?void 0:(Number(((zt=je==null?void 0:je.marginSummary)==null?void 0:zt.accountValue)??0)<5?Q.current||(Q.current=setInterval(()=>{Ft(a,2)},1e4)):Q.current&&(clearInterval(Q.current),Q.current=null),()=>{Q.current&&(clearInterval(Q.current),Q.current=null)})},[je,e,F,a]),m.useEffect(()=>{const ht=window.localStorage.getItem("hyperToken");(!a||!s||!ht)&&(t(!1),d(""),v(""),Ne(""))},[a,s,o]);const Ye=()=>{window.localStorage.getItem("hyperToken")&&a&&e?(Ft(a,1),Ke(a),qe(a)):rn.error("Please connect wallet")};return m.useEffect(()=>{if(e&&!L)if(($e==null?void 0:$e.length)>0){const ht=$e==null?void 0:$e.some(zt=>((zt==null?void 0:zt.name)??"").trim().toLowerCase()==="dextrabot"),Zt=localStorage.getItem("isWalletSelectMenu");U(Zt==="LIGHTER"||Zt==="EXTENDED"?"account":Zt==="HYPER"?ht?"generate":"account":ht&&(tt==null?void 0:tt.length)>0&&(ft==null?void 0:ft.length)>0?"generate":"account"),z(!0)}else U("account"),z(!0)},[$e,L]),i.jsxs(i.Fragment,{children:[i.jsx(Uyt,{open:I,setOpen:R,setGenModalOpen:t,setGenWalletSuccess:P,setGenWalletData:c,setShowPrivateKey:C}),i.jsxs(Ea,{open:e,onClose:()=>{},className:"relative z-[9999999998] font-manrope",children:[i.jsx(ja,{transition:!0,style:{backgroundColor:"rgba(0, 0, 0, 0.48)"},className:"fixed inset-0 transition-opacity data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in"}),i.jsx("div",{className:"fixed inset-0 z-[9999999998] w-screen overflow-y-auto",children:i.jsx("div",{className:"flex min-h-full justify-center p-4 text-center items-center sm:p-0",children:i.jsx(xa,{transition:!0,style:{boxShadow:"0 4px 24px 0 #000",backdropFilter:"blur(16px)"},className:"relative transform overflow-hidden bg-[rgba(16,16,16,0.64)] border border-[rgba(46,46,46,0.32)] text-left shadow-xl transition-all data-[closed]:translate-y-4 data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in data-[closed]:sm:translate-y-0 data-[closed]:sm:scale-95 rounded-3xl",children:i.jsx("div",{className:`${N&&Object.keys(l).length>0?"w-max":"w-[400px]"} flex flex-col justify-start items-center gap-[26px] h-max relative bg-[#0f0f0f]/60 rounded-3xl pt-[29px] pb-[24px] px-[26px] w-full min-w-[320px]`,children:i.jsxs(i.Fragment,{children:[i.jsx("div",{onClick:ht=>{ht.preventDefault(),f&&F==="generate"||F==="account"&&he?rn.success(i.jsx(i.Fragment,{children:i.jsx("span",{style:{color:"#ff797c",paddingLeft:"5px"},children:"Please wait until completion."})}),{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(255, 121, 124, 0.32)",width:"300px",minWidth:"300px",height:"40px",backdropFilter:"blur(48px)"},iconTheme:{primary:"#ff797c",secondary:"#7d3031"}}):F==="generate"&&N&&Object.keys(l).length>0?(R(!0),C(!1)):(t(!1),d(""),v(""),Ne(""),it([]),jt(null),z(!1))},className:"cursor-pointer flex w-full items-center justify-end absolute right-2 top-3.5",children:i.jsx("span",{className:"absolute top-2 right-2 w-9 h-9 rounded-full p-1 flex justify-center items-center hover:bg-[#7535FE]",children:i.jsx("img",{className:"p-1",src:Ba})})}),i.jsx("div",{className:"flex justify-start text-white text-base font-medium font-manrope w-full",children:"Generate your wallet"}),i.jsxs("div",{className:"flex justify-start items-center w-full",children:[i.jsxs("div",{className:"grid grid-cols-1 sm:hidden w-full",children:[i.jsx("select",{value:F,onChange:ht=>{const Zt=ht.target.value;if(!f){if(F==="generate"&&Zt!=="generate"&&N&&Object.keys(l).length>0){C(!1),R(!0);return}if(F==="account"&&Zt!=="account"&&he){rn.success(i.jsx(i.Fragment,{children:i.jsx("span",{style:{color:"#ff797c",paddingLeft:"5px"},children:"Please wait until completion."})}),{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(255, 121, 124, 0.32)",width:"300px",minWidth:"300px",height:"40px",backdropFilter:"blur(48px)"},iconTheme:{primary:"#ff797c",secondary:"#7d3031"}});return}U(Zt),d("")}},"aria-label":"Select a tab",className:"col-start-1 row-start-1 w-full appearance-none rounded-md bg-white py-2 pl-3 pr-8 text-base text-gray-900 outline outline-1 -outline-offset-1 outline-gray-300 focus:outline focus:outline-2 focus:-outline-offset-2 dark:bg-white/5 dark:text-gray-100 dark:outline-white/10 dark:*:bg-gray-800",children:cn==null?void 0:cn.map(ht=>i.jsx("option",{value:ht==null?void 0:ht.id,children:ht==null?void 0:ht.name},ht==null?void 0:ht.id))}),i.jsx(A9,{"aria-hidden":"true",className:"pointer-events-none col-start-1 row-start-1 mr-2 size-5 self-center justify-self-end fill-gray-500 dark:fill-gray-400"})]}),i.jsx("div",{style:{boxShadow:"0 2px 4px 0 rgba(0, 0, 0, 0.16)"},className:"hidden sm:flex w-full justify-center items-center border border-[#2A2A2A] rounded-2xl p-1 h-10",children:i.jsx("nav",{"aria-label":"Tabs",role:"tablist",className:"flex items-center space-x-8",children:cn==null?void 0:cn.map(ht=>{const Zt=(ht==null?void 0:ht.id)===F;return i.jsxs("a",{href:ht==null?void 0:ht.href,onClick:zt=>{zt.preventDefault();const Et=ht==null?void 0:ht.id;if(f)return;if(F==="generate"&&Et!=="generate"&&N&&Object.keys(l).length>0){C(!1),R(!0);return}if(F==="account"&&Et!=="account"&&he){rn.success(i.jsx(i.Fragment,{children:i.jsx("span",{style:{color:"#ff797c",paddingLeft:"5px"},children:"Please wait until completion."})}),{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(255, 121, 124, 0.32)",width:"300px",minWidth:"300px",height:"40px",backdropFilter:"blur(48px)"},iconTheme:{primary:"#ff797c",secondary:"#7d3031"}});return}U(Et);const nt=document.querySelector(ht.href);nt&&nt.scrollIntoView({behavior:"smooth",block:"start"}),d("")},"aria-current":Zt?"page":void 0,className:un(Zt?"bg-[#2e2e2e] rounded-xl shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] h-8 px-6 py-3 text-white":"text-[#878787]","group flex justify-center items-center px-1 py-4 text-[13px] font-medium tracking-[-0.13px] w-[220px] hover:text-white group"),children:[i.jsx(ht.icon,{"aria-hidden":"true",className:un(Zt?"text-white group-hover:text-white":"text-[#878787] group-hover:text-white","-ml-0.5 mr-2 size-[18px]")}),i.jsx("span",{children:ht==null?void 0:ht.name})]},ht==null?void 0:ht.id)})})})]}),F==="generate"?i.jsx(Hyt,{loading:f,genWalletSuccess:N,genWalletData:l,showPrivateKey:w,genWalletName:u,setGenWalletName:d,errorMessage:g,setShowPrivateKey:C,setErrorMessage:v,setLoading:x,setGenWalletData:c,setGenWalletSuccess:P,handleListRequest:n,handlePageChange:r}):F==="agent"?i.jsx(Vyt,{agentWalletData:ne,setAgentWalletData:J,agentWalletName:X,setAgentWalletName:re,errorAgentMessage:pe,setErrorAgentMessage:Y,loadingAgent:ie,setLoadingAgent:oe,handleListRequest:n,handlePageChange:r,agentWalletAddress:G,setAgentWalletAddress:V,agentWalletPkey:ee,setAgentWalletPkey:ae}):F==="account"?i.jsx(M6t,{errorConnectMessage:fe,setErrorConnectMessage:Ne,loadingConnect:he,setLoadingConnect:ge,handleListRequest:n,handlePageChange:r,isBalanceValue:je,isBalanceLoading:ye,isAgentInfoLoading:Le,isAgentInfoValue:$e,handleAgentWalletInfo:Ke,isBuilderFeeLoading:qt,isBuilderFeeValue:nn,refreshAgent:Ye,handleBuilderFeeInfo:qe,isLighterInfoValue:tt,handleLighterWalletInfo:Bt,isExtendedInfoValue:ft,handleExtendedWalletInfo:$t}):""]})})})})})]})]})}var nf="top",lp="bottom",cp="right",rf="left",Iae="auto",Gk=[nf,lp,cp,rf],GS="start",vE="end",R6t="clippingParents",VIe="viewport",A7="popper",L6t="reference",yxe=Gk.reduce(function(e,t){return e.concat([t+"-"+GS,t+"-"+vE])},[]),WIe=[].concat(Gk,[Iae]).reduce(function(e,t){return e.concat([t,t+"-"+GS,t+"-"+vE])},[]),D6t="beforeRead",B6t="read",$6t="afterRead",U6t="beforeMain",z6t="main",H6t="afterMain",V6t="beforeWrite",W6t="write",q6t="afterWrite",G6t=[D6t,B6t,$6t,U6t,z6t,H6t,V6t,W6t,q6t];function ex(e){return e?(e.nodeName||"").toLowerCase():null}function Gf(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function O3(e){var t=Gf(e).Element;return e instanceof t||e instanceof Element}function ep(e){var t=Gf(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function Pae(e){if(typeof ShadowRoot>"u")return!1;var t=Gf(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function K6t(e){var t=e.state;Object.keys(t.elements).forEach(function(n){var r=t.styles[n]||{},s=t.attributes[n]||{},a=t.elements[n];!ep(a)||!ex(a)||(Object.assign(a.style,r),Object.keys(s).forEach(function(o){var l=s[o];l===!1?a.removeAttribute(o):a.setAttribute(o,l===!0?"":l)}))})}function Y6t(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach(function(r){var s=t.elements[r],a=t.attributes[r]||{},o=Object.keys(t.styles.hasOwnProperty(r)?t.styles[r]:n[r]),l=o.reduce(function(c,u){return c[u]="",c},{});!ep(s)||!ex(s)||(Object.assign(s.style,l),Object.keys(a).forEach(function(c){s.removeAttribute(c)}))})}}const qIe={name:"applyStyles",enabled:!0,phase:"write",fn:K6t,effect:Y6t,requires:["computeStyles"]};function D0(e){return e.split("-")[0]}var Qw=Math.max,OM=Math.min,KS=Math.round;function see(){var e=navigator.userAgentData;return e!=null&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function GIe(){return!/^((?!chrome|android).)*safari/i.test(see())}function YS(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var r=e.getBoundingClientRect(),s=1,a=1;t&&ep(e)&&(s=e.offsetWidth>0&&KS(r.width)/e.offsetWidth||1,a=e.offsetHeight>0&&KS(r.height)/e.offsetHeight||1);var o=O3(e)?Gf(e):window,l=o.visualViewport,c=!GIe()&&n,u=(r.left+(c&&l?l.offsetLeft:0))/s,d=(r.top+(c&&l?l.offsetTop:0))/a,f=r.width/s,x=r.height/a;return{width:f,height:x,top:d,right:u+f,bottom:d+x,left:u,x:u,y:d}}function Fae(e){var t=YS(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function KIe(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&Pae(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function d1(e){return Gf(e).getComputedStyle(e)}function X6t(e){return["table","td","th"].indexOf(ex(e))>=0}function l2(e){return((O3(e)?e.ownerDocument:e.document)||window.document).documentElement}function GB(e){return ex(e)==="html"?e:e.assignedSlot||e.parentNode||(Pae(e)?e.host:null)||l2(e)}function vxe(e){return!ep(e)||d1(e).position==="fixed"?null:e.offsetParent}function Q6t(e){var t=/firefox/i.test(see()),n=/Trident/i.test(see());if(n&&ep(e)){var r=d1(e);if(r.position==="fixed")return null}var s=GB(e);for(Pae(s)&&(s=s.host);ep(s)&&["html","body"].indexOf(ex(s))<0;){var a=d1(s);if(a.transform!=="none"||a.perspective!=="none"||a.contain==="paint"||["transform","perspective"].indexOf(a.willChange)!==-1||t&&a.willChange==="filter"||t&&a.filter&&a.filter!=="none")return s;s=s.parentNode}return null}function Kk(e){for(var t=Gf(e),n=vxe(e);n&&X6t(n)&&d1(n).position==="static";)n=vxe(n);return n&&(ex(n)==="html"||ex(n)==="body"&&d1(n).position==="static")?t:n||Q6t(e)||t}function Oae(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function Gj(e,t,n){return Qw(e,OM(t,n))}function Z6t(e,t,n){var r=Gj(e,t,n);return r>n?n:r}function YIe(){return{top:0,right:0,bottom:0,left:0}}function XIe(e){return Object.assign({},YIe(),e)}function QIe(e,t){return t.reduce(function(n,r){return n[r]=e,n},{})}var J6t=function(t,n){return t=typeof t=="function"?t(Object.assign({},n.rects,{placement:n.placement})):t,XIe(typeof t!="number"?t:QIe(t,Gk))};function eCt(e){var t,n=e.state,r=e.name,s=e.options,a=n.elements.arrow,o=n.modifiersData.popperOffsets,l=D0(n.placement),c=Oae(l),u=[rf,cp].indexOf(l)>=0,d=u?"height":"width";if(!(!a||!o)){var f=J6t(s.padding,n),x=Fae(a),g=c==="y"?nf:rf,v=c==="y"?lp:cp,w=n.rects.reference[d]+n.rects.reference[c]-o[c]-n.rects.popper[d],C=o[c]-n.rects.reference[c],N=Kk(a),P=N?c==="y"?N.clientHeight||0:N.clientWidth||0:0,I=w/2-C/2,R=f[g],F=P-x[d]-f[v],U=P/2-x[d]/2+I,L=Gj(R,U,F),z=c;n.modifiersData[r]=(t={},t[z]=L,t.centerOffset=L-U,t)}}function tCt(e){var t=e.state,n=e.options,r=n.element,s=r===void 0?"[data-popper-arrow]":r;s!=null&&(typeof s=="string"&&(s=t.elements.popper.querySelector(s),!s)||KIe(t.elements.popper,s)&&(t.elements.arrow=s))}const nCt={name:"arrow",enabled:!0,phase:"main",fn:eCt,effect:tCt,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function XS(e){return e.split("-")[1]}var rCt={top:"auto",right:"auto",bottom:"auto",left:"auto"};function sCt(e,t){var n=e.x,r=e.y,s=t.devicePixelRatio||1;return{x:KS(n*s)/s||0,y:KS(r*s)/s||0}}function wxe(e){var t,n=e.popper,r=e.popperRect,s=e.placement,a=e.variation,o=e.offsets,l=e.position,c=e.gpuAcceleration,u=e.adaptive,d=e.roundOffsets,f=e.isFixed,x=o.x,g=x===void 0?0:x,v=o.y,w=v===void 0?0:v,C=typeof d=="function"?d({x:g,y:w}):{x:g,y:w};g=C.x,w=C.y;var N=o.hasOwnProperty("x"),P=o.hasOwnProperty("y"),I=rf,R=nf,F=window;if(u){var U=Kk(n),L="clientHeight",z="clientWidth";if(U===Gf(n)&&(U=l2(n),d1(U).position!=="static"&&l==="absolute"&&(L="scrollHeight",z="scrollWidth")),U=U,s===nf||(s===rf||s===cp)&&a===vE){R=lp;var Q=f&&U===F&&F.visualViewport?F.visualViewport.height:U[L];w-=Q-r.height,w*=c?1:-1}if(s===rf||(s===nf||s===lp)&&a===vE){I=cp;var ne=f&&U===F&&F.visualViewport?F.visualViewport.width:U[z];g-=ne-r.width,g*=c?1:-1}}var J=Object.assign({position:l},u&&rCt),X=d===!0?sCt({x:g,y:w},Gf(n)):{x:g,y:w};if(g=X.x,w=X.y,c){var re;return Object.assign({},J,(re={},re[R]=P?"0":"",re[I]=N?"0":"",re.transform=(F.devicePixelRatio||1)<=1?"translate("+g+"px, "+w+"px)":"translate3d("+g+"px, "+w+"px, 0)",re))}return Object.assign({},J,(t={},t[R]=P?w+"px":"",t[I]=N?g+"px":"",t.transform="",t))}function iCt(e){var t=e.state,n=e.options,r=n.gpuAcceleration,s=r===void 0?!0:r,a=n.adaptive,o=a===void 0?!0:a,l=n.roundOffsets,c=l===void 0?!0:l,u={placement:D0(t.placement),variation:XS(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:s,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,wxe(Object.assign({},u,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:o,roundOffsets:c})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,wxe(Object.assign({},u,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:c})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const aCt={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:iCt,data:{}};var aP={passive:!0};function oCt(e){var t=e.state,n=e.instance,r=e.options,s=r.scroll,a=s===void 0?!0:s,o=r.resize,l=o===void 0?!0:o,c=Gf(t.elements.popper),u=[].concat(t.scrollParents.reference,t.scrollParents.popper);return a&&u.forEach(function(d){d.addEventListener("scroll",n.update,aP)}),l&&c.addEventListener("resize",n.update,aP),function(){a&&u.forEach(function(d){d.removeEventListener("scroll",n.update,aP)}),l&&c.removeEventListener("resize",n.update,aP)}}const lCt={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:oCt,data:{}};var cCt={left:"right",right:"left",bottom:"top",top:"bottom"};function oO(e){return e.replace(/left|right|bottom|top/g,function(t){return cCt[t]})}var uCt={start:"end",end:"start"};function Cxe(e){return e.replace(/start|end/g,function(t){return uCt[t]})}function Mae(e){var t=Gf(e),n=t.pageXOffset,r=t.pageYOffset;return{scrollLeft:n,scrollTop:r}}function Rae(e){return YS(l2(e)).left+Mae(e).scrollLeft}function dCt(e,t){var n=Gf(e),r=l2(e),s=n.visualViewport,a=r.clientWidth,o=r.clientHeight,l=0,c=0;if(s){a=s.width,o=s.height;var u=GIe();(u||!u&&t==="fixed")&&(l=s.offsetLeft,c=s.offsetTop)}return{width:a,height:o,x:l+Rae(e),y:c}}function fCt(e){var t,n=l2(e),r=Mae(e),s=(t=e.ownerDocument)==null?void 0:t.body,a=Qw(n.scrollWidth,n.clientWidth,s?s.scrollWidth:0,s?s.clientWidth:0),o=Qw(n.scrollHeight,n.clientHeight,s?s.scrollHeight:0,s?s.clientHeight:0),l=-r.scrollLeft+Rae(e),c=-r.scrollTop;return d1(s||n).direction==="rtl"&&(l+=Qw(n.clientWidth,s?s.clientWidth:0)-a),{width:a,height:o,x:l,y:c}}function Lae(e){var t=d1(e),n=t.overflow,r=t.overflowX,s=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+s+r)}function ZIe(e){return["html","body","#document"].indexOf(ex(e))>=0?e.ownerDocument.body:ep(e)&&Lae(e)?e:ZIe(GB(e))}function Kj(e,t){var n;t===void 0&&(t=[]);var r=ZIe(e),s=r===((n=e.ownerDocument)==null?void 0:n.body),a=Gf(r),o=s?[a].concat(a.visualViewport||[],Lae(r)?r:[]):r,l=t.concat(o);return s?l:l.concat(Kj(GB(o)))}function iee(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function hCt(e,t){var n=YS(e,!1,t==="fixed");return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}function Sxe(e,t,n){return t===VIe?iee(dCt(e,n)):O3(t)?hCt(t,n):iee(fCt(l2(e)))}function pCt(e){var t=Kj(GB(e)),n=["absolute","fixed"].indexOf(d1(e).position)>=0,r=n&&ep(e)?Kk(e):e;return O3(r)?t.filter(function(s){return O3(s)&&KIe(s,r)&&ex(s)!=="body"}):[]}function mCt(e,t,n,r){var s=t==="clippingParents"?pCt(e):[].concat(t),a=[].concat(s,[n]),o=a[0],l=a.reduce(function(c,u){var d=Sxe(e,u,r);return c.top=Qw(d.top,c.top),c.right=OM(d.right,c.right),c.bottom=OM(d.bottom,c.bottom),c.left=Qw(d.left,c.left),c},Sxe(e,o,r));return l.width=l.right-l.left,l.height=l.bottom-l.top,l.x=l.left,l.y=l.top,l}function JIe(e){var t=e.reference,n=e.element,r=e.placement,s=r?D0(r):null,a=r?XS(r):null,o=t.x+t.width/2-n.width/2,l=t.y+t.height/2-n.height/2,c;switch(s){case nf:c={x:o,y:t.y-n.height};break;case lp:c={x:o,y:t.y+t.height};break;case cp:c={x:t.x+t.width,y:l};break;case rf:c={x:t.x-n.width,y:l};break;default:c={x:t.x,y:t.y}}var u=s?Oae(s):null;if(u!=null){var d=u==="y"?"height":"width";switch(a){case GS:c[u]=c[u]-(t[d]/2-n[d]/2);break;case vE:c[u]=c[u]+(t[d]/2-n[d]/2);break}}return c}function wE(e,t){t===void 0&&(t={});var n=t,r=n.placement,s=r===void 0?e.placement:r,a=n.strategy,o=a===void 0?e.strategy:a,l=n.boundary,c=l===void 0?R6t:l,u=n.rootBoundary,d=u===void 0?VIe:u,f=n.elementContext,x=f===void 0?A7:f,g=n.altBoundary,v=g===void 0?!1:g,w=n.padding,C=w===void 0?0:w,N=XIe(typeof C!="number"?C:QIe(C,Gk)),P=x===A7?L6t:A7,I=e.rects.popper,R=e.elements[v?P:x],F=mCt(O3(R)?R:R.contextElement||l2(e.elements.popper),c,d,o),U=YS(e.elements.reference),L=JIe({reference:U,element:I,strategy:"absolute",placement:s}),z=iee(Object.assign({},I,L)),Q=x===A7?z:U,ne={top:F.top-Q.top+N.top,bottom:Q.bottom-F.bottom+N.bottom,left:F.left-Q.left+N.left,right:Q.right-F.right+N.right},J=e.modifiersData.offset;if(x===A7&&J){var X=J[s];Object.keys(ne).forEach(function(re){var pe=[cp,lp].indexOf(re)>=0?1:-1,Y=[nf,lp].indexOf(re)>=0?"y":"x";ne[re]+=X[Y]*pe})}return ne}function xCt(e,t){t===void 0&&(t={});var n=t,r=n.placement,s=n.boundary,a=n.rootBoundary,o=n.padding,l=n.flipVariations,c=n.allowedAutoPlacements,u=c===void 0?WIe:c,d=XS(r),f=d?l?yxe:yxe.filter(function(v){return XS(v)===d}):Gk,x=f.filter(function(v){return u.indexOf(v)>=0});x.length===0&&(x=f);var g=x.reduce(function(v,w){return v[w]=wE(e,{placement:w,boundary:s,rootBoundary:a,padding:o})[D0(w)],v},{});return Object.keys(g).sort(function(v,w){return g[v]-g[w]})}function gCt(e){if(D0(e)===Iae)return[];var t=oO(e);return[Cxe(e),t,Cxe(t)]}function bCt(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var s=n.mainAxis,a=s===void 0?!0:s,o=n.altAxis,l=o===void 0?!0:o,c=n.fallbackPlacements,u=n.padding,d=n.boundary,f=n.rootBoundary,x=n.altBoundary,g=n.flipVariations,v=g===void 0?!0:g,w=n.allowedAutoPlacements,C=t.options.placement,N=D0(C),P=N===C,I=c||(P||!v?[oO(C)]:gCt(C)),R=[C].concat(I).reduce(function(he,ge){return he.concat(D0(ge)===Iae?xCt(t,{placement:ge,boundary:d,rootBoundary:f,padding:u,flipVariations:v,allowedAutoPlacements:w}):ge)},[]),F=t.rects.reference,U=t.rects.popper,L=new Map,z=!0,Q=R[0],ne=0;ne<R.length;ne++){var J=R[ne],X=D0(J),re=XS(J)===GS,pe=[nf,lp].indexOf(X)>=0,Y=pe?"width":"height",ie=wE(t,{placement:J,boundary:d,rootBoundary:f,altBoundary:x,padding:u}),oe=pe?re?cp:rf:re?lp:nf;F[Y]>U[Y]&&(oe=oO(oe));var G=oO(oe),V=[];if(a&&V.push(ie[X]<=0),l&&V.push(ie[oe]<=0,ie[G]<=0),V.every(function(he){return he})){Q=J,z=!1;break}L.set(J,V)}if(z)for(var ee=v?3:1,ae=function(ge){var ye=R.find(function(ve){var je=L.get(ve);if(je)return je.slice(0,ge).every(function(Ie){return Ie})});if(ye)return Q=ye,"break"},fe=ee;fe>0;fe--){var Ne=ae(fe);if(Ne==="break")break}t.placement!==Q&&(t.modifiersData[r]._skip=!0,t.placement=Q,t.reset=!0)}}const yCt={name:"flip",enabled:!0,phase:"main",fn:bCt,requiresIfExists:["offset"],data:{_skip:!1}};function Nxe(e,t,n){return n===void 0&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function Axe(e){return[nf,cp,lp,rf].some(function(t){return e[t]>=0})}function vCt(e){var t=e.state,n=e.name,r=t.rects.reference,s=t.rects.popper,a=t.modifiersData.preventOverflow,o=wE(t,{elementContext:"reference"}),l=wE(t,{altBoundary:!0}),c=Nxe(o,r),u=Nxe(l,s,a),d=Axe(c),f=Axe(u);t.modifiersData[n]={referenceClippingOffsets:c,popperEscapeOffsets:u,isReferenceHidden:d,hasPopperEscaped:f},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":d,"data-popper-escaped":f})}const wCt={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:vCt};function CCt(e,t,n){var r=D0(e),s=[rf,nf].indexOf(r)>=0?-1:1,a=typeof n=="function"?n(Object.assign({},t,{placement:e})):n,o=a[0],l=a[1];return o=o||0,l=(l||0)*s,[rf,cp].indexOf(r)>=0?{x:l,y:o}:{x:o,y:l}}function SCt(e){var t=e.state,n=e.options,r=e.name,s=n.offset,a=s===void 0?[0,0]:s,o=WIe.reduce(function(d,f){return d[f]=CCt(f,t.rects,a),d},{}),l=o[t.placement],c=l.x,u=l.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=c,t.modifiersData.popperOffsets.y+=u),t.modifiersData[r]=o}const NCt={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:SCt};function ACt(e){var t=e.state,n=e.name;t.modifiersData[n]=JIe({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}const jCt={name:"popperOffsets",enabled:!0,phase:"read",fn:ACt,data:{}};function ECt(e){return e==="x"?"y":"x"}function _Ct(e){var t=e.state,n=e.options,r=e.name,s=n.mainAxis,a=s===void 0?!0:s,o=n.altAxis,l=o===void 0?!1:o,c=n.boundary,u=n.rootBoundary,d=n.altBoundary,f=n.padding,x=n.tether,g=x===void 0?!0:x,v=n.tetherOffset,w=v===void 0?0:v,C=wE(t,{boundary:c,rootBoundary:u,padding:f,altBoundary:d}),N=D0(t.placement),P=XS(t.placement),I=!P,R=Oae(N),F=ECt(R),U=t.modifiersData.popperOffsets,L=t.rects.reference,z=t.rects.popper,Q=typeof w=="function"?w(Object.assign({},t.rects,{placement:t.placement})):w,ne=typeof Q=="number"?{mainAxis:Q,altAxis:Q}:Object.assign({mainAxis:0,altAxis:0},Q),J=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,X={x:0,y:0};if(U){if(a){var re,pe=R==="y"?nf:rf,Y=R==="y"?lp:cp,ie=R==="y"?"height":"width",oe=U[R],G=oe+C[pe],V=oe-C[Y],ee=g?-z[ie]/2:0,ae=P===GS?L[ie]:z[ie],fe=P===GS?-z[ie]:-L[ie],Ne=t.elements.arrow,he=g&&Ne?Fae(Ne):{width:0,height:0},ge=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:YIe(),ye=ge[pe],ve=ge[Y],je=Gj(0,L[ie],he[ie]),Ie=I?L[ie]/2-ee-je-ye-ne.mainAxis:ae-je-ye-ne.mainAxis,Le=I?-L[ie]/2+ee+je+ve+ne.mainAxis:fe+je+ve+ne.mainAxis,Qe=t.elements.arrow&&Kk(t.elements.arrow),$e=Qe?R==="y"?Qe.clientTop||0:Qe.clientLeft||0:0,it=(re=J==null?void 0:J[R])!=null?re:0,tt=oe+Ie-it-$e,lt=oe+Le-it,ft=Gj(g?OM(G,tt):G,oe,g?Qw(V,lt):V);U[R]=ft,X[R]=ft-oe}if(l){var ut,qt=R==="x"?nf:rf,It=R==="x"?lp:cp,nn=U[F],jt=F==="y"?"height":"width",cn=nn+C[qt],un=nn-C[It],Ft=[nf,rf].indexOf(N)!==-1,Ke=(ut=J==null?void 0:J[F])!=null?ut:0,Bt=Ft?cn:nn-L[jt]-z[jt]-Ke+ne.altAxis,$t=Ft?nn+L[jt]+z[jt]-Ke-ne.altAxis:un,qe=g&&Ft?Z6t(Bt,nn,$t):Gj(g?Bt:cn,nn,g?$t:un);U[F]=qe,X[F]=qe-nn}t.modifiersData[r]=X}}const kCt={name:"preventOverflow",enabled:!0,phase:"main",fn:_Ct,requiresIfExists:["offset"]};function TCt(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function ICt(e){return e===Gf(e)||!ep(e)?Mae(e):TCt(e)}function PCt(e){var t=e.getBoundingClientRect(),n=KS(t.width)/e.offsetWidth||1,r=KS(t.height)/e.offsetHeight||1;return n!==1||r!==1}function FCt(e,t,n){n===void 0&&(n=!1);var r=ep(t),s=ep(t)&&PCt(t),a=l2(t),o=YS(e,s,n),l={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(r||!r&&!n)&&((ex(t)!=="body"||Lae(a))&&(l=ICt(t)),ep(t)?(c=YS(t,!0),c.x+=t.clientLeft,c.y+=t.clientTop):a&&(c.x=Rae(a))),{x:o.left+l.scrollLeft-c.x,y:o.top+l.scrollTop-c.y,width:o.width,height:o.height}}function OCt(e){var t=new Map,n=new Set,r=[];e.forEach(function(a){t.set(a.name,a)});function s(a){n.add(a.name);var o=[].concat(a.requires||[],a.requiresIfExists||[]);o.forEach(function(l){if(!n.has(l)){var c=t.get(l);c&&s(c)}}),r.push(a)}return e.forEach(function(a){n.has(a.name)||s(a)}),r}function MCt(e){var t=OCt(e);return G6t.reduce(function(n,r){return n.concat(t.filter(function(s){return s.phase===r}))},[])}function RCt(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}function LCt(e){var t=e.reduce(function(n,r){var s=n[r.name];return n[r.name]=s?Object.assign({},s,r,{options:Object.assign({},s.options,r.options),data:Object.assign({},s.data,r.data)}):r,n},{});return Object.keys(t).map(function(n){return t[n]})}var jxe={placement:"bottom",modifiers:[],strategy:"absolute"};function Exe(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some(function(r){return!(r&&typeof r.getBoundingClientRect=="function")})}function DCt(e){e===void 0&&(e={});var t=e,n=t.defaultModifiers,r=n===void 0?[]:n,s=t.defaultOptions,a=s===void 0?jxe:s;return function(l,c,u){u===void 0&&(u=a);var d={placement:"bottom",orderedModifiers:[],options:Object.assign({},jxe,a),modifiersData:{},elements:{reference:l,popper:c},attributes:{},styles:{}},f=[],x=!1,g={state:d,setOptions:function(N){var P=typeof N=="function"?N(d.options):N;w(),d.options=Object.assign({},a,d.options,P),d.scrollParents={reference:O3(l)?Kj(l):l.contextElement?Kj(l.contextElement):[],popper:Kj(c)};var I=MCt(LCt([].concat(r,d.options.modifiers)));return d.orderedModifiers=I.filter(function(R){return R.enabled}),v(),g.update()},forceUpdate:function(){if(!x){var N=d.elements,P=N.reference,I=N.popper;if(Exe(P,I)){d.rects={reference:FCt(P,Kk(I),d.options.strategy==="fixed"),popper:Fae(I)},d.reset=!1,d.placement=d.options.placement,d.orderedModifiers.forEach(function(ne){return d.modifiersData[ne.name]=Object.assign({},ne.data)});for(var R=0;R<d.orderedModifiers.length;R++){if(d.reset===!0){d.reset=!1,R=-1;continue}var F=d.orderedModifiers[R],U=F.fn,L=F.options,z=L===void 0?{}:L,Q=F.name;typeof U=="function"&&(d=U({state:d,options:z,name:Q,instance:g})||d)}}}},update:RCt(function(){return new Promise(function(C){g.forceUpdate(),C(d)})}),destroy:function(){w(),x=!0}};if(!Exe(l,c))return g;g.setOptions(u).then(function(C){!x&&u.onFirstUpdate&&u.onFirstUpdate(C)});function v(){d.orderedModifiers.forEach(function(C){var N=C.name,P=C.options,I=P===void 0?{}:P,R=C.effect;if(typeof R=="function"){var F=R({state:d,name:N,instance:g,options:I}),U=function(){};f.push(F||U)}})}function w(){f.forEach(function(C){return C()}),f=[]}return g}}var BCt=[lCt,jCt,aCt,qIe,NCt,yCt,kCt,nCt,wCt],$Ct=DCt({defaultModifiers:BCt}),UCt="tippy-box",ePe="tippy-content",zCt="tippy-backdrop",tPe="tippy-arrow",nPe="tippy-svg-arrow",jv={passive:!0,capture:!0},rPe=function(){return document.body};function nV(e,t,n){if(Array.isArray(e)){var r=e[t];return r??(Array.isArray(n)?n[t]:n)}return e}function Dae(e,t){var n={}.toString.call(e);return n.indexOf("[object")===0&&n.indexOf(t+"]")>-1}function sPe(e,t){return typeof e=="function"?e.apply(void 0,t):e}function _xe(e,t){if(t===0)return e;var n;return function(r){clearTimeout(n),n=setTimeout(function(){e(r)},t)}}function HCt(e){return e.split(/\s+/).filter(Boolean)}function wC(e){return[].concat(e)}function kxe(e,t){e.indexOf(t)===-1&&e.push(t)}function VCt(e){return e.filter(function(t,n){return e.indexOf(t)===n})}function WCt(e){return e.split("-")[0]}function MM(e){return[].slice.call(e)}function Txe(e){return Object.keys(e).reduce(function(t,n){return e[n]!==void 0&&(t[n]=e[n]),t},{})}function Yj(){return document.createElement("div")}function KB(e){return["Element","Fragment"].some(function(t){return Dae(e,t)})}function qCt(e){return Dae(e,"NodeList")}function iPe(e){return Dae(e,"MouseEvent")}function GCt(e){return!!(e&&e._tippy&&e._tippy.reference===e)}function KCt(e){return KB(e)?[e]:qCt(e)?MM(e):Array.isArray(e)?e:MM(document.querySelectorAll(e))}function rV(e,t){e.forEach(function(n){n&&(n.style.transitionDuration=t+"ms")})}function Ixe(e,t){e.forEach(function(n){n&&n.setAttribute("data-state",t)})}function aPe(e){var t,n=wC(e),r=n[0];return r!=null&&(t=r.ownerDocument)!=null&&t.body?r.ownerDocument:document}function YCt(e,t){var n=t.clientX,r=t.clientY;return e.every(function(s){var a=s.popperRect,o=s.popperState,l=s.props,c=l.interactiveBorder,u=WCt(o.placement),d=o.modifiersData.offset;if(!d)return!0;var f=u==="bottom"?d.top.y:0,x=u==="top"?d.bottom.y:0,g=u==="right"?d.left.x:0,v=u==="left"?d.right.x:0,w=a.top-r+f>c,C=r-a.bottom-x>c,N=a.left-n+g>c,P=n-a.right-v>c;return w||C||N||P})}function sV(e,t,n){var r=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(s){e[r](s,n)})}function Pxe(e,t){for(var n=t;n;){var r;if(e.contains(n))return!0;n=n.getRootNode==null||(r=n.getRootNode())==null?void 0:r.host}return!1}var b0={isTouch:!1},Fxe=0;function XCt(){b0.isTouch||(b0.isTouch=!0,window.performance&&document.addEventListener("mousemove",oPe))}function oPe(){var e=performance.now();e-Fxe<20&&(b0.isTouch=!1,document.removeEventListener("mousemove",oPe)),Fxe=e}function QCt(){var e=document.activeElement;if(GCt(e)){var t=e._tippy;e.blur&&!t.state.isVisible&&e.blur()}}function ZCt(){document.addEventListener("touchstart",XCt,jv),window.addEventListener("blur",QCt)}var JCt=typeof window<"u"&&typeof document<"u",e4t=JCt?!!window.msCrypto:!1,t4t={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},n4t={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},am=Object.assign({appendTo:rPe,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},t4t,n4t),r4t=Object.keys(am),s4t=function(t){var n=Object.keys(t);n.forEach(function(r){am[r]=t[r]})};function lPe(e){var t=e.plugins||[],n=t.reduce(function(r,s){var a=s.name,o=s.defaultValue;if(a){var l;r[a]=e[a]!==void 0?e[a]:(l=am[a])!=null?l:o}return r},{});return Object.assign({},e,n)}function i4t(e,t){var n=t?Object.keys(lPe(Object.assign({},am,{plugins:t}))):r4t,r=n.reduce(function(s,a){var o=(e.getAttribute("data-tippy-"+a)||"").trim();if(!o)return s;if(a==="content")s[a]=o;else try{s[a]=JSON.parse(o)}catch{s[a]=o}return s},{});return r}function Oxe(e,t){var n=Object.assign({},t,{content:sPe(t.content,[e])},t.ignoreAttributes?{}:i4t(e,t.plugins));return n.aria=Object.assign({},am.aria,n.aria),n.aria={expanded:n.aria.expanded==="auto"?t.interactive:n.aria.expanded,content:n.aria.content==="auto"?t.interactive?null:"describedby":n.aria.content},n}var a4t=function(){return"innerHTML"};function aee(e,t){e[a4t()]=t}function Mxe(e){var t=Yj();return e===!0?t.className=tPe:(t.className=nPe,KB(e)?t.appendChild(e):aee(t,e)),t}function Rxe(e,t){KB(t.content)?(aee(e,""),e.appendChild(t.content)):typeof t.content!="function"&&(t.allowHTML?aee(e,t.content):e.textContent=t.content)}function oee(e){var t=e.firstElementChild,n=MM(t.children);return{box:t,content:n.find(function(r){return r.classList.contains(ePe)}),arrow:n.find(function(r){return r.classList.contains(tPe)||r.classList.contains(nPe)}),backdrop:n.find(function(r){return r.classList.contains(zCt)})}}function cPe(e){var t=Yj(),n=Yj();n.className=UCt,n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var r=Yj();r.className=ePe,r.setAttribute("data-state","hidden"),Rxe(r,e.props),t.appendChild(n),n.appendChild(r),s(e.props,e.props);function s(a,o){var l=oee(t),c=l.box,u=l.content,d=l.arrow;o.theme?c.setAttribute("data-theme",o.theme):c.removeAttribute("data-theme"),typeof o.animation=="string"?c.setAttribute("data-animation",o.animation):c.removeAttribute("data-animation"),o.inertia?c.setAttribute("data-inertia",""):c.removeAttribute("data-inertia"),c.style.maxWidth=typeof o.maxWidth=="number"?o.maxWidth+"px":o.maxWidth,o.role?c.setAttribute("role",o.role):c.removeAttribute("role"),(a.content!==o.content||a.allowHTML!==o.allowHTML)&&Rxe(u,e.props),o.arrow?d?a.arrow!==o.arrow&&(c.removeChild(d),c.appendChild(Mxe(o.arrow))):c.appendChild(Mxe(o.arrow)):d&&c.removeChild(d)}return{popper:t,onUpdate:s}}cPe.$$tippy=!0;var o4t=1,oP=[],iV=[];function l4t(e,t){var n=Oxe(e,Object.assign({},am,lPe(Txe(t)))),r,s,a,o=!1,l=!1,c=!1,u=!1,d,f,x,g=[],v=_xe(tt,n.interactiveDebounce),w,C=o4t++,N=null,P=VCt(n.plugins),I={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},R={id:C,reference:e,popper:Yj(),popperInstance:N,props:n,state:I,plugins:P,clearDelayTimeouts:Bt,setProps:$t,setContent:qe,show:Ye,hide:ht,hideWithInteractivity:Zt,enable:Ft,disable:Ke,unmount:zt,destroy:Et};if(!n.render)return R;var F=n.render(R),U=F.popper,L=F.onUpdate;U.setAttribute("data-tippy-root",""),U.id="tippy-"+R.id,R.popper=U,e._tippy=R,U._tippy=R;var z=P.map(function(nt){return nt.fn(R)}),Q=e.hasAttribute("aria-expanded");return Qe(),ee(),oe(),G("onCreate",[R]),n.showOnCreate&&cn(),U.addEventListener("mouseenter",function(){R.props.interactive&&R.state.isVisible&&R.clearDelayTimeouts()}),U.addEventListener("mouseleave",function(){R.props.interactive&&R.props.trigger.indexOf("mouseenter")>=0&&pe().addEventListener("mousemove",v)}),R;function ne(){var nt=R.props.touch;return Array.isArray(nt)?nt:[nt,0]}function J(){return ne()[0]==="hold"}function X(){var nt;return!!((nt=R.props.render)!=null&&nt.$$tippy)}function re(){return w||e}function pe(){var nt=re().parentNode;return nt?aPe(nt):document}function Y(){return oee(U)}function ie(nt){return R.state.isMounted&&!R.state.isVisible||b0.isTouch||d&&d.type==="focus"?0:nV(R.props.delay,nt?0:1,am.delay)}function oe(nt){nt===void 0&&(nt=!1),U.style.pointerEvents=R.props.interactive&&!nt?"":"none",U.style.zIndex=""+R.props.zIndex}function G(nt,Ue,Rt){if(Rt===void 0&&(Rt=!0),z.forEach(function(at){at[nt]&&at[nt].apply(at,Ue)}),Rt){var We;(We=R.props)[nt].apply(We,Ue)}}function V(){var nt=R.props.aria;if(nt.content){var Ue="aria-"+nt.content,Rt=U.id,We=wC(R.props.triggerTarget||e);We.forEach(function(at){var mt=at.getAttribute(Ue);if(R.state.isVisible)at.setAttribute(Ue,mt?mt+" "+Rt:Rt);else{var Dt=mt&&mt.replace(Rt,"").trim();Dt?at.setAttribute(Ue,Dt):at.removeAttribute(Ue)}})}}function ee(){if(!(Q||!R.props.aria.expanded)){var nt=wC(R.props.triggerTarget||e);nt.forEach(function(Ue){R.props.interactive?Ue.setAttribute("aria-expanded",R.state.isVisible&&Ue===re()?"true":"false"):Ue.removeAttribute("aria-expanded")})}}function ae(){pe().removeEventListener("mousemove",v),oP=oP.filter(function(nt){return nt!==v})}function fe(nt){if(!(b0.isTouch&&(c||nt.type==="mousedown"))){var Ue=nt.composedPath&&nt.composedPath()[0]||nt.target;if(!(R.props.interactive&&Pxe(U,Ue))){if(wC(R.props.triggerTarget||e).some(function(Rt){return Pxe(Rt,Ue)})){if(b0.isTouch||R.state.isVisible&&R.props.trigger.indexOf("click")>=0)return}else G("onClickOutside",[R,nt]);R.props.hideOnClick===!0&&(R.clearDelayTimeouts(),R.hide(),l=!0,setTimeout(function(){l=!1}),R.state.isMounted||ye())}}}function Ne(){c=!0}function he(){c=!1}function ge(){var nt=pe();nt.addEventListener("mousedown",fe,!0),nt.addEventListener("touchend",fe,jv),nt.addEventListener("touchstart",he,jv),nt.addEventListener("touchmove",Ne,jv)}function ye(){var nt=pe();nt.removeEventListener("mousedown",fe,!0),nt.removeEventListener("touchend",fe,jv),nt.removeEventListener("touchstart",he,jv),nt.removeEventListener("touchmove",Ne,jv)}function ve(nt,Ue){Ie(nt,function(){!R.state.isVisible&&U.parentNode&&U.parentNode.contains(U)&&Ue()})}function je(nt,Ue){Ie(nt,Ue)}function Ie(nt,Ue){var Rt=Y().box;function We(at){at.target===Rt&&(sV(Rt,"remove",We),Ue())}if(nt===0)return Ue();sV(Rt,"remove",f),sV(Rt,"add",We),f=We}function Le(nt,Ue,Rt){Rt===void 0&&(Rt=!1);var We=wC(R.props.triggerTarget||e);We.forEach(function(at){at.addEventListener(nt,Ue,Rt),g.push({node:at,eventType:nt,handler:Ue,options:Rt})})}function Qe(){J()&&(Le("touchstart",it,{passive:!0}),Le("touchend",lt,{passive:!0})),HCt(R.props.trigger).forEach(function(nt){if(nt!=="manual")switch(Le(nt,it),nt){case"mouseenter":Le("mouseleave",lt);break;case"focus":Le(e4t?"focusout":"blur",ft);break;case"focusin":Le("focusout",ft);break}})}function $e(){g.forEach(function(nt){var Ue=nt.node,Rt=nt.eventType,We=nt.handler,at=nt.options;Ue.removeEventListener(Rt,We,at)}),g=[]}function it(nt){var Ue,Rt=!1;if(!(!R.state.isEnabled||ut(nt)||l)){var We=((Ue=d)==null?void 0:Ue.type)==="focus";d=nt,w=nt.currentTarget,ee(),!R.state.isVisible&&iPe(nt)&&oP.forEach(function(at){return at(nt)}),nt.type==="click"&&(R.props.trigger.indexOf("mouseenter")<0||o)&&R.props.hideOnClick!==!1&&R.state.isVisible?Rt=!0:cn(nt),nt.type==="click"&&(o=!Rt),Rt&&!We&&un(nt)}}function tt(nt){var Ue=nt.target,Rt=re().contains(Ue)||U.contains(Ue);if(!(nt.type==="mousemove"&&Rt)){var We=jt().concat(U).map(function(at){var mt,Dt=at._tippy,Tt=(mt=Dt.popperInstance)==null?void 0:mt.state;return Tt?{popperRect:at.getBoundingClientRect(),popperState:Tt,props:n}:null}).filter(Boolean);YCt(We,nt)&&(ae(),un(nt))}}function lt(nt){var Ue=ut(nt)||R.props.trigger.indexOf("click")>=0&&o;if(!Ue){if(R.props.interactive){R.hideWithInteractivity(nt);return}un(nt)}}function ft(nt){R.props.trigger.indexOf("focusin")<0&&nt.target!==re()||R.props.interactive&&nt.relatedTarget&&U.contains(nt.relatedTarget)||un(nt)}function ut(nt){return b0.isTouch?J()!==nt.type.indexOf("touch")>=0:!1}function qt(){It();var nt=R.props,Ue=nt.popperOptions,Rt=nt.placement,We=nt.offset,at=nt.getReferenceClientRect,mt=nt.moveTransition,Dt=X()?oee(U).arrow:null,Tt=at?{getBoundingClientRect:at,contextElement:at.contextElement||re()}:e,dn={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(Nn){var kn=Nn.state;if(X()){var yn=Y(),Vn=yn.box;["placement","reference-hidden","escaped"].forEach(function(Gn){Gn==="placement"?Vn.setAttribute("data-placement",kn.placement):kn.attributes.popper["data-popper-"+Gn]?Vn.setAttribute("data-"+Gn,""):Vn.removeAttribute("data-"+Gn)}),kn.attributes.popper={}}}},on=[{name:"offset",options:{offset:We}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!mt}},dn];X()&&Dt&&on.push({name:"arrow",options:{element:Dt,padding:3}}),on.push.apply(on,(Ue==null?void 0:Ue.modifiers)||[]),R.popperInstance=$Ct(Tt,U,Object.assign({},Ue,{placement:Rt,onFirstUpdate:x,modifiers:on}))}function It(){R.popperInstance&&(R.popperInstance.destroy(),R.popperInstance=null)}function nn(){var nt=R.props.appendTo,Ue,Rt=re();R.props.interactive&&nt===rPe||nt==="parent"?Ue=Rt.parentNode:Ue=sPe(nt,[Rt]),Ue.contains(U)||Ue.appendChild(U),R.state.isMounted=!0,qt()}function jt(){return MM(U.querySelectorAll("[data-tippy-root]"))}function cn(nt){R.clearDelayTimeouts(),nt&&G("onTrigger",[R,nt]),ge();var Ue=ie(!0),Rt=ne(),We=Rt[0],at=Rt[1];b0.isTouch&&We==="hold"&&at&&(Ue=at),Ue?r=setTimeout(function(){R.show()},Ue):R.show()}function un(nt){if(R.clearDelayTimeouts(),G("onUntrigger",[R,nt]),!R.state.isVisible){ye();return}if(!(R.props.trigger.indexOf("mouseenter")>=0&&R.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(nt.type)>=0&&o)){var Ue=ie(!1);Ue?s=setTimeout(function(){R.state.isVisible&&R.hide()},Ue):a=requestAnimationFrame(function(){R.hide()})}}function Ft(){R.state.isEnabled=!0}function Ke(){R.hide(),R.state.isEnabled=!1}function Bt(){clearTimeout(r),clearTimeout(s),cancelAnimationFrame(a)}function $t(nt){if(!R.state.isDestroyed){G("onBeforeUpdate",[R,nt]),$e();var Ue=R.props,Rt=Oxe(e,Object.assign({},Ue,Txe(nt),{ignoreAttributes:!0}));R.props=Rt,Qe(),Ue.interactiveDebounce!==Rt.interactiveDebounce&&(ae(),v=_xe(tt,Rt.interactiveDebounce)),Ue.triggerTarget&&!Rt.triggerTarget?wC(Ue.triggerTarget).forEach(function(We){We.removeAttribute("aria-expanded")}):Rt.triggerTarget&&e.removeAttribute("aria-expanded"),ee(),oe(),L&&L(Ue,Rt),R.popperInstance&&(qt(),jt().forEach(function(We){requestAnimationFrame(We._tippy.popperInstance.forceUpdate)})),G("onAfterUpdate",[R,nt])}}function qe(nt){R.setProps({content:nt})}function Ye(){var nt=R.state.isVisible,Ue=R.state.isDestroyed,Rt=!R.state.isEnabled,We=b0.isTouch&&!R.props.touch,at=nV(R.props.duration,0,am.duration);if(!(nt||Ue||Rt||We)&&!re().hasAttribute("disabled")&&(G("onShow",[R],!1),R.props.onShow(R)!==!1)){if(R.state.isVisible=!0,X()&&(U.style.visibility="visible"),oe(),ge(),R.state.isMounted||(U.style.transition="none"),X()){var mt=Y(),Dt=mt.box,Tt=mt.content;rV([Dt,Tt],0)}x=function(){var on;if(!(!R.state.isVisible||u)){if(u=!0,U.offsetHeight,U.style.transition=R.props.moveTransition,X()&&R.props.animation){var gn=Y(),Nn=gn.box,kn=gn.content;rV([Nn,kn],at),Ixe([Nn,kn],"visible")}V(),ee(),kxe(iV,R),(on=R.popperInstance)==null||on.forceUpdate(),G("onMount",[R]),R.props.animation&&X()&&je(at,function(){R.state.isShown=!0,G("onShown",[R])})}},nn()}}function ht(){var nt=!R.state.isVisible,Ue=R.state.isDestroyed,Rt=!R.state.isEnabled,We=nV(R.props.duration,1,am.duration);if(!(nt||Ue||Rt)&&(G("onHide",[R],!1),R.props.onHide(R)!==!1)){if(R.state.isVisible=!1,R.state.isShown=!1,u=!1,o=!1,X()&&(U.style.visibility="hidden"),ae(),ye(),oe(!0),X()){var at=Y(),mt=at.box,Dt=at.content;R.props.animation&&(rV([mt,Dt],We),Ixe([mt,Dt],"hidden"))}V(),ee(),R.props.animation?X()&&ve(We,R.unmount):R.unmount()}}function Zt(nt){pe().addEventListener("mousemove",v),kxe(oP,v),v(nt)}function zt(){R.state.isVisible&&R.hide(),R.state.isMounted&&(It(),jt().forEach(function(nt){nt._tippy.unmount()}),U.parentNode&&U.parentNode.removeChild(U),iV=iV.filter(function(nt){return nt!==R}),R.state.isMounted=!1,G("onHidden",[R]))}function Et(){R.state.isDestroyed||(R.clearDelayTimeouts(),R.unmount(),$e(),delete e._tippy,R.state.isDestroyed=!0,G("onDestroy",[R]))}}function Yk(e,t){t===void 0&&(t={});var n=am.plugins.concat(t.plugins||[]);ZCt();var r=Object.assign({},t,{plugins:n}),s=KCt(e),a=s.reduce(function(o,l){var c=l&&l4t(l,r);return c&&o.push(c),o},[]);return KB(e)?a[0]:a}Yk.defaultProps=am;Yk.setDefaultProps=s4t;Yk.currentInput=b0;Object.assign({},qIe,{effect:function(t){var n=t.state,r={popper:{position:n.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(n.elements.popper.style,r.popper),n.styles=r,n.elements.arrow&&Object.assign(n.elements.arrow.style,r.arrow)}});var lee={clientX:0,clientY:0},lP=[];function uPe(e){var t=e.clientX,n=e.clientY;lee={clientX:t,clientY:n}}function c4t(e){e.addEventListener("mousemove",uPe)}function u4t(e){e.removeEventListener("mousemove",uPe)}var d4t={name:"followCursor",defaultValue:!1,fn:function(t){var n=t.reference,r=aPe(t.props.triggerTarget||n),s=!1,a=!1,o=!0,l=t.props;function c(){return t.props.followCursor==="initial"&&t.state.isVisible}function u(){r.addEventListener("mousemove",x)}function d(){r.removeEventListener("mousemove",x)}function f(){s=!0,t.setProps({getReferenceClientRect:null}),s=!1}function x(w){var C=w.target?n.contains(w.target):!0,N=t.props.followCursor,P=w.clientX,I=w.clientY,R=n.getBoundingClientRect(),F=P-R.left,U=I-R.top;(C||!t.props.interactive)&&t.setProps({getReferenceClientRect:function(){var z=n.getBoundingClientRect(),Q=P,ne=I;N==="initial"&&(Q=z.left+F,ne=z.top+U);var J=N==="horizontal"?z.top:ne,X=N==="vertical"?z.right:Q,re=N==="horizontal"?z.bottom:ne,pe=N==="vertical"?z.left:Q;return{width:X-pe,height:re-J,top:J,right:X,bottom:re,left:pe}}})}function g(){t.props.followCursor&&(lP.push({instance:t,doc:r}),c4t(r))}function v(){lP=lP.filter(function(w){return w.instance!==t}),lP.filter(function(w){return w.doc===r}).length===0&&u4t(r)}return{onCreate:g,onDestroy:v,onBeforeUpdate:function(){l=t.props},onAfterUpdate:function(C,N){var P=N.followCursor;s||P!==void 0&&l.followCursor!==P&&(v(),P?(g(),t.state.isMounted&&!a&&!c()&&u()):(d(),f()))},onMount:function(){t.props.followCursor&&!a&&(o&&(x(lee),o=!1),c()||u())},onTrigger:function(C,N){iPe(N)&&(lee={clientX:N.clientX,clientY:N.clientY}),a=N.type==="focus"},onHidden:function(){t.props.followCursor&&(f(),d(),o=!0)}}}};Yk.setDefaultProps({render:cPe});function mi({content:e,children:t,align:n="center"}){const r=m.useRef(null),s=m.useRef(null),a=m.useRef(null),o=m.useRef(null);return m.useEffect(()=>{const l=()=>{o.current.hide()},c=document.querySelectorAll("*");return c.forEach(u=>{u.addEventListener("scroll",l,{passive:!0})}),()=>{c.forEach(u=>{u.removeEventListener("scroll",l)})}},[]),m.useEffect(()=>{if(!r.current)return;const l=typeof e!="string";l&&(s.current=document.createElement("div"),a.current=MNe.createRoot(s.current),a.current.render(e));const c=Yk(r.current,{content:l?s.current:`
<div style="
border-radius: 12px;
border: 0.8px solid rgba(133, 133, 133, 0.32);
background: rgba(255, 255, 255, 0.08);
box-shadow: 0 4px 4px 0 #050505;
backdrop-filter: blur(43px);
color: #FFF;
text-align: ${n};
font-family: Inter, sans-serif;
font-size: 12px;
font-style: normal;
font-weight: 400;
line-height: 14px;
letter-spacing: -0.12px;
padding: 6px 10px;
">
${e}
</div>
`,allowHTML:!l,followCursor:!0,plugins:[d4t],delay:[0,0],offset:[10,10],animation:"scale-subtle",duration:[50,100],placement:"top",popperOptions:{modifiers:[{name:"flip",options:{fallbackPlacements:["right","bottom","left"]}},{name:"preventOverflow",options:{padding:8}}]},interactive:!1,moveTransition:"",trigger:"mouseenter mousemove",theme:"custom",onShow(){setTimeout(()=>{window.dispatchEvent(new Event("resize"))},50)}});return o.current=c,()=>{a.current&&Promise.resolve().then(()=>{var u;(u=a.current)==null||u.unmount()})}},[e]),m.isValidElement(t)?m.cloneElement(t,{ref:r}):i.jsx("span",{ref:r,children:t})}var Qh;(function(e){e.NUMBER="NUMBER_NUMBER",e.HEX="NUMBER_HEX",e.STR="NUMBER_STR",e.BIGINT="NUMBER_BIGINT"})(Qh||(Qh={}));var f1;(function(e){e.HEX="BYTES_HEX",e.UINT8ARRAY="BYTES_UINT8ARRAY"})(f1||(f1={}));const dd={number:Qh.BIGINT,bytes:f1.HEX},pi={number:Qh.HEX,bytes:f1.HEX};var Tg;(function(e){e.EARLIEST="earliest",e.LATEST="latest",e.PENDING="pending",e.SAFE="safe",e.FINALIZED="finalized",e.COMMITTED="committed"})(Tg||(Tg={}));var Xj;(function(e){e.chainstart="chainstart",e.frontier="frontier",e.homestead="homestead",e.dao="dao",e.tangerineWhistle="tangerineWhistle",e.spuriousDragon="spuriousDragon",e.byzantium="byzantium",e.constantinople="constantinople",e.petersburg="petersburg",e.istanbul="istanbul",e.muirGlacier="muirGlacier",e.berlin="berlin",e.london="london",e.altair="altair",e.arrowGlacier="arrowGlacier",e.grayGlacier="grayGlacier",e.bellatrix="bellatrix",e.merge="merge",e.capella="capella",e.shanghai="shanghai"})(Xj||(Xj={}));const Bae=Object.getPrototypeOf(Uint8Array);var Lxe=function(e,t,n,r){function s(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?a(d.value):s(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})};const Dxe=Symbol.for("web3/base-provider");class Xk{static isWeb3Provider(t){return t instanceof Xk||!!(t&&t[Dxe])}get[Dxe](){return!0}send(t,n){this.request(t).then(r=>{n(null,r)}).catch(r=>{n(r)})}sendAsync(t){return Lxe(this,void 0,void 0,function*(){return this.request(t)})}asEIP1193Provider(){const t=Object.create(this),n=t.request;return t.request=function(s){return Lxe(this,void 0,void 0,function*(){return(yield n(s)).result})},t.asEIP1193Provider=void 0,t}}class f4t extends Array{constructor(t){super(),this._accountProvider=t}}const h4t=100,p4t=101,m4t=201,x4t=202,g4t=203,b4t=204,y4t=205,v4t=206,w4t=207,C4t=208,S4t=300,N4t=301,A4t=310,j4t=311,E4t=400,_4t=402,k4t=405,T4t=407,I4t=408,P4t=410,F4t=411,O4t=412,M4t=413,R4t=414,L4t=415,D4t=416,B4t=417,$4t=418,U4t=419,z4t=420,H4t=421,V4t=422,W4t=423,q4t=424,G4t=425,K4t=426,Y4t=427,X4t=428,Q4t=429,Z4t=430,J4t=431,eSt=432,tSt=433,nSt=434,rSt=435,sSt=436,iSt=437,aSt=438,oSt=439,lSt=440,cSt=441,uSt=500,dSt=503,fSt=505,hSt=506,pSt=507,mSt=600,xSt=602,gSt=603,bSt=604,ySt=701,vSt=702,wSt=703,CSt=704,SSt=705,NSt=706,ASt=707,jSt=709,ESt=801,_St=802,kSt=4001,TSt=4100,ISt=4200,PSt=4900,FSt=4901,OSt=902,MSt=903,RSt=1001,LSt=1002,DSt=1003,BSt=1004,$St=1005,USt=1006,zSt=1008,HSt=1009,VSt=1010,WSt=1011,qSt=1012,GSt=1014,KSt=1015,YSt=1100,dPe=1101,XSt=1200,RM=-32700,LM=-32600,DM=-32601,BM=-32602,$M=-32603,UM=-32e3,zM=-32001,HM=-32002,VM=-32003,WM=-32004,qM=-32005,GM=-32006;class di extends Error{get innerError(){return this.cause instanceof Qj?this.cause.errors:this.cause}set innerError(t){Array.isArray(t)?this.cause=new Qj(t):this.cause=t}constructor(t,n){super(t),Array.isArray(n)?this.cause=new Qj(n):this.cause=n,this.name=this.constructor.name,typeof Error.captureStackTrace=="function"?Error.captureStackTrace(new.target.constructor):this.stack=new Error().stack}static convertToString(t,n=!1){if(t==null)return"undefined";const r=JSON.stringify(t,(s,a)=>typeof a=="bigint"?a.toString():a);return n&&["bigint","string"].includes(typeof t)?r.replace(/['\\"]+/g,""):r}toJSON(){return{name:this.name,code:this.code,message:this.message,cause:this.cause,innerError:this.cause}}}class Qj extends di{constructor(t){super(`Multiple errors occurred: [${t.map(n=>n.message).join("], [")}]`),this.code=C4t,this.errors=t}}class Ui extends di{constructor(t,n){super(`Invalid value given "${di.convertToString(t,!0)}". Error: ${n}.`),this.name=this.constructor.name}}class Bxe extends di{constructor(){super("Private key must be 32 bytes."),this.code=ySt}}class QSt extends di{constructor(){super("Invalid Private Key, Not a valid string or uint8Array"),this.code=vSt}}class ZSt extends di{constructor(t){super(`"${t}"`),this.code=_St}}class fPe extends di{constructor(){super("Invalid key derivation function"),this.code=wSt}}class JSt extends di{constructor(){super("Key derivation failed - possibly wrong password"),this.code=CSt}}class eNt extends di{constructor(){super("Unsupported key store version"),this.code=SSt}}class tNt extends di{constructor(){super("Password cannot be empty"),this.code=NSt}}class nNt extends di{constructor(){super("Initialization vector must be 16 bytes"),this.code=ASt}}class rNt extends di{constructor(){super("c > 1000, pbkdf2 is less secure with less iterations"),this.code=jSt}}class Qk extends di{constructor(t,n){super(t),this.code=uSt,n&&(this.errorCode=n.code,this.errorReason=n.reason)}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{errorCode:this.errorCode,errorReason:this.errorReason})}}class cee extends Qk{constructor(t){super("Connection not open",t),this.code=dSt}}class sNt extends Qk{constructor(t){super(`Maximum number of reconnect attempts reached! (${t})`),this.code=fSt}}class iNt extends Qk{constructor(){super("CONNECTION ERROR: Provider started to reconnect before the response got received!"),this.code=hSt}}class aNt extends Qk{constructor(t){super(`Request already sent with following id: ${t}`),this.code=pSt}}class fd extends di{constructor(t,n){super(t),this.code=S4t,this.receipt=n}}class $xe extends di{constructor(t,n){super(`The resolver at ${t} does not implement requested method: "${n}".`),this.address=t,this.name=n,this.code=N4t}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{address:this.address,name:this.name})}}class YB extends fd{constructor(t){if(super(t.message||"Error"),this.name="name"in t&&t.name||this.constructor.name,this.stack="stack"in t&&t.stack||void 0,this.code=t.code,typeof t.data=="object"){let n;t.data&&"originalError"in t.data?n=t.data.originalError:n=t.data,this.data=n.data,this.cause=new YB(n)}else this.data=t.data}setDecodedProperties(t,n,r){this.errorName=t,this.errorSignature=n,this.errorArgs=r}toJSON(){let t=Object.assign(Object.assign({},super.toJSON()),{data:this.data});return this.errorName&&(t=Object.assign(Object.assign({},t),{errorName:this.errorName,errorSignature:this.errorSignature,errorArgs:this.errorArgs})),t}}class Zw extends fd{constructor(t){super("Error happened while trying to execute a function inside a smart contract"),this.code=A4t,this.cause=new YB(t)}}class oNt extends Ui{constructor(t){var n,r;super(`data: ${(n=t.data)!==null&&n!==void 0?n:"undefined"}, input: ${(r=t.input)!==null&&r!==void 0?r:"undefined"}`,`You can't have "data" and "input" as properties of a contract at the same time, please use either "data" or "input" instead.`),this.code=j4t}}class lNt extends di{constructor(t){super(`ENS is not supported on network ${t}`),this.code=OSt}}class cNt extends di{constructor(){super("Network not synced"),this.code=MSt}}class Uxe extends di{constructor(t){super(`Invalid parameters passed. "${typeof t<"u"?t:""}"`),this.hint=t,this.code=w4t}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{hint:this.hint})}}class uee extends di{constructor(){super(...arguments),this.code=m4t}}class Ux extends di{constructor(){super("The method you're trying to call is not implemented."),this.code=x4t}}class hPe extends di{constructor(){super(...arguments),this.code=g4t}}class uNt extends di{constructor(){super(...arguments),this.code=b4t}}class Ki extends di{constructor(t,n){super(t),this.code=y4t,this.props=n??{}}}class dNt extends di{constructor(t){super(`A plugin with the namespace: ${t} has already been registered.`),this.code=v4t}}class lO extends di{constructor(){super(...arguments),this.code=mSt}}class dee extends di{constructor(t){super(`Client URL "${t}" is invalid.`),this.code=xSt}}class lg extends di{constructor(){super(...arguments),this.code=gSt}}class fNt extends di{constructor(){super(...arguments),this.code=bSt}}class hNt extends Ui{constructor(){super(...arguments),this.code=ESt}}class $ae extends di{constructor(t,n){super(t),this.receipt=n,this.code=E4t}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{receipt:this.receipt})}}class KM extends di{constructor(t,n,r,s){super(`Transaction has been reverted by the EVM${r===void 0?"":`:
${di.convertToString(r)}`}`),this.reason=t,this.signature=n,this.receipt=r,this.data=s,this.code=_4t}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{reason:this.reason,signature:this.signature,receipt:this.receipt,data:this.data})}}class pPe extends KM{constructor(t,n,r,s,a,o,l){super(t),this.reason=t,this.customErrorName=n,this.customErrorDecodedSignature=r,this.customErrorArguments=s,this.signature=a,this.receipt=o,this.data=l,this.code=aSt}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{reason:this.reason,customErrorName:this.customErrorName,customErrorDecodedSignature:this.customErrorDecodedSignature,customErrorArguments:this.customErrorArguments,signature:this.signature,receipt:this.receipt,data:this.data})}}class mPe extends $ae{constructor(t){super(`Transaction has been reverted by the EVM${t===void 0?"":`:
${di.convertToString(t)}`}`,t),this.code=k4t}}class pNt extends $ae{constructor(){super("Raw transaction undefined"),this.code=T4t}}class zxe extends $ae{constructor(){super("Transaction not found"),this.code=Z4t}}class mNt extends Ui{constructor(t){super(t,"invalid transaction with invalid sender"),this.code=I4t}}class xNt extends Ui{constructor(t){super(t,"invalid transaction with invalid receiver"),this.code=iSt}}class gNt extends Ui{constructor(){super("MissingCustomChainError","If tx.common is provided it must have tx.common.customChain"),this.code=P4t}}class bNt extends Ui{constructor(){super("MissingCustomChainIdError","If tx.common is provided it must have tx.common.customChain and tx.common.customChain.chainId"),this.code=F4t}}class yNt extends Ui{constructor(t){super(JSON.stringify(t),"Chain Id doesnt match in tx.chainId tx.common.customChain.chainId"),this.code=O4t}}class vNt extends Ui{constructor(t){super(JSON.stringify(t),"Chain doesnt match in tx.chain tx.common.basechain"),this.code=rSt}}class wNt extends Ui{constructor(t){super(JSON.stringify(t),"hardfork doesnt match in tx.hardfork tx.common.hardfork"),this.code=sSt}}class CNt extends Ui{constructor(){super("CommonOrChainAndHardforkError","Please provide the common object or the chain and hardfork property but not all together."),this.code=M4t}}class SNt extends Ui{constructor(t){var n,r;super("MissingChainOrHardforkError",`When specifying chain and hardfork, both values must be defined. Received "chain": ${(n=t.chain)!==null&&n!==void 0?n:"undefined"}, "hardfork": ${(r=t.hardfork)!==null&&r!==void 0?r:"undefined"}`),this.code=R4t}}class NNt extends di{constructor(){super('Missing properties in transaction, either define "gas" and "gasPrice" for type 0 transactions or "gas", "maxPriorityFeePerGas" and "maxFeePerGas" for type 2 transactions'),this.code=lSt}}class ANt extends Ui{constructor(t){var n,r,s,a;super(`gas: ${(n=t.gas)!==null&&n!==void 0?n:"undefined"}, gasPrice: ${(r=t.gasPrice)!==null&&r!==void 0?r:"undefined"}, maxPriorityFeePerGas: ${(s=t.maxPriorityFeePerGas)!==null&&s!==void 0?s:"undefined"}, maxFeePerGas: ${(a=t.maxFeePerGas)!==null&&a!==void 0?a:"undefined"}`,'"gas" is missing'),this.code=L4t,this.cause=new NNt}}class jNt extends di{constructor(){super('Missing properties in transaction, either define "gas" and "gasPrice" for type 0 transactions or "gas", "maxPriorityFeePerGas" and "maxFeePerGas" for type 2 transactions, not both'),this.code=cSt}}class ENt extends Ui{constructor(t){var n,r,s,a;super(`gas: ${(n=t.gas)!==null&&n!==void 0?n:"undefined"}, gasPrice: ${(r=t.gasPrice)!==null&&r!==void 0?r:"undefined"}, maxPriorityFeePerGas: ${(s=t.maxPriorityFeePerGas)!==null&&s!==void 0?s:"undefined"}, maxFeePerGas: ${(a=t.maxFeePerGas)!==null&&a!==void 0?a:"undefined"}`,"transaction must specify legacy or fee market gas properties, not both"),this.code=nSt,this.cause=new jNt}}class _Nt extends Ui{constructor(t){var n,r;super(`gas: ${(n=t.gas)!==null&&n!==void 0?n:"undefined"}, gasPrice: ${(r=t.gasPrice)!==null&&r!==void 0?r:"undefined"}`,"Gas or gasPrice is lower than 0"),this.code=D4t}}class kNt extends Ui{constructor(t){var n,r;super(`maxPriorityFeePerGas: ${(n=t.maxPriorityFeePerGas)!==null&&n!==void 0?n:"undefined"}, maxFeePerGas: ${(r=t.maxFeePerGas)!==null&&r!==void 0?r:"undefined"}`,"maxPriorityFeePerGas or maxFeePerGas is lower than 0"),this.code=B4t}}class TNt extends Ui{constructor(t){super(t,"eip-1559 transactions don't support gasPrice"),this.code=$4t}}class xPe extends Ui{constructor(t){var n,r;super(`maxPriorityFeePerGas: ${(n=t.maxPriorityFeePerGas)!==null&&n!==void 0?n:"undefined"}, maxFeePerGas: ${(r=t.maxFeePerGas)!==null&&r!==void 0?r:"undefined"}`,"pre-eip-1559 transaction don't support maxFeePerGas/maxPriorityFeePerGas"),this.code=U4t}}class INt extends Ui{constructor(t){super(t,"invalid transaction object"),this.code=z4t}}class PNt extends Ui{constructor(t){var n,r;super(`nonce: ${(n=t.nonce)!==null&&n!==void 0?n:"undefined"}, chainId: ${(r=t.chainId)!==null&&r!==void 0?r:"undefined"}`,"Nonce or chainId is lower than 0"),this.code=H4t}}class FNt extends Ui{constructor(){super("UnableToPopulateNonceError","unable to populate nonce, no from address available"),this.code=V4t}}class ONt extends Ui{constructor(){super("Eip1559NotSupportedError","Network doesn't support eip-1559"),this.code=W4t}}class Hxe extends Ui{constructor(t){super(t,"unsupported transaction type"),this.code=q4t}}class gPe extends Ui{constructor(t){var n,r;super(`data: ${(n=t.data)!==null&&n!==void 0?n:"undefined"}, input: ${(r=t.input)!==null&&r!==void 0?r:"undefined"}`,`You can't have "data" and "input" as properties of transactions at the same time, please use either "data" or "input" instead.`),this.code=G4t}}class MNt extends di{constructor(t){super(`The connected Ethereum Node did not respond within ${t.numberOfSeconds} seconds, please make sure your transaction was properly sent and you are connected to a healthy Node. Be aware that transaction might still be pending or mined!
Transaction Hash: ${t.transactionHash?t.transactionHash.toString():"not available"}`),this.code=J4t}}function bPe(e){return`Please make sure your transaction was properly sent and there are no previous pending transaction for the same account. However, be aware that it might still be mined!
Transaction Hash: ${e?e.toString():"not available"}`}class yPe extends di{constructor(t){super(`Transaction was not mined within ${t.numberOfSeconds} seconds. ${bPe(t.transactionHash)}`),this.code=K4t}}class vPe extends di{constructor(t){super(`Transaction started at ${t.starterBlockNumber} but was not mined within ${t.numberOfBlocks} blocks. ${bPe(t.transactionHash)}`),this.code=eSt}}class RNt extends Ui{constructor(t){var n,r;super(`receipt: ${JSON.stringify(t.receipt)}, blockHash: ${(n=t.blockHash)===null||n===void 0?void 0:n.toString()}, transactionHash: ${(r=t.transactionHash)===null||r===void 0?void 0:r.toString()}`,"Receipt missing or blockHash null"),this.code=Y4t}}class LNt extends Ui{constructor(t){super(`receipt: ${JSON.stringify(t.receipt)}`,"Receipt missing block number"),this.code=X4t}}class fee extends di{constructor(t){super(`Invalid signature. "${t}"`),this.code=tSt}}class Vxe extends Ui{constructor(){super("LocalWalletNotAvailableError","Attempted to index account in local wallet, but no wallet is available"),this.code=Q4t}}class DNt extends di{constructor(t,n){const r=[];t.forEach(s=>r.push(s.keyword)),super(`The following properties are invalid for the transaction type ${n}: ${r.join(", ")}`),this.code=oSt}}class o4 extends Ui{constructor(t){super(t,"can not parse as byte data"),this.code=LSt}}class Uae extends Ui{constructor(t){super(t,"can not parse as number data"),this.code=DSt}}class zae extends Ui{constructor(t){super(t,"invalid ethereum address"),this.code=$St}}class BNt extends Ui{constructor(t){super(t,"not a valid string"),this.code=RSt}}class wPe extends Ui{constructor(t){super(t,"invalid unit"),this.code=BSt}}class CPe extends Ui{constructor(t){super(t,"not a valid unit. Must be a positive integer"),this.code=KSt}}class $Nt extends Ui{constructor(t){super(t,"can not be converted to hex"),this.code=USt}}class SPe extends Ui{constructor(t){super(t,"value greater than the nibble width"),this.code=GSt}}class Hae extends Ui{constructor(t){super(t,"not a valid boolean."),this.code=zSt}}class UNt extends Ui{constructor(t){super(t,"not a valid unsigned integer."),this.code=HSt}}class Wxe extends Ui{constructor(t){super(t,"invalid size given."),this.code=VSt}}class qxe extends Ui{constructor(t){super(t,"value is larger than size."),this.code=WSt}}class zNt extends Ui{constructor(t){super(t,"invalid string given"),this.code=qSt}}const HNt=e=>!Array.isArray(e)&&e.jsonrpc==="2.0"&&!!e&&(e.result===void 0||e.result===null)&&"error"in e&&(typeof e.id=="number"||typeof e.id=="string"),Gxe=e=>HNt(e)?e.error.message:"";class S0 extends di{constructor(t,n,r,s){var a;super(n??`Returned error: ${Array.isArray(t)?t.map(l=>Gxe(l)).join(","):Gxe(t)}`),this.code=h4t,n||(this.data=Array.isArray(t)?t.map(l=>{var c;return(c=l.error)===null||c===void 0?void 0:c.data}):(a=t==null?void 0:t.error)===null||a===void 0?void 0:a.data),this.statusCode=s,this.request=r;let o;"error"in t?o=t.error:t instanceof Array&&(o=t.filter(l=>l.error).map(l=>l.error)),Array.isArray(o)&&o.length>0?this.cause=new Qj(o):this.cause=o}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{data:this.data,request:this.request,statusCode:this.statusCode})}}class XB extends S0{constructor(t,n){super(t,void 0,n),this.code=p4t;let r;"error"in t?r=t.error:t instanceof Array&&(r=t.map(s=>s.error)),Array.isArray(r)?this.cause=new Qj(r):this.cause=r}}class Kxe extends di{constructor(t,n){super(`Web3Config hardfork doesnt match in defaultHardfork ${t} and common.hardfork ${n}`),this.code=dPe}}class Yxe extends di{constructor(t,n){super(`Web3Config chain doesnt match in defaultHardfork ${t} and common.hardfork ${n}`),this.code=dPe}}const NPe="An Rpc error has occured with a code of *code*",Pu={[RM]:{message:"Parse error",description:"Invalid JSON"},[LM]:{message:"Invalid request",description:"JSON is not a valid request object "},[DM]:{message:"Method not found",description:"Method does not exist "},[BM]:{message:"Invalid params",description:"Invalid method parameters"},[$M]:{message:"Internal error",description:"Internal JSON-RPC error"},[UM]:{message:"Invalid input",description:"Missing or invalid parameters"},[zM]:{message:"Resource not found",description:"Requested resource not found"},[HM]:{message:"Resource unavailable",description:"Requested resource not available"},[VM]:{message:"Transaction rejected",description:"Transaction creation failed"},[WM]:{message:"Method not supported",description:"Method is not implemented"},[qM]:{message:"Limit exceeded",description:"Request exceeds defined limit"},[GM]:{message:"JSON-RPC version not supported",description:"Version of JSON-RPC protocol is not supported"},[kSt]:{name:"User Rejected Request",message:"The user rejected the request."},[TSt]:{name:"Unauthorized",message:"The requested method and/or account has not been authorized by the user."},[ISt]:{name:"Unsupported Method",message:"The Provider does not support the requested method."},[PSt]:{name:"Disconnected",message:"The Provider is disconnected from all chains."},[FSt]:{name:"Chain Disconnected",message:"The Provider is not connected to the requested chain."},"0-999":{name:"",message:"Not used."},1e3:{name:"Normal Closure",message:"The connection successfully completed the purpose for which it was created."},1001:{name:"Going Away",message:"The endpoint is going away, either because of a server failure or because the browser is navigating away from the page that opened the connection."},1002:{name:"Protocol error",message:"The endpoint is terminating the connection due to a protocol error."},1003:{name:"Unsupported Data",message:"The connection is being terminated because the endpoint received data of a type it cannot accept. (For example, a text-only endpoint received binary data.)"},1004:{name:"Reserved",message:"Reserved. A meaning might be defined in the future."},1005:{name:"No Status Rcvd",message:"Reserved. Indicates that no status code was provided even though one was expected."},1006:{name:"Abnormal Closure",message:"Reserved. Indicates that a connection was closed abnormally (that is, with no close frame being sent) when a status code is expected."},1007:{name:"Invalid frame payload data",message:"The endpoint is terminating the connection because a message was received that contained inconsistent data (e.g., non-UTF-8 data within a text message)."},1008:{name:"Policy Violation",message:"The endpoint is terminating the connection because it received a message that violates its policy. This is a generic status code, used when codes 1003 and 1009 are not suitable."},1009:{name:"Message Too Big",message:"The endpoint is terminating the connection because a data frame was received that is too large."},1010:{name:"Mandatory Ext.",message:"The client is terminating the connection because it expected the server to negotiate one or more extension, but the server didn't."},1011:{name:"Internal Error",message:"The server is terminating the connection because it encountered an unexpected condition that prevented it from fulfilling the request."},1012:{name:"Service Restart",message:"The server is terminating the connection because it is restarting."},1013:{name:"Try Again Later",message:"The server is terminating the connection due to a temporary condition, e.g. it is overloaded and is casting off some of its clients."},1014:{name:"Bad Gateway",message:"The server was acting as a gateway or proxy and received an invalid response from the upstream server. This is similar to 502 HTTP Status Code."},1015:{name:"TLS handshake",message:"Reserved. Indicates that the connection was closed due to a failure to perform a TLS handshake (e.g., the server certificate can't be verified)."},"1016-2999":{name:"",message:"For definition by future revisions of the WebSocket Protocol specification, and for definition by extension specifications."},"3000-3999":{name:"",message:"For use by libraries, frameworks, and applications. These status codes are registered directly with IANA. The interpretation of these codes is undefined by the WebSocket protocol."},"4000-4999":{name:"",message:"For private use, and thus can't be registered. Such codes can be used by prior agreements between WebSocket applications. The interpretation of these codes is undefined by the WebSocket protocol."}};class Jf extends di{constructor(t,n){super(n??NPe.replace("*code*",t.error.code.toString())),this.code=t.error.code,this.id=t.id,this.jsonrpc=t.jsonrpc,this.jsonRpcError=t.error}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{error:this.jsonRpcError,id:this.id,jsonRpc:this.jsonrpc})}}class VNt extends di{constructor(t,n){var r,s,a,o;if(!t)super();else if(!((r=Pu[t])===null||r===void 0)&&r.message)super(Pu[t].message);else{const l=Object.keys(Pu).find(c=>typeof c=="string"&&t>=parseInt(c.split("-")[0],10)&&t<=parseInt(c.split("-")[1],10));super((a=(s=Pu[l??""])===null||s===void 0?void 0:s.message)!==null&&a!==void 0?a:NPe.replace("*code*",(o=t==null?void 0:t.toString())!==null&&o!==void 0?o:'""'))}this.code=t,this.data=n}}class WNt extends Jf{constructor(t){super(t,Pu[RM].message),this.code=RM}}class qNt extends Jf{constructor(t){super(t,Pu[LM].message),this.code=LM}}class GNt extends Jf{constructor(t){super(t,Pu[DM].message),this.code=DM}}class KNt extends Jf{constructor(t){super(t,Pu[BM].message),this.code=BM}}class YNt extends Jf{constructor(t){super(t,Pu[$M].message),this.code=$M}}class XNt extends Jf{constructor(t){super(t,Pu[UM].message),this.code=UM}}class QNt extends Jf{constructor(t){super(t,Pu[WM].message),this.code=WM}}class ZNt extends Jf{constructor(t){super(t,Pu[HM].message),this.code=HM}}class JNt extends Jf{constructor(t){super(t,Pu[zM].message),this.code=zM}}class eAt extends Jf{constructor(t){super(t,Pu[GM].message),this.code=GM}}class tAt extends Jf{constructor(t){super(t,Pu[VM].message),this.code=VM}}class nAt extends Jf{constructor(t){super(t,Pu[qM].message),this.code=qM}}const md=new Map;md.set(RM,{error:WNt});md.set(LM,{error:qNt});md.set(DM,{error:GNt});md.set(BM,{error:KNt});md.set($M,{error:YNt});md.set(UM,{error:XNt});md.set(WM,{error:QNt});md.set(HM,{error:ZNt});md.set(VM,{error:tAt});md.set(zM,{error:JNt});md.set(GM,{error:eAt});md.set(qM,{error:nAt});class rAt extends di{constructor(t){super(`Format for the type ${t} is unsupported`),this.type=t,this.code=XSt}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{type:this.type})}}function qd(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`positive integer expected, not ${e}`)}function sAt(e){if(typeof e!="boolean")throw new Error(`boolean expected, not ${e}`)}function iAt(e){return e instanceof Uint8Array||e!=null&&typeof e=="object"&&e.constructor.name==="Uint8Array"}function MA(e,...t){if(!iAt(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error(`Uint8Array expected of length ${t}, not of length=${e.length}`)}function Vae(e){if(typeof e!="function"||typeof e.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");qd(e.outputLen),qd(e.blockLen)}function M3(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function Wae(e,t){MA(e);const n=t.outputLen;if(e.length<n)throw new Error(`digestInto() expects output buffer of length at least ${n}`)}const APe={number:qd,bool:sAt,bytes:MA,hash:Vae,exists:M3,output:Wae},cP=BigInt(2**32-1),Xxe=BigInt(32);function aAt(e,t=!1){return t?{h:Number(e&cP),l:Number(e>>Xxe&cP)}:{h:Number(e>>Xxe&cP)|0,l:Number(e&cP)|0}}function oAt(e,t=!1){let n=new Uint32Array(e.length),r=new Uint32Array(e.length);for(let s=0;s<e.length;s++){const{h:a,l:o}=aAt(e[s],t);[n[s],r[s]]=[a,o]}return[n,r]}const lAt=(e,t,n)=>e<<n|t>>>32-n,cAt=(e,t,n)=>t<<n|e>>>32-n,uAt=(e,t,n)=>t<<n-32|e>>>64-n,dAt=(e,t,n)=>e<<n-32|t>>>64-n,cO=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */const uO=e=>new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4)),dO=e=>new DataView(e.buffer,e.byteOffset,e.byteLength),Qm=(e,t)=>e<<32-t|e>>>t,pa=(e,t)=>e<<t|e>>>32-t>>>0,YM=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68,fAt=e=>e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255;function XM(e){for(let t=0;t<e.length;t++)e[t]=fAt(e[t])}function QS(e){if(typeof e!="string")throw new Error(`utf8ToBytes expected string, got ${typeof e}`);return new Uint8Array(new TextEncoder().encode(e))}function ZS(e){return typeof e=="string"&&(e=QS(e)),MA(e),e}function QM(...e){let t=0;for(let r=0;r<e.length;r++){const s=e[r];MA(s),t+=s.length}const n=new Uint8Array(t);for(let r=0,s=0;r<e.length;r++){const a=e[r];n.set(a,s),s+=a.length}return n}class qae{clone(){return this._cloneInto()}}const hAt={}.toString;function jPe(e,t){if(t!==void 0&&hAt.call(t)!=="[object Object]")throw new Error("Options should be object or undefined");return Object.assign(e,t)}function EPe(e){const t=r=>e().update(ZS(r)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}function _Pe(e=32){if(cO&&typeof cO.getRandomValues=="function")return cO.getRandomValues(new Uint8Array(e));throw new Error("crypto.getRandomValues must be defined")}const kPe=[],TPe=[],IPe=[],pAt=BigInt(0),j7=BigInt(1),mAt=BigInt(2),xAt=BigInt(7),gAt=BigInt(256),bAt=BigInt(113);for(let e=0,t=j7,n=1,r=0;e<24;e++){[n,r]=[r,(2*n+3*r)%5],kPe.push(2*(5*r+n)),TPe.push((e+1)*(e+2)/2%64);let s=pAt;for(let a=0;a<7;a++)t=(t<<j7^(t>>xAt)*bAt)%gAt,t&mAt&&(s^=j7<<(j7<<BigInt(a))-j7);IPe.push(s)}const[yAt,vAt]=oAt(IPe,!0),Qxe=(e,t,n)=>n>32?uAt(e,t,n):lAt(e,t,n),Zxe=(e,t,n)=>n>32?dAt(e,t,n):cAt(e,t,n);function wAt(e,t=24){const n=new Uint32Array(10);for(let r=24-t;r<24;r++){for(let o=0;o<10;o++)n[o]=e[o]^e[o+10]^e[o+20]^e[o+30]^e[o+40];for(let o=0;o<10;o+=2){const l=(o+8)%10,c=(o+2)%10,u=n[c],d=n[c+1],f=Qxe(u,d,1)^n[l],x=Zxe(u,d,1)^n[l+1];for(let g=0;g<50;g+=10)e[o+g]^=f,e[o+g+1]^=x}let s=e[2],a=e[3];for(let o=0;o<24;o++){const l=TPe[o],c=Qxe(s,a,l),u=Zxe(s,a,l),d=kPe[o];s=e[d],a=e[d+1],e[d]=c,e[d+1]=u}for(let o=0;o<50;o+=10){for(let l=0;l<10;l++)n[l]=e[o+l];for(let l=0;l<10;l++)e[o+l]^=~n[(l+2)%10]&n[(l+4)%10]}e[0]^=yAt[r],e[1]^=vAt[r]}n.fill(0)}class Gae extends qae{constructor(t,n,r,s=!1,a=24){if(super(),this.blockLen=t,this.suffix=n,this.outputLen=r,this.enableXOF=s,this.rounds=a,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,qd(r),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=uO(this.state)}keccak(){YM||XM(this.state32),wAt(this.state32,this.rounds),YM||XM(this.state32),this.posOut=0,this.pos=0}update(t){M3(this);const{blockLen:n,state:r}=this;t=ZS(t);const s=t.length;for(let a=0;a<s;){const o=Math.min(n-this.pos,s-a);for(let l=0;l<o;l++)r[this.pos++]^=t[a++];this.pos===n&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:t,suffix:n,pos:r,blockLen:s}=this;t[r]^=n,n&128&&r===s-1&&this.keccak(),t[s-1]^=128,this.keccak()}writeInto(t){M3(this,!1),MA(t),this.finish();const n=this.state,{blockLen:r}=this;for(let s=0,a=t.length;s<a;){this.posOut>=r&&this.keccak();const o=Math.min(r-this.posOut,a-s);t.set(n.subarray(this.posOut,this.posOut+o),s),this.posOut+=o,s+=o}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return qd(t),this.xofInto(new Uint8Array(t))}digestInto(t){if(Wae(t,this),this.finished)throw new Error("digest() was already called");return this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(t){const{blockLen:n,suffix:r,outputLen:s,rounds:a,enableXOF:o}=this;return t||(t=new Gae(n,r,s,o,a)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=a,t.suffix=r,t.outputLen=s,t.enableXOF=o,t.destroyed=this.destroyed,t}}const CAt=(e,t,n)=>EPe(()=>new Gae(t,e,n)),Jxe=CAt(1,136,256/8),ZM=APe.bytes;function PPe(e){if(!(e instanceof Uint8Array))throw new TypeError(`bytesToUtf8 expected Uint8Array, got ${typeof e}`);return new TextDecoder().decode(e)}function SAt(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function NAt(e){return t=>(APe.bytes(t),e(t))}(()=>{const e=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0,t=typeof module<"u"&&typeof module.require=="function"&&module.require.bind(module);return{node:t&&!e?t("crypto"):void 0,web:e}})();const od=(()=>{const e=NAt(Jxe);return e.create=Jxe.create,e})();var ua;(function(e){e.assertEqual=s=>{};function t(s){}e.assertIs=t;function n(s){throw new Error}e.assertNever=n,e.arrayToEnum=s=>{const a={};for(const o of s)a[o]=o;return a},e.getValidEnumValues=s=>{const a=e.objectKeys(s).filter(l=>typeof s[s[l]]!="number"),o={};for(const l of a)o[l]=s[l];return e.objectValues(o)},e.objectValues=s=>e.objectKeys(s).map(function(a){return s[a]}),e.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{const a=[];for(const o in s)Object.prototype.hasOwnProperty.call(s,o)&&a.push(o);return a},e.find=(s,a)=>{for(const o of s)if(a(o))return o},e.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&Number.isFinite(s)&&Math.floor(s)===s;function r(s,a=" | "){return s.map(o=>typeof o=="string"?`'${o}'`:o).join(a)}e.joinValues=r,e.jsonStringifyReplacer=(s,a)=>typeof a=="bigint"?a.toString():a})(ua||(ua={}));var hee;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(hee||(hee={}));const Cs=ua.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),fg=e=>{switch(typeof e){case"undefined":return Cs.undefined;case"string":return Cs.string;case"number":return Number.isNaN(e)?Cs.nan:Cs.number;case"boolean":return Cs.boolean;case"function":return Cs.function;case"bigint":return Cs.bigint;case"symbol":return Cs.symbol;case"object":return Array.isArray(e)?Cs.array:e===null?Cs.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?Cs.promise:typeof Map<"u"&&e instanceof Map?Cs.map:typeof Set<"u"&&e instanceof Set?Cs.set:typeof Date<"u"&&e instanceof Date?Cs.date:Cs.object;default:return Cs.unknown}},Gr=ua.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),AAt=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:");class Wf extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=t}format(t){const n=t||function(a){return a.message},r={_errors:[]},s=a=>{for(const o of a.issues)if(o.code==="invalid_union")o.unionErrors.map(s);else if(o.code==="invalid_return_type")s(o.returnTypeError);else if(o.code==="invalid_arguments")s(o.argumentsError);else if(o.path.length===0)r._errors.push(n(o));else{let l=r,c=0;for(;c<o.path.length;){const u=o.path[c];c===o.path.length-1?(l[u]=l[u]||{_errors:[]},l[u]._errors.push(n(o))):l[u]=l[u]||{_errors:[]},l=l[u],c++}}};return s(this),r}static assert(t){if(!(t instanceof Wf))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,ua.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=n=>n.message){const n={},r=[];for(const s of this.issues)if(s.path.length>0){const a=s.path[0];n[a]=n[a]||[],n[a].push(t(s))}else r.push(t(s));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}Wf.create=e=>new Wf(e);const JS=(e,t)=>{let n;switch(e.code){case Gr.invalid_type:e.received===Cs.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case Gr.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,ua.jsonStringifyReplacer)}`;break;case Gr.unrecognized_keys:n=`Unrecognized key(s) in object: ${ua.joinValues(e.keys,", ")}`;break;case Gr.invalid_union:n="Invalid input";break;case Gr.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${ua.joinValues(e.options)}`;break;case Gr.invalid_enum_value:n=`Invalid enum value. Expected ${ua.joinValues(e.options)}, received '${e.received}'`;break;case Gr.invalid_arguments:n="Invalid function arguments";break;case Gr.invalid_return_type:n="Invalid function return type";break;case Gr.invalid_date:n="Invalid date";break;case Gr.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:ua.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case Gr.too_small:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="bigint"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:n="Invalid input";break;case Gr.too_big:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:n="Invalid input";break;case Gr.custom:n="Invalid input";break;case Gr.invalid_intersection_types:n="Intersection results could not be merged";break;case Gr.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case Gr.not_finite:n="Number must be finite";break;default:n=t.defaultError,ua.assertNever(e)}return{message:n}};let FPe=JS;function jAt(e){FPe=e}function JM(){return FPe}const eR=e=>{const{data:t,path:n,errorMaps:r,issueData:s}=e,a=[...n,...s.path||[]],o={...s,path:a};if(s.message!==void 0)return{...s,path:a,message:s.message};let l="";const c=r.filter(u=>!!u).slice().reverse();for(const u of c)l=u(o,{data:t,defaultError:l}).message;return{...s,path:a,message:l}},EAt=[];function us(e,t){const n=JM(),r=eR({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===JS?void 0:JS].filter(s=>!!s)});e.common.issues.push(r)}class Lu{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,n){const r=[];for(const s of n){if(s.status==="aborted")return ri;s.status==="dirty"&&t.dirty(),r.push(s.value)}return{status:t.value,value:r}}static async mergeObjectAsync(t,n){const r=[];for(const s of n){const a=await s.key,o=await s.value;r.push({key:a,value:o})}return Lu.mergeObjectSync(t,r)}static mergeObjectSync(t,n){const r={};for(const s of n){const{key:a,value:o}=s;if(a.status==="aborted"||o.status==="aborted")return ri;a.status==="dirty"&&t.dirty(),o.status==="dirty"&&t.dirty(),a.value!=="__proto__"&&(typeof o.value<"u"||s.alwaysSet)&&(r[a.value]=o.value)}return{status:t.value,value:r}}}const ri=Object.freeze({status:"aborted"}),RC=e=>({status:"dirty",value:e}),xd=e=>({status:"valid",value:e}),pee=e=>e.status==="aborted",mee=e=>e.status==="dirty",R3=e=>e.status==="valid",CE=e=>typeof Promise<"u"&&e instanceof Promise;var Ls;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(Ls||(Ls={}));class tx{constructor(t,n,r,s){this._cachedPath=[],this.parent=t,this.data=n,this._path=r,this._key=s}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const ege=(e,t)=>{if(R3(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new Wf(e.common.issues);return this._error=n,this._error}}};function ki(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:r,description:s}=e;if(t&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:s}:{errorMap:(o,l)=>{const{message:c}=e;return o.code==="invalid_enum_value"?{message:c??l.defaultError}:typeof l.data>"u"?{message:c??r??l.defaultError}:o.code!=="invalid_type"?{message:l.defaultError}:{message:c??n??l.defaultError}},description:s}}class Bi{get description(){return this._def.description}_getType(t){return fg(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:fg(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new Lu,ctx:{common:t.parent.common,data:t.data,parsedType:fg(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const n=this._parse(t);if(CE(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(t){const n=this._parse(t);return Promise.resolve(n)}parse(t,n){const r=this.safeParse(t,n);if(r.success)return r.data;throw r.error}safeParse(t,n){const r={common:{issues:[],async:(n==null?void 0:n.async)??!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:fg(t)},s=this._parseSync({data:t,path:r.path,parent:r});return ege(r,s)}"~validate"(t){var r,s;const n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:fg(t)};if(!this["~standard"].async)try{const a=this._parseSync({data:t,path:[],parent:n});return R3(a)?{value:a.value}:{issues:n.common.issues}}catch(a){(s=(r=a==null?void 0:a.message)==null?void 0:r.toLowerCase())!=null&&s.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:n}).then(a=>R3(a)?{value:a.value}:{issues:n.common.issues})}async parseAsync(t,n){const r=await this.safeParseAsync(t,n);if(r.success)return r.data;throw r.error}async safeParseAsync(t,n){const r={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:fg(t)},s=this._parse({data:t,path:r.path,parent:r}),a=await(CE(s)?s:Promise.resolve(s));return ege(r,a)}refine(t,n){const r=s=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(s):n;return this._refinement((s,a)=>{const o=t(s),l=()=>a.addIssue({code:Gr.custom,...r(s)});return typeof Promise<"u"&&o instanceof Promise?o.then(c=>c?!0:(l(),!1)):o?!0:(l(),!1)})}refinement(t,n){return this._refinement((r,s)=>t(r)?!0:(s.addIssue(typeof n=="function"?n(r,s):n),!1))}_refinement(t){return new ym({schema:this,typeName:ai.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:n=>this["~validate"](n)}}optional(){return B0.create(this,this._def)}nullable(){return Gy.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return dm.create(this)}promise(){return tN.create(this,this._def)}or(t){return jE.create([this,t],this._def)}and(t){return EE.create(this,t,this._def)}transform(t){return new ym({...ki(this._def),schema:this,typeName:ai.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const n=typeof t=="function"?t:()=>t;return new PE({...ki(this._def),innerType:this,defaultValue:n,typeName:ai.ZodDefault})}brand(){return new Kae({typeName:ai.ZodBranded,type:this,...ki(this._def)})}catch(t){const n=typeof t=="function"?t:()=>t;return new FE({...ki(this._def),innerType:this,catchValue:n,typeName:ai.ZodCatch})}describe(t){const n=this.constructor;return new n({...this._def,description:t})}pipe(t){return Zk.create(this,t)}readonly(){return OE.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const _At=/^c[^\s-]{8,}$/i,kAt=/^[0-9a-z]+$/,TAt=/^[0-9A-HJKMNP-TV-Z]{26}$/i,IAt=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,PAt=/^[a-z0-9_-]{21}$/i,FAt=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,OAt=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,MAt=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,RAt="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let aV;const LAt=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,DAt=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,BAt=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,$At=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,UAt=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,zAt=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,OPe="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",HAt=new RegExp(`^${OPe}$`);function MPe(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`);const n=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${n}`}function VAt(e){return new RegExp(`^${MPe(e)}$`)}function RPe(e){let t=`${OPe}T${MPe(e)}`;const n=[];return n.push(e.local?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}function WAt(e,t){return!!((t==="v4"||!t)&&LAt.test(e)||(t==="v6"||!t)&&BAt.test(e))}function qAt(e,t){if(!FAt.test(e))return!1;try{const[n]=e.split(".");if(!n)return!1;const r=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),s=JSON.parse(atob(r));return!(typeof s!="object"||s===null||"typ"in s&&(s==null?void 0:s.typ)!=="JWT"||!s.alg||t&&s.alg!==t)}catch{return!1}}function GAt(e,t){return!!((t==="v4"||!t)&&DAt.test(e)||(t==="v6"||!t)&&$At.test(e))}class om extends Bi{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==Cs.string){const a=this._getOrReturnCtx(t);return us(a,{code:Gr.invalid_type,expected:Cs.string,received:a.parsedType}),ri}const r=new Lu;let s;for(const a of this._def.checks)if(a.kind==="min")t.data.length<a.value&&(s=this._getOrReturnCtx(t,s),us(s,{code:Gr.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),r.dirty());else if(a.kind==="max")t.data.length>a.value&&(s=this._getOrReturnCtx(t,s),us(s,{code:Gr.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),r.dirty());else if(a.kind==="length"){const o=t.data.length>a.value,l=t.data.length<a.value;(o||l)&&(s=this._getOrReturnCtx(t,s),o?us(s,{code:Gr.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):l&&us(s,{code:Gr.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),r.dirty())}else if(a.kind==="email")MAt.test(t.data)||(s=this._getOrReturnCtx(t,s),us(s,{validation:"email",code:Gr.invalid_string,message:a.message}),r.dirty());else if(a.kind==="emoji")aV||(aV=new RegExp(RAt,"u")),aV.test(t.data)||(s=this._getOrReturnCtx(t,s),us(s,{validation:"emoji",code:Gr.invalid_string,message:a.message}),r.dirty());else if(a.kind==="uuid")IAt.test(t.data)||(s=this._getOrReturnCtx(t,s),us(s,{validation:"uuid",code:Gr.invalid_string,message:a.message}),r.dirty());else if(a.kind==="nanoid")PAt.test(t.data)||(s=this._getOrReturnCtx(t,s),us(s,{validation:"nanoid",code:Gr.invalid_string,message:a.message}),r.dirty());else if(a.kind==="cuid")_At.test(t.data)||(s=this._getOrReturnCtx(t,s),us(s,{validation:"cuid",code:Gr.invalid_string,message:a.message}),r.dirty());else if(a.kind==="cuid2")kAt.test(t.data)||(s=this._getOrReturnCtx(t,s),us(s,{validation:"cuid2",code:Gr.invalid_string,message:a.message}),r.dirty());else if(a.kind==="ulid")TAt.test(t.data)||(s=this._getOrReturnCtx(t,s),us(s,{validation:"ulid",code:Gr.invalid_string,message:a.message}),r.dirty());else if(a.kind==="url")try{new URL(t.data)}catch{s=this._getOrReturnCtx(t,s),us(s,{validation:"url",code:Gr.invalid_string,message:a.message}),r.dirty()}else a.kind==="regex"?(a.regex.lastIndex=0,a.regex.test(t.data)||(s=this._getOrReturnCtx(t,s),us(s,{validation:"regex",code:Gr.invalid_string,message:a.message}),r.dirty())):a.kind==="trim"?t.data=t.data.trim():a.kind==="includes"?t.data.includes(a.value,a.position)||(s=this._getOrReturnCtx(t,s),us(s,{code:Gr.invalid_string,validation:{includes:a.value,position:a.position},message:a.message}),r.dirty()):a.kind==="toLowerCase"?t.data=t.data.toLowerCase():a.kind==="toUpperCase"?t.data=t.data.toUpperCase():a.kind==="startsWith"?t.data.startsWith(a.value)||(s=this._getOrReturnCtx(t,s),us(s,{code:Gr.invalid_string,validation:{startsWith:a.value},message:a.message}),r.dirty()):a.kind==="endsWith"?t.data.endsWith(a.value)||(s=this._getOrReturnCtx(t,s),us(s,{code:Gr.invalid_string,validation:{endsWith:a.value},message:a.message}),r.dirty()):a.kind==="datetime"?RPe(a).test(t.data)||(s=this._getOrReturnCtx(t,s),us(s,{code:Gr.invalid_string,validation:"datetime",message:a.message}),r.dirty()):a.kind==="date"?HAt.test(t.data)||(s=this._getOrReturnCtx(t,s),us(s,{code:Gr.invalid_string,validation:"date",message:a.message}),r.dirty()):a.kind==="time"?VAt(a).test(t.data)||(s=this._getOrReturnCtx(t,s),us(s,{code:Gr.invalid_string,validation:"time",message:a.message}),r.dirty()):a.kind==="duration"?OAt.test(t.data)||(s=this._getOrReturnCtx(t,s),us(s,{validation:"duration",code:Gr.invalid_string,message:a.message}),r.dirty()):a.kind==="ip"?WAt(t.data,a.version)||(s=this._getOrReturnCtx(t,s),us(s,{validation:"ip",code:Gr.invalid_string,message:a.message}),r.dirty()):a.kind==="jwt"?qAt(t.data,a.alg)||(s=this._getOrReturnCtx(t,s),us(s,{validation:"jwt",code:Gr.invalid_string,message:a.message}),r.dirty()):a.kind==="cidr"?GAt(t.data,a.version)||(s=this._getOrReturnCtx(t,s),us(s,{validation:"cidr",code:Gr.invalid_string,message:a.message}),r.dirty()):a.kind==="base64"?UAt.test(t.data)||(s=this._getOrReturnCtx(t,s),us(s,{validation:"base64",code:Gr.invalid_string,message:a.message}),r.dirty()):a.kind==="base64url"?zAt.test(t.data)||(s=this._getOrReturnCtx(t,s),us(s,{validation:"base64url",code:Gr.invalid_string,message:a.message}),r.dirty()):ua.assertNever(a);return{status:r.value,value:t.data}}_regex(t,n,r){return this.refinement(s=>t.test(s),{validation:n,code:Gr.invalid_string,...Ls.errToObj(r)})}_addCheck(t){return new om({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...Ls.errToObj(t)})}url(t){return this._addCheck({kind:"url",...Ls.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...Ls.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...Ls.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...Ls.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...Ls.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...Ls.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...Ls.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...Ls.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...Ls.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...Ls.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...Ls.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...Ls.errToObj(t)})}datetime(t){return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(t==null?void 0:t.offset)??!1,local:(t==null?void 0:t.local)??!1,...Ls.errToObj(t==null?void 0:t.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,...Ls.errToObj(t==null?void 0:t.message)})}duration(t){return this._addCheck({kind:"duration",...Ls.errToObj(t)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...Ls.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n==null?void 0:n.position,...Ls.errToObj(n==null?void 0:n.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...Ls.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...Ls.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...Ls.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...Ls.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...Ls.errToObj(n)})}nonempty(t){return this.min(1,Ls.errToObj(t))}trim(){return new om({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new om({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new om({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}om.create=e=>new om({checks:[],typeName:ai.ZodString,coerce:(e==null?void 0:e.coerce)??!1,...ki(e)});function KAt(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,s=n>r?n:r,a=Number.parseInt(e.toFixed(s).replace(".","")),o=Number.parseInt(t.toFixed(s).replace(".",""));return a%o/10**s}class Vy extends Bi{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==Cs.number){const a=this._getOrReturnCtx(t);return us(a,{code:Gr.invalid_type,expected:Cs.number,received:a.parsedType}),ri}let r;const s=new Lu;for(const a of this._def.checks)a.kind==="int"?ua.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),us(r,{code:Gr.invalid_type,expected:"integer",received:"float",message:a.message}),s.dirty()):a.kind==="min"?(a.inclusive?t.data<a.value:t.data<=a.value)&&(r=this._getOrReturnCtx(t,r),us(r,{code:Gr.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),s.dirty()):a.kind==="max"?(a.inclusive?t.data>a.value:t.data>=a.value)&&(r=this._getOrReturnCtx(t,r),us(r,{code:Gr.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),s.dirty()):a.kind==="multipleOf"?KAt(t.data,a.value)!==0&&(r=this._getOrReturnCtx(t,r),us(r,{code:Gr.not_multiple_of,multipleOf:a.value,message:a.message}),s.dirty()):a.kind==="finite"?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),us(r,{code:Gr.not_finite,message:a.message}),s.dirty()):ua.assertNever(a);return{status:s.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,Ls.toString(n))}gt(t,n){return this.setLimit("min",t,!1,Ls.toString(n))}lte(t,n){return this.setLimit("max",t,!0,Ls.toString(n))}lt(t,n){return this.setLimit("max",t,!1,Ls.toString(n))}setLimit(t,n,r,s){return new Vy({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:Ls.toString(s)}]})}_addCheck(t){return new Vy({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:Ls.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Ls.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Ls.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Ls.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Ls.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:Ls.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:Ls.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Ls.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Ls.toString(t)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&ua.isInteger(t.value))}get isFinite(){let t=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(t===null||r.value<t)&&(t=r.value)}return Number.isFinite(n)&&Number.isFinite(t)}}Vy.create=e=>new Vy({checks:[],typeName:ai.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...ki(e)});class Wy extends Bi{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==Cs.bigint)return this._getInvalidInput(t);let r;const s=new Lu;for(const a of this._def.checks)a.kind==="min"?(a.inclusive?t.data<a.value:t.data<=a.value)&&(r=this._getOrReturnCtx(t,r),us(r,{code:Gr.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),s.dirty()):a.kind==="max"?(a.inclusive?t.data>a.value:t.data>=a.value)&&(r=this._getOrReturnCtx(t,r),us(r,{code:Gr.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),s.dirty()):a.kind==="multipleOf"?t.data%a.value!==BigInt(0)&&(r=this._getOrReturnCtx(t,r),us(r,{code:Gr.not_multiple_of,multipleOf:a.value,message:a.message}),s.dirty()):ua.assertNever(a);return{status:s.value,value:t.data}}_getInvalidInput(t){const n=this._getOrReturnCtx(t);return us(n,{code:Gr.invalid_type,expected:Cs.bigint,received:n.parsedType}),ri}gte(t,n){return this.setLimit("min",t,!0,Ls.toString(n))}gt(t,n){return this.setLimit("min",t,!1,Ls.toString(n))}lte(t,n){return this.setLimit("max",t,!0,Ls.toString(n))}lt(t,n){return this.setLimit("max",t,!1,Ls.toString(n))}setLimit(t,n,r,s){return new Wy({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:Ls.toString(s)}]})}_addCheck(t){return new Wy({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Ls.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Ls.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Ls.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Ls.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:Ls.toString(n)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}Wy.create=e=>new Wy({checks:[],typeName:ai.ZodBigInt,coerce:(e==null?void 0:e.coerce)??!1,...ki(e)});class SE extends Bi{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==Cs.boolean){const r=this._getOrReturnCtx(t);return us(r,{code:Gr.invalid_type,expected:Cs.boolean,received:r.parsedType}),ri}return xd(t.data)}}SE.create=e=>new SE({typeName:ai.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...ki(e)});class L3 extends Bi{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==Cs.date){const a=this._getOrReturnCtx(t);return us(a,{code:Gr.invalid_type,expected:Cs.date,received:a.parsedType}),ri}if(Number.isNaN(t.data.getTime())){const a=this._getOrReturnCtx(t);return us(a,{code:Gr.invalid_date}),ri}const r=new Lu;let s;for(const a of this._def.checks)a.kind==="min"?t.data.getTime()<a.value&&(s=this._getOrReturnCtx(t,s),us(s,{code:Gr.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),r.dirty()):a.kind==="max"?t.data.getTime()>a.value&&(s=this._getOrReturnCtx(t,s),us(s,{code:Gr.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),r.dirty()):ua.assertNever(a);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new L3({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:Ls.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:Ls.toString(n)})}get minDate(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t!=null?new Date(t):null}}L3.create=e=>new L3({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:ai.ZodDate,...ki(e)});class tR extends Bi{_parse(t){if(this._getType(t)!==Cs.symbol){const r=this._getOrReturnCtx(t);return us(r,{code:Gr.invalid_type,expected:Cs.symbol,received:r.parsedType}),ri}return xd(t.data)}}tR.create=e=>new tR({typeName:ai.ZodSymbol,...ki(e)});class NE extends Bi{_parse(t){if(this._getType(t)!==Cs.undefined){const r=this._getOrReturnCtx(t);return us(r,{code:Gr.invalid_type,expected:Cs.undefined,received:r.parsedType}),ri}return xd(t.data)}}NE.create=e=>new NE({typeName:ai.ZodUndefined,...ki(e)});class AE extends Bi{_parse(t){if(this._getType(t)!==Cs.null){const r=this._getOrReturnCtx(t);return us(r,{code:Gr.invalid_type,expected:Cs.null,received:r.parsedType}),ri}return xd(t.data)}}AE.create=e=>new AE({typeName:ai.ZodNull,...ki(e)});class eN extends Bi{constructor(){super(...arguments),this._any=!0}_parse(t){return xd(t.data)}}eN.create=e=>new eN({typeName:ai.ZodAny,...ki(e)});class Jw extends Bi{constructor(){super(...arguments),this._unknown=!0}_parse(t){return xd(t.data)}}Jw.create=e=>new Jw({typeName:ai.ZodUnknown,...ki(e)});class h1 extends Bi{_parse(t){const n=this._getOrReturnCtx(t);return us(n,{code:Gr.invalid_type,expected:Cs.never,received:n.parsedType}),ri}}h1.create=e=>new h1({typeName:ai.ZodNever,...ki(e)});class nR extends Bi{_parse(t){if(this._getType(t)!==Cs.undefined){const r=this._getOrReturnCtx(t);return us(r,{code:Gr.invalid_type,expected:Cs.void,received:r.parsedType}),ri}return xd(t.data)}}nR.create=e=>new nR({typeName:ai.ZodVoid,...ki(e)});class dm extends Bi{_parse(t){const{ctx:n,status:r}=this._processInputParams(t),s=this._def;if(n.parsedType!==Cs.array)return us(n,{code:Gr.invalid_type,expected:Cs.array,received:n.parsedType}),ri;if(s.exactLength!==null){const o=n.data.length>s.exactLength.value,l=n.data.length<s.exactLength.value;(o||l)&&(us(n,{code:o?Gr.too_big:Gr.too_small,minimum:l?s.exactLength.value:void 0,maximum:o?s.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:s.exactLength.message}),r.dirty())}if(s.minLength!==null&&n.data.length<s.minLength.value&&(us(n,{code:Gr.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),r.dirty()),s.maxLength!==null&&n.data.length>s.maxLength.value&&(us(n,{code:Gr.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((o,l)=>s.type._parseAsync(new tx(n,o,n.path,l)))).then(o=>Lu.mergeArray(r,o));const a=[...n.data].map((o,l)=>s.type._parseSync(new tx(n,o,n.path,l)));return Lu.mergeArray(r,a)}get element(){return this._def.type}min(t,n){return new dm({...this._def,minLength:{value:t,message:Ls.toString(n)}})}max(t,n){return new dm({...this._def,maxLength:{value:t,message:Ls.toString(n)}})}length(t,n){return new dm({...this._def,exactLength:{value:t,message:Ls.toString(n)}})}nonempty(t){return this.min(1,t)}}dm.create=(e,t)=>new dm({type:e,minLength:null,maxLength:null,exactLength:null,typeName:ai.ZodArray,...ki(t)});function CC(e){if(e instanceof Bo){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=B0.create(CC(r))}return new Bo({...e._def,shape:()=>t})}else return e instanceof dm?new dm({...e._def,type:CC(e.element)}):e instanceof B0?B0.create(CC(e.unwrap())):e instanceof Gy?Gy.create(CC(e.unwrap())):e instanceof nx?nx.create(e.items.map(t=>CC(t))):e}class Bo extends Bi{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),n=ua.objectKeys(t);return this._cached={shape:t,keys:n},this._cached}_parse(t){if(this._getType(t)!==Cs.object){const u=this._getOrReturnCtx(t);return us(u,{code:Gr.invalid_type,expected:Cs.object,received:u.parsedType}),ri}const{status:r,ctx:s}=this._processInputParams(t),{shape:a,keys:o}=this._getCached(),l=[];if(!(this._def.catchall instanceof h1&&this._def.unknownKeys==="strip"))for(const u in s.data)o.includes(u)||l.push(u);const c=[];for(const u of o){const d=a[u],f=s.data[u];c.push({key:{status:"valid",value:u},value:d._parse(new tx(s,f,s.path,u)),alwaysSet:u in s.data})}if(this._def.catchall instanceof h1){const u=this._def.unknownKeys;if(u==="passthrough")for(const d of l)c.push({key:{status:"valid",value:d},value:{status:"valid",value:s.data[d]}});else if(u==="strict")l.length>0&&(us(s,{code:Gr.unrecognized_keys,keys:l}),r.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const u=this._def.catchall;for(const d of l){const f=s.data[d];c.push({key:{status:"valid",value:d},value:u._parse(new tx(s,f,s.path,d)),alwaysSet:d in s.data})}}return s.common.async?Promise.resolve().then(async()=>{const u=[];for(const d of c){const f=await d.key,x=await d.value;u.push({key:f,value:x,alwaysSet:d.alwaysSet})}return u}).then(u=>Lu.mergeObjectSync(r,u)):Lu.mergeObjectSync(r,c)}get shape(){return this._def.shape()}strict(t){return Ls.errToObj,new Bo({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,r)=>{var a,o;const s=((o=(a=this._def).errorMap)==null?void 0:o.call(a,n,r).message)??r.defaultError;return n.code==="unrecognized_keys"?{message:Ls.errToObj(t).message??s}:{message:s}}}:{}})}strip(){return new Bo({...this._def,unknownKeys:"strip"})}passthrough(){return new Bo({...this._def,unknownKeys:"passthrough"})}extend(t){return new Bo({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new Bo({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:ai.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new Bo({...this._def,catchall:t})}pick(t){const n={};for(const r of ua.objectKeys(t))t[r]&&this.shape[r]&&(n[r]=this.shape[r]);return new Bo({...this._def,shape:()=>n})}omit(t){const n={};for(const r of ua.objectKeys(this.shape))t[r]||(n[r]=this.shape[r]);return new Bo({...this._def,shape:()=>n})}deepPartial(){return CC(this)}partial(t){const n={};for(const r of ua.objectKeys(this.shape)){const s=this.shape[r];t&&!t[r]?n[r]=s:n[r]=s.optional()}return new Bo({...this._def,shape:()=>n})}required(t){const n={};for(const r of ua.objectKeys(this.shape))if(t&&!t[r])n[r]=this.shape[r];else{let a=this.shape[r];for(;a instanceof B0;)a=a._def.innerType;n[r]=a}return new Bo({...this._def,shape:()=>n})}keyof(){return LPe(ua.objectKeys(this.shape))}}Bo.create=(e,t)=>new Bo({shape:()=>e,unknownKeys:"strip",catchall:h1.create(),typeName:ai.ZodObject,...ki(t)});Bo.strictCreate=(e,t)=>new Bo({shape:()=>e,unknownKeys:"strict",catchall:h1.create(),typeName:ai.ZodObject,...ki(t)});Bo.lazycreate=(e,t)=>new Bo({shape:e,unknownKeys:"strip",catchall:h1.create(),typeName:ai.ZodObject,...ki(t)});class jE extends Bi{_parse(t){const{ctx:n}=this._processInputParams(t),r=this._def.options;function s(a){for(const l of a)if(l.result.status==="valid")return l.result;for(const l of a)if(l.result.status==="dirty")return n.common.issues.push(...l.ctx.common.issues),l.result;const o=a.map(l=>new Wf(l.ctx.common.issues));return us(n,{code:Gr.invalid_union,unionErrors:o}),ri}if(n.common.async)return Promise.all(r.map(async a=>{const o={...n,common:{...n.common,issues:[]},parent:null};return{result:await a._parseAsync({data:n.data,path:n.path,parent:o}),ctx:o}})).then(s);{let a;const o=[];for(const c of r){const u={...n,common:{...n.common,issues:[]},parent:null},d=c._parseSync({data:n.data,path:n.path,parent:u});if(d.status==="valid")return d;d.status==="dirty"&&!a&&(a={result:d,ctx:u}),u.common.issues.length&&o.push(u.common.issues)}if(a)return n.common.issues.push(...a.ctx.common.issues),a.result;const l=o.map(c=>new Wf(c));return us(n,{code:Gr.invalid_union,unionErrors:l}),ri}}get options(){return this._def.options}}jE.create=(e,t)=>new jE({options:e,typeName:ai.ZodUnion,...ki(t)});const ig=e=>e instanceof kE?ig(e.schema):e instanceof ym?ig(e.innerType()):e instanceof TE?[e.value]:e instanceof qy?e.options:e instanceof IE?ua.objectValues(e.enum):e instanceof PE?ig(e._def.innerType):e instanceof NE?[void 0]:e instanceof AE?[null]:e instanceof B0?[void 0,...ig(e.unwrap())]:e instanceof Gy?[null,...ig(e.unwrap())]:e instanceof Kae||e instanceof OE?ig(e.unwrap()):e instanceof FE?ig(e._def.innerType):[];class QB extends Bi{_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==Cs.object)return us(n,{code:Gr.invalid_type,expected:Cs.object,received:n.parsedType}),ri;const r=this.discriminator,s=n.data[r],a=this.optionsMap.get(s);return a?n.common.async?a._parseAsync({data:n.data,path:n.path,parent:n}):a._parseSync({data:n.data,path:n.path,parent:n}):(us(n,{code:Gr.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),ri)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,r){const s=new Map;for(const a of n){const o=ig(a.shape[t]);if(!o.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const l of o){if(s.has(l))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(l)}`);s.set(l,a)}}return new QB({typeName:ai.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:s,...ki(r)})}}function xee(e,t){const n=fg(e),r=fg(t);if(e===t)return{valid:!0,data:e};if(n===Cs.object&&r===Cs.object){const s=ua.objectKeys(t),a=ua.objectKeys(e).filter(l=>s.indexOf(l)!==-1),o={...e,...t};for(const l of a){const c=xee(e[l],t[l]);if(!c.valid)return{valid:!1};o[l]=c.data}return{valid:!0,data:o}}else if(n===Cs.array&&r===Cs.array){if(e.length!==t.length)return{valid:!1};const s=[];for(let a=0;a<e.length;a++){const o=e[a],l=t[a],c=xee(o,l);if(!c.valid)return{valid:!1};s.push(c.data)}return{valid:!0,data:s}}else return n===Cs.date&&r===Cs.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class EE extends Bi{_parse(t){const{status:n,ctx:r}=this._processInputParams(t),s=(a,o)=>{if(pee(a)||pee(o))return ri;const l=xee(a.value,o.value);return l.valid?((mee(a)||mee(o))&&n.dirty(),{status:n.value,value:l.data}):(us(r,{code:Gr.invalid_intersection_types}),ri)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([a,o])=>s(a,o)):s(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}EE.create=(e,t,n)=>new EE({left:e,right:t,typeName:ai.ZodIntersection,...ki(n)});class nx extends Bi{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Cs.array)return us(r,{code:Gr.invalid_type,expected:Cs.array,received:r.parsedType}),ri;if(r.data.length<this._def.items.length)return us(r,{code:Gr.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),ri;!this._def.rest&&r.data.length>this._def.items.length&&(us(r,{code:Gr.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const a=[...r.data].map((o,l)=>{const c=this._def.items[l]||this._def.rest;return c?c._parse(new tx(r,o,r.path,l)):null}).filter(o=>!!o);return r.common.async?Promise.all(a).then(o=>Lu.mergeArray(n,o)):Lu.mergeArray(n,a)}get items(){return this._def.items}rest(t){return new nx({...this._def,rest:t})}}nx.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new nx({items:e,typeName:ai.ZodTuple,rest:null,...ki(t)})};class _E extends Bi{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Cs.object)return us(r,{code:Gr.invalid_type,expected:Cs.object,received:r.parsedType}),ri;const s=[],a=this._def.keyType,o=this._def.valueType;for(const l in r.data)s.push({key:a._parse(new tx(r,l,r.path,l)),value:o._parse(new tx(r,r.data[l],r.path,l)),alwaysSet:l in r.data});return r.common.async?Lu.mergeObjectAsync(n,s):Lu.mergeObjectSync(n,s)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof Bi?new _E({keyType:t,valueType:n,typeName:ai.ZodRecord,...ki(r)}):new _E({keyType:om.create(),valueType:t,typeName:ai.ZodRecord,...ki(n)})}}class rR extends Bi{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Cs.map)return us(r,{code:Gr.invalid_type,expected:Cs.map,received:r.parsedType}),ri;const s=this._def.keyType,a=this._def.valueType,o=[...r.data.entries()].map(([l,c],u)=>({key:s._parse(new tx(r,l,r.path,[u,"key"])),value:a._parse(new tx(r,c,r.path,[u,"value"]))}));if(r.common.async){const l=new Map;return Promise.resolve().then(async()=>{for(const c of o){const u=await c.key,d=await c.value;if(u.status==="aborted"||d.status==="aborted")return ri;(u.status==="dirty"||d.status==="dirty")&&n.dirty(),l.set(u.value,d.value)}return{status:n.value,value:l}})}else{const l=new Map;for(const c of o){const u=c.key,d=c.value;if(u.status==="aborted"||d.status==="aborted")return ri;(u.status==="dirty"||d.status==="dirty")&&n.dirty(),l.set(u.value,d.value)}return{status:n.value,value:l}}}}rR.create=(e,t,n)=>new rR({valueType:t,keyType:e,typeName:ai.ZodMap,...ki(n)});class D3 extends Bi{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Cs.set)return us(r,{code:Gr.invalid_type,expected:Cs.set,received:r.parsedType}),ri;const s=this._def;s.minSize!==null&&r.data.size<s.minSize.value&&(us(r,{code:Gr.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),n.dirty()),s.maxSize!==null&&r.data.size>s.maxSize.value&&(us(r,{code:Gr.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),n.dirty());const a=this._def.valueType;function o(c){const u=new Set;for(const d of c){if(d.status==="aborted")return ri;d.status==="dirty"&&n.dirty(),u.add(d.value)}return{status:n.value,value:u}}const l=[...r.data.values()].map((c,u)=>a._parse(new tx(r,c,r.path,u)));return r.common.async?Promise.all(l).then(c=>o(c)):o(l)}min(t,n){return new D3({...this._def,minSize:{value:t,message:Ls.toString(n)}})}max(t,n){return new D3({...this._def,maxSize:{value:t,message:Ls.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}}D3.create=(e,t)=>new D3({valueType:e,minSize:null,maxSize:null,typeName:ai.ZodSet,...ki(t)});class l4 extends Bi{constructor(){super(...arguments),this.validate=this.implement}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==Cs.function)return us(n,{code:Gr.invalid_type,expected:Cs.function,received:n.parsedType}),ri;function r(l,c){return eR({data:l,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,JM(),JS].filter(u=>!!u),issueData:{code:Gr.invalid_arguments,argumentsError:c}})}function s(l,c){return eR({data:l,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,JM(),JS].filter(u=>!!u),issueData:{code:Gr.invalid_return_type,returnTypeError:c}})}const a={errorMap:n.common.contextualErrorMap},o=n.data;if(this._def.returns instanceof tN){const l=this;return xd(async function(...c){const u=new Wf([]),d=await l._def.args.parseAsync(c,a).catch(g=>{throw u.addIssue(r(c,g)),u}),f=await Reflect.apply(o,this,d);return await l._def.returns._def.type.parseAsync(f,a).catch(g=>{throw u.addIssue(s(f,g)),u})})}else{const l=this;return xd(function(...c){const u=l._def.args.safeParse(c,a);if(!u.success)throw new Wf([r(c,u.error)]);const d=Reflect.apply(o,this,u.data),f=l._def.returns.safeParse(d,a);if(!f.success)throw new Wf([s(d,f.error)]);return f.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new l4({...this._def,args:nx.create(t).rest(Jw.create())})}returns(t){return new l4({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,n,r){return new l4({args:t||nx.create([]).rest(Jw.create()),returns:n||Jw.create(),typeName:ai.ZodFunction,...ki(r)})}}class kE extends Bi{get schema(){return this._def.getter()}_parse(t){const{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}kE.create=(e,t)=>new kE({getter:e,typeName:ai.ZodLazy,...ki(t)});class TE extends Bi{_parse(t){if(t.data!==this._def.value){const n=this._getOrReturnCtx(t);return us(n,{received:n.data,code:Gr.invalid_literal,expected:this._def.value}),ri}return{status:"valid",value:t.data}}get value(){return this._def.value}}TE.create=(e,t)=>new TE({value:e,typeName:ai.ZodLiteral,...ki(t)});function LPe(e,t){return new qy({values:e,typeName:ai.ZodEnum,...ki(t)})}class qy extends Bi{_parse(t){if(typeof t.data!="string"){const n=this._getOrReturnCtx(t),r=this._def.values;return us(n,{expected:ua.joinValues(r),received:n.parsedType,code:Gr.invalid_type}),ri}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){const n=this._getOrReturnCtx(t),r=this._def.values;return us(n,{received:n.data,code:Gr.invalid_enum_value,options:r}),ri}return xd(t.data)}get options(){return this._def.values}get enum(){const t={};for(const n of this._def.values)t[n]=n;return t}get Values(){const t={};for(const n of this._def.values)t[n]=n;return t}get Enum(){const t={};for(const n of this._def.values)t[n]=n;return t}extract(t,n=this._def){return qy.create(t,{...this._def,...n})}exclude(t,n=this._def){return qy.create(this.options.filter(r=>!t.includes(r)),{...this._def,...n})}}qy.create=LPe;class IE extends Bi{_parse(t){const n=ua.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==Cs.string&&r.parsedType!==Cs.number){const s=ua.objectValues(n);return us(r,{expected:ua.joinValues(s),received:r.parsedType,code:Gr.invalid_type}),ri}if(this._cache||(this._cache=new Set(ua.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){const s=ua.objectValues(n);return us(r,{received:r.data,code:Gr.invalid_enum_value,options:s}),ri}return xd(t.data)}get enum(){return this._def.values}}IE.create=(e,t)=>new IE({values:e,typeName:ai.ZodNativeEnum,...ki(t)});class tN extends Bi{unwrap(){return this._def.type}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==Cs.promise&&n.common.async===!1)return us(n,{code:Gr.invalid_type,expected:Cs.promise,received:n.parsedType}),ri;const r=n.parsedType===Cs.promise?n.data:Promise.resolve(n.data);return xd(r.then(s=>this._def.type.parseAsync(s,{path:n.path,errorMap:n.common.contextualErrorMap})))}}tN.create=(e,t)=>new tN({type:e,typeName:ai.ZodPromise,...ki(t)});class ym extends Bi{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ai.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:n,ctx:r}=this._processInputParams(t),s=this._def.effect||null,a={addIssue:o=>{us(r,o),o.fatal?n.abort():n.dirty()},get path(){return r.path}};if(a.addIssue=a.addIssue.bind(a),s.type==="preprocess"){const o=s.transform(r.data,a);if(r.common.async)return Promise.resolve(o).then(async l=>{if(n.value==="aborted")return ri;const c=await this._def.schema._parseAsync({data:l,path:r.path,parent:r});return c.status==="aborted"?ri:c.status==="dirty"||n.value==="dirty"?RC(c.value):c});{if(n.value==="aborted")return ri;const l=this._def.schema._parseSync({data:o,path:r.path,parent:r});return l.status==="aborted"?ri:l.status==="dirty"||n.value==="dirty"?RC(l.value):l}}if(s.type==="refinement"){const o=l=>{const c=s.refinement(l,a);if(r.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return l};if(r.common.async===!1){const l=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return l.status==="aborted"?ri:(l.status==="dirty"&&n.dirty(),o(l.value),{status:n.value,value:l.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(l=>l.status==="aborted"?ri:(l.status==="dirty"&&n.dirty(),o(l.value).then(()=>({status:n.value,value:l.value}))))}if(s.type==="transform")if(r.common.async===!1){const o=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!R3(o))return ri;const l=s.transform(o.value,a);if(l instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:l}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(o=>R3(o)?Promise.resolve(s.transform(o.value,a)).then(l=>({status:n.value,value:l})):ri);ua.assertNever(s)}}ym.create=(e,t,n)=>new ym({schema:e,typeName:ai.ZodEffects,effect:t,...ki(n)});ym.createWithPreprocess=(e,t,n)=>new ym({schema:t,effect:{type:"preprocess",transform:e},typeName:ai.ZodEffects,...ki(n)});class B0 extends Bi{_parse(t){return this._getType(t)===Cs.undefined?xd(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}B0.create=(e,t)=>new B0({innerType:e,typeName:ai.ZodOptional,...ki(t)});class Gy extends Bi{_parse(t){return this._getType(t)===Cs.null?xd(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Gy.create=(e,t)=>new Gy({innerType:e,typeName:ai.ZodNullable,...ki(t)});class PE extends Bi{_parse(t){const{ctx:n}=this._processInputParams(t);let r=n.data;return n.parsedType===Cs.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}PE.create=(e,t)=>new PE({innerType:e,typeName:ai.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...ki(t)});class FE extends Bi{_parse(t){const{ctx:n}=this._processInputParams(t),r={...n,common:{...n.common,issues:[]}},s=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return CE(s)?s.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new Wf(r.common.issues)},input:r.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Wf(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}FE.create=(e,t)=>new FE({innerType:e,typeName:ai.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...ki(t)});class sR extends Bi{_parse(t){if(this._getType(t)!==Cs.nan){const r=this._getOrReturnCtx(t);return us(r,{code:Gr.invalid_type,expected:Cs.nan,received:r.parsedType}),ri}return{status:"valid",value:t.data}}}sR.create=e=>new sR({typeName:ai.ZodNaN,...ki(e)});const YAt=Symbol("zod_brand");class Kae extends Bi{_parse(t){const{ctx:n}=this._processInputParams(t),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class Zk extends Bi{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.common.async)return(async()=>{const a=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?ri:a.status==="dirty"?(n.dirty(),RC(a.value)):this._def.out._parseAsync({data:a.value,path:r.path,parent:r})})();{const s=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?ri:s.status==="dirty"?(n.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:r.path,parent:r})}}static create(t,n){return new Zk({in:t,out:n,typeName:ai.ZodPipeline})}}class OE extends Bi{_parse(t){const n=this._def.innerType._parse(t),r=s=>(R3(s)&&(s.value=Object.freeze(s.value)),s);return CE(n)?n.then(s=>r(s)):r(n)}unwrap(){return this._def.innerType}}OE.create=(e,t)=>new OE({innerType:e,typeName:ai.ZodReadonly,...ki(t)});function tge(e,t){const n=typeof e=="function"?e(t):typeof e=="string"?{message:e}:e;return typeof n=="string"?{message:n}:n}function DPe(e,t={},n){return e?eN.create().superRefine((r,s)=>{const a=e(r);if(a instanceof Promise)return a.then(o=>{if(!o){const l=tge(t,r),c=l.fatal??n??!0;s.addIssue({code:"custom",...l,fatal:c})}});if(!a){const o=tge(t,r),l=o.fatal??n??!0;s.addIssue({code:"custom",...o,fatal:l})}}):eN.create()}const XAt={object:Bo.lazycreate};var ai;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(ai||(ai={}));const QAt=(e,t={message:`Input not instance of ${e.name}`})=>DPe(n=>n instanceof e,t),BPe=om.create,$Pe=Vy.create,ZAt=sR.create,JAt=Wy.create,UPe=SE.create,e8t=L3.create,t8t=tR.create,n8t=NE.create,r8t=AE.create,gee=eN.create,s8t=Jw.create,i8t=h1.create,a8t=nR.create,zPe=dm.create,fO=Bo.create,o8t=Bo.strictCreate,HPe=jE.create,l8t=QB.create,c8t=EE.create,VPe=nx.create,u8t=_E.create,d8t=rR.create,f8t=D3.create,h8t=l4.create,p8t=kE.create,m8t=TE.create,x8t=qy.create,g8t=IE.create,b8t=tN.create,nge=ym.create,y8t=B0.create,v8t=Gy.create,w8t=ym.createWithPreprocess,C8t=Zk.create,S8t=()=>BPe().optional(),N8t=()=>$Pe().optional(),A8t=()=>UPe().optional(),j8t={string:e=>om.create({...e,coerce:!0}),number:e=>Vy.create({...e,coerce:!0}),boolean:e=>SE.create({...e,coerce:!0}),bigint:e=>Wy.create({...e,coerce:!0}),date:e=>L3.create({...e,coerce:!0})},E8t=ri,rge=Object.freeze(Object.defineProperty({__proto__:null,BRAND:YAt,DIRTY:RC,EMPTY_PATH:EAt,INVALID:ri,NEVER:E8t,OK:xd,ParseStatus:Lu,Schema:Bi,ZodAny:eN,ZodArray:dm,ZodBigInt:Wy,ZodBoolean:SE,ZodBranded:Kae,ZodCatch:FE,ZodDate:L3,ZodDefault:PE,ZodDiscriminatedUnion:QB,ZodEffects:ym,ZodEnum:qy,ZodError:Wf,get ZodFirstPartyTypeKind(){return ai},ZodFunction:l4,ZodIntersection:EE,ZodIssueCode:Gr,ZodLazy:kE,ZodLiteral:TE,ZodMap:rR,ZodNaN:sR,ZodNativeEnum:IE,ZodNever:h1,ZodNull:AE,ZodNullable:Gy,ZodNumber:Vy,ZodObject:Bo,ZodOptional:B0,ZodParsedType:Cs,ZodPipeline:Zk,ZodPromise:tN,ZodReadonly:OE,ZodRecord:_E,ZodSchema:Bi,ZodSet:D3,ZodString:om,ZodSymbol:tR,ZodTransformer:ym,ZodTuple:nx,ZodType:Bi,ZodUndefined:NE,ZodUnion:jE,ZodUnknown:Jw,ZodVoid:nR,addIssueToContext:us,any:gee,array:zPe,bigint:JAt,boolean:UPe,coerce:j8t,custom:DPe,date:e8t,datetimeRegex:RPe,defaultErrorMap:JS,discriminatedUnion:l8t,effect:nge,enum:x8t,function:h8t,getErrorMap:JM,getParsedType:fg,instanceof:QAt,intersection:c8t,isAborted:pee,isAsync:CE,isDirty:mee,isValid:R3,late:XAt,lazy:p8t,literal:m8t,makeIssue:eR,map:d8t,nan:ZAt,nativeEnum:g8t,never:i8t,null:r8t,nullable:v8t,number:$Pe,object:fO,get objectUtil(){return hee},oboolean:A8t,onumber:N8t,optional:y8t,ostring:S8t,pipeline:C8t,preprocess:w8t,promise:b8t,quotelessJson:AAt,record:u8t,set:f8t,setErrorMap:jAt,strictObject:o8t,string:BPe,symbol:t8t,transformer:nge,tuple:VPe,undefined:n8t,union:HPe,unknown:s8t,get util(){return ua},void:a8t},Symbol.toStringTag,{value:"Module"})),_8t=e=>e.message?e.message:"unspecified error";class nN extends di{constructor(t){super(),this.code=YSt,this.errors=t,super.message=`Web3 validator found ${t.length} error[s]:
${this._compileErrors().join(`
`)}`}_compileErrors(){return this.errors.map(_8t)}}const k8t=["bool","int","uint","bytes","string","address","tuple"],WPe=e=>typeof e=="object"&&"type"in e&&"name"in e,Yae=e=>typeof e=="string",Aa=e=>typeof e=="string"&&/^((-)?0x[0-9a-f]+|(0x))$/i.test(e);function qPe(e,t){return!(typeof e!="string"||!e.match(/^0x[0-9A-Fa-f]*$/))}const iR=e=>typeof e=="number"||typeof e=="bigint"||typeof e=="string"&&/^((-0x|0x|-)?[0-9a-f]+|(0x))$/i.test(e);function Xae(e){if(typeof e!="string")throw new Error(`[isHexPrefixed] input must be type 'string', received type ${typeof e}`);return e.startsWith("0x")}const Qae=function(e){for(const[t,n]of Object.entries(e))if(n!==void 0&&n.length>0&&n[0]===0)throw new Error(`${t} cannot have leading zeroes, received: ${n.toString()}`)},T8t=["hex","number","blockNumber","blockNumberOrTag","filter","bloom"],h5=e=>{let t=e.replace(/ /,""),n,r=!1,s=[];if(e.includes("[")&&(t=t.slice(0,t.indexOf("[")),s=[...e.matchAll(/(?:\[(\d*)\])/g)].map(a=>parseInt(a[1],10)).map(a=>Number.isNaN(a)?-1:a),r=s.length>0),k8t.includes(t))return{baseType:t,isArray:r,baseTypeSize:n,arraySizes:s};if(t.startsWith("int"))n=parseInt(t.substring(3),10),t="int";else if(t.startsWith("uint"))n=parseInt(e.substring(4),10),t="uint";else if(t.startsWith("bytes"))n=parseInt(t.substring(5),10),t="bytes";else return{baseType:void 0,isArray:!1,baseTypeSize:void 0,arraySizes:s};return{baseType:t,isArray:r,baseTypeSize:n,arraySizes:s}},oV=(e,t={})=>{if(Object.keys(t).includes("type"))throw new nN([{keyword:"eth",message:'Either "eth" or "type" can be presented in schema',params:{eth:e},instancePath:"",schemaPath:""}]);const{baseType:r,baseTypeSize:s}=h5(e);if(!r&&!T8t.includes(e))throw new nN([{keyword:"eth",message:`Eth data type "${e}" is not valid`,params:{eth:e},instancePath:"",schemaPath:""}]);if(r){if(r==="tuple")throw new Error('"tuple" type is not implemented directly.');return{format:`${r}${s??""}`,required:!0}}return e?{format:e,required:!0}:{}},aR=(e,t="/0")=>{const n={type:"array",items:[],maxItems:e.length,minItems:e.length};for(const[r,s]of e.entries()){let a,o,l=[];WPe(s)?(a=s.type,o=s.name||`${t}/${r}`,l=s.components):typeof s=="string"?(a=s,o=`${t}/${r}`):Array.isArray(s)&&(s[0]&&typeof s[0]=="string"&&s[0].startsWith("tuple")&&!Array.isArray(s[0])&&s[1]&&Array.isArray(s[1])?(a=s[0],o=`${t}/${r}`,l=s[1]):(a="tuple",o=`${t}/${r}`,l=s));const{baseType:c,isArray:u,arraySizes:d}=h5(a);let f,x=n;for(let g=d.length-1;g>0;g-=1)f={type:"array",$id:o,items:[],maxItems:d[g],minItems:d[g]},d[g]<0&&(delete f.maxItems,delete f.minItems),Array.isArray(x.items)?x.items.length===0?x.items=[f]:x.items.push(f):x.items=[x.items,f],x=f;if(c==="tuple"&&!u){const g=aR(l,o);g.$id=o,x.items.push(g)}else if(c==="tuple"&&u){const g=d[0],v=Object.assign({type:"array",$id:o,items:aR(l,o)},g>=0&&{minItems:g,maxItems:g});x.items.push(v)}else if(u){const g=d[0],v=Object.assign({type:"array",$id:o,items:oV(a)},g>=0&&{minItems:g,maxItems:g});x.items.push(v)}else Array.isArray(x.items)?x.items.push(Object.assign({$id:o},oV(a))):x.items.push(Object.assign({$id:o},oV(a)));x=n}return n},Zae=e=>aR(e),Jae=(e,t)=>t===1?e:Jae(e[0],t-1),Zj=(e,t,n)=>{const r=[];for(const[s,a]of e.entries()){let o,l,c=[];WPe(a)?(o=a.type,l=a.name,c=a.components):typeof a=="string"?o=a:Array.isArray(a)&&(a[1]&&Array.isArray(a[1])?(o=a[0],c=a[1]):(o="tuple",c=a));const{baseType:u,isArray:d,arraySizes:f}=h5(o),x=Array.isArray(t)?t[s]:t[l];if(u==="tuple"&&!d)r.push(Zj(c,x,n));else if(u==="tuple"&&d){const g=[];for(const v of x)if(f.length>1){const w=Jae(v,f.length-1),C=[];for(const N of w)C.push(Zj(c,N,n));g.push(C)}else g.push(Zj(c,v,n));r.push(g)}else r.push(x)}return n=n??[],n.push(...r),n},GPe=e=>{if(e>=48&&e<=57)return e-48;if(e>=65&&e<=70)return e-55;if(e>=97&&e<=102)return e-87;throw new Error(`Invalid code point: ${e}`)},ZB=e=>{if(!Aa(e))throw new Error("Invalid hex string");const[t,n]=e.startsWith("-")?[!0,e.slice(1)]:[!1,e],r=BigInt(n);return r>Number.MAX_SAFE_INTEGER?t?-r:r:r<Number.MIN_SAFE_INTEGER?r:t?-1*Number(r):Number(r)},JB=e=>{if((typeof e=="number"||typeof e=="bigint")&&e<0)return`-0x${e.toString(16).slice(1)}`;if((typeof e=="number"||typeof e=="bigint")&&e>=0)return`0x${e.toString(16)}`;if(typeof e=="string"&&Aa(e)){const[t,n]=e.startsWith("-")?[!0,e.slice(1)]:[!1,e],r=n.split(/^(-)?0(x|X)/).slice(-1)[0];return`${t?"-":""}0x${r.replace(/^0+/,"").toLowerCase()}`}if(typeof e=="string"&&!Aa(e))return JB(BigInt(e));throw new Uae(e)},oR=(e,t,n="0")=>{if(typeof e=="string"&&!Aa(e))return e.padStart(t,n);const r=typeof e=="string"&&Aa(e)?e:JB(e),[s,a]=r.startsWith("-")?["-0x",r.slice(3)]:["0x",r.slice(2)];return`${s}${a.padStart(t,n)}`};function A1(e){let t="0x";for(const n of e){const r=n.toString(16);t+=r.length===1?`0${r}`:r}return t}const zx={zero:48,nine:57,A:65,F:70,a:97,f:102};function sge(e){if(e>=zx.zero&&e<=zx.nine)return e-zx.zero;if(e>=zx.A&&e<=zx.F)return e-(zx.A-10);if(e>=zx.a&&e<=zx.f)return e-(zx.a-10)}function p5(e){let t=0;if(e.startsWith("0")&&(e[1]==="x"||e[1]==="X")&&(t=2),e.length%2!==0)throw new o4(`hex string has odd length: ${e}`);const n=(e.length-t)/2,r=new Uint8Array(n);for(let s=0,a=t;s<n;s+=1){const o=sge(e.charCodeAt(a++)),l=sge(e.charCodeAt(a++));if(o===void 0||l===void 0)throw new o4(`Invalid byte sequence ("${e[a-2]}${e[a-1]}" in "${e}").`);r[s]=o*16+l}return r}function e$(e){var t;return!(e instanceof Uint8Array)&&((t=e==null?void 0:e.constructor)===null||t===void 0?void 0:t.name)==="Uint8Array"?Uint8Array.from(e):e}const KPe=Object.freeze(Object.defineProperty({__proto__:null,abiSchemaToJsonSchema:aR,codePointToInt:GPe,ensureIfUint8Array:e$,ethAbiToJsonSchema:Zae,fetchArrayElement:Jae,hexToNumber:ZB,hexToUint8Array:p5,numberToHex:JB,padLeft:oR,parseBaseType:h5,transformJsonDataToAbiFormat:Zj,uint8ArrayToHexString:A1},Symbol.toStringTag,{value:"Module"})),bee=e=>{var t,n;return e instanceof Uint8Array||((t=e==null?void 0:e.constructor)===null||t===void 0?void 0:t.name)==="Uint8Array"||((n=e==null?void 0:e.constructor)===null||n===void 0?void 0:n.name)==="Buffer"},c2=(e,t={abiType:"bytes"})=>{if(typeof e!="string"&&!Array.isArray(e)&&!bee(e)||typeof e=="string"&&Aa(e)&&e.startsWith("-")||typeof e=="string"&&!Aa(e))return!1;let n;if(typeof e=="string"){if(e.length%2!==0)return!1;n=p5(e)}else if(Array.isArray(e)){if(e.some(r=>r<0||r>255||!Number.isInteger(r)))return!1;n=new Uint8Array(e)}else n=e;if(t!=null&&t.abiType){const{baseTypeSize:r}=h5(t.abiType);return r?n.length===r:!0}return t!=null&&t.size?n.length===(t==null?void 0:t.size):!0},YPe=e=>{if(!/^(0x)?[0-9a-f]{40}$/i.test(e))return!1;const t=e.slice(2),n=QS(t.toLowerCase()),r=A1(od(e$(n))).slice(2);for(let s=0;s<40;s+=1)if(parseInt(r[s],16)>7&&t[s].toUpperCase()!==t[s]||parseInt(r[s],16)<=7&&t[s].toLowerCase()!==t[s])return!1;return!0},Kf=(e,t=!0)=>{if(typeof e!="string"&&!bee(e))return!1;let n;return bee(e)?n=A1(e):typeof e=="string"&&!Aa(e)?n=e.toLowerCase().startsWith("0x")?e:`0x${e}`:n=e,/^(0x)?[0-9a-f]{40}$/i.test(n)?/^(0x|0X)?[0-9a-f]{40}$/.test(n)||/^(0x|0X)?[0-9A-F]{40}$/.test(n)?!0:t?YPe(n):!0:!1},B3=(e,t)=>{if(t===BigInt(0))return BigInt(1);let n=e;for(let r=1;r<t;r+=1)n*=e;return n},p1=(e,t={abiType:"uint"})=>{if(!["number","string","bigint"].includes(typeof e)||typeof e=="string"&&e.length===0)return!1;let n;if(t!=null&&t.abiType){const{baseTypeSize:s}=h5(t.abiType);s&&(n=s)}else t.bitSize&&(n=t.bitSize);const r=B3(BigInt(2),BigInt(n??256))-BigInt(1);try{const s=typeof e=="string"&&Aa(e)?BigInt(ZB(e)):BigInt(e);return s>=0&&s<=r}catch{return!1}},ME=(e,t={abiType:"int"})=>{if(!["number","string","bigint"].includes(typeof e)||typeof e=="number"&&e>Number.MAX_SAFE_INTEGER)return!1;let n;if(t!=null&&t.abiType){const{baseTypeSize:a,baseType:o}=h5(t.abiType);if(o!=="int")return!1;a&&(n=a)}else t.bitSize&&(n=t.bitSize);const r=B3(BigInt(2),BigInt((n??256)-1)),s=BigInt(-1)*B3(BigInt(2),BigInt((n??256)-1));try{const a=typeof e=="string"&&Aa(e)?BigInt(ZB(e)):BigInt(e);return a>=s&&a<=r}catch{return!1}},XPe=e=>!!(ME(e)||typeof e=="string"&&/[0-9.]/.test(e)&&e.indexOf(".")===e.lastIndexOf(".")||typeof e=="number"),QPe=e=>p1(e),Mc=e=>Object.values(Tg).includes(e),yee=e=>Mc(e)||QPe(e),RA=e=>typeof e!="string"||!/^(0x)?[0-9a-f]{512}$/i.test(e)?!1:!!(/^(0x)?[0-9a-f]{512}$/.test(e)||/^(0x)?[0-9A-F]{512}$/.test(e)),t$=(e,t)=>{if(typeof t=="string"&&!Aa(t)||!RA(e))return!1;const n=typeof t=="string"?p5(t):t,r=A1(od(n)).slice(2);for(let s=0;s<12;s+=4){const a=(parseInt(r.slice(s,s+2),16)<<8)+parseInt(r.slice(s+2,s+4),16)&2047,o=GPe(e.charCodeAt(e.length-1-Math.floor(a/4))),l=1<<a%4;if((o&l)!==l)return!1}return!0},I8t=(e,t)=>{if(!RA(e)||!Kf(t))return!1;const n=oR(t,64);return t$(e,n)},P8t=(e,t)=>!RA(e)||!Kf(t)?!1:t$(e,t),F8t=e=>["number","string","boolean"].includes(typeof e)?typeof e=="boolean"?!0:typeof e=="string"&&!Aa(e)?e==="1"||e==="0":typeof e=="string"&&Aa(e)?e==="0x1"||e==="0x0":e===1||e===0:!1,pr=e=>e==null,rN=e=>typeof e=="object"&&!pr(e)&&!Array.isArray(e)&&!(e instanceof Bae),lR=e=>typeof e!="string"||!/^(0x)?[0-9a-f]{64}$/i.test(e)?!1:!!(/^(0x)?[0-9a-f]{64}$/.test(e)||/^(0x)?[0-9A-F]{64}$/.test(e)),O8t=(e,t)=>!RA(e)||!lR(t)?!1:t$(e,t),M8t=e=>{const t=["fromBlock","toBlock","address","topics","blockHash"];if(pr(e)||typeof e!="object"||!Object.keys(e).every(n=>t.includes(n))||!pr(e.fromBlock)&&!yee(e.fromBlock)||!pr(e.toBlock)&&!yee(e.toBlock))return!1;if(!pr(e.address)){if(Array.isArray(e.address)){if(!e.address.every(n=>Kf(n)))return!1}else if(!Kf(e.address))return!1}return!(!pr(e.topics)&&!e.topics.every(n=>pr(n)?!0:Array.isArray(n)?n.every(r=>lR(r)):!!lR(n)))},$3={address:e=>Kf(e),bloom:e=>RA(e),blockNumber:e=>QPe(e),blockTag:e=>Mc(e),blockNumberOrTag:e=>yee(e),bool:e=>F8t(e),bytes:e=>c2(e),filter:e=>M8t(e),hex:e=>Aa(e),uint:e=>p1(e),int:e=>ME(e),number:e=>XPe(e),string:e=>Yae(e)};for(let e=8;e<=256;e+=8)$3[`int${e}`]=t=>ME(t,{bitSize:e}),$3[`uint${e}`]=t=>p1(t,{bitSize:e});for(let e=1;e<=32;e+=1)$3[`bytes${e}`]=t=>c2(t,{size:e});$3.bytes256=$3.bytes;const Cj=e=>{if((!(e!=null&&e.type)||(e==null?void 0:e.type)==="object")&&(e!=null&&e.properties)){const t={};for(const n of Object.keys(e.properties)){const r=Cj(e.properties[n]);r&&(t[n]=r)}return Array.isArray(e.required)?fO(t).partial().required(e.required.reduce((n,r)=>Object.assign(Object.assign({},n),{[r]:!0}),{})):fO(t).partial()}if((e==null?void 0:e.type)==="array"&&(e!=null&&e.items)){if(Array.isArray(e.items)&&e.items.length>1&&e.maxItems!==void 0&&new Set(e.items.map(r=>r.$id)).size===e.items.length){const r=[];for(const s of e.items){const a=Cj(s);a&&r.push(a)}return VPe(r)}const t=Array.isArray(e.items)?e.items[0]:e.items;let n=zPe(Cj(t));return n=e.minItems!==void 0?n.min(e.minItems):n,n=e.maxItems!==void 0?n.max(e.maxItems):n,n}if(e.oneOf&&Array.isArray(e.oneOf))return HPe(e.oneOf.map(t=>Cj(t)));if(e!=null&&e.format){if(!$3[e.format])throw new rAt(e.format);return gee().refine($3[e.format],t=>({params:{value:t,format:e.format}}))}return e!=null&&e.type&&(e==null?void 0:e.type)!=="object"&&typeof rge[String(e.type)]=="function"?rge[String(e.type)]():fO({data:gee()}).partial()};class LC{static factory(){return LC.validatorInstance||(LC.validatorInstance=new LC),LC.validatorInstance}validate(t,n,r){var s,a;const l=Cj(t).safeParse(n);if(!l.success){const c=this.convertErrors((a=(s=l.error)===null||s===void 0?void 0:s.issues)!==null&&a!==void 0?a:[]);if(c){if(r!=null&&r.silent)return c;throw new nN(c)}}}convertErrors(t){if(t&&Array.isArray(t)&&t.length>0)return t.map(n=>{var r;let s,a,o,l;l=n.path.join("/");const c=String(n.path[n.path.length-1]),u=n.path.join("/");if(n.code===Gr.too_big)a="maxItems",l=`${u}/maxItems`,o={limit:n.maximum},s=`must NOT have more than ${n.maximum} items`;else if(n.code===Gr.too_small)a="minItems",l=`${u}/minItems`,o={limit:n.minimum},s=`must NOT have fewer than ${n.minimum} items`;else if(n.code===Gr.custom){const{value:d,format:f}=(r=n.params)!==null&&r!==void 0?r:{};typeof d>"u"?s=`value at "/${l}" is required`:s=`value "${typeof d=="object"?JSON.stringify(d):d}" at "/${l}" must pass "${f}" validation`,o={value:d}}return{keyword:a??c,instancePath:u?`/${u}`:"",schemaPath:l?`#${l}`:"#",params:o??{value:n.message},message:s??n.message}})}}class R8t{constructor(){this._validator=LC.factory()}validateJSONSchema(t,n,r){return this._validator.validate(t,n,r)}validate(t,n,r={silent:!1}){var s,a;const o=Zae(t);if(!(Array.isArray(o.items)&&((s=o.items)===null||s===void 0?void 0:s.length)===0&&n.length===0)){if(Array.isArray(o.items)&&((a=o.items)===null||a===void 0?void 0:a.length)===0&&n.length!==0)throw new nN([{instancePath:"/0",schemaPath:"/",keyword:"required",message:"empty schema against data can not be validated",params:n}]);return this._validator.validate(o,n,r)}}}const qs=new R8t;function u2(e){var t,n;return e instanceof Uint8Array||((t=e==null?void 0:e.constructor)===null||t===void 0?void 0:t.name)==="Uint8Array"||((n=e==null?void 0:e.constructor)===null||n===void 0?void 0:n.name)==="Buffer"}function gd(...e){const t=e.reduce((s,a)=>s+a.length,0),n=new Uint8Array(t);let r=0;for(const s of e)n.set(s,r),r+=s.length;return n}function n$(e,t){if(e===t)return!0;if(e.byteLength!==t.byteLength)return!1;for(let n=0;n<e.byteLength;n+=1)if(e[n]!==t[n])return!1;return!0}const r$={noether:BigInt(0),wei:BigInt(1),kwei:BigInt(1e3),Kwei:BigInt(1e3),babbage:BigInt(1e3),femtoether:BigInt(1e3),mwei:BigInt(1e6),Mwei:BigInt(1e6),lovelace:BigInt(1e6),picoether:BigInt(1e6),gwei:BigInt(1e9),Gwei:BigInt(1e9),shannon:BigInt(1e9),nanoether:BigInt(1e9),nano:BigInt(1e9),szabo:BigInt(1e12),microether:BigInt(1e12),micro:BigInt(1e12),finney:BigInt(1e15),milliether:BigInt(1e15),milli:BigInt(1e15),ether:BigInt("1000000000000000000"),kether:BigInt("1000000000000000000000"),grand:BigInt("1000000000000000000000"),mether:BigInt("1000000000000000000000000"),gether:BigInt("1000000000000000000000000000"),tether:BigInt("1000000000000000000000000000000")},vee="Warning: Using type `number` with values that are large or contain many decimals may cause loss of precision, it is recommended to use type `string` or `BigInt` when using conversion methods",rx=e=>{if(qs.validate(["bytes"],[e]),u2(e))return e;if(Array.isArray(e))return new Uint8Array(e);if(typeof e=="string")return p5(e);throw new o4(e)},{uint8ArrayToHexString:L8t}=KPe,Wi=e=>L8t(rx(e)),oo=e=>typeof e=="string"&&e.slice(0,2).toLowerCase()!=="0x"?rx(`0x${e}`):rx(e),Jk=e=>(qs.validate(["hex"],[e]),ZB(e)),D8t=Jk,nc=(e,t)=>{typeof e!="bigint"&&qs.validate(["int"],[e]);let n=JB(e);return t&&(!n.startsWith("-")&&n.length%2===1?n="0x0".concat(n.slice(2)):n.length%2===0&&n.startsWith("-")&&(n="-0x0".concat(n.slice(3)))),n},B8t=nc,$8t=e=>Jk(e).toString(),vm=e=>{qs.validate(["string"],[e]);let t=e.replace(/^(?:\u0000)/,"");return t=t.replace(/(?:\u0000)$/,""),Wi(new TextEncoder().encode(t))},ZPe=vm,U8t=vm,s$=e=>PPe(oo(e)),z8t=e=>typeof e=="string"?s$(e):(qs.validate(["bytes"],[e]),PPe(e)),eoe=QS,H8t=s$,JPe=e=>{qs.validate(["string"],[e]);let t="";for(let n=0;n<e.length;n+=1){const r=e.charCodeAt(n).toString(16);t+=r.length%2!==0?`0${r}`:r}return`0x${t}`},V8t=JPe,eFe=e=>new TextDecoder("ascii").decode(oo(e)),W8t=eFe,m1=(e,t)=>{if(typeof e=="string"&&Kf(e))return t?"address":`0x${e.toLowerCase().replace(/^0x/i,"")}`;if(typeof e=="boolean")return t?"bool":e?"0x01":"0x00";if(typeof e=="number")return t?e<0?"int256":"uint256":nc(e);if(typeof e=="bigint")return t?"bigint":nc(e);if(u2(e))return t?"bytes":Wi(e);if(typeof e=="object"&&e)return t?"string":vm(JSON.stringify(e));if(typeof e=="string"){if(e.startsWith("-0x")||e.startsWith("-0X"))return t?"int256":nc(e);if(Aa(e))return t?"bytes":e;if(iR(e)&&!ME(e)&&!p1(e))return t?"bytes":`0x${e}`;if(iR(e)&&!ME(e)&&p1(e))return t?"uint":nc(e);if(!Number.isFinite(e))return t?"string":vm(e)}throw new $Nt(e)},Xd=e=>{if(typeof e=="number")return e>1e20?(console.warn(vee),BigInt(e)):e;if(typeof e=="bigint")return e>=Number.MIN_SAFE_INTEGER&&e<=Number.MAX_SAFE_INTEGER?Number(e):e;if(typeof e=="string"&&Aa(e))return Jk(e);try{return Xd(BigInt(e))}catch{throw new Uae(e)}},Xv=e=>{if(typeof e=="number")return BigInt(e);if(typeof e=="bigint")return e;if(typeof e=="string"&&iR(e))return e.startsWith("-")?-BigInt(e.substring(1)):BigInt(e);throw new Uae(e)},q8t=(e,t)=>{let n;if(typeof t=="string"){if(n=r$[t],!n)throw new wPe(t)}else{if(t<0||!Number.isInteger(t))throw new CPe(t);n=B3(BigInt(10),BigInt(t))}const r=String(Xd(e)),s=n.toString().length-1;if(s<=0)return r.toString();const a=r.padStart(s,"0"),o=a.slice(0,-s),l=a.slice(-s).replace(/\.?0+$/,"");return o===""?l?`0.${l}`:"0":l===""?o:`${o}.${l}`.slice(0,o.length+s+1)},G8t=(e,t)=>{qs.validate(["number"],[e]);let n;if(typeof t=="string"){if(n=r$[t],!n)throw new wPe(t)}else{if(t<0||!Number.isInteger(t))throw new CPe(t);n=B3(BigInt(10),BigInt(t))}let r=e;typeof r=="number"&&(r<1e-15&&console.warn(vee),r>1e20?(console.warn(vee),r=BigInt(r)):r=r.toLocaleString("fullwide",{useGrouping:!1,maximumFractionDigits:20}));const[s,a]=String(typeof r=="string"&&!Aa(r)?r:Xd(r)).split(".").concat(""),l=BigInt(`${s}${a}`)*n,c=a.length;return c===0?l.toString():l.toString().slice(0,-c)},fx=e=>{if(!Kf(e,!1))throw new zae(e);const t=e.toLowerCase().replace(/^0x/i,""),n=A1(od(e$(eoe(t))));if(pr(n)||n==="0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470")return"";let r="0x";const s=n.replace(/^0x/i,"");for(let a=0;a<t.length;a+=1)parseInt(s[a],16)>7?r+=t[a].toUpperCase():r+=t[a];return r},tFe=e=>{if(typeof e=="boolean")return e;if(typeof e=="number"&&(e===0||e===1)||typeof e=="bigint"&&(e===BigInt(0)||e===BigInt(1)))return!!e;if(typeof e=="string"&&!Aa(e)&&(e==="1"||e==="0"||e==="false"||e==="true"))return e==="true"?!0:e==="false"?!1:!!Number(e);if(typeof e=="string"&&Aa(e)&&(e==="0x1"||e==="0x0"))return!!Xd(e);throw new Hae(e)};let toe=class extends Bie{constructor(){super(...arguments),this.maxListeners=Number.MAX_SAFE_INTEGER}setMaxListeners(t){return this.maxListeners=t,this}getMaxListeners(){return this.maxListeners}};const K8t=Aa,Y8t=iR,X8t=YPe,Q8t=Kf,Z8t=RA,J8t=t$,e7t=I8t,t7t=P8t,n7t=lR,r7t=O8t,s7t=(e,t)=>{const n=typeof e=="string"&&Mc(e),r=typeof t=="string"&&Mc(t);if(e===t||(e==="earliest"||e===0)&&(t==="earliest"||t===0))return 0;if(e==="earliest")return-1;if(t==="earliest")return 1;if(n&&r){const o={[Tg.EARLIEST]:1,[Tg.FINALIZED]:2,[Tg.SAFE]:3,[Tg.LATEST]:4,[Tg.PENDING]:5};return o[e]<o[t]?-1:1}if(n&&!r||!n&&r)throw new zNt("Cannot compare blocktag with provided non-blocktag input.");const s=BigInt(e),a=BigInt(t);return s<a?-1:s===a?0:1},py=e=>typeof e=="object"&&!pr(e)&&Object.keys(e).length!==0&&["input","data","from","gas","gasPrice","gasLimit","address","jsonInterface","syncWithContext","dataInputFill"].some(t=>t in e),ni=pr,ige=e=>typeof e=="object"&&!pr(e)&&!Array.isArray(e)&&!(e instanceof Bae),d2=(e,...t)=>{if(!ige(e))return e;const n=Object.assign({},e);for(const r of t)for(const s in r)ige(r[s])?(n[s]||(n[s]={}),n[s]=d2(n[s],r[s])):!pr(r[s])&&Object.hasOwnProperty.call(r,s)&&(Array.isArray(r[s])||r[s]instanceof Bae?n[s]=r[s].slice(0):n[s]=r[s]);return n},sN=(e,t,n="0")=>typeof e=="string"?Aa(e)?oR(e,t,n):e.padStart(t,n):(qs.validate(["int"],[e]),oR(e,t,n)),nFe=(e,t,n="0")=>{if(typeof e=="string"&&!Aa(e))return e.padEnd(t,n);const r=typeof e=="string"&&Aa(e)?e:nc(e),s=r.startsWith("-")?3:2;return qs.validate([r.startsWith("-")?"int":"uint"],[e]),r.padEnd(t+s,n)},rFe=nFe,RE=sN,sFe=(e,t=64)=>{qs.validate(["int"],[e]);const n=Xd(e);if(n>=0)return sN(m1(n),t);const r=B3(BigInt(2),BigInt(t*4));if(-n>=r)throw new SPe(`value: ${e}, nibbleWidth: ${t}`);const a=BigInt(n)+r;return sN(nc(a),t)},i7t=(e,t=64)=>{qs.validate(["int"],[e]);const n=Xd(e);if(n<0)return n;const r=Math.ceil(Math.log(Number(n))/Math.log(2));if(r>t*4)throw new SPe(`value: "${e}", nibbleWidth: "${t}"`);if(t*4!==r)return n;const s=B3(BigInt(2),BigInt(t)*BigInt(4));return Xd(BigInt(n)-s)},{parseBaseType:a7t}=KPe,hg=e=>typeof e=="object"&&!pr(e)&&"number"in e&&"bytes"in e,o7t=(e,t,n=[])=>{let r=Object.assign({},e),s;for(const a of t){if(r.oneOf&&s){const o=s,l=n.find(([c])=>c===o);l&&l[0]===s&&(r=r.oneOf[l[1]])}if(!r.properties&&!r.items)return;r.properties?r=r.properties[a]:r.items&&r.items.properties?r=r.items.properties[a]:r.items&&rN(r.items)?r=r.items:r.items&&Array.isArray(r.items)&&(r=r.items[parseInt(a,10)]),r&&a&&(s=a)}return r},LE=(e,t,n)=>{try{const{baseType:r,baseTypeSize:s}=a7t(t);if(r==="int"||r==="uint")switch(n.number){case Qh.NUMBER:return Number(Xv(e));case Qh.HEX:return nc(Xv(e));case Qh.STR:return Xv(e).toString();case Qh.BIGINT:return Xv(e);default:throw new uee(`Invalid format: ${String(n.number)}`)}if(r==="bytes"){let a;switch(s?typeof e=="string"?a=sN(e,s*2):u2(e)&&(a=gd(new Uint8Array(s-e.length),e)):a=e,n.bytes){case f1.HEX:return Wi(rx(a));case f1.UINT8ARRAY:return rx(a);default:throw new uee(`Invalid format: ${String(n.bytes)}`)}}if(r==="string")return String(e)}catch{return e}return e},age=({value:e,schemaProp:t,schema:n,object:r,key:s,dataPath:a,format:o,oneOfPath:l=[]})=>{var c,u;if(Array.isArray(e)){let d=t;if((t==null?void 0:t.oneOf)!==void 0&&t.oneOf.forEach((f,x)=>{var g,v;!Array.isArray(t==null?void 0:t.items)&&(typeof e[0]=="object"&&((g=f==null?void 0:f.items)===null||g===void 0?void 0:g.type)==="object"||typeof e[0]=="string"&&((v=f==null?void 0:f.items)===null||v===void 0?void 0:v.type)!=="object")&&(d=f,l.push([s,x]))}),pr(d==null?void 0:d.items))return delete r[s],a.pop(),!0;if(rN(d.items)&&!pr(d.items.format)){for(let f=0;f<e.length;f+=1)r[s][f]=LE(e[f],(c=d==null?void 0:d.items)===null||c===void 0?void 0:c.format,o);return a.pop(),!0}if(!Array.isArray(d==null?void 0:d.items)&&((u=d==null?void 0:d.items)===null||u===void 0?void 0:u.type)==="object"){for(const f of e)i$(f,n,a,o,l);return a.pop(),!0}if(Array.isArray(d==null?void 0:d.items)){for(let f=0;f<e.length;f+=1)r[s][f]=LE(e[f],d.items[f].format,o);return a.pop(),!0}}return!1},i$=(e,t,n,r,s=[])=>{var a;if(!rN(e)&&!Array.isArray(e))return LE(e,t==null?void 0:t.format,r);const o=e;if(Array.isArray(o)&&(t==null?void 0:t.type)==="array"&&((a=t==null?void 0:t.items)===null||a===void 0?void 0:a.type)==="object")age({value:o,schemaProp:t,schema:t,object:o,key:"",dataPath:n,format:r,oneOfPath:s});else for(const[l,c]of Object.entries(o)){n.push(l);let u=o7t(t,n,s);if(pr(u)){delete o[l],n.pop();continue}if(rN(c)){i$(c,t,n,r,s),n.pop();continue}if(!age({value:c,schemaProp:u,schema:t,object:o,key:l,dataPath:n,format:r,oneOfPath:s})){if((u==null?void 0:u.format)===void 0&&(u==null?void 0:u.oneOf)!==void 0){for(const[d,f]of u.oneOf.entries())if((f==null?void 0:f.format)!==void 0){u=f;break}}o[l]=LE(c,u.format,r),n.pop()}}return o},qr=(e,t,n=dd)=>{let r;rN(t)?r=d2({},t):Array.isArray(t)?r=[...t]:r=t;const s=rN(e)?e:Zae(e);if(!s.properties&&!s.items&&!s.format)throw new uee("Invalid json schema for formatting");return i$(r,s,[],n)},iFe="0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470",iN=e=>{let t;return typeof e=="bigint"||typeof e=="number"?t=QS(e.toString()):Array.isArray(e)?t=new Uint8Array(e):typeof e=="string"&&!Aa(e)?t=QS(e):t=rx(e),Wi(od(e$(t)))},eT=e=>{let t;typeof e=="string"?e.startsWith("0x")&&Aa(e)?t=oo(e):t=QS(e):t=e;const n=iN(t);return n===iFe?void 0:n},Yf=e=>{const t=eT(e);return pr(t)?iFe:t},l7t=e=>{if(Array.isArray(e))throw new Error("Autodetection of array types is not supported.");let t,n;if(typeof e=="object"&&("t"in e||"type"in e)&&("v"in e||"value"in e))t="t"in e?e.t:e.type,n="v"in e?e.v:e.value,t=t.toLowerCase()==="bigint"?"int":t;else{if(typeof e=="bigint")return["int",e];t=m1(e,!0),n=m1(e),!t.startsWith("int")&&!t.startsWith("uint")&&(t="bytes")}return(t.startsWith("int")||t.startsWith("uint"))&&typeof n=="string"&&!/^(-)?0x/i.test(n)&&(n=Xv(n)),[t,n]},c7t=e=>e.startsWith("int[")?`int256${e.slice(3)}`:e==="int"?"int256":e.startsWith("uint[")?`uint256'${e.slice(4)}`:e==="uint"?"uint256":e,lV=(e,t)=>{const n=/^(\d+).*$/.exec(e.slice(t));return n?parseInt(n[1],10):0},oge=e=>e.toString(2).length,lge=(e,t)=>{const n=t.toString();if(e==="string"){if(typeof t=="string")return vm(t);throw new BNt(t)}if(e==="bool"||e==="boolean"){if(typeof t=="boolean")return t?"01":"00";throw new Hae(t)}if(e==="address"){if(!Kf(n))throw new zae(n);return n}const r=c7t(e);if(e.startsWith("uint")){const s=lV(r,4);if(s%8||s<8||s>256)throw new Wxe(n);const a=Xd(n);if(oge(a)>s)throw new qxe(n);if(a<BigInt(0))throw new UNt(n);return s?RE(a.toString(16),s/8*2):a.toString(16)}if(e.startsWith("int")){const s=lV(r,3);if(s%8||s<8||s>256)throw new Wxe(e);const a=Xd(n);if(oge(a)>s)throw new qxe(n);return a<BigInt(0)?sFe(a.toString(),s/8*2):s?RE(a.toString(16),s/4):a.toString(16)}if(r==="bytes"){if(n.replace(/^0x/i,"").length%2!==0)throw new o4(n);return n}if(e.startsWith("bytes")){if(n.replace(/^0x/i,"").length%2!==0)throw new o4(n);const s=lV(e,5);if(!s||s<1||s>64||s<n.replace(/^0x/i,"").length/2)throw new o4(n);return rFe(n,s*2)}return""},aFe=e=>{const[t,n]=l7t(e);return Array.isArray(n)?n.map(a=>lge(t,a).replace("0x","")).join(""):lge(t,n).replace("0x","")},noe=(...e)=>`0x${e.map(aFe).join("").toLowerCase()}`,u7t=(...e)=>eT(noe(...e)),d7t=(...e)=>Yf(noe(...e)),f7t=e=>eT(`0x${(typeof e=="number"?e.toString():e).padStart(64,"0")}`);function h7t(e){return _Pe(e)}const DE=e=>h7t(e),p7t=e=>Wi(DE(e));var a$=function(e,t,n,r){function s(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?a(d.value):s(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})};function oFe(e){return(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"}function lFe(e,t,n){return a$(this,void 0,void 0,function*(){let r;const s=yield Promise.race([e instanceof Promise?e:e(),new Promise((a,o)=>{r=setTimeout(()=>n?o(n):a(void 0),t)})]);if(r&&clearTimeout(r),s instanceof Error)throw s;return s})}function roe(e,t){let n;return[new Promise((s,a)=>{n=setInterval(function o(){return a$(this,void 0,void 0,function*(){try{const l=yield lFe(e,t);pr(l)||(clearInterval(n),s(l))}catch(l){clearInterval(n),a(l)}}),o}(),t)}),n]}function m7t(e,t){return a$(this,void 0,void 0,function*(){return roe(e,t)[0]})}function soe(e,t){let n;const r=new Promise((s,a)=>{n=setTimeout(()=>{a(t)},e)});return[n,r]}function cFe(e,t){let n;const r=new Promise((s,a)=>{n=setInterval(()=>{a$(this,void 0,void 0,function*(){const o=yield e();o&&(clearInterval(n),a(o))})},t)});return[n,r]}const ioe=()=>{const e=DE(16);e[6]=e[6]&15|64,e[8]=e[8]&63|128;const t=Wi(e);return[t.substring(2,10),t.substring(10,14),t.substring(14,18),t.substring(18,22),t.substring(22,34)].join("-")},aoe=e=>{const t=e.error.code;return md.has(t)||t>=-32099&&t<=-32e3},jy=e=>!Array.isArray(e)&&!!e&&e.jsonrpc==="2.0"&&"result"in e&&pr(e.error)&&(typeof e.id=="number"||typeof e.id=="string"),Ey=e=>!Array.isArray(e)&&e.jsonrpc==="2.0"&&!!e&&pr(e.result)&&"error"in e&&(typeof e.id=="number"||typeof e.id=="string"),o$=e=>!Array.isArray(e)&&!!e&&e.jsonrpc==="2.0"&&!pr(e.params)&&!pr(e.method),uFe=e=>!Array.isArray(e)&&!!e&&e.jsonrpc==="2.0"&&"id"in e&&"result"in e,cR=e=>jy(e)||Ey(e),ooe=e=>Array.isArray(e)?e.every(cR):cR(e),BE=e=>Array.isArray(e)&&e.length>0&&ooe(e);let hO;const dFe=e=>{hO=e},U3=e=>{var t,n,r,s;return typeof hO<"u"&&(hO+=1),{jsonrpc:(t=e.jsonrpc)!==null&&t!==void 0?t:"2.0",id:(r=(n=e.id)!==null&&n!==void 0?n:hO)!==null&&r!==void 0?r:ioe(),method:e.method,params:(s=e.params)!==null&&s!==void 0?s:void 0}},loe=e=>e.map(t=>U3(t)),r0=e=>Array.isArray(e)&&e.length>0,x7t=Object.freeze(Object.defineProperty({__proto__:null,isBatchRequest:r0,isBatchResponse:BE,isResponseRpcError:aoe,isResponseWithError:Ey,isResponseWithNotification:o$,isResponseWithResult:jy,isSubscriptionResult:uFe,isValidResponse:ooe,setRequestIdStart:dFe,toBatchPayload:loe,toPayload:U3,validateResponse:cR},Symbol.toStringTag,{value:"Module"}));var cV=function(e,t,n,r){function s(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?a(d.value):s(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})},fFe;class uR{constructor({timeout:t,eagerStart:n,timeoutMessage:r}={timeout:0,eagerStart:!1,timeoutMessage:"DeferredPromise timed out"}){this[fFe]="Promise",this._state="pending",this._promise=new Promise((s,a)=>{this._resolve=s,this._reject=a}),this._timeoutMessage=r,this._timeoutInterval=t,n&&this.startTimer()}get state(){return this._state}then(t,n){return cV(this,void 0,void 0,function*(){return this._promise.then(t,n)})}catch(t){return cV(this,void 0,void 0,function*(){return this._promise.catch(t)})}finally(t){return cV(this,void 0,void 0,function*(){return this._promise.finally(t)})}resolve(t){this._resolve(t),this._state="fulfilled",this._clearTimeout()}reject(t){this._reject(t),this._state="rejected",this._clearTimeout()}startTimer(){this._timeoutInterval&&this._timeoutInterval>0&&(this._timeoutId=setTimeout(this._checkTimeout.bind(this),this._timeoutInterval))}_checkTimeout(){this._state==="pending"&&this._timeoutId&&this.reject(new hPe(this._timeoutMessage))}_clearTimeout(){this._timeoutId&&clearTimeout(this._timeoutId)}}fFe=Symbol.toStringTag;class hFe{constructor(t,n){this.eventEmitter=t,this.autoReconnect=n,this.chunkTimeout=1e3*15}clearQueues(){typeof this._clearQueues=="function"&&this._clearQueues()}onError(t){this._clearQueues=t}parseResponse(t){const n=[];return t.replace(/\}[\n\r]?\{/g,"}|--|{").replace(/\}\][\n\r]?\[\{/g,"}]|--|[{").replace(/\}[\n\r]?\[\{/g,"}|--|[{").replace(/\}\][\n\r]?\{/g,"}]|--|{").split("|--|").forEach(s=>{let a=s;this.lastChunk&&(a=this.lastChunk+a);let o;try{o=JSON.parse(a)}catch{this.lastChunk=a,this.lastChunkTimeout&&clearTimeout(this.lastChunkTimeout),this.lastChunkTimeout=setTimeout(()=>{this.autoReconnect||(this.clearQueues(),this.eventEmitter.emit("error",new XB({id:1,jsonrpc:"2.0",error:{code:2,message:"Chunk timeout"}})))},this.chunkTimeout);return}clearTimeout(this.lastChunkTimeout),this.lastChunk=void 0,o&&n.push(o)}),n}}var cge=function(e,t,n,r){function s(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?a(d.value):s(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})};class coe extends Xk{constructor(){super(...arguments),this._eventEmitter=new Bie,this._chainId="",this._accounts=[]}_getChainId(){return cge(this,void 0,void 0,function*(){var t;const n=yield this.request(U3({method:"eth_chainId",params:[]}));return(t=n==null?void 0:n.result)!==null&&t!==void 0?t:""})}_getAccounts(){return cge(this,void 0,void 0,function*(){var t;const n=yield this.request(U3({method:"eth_accounts",params:[]}));return(t=n==null?void 0:n.result)!==null&&t!==void 0?t:[]})}_onConnect(){Promise.all([this._getChainId().then(t=>{t!==this._chainId&&(this._chainId=t,this._eventEmitter.emit("chainChanged",this._chainId))}).catch(t=>{console.error(t)}),this._getAccounts().then(t=>{this._accounts.length===t.length&&t.every(n=>t.includes(n))||(this._accounts=t,this._onAccountsChanged())}).catch(t=>{console.error(t)})]).then(()=>this._eventEmitter.emit("connect",{chainId:this._chainId})).catch(t=>{console.error(t)})}_onDisconnect(t,n){this._eventEmitter.emit("disconnect",new VNt(t,n))}_onAccountsChanged(){this._eventEmitter.emit("accountsChanged",this._accounts)}}var uV=function(e,t,n,r){function s(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?a(d.value):s(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})};const g7t={autoReconnect:!0,delay:5e3,maxAttempts:5},b7t=1e3;class pFe extends coe{get SocketConnection(){return this._socketConnection}constructor(t,n,r){if(super(),this._connectionStatus="connecting",this._onMessageHandler=this._onMessage.bind(this),this._onOpenHandler=this._onConnect.bind(this),this._onCloseHandler=this._onCloseEvent.bind(this),this._onErrorHandler=this._onError.bind(this),!this._validateProviderPath(t))throw new dee(t);this._socketPath=t,this._socketOptions=n,this._reconnectOptions=Object.assign(Object.assign({},g7t),r??{}),this._pendingRequestsQueue=new Map,this._sentRequestsQueue=new Map,this._init(),this.connect(),this.chunkResponseParser=new hFe(this._eventEmitter,this._reconnectOptions.autoReconnect),this.chunkResponseParser.onError(()=>{this._clearQueues()}),this.isReconnecting=!1}_init(){this._reconnectAttempts=0}connect(){try{this._openSocketConnection(),this._connectionStatus="connecting",this._addSocketListeners()}catch(t){if(this.isReconnecting)setImmediate(()=>{this._reconnect()});else throw this._connectionStatus="disconnected",t&&t.message?new Qk(`Error while connecting to ${this._socketPath}. Reason: ${t.message}`):new dee(this._socketPath)}}_validateProviderPath(t){return!!t}getPendingRequestQueueSize(){return this._pendingRequestsQueue.size}getSentRequestsQueueSize(){return this._sentRequestsQueue.size}supportsSubscriptions(){return!0}on(t,n){this._eventEmitter.on(t,n)}once(t,n){this._eventEmitter.once(t,n)}removeListener(t,n){this._eventEmitter.removeListener(t,n)}_onDisconnect(t,n){this._connectionStatus="disconnected",super._onDisconnect(t,n)}disconnect(t,n){const r=t??b7t;this._removeSocketListeners(),this.getStatus()!=="disconnected"&&this._closeSocketConnection(r,n),this._onDisconnect(r,n)}safeDisconnect(t,n){return uV(this,arguments,void 0,function*(r,s,a=!1,o=1e3){let l=0;yield uV(this,void 0,void 0,function*(){return new Promise(u=>{const d=setInterval(()=>{a&&l>=5&&this.clearQueues(),this.getPendingRequestQueueSize()===0&&this.getSentRequestsQueueSize()===0&&(clearInterval(d),u(!0)),l+=1},o)})}),this.disconnect(r,s)})}removeAllListeners(t){this._eventEmitter.removeAllListeners(t)}_onError(t){this.isReconnecting?this._reconnect():this._eventEmitter.emit("error",t)}reset(){this._sentRequestsQueue.clear(),this._pendingRequestsQueue.clear(),this._init(),this._removeSocketListeners(),this._addSocketListeners()}_reconnect(){this.isReconnecting||(this.isReconnecting=!0,this._sentRequestsQueue.size>0&&this._sentRequestsQueue.forEach((t,n)=>{t.deferredPromise.reject(new iNt),this._sentRequestsQueue.delete(n)}),this._reconnectAttempts<this._reconnectOptions.maxAttempts?(this._reconnectAttempts+=1,setTimeout(()=>{this._removeSocketListeners(),this.connect(),this.isReconnecting=!1},this._reconnectOptions.delay)):(this.isReconnecting=!1,this._clearQueues(),this._removeSocketListeners(),this._eventEmitter.emit("error",new sNt(this._reconnectOptions.maxAttempts))))}request(t){return uV(this,void 0,void 0,function*(){if(ni(this._socketConnection))throw new Error("Connection is undefined");this.getStatus()==="disconnected"&&this.connect();const n=r0(t)?t[0].id:t.id;if(!n)throw new fNt("Request Id not defined");if(this._sentRequestsQueue.has(n))throw new aNt(n);const r=new uR;r.catch(a=>{this._eventEmitter.emit("error",a)});const s={payload:t,deferredPromise:r};if(this.getStatus()==="connecting")return this._pendingRequestsQueue.set(n,s),s.deferredPromise;this._sentRequestsQueue.set(n,s);try{this._sendToSocket(s.payload)}catch(a){this._sentRequestsQueue.delete(n),this._eventEmitter.emit("error",a)}return r})}_onConnect(){this._connectionStatus="connected",this._reconnectAttempts=0,super._onConnect(),this._sendPendingRequests()}_sendPendingRequests(){for(const[t,n]of this._pendingRequestsQueue.entries())try{this._sendToSocket(n.payload),this._pendingRequestsQueue.delete(t),this._sentRequestsQueue.set(t,n)}catch(r){this._pendingRequestsQueue.delete(t),this._eventEmitter.emit("error",r)}}_onMessage(t){const n=this._parseResponses(t);if(!(ni(n)||n.length===0))for(const r of n){if(o$(r)&&r.method.endsWith("_subscription")){this._eventEmitter.emit("message",r);return}const s=BE(r)?r[0].id:r.id,a=this._sentRequestsQueue.get(s);if(!a)return;(BE(r)||jy(r)||Ey(r))&&(this._eventEmitter.emit("message",r),a.deferredPromise.resolve(r)),this._sentRequestsQueue.delete(s)}}clearQueues(t){this._clearQueues(t)}_clearQueues(t){this._pendingRequestsQueue.size>0&&this._pendingRequestsQueue.forEach((n,r)=>{n.deferredPromise.reject(new cee(t)),this._pendingRequestsQueue.delete(r)}),this._sentRequestsQueue.size>0&&this._sentRequestsQueue.forEach((n,r)=>{n.deferredPromise.reject(new cee(t)),this._sentRequestsQueue.delete(r)}),this._removeSocketListeners()}}const mFe=Object.freeze(Object.defineProperty({__proto__:null,ChunkResponseParser:hFe,Eip1193Provider:coe,EventEmitter:toe,SocketProvider:pFe,Web3DeferredPromise:uR,asciiToHex:JPe,bytesToHex:Wi,bytesToUint8Array:rx,checkAddressCheckSum:X8t,compareBlockNumbers:s7t,convert:i$,convertScalarValue:LE,encodePacked:noe,ethUnitMap:r$,format:qr,fromAscii:V8t,fromDecimal:B8t,fromTwosComplement:i7t,fromUtf8:ZPe,fromWei:q8t,getStorageSlotNumForLongString:f7t,hexToAscii:eFe,hexToBytes:oo,hexToNumber:Jk,hexToNumberString:$8t,hexToString:H8t,hexToUtf8:s$,isAddress:Q8t,isBatchRequest:r0,isBatchResponse:BE,isBloom:Z8t,isContractAddressInBloom:t7t,isContractInitOptions:py,isDataFormat:hg,isHex:Y8t,isHexStrict:K8t,isInBloom:J8t,isNullish:ni,isPromise:oFe,isResponseRpcError:aoe,isResponseWithError:Ey,isResponseWithNotification:o$,isResponseWithResult:jy,isSubscriptionResult:uFe,isTopic:n7t,isTopicInBloom:r7t,isUint8Array:u2,isUserEthereumAddressInBloom:e7t,isValidResponse:ooe,jsonRpc:x7t,keccak256:iN,keccak256Wrapper:iN,leftPad:RE,mergeDeep:d2,numberToHex:nc,padLeft:sN,padRight:nFe,pollTillDefined:m7t,pollTillDefinedAndReturnIntervalId:roe,processSolidityEncodePackedArgs:aFe,randomBytes:DE,randomHex:p7t,rejectIfConditionAtInterval:cFe,rejectIfTimeout:soe,rightPad:rFe,setRequestIdStart:dFe,sha3:eT,sha3Raw:Yf,soliditySha3:u7t,soliditySha3Raw:d7t,stringToHex:U8t,toAscii:W8t,toBatchPayload:loe,toBigInt:Xv,toBool:tFe,toChecksumAddress:fx,toDecimal:D8t,toHex:m1,toNumber:Xd,toPayload:U3,toTwosComplement:sFe,toUtf8:z8t,toWei:G8t,uint8ArrayConcat:gd,uint8ArrayEquals:n$,utf8ToBytes:eoe,utf8ToHex:vm,uuidV4:ioe,validateResponse:cR,waitWithTimeout:lFe},Symbol.toStringTag,{value:"Module"}));class l${constructor(){this._emitter=new toe}on(t,n){this._emitter.on(t,n)}once(t,n){this._emitter.once(t,n)}off(t,n){this._emitter.off(t,n)}emit(t,n){this._emitter.emit(t,n)}listenerCount(t){return this._emitter.listenerCount(t)}listeners(t){return this._emitter.listeners(t)}eventNames(){return this._emitter.eventNames()}removeAllListeners(){return this._emitter.removeAllListeners()}setMaxListenerWarningThreshold(t){this._emitter.setMaxListeners(t)}getMaxListeners(){return this._emitter.getMaxListeners()}}var z3;(function(e){e.CONFIG_CHANGE="CONFIG_CHANGE"})(z3||(z3={}));class y7t extends l${constructor(t){super(),this.config={handleRevert:!1,defaultAccount:void 0,defaultBlock:"latest",transactionBlockTimeout:50,transactionConfirmationBlocks:24,transactionPollingInterval:1e3,transactionPollingTimeout:750*1e3,transactionReceiptPollingInterval:void 0,transactionSendTimeout:750*1e3,transactionConfirmationPollingInterval:void 0,blockHeaderTimeout:10,maxListenersWarningThreshold:100,contractDataInputFill:"data",defaultNetworkId:void 0,defaultChain:"mainnet",defaultHardfork:"london",defaultCommon:void 0,defaultTransactionType:"0x2",defaultMaxPriorityFeePerGas:m1(25e8),enableExperimentalFeatures:{useSubscriptionWhenCheckingBlockTimeout:!1,useRpcCallSpecification:!1},transactionBuilder:void 0,transactionTypeParser:void 0,customTransactionSchema:void 0,defaultReturnFormat:dd,ignoreGasPricing:!1},this.setConfig(t??{})}setConfig(t){const n=Object.keys(t);for(const r of n)this._triggerConfigChange(r,t[r]),!ni(t[r])&&typeof t[r]=="number"&&r==="maxListenersWarningThreshold"&&this.setMaxListenerWarningThreshold(Number(t[r]));Object.assign(this.config,t)}get handleRevert(){return this.config.handleRevert}set handleRevert(t){this._triggerConfigChange("handleRevert",t),this.config.handleRevert=t}get contractDataInputFill(){return this.config.contractDataInputFill}set contractDataInputFill(t){this._triggerConfigChange("contractDataInputFill",t),this.config.contractDataInputFill=t}get defaultAccount(){return this.config.defaultAccount}set defaultAccount(t){this._triggerConfigChange("defaultAccount",t),this.config.defaultAccount=t}get defaultBlock(){return this.config.defaultBlock}set defaultBlock(t){this._triggerConfigChange("defaultBlock",t),this.config.defaultBlock=t}get transactionSendTimeout(){return this.config.transactionSendTimeout}set transactionSendTimeout(t){this._triggerConfigChange("transactionSendTimeout",t),this.config.transactionSendTimeout=t}get transactionBlockTimeout(){return this.config.transactionBlockTimeout}set transactionBlockTimeout(t){this._triggerConfigChange("transactionBlockTimeout",t),this.config.transactionBlockTimeout=t}get transactionConfirmationBlocks(){return this.config.transactionConfirmationBlocks}set transactionConfirmationBlocks(t){this._triggerConfigChange("transactionConfirmationBlocks",t),this.config.transactionConfirmationBlocks=t}get transactionPollingInterval(){return this.config.transactionPollingInterval}set transactionPollingInterval(t){this._triggerConfigChange("transactionPollingInterval",t),this.config.transactionPollingInterval=t,this.transactionReceiptPollingInterval=t,this.transactionConfirmationPollingInterval=t}get transactionPollingTimeout(){return this.config.transactionPollingTimeout}set transactionPollingTimeout(t){this._triggerConfigChange("transactionPollingTimeout",t),this.config.transactionPollingTimeout=t}get transactionReceiptPollingInterval(){return this.config.transactionReceiptPollingInterval}set transactionReceiptPollingInterval(t){this._triggerConfigChange("transactionReceiptPollingInterval",t),this.config.transactionReceiptPollingInterval=t}get transactionConfirmationPollingInterval(){return this.config.transactionConfirmationPollingInterval}set transactionConfirmationPollingInterval(t){this._triggerConfigChange("transactionConfirmationPollingInterval",t),this.config.transactionConfirmationPollingInterval=t}get blockHeaderTimeout(){return this.config.blockHeaderTimeout}set blockHeaderTimeout(t){this._triggerConfigChange("blockHeaderTimeout",t),this.config.blockHeaderTimeout=t}get enableExperimentalFeatures(){return this.config.enableExperimentalFeatures}set enableExperimentalFeatures(t){this._triggerConfigChange("enableExperimentalFeatures",t),this.config.enableExperimentalFeatures=t}get maxListenersWarningThreshold(){return this.config.maxListenersWarningThreshold}set maxListenersWarningThreshold(t){this._triggerConfigChange("maxListenersWarningThreshold",t),this.setMaxListenerWarningThreshold(t),this.config.maxListenersWarningThreshold=t}get defaultReturnFormat(){return this.config.defaultReturnFormat}set defaultReturnFormat(t){this._triggerConfigChange("defaultReturnFormat",t),this.config.defaultReturnFormat=t}get defaultNetworkId(){return this.config.defaultNetworkId}set defaultNetworkId(t){this._triggerConfigChange("defaultNetworkId",t),this.config.defaultNetworkId=t}get defaultChain(){return this.config.defaultChain}set defaultChain(t){if(!ni(this.config.defaultCommon)&&!ni(this.config.defaultCommon.baseChain)&&t!==this.config.defaultCommon.baseChain)throw new Yxe(this.config.defaultChain,t);this._triggerConfigChange("defaultChain",t),this.config.defaultChain=t}get defaultHardfork(){return this.config.defaultHardfork}set defaultHardfork(t){if(!ni(this.config.defaultCommon)&&!ni(this.config.defaultCommon.hardfork)&&t!==this.config.defaultCommon.hardfork)throw new Kxe(this.config.defaultCommon.hardfork,t);this._triggerConfigChange("defaultHardfork",t),this.config.defaultHardfork=t}get defaultCommon(){return this.config.defaultCommon}set defaultCommon(t){if(!ni(this.config.defaultHardfork)&&!ni(t)&&!ni(t.hardfork)&&this.config.defaultHardfork!==t.hardfork)throw new Kxe(this.config.defaultHardfork,t.hardfork);if(!ni(this.config.defaultChain)&&!ni(t)&&!ni(t.baseChain)&&this.config.defaultChain!==t.baseChain)throw new Yxe(this.config.defaultChain,t.baseChain);this._triggerConfigChange("defaultCommon",t),this.config.defaultCommon=t}get ignoreGasPricing(){return this.config.ignoreGasPricing}set ignoreGasPricing(t){this._triggerConfigChange("ignoreGasPricing",t),this.config.ignoreGasPricing=t}get defaultTransactionType(){return this.config.defaultTransactionType}set defaultTransactionType(t){this._triggerConfigChange("defaultTransactionType",t),this.config.defaultTransactionType=t}get defaultMaxPriorityFeePerGas(){return this.config.defaultMaxPriorityFeePerGas}set defaultMaxPriorityFeePerGas(t){this._triggerConfigChange("defaultMaxPriorityFeePerGas",t),this.config.defaultMaxPriorityFeePerGas=t}get transactionBuilder(){return this.config.transactionBuilder}set transactionBuilder(t){this._triggerConfigChange("transactionBuilder",t),this.config.transactionBuilder=t}get transactionTypeParser(){return this.config.transactionTypeParser}set transactionTypeParser(t){this._triggerConfigChange("transactionTypeParser",t),this.config.transactionTypeParser=t}get customTransactionSchema(){return this.config.customTransactionSchema}set customTransactionSchema(t){this._triggerConfigChange("customTransactionSchema",t),this.config.customTransactionSchema=t}_triggerConfigChange(t,n){this.emit(z3.CONFIG_CHANGE,{name:t,oldValue:this.config[t],newValue:n})}}var uP={exports:{}},uge;function v7t(){return uge||(uge=1,function(e,t){var n=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof Tu<"u"&&Tu,r=function(){function a(){this.fetch=!1,this.DOMException=n.DOMException}return a.prototype=n,new a}();(function(a){(function(o){var l=typeof a<"u"&&a||typeof self<"u"&&self||typeof l<"u"&&l,c={searchParams:"URLSearchParams"in l,iterable:"Symbol"in l&&"iterator"in Symbol,blob:"FileReader"in l&&"Blob"in l&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in l,arrayBuffer:"ArrayBuffer"in l};function u(Y){return Y&&DataView.prototype.isPrototypeOf(Y)}if(c.arrayBuffer)var d=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],f=ArrayBuffer.isView||function(Y){return Y&&d.indexOf(Object.prototype.toString.call(Y))>-1};function x(Y){if(typeof Y!="string"&&(Y=String(Y)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(Y)||Y==="")throw new TypeError('Invalid character in header field name: "'+Y+'"');return Y.toLowerCase()}function g(Y){return typeof Y!="string"&&(Y=String(Y)),Y}function v(Y){var ie={next:function(){var oe=Y.shift();return{done:oe===void 0,value:oe}}};return c.iterable&&(ie[Symbol.iterator]=function(){return ie}),ie}function w(Y){this.map={},Y instanceof w?Y.forEach(function(ie,oe){this.append(oe,ie)},this):Array.isArray(Y)?Y.forEach(function(ie){this.append(ie[0],ie[1])},this):Y&&Object.getOwnPropertyNames(Y).forEach(function(ie){this.append(ie,Y[ie])},this)}w.prototype.append=function(Y,ie){Y=x(Y),ie=g(ie);var oe=this.map[Y];this.map[Y]=oe?oe+", "+ie:ie},w.prototype.delete=function(Y){delete this.map[x(Y)]},w.prototype.get=function(Y){return Y=x(Y),this.has(Y)?this.map[Y]:null},w.prototype.has=function(Y){return this.map.hasOwnProperty(x(Y))},w.prototype.set=function(Y,ie){this.map[x(Y)]=g(ie)},w.prototype.forEach=function(Y,ie){for(var oe in this.map)this.map.hasOwnProperty(oe)&&Y.call(ie,this.map[oe],oe,this)},w.prototype.keys=function(){var Y=[];return this.forEach(function(ie,oe){Y.push(oe)}),v(Y)},w.prototype.values=function(){var Y=[];return this.forEach(function(ie){Y.push(ie)}),v(Y)},w.prototype.entries=function(){var Y=[];return this.forEach(function(ie,oe){Y.push([oe,ie])}),v(Y)},c.iterable&&(w.prototype[Symbol.iterator]=w.prototype.entries);function C(Y){if(Y.bodyUsed)return Promise.reject(new TypeError("Already read"));Y.bodyUsed=!0}function N(Y){return new Promise(function(ie,oe){Y.onload=function(){ie(Y.result)},Y.onerror=function(){oe(Y.error)}})}function P(Y){var ie=new FileReader,oe=N(ie);return ie.readAsArrayBuffer(Y),oe}function I(Y){var ie=new FileReader,oe=N(ie);return ie.readAsText(Y),oe}function R(Y){for(var ie=new Uint8Array(Y),oe=new Array(ie.length),G=0;G<ie.length;G++)oe[G]=String.fromCharCode(ie[G]);return oe.join("")}function F(Y){if(Y.slice)return Y.slice(0);var ie=new Uint8Array(Y.byteLength);return ie.set(new Uint8Array(Y)),ie.buffer}function U(){return this.bodyUsed=!1,this._initBody=function(Y){this.bodyUsed=this.bodyUsed,this._bodyInit=Y,Y?typeof Y=="string"?this._bodyText=Y:c.blob&&Blob.prototype.isPrototypeOf(Y)?this._bodyBlob=Y:c.formData&&FormData.prototype.isPrototypeOf(Y)?this._bodyFormData=Y:c.searchParams&&URLSearchParams.prototype.isPrototypeOf(Y)?this._bodyText=Y.toString():c.arrayBuffer&&c.blob&&u(Y)?(this._bodyArrayBuffer=F(Y.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):c.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(Y)||f(Y))?this._bodyArrayBuffer=F(Y):this._bodyText=Y=Object.prototype.toString.call(Y):this._bodyText="",this.headers.get("content-type")||(typeof Y=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):c.searchParams&&URLSearchParams.prototype.isPrototypeOf(Y)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},c.blob&&(this.blob=function(){var Y=C(this);if(Y)return Y;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){if(this._bodyArrayBuffer){var Y=C(this);return Y||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}else return this.blob().then(P)}),this.text=function(){var Y=C(this);if(Y)return Y;if(this._bodyBlob)return I(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(R(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},c.formData&&(this.formData=function(){return this.text().then(ne)}),this.json=function(){return this.text().then(JSON.parse)},this}var L=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function z(Y){var ie=Y.toUpperCase();return L.indexOf(ie)>-1?ie:Y}function Q(Y,ie){if(!(this instanceof Q))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');ie=ie||{};var oe=ie.body;if(Y instanceof Q){if(Y.bodyUsed)throw new TypeError("Already read");this.url=Y.url,this.credentials=Y.credentials,ie.headers||(this.headers=new w(Y.headers)),this.method=Y.method,this.mode=Y.mode,this.signal=Y.signal,!oe&&Y._bodyInit!=null&&(oe=Y._bodyInit,Y.bodyUsed=!0)}else this.url=String(Y);if(this.credentials=ie.credentials||this.credentials||"same-origin",(ie.headers||!this.headers)&&(this.headers=new w(ie.headers)),this.method=z(ie.method||this.method||"GET"),this.mode=ie.mode||this.mode||null,this.signal=ie.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&oe)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(oe),(this.method==="GET"||this.method==="HEAD")&&(ie.cache==="no-store"||ie.cache==="no-cache")){var G=/([?&])_=[^&]*/;if(G.test(this.url))this.url=this.url.replace(G,"$1_="+new Date().getTime());else{var V=/\?/;this.url+=(V.test(this.url)?"&":"?")+"_="+new Date().getTime()}}}Q.prototype.clone=function(){return new Q(this,{body:this._bodyInit})};function ne(Y){var ie=new FormData;return Y.trim().split("&").forEach(function(oe){if(oe){var G=oe.split("="),V=G.shift().replace(/\+/g," "),ee=G.join("=").replace(/\+/g," ");ie.append(decodeURIComponent(V),decodeURIComponent(ee))}}),ie}function J(Y){var ie=new w,oe=Y.replace(/\r?\n[\t ]+/g," ");return oe.split("\r").map(function(G){return G.indexOf(`
`)===0?G.substr(1,G.length):G}).forEach(function(G){var V=G.split(":"),ee=V.shift().trim();if(ee){var ae=V.join(":").trim();ie.append(ee,ae)}}),ie}U.call(Q.prototype);function X(Y,ie){if(!(this instanceof X))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');ie||(ie={}),this.type="default",this.status=ie.status===void 0?200:ie.status,this.ok=this.status>=200&&this.status<300,this.statusText=ie.statusText===void 0?"":""+ie.statusText,this.headers=new w(ie.headers),this.url=ie.url||"",this._initBody(Y)}U.call(X.prototype),X.prototype.clone=function(){return new X(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new w(this.headers),url:this.url})},X.error=function(){var Y=new X(null,{status:0,statusText:""});return Y.type="error",Y};var re=[301,302,303,307,308];X.redirect=function(Y,ie){if(re.indexOf(ie)===-1)throw new RangeError("Invalid status code");return new X(null,{status:ie,headers:{location:Y}})},o.DOMException=l.DOMException;try{new o.DOMException}catch{o.DOMException=function(ie,oe){this.message=ie,this.name=oe;var G=Error(ie);this.stack=G.stack},o.DOMException.prototype=Object.create(Error.prototype),o.DOMException.prototype.constructor=o.DOMException}function pe(Y,ie){return new Promise(function(oe,G){var V=new Q(Y,ie);if(V.signal&&V.signal.aborted)return G(new o.DOMException("Aborted","AbortError"));var ee=new XMLHttpRequest;function ae(){ee.abort()}ee.onload=function(){var Ne={status:ee.status,statusText:ee.statusText,headers:J(ee.getAllResponseHeaders()||"")};Ne.url="responseURL"in ee?ee.responseURL:Ne.headers.get("X-Request-URL");var he="response"in ee?ee.response:ee.responseText;setTimeout(function(){oe(new X(he,Ne))},0)},ee.onerror=function(){setTimeout(function(){G(new TypeError("Network request failed"))},0)},ee.ontimeout=function(){setTimeout(function(){G(new TypeError("Network request failed"))},0)},ee.onabort=function(){setTimeout(function(){G(new o.DOMException("Aborted","AbortError"))},0)};function fe(Ne){try{return Ne===""&&l.location.href?l.location.href:Ne}catch{return Ne}}ee.open(V.method,fe(V.url),!0),V.credentials==="include"?ee.withCredentials=!0:V.credentials==="omit"&&(ee.withCredentials=!1),"responseType"in ee&&(c.blob?ee.responseType="blob":c.arrayBuffer&&V.headers.get("Content-Type")&&V.headers.get("Content-Type").indexOf("application/octet-stream")!==-1&&(ee.responseType="arraybuffer")),ie&&typeof ie.headers=="object"&&!(ie.headers instanceof w)?Object.getOwnPropertyNames(ie.headers).forEach(function(Ne){ee.setRequestHeader(Ne,g(ie.headers[Ne]))}):V.headers.forEach(function(Ne,he){ee.setRequestHeader(he,Ne)}),V.signal&&(V.signal.addEventListener("abort",ae),ee.onreadystatechange=function(){ee.readyState===4&&V.signal.removeEventListener("abort",ae)}),ee.send(typeof V._bodyInit>"u"?null:V._bodyInit)})}return pe.polyfill=!0,l.fetch||(l.fetch=pe,l.Headers=w,l.Request=Q,l.Response=X),o.Headers=w,o.Request=Q,o.Response=X,o.fetch=pe,o})({})})(r),r.fetch.ponyfill=!0,delete r.fetch.polyfill;var s=n.fetch?n:r;t=s.fetch,t.default=s.fetch,t.fetch=s.fetch,t.Headers=s.Headers,t.Request=s.Request,t.Response=s.Response,e.exports=t}(uP,uP.exports)),uP.exports}var w7t=v7t();const C7t=Ti(w7t);var S7t=function(e,t,n,r){function s(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?a(d.value):s(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})};class c$ extends Xk{constructor(t,n){if(super(),!c$.validateClientUrl(t))throw new dee(t);this.clientUrl=t,this.httpProviderOptions=n}static validateClientUrl(t){return typeof t=="string"?/^http(s)?:\/\//i.test(t):!1}getStatus(){throw new Ux}supportsSubscriptions(){return!1}request(t,n){var r;return S7t(this,void 0,void 0,function*(){const s=Object.assign(Object.assign({},(r=this.httpProviderOptions)===null||r===void 0?void 0:r.providerOptions),n),a=yield C7t(this.clientUrl,Object.assign(Object.assign({},s),{method:"POST",headers:Object.assign(Object.assign({},s.headers),{"Content-Type":"application/json"}),body:JSON.stringify(t)}));if(!a.ok)throw new S0(yield a.json(),void 0,void 0,a.status);return yield a.json()})}on(){throw new Ux}removeListener(){throw new Ux}once(){throw new Ux}removeAllListeners(){throw new Ux}connect(){throw new Ux}disconnect(){throw new Ux}reset(){throw new Ux}reconnect(){throw new Ux}}var SC=null;typeof WebSocket<"u"?SC=WebSocket:typeof MozWebSocket<"u"?SC=MozWebSocket:typeof global<"u"?SC=global.WebSocket||global.MozWebSocket:typeof window<"u"?SC=window.WebSocket||window.MozWebSocket:typeof self<"u"&&(SC=self.WebSocket||self.MozWebSocket);const N7t=SC;class xFe extends pFe{constructor(t,n,r){super(t,n,r)}_validateProviderPath(t){return typeof t=="string"?/^ws(s)?:\/\//i.test(t):!1}getStatus(){if(this._socketConnection&&!ni(this._socketConnection))switch(this._socketConnection.readyState){case this._socketConnection.CONNECTING:return"connecting";case this._socketConnection.OPEN:return"connected";default:return"disconnected"}return"disconnected"}_openSocketConnection(){this._socketConnection=new N7t(this._socketPath,void 0,this._socketOptions&&Object.keys(this._socketOptions).length===0?void 0:this._socketOptions)}_closeSocketConnection(t,n){var r;(r=this._socketConnection)===null||r===void 0||r.close(t,n)}_sendToSocket(t){var n;if(this.getStatus()==="disconnected")throw new cee;(n=this._socketConnection)===null||n===void 0||n.send(JSON.stringify(t))}_parseResponses(t){return this.chunkResponseParser.parseResponse(t.data)}_addSocketListeners(){var t,n,r,s;(t=this._socketConnection)===null||t===void 0||t.addEventListener("open",this._onOpenHandler),(n=this._socketConnection)===null||n===void 0||n.addEventListener("message",this._onMessageHandler),(r=this._socketConnection)===null||r===void 0||r.addEventListener("close",a=>this._onCloseHandler(a)),(s=this._socketConnection)===null||s===void 0||s.addEventListener("error",this._onErrorHandler)}_removeSocketListeners(){var t,n,r;(t=this._socketConnection)===null||t===void 0||t.removeEventListener("message",this._onMessageHandler),(n=this._socketConnection)===null||n===void 0||n.removeEventListener("open",this._onOpenHandler),(r=this._socketConnection)===null||r===void 0||r.removeEventListener("close",this._onCloseHandler)}_onCloseEvent(t){var n;if(this._reconnectOptions.autoReconnect&&(![1e3,1001].includes(t.code)||!t.wasClean)){this._reconnect();return}this._clearQueues(t),this._removeSocketListeners(),this._onDisconnect(t.code,t.reason),(n=this._socketConnection)===null||n===void 0||n.removeEventListener("error",this._onErrorHandler)}}const gFe=e=>Xk.isWeb3Provider(e),bFe=e=>typeof e!="string"&&"request"in e&&e.request.constructor.name==="Function",yFe=e=>typeof e!="string"&&"request"in e&&e.request.constructor.name==="AsyncFunction",vFe=e=>typeof e!="string"&&"send"in e,wFe=e=>typeof e!="string"&&"sendAsync"in e,dR=e=>e&&(gFe(e)||yFe(e)||bFe(e)||wFe(e)||vFe(e)),A7t=e=>e&&"supportsSubscriptions"in e?e.supportsSubscriptions():!!(e&&typeof e!="string"&&"on"in e);var dV=function(e,t,n,r){function s(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?a(d.value):s(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})},aN;(function(e){e.PROVIDER_CHANGED="PROVIDER_CHANGED",e.BEFORE_PROVIDER_CHANGE="BEFORE_PROVIDER_CHANGE"})(aN||(aN={}));const dge={HttpProvider:c$,WebsocketProvider:xFe};class e3 extends l${constructor(t,n,r){super(),ni(t)||this.setProvider(t),this.useRpcCallSpecification=n,ni(r)||(this.middleware=r)}static get providers(){return dge}get provider(){return this._provider}get providers(){return dge}setProvider(t){let n;if(t&&typeof t=="string"&&this.providers)if(/^http(s)?:\/\//i.test(t))n=new this.providers.HttpProvider(t);else if(/^ws(s)?:\/\//i.test(t))n=new this.providers.WebsocketProvider(t);else throw new lO(`Can't autodetect provider for "${t}"`);else ni(t)?n=void 0:n=t;return this.emit(aN.BEFORE_PROVIDER_CHANGE,this._provider),this._provider=n,this.emit(aN.PROVIDER_CHANGED,this._provider),!0}setMiddleware(t){this.middleware=t}send(t){return dV(this,void 0,void 0,function*(){const n=Object.assign({},t);let r=yield this._sendRequest(n);if(ni(this.middleware)||(r=yield this.middleware.processResponse(r)),jy(r))return r.result;throw new S0(r)})}sendBatch(t){return dV(this,void 0,void 0,function*(){return yield this._sendRequest(t)})}_sendRequest(t){return dV(this,void 0,void 0,function*(){const{provider:n}=this;if(ni(n))throw new lO("Provider not available. Use `.setProvider` or `.provider=` to initialize the provider.");let r=r0(t)?loe(t):U3(t);if(ni(this.middleware)||(r=yield this.middleware.processRequest(r)),gFe(n)){let s;try{s=yield n.request(r)}catch(a){s=a}return this._processJsonRpcResponse(r,s,{legacy:!1,error:!1})}if(yFe(n))return n.request(r).then(s=>this._processJsonRpcResponse(r,s,{legacy:!0,error:!1})).catch(s=>this._processJsonRpcResponse(r,s,{legacy:!0,error:!0}));if(bFe(n))return new Promise((s,a)=>{const o=u=>{a(this._processJsonRpcResponse(r,u,{legacy:!0,error:!0}))},l=u=>s(this._processJsonRpcResponse(r,u,{legacy:!0,error:!1})),c=n.request(r,(u,d)=>u?o(u):l(d));oFe(c)&&c.then(l).catch(d=>{try{const f=this._processJsonRpcResponse(r,d,{legacy:!0,error:!0});a(f)}catch(f){a(f)}})});if(vFe(n))return new Promise((s,a)=>{n.send(r,(o,l)=>{if(o)return a(this._processJsonRpcResponse(r,o,{legacy:!0,error:!0}));if(ni(l))throw new S0({},'Got a "nullish" response from provider.');return s(this._processJsonRpcResponse(r,l,{legacy:!0,error:!1}))})});if(wFe(n))return n.sendAsync(r).then(s=>this._processJsonRpcResponse(r,s,{legacy:!0,error:!1})).catch(s=>this._processJsonRpcResponse(r,s,{legacy:!0,error:!0}));throw new lO("Provider does not have a request or send method to use.")})}_processJsonRpcResponse(t,n,{legacy:r,error:s}){if(ni(n))return this._buildResponse(t,null,s);if(Ey(n)){if(this.useRpcCallSpecification&&aoe(n)){const a=n;if(md.get(a.error.code)){const o=md.get(a.error.code).error;throw new o(a)}else throw new Jf(a)}else if(!e3._isReverted(n))throw new XB(n,t)}if(jy(n))return n;if(n instanceof Error)throw e3._isReverted(n),n;if(!r&&r0(t)&&BE(n)||r&&!s&&r0(t))return n;if(r&&s&&r0(t))throw n;if(r&&!Ey(n)&&!jy(n))return this._buildResponse(t,n,s);throw r0(t)&&!Array.isArray(n)?new S0(n,"Got normal response for a batch request."):!r0(t)&&Array.isArray(n)?new S0(n,"Got batch response for a normal request."):new S0(n,"Invalid response")}static _isReverted(t){let n;if(Ey(t)?n=t.error:t instanceof Error&&(n=t),n!=null&&n.message.includes("revert"))throw new Zw(n);return!1}_buildResponse(t,n,r){const s={jsonrpc:"2.0",id:r0(t)?t[0].id:"id"in t?t.id:null};return r?Object.assign(Object.assign({},s),{error:n}):Object.assign(Object.assign({},s),{result:n})}}var E7=function(e,t,n,r){function s(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?a(d.value):s(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})};class fR{constructor(t,n,r=!1){this.requestManager=t,this.registeredSubscriptions=n,this.tolerateUnlinkedSubscription=r,this._subscriptions=new Map,this.requestManager.on(aN.BEFORE_PROVIDER_CHANGE,()=>E7(this,void 0,void 0,function*(){yield this.unsubscribe()})),this.requestManager.on(aN.PROVIDER_CHANGED,()=>{this.clear(),this.listenToProviderEvents()}),this.listenToProviderEvents()}listenToProviderEvents(){const t=this.requestManager.provider;!this.requestManager.provider||typeof(t==null?void 0:t.supportsSubscriptions)=="function"&&!(t!=null&&t.supportsSubscriptions())||typeof this.requestManager.provider.on=="function"&&(typeof this.requestManager.provider.request=="function"?this.requestManager.provider.on("message",n=>this.messageListener(n)):t.on("data",n=>this.messageListener(n)))}messageListener(t){var n,r,s;if(!t)throw new lg("Should not call messageListener with no data. Type was");const a=((n=t.params)===null||n===void 0?void 0:n.subscription)||((r=t.data)===null||r===void 0?void 0:r.subscription)||((s=t.id)===null||s===void 0?void 0:s.toString(16));if(a){const o=this._subscriptions.get(a);o==null||o.processSubscriptionData(t)}}subscribe(t,n){return E7(this,arguments,void 0,function*(r,s,a=dd){const o=this.registeredSubscriptions[r];if(!o)throw new lg("Invalid subscription type");const l=new o(s??void 0,{subscriptionManager:this,returnFormat:a});return yield this.addSubscription(l),l})}get subscriptions(){return this._subscriptions}addSubscription(t){return E7(this,void 0,void 0,function*(){if(!this.requestManager.provider)throw new lO("Provider not available");if(!this.supportsSubscriptions())throw new lg("The current provider does not support subscriptions");if(t.id&&this._subscriptions.has(t.id))throw new lg(`Subscription with id "${t.id}" already exists`);if(yield t.sendSubscriptionRequest(),ni(t.id))throw new lg("Subscription is not subscribed yet.");return this._subscriptions.set(t.id,t),t.id})}removeSubscription(t){return E7(this,void 0,void 0,function*(){const{id:n}=t;if(ni(n))throw new lg("Subscription is not subscribed yet. Or, had already been unsubscribed but not through the Subscription Manager.");if(!this._subscriptions.has(n)&&!this.tolerateUnlinkedSubscription)throw new lg(`Subscription with id "${n.toString()}" does not exists`);return yield t.sendUnsubscribeRequest(),this._subscriptions.delete(n),n})}unsubscribe(t){return E7(this,void 0,void 0,function*(){const n=[];for(const[r,s]of this.subscriptions.entries())(!t||typeof t=="function"&&t({id:r,sub:s}))&&n.push(this.removeSubscription(s));return Promise.all(n)})}clear(){this._subscriptions.clear()}supportsSubscriptions(){return ni(this.requestManager.provider)?!1:A7t(this.requestManager.provider)}}var _7=function(e,t,n,r){function s(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?a(d.value):s(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})};class tT extends l${constructor(t,n){var r;super(),this.args=t;const{requestManager:s}=n,{subscriptionManager:a}=n;s?this._subscriptionManager=new fR(s,{},!0):this._subscriptionManager=a,this._returnFormat=(r=n==null?void 0:n.returnFormat)!==null&&r!==void 0?r:dd}get id(){return this._id}get lastBlock(){return this._lastBlock}subscribe(){return _7(this,void 0,void 0,function*(){return this._subscriptionManager.addSubscription(this)})}processSubscriptionData(t){var n,r;t!=null&&t.data?this._processSubscriptionResult((r=(n=t==null?void 0:t.data)===null||n===void 0?void 0:n.result)!==null&&r!==void 0?r:t==null?void 0:t.data):t&&o$(t)&&this._processSubscriptionResult(t==null?void 0:t.params.result)}sendSubscriptionRequest(){return _7(this,void 0,void 0,function*(){return this._id=yield this._subscriptionManager.requestManager.send({method:"eth_subscribe",params:this._buildSubscriptionParams()}),this.emit("connected",this._id),this._id})}get returnFormat(){return this._returnFormat}get subscriptionManager(){return this._subscriptionManager}resubscribe(){return _7(this,void 0,void 0,function*(){yield this.unsubscribe(),yield this.subscribe()})}unsubscribe(){return _7(this,void 0,void 0,function*(){this.id&&(yield this._subscriptionManager.removeSubscription(this))})}sendUnsubscribeRequest(){return _7(this,void 0,void 0,function*(){yield this._subscriptionManager.requestManager.send({method:"eth_unsubscribe",params:[this.id]}),this._id=void 0})}formatSubscriptionResult(t){return t}_processSubscriptionResult(t){this.emit("data",this.formatSubscriptionResult(t))}_processSubscriptionError(t){this.emit("error",t)}_buildSubscriptionParams(){throw new Error("Implement in the child class")}}var H6=function(e,t,n,r){function s(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?a(d.value):s(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})};class hR extends f4t{constructor(){super(...arguments),this._addressMap=new Map,this._defaultKeyName="web3js_wallet"}static getStorage(){let t;try{t=window.localStorage;const n="__storage_test__";return t.setItem(n,n),t.removeItem(n),t}catch(n){return n&&(n.code===22||n.code===1014||n.name==="QuotaExceededError"||n.name==="NS_ERROR_DOM_QUOTA_REACHED")&&!pr(t)&&t.length!==0?t:void 0}}create(t){for(let n=0;n<t;n+=1)this.add(this._accountProvider.create());return this}add(t){var n;if(typeof t=="string")return this.add(this._accountProvider.privateKeyToAccount(t));let r=this.length;return this.get(t.address)&&(console.warn(`Account ${t.address.toLowerCase()} already exists.`),r=(n=this._addressMap.get(t.address.toLowerCase()))!==null&&n!==void 0?n:r),this._addressMap.set(t.address.toLowerCase(),r),this[r]=t,this}get(t){if(typeof t=="string"){const n=this._addressMap.get(t.toLowerCase());return pr(n)?void 0:this[n]}return this[t]}remove(t){if(typeof t=="string"){const n=this._addressMap.get(t.toLowerCase());return pr(n)?!1:(this._addressMap.delete(t.toLowerCase()),this.splice(n,1),!0)}return this[t]?(this.splice(t,1),!0):!1}clear(){return this._addressMap.clear(),this.length=0,this}encrypt(t,n){return H6(this,void 0,void 0,function*(){return Promise.all(this.map(r=>H6(this,void 0,void 0,function*(){return r.encrypt(t,n)})))})}decrypt(t,n,r){return H6(this,void 0,void 0,function*(){const s=yield Promise.all(t.map(a=>H6(this,void 0,void 0,function*(){return this._accountProvider.decrypt(a,n,r)})));for(const a of s)this.add(a);return this})}save(t,n){return H6(this,void 0,void 0,function*(){const r=hR.getStorage();if(!r)throw new Error("Local storage not available.");return r.setItem(n??this._defaultKeyName,JSON.stringify(yield this.encrypt(t))),!0})}load(t,n){return H6(this,void 0,void 0,function*(){const r=hR.getStorage();if(!r)throw new Error("Local storage not available.");const s=r.getItem(n??this._defaultKeyName);return s&&(yield this.decrypt(JSON.parse(s)||[],t)),this})}}const _0={web:cO};function CFe(e,t,n){if(!n.startsWith("aes-"))throw new Error(`AES submodule doesn't support mode ${n}`);if(t.length!==16)throw new Error("AES: wrong IV length");if(n.startsWith("aes-128")&&e.length!==16||n.startsWith("aes-256")&&e.length!==32)throw new Error("AES: wrong key length")}async function SFe(e,t,n){if(!_0.web)throw new Error("Browser crypto not available.");let r;if(["aes-128-cbc","aes-256-cbc"].includes(e)&&(r="cbc"),["aes-128-ctr","aes-256-ctr"].includes(e)&&(r="ctr"),!r)throw new Error("AES: unsupported mode");return[await _0.web.subtle.importKey("raw",t,{name:`AES-${r.toUpperCase()}`,length:t.length*8},!0,["encrypt","decrypt"]),{name:`aes-${r}`,iv:n,counter:n,length:128}]}async function uoe(e,t,n,r="aes-128-ctr",s=!0){if(CFe(t,n,r),_0.web){const[a,o]=await SFe(r,t,n),l=await _0.web.subtle.encrypt(o,a,e);let c=new Uint8Array(l);return!s&&o.name==="aes-cbc"&&!(e.length%16)&&(c=c.slice(0,-16)),c}else if(_0.node){const a=_0.node.createCipheriv(r,t,n);return a.setAutoPadding(s),QM(a.update(e),a.final())}else throw new Error("The environment doesn't have AES module")}async function j7t(e,t,n,r){const s=e.slice(-16);for(let o=0;o<16;o++)s[o]^=n[o]^16;return(await uoe(s,t,n,r)).slice(0,16)}async function E7t(e,t,n,r="aes-128-ctr",s=!0){if(CFe(t,n,r),_0.web){const[a,o]=await SFe(r,t,n);if(!s&&o.name==="aes-cbc"){const u=await j7t(e,t,n,r);e=QM(e,u)}const l=await _0.web.subtle.decrypt(o,a,e),c=new Uint8Array(l);if(o.name==="aes-cbc"){const u=await uoe(c,t,n,r);if(!SAt(u,e))throw new Error("AES: wrong padding")}return c}else if(_0.node){const a=_0.node.createDecipheriv(r,t,n);return a.setAutoPadding(s),QM(a.update(e),a.final())}else throw new Error("The environment doesn't have AES module")}class NFe extends qae{constructor(t,n){super(),this.finished=!1,this.destroyed=!1,Vae(t);const r=ZS(n);if(this.iHash=t.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const s=this.blockLen,a=new Uint8Array(s);a.set(r.length>s?t.create().update(r).digest():r);for(let o=0;o<a.length;o++)a[o]^=54;this.iHash.update(a),this.oHash=t.create();for(let o=0;o<a.length;o++)a[o]^=106;this.oHash.update(a),a.fill(0)}update(t){return M3(this),this.iHash.update(t),this}digestInto(t){M3(this),MA(t,this.outputLen),this.finished=!0,this.iHash.digestInto(t),this.oHash.update(t),this.oHash.digestInto(t),this.destroy()}digest(){const t=new Uint8Array(this.oHash.outputLen);return this.digestInto(t),t}_cloneInto(t){t||(t=Object.create(Object.getPrototypeOf(this),{}));const{oHash:n,iHash:r,finished:s,destroyed:a,blockLen:o,outputLen:l}=this;return t=t,t.finished=s,t.destroyed=a,t.blockLen=o,t.outputLen=l,t.oHash=n._cloneInto(t.oHash),t.iHash=r._cloneInto(t.iHash),t}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}const doe=(e,t,n)=>new NFe(e,t).update(n).digest();doe.create=(e,t)=>new NFe(e,t);function _7t(e,t,n,r){Vae(e);const s=jPe({dkLen:32,asyncTick:10},r),{c:a,dkLen:o,asyncTick:l}=s;if(qd(a),qd(o),qd(l),a<1)throw new Error("PBKDF2: iterations (c) should be >= 1");const c=ZS(t),u=ZS(n),d=new Uint8Array(o),f=doe.create(e,c),x=f._cloneInto().update(u);return{c:a,dkLen:o,asyncTick:l,DK:d,PRF:f,PRFSalt:x}}function k7t(e,t,n,r,s){return e.destroy(),t.destroy(),r&&r.destroy(),s.fill(0),n}function foe(e,t,n,r){const{c:s,dkLen:a,DK:o,PRF:l,PRFSalt:c}=_7t(e,t,n,r);let u;const d=new Uint8Array(4),f=dO(d),x=new Uint8Array(l.outputLen);for(let g=1,v=0;v<a;g++,v+=l.outputLen){const w=o.subarray(v,v+l.outputLen);f.setInt32(0,g,!1),(u=c._cloneInto(u)).update(d).digestInto(x),w.set(x.subarray(0,w.length));for(let C=1;C<s;C++){l._cloneInto(u).update(x).digestInto(x);for(let N=0;N<w.length;N++)w[N]^=x[N]}}return k7t(l,c,o,u,x)}function T7t(e,t,n,r){if(typeof e.setBigUint64=="function")return e.setBigUint64(t,n,r);const s=BigInt(32),a=BigInt(4294967295),o=Number(n>>s&a),l=Number(n&a),c=r?4:0,u=r?0:4;e.setUint32(t+c,o,r),e.setUint32(t+u,l,r)}const I7t=(e,t,n)=>e&t^~e&n,P7t=(e,t,n)=>e&t^e&n^t&n;class F7t extends qae{constructor(t,n,r,s){super(),this.blockLen=t,this.outputLen=n,this.padOffset=r,this.isLE=s,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(t),this.view=dO(this.buffer)}update(t){M3(this);const{view:n,buffer:r,blockLen:s}=this;t=ZS(t);const a=t.length;for(let o=0;o<a;){const l=Math.min(s-this.pos,a-o);if(l===s){const c=dO(t);for(;s<=a-o;o+=s)this.process(c,o);continue}r.set(t.subarray(o,o+l),this.pos),this.pos+=l,o+=l,this.pos===s&&(this.process(n,0),this.pos=0)}return this.length+=t.length,this.roundClean(),this}digestInto(t){M3(this),Wae(t,this),this.finished=!0;const{buffer:n,view:r,blockLen:s,isLE:a}=this;let{pos:o}=this;n[o++]=128,this.buffer.subarray(o).fill(0),this.padOffset>s-o&&(this.process(r,0),o=0);for(let f=o;f<s;f++)n[f]=0;T7t(r,s-8,BigInt(this.length*8),a),this.process(r,0);const l=dO(t),c=this.outputLen;if(c%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const u=c/4,d=this.get();if(u>d.length)throw new Error("_sha2: outputLen bigger than state");for(let f=0;f<u;f++)l.setUint32(4*f,d[f],a)}digest(){const{buffer:t,outputLen:n}=this;this.digestInto(t);const r=t.slice(0,n);return this.destroy(),r}_cloneInto(t){t||(t=new this.constructor),t.set(...this.get());const{blockLen:n,buffer:r,length:s,finished:a,destroyed:o,pos:l}=this;return t.length=s,t.pos=l,t.finished=a,t.destroyed=o,s%n&&t.buffer.set(r),t}}const O7t=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),fb=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),hb=new Uint32Array(64);class M7t extends F7t{constructor(){super(64,32,8,!1),this.A=fb[0]|0,this.B=fb[1]|0,this.C=fb[2]|0,this.D=fb[3]|0,this.E=fb[4]|0,this.F=fb[5]|0,this.G=fb[6]|0,this.H=fb[7]|0}get(){const{A:t,B:n,C:r,D:s,E:a,F:o,G:l,H:c}=this;return[t,n,r,s,a,o,l,c]}set(t,n,r,s,a,o,l,c){this.A=t|0,this.B=n|0,this.C=r|0,this.D=s|0,this.E=a|0,this.F=o|0,this.G=l|0,this.H=c|0}process(t,n){for(let f=0;f<16;f++,n+=4)hb[f]=t.getUint32(n,!1);for(let f=16;f<64;f++){const x=hb[f-15],g=hb[f-2],v=Qm(x,7)^Qm(x,18)^x>>>3,w=Qm(g,17)^Qm(g,19)^g>>>10;hb[f]=w+hb[f-7]+v+hb[f-16]|0}let{A:r,B:s,C:a,D:o,E:l,F:c,G:u,H:d}=this;for(let f=0;f<64;f++){const x=Qm(l,6)^Qm(l,11)^Qm(l,25),g=d+x+I7t(l,c,u)+O7t[f]+hb[f]|0,w=(Qm(r,2)^Qm(r,13)^Qm(r,22))+P7t(r,s,a)|0;d=u,u=c,c=l,l=o+g|0,o=a,a=s,s=r,r=g+w|0}r=r+this.A|0,s=s+this.B|0,a=a+this.C|0,o=o+this.D|0,l=l+this.E|0,c=c+this.F|0,u=u+this.G|0,d=d+this.H|0,this.set(r,s,a,o,l,c,u,d)}roundClean(){hb.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}const u$=EPe(()=>new M7t);function AFe(e,t,n,r,s){if(!["sha256","sha512"].includes(s))throw new Error("Only sha256 and sha512 are supported");return ZM(e),ZM(t),foe(u$,e,t,{c:n,dkLen:r})}function fge(e,t,n,r,s,a){let o=e[t++]^n[r++],l=e[t++]^n[r++],c=e[t++]^n[r++],u=e[t++]^n[r++],d=e[t++]^n[r++],f=e[t++]^n[r++],x=e[t++]^n[r++],g=e[t++]^n[r++],v=e[t++]^n[r++],w=e[t++]^n[r++],C=e[t++]^n[r++],N=e[t++]^n[r++],P=e[t++]^n[r++],I=e[t++]^n[r++],R=e[t++]^n[r++],F=e[t++]^n[r++],U=o,L=l,z=c,Q=u,ne=d,J=f,X=x,re=g,pe=v,Y=w,ie=C,oe=N,G=P,V=I,ee=R,ae=F;for(let fe=0;fe<8;fe+=2)ne^=pa(U+G|0,7),pe^=pa(ne+U|0,9),G^=pa(pe+ne|0,13),U^=pa(G+pe|0,18),Y^=pa(J+L|0,7),V^=pa(Y+J|0,9),L^=pa(V+Y|0,13),J^=pa(L+V|0,18),ee^=pa(ie+X|0,7),z^=pa(ee+ie|0,9),X^=pa(z+ee|0,13),ie^=pa(X+z|0,18),Q^=pa(ae+oe|0,7),re^=pa(Q+ae|0,9),oe^=pa(re+Q|0,13),ae^=pa(oe+re|0,18),L^=pa(U+Q|0,7),z^=pa(L+U|0,9),Q^=pa(z+L|0,13),U^=pa(Q+z|0,18),X^=pa(J+ne|0,7),re^=pa(X+J|0,9),ne^=pa(re+X|0,13),J^=pa(ne+re|0,18),oe^=pa(ie+Y|0,7),pe^=pa(oe+ie|0,9),Y^=pa(pe+oe|0,13),ie^=pa(Y+pe|0,18),G^=pa(ae+ee|0,7),V^=pa(G+ae|0,9),ee^=pa(V+G|0,13),ae^=pa(ee+V|0,18);s[a++]=o+U|0,s[a++]=l+L|0,s[a++]=c+z|0,s[a++]=u+Q|0,s[a++]=d+ne|0,s[a++]=f+J|0,s[a++]=x+X|0,s[a++]=g+re|0,s[a++]=v+pe|0,s[a++]=w+Y|0,s[a++]=C+ie|0,s[a++]=N+oe|0,s[a++]=P+G|0,s[a++]=I+V|0,s[a++]=R+ee|0,s[a++]=F+ae|0}function fV(e,t,n,r,s){let a=r+0,o=r+16*s;for(let l=0;l<16;l++)n[o+l]=e[t+(2*s-1)*16+l];for(let l=0;l<s;l++,a+=16,t+=16)fge(n,o,e,t,n,a),l>0&&(o+=16),fge(n,a,e,t+=16,n,o)}function R7t(e,t,n){const r=jPe({dkLen:32,asyncTick:10,maxmem:1073742848},n),{N:s,r:a,p:o,dkLen:l,asyncTick:c,maxmem:u,onProgress:d}=r;if(qd(s),qd(a),qd(o),qd(l),qd(c),qd(u),d!==void 0&&typeof d!="function")throw new Error("progressCb should be function");const f=128*a,x=f/4;if(s<=1||s&s-1||s>=2**(f/8)||s>2**32)throw new Error("Scrypt: N must be larger than 1, a power of 2, less than 2^(128 * r / 8) and less than 2^32");if(o<0||o>(2**32-1)*32/f)throw new Error("Scrypt: p must be a positive integer less than or equal to ((2^32 - 1) * 32) / (128 * r)");if(l<0||l>(2**32-1)*32)throw new Error("Scrypt: dkLen should be positive integer less than or equal to (2^32 - 1) * 32");const g=f*(s+o);if(g>u)throw new Error(`Scrypt: parameters too large, ${g} (128 * r * (N + p)) > ${u} (maxmem)`);const v=foe(u$,e,t,{c:1,dkLen:f*o}),w=uO(v),C=uO(new Uint8Array(f*s)),N=uO(new Uint8Array(f));let P=()=>{};if(d){const I=2*s*o,R=Math.max(Math.floor(I/1e4),1);let F=0;P=()=>{F++,d&&(!(F%R)||F===I)&&d(F/I)}}return{N:s,r:a,p:o,dkLen:l,blockSize32:x,V:C,B32:w,B:v,tmp:N,blockMixCb:P,asyncTick:c}}function L7t(e,t,n,r,s){const a=foe(u$,e,n,{c:1,dkLen:t});return n.fill(0),r.fill(0),s.fill(0),a}function D7t(e,t,n){const{N:r,r:s,p:a,dkLen:o,blockSize32:l,V:c,B32:u,B:d,tmp:f,blockMixCb:x}=R7t(e,t,n);YM||XM(u);for(let g=0;g<a;g++){const v=l*g;for(let w=0;w<l;w++)c[w]=u[v+w];for(let w=0,C=0;w<r-1;w++)fV(c,C,c,C+=l,s),x();fV(c,(r-1)*l,u,v,s),x();for(let w=0;w<r;w++){const C=u[v+l-16]%r;for(let N=0;N<l;N++)f[N]=u[v+N]^c[C*l+N];fV(f,0,u,v,s),x()}}return YM||XM(u),L7t(e,o,d,c,f)}function jFe(e,t,n,r,s,a,o){return ZM(e),ZM(t),D7t(e,t,{N:n,r:s,p:r,dkLen:a,onProgress:o})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const EFe=BigInt(0),d$=BigInt(1),B7t=BigInt(2);function H3(e){return e instanceof Uint8Array||e!=null&&typeof e=="object"&&e.constructor.name==="Uint8Array"}function nT(e){if(!H3(e))throw new Error("Uint8Array expected")}const $7t=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function oN(e){nT(e);let t="";for(let n=0;n<e.length;n++)t+=$7t[e[n]];return t}function _Fe(e){const t=e.toString(16);return t.length&1?`0${t}`:t}function hoe(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);return BigInt(e===""?"0":`0x${e}`)}const Hx={_0:48,_9:57,_A:65,_F:70,_a:97,_f:102};function hge(e){if(e>=Hx._0&&e<=Hx._9)return e-Hx._0;if(e>=Hx._A&&e<=Hx._F)return e-(Hx._A-10);if(e>=Hx._a&&e<=Hx._f)return e-(Hx._a-10)}function lN(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);const t=e.length,n=t/2;if(t%2)throw new Error("padded hex string expected, got unpadded hex of length "+t);const r=new Uint8Array(n);for(let s=0,a=0;s<n;s++,a+=2){const o=hge(e.charCodeAt(a)),l=hge(e.charCodeAt(a+1));if(o===void 0||l===void 0){const c=e[a]+e[a+1];throw new Error('hex string expected, got non-hex character "'+c+'" at index '+a)}r[s]=o*16+l}return r}function t3(e){return hoe(oN(e))}function poe(e){return nT(e),hoe(oN(Uint8Array.from(e).reverse()))}function cN(e,t){return lN(e.toString(16).padStart(t*2,"0"))}function moe(e,t){return cN(e,t).reverse()}function U7t(e){return lN(_Fe(e))}function $p(e,t,n){let r;if(typeof t=="string")try{r=lN(t)}catch(a){throw new Error(`${e} must be valid hex string, got "${t}". Cause: ${a}`)}else if(H3(t))r=Uint8Array.from(t);else throw new Error(`${e} must be hex string or Uint8Array`);const s=r.length;if(typeof n=="number"&&s!==n)throw new Error(`${e} expected ${n} bytes, got ${s}`);return r}function $E(...e){let t=0;for(let r=0;r<e.length;r++){const s=e[r];nT(s),t+=s.length}const n=new Uint8Array(t);for(let r=0,s=0;r<e.length;r++){const a=e[r];n.set(a,s),s+=a.length}return n}function z7t(e,t){if(e.length!==t.length)return!1;let n=0;for(let r=0;r<e.length;r++)n|=e[r]^t[r];return n===0}function H7t(e){if(typeof e!="string")throw new Error(`utf8ToBytes expected string, got ${typeof e}`);return new Uint8Array(new TextEncoder().encode(e))}function V7t(e){let t;for(t=0;e>EFe;e>>=d$,t+=1);return t}function W7t(e,t){return e>>BigInt(t)&d$}function q7t(e,t,n){return e|(n?d$:EFe)<<BigInt(t)}const xoe=e=>(B7t<<BigInt(e-1))-d$,hV=e=>new Uint8Array(e),pge=e=>Uint8Array.from(e);function kFe(e,t,n){if(typeof e!="number"||e<2)throw new Error("hashLen must be a number");if(typeof t!="number"||t<2)throw new Error("qByteLen must be a number");if(typeof n!="function")throw new Error("hmacFn must be a function");let r=hV(e),s=hV(e),a=0;const o=()=>{r.fill(1),s.fill(0),a=0},l=(...f)=>n(s,r,...f),c=(f=hV())=>{s=l(pge([0]),f),r=l(),f.length!==0&&(s=l(pge([1]),f),r=l())},u=()=>{if(a++>=1e3)throw new Error("drbg: tried 1000 values");let f=0;const x=[];for(;f<t;){r=l();const g=r.slice();x.push(g),f+=r.length}return $E(...x)};return(f,x)=>{o(),c(f);let g;for(;!(g=x(u()));)c();return o(),g}}const G7t={bigint:e=>typeof e=="bigint",function:e=>typeof e=="function",boolean:e=>typeof e=="boolean",string:e=>typeof e=="string",stringOrUint8Array:e=>typeof e=="string"||H3(e),isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,t)=>t.Fp.isValid(e),hash:e=>typeof e=="function"&&Number.isSafeInteger(e.outputLen)};function rT(e,t,n={}){const r=(s,a,o)=>{const l=G7t[a];if(typeof l!="function")throw new Error(`Invalid validator "${a}", expected function`);const c=e[s];if(!(o&&c===void 0)&&!l(c,e))throw new Error(`Invalid param ${String(s)}=${c} (${typeof c}), expected ${a}`)};for(const[s,a]of Object.entries(t))r(s,a,!1);for(const[s,a]of Object.entries(n))r(s,a,!0);return e}const K7t=Object.freeze(Object.defineProperty({__proto__:null,abytes:nT,bitGet:W7t,bitLen:V7t,bitMask:xoe,bitSet:q7t,bytesToHex:oN,bytesToNumberBE:t3,bytesToNumberLE:poe,concatBytes:$E,createHmacDrbg:kFe,ensureBytes:$p,equalBytes:z7t,hexToBytes:lN,hexToNumber:hoe,isBytes:H3,numberToBytesBE:cN,numberToBytesLE:moe,numberToHexUnpadded:_Fe,numberToVarBytesBE:U7t,utf8ToBytes:H7t,validateObject:rT},Symbol.toStringTag,{value:"Module"}));/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Tc=BigInt(0),vl=BigInt(1),Lv=BigInt(2),Y7t=BigInt(3),wee=BigInt(4),mge=BigInt(5),xge=BigInt(8);BigInt(9);BigInt(16);function Hd(e,t){const n=e%t;return n>=Tc?n:t+n}function X7t(e,t,n){if(n<=Tc||t<Tc)throw new Error("Expected power/modulo > 0");if(n===vl)return Tc;let r=vl;for(;t>Tc;)t&vl&&(r=r*e%n),e=e*e%n,t>>=vl;return r}function yh(e,t,n){let r=e;for(;t-- >Tc;)r*=r,r%=n;return r}function Cee(e,t){if(e===Tc||t<=Tc)throw new Error(`invert: expected positive integers, got n=${e} mod=${t}`);let n=Hd(e,t),r=t,s=Tc,a=vl;for(;n!==Tc;){const l=r/n,c=r%n,u=s-a*l;r=n,n=c,s=a,a=u}if(r!==vl)throw new Error("invert: does not exist");return Hd(s,t)}function Q7t(e){const t=(e-vl)/Lv;let n,r,s;for(n=e-vl,r=0;n%Lv===Tc;n/=Lv,r++);for(s=Lv;s<e&&X7t(s,t,e)!==e-vl;s++);if(r===1){const o=(e+vl)/wee;return function(c,u){const d=c.pow(u,o);if(!c.eql(c.sqr(d),u))throw new Error("Cannot find square root");return d}}const a=(n+vl)/Lv;return function(l,c){if(l.pow(c,t)===l.neg(l.ONE))throw new Error("Cannot find square root");let u=r,d=l.pow(l.mul(l.ONE,s),n),f=l.pow(c,a),x=l.pow(c,n);for(;!l.eql(x,l.ONE);){if(l.eql(x,l.ZERO))return l.ZERO;let g=1;for(let w=l.sqr(x);g<u&&!l.eql(w,l.ONE);g++)w=l.sqr(w);const v=l.pow(d,vl<<BigInt(u-g-1));d=l.sqr(v),f=l.mul(f,v),x=l.mul(x,d),u=g}return f}}function Z7t(e){if(e%wee===Y7t){const t=(e+vl)/wee;return function(r,s){const a=r.pow(s,t);if(!r.eql(r.sqr(a),s))throw new Error("Cannot find square root");return a}}if(e%xge===mge){const t=(e-mge)/xge;return function(r,s){const a=r.mul(s,Lv),o=r.pow(a,t),l=r.mul(s,o),c=r.mul(r.mul(l,Lv),o),u=r.mul(l,r.sub(c,r.ONE));if(!r.eql(r.sqr(u),s))throw new Error("Cannot find square root");return u}}return Q7t(e)}const J7t=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function ejt(e){const t={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},n=J7t.reduce((r,s)=>(r[s]="function",r),t);return rT(e,n)}function tjt(e,t,n){if(n<Tc)throw new Error("Expected power > 0");if(n===Tc)return e.ONE;if(n===vl)return t;let r=e.ONE,s=t;for(;n>Tc;)n&vl&&(r=e.mul(r,s)),s=e.sqr(s),n>>=vl;return r}function njt(e,t){const n=new Array(t.length),r=t.reduce((a,o,l)=>e.is0(o)?a:(n[l]=a,e.mul(a,o)),e.ONE),s=e.inv(r);return t.reduceRight((a,o,l)=>e.is0(o)?a:(n[l]=e.mul(a,n[l]),e.mul(a,o)),s),n}function TFe(e,t){const n=t!==void 0?t:e.toString(2).length,r=Math.ceil(n/8);return{nBitLength:n,nByteLength:r}}function rjt(e,t,n=!1,r={}){if(e<=Tc)throw new Error(`Expected Field ORDER > 0, got ${e}`);const{nBitLength:s,nByteLength:a}=TFe(e,t);if(a>2048)throw new Error("Field lengths over 2048 bytes are not supported");const o=Z7t(e),l=Object.freeze({ORDER:e,BITS:s,BYTES:a,MASK:xoe(s),ZERO:Tc,ONE:vl,create:c=>Hd(c,e),isValid:c=>{if(typeof c!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof c}`);return Tc<=c&&c<e},is0:c=>c===Tc,isOdd:c=>(c&vl)===vl,neg:c=>Hd(-c,e),eql:(c,u)=>c===u,sqr:c=>Hd(c*c,e),add:(c,u)=>Hd(c+u,e),sub:(c,u)=>Hd(c-u,e),mul:(c,u)=>Hd(c*u,e),pow:(c,u)=>tjt(l,c,u),div:(c,u)=>Hd(c*Cee(u,e),e),sqrN:c=>c*c,addN:(c,u)=>c+u,subN:(c,u)=>c-u,mulN:(c,u)=>c*u,inv:c=>Cee(c,e),sqrt:r.sqrt||(c=>o(l,c)),invertBatch:c=>njt(l,c),cmov:(c,u,d)=>d?u:c,toBytes:c=>n?moe(c,a):cN(c,a),fromBytes:c=>{if(c.length!==a)throw new Error(`Fp.fromBytes: expected ${a}, got ${c.length}`);return n?poe(c):t3(c)}});return Object.freeze(l)}function IFe(e){if(typeof e!="bigint")throw new Error("field order must be bigint");const t=e.toString(2).length;return Math.ceil(t/8)}function PFe(e){const t=IFe(e);return t+Math.ceil(t/2)}function sjt(e,t,n=!1){const r=e.length,s=IFe(t),a=PFe(t);if(r<16||r<a||r>1024)throw new Error(`expected ${a}-1024 bytes of input, got ${r}`);const o=n?t3(e):poe(e),l=Hd(o,t-vl)+vl;return n?moe(l,s):cN(l,s)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const ijt=BigInt(0),pV=BigInt(1);function ajt(e,t){const n=(s,a)=>{const o=a.negate();return s?o:a},r=s=>{const a=Math.ceil(t/s)+1,o=2**(s-1);return{windows:a,windowSize:o}};return{constTimeNegate:n,unsafeLadder(s,a){let o=e.ZERO,l=s;for(;a>ijt;)a&pV&&(o=o.add(l)),l=l.double(),a>>=pV;return o},precomputeWindow(s,a){const{windows:o,windowSize:l}=r(a),c=[];let u=s,d=u;for(let f=0;f<o;f++){d=u,c.push(d);for(let x=1;x<l;x++)d=d.add(u),c.push(d);u=d.double()}return c},wNAF(s,a,o){const{windows:l,windowSize:c}=r(s);let u=e.ZERO,d=e.BASE;const f=BigInt(2**s-1),x=2**s,g=BigInt(s);for(let v=0;v<l;v++){const w=v*c;let C=Number(o&f);o>>=g,C>c&&(C-=x,o+=pV);const N=w,P=w+Math.abs(C)-1,I=v%2!==0,R=C<0;C===0?d=d.add(n(I,a[N])):u=u.add(n(R,a[P]))}return{p:u,f:d}},wNAFCached(s,a,o,l){const c=s._WINDOW_SIZE||1;let u=a.get(s);return u||(u=this.precomputeWindow(s,c),c!==1&&a.set(s,l(u))),this.wNAF(c,u,o)}}}function FFe(e){return ejt(e.Fp),rT(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...TFe(e.n,e.nBitLength),...e,p:e.Fp.ORDER})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function ojt(e){const t=FFe(e);rT(t,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:n,Fp:r,a:s}=t;if(n){if(!r.eql(s,r.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if(typeof n!="object"||typeof n.beta!="bigint"||typeof n.splitScalar!="function")throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...t})}const{bytesToNumberBE:ljt,hexToBytes:cjt}=K7t,Qv={Err:class extends Error{constructor(t=""){super(t)}},_parseInt(e){const{Err:t}=Qv;if(e.length<2||e[0]!==2)throw new t("Invalid signature integer tag");const n=e[1],r=e.subarray(2,n+2);if(!n||r.length!==n)throw new t("Invalid signature integer: wrong length");if(r[0]&128)throw new t("Invalid signature integer: negative");if(r[0]===0&&!(r[1]&128))throw new t("Invalid signature integer: unnecessary leading zero");return{d:ljt(r),l:e.subarray(n+2)}},toSig(e){const{Err:t}=Qv,n=typeof e=="string"?cjt(e):e;nT(n);let r=n.length;if(r<2||n[0]!=48)throw new t("Invalid signature tag");if(n[1]!==r-2)throw new t("Invalid signature: incorrect length");const{d:s,l:a}=Qv._parseInt(n.subarray(2)),{d:o,l}=Qv._parseInt(a);if(l.length)throw new t("Invalid signature: left bytes after parsing");return{r:s,s:o}},hexFromSig(e){const t=u=>Number.parseInt(u[0],16)&8?"00"+u:u,n=u=>{const d=u.toString(16);return d.length&1?`0${d}`:d},r=t(n(e.s)),s=t(n(e.r)),a=r.length/2,o=s.length/2,l=n(a),c=n(o);return`30${n(o+a+4)}02${c}${s}02${l}${r}`}},Ig=BigInt(0),Hh=BigInt(1);BigInt(2);const gge=BigInt(3);BigInt(4);function ujt(e){const t=ojt(e),{Fp:n}=t,r=t.toBytes||((v,w,C)=>{const N=w.toAffine();return $E(Uint8Array.from([4]),n.toBytes(N.x),n.toBytes(N.y))}),s=t.fromBytes||(v=>{const w=v.subarray(1),C=n.fromBytes(w.subarray(0,n.BYTES)),N=n.fromBytes(w.subarray(n.BYTES,2*n.BYTES));return{x:C,y:N}});function a(v){const{a:w,b:C}=t,N=n.sqr(v),P=n.mul(N,v);return n.add(n.add(P,n.mul(v,w)),C)}if(!n.eql(n.sqr(t.Gy),a(t.Gx)))throw new Error("bad generator point: equation left != right");function o(v){return typeof v=="bigint"&&Ig<v&&v<t.n}function l(v){if(!o(v))throw new Error("Expected valid bigint: 0 < bigint < curve.n")}function c(v){const{allowedPrivateKeyLengths:w,nByteLength:C,wrapPrivateKey:N,n:P}=t;if(w&&typeof v!="bigint"){if(H3(v)&&(v=oN(v)),typeof v!="string"||!w.includes(v.length))throw new Error("Invalid key");v=v.padStart(C*2,"0")}let I;try{I=typeof v=="bigint"?v:t3($p("private key",v,C))}catch{throw new Error(`private key must be ${C} bytes, hex or bigint, not ${typeof v}`)}return N&&(I=Hd(I,P)),l(I),I}const u=new Map;function d(v){if(!(v instanceof f))throw new Error("ProjectivePoint expected")}class f{constructor(w,C,N){if(this.px=w,this.py=C,this.pz=N,w==null||!n.isValid(w))throw new Error("x required");if(C==null||!n.isValid(C))throw new Error("y required");if(N==null||!n.isValid(N))throw new Error("z required")}static fromAffine(w){const{x:C,y:N}=w||{};if(!w||!n.isValid(C)||!n.isValid(N))throw new Error("invalid affine point");if(w instanceof f)throw new Error("projective point not allowed");const P=I=>n.eql(I,n.ZERO);return P(C)&&P(N)?f.ZERO:new f(C,N,n.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(w){const C=n.invertBatch(w.map(N=>N.pz));return w.map((N,P)=>N.toAffine(C[P])).map(f.fromAffine)}static fromHex(w){const C=f.fromAffine(s($p("pointHex",w)));return C.assertValidity(),C}static fromPrivateKey(w){return f.BASE.multiply(c(w))}_setWindowSize(w){this._WINDOW_SIZE=w,u.delete(this)}assertValidity(){if(this.is0()){if(t.allowInfinityPoint&&!n.is0(this.py))return;throw new Error("bad point: ZERO")}const{x:w,y:C}=this.toAffine();if(!n.isValid(w)||!n.isValid(C))throw new Error("bad point: x or y not FE");const N=n.sqr(C),P=a(w);if(!n.eql(N,P))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){const{y:w}=this.toAffine();if(n.isOdd)return!n.isOdd(w);throw new Error("Field doesn't support isOdd")}equals(w){d(w);const{px:C,py:N,pz:P}=this,{px:I,py:R,pz:F}=w,U=n.eql(n.mul(C,F),n.mul(I,P)),L=n.eql(n.mul(N,F),n.mul(R,P));return U&&L}negate(){return new f(this.px,n.neg(this.py),this.pz)}double(){const{a:w,b:C}=t,N=n.mul(C,gge),{px:P,py:I,pz:R}=this;let F=n.ZERO,U=n.ZERO,L=n.ZERO,z=n.mul(P,P),Q=n.mul(I,I),ne=n.mul(R,R),J=n.mul(P,I);return J=n.add(J,J),L=n.mul(P,R),L=n.add(L,L),F=n.mul(w,L),U=n.mul(N,ne),U=n.add(F,U),F=n.sub(Q,U),U=n.add(Q,U),U=n.mul(F,U),F=n.mul(J,F),L=n.mul(N,L),ne=n.mul(w,ne),J=n.sub(z,ne),J=n.mul(w,J),J=n.add(J,L),L=n.add(z,z),z=n.add(L,z),z=n.add(z,ne),z=n.mul(z,J),U=n.add(U,z),ne=n.mul(I,R),ne=n.add(ne,ne),z=n.mul(ne,J),F=n.sub(F,z),L=n.mul(ne,Q),L=n.add(L,L),L=n.add(L,L),new f(F,U,L)}add(w){d(w);const{px:C,py:N,pz:P}=this,{px:I,py:R,pz:F}=w;let U=n.ZERO,L=n.ZERO,z=n.ZERO;const Q=t.a,ne=n.mul(t.b,gge);let J=n.mul(C,I),X=n.mul(N,R),re=n.mul(P,F),pe=n.add(C,N),Y=n.add(I,R);pe=n.mul(pe,Y),Y=n.add(J,X),pe=n.sub(pe,Y),Y=n.add(C,P);let ie=n.add(I,F);return Y=n.mul(Y,ie),ie=n.add(J,re),Y=n.sub(Y,ie),ie=n.add(N,P),U=n.add(R,F),ie=n.mul(ie,U),U=n.add(X,re),ie=n.sub(ie,U),z=n.mul(Q,Y),U=n.mul(ne,re),z=n.add(U,z),U=n.sub(X,z),z=n.add(X,z),L=n.mul(U,z),X=n.add(J,J),X=n.add(X,J),re=n.mul(Q,re),Y=n.mul(ne,Y),X=n.add(X,re),re=n.sub(J,re),re=n.mul(Q,re),Y=n.add(Y,re),J=n.mul(X,Y),L=n.add(L,J),J=n.mul(ie,Y),U=n.mul(pe,U),U=n.sub(U,J),J=n.mul(pe,X),z=n.mul(ie,z),z=n.add(z,J),new f(U,L,z)}subtract(w){return this.add(w.negate())}is0(){return this.equals(f.ZERO)}wNAF(w){return g.wNAFCached(this,u,w,C=>{const N=n.invertBatch(C.map(P=>P.pz));return C.map((P,I)=>P.toAffine(N[I])).map(f.fromAffine)})}multiplyUnsafe(w){const C=f.ZERO;if(w===Ig)return C;if(l(w),w===Hh)return this;const{endo:N}=t;if(!N)return g.unsafeLadder(this,w);let{k1neg:P,k1:I,k2neg:R,k2:F}=N.splitScalar(w),U=C,L=C,z=this;for(;I>Ig||F>Ig;)I&Hh&&(U=U.add(z)),F&Hh&&(L=L.add(z)),z=z.double(),I>>=Hh,F>>=Hh;return P&&(U=U.negate()),R&&(L=L.negate()),L=new f(n.mul(L.px,N.beta),L.py,L.pz),U.add(L)}multiply(w){l(w);let C=w,N,P;const{endo:I}=t;if(I){const{k1neg:R,k1:F,k2neg:U,k2:L}=I.splitScalar(C);let{p:z,f:Q}=this.wNAF(F),{p:ne,f:J}=this.wNAF(L);z=g.constTimeNegate(R,z),ne=g.constTimeNegate(U,ne),ne=new f(n.mul(ne.px,I.beta),ne.py,ne.pz),N=z.add(ne),P=Q.add(J)}else{const{p:R,f:F}=this.wNAF(C);N=R,P=F}return f.normalizeZ([N,P])[0]}multiplyAndAddUnsafe(w,C,N){const P=f.BASE,I=(F,U)=>U===Ig||U===Hh||!F.equals(P)?F.multiplyUnsafe(U):F.multiply(U),R=I(this,C).add(I(w,N));return R.is0()?void 0:R}toAffine(w){const{px:C,py:N,pz:P}=this,I=this.is0();w==null&&(w=I?n.ONE:n.inv(P));const R=n.mul(C,w),F=n.mul(N,w),U=n.mul(P,w);if(I)return{x:n.ZERO,y:n.ZERO};if(!n.eql(U,n.ONE))throw new Error("invZ was invalid");return{x:R,y:F}}isTorsionFree(){const{h:w,isTorsionFree:C}=t;if(w===Hh)return!0;if(C)return C(f,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:w,clearCofactor:C}=t;return w===Hh?this:C?C(f,this):this.multiplyUnsafe(t.h)}toRawBytes(w=!0){return this.assertValidity(),r(f,this,w)}toHex(w=!0){return oN(this.toRawBytes(w))}}f.BASE=new f(t.Gx,t.Gy,n.ONE),f.ZERO=new f(n.ZERO,n.ONE,n.ZERO);const x=t.nBitLength,g=ajt(f,t.endo?Math.ceil(x/2):x);return{CURVE:t,ProjectivePoint:f,normPrivateKeyToScalar:c,weierstrassEquation:a,isWithinCurveOrder:o}}function djt(e){const t=FFe(e);return rT(t,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...t})}function fjt(e){const t=djt(e),{Fp:n,n:r}=t,s=n.BYTES+1,a=2*n.BYTES+1;function o(Y){return Ig<Y&&Y<n.ORDER}function l(Y){return Hd(Y,r)}function c(Y){return Cee(Y,r)}const{ProjectivePoint:u,normPrivateKeyToScalar:d,weierstrassEquation:f,isWithinCurveOrder:x}=ujt({...t,toBytes(Y,ie,oe){const G=ie.toAffine(),V=n.toBytes(G.x),ee=$E;return oe?ee(Uint8Array.from([ie.hasEvenY()?2:3]),V):ee(Uint8Array.from([4]),V,n.toBytes(G.y))},fromBytes(Y){const ie=Y.length,oe=Y[0],G=Y.subarray(1);if(ie===s&&(oe===2||oe===3)){const V=t3(G);if(!o(V))throw new Error("Point is not on curve");const ee=f(V);let ae;try{ae=n.sqrt(ee)}catch(he){const ge=he instanceof Error?": "+he.message:"";throw new Error("Point is not on curve"+ge)}const fe=(ae&Hh)===Hh;return(oe&1)===1!==fe&&(ae=n.neg(ae)),{x:V,y:ae}}else if(ie===a&&oe===4){const V=n.fromBytes(G.subarray(0,n.BYTES)),ee=n.fromBytes(G.subarray(n.BYTES,2*n.BYTES));return{x:V,y:ee}}else throw new Error(`Point of length ${ie} was invalid. Expected ${s} compressed bytes or ${a} uncompressed bytes`)}}),g=Y=>oN(cN(Y,t.nByteLength));function v(Y){const ie=r>>Hh;return Y>ie}function w(Y){return v(Y)?l(-Y):Y}const C=(Y,ie,oe)=>t3(Y.slice(ie,oe));class N{constructor(ie,oe,G){this.r=ie,this.s=oe,this.recovery=G,this.assertValidity()}static fromCompact(ie){const oe=t.nByteLength;return ie=$p("compactSignature",ie,oe*2),new N(C(ie,0,oe),C(ie,oe,2*oe))}static fromDER(ie){const{r:oe,s:G}=Qv.toSig($p("DER",ie));return new N(oe,G)}assertValidity(){if(!x(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!x(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(ie){return new N(this.r,this.s,ie)}recoverPublicKey(ie){const{r:oe,s:G,recovery:V}=this,ee=L($p("msgHash",ie));if(V==null||![0,1,2,3].includes(V))throw new Error("recovery id invalid");const ae=V===2||V===3?oe+t.n:oe;if(ae>=n.ORDER)throw new Error("recovery id 2 or 3 invalid");const fe=V&1?"03":"02",Ne=u.fromHex(fe+g(ae)),he=c(ae),ge=l(-ee*he),ye=l(G*he),ve=u.BASE.multiplyAndAddUnsafe(Ne,ge,ye);if(!ve)throw new Error("point at infinify");return ve.assertValidity(),ve}hasHighS(){return v(this.s)}normalizeS(){return this.hasHighS()?new N(this.r,l(-this.s),this.recovery):this}toDERRawBytes(){return lN(this.toDERHex())}toDERHex(){return Qv.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return lN(this.toCompactHex())}toCompactHex(){return g(this.r)+g(this.s)}}const P={isValidPrivateKey(Y){try{return d(Y),!0}catch{return!1}},normPrivateKeyToScalar:d,randomPrivateKey:()=>{const Y=PFe(t.n);return sjt(t.randomBytes(Y),t.n)},precompute(Y=8,ie=u.BASE){return ie._setWindowSize(Y),ie.multiply(BigInt(3)),ie}};function I(Y,ie=!0){return u.fromPrivateKey(Y).toRawBytes(ie)}function R(Y){const ie=H3(Y),oe=typeof Y=="string",G=(ie||oe)&&Y.length;return ie?G===s||G===a:oe?G===2*s||G===2*a:Y instanceof u}function F(Y,ie,oe=!0){if(R(Y))throw new Error("first arg must be private key");if(!R(ie))throw new Error("second arg must be public key");return u.fromHex(ie).multiply(d(Y)).toRawBytes(oe)}const U=t.bits2int||function(Y){const ie=t3(Y),oe=Y.length*8-t.nBitLength;return oe>0?ie>>BigInt(oe):ie},L=t.bits2int_modN||function(Y){return l(U(Y))},z=xoe(t.nBitLength);function Q(Y){if(typeof Y!="bigint")throw new Error("bigint expected");if(!(Ig<=Y&&Y<z))throw new Error(`bigint expected < 2^${t.nBitLength}`);return cN(Y,t.nByteLength)}function ne(Y,ie,oe=J){if(["recovered","canonical"].some(Ie=>Ie in oe))throw new Error("sign() legacy options not supported");const{hash:G,randomBytes:V}=t;let{lowS:ee,prehash:ae,extraEntropy:fe}=oe;ee==null&&(ee=!0),Y=$p("msgHash",Y),ae&&(Y=$p("prehashed msgHash",G(Y)));const Ne=L(Y),he=d(ie),ge=[Q(he),Q(Ne)];if(fe!=null&&fe!==!1){const Ie=fe===!0?V(n.BYTES):fe;ge.push($p("extraEntropy",Ie))}const ye=$E(...ge),ve=Ne;function je(Ie){const Le=U(Ie);if(!x(Le))return;const Qe=c(Le),$e=u.BASE.multiply(Le).toAffine(),it=l($e.x);if(it===Ig)return;const tt=l(Qe*l(ve+it*he));if(tt===Ig)return;let lt=($e.x===it?0:2)|Number($e.y&Hh),ft=tt;return ee&&v(tt)&&(ft=w(tt),lt^=1),new N(it,ft,lt)}return{seed:ye,k2sig:je}}const J={lowS:t.lowS,prehash:!1},X={lowS:t.lowS,prehash:!1};function re(Y,ie,oe=J){const{seed:G,k2sig:V}=ne(Y,ie,oe),ee=t;return kFe(ee.hash.outputLen,ee.nByteLength,ee.hmac)(G,V)}u.BASE._setWindowSize(8);function pe(Y,ie,oe,G=X){var $e;const V=Y;if(ie=$p("msgHash",ie),oe=$p("publicKey",oe),"strict"in G)throw new Error("options.strict was renamed to lowS");const{lowS:ee,prehash:ae}=G;let fe,Ne;try{if(typeof V=="string"||H3(V))try{fe=N.fromDER(V)}catch(it){if(!(it instanceof Qv.Err))throw it;fe=N.fromCompact(V)}else if(typeof V=="object"&&typeof V.r=="bigint"&&typeof V.s=="bigint"){const{r:it,s:tt}=V;fe=new N(it,tt)}else throw new Error("PARSE");Ne=u.fromHex(oe)}catch(it){if(it.message==="PARSE")throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(ee&&fe.hasHighS())return!1;ae&&(ie=t.hash(ie));const{r:he,s:ge}=fe,ye=L(ie),ve=c(ge),je=l(ye*ve),Ie=l(he*ve),Le=($e=u.BASE.multiplyAndAddUnsafe(Ne,je,Ie))==null?void 0:$e.toAffine();return Le?l(Le.x)===he:!1}return{CURVE:t,getPublicKey:I,getSharedSecret:F,sign:re,verify:pe,ProjectivePoint:u,Signature:N,utils:P}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function hjt(e){return{hash:e,hmac:(t,...n)=>doe(e,t,QM(...n)),randomBytes:_Pe}}function pjt(e,t){const n=r=>fjt({...e,...hjt(r)});return Object.freeze({...n(t),create:n})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const OFe=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),bge=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),mjt=BigInt(1),See=BigInt(2),yge=(e,t)=>(e+t/See)/t;function xjt(e){const t=OFe,n=BigInt(3),r=BigInt(6),s=BigInt(11),a=BigInt(22),o=BigInt(23),l=BigInt(44),c=BigInt(88),u=e*e*e%t,d=u*u*e%t,f=yh(d,n,t)*d%t,x=yh(f,n,t)*d%t,g=yh(x,See,t)*u%t,v=yh(g,s,t)*g%t,w=yh(v,a,t)*v%t,C=yh(w,l,t)*w%t,N=yh(C,c,t)*C%t,P=yh(N,l,t)*w%t,I=yh(P,n,t)*d%t,R=yh(I,o,t)*v%t,F=yh(R,r,t)*u%t,U=yh(F,See,t);if(!Nee.eql(Nee.sqr(U),e))throw new Error("Cannot find square root");return U}const Nee=rjt(OFe,void 0,void 0,{sqrt:xjt}),goe=pjt({a:BigInt(0),b:BigInt(7),Fp:Nee,n:bge,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:e=>{const t=bge,n=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),r=-mjt*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),s=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),a=n,o=BigInt("0x100000000000000000000000000000000"),l=yge(a*e,t),c=yge(-r*e,t);let u=Hd(e-l*n-c*s,t),d=Hd(-l*r-c*a,t);const f=u>o,x=d>o;if(f&&(u=t-u),x&&(d=t-d),u>o||d>o)throw new Error("splitScalar: Endomorphism failed, k="+e);return{k1neg:f,k1:u,k2neg:x,k2:d}}}},u$);BigInt(0);goe.ProjectivePoint;const gjt=Object.freeze(Object.defineProperty({__proto__:null,secp256k1:goe},Symbol.toStringTag,{value:"Module"}));var mV;const j1=(mV=goe)!==null&&mV!==void 0?mV:gjt,vge=BigInt("0xffffffffffffffff"),UE=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),bjt=j1.CURVE.n,yjt=bjt/BigInt(2),vjt={type:"object",required:["crypto","id","version","address"],properties:{crypto:{type:"object",required:["cipher","ciphertext","cipherparams","kdf","kdfparams","mac"],properties:{cipher:{type:"string"},ciphertext:{type:"string"},cipherparams:{type:"object"},kdf:{type:"string"},kdfparams:{type:"object"},salt:{type:"string"},mac:{type:"string"}}},id:{type:"string"},version:{type:"number"},address:{type:"string"}}};var pR;(function(e){e[e.Mainnet=1]="Mainnet",e[e.Goerli=5]="Goerli",e[e.Sepolia=11155111]="Sepolia"})(pR||(pR={}));var so;(function(e){e.Chainstart="chainstart",e.Homestead="homestead",e.Dao="dao",e.TangerineWhistle="tangerineWhistle",e.SpuriousDragon="spuriousDragon",e.Byzantium="byzantium",e.Constantinople="constantinople",e.Petersburg="petersburg",e.Istanbul="istanbul",e.MuirGlacier="muirGlacier",e.Berlin="berlin",e.London="london",e.ArrowGlacier="arrowGlacier",e.GrayGlacier="grayGlacier",e.MergeForkIdTransition="mergeForkIdTransition",e.Merge="merge",e.Shanghai="shanghai",e.ShardingForkDev="shardingFork"})(so||(so={}));var wge;(function(e){e.ProofOfStake="pos",e.ProofOfWork="pow",e.ProofOfAuthority="poa"})(wge||(wge={}));var Cge;(function(e){e.Ethash="ethash",e.Clique="clique",e.Casper="casper"})(Cge||(Cge={}));var xu;(function(e){e.PolygonMainnet="polygon-mainnet",e.PolygonMumbai="polygon-mumbai",e.ArbitrumRinkebyTestnet="arbitrum-rinkeby-testnet",e.ArbitrumOne="arbitrum-one",e.xDaiChain="x-dai-chain",e.OptimisticKovan="optimistic-kovan",e.OptimisticEthereum="optimistic-ethereum"})(xu||(xu={}));var Gh;(function(e){e[e.Number=0]="Number",e[e.BigInt=1]="BigInt",e[e.Uint8Array=2]="Uint8Array",e[e.PrefixedHexString=3]="PrefixedHexString"})(Gh||(Gh={}));const MFe=e=>{if(typeof e!="string")throw new Error(`[stripHexPrefix] input must be type 'string', received ${typeof e}`);return Xae(e)?e.slice(2):e};function wjt(e){return!e||e==="0x0"?"0x0000000000000000":Xae(e)?`0x${MFe(e).padStart(16,"0")}`:`0x${e.padStart(16,"0")}`}const RFe=function(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`Received an invalid integer type: ${e}`);return`0x${e.toString(16)}`};function Cjt(e,t=!0){var n,r;const{name:s,config:a,difficulty:o,mixHash:l,gasLimit:c,coinbase:u,baseFeePerGas:d}=e;let{extraData:f,timestamp:x,nonce:g}=e;const v=Number(x),{chainId:w}=a;if(f===""&&(f="0x"),Xae(x)||(x=RFe(parseInt(x))),g.length!==18&&(g=wjt(g)),a.eip155Block!==a.eip158Block)throw new Error("EIP155 block number must equal EIP 158 block number since both are part of SpuriousDragon hardfork and the client only supports activating the full hardfork");const C={name:s,chainId:w,networkId:w,genesis:{timestamp:x,gasLimit:parseInt(c),difficulty:parseInt(o),nonce:g,extraData:f,mixHash:l,coinbase:u,baseFeePerGas:d},hardfork:void 0,hardforks:[],bootstrapNodes:[],consensus:a.clique!==void 0?{type:"poa",algorithm:"clique",clique:{period:(n=a.clique.period)!==null&&n!==void 0?n:a.clique.blockperiodseconds,epoch:(r=a.clique.epoch)!==null&&r!==void 0?r:a.clique.epochlength}}:{type:"pow",algorithm:"ethash",ethash:{}}},N={[so.Homestead]:{name:"homesteadBlock"},[so.Dao]:{name:"daoForkBlock"},[so.TangerineWhistle]:{name:"eip150Block"},[so.SpuriousDragon]:{name:"eip155Block"},[so.Byzantium]:{name:"byzantiumBlock"},[so.Constantinople]:{name:"constantinopleBlock"},[so.Petersburg]:{name:"petersburgBlock"},[so.Istanbul]:{name:"istanbulBlock"},[so.MuirGlacier]:{name:"muirGlacierBlock"},[so.Berlin]:{name:"berlinBlock"},[so.London]:{name:"londonBlock"},[so.MergeForkIdTransition]:{name:"mergeForkBlock",postMerge:t},[so.Shanghai]:{name:"shanghaiTime",postMerge:!0,isTimestamp:!0},[so.ShardingForkDev]:{name:"shardingForkTime",postMerge:!0,isTimestamp:!0}},P=Object.keys(N).reduce((F,U)=>(F[N[U].name]=U,F),{}),I=Object.keys(a).filter(F=>P[F]!==void 0&&a[F]!==void 0&&a[F]!==null);if(C.hardforks=I.map(F=>({name:P[F],block:N[P[F]].isTimestamp===!0||typeof a[F]!="number"?null:a[F],timestamp:N[P[F]].isTimestamp===!0&&typeof a[F]=="number"?a[F]:void 0})).filter(F=>F.block!==null||F.timestamp!==void 0),C.hardforks.sort((F,U)=>{var L,z;return((L=F.block)!==null&&L!==void 0?L:1/0)-((z=U.block)!==null&&z!==void 0?z:1/0)}),C.hardforks.sort((F,U)=>{var L,z;return((L=F.timestamp)!==null&&L!==void 0?L:v)-((z=U.timestamp)!==null&&z!==void 0?z:v)}),a.terminalTotalDifficulty!==void 0){const F={name:so.Merge,ttd:a.terminalTotalDifficulty,block:null},U=C.hardforks.findIndex(L=>{var z;return((z=N[L.name])===null||z===void 0?void 0:z.postMerge)===!0});U!==-1?C.hardforks.splice(U,0,F):C.hardforks.push(F)}const R=C.hardforks.length>0?C.hardforks.slice(-1)[0]:void 0;return C.hardfork=R==null?void 0:R.name,C.hardforks.unshift({name:so.Chainstart,block:0}),C}function Sjt(e,t,n){try{if(["config","difficulty","gasLimit","alloc"].some(r=>!(r in e)))throw new Error("Invalid format, expected geth genesis fields missing");return t!==void 0&&(e.name=t),Cjt(e,n)}catch(r){throw new Error(`Error parsing parameters file: ${r.message}`)}}function LFe(e){let t=e;if(typeof t!="string")throw new Error(`[padToEven] value must be type 'string', received ${typeof t}`);return t.length%2&&(t=`0${t}`),t}const Njt=function(e){const t=RFe(e);return oo(`0x${LFe(t.slice(2))}`)},ko=function(e){var t;if(e==null)return new Uint8Array;if(e instanceof Uint8Array)return e;if(((t=e==null?void 0:e.constructor)===null||t===void 0?void 0:t.name)==="Uint8Array"||Array.isArray(e))return Uint8Array.from(e);if(typeof e=="string"){if(!qPe(e))throw new Error(`Cannot convert string to Uint8Array. only supports 0x-prefixed hex strings and this string was given: ${e}`);return oo(LFe(MFe(e)))}if(typeof e=="number")return ko(nc(e));if(typeof e=="bigint"){if(e<BigInt(0))throw new Error(`Cannot convert negative bigint to Uint8Array. Given: ${e}`);let n=e.toString(16);return n.length%2&&(n=`0${n}`),ko(`0x${n}`)}if(e.toArray)return Uint8Array.from(e.toArray());throw new Error("invalid type")};function Ka(e){const t=Wi(e);return BigInt(t==="0x"?0:t)}function Ajt(e){return ko(`0x${e.toString(16)}`)}const DFe=function(e){return new Uint8Array(e).fill(0)},jjt=function(e,t,n){const r=DFe(t);return e.length<t?(r.set(e,t-e.length),r):e.subarray(-t)};function boe(e){if(!u2(e)){const t=`This method only supports Uint8Array but input was: ${e}`;throw new Error(t)}}const Sge=function(e,t){return boe(e),jjt(e,t)};function Ejt(e){let t=e[0];for(;e.length>0&&t.toString()==="0";)e=e.slice(1),t=e[0];return e}const mR=function(e){return boe(e),Ejt(e)},To=e=>`0x${e.toString(16)}`;function oa(e){return mR(Ajt(e))}function _jt(e,t){return e===BigInt(0)||e===BigInt(1)?e:t===void 0?e-BigInt(27):e-(t*BigInt(2)+BigInt(35))}function kjt(e){return e===BigInt(0)||e===BigInt(1)}const yoe=function(e,t,n,r,s){const a=_jt(t,s);if(!kjt(a))throw new Error("Invalid signature v value");return new j1.Signature(Ka(n),Ka(r)).addRecoveryBit(Number(a)).recoverPublicKey(e).toRawBytes(!1).slice(1)};function V6(e,t){if(e===null)return null;if(e===void 0)return;if(typeof e=="string"&&!qPe(e))throw new Error(`A string must be provided with a 0x-prefix, given: ${e}`);if(typeof e=="number"&&!Number.isSafeInteger(e))throw new Error("The provided number is greater than MAX_SAFE_INTEGER (please use an alternative input type)");const n=ko(e);switch(t){case Gh.Uint8Array:return n;case Gh.BigInt:return Ka(n);case Gh.Number:{const r=Ka(n);if(r>BigInt(Number.MAX_SAFE_INTEGER))throw new Error("The provided number is greater than MAX_SAFE_INTEGER (please use an alternative output type)");return Number(r)}case Gh.PrefixedHexString:return Wi(n);default:throw new Error("unknown outputType")}}var Tp={},Nge;function Tjt(){if(Nge)return Tp;Nge=1,Object.defineProperty(Tp,"__esModule",{value:!0}),Tp.RLP=Tp.utils=Tp.decode=Tp.encode=void 0;function e(N){if(Array.isArray(N)){const I=[];let R=0;for(let F=0;F<N.length;F++){const U=e(N[F]);I.push(U),R+=U.length}return d(r(R,192),...I)}const P=C(N);return P.length===1&&P[0]<128?P:d(r(P.length,128),P)}Tp.encode=e;function t(N,P,I){if(I>N.length)throw new Error("invalid RLP (safeSlice): end slice of Uint8Array out-of-bounds");return N.slice(P,I)}function n(N){if(N[0]===0)throw new Error("invalid RLP: extra zeros");return c(l(N))}function r(N,P){if(N<56)return Uint8Array.from([N+P]);const I=x(N),R=I.length/2,F=x(P+55+R);return Uint8Array.from(u(F+I))}function s(N,P=!1){if(typeof N>"u"||N===null||N.length===0)return Uint8Array.from([]);const I=C(N),R=a(I);if(P)return R;if(R.remainder.length!==0)throw new Error("invalid RLP: remainder must be zero");return R.data}Tp.decode=s;function a(N){let P,I,R,F,U;const L=[],z=N[0];if(z<=127)return{data:N.slice(0,1),remainder:N.slice(1)};if(z<=183){if(P=z-127,z===128?R=Uint8Array.from([]):R=t(N,1,P),P===2&&R[0]<128)throw new Error("invalid RLP encoding: invalid prefix, single byte < 0x80 are not prefixed");return{data:R,remainder:N.slice(P)}}else if(z<=191){if(I=z-182,N.length-1<I)throw new Error("invalid RLP: not enough bytes for string length");if(P=n(t(N,1,I)),P<=55)throw new Error("invalid RLP: expected string length to be greater than 55");return R=t(N,I,P+I),{data:R,remainder:N.slice(P+I)}}else if(z<=247){for(P=z-191,F=t(N,1,P);F.length;)U=a(F),L.push(U.data),F=U.remainder;return{data:L,remainder:N.slice(P)}}else{if(I=z-246,P=n(t(N,1,I)),P<56)throw new Error("invalid RLP: encoded list too short");const Q=I+P;if(Q>N.length)throw new Error("invalid RLP: total length is larger than the data");for(F=t(N,I,Q);F.length;)U=a(F),L.push(U.data),F=U.remainder;return{data:L,remainder:N.slice(Q)}}}const o=Array.from({length:256},(N,P)=>P.toString(16).padStart(2,"0"));function l(N){let P="";for(let I=0;I<N.length;I++)P+=o[N[I]];return P}function c(N){const P=Number.parseInt(N,16);if(Number.isNaN(P))throw new Error("Invalid byte sequence");return P}function u(N){if(typeof N!="string")throw new TypeError("hexToBytes: expected string, got "+typeof N);if(N.length%2)throw new Error("hexToBytes: received invalid unpadded hex");const P=new Uint8Array(N.length/2);for(let I=0;I<P.length;I++){const R=I*2;P[I]=c(N.slice(R,R+2))}return P}function d(...N){if(N.length===1)return N[0];const P=N.reduce((R,F)=>R+F.length,0),I=new Uint8Array(P);for(let R=0,F=0;R<N.length;R++){const U=N[R];I.set(U,F),F+=U.length}return I}function f(N){return new TextEncoder().encode(N)}function x(N){if(N<0)throw new Error("Invalid integer as argument, must be unsigned!");const P=N.toString(16);return P.length%2?`0${P}`:P}function g(N){return N.length%2?`0${N}`:N}function v(N){return N.length>=2&&N[0]==="0"&&N[1]==="x"}function w(N){return typeof N!="string"?N:v(N)?N.slice(2):N}function C(N){if(N instanceof Uint8Array)return N;if(typeof N=="string")return v(N)?u(g(w(N))):f(N);if(typeof N=="number"||typeof N=="bigint")return N?u(x(N)):Uint8Array.from([]);if(N==null)return Uint8Array.from([]);throw new Error("toBytes: received unsupported type "+typeof N)}return Tp.utils={bytesToHex:l,concatBytes:d,hexToBytes:u,utf8ToBytes:f},Tp.RLP={encode:e,decode:s},Tp}var Kh=Tjt(),xV={};/*! crc32.js (C) 2014-present SheetJS -- http://sheetjs.com */var Age;function Ijt(){return Age||(Age=1,function(e){(function(t){t(typeof DO_NOT_EXPORT_CRC>"u"?e:{})})(function(t){t.version="1.2.2";function n(){for(var z=0,Q=new Array(256),ne=0;ne!=256;++ne)z=ne,z=z&1?-306674912^z>>>1:z>>>1,z=z&1?-306674912^z>>>1:z>>>1,z=z&1?-306674912^z>>>1:z>>>1,z=z&1?-306674912^z>>>1:z>>>1,z=z&1?-306674912^z>>>1:z>>>1,z=z&1?-306674912^z>>>1:z>>>1,z=z&1?-306674912^z>>>1:z>>>1,z=z&1?-306674912^z>>>1:z>>>1,Q[ne]=z;return typeof Int32Array<"u"?new Int32Array(Q):Q}var r=n();function s(z){var Q=0,ne=0,J=0,X=typeof Int32Array<"u"?new Int32Array(4096):new Array(4096);for(J=0;J!=256;++J)X[J]=z[J];for(J=0;J!=256;++J)for(ne=z[J],Q=256+J;Q<4096;Q+=256)ne=X[Q]=ne>>>8^z[ne&255];var re=[];for(J=1;J!=16;++J)re[J-1]=typeof Int32Array<"u"?X.subarray(J*256,J*256+256):X.slice(J*256,J*256+256);return re}var a=s(r),o=a[0],l=a[1],c=a[2],u=a[3],d=a[4],f=a[5],x=a[6],g=a[7],v=a[8],w=a[9],C=a[10],N=a[11],P=a[12],I=a[13],R=a[14];function F(z,Q){for(var ne=Q^-1,J=0,X=z.length;J<X;)ne=ne>>>8^r[(ne^z.charCodeAt(J++))&255];return~ne}function U(z,Q){for(var ne=Q^-1,J=z.length-15,X=0;X<J;)ne=R[z[X++]^ne&255]^I[z[X++]^ne>>8&255]^P[z[X++]^ne>>16&255]^N[z[X++]^ne>>>24]^C[z[X++]]^w[z[X++]]^v[z[X++]]^g[z[X++]]^x[z[X++]]^f[z[X++]]^d[z[X++]]^u[z[X++]]^c[z[X++]]^l[z[X++]]^o[z[X++]]^r[z[X++]];for(J+=15;X<J;)ne=ne>>>8^r[(ne^z[X++])&255];return~ne}function L(z,Q){for(var ne=Q^-1,J=0,X=z.length,re=0,pe=0;J<X;)re=z.charCodeAt(J++),re<128?ne=ne>>>8^r[(ne^re)&255]:re<2048?(ne=ne>>>8^r[(ne^(192|re>>6&31))&255],ne=ne>>>8^r[(ne^(128|re&63))&255]):re>=55296&&re<57344?(re=(re&1023)+64,pe=z.charCodeAt(J++)&1023,ne=ne>>>8^r[(ne^(240|re>>8&7))&255],ne=ne>>>8^r[(ne^(128|re>>2&63))&255],ne=ne>>>8^r[(ne^(128|pe>>6&15|(re&3)<<4))&255],ne=ne>>>8^r[(ne^(128|pe&63))&255]):(ne=ne>>>8^r[(ne^(224|re>>12&15))&255],ne=ne>>>8^r[(ne^(128|re>>6&63))&255],ne=ne>>>8^r[(ne^(128|re&63))&255]);return~ne}t.table=r,t.bstr=F,t.buf=U,t.str=L})}(xV)),xV}var Pjt=Ijt();const Fjt=Ti(Pjt),Ojt={name:"goerli",chainId:5,networkId:5,defaultHardfork:"merge",consensus:{type:"poa",algorithm:"clique",clique:{period:15,epoch:3e4}},comment:"Cross-client PoA test network",url:"https://github.com/goerli/testnet",genesis:{timestamp:"0x5c51a607",gasLimit:10485760,difficulty:1,nonce:"0x0000000000000000",extraData:"0x22466c6578692069732061207468696e6722202d204166726900000000000000e0a2bd4258d2768837baa26a28fe71dc079f84c70000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"},hardforks:[{name:"chainstart",block:0,forkHash:"0xa3f5ab08"},{name:"homestead",block:0,forkHash:"0xa3f5ab08"},{name:"tangerineWhistle",block:0,forkHash:"0xa3f5ab08"},{name:"spuriousDragon",block:0,forkHash:"0xa3f5ab08"},{name:"byzantium",block:0,forkHash:"0xa3f5ab08"},{name:"constantinople",block:0,forkHash:"0xa3f5ab08"},{name:"petersburg",block:0,forkHash:"0xa3f5ab08"},{name:"istanbul",block:1561651,forkHash:"0xc25efa5c"},{name:"berlin",block:4460644,forkHash:"0x757a1c47"},{name:"london",block:5062605,forkHash:"0xb8c6299d"},{"//_comment":"The forkHash will remain same as mergeForkIdTransition is post merge, terminal block: https://goerli.etherscan.io/block/7382818",name:"merge",ttd:"10790000",block:7382819,forkHash:"0xb8c6299d"},{name:"mergeForkIdTransition",block:null,forkHash:null},{name:"shanghai",block:null,forkHash:null}],bootstrapNodes:[],dnsNetworks:["enrtree://AKA3AM6LPBYEUDMVNU3BSVQJ5AD45Y7YPOHJLEF6W26QOE4VTUDPE@all.goerli.ethdisco.net"]},Mjt={name:"mainnet",chainId:1,networkId:1,defaultHardfork:"merge",consensus:{type:"pow",algorithm:"ethash",ethash:{}},comment:"The Ethereum main chain",url:"https://ethstats.net/",genesis:{gasLimit:5e3,difficulty:17179869184,nonce:"0x0000000000000042",extraData:"0x11bbe8db4e347b4e8c937c1c8370e4b5ed33adb3db69cbdb7a38e1e50b1b82fa"},hardforks:[{name:"chainstart",block:0,forkHash:"0xfc64ec04"},{name:"homestead",block:115e4,forkHash:"0x97c2c34c"},{name:"dao",block:192e4,forkHash:"0x91d1f948"},{name:"tangerineWhistle",block:2463e3,forkHash:"0x7a64da13"},{name:"spuriousDragon",block:2675e3,forkHash:"0x3edd5b10"},{name:"byzantium",block:437e4,forkHash:"0xa00bc324"},{name:"constantinople",block:728e4,forkHash:"0x668db0af"},{name:"petersburg",block:728e4,forkHash:"0x668db0af"},{name:"istanbul",block:9069e3,forkHash:"0x879d6e30"},{name:"muirGlacier",block:92e5,forkHash:"0xe029e991"},{name:"berlin",block:12244e3,forkHash:"0x0eb440f6"},{name:"london",block:12965e3,forkHash:"0xb715077d"},{name:"arrowGlacier",block:13773e3,forkHash:"0x20c327fc"},{name:"grayGlacier",block:1505e4,forkHash:"0xf0afd0e3"},{"//_comment":"The forkHash will remain same as mergeForkIdTransition is post merge, terminal block: https://etherscan.io/block/15537393",name:"merge",ttd:"58750000000000000000000",block:15537394,forkHash:"0xf0afd0e3"},{name:"mergeForkIdTransition",block:null,forkHash:null},{name:"shanghai",block:null,forkHash:null}],bootstrapNodes:[],dnsNetworks:["enrtree://AKA3AM6LPBYEUDMVNU3BSVQJ5AD45Y7YPOHJLEF6W26QOE4VTUDPE@all.mainnet.ethdisco.net"]},Rjt={name:"sepolia",chainId:11155111,networkId:11155111,defaultHardfork:"merge",consensus:{type:"pow",algorithm:"ethash",ethash:{}},comment:"PoW test network to replace Ropsten",url:"https://github.com/ethereum/go-ethereum/pull/23730",genesis:{timestamp:"0x6159af19",gasLimit:3e7,difficulty:131072,nonce:"0x0000000000000000",extraData:"0x5365706f6c69612c20417468656e732c204174746963612c2047726565636521"},hardforks:[{name:"chainstart",block:0,forkHash:"0xfe3366e7"},{name:"homestead",block:0,forkHash:"0xfe3366e7"},{name:"tangerineWhistle",block:0,forkHash:"0xfe3366e7"},{name:"spuriousDragon",block:0,forkHash:"0xfe3366e7"},{name:"byzantium",block:0,forkHash:"0xfe3366e7"},{name:"constantinople",block:0,forkHash:"0xfe3366e7"},{name:"petersburg",block:0,forkHash:"0xfe3366e7"},{name:"istanbul",block:0,forkHash:"0xfe3366e7"},{name:"muirGlacier",block:0,forkHash:"0xfe3366e7"},{name:"berlin",block:0,forkHash:"0xfe3366e7"},{name:"london",block:0,forkHash:"0xfe3366e7"},{"//_comment":"The forkHash will remain same as mergeForkIdTransition is post merge, terminal block: https://sepolia.etherscan.io/block/1450408",name:"merge",ttd:"17000000000000000",block:1450409,forkHash:"0xfe3366e7"},{name:"mergeForkIdTransition",block:1735371,forkHash:"0xb96cbd13"},{name:"shanghai",block:null,timestamp:"1677557088",forkHash:"0xf7f9bc08"}],bootstrapNodes:[],dnsNetworks:["enrtree://AKA3AM6LPBYEUDMVNU3BSVQJ5AD45Y7YPOHJLEF6W26QOE4VTUDPE@all.sepolia.ethdisco.net"]},Ljt={name:"EIP-1153",number:1153,comment:"Transient Storage",url:"https://eips.ethereum.org/EIPS/eip-1153",status:"Review",minimumHardfork:"chainstart",requiredEIPs:[],gasConfig:{},gasPrices:{tstore:{v:100,d:"Base fee of the TSTORE opcode"},tload:{v:100,d:"Base fee of the TLOAD opcode"}},vm:{},pow:{}},Djt={name:"EIP-1559",number:1559,comment:"Fee market change for ETH 1.0 chain",url:"https://eips.ethereum.org/EIPS/eip-1559",status:"Final",minimumHardfork:"berlin",requiredEIPs:[2930],gasConfig:{baseFeeMaxChangeDenominator:{v:8,d:"Maximum base fee change denominator"},elasticityMultiplier:{v:2,d:"Maximum block gas target elasticity"},initialBaseFee:{v:1e9,d:"Initial base fee on first EIP1559 block"}},gasPrices:{},vm:{},pow:{}},Bjt={name:"EIP-2315",number:2315,comment:"Simple subroutines for the EVM",url:"https://eips.ethereum.org/EIPS/eip-2315",status:"Draft",minimumHardfork:"istanbul",gasConfig:{},gasPrices:{beginsub:{v:2,d:"Base fee of the BEGINSUB opcode"},returnsub:{v:5,d:"Base fee of the RETURNSUB opcode"},jumpsub:{v:10,d:"Base fee of the JUMPSUB opcode"}},vm:{},pow:{}},$jt={name:"EIP-2537",number:2537,comment:"BLS12-381 precompiles",url:"https://eips.ethereum.org/EIPS/eip-2537",status:"Draft",minimumHardfork:"chainstart",gasConfig:{},gasPrices:{Bls12381G1AddGas:{v:600,d:"Gas cost of a single BLS12-381 G1 addition precompile-call"},Bls12381G1MulGas:{v:12e3,d:"Gas cost of a single BLS12-381 G1 multiplication precompile-call"},Bls12381G2AddGas:{v:4500,d:"Gas cost of a single BLS12-381 G2 addition precompile-call"},Bls12381G2MulGas:{v:55e3,d:"Gas cost of a single BLS12-381 G2 multiplication precompile-call"},Bls12381PairingBaseGas:{v:115e3,d:"Base gas cost of BLS12-381 pairing check"},Bls12381PairingPerPairGas:{v:23e3,d:"Per-pair gas cost of BLS12-381 pairing check"},Bls12381MapG1Gas:{v:5500,d:"Gas cost of BLS12-381 map field element to G1"},Bls12381MapG2Gas:{v:11e4,d:"Gas cost of BLS12-381 map field element to G2"},Bls12381MultiExpGasDiscount:{v:[[1,1200],[2,888],[3,764],[4,641],[5,594],[6,547],[7,500],[8,453],[9,438],[10,423],[11,408],[12,394],[13,379],[14,364],[15,349],[16,334],[17,330],[18,326],[19,322],[20,318],[21,314],[22,310],[23,306],[24,302],[25,298],[26,294],[27,289],[28,285],[29,281],[30,277],[31,273],[32,269],[33,268],[34,266],[35,265],[36,263],[37,262],[38,260],[39,259],[40,257],[41,256],[42,254],[43,253],[44,251],[45,250],[46,248],[47,247],[48,245],[49,244],[50,242],[51,241],[52,239],[53,238],[54,236],[55,235],[56,233],[57,232],[58,231],[59,229],[60,228],[61,226],[62,225],[63,223],[64,222],[65,221],[66,220],[67,219],[68,219],[69,218],[70,217],[71,216],[72,216],[73,215],[74,214],[75,213],[76,213],[77,212],[78,211],[79,211],[80,210],[81,209],[82,208],[83,208],[84,207],[85,206],[86,205],[87,205],[88,204],[89,203],[90,202],[91,202],[92,201],[93,200],[94,199],[95,199],[96,198],[97,197],[98,196],[99,196],[100,195],[101,194],[102,193],[103,193],[104,192],[105,191],[106,191],[107,190],[108,189],[109,188],[110,188],[111,187],[112,186],[113,185],[114,185],[115,184],[116,183],[117,182],[118,182],[119,181],[120,180],[121,179],[122,179],[123,178],[124,177],[125,176],[126,176],[127,175],[128,174]],d:"Discount gas costs of calls to the MultiExp precompiles with `k` (point, scalar) pair"}},vm:{},pow:{}},Ujt={name:"EIP-2565",number:2565,comment:"ModExp gas cost",url:"https://eips.ethereum.org/EIPS/eip-2565",status:"Final",minimumHardfork:"byzantium",gasConfig:{},gasPrices:{modexpGquaddivisor:{v:3,d:"Gquaddivisor from modexp precompile for gas calculation"}},vm:{},pow:{}},zjt={name:"EIP-2718",comment:"Typed Transaction Envelope",url:"https://eips.ethereum.org/EIPS/eip-2718",status:"Final",minimumHardfork:"chainstart",gasConfig:{},gasPrices:{},vm:{},pow:{}},Hjt={name:"EIP-2929",comment:"Gas cost increases for state access opcodes",url:"https://eips.ethereum.org/EIPS/eip-2929",status:"Final",minimumHardfork:"chainstart",gasConfig:{},gasPrices:{coldsload:{v:2100,d:"Gas cost of the first read of storage from a given location (per transaction)"},coldaccountaccess:{v:2600,d:"Gas cost of the first read of a given address (per transaction)"},warmstorageread:{v:100,d:"Gas cost of reading storage locations which have already loaded 'cold'"},sstoreCleanGasEIP2200:{v:2900,d:"Once per SSTORE operation from clean non-zero to something else"},sstoreNoopGasEIP2200:{v:100,d:"Once per SSTORE operation if the value doesn't change"},sstoreDirtyGasEIP2200:{v:100,d:"Once per SSTORE operation if a dirty value is changed"},sstoreInitRefundEIP2200:{v:19900,d:"Once per SSTORE operation for resetting to the original zero value"},sstoreCleanRefundEIP2200:{v:4900,d:"Once per SSTORE operation for resetting to the original non-zero value"},call:{v:0,d:"Base fee of the CALL opcode"},callcode:{v:0,d:"Base fee of the CALLCODE opcode"},delegatecall:{v:0,d:"Base fee of the DELEGATECALL opcode"},staticcall:{v:0,d:"Base fee of the STATICCALL opcode"},balance:{v:0,d:"Base fee of the BALANCE opcode"},extcodesize:{v:0,d:"Base fee of the EXTCODESIZE opcode"},extcodecopy:{v:0,d:"Base fee of the EXTCODECOPY opcode"},extcodehash:{v:0,d:"Base fee of the EXTCODEHASH opcode"},sload:{v:0,d:"Base fee of the SLOAD opcode"},sstore:{v:0,d:"Base fee of the SSTORE opcode"}},vm:{},pow:{}},Vjt={name:"EIP-2930",comment:"Optional access lists",url:"https://eips.ethereum.org/EIPS/eip-2930",status:"Final",minimumHardfork:"istanbul",requiredEIPs:[2718,2929],gasConfig:{},gasPrices:{accessListStorageKeyCost:{v:1900,d:"Gas cost per storage key in an Access List transaction"},accessListAddressCost:{v:2400,d:"Gas cost per storage key in an Access List transaction"}},vm:{},pow:{}},Wjt={name:"EIP-3198",number:3198,comment:"BASEFEE opcode",url:"https://eips.ethereum.org/EIPS/eip-3198",status:"Final",minimumHardfork:"london",gasConfig:{},gasPrices:{basefee:{v:2,d:"Gas cost of the BASEFEE opcode"}},vm:{},pow:{}},qjt={name:"EIP-3529",comment:"Reduction in refunds",url:"https://eips.ethereum.org/EIPS/eip-3529",status:"Final",minimumHardfork:"berlin",requiredEIPs:[2929],gasConfig:{maxRefundQuotient:{v:5,d:"Maximum refund quotient; max tx refund is min(tx.gasUsed/maxRefundQuotient, tx.gasRefund)"}},gasPrices:{selfdestructRefund:{v:0,d:"Refunded following a selfdestruct operation"},sstoreClearRefundEIP2200:{v:4800,d:"Once per SSTORE operation for clearing an originally existing storage slot"}},vm:{},pow:{}},Gjt={name:"EIP-3540",number:3540,comment:"EVM Object Format (EOF) v1",url:"https://eips.ethereum.org/EIPS/eip-3540",status:"Review",minimumHardfork:"london",requiredEIPs:[3541],gasConfig:{},gasPrices:{},vm:{},pow:{}},Kjt={name:"EIP-3541",comment:"Reject new contracts starting with the 0xEF byte",url:"https://eips.ethereum.org/EIPS/eip-3541",status:"Final",minimumHardfork:"berlin",requiredEIPs:[],gasConfig:{},gasPrices:{},vm:{},pow:{}},Yjt={name:"EIP-3554",comment:"Reduction in refunds",url:"Difficulty Bomb Delay to December 1st 2021",status:"Final",minimumHardfork:"muirGlacier",requiredEIPs:[],gasConfig:{},gasPrices:{},vm:{},pow:{difficultyBombDelay:{v:95e5,d:"the amount of blocks to delay the difficulty bomb with"}}},Xjt={name:"EIP-3607",number:3607,comment:"Reject transactions from senders with deployed code",url:"https://eips.ethereum.org/EIPS/eip-3607",status:"Final",minimumHardfork:"chainstart",requiredEIPs:[],gasConfig:{},gasPrices:{},vm:{},pow:{}},Qjt={name:"EIP-3651",number:3198,comment:"Warm COINBASE",url:"https://eips.ethereum.org/EIPS/eip-3651",status:"Review",minimumHardfork:"london",requiredEIPs:[2929],gasConfig:{},gasPrices:{},vm:{},pow:{}},Zjt={name:"EIP-3670",number:3670,comment:"EOF - Code Validation",url:"https://eips.ethereum.org/EIPS/eip-3670",status:"Review",minimumHardfork:"london",requiredEIPs:[3540],gasConfig:{},gasPrices:{},vm:{},pow:{}},Jjt={name:"EIP-3675",number:3675,comment:"Upgrade consensus to Proof-of-Stake",url:"https://eips.ethereum.org/EIPS/eip-3675",status:"Final",minimumHardfork:"london",requiredEIPs:[],gasConfig:{},gasPrices:{},vm:{},pow:{}},e9t={name:"EIP-3855",number:3855,comment:"PUSH0 instruction",url:"https://eips.ethereum.org/EIPS/eip-3855",status:"Review",minimumHardfork:"chainstart",requiredEIPs:[],gasConfig:{},gasPrices:{push0:{v:2,d:"Base fee of the PUSH0 opcode"}},vm:{},pow:{}},t9t={name:"EIP-3860",number:3860,comment:"Limit and meter initcode",url:"https://eips.ethereum.org/EIPS/eip-3860",status:"Review",minimumHardfork:"spuriousDragon",requiredEIPs:[],gasConfig:{},gasPrices:{initCodeWordCost:{v:2,d:"Gas to pay for each word (32 bytes) of initcode when creating a contract"}},vm:{maxInitCodeSize:{v:49152,d:"Maximum length of initialization code when creating a contract"}},pow:{}},n9t={name:"EIP-4345",number:4345,comment:"Difficulty Bomb Delay to June 2022",url:"https://eips.ethereum.org/EIPS/eip-4345",status:"Final",minimumHardfork:"london",gasConfig:{},gasPrices:{},vm:{},pow:{difficultyBombDelay:{v:107e5,d:"the amount of blocks to delay the difficulty bomb with"}}},r9t={name:"EIP-4399",number:4399,comment:"Supplant DIFFICULTY opcode with PREVRANDAO",url:"https://eips.ethereum.org/EIPS/eip-4399",status:"Review",minimumHardfork:"london",requiredEIPs:[],gasConfig:{},gasPrices:{},vm:{},pow:{}},s9t={name:"EIP-5133",number:5133,comment:"Delaying Difficulty Bomb to mid-September 2022",url:"https://eips.ethereum.org/EIPS/eip-5133",status:"Draft",minimumHardfork:"grayGlacier",gasConfig:{},gasPrices:{},vm:{},pow:{difficultyBombDelay:{v:114e5,d:"the amount of blocks to delay the difficulty bomb with"}}},W6={1153:Ljt,1559:Djt,2315:Bjt,2537:$jt,2565:Ujt,2718:zjt,2929:Hjt,2930:Vjt,3198:Wjt,3529:qjt,3540:Gjt,3541:Kjt,3554:Yjt,3607:Xjt,3651:Qjt,3670:Zjt,3675:Jjt,3855:e9t,3860:t9t,4345:n9t,4399:r9t,5133:s9t},i9t={name:"chainstart",comment:"Start of the Ethereum main chain",url:"",status:"",gasConfig:{minGasLimit:{v:5e3,d:"Minimum the gas limit may ever be"},gasLimitBoundDivisor:{v:1024,d:"The bound divisor of the gas limit, used in update calculations"},maxRefundQuotient:{v:2,d:"Maximum refund quotient; max tx refund is min(tx.gasUsed/maxRefundQuotient, tx.gasRefund)"}},gasPrices:{base:{v:2,d:"Gas base cost, used e.g. for ChainID opcode (Istanbul)"},tierStep:{v:[0,2,3,5,8,10,20],d:"Once per operation, for a selection of them"},exp:{v:10,d:"Base fee of the EXP opcode"},expByte:{v:10,d:"Times ceil(log256(exponent)) for the EXP instruction"},sha3:{v:30,d:"Base fee of the SHA3 opcode"},sha3Word:{v:6,d:"Once per word of the SHA3 operation's data"},sload:{v:50,d:"Base fee of the SLOAD opcode"},sstoreSet:{v:2e4,d:"Once per SSTORE operation if the zeroness changes from zero"},sstoreReset:{v:5e3,d:"Once per SSTORE operation if the zeroness does not change from zero"},sstoreRefund:{v:15e3,d:"Once per SSTORE operation if the zeroness changes to zero"},jumpdest:{v:1,d:"Base fee of the JUMPDEST opcode"},log:{v:375,d:"Base fee of the LOG opcode"},logData:{v:8,d:"Per byte in a LOG* operation's data"},logTopic:{v:375,d:"Multiplied by the * of the LOG*, per LOG transaction. e.g. LOG0 incurs 0 * c_txLogTopicGas, LOG4 incurs 4 * c_txLogTopicGas"},create:{v:32e3,d:"Base fee of the CREATE opcode"},call:{v:40,d:"Base fee of the CALL opcode"},callStipend:{v:2300,d:"Free gas given at beginning of call"},callValueTransfer:{v:9e3,d:"Paid for CALL when the value transfor is non-zero"},callNewAccount:{v:25e3,d:"Paid for CALL when the destination address didn't exist prior"},selfdestructRefund:{v:24e3,d:"Refunded following a selfdestruct operation"},memory:{v:3,d:"Times the address of the (highest referenced byte in memory + 1). NOTE: referencing happens on read, write and in instructions such as RETURN and CALL"},quadCoeffDiv:{v:512,d:"Divisor for the quadratic particle of the memory cost equation"},createData:{v:200,d:""},tx:{v:21e3,d:"Per transaction. NOTE: Not payable on data of calls between transactions"},txCreation:{v:32e3,d:"The cost of creating a contract via tx"},txDataZero:{v:4,d:"Per byte of data attached to a transaction that equals zero. NOTE: Not payable on data of calls between transactions"},txDataNonZero:{v:68,d:"Per byte of data attached to a transaction that is not equal to zero. NOTE: Not payable on data of calls between transactions"},copy:{v:3,d:"Multiplied by the number of 32-byte words that are copied (round up) for any *COPY operation and added"},ecRecover:{v:3e3,d:""},sha256:{v:60,d:""},sha256Word:{v:12,d:""},ripemd160:{v:600,d:""},ripemd160Word:{v:120,d:""},identity:{v:15,d:""},identityWord:{v:3,d:""},stop:{v:0,d:"Base fee of the STOP opcode"},add:{v:3,d:"Base fee of the ADD opcode"},mul:{v:5,d:"Base fee of the MUL opcode"},sub:{v:3,d:"Base fee of the SUB opcode"},div:{v:5,d:"Base fee of the DIV opcode"},sdiv:{v:5,d:"Base fee of the SDIV opcode"},mod:{v:5,d:"Base fee of the MOD opcode"},smod:{v:5,d:"Base fee of the SMOD opcode"},addmod:{v:8,d:"Base fee of the ADDMOD opcode"},mulmod:{v:8,d:"Base fee of the MULMOD opcode"},signextend:{v:5,d:"Base fee of the SIGNEXTEND opcode"},lt:{v:3,d:"Base fee of the LT opcode"},gt:{v:3,d:"Base fee of the GT opcode"},slt:{v:3,d:"Base fee of the SLT opcode"},sgt:{v:3,d:"Base fee of the SGT opcode"},eq:{v:3,d:"Base fee of the EQ opcode"},iszero:{v:3,d:"Base fee of the ISZERO opcode"},and:{v:3,d:"Base fee of the AND opcode"},or:{v:3,d:"Base fee of the OR opcode"},xor:{v:3,d:"Base fee of the XOR opcode"},not:{v:3,d:"Base fee of the NOT opcode"},byte:{v:3,d:"Base fee of the BYTE opcode"},address:{v:2,d:"Base fee of the ADDRESS opcode"},balance:{v:20,d:"Base fee of the BALANCE opcode"},origin:{v:2,d:"Base fee of the ORIGIN opcode"},caller:{v:2,d:"Base fee of the CALLER opcode"},callvalue:{v:2,d:"Base fee of the CALLVALUE opcode"},calldataload:{v:3,d:"Base fee of the CALLDATALOAD opcode"},calldatasize:{v:2,d:"Base fee of the CALLDATASIZE opcode"},calldatacopy:{v:3,d:"Base fee of the CALLDATACOPY opcode"},codesize:{v:2,d:"Base fee of the CODESIZE opcode"},codecopy:{v:3,d:"Base fee of the CODECOPY opcode"},gasprice:{v:2,d:"Base fee of the GASPRICE opcode"},extcodesize:{v:20,d:"Base fee of the EXTCODESIZE opcode"},extcodecopy:{v:20,d:"Base fee of the EXTCODECOPY opcode"},blockhash:{v:20,d:"Base fee of the BLOCKHASH opcode"},coinbase:{v:2,d:"Base fee of the COINBASE opcode"},timestamp:{v:2,d:"Base fee of the TIMESTAMP opcode"},number:{v:2,d:"Base fee of the NUMBER opcode"},difficulty:{v:2,d:"Base fee of the DIFFICULTY opcode"},gaslimit:{v:2,d:"Base fee of the GASLIMIT opcode"},pop:{v:2,d:"Base fee of the POP opcode"},mload:{v:3,d:"Base fee of the MLOAD opcode"},mstore:{v:3,d:"Base fee of the MSTORE opcode"},mstore8:{v:3,d:"Base fee of the MSTORE8 opcode"},sstore:{v:0,d:"Base fee of the SSTORE opcode"},jump:{v:8,d:"Base fee of the JUMP opcode"},jumpi:{v:10,d:"Base fee of the JUMPI opcode"},pc:{v:2,d:"Base fee of the PC opcode"},msize:{v:2,d:"Base fee of the MSIZE opcode"},gas:{v:2,d:"Base fee of the GAS opcode"},push:{v:3,d:"Base fee of the PUSH opcode"},dup:{v:3,d:"Base fee of the DUP opcode"},swap:{v:3,d:"Base fee of the SWAP opcode"},callcode:{v:40,d:"Base fee of the CALLCODE opcode"},return:{v:0,d:"Base fee of the RETURN opcode"},invalid:{v:0,d:"Base fee of the INVALID opcode"},selfdestruct:{v:0,d:"Base fee of the SELFDESTRUCT opcode"}},vm:{stackLimit:{v:1024,d:"Maximum size of VM stack allowed"},callCreateDepth:{v:1024,d:"Maximum depth of call/create stack"},maxExtraDataSize:{v:32,d:"Maximum size extra data may be after Genesis"}},pow:{minimumDifficulty:{v:131072,d:"The minimum that the difficulty may ever be"},difficultyBoundDivisor:{v:2048,d:"The bound divisor of the difficulty, used in the update calculations"},durationLimit:{v:13,d:"The decision boundary on the blocktime duration used to determine whether difficulty should go up or not"},epochDuration:{v:3e4,d:"Duration between proof-of-work epochs"},timebombPeriod:{v:1e5,d:"Exponential difficulty timebomb period"},minerReward:{v:"5000000000000000000",d:"the amount a miner get rewarded for mining a block"},difficultyBombDelay:{v:0,d:"the amount of blocks to delay the difficulty bomb with"}}},a9t={name:"dao",comment:"DAO rescue hardfork",url:"https://eips.ethereum.org/EIPS/eip-779",status:"Final",gasConfig:{},gasPrices:{},vm:{},pow:{}},o9t={name:"homestead",comment:"Homestead hardfork with protocol and network changes",url:"https://eips.ethereum.org/EIPS/eip-606",status:"Final",gasConfig:{},gasPrices:{delegatecall:{v:40,d:"Base fee of the DELEGATECALL opcode"}},vm:{},pow:{}},l9t={name:"tangerineWhistle",comment:"Hardfork with gas cost changes for IO-heavy operations",url:"https://eips.ethereum.org/EIPS/eip-608",status:"Final",gasConfig:{},gasPrices:{sload:{v:200,d:"Once per SLOAD operation"},call:{v:700,d:"Once per CALL operation & message call transaction"},extcodesize:{v:700,d:"Base fee of the EXTCODESIZE opcode"},extcodecopy:{v:700,d:"Base fee of the EXTCODECOPY opcode"},balance:{v:400,d:"Base fee of the BALANCE opcode"},delegatecall:{v:700,d:"Base fee of the DELEGATECALL opcode"},callcode:{v:700,d:"Base fee of the CALLCODE opcode"},selfdestruct:{v:5e3,d:"Base fee of the SELFDESTRUCT opcode"}},vm:{},pow:{}},c9t={name:"spuriousDragon",comment:"HF with EIPs for simple replay attack protection, EXP cost increase, state trie clearing, contract code size limit",url:"https://eips.ethereum.org/EIPS/eip-607",status:"Final",gasConfig:{},gasPrices:{expByte:{v:50,d:"Times ceil(log256(exponent)) for the EXP instruction"}},vm:{maxCodeSize:{v:24576,d:"Maximum length of contract code"}},pow:{}},u9t={name:"byzantium",comment:"Hardfork with new precompiles, instructions and other protocol changes",url:"https://eips.ethereum.org/EIPS/eip-609",status:"Final",gasConfig:{},gasPrices:{modexpGquaddivisor:{v:20,d:"Gquaddivisor from modexp precompile for gas calculation"},ecAdd:{v:500,d:"Gas costs for curve addition precompile"},ecMul:{v:4e4,d:"Gas costs for curve multiplication precompile"},ecPairing:{v:1e5,d:"Base gas costs for curve pairing precompile"},ecPairingWord:{v:8e4,d:"Gas costs regarding curve pairing precompile input length"},revert:{v:0,d:"Base fee of the REVERT opcode"},staticcall:{v:700,d:"Base fee of the STATICCALL opcode"},returndatasize:{v:2,d:"Base fee of the RETURNDATASIZE opcode"},returndatacopy:{v:3,d:"Base fee of the RETURNDATACOPY opcode"}},vm:{},pow:{minerReward:{v:"3000000000000000000",d:"the amount a miner get rewarded for mining a block"},difficultyBombDelay:{v:3e6,d:"the amount of blocks to delay the difficulty bomb with"}}},d9t={name:"constantinople",comment:"Postponed hardfork including EIP-1283 (SSTORE gas metering changes)",url:"https://eips.ethereum.org/EIPS/eip-1013",status:"Final",gasConfig:{},gasPrices:{netSstoreNoopGas:{v:200,d:"Once per SSTORE operation if the value doesn't change"},netSstoreInitGas:{v:2e4,d:"Once per SSTORE operation from clean zero"},netSstoreCleanGas:{v:5e3,d:"Once per SSTORE operation from clean non-zero"},netSstoreDirtyGas:{v:200,d:"Once per SSTORE operation from dirty"},netSstoreClearRefund:{v:15e3,d:"Once per SSTORE operation for clearing an originally existing storage slot"},netSstoreResetRefund:{v:4800,d:"Once per SSTORE operation for resetting to the original non-zero value"},netSstoreResetClearRefund:{v:19800,d:"Once per SSTORE operation for resetting to the original zero value"},shl:{v:3,d:"Base fee of the SHL opcode"},shr:{v:3,d:"Base fee of the SHR opcode"},sar:{v:3,d:"Base fee of the SAR opcode"},extcodehash:{v:400,d:"Base fee of the EXTCODEHASH opcode"},create2:{v:32e3,d:"Base fee of the CREATE2 opcode"}},vm:{},pow:{minerReward:{v:"2000000000000000000",d:"The amount a miner gets rewarded for mining a block"},difficultyBombDelay:{v:5e6,d:"the amount of blocks to delay the difficulty bomb with"}}},f9t={name:"petersburg",comment:"Aka constantinopleFix, removes EIP-1283, activate together with or after constantinople",url:"https://eips.ethereum.org/EIPS/eip-1716",status:"Final",gasConfig:{},gasPrices:{netSstoreNoopGas:{v:null,d:"Removed along EIP-1283"},netSstoreInitGas:{v:null,d:"Removed along EIP-1283"},netSstoreCleanGas:{v:null,d:"Removed along EIP-1283"},netSstoreDirtyGas:{v:null,d:"Removed along EIP-1283"},netSstoreClearRefund:{v:null,d:"Removed along EIP-1283"},netSstoreResetRefund:{v:null,d:"Removed along EIP-1283"},netSstoreResetClearRefund:{v:null,d:"Removed along EIP-1283"}},vm:{},pow:{}},h9t={name:"istanbul",comment:"HF targeted for December 2019 following the Constantinople/Petersburg HF",url:"https://eips.ethereum.org/EIPS/eip-1679",status:"Final",gasConfig:{},gasPrices:{blake2Round:{v:1,d:"Gas cost per round for the Blake2 F precompile"},ecAdd:{v:150,d:"Gas costs for curve addition precompile"},ecMul:{v:6e3,d:"Gas costs for curve multiplication precompile"},ecPairing:{v:45e3,d:"Base gas costs for curve pairing precompile"},ecPairingWord:{v:34e3,d:"Gas costs regarding curve pairing precompile input length"},txDataNonZero:{v:16,d:"Per byte of data attached to a transaction that is not equal to zero. NOTE: Not payable on data of calls between transactions"},sstoreSentryGasEIP2200:{v:2300,d:"Minimum gas required to be present for an SSTORE call, not consumed"},sstoreNoopGasEIP2200:{v:800,d:"Once per SSTORE operation if the value doesn't change"},sstoreDirtyGasEIP2200:{v:800,d:"Once per SSTORE operation if a dirty value is changed"},sstoreInitGasEIP2200:{v:2e4,d:"Once per SSTORE operation from clean zero to non-zero"},sstoreInitRefundEIP2200:{v:19200,d:"Once per SSTORE operation for resetting to the original zero value"},sstoreCleanGasEIP2200:{v:5e3,d:"Once per SSTORE operation from clean non-zero to something else"},sstoreCleanRefundEIP2200:{v:4200,d:"Once per SSTORE operation for resetting to the original non-zero value"},sstoreClearRefundEIP2200:{v:15e3,d:"Once per SSTORE operation for clearing an originally existing storage slot"},balance:{v:700,d:"Base fee of the BALANCE opcode"},extcodehash:{v:700,d:"Base fee of the EXTCODEHASH opcode"},chainid:{v:2,d:"Base fee of the CHAINID opcode"},selfbalance:{v:5,d:"Base fee of the SELFBALANCE opcode"},sload:{v:800,d:"Base fee of the SLOAD opcode"}},vm:{},pow:{}},p9t={name:"muirGlacier",comment:"HF to delay the difficulty bomb",url:"https://eips.ethereum.org/EIPS/eip-2384",status:"Final",gasConfig:{},gasPrices:{},vm:{},pow:{difficultyBombDelay:{v:9e6,d:"the amount of blocks to delay the difficulty bomb with"}}},m9t={name:"berlin",comment:"HF targeted for July 2020 following the Muir Glacier HF",url:"https://eips.ethereum.org/EIPS/eip-2070",status:"Final",eips:[2565,2929,2718,2930]},x9t={name:"london",comment:"HF targeted for July 2021 following the Berlin fork",url:"https://github.com/ethereum/eth1.0-specs/blob/master/network-upgrades/mainnet-upgrades/london.md",status:"Final",eips:[1559,3198,3529,3541]},g9t={name:"shanghai",comment:"Next feature hardfork after the merge hardfork having withdrawals, warm coinbase, push0, limit/meter initcode",url:"https://github.com/ethereum/execution-specs/blob/master/network-upgrades/mainnet-upgrades/shanghai.md",status:"Final",eips:[3651,3855,3860,4895]},b9t={name:"arrowGlacier",comment:"HF to delay the difficulty bomb",url:"https://github.com/ethereum/execution-specs/blob/master/network-upgrades/mainnet-upgrades/arrow-glacier.md",status:"Final",eips:[4345],gasConfig:{},gasPrices:{},vm:{},pow:{}},y9t={name:"grayGlacier",comment:"Delaying the difficulty bomb to Mid September 2022",url:"https://github.com/ethereum/execution-specs/blob/master/network-upgrades/mainnet-upgrades/gray-glacier.md",status:"Draft",eips:[5133],gasConfig:{},gasPrices:{},vm:{},pow:{}},v9t={name:"mergeForkIdTransition",comment:"Pre-merge hardfork to fork off non-upgraded clients",url:"https://eips.ethereum.org/EIPS/eip-3675",status:"Draft",eips:[]},w9t={name:"merge",comment:"Hardfork to upgrade the consensus mechanism to Proof-of-Stake",url:"https://github.com/ethereum/execution-specs/blob/master/network-upgrades/mainnet-upgrades/merge.md",status:"Final",consensus:{type:"pos",algorithm:"casper",casper:{}},eips:[3675,4399]},C9t={chainstart:i9t,homestead:o9t,dao:a9t,tangerineWhistle:l9t,spuriousDragon:c9t,byzantium:u9t,constantinople:d9t,petersburg:f9t,istanbul:h9t,muirGlacier:p9t,berlin:m9t,london:x9t,shanghai:g9t,arrowGlacier:b9t,grayGlacier:y9t,mergeForkIdTransition:v9t,merge:w9t},{buf:S9t}=Fjt;class Zl extends toe{static custom(t,n={}){var r;const s=(r=n.baseChain)!==null&&r!==void 0?r:"mainnet",a=Object.assign({},Zl._getChainParams(s));if(a.name="custom-chain",typeof t!="string")return new Zl(Object.assign({chain:Object.assign(Object.assign({},a),t)},n));if(t===xu.PolygonMainnet)return Zl.custom({name:xu.PolygonMainnet,chainId:137,networkId:137},n);if(t===xu.PolygonMumbai)return Zl.custom({name:xu.PolygonMumbai,chainId:80001,networkId:80001},n);if(t===xu.ArbitrumRinkebyTestnet)return Zl.custom({name:xu.ArbitrumRinkebyTestnet,chainId:421611,networkId:421611},n);if(t===xu.ArbitrumOne)return Zl.custom({name:xu.ArbitrumOne,chainId:42161,networkId:42161},n);if(t===xu.xDaiChain)return Zl.custom({name:xu.xDaiChain,chainId:100,networkId:100},n);if(t===xu.OptimisticKovan)return Zl.custom({name:xu.OptimisticKovan,chainId:69,networkId:69},Object.assign({hardfork:so.Berlin},n));if(t===xu.OptimisticEthereum)return Zl.custom({name:xu.OptimisticEthereum,chainId:10,networkId:10},Object.assign({hardfork:so.Berlin},n));throw new Error(`Custom chain ${t} not supported`)}static fromGethGenesis(t,{chain:n,eips:r,genesisHash:s,hardfork:a,mergeForkIdPostMerge:o}){var l;const c=Sjt(t,n,o),u=new Zl({chain:(l=c.name)!==null&&l!==void 0?l:"custom",customChains:[c],eips:r,hardfork:a??c.hardfork});return s!==void 0&&u.setForkHashes(s),u}static isSupportedChainId(t){return!!this._getInitializedChains().names[t.toString()]}static _getChainParams(t,n){let r=t;const s=this._getInitializedChains(n);if(typeof r=="number"||typeof r=="bigint"){if(r=r.toString(),s.names[r]){const a=s.names[r];return s[a]}throw new Error(`Chain with ID ${r} not supported`)}if(s[r]!==void 0)return s[r];throw new Error(`Chain with name ${r} not supported`)}constructor(t){var n,r;super(),this._eips=[],this._customChains=(n=t.customChains)!==null&&n!==void 0?n:[],this._chainParams=this.setChain(t.chain),this.DEFAULT_HARDFORK=(r=this._chainParams.defaultHardfork)!==null&&r!==void 0?r:so.Merge,this.HARDFORK_CHANGES=this.hardforks().map(s=>[s.name,C9t[s.name]]),this._hardfork=this.DEFAULT_HARDFORK,t.hardfork!==void 0&&this.setHardfork(t.hardfork),t.eips&&this.setEIPs(t.eips)}setChain(t){if(typeof t=="number"||typeof t=="bigint"||typeof t=="string")this._chainParams=Zl._getChainParams(t,this._customChains);else if(typeof t=="object"){if(this._customChains.length>0)throw new Error("Chain must be a string, number, or bigint when initialized with customChains passed in");const n=["networkId","genesis","hardforks","bootstrapNodes"];for(const r of n)if(!(r in t))throw new Error(`Missing required chain parameter: ${r}`);this._chainParams=t}else throw new Error("Wrong input format");for(const n of this.hardforks())if(n.block===void 0)throw new Error("Hardfork cannot have undefined block number");return this._chainParams}setHardfork(t){let n=!1;for(const r of this.HARDFORK_CHANGES)r[0]===t&&(this._hardfork!==t&&(this._hardfork=t,this.emit("hardforkChanged",t)),n=!0);if(!n)throw new Error(`Hardfork with name ${t} not supported`)}getHardforkByBlockNumber(t,n,r){const s=V6(t,Gh.BigInt),a=V6(n,Gh.BigInt),o=V6(r,Gh.Number),l=this.hardforks().filter(g=>g.block!==null||g.ttd!==null&&g.ttd!==void 0||g.timestamp!==void 0),c=l.findIndex(g=>g.ttd!==null&&g.ttd!==void 0);if(l.slice(c+1).findIndex(g=>g.ttd!==null&&g.ttd!==void 0)>=0)throw Error("More than one merge hardforks found with ttd specified");let d=l.findIndex(g=>g.block!==null&&g.block>s||o!==void 0&&Number(g.timestamp)>o);if(d===-1)d=l.length;else if(d===0)throw Error("Must have at least one hardfork at block 0");if(o===void 0){const g=l.slice(0,d).reverse().findIndex(v=>v.block!==null||v.ttd!==void 0);d-=g}if(d-=1,l[d].block===null&&l[d].timestamp===void 0)(a==null||BigInt(l[d].ttd)>a)&&(d-=1);else if(c>=0&&a!==void 0&&a!==null){if(d>=c&&BigInt(l[c].ttd)>a)throw Error("Maximum HF determined by total difficulty is lower than the block number HF");if(d<c&&BigInt(l[c].ttd)<=a)throw Error("HF determined by block number is lower than the minimum total difficulty HF")}const f=d;for(;d<l.length-1&&!(l[d].block!==l[d+1].block||l[d].timestamp!==l[d+1].timestamp);d+=1);if(o){if(l.slice(0,f).reduce((w,C)=>{var N;return Math.max(Number((N=C.timestamp)!==null&&N!==void 0?N:"0"),w)},0)>o)throw Error("Maximum HF determined by timestamp is lower than the block number/ttd HF");if(l.slice(d+1).reduce((w,C)=>{var N;return Math.min(Number((N=C.timestamp)!==null&&N!==void 0?N:o),w)},o)<o)throw Error("Maximum HF determined by block number/ttd is lower than timestamp HF")}return l[d].name}setHardforkByBlockNumber(t,n,r){const s=this.getHardforkByBlockNumber(t,n,r);return this.setHardfork(s),s}_getHardfork(t){const n=this.hardforks();for(const r of n)if(r.name===t)return r;return null}setEIPs(t=[]){for(const n of t){if(!(n in W6))throw new Error(`${n} not supported`);const r=this.gteHardfork(W6[n].minimumHardfork);if(!r)throw new Error(`${n} cannot be activated on hardfork ${this.hardfork()}, minimumHardfork: ${r}`);if(W6[n].requiredEIPs!==void 0){for(const s of W6[n].requiredEIPs)if(!(t.includes(s)||this.isActivatedEIP(s)))throw new Error(`${n} requires EIP ${s}, but is not included in the EIP list`)}}this._eips=t}param(t,n){let r;for(const s of this._eips)if(r=this.paramByEIP(t,n,s),r!==void 0)return r;return this.paramByHardfork(t,n,this._hardfork)}paramByHardfork(t,n,r){let s=null;for(const a of this.HARDFORK_CHANGES){if("eips"in a[1]){const o=a[1].eips;for(const l of o){const c=this.paramByEIP(t,n,l);s=typeof c=="bigint"?c:s}}else{if(a[1][t]===void 0)throw new Error(`Topic ${t} not defined`);a[1][t][n]!==void 0&&(s=a[1][t][n].v)}if(a[0]===r)break}return BigInt(s??0)}paramByEIP(t,n,r){if(!(r in W6))throw new Error(`${r} not supported`);const s=W6[r];if(!(t in s))throw new Error(`Topic ${t} not defined`);if(s[t][n]===void 0)return;const a=s[t][n].v;return BigInt(a)}paramByBlock(t,n,r,s,a){const o=this.getHardforkByBlockNumber(r,s,a);return this.paramByHardfork(t,n,o)}isActivatedEIP(t){if(this.eips().includes(t))return!0;for(const n of this.HARDFORK_CHANGES){const r=n[1];if(this.gteHardfork(r.name)&&"eips"in r&&r.eips.includes(t))return!0}return!1}hardforkIsActiveOnBlock(t,n){const r=V6(n,Gh.BigInt),s=t??this._hardfork,a=this.hardforkBlock(s);return typeof a=="bigint"&&a!==BigInt(0)&&r>=a}activeOnBlock(t){return this.hardforkIsActiveOnBlock(null,t)}hardforkGteHardfork(t,n){const r=t??this._hardfork,s=this.hardforks();let a=-1,o=-1,l=0;for(const c of s)c.name===r&&(a=l),c.name===n&&(o=l),l+=1;return a>=o&&o!==-1}gteHardfork(t){return this.hardforkGteHardfork(null,t)}hardforkBlock(t){var n;const r=t??this._hardfork,s=(n=this._getHardfork(r))===null||n===void 0?void 0:n.block;return s==null?null:BigInt(s)}hardforkTimestamp(t){var n;const r=t??this._hardfork,s=(n=this._getHardfork(r))===null||n===void 0?void 0:n.timestamp;return s==null?null:BigInt(s)}eipBlock(t){for(const n of this.HARDFORK_CHANGES){const r=n[1];if("eips"in r&&r.eips.includes(t))return this.hardforkBlock(typeof n[0]=="number"?String(n[0]):n[0])}return null}hardforkTTD(t){var n;const r=t??this._hardfork,s=(n=this._getHardfork(r))===null||n===void 0?void 0:n.ttd;return s==null?null:BigInt(s)}isHardforkBlock(t,n){const r=V6(t,Gh.BigInt),s=n??this._hardfork,a=this.hardforkBlock(s);return typeof a=="bigint"&&a!==BigInt(0)?a===r:!1}nextHardforkBlockOrTimestamp(t){var n,r,s;const a=(n=t)!==null&&n!==void 0?n:this._hardfork,o=this.hardforks();let l=o.findIndex(f=>f.name===a);if(a===so.Merge&&(l-=1),l<0)return null;let c=(r=o[l].timestamp)!==null&&r!==void 0?r:o[l].block;c=c!=null?Number(c):null;const u=o.slice(l+1).find(f=>{var x;let g=(x=f.timestamp)!==null&&x!==void 0?x:f.block;return g=g!=null?Number(g):null,f.name!==so.Merge&&g!==null&&g!==void 0&&g!==c});if(u===void 0)return null;const d=(s=u.timestamp)!==null&&s!==void 0?s:u.block;return d==null?null:BigInt(d)}nextHardforkBlock(t){var n;const r=(n=t)!==null&&n!==void 0?n:this._hardfork;let s=this.hardforkBlock(r);if(s===null&&r===so.Merge){const o=this.hardforks(),l=o.findIndex(c=>c.ttd!==null&&c.ttd!==void 0);if(l<0)throw Error("Merge hardfork should have been found");s=this.hardforkBlock(o[l-1].name)}return s===null?null:this.hardforks().reduce((o,l)=>{const c=BigInt(l.block===null||l.ttd!==void 0&&l.ttd!==null?0:l.block);return c>s&&o===null?c:o},null)}isNextHardforkBlock(t,n){const r=V6(t,Gh.BigInt),s=n??this._hardfork,a=this.nextHardforkBlock(s);return a===null?!1:a===r}_calcForkHash(t,n){let r=new Uint8Array,s=0;for(const l of this.hardforks()){const{block:c,timestamp:u,name:d}=l;let f=u??c;if(f=f!==null?Number(f):null,typeof f=="number"&&f!==0&&f!==s&&d!==so.Merge){const x=oo(f.toString(16).padStart(16,"0"));r=gd(r,x),s=f}if(l.name===t)break}const a=gd(n,r);return Wi(Njt(S9t(a)>>>0))}forkHash(t,n){const r=t??this._hardfork,s=this._getHardfork(r);if(s===null||(s==null?void 0:s.block)===null&&(s==null?void 0:s.timestamp)===void 0&&(s==null?void 0:s.ttd)===void 0){const a="No fork hash calculation possible for future hardfork";throw new Error(a)}if((s==null?void 0:s.forkHash)!==null&&(s==null?void 0:s.forkHash)!==void 0)return s.forkHash;if(!n)throw new Error("genesisHash required for forkHash calculation");return this._calcForkHash(r,n)}hardforkForForkHash(t){const n=this.hardforks().filter(r=>r.forkHash===t);return n.length>=1?n[n.length-1]:null}setForkHashes(t){var n;for(const r of this.hardforks()){const s=(n=r.timestamp)!==null&&n!==void 0?n:r.block;(r.forkHash===null||r.forkHash===void 0)&&(s!=null||typeof r.ttd<"u")&&(r.forkHash=this.forkHash(r.name,t))}}genesis(){return this._chainParams.genesis}hardforks(){return this._chainParams.hardforks}bootstrapNodes(){return this._chainParams.bootstrapNodes}dnsNetworks(){return this._chainParams.dnsNetworks}hardfork(){return this._hardfork}chainId(){return BigInt(this._chainParams.chainId)}chainName(){return this._chainParams.name}networkId(){return BigInt(this._chainParams.networkId)}eips(){return this._eips}consensusType(){const t=this.hardfork();let n;for(const r of this.HARDFORK_CHANGES)if("consensus"in r[1]&&(n=r[1].consensus.type),r[0]===t)break;return n??this._chainParams.consensus.type}consensusAlgorithm(){const t=this.hardfork();let n;for(const r of this.HARDFORK_CHANGES)if("consensus"in r[1]&&(n=r[1].consensus.algorithm),r[0]===t)break;return n??this._chainParams.consensus.algorithm}consensusConfig(){var t;const n=this.hardfork();let r;for(const s of this.HARDFORK_CHANGES)if("consensus"in s[1]&&(r=s[1].consensus[s[1].consensus.algorithm]),s[0]===n)break;return(t=r??this._chainParams.consensus[this.consensusAlgorithm()])!==null&&t!==void 0?t:{}}copy(){const t=Object.assign(Object.create(Object.getPrototypeOf(this)),this);return t.removeAllListeners(),t}static _getInitializedChains(t){const n={};for(const[s,a]of Object.entries(pR))n[a]=s.toLowerCase();const r={mainnet:Mjt,goerli:Ojt,sepolia:Rjt};if(t)for(const s of t){const{name:a}=s;n[s.chainId.toString()]=a,r[a]=s}return r.names=n,r}}var N0;(function(e){e[e.EIP155ReplayProtection=155]="EIP155ReplayProtection",e[e.EIP1559FeeMarket=1559]="EIP1559FeeMarket",e[e.EIP2718TypedTransaction=2718]="EIP2718TypedTransaction",e[e.EIP2930AccessLists=2930]="EIP2930AccessLists"})(N0||(N0={}));function N9t(e){if(e.length===0)return!0;const t=e[0];return!!Array.isArray(t)}function A9t(e){return!N9t(e)}class c4{constructor(t){if(t.length!==20)throw new Error("Invalid address length");this.buf=t}static zero(){return new c4(DFe(20))}equals(t){return n$(this.buf,t.buf)}isZero(){return this.equals(c4.zero())}toString(){return Wi(this.buf)}toArray(){return this.buf}static publicToAddress(t,n=!1){let r=t;if(boe(r),n&&r.length!==64&&(r=j1.ProjectivePoint.fromHex(r).toRawBytes(!1).slice(1)),r.length!==64)throw new Error("Expected pubKey to be of length 64");return od(r).slice(-20)}}const j9t=(e,t)=>{const n=e.param("vm","maxInitCodeSize");if(n&&BigInt(t)>n)throw new Error(`the initcode size of this transaction is too large: it is ${t} while the max is ${e.param("vm","maxInitCodeSize")}`)},BFe=e=>{let t,n;if(A9t(e)){t=e;const r=[];for(let s=0;s<e.length;s+=1){const a=e[s],o=ko(a.address),l=[];for(let c=0;c<a.storageKeys.length;c+=1)l.push(ko(a.storageKeys[c]));r.push([o,l])}n=r}else{n=e??[];const r=[];for(let s=0;s<n.length;s+=1){const a=n[s],o=Wi(a[0]),l=[];for(let u=0;u<a[1].length;u+=1)l.push(Wi(a[1][u]));const c={address:o,storageKeys:l};r.push(c)}t=r}return{AccessListJSON:t,accessList:n}},$Fe=e=>{for(let t=0;t<e.length;t+=1){const n=e[t],r=n[0],s=n[1];if(n[2]!==void 0)throw new Error("Access list item cannot have 3 elements. It can only have an address, and an array of storage slots.");if(r.length!==20)throw new Error("Invalid EIP-2930 transaction: address length should be 20 bytes");for(let a=0;a<s.length;a+=1)if(s[a].length!==32)throw new Error("Invalid EIP-2930 transaction: storage slot length should be 32 bytes")}},UFe=e=>{const t=[];for(let n=0;n<e.length;n+=1){const r=e[n],s={address:Wi(Sge(r[0],20)),storageKeys:[]},a=r&&r[1];for(let o=0;o<a.length;o+=1){const l=a[o];s.storageKeys.push(Wi(Sge(l,32)))}t.push(s)}return t},zFe=(e,t)=>{const n=t.param("gasPrices","accessListStorageKeyCost"),r=t.param("gasPrices","accessListAddressCost");let s=0;for(let o=0;o<e.length;o+=1){const c=e[o][1];s+=c.length}return e.length*Number(r)+s*Number(n)};class uN{constructor(t,n){var r,s;this.cache={hash:void 0,dataFee:void 0},this.activeCapabilities=[],this.DEFAULT_CHAIN=pR.Mainnet,this.DEFAULT_HARDFORK=so.Merge;const{nonce:a,gasLimit:o,to:l,value:c,data:u,v:d,r:f,s:x,type:g}=t;this._type=Number(Ka(ko(g))),this.txOptions=n;const v=ko(l===""?"0x":l),w=ko(d===""?"0x":d),C=ko(f===""?"0x":f),N=ko(x===""?"0x":x);this.nonce=Ka(ko(a===""?"0x":a)),this.gasLimit=Ka(ko(o===""?"0x":o)),this.to=v.length>0?new c4(v):void 0,this.value=Ka(ko(c===""?"0x":c)),this.data=ko(u===""?"0x":u),this.v=w.length>0?Ka(w):void 0,this.r=C.length>0?Ka(C):void 0,this.s=N.length>0?Ka(N):void 0,this._validateCannotExceedMaxInteger({value:this.value,r:this.r,s:this.s}),this._validateCannotExceedMaxInteger({gasLimit:this.gasLimit},64),this._validateCannotExceedMaxInteger({nonce:this.nonce},64,!0);const P=this.to===void 0||this.to===null,I=(r=n.allowUnlimitedInitCodeSize)!==null&&r!==void 0?r:!1,R=(s=n.common)!==null&&s!==void 0?s:this._getCommon();P&&R.isActivatedEIP(3860)&&!I&&j9t(R,this.data.length)}get type(){return this._type}supports(t){return this.activeCapabilities.includes(t)}validate(t=!1){const n=[];return this.getBaseFee()>this.gasLimit&&n.push(`gasLimit is too low. given ${this.gasLimit}, need at least ${this.getBaseFee()}`),this.isSigned()&&!this.verifySignature()&&n.push("Invalid Signature"),t?n:n.length===0}_validateYParity(){const{v:t}=this;if(t!==void 0&&t!==BigInt(0)&&t!==BigInt(1)){const n=this._errorMsg("The y-parity of the transaction should either be 0 or 1");throw new Error(n)}}_validateHighS(){const{s:t}=this;if(this.common.gteHardfork("homestead")&&t!==void 0&&t>yjt){const n=this._errorMsg("Invalid Signature: s-values greater than secp256k1n/2 are considered invalid");throw new Error(n)}}getBaseFee(){const t=this.common.param("gasPrices","tx");let n=this.getDataFee();if(t&&(n+=t),this.common.gteHardfork("homestead")&&this.toCreationAddress()){const r=this.common.param("gasPrices","txCreation");r&&(n+=r)}return n}getDataFee(){const t=this.common.param("gasPrices","txDataZero"),n=this.common.param("gasPrices","txDataNonZero");let r=BigInt(0);for(let s=0;s<this.data.length;s+=1)this.data[s]===0?r+=t:r+=n;if((this.to===void 0||this.to===null)&&this.common.isActivatedEIP(3860)){const s=BigInt(Math.ceil(this.data.length/32)),a=this.common.param("gasPrices","initCodeWordCost")*s;r+=a}return r}toCreationAddress(){return this.to===void 0||this.to.buf.length===0}isSigned(){const{v:t,r:n,s:r}=this;return!(t===void 0||n===void 0||r===void 0)}verifySignature(){try{const t=this.getSenderPublicKey();return mR(t).length!==0}catch{return!1}}getSenderAddress(){return new c4(c4.publicToAddress(this.getSenderPublicKey()))}sign(t){if(t.length!==32){const c=this._errorMsg("Private key must be 32 bytes in length.");throw new Error(c)}let n=!1;this.type===0&&this.common.gteHardfork("spuriousDragon")&&!this.supports(N0.EIP155ReplayProtection)&&(this.activeCapabilities.push(N0.EIP155ReplayProtection),n=!0);const r=this.getMessageToSign(!0),{v:s,r:a,s:o}=this._ecsign(r,t),l=this._processSignature(s,a,o);if(n){const c=this.activeCapabilities.indexOf(N0.EIP155ReplayProtection);c>-1&&this.activeCapabilities.splice(c,1)}return l}_getCommon(t,n){var r,s,a,o;if(n!==void 0){const l=Ka(ko(n));if(t){if(t.chainId()!==l){const c=this._errorMsg("The chain ID does not match the chain ID of Common");throw new Error(c)}return t.copy()}return Zl.isSupportedChainId(l)?new Zl({chain:l,hardfork:this.DEFAULT_HARDFORK}):Zl.custom({name:"custom-chain",networkId:l,chainId:l},{baseChain:this.DEFAULT_CHAIN,hardfork:this.DEFAULT_HARDFORK})}if(t!=null&&t.copy&&typeof(t==null?void 0:t.copy)=="function")return t.copy();if(t){const l=typeof t.hardfork=="function"?t.hardfork():t.hardfork;return Zl.custom({name:"custom-chain",networkId:t.networkId?t.networkId():(s=BigInt((r=t.customChain)===null||r===void 0?void 0:r.networkId))!==null&&s!==void 0?s:void 0,chainId:t.chainId?t.chainId():(o=BigInt((a=t.customChain)===null||a===void 0?void 0:a.chainId))!==null&&o!==void 0?o:void 0},{baseChain:this.DEFAULT_CHAIN,hardfork:l||this.DEFAULT_HARDFORK})}return new Zl({chain:this.DEFAULT_CHAIN,hardfork:this.DEFAULT_HARDFORK})}_validateCannotExceedMaxInteger(t,n=256,r=!1){for(const[s,a]of Object.entries(t))switch(n){case 64:if(r){if(a!==void 0&&a>=vge){const o=this._errorMsg(`${s} cannot equal or exceed MAX_UINT64 (2^64-1), given ${a}`);throw new Error(o)}}else if(a!==void 0&&a>vge){const o=this._errorMsg(`${s} cannot exceed MAX_UINT64 (2^64-1), given ${a}`);throw new Error(o)}break;case 256:if(r){if(a!==void 0&&a>=UE){const o=this._errorMsg(`${s} cannot equal or exceed MAX_INTEGER (2^256-1), given ${a}`);throw new Error(o)}}else if(a!==void 0&&a>UE){const o=this._errorMsg(`${s} cannot exceed MAX_INTEGER (2^256-1), given ${a}`);throw new Error(o)}break;default:{const o=this._errorMsg("unimplemented bits value");throw new Error(o)}}}static _validateNotArray(t){const n=["nonce","gasPrice","gasLimit","to","value","data","v","r","s","type","baseFee","maxFeePerGas","chainId"];for(const[r,s]of Object.entries(t))if(n.includes(r)&&Array.isArray(s))throw new Error(`${r} cannot be an array`)}_getSharedErrorPostfix(){let t="";try{t=this.isSigned()?Wi(this.hash()):"not available (unsigned)"}catch{t="error"}let n="";try{n=this.isSigned().toString()}catch{t="error"}let r="";try{r=this.common.hardfork()}catch{r="error"}let s=`tx type=${this.type} hash=${t} nonce=${this.nonce} value=${this.value} `;return s+=`signed=${n} hf=${r}`,s}_ecsign(t,n,r){const s=j1.sign(t,n),a=s.toCompactRawBytes(),o=a.subarray(0,32),l=a.subarray(32,64),c=r===void 0?BigInt(s.recovery+27):BigInt(s.recovery+35)+BigInt(r)*BigInt(2);return{r:o,s:l,v:c}}static fromSerializedTx(t,n={}){}static fromTxData(t,n={}){}}const Aee=2,gV=oo(Aee.toString(16).padStart(2,"0"));class Zv extends uN{static fromTxData(t,n={}){return new Zv(t,n)}static fromSerializedTx(t,n={}){if(!n$(t.subarray(0,1),gV))throw new Error(`Invalid serialized tx input: not an EIP-1559 transaction (wrong tx type, expected: ${Aee}, received: ${Wi(t.subarray(0,1))}`);const r=Kh.RLP.decode(t.subarray(1));if(!Array.isArray(r))throw new Error("Invalid serialized tx input: must be array");return Zv.fromValuesArray(r,n)}static fromValuesArray(t,n={}){if(t.length!==9&&t.length!==12)throw new Error("Invalid EIP-1559 transaction. Only expecting 9 values (for unsigned tx) or 12 values (for signed tx).");const[r,s,a,o,l,c,u,d,f,x,g,v]=t;return this._validateNotArray({chainId:r,v:x}),Qae({nonce:s,maxPriorityFeePerGas:a,maxFeePerGas:o,gasLimit:l,value:u,v:x,r:g,s:v}),new Zv({chainId:Ka(r),nonce:s,maxPriorityFeePerGas:a,maxFeePerGas:o,gasLimit:l,to:c,value:u,data:d,accessList:f??[],v:x!==void 0?Ka(x):void 0,r:g,s:v},n)}constructor(t,n={}){var r;super(Object.assign(Object.assign({},t),{type:Aee}),n),this.DEFAULT_HARDFORK="london";const{chainId:s,accessList:a,maxFeePerGas:o,maxPriorityFeePerGas:l}=t;if(this.common=this._getCommon(n.common,s),this.chainId=this.common.chainId(),!this.common.isActivatedEIP(1559))throw new Error("EIP-1559 not enabled on Common");this.activeCapabilities=this.activeCapabilities.concat([1559,2718,2930]);const c=BFe(a??[]);if(this.accessList=c.accessList,this.AccessListJSON=c.AccessListJSON,$Fe(this.accessList),this.maxFeePerGas=Ka(ko(o===""?"0x":o)),this.maxPriorityFeePerGas=Ka(ko(l===""?"0x":l)),this._validateCannotExceedMaxInteger({maxFeePerGas:this.maxFeePerGas,maxPriorityFeePerGas:this.maxPriorityFeePerGas}),uN._validateNotArray(t),this.gasLimit*this.maxFeePerGas>UE){const d=this._errorMsg("gasLimit * maxFeePerGas cannot exceed MAX_INTEGER (2^256-1)");throw new Error(d)}if(this.maxFeePerGas<this.maxPriorityFeePerGas){const d=this._errorMsg("maxFeePerGas cannot be less than maxPriorityFeePerGas (The total must be the larger of the two)");throw new Error(d)}this._validateYParity(),this._validateHighS(),((r=n==null?void 0:n.freeze)!==null&&r!==void 0?r:!0)&&Object.freeze(this)}getDataFee(){if(this.cache.dataFee&&this.cache.dataFee.hardfork===this.common.hardfork())return this.cache.dataFee.value;let t=super.getDataFee();return t+=BigInt(zFe(this.accessList,this.common)),Object.isFrozen(this)&&(this.cache.dataFee={value:t,hardfork:this.common.hardfork()}),t}getUpfrontCost(t=BigInt(0)){const n=this.maxPriorityFeePerGas,r=this.maxFeePerGas-t,a=(n<r?n:r)+t;return this.gasLimit*a+this.value}raw(){return[oa(this.chainId),oa(this.nonce),oa(this.maxPriorityFeePerGas),oa(this.maxFeePerGas),oa(this.gasLimit),this.to!==void 0?this.to.buf:Uint8Array.from([]),oa(this.value),this.data,this.accessList,this.v!==void 0?oa(this.v):Uint8Array.from([]),this.r!==void 0?oa(this.r):Uint8Array.from([]),this.s!==void 0?oa(this.s):Uint8Array.from([])]}serialize(){const t=this.raw();return gd(gV,Kh.RLP.encode(t))}getMessageToSign(t=!0){const n=this.raw().slice(0,9),r=gd(gV,Kh.RLP.encode(n));return t?od(r):r}hash(){if(!this.isSigned()){const t=this._errorMsg("Cannot call hash method if transaction is not signed");throw new Error(t)}return Object.isFrozen(this)?(this.cache.hash||(this.cache.hash=od(this.serialize())),this.cache.hash):od(this.serialize())}getMessageToVerifySignature(){return this.getMessageToSign()}getSenderPublicKey(){if(!this.isSigned()){const a=this._errorMsg("Cannot call this method if transaction is not signed");throw new Error(a)}const t=this.getMessageToVerifySignature(),{v:n,r,s}=this;this._validateHighS();try{return yoe(t,n+BigInt(27),oa(r),oa(s))}catch{const o=this._errorMsg("Invalid Signature");throw new Error(o)}}_processSignature(t,n,r){const s=Object.assign(Object.assign({},this.txOptions),{common:this.common});return Zv.fromTxData({chainId:this.chainId,nonce:this.nonce,maxPriorityFeePerGas:this.maxPriorityFeePerGas,maxFeePerGas:this.maxFeePerGas,gasLimit:this.gasLimit,to:this.to,value:this.value,data:this.data,accessList:this.accessList,v:t-BigInt(27),r:Ka(n),s:Ka(r)},s)}toJSON(){const t=UFe(this.accessList);return{chainId:To(this.chainId),nonce:To(this.nonce),maxPriorityFeePerGas:To(this.maxPriorityFeePerGas),maxFeePerGas:To(this.maxFeePerGas),gasLimit:To(this.gasLimit),to:this.to!==void 0?this.to.toString():void 0,value:To(this.value),data:Wi(this.data),accessList:t,v:this.v!==void 0?To(this.v):void 0,r:this.r!==void 0?To(this.r):void 0,s:this.s!==void 0?To(this.s):void 0}}errorStr(){let t=this._getSharedErrorPostfix();return t+=` maxFeePerGas=${this.maxFeePerGas} maxPriorityFeePerGas=${this.maxPriorityFeePerGas}`,t}_errorMsg(t){return`${t} (${this.errorStr()})`}}const jee=1,bV=oo(jee.toString(16).padStart(2,"0"));class Jv extends uN{static fromTxData(t,n={}){return new Jv(t,n)}static fromSerializedTx(t,n={}){if(!n$(t.subarray(0,1),bV))throw new Error(`Invalid serialized tx input: not an EIP-2930 transaction (wrong tx type, expected: ${jee}, received: ${Wi(t.subarray(0,1))}`);const r=Kh.RLP.decode(Uint8Array.from(t.subarray(1)));if(!Array.isArray(r))throw new Error("Invalid serialized tx input: must be array");return Jv.fromValuesArray(r,n)}static fromValuesArray(t,n={}){if(t.length!==8&&t.length!==11)throw new Error("Invalid EIP-2930 transaction. Only expecting 8 values (for unsigned tx) or 11 values (for signed tx).");const[r,s,a,o,l,c,u,d,f,x,g]=t;this._validateNotArray({chainId:r,v:f}),Qae({nonce:s,gasPrice:a,gasLimit:o,value:c,v:f,r:x,s:g});const v=[];return new Jv({chainId:Ka(r),nonce:s,gasPrice:a,gasLimit:o,to:l,value:c,data:u,accessList:d??v,v:f!==void 0?Ka(f):void 0,r:x,s:g},n)}constructor(t,n={}){var r;super(Object.assign(Object.assign({},t),{type:jee}),n),this.DEFAULT_HARDFORK="berlin";const{chainId:s,accessList:a,gasPrice:o}=t;if(this.common=this._getCommon(n.common,s),this.chainId=this.common.chainId(),!this.common.isActivatedEIP(2930))throw new Error("EIP-2930 not enabled on Common");this.activeCapabilities=this.activeCapabilities.concat([2718,2930]);const l=BFe(a??[]);if(this.accessList=l.accessList,this.AccessListJSON=l.AccessListJSON,$Fe(this.accessList),this.gasPrice=Ka(ko(o===""?"0x":o)),this._validateCannotExceedMaxInteger({gasPrice:this.gasPrice}),uN._validateNotArray(t),this.gasPrice*this.gasLimit>UE){const u=this._errorMsg("gasLimit * gasPrice cannot exceed MAX_INTEGER");throw new Error(u)}this._validateYParity(),this._validateHighS(),((r=n==null?void 0:n.freeze)!==null&&r!==void 0?r:!0)&&Object.freeze(this)}getDataFee(){if(this.cache.dataFee&&this.cache.dataFee.hardfork===this.common.hardfork())return this.cache.dataFee.value;let t=super.getDataFee();return t+=BigInt(zFe(this.accessList,this.common)),Object.isFrozen(this)&&(this.cache.dataFee={value:t,hardfork:this.common.hardfork()}),t}getUpfrontCost(){return this.gasLimit*this.gasPrice+this.value}raw(){return[oa(this.chainId),oa(this.nonce),oa(this.gasPrice),oa(this.gasLimit),this.to!==void 0?this.to.buf:Uint8Array.from([]),oa(this.value),this.data,this.accessList,this.v!==void 0?oa(this.v):Uint8Array.from([]),this.r!==void 0?oa(this.r):Uint8Array.from([]),this.s!==void 0?oa(this.s):Uint8Array.from([])]}serialize(){const t=this.raw();return gd(bV,Kh.RLP.encode(t))}getMessageToSign(t=!0){const n=this.raw().slice(0,8),r=gd(bV,Kh.RLP.encode(n));return t?od(r):r}hash(){if(!this.isSigned()){const t=this._errorMsg("Cannot call hash method if transaction is not signed");throw new Error(t)}return Object.isFrozen(this)?(this.cache.hash||(this.cache.hash=od(this.serialize())),this.cache.hash):od(this.serialize())}getMessageToVerifySignature(){return this.getMessageToSign()}getSenderPublicKey(){if(!this.isSigned()){const a=this._errorMsg("Cannot call this method if transaction is not signed");throw new Error(a)}const t=this.getMessageToVerifySignature(),{v:n,r,s}=this;this._validateHighS();try{return yoe(t,n+BigInt(27),oa(r),oa(s))}catch{const o=this._errorMsg("Invalid Signature");throw new Error(o)}}_processSignature(t,n,r){const s=Object.assign(Object.assign({},this.txOptions),{common:this.common});return Jv.fromTxData({chainId:this.chainId,nonce:this.nonce,gasPrice:this.gasPrice,gasLimit:this.gasLimit,to:this.to,value:this.value,data:this.data,accessList:this.accessList,v:t-BigInt(27),r:Ka(n),s:Ka(r)},s)}toJSON(){const t=UFe(this.accessList);return{chainId:To(this.chainId),nonce:To(this.nonce),gasPrice:To(this.gasPrice),gasLimit:To(this.gasLimit),to:this.to!==void 0?this.to.toString():void 0,value:To(this.value),data:Wi(this.data),accessList:t,v:this.v!==void 0?To(this.v):void 0,r:this.r!==void 0?To(this.r):void 0,s:this.s!==void 0?To(this.s):void 0}}errorStr(){var t,n;let r=this._getSharedErrorPostfix();return r+=` gasPrice=${this.gasPrice} accessListCount=${(n=(t=this.accessList)===null||t===void 0?void 0:t.length)!==null&&n!==void 0?n:0}`,r}_errorMsg(t){return`${t} (${this.errorStr()})`}}const E9t=0;function jge(e,t){const n=Number(e),r=Number(t)*2;return n===r+35||n===r+36}class my extends uN{static fromTxData(t,n={}){return new my(t,n)}static fromSerializedTx(t,n={}){const r=Kh.RLP.decode(t);if(!Array.isArray(r))throw new Error("Invalid serialized tx input. Must be array");return this.fromValuesArray(r,n)}static fromValuesArray(t,n={}){if(t.length!==6&&t.length!==9)throw new Error("Invalid transaction. Only expecting 6 values (for unsigned tx) or 9 values (for signed tx).");const[r,s,a,o,l,c,u,d,f]=t;return Qae({nonce:r,gasPrice:s,gasLimit:a,value:l,v:u,r:d,s:f}),new my({nonce:r,gasPrice:s,gasLimit:a,to:o,value:l,data:c,v:u,r:d,s:f},n)}constructor(t,n={}){var r;if(super(Object.assign(Object.assign({},t),{type:E9t}),n),this.common=this._validateTxV(this.v,n.common),this.gasPrice=Ka(ko(t.gasPrice===""?"0x":t.gasPrice)),this.gasPrice*this.gasLimit>UE){const a=this._errorMsg("gas limit * gasPrice cannot exceed MAX_INTEGER (2^256-1)");throw new Error(a)}this._validateCannotExceedMaxInteger({gasPrice:this.gasPrice}),uN._validateNotArray(t),this.common.gteHardfork("spuriousDragon")&&(this.isSigned()?jge(this.v,this.common.chainId())&&this.activeCapabilities.push(N0.EIP155ReplayProtection):this.activeCapabilities.push(N0.EIP155ReplayProtection)),((r=n==null?void 0:n.freeze)!==null&&r!==void 0?r:!0)&&Object.freeze(this)}raw(){return[oa(this.nonce),oa(this.gasPrice),oa(this.gasLimit),this.to!==void 0?this.to.buf:Uint8Array.from([]),oa(this.value),this.data,this.v!==void 0?oa(this.v):Uint8Array.from([]),this.r!==void 0?oa(this.r):Uint8Array.from([]),this.s!==void 0?oa(this.s):Uint8Array.from([])]}serialize(){return Kh.RLP.encode(this.raw())}_getMessageToSign(){const t=[oa(this.nonce),oa(this.gasPrice),oa(this.gasLimit),this.to!==void 0?this.to.buf:Uint8Array.from([]),oa(this.value),this.data];return this.supports(N0.EIP155ReplayProtection)&&(t.push(ko(this.common.chainId())),t.push(mR(ko(0))),t.push(mR(ko(0)))),t}getMessageToSign(t=!0){const n=this._getMessageToSign();return t?od(Kh.RLP.encode(n)):n}getDataFee(){return this.cache.dataFee&&this.cache.dataFee.hardfork===this.common.hardfork()?this.cache.dataFee.value:(Object.isFrozen(this)&&(this.cache.dataFee={value:super.getDataFee(),hardfork:this.common.hardfork()}),super.getDataFee())}getUpfrontCost(){return this.gasLimit*this.gasPrice+this.value}hash(){if(!this.isSigned()){const t=this._errorMsg("Cannot call hash method if transaction is not signed");throw new Error(t)}return Object.isFrozen(this)?(this.cache.hash||(this.cache.hash=od(Kh.RLP.encode(this.raw()))),this.cache.hash):od(Kh.RLP.encode(this.raw()))}getMessageToVerifySignature(){if(!this.isSigned()){const n=this._errorMsg("This transaction is not signed");throw new Error(n)}const t=this._getMessageToSign();return od(Kh.RLP.encode(t))}getSenderPublicKey(){const t=this.getMessageToVerifySignature(),{v:n,r,s}=this;this._validateHighS();try{return yoe(t,n,oa(r),oa(s),this.supports(N0.EIP155ReplayProtection)?this.common.chainId():void 0)}catch{const o=this._errorMsg("Invalid Signature");throw new Error(o)}}_processSignature(t,n,r){let s=t;this.supports(N0.EIP155ReplayProtection)&&(s+=this.common.chainId()*BigInt(2)+BigInt(8));const a=Object.assign(Object.assign({},this.txOptions),{common:this.common});return my.fromTxData({nonce:this.nonce,gasPrice:this.gasPrice,gasLimit:this.gasLimit,to:this.to,value:this.value,data:this.data,v:s,r:Ka(n),s:Ka(r)},a)}toJSON(){return{nonce:To(this.nonce),gasPrice:To(this.gasPrice),gasLimit:To(this.gasLimit),to:this.to!==void 0?this.to.toString():void 0,value:To(this.value),data:Wi(this.data),v:this.v!==void 0?To(this.v):void 0,r:this.r!==void 0?To(this.r):void 0,s:this.s!==void 0?To(this.s):void 0}}_validateTxV(t,n){let r;const s=t!==void 0?Number(t):void 0;if(s!==void 0&&s<37&&s!==27&&s!==28)throw new Error(`Legacy txs need either v = 27/28 or v >= 37 (EIP-155 replay protection), got v = ${s}`);if(s!==void 0&&s!==0&&(!n||n.gteHardfork("spuriousDragon"))&&s!==27&&s!==28)if(n){if(!jge(BigInt(s),n.chainId()))throw new Error(`Incompatible EIP155-based V ${s} and chain id ${n.chainId()}. See the Common parameter of the Transaction constructor to set the chain id.`)}else{let a;(s-35)%2===0?a=35:a=36,r=BigInt(s-a)/BigInt(2)}return this._getCommon(n,r)}errorStr(){let t=this._getSharedErrorPostfix();return t+=` gasPrice=${this.gasPrice}`,t}_errorMsg(t){return`${t} (${this.errorStr()})`}}const yV=new Map;class V3{constructor(){}static typeToInt(t){return Number(Ka(ko(t)))}static registerTransactionType(t,n){const r=V3.typeToInt(t);yV.set(r,n)}static fromTxData(t,n={}){if(!("type"in t)||t.type===void 0)return my.fromTxData(t,n);const r=V3.typeToInt(t.type);if(r===0)return my.fromTxData(t,n);if(r===1)return Jv.fromTxData(t,n);if(r===2)return Zv.fromTxData(t,n);const s=yV.get(r);if(s!=null&&s.fromTxData)return s.fromTxData(t,n);throw new Error(`Tx instantiation with type ${r} not supported`)}static fromSerializedData(t,n={}){if(t[0]<=127)switch(t[0]){case 1:return Jv.fromSerializedTx(t,n);case 2:return Zv.fromSerializedTx(t,n);default:{const r=yV.get(Number(t[0]));if(r!=null&&r.fromSerializedTx)return r.fromSerializedTx(t,n);throw new Error(`TypedTransaction with ID ${t[0]} unknown`)}}else return my.fromSerializedTx(t,n)}static fromBlockBodyData(t,n={}){if(u2(t))return this.fromSerializedData(t,n);if(Array.isArray(t))return my.fromValuesArray(t,n);throw new Error("Cannot decode transaction: unknown type input")}}var f$=function(e,t,n,r){function s(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?a(d.value):s(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})};const LA=(e,t)=>{let n;if(!t&&typeof e=="string"&&Aa(e)&&e.length!==66)throw new Bxe;try{n=u2(e)?e:rx(e)}catch{throw new QSt}if(!t&&n.byteLength!==32)throw new Bxe;return n},voe=(e,t=!1)=>{const n=Aa(e)?e:vm(e),r=oo(n),s=oo(ZPe(`Ethereum Signed Message:
${r.byteLength}`)),a=t?r:gd(s,r);return Yf(a)},_9t=(e,t)=>{const n=LA(t),r=j1.sign(e.substring(2),n),s=r.toCompactRawBytes(),a=r.r.toString(16).padStart(64,"0"),o=r.s.toString(16).padStart(64,"0"),l=r.recovery+27;return{messageHash:e,v:nc(l),r:`0x${a}`,s:`0x${o}`,signature:`${Wi(s)}${l.toString(16)}`}},HFe=(e,t)=>{const n=voe(e),{messageHash:r,v:s,r:a,s:o,signature:l}=_9t(n,t);return{message:e,messageHash:r,v:s,r:a,s:o,signature:l}},k9t=(e,t)=>f$(void 0,void 0,void 0,function*(){const n=e.sign(oo(t));if(pr(n.v)||pr(n.r)||pr(n.s))throw new fee("Signer Error");const r=n.validate(!0);if(r.length>0){let o="Signer Error ";for(const l of r)o+=`${o} ${l}.`;throw new fee(o)}const s=Wi(n.serialize()),a=Yf(s);return{messageHash:Wi(n.getMessageToSign(!0)),v:`0x${n.v.toString(16)}`,r:`0x${n.r.toString(16).padStart(64,"0")}`,s:`0x${n.s.toString(16).padStart(64,"0")}`,rawTransaction:s,transactionHash:Wi(a)}}),T9t=e=>{if(pr(e))throw new pNt;const t=V3.fromSerializedData(oo(e));return fx(t.getSenderAddress().toString())},Eee=(e,t,n,r,s)=>{if(typeof e=="object"){const f=`${e.r}${e.s.slice(2)}${e.v.slice(2)}`;return Eee(e.messageHash,f,n)}if(typeof t=="string"&&typeof n=="string"&&!pr(r)){const f=`${n}${r.slice(2)}${t.slice(2)}`;return Eee(e,f,s)}if(pr(t))throw new ZSt("signature string undefined");const a=130,o=n?e:voe(e);let l=parseInt(t.substring(a),16);l>26&&(l-=27);const c=j1.Signature.fromCompact(t.slice(2,a)).addRecoveryBit(l).recoverPublicKey(o.replace("0x","")).toRawBytes(!1),u=Yf(c.subarray(1));return fx(`0x${u.slice(-40)}`)},h$=e=>{const t=LA(e),n=j1.getPublicKey(t,!1),s=Yf(n.slice(1)).slice(-40);return fx(`0x${s}`)},I9t=(e,t)=>{const n=LA(e);return`0x${Wi(j1.getPublicKey(n,t)).slice(4)}`},VFe=(e,t,n)=>f$(void 0,void 0,void 0,function*(){var r,s,a,o,l,c,u;const d=LA(e);let f;if(n!=null&&n.salt?f=typeof n.salt=="string"?oo(n.salt):n.salt:f=DE(32),!(Yae(t)||u2(t)))throw new tNt;const x=typeof t=="string"?oo(vm(t)):t;let g;if(n!=null&&n.iv){if(g=typeof n.iv=="string"?oo(n.iv):n.iv,g.length!==16)throw new nNt}else g=DE(16);const v=(r=n==null?void 0:n.kdf)!==null&&r!==void 0?r:"scrypt";let w,C;if(v==="pbkdf2"){if(C={dklen:(s=n==null?void 0:n.dklen)!==null&&s!==void 0?s:32,salt:Wi(f).replace("0x",""),c:(a=n==null?void 0:n.c)!==null&&a!==void 0?a:262144,prf:"hmac-sha256"},C.c<1e3)throw new rNt;w=AFe(x,f,C.c,C.dklen,"sha256")}else if(v==="scrypt")C={n:(o=n==null?void 0:n.n)!==null&&o!==void 0?o:8192,r:(l=n==null?void 0:n.r)!==null&&l!==void 0?l:8,p:(c=n==null?void 0:n.p)!==null&&c!==void 0?c:1,dklen:(u=n==null?void 0:n.dklen)!==null&&u!==void 0?u:32,salt:Wi(f).replace("0x","")},w=jFe(x,f,C.n,C.p,C.r,C.dklen);else throw new fPe;const N=yield uoe(d,w.slice(0,16),g,"aes-128-ctr"),P=Wi(N).slice(2),I=Yf(gd(w.slice(16,32),N)).replace("0x","");return{version:3,id:ioe(),address:h$(d).toLowerCase().replace("0x",""),crypto:{ciphertext:P,cipherparams:{iv:Wi(g).replace("0x","")},cipher:"aes-128-ctr",kdf:v,kdfparams:C,mac:I}}}),woe=(e,t)=>{const n=LA(e,t);return{address:h$(n),privateKey:Wi(n),signTransaction:r=>{throw new fee("Do not have network access to sign the transaction")},sign:r=>HFe(typeof r=="string"?r:JSON.stringify(r),n),encrypt:(r,s)=>f$(void 0,void 0,void 0,function*(){return VFe(n,r,s)})}},P9t=()=>{const e=j1.utils.randomPrivateKey();return woe(`${Wi(e)}`)},F9t=(e,t,n)=>f$(void 0,void 0,void 0,function*(){const r=typeof e=="object"?e:JSON.parse(n?e.toLowerCase():e);if(qs.validateJSONSchema(vjt,r),r.version!==3)throw new eNt;const s=typeof t=="string"?oo(vm(t)):t;qs.validate(["bytes"],[s]);let a;if(r.crypto.kdf==="scrypt"){const u=r.crypto.kdfparams,d=typeof u.salt=="string"?oo(u.salt):u.salt;a=jFe(s,d,u.n,u.p,u.r,u.dklen)}else if(r.crypto.kdf==="pbkdf2"){const u=r.crypto.kdfparams,d=typeof u.salt=="string"?oo(u.salt):u.salt;a=AFe(s,d,u.c,u.dklen,"sha256")}else throw new fPe;const o=oo(r.crypto.ciphertext);if(Yf(gd(a.slice(16,32),o)).replace("0x","")!==r.crypto.mac)throw new JSt;const c=yield E7t(oo(r.crypto.ciphertext),a.slice(0,16),oo(r.crypto.cipherparams.iv));return woe(c)});var Ege=function(e,t,n,r){function s(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?a(d.value):s(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})};const O9t=1e3;class M9t{constructor(t){this._requestManager=t,this._requests=new Map}get requests(){return[...this._requests.values()].map(t=>t.payload)}add(t){const n=U3(t),r=new uR;return this._requests.set(n.id,{payload:n,promise:r}),r}execute(t){return Ege(this,void 0,void 0,function*(){var n;if(this.requests.length===0)return Promise.resolve([]);const r=new uR({timeout:(n=t==null?void 0:t.timeout)!==null&&n!==void 0?n:O9t,eagerStart:!0,timeoutMessage:"Batch request timeout"});return this._processBatchRequest(r).catch(s=>r.reject(s)),r.catch(s=>{s instanceof hPe&&this._abortAllRequests("Batch request timeout"),r.reject(s)}),r})}_processBatchRequest(t){return Ege(this,void 0,void 0,function*(){var n,r;const s=yield this._requestManager.sendBatch([...this._requests.values()].map(l=>l.payload));if(s.length!==this._requests.size)throw this._abortAllRequests("Invalid batch response"),new S0(s,`Batch request size mismatch the results size. Requests: ${this._requests.size}, Responses: ${s.length}`);const a=this.requests.map(l=>l.id).map(Number).sort((l,c)=>l-c),o=s.map(l=>l.id).map(Number).sort((l,c)=>l-c);if(JSON.stringify(a)!==JSON.stringify(o))throw this._abortAllRequests("Invalid batch response"),new S0(s,`Batch request mismatch the results. Requests: [${a.join()}], Responses: [${o.join()}]`);for(const l of s)jy(l)?(n=this._requests.get(l.id))===null||n===void 0||n.promise.resolve(l.result):Ey(l)&&((r=this._requests.get(l.id))===null||r===void 0||r.promise.reject(l.error));t.resolve(s)})}_abortAllRequests(t){for(const{promise:n}of this._requests.values())n.reject(new uNt(t))}}var R9t=function(e,t,n,r){function s(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?a(d.value):s(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})};class Qd extends y7t{constructor(t){var n;if(super(),this.providers=e3.providers,ni(t)||typeof t=="string"&&t.trim()!==""||dR(t)){this._requestManager=new e3(t),this._subscriptionManager=new fR(this._requestManager,{});return}const{config:r,provider:s,requestManager:a,subscriptionManager:o,registeredSubscriptions:l,accountProvider:c,wallet:u,requestManagerMiddleware:d}=t;this.setConfig(r??{}),this._requestManager=a??new e3(s,(n=r==null?void 0:r.enableExperimentalFeatures)===null||n===void 0?void 0:n.useSubscriptionWhenCheckingBlockTimeout,d),o?this._subscriptionManager=o:this._subscriptionManager=new fR(this.requestManager,l??{}),c&&(this._accountProvider=c),u&&(this._wallet=u)}get requestManager(){return this._requestManager}get subscriptionManager(){return this._subscriptionManager}get wallet(){return this._wallet}get accountProvider(){return this._accountProvider}static fromContextObject(...t){return new this(...t.reverse())}getContextObject(){var t;return{config:this.config,provider:this.provider,requestManager:this.requestManager,subscriptionManager:this.subscriptionManager,registeredSubscriptions:(t=this.subscriptionManager)===null||t===void 0?void 0:t.registeredSubscriptions,providers:this.providers,wallet:this.wallet,accountProvider:this.accountProvider}}use(t,...n){const r=new t(...n,this.getContextObject());return this.on(z3.CONFIG_CHANGE,s=>{r.setConfig({[s.name]:s.newValue})}),this[t.name]=r,r}link(t){this.setConfig(t.config),this._requestManager=t.requestManager,this.provider=t.provider,this._subscriptionManager=t.subscriptionManager,this._wallet=t.wallet,this._accountProvider=t._accountProvider,t.on(z3.CONFIG_CHANGE,n=>{this.setConfig({[n.name]:n.newValue})})}registerPlugin(t){if(this[t.pluginNamespace]!==void 0)throw new dNt(t.pluginNamespace);const n={[t.pluginNamespace]:t};n[t.pluginNamespace].link(this),Object.assign(this,n)}get provider(){return this.currentProvider}set provider(t){this.requestManager.setProvider(t)}get currentProvider(){return this.requestManager.provider}set currentProvider(t){this.requestManager.setProvider(t)}get givenProvider(){return Qd.givenProvider}setProvider(t){return this.provider=t,!0}setRequestManagerMiddleware(t){this.requestManager.setMiddleware(t)}get BatchRequest(){return M9t.bind(void 0,this._requestManager)}extend(t){var n;return t.property&&!this[t.property]&&(this[t.property]={}),(n=t.methods)===null||n===void 0||n.forEach(r=>{const s=(...a)=>R9t(this,void 0,void 0,function*(){return this.requestManager.send({method:r.call,params:a})});t.property?this[t.property][r.name]=s:this[r.name]=s}),this}}Qd.providers=e3.providers;class Rl{constructor(t){if(this.toAddress=()=>{if(this.isDirect()){const n=this._iban.slice(4),r=Rl._parseInt(n,36),s=RE(r,40);return fx(s)}throw new Error("Iban is indirect and cannot be converted. Must be length of 34 or 35")},Rl.isIndirect(t)||Rl.isDirect(t))this._iban=t;else throw new Error("Invalid IBAN was provided")}static isDirect(t){return t.length===34||t.length===35}isDirect(){return Rl.isDirect(this._iban)}static isIndirect(t){return t.length===20}isIndirect(){return Rl.isIndirect(this._iban)}static isValid(t){return/^XE[0-9]{2}(ETH[0-9A-Z]{13}|[0-9A-Z]{30,31})$/.test(t)&&Rl._mod9710(Rl._iso13616Prepare(t))===1}isValid(){return Rl.isValid(this._iban)}static fromBban(t){const n="XE",s=`0${(98-this._mod9710(this._iso13616Prepare(`${n}00${t}`))).toString()}`.slice(-2);return new Rl(`${n}${s}${t}`)}static createIndirect(t){return Rl.fromBban(`ETH${t.institution}${t.identifier}`)}static fromAddress(t){if(!Kf(t))throw new zae(t);const r=BigInt(Jk(t)).toString(36),s=RE(r,15);return Rl.fromBban(s.toUpperCase())}static toIban(t){return Rl.fromAddress(t).toString()}client(){return this.isIndirect()?this._iban.slice(11):""}checksum(){return this._iban.slice(2,4)}institution(){return this.isIndirect()?this._iban.slice(7,11):""}toString(){return this._iban}}Rl._iso13616Prepare=e=>{const r=e.toUpperCase();return`${r.slice(4)}${r.slice(0,4)}`.split("").map(a=>{const o=a.charCodeAt(0);return o>=65&&o<=90?o-65+10:a}).join("")};Rl._parseInt=(e,t)=>[...e].reduce((n,r)=>BigInt(parseInt(r,t))+BigInt(t)*n,BigInt(0));Rl._mod9710=e=>{let t=e,n;for(;t.length>2;)n=t.slice(0,9),t=`${(parseInt(n,10)%97).toString()}${t.slice(n.length)}`;return parseInt(t,10)%97};Rl.toAddress=e=>new Rl(e).toAddress();var vV=function(e,t,n,r){function s(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?a(d.value):s(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})},WFe;class qFe extends l${constructor(t){super(),this[WFe]="Promise",this._promise=new Promise(t)}then(t,n){return vV(this,void 0,void 0,function*(){return this._promise.then(t,n)})}catch(t){return vV(this,void 0,void 0,function*(){return this._promise.catch(t)})}finally(t){return vV(this,void 0,void 0,function*(){return this._promise.finally(t)})}on(t,n){return super.on(t,n),this}once(t,n){return super.once(t,n),this}}WFe=Symbol.toStringTag;var wV={},_ge;function L9t(){return _ge||(_ge=1,function(e,t){if(e.setImmediate)return;var n=1,r={},s=!1,a=e.document,o;function l(P){typeof P!="function"&&(P=new Function(""+P));for(var I=new Array(arguments.length-1),R=0;R<I.length;R++)I[R]=arguments[R+1];var F={callback:P,args:I};return r[n]=F,o(n),n++}function c(P){delete r[P]}function u(P){var I=P.callback,R=P.args;switch(R.length){case 0:I();break;case 1:I(R[0]);break;case 2:I(R[0],R[1]);break;case 3:I(R[0],R[1],R[2]);break;default:I.apply(t,R);break}}function d(P){if(s)setTimeout(d,0,P);else{var I=r[P];if(I){s=!0;try{u(I)}finally{c(P),s=!1}}}}function f(){o=function(P){process.nextTick(function(){d(P)})}}function x(){if(e.postMessage&&!e.importScripts){var P=!0,I=e.onmessage;return e.onmessage=function(){P=!1},e.postMessage("","*"),e.onmessage=I,P}}function g(){var P="setImmediate$"+Math.random()+"$",I=function(R){R.source===e&&typeof R.data=="string"&&R.data.indexOf(P)===0&&d(+R.data.slice(P.length))};e.addEventListener?e.addEventListener("message",I,!1):e.attachEvent("onmessage",I),o=function(R){e.postMessage(P+R,"*")}}function v(){var P=new MessageChannel;P.port1.onmessage=function(I){var R=I.data;d(R)},o=function(I){P.port2.postMessage(I)}}function w(){var P=a.documentElement;o=function(I){var R=a.createElement("script");R.onreadystatechange=function(){d(I),R.onreadystatechange=null,P.removeChild(R),R=null},P.appendChild(R)}}function C(){o=function(P){setTimeout(d,0,P)}}var N=Object.getPrototypeOf&&Object.getPrototypeOf(e);N=N&&N.setTimeout?N:e,{}.toString.call(e.process)==="[object process]"?f():x()?g():e.MessageChannel?v():a&&"onreadystatechange"in a.createElement("script")?w():C(),N.setImmediate=l,N.clearImmediate=c}(typeof self>"u"?typeof Tu>"u"?wV:Tu:self)),wV}L9t();var fi=function(e,t,n,r){function s(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?a(d.value):s(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})};function D9t(e){return fi(this,void 0,void 0,function*(){return e.send({method:"eth_protocolVersion",params:[]})})}function GFe(e){return fi(this,void 0,void 0,function*(){return e.send({method:"eth_syncing",params:[]})})}function B9t(e){return fi(this,void 0,void 0,function*(){return e.send({method:"eth_coinbase",params:[]})})}function $9t(e){return fi(this,void 0,void 0,function*(){return e.send({method:"eth_mining",params:[]})})}function U9t(e){return fi(this,void 0,void 0,function*(){return e.send({method:"eth_hashrate",params:[]})})}function z9t(e){return fi(this,void 0,void 0,function*(){return e.send({method:"eth_gasPrice",params:[]})})}function H9t(e){return fi(this,void 0,void 0,function*(){return e.send({method:"eth_maxPriorityFeePerGas",params:[]})})}function V9t(e){return fi(this,void 0,void 0,function*(){return e.send({method:"eth_accounts",params:[]})})}function W9t(e){return fi(this,void 0,void 0,function*(){return e.send({method:"eth_blockNumber",params:[]})})}function q9t(e,t,n){return fi(this,void 0,void 0,function*(){return qs.validate(["address","blockNumberOrTag"],[t,n]),e.send({method:"eth_getBalance",params:[t,n]})})}function G9t(e,t,n,r){return fi(this,void 0,void 0,function*(){return qs.validate(["address","hex","blockNumberOrTag"],[t,n,r]),e.send({method:"eth_getStorageAt",params:[t,n,r]})})}function K9t(e,t,n){return fi(this,void 0,void 0,function*(){return qs.validate(["address","blockNumberOrTag"],[t,n]),e.send({method:"eth_getTransactionCount",params:[t,n]})})}function Y9t(e,t){return fi(this,void 0,void 0,function*(){return qs.validate(["bytes32"],[t]),e.send({method:"eth_getBlockTransactionCountByHash",params:[t]})})}function X9t(e,t){return fi(this,void 0,void 0,function*(){return qs.validate(["blockNumberOrTag"],[t]),e.send({method:"eth_getBlockTransactionCountByNumber",params:[t]})})}function Q9t(e,t){return fi(this,void 0,void 0,function*(){return qs.validate(["bytes32"],[t]),e.send({method:"eth_getUncleCountByBlockHash",params:[t]})})}function Z9t(e,t){return fi(this,void 0,void 0,function*(){return qs.validate(["blockNumberOrTag"],[t]),e.send({method:"eth_getUncleCountByBlockNumber",params:[t]})})}function J9t(e,t,n){return fi(this,void 0,void 0,function*(){return qs.validate(["address","blockNumberOrTag"],[t,n]),e.send({method:"eth_getCode",params:[t,n]})})}function eEt(e,t,n){return fi(this,void 0,void 0,function*(){return qs.validate(["address","hex"],[t,n]),e.send({method:"eth_sign",params:[t,n]})})}function tEt(e,t){return fi(this,void 0,void 0,function*(){return e.send({method:"eth_signTransaction",params:[t]})})}function nEt(e,t){return fi(this,void 0,void 0,function*(){return e.send({method:"eth_sendTransaction",params:[t]})})}function KFe(e,t){return fi(this,void 0,void 0,function*(){return qs.validate(["hex"],[t]),e.send({method:"eth_sendRawTransaction",params:[t]})})}function rEt(e,t,n){return fi(this,void 0,void 0,function*(){return qs.validate(["blockNumberOrTag"],[n]),e.send({method:"eth_call",params:[t,n]})})}function sEt(e,t,n){return fi(this,void 0,void 0,function*(){return qs.validate(["blockNumberOrTag"],[n]),e.send({method:"eth_estimateGas",params:[t,n]})})}function iEt(e,t,n){return fi(this,void 0,void 0,function*(){return qs.validate(["bytes32","bool"],[t,n]),e.send({method:"eth_getBlockByHash",params:[t,n]})})}function YFe(e,t,n){return fi(this,void 0,void 0,function*(){return qs.validate(["blockNumberOrTag","bool"],[t,n]),e.send({method:"eth_getBlockByNumber",params:[t,n]})})}function aEt(e,t){return fi(this,void 0,void 0,function*(){return qs.validate(["bytes32"],[t]),e.send({method:"eth_getTransactionByHash",params:[t]})})}function oEt(e,t,n){return fi(this,void 0,void 0,function*(){return qs.validate(["bytes32","hex"],[t,n]),e.send({method:"eth_getTransactionByBlockHashAndIndex",params:[t,n]})})}function lEt(e,t,n){return fi(this,void 0,void 0,function*(){return qs.validate(["blockNumberOrTag","hex"],[t,n]),e.send({method:"eth_getTransactionByBlockNumberAndIndex",params:[t,n]})})}function cEt(e,t){return fi(this,void 0,void 0,function*(){return qs.validate(["bytes32"],[t]),e.send({method:"eth_getTransactionReceipt",params:[t]})})}function uEt(e,t,n){return fi(this,void 0,void 0,function*(){return qs.validate(["bytes32","hex"],[t,n]),e.send({method:"eth_getUncleByBlockHashAndIndex",params:[t,n]})})}function dEt(e,t,n){return fi(this,void 0,void 0,function*(){return qs.validate(["blockNumberOrTag","hex"],[t,n]),e.send({method:"eth_getUncleByBlockNumberAndIndex",params:[t,n]})})}function fEt(e,t){return fi(this,void 0,void 0,function*(){return qs.validate(["filter"],[t]),e.send({method:"eth_newFilter",params:[t]})})}function hEt(e){return fi(this,void 0,void 0,function*(){return e.send({method:"eth_newBlockFilter",params:[]})})}function pEt(e){return fi(this,void 0,void 0,function*(){return e.send({method:"eth_newPendingTransactionFilter",params:[]})})}function mEt(e,t){return fi(this,void 0,void 0,function*(){return qs.validate(["hex"],[t]),e.send({method:"eth_uninstallFilter",params:[t]})})}function xEt(e,t){return fi(this,void 0,void 0,function*(){return qs.validate(["hex"],[t]),e.send({method:"eth_getFilterChanges",params:[t]})})}function gEt(e,t){return fi(this,void 0,void 0,function*(){return qs.validate(["hex"],[t]),e.send({method:"eth_getFilterLogs",params:[t]})})}function bEt(e,t){return fi(this,void 0,void 0,function*(){return qs.validate(["filter"],[t]),e.send({method:"eth_getLogs",params:[t]})})}function yEt(e){return fi(this,void 0,void 0,function*(){return e.send({method:"eth_getWork",params:[]})})}function vEt(e,t,n,r){return fi(this,void 0,void 0,function*(){return qs.validate(["bytes8","bytes32","bytes32"],[t,n,r]),e.send({method:"eth_submitWork",params:[t,n,r]})})}function wEt(e,t,n,r){return fi(this,void 0,void 0,function*(){qs.validate(["hex","blockNumberOrTag"],[t,n]);for(const s of r)qs.validate(["number"],[s]);return e.send({method:"eth_feeHistory",params:[t,n,r]})})}function CEt(e){return fi(this,void 0,void 0,function*(){return e.send({method:"eth_pendingTransactions",params:[]})})}function SEt(e){return fi(this,void 0,void 0,function*(){return e.send({method:"eth_requestAccounts",params:[]})})}function NEt(e){return fi(this,void 0,void 0,function*(){return e.send({method:"eth_chainId",params:[]})})}function AEt(e,t,n,r){return fi(this,void 0,void 0,function*(){return qs.validate(["address","bytes32[]","blockNumberOrTag"],[t,n,r]),e.send({method:"eth_getProof",params:[t,n,r]})})}function jEt(e){return fi(this,void 0,void 0,function*(){return e.send({method:"web3_clientVersion",params:[]})})}function EEt(e,t,n){return fi(this,void 0,void 0,function*(){return qs.validate(["blockNumberOrTag"],[n]),e.send({method:"eth_createAccessList",params:[t,n]})})}function _Et(e,t,n,r=!1){return fi(this,void 0,void 0,function*(){return qs.validate(["address"],[t]),e.send({method:`eth_signTypedData${r?"":"_v4"}`,params:[t,n]})})}var Coe=function(e,t,n,r){function s(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?a(d.value):s(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})};function kEt(e){return Coe(this,void 0,void 0,function*(){return e.send({method:"net_version",params:[]})})}function TEt(e){return Coe(this,void 0,void 0,function*(){return e.send({method:"net_peerCount",params:[]})})}function IEt(e){return Coe(this,void 0,void 0,function*(){return e.send({method:"net_listening",params:[]})})}var E1=function(e,t,n,r){function s(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?a(d.value):s(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})};const PEt=e=>E1(void 0,void 0,void 0,function*(){return e.send({method:"personal_listAccounts",params:[]})}),FEt=(e,t)=>E1(void 0,void 0,void 0,function*(){return e.send({method:"personal_newAccount",params:[t]})}),OEt=(e,t,n,r)=>E1(void 0,void 0,void 0,function*(){return e.send({method:"personal_unlockAccount",params:[t,n,r]})}),MEt=(e,t)=>E1(void 0,void 0,void 0,function*(){return e.send({method:"personal_lockAccount",params:[t]})}),REt=(e,t,n)=>E1(void 0,void 0,void 0,function*(){return e.send({method:"personal_importRawKey",params:[t,n]})}),LEt=(e,t,n)=>E1(void 0,void 0,void 0,function*(){return e.send({method:"personal_sendTransaction",params:[t,n]})}),DEt=(e,t,n)=>E1(void 0,void 0,void 0,function*(){return e.send({method:"personal_signTransaction",params:[t,n]})}),BEt=(e,t,n,r)=>E1(void 0,void 0,void 0,function*(){return e.send({method:"personal_sign",params:[t,n,r]})}),$Et=(e,t,n)=>E1(void 0,void 0,void 0,function*(){return e.send({method:"personal_ecRecover",params:[t,n]})}),kge={type:"object",properties:{accessList:{type:"null"},maxFeePerGas:{type:"null"},maxPriorityFeePerGas:{type:"null"}}},Tge={type:"object",properties:{maxFeePerGas:{type:"null"},maxPriorityFeePerGas:{type:"null"}}},Ige={type:"object",properties:{gasPrice:{type:"null"}}},dP=(e,t,n)=>{try{qs.validateJSONSchema(e,t)}catch(r){throw r instanceof nN?new DNt(r.errors,n):r}},UEt=e=>{var t,n;const r=e;if(!pr(r.type)){let a;switch(r.type){case"0x0":a=kge;break;case"0x1":a=Tge;break;case"0x2":a=Ige;break;default:return qr({format:"uint"},r.type,pi)}return dP(a,r,r.type),qr({format:"uint"},r.type,pi)}if(!pr(r.maxFeePerGas)||!pr(r.maxPriorityFeePerGas))return dP(Ige,r,"0x2"),"0x2";if(!pr(r.accessList))return dP(Tge,r,"0x1"),"0x1";const s=(t=r.hardfork)!==null&&t!==void 0?t:(n=r.common)===null||n===void 0?void 0:n.hardfork;if(!pr(s)){const a=Object.keys(Xj).indexOf(s);if(a>=Object.keys(Xj).indexOf("london"))return pr(r.gasPrice)?"0x2":"0x0";if(a===Object.keys(Xj).indexOf("berlin"))return"0x0"}if(!pr(r.gasPrice))return dP(kge,r,"0x0"),"0x0"},zEt=(e,t)=>{var n;return((n=t==null?void 0:t.transactionTypeParser)!==null&&n!==void 0?n:UEt)(e)},HEt=e=>e[0]>127?"0x0":m1(e[0]),VEt={type:"object",properties:{address:{format:"address"},storageKeys:{type:"array",items:{format:"bytes32"}}}},Soe={type:"array",items:Object.assign({},VEt)},WEt={type:"object",properties:{accessList:Object.assign({},Soe),gasUsed:{type:"string"}}},Pge={type:"string",enum:["goerli","kovan","mainnet","rinkeby","ropsten","sepolia"]},Fge={type:"string",enum:["arrowGlacier","berlin","byzantium","chainstart","constantinople","dao","homestead","istanbul","london","merge","muirGlacier","petersburg","shanghai","spuriousDragon","tangerineWhistle"]},qEt={type:"object",properties:{name:{format:"string"},networkId:{format:"uint"},chainId:{format:"uint"}}},XFe={type:"object",properties:{from:{format:"address"},to:{oneOf:[{format:"address"},{type:"null"}]},value:{format:"uint"},gas:{format:"uint"},gasPrice:{format:"uint"},effectiveGasPrice:{format:"uint"},type:{format:"uint"},maxFeePerGas:{format:"uint"},maxPriorityFeePerGas:{format:"uint"},accessList:Object.assign({},Soe),data:{format:"bytes"},input:{format:"bytes"},nonce:{format:"uint"},chain:Object.assign({},Pge),hardfork:Object.assign({},Fge),chainId:{format:"uint"},networkId:{format:"uint"},common:{type:"object",properties:{customChain:Object.assign({},qEt),baseChain:Object.assign({},Pge),hardfork:Object.assign({},Fge)}},gasLimit:{format:"uint"},v:{format:"uint"},r:{format:"bytes32"},s:{format:"bytes32"}}},_ee={type:"object",properties:Object.assign(Object.assign({},XFe.properties),{blockHash:{format:"bytes32"},blockNumber:{format:"uint"},hash:{format:"bytes32"},transactionIndex:{format:"uint"},from:{format:"address"},to:{oneOf:[{format:"address"},{type:"null"}]},value:{format:"uint"},gas:{format:"uint"},gasPrice:{format:"uint"},effectiveGasPrice:{format:"uint"},type:{format:"uint"},maxFeePerGas:{format:"uint"},maxPriorityFeePerGas:{format:"uint"},accessList:Object.assign({},Soe),data:{format:"bytes"},input:{format:"bytes"},nonce:{format:"uint"},gasLimit:{format:"uint"},v:{format:"uint"},r:{format:"bytes32"},s:{format:"bytes32"}})},QFe={type:"object",properties:{index:{format:"uint"},validatorIndex:{format:"uint"},address:{format:"address"},amount:{format:"uint"}}},xR={type:"object",properties:{baseFeePerGas:{format:"uint"},blobGasUsed:{format:"uint"},difficulty:{format:"uint"},excessBlobGas:{format:"uint"},extraData:{format:"bytes"},gasLimit:{format:"uint"},gasUsed:{format:"uint"},hash:{format:"bytes32"},logsBloom:{format:"bytes256"},miner:{format:"bytes"},mixHash:{format:"bytes32"},nonce:{format:"uint"},number:{format:"uint"},parentBeaconBlockRoot:{format:"bytes32"},parentHash:{format:"bytes32"},receiptsRoot:{format:"bytes32"},sha3Uncles:{format:"bytes32"},size:{format:"uint"},stateRoot:{format:"bytes32"},timestamp:{format:"uint"},totalDifficulty:{format:"uint"},transactions:{oneOf:[{type:"array",items:Object.assign({},_ee)},{type:"array",items:{format:"bytes32"}}]},transactionsRoot:{format:"bytes32"},uncles:{type:"array",items:{format:"bytes32"}},withdrawals:{type:"array",items:Object.assign({},QFe)},withdrawalsRoot:{format:"bytes32"}}},GEt={type:"object",properties:{author:{format:"bytes32"},excessDataGas:{format:"uint"},baseFeePerGas:{format:"uint"},blobGasUsed:{format:"uint"},difficulty:{format:"uint"},excessBlobGas:{format:"uint"},extraData:{format:"bytes"},gasLimit:{format:"uint"},gasUsed:{format:"uint"},hash:{format:"bytes32"},logsBloom:{format:"bytes256"},miner:{format:"bytes"},mixHash:{format:"bytes32"},nonce:{format:"uint"},number:{format:"uint"},parentBeaconBlockRoot:{format:"bytes32"},parentHash:{format:"bytes32"},receiptsRoot:{format:"bytes32"},sha3Uncles:{format:"bytes32"},size:{format:"uint"},stateRoot:{format:"bytes32"},timestamp:{format:"uint"},totalDifficulty:{format:"uint"},transactions:{type:"array",items:{format:"bytes32"}},transactionsRoot:{format:"bytes32"},uncles:{type:"array",items:{format:"bytes32"}},withdrawals:{type:"array",items:Object.assign({},QFe)},withdrawalsRoot:{format:"bytes32"}}},DA={type:"object",properties:{removed:{format:"bool"},logIndex:{format:"uint"},transactionIndex:{format:"uint"},transactionHash:{format:"bytes32"},blockHash:{format:"bytes32"},blockNumber:{format:"uint"},address:{format:"address"},data:{format:"bytes"},topics:{type:"array",items:{format:"bytes32"}}}},KEt={type:"object",properties:{startingBlock:{format:"string"},currentBlock:{format:"string"},highestBlock:{format:"string"},knownStates:{format:"string"},pulledStates:{format:"string"}}},BA={type:"object",properties:{transactionHash:{format:"bytes32"},transactionIndex:{format:"uint"},blockHash:{format:"bytes32"},blockNumber:{format:"uint"},from:{format:"address"},to:{format:"address"},cumulativeGasUsed:{format:"uint"},gasUsed:{format:"uint"},effectiveGasPrice:{format:"uint"},contractAddress:{format:"address"},logs:{type:"array",items:Object.assign({},DA)},logsBloom:{format:"bytes"},root:{format:"bytes"},status:{format:"uint"},type:{format:"uint"}}},YEt={type:"object",properties:{messageHash:{format:"bytes"},r:{format:"bytes32"},s:{format:"bytes32"},v:{format:"bytes"},message:{format:"bytes"},signature:{format:"bytes"}}},XEt={type:"object",properties:{oldestBlock:{format:"uint"},baseFeePerGas:{type:"array",items:{format:"uint"}},reward:{type:"array",items:{type:"array",items:{format:"uint"}}},gasUsedRatio:{type:"array",items:{type:"number"}}}},QEt={type:"object",properties:{key:{format:"bytes32"},value:{format:"uint"},proof:{type:"array",items:{format:"bytes32"}}}},ZEt={type:"object",properties:{balance:{format:"uint"},codeHash:{format:"bytes32"},nonce:{format:"uint"},storageHash:{format:"bytes32"},accountProof:{type:"array",items:{format:"bytes32"}},storageProof:{type:"array",items:Object.assign({},QEt)}}};function cf(e,t=dd,n={transactionSchema:_ee,fillInputAndData:!1}){var r,s;let a=d2({},e);if(pr(e==null?void 0:e.common)||(a.common=Object.assign({},e.common),pr((r=e.common)===null||r===void 0?void 0:r.customChain)||(a.common.customChain=Object.assign({},e.common.customChain))),a=qr((s=n.transactionSchema)!==null&&s!==void 0?s:_ee,a,t),!pr(a.data)&&!pr(a.input)&&m1(a.data)!==m1(a.input))throw new gPe({data:Wi(a.data),input:Wi(a.input)});return n.fillInputAndData&&(pr(a.data)?pr(a.input)||(a.data=a.input):a.input=a.data),pr(a.gasLimit)||(a.gas=a.gasLimit,delete a.gasLimit),a}function JEt(e,t,n={fillInputAndData:!1}){return{raw:qr({format:"bytes"},e,t),tx:cf(Object.assign(Object.assign({},V3.fromSerializedData(oo(e)).toJSON()),{hash:Wi(iN(oo(e))),type:HEt(oo(e))}),t,{fillInputAndData:n.fillInputAndData,transactionSchema:n.transactionSchema})}}var Noe=function(e,t,n,r){function s(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?a(d.value):s(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})};function Aoe(e,t){return Noe(this,void 0,void 0,function*(){const n=yield kEt(e.requestManager);return qr({format:"uint"},n,t)})}function e_t(e,t){return Noe(this,void 0,void 0,function*(){const n=yield TEt(e.requestManager);return qr({format:"uint"},n,t)})}const t_t=e=>Noe(void 0,void 0,void 0,function*(){return IEt(e.requestManager)});var CV=function(e,t,n,r){function s(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?a(d.value):s(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})};class ZFe extends Qd{getId(t=this.defaultReturnFormat){return CV(this,void 0,void 0,function*(){return Aoe(this,t)})}getPeerCount(t=this.defaultReturnFormat){return CV(this,void 0,void 0,function*(){return e_t(this,t)})}isListening(){return CV(this,void 0,void 0,function*(){return t_t(this)})}}const dN="ALLEVENTS",kee={name:dN,signature:"",type:"event",inputs:[]},p$={bytes:f1.HEX,number:Qh.NUMBER};var JFe=function(e,t,n,r){function s(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?a(d.value):s(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})};function n_t(e,t,n){return JFe(this,void 0,void 0,function*(){var r,s,a,o;const l=yield _Oe(t,t.defaultBlock,!1,pi);if(pr(l.baseFeePerGas))throw new ONt;let c;if(pr(e.gasPrice)&&BigInt(l.baseFeePerGas)===BigInt(0)&&(c=yield Ooe(t,n)),!pr(e.gasPrice)||!pr(c)){const u=qr({format:"uint"},(r=e.gasPrice)!==null&&r!==void 0?r:c,n);return{maxPriorityFeePerGas:u,maxFeePerGas:u}}return{maxPriorityFeePerGas:qr({format:"uint"},(s=e.maxPriorityFeePerGas)!==null&&s!==void 0?s:t.defaultMaxPriorityFeePerGas,n),maxFeePerGas:qr({format:"uint"},(a=e.maxFeePerGas)!==null&&a!==void 0?a:BigInt(l.baseFeePerGas)*BigInt(2)+BigInt((o=e.maxPriorityFeePerGas)!==null&&o!==void 0?o:t.defaultMaxPriorityFeePerGas),n)}})}function eOe(e,t,n){return JFe(this,void 0,void 0,function*(){const r=tOe(e,t);if(!pr(r)){if(r.startsWith("-"))throw new Hxe(r);if(Number(r)<0||Number(r)>127)throw new Hxe(r);if(pr(e.gasPrice)&&(r==="0x0"||r==="0x1"))return{gasPrice:yield Ooe(t,n),maxPriorityFeePerGas:void 0,maxFeePerGas:void 0};if(r==="0x2")return Object.assign({gasPrice:void 0},yield n_t(e,t,n))}})}var joe=function(e,t,n,r){function s(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?a(d.value):s(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})};const Tee=(e,t,n,r)=>{if(n!==void 0&&e in n&&n[e]!==void 0){if(typeof n[e]=="string"&&Kf(n[e]))return n[e];if(!Aa(n[e])&&XPe(n[e])){if(t.wallet){const s=t.wallet.get(qr({format:"uint"},n[e],p$));if(!pr(s))return s.address;throw new Vxe}throw new Vxe}else throw e==="from"?new mNt(n.from):new xNt(n.to)}if(e==="from"){if(!pr(r))return h$(r);if(!pr(t.defaultAccount))return t.defaultAccount}},r_t=(e,t,...n)=>joe(void 0,[e,t,...n],void 0,function*(r,s,a=r.defaultReturnFormat){if(pr(s))throw new FNt;return TOe(r,s,r.defaultBlock,a)}),tOe=(e,t)=>{const n=zEt(e,t);if(!pr(n))return n;if(!pr(t.defaultTransactionType))return qr({format:"uint"},t.defaultTransactionType,pi)};function s_t(e){return joe(this,void 0,void 0,function*(){var t,n;let r=qr(XFe,e.transaction,e.web3Context.defaultReturnFormat);if(pr(r.from)&&(r.from=Tee("from",e.web3Context,void 0,e.privateKey)),pr(r.nonce)&&(r.nonce=yield r_t(e.web3Context,r.from,pi)),pr(r.value)&&(r.value="0x0"),pr(r.data))pr(r.input)?r.input="0x":r.input.startsWith("0x")||(r.input=`0x${r.input}`);else{if(!pr(r.input)&&r.data!==r.input)throw new gPe({data:Wi(r.data),input:Wi(r.input)});r.data.startsWith("0x")||(r.data=`0x${r.data}`)}if(pr(r.common)){if(e.web3Context.defaultCommon){const s=e.web3Context.defaultCommon,a=s.customChain.chainId,o=s.customChain.networkId,l=s.customChain.name;r.common=Object.assign(Object.assign({},s),{customChain:{chainId:a,networkId:o,name:l}})}pr(r.chain)&&(r.chain=e.web3Context.defaultChain),pr(r.hardfork)&&(r.hardfork=e.web3Context.defaultHardfork)}if(pr(r.chainId)&&pr((t=r.common)===null||t===void 0?void 0:t.customChain.chainId)&&(r.chainId=yield POe(e.web3Context,pi)),pr(r.networkId)&&(r.networkId=(n=e.web3Context.defaultNetworkId)!==null&&n!==void 0?n:yield Aoe(e.web3Context,pi)),pr(r.gasLimit)&&!pr(r.gas)&&(r.gasLimit=r.gas),r.type=tOe(r,e.web3Context),pr(r.accessList)&&(r.type==="0x1"||r.type==="0x2")&&(r.accessList=[]),e.fillGasPrice&&(r=Object.assign(Object.assign({},r),yield eOe(r,e.web3Context,pi))),pr(r.gas)&&pr(r.gasLimit)&&e.fillGasLimit){const s=yield Loe(e.web3Context,r,"latest",pi);r=Object.assign(Object.assign({},r),{gas:qr({format:"uint"},s,pi)})}return r})}const i_t=e=>joe(void 0,void 0,void 0,function*(){var t;return((t=e.web3Context.transactionBuilder)!==null&&t!==void 0?t:s_t)(Object.assign(Object.assign({},e),{transaction:e.transaction}))});var Eoe=function(e,t,n,r){function s(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?a(d.value):s(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})};function Iee(e,t,n){const r=e.transactionPollingInterval,[s,a]=cFe(()=>Eoe(this,void 0,void 0,function*(){let l;try{l=yield Moe(e,p$)}catch(u){console.warn("An error happen while trying to get the block number",u);return}const c=l-t;if(c>=e.transactionBlockTimeout)return new vPe({starterBlockNumber:t,numberOfBlocks:c,transactionHash:n})}),r);return[a,{clean:()=>{clearInterval(s)}}]}function a_t(e,t,n){return Eoe(this,void 0,void 0,function*(){var r;let s=!0,a,o;function l(u,d){d&&console.warn("error happened at subscription. So revert to polling...",d),o.clean(),s=!1;const[f,x]=Iee(e,t,n);o.clean=x.clean,f.catch(g=>u(g))}try{a=yield(r=e.subscriptionManager)===null||r===void 0?void 0:r.subscribe("newHeads"),o={clean:()=>{var u;a.id&&((u=e.subscriptionManager)===null||u===void 0||u.removeSubscription(a).then(()=>{}).catch(()=>{}))}}}catch{return Iee(e,t,n)}return[new Promise((u,d)=>{try{a.on("data",f=>{if(s=!1,!(f!=null&&f.number))return;const x=Number(BigInt(f.number)-BigInt(t));x>=e.transactionBlockTimeout&&d(new vPe({starterBlockNumber:t,numberOfBlocks:x,transactionHash:n}))}),a.on("error",f=>{l(d,f)})}catch(f){l(d,f)}setTimeout(()=>{s&&l(d)},e.blockHeaderTimeout*1e3)}),o]})}function nOe(e,t){return Eoe(this,void 0,void 0,function*(){var n,r;const{provider:s}=e.requestManager;let a;const o=yield Moe(e,p$);return!((r=(n=s).supportsSubscriptions)===null||r===void 0)&&r.call(n)&&e.enableExperimentalFeatures.useSubscriptionWhenCheckingBlockTimeout?a=yield a_t(e,o,t):a=Iee(e,o,t),a})}var o_t=function(e,t,n,r){function s(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?a(d.value):s(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})};function Pee(e,t,n){return o_t(this,void 0,void 0,function*(){const[r,s]=soe(e.transactionSendTimeout,new MNt({numberOfSeconds:e.transactionSendTimeout/1e3,transactionHash:n})),[a,o]=yield nOe(e,n);try{return yield Promise.race([t(),s,a])}finally{clearTimeout(r),o.clean()}})}var Oge=function(e,t,n,r){function s(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?a(d.value):s(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})};function rOe(e,t,n,r){return Oge(this,void 0,void 0,function*(){var s;const a=(s=e.transactionReceiptPollingInterval)!==null&&s!==void 0?s:e.transactionPollingInterval,[o,l]=roe(()=>Oge(this,void 0,void 0,function*(){try{return(r??kOe)(e,t,n)}catch(x){console.warn("An error happen while trying to get the transaction receipt",x);return}}),a),[c,u]=soe(e.transactionPollingTimeout,new yPe({numberOfSeconds:e.transactionPollingTimeout/1e3,transactionHash:t})),[d,f]=yield nOe(e,t);try{return yield Promise.race([o,u,d])}finally{c&&clearTimeout(c),l&&clearInterval(l),f.clean()}})}var l_t=function(e,t,n,r){function s(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?a(d.value):s(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})};const pO=({web3Context:e,transactionReceipt:t,transactionPromiEvent:n,customTransactionReceiptSchema:r,returnFormat:s})=>{var a;let o=1;const l=setInterval(()=>{l_t(void 0,void 0,void 0,function*(){if(o>=e.transactionConfirmationBlocks){clearInterval(l);return}const c=yield YFe(e.requestManager,nc(BigInt(t.blockNumber)+BigInt(o)),!1);c!=null&&c.hash&&(o+=1,n.emit("confirmation",{confirmations:qr({format:"uint"},o,s),receipt:qr(r??BA,t,s),latestBlockHash:qr({format:"bytes32"},c.hash,s)}))})},(a=e.transactionReceiptPollingInterval)!==null&&a!==void 0?a:e.transactionPollingInterval)};var Mge=function(e,t,n,r){function s(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?a(d.value):s(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})};const c_t=({web3Context:e,transactionReceipt:t,transactionPromiEvent:n,customTransactionReceiptSchema:r,returnFormat:s})=>{let a=!0,o;setImmediate(()=>{var l;(l=e.subscriptionManager)===null||l===void 0||l.subscribe("newHeads").then(c=>{c.on("data",u=>Mge(void 0,void 0,void 0,function*(){var d;if(a=!1,!(u!=null&&u.number)||o===(u==null?void 0:u.parentHash))return;o=u==null?void 0:u.parentHash;const f=BigInt(u.number)-BigInt(t.blockNumber)+BigInt(1);n.emit("confirmation",{confirmations:qr({format:"uint"},f,s),receipt:qr(r??BA,t,s),latestBlockHash:qr({format:"bytes32"},u.parentHash,s)}),f>=e.transactionConfirmationBlocks&&(yield(d=e.subscriptionManager)===null||d===void 0?void 0:d.removeSubscription(c))})),c.on("error",()=>Mge(void 0,void 0,void 0,function*(){var u;yield(u=e.subscriptionManager)===null||u===void 0?void 0:u.removeSubscription(c),a=!1,pO({web3Context:e,transactionReceipt:t,transactionPromiEvent:n,customTransactionReceiptSchema:r,returnFormat:s})}))}).catch(()=>{a=!1,pO({web3Context:e,transactionReceipt:t,customTransactionReceiptSchema:r,transactionPromiEvent:n,returnFormat:s})})}),setTimeout(()=>{a&&pO({web3Context:e,transactionReceipt:t,transactionPromiEvent:n,returnFormat:s})},e.blockHeaderTimeout*1e3)};function u_t(e,t,n,r,s,a){if(pr(n)||pr(n.blockHash))throw new RNt({receipt:n,blockHash:qr({format:"bytes32"},n==null?void 0:n.blockHash,s),transactionHash:qr({format:"bytes32"},r,s)});if(!n.blockNumber)throw new LNt({receipt:n});t.emit("confirmation",{confirmations:qr({format:"uint"},1,s),receipt:qr(a??BA,n,s),latestBlockHash:qr({format:"bytes32"},n.blockHash,s)});const o=e.requestManager.provider;o&&"supportsSubscriptions"in o&&o.supportsSubscriptions()?c_t({web3Context:e,transactionReceipt:n,transactionPromiEvent:t,customTransactionReceiptSchema:a,returnFormat:s}):pO({web3Context:e,transactionReceipt:n,transactionPromiEvent:t,customTransactionReceiptSchema:a,returnFormat:s})}const m$=e=>!ni(e)&&typeof e=="object"&&!ni(e.type)&&e.type==="error",_oe=e=>!ni(e)&&typeof e=="object"&&!ni(e.type)&&e.type==="event",x$=e=>!ni(e)&&typeof e=="object"&&!ni(e.type)&&e.type==="function",d_t=e=>!ni(e)&&typeof e=="object"&&!ni(e.type)&&e.type==="constructor",f_t=e=>typeof e=="object"&&typeof e.components>"u"&&typeof e.name>"u",sOe=e=>e.includes("[]")?{type:"tuple[]",name:e.slice(0,-2)}:{type:"tuple",name:e},iOe=e=>{const t=[];for(const n of Object.keys(e)){const r=e[n];typeof r=="object"?t.push(Object.assign(Object.assign({},sOe(n)),{components:iOe(r)})):t.push({name:n,type:e[n]})}return t},Fee=(e,t)=>{const n=[];return t.forEach(r=>{if(typeof r.components=="object"){if(!r.type.startsWith("tuple"))throw new Ki(`Invalid value given "${r.type}". Error: components found but type is not tuple.`);const s=r.type.indexOf("["),a=s>=0?r.type.substring(s):"",o=Fee(e,r.components);n.push(`(${o.join(",")})${a}`)}else n.push(r.type)}),n},Gg=e=>{var t,n,r,s;return m$(e)||_oe(e)||x$(e)?!((t=e.name)===null||t===void 0)&&t.includes("(")?e.name:`${(n=e.name)!==null&&n!==void 0?n:""}(${Fee(!1,(r=e.inputs)!==null&&r!==void 0?r:[]).join(",")})`:`(${Fee(!1,(s=e.inputs)!==null&&s!==void 0?s:[]).join(",")})`},h_t=e=>{if(typeof e!="string"&&!m$(e))throw new Ki("Invalid parameter value in encodeErrorSignature");let t;return e&&(typeof e=="function"||typeof e=="object")?t=Gg(e):t=e,Yf(t)},koe=e=>{if(typeof e!="string"&&!_oe(e))throw new Ki("Invalid parameter value in encodeEventSignature");let t;return e&&(typeof e=="function"||typeof e=="object")?t=Gg(e):t=e,Yf(t)};function Toe(e,t){const n=e.exec(t);return n==null?void 0:n.groups}var aOe=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,oOe=/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/,lOe=/^\(.+?\).*?$/,p_t=Object.defineProperty,m_t=(e,t,n)=>t in e?p_t(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,k7=(e,t,n)=>(m_t(e,typeof t!="symbol"?t+"":t,n),n),x_t="abitype",g_t="0.7.1",Kd=class extends Error{constructor(e,t={}){var a;const n=t.cause instanceof Kd?t.cause.details:(a=t.cause)!=null&&a.message?t.cause.message:t.details,r=t.cause instanceof Kd&&t.cause.docsPath||t.docsPath,s=[e||"An error occurred.","",...t.metaMessages?[...t.metaMessages,""]:[],...r?[`Docs: https://abitype.dev${r}`]:[],...n?[`Details: ${n}`]:[],`Version: ${x_t}@${g_t}`].join(`
`);super(s),k7(this,"details"),k7(this,"docsPath"),k7(this,"metaMessages"),k7(this,"shortMessage"),k7(this,"name","AbiTypeError"),t.cause&&(this.cause=t.cause),this.details=n,this.docsPath=r,this.metaMessages=t.metaMessages,this.shortMessage=e}},cOe=/^struct (?<name>[a-zA-Z0-9_]+) \{(?<properties>.*?)\}$/;function uOe(e){return cOe.test(e)}function b_t(e){return Toe(cOe,e)}var Rge=new Set(["memory","indexed","storage","calldata"]),y_t=new Set(["calldata","memory","storage"]);function v_t(e,t){return t?`${t}:${e}`:e}var SV=new Map([["address",{type:"address"}],["bool",{type:"bool"}],["bytes",{type:"bytes"}],["bytes32",{type:"bytes32"}],["int",{type:"int256"}],["int256",{type:"int256"}],["string",{type:"string"}],["uint",{type:"uint256"}],["uint8",{type:"uint8"}],["uint16",{type:"uint16"}],["uint24",{type:"uint24"}],["uint32",{type:"uint32"}],["uint64",{type:"uint64"}],["uint96",{type:"uint96"}],["uint112",{type:"uint112"}],["uint160",{type:"uint160"}],["uint192",{type:"uint192"}],["uint256",{type:"uint256"}],["address owner",{type:"address",name:"owner"}],["address to",{type:"address",name:"to"}],["bool approved",{type:"bool",name:"approved"}],["bytes _data",{type:"bytes",name:"_data"}],["bytes data",{type:"bytes",name:"data"}],["bytes signature",{type:"bytes",name:"signature"}],["bytes32 hash",{type:"bytes32",name:"hash"}],["bytes32 r",{type:"bytes32",name:"r"}],["bytes32 root",{type:"bytes32",name:"root"}],["bytes32 s",{type:"bytes32",name:"s"}],["string name",{type:"string",name:"name"}],["string symbol",{type:"string",name:"symbol"}],["string tokenURI",{type:"string",name:"tokenURI"}],["uint tokenId",{type:"uint256",name:"tokenId"}],["uint8 v",{type:"uint8",name:"v"}],["uint256 balance",{type:"uint256",name:"balance"}],["uint256 tokenId",{type:"uint256",name:"tokenId"}],["uint256 value",{type:"uint256",name:"value"}],["event:address indexed from",{type:"address",name:"from",indexed:!0}],["event:address indexed to",{type:"address",name:"to",indexed:!0}],["event:uint indexed tokenId",{type:"uint256",name:"tokenId",indexed:!0}],["event:uint256 indexed tokenId",{type:"uint256",name:"tokenId",indexed:!0}]]),w_t=/^(?<type>[a-zA-Z0-9_]+?)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z0-9_]+))?$/,C_t=/^\((?<type>.+?)\)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z0-9_]+))?$/,S_t=/^u?int$/;function gR(e,t){var f,x;const n=v_t(e,t==null?void 0:t.type);if(SV.has(n))return SV.get(n);const r=lOe.test(e),s=Toe(r?C_t:w_t,e);if(!s)throw new Kd("Invalid ABI parameter.",{details:e});if(s.name&&A_t(s.name))throw new Kd("Invalid ABI parameter.",{details:e,metaMessages:[`"${s.name}" is a protected Solidity keyword. More info: https://docs.soliditylang.org/en/latest/cheatsheet.html`]});const a=s.name?{name:s.name}:{},o=s.modifier==="indexed"?{indexed:!0}:{},l=(t==null?void 0:t.structs)??{};let c,u={};if(r){c="tuple";const g=NC(s.type),v=[],w=g.length;for(let C=0;C<w;C++)v.push(gR(g[C],{structs:l}));u={components:v}}else if(s.type in l)c="tuple",u={components:l[s.type]};else if(S_t.test(s.type))c=`${s.type}256`;else if(c=s.type,(t==null?void 0:t.type)!=="struct"&&!dOe(c))throw new Kd("Unknown type.",{metaMessages:[`Type "${c}" is not a valid ABI type.`]});if(s.modifier){if(!((x=(f=t==null?void 0:t.modifiers)==null?void 0:f.has)!=null&&x.call(f,s.modifier)))throw new Kd("Invalid ABI parameter.",{details:e,metaMessages:[`Modifier "${s.modifier}" not allowed${t!=null&&t.type?` in "${t.type}" type`:""}.`]});if(y_t.has(s.modifier)&&!j_t(c,!!s.array))throw new Kd("Invalid ABI parameter.",{details:e,metaMessages:[`Modifier "${s.modifier}" not allowed${t!=null&&t.type?` in "${t.type}" type`:""}.`,`Data location can only be specified for array, struct, or mapping types, but "${s.modifier}" was given.`]})}const d={type:`${c}${s.array??""}`,...a,...o,...u};return SV.set(n,d),d}function NC(e,t=[],n="",r=0){if(e===""){if(n==="")return t;if(r!==0)throw new Kd("Unbalanced parentheses.",{metaMessages:[`"${n.trim()}" has too many ${r>0?"opening":"closing"} parentheses.`],details:`Depth "${r}"`});return[...t,n.trim()]}const s=e.length;for(let a=0;a<s;a++){const o=e[a],l=e.slice(a+1);switch(o){case",":return r===0?NC(l,[...t,n.trim()]):NC(l,t,`${n}${o}`,r);case"(":return NC(l,t,`${n}${o}`,r+1);case")":return NC(l,t,`${n}${o}`,r-1);default:return NC(l,t,`${n}${o}`,r)}}return[]}function dOe(e){return e==="address"||e==="bool"||e==="function"||e==="string"||aOe.test(e)||oOe.test(e)}var N_t=/^(?:after|alias|anonymous|apply|auto|byte|calldata|case|catch|constant|copyof|default|defined|error|event|external|false|final|function|immutable|implements|in|indexed|inline|internal|let|mapping|match|memory|mutable|null|of|override|partial|private|promise|public|pure|reference|relocatable|return|returns|sizeof|static|storage|struct|super|supports|switch|this|true|try|typedef|typeof|var|view|virtual)$/;function A_t(e){return e==="address"||e==="bool"||e==="function"||e==="string"||e==="tuple"||aOe.test(e)||oOe.test(e)||N_t.test(e)}function j_t(e,t){return t||e==="bytes"||e==="string"||e==="tuple"}function E_t(e){const t={},n=e.length;for(let o=0;o<n;o++){const l=e[o];if(!uOe(l))continue;const c=b_t(l);if(!c)throw new Kd("Invalid struct signature.",{details:l});const u=c.properties.split(";"),d=[],f=u.length;for(let x=0;x<f;x++){const v=u[x].trim();if(!v)continue;const w=gR(v,{type:"struct"});d.push(w)}if(!d.length)throw new Kd("Invalid struct signature.",{details:l,metaMessages:["No properties exist."]});t[c.name]=d}const r={},s=Object.entries(t),a=s.length;for(let o=0;o<a;o++){const[l,c]=s[o];r[l]=fOe(c,t)}return r}var __t=/^(?<type>[a-zA-Z0-9_]+?)(?<array>(?:\[\d*?\])+?)?$/;function fOe(e,t,n=new Set){const r=[],s=e.length;for(let a=0;a<s;a++){const o=e[a];if(lOe.test(o.type))r.push(o);else{const c=Toe(__t,o.type);if(!(c!=null&&c.type))throw new Kd("Invalid ABI parameter.",{details:JSON.stringify(o,null,2),metaMessages:["ABI parameter type is invalid."]});const{array:u,type:d}=c;if(d in t){if(n.has(d))throw new Kd("Circular reference detected.",{metaMessages:[`Struct "${d}" is a circular reference.`]});r.push({...o,type:`tuple${u??""}`,components:fOe(t[d]??[],t,new Set([...n,d]))})}else if(dOe(d))r.push(o);else throw new Kd("Unknown type.",{metaMessages:[`Type "${d}" is not a valid ABI type. Perhaps you forgot to include a struct signature?`]})}}return r}function k_t(e){let t;if(typeof e=="string")t=gR(e,{modifiers:Rge});else{const n=E_t(e),r=e.length;for(let s=0;s<r;s++){const a=e[s];if(!uOe(a)){t=gR(a,{modifiers:Rge,structs:n});break}}}if(!t)throw new Kd("Failed to parse ABI parameter.",{details:`parseAbiParameter(${JSON.stringify(e,null,2)})`,docsPath:"/api/human.html#parseabiparameter-1"});return t}const nl=32;function Oee(e=0){var t;if(((t=globalThis.Buffer)===null||t===void 0?void 0:t.alloc)!==void 0){const n=globalThis.Buffer.alloc(e);return new Uint8Array(n.buffer,n.byteOffset,n.byteLength)}return new Uint8Array(e)}function hOe(e){var t,n;return Object.assign(Object.assign({},e),{name:(t=e.name)!==null&&t!==void 0?t:"",components:(n=e.components)===null||n===void 0?void 0:n.map(r=>hOe(r))})}function T_t(e){return!ni(e)&&typeof e=="object"&&!ni(e.type)&&typeof e.type=="string"}function pOe(e){return e.map(t=>{var n;if(T_t(t))return t;if(typeof t=="string")return hOe(k_t(t.replace(/tuple/,"")));if(f_t(t)){const r=Object.keys(t)[0],s=sOe(r);return s.name=(n=s.name)!==null&&n!==void 0?n:"",Object.assign(Object.assign({},s),{components:iOe(t[r])})}throw new Ki("Invalid abi")})}function Ioe(e){const t=e.type.lastIndexOf("["),n=e.type.substring(0,t),r=e.type.substring(t);let s=-1;if(r!=="[]"&&(s=Number(r.slice(1,-1)),isNaN(s)))throw new Ki("Invalid fixed array size",{size:r});return{param:{type:n,name:"",components:e.components},size:s}}function bR(e){var t,n;return e.type==="string"||e.type==="bytes"||e.type.endsWith("[]")?!0:e.type==="tuple"?(n=(t=e.components)===null||t===void 0?void 0:t.some(bR))!==null&&n!==void 0?n:!1:e.type.endsWith("]")?bR(Ioe(e).param):!1}const mOe=20,xOe=nl-mOe;function I_t(e,t){if(typeof t!="string")throw new Ki("address type expects string as input type",{value:t,name:e.name,type:e.type});let n=t.toLowerCase();if(n.startsWith("0x")||(n=`0x${n}`),!Kf(n))throw new Ki("provided input is not valid address",{value:t,name:e.name,type:e.type});const r=p5(n),s=Oee(nl);return s.set(r,xOe),{dynamic:!1,encoded:s}}function P_t(e,t){const n=t.subarray(xOe,nl);if(n.length!==mOe)throw new Ki("Invalid decoding input, not enough bytes to decode address",{bytes:t});const r=A1(n);return{result:fx(r),encoded:t.subarray(nl),consumed:nl}}const Ky=new Map;let fP=BigInt(256);for(let e=8;e<=256;e+=8)Ky.set(`uint${e}`,{min:BigInt(0),max:fP-BigInt(1)}),Ky.set(`int${e}`,{min:-fP/BigInt(2),max:fP/BigInt(2)-BigInt(1)}),fP*=BigInt(256);Ky.set("int",Ky.get("int256"));Ky.set("uint",Ky.get("uint256"));const gOe=BigInt(1)<<BigInt(256);function F_t(e,t=nl){let n;return e<0?n=(gOe+e).toString(16):n=e.toString(16),n=sN(n,t*2),p5(n)}function O_t(e,t){const n=A1(e),r=BigInt(n);return r<=t?r:r-gOe}function sT(e,t){let n;try{n=Xv(t)}catch{throw new Ki("provided input is not number value",{type:e.type,value:t,name:e.name})}const r=Ky.get(e.type);if(!r)throw new Ki("provided abi contains invalid number datatype",{type:e.type});if(n<r.min)throw new Ki("provided input is less then minimum for given type",{type:e.type,value:t,name:e.name,minimum:r.min.toString()});if(n>r.max)throw new Ki("provided input is greater then maximum for given type",{type:e.type,value:t,name:e.name,maximum:r.max.toString()});return{dynamic:!1,encoded:F_t(n)}}function fN(e,t){if(t.length<nl)throw new Ki("Not enough bytes left to decode",{param:e,bytesLeft:t.length});const n=t.subarray(0,nl),r=Ky.get(e.type);if(!r)throw new Ki("provided abi contains invalid number datatype",{type:e.type});const s=O_t(n,r.max);if(s<r.min)throw new Ki("decoded value is less then minimum for given type",{type:e.type,value:s,name:e.name,minimum:r.min.toString()});if(s>r.max)throw new Ki("decoded value is greater then maximum for given type",{type:e.type,value:s,name:e.name,maximum:r.max.toString()});return{result:s,encoded:t.subarray(nl),consumed:nl}}function M_t(e,t){let n;try{n=tFe(t)}catch(r){if(r instanceof Hae)throw new Ki("provided input is not valid boolean value",{type:e.type,value:t,name:e.name})}return sT({type:"uint8",name:""},Number(n))}function R_t(e,t){const n=fN({type:"uint8",name:""},t);if(n.result>1||n.result<0)throw new Ki("Invalid boolean value encoded",{boolBytes:t.subarray(0,nl),numberResult:n});return{result:n.result===BigInt(1),encoded:n.encoded,consumed:nl}}const L_t=32;function bOe(e,t){if(typeof t=="string"&&t.length%2!==0&&(t+="0"),!c2(t))throw new Ki("provided input is not valid bytes value",{type:e.type,value:t,name:e.name});const n=rx(t),[,r]=e.type.split("bytes");if(r){if(Number(r)>L_t||Number(r)<1)throw new Ki("invalid bytes type. Static byte type can have between 1 and 32 bytes",{type:e.type});if(Number(r)<n.length)throw new Ki("provided input size is different than type size",{type:e.type,value:t,name:e.name});const o=Oee(nl);return o.set(n),{dynamic:!1,encoded:o}}const s=Math.ceil(n.length/nl),a=Oee(nl+s*nl);return a.set(sT({type:"uint32",name:""},n.length).encoded),a.set(n,nl),{dynamic:!0,encoded:a}}function yOe(e,t){const[,n]=e.type.split("bytes");let r=Number(n),s=t,a=1,o=0;if(!r){const l=fN({type:"uint32",name:""},s);r=Number(l.result),o+=l.consumed,s=l.encoded,a=Math.ceil(r/nl)}if(r>t.length)throw new Ki("there is not enough data to decode",{type:e.type,encoded:t,size:r});return{result:Wi(s.subarray(0,r)),encoded:s.subarray(a*nl),consumed:o+a*nl}}function D_t(e,t){if(typeof t!="string")throw new Ki("invalid input, should be string",{input:t});const n=eoe(t);return bOe({type:"bytes",name:""},n)}function B_t(e,t){const n=yOe({type:"bytes",name:""},t);return{result:s$(n.result),encoded:n.encoded,consumed:n.consumed}}function vOe(e){let t=0,n=0;const r=[],s=[];for(const a of e)a.dynamic?t+=nl:t+=a.encoded.length;for(const a of e)a.dynamic?(r.push(sT({type:"uint256",name:""},t+n)),s.push(a),n+=a.encoded.length):r.push(a);return gd(...r.map(a=>a.encoded),...s.map(a=>a.encoded))}function $_t(e,t){if(!Array.isArray(t))throw new Ki("Expected value to be array",{abi:e,values:t});const{size:n,param:r}=Ioe(e),s=t.map(l=>Mee(r,l)),a=n===-1,o=s.length>0&&s[0].dynamic;if(!a&&t.length!==n)throw new Ki("Given arguments count doesn't match array length",{arrayLength:n,argumentsLength:t.length});if(a||o){const l=vOe(s);if(a){const c=sT({type:"uint256",name:""},s.length).encoded;return{dynamic:!0,encoded:s.length>0?gd(c,l):c}}return{dynamic:!0,encoded:l}}return{dynamic:!1,encoded:gd(...s.map(l=>l.encoded))}}function U_t(e,t){let{size:n,param:r}=Ioe(e);const s=n===-1;let a=0;const o=[];let l=t;if(s){const u=fN({type:"uint32",name:""},t);n=Number(u.result),a=u.consumed,l=u.encoded}if(bR(r)){for(let u=0;u<n;u+=1){const d=fN({type:"uint32",name:""},l.subarray(u*nl));a+=d.consumed;const f=yR(r,l.subarray(Number(d.result)));a+=f.consumed,o.push(f.result)}return{result:o,encoded:l.subarray(a),consumed:a}}for(let u=0;u<n;u+=1){const d=yR(r,t.subarray(a));a+=d.consumed,o.push(d.result)}return{result:o,encoded:t.subarray(a),consumed:a}}function Mee(e,t){if(e.type==="string")return D_t(e,t);if(e.type==="bool")return M_t(e,t);if(e.type==="address")return I_t(e,t);if(e.type==="tuple")return Poe(e,t);if(e.type.endsWith("]"))return $_t(e,t);if(e.type.startsWith("bytes"))return bOe(e,t);if(e.type.startsWith("uint")||e.type.startsWith("int"))return sT(e,t);throw new Ki("Unsupported",{param:e,value:t})}function yR(e,t){if(e.type==="string")return B_t(e,t);if(e.type==="bool")return R_t(e,t);if(e.type==="address")return P_t(e,t);if(e.type==="tuple")return wOe(e,t);if(e.type.endsWith("]"))return U_t(e,t);if(e.type.startsWith("bytes"))return yOe(e,t);if(e.type.startsWith("uint")||e.type.startsWith("int"))return fN(e,t);throw new Ki("Unsupported",{param:e,bytes:t})}function Poe(e,t){var n,r,s;let a=!1;if(!Array.isArray(t)&&typeof t!="object")throw new Ki("param must be either Array or Object",{param:e,input:t});const o=t,l=[];for(let c=0;c<((r=(n=e.components)===null||n===void 0?void 0:n.length)!==null&&r!==void 0?r:0);c+=1){const u=e.components[c];let d;if(Array.isArray(o)){if(c>=o.length)throw new Ki("input param length missmatch",{param:e,input:t});d=Mee(u,o[c])}else{const f=o[(s=u.name)!==null&&s!==void 0?s:""];if(f==null)throw new Ki("missing input defined in abi",{param:e,input:t,paramName:u.name});d=Mee(u,f)}d.dynamic&&(a=!0),l.push(d)}return a?{dynamic:!0,encoded:vOe(l)}:{dynamic:!1,encoded:gd(...l.map(c=>c.encoded))}}function wOe(e,t){const n={__length__:0};let r=0;if(!e.components)return{result:n,encoded:t,consumed:r};let s=0;for(const[a,o]of e.components.entries()){let l;if(bR(o)){const c=fN({type:"uint32",name:""},t.subarray(r));l=yR(o,t.subarray(Number(c.result))),r+=c.consumed,s+=l.consumed}else l=yR(o,t.subarray(r)),r+=l.consumed;n.__length__+=1,n[a]=l.result,o.name&&o.name!==""&&(n[o.name]=l.result)}return{encoded:t.subarray(r+s),result:n,consumed:r+s}}function z_t(e,t,n){const r=pOe(e),s=p5(t);return wOe({type:"tuple",name:"",components:r},s).result}function COe(e){const t=[];return e.forEach(n=>{if(Array.isArray(n)){const r=COe(n);t.push({type:"tuple",components:r,name:""})}else t.push({type:m1(n,!0)})}),t}function g$(e,t){if((e==null?void 0:e.length)!==t.length)throw new Ki("Invalid number of values received for given ABI",{expected:e==null?void 0:e.length,received:t.length});const n=pOe(e);return A1(Poe({type:"tuple",name:"",components:n},t).encoded)}function H_t(e){try{const t=COe(e);return A1(Poe({type:"tuple",name:"",components:t},e).encoded)}catch{throw new Ki("Could not infer types from given params",{params:e})}}const Ree=(e,t)=>g$([e],[t]),SOe=(e,t,n)=>{try{if(e.length>0&&(!t||t==="0x"||t==="0X"))throw new Ki("Returned values aren't valid, did it run Out of Gas? You might also see this error if you are not using the correct ABI for the contract you are retrieving data from, requesting data from a block number that does not exist, or querying a node which is not fully synced.");return z_t(e,`0x${t.replace(/0x/i,"")}`,n)}catch(r){throw new Ki(`Parameter decoding error: ${r.message}`,{internalErr:r})}},n3=(e,t)=>SOe(e,t,!1),NOe=(e,t)=>n3([e],t)[0],zE=e=>{if(typeof e!="string"&&!x$(e))throw new Ki("Invalid parameter value in encodeFunctionSignature");let t;return e&&(typeof e=="function"||typeof e=="object")?t=Gg(e):t=e,Yf(t).slice(0,10)},V_t=(e,t)=>{var n;if(!x$(e))throw new Ki("Invalid parameter value in encodeFunctionCall");return`${zE(e)}${g$((n=e.inputs)!==null&&n!==void 0?n:[],t??[]).replace("0x","")}`},Lee=(e,t,n=!0)=>{const r=n&&t&&t.length>=10&&t.startsWith("0x")?t.slice(10):t;if(!e.inputs)throw new fd("No inputs found in the ABI");const s=n3([...e.inputs],r);return Object.assign(Object.assign({},s),{__method__:Gg(e)})},W_t=(e,t)=>{if(e.type==="constructor")return t;if(!t)return null;const n=t.length>=2?t.slice(2):t;if(!e.outputs)return null;const r=n3([...e.outputs],n);return r.__length__===1?r[0]:r},q_t=["bool","string","int","uint","address","fixed","ufixed"],G_t=(e,t)=>e==="string"?t:NOe(e,t),AOe=(e,t,n)=>{const r=Array.isArray(n)?n:[n],s={},a={};for(const[x,g]of e.entries())g.indexed?s[x]=g:a[x]=g;const o=t?SOe(Object.values(a),t,!0):{__length__:0},l=r.length-Object.keys(s).length,c=Object.values(s).map((x,g)=>q_t.some(v=>x.type.startsWith(v))?G_t(x.type,r[g+l]):r[g+l]),u={__length__:0};let d=0,f=0;for(const[x,g]of e.entries())u[x]=g.type==="string"?"":void 0,s[x]&&(u[x]=c[d],d+=1),a[x]&&(u[x]=o[String(f)],f+=1),g.name&&(u[g.name]=u[x]),u.__length__+=1;return u},mO=(e,t)=>{if(t!=null&&t.data){let n,r,s;try{const a=t.data.slice(0,10),o=e.find(l=>h_t(l).startsWith(a));o!=null&&o.inputs?(n=o.name,r=Gg(o),s=n3([...o.inputs],t.data.substring(10))):t.data.startsWith("0x08c379a0")?(n="Error",r="Error(string)",s=n3([{name:"message",type:"string"}],t.data.substring(10))):t.data.startsWith("0x4e487b71")?(n="Panic",r="Panic(uint256)",s=n3([{name:"code",type:"uint256"}],t.data.substring(10))):console.error("No matching error abi found for error data",t.data)}catch(a){console.error(a)}n&&t.setDecodedProperties(n,r,s)}};var K_t=function(e,t,n,r){function s(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?a(d.value):s(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})};const Y_t=(e,t)=>{var n,r,s,a,o;if(e instanceof Zw&&e.cause instanceof YB){if(t!==void 0){const l=t.filter(c=>m$(c));return mO(l,e.cause),{reason:e.cause.message,signature:(n=e.cause.data)===null||n===void 0?void 0:n.slice(0,10),data:(r=e.cause.data)===null||r===void 0?void 0:r.substring(10),customErrorName:e.cause.errorName,customErrorDecodedSignature:e.cause.errorSignature,customErrorArguments:e.cause.errorArgs}}return{reason:e.cause.message,signature:(s=e.cause.data)===null||s===void 0?void 0:s.slice(0,10),data:(a=e.cause.data)===null||a===void 0?void 0:a.substring(10)}}if(e instanceof XB&&!Array.isArray((o=e.cause)===null||o===void 0?void 0:o.errors)&&e.cause!==void 0)return e.cause.message;throw e};function jOe(e,t,n){return K_t(this,arguments,void 0,function*(r,s,a,o=r.defaultReturnFormat){try{yield Roe(r,s,r.defaultBlock,o);return}catch(l){return Y_t(l,a)}})}var X_t=function(e,t,n,r){function s(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?a(d.value):s(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})};function NV(e,t,n,r,s,a){return X_t(this,void 0,void 0,function*(){let o=a;o===void 0&&e.handleRevert&&t!==void 0&&(o=yield jOe(e,t,s));let l;if(o===void 0)l=new mPe(n);else if(typeof o=="string")l=new KM(o,void 0,n);else if(o.customErrorName!==void 0&&o.customErrorDecodedSignature!==void 0&&o.customErrorArguments!==void 0){const c=o;l=new pPe(c.reason,c.customErrorName,c.customErrorDecodedSignature,c.customErrorArguments,c.signature,n,c.data)}else l=new KM(o.reason,o.signature,n,o.data);return l})}const Foe=(e,t,n,r=dd)=>{var s,a,o,l,c,u;let d=Object.assign({},e);const f=qr(DA,t,r);if([dN,"allEvents"].includes(d.name)){const g=n.find(v=>v.signature===t.topics[0]);g?d=g:d={anonymous:!0}}if(d.inputs=(a=(s=d.inputs)!==null&&s!==void 0?s:e.inputs)!==null&&a!==void 0?a:[],!d.anonymous){let g=0;((o=d.inputs)!==null&&o!==void 0?o:[]).forEach(v=>{v.indexed&&(g+=1)}),g>0&&(t!=null&&t.topics)&&(t==null?void 0:t.topics.length)!==g+1&&(d=Object.assign(Object.assign({},d),{anonymous:!0,inputs:[]}))}const x=d.anonymous?t.topics:((l=t.topics)!==null&&l!==void 0?l:[]).slice(1);return Object.assign(Object.assign({},f),{returnValues:AOe([...(c=d.inputs)!==null&&c!==void 0?c:[]],t.data,x),event:d.name,signature:!d.anonymous&&((u=t.topics)===null||u===void 0?void 0:u.length)>0&&t.topics[0]?t.topics[0]:void 0,raw:{data:t.data,topics:t.topics}})};var lv=function(e,t,n,r){function s(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?a(d.value):s(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})};class EOe{constructor({options:t,web3Context:n,promiEvent:r,returnFormat:s}){this.options={checkRevertBeforeSending:!0},this.options=t,this.web3Context=n,this.promiEvent=r,this.returnFormat=s}getReceiptWithEvents(t){var n,r;const s=Object.assign({},t??{});if(!((n=this.options)===null||n===void 0)&&n.contractAbi&&s.logs&&s.logs.length>0){s.events={};for(const a of s.logs){const o=Foe(kee,a,(r=this.options)===null||r===void 0?void 0:r.contractAbi,this.returnFormat);o.event&&(s.events[o.event]=o)}}return s}checkRevertBeforeSending(t){return lv(this,void 0,void 0,function*(){if(this.options.checkRevertBeforeSending!==!1){let n=t;pr(t.data)&&pr(t.input)&&pr(t.gas)&&(n=Object.assign(Object.assign({},t),{gas:21e3}));const r=yield jOe(this.web3Context,n,this.options.contractAbi);if(r!==void 0)throw yield NV(this.web3Context,t,void 0,void 0,this.options.contractAbi,r)}})}emitSending(t){this.promiEvent.listenerCount("sending")>0&&this.promiEvent.emit("sending",t)}populateGasPrice(t){return lv(this,arguments,void 0,function*({transactionFormatted:n,transaction:r}){var s;let a=n;return!this.web3Context.config.ignoreGasPricing&&!(!((s=this.options)===null||s===void 0)&&s.ignoreGasPricing)&&pr(n.gasPrice)&&(pr(r.maxPriorityFeePerGas)||pr(r.maxFeePerGas))&&(a=Object.assign(Object.assign({},n),yield eOe(n,this.web3Context,pi))),a})}signAndSend(t){return lv(this,arguments,void 0,function*({wallet:n,tx:r}){if(n){const s=yield n.signTransaction(r);return Pee(this.web3Context,()=>lv(this,void 0,void 0,function*(){return KFe(this.web3Context.requestManager,s.rawTransaction)}),s.transactionHash)}return Pee(this.web3Context,()=>lv(this,void 0,void 0,function*(){return nEt(this.web3Context.requestManager,r)}))})}emitSent(t){this.promiEvent.listenerCount("sent")>0&&this.promiEvent.emit("sent",t)}emitTransactionHash(t){this.promiEvent.listenerCount("transactionHash")>0&&this.promiEvent.emit("transactionHash",t)}emitReceipt(t){this.promiEvent.listenerCount("receipt")>0&&this.promiEvent.emit("receipt",t)}handleError(t){return lv(this,arguments,void 0,function*({error:n,tx:r}){var s;let a=n;return a instanceof Zw&&this.web3Context.handleRevert&&(a=yield NV(this.web3Context,r,void 0,void 0,(s=this.options)===null||s===void 0?void 0:s.contractAbi)),(a instanceof XB||a instanceof Zw||a instanceof pPe||a instanceof mPe||a instanceof KM||a instanceof yPe)&&this.promiEvent.listenerCount("error")>0&&this.promiEvent.emit("error",a),a})}emitConfirmation({receipt:t,transactionHash:n,customTransactionReceiptSchema:r}){this.promiEvent.listenerCount("confirmation")>0&&u_t(this.web3Context,this.promiEvent,t,n,this.returnFormat,r)}handleResolve(t){return lv(this,arguments,void 0,function*({receipt:n,tx:r}){var s,a,o;if(!((s=this.options)===null||s===void 0)&&s.transactionResolver)return(a=this.options)===null||a===void 0?void 0:a.transactionResolver(n);if(n.status===BigInt(0)){const l=yield NV(this.web3Context,r,n,void 0,(o=this.options)===null||o===void 0?void 0:o.contractAbi);throw this.promiEvent.listenerCount("error")>0&&this.promiEvent.emit("error",l),l}else return n})}}var La=function(e,t,n,r){function s(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?a(d.value):s(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})},Q_t=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,r=Object.getOwnPropertySymbols(e);s<r.length;s++)t.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(e,r[s])&&(n[r[s]]=e[r[s]]);return n};const Z_t=e=>La(void 0,void 0,void 0,function*(){return GFe(e.requestManager)});function J_t(e,t){return La(this,void 0,void 0,function*(){const n=yield U9t(e.requestManager);return qr({format:"uint"},n,t??e.defaultReturnFormat)})}function Ooe(e,t){return La(this,void 0,void 0,function*(){const n=yield z9t(e.requestManager);return qr({format:"uint"},n,t??e.defaultReturnFormat)})}function ekt(e,t){return La(this,void 0,void 0,function*(){const n=yield H9t(e.requestManager);return qr({format:"uint"},n,t??e.defaultReturnFormat)})}function Moe(e,t){return La(this,void 0,void 0,function*(){const n=yield W9t(e.requestManager);return qr({format:"uint"},n,t??e.defaultReturnFormat)})}function tkt(e,t){return La(this,arguments,void 0,function*(n,r,s=n.defaultBlock,a){const o=Mc(s)?s:qr({format:"uint"},s,pi),l=yield q9t(n.requestManager,r,o);return qr({format:"uint"},l,a??n.defaultReturnFormat)})}function nkt(e,t,n){return La(this,arguments,void 0,function*(r,s,a,o=r.defaultBlock,l){const c=qr({format:"uint"},a,pi),u=Mc(o)?o:qr({format:"uint"},o,pi),d=yield G9t(r.requestManager,s,c,u);return qr({format:"bytes"},d,l??r.defaultReturnFormat)})}function rkt(e,t){return La(this,arguments,void 0,function*(n,r,s=n.defaultBlock,a){const o=Mc(s)?s:qr({format:"uint"},s,pi),l=yield J9t(n.requestManager,r,o);return qr({format:"bytes"},l,a??n.defaultReturnFormat)})}function _Oe(e){return La(this,arguments,void 0,function*(t,n=t.defaultBlock,r=!1,s){var a;let o;if(c2(n)){const c=qr({format:"bytes32"},n,pi);o=yield iEt(t.requestManager,c,r)}else{const c=Mc(n)?n:qr({format:"uint"},n,pi);o=yield YFe(t.requestManager,c,r)}const l=qr(xR,o,s??t.defaultReturnFormat);return pr(l)?l:Object.assign(Object.assign({},l),{transactions:(a=l.transactions)!==null&&a!==void 0?a:[]})})}function skt(e){return La(this,arguments,void 0,function*(t,n=t.defaultBlock,r){let s;if(c2(n)){const a=qr({format:"bytes32"},n,pi);s=yield Y9t(t.requestManager,a)}else{const a=Mc(n)?n:qr({format:"uint"},n,pi);s=yield X9t(t.requestManager,a)}return qr({format:"uint"},s,r??t.defaultReturnFormat)})}function ikt(e){return La(this,arguments,void 0,function*(t,n=t.defaultBlock,r){let s;if(c2(n)){const a=qr({format:"bytes32"},n,pi);s=yield Q9t(t.requestManager,a)}else{const a=Mc(n)?n:qr({format:"uint"},n,pi);s=yield Z9t(t.requestManager,a)}return qr({format:"uint"},s,r??t.defaultReturnFormat)})}function akt(e){return La(this,arguments,void 0,function*(t,n=t.defaultBlock,r,s){const a=qr({format:"uint"},r,pi);let o;if(c2(n)){const l=qr({format:"bytes32"},n,pi);o=yield uEt(t.requestManager,l,a)}else{const l=Mc(n)?n:qr({format:"uint"},n,pi);o=yield dEt(t.requestManager,l,a)}return qr(xR,o,s??t.defaultReturnFormat)})}function okt(e,t){return La(this,arguments,void 0,function*(n,r,s=n.defaultReturnFormat){const a=qr({format:"bytes32"},r,dd),o=yield aEt(n.requestManager,a);return pr(o)?o:cf(o,s,{transactionSchema:n.config.customTransactionSchema,fillInputAndData:!0})})}function lkt(e,t){return La(this,void 0,void 0,function*(){return(yield CEt(e.requestManager)).map(r=>cf(r,t??e.defaultReturnFormat,{transactionSchema:e.config.customTransactionSchema,fillInputAndData:!0}))})}function ckt(e){return La(this,arguments,void 0,function*(t,n=t.defaultBlock,r,s){const a=qr({format:"uint"},r,pi);let o;if(c2(n)){const l=qr({format:"bytes32"},n,pi);o=yield oEt(t.requestManager,l,a)}else{const l=Mc(n)?n:qr({format:"uint"},n,pi);o=yield lEt(t.requestManager,l,a)}return pr(o)?o:cf(o,s??t.defaultReturnFormat,{transactionSchema:t.config.customTransactionSchema,fillInputAndData:!0})})}function kOe(e,t,n){return La(this,void 0,void 0,function*(){const r=qr({format:"bytes32"},t,dd);let s;try{s=yield cEt(e.requestManager,r)}catch(a){if(typeof a=="object"&&!pr(a)&&"message"in a&&a.message==="transaction indexing is in progress")console.warn("Transaction indexing is in progress.");else throw a}return pr(s)?s:qr(BA,s,n??e.defaultReturnFormat)})}function TOe(e,t){return La(this,arguments,void 0,function*(n,r,s=n.defaultBlock,a){const o=Mc(s)?s:qr({format:"uint"},s,pi),l=yield K9t(n.requestManager,r,o);return qr({format:"uint"},l,a??n.defaultReturnFormat)})}function HE(e,t,n,r={checkRevertBeforeSending:!0},s){const a=new qFe((o,l)=>{setImmediate(()=>{La(this,void 0,void 0,function*(){const c=new EOe({web3Context:e,promiEvent:a,options:r,returnFormat:n});let u=Object.assign({},t);pr(s)||(u=yield s.processTransaction(u));let d=cf(Object.assign(Object.assign({},u),{from:Tee("from",e,u),to:Tee("to",e,u)}),pi,{transactionSchema:e.config.customTransactionSchema});try{d=yield c.populateGasPrice({transaction:u,transactionFormatted:d}),yield c.checkRevertBeforeSending(d),c.emitSending(d);let f;e.wallet&&!pr(d.from)&&(f=e.wallet.get(d.from));const x=yield c.signAndSend({wallet:f,tx:d}),g=qr({format:"bytes32"},x,n??e.defaultReturnFormat);c.emitSent(d),c.emitTransactionHash(g);const v=yield rOe(e,x,n??e.defaultReturnFormat),w=c.getReceiptWithEvents(qr(BA,v,n??e.defaultReturnFormat));c.emitReceipt(w),o(yield c.handleResolve({receipt:w,tx:d})),c.emitConfirmation({receipt:w,transactionHash:x})}catch(f){l(yield c.handleError({error:f,tx:d}))}})})});return a}function ukt(e,t,n,r={checkRevertBeforeSending:!0}){const s=new qFe((a,o)=>{setImmediate(()=>{La(this,void 0,void 0,function*(){const l=new EOe({web3Context:e,promiEvent:s,options:r,returnFormat:n}),c=qr({format:"bytes"},t,pi),u=V3.fromSerializedData(rx(oo(c))),d=Object.assign(Object.assign({},u.toJSON()),{from:u.getSenderAddress().toString()});try{const{v:f,r:x,s:g}=d,v=Q_t(d,["v","r","s"]);yield l.checkRevertBeforeSending(v),l.emitSending(c);const w=yield Pee(e,()=>La(this,void 0,void 0,function*(){return KFe(e.requestManager,c)}));l.emitSent(c);const C=qr({format:"bytes32"},w,n??e.defaultReturnFormat);l.emitTransactionHash(C);const N=yield rOe(e,w,n??e.defaultReturnFormat),P=l.getReceiptWithEvents(qr(BA,N,n??e.defaultReturnFormat));l.emitReceipt(P),a(yield l.handleResolve({receipt:P,tx:d})),l.emitConfirmation({receipt:P,transactionHash:w})}catch(f){o(yield l.handleError({error:f,tx:d}))}})})});return s}function dkt(e,t,n){return La(this,arguments,void 0,function*(r,s,a,o=r.defaultReturnFormat){var l;const c=qr({format:"bytes"},s,dd);if(!((l=r.wallet)===null||l===void 0)&&l.get(a)){const f=r.wallet.get(a).sign(c);return qr(YEt,f,o)}if(typeof a=="number")throw new hNt(s,'RPC method "eth_sign" does not support index signatures');const u=yield eEt(r.requestManager,a,c);return qr({format:"bytes"},u,o)})}function fkt(e,t){return La(this,arguments,void 0,function*(n,r,s=n.defaultReturnFormat){const a=yield tEt(n.requestManager,cf(r,pi,{transactionSchema:n.config.customTransactionSchema}));return Yae(a)?JEt(a,s,{fillInputAndData:!0}):{raw:qr({format:"bytes"},a.raw,s),tx:cf(a.tx,s,{transactionSchema:n.config.customTransactionSchema,fillInputAndData:!0})}})}function Roe(e,t){return La(this,arguments,void 0,function*(n,r,s=n.defaultBlock,a=n.defaultReturnFormat){const o=Mc(s)?s:qr({format:"uint"},s,pi),l=yield rEt(n.requestManager,cf(r,pi,{transactionSchema:n.config.customTransactionSchema}),o);return qr({format:"bytes"},l,a)})}function Loe(e,t){return La(this,arguments,void 0,function*(n,r,s=n.defaultBlock,a){const o=cf(r,pi,{transactionSchema:n.config.customTransactionSchema}),l=Mc(s)?s:qr({format:"uint"},s,pi),c=yield sEt(n.requestManager,o,l);return qr({format:"uint"},c,a??n.defaultReturnFormat)})}function IOe(e,t,n){return La(this,void 0,void 0,function*(){let{toBlock:r,fromBlock:s}=t;pr(r)||(typeof r=="number"||typeof r=="bigint")&&(r=nc(r)),pr(s)||(typeof s=="number"||typeof s=="bigint")&&(s=nc(s));const a=Object.assign(Object.assign({},t),{fromBlock:s,toBlock:r});return(yield bEt(e.requestManager,a)).map(c=>typeof c=="string"?c:qr(DA,c,n??e.defaultReturnFormat))})}function POe(e,t){return La(this,void 0,void 0,function*(){const n=yield NEt(e.requestManager);return qr({format:"uint"},n,t??e.defaultReturnFormat)})}function hkt(e,t,n){return La(this,arguments,void 0,function*(r,s,a,o=r.defaultBlock,l){const c=a.map(f=>qr({format:"bytes"},f,pi)),u=Mc(o)?o:qr({format:"uint"},o,pi),d=yield AEt(r.requestManager,s,c,u);return qr(ZEt,d,l??r.defaultReturnFormat)})}function pkt(e,t){return La(this,arguments,void 0,function*(n,r,s=n.defaultBlock,a,o){const l=qr({format:"uint"},r,pi),c=Mc(s)?s:qr({format:"uint"},s,pi),u=qr({type:"array",items:{format:"uint"}},a,p$),d=yield wEt(n.requestManager,l,c,u);return qr(XEt,d,o??n.defaultReturnFormat)})}function FOe(e,t){return La(this,arguments,void 0,function*(n,r,s=n.defaultBlock,a){const o=Mc(s)?s:qr({format:"uint"},s,pi),l=yield EEt(n.requestManager,cf(r,pi,{transactionSchema:n.config.customTransactionSchema}),o);return qr(WEt,l,a??n.defaultReturnFormat)})}function mkt(e,t,n,r,s){return La(this,void 0,void 0,function*(){const a=yield _Et(e.requestManager,t,n,r);return qr({format:"bytes"},a,s??e.defaultReturnFormat)})}var $A=function(e,t,n,r){function s(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?a(d.value):s(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})};function xkt(e,t){return $A(this,void 0,void 0,function*(){const n=yield pEt(e.requestManager);return qr({format:"uint"},n,t??e.defaultReturnFormat)})}function gkt(e,t,n){return $A(this,void 0,void 0,function*(){let{toBlock:r,fromBlock:s}=t;pr(r)||(typeof r=="number"||typeof r=="bigint")&&(r=nc(r)),pr(s)||(typeof s=="number"||typeof s=="bigint")&&(s=nc(s));const a=Object.assign(Object.assign({},t),{fromBlock:s,toBlock:r}),o=yield fEt(e.requestManager,a);return qr({format:"uint"},o,n??e.defaultReturnFormat)})}function bkt(e,t){return $A(this,void 0,void 0,function*(){const n=yield hEt(e.requestManager);return qr({format:"uint"},n,t??e.defaultReturnFormat)})}function ykt(e,t){return $A(this,void 0,void 0,function*(){return yield mEt(e.requestManager,nc(t))})}function vkt(e,t,n){return $A(this,void 0,void 0,function*(){return(yield xEt(e.requestManager,nc(t))).map(a=>typeof a=="string"?a:qr(DA,a,n??e.defaultReturnFormat))})}function wkt(e,t,n){return $A(this,void 0,void 0,function*(){return(yield gEt(e.requestManager,nc(t))).map(a=>typeof a=="string"?a:qr(DA,a,n??e.defaultReturnFormat))})}class OOe extends tT{_buildSubscriptionParams(){return["logs",this.args]}formatSubscriptionResult(t){return qr(DA,t,super.returnFormat)}}class Lge extends tT{_buildSubscriptionParams(){return["newPendingTransactions"]}formatSubscriptionResult(t){return qr({format:"string"},t,super.returnFormat)}}class vR extends tT{_buildSubscriptionParams(){return["newHeads"]}formatSubscriptionResult(t){return qr(GEt,t,super.returnFormat)}}class MOe extends tT{_buildSubscriptionParams(){return["syncing"]}_processSubscriptionResult(t){if(typeof t=="boolean")this.emit("changed",t);else{const n=Object.fromEntries(Object.entries((t==null?void 0:t.status)||t).map(([r,s])=>[r.charAt(0).toLowerCase()+r.substring(1),s]));this.emit("changed",t.syncing),this.emit("data",qr(KEt,n,super.returnFormat))}}}var bi=function(e,t,n,r){function s(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?a(d.value):s(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})};const Dee={logs:OOe,newPendingTransactions:Lge,newHeads:vR,syncing:MOe,pendingTransactions:Lge,newBlockHeaders:vR};class b$ extends Qd{constructor(t){if(typeof t=="string"||dR(t)){super({provider:t,registeredSubscriptions:Dee});return}if(t.registeredSubscriptions){super(t);return}super(Object.assign(Object.assign({},t),{registeredSubscriptions:Dee})),this.getFeeData=this.calculateFeeData}setTransactionMiddleware(t){this.transactionMiddleware=t}getTransactionMiddleware(){return this.transactionMiddleware}getProtocolVersion(){return bi(this,void 0,void 0,function*(){return D9t(this.requestManager)})}isSyncing(){return bi(this,void 0,void 0,function*(){return GFe(this.requestManager)})}getCoinbase(){return bi(this,void 0,void 0,function*(){return B9t(this.requestManager)})}isMining(){return bi(this,void 0,void 0,function*(){return $9t(this.requestManager)})}getHashrate(t){return bi(this,void 0,void 0,function*(){var n;return t===void 0&&(t=(n=this.defaultReturnFormat)!==null&&n!==void 0?n:dd),this.getHashRate(t)})}getHashRate(){return bi(this,arguments,void 0,function*(t=this.defaultReturnFormat){return J_t(this,t)})}getGasPrice(){return bi(this,arguments,void 0,function*(t=this.defaultReturnFormat){return Ooe(this,t)})}getMaxPriorityFeePerGas(){return bi(this,arguments,void 0,function*(t=this.defaultReturnFormat){return ekt(this,t)})}calculateFeeData(){return bi(this,arguments,void 0,function*(t=BigInt(2),n=r$.Gwei){var r;const s=yield this.getBlock(void 0,!1),a=(r=s==null?void 0:s.baseFeePerGas)!==null&&r!==void 0?r:void 0;let o;try{o=yield this.getGasPrice()}catch{}let l;try{l=yield this.getMaxPriorityFeePerGas()}catch{}let c;if(a){l=l??n;let u;typeof t=="number"?u=BigInt(Math.floor(t*1e3))/BigInt(1e3):u=t,c=a*u+l}return{gasPrice:o,maxFeePerGas:c,maxPriorityFeePerGas:l,baseFeePerGas:a}})}getAccounts(){return bi(this,void 0,void 0,function*(){var t;return((t=yield V9t(this.requestManager))!==null&&t!==void 0?t:[]).map(r=>fx(r))})}getBlockNumber(){return bi(this,arguments,void 0,function*(t=this.defaultReturnFormat){return Moe(this,t)})}getBalance(t){return bi(this,arguments,void 0,function*(n,r=this.defaultBlock,s=this.defaultReturnFormat){return tkt(this,n,r,s)})}getStorageAt(t,n){return bi(this,arguments,void 0,function*(r,s,a=this.defaultBlock,o=this.defaultReturnFormat){return nkt(this,r,s,a,o)})}getCode(t){return bi(this,arguments,void 0,function*(n,r=this.defaultBlock,s=this.defaultReturnFormat){return rkt(this,n,r,s)})}getBlock(){return bi(this,arguments,void 0,function*(t=this.defaultBlock,n=!1,r=this.defaultReturnFormat){return _Oe(this,t,n,r)})}getBlockTransactionCount(){return bi(this,arguments,void 0,function*(t=this.defaultBlock,n=this.defaultReturnFormat){return skt(this,t,n)})}getBlockUncleCount(){return bi(this,arguments,void 0,function*(t=this.defaultBlock,n=this.defaultReturnFormat){return ikt(this,t,n)})}getUncle(){return bi(this,arguments,void 0,function*(t=this.defaultBlock,n,r=this.defaultReturnFormat){return akt(this,t,n,r)})}getTransaction(t){return bi(this,arguments,void 0,function*(n,r=this.defaultReturnFormat){const s=yield okt(this,n,r);if(!s)throw new zxe;return s})}getPendingTransactions(){return bi(this,arguments,void 0,function*(t=this.defaultReturnFormat){return lkt(this,t)})}getTransactionFromBlock(){return bi(this,arguments,void 0,function*(t=this.defaultBlock,n,r=this.defaultReturnFormat){return ckt(this,t,n,r)})}getTransactionReceipt(t){return bi(this,arguments,void 0,function*(n,r=this.defaultReturnFormat){const s=yield kOe(this,n,r);if(!s)throw new zxe;return s})}getTransactionCount(t){return bi(this,arguments,void 0,function*(n,r=this.defaultBlock,s=this.defaultReturnFormat){return TOe(this,n,r,s)})}sendTransaction(t,n=this.defaultReturnFormat,r){return HE(this,t,n,r,this.transactionMiddleware)}sendSignedTransaction(t,n=this.defaultReturnFormat,r){return ukt(this,t,n,r)}sign(t,n){return bi(this,arguments,void 0,function*(r,s,a=this.defaultReturnFormat){return dkt(this,r,s,a)})}signTransaction(t){return bi(this,arguments,void 0,function*(n,r=this.defaultReturnFormat){return fkt(this,n,r)})}call(t){return bi(this,arguments,void 0,function*(n,r=this.defaultBlock,s=this.defaultReturnFormat){return Roe(this,n,r,s)})}estimateGas(t){return bi(this,arguments,void 0,function*(n,r=this.defaultBlock,s=this.defaultReturnFormat){return Loe(this,n,r,s)})}getPastLogs(t){return bi(this,arguments,void 0,function*(n,r=this.defaultReturnFormat){return IOe(this,n,r)})}getWork(){return bi(this,void 0,void 0,function*(){return yEt(this.requestManager)})}submitWork(t,n,r){return bi(this,void 0,void 0,function*(){return vEt(this.requestManager,t,n,r)})}requestAccounts(){return bi(this,void 0,void 0,function*(){return SEt(this.requestManager)})}getChainId(){return bi(this,arguments,void 0,function*(t=this.defaultReturnFormat){return POe(this,t)})}getNodeInfo(){return bi(this,void 0,void 0,function*(){return jEt(this.requestManager)})}getProof(t,n){return bi(this,arguments,void 0,function*(r,s,a=this.defaultBlock,o=this.defaultReturnFormat){return hkt(this,r,s,a,o)})}getFeeHistory(t){return bi(this,arguments,void 0,function*(n,r=this.defaultBlock,s,a=this.defaultReturnFormat){return pkt(this,n,r,s,a)})}createAccessList(t){return bi(this,arguments,void 0,function*(n,r=this.defaultBlock,s=this.defaultReturnFormat){return FOe(this,n,r,s)})}signTypedData(t,n,r,s){return bi(this,void 0,void 0,function*(){var a;return r===void 0&&(r=!1),s===void 0&&(s=(a=this.defaultReturnFormat)!==null&&a!==void 0?a:dd),mkt(this,t,n,r,s)})}subscribe(t,n,r){return bi(this,void 0,void 0,function*(){var s,a;r===void 0&&(r=(s=this.defaultReturnFormat)!==null&&s!==void 0?s:dd);const o=yield(a=this.subscriptionManager)===null||a===void 0?void 0:a.subscribe(t,n,r);return o instanceof OOe&&t==="logs"&&typeof n=="object"&&!ni(n.fromBlock)&&Number.isFinite(Number(n.fromBlock))&&setImmediate(()=>{this.getPastLogs(n).then(l=>{for(const c of l)o._processSubscriptionResult(c)}).catch(l=>{o._processSubscriptionError(l)})}),o})}static shouldClearSubscription({sub:t}){return!(t instanceof MOe)}clearSubscriptions(t=!1){var n;return(n=this.subscriptionManager)===null||n===void 0?void 0:n.unsubscribe(t?b$.shouldClearSubscription:void 0)}createNewPendingTransactionFilter(){return bi(this,arguments,void 0,function*(t=this.defaultReturnFormat){return xkt(this,t)})}createNewFilter(t){return bi(this,arguments,void 0,function*(n,r=this.defaultReturnFormat){return gkt(this,n,r)})}createNewBlockFilter(){return bi(this,arguments,void 0,function*(t=this.defaultReturnFormat){return bkt(this,t)})}uninstallFilter(t){return bi(this,void 0,void 0,function*(){return ykt(this,t)})}getFilterChanges(t){return bi(this,arguments,void 0,function*(n,r=this.defaultReturnFormat){return vkt(this,n,r)})}getFilterLogs(t){return bi(this,arguments,void 0,function*(n,r=this.defaultReturnFormat){return wkt(this,n,r)})}}const Ckt=e=>{if(!pr(e.common)){if(pr(e.common.customChain))throw new gNt;if(pr(e.common.customChain.chainId))throw new bNt;if(!pr(e.chainId)&&e.chainId!==e.common.customChain.chainId)throw new yNt({txChainId:e.chainId,customChainId:e.common.customChain.chainId})}},Skt=e=>{if(!pr(e.common)&&!pr(e.chain)&&!pr(e.hardfork))throw new CNt;if(!pr(e.chain)&&pr(e.hardfork)||!pr(e.hardfork)&&pr(e.chain))throw new SNt({chain:e.chain,hardfork:e.hardfork})},Nkt=e=>{if(!pr(e.common)&&!pr(e.common.baseChain)&&!pr(e.chain)&&e.chain!==e.common.baseChain)throw new vNt({txChain:e.chain,baseChain:e.common.baseChain})},Akt=e=>{if(!pr(e.common)&&!pr(e.common.hardfork)&&!pr(e.hardfork)&&e.hardfork!==e.common.hardfork)throw new wNt({txHardfork:e.hardfork,commonHardfork:e.common.hardfork})},Dge=e=>{if(pr(e.gas)||!p1(e.gas)||pr(e.gasPrice)||!p1(e.gasPrice))throw new _Nt({gas:e.gas,gasPrice:e.gasPrice});if(!pr(e.maxFeePerGas)||!pr(e.maxPriorityFeePerGas))throw new xPe({maxFeePerGas:e.maxFeePerGas,maxPriorityFeePerGas:e.maxPriorityFeePerGas})},Bge=e=>{if(!pr(e.gasPrice)&&e.type==="0x2")throw new TNt(e.gasPrice);if(e.type==="0x0"||e.type==="0x1")throw new xPe({maxFeePerGas:e.maxFeePerGas,maxPriorityFeePerGas:e.maxPriorityFeePerGas});if(pr(e.maxFeePerGas)||!p1(e.maxFeePerGas)||pr(e.maxPriorityFeePerGas)||!p1(e.maxPriorityFeePerGas))throw new kNt({maxPriorityFeePerGas:e.maxPriorityFeePerGas,maxFeePerGas:e.maxFeePerGas})},jkt=e=>{const t=!pr(e.gas)||!pr(e.gasLimit),n=t&&!pr(e.gasPrice),r=t&&!pr(e.maxPriorityFeePerGas)&&!pr(e.maxFeePerGas);if(!n&&!r)throw new ANt({gas:e.gas,gasPrice:e.gasPrice,maxPriorityFeePerGas:e.maxPriorityFeePerGas,maxFeePerGas:e.maxFeePerGas});if(n&&r)throw new ENt({gas:e.gas,gasPrice:e.gasPrice,maxPriorityFeePerGas:e.maxPriorityFeePerGas,maxFeePerGas:e.maxFeePerGas});(n?Dge:Bge)(e),(!pr(e.type)&&e.type>"0x1"?Bge:Dge)(e)},Ekt=(e,t,n={transactionSchema:void 0})=>{if(!pr(t)){t(e);return}if(typeof e!="object"||pr(e))throw new INt(e);Ckt(e),Skt(e),Nkt(e),Akt(e);const r=cf(e,pi,{transactionSchema:n.transactionSchema});if(jkt(r),pr(r.nonce)||pr(r.chainId)||r.nonce.startsWith("-")||r.chainId.startsWith("-"))throw new PNt({nonce:e.nonce,chainId:e.chainId})};var _kt=function(e,t,n,r){function s(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?a(d.value):s(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})};const kkt=e=>{var t,n;return Object.assign(Object.assign({},e),{nonce:e.nonce,gasPrice:e.gasPrice,gasLimit:(t=e.gasLimit)!==null&&t!==void 0?t:e.gas,to:e.to,value:e.value,data:(n=e.data)!==null&&n!==void 0?n:e.input,type:e.type,chainId:e.chainId,accessList:e.accessList,maxPriorityFeePerGas:e.maxPriorityFeePerGas,maxFeePerGas:e.maxFeePerGas})},Tkt=(e,t)=>{var n,r,s,a,o,l,c,u,d,f,x,g,v,w,C,N,P,I;const R=!pr(e.chain)&&!pr(e.hardfork)||!pr(e.common);let F;if(!R)t.defaultCommon?(F=Object.assign({},t.defaultCommon),pr(F.hardfork)&&(F.hardfork=(n=e.hardfork)!==null&&n!==void 0?n:t.defaultHardfork),pr(F.baseChain)&&(F.baseChain=t.defaultChain)):F=Zl.custom({name:"custom-network",chainId:Xd(e.chainId),networkId:pr(e.networkId)?void 0:Xd(e.networkId),defaultHardfork:(r=e.hardfork)!==null&&r!==void 0?r:t.defaultHardfork},{baseChain:t.defaultChain});else{const U=(l=(o=(a=(s=e==null?void 0:e.common)===null||s===void 0?void 0:s.customChain)===null||a===void 0?void 0:a.name)!==null&&o!==void 0?o:e.chain)!==null&&l!==void 0?l:"custom-network",L=Xd((d=(u=(c=e==null?void 0:e.common)===null||c===void 0?void 0:c.customChain)===null||u===void 0?void 0:u.chainId)!==null&&d!==void 0?d:e==null?void 0:e.chainId),z=Xd((g=(x=(f=e==null?void 0:e.common)===null||f===void 0?void 0:f.customChain)===null||x===void 0?void 0:x.networkId)!==null&&g!==void 0?g:e==null?void 0:e.networkId),Q=(C=(w=(v=e==null?void 0:e.common)===null||v===void 0?void 0:v.hardfork)!==null&&w!==void 0?w:e==null?void 0:e.hardfork)!==null&&C!==void 0?C:t.defaultHardfork,ne=(I=(P=(N=e.common)===null||N===void 0?void 0:N.baseChain)!==null&&P!==void 0?P:e.chain)!==null&&I!==void 0?I:t.defaultChain;L&&z&&U&&(F=Zl.custom({name:U,chainId:L,networkId:z,defaultHardfork:Q},{baseChain:ne}))}return{common:F}},Ikt=(e,t,n,...r)=>_kt(void 0,[e,t,n,...r],void 0,function*(s,a,o,l=!1,c=!0){const u=yield i_t({transaction:s,web3Context:a,privateKey:o,fillGasPrice:l,fillGasLimit:c}),d=cf(u,pi,{transactionSchema:a.config.customTransactionSchema});return Ekt(d,void 0,{transactionSchema:a.config.customTransactionSchema}),V3.fromTxData(kkt(d),Tkt(d,a))}),$ge=({address:e},t,n)=>{var r,s;const a=n==null?void 0:n.topics,o=(r=n==null?void 0:n.filter)!==null&&r!==void 0?r:{},l={};if(ni(n==null?void 0:n.fromBlock)||(l.fromBlock=qr(xR.properties.number,n==null?void 0:n.fromBlock,{number:Qh.HEX,bytes:f1.HEX})),ni(n==null?void 0:n.toBlock)||(l.toBlock=qr(xR.properties.number,n==null?void 0:n.toBlock,{number:Qh.HEX,bytes:f1.HEX})),a&&Array.isArray(a))l.topics=[...a];else if(l.topics=[],t&&!t.anonymous&&![dN,"allEvents"].includes(t.name)&&l.topics.push((s=t.signature)!==null&&s!==void 0?s:koe(Gg(t))),![dN,"allEvents"].includes(t.name)&&t.inputs)for(const c of t.inputs){if(!c.indexed)continue;const u=o[c.name];if(!u){l.topics.push(null);continue}Array.isArray(u)?l.topics.push(u.map(d=>Ree(c.type,d))):c.type==="string"?l.topics.push(iN(u)):l.topics.push(Ree(c.type,u))}return l.topics.length||delete l.topics,e&&(l.address=e.toLowerCase()),l},Jj=(e,t,n)=>{const r=Array.isArray(e.inputs)?e.inputs.length:0;if(e.inputs&&r!==t.length)throw new fd(`The number of arguments is not matching the methods required number. You need to pass ${r} arguments.`);let s;if(e.inputs?s=g$(Array.isArray(e.inputs)?e.inputs:[],t).replace("0x",""):s=H_t(t).replace("0x",""),d_t(e)){if(!n)throw new fd("The contract has no contract data option set. This is necessary to append the constructor parameters.");return n.startsWith("0x")?`${n}${s}`:`0x${n}${s}`}return`${zE(e)}${s}`};class ROe extends tT{constructor(t,n){super(t,n),this.address=t.address,this.topics=t.topics,this.abi=t.abi,this.jsonInterface=t.jsonInterface}_buildSubscriptionParams(){return["logs",{address:this.address,topics:this.topics}]}formatSubscriptionResult(t){return Foe(this.abi,t,this.jsonInterface,super.returnFormat)}}Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));const y$=(e,t,n,r)=>{var s,a;const o={};return(!ni(e.data)||r==="both")&&(o.data=Jj(t,n,(s=e.data)!==null&&s!==void 0?s:e.input)),(!ni(e.input)||r==="both")&&(o.input=Jj(t,n,(a=e.input)!==null&&a!==void 0?a:e.data)),ni(o.input)&&ni(o.data)&&(o[r]=Jj(t,n)),{data:o.data,input:o.input}},Bee=({abi:e,params:t,options:n,contractOptions:r})=>{var s,a,o;if(!((o=(a=(s=n==null?void 0:n.input)!==null&&s!==void 0?s:n==null?void 0:n.data)!==null&&a!==void 0?a:r.input)!==null&&o!==void 0?o:r.data)&&!(n!=null&&n.to)&&!r.address)throw new fd("Contract address not specified");if(!(n!=null&&n.from)&&!r.from)throw new fd('Contract "from" address not specified');let c=d2({to:r.address,gas:r.gas,gasPrice:r.gasPrice,from:r.from,input:r.input,maxPriorityFeePerGas:r.maxPriorityFeePerGas,maxFeePerGas:r.maxFeePerGas,data:r.data},n);const u=y$(c,e,t,n==null?void 0:n.dataInputFill);return c=Object.assign(Object.assign({},c),{data:u.data,input:u.input}),c},Pkt=({abi:e,params:t,options:n,contractOptions:r})=>{if(!(n!=null&&n.to)&&!r.address)throw new fd("Contract address not specified");let s=d2({to:r.address,gas:r.gas,gasPrice:r.gasPrice,from:r.from,input:r.input,maxPriorityFeePerGas:r.maxPriorityFeePerGas,maxFeePerGas:r.maxFeePerGas,data:r.data},n);const a=y$(s,e,t,n==null?void 0:n.dataInputFill);return s=Object.assign(Object.assign({},s),{data:a.data,input:a.input}),s},Fkt=({abi:e,params:t,options:n,contractOptions:r})=>{let s=d2({to:r.address,gas:r.gas,gasPrice:r.gasPrice,from:r.from,input:r.input,data:r.data},n);const a=y$(s,e,t,n==null?void 0:n.dataInputFill);return s=Object.assign(Object.assign({},s),{data:a.data,input:a.input}),s},Uge=e=>typeof e=="object"&&!ni(e)&&Object.keys(e).length!==0&&!py(e),Okt=({abi:e,params:t,options:n,contractOptions:r})=>{if(!(n!=null&&n.to)&&!r.address)throw new fd("Contract address not specified");if(!(n!=null&&n.from)&&!r.from)throw new fd('Contract "from" address not specified');let s=d2({to:r.address,gas:r.gas,gasPrice:r.gasPrice,from:r.from,input:r.input,maxPriorityFeePerGas:r.maxPriorityFeePerGas,maxFeePerGas:r.maxFeePerGas,data:r.data},n);const a=y$(s,e,t,n==null?void 0:n.dataInputFill);return s=Object.assign(Object.assign({},s),{data:a.data,input:a.input}),s};var Mkt=function(e,t,n,r){function s(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?a(d.value):s(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})};class Rkt{_contractMethodDeploySend(t){const n={transactionResolver:r=>{if(r.status===BigInt(0))throw new fd("code couldn't be stored",r);const s=this.parent.clone();return s.options.address=r.contractAddress,s},contractAbi:this.parent.options.jsonInterface,checkRevertBeforeSending:!1};return pr(this.parent.getTransactionMiddleware())?HE(this.parent,t,this.parent.defaultReturnFormat,n):HE(this.parent,t,this.parent.defaultReturnFormat,n,this.parent.getTransactionMiddleware())}constructor(t,n){this.parent=t,this.deployOptions=n;const{args:r,abi:s,contractOptions:a,deployData:o}=this.calculateDeployParams();this.args=r,this.constructorAbi=s,this.contractOptions=a,this.deployData=o}send(t){const n=Object.assign({},t),r=this.populateTransaction(n);return this._contractMethodDeploySend(r)}populateTransaction(t){var n,r;const s=Object.assign(Object.assign({},this.contractOptions),{from:(r=(n=this.contractOptions.from)!==null&&n!==void 0?n:this.parent.defaultAccount)!==null&&r!==void 0?r:void 0}),a=Bee({abi:this.constructorAbi,params:this.args,options:Object.assign(Object.assign({},t),{dataInputFill:this.parent.contractDataInputFill}),contractOptions:s});return a.dataInputFill&&delete a.dataInputFill,a}calculateDeployParams(){var t,n,r,s,a,o;let l=this.parent.options.jsonInterface.find(g=>g.type==="constructor");l||(l={type:"constructor",stateMutability:""});const c=qr({format:"bytes"},(n=(t=this.deployOptions)===null||t===void 0?void 0:t.input)!==null&&n!==void 0?n:this.parent.options.input,dd),u=qr({format:"bytes"},(s=(r=this.deployOptions)===null||r===void 0?void 0:r.data)!==null&&s!==void 0?s:this.parent.options.data,dd);if((!c||c.trim()==="0x")&&(!u||u.trim()==="0x"))throw new fd("contract creation without any data provided.");const d=(o=(a=this.deployOptions)===null||a===void 0?void 0:a.arguments)!==null&&o!==void 0?o:[],f=Object.assign(Object.assign({},this.parent.options),{input:c,data:u});return{args:d,abi:l,contractOptions:f,deployData:c??u}}estimateGas(t){return Mkt(this,arguments,void 0,function*(n,r=this.parent.defaultReturnFormat){const s=Object.assign({},n);return this.parent.contractMethodEstimateGas({abi:this.constructorAbi,params:this.args,returnFormat:r,options:s,contractOptions:this.contractOptions})})}encodeABI(){return Jj(this.constructorAbi,this.args,qr({format:"bytes"},this.deployData,this.parent.defaultReturnFormat))}decodeData(t){return Object.assign(Object.assign({},Lee(this.constructorAbi,t.replace(this.deployData,""),!1)),{__method__:this.constructorAbi.type})}}var Lkt=function(e,t,n,r){function s(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?a(d.value):s(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})};class Dkt extends fR{constructor(t,n){super(t.requestManager,t.registeredSubscriptions),this.parentContract=n}subscribe(t,n){const r=Object.create(null,{subscribe:{get:()=>super.subscribe}});return Lkt(this,arguments,void 0,function*(s,a,o=dd){return r.subscribe.call(this,s,a??this.parentContract.options,o)})}}var cv=function(e,t,n,r){function s(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?a(d.value):s(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})};const Bkt={logs:ROe,newHeads:vR,newBlockHeaders:vR};class r3 extends Qd{get subscriptionManager(){return this._subscriptionManager}constructor(t,n,r,s,a){var o,l,c;const u=py(n)?n:py(r)?r:void 0;let d;Uge(n)?d=n:Uge(r)?d=r:d=s;let f;if(typeof n=="object"&&"provider"in n?f=n.provider:typeof r=="object"&&"provider"in r?f=r.provider:typeof s=="object"&&"provider"in s?f=s.provider:f=r3.givenProvider,super(Object.assign(Object.assign({},d),{provider:f,registeredSubscriptions:Bkt})),this.syncWithContext=!1,this._functions={},this._subscriptionManager=new Dkt(super.subscriptionManager,this),d!=null&&d.wallet&&(this._wallet=d.wallet),d!=null&&d.accountProvider&&(this._accountProvider=d.accountProvider),!pr(u)&&!pr(u.data)&&!pr(u.input)&&this.config.contractDataInputFill!=="both")throw new oNt({data:u.data,input:u.input});this._overloadedMethodAbis=new Map;const x=hg(s)?s:hg(r)?r:a??this.defaultReturnFormat,g=typeof n=="string"?n:void 0;this.config.contractDataInputFill=(o=u==null?void 0:u.dataInputFill)!==null&&o!==void 0?o:this.config.contractDataInputFill,this._parseAndSetJsonInterface(t,x),this.defaultReturnFormat!==x&&(this.defaultReturnFormat=x),pr(g)||this._parseAndSetAddress(g,x),this.options={address:g,jsonInterface:this._jsonInterface,gas:(l=u==null?void 0:u.gas)!==null&&l!==void 0?l:u==null?void 0:u.gasLimit,gasPrice:u==null?void 0:u.gasPrice,from:u==null?void 0:u.from,input:u==null?void 0:u.input,data:u==null?void 0:u.data},this.syncWithContext=(c=u==null?void 0:u.syncWithContext)!==null&&c!==void 0?c:!1,d instanceof Qd&&this.subscribeToContextEvents(d),Object.defineProperty(this.options,"address",{set:v=>this._parseAndSetAddress(v,x),get:()=>this._address}),Object.defineProperty(this.options,"jsonInterface",{set:v=>this._parseAndSetJsonInterface(v,x),get:()=>this._jsonInterface}),d instanceof Qd&&d.on(z3.CONFIG_CHANGE,v=>{this.setConfig({[v.name]:v.newValue})})}setTransactionMiddleware(t){this.transactionMiddleware=t}getTransactionMiddleware(){return this.transactionMiddleware}get events(){return this._events}get methods(){return this._methods}clone(){let t;return this.options.address?t=new r3([...this._jsonInterface,...this._errorsInterface],this.options.address,{gas:this.options.gas,gasPrice:this.options.gasPrice,from:this.options.from,input:this.options.input,data:this.options.data,provider:this.currentProvider,syncWithContext:this.syncWithContext,dataInputFill:this.config.contractDataInputFill},this.getContextObject()):t=new r3([...this._jsonInterface,...this._errorsInterface],{gas:this.options.gas,gasPrice:this.options.gasPrice,from:this.options.from,input:this.options.input,data:this.options.data,provider:this.currentProvider,syncWithContext:this.syncWithContext,dataInputFill:this.config.contractDataInputFill},this.getContextObject()),this.context&&t.subscribeToContextEvents(this.context),t}deploy(t){return new Rkt(this,t)}getPastEvents(t,n,r){return cv(this,void 0,void 0,function*(){var s;const a=typeof t=="string"?t:dN,o=typeof t!="string"&&!hg(t)?t:hg(n)?{}:n,l=hg(t)?t:hg(n)?n:r??this.defaultReturnFormat,c=a==="allEvents"||a===dN?kee:this._jsonInterface.find(N=>"name"in N&&N.name===a);if(!c)throw new fd(`Event ${String(a)} not found.`);const{fromBlock:u,toBlock:d,topics:f,address:x}=$ge(this.options,c,o??{}),g=yield IOe(this,{fromBlock:u,toBlock:d,topics:f,address:x},l),v=g?g.map(N=>typeof N=="string"?N:Foe(c,N,this._jsonInterface,l)):[],w=(s=o==null?void 0:o.filter)!==null&&s!==void 0?s:{},C=Object.keys(w);return C.length>0?v.filter(N=>typeof N=="string"?!0:C.every(P=>{var I;if(Array.isArray(w[P]))return w[P].some(F=>String(N.returnValues[P]).toUpperCase()===String(F).toUpperCase());const R=(I=c.inputs)===null||I===void 0?void 0:I.filter(F=>F.name===P)[0];return R!=null&&R.indexed&&R.type==="string"&&iN(w[P])===String(N.returnValues[P])?!0:String(N.returnValues[P]).toUpperCase()===String(w[P]).toUpperCase()})):v})}_parseAndSetAddress(t,n=this.defaultReturnFormat){this._address=t&&fx(qr({format:"address"},t,n))}decodeMethodData(t){const n=t.slice(0,10),s=this._jsonInterface.filter(a=>a.type!=="error").find(a=>n===zE(Gg(a)));if(!s)throw new fd(`The ABI for the provided method signature ${n} was not found.`);return Lee(s,t)}_parseAndSetJsonInterface(t,n=this.defaultReturnFormat){var r,s;this._functions={},this._methods={},this._events={};let a=[];const o=t.filter(c=>c.type!=="error"),l=t.filter(c=>m$(c));for(const c of o){const u=Object.assign(Object.assign({},c),{signature:""});if(x$(u)){const d=Gg(u),f=zE(d);u.methodNameWithInputs=d,u.signature=f,u.constant=u.stateMutability==="view"||u.stateMutability==="pure"||u.constant,u.payable=u.stateMutability==="payable"||u.payable,this._overloadedMethodAbis.set(u.name,[...(r=this._overloadedMethodAbis.get(u.name))!==null&&r!==void 0?r:[],u]);const x=(s=this._overloadedMethodAbis.get(u.name))!==null&&s!==void 0?s:[],g=this._createContractMethod(x,l),v=this._createContractMethod(x,l,!0);this._functions[d]={signature:f,method:v},this._methods[u.name]=g,this._methods[d]=v,this._methods[f]=v}else if(_oe(u)){const d=Gg(u),f=koe(d),x=this._createContractEvent(u,n);u.signature=f,(!(d in this._events)||u.name==="bound")&&(this._events[d]=x),this._events[u.name]=x,this._events[f]=x}a=[...a,u]}this._events.allEvents=this._createContractEvent(kee,n),this._jsonInterface=[...a],this._errorsInterface=l}_getAbiParams(t,n){var r;try{return Zj((r=t.inputs)!==null&&r!==void 0?r:[],n)}catch(s){throw new fd(`Invalid parameters for method ${t.name}: ${s.message}`)}}_createContractMethod(t,n,r=!1){const s=t[t.length-1];return(...a)=>{var o,l,c;let u;const d=(l=r?(o=this._overloadedMethodAbis.get(s.name))===null||o===void 0?void 0:o.filter(w=>w.signature===s.signature):this._overloadedMethodAbis.get(s.name))!==null&&l!==void 0?l:[];let f=d[0];const x=n,g=d.filter(w=>{var C;return((C=w.inputs)!==null&&C!==void 0?C:[]).length===a.length});if(d.length===1||g.length===0)u=this._getAbiParams(f,a),qs.validate((c=s.inputs)!==null&&c!==void 0?c:[],u);else{const w=[],C=[];for(const N of g)try{u=this._getAbiParams(N,a),qs.validate(N.inputs,u),C.push(N)}catch(P){w.push(P)}if(C.length===1?[f]=C:C.length>1&&([f]=C,console.warn(`Multiple methods found that is compatible with the given inputs.
Found ${C.length} compatible methods: ${JSON.stringify(C.map(N=>`${N.methodNameWithInputs} (signature: ${N.signature})`))}
The first one will be used: ${f.methodNameWithInputs}`)),w.length===g.length)throw new nN(w)}const v={arguments:u,call:(w,C)=>cv(this,void 0,void 0,function*(){return this._contractMethodCall(f,u,x,w,C)}),send:w=>this._contractMethodSend(f,u,x,w),populateTransaction:(w,C)=>{var N,P;let I=C??this.options;I=Object.assign(Object.assign({},I),{input:void 0,from:(P=(N=I==null?void 0:I.from)!==null&&N!==void 0?N:this.defaultAccount)!==null&&P!==void 0?P:void 0});const R=Bee({abi:s,params:a,options:Object.assign(Object.assign({},w),{dataInputFill:this.config.contractDataInputFill}),contractOptions:I});return R.dataInputFill&&delete R.dataInputFill,R},estimateGas:(w,...C)=>cv(this,[w,...C],void 0,function*(N,P=this.defaultReturnFormat){return this.contractMethodEstimateGas({abi:f,params:u,returnFormat:P,options:N})}),encodeABI:()=>Jj(f,u),decodeData:w=>Lee(f,w),createAccessList:(w,C)=>cv(this,void 0,void 0,function*(){return this._contractMethodCreateAccessList(f,u,x,w,C)})};return f.stateMutability==="payable",v}}_contractMethodCall(t,n,r,s,a){return cv(this,void 0,void 0,function*(){var o;const l=Pkt({abi:t,params:n,options:Object.assign(Object.assign({},s),{dataInputFill:this.config.contractDataInputFill}),contractOptions:Object.assign(Object.assign({},this.options),{from:(o=this.options.from)!==null&&o!==void 0?o:this.config.defaultAccount})});try{const c=yield Roe(this,l,a,this.defaultReturnFormat);return W_t(t,c)}catch(c){throw c instanceof Zw&&mO(r,c.cause),c}})}_contractMethodCreateAccessList(t,n,r,s,a){return cv(this,void 0,void 0,function*(){var o;const l=Okt({abi:t,params:n,options:Object.assign(Object.assign({},s),{dataInputFill:this.config.contractDataInputFill}),contractOptions:Object.assign(Object.assign({},this.options),{from:(o=this.options.from)!==null&&o!==void 0?o:this.config.defaultAccount})});try{return FOe(this,l,a,this.defaultReturnFormat)}catch(c){throw c instanceof Zw&&mO(r,c.cause),c}})}_contractMethodSend(t,n,r,s,a){var o,l;let c=a??this.options;c=Object.assign(Object.assign({},c),{input:void 0,from:(l=(o=c.from)!==null&&o!==void 0?o:this.defaultAccount)!==null&&l!==void 0?l:void 0});const u=Bee({abi:t,params:n,options:Object.assign(Object.assign({},s),{dataInputFill:this.config.contractDataInputFill}),contractOptions:c}),d=pr(this.transactionMiddleware)?HE(this,u,this.defaultReturnFormat,{checkRevertBeforeSending:!1,contractAbi:this._jsonInterface}):HE(this,u,this.defaultReturnFormat,{checkRevertBeforeSending:!1,contractAbi:this._jsonInterface},this.transactionMiddleware);return d.on("error",f=>{f instanceof Zw&&mO(r,f.cause)}),d}contractMethodEstimateGas(t){return cv(this,arguments,void 0,function*({abi:n,params:r,returnFormat:s,options:a,contractOptions:o}){const l=Fkt({abi:n,params:r,options:Object.assign(Object.assign({},a),{dataInputFill:this.config.contractDataInputFill}),contractOptions:o??this.options});return Loe(this,l,Tg.LATEST,s??this.defaultReturnFormat)})}_createContractEvent(t,n=this.defaultReturnFormat){return(...r)=>{var s;const{topics:a,fromBlock:o}=$ge(this.options,t,r[0]),l=new ROe({address:this.options.address,topics:a,abi:t,jsonInterface:this._jsonInterface},{subscriptionManager:this.subscriptionManager,returnFormat:n});return pr(o)||this.getPastEvents(t.name,{fromBlock:o,topics:a},n).then(c=>{c&&c.forEach(u=>l.emit("data",u))}).catch(c=>{l.emit("error",new lg("Failed to get past events.",c))}),(s=this.subscriptionManager)===null||s===void 0||s.addSubscription(l).catch(c=>{l.emit("error",new lg("Failed to subscribe.",c))}),l}}subscribeToContextEvents(t){const n=this;this.context=t,n.syncWithContext&&t.on(z3.CONFIG_CHANGE,r=>{n.setConfig({[r.name]:r.newValue})})}}const zge={addr:"0x3b3b57de",name:"0x691f3431",abi:"0x2203ab56",pubkey:"0xc8690233",text:"0x59d1d43c",contenthash:"0xbc1c58d1"},q6={setAddr:"addr",addr:"addr",setPubkey:"pubkey",pubkey:"pubkey",setContenthash:"contenthash",contenthash:"contenthash",text:"text",name:"name"},wR={main:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",goerli:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},$kt={"0x1":"main","0x5":"goerli"},Ukt=[{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!0,internalType:"bytes32",name:"label",type:"bytes32"},{indexed:!1,internalType:"address",name:"owner",type:"address"}],name:"NewOwner",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!1,internalType:"address",name:"resolver",type:"address"}],name:"NewResolver",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!1,internalType:"address",name:"owner",type:"address"}],name:"Transfer",type:"event"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"operator",type:"address"}],name:"isApprovedForAll",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"}],name:"owner",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"}],name:"recordExists",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"}],name:"resolver",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"}],name:"ttl",outputs:[{internalType:"uint64",name:"",type:"uint64"}],stateMutability:"view",type:"function"}],zkt=[{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!1,internalType:"address",name:"a",type:"address"}],name:"AddrChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!1,internalType:"uint256",name:"coinType",type:"uint256"},{indexed:!1,internalType:"bytes",name:"newAddress",type:"bytes"}],name:"AddressChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!1,internalType:"bool",name:"approved",type:"bool"}],name:"ApprovalForAll",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!1,internalType:"bytes",name:"hash",type:"bytes"}],name:"ContenthashChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!1,internalType:"bytes",name:"name",type:"bytes"},{indexed:!1,internalType:"uint16",name:"resource",type:"uint16"},{indexed:!1,internalType:"bytes",name:"record",type:"bytes"}],name:"DNSRecordChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!1,internalType:"bytes",name:"name",type:"bytes"},{indexed:!1,internalType:"uint16",name:"resource",type:"uint16"}],name:"DNSRecordDeleted",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"}],name:"DNSZoneCleared",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!1,internalType:"bytes",name:"lastzonehash",type:"bytes"},{indexed:!1,internalType:"bytes",name:"zonehash",type:"bytes"}],name:"DNSZonehashChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!0,internalType:"bytes4",name:"interfaceID",type:"bytes4"},{indexed:!1,internalType:"address",name:"implementer",type:"address"}],name:"InterfaceChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!1,internalType:"string",name:"name",type:"string"}],name:"NameChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!1,internalType:"bytes32",name:"x",type:"bytes32"},{indexed:!1,internalType:"bytes32",name:"y",type:"bytes32"}],name:"PubkeyChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!0,internalType:"string",name:"indexedKey",type:"string"},{indexed:!1,internalType:"string",name:"key",type:"string"}],name:"TextChanged",type:"event"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"uint256",name:"contentTypes",type:"uint256"}],name:"ABI",outputs:[{internalType:"uint256",name:"",type:"uint256"},{internalType:"bytes",name:"",type:"bytes"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"}],name:"addr",outputs:[{internalType:"address payable",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"uint256",name:"coinType",type:"uint256"}],name:"addr",outputs:[{internalType:"bytes",name:"",type:"bytes"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"}],name:"contenthash",outputs:[{internalType:"bytes",name:"",type:"bytes"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"bytes32",name:"name",type:"bytes32"},{internalType:"uint16",name:"resource",type:"uint16"}],name:"dnsRecord",outputs:[{internalType:"bytes",name:"",type:"bytes"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"bytes32",name:"name",type:"bytes32"}],name:"hasDNSRecords",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"bytes4",name:"interfaceID",type:"bytes4"}],name:"interfaceImplementer",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"},{internalType:"address",name:"operator",type:"address"}],name:"isApprovedForAll",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"}],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"}],name:"pubkey",outputs:[{internalType:"bytes32",name:"x",type:"bytes32"},{internalType:"bytes32",name:"y",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes4",name:"interfaceID",type:"bytes4"}],name:"supportsInterface",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"string",name:"key",type:"string"}],name:"text",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"}],name:"zonehash",outputs:[{internalType:"bytes",name:"",type:"bytes"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"address",name:"a",type:"address"}],name:"setAddr",outputs:[],stateMutability:"nonpayable",type:"function"}];var Hkt="AEkVMQnvDV0B0wKWAQYBQgDpATQAoQDcAIUApwBsAOMAcACTAEUAigBRAHkAPgA/ACwANwAoAGIAHgAvACsAJQAXAC8AHAAhACIALwAVACsAEQAiAAsAGwARABgAFwA7ACoAKwAsADQAFgAtABIAHAAhAA4AHQAdABUAFgAZAA0ADgAXABAAGQAUABIEtAYQASIUOjfDBdMAsQCuPwFnAKUBA10jAK5/Ly8vLwE/pwUJ6/0HPwbkMQVXBVgAPSs5APa2EQbIwQuUCkEDyJ4zAsUKLwKOoQKG2D+Ob4kCxcsCg/IBH98JAPKtAUECLY0KP48A4wDiChUAF9S5yAwLPZ0EG3cA/QI5GL0P6wkGKekFBIFnDRsHLQCrAGmR76WcfwBbBpMjBukAGwA7DJMAWxVbqft7uycM2yDPCLspA7EUOwD3LWujAKF9GAAXBCXXFgEdALkZzQT6CSBMNwmXCYgeG1ZZTOODQgATAAwAFQAOa1QAIQAOAEfuFdg98zlYypXmLgoQHV9NWD3sABMADAAVAA5rIFxAlwDD6wAbADkMxQAbFVup+3EB224cHQVbBeIC0J8CxLAKTBykZRRzGm1M9QC7DWcC4QALLTSJF8mRAoF7ARMbAL0NZwLhAAstAUhQJZFMCgMt+wUyCddpF60B10MASSsSdwIxFiEC6ye5N2sAOeEB9SUAxw7LtQEbY4EAsQUABQCK00kFG8MfBxcAqCfRAaErLQObAGcBChk+7Td0BBgXAKoBxwIhANMrEnM681CwBZA6dyc1SAX6JwVZBVivuAVpO11CEjpYQZd7k2ZfofgLEwPFByXxdyMEo0sCU1MCdRurJwGPo6U1WwNFFwSDYQkA0QarPy8jBykCOV0AawFhH3EAgx0ZAJUBSbcAJ2kXAa/FAzctIUNTAW9ZBmUCZQDxSRcDKQEFAElBAKsAXQBzACu1Bgfz7xmNfwAJIQApALMbRwHRAdsHCzGXeIHoAAoAEQA0AD0AODN3edPAEF8QXAFNCUxsOhULAqwPpgvlERUM0SrL09gANKkH6wNTB+sDUwNTB+sH6wNTB+sDUwNTA1MDUxwK8BrTwBBfD0gEbQWOBYsE1giDJkkRgQcoCNJUDXQeHEcDRQD8IyVJHDuTMwslQkwMTQMH/DZCbKd9OANHMatU9ZCiA8syTzlsAR5xEqAAKg9zHDW1Tn56R3GgCktPrrV/SWJOZwK+Oqg/+AohCZNvu3dOBj0QFyehEPMMLwGxATcN6UvUBO0GNwTFH3kZFQ/JlZgIoS3ZDOkm3y6dgFYj8Sp/BelL8DzZC0lRZA9VC2EJ3zpfgUoDHQEJIocK2Q01CGkQ7wrFZw3hEUEHNQPRSZYAoQb9Cw0dMRWxJgxiqAsFOXMG9xryC4smqxMlevgFzxodBkkBJRr7AMsu44WsWi1cGE9bBf8LISPDFKRQHA0hQLN4RBoXBxElpQKNQ2xKg1EyHo8h8jw5DWIuD1F4B/E8ARlLC308mkanRQoRzj6JPUQiRUwoBDF7LCsnhwnLD4EMtXxuAVUJHQmtDG0TLRETN8EINQcVKZcgJxEIHUaRYJYE85sD7xPNAwcFOwk9Bw8DsRwpEyoVJQUJgSDTAu820S6vAotWfAETBccPIR/bEExH3A7lCJcCYQN/JecAKRUdABMilwg/XwBbj9RTAS7HCMNqaCNwA2MU410RbweNDlMHoxwvFbsc3XDEXgeGBCifqwlXAXEJlQFbBN8IBTVXjJwgPWdPi1QYlyBdQTtd+AItDGEVm0S5h3QChw9nEhcBMQFvBzUM/QJzEekRZxCRCOeGADWxM/Q6IQRLIX8gDQojA0tsygsjJvUM9GUBnxJeAwg0OXfqZ6dgsiAX+QcVMsFBXCHtC45PyQyYGr0YPlQqGeAHuwPvGu8n5kFTBfsDnw86STPqBLkLZQiHCTsARQ6fEwfTGGYKbYzMAS2HAbOVA1ONfwJriwYzBwcAYweDBXXhABkCowifAAEAywNTADUCqQeZABUAgT0BOQMjKwEd4QKLA48ILccBkSsB7yUEF78MEQDzM25GAsOtAoBmZp4F2VQCigJFMQFJIQQBSkNNA6tt3QDXAEcGD9tDARGnRscW3z8B22snAMMA9wABMQcBPQHJAe9pALMBWwstCZ6vsQFJ5SUAfwARZwHTAoUA2QAxAHvtAU8ASQVV9QXPAktFAQ0tFCdTXQG3AxsBLwEJAHUGx4mhxQMbBGkHzwIQFxXdAu8qB7EDItsTyULBAr3aUQAyEgo0CrUKtB9f81wvAi1uPUwACh+kPsM/SgVNO087VDtPO1Q7TztUO087VDtPO1QDk7veu94KaF9BYecMog3QRMQ6RRPXYE1gLhPELbMUvRXKJVIZORq4JwEl4FUFDwAtz2YsCCg0cRe4ADspZIM9Y4IeLApHHONTjVT0LRcArUueM6sNqBsRRDwFQ3XpYiYWCgoeAmR9AmI+V0mrVzccAqHzAmiUAmYFAp+AOBcHAmY3AmYiBGoEewN/DwN+jjkCOXMTOX46Hx8CbBkCMjI4BgJtwwJtquuGL2NBJwFjANoA3QBGAQeUDIkA+ge+AAmxAncrAnaeOwJ5Rz8CeLYZWNdFqkbTAnw7AnrEAn0FAnzsBVUFHEf8SHlfIAAnEUlUSlcRE0rIAtD9AtDISyMDiEsDh+JEwZEuAvKdXP8DA6pLykwpIctNSE2rAos7AorUvRcDGT9jAbMCjjMCjlg8k30CjtUCjlh0UbBTMQZS0FSBApP3ApMIAOUAGFUaVatVzAIsFymRgjLdeGJFNzUCl5sC765YHaQAVSEClosClniYAKVZqFoFfUkANwKWsQKWSlxAXM0CmccCmWBcxl0DFQKclzm+OpkCnBICn5cCnrSGABkLLSYLAp3tAp6OALE5YTBh6wKezwKgagGlAp6bGwKeSqFjxGQjIScCJ6sCJnoCoPcCoEgCotkCocACpisCpcoCp/sAeQKn7mh4aK3/RWoYas0CrN8CrKoCrWMCrP4CVxkCVdgCsd3TAx9KbJMCsrkJArLkE2zcbV9tRFsDJckCtlg3O26MAylBArhaArlDEQK5JnNwMnDdAr0VArvWcJIDMg0CvoRx/gMzbQK+FnMec0sCw8cCwwBzfnRHMUF03AM8owM8lgM9uwLFeALGQwLGDIUCyGVNAshAAslLAskqAmSZAt3OeHVdeKp5IUvMAxifZv4CYfAZ75Ugewdejl63DQLPZwLPaCtHT87vD5sAwqkCz28BJeYDTg5+RwEC3CMC24YC0ksDUlgDU1sA/QNViICFO8cS6VxBghiCz4LKg4kC2sMC2dqEDIRFpzgDhqEAKwNkCoZtVfUAUQLfYQLetG9zAuIr7RAB8ywjAfSXAfLOgwLr7wLpbHUC6vUC6uAA9UMBtQLuhQLrmJamlv8C7jsDhdyYdXDccZ0C8v8AZQOOEpmPAvcPA5FqA5KDAveUAvnVAvhimhiap7czmxoDnX8C/vYBFwA1nxifrwMFiQOmZgOm1QDNwQMGZqGEogEFAwxFAQsBGwdpBl21YwEAtwRnuw2HHq8JABNxNQAfAy8SSQOFewFfIx0AjOsAHQDmnwObjQizBhufwQCnBRG76R09PhZ4BWg3PkArQiFCtF9xEV+8AJbFBTIAkEwZm7k7JmAyEbrPDi8YxhiJyfYFVwVYBVcFWAVjBVgFVwVYBVcFWAVXBVgFVwVYRhUI14VnAgICCmRe6SsEyQOxBi+7uwC7BKe7AOdAKRayBUY+aT5wQj9Ctl91N1/oAFgRM6sAjP7Ma8v8pudGej0mIwQrFic2NX5t32rB8RnCLGkBa9duMBcFXwVqycHJuAjPSVsAAAAKfF59i74AMz+BAAMW0QblrSMFAIzDCwMBDQDlZR09JB9KQrFCvEE4I18nYDYnOCMJwT0KRD9DPng+gT5wPnECiUK8SUI7X8tOT2pNCixrVC9qC24fX+AzOhsJZ5sKYiMrPB0mQqtCvCvMAcv8X8kOHy4JCAkifp3fajotShfJq8msCWXBy8wKYEFfD+UQoxEAk40dRUIlG6ltOc44CjM/Qz5wQj8cBwodTEdsWywtWuG8Egp97R0rQj8cXQhKCQ4zVENCNwQ7Q5wsCoEbLUI/G/UIUyIjGDAxAAWPYfBeCnFkyWALYC0jbkNgGTkCGx5gswYCaxBlTmBNEQFk52AVYJVgfWCzYEtgkWgWFwa1DtxVqbxaC0MWqwG7K83BAh8VABwDHgF5AmwvMJVSgAGKCrhHGgDkI3SOCsoNpk3qAZsCh5xPBUBfAPf3BwA0FlcMC6UMJB+6r0eAgQw0ABUTnyuCCHoC0gtLZREbANhOBnUECh5aADEAtritAJQnCxZvqyQ4nxkBWwGGCfwD2e0PBqoGSga5AB3LValaCbthE4kLLT8OuwG7ASICR1ooKCggHh8hLBImBiEMjQBUAm5XkEmVAW4fD3FHAdN1D85RIBmpsE3qBxEFTF8A9/cHAHoGJGwKKwulODAtx69WDQsAX7wLAGNAlQh6AOpN7yIbvwAxALa4rQCUJy07Ds4CkBh7ULtYyHRyjsOlmw/ZFUkb7AEpEFwSBh/lAccJOhCTBQ8rDDYLABEAs+AiAQIApADhAJiCCrJrOS8AFABbG8YubHYqDcEQAjskHNPhHB4LG30CewTBCqrxbAAnLQ6mLs6hHAe7CQAQOg+7GkcczaF3HgE9Kl8cLs4RGQB9q9ocAuugCAHCAULz5B9lAb4Jtwz6CDwKPgAFwAs9AksNuwi8DTwKvAk8DrsFmAEbawouzqEqD4sa4QHDAREWOwCgCzsLuxC7BBiqe9wAO2sMPAACpgm8BRvQ9QUBvgH6bsoGewG7D00RErwBAQDqAQAAdBVbBhbLFPxvF7sYOxjbL7ZtvgNIqLsAB7sALrsC6w5WAAq7BAAeuwJVICp/FTwVuwG+J+QAsloBvSjgo7vIAAFbAAG7AAJbAALjAAg7AA67AgAbu6VbDr/EAPQAaPuoOwMBu5UnSwDn3Rm7CBp7CKEFCv9wAN+7p7sau6OLeXIG+6mbgwASuwYbCwG8AACGAG27BgALu6c7ARo7ugihnMoBuwvtB8CpOwDhewG/AADlABW7AAb7AAm7AGmLABq7GLuOaRX7AA5rAC5LHgAGuwAXuwghAA1KAcIAt68mAcAAALQADpsAHBsBv/7hCqEABcYLFRXbAAebAEK7AQIAabsAC3sAHbsACLsJoQAFygBunxnVAJEIIQAFygABOwAH2wAdmwghAAaaAAl7ABsrAG0bAOa7gAAIWwAUuwkhAAbKAOOLAAk7C6EOxPtfAAc7AG6cQEgARwADOwAJrQM3AAcbABl7Abv/Aab7AAobAAo7AAn7p+sGuwAJGwADCwAQOwAIPAAUOwARawAPiwAN6wANuwAZCwYWGwAVOwBumxm7ALobLgATOwMAaSsKAOFLAAI7AARSABd7BRsABtAAGLsAC/sAX7sAa/sA5IsBuwAXdgG8AAFyC6EABUoAbXYAB/sA5XsAHGseAXsoUgA5RQD+Bw0McgAoKnABpAUIXgG8XiMMCQdvS2xfKokfPBRiLTYDoQq0AdgAFgLRA24BdnJHUhQhA08CFT4BLAYDc0a8e1J6QAApADEB+wBTCtsAe5AsASsAduUNETJGAUoAVwUAAVABB4rMAHg7BCClAFoA1hUAlWg3H4sAzWuxAM/UFgjCdXMbGFYdCdEBiJCrIlNTTUgSPMKJ+QB/HDdAKSvgEZdPAHIBKSwwKUIZDwMwVQT3xe4AS2XcAGoCcQI/EXo6x3guNdUGBQAQGx0KCAwqBB8dKU5TTgi5ugAKEs0AJgABGgCGAIkAjjUA7gC0AOAAnTwAuwCrAKYAoQDyAJ8A0wCcAOsBDAEHAMAAeQBaAMsAzQEHANcA6wCIAKIBNQDjANgA1QMBByoz1NTU1LbA3M3QzkMyFwFNAVcvRwFVAWQBYwFWAUdLQ0VoDQFOFQcIAzI2DAcAIg0kJiksODo6PT09Pj8OQB5RUVFRU1NSUylUVVdWVhxdYWFgYmEjZmhwb3JycnJycnR0dHR0dHR0dHR0dnZ3dnVbAEDsAEUAlgB0AC4AYvIAigBTAFMAMwJz6QCH//LyAGAAj+wAmwBLAF4AYPn5qgCBAIEAZQBSAK0AHgCyAH8CPAI/APgA4wD6APoA5AD7AOUA5QDkAOIAKQJ3AU0BPAE6AVABOgE6AToBNQE0ATQBNAEYAVQPACsIAABNFwoWAxUWDgCKAJIAogBLAGQYAi0AcABpAJEDEgMkKgMeQT5HKQCLAksAwwJTAqAAugKSApICkgKSApICkgKHApICkgKSApICkgKSApECkQKUApwCkwKSApICkAKQApACkAKOApECcQHQApMCmwKSApICkRZ5CwD6BQOnAl0CNhcBUBA1At4RCisTAUo3E02RAXekPAFlWQD/Az1HAQAAkykeGI9qAClgAGkALgCJA5TMi/CuhFoFuisOwhEBndV0KgsEIzFsATNabAGyAN5+gH9+gH6BgoJ+g4aEfoWIhoCHgoiCiX6Kfot+jIqNfo5+j4KQfpF+kn6TfpSDlYiWgpd+2gLabOEC2GwAgmwkbKAAg2xsBEkERgRIBEsESQRPBEwERwRNBE8ETgRKBEwETwCWZmwAowOIbAC0ZgEFbADJUWxsAM9sAgxsAPZabAD2ARkA9gD0APQA9QD0A31ebNSEI2XAAPYA9AD0APUA9BxsbACJWmwA9gCJARkA9gCJAL4A6AAIAPYAiQN9XmzUhCNlwBxsAPdabAEZAPYA9gD0APQA9QD0APcA9AD0APUA9AN9XmzUhCNlwBxsbACJWmwBGQD2AIkA9gCJAu0A9gCJAL4CNwD3AIkDfV5s1IQjZcAcbAJDATZsAkoBOWwCS8FsbAJXbGwDnwLtA58DnwOgA6ADoAOg1IQjZcAGA31ebBxsbACJWmwBGQOfAIkDnwCJAu0DnwCJAL4CNwOfAInUhCNlwAYDfV5sHGwEPmwAiQQ/AIkGjTFtIDFs1m4DKGwDrAJsbABVWv4VMgJsbACJAmwAVAEAul5sAmxebGwAiV5sAmxebD3YAEls1gJsbEbCxxP/x5BApA0KYFA89AsjTx97EHmJQPyocItC2JnNFRCEnFU6SFTDoI0PxeRNRoNRWkpzVnWW8pTagkNmgf+jGupqZ3eu50LAFnc+OzfJwdub1AdpOy76VnijWNR/CMEevikQkFyQuLuPajxWi9chqOoMJ7qpCN4sx3LJG4Myu8kD68wC6+iAwt+pU1JEeY13rpCVkXSZfinVKn4xZpxsI3Lp8bJLrJ9ujkrIalMRBAcv/GSKEtowzcEn5XmJw2BagB8V2UWJoJHZ14SXhM7p0XeGFOuw6mlvyq99WYp5XxrO6ru9nn4RHcOkJ7hx5UqWtman7yVMLzYXQefQRUdIY70RYQE8+aAzCNSGQkXiHfnHYRMi+xczKDdZLk3AV1gzxkkSHLjBwuq8shIJ+/RAbqjqQbugFhe0rqklu432EERkM5k9y1DXzds46oLqKAx6OhPT2WiqEfhaITn7OF9Y694AmKmUvbpWp0xJqDaf3jeNJXnK6NpnGcFOmbclbARC+5+5U52ufw5b0Hh+2LrrNimvZe4eYmApRsZnJE310SqB+1xB6rSJfnV1f2D0awB18Oc0sXAFqIlgHgWiaZGdvP5CJUSsCTCQUC335+iSkwPlLJJ5lwjTSn9Lw22NbK1Tu8w+bUpHtDRDPho7Gun8aw2Jzu9i+N0Ot/kPMbLAb/rUQ82kfpk85qLDkfxLl39QPDngo72GYh/Xigbpcm1pA23D2ywt3D8GgMOao040wDqkHxOEx0OhC+ZmHiIdjK7yRbfJD2ouZbAedhD3p7s8WDmCJfNforgDYPGAXSI08fTjPZ5B37lc5VXGzc1vJmibDwBNVzXuaUzg7N5H4BxqjhJ+kz9HLUJys7bpBDYAPvbut13AwJCWd059tS8YTYgC8HwrkewBfa1LSSpmMr9uR2EekTiAMH+Mx4AGzgbquccwBDlLmRhgXL/YiLPCEb6d2k5qJ6o800qddABkpqt7NG+sc2uvHZwZs57W1AHTFM1KkMShasADAh2FvzbzJOzVDMS3ZlT2BSFKdnkZFB6JyqJbhm6XANis9TrtzJdlPVp+rl8v3nIke6Jou7m2TKu53Vounupgkz2LzrQPhhatLIG7rfF/gUKWp15X3LKt+ZvuCDSqPUigF9yJntimC1HJR7Yj/dUrLAXWrT+1tnwPJJLGKAlQ5VeNDWRKCTt2vz3rJuo4+gIt75/Mkfl/gSZblZ9r/SEeeosZXneli/xNh1WVCvkRt2RnyyjtMkMqhzXh1PVOCbILqv0r7rGYm0CHIyKdhHL90cl9E1I6eEtQTCt6RXj8M0HHrHCHLVRpNM6WIbT5BCMGVnL0o5895qSRbCJz+5I8PGMhAN/Xrj4BgIdlKqlHtBHqTJwmK169toZ2IWxNzrAbIG7zh85Q/LG2A4yBcaBel52zdunokB0lv3A7kXnTI7M6ZnfZ7nwuj5lkGhqSpW+w5CI/FmRlplBEbnZy1ZxS3DL8rf1YWhO5XivWZBSRh1gFsjjyj3qRG1cm/6ors7WsEif6WRxns1MKDZa6KrbfMQ/swIb+2nb0tqxHeii6FcgVeAjE/Xwac1owx04dJKG8R5YQgHNnEfHf0qb8WOnU0eQSjazq+IK7cSuCqYzPEUB/x+QgGZqM3dBoYvNvZVOHDkbgdilWdagqO5bkybXfLpyMPuGq8mvAAEZGbR6RwXGlW9ErOWTfnjfx6dXFJqBj0OBSGFz4lWQasNOmVJeN4SFWSLfOGB/7ehV5YuoNNROHZEG9ElVuMnqbDMMuDleOt/cN/gsWxGw128mwU8/HxkOKqdTZnI7dHka67WCTf/FmBrxpNCaKJ1GxBTCSS7MNfhNj8S4Gtotg6Z3AM9cAeVROnppUMaiV5jjudLnNqoVrKO1/FijLlAc74kxydxKX1RQuMqHR63eecYr5o6MJ+B78VsLlCrpelWh6GOrCOBIoQmIcdpJL1pwE2zzZqBkecGTdK8KMOB6r1eNRURyrz6M899TZaoS/vNOxHf+5gORU+OyYIcIW6diP25GHF6u8TNjuL/GJzCnLLXd01KrsjRa51v4+O/VIAWXESJxfxWjv628J+cWUQpoD+Yytzs3jSMRJ23/XT+vUdtUMLDQq1vnIoeg/GjWh88MT6k9dRqDaQ+vodilFgvjuNw5pJpId9mfwyYeLCGb3BmHXdfQfhfPRQaupe/f8TG4Bk3eDKlYBaEK3kZYNN2Sdxz47m/vYBxvIOKtnqplB1pebzuXmAr/MuzQCknKe653dzaWQQ7MUhWYWvzIZwLe1v0rXxImLaz+AkAu+sYikhouNF3EW6w4crZ6MuUiDbIAx8XhAfegcvW6x9BPb3/sCxGWu9YyatqExB+TSm69qIkI9IwhjrcnzME+jWBx4mNQm5WwLzUjSyY4FZ0aMF5YFlXUD4hL4XfOeYv5rDe2s2D/Cn+28fZ9UCnOQvXFMnQqfc0G+ZqOWWD9l/liqUPaNQzZjxCHpUAD8Rcc90MniQ02ugHWsUupFUvhC9usY7zNPt5F2jO7qgzhafsQSd50jgLrC6Qx6bpHbXR3WNAu1BzGmwbz+ebGmwTjdy006Y6zipP7n/OJlvSmbq+SY+nefAVKK6EBMPbce5n3IdRI8+vbxCpN53rw3TvgNds1SuMiuLGxt89L71mxPDeanGhyHvOjmO56tnVpoHalQnL6TqNuqKsHjHCIKB4pCgj4WyYPvRvYvqi5EMr7lN3MotPR/KH7JUD1lZbU0QzfbrEBJnuQiVAyAC9vwXWp2TRU1/0aapyAH2cbglEHVAdl+1rb1u147uV0td1eNoQZsqHrIMIYVPXtLk2TIU3cJE08PjoYNDpfF/IcJnYQHl6nsplczX3Rgah4NbJJHl//5scUufqsSd//kbIS406ZWoMP//+jhGUswX/5nVNz/jAj9KmXPtAmMiK+khhbn1w/mELzZMT/WxcW//y/jsHaOM/61oAW/CjYhJtY622/TtMYuP7bilBvbiT3vB9n8IcFPnwM78H0KfhYDRdY5PhWJ4jWRQzB+HT5NVZV56LG82hcQms+jOTT/c9Y9sx5rPi1/wB7f/+c5UfUCKk3iwwCuywUc2MGnAwsXf1E5hoI55x1Q/Qby+sWH8NRjavZ8VaDsdi1NUVhH86BJHX1yaFt1w1OYeL5LVmdN+5Q+KuTvXEPDzUCg6xp0HhsUhTWSe7MZMM/6rsTUb0/nbUE3YQlGGt48kT1/6cnf6yHnvHtQx9EosOXN077yyEq/jE3YTiG/5SEJmXFeocJJ1EAd6vKeK6VEdJLOZ1km/EwOnZWCQpzCLKPHxrfh4yJhGq//2dos2E/3+MOcdW5EsgIdmTQUQetzRy5fQHhDBl37XbWzsqO/cASEDjyst1/8NEROqVAxWnddQV+umJ8IrKVgKvGaTc0GsQ4s8h0Osql5QKwlddPDjJhKInyWqYUKmmlIts+FIcXZ6yM6cljbsjUG2ksSOkuIw4sYHffRNgBOLApvD6XrR6Rt0rV2Uf8IpnIUVnb9Twt91QjAaD/dStSWDxg7aYY+VXIgnuowYdOkjywa2hlgrnI6PjaU3e3UjQ5Yk5mdIJGyHnv3/P+1EkMav1yFyF+FeJE/RXnWBw+Nh0aOo6TGlKX7d+dkP9+brvr79SdtXJtcD/aXBGiMNfG6/NQniQHYQlK78FEHDqOh+bDI0o+2Ub0h53EL/vlzjrBczVEZz2bOtvIL+DIzDkk9nCWt7tlqsq3l9JMtJk3r5HG2iJ9b/X11TG6wwMAjHLQ2oasaMEsydh88QPvI+hmqIHhvalpKoKOueJR0eZ9J8G2alNOIOy98jwvbc87Ewk9d+5G/tUijTmlbjFlDKXV05HalKxaRTrucc73On7yzAPS6f2v4ogiaWyWeV73dv/MsQT5HjRrsYV9dLAcI3T+zC2qEVINyNpEhoKV+xVSuWtT4AhBfpnZ7unIM+HX3msI0HiI+P+z2PFgkjGi5PqEbG/wNIWeRUjPtDEgbbubN+I4JaDLrW9borRBDob7ZFx+JdKeFVUKVeWqb/c88Ol7DhM0suLtuEd8tkDSMTD3DFx8UphPINHMHi51hAPttXL4Ektt/lKEUG/R4qZKohHjVpAcPIMiHyWr6xR8/EWnNJvBFET76yCdk5er7ADB/1bgoImhpSiZ/omZjPKPCEeZsOwvPmXL+1vlJNeGO3TzySmGA1X6e58gLrazDM71jywM1XL8zKHN6G3kB31Y8vLtP982N975SZXk2JwDvmv7AY/aDsFFk1v+nE7/hbvuOWhBH4kuemeYozPk2K22Vx/YGiDTLU7YilpOt29u3RZMBh4UJjlTP5ItxTzWv6ebL9b+GSU1Vsm2S8LMfVfJczaBSqE8J1A4YUjpsALL7++bwCPXFhaufdpDFtBlHb9makeYbqdg9ltvK/HwF/rNE6KrtWUkEcxmTB7Iyu5TiVaIgW/YxzQhpArliIMkOoK5L7ShVtF+DYqV01mk7fwop04hQRwg4KFmr5z9nYf05VVqkSe7gfnx5bxxlQ0qEV0jiwzf064qG11iEqjHcUgDWWsDs/LEGlzX31T5KVL+7D4EoKim7HBagiqRo5JI3WfDBgpKIruWz9j/J6Hp5Q/EJbMWB8NeSMuFarNw3AEYPBJtYQO/4oD/ZgPTSQ06di0EeumX5EbrdThO+fvYEVSxLtZ3AJkee0Xn0sDwNtiiZhJjJRDuG1YRKB1vOulfd9JjHeyu+UHTmrtra/pm+8Rixh4WKiLaLOCxIbZNoWRZSyyUGLPjAaAo+SQBpfO2uruWrzFxLlpvrXJNMCWtlJDKGAnlWK5xpU2tcxXbeD+sbdfwYXt/qTwDk6UqXR/aUt099DhSNl4Nk8mXwpw+b0nvjKOG6Mg1PRXjrMUMANvNgEArv8nMJs3vj1aHi8MHz/UfJWWzkcrSpZTNBhduXlGR7i+ip/THDp5R9KRNcDKECgtwgXg4EFN5HHfikP/XvsoCkHTg+NbsD8Gl6eknk4Arwn/BWGJ0hgW0/gUKrzuGZhub7igRP3abetpIm+24xEOlWl3YKpm2qTBFvX8ddDRvm1LcwnCJuEfZx12qPY9TrntMIQsv316zvpyWnyStX8VU4j6tQk+CWlLBUCJR6MdH9Cp7g2qdn2WM9qFbREmejH09dlWEPm8hPF0L7RxwRRdiCs0DP8ewk6ApoELkKU9hckSdbnXm8UHJmaNXjxv/q0fTTpu8rnl9lN0vQCpDRbCtcz12rGRFEA7Cfg7FhZn5QFkNmv1ZURKEsiZce1nS9K7HrwpC7yJV4Xt3eAVbLJfoXHrtwG60Z8gwaSnmxoL3s2ZlRqggZN/MHo1oUS4L+GwObFI596Ld4Mvi8l+cQmF1gJpkpnDio7TuO35npaMHiWzFqPSX3qNgkIPGuX0qGYnPIVsM901Yu8oZnOZOY1TbtIdFUNKNq2dP8SJ4F/VCEzIjF0/Rh+7UrZj80tC6rognVH3mqa8eCs/lcQU1Pjj98kBmAKDbZUTwosv02UunRR3n0X6c+f73mtwB7/WbQ16gO431EtwZbNG1SM4TZPBnsQSESlsfG2JLQXx5xWf4bmQ/xcVCPISAX5897JxHKLD/Xkgu57+ABR2+MMtEbX64+MNlBHpKC7sjlWVEShf5qA+dGc59LFVlZrX/Enq9z/v+wnZ1HErmxmjJjxOA+hAjVUWgtq6ygAi/8ewJDjUMFw3zhQFtbyTLDPFd21Ji5S5QPZo9nMSxdg1+DGFSN0wlWt7XeYPbHqLfliV0J1kOhQNp0VbUPy0MS2Ms66OxtSWvaULaWHnfAA+sieVVgtjDwN3nKonWapkSKRN8BKKJQpCfqo8RQI5udhfu5s5+7vwsppmAJDgz2GNA7d43VdbV2l/SrvEu4RYslmNJmfSOVbssxAhSYy6WxpIQdDB0FVBpZ6IM8yr81QN+XLZ3n/wed/R+s6LslkxKbzzst/GkRbe6rFmtvJCwr1T44ETM+IMgOnjUO0eG6a1n2w7lwM1oFBvzMUWRkNFOvKcx3oSb5XdenZ5dXsute6nkRypBiSdAtA2fxAd8UdLOZW/MB7fZoEuFheQXijdaF8kuaRZoSeWdKOkKsGYEGaXfaDKTu0WMTcLniQs7KRCz9iK3SP+Y2xIjkfVGqFLSQ6vh+A1u6FdfwXsv1VPMfi2cxmdM+/xTgMXEyo2ZGcQ2YmPsghnYdv2+z48JpGZA4tUK1p1q2VdVxyfypXEXcrxKKtmt8UdW7sHWmKMqDuBBM3J/JUQx8eUYN4pJ5oRqvdiPHU1o/WPjiKvnlCqOdyxlxF54L9PrtLD1NejZ9aZDivVr6ZfMFK1/psVygoPIAnphcJWWb9+5IKMKmgRQULsTPZi6Bw4wP32zVEoKcHpP73CkFAqS98nSaGoWDjDJiaACJn4p5o1jq9R4Q4VcibhXF//LHP0bdf63kRVZdRbbhGe7sDQcyWS5tpkfeYHnff25WK+4FpzLlAcbaKmHdIBqOw3fImx1uqQIADH0TyHzFlqTG6nMoY81svP0T6BIyELMS8tMe+E1p6TFP6sVpZa6VNaTumufD5aj9goRa9SAmdJT4HhI2r0egj8UrgFb8L59wGLnYlzkLAiUd3m/WWIIEU61kPoEjd3gIVy/fiBcgqQqHnoXpL0SqLGdGGgn7DQeVMSYWHfjno1FngIKP9cjYaTlcRP6bZunjHP13/lbVm4awti894pTf/ZNNqr4OR+tDVie/m+rC8QpVnRbsCMPukOH87B2jM4AG6pHuXl1x9SiKdhYJVOhfo/+SCaGjUW2CoogL1FFhFGN9o+acoVLl0SXs/3vrSccmZeAF3NewFuOg/P12QYKQF+SH+KYcNnsAhIAELPBUgre/KRUJEA+KPD0MHRjv+3J/j2Z23MuJmkfy7leWcMsti8wXLSHgXFJTaksx1Woi6oljwxFVIJG12SBSZLNJDbXMYPekmiXT4FclKI35BFgqnYpKfcsr+f8HUXQoHJ9UYZ4J5YMiHHyAxg6eidhodgqJ2Htf/xYEx+G0zXchuzlt8hcAl+AT8NCQ4orFc4DerabF1enA7NTLnvtZh3FUwqIOvY7Q4DYmoDHwXTSw5UNNh6r7j0B/ezMYJMDcw4+6gCTZX4YQ+7Xs8de72vsR3cmfpxIX64/6KR1p3VX4F6vfHEzxzarh8aDH4G1DFoBBM6npXFpK+Rh+WrcFclAeAxi0PoaR9CpOxxGLSdvxKVSw8oOOanG/soKImRopN38AdcUhhM2GT/PgQeSQrG12njuJJD5Z7vWfAZmFybYLdSA91kB4aoBhoj1Z//KNIVVujqaLLRwCkbyn4vh0739C9V9iSjybeOIeSOvNs7LW1a7EUtNoKAnOGML4U8KBXpfrw73WjAszJG4Qscq+Xr3kZWR4Omm0xT6qE9y6FNSpstV4onMZSqCEJ+3VX9qjvdx5QVrM0WXxmPZxejdfnihcFAjzv5PjlTl6ickDbHe6+Lch52pjOPqk+m3RZ+bh2JSMGtFBuODbMchrpRVlt16NTQ05Ps0IDtWlUmWfP2vX8M4YDynIuOZ4Ck91+591B98Gw9fw+yQogTR8CSg0zaJu+rlBo/mr3A+1NziF+kdubz+whc857AZt6DwIBIF5+5yiaaf3ByQp1Fm3sOkZDAzwsYSQTM/Kv6idkugF63FDobDdUY3huruU+sCaBuRR+HmOowvmZoBjZHNh77SXFtmY/oOUE7ifN7nBHAo83S/xvcS6H4Ci2u/9Id62Wv6Ui+zMNLAzhfkTkVcW2BwrnYvpur0ZDlzs+ZLsmGTWvd1892t78gx1YjEJusGcxphjLkV0UfAKlekfSBVWHE2ahk4AbbRmHyL7GYdtKfdlINwrcdJuf3Cee1nfUojDQn/YmItESOFhtLzrkEv4k2XpMU9oaJQ3VUC+1INh6BE68pkHameGJm4Gvdb24Q0fXWxd9Tp3A9mzFSe4qXDGGDIV4AAGV1jIDfveknH1TwWpUT6HiQxKP3AAHJNkJeRlj/mXBmS4S1j8FK6YmpK7jyyAiRbsMCCLoJcx01fvgpMvKQRxu9IOwymconQjD56g7ksOrcOeoTbius4JnGesAS1DtgdaophYsw1wGIsMS3P7K6doE3K5czznqPQLSRRF/Ylzb5NtSKsL33SgskFNCF4khn5LWaDxI23ZRi2hzqN8uW8UzZEBYy68+VtGLSymQrXGUlr2nO2BbBIT5Vh1RmGAyDXaW0FPrpx3wv2UYdFk9tSl+906bMxCuXQaKDQP/U19UEcVGK4gmksL8lAorxQSAOwpeYX9xrZsh6yoGaL/X5O3tgQC8OM+/GvxnW9XvAtu/JxAigydfSmZfqZfg1XOcHNOpLlN8j64OZ36l5qawDBJ62YaTvxeNmm5gowCdBosgcpHOgNgwA+sknN8XmsR2IYChcafl9bGNMZ/nB5guWuvEziv6QI2bP2DtyKWG/qUjZMaxy+wASkkVGtuwGtywkTYG6MYrZBo18vYcww48G/+f+eITA/qMwbLlJC0S3+/ai2pPvkOhRRVmGTuSupaxhIk0xoXLtixCxSAn4Z3OnUS3wBqVscLI4P3GP7i/6gxYsswsVmkvDXFLhO/OKcur8flegCSKiqmVpIRvCzgbjEA0mXPn+RExXY/2OE1f/BYuWpRQY8gCDpMOYBx9Gn4tL3hihSIR1ixh2PIIT7cr2gUJbfs76EKYG52Jk0UZF/PQkBxGuFCEWXnG6ue/hTIqjTRq1sotVrKrwIGHDrITyuanUzbIYdgdEeV88K1VD82TYB2B61Ft+tB1KqHPmT9+hWoaV+iF3SuvtJqvnoLaA8wxrD56AUMULEgzO9SvBcBAfqz/dzMYzwMt/YLszDbmGe1bcHHfFMcvGql9bf/tp+Hrj4q18aNnftGjmXTfws39emn7/5IBxog9MrmftAA5Oq4awenm8HimWO72dwVlHcHmutVMdrMHw+p2vzpzT+B0iIZ+IEpplwWhClcXlxhxAsF3CHRnnaUEqq3ByQ+cqhe5SvR4SFxh/LZoQwtj8QZQGT1BzY2EMpYnUcZWQEPlwFZw+7UryK9qV8KgruYsvyMoK16KI2sN4SOblrVwhyiL8+IBZ8cpUhsJQSU7TFHAi+L2F0sn0y+FtDODlnuif2Mba8QddPZYYxjTsIgkMe3M6+7kXxUfZvbCUlyq71J1eNczGk6Vqw6rSx2K3vM+DjLxDRGzWepTO2qTT/W8S7u0QXcyFUahcB4vq8xCYTpy8iswtnyz7Kx6lgTEQJ9RqkgEIN6DOUqB0uRdeYuDa7AP7Zy9z+ZlTsmVR5vtV71m3dmdtNeWghbr5PnPJtjXAzcvZjxyV96VEx/B1TA0IEQSI50ywGuIbmAYdQg/l/rxhQLX+6uOLyFsaUt6mtjpAJkLfehnB6MlOHnNOrWLvCBqVBS07jcM+4RzLEed3f3/0Xwp92U+nataNHyEgnnuYR6PXEjRLETz0xrt3UglfK7Bn4aNlXG7cZco4lMziLv5+Mh2JCww3mz69Z9ZMRR/xv5EKJ38IFxKd9dw5CgPIXja/gzAshMbF14/qBIgNkdUQeP8YE7SrICGtiTnAKTyA9cXa3OauDHxZOdTP7yuYBzD1UcHstIO16FxF1bRUAlSkszI83YufTchU8OPnnozDl9bS0y6CnnjGwgj9M61cXcZsljjhLeT/Vq+30ScN2PcT/dOoxUDqDS38+OpCCzLDdnwHQc3ECQVIkaxmdPaZTSdfp2jjGzSdNLM5yPQsgJDl+ZnhclDQi8ltUnkqWJ323IvTZPN8rn0+EshL1cx9PiaLTzUsryn9Zp2Nt/detUAh4N/2I3dlMQqjHFxSihv0uykzflq5clMy2ZBaxoEb0/QMp03IQQus3vnZd/NOmSsmgqXqKFP3ozyDgY7RQS+npabe/hNG+5sa5FtvL8v0uYuag2NewYkcol3TOTadpuncCnDgOGpmLnTQ1PEPUN2cNsrW8LYfIv+hzfb7vod+ipXHzmbgj5Fzc6RcT/5PD7VQ8nTJBNj1urkVUx9uJvTWmqY08OC80rGDLaWXv243VB16gjt4Xtwp5H2UDR0LiKW24Ed/sOO8jl1yEU/XAb3h7ScKnCFy/V3sICrkY1D0K9fSokHIL0s5/7DLShLAPXRbV7fbv4qj6OwHC9d5PlEOX3LRpQ3P7hcSAKlIKPDM83ypz56U5+rJeo0cyUtC7wltL8wqEiNSgZsDWzACc7RFoZqhlD0+sihIBQlkQTXmvUyIOZhkQX2zqME5VRC7ms1sa3CY+odMn3mMBiTvCMKnnCxg5ZPLq4GUDB4jF8Br2K4x4sxfWjGXQatJ25I1JyrIv2Z4bP1jKw5C+B2/s0v4dGUOsaS6IPIQV3ETQ+F2fSl2BPBXHzyYN8VmwWIrKeMX9pyGWuAOVXwkxJsRBaBVzLhZDP8ONGncknL5DpTxHN32GgFWMwsc0GmL0oRDmRT8u2lvjAKUIi0MmXhIHSlFeh3Qh5pP6ap4YUd6b569ZIaHgya2AyD12cPxY0In/PBjzDctTaKJCU+xc6m9RkNLDEE8guvxtJP8sl8N9bLqw0F/qejaBlcHYqw31zYpsutQp07hsP1vhGdl4hJ1wA7OCsAHnKj9879uSHILEmuZ6vI1lT4tvnWCVKZhhYrWHW9oPKPKpbOC6FTjf/OtUvwmiXr2ykvyLzHGQeyS7BenZpL3N/CaF5T7Gkml7JXN5cj0PKaDpZVImD61FuMgFHPqSHvt4Ej4KBdAfdcoO3AjQPLwwtKsgGM+ty4lNZMBEItJSRLunG5ckrM/BeoXWoPZVvEoIzLgFQYPupMwZCXis4W2SCJ2zsefZqCj+aTfSq1FYdUj2UeJALvVTf7vuuikOE1Hit3UIAGUi/sqgMum9vw218y1FlY/9XnOji9nqhGAcMYICc7BiqLZj5N+cKEuSAuiyWbMg81ZD1lHovy/we2eaCcCv4MzEW3O0mVA/t2xdA0cxTVbXmFhn+tARDpvDz5ftLr15OAAmvo2QiAky+feVO4bGibv2nlBmBzqx0lEDfEm4UnEs11pbnwZlJ/0Y73/wBPYfTNZiJKR73TzdCW1BffiJq9bLjQmaKnU0+gN8sfe25IKSUCooQwxePDrFn3a/zUgWxvPoTYVXfobY/GV2qqTkeVDV9D8657fhY0/wiaJ5NfLxhXbE/naxs34N0hd6vxNfdm1TCnozm/NKSCThchoYgMF7Z2tzXFovRfsNVkf86JjrM60r7UIuV3bsmfrMOqzjXjN6HPBG25zCJ3QLueySbj9oFvX/HxWBqh31PBPxduCVAxMqC9HK+YL3oBZqBruoh6LKvdMqoz0PYXUBrwbiioyE8Tj5ImjJmiOOWLbAZvIZ/l9rIPljx3T5glJ2ewlfuIT5GlodQsAf/IEtmYkML5SRQGxxwW+rlZkD8belJNu09Itwx9xDULTnemVDeojdbgcd2gKGM9aO00Jivtbs7ZyOSE8IPh98GfvatD8Ud5uHcZfAfMiPSlIxd4UqeSDzuNfbKDuFepkyC/s3j9fawmhY1b9NqDi0ZS5eP35l7rL2eK5QlWLlyCmxx8AFaFiTuD2pMUxZV5mBSJuJduOaq2ZrWpu28DE8jl/hisBz7bGWH6qLF0ayWNq1Sejtcs8KQrQqJk5P9QHDYHOIolgNsMDmEaWcTelghbfFCDqWrq6YLwDWy+m68ec5nShgq2fduUBpQUuKKKgnttaUX9PRfMmxqJyU7e0RLr1bev+ge1KK0bZyhHKKDE8gQX9Vf7rNHWOxBtZcxwwGusyMpH77qWZxXsQmbgIGhtiO+gSSRCyu/ek+OFsz1HMiQH0IHV7PjJi3dszYfFp8ue9h4+AfKte4MTiehPvxNcm/T1t9vsFZx8rHN5ie77r2jzZOq/Em4Q+H9sNcZakf9HnzCc1fJixppxP8FQABmVnqa6GbJhwaka7WH7Wdoz1WxOjSNV8N9sgW5S3Ppgkut+TTCkjA+AodUOk1KIR+8G8S3WrSZG4nyqfJ6FEjXl6a/LEoRMHZUqfPRWvwqrtXYy9IUsmUGzkqi76ib4NANCe5DnyOxnFRZ9d8FdBVBjra3iNuZhJuWW5Omi/hBigqDsg0mu2AhfJDXdwyMIJ33HHHPfS2JtjegRejX11m41TbNL+Qp7mR0g9CPKTj9PIjuSycGN/YPozXI4zarXuAeLv5CHKtKcJKRbd6R2oLNiEt0T8+QIVJH7zt9ncKMgd49vV2P1AyScZ9Qzbu3m3LBnuu6dw7aE0b6r4kzVkI/GUS88mA53L/rLtntkFlZXGtIoqNP2mD3eVv08AVVPT3wJn81zpbJV9SuqZ6Pd1ge0Zz2RFHeCdV5CLPftH9V5o9+VzFu4R0QeumqDwUhXn3IyYotdJnxr1l3BqWnQVAeDBEOtPyJQx1q5+mODiClXtYeBLTWtsJ42AMBcf/IFIhpfhYO08hsg0Ik+DpQFNOKReK3o3cudkxWX0soPtI5eSFOA6yNylS+IQjrQtYQ/5s4UcixJfokumBUjpH9ofSjUTwPCapGFndfqqG5IHeMMvfg+88SXm7bNyjk6pGKzL+WxDAdqKtQ72WWVbOk3I+ueGuammmB2pvFZvqIcU/lvW3n9+r2lycnQLE4OX9R1jIgW4cDjJ3v8dAa66mVcfC7ptCr5io6mCaA9qI9T9FFWqo1ZAaMxgxAu8aXqmaOYryMND2sTUfoHvxcYK7hEiJhCLYFDx3PBhE97c2a0ub1/ePJcyJOqr7UaTAPTJ+xvZtjb/40sloY1ltRnTkWILmIP2b7S3AdXCR+YiArMUHwdncpjpyDGfzqGOUoAuaamWzAMacQtb34/M32FEgR5lUEf8fRzFrZUhzQj0fR7/6gdzdnVVvcSneLmtqJ930VCCDORY8CVdQWdo/S3PNkX3pQsPVKWIYGAMrFZoq8bQ/OJBDSXP7KSBdL3QN0Zqd393p6VFc7DnlnFiN00SY5Nux7yadeIM0Upl2rVsu8/VAI";const Hge=new Map([[8217,"apostrophe"],[8260,"fraction slash"],[12539,"middle dot"]]),Vge=4;function Vkt(e){let t=0;function n(){return e[t++]<<8|e[t++]}let r=n(),s=1,a=[0,1];for(let F=1;F<r;F++)a.push(s+=n());let o=n(),l=t;t+=o;let c=0,u=0;function d(){return c==0&&(u=u<<8|e[t++],c=8),u>>--c&1}const f=31,x=2**f,g=x>>>1,v=g>>1,w=x-1;let C=0;for(let F=0;F<f;F++)C=C<<1|d();let N=[],P=0,I=x;for(;;){let F=Math.floor(((C-P+1)*s-1)/I),U=0,L=r;for(;L-U>1;){let ne=U+L>>>1;F<a[ne]?L=ne:U=ne}if(U==0)break;N.push(U);let z=P+Math.floor(I*a[U]/s),Q=P+Math.floor(I*a[U+1]/s)-1;for(;!((z^Q)&g);)C=C<<1&w|d(),z=z<<1&w,Q=Q<<1&w|1;for(;z&~Q&v;)C=C&g|C<<1&w>>>1|d(),z=z<<1^g,Q=(Q^g)<<1|g|1;P=z,I=1+Q-z}let R=r-4;return N.map(F=>{switch(F-R){case 3:return R+65792+(e[l++]<<16|e[l++]<<8|e[l++]);case 2:return R+256+(e[l++]<<8|e[l++]);case 1:return R+e[l++];default:return F-1}})}function Wkt(e){let t=0;return()=>e[t++]}function LOe(e){return Wkt(Vkt(qkt(e)))}function qkt(e){let t=[];[..."ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"].forEach((s,a)=>t[s.charCodeAt(0)]=a);let n=e.length,r=new Uint8Array(6*n>>3);for(let s=0,a=0,o=0,l=0;s<n;s++)l=l<<6|t[e.charCodeAt(s)],o+=6,o>=8&&(r[a++]=l>>(o-=8));return r}function Gkt(e){return e&1?~e>>1:e>>1}function Kkt(e,t){let n=Array(e);for(let r=0,s=0;r<e;r++)n[r]=s+=Gkt(t());return n}function VE(e,t=0){let n=[];for(;;){let r=e(),s=e();if(!s)break;t+=r;for(let a=0;a<s;a++)n.push(t+a);t+=s+1}return n}function DOe(e){return WE(()=>{let t=VE(e);if(t.length)return t})}function BOe(e){let t=[];for(;;){let n=e();if(n==0)break;t.push(Ykt(n,e))}for(;;){let n=e()-1;if(n<0)break;t.push(Xkt(n,e))}return t.flat()}function WE(e){let t=[];for(;;){let n=e(t.length);if(!n)break;t.push(n)}return t}function $Oe(e,t,n){let r=Array(e).fill().map(()=>[]);for(let s=0;s<t;s++)Kkt(e,n).forEach((a,o)=>r[o].push(a));return r}function Ykt(e,t){let n=1+t(),r=t(),s=WE(t);return $Oe(s.length,1+e,t).flatMap((o,l)=>{let[c,...u]=o;return Array(s[l]).fill().map((d,f)=>{let x=f*r;return[c+f*n,u.map(g=>g+x)]})})}function Xkt(e,t){let n=1+t();return $Oe(n,1+e,t).map(s=>[s[0],s.slice(1)])}function Qkt(e){let t=[],n=VE(e);return s(r([]),[]),t;function r(a){let o=e(),l=WE(()=>{let c=VE(e).map(u=>n[u]);if(c.length)return r(c)});return{S:o,B:l,Q:a}}function s({S:a,B:o},l,c){if(!(a&4&&c===l[l.length-1])){a&2&&(c=l[l.length-1]),a&1&&t.push(l);for(let u of o)for(let d of u.Q)s(u,[...l,d],c)}}}function Zkt(e){return e.toString(16).toUpperCase().padStart(2,"0")}function UOe(e){return`{${Zkt(e)}}`}function Jkt(e){let t=[];for(let n=0,r=e.length;n<r;){let s=e.codePointAt(n);n+=s<65536?1:2,t.push(s)}return t}function hN(e){let n=e.length;if(n<4096)return String.fromCodePoint(...e);let r=[];for(let s=0;s<n;)r.push(String.fromCodePoint(...e.slice(s,s+=4096)));return r.join("")}function eTt(e,t){let n=e.length,r=n-t.length;for(let s=0;r==0&&s<n;s++)r=e[s]-t[s];return r}var tTt="AEUDWAHSCGYATwDVADIAdgAiADQAFAAtABQAIQAPACcADQASAAsAGQAJABIACQARAAUACwAFAAwABQAQAAMABwAEAAoABQAJAAIACgABAAQAFAALAAIACwABAAIAAQAHAAMAAwAEAAsADAAMAAwACwANAA0AAwAKAAkABAAdAAYAZwDTAecDNACxCmIB8xhZAqfoC190UGcThgBurwf7PT09Pb09AjgJum8OjDllxHYUKXAPxzq6tABAxgK8ysUvWAgMPT09PT09PSs6LT2HcgWXWwFLoSMEEEl5RFVMKvO0XQ8ExDdJMnIgPi89uj00MsvBXxEPAGPCDwBnQKoEbwRwBHEEcgRzBHQEdQR2BHcEeAR6BHsEfAR+BIAEgfndBQoBYgULAWIFDAFiBNcE2ATZBRAFEQUvBdALFAsVDPcNBw13DYcOMA4xDjMB4BllHI0B2grbAMDpHLkQ7QHVAPRNQQFnGRUEg0yEB2uaJEMAJpIBpob5AERSMAKNoAXqaQLRBMCzEiC+AZ4EWRJJFbEu7QDQLARtEbgECxDwAb/RyAk1AV4nD2cEQQKTAzsAGpobPgAahAGPCrysdy0OAKwAfFIcBAQFUmoA/PtZADkBIadVj2UMUgx5Il4ANQC9vLIBDAHUGVsQ8wCzfQIbGVcCHBZHAZ8CBAgXOhG7AqMZ4M7+1M0UAPDNAWsC+mcJDe8AAQA99zkEXLICyQozAo6lAobcP5JvjQLFzwKD9gU/OD8FEQCtEQL6bW+nAKUEvzjDHsuRyUvOFHcacUz5AqIFRSE2kzsBEQCuaQL5DQTlcgO6twSpTiUgCwIFCAUXBHQEqQV6swAVxUlmTmsCwjqsP/wKJQmXb793UgZBEBsnpRD3DDMBtQE7De1L2ATxBjsEyR99GRkPzZWcCKUt3QztJuMuoYBaI/UqgwXtS/Q83QtNUWgPWQtlCeM6Y4FOAyEBDSKLCt0NOQhtEPMKyWsN5RFFBzkD1UmaAKUHAQsRHTUVtSYQYqwLCTl3Bvsa9guPJq8TKXr8BdMaIQZNASka/wDPLueFsFoxXBxPXwYDCyUjxxSoUCANJUC3eEgaGwcVJakCkUNwSodRNh6TIfY8PQ1mLhNRfAf1PAUZTwuBPJ5Gq0UOEdI+jT1IIklMLAQ1fywvJ4sJzw+FDLl8cgFZCSEJsQxxEzERFzfFCDkHGS2XJCcVCCFGlWCaBPefA/MT0QMLBT8JQQcTA7UcLRMuFSkFDYEk1wLzNtUuswKPVoABFwXLDyUf3xBQR+AO6QibAmUDgyXrAC0VIQAXIpsIQ2MAX4/YUwUuywjHamwjdANnFOdhEXMHkQ5XB6ccMxW/HOFwyF4Lhggoo68JWwF1CZkBXwTjCAk1W4ygIEFnU4tYGJsgYUE/XfwCMQxlFZ9EvYd4AosPaxIbATUBcwc5DQECdxHtEWsQlQjrhgQ1tTP4OiUETyGDIBEKJwNPbM4LJyb5DPhpAaMSYgMMND137merYLYkF/0HGTLFQWAh8QuST80MnBrBGEJULhnkB78D8xrzJ+pBVwX/A6MDEzpNM+4EvQtpCIsJPwBJDqMXB9cYagpxjNABMYsBt5kDV5GDAm+PBjcHCwBnC4cFeeUAHQKnCKMABQDPA1cAOQKtB50AGQCFQQE9AycvASHlAo8DkwgxywGVLwHzKQQbwwwVAPc3bkoCw7ECgGpmogXdWAKOAkk1AU0lBAVOR1EDr3HhANsASwYT30cBFatKyxrjQwHfbysAxwD7AAU1BwVBAc0B820AtwFfCzEJorO1AU3pKQCDABVrAdcCiQDdADUAf/EBUwBNBVn5BdMCT0kBETEYK1dhAbsDHwEzAQ0AeQbLjaXJBx8EbQfTAhAbFeEC7y4HtQEDIt8TzULFAr3eVaFgAmSBAmJCW02vWzcgAqH3AmiYAmYJAp+EOBsLAmY7AmYmBG4EfwN/EwN+kjkGOXcXOYI6IyMCbB0CMjY4CgJtxwJtru+KM2dFKwFnAN4A4QBKBQeYDI0A/gvCAA21AncvAnaiPwJ5S0MCeLodXNtFrkbXAnw/AnrIAn0JAnzwBVkFIEgASH1jJAKBbQKAAAKABQJ/rklYSlsVF0rMAtEBAtDMSycDiE8Dh+ZExZEyAvKhXQMDA65LzkwtJQPPTUxNrwKLPwKK2MEbBx1DZwW3Ao43Ao5cQJeBAo7ZAo5ceFG0UzUKUtRUhQKT+wKTDADpABxVHlWvVdAGLBsplYYy4XhmRTs5ApefAu+yWCGoAFklApaPApZ8nACpWaxaCYFNADsClrUClk5cRFzRApnLAplkXMpdBxkCnJs5wjqdApwWAp+bAp64igAdDzEqDwKd8QKekgC1PWE0Ye8CntMCoG4BqQKenx8Cnk6lY8hkJyUrAievAiZ+AqD7AqBMAqLdAqHEAqYvAqXOAqf/AH0Cp/JofGixAANJahxq0QKs4wKsrgKtZwKtAgJXHQJV3AKx4dcDH05slwKyvQ0CsugXbOBtY21IXwMlzQK2XDs/bpADKUUCuF4CuUcVArkqd3A2cOECvRkCu9pwlgMyEQK+iHICAzNxAr4acyJzTwLDywLDBHOCdEs1RXTgAzynAzyaAz2/AsV8AsZHAsYQiQLIaVECyEQCyU8CyS4CZJ0C3dJ4eWF4rnklS9ADGKNnAgJh9BnzlSR7C16SXrsRAs9rAs9sL0tT0vMTnwDGrQLPcwEp6gNOEn5LBQLcJwLbigLSTwNSXANTXwEBA1WMgIk/AMsW7WBFghyC04LOg40C2scC2d6EEIRJpzwDhqUALwNkDoZxWfkAVQLfZQLeuHN3AuIv7RQB8zAnAfSbAfLShwLr8wLpcHkC6vkC6uQA+UcBuQLuiQLrnJaqlwMC7j8DheCYeXDgcaEC8wMAaQOOFpmTAvcTA5FuA5KHAveYAvnZAvhmmhyaq7s3mx4DnYMC/voBGwA5nxyfswMFjQOmagOm2QDRxQMGaqGIogUJAwxJAtQAPwMA4UEXUwER8wNrB5dnBQCTLSu3r73bAYmZFH8RBDkB+ykFIQ6dCZ8Akv0TtRQrxQL3LScApQC3BbmOkRc/xqdtQS4UJo0uAUMBgPwBtSYAdQMOBG0ALAIWDKEAAAoCPQJqA90DfgSRASBFBSF8CgAFAEQAEwA2EgJ3AQAF1QNr7wrFAgD3Cp8nv7G35QGRIUFCAekUfxE0wIkABAAbAFoCRQKEiwAGOlM6lI1tALg6jzrQAI04wTrcAKUA6ADLATqBOjs5/Dn5O3aJOls7nok6bzkYAVYBMwFsBS81XTWeNa01ZjV1NbY1xTWCNZE10jXhNZ41rTXuNf01sjXBNgI2ETXGNdU2FjYnNd417TYuNj02LjUtITY6Nj02PDbJNwgEkDxXNjg23TcgNw82yiA3iTcwCgSwPGc2JDcZN2w6jTchQtRDB0LgQwscDw8JmyhtKFFVBgDpfwDpsAD+mxQ91wLpNSMArQC9BbeOkRdLxptzBL8MDAMMAQgDAAkKCwsLCQoGBAVVBI/DvwDz9b29kaUCb0QtsRTNLt4eGBcSHAMZFhYZEhYEARAEBUEcQRxBHEEcQRxBHEEaQRxBHEFCSTxBPElISUhBNkM2QTYbNklISVmBVIgELgEaJZkC7aMAoQCjBcGOmxdNxrsBvwGJAaQcEZ0ePCklMAAhMvAIMAL54gC7Bm8EescjzQMpARQpKgDUHqSvAj5Gqwr7YrMUACT9AN3rpF27H7fsd/twPt4l+UW1yQYKBt2Cgy7qJpGiLcdE2P1cQSImUbqJ6ICH27H4knQMIRMrFkHu3sx6tC35Y+eLIh4e4CMKJ4DfyV+8mfta499RCAJ0xfeZR8PsoYOApva9pjGn4PhvyZS7/h5JLuhaucfjuU+Z584wwqNO4hWYmaBCcjgQPale1bjoHzMUbut/zTgxHxBnAyrdKpF4IRMASLBtD/jviyLeCgj8twWjAd3HchN/uqaeRYeHJgl7JEY9/cTrvtfybx/r3Y/NtxJ9dp+MTVmiS9bwBH73s8Di56/Ma+mTPMHq4T1yEG1fWcqr0u+hrGnJEvU1JJAm/maQSrKrazIyvSkDFkj8UUlfBq8baniTGPng6YZRL661rDNw4w/1g2figG0IhXnL7wosd/sVNo5dYSmMBTP5c7rYLjRdCwg8quwljOMPf63D8ICAL0r71XRiyFHdgwHbwfgnPOf4Lzjf2v+j+IiDHG2isp5yUnzSDyDRb4i/Vs0qHSHq8PiEQ/JnBP7PxnjN0j6gT4AVAeRx/1o9VnEUlUwvFrzJqHk9jxAw4sYxCnrxaeBdCFFKbnE7z+x54F5W7ZZsU6kx8Qocul6FoAHHy01FGL/nne61mn4+uYXfQ1Uccn+HMLKE+cZzT8BB1E3FRskOgJrRsq25rauLm8+uamXpkS/bTy6y1wDbCrW4eD532kTWrtNUmVVZOIn/C+/JR9KVR5iG9TY8iaT67ubm/whL1xbKZoqtY+a6fNxMJrg211bGYJDUkYMNWA0BMB++9zOm6Eik4roqs9CCEFW0lyAK0PbvlzvoxrZuY/OEhNW/l/63U15Od/RSvmDvXpGLiVmeGi5PDSH2bYz5o2g6wFDQ2FbZgYgTF8rPlvA1ifjZD3NLtFdXdpSIJvgKR7GpjJWG7GZGawPomIH8B5tUmtHH9LpM+/KQKunEPa1GiQkCXv4Cnm9DLORo2joicHdPDZ64obQrPZ5bgqckkj0G6/NEiPYBY4bCkL7W8G5YzsUb6GakFjykSPkT7JGeLeB6uJOGMm+x7N381BCDfbJFx0dtLgV9Q477BfL1fvitX5anV/oYfxeYl+eF5x5bB8+Ep/L2nsmd56aKF4aAD4GbJWsdKyBW22xEmAD3XdbtsMyAFoR5mOla0gEd9U/YVB7zvHGpHbQonay9Sv0bQ8iZ8piaXVrKc5AG1AmqqgaEvzHSP2Wux7aZTWh6quVDVU01JtMIVRdCFwlSbbqqhoFlyzsotQzRexFvZ/MqUSFu3OhRIuNBbufvBpdVgb8XdGJ48/lJPCZ7dsOujTTbKPSEvGXkOnG2Xdi8/nM3EMRqITd5QeU7iOjKqC7URJY6TnLsHij22xAHKnVRD5MDtBYnoGFqZGMDmXCW6Oj+BAWw14hESY/xLF6bLku06AHkiXTHPCFZ0f9YSqqo27eAhhS67OrA2Het4M9JM3jm/yRX6bYxnfmzYl5qQdHxN08FsNuWDrWd4vMUY2QD3hr8vS73SCTkFoXZR3xNzOQt8d/6HfjBmXqvrE6EGkLzK6YK2U2/ksU/iUH+LvVIsJI+ri2AL/klo+ShdDyfs5A83i2prkMs51IKR7ZcqjZJi5X3+bd8GlyWvtddxKEoEqSgEO7A8jIgf2nH0h8FjM7oB6yte3X5mpL0i/E4Rx0CotKnILJj/vJqo4VkPQ93jRtRVfaitQPqldl5xRYPq8387Z0DcnZvOeION0Ht1+P27kFLGQIcLBX4FG3sffccNHh5cPfzp9INoRtqVtdViJfg8RjnXiIz/MNqEN6zvzX3hMzyWC7oSoXIT14ubc0abPX8Rp9GVa5NI/8iv+6ela1oTncbdimRKnrbRffDR/X4nH+bgqAuHWl7hOaeXPWVzIeRl7ga+JzD4Sx3mlj/q6Ra/E2HhDf21eEzTLNGfCZsY+/yxZzQzIAuijG65ii4O/waAJCrEJaWd/DRAKMQ5678Dw5AT7RCKzdadIwd8LsD+DgPBASmWsUlf8R0k1w/2k4lO2Wpb4zMI6EJVJs0xk/wn8/fRUPqrDKhbjHR41SqgFMx5RGMPuduFwlu5lK89tW11sTqiX/5EfGs5nO+y9FKvgXKPOEmgE05EKNL6Sjb3xS40H3BVPhm0ESOZgAjZoymc8be0inDVo4JdJVf+NKd3tN/CaB7GShhH27qf95NoFZVX/6ZkR2lX+CgWrQ2INgkh+bbMz68+uJ3Clsh8HSMPEQtAt+BBE6fXDab7KIlsKxU1lIXW/KWVstpdPanJ0pdXpQinDyUQjtY7ZVcfiecRxRDMAUhHFU2cEaciQ+htiPMPx1kdvtWG9T44w3r037ljHBFJdYR0r55qvMRixtAEFJAqA4T1ES87FAx7UozXasytg8MftZYt0rjYgLe6EJ5aWvy2qscBSBQ7yehoJIA3wIIZ9ukfkyBb6qnue5ko8W50rpV4kXqWjI5nbGRXrNW0tBZHXlY48nSgcUXBHWT4GcgLZJoLlKJnV96kCYpq9eWHh7xJzkCAyrQuQ5AJ0qq/uZ3toJglNterev+Qm0KXxPg/+YbFRJdfhbp1wOnVOEYdVHTya6CtO0afhEaBhx3oHwCb5Kq6RwHDzFMl2vfjL8GwzcCoTj7wZe+UFnYDV2yKpPU9dba29gYBdNqJg/KXozO+CJTlKmlKhnqTf5doeS35DZFV+cYJQVjd+oVY/Gtc/6XPzUxb1gMqf6cEjNNoRC8AObrp+fx0cVtGu4ffC2TgXRC8zPl8moUHCB5HZ25d87mlsiiK0aNwBtcEQjRNBT/QrXbw/8aVXdKMHn9EqYEKEyxSGTpYQOaes1G1Qq8pDgqkZtlO2HRyCXpmeM7TSrRPkAh004BfisVpF6zP44n2Jvxz/gOVocNCyy9V6lkod28QM4pbaMvVJigD/w3BrsjSJrXlqc4ulBYOCceiBN4b/gHajYyupbhEt63a619Ay4wsL6a6w6B+A7TnoyE7BliWHJfzVxxIKM/W3M/J8Bx99Op863Q8eNuIMGRx++VbYfjm+VGYBA3Ap/KEu/wxBNBpJJncwHPG45V8Gh98ZIrGCc20MwijGowZbcS7d1nEgcOW5cddZpHL2XPAIRbColiheZzXTvBxZOY3iMSDSKDrICyJ/iQs1vdplVdH/JrLJsQ2jtTnfCrITIghq3KFX3qAgLWAIp8IffNSdTYptnbGfc8s+qcr3zyzyHp1aJg+jxTF4kD1ry5Wauv5V3xnOGwTFecNzXSLHBW20/pCQjk4uorD0plIhMSTc79+/r4RKPClRYTBYex1Ob5crtfvRQBBv6re/6FhtCqtduag67glqRA77/3ulblh9YRtMdDxkCyJDeNnAuCLPQFmdRRWJtH20Z8DstfJf+5oj5SSB64d0iF5/Ya4KfTWxfivj9Ap2/zbYaTo/1gO3tM6RYsCZharMBFr7Fm61mLSrQnEI4OF1gbVS4k/JE9UotOrnLJZuswoWodCSV8zbybkJSVIP7n8UaE9xCR39rJZmf27HOAPVOGc9pdkQUcRrI0qyVF9Z3j1RHDbxIfwbWzmPVjwIdPJvtmBYwEQIUsIW1S939hcVikK00ozPRI02cqhzVUNzpOxVdrwRPvlh1aIOf0xFEqD3YkGnCnFah/cFN3J2gB7N+bZSGawwkKFu1tpQMrp1W+27YNkyT0TpcFpTqgOqqLabrgcCUPxh97mREOGy4xItzQ9xSl6rq+8BZsHcrQFReS+QeMxJ3P6CnL9EP/eOLDjumLhvrcQrpPiknsofbzBv9gTP0lU+TIVwE6E7CcKfT36q+ZiEOHJ9ayf0dyUJLezAb2M8aNHwd0+OJmsVgTzRWA";const qE=44032,CR=4352,SR=4449,NR=4519,zOe=19,HOe=21,pN=28,AR=HOe*pN,nTt=zOe*AR,rTt=qE+nTt,sTt=CR+zOe,iTt=SR+HOe,aTt=NR+pN;function Sj(e){return e>>24&255}function VOe(e){return e&16777215}let $ee,Wge,Uee,xO;function oTt(){let e=LOe(tTt);$ee=new Map(DOe(e).flatMap((t,n)=>t.map(r=>[r,n+1<<24]))),Wge=new Set(VE(e)),Uee=new Map,xO=new Map;for(let[t,n]of BOe(e)){if(!Wge.has(t)&&n.length==2){let[r,s]=n,a=xO.get(r);a||(a=new Map,xO.set(r,a)),a.set(s,t)}Uee.set(t,n.reverse())}}function WOe(e){return e>=qE&&e<rTt}function lTt(e,t){if(e>=CR&&e<sTt&&t>=SR&&t<iTt)return qE+(e-CR)*AR+(t-SR)*pN;if(WOe(e)&&t>NR&&t<aTt&&(e-qE)%pN==0)return e+(t-NR);{let n=xO.get(e);return n&&(n=n.get(t),n)?n:-1}}function qOe(e){$ee||oTt();let t=[],n=[],r=!1;function s(a){let o=$ee.get(a);o&&(r=!0,a|=o),t.push(a)}for(let a of e)for(;;){if(a<128)t.push(a);else if(WOe(a)){let o=a-qE,l=o/AR|0,c=o%AR/pN|0,u=o%pN;s(CR+l),s(SR+c),u>0&&s(NR+u)}else{let o=Uee.get(a);o?n.push(...o):s(a)}if(!n.length)break;a=n.pop()}if(r&&t.length>1){let a=Sj(t[0]);for(let o=1;o<t.length;o++){let l=Sj(t[o]);if(l==0||a<=l){a=l;continue}let c=o-1;for(;;){let u=t[c+1];if(t[c+1]=t[c],t[c]=u,!c||(a=Sj(t[--c]),a<=l))break}a=Sj(t[o])}}return t}function cTt(e){let t=[],n=[],r=-1,s=0;for(let a of e){let o=Sj(a),l=VOe(a);if(r==-1)o==0?r=l:t.push(l);else if(s>0&&s>=o)o==0?(t.push(r,...n),n.length=0,r=l):n.push(l),s=o;else{let c=lTt(r,l);c>=0?r=c:s==0&&o==0?(t.push(r),r=l):(n.push(l),s=o)}}return r>=0&&t.push(r,...n),t}function GOe(e){return qOe(e).map(VOe)}function uTt(e){return cTt(qOe(e))}const qge=45,KOe=".",YOe=65039,XOe=1,jR=e=>Array.from(e);function GE(e,t){return e.P.has(t)||e.Q.has(t)}let dTt=class extends Array{get is_emoji(){return!0}},zee,QOe,ew,Hee,ZOe,u4,AV,AC,Ev,Gge,Vee;function Doe(){if(zee)return;let e=LOe(Hkt);const t=()=>VE(e),n=()=>new Set(t()),r=(d,f)=>f.forEach(x=>d.add(x));zee=new Map(BOe(e)),QOe=n(),ew=t(),Hee=new Set(t().map(d=>ew[d])),ew=new Set(ew),ZOe=n(),n();let s=DOe(e),a=e();const o=()=>{let d=new Set;return t().forEach(f=>r(d,s[f])),r(d,t()),d};u4=WE(d=>{let f=WE(e).map(x=>x+96);if(f.length){let x=d>=a;f[0]-=32,f=hN(f),x&&(f=`Restricted[${f}]`);let g=o(),v=o(),w=!e();return{N:f,P:g,Q:v,M:w,R:x}}}),AV=n(),AC=new Map;let l=t().concat(jR(AV)).sort((d,f)=>d-f);l.forEach((d,f)=>{let x=e(),g=l[f]=x?l[f-x]:{V:[],M:new Map};g.V.push(d),AV.has(d)||AC.set(d,g)});for(let{V:d,M:f}of new Set(AC.values())){let x=[];for(let v of d){let w=u4.filter(N=>GE(N,v)),C=x.find(({G:N})=>w.some(P=>N.has(P)));C||(C={G:new Set,V:[]},x.push(C)),C.V.push(v),r(C.G,w)}let g=x.flatMap(v=>jR(v.G));for(let{G:v,V:w}of x){let C=new Set(g.filter(N=>!v.has(N)));for(let N of w)f.set(N,C)}}Ev=new Set;let c=new Set;const u=d=>Ev.has(d)?c.add(d):Ev.add(d);for(let d of u4){for(let f of d.P)u(f);for(let f of d.Q)u(f)}for(let d of Ev)!AC.has(d)&&!c.has(d)&&AC.set(d,XOe);r(Ev,GOe(Ev)),Gge=Qkt(e).map(d=>dTt.from(d)).sort(eTt),Vee=new Map;for(let d of Gge){let f=[Vee];for(let x of d){let g=f.map(v=>{let w=v.get(x);return w||(w=new Map,v.set(x,w)),w});x===YOe?f.push(...g):f=g}for(let x of f)x.V=d}}function Boe(e){return(JOe(e)?"":`${$oe(v$([e]))} `)+UOe(e)}function $oe(e){return`"${e}"`}function fTt(e){if(e.length>=4&&e[2]==qge&&e[3]==qge)throw new Error(`invalid label extension: "${hN(e.slice(0,4))}"`)}function hTt(e){for(let n=e.lastIndexOf(95);n>0;)if(e[--n]!==95)throw new Error("underscore allowed only at start")}function pTt(e){let t=e[0],n=Hge.get(t);if(n)throw e9(`leading ${n}`);let r=e.length,s=-1;for(let a=1;a<r;a++){t=e[a];let o=Hge.get(t);if(o){if(s==a)throw e9(`${n} + ${o}`);s=a+1,n=o}}if(s==r)throw e9(`trailing ${n}`)}function v$(e,t=1/0,n=UOe){let r=[];mTt(e[0])&&r.push("◌"),e.length>t&&(t>>=1,e=[...e.slice(0,t),8230,...e.slice(-t)]);let s=0,a=e.length;for(let o=0;o<a;o++){let l=e[o];JOe(l)&&(r.push(hN(e.slice(s,o))),r.push(n(l)),s=o+1)}return r.push(hN(e.slice(s,a))),r.join("")}function mTt(e,t){return Doe(),ew.has(e)}function JOe(e){return Doe(),ZOe.has(e)}function xTt(e){return vTt(gTt(e,uTt,STt))}function gTt(e,t,n){if(!e)return[];Doe();let r=0;return e.split(KOe).map(s=>{let a=Jkt(s),o={input:a,offset:r};r+=a.length+1;try{let l=o.tokens=CTt(a,t,n),c=l.length,u;if(!c)throw new Error("empty label");let d=o.output=l.flat();if(hTt(d),!(o.emoji=c>1||l[0].is_emoji)&&d.every(x=>x<128))fTt(d),u="ASCII";else{let x=l.flatMap(g=>g.is_emoji?[]:g);if(!x.length)u="Emoji";else{if(ew.has(d[0]))throw e9("leading combining mark");for(let w=1;w<c;w++){let C=l[w];if(!C.is_emoji&&ew.has(C[0]))throw e9(`emoji + combining mark: "${hN(l[w-1])} + ${v$([C[0]])}"`)}pTt(d);let g=jR(new Set(x)),[v]=yTt(g);wTt(v,x),bTt(v,g),u=v.N}}o.type=u}catch(l){o.error=l}return o})}function bTt(e,t){let n,r=[];for(let s of t){let a=AC.get(s);if(a===XOe)return;if(a){let o=a.M.get(s);if(n=n?n.filter(l=>o.has(l)):jR(o),!n.length)return}else r.push(s)}if(n){for(let s of n)if(r.every(a=>GE(s,a)))throw new Error(`whole-script confusable: ${e.N}/${s.N}`)}}function yTt(e){let t=u4;for(let n of e){let r=t.filter(s=>GE(s,n));if(!r.length)throw u4.some(s=>GE(s,n))?tMe(t[0],n):eMe(n);if(t=r,r.length==1)break}return t}function vTt(e){return e.map(({input:t,error:n,output:r})=>{if(n){let s=n.message;throw new Error(e.length==1?s:`Invalid label ${$oe(v$(t,63))}: ${s}`)}return hN(r)}).join(KOe)}function eMe(e){return new Error(`disallowed character: ${Boe(e)}`)}function tMe(e,t){let n=Boe(t),r=u4.find(s=>s.P.has(t));return r&&(n=`${r.N} ${n}`),new Error(`illegal mixture: ${e.N} + ${n}`)}function e9(e){return new Error(`illegal placement: ${e}`)}function wTt(e,t){for(let n of t)if(!GE(e,n))throw tMe(e,n);if(e.M){let n=GOe(t);for(let r=1,s=n.length;r<s;r++)if(Hee.has(n[r])){let a=r+1;for(let o;a<s&&Hee.has(o=n[a]);a++)for(let l=r;l<a;l++)if(n[l]==o)throw new Error(`duplicate non-spacing marks: ${Boe(o)}`);if(a-r>Vge)throw new Error(`excessive non-spacing marks: ${$oe(v$(n.slice(r-1,a)))} (${a-r}/${Vge})`);r=a}}}function CTt(e,t,n){let r=[],s=[];for(e=e.slice().reverse();e.length;){let a=NTt(e);if(a)s.length&&(r.push(t(s)),s=[]),r.push(n(a));else{let o=e.pop();if(Ev.has(o))s.push(o);else{let l=zee.get(o);if(l)s.push(...l);else if(!QOe.has(o))throw eMe(o)}}}return s.length&&r.push(t(s)),r}function STt(e){return e.filter(t=>t!=YOe)}function NTt(e,t){let n=Vee,r,s=e.length;for(;s&&(n=n.get(e[--s]),!!n);){let{V:a}=n;a&&(r=a,e.length=s)}return r}const ATt=e=>xTt(e),y0=e=>{let t="";for(let n=0;n<32;n+=1)t+="00";if(e){const r=ATt(e).split(".");for(let s=r.length-1;s>=0;s-=1){const a=Yf(r[s]).slice(2);t=Yf(`0x${t}${a}`).slice(2)}}return`0x${t}`};var hP=function(e,t,n,r){function s(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?a(d.value):s(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})};class jTt{constructor(t,n){this.contract=new r3(Ukt,n??wR.main,t),this.context=t}getOwner(t){return hP(this,void 0,void 0,function*(){try{return this.contract.methods.owner(y0(t)).call()}catch{throw new Error}})}getTTL(t){return hP(this,void 0,void 0,function*(){try{return this.contract.methods.ttl(y0(t)).call()}catch{throw new Error}})}recordExists(t){return hP(this,void 0,void 0,function*(){try{return this.contract.methods.recordExists(y0(t)).call()}catch{throw new Error}})}getResolver(t){return hP(this,void 0,void 0,function*(){try{return this.contract.methods.resolver(y0(t)).call().then(n=>{if(typeof n=="string")return new r3(zkt,n,this.context);throw new Error})}catch{throw new Error}})}get events(){return this.contract.events}}var Vx=function(e,t,n,r){function s(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?a(d.value):s(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})};class ETt{constructor(t){this.registry=t}getResolverContractAdapter(t){return Vx(this,void 0,void 0,function*(){return this.registry.getResolver(t)})}checkInterfaceSupport(t,n){var r,s;return Vx(this,void 0,void 0,function*(){if(ni(zge[n]))throw new $xe((r=t.options.address)!==null&&r!==void 0?r:"",n);if(!(yield t.methods.supportsInterface(zge[n]).call()))throw new $xe((s=t.options.address)!==null&&s!==void 0?s:"",n)})}supportsInterface(t,n){var r;return Vx(this,void 0,void 0,function*(){const s=yield this.getResolverContractAdapter(t);let a=n;if(!Aa(a)){if(a=(r=eT(n))!==null&&r!==void 0?r:"",n==="")throw new Error("Invalid interface Id");a=a.slice(0,10)}return s.methods.supportsInterface(a).call()})}getAddress(t,n=60){return Vx(this,void 0,void 0,function*(){const r=yield this.getResolverContractAdapter(t);return yield this.checkInterfaceSupport(r,q6.addr),r.methods.addr(y0(t),n).call()})}getPubkey(t){return Vx(this,void 0,void 0,function*(){const n=yield this.getResolverContractAdapter(t);return yield this.checkInterfaceSupport(n,q6.pubkey),n.methods.pubkey(y0(t)).call()})}getContenthash(t){return Vx(this,void 0,void 0,function*(){const n=yield this.getResolverContractAdapter(t);return yield this.checkInterfaceSupport(n,q6.contenthash),n.methods.contenthash(y0(t)).call()})}setAddress(t,n,r){return Vx(this,void 0,void 0,function*(){const s=yield this.getResolverContractAdapter(t);return yield this.checkInterfaceSupport(s,q6.setAddr),s.methods.setAddr(y0(t),n).send(r)})}getText(t,n){return Vx(this,void 0,void 0,function*(){const r=yield this.getResolverContractAdapter(t);return yield this.checkInterfaceSupport(r,q6.text),r.methods.text(y0(t),n).call()})}getName(t,n=!0){return Vx(this,void 0,void 0,function*(){const r=`${t.toLowerCase().substring(2)}.addr.reverse`,s=yield this.getResolverContractAdapter(r);return n&&(yield this.checkInterfaceSupport(s,q6.name)),s.methods.name(y0(r)).call()})}}var vh=function(e,t,n,r){function s(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?a(d.value):s(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})};class nMe extends Qd{constructor(t,n){super(n??""),this.registryAddress=t??wR.main,this._registry=new jTt(this.getContextObject(),t),this._resolver=new ETt(this._registry)}getResolver(t){return vh(this,void 0,void 0,function*(){return this._registry.getResolver(t)})}recordExists(t){return vh(this,void 0,void 0,function*(){return this._registry.recordExists(t)})}getTTL(t){return vh(this,void 0,void 0,function*(){return this._registry.getTTL(t)})}getOwner(t){return vh(this,void 0,void 0,function*(){return this._registry.getOwner(t)})}getAddress(t,n=60){return vh(this,void 0,void 0,function*(){return this._resolver.getAddress(t,n)})}getText(t,n){return vh(this,void 0,void 0,function*(){return Kf(t)?this._resolver.getText(yield this._resolver.getName(t,!1),n):this._resolver.getText(t,n)})}getName(t,n=!0){return vh(this,void 0,void 0,function*(){return this._resolver.getName(t,n)})}getPubkey(t){return vh(this,void 0,void 0,function*(){return this._resolver.getPubkey(t)})}getContenthash(t){return vh(this,void 0,void 0,function*(){return this._resolver.getContenthash(t)})}checkNetwork(){return vh(this,void 0,void 0,function*(){const t=Date.now()/1e3;if(!this._lastSyncCheck||t-this._lastSyncCheck>3600){const s=yield Z_t(this);if(!(typeof s=="boolean"&&!s))throw new cNt;this._lastSyncCheck=t}if(this._detectedAddress)return this._detectedAddress;const n=yield Aoe(this,Object.assign(Object.assign({},this.defaultReturnFormat),{number:Qh.HEX})),r=wR[$kt[n]];if(typeof r>"u")throw new lNt(n);return this._detectedAddress=r,this._detectedAddress})}supportsInterface(t,n){return vh(this,void 0,void 0,function*(){return this._resolver.supportsInterface(t,n)})}get events(){return this._registry.events}setAddress(t,n,r){return vh(this,void 0,void 0,function*(){return this._resolver.setAddress(t,n,r)})}}var _1=function(e,t,n,r){function s(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?a(d.value):s(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})};const _Tt=e=>_1(void 0,void 0,void 0,function*(){return(yield PEt(e)).map(fx)}),kTt=(e,t)=>_1(void 0,void 0,void 0,function*(){qs.validate(["string"],[t]);const n=yield FEt(e,t);return fx(n)}),TTt=(e,t,n,r)=>_1(void 0,void 0,void 0,function*(){return qs.validate(["address","string","uint"],[t,n,r]),OEt(e,t,n,r)}),ITt=(e,t)=>_1(void 0,void 0,void 0,function*(){return qs.validate(["address"],[t]),MEt(e,t)}),PTt=(e,t,n)=>_1(void 0,void 0,void 0,function*(){return qs.validate(["string","string"],[t,n]),REt(e,t,n)}),FTt=(e,t,n,r)=>_1(void 0,void 0,void 0,function*(){const s=cf(t,pi,{transactionSchema:r==null?void 0:r.customTransactionSchema});return LEt(e,s,n)}),OTt=(e,t,n,r)=>_1(void 0,void 0,void 0,function*(){const s=cf(t,pi,{transactionSchema:r==null?void 0:r.customTransactionSchema});return DEt(e,s,n)}),MTt=(e,t,n,r)=>_1(void 0,void 0,void 0,function*(){qs.validate(["string","address","string"],[t,n,r]);const s=Aa(t)?t:vm(t);return BEt(e,s,n,r)}),RTt=(e,t,n)=>_1(void 0,void 0,void 0,function*(){qs.validate(["string","string"],[t,n]);const r=Aa(t)?t:vm(t);return $Et(e,r,n)});var Wx=function(e,t,n,r){function s(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?a(d.value):s(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})};class rMe extends Qd{getAccounts(){return Wx(this,void 0,void 0,function*(){return _Tt(this.requestManager)})}newAccount(t){return Wx(this,void 0,void 0,function*(){return kTt(this.requestManager,t)})}unlockAccount(t,n,r){return Wx(this,void 0,void 0,function*(){return TTt(this.requestManager,t,n,r)})}lockAccount(t){return Wx(this,void 0,void 0,function*(){return ITt(this.requestManager,t)})}importRawKey(t,n){return Wx(this,void 0,void 0,function*(){return PTt(this.requestManager,t,n)})}sendTransaction(t,n){return Wx(this,void 0,void 0,function*(){return FTt(this.requestManager,t,n,this.config)})}signTransaction(t,n){return Wx(this,void 0,void 0,function*(){return OTt(this.requestManager,t,n,this.config)})}sign(t,n,r){return Wx(this,void 0,void 0,function*(){return MTt(this.requestManager,t,n,r)})}ecRecover(t,n){return Wx(this,void 0,void 0,function*(){return RTt(this.requestManager,t,n)})}}var A0;(function(e){e.HTTPS="https",e.WebSocket="wss"})(A0||(A0={}));var vs;(function(e){e.ETH_MAINNET="eth_mainnet",e.ETH_SEPOLIA="eth_sepolia",e.ETH_HOLESKY="eth_holesky",e.POLYGON_MAINNET="polygon_mainnet",e.POLYGON_AMOY="polygon_amoy",e.AVALANCHE_C_MAINNET="avalanche_c_mainnet",e.AVALANCHE_P_MAINNET="avalanche_p_mainnet",e.AVALANCHE_X_MAINNET="avalanche_x_mainnet",e.ARBITRUM_MAINNET="arbitrum_mainnet",e.ARBITRUM_SEPOLIA="arbitrum_sepolia",e.BASE_MAINNET="base_mainnet",e.BASE_SEPOLIA="base_sepolia",e.OPTIMISM_MAINNET="optimism_mainnet",e.OPTIMISM_SEPOLIA="optimism_sepolia",e.FANTOM_MAINNET="fantom_mainnet",e.FANTOM_TESTNET="fantom_testnet",e.DYMENSION_MAINNET="dymension_mainnet",e.DYMENSION_TESTNET="dymension_testnet",e.BNB_MAINNET="bnb_mainnet",e.BNB_TESTNET="bnb_testnet",e.BSC_MAINNET="bsc_mainnet",e.BSC_TESTNET="bsc_testnet",e.ARBITRUM_ONE="arbitrum_one",e.ARBITRUM_NOVA="arbitrum_nova",e.AVALANCHE_FUJI_C="avalanche_fuji_c",e.AVALANCHE_FUJI_P="avalanche_fuji_p",e.AVALANCHE_FUJI_X="avalanche_fuji_x",e.BLAST_MAINNET="blast_mainnet",e.OPBNB_MAINNET="opbnb_mainnet",e.OPBNB_TESTNET="opbnb_testnet",e.GNOSIS_MAINNET="gnosis_mainnet",e.GNOSIS_CHIADO="gnosis_chiado",e.PULSECHAIN_MAINNET="pulsechain_mainnet",e.PULSECHAIN_TESTNET="pulsechain_testnet",e.KAVA_MAINNET="kava_mainnet",e.CRONOS_MAINNET="cronos_mainnet",e.MANTLE_MAINNET="mantle_mainnet",e.CHILIZ_MAINNET="chiliz_mainnet",e.CHILIZ_SPICY="chiliz_spicy",e.MOONBEAM_MAINNET="moonbeam_mainnet",e.TAIKO_MAINNET="taiko_mainnet",e.TAIKO_HEKLA="taiko_hekla",e.LINEA_MAINNET="linea_mainnet",e.LINEA_SEPOLIA="linea_sepolia",e.BAHAMUT_MAINNET="bahamut_mainnet",e.SCROLL_MAINNET="scroll_mainnet",e.SCROLL_SEPOLIA="scroll_sepolia",e.TRON_MAINNET="tron_mainnet",e.SYSCOIN_MAINNET="syscoin_mainnet",e.SYSCOIN_TANENBAUM="syscoin_tanenbaum",e.MOONRIVER_MAINNET="moonriver_mainnet",e.HAQQ_MAINNET="haqq_mainnet",e.EVMOS_MAINNET="evmos_mainnet",e.EVMOS_TESTNET="evmos_testnet",e.BERACHAIN_TESTNET="berachain_testnet"})(vs||(vs={}));const LTt=1300;class DTt extends di{constructor(t){super("You've reach the rate limit of free RPC calls from our Partner Quick Nodes. There are two options you can either create a paid Quick Nodes account and get 20% off for 2 months using WEB3JS referral code, or use Free public RPC endpoint.",t),this.code=LTt}}const BTt=1301;class Kge extends di{constructor(t){super(`Invalid provider config options given for ${t}`),this.code=BTt}}var $Tt=function(e,t,n,r){function s(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?a(d.value):s(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})};class sMe extends coe{constructor(t,n,r,s,a){if(super(),a!==void 0&&n===A0.HTTPS&&!("providerOptions"in a))throw new Kge("HTTP Provider");if(a!==void 0&&n===A0.WebSocket&&!("socketOptions"in a||"reconnectOptions"in a))throw new Kge("Websocket Provider");this.transport=n,n===A0.HTTPS?this.provider=new c$(this.getRPCURL(t,n,r,s),a):n===A0.WebSocket&&(this.provider=new xFe(this.getRPCURL(t,n,r,s),a==null?void 0:a.socketOptions,a==null?void 0:a.reconnectOptions))}request(t,n){return $Tt(this,void 0,void 0,function*(){return this.transport===A0.HTTPS?yield this.provider.request(t,n):this.provider.request(t)})}getStatus(){return this.provider.getStatus()}supportsSubscriptions(){return this.provider.supportsSubscriptions()}once(t,n){var r;!((r=this.provider)===null||r===void 0)&&r.once&&this.provider.once(t,n)}removeAllListeners(t){var n;!((n=this.provider)===null||n===void 0)&&n.removeAllListeners&&this.provider.removeAllListeners(t)}connect(){var t;!((t=this.provider)===null||t===void 0)&&t.connect&&this.provider.connect()}disconnect(t,n){var r;!((r=this.provider)===null||r===void 0)&&r.disconnect&&this.provider.disconnect(t,n)}reset(){var t;!((t=this.provider)===null||t===void 0)&&t.reset&&this.provider.reset()}on(t,n){this.provider&&this.provider.on(t,n)}removeListener(t,n){this.provider&&this.provider.removeListener(t,n)}}var UTt=function(e,t,n,r){function s(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?a(d.value):s(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})};const vc=e=>e!==void 0&&e.trim().length>0;class zTt extends sMe{constructor(t=vs.ETH_MAINNET,n=A0.HTTPS,r="",s="",a){super(t,n,r,s,a)}request(t,n){const r=Object.create(null,{request:{get:()=>super.request}});return UTt(this,void 0,void 0,function*(){try{return yield r.request.call(this,t,n)}catch(s){throw s instanceof S0&&s.statusCode===429?new DTt(s):s}})}getRPCURL(t,n,r,s){let a="",o="";switch(t){case vs.ETH_MAINNET:a=vc(s)?s:"powerful-holy-bush.quiknode.pro",o=vc(r)?r:"3240624a343867035925ff7561eb60dfdba2a668";break;case vs.ETH_SEPOLIA:a=vc(s)?s:"dimensional-fabled-glitter.ethereum-sepolia.quiknode.pro",o=vc(r)?r:"382a3b5a4b938f2d6e8686c19af4b22921fde2cd";break;case vs.ETH_HOLESKY:a=vc(s)?s:"yolo-morning-card.ethereum-holesky.quiknode.pro",o=vc(r)?r:"481ebe70638c4dcf176af617a16d02ab866b9af9";break;case vs.ARBITRUM_MAINNET:a=vc(s)?s:"autumn-divine-dinghy.arbitrum-mainnet.quiknode.pro",o=vc(r)?r:"a5d7bfbf60b5ae9ce3628e53d69ef50d529e9a8c";break;case vs.ARBITRUM_SEPOLIA:a=vc(s)?s:"few-patient-pond.arbitrum-sepolia.quiknode.pro",o=vc(r)?r:"3be985450970628c860b959c65cd2642dcafe53c";break;case vs.BNB_MAINNET:a=vc(s)?s:"purple-empty-reel.bsc.quiknode.pro",o=vc(r)?r:"ebf6c532961e21f092ff2facce1ec4c89c540158";break;case vs.BNB_TESTNET:a=vc(s)?s:"floral-rough-scion.bsc-testnet.quiknode.pro",o=vc(r)?r:"5b297e5acff5f81f4c37ebf6f235f7299b6f9d28";break;case vs.POLYGON_MAINNET:a=vc(s)?s:"small-chaotic-moon.matic.quiknode.pro",o=vc(r)?r:"847569f8a017e84d985e10d0f44365d965a951f1";break;case vs.POLYGON_AMOY:a=vc(s)?s:"prettiest-side-shape.matic-amoy.quiknode.pro",o=vc(r)?r:"79a9476eea661d4f82de614db1d8a895b14b881c";break;default:throw new Error("Network info not avalible.")}return`${n}://${a}/${o}`}}const HTt=e=>e!==void 0&&e.trim().length>0,VTt=[vs.DYMENSION_MAINNET,vs.DYMENSION_TESTNET,vs.KAVA_MAINNET,vs.CRONOS_MAINNET,vs.POLYGON_MAINNET];class ER extends sMe{constructor(t=vs.ETH_MAINNET,n=A0.HTTPS,r="",s){super(t,n,"",r,s)}getRPCURL(t,n,r,s){if(!ER.networkHostMap[t])throw new Error("Network info not avalible.");const a=`${ER.networkHostMap[t]}.publicnode.com`,o=HTt(s)?s:a;return VTt.includes(t)&&n===A0.WebSocket?`${n}://${o}/websocket`:`${n}://${o}`}}ER.networkHostMap={[vs.POLYGON_AMOY]:"polygon-amoy-bor-rpc",[vs.DYMENSION_MAINNET]:"dymension-evm-rpc",[vs.DYMENSION_TESTNET]:"dymension-testnet-evm-rpc",[vs.BLAST_MAINNET]:"blast-rpc",[vs.GNOSIS_MAINNET]:"gnosis-rpc",[vs.PULSECHAIN_MAINNET]:"pulsechain-rpc",[vs.PULSECHAIN_TESTNET]:"pulsechain-testnet-rpc",[vs.KAVA_MAINNET]:"kava-evm-rpc",[vs.CRONOS_MAINNET]:"cronos-evm-rpc",[vs.MANTLE_MAINNET]:"mantle-rpc",[vs.TAIKO_MAINNET]:"taiko-rpc",[vs.TAIKO_HEKLA]:"taiko-hekla-rpc",[vs.LINEA_MAINNET]:"linea-rpc",[vs.LINEA_SEPOLIA]:"linea-sepolia-rpc",[vs.SCROLL_MAINNET]:"scroll-rpc",[vs.SCROLL_SEPOLIA]:"scroll-sepolia-rpc",[vs.SYSCOIN_MAINNET]:"syscoin-evm-rpc",[vs.SYSCOIN_TANENBAUM]:"syscoin-tanenbaum-evm-rpc",[vs.HAQQ_MAINNET]:"haqq-evm-rpc",[vs.EVMOS_MAINNET]:"evmos-evm-rpc",[vs.EVMOS_TESTNET]:"evmos-testnet-evm-rpc",[vs.BERACHAIN_TESTNET]:"berachain-testnet-evm-rpc",[vs.ETH_MAINNET]:"ethereum-rpc",[vs.ETH_SEPOLIA]:"ethereum-sepolia-rpc",[vs.ETH_HOLESKY]:"ethereum-holesky-rpc",[vs.BSC_MAINNET]:"bsc-rpc",[vs.BSC_TESTNET]:"bsc-testnet-rpc",[vs.POLYGON_MAINNET]:"polygon-bor-rpc",[vs.BASE_MAINNET]:"base-rpc",[vs.BASE_SEPOLIA]:"base-sepolia-rpc",[vs.ARBITRUM_ONE]:"arbitrum-one-rpc",[vs.ARBITRUM_NOVA]:"arbitrum-nova-rpc",[vs.ARBITRUM_SEPOLIA]:"arbitrum-sepolia-rpc",[vs.AVALANCHE_C_MAINNET]:"avalanche-c-chain-rpc",[vs.AVALANCHE_P_MAINNET]:"avalanche-p-chain-rpc",[vs.AVALANCHE_X_MAINNET]:"avalanche-x-chain-rpc",[vs.AVALANCHE_FUJI_C]:"avalanche-fuji-c-chain-rpc",[vs.AVALANCHE_FUJI_P]:"avalanche-fuji-p-chain-rpc",[vs.AVALANCHE_FUJI_X]:"avalanche-fuji-x-chain-rpc",[vs.OPTIMISM_MAINNET]:"optimism-rpc",[vs.OPTIMISM_SEPOLIA]:"optimism-sepolia-rpc",[vs.FANTOM_MAINNET]:"fantom-rpc",[vs.FANTOM_TESTNET]:"fantom-testnet-rpc",[vs.OPBNB_MAINNET]:"opbnb-rpc",[vs.OPBNB_TESTNET]:"opbnb-testnet-rpc",[vs.GNOSIS_CHIADO]:"gnosis-chiado-rpc",[vs.CHILIZ_MAINNET]:"chiliz-rpc",[vs.CHILIZ_SPICY]:"chiliz-spicy-rpc",[vs.MOONBEAM_MAINNET]:"moonbeam-rpc",[vs.BAHAMUT_MAINNET]:"bahamut-rpc",[vs.TRON_MAINNET]:"tron-evm-rpc",[vs.MOONRIVER_MAINNET]:"moonriver-rpc"};const WTt=new zTt,qTt={encodeEventSignature:koe,encodeFunctionCall:V_t,encodeFunctionSignature:zE,encodeParameter:Ree,encodeParameters:g$,decodeParameter:NOe,decodeParameters:n3,decodeLog:AOe};var T7=function(e,t,n,r){function s(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?a(d.value):s(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})};const GTt=e=>{const t=(o,l)=>T7(void 0,void 0,void 0,function*(){const c=yield Ikt(o,e),u=qr({format:"bytes"},l,pi);return k9t(c,u)}),n=o=>{const l=woe(o);return Object.assign(Object.assign({},l),{signTransaction:c=>T7(void 0,void 0,void 0,function*(){return t(c,l.privateKey)})})},r=(o,l,c)=>T7(void 0,void 0,void 0,function*(){var u;const d=yield F9t(o,l,(u=c==null?void 0:c.nonStrict)!==null&&u!==void 0?u:!0);return Object.assign(Object.assign({},d),{signTransaction:f=>T7(void 0,void 0,void 0,function*(){return t(f,d.privateKey)})})}),s=()=>{const o=P9t();return Object.assign(Object.assign({},o),{signTransaction:l=>T7(void 0,void 0,void 0,function*(){return t(l,o.privateKey)})})},a=new hR({create:s,privateKeyToAccount:n,decrypt:r});return{signTransaction:t,create:s,privateKeyToAccount:n,decrypt:r,recoverTransaction:T9t,hashMessage:voe,sign:HFe,recover:Eee,encrypt:VFe,wallet:a,privateKeyToAddress:h$,parseAndValidatePrivateKey:LA,privateKeyToPublicKey:I9t}},KTt={version:"4.16.0"};var YTt=function(e,t,n,r){function s(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?a(d.value):s(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})},_R;(function(e){e.eip6963announceProvider="eip6963:announceProvider",e.eip6963requestProvider="eip6963:requestProvider"})(_R||(_R={}));const jV=new Map,iMe="web3:providersMapUpdated",XTt=()=>YTt(void 0,void 0,void 0,function*(){return new Promise((e,t)=>{typeof window>"u"&&t(new Error("window object not available, EIP-6963 is intended to be used within a browser")),window.addEventListener(_R.eip6963announceProvider,n=>{jV.set(n.detail.info.uuid,n.detail);const r=new CustomEvent(iMe,{detail:jV});window.dispatchEvent(r),e(jV)}),window.dispatchEvent(new Event(_R.eip6963requestProvider))})}),QTt=e=>{if(typeof window>"u")throw new Error("window object not available, EIP-6963 is intended to be used within a browser");window.addEventListener(iMe,e)};class Sl extends Qd{constructor(t=WTt){var n;(ni(t)||typeof t=="string"&&t.trim()===""||typeof t!="string"&&!dR(t)&&!t.provider)&&console.warn("NOTE: web3.js is running without provider. You need to pass a provider in order to interact with the network!");let r={};typeof t=="string"||dR(t)?r.provider=t:t?r=t:r={},r.registeredSubscriptions=Object.assign(Object.assign({},Dee),(n=r.registeredSubscriptions)!==null&&n!==void 0?n:{}),super(r);const s=GTt(this);this._wallet=s.wallet,this._accountProvider=s,this.utils=mFe;const a=this;class o extends r3{constructor(u,d,f,x,g){if(py(d)&&py(f))throw new Uxe("Should not provide options at both 2nd and 3rd parameters");let v,w={},C,N;if(!ni(d)&&typeof d!="object"&&typeof d!="string")throw new Uxe;if(typeof d=="string"&&(v=d),py(d)?w=d:py(f)?w=f:w={},d instanceof Qd?C=d:f instanceof Qd?C=f:x instanceof Qd?C=x:C=a.getContextObject(),g?N=g:hg(f)?N=f:hg(x)&&(N=x),super(u,v,w,C,N),super.subscribeToContextEvents(a),!ni(l)){const P=l.getTransactionMiddleware();ni(P)||super.setTransactionMiddleware(P)}}}const l=a.use(b$);this.eth=Object.assign(l,{ens:a.use(nMe,wR.main),Iban:Rl,net:a.use(ZFe),personal:a.use(rMe),Contract:o,abi:qTt,accounts:s})}}Sl.version=KTt.version;Sl.utils=mFe;Sl.requestEIP6963Providers=XTt;Sl.onNewProviderDiscovered=QTt;Sl.modules={Web3Eth:b$,Iban:Rl,Net:ZFe,ENS:nMe,Personal:rMe};const bd=({open:e,setOpen:t,transactionHash:n,transactionLoading:r,paymentPresaleRole:s,errorFunds:a,activeMethod:o})=>{const[l,c]=m.useState(!1);m.useEffect(()=>{const d=f=>{r&&e&&(f.preventDefault(),f.returnValue="Please do not leave, your purchase is in progress.")};return window.addEventListener("beforeunload",d),()=>window.removeEventListener("beforeunload",d)},[r,e]);const u=async d=>{try{await navigator.clipboard.writeText(d),rn.success("TX Hash copied to clipboard!")}catch(f){console.error("Failed to copy: ",f),rn.error("Failed to copy TX Hash")}};return m.useEffect(()=>{let d;return e&&r?d=setTimeout(()=>c(!0),24e4):(c(!1),d&&clearTimeout(d)),()=>d&&clearTimeout(d)},[e,r]),i.jsxs(Ea,{open:e,onClose:()=>{r||t(!1)},className:"relative z-[9001] font-inter",children:[i.jsx(ja,{style:{backgroundColor:"rgba(0, 0, 0, 0.48)"},className:"fixed inset-0 transition-opacity data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in"}),i.jsx("div",{className:"fixed inset-0 z-50 w-screen overflow-y-auto",children:i.jsx("div",{className:"flex min-h-full justify-center p-4 text-center items-center sm:p-0",children:i.jsx(xa,{transition:!0,style:{maxWidth:"448px"},className:`relative transform overflow-hidden rounded-lg bg-[#161616] border border-[#404040] pt-5 pb-4 text-left shadow-xl transition-all
data-[closed]:translate-y-4 data-[closed]:opacity-0
data-[enter]:duration-300 data-[leave]:duration-200
data-[enter]:ease-out data-[leave]:ease-in
sm:my-8 sm:align-middle sm:w-full sm:max-w-lg`,children:i.jsxs("div",{className:"mt-3 text-center sm:mt-5 text-white",children:[(!r&&s||l)&&i.jsx("svg",{onClick:()=>t(!1),xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6 fixed right-0 mr-4 top-4 cursor-pointer text-gray-400 hover:text-white",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})}),r?i.jsxs("div",{className:"mt-2",children:[!a&&i.jsx("div",{className:"flex justify-center items-center",children:i.jsx(Da,{})}),i.jsxs("p",{className:"mt-4 text-center flex flex-col items-center text-sm font-medium text-gray-200",children:[i.jsx("span",{children:"Your subscription order is created, please confirm"}),i.jsx("span",{children:"transaction on your wallet to complete purchase."})]}),l?i.jsxs(i.Fragment,{children:[i.jsxs("p",{className:"text-red-400 mt-4 flex justify-start items-center min-h-20 sm:h-20 bg-[#2a1a1a] w-full border-l-2 border-red-600 gap-4 pl-2.5 rounded",children:[i.jsx("img",{src:ec,alt:"",className:"w-8 h-8"}),i.jsx("span",{className:"text-sm font-medium text-red-400 max-w-[354px] text-left",children:"There was an error, you can contact us via discord."})]}),i.jsx("div",{className:"w-full flex justify-center items-center mt-6",children:i.jsxs("a",{href:"https://discord.gg/dextrabot",target:"_blank",className:"inline-flex relative items-center px-2.5 py-1.5 text-sm font-bold text-white hover:text-white bg-[#5865F2] hover:bg-[#626ef1] rounded-md h-9 min-w-max gap-2",children:[i.jsx("img",{src:ike,className:"w-6 h-6"}),"Join Discord"]})})]}):i.jsxs(i.Fragment,{children:[i.jsx("p",{className:`${a?"text-red-400 bg-[#2a1a1a] border-red-600":"text-yellow-400 bg-[#2a2418] border-yellow-600"} mt-4 flex justify-start items-center min-h-20 sm:h-20 w-full border-l-2 gap-4 pl-2.5 rounded`,children:a?i.jsxs(i.Fragment,{children:[i.jsx("img",{src:ec,alt:"",className:"w-8 h-8"}),i.jsx("span",{className:"text-sm font-medium text-red-400 max-w-[354px] text-left",children:"Insufficient funds.Please add funds to your wallet on Ethereum Mainnet."})]}):i.jsxs(i.Fragment,{children:[i.jsx(IM,{className:"w-8 h-8 text-yellow-400"}),i.jsx("span",{className:"text-sm font-medium text-yellow-400 max-w-[354px] text-left",children:"If you have confirmed the transaction from wallet extension, do not exit back and wait, otherwise your transaction may be incorrect."})]})}),i.jsx("div",{className:"w-full flex justify-center items-center mt-6",children:i.jsx("div",{onClick:()=>t(!1),className:"w-26 h-8 px-4 py-1 bg-[#2a2a2a] rounded-full flex justify-center items-center cursor-pointer hover:bg-[#3a3a3a]",children:i.jsx("div",{className:"text-sm font-medium text-gray-300",children:"Cancel"})})})]})]}):o===2&&s?i.jsxs("div",{className:"mt-2",children:[i.jsx("div",{className:"flex justify-center items-center",children:i.jsx("div",{className:"mx-auto flex items-center justify-center h-12 w-12 rounded-full bg-green-100",children:i.jsx(yet,{className:"h-6 w-6 text-green-600","aria-hidden":"true"})})}),i.jsx("p",{className:"text-gray-100 text-lg mt-4 font-medium",children:"Payment Successful"}),i.jsxs("p",{className:"text-sm text-left text-gray-300 mt-4 px-2",children:["Transaction Hash"," ",i.jsxs("span",{className:"flex items-center justify-center text-xs break-all",children:[n,i.jsx("span",{onClick:()=>u(n),className:"inline-block mx-1 w-4 cursor-pointer",children:i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 text-gray-300 hover:text-white",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"})})})]})]})]}):i.jsxs("div",{className:"my-2",children:[i.jsx("div",{className:"flex justify-center items-center",children:i.jsx(Da,{})}),i.jsx("p",{className:"mt-4 text-center flex flex-col items-center text-sm font-medium text-gray-200 font-manrope",children:i.jsx("span",{children:"If your role has not been assigned yet, please refresh the page."})})]})]})})})})]})},Uoe=({className:e})=>i.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"121",height:"32",viewBox:"0 0 32 32",fill:"none",className:e,children:[i.jsx("path",{d:"M9.13309 30.4398L9.88315 26.9871C10.7197 23.1362 7.77521 19.4988 3.82118 19.4988H0.385363C1.4689 24.3374 4.75127 28.3496 9.13309 30.4398Z",fill:"currentColor"}),i.jsx("path",{d:"M10.64 31.0663C12.3326 31.6707 14.1567 32 16.0579 32C23.7199 32 30.1285 26.6527 31.7305 19.4988H21.249C16.5244 19.4988 12.4396 22.7824 11.44 27.3838L10.64 31.0663Z",fill:"currentColor"}),i.jsx("path",{d:"M32.0038 17.8987C32.0778 17.2756 32.1159 16.6415 32.1159 15.9985C32.1159 7.60402 25.629 0.719287 17.3779 0.0503251L15.1273 10.4105C14.2907 14.2614 17.2352 17.8987 21.1892 17.8987H32.0038Z",fill:"currentColor"}),i.jsx("path",{d:"M15.7459 0C7.02134 0.165717 0 7.26504 0 15.9985C0 16.6415 0.0380539 17.2756 0.112041 17.8987H3.76146C8.48603 17.8987 12.5709 14.6151 13.5705 10.0137L15.7459 0Z",fill:"currentColor"}),i.jsxs("defs",{children:[i.jsxs("linearGradient",{id:"paint0_linear",x1:"18.9416",y1:"0",x2:"12.6408",y2:"32.0507",gradientUnits:"userSpaceOnUse",children:[i.jsx("stop",{stopColor:"#F4D5B1"}),i.jsx("stop",{offset:"1",stopColor:"#FFD29F"})]}),i.jsxs("linearGradient",{id:"paint1_linear",x1:"18.9416",y1:"0",x2:"12.6408",y2:"32.0507",gradientUnits:"userSpaceOnUse",children:[i.jsx("stop",{stopColor:"#F4D5B1"}),i.jsx("stop",{offset:"1",stopColor:"#FFD29F"})]}),i.jsxs("linearGradient",{id:"paint2_linear",x1:"18.9416",y1:"0",x2:"12.6408",y2:"32.0507",gradientUnits:"userSpaceOnUse",children:[i.jsx("stop",{stopColor:"#F4D5B1"}),i.jsx("stop",{offset:"1",stopColor:"#FFD29F"})]}),i.jsxs("linearGradient",{id:"paint3_linear",x1:"18.9416",y1:"0",x2:"12.6408",y2:"32.0507",gradientUnits:"userSpaceOnUse",children:[i.jsx("stop",{stopColor:"#F4D5B1"}),i.jsx("stop",{offset:"1",stopColor:"#FFD29F"})]})]})]}),aMe=[{id:"aster",label:"Aster",hash:"#aster-farming"},{id:"basedapp",label:"BasedApp",hash:"#basedapp-farming"},{id:"lighter",label:"Lighter",hash:"#lighter-farming"},{id:"apex",label:"Apex",hash:"#apex-farming"},{id:"extended",label:"Extended",hash:"#extended-farming"},{id:"variational",label:"Variational",hash:"#variational-farming"},{id:"paradex",label:"Paradex",hash:"#paradex-farming"},{id:"pacifica",label:"Pacifica",hash:"#pacifica-farming"}],ZTt=aMe.reduce((e,t)=>(e[t.hash]=t.id,e),{}),f2=({current:e="",onCloseCurrent:t})=>{const n=oc(),r=Vo(),s=e||ZTt[n.hash]||"",a=o=>{!o||o.id===s||(t&&t(),r(`${n.pathname}${n.search}${o.hash}`,{replace:!0}))};return i.jsxs("div",{className:"hidden lg:flex flex-col gap-4 w-[220px] p-4 rounded-2xl border border-[#242424] bg-[rgba(16,16,16,0.9)] shadow-lg shadow-black/30",children:[i.jsxs("div",{className:"flex items-center gap-2 px-2",children:[i.jsx("div",{className:"h-1 w-6 bg-gradient-to-r from-[#5ce0a5] to-[#4aba85] rounded-full"}),i.jsx("h3",{className:"text-[11px] text-[#b0b0b0] font-bold uppercase tracking-[0.15em]",children:"Farming Modules"})]}),i.jsx("div",{className:"flex flex-col gap-1.5",children:aMe.map(o=>{const l=o.id===s;return i.jsxs("button",{onClick:()=>a(o),className:`group relative h-12 w-full rounded-lg text-left px-3 text-[13px] font-medium transition-all duration-200 overflow-hidden ${l?"bg-[#293e33] text-white":"bg-transparent text-[#a8a8a8] hover:bg-[#1a1a1a] hover:text-white"}`,disabled:l,children:[i.jsx("div",{className:`absolute left-0 top-1/2 -translate-y-1/2 h-6 w-[3px] rounded-r-full transition-all duration-200 ${l?"bg-gradient-to-b from-[#5ce0a5] to-[#4aba85] opacity-100":"bg-[#3a3a3a] opacity-0 group-hover:opacity-100"}`}),i.jsxs("div",{className:"flex items-center gap-3 pl-2",children:[i.jsx("div",{className:`flex-shrink-0 w-5 h-5 rounded-md flex items-center justify-center transition-all duration-200 ${l?"bg-[#5ce0a5]/10 ring-1 ring-[#5ce0a5]/30":"bg-[#1f1f1f] group-hover:bg-[#252525]"}`,children:o.id==="aster"?i.jsx(Uoe,{className:`w-3.5 h-3.5 ${l?"text-[#5ce0a5]":""}`}):o.id==="basedapp"?i.jsx("img",{src:Byt,alt:"BasedApp",className:"w-3.5 h-3.5"}):o.id==="lighter"?i.jsx(Mg,{className:`w-3.5 h-3.5 ${l?"text-[#5ce0a5]":"text-white"}`}):o.id==="apex"?i.jsx("img",{src:dke,alt:"Apex",className:"w-3.5 h-3.5"}):o.id==="extended"?i.jsx("img",{src:"https://app.extended.exchange/assets/logo/extended.svg",alt:"Extended",className:"w-3.5 h-3.5"}):o.id==="variational"?i.jsx("img",{src:uke,alt:"Variational",className:"w-3.5 h-3.5"}):o.id==="paradex"?i.jsx("img",{src:fke,alt:"Paradex",className:"w-3.5 h-3.5"}):o.id==="pacifica"?i.jsx("img",{src:"https://app.pacifica.fi/imgs/icon.svg",alt:"Pacifica",className:"w-3.5 h-3.5"}):null}),i.jsxs("span",{className:`transition-colors duration-200 ${l?"text-[#e8e8e8]":""}`,children:[o.label," Farming"]})]}),l&&i.jsx("div",{className:"absolute bottom-0 left-0 right-0 h-[1px] bg-gradient-to-r from-transparent via-[#5ce0a5]/50 to-transparent"})]},o.id)})})]})};function zoe({open:e=!1,setOpen:t=()=>{}}){const[n,r]=m.useState([]),[s,a]=m.useState(""),[o,l]=m.useState(""),[c,u]=m.useState("11"),[d,f]=m.useState(""),[x,g]=m.useState(""),[v,w]=m.useState(""),[C,N]=m.useState(""),[P,I]=m.useState(2),[R,F]=m.useState(!1),[U,L]=m.useState(!1),[z,Q]=m.useState(!1),[ne,J]=m.useState(!1),[X,re]=m.useState(!1),[pe,Y]=m.useState(""),[ie,oe]=m.useState(""),[G,V]=m.useState(!1),[ee,ae]=m.useState(!1),[fe,Ne]=m.useState(null),[he,ge]=m.useState(""),[ye,ve]=m.useState(!1),[je,Ie]=m.useState(!1),[Le,Qe]=m.useState(null),[$e,it]=m.useState(!1),[tt,lt]=m.useState([]),[ft,ut]=m.useState(!1),[qt,It]=m.useState(!1),[nn,jt]=m.useState(""),[cn,un]=m.useState(!0),{setSignModalOpen:Ft,setTelegramChatId:Ke,setSubscriberRole:Bt,setSubsExpireDay:$t,setMushboomerETH:qe,setMushboomerSOL:Ye,setIsReferralCode:ht,setIsReferralCodeName:Zt,setIsWhitelist:zt,setHyperToken:Et,setHyperAddress:nt}=m.useContext(Qr),Ue="https://dextrabothypev2.nftinit.io",Rt="https://api.hyperliquid.xyz/info",We="0x1924b8561eef20e70ede628a296175d358be80e5",at=["HYPE","ETH","BTC","SOL","USDT0","PUP"],mt="0.01",Dt=Ee=>{switch(Ee){case"BTC":return"UBTC";case"ETH":return"UETH";case"SOL":return"USOL";case"USDT0":return"USDT0";case"HYPE":default:return Ee}},Tt=Ee=>{if(Ee==null||Ee==="")return"0.00";const h=Number(Ee);return Number.isNaN(h)?"0.00":h.toLocaleString(void 0,{minimumFractionDigits:2,maximumFractionDigits:2})},dn=Ee=>/^\d*\.?\d{0,6}$/.test(Ee),on=Ee=>/^\d*$/.test(Ee),gn=Ee=>{["e","E","+","-"].includes(Ee.key)&&Ee.preventDefault()},Nn=m.useMemo(()=>{if(c==="")return!1;const Ee=Number(c);return!Number.isNaN(Ee)&&Ee>=11},[c]);m.useMemo(()=>{if(d==="")return!1;const Ee=Number(d);return!Number.isNaN(Ee)&&Ee>0},[d]);const kn=m.useMemo(()=>{if(x==="")return!1;const Ee=Number(x);return!Number.isNaN(Ee)&&Ee>=0&&Ee<=100},[x]),yn=m.useMemo(()=>{if(v==="")return!1;const Ee=Number(v);return!Number.isNaN(Ee)&&Ee>=0&&Ee<=100},[v]),Vn=m.useMemo(()=>{if(C==="")return!1;const Ee=Number(C);return Number.isInteger(Ee)&&Ee>0&&Ee<=180},[C]),Gn=m.useMemo(()=>n.map(Ee=>{const h=(Ee==null?void 0:Ee.wallet_name)??(Ee==null?void 0:Ee.name)??(Ee==null?void 0:Ee.label)??String(Ee==null?void 0:Ee.wallet_id),p=(Ee==null?void 0:Ee.version)===3?`${h} - (API-AGENT) Wallet`:h;return{value:(Ee==null?void 0:Ee.wallet_id)??(Ee==null?void 0:Ee.id)??(Ee==null?void 0:Ee.value)??"",label:p,raw:Ee}}),[n]),Dn=m.useMemo(()=>{var Ee;return(Ee=Gn.find(h=>String(h.value)===String(s)))==null?void 0:Ee.raw},[Gn,s]),Kn=m.useMemo(()=>{const Ee=Dn||{};return Ee.address||Ee.evm_address||Ee.wallet_address||Ee.public_address||Ee.eth_address||Ee.addr||null},[Dn]),Cn=(Dn==null?void 0:Dn.version)===3,sn=!Cn||Le>0,Me=m.useMemo(()=>{if(!o)return{coin:Dt(o),total:"0",entryNtl:"0"};const Ee=Dt(o);return(tt||[]).find(p=>(p==null?void 0:p.coin)===Ee)??{coin:Ee,total:"0",entryNtl:"0"}},[o,tt]),en=s!==""&&o!==""&&(P===1?Vn&&yn:Nn&&kn)&&ye&&sn&&cn;m.useEffect(()=>{if(!e)return;const Ee=localStorage.getItem("hyperToken"),h=localStorage.getItem("hyperAddress");ve(!!(Ee&&h));const p=setInterval(()=>{const S=localStorage.getItem("hyperToken"),_=localStorage.getItem("hyperAddress");ve(!!(S&&_))},800);return()=>clearInterval(p)},[e]),m.useEffect(()=>{e&&(Y(""),ye&&Mt())},[e,ye]),m.useEffect(()=>{e&&(Kn?Yn(Kn):(Ne(null),ge(""),lt([])))},[e,Kn]),m.useEffect(()=>{!e||!ye||(Nt(),Jn())},[e,ye]),m.useEffect(()=>{e&&P===1&&!v&&w(mt)},[e,P]),m.useEffect(()=>{if(!e||!ye)return;const Ee=Dn||{},h=Ee.address||Ee.evm_address||Ee.wallet_address||Ee.public_address||Ee.eth_address||Ee.addr||null;(Ee==null?void 0:Ee.version)===3&&h&&an(h)},[e,ye,s,Dn]);async function an(Ee){try{Ie(!0),Qe(null);const p=await(await fetch(Rt,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"maxBuilderFee",user:Ee,builder:We})})).json();Qe(Number(p))}catch{Qe(null)}finally{Ie(!1)}}async function Nt(){var Ee,h,p;try{L(!0);const S=window.localStorage.getItem("hyperToken"),_=window.localStorage.getItem("hyperAddress");if(!S||!_){V(!1);return}const T=await(await fetch(`${Ue}/api/hyper/farming/info/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({address:_.toLowerCase(),token:S})})).json();if(T!=null&&T.success&&((Ee=T==null?void 0:T.data)!=null&&Ee.farming_params)){V(!0),((h=T==null?void 0:T.data)==null?void 0:h.wallet_id)!==void 0&&((p=T==null?void 0:T.data)==null?void 0:p.wallet_id)!==null&&a(String(T.data.wallet_id));const B=T.data.farming_params||{};B.coin&&l(B.coin),B.margin!==void 0&&B.margin!==null&&u(String(B.margin)),B.budget!==void 0&&B.budget!==null&&f(String(B.budget));const q=Number(B.methodType);q===1?(I(2),B.spread!==void 0&&B.spread!==null&&g(String(B.spread))):q===2?(I(1),B.spread!==void 0&&B.spread!==null?w(String(B.spread)):w(mt),B.orderPerHour!==void 0&&B.orderPerHour!==null&&N(String(B.orderPerHour))):I(2)}else V(!1)}catch{V(!1)}finally{L(!1)}}async function Yn(Ee){try{ge(""),ae(!0),Ne(null);const p=await(await fetch(Rt,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"spotClearinghouseState",user:Ee})})).json(),S=Array.isArray(p==null?void 0:p.balances)?p.balances:[];lt(S);const _=S.find(k=>(k==null?void 0:k.coin)==="USDC");Ne(_?_.total:"0")}catch(h){ge(h.message||"Failed to load USDC balance.")}finally{ae(!1)}}function xn(){const Ee=Kn||window.localStorage.getItem("hyperAddress");Ee&&Yn(Ee)}async function Mt(){try{F(!0);const Ee=window.localStorage.getItem("hyperToken"),h=window.localStorage.getItem("hyperAddress");if(!Ee||!h){ve(!1),Ft(!0);return}const S=await(await fetch(`${Ue}/api/wallet/confirmed-list`,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:h.toLowerCase(),token:Ee})})).json();S!=null&&S.success?r((S==null?void 0:S.data)||[]):Y((S==null?void 0:S.error_message)||"Failed to load wallets.")}catch(Ee){Y(Ee.message||"Wallet list error.")}finally{F(!1)}}async function tn(){if(!ye){Ft(!0);return}if(en)try{J(!0),Y("");const Ee=window.localStorage.getItem("hyperToken"),h=window.localStorage.getItem("hyperAddress");if(!Ee||!h){ve(!1),Ft(!0);return}const S=P===1?{margin:100,budget:1,coin:o,orderPerHour:Number(C),spread:Number(v),methodType:2}:{margin:Number(c),coin:o,spread:Number(x),methodType:1,budget:1},_={address:h.toLowerCase(),token:Ee,wallet_id:Number(s),farming_params:S},T=await(await fetch(`${Ue}/api/hyper/farming/save/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(_)})).json();T!=null&&T.success?V(!0):Y((T==null?void 0:T.message)||"Start failed.")}catch(Ee){Y(Ee.message||"An error occurred while saving.")}finally{J(!1)}}async function In(){if(!ye)return Ft(!0);if(s)try{re(!0),Y("");const Ee=window.localStorage.getItem("hyperToken"),h=window.localStorage.getItem("hyperAddress");if(!Ee||!h){ve(!1),Ft(!0);return}const S=await(await fetch(`${Ue}/api/hyper/farming/stop/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({address:h.toLowerCase(),token:Ee,wallet_id:Number(s)})})).json();S!=null&&S.success?V(!1):Y((S==null?void 0:S.error_message)||"Stop failed.")}catch(Ee){Y(Ee.message||"An error occurred while stopping.")}finally{re(!1)}}const Xn=32,or={control:(Ee,h)=>({...Ee,backgroundColor:"#242424",borderColor:h.isFocused?"#67FFBD":"#353535",minHeight:Xn,height:Xn,boxShadow:"none",cursor:"pointer",alignItems:"center"}),valueContainer:Ee=>({...Ee,height:Xn,paddingTop:0,paddingBottom:0,display:"flex",alignItems:"center"}),indicatorsContainer:Ee=>({...Ee,height:Xn}),input:Ee=>({...Ee,color:"#FFFFFF",margin:0,padding:0}),singleValue:Ee=>({...Ee,color:"#FFFFFF",margin:0,lineHeight:"normal",fontSize:"12px",display:"flex",alignItems:"center"}),placeholder:Ee=>({...Ee,color:"#7F7F7F",fontSize:"12px"}),menu:Ee=>({...Ee,backgroundColor:"#242424",border:"1px solid #353535",zIndex:9999}),menuList:Ee=>({...Ee,paddingTop:0,paddingBottom:0}),option:(Ee,h)=>({...Ee,backgroundColor:h.isFocused?"#2e2e2e":"#242424",color:"#FFFFFF",cursor:"pointer",minHeight:Xn,display:"flex",alignItems:"center",fontSize:"12px"}),dropdownIndicator:Ee=>({...Ee,color:"#9B9B9B",paddingTop:4,paddingBottom:4}),indicatorSeparator:Ee=>({...Ee,backgroundColor:"#353535"})},lr=Ee=>{var h;return i.jsx(Ca.Option,{...Ee,children:i.jsxs("div",{className:"flex items-center gap-2 px-3",children:[((h=Ee.data)==null?void 0:h.icon)&&i.jsx("img",{src:Ee.data.icon,alt:Ee.data.label,className:"w-4 h-4",onError:p=>{p.currentTarget.style.display="none"}}),i.jsx("span",{className:"text-white text-[13px]",children:Ee.data.label})]})})},Qt=Ee=>{var h;return i.jsx(Ca.SingleValue,{...Ee,children:i.jsxs("div",{className:"flex items-center gap-2",children:[((h=Ee.data)==null?void 0:h.icon)&&i.jsx("img",{src:Ee.data.icon,alt:Ee.data.label,className:"w-4 h-4",onError:p=>{p.currentTarget.style.display="none"}}),i.jsx("span",{className:"text-white text-[13px]",children:Ee.data.label})]})})},zn=m.useMemo(()=>at.map(Ee=>{let p=`https://app.hyperliquid.xyz/coins/${Ee==="USDT0"?"USDT":Ee}.svg`;return Ee==="PUP"&&(p="https://www.basedapp.io/_next/image?url=%2Ftokens%2Fpng%2FPUP_USDC.png&w=32&q=75"),{value:Ee,label:Ee,icon:p}}),[]),Jn=async()=>{var p,S;const Ee=window.localStorage.getItem("hyperToken"),h=window.localStorage.getItem("hyperAddress");if(!(!Ee||!h))try{Q(!0);const _=await Ei(h.toLowerCase(),Ee);_!=null&&_.success?(Ke(_==null?void 0:_.telegram_chat_id),Bt(_==null?void 0:_.subscriber_role),$t(_==null?void 0:_.subs_expire_day),qe((p=_==null?void 0:_.mushboomer_counts)==null?void 0:p.eth),Ye((S=_==null?void 0:_.mushboomer_counts)==null?void 0:S.sol),ht(_==null?void 0:_.referral_code),Zt(_==null?void 0:_.refcode),zt(_==null?void 0:_.whitelist),Et(Ee),nt(h),un(!0),Q(!1)):(window.localStorage.removeItem("hyperToken"),window.localStorage.removeItem("hyperAddress"),Et(""),nt(""),Q(!1))}catch(_){console.error("Token verification error:",_),console.error(_.message||"An unknown error occurred."),Q(!1)}},Lt=R||U||ne||X||z,jn=G&&!X;return e?i.jsxs(i.Fragment,{children:[$e&&Na.createPortal(i.jsx("div",{className:"fixed inset-0 z-[999999999]",children:i.jsx(f5,{open:$e,setOpen:it,handleListRequest:Mt,handlePageChange:()=>{}})}),document.body),i.jsx(bd,{open:qt,setOpen:It,transactionHash:nn,transactionLoading:ft,paymentPresaleRole:cn,errorFunds:ie,activeMethod:2}),i.jsxs("div",{className:"fixed inset-0 z-[9000] flex items-center justify-center",children:[i.jsx("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-[2px]",onClick:()=>!Lt&&t(!1)}),i.jsxs("div",{className:"relative flex items-start gap-4 px-3 w-full max-w-[1000px]",children:[i.jsx(f2,{current:"basedapp",onCloseCurrent:()=>!Lt&&t(!1)}),i.jsxs("div",{className:"relative w-[680px] max-w-[92vw] rounded-3xl bg-[#1B1B1B] text-white shadow-xl border border-[#ff6940] max-h-[90dvh] overflow-y-auto",children:[i.jsxs("div",{className:"p-5 border-b border-[#353535] rounded-t-3xl relative",children:[i.jsxs("div",{className:"flex justify-start items-baseline gap-2",children:[i.jsx("img",{src:cke,alt:"BasedApp",className:"h-6"}),i.jsx("span",{className:"text-[34px] font-semibold text-[#ff6940]",children:"farming"})]}),i.jsx("div",{className:"text-xs font-normal text-[#7C7C7C] mt-2 pr-[148px]",children:"BasedApp farming module lets you configure automated trading by selecting a wallet, coin, margin, and spread or orders per hour."}),i.jsxs("div",{onClick:Ee=>{window.localStorage.getItem("hyperToken")?it(!0):Ft(!0)},className:"absolute top-[70px] sm:top-8 right-5 h-6 sm:h-8 pl-2 sm:pl-3 pr-4 py-3 bg-[#7445ff] rounded-[10px] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-[#8860ff] justify-center items-center gap-1.5 inline-flex cursor-pointer",children:[i.jsx("div",{"data-svg-wrapper":!0,children:i.jsxs("svg",{width:"19",height:"18",viewBox:"0 0 19 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("path",{d:"M5 9H14",stroke:"white",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),i.jsx("path",{d:"M9.5 13.5V4.5",stroke:"white",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})}),i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px] !w-30",children:"Add Account"})]}),i.jsxs("div",{onClick:()=>{window.open("https://www.youtube.com/watch?v=2kBqpY09aDM","_blank")},className:"absolute top-[110px] sm:top-[84px] right-5 h-6 sm:h-8 pl-[26px] sm:pl-[32px] pr-7 py-3 bg-[#FF0000] rounded-[10px] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-[#ff4d4d] justify-center items-center gap-1 inline-flex cursor-pointer",children:[i.jsx("div",{"data-svg-wrapper":!0,children:i.jsx(qk,{})}),i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px]",children:"YouTube"})]})]}),G&&i.jsx("div",{className:"px-5 pt-3",children:i.jsxs("div",{className:"flex items-center justify-between rounded-[12px] border border-[#2A2A2A] bg-[#1f1f1f] px-3 py-2",children:[i.jsx("span",{className:"text-[12px] text-[#CECECE]",children:"Your farm process is currently running. You can follow it here."}),i.jsx("a",{href:"https://www.basedapp.io/leaderboard",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center justify-center h-8 px-4 rounded-[10px] text-[12px] font-semibold border bg-[#7446FF] border-[#8861FF] hover:bg-[#5834C3] text-white",children:"Leaderboard"})]})}),P===2&&i.jsx("div",{className:"px-5 pt-3",children:i.jsx("div",{className:"text-[12px] text-[#FFD166] bg-[#2a2413] border border-[#6b5c2d] rounded-md px-3 py-2",children:"Use a lower margin compared to your spot balance. Margin should be less than 50% of the Spot balance in order for system to keep farming. Example: For 10.000$ Spot equity use 2.000$ in margin."})}),ye&&Cn&&i.jsx("div",{className:"px-5 pt-3",children:je?i.jsx("div",{className:"text-[12px] text-[#FFD166] bg-[#2a2413] border border-[#6b5c2d] rounded-md px-3 py-2",children:"Checking builder approval..."}):sn?null:i.jsxs("div",{className:"flex flex-col gap-2 text-[12px] text-[#FFD166] bg-[#2a2413] border border-[#6b5c2d] rounded-md px-3 py-2",children:[i.jsx("span",{children:"Action required: Please log in via BasedApp and approve the Builder fee for this wallet to continue."}),i.jsx("a",{href:"https://app.based.one/register?ref=ANABOLIC",target:"_blank",rel:"noopener noreferrer",className:"inline-block text-center text-[#1B1B1B] bg-[#ff6940] rounded-md px-3 py-1 font-bold transition",children:"BasedApp Login"})]})}),i.jsxs("div",{className:"p-5 space-y-6",children:[pe&&i.jsx("div",{className:"text-[12px] text-[#FF797C] bg-[#3b2626] border border-[#ff797c]/30 rounded-md px-3 py-2",children:pe}),i.jsxs("div",{className:"w-full rounded-full border border-[#2A2A2A] bg-transparent p-1 flex gap-2",children:[i.jsx("div",{className:`flex-1 h-9 rounded-full text-[13px] transition cursor-pointer flex justify-center items-center font-semibold ${P===2?"bg-[#242424] text-white shadow-[inset_0_0_0_1px_rgba(255,255,255,0.06)]":"text-[#B3B3B3]"} ${jn?"opacity-60 cursor-not-allowed":""}`,onClick:()=>!jn&&I(2),children:"Econo Mode"}),i.jsx("div",{className:`flex-1 h-9 rounded-full text-[13px] transition cursor-pointer flex justify-center items-center font-semibold ${P===1?"bg-[#242424] text-white shadow-[inset_0_0_0_1px_rgba(255,255,255,0.06)]":"text-[#B3B3B3]"} ${jn?"opacity-60 cursor-not-allowed":""}`,onClick:()=>!jn&&I(1),children:"Farmer Mode"})]}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px]",children:"Select Wallet"}),i.jsxs("div",{className:"relative",children:[i.jsx(Cl,{styles:or,isDisabled:Lt||R||jn,isLoading:R,options:Gn,value:Gn.find(Ee=>String(Ee.value)===String(s))||null,onChange:Ee=>{if(jn)return;a((Ee==null?void 0:Ee.value)??""),Qe(null);const h=(Ee==null?void 0:Ee.raw)||{},p=h.address||h.evm_address||h.wallet_address||h.public_address||h.eth_address||h.addr||null;ye&&(h==null?void 0:h.version)===3&&p&&an(p)},placeholder:ye?R?"Loading...":"Select":"Connect to select",isSearchable:!0,onMenuOpen:()=>{ye||Ft(!0)},menuIsOpen:ye?void 0:!1}),!ye&&i.jsx("button",{type:"button",onClick:()=>Ft(!0),className:"absolute inset-0 rounded-md cursor-pointer bg-transparent","aria-label":"Connect to select",title:"Connect"})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px]",children:"Select Coin"}),i.jsx(Cl,{styles:or,components:{Option:lr,SingleValue:Qt},isDisabled:Lt||jn,options:zn,value:zn.find(Ee=>Ee.value===o)||null,onChange:Ee=>{jn||l((Ee==null?void 0:Ee.value)??"")},placeholder:"Select",isSearchable:!0})]})]}),P===1?i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px]",children:"Trade Per Hour"}),i.jsx("input",{value:C,onChange:Ee=>{const h=Ee.target.value.trim();if(h==="")return N("");on(h)&&N(h)},onKeyDown:gn,inputMode:"numeric",autoComplete:"off",placeholder:"e.g. 6 (max 180)",className:`w-full h-8 px-3 rounded-md bg-[#242424] border text-[14px] font-inter outline-none placeholder:text-[#7F7F7F] ${C===""?"border-[#353535]":Vn?"border-[#353535] focus:border-[#67FFBD]":"border-[#FF797C]"}`,disabled:Lt||jn}),C!==""&&!Vn&&i.jsx("div",{className:"text-[#FF797C] text-[12px]",children:"Enter an integer between 1 and 180."})]}),i.jsxs("div",{className:"space-y-2 hidden",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px]",children:"Spread %"}),i.jsxs("div",{className:"relative",children:[i.jsx("span",{className:"absolute left-2 top-1/2 -translate-y-1/2 text-[#7F7F7F] font-semibold",children:"%"}),i.jsx("input",{value:v,onChange:Ee=>{const h=Ee.target.value.trim();if(h==="")return w("");dn(h)&&w(h)},onKeyDown:gn,inputMode:"decimal",autoComplete:"off",placeholder:"Default 0.01",className:`w-full h-8 pl-7 pr-3 rounded-md bg-[#242424] border text-[14px] font-inter outline-none placeholder:text-[#7F7F7F] ${v===""?"border-[#353535]":yn?"border-[#353535] focus:border-[#67FFBD]":"border-[#FF797C]"}`,disabled:Lt||jn})]}),v!==""&&!yn&&i.jsx("div",{className:"text-[#FF797C] text-[12px]",children:"Enter a percentage between 0 and 100."}),o==="PUP"&&i.jsxs("div",{className:"mt-2 text-[12px] text-[#FFD166] bg-[#2a2413] border border-[#6b5c2d] rounded-md px-3 py-2",children:[i.jsx("div",{children:"⚠️ PUP Spread Warning"}),i.jsx("div",{children:"Due to high price volatility, we recommend setting your spread to at least %0.03 for PUP."})]})]})]}):i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px]",children:i.jsx(mi,{content:"The portion of your budget used per trade. A higher margin means larger trade size, while a lower margin spreads your budget across more trades.",children:i.jsx("span",{children:"Margin (Amount)"})})}),i.jsx("input",{value:c,onChange:Ee=>{const h=Ee.target.value.trim();if(h==="")return u("");dn(h)&&u(h)},onKeyDown:gn,inputMode:"decimal",autoComplete:"off",placeholder:"e.g. 2000",className:`w-full h-8 px-3 rounded-md bg-[#242424] border text-[14px] font-inter outline-none placeholder:text-[#7F7F7F] ${c===""?"border-[#353535]":Nn?"border-[#353535] focus:border-[#67FFBD]":"border-[#FF797C]"}`,disabled:Lt||jn}),c!==""&&!Nn&&i.jsx("div",{className:"text-[#FF797C] text-[12px]",children:"Enter a value greater than or equal to 11."})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px]",children:"Spread %"}),i.jsxs("div",{className:"relative",children:[i.jsx("span",{className:"absolute left-2 top-1/2 -translate-y-1/2 text-[#7F7F7F] font-semibold",children:"%"}),i.jsx("input",{value:x,onChange:Ee=>{const h=Ee.target.value.trim();if(h==="")return g("");dn(h)&&g(h)},onKeyDown:gn,inputMode:"decimal",autoComplete:"off",placeholder:"e.g. 0.5",className:`w-full h-8 pl-7 pr-3 rounded-md bg-[#242424] border text-[14px] font-inter outline-none placeholder:text-[#7F7F7F] ${x===""?"border-[#353535]":kn?"border-[#353535] focus:border-[#67FFBD]":"border-[#FF797C]"}`,disabled:Lt||jn})]}),x!==""&&!kn&&i.jsx("div",{className:"text-[#FF797C] text-[12px]",children:"Enter a percentage between 0 and 100."}),o==="PUP"&&i.jsxs("div",{className:"mt-2 text-[12px] text-[#FFD166] bg-[#2a2413] border border-[#6b5c2d] rounded-md px-3 py-2",children:[i.jsx("div",{children:"⚠️ PUP Spread Warning"}),i.jsx("div",{children:"Due to high price volatility, we recommend setting your spread to at least 0.03 for PUP."})]})]})]})]}),i.jsxs("div",{className:"flex items-start gap-3 p-3 border-t border-[#353535] bg[rgba(27,27,27,0.32)] rounded-b-3xl",children:[i.jsxs("div",{className:"flex flex-col gap-1",children:[ye&&i.jsxs("div",{className:"text-[12px] text-[#9B9B9B] flex items-center gap-2",children:["Available Spot Balance (USDC):",i.jsx("span",{className:"text-white",children:ee?"Loading...":he?"—":Tt(fe??"0")}),i.jsx("div",{onClick:xn,className:"flex justify-center items-center cursor-pointer",title:"Refresh balance",children:i.jsx(jS,{className:`w-4 h-4 ${ee?"animate-spin":""}`})})]}),ye&&o&&i.jsxs("div",{className:"text-[12px] text-[#9B9B9B] flex items-center gap-2",children:["Available ",o," Balance:",i.jsx("span",{className:"text-white",children:Tt(Me==null?void 0:Me.total)}),i.jsxs("span",{className:"text-[#9B9B9B]",children:["(~",Tt(Me==null?void 0:Me.entryNtl)," USDC)"]}),i.jsx("div",{onClick:xn,className:"flex justify-center items-center cursor-pointer",title:"Refresh balance",children:i.jsx(jS,{className:`w-4 h-4 ${ee?"animate-spin":""}`})})]})]}),i.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[i.jsx("button",{onClick:()=>!Lt&&t(!1),className:"inline-flex items-center justify-center h-8 px-5 rounded-[10px] border bg-black/5 border-[#353535] text-white text-[13px] font-inter hover:border-white disabled:opacity-60",disabled:Lt,children:"Cancel"}),ye?G?i.jsx("button",{onClick:In,disabled:!s||Lt,className:"inline-flex items-center justify-center h-8 px-6 rounded-[10px] text-[13px] font-inter border border-[#353535] hover:border-[#FF797C] text-[#FF797C] bg-[rgba(27,27,27,0.32)] disabled:opacity-60",children:X?"Stopping...":"Stop"}):i.jsx("button",{onClick:tn,disabled:!en||Lt,className:`inline-flex items-center justify-center h-8 px-6 rounded-[10px] text-[13px] font-inter border ${!en||Lt?"bg-[#2a2a2a] border-[#3a3a3a] opacity-60 cursor-not-allowed":"bg-[#7446FF] border-[#8861FF] hover:bg-[#5834C3]"}`,children:ne?"Starting...":"Start"}):i.jsx("button",{onClick:()=>Ft(!0),className:"inline-flex items-center justify-center h-8 px-6 rounded-[10px] text-[13px] font-inter border bg-[#67FFBD] border-[#67FFBD] text-black hover:opacity-90",children:"Connect"})]})]}),(R||U)&&i.jsx("div",{className:"absolute inset-0 rounded-3xl bg-black/40 flex items-center justify-center text-sm",children:"Loading..."})]})]})]})]}):null}const Hoe=({open:e=!1,setOpen:t=()=>{},defaultMethod:n=2})=>{const{setSignModalOpen:r,setTelegramChatId:s,setSubscriberRole:a,setSubsExpireDay:o,setMushboomerETH:l,setMushboomerSOL:c,setIsReferralCode:u,setIsReferralCodeName:d,setIsWhitelist:f,setHyperToken:x,setHyperAddress:g}=m.useContext(Qr);ns();const[v,w]=m.useState(!1),[C,N]=m.useState(!1),[P,I]=m.useState(""),[R,F]=m.useState(""),[U,L]=m.useState(""),[z,Q]=m.useState(""),[ne,J]=m.useState(""),[X,re]=m.useState("OFF"),[pe,Y]=m.useState(""),[ie,oe]=m.useState(""),[G,V]=m.useState("LONG"),[ee,ae]=m.useState("MARKET"),[fe,Ne]=m.useState(""),[he,ge]=m.useState(""),[ye,ve]=m.useState(""),[je,Ie]=m.useState(!1),[Le,Qe]=m.useState(!1),[$e,it]=m.useState(!1),[tt,lt]=m.useState(!1),[ft,ut]=m.useState(""),[qt,It]=m.useState(""),[nn,jt]=m.useState(!0),[cn,un]=m.useState(!1),[Ft,Ke]=m.useState(!1),[Bt,$t]=m.useState(!1),[qe,Ye]=m.useState(!1),[ht,Zt]=m.useState(!1),[zt,Et]=m.useState(!1),[nt,Ue]=m.useState(""),[Rt,We]=m.useState(!0),[at,mt]=m.useState(2),Dt="https://dextrabothypev2.nftinit.io",Tt="",dn={ASTERUSDT:[[50,0,2500],[25,2500,5e3],[20,5e3,1e4],[10,1e4,1e5],[5,1e5,2e5],[2,2e5,6e5],[1,6e5,1e6]],BTCUSDT:[[100,0,5e5],[75,5e5,1e6],[50,1e6,25e5],[25,25e5,5e6],[20,5e6,125e5],[10,125e5,25e6],[5,25e6,75e6],[4,75e6,125e6],[3,125e6,2e8],[2,2e8,25e7],[1,25e7,375e6]],ETHUSDT:[[100,0,3e5],[75,3e5,6e5],[50,6e5,375e4],[20,375e4,12e6],[10,12e6,15e6],[5,15e6,45e6],[4,45e6,75e6],[3,75e6,12e7],[2,12e7,15e7],[1,15e7,225e6]],BNBUSDT:[[100,0,1e4],[75,1e4,5e4],[50,5e4,625e3],[20,625e3,2e6],[10,2e6,25e5],[5,25e5,75e5],[4,75e5,125e5],[3,125e5,2e7],[2,2e7,25e6],[1,25e6,375e5]],SOLUSDT:[[25,0,2e5],[15,2e5,4e5],[10,4e5,4e6],[8,4e6,8e6],[6,8e6,2e7],[5,2e7,4e7],[4,4e7,8e7],[3,8e7,12e7],[2,12e7,16e7],[1,16e7,2e8]]},on={ASTERUSDT:{market:5e3,unit:"ASTER"},BTCUSDT:{market:20,unit:"BTC"},ETHUSDT:{market:100,unit:"ETH"},BNBUSDT:{market:300,unit:"BNB"},SOLUSDT:{market:3e3,unit:"SOL"}},gn=k=>{if(k==null||isNaN(k))return"";const T=Math.abs(k),B=q=>q.toFixed(1).replace(/\.0$/,"");return T>=1e9?`${B(k/1e9)}B`:T>=1e6?`${B(k/1e6)}M`:T>=1e3?`${B(k/1e3)}K`:`${k}`},Nn=(k,T)=>{const B=dn[k]||[];if(!B.length||!T)return null;let q=null;for(const[te,ue,de]of B)T<=te&&(!q||te<q.maxLev)&&(q={min:ue,max:de,maxLev:te});return q},kn=m.useMemo(()=>[{value:"ASTERUSDT",label:"ASTERUSDT",icon:"https://static.astherus.finance/image/admin_mgs_image_upload/20250916/6dba1412-ddfb-4314-bfdf-87fa11f2daa6.png",maxLeverage:50},{value:"BTCUSDT",label:"BTCUSDT",icon:"https://app.hyperliquid.xyz/coins/BTC.svg",maxLeverage:100},{value:"ETHUSDT",label:"ETHUSDT",icon:"https://app.hyperliquid.xyz/coins/ETH.svg",maxLeverage:100},{value:"BNBUSDT",label:"BNBUSDT",icon:"https://app.hyperliquid.xyz/coins/BNB.svg",maxLeverage:100},{value:"SOLUSDT",label:"SOLUSDT",icon:"https://app.hyperliquid.xyz/coins/SOL.svg",maxLeverage:25}],[]),yn=k=>{var T;return((T=kn.find(B=>B.value===k))==null?void 0:T.maxLeverage)??100},Vn=k=>{["e","E","+","-"].includes(k.key)&&k.preventDefault()},Gn=k=>/^\d*\.?\d{0,6}$/.test(k),Dn=k=>/^\d*$/.test(k),Kn=m.useMemo(()=>{if(pe==="")return!1;const k=Number(pe);return Number.isInteger(k)&&k>=1&&k<=180},[pe]),Cn=m.useMemo(()=>{if(ie==="")return!1;const k=Number(ie),T=yn(ne);return Number.isInteger(k)&&k>=1&&k<=T},[ie,ne]),sn=m.useMemo(()=>{if(fe==="")return!1;const k=Number(fe);return!Number.isNaN(k)&&k>=0&&k<=100},[fe]),Me=m.useMemo(()=>{if(he==="")return!1;const k=Number(he);return!Number.isNaN(k)&&k>=0&&k<=100},[he]),en=m.useMemo(()=>{if(ye==="")return!1;const k=Number(ye);return!Number.isNaN(k)&&k>=0&&k<=100},[ye]),an=Number(ie||0),Nt=Cn&&ne?Nn(ne,an):null,Yn=v&&P.trim()!==""&&R.trim()!==""&&(X!=="ON"||U.trim()!==""&&z.trim()!=="")&&ne!==""&&Kn&&Cn&&(G==="LONG"||G==="SHORT")&&(ee==="LIMIT"||ee==="MARKET")&&Rt,xn=()=>(localStorage.getItem("hyperAddress")||"dextra").toLowerCase(),Mt=()=>`asterCreds:${xn()}`,tn=()=>{try{const k=localStorage.getItem(Mt());if(!k)return;const T=JSON.parse(k);T.apiKey&&I(T.apiKey),T.apiSecret&&F(T.apiSecret),T.apiKeyTwo&&L(T.apiKeyTwo),T.apiSecretTwo&&Q(T.apiSecretTwo),typeof T.remember=="boolean"&&jt(T.remember)}catch{}},In=()=>{if(nn)try{localStorage.setItem(Mt(),JSON.stringify({apiKey:P,apiSecret:R,apiKeyTwo:U,apiSecretTwo:z,remember:!0}))}catch{}},Xn=()=>{try{localStorage.removeItem(Mt())}catch{}};m.useEffect(()=>{if(!e)return;const k=localStorage.getItem("hyperToken"),T=localStorage.getItem("hyperAddress");w(!!(k&&T));const B=setInterval(()=>{const q=localStorage.getItem("hyperToken"),te=localStorage.getItem("hyperAddress");w(!!(q&&te))},800);return()=>clearInterval(B)},[e]),m.useEffect(()=>{!e||!v||(or(),Ee())},[e,v]),m.useEffect(()=>{e&&(he===""&&ge(Tt),fe===""&&Ne(Tt),ye===""&&ve(Tt))},[e]),m.useEffect(()=>{if(!ne)return;const k=yn(ne),T=Number(ie);!Number.isNaN(T)&&T>k&&oe(String(k)),!Number.isNaN(T)&&T<1&&ie!==""&&oe("1")},[ne]),m.useEffect(()=>{e&&(nn&&In(),nn||Xn())},[P,R,U,z,nn,e]);async function or(){var k,T,B,q,te;try{Qe(!0),ut("");const ue=window.localStorage.getItem("hyperToken"),de=window.localStorage.getItem("hyperAddress");if(!ue||!de){N(!1),tn();return}const Se=await(await fetch(`${Dt}/api/hyper/ast_farming/info/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({address:de.toLowerCase(),token:ue})})).json(),ke=(k=Se==null?void 0:Se.data)==null?void 0:k.farming_params;if(Se!=null&&Se.success&&ke){N(!0);const Re=((T=Se==null?void 0:Se.data)==null?void 0:T.aster_apikey)??"",Ge=((B=Se==null?void 0:Se.data)==null?void 0:B.aster_apisecret)??"",Fe=(ke==null?void 0:ke.api_key_2)??"",st=(ke==null?void 0:ke.api_secret_2)??"";Re&&I(String(Re)),Ge&&F(String(Ge)),Fe&&L(String(Fe)),st&&Q(String(st)),((q=Se==null?void 0:Se.data)==null?void 0:q.delta_neutral)!==void 0&&re((te=Se==null?void 0:Se.data)!=null&&te.delta_neutral?"ON":"OFF"),ke!=null&&ke.coin&&J(String(ke.coin)),(ke==null?void 0:ke.orderPerHour)!=null&&Y(String(ke.orderPerHour)),(ke==null?void 0:ke.leverage)!=null&&oe(String(ke.leverage)),ke!=null&&ke.direction&&V(String(ke.direction).toUpperCase()==="SHORT"?"SHORT":"LONG"),ke!=null&&ke.order_type&&ae(String(ke.order_type)==="limit"?"LIMIT":"MARKET"),(ke==null?void 0:ke.upspread)!=null&&Ne(String(ke.upspread)),(ke==null?void 0:ke.downspread)!=null&&ge(String(ke.downspread)),(ke==null?void 0:ke.upspread)!=null&&ve(String(ke.upspread))}else N(!1),re("OFF");(!P&&!R||X==="ON"&&!U&&!z)&&tn()}catch{N(!1),tn(),re("OFF")}finally{Qe(!1)}}async function lr(){if(!v){r(!0);return}if(Yn)try{it(!0),ut("");const k=window.localStorage.getItem("hyperToken"),T=window.localStorage.getItem("hyperAddress");if(!k||!T){r(!0);return}const B={methodType:X==="ON"?2:1,coin:ne,orderPerHour:Number(pe),leverage:Number(ie),...X==="ON"?{api_key_2:U,api_secret_2:z}:ee==="LIMIT"?{upspread:Number(ye),direction:G,order_type:ee==="LIMIT"?"limit":"market"}:{upspread:Number(fe),downspread:Number(he),direction:G,order_type:ee==="LIMIT"?"limit":"market"}},q={address:T.toLowerCase(),token:k,apikey:P,apisecret:R,farming_params:B,delta_neutral:X==="ON"},ue=await(await fetch(`${Dt}/api/hyper/ast_farming/save/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(q)})).json();ue!=null&&ue.success?(N(!0),nn&&In()):ut((ue==null?void 0:ue.error_message)||"Start failed.")}catch(k){ut(k.message||"An error occurred while saving.")}finally{it(!1)}}async function Qt(){if(!v){r(!0);return}try{lt(!0),ut("");const k=window.localStorage.getItem("hyperToken"),T=window.localStorage.getItem("hyperAddress");if(!k||!T){r(!0);return}const q=await(await fetch(`${Dt}/api/hyper/ast_farming/stop/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({address:T.toLowerCase(),token:k})})).json();q!=null&&q.success?N(!1):ut((q==null?void 0:q.error_message)||"Stop failed.")}catch(k){ut(k.message||"An error occurred while stopping.")}finally{lt(!1)}}const zn={control:(k,T)=>({...k,backgroundColor:"#242424",borderColor:T.isFocused?"#67FFBD":"#353535",minHeight:32,height:32,boxShadow:"none",cursor:"pointer",alignItems:"center"}),valueContainer:k=>({...k,height:32,paddingTop:0,paddingBottom:0,display:"flex",alignItems:"center"}),indicatorsContainer:k=>({...k,height:32}),input:k=>({...k,color:"#FFFFFF",margin:0,padding:0}),singleValue:k=>({...k,color:"#FFFFFF",margin:0,lineHeight:"normal",fontSize:"12px",display:"flex",alignItems:"center"}),placeholder:k=>({...k,color:"#7F7F7F",fontSize:"12px"}),menu:k=>({...k,backgroundColor:"#242424",border:"1px solid #353535",zIndex:9999}),menuList:k=>({...k,paddingTop:0,paddingBottom:0}),option:(k,T)=>({...k,backgroundColor:T.isFocused?"#2e2e2e":"#242424",color:"#FFFFFF",cursor:"pointer",minHeight:32,display:"flex",alignItems:"center",fontSize:"12px"}),dropdownIndicator:k=>({...k,color:"#9B9B9B",paddingTop:4,paddingBottom:4}),indicatorSeparator:k=>({...k,backgroundColor:"#353535"})},Jn=({max:k})=>i.jsxs("span",{className:"inline-flex items-center h-4 px-1.5 py-2 rounded bg-black/40 border border-[#2A2A2A] text-[10px] text-[#CECECE] font-bold",children:[k,"x"]}),Lt=k=>{var T;return i.jsx(Ca.Option,{...k,children:i.jsxs("div",{className:"flex items-center gap-2 px-3",children:[((T=k.data)==null?void 0:T.icon)&&i.jsx("img",{src:k.data.icon,alt:k.data.label,className:"w-4 h-4 rounded-[4px]",onError:B=>B.currentTarget.style.display="none"}),i.jsx("span",{className:"text-white text-[13px]",children:k.data.label}),i.jsx(Jn,{max:k.data.maxLeverage})]})})},jn=k=>{var T;return i.jsx(Ca.SingleValue,{...k,children:i.jsxs("div",{className:"flex items-center gap-2",children:[((T=k.data)==null?void 0:T.icon)&&i.jsx("img",{src:k.data.icon,alt:k.data.label,className:"w-4 h-4 rounded-[4px]",onError:B=>B.currentTarget.style.display="none"}),i.jsx("span",{className:"text-white text-[13px]",children:k.data.label}),i.jsx(Jn,{max:k.data.maxLeverage})]})})},Ee=async()=>{var B,q;const k=window.localStorage.getItem("hyperToken"),T=window.localStorage.getItem("hyperAddress");if(!(!k||!T))try{Ie(!0);const te=await Ei(T.toLowerCase(),k);te!=null&&te.success?(s(te==null?void 0:te.telegram_chat_id),a(te==null?void 0:te.subscriber_role),o(te==null?void 0:te.subs_expire_day),l((B=te==null?void 0:te.mushboomer_counts)==null?void 0:B.eth),c((q=te==null?void 0:te.mushboomer_counts)==null?void 0:q.sol),u(te==null?void 0:te.referral_code),d(te==null?void 0:te.refcode),f(te==null?void 0:te.whitelist),x(k),g(T),We(!0),Ie(!1)):(window.localStorage.removeItem("hyperToken"),window.localStorage.removeItem("hyperAddress"),x(""),g(""),Ie(!1))}catch(te){console.error("Token verification error:",te),console.error(te.message||"An unknown error occurred."),Ie(!1)}},h=kn;if(!e)return null;const p=Le||$e||tt||je,S=C&&!tt,_=yn(ne);return i.jsxs(i.Fragment,{children:[i.jsx(bd,{open:zt,setOpen:Et,transactionHash:nt,transactionLoading:ht,paymentPresaleRole:Rt,errorFunds:qt,activeMethod:2}),i.jsxs("div",{className:"fixed inset-0 z-[9000] flex items-center justify-center",children:[i.jsx("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-[2px]",onClick:()=>!p&&t(!1)}),i.jsxs("div",{className:"relative flex items-start gap-4 px-3 w-full max-w-[1000px]",children:[i.jsx(f2,{current:"aster",onCloseCurrent:()=>!p&&t(!1)}),i.jsxs("div",{className:"relative w-[680px] max-w-[92vw] rounded-3xl bg-[#1B1B1B] text-white shadow-xl border border-[#F8D4AB] max-h-[97dvh] overflow-y-auto",children:[i.jsxs("div",{className:`${X==="ON"?"pb-3.5":"pb-2"} px-5 pt-5 border-b border-[#353535] rounded-t-3xl relative`,children:[i.jsxs("div",{className:"flex justify-start items-center gap-2",children:[i.jsx("img",{src:"https://static.asterdex.com/cloud-futures/static/images/aster/logo.svg",alt:"Dextrabot - Aster Farming"}),i.jsx("span",{className:"text-[24px] font-semibold text-[#F8D4AB] mt-[1px]",children:"farming"})]}),i.jsxs("div",{className:"flex justify-between items-center gap-4",children:[i.jsx("div",{className:"text-xs font-normal text-[#7C7C7C] mt-2",children:"Aster Farming module lets you set up automated farming by providing your API Key and Secret, selecting a pair, defining orders per hour, leverage, direction, and TP/SL percentages."}),i.jsx("div",{className:"flex flex-col items- justify-start gap-1",children:i.jsxs("div",{onClick:()=>window.open("https://www.youtube.com/watch?v=qFJxq-vzctE","_blank"),className:"h-6 sm:h-7 w-[130px] py-2 bg-[#FF0000] rounded-[10px] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-[#ff4d4d] inline-flex justify-center items-center gap-1 cursor-pointer",children:[i.jsx("div",{"data-svg-wrapper":!0,children:i.jsx(qk,{})}),i.jsx("div",{className:"text-white text-[13px] font-medium leading-[8px]",children:"YouTube"})]})})]}),C&&at===2&&i.jsx("div",{className:"pt-4",children:i.jsxs("div",{className:"flex items-center justify-between rounded-[12px] border border-[#2A2A2A] bg-[#1f1f1f] px-3 py-2",children:[i.jsx("span",{className:"text-[12px] text-[#CECECE]",children:"Your farm process is currently running. You can follow it here."}),i.jsx("a",{href:"https://www.asterdex.com/en/stage3/statistics",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center justify-center h-8 px-4 rounded-[10px] text-[12px] font-semibold border bg-[#F8D4AB] border-[#f7c080] hover:bg-[#f6e7d5] text-black hover:text-black",children:"Points"})]})})]}),i.jsxs("div",{className:`${X==="ON"?"space-y-3 pt-3.5 pb-3":"space-y-2 pt-2 pb-2"} px-5`,children:[ft&&i.jsx("div",{className:"text-[12px] text-[#FF797C] bg-[#3b2626] border border-[#ff797c]/30 rounded-md px-3 py-2",children:ft}),i.jsx("div",{className:"px-1 sm:px-4",children:i.jsx("div",{className:"w-full flex gap-2",children:i.jsx("div",{className:"flex-1 h-9 rounded-full text-[13px] transition flex justify-center items-center font-semibold",children:i.jsx("div",{className:"airdrop-btn",children:i.jsx("span",{className:"label",children:i.jsxs("span",{className:"text-[#F6D5B1] font-medium text-[11px] sm:text-sm flex items-center gap-2 min-w-max",children:[i.jsx(Uoe,{className:"w-4 h-4"}),"Stage 3"]})})})})})}),v&&!C&&at===2&&Rt&&i.jsxs("div",{className:"flex flex-col items-center gap-2 px-2 sm:px-5 ",children:[i.jsxs("div",{className:"flex justify-between items-center rounded-[12px] border border-[#2A2A2A] bg-[#1f1f1f] px-3 py-2 w-full gap-2",children:[i.jsx("div",{className:"text-white font-semibold text-[11px] sm:text-[14px] leading-4 font-manrope",children:"1) Enable Trading on Asterdex"}),i.jsx("div",{onClick:()=>{window.open("https://www.asterdex.com/en/futures/v1/BTCUSDT?ref=9876D8","_blank")},className:"flex items-center justify-center h-6 px-6 rounded-[10px] text-[13px] border bg-[#F8D4AB] border-[#F8D4AB] hover:bg-[#dbb689] cursor-pointer min-w-max text-black hover:text-black/90",children:"Enable Trading"})]}),i.jsxs("div",{className:"flex justify-between items-center rounded-[12px] border border-[#2A2A2A] bg-[#1f1f1f] px-3 py-2 w-full gap-2",children:[i.jsx("div",{className:"text-white font-semibold text-[11px] sm:text-[14px] leading-4 font-manrope",children:"2) Create Your API Keys"}),i.jsx("div",{onClick:()=>{window.open("https://www.asterdex.com/en/api-management","_blank")},className:"flex items-center justify-center h-6 px-6 rounded-[10px] text-[13px] border bg-[#F8D4AB] border-[#F8D4AB] hover:bg-[#dbb689] cursor-pointer min-w-max text-black hover:text-black/90",children:"Go to Asterdex"})]})]}),at===2&&i.jsxs("div",{className:`${X==="ON"?"space-y-6":"space-y-3"} px-3 sm:px-5 py-2 `,children:[i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[X==="ON"?i.jsxs("div",{className:"col-span-1 space-y-4 border border-[#6f604d] hover:border-[#F8D4AB]/70 rounded-lg p-2.5",children:[i.jsx("div",{className:"flex items-center justify-between border-b border-[#353535] pb-2 mb-3",children:i.jsx("span",{className:"text-[13px] font-semibold text-[#F8D4AB]",children:"API - 1"})}),i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"API Key"}),i.jsx("a",{href:"https://www.asterdex.com/en/api-management",target:"_blank",rel:"noopener noreferrer",className:"text-[11px] underline text-[#F8D4AB] hover:text-[#eee0d0]",children:"How to get API key?"})]}),i.jsxs("div",{className:"relative",children:[i.jsx("input",{value:P,onChange:k=>I(k.target.value),autoComplete:"off",placeholder:"ASTER_API_KEY",type:cn?"text":"password",className:`w-full h-8 pl-3 pr-16 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${P===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:p||S}),i.jsx("button",{type:"button",onClick:()=>un(k=>!k),className:"absolute right-1 top-1/2 -translate-y-1/2 text-[11px] text-[#9B9B9B] hover:text-white h-6 flex justify-center items-center hover:border-none hover:ring-0 focus:outline-none focus:border-none bg-transparent",disabled:p||S,children:cn?i.jsx(la,{size:14}):i.jsx(ca,{size:14})})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"API Secret"}),i.jsxs("div",{className:"relative",children:[i.jsx("input",{value:R,onChange:k=>F(k.target.value),autoComplete:"off",placeholder:"ASTER_API_SECRET",type:Ft?"text":"password",className:`w-full h-8 pl-3 pr-16 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${R===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:p||S}),i.jsx("button",{type:"button",onClick:()=>Ke(k=>!k),className:"absolute right-1 top-1/2 -translate-y-1/2 text-[11px] text-[#9B9B9B] hover:text-white h-6 flex justify-center items-center hover:border-none hover:ring-0 focus:outline-none focus:border-none bg-transparent",disabled:p||S,children:Ft?i.jsx(la,{size:14}):i.jsx(ca,{size:14})})]})]})]}):i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"API Key"}),i.jsx("a",{href:"https://www.asterdex.com/en/api-management",target:"_blank",rel:"noopener noreferrer",className:"text-[11px] underline text-[#F8D4AB] hover:text-[#eee0d0]",children:"How to get API key?"})]}),i.jsxs("div",{className:"relative",children:[i.jsx("input",{value:P,onChange:k=>I(k.target.value),autoComplete:"off",placeholder:"ASTER_API_KEY",type:cn?"text":"password",className:`w-full h-8 pl-3 pr-16 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${P===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:p||S}),i.jsx("button",{type:"button",onClick:()=>un(k=>!k),className:"absolute right-1 top-1/2 -translate-y-1/2 text-[11px] text-[#9B9B9B] hover:text-white h-6 flex justify-center items-center hover:border-none hover:ring-0 focus:outline-none focus:border-none bg-transparent",disabled:p||S,children:cn?i.jsx(la,{size:14}):i.jsx(ca,{size:14})})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"API Secret"}),i.jsxs("div",{className:"relative",children:[i.jsx("input",{value:R,onChange:k=>F(k.target.value),autoComplete:"off",placeholder:"ASTER_API_SECRET",type:Ft?"text":"password",className:`w-full h-8 pl-3 pr-16 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${R===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:p||S}),i.jsx("button",{type:"button",onClick:()=>Ke(k=>!k),className:"absolute right-1 top-1/2 -translate-y-1/2 text-[11px] text-[#9B9B9B] hover:text-white h-6 flex justify-center items-center hover:border-none hover:ring-0 focus:outline-none focus:border-none bg-transparent",disabled:p||S,children:Ft?i.jsx(la,{size:14}):i.jsx(ca,{size:14})})]})]})]}),X==="ON"&&i.jsxs("div",{className:"col-span-1 space-y-4 border border-[#6f604d] hover:border-[#F8D4AB]/70 rounded-lg p-2.5",children:[i.jsx("div",{className:"flex items-center justify-between border-b border-[#353535] pb-2 mb-3",children:i.jsx("span",{className:"text-[13px] font-semibold text-[#F8D4AB]",children:"API - 2"})}),i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"API Key 2"}),i.jsx("a",{href:"https://www.asterdex.com/en/api-management",target:"_blank",rel:"noopener noreferrer",className:"text-[11px] underline text-[#F8D4AB] hover:text-[#eee0d0]",children:"How to get API key?"})]}),i.jsxs("div",{className:"relative",children:[i.jsx("input",{value:U,onChange:k=>L(k.target.value),autoComplete:"off",placeholder:"ASTER_API_KEY_2",type:Bt?"text":"password",className:`w-full h-8 pl-3 pr-16 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${U===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:p||S}),i.jsx("button",{type:"button",onClick:()=>$t(k=>!k),className:"absolute right-1 top-1/2 -translate-y-1/2 text-[11px] text-[#9B9B9B] hover:text-white h-6 flex justify-center items-center hover:border-none hover:ring-0 focus:outline-none focus:border-none bg-transparent",disabled:p||S,children:Bt?i.jsx(la,{size:14}):i.jsx(ca,{size:14})})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"API Secret 2"}),i.jsxs("div",{className:"relative",children:[i.jsx("input",{value:z,onChange:k=>Q(k.target.value),autoComplete:"off",placeholder:"ASTER_API_SECRET_2",type:qe?"text":"password",className:`w-full h-8 pl-3 pr-16 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${z===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:p||S}),i.jsx("button",{type:"button",onClick:()=>Ye(k=>!k),className:"absolute right-1 top-1/2 -translate-y-1/2 text-[11px] text-[#9B9B9B] hover:text-white h-6 flex justify-center items-center hover:border-none hover:ring-0 focus:outline-none focus:border-none bg-transparent",disabled:p||S,children:qe?i.jsx(la,{size:14}):i.jsx(ca,{size:14})})]})]})]})]}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Select Pair"}),i.jsx(Cl,{styles:zn,components:{Option:Lt,SingleValue:jn},isDisabled:p||S,options:h,value:h.find(k=>k.value===ne)||null,onChange:k=>J((k==null?void 0:k.value)??""),placeholder:"Select",isSearchable:!0})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Trade Per Hour"}),i.jsx("input",{value:pe,onChange:k=>{const T=k.target.value.trim();if(T==="")return Y("");Dn(T)&&Y(T)},onKeyDown:Vn,inputMode:"numeric",autoComplete:"off",placeholder:"e.g. 10 (max 180)",className:`w-full h-8 px-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${pe===""?"border-[#353535]":Kn?"border-[#353535] focus:border-[#67FFBD]":"border-[#FF797C]"}`,disabled:p||S}),pe!==""&&!Kn&&i.jsx("div",{className:"text-[#FF797C] text-[12px]",children:"Enter an integer between 1 and 180."})]})]}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Delta Neutral"}),i.jsxs("div",{className:"flex justify-between w-full items-center gap-2 border border-[#353535] bg-[#242424] p-1 rounded-md px-2 h-8",children:[i.jsx("span",{className:"text-white font-inter text-[13px] font-medium leading-[8px] tracking-[-0.26px]",children:X==="ON"?"On":"Off"}),i.jsx(Eo,{checked:X==="ON",onChange:k=>re(k?"ON":"OFF"),disabled:p||S,className:`${X==="ON"?"bg-[#1DE674]":"bg-white/10"} relative inline-flex h-5 w-9 items-center rounded-full p-1 transition-colors duration-200 ease-in-out ${p||S?"opacity-50 cursor-not-allowed":"cursor-pointer"}`,children:i.jsx("span",{"aria-hidden":"true",className:`inline-block h-4 w-4 transform rounded-full bg-white shadow-lg transition duration-200 ease-in-out ${X==="ON"?"translate-x-3":"translate-x-0"}`})})]})]}),i.jsxs("div",{className:" space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Leverage"}),i.jsx("input",{value:ie,onChange:k=>{const T=k.target.value.trim();if(T==="")return oe("");Dn(T)&&oe(T)},onKeyDown:Vn,inputMode:"numeric",autoComplete:"off",placeholder:ne?`1–${_}x`:"e.g. 3",className:`w-full h-8 px-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${ie===""?"border-[#353535]":Cn?"border-[#353535] focus:border-[#67FFBD]":"border-[#FF797C]"}`,disabled:p||S}),ie!==""&&!Cn&&i.jsxs("div",{className:"text-[#FF797C] text-[12px]",children:["Allowed: 1–",_,"x"]}),Nt&&i.jsxs("div",{className:"mt-2 space-y-1 text-[10px] text-[#CECECE]",children:[i.jsxs("div",{children:["Tier range at ",i.jsxs("b",{children:[an,"x"]}),":"," ",i.jsxs("b",{children:[gn(Nt.min)," – ",gn(Nt.max)," USDT"]})," ",i.jsx("a",{href:"https://www.asterdex.com/en/futures/trading-rules/leverage-and-margin",target:"_blank",rel:"noopener noreferrer",className:"underline text-[#F8D4AB] hover:text-white",children:"More Details"})]}),on[ne]&&i.jsxs("div",{children:["Trading Limit is"," ",i.jsxs("b",{children:[gn(on[ne].market)," ",on[ne].unit]})," ","for ",i.jsx("b",{children:ne})," ",i.jsx("a",{href:"https://www.asterdex.com/en/futures/trading-rules/trading-rules",target:"_blank",rel:"noopener noreferrer",className:"underline text-[#F8D4AB] hover:text-white",children:"More Details"})]})]})]})]}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[i.jsxs("div",{className:`${X==="ON"?"hidden":""} space-y-2`,children:[i.jsx("div",{className:"flex items-center gap-2 text-[13px] text-[#7C7C7C] font-semibold",children:i.jsx("span",{children:"Order Type"})}),i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("button",{"aria-pressed":ee==="MARKET",onClick:()=>!S&&ae("MARKET"),className:["inline-flex justify-center items-center gap-1.5 h-8 px-3 rounded-[10px] uppercase tracking-wide text-[12px] font-semibold transition-all border w-1/2",p||S?"opacity-60 cursor-not-allowed":"cursor-pointer",ee==="MARKET"?"bg-[#8e643a] text-white border-[#44382C]":"text-[#7C7C7C] bg-transparent border-[#404040] hover:bg-[#404040]/25 hover:text-white"].join(" "),children:i.jsxs("span",{children:["MARKET ",ee==="MARKET"?" ✓":""]})}),i.jsx("button",{"aria-pressed":ee==="LIMIT",onClick:()=>!S&&ae("LIMIT"),className:["inline-flex justify-center items-center gap-1.5 h-8 px-3 rounded-[10px] uppercase tracking-wide text-[12px] font-semibold transition-all border w-1/2",p||S?"opacity-60 cursor-not-allowed":"cursor-pointer",ee==="LIMIT"?"bg-[#8e643a] text-white border-[#44382C]":"text-[#7C7C7C] bg-transparent border-[#404040] hover:bg-[#404040]/25 hover:text-white"].join(" "),children:i.jsxs("span",{children:["LIMIT ",ee==="LIMIT"?" ✓":""]})})]})]}),i.jsxs("div",{className:`${X==="ON"?"hidden":""} space-y-2`,children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Direction"}),i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{"aria-pressed":G==="LONG",onClick:()=>!S&&V("LONG"),className:["inline-flex justify-center items-center gap-1.5 h-8 px-3 rounded-[10px] uppercase tracking-wide text-[12px] font-semibold transition-all border w-1/2",p||S?"opacity-60 cursor-not-allowed":"cursor-pointer",G==="LONG"?"bg-[#67FFBD] text-black border-[#67FFBD] shadow-[0_0_0_3px_rgba(103,255,189,0.25)]":"text-[#67FFBD] bg-[#67FFBD]/15 border-[#2A2A2A] hover:bg-[#67FFBD]/25"].join(" "),children:i.jsxs("span",{children:["LONG",ie?` - ${ie}x`:""]})}),i.jsx("div",{"aria-pressed":G==="SHORT",onClick:()=>!S&&V("SHORT"),className:["inline-flex justify-center items-center gap-1.5 h-8 px-3 rounded-[10px] uppercase tracking-wide text-[12px] font-semibold transition-all border w-1/2",p||S?"opacity-60 cursor-not-allowed":"cursor-pointer",G==="SHORT"?"bg-[#FF797C] text-black border-[#FF797C] shadow-[0_0_0_3px_rgba(255,121,124,0.25)]":"text-[#FF787B] bg-[#FF797C]/20 border-[#2A2A2A] hover:bg-[#FF797C]/30"].join(" "),children:i.jsxs("span",{children:["SHORT",ie?` - ${ie}x`:""]})})]})]})]}),i.jsxs("div",{className:`${X==="ON"||ee==="LIMIT"?"hidden":""} grid grid-cols-1 md:grid-cols-2 gap-4`,children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Take Profit %"}),i.jsxs("div",{className:"relative",children:[i.jsx("span",{className:"absolute left-2 top-1/2 -translate-y-1/2 text-[#7F7F7F] font-semibold",children:"%"}),i.jsx("input",{value:fe,onChange:k=>{const T=k.target.value.trim();if(T==="")return Ne("");Gn(T)&&Ne(T)},onKeyDown:Vn,inputMode:"decimal",autoComplete:"off",placeholder:"e.g. 0.5",className:`w-full h-8 pl-7 pr-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${fe===""?"border-[#353535]":sn?"border-[#353535] focus:border-[#67FFBD]":"border-[#FF797C]"}`,disabled:p||S})]}),fe!==""&&!sn&&i.jsx("div",{className:"text-[#FF797C] text-[12px]",children:"Enter a percentage between 0 and 100."})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Stop Loss %"}),i.jsxs("div",{className:"relative",children:[i.jsx("span",{className:"absolute left-2 top-1/2 -translate-y-1/2 text-[#7F7F7F] font-semibold",children:"%"}),i.jsx("input",{value:he,onChange:k=>{const T=k.target.value.trim();if(T==="")return ge("");Gn(T)&&ge(T)},onKeyDown:Vn,inputMode:"decimal",autoComplete:"off",placeholder:"e.g. 0.2",className:`w-full h-8 pl-7 pr-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${he===""?"border-[#353535]":Me?"border-[#353535] focus:border-[#67FFBD]":"border-[#FF797C]"}`,disabled:p||S})]}),he!==""&&!Me&&i.jsx("div",{className:"text-[#FF797C] text-[12px]",children:"Enter a percentage between 0 and 100."})]})]}),i.jsx("div",{className:`${X==="OFF"&&ee==="LIMIT"?"":"hidden"} grid grid-cols-1 md:grid-cols-2 gap-4`,children:i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Spread %"}),i.jsxs("div",{className:"relative",children:[i.jsx("span",{className:"absolute left-2 top-1/2 -translate-y-1/2 text-[#7F7F7F] font-semibold",children:"%"}),i.jsx("input",{value:ye,onChange:k=>{const T=k.target.value.trim();if(T==="")return ve("");Gn(T)&&ve(T)},onKeyDown:Vn,inputMode:"decimal",autoComplete:"off",placeholder:"e.g. 0.5",className:`w-full h-8 pl-7 pr-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${ye===""?"border-[#353535]":en?"border-[#353535] focus:border-[#67FFBD]":"border-[#FF797C]"}`,disabled:p||S})]}),ye!==""&&!en&&i.jsx("div",{className:"text-[#FF797C] text-[12px]",children:"Enter a percentage between 0 and 100."})]})})]}),at===2&&i.jsx("div",{className:"flex items-center gap-3 px-5 py-3 border-t border-[#353535] bg-[rgba(27,27,27,0.32)] rounded-b-3xl",children:i.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[i.jsx("button",{onClick:()=>!p&&t(!1),className:"inline-flex items-center justify-center h-8 px-5 rounded-[10px] border bg-black/5 border-[#353535] text-white text-[13px] hover:border-white disabled:opacity-60",disabled:p,children:"Cancel"}),v?C?i.jsx("button",{onClick:Qt,disabled:p,className:"inline-flex items-center justify-center h-8 px-6 rounded-[10px] text-[13px] border border-[#353535] hover:border-[#FF797C] text-[#FF797C] bg-[rgba(27,27,27,0.32)] disabled:opacity-60",children:tt?"Stopping...":"Stop"}):i.jsx("button",{onClick:lr,disabled:!Yn||p,className:`inline-flex items-center justify-center h-8 px-6 rounded-[10px] text-[13px] border ${!Yn||p?"bg-[#2a2a2a] border-[#3a3a3a] opacity-60 cursor-not-allowed":"bg-[#7446FF] border-[#8861FF] hover:bg-[#5834C3]"}`,children:$e?"Starting...":"Start"}):i.jsx("button",{onClick:()=>r(!0),className:"inline-flex items-center justify-center h-8 px-6 rounded-[10px] text-[13px] border bg-[#67FFBD] border-[#67FFBD] text-black hover:opacity-90",children:"Connect"})]})}),Le&&at===2&&i.jsx("div",{className:"absolute inset-0 rounded-3xl bg-black/40 flex items-center justify-center text-sm",children:"Loading..."})]})]})]})]})]})},JTt=({linkTo:e,title:t,icon:n})=>i.jsx("a",{href:e,target:"_self",children:i.jsxs("div",{className:`${location.pathname===e?"bg-[#353535] rounded-[256px]":""} h-8 px-2.5 py-2 justify-start items-center inline-flex text-white min-w-max cursor-pointer ${e==="/tracked-wallets"||e==="/tracker"||e==="/referral"||e==="/wallet-management"||e==="/copy-trade"||e==="/leaderboard"?"hidden sm:block":""}`,children:[n&&i.jsx("img",{src:n,alt:t,className:"h-4"}),i.jsx("div",{className:"text-[13px] font-semibold font-manrope leading-[16px] min-w-max",children:t})]})}),Xf=({className:e})=>i.jsxs("svg",{viewBox:"0 0 53 96",fill:"currentColor",stroke:"currentColor",xmlns:"http://www.w3.org/2000/svg",className:`size-full ${e}`,children:[i.jsx("path",{d:"M23 76.3751L0 96V20.687L23 0V76.3751Z"}),i.jsx("path",{d:"M53 76.4219L30 96V66.6279L53 46V76.4219Z"})]}),ro=({content:e,positionTop:t,alignRight:n,tooltipCss:r})=>i.jsxs("span",{className:`tooltip ${n?"left-5 top-1/2 -translate-y-1/2 ":t?"-top-6 -translate-x-1/2 left-1/2":"-bottom-6 -translate-x-1/2 left-1/2"} transform bg-[#353535] text-white font-manrope font-semibold text-xs leading-3 py-1 px-1.5 rounded-sm relative whitespace-normal ${r} h-auto overflow-hidden break-normal`,children:[e==="Sharpe_tooltip"?i.jsxs("div",{className:"flex flex-col items-start pl-4 gap-1 min-w-max",children:[i.jsxs("span",{className:"flex justify-start items-center gap-1 text-xs font-semibold",children:[i.jsx("div",{className:"rounded-full bg-[#FF7173] w-2 h-2"}),i.jsx("span",{children:"< 1"})]}),i.jsxs("span",{className:"flex justify-start items-center gap-1 text-xs font-semibold",children:[i.jsx("div",{className:"rounded-full bg-[#E5BB18] w-2 h-2"}),i.jsx("span",{children:"1 - 2"})]}),i.jsxs("span",{className:"flex justify-start items-center gap-1 text-xs font-semibold",children:[i.jsx("div",{className:"rounded-full bg-[#1DE6A3] w-2 h-2"}),i.jsx("span",{children:"> 2"})]})]}):e,i.jsx("svg",{width:"10",height:"8",viewBox:"0 0 10 8",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:`absolute transform -z-1 ${n?"-rotate-90 left-1 -translate-x-full -translate-y-1/2 top-1/2 ":t?"-bottom-1 rotate-180 -translate-x-1/2 left-1/2":"-top-1 -translate-x-1/2 left-1/2"}`,children:i.jsx("path",{d:"M3.70096 1.25C4.27831 0.25 5.72169 0.25 6.29904 1.25L8.89711 5.75C9.47446 6.75 8.75278 8 7.59808 8H2.40192C1.24722 8 0.525536 6.75 1.10289 5.75L3.70096 1.25Z",fill:"#353535"})})]}),Ni=({className:e})=>i.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e,children:[i.jsx("path",{d:"M8.00016 14.6666C11.6668 14.6666 14.6668 11.6666 14.6668 7.99992C14.6668 4.33325 11.6668 1.33325 8.00016 1.33325C4.3335 1.33325 1.3335 4.33325 1.3335 7.99992C1.3335 11.6666 4.3335 14.6666 8.00016 14.6666Z",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"}),i.jsx("path",{d:"M8 5.33325V8.66659",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"}),i.jsx("path",{d:"M7.99609 10.6667H8.00208",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"})]}),m5=({open:e=!1,setOpen:t=()=>{},oldSlotCount:n,checkAccountLighter:r,tradeMarket:s,product:a})=>{const{address:o}=ns(),{setSignModalOpen:l,setTelegramChatId:c,setSubscriberRole:u,setSubsExpireDay:d,setMushboomerETH:f,setMushboomerSOL:x,setIsReferralCode:g,setIsReferralCodeName:v,setIsWhitelist:w,setHyperToken:C,setHyperAddress:N}=m.useContext(Qr),[P,I]=m.useState(1),[R,F]=m.useState(!1),[U,L]=m.useState(!1),[z,Q]=m.useState(""),[ne,J]=m.useState(""),[X,re]=m.useState(""),pe=fe=>/^\d*$/.test(fe),Y=fe=>{["e","E","+","-"].includes(fe.key)&&fe.preventDefault()};m.useEffect(()=>{e||I(1)},[e]);const ie=m.useRef(X);m.useEffect(()=>{ie.current=X},[X]);const oe=m.useMemo(()=>{if(P==="")return!1;const fe=Number(P);return Number.isInteger(fe)&&fe>=1},[P]),G=async()=>{var he,ge,ye,ve;const fe=window.localStorage.getItem("hyperToken"),Ne=window.localStorage.getItem("hyperAddress");if(!(!fe||!Ne))try{const je=await Ei(Ne.toLowerCase(),fe);je!=null&&je.success?(c(je==null?void 0:je.telegram_chat_id),u(je==null?void 0:je.subscriber_role),d(je==null?void 0:je.subs_expire_day),f((he=je==null?void 0:je.mushboomer_counts)==null?void 0:he.eth),x((ge=je==null?void 0:je.mushboomer_counts)==null?void 0:ge.sol),g(je==null?void 0:je.referral_code),v(je==null?void 0:je.refcode),w(je==null?void 0:je.whitelist),C(fe),N(Ne),re((ve=(ye=je==null?void 0:je.slots_info)==null?void 0:ye[s])==null?void 0:ve.total_qty)):(window.localStorage.removeItem("hyperToken"),window.localStorage.removeItem("hyperAddress"),C(""),N(""))}catch(je){console.error("Token verification error:",je),console.error(je.message||"An unknown error occurred.")}},V=async()=>new Sl(window.ethereum).eth.getAccounts(Ne=>Ne),ee=async(fe="slot",Ne=24,he=5e3)=>{Ne<=0||(await new Promise(ge=>setTimeout(ge,he)),await G(),fe==="slot"&&ie.current<=n?ee(fe,Ne-1,he):r())},ae=async fe=>{J("");const Ne=window.localStorage.getItem("hyperToken"),he=window.localStorage.getItem("hyperAddress");if(!Ne||!o){l(!0);return}L(!0),F(!0);try{await window.ethereum.request({method:"wallet_switchEthereumChain",params:[{chainId:"0x1"}]})}catch(ve){console.error("Failed to switch network",ve),F(!1);return}const ge=new Sl(window.ethereum);var ye=await V();if(ye.length>0?ye=ye[0]:ye=void 0,ye){const je=fe*.012,Ie=ge.utils.toWei(je.toString(),"ether"),Le={from:ye,to:"0xdEAe8586eD227A5096EBae47342fFc1ED99f13F9",value:Ie};await ge.eth.sendTransaction(Le).then(Qe=>{console.log("txHash :>> ",Qe),F(!1),Q(Qe.transactionHash);const $e=a==="grid_bot"?"bots_extra_slot":s==="lighter"?"lighter_season_2":s==="variational"?"variational":s==="extended"?"extended":s==="pacifica"?"pacifica":s==="paradex"?"paradex":"";fetch("https://dextrabothypev2.nftinit.io/api/hyper/slots_payment/save/",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:o?o.toLowerCase():he,token:Ne,payment_tx:Qe.transactionHash,slot_role:$e,slot_qty:Number(P)})}),G(),ee("slot")}).catch(Qe=>{console.log(Qe),Qe.code===-32003||Qe.message.includes("insufficient funds")?J("Insufficient funds."):Qe.message==="MetaMask Tx Signature: User denied transaction signature."&&L(!1)})}else await ge.eth.requestAccounts()};return e?i.jsxs(i.Fragment,{children:[i.jsx(bd,{open:U,setOpen:L,transactionHash:z,transactionLoading:R,paymentPresaleRole:!(X<=n),errorFunds:ne,activeMethod:2}),i.jsxs("div",{className:"fixed inset-0 z-[9001] flex items-center justify-center",children:[i.jsx("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-[2px]",onClick:()=>t(!1)}),i.jsx("div",{className:"relative w-[380px] max-w-[92vw] rounded-3xl bg-[#1B1B1B] text-white shadow-xl border border-[#404040] max-h-[97dvh] overflow-y-auto p-5",children:i.jsxs("div",{className:"flex flex-col w-full gap-4",children:[i.jsx("div",{className:"text-white/90 font-manrope text-[18px] font-semibold leading-4 mx-auto",children:"Get more slots"}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Slot Count"}),i.jsxs("div",{className:"flex items-center justify-center gap-2",children:[i.jsx("button",{onClick:()=>I(fe=>{const Ne=Number(fe||0);return Ne>1?String(Ne-1):"1"}),className:"w-8 h-8 flex items-center justify-center rounded-md bg-[#242424] border border-[#353535] text-[#bbb] hover:text-white hover:border-[#555] transition-all",children:"–"}),i.jsx("input",{value:P,onChange:fe=>{const Ne=fe.target.value.trim();if(Ne==="")return I("");pe(Ne)&&I(Ne)},onKeyDown:Y,inputMode:"numeric",autoComplete:"off",placeholder:"e.g. 10",className:"w-full h-8 text-center rounded-md bg-[#242424] border border-[#353535] text-white text-[13px] outline-none placeholder:text-[#7F7F7F]"}),i.jsx("button",{onClick:()=>I(fe=>{const Ne=Number(fe||0);return String(Ne+1)}),className:"w-8 h-8 flex items-center justify-center rounded-md bg-[#242424] border border-[#353535] text-[#bbb] hover:text-white hover:border-[#555] transition-all",children:"+"})]}),P!==""&&!oe&&i.jsx("div",{className:"text-[#FF797C] text-[12px]",children:"Enter an integer that is at least 1."})]}),i.jsxs("div",{className:"text-[13px] text-[#7C7C7C] font-semibold flex items-center gap-1",children:["Total Price:",i.jsxs("span",{className:"bg-[#1E1E1E] text-[#F8D4AB] font-bold px-2 py-[2px] rounded-md border border-[#3A3A3A]",children:[(P*.012).toFixed(3)," ETH"]})]}),i.jsx("div",{onClick:fe=>{fe.preventDefault(),oe&&ae(P)},className:`flex items-center justify-center h-8 px-6 rounded-[10px] text-[13px] border bg-[#7446FF] border-[#8861FF] hover:bg-[#5834C3] min-w-max font-semibold ${oe?"bg-[#7446FF] border-[#8861FF] hover:bg-[#5834C3] cursor-pointer":"bg-[#2a2a2a] border-[#3a3a3a] opacity-60 cursor-not-allowed"}`,children:"Buy"})]})})]})]}):null},Voe=({open:e=!1,setOpen:t=()=>{}})=>{var es,Gs,Es,xr;const{setSignModalOpen:n,setTelegramChatId:r,setSubscriberRole:s,setSubsExpireDay:a,setMushboomerETH:o,setMushboomerSOL:l,setIsReferralCode:c,setIsReferralCodeName:u,setIsWhitelist:d,setHyperToken:f,setHyperAddress:x}=m.useContext(Qr);ns();const[g,v]=m.useState(1),[w,C]=m.useState(0),[N,P]=m.useState(0),[I,R]=m.useState(0),[F,U]=m.useState(0),[L,z]=m.useState({}),[Q,ne]=m.useState(null),[J,X]=m.useState(!1),[re,pe]=m.useState(!1),[Y,ie]=m.useState(!1),[oe,G]=m.useState("OFF"),[V,ee]=m.useState(""),[ae,fe]=m.useState(""),[Ne,he]=m.useState(""),[ge,ye]=m.useState(""),[ve,je]=m.useState(""),[Ie,Le]=m.useState(""),[Qe,$e]=m.useState(""),[it,tt]=m.useState(""),[lt,ft]=m.useState([]),[ut,qt]=m.useState(""),[It,nn]=m.useState(""),[jt,cn]=m.useState(""),[un,Ft]=m.useState("LONG"),[Ke,Bt]=m.useState("STANDARD"),[$t,qe]=m.useState("STANDARD"),[Ye,ht]=m.useState("MARKET"),[Zt,zt]=m.useState(""),[Et,nt]=m.useState(""),[Ue,Rt]=m.useState(""),[We,at]=m.useState(!1),[mt,Dt]=m.useState(!1),[Tt,dn]=m.useState(!1),[on,gn]=m.useState(!1),[Nn,kn]=m.useState(""),[yn,Vn]=m.useState(""),[Gn,Dn]=m.useState(!0),[Kn,Cn]=m.useState(!1),[sn,Me]=m.useState(!1),[en,an]=m.useState(!1),[Nt,Yn]=m.useState(!1),[xn,Mt]=m.useState(""),[tn,In]=m.useState(!0),[Xn,or]=m.useState(!1),[lr,Qt]=m.useState("Hour"),[zn,Jn]=m.useState(1),[Lt,jn]=m.useState("lighter"),[Ee,h]=m.useState(!1),p=m.useRef(null),[S,_]=m.useState(""),[k,T]=m.useState(null),[B,q]=m.useState(""),[te,ue]=m.useState(!1),de=k?(k==null?void 0:k.getTime())<=Date.now():!1,xe="https://dextrabothypev2.nftinit.io",Se="",ke={kBONK:"BONK",kPEPE:"PEPE",kSHIB:"SHIB",kFLOKI:"FLOKI"},Re=["BTC","ETH","SOL"];m.useEffect(()=>{async function Gt(){if(e)try{const rt=await(await fetch("https://dextrabothypev2.nftinit.io/api/hyper/get_lighter_coins/")).json();if(rt!=null&&rt.coins){let Pt=rt.coins.map(vt=>{const ln=(vt==null?void 0:vt.label)||"",mn=ke[ln]||ln,cr=mn==="XMR"?"https://app.lighter.xyz/assets/xmr-CV8khZ54.png":mn==="NMR"?"https://app.lighter.xyz/assets/nmr-2YIHMk6g.png":mn==="USELESS"?"https://app.lighter.xyz/assets/useless-BTmgr78l.png":mn==="DOLO"?"https://app.lighter.xyz/assets/dolo-DuOVl-Vo.png":mn==="CRO"?"https://app.lighter.xyz/assets/cro-C7lstwu3.png":mn==="FF"?"https://app.lighter.xyz/assets/ff-CvnDhHny.png":mn==="kTOSHI"?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAKx0lEQVR4XtVae3BUVxnfzYO8aHFKsptNeOWxm0JpyANoSi1V+0etIiQpHVoSa5niDOp0xsFa/6DTkIBSq9XWjm3zkqL9Q8eZ6h8ELY5TaaSGEUsgVDrkwWAgaKcBCUIhye7n951z7957v3PvPpLNBr6Z39zd8/x+v/Od75y7icuVLHsE3nXVA8SMW944oeniljHueOJxhk85+1YPTTaOzjxuCuNOJRuzZtyR2UZSjU8eA9oH4wPvHxNm3PiEUcBJTRV83KiYEeOTOIA7n2jw+RyRUOOD24A7OtPg89siIcYHtQF3LlngfthiWsYHswF3Ktng/thiysYHsiHurg1CibcCXj0xpjiXTHD/GJo4teimDqKQJ7hrDbg2AATyKhTnkgXupwVxGe/sQP6lngtIPATPtR8GVx3WkwgE/OzPq1QcTAa4v1MTgXfUMH+rdbL7H9wsCLfh52df+zMs8VXISDDh85u+rjg5k8jdqvodnwi8gwl8srLCak2AkBDhzVPXYGfbe2Hy+tbIKtyo9DWjbSCET4Jap9f7PVUQ8FbCQu8acNX0ILoRf4Pblr+otOd+xy4AvWryDg7kCUsLqsUWaB8MCgEIHb1jQoSsLx6zREIqtRsIQsBTAa57/iIIpDwSEgJ1DE2G+xNo7M4BFNhbhe1we9WgqDWHILWmL7zF3PUT4Bfzq35NXQTeMAJ5QmDhSkgRAsgI0NHU/p4Qocy7whIN9JyXW6qVhSwCtQ8Z/XVQGzeSLc67S+YVTzU0tXWH2+Ys2CISL/crqgiOxhtGEWDrnn22AhBIAGM7hCD1oQsKaQ4a0xiD2hrtSYgmHM8cJan39eC2qFL8iiqArQi8QRTyOpwEeGNQOkwipH7hpCQhIMNeJ2c+Qum7WQBqu7b5ktYnBCnYphkjgOpL7wg4hn9MIijGG8QqAK5Mx6CVvIgA2gbt3eC+96/KSkuYVpeIDMjv7ef0fCCFasdc4Fqvt5NlnTQv5oVi752KPxycj70AvFLDnqPqgByU3Dot+zeEq96Nq38I3JS8FOIcknjnsOZwnXzKLYDiogB1nTcsfdJqDop2racnFX84nu9Weaki8AoNfDA7kCOlvgATAInfcyic+CJD7nU9nNuGJHFDgKBY+XD7DSExZ7GvXPHFCZxXQgWgdwF37YQR+q2HxBEnQh9Dd+tvrsB3eiInP7MYe88FRT7Y/qcxzC8AP/lo0lIvREFxynyrFF+cwHnFJEDZd9WB7CDO6lrtO26FAF5YKAIoMb5yImhD0h7maHHXGQmSt9NF2HvG+eLEUfk8KPwMAerhklJRrw7ihJVVtcIp2qu7Ot8X5Pdi2Mp3g0grH6nOCdp2WRfEyxPdC5yPQA7OzxCBF8QpAIFWamHxKmj8xo9FdqYQ7sBs7v6S7rT5qUOSMUM/7ozvMvNbx9A+Yy5oG1J9cQLnl1AByKFSTxEUPtwFz/7soFbGCXNwYrzeCSaBMMeU5ceWCzi/hArgx5eUxd67xdHn+jJ32Ar90lP2rVGRNPUx0jdcM+rDbQ1hqDyrbgxeH56EN86Na+1CMGf9fxV/7GAkPG425OMV4PFvvyiPPnHux7aaBU9eEX31o1MXw0Jeux3KIzIkLlzyUmSdw++J/iMMp22YDfl4BQh4KgX5tHVXFaI6AX3FeB2H3pYwODIaLuPtzO3p+erxy4pfZnDahtmQj1cA1730bo7h70CQnLy9qhUW4TYpzavEfFEFpV56IvAYLcmvhBIvlSEKysXKD41cgoGRi9B/YVR892Nbf75s6y+ogju95XgBq4Bl+eVSBDx1lhZ9VvEt7KOj2ZCPR4BSzwqx+nTt5StlvcHhip6/iKRGYZFnGfarEDj7nzFBVMfRw32Qgu/65jL3o9eh/5zs68f5KOSHP/4fHDlMvw9Y8wTVcx9nTIC2/klt9UkAigDDEXoOofODJiL0mZzXyVPyNBPtef9DOD1y2VKmY/iTq+G+Z7DNIEbIvLVvQ/oDJzQfJPwOr8ectmE25GMVgMJZ/lqDAqyXtz66vq770RWFgBnk/L/HPoVCfIdY4FsOT2/ZDgPnZcib0dr5W5ty+m6Ukag0HvlQ+8QOxcewADYcBZSCGAUIeKvD5MX+ryMBQuLnLk5kSrhwSa54XoVaZ4PBkcjHIednFiDuq3BrfxDy89cZq49IXfMuPrstIZ9s0B9ouK/RBXDYBrG8DNGLj9j7mhABX5XiVDw4LZKkCedHlTaRQOJzHwmRX4YcBCDwgZzw2ofXxBHGHTr10VmlLBKIwBIMe31fi/BHUYZIGCaOPFFU0KnE/eO8Ei4AgWd0HV37uuD8x5GTIke/6bP9lhrFcQ+IsQ/g01w3NPyJ4hvnFbMAzxxUiTqBVkx19KJYubd/8XvhbNebXWqYx41ROIDjiPFM0Ov5Nnjh7yovVYAIInCidmjDpMgd/V2HRtoEus0Z3/c7i2YHzAenTo9A11t/hPLiz8Gj25qhNFfeJPUx+7WLltk3zsee/DQFoD+E0koTId2ZA1p4drz8K3E5KcH9XIIClJguQp0vvaW1swpl/r4fV7uiuEbsbRKazx32AY/l1h+0C7HKCoxXZM7HWQAy3ihGEQb/dRnDcj/QvizxlIsLku5sb0MmHGuYY0GveGZIMVCYLtFXJ38AfvnKr2HTUi9MtmTBxK4sZb5IKM1FofNkIuQ8ZkwAurD8/ORVpfzBr2wThI83pIfJT+zKFBhHYuM/nA/HHs+B41uyRES8s+8PYgWL8QXnys50uNGcBhMtKFSe/fU2GjiPyOTJIvxHNx88FtBvdnK1DeJBJB7aNQfGkdinTSnQ91gqnECBiu5YAb2b06G88C7cUith8vsZEMhfAfeXqsdaLOD+xyYAGW88TRFKfNXwAQnQMgd++sBcFCRDCHJjTwZMClGyoLcxA1Le2QhHHkuHsztuE2XXd2ZD5u6HAVrSlDGjgfsdO3ndeCcN859SJ4uGviczoNizSpA+sikbjjakGVugBQVAHGucIwSA3anhSCEEvKuh2LcKLmyfq4zrhNynVL8TJgCBTxgN9U+3iG0gVzsTfL77wgLQStPnY43p4D6IArwgv0tkQFF+NSzJLId/bs4Av69GGdsO3N/4yevGO09RhJNPYNZvzIRDG28PEw7uJgGMle5FAVwYAeNI2hwBi/F2mXJkM6xdnIvfs5WxObifUyevGx8kThFe/uCiCP1/NEhiHiREz21L54fFIAx9Mx3SvrfcUkY4jn0DuSsxOaaIuqIIpwH3j2EnpxabqQMp4I6YUeS923ICEIm+r9E+z8HVzrGUF3lIHKsAhNSeBgg2ybxhdyfg/thiWsYHswF3SofI+I20+llwA5PdM2vy8XKTJkQZb7aGOw9/K7JEHqHngvnLkkheNz6oDTh5ug3SbS+0OwsTIBLYTIlQywG4n09uSkExsrVkmCPKCCHtOdlCEULIFv2KCyrw0kTRI3MBn98WCTU+uAN0AUq85UKAJfmrYXjHPEGcToJe7Rgk+D0rxarSUUg3vkmHKCjCC9EJPAlCe+Yq8zliRoxPEgF9X5WhzkNZPjNgsWc1Hnsuhezl5+Za3hv0fnz8iJhx4xNGgU6antfxBWcR/QEEr8nBJjXpmcHHiYqkGp98tjFrxh1JNmrhM9yl5BtdNLhjycBNadzJxOMMn/LmNNXx6eGWtwg/ttgiSfZ/z360yWKNq4wAAAAASUVORK5CYII=":mn==="EDEN"?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAADjElEQVR4Xu2Zy0prMRiFq1ZrFUFwKkJHDi0WZ04E5/o2YhXfRF/AkU4E30AcdCoUiiCCIxXxhpfmsDbksFnpbnP547lkf7CoJ+z8+bNOspOdVFTiVLggNUoDuCA1SgO4IDVKA7ggNUoDuCA1/rgB39/fXPSj/LgBnU5Hra2tqYmJCVWpVNTY2Jianp5WBwcH6uXlhR+PTnQD2u22mpmZUbVaLessOl0kmIJn8Ds5OcmhoiBuAIb05+en2tzcNDroo7m5OW5CFFED+v2+urm5UePj40ZHQoRRMTU1lcWXRsQA/I+D1dVVI3lpgbe3t3zzQYgYADBn6/W6kbC0MBq2t7e5eW+CDMCQxJzHS44TjSmYgJVEgiADACf3U8KI293d5XScCTKg2Ww6v/Cq1Wr2i6UOf+eXRvwbyyXXKRJivL6+clpOeBmAYY8NDSc0TOiozUan1WplJrgYG7Kb9DLg4+MjG4KcSJEeHh6yek9PTxTJRHdmdnY2W/o41iBtbGxQFHu8DFhZWTGSKBKGKAzzodfrGfGK5DsKvAzgxoskwdHRkdVIaDQaXNUK5yy3traMxvPSHzmS7O3tGe2w0K4PzpmOmvtI5P7+nqsFw+0MUrfb5WojcTaAG2VhKXt/f+dqwWC7rUfXMLniXIMbzAtz9e7ujquIofcQRfL5hLY2ANve8/PzkUnEAm/5w8NDoz2WK041lpeXjQZZseH2WK5Y18ActPnai82wUyWflcA6Y0wBbE/RSJEwPWKjOzpIMMcVawP+V0oDuCA1SgO4IDVKA7ggFH1E/q8gboBmZ2eHi7zRx2MxEI2KzRKusvRX2+LiIj9ijb4Fmp+fz2LBBJwVXlxc0JNhiBqAW17eni4sLDh/HuvjLY6lBVOkCDIgf1c3bI8OXV9fF97t5a+6YBbXLZIEwVFw6GnzkaS1tLTEITJOT09/PzPKTP0MpsXz8zOHciLIAJz2cmK20u8JdMLlDiAvmPD4+MhpORFkAObqycmJ1amttGBa0ZRyIcgAzfHxsZFgTEl+dosYAG5vb72Hso0QW68ykohF029yTlxK6Pz+/n7Whu9N0yDEDNBgK3x5eWn1JreVHvK+11/DEDcgz9nZWdYB/ca3lTYPv19fX5liEdUAgOSxuVlfXzeuvfUtE8p0p2HW1dUVh4lGdAP+dkoDuCA1SgO4IDVKA7ggNUoDuCA1SgO4IDWSN+AXxfi0jU1sI9sAAAAASUVORK5CYII=":mn==="AERO"?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAGo0lEQVR4XuWbeWwUVRzHF8Ha0oOi4Sw0RoP6HyCUQ0MQEqOBkNQY/4AEY4z/STwS8EqM/5giIkaDicihUI5EoGgQGg0YFFHBSAQ5Qists0dnd2Z2etCWskDn5/u9YY/5vWmb7ry94Jd8spOdmffe9/eu33v71ufLkkUiV+YZqv+IFlZiRsQPbvB77BlTU+bT9wvOolqglgpMi7Afomqglqafl2aElaWCAMnoYWUJzTfnpqv+OlrQTKNH/GtpObJuhhqYTQuWdVgZaLmyYkJBcgwtX8YsGg1W0czzBSwbLa9UY5lsopnmIZtouaWYHhYyymto+T0ZTbxQoDrSMt0l4UKC6hmWGYXR54civTHBDIWmuCRWkKAWqm9Io4kUOlTfoIYLEJrAnQDV6WrRcKCGvningNqoXsHoS/lCVBO/Sweq12FsVbeWvpArTD0I6z5aD+UV1VBaNgXKyqdy8Hv67HBg03od1Z0w+nA2MfUANOzbx0WmCqbQ99KB6uaWjc0MSrsRgvXrPoHiksmCUA46oqwKiqvrYNTMPqhcYIGUkJxppfqzWvs7tm+HktEDiy56pBFGzgIY5UJTs7cuEIfqz4oDWpovuNd22WQomfQKE20JguOMfBzgnpnABkNFSDcdHOI1VXmOPiCTSNsVUTgTfd9DmwesaRRc8STA6g0AX38HsLUBYMt+YOnJcQBqTjhAD8tJ1I0JEx91CC+tnO5a0yj43tkA73wGsO2ALdgNTRXzSAdc5CUcQG/KIBxqdYzmo+9fINR2vJa//FYUGgdrfefBW3CxuR2ihirk44WMOeDM6VOOQY0KL54D8NVeW5yb4O+PxqCzIwy93W0M1QHNywtcvKYp8+kNL+ysr0+IL3rsuEN4zQpRsC3aguYW01VwnJ4e5hCGzO6Kv1b5DFU5Qm94gTd7UuvVz7qL1vWIu+irbdBzTYPrOzaCNaEIoNIHMNZG9xgJOmDafYP9Vjdc/K2X+OgeF4/TVuqAhs376B+9rqKxhvt+awRr3CiHYIohsQVoESUmtf/jPB8XP/UZZx///XS3IJzXcv1GgHJRaAJ278biWWD+fQJ0FjnSPL0i1QHtusLFP/FiUvjuQ7ccwnsYfT/uHVh0hQ+uL1/Kazob+5FSHfDvhRAsfzvZ3O2RPCn85ool7s2bie5s2AW6FhDSzDRSHYBRWrzmTdMp3q3G+6srwDz5S1ZqeiCkOkBjKzWs+audSeHWww84hbMW0P15XU5FpyLVAcFAELq7klOZo7mz60Xl4+2osLQKamoW8VkjmoNmn4rUaRCDFC6+9Yyj1k9NnAPLVvWCqdtT2KpX3+TL4XiojJ+48/PWmvfgctN5vk9A084EqF1qIIT7dn2H9jjEHz3cBL4ZyaAIr+sP6AlnIO1GEE4cPwZvvL4Gpk2bxZ2DYEspLpnEnbPwqSVCfp7BQIgfXqI30gR3a1Kb/ZaGfj4gHvz5Gp8iv9gVZQsgiy+C4oHS6LkWfPqNeXudP3CQI2tTNBVcBshdDCmXEuJjGz4Avz/sCIa2HbAg3IZ9XuEOOXm6DVZ92AWl8ywYMeP2pgcDr6e/EIOPt5pw9lwITOYcRMjPI9JXg9GmswkH9AYu2DMBGwxRcMNP1xPOsD8tOHdRgyiv9VRxtnNwRjl/MQj7GjVYvb4TVr7bLeTnlYQD9EGa3nDAqS3RBcb4nGEvcwQOkij4v8sq7PrhJmzenwyX8XrP4RvwzzmDi7edIqdcbjg2RKRuiSlNSSewT0Nt5eJTndHVESLLWoWPH5dbVDj2ZxfsZs5Bx8QdhJ/YfYS8PODYEkOjD3gBvWuNK0p0h/6qUraMtae27i5xJXi1M8QHOZlr/aFwiJftgDjXXnvZ0RpiyxbyFV1caGd7UGgdCDqp3bADJHw2E46h+jP2wwi2BvOvX8EaOyIZH7DFz42n54IRanEsgFLF4i9FHWaQtw50kj2YiumnhdsPI2jCg5Lh8T8T3bey1l4cpQyYuPPTve59PobEu0umoLoTlqMjr3ybq6NxP/S99Dz0P1hpO2fMbdi1Nb4IYrWLhXfTYcgjtvSFfIA7yeX7dKB6BbvrD0igZWLUzTWoieoc1GgChQ7VN6Td9cfk0LQ74KAkaqC6hmUFfWQunEbTdzMh4QKB6vBkNPG8RlbNUyuEMcFznx/KosE8/stMMMN/mUm1fAqWhh3kyLK7+m9zqZaLI7aDHnnNlWVqU8XBQJsZ+WaaeqVWxjiBO9aYFk2/4IwfxlKVwf8+H8F7yhF+eClL9j+y7eB1y657sQAAAABJRU5ErkJggg==":mn==="MYX"?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAYAAACtWK6eAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAL5ElEQVR4nO3db2xV9R3H8ffvtgnX0Qc/266osU0hdPOJGRoTupEpo2aSJUUhEnyAkYypLItLfGR8NJ9sxj1zmRMFjPzZhGAitJP5YE7GEgOLMSwsUYFJLYTwp2U/lxJr0vLbg/ZCqe3pvb3nnt85535ej1ruued+H/DO75zbc881BGRt821QuA9YBr4LQyeeNoxpBZqAYsj5JCl+DIwDHPjzeAYw5gSeT8EfdW54KNRkJskXs7bVYliJpxfDSmBJkq8vmXUa748A70DhsHOXR5J64ZoHYq1thIbVGB4HswatClIVPwocwrPNueH3av1qNQvE2lYLfguGzWCW1up1pJ75AeBl/PhW59xoLV4h9kCstUVofB7DLwEb9/5FvslfAF6qRSixBmJt80ZM4UXgzjj3K1IefwHvn3Xuyt649hhLILa5tZNrfgfGrIpjfyJV8f4IBfOEuzI0UO2uCtXuwNrmTXhOKA5JDWPux/tPrG3ZVPWu5vtEa20R0/AKmJ9WO4RI7fhd+PGn53tuMq9ArG25DXgXY+6dz/NFEuX9h2A2ODd0rtKnVhyIta2dwAcYOit9rkhAAxh+VOl5SUXnILb523dh+IfikAzqxPOBbW65q5Inlb2CaOWQnDiH4YflriRlBWJt851Q0MoheTGA9993bvjCXBvOeYg18Zdxs09xSI50gnl34v92tLnPQUzDaxjzgzimEkkNw72Yxlfm2qwh6kFrmzdhCr+KbyqRVLmnWLzli9HRr47PtsGs5yDWtnZi/CdgdHm65NkIhrtnO2mPOMTyOxWH1IEmrrFjtgdnDMTa5scw5v7azSSSIoZV1rZsnPmhaSavsfoCTFvtJxNJjXP4sa7p12x9cwUxDVsUh9ShO6Hx+en/eNMKotVD6pzDs9i5IVf6h5tXEK0eUt8m7qMwxc0ryK0tX4DpSHYmkVT5HD/2XefcGExZQaxtWa04RFgCjatLv0w9xHoywDAi6WP849d/BLDWNmEaLusPgyIAfhRvbnduyE2uIA0rFYdIiSlO3hr3+iHW2nDDiKSQ971QCmSyFhGZNNmEsbalFWMuBx5HJH38tdsLQHfoOUTSqXBfAWMqusuDSP3wywp4f3foMURSqqsAuhmDyIwMnQXgjtBziKSSp62AMfqSG5GZGFoL4BWIyMyaCmAaQ08hkk6mWPUX6IjkmQIRiaBARCIoEJEICkQkggIRiaBARCIoEJEICkQkggIRiaBARCIoEJEICkQkggIRiaBARCIE/yxIR3s7/f0H6OjI1o3lR0ausn79Bo4eOxZ6lDlt2fIUL/7m16HHqNhf33+fjRuf4Ouvvw42Q/AVZPDsWXp7H2FwcDD0KBVpalrI/v376F6+PPQokRRHdYIHAoqkVhRH9Yy9tdWHHqJEh1vxWbduLTu2vx56jIqlKQ5IyQpSopUkHmvW9PLa1j+EHqNiaYsDUhYIZD+SZcu+F3SONWt62bH9dRobg7//UpE0xgEpDASyHcnet/5EV9fSIK+vOOKXykAgu5EsWtRGf9/BxCNRHLWR2kBAkZRLcdROqgMBRTIXxVFbqQ8EFMlsFEftZSIQUCTTKY5kZCYQUCQlWY3j6NGjbNq0OTNxQMYCAUWS5TgeXf8YV69eDT1KRTIXCExE8sjaR7l48VLoUSpSbSSKI3mZDATgzJkz9K55uG4iURxhZDYQgFOnTtdFJIojnEwHAtmOZN26tXNupzjCStXl7tXo6lpKf99BFi1qCz1KWQ4e7GPzz55ifHx81m16elaxZ/dOisVigpNVLy9xQA5WkJIsrSSKIztyEwhkIxLFkS25CgTSHYniyJ7cBQLpjERxZFMuA4F0RaI4sis372LNpqtraVlvp9bK1ZGrvLr1NcWRUbkPJO0UR7rl9hArC7Iax4kTJ+oiDlAgwWQ1jpMnT9VNHKBAgshyHL1rHuHSpfBvfCRFgSRMcWSLAkmQ4sgeBZIQxZFNCiQBiiO7FEiNKY5sUyA1pDiyT4HUiOLIBwVSA4ojPxRIzBRHviiQGCmO/FEgMVEc+aRAYqA48kuBVCmrcQwODiqOMiiQKmQ6jl7FUQ4FMk9Zj2Pw7NnQo2SCApkHxVE/FEiFFEd9USAVUBz1R4GUacWKFYqjDimQMnQvX87et/6oOOqQAplD9/Ll7N+/j6amhaFHqYjiiIcCiaA4RIHMQnEIKJAZKQ4pUSDTKA6ZSoFMoThkOgUySXHITBQIikNmV/eBKA6JUteBKA6ZS90GojikHHUZiOKQctVdIIpDKlFXgXR1LWXPnp2KQ8pWN4F0dS2lv+8gLS0toUepiOIIqzH0AEkoxbFoUVvoUSpSThxtbW309KxKcKob+vr6c/9lnrn/nvS8x9Hfd4DvfKcrwcluqIfvSs/1IZbiqK3u7m7e3r+XhQuzdU5XidwGojiSkfdIchmI4khWniPJXSCKI4y8RpKrQPIcx8KFC1MbR0keI8lNIFmN4+LFSzy6fsOccby9f1+q4yjJWyS5CCTLcfSueZhTp05Hbrdn9y66u5cnNFX18hRJ5gPJexwA27ZvZ2xsLIGp4pOXSDIdSD3EAXDo0F/YvPkpRRJAZgOplzhK+vr7FUkAmQxk8eLFdRVHiSJJXuYCaW9v58A7b9ddHCWKJFmZCqS9vZ0/9x+go6Mj9CgViSuOEkWSnMwEojhuluVI3nzzDRYsWBB6lLJkIhDFMbOsRvJgzyr27NmViUhSH4jiiKZIaivVgSiO8iiS2kltIIqjMoqkNlIZiOKYH0USv9QFktU4RkZGgsZRokjilapAshzH+vUbgsdRokjik5pAsh7H0WP/DD3KTRRJPBqKt3zrhdBDKI7a+OzkSYYuD/HQQz8OPUpFlixZzLJ7ltHX18/4+HjQWYIHojhq6/jxf/Hll1/yYE9P6FEqkpZIcn/jOJFqpOYcRCSNFIhIBAUiEkGBiERQICIRFIhIBAUiEkGBiERQICIRFIhIBAUiEkGBiERQICIRFIhIBAUiEqEAjIYeQiSlxgrASOgpRNLJuwLeXwk9hkgqefO/AnAh9BwiqWT8uQIwEHoOkVTyDBTAnAo9h0gqGXOiAP546DlEUsnzaQH8R6HnEEknf7Tg3JULeD4PPYpIqnh/2rnhodJf0g+HnEUkhY7AjUtN+gMOIpJC5h24EchhdMmJyCQ/CuYwTAbi3JDD+76gM4mkxyHnLo/AzVfz7g40jEi6eLaVfjSlH6y1jdDwGcYsCTOVSAp4P+Dc8OLSr9dXEOfcGNwoR6ROvTz1FzP1F2tbLXAGg010JJE08P4CjC92zl1/w+qmTxQ6N+SA3yU+mEg6vDQ1Dpi2ggBYa4vQ8B+MuSO5uUQCm2H1gBk+kz6xgX8uuclE0sA/Oz0OmGEFKbG25X2MWVXboURSwPsjzg0/MNNDEXc1MZvR59Ul9/woBfPEbI/OGohzQwP4a8/UZiiRlPD83F0ZGpjt4Yao546OfnW8WLylA2PuiX0wkeD8LueGX4jaoowbx43/Au8/jmkikXTw/kP8+NNzbTbrSfpU1rbcBuYYho7qJxMJbhDPCueGzs21YVm3HnVu+ALwAN6fr3o0kbAGMTxQThxQwb15nRsaoFDowTM4/9lEQvLnMeahqJPy6co6xJrK2tZO4O863JKMmVg5KogD5nF3d+eGBuDaCrz/sNLnigTh/cd4v7zSOGCeX3/g3JVzMN6D97vm83yR5Pg3YHzF5Hl0xSo+xJrO2uZNGPMqmGK1+xKJ0QjeP+Pc8JvV7KTqQKB0XuJ3Ysz9cexPpCre/w3M5onTgerEEkiJtc2PgXkZY9ri3K9Iefx5PM85N7wnrj1GXmpSqdHRr/5dLC74PZhh4F6MWRjn/kVm5HHAb2F8vXP/jfWqj1hXkKkmP3i1BXgWY/SWsMTP+8+BbWC2Tn4aNnY1C2Qqa1tWA09i+IlO5qVKo5P3cNsN4+9N3mykZhIJpMRa2wQNK4G1wErdYkjKMnFz9cNM3CL3cK1Wi5kkGsh01ra0At1g7gJ/N9AJ3AHGYrwF0xhyPknMKJ4R8EPAJWBg4oud/HHwHzl3JdjXBP4fQFHoFHnhJJwAAAAASUVORK5CYII=":mn==="CC"?"https://app.lighter.xyz/assets/cc-D4WHZ-w6.png":`https://app.hyperliquid.xyz/coins/${mn}.svg`;return{...vt,icon:cr}});Lt==="variational"&&oe==="ON"&&(Pt=Pt.filter(vt=>Re.includes(vt.label))),ft(Pt)}}catch(ce){console.error("Failed to fetch coin list:",ce)}}Gt()},[e,Lt,oe]);const Ge=Gt=>{var ce;return((ce=lt==null?void 0:lt.find(rt=>rt.value===Gt))==null?void 0:ce.maxLeverage)??100},Fe=Gt=>{["e","E","+","-"].includes(Gt.key)&&Gt.preventDefault()},st=Gt=>/^\d*\.?\d{0,6}$/.test(Gt),se=Gt=>/^\d*$/.test(Gt),Ce=m.useMemo(()=>{if(It==="")return!1;const Gt=Number(It);return Number.isInteger(Gt)&&Gt>=1&&Gt<=180},[It]),Be=m.useMemo(()=>{if(jt==="")return!1;const Gt=Number(jt),ce=Ge(it);return Number.isInteger(Gt)&&Gt>=1&&Gt<=ce},[jt,it,lt]),De=m.useMemo(()=>{if(Zt==="")return!1;const Gt=Number(Zt);return Number.isNaN(Gt)?!1:Gt===0?!0:Gt>=1&&Gt<=1e7},[Zt]),_e=m.useMemo(()=>{if(Et==="")return!1;const Gt=Number(Et);if(Number.isNaN(Gt))return!1;const ce=jt===""?null:Number(jt),rt=ce?ce*100-1:4999;return Gt===0?!0:Gt>0&&Gt<1?!1:Gt>=1&&Gt<=rt},[Et,jt]);m.useMemo(()=>{if(Ue==="")return!1;const Gt=Number(Ue);return!Number.isNaN(Gt)&&Gt>0&&Gt<=100},[Ue]);const Je=re&&ve.trim()!==""&&V.trim()!==""&&Ne.trim()!==""&&it!==""&&Ce&&Be&&ut&&(!Zt||De)&&(!Et||_e)&&(un==="LONG"||un==="SHORT"||un==="RANDOM")&&(Ye==="LIMIT"||Ye==="MARKET"||Ye==="RANDOM")&&tn,ct=re&&V.trim()!==""&&Ne.trim()!==""&&ve.trim()!==""&&(Lt!=="lighter"||ae.trim()!=="")&&(Lt!=="lighter"||ge.trim()!=="")&&(Lt!=="lighter"||Ie.trim()!=="")&&(Lt!=="lighter"||V.trim()!==ae.trim())&&(Lt!=="lighter"||Ne.trim()!==ge.trim())&&(Lt!=="lighter"||ve.trim().toLowerCase()!==Ie.trim().toLowerCase())&&it!==""&&Ce&&Be&&ut&&(Lt!=="variational"||S.trim()!=="")&&(Lt!=="variational"||!B)&&(Lt!=="variational"||!de)&&tn;m.useEffect(()=>{if(oe==="ON"&&Lt==="lighter"){if(Ne&&ge&&Ne.trim()===ge.trim()){kn("Make sure the wallet API indexes are unique for each Slot.");return}if(ve&&Ie&&ve.trim().toLowerCase()===Ie.trim().toLowerCase()){kn("Make sure both the Lighter wallet addresses are unique for each Slot.");return}if(V&&ae&&V.trim()===ae.trim()){kn("Please create an API key for each wallet.");return}kn("")}else kn("")},[oe,Ne,ge,V,ae,ve,Ie]);const gt=()=>(localStorage.getItem("hyperAddress")||"dextra").toLowerCase(),Xt=()=>`lighterCreds:${gt()}`,wt=()=>{try{const Gt=localStorage.getItem(Xt());if(!Gt)return;const ce=JSON.parse(Gt);ce.apiKey&&ee(ce.apiKey),ce.apiKeyTwo&&fe(ce.apiKeyTwo),ce.apiKeyIndex&&he(ce.apiKeyIndex),ce.apiKeyIndexTwo&&ye(ce.apiKeyIndexTwo),ce.lighterLoginAddress&&je(ce.lighterLoginAddress),ce.lighterLoginAddressTwo&&Le(ce.lighterLoginAddressTwo),typeof ce.remember=="boolean"&&Dn(ce.remember)}catch{}},Xe=()=>{if(Gn)try{localStorage.setItem(Xt(),JSON.stringify({apiKey:V,apiKeyIndex:Ne,lighterLoginAddress:ve,remember:!0}))}catch{}},Oe=()=>{try{localStorage.removeItem(Xt())}catch{}};m.useEffect(()=>{if(!e)return;const Gt=localStorage.getItem("hyperToken"),ce=localStorage.getItem("hyperAddress");pe(!!(Gt&&ce));const rt=setInterval(()=>{const Pt=localStorage.getItem("hyperToken"),vt=localStorage.getItem("hyperAddress");pe(!!(Pt&&vt))},800);return()=>clearInterval(rt)},[e]),m.useEffect(()=>{!e||!re||(bt(),Ar())},[e,re]),m.useEffect(()=>{e&&(Et===""&&nt(Se),Zt===""&&zt(Se),Ue===""&&Rt(Se))},[e]),m.useEffect(()=>{if(!it)return;const Gt=Ge(it),ce=Number(jt);!Number.isNaN(ce)&&ce>Gt&&cn(String(Gt)),!Number.isNaN(ce)&&ce<1&&jt!==""&&cn("1")},[it]),m.useEffect(()=>{e&&(Gn&&Xe(),Gn||Oe())},[V,Ne,ve,Qe,Gn,e]);async function bt(){var Gt,ce,rt,Pt,vt,ln,mn,cr,Nr,fr,ur,Yr,ss,Ir,mr,Qn;try{Dt(!0),kn("");const xs=window.localStorage.getItem("hyperToken"),Xs=window.localStorage.getItem("hyperAddress");if(!xs||!Xs){ie(!1),wt();return}const Pr=await(await fetch(`${xe}/api/hyper/new_farming_app/info/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({address:Xs.toLowerCase(),token:xs})})).json();if(!(Pr!=null&&Pr.success)){if(console.warn("INFO API RESPONSE:",Pr==null?void 0:Pr.error_message),(Pr==null?void 0:Pr.error_message)==="You have not a running process"){const vn=ut?ut.toLowerCase().replace("-","_"):null,Mn=L==null?void 0:L[vn];if(vn&&Mn){const ot={...L,[vn]:{...Mn,isStop:!0}};z(ot);const er=Object.keys(ot).filter(Wn=>Wn.startsWith("lighter"));if(er.length>0&&!ut){const kr=er.sort((ts,Ms)=>{var Hn,Hr;const At=parseInt(((Hn=ts.match(/\d+/))==null?void 0:Hn[0])||0,10),ir=parseInt(((Hr=Ms.match(/\d+/))==null?void 0:Hr[0])||0,10);return At-ir})[0].match(/\d+/);kr&&qt(`Lighter-${kr[0]}`)}}else qt("Lighter-1")}Pr!=null&&Pr.slots_info&&(P((ce=(Gt=Pr==null?void 0:Pr.slots_info)==null?void 0:Gt.lighter)==null?void 0:ce.total_qty),C((Pt=(rt=Pr==null?void 0:Pr.slots_info)==null?void 0:rt.lighter)==null?void 0:Pt.active_qty),U((ln=(vt=Pr==null?void 0:Pr.slots_info)==null?void 0:vt.variational)==null?void 0:ln.total_qty),R((cr=(mn=Pr==null?void 0:Pr.slots_info)==null?void 0:mn.variational)==null?void 0:cr.active_qty));return}if(Pr!=null&&Pr.success&&(Pr!=null&&Pr.data)){const vn=ut?ut.toLowerCase().replace("-","_"):null,Mn=L==null?void 0:L[vn],ot=Pr.data||{};vn&&!ot[vn]&&Mn&&(ot[vn]={...Mn,isStop:!0}),z(ot);const er=Object.keys(ot).filter(Wn=>Wn.startsWith("lighter"));if(er.length>0&&!ut){const kr=er.sort((ts,Ms)=>{var Hn,Hr;const At=parseInt(((Hn=ts.match(/\d+/))==null?void 0:Hn[0])||0,10),ir=parseInt(((Hr=Ms.match(/\d+/))==null?void 0:Hr[0])||0,10);return At-ir})[0].match(/\d+/);kr&&qt(`Lighter-${kr[0]}`)}Pr!=null&&Pr.slots_info&&(P((fr=(Nr=Pr==null?void 0:Pr.slots_info)==null?void 0:Nr.lighter)==null?void 0:fr.total_qty),C((Yr=(ur=Pr==null?void 0:Pr.slots_info)==null?void 0:ur.lighter)==null?void 0:Yr.active_qty),U((Ir=(ss=Pr==null?void 0:Pr.slots_info)==null?void 0:ss.variational)==null?void 0:Ir.total_qty),R((Qn=(mr=Pr==null?void 0:Pr.slots_info)==null?void 0:mr.variational)==null?void 0:Qn.active_qty))}}catch{ie(!1),wt(),G("OFF"),X(!1)}finally{Dt(!1)}}const kt=m.useMemo(()=>ut?ut.toLowerCase().replace("-","_"):"",[ut]),Ut=!!((es=L==null?void 0:L[kt])!=null&&es.delta)&&!!((Gs=L==null?void 0:L[kt])!=null&&Gs.from_slot),fn=Ut?`lighter_${(Es=L==null?void 0:L[kt])==null?void 0:Es.from_slot}`:kt;m.useEffect(()=>{var rt,Pt,vt,ln,mn,cr,Nr,fr,ur,Yr,ss,Ir,mr,Qn,xs,Xs,ii,Pr,vn,Mn;if(!ut||!L)return;const Gt=fn,ce=L==null?void 0:L[Gt];if(!ce){ee(""),fe(""),he(""),ye(""),je(""),Le(""),tt(""),nn(""),cn(""),Ft("LONG"),ht("MARKET"),ie(!1),G("OFF"),X(!1),Qt("Hour"),zt(""),nt(""),_(""),jn("lighter"),T(null);return}if(ce!=null&&ce.farming_params){ce!=null&&ce.isStop?ie(!1):ie(!0),G("OFF"),X(!1);const ot=ce.farming_params,Vt=(ce==null?void 0:ce.lighter_api_pkey)??"",er=(ce==null?void 0:ce.lighter_login_address)??"",Wn=(ce==null?void 0:ce.lighter_api_index)??"",Fr=(ce==null?void 0:ce.slot_number)??"";Vt&&ee(String(Vt)),er&&je(String(er)),Wn&&he(String(Wn)),Fr&&!Ut&&qt(`Lighter-${Fr}`),ot!=null&&ot.cycleSeconds&&Qt((ot==null?void 0:ot.cycleSeconds)===86400?"Day":"Hour"),ot!=null&&ot.coin&&tt(String(ot.coin)),(ot==null?void 0:ot.orderPerHour)!=null&&nn(String(ot.orderPerHour)),(ot==null?void 0:ot.leverage)!=null&&cn(String(ot.leverage)),ot!=null&&ot.direction&&Ft(String(ot.direction).toUpperCase()==="SHORT"?"SHORT":String(ot.direction).toUpperCase()==="RANDOM"?"RANDOM":"LONG"),ot!=null&&ot.orderType&&ht(String(ot.orderType).toUpperCase()==="MARKET"?"MARKET":String(ot.orderType).toUpperCase()==="LIMIT"?"LIMIT":"RANDOM"),ot!=null&&ot.accountType&&Jn(ot.accountType==="standart"?1:2),ot!=null&&ot.accountType&&Bt(ot.accountType==="standart"?"STANDARD":"PREMIUM"),(ot==null?void 0:ot.tp)!=null&&zt(String(ot.tp)),(ot==null?void 0:ot.sl)!=null&&nt(String(ot.sl)),(ot==null?void 0:ot.spread)!=null&&Rt(String(ot.spread))}else if(ce!=null&&ce.source_params){ce!=null&&ce.isStop?ie(!1):ie(!0),G("ON"),X(!1);const ot=((rt=ce==null?void 0:ce.source_params)==null?void 0:rt.api_pkey)??"",Vt=((Pt=ce==null?void 0:ce.source_params)==null?void 0:Pt.login_wallet)??"",er=((vt=ce==null?void 0:ce.source_params)==null?void 0:vt.api_index)??"",Wn=((ln=ce==null?void 0:ce.target_params)==null?void 0:ln.api_pkey)??"",Fr=((mn=ce==null?void 0:ce.target_params)==null?void 0:mn.login_wallet)??"",kr=((cr=ce==null?void 0:ce.target_params)==null?void 0:cr.api_index)??"",ts=(ce==null?void 0:ce.slot_number)??"";ts&&!Ut&&qt(`Lighter-${ts}`),ot&&ee(String(ot)),Wn&&fe(String(Wn)),Vt&&je(String(Vt)),Fr&&Le(String(Fr)),er&&he(String(er)),kr&&ye(String(kr)),(Nr=ce==null?void 0:ce.source_params)!=null&&Nr.coin&&tt(String((fr=ce==null?void 0:ce.source_params)==null?void 0:fr.coin)),((ur=ce==null?void 0:ce.source_params)==null?void 0:ur.orderPerHour)!=null&&nn(String((Yr=ce==null?void 0:ce.source_params)==null?void 0:Yr.orderPerHour)),((ss=ce==null?void 0:ce.source_params)==null?void 0:ss.leverage)!=null&&cn(String((Ir=ce==null?void 0:ce.source_params)==null?void 0:Ir.leverage)),(mr=ce==null?void 0:ce.source_params)!=null&&mr.accountType&&Jn(((Qn=ce==null?void 0:ce.source_params)==null?void 0:Qn.accountType)==="standart"?1:2),(xs=ce==null?void 0:ce.source_params)!=null&&xs.accountType&&Bt(((Xs=ce==null?void 0:ce.source_params)==null?void 0:Xs.accountType)==="standart"?"STANDARD":"PREMIUM"),(ii=ce==null?void 0:ce.target_params)!=null&&ii.accountType&&qe(((Pr=ce==null?void 0:ce.target_params)==null?void 0:Pr.accountType)==="standart"?"STANDARD":"PREMIUM"),ce!=null&&ce.target_app&&jn((ce==null?void 0:ce.target_app)==="lighter"?"lighter":"variational"),(vn=ce==null?void 0:ce.target_params)!=null&&vn.vr_token&&_((Mn=ce==null?void 0:ce.target_params)==null?void 0:Mn.vr_token)}else ie(!1),G("OFF"),X(!1)},[ut,L,Ut,fn]);const On=Gt=>{var ce;return Number(((ce=String(Gt||"").match(/\d+/))==null?void 0:ce[0])||0)},Sn=Gt=>(Gt||"").toLowerCase().replace("-","_"),yr=m.useMemo(()=>{const Gt=L==null?void 0:L[Sn(ut)];if(Gt!=null&&Gt.delta&&(Gt!=null&&Gt.from_slot))return Number(Gt.from_slot);const ce=Number(Gt==null?void 0:Gt.slot_number);return Number.isFinite(ce)?ce:On(ut)},[ut,L]),Pn=m.useMemo(()=>{const Gt=Number(g)||0,ce=Array.from({length:Gt},()=>({used:!1,kind:null})),rt=L||{};for(const[Pt,vt]of Object.entries(rt)){if(!Pt.startsWith("lighter_"))continue;const ln=On(Pt)-1;ln<0||ln>=Gt||((vt==null?void 0:vt.isStop)===!0?ce[ln]={used:!1,kind:null}:vt!=null&&vt.source_params?ce[ln]={used:!0,kind:"delta-src"}:vt!=null&&vt.target_params||vt!=null&&vt.delta?ce[ln]={used:!0,kind:"delta-shadow"}:vt!=null&&vt.farming_params?ce[ln]={used:!0,kind:"single"}:ce[ln]={used:!0,kind:"unknown"})}return ce},[L,g]),En=m.useMemo(()=>Pn.map((Gt,ce)=>Gt.used&&Gt.kind!=="delta-src-inferred"?`Lighter-${ce+1}`:null).filter(Boolean),[Pn]);m.useMemo(()=>Pn.filter(Gt=>!Gt.used).length,[Pn]);async function $n(){if(!re){n(!0);return}if(Je)try{dn(!0),kn("");const Gt=window.localStorage.getItem("hyperToken"),ce=window.localStorage.getItem("hyperAddress");if(!Gt||!ce){n(!0);return}const rt={coin:it,orderPerHour:Number(It),leverage:Number(jt),direction:un,orderType:Ye,tp:Number(Zt),sl:Number(Et),cycleSeconds:lr==="Hour"?3600:86400},Pt={address:ce.toLowerCase(),token:Gt,api_pkey:V,api_index:Number(Ne),login_wallet:ve,slot_number:Number(ut==null?void 0:ut.replace("Lighter-","")),farming_params:rt},ln=await(await fetch(`${xe}/api/hyper/lighter_farming/save/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Pt)})).json();ln!=null&&ln.success?(ie(!0),bt(),Gn&&Xe()):kn((ln==null?void 0:ln.error_message)||"Start failed.")}catch(Gt){kn(Gt.message||"An error occurred while saving.")}finally{dn(!1)}}async function Bn(){var ce;const Gt=On(ut)-1;if(Gt<0){kn("Please select a slot."),dn(!1);return}if((ce=Pn[Gt])!=null&&ce.used){kn("Selected slot is already in use."),dn(!1);return}if(!re){n(!0);return}if(ct)try{dn(!0),kn("");const rt=window.localStorage.getItem("hyperToken"),Pt=window.localStorage.getItem("hyperAddress");if(!rt||!Pt){n(!0);return}const vt={api_pkey:V,api_index:Ne,login_wallet:ve,coin:it,orderPerHour:Number(It),leverage:Number(jt)},ln={...Lt==="lighter"&&{api_pkey:ae,api_index:ge,login_wallet:Ie},coin:it==null?void 0:it.replace("USDT",""),orderPerHour:Number(It),leverage:Number(jt),...Lt==="variational"&&{vr_token:S}},mn={address:Pt.toLowerCase(),token:rt,slot_number:Number(ut==null?void 0:ut.replace("Lighter-","")),source_app:"lighter",source_params:vt,target_app:Lt==="lighter"?"lighter":"variational_delta",target_params:ln},Nr=await(await fetch(`${xe}/api/hyper/farming_app/save/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(mn)})).json();Nr!=null&&Nr.success?(ie(!0),bt(),Gn&&Xe()):kn((Nr==null?void 0:Nr.error_message)||fallback)}catch(rt){kn(rt.message||"An error occurred while saving.")}finally{dn(!1)}}async function _r(){if(!re){n(!0);return}try{gn(!0),kn("");const Gt=window.localStorage.getItem("hyperToken"),ce=window.localStorage.getItem("hyperAddress");if(!Gt||!ce){n(!0);return}const Pt=await(await fetch(`${xe}/api/hyper/lighter_farming/stop/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({address:ce.toLowerCase(),token:Gt,slot_number:yr})})).json();Pt!=null&&Pt.success?(ie(!1),bt()):kn((Pt==null?void 0:Pt.error_message)||"Stop failed.")}catch(Gt){kn(Gt.message||"An error occurred while stopping.")}finally{gn(!1)}}async function sr(){if(!re){n(!0);return}try{gn(!0),kn("");const Gt=window.localStorage.getItem("hyperToken"),ce=window.localStorage.getItem("hyperAddress");if(!Gt||!ce){n(!0);return}const Pt=await(await fetch(`${xe}/api/hyper/farming_app/stop/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({address:ce.toLowerCase(),token:Gt,source_app:"lighter",target_app:Lt==="lighter"?"lighter":"variational_delta",slot_number:yr})})).json();Pt!=null&&Pt.success?(ie(!1),bt()):kn((Pt==null?void 0:Pt.error_message)||"Stop failed.")}catch(Gt){kn(Gt.message||"An error occurred while stopping.")}finally{gn(!1)}}const rr=Gt=>{jn(Gt??"lighter"),h(!1)},Rr=[{value:"lighter",label:"Lighter"},{value:"variational",label:"Variational"}];function Jr(Gt){try{const ce=Gt.split(".");if(ce.length!==3)throw new Error("Invalid JWT format");const Pt=ce[1].replace(/-/g,"+").replace(/_/g,"/"),vt=decodeURIComponent(atob(Pt).split("").map(ln=>"%"+("00"+ln.charCodeAt(0).toString(16)).slice(-2)).join(""));return JSON.parse(vt)}catch{return null}}const ws={control:(Gt,ce)=>({...Gt,backgroundColor:"#242424",borderColor:ce.isFocused?"#67FFBD":"#353535",minHeight:32,height:32,boxShadow:"none",cursor:"pointer",alignItems:"center",minWidth:"max-content"}),valueContainer:Gt=>({...Gt,height:32,paddingTop:0,paddingBottom:0,display:"flex",alignItems:"center"}),indicatorsContainer:Gt=>({...Gt,height:32}),input:Gt=>({...Gt,color:"#FFFFFF",margin:0,padding:0}),singleValue:Gt=>({...Gt,color:"#FFFFFF",margin:0,lineHeight:"normal",fontSize:"12px",display:"flex",alignItems:"center"}),placeholder:Gt=>({...Gt,color:"#7F7F7F",fontSize:"12px"}),menu:Gt=>({...Gt,backgroundColor:"#242424",border:"1px solid #353535",zIndex:9999}),menuList:Gt=>({...Gt,paddingTop:0,paddingBottom:0,maxHeight:200}),option:(Gt,ce)=>({...Gt,backgroundColor:ce.isFocused?"#2e2e2e":"#242424",color:"#FFFFFF",cursor:"pointer",minHeight:32,display:"flex",alignItems:"center",fontSize:"12px"}),dropdownIndicator:Gt=>({...Gt,color:"#9B9B9B",paddingTop:4,paddingBottom:4}),indicatorSeparator:Gt=>({...Gt,backgroundColor:"#353535"})},ls=({max:Gt})=>i.jsxs("span",{className:"inline-flex items-center h-4 px-1.5 py-2 rounded bg-black/40 border border-[#2A2A2A] text-[10px] text-[#CECECE] font-bold",children:[Gt,"x"]}),et=Gt=>{var ce,rt,Pt;return i.jsx(Ca.Option,{...Gt,children:i.jsxs("div",{className:"flex items-center gap-2 px-3",children:[(ce=Gt.data)!=null&&ce.icon?i.jsx("img",{src:Gt.data.icon,alt:Gt.data.label,className:`${((rt=Gt.data)==null?void 0:rt.label)==="XRP"||((Pt=Gt.data)==null?void 0:Pt.label)==="MEGA"?"bg-[#4F4F4F] rounded-full":""} w-4 h-4 rounded-[4px]`,onError:vt=>vt.currentTarget.style.display="none"}):i.jsx("div",{className:"rounded-full w-4 h-4 min-w-4 min-h-4 bg-[#4F4F4F] flex items-center justify-center",children:i.jsx("span",{className:"text-white text-xs"})}),i.jsx("span",{className:"text-white text-[13px]",children:Gt.data.label}),i.jsx(ls,{max:Gt.data.maxLeverage})]})})},yt=Gt=>{var ce,rt,Pt;return i.jsx(Ca.SingleValue,{...Gt,children:i.jsxs("div",{className:"flex items-center gap-2",children:[(ce=Gt.data)!=null&&ce.icon?i.jsx("img",{src:Gt.data.icon,alt:Gt.data.label,className:`${((rt=Gt.data)==null?void 0:rt.label)==="XRP"||((Pt=Gt.data)==null?void 0:Pt.label)==="MEGA"?"bg-[#4F4F4F] rounded-full":""} w-4 h-4 rounded-[4px]`,onError:vt=>vt.currentTarget.style.display="none"}):i.jsx("div",{className:"rounded-full w-4 h-4 min-w-4 min-h-4 bg-[#4F4F4F] flex items-center justify-center",children:i.jsx("span",{className:"text-white text-xs"})}),i.jsx("span",{className:"text-white text-[13px]",children:Gt.data.label}),i.jsx(ls,{max:Gt.data.maxLeverage})]})})},Tn=Gt=>{const ce=En.includes(Gt.data.value);return i.jsx(Ca.Option,{...Gt,children:i.jsxs("div",{className:"flex items-center gap-2 px-3",children:[i.jsx("span",{className:"text-white text-[13px]",children:Gt.data.label}),ce&&i.jsx("span",{className:"ml-auto w-2 h-2 rounded-full bg-[#67FFBD]",title:"Active"})]})})},tr=Gt=>i.jsx(Ca.SingleValue,{...Gt,children:i.jsx("div",{className:"flex items-center gap-2 px-3",children:i.jsx("span",{className:"text-white text-[13px]",children:Gt.data.label})})}),Ar=async()=>{var rt,Pt,vt,ln,mn,cr,Nr,fr;const Gt=window.localStorage.getItem("hyperToken"),ce=window.localStorage.getItem("hyperAddress");if(!(!Gt||!ce))try{at(!0);const ur=await Ei(ce.toLowerCase(),Gt);ur!=null&&ur.success?(r(ur==null?void 0:ur.telegram_chat_id),s(ur==null?void 0:ur.subscriber_role),a(ur==null?void 0:ur.subs_expire_day),o((rt=ur==null?void 0:ur.mushboomer_counts)==null?void 0:rt.eth),l((Pt=ur==null?void 0:ur.mushboomer_counts)==null?void 0:Pt.sol),c(ur==null?void 0:ur.referral_code),u(ur==null?void 0:ur.refcode),d(ur==null?void 0:ur.whitelist),f(Gt),x(ce),In(!0),v((ln=(vt=ur==null?void 0:ur.slots_info)==null?void 0:vt.lighter)==null?void 0:ln.total_qty),P((cr=(mn=ur==null?void 0:ur.slots_info)==null?void 0:mn.lighter)==null?void 0:cr.total_qty),C((fr=(Nr=ur==null?void 0:ur.slots_info)==null?void 0:Nr.lighter)==null?void 0:fr.active_qty),at(!1)):(window.localStorage.removeItem("hyperToken"),window.localStorage.removeItem("hyperAddress"),f(""),x(""),at(!1))}catch(ur){console.error("Token verification error:",ur),console.error(ur.message||"An unknown error occurred."),at(!1)}},Br=lt,Vr=m.useMemo(()=>Array.from({length:g},(Gt,ce)=>({value:`Lighter-${ce+1}`,label:`Lighter-${ce+1}`})),[g]);if(!e)return null;const dr=mt||Tt||on||We,jr=Y&&!on,ps=Ge(it),gr=I===F;return i.jsxs(i.Fragment,{children:[i.jsx(bd,{open:Nt,setOpen:Yn,transactionHash:xn,transactionLoading:en,paymentPresaleRole:tn,errorFunds:yn,activeMethod:2}),i.jsx(m5,{open:Xn,setOpen:or,paymentLighterRole:tn,oldSlotCount:Q,checkAccountLighter:Ar,tradeMarket:"lighter"}),i.jsxs("div",{className:"fixed inset-0 z-[9000] flex items-center justify-center",children:[i.jsx("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-[2px]",onClick:()=>!dr&&t(!1)}),i.jsxs("div",{className:"relative flex items-start gap-4 px-3 w-full max-w-[1000px]",children:[i.jsx(f2,{current:"lighter",onCloseCurrent:()=>!dr&&t(!1)}),i.jsxs("div",{className:"relative w-[680px] max-w-[92vw] rounded-3xl bg-[#1B1B1B] text-white shadow-xl border border-[#F8D4AB] max-h-[97dvh] overflow-y-auto",children:[i.jsxs("div",{className:"pb-2 px-5 pt-3 border-b border-[#353535] rounded-t-3xl relative",children:[i.jsxs("div",{className:"flex justify-start items-center gap-2",children:[i.jsx(Xf,{className:"w-6 h-6 text-[#fff]"}),i.jsx("span",{className:"text-[24px] font-semibold text-[#fff]",children:"Lighter"}),i.jsx("span",{className:"text-[24px] font-semibold text-[#e87859] mt-[1px]",children:"farming"})]}),i.jsxs("div",{className:"flex justify-between items-center gap-4",children:[i.jsx("div",{className:"text-xs font-normal text-[#7C7C7C] mt-2",children:"Lighter Farming module lets you set up automated farming by providing your API Key, selecting a pair, defining orders per hour, leverage, direction, and TP/SL/Spread percentages."}),i.jsxs("div",{className:"flex flex-col items- justify-start gap-1 relative",children:[i.jsx("div",{className:"absolute -top-12 right-0 text-xs font-semibold text-[#7C7C7C] mt-2",children:i.jsxs("div",{onClick:()=>window.open("https://docs.dextrabot.com/farm/lighter-farming-module","_blank"),className:"h-6 sm:h-7 w-max py-[5px] rounded-[256px] flex justify-start items-center gap-2 cursor-pointer border border-[#353535] px-4 bg-[#242424] hover:bg-[#2e2e2e]",children:[i.jsx("img",{src:l5,className:"w-[14px] h-[14px]"}),i.jsx("div",{className:"min-w-max text-white text-xs font-medium font-manrope leading-none pointer-events-none",children:"Docs"})]})}),i.jsxs("div",{onClick:()=>window.open("https://youtu.be/_TxVAzKU5LE","_blank"),className:"h-6 sm:h-7 w-[130px] py-2 bg-[#FF0000] rounded-[10px] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-[#ff4d4d] inline-flex justify-center items-center gap-1 cursor-pointer",children:[i.jsx("div",{"data-svg-wrapper":!0,children:i.jsx(qk,{})}),i.jsx("div",{className:"text-white text-[13px] font-medium leading-[8px]",children:"YouTube"})]})]})]})]}),i.jsxs("div",{className:"pb-2 space-y-3 pt-2 px-5",children:[Nn&&i.jsx("div",{className:"text-[12px] text-[#FF797C] bg-[#3b2626] border border-[#ff797c]/30 rounded-md px-3 py-2",children:Nn==="Get more slots to run Delta Neutral with Variational"?i.jsxs(i.Fragment,{children:[i.jsx("span",{children:Nn}),i.jsx("button",{onClick:()=>{window.open("#variational-farming","_self")},className:"bg-[#67FFBD]/10 text-[#67FFBD] border border-[#67FFBD]/30 hover:bg-[#67FFBD]/20 text-[11px] px-2 py-[3px] rounded-md transition-colors ml-4",children:"Variational Farming"})]}):i.jsx("span",{children:Nn})}),re&&tn&&N===w&&i.jsx("div",{className:"text-[12px] text-[#FF797C] bg-[#3b2626] border border-[#ff797c]/30 rounded-md px-3 py-2",children:`No free Lighter slots. All ${(Vr==null?void 0:Vr.length)||N} in use.`}),re&&gr&&Lt==="variational"&&!Y&&oe==="ON"&&i.jsx("div",{className:"text-[12px] text-[#FF797C] bg-[#3b2626] border border-[#ff797c]/30 rounded-md px-3 py-2",children:i.jsxs(i.Fragment,{children:[i.jsx("span",{children:'"No Variational slots available. Purchase Variational slot."'}),i.jsx("button",{onClick:()=>{window.open("#variational-farming","_self"),t(!1)},className:"bg-[#67FFBD]/10 text-[#67FFBD] border border-[#67FFBD]/30 hover:bg-[#67FFBD]/20 text-[11px] px-2 py-[3px] rounded-md transition-colors ml-4",children:"Variational Farming"})]})}),J&&i.jsx("div",{className:"text-[12px] text-[#FF797C] bg-[#3b2626] border border-[#ff797c]/30 rounded-md px-3 py-2",children:"You cannot use this area because the delta socket is active in another slot."}),re&&tn&&i.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4 px-4 sm:px-5",children:i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex items-center justify-between text-[13px] text-[#7C7C7C] font-semibold",children:[i.jsx("span",{className:"pl-[2px]",children:"Slot"}),i.jsxs("div",{className:"flex items-center gap-1",children:[i.jsx(s5,{className:"w-3 h-3 text-[#67FFBD] fill-[#67FFBD]"}),i.jsxs("span",{className:"text-[#67FFBD] font-medium",children:[w||0,"/",Vr.length]})]})]}),i.jsx(Cl,{styles:ws,components:{Option:Tn,SingleValue:tr},options:Vr,value:Vr.find(Gt=>Gt.value===ut)||null,onChange:Gt=>qt((Gt==null?void 0:Gt.value)??""),placeholder:"Select",isSearchable:!0})]})}),i.jsxs("div",{className:"py-1 space-y-3 px-3 sm:px-5",children:[i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[oe==="ON"?i.jsxs("div",{className:"col-span-1 space-y-4 border border-[#6f604d] hover:border-[#F8D4AB]/70 rounded-lg p-2.5",children:[i.jsxs("div",{className:"flex items-center justify-between border-b border-[#353535] pb-2 mb-3",children:[i.jsx("span",{className:"text-[13px] font-semibold text-[#F8D4AB]",children:"API - 1"}),i.jsx("span",{className:"rounded-md w-max text-white font-inter text-[14px] font-medium leading-[8px] tracking-[-0.28px] bg-[#353535] px-2 h-6 flex items-center",children:"Lighter"})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"flex items-center justify-between",children:i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"1st Lighter Wallet Address"})}),i.jsx("div",{className:"relative",children:i.jsx("input",{value:ve,onChange:Gt=>je(Gt.target.value),autoComplete:"off",placeholder:"1st Lighter Wallet Address ",type:"text",className:`w-full h-8 px-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${ve===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:dr||jr})})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"API Private Key"}),i.jsx("a",{href:"https://docs.dextrabot.com/farm/lighter-farming-module",target:"_blank",rel:"noopener noreferrer",className:"text-[11px] underline text-[#F8D4AB] hover:text-[#eee0d0]",children:"How to get API Private key?"})]}),i.jsxs("div",{className:"relative",children:[i.jsx("input",{value:V,onChange:Gt=>ee(Gt.target.value),autoComplete:"off",placeholder:"API_PRIVATE_KEY",type:Kn?"text":"password",className:`w-full h-8 pl-3 pr-16 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${V===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:dr||jr}),i.jsx("button",{type:"button",onClick:()=>Cn(Gt=>!Gt),className:"absolute right-1 top-1/2 -translate-y-1/2 text-[11px] text-[#9B9B9B] hover:text-white h-6 flex justify-center items-center hover:border-none hover:ring-0 focus:outline-none focus:border-none bg-transparent",disabled:dr||jr,children:Kn?i.jsx(la,{size:14}):i.jsx(ca,{size:14})})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"API Key Index"}),i.jsx("div",{className:"relative",children:i.jsx("input",{value:Ne,onChange:Gt=>{const ce=Gt.target.value.trim();if(ce==="")return he("");se(ce)&&he(ce)},onKeyDown:Fe,inputMode:"numeric",autoComplete:"off",placeholder:"API_KEY_INDEX",className:`w-full h-8 px-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${Ne===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:dr||jr})})]})]}):i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"flex items-center justify-between",children:i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Lighter Wallet Address"})}),i.jsx("div",{className:"relative",children:i.jsx("input",{value:ve,onChange:Gt=>je(Gt.target.value),autoComplete:"off",placeholder:"Lighter Wallet Address ",type:"text",className:`w-full h-8 px-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${ve===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:dr||jr})})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"API Private Key"}),i.jsx("a",{href:"https://docs.dextrabot.com/farm/lighter-farming-module",target:"_blank",rel:"noopener noreferrer",className:"text-[11px] underline text-[#F8D4AB] hover:text-[#eee0d0]",children:"How to get API Private key?"})]}),i.jsxs("div",{className:"relative",children:[i.jsx("input",{value:V,onChange:Gt=>ee(Gt.target.value),autoComplete:"off",placeholder:"API_PRIVATE_KEY",type:Kn?"text":"password",className:`w-full h-8 pl-3 pr-16 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${V===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:dr||jr}),i.jsx("button",{type:"button",onClick:()=>Cn(Gt=>!Gt),className:"absolute right-1 top-1/2 -translate-y-1/2 text-[11px] text-[#9B9B9B] hover:text-white h-6 flex justify-center items-center hover:border-none hover:ring-0 focus:outline-none focus:border-none bg-transparent",disabled:dr||jr,children:Kn?i.jsx(la,{size:14}):i.jsx(ca,{size:14})})]})]})]}),oe==="ON"&&i.jsxs("div",{className:"col-span-1 space-y-4 border border-[#6f604d] hover:border-[#F8D4AB]/70 rounded-lg p-2.5",children:[i.jsxs("div",{className:"flex items-center justify-between border-b border-[#353535] pb-2 mb-3",children:[i.jsx("span",{className:"text-[13px] font-semibold text-[#F8D4AB]",children:"API - 2"}),i.jsx("div",{children:i.jsxs("div",{ref:p,className:"relative w-[120px]",children:[i.jsxs("div",{className:`${dr||jr?"cursor-not-allowed":"cursor-pointer"} rounded-md bg-[#353535] text-white px-2 h-6 flex items-center justify-between`,onClick:Gt=>{Gt.preventDefault(),dr||jr||h(!Ee)},children:[i.jsx("span",{className:"text-white font-inter text-[14px] font-medium leading-[8px] tracking-[-0.28px]",children:(xr=Rr==null?void 0:Rr.find(Gt=>(Gt==null?void 0:Gt.value)===Lt))==null?void 0:xr.label}),i.jsx("svg",{className:`w-4 h-4 ml-2 transform transition ${Ee?"rotate-180":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),Ee&&i.jsx("div",{className:"absolute z-10 mt-1 w-full bg-[#353535] rounded-md shadow-lg overflow-hidden p-1",children:i.jsx("div",{className:"flex flex-col gap-[2px] max-h-[170px] overflow-y-auto",children:Rr==null?void 0:Rr.map((Gt,ce)=>i.jsxs("div",{onClick:rt=>{rt.preventDefault(),dr||jr||rr(Gt==null?void 0:Gt.value)},className:`py-2 px-2 h-8 min-h-8 flex justify-between items-center rounded-md font-inter text-[14px] font-medium leading-[8px] tracking-[-0.28px] min-w-max gap-1 ${(Gt==null?void 0:Gt.value)===Lt?"bg-[#2c2c2c]":"hover:bg-[#2c2c2c]"} text-white ${dr||jr?"cursor-not-allowed":"cursor-pointer"}`,children:[i.jsx("span",{className:"text-white",children:Gt==null?void 0:Gt.label}),(Gt==null?void 0:Gt.value)===Lt&&i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 text-[#1de674]",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})})]},ce))})})]})})]}),Lt==="lighter"&&i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"flex items-center justify-between",children:i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"2nd Lighter Wallet Address"})}),i.jsx("div",{className:"relative",children:i.jsx("input",{value:Ie,onChange:Gt=>Le(Gt.target.value),autoComplete:"off",placeholder:"2nd Lighter Wallet Address",type:"text",className:`w-full h-8 px-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${Ie===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:dr||jr})})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"API Private Key 2"}),i.jsx("a",{href:"https://docs.dextrabot.com/farm/lighter-farming-module",target:"_blank",rel:"noopener noreferrer",className:"text-[11px] underline text-[#F8D4AB] hover:text-[#eee0d0]",children:"How to get API Private key?"})]}),i.jsxs("div",{className:"relative",children:[i.jsx("input",{value:ae,onChange:Gt=>fe(Gt.target.value),autoComplete:"off",placeholder:"API_PRIVATE_KEY_2",type:sn?"text":"password",className:`w-full h-8 pl-3 pr-16 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${ae===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:dr||jr}),i.jsx("button",{type:"button",onClick:()=>Me(Gt=>!Gt),className:"absolute right-1 top-1/2 -translate-y-1/2 text-[11px] text-[#9B9B9B] hover:text-white h-6 flex justify-center items-center hover:border-none hover:ring-0 focus:outline-none focus:border-none bg-transparent",disabled:dr||jr,children:sn?i.jsx(la,{size:14}):i.jsx(ca,{size:14})})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"API Key Index 2"}),i.jsx("div",{className:"relative",children:i.jsx("input",{value:ge,onChange:Gt=>{const ce=Gt.target.value.trim();if(ce==="")return ye("");se(ce)&&ye(ce)},onKeyDown:Fe,inputMode:"numeric",autoComplete:"off",placeholder:"API_KEY_INDEX_2",className:`w-full h-8 px-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${ge===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:dr||jr})})]})]}),Lt==="variational"&&i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Variational Token"}),i.jsx("a",{href:"https://docs.dextrabot.com/farm/variational-omni-farming-module#getting-your-variational-token",target:"_blank",rel:"noopener noreferrer",className:"text-[11px] underline text-[#F8D4AB] hover:text-[#eee0d0]",children:"How to get Variational Token?"})]}),i.jsxs("div",{className:"relative",children:[i.jsx("input",{value:S,onChange:Gt=>{const ce=Gt.target.value;if(_(ce),!ce.trim()){T(null),q("");return}const rt=Jr(ce);if(rt&&(rt!=null&&rt.exp)){const Pt=new Date((rt==null?void 0:rt.exp)*1e3);T(Pt),q("")}else rt?(T(null),q("The token's expiration date could not be found.")):(T(null),q("Invalid token format."))},type:te?"text":"password",autoComplete:"off",placeholder:"Variational_Token",className:`w-full h-8 pl-3 pr-16 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${S===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:dr||jr}),k&&i.jsxs("div",{className:"text-[12px] mt-1 pl-[3px] flex justify-start items-center gap-2",children:[i.jsx("span",{className:"text-[10px] text-[#CECECE] font-medium",children:"Valid Until:"})," ",i.jsx("span",{className:"text-[11px] font-semibold "+(de?"text-[#FF797C]":"text-[#F8D4AB]"),children:k==null?void 0:k.toLocaleString("en-US",{dateStyle:"medium",timeStyle:"short"})}),de&&i.jsx("span",{children:i.jsx("img",{src:ec,alt:"",className:"w-3.5 h-3.5"})})]}),B&&i.jsx("div",{className:"text-[10px] text-[#FF797C] mt-[2px] pl-[3px]",children:B}),i.jsx("button",{type:"button",onClick:()=>ue(Gt=>!Gt),className:"absolute right-1 top-4 -translate-y-1/2 text-[11px] text-[#9B9B9B] hover:text-white h-6 flex justify-center items-center hover:border-none hover:ring-0 focus:outline-none focus:border-none bg-transparent",disabled:dr||jr,children:te?i.jsx(la,{size:14}):i.jsx(ca,{size:14})})]})]})]})]}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[i.jsxs("div",{className:`${oe==="ON"?"hidden":""} space-y-2`,children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"API Key Index"}),i.jsx("div",{className:"relative",children:i.jsx("input",{value:Ne,onChange:Gt=>{const ce=Gt.target.value.trim();if(ce==="")return he("");se(ce)&&he(ce)},onKeyDown:Fe,inputMode:"numeric",autoComplete:"off",placeholder:"API_KEY_INDEX",className:`w-full h-8 px-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${Ne===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:dr||jr})})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Select Pair"}),i.jsx(Cl,{styles:ws,components:{Option:et,SingleValue:yt},isDisabled:dr||jr,options:Br,value:Br.find(Gt=>Gt.value===it)||null,onChange:Gt=>tt((Gt==null?void 0:Gt.value)??""),placeholder:"Select",isSearchable:!0})]}),i.jsxs("div",{className:`${oe==="ON"?"":"hidden"} space-y-2`,children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Trade Per Hour"}),i.jsx("input",{value:It,onChange:Gt=>{const ce=Gt.target.value.trim();if(ce==="")return nn("");se(ce)&&nn(ce)},onKeyDown:Fe,inputMode:"numeric",autoComplete:"off",placeholder:"e.g. 10 (max 180)",className:`w-full h-8 px-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${It===""?"border-[#353535]":Ce?"border-[#353535] focus:border-[#67FFBD]":"border-[#FF797C]"}`,disabled:dr||jr}),It!==""&&!Ce&&i.jsx("div",{className:"text-[#FF797C] text-[12px]",children:"Enter an integer between 1 and 180."})]})]}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[i.jsxs("div",{className:`${oe==="ON"?"hidden":""} space-y-1`,children:[i.jsxs("div",{className:"flex justify-start items-center gap-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Trade Per"}),i.jsxs("select",{value:lr,onChange:Gt=>Qt(Gt.target.value),className:`${dr||jr?"cursor-not-allowed":"cursor-pointer"} h-6 text-[12px] bg-[#242424] border border-[#353535] rounded-md px-2 text-white outline-none font-bold font-manrope`,disabled:dr||jr,children:[i.jsx("option",{value:"Hour",children:"Hour"}),i.jsx("option",{value:"Day",children:"Day"})]})]}),i.jsx("input",{value:It,onChange:Gt=>{const ce=Gt.target.value.trim();if(ce==="")return nn("");se(ce)&&nn(ce)},onKeyDown:Fe,inputMode:"numeric",autoComplete:"off",placeholder:"e.g. 10 (max 180)",className:`w-full h-8 px-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${It===""?"border-[#353535]":Ce?"border-[#353535] focus:border-[#67FFBD]":"border-[#FF797C]"}`,disabled:dr||jr}),It!==""&&!Ce&&i.jsx("div",{className:"text-[#FF797C] text-[12px]",children:"Enter an integer between 1 and 180."})]}),i.jsxs("div",{className:`${oe==="ON"?"":"hidden"} space-y-2`,children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Delta Neutral (Requires 2 slots to work)"}),i.jsxs("div",{className:"flex justify-between w-full items-center gap-2 border border-[#353535] bg-[#242424] p-1 rounded-md px-2 h-8",children:[i.jsx("span",{className:"text-white font-inter text-[13px] font-medium leading-[8px] tracking-[-0.26px]",children:oe==="ON"?"On":"Off"}),i.jsx(Eo,{checked:oe==="ON",onChange:Gt=>G(Gt?"ON":"OFF"),disabled:dr||jr,className:`${oe==="ON"?"bg-[#1DE674]":"bg-white/10"} relative inline-flex h-5 w-9 items-center rounded-full p-1 transition-colors duration-200 ease-in-out ${dr||jr?"opacity-50 cursor-not-allowed":"cursor-pointer"}`,children:i.jsx("span",{"aria-hidden":"true",className:`inline-block h-4 w-4 transform rounded-full bg-white shadow-lg transition duration-200 ease-in-out ${oe==="ON"?"translate-x-3":"translate-x-0"}`})})]})]}),i.jsxs("div",{className:" space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Leverage"}),i.jsx("input",{value:jt,onChange:Gt=>{const ce=Gt.target.value.trim();if(ce==="")return cn("");se(ce)&&cn(ce)},onKeyDown:Fe,inputMode:"numeric",autoComplete:"off",placeholder:it?`1–${ps}x`:"e.g. 3",className:`w-full h-8 px-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${jt===""?"border-[#353535]":Be?"border-[#353535] focus:border-[#67FFBD]":"border-[#FF797C]"}`,disabled:dr||jr})]})]}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[i.jsxs("div",{className:`${oe==="ON"?"hidden":""} space-y-2`,children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Direction"}),i.jsxs("div",{className:"flex items-center gap-2 md:pr-6",children:[i.jsx("div",{"aria-pressed":un==="LONG",onClick:()=>!jr&&Ft("LONG"),className:["inline-flex justify-center items-center gap-1.5 h-6 rounded-[8px] uppercase tracking-wide font-semibold transition-all border w-1/2","text-[8.5px] px-1",dr||jr?"cursor-not-allowed":"cursor-pointer",un==="LONG"?"bg-[#67FFBD] text-black border-[#67FFBD] shadow-[0_0_0_3px_rgba(103,255,189,0.25)]":"text-[#67FFBD] bg-[#67FFBD]/15 border-[#2A2A2A] hover:bg-[#67FFBD]/25"].join(" "),children:i.jsxs("span",{className:"min-w-max",children:["LONG",jt?` - ${jt}x`:""]})}),i.jsx("div",{"aria-pressed":un==="SHORT",onClick:()=>!jr&&Ft("SHORT"),className:["inline-flex justify-center items-center gap-1.5 h-6 rounded-[8px] uppercase tracking-wide font-semibold transition-all border w-1/2","text-[8.5px] px-1",dr||jr?"cursor-not-allowed":"cursor-pointer",un==="SHORT"?"bg-[#FF797C] text-black border-[#FF797C] shadow-[0_0_0_3px_rgba(255,121,124,0.25)]":"text-[#FF787B] bg-[#FF797C]/20 border-[#2A2A2A] hover:bg-[#FF797C]/30"].join(" "),children:i.jsxs("span",{className:"min-w-max",children:["SHORT",jt?` - ${jt}x`:""]})}),i.jsx("div",{"aria-pressed":un==="RANDOM",onClick:()=>!jr&&Ft("RANDOM"),className:["inline-flex justify-center items-center gap-1.5 h-6 rounded-[8px] uppercase tracking-wide font-semibold transition-all border w-1/2","text-[8.5px] px-1",dr||jr?"cursor-not-allowed":"cursor-pointer",un==="RANDOM"?"bg-[#3b82f6] text-[#ffffff] border-[#93c5fd] shadow-[0_0_0_3px_rgba(59,130,246,0.3)]":"text-[#3b82f6] bg-[rgba(59,130,246,0.15)] border-[rgba(59,130,246,0.15)] hover:bg-[#2563eb] hover:text-white"].join(" "),children:i.jsxs("span",{className:"min-w-max",children:["RANDOM",jt?` - ${jt}x`:""]})})]})]}),i.jsxs("div",{className:`${oe==="ON"?"hidden":""} space-y-2`,children:[i.jsx("div",{className:"flex items-center gap-2 text-[13px] text-[#7C7C7C] font-semibold",children:i.jsx("span",{children:"Order Type"})}),i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("button",{"aria-pressed":Ye==="MARKET",onClick:()=>!jr&&ht("MARKET"),className:["inline-flex justify-center items-center gap-1.5 h-6 px-2 rounded-[8px] uppercase tracking-wide text-[8.5px] font-semibold transition-all border w-1/2",dr||jr?"cursor-not-allowed":"cursor-pointer",Ye==="MARKET"?"bg-[#8e643a] text-white border-[#44382C]":"text-[#7C7C7C] bg-transparent border-[#404040] hover:bg-[#404040]/25 hover:text-white"].join(" "),children:i.jsxs("span",{children:["MARKET ",Ye==="MARKET"?" ✓":""]})}),i.jsx("button",{"aria-pressed":Ye==="LIMIT",onClick:()=>!jr&&ht("LIMIT"),className:["inline-flex justify-center items-center gap-1.5 h-6 px-2 rounded-[8px] uppercase tracking-wide text-[8.5px] font-semibold transition-all border w-1/2",dr||jr?"cursor-not-allowed":"cursor-pointer",Ye==="LIMIT"?"bg-[#8e643a] text-white border-[#44382C]":"text-[#7C7C7C] bg-transparent border-[#404040] hover:bg-[#404040]/25 hover:text-white"].join(" "),children:i.jsxs("span",{children:["LIMIT ",Ye==="LIMIT"?" ✓":""]})}),i.jsx("button",{"aria-pressed":Ye==="RANDOM",onClick:()=>!jr&&ht("RANDOM"),className:["inline-flex justify-center items-center gap-1.5 h-6 px-2 rounded-[8px] uppercase tracking-wide text-[8.5px] font-semibold transition-all border w-1/2",dr||jr?"cursor-not-allowed":"cursor-pointer",Ye==="RANDOM"?"bg-[#8e643a] text-white border-[#44382C]":"text-[#7C7C7C] bg-transparent border-[#404040] hover:bg-[#404040]/25 hover:text-white"].join(" "),children:i.jsxs("span",{children:["RANDOM ",Ye==="RANDOM"?" ✓":""]})})]})]})]}),i.jsxs("div",{className:`${oe==="ON"?"hidden":""} grid grid-cols-1 md:grid-cols-2 gap-4`,children:[i.jsxs("div",{className:`${oe==="ON"?"hidden":""} space-y-2`,children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Take Profit %"}),i.jsxs("div",{className:"relative",children:[i.jsx("span",{className:"absolute left-2 top-1/2 -translate-y-1/2 text-[#7F7F7F] font-semibold",children:"%"}),i.jsx("input",{value:Zt,onChange:Gt=>{const ce=Gt.target.value.trim();if(ce==="")return zt("");st(ce)&&zt(ce)},onKeyDown:Fe,inputMode:"decimal",autoComplete:"off",placeholder:"e.g. 5",className:`w-full h-8 pl-7 pr-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${Zt===""?"border-[#353535]":De?"border-[#353535] focus:border-[#67FFBD]":"border-[#FF797C]"}`,disabled:dr||jr})]}),Zt!==""&&!De&&i.jsx("div",{className:"text-[#FF797C] text-[11px]",children:"Value must be 0, or between 1 and 10000000. Numbers between 0 and 1 are not allowed."})]}),i.jsxs("div",{className:`${oe==="ON"?"hidden":""} space-y-2`,children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Stop Loss %"}),i.jsxs("div",{className:"relative",children:[i.jsx("span",{className:"absolute left-2 top-1/2 -translate-y-1/2 text-[#7F7F7F] font-semibold",children:"%"}),i.jsx("input",{value:Et,onChange:Gt=>{const ce=Gt.target.value.trim();if(ce==="")return nt("");st(ce)&&nt(ce)},onKeyDown:Fe,inputMode:"decimal",autoComplete:"off",placeholder:"e.g. 5",className:`w-full h-8 pl-7 pr-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${Et===""?"border-[#353535]":_e?"border-[#353535] focus:border-[#67FFBD]":"border-[#FF797C]"}`,disabled:dr||jr})]}),Et!==""&&!_e&&i.jsxs("div",{className:"text-[#FF797C] text-[11px]",children:["Value must be 0, or between 1 and"," ",jt?Math.max(jt*100-1,0):4999,". Numbers between 0 and 1 are not allowed."]})]})]}),i.jsx("div",{className:`${oe==="ON"?"hidden":""} grid grid-cols-1 md:grid-cols-2 gap-4`,children:i.jsxs("div",{className:`${oe==="ON"?"hidden":""} space-y-2`,children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Delta Neutral"}),i.jsxs("div",{className:"flex justify-between w-full items-center gap-2 border border-[#353535] bg-[#242424] p-1 rounded-md px-2 h-8",children:[i.jsx("span",{className:"text-white font-inter text-[13px] font-medium leading-[8px] tracking-[-0.26px]",children:oe==="ON"?"On":"Off"}),i.jsx(Eo,{checked:oe==="ON",onChange:Gt=>G(Gt?"ON":"OFF"),disabled:dr||jr,className:`${oe==="ON"?"bg-[#1DE674]":"bg-white/10"} relative inline-flex h-5 w-9 items-center rounded-full p-1 transition-colors duration-200 ease-in-out ${dr||jr?"opacity-50 cursor-not-allowed":"cursor-pointer"}`,children:i.jsx("span",{"aria-hidden":"true",className:`inline-block h-4 w-4 transform rounded-full bg-white shadow-lg transition duration-200 ease-in-out ${oe==="ON"?"translate-x-3":"translate-x-0"}`})})]})]})}),!1]}),i.jsx("div",{className:"py-3 flex items-center gap-3 px-5 border-t border-[#353535] bg-[rgba(27,27,27,0.32)] rounded-b-3xl",children:i.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[i.jsx("button",{onClick:()=>!dr&&t(!1),className:"inline-flex items-center justify-center h-8 px-5 rounded-[10px] border bg-black/5 border-[#353535] text-white text-[13px] hover:border-white disabled:opacity-60",disabled:dr,children:"Cancel"}),re?oe==="ON"?Y?i.jsx("button",{onClick:sr,disabled:dr,className:`${J?"hidden":""} inline-flex items-center justify-center h-8 px-6 rounded-[10px] text-[13px] border border-[#353535] hover:border-[#FF797C] text-[#FF797C] bg-[rgba(27,27,27,0.32)] disabled:opacity-60`,children:on?"Stopping...":"Stop"}):i.jsx("button",{onClick:Bn,disabled:!ct||dr||Lt==="variational"&&gr&&oe==="ON",className:`inline-flex items-center justify-center h-8 px-6 rounded-[10px] text-[13px] border ${!ct||dr||Lt==="variational"&&gr&&oe==="ON"?"bg-[#2a2a2a] border-[#3a3a3a] opacity-60 cursor-not-allowed":"bg-[#7446FF] border-[#8861FF] hover:bg-[#5834C3]"} ${J?"hidden":""}`,children:Tt?"Starting...":"Start"}):Y?i.jsx("button",{onClick:_r,disabled:dr,className:`${J?"hidden":""} inline-flex items-center justify-center h-8 px-6 rounded-[10px] text-[13px] border border-[#353535] hover:border-[#FF797C] text-[#FF797C] bg-[rgba(27,27,27,0.32)] disabled:opacity-60`,children:on?"Stopping...":"Stop"}):i.jsx("button",{onClick:$n,disabled:!Je||dr,className:`inline-flex items-center justify-center h-8 px-6 rounded-[10px] text-[13px] border ${!Je||dr?"bg-[#2a2a2a] border-[#3a3a3a] opacity-60 cursor-not-allowed":"bg-[#7446FF] border-[#8861FF] hover:bg-[#5834C3]"} ${J?"hidden":""}`,children:Tt?"Starting...":"Start"}):i.jsx("button",{onClick:()=>n(!0),className:"inline-flex items-center justify-center h-8 px-6 rounded-[10px] text-[13px] border bg-[#67FFBD] border-[#67FFBD] text-black hover:opacity-90",children:"Connect"})]})}),mt&&i.jsx("div",{className:"absolute inset-0 rounded-3xl bg-black/40 flex items-center justify-center text-sm",children:"Loading..."})]})]})]})]})]})},Woe=({open:e=!1,setOpen:t=()=>{}})=>{const{setSignModalOpen:n,setTelegramChatId:r,setSubscriberRole:s,setSubsExpireDay:a,setMushboomerETH:o,setMushboomerSOL:l,setIsReferralCode:c,setIsReferralCodeName:u,setIsWhitelist:d,setHyperToken:f,setHyperAddress:x}=m.useContext(Qr);ns();const[g,v]=m.useState(!1),[w,C]=m.useState(!1),[N,P]=m.useState(""),[I,R]=m.useState(""),[F,U]=m.useState(""),[L,z]=m.useState(""),[Q,ne]=m.useState(""),[J,X]=m.useState(""),[re,pe]=m.useState(""),[Y,ie]=m.useState("LONG"),[oe,G]=m.useState(!1),[V,ee]=m.useState(!1),[ae,fe]=m.useState(!1),[Ne,he]=m.useState(!1),[ge,ye]=m.useState(""),[ve,je]=m.useState(""),[Ie,Le]=m.useState(!0),[Qe,$e]=m.useState(!1),[it,tt]=m.useState(!1),[lt,ft]=m.useState(!1),[ut,qt]=m.useState(!1),[It,nn]=m.useState(!1),[jt,cn]=m.useState(!1),[un,Ft]=m.useState(""),[Ke,Bt]=m.useState(!0);m.useState(1);const $t="https://dextrabothypev2.nftinit.io",qe=m.useMemo(()=>[{value:"BTC-USDT",label:"BTCUSDT",icon:"https://app.hyperliquid.xyz/coins/BTC.svg",maxLeverage:100},{value:"ETH-USDT",label:"ETHUSDT",icon:"https://app.hyperliquid.xyz/coins/ETH.svg",maxLeverage:100},{value:"APEX-USDT",label:"APEXUSDT",icon:"https://app.hyperliquid.xyz/coins/APEX.svg",maxLeverage:50},{value:"ASTER-USDT",label:"ASTERUSDT",icon:"https://static.astherus.finance/image/admin_mgs_image_upload/20250916/6dba1412-ddfb-4314-bfdf-87fa11f2daa6.png",maxLeverage:50},{value:"SOL-USDT",label:"SOLUSDT",icon:"https://app.hyperliquid.xyz/coins/SOL.svg",maxLeverage:50},{value:"HYPE-USDT",label:"HYPEUSDT",icon:"https://app.hyperliquid.xyz/coins/HYPE.svg",maxLeverage:50}],[]),Ye=Cn=>{var sn;return((sn=qe.find(Me=>Me.value===Cn))==null?void 0:sn.maxLeverage)??100},ht=Cn=>{["e","E","+","-"].includes(Cn.key)&&Cn.preventDefault()},Zt=Cn=>/^\d*$/.test(Cn),zt=m.useMemo(()=>{if(J==="")return!1;const Cn=Number(J);return Number.isInteger(Cn)&&Cn>=1&&Cn<=100},[J]),Et=m.useMemo(()=>{if(re==="")return!1;const Cn=Number(re),sn=Ye(Q);return Number.isInteger(Cn)&&Cn>=1&&Cn<=sn},[re,Q]),nt=g&&N.trim()!==""&&F.trim()!==""&&I.trim()!==""&&L.trim()!==""&&Q!==""&&zt&&Et&&(Y==="LONG"||Y==="SHORT"||Y==="RANDOM"),Ue=()=>(localStorage.getItem("hyperAddress")||"dextra").toLowerCase(),Rt=()=>`apexCreds:${Ue()}`,We=()=>{try{const Cn=localStorage.getItem(Rt());if(!Cn)return;const sn=JSON.parse(Cn);sn.apiKey&&P(sn.apiKey),sn.apiKeySecret&&R(sn.apiKeySecret),sn.omniKeySeed&&z(sn.omniKeySeed),sn.apiKeyPass&&U(sn.apiKeyPass),typeof sn.remember=="boolean"&&Le(sn.remember)}catch{}},at=()=>{if(Ie)try{localStorage.setItem(Rt(),JSON.stringify({apiKey:N,apiKeyPass:F,apiKeySecret:I,omniKeySeed:L,remember:!0}))}catch{}},mt=()=>{try{localStorage.removeItem(Rt())}catch{}};m.useEffect(()=>{if(!e)return;const Cn=localStorage.getItem("hyperToken"),sn=localStorage.getItem("hyperAddress");v(!!(Cn&&sn));const Me=setInterval(()=>{const en=localStorage.getItem("hyperToken"),an=localStorage.getItem("hyperAddress");v(!!(en&&an))},800);return()=>clearInterval(Me)},[e]),m.useEffect(()=>{!e||!g||(Dt(),yn())},[e,g]),m.useEffect(()=>{if(!Q)return;const Cn=Ye(Q),sn=Number(re);!Number.isNaN(sn)&&sn>Cn&&pe(String(Cn)),!Number.isNaN(sn)&&sn<1&&re!==""&&pe("1")},[Q]),m.useEffect(()=>{e&&(Ie&&at(),Ie||mt())},[N,F,I,L,Ie,e]);async function Dt(){var Cn,sn,Me,en,an;try{ee(!0),ye("");const Nt=window.localStorage.getItem("hyperToken"),Yn=window.localStorage.getItem("hyperAddress");if(!Nt||!Yn){C(!1),We();return}const Mt=await(await fetch(`${$t}/api/hyper/apex_farming/info/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({address:Yn.toLowerCase(),token:Nt})})).json(),tn=(Cn=Mt==null?void 0:Mt.data)==null?void 0:Cn.farming_params;if(Mt!=null&&Mt.success&&tn){C(!0);const In=((sn=Mt==null?void 0:Mt.data)==null?void 0:sn.apex_api_pkey)??"",Xn=((Me=Mt==null?void 0:Mt.data)==null?void 0:Me.apex_api_pass)??"",or=((en=Mt==null?void 0:Mt.data)==null?void 0:en.apex_api_secret)??"",lr=((an=Mt==null?void 0:Mt.data)==null?void 0:an.apex_key_seed)??"";In&&P(String(In)),Xn&&U(String(Xn)),or&&R(String(or)),lr&&z(String(lr)),tn!=null&&tn.symbol&&ne(String(tn.symbol)),(tn==null?void 0:tn.orderPerHour)!=null&&X(String(tn.orderPerHour)),(tn==null?void 0:tn.leverage)!=null&&pe(String(tn.leverage)),tn!=null&&tn.direction&&ie(String(tn.direction).toUpperCase()==="SHORT"?"SHORT":String(tn.direction).toUpperCase()==="RANDOM"?"RANDOM":"LONG")}else C(!1);!N&&!F&&!I&&!L&&We()}catch{C(!1),We()}finally{ee(!1)}}async function Tt(){if(!g){n(!0);return}if(nt)try{fe(!0),ye("");const Cn=window.localStorage.getItem("hyperToken"),sn=window.localStorage.getItem("hyperAddress");if(!Cn||!sn){n(!0);return}const Me={symbol:Q,orderPerHour:Number(J),leverage:Number(re),direction:Y},en={address:sn.toLowerCase(),token:Cn,apex_api_pkey:N,apex_api_secret:I,apex_api_pass:F,apex_key_seed:L,farming_params:Me},Nt=await(await fetch(`${$t}/api/hyper/apex_farming/save/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(en)})).json();Nt!=null&&Nt.success?(C(!0),Ie&&at()):ye((Nt==null?void 0:Nt.error_message)||"Start failed.")}catch(Cn){ye(Cn.message||"An error occurred while saving.")}finally{fe(!1)}}async function dn(){if(!g){n(!0);return}try{he(!0),ye("");const Cn=window.localStorage.getItem("hyperToken"),sn=window.localStorage.getItem("hyperAddress");if(!Cn||!sn){n(!0);return}const en=await(await fetch(`${$t}/api/hyper/apex_farming/stop/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({address:sn.toLowerCase(),token:Cn})})).json();en!=null&&en.success?C(!1):ye((en==null?void 0:en.error_message)||"Stop failed.")}catch(Cn){ye(Cn.message||"An error occurred while stopping.")}finally{he(!1)}}const on={control:(Cn,sn)=>({...Cn,backgroundColor:"#242424",borderColor:sn.isFocused?"#67FFBD":"#353535",minHeight:32,height:32,boxShadow:"none",cursor:"pointer",alignItems:"center"}),valueContainer:Cn=>({...Cn,height:32,paddingTop:0,paddingBottom:0,display:"flex",alignItems:"center"}),indicatorsContainer:Cn=>({...Cn,height:32}),input:Cn=>({...Cn,color:"#FFFFFF",margin:0,padding:0}),singleValue:Cn=>({...Cn,color:"#FFFFFF",margin:0,lineHeight:"normal",fontSize:"12px",display:"flex",alignItems:"center"}),placeholder:Cn=>({...Cn,color:"#7F7F7F",fontSize:"12px"}),menu:Cn=>({...Cn,backgroundColor:"#242424",border:"1px solid #353535",zIndex:9999}),menuList:Cn=>({...Cn,paddingTop:0,paddingBottom:0}),option:(Cn,sn)=>({...Cn,backgroundColor:sn.isFocused?"#2e2e2e":"#242424",color:"#FFFFFF",cursor:"pointer",minHeight:32,display:"flex",alignItems:"center",fontSize:"12px"}),dropdownIndicator:Cn=>({...Cn,color:"#9B9B9B",paddingTop:4,paddingBottom:4}),indicatorSeparator:Cn=>({...Cn,backgroundColor:"#353535"})},gn=({max:Cn})=>i.jsxs("span",{className:"inline-flex items-center h-4 px-1.5 py-2 rounded bg-black/40 border border-[#2A2A2A] text-[10px] text-[#CECECE] font-bold",children:[Cn,"x"]}),Nn=Cn=>{var sn;return i.jsx(Ca.Option,{...Cn,children:i.jsxs("div",{className:"flex items-center gap-2 px-3",children:[((sn=Cn.data)==null?void 0:sn.icon)&&i.jsx("img",{src:Cn.data.icon,alt:Cn.data.label,className:"w-4 h-4 rounded-[4px]",onError:Me=>Me.currentTarget.style.display="none"}),i.jsx("span",{className:"text-white text-[13px]",children:Cn.data.label}),i.jsx(gn,{max:Cn.data.maxLeverage})]})})},kn=Cn=>{var sn;return i.jsx(Ca.SingleValue,{...Cn,children:i.jsxs("div",{className:"flex items-center gap-2",children:[((sn=Cn.data)==null?void 0:sn.icon)&&i.jsx("img",{src:Cn.data.icon,alt:Cn.data.label,className:"w-4 h-4 rounded-[4px]",onError:Me=>Me.currentTarget.style.display="none"}),i.jsx("span",{className:"text-white text-[13px]",children:Cn.data.label}),i.jsx(gn,{max:Cn.data.maxLeverage})]})})},yn=async()=>{var Me,en;const Cn=window.localStorage.getItem("hyperToken"),sn=window.localStorage.getItem("hyperAddress");if(!(!Cn||!sn))try{G(!0);const an=await Ei(sn.toLowerCase(),Cn);an!=null&&an.success?(r(an==null?void 0:an.telegram_chat_id),s(an==null?void 0:an.subscriber_role),a(an==null?void 0:an.subs_expire_day),o((Me=an==null?void 0:an.mushboomer_counts)==null?void 0:Me.eth),l((en=an==null?void 0:an.mushboomer_counts)==null?void 0:en.sol),c(an==null?void 0:an.referral_code),u(an==null?void 0:an.refcode),d(an==null?void 0:an.whitelist),f(Cn),x(sn),Bt(!0),G(!1)):(window.localStorage.removeItem("hyperToken"),window.localStorage.removeItem("hyperAddress"),f(""),x(""),G(!1))}catch(an){console.error("Token verification error:",an),console.error(an.message||"An unknown error occurred."),G(!1)}},Vn=qe;if(!e)return null;const Gn=V||ae||Ne||oe,Dn=w&&!Ne,Kn=Ye(Q);return i.jsxs(i.Fragment,{children:[i.jsx(bd,{open:jt,setOpen:cn,transactionHash:un,transactionLoading:It,paymentPresaleRole:Ke,errorFunds:ve,activeMethod:2}),i.jsxs("div",{className:"fixed inset-0 z-[9000] flex items-center justify-center",children:[i.jsx("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-[2px]",onClick:()=>!Gn&&t(!1)}),i.jsxs("div",{className:"relative flex items-start gap-4 px-3 w-full max-w-[1000px]",children:[i.jsx(f2,{current:"apex",onCloseCurrent:()=>!Gn&&t(!1)}),i.jsxs("div",{className:"relative w-[680px] max-w-[92vw] rounded-3xl bg-[#1B1B1B] text-white shadow-xl border border-[#F8D4AB] max-h-[97dvh] overflow-y-auto",children:[i.jsxs("div",{className:"pb-2 px-5 pt-5 border-b border-[#353535] rounded-t-3xl relative",children:[i.jsxs("div",{className:"flex justify-start items-center gap-2",children:[i.jsx("img",{src:"https://omni.apex.exchange/assets/logo_content-CY9uyFbz.svg",alt:""}),i.jsx("span",{className:"text-[24px] font-semibold text-[#e87859] -mt-1",children:"farming"})]}),i.jsxs("div",{className:"flex justify-between items-center gap-4",children:[i.jsx("div",{className:"text-xs font-normal text-[#7C7C7C] mt-2",children:"Apex Farming module lets you set up automated farming by providing your API Key, API Key Passphrase, API Key Secret, Omni Key Seed, selecting a pair, defining orders per hour, leverage and direction."}),i.jsx("div",{className:"flex flex-col items- justify-start gap-1 relative",children:i.jsxs("div",{onClick:()=>window.open("https://youtu.be/VczH7nAH0Gc","_blank"),className:"h-6 sm:h-7 w-[130px] py-2 bg-[#FF0000] rounded-[10px] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-[#ff4d4d] inline-flex justify-center items-center gap-1 cursor-pointer",children:[i.jsx("div",{"data-svg-wrapper":!0,children:i.jsx(qk,{})}),i.jsx("div",{className:"text-white text-[13px] font-medium leading-[8px]",children:"YouTube"})]})})]})]}),i.jsxs("div",{className:"space-y-2 pt-2 pb-2 px-5",children:[ge&&i.jsx("div",{className:"text-[12px] text-[#FF797C] bg-[#3b2626] border border-[#ff797c]/30 rounded-md px-3 py-2",children:ge}),i.jsxs("div",{className:"space-y-3 px-3 sm:px-5 py-2",children:[i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"API Key"}),i.jsx("a",{href:"https://omni.apex.exchange/keyManagement",target:"_blank",rel:"noopener noreferrer",className:"text-[11px] underline text-[#F8D4AB] hover:text-[#eee0d0]",children:"How to get API key?"})]}),i.jsxs("div",{className:"relative",children:[i.jsx("input",{value:N,onChange:Cn=>P(Cn.target.value),autoComplete:"off",placeholder:"API_KEY",type:Qe?"text":"password",className:`w-full h-8 pl-3 pr-16 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${N===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:Gn||Dn}),i.jsx("button",{type:"button",onClick:()=>$e(Cn=>!Cn),className:"absolute right-1 top-1/2 -translate-y-1/2 text-[11px] text-[#9B9B9B] hover:text-white h-6 flex justify-center items-center hover:border-none hover:ring-0 focus:outline-none focus:border-none bg-transparent",disabled:Gn||Dn,children:Qe?i.jsx(la,{size:14}):i.jsx(ca,{size:14})})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"flex items-center justify-between",children:i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"API Key Passphrase"})}),i.jsxs("div",{className:"relative",children:[i.jsx("input",{value:F,onChange:Cn=>U(Cn.target.value),autoComplete:"off",placeholder:"API_KEY_PAASSPHRASE",type:lt?"text":"password",className:`w-full h-8 pl-3 pr-16 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${F===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:Gn||Dn}),i.jsx("button",{type:"button",onClick:()=>ft(Cn=>!Cn),className:"absolute right-1 top-1/2 -translate-y-1/2 text-[11px] text-[#9B9B9B] hover:text-white h-6 flex justify-center items-center hover:border-none hover:ring-0 focus:outline-none focus:border-none bg-transparent",disabled:Gn||Dn,children:lt?i.jsx(la,{size:14}):i.jsx(ca,{size:14})})]})]})]}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"API Key Secret"}),i.jsxs("div",{className:"relative",children:[i.jsx("input",{value:I,onChange:Cn=>R(Cn.target.value),autoComplete:"off",placeholder:"API_KEY_SECRET",type:it?"text":"password",className:`w-full h-8 pl-3 pr-16 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${I===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:Gn||Dn}),i.jsx("button",{type:"button",onClick:()=>tt(Cn=>!Cn),className:"absolute right-1 top-1/2 -translate-y-1/2 text-[11px] text-[#9B9B9B] hover:text-white h-6 flex justify-center items-center hover:border-none hover:ring-0 focus:outline-none focus:border-none bg-transparent",disabled:Gn||Dn,children:it?i.jsx(la,{size:14}):i.jsx(ca,{size:14})})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Omni Key Seed"}),i.jsxs("div",{className:"relative",children:[i.jsx("input",{value:L,onChange:Cn=>z(Cn.target.value),autoComplete:"off",placeholder:"OMNI_KEY_SEED",type:ut?"text":"password",className:`w-full h-8 pl-3 pr-16 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${L===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:Gn||Dn}),i.jsx("button",{type:"button",onClick:()=>qt(Cn=>!Cn),className:"absolute right-1 top-1/2 -translate-y-1/2 text-[11px] text-[#9B9B9B] hover:text-white h-6 flex justify-center items-center hover:border-none hover:ring-0 focus:outline-none focus:border-none bg-transparent",disabled:Gn||Dn,children:ut?i.jsx(la,{size:14}):i.jsx(ca,{size:14})})]})]})]}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Select Pair"}),i.jsx(Cl,{styles:on,components:{Option:Nn,SingleValue:kn},isDisabled:Gn||Dn,options:Vn,value:Vn.find(Cn=>Cn.value===Q)||null,onChange:Cn=>ne((Cn==null?void 0:Cn.value)??""),placeholder:"Select",isSearchable:!0})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Trade Per Hour"}),i.jsx("input",{value:J,onChange:Cn=>{const sn=Cn.target.value.trim();if(sn==="")return X("");Zt(sn)&&X(sn)},onKeyDown:ht,inputMode:"numeric",autoComplete:"off",placeholder:"e.g. 10 (max 100)",className:`w-full h-8 px-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${J===""?"border-[#353535]":zt?"border-[#353535] focus:border-[#67FFBD]":"border-[#FF797C]"}`,disabled:Gn||Dn}),J!==""&&!zt&&i.jsx("div",{className:"text-[#FF797C] text-[12px]",children:"Enter an integer between 1 and 100."})]})]}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[i.jsxs("div",{className:" space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Leverage"}),i.jsx("input",{value:re,onChange:Cn=>{const sn=Cn.target.value.trim();if(sn==="")return pe("");Zt(sn)&&pe(sn)},onKeyDown:ht,inputMode:"numeric",autoComplete:"off",placeholder:Q?`1–${Kn}x`:"e.g. 3",className:`w-full h-8 px-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${re===""?"border-[#353535]":Et?"border-[#353535] focus:border-[#67FFBD]":"border-[#FF797C]"}`,disabled:Gn||Dn})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Direction"}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("div",{"aria-pressed":Y==="LONG",onClick:()=>!Dn&&ie("LONG"),className:["inline-flex justify-center items-center gap-1.5 h-8 rounded-[10px] uppercase tracking-wide font-semibold transition-all border w-1/2",re?"text-[10px] px-1.5":"text-[11px] px-2",Gn||Dn?"opacity-60 cursor-not-allowed":"cursor-pointer",Y==="LONG"?"bg-[#67FFBD] text-black border-[#67FFBD] shadow-[0_0_0_3px_rgba(103,255,189,0.25)]":"text-[#67FFBD] bg-[#67FFBD]/15 border-[#2A2A2A] hover:bg-[#67FFBD]/25"].join(" "),children:i.jsxs("span",{className:"min-w-max",children:["LONG",re?` - ${re}x`:""]})}),i.jsx("div",{"aria-pressed":Y==="SHORT",onClick:()=>!Dn&&ie("SHORT"),className:["inline-flex justify-center items-center gap-1.5 h-8 rounded-[10px] uppercase tracking-wide font-semibold transition-all border w-1/2",re?"text-[10px] px-1.5":"text-[11px] px-2",Gn||Dn?"opacity-60 cursor-not-allowed":"cursor-pointer",Y==="SHORT"?"bg-[#FF797C] text-black border-[#FF797C] shadow-[0_0_0_3px_rgba(255,121,124,0.25)]":"text-[#FF787B] bg-[#FF797C]/20 border-[#2A2A2A] hover:bg-[#FF797C]/30"].join(" "),children:i.jsxs("span",{className:"min-w-max",children:["SHORT",re?` - ${re}x`:""]})}),i.jsx("div",{"aria-pressed":Y==="RANDOM",onClick:()=>!Dn&&ie("RANDOM"),className:["inline-flex justify-center items-center gap-1.5 h-8 rounded-[10px] uppercase tracking-wide font-semibold transition-all border w-1/2",re?"text-[10px] px-1.5":"text-[11px] px-2",Gn||Dn?"opacity-60 cursor-not-allowed":"cursor-pointer",Y==="RANDOM"?"bg-[#3b82f6] text-[#ffffff] border-[#93c5fd] shadow-[0_0_0_3px_rgba(59,130,246,0.3)]":"text-[#3b82f6] bg-[rgba(59,130,246,0.15)] border-[rgba(59,130,246,0.15)] hover:bg-[#2563eb] hover:text-white"].join(" "),children:i.jsxs("span",{className:"min-w-max",children:["RANDOM",re?` - ${re}x`:""]})})]})]})]})]}),i.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center gap-4 px-5 py-2 border-t border-[#353535] bg-[rgba(27,27,27,0.32)] rounded-b-3xl",children:[i.jsxs("div",{onClick:()=>window.open("https://join.omni.apex.exchange/AFF-7530","_blank"),className:"cursor-pointer text-[12px] text-zinc-400 text-start transition-colors duration-300 hover:text-zinc-200 flex-1",children:[i.jsxs("p",{children:["Be part of the"," ",i.jsx("span",{className:"text-white font-semibold",children:"Dextrabot x Apex squad!"})," ","Trade under our referral — unlock bonuses instantly"]}),i.jsx("div",{className:"mt-1 inline-flex items-center gap-1 text-emerald-400 font-medium hover:text-emerald-300 transition-colors duration-300",children:"🔗 Join Now"})]}),i.jsxs("div",{className:"ml-auto flex-1 flex justify-end items-center gap-2",children:[i.jsx("button",{onClick:()=>!Gn&&t(!1),className:"inline-flex items-center justify-center h-8 px-5 rounded-[10px] border bg-black/5 border-[#353535] text-white text-[13px] hover:border-white disabled:opacity-60",disabled:Gn,children:"Cancel"}),g?w?i.jsx("button",{onClick:dn,disabled:Gn,className:"inline-flex items-center justify-center h-8 px-6 rounded-[10px] text-[13px] border border-[#353535] hover:border-[#FF797C] text-[#FF797C] bg-[rgba(27,27,27,0.32)] disabled:opacity-60",children:Ne?"Stopping...":"Stop"}):i.jsx("button",{onClick:Tt,disabled:!nt||Gn,className:`inline-flex items-center justify-center h-8 px-6 rounded-[10px] text-[13px] border ${!nt||Gn?"bg-[#2a2a2a] border-[#3a3a3a] opacity-60 cursor-not-allowed":"bg-[#7446FF] border-[#8861FF] hover:bg-[#5834C3]"}`,children:ae?"Starting...":"Start"}):i.jsx("button",{onClick:()=>n(!0),className:"inline-flex items-center justify-center h-8 px-6 rounded-[10px] text-[13px] border bg-[#67FFBD] border-[#67FFBD] text-black hover:opacity-90",children:"Connect"})]})]}),V&&i.jsx("div",{className:"absolute inset-0 rounded-3xl bg-black/40 flex items-center justify-center text-sm",children:"Loading..."})]})]})]})]})]})},qoe=({open:e=!1,setOpen:t=()=>{}})=>{var ws,ls;const{setSignModalOpen:n,setTelegramChatId:r,setSubscriberRole:s,setSubsExpireDay:a,setMushboomerETH:o,setMushboomerSOL:l,setIsReferralCode:c,setIsReferralCodeName:u,setIsWhitelist:d,setHyperToken:f,setHyperAddress:x}=m.useContext(Qr);ns();const[g,v]=m.useState(!1),[w,C]=m.useState(!1),[N,P]=m.useState(1),[I,R]=m.useState(0),[F,U]=m.useState(0),[L,z]=m.useState({}),[Q,ne]=m.useState(null),[J,X]=m.useState(!1),[re,pe]=m.useState("variational");m.useState(!1),m.useRef(null);const[Y,ie]=m.useState(!1),[oe,G]=m.useState(!1),[V,ee]=m.useState(0),[ae,fe]=m.useState("OFF"),[Ne,he]=m.useState(""),[ge,ye]=m.useState(""),[ve,je]=m.useState(""),[Ie,Le]=m.useState(""),[Qe,$e]=m.useState(null),[it,tt]=m.useState(""),[lt,ft]=m.useState(""),[ut,qt]=m.useState(""),[It,nn]=m.useState("");m.useState("");const[jt,cn]=m.useState("");m.useState([]);const[un,Ft]=m.useState(""),[Ke,Bt]=m.useState(""),[$t,qe]=m.useState(""),[Ye,ht]=m.useState("LONG"),[Zt,zt]=m.useState("STANDARD"),[Et,nt]=m.useState("STANDARD"),[Ue,Rt]=m.useState("MARKET"),[We,at]=m.useState(""),[mt,Dt]=m.useState(""),[Tt,dn]=m.useState(""),[on,gn]=m.useState("Hour"),[Nn,kn]=m.useState(!1),[yn,Vn]=m.useState(!1),[Gn,Dn]=m.useState(!1),[Kn,Cn]=m.useState(!1),[sn,Me]=m.useState(""),[en,an]=m.useState(""),[Nt,Yn]=m.useState(!0),[xn,Mt]=m.useState(!1),[tn,In]=m.useState(!1),[Xn,or]=m.useState(!1),[lr,Qt]=m.useState(!1),[zn,Jn]=m.useState(!1),[Lt,jn]=m.useState(""),[Ee,h]=m.useState(!0),[p,S]=m.useState(""),_=Qe?(Qe==null?void 0:Qe.getTime())<=Date.now():!1;m.useState(1);const k="https://dextrabothypev2.nftinit.io",T="",B=m.useMemo(()=>[{value:"BTC",label:"BTC",icon:"https://app.hyperliquid.xyz/coins/BTC.svg",maxLeverage:50},{value:"ETH",label:"ETH",icon:"https://app.hyperliquid.xyz/coins/ETH.svg",maxLeverage:50},{value:"SOL",label:"SOL",icon:"https://app.hyperliquid.xyz/coins/SOL.svg",maxLeverage:50},{value:"HYPE",label:"HYPE",icon:"https://app.hyperliquid.xyz/coins/HYPE.svg",maxLeverage:50},{value:"XAUT",label:"XAUT",icon:"https://coin-images.coingecko.com/coins/images/10481/large/Tether_Gold.png",maxLeverage:50},{value:"BNB",label:"BNB",icon:"https://app.hyperliquid.xyz/coins/BNB.svg",maxLeverage:50},{value:"PUMPFUN",label:"PUMPFUN",icon:"https://coin-images.coingecko.com/coins/images/67164/large/pump.jpg",maxLeverage:50},{value:"KAITO",label:"KAITO",icon:"https://app.hyperliquid.xyz/coins/KAITO.svg",maxLeverage:50},{value:"ZEC",label:"ZEC",icon:"https://app.hyperliquid.xyz/coins/ZEC.svg",maxLeverage:50},{value:"SUI",label:"SUI",icon:"https://app.hyperliquid.xyz/coins/SUI.svg",maxLeverage:50},{value:"VIRTUAL",label:"VIRTUAL",icon:"https://app.hyperliquid.xyz/coins/VIRTUAL.svg",maxLeverage:50},{value:"TAO",label:"TAO",icon:"https://app.hyperliquid.xyz/coins/TAO.svg",maxLeverage:50},{value:"XRP",label:"XRP",icon:"https://app.hyperliquid.xyz/coins/XRP.svg",maxLeverage:50},{value:"TRUMP",label:"TRUMP",icon:"https://app.hyperliquid.xyz/coins/TRUMP.svg",maxLeverage:50},{value:"CRO",label:"CRO",icon:"https://coin-images.coingecko.com/coins/images/7310/large/cro_token_logo.png",maxLeverage:50},{value:"XPL",label:"XPL",icon:"https://app.hyperliquid.xyz/coins/XPL.svg",maxLeverage:50},{value:"IP",label:"IP",icon:"https://app.hyperliquid.xyz/coins/IP.svg",maxLeverage:50},{value:"PAXG",label:"PAXG",icon:"https://app.hyperliquid.xyz/coins/PAXG.svg",maxLeverage:50},{value:"ASTER",label:"ASTER",icon:"https://app.hyperliquid.xyz/coins/ASTER.svg",maxLeverage:50},{value:"DOLO",label:"DOLO",icon:"https://coin-images.coingecko.com/coins/images/54710/large/DOLO-small.png",maxLeverage:50},{value:"RESOLV",label:"RESOLV",icon:"https://app.hyperliquid.xyz/coins/RESOLV.svg",maxLeverage:50},{value:"GRASS",label:"GRASS",icon:"https://app.hyperliquid.xyz/coins/GRASS.svg",maxLeverage:50},{value:"YZY",label:"YZY",icon:"https://app.hyperliquid.xyz/coins/YZY.svg",maxLeverage:50},{value:"PROVE",label:"PROVE",icon:"https://app.hyperliquid.xyz/coins/PROVE.svg",maxLeverage:50},{value:"SYRUP",label:"SYRUP",icon:"https://app.hyperliquid.xyz/coins/SYRUP.svg",maxLeverage:50},{value:"NMR",label:"NMR",icon:"https://coin-images.coingecko.com/coins/images/752/large/numeraire.png",maxLeverage:50},{value:"GMX",label:"GMX",icon:"https://app.hyperliquid.xyz/coins/GMX.svg",maxLeverage:50}],[]),q=et=>{var yt;return((yt=B.find(Tn=>Tn.value===et))==null?void 0:yt.maxLeverage)??100},te=et=>{["e","E","+","-"].includes(et.key)&&et.preventDefault()},ue=et=>/^\d*\.?\d{0,6}$/.test(et),de=et=>/^\d*$/.test(et),xe=m.useMemo(()=>{if(Ke==="")return!1;const et=Number(Ke);return Number.isInteger(et)&&et>=1&&et<=120},[Ke]),Se=m.useMemo(()=>{if($t==="")return!1;const et=Number($t),yt=q(jt);return Number.isInteger(et)&&et>=1&&et<=yt},[$t,jt]),ke=m.useMemo(()=>{if(We==="")return!1;const et=Number(We);return Number.isNaN(et)?!1:et===0?!0:et>=1&&et<=1e7},[We]),Re=m.useMemo(()=>{if(mt==="")return!1;const et=Number(mt);if(Number.isNaN(et))return!1;const yt=$t===""?null:Number($t),Tn=yt?yt*100-1:4999;return et===0?!0:et>0&&et<1?!1:et>=1&&et<=Tn},[mt,$t]);m.useMemo(()=>{if(Tt==="")return!1;const et=Number(Tt);return!Number.isNaN(et)&&et>0&&et<=100},[Tt]);const Ge=g&&Ie.trim()!==""&&jt!==""&&xe&&Se&&(!We||ke)&&(!mt||Re)&&!_&&!it&&un&&(Ye==="LONG"||Ye==="SHORT"||Ye==="RANDOM")&&(Ue==="LIMIT"||Ue==="MARKET"||Ue==="RANDOM")&&Ee,Fe=g&&Ie.trim()!==""&&jt!==""&&xe&&un&&Se&&un&&Ee,st=()=>(localStorage.getItem("hyperAddress")||"dextra").toLowerCase(),se=()=>`variationalCreds:${st()}`,Ce=()=>{try{const et=localStorage.getItem(se());if(!et)return;const yt=JSON.parse(et);yt.variationalToken&&Le(yt.variationalToken),typeof yt.remember=="boolean"&&Yn(yt.remember)}catch{}},Be=()=>{if(Nt)try{localStorage.setItem(se(),JSON.stringify({variationalToken:Ie,remember:!0}))}catch{}},De=()=>{try{localStorage.removeItem(se())}catch{}};m.useEffect(()=>{if(!e)return;const et=localStorage.getItem("hyperToken"),yt=localStorage.getItem("hyperAddress");v(!!(et&&yt));const Tn=setInterval(()=>{const tr=localStorage.getItem("hyperToken"),Ar=localStorage.getItem("hyperAddress");v(!!(tr&&Ar))},800);return()=>clearInterval(Tn)},[e]),m.useEffect(()=>{!e||!g||(_e(),$n())},[e,g]),m.useEffect(()=>{e&&(mt===""&&Dt(T),We===""&&at(T),Tt===""&&dn(T))},[e]),m.useEffect(()=>{if(!jt)return;const et=q(jt),yt=Number($t);!Number.isNaN(yt)&&yt>et&&qe(String(et)),!Number.isNaN(yt)&&yt<1&&$t!==""&&qe("1")},[jt]),m.useEffect(()=>{e&&(Nt&&Be(),Nt||De())},[Ie,Nt,e]);async function _e(){var et,yt,Tn,tr,Ar,Br,Vr,dr;try{Vn(!0),Me("");const jr=window.localStorage.getItem("hyperToken"),ps=window.localStorage.getItem("hyperAddress");if(!jr||!ps){C(!1),Ce();return}const es=await(await fetch(`${k}/api/hyper/new_farming_app/info/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({address:ps.toLowerCase(),token:jr})})).json();if(!(es!=null&&es.success)){if(console.warn("INFO API RESPONSE:",es==null?void 0:es.error_message),(es==null?void 0:es.error_message)==="You have not a running process"){const Gs=un?un.toLowerCase().replace("-","_farming_"):null,Es=L==null?void 0:L[Gs];if(Gs&&Es){const xr={...L,[Gs]:{...Es,isStop:!0}};z(xr);const ce=Object.keys(xr).filter(rt=>rt.startsWith("variational"));if(ce.length>0&&!un){const vt=ce.sort((ln,mn)=>{var fr,ur;const cr=parseInt(((fr=ln.match(/\d+/))==null?void 0:fr[0])||0,10),Nr=parseInt(((ur=mn.match(/\d+/))==null?void 0:ur[0])||0,10);return cr-Nr})[0].match(/\d+/);vt&&Ft(`Variational-${vt[0]}`)}}else Ft("Variational-1")}es!=null&&es.slots_info&&(U((yt=(et=es==null?void 0:es.slots_info)==null?void 0:et.variational)==null?void 0:yt.total_qty),R((tr=(Tn=es==null?void 0:es.slots_info)==null?void 0:Tn.variational)==null?void 0:tr.active_qty));return}if(es!=null&&es.success&&(es!=null&&es.data)){const Gs=un?un.toLowerCase().replace("-","_farming_"):null,Es=L==null?void 0:L[Gs],xr=es.data||{};Gs&&!xr[Gs]&&Es&&(xr[Gs]={...Es,isStop:!0}),z(xr);const ce=Object.keys(xr).filter(rt=>rt.startsWith("variational"));if(ce.length>0&&!un){const vt=ce.sort((ln,mn)=>{var fr,ur;const cr=parseInt(((fr=ln.match(/\d+/))==null?void 0:fr[0])||0,10),Nr=parseInt(((ur=mn.match(/\d+/))==null?void 0:ur[0])||0,10);return cr-Nr})[0].match(/\d+/);vt&&Ft(`Variational-${vt[0]}`)}es!=null&&es.slots_info&&(U((Br=(Ar=es==null?void 0:es.slots_info)==null?void 0:Ar.variational)==null?void 0:Br.total_qty),R((dr=(Vr=es==null?void 0:es.slots_info)==null?void 0:Vr.variational)==null?void 0:dr.active_qty))}}catch{C(!1),Ce(),fe("OFF"),X(!1)}finally{Vn(!1)}}const Je=m.useMemo(()=>un?un.toLowerCase().replace("-","_farming_"):"",[un]),ct=!!((ws=L==null?void 0:L[Je])!=null&&ws.delta)&&!!((ls=L==null?void 0:L[Je])!=null&&ls.from_slot),gt=Je;m.useEffect(()=>{var Tn,tr,Ar,Br,Vr,dr,jr,ps,gr,es,Gs,Es,xr,Gt;if(!un||!L)return;const et=gt,yt=L==null?void 0:L[et];if(!yt){he(""),ye(""),je(""),ft(""),qt(""),nn(""),cn(""),Bt(""),S(""),qe(""),ht("LONG"),Rt("MARKET"),C(!1),fe("OFF"),X(!1),gn("Hour"),at(""),Dt(""),Le(""),$e(null),pe("variational"),G(!1),ee(0);return}if((yt==null?void 0:yt.target_params)==null&&yt.source_params){yt!=null&&yt.isStop?C(!1):C(!0),fe("OFF"),X(!1),G(!1);const ce=yt.source_params,rt=(yt==null?void 0:yt.slot_number)??"";rt&&!ct&&Ft(`Variational-${rt}`),ce!=null&&ce.cycleSeconds&&gn((ce==null?void 0:ce.cycleSeconds)===86400?"Day":"Hour"),ce!=null&&ce.vr_token&&Le(String(ce.vr_token)),ce!=null&&ce.coin&&cn(String(ce.coin)),(ce==null?void 0:ce.orderPerHour)!=null&&Bt(String(ce.orderPerHour)),(ce==null?void 0:ce.leverage)!=null&&qe(String(ce.leverage)),ce!=null&&ce.direction&&ht(String(ce.direction).toUpperCase()==="SHORT"?"SHORT":String(ce.direction).toUpperCase()==="RANDOM"?"RANDOM":"LONG"),ce!=null&&ce.orderType&&Rt(String(ce.orderType).toUpperCase()==="MARKET"?"MARKET":String(ce.orderType).toUpperCase()==="LIMIT"?"LIMIT":"RANDOM"),(ce==null?void 0:ce.tp)!=null&&at(String(ce.tp)),(ce==null?void 0:ce.sl)!=null&&Dt(String(ce.sl))}else if((yt==null?void 0:yt.target_params)!==null){yt!=null&&yt.isStop?(C(!1),G(!1)):(C(!0),G(!0)),fe("OFF"),X(!1);const ce=(yt==null?void 0:yt.slot_number)??"";ee(ce),ce&&!ct&&Ft(`Variational-${ce}`),(Tn=yt==null?void 0:yt.source_params)!=null&&Tn.vr_token&&Le(String((tr=yt==null?void 0:yt.source_params)==null?void 0:tr.vr_token)),(Ar=yt==null?void 0:yt.target_params)!=null&&Ar.coin&&cn(String((Br=yt==null?void 0:yt.target_params)==null?void 0:Br.coin)),((Vr=yt==null?void 0:yt.source_params)==null?void 0:Vr.orderPerHour)!=null&&Bt(String((dr=yt==null?void 0:yt.source_params)==null?void 0:dr.orderPerHour)),yt!=null&&yt.source_app&&S(yt==null?void 0:yt.source_app),((jr=yt==null?void 0:yt.source_params)==null?void 0:jr.leverage)!=null&&qe(String((ps=yt==null?void 0:yt.source_params)==null?void 0:ps.leverage)),(gr=yt==null?void 0:yt.source_params)!=null&&gr.accountType&&zt(((es=yt==null?void 0:yt.source_params)==null?void 0:es.accountType)==="standart"?"STANDARD":"PREMIUM"),(Gs=yt==null?void 0:yt.target_params)!=null&&Gs.accountType&&nt(((Es=yt==null?void 0:yt.target_params)==null?void 0:Es.accountType)==="standart"?"STANDARD":"PREMIUM"),yt!=null&&yt.target_app&&pe(((yt==null?void 0:yt.target_app)==="variational","variational")),(xr=yt==null?void 0:yt.target_params)!=null&&xr.vr_token&&Le((Gt=yt==null?void 0:yt.target_params)==null?void 0:Gt.vr_token)}else C(!1),fe("OFF"),X(!1)},[un,L,ct,gt]);const Xt=et=>{var yt;return Number(((yt=String(et||"").match(/\d+/))==null?void 0:yt[0])||0)},wt=et=>(et||"").toLowerCase().replace("-","_"),Xe=m.useMemo(()=>{const et=L==null?void 0:L[wt(un)];if(et!=null&&et.delta&&(et!=null&&et.from_slot))return Number(et.from_slot);const yt=Number(et==null?void 0:et.slot_number);return Number.isFinite(yt)?yt:Xt(un)},[un,L]),Oe=m.useMemo(()=>{const et=Number(N)||0,yt=Array.from({length:et},()=>({used:!1,kind:null})),Tn=L||{};for(const[tr,Ar]of Object.entries(Tn)){if(!tr.startsWith("variational_farming"))continue;const Br=Xt(tr)-1;Br<0||Br>=et||((Ar==null?void 0:Ar.isStop)===!0?yt[Br]={used:!1,kind:null}:Ar!=null&&Ar.source_params?yt[Br]={used:!0,kind:"delta-src"}:Ar!=null&&Ar.target_params||Ar!=null&&Ar.delta?yt[Br]={used:!0,kind:"delta-shadow"}:Ar!=null&&Ar.farming_params?yt[Br]={used:!0,kind:"single"}:yt[Br]={used:!0,kind:"unknown"})}return yt},[L,N]),bt=m.useMemo(()=>Oe.map((et,yt)=>et.used&&et.kind!=="delta-src-inferred"?`Variational-${yt+1}`:null).filter(Boolean),[Oe]);m.useMemo(()=>Oe.filter(et=>!et.used).length,[Oe]);async function kt(){if(!g){n(!0);return}if(Ge)try{Dn(!0),Me("");const et=window.localStorage.getItem("hyperToken"),yt=window.localStorage.getItem("hyperAddress");if(!et||!yt){n(!0);return}const Tn={vr_token:Ie,coin:jt,orderPerHour:Number(Ke),leverage:Number($t),direction:Ye,orderType:"MARKET",tp:Number(We),sl:Number(mt),cycleSeconds:on==="Hour"?3600:86400},tr={api_pkey:ge,api_index:lt,login_wallet:It,coin:jt==null?void 0:jt.replace("USDT",""),orderPerHour:Number(Ke),leverage:Number($t)},Ar={address:yt.toLowerCase(),token:et,source_app:"variational_farming",source_params:Tn,slot_number:Number(un==null?void 0:un.replace("Variational-",""))},Vr=await(await fetch(`${k}/api/hyper/farming_app/save/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Ar)})).json();Vr!=null&&Vr.success?(C(!0),_e(),Nt&&Be()):Me((Vr==null?void 0:Vr.error_message)||"Start failed.")}catch(et){Me(et.message||"An error occurred while saving.")}finally{Dn(!1)}}async function Ut(){if(!g){n(!0);return}try{Cn(!0),Me("");const et=window.localStorage.getItem("hyperToken"),yt=window.localStorage.getItem("hyperAddress");if(!et||!yt){n(!0);return}const tr=await(await fetch(`${k}/api/hyper/farming_app/stop/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({address:yt.toLowerCase(),token:et,...oe?{slot_number:V,target_app:"variational_delta",source_app:p}:{source_app:"variational_farming",slot_number:Xe}})})).json();tr!=null&&tr.success?(C(!1),_e()):Me((tr==null?void 0:tr.error_message)||"Stop failed.")}catch(et){Me(et.message||"An error occurred while stopping.")}finally{Cn(!1)}}const fn={control:(et,yt)=>({...et,backgroundColor:"#242424",borderColor:yt.isFocused?"#67FFBD":"#353535",minHeight:32,height:32,boxShadow:"none",cursor:"pointer",alignItems:"center"}),valueContainer:et=>({...et,height:32,paddingTop:0,paddingBottom:0,display:"flex",alignItems:"center"}),indicatorsContainer:et=>({...et,height:32}),input:et=>({...et,color:"#FFFFFF",margin:0,padding:0}),singleValue:et=>({...et,color:"#FFFFFF",margin:0,lineHeight:"normal",fontSize:"12px",display:"flex",alignItems:"center"}),placeholder:et=>({...et,color:"#7F7F7F",fontSize:"12px"}),menu:et=>({...et,backgroundColor:"#242424",border:"1px solid #353535",zIndex:9999}),menuList:et=>({...et,paddingTop:0,paddingBottom:0,maxHeight:200}),option:(et,yt)=>({...et,backgroundColor:yt.isFocused?"#2e2e2e":"#242424",color:"#FFFFFF",cursor:"pointer",minHeight:32,display:"flex",alignItems:"center",fontSize:"12px"}),dropdownIndicator:et=>({...et,color:"#9B9B9B",paddingTop:4,paddingBottom:4}),indicatorSeparator:et=>({...et,backgroundColor:"#353535"})};m.useEffect(()=>{if(!Ie){$e(null),tt("");return}const et=Bn(Ie);if(et&&(et!=null&&et.exp)){const yt=new Date(et.exp*1e3);$e(yt),tt("")}else et?($e(null),tt("The token's expiration date could not be found.")):($e(null),tt("Invalid token format."))},[Ie]);const On=({max:et})=>i.jsxs("span",{className:"inline-flex items-center h-4 px-1.5 py-2 rounded bg-black/40 border border-[#2A2A2A] text-[10px] text-[#CECECE] font-bold",children:[et,"x"]}),Sn=et=>{var yt,Tn;return i.jsx(Ca.Option,{...et,children:i.jsxs("div",{className:"flex items-center gap-2 px-3",children:[(yt=et.data)!=null&&yt.icon?i.jsx("img",{src:et.data.icon,alt:et.data.label,className:`w-4 h-4 ${((Tn=et==null?void 0:et.data)==null?void 0:Tn.label)==="XRP"?"bg-gray-600 rounded-full":"rounded-[4px]"}`,onError:tr=>tr.currentTarget.style.display="none"}):i.jsx("div",{className:"rounded-full w-4 h-4 min-w-4 min-h-4 bg-[#4F4F4F] flex items-center justify-center",children:i.jsx("span",{className:"text-white text-xs"})}),i.jsx("span",{className:"text-white text-[13px]",children:et.data.label}),i.jsx(On,{max:et.data.maxLeverage})]})})},yr=et=>{var yt,Tn;return i.jsx(Ca.SingleValue,{...et,children:i.jsxs("div",{className:"flex items-center gap-2",children:[(yt=et.data)!=null&&yt.icon?i.jsx("img",{src:et.data.icon,alt:et.data.label,className:`w-4 h-4 ${((Tn=et==null?void 0:et.data)==null?void 0:Tn.label)==="XRP"?"bg-gray-600 rounded-full":"rounded-[4px]"}`,onError:tr=>tr.currentTarget.style.display="none"}):i.jsx("div",{className:"rounded-full w-4 h-4 min-w-4 min-h-4 bg-[#4F4F4F] flex items-center justify-center",children:i.jsx("span",{className:"text-white text-xs"})}),i.jsx("span",{className:"text-white text-[13px]",children:et.data.label}),i.jsx(On,{max:et.data.maxLeverage})]})})},Pn=et=>{const yt=bt.includes(et.data.value);return i.jsx(Ca.Option,{...et,children:i.jsxs("div",{className:"flex items-center gap-2 px-3",children:[i.jsx("span",{className:"text-white text-[13px]",children:et.data.label}),yt&&i.jsx("span",{className:"ml-auto w-2 h-2 rounded-full bg-[#67FFBD]",title:"Active"})]})})},En=et=>i.jsx(Ca.SingleValue,{...et,children:i.jsx("div",{className:"flex items-center gap-2 px-3",children:i.jsx("span",{className:"text-white text-[13px]",children:et.data.label})})}),$n=async()=>{var Tn,tr,Ar,Br,Vr,dr,jr,ps;const et=window.localStorage.getItem("hyperToken"),yt=window.localStorage.getItem("hyperAddress");if(!(!et||!yt))try{kn(!0);const gr=await Ei(yt.toLowerCase(),et);gr!=null&&gr.success?(r(gr==null?void 0:gr.telegram_chat_id),s(gr==null?void 0:gr.subscriber_role),a(gr==null?void 0:gr.subs_expire_day),o((Tn=gr==null?void 0:gr.mushboomer_counts)==null?void 0:Tn.eth),l((tr=gr==null?void 0:gr.mushboomer_counts)==null?void 0:tr.sol),c(gr==null?void 0:gr.referral_code),u(gr==null?void 0:gr.refcode),d(gr==null?void 0:gr.whitelist),f(et),x(yt),h(!0),P((Br=(Ar=gr==null?void 0:gr.slots_info)==null?void 0:Ar.variational)==null?void 0:Br.total_qty),U((dr=(Vr=gr==null?void 0:gr.slots_info)==null?void 0:Vr.variational)==null?void 0:dr.total_qty),R((ps=(jr=gr==null?void 0:gr.slots_info)==null?void 0:jr.variational)==null?void 0:ps.active_qty),kn(!1)):(window.localStorage.removeItem("hyperToken"),window.localStorage.removeItem("hyperAddress"),f(""),x(""),kn(!1))}catch(gr){console.error("Token verification error:",gr),console.error(gr.message||"An unknown error occurred."),kn(!1)}};function Bn(et){try{const yt=et.split(".");if(yt.length!==3)throw new Error("Invalid JWT format");const tr=yt[1].replace(/-/g,"+").replace(/_/g,"/"),Ar=decodeURIComponent(atob(tr).split("").map(Br=>"%"+("00"+Br.charCodeAt(0).toString(16)).slice(-2)).join(""));return JSON.parse(Ar)}catch{return null}}const _r=B,sr=m.useMemo(()=>Array.from({length:N},(et,yt)=>({value:`Variational-${yt+1}`,label:`Variational-${yt+1}`})),[N]);if(!e)return null;const rr=yn||Gn||Kn||Nn,Rr=w&&!Kn,Jr=q(jt);return i.jsxs(i.Fragment,{children:[i.jsx(bd,{open:zn,setOpen:Jn,transactionHash:Lt,transactionLoading:lr,paymentPresaleRole:Ee,errorFunds:en,activeMethod:2}),i.jsx(m5,{open:Y,setOpen:ie,paymentLighterRole:Ee,oldSlotCount:Q,checkAccountLighter:$n,tradeMarket:"variational"}),i.jsxs("div",{className:"fixed inset-0 z-[9000] flex items-center justify-center",children:[i.jsx("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-[2px]",onClick:()=>!rr&&t(!1)}),i.jsxs("div",{className:"relative flex items-start gap-4 px-3 w-full max-w-[1000px]",children:[i.jsx(f2,{current:"variational",onCloseCurrent:()=>!rr&&t(!1)}),i.jsxs("div",{className:"relative w-[680px] max-w-[92vw] rounded-3xl bg-[#1B1B1B] text-white shadow-xl border border-[#F8D4AB] max-h-[97dvh] overflow-y-auto",children:[i.jsxs("div",{className:"pb-2 px-5 pt-3 border-b border-[#353535] rounded-t-3xl relative",children:[i.jsxs("div",{className:"flex justify-start items-center gap-2",children:[i.jsx("img",{src:"https://omni.variational.io/_app/immutable/assets/full_omni_wordmark.DwlcSpMk.svg",alt:"Variational",className:"h-[18px] text-white"}),i.jsx("span",{className:"text-[24px] font-semibold text-[#e87859] mt-[1px]",children:"farming"})]}),i.jsxs("div",{className:"flex justify-between items-center gap-4",children:[i.jsx("div",{className:"text-xs font-normal text-[#7C7C7C] mt-2",children:"Variational Farming module lets you set up automated farming by providing your Variational Token, selecting a pair, defining orders per hour, leverage, direction and order type ."}),i.jsx("div",{className:"flex flex-col items- justify-start gap-1 relative",children:i.jsx("div",{className:"text-xs font-semibold text-[#7C7C7C] mt-2",children:i.jsxs("div",{onClick:()=>window.open("https://docs.dextrabot.com/farm/variational-omni-farming-module#getting-your-variational-token","_blank"),className:"h-6 sm:h-7 w-max py-[5px] rounded-[256px] flex justify-start items-center gap-2 cursor-pointer border border-[#353535] px-4 bg-[#242424] hover:bg-[#2e2e2e]",children:[i.jsx("img",{src:l5,className:"w-[14px] h-[14px]"}),i.jsx("div",{className:"min-w-max text-white text-xs font-medium font-manrope leading-none pointer-events-none",children:"Docs"})]})})})]})]}),i.jsxs("div",{className:"pb-2 space-y-3 pt-2 px-5",children:[sn&&i.jsx("div",{className:"text-[12px] text-[#FF797C] bg-[#3b2626] border border-[#ff797c]/30 rounded-md px-3 py-2",children:sn}),g&&Ee&&F===I&&i.jsx("div",{className:"text-[12px] text-[#FF797C] bg-[#3b2626] border border-[#ff797c]/30 rounded-md px-3 py-2",children:"No free Variational slots. Currently running on Delta Neutral."}),g&&oe&&i.jsx("div",{className:"text-[12px] text-[#FF797C] bg-[#3b2626] border border-[#ff797c]/30 rounded-md px-3 py-2",children:`Currently used for Delta Neutral in ${p.charAt(0).toUpperCase()+p.slice(1)} Farming (Slot-${V})`}),g&&Ee&&i.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4 px-4 sm:px-5",children:i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex items-center justify-between text-[13px] text-[#7C7C7C] font-semibold",children:[i.jsx("span",{className:"pl-[2px]",children:"Slot"}),i.jsxs("div",{className:"flex items-center gap-1",children:[i.jsx(s5,{className:"w-3 h-3 text-[#67FFBD] fill-[#67FFBD]"}),i.jsxs("span",{className:"text-[#67FFBD] font-medium",children:[I||0,"/",sr.length]})]})]}),i.jsx(Cl,{styles:fn,components:{Option:Pn,SingleValue:En},options:sr,value:sr.find(et=>et.value===un)||null,onChange:et=>Ft((et==null?void 0:et.value)??""),placeholder:"Select",isSearchable:!0})]})}),i.jsxs("div",{className:"py-1 space-y-3 px-3 sm:px-5",children:[i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[ae==="ON"?i.jsxs("div",{className:"col-span-1 space-y-4 border border-[#6f604d] hover:border-[#F8D4AB]/70 rounded-lg p-2.5",children:[i.jsx("div",{className:"flex items-center justify-between border-b border-[#353535] pb-2 mb-3",children:i.jsx("span",{className:"text-[13px] font-semibold text-[#F8D4AB]",children:"API - 1"})}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"flex items-center justify-between",children:i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"1st Variational Wallet Address"})}),i.jsx("div",{className:"relative",children:i.jsx("input",{value:ut,onChange:et=>qt(et.target.value),autoComplete:"off",placeholder:"1st Variational Wallet Address ",type:"text",className:`w-full h-8 px-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${ut===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:rr||Rr})})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"API Private Key"}),i.jsx("a",{href:"https://docs.dextrabot.com/farm/variational-omni-farming-module#getting-your-variational-token",target:"_blank",rel:"noopener noreferrer",className:"text-[11px] underline text-[#F8D4AB] hover:text-[#eee0d0]",children:"How to get API Private key?"})]}),i.jsxs("div",{className:"relative",children:[i.jsx("input",{value:Ne,onChange:et=>he(et.target.value),autoComplete:"off",placeholder:"API_PRIVATE_KEY",type:xn?"text":"password",className:`w-full h-8 pl-3 pr-16 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${Ne===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:rr||Rr}),i.jsx("button",{type:"button",onClick:()=>Mt(et=>!et),className:"absolute right-1 top-1/2 -translate-y-1/2 text-[11px] text-[#9B9B9B] hover:text-white h-6 flex justify-center items-center hover:border-none hover:ring-0 focus:outline-none focus:border-none bg-transparent",disabled:rr||Rr,children:xn?i.jsx(la,{size:14}):i.jsx(ca,{size:14})})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"API Key Index"}),i.jsx("div",{className:"relative",children:i.jsx("input",{value:ve,onChange:et=>{const yt=et.target.value.trim();if(yt==="")return je("");de(yt)&&je(yt)},onKeyDown:te,inputMode:"numeric",autoComplete:"off",placeholder:"API_KEY_INDEX",className:`w-full h-8 px-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${ve===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:rr||Rr})})]})]}):i.jsx(i.Fragment,{}),ae==="ON"&&i.jsxs("div",{className:"col-span-1 space-y-4 border border-[#6f604d] hover:border-[#F8D4AB]/70 rounded-lg p-2.5",children:[i.jsx("div",{className:"flex items-center justify-between border-b border-[#353535] pb-2 mb-3",children:i.jsx("span",{className:"text-[13px] font-semibold text-[#F8D4AB]",children:"API - 2"})}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"flex items-center justify-between",children:i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"2nd Variational Wallet Address"})}),i.jsx("div",{className:"relative",children:i.jsx("input",{value:It,onChange:et=>nn(et.target.value),autoComplete:"off",placeholder:"2nd Variational Wallet Address",type:"text",className:`w-full h-8 px-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${It===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:rr||Rr})})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"API Private Key 2"}),i.jsx("a",{href:"https://docs.dextrabot.com/farm/variational-omni-farming-module#getting-your-variational-token",target:"_blank",rel:"noopener noreferrer",className:"text-[11px] underline text-[#F8D4AB] hover:text-[#eee0d0]",children:"How to get API Private key?"})]}),i.jsxs("div",{className:"relative",children:[i.jsx("input",{value:ge,onChange:et=>ye(et.target.value),autoComplete:"off",placeholder:"API_PRIVATE_KEY_2",type:Xn?"text":"password",className:`w-full h-8 pl-3 pr-16 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${ge===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:rr||Rr}),i.jsx("button",{type:"button",onClick:()=>or(et=>!et),className:"absolute right-1 top-1/2 -translate-y-1/2 text-[11px] text-[#9B9B9B] hover:text-white h-6 flex justify-center items-center hover:border-none hover:ring-0 focus:outline-none focus:border-none bg-transparent",disabled:rr||Rr,children:Xn?i.jsx(la,{size:14}):i.jsx(ca,{size:14})})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"API Key Index 2"}),i.jsx("div",{className:"relative",children:i.jsx("input",{value:lt,onChange:et=>{const yt=et.target.value.trim();if(yt==="")return ft("");de(yt)&&ft(yt)},onKeyDown:te,inputMode:"numeric",autoComplete:"off",placeholder:"API_KEY_INDEX_2",className:`w-full h-8 px-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${lt===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:rr||Rr})})]})]})]}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[i.jsxs("div",{className:`${ae==="ON"?"hidden":""} space-y-2`,children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Variational Token"}),i.jsx("a",{href:"https://docs.dextrabot.com/farm/variational-omni-farming-module#getting-your-variational-token",target:"_blank",rel:"noopener noreferrer",className:"text-[11px] underline text-[#F8D4AB] hover:text-[#eee0d0]",children:"How to get Variational Token?"})]}),i.jsxs("div",{className:"relative",children:[i.jsx("input",{value:Ie,onChange:et=>{const yt=et.target.value;if(Le(yt),!yt.trim()){$e(null),tt("");return}const Tn=Bn(yt);if(Tn&&(Tn!=null&&Tn.exp)){const tr=new Date((Tn==null?void 0:Tn.exp)*1e3);$e(tr),tt("")}else Tn?($e(null),tt("The token's expiration date could not be found.")):($e(null),tt("Invalid token format."))},type:tn?"text":"password",autoComplete:"off",placeholder:"Variational_Token",className:`w-full h-8 pl-3 pr-16 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${Ie===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:rr||Rr}),Qe&&i.jsxs("div",{className:"text-[12px] mt-1 pl-[3px] flex justify-start items-center gap-2",children:[i.jsx("span",{className:"text-[10px] text-[#CECECE] font-medium",children:"Valid Until:"})," ",i.jsx("span",{className:"text-[11px] font-semibold "+(_?"text-[#FF797C]":"text-[#F8D4AB]"),children:Qe==null?void 0:Qe.toLocaleString("en-US",{dateStyle:"medium",timeStyle:"short"})}),_&&i.jsx("span",{children:i.jsx("img",{src:ec,alt:"",className:"w-3.5 h-3.5"})})]}),it&&i.jsx("div",{className:"text-[10px] text-[#FF797C] mt-[2px] pl-[3px]",children:it}),i.jsx("button",{type:"button",onClick:()=>In(et=>!et),className:"absolute right-1 top-4 -translate-y-1/2 text-[11px] text-[#9B9B9B] hover:text-white h-6 flex justify-center items-center hover:border-none hover:ring-0 focus:outline-none focus:border-none bg-transparent",disabled:rr||Rr,children:tn?i.jsx(la,{size:14}):i.jsx(ca,{size:14})})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Select Pair"}),i.jsx(Cl,{styles:fn,components:{Option:Sn,SingleValue:yr},isDisabled:rr||Rr,options:_r,value:_r.find(et=>et.value===jt)||null,onChange:et=>cn((et==null?void 0:et.value)??""),placeholder:"Select",isSearchable:!0})]}),i.jsxs("div",{className:`${ae==="ON"?"":"hidden"} space-y-2`,children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Trade Per Hour"}),i.jsx("input",{value:Ke,onChange:et=>{const yt=et.target.value.trim();if(yt==="")return Bt("");de(yt)&&Bt(yt)},onKeyDown:te,inputMode:"numeric",autoComplete:"off",placeholder:"e.g. 10 (max 180)",className:`w-full h-8 px-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${Ke===""?"border-[#353535]":xe?"border-[#353535] focus:border-[#67FFBD]":"border-[#FF797C]"}`,disabled:rr||Rr}),Ke!==""&&!xe&&i.jsx("div",{className:"text-[#FF797C] text-[12px]",children:"Enter an integer between 1 and 120."})]})]}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[i.jsxs("div",{className:`${ae==="ON"?"hidden":""} space-y-1`,children:[i.jsxs("div",{className:"flex justify-start items-center gap-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Trade Per"}),i.jsxs("select",{value:on,onChange:et=>gn(et.target.value),className:`${rr||Rr?"cursor-not-allowed":"cursor-pointer"} h-6 text-[12px] bg-[#242424] border border-[#353535] rounded-md px-2 text-white outline-none font-bold font-manrope`,disabled:rr||Rr,children:[i.jsx("option",{value:"Hour",children:"Hour"}),i.jsx("option",{value:"Day",children:"Day"})]})]}),i.jsx("input",{value:Ke,onChange:et=>{const yt=et.target.value.trim();if(yt==="")return Bt("");de(yt)&&Bt(yt)},onKeyDown:te,inputMode:"numeric",autoComplete:"off",placeholder:"e.g. 10 (max 120)",className:`w-full h-8 px-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${Ke===""?"border-[#353535]":xe?"border-[#353535] focus:border-[#67FFBD]":"border-[#FF797C]"}`,disabled:rr||Rr}),Ke!==""&&!xe&&i.jsx("div",{className:"text-[#FF797C] text-[12px]",children:"Enter an integer between 1 and 120."})]}),i.jsxs("div",{className:`${ae==="ON"?"":"hidden"} space-y-2`,children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Delta Neutral"}),i.jsxs("div",{className:"flex justify-between w-full items-center gap-2 border border-[#353535] bg-[#242424] p-1 rounded-md px-2 h-8",children:[i.jsx("span",{className:"text-white font-inter text-[13px] font-medium leading-[8px] tracking-[-0.26px]",children:ae==="ON"?"On":"Off"}),i.jsx(Eo,{checked:ae==="ON",onChange:et=>fe(et?"ON":"OFF"),disabled:rr||Rr,className:`${ae==="ON"?"bg-[#1DE674]":"bg-white/10"} relative inline-flex h-5 w-9 items-center rounded-full p-1 transition-colors duration-200 ease-in-out ${rr||Rr?"opacity-50 cursor-not-allowed":"cursor-pointer"}`,children:i.jsx("span",{"aria-hidden":"true",className:`inline-block h-4 w-4 transform rounded-full bg-white shadow-lg transition duration-200 ease-in-out ${ae==="ON"?"translate-x-3":"translate-x-0"}`})})]})]}),i.jsxs("div",{className:" space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Leverage"}),i.jsx("input",{value:$t,onChange:et=>{const yt=et.target.value.trim();if(yt==="")return qe("");de(yt)&&qe(yt)},onKeyDown:te,inputMode:"numeric",autoComplete:"off",placeholder:jt?`1–${Jr}x`:"e.g. 3",className:`w-full h-8 px-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${$t===""?"border-[#353535]":Se?"border-[#353535] focus:border-[#67FFBD]":"border-[#FF797C]"}`,disabled:rr||Rr})]})]}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[i.jsxs("div",{className:`${oe?"hidden":""} space-y-2`,children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Direction"}),i.jsxs("div",{className:"flex items-center gap-2 md:pr-6",children:[i.jsx("div",{"aria-pressed":Ye==="LONG",onClick:()=>!Rr&&ht("LONG"),className:["inline-flex justify-center items-center gap-1.5 h-6 rounded-[8px] uppercase tracking-wide font-semibold transition-all border w-1/2","text-[8.5px] px-1",rr||Rr?"cursor-not-allowed":"cursor-pointer",Ye==="LONG"?"bg-[#67FFBD] text-black border-[#67FFBD] shadow-[0_0_0_3px_rgba(103,255,189,0.25)]":"text-[#67FFBD] bg-[#67FFBD]/15 border-[#2A2A2A] hover:bg-[#67FFBD]/25"].join(" "),children:i.jsxs("span",{className:"min-w-max",children:["LONG",$t?` - ${$t}x`:""]})}),i.jsx("div",{"aria-pressed":Ye==="SHORT",onClick:()=>!Rr&&ht("SHORT"),className:["inline-flex justify-center items-center gap-1.5 h-6 rounded-[8px] uppercase tracking-wide font-semibold transition-all border w-1/2","text-[8.5px] px-1",rr||Rr?"cursor-not-allowed":"cursor-pointer",Ye==="SHORT"?"bg-[#FF797C] text-black border-[#FF797C] shadow-[0_0_0_3px_rgba(255,121,124,0.25)]":"text-[#FF787B] bg-[#FF797C]/20 border-[#2A2A2A] hover:bg-[#FF797C]/30"].join(" "),children:i.jsxs("span",{className:"min-w-max",children:["SHORT",$t?` - ${$t}x`:""]})}),i.jsx("div",{"aria-pressed":Ye==="RANDOM",onClick:()=>!Rr&&ht("RANDOM"),className:["inline-flex justify-center items-center gap-1.5 h-6 rounded-[8px] uppercase tracking-wide font-semibold transition-all border w-1/2","text-[8.5px] px-1",rr||Rr?"cursor-not-allowed":"cursor-pointer",Ye==="RANDOM"?"bg-[#3b82f6] text-[#ffffff] border-[#93c5fd] shadow-[0_0_0_3px_rgba(59,130,246,0.3)]":"text-[#3b82f6] bg-[rgba(59,130,246,0.15)] border-[rgba(59,130,246,0.15)] hover:bg-[#2563eb] hover:text-white"].join(" "),children:i.jsxs("span",{className:"min-w-max",children:["RANDOM",$t?` - ${$t}x`:""]})})]})]}),i.jsxs("div",{className:`${oe?"hidden":""} space-y-2`,children:[i.jsx("div",{className:"flex items-center gap-2 text-[13px] text-[#7C7C7C] font-semibold",children:i.jsx("span",{children:"Order Type"})}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("button",{"aria-pressed":Ue==="MARKET",onClick:()=>!Rr&&Rt("MARKET"),className:["inline-flex justify-center items-center gap-1.5 h-6 px-2 rounded-[8px] uppercase tracking-wide text-[8.5px] font-semibold transition-all border w-1/2 min-w-max",rr||Rr?"cursor-not-allowed":"cursor-pointer",Ue==="MARKET"?"bg-[#8e643a] text-white border-[#44382C]":"text-[#7C7C7C] bg-transparent border-[#404040] hover:bg-[#404040]/25 hover:text-white"].join(" "),children:i.jsxs("span",{children:["MARKET ",Ue==="MARKET"?" ✓":""]})}),i.jsxs("button",{"aria-pressed":Ue==="LIMIT",className:["inline-flex flex-col justify-center items-center h-6 px-1 rounded-[8px] uppercase tracking-wide text-[8.5px] font-semibold transition-all border w-1/2","cursor-not-allowed",Ue==="LIMIT"?"bg-[#8e643a] text-white border-[#44382C]":"text-[#7C7C7C] bg-transparent border-[#404040] hover:bg-[#404040]/25 hover:text-white"].join(" "),children:[i.jsxs("span",{children:["LIMIT ",Ue==="LIMIT"?" ✓":""]}),i.jsx("span",{className:"min-w-max text-[6px] -mt-[1px] text-[#FF9A3C]",children:"Coming Soon"})]}),i.jsxs("button",{"aria-pressed":Ue==="RANDOM",className:["inline-flex flex-col justify-center items-center h-6 px-1 rounded-[8px] uppercase tracking-wide text-[8.5px] font-semibold transition-all border w-1/2","cursor-not-allowed",Ue==="RANDOM"?"bg-[#8e643a] text-white border-[#44382C]":"text-[#7C7C7C] bg-transparent border-[#404040] hover:bg-[#404040]/25 hover:text-white"].join(" "),children:[i.jsxs("span",{children:["RANDOM ",Ue==="RANDOM"?" ✓":""]}),i.jsx("span",{className:"min-w-max text-[6px] -mt-[1px] text-[#FF9A3C]",children:"Coming Soon"})]})]})]})]}),!1,i.jsxs("div",{className:`${oe?"hidden":""} grid grid-cols-1 md:grid-cols-2 gap-4`,children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Take Profit %"}),i.jsxs("div",{className:"relative",children:[i.jsx("span",{className:"absolute left-2 top-1/2 -translate-y-1/2 text-[#7F7F7F] font-semibold",children:"%"}),i.jsx("input",{value:We,onChange:et=>{const yt=et.target.value.trim();if(yt==="")return at("");ue(yt)&&at(yt)},onKeyDown:te,inputMode:"decimal",autoComplete:"off",placeholder:"e.g. 5",className:`w-full h-8 pl-7 pr-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${We===""?"border-[#353535]":ke?"border-[#353535] focus:border-[#67FFBD]":"border-[#FF797C]"}`,disabled:rr||Rr})]}),We!==""&&!ke&&i.jsx("div",{className:"text-[#FF797C] text-[11px]",children:"Value must be 0, or between 1 and 10000000. Numbers between 0 and 1 are not allowed."})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Stop Loss %"}),i.jsxs("div",{className:"relative",children:[i.jsx("span",{className:"absolute left-2 top-1/2 -translate-y-1/2 text-[#7F7F7F] font-semibold",children:"%"}),i.jsx("input",{value:mt,onChange:et=>{const yt=et.target.value.trim();if(yt==="")return Dt("");ue(yt)&&Dt(yt)},onKeyDown:te,inputMode:"decimal",autoComplete:"off",placeholder:"e.g. 5",className:`w-full h-8 pl-7 pr-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${mt===""?"border-[#353535]":Re?"border-[#353535] focus:border-[#67FFBD]":"border-[#FF797C]"}`,disabled:rr||Rr})]}),mt!==""&&!Re&&i.jsxs("div",{className:"text-[#FF797C] text-[11px]",children:["Value must be 0, or between 1 and"," ",$t?Math.max($t*100-1,0):4999,". Numbers between 0 and 1 are not allowed."]})]})]})]}),i.jsx("div",{className:`${ae==="ON"?"py-3":"py-6"} flex items-center gap-3 px-5 border-t border-[#353535] bg-[rgba(27,27,27,0.32)] rounded-b-3xl`,children:i.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[i.jsx("button",{onClick:()=>!rr&&t(!1),className:"inline-flex items-center justify-center h-8 px-5 rounded-[10px] border bg-black/5 border-[#353535] text-white text-[13px] hover:border-white disabled:opacity-60",disabled:rr,children:"Cancel"}),g?ae==="ON"?w?i.jsx("button",{onClick:stopLighterFarming,disabled:rr,className:"inline-flex items-center justify-center h-8 px-6 rounded-[10px] text-[13px] border border-[#353535] hover:border-[#FF797C] text-[#FF797C] bg-[rgba(27,27,27,0.32)] disabled:opacity-60",children:Kn?"Stopping...":"Stop"}):i.jsx("button",{onClick:saveLighterFarming,disabled:!Fe||rr,className:`inline-flex items-center justify-center h-8 px-6 rounded-[10px] text-[13px] border ${!Fe||rr?"bg-[#2a2a2a] border-[#3a3a3a] opacity-60 cursor-not-allowed":"bg-[#7446FF] border-[#8861FF] hover:bg-[#5834C3]"}`,children:Gn?"Starting...":"Start"}):w?i.jsx("button",{onClick:Ut,disabled:rr,className:"inline-flex items-center justify-center h-8 px-6 rounded-[10px] text-[13px] border border-[#353535] hover:border-[#FF797C] text-[#FF797C] bg-[rgba(27,27,27,0.32)] disabled:opacity-60",children:Kn?"Stopping...":"Stop"}):i.jsx("button",{onClick:kt,disabled:!Ge||rr,className:`inline-flex items-center justify-center h-8 px-6 rounded-[10px] text-[13px] border ${!Ge||rr?"bg-[#2a2a2a] border-[#3a3a3a] opacity-60 cursor-not-allowed":"bg-[#7446FF] border-[#8861FF] hover:bg-[#5834C3]"}`,children:Gn?"Starting...":"Start"}):i.jsx("button",{onClick:()=>n(!0),className:"inline-flex items-center justify-center h-8 px-6 rounded-[10px] text-[13px] border bg-[#67FFBD] border-[#67FFBD] text-black hover:opacity-90",children:"Connect"})]})}),yn&&i.jsx("div",{className:"absolute inset-0 rounded-3xl bg-black/40 flex items-center justify-center text-sm",children:"Loading..."})]})]})]})]})]})},w$=({open:e=!1,setOpen:t=()=>{}})=>{var ii,Pr,vn,Mn;const{setSignModalOpen:n,setTelegramChatId:r,setSubscriberRole:s,setSubsExpireDay:a,setMushboomerETH:o,setMushboomerSOL:l,setIsReferralCode:c,setIsReferralCodeName:u,setIsWhitelist:d,setHyperToken:f,setHyperAddress:x}=m.useContext(Qr),{address:g}=ns(),[v,w]=m.useState(!1),[C,N]=m.useState(!1),[P,I]=m.useState(1),[R,F]=m.useState(0),[U,L]=m.useState(0),[z,Q]=m.useState(0),[ne,J]=m.useState(0),[X,re]=m.useState({}),[pe,Y]=m.useState(null),[ie,oe]=m.useState("variational"),[G,V]=m.useState(!1),ee=m.useRef(null),[ae,fe]=m.useState(!1),[Ne,he]=m.useState("Extended-1"),[ge,ye]=m.useState("ON"),[ve,je]=m.useState(""),[Ie,Le]=m.useState(""),[Qe,$e]=m.useState(""),[it,tt]=m.useState(""),[lt,ft]=m.useState(""),[ut,qt]=m.useState(""),[It,nn]=m.useState(""),[jt,cn]=m.useState(""),[un,Ft]=m.useState([]),[Ke,Bt]=m.useState(""),[$t,qe]=m.useState(""),[Ye,ht]=m.useState("LONG"),[Zt,zt]=m.useState("STANDARD"),[Et,nt]=m.useState("STANDARD"),[Ue,Rt]=m.useState("LIMIT"),[We,at]=m.useState("LIMIT"),[mt,Dt]=m.useState("MARKET"),[Tt,dn]=m.useState(""),[on,gn]=m.useState(""),[Nn,kn]=m.useState(""),[yn,Vn]=m.useState(!1),[Gn,Dn]=m.useState(!1),[Kn,Cn]=m.useState(!1),[sn,Me]=m.useState(!1),[en,an]=m.useState(""),[Nt,Yn]=m.useState(""),[xn,Mt]=m.useState(!0),[tn,In]=m.useState(!1),[Xn,or]=m.useState(!1),[lr,Qt]=m.useState(!1),[zn,Jn]=m.useState(!1),[Lt,jn]=m.useState(!1),[Ee,h]=m.useState(!1),[p,S]=m.useState(!1),[_,k]=m.useState(""),[T,B]=m.useState(!0),[q,te]=m.useState(""),[ue,de]=m.useState(null),[xe,Se]=m.useState(""),[ke,Re]=m.useState(!1),Ge=ue?(ue==null?void 0:ue.getTime())<=Date.now():!1,[Fe,st]=m.useState("Hour"),[se,Ce]=m.useState([]),[Be,De]=m.useState(""),[_e,Je]=m.useState(!1),[ct,gt]=m.useState(!1);m.useState(1);const Xt="https://dextrabothypev2.nftinit.io",wt="",Xe=m.useMemo(()=>[{value:"BTC",label:"BTC",icon:"https://app.hyperliquid.xyz/coins/BTC.svg",maxLeverage:50},{value:"ETH",label:"ETH",icon:"https://app.hyperliquid.xyz/coins/ETH.svg",maxLeverage:50},{value:"SOL",label:"SOL",icon:"https://app.hyperliquid.xyz/coins/SOL.svg",maxLeverage:50},{value:"HYPE",label:"HYPE",icon:"https://app.hyperliquid.xyz/coins/HYPE.svg",maxLeverage:50},{value:"ZEC",label:"ZEC",icon:"https://app.hyperliquid.xyz/coins/ZEC.svg",maxLeverage:10},{value:"BNB",label:"BNB",icon:"https://app.hyperliquid.xyz/coins/BNB.svg",maxLeverage:20},{value:"RESOLV",label:"RESOLV",icon:"https://app.hyperliquid.xyz/coins/RESOLV.svg",maxLeverage:5},{value:"XPL",label:"XPL",icon:"https://app.hyperliquid.xyz/coins/XPL.svg",maxLeverage:20},{value:"GOAT",label:"GOAT",icon:"https://app.hyperliquid.xyz/coins/GOAT.svg",maxLeverage:10},{value:"PUMP",label:"PUMP",icon:"https://app.hyperliquid.xyz/coins/PUMP.svg",maxLeverage:25},{value:"ASTER",label:"ASTER",icon:"https://static.astherus.finance/image/admin_mgs_image_upload/20250916/6dba1412-ddfb-4314-bfdf-87fa11f2daa6.png",maxLeverage:10}],[]),Oe=m.useMemo(()=>[{value:"BTC",label:"BTC",icon:"https://app.hyperliquid.xyz/coins/BTC.svg",maxLeverage:50},{value:"ETH",label:"ETH",icon:"https://app.hyperliquid.xyz/coins/ETH.svg",maxLeverage:50},{value:"SOL",label:"SOL",icon:"https://app.hyperliquid.xyz/coins/SOL.svg",maxLeverage:50},{value:"HYPE",label:"HYPE",icon:"https://app.hyperliquid.xyz/coins/HYPE.svg",maxLeverage:50},{value:"XMR",label:"XMR",icon:"https://cdn.extended.exchange/crypto/XMR.svg",maxLeverage:25},{value:"XRP",label:"XRP",icon:"https://app.hyperliquid.xyz/coins/XRP.svg",maxLeverage:50},{value:"PUMP",label:"PUMP",icon:"https://app.hyperliquid.xyz/coins/PUMP.svg",maxLeverage:50},{value:"BNB",label:"BNB",icon:"https://app.hyperliquid.xyz/coins/BNB.svg",maxLeverage:25},{value:"ZEC",label:"ZEC",icon:"https://app.hyperliquid.xyz/coins/ZEC.svg",maxLeverage:10},{value:"LTC",label:"LTC",icon:"https://app.hyperliquid.xyz/coins/LTC.svg",maxLeverage:25},{value:"IP",label:"IP",icon:"https://app.hyperliquid.xyz/coins/IP.svg",maxLeverage:10},{value:"SUI",label:"SUI",icon:"https://app.hyperliquid.xyz/coins/SUI.svg",maxLeverage:50},{value:"AAVE",label:"AAVE",icon:"https://app.hyperliquid.xyz/coins/AAVE.svg",maxLeverage:50},{value:"FARTCOIN",label:"FARTCOIN",icon:"https://app.hyperliquid.xyz/coins/FARTCOIN.svg",maxLeverage:25},{value:"BERA",label:"BERA",icon:"https://app.hyperliquid.xyz/coins/BERA.svg",maxLeverage:10},{value:"ASTER",label:"ASTER",icon:"https://app.hyperliquid.xyz/coins/ASTER.svg",maxLeverage:25},{value:"ENA",label:"ENA",icon:"https://app.hyperliquid.xyz/coins/ENA.svg",maxLeverage:50},{value:"ADA",label:"ADA",icon:"https://app.hyperliquid.xyz/coins/ADA.svg",maxLeverage:50},{value:"TIA",label:"TIA",icon:"https://app.hyperliquid.xyz/coins/TIA.svg",maxLeverage:25},{value:"LINK",label:"LINK",icon:"https://app.hyperliquid.xyz/coins/LINK.svg",maxLeverage:25}],[]),bt={kBONK:"BONK",kPEPE:"PEPE",kSHIB:"SHIB",kFLOKI:"FLOKI"};m.useEffect(()=>{async function ot(){if(e)try{const er=await(await fetch("https://dextrabothypev2.nftinit.io/api/hyper/get_farming_coins/?app=extended")).json();if(er!=null&&er.coins){let Wn=er.coins.map(Fr=>{const kr=(Fr==null?void 0:Fr.label)||"",ts=bt[kr]||kr,Ms=ts==="XMR"?"https://app.lighter.xyz/assets/xmr-CV8khZ54.png":ts==="NMR"?"https://app.lighter.xyz/assets/nmr-2YIHMk6g.png":ts==="USELESS"?"https://app.lighter.xyz/assets/useless-BTmgr78l.png":ts==="DOLO"?"https://app.lighter.xyz/assets/dolo-DuOVl-Vo.png":ts==="CRO"?"https://app.lighter.xyz/assets/cro-C7lstwu3.png":ts==="FF"?"https://app.lighter.xyz/assets/ff-CvnDhHny.png":ts==="4"||ts=="EUR"||ts=="EDEN"||ts=="XAU"?"":`https://app.hyperliquid.xyz/coins/${ts}.svg`;return{...Fr,icon:Ms}});Ft(Wn)}}catch(Vt){console.error("Failed to fetch coin list:",Vt)}}ot()},[e]);async function kt(){try{Je(!0);const ot=window.localStorage.getItem("hyperToken"),Vt=window.localStorage.getItem("hyperAddress");if(!ot||!Vt){n(!0);return}const er=`${Xt}/api/wallet/list-extended`,Fr=await(await fetch(`${er}`,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:Vt.toLowerCase(),token:ot})})).json();Fr!=null&&Fr.success?Ce((Fr==null?void 0:Fr.data)||[]):an((Fr==null?void 0:Fr.error_message)||"Failed to load wallets.")}catch(ot){an(ot.message||"Wallet list error.")}finally{Je(!1)}}const Ut=ot=>{var Vt;return((Vt=(ge==="ON"?Oe:Xe).find(er=>er.value===ot))==null?void 0:Vt.maxLeverage)??100},fn=ot=>{["e","E","+","-"].includes(ot.key)&&ot.preventDefault()},On=ot=>/^\d*\.?\d{0,6}$/.test(ot),Sn=ot=>/^\d*$/.test(ot),yr=m.useMemo(()=>{if(Ke==="")return!1;const ot=Number(Ke);return Number.isInteger(ot)&&ot>=1&&ot<=120},[Ke]),Pn=m.useMemo(()=>{if($t==="")return!1;const ot=Number($t),Vt=Ut(jt);return Number.isInteger(ot)&&ot>=1&&ot<=Vt},[$t,jt]),En=m.useMemo(()=>{if(Tt==="")return!1;const ot=Number(Tt);return Number.isNaN(ot)?!1:ot===0?!0:ot>=1&&ot<=1e7},[Tt]),$n=m.useMemo(()=>{if(on==="")return!1;const ot=Number(on);if(Number.isNaN(ot))return!1;const Vt=$t===""?null:Number($t),er=Vt?Vt*100-1:4999;return ot===0?!0:ot>0&&ot<1?!1:ot>=1&&ot<=er},[on,$t]);m.useMemo(()=>{if(Nn==="")return!1;const ot=Number(Nn);return!Number.isNaN(ot)&&ot>0&&ot<=100},[Nn]);const Bn=ge=="ON"?Oe:Xe,_r=m.useMemo(()=>jt?Bn.some(ot=>ot.value===jt):!1,[jt,Bn]),sr=v&&ve.trim()!==""&&ut.trim()!==""&&Qe.trim()!==""&&it.trim()!==""&&jt!==""&&yr&&Pn&&Ne&&(!Tt||En)&&(!on||$n)&&(Ye==="LONG"||Ye==="SHORT"||Ye==="RANDOM")&&(Ue==="LIMIT"||Ue==="MARKET"||Ue==="RANDOM")&&T,rr=v&&Be&&Ne&&jt!==""&&_r&&yr&&Pn&&(ie!=="variational"||q.trim()!=="")&&(ie!=="variational"||!xe)&&(ie!=="variational"||!Ge)&&T,Rr=()=>(localStorage.getItem("hyperAddress")||"dextra").toLowerCase(),Jr=()=>`extendedCreds:${Rr()}`,ws=()=>{try{const ot=localStorage.getItem(Jr());if(!ot)return;const Vt=JSON.parse(ot);Vt.apiKey&&je(Vt.apiKey),Vt.apiPrivateKey&&$e(Vt.apiPrivateKey),Vt.vaultNumber&&tt(Vt.vaultNumber),Vt.apiPublicKey&&qt(Vt.apiPublicKey),typeof Vt.remember=="boolean"&&Mt(Vt.remember)}catch{}},ls=()=>{if(xn)try{localStorage.setItem(Jr(),JSON.stringify({apiKey:ve,apiPrivateKey:Qe,apiPublicKey:ut,vaultNumber:it,remember:!0}))}catch{}},et=()=>{try{localStorage.removeItem(Jr())}catch{}};m.useEffect(()=>{if(!e)return;const ot=localStorage.getItem("hyperToken"),Vt=localStorage.getItem("hyperAddress");w(!!(ot&&Vt));const er=setInterval(()=>{const Wn=localStorage.getItem("hyperToken"),Fr=localStorage.getItem("hyperAddress");w(!!(Wn&&Fr))},800);return()=>clearInterval(er)},[e]),m.useEffect(()=>{!e||!v||(yt(),kt(),fr())},[e,v]),m.useEffect(()=>{e&&(on===""&&gn(wt),Tt===""&&dn(wt),Nn===""&&kn(wt))},[e]),m.useEffect(()=>{if(!jt)return;const ot=Ut(jt),Vt=Number($t);!Number.isNaN(Vt)&&Vt>ot&&qe(String(ot)),!Number.isNaN(Vt)&&Vt<1&&$t!==""&&qe("1")},[jt]),m.useEffect(()=>{e&&(xn&&ls(),xn||et())},[ve,Qe,it,ut,xn,e]);async function yt(){var ot,Vt,er,Wn,Fr,kr,ts,Ms,At,ir,Hn,Hr,os,is,ms,gs;try{Dn(!0),an("");const $i=window.localStorage.getItem("hyperToken"),Bs=window.localStorage.getItem("hyperAddress");if(!$i||!Bs){N(!1),ws();return}const Tr=await(await fetch(`${Xt}/api/test_app/new_farming_app/info/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({address:Bs.toLowerCase(),token:$i})})).json();if(!(Tr!=null&&Tr.success)){if(console.warn("INFO API RESPONSE:",Tr==null?void 0:Tr.error_message),(Tr==null?void 0:Tr.error_message)==="You have not a running process"){const ga=Ne?Ne.toLowerCase().replace("-","_"):null,El=X==null?void 0:X[ga];if(ga&&El){const _l={...X,[ga]:{...El,isStop:!0}};re(_l);const ba=Object.keys(_l).filter(kl=>kl.startsWith("extended"));if(ba.length>0&&!Ne){const $u=ba.sort((gi,yd)=>{var E,O;const dt=parseInt(((E=gi.match(/\d+/))==null?void 0:E[0])||0,10),y=parseInt(((O=yd.match(/\d+/))==null?void 0:O[0])||0,10);return dt-y})[0].match(/\d+/);$u&&he(`Extended-${$u[0]}`)}}else he("Extended-1")}Tr!=null&&Tr.slots_info&&(L((Vt=(ot=Tr==null?void 0:Tr.slots_info)==null?void 0:ot.extended)==null?void 0:Vt.total_qty),F((Wn=(er=Tr==null?void 0:Tr.slots_info)==null?void 0:er.extended)==null?void 0:Wn.active_qty),J((kr=(Fr=Tr==null?void 0:Tr.slots_info)==null?void 0:Fr.variational)==null?void 0:kr.total_qty),Q((Ms=(ts=Tr==null?void 0:Tr.slots_info)==null?void 0:ts.variational)==null?void 0:Ms.active_qty));return}if(Tr!=null&&Tr.success&&(Tr!=null&&Tr.data)){const ga=Ne?Ne.toLowerCase().replace("-","_"):null,El=X==null?void 0:X[ga],_l=Tr.data||{};ga&&!_l[ga]&&El&&(_l[ga]={...El,isStop:!0}),re(_l);const ba=Object.keys(_l).filter(kl=>kl.startsWith("extended"));if(ba.length>0&&!Ne){const $u=ba.sort((gi,yd)=>{var E,O;const dt=parseInt(((E=gi.match(/\d+/))==null?void 0:E[0])||0,10),y=parseInt(((O=yd.match(/\d+/))==null?void 0:O[0])||0,10);return dt-y})[0].match(/\d+/);$u&&he(`Extended-${$u[0]}`)}Tr!=null&&Tr.slots_info&&(L((ir=(At=Tr==null?void 0:Tr.slots_info)==null?void 0:At.extended)==null?void 0:ir.total_qty),F((Hr=(Hn=Tr==null?void 0:Tr.slots_info)==null?void 0:Hn.extended)==null?void 0:Hr.active_qty),J((is=(os=Tr==null?void 0:Tr.slots_info)==null?void 0:os.variational)==null?void 0:is.total_qty),Q((gs=(ms=Tr==null?void 0:Tr.slots_info)==null?void 0:ms.variational)==null?void 0:gs.active_qty))}}catch{N(!1),ws(),ye("ON")}finally{Dn(!1)}}const Tn=m.useMemo(()=>Ne?Ne.toLowerCase().replace("-","_"):"",[Ne]),tr=!!((ii=X==null?void 0:X[Tn])!=null&&ii.delta)&&!!((Pr=X==null?void 0:X[Tn])!=null&&Pr.from_slot),Ar=tr?`extended_${(vn=X==null?void 0:X[Tn])==null?void 0:vn.from_slot}`:Tn;m.useEffect(()=>{var er,Wn,Fr,kr,ts,Ms,At,ir,Hn,Hr,os,is,ms,gs,$i,Bs,bs;if(!Ne||!X)return;const ot=Ar,Vt=X==null?void 0:X[ot];if(!Vt){je(""),$e(""),qt(""),ft(""),tt(""),cn(""),Bt(""),qe(""),ht("LONG"),Rt("LIMIT"),N(!1),ye("ON"),st("Hour"),dn(""),gn(""),te(""),at("LIMIT"),Dt("MARKET"),oe("variational"),de(null);return}if((Vt==null?void 0:Vt.target_params)==null&&Vt.source_params){Vt!=null&&Vt.isStop?N(!1):N(!0),ye("OFF");const Tr=Vt.source_params,ga=(Vt==null?void 0:Vt.slot_number)??"";ga&&!tr&&he(`Extended-${ga}`),Tr!=null&&Tr.cycleSeconds&&st((Tr==null?void 0:Tr.cycleSeconds)===86400?"Day":"Hour");const El=(Tr==null?void 0:Tr.extendedapikey)??"",_l=(Tr==null?void 0:Tr.x10privatekey)??"",Bu=(Tr==null?void 0:Tr.x10publickey)??"",ba=(Tr==null?void 0:Tr.x10vault)??"";if(El&&je(String(El)),_l&&$e(String(_l)),Bu&&qt(String(Bu)),ba&&tt(String(ba)),Tr!=null&&Tr.coin){const kl=String(Tr.coin).replace(/-USD$/,"");cn(kl)}(Tr==null?void 0:Tr.orderPerHour)!=null&&Bt(String(Tr.orderPerHour)),(Tr==null?void 0:Tr.leverage)!=null&&qe(String(Tr.leverage)),Tr!=null&&Tr.direction&&ht(String(Tr.direction).toUpperCase()==="SHORT"?"SHORT":String(Tr.direction).toUpperCase()==="RANDOM"?"RANDOM":"LONG"),Tr!=null&&Tr.orderType&&Rt(String(Tr.orderType).toUpperCase()==="MARKET"?"MARKET":String(Tr.orderType).toUpperCase()==="LIMIT"?"LIMIT":"RANDOM"),(Tr==null?void 0:Tr.tp)!=null&&dn(String(Tr.tp)),(Tr==null?void 0:Tr.sl)!=null&&gn(String(Tr.sl))}else if((Vt==null?void 0:Vt.target_params)!==null){Vt!=null&&Vt.isStop?N(!1):N(!0),ye("ON");const Tr=(Vt==null?void 0:Vt.slot_number)??"";Tr&&!tr&&he(`Extended-${Tr}`);const ga=Vt.source_params,El=(ga==null?void 0:ga.extendedapikey)??"",_l=(ga==null?void 0:ga.x10privatekey)??"",Bu=(ga==null?void 0:ga.x10publickey)??"",ba=(ga==null?void 0:ga.x10vault)??"";if(El&&je(String(El)),_l&&$e(String(_l)),Bu&&qt(String(Bu)),ba&&tt(String(ba)),(er=Vt==null?void 0:Vt.source_params)!=null&&er.wallet_id&&De(String((Wn=Vt==null?void 0:Vt.source_params)==null?void 0:Wn.wallet_id)),(Fr=Vt==null?void 0:Vt.source_params)!=null&&Fr.coin){const kl=String((kr=Vt==null?void 0:Vt.source_params)==null?void 0:kr.coin).replace(/-USD$/,"");cn(kl)}((ts=Vt==null?void 0:Vt.source_params)==null?void 0:ts.orderPerHour)!=null&&Bt(String((Ms=Vt==null?void 0:Vt.source_params)==null?void 0:Ms.orderPerHour)),((At=Vt==null?void 0:Vt.source_params)==null?void 0:At.leverage)!=null&&qe(String((ir=Vt==null?void 0:Vt.source_params)==null?void 0:ir.leverage)),(Hn=Vt==null?void 0:Vt.source_params)!=null&&Hn.accountType&&zt(((Hr=Vt==null?void 0:Vt.source_params)==null?void 0:Hr.accountType)==="standart"?"STANDARD":"PREMIUM"),(os=Vt==null?void 0:Vt.target_params)!=null&&os.accountType&&nt(((is=Vt==null?void 0:Vt.target_params)==null?void 0:is.accountType)==="standart"?"STANDARD":"PREMIUM"),Vt!=null&&Vt.target_app&&oe(((Vt==null?void 0:Vt.target_app)==="variational","variational")),(ms=Vt==null?void 0:Vt.target_params)!=null&&ms.vr_token&&te((gs=Vt==null?void 0:Vt.target_params)==null?void 0:gs.vr_token),($i=Vt==null?void 0:Vt.source_params)!=null&&$i.source_orderType&&at(String((Bs=Vt==null?void 0:Vt.source_params)==null?void 0:Bs.source_orderType).toUpperCase()==="MARKET"?"MARKET":String((bs=Vt==null?void 0:Vt.source_params)==null?void 0:bs.source_orderType).toUpperCase()==="LIMIT"?"LIMIT":"HYBRID")}else N(!1),ye("OFF")},[Ne,X,tr,Ar]);const Br=ot=>{var Vt;return Number(((Vt=String(ot||"").match(/\d+/))==null?void 0:Vt[0])||0)},Vr=ot=>(ot||"").toLowerCase().replace("-","_"),dr=m.useMemo(()=>{const ot=X==null?void 0:X[Vr(Ne)];if(ot!=null&&ot.delta&&(ot!=null&&ot.from_slot))return Number(ot.from_slot);const Vt=Number(ot==null?void 0:ot.slot_number);return Number.isFinite(Vt)?Vt:Br(Ne)},[Ne,X]),jr=m.useMemo(()=>{const ot=Number(P)||0,Vt=Array.from({length:ot},()=>({used:!1,kind:null})),er=X||{};for(const[Wn,Fr]of Object.entries(er)){if(!Wn.startsWith("extended"))continue;const kr=Br(Wn)-1;kr<0||kr>=ot||((Fr==null?void 0:Fr.isStop)===!0?Vt[kr]={used:!1,kind:null}:Fr!=null&&Fr.source_params?Vt[kr]={used:!0,kind:"delta-src"}:Fr!=null&&Fr.target_params||Fr!=null&&Fr.delta?Vt[kr]={used:!0,kind:"delta-shadow"}:Fr!=null&&Fr.farming_params?Vt[kr]={used:!0,kind:"single"}:Vt[kr]={used:!0,kind:"unknown"})}return Vt},[X,P]),ps=m.useMemo(()=>jr.map((ot,Vt)=>ot.used&&ot.kind!=="delta-src-inferred"?`Extended-${Vt+1}`:null).filter(Boolean),[jr]);m.useMemo(()=>jr.filter(ot=>!ot.used).length,[jr]);async function gr(){var Vt;const ot=Br(Ne)-1;if(ot<0){an("Please select a slot."),Cn(!1);return}if((Vt=jr[ot])!=null&&Vt.used){an("Selected slot is already in use."),Cn(!1);return}if(!v){n(!0);return}if(ge==="OFF"){if(!sr)return}else if(!rr)return;try{Cn(!0),an("");const er=window.localStorage.getItem("hyperToken"),Wn=window.localStorage.getItem("hyperAddress");if(!er||!Wn){n(!0);return}const Fr={coin:`${jt}-USD`,leverage:Number($t),orderPerHour:Number(Ke),...ge==="ON"?{source_orderType:We,wallet_id:Be}:{extendedapikey:ve,x10publickey:ut,x10privatekey:Qe,x10vault:it,orderType:Ue,cycleSeconds:Fe==="Hour"?3600:86400,tp:Number(Tt),sl:Number(on),direction:Ye}},kr={...ie==="variational"&&{vr_token:q},coin:`${jt}`,orderPerHour:Number(Ke),leverage:Number($t),target_orderType:mt},ts={address:Wn.toLowerCase(),token:er,slot_number:Number(Ne==null?void 0:Ne.replace("Extended-","")),source_app:"extended",source_params:Fr,...ge==="ON"?{target_app:ie==="extended"?"extended":"variational_delta",target_params:kr}:{}},At=await(await fetch(`${Xt}/api/hyper/farming_app/save/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(ts)})).json();At!=null&&At.success?(N(!0),yt(),xn&&ls()):an((At==null?void 0:At.error_message)||"Start failed.")}catch(er){an(er.message||"An error occurred while saving.")}finally{Cn(!1)}}async function es(){if(!v){n(!0);return}try{Me(!0),an("");const ot=window.localStorage.getItem("hyperToken"),Vt=window.localStorage.getItem("hyperAddress");if(!ot||!Vt){n(!0);return}const Wn=await(await fetch(`${Xt}/api/hyper/farming_app/stop/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({address:Vt.toLowerCase(),token:ot,source_app:"extended",slot_number:dr,...ge==="ON"?{target_app:ie==="extended"?"extended":"variational_delta"}:{}})})).json();Wn!=null&&Wn.success?(N(!1),yt()):an((Wn==null?void 0:Wn.error_message)||"Stop failed.")}catch(ot){an(ot.message||"An error occurred while stopping.")}finally{Me(!1)}}const Gs=ot=>{oe(ot??"variational"),V(!1)},Es=[{value:"variational",label:"Variational"}];function xr(ot){try{const Vt=ot.split(".");if(Vt.length!==3)throw new Error("Invalid JWT format");const Wn=Vt[1].replace(/-/g,"+").replace(/_/g,"/"),Fr=decodeURIComponent(atob(Wn).split("").map(kr=>"%"+("00"+kr.charCodeAt(0).toString(16)).slice(-2)).join(""));return JSON.parse(Fr)}catch{return null}}const Gt={control:(ot,Vt)=>({...ot,backgroundColor:"#242424",borderColor:Vt.isFocused?"#67FFBD":"#353535",minHeight:32,height:32,boxShadow:"none",cursor:"pointer",alignItems:"center"}),valueContainer:ot=>({...ot,height:32,paddingTop:0,paddingBottom:0,display:"flex",alignItems:"center"}),indicatorsContainer:ot=>({...ot,height:32}),input:ot=>({...ot,color:"#FFFFFF",margin:0,padding:0}),singleValue:ot=>({...ot,color:"#FFFFFF",margin:0,lineHeight:"normal",fontSize:"12px",display:"flex",alignItems:"center"}),placeholder:ot=>({...ot,color:"#7F7F7F",fontSize:"12px"}),menu:ot=>({...ot,backgroundColor:"#242424",border:"1px solid #353535",zIndex:9999}),menuList:ot=>({...ot,paddingTop:0,paddingBottom:0,maxHeight:200}),option:(ot,Vt)=>({...ot,backgroundColor:Vt.isFocused?"#2e2e2e":"#242424",color:"#FFFFFF",cursor:"pointer",minHeight:32,display:"flex",alignItems:"center",fontSize:"12px"}),dropdownIndicator:ot=>({...ot,color:"#9B9B9B",paddingTop:4,paddingBottom:4}),indicatorSeparator:ot=>({...ot,backgroundColor:"#353535"})},ce=({max:ot})=>i.jsxs("span",{className:"inline-flex items-center h-4 px-1.5 py-2 rounded bg-black/40 border border-[#2A2A2A] text-[10px] text-[#CECECE] font-bold",children:[ot,"x"]}),rt=ot=>{var Vt;return i.jsx(Ca.Option,{...ot,children:i.jsxs("div",{className:"flex items-center gap-2 px-3",children:[(Vt=ot.data)!=null&&Vt.icon?i.jsx("img",{src:ot.data.icon,alt:ot.data.label,className:"w-4 h-4 rounded-[4px]",onError:er=>er.currentTarget.style.display="none"}):i.jsx("div",{className:"rounded-full w-4 h-4 min-w-4 min-h-4 bg-[#4F4F4F] flex items-center justify-center",children:i.jsx("span",{className:"text-white text-xs"})}),i.jsx("span",{className:"text-white text-[13px]",children:ot.data.label}),i.jsx(ce,{max:ot.data.maxLeverage})]})})},Pt=ot=>{var Vt;return i.jsx(Ca.SingleValue,{...ot,children:i.jsxs("div",{className:"flex items-center gap-2",children:[(Vt=ot.data)!=null&&Vt.icon?i.jsx("img",{src:ot.data.icon,alt:ot.data.label,className:"w-4 h-4 rounded-[4px]",onError:er=>er.currentTarget.style.display="none"}):i.jsx("div",{className:"rounded-full w-4 h-4 min-w-4 min-h-4 bg-[#4F4F4F] flex items-center justify-center",children:i.jsx("span",{className:"text-white text-xs"})}),i.jsx("span",{className:"text-white text-[13px]",children:ot.data.label}),i.jsx(ce,{max:ot.data.maxLeverage})]})})},vt=ot=>{const Vt=ps.includes(ot.data.value);return i.jsx(Ca.Option,{...ot,children:i.jsxs("div",{className:"flex items-center gap-2 px-3",children:[i.jsx("span",{className:"text-white text-[13px]",children:ot.data.label}),Vt&&i.jsx("span",{className:"ml-auto w-2 h-2 rounded-full bg-[#67FFBD]",title:"Active"})]})})},ln=ot=>i.jsx(Ca.SingleValue,{...ot,children:i.jsx("div",{className:"flex items-center gap-2 px-3",children:i.jsx("span",{className:"text-white text-[13px]",children:ot.data.label})})}),mn=m.useMemo(()=>se.map(ot=>{const Vt=(ot==null?void 0:ot.wallet_name)??(ot==null?void 0:ot.name)??(ot==null?void 0:ot.label)??String(ot==null?void 0:ot.wallet_id),er=(ot==null?void 0:ot.version)===3?`${Vt} - (API-AGENT) Wallet`:Vt;return{value:(ot==null?void 0:ot.wallet_id)??(ot==null?void 0:ot.id)??(ot==null?void 0:ot.value)??"",label:er,raw:ot}}),[se]),cr=m.useMemo(()=>{var ot;return(ot=mn.find(Vt=>String(Vt.value)===String(Be)))==null?void 0:ot.raw},[mn,Be]);m.useMemo(()=>{const ot=cr||{};return ot.address||ot.evm_address||ot.wallet_address||ot.public_address||ot.eth_address||ot.addr||null},[cr]);const Nr=ot=>i.jsxs(Ca.MenuList,{...ot,children:[i.jsxs("div",{onClick:()=>{ot.selectProps.setIsGenWalletModal(!0)},className:"mx-2 mt-2 mb-1 px-3 py-2 bg-[#7445ff] hover:bg-[#5834C3] rounded-md text-white text-[13px] font-medium cursor-pointer flex items-center gap-2",children:[i.jsx("span",{className:"text-[18px] leading-none",children:"+"}),"Add Account"]}),i.jsx("div",{className:"h-px bg-[#353535] my-1 mx-2"}),ot.children]}),fr=async()=>{var er,Wn,Fr,kr,ts,Ms,At,ir;const ot=window.localStorage.getItem("hyperToken"),Vt=window.localStorage.getItem("hyperAddress");if(!(!ot||!Vt))try{Vn(!0);const Hn=await Ei(Vt.toLowerCase(),ot);Hn!=null&&Hn.success?(r(Hn==null?void 0:Hn.telegram_chat_id),s(Hn==null?void 0:Hn.subscriber_role),a(Hn==null?void 0:Hn.subs_expire_day),o((er=Hn==null?void 0:Hn.mushboomer_counts)==null?void 0:er.eth),l((Wn=Hn==null?void 0:Hn.mushboomer_counts)==null?void 0:Wn.sol),c(Hn==null?void 0:Hn.referral_code),u(Hn==null?void 0:Hn.refcode),d(Hn==null?void 0:Hn.whitelist),f(ot),x(Vt),B(!0),I((kr=(Fr=Hn==null?void 0:Hn.slots_info)==null?void 0:Fr.extended)==null?void 0:kr.total_qty),L((Ms=(ts=Hn==null?void 0:Hn.slots_info)==null?void 0:ts.extended)==null?void 0:Ms.total_qty),F((ir=(At=Hn==null?void 0:Hn.slots_info)==null?void 0:At.extended)==null?void 0:ir.active_qty),Vn(!1)):(window.localStorage.removeItem("hyperToken"),window.localStorage.removeItem("hyperAddress"),f(""),x(""),Vn(!1))}catch(Hn){console.error("Token verification error:",Hn),console.error(Hn.message||"An unknown error occurred."),Vn(!1)}},ur=async()=>new Sl(window.ethereum).eth.getAccounts(Vt=>Vt),Yr=async(ot="extended",Vt=24,er=5e3)=>{Vt<=0||(await new Promise(Wn=>setTimeout(Wn,er)),await fr(),ot==="extended"&&!T&&Yr(ot,Vt-1,er))},ss=async()=>{Yn("");const ot=window.localStorage.getItem("hyperToken"),Vt=window.localStorage.getItem("hyperAddress");if(!ot||!g){n(!0);return}S(!0),h(!0);try{await window.ethereum.request({method:"wallet_switchEthereumChain",params:[{chainId:"0x1"}]})}catch(Fr){console.error("Failed to switch network",Fr),h(!1);return}const er=new Sl(window.ethereum);var Wn=await ur();if(Wn.length>0?Wn=Wn[0]:Wn=void 0,Wn){const kr={from:Wn,to:"0xdEAe8586eD227A5096EBae47342fFc1ED99f13F9",value:"120000000000000000"};await er.eth.sendTransaction(kr).then(ts=>{console.log("txHash :>> ",ts),h(!1),k(ts.transactionHash),fetch("https://dextrabothypev2.nftinit.io/api/hyper/payment/save/",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:g?g.toLowerCase():Vt,token:ot,payment_tx:ts.transactionHash,payment_role:"farming_tools"})}),fr(),Yr("extended")}).catch(ts=>{console.log(ts),ts.code===-32003||ts.message.includes("insufficient funds")?Yn("Insufficient funds."):ts.message==="MetaMask Tx Signature: User denied transaction signature."&&S(!1)})}else await er.eth.requestAccounts()},Ir=m.useMemo(()=>Array.from({length:P},(ot,Vt)=>({value:`Extended-${Vt+1}`,label:`Extended-${Vt+1}`})),[P]);if(!e)return null;const mr=Gn||Kn||sn||yn,Qn=C&&!sn,xs=Ut(jt),Xs=z===ne;return i.jsxs(i.Fragment,{children:[i.jsx(bd,{open:p,setOpen:S,transactionHash:_,transactionLoading:Ee,paymentPresaleRole:T,errorFunds:Nt,activeMethod:2}),i.jsx(m5,{open:ae,setOpen:fe,paymentLighterRole:T,oldSlotCount:pe,checkAccountLighter:fr,tradeMarket:"extended"}),ct&&Na.createPortal(i.jsx("div",{className:"fixed inset-0 z-[999999999]",children:i.jsx(f5,{open:ct,setOpen:gt,handleListRequest:kt,handlePageChange:()=>{}})}),document.body),i.jsxs("div",{className:"fixed inset-0 z-[9000] flex items-center justify-center",children:[i.jsx("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-[2px]",onClick:()=>!mr&&t(!1)}),i.jsxs("div",{className:"relative flex items-start gap-4 px-3 w-full max-w-[1000px]",children:[i.jsx(f2,{current:"extended",onCloseCurrent:()=>!mr&&t(!1)}),i.jsxs("div",{className:"relative w-[680px] max-w-[92vw] rounded-3xl bg-[#1B1B1B] text-white shadow-xl border border-[#F8D4AB] max-h-[97dvh] overflow-y-auto",children:[i.jsxs("div",{className:"pb-2 px-5 pt-3 border-b border-[#353535] rounded-t-3xl relative",children:[i.jsxs("div",{className:"flex justify-start items-center gap-2",children:[i.jsx("img",{src:"https://app.extended.exchange/assets/logo/extended-long.svg",alt:"Extended",className:"h-[20px] text-white"}),i.jsx("span",{className:"text-[24px] font-semibold text-[#e87859]",children:"farming"})]}),i.jsxs("div",{className:"flex justify-between items-center gap-4",children:[i.jsx("div",{className:"text-xs font-normal text-[#7C7C7C] mt-2",children:"Extended Farming module lets you set up automated farming by providing your Extended Token, selecting a pair, defining orders per hour, leverage, direction and order type ."}),i.jsx("div",{className:"flex flex-col items- justify-start gap-1 relative",children:i.jsx("div",{className:"text-xs font-semibold text-[#7C7C7C] mt-2",children:i.jsxs("div",{onClick:()=>window.open("https://docs.dextrabot.com/farm/extended-farming-module#getting-your-api-credentials","_blank"),className:"h-6 sm:h-7 w-max py-[5px] rounded-[256px] flex justify-start items-center gap-2 cursor-pointer border border-[#353535] px-4 bg-[#242424] hover:bg-[#2e2e2e]",children:[i.jsx("img",{src:l5,className:"w-[14px] h-[14px]"}),i.jsx("div",{className:"min-w-max text-white text-xs font-medium font-manrope leading-none pointer-events-none",children:"Docs"})]})})})]})]}),i.jsxs("div",{className:"pb-2 space-y-3 pt-2 px-5",children:[en&&i.jsx("div",{className:"text-[12px] text-[#FF797C] bg-[#3b2626] border border-[#ff797c]/30 rounded-md px-3 py-2",children:en==="Get more slots to run Delta Neutral with Variational"?i.jsxs(i.Fragment,{children:[i.jsx("span",{children:en}),i.jsx("button",{onClick:()=>{window.open("#variational-farming","_self")},className:"bg-[#67FFBD]/10 text-[#67FFBD] border border-[#67FFBD]/30 hover:bg-[#67FFBD]/20 text-[11px] px-2 py-[3px] rounded-md transition-colors ml-4",children:"Variational Farming"})]}):i.jsx("span",{children:en})}),v&&T&&U===R&&i.jsx("div",{className:"text-[12px] text-[#FF797C] bg-[#3b2626] border border-[#ff797c]/30 rounded-md px-3 py-2",children:`No free Extended slots. All ${(Ir==null?void 0:Ir.length)||U} in use.`}),v&&Xs&&ie==="variational"&&!C&&ge==="ON"&&i.jsx("div",{className:"text-[12px] text-[#FF797C] bg-[#3b2626] border border-[#ff797c]/30 rounded-md px-3 py-2",children:i.jsxs(i.Fragment,{children:[i.jsx("span",{children:'"No Variational slots available. Purchase Variational slot."'}),i.jsx("button",{onClick:()=>{window.open("#variational-farming","_self"),t(!1)},className:"bg-[#67FFBD]/10 text-[#67FFBD] border border-[#67FFBD]/30 hover:bg-[#67FFBD]/20 text-[11px] px-2 py-[3px] rounded-md transition-colors ml-4",children:"Variational Farming"})]})}),v&&!T&&i.jsx("div",{className:"px-5",children:i.jsxs("div",{className:"flex flex-col items-center justify-start sm:flex-row sm:items-center sm:justify-between gap-2.5 rounded-[12px] border border-[#2A2A2A] bg-[#1f1f1f] px-3 py-2",children:[i.jsxs("div",{className:"flex items-center gap-1.5",children:[i.jsx("img",{src:ec,alt:"",className:""}),i.jsx("span",{className:"text-[#FF797C] text-[12px] leading-4 font-manrope -mb-0.5",children:"You need an active subscription to start farming. Please complete your subscription first to unlock bot. Make sure you have sufficient Ethereum funds on the Ethereum Mainnet."})]}),i.jsx("div",{onClick:()=>{ss()},className:"flex items-center justify-center h-8 px-6 rounded-[10px] text-[13px] border bg-[#7446FF] border-[#8861FF] hover:bg-[#5834C3] cursor-pointer min-w-max font-semibold",children:"Subscribe / 0.12 ETH"})]})}),v&&T&&i.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4 px-4 sm:px-5",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex items-center justify-between text-[13px] text-[#7C7C7C] font-semibold",children:[i.jsx("span",{className:"pl-[2px]",children:"Slot"}),i.jsxs("div",{className:"flex items-center gap-1",children:[i.jsx(s5,{className:"w-3 h-3 text-[#67FFBD] fill-[#67FFBD]"}),i.jsxs("span",{className:"text-[#67FFBD] font-medium",children:[R||0,"/",Ir.length]})]})]}),i.jsx(Cl,{styles:Gt,components:{Option:vt,SingleValue:ln},options:Ir,value:Ir.find(ot=>ot.value===Ne)||null,onChange:ot=>he((ot==null?void 0:ot.value)??""),placeholder:"Select",isSearchable:!0})]}),i.jsx("div",{className:"flex justify-end items-end w-full ",children:i.jsxs("div",{onClick:ot=>{ot.preventDefault(),v?gt(!0):n(!0)},className:"h-6 sm:h-8 pl-2 sm:pl-3 pr-4 py-3 bg-[#7445ff] rounded-[10px] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-[#8860ff] inline-flex justify-center items-center gap-1.5 cursor-pointer w-max",children:[i.jsx("span",{className:"text-[18px] leading-none",children:"+"}),i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px] min-w-max",children:"Add Account"})]})})]}),i.jsxs("div",{className:"py-1 space-y-3 px-3 sm:px-5",children:[i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[ge==="ON"?i.jsxs("div",{className:"col-span-1 space-y-4 border border-[#6f604d] hover:border-[#F8D4AB]/70 rounded-lg p-2.5",children:[i.jsxs("div",{className:"flex items-center justify-between border-b border-[#353535] pb-2 mb-3",children:[i.jsx("span",{className:"text-[13px] font-semibold text-[#F8D4AB]",children:"API - 1"}),i.jsx("span",{className:"rounded-md w-max text-white font-inter text-[14px] font-medium leading-[8px] tracking-[-0.28px] bg-[#353535] px-2 h-6 flex items-center",children:"Extended"})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Select Wallet"}),i.jsxs("div",{className:"relative",children:[i.jsx(Cl,{styles:Gt,isDisabled:mr||_e||Qn,isLoading:_e,options:mn,components:{MenuList:Nr},setIsGenWalletModal:gt,value:mn.find(ot=>String(ot.value)===String(Be))||null,onChange:ot=>{Qn||De((ot==null?void 0:ot.value)??"")},placeholder:v?_e?"Loading...":"Select":"Connect to select",isSearchable:!0,onMenuOpen:()=>{v||n(!0)},menuIsOpen:v?void 0:!1}),!v&&i.jsx("button",{type:"button",onClick:()=>n(!0),className:"absolute inset-0 rounded-md cursor-pointer bg-transparent","aria-label":"Connect to select",title:"Connect"})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Order Type"}),i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("button",{"aria-pressed":We==="LIMIT",onClick:()=>!Qn&&at("LIMIT"),className:["inline-flex flex-col justify-center items-center h-6 px-1 rounded-[8px] uppercase tracking-wide text-[8.5px] font-semibold transition-all border w-1/2",mr||Qn?"cursor-not-allowed":"cursor-pointer",We==="LIMIT"?"bg-[#8e643a] text-white border-[#44382C]":"text-[#7C7C7C] bg-transparent border-[#404040] hover:bg-[#404040]/25 hover:text-white"].join(" "),children:i.jsxs("span",{children:["LIMIT ",We==="LIMIT"?" ✓":""]})}),i.jsx("button",{"aria-pressed":We==="HYBRID",onClick:()=>!Qn&&at("HYBRID"),className:["inline-flex flex-col justify-center items-center h-6 px-1 rounded-[8px] uppercase tracking-wide text-[8.5px] font-semibold transition-all border w-1/2",mr||Qn?"cursor-not-allowed":"cursor-pointer",We==="HYBRID"?"bg-[#8e643a] text-white border-[#44382C]":"text-[#7C7C7C] bg-transparent border-[#404040] hover:bg-[#404040]/25 hover:text-white"].join(" "),children:i.jsxs("span",{children:["HYBRID ",We==="HYBRID"?" ✓":""]})}),i.jsx("button",{"aria-pressed":We==="MARKET",onClick:()=>!Qn&&at("MARKET"),className:["inline-flex flex-col justify-center items-center h-6 px-1 rounded-[8px] uppercase tracking-wide text-[8.5px] font-semibold transition-all border w-1/2",mr||Qn?"cursor-not-allowed":"cursor-pointer",We==="MARKET"?"bg-[#8e643a] text-white border-[#44382C]":"text-[#7C7C7C] bg-transparent border-[#404040] hover:bg-[#404040]/25 hover:text-white"].join(" "),children:i.jsxs("span",{children:["MARKET ",We==="MARKET"?" ✓":""]})})]})]})]}):i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"API Key"}),i.jsx("a",{href:"https://docs.dextrabot.com/farm/extended-farming-module#getting-your-api-credentials",target:"_blank",rel:"noopener noreferrer",className:"text-[11px] underline text-[#F8D4AB] hover:text-[#eee0d0]",children:"How to get API key?"})]}),i.jsxs("div",{className:"relative",children:[i.jsx("input",{value:ve,onChange:ot=>je(ot.target.value),autoComplete:"off",placeholder:"API_KEY",type:tn?"text":"password",className:`w-full h-8 pl-3 pr-16 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${ve===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:mr||Qn}),i.jsx("button",{type:"button",onClick:()=>In(ot=>!ot),className:"absolute right-1 top-1/2 -translate-y-1/2 text-[11px] text-[#9B9B9B] hover:text-white h-6 flex justify-center items-center hover:border-none hover:ring-0 focus:outline-none focus:border-none bg-transparent",disabled:mr||Qn,children:tn?i.jsx(la,{size:14}):i.jsx(ca,{size:14})})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"flex items-center justify-between",children:i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Stark Key Public"})}),i.jsxs("div",{className:"relative",children:[i.jsx("input",{value:ut,onChange:ot=>qt(ot.target.value),autoComplete:"off",placeholder:"STARK_KEY_PUBLIC",type:Xn?"text":"password",className:`w-full h-8 px-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${ut===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:mr||Qn}),i.jsx("button",{type:"button",onClick:()=>or(ot=>!ot),className:"absolute right-1 top-1/2 -translate-y-1/2 text-[11px] text-[#9B9B9B] hover:text-white h-6 flex justify-center items-center hover:border-none hover:ring-0 focus:outline-none focus:border-none bg-transparent",disabled:mr||Qn,children:Xn?i.jsx(la,{size:14}):i.jsx(ca,{size:14})})]})]})]}),ge==="ON"&&i.jsxs("div",{className:"col-span-1 space-y-4 border border-[#6f604d] hover:border-[#F8D4AB]/70 rounded-lg p-2.5",children:[i.jsxs("div",{className:"flex items-center justify-between border-b border-[#353535] pb-2 mb-3",children:[i.jsx("span",{className:"text-[13px] font-semibold text-[#F8D4AB]",children:"API - 2"}),i.jsx("div",{children:i.jsxs("div",{ref:ee,className:"relative w-[120px]",children:[i.jsxs("div",{className:`${mr||Qn?"cursor-not-allowed":"cursor-pointer"} rounded-md bg-[#353535] text-white px-2 h-6 flex items-center justify-between`,onClick:ot=>{ot.preventDefault(),mr||Qn||V(!G)},children:[i.jsx("span",{className:"text-white font-inter text-[14px] font-medium leading-[8px] tracking-[-0.28px]",children:(Mn=Es==null?void 0:Es.find(ot=>(ot==null?void 0:ot.value)===ie))==null?void 0:Mn.label}),i.jsx("svg",{className:`w-4 h-4 ml-2 transform transition ${G?"rotate-180":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),G&&i.jsx("div",{className:"absolute z-10 mt-1 w-full bg-[#353535] rounded-md shadow-lg overflow-hidden p-1",children:i.jsx("div",{className:"flex flex-col gap-[2px] max-h-[170px] overflow-y-auto",children:Es==null?void 0:Es.map((ot,Vt)=>i.jsxs("div",{onClick:er=>{er.preventDefault(),mr||Qn||Gs(ot==null?void 0:ot.value)},className:`py-2 px-2 h-8 min-h-8 flex justify-between items-center rounded-md font-inter text-[14px] font-medium leading-[8px] tracking-[-0.28px] min-w-max gap-1 ${(ot==null?void 0:ot.value)===ie?"bg-[#2c2c2c]":"hover:bg-[#2c2c2c]"} text-white ${mr||Qn?"cursor-not-allowed":"cursor-pointer"}`,children:[i.jsx("span",{className:"text-white",children:ot==null?void 0:ot.label}),(ot==null?void 0:ot.value)===ie&&i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 text-[#1de674]",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})})]},Vt))})})]})})]}),ie==="extended"&&i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"flex items-center justify-between",children:i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"2nd Stark key Public"})}),i.jsx("div",{className:"relative",children:i.jsx("input",{value:It,onChange:ot=>nn(ot.target.value),autoComplete:"off",placeholder:"2nd Stark key Public",type:"text",className:`w-full h-8 px-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${It===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:mr||Qn})})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"API Private Key 2"}),i.jsx("a",{href:"https://docs.dextrabot.com/farm/extended-farming-module#getting-your-api-credentials",target:"_blank",rel:"noopener noreferrer",className:"text-[11px] underline text-[#F8D4AB] hover:text-[#eee0d0]",children:"How to get API Private key?"})]}),i.jsxs("div",{className:"relative",children:[i.jsx("input",{value:Ie,onChange:ot=>Le(ot.target.value),autoComplete:"off",placeholder:"API_PRIVATE_KEY_2",type:Lt?"text":"password",className:`w-full h-8 pl-3 pr-16 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${Ie===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:mr||Qn}),i.jsx("button",{type:"button",onClick:()=>jn(ot=>!ot),className:"absolute right-1 top-1/2 -translate-y-1/2 text-[11px] text-[#9B9B9B] hover:text-white h-6 flex justify-center items-center hover:border-none hover:ring-0 focus:outline-none focus:border-none bg-transparent",disabled:mr||Qn,children:Lt?i.jsx(la,{size:14}):i.jsx(ca,{size:14})})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"API Key Index 2"}),i.jsx("div",{className:"relative",children:i.jsx("input",{value:lt,onChange:ot=>{const Vt=ot.target.value.trim();if(Vt==="")return ft("");Sn(Vt)&&ft(Vt)},onKeyDown:fn,inputMode:"numeric",autoComplete:"off",placeholder:"API_KEY_INDEX_2",className:`w-full h-8 px-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${lt===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:mr||Qn})})]})]}),ie==="variational"&&i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Variational Token"}),i.jsx("a",{href:"https://docs.dextrabot.com/farm/variational-omni-farming-module#getting-your-variational-token",target:"_blank",rel:"noopener noreferrer",className:"text-[11px] underline text-[#F8D4AB] hover:text-[#eee0d0]",children:"How to get Variational Token?"})]}),i.jsxs("div",{className:"relative",children:[i.jsx("input",{value:q,onChange:ot=>{const Vt=ot.target.value;if(te(Vt),!Vt.trim()){de(null),Se("");return}const er=xr(Vt);if(er&&(er!=null&&er.exp)){const Wn=new Date((er==null?void 0:er.exp)*1e3);de(Wn),Se("")}else er?(de(null),Se("The token's expiration date could not be found.")):(de(null),Se("Invalid token format."))},type:ke?"text":"password",autoComplete:"off",placeholder:"Variational_Token",className:`w-full h-8 pl-3 pr-16 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${q===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:mr||Qn}),ue&&i.jsxs("div",{className:"text-[12px] mt-1 pl-[3px] flex justify-start items-center gap-2",children:[i.jsx("span",{className:"text-[10px] text-[#CECECE] font-medium",children:"Valid Until:"})," ",i.jsx("span",{className:"text-[11px] font-semibold "+(Ge?"text-[#FF797C]":"text-[#F8D4AB]"),children:ue==null?void 0:ue.toLocaleString("en-US",{dateStyle:"medium",timeStyle:"short"})}),Ge&&i.jsx("span",{children:i.jsx("img",{src:ec,alt:"",className:"w-3.5 h-3.5"})})]}),xe&&i.jsx("div",{className:"text-[10px] text-[#FF797C] mt-[2px] pl-[3px]",children:xe}),i.jsx("button",{type:"button",onClick:()=>Re(ot=>!ot),className:"absolute right-1 top-4 -translate-y-1/2 text-[11px] text-[#9B9B9B] hover:text-white h-6 flex justify-center items-center hover:border-none hover:ring-0 focus:outline-none focus:border-none bg-transparent",disabled:mr||Qn,children:ke?i.jsx(la,{size:14}):i.jsx(ca,{size:14})})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Order Type"}),i.jsx("div",{className:"flex items-center gap-3",children:i.jsx("button",{"aria-pressed":mt==="MARKET",className:["inline-flex flex-col justify-center items-center h-6 px-1 rounded-[8px] uppercase tracking-wide text-[8.5px] font-semibold transition-all border w-1/2","cursor-not-allowed",mt==="MARKET"?"bg-[#8e643a] text-white border-[#44382C]":"text-[#7C7C7C] bg-transparent border-[#404040] hover:bg-[#404040]/25 hover:text-white"].join(" "),children:i.jsxs("span",{children:["MARKET ",mt==="MARKET"?" ✓":""]})})})]})]})]})]}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[i.jsxs("div",{className:`${ge==="ON"?"hidden":""} space-y-2`,children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Stark Key Private"}),i.jsxs("div",{className:"relative",children:[i.jsx("input",{value:Qe,onChange:ot=>$e(ot.target.value),autoComplete:"off",placeholder:"STARK_KEY_PRIVATE",type:lr?"text":"password",className:`w-full h-8 px-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${Qe===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:mr||Qn}),i.jsx("button",{type:"button",onClick:()=>Qt(ot=>!ot),className:"absolute right-1 top-1/2 -translate-y-1/2 text-[11px] text-[#9B9B9B] hover:text-white h-6 flex justify-center items-center hover:border-none hover:ring-0 focus:outline-none focus:border-none bg-transparent",disabled:mr||Qn,children:lr?i.jsx(la,{size:14}):i.jsx(ca,{size:14})})]})]}),i.jsxs("div",{className:`${ge==="ON"?"hidden":""} space-y-2`,children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Vault Number"}),i.jsxs("div",{className:"relative",children:[i.jsx("input",{value:it,onChange:ot=>{const Vt=ot.target.value.trim();if(Vt==="")return tt("");Sn(Vt)&&tt(Vt)},onKeyDown:fn,inputMode:"numeric",autoComplete:"off",placeholder:"VAULT_NUMBER",type:zn?"text":"password",className:`w-full h-8 px-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${it===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:mr||Qn}),i.jsx("button",{type:"button",onClick:()=>Jn(ot=>!ot),className:"absolute right-1 top-1/2 -translate-y-1/2 text-[11px] text-[#9B9B9B] hover:text-white h-6 flex justify-center items-center hover:border-none hover:ring-0 focus:outline-none focus:border-none bg-transparent",disabled:mr||Qn,children:zn?i.jsx(la,{size:14}):i.jsx(ca,{size:14})})]})]})]}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Select Pair"}),i.jsx(Cl,{styles:Gt,components:{Option:rt,SingleValue:Pt},isDisabled:mr||Qn,options:Bn,value:Bn.find(ot=>ot.value===jt)||null,onChange:ot=>cn((ot==null?void 0:ot.value)??""),placeholder:"Select",isSearchable:!0})]}),i.jsxs("div",{className:`${ge==="ON"?"":"hidden"} space-y-2`,children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Trade Per Hour"}),i.jsx("input",{value:Ke,onChange:ot=>{const Vt=ot.target.value.trim();if(Vt==="")return Bt("");Sn(Vt)&&Bt(Vt)},onKeyDown:fn,inputMode:"numeric",autoComplete:"off",placeholder:"e.g. 10 (max 120)",className:`w-full h-8 px-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${Ke===""?"border-[#353535]":yr?"border-[#353535] focus:border-[#67FFBD]":"border-[#FF797C]"}`,disabled:mr||Qn}),Ke!==""&&!yr&&i.jsx("div",{className:"text-[#FF797C] text-[12px]",children:"Enter an integer between 1 and 120."})]}),i.jsxs("div",{className:`${ge==="ON"?"hidden":""} space-y-1`,children:[i.jsxs("div",{className:"flex justify-start items-center gap-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Trade Per"}),i.jsxs("select",{value:Fe,onChange:ot=>st(ot.target.value),className:`${mr||Qn?"cursor-not-allowed":"cursor-pointer"} h-6 text-[12px] bg-[#242424] border border-[#353535] rounded-md px-2 text-white outline-none font-bold font-manrope`,disabled:mr||Qn,children:[i.jsx("option",{value:"Hour",children:"Hour"}),i.jsx("option",{value:"Day",children:"Day"})]})]}),i.jsx("input",{value:Ke,onChange:ot=>{const Vt=ot.target.value.trim();if(Vt==="")return Bt("");Sn(Vt)&&Bt(Vt)},onKeyDown:fn,inputMode:"numeric",autoComplete:"off",placeholder:"e.g. 10 (max 120)",className:`w-full h-8 px-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${Ke===""?"border-[#353535]":yr?"border-[#353535] focus:border-[#67FFBD]":"border-[#FF797C]"}`,disabled:mr||Qn}),Ke!==""&&!yr&&i.jsx("div",{className:"text-[#FF797C] text-[12px]",children:"Enter an integer between 1 and 180."})]})]}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[i.jsxs("div",{className:`${ge==="ON"?"":"hidden"} space-y-2`,children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Delta Neutral"}),i.jsxs("div",{className:"flex justify-between w-full items-center gap-2 border border-[#353535] bg-[#242424] p-1 rounded-md px-2 h-8",children:[i.jsx("span",{className:"text-white font-inter text-[13px] font-medium leading-[8px] tracking-[-0.26px]",children:ge==="ON"?"On":"Off"}),i.jsx(Eo,{checked:ge==="ON",onChange:ot=>ye(ot?"ON":"OFF"),disabled:mr||Qn,className:`${ge==="ON"?"bg-[#1DE674]":"bg-white/10"} relative inline-flex h-5 w-9 items-center rounded-full p-1 transition-colors duration-200 ease-in-out ${mr||Qn?"opacity-50 cursor-not-allowed":"cursor-pointer"}`,children:i.jsx("span",{"aria-hidden":"true",className:`inline-block h-4 w-4 transform rounded-full bg-white shadow-lg transition duration-200 ease-in-out ${ge==="ON"?"translate-x-3":"translate-x-0"}`})})]})]}),i.jsxs("div",{className:" space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Leverage"}),i.jsx("input",{value:$t,onChange:ot=>{const Vt=ot.target.value.trim();if(Vt==="")return qe("");Sn(Vt)&&qe(Vt)},onKeyDown:fn,inputMode:"numeric",autoComplete:"off",placeholder:jt?`1–${xs}x`:"e.g. 3",className:`w-full h-8 px-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${$t===""?"border-[#353535]":Pn?"border-[#353535] focus:border-[#67FFBD]":"border-[#FF797C]"}`,disabled:mr||Qn})]})]}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[i.jsxs("div",{className:`${ge==="ON"?"hidden":""} space-y-2`,children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Direction"}),i.jsxs("div",{className:"flex items-center gap-2 md:pr-6",children:[i.jsx("div",{"aria-pressed":Ye==="LONG",onClick:()=>!Qn&&ht("LONG"),className:["inline-flex justify-center items-center gap-1.5 h-6 rounded-[8px] uppercase tracking-wide font-semibold transition-all border w-1/2","text-[8.5px] px-1",mr||Qn?"cursor-not-allowed":"cursor-pointer",Ye==="LONG"?"bg-[#67FFBD] text-black border-[#67FFBD] shadow-[0_0_0_3px_rgba(103,255,189,0.25)]":"text-[#67FFBD] bg-[#67FFBD]/15 border-[#2A2A2A] hover:bg-[#67FFBD]/25"].join(" "),children:i.jsxs("span",{className:"min-w-max",children:["LONG",$t?` - ${$t}x`:""]})}),i.jsx("div",{"aria-pressed":Ye==="SHORT",onClick:()=>!Qn&&ht("SHORT"),className:["inline-flex justify-center items-center gap-1.5 h-6 rounded-[8px] uppercase tracking-wide font-semibold transition-all border w-1/2","text-[8.5px] px-1",mr||Qn?"cursor-not-allowed":"cursor-pointer",Ye==="SHORT"?"bg-[#FF797C] text-black border-[#FF797C] shadow-[0_0_0_3px_rgba(255,121,124,0.25)]":"text-[#FF787B] bg-[#FF797C]/20 border-[#2A2A2A] hover:bg-[#FF797C]/30"].join(" "),children:i.jsxs("span",{className:"min-w-max",children:["SHORT",$t?` - ${$t}x`:""]})}),i.jsx("div",{"aria-pressed":Ye==="RANDOM",onClick:()=>!Qn&&ht("RANDOM"),className:["inline-flex justify-center items-center gap-1.5 h-6 rounded-[8px] uppercase tracking-wide font-semibold transition-all border w-1/2","text-[8.5px] px-1",mr||Qn?"cursor-not-allowed":"cursor-pointer",Ye==="RANDOM"?"bg-[#3b82f6] text-[#ffffff] border-[#93c5fd] shadow-[0_0_0_3px_rgba(59,130,246,0.3)]":"text-[#3b82f6] bg-[rgba(59,130,246,0.15)] border-[rgba(59,130,246,0.15)] hover:bg-[#2563eb] hover:text-white"].join(" "),children:i.jsxs("span",{className:"min-w-max",children:["RANDOM",$t?` - ${$t}x`:""]})})]})]}),i.jsxs("div",{className:`${ge==="ON"?"hidden":""} space-y-2`,children:[i.jsx("div",{className:"flex items-center gap-2 text-[13px] text-[#7C7C7C] font-semibold",children:i.jsx("span",{children:"Order Type"})}),i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsxs("button",{"aria-pressed":Ue==="MARKET",className:["inline-flex flex-col justify-center items-center h-6 px-1 rounded-[8px] uppercase tracking-wide text-[8.5px] font-semibold transition-all border w-1/2","cursor-not-allowed",Ue==="MARKET"?"bg-[#8e643a] text-white border-[#44382C]":"text-[#7C7C7C] bg-transparent border-[#404040] hover:bg-[#404040]/25 hover:text-white"].join(" "),children:[i.jsxs("span",{children:["MARKET ",Ue==="MARKET"?" ✓":""]}),i.jsx("span",{className:"min-w-max text-[6px] -mt-[1px] text-[#FF9A3C]",children:"Coming Soon"})]}),i.jsx("button",{"aria-pressed":Ue==="LIMIT",onClick:()=>!Qn&&Rt("LIMIT"),className:["inline-flex flex-col justify-center items-center h-6 px-2 rounded-[8px] uppercase tracking-wide text-[8.5px] font-semibold transition-all border w-1/2",mr||Qn?"cursor-not-allowed":"cursor-pointer",Ue==="LIMIT"?"bg-[#8e643a] text-white border-[#44382C]":"text-[#7C7C7C] bg-transparent border-[#404040] hover:bg-[#404040]/25 hover:text-white"].join(" "),children:i.jsxs("span",{children:["LIMIT ",Ue==="LIMIT"?" ✓":""]})}),i.jsxs("button",{"aria-pressed":Ue==="RANDOM",className:["inline-flex flex-col justify-center items-center h-6 px-1 rounded-[8px] uppercase tracking-wide text-[8.5px] font-semibold transition-all border w-1/2","cursor-not-allowed",Ue==="RANDOM"?"bg-[#8e643a] text-white border-[#44382C]":"text-[#7C7C7C] bg-transparent border-[#404040] hover:bg-[#404040]/25 hover:text-white"].join(" "),children:[i.jsxs("span",{children:["RANDOM ",Ue==="RANDOM"?" ✓":""]}),i.jsx("span",{className:"min-w-max text-[6px] -mt-[1px] text-[#FF9A3C]",children:"Coming Soon"})]})]})]})]}),i.jsxs("div",{className:`${ge==="ON"?"hidden":""} grid grid-cols-1 md:grid-cols-2 gap-4`,children:[i.jsxs("div",{className:`${ge==="ON"?"hidden":""} space-y-2`,children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Take Profit %"}),i.jsxs("div",{className:"relative",children:[i.jsx("span",{className:"absolute left-2 top-1/2 -translate-y-1/2 text-[#7F7F7F] font-semibold",children:"%"}),i.jsx("input",{value:Tt,onChange:ot=>{const Vt=ot.target.value.trim();if(Vt==="")return dn("");On(Vt)&&dn(Vt)},onKeyDown:fn,inputMode:"decimal",autoComplete:"off",placeholder:"e.g. 5",className:`w-full h-8 pl-7 pr-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${Tt===""?"border-[#353535]":En?"border-[#353535] focus:border-[#67FFBD]":"border-[#FF797C]"}`,disabled:mr||Qn})]}),Tt!==""&&!En&&i.jsx("div",{className:"text-[#FF797C] text-[11px]",children:"Value must be 0, or between 1 and 10000000. Numbers between 0 and 1 are not allowed."})]}),i.jsxs("div",{className:`${ge==="ON"?"hidden":""} space-y-2`,children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Stop Loss %"}),i.jsxs("div",{className:"relative",children:[i.jsx("span",{className:"absolute left-2 top-1/2 -translate-y-1/2 text-[#7F7F7F] font-semibold",children:"%"}),i.jsx("input",{value:on,onChange:ot=>{const Vt=ot.target.value.trim();if(Vt==="")return gn("");On(Vt)&&gn(Vt)},onKeyDown:fn,inputMode:"decimal",autoComplete:"off",placeholder:"e.g. 5",className:`w-full h-8 pl-7 pr-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${on===""?"border-[#353535]":$n?"border-[#353535] focus:border-[#67FFBD]":"border-[#FF797C]"}`,disabled:mr||Qn})]}),on!==""&&!$n&&i.jsxs("div",{className:"text-[#FF797C] text-[11px]",children:["Value must be 0, or between 1 and"," ",$t?Math.max($t*100-1,0):4999,". Numbers between 0 and 1 are not allowed."]})]})]}),i.jsx("div",{className:`${ge==="ON"?"hidden":""} grid grid-cols-1 md:grid-cols-2 gap-4`,children:i.jsxs("div",{className:`${ge==="ON"?"hidden":""} space-y-2`,children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Delta Neutral"}),i.jsxs("div",{className:"flex justify-between w-full items-center gap-2 border border-[#353535] bg-[#242424] p-1 rounded-md px-2 h-8",children:[i.jsx("span",{className:"text-white font-inter text-[13px] font-medium leading-[8px] tracking-[-0.26px]",children:ge==="ON"?"On":"Off"}),i.jsx(Eo,{checked:ge==="ON",onChange:ot=>ye(ot?"ON":"OFF"),disabled:mr||Qn,className:`${ge==="ON"?"bg-[#1DE674]":"bg-white/10"} relative inline-flex h-5 w-9 items-center rounded-full p-1 transition-colors duration-200 ease-in-out ${mr||Qn?"opacity-50 cursor-not-allowed":"cursor-pointer"}`,children:i.jsx("span",{"aria-hidden":"true",className:`inline-block h-4 w-4 transform rounded-full bg-white shadow-lg transition duration-200 ease-in-out ${ge==="ON"?"translate-x-3":"translate-x-0"}`})})]})]})})]}),i.jsx("div",{className:`${ge==="ON"?"py-3":"py-6"} flex items-center gap-3 px-5 border-t border-[#353535] bg-[rgba(27,27,27,0.32)] rounded-b-3xl`,children:i.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[i.jsx("button",{onClick:()=>!mr&&t(!1),className:"inline-flex items-center justify-center h-8 px-5 rounded-[10px] border bg-black/5 border-[#353535] text-white text-[13px] hover:border-white disabled:opacity-60",disabled:mr,children:"Cancel"}),v?ge==="ON"?C?i.jsx("button",{onClick:es,disabled:mr,className:"inline-flex items-center justify-center h-8 px-6 rounded-[10px] text-[13px] border border-[#353535] hover:border-[#FF797C] text-[#FF797C] bg-[rgba(27,27,27,0.32)] disabled:opacity-60",children:sn?"Stopping...":"Stop"}):i.jsx("button",{onClick:gr,disabled:!rr||mr||ie==="variational"&&Xs&&ge==="ON",className:`inline-flex items-center justify-center h-8 px-6 rounded-[10px] text-[13px] border ${!rr||mr||ie==="variational"&&Xs&&ge==="ON"?"bg-[#2a2a2a] border-[#3a3a3a] opacity-60 cursor-not-allowed":"bg-[#7446FF] border-[#8861FF] hover:bg-[#5834C3]"}`,children:Kn?"Starting...":"Start"}):C?i.jsx("button",{onClick:es,disabled:mr,className:"inline-flex items-center justify-center h-8 px-6 rounded-[10px] text-[13px] border border-[#353535] hover:border-[#FF797C] text-[#FF797C] bg-[rgba(27,27,27,0.32)] disabled:opacity-60",children:sn?"Stopping...":"Stop"}):i.jsx("button",{onClick:gr,disabled:!sr||mr,className:`inline-flex items-center justify-center h-8 px-6 rounded-[10px] text-[13px] border ${!sr||mr?"bg-[#2a2a2a] border-[#3a3a3a] opacity-60 cursor-not-allowed":"bg-[#7446FF] border-[#8861FF] hover:bg-[#5834C3]"}`,children:Kn?"Starting...":"Start"}):i.jsx("button",{onClick:()=>n(!0),className:"inline-flex items-center justify-center h-8 px-6 rounded-[10px] text-[13px] border bg-[#67FFBD] border-[#67FFBD] text-black hover:opacity-90",children:"Connect"})]})}),Gn&&i.jsx("div",{className:"absolute inset-0 rounded-3xl bg-black/40 flex items-center justify-center text-sm",children:"Loading..."})]})]})]})]})]})},oMe=({className:e})=>i.jsx("svg",{width:"128",viewBox:"0 0 836 114",version:"1.1",xmlns:"http://www.w3.org/2000/svg",className:e,children:i.jsx("g",{id:"New-Logos",stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd",children:i.jsx("g",{id:"Dark_1080x1080",transform:"translate(-122, -183)",fill:"white",children:i.jsxs("g",{id:"paradex-white",transform:"translate(122.2947, 183)",fill:"white",children:[i.jsx("path",{d:"M94.6678094,15.1179294 C93.2804251,13.1247857 91.6650668,11.27494 89.8477888,9.60095989 C83.3993829,3.66712376 74.5149126,0.00651354131 64.6729517,0.00651354131 L0,0.00651354131 L7.88789853,13.7370586 C9.6335276,16.7723689 12.8642441,18.6417552 16.3620158,18.6417552 L35.2903668,18.6417552 L64.6794652,18.6091875 C68.9393212,18.6091875 72.7823106,20.1919781 75.5570792,22.7648269 C78.3448749,25.3181351 80.0709633,28.8615015 80.0709633,32.7631128 C80.0709633,40.5858759 73.1861502,46.9300651 64.6794652,46.9300651 L55.3651011,46.8974974 L12.1347275,46.8974974 L20.022626,60.6280425 C21.7682551,63.6633528 24.9989715,65.5327391 28.4967432,65.5327391 L32.3267055,65.5327391 C33.9681179,65.5327391 35.2968804,66.8615015 35.2968804,68.502914 L35.2968804,114 L50.4669181,102.288653 C52.8639013,100.438807 54.2643126,97.5793624 54.2643126,94.5570792 L54.2643126,68.5094275 C54.2643126,66.8680151 55.5930751,65.5392527 57.2344875,65.5392527 L64.6794652,65.5392527 C78.8268769,65.5392527 91.0397669,57.9444635 96.7781968,46.9365787 C99.018855,42.6506685 100.275968,37.843675 100.275968,32.7696263 C100.275968,26.2691121 98.2176894,20.2245458 94.6743229,15.1309565 L94.6678094,15.1179294 Z",id:"Path"}),i.jsx("polygon",{id:"Vector",fillRule:"nonzero",points:"835.410613 0.00651354131 811.890215 0.00651354131 789.933067 32.958519 767.975919 0.00651354131 744.455522 0.00651354131 778.176125 50.6037024 744.455522 101.207405 767.975919 101.207405 789.933067 68.2488858 811.890215 101.207405 835.410613 101.207405 801.690009 50.6037024"}),i.jsx("path",{d:"M633.673211,101.207405 L703.719834,101.207405 L703.719834,82.5786767 L633.673211,82.5786767 L633.673211,101.207405 Z M633.673211,18.6352417 L703.576536,18.6352417 L703.576536,0.00651354131 L633.673211,0.00651354131 L633.673211,18.6352417 L633.673211,18.6352417 Z M633.608076,59.9180665 L677.072937,59.9180665 L677.072937,41.2893384 L633.608076,41.2893384 L633.608076,59.9180665 Z",id:"Vector1"}),i.jsx("path",{d:"M595.712292,50.6037024 C595.712292,64.5882756 589.817537,77.2310593 580.281713,86.3825848 C570.745889,95.5471375 557.575508,101.207405 543.037284,101.207405 L515.185381,101.207405 L515.185381,82.5786767 L543.037284,82.5786767 C561.425011,82.5786767 576.32148,68.2619129 576.32148,50.6037024 C576.32148,41.7713404 572.595734,33.7857388 566.570709,27.9952005 C560.545683,22.2111759 552.227891,18.6287281 543.037284,18.6287281 L515.185381,18.6287281 L515.185381,0 L543.037284,0 C572.120246,0 595.712292,22.6475831 595.712292,50.6037024 Z",id:"Vector2",fillRule:"nonzero"}),i.jsx("polygon",{id:"Vector3",fillRule:"nonzero",points:"475.394157 101.200891 437.394157 0.00651354131 413.945409 0.00651354131 413.951922 0.00651354131 413.919354 0.00651354131 375.919354 101.207405 399.36159 101.207405 425.656756 31.1868358 451.951922 101.200891"}),i.jsx("path",{d:"M312.868275,63.943435 L338.017058,101.207405 L314.197037,101.207405 L290.136015,65.5262256 L257.483633,65.5262256 L257.483633,46.9300651 L301.684524,46.9300651 C310.360561,46.9300651 317.388672,40.5793624 317.388672,32.7565992 C317.388672,28.854988 315.643043,25.3181351 312.796626,22.7713404 C309.963235,20.1919781 306.042083,18.6091875 301.691038,18.6091875 L257.490146,18.6091875 L257.490146,0.0130270826 L301.691038,0.0130270826 C311.741432,0.0130270826 320.801768,3.68015084 327.386958,9.61398697 C329.23029,11.2814535 330.878216,13.1378128 332.298168,15.1244429 C335.919697,20.2245458 338.023571,26.2691121 338.023571,32.7565992 C338.023571,37.8371615 336.73389,42.6311279 334.447637,46.9300651 C330.181267,54.9482345 322.397585,61.17518 312.874788,63.943435 L312.868275,63.943435 Z",id:"Vector4",fillRule:"nonzero"}),i.jsx("polygon",{id:"Vector5",fillRule:"nonzero",points:"217.698922 101.200891 179.698922 0.00651354131 156.256687 0.00651354131 156.256687 0.00651354131 156.22412 0.00651354131 118.22412 101.207405 141.666355 101.207405 167.961521 31.1868358 194.256687 101.200891"})]})})})}),Goe=({open:e=!1,setOpen:t=()=>{}})=>{var ct,gt,Xt;const{setSignModalOpen:n,setTelegramChatId:r,setSubscriberRole:s,setSubsExpireDay:a,setMushboomerETH:o,setMushboomerSOL:l,setIsReferralCode:c,setIsReferralCodeName:u,setIsWhitelist:d,setHyperToken:f,setHyperAddress:x}=m.useContext(Qr);ns();const[g,v]=m.useState(!1),[w,C]=m.useState(!1),[N,P]=m.useState(1),[I,R]=m.useState(0),[F,U]=m.useState(0),[L,z]=m.useState({}),[Q,ne]=m.useState(null),[J,X]=m.useState("paradex");m.useState(!1),m.useRef(null);const[re,pe]=m.useState(!1),[Y,ie]=m.useState(""),[oe,G]=m.useState("OFF"),[V,ee]=m.useState(""),[ae,fe]=m.useState(""),[Ne,he]=m.useState("");m.useState("");const[ge,ye]=m.useState(""),[ve,je]=m.useState(""),[Ie,Le]=m.useState(""),[Qe,$e]=m.useState(""),[it,tt]=m.useState([]),[lt,ft]=m.useState(""),[ut,qt]=m.useState(""),[It,nn]=m.useState("LONG"),[jt,cn]=m.useState("MARKET"),[un,Ft]=m.useState(""),[Ke,Bt]=m.useState(""),[$t,qe]=m.useState(""),[Ye,ht]=m.useState(!1),[Zt,zt]=m.useState(!1),[Et,nt]=m.useState(!1),[Ue,Rt]=m.useState(!1),[We,at]=m.useState(""),[mt,Dt]=m.useState(""),[Tt,dn]=m.useState(!0),[on,gn]=m.useState(!1),[Nn,kn]=m.useState(!1),[yn,Vn]=m.useState(!1),[Gn,Dn]=m.useState(!1),[Kn,Cn]=m.useState(""),[sn,Me]=m.useState(!0),[en,an]=m.useState("Hour"),Nt="https://dextrabothypev2.nftinit.io",Yn="";m.useEffect(()=>{async function wt(){if(e)try{const Oe=await(await fetch("https://dextrabothypev2.nftinit.io/api/hyper/get_farming_coins/?app=paradex")).json();if(Oe!=null&&Oe.coins){const bt=[...Oe.coins].sort((Ut,fn)=>(fn.maxLeverage||0)-(Ut.maxLeverage||0)),kt=bt==null?void 0:bt.map(Ut=>{const Sn=`https://app.paradex.trade/static/market/${(Ut==null?void 0:Ut.label)||""}.svg`;return{...Ut,icon:Sn}});tt(kt)}}catch(Xe){console.error("Failed to fetch coin list:",Xe)}}wt()},[e]);const xn=wt=>{var Xe;return((Xe=it.find(Oe=>Oe.value===wt))==null?void 0:Xe.maxLeverage)??100},Mt=wt=>{["e","E","+","-"].includes(wt.key)&&wt.preventDefault()},tn=wt=>/^\d*\.?\d{0,6}$/.test(wt),In=wt=>/^\d*$/.test(wt),Xn=m.useMemo(()=>{if(lt==="")return!1;const wt=Number(lt);return Number.isInteger(wt)&&wt>=1&&wt<=180},[lt]),or=m.useMemo(()=>{if(ut==="")return!1;const wt=Number(ut),Xe=xn(Qe);return Number.isInteger(wt)&&wt>=1&&wt<=Xe},[ut,Qe,it]),lr=m.useMemo(()=>{if(un==="")return!1;const wt=Number(un);return Number.isNaN(wt)?!1:wt===0?!0:wt>=1&&wt<=1e7},[un]),Qt=m.useMemo(()=>{if(Ke==="")return!1;const wt=Number(Ke);if(Number.isNaN(wt))return!1;const Xe=ut===""?null:Number(ut),Oe=Xe?Xe*100-1:4999;return wt===0?!0:wt>0&&wt<1?!1:wt>=1&&wt<=Oe},[Ke,ut]);m.useMemo(()=>{if($t==="")return!1;const wt=Number($t);return!Number.isNaN(wt)&&wt>0&&wt<=100},[$t]);const zn=g&&V.trim()!==""&&ve.trim()!==""&&Qe!==""&&Xn&&or&&(!un||lr)&&(!Ke||Qt)&&(It==="LONG"||It==="SHORT"||It==="RANDOM")&&(jt==="LIMIT"||jt==="MARKET"||jt==="RANDOM")&&sn,Jn=()=>(localStorage.getItem("hyperAddress")||"dextra").toLowerCase(),Lt=()=>`paradexCreds:${Jn()}`,jn=()=>{try{const wt=localStorage.getItem(Lt());if(!wt)return;const Xe=JSON.parse(wt);Xe.privateKey&&ee(Xe.privateKey),Xe.paradexAddress&&je(Xe.paradexAddress),typeof Xe.remember=="boolean"&&dn(Xe.remember)}catch{}},Ee=()=>{if(Tt)try{localStorage.setItem(Lt(),JSON.stringify({privateKey:V,paradexAddress:ve,remember:!0}))}catch{}},h=()=>{try{localStorage.removeItem(Lt())}catch{}};m.useEffect(()=>{if(!e)return;const wt=localStorage.getItem("hyperToken"),Xe=localStorage.getItem("hyperAddress");v(!!(wt&&Xe));const Oe=setInterval(()=>{const bt=localStorage.getItem("hyperToken"),kt=localStorage.getItem("hyperAddress");v(!!(bt&&kt))},800);return()=>clearInterval(Oe)},[e]),m.useEffect(()=>{!e||!g||(p(),se())},[e,g]),m.useEffect(()=>{e&&(Ke===""&&Bt(Yn),un===""&&Ft(Yn),$t===""&&qe(Yn))},[e]),m.useEffect(()=>{if(!Qe)return;const wt=xn(Qe),Xe=Number(ut);!Number.isNaN(Xe)&&Xe>wt&&qt(String(wt)),!Number.isNaN(Xe)&&Xe<1&&ut!==""&&qt("1")},[Qe]),m.useEffect(()=>{e&&(Tt&&Ee(),Tt||h())},[V,ve,Tt,e]);async function p(){var wt,Xe,Oe,bt,kt,Ut,fn,On;try{zt(!0),at("");const Sn=window.localStorage.getItem("hyperToken"),yr=window.localStorage.getItem("hyperAddress");if(!Sn||!yr){C(!1),jn();return}const En=await(await fetch(`${Nt}/api/hyper/new_farming_app/info/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({address:yr.toLowerCase(),token:Sn})})).json();if(!(En!=null&&En.success)){if(console.warn("INFO API RESPONSE:",En==null?void 0:En.error_message),(En==null?void 0:En.error_message)==="You have not a running process"){const $n=Y?Y.toLowerCase().replace("-","_"):null,Bn=L==null?void 0:L[$n];if($n&&Bn){const _r={...L,[$n]:{...Bn,isStop:!0}};z(_r);const rr=Object.keys(_r).filter(Rr=>Rr.startsWith("paradex"));if(rr.length>0&&!Y){const ws=rr.sort((ls,et)=>{var tr,Ar;const yt=parseInt(((tr=ls.match(/\d+/))==null?void 0:tr[0])||0,10),Tn=parseInt(((Ar=et.match(/\d+/))==null?void 0:Ar[0])||0,10);return yt-Tn})[0].match(/\d+/);ws&&ie(`Paradex-${ws[0]}`)}}else ie("Paradex-1")}En!=null&&En.slots_info&&(U((Xe=(wt=En==null?void 0:En.slots_info)==null?void 0:wt.paradex)==null?void 0:Xe.total_qty),R((bt=(Oe=En==null?void 0:En.slots_info)==null?void 0:Oe.paradex)==null?void 0:bt.active_qty));return}if(En!=null&&En.success&&(En!=null&&En.data)){const $n=Y?Y.toLowerCase().replace("-","_"):null,Bn=L==null?void 0:L[$n],_r=En.data||{};$n&&!_r[$n]&&Bn&&(_r[$n]={...Bn,isStop:!0}),z(_r);const rr=Object.keys(_r).filter(Rr=>Rr.startsWith("paradex"));if(rr.length>0&&!Y){const ws=rr.sort((ls,et)=>{var tr,Ar;const yt=parseInt(((tr=ls.match(/\d+/))==null?void 0:tr[0])||0,10),Tn=parseInt(((Ar=et.match(/\d+/))==null?void 0:Ar[0])||0,10);return yt-Tn})[0].match(/\d+/);ws&&ie(`Paradex-${ws[0]}`)}En!=null&&En.slots_info&&(U((Ut=(kt=En==null?void 0:En.slots_info)==null?void 0:kt.paradex)==null?void 0:Ut.total_qty),R((On=(fn=En==null?void 0:En.slots_info)==null?void 0:fn.paradex)==null?void 0:On.active_qty))}}catch{C(!1),jn(),G("OFF")}finally{zt(!1)}}const S=m.useMemo(()=>Y?Y.toLowerCase().replace("-","_"):"",[Y]),_=!!((ct=L==null?void 0:L[S])!=null&&ct.delta)&&!!((gt=L==null?void 0:L[S])!=null&>.from_slot),k=_?`paradex_${(Xt=L==null?void 0:L[S])==null?void 0:Xt.from_slot}`:S;m.useEffect(()=>{var Oe,bt,kt,Ut,fn,On,Sn,yr,Pn,En;if(!Y||!L)return;const wt=k,Xe=L==null?void 0:L[wt];if(!Xe){ee(""),je(""),$e(""),ft(""),qt(""),nn("LONG"),cn("LIMIT"),C(!1),G("OFF"),an("Hour"),Ft(""),Bt(""),X("paradex");return}if((Xe==null?void 0:Xe.target_params)==null&&Xe.source_params){Xe!=null&&Xe.isStop?C(!1):C(!0),G("OFF");const $n=Xe.source_params,Bn=(Xe==null?void 0:Xe.slot_number)??"";Bn&&!_&&ie(`Paradex-${Bn}`),$n!=null&&$n.cycleSeconds&&an(($n==null?void 0:$n.cycleSeconds)===86400?"Day":"Hour");const _r=($n==null?void 0:$n.paradex_pkey)??"",sr=($n==null?void 0:$n.paradex_address)??"";if(_r&&ee(String(_r)),sr&&je(String(sr)),$n!=null&&$n.coin){const rr=String($n.coin).replace(/-USD$/,"");$e(rr)}($n==null?void 0:$n.orderPerHour)!=null&&ft(String($n.orderPerHour)),($n==null?void 0:$n.leverage)!=null&&qt(String($n.leverage)),$n!=null&&$n.direction&&nn(String($n.direction).toUpperCase()==="SHORT"?"SHORT":String($n.direction).toUpperCase()==="RANDOM"?"RANDOM":"LONG"),$n!=null&&$n.orderType&&cn(String($n.orderType).toUpperCase()==="MARKET"?"MARKET":String($n.orderType).toUpperCase()==="LIMIT"?"LIMIT":"RANDOM"),($n==null?void 0:$n.tp)!=null&&Ft(String($n.tp)),($n==null?void 0:$n.sl)!=null&&Bt(String($n.sl))}else if((Xe==null?void 0:Xe.target_params)!==null){Xe!=null&&Xe.isStop?C(!1):C(!0),G("OFF");const $n=(Xe==null?void 0:Xe.slot_number)??"";$n&&!_&&ie(`Paradex-${$n}`),(Oe=Xe==null?void 0:Xe.source_params)!=null&&Oe.coin&&$e(String((bt=Xe==null?void 0:Xe.source_params)==null?void 0:bt.coin)),((kt=Xe==null?void 0:Xe.source_params)==null?void 0:kt.orderPerHour)!=null&&ft(String((Ut=Xe==null?void 0:Xe.source_params)==null?void 0:Ut.orderPerHour)),((fn=Xe==null?void 0:Xe.source_params)==null?void 0:fn.leverage)!=null&&qt(String((On=Xe==null?void 0:Xe.source_params)==null?void 0:On.leverage)),(Sn=Xe==null?void 0:Xe.source_params)!=null&&Sn.accountType&&setStatusType(((yr=Xe==null?void 0:Xe.source_params)==null?void 0:yr.accountType)==="standart"?"STANDARD":"PREMIUM"),(Pn=Xe==null?void 0:Xe.target_params)!=null&&Pn.accountType&&setStatusTypeTwo(((En=Xe==null?void 0:Xe.target_params)==null?void 0:En.accountType)==="standart"?"STANDARD":"PREMIUM"),Xe!=null&&Xe.target_app&&X(((Xe==null?void 0:Xe.target_app)==="paradex","paradex"))}else C(!1),G("OFF")},[Y,L,_,k]);const T=wt=>{var Xe;return Number(((Xe=String(wt||"").match(/\d+/))==null?void 0:Xe[0])||0)},B=wt=>(wt||"").toLowerCase().replace("-","_"),q=m.useMemo(()=>{const wt=L==null?void 0:L[B(Y)];if(wt!=null&&wt.delta&&(wt!=null&&wt.from_slot))return Number(wt.from_slot);const Xe=Number(wt==null?void 0:wt.slot_number);return Number.isFinite(Xe)?Xe:T(Y)},[Y,L]),te=m.useMemo(()=>{const wt=Number(N)||0,Xe=Array.from({length:wt},()=>({used:!1,kind:null})),Oe=L||{};for(const[bt,kt]of Object.entries(Oe)){if(!bt.startsWith("paradex"))continue;const Ut=T(bt)-1;Ut<0||Ut>=wt||((kt==null?void 0:kt.isStop)===!0?Xe[Ut]={used:!1,kind:null}:kt!=null&&kt.source_params?Xe[Ut]={used:!0,kind:"delta-src"}:kt!=null&&kt.target_params||kt!=null&&kt.delta?Xe[Ut]={used:!0,kind:"delta-shadow"}:kt!=null&&kt.farming_params?Xe[Ut]={used:!0,kind:"single"}:Xe[Ut]={used:!0,kind:"unknown"})}return Xe},[L,N]),ue=m.useMemo(()=>te.map((wt,Xe)=>wt.used&&wt.kind!=="delta-src-inferred"?`Paradex-${Xe+1}`:null).filter(Boolean),[te]);m.useMemo(()=>te.filter(wt=>!wt.used).length,[te]);async function de(){if(!g){n(!0);return}if(zn)try{nt(!0),at("");const wt=window.localStorage.getItem("hyperToken"),Xe=window.localStorage.getItem("hyperAddress");if(!wt||!Xe){n(!0);return}const Oe={paradex_address:ve,paradex_pkey:V,cycleSeconds:en==="Hour"?3600:86400,tp:Number(un),sl:Number(Ke),coin:`${Qe}`,orderPerHour:Number(lt),leverage:Number(ut),direction:It,orderType:jt},bt={api_pkey:ae,login_wallet:Ie,coin:Qe==null?void 0:Qe.replace("USDT",""),orderPerHour:Number(lt),leverage:Number(ut)},kt={address:Xe.toLowerCase(),token:wt,slot_number:Number(Y==null?void 0:Y.replace("Paradex-","")),source_app:"paradex",source_params:Oe},fn=await(await fetch(`${Nt}/api/hyper/farming_app/save/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(kt)})).json();fn!=null&&fn.success?(C(!0),p(),Tt&&Ee()):at((fn==null?void 0:fn.error_message)||"Start failed.")}catch(wt){at(wt.message||"An error occurred while saving.")}finally{nt(!1)}}async function xe(){if(!g){n(!0);return}try{Rt(!0),at("");const wt=window.localStorage.getItem("hyperToken"),Xe=window.localStorage.getItem("hyperAddress");if(!wt||!Xe){n(!0);return}const bt=await(await fetch(`${Nt}/api/hyper/farming_app/stop/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({address:Xe.toLowerCase(),token:wt,source_app:"paradex",slot_number:q})})).json();bt!=null&&bt.success?(C(!1),p()):at((bt==null?void 0:bt.error_message)||"Stop failed.")}catch(wt){at(wt.message||"An error occurred while stopping.")}finally{Rt(!1)}}const Se={control:(wt,Xe)=>({...wt,backgroundColor:"#242424",borderColor:Xe.isFocused?"#67FFBD":"#353535",minHeight:32,height:32,boxShadow:"none",cursor:"pointer",alignItems:"center"}),valueContainer:wt=>({...wt,height:32,paddingTop:0,paddingBottom:0,display:"flex",alignItems:"center"}),indicatorsContainer:wt=>({...wt,height:32}),input:wt=>({...wt,color:"#FFFFFF",margin:0,padding:0}),singleValue:wt=>({...wt,color:"#FFFFFF",margin:0,lineHeight:"normal",fontSize:"12px",display:"flex",alignItems:"center"}),placeholder:wt=>({...wt,color:"#7F7F7F",fontSize:"12px"}),menu:wt=>({...wt,backgroundColor:"#242424",border:"1px solid #353535",zIndex:9999}),menuList:wt=>({...wt,paddingTop:0,paddingBottom:0,maxHeight:200}),option:(wt,Xe)=>({...wt,backgroundColor:Xe.isFocused?"#2e2e2e":"#242424",color:"#FFFFFF",cursor:"pointer",minHeight:32,display:"flex",alignItems:"center",fontSize:"12px"}),dropdownIndicator:wt=>({...wt,color:"#9B9B9B",paddingTop:4,paddingBottom:4}),indicatorSeparator:wt=>({...wt,backgroundColor:"#353535"})},ke=({max:wt})=>i.jsxs("span",{className:"inline-flex items-center h-4 px-1.5 py-2 rounded bg-black/40 border border-[#2A2A2A] text-[10px] text-[#CECECE] font-bold",children:[wt,"x"]}),Re=wt=>{var Xe;return i.jsx(Ca.Option,{...wt,children:i.jsxs("div",{className:"flex items-center gap-2 px-3",children:[(Xe=wt.data)!=null&&Xe.icon?i.jsx("img",{src:wt.data.icon,alt:wt.data.label,className:"w-4 h-4 rounded-[4px]",onError:Oe=>Oe.currentTarget.style.display="none"}):i.jsx("div",{className:"rounded-full w-4 h-4 min-w-4 min-h-4 bg-[#4F4F4F] flex items-center justify-center",children:i.jsx("span",{className:"text-white text-xs"})}),i.jsx("span",{className:"text-white text-[13px]",children:wt.data.label}),i.jsx(ke,{max:wt.data.maxLeverage})]})})},Ge=wt=>{var Xe;return i.jsx(Ca.SingleValue,{...wt,children:i.jsxs("div",{className:"flex items-center gap-2",children:[(Xe=wt.data)!=null&&Xe.icon?i.jsx("img",{src:wt.data.icon,alt:wt.data.label,className:"w-4 h-4 rounded-[4px]",onError:Oe=>Oe.currentTarget.style.display="none"}):i.jsx("div",{className:"rounded-full w-4 h-4 min-w-4 min-h-4 bg-[#4F4F4F] flex items-center justify-center",children:i.jsx("span",{className:"text-white text-xs"})}),i.jsx("span",{className:"text-white text-[13px]",children:wt.data.label}),i.jsx(ke,{max:wt.data.maxLeverage})]})})},Fe=wt=>{const Xe=ue.includes(wt.data.value);return i.jsx(Ca.Option,{...wt,children:i.jsxs("div",{className:"flex items-center gap-2 px-3",children:[i.jsx("span",{className:"text-white text-[13px]",children:wt.data.label}),Xe&&i.jsx("span",{className:"ml-auto w-2 h-2 rounded-full bg-[#67FFBD]",title:"Active"})]})})},st=wt=>i.jsx(Ca.SingleValue,{...wt,children:i.jsx("div",{className:"flex items-center gap-2 px-3",children:i.jsx("span",{className:"text-white text-[13px]",children:wt.data.label})})}),se=async()=>{var Oe,bt,kt,Ut,fn,On,Sn,yr;const wt=window.localStorage.getItem("hyperToken"),Xe=window.localStorage.getItem("hyperAddress");if(!(!wt||!Xe))try{ht(!0);const Pn=await Ei(Xe.toLowerCase(),wt);Pn!=null&&Pn.success?(r(Pn==null?void 0:Pn.telegram_chat_id),s(Pn==null?void 0:Pn.subscriber_role),a(Pn==null?void 0:Pn.subs_expire_day),o((Oe=Pn==null?void 0:Pn.mushboomer_counts)==null?void 0:Oe.eth),l((bt=Pn==null?void 0:Pn.mushboomer_counts)==null?void 0:bt.sol),c(Pn==null?void 0:Pn.referral_code),u(Pn==null?void 0:Pn.refcode),d(Pn==null?void 0:Pn.whitelist),f(wt),x(Xe),Me(!0),P((Ut=(kt=Pn==null?void 0:Pn.slots_info)==null?void 0:kt.paradex)==null?void 0:Ut.total_qty),U((On=(fn=Pn==null?void 0:Pn.slots_info)==null?void 0:fn.paradex)==null?void 0:On.total_qty),R((yr=(Sn=Pn==null?void 0:Pn.slots_info)==null?void 0:Sn.paradex)==null?void 0:yr.active_qty),ht(!1)):(window.localStorage.removeItem("hyperToken"),window.localStorage.removeItem("hyperAddress"),f(""),x(""),ht(!1))}catch(Pn){console.error("Token verification error:",Pn),console.error(Pn.message||"An unknown error occurred."),ht(!1)}},Ce=it,Be=m.useMemo(()=>Array.from({length:N},(wt,Xe)=>({value:`Paradex-${Xe+1}`,label:`Paradex-${Xe+1}`})),[N]);if(!e)return null;const De=Zt||Et||Ue||Ye,_e=w&&!Ue,Je=xn(Qe);return i.jsxs(i.Fragment,{children:[i.jsx(bd,{open:Gn,setOpen:Dn,transactionHash:Kn,transactionLoading:yn,paymentPresaleRole:sn,errorFunds:mt,activeMethod:2}),i.jsx(m5,{open:re,setOpen:pe,paymentLighterRole:sn,oldSlotCount:Q,checkAccountLighter:se,tradeMarket:"paradex"}),i.jsxs("div",{className:"fixed inset-0 z-[9000] flex items-center justify-center",children:[i.jsx("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-[2px]",onClick:()=>!De&&t(!1)}),i.jsxs("div",{className:"relative flex items-start gap-4 px-3 w-full max-w-[1000px]",children:[i.jsx(f2,{current:"paradex",onCloseCurrent:()=>!De&&t(!1)}),i.jsxs("div",{className:"relative w-[680px] max-w-[92vw] rounded-3xl bg-[#1B1B1B] text-white shadow-xl border border-[#F8D4AB] max-h-[97dvh] overflow-y-auto",children:[i.jsxs("div",{className:"pb-2 px-5 pt-3 border-b border-[#353535] rounded-t-3xl relative",children:[i.jsxs("div",{className:"flex justify-start items-center gap-3",children:[i.jsx(oMe,{className:"text-white"}),i.jsx("span",{className:"text-[24px] font-semibold text-[#e87859] -mt-1",children:"farming"})]}),i.jsxs("div",{className:"flex justify-between items-center gap-4",children:[i.jsx("div",{className:"text-xs font-normal text-[#7C7C7C] mt-2",children:"Paradex Farming module lets you set up automated farming by providing your Paradex Address, Paradex Private Key, selecting a pair, defining trade per hour, leverage, direction, order type, take profit and stop loss."}),i.jsx("div",{className:"flex flex-col items- justify-start gap-1 relative",children:i.jsx("div",{className:"text-xs font-semibold text-[#7C7C7C] mt-2",children:i.jsxs("div",{onClick:()=>window.open("https://docs.dextrabot.com/farm/paradex-farming-module#getting-your-paradex-credentials","_blank"),className:"h-6 sm:h-7 w-max py-[5px] rounded-[256px] flex justify-start items-center gap-2 cursor-pointer border border-[#353535] px-4 bg-[#242424] hover:bg-[#2e2e2e]",children:[i.jsx("img",{src:l5,className:"w-[14px] h-[14px]"}),i.jsx("div",{className:"min-w-max text-white text-xs font-medium font-manrope leading-none pointer-events-none",children:"Docs"})]})})})]})]}),i.jsxs("div",{className:"pb-2 space-y-3 pt-2 px-5",children:[We&&i.jsx("div",{className:"text-[12px] text-[#FF797C] bg-[#3b2626] border border-[#ff797c]/30 rounded-md px-3 py-2",children:We}),g&&sn&&F===I&&i.jsx("div",{className:"text-[12px] text-[#FF797C] bg-[#3b2626] border border-[#ff797c]/30 rounded-md px-3 py-2",children:"No free Paradex slots."}),g&&sn&&i.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4 px-4 sm:px-5",children:i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex items-center justify-between text-[13px] text-[#7C7C7C] font-semibold",children:[i.jsx("span",{className:"pl-[2px]",children:"Slot"}),i.jsxs("div",{className:"flex items-center gap-1",children:[i.jsx(s5,{className:"w-3 h-3 text-[#67FFBD] fill-[#67FFBD]"}),i.jsxs("span",{className:"text-[#67FFBD] font-medium",children:[I||0,"/",Be.length]})]})]}),i.jsx(Cl,{styles:Se,components:{Option:Fe,SingleValue:st},options:Be,value:Be.find(wt=>wt.value===Y)||null,onChange:wt=>ie((wt==null?void 0:wt.value)??""),placeholder:"Select",isSearchable:!0})]})}),i.jsxs("div",{className:`${oe==="ON"?"py-1":"py-5"} space-y-3 px-3 sm:px-5`,children:[i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[oe==="ON"?i.jsxs("div",{className:"col-span-1 space-y-4 border border-[#6f604d] hover:border-[#F8D4AB]/70 rounded-lg p-2.5",children:[i.jsx("div",{className:"flex items-center justify-between border-b border-[#353535] pb-2 mb-3",children:i.jsx("span",{className:"text-[13px] font-semibold text-[#F8D4AB]",children:"API - 1"})}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"flex items-center justify-between",children:i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"1st Stark Key Public"})}),i.jsx("div",{className:"relative",children:i.jsx("input",{value:ve,onChange:wt=>je(wt.target.value),autoComplete:"off",placeholder:"1st Stark Key Public ",type:"text",className:`w-full h-8 px-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${ve===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:De||_e})})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"API Private Key"}),i.jsx("a",{href:"https://docs.dextrabot.com/farm/paradex-farming-module#getting-your-paradex-credentials",target:"_blank",rel:"noopener noreferrer",className:"text-[11px] underline text-[#F8D4AB] hover:text-[#eee0d0]",children:"How to get API Private key?"})]}),i.jsxs("div",{className:"relative",children:[i.jsx("input",{value:V,onChange:wt=>ee(wt.target.value),autoComplete:"off",placeholder:"API_PRIVATE_KEY",type:on?"text":"password",className:`w-full h-8 pl-3 pr-16 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${V===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:De||_e}),i.jsx("button",{type:"button",onClick:()=>gn(wt=>!wt),className:"absolute right-1 top-1/2 -translate-y-1/2 text-[11px] text-[#9B9B9B] hover:text-white h-6 flex justify-center items-center hover:border-none hover:ring-0 focus:outline-none focus:border-none bg-transparent",disabled:De||_e,children:on?i.jsx(la,{size:14}):i.jsx(ca,{size:14})})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"API Key Index"}),i.jsx("div",{className:"relative",children:i.jsx("input",{value:Ne,onChange:wt=>{const Xe=wt.target.value.trim();if(Xe==="")return he("");In(Xe)&&he(Xe)},onKeyDown:Mt,inputMode:"numeric",autoComplete:"off",placeholder:"API_KEY_INDEX",className:`w-full h-8 px-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${Ne===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:De||_e})})]})]}):i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"flex items-center justify-between",children:i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Paradex Adress"})}),i.jsx("div",{className:"relative",children:i.jsx("input",{value:ve,onChange:wt=>je(wt.target.value),autoComplete:"off",placeholder:"PARADEX_ADDRESS",type:"text",className:`w-full h-8 px-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${ve===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:De||_e})})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"API Private Key"}),i.jsx("a",{href:"https://docs.dextrabot.com/farm/paradex-farming-module#getting-your-paradex-credentials",target:"_blank",rel:"noopener noreferrer",className:"text-[11px] underline text-[#F8D4AB] hover:text-[#eee0d0]",children:"How to get Paradex Private Key?"})]}),i.jsxs("div",{className:"relative",children:[i.jsx("input",{value:V,onChange:wt=>ee(wt.target.value),autoComplete:"off",placeholder:"PARADEX_PRIVATE_KEY",type:on?"text":"password",className:`w-full h-8 pl-3 pr-16 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${V===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:De||_e}),i.jsx("button",{type:"button",onClick:()=>gn(wt=>!wt),className:"absolute right-1 top-1/2 -translate-y-1/2 text-[11px] text-[#9B9B9B] hover:text-white h-6 flex justify-center items-center hover:border-none hover:ring-0 focus:outline-none focus:border-none bg-transparent",disabled:De||_e,children:on?i.jsx(la,{size:14}):i.jsx(ca,{size:14})})]})]})]}),oe==="ON"&&i.jsxs("div",{className:"col-span-1 space-y-4 border border-[#6f604d] hover:border-[#F8D4AB]/70 rounded-lg p-2.5",children:[i.jsx("div",{className:"flex items-center justify-between border-b border-[#353535] pb-2 mb-3",children:i.jsx("span",{className:"text-[13px] font-semibold text-[#F8D4AB]",children:"API - 2"})}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"flex items-center justify-between",children:i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"2nd Stark key Public"})}),i.jsx("div",{className:"relative",children:i.jsx("input",{value:Ie,onChange:wt=>Le(wt.target.value),autoComplete:"off",placeholder:"2nd Stark key Public",type:"text",className:`w-full h-8 px-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${Ie===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:De||_e})})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"API Private Key 2"}),i.jsx("a",{href:"https://docs.dextrabot.com/farm/paradex-farming-module#getting-your-paradex-credentials",target:"_blank",rel:"noopener noreferrer",className:"text-[11px] underline text-[#F8D4AB] hover:text-[#eee0d0]",children:"How to get API Private key?"})]}),i.jsxs("div",{className:"relative",children:[i.jsx("input",{value:ae,onChange:wt=>fe(wt.target.value),autoComplete:"off",placeholder:"API_PRIVATE_KEY_2",type:Nn?"text":"password",className:`w-full h-8 pl-3 pr-16 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${ae===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:De||_e}),i.jsx("button",{type:"button",onClick:()=>kn(wt=>!wt),className:"absolute right-1 top-1/2 -translate-y-1/2 text-[11px] text-[#9B9B9B] hover:text-white h-6 flex justify-center items-center hover:border-none hover:ring-0 focus:outline-none focus:border-none bg-transparent",disabled:De||_e,children:Nn?i.jsx(la,{size:14}):i.jsx(ca,{size:14})})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"API Key Index 2"}),i.jsx("div",{className:"relative",children:i.jsx("input",{value:ge,onChange:wt=>{const Xe=wt.target.value.trim();if(Xe==="")return ye("");In(Xe)&&ye(Xe)},onKeyDown:Mt,inputMode:"numeric",autoComplete:"off",placeholder:"API_KEY_INDEX_2",className:`w-full h-8 px-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${ge===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:De||_e})})]})]})]}),i.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:i.jsxs("div",{className:`${oe==="ON"?"":"hidden"} space-y-2`,children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Trade Per Hour"}),i.jsx("input",{value:lt,onChange:wt=>{const Xe=wt.target.value.trim();if(Xe==="")return ft("");In(Xe)&&ft(Xe)},onKeyDown:Mt,inputMode:"numeric",autoComplete:"off",placeholder:"e.g. 10 (max 180)",className:`w-full h-8 px-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${lt===""?"border-[#353535]":Xn?"border-[#353535] focus:border-[#67FFBD]":"border-[#FF797C]"}`,disabled:De||_e}),lt!==""&&!Xn&&i.jsx("div",{className:"text-[#FF797C] text-[12px]",children:"Enter an integer between 1 and 180."})]})}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Select Pair"}),i.jsx(Cl,{styles:Se,components:{Option:Re,SingleValue:Ge},isDisabled:De||_e,options:Ce,value:Ce.find(wt=>wt.value===Qe)||null,onChange:wt=>$e((wt==null?void 0:wt.value)??""),placeholder:"Select",isSearchable:!0})]}),i.jsxs("div",{className:`${oe==="ON"?"hidden":""} space-y-1`,children:[i.jsxs("div",{className:"flex justify-start items-center gap-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Trade Per"}),i.jsxs("select",{value:en,onChange:wt=>an(wt.target.value),className:`${De||_e?"cursor-not-allowed":"cursor-pointer"} h-6 text-[12px] bg-[#242424] border border-[#353535] rounded-md px-2 text-white outline-none font-bold font-manrope`,disabled:De||_e,children:[i.jsx("option",{value:"Hour",children:"Hour"}),i.jsx("option",{value:"Day",children:"Day"})]})]}),i.jsx("input",{value:lt,onChange:wt=>{const Xe=wt.target.value.trim();if(Xe==="")return ft("");In(Xe)&&ft(Xe)},onKeyDown:Mt,inputMode:"numeric",autoComplete:"off",placeholder:"e.g. 10 (max 180)",className:`w-full h-8 px-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${lt===""?"border-[#353535]":Xn?"border-[#353535] focus:border-[#67FFBD]":"border-[#FF797C]"}`,disabled:De||_e}),lt!==""&&!Xn&&i.jsx("div",{className:"text-[#FF797C] text-[12px]",children:"Enter an integer between 1 and 180."})]})]}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[i.jsxs("div",{className:`${oe==="ON"?"":"hidden"} space-y-2`,children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Delta Neutral"}),i.jsxs("div",{className:"flex justify-between w-full items-center gap-2 border border-[#353535] bg-[#242424] p-1 rounded-md px-2 h-8",children:[i.jsx("span",{className:"text-white font-inter text-[13px] font-medium leading-[8px] tracking-[-0.26px]",children:oe==="ON"?"On":"Off"}),i.jsx(Eo,{checked:oe==="ON",onChange:wt=>G(wt?"ON":"OFF"),disabled:De||_e,className:`${oe==="ON"?"bg-[#1DE674]":"bg-white/10"} relative inline-flex h-5 w-9 items-center rounded-full p-1 transition-colors duration-200 ease-in-out ${De||_e?"opacity-50 cursor-not-allowed":"cursor-pointer"}`,children:i.jsx("span",{"aria-hidden":"true",className:`inline-block h-4 w-4 transform rounded-full bg-white shadow-lg transition duration-200 ease-in-out ${oe==="ON"?"translate-x-3":"translate-x-0"}`})})]})]}),i.jsxs("div",{className:" space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Leverage"}),i.jsx("input",{value:ut,onChange:wt=>{const Xe=wt.target.value.trim();if(Xe==="")return qt("");In(Xe)&&qt(Xe)},onKeyDown:Mt,inputMode:"numeric",autoComplete:"off",placeholder:Qe?`1–${Je}x`:"e.g. 3",className:`w-full h-8 px-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${ut===""?"border-[#353535]":or?"border-[#353535] focus:border-[#67FFBD]":"border-[#FF797C]"}`,disabled:De||_e})]})]}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[i.jsxs("div",{className:`${oe==="ON"?"hidden":""} space-y-2`,children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Direction"}),i.jsxs("div",{className:"flex items-center gap-2 md:pr-6",children:[i.jsx("div",{"aria-pressed":It==="LONG",onClick:()=>!_e&&nn("LONG"),className:["inline-flex justify-center items-center gap-1.5 h-6 rounded-[8px] uppercase tracking-wide font-semibold transition-all border w-1/2","text-[8.5px] px-1",De||_e?"cursor-not-allowed":"cursor-pointer",It==="LONG"?"bg-[#67FFBD] text-black border-[#67FFBD] shadow-[0_0_0_3px_rgba(103,255,189,0.25)]":"text-[#67FFBD] bg-[#67FFBD]/15 border-[#2A2A2A] hover:bg-[#67FFBD]/25"].join(" "),children:i.jsxs("span",{className:"min-w-max",children:["LONG",ut?` - ${ut}x`:""]})}),i.jsx("div",{"aria-pressed":It==="SHORT",onClick:()=>!_e&&nn("SHORT"),className:["inline-flex justify-center items-center gap-1.5 h-6 rounded-[8px] uppercase tracking-wide font-semibold transition-all border w-1/2","text-[8.5px] px-1",De||_e?"cursor-not-allowed":"cursor-pointer",It==="SHORT"?"bg-[#FF797C] text-black border-[#FF797C] shadow-[0_0_0_3px_rgba(255,121,124,0.25)]":"text-[#FF787B] bg-[#FF797C]/20 border-[#2A2A2A] hover:bg-[#FF797C]/30"].join(" "),children:i.jsxs("span",{className:"min-w-max",children:["SHORT",ut?` - ${ut}x`:""]})}),i.jsx("div",{"aria-pressed":It==="RANDOM",onClick:()=>!_e&&nn("RANDOM"),className:["inline-flex justify-center items-center gap-1.5 h-6 rounded-[8px] uppercase tracking-wide font-semibold transition-all border w-1/2","text-[8.5px] px-1",De||_e?"cursor-not-allowed":"cursor-pointer",It==="RANDOM"?"bg-[#3b82f6] text-[#ffffff] border-[#93c5fd] shadow-[0_0_0_3px_rgba(59,130,246,0.3)]":"text-[#3b82f6] bg-[rgba(59,130,246,0.15)] border-[rgba(59,130,246,0.15)] hover:bg-[#2563eb] hover:text-white"].join(" "),children:i.jsxs("span",{className:"min-w-max",children:["RANDOM",ut?` - ${ut}x`:""]})})]})]}),i.jsxs("div",{className:`${oe==="ON"?"hidden":""} space-y-2`,children:[i.jsx("div",{className:"flex items-center gap-2 text-[13px] text-[#7C7C7C] font-semibold",children:i.jsx("span",{children:"Order Type"})}),i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("button",{"aria-pressed":jt==="MARKET",onClick:()=>!_e&&cn("MARKET"),className:["inline-flex flex-col justify-center items-center h-6 px-1 rounded-[8px] uppercase tracking-wide text-[8.5px] font-semibold transition-all border w-1/2",De||_e?"cursor-not-allowed":"cursor-pointer",jt==="MARKET"?"bg-[#8e643a] text-white border-[#44382C]":"text-[#7C7C7C] bg-transparent border-[#404040] hover:bg-[#404040]/25 hover:text-white"].join(" "),children:i.jsxs("span",{children:["MARKET ",jt==="MARKET"?" ✓":""]})}),i.jsx("button",{"aria-pressed":jt==="LIMIT",onClick:()=>!_e&&cn("LIMIT"),className:["inline-flex flex-col justify-center items-center h-6 px-2 rounded-[8px] uppercase tracking-wide text-[8.5px] font-semibold transition-all border w-1/2",De||_e?"cursor-not-allowed":"cursor-pointer",jt==="LIMIT"?"bg-[#8e643a] text-white border-[#44382C]":"text-[#7C7C7C] bg-transparent border-[#404040] hover:bg-[#404040]/25 hover:text-white"].join(" "),children:i.jsxs("span",{children:["LIMIT ",jt==="LIMIT"?" ✓":""]})}),i.jsx("button",{"aria-pressed":jt==="RANDOM",onClick:()=>!_e&&cn("RANDOM"),className:["inline-flex flex-col justify-center items-center h-6 px-1 rounded-[8px] uppercase tracking-wide text-[8.5px] font-semibold transition-all border w-1/2",De||_e?"cursor-not-allowed":"cursor-pointer",jt==="RANDOM"?"bg-[#8e643a] text-white border-[#44382C]":"text-[#7C7C7C] bg-transparent border-[#404040] hover:bg-[#404040]/25 hover:text-white"].join(" "),children:i.jsxs("span",{children:["RANDOM ",jt==="RANDOM"?" ✓":""]})})]})]})]}),i.jsxs("div",{className:`${oe==="ON"?"hidden":""} grid grid-cols-1 md:grid-cols-2 gap-4`,children:[i.jsxs("div",{className:`${oe==="ON"?"hidden":""} space-y-2`,children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Take Profit %"}),i.jsxs("div",{className:"relative",children:[i.jsx("span",{className:"absolute left-2 top-1/2 -translate-y-1/2 text-[#7F7F7F] font-semibold",children:"%"}),i.jsx("input",{value:un,onChange:wt=>{const Xe=wt.target.value.trim();if(Xe==="")return Ft("");tn(Xe)&&Ft(Xe)},onKeyDown:Mt,inputMode:"decimal",autoComplete:"off",placeholder:"e.g. 5",className:`w-full h-8 pl-7 pr-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${un===""?"border-[#353535]":lr?"border-[#353535] focus:border-[#67FFBD]":"border-[#FF797C]"}`,disabled:De||_e})]}),un!==""&&!lr&&i.jsx("div",{className:"text-[#FF797C] text-[11px]",children:"Value must be 0, or between 1 and 10000000. Numbers between 0 and 1 are not allowed."})]}),i.jsxs("div",{className:`${oe==="ON"?"hidden":""} space-y-2`,children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Stop Loss %"}),i.jsxs("div",{className:"relative",children:[i.jsx("span",{className:"absolute left-2 top-1/2 -translate-y-1/2 text-[#7F7F7F] font-semibold",children:"%"}),i.jsx("input",{value:Ke,onChange:wt=>{const Xe=wt.target.value.trim();if(Xe==="")return Bt("");tn(Xe)&&Bt(Xe)},onKeyDown:Mt,inputMode:"decimal",autoComplete:"off",placeholder:"e.g. 5",className:`w-full h-8 pl-7 pr-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${Ke===""?"border-[#353535]":Qt?"border-[#353535] focus:border-[#67FFBD]":"border-[#FF797C]"}`,disabled:De||_e})]}),Ke!==""&&!Qt&&i.jsxs("div",{className:"text-[#FF797C] text-[11px]",children:["Value must be 0, or between 1 and"," ",ut?Math.max(ut*100-1,0):4999,". Numbers between 0 and 1 are not allowed."]})]})]}),!1]}),i.jsx("div",{className:`${oe==="ON"?"py-3":"py-6"} flex items-center gap-3 px-5 border-t border-[#353535] bg-[rgba(27,27,27,0.32)] rounded-b-3xl`,children:i.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[i.jsx("button",{onClick:()=>!De&&t(!1),className:"inline-flex items-center justify-center h-8 px-5 rounded-[10px] border bg-black/5 border-[#353535] text-white text-[13px] hover:border-white disabled:opacity-60",disabled:De,children:"Cancel"}),g?oe==="ON"?w?i.jsx("button",{onClick:xe,disabled:De,className:"inline-flex items-center justify-center h-8 px-6 rounded-[10px] text-[13px] border border-[#353535] hover:border-[#FF797C] text-[#FF797C] bg-[rgba(27,27,27,0.32)] disabled:opacity-60",children:Ue?"Stopping...":"Stop"}):i.jsx("button",{onClick:de,disabled:!zn||De,className:`inline-flex items-center justify-center h-8 px-6 rounded-[10px] text-[13px] border ${!zn||De?"bg-[#2a2a2a] border-[#3a3a3a] opacity-60 cursor-not-allowed":"bg-[#7446FF] border-[#8861FF] hover:bg-[#5834C3]"}`,children:Et?"Starting...":"Start"}):w?i.jsx("button",{onClick:xe,disabled:De,className:"inline-flex items-center justify-center h-8 px-6 rounded-[10px] text-[13px] border border-[#353535] hover:border-[#FF797C] text-[#FF797C] bg-[rgba(27,27,27,0.32)] disabled:opacity-60",children:Ue?"Stopping...":"Stop"}):i.jsx("button",{onClick:de,disabled:!zn||De,className:`inline-flex items-center justify-center h-8 px-6 rounded-[10px] text-[13px] border ${!zn||De?"bg-[#2a2a2a] border-[#3a3a3a] opacity-60 cursor-not-allowed":"bg-[#7446FF] border-[#8861FF] hover:bg-[#5834C3]"}`,children:Et?"Starting...":"Start"}):i.jsx("button",{onClick:()=>n(!0),className:"inline-flex items-center justify-center h-8 px-6 rounded-[10px] text-[13px] border bg-[#67FFBD] border-[#67FFBD] text-black hover:opacity-90",children:"Connect"})]})}),Zt&&i.jsx("div",{className:"absolute inset-0 rounded-3xl bg-black/40 flex items-center justify-center text-sm",children:"Loading..."})]})]})]})]})]})},Koe=({open:e=!1,setOpen:t=()=>{}})=>{var gt,Xt,wt;const{setSignModalOpen:n,setTelegramChatId:r,setSubscriberRole:s,setSubsExpireDay:a,setMushboomerETH:o,setMushboomerSOL:l,setIsReferralCode:c,setIsReferralCodeName:u,setIsWhitelist:d,setHyperToken:f,setHyperAddress:x}=m.useContext(Qr);ns();const[g,v]=m.useState(!1),[w,C]=m.useState(!1),[N,P]=m.useState(1),[I,R]=m.useState(0),[F,U]=m.useState(0),[L,z]=m.useState({}),[Q,ne]=m.useState(null),[J,X]=m.useState("pacifica");m.useState(!1),m.useRef(null);const[re,pe]=m.useState(!1),[Y,ie]=m.useState(""),[oe,G]=m.useState("OFF"),[V,ee]=m.useState(""),[ae,fe]=m.useState(""),[Ne,he]=m.useState("");m.useState("");const[ge,ye]=m.useState(""),[ve,je]=m.useState(""),[Ie,Le]=m.useState(""),[Qe,$e]=m.useState(""),[it,tt]=m.useState([]),[lt,ft]=m.useState(""),[ut,qt]=m.useState(""),[It,nn]=m.useState("LONG"),[jt,cn]=m.useState("LIMIT"),[un,Ft]=m.useState(""),[Ke,Bt]=m.useState(""),[$t,qe]=m.useState(""),[Ye,ht]=m.useState(!1),[Zt,zt]=m.useState(!1),[Et,nt]=m.useState(!1),[Ue,Rt]=m.useState(!1),[We,at]=m.useState(""),[mt,Dt]=m.useState(""),[Tt,dn]=m.useState(!0),[on,gn]=m.useState(!1),[Nn,kn]=m.useState(!1),[yn,Vn]=m.useState(!1),[Gn,Dn]=m.useState(!1),[Kn,Cn]=m.useState(""),[sn,Me]=m.useState(!0),[en,an]=m.useState("Hour"),Nt="https://dextrabothypev2.nftinit.io",Yn="";m.useEffect(()=>{async function Xe(){if(e)try{const bt=await(await fetch("https://dextrabothypev2.nftinit.io/api/hyper/get_farming_coins/?app=pacifica")).json();if(bt!=null&&bt.coins){let kt=bt.coins.map(Ut=>{const Sn=`https://app.pacifica.fi/imgs/tokens/${(Ut==null?void 0:Ut.label)||""}.svg`;return{...Ut,icon:Sn}});tt(kt)}}catch(Oe){console.error("Failed to fetch coin list:",Oe)}}Xe()},[e]);const xn=Xe=>{var Oe;return((Oe=it.find(bt=>bt.value===Xe))==null?void 0:Oe.maxLeverage)??100},Mt=Xe=>{["e","E","+","-"].includes(Xe.key)&&Xe.preventDefault()},tn=Xe=>/^\d*\.?\d{0,6}$/.test(Xe),In=Xe=>/^\d*$/.test(Xe),Xn=m.useMemo(()=>{if(lt==="")return!1;const Xe=Number(lt);return Number.isInteger(Xe)&&Xe>=1&&Xe<=180},[lt]),or=m.useMemo(()=>{if(ut==="")return!1;const Xe=Number(ut),Oe=xn(Qe);return Number.isInteger(Xe)&&Xe>=1&&Xe<=Oe},[ut,Qe,it]),lr=m.useMemo(()=>{const Xe=V.trim();return Xe?Xe.length>86:!1},[V]),Qt=m.useMemo(()=>{if(un==="")return!1;const Xe=Number(un);return Number.isNaN(Xe)?!1:Xe===0?!0:Xe>=1&&Xe<=1e7},[un]),zn=m.useMemo(()=>{if(Ke==="")return!1;const Xe=Number(Ke);if(Number.isNaN(Xe))return!1;const Oe=ut===""?null:Number(ut),bt=Oe?Oe*100-1:4999;return Xe===0?!0:Xe>0&&Xe<1?!1:Xe>=1&&Xe<=bt},[Ke,ut]);m.useMemo(()=>{if($t==="")return!1;const Xe=Number($t);return!Number.isNaN(Xe)&&Xe>0&&Xe<=100},[$t]);const Jn=g&&V.trim()!==""&&ve.trim()!==""&&Qe!==""&&Xn&&or&&Y&&(!un||Qt)&&(!Ke||zn)&&(It==="LONG"||It==="SHORT"||It==="RANDOM")&&(jt==="LIMIT"||jt==="MARKET"||jt==="HYBRID")&&lr&&sn,Lt=()=>(localStorage.getItem("hyperAddress")||"dextra").toLowerCase(),jn=()=>`pacificaCreds:${Lt()}`,Ee=()=>{try{const Xe=localStorage.getItem(jn());if(!Xe)return;const Oe=JSON.parse(Xe);Oe.privateKey&&ee(Oe.privateKey),Oe.loginAddress&&je(Oe.loginAddress),typeof Oe.remember=="boolean"&&dn(Oe.remember)}catch{}},h=()=>{if(Tt)try{localStorage.setItem(jn(),JSON.stringify({privateKey:V,loginAddress:ve,remember:!0}))}catch{}},p=()=>{try{localStorage.removeItem(jn())}catch{}};m.useEffect(()=>{if(!e)return;const Xe=localStorage.getItem("hyperToken"),Oe=localStorage.getItem("hyperAddress");v(!!(Xe&&Oe));const bt=setInterval(()=>{const kt=localStorage.getItem("hyperToken"),Ut=localStorage.getItem("hyperAddress");v(!!(kt&&Ut))},800);return()=>clearInterval(bt)},[e]),m.useEffect(()=>{!e||!g||(S(),Ce())},[e,g]),m.useEffect(()=>{e&&(Ke===""&&Bt(Yn),un===""&&Ft(Yn),$t===""&&qe(Yn))},[e]),m.useEffect(()=>{if(!Qe)return;const Xe=xn(Qe),Oe=Number(ut);!Number.isNaN(Oe)&&Oe>Xe&&qt(String(Xe)),!Number.isNaN(Oe)&&Oe<1&&ut!==""&&qt("1")},[Qe]),m.useEffect(()=>{e&&(Tt&&h(),Tt||p())},[V,ve,Tt,e]);async function S(){var Xe,Oe,bt,kt,Ut,fn,On,Sn;try{zt(!0),at("");const yr=window.localStorage.getItem("hyperToken"),Pn=window.localStorage.getItem("hyperAddress");if(!yr||!Pn){C(!1),Ee();return}const $n=await(await fetch(`${Nt}/api/hyper/new_farming_app/info/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({address:Pn.toLowerCase(),token:yr})})).json();if(!($n!=null&&$n.success)){if(console.warn("INFO API RESPONSE:",$n==null?void 0:$n.error_message),($n==null?void 0:$n.error_message)==="You have not a running process"){const Bn=Y?Y.toLowerCase().replace("-","_"):null,_r=L==null?void 0:L[Bn];if(Bn&&_r){const sr={...L,[Bn]:{..._r,isStop:!0}};z(sr);const Rr=Object.keys(sr).filter(Jr=>Jr.startsWith("pacifica"));if(Rr.length>0&&!Y){const ls=Rr.sort((et,yt)=>{var Ar,Br;const Tn=parseInt(((Ar=et.match(/\d+/))==null?void 0:Ar[0])||0,10),tr=parseInt(((Br=yt.match(/\d+/))==null?void 0:Br[0])||0,10);return Tn-tr})[0].match(/\d+/);ls&&ie(`Pacifica-${ls[0]}`)}}else ie("Pacifica-1")}$n!=null&&$n.slots_info&&(U((Oe=(Xe=$n==null?void 0:$n.slots_info)==null?void 0:Xe.pacifica)==null?void 0:Oe.total_qty),R((kt=(bt=$n==null?void 0:$n.slots_info)==null?void 0:bt.pacifica)==null?void 0:kt.active_qty));return}if($n!=null&&$n.success&&($n!=null&&$n.data)){const Bn=Y?Y.toLowerCase().replace("-","_"):null,_r=L==null?void 0:L[Bn],sr=$n.data||{};Bn&&!sr[Bn]&&_r&&(sr[Bn]={..._r,isStop:!0}),z(sr);const Rr=Object.keys(sr).filter(Jr=>Jr.startsWith("pacifica"));if(Rr.length>0&&!Y){const ls=Rr.sort((et,yt)=>{var Ar,Br;const Tn=parseInt(((Ar=et.match(/\d+/))==null?void 0:Ar[0])||0,10),tr=parseInt(((Br=yt.match(/\d+/))==null?void 0:Br[0])||0,10);return Tn-tr})[0].match(/\d+/);ls&&ie(`Pacifica-${ls[0]}`)}$n!=null&&$n.slots_info&&(U((fn=(Ut=$n==null?void 0:$n.slots_info)==null?void 0:Ut.pacifica)==null?void 0:fn.total_qty),R((Sn=(On=$n==null?void 0:$n.slots_info)==null?void 0:On.pacifica)==null?void 0:Sn.active_qty))}}catch{C(!1),Ee(),G("OFF")}finally{zt(!1)}}const _=m.useMemo(()=>Y?Y.toLowerCase().replace("-","_"):"",[Y]),k=!!((gt=L==null?void 0:L[_])!=null&>.delta)&&!!((Xt=L==null?void 0:L[_])!=null&&Xt.from_slot),T=k?`pacifica_${(wt=L==null?void 0:L[_])==null?void 0:wt.from_slot}`:_;m.useEffect(()=>{var bt,kt,Ut,fn,On,Sn,yr,Pn,En,$n;if(!Y||!L)return;const Xe=T,Oe=L==null?void 0:L[Xe];if(!Oe){ee(""),je(""),$e(""),ft(""),qt(""),nn("LONG"),cn("LIMIT"),C(!1),G("OFF"),an("Hour"),Ft(""),Bt(""),X("pacifica");return}if((Oe==null?void 0:Oe.target_params)==null&&Oe.source_params){Oe!=null&&Oe.isStop?C(!1):C(!0),G("OFF");const Bn=Oe.source_params,_r=(Oe==null?void 0:Oe.slot_number)??"";_r&&!k&&ie(`Pacifica-${_r}`),Bn!=null&&Bn.cycleSeconds&&an((Bn==null?void 0:Bn.cycleSeconds)===86400?"Day":"Hour");const sr=(Bn==null?void 0:Bn.agent_pkey)??"",rr=(Bn==null?void 0:Bn.login_address)??"";if(sr&&ee(String(sr)),rr&&je(String(rr)),Bn!=null&&Bn.coin){const Rr=String(Bn.coin);$e(Rr)}(Bn==null?void 0:Bn.orderPerHour)!=null&&ft(String(Bn.orderPerHour)),(Bn==null?void 0:Bn.leverage)!=null&&qt(String(Bn.leverage)),Bn!=null&&Bn.direction&&nn(String(Bn.direction).toUpperCase()==="SHORT"?"SHORT":String(Bn.direction).toUpperCase()==="RANDOM"?"RANDOM":"LONG"),Bn!=null&&Bn.orderType&&cn(String(Bn.orderType).toUpperCase()==="MARKET"?"MARKET":String(Bn.orderType).toUpperCase()==="LIMIT"?"LIMIT":"HYBRID"),(Bn==null?void 0:Bn.tp)!=null&&Ft(String(Bn.tp)),(Bn==null?void 0:Bn.sl)!=null&&Bt(String(Bn.sl))}else if((Oe==null?void 0:Oe.target_params)!==null){Oe!=null&&Oe.isStop?C(!1):C(!0),G("OFF");const Bn=(Oe==null?void 0:Oe.slot_number)??"";Bn&&!k&&ie(`Pacifica-${Bn}`),(bt=Oe==null?void 0:Oe.source_params)!=null&&bt.coin&&$e(String((kt=Oe==null?void 0:Oe.source_params)==null?void 0:kt.coin)),((Ut=Oe==null?void 0:Oe.source_params)==null?void 0:Ut.orderPerHour)!=null&&ft(String((fn=Oe==null?void 0:Oe.source_params)==null?void 0:fn.orderPerHour)),((On=Oe==null?void 0:Oe.source_params)==null?void 0:On.leverage)!=null&&qt(String((Sn=Oe==null?void 0:Oe.source_params)==null?void 0:Sn.leverage)),(yr=Oe==null?void 0:Oe.source_params)!=null&&yr.accountType&&setStatusType(((Pn=Oe==null?void 0:Oe.source_params)==null?void 0:Pn.accountType)==="standart"?"STANDARD":"PREMIUM"),(En=Oe==null?void 0:Oe.target_params)!=null&&En.accountType&&setStatusTypeTwo((($n=Oe==null?void 0:Oe.target_params)==null?void 0:$n.accountType)==="standart"?"STANDARD":"PREMIUM"),Oe!=null&&Oe.target_app&&X(((Oe==null?void 0:Oe.target_app)==="pacifica","pacifica"))}else C(!1),G("OFF")},[Y,L,k,T]);const B=Xe=>{var Oe;return Number(((Oe=String(Xe||"").match(/\d+/))==null?void 0:Oe[0])||0)},q=Xe=>(Xe||"").toLowerCase().replace("-","_"),te=m.useMemo(()=>{const Xe=L==null?void 0:L[q(Y)];if(Xe!=null&&Xe.delta&&(Xe!=null&&Xe.from_slot))return Number(Xe.from_slot);const Oe=Number(Xe==null?void 0:Xe.slot_number);return Number.isFinite(Oe)?Oe:B(Y)},[Y,L]),ue=m.useMemo(()=>{const Xe=Number(N)||0,Oe=Array.from({length:Xe},()=>({used:!1,kind:null})),bt=L||{};for(const[kt,Ut]of Object.entries(bt)){if(!kt.startsWith("pacifica"))continue;const fn=B(kt)-1;fn<0||fn>=Xe||((Ut==null?void 0:Ut.isStop)===!0?Oe[fn]={used:!1,kind:null}:Ut!=null&&Ut.source_params?Oe[fn]={used:!0,kind:"delta-src"}:Ut!=null&&Ut.target_params||Ut!=null&&Ut.delta?Oe[fn]={used:!0,kind:"delta-shadow"}:Ut!=null&&Ut.farming_params?Oe[fn]={used:!0,kind:"single"}:Oe[fn]={used:!0,kind:"unknown"})}return Oe},[L,N]),de=m.useMemo(()=>ue.map((Xe,Oe)=>Xe.used&&Xe.kind!=="delta-src-inferred"?`Pacifica-${Oe+1}`:null).filter(Boolean),[ue]);m.useMemo(()=>ue.filter(Xe=>!Xe.used).length,[ue]);async function xe(){if(!g){n(!0);return}if(Jn)try{nt(!0),at("");const Xe=window.localStorage.getItem("hyperToken"),Oe=window.localStorage.getItem("hyperAddress");if(!Xe||!Oe){n(!0);return}const bt={login_address:ve,agent_pkey:V,cycleSeconds:en==="Hour"?3600:86400,tp:Number(un),sl:Number(Ke),coin:`${Qe}`,orderPerHour:Number(lt),leverage:Number(ut),direction:It,orderType:jt},kt={api_pkey:ae,login_wallet:Ie,coin:Qe==null?void 0:Qe.replace("USDT",""),orderPerHour:Number(lt),leverage:Number(ut)},Ut={address:Oe.toLowerCase(),token:Xe,slot_number:Number(Y==null?void 0:Y.replace("Pacifica-","")),source_app:"pacifica",source_params:bt},On=await(await fetch(`${Nt}/api/hyper/farming_app/save/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Ut)})).json();On!=null&&On.success?(C(!0),S(),Tt&&h()):at((On==null?void 0:On.error_message)||"Start failed.")}catch(Xe){at(Xe.message||"An error occurred while saving.")}finally{nt(!1)}}async function Se(){if(!g){n(!0);return}try{Rt(!0),at("");const Xe=window.localStorage.getItem("hyperToken"),Oe=window.localStorage.getItem("hyperAddress");if(!Xe||!Oe){n(!0);return}const kt=await(await fetch(`${Nt}/api/hyper/farming_app/stop/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({address:Oe.toLowerCase(),token:Xe,source_app:"pacifica",slot_number:te})})).json();kt!=null&&kt.success?(C(!1),S()):at((kt==null?void 0:kt.error_message)||"Stop failed.")}catch(Xe){at(Xe.message||"An error occurred while stopping.")}finally{Rt(!1)}}const ke={control:(Xe,Oe)=>({...Xe,backgroundColor:"#242424",borderColor:Oe.isFocused?"#67FFBD":"#353535",minHeight:32,height:32,boxShadow:"none",cursor:"pointer",alignItems:"center"}),valueContainer:Xe=>({...Xe,height:32,paddingTop:0,paddingBottom:0,display:"flex",alignItems:"center"}),indicatorsContainer:Xe=>({...Xe,height:32}),input:Xe=>({...Xe,color:"#FFFFFF",margin:0,padding:0}),singleValue:Xe=>({...Xe,color:"#FFFFFF",margin:0,lineHeight:"normal",fontSize:"12px",display:"flex",alignItems:"center"}),placeholder:Xe=>({...Xe,color:"#7F7F7F",fontSize:"12px"}),menu:Xe=>({...Xe,backgroundColor:"#242424",border:"1px solid #353535",zIndex:9999}),menuList:Xe=>({...Xe,paddingTop:0,paddingBottom:0,maxHeight:200}),option:(Xe,Oe)=>({...Xe,backgroundColor:Oe.isFocused?"#2e2e2e":"#242424",color:"#FFFFFF",cursor:"pointer",minHeight:32,display:"flex",alignItems:"center",fontSize:"12px"}),dropdownIndicator:Xe=>({...Xe,color:"#9B9B9B",paddingTop:4,paddingBottom:4}),indicatorSeparator:Xe=>({...Xe,backgroundColor:"#353535"})},Re=({max:Xe})=>i.jsxs("span",{className:"inline-flex items-center h-4 px-1.5 py-2 rounded bg-black/40 border border-[#2A2A2A] text-[10px] text-[#CECECE] font-bold",children:[Xe,"x"]}),Ge=Xe=>{var Oe;return i.jsx(Ca.Option,{...Xe,children:i.jsxs("div",{className:"flex items-center gap-2 px-3",children:[(Oe=Xe.data)!=null&&Oe.icon?i.jsx("img",{src:Xe.data.icon,alt:Xe.data.label,className:"w-4 h-4 rounded-[4px]",onError:bt=>bt.currentTarget.style.display="none"}):i.jsx("div",{className:"rounded-full w-4 h-4 min-w-4 min-h-4 bg-[#4F4F4F] flex items-center justify-center",children:i.jsx("span",{className:"text-white text-xs"})}),i.jsx("span",{className:"text-white text-[13px]",children:Xe.data.label}),i.jsx(Re,{max:Xe.data.maxLeverage})]})})},Fe=Xe=>{var Oe;return i.jsx(Ca.SingleValue,{...Xe,children:i.jsxs("div",{className:"flex items-center gap-2",children:[(Oe=Xe.data)!=null&&Oe.icon?i.jsx("img",{src:Xe.data.icon,alt:Xe.data.label,className:"w-4 h-4 rounded-[4px]",onError:bt=>bt.currentTarget.style.display="none"}):i.jsx("div",{className:"rounded-full w-4 h-4 min-w-4 min-h-4 bg-[#4F4F4F] flex items-center justify-center",children:i.jsx("span",{className:"text-white text-xs"})}),i.jsx("span",{className:"text-white text-[13px]",children:Xe.data.label}),i.jsx(Re,{max:Xe.data.maxLeverage})]})})},st=Xe=>{const Oe=de.includes(Xe.data.value);return i.jsx(Ca.Option,{...Xe,children:i.jsxs("div",{className:"flex items-center gap-2 px-3",children:[i.jsx("span",{className:"text-white text-[13px]",children:Xe.data.label}),Oe&&i.jsx("span",{className:"ml-auto w-2 h-2 rounded-full bg-[#67FFBD]",title:"Active"})]})})},se=Xe=>i.jsx(Ca.SingleValue,{...Xe,children:i.jsx("div",{className:"flex items-center gap-2 px-3",children:i.jsx("span",{className:"text-white text-[13px]",children:Xe.data.label})})}),Ce=async()=>{var bt,kt,Ut,fn,On,Sn,yr,Pn;const Xe=window.localStorage.getItem("hyperToken"),Oe=window.localStorage.getItem("hyperAddress");if(!(!Xe||!Oe))try{ht(!0);const En=await Ei(Oe.toLowerCase(),Xe);En!=null&&En.success?(r(En==null?void 0:En.telegram_chat_id),s(En==null?void 0:En.subscriber_role),a(En==null?void 0:En.subs_expire_day),o((bt=En==null?void 0:En.mushboomer_counts)==null?void 0:bt.eth),l((kt=En==null?void 0:En.mushboomer_counts)==null?void 0:kt.sol),c(En==null?void 0:En.referral_code),u(En==null?void 0:En.refcode),d(En==null?void 0:En.whitelist),f(Xe),x(Oe),Me(!0),P((fn=(Ut=En==null?void 0:En.slots_info)==null?void 0:Ut.pacifica)==null?void 0:fn.total_qty),U((Sn=(On=En==null?void 0:En.slots_info)==null?void 0:On.pacifica)==null?void 0:Sn.total_qty),R((Pn=(yr=En==null?void 0:En.slots_info)==null?void 0:yr.pacifica)==null?void 0:Pn.active_qty),ht(!1)):(window.localStorage.removeItem("hyperToken"),window.localStorage.removeItem("hyperAddress"),f(""),x(""),ht(!1))}catch(En){console.error("Token verification error:",En),console.error(En.message||"An unknown error occurred."),ht(!1)}},Be=it,De=m.useMemo(()=>Array.from({length:N},(Xe,Oe)=>({value:`Pacifica-${Oe+1}`,label:`Pacifica-${Oe+1}`})),[N]);if(!e)return null;const _e=Zt||Et||Ue||Ye,Je=w&&!Ue,ct=xn(Qe);return i.jsxs(i.Fragment,{children:[i.jsx(bd,{open:Gn,setOpen:Dn,transactionHash:Kn,transactionLoading:yn,paymentPresaleRole:sn,errorFunds:mt,activeMethod:2}),i.jsx(m5,{open:re,setOpen:pe,paymentLighterRole:sn,oldSlotCount:Q,checkAccountLighter:Ce,tradeMarket:"pacifica"}),i.jsxs("div",{className:"fixed inset-0 z-[9000] flex items-center justify-center",children:[i.jsx("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-[2px]",onClick:()=>!_e&&t(!1)}),i.jsxs("div",{className:"relative flex items-start gap-4 px-3 w-full max-w-[1000px]",children:[i.jsx(f2,{current:"pacifica",onCloseCurrent:()=>!_e&&t(!1)}),i.jsxs("div",{className:"relative w-[680px] max-w-[92vw] rounded-3xl bg-[#1B1B1B] text-white shadow-xl border border-[#F8D4AB] max-h-[97dvh] overflow-y-auto",children:[i.jsxs("div",{className:"pb-2 px-5 pt-3 border-b border-[#353535] rounded-t-3xl relative",children:[i.jsxs("div",{className:"flex justify-start items-center gap-3",children:[i.jsx("img",{src:"https://app.pacifica.fi/imgs/logo.svg",alt:"",className:"h-9"}),i.jsx("span",{className:"text-[24px] font-semibold text-[#e87859] mt-1",children:"farming"})]}),i.jsxs("div",{className:"flex justify-between items-center gap-4",children:[i.jsx("div",{className:"text-xs font-normal text-[#7C7C7C] mt-2",children:"Pacifica Farming module lets you set up automated farming by providing your Pacifica Address, Pacifica Private Key, selecting a pair, defining trade per hour, leverage, direction, order type, take profit and stop loss."}),i.jsx("div",{className:"flex flex-col items- justify-start gap-1 relative",children:i.jsx("div",{className:"text-xs font-semibold text-[#7C7C7C] mt-2",children:i.jsxs("div",{onClick:()=>window.open("https://docs.dextrabot.com/farm/pacifica-farming-module#getting-your-api-credentials","_blank"),className:"h-6 sm:h-7 w-max py-[5px] rounded-[256px] flex justify-start items-center gap-2 cursor-pointer border border-[#353535] px-4 bg-[#242424] hover:bg-[#2e2e2e]",children:[i.jsx("img",{src:l5,className:"w-[14px] h-[14px]"}),i.jsx("div",{className:"min-w-max text-white text-xs font-medium font-manrope leading-none pointer-events-none",children:"Docs"})]})})})]})]}),i.jsxs("div",{className:"pb-2 space-y-3 pt-2 px-5",children:[We&&i.jsx("div",{className:"text-[12px] text-[#FF797C] bg-[#3b2626] border border-[#ff797c]/30 rounded-md px-3 py-2",children:We}),g&&sn&&F===I&&i.jsx("div",{className:"text-[12px] text-[#FF797C] bg-[#3b2626] border border-[#ff797c]/30 rounded-md px-3 py-2",children:"No free Pacifica slots."}),g&&sn&&i.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4 px-4 sm:px-5",children:i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex items-center justify-between text-[13px] text-[#7C7C7C] font-semibold",children:[i.jsx("span",{className:"pl-[2px]",children:"Slot"}),i.jsxs("div",{className:"flex items-center gap-1",children:[i.jsx(s5,{className:"w-3 h-3 text-[#67FFBD] fill-[#67FFBD]"}),i.jsxs("span",{className:"text-[#67FFBD] font-medium",children:[I||0,"/",De.length]})]})]}),i.jsx(Cl,{styles:ke,components:{Option:st,SingleValue:se},options:De,value:De.find(Xe=>Xe.value===Y)||null,onChange:Xe=>ie((Xe==null?void 0:Xe.value)??""),placeholder:"Select",isSearchable:!0})]})}),i.jsxs("div",{className:`${oe==="ON"?"py-1":"py-5"} space-y-3 px-3 sm:px-5`,children:[i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[oe==="ON"?i.jsxs("div",{className:"col-span-1 space-y-4 border border-[#6f604d] hover:border-[#F8D4AB]/70 rounded-lg p-2.5",children:[i.jsx("div",{className:"flex items-center justify-between border-b border-[#353535] pb-2 mb-3",children:i.jsx("span",{className:"text-[13px] font-semibold text-[#F8D4AB]",children:"API - 1"})}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"flex items-center justify-between",children:i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"1st Stark Key Public"})}),i.jsx("div",{className:"relative",children:i.jsx("input",{value:ve,onChange:Xe=>je(Xe.target.value),autoComplete:"off",placeholder:"1st Stark Key Public ",type:"text",className:`w-full h-8 px-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${ve===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:_e||Je})})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"API Private Key"}),i.jsx("a",{href:"https://docs.dextrabot.com/farm/pacifica-farming-module#getting-your-api-credentials",target:"_blank",rel:"noopener noreferrer",className:"text-[11px] underline text-[#F8D4AB] hover:text-[#eee0d0]",children:"How to get API Private key?"})]}),i.jsxs("div",{className:"relative",children:[i.jsx("input",{value:V,onChange:Xe=>ee(Xe.target.value),autoComplete:"off",placeholder:"API_PRIVATE_KEY",type:on?"text":"password",className:`w-full h-8 pl-3 pr-16 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${V===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:_e||Je}),i.jsx("button",{type:"button",onClick:()=>gn(Xe=>!Xe),className:"absolute right-1 top-1/2 -translate-y-1/2 text-[11px] text-[#9B9B9B] hover:text-white h-6 flex justify-center items-center hover:border-none hover:ring-0 focus:outline-none focus:border-none bg-transparent",disabled:_e||Je,children:on?i.jsx(la,{size:14}):i.jsx(ca,{size:14})})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"API Key Index"}),i.jsx("div",{className:"relative",children:i.jsx("input",{value:Ne,onChange:Xe=>{const Oe=Xe.target.value.trim();if(Oe==="")return he("");In(Oe)&&he(Oe)},onKeyDown:Mt,inputMode:"numeric",autoComplete:"off",placeholder:"API_KEY_INDEX",className:`w-full h-8 px-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${Ne===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:_e||Je})})]})]}):i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"flex items-center justify-between",children:i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Login Wallet Address"})}),i.jsx("div",{className:"relative",children:i.jsx("input",{value:ve,onChange:Xe=>je(Xe.target.value),autoComplete:"off",placeholder:"LOGIN_WALLET_ADDRESS",type:"text",className:`w-full h-8 px-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${ve===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:_e||Je})})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"API Private Key"}),i.jsx("a",{href:"https://docs.dextrabot.com/farm/pacifica-farming-module#getting-your-api-credentials",target:"_blank",rel:"noopener noreferrer",className:"text-[11px] underline text-[#F8D4AB] hover:text-[#eee0d0]",children:"How to get Pacifica Private Key?"})]}),i.jsxs("div",{className:"relative",children:[i.jsx("input",{value:V,onChange:Xe=>ee(Xe.target.value),autoComplete:"off",placeholder:"PACIFICA_PRIVATE_KEY",type:on?"text":"password",className:`w-full h-8 pl-3 pr-16 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${V===""?"border-[#353535]":lr?"border-[#353535] focus:border-[#67FFBD]":"border-[#FF797C]"}`,disabled:_e||Je}),i.jsx("button",{type:"button",onClick:()=>gn(Xe=>!Xe),className:"absolute right-1 top-1/2 -translate-y-1/2 text-[11px] text-[#9B9B9B] hover:text-white h-6 flex justify-center items-center hover:border-none hover:ring-0 focus:outline-none focus:border-none bg-transparent",disabled:_e||Je,children:on?i.jsx(la,{size:14}):i.jsx(ca,{size:14})})]}),V!==""&&!lr&&i.jsx("div",{className:"text-[#FF797C] text-[11px]",children:"Please enter a valid private key."})]})]}),oe==="ON"&&i.jsxs("div",{className:"col-span-1 space-y-4 border border-[#6f604d] hover:border-[#F8D4AB]/70 rounded-lg p-2.5",children:[i.jsx("div",{className:"flex items-center justify-between border-b border-[#353535] pb-2 mb-3",children:i.jsx("span",{className:"text-[13px] font-semibold text-[#F8D4AB]",children:"API - 2"})}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"flex items-center justify-between",children:i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"2nd Stark key Public"})}),i.jsx("div",{className:"relative",children:i.jsx("input",{value:Ie,onChange:Xe=>Le(Xe.target.value),autoComplete:"off",placeholder:"2nd Stark key Public",type:"text",className:`w-full h-8 px-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${Ie===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:_e||Je})})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"API Private Key 2"}),i.jsx("a",{href:"https://docs.dextrabot.com/farm/pacifica-farming-module#getting-your-api-credentials",target:"_blank",rel:"noopener noreferrer",className:"text-[11px] underline text-[#F8D4AB] hover:text-[#eee0d0]",children:"How to get API Private key?"})]}),i.jsxs("div",{className:"relative",children:[i.jsx("input",{value:ae,onChange:Xe=>fe(Xe.target.value),autoComplete:"off",placeholder:"API_PRIVATE_KEY_2",type:Nn?"text":"password",className:`w-full h-8 pl-3 pr-16 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${ae===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:_e||Je}),i.jsx("button",{type:"button",onClick:()=>kn(Xe=>!Xe),className:"absolute right-1 top-1/2 -translate-y-1/2 text-[11px] text-[#9B9B9B] hover:text-white h-6 flex justify-center items-center hover:border-none hover:ring-0 focus:outline-none focus:border-none bg-transparent",disabled:_e||Je,children:Nn?i.jsx(la,{size:14}):i.jsx(ca,{size:14})})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"API Key Index 2"}),i.jsx("div",{className:"relative",children:i.jsx("input",{value:ge,onChange:Xe=>{const Oe=Xe.target.value.trim();if(Oe==="")return ye("");In(Oe)&&ye(Oe)},onKeyDown:Mt,inputMode:"numeric",autoComplete:"off",placeholder:"API_KEY_INDEX_2",className:`w-full h-8 px-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${ge===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:_e||Je})})]})]})]}),V!==""&&!lr&&i.jsx("div",{children:i.jsx("img",{src:$yt,alt:"",className:"mt-4 rounded-md w-full"})}),i.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:i.jsxs("div",{className:`${oe==="ON"?"":"hidden"} space-y-2`,children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Trade Per Hour"}),i.jsx("input",{value:lt,onChange:Xe=>{const Oe=Xe.target.value.trim();if(Oe==="")return ft("");In(Oe)&&ft(Oe)},onKeyDown:Mt,inputMode:"numeric",autoComplete:"off",placeholder:"e.g. 10 (max 180)",className:`w-full h-8 px-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${lt===""?"border-[#353535]":Xn?"border-[#353535] focus:border-[#67FFBD]":"border-[#FF797C]"}`,disabled:_e||Je}),lt!==""&&!Xn&&i.jsx("div",{className:"text-[#FF797C] text-[12px]",children:"Enter an integer between 1 and 180."})]})}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Select Pair"}),i.jsx(Cl,{styles:ke,components:{Option:Ge,SingleValue:Fe},isDisabled:_e||Je,options:Be,value:Be.find(Xe=>Xe.value===Qe)||null,onChange:Xe=>$e((Xe==null?void 0:Xe.value)??""),placeholder:"Select",isSearchable:!0})]}),i.jsxs("div",{className:`${oe==="ON"?"hidden":""} space-y-1`,children:[i.jsxs("div",{className:"flex justify-start items-center gap-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Trade Per"}),i.jsxs("select",{value:en,onChange:Xe=>an(Xe.target.value),className:`${_e||Je?"cursor-not-allowed":"cursor-pointer"} h-6 text-[12px] bg-[#242424] border border-[#353535] rounded-md px-2 text-white outline-none font-bold font-manrope`,disabled:_e||Je,children:[i.jsx("option",{value:"Hour",children:"Hour"}),i.jsx("option",{value:"Day",children:"Day"})]})]}),i.jsx("input",{value:lt,onChange:Xe=>{const Oe=Xe.target.value.trim();if(Oe==="")return ft("");In(Oe)&&ft(Oe)},onKeyDown:Mt,inputMode:"numeric",autoComplete:"off",placeholder:"e.g. 10 (max 180)",className:`w-full h-8 px-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${lt===""?"border-[#353535]":Xn?"border-[#353535] focus:border-[#67FFBD]":"border-[#FF797C]"}`,disabled:_e||Je}),lt!==""&&!Xn&&i.jsx("div",{className:"text-[#FF797C] text-[12px]",children:"Enter an integer between 1 and 180."})]})]}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[i.jsxs("div",{className:`${oe==="ON"?"":"hidden"} space-y-2`,children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Delta Neutral"}),i.jsxs("div",{className:"flex justify-between w-full items-center gap-2 border border-[#353535] bg-[#242424] p-1 rounded-md px-2 h-8",children:[i.jsx("span",{className:"text-white font-inter text-[13px] font-medium leading-[8px] tracking-[-0.26px]",children:oe==="ON"?"On":"Off"}),i.jsx(Eo,{checked:oe==="ON",onChange:Xe=>G(Xe?"ON":"OFF"),disabled:_e||Je,className:`${oe==="ON"?"bg-[#1DE674]":"bg-white/10"} relative inline-flex h-5 w-9 items-center rounded-full p-1 transition-colors duration-200 ease-in-out ${_e||Je?"opacity-50 cursor-not-allowed":"cursor-pointer"}`,children:i.jsx("span",{"aria-hidden":"true",className:`inline-block h-4 w-4 transform rounded-full bg-white shadow-lg transition duration-200 ease-in-out ${oe==="ON"?"translate-x-3":"translate-x-0"}`})})]})]}),i.jsxs("div",{className:" space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Leverage"}),i.jsx("input",{value:ut,onChange:Xe=>{const Oe=Xe.target.value.trim();if(Oe==="")return qt("");In(Oe)&&qt(Oe)},onKeyDown:Mt,inputMode:"numeric",autoComplete:"off",placeholder:Qe?`1–${ct}x`:"e.g. 3",className:`w-full h-8 px-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${ut===""?"border-[#353535]":or?"border-[#353535] focus:border-[#67FFBD]":"border-[#FF797C]"}`,disabled:_e||Je})]})]}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[i.jsxs("div",{className:`${oe==="ON"?"hidden":""} space-y-2`,children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Direction"}),i.jsxs("div",{className:"flex items-center gap-2 md:pr-6",children:[i.jsx("div",{"aria-pressed":It==="LONG",onClick:()=>!Je&&nn("LONG"),className:["inline-flex justify-center items-center gap-1.5 h-6 rounded-[8px] uppercase tracking-wide font-semibold transition-all border w-1/2","text-[8.5px] px-1",_e||Je?"cursor-not-allowed":"cursor-pointer",It==="LONG"?"bg-[#67FFBD] text-black border-[#67FFBD] shadow-[0_0_0_3px_rgba(103,255,189,0.25)]":"text-[#67FFBD] bg-[#67FFBD]/15 border-[#2A2A2A] hover:bg-[#67FFBD]/25"].join(" "),children:i.jsxs("span",{className:"min-w-max",children:["LONG",ut?` - ${ut}x`:""]})}),i.jsx("div",{"aria-pressed":It==="SHORT",onClick:()=>!Je&&nn("SHORT"),className:["inline-flex justify-center items-center gap-1.5 h-6 rounded-[8px] uppercase tracking-wide font-semibold transition-all border w-1/2","text-[8.5px] px-1",_e||Je?"cursor-not-allowed":"cursor-pointer",It==="SHORT"?"bg-[#FF797C] text-black border-[#FF797C] shadow-[0_0_0_3px_rgba(255,121,124,0.25)]":"text-[#FF787B] bg-[#FF797C]/20 border-[#2A2A2A] hover:bg-[#FF797C]/30"].join(" "),children:i.jsxs("span",{className:"min-w-max",children:["SHORT",ut?` - ${ut}x`:""]})}),i.jsx("div",{"aria-pressed":It==="RANDOM",onClick:()=>!Je&&nn("RANDOM"),className:["inline-flex justify-center items-center gap-1.5 h-6 rounded-[8px] uppercase tracking-wide font-semibold transition-all border w-1/2","text-[8.5px] px-1",_e||Je?"cursor-not-allowed":"cursor-pointer",It==="RANDOM"?"bg-[#3b82f6] text-[#ffffff] border-[#93c5fd] shadow-[0_0_0_3px_rgba(59,130,246,0.3)]":"text-[#3b82f6] bg-[rgba(59,130,246,0.15)] border-[rgba(59,130,246,0.15)] hover:bg-[#2563eb] hover:text-white"].join(" "),children:i.jsxs("span",{className:"min-w-max",children:["RANDOM",ut?` - ${ut}x`:""]})})]})]}),i.jsxs("div",{className:`${oe==="ON"?"hidden":""} space-y-2`,children:[i.jsx("div",{className:"flex items-center gap-2 text-[13px] text-[#7C7C7C] font-semibold",children:i.jsx("span",{children:"Order Type"})}),i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("button",{"aria-pressed":jt==="LIMIT",onClick:()=>!Je&&cn("LIMIT"),className:["inline-flex flex-col justify-center items-center h-6 px-2 rounded-[8px] uppercase tracking-wide text-[8.5px] font-semibold transition-all border w-1/2",_e||Je?"cursor-not-allowed":"cursor-pointer",jt==="LIMIT"?"bg-[#8e643a] text-white border-[#44382C]":"text-[#7C7C7C] bg-transparent border-[#404040] hover:bg-[#404040]/25 hover:text-white"].join(" "),children:i.jsxs("span",{children:["LIMIT ",jt==="LIMIT"?" ✓":""]})}),i.jsx("button",{"aria-pressed":jt==="HYBRID",onClick:()=>!Je&&cn("HYBRID"),className:["inline-flex flex-col justify-center items-center h-6 px-1 rounded-[8px] uppercase tracking-wide text-[8.5px] font-semibold transition-all border w-1/2",_e||Je?"cursor-not-allowed":"cursor-pointer",jt==="HYBRID"?"bg-[#8e643a] text-white border-[#44382C]":"text-[#7C7C7C] bg-transparent border-[#404040] hover:bg-[#404040]/25 hover:text-white"].join(" "),children:i.jsxs("span",{children:["HYBRID ",jt==="HYBRID"?" ✓":""]})}),i.jsx("button",{"aria-pressed":jt==="MARKET",onClick:()=>!Je&&cn("MARKET"),className:["inline-flex flex-col justify-center items-center h-6 px-1 rounded-[8px] uppercase tracking-wide text-[8.5px] font-semibold transition-all border w-1/2",_e||Je?"cursor-not-allowed":"cursor-pointer",jt==="MARKET"?"bg-[#8e643a] text-white border-[#44382C]":"text-[#7C7C7C] bg-transparent border-[#404040] hover:bg-[#404040]/25 hover:text-white"].join(" "),children:i.jsxs("span",{children:["MARKET ",jt==="MARKET"?" ✓":""]})})]})]})]}),i.jsxs("div",{className:`${oe==="ON"?"hidden":""} grid grid-cols-1 md:grid-cols-2 gap-4`,children:[i.jsxs("div",{className:`${oe==="ON"?"hidden":""} space-y-2`,children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Take Profit %"}),i.jsxs("div",{className:"relative",children:[i.jsx("span",{className:"absolute left-2 top-1/2 -translate-y-1/2 text-[#7F7F7F] font-semibold",children:"%"}),i.jsx("input",{value:un,onChange:Xe=>{const Oe=Xe.target.value.trim();if(Oe==="")return Ft("");tn(Oe)&&Ft(Oe)},onKeyDown:Mt,inputMode:"decimal",autoComplete:"off",placeholder:"e.g. 5",className:`w-full h-8 pl-7 pr-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${un===""?"border-[#353535]":Qt?"border-[#353535] focus:border-[#67FFBD]":"border-[#FF797C]"}`,disabled:_e||Je})]}),un!==""&&!Qt&&i.jsx("div",{className:"text-[#FF797C] text-[11px]",children:"Value must be 0, or between 1 and 10000000. Numbers between 0 and 1 are not allowed."})]}),i.jsxs("div",{className:`${oe==="ON"?"hidden":""} space-y-2`,children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Stop Loss %"}),i.jsxs("div",{className:"relative",children:[i.jsx("span",{className:"absolute left-2 top-1/2 -translate-y-1/2 text-[#7F7F7F] font-semibold",children:"%"}),i.jsx("input",{value:Ke,onChange:Xe=>{const Oe=Xe.target.value.trim();if(Oe==="")return Bt("");tn(Oe)&&Bt(Oe)},onKeyDown:Mt,inputMode:"decimal",autoComplete:"off",placeholder:"e.g. 5",className:`w-full h-8 pl-7 pr-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${Ke===""?"border-[#353535]":zn?"border-[#353535] focus:border-[#67FFBD]":"border-[#FF797C]"}`,disabled:_e||Je})]}),Ke!==""&&!zn&&i.jsxs("div",{className:"text-[#FF797C] text-[11px]",children:["Value must be 0, or between 1 and"," ",ut?Math.max(ut*100-1,0):4999,". Numbers between 0 and 1 are not allowed."]})]})]}),!1]}),i.jsx("div",{className:`${oe==="ON"?"py-3":"py-6"} flex items-center gap-3 px-5 border-t border-[#353535] bg-[rgba(27,27,27,0.32)] rounded-b-3xl`,children:i.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[i.jsx("button",{onClick:()=>!_e&&t(!1),className:"inline-flex items-center justify-center h-8 px-5 rounded-[10px] border bg-black/5 border-[#353535] text-white text-[13px] hover:border-white disabled:opacity-60",disabled:_e,children:"Cancel"}),g?oe==="ON"?w?i.jsx("button",{onClick:Se,disabled:_e,className:"inline-flex items-center justify-center h-8 px-6 rounded-[10px] text-[13px] border border-[#353535] hover:border-[#FF797C] text-[#FF797C] bg-[rgba(27,27,27,0.32)] disabled:opacity-60",children:Ue?"Stopping...":"Stop"}):i.jsx("button",{onClick:xe,disabled:!Jn||_e,className:`inline-flex items-center justify-center h-8 px-6 rounded-[10px] text-[13px] border ${!Jn||_e?"bg-[#2a2a2a] border-[#3a3a3a] opacity-60 cursor-not-allowed":"bg-[#7446FF] border-[#8861FF] hover:bg-[#5834C3]"}`,children:Et?"Starting...":"Start"}):w?i.jsx("button",{onClick:Se,disabled:_e,className:"inline-flex items-center justify-center h-8 px-6 rounded-[10px] text-[13px] border border-[#353535] hover:border-[#FF797C] text-[#FF797C] bg-[rgba(27,27,27,0.32)] disabled:opacity-60",children:Ue?"Stopping...":"Stop"}):i.jsx("button",{onClick:xe,disabled:!Jn||_e,className:`inline-flex items-center justify-center h-8 px-6 rounded-[10px] text-[13px] border ${!Jn||_e?"bg-[#2a2a2a] border-[#3a3a3a] opacity-60 cursor-not-allowed":"bg-[#7446FF] border-[#8861FF] hover:bg-[#5834C3]"}`,children:Et?"Starting...":"Start"}):i.jsx("button",{onClick:()=>n(!0),className:"inline-flex items-center justify-center h-8 px-6 rounded-[10px] text-[13px] border bg-[#67FFBD] border-[#67FFBD] text-black hover:opacity-90",children:"Connect"})]})}),Zt&&i.jsx("div",{className:"absolute inset-0 rounded-3xl bg-black/40 flex items-center justify-center text-sm",children:"Loading..."})]})]})]})]})]})},eIt=()=>{const[e,t]=m.useState(!1),[n,r]=m.useState(!1),[s,a]=m.useState(2),[o,l]=m.useState(!1),[c,u]=m.useState(!1),[d,f]=m.useState(!1),[x,g]=m.useState(!1),[v,w]=m.useState(!1),[C,N]=m.useState(!1),P=(I=[])=>I==null?void 0:I.map(R=>R.submenu?{...R,submenu:P(R.submenu)}:R.action==="openAster"?{...R,onClick:()=>{a(2),r(!0)}}:R.action==="openFarm"?{...R,onClick:()=>t(!0)}:R.action==="openLighter"?{...R,onClick:()=>l(!0)}:R.action==="openApex"?{...R,onClick:()=>u(!0)}:R.action==="openVariational"?{...R,onClick:()=>f(!0)}:R.action==="openExtended"?{...R,onClick:()=>g(!0)}:R.action==="openParadex"?{...R,onClick:()=>w(!0)}:R.action==="openPacifica"?{...R,onClick:()=>N(!0)}:R);return i.jsxs(i.Fragment,{children:[i.jsx(hl,{to:"https://dextrabot.com/",className:"cursor-pointer",children:i.jsx("div",{className:"flex items-center gap-2 font-manrope",children:i.jsx("img",{src:_A,alt:"Dextrabot",loading:"eager",decoding:"async",width:32,height:32,className:"w-8 h-8 object-contain"})})}),i.jsx("div",{className:"flex items-center gap-1",children:uit.map(I=>I.type==="link"?i.jsx(JTt,{linkTo:I.to,title:I.label},I.to):I.type==="dropdown"?i.jsx(cit,{label:I.label,items:P(I.items),activePaths:I.activePaths,badgeLabel:I.badgeLabel,badgeTone:I.badgeTone},I.label):null)}),i.jsx(zoe,{open:e,setOpen:t}),i.jsx(Hoe,{open:n,setOpen:r,defaultMethod:s}),i.jsx(Voe,{open:o,setOpen:l}),i.jsx(Woe,{open:c,setOpen:u}),i.jsx(qoe,{open:d,setOpen:f}),i.jsx(w$,{open:x,setOpen:g}),i.jsx(Goe,{open:v,setOpen:w}),i.jsx(Koe,{open:C,setOpen:N})]})},_y=({className:e})=>i.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e,children:[i.jsx("path",{d:"M8.625 15.75C12.56 15.75 15.75 12.56 15.75 8.625C15.75 4.68997 12.56 1.5 8.625 1.5C4.68997 1.5 1.5 4.68997 1.5 8.625C1.5 12.56 4.68997 15.75 8.625 15.75Z",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),i.jsx("path",{d:"M16.5 16.5L15 15",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),fm=(e,t=null)=>{t&&e.target.src===t?e.target.src=IH:t&&e.target.src!==t?e.target.src=t:e.target.src!==IH&&(e.target.src=IH)},tIt=m.forwardRef(({setOpen:e},t)=>{const{searchTerminalCoin:n,isSearchTerminalError:r}=m.useContext(Qr),[s,a]=m.useState(""),[o,l]=m.useState([]),[c,u]=m.useState([]),[d,f]=m.useState([]),x={kBONK:"BONK",kPEPE:"PEPE",kSHIB:"SHIB",kFLOKI:"FLOKI",kNEIRO:"NEIRO",kDOGS:"DOGS",kLUNC:"LUNC"};m.useEffect(()=>{const C=JSON.parse(localStorage.getItem("recentWallets")||"[]");l(C);const N=JSON.parse(localStorage.getItem("recentCoins")||"[]");u(N)},[]);const g=C=>{a(C.target.value.toLowerCase())},v=C=>{C.key==="Enter"&&w()},w=()=>{if(s)if(s.match(/^0x[a-fA-F0-9]{40}$/)){const C=s==null?void 0:s.toLowerCase(),N=[C,...o.filter(P=>(P==null?void 0:P.toLowerCase())!==C)];N.length>12&&N.pop(),l(N),localStorage.setItem("recentWallets",JSON.stringify(N)),window.open(`/wallet-details/${s}`,"_blank"),e(!1)}else rn.success(i.jsx(i.Fragment,{children:i.jsx("span",{style:{color:"#ff797c",paddingLeft:"5px"},children:"Please enter a valid Ethereum address"})}),{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(255, 121, 124, 0.32)",width:"380px",minWidth:"380px",height:"40px",backdropFilter:"blur(48px)"},iconTheme:{primary:"#ff797c",secondary:"#7d3031"}})};return m.useEffect(()=>{if(s.length>0){const C=s==null?void 0:s.toLowerCase(),N=n.filter(P=>Array.isArray(P)&&P.some(I=>{var R;return(R=I==null?void 0:I.toLowerCase())==null?void 0:R.includes(C)})).map(P=>P[0]);f(N)}else f([])},[s,n]),i.jsxs("div",{children:[i.jsx("div",{className:"sm:w-[416px] h-12 font-manrope z-[999]",children:i.jsxs("div",{className:"flex justify-between items-center bg-[#303030] h-full px-4 gap-1 sm:gap-2.5",children:[i.jsxs("div",{className:"flex justify-start items-center gap-1 sm:gap-2.5 w-full",children:[i.jsx(_y,{className:"text-white"}),i.jsx("input",{type:"text",ref:t,placeholder:"Search coin or wallet",value:s,onChange:g,onKeyDown:v,className:"w-full bg-transparent text-white placeholder-[#989898] text-sm font-medium font-manrope leading-[8px] placeholder:leading-[8px] tracking-tight focus:outline-none h-12"})]}),i.jsx("div",{onClick:()=>a(""),className:`${(s==null?void 0:s.length)>0?"":"hidden"} text-[#aaa] hover:text-white outline-none focus:outline-none focus:ring-0 border-none w-6 min-w-6 h-[24px] bg-[#353535] hover:bg-[#585858] rounded-md flex justify-center items-center cursor-pointer`,children:i.jsx("img",{src:Ba,alt:"",className:"w-[14px] h-[14px] min-w-[14px] min-h-[14px]"})}),i.jsx("div",{className:`${s.match(/^0x[a-fA-F0-9]{40}$/)?"":"hidden"}`,children:i.jsx("div",{onClick:w,className:"w-16 h-7 px-4 py-3 rounded-[256px] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-[#989898] justify-center items-center gap-2.5 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-white text-xs font-medium font-inter leading-[8px]",children:"Search"})})})]})}),i.jsxs("div",{className:"recent-wallets",children:[i.jsx("div",{className:`${(d==null?void 0:d.length)===0&&"hidden"} text-white text-[11px] font-bold font-manrope leading-none tracking-wider bg-[#1f1f1f] pl-4 pb-2 pt-4`,children:"SEARCH RESULTS"}),i.jsx("ul",{className:`${(c==null?void 0:c.length)===0&&(o==null?void 0:o.length)===0?"h-full max-h-[320px]":"max-h-[120px]"} overflow-y-scroll overflow-x-hidden h-full pl-4 pb-4 flex flex-wrap gap-1 sm:gap-2`,children:(d==null?void 0:d.length)===0?i.jsx("div",{className:`${!s.match(/^0x[a-fA-F0-9]{40}$/)&&(s==null?void 0:s.length)>0?"min-h-10":""} w-full h-full flex justify-center items-center`,children:i.jsx("div",{className:`${!s.match(/^0x[a-fA-F0-9]{40}$/)&&(s==null?void 0:s.length)>0?"":"hidden"} text-[#989898] text-[13px] font-semibold font-manrope leading-none pt-4`,children:"No results for your search."})}):d==null?void 0:d.map((C,N)=>i.jsx("li",{className:"mt-1 sm:mt-2",children:i.jsx("div",{className:"flex justify-start items-center gap-2 h-6 px-1 rounded-md border border-[#3a3a3a] max-w-max",children:i.jsx("div",{className:"flex justify-start items-center gap-2.5",children:i.jsxs("a",{href:`/terminal/${C}`,target:"_blank",className:"text-[#989898] text-[13px] font-semibold font-manrope leading-none hover:text-white flex gap-1.5 items-center",onClick:()=>{e(!1);const P=JSON.parse(localStorage.getItem("recentCoins")||"[]");P!=null&&P.includes(C)||(P.unshift(C),P.length>14&&P.pop(),localStorage.setItem("recentCoins",JSON.stringify(P)))},children:[i.jsx("img",{src:`https://app.hyperliquid.xyz/coins/${x[C]||(C==null?void 0:C.split("/")[0])}.svg`,alt:C,className:"rounded-full w-4 h-4 min-w-4 min-h-4 bg-gray-700",loading:"lazy",onError:P=>fm(P)}),C]})})})},N))})]}),i.jsxs("div",{className:`${(c==null?void 0:c.length)===0?"hidden":""} recent-wallets pt-4`,children:[i.jsx("div",{className:"text-white text-[11px] font-bold font-manrope leading-none tracking-wider bg-[#1f1f1f] pl-4 pb-2",children:"RECENT COINS"}),i.jsx("ul",{className:"overflow-y-scroll overflow-x-hidden h-full max-h-[142px] sm:max-h-[132px] pl-4 pb-4 flex flex-wrap gap-1 sm:gap-2",children:Array.isArray(c)&&(c==null?void 0:c.map((C,N)=>i.jsx("li",{className:"mt-1 sm:mt-2",children:i.jsx("div",{className:"flex justify-start items-center gap-2 h-6 px-1 rounded-md border border-[#3a3a3a] max-w-max",children:i.jsx("div",{className:"flex justify-start items-center gap-2.5",children:i.jsxs("a",{href:`/terminal/${C}`,target:"_blank",className:"text-[#989898] text-[13px] font-semibold font-manrope leading-none hover:text-white flex gap-1.5 items-center",onClick:()=>e(!1),children:[i.jsx("img",{src:`https://app.hyperliquid.xyz/coins/${x[C]||(C==null?void 0:C.split("/")[0])}.svg`,alt:C,className:"rounded-full w-4 h-4 min-w-4 min-h-4 bg-gray-700",loading:"lazy",onError:P=>fm(P)}),C]})})})},N)))})]}),i.jsxs("div",{className:`${(o==null?void 0:o.length)===0?"hidden":""} recent-wallets pt-4`,children:[i.jsx("div",{className:"text-white text-[11px] font-bold font-manrope leading-none tracking-wider bg-[#1f1f1f] pl-4 pb-2",children:"RECENT WALLETS"}),i.jsx("ul",{className:"overflow-y-scroll overflow-x-hidden h-full max-h-[120px] sm:max-h-[190px] pl-4 pb-4 sm:pb-8 flex flex-wrap gap-2",children:o==null?void 0:o.map((C,N)=>i.jsx("li",{className:"mt-1 sm:mt-2",children:i.jsx("div",{className:"flex justify-start items-center gap-2 h-6 px-1 rounded-md border border-[#3a3a3a] w-[120px]",children:i.jsx("div",{className:"flex justify-start items-center gap-2.5",children:i.jsxs("a",{href:`/wallet-details/${C}`,target:"_blank",className:"text-[#989898] text-[13px] font-semibold font-manrope leading-none hover:text-white flex gap-1.5 items-center",onClick:()=>e(!1),children:[i.jsx("img",{src:qbt,alt:"",className:"w-4 h-4"}),C&&C.slice(0,6)+"..."+C.slice(-4)]})})})},N))})]})]})}),nIt=({open:e,setOpen:t})=>{const n=m.useRef(null);return m.useEffect(()=>{e&&setTimeout(()=>{var r;(r=n.current)==null||r.focus()},0)},[e]),i.jsxs(Ea,{open:e,onClose:t,className:"relative z-50",children:[i.jsx(ja,{transition:!0,style:{backgroundColor:"rgba(0, 0, 0, 0.48)"},className:"fixed inset-0 transition-opacity data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in"}),i.jsx("div",{className:"fixed inset-0 z-50 w-screen overflow-y-auto",children:i.jsx("div",{className:"flex min-h-full items-center justify-center p-4 text-center sm:p-0",children:i.jsx(xa,{transition:!0,className:"relative transform overflow-hidden rounded-lg text-left shadow-xl transition-all data-[closed]:translate-y-4 data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in sm:my-8 max-w-max data-[closed]:sm:translate-y-0 data-[closed]:sm:scale-95",children:i.jsx("div",{className:"max-w-[320px] sm:max-w-[416px] min-h-[200px] max-h-[600px] relative bg-[#1f1f1f] border-[#404040] rounded-lg shadow backdrop-blur-[32px]",children:i.jsx(tIt,{ref:n,setOpen:t})})})})})]})},lMe=()=>{const[e,t]=m.useState(!1);return i.jsxs(i.Fragment,{children:[i.jsx(nIt,{open:e,setOpen:t}),i.jsx("div",{onClick:()=>{t(!0)},className:"flex-shrink w-full min-w-[80px] lg:max-w-[250px] h-8 bg-[#353535] rounded-[256px] flex justify-between items-center px-4 cursor-pointer font-manrope group",children:i.jsxs("div",{className:"flex justify-start items-center gap-[11px]",children:[i.jsx("div",{children:i.jsx(_y,{className:"text-[#646464] group-hover:text-[#e2e2e2]"})}),i.jsx("div",{className:"font-manrope leading-none text-[#666666] group-hover:text-[#e2e2e2] text-sm font-medium min-w-max",children:"Search..."})]})})]})};var Yge='-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',rIt={rounded:`SFRounded, ui-rounded, "SF Pro Rounded", ${Yge}`,system:Yge},I7={large:{actionButton:"9999px",connectButton:"12px",modal:"24px",modalMobile:"28px"},medium:{actionButton:"10px",connectButton:"8px",modal:"16px",modalMobile:"18px"},none:{actionButton:"0px",connectButton:"0px",modal:"0px",modalMobile:"0px"},small:{actionButton:"4px",connectButton:"4px",modal:"8px",modalMobile:"8px"}},sIt={large:{modalOverlay:"blur(20px)"},none:{modalOverlay:"blur(0px)"},small:{modalOverlay:"blur(4px)"}},cMe=({borderRadius:e="large",fontStack:t="rounded",overlayBlur:n="none"})=>({blurs:{modalOverlay:sIt[n].modalOverlay},fonts:{body:rIt[t]},radii:{actionButton:I7[e].actionButton,connectButton:I7[e].connectButton,menuButton:I7[e].connectButton,modal:I7[e].modal,modalMobile:I7[e].modalMobile}}),uMe={blue:{accentColor:"#0E76FD",accentColorForeground:"#FFF"},green:{accentColor:"#1DB847",accentColorForeground:"#FFF"},orange:{accentColor:"#FF801F",accentColorForeground:"#FFF"},pink:{accentColor:"#FF5CA0",accentColorForeground:"#FFF"},purple:{accentColor:"#5F5AFA",accentColorForeground:"#FFF"},red:{accentColor:"#FA423C",accentColorForeground:"#FFF"}},Xge=uMe.blue,dMe=({accentColor:e=Xge.accentColor,accentColorForeground:t=Xge.accentColorForeground,...n}={})=>({...cMe(n),colors:{accentColor:e,accentColorForeground:t,actionButtonBorder:"rgba(0, 0, 0, 0.04)",actionButtonBorderMobile:"rgba(0, 0, 0, 0.06)",actionButtonSecondaryBackground:"rgba(0, 0, 0, 0.06)",closeButton:"rgba(60, 66, 66, 0.8)",closeButtonBackground:"rgba(0, 0, 0, 0.06)",connectButtonBackground:"#FFF",connectButtonBackgroundError:"#FF494A",connectButtonInnerBackground:"linear-gradient(0deg, rgba(0, 0, 0, 0.03), rgba(0, 0, 0, 0.06))",connectButtonText:"#25292E",connectButtonTextError:"#FFF",connectionIndicator:"#30E000",downloadBottomCardBackground:"linear-gradient(126deg, rgba(255, 255, 255, 0) 9.49%, rgba(171, 171, 171, 0.04) 71.04%), #FFFFFF",downloadTopCardBackground:"linear-gradient(126deg, rgba(171, 171, 171, 0.2) 9.49%, rgba(255, 255, 255, 0) 71.04%), #FFFFFF",error:"#FF494A",generalBorder:"rgba(0, 0, 0, 0.06)",generalBorderDim:"rgba(0, 0, 0, 0.03)",menuItemBackground:"rgba(60, 66, 66, 0.1)",modalBackdrop:"rgba(0, 0, 0, 0.3)",modalBackground:"#FFF",modalBorder:"transparent",modalText:"#25292E",modalTextDim:"rgba(60, 66, 66, 0.3)",modalTextSecondary:"rgba(60, 66, 66, 0.6)",profileAction:"#FFF",profileActionHover:"rgba(255, 255, 255, 0.5)",profileForeground:"rgba(60, 66, 66, 0.06)",selectedOptionBorder:"rgba(60, 66, 66, 0.1)",standby:"#FFD641"},shadows:{connectButton:"0px 4px 12px rgba(0, 0, 0, 0.1)",dialog:"0px 8px 32px rgba(0, 0, 0, 0.32)",profileDetailsAction:"0px 2px 6px rgba(37, 41, 46, 0.04)",selectedOption:"0px 2px 6px rgba(0, 0, 0, 0.24)",selectedWallet:"0px 2px 6px rgba(0, 0, 0, 0.12)",walletLogo:"0px 2px 16px rgba(0, 0, 0, 0.16)"}});dMe.accentColors=uMe;var gO="#1A1B1F",fMe={blue:{accentColor:"#3898FF",accentColorForeground:"#FFF"},green:{accentColor:"#4BD166",accentColorForeground:gO},orange:{accentColor:"#FF983D",accentColorForeground:gO},pink:{accentColor:"#FF7AB8",accentColorForeground:gO},purple:{accentColor:"#7A70FF",accentColorForeground:"#FFF"},red:{accentColor:"#FF6257",accentColorForeground:"#FFF"}},Qge=fMe.blue,hMe=({accentColor:e=Qge.accentColor,accentColorForeground:t=Qge.accentColorForeground,...n}={})=>({...cMe(n),colors:{accentColor:e,accentColorForeground:t,actionButtonBorder:"rgba(255, 255, 255, 0.04)",actionButtonBorderMobile:"rgba(255, 255, 255, 0.08)",actionButtonSecondaryBackground:"rgba(255, 255, 255, 0.08)",closeButton:"rgba(224, 232, 255, 0.6)",closeButtonBackground:"rgba(255, 255, 255, 0.08)",connectButtonBackground:gO,connectButtonBackgroundError:"#FF494A",connectButtonInnerBackground:"linear-gradient(0deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.15))",connectButtonText:"#FFF",connectButtonTextError:"#FFF",connectionIndicator:"#30E000",downloadBottomCardBackground:"linear-gradient(126deg, rgba(0, 0, 0, 0) 9.49%, rgba(120, 120, 120, 0.2) 71.04%), #1A1B1F",downloadTopCardBackground:"linear-gradient(126deg, rgba(120, 120, 120, 0.2) 9.49%, rgba(0, 0, 0, 0) 71.04%), #1A1B1F",error:"#FF494A",generalBorder:"rgba(255, 255, 255, 0.08)",generalBorderDim:"rgba(255, 255, 255, 0.04)",menuItemBackground:"rgba(224, 232, 255, 0.1)",modalBackdrop:"rgba(0, 0, 0, 0.5)",modalBackground:"#1A1B1F",modalBorder:"rgba(255, 255, 255, 0.08)",modalText:"#FFF",modalTextDim:"rgba(224, 232, 255, 0.3)",modalTextSecondary:"rgba(255, 255, 255, 0.6)",profileAction:"rgba(224, 232, 255, 0.1)",profileActionHover:"rgba(224, 232, 255, 0.2)",profileForeground:"rgba(224, 232, 255, 0.05)",selectedOptionBorder:"rgba(224, 232, 255, 0.1)",standby:"#FFD641"},shadows:{connectButton:"0px 4px 12px rgba(0, 0, 0, 0.1)",dialog:"0px 8px 32px rgba(0, 0, 0, 0.32)",profileDetailsAction:"0px 2px 6px rgba(37, 41, 46, 0.04)",selectedOption:"0px 2px 6px rgba(0, 0, 0, 0.24)",selectedWallet:"0px 2px 6px rgba(0, 0, 0, 0.24)",walletLogo:"0px 2px 16px rgba(0, 0, 0, 0.16)"}});hMe.accentColors=fMe;var Wee=`{
"connect_wallet": {
"label": "Connect Wallet",
"wrong_network": {
"label": "Wrong network"
}
},
"intro": {
"title": "What is a Wallet?",
"description": "A wallet is used to send, receive, store, and display digital assets. It's also a new way to log in, without needing to create new accounts and passwords on every website.",
"digital_asset": {
"title": "A Home for your Digital Assets",
"description": "Wallets are used to send, receive, store, and display digital assets like Ethereum and NFTs."
},
"login": {
"title": "A New Way to Log In",
"description": "Instead of creating new accounts and passwords on every website, just connect your wallet."
},
"get": {
"label": "Get a Wallet"
},
"learn_more": {
"label": "Learn More"
}
},
"sign_in": {
"label": "Verify your account",
"description": "To finish connecting, you must sign a message in your wallet to verify that you are the owner of this account.",
"message": {
"send": "Sign message",
"preparing": "Preparing message...",
"cancel": "Cancel",
"preparing_error": "Error preparing message, please retry!"
},
"signature": {
"waiting": "Waiting for signature...",
"verifying": "Verifying signature...",
"signing_error": "Error signing message, please retry!",
"verifying_error": "Error verifying signature, please retry!",
"oops_error": "Oops, something went wrong!"
}
},
"connect": {
"label": "Connect",
"title": "Connect a Wallet",
"new_to_ethereum": {
"description": "New to Ethereum wallets?",
"learn_more": {
"label": "Learn More"
}
},
"learn_more": {
"label": "Learn more"
},
"recent": "Recent",
"status": {
"opening": "Opening %{wallet}...",
"connecting": "Connecting",
"connect_mobile": "Continue in %{wallet}",
"not_installed": "%{wallet} is not installed",
"not_available": "%{wallet} is not available",
"confirm": "Confirm connection in the extension",
"confirm_mobile": "Accept connection request in the wallet"
},
"secondary_action": {
"get": {
"description": "Don't have %{wallet}?",
"label": "GET"
},
"install": {
"label": "INSTALL"
},
"retry": {
"label": "RETRY"
}
},
"walletconnect": {
"description": {
"full": "Need the official WalletConnect modal?",
"compact": "Need the WalletConnect modal?"
},
"open": {
"label": "OPEN"
}
}
},
"connect_scan": {
"title": "Scan with %{wallet}",
"fallback_title": "Scan with your phone"
},
"connector_group": {
"installed": "Installed",
"recommended": "Recommended",
"other": "Other",
"popular": "Popular",
"more": "More",
"others": "Others"
},
"get": {
"title": "Get a Wallet",
"action": {
"label": "GET"
},
"mobile": {
"description": "Mobile Wallet"
},
"extension": {
"description": "Browser Extension"
},
"mobile_and_extension": {
"description": "Mobile Wallet and Extension"
},
"mobile_and_desktop": {
"description": "Mobile and Desktop Wallet"
},
"looking_for": {
"title": "Not what you're looking for?",
"mobile": {
"description": "Select a wallet on the main screen to get started with a different wallet provider."
},
"desktop": {
"compact_description": "Select a wallet on the main screen to get started with a different wallet provider.",
"wide_description": "Select a wallet on the left to get started with a different wallet provider."
}
}
},
"get_options": {
"title": "Get started with %{wallet}",
"short_title": "Get %{wallet}",
"mobile": {
"title": "%{wallet} for Mobile",
"description": "Use the mobile wallet to explore the world of Ethereum.",
"download": {
"label": "Get the app"
}
},
"extension": {
"title": "%{wallet} for %{browser}",
"description": "Access your wallet right from your favorite web browser.",
"download": {
"label": "Add to %{browser}"
}
},
"desktop": {
"title": "%{wallet} for %{platform}",
"description": "Access your wallet natively from your powerful desktop.",
"download": {
"label": "Add to %{platform}"
}
}
},
"get_mobile": {
"title": "Install %{wallet}",
"description": "Scan with your phone to download on iOS or Android",
"continue": {
"label": "Continue"
}
},
"get_instructions": {
"mobile": {
"connect": {
"label": "Connect"
},
"learn_more": {
"label": "Learn More"
}
},
"extension": {
"refresh": {
"label": "Refresh"
},
"learn_more": {
"label": "Learn More"
}
},
"desktop": {
"connect": {
"label": "Connect"
},
"learn_more": {
"label": "Learn More"
}
}
},
"chains": {
"title": "Switch Networks",
"wrong_network": "Wrong network detected, switch or disconnect to continue.",
"confirm": "Confirm in Wallet",
"switching_not_supported": "Your wallet does not support switching networks from %{appName}. Try switching networks from within your wallet instead.",
"switching_not_supported_fallback": "Your wallet does not support switching networks from this app. Try switching networks from within your wallet instead.",
"disconnect": "Disconnect",
"connected": "Connected"
},
"profile": {
"disconnect": {
"label": "Disconnect"
},
"copy_address": {
"label": "Copy Address",
"copied": "Copied!"
},
"explorer": {
"label": "View more on explorer"
},
"transactions": {
"description": "%{appName} transactions will appear here...",
"description_fallback": "Your transactions will appear here...",
"recent": {
"title": "Recent Transactions"
},
"clear": {
"label": "Clear All"
}
}
},
"wallet_connectors": {
"argent": {
"qr_code": {
"step1": {
"description": "Put Argent on your home screen for faster access to your wallet.",
"title": "Open the Argent app"
},
"step2": {
"description": "Create a wallet and username, or import an existing wallet.",
"title": "Create or Import a Wallet"
},
"step3": {
"description": "After you scan, a connection prompt will appear for you to connect your wallet.",
"title": "Tap the Scan QR button"
}
}
},
"berasig": {
"extension": {
"step1": {
"title": "Install the BeraSig extension",
"description": "We recommend pinning BeraSig to your taskbar for easier access to your wallet."
},
"step2": {
"title": "Create a Wallet",
"description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone."
},
"step3": {
"title": "Refresh your browser",
"description": "Once you set up your wallet, click below to refresh the browser and load up the extension."
}
}
},
"best": {
"qr_code": {
"step1": {
"title": "Open the Best Wallet app",
"description": "Add Best Wallet to your home screen for faster access to your wallet."
},
"step2": {
"title": "Create or Import a Wallet",
"description": "Create a new wallet or import an existing one."
},
"step3": {
"title": "Tap the QR icon and scan",
"description": "Tap the QR icon on your homescreen, scan the code and confirm the prompt to connect."
}
}
},
"bifrost": {
"qr_code": {
"step1": {
"description": "We recommend putting Bifrost Wallet on your home screen for quicker access.",
"title": "Open the Bifrost Wallet app"
},
"step2": {
"description": "Create or import a wallet using your recovery phrase.",
"title": "Create or Import a Wallet"
},
"step3": {
"description": "After you scan, a connection prompt will appear for you to connect your wallet.",
"title": "Tap the scan button"
}
}
},
"bitget": {
"qr_code": {
"step1": {
"description": "We recommend putting Bitget Wallet on your home screen for quicker access.",
"title": "Open the Bitget Wallet app"
},
"step2": {
"description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone.",
"title": "Create or Import a Wallet"
},
"step3": {
"description": "After you scan, a connection prompt will appear for you to connect your wallet.",
"title": "Tap the scan button"
}
},
"extension": {
"step1": {
"description": "We recommend pinning Bitget Wallet to your taskbar for quicker access to your wallet.",
"title": "Install the Bitget Wallet extension"
},
"step2": {
"description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone.",
"title": "Create or Import a Wallet"
},
"step3": {
"description": "Once you set up your wallet, click below to refresh the browser and load up the extension.",
"title": "Refresh your browser"
}
}
},
"bitski": {
"extension": {
"step1": {
"description": "We recommend pinning Bitski to your taskbar for quicker access to your wallet.",
"title": "Install the Bitski extension"
},
"step2": {
"description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone.",
"title": "Create or Import a Wallet"
},
"step3": {
"description": "Once you set up your wallet, click below to refresh the browser and load up the extension.",
"title": "Refresh your browser"
}
}
},
"bitverse": {
"qr_code": {
"step1": {
"title": "Open the Bitverse Wallet app",
"description": "Add Bitverse Wallet to your home screen for faster access to your wallet."
},
"step2": {
"title": "Create or Import a Wallet",
"description": "Create a new wallet or import an existing one."
},
"step3": {
"title": "Tap the QR icon and scan",
"description": "Tap the QR icon on your homescreen, scan the code and confirm the prompt to connect."
}
}
},
"bloom": {
"desktop": {
"step1": {
"title": "Open the Bloom Wallet app",
"description": "We recommend putting Bloom Wallet on your home screen for quicker access."
},
"step2": {
"description": "Create or import a wallet using your recovery phrase.",
"title": "Create or Import a Wallet"
},
"step3": {
"description": "After you have a wallet, click on Connect to connect via Bloom. A connection prompt in the app will appear for you to confirm the connection.",
"title": "Click on Connect"
}
}
},
"bybit": {
"qr_code": {
"step1": {
"description": "We recommend putting Bybit on your home screen for faster access to your wallet.",
"title": "Open the Bybit app"
},
"step2": {
"description": "You can easily backup your wallet using our backup feature on your phone.",
"title": "Create or Import a Wallet"
},
"step3": {
"description": "After you scan, a connection prompt will appear for you to connect your wallet.",
"title": "Tap the scan button"
}
},
"extension": {
"step1": {
"description": "Click at the top right of your browser and pin Bybit Wallet for easy access.",
"title": "Install the Bybit Wallet extension"
},
"step2": {
"description": "Create a new wallet or import an existing one.",
"title": "Create or Import a wallet"
},
"step3": {
"description": "Once you set up Bybit Wallet, click below to refresh the browser and load up the extension.",
"title": "Refresh your browser"
}
}
},
"binance": {
"qr_code": {
"step1": {
"description": "We recommend putting Binance on your home screen for faster access to your wallet.",
"title": "Open the Binance app"
},
"step2": {
"description": "You can easily backup your wallet using our backup feature on your phone.",
"title": "Create or Import a Wallet"
},
"step3": {
"description": "After you scan, a connection prompt will appear for you to connect your wallet.",
"title": "Tap the WalletConnect button"
}
}
},
"coin98": {
"qr_code": {
"step1": {
"description": "We recommend putting Coin98 Wallet on your home screen for faster access to your wallet.",
"title": "Open the Coin98 Wallet app"
},
"step2": {
"description": "You can easily backup your wallet using our backup feature on your phone.",
"title": "Create or Import a Wallet"
},
"step3": {
"description": "After you scan, a connection prompt will appear for you to connect your wallet.",
"title": "Tap the WalletConnect button"
}
},
"extension": {
"step1": {
"description": "Click at the top right of your browser and pin Coin98 Wallet for easy access.",
"title": "Install the Coin98 Wallet extension"
},
"step2": {
"description": "Create a new wallet or import an existing one.",
"title": "Create or Import a wallet"
},
"step3": {
"description": "Once you set up Coin98 Wallet, click below to refresh the browser and load up the extension.",
"title": "Refresh your browser"
}
}
},
"coinbase": {
"qr_code": {
"step1": {
"description": "We recommend putting Coinbase Wallet on your home screen for quicker access.",
"title": "Open the Coinbase Wallet app"
},
"step2": {
"description": "You can easily backup your wallet using the cloud backup feature.",
"title": "Create or Import a Wallet"
},
"step3": {
"description": "After you scan, a connection prompt will appear for you to connect your wallet.",
"title": "Tap the scan button"
}
},
"extension": {
"step1": {
"description": "We recommend pinning Coinbase Wallet to your taskbar for quicker access to your wallet.",
"title": "Install the Coinbase Wallet extension"
},
"step2": {
"description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone.",
"title": "Create or Import a Wallet"
},
"step3": {
"description": "Once you set up your wallet, click below to refresh the browser and load up the extension.",
"title": "Refresh your browser"
}
}
},
"compass": {
"extension": {
"step1": {
"description": "We recommend pinning Compass Wallet to your taskbar for quicker access to your wallet.",
"title": "Install the Compass Wallet extension"
},
"step2": {
"description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone.",
"title": "Create or Import a Wallet"
},
"step3": {
"description": "Once you set up your wallet, click below to refresh the browser and load up the extension.",
"title": "Refresh your browser"
}
}
},
"core": {
"qr_code": {
"step1": {
"description": "We recommend putting Core on your home screen for faster access to your wallet.",
"title": "Open the Core app"
},
"step2": {
"description": "You can easily backup your wallet using our backup feature on your phone.",
"title": "Create or Import a Wallet"
},
"step3": {
"description": "After you scan, a connection prompt will appear for you to connect your wallet.",
"title": "Tap the WalletConnect button"
}
},
"extension": {
"step1": {
"description": "We recommend pinning Core to your taskbar for quicker access to your wallet.",
"title": "Install the Core extension"
},
"step2": {
"description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone.",
"title": "Create or Import a Wallet"
},
"step3": {
"description": "Once you set up your wallet, click below to refresh the browser and load up the extension.",
"title": "Refresh your browser"
}
}
},
"fox": {
"qr_code": {
"step1": {
"description": "We recommend putting FoxWallet on your home screen for quicker access.",
"title": "Open the FoxWallet app"
},
"step2": {
"description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone.",
"title": "Create or Import a Wallet"
},
"step3": {
"description": "After you scan, a connection prompt will appear for you to connect your wallet.",
"title": "Tap the scan button"
}
}
},
"frontier": {
"qr_code": {
"step1": {
"description": "We recommend putting Frontier Wallet on your home screen for quicker access.",
"title": "Open the Frontier Wallet app"
},
"step2": {
"description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone.",
"title": "Create or Import a Wallet"
},
"step3": {
"description": "After you scan, a connection prompt will appear for you to connect your wallet.",
"title": "Tap the scan button"
}
},
"extension": {
"step1": {
"description": "We recommend pinning Frontier Wallet to your taskbar for quicker access to your wallet.",
"title": "Install the Frontier Wallet extension"
},
"step2": {
"description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone.",
"title": "Create or Import a Wallet"
},
"step3": {
"description": "Once you set up your wallet, click below to refresh the browser and load up the extension.",
"title": "Refresh your browser"
}
}
},
"im_token": {
"qr_code": {
"step1": {
"title": "Open the imToken app",
"description": "Put imToken app on your home screen for faster access to your wallet."
},
"step2": {
"title": "Create or Import a Wallet",
"description": "Create a new wallet or import an existing one."
},
"step3": {
"title": "Tap Scanner Icon in top right corner",
"description": "Choose New Connection, then scan the QR code and confirm the prompt to connect."
}
}
},
"iopay": {
"qr_code": {
"step1": {
"description": "We recommend putting ioPay on your home screen for faster access to your wallet.",
"title": "Open the ioPay app"
},
"step2": {
"description": "You can easily backup your wallet using our backup feature on your phone.",
"title": "Create or Import a Wallet"
},
"step3": {
"description": "After you scan, a connection prompt will appear for you to connect your wallet.",
"title": "Tap the WalletConnect button"
}
}
},
"kaikas": {
"extension": {
"step1": {
"description": "We recommend pinning Kaikas to your taskbar for quicker access to your wallet.",
"title": "Install the Kaikas extension"
},
"step2": {
"description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone.",
"title": "Create or Import a Wallet"
},
"step3": {
"description": "Once you set up your wallet, click below to refresh the browser and load up the extension.",
"title": "Refresh your browser"
}
},
"qr_code": {
"step1": {
"title": "Open the Kaikas app",
"description": "Put Kaikas app on your home screen for faster access to your wallet."
},
"step2": {
"title": "Create or Import a Wallet",
"description": "Create a new wallet or import an existing one."
},
"step3": {
"title": "Tap Scanner Icon in top right corner",
"description": "Choose New Connection, then scan the QR code and confirm the prompt to connect."
}
}
},
"kaia": {
"extension": {
"step1": {
"description": "We recommend pinning Kaia to your taskbar for quicker access to your wallet.",
"title": "Install the Kaia extension"
},
"step2": {
"description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone.",
"title": "Create or Import a Wallet"
},
"step3": {
"description": "Once you set up your wallet, click below to refresh the browser and load up the extension.",
"title": "Refresh your browser"
}
},
"qr_code": {
"step1": {
"title": "Open the Kaia app",
"description": "Put Kaia app on your home screen for faster access to your wallet."
},
"step2": {
"title": "Create or Import a Wallet",
"description": "Create a new wallet or import an existing one."
},
"step3": {
"title": "Tap Scanner Icon in top right corner",
"description": "Choose New Connection, then scan the QR code and confirm the prompt to connect."
}
}
},
"kraken": {
"qr_code": {
"step1": {
"title": "Open the Kraken Wallet app",
"description": "Add Kraken Wallet to your home screen for faster access to your wallet."
},
"step2": {
"title": "Create or Import a Wallet",
"description": "Create a new wallet or import an existing one."
},
"step3": {
"title": "Tap the QR icon and scan",
"description": "Tap the QR icon on your homescreen, scan the code and confirm the prompt to connect."
}
}
},
"kresus": {
"qr_code": {
"step1": {
"title": "Open the Kresus Wallet app",
"description": "Add Kresus Wallet to your home screen for faster access to your wallet."
},
"step2": {
"title": "Create or Import a Wallet",
"description": "Create a new wallet or import an existing one."
},
"step3": {
"title": "Tap the QR icon and scan",
"description": "Tap the QR icon on your homescreen, scan the code and confirm the prompt to connect."
}
}
},
"magicEden": {
"extension": {
"step1": {
"title": "Install the Magic Eden extension",
"description": "We recommend pinning Magic Eden to your taskbar for easier access to your wallet."
},
"step2": {
"title": "Create or Import a Wallet",
"description": "Be sure to back up your wallet using a secure method. Never share your secret recovery phrase with anyone."
},
"step3": {
"title": "Refresh your browser",
"description": "Once you set up your wallet, click below to refresh the browser and load up the extension."
}
}
},
"metamask": {
"qr_code": {
"step1": {
"title": "Open the MetaMask app",
"description": "We recommend putting MetaMask on your home screen for quicker access."
},
"step2": {
"title": "Create or Import a Wallet",
"description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone."
},
"step3": {
"title": "Tap the scan button",
"description": "After you scan, a connection prompt will appear for you to connect your wallet."
}
},
"extension": {
"step1": {
"title": "Install the MetaMask extension",
"description": "We recommend pinning MetaMask to your taskbar for quicker access to your wallet."
},
"step2": {
"title": "Create or Import a Wallet",
"description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone."
},
"step3": {
"title": "Refresh your browser",
"description": "Once you set up your wallet, click below to refresh the browser and load up the extension."
}
}
},
"nestwallet": {
"extension": {
"step1": {
"title": "Install the NestWallet extension",
"description": "We recommend pinning NestWallet to your taskbar for quicker access to your wallet."
},
"step2": {
"title": "Create or Import a Wallet",
"description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone."
},
"step3": {
"title": "Refresh your browser",
"description": "Once you set up your wallet, click below to refresh the browser and load up the extension."
}
}
},
"okx": {
"qr_code": {
"step1": {
"title": "Open the OKX Wallet app",
"description": "We recommend putting OKX Wallet on your home screen for quicker access."
},
"step2": {
"title": "Create or Import a Wallet",
"description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone."
},
"step3": {
"title": "Tap the scan button",
"description": "After you scan, a connection prompt will appear for you to connect your wallet."
}
},
"extension": {
"step1": {
"title": "Install the OKX Wallet extension",
"description": "We recommend pinning OKX Wallet to your taskbar for quicker access to your wallet."
},
"step2": {
"title": "Create or Import a Wallet",
"description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone."
},
"step3": {
"title": "Refresh your browser",
"description": "Once you set up your wallet, click below to refresh the browser and load up the extension."
}
}
},
"omni": {
"qr_code": {
"step1": {
"title": "Open the Omni app",
"description": "Add Omni to your home screen for faster access to your wallet."
},
"step2": {
"title": "Create or Import a Wallet",
"description": "Create a new wallet or import an existing one."
},
"step3": {
"title": "Tap the QR icon and scan",
"description": "Tap the QR icon on your home screen, scan the code and confirm the prompt to connect."
}
}
},
"1inch": {
"qr_code": {
"step1": {
"description": "Put 1inch Wallet on your home screen for faster access to your wallet.",
"title": "Open the 1inch Wallet app"
},
"step2": {
"description": "Create a wallet and username, or import an existing wallet.",
"title": "Create or Import a Wallet"
},
"step3": {
"description": "After you scan, a connection prompt will appear for you to connect your wallet.",
"title": "Tap the Scan QR button"
}
}
},
"token_pocket": {
"qr_code": {
"step1": {
"title": "Open the TokenPocket app",
"description": "We recommend putting TokenPocket on your home screen for quicker access."
},
"step2": {
"title": "Create or Import a Wallet",
"description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone."
},
"step3": {
"title": "Tap the scan button",
"description": "After you scan, a connection prompt will appear for you to connect your wallet."
}
},
"extension": {
"step1": {
"title": "Install the TokenPocket extension",
"description": "We recommend pinning TokenPocket to your taskbar for quicker access to your wallet."
},
"step2": {
"title": "Create or Import a Wallet",
"description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone."
},
"step3": {
"title": "Refresh your browser",
"description": "Once you set up your wallet, click below to refresh the browser and load up the extension."
}
}
},
"trust": {
"qr_code": {
"step1": {
"title": "Open the Trust Wallet app",
"description": "Put Trust Wallet on your home screen for faster access to your wallet."
},
"step2": {
"title": "Create or Import a Wallet",
"description": "Create a new wallet or import an existing one."
},
"step3": {
"title": "Tap WalletConnect in Settings",
"description": "Choose New Connection, then scan the QR code and confirm the prompt to connect."
}
},
"extension": {
"step1": {
"title": "Install the Trust Wallet extension",
"description": "Click at the top right of your browser and pin Trust Wallet for easy access."
},
"step2": {
"title": "Create or Import a wallet",
"description": "Create a new wallet or import an existing one."
},
"step3": {
"title": "Refresh your browser",
"description": "Once you set up Trust Wallet, click below to refresh the browser and load up the extension."
}
}
},
"uniswap": {
"qr_code": {
"step1": {
"title": "Open the Uniswap app",
"description": "Add Uniswap Wallet to your home screen for faster access to your wallet."
},
"step2": {
"title": "Create or Import a Wallet",
"description": "Create a new wallet or import an existing one."
},
"step3": {
"title": "Tap the QR icon and scan",
"description": "Tap the QR icon on your homescreen, scan the code and confirm the prompt to connect."
}
}
},
"zerion": {
"qr_code": {
"step1": {
"title": "Open the Zerion app",
"description": "We recommend putting Zerion on your home screen for quicker access."
},
"step2": {
"title": "Create or Import a Wallet",
"description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone."
},
"step3": {
"title": "Tap the scan button",
"description": "After you scan, a connection prompt will appear for you to connect your wallet."
}
},
"extension": {
"step1": {
"title": "Install the Zerion extension",
"description": "We recommend pinning Zerion to your taskbar for quicker access to your wallet."
},
"step2": {
"title": "Create or Import a Wallet",
"description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone."
},
"step3": {
"title": "Refresh your browser",
"description": "Once you set up your wallet, click below to refresh the browser and load up the extension."
}
}
},
"rainbow": {
"qr_code": {
"step1": {
"title": "Open the Rainbow app",
"description": "We recommend putting Rainbow on your home screen for faster access to your wallet."
},
"step2": {
"title": "Create or Import a Wallet",
"description": "You can easily backup your wallet using our backup feature on your phone."
},
"step3": {
"title": "Tap the scan button",
"description": "After you scan, a connection prompt will appear for you to connect your wallet."
}
}
},
"enkrypt": {
"extension": {
"step1": {
"description": "We recommend pinning Enkrypt Wallet to your taskbar for quicker access to your wallet.",
"title": "Install the Enkrypt Wallet extension"
},
"step2": {
"description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone.",
"title": "Create or Import a Wallet"
},
"step3": {
"description": "Once you set up your wallet, click below to refresh the browser and load up the extension.",
"title": "Refresh your browser"
}
}
},
"frame": {
"extension": {
"step1": {
"description": "We recommend pinning Frame to your taskbar for quicker access to your wallet.",
"title": "Install Frame & the companion extension"
},
"step2": {
"description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone.",
"title": "Create or Import a Wallet"
},
"step3": {
"description": "Once you set up your wallet, click below to refresh the browser and load up the extension.",
"title": "Refresh your browser"
}
}
},
"one_key": {
"extension": {
"step1": {
"title": "Install the OneKey Wallet extension",
"description": "We recommend pinning OneKey Wallet to your taskbar for quicker access to your wallet."
},
"step2": {
"title": "Create or Import a Wallet",
"description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone."
},
"step3": {
"title": "Refresh your browser",
"description": "Once you set up your wallet, click below to refresh the browser and load up the extension."
}
}
},
"paraswap": {
"qr_code": {
"step1": {
"title": "Open the ParaSwap app",
"description": "Add ParaSwap Wallet to your home screen for faster access to your wallet."
},
"step2": {
"title": "Create or Import a Wallet",
"description": "Create a new wallet or import an existing one."
},
"step3": {
"title": "Tap the QR icon and scan",
"description": "Tap the QR icon on your homescreen, scan the code and confirm the prompt to connect."
}
}
},
"phantom": {
"extension": {
"step1": {
"title": "Install the Phantom extension",
"description": "We recommend pinning Phantom to your taskbar for easier access to your wallet."
},
"step2": {
"title": "Create or Import a Wallet",
"description": "Be sure to back up your wallet using a secure method. Never share your secret recovery phrase with anyone."
},
"step3": {
"title": "Refresh your browser",
"description": "Once you set up your wallet, click below to refresh the browser and load up the extension."
}
}
},
"rabby": {
"extension": {
"step1": {
"title": "Install the Rabby extension",
"description": "We recommend pinning Rabby to your taskbar for quicker access to your wallet."
},
"step2": {
"title": "Create or Import a Wallet",
"description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone."
},
"step3": {
"title": "Refresh your browser",
"description": "Once you set up your wallet, click below to refresh the browser and load up the extension."
}
}
},
"ronin": {
"qr_code": {
"step1": {
"description": "We recommend putting Ronin Wallet on your home screen for quicker access.",
"title": "Open the Ronin Wallet app"
},
"step2": {
"description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone.",
"title": "Create or Import a Wallet"
},
"step3": {
"description": "After you scan, a connection prompt will appear for you to connect your wallet.",
"title": "Tap the scan button"
}
},
"extension": {
"step1": {
"description": "We recommend pinning Ronin Wallet to your taskbar for quicker access to your wallet.",
"title": "Install the Ronin Wallet extension"
},
"step2": {
"description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone.",
"title": "Create or Import a Wallet"
},
"step3": {
"description": "Once you set up your wallet, click below to refresh the browser and load up the extension.",
"title": "Refresh your browser"
}
}
},
"ramper": {
"extension": {
"step1": {
"title": "Install the Ramper extension",
"description": "We recommend pinning Ramper to your taskbar for easier access to your wallet."
},
"step2": {
"title": "Create a Wallet",
"description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone."
},
"step3": {
"title": "Refresh your browser",
"description": "Once you set up your wallet, click below to refresh the browser and load up the extension."
}
}
},
"safeheron": {
"extension": {
"step1": {
"title": "Install the Core extension",
"description": "We recommend pinning Safeheron to your taskbar for quicker access to your wallet."
},
"step2": {
"title": "Create or Import a Wallet",
"description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone."
},
"step3": {
"title": "Refresh your browser",
"description": "Once you set up your wallet, click below to refresh the browser and load up the extension."
}
}
},
"taho": {
"extension": {
"step1": {
"title": "Install the Taho extension",
"description": "We recommend pinning Taho to your taskbar for quicker access to your wallet."
},
"step2": {
"title": "Create or Import a Wallet",
"description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone."
},
"step3": {
"title": "Refresh your browser",
"description": "Once you set up your wallet, click below to refresh the browser and load up the extension."
}
}
},
"wigwam": {
"extension": {
"step1": {
"title": "Install the Wigwam extension",
"description": "We recommend pinning Wigwam to your taskbar for quicker access to your wallet."
},
"step2": {
"title": "Create or Import a Wallet",
"description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone."
},
"step3": {
"title": "Refresh your browser",
"description": "Once you set up your wallet, click below to refresh the browser and load up the extension."
}
}
},
"talisman": {
"extension": {
"step1": {
"title": "Install the Talisman extension",
"description": "We recommend pinning Talisman to your taskbar for quicker access to your wallet."
},
"step2": {
"title": "Create or Import an Ethereum Wallet",
"description": "Be sure to back up your wallet using a secure method. Never share your recovery phrase with anyone."
},
"step3": {
"title": "Refresh your browser",
"description": "Once you set up your wallet, click below to refresh the browser and load up the extension."
}
}
},
"xdefi": {
"extension": {
"step1": {
"title": "Install the XDEFI Wallet extension",
"description": "We recommend pinning XDEFI Wallet to your taskbar for quicker access to your wallet."
},
"step2": {
"title": "Create or Import a Wallet",
"description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone."
},
"step3": {
"title": "Refresh your browser",
"description": "Once you set up your wallet, click below to refresh the browser and load up the extension."
}
}
},
"zeal": {
"qr_code": {
"step1": {
"title": "Open the Zeal app",
"description": "Add Zeal Wallet to your home screen for faster access to your wallet."
},
"step2": {
"title": "Create or Import a Wallet",
"description": "Create a new wallet or import an existing one."
},
"step3": {
"title": "Tap the QR icon and scan",
"description": "Tap the QR icon on your homescreen, scan the code and confirm the prompt to connect."
}
},
"extension": {
"step1": {
"title": "Install the Zeal extension",
"description": "We recommend pinning Zeal to your taskbar for quicker access to your wallet."
},
"step2": {
"title": "Create or Import a Wallet",
"description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone."
},
"step3": {
"title": "Refresh your browser",
"description": "Once you set up your wallet, click below to refresh the browser and load up the extension."
}
}
},
"safepal": {
"extension": {
"step1": {
"title": "Install the SafePal Wallet extension",
"description": "Click at the top right of your browser and pin SafePal Wallet for easy access."
},
"step2": {
"title": "Create or Import a wallet",
"description": "Create a new wallet or import an existing one."
},
"step3": {
"title": "Refresh your browser",
"description": "Once you set up SafePal Wallet, click below to refresh the browser and load up the extension."
}
},
"qr_code": {
"step1": {
"title": "Open the SafePal Wallet app",
"description": "Put SafePal Wallet on your home screen for faster access to your wallet."
},
"step2": {
"title": "Create or Import a Wallet",
"description": "Create a new wallet or import an existing one."
},
"step3": {
"title": "Tap WalletConnect in Settings",
"description": "Choose New Connection, then scan the QR code and confirm the prompt to connect."
}
}
},
"desig": {
"extension": {
"step1": {
"title": "Install the Desig extension",
"description": "We recommend pinning Desig to your taskbar for easier access to your wallet."
},
"step2": {
"title": "Create a Wallet",
"description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone."
},
"step3": {
"title": "Refresh your browser",
"description": "Once you set up your wallet, click below to refresh the browser and load up the extension."
}
}
},
"subwallet": {
"extension": {
"step1": {
"title": "Install the SubWallet extension",
"description": "We recommend pinning SubWallet to your taskbar for quicker access to your wallet."
},
"step2": {
"title": "Create or Import a Wallet",
"description": "Be sure to back up your wallet using a secure method. Never share your recovery phrase with anyone."
},
"step3": {
"title": "Refresh your browser",
"description": "Once you set up your wallet, click below to refresh the browser and load up the extension."
}
},
"qr_code": {
"step1": {
"title": "Open the SubWallet app",
"description": "We recommend putting SubWallet on your home screen for quicker access."
},
"step2": {
"title": "Create or Import a Wallet",
"description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone."
},
"step3": {
"title": "Tap the scan button",
"description": "After you scan, a connection prompt will appear for you to connect your wallet."
}
}
},
"clv": {
"extension": {
"step1": {
"title": "Install the CLV Wallet extension",
"description": "We recommend pinning CLV Wallet to your taskbar for quicker access to your wallet."
},
"step2": {
"title": "Create or Import a Wallet",
"description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone."
},
"step3": {
"title": "Refresh your browser",
"description": "Once you set up your wallet, click below to refresh the browser and load up the extension."
}
},
"qr_code": {
"step1": {
"title": "Open the CLV Wallet app",
"description": "We recommend putting CLV Wallet on your home screen for quicker access."
},
"step2": {
"title": "Create or Import a Wallet",
"description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone."
},
"step3": {
"title": "Tap the scan button",
"description": "After you scan, a connection prompt will appear for you to connect your wallet."
}
}
},
"okto": {
"qr_code": {
"step1": {
"title": "Open the Okto app",
"description": "Add Okto to your home screen for quick access"
},
"step2": {
"title": "Create an MPC Wallet",
"description": "Create an account and generate a wallet"
},
"step3": {
"title": "Tap WalletConnect in Settings",
"description": "Tap the Scan QR icon at the top right and confirm the prompt to connect."
}
}
},
"ledger": {
"desktop": {
"step1": {
"title": "Open the Ledger Live app",
"description": "We recommend putting Ledger Live on your home screen for quicker access."
},
"step2": {
"title": "Set up your Ledger",
"description": "Set up a new Ledger or connect to an existing one."
},
"step3": {
"title": "Connect",
"description": "A connection prompt will appear for you to connect your wallet."
}
},
"qr_code": {
"step1": {
"title": "Open the Ledger Live app",
"description": "We recommend putting Ledger Live on your home screen for quicker access."
},
"step2": {
"title": "Set up your Ledger",
"description": "You can either sync with the desktop app or connect your Ledger."
},
"step3": {
"title": "Scan the code",
"description": "Tap WalletConnect then Switch to Scanner. After you scan, a connection prompt will appear for you to connect your wallet."
}
}
},
"valora": {
"qr_code": {
"step1": {
"title": "Open the Valora app",
"description": "We recommend putting Valora on your home screen for quicker access."
},
"step2": {
"title": "Create or import a wallet",
"description": "Create a new wallet or import an existing one."
},
"step3": {
"title": "Tap the scan button",
"description": "After you scan, a connection prompt will appear for you to connect your wallet."
}
}
}
}
}
`;function iIt(e,t){return Object.defineProperty(e,"__recipe__",{value:t,writable:!1}),e}var pMe=iIt;function mMe(e){var{conditions:t}=e;if(!t)throw new Error("Styles have no conditions");function n(r){if(typeof r=="string"||typeof r=="number"||typeof r=="boolean"){if(!t.defaultCondition)throw new Error("No default condition");return{[t.defaultCondition]:r}}if(Array.isArray(r)){if(!("responsiveArray"in t))throw new Error("Responsive arrays are not supported");var s={};for(var a in t.responsiveArray)r[a]!=null&&(s[t.responsiveArray[a]]=r[a]);return s}return r}return pMe(n,{importPath:"@vanilla-extract/sprinkles/createUtils",importName:"createNormalizeValueFn",args:[{conditions:e.conditions}]})}function aIt(e){var{conditions:t}=e;if(!t)throw new Error("Styles have no conditions");var n=mMe(e);function r(s,a){if(typeof s=="string"||typeof s=="number"||typeof s=="boolean"){if(!t.defaultCondition)throw new Error("No default condition");return a(s,t.defaultCondition)}var o=Array.isArray(s)?n(s):s,l={};for(var c in o)o[c]!=null&&(l[c]=a(o[c],c));return l}return pMe(r,{importPath:"@vanilla-extract/sprinkles/createUtils",importName:"createMapValueFn",args:[{conditions:e.conditions}]})}function oIt(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function lIt(e){var t=oIt(e,"string");return typeof t=="symbol"?t:String(t)}function cIt(e,t,n){return t=lIt(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Zge(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function EV(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Zge(Object(n),!0).forEach(function(r){cIt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Zge(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var uIt=e=>function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var s=Object.assign({},...n.map(c=>c.styles)),a=Object.keys(s),o=a.filter(c=>"mappings"in s[c]),l=c=>{var u=[],d={},f=EV({},c),x=!1;for(var g of o){var v=c[g];if(v!=null){var w=s[g];x=!0;for(var C of w.mappings)d[C]=v,f[C]==null&&delete f[C]}}var N=x?EV(EV({},d),f):c,P=function(){var F=N[I],U=s[I];try{if(U.mappings)return 1;if(typeof F=="string"||typeof F=="number")u.push(U.values[F].defaultClass);else if(Array.isArray(F))for(var L=0;L<F.length;L++){var z=F[L];if(z!=null){var Q=U.responsiveArray[L];u.push(U.values[z].conditions[Q])}}else for(var ne in F){var J=F[ne];J!=null&&u.push(U.values[J].conditions[ne])}}catch(X){throw X}};for(var I in N)P();return e(u.join(" "))};return Object.assign(l,{properties:new Set(a)})},dIt=e=>e,fIt=function(){return uIt(dIt)(...arguments)};function xMe(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(n=xMe(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function gMe(){for(var e,t,n=0,r="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=xMe(e))&&(r&&(r+=" "),r+=t);return r}var hIt="AEkU4AngDVgB0QKRAQYBOwDqATEAnwDbAIUApABsAOAAbwCRAEYAiQBPAHYAPgA+ACsANwAlAGMAHwAvACsAJQAWAC8AGwAiACIALwAUACsAEQAiAAsAGwARABcAGAA6ACkALAAsADUAFgAsABEAHQAhAA8AGwAdABUAFgAZAA0ADQAXABAAGQAUABIEqgYJAR4UFjfDBdMAsQCuPwFnAKUBA10jAK5/Ly8vLwE/pwUJ6/0HPwbkMQVXBVgAPSs5APa2EQbIwQuUCkEDyJ4zAsUKLwKOoQKG2D+Ob4kCxcsCg/IBH98JAPKtAUECLY0KP48A4wDiChUAF9S5yAwLPZ0EG3cA/QI5GL0P6wkGKekFBIFnDRsHLQCrAGmR76WcfwBbBpMjBukAGwA7DJMAWxVbqfu75wzbIM8IuykDsRQ7APcta6MAoX0YABcEJdcWAR0AuRnNBPoJIEw3CZcJiB4bVllM44NCABMADAAVAA5rVAAhAA4AR+4V2D3zOVjKleYuChAdX01YPewAEwAMABUADmsgXECXAMPrABsAOQzFABsVW6n7Adq4HB0FWwXiAtCfAsSwCkwcpGUUcxptTPUAuw1nAuEACy00iRfJkQKBewETGwC9DWcC4QALLQFIUCWRTAoDLfsFMgnXaRetAddDAEkrEncCMRYhAusnuTdrADnhAfUlAMcOy7UBG2OBALEFAAUAitNJBRvDHwcXAKgn0QGhKy0DmwBnAQoZPu03dAQYFwCqAccCIQDTKxJzOvNQsAWQOncnNUgF+icFWQVYr7gFaTtdQhI6WEGXe5NmX6H4CxMDxQcl8XcjBKNLAlNTAnUbqycBj6OlNVsDRRcEg2EJANEGqz8vIwcpAjldAGsBYR9xAIMdGQCVAUm3ACdpFwGvxQM3LSFDUwFvWQZlAmUA8UkXAykBBQBJQQCrAF0AcwArtQYH8+8ZjX8ACSEAKQCzG0cB0QHbBwsxl3iB6AAKABEANAA9ADgzd3nTwBBfEFwBTQlMbDoVCwKsD6YL5REVDNEqy9PYADSpB+sDUwfrA1MDUwfrB+sDUwfrA1MDUwNTA1McCvAa08AQXw9IBG0FjgWLBNYIgyZJEYEHKAjSVA10HhxHA0UA/CMlSRw7kzMLJUJMDE0DB/w2QmynfTgDRzGrVPWQogPLMk85bAEecRKgACoPcxw1tU5+ekdxoApLT661f0liTmcCvjqoP/gKIQmTb7t3TgY9EBcnoRDzDC8BsQE3DelL1ATtBjcExR95GRUPyZWYCKEt2QzpJt8unYBWI/EqfwXpS/A82QtJUWQPVQthCd86X4FKAx0BCSKHCtkNNQhpEO8KxWcN4RFBBzUD0UmWAKEG/QsNHTEVsSYMYqgLBTlzBvca8guLJqsTJXr4Bc8aHQZJASUa+wDLLuOFrFotXBhPWwX/CyEjwxSkUBwNIUCzeEQaFwcRJaUCjUNsSoNRMh6PIfI8OQ1iLg9ReAfxPAEZSwt9PJpGp0UKEc4+iT1EIkVMKAQxeywrJ4cJyw+BDLV8bgFVCR0JrQxtEy0REzfBCDUHFSmXICcRCB1GkWCWBPObA+8TzQMHBTsJPQcPA7EcKRMqFSUFCYEg0wLvNtEurwKLVnwBEwXHDyEf2xBMR9wO5QiXAmEDfyXnACkVHQATIpcIP18AW4/UUwEuxwjDamgjcANjFONdEW8HjQ5TB6McLxW7HN1wxF4HhgQon6sJVwFxCZUBWwTfCAU1V4ycID1nT4tUGJcgXUE7XfgCLQxhFZtEuYd0AocPZxIXATEBbwc1DP0CcxHpEWcQkQjnhgA1sTP0OiEESyF/IA0KIwNLbMoLIyb1DPRlAZ8SXgMINDl36menYLIgF/kHFTLBQVwh7QuOT8kMmBq9GD5UKhngB7sD7xrvJ+ZBUwX7A58POkkz6gS5C2UIhwk7AEUOnxMH0xhmCm2MzAEthwGzlQNTjX8Ca4sGMwcHAGMHgwV14QAZAqMInwABAMsDUwA1AqkHmQAVAIE9ATkDIysBHeECiwOPCC3HAZErAe8lBBe/DBEA8zNuRgLDrQKAZmaeBdlUAooCRTEBSSEEAUpDTQOrbd0A1wBHBg/bQwERp0bHFt8/AdtrJwDDAPcAATEHAT0ByQHvaQCzAVsLLQmer7EBSeUlAH8AEWcB0wKFANkAMQB77QFPAEkFVfUFzwJLRQENLRQnU10BtwMbAS8BCQB1BseJocUDGwRpB88CEBcV3QLvKgexAyLbE8lCwQK92lEAMhIKNAq1CrQfX/NcLwItbj1MAAofpD7DP0oFTTtPO1Q7TztUO087VDtPO1Q7TztUA5O73rveCmhfQWHnDKIN0ETEOkUT12BNYC4TxC2zFL0VyiVSGTkauCcBJeBVBQ8ALc9mLAgoNHEXuAA7KWSDPWOCHiwKRxzjU41U9C0XAK1LnjOrDagbEUQ8BUN16WImFgoKHgJkfQJiPldJq1c3HAKh8wJolAJmBQKfgDgXBwJmNwJmIgRqBHsDfw8Dfo45AjlzEzl+Oh8fAmwZAjIyOAYCbcMCbarrhi9jQScBYwDaAN0ARgEHlAyJAPoHvgAJsQJ3KwJ2njsCeUc/Ani2GVjXRapG0wJ8OwJ6xAJ9BQJ87AVVBRxH/Eh5XyAAJxFJVEpXERNKyALQ/QLQyEsjA4hLA4fiRMGRLgLynVz/AwOqS8pMKSHLTUhNqwKLOwKK1L0XAxk/YwGzAo4zAo5YPJN9Ao7VAo5YdFGwUzEGUtBUgQKT9wKTCADlABhVGlWrVcwCLBcpkYIy3XhiRTc1ApebAu+uWB2kAFUhApaLApZ4mAClWahaBX1JADcClrEClkpcQFzNApnHAplgXMZdAxUCnJc5vjqZApwSAp+XAp60hgAZCy0mCwKd7QKejgCxOWEwYesCns8CoGoBpQKemxsCnkqhY8RkIyEnAierAiZ6AqD3AqBIAqLZAqHAAqYrAqXKAqf7AHkCp+5oeGit/0VqGGrNAqzfAqyqAq1jAqz+AlcZAlXYArHd0wMfSmyTArK5CQKy5BNs3G1fbURbAyXJArZYNztujAMpQQK4WgK5QxECuSZzcDJw3QK9FQK71nCSAzINAr6Ecf4DM20CvhZzHnNLAsPHAsMAc350RzFBdNwDPKMDPJYDPbsCxXgCxkMCxgyFAshlTQLIQALJSwLJKgJkmQLdznh1XXiqeSFLzAMYn2b+AmHwGe+VIHsHXo5etw0Cz2cCz2grR0/O7w+bAMKpAs9vASXmA04OfkcBAtwjAtuGAtJLA1JYA1NbAP0DVYiAhTvHEulcQYIYgs+CyoOJAtrDAtnahAyERac4A4ahACsDZAqGbVX1AFEC32EC3rRvcwLiK+0QAfMsIwH0lwHyzoMC6+8C6Wx1Aur1AurgAPVDAbUC7oUC65iWppb/Au47A4XcmHVw3HGdAvL/AGUDjhKZjwL3DwORagOSgwL3lAL51QL4YpoYmqe3M5saA51/Av72ARcANZ8Yn68DBYkDpmYDptUAzcEDBmahhKIBBQMMRQELARsHaQZdtWMBALcEZ7sNhx6vCQATcTUAHwMvEkkDhXsBXyMdAIzrAB0A5p8Dm40IswYbn8EApwURu+kdPT4WeAVoNz5AK0IhQrRfcRFfvACWxQUyAJBMGZu5OyZgMhG6zw4vGMYYicn2BVcFWAVXBVgFYwVYBVcFWAVXBVgFVwVYBVcFWEYVCNeFZwICAgpkXukrBMkDsQYvu7sAuwSnuwDnQCkWsgVGPmk+cEI/QrZfdTdf6ABYETOrAIz+zGvL/KbnRno9JiMEKxYnNjV+bd9qwfEZwixpAWvXbjAXBV8FasnBybgIz0lbAAAACnxefYu+ADM/gQADFtEG5a0jBQCMwwsDAQ0A5WUdPSQfSkKxQrxBOCNfJ2A2JzgjCcE9CkQ/Qz54PoE+cD5xAolCvElCO1/LTk9qTQosa1QvagtuH1/gMzobCWebCmIjKzwdJkKrQrwrzAHL/F/JDh8uCQgJIn6d32o6LUoXyavJrAllwcvMCmBBXw/lEKMRAJONHUVCJRupbTnOOAozP0M+cEI/HAcKHUxHbFssLVrhvBIKfe0dK0I/HF0ISgkOM1RDQjcEO0OcLAqBGy1CPxv1CFMiIxgwMQAFj2HwXgpxZMlgC2AtI25DYBk5AhseYLMGAmsQZU5gTREBZOdgFWCVYH1gs2BLYJFoFhcGtQ7cVam8WgtDFqsBuyvNwQIfFQAcAx4BeQJsLzCVUoABigq4RxoA5CN0jgrKDaZN6gGbAoecTwVAXwD39wkANBZXDAulDCQfuq9HAE8MNAAVE58rggh6AtILS2URGwDYTgZ1BAoeWgAxALa4AZonCxZvqyQ4nxkBWwGGCfwD2e0PBqoGSga5AB3LValaCbthE4kLLT8OuwG7ASICR1ooKCggHh8hLBImBiEMjQBUAm5XkEmVAW4fD3FHAdN1D85RIBmpsE3qBxEFTF8A9/cKAHoGJGwKKwulODAtx69WDQsAX7wLAGNAlQh6AOpN7yIbvwAxALa4AZonLTsOzgKQGHtQu1jIdHKO16WbDvWZFT0b7AEpEFwSBg8bAccJOhCTBRArDDYLABEAs84BAgCkAOEAmIIABWtXLwAUAFsbxi5sdioNwRACOyQz0+EcHgsbfQJ7Ls6hHATBCqrxbAA3OS0Opge7CQAQOi7OERkAfavaHA+7GkcczaF3HgE9Kl8cAuugCAHCAULz5B9lAb4Jtwz6CDwKPgAFwAs9AksNuwi8DTwKvC7OoSoJPA67BZgBG2sKD4sa4QHDARELuxY7AKALOxC7BBige9wAO2sMPAACpgm8BRvQ9QUBvgH6bsoGewAHuwG7D00RErwBAQDqAQAAdBVbBhbLFPxvF7sYOwAuuwLrDlaouwAeuwJVICp/AAG7AALjAAg7FTwVuwAbuwG9KOClWw6/xAD0AGj7L7ZtvgNIo7vIqDsDAbuVJ0sAAlsACrsEAOfdGbsIGnsIoQUK/3AA37unuxjbGruji3lyBvupm4MAErsGGwsBvAAAhgBtuwYAC7unOwEaO7oIoZzKAbsL7QfAqTsA4XsBvwAA5QAVuwAG+wAJuwBpiwAauwAOuwIYu45pFfsAAVsADmsALkseAAa7ABe7CCEADUoBwgC3ryYBwAAAtAAOmwG+J+QAsloAHBsBv/7hCqEABcYLFRXbAAebAEK7AQIAabsAC3sAHbsACLsJoQAFygBunxnVAJEIIQAFygABOwAH2wAdmwghAAaaAAl7ABsrAG0bAOa7gAAIWwAUuwkhAAbKAOOLAAk7C6EOxPtfAAc7AG6cQEgARwADOwAJrQM3AAcbABl7Abv/Aab7AAobAAo7AAn7p+sGuwAJGwADCwAQOwAAFDsAEWsAD4sADesADbsAGQsGFhsAFTsAbpsWswG7ALoAEzsDAGkrCgDhSwACOwAEUgAXewUbAAbQABi7AAv7AF+7AGv7AOSLAbsAF3YBvAABcguhAAVKHgF7KFIAOUUA/gcNDHIAKCpwAaQFCF4BvF4jDAkHb0tsXyqJHzwUYi02A6EKtAHYABYC0QNuAXZyR1IUIQNPAhU+ASwGA3NGvHtSekAAKQAxAfsAUwrbAHuQLAErAHblDREyRgFKAFcFAAFQAQeKzAB4OwQgpQBaANYVAJVoNx+LAM1rsQDP1BYIwnVzGxhWHQnRAYiQqyJTU01IEjzCifkAfxw3QCkr4BGXTwByASksMClCGQ8DMFUE98XuAEtl3ABqAnECPxF6Osd4LjXVBgUAEBsdCggMKgQfHSlOU04IuboAChLNACYAARoAhgCJAI41AO4AtADgAJ08ALsAqwCmAKEA8gCfANMAnADrAQwBBwDAAHkAWgDLAM0BBwDXAOsAiACiATUA4wDYANUDAQcqM9TU1NS2wNzN0M5DMhcBTQFXL0cBVQFkAWMBVgFHS0NFaA0BThUHCAMyNgwHACINJCYpLDg6Oj09PT4/DkAeUVFRUVNTUlMpVFVXVlYcXWFhYGJhI2ZocG9ycnJycnJ0dHR0dHR0dHR0dHZ2d3Z1WwBA7ABFAJYAdAAuAGLyAIoAUwBTADMCc+kAh//y8gBgAI/sAJsASwBeAGD5+aoAgQCBAGUAUgCtAB4AsgB/AjwCPwD4AOMA+gD6AOQA+wDlAOUA5ADiACkCdwFNATwBOgFQAToBOgE6ATUBNAE0ATQBGAFUDwArCAAATRcKFgMVFg4AigCSAKIASwBkGAItAHAAaQCRAxIDJCoDHkE+RykAiwJLAMMCUwKgALoCkgKSApICkgKSApIChwKSApICkgKSApICkgKRApEClAKcApMCkgKSApACkAKQApACjgKRAnEB0AKTApsCkgKSApEWeQsA+gUDpwJdAjYXAVAQNQLeEQorEwFKNxNNkQF3pDwBZVkA/wM9RwEAAJMpHhiPagApYABpAC4AiQOUzIvwroRaBborDsIRAZ3VdCoLBCMxbAEzWmwBsgDdfoB/foB+gYKCfoOGhH6FiIaAh4KIgol+in6LfoyKjX6Ofo+CkH6RfpJ+k36Ug5WIloKXftoC2WzhAtdsAIJsJGygAINsbARCBD8EQQREBEIESARFBEAERgRIBEcEQwRFBEgAlmZsAKMDh2wAtGYBBWwAyVFsbADPbAIMbAD2WmwA9gEZAPYA9AD0APUA9AN8XmzUhCNlvwD2APQA9AD1APQcbGwAiVpsAPYAiQEZAPYAiQLsAPYAiQN8XmzUhCNlvxxsAPdabAEZAPYA9gD0APQA9QD0APcA9AD0APUA9AN8XmzUhCNlvxxsbACJWmwBGQD2AIkA9gCJAuwA9gCJA3xebNSEI2W/HGwCQwE2bAJKATlsAkvBbGwCV2xsA54C7AOeA54DnwOfA58DnwN8XmzUhCNlvxxsbACJWmwBGQOeAIkDngCJAuwDngCJA3xebNSEI2W/HGwEN2wAiQQ4AIkGjTFtIC9s1m4DJmwA/QDGWgJsbABVWv4UMgJsbACJAmwAVAEAuV5sAmxebGwAiV5sAmxebD3YAEls1gJsbEZFNiJ9FGVAe8xvEZKvxVfKZszAVTBzYBH2d1iyUXEHH7twNw7eZF5JJRHI5EgaRr5D20/3dfONrFLSq5qSrrgd2CEUq722WBQ/LzpA+bx1oREI5xy4BDSZNun0ZWORUJqInZSyMaioyvfSI0l5uFDzbWaQ28/zdB0hwR4OQZ0/jn9ALSLNikjFYGfqR389qtFlhD3a6KdIh97rhZYpywuLc7o8ql5/X8KCbPU3L/QlmCowhRXhsGDvg6wUNprA9bM/49uxlAj7ZVy3ouEY/BgFXBNyK0TLrSjZWeJm/T4nz6QGLT3cJNtWRZVZTvIdtaxMMJRHgig9+S11LjBh7Inr06ykoch1U097Rw0hvgmOrydQyaWcEQDg0RavuMuT0zYabUZl1e33HNSK1oNUCS03eh+9C2EvF3fq9h+XBaAMFuoWeZf+mfZgL4HzyiKDIUtfNU4oFu0aE9qt3VA3U4D3fOSrAcYVnjG3cSkp1vhXZnp3JQm4JknKdBitO2NVnGCYQwU3YMWHWB87NEd+4AHuOKI8BSIH92reW0pfs+kWCTJxDCbRjFv8Cfc4/DSBYJScJYTeAEgg9wTEvcwd/QuHRHqGzAQ4fXf5FUI1lPrO+fvEcPl4JInM1z9AtBT2bL4QYEREe7KiSnnxTwtmAFjn8lqT3mND8qTktX2F16Ae9cakqJ6/pEQsHURqyqWlRMCzKXRKfCHT7sYHWx9/T/ugYTFY6iVN3Btm58ATJR5alYZybKMWojwOw3HbFn23NFyeLl7+Er82RchyYuBoGQ3j7SAWNxiYvp5U+Fq/DEzB9cG5DlJWsqkosRze92OVlCtQEYo1S1lF72Z8xWc4ld/+fFcfTEDTFb9d8tJGQ75dpJEvcWyGmGBiTbiWDdGOcw93Dmxq5ISUrmasygONfHLvhgo83HQZenbdBtSzBkvYrCEQ/xEDMhMZsN6gqplx5jGG9mSQLhM81UEdEeJ59sdNJDAFy/gPyJoKlwPZgB/MkC/kICLiCB8va+nCdO2ry4aDfkmPFpF/H/SGQ3LJ6aAv9dtJ8DniHtLOckZix0BVb0iR5V3LAp521LBSIi6AtV7r2ZB/hQEvAw54EFNOQcFnl1xGUIc67tqK1INNwD2n/RbwgzO9h45LM6VMuN8V1ZNIQ6t+Xy3lTqyVCD5kqLy/t3/b8MLbgDg8JIWDkSZ+LrGhhr+gYpH+pr1TnCUnZPjpUdw6bSL6MWVXoDDciQDWECwU2e6VEpfrcOBbrSOijqGkEIoJPbpmeJLkcwbvA0yWIixQVjo0HnYh7fji+Dfdq1mtV1lG2Zz9R7eFMHS+FK7nybutu2fwzDpFldO2pZBshsHJWaltn3PWOoGJpCT2jE8EHOuC6FkejNWcfsWCqNqMLP9xTwcWArj2EiiI7D+EaDi7/2cqHL1gPiF6C/J7aUo7RQqogPZ11WqbyP97nsoMxPOC78wZMF7B1Y0g7JNXJV/nN1m4xx8hbqWz07KSaqr5hE4icB326DMR/vUKX9LoNjle/ZWtbUhrTAcsdgrLlG5Ne8aiR0bS/2ZhpNOVVxavWIZsEM/rd68EB4vjbbD13NkMK1qvMk74vGbSkL7ULO0sZ9R6APSCo6KH+Xn98wEdw1bCPAnDTaBsD6sidAGN58uiH4a3ovG1KyZAu2XtyGgF/vgWKGxw9R1lfAVcfuYE71DHuxtTzfGZnHaDpDGWmfEq0N4GawE7yIkaoz8jcmVmzJe1ydM8q0p08YIxFcY1YcqQc1djWBEoNETDFcgk5waRftEJasPREkrV++N/TOKkERF1fCLrXS8DFGYGRBeECMQRNEs0ES3FzUtXCcNxpYEM3Uei6XodZruXUIRnn+UXf2b/r7n1vQutoi6WoIbW7svDNWBbUWcDUc7F9SJK3bvSy9KIqhgyJHoW2Kpvv0J4ob14HFXGWWVsYXJzjwxS+SADShTgCRjhoDgjAYRGxwJ1Vonw+cpnCKhz8NQPrb0SFxHIRbmG95Q2hlC4mDxvPBRbkFa60cvWakd7f0kVBxxktzZ9agPJEWyA63RSHYVqt8cPrs2uFJ3rS3k9ETGKn5+A6F9IOrdZHfT1biEyUJKEvwzuscwshGCBJvd16TrefW03xVnJf4xvs72PdxrMidjJO8EiWyN/VWyB3fv9kc34YIuZTFtXGo9DuG3H1Uka5FgBMwDPEvRcSabi3WakNQkXFecJlFk6buLVk5YHpuKWTw6oF632FPPSVIVl5hgUAeHhj0t/sw/PEEvThLQDDFE34eCg/rLOyXT3r+L98oRKrlTO0MdALYQ3rRQqC7d822dJPGxF1K4J2TtfPSMFaCAg0n0NGk9yiaKKOJD1v2aBX9HUOIawjjfvwCmjHZJTR62R9c9x33JnBjWrN4QYEOmehy0oZMP9XM9Zyi6TYoe07PaLceRXcCWZiY/imRUWW6+mci7+wMxSdwMdbXckXtvhJH8sc4iQcTwm7yp+3f7CaesTTQB2qkgeXh+wFiSMXfMlH7Yil0OoZ2QTtRLTip2O0cLZ4SstqWHZ6H+8A2kZXhpm0kPbL9dUanTOvziqIUh6Ambwa3WrCb2eWbuCN3L1hgWUmjRC3JoL3dBhR3imSQI8xuCMfsszlji7cSShNSYdqCXPxEVwbqO9i5B6hf93YI7aeyI8jxgcVXK0I/klbvhSXjkjOIwZgPdVwmsFW7HGPLUAvDRuKm+itybRg7c8+Yqqjg824Qf+/NxsBSUNAK9KCoJpauFqK0XQULrWYj4FnxeKDuvr54iokpi+D57e6Y1zxRJJdsHnDR3JyraCUufHBRTKODWBVzthjm4k3/Hv+Q990XDVR+KW+TcJX045LW86EKhz/97aqj89A8ZvTk1//tczosU90loIPVaHuWegJU3wP//7XHcO7c0yQM2jM/IhQKrf8hiObHWiWDZManF8Uf/HzbmDfC2wT//aiZ4hGTv/xzgKwdb1sD6cGEkceow0s3b89/zg+3plyRm0HlZi886j5wUwFhdHiDTaBidZRo5cx/tMeLyguOATbzq17ydhzbrpxunuHx6lbFGiO97gsd4dk//7iCIo+Ew+hG2so5kvv+ITG4c1fzHPtu1Xn5QfUnqY3/uByVmB7gmnE/E+5zdm+6nDmoews5fr+NzThdSHzK4bBQOL9c4O8OI0xLSqjJ4lbniLJg1aFpQRLwaSMZmpkC9e/j6FOVrTQ6a/a4alGgfrl2ZL1sbHUQ3DOI7ntq9diHFfm3t1mul3rdJEJCHnlW/hlQntipMrpeMs7fUr6wK370D7VbXH0DUHzdYfRg/6Z11Ult1sffJS+heHbco15Sxy3+rDnPesqH1lajk0yu02hPUvEUqvcUXWXL7Ad0wNGMx5gOle4XJxq/r/YY0xdco2wRSEGwcT7YADlBrHc9ZbvzOL0QwyWCWWChB9Obg800v7tyBWaNvdwz+fL7Ph9i2irEeJkRgOzeEDw+JiD/V93vH9FgMEoFIJMoIuogmicZohf94SBuPn6hXaV9jP4VVVA/bu+Wg8S88GLtmEPSNRLdtlXx2XL/nuM8nKkhnlnjaropiKKLIH94pLIASci0pDBfj9Hi5BfaTSXQg5+PMjQX91Ktk4MOqK1K99l4BRPv5+vNovGZ3IxQv8ICvjV4/diThpoaM8uvd3D9d/DE477w3yAbW3IDm2i73pZ9aEj38JqS6h/s8/xgmUIVcuq2JTgefAyuoafzQxAuRASeg3NtG3ach/JEkyuX+JDt2PnDZTShUhyHHG3ttBg/6lhAchGjLJBtopj4e01MlCp2yqQRTr4sBBXru+lKaoanwYX8y2aWCJiR3KnhCOkYVFSvsO0oDRujUFOEptiNDTYrJoUbvOyvl4AhC9h3wORiTXK1MrpMfnvdnndnR/HRVSusMBgIxwrLdn3vq1VcncPiD0SquTx/kNmxeFyCT4uXVUd9AL+rSGmuq7OOCzDKeVPjiNWVaoP5KOFqYq5Xcuf/xW9S+u9eIq9GAtZWtQlgkRecjRtvG1NR4WXXpn+pwsTBTIy079Ikg8rSef1aVapIFcXCd6C2wHVjLXR+N0tw4Taw6x6H90BFRgNrtlq2up6hHKuV3inM5RJaQWZHd84e6RsKkk9po3dk9by54tpPw7cBkFas/G+GbHwuG+AwP55BZyXILTHCIVrPpXHEaUPYfL6nphJP1Rc10xG4UaCeY4IHCwuur8xmSQDgY4aVwhzWhjbtSHG8JO6P2i2nC9/0Bfx0zk6dYQq3aw7k5vIObD7SEKrxhz0fQ0+YTOfHW23CBNeZci1qNsUDhoeqmfyP6PvjoEjHk8QbrFyQVZPHVWijnb8YCM65iYNoEbvnchStZ/9cKg5Vd45j8KnB6UjzXl/bkyZx7VoD47ocUUi117WwgySSb4rXgLJ52Mv5XJbp3I+uBP81BUvOjy4Cacgi+GWWlC/8dwgqwiojjUBDnEOxyRyowwLQfytFra1OZS4XvRYr4uoamAfG3I/p2bA7G90yqKThH8Ke00Tqd+3l3dmJpaCZelBMYjGqNLVa3SM4+LQeL56gY6Bymy2LQPVOxjWfj5tq4o74swcxhyGJPynkS5xAjOXZP1/FAYcBT3u6qLoIkEfErwo4gozmyI1YCvM0oyI3ghjGPQSsof2sKUhq91WsKy9cYWN+4A2v4pG/Mxpdc6w6kI/HX7Xb0TuihmsiOy2wQIsrZbUmr3OBSUo6oDJNgQp+YqYkgTgYcWZDgawJw3DFfdzT//PhVUidgB2qa8uw/j9ToHBAS33iT8YLhhAfyXG0bQUFp7QmH7oQ3i6Flf4OTZLvJdh8pfuflmWu2ohm5pTiSg1pl3vq9uluTJwqXfh1hqy8e2iHoD+Y35gCIViTo6VOtK5dD8HYClucJucXASzwe2kPj4S4eYQtmkYHagXhAzp/F541xE8YFYqSPszDuz3soWzHy0p3E2jwZNQaIcGU9FNQwQxeDw0ZlK9dxXrj9IUHGUPTOyib8CqXmbZ7Ex54bn1rLx3qqAavu/gh6XjV0GmN1p+yyMK9HN5uYEvxgbAk43tsheREhyI+Q5WLIneKTGPmYiM/lxOp8fvqHy8YgXK0TlMiX0tliLI2JtfmWZP8eVV732sdYm+pcWzDzEmKLJZyeelyaZKkjPnnUO9keDwtgiLnmd5+t+Sr5y8brRnlvxcWEWfCqIALQYHvaXx6jTg4dAlye469uGwwOZVZCILLfGjaMg4LUCNMTtMSp1aC2y/3wR2t1v3w/iNBRQ+bNbtDqL2NAr7K4rUcyqbSpNrXZgAWXvjxBBtfYLK1uRYt3q2pfXJOAL0HtWcEwJLddOSJKV1SwvcvEuzg/4MPnA8MIUJOLqm3qI6wFyN99Ck6zYaV/zGSAzF/PGsaNa4vPLe5QnyuqVUnVQ6xELA6gbe53aGgeke+R/ycb2LJVyc7BhuzI90zA+c6wUDTb7NH//gdDSl2u/aW7lRJm8m1fLtPxcNuEM5JbkOCZKPM88HUsLRoC1pmKKlvWyeAXuxILbu0snpSxf8N+RgtLUSe5n2gdjOjoSTaN7mMZ7bF+cWk/MS8mFD4pcyl5UN7CbpFZH2a+Pm1VAnUTVfbw8qrmz1G9m5aKmRzY1SMhhPrlCn2t4uNUXNA3IFe6NOjSC1DEaAFZAfDlEkQCsbNhsZPj6NQPDSB3tLiTo0ZYoEbIeEIaKtU3Wk60rEszawTFuyHVd365LA/c/uarABN5M5rGq/dqTG3Ilye/5EKiYisisuzqNaZjmWv0z9TORc0CKbaTea214oNM9u2sXUZub/eqM3Pi/PjRSyQiOSwPWif2asTgu6hS6fb5UGosCWxdedMqdViIUUSSdIJx+qQ4KShfTT39VAWZbi+mB+iKICNwpt6cflY57Rcbs6d1kA26Iru73cuxYVlSvuJdcR5VfDYZRk8X0AXePROyw3Le6LaUdmTLzYsoNhhgQpd67xVNiHgk3pakmndeIAtTC4DCXy9oS6eU4CWxDdVmY53pKNbdAKmQsP37lrJZC6iDXMELGKcHjNuuZgcDyY8W/yv6ha3DX7OWm/35fpvhw55oitf4V+GULlcPWYyGGuVBdro19c8u0RDddDun40W7G5cSIzHLh/qZxb59R+EPY+wZ2XerkUim92hhXpKyW6WtAh6zQS97DrPyjCvKi3pCw96LeKynOpyjtsMQc2RmI/20zFOZcSa2AK++PoRcT6zeJyxlBZ7kk5mhqXGkLlM2hFKc+/T544xXP0Ua38Q6xdPTLTeG1PHnLMaOvksUQMrEFTB/lizCirmFQL8zYVU+OTeYQEFaITsBSMMYexS9HkajO2gGIf2micvntCZJsZQEwIH3/4JGJQGflBuH5rNXmnRRYXDQs3ZoEQoMtYDr1kFKUS/siiQSUxcTH9XYeBZiKDDFQoExREO9dddKQLO3BwMHvymCSTFyY+vxn3D27NDx6OlU092D5EDUwilttqVHpjJQDUceJYCLsK2swfXeNUVrBJT/w/sk+7si8rPtiMFis+oxvGdGQxirMBID700T39mULuNHzOyN+xBfcFACZcyngF1aSpv0JPkNUrAZTqfplv509cGXFUiEEm5dZb+OsP/blizqdK45/dSsIrufYTrCPY2lgJD6k6QljTfXVlHfYKSq+MsagyUcaMintyr95bD8kdTAeYNLNsMmo/Wdd8a2nStBP49ARIjqqpUHWY4q4mvO5Cq/CgCP+4/B+5zutGwX5pssgVLr1+fIM7WWLfiUQDk4c6ZdHZOWv5hG3g2dgQ5NXnpIY+BWwJpaouf25bXnjDzbHnQNofH/c6m+dEAS9Gs2h7pFRPKOBDnqswZ8KZjhId1ytHUTs533KwBoSiImoxKQUgZ7z6pA9QB3sZ8Cq0vwutJTTkfbX8AzCpm2cFXx/P22niUMHauU8IGc+78R6TsutoonoqFuoNA3l80t387YHMoL5KGAT1JO4zmx+vJ0LbLHlicHraSVYvJjnO9p++qnWgKw9OwFVVUagvZuf9qfiuum+hIicxP1q4zDnzkHsCNriLxBpxY9N+UOmqzdY1MunLMDgkMyi3uvnN3UBXJeZ8YLs5xr8QrOhimYoKuGBebZHAiBIkViv3DG8k2oNpp5OIgX6ulqaRN8V62QUPjn5tl1kPXhT9bcd8qIm8gi4or/FGbvQ6pgGSHmnayrugmf5E0upGxPRf/3xOtitGMaHLKJVm5zhglmVfI91o0yxhJZVS/5wQ8zfxK8Ylw0WmHXoGfRkoBRx9Hsnl/6sgTjAVwpmNuSeZtBwlX4qB8Bh8lxjqBDIuFGJ4I1wxN0XRlAAslzqMKwQfyA7OkuivCXfv+i+3XmhcBFM2n4jdT+NyUmBnQJPV3F2sZfKvJhUlXzSosFR4VevVVcOkFnnjdiRWc0TeSYxj41sJGYMbZTeLI3GvyZ8/gAAudQ1+4oFX+enX5V49MczGCYVBuoC4kHjp7ZVxj+clBwPr9k+v05SsezQK3enxLs1Nt/N7c7AImVUysjGou4iOohHo83Zs9/MI/OWB+OyXzOBD93NbApGHXrv8CVRHp2bwH+xB55cfNrdqFD35HSMx4iVmtzYAmSCIV8kXsHoq3DIb93riTWbubnjxbBW5zConVtbxLRStXHkIyAByaozME952Gc9aAdAbBpZSVCH88Uwb/4bPTVOVl+WoMYD7JIvK8VcMrJ8zHV4bbG0Dg7Kx17A4ej/ZcZ2Z5pVuVLUH1E/AccUTKm81SE+LQ6STTUDscUk0x2OWIbEORhg69tdoTGNkA1RfkGIRZHr5mCXOpLC55WWzCZoGPFUVtZRHwh0nq039CDdjEPo+JyaxSQAvDgR6Iqvxy0frrtEG1A385N81l05SSzN+IDm9bypF9m92EUqblnauZ5sjc37wRykOdl7w4o8WMgQsjii3EE/aJYDfHs1cH6DNBEujjcCc8qAefYFyIAURDcDnzun5UmkbBQsU4eu/W8I9nBE0qJKTdg2hwjq0+XV7a3TJ7R+alvJZCRia9lJ+grNB9dbrOmWEvUotMjvDhq4wV/kq4fvIBkzUGpDeYH74rne8uU3dgoNZdR9pUL6q9YDNRfOiF6Dyk+SYXQIghTjm9qR4tBHh0gnmF/9q3Qv22EzaLhSvDlDOxMrrCNRmLCl1jApzLrBCPn2mjn5zqK7OYK7VxOfQ5GfBfoPdyQwqFEgCVHkJ9oTnagRM3R0+rsuN5jQv9icCav/p1WqiEXSzCdLd/WEA6z6dDP7tPqPbeDYKAkVcz1lLGbFOC9b7cBd3MV0Ve8dZ89oR7OnxGS7uVpSry8banVZwpJg+nkH1jRBYa2BvBMY2xITH9ERXCjHzdZxs+ipdXP2DY7X+eWiBhtT2L0RRGTLPeazn5tpl4tu8iE2rWig731iuJDRbCHHy+g/Mb9+miAyVqfIpXT/iZeOxOxODO0hEpLM78I1+G2Z45yi3lS1K3m4WMQ559Lp4UML5vZUjYGJuxl+OPpUH5klpyBujkjprhei0TmUik10gjvNUp8mDkWlNKikmYspaVTqewbnOzJrmz8FLIpsT67EJLHIIfeDcWEfiP+DJrZ1jfxpoAb2abeMqLx+9RuZGzQoYtYVGgAWwEM9Kek2vPIeBNAKD6ao7nw6sgvfeLZPoXkbYO/tStHJdKzk+WFSFEU2NcALJAEP6S8pcnqqBBt57dwTrzQNCIdk2SocK4dLRbD/pu/VryKnm65ZYXiJCfHJk3mx9MRSl+nSK6OqEBSoGjz0/LADddwF/HqcfK3K3O+6YUGQcmj8pZL4PhZ6KrGkb8B38FmDvvLd3XQXbvS/FQmrXFTvJNkaN/FGo83KuS43BK1UfVnIqigGkCoP5fBda2MwAGTGNKX9K9t4Bx83pMFc5KSORmWKv+8VoVggWxoaBz3/9IBh6RwLd1tebwy89xvE5z6EEpXpDfrXWfRsMs6+ekUHH6idVosno55+xQ8Zqzelh0bxtJTgCcH3Z3/Cxlx9eNIS4JIFKOAVrDqbrXRszmY55a5+niJGHtkO3b6mnIDxLa1WXc7BAe33mt2KyM4Fbc3R6/WVTQN8QhlqAtave2WsQTqzWeSlKuGUVIJRqtObpv294rS0kDN1RKzdstZTXJebR2HlzsQ4P3NbMHUqFZMZw+/IKXnh4t+lY8qocp/B1oMszR03EFs3bPeND8QkItMvllObeCz3SZAjqZrobmLcrpFyQV7mwBjg3C3C8/bc5goQhv8j/IXMLGnt4mF7tybRDG5G0polxoUScQkPvmnga2/K+aapKeqSL0BTmo1Cm5g+booNOtdyKva2KoefRURaBk7113QKo3y+WTuFKtgETIK8HRluYS9DvlcciCDvnG8UaJRfZE2siZsiTHvRmN80xkUIInHeRZl5Re/+ATL6VhKFi8CZ/n/jbFV6T5pZ+Uoppvsi3qjacVFOJgWWfdlwVHKPW/TJO3na9hRM9bS2yo2rEsC6IBzRReVO6IesJU7PItzOamr+ROFfwGZmZ7ue8HNxAgLJKb7P3p8dMqk6Be5PJaT/5Rdc1deYVihWH9cjVKc9uz5EnfHqxLUkOO8iJUENBNVf5LyNy8zjLu/78k5WNTywiPfYeX3CPk7yc6CI3lum/CEZwfUaNpcI3KsPqfn2lmz3kd/acQjKA1ebkJaiuLD+epQ/Fc1llHXXMzofWzz/Kd29SNmOhcjMWw1jq1g3YfrXZ9rzXDYW4ZttfgfMi6oCUtBs0PkMVuxmq5lxEoCaSXPSqCJJ7MlKdRDidVt0AFlxk5cTdX++sBF2+E35mjwfm8ERVxH0FvuAQtsfA4V2G0TKTUxeyRGVjd/u6F1SvuAiU2/WaQjcNCU4Ep7VunXCYSbZj3U3wzu/LWM5MPlYuyQ3FOOCD/zt7K295hY2JhwF+ODDIZ676vGQFKveEQYkWj7lkK7rVmD7MhU0Y/tF8EcTTpo4/yqOufbd/zWIpMajnbDuWK2vn6OPPtz2rc9MIBNlPd8tt+yf+7SC4wqEPbozKMCwY5Bygx4JmoIEDsixWRDcdHd6S3/dZMHXOJAAv7+NIstl00crgSqHZKAEe4g3G4dzIV51EeZB01r7p8GNlfUnG/GjZgNGsqXZdYMBVtAtFNv3hJWPve4GvqZ2XxuiNkHTz5kxWgr0PjQdJlVywJ9Zf2ZvqeeTbolKtvK54re2Lq5BoyzfsRtvDfyao3kmyFzDQ88nM+qx83w74RDlkngtYiArI05Epre3GgBeSlMig0pE6RGQaFznKkGeb0SozLCyiOtxh7hgwZlbKbClzUUfC8ntMiHUOZE375RhTy9c4DA+oMLkUDkztSybZbdmP1xpaIbjUpPAHBq3cIq+CBFzbMlMMCCkUQ6d9LGV6GYCsYiEWZIy3nBnuxOYXeU4YTGDSin9e4/pCjPtQSHlg5LMEvIlF0ElthqrF129iK2RPBEWd3XWOl3SWV5uz5VUyZYp5kEFmz7QfP/B1W1BBzQ2iTGbSVT79lUHzcGXz3PJceSgz4uknETUwo0xffpr2KUvZF0i/r2sL3IFIClYx8CbIZE6Qt7MDJbOPB3xMScwaOcWG66IJfCnDkb0D2Mb+PHzX+oiCbxeTIogtyN+s2NJirNACk/OACSOTtV6vscwbzW4M168xqaI+RzR47S1nlV/rOoZnid87n/Ima2XYa3un3BuGAisNjb8eLMT9OnMtazQROFCuO1HiZXaOc0oUDbNC4eKLToOx8DzVhMgGA8XIAQ2x3b6I0uEyLssQjJX3QphcUMx4KsMgJ+72km4N2aqkBF2coKmUEt1eqIMGn+5txMT4kYVGd3ALO+y9Z4PP3d3l48JQK8s9ZZ/Qx/+NBKgBEJFlQ32psoJiihGO7FSYM5L81q72kaAYcilEFMG+ZK1BcMqELkflyCV7v8JEXLO4Rf/oZYNZHZVjJhfL6fnpP9Tio3Euue5uS7FMkfGOeRCTrBZ06Caev7tgufeTrX34Ur/Vvc+b8ksiIShNJtuF9WmYxOZ4xg8y6zTdy3KAB2y5kYkcRnXsptWwAFyKZ2I/QGySNeoQLkINUMloC+5L3WuMMx297Q1xUYLKqZ9XHavaobo6QQv4auMm+i84IhxRpPt9nUmcav9NcjCcP+TcMmxsQZ/F3mgeoA0fQgwvTsyXuuTaM3Sqtv2jaaajmaFQpK9W6uIbeqwvSDo34ZrY6elDUHwSCjHRRmlwmyy+eOra64Ssq0XSXYljMHtKY+FShcMkHsEUY/4Bw63dJ6KpwDaxmthlDdbdE+TvYF3v33cGSKqO+1H1pKYhJMvZD5ckQcHyNF8zrtiR5b0ko6NPGoRexUZTYP6VbUdn3zzxGBOi8Z0OqHjGqYxRXwN3mYi0GYEEZYq+Q3QvdKcEHILLLj8S+VFepSfErtmfZCdvxbfIifFSpEzKi+7VJsLMT+zEFeyp1OdwRC1VZrfTLIyR7xTPUcZFYPD9qI7D70uTb4hdpqPXsJIRNYbZtNwch1OI3trh3u2ScoQyM9POnInsUa+OovcwkUP1UfIzPb95n4BaF2ev57NHAej0+BVMF9/Cj9663HN2/JN3SQgslL914bKfiTTDFAz9PlQEL/dSv1H8xl3mtWxh1McFO9EJXlRDaKQDsyKO4vOJW90NFE6yw2tjbc2GeF95sbs0I9enAa6QwQVf/kJQhAD2BzUDKggOyjy1TEhED6sfk+418lQy3c/uj8aw8UEzZ6hIMCd8RohAkumMtIj9m73l2yPWoGHVTPaywkC7Yj9tBM1NxMgcrDwRtk4RO2WHT7Ql5kQCKdJj6kNuOTeyEBYBjLMhGz+O5/YGa84HEiTYEpZ6fFzy26GG2hWtTyteuYrhSyG56BjsT/wQeLRytpTY3D7sIMqZnJ9z1FDrfyjFlGl2TNw9BQysbaxOuwYYZs/7I6BANgkqCknWZC7/BBXvaeKwAmC959I+G39BUE9bExkNlbRoFRyEtNzv+NJ91FuisG3JCS6uYBeRnfv8AkAfKTeg9EYamqnsGfAV7d0f9DghHEQ5IsPGDIUhgoSj7obM4Bu5uhQ3/CYEDTHc92AsFvDK4XGrwUeGBWBHPlS+f4x+CxmmHz2sAGmSFNt65kwZC64mnaoWlu2310laYn8r62AqsR5dfjyK18MEdurdagldzfJtjFXlZs7St4QhdPiye6TPh2/ZAQLU/Fip5s7TDEM16KtRWrK9hmxnQ7bmfa/+7pa10Z8WDPK3NuJ+NN/RAbQ5vHx2uX0Lm7/w7cAEH/hvZA+mt7J7zGw7YtQYwnNN6dpgwkGjjrS3yQoeoYt1EnczmtmJfQZWzUlP3Hlg9Wzlr9IH23q3thGth+QNEANFettxKfskkGOlLk8AqoKJwDqOxAa6UzAx07plSSyNBJSGco9zjnC5gGbDoKvsMDuBR6bGRlGzJ+hFsGa/Izt78aI+WZ6dJlZKp4pGISuv9rV0sAS0MWEwCmfauO7oQZMiakHU35LBxiyJoOMddhUWgcZuC8r4Ksvn75TTcQXLJ7kWtYhGuGqPd9dZuFjBWQHNwosXY5snbHFQq72CvHXhIg+shQxycuLOuWYErwCLZeF24b7F78pO7xw4X6lIAR02hUOf5087Rl0nOaeb6CK4i/KA/EZv76ftOWZtjwxslNr0E/u8rWUmnf3amfg6UZmBAluuoj3Dd7UV+9IAJ6iYcDfSJlgmIImohjfIUMJ27z+opj50Ak9af2LCNrWrBJvMovA1OeNO+MF/MwZvnaCxTgG7Cw4QfSPF6AYCGFt21M8PySZFeV3t2Rqqs5JMzMYzGRgq4o+UaKRgBf9GHi/9X9HXA3wxkCsd/UhnHSh2zUVDiraio/6nP4y3XJqs8ABfALAtCYU7DHPMPRjgcM6Ad/HiSXDAbOdSMkvGZPAkHs8wuQTy6X2Ov/JFvcPuKfV3/r9Q28";const Jge=new Map([[8217,"apostrophe"],[8260,"fraction slash"],[12539,"middle dot"]]),e1e=4;function pIt(e){let t=0;function n(){return e[t++]<<8|e[t++]}let r=n(),s=1,a=[0,1];for(let F=1;F<r;F++)a.push(s+=n());let o=n(),l=t;t+=o;let c=0,u=0;function d(){return c==0&&(u=u<<8|e[t++],c=8),u>>--c&1}const f=31,x=2**f,g=x>>>1,v=g>>1,w=x-1;let C=0;for(let F=0;F<f;F++)C=C<<1|d();let N=[],P=0,I=x;for(;;){let F=Math.floor(((C-P+1)*s-1)/I),U=0,L=r;for(;L-U>1;){let ne=U+L>>>1;F<a[ne]?L=ne:U=ne}if(U==0)break;N.push(U);let z=P+Math.floor(I*a[U]/s),Q=P+Math.floor(I*a[U+1]/s)-1;for(;!((z^Q)&g);)C=C<<1&w|d(),z=z<<1&w,Q=Q<<1&w|1;for(;z&~Q&v;)C=C&g|C<<1&w>>>1|d(),z=z<<1^g,Q=(Q^g)<<1|g|1;P=z,I=1+Q-z}let R=r-4;return N.map(F=>{switch(F-R){case 3:return R+65792+(e[l++]<<16|e[l++]<<8|e[l++]);case 2:return R+256+(e[l++]<<8|e[l++]);case 1:return R+e[l++];default:return F-1}})}function mIt(e){let t=0;return()=>e[t++]}function bMe(e){return mIt(pIt(xIt(e)))}function xIt(e){let t=[];[..."ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"].forEach((s,a)=>t[s.charCodeAt(0)]=a);let n=e.length,r=new Uint8Array(6*n>>3);for(let s=0,a=0,o=0,l=0;s<n;s++)l=l<<6|t[e.charCodeAt(s)],o+=6,o>=8&&(r[a++]=l>>(o-=8));return r}function gIt(e){return e&1?~e>>1:e>>1}function bIt(e,t){let n=Array(e);for(let r=0,s=0;r<e;r++)n[r]=s+=gIt(t());return n}function KE(e,t=0){let n=[];for(;;){let r=e(),s=e();if(!s)break;t+=r;for(let a=0;a<s;a++)n.push(t+a);t+=s+1}return n}function yMe(e){return YE(()=>{let t=KE(e);if(t.length)return t})}function vMe(e){let t=[];for(;;){let n=e();if(n==0)break;t.push(yIt(n,e))}for(;;){let n=e()-1;if(n<0)break;t.push(vIt(n,e))}return t.flat()}function YE(e){let t=[];for(;;){let n=e(t.length);if(!n)break;t.push(n)}return t}function wMe(e,t,n){let r=Array(e).fill().map(()=>[]);for(let s=0;s<t;s++)bIt(e,n).forEach((a,o)=>r[o].push(a));return r}function yIt(e,t){let n=1+t(),r=t(),s=YE(t);return wMe(s.length,1+e,t).flatMap((o,l)=>{let[c,...u]=o;return Array(s[l]).fill().map((d,f)=>{let x=f*r;return[c+f*n,u.map(g=>g+x)]})})}function vIt(e,t){let n=1+t();return wMe(n,1+e,t).map(s=>[s[0],s.slice(1)])}function wIt(e){let t=[],n=KE(e);return s(r([]),[]),t;function r(a){let o=e(),l=YE(()=>{let c=KE(e).map(u=>n[u]);if(c.length)return r(c)});return{S:o,B:l,Q:a}}function s({S:a,B:o},l,c){if(!(a&4&&c===l[l.length-1])){a&2&&(c=l[l.length-1]),a&1&&t.push(l);for(let u of o)for(let d of u.Q)s(u,[...l,d],c)}}}function CIt(e){return e.toString(16).toUpperCase().padStart(2,"0")}function CMe(e){return`{${CIt(e)}}`}function SIt(e){let t=[];for(let n=0,r=e.length;n<r;){let s=e.codePointAt(n);n+=s<65536?1:2,t.push(s)}return t}function mN(e){let n=e.length;if(n<4096)return String.fromCodePoint(...e);let r=[];for(let s=0;s<n;)r.push(String.fromCodePoint(...e.slice(s,s+=4096)));return r.join("")}function NIt(e,t){let n=e.length,r=n-t.length;for(let s=0;r==0&&s<n;s++)r=e[s]-t[s];return r}var AIt="AEUDVgHLCGMATwDUADIAdAAhADQAFAAtABQAIQAPACcADQASAAoAGAAJABIACQARAAUACwAFAAwABQAQAAMABwAEAAoABQAJAAIACgABAAQAFAALAAIACwABAAIAAQAHAAMAAwAEAAsADAAMAAwACwANAA0AAwAKAAkABAAdAAYAZwDTAeYDMwCxCl8B8xhZAqfoC190UGcThgBurwf7PT09Pb09AjgJum8OjDllxHYUKXAPxzq6tABAxgK8ysUvWAgMPT09PT09PSs6LT2HcgWXWwFLoSMEEEl5RFVMKvO0XQ8ExDdJMnIgPi89uj00MsvBXxEPAGPCDwBnQKoEbwRwBHEEcgRzBHQEdQR2BHcEeAR6BHsEfAR+BIAEgfndBQoBYgULAWIFDAFiBNcE2ATZBRAFEQUvBdALFAsVDPcNBw13DYcOMA4xDjMB4BllHI0B2grbAMDpHLkQ7QHVAPRNQQFnGRUEg0yEB2uaJF8AJpIBpob5AERSMAKNoAXqaQLUBMCzEiC+AZ4EWRJJFbEu7QDQLARtEbgECxDwAb/RyAk1AV4nD2cEQQKTAzsAGpobWgAahAGPCrysdy0OAKwAfFIcBAQFUmoA/PtZADkBIadVj2UMUgx5Il4ANQC9vAITAdQZWxDzALN9AhsZVwIcGSkCBAgXOhG7AqMZ4M7+1M0UAPDNAWsC+mcJDe8AAQA99zkEXLICyQozAo6lAobcP5JvjQLFzwKD9gU/OD8FEQCtEQL6bW+nAKUEvzjDHsuRyUvOFHcacUz5AqIFRSE2kzsBEQCuaQL5DQTlcgO6twSpTiUgCwIFCAUXBHQEqQV6swAVxUlmTmsCwjqsP/wKJQmXb793UgZBEBsnpRD3DDMBtQE7De1L2ATxBjsEyR99GRkPzZWcCKUt3QztJuMuoYBaI/UqgwXtS/Q83QtNUWgPWQtlCeM6Y4FOAyEBDSKLCt0NOQhtEPMKyWsN5RFFBzkD1UmaAKUHAQsRHTUVtSYQYqwLCTl3Bvsa9guPJq8TKXr8BdMaIQZNASka/wDPLueFsFoxXBxPXwYDCyUjxxSoUCANJUC3eEgaGwcVJakCkUNwSodRNh6TIfY8PQ1mLhNRfAf1PAUZTwuBPJ5Gq0UOEdI+jT1IIklMLAQ1fywvJ4sJzw+FDLl8cgFZCSEJsQxxEzERFzfFCDkHGS2XJCcVCCFGlWCaBPefA/MT0QMLBT8JQQcTA7UcLRMuFSkFDYEk1wLzNtUuswKPVoABFwXLDyUf3xBQR+AO6QibAmUDgyXrAC0VIQAXIpsIQ2MAX4/YUwUuywjHamwjdANnFOdhEXMHkQ5XB6ccMxW/HOFwyF4Lhggoo68JWwF1CZkBXwTjCAk1W4ygIEFnU4tYGJsgYUE/XfwCMQxlFZ9EvYd4AosPaxIbATUBcwc5DQECdxHtEWsQlQjrhgQ1tTP4OiUETyGDIBEKJwNPbM4LJyb5DPhpAaMSYgMMND137merYLYkF/0HGTLFQWAh8QuST80MnBrBGEJULhnkB78D8xrzJ+pBVwX/A6MDEzpNM+4EvQtpCIsJPwBJDqMXB9cYagpxjNABMYsBt5kDV5GDAm+PBjcHCwBnC4cFeeUAHQKnCKMABQDPA1cAOQKtB50AGQCFQQE9AycvASHlAo8DkwgxywGVLwHzKQQbwwwVAPc3bkoCw7ECgGpmogXdWAKOAkk1AU0lBAVOR1EDr3HhANsASwYT30cBFatKyxrjQwHfbysAxwD7AAU1BwVBAc0B820AtwFfCzEJorO1AU3pKQCDABVrAdcCiQDdADUAf/EBUwBNBVn5BdMCT0kBETEYK1dhAbsDHwEzAQ0AeQbLjaXJBx8EbQfTAhAbFeEC7y4HtQEDIt8TzULFAr3eVaFgAmSBAmJCW02vWzcgAqH3AmiYAmYJAp+EOBsLAmY7AmYmBG4EfwN/EwN+kjkGOXcXOYI6IyMCbB0CMjY4CgJtxwJtru+KM2dFKwFnAN4A4QBKBQeYDI0A/gvCAA21AncvAnaiPwJ5S0MCeLodXNtFrkbXAnw/AnrIAn0JAnzwBVkFIEgASH1jJAKBbQKAAAKABQJ/rklYSlsVF0rMAtEBAtDMSycDiE8Dh+ZExZEyAvKhXQMDA65LzkwtJQPPTUxNrwKLPwKK2MEbBx1DZwW3Ao43Ao5cQJeBAo7ZAo5ceFG0UzUKUtRUhQKT+wKTDADpABxVHlWvVdAGLBsplYYy4XhmRTs5ApefAu+yWCGoAFklApaPApZ8nACpWaxaCYFNADsClrUClk5cRFzRApnLAplkXMpdBxkCnJs5wjqdApwWAp+bAp64igAdDzEqDwKd8QKekgC1PWE0Ye8CntMCoG4BqQKenx8Cnk6lY8hkJyUrAievAiZ+AqD7AqBMAqLdAqHEAqYvAqXOAqf/AH0Cp/JofGixAANJahxq0QKs4wKsrgKtZwKtAgJXHQJV3AKx4dcDH05slwKyvQ0CsugXbOBtY21IXwMlzQK2XDs/bpADKUUCuF4CuUcVArkqd3A2cOECvRkCu9pwlgMyEQK+iHICAzNxAr4acyJzTwLDywLDBHOCdEs1RXTgAzynAzyaAz2/AsV8AsZHAsYQiQLIaVECyEQCyU8CyS4CZJ0C3dJ4eWF4rnklS9ADGKNnAgJh9BnzlSR7C16SXrsRAs9rAs9sL0tT0vMTnwDGrQLPcwEp6gNOEn5LBQLcJwLbigLSTwNSXANTXwEBA1WMgIk/AMsW7WBFghyC04LOg40C2scC2d6EEIRJpzwDhqUALwNkDoZxWfkAVQLfZQLeuHN3AuIv7RQB8zAnAfSbAfLShwLr8wLpcHkC6vkC6uQA+UcBuQLuiQLrnJaqlwMC7j8DheCYeXDgcaEC8wMAaQOOFpmTAvcTA5FuA5KHAveYAvnZAvhmmhyaq7s3mx4DnYMC/voBGwA5nxyfswMFjQOmagOm2QDRxQMGaqGIogUJAwxJAtQAPwMA4UEXUwER8wNrB5dnBQCTLSu3r73bAYmZFH8RBDkB+ykFIQ6dCZ8Akv0TtRQrxQL3LScApQC3BbmOkRc/xqdtQS4UJo0uAUMBgPwBtSYAdQMOBG0ALAIWDKEAAAoCPQJqA90DfgSRASBFBSF8CgAFAEQAEwA2EgJ3AQAF1QNr7wrFAgD3Cp8nv7G35QGRIUFCAekUfxE0wIkABAAbAFoCRQKEiwAGOlM6lI1tALg6jzrQAI04wTrcAKUA6ADLATqBOjs5/Dn5O3aJOls7nok6bzkYAVYBMwFsBS81XTWeNa01ZjV1NbY1xTWCNZE10jXhNZ41rTXuNf01sjXBNgI2ETXGNdU2FjYnNd417TYuNj02LjUtITY6Nj02PDbJNwgEkDxXNjg23TcgNw82yiA3iTcwCgSwPGc2JDcZN2w6jTchQtRDB0LgQwscDw8JmyhtKFFVBgDpfwDpsAD+mxQ91wLpNSMArQC9BbeOkRdLxptzBL8MDAMMAQgDAAkKCwsLCQoGBAVVBI/DvwDz9b29kaUCb0QtsRTNLt4eGBcSHAMZFhYZEhYEARAEBUEcQRxBHEEcQRxBHEEaQRxBHEFCSTxBPElISUhBNkM2QTYbNklISVmBVIgELgEaJZkC7aMAoQCjBcGOmxdNxrsBvwGJAaQcEZ0ePCklMAAhMvAIMAL54gC7Bm8EescjzQMpARQpKgDUHqSvAj5Gqwr7YrMUACT9AN3rlr3JG9m8w9lIAXltp/v8kfWaIaaR9OwpAES/I3ZVamDXSgB/UsOgAG6D0tq+5CIqE15FiAhV3yA2VhCQ7tj+m6xXaF53FIfGi/IAZIskMGAi2MU7MDVJNCbMzERyHZi+osdPtnFVbvq653O8rwaCy4IAf9OOok65AqJUtUriUfYsGPPVbe6jm0s9lbKlPCUKjdkHsFsEhvX4kT39ZCtAAbwQdn/h4TpO5hTByWAmr5n+Wuwhdegv6bmvX4LyOes3z2+cuHv2JFYwVMNuq2gzn8YHTjlUQd39osyWei4NKl3LAdfxlO876hh5ENp/cOvpuI9bF55guEthLLPOXjD4dktTH04P5TvZrWTM0e4+BHJxj7MLApXIFOs0sWKhNkG8iwuM5wR83my6V3wW06abhDzTXYfOr/ZpFXgXzmv4d12FFyP00/dPGbIVGV5ao8UufGzUwp/IHx6v/wDWJr9iaoCulhWwlZ7A8q/NMoD12+mBdNRgJYnThRLtMx1Bgwttn8/4Qn2CDfOSup9GVXEvA21ILgp0owHYxNOkpwLWz0G7K+WREIDjIzUzSn8I99CuJSmSpPyH0Ke6/NERYiNx+3dncSebPnOUnnWD61AhJ1n/tSLZmU5wYO5GfgzyAYJm6VL91LxZ8hL1lfximQxIDMRhIecQZBmeE5R0XlrpvwplVrJwpa8BBCdp93GPP9lyBeZ2zkRr920CR3cYbKpKHfogvm0nV7XdDz6EbjzlxADCMjSLXuXpIpyuizy39yY+I+H9rmpoIF3YwEjlH9MgGgWcCNTjHEWMqAbprn2Ox7rOHupaVE3lNyg3nt5XaZID6Y+uml5Ja+aOPu+BI+DZbiJVfaspUadakWUX6TA4dETkIqdJJHYnU4Z4yKpt5y8rVIahoMUf8A8kWtAQNCTbjp71gx3/zVdqNz1Sutkw0gFIMVm2BF4Xdv/0olw+NaDIR9Bb3DPweZA2K/cw+/b+AwyWl9ZOP67A9nexmeTNjfdzPGf9J6E6BMPKa5lJh+qNsdUz3HBUevU71eQFCqOcxiIYhacAhh/8PX0J5DdSViZ6WazDDx7cukJNpMfEkYLJ5Ao4vLoVd3d25Pg4qaVa2p2D2L3WvYPJ5Yf/A/MSxptjlgXL/KJtP2U0cRv2I09ATAiWCJYuRwiapeKFsqmi18yMMulDp3HdcIldq+7jkwsJUOHLHCzzzBw5XFvL0CAmo1ub456z7zb7shk3KPGCLZzr47oT1k/j06XNnJvG3Udv6XrP+wsqTBlZ5MaNPt9FOs/4Bt/ja/vbVhTNpBFl9Gq7MqINvGlWKOAwQzwOZy+EzSdjAqKJVV2YcskTuM94aIK+kc/AZaXiZLPREUDpkXIV947IFfj+85TrqPqLfkGcxgboMQjosf+az+odLNXdyp1mDNGsqSdK/pJ2Ca04mt/4d6s1X+lncOEYaGBBeW4pApGcjf7/XJCFbj3N3mFb+BtlIcw8ZiDKoClFX9Rf0bxCqtLpicObKJzBVVHr/6u4siH2hK75RNv7w9GfTbhJOQBYiFUZAByY4rn37tZBHT//kqKsNi3ryL9AqXJRzqiMIJMhILjoi/i8LVEsbu+Ih9bsyW16sgQqjYLO0qda6KaCPKj3DQcu6CfV5lKtjS3ZCdqLAZkOey9MR+QutJBGiz/r15GVD6rCVwJR4UUKC4GNJkfDf00OMW8aQtLSAGLXV8MIi9mbbl/qQEpxCm2L5hutFX4ekeLH4QgBWUFKs/2VVMKy46WtFE6AbwgmYm/Z0yHk5veDIrcl2HpVqb/rSE0PC9EbDzJEWqeaPhh7vF369Umq2kSiB3s5rBI6c/7N9bkRu4h2n+/h5nSwy+7n+/I+6oXQVANo2Jb5zDwtiBPf1ySCzHdT6yJShMzqSRZfnykX49CaFaxhoVF4PBhEuECJ1PrFYSpmHuyYsl14DTAV9ZxRms1XiR/kBrjhZjidOt0UNe+GSml7XNgpVw8YsUTmZXLTK+6iYnyW/wYR1W4UXwOi14xpFROHb6HcZzksgF5DbL2AFXzKNwHU2adjdAY+KCyM/cwRTBkkq/a227NI0q6DR2MkMCRu620t79bGcYUmACtqN3mk/0uNwd3JSXHqE1kzf6Yyj0W2083JNDRnIXDlgBxJ6uf58NN1f6FQiRCWB4egF8QDx74AixV8oTyw7PluIjr3/rj/WzgwPSq4xPojaF7V0xqG2u5ti2L1h6yYHv73Isrukr0kURDIEjClBsBx7kdcXUxaYMS0syT3ymLzDzslNDWQOT1Tao1YNmJHARUenhCkmV9tqCPGI5GqZaRpkiPxyjoncWjyOHYGqvbvRX+Bn1pn7EhRNXa1lqJPmoeN5VqdqIDPhEVhFsyG0d4iQEIYX0wZUbY2XbZWYlpZ/l66IrDDY0q1C1YzBDpHC4h05YqHQLqS9anyl22JQ6lEvjvdBwMHfE7z0luCXD34/rFeDa2TmSeEAykSpYO5j1G/nsgpR3qn0qaQEmLjnnLfcz+veoYqPnRqmRGwCJ6FJ3Gm/Z1/aVX5PSb03MMnjAf41ww54sD5k8FrkfBP+K0b1MrYpapWjtpZfve2HVf4ickX3LKSOhu7qI1Vd4c1kNrn2ajy1t4y93JhV4fnWCKq7OmFpcr7FjdJCXPTql0Drr14Ho3Z87+GPQ4Z/DcTiGqtvZxlRYi8cNuhXABveZIwNl/BX1huhVLaFax5OqypUrQRyb9OE3SSkPlDdy5uo5XGg2EIGEjLY1MO5cr1ibfiFWV7zspcTgkBKkwo5jPyAin04LqizZXb2tDRgwKJjGx4cVk3ngAQixwcxjYAg2Q7vmUR/hpwInMdw7OhC2qyf41vTPkudQAORS0DdLtOGQxb4fH2VYGsvJCkeWPeUwtf1/tuIhzXEThoCZzzSJqqjUtbaPI3ntHm3T5uf849hGUA0zU8ni5W+EEn3/0Y6oUhQFw9z0aGjkljBbAlFXc0y82G2wkd7VdgWa5KTgJJNjNwZMfmdnUIUn1JU5LiWX5UZEZbVlKSN76mlmjUR2ku+fucTNlO4IAAahnLjBhlvQNR9pe9swGBgq0YR7P3VCyI/seYwQ4QBzy9X+HPePgoF8WfKaJ4MBOhLCGHae6Z8xkNXwni9QAKvTNtVA56x8YJflZ/VvONRSlsSLmiSyNMnTjTaE1ko81zkzGEnVwEhjCzlwIqpxmpDAqwsEmtpdr3xpc7i/ZX3f2TzT3M0FdxIEQvO1jgmmiN+D1YpMduAzEhBtj2OBkMN/rv6p7Th4pSH6f5aH3aTvwFTl7EOSgGASI7ttyMehzpm4AVyK+bFEaFg9gnZsSUPpsbAe/0RFhrH+EXZ12Z7thf4dzN1+Sn+G8QrDA1VKaN4IFxD1rQz9Xq9Coii9S9/hPbTGjyBwFH3H1UdQuz5KsgPDEHua4/kPg2Gp/IIItsaLWBqiT9XH45MiQxSosGJ56H/0F2cjcCFd72l1665RNHURdC3lspI77esfJsl+rXXabkAy7vxDXG/XGGcKpwiKDPFfvMEgjkAHil4Za1F36RnyxxvdIAzvgfH8knukYDck07tc++DP4TdWeI7HXuq5Yl6VVFrUQtf64/dkXewlKZSHQo6YvCSpREB0GDrz+Ys2GfO8nw2SwrYwaf88AifzlPvP17bf1mI3AuccJvAjZIpBmqvharKFAebEjVKfGAwpQjWoXlm9LROsq9bCk1UeQ3CJxJqprzssS/Q04JeS1ReCCubL3J7sx86spkP4eNpp95UF+8K748icIs8vdILFklk9skQqi1So6cx3X906pvy1vz+KipTJ8fiVJxsV5MmT0XwA";const XE=44032,kR=4352,TR=4449,IR=4519,SMe=19,NMe=21,xN=28,PR=NMe*xN,jIt=SMe*PR,EIt=XE+jIt,_It=kR+SMe,kIt=TR+NMe,TIt=IR+xN;function Nj(e){return e>>24&255}function AMe(e){return e&16777215}let qee,t1e,Gee,bO;function IIt(){let e=bMe(AIt);qee=new Map(yMe(e).flatMap((t,n)=>t.map(r=>[r,n+1<<24]))),t1e=new Set(KE(e)),Gee=new Map,bO=new Map;for(let[t,n]of vMe(e)){if(!t1e.has(t)&&n.length==2){let[r,s]=n,a=bO.get(r);a||(a=new Map,bO.set(r,a)),a.set(s,t)}Gee.set(t,n.reverse())}}function jMe(e){return e>=XE&&e<EIt}function PIt(e,t){if(e>=kR&&e<_It&&t>=TR&&t<kIt)return XE+(e-kR)*PR+(t-TR)*xN;if(jMe(e)&&t>IR&&t<TIt&&(e-XE)%xN==0)return e+(t-IR);{let n=bO.get(e);return n&&(n=n.get(t),n)?n:-1}}function EMe(e){qee||IIt();let t=[],n=[],r=!1;function s(a){let o=qee.get(a);o&&(r=!0,a|=o),t.push(a)}for(let a of e)for(;;){if(a<128)t.push(a);else if(jMe(a)){let o=a-XE,l=o/PR|0,c=o%PR/xN|0,u=o%xN;s(kR+l),s(TR+c),u>0&&s(IR+u)}else{let o=Gee.get(a);o?n.push(...o):s(a)}if(!n.length)break;a=n.pop()}if(r&&t.length>1){let a=Nj(t[0]);for(let o=1;o<t.length;o++){let l=Nj(t[o]);if(l==0||a<=l){a=l;continue}let c=o-1;for(;;){let u=t[c+1];if(t[c+1]=t[c],t[c]=u,!c||(a=Nj(t[--c]),a<=l))break}a=Nj(t[o])}}return t}function FIt(e){let t=[],n=[],r=-1,s=0;for(let a of e){let o=Nj(a),l=AMe(a);if(r==-1)o==0?r=l:t.push(l);else if(s>0&&s>=o)o==0?(t.push(r,...n),n.length=0,r=l):n.push(l),s=o;else{let c=PIt(r,l);c>=0?r=c:s==0&&o==0?(t.push(r),r=l):(n.push(l),s=o)}}return r>=0&&t.push(r,...n),t}function _Me(e){return EMe(e).map(AMe)}function OIt(e){return FIt(EMe(e))}const n1e=45,kMe=".",TMe=65039,IMe=1,FR=e=>Array.from(e);function QE(e,t){return e.P.has(t)||e.Q.has(t)}class MIt extends Array{get is_emoji(){return!0}}let Kee,PMe,tw,Yee,FMe,d4,_V,jC,_v,r1e,Xee;function Yoe(){if(Kee)return;let e=bMe(hIt);const t=()=>KE(e),n=()=>new Set(t()),r=(d,f)=>f.forEach(x=>d.add(x));Kee=new Map(vMe(e)),PMe=n(),tw=t(),Yee=new Set(t().map(d=>tw[d])),tw=new Set(tw),FMe=n(),n();let s=yMe(e),a=e();const o=()=>{let d=new Set;return t().forEach(f=>r(d,s[f])),r(d,t()),d};d4=YE(d=>{let f=YE(e).map(x=>x+96);if(f.length){let x=d>=a;f[0]-=32,f=mN(f),x&&(f=`Restricted[${f}]`);let g=o(),v=o(),w=!e();return{N:f,P:g,Q:v,M:w,R:x}}}),_V=n(),jC=new Map;let l=t().concat(FR(_V)).sort((d,f)=>d-f);l.forEach((d,f)=>{let x=e(),g=l[f]=x?l[f-x]:{V:[],M:new Map};g.V.push(d),_V.has(d)||jC.set(d,g)});for(let{V:d,M:f}of new Set(jC.values())){let x=[];for(let v of d){let w=d4.filter(N=>QE(N,v)),C=x.find(({G:N})=>w.some(P=>N.has(P)));C||(C={G:new Set,V:[]},x.push(C)),C.V.push(v),r(C.G,w)}let g=x.flatMap(v=>FR(v.G));for(let{G:v,V:w}of x){let C=new Set(g.filter(N=>!v.has(N)));for(let N of w)f.set(N,C)}}_v=new Set;let c=new Set;const u=d=>_v.has(d)?c.add(d):_v.add(d);for(let d of d4){for(let f of d.P)u(f);for(let f of d.Q)u(f)}for(let d of _v)!jC.has(d)&&!c.has(d)&&jC.set(d,IMe);r(_v,_Me(_v)),r1e=wIt(e).map(d=>MIt.from(d)).sort(NIt),Xee=new Map;for(let d of r1e){let f=[Xee];for(let x of d){let g=f.map(v=>{let w=v.get(x);return w||(w=new Map,v.set(x,w)),w});x===TMe?f.push(...g):f=g}for(let x of f)x.V=d}}function Xoe(e){return(OMe(e)?"":`${Qoe(C$([e]))} `)+CMe(e)}function Qoe(e){return`"${e}"`}function RIt(e){if(e.length>=4&&e[2]==n1e&&e[3]==n1e)throw new Error(`invalid label extension: "${mN(e.slice(0,4))}"`)}function LIt(e){for(let n=e.lastIndexOf(95);n>0;)if(e[--n]!==95)throw new Error("underscore allowed only at start")}function DIt(e){let t=e[0],n=Jge.get(t);if(n)throw t9(`leading ${n}`);let r=e.length,s=-1;for(let a=1;a<r;a++){t=e[a];let o=Jge.get(t);if(o){if(s==a)throw t9(`${n} + ${o}`);s=a+1,n=o}}if(s==r)throw t9(`trailing ${n}`)}function C$(e,t=1/0,n=CMe){let r=[];BIt(e[0])&&r.push("◌"),e.length>t&&(t>>=1,e=[...e.slice(0,t),8230,...e.slice(-t)]);let s=0,a=e.length;for(let o=0;o<a;o++){let l=e[o];OMe(l)&&(r.push(mN(e.slice(s,o))),r.push(n(l)),s=o+1)}return r.push(mN(e.slice(s,a))),r.join("")}function BIt(e,t){return Yoe(),tw.has(e)}function OMe(e){return Yoe(),FMe.has(e)}function $It(e){return VIt(UIt(e,OIt,GIt))}function UIt(e,t,n){if(!e)return[];Yoe();let r=0;return e.split(kMe).map(s=>{let a=SIt(s),o={input:a,offset:r};r+=a.length+1;try{let l=o.tokens=qIt(a,t,n),c=l.length,u;if(!c)throw new Error("empty label");let d=o.output=l.flat();if(LIt(d),!(o.emoji=c>1||l[0].is_emoji)&&d.every(x=>x<128))RIt(d),u="ASCII";else{let x=l.flatMap(g=>g.is_emoji?[]:g);if(!x.length)u="Emoji";else{if(tw.has(d[0]))throw t9("leading combining mark");for(let w=1;w<c;w++){let C=l[w];if(!C.is_emoji&&tw.has(C[0]))throw t9(`emoji + combining mark: "${mN(l[w-1])} + ${C$([C[0]])}"`)}DIt(d);let g=FR(new Set(x)),[v]=HIt(g);WIt(v,x),zIt(v,g),u=v.N}}o.type=u}catch(l){o.error=l}return o})}function zIt(e,t){let n,r=[];for(let s of t){let a=jC.get(s);if(a===IMe)return;if(a){let o=a.M.get(s);if(n=n?n.filter(l=>o.has(l)):FR(o),!n.length)return}else r.push(s)}if(n){for(let s of n)if(r.every(a=>QE(s,a)))throw new Error(`whole-script confusable: ${e.N}/${s.N}`)}}function HIt(e){let t=d4;for(let n of e){let r=t.filter(s=>QE(s,n));if(!r.length)throw d4.some(s=>QE(s,n))?RMe(t[0],n):MMe(n);if(t=r,r.length==1)break}return t}function VIt(e){return e.map(({input:t,error:n,output:r})=>{if(n){let s=n.message;throw new Error(e.length==1?s:`Invalid label ${Qoe(C$(t,63))}: ${s}`)}return mN(r)}).join(kMe)}function MMe(e){return new Error(`disallowed character: ${Xoe(e)}`)}function RMe(e,t){let n=Xoe(t),r=d4.find(s=>s.P.has(t));return r&&(n=`${r.N} ${n}`),new Error(`illegal mixture: ${e.N} + ${n}`)}function t9(e){return new Error(`illegal placement: ${e}`)}function WIt(e,t){for(let n of t)if(!QE(e,n))throw RMe(e,n);if(e.M){let n=_Me(t);for(let r=1,s=n.length;r<s;r++)if(Yee.has(n[r])){let a=r+1;for(let o;a<s&&Yee.has(o=n[a]);a++)for(let l=r;l<a;l++)if(n[l]==o)throw new Error(`duplicate non-spacing marks: ${Xoe(o)}`);if(a-r>e1e)throw new Error(`excessive non-spacing marks: ${Qoe(C$(n.slice(r-1,a)))} (${a-r}/${e1e})`);r=a}}}function qIt(e,t,n){let r=[],s=[];for(e=e.slice().reverse();e.length;){let a=KIt(e);if(a)s.length&&(r.push(t(s)),s=[]),r.push(n(a));else{let o=e.pop();if(_v.has(o))s.push(o);else{let l=Kee.get(o);if(l)s.push(...l);else if(!PMe.has(o))throw MMe(o)}}}return s.length&&r.push(t(s)),r}function GIt(e){return e.filter(t=>t!=TMe)}function KIt(e,t){let n=Xee,r,s=e.length;for(;s&&(n=n.get(e[--s]),!!n);){let{V:a}=n;a&&(r=a,e.length=s)}return r}function YIt(e){return $It(e)}function XIt(e){return YIt(e)}const QIt={gasPriceOracle:{address:"0x420000000000000000000000000000000000000F"},l1Block:{address:"0x4200000000000000000000000000000000000015"},l2CrossDomainMessenger:{address:"0x4200000000000000000000000000000000000007"},l2Erc721Bridge:{address:"0x4200000000000000000000000000000000000014"},l2StandardBridge:{address:"0x4200000000000000000000000000000000000010"},l2ToL1MessagePasser:{address:"0x4200000000000000000000000000000000000016"}},ZIt={block:Dut({format(e){var n;return{transactions:(n=e.transactions)==null?void 0:n.map(r=>{if(typeof r=="string")return r;const s=iB(r);return s.typeHex==="0x7e"&&(s.isSystemTx=r.isSystemTx,s.mint=r.mint?nd(r.mint):void 0,s.sourceHash=r.sourceHash,s.type="deposit"),s}),stateRoot:e.stateRoot}}}),transaction:Rut({format(e){const t={};return e.type==="0x7e"&&(t.isSystemTx=e.isSystemTx,t.mint=e.mint?nd(e.mint):void 0,t.sourceHash=e.sourceHash,t.type="deposit"),t}}),transactionReceipt:oht({format(e){return{l1GasPrice:e.l1GasPrice?nd(e.l1GasPrice):null,l1GasUsed:e.l1GasUsed?nd(e.l1GasUsed):null,l1Fee:e.l1Fee?nd(e.l1Fee):null,l1FeeScalar:e.l1FeeScalar?Number(e.l1FeeScalar):null}}})};function JIt(e,t){return nPt(e)?tPt(e):Kpt(e,t)}const ePt={transaction:JIt};function tPt(e){rPt(e);const{sourceHash:t,data:n,from:r,gas:s,isSystemTx:a,mint:o,to:l,value:c}=e,u=[t,r,l??"0x",o?ci(o):"0x",c?ci(c):"0x",s?ci(s):"0x",a?"0x1":"0x",n??"0x"];return Sm(["0x7e",By(u)])}function nPt(e){return e.type==="deposit"||typeof e.sourceHash<"u"}function rPt(e){const{from:t,to:n}=e;if(t&&!ic(t))throw new pd({address:t});if(n&&!ic(n))throw new pd({address:n})}const s1e={contracts:QIt,formatters:ZIt,serializers:ePt},i1e=hB({id:42161,name:"Arbitrum One",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://arb1.arbitrum.io/rpc"]}},blockExplorers:{default:{name:"Arbiscan",url:"https://arbiscan.io",apiUrl:"https://api.arbiscan.io/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:7654707}}}),ZE=hB({id:1,name:"Ethereum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://eth.merkle.io"]}},blockExplorers:{default:{name:"Etherscan",url:"https://etherscan.io",apiUrl:"https://api.etherscan.io/api"}},contracts:{ensRegistry:{address:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},ensUniversalResolver:{address:"0xce01f8eee7E479C928F8919abD53E553a36CeF67",blockCreated:19258213},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:14353601}}}),P7=1,a1e=hB({...s1e,id:10,name:"OP Mainnet",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://mainnet.optimism.io"]}},blockExplorers:{default:{name:"Optimism Explorer",url:"https://optimistic.etherscan.io",apiUrl:"https://api-optimistic.etherscan.io/api"}},contracts:{...s1e.contracts,disputeGameFactory:{[P7]:{address:"0xe5965Ab5962eDc7477C8520243A95517CD252fA9"}},l2OutputOracle:{[P7]:{address:"0xdfe97868233d1aa22e815a266982f2cf17685a27"}},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:4286263},portal:{[P7]:{address:"0xbEb5Fc579115071764c7423A4f12eDde41f106Ed"}},l1StandardBridge:{[P7]:{address:"0x99C9fc46f92E8a1c0deC1b1747d010903E884bE1"}}},sourceId:P7}),o1e=hB({id:137,name:"Polygon",nativeCurrency:{name:"POL",symbol:"POL",decimals:18},rpcUrls:{default:{http:["https://polygon-rpc.com"]}},blockExplorers:{default:{name:"PolygonScan",url:"https://polygonscan.com",apiUrl:"https://api.polygonscan.com/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:25770160}}});var Ob=function(){return Ob=Object.assign||function(t){for(var n,r=1,s=arguments.length;r<s;r++){n=arguments[r];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},Ob.apply(this,arguments)};function sPt(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,r=Object.getOwnPropertySymbols(e);s<r.length;s++)t.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(e,r[s])&&(n[r[s]]=e[r[s]]);return n}function iPt(e,t,n){if(n||arguments.length===2)for(var r=0,s=t.length,a;r<s;r++)(a||!(r in t))&&(a||(a=Array.prototype.slice.call(t,0,r)),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var n9="right-scroll-bar-position",r9="width-before-scroll-bar",aPt="with-scroll-bars-hidden",oPt="--removed-body-scroll-bar-size";function kV(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function lPt(e,t){var n=m.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var s=n.value;s!==r&&(n.value=r,n.callback(r,s))}}}})[0];return n.callback=t,n.facade}var cPt=typeof window<"u"?m.useLayoutEffect:m.useEffect,l1e=new WeakMap;function LMe(e,t){var n=lPt(null,function(r){return e.forEach(function(s){return kV(s,r)})});return cPt(function(){var r=l1e.get(n);if(r){var s=new Set(r),a=new Set(e),o=n.current;s.forEach(function(l){a.has(l)||kV(l,null)}),a.forEach(function(l){s.has(l)||kV(l,o)})}l1e.set(n,e)},[e]),n}var Qee=function(e,t){return Qee=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(n[s]=r[s])},Qee(e,t)};function DMe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");Qee(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var gN=function(){return gN=Object.assign||function(t){for(var n,r=1,s=arguments.length;r<s;r++){n=arguments[r];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},gN.apply(this,arguments)};function Zoe(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,r=Object.getOwnPropertySymbols(e);s<r.length;s++)t.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(e,r[s])&&(n[r[s]]=e[r[s]]);return n}function BMe(e,t,n,r){var s=arguments.length,a=s<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(a=(s<3?o(a):s>3?o(t,n,a):o(t,n))||a);return s>3&&a&&Object.defineProperty(t,n,a),a}function $Me(e,t){return function(n,r){t(n,r,e)}}function UMe(e,t,n,r,s,a){function o(N){if(N!==void 0&&typeof N!="function")throw new TypeError("Function expected");return N}for(var l=r.kind,c=l==="getter"?"get":l==="setter"?"set":"value",u=!t&&e?r.static?e:e.prototype:null,d=t||(u?Object.getOwnPropertyDescriptor(u,r.name):{}),f,x=!1,g=n.length-1;g>=0;g--){var v={};for(var w in r)v[w]=w==="access"?{}:r[w];for(var w in r.access)v.access[w]=r.access[w];v.addInitializer=function(N){if(x)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(N||null))};var C=(0,n[g])(l==="accessor"?{get:d.get,set:d.set}:d[c],v);if(l==="accessor"){if(C===void 0)continue;if(C===null||typeof C!="object")throw new TypeError("Object expected");(f=o(C.get))&&(d.get=f),(f=o(C.set))&&(d.set=f),(f=o(C.init))&&s.unshift(f)}else(f=o(C))&&(l==="field"?s.unshift(f):d[c]=f)}u&&Object.defineProperty(u,r.name,d),x=!0}function zMe(e,t,n){for(var r=arguments.length>2,s=0;s<t.length;s++)n=r?t[s].call(e,n):t[s].call(e);return r?n:void 0}function HMe(e){return typeof e=="symbol"?e:"".concat(e)}function VMe(e,t,n){return typeof t=="symbol"&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:n?"".concat(n," ",t):t})}function WMe(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}function qMe(e,t,n,r){function s(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?a(d.value):s(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})}function GMe(e,t){var n={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,s,a,o=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return o.next=l(0),o.throw=l(1),o.return=l(2),typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function l(u){return function(d){return c([u,d])}}function c(u){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,u[0]&&(n=0)),n;)try{if(r=1,s&&(a=u[0]&2?s.return:u[0]?s.throw||((a=s.return)&&a.call(s),0):s.next)&&!(a=a.call(s,u[1])).done)return a;switch(s=0,a&&(u=[u[0]&2,a.value]),u[0]){case 0:case 1:a=u;break;case 4:return n.label++,{value:u[1],done:!1};case 5:n.label++,s=u[1],u=[0];continue;case 7:u=n.ops.pop(),n.trys.pop();continue;default:if(a=n.trys,!(a=a.length>0&&a[a.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!a||u[1]>a[0]&&u[1]<a[3])){n.label=u[1];break}if(u[0]===6&&n.label<a[1]){n.label=a[1],a=u;break}if(a&&n.label<a[2]){n.label=a[2],n.ops.push(u);break}a[2]&&n.ops.pop(),n.trys.pop();continue}u=t.call(e,n)}catch(d){u=[6,d],s=0}finally{r=a=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}var S$=Object.create?function(e,t,n,r){r===void 0&&(r=n);var s=Object.getOwnPropertyDescriptor(t,n);(!s||("get"in s?!t.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,s)}:function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]};function KMe(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&S$(t,e,n)}function OR(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Joe(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),s,a=[],o;try{for(;(t===void 0||t-- >0)&&!(s=r.next()).done;)a.push(s.value)}catch(l){o={error:l}}finally{try{s&&!s.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a}function YMe(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(Joe(arguments[t]));return e}function XMe(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;for(var r=Array(e),s=0,t=0;t<n;t++)for(var a=arguments[t],o=0,l=a.length;o<l;o++,s++)r[s]=a[o];return r}function QMe(e,t,n){if(n||arguments.length===2)for(var r=0,s=t.length,a;r<s;r++)(a||!(r in t))&&(a||(a=Array.prototype.slice.call(t,0,r)),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}function bN(e){return this instanceof bN?(this.v=e,this):new bN(e)}function ZMe(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=n.apply(e,t||[]),s,a=[];return s=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),l("next"),l("throw"),l("return",o),s[Symbol.asyncIterator]=function(){return this},s;function o(g){return function(v){return Promise.resolve(v).then(g,f)}}function l(g,v){r[g]&&(s[g]=function(w){return new Promise(function(C,N){a.push([g,w,C,N])>1||c(g,w)})},v&&(s[g]=v(s[g])))}function c(g,v){try{u(r[g](v))}catch(w){x(a[0][3],w)}}function u(g){g.value instanceof bN?Promise.resolve(g.value.v).then(d,f):x(a[0][2],g)}function d(g){c("next",g)}function f(g){c("throw",g)}function x(g,v){g(v),a.shift(),a.length&&c(a[0][0],a[0][1])}}function JMe(e){var t,n;return t={},r("next"),r("throw",function(s){throw s}),r("return"),t[Symbol.iterator]=function(){return this},t;function r(s,a){t[s]=e[s]?function(o){return(n=!n)?{value:bN(e[s](o)),done:!1}:a?a(o):o}:a}}function eRe(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],n;return t?t.call(e):(e=typeof OR=="function"?OR(e):e[Symbol.iterator](),n={},r("next"),r("throw"),r("return"),n[Symbol.asyncIterator]=function(){return this},n);function r(a){n[a]=e[a]&&function(o){return new Promise(function(l,c){o=e[a](o),s(l,c,o.done,o.value)})}}function s(a,o,l,c){Promise.resolve(c).then(function(u){a({value:u,done:l})},o)}}function tRe(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}var uPt=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t};function nRe(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&S$(t,e,n);return uPt(t,e),t}function rRe(e){return e&&e.__esModule?e:{default:e}}function sRe(e,t,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(e):r?r.value:t.get(e)}function iRe(e,t,n,r,s){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?s.call(e,n):s?s.value=n:t.set(e,n),n}function aRe(e,t){if(t===null||typeof t!="object"&&typeof t!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof e=="function"?t===e:e.has(t)}function oRe(e,t,n){if(t!=null){if(typeof t!="object"&&typeof t!="function")throw new TypeError("Object expected.");var r,s;if(n){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");r=t[Symbol.asyncDispose]}if(r===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");r=t[Symbol.dispose],n&&(s=r)}if(typeof r!="function")throw new TypeError("Object not disposable.");s&&(r=function(){try{s.call(this)}catch(a){return Promise.reject(a)}}),e.stack.push({value:t,dispose:r,async:n})}else n&&e.stack.push({async:!0});return t}var dPt=typeof SuppressedError=="function"?SuppressedError:function(e,t,n){var r=new Error(n);return r.name="SuppressedError",r.error=e,r.suppressed=t,r};function lRe(e){function t(a){e.error=e.hasError?new dPt(a,e.error,"An error was suppressed during disposal."):a,e.hasError=!0}var n,r=0;function s(){for(;n=e.stack.pop();)try{if(!n.async&&r===1)return r=0,e.stack.push(n),Promise.resolve().then(s);if(n.dispose){var a=n.dispose.call(n.value);if(n.async)return r|=2,Promise.resolve(a).then(s,function(o){return t(o),s()})}else r|=1}catch(o){t(o)}if(r===1)return e.hasError?Promise.reject(e.error):Promise.resolve();if(e.hasError)throw e.error}return s()}function cRe(e,t){return typeof e=="string"&&/^\.\.?\//.test(e)?e.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(n,r,s,a,o){return r?t?".jsx":".js":s&&(!a||!o)?n:s+a+"."+o.toLowerCase()+"js"}):e}const fPt={__extends:DMe,__assign:gN,__rest:Zoe,__decorate:BMe,__param:$Me,__esDecorate:UMe,__runInitializers:zMe,__propKey:HMe,__setFunctionName:VMe,__metadata:WMe,__awaiter:qMe,__generator:GMe,__createBinding:S$,__exportStar:KMe,__values:OR,__read:Joe,__spread:YMe,__spreadArrays:XMe,__spreadArray:QMe,__await:bN,__asyncGenerator:ZMe,__asyncDelegator:JMe,__asyncValues:eRe,__makeTemplateObject:tRe,__importStar:nRe,__importDefault:rRe,__classPrivateFieldGet:sRe,__classPrivateFieldSet:iRe,__classPrivateFieldIn:aRe,__addDisposableResource:oRe,__disposeResources:lRe,__rewriteRelativeImportExtension:cRe},yvn=Object.freeze(Object.defineProperty({__proto__:null,__addDisposableResource:oRe,get __assign(){return gN},__asyncDelegator:JMe,__asyncGenerator:ZMe,__asyncValues:eRe,__await:bN,__awaiter:qMe,__classPrivateFieldGet:sRe,__classPrivateFieldIn:aRe,__classPrivateFieldSet:iRe,__createBinding:S$,__decorate:BMe,__disposeResources:lRe,__esDecorate:UMe,__exportStar:KMe,__extends:DMe,__generator:GMe,__importDefault:rRe,__importStar:nRe,__makeTemplateObject:tRe,__metadata:WMe,__param:$Me,__propKey:HMe,__read:Joe,__rest:Zoe,__rewriteRelativeImportExtension:cRe,__runInitializers:zMe,__setFunctionName:VMe,__spread:YMe,__spreadArray:QMe,__spreadArrays:XMe,__values:OR,default:fPt},Symbol.toStringTag,{value:"Module"}));function hPt(e){return e}function pPt(e,t){t===void 0&&(t=hPt);var n=[],r=!1,s={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(a){var o=t(a,r);return n.push(o),function(){n=n.filter(function(l){return l!==o})}},assignSyncMedium:function(a){for(r=!0;n.length;){var o=n;n=[],o.forEach(a)}n={push:function(l){return a(l)},filter:function(){return n}}},assignMedium:function(a){r=!0;var o=[];if(n.length){var l=n;n=[],l.forEach(a),o=n}var c=function(){var d=o;o=[],d.forEach(a)},u=function(){return Promise.resolve().then(c)};u(),n={push:function(d){o.push(d),u()},filter:function(d){return o=o.filter(d),n}}}};return s}function uRe(e){e===void 0&&(e={});var t=pPt(null);return t.options=gN({async:!0,ssr:!1},e),t}var dRe=function(e){var t=e.sideCar,n=Zoe(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return m.createElement(r,gN({},n))};dRe.isSideCarExport=!0;function fRe(e,t){return e.useMedium(t),dRe}var hRe=uRe(),TV=function(){},N$=m.forwardRef(function(e,t){var n=m.useRef(null),r=m.useState({onScrollCapture:TV,onWheelCapture:TV,onTouchMoveCapture:TV}),s=r[0],a=r[1],o=e.forwardProps,l=e.children,c=e.className,u=e.removeScrollBar,d=e.enabled,f=e.shards,x=e.sideCar,g=e.noIsolation,v=e.inert,w=e.allowPinchZoom,C=e.as,N=C===void 0?"div":C,P=e.gapMode,I=sPt(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),R=x,F=LMe([n,t]),U=Ob(Ob({},I),s);return m.createElement(m.Fragment,null,d&&m.createElement(R,{sideCar:hRe,removeScrollBar:u,shards:f,noIsolation:g,inert:v,setCallbacks:a,allowPinchZoom:!!w,lockRef:n,gapMode:P}),o?m.cloneElement(m.Children.only(l),Ob(Ob({},U),{ref:F})):m.createElement(N,Ob({},U,{className:c,ref:F}),l))});N$.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};N$.classNames={fullWidth:r9,zeroRight:n9};var mPt=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function xPt(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=mPt();return t&&e.setAttribute("nonce",t),e}function gPt(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function bPt(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var yPt=function(){var e=0,t=null;return{add:function(n){e==0&&(t=xPt())&&(gPt(t,n),bPt(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},vPt=function(){var e=yPt();return function(t,n){m.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},ele=function(){var e=vPt(),t=function(n){var r=n.styles,s=n.dynamic;return e(r,s),null};return t},wPt={left:0,top:0,right:0,gap:0},IV=function(e){return parseInt(e||"",10)||0},CPt=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],s=t[e==="padding"?"paddingRight":"marginRight"];return[IV(n),IV(r),IV(s)]},SPt=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return wPt;var t=CPt(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},NPt=ele(),f4="data-scroll-locked",APt=function(e,t,n,r){var s=e.left,a=e.top,o=e.right,l=e.gap;return n===void 0&&(n="margin"),`
.`.concat(aPt,` {
overflow: hidden `).concat(r,`;
padding-right: `).concat(l,"px ").concat(r,`;
}
body[`).concat(f4,`] {
overflow: hidden `).concat(r,`;
overscroll-behavior: contain;
`).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
padding-left: `.concat(s,`px;
padding-top: `).concat(a,`px;
padding-right: `).concat(o,`px;
margin-left:0;
margin-top:0;
margin-right: `).concat(l,"px ").concat(r,`;
`),n==="padding"&&"padding-right: ".concat(l,"px ").concat(r,";")].filter(Boolean).join(""),`
}
.`).concat(n9,` {
right: `).concat(l,"px ").concat(r,`;
}
.`).concat(r9,` {
margin-right: `).concat(l,"px ").concat(r,`;
}
.`).concat(n9," .").concat(n9,` {
right: 0 `).concat(r,`;
}
.`).concat(r9," .").concat(r9,` {
margin-right: 0 `).concat(r,`;
}
body[`).concat(f4,`] {
`).concat(oPt,": ").concat(l,`px;
}
`)},c1e=function(){var e=parseInt(document.body.getAttribute(f4)||"0",10);return isFinite(e)?e:0},jPt=function(){m.useEffect(function(){return document.body.setAttribute(f4,(c1e()+1).toString()),function(){var e=c1e()-1;e<=0?document.body.removeAttribute(f4):document.body.setAttribute(f4,e.toString())}},[])},pRe=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,s=r===void 0?"margin":r;jPt();var a=m.useMemo(function(){return SPt(s)},[s]);return m.createElement(NPt,{styles:APt(a,!t,s,n?"":"!important")})},Zee=!1;if(typeof window<"u")try{var pP=Object.defineProperty({},"passive",{get:function(){return Zee=!0,!0}});window.addEventListener("test",pP,pP),window.removeEventListener("test",pP,pP)}catch{Zee=!1}var G6=Zee?{passive:!1}:!1,EPt=function(e){return e.tagName==="TEXTAREA"},mRe=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!EPt(e)&&n[t]==="visible")},_Pt=function(e){return mRe(e,"overflowY")},kPt=function(e){return mRe(e,"overflowX")},u1e=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var s=xRe(e,r);if(s){var a=gRe(e,r),o=a[1],l=a[2];if(o>l)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},TPt=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},IPt=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},xRe=function(e,t){return e==="v"?_Pt(t):kPt(t)},gRe=function(e,t){return e==="v"?TPt(t):IPt(t)},PPt=function(e,t){return e==="h"&&t==="rtl"?-1:1},FPt=function(e,t,n,r,s){var a=PPt(e,window.getComputedStyle(t).direction),o=a*r,l=n.target,c=t.contains(l),u=!1,d=o>0,f=0,x=0;do{var g=gRe(e,l),v=g[0],w=g[1],C=g[2],N=w-C-a*v;(v||N)&&xRe(e,l)&&(f+=N,x+=v),l instanceof ShadowRoot?l=l.host:l=l.parentNode}while(!c&&l!==document.body||c&&(t.contains(l)||t===l));return(d&&Math.abs(f)<1||!d&&Math.abs(x)<1)&&(u=!0),u},mP=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},d1e=function(e){return[e.deltaX,e.deltaY]},f1e=function(e){return e&&"current"in e?e.current:e},OPt=function(e,t){return e[0]===t[0]&&e[1]===t[1]},MPt=function(e){return`
.block-interactivity-`.concat(e,` {pointer-events: none;}
.allow-interactivity-`).concat(e,` {pointer-events: all;}
`)},RPt=0,K6=[];function LPt(e){var t=m.useRef([]),n=m.useRef([0,0]),r=m.useRef(),s=m.useState(RPt++)[0],a=m.useState(ele)[0],o=m.useRef(e);m.useEffect(function(){o.current=e},[e]),m.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var w=iPt([e.lockRef.current],(e.shards||[]).map(f1e),!0).filter(Boolean);return w.forEach(function(C){return C.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),w.forEach(function(C){return C.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var l=m.useCallback(function(w,C){if("touches"in w&&w.touches.length===2||w.type==="wheel"&&w.ctrlKey)return!o.current.allowPinchZoom;var N=mP(w),P=n.current,I="deltaX"in w?w.deltaX:P[0]-N[0],R="deltaY"in w?w.deltaY:P[1]-N[1],F,U=w.target,L=Math.abs(I)>Math.abs(R)?"h":"v";if("touches"in w&&L==="h"&&U.type==="range")return!1;var z=u1e(L,U);if(!z)return!0;if(z?F=L:(F=L==="v"?"h":"v",z=u1e(L,U)),!z)return!1;if(!r.current&&"changedTouches"in w&&(I||R)&&(r.current=F),!F)return!0;var Q=r.current||F;return FPt(Q,C,w,Q==="h"?I:R)},[]),c=m.useCallback(function(w){var C=w;if(!(!K6.length||K6[K6.length-1]!==a)){var N="deltaY"in C?d1e(C):mP(C),P=t.current.filter(function(F){return F.name===C.type&&(F.target===C.target||C.target===F.shadowParent)&&OPt(F.delta,N)})[0];if(P&&P.should){C.cancelable&&C.preventDefault();return}if(!P){var I=(o.current.shards||[]).map(f1e).filter(Boolean).filter(function(F){return F.contains(C.target)}),R=I.length>0?l(C,I[0]):!o.current.noIsolation;R&&C.cancelable&&C.preventDefault()}}},[]),u=m.useCallback(function(w,C,N,P){var I={name:w,delta:C,target:N,should:P,shadowParent:DPt(N)};t.current.push(I),setTimeout(function(){t.current=t.current.filter(function(R){return R!==I})},1)},[]),d=m.useCallback(function(w){n.current=mP(w),r.current=void 0},[]),f=m.useCallback(function(w){u(w.type,d1e(w),w.target,l(w,e.lockRef.current))},[]),x=m.useCallback(function(w){u(w.type,mP(w),w.target,l(w,e.lockRef.current))},[]);m.useEffect(function(){return K6.push(a),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:x}),document.addEventListener("wheel",c,G6),document.addEventListener("touchmove",c,G6),document.addEventListener("touchstart",d,G6),function(){K6=K6.filter(function(w){return w!==a}),document.removeEventListener("wheel",c,G6),document.removeEventListener("touchmove",c,G6),document.removeEventListener("touchstart",d,G6)}},[]);var g=e.removeScrollBar,v=e.inert;return m.createElement(m.Fragment,null,v?m.createElement(a,{styles:MPt(s)}):null,g?m.createElement(pRe,{gapMode:e.gapMode}):null)}function DPt(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const BPt=fRe(hRe,LPt);var bRe=m.forwardRef(function(e,t){return m.createElement(N$,Ob({},e,{ref:t,sideCar:BPt}))});bRe.classNames=N$.classNames;function h1e(e){var t=e.match(/^var\((.*)\)$/);return t?t[1]:e}function $Pt(e,t){var n=e;for(var r of t){if(!(r in n))throw new Error("Path ".concat(t.join(" -> ")," does not exist in object"));n=n[r]}return n}function yRe(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[],r={};for(var s in e){var a=e[s],o=[...n,s];typeof a=="string"||typeof a=="number"||a==null?r[s]=t(a,o):typeof a=="object"&&!Array.isArray(a)?r[s]=yRe(a,t,o):console.warn('Skipping invalid key "'.concat(o.join("."),'". Should be a string, number, null or object. Received: "').concat(Array.isArray(a)?"Array":typeof a,'"'))}return r}function p1e(e,t){var n={};if(typeof t=="object"){var r=e;yRe(t,(l,c)=>{if(l!=null){var u=$Pt(r,c);n[h1e(u)]=String(l)}})}else{var s=e;for(var a in s){var o=s[a];o!=null&&(n[h1e(a)]=o)}}return Object.defineProperty(n,"toString",{value:function(){return Object.keys(this).map(c=>"".concat(c,":").concat(this[c])).join(";")},writable:!1}),n}var Aj={exports:{}},UPt=Aj.exports,m1e;function zPt(){return m1e||(m1e=1,function(e,t){(function(n,r){var s="1.0.40",a="",o="?",l="function",c="undefined",u="object",d="string",f="major",x="model",g="name",v="type",w="vendor",C="version",N="architecture",P="console",I="mobile",R="tablet",F="smarttv",U="wearable",L="embedded",z=500,Q="Amazon",ne="Apple",J="ASUS",X="BlackBerry",re="Browser",pe="Chrome",Y="Edge",ie="Firefox",oe="Google",G="Huawei",V="LG",ee="Microsoft",ae="Motorola",fe="Opera",Ne="Samsung",he="Sharp",ge="Sony",ye="Xiaomi",ve="Zebra",je="Facebook",Ie="Chromium OS",Le="Mac OS",Qe=" Browser",$e=function(Bt,$t){var qe={};for(var Ye in Bt)$t[Ye]&&$t[Ye].length%2===0?qe[Ye]=$t[Ye].concat(Bt[Ye]):qe[Ye]=Bt[Ye];return qe},it=function(Bt){for(var $t={},qe=0;qe<Bt.length;qe++)$t[Bt[qe].toUpperCase()]=Bt[qe];return $t},tt=function(Bt,$t){return typeof Bt===d?lt($t).indexOf(lt(Bt))!==-1:!1},lt=function(Bt){return Bt.toLowerCase()},ft=function(Bt){return typeof Bt===d?Bt.replace(/[^\d\.]/g,a).split(".")[0]:r},ut=function(Bt,$t){if(typeof Bt===d)return Bt=Bt.replace(/^\s\s*/,a),typeof $t===c?Bt:Bt.substring(0,z)},qt=function(Bt,$t){for(var qe=0,Ye,ht,Zt,zt,Et,nt;qe<$t.length&&!Et;){var Ue=$t[qe],Rt=$t[qe+1];for(Ye=ht=0;Ye<Ue.length&&!Et&&Ue[Ye];)if(Et=Ue[Ye++].exec(Bt),Et)for(Zt=0;Zt<Rt.length;Zt++)nt=Et[++ht],zt=Rt[Zt],typeof zt===u&&zt.length>0?zt.length===2?typeof zt[1]==l?this[zt[0]]=zt[1].call(this,nt):this[zt[0]]=zt[1]:zt.length===3?typeof zt[1]===l&&!(zt[1].exec&&zt[1].test)?this[zt[0]]=nt?zt[1].call(this,nt,zt[2]):r:this[zt[0]]=nt?nt.replace(zt[1],zt[2]):r:zt.length===4&&(this[zt[0]]=nt?zt[3].call(this,nt.replace(zt[1],zt[2])):r):this[zt]=nt||r;qe+=2}},It=function(Bt,$t){for(var qe in $t)if(typeof $t[qe]===u&&$t[qe].length>0){for(var Ye=0;Ye<$t[qe].length;Ye++)if(tt($t[qe][Ye],Bt))return qe===o?r:qe}else if(tt($t[qe],Bt))return qe===o?r:qe;return $t.hasOwnProperty("*")?$t["*"]:Bt},nn={"1.0":"/8","1.2":"/1","1.3":"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"},jt={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2","8.1":"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},cn={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[C,[g,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[C,[g,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[g,C],[/opios[\/ ]+([\w\.]+)/i],[C,[g,fe+" Mini"]],[/\bop(?:rg)?x\/([\w\.]+)/i],[C,[g,fe+" GX"]],[/\bopr\/([\w\.]+)/i],[C,[g,fe]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[C,[g,"Baidu"]],[/\b(?:mxbrowser|mxios|myie2)\/?([-\w\.]*)\b/i],[C,[g,"Maxthon"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer|sleipnir)[\/ ]?([\w\.]*)/i,/(avant|iemobile|slim(?:browser|boat|jet))[\/ ]?([\d\.]*)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|duckduckgo|klar|helio|(?=comodo_)?dragon)\/([-\w\.]+)/i,/(heytap|ovi|115)browser\/([\d\.]+)/i,/(weibo)__([\d\.]+)/i],[g,C],[/quark(?:pc)?\/([-\w\.]+)/i],[C,[g,"Quark"]],[/\bddg\/([\w\.]+)/i],[C,[g,"DuckDuckGo"]],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[C,[g,"UC"+re]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[C,[g,"WeChat"]],[/konqueror\/([\w\.]+)/i],[C,[g,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[C,[g,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[C,[g,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[C,[g,"Smart Lenovo "+re]],[/(avast|avg)\/([\w\.]+)/i],[[g,/(.+)/,"$1 Secure "+re],C],[/\bfocus\/([\w\.]+)/i],[C,[g,ie+" Focus"]],[/\bopt\/([\w\.]+)/i],[C,[g,fe+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[C,[g,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[C,[g,"Dolphin"]],[/coast\/([\w\.]+)/i],[C,[g,fe+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[C,[g,"MIUI"+Qe]],[/fxios\/([\w\.-]+)/i],[C,[g,ie]],[/\bqihoobrowser\/?([\w\.]*)/i],[C,[g,"360"]],[/\b(qq)\/([\w\.]+)/i],[[g,/(.+)/,"$1Browser"],C],[/(oculus|sailfish|huawei|vivo|pico)browser\/([\w\.]+)/i],[[g,/(.+)/,"$1"+Qe],C],[/samsungbrowser\/([\w\.]+)/i],[C,[g,Ne+" Internet"]],[/metasr[\/ ]?([\d\.]+)/i],[C,[g,"Sogou Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[g,"Sogou Mobile"],C],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345(?=browser|chrome|explorer))\w*[\/ ]?v?([\w\.]+)/i],[g,C],[/(lbbrowser|rekonq)/i,/\[(linkedin)app\]/i],[g],[/ome\/([\w\.]+) \w* ?(iron) saf/i,/ome\/([\w\.]+).+qihu (360)[es]e/i],[C,g],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[g,je],C],[/(Klarna)\/([\w\.]+)/i,/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(alipay)client\/([\w\.]+)/i,/(twitter)(?:and| f.+e\/([\w\.]+))/i,/(chromium|instagram|snapchat)[\/ ]([-\w\.]+)/i],[g,C],[/\bgsa\/([\w\.]+) .*safari\//i],[C,[g,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[C,[g,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[C,[g,pe+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[g,pe+" WebView"],C],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[C,[g,"Android "+re]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[g,C],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[C,[g,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[C,g],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[g,[C,It,nn]],[/(webkit|khtml)\/([\w\.]+)/i],[g,C],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[g,"Netscape"],C],[/(wolvic|librewolf)\/([\w\.]+)/i],[g,C],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[C,[g,ie+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i],[g,[C,/_/g,"."]],[/(cobalt)\/([\w\.]+)/i],[g,[C,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[N,"amd64"]],[/(ia32(?=;))/i],[[N,lt]],[/((?:i[346]|x)86)[;\)]/i],[[N,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[N,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[N,"armhf"]],[/windows (ce|mobile); ppc;/i],[[N,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[N,/ower/,a,lt]],[/(sun4\w)[;\)]/i],[[N,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[N,lt]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[x,[w,Ne],[v,R]],[/\b((?:s[cgp]h|gt|sm)-(?![lr])\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]((?!sm-[lr])[-\w]+)/i,/sec-(sgh\w+)/i],[x,[w,Ne],[v,I]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[x,[w,ne],[v,I]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[x,[w,ne],[v,R]],[/(macintosh);/i],[x,[w,ne]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[x,[w,he],[v,I]],[/(?:honor)([-\w ]+)[;\)]/i],[x,[w,"Honor"],[v,I]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[x,[w,G],[v,R]],[/(?:huawei)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[x,[w,G],[v,I]],[/\b(poco[\w ]+|m2\d{3}j\d\d[a-z]{2})(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/oid[^\)]+; (m?[12][0-389][01]\w{3,6}[c-y])( bui|; wv|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite|pro)?)(?: bui|\))/i],[[x,/_/g," "],[w,ye],[v,I]],[/oid[^\)]+; (2\d{4}(283|rpbf)[cgl])( bui|\))/i,/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[x,/_/g," "],[w,ye],[v,R]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[x,[w,"OPPO"],[v,I]],[/\b(opd2\d{3}a?) bui/i],[x,[w,"OPPO"],[v,R]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[x,[w,"Vivo"],[v,I]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[x,[w,"Realme"],[v,I]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[x,[w,ae],[v,I]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[x,[w,ae],[v,R]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[x,[w,V],[v,R]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[x,[w,V],[v,I]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[x,[w,"Lenovo"],[v,R]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[x,/_/g," "],[w,"Nokia"],[v,I]],[/(pixel c)\b/i],[x,[w,oe],[v,R]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[x,[w,oe],[v,I]],[/droid.+; (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[x,[w,ge],[v,I]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[x,"Xperia Tablet"],[w,ge],[v,R]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[x,[w,"OnePlus"],[v,I]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo(?!bc)\w\w)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[x,[w,Q],[v,R]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[x,/(.+)/g,"Fire Phone $1"],[w,Q],[v,I]],[/(playbook);[-\w\),; ]+(rim)/i],[x,w,[v,R]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[x,[w,X],[v,I]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[x,[w,J],[v,R]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[x,[w,J],[v,I]],[/(nexus 9)/i],[x,[w,"HTC"],[v,R]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[w,[x,/_/g," "],[v,I]],[/droid [\w\.]+; ((?:8[14]9[16]|9(?:0(?:48|60|8[01])|1(?:3[27]|66)|2(?:6[69]|9[56])|466))[gqswx])\w*(\)| bui)/i],[x,[w,"TCL"],[v,R]],[/(itel) ((\w+))/i],[[w,lt],x,[v,It,{tablet:["p10001l","w7001"],"*":"mobile"}]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[x,[w,"Acer"],[v,R]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[x,[w,"Meizu"],[v,I]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[x,[w,"Ulefone"],[v,I]],[/; (energy ?\w+)(?: bui|\))/i,/; energizer ([\w ]+)(?: bui|\))/i],[x,[w,"Energizer"],[v,I]],[/; cat (b35);/i,/; (b15q?|s22 flip|s48c|s62 pro)(?: bui|\))/i],[x,[w,"Cat"],[v,I]],[/((?:new )?andromax[\w- ]+)(?: bui|\))/i],[x,[w,"Smartfren"],[v,I]],[/droid.+; (a(?:015|06[35]|142p?))/i],[x,[w,"Nothing"],[v,I]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron|infinix|tecno|micromax|advan)[-_ ]?([-\w]*)/i,/; (imo) ((?!tab)[\w ]+?)(?: bui|\))/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[w,x,[v,I]],[/(imo) (tab \w+)/i,/(kobo)\s(ereader|touch)/i,/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[w,x,[v,R]],[/(surface duo)/i],[x,[w,ee],[v,R]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[x,[w,"Fairphone"],[v,I]],[/(u304aa)/i],[x,[w,"AT&T"],[v,I]],[/\bsie-(\w*)/i],[x,[w,"Siemens"],[v,I]],[/\b(rct\w+) b/i],[x,[w,"RCA"],[v,R]],[/\b(venue[\d ]{2,7}) b/i],[x,[w,"Dell"],[v,R]],[/\b(q(?:mv|ta)\w+) b/i],[x,[w,"Verizon"],[v,R]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[x,[w,"Barnes & Noble"],[v,R]],[/\b(tm\d{3}\w+) b/i],[x,[w,"NuVision"],[v,R]],[/\b(k88) b/i],[x,[w,"ZTE"],[v,R]],[/\b(nx\d{3}j) b/i],[x,[w,"ZTE"],[v,I]],[/\b(gen\d{3}) b.+49h/i],[x,[w,"Swiss"],[v,I]],[/\b(zur\d{3}) b/i],[x,[w,"Swiss"],[v,R]],[/\b((zeki)?tb.*\b) b/i],[x,[w,"Zeki"],[v,R]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[w,"Dragon Touch"],x,[v,R]],[/\b(ns-?\w{0,9}) b/i],[x,[w,"Insignia"],[v,R]],[/\b((nxa|next)-?\w{0,9}) b/i],[x,[w,"NextBook"],[v,R]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[w,"Voice"],x,[v,I]],[/\b(lvtel\-)?(v1[12]) b/i],[[w,"LvTel"],x,[v,I]],[/\b(ph-1) /i],[x,[w,"Essential"],[v,I]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[x,[w,"Envizen"],[v,R]],[/\b(trio[-\w\. ]+) b/i],[x,[w,"MachSpeed"],[v,R]],[/\btu_(1491) b/i],[x,[w,"Rotor"],[v,R]],[/(shield[\w ]+) b/i],[x,[w,"Nvidia"],[v,R]],[/(sprint) (\w+)/i],[w,x,[v,I]],[/(kin\.[onetw]{3})/i],[[x,/\./g," "],[w,ee],[v,I]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[x,[w,ve],[v,R]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[x,[w,ve],[v,I]],[/smart-tv.+(samsung)/i],[w,[v,F]],[/hbbtv.+maple;(\d+)/i],[[x,/^/,"SmartTV"],[w,Ne],[v,F]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[w,V],[v,F]],[/(apple) ?tv/i],[w,[x,ne+" TV"],[v,F]],[/crkey/i],[[x,pe+"cast"],[w,oe],[v,F]],[/droid.+aft(\w+)( bui|\))/i],[x,[w,Q],[v,F]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[x,[w,he],[v,F]],[/(bravia[\w ]+)( bui|\))/i],[x,[w,ge],[v,F]],[/(mitv-\w{5}) bui/i],[x,[w,ye],[v,F]],[/Hbbtv.*(technisat) (.*);/i],[w,x,[v,F]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[w,ut],[x,ut],[v,F]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[v,F]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[w,x,[v,P]],[/droid.+; (shield) bui/i],[x,[w,"Nvidia"],[v,P]],[/(playstation [345portablevi]+)/i],[x,[w,ge],[v,P]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[x,[w,ee],[v,P]],[/\b(sm-[lr]\d\d[05][fnuw]?s?)\b/i],[x,[w,Ne],[v,U]],[/((pebble))app/i],[w,x,[v,U]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[x,[w,ne],[v,U]],[/droid.+; (glass) \d/i],[x,[w,oe],[v,U]],[/droid.+; (wt63?0{2,3})\)/i],[x,[w,ve],[v,U]],[/droid.+; (glass) \d/i],[x,[w,oe],[v,U]],[/(pico) (4|neo3(?: link|pro)?)/i],[w,x,[v,U]],[/; (quest( \d| pro)?)/i],[x,[w,je],[v,U]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[w,[v,L]],[/(aeobc)\b/i],[x,[w,Q],[v,L]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i],[x,[v,I]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[x,[v,R]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[v,R]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[v,I]],[/(android[-\w\. ]{0,9});.+buil/i],[x,[w,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[C,[g,Y+"HTML"]],[/(arkweb)\/([\w\.]+)/i],[g,C],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[C,[g,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna|servo)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[g,C],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[C,g]],os:[[/microsoft (windows) (vista|xp)/i],[g,C],[/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i],[g,[C,It,jt]],[/windows nt 6\.2; (arm)/i,/windows[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i,/(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[C,It,jt],[g,"Windows"]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[C,/_/g,"."],[g,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[g,Le],[C,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[C,g],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish|openharmony)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[g,C],[/\(bb(10);/i],[C,[g,X]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[C,[g,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[C,[g,ie+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[C,[g,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[C,[g,"watchOS"]],[/crkey\/([\d\.]+)/i],[C,[g,pe+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[g,Ie],C],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[g,C],[/(sunos) ?([\w\.\d]*)/i],[[g,"Solaris"],C],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[g,C]]},un=function(Bt,$t){if(typeof Bt===u&&($t=Bt,Bt=r),!(this instanceof un))return new un(Bt,$t).getResult();var qe=typeof n!==c&&n.navigator?n.navigator:r,Ye=Bt||(qe&&qe.userAgent?qe.userAgent:a),ht=qe&&qe.userAgentData?qe.userAgentData:r,Zt=$t?$e(cn,$t):cn,zt=qe&&qe.userAgent==Ye;return this.getBrowser=function(){var Et={};return Et[g]=r,Et[C]=r,qt.call(Et,Ye,Zt.browser),Et[f]=ft(Et[C]),zt&&qe&&qe.brave&&typeof qe.brave.isBrave==l&&(Et[g]="Brave"),Et},this.getCPU=function(){var Et={};return Et[N]=r,qt.call(Et,Ye,Zt.cpu),Et},this.getDevice=function(){var Et={};return Et[w]=r,Et[x]=r,Et[v]=r,qt.call(Et,Ye,Zt.device),zt&&!Et[v]&&ht&&ht.mobile&&(Et[v]=I),zt&&Et[x]=="Macintosh"&&qe&&typeof qe.standalone!==c&&qe.maxTouchPoints&&qe.maxTouchPoints>2&&(Et[x]="iPad",Et[v]=R),Et},this.getEngine=function(){var Et={};return Et[g]=r,Et[C]=r,qt.call(Et,Ye,Zt.engine),Et},this.getOS=function(){var Et={};return Et[g]=r,Et[C]=r,qt.call(Et,Ye,Zt.os),zt&&!Et[g]&&ht&&ht.platform&&ht.platform!="Unknown"&&(Et[g]=ht.platform.replace(/chrome os/i,Ie).replace(/macos/i,Le)),Et},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return Ye},this.setUA=function(Et){return Ye=typeof Et===d&&Et.length>z?ut(Et,z):Et,this},this.setUA(Ye),this};un.VERSION=s,un.BROWSER=it([g,C,f]),un.CPU=it([N]),un.DEVICE=it([x,w,v,P,I,F,R,U,L]),un.ENGINE=un.OS=it([g,C]),e.exports&&(t=e.exports=un),t.UAParser=un;var Ft=typeof n!==c&&(n.jQuery||n.Zepto);if(Ft&&!Ft.ua){var Ke=new un;Ft.ua=Ke.getResult(),Ft.ua.get=function(){return Ke.getUA()},Ft.ua.set=function(Bt){Ke.setUA(Bt);var $t=Ke.getResult();for(var qe in $t)Ft.ua[qe]=$t[qe]}}})(typeof window=="object"?window:UPt)}(Aj,Aj.exports)),Aj.exports}var HPt=zPt(),Y6={},PV,x1e;function VPt(){return x1e||(x1e=1,PV=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then}),PV}var FV={},pb={},g1e;function x5(){if(g1e)return pb;g1e=1;let e;const t=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];return pb.getSymbolSize=function(r){if(!r)throw new Error('"version" cannot be null or undefined');if(r<1||r>40)throw new Error('"version" should be in range from 1 to 40');return r*4+17},pb.getSymbolTotalCodewords=function(r){return t[r]},pb.getBCHDigit=function(n){let r=0;for(;n!==0;)r++,n>>>=1;return r},pb.setToSJISFunction=function(r){if(typeof r!="function")throw new Error('"toSJISFunc" is not a valid function.');e=r},pb.isKanjiModeEnabled=function(){return typeof e<"u"},pb.toSJIS=function(r){return e(r)},pb}var OV={},b1e;function tle(){return b1e||(b1e=1,function(e){e.L={bit:1},e.M={bit:0},e.Q={bit:3},e.H={bit:2};function t(n){if(typeof n!="string")throw new Error("Param is not a string");switch(n.toLowerCase()){case"l":case"low":return e.L;case"m":case"medium":return e.M;case"q":case"quartile":return e.Q;case"h":case"high":return e.H;default:throw new Error("Unknown EC Level: "+n)}}e.isValid=function(r){return r&&typeof r.bit<"u"&&r.bit>=0&&r.bit<4},e.from=function(r,s){if(e.isValid(r))return r;try{return t(r)}catch{return s}}}(OV)),OV}var MV,y1e;function WPt(){if(y1e)return MV;y1e=1;function e(){this.buffer=[],this.length=0}return e.prototype={get:function(t){const n=Math.floor(t/8);return(this.buffer[n]>>>7-t%8&1)===1},put:function(t,n){for(let r=0;r<n;r++)this.putBit((t>>>n-r-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(t){const n=Math.floor(this.length/8);this.buffer.length<=n&&this.buffer.push(0),t&&(this.buffer[n]|=128>>>this.length%8),this.length++}},MV=e,MV}var RV,v1e;function qPt(){if(v1e)return RV;v1e=1;function e(t){if(!t||t<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=t,this.data=new Uint8Array(t*t),this.reservedBit=new Uint8Array(t*t)}return e.prototype.set=function(t,n,r,s){const a=t*this.size+n;this.data[a]=r,s&&(this.reservedBit[a]=!0)},e.prototype.get=function(t,n){return this.data[t*this.size+n]},e.prototype.xor=function(t,n,r){this.data[t*this.size+n]^=r},e.prototype.isReserved=function(t,n){return this.reservedBit[t*this.size+n]},RV=e,RV}var LV={},w1e;function GPt(){return w1e||(w1e=1,function(e){const t=x5().getSymbolSize;e.getRowColCoords=function(r){if(r===1)return[];const s=Math.floor(r/7)+2,a=t(r),o=a===145?26:Math.ceil((a-13)/(2*s-2))*2,l=[a-7];for(let c=1;c<s-1;c++)l[c]=l[c-1]-o;return l.push(6),l.reverse()},e.getPositions=function(r){const s=[],a=e.getRowColCoords(r),o=a.length;for(let l=0;l<o;l++)for(let c=0;c<o;c++)l===0&&c===0||l===0&&c===o-1||l===o-1&&c===0||s.push([a[l],a[c]]);return s}}(LV)),LV}var DV={},C1e;function KPt(){if(C1e)return DV;C1e=1;const e=x5().getSymbolSize,t=7;return DV.getPositions=function(r){const s=e(r);return[[0,0],[s-t,0],[0,s-t]]},DV}var BV={},S1e;function YPt(){return S1e||(S1e=1,function(e){e.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};const t={N1:3,N2:3,N3:40,N4:10};e.isValid=function(s){return s!=null&&s!==""&&!isNaN(s)&&s>=0&&s<=7},e.from=function(s){return e.isValid(s)?parseInt(s,10):void 0},e.getPenaltyN1=function(s){const a=s.size;let o=0,l=0,c=0,u=null,d=null;for(let f=0;f<a;f++){l=c=0,u=d=null;for(let x=0;x<a;x++){let g=s.get(f,x);g===u?l++:(l>=5&&(o+=t.N1+(l-5)),u=g,l=1),g=s.get(x,f),g===d?c++:(c>=5&&(o+=t.N1+(c-5)),d=g,c=1)}l>=5&&(o+=t.N1+(l-5)),c>=5&&(o+=t.N1+(c-5))}return o},e.getPenaltyN2=function(s){const a=s.size;let o=0;for(let l=0;l<a-1;l++)for(let c=0;c<a-1;c++){const u=s.get(l,c)+s.get(l,c+1)+s.get(l+1,c)+s.get(l+1,c+1);(u===4||u===0)&&o++}return o*t.N2},e.getPenaltyN3=function(s){const a=s.size;let o=0,l=0,c=0;for(let u=0;u<a;u++){l=c=0;for(let d=0;d<a;d++)l=l<<1&2047|s.get(u,d),d>=10&&(l===1488||l===93)&&o++,c=c<<1&2047|s.get(d,u),d>=10&&(c===1488||c===93)&&o++}return o*t.N3},e.getPenaltyN4=function(s){let a=0;const o=s.data.length;for(let c=0;c<o;c++)a+=s.data[c];return Math.abs(Math.ceil(a*100/o/5)-10)*t.N4};function n(r,s,a){switch(r){case e.Patterns.PATTERN000:return(s+a)%2===0;case e.Patterns.PATTERN001:return s%2===0;case e.Patterns.PATTERN010:return a%3===0;case e.Patterns.PATTERN011:return(s+a)%3===0;case e.Patterns.PATTERN100:return(Math.floor(s/2)+Math.floor(a/3))%2===0;case e.Patterns.PATTERN101:return s*a%2+s*a%3===0;case e.Patterns.PATTERN110:return(s*a%2+s*a%3)%2===0;case e.Patterns.PATTERN111:return(s*a%3+(s+a)%2)%2===0;default:throw new Error("bad maskPattern:"+r)}}e.applyMask=function(s,a){const o=a.size;for(let l=0;l<o;l++)for(let c=0;c<o;c++)a.isReserved(c,l)||a.xor(c,l,n(s,c,l))},e.getBestMask=function(s,a){const o=Object.keys(e.Patterns).length;let l=0,c=1/0;for(let u=0;u<o;u++){a(u),e.applyMask(u,s);const d=e.getPenaltyN1(s)+e.getPenaltyN2(s)+e.getPenaltyN3(s)+e.getPenaltyN4(s);e.applyMask(u,s),d<c&&(c=d,l=u)}return l}}(BV)),BV}var xP={},N1e;function vRe(){if(N1e)return xP;N1e=1;const e=tle(),t=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],n=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];return xP.getBlocksCount=function(s,a){switch(a){case e.L:return t[(s-1)*4+0];case e.M:return t[(s-1)*4+1];case e.Q:return t[(s-1)*4+2];case e.H:return t[(s-1)*4+3];default:return}},xP.getTotalCodewordsCount=function(s,a){switch(a){case e.L:return n[(s-1)*4+0];case e.M:return n[(s-1)*4+1];case e.Q:return n[(s-1)*4+2];case e.H:return n[(s-1)*4+3];default:return}},xP}var $V={},F7={},A1e;function XPt(){if(A1e)return F7;A1e=1;const e=new Uint8Array(512),t=new Uint8Array(256);return function(){let r=1;for(let s=0;s<255;s++)e[s]=r,t[r]=s,r<<=1,r&256&&(r^=285);for(let s=255;s<512;s++)e[s]=e[s-255]}(),F7.log=function(r){if(r<1)throw new Error("log("+r+")");return t[r]},F7.exp=function(r){return e[r]},F7.mul=function(r,s){return r===0||s===0?0:e[t[r]+t[s]]},F7}var j1e;function QPt(){return j1e||(j1e=1,function(e){const t=XPt();e.mul=function(r,s){const a=new Uint8Array(r.length+s.length-1);for(let o=0;o<r.length;o++)for(let l=0;l<s.length;l++)a[o+l]^=t.mul(r[o],s[l]);return a},e.mod=function(r,s){let a=new Uint8Array(r);for(;a.length-s.length>=0;){const o=a[0];for(let c=0;c<s.length;c++)a[c]^=t.mul(s[c],o);let l=0;for(;l<a.length&&a[l]===0;)l++;a=a.slice(l)}return a},e.generateECPolynomial=function(r){let s=new Uint8Array([1]);for(let a=0;a<r;a++)s=e.mul(s,new Uint8Array([1,t.exp(a)]));return s}}($V)),$V}var UV,E1e;function ZPt(){if(E1e)return UV;E1e=1;const e=QPt();function t(n){this.genPoly=void 0,this.degree=n,this.degree&&this.initialize(this.degree)}return t.prototype.initialize=function(r){this.degree=r,this.genPoly=e.generateECPolynomial(this.degree)},t.prototype.encode=function(r){if(!this.genPoly)throw new Error("Encoder not initialized");const s=new Uint8Array(r.length+this.degree);s.set(r);const a=e.mod(s,this.genPoly),o=this.degree-a.length;if(o>0){const l=new Uint8Array(this.degree);return l.set(a,o),l}return a},UV=t,UV}var zV={},HV={},VV={},_1e;function wRe(){return _1e||(_1e=1,VV.isValid=function(t){return!isNaN(t)&&t>=1&&t<=40}),VV}var Zm={},k1e;function CRe(){if(k1e)return Zm;k1e=1;const e="[0-9]+",t="[A-Z $%*+\\-./:]+";let n="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";n=n.replace(/u/g,"\\u");const r="(?:(?![A-Z0-9 $%*+\\-./:]|"+n+`)(?:.|[\r
]))+`;Zm.KANJI=new RegExp(n,"g"),Zm.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),Zm.BYTE=new RegExp(r,"g"),Zm.NUMERIC=new RegExp(e,"g"),Zm.ALPHANUMERIC=new RegExp(t,"g");const s=new RegExp("^"+n+"$"),a=new RegExp("^"+e+"$"),o=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");return Zm.testKanji=function(c){return s.test(c)},Zm.testNumeric=function(c){return a.test(c)},Zm.testAlphanumeric=function(c){return o.test(c)},Zm}var T1e;function g5(){return T1e||(T1e=1,function(e){const t=wRe(),n=CRe();e.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},e.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},e.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},e.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},e.MIXED={bit:-1},e.getCharCountIndicator=function(a,o){if(!a.ccBits)throw new Error("Invalid mode: "+a);if(!t.isValid(o))throw new Error("Invalid version: "+o);return o>=1&&o<10?a.ccBits[0]:o<27?a.ccBits[1]:a.ccBits[2]},e.getBestModeForData=function(a){return n.testNumeric(a)?e.NUMERIC:n.testAlphanumeric(a)?e.ALPHANUMERIC:n.testKanji(a)?e.KANJI:e.BYTE},e.toString=function(a){if(a&&a.id)return a.id;throw new Error("Invalid mode")},e.isValid=function(a){return a&&a.bit&&a.ccBits};function r(s){if(typeof s!="string")throw new Error("Param is not a string");switch(s.toLowerCase()){case"numeric":return e.NUMERIC;case"alphanumeric":return e.ALPHANUMERIC;case"kanji":return e.KANJI;case"byte":return e.BYTE;default:throw new Error("Unknown mode: "+s)}}e.from=function(a,o){if(e.isValid(a))return a;try{return r(a)}catch{return o}}}(HV)),HV}var I1e;function JPt(){return I1e||(I1e=1,function(e){const t=x5(),n=vRe(),r=tle(),s=g5(),a=wRe(),o=7973,l=t.getBCHDigit(o);function c(x,g,v){for(let w=1;w<=40;w++)if(g<=e.getCapacity(w,v,x))return w}function u(x,g){return s.getCharCountIndicator(x,g)+4}function d(x,g){let v=0;return x.forEach(function(w){const C=u(w.mode,g);v+=C+w.getBitsLength()}),v}function f(x,g){for(let v=1;v<=40;v++)if(d(x,v)<=e.getCapacity(v,g,s.MIXED))return v}e.from=function(g,v){return a.isValid(g)?parseInt(g,10):v},e.getCapacity=function(g,v,w){if(!a.isValid(g))throw new Error("Invalid QR Code version");typeof w>"u"&&(w=s.BYTE);const C=t.getSymbolTotalCodewords(g),N=n.getTotalCodewordsCount(g,v),P=(C-N)*8;if(w===s.MIXED)return P;const I=P-u(w,g);switch(w){case s.NUMERIC:return Math.floor(I/10*3);case s.ALPHANUMERIC:return Math.floor(I/11*2);case s.KANJI:return Math.floor(I/13);case s.BYTE:default:return Math.floor(I/8)}},e.getBestVersionForData=function(g,v){let w;const C=r.from(v,r.M);if(Array.isArray(g)){if(g.length>1)return f(g,C);if(g.length===0)return 1;w=g[0]}else w=g;return c(w.mode,w.getLength(),C)},e.getEncodedBits=function(g){if(!a.isValid(g)||g<7)throw new Error("Invalid QR Code version");let v=g<<12;for(;t.getBCHDigit(v)-l>=0;)v^=o<<t.getBCHDigit(v)-l;return g<<12|v}}(zV)),zV}var WV={},P1e;function eFt(){if(P1e)return WV;P1e=1;const e=x5(),t=1335,n=21522,r=e.getBCHDigit(t);return WV.getEncodedBits=function(a,o){const l=a.bit<<3|o;let c=l<<10;for(;e.getBCHDigit(c)-r>=0;)c^=t<<e.getBCHDigit(c)-r;return(l<<10|c)^n},WV}var qV={},GV,F1e;function tFt(){if(F1e)return GV;F1e=1;const e=g5();function t(n){this.mode=e.NUMERIC,this.data=n.toString()}return t.getBitsLength=function(r){return 10*Math.floor(r/3)+(r%3?r%3*3+1:0)},t.prototype.getLength=function(){return this.data.length},t.prototype.getBitsLength=function(){return t.getBitsLength(this.data.length)},t.prototype.write=function(r){let s,a,o;for(s=0;s+3<=this.data.length;s+=3)a=this.data.substr(s,3),o=parseInt(a,10),r.put(o,10);const l=this.data.length-s;l>0&&(a=this.data.substr(s),o=parseInt(a,10),r.put(o,l*3+1))},GV=t,GV}var KV,O1e;function nFt(){if(O1e)return KV;O1e=1;const e=g5(),t=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function n(r){this.mode=e.ALPHANUMERIC,this.data=r}return n.getBitsLength=function(s){return 11*Math.floor(s/2)+6*(s%2)},n.prototype.getLength=function(){return this.data.length},n.prototype.getBitsLength=function(){return n.getBitsLength(this.data.length)},n.prototype.write=function(s){let a;for(a=0;a+2<=this.data.length;a+=2){let o=t.indexOf(this.data[a])*45;o+=t.indexOf(this.data[a+1]),s.put(o,11)}this.data.length%2&&s.put(t.indexOf(this.data[a]),6)},KV=n,KV}var YV,M1e;function rFt(){if(M1e)return YV;M1e=1;const e=g5();function t(n){this.mode=e.BYTE,typeof n=="string"?this.data=new TextEncoder().encode(n):this.data=new Uint8Array(n)}return t.getBitsLength=function(r){return r*8},t.prototype.getLength=function(){return this.data.length},t.prototype.getBitsLength=function(){return t.getBitsLength(this.data.length)},t.prototype.write=function(n){for(let r=0,s=this.data.length;r<s;r++)n.put(this.data[r],8)},YV=t,YV}var XV,R1e;function sFt(){if(R1e)return XV;R1e=1;const e=g5(),t=x5();function n(r){this.mode=e.KANJI,this.data=r}return n.getBitsLength=function(s){return s*13},n.prototype.getLength=function(){return this.data.length},n.prototype.getBitsLength=function(){return n.getBitsLength(this.data.length)},n.prototype.write=function(r){let s;for(s=0;s<this.data.length;s++){let a=t.toSJIS(this.data[s]);if(a>=33088&&a<=40956)a-=33088;else if(a>=57408&&a<=60351)a-=49472;else throw new Error("Invalid SJIS character: "+this.data[s]+`
Make sure your charset is UTF-8`);a=(a>>>8&255)*192+(a&255),r.put(a,13)}},XV=n,XV}var QV={exports:{}},L1e;function iFt(){return L1e||(L1e=1,function(e){var t={single_source_shortest_paths:function(n,r,s){var a={},o={};o[r]=0;var l=t.PriorityQueue.make();l.push(r,0);for(var c,u,d,f,x,g,v,w,C;!l.empty();){c=l.pop(),u=c.value,f=c.cost,x=n[u]||{};for(d in x)x.hasOwnProperty(d)&&(g=x[d],v=f+g,w=o[d],C=typeof o[d]>"u",(C||w>v)&&(o[d]=v,l.push(d,v),a[d]=u))}if(typeof s<"u"&&typeof o[s]>"u"){var N=["Could not find a path from ",r," to ",s,"."].join("");throw new Error(N)}return a},extract_shortest_path_from_predecessor_list:function(n,r){for(var s=[],a=r;a;)s.push(a),n[a],a=n[a];return s.reverse(),s},find_path:function(n,r,s){var a=t.single_source_shortest_paths(n,r,s);return t.extract_shortest_path_from_predecessor_list(a,s)},PriorityQueue:{make:function(n){var r=t.PriorityQueue,s={},a;n=n||{};for(a in r)r.hasOwnProperty(a)&&(s[a]=r[a]);return s.queue=[],s.sorter=n.sorter||r.default_sorter,s},default_sorter:function(n,r){return n.cost-r.cost},push:function(n,r){var s={value:n,cost:r};this.queue.push(s),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};e.exports=t}(QV)),QV.exports}var D1e;function aFt(){return D1e||(D1e=1,function(e){const t=g5(),n=tFt(),r=nFt(),s=rFt(),a=sFt(),o=CRe(),l=x5(),c=iFt();function u(N){return unescape(encodeURIComponent(N)).length}function d(N,P,I){const R=[];let F;for(;(F=N.exec(I))!==null;)R.push({data:F[0],index:F.index,mode:P,length:F[0].length});return R}function f(N){const P=d(o.NUMERIC,t.NUMERIC,N),I=d(o.ALPHANUMERIC,t.ALPHANUMERIC,N);let R,F;return l.isKanjiModeEnabled()?(R=d(o.BYTE,t.BYTE,N),F=d(o.KANJI,t.KANJI,N)):(R=d(o.BYTE_KANJI,t.BYTE,N),F=[]),P.concat(I,R,F).sort(function(L,z){return L.index-z.index}).map(function(L){return{data:L.data,mode:L.mode,length:L.length}})}function x(N,P){switch(P){case t.NUMERIC:return n.getBitsLength(N);case t.ALPHANUMERIC:return r.getBitsLength(N);case t.KANJI:return a.getBitsLength(N);case t.BYTE:return s.getBitsLength(N)}}function g(N){return N.reduce(function(P,I){const R=P.length-1>=0?P[P.length-1]:null;return R&&R.mode===I.mode?(P[P.length-1].data+=I.data,P):(P.push(I),P)},[])}function v(N){const P=[];for(let I=0;I<N.length;I++){const R=N[I];switch(R.mode){case t.NUMERIC:P.push([R,{data:R.data,mode:t.ALPHANUMERIC,length:R.length},{data:R.data,mode:t.BYTE,length:R.length}]);break;case t.ALPHANUMERIC:P.push([R,{data:R.data,mode:t.BYTE,length:R.length}]);break;case t.KANJI:P.push([R,{data:R.data,mode:t.BYTE,length:u(R.data)}]);break;case t.BYTE:P.push([{data:R.data,mode:t.BYTE,length:u(R.data)}])}}return P}function w(N,P){const I={},R={start:{}};let F=["start"];for(let U=0;U<N.length;U++){const L=N[U],z=[];for(let Q=0;Q<L.length;Q++){const ne=L[Q],J=""+U+Q;z.push(J),I[J]={node:ne,lastCount:0},R[J]={};for(let X=0;X<F.length;X++){const re=F[X];I[re]&&I[re].node.mode===ne.mode?(R[re][J]=x(I[re].lastCount+ne.length,ne.mode)-x(I[re].lastCount,ne.mode),I[re].lastCount+=ne.length):(I[re]&&(I[re].lastCount=ne.length),R[re][J]=x(ne.length,ne.mode)+4+t.getCharCountIndicator(ne.mode,P))}}F=z}for(let U=0;U<F.length;U++)R[F[U]].end=0;return{map:R,table:I}}function C(N,P){let I;const R=t.getBestModeForData(N);if(I=t.from(P,R),I!==t.BYTE&&I.bit<R.bit)throw new Error('"'+N+'" cannot be encoded with mode '+t.toString(I)+`.
Suggested mode is: `+t.toString(R));switch(I===t.KANJI&&!l.isKanjiModeEnabled()&&(I=t.BYTE),I){case t.NUMERIC:return new n(N);case t.ALPHANUMERIC:return new r(N);case t.KANJI:return new a(N);case t.BYTE:return new s(N)}}e.fromArray=function(P){return P.reduce(function(I,R){return typeof R=="string"?I.push(C(R,null)):R.data&&I.push(C(R.data,R.mode)),I},[])},e.fromString=function(P,I){const R=f(P,l.isKanjiModeEnabled()),F=v(R),U=w(F,I),L=c.find_path(U.map,"start","end"),z=[];for(let Q=1;Q<L.length-1;Q++)z.push(U.table[L[Q]].node);return e.fromArray(g(z))},e.rawSplit=function(P){return e.fromArray(f(P,l.isKanjiModeEnabled()))}}(qV)),qV}var B1e;function oFt(){if(B1e)return FV;B1e=1;const e=x5(),t=tle(),n=WPt(),r=qPt(),s=GPt(),a=KPt(),o=YPt(),l=vRe(),c=ZPt(),u=JPt(),d=eFt(),f=g5(),x=aFt();function g(U,L){const z=U.size,Q=a.getPositions(L);for(let ne=0;ne<Q.length;ne++){const J=Q[ne][0],X=Q[ne][1];for(let re=-1;re<=7;re++)if(!(J+re<=-1||z<=J+re))for(let pe=-1;pe<=7;pe++)X+pe<=-1||z<=X+pe||(re>=0&&re<=6&&(pe===0||pe===6)||pe>=0&&pe<=6&&(re===0||re===6)||re>=2&&re<=4&&pe>=2&&pe<=4?U.set(J+re,X+pe,!0,!0):U.set(J+re,X+pe,!1,!0))}}function v(U){const L=U.size;for(let z=8;z<L-8;z++){const Q=z%2===0;U.set(z,6,Q,!0),U.set(6,z,Q,!0)}}function w(U,L){const z=s.getPositions(L);for(let Q=0;Q<z.length;Q++){const ne=z[Q][0],J=z[Q][1];for(let X=-2;X<=2;X++)for(let re=-2;re<=2;re++)X===-2||X===2||re===-2||re===2||X===0&&re===0?U.set(ne+X,J+re,!0,!0):U.set(ne+X,J+re,!1,!0)}}function C(U,L){const z=U.size,Q=u.getEncodedBits(L);let ne,J,X;for(let re=0;re<18;re++)ne=Math.floor(re/3),J=re%3+z-8-3,X=(Q>>re&1)===1,U.set(ne,J,X,!0),U.set(J,ne,X,!0)}function N(U,L,z){const Q=U.size,ne=d.getEncodedBits(L,z);let J,X;for(J=0;J<15;J++)X=(ne>>J&1)===1,J<6?U.set(J,8,X,!0):J<8?U.set(J+1,8,X,!0):U.set(Q-15+J,8,X,!0),J<8?U.set(8,Q-J-1,X,!0):J<9?U.set(8,15-J-1+1,X,!0):U.set(8,15-J-1,X,!0);U.set(Q-8,8,1,!0)}function P(U,L){const z=U.size;let Q=-1,ne=z-1,J=7,X=0;for(let re=z-1;re>0;re-=2)for(re===6&&re--;;){for(let pe=0;pe<2;pe++)if(!U.isReserved(ne,re-pe)){let Y=!1;X<L.length&&(Y=(L[X]>>>J&1)===1),U.set(ne,re-pe,Y),J--,J===-1&&(X++,J=7)}if(ne+=Q,ne<0||z<=ne){ne-=Q,Q=-Q;break}}}function I(U,L,z){const Q=new n;z.forEach(function(pe){Q.put(pe.mode.bit,4),Q.put(pe.getLength(),f.getCharCountIndicator(pe.mode,U)),pe.write(Q)});const ne=e.getSymbolTotalCodewords(U),J=l.getTotalCodewordsCount(U,L),X=(ne-J)*8;for(Q.getLengthInBits()+4<=X&&Q.put(0,4);Q.getLengthInBits()%8!==0;)Q.putBit(0);const re=(X-Q.getLengthInBits())/8;for(let pe=0;pe<re;pe++)Q.put(pe%2?17:236,8);return R(Q,U,L)}function R(U,L,z){const Q=e.getSymbolTotalCodewords(L),ne=l.getTotalCodewordsCount(L,z),J=Q-ne,X=l.getBlocksCount(L,z),re=Q%X,pe=X-re,Y=Math.floor(Q/X),ie=Math.floor(J/X),oe=ie+1,G=Y-ie,V=new c(G);let ee=0;const ae=new Array(X),fe=new Array(X);let Ne=0;const he=new Uint8Array(U.buffer);for(let Ie=0;Ie<X;Ie++){const Le=Ie<pe?ie:oe;ae[Ie]=he.slice(ee,ee+Le),fe[Ie]=V.encode(ae[Ie]),ee+=Le,Ne=Math.max(Ne,Le)}const ge=new Uint8Array(Q);let ye=0,ve,je;for(ve=0;ve<Ne;ve++)for(je=0;je<X;je++)ve<ae[je].length&&(ge[ye++]=ae[je][ve]);for(ve=0;ve<G;ve++)for(je=0;je<X;je++)ge[ye++]=fe[je][ve];return ge}function F(U,L,z,Q){let ne;if(Array.isArray(U))ne=x.fromArray(U);else if(typeof U=="string"){let Y=L;if(!Y){const ie=x.rawSplit(U);Y=u.getBestVersionForData(ie,z)}ne=x.fromString(U,Y||40)}else throw new Error("Invalid data");const J=u.getBestVersionForData(ne,z);if(!J)throw new Error("The amount of data is too big to be stored in a QR Code");if(!L)L=J;else if(L<J)throw new Error(`
The chosen QR Code version cannot contain this amount of data.
Minimum version required to store current data is: `+J+`.
`);const X=I(L,z,ne),re=e.getSymbolSize(L),pe=new r(re);return g(pe,L),v(pe),w(pe,L),N(pe,z,0),L>=7&&C(pe,L),P(pe,X),isNaN(Q)&&(Q=o.getBestMask(pe,N.bind(null,pe,z))),o.applyMask(Q,pe),N(pe,z,Q),{modules:pe,version:L,errorCorrectionLevel:z,maskPattern:Q,segments:ne}}return FV.create=function(L,z){if(typeof L>"u"||L==="")throw new Error("No input text");let Q=t.M,ne,J;return typeof z<"u"&&(Q=t.from(z.errorCorrectionLevel,t.M),ne=u.from(z.version),J=o.from(z.maskPattern),z.toSJISFunc&&e.setToSJISFunction(z.toSJISFunc)),F(L,ne,Q,J)},FV}var ZV={},JV={},$1e;function SRe(){return $1e||($1e=1,function(e){function t(n){if(typeof n=="number"&&(n=n.toString()),typeof n!="string")throw new Error("Color should be defined as hex string");let r=n.slice().replace("#","").split("");if(r.length<3||r.length===5||r.length>8)throw new Error("Invalid hex color: "+n);(r.length===3||r.length===4)&&(r=Array.prototype.concat.apply([],r.map(function(a){return[a,a]}))),r.length===6&&r.push("F","F");const s=parseInt(r.join(""),16);return{r:s>>24&255,g:s>>16&255,b:s>>8&255,a:s&255,hex:"#"+r.slice(0,6).join("")}}e.getOptions=function(r){r||(r={}),r.color||(r.color={});const s=typeof r.margin>"u"||r.margin===null||r.margin<0?4:r.margin,a=r.width&&r.width>=21?r.width:void 0,o=r.scale||4;return{width:a,scale:a?4:o,margin:s,color:{dark:t(r.color.dark||"#000000ff"),light:t(r.color.light||"#ffffffff")},type:r.type,rendererOpts:r.rendererOpts||{}}},e.getScale=function(r,s){return s.width&&s.width>=r+s.margin*2?s.width/(r+s.margin*2):s.scale},e.getImageWidth=function(r,s){const a=e.getScale(r,s);return Math.floor((r+s.margin*2)*a)},e.qrToImageData=function(r,s,a){const o=s.modules.size,l=s.modules.data,c=e.getScale(o,a),u=Math.floor((o+a.margin*2)*c),d=a.margin*c,f=[a.color.light,a.color.dark];for(let x=0;x<u;x++)for(let g=0;g<u;g++){let v=(x*u+g)*4,w=a.color.light;if(x>=d&&g>=d&&x<u-d&&g<u-d){const C=Math.floor((x-d)/c),N=Math.floor((g-d)/c);w=f[l[C*o+N]?1:0]}r[v++]=w.r,r[v++]=w.g,r[v++]=w.b,r[v]=w.a}}}(JV)),JV}var U1e;function lFt(){return U1e||(U1e=1,function(e){const t=SRe();function n(s,a,o){s.clearRect(0,0,a.width,a.height),a.style||(a.style={}),a.height=o,a.width=o,a.style.height=o+"px",a.style.width=o+"px"}function r(){try{return document.createElement("canvas")}catch{throw new Error("You need to specify a canvas element")}}e.render=function(a,o,l){let c=l,u=o;typeof c>"u"&&(!o||!o.getContext)&&(c=o,o=void 0),o||(u=r()),c=t.getOptions(c);const d=t.getImageWidth(a.modules.size,c),f=u.getContext("2d"),x=f.createImageData(d,d);return t.qrToImageData(x.data,a,c),n(f,u,d),f.putImageData(x,0,0),u},e.renderToDataURL=function(a,o,l){let c=l;typeof c>"u"&&(!o||!o.getContext)&&(c=o,o=void 0),c||(c={});const u=e.render(a,o,c),d=c.type||"image/png",f=c.rendererOpts||{};return u.toDataURL(d,f.quality)}}(ZV)),ZV}var eW={},z1e;function cFt(){if(z1e)return eW;z1e=1;const e=SRe();function t(s,a){const o=s.a/255,l=a+'="'+s.hex+'"';return o<1?l+" "+a+'-opacity="'+o.toFixed(2).slice(1)+'"':l}function n(s,a,o){let l=s+a;return typeof o<"u"&&(l+=" "+o),l}function r(s,a,o){let l="",c=0,u=!1,d=0;for(let f=0;f<s.length;f++){const x=Math.floor(f%a),g=Math.floor(f/a);!x&&!u&&(u=!0),s[f]?(d++,f>0&&x>0&&s[f-1]||(l+=u?n("M",x+o,.5+g+o):n("m",c,0),c=0,u=!1),x+1<a&&s[f+1]||(l+=n("h",d),d=0)):c++}return l}return eW.render=function(a,o,l){const c=e.getOptions(o),u=a.modules.size,d=a.modules.data,f=u+c.margin*2,x=c.color.light.a?"<path "+t(c.color.light,"fill")+' d="M0 0h'+f+"v"+f+'H0z"/>':"",g="<path "+t(c.color.dark,"stroke")+' d="'+r(d,u,c.margin)+'"/>',v='viewBox="0 0 '+f+" "+f+'"',C='<svg xmlns="http://www.w3.org/2000/svg" '+(c.width?'width="'+c.width+'" height="'+c.width+'" ':"")+v+' shape-rendering="crispEdges">'+x+g+`</svg>
`;return typeof l=="function"&&l(null,C),C},eW}var H1e;function uFt(){if(H1e)return Y6;H1e=1;const e=VPt(),t=oFt(),n=lFt(),r=cFt();function s(a,o,l,c,u){const d=[].slice.call(arguments,1),f=d.length,x=typeof d[f-1]=="function";if(!x&&!e())throw new Error("Callback required as last argument");if(x){if(f<2)throw new Error("Too few arguments provided");f===2?(u=l,l=o,o=c=void 0):f===3&&(o.getContext&&typeof u>"u"?(u=c,c=void 0):(u=c,c=l,l=o,o=void 0))}else{if(f<1)throw new Error("Too few arguments provided");return f===1?(l=o,o=c=void 0):f===2&&!o.getContext&&(c=l,l=o,o=void 0),new Promise(function(g,v){try{const w=t.create(l,c);g(a(w,o,c))}catch(w){v(w)}})}try{const g=t.create(l,c);u(null,a(g,o,c))}catch(g){u(g)}}return Y6.create=t.create,Y6.toCanvas=s.bind(null,n.render),Y6.toDataURL=s.bind(null,n.renderToDataURL),Y6.toString=s.bind(null,function(a,o,l){return r.render(a,l)}),Y6}var dFt=uFt();const fFt=Ti(dFt);A$.type="coinbaseWallet";function A$(e={}){return e.version==="3"||e.headlessMode?pFt(e):hFt(e)}function hFt(e){let t,n,r,s;return a=>({id:"coinbaseWalletSDK",name:"Coinbase Wallet",rdns:"com.coinbase.wallet",type:A$.type,async connect({chainId:o,...l}={}){try{const c=await this.getProvider(),u=(await c.request({method:"eth_requestAccounts",params:"instantOnboarding"in l&&l.instantOnboarding?[{onboarding:"instant"}]:[]})).map(f=>jc(f));n||(n=this.onAccountsChanged.bind(this),c.on("accountsChanged",n)),r||(r=this.onChainChanged.bind(this),c.on("chainChanged",r)),s||(s=this.onDisconnect.bind(this),c.on("disconnect",s));let d=await this.getChainId();if(o&&d!==o){const f=await this.switchChain({chainId:o}).catch(x=>{if(x.code===bo.code)throw x;return{id:d}});d=(f==null?void 0:f.id)??d}return{accounts:u,chainId:d}}catch(c){throw/(user closed modal|accounts received is empty|user denied account|request rejected)/i.test(c.message)?new bo(c):c}},async disconnect(){var l;const o=await this.getProvider();n&&(o.removeListener("accountsChanged",n),n=void 0),r&&(o.removeListener("chainChanged",r),r=void 0),s&&(o.removeListener("disconnect",s),s=void 0),o.disconnect(),(l=o.close)==null||l.call(o)},async getAccounts(){return(await(await this.getProvider()).request({method:"eth_accounts"})).map(l=>jc(l))},async getChainId(){const l=await(await this.getProvider()).request({method:"eth_chainId"});return Number(l)},async getProvider(){if(!t){const o=(()=>{var u;return typeof e.preference=="string"?{options:e.preference}:{...e.preference,options:((u=e.preference)==null?void 0:u.options)??"all"}})(),{createCoinbaseWalletSDK:l}=await as(async()=>{const{createCoinbaseWalletSDK:u}=await import("./index-DAAglTXq.js");return{createCoinbaseWalletSDK:u}},__vite__mapDeps([0,1,2,3]));t=l({...e,appChainIds:a.chains.map(u=>u.id),preference:o}).getProvider()}return t},async isAuthorized(){try{return!!(await this.getAccounts()).length}catch{return!1}},async switchChain({addEthereumChainParameter:o,chainId:l}){var d,f,x,g;const c=a.chains.find(v=>v.id===l);if(!c)throw new ip(new S3);const u=await this.getProvider();try{return await u.request({method:"wallet_switchEthereumChain",params:[{chainId:$s(c.id)}]}),c}catch(v){if(v.code===4902)try{let w;o!=null&&o.blockExplorerUrls?w=o.blockExplorerUrls:w=(d=c.blockExplorers)!=null&&d.default.url?[(f=c.blockExplorers)==null?void 0:f.default.url]:[];let C;(x=o==null?void 0:o.rpcUrls)!=null&&x.length?C=o.rpcUrls:C=[((g=c.rpcUrls.default)==null?void 0:g.http[0])??""];const N={blockExplorerUrls:w,chainId:$s(l),chainName:(o==null?void 0:o.chainName)??c.name,iconUrls:o==null?void 0:o.iconUrls,nativeCurrency:(o==null?void 0:o.nativeCurrency)??c.nativeCurrency,rpcUrls:C};return await u.request({method:"wallet_addEthereumChain",params:[N]}),c}catch(w){throw new bo(w)}throw new ip(v)}},onAccountsChanged(o){o.length===0?this.onDisconnect():a.emitter.emit("change",{accounts:o.map(l=>jc(l))})},onChainChanged(o){const l=Number(o);a.emitter.emit("change",{chainId:l})},async onDisconnect(o){a.emitter.emit("disconnect");const l=await this.getProvider();n&&(l.removeListener("accountsChanged",n),n=void 0),r&&(l.removeListener("chainChanged",r),r=void 0),s&&(l.removeListener("disconnect",s),s=void 0)}})}function pFt(e){let n,r,s,a,o;return l=>({id:"coinbaseWalletSDK",name:"Coinbase Wallet",type:A$.type,async connect({chainId:c}={}){try{const u=await this.getProvider(),d=(await u.request({method:"eth_requestAccounts"})).map(x=>jc(x));s||(s=this.onAccountsChanged.bind(this),u.on("accountsChanged",s)),a||(a=this.onChainChanged.bind(this),u.on("chainChanged",a)),o||(o=this.onDisconnect.bind(this),u.on("disconnect",o));let f=await this.getChainId();if(c&&f!==c){const x=await this.switchChain({chainId:c}).catch(g=>{if(g.code===bo.code)throw g;return{id:f}});f=(x==null?void 0:x.id)??f}return{accounts:d,chainId:f}}catch(u){throw/(user closed modal|accounts received is empty|user denied account)/i.test(u.message)?new bo(u):u}},async disconnect(){const c=await this.getProvider();s&&(c.removeListener("accountsChanged",s),s=void 0),a&&(c.removeListener("chainChanged",a),a=void 0),o&&(c.removeListener("disconnect",o),o=void 0),c.disconnect(),c.close()},async getAccounts(){return(await(await this.getProvider()).request({method:"eth_accounts"})).map(u=>jc(u))},async getChainId(){const u=await(await this.getProvider()).request({method:"eth_chainId"});return Number(u)},async getProvider(){var c;if(!r){const u=await(async()=>{const{default:v}=await as(async()=>{const{default:w}=await import("./index-DmtF-XQN.js").then(C=>C.i);return{default:w}},__vite__mapDeps([4,3,5]));return typeof v!="function"&&typeof v.default=="function"?v.default:v})();n=new u({...e,reloadOnDisconnect:!1});const d=(c=n.walletExtension)==null?void 0:c.getChainId(),f=l.chains.find(v=>e.chainId?v.id===e.chainId:v.id===d)||l.chains[0],x=e.chainId||(f==null?void 0:f.id),g=e.jsonRpcUrl||(f==null?void 0:f.rpcUrls.default.http[0]);r=n.makeWeb3Provider(g,x)}return r},async isAuthorized(){try{return!!(await this.getAccounts()).length}catch{return!1}},async switchChain({addEthereumChainParameter:c,chainId:u}){var x,g,v,w;const d=l.chains.find(C=>C.id===u);if(!d)throw new ip(new S3);const f=await this.getProvider();try{return await f.request({method:"wallet_switchEthereumChain",params:[{chainId:$s(d.id)}]}),d}catch(C){if(C.code===4902)try{let N;c!=null&&c.blockExplorerUrls?N=c.blockExplorerUrls:N=(x=d.blockExplorers)!=null&&x.default.url?[(g=d.blockExplorers)==null?void 0:g.default.url]:[];let P;(v=c==null?void 0:c.rpcUrls)!=null&&v.length?P=c.rpcUrls:P=[((w=d.rpcUrls.default)==null?void 0:w.http[0])??""];const I={blockExplorerUrls:N,chainId:$s(u),chainName:(c==null?void 0:c.chainName)??d.name,iconUrls:c==null?void 0:c.iconUrls,nativeCurrency:(c==null?void 0:c.nativeCurrency)??d.nativeCurrency,rpcUrls:P};return await f.request({method:"wallet_addEthereumChain",params:[I]}),d}catch(N){throw new bo(N)}throw new ip(C)}},onAccountsChanged(c){c.length===0?this.onDisconnect():l.emitter.emit("change",{accounts:c.map(u=>jc(u))})},onChainChanged(c){const u=Number(c);l.emitter.emit("change",{chainId:u})},async onDisconnect(c){l.emitter.emit("disconnect");const u=await this.getProvider();s&&(u.removeListener("accountsChanged",s),s=void 0),a&&(u.removeListener("chainChanged",a),a=void 0),o&&(u.removeListener("disconnect",o),o=void 0)}})}nle.type="safe";function nle(e={}){const{shimDisconnect:t=!1}=e;let n,r;return s=>({id:"safe",name:"Safe",type:nle.type,async connect(){var c;const a=await this.getProvider();if(!a)throw new Wh;const o=await this.getAccounts(),l=await this.getChainId();return r||(r=this.onDisconnect.bind(this),a.on("disconnect",r)),t&&await((c=s.storage)==null?void 0:c.removeItem("safe.disconnected")),{accounts:o,chainId:l}},async disconnect(){var o;const a=await this.getProvider();if(!a)throw new Wh;r&&(a.removeListener("disconnect",r),r=void 0),t&&await((o=s.storage)==null?void 0:o.setItem("safe.disconnected",!0))},async getAccounts(){const a=await this.getProvider();if(!a)throw new Wh;return(await a.request({method:"eth_accounts"})).map(jc)},async getProvider(){if(typeof window<"u"&&(window==null?void 0:window.parent)!==window){if(!n){const{default:o}=await as(async()=>{const{default:d}=await import("./index-B8lqC164.js");return{default:d}},__vite__mapDeps([6,7,2])),l=new o(e),c=await Iie(()=>l.safe.getInfo(),{timeout:e.unstable_getInfoTimeout??10});if(!c)throw new Error("Could not load Safe information");const u=await(async()=>{const d=await as(()=>import("./index-Dv6ebf5e.js").then(f=>f.i),__vite__mapDeps([8,7,1,5]));return typeof d.SafeAppProvider!="function"&&typeof d.default.SafeAppProvider=="function"?d.default.SafeAppProvider:d.SafeAppProvider})();n=new u(c,l)}return n}},async getChainId(){const a=await this.getProvider();if(!a)throw new Wh;return Number(a.chainId)},async isAuthorized(){var a;try{return t&&await((a=s.storage)==null?void 0:a.getItem("safe.disconnected"))?!1:!!(await this.getAccounts()).length}catch{return!1}},onAccountsChanged(){},onChainChanged(){},onDisconnect(){s.emitter.emit("disconnect")}})}rle.type="walletConnect";function rle(e){const t=e.isNewChainsStale??!0;let n,r;const s="eip155";let a,o,l,c,u,d;return f=>({id:"walletConnect",name:"WalletConnect",type:rle.type,async setup(){const x=await this.getProvider().catch(()=>null);x&&(l||(l=this.onConnect.bind(this),x.on("connect",l)),u||(u=this.onSessionDelete.bind(this),x.on("session_delete",u)))},async connect({chainId:x,...g}={}){var v,w;try{const C=await this.getProvider();if(!C)throw new Wh;c||(c=this.onDisplayUri,C.on("display_uri",c));let N=x;if(!N){const F=await((v=f.storage)==null?void 0:v.getItem("state"))??{};f.chains.some(L=>L.id===F.chainId)?N=F.chainId:N=(w=f.chains[0])==null?void 0:w.id}if(!N)throw new Error("No chains found on connector.");const P=await this.isChainsStale();if(C.session&&P&&await C.disconnect(),!C.session||P){const F=f.chains.filter(U=>U.id!==N).map(U=>U.id);await C.connect({optionalChains:[N,...F],..."pairingTopic"in g?{pairingTopic:g.pairingTopic}:{}}),this.setRequestedChainsIds(f.chains.map(U=>U.id))}const I=(await C.enable()).map(F=>jc(F)),R=await this.getChainId();return c&&(C.removeListener("display_uri",c),c=void 0),l&&(C.removeListener("connect",l),l=void 0),a||(a=this.onAccountsChanged.bind(this),C.on("accountsChanged",a)),o||(o=this.onChainChanged.bind(this),C.on("chainChanged",o)),d||(d=this.onDisconnect.bind(this),C.on("disconnect",d)),u||(u=this.onSessionDelete.bind(this),C.on("session_delete",u)),{accounts:I,chainId:R}}catch(C){throw/(user rejected|connection request reset)/i.test(C==null?void 0:C.message)?new bo(C):C}},async disconnect(){const x=await this.getProvider();try{await(x==null?void 0:x.disconnect())}catch(g){if(!/No matching key/i.test(g.message))throw g}finally{o&&(x==null||x.removeListener("chainChanged",o),o=void 0),d&&(x==null||x.removeListener("disconnect",d),d=void 0),l||(l=this.onConnect.bind(this),x==null||x.on("connect",l)),a&&(x==null||x.removeListener("accountsChanged",a),a=void 0),u&&(x==null||x.removeListener("session_delete",u),u=void 0),this.setRequestedChainsIds([])}},async getAccounts(){return(await this.getProvider()).accounts.map(g=>jc(g))},async getProvider({chainId:x}={}){var v;async function g(){const w=f.chains.map(N=>N.id);if(!w.length)return;const{EthereumProvider:C}=await as(async()=>{const{EthereumProvider:N}=await import("./index.es-C5ku7T-p.js");return{EthereumProvider:N}},__vite__mapDeps([9,5]));return await C.init({...e,disableProviderPing:!0,optionalChains:w,projectId:e.projectId,rpcMap:Object.fromEntries(f.chains.map(N=>{const[P]=X0t({chain:N,transports:f.transports});return[N.id,P]})),showQrModal:e.showQrModal??!0})}return n||(r||(r=g()),n=await r,n==null||n.events.setMaxListeners(Number.POSITIVE_INFINITY)),x&&await((v=this.switchChain)==null?void 0:v.call(this,{chainId:x})),n},async getChainId(){return(await this.getProvider()).chainId},async isAuthorized(){try{const[x,g]=await Promise.all([this.getAccounts(),this.getProvider()]);return x.length?await this.isChainsStale()&&g.session?(await g.disconnect().catch(()=>{}),!1):!0:!1}catch{return!1}},async switchChain({addEthereumChainParameter:x,chainId:g}){var C,N,P;const v=await this.getProvider();if(!v)throw new Wh;const w=f.chains.find(I=>I.id===g);if(!w)throw new ip(new S3);try{await Promise.all([new Promise(R=>{const F=({chainId:U})=>{U===g&&(f.emitter.off("change",F),R())};f.emitter.on("change",F)}),v.request({method:"wallet_switchEthereumChain",params:[{chainId:$s(g)}]})]);const I=await this.getRequestedChainsIds();return this.setRequestedChainsIds([...I,g]),w}catch(I){const R=I;if(/(user rejected)/i.test(R.message))throw new bo(R);try{let F;x!=null&&x.blockExplorerUrls?F=x.blockExplorerUrls:F=(C=w.blockExplorers)!=null&&C.default.url?[(N=w.blockExplorers)==null?void 0:N.default.url]:[];let U;(P=x==null?void 0:x.rpcUrls)!=null&&P.length?U=x.rpcUrls:U=[...w.rpcUrls.default.http];const L={blockExplorerUrls:F,chainId:$s(g),chainName:(x==null?void 0:x.chainName)??w.name,iconUrls:x==null?void 0:x.iconUrls,nativeCurrency:(x==null?void 0:x.nativeCurrency)??w.nativeCurrency,rpcUrls:U};await v.request({method:"wallet_addEthereumChain",params:[L]});const z=await this.getRequestedChainsIds();return this.setRequestedChainsIds([...z,g]),w}catch(F){throw new bo(F)}}},onAccountsChanged(x){x.length===0?this.onDisconnect():f.emitter.emit("change",{accounts:x.map(g=>jc(g))})},onChainChanged(x){const g=Number(x);f.emitter.emit("change",{chainId:g})},async onConnect(x){const g=Number(x.chainId),v=await this.getAccounts();f.emitter.emit("connect",{accounts:v,chainId:g})},async onDisconnect(x){this.setRequestedChainsIds([]),f.emitter.emit("disconnect");const g=await this.getProvider();a&&(g.removeListener("accountsChanged",a),a=void 0),o&&(g.removeListener("chainChanged",o),o=void 0),d&&(g.removeListener("disconnect",d),d=void 0),u&&(g.removeListener("session_delete",u),u=void 0),l||(l=this.onConnect.bind(this),g.on("connect",l))},onDisplayUri(x){f.emitter.emit("message",{type:"display_uri",data:x})},onSessionDelete(){this.onDisconnect()},getNamespaceChainsIds(){var g,v,w;return n?((w=(v=(g=n.session)==null?void 0:g.namespaces[s])==null?void 0:v.accounts)==null?void 0:w.map(C=>Number.parseInt(C.split(":")[1]||"")))??[]:[]},async getRequestedChainsIds(){var x;return await((x=f.storage)==null?void 0:x.getItem(this.requestedChainsStorageKey))??[]},async isChainsStale(){if(!t)return!1;const x=f.chains.map(w=>w.id),g=this.getNamespaceChainsIds();if(g.length&&!g.some(w=>x.includes(w)))return!1;const v=await this.getRequestedChainsIds();return!x.every(w=>v.includes(w))},async setRequestedChainsIds(x){var g;await((g=f.storage)==null?void 0:g.setItem(this.requestedChainsStorageKey,x))},get requestedChainsStorageKey(){return`${this.id}.requestedChains`}})}var MR={},mFt=768;aIt({conditions:{defaultCondition:"smallScreen",conditionNames:["smallScreen","largeScreen"],responsiveArray:void 0}});var xFt=mMe({conditions:{defaultCondition:"smallScreen",conditionNames:["smallScreen","largeScreen"],responsiveArray:void 0}}),Jee=fIt({conditions:{defaultCondition:"base",conditionNames:["base","hover","active"],responsiveArray:void 0},styles:{background:{values:{accentColor:{conditions:{base:"ju367v9i",hover:"ju367v9j",active:"ju367v9k"},defaultClass:"ju367v9i"},accentColorForeground:{conditions:{base:"ju367v9l",hover:"ju367v9m",active:"ju367v9n"},defaultClass:"ju367v9l"},actionButtonBorder:{conditions:{base:"ju367v9o",hover:"ju367v9p",active:"ju367v9q"},defaultClass:"ju367v9o"},actionButtonBorderMobile:{conditions:{base:"ju367v9r",hover:"ju367v9s",active:"ju367v9t"},defaultClass:"ju367v9r"},actionButtonSecondaryBackground:{conditions:{base:"ju367v9u",hover:"ju367v9v",active:"ju367v9w"},defaultClass:"ju367v9u"},closeButton:{conditions:{base:"ju367v9x",hover:"ju367v9y",active:"ju367v9z"},defaultClass:"ju367v9x"},closeButtonBackground:{conditions:{base:"ju367va0",hover:"ju367va1",active:"ju367va2"},defaultClass:"ju367va0"},connectButtonBackground:{conditions:{base:"ju367va3",hover:"ju367va4",active:"ju367va5"},defaultClass:"ju367va3"},connectButtonBackgroundError:{conditions:{base:"ju367va6",hover:"ju367va7",active:"ju367va8"},defaultClass:"ju367va6"},connectButtonInnerBackground:{conditions:{base:"ju367va9",hover:"ju367vaa",active:"ju367vab"},defaultClass:"ju367va9"},connectButtonText:{conditions:{base:"ju367vac",hover:"ju367vad",active:"ju367vae"},defaultClass:"ju367vac"},connectButtonTextError:{conditions:{base:"ju367vaf",hover:"ju367vag",active:"ju367vah"},defaultClass:"ju367vaf"},connectionIndicator:{conditions:{base:"ju367vai",hover:"ju367vaj",active:"ju367vak"},defaultClass:"ju367vai"},downloadBottomCardBackground:{conditions:{base:"ju367val",hover:"ju367vam",active:"ju367van"},defaultClass:"ju367val"},downloadTopCardBackground:{conditions:{base:"ju367vao",hover:"ju367vap",active:"ju367vaq"},defaultClass:"ju367vao"},error:{conditions:{base:"ju367var",hover:"ju367vas",active:"ju367vat"},defaultClass:"ju367var"},generalBorder:{conditions:{base:"ju367vau",hover:"ju367vav",active:"ju367vaw"},defaultClass:"ju367vau"},generalBorderDim:{conditions:{base:"ju367vax",hover:"ju367vay",active:"ju367vaz"},defaultClass:"ju367vax"},menuItemBackground:{conditions:{base:"ju367vb0",hover:"ju367vb1",active:"ju367vb2"},defaultClass:"ju367vb0"},modalBackdrop:{conditions:{base:"ju367vb3",hover:"ju367vb4",active:"ju367vb5"},defaultClass:"ju367vb3"},modalBackground:{conditions:{base:"ju367vb6",hover:"ju367vb7",active:"ju367vb8"},defaultClass:"ju367vb6"},modalBorder:{conditions:{base:"ju367vb9",hover:"ju367vba",active:"ju367vbb"},defaultClass:"ju367vb9"},modalText:{conditions:{base:"ju367vbc",hover:"ju367vbd",active:"ju367vbe"},defaultClass:"ju367vbc"},modalTextDim:{conditions:{base:"ju367vbf",hover:"ju367vbg",active:"ju367vbh"},defaultClass:"ju367vbf"},modalTextSecondary:{conditions:{base:"ju367vbi",hover:"ju367vbj",active:"ju367vbk"},defaultClass:"ju367vbi"},profileAction:{conditions:{base:"ju367vbl",hover:"ju367vbm",active:"ju367vbn"},defaultClass:"ju367vbl"},profileActionHover:{conditions:{base:"ju367vbo",hover:"ju367vbp",active:"ju367vbq"},defaultClass:"ju367vbo"},profileForeground:{conditions:{base:"ju367vbr",hover:"ju367vbs",active:"ju367vbt"},defaultClass:"ju367vbr"},selectedOptionBorder:{conditions:{base:"ju367vbu",hover:"ju367vbv",active:"ju367vbw"},defaultClass:"ju367vbu"},standby:{conditions:{base:"ju367vbx",hover:"ju367vby",active:"ju367vbz"},defaultClass:"ju367vbx"}}},borderColor:{values:{accentColor:{conditions:{base:"ju367vc0",hover:"ju367vc1",active:"ju367vc2"},defaultClass:"ju367vc0"},accentColorForeground:{conditions:{base:"ju367vc3",hover:"ju367vc4",active:"ju367vc5"},defaultClass:"ju367vc3"},actionButtonBorder:{conditions:{base:"ju367vc6",hover:"ju367vc7",active:"ju367vc8"},defaultClass:"ju367vc6"},actionButtonBorderMobile:{conditions:{base:"ju367vc9",hover:"ju367vca",active:"ju367vcb"},defaultClass:"ju367vc9"},actionButtonSecondaryBackground:{conditions:{base:"ju367vcc",hover:"ju367vcd",active:"ju367vce"},defaultClass:"ju367vcc"},closeButton:{conditions:{base:"ju367vcf",hover:"ju367vcg",active:"ju367vch"},defaultClass:"ju367vcf"},closeButtonBackground:{conditions:{base:"ju367vci",hover:"ju367vcj",active:"ju367vck"},defaultClass:"ju367vci"},connectButtonBackground:{conditions:{base:"ju367vcl",hover:"ju367vcm",active:"ju367vcn"},defaultClass:"ju367vcl"},connectButtonBackgroundError:{conditions:{base:"ju367vco",hover:"ju367vcp",active:"ju367vcq"},defaultClass:"ju367vco"},connectButtonInnerBackground:{conditions:{base:"ju367vcr",hover:"ju367vcs",active:"ju367vct"},defaultClass:"ju367vcr"},connectButtonText:{conditions:{base:"ju367vcu",hover:"ju367vcv",active:"ju367vcw"},defaultClass:"ju367vcu"},connectButtonTextError:{conditions:{base:"ju367vcx",hover:"ju367vcy",active:"ju367vcz"},defaultClass:"ju367vcx"},connectionIndicator:{conditions:{base:"ju367vd0",hover:"ju367vd1",active:"ju367vd2"},defaultClass:"ju367vd0"},downloadBottomCardBackground:{conditions:{base:"ju367vd3",hover:"ju367vd4",active:"ju367vd5"},defaultClass:"ju367vd3"},downloadTopCardBackground:{conditions:{base:"ju367vd6",hover:"ju367vd7",active:"ju367vd8"},defaultClass:"ju367vd6"},error:{conditions:{base:"ju367vd9",hover:"ju367vda",active:"ju367vdb"},defaultClass:"ju367vd9"},generalBorder:{conditions:{base:"ju367vdc",hover:"ju367vdd",active:"ju367vde"},defaultClass:"ju367vdc"},generalBorderDim:{conditions:{base:"ju367vdf",hover:"ju367vdg",active:"ju367vdh"},defaultClass:"ju367vdf"},menuItemBackground:{conditions:{base:"ju367vdi",hover:"ju367vdj",active:"ju367vdk"},defaultClass:"ju367vdi"},modalBackdrop:{conditions:{base:"ju367vdl",hover:"ju367vdm",active:"ju367vdn"},defaultClass:"ju367vdl"},modalBackground:{conditions:{base:"ju367vdo",hover:"ju367vdp",active:"ju367vdq"},defaultClass:"ju367vdo"},modalBorder:{conditions:{base:"ju367vdr",hover:"ju367vds",active:"ju367vdt"},defaultClass:"ju367vdr"},modalText:{conditions:{base:"ju367vdu",hover:"ju367vdv",active:"ju367vdw"},defaultClass:"ju367vdu"},modalTextDim:{conditions:{base:"ju367vdx",hover:"ju367vdy",active:"ju367vdz"},defaultClass:"ju367vdx"},modalTextSecondary:{conditions:{base:"ju367ve0",hover:"ju367ve1",active:"ju367ve2"},defaultClass:"ju367ve0"},profileAction:{conditions:{base:"ju367ve3",hover:"ju367ve4",active:"ju367ve5"},defaultClass:"ju367ve3"},profileActionHover:{conditions:{base:"ju367ve6",hover:"ju367ve7",active:"ju367ve8"},defaultClass:"ju367ve6"},profileForeground:{conditions:{base:"ju367ve9",hover:"ju367vea",active:"ju367veb"},defaultClass:"ju367ve9"},selectedOptionBorder:{conditions:{base:"ju367vec",hover:"ju367ved",active:"ju367vee"},defaultClass:"ju367vec"},standby:{conditions:{base:"ju367vef",hover:"ju367veg",active:"ju367veh"},defaultClass:"ju367vef"}}},boxShadow:{values:{connectButton:{conditions:{base:"ju367vei",hover:"ju367vej",active:"ju367vek"},defaultClass:"ju367vei"},dialog:{conditions:{base:"ju367vel",hover:"ju367vem",active:"ju367ven"},defaultClass:"ju367vel"},profileDetailsAction:{conditions:{base:"ju367veo",hover:"ju367vep",active:"ju367veq"},defaultClass:"ju367veo"},selectedOption:{conditions:{base:"ju367ver",hover:"ju367ves",active:"ju367vet"},defaultClass:"ju367ver"},selectedWallet:{conditions:{base:"ju367veu",hover:"ju367vev",active:"ju367vew"},defaultClass:"ju367veu"},walletLogo:{conditions:{base:"ju367vex",hover:"ju367vey",active:"ju367vez"},defaultClass:"ju367vex"}}},color:{values:{accentColor:{conditions:{base:"ju367vf0",hover:"ju367vf1",active:"ju367vf2"},defaultClass:"ju367vf0"},accentColorForeground:{conditions:{base:"ju367vf3",hover:"ju367vf4",active:"ju367vf5"},defaultClass:"ju367vf3"},actionButtonBorder:{conditions:{base:"ju367vf6",hover:"ju367vf7",active:"ju367vf8"},defaultClass:"ju367vf6"},actionButtonBorderMobile:{conditions:{base:"ju367vf9",hover:"ju367vfa",active:"ju367vfb"},defaultClass:"ju367vf9"},actionButtonSecondaryBackground:{conditions:{base:"ju367vfc",hover:"ju367vfd",active:"ju367vfe"},defaultClass:"ju367vfc"},closeButton:{conditions:{base:"ju367vff",hover:"ju367vfg",active:"ju367vfh"},defaultClass:"ju367vff"},closeButtonBackground:{conditions:{base:"ju367vfi",hover:"ju367vfj",active:"ju367vfk"},defaultClass:"ju367vfi"},connectButtonBackground:{conditions:{base:"ju367vfl",hover:"ju367vfm",active:"ju367vfn"},defaultClass:"ju367vfl"},connectButtonBackgroundError:{conditions:{base:"ju367vfo",hover:"ju367vfp",active:"ju367vfq"},defaultClass:"ju367vfo"},connectButtonInnerBackground:{conditions:{base:"ju367vfr",hover:"ju367vfs",active:"ju367vft"},defaultClass:"ju367vfr"},connectButtonText:{conditions:{base:"ju367vfu",hover:"ju367vfv",active:"ju367vfw"},defaultClass:"ju367vfu"},connectButtonTextError:{conditions:{base:"ju367vfx",hover:"ju367vfy",active:"ju367vfz"},defaultClass:"ju367vfx"},connectionIndicator:{conditions:{base:"ju367vg0",hover:"ju367vg1",active:"ju367vg2"},defaultClass:"ju367vg0"},downloadBottomCardBackground:{conditions:{base:"ju367vg3",hover:"ju367vg4",active:"ju367vg5"},defaultClass:"ju367vg3"},downloadTopCardBackground:{conditions:{base:"ju367vg6",hover:"ju367vg7",active:"ju367vg8"},defaultClass:"ju367vg6"},error:{conditions:{base:"ju367vg9",hover:"ju367vga",active:"ju367vgb"},defaultClass:"ju367vg9"},generalBorder:{conditions:{base:"ju367vgc",hover:"ju367vgd",active:"ju367vge"},defaultClass:"ju367vgc"},generalBorderDim:{conditions:{base:"ju367vgf",hover:"ju367vgg",active:"ju367vgh"},defaultClass:"ju367vgf"},menuItemBackground:{conditions:{base:"ju367vgi",hover:"ju367vgj",active:"ju367vgk"},defaultClass:"ju367vgi"},modalBackdrop:{conditions:{base:"ju367vgl",hover:"ju367vgm",active:"ju367vgn"},defaultClass:"ju367vgl"},modalBackground:{conditions:{base:"ju367vgo",hover:"ju367vgp",active:"ju367vgq"},defaultClass:"ju367vgo"},modalBorder:{conditions:{base:"ju367vgr",hover:"ju367vgs",active:"ju367vgt"},defaultClass:"ju367vgr"},modalText:{conditions:{base:"ju367vgu",hover:"ju367vgv",active:"ju367vgw"},defaultClass:"ju367vgu"},modalTextDim:{conditions:{base:"ju367vgx",hover:"ju367vgy",active:"ju367vgz"},defaultClass:"ju367vgx"},modalTextSecondary:{conditions:{base:"ju367vh0",hover:"ju367vh1",active:"ju367vh2"},defaultClass:"ju367vh0"},profileAction:{conditions:{base:"ju367vh3",hover:"ju367vh4",active:"ju367vh5"},defaultClass:"ju367vh3"},profileActionHover:{conditions:{base:"ju367vh6",hover:"ju367vh7",active:"ju367vh8"},defaultClass:"ju367vh6"},profileForeground:{conditions:{base:"ju367vh9",hover:"ju367vha",active:"ju367vhb"},defaultClass:"ju367vh9"},selectedOptionBorder:{conditions:{base:"ju367vhc",hover:"ju367vhd",active:"ju367vhe"},defaultClass:"ju367vhc"},standby:{conditions:{base:"ju367vhf",hover:"ju367vhg",active:"ju367vhh"},defaultClass:"ju367vhf"}}}}},{conditions:{defaultCondition:"smallScreen",conditionNames:["smallScreen","largeScreen"],responsiveArray:void 0},styles:{alignItems:{values:{"flex-start":{conditions:{smallScreen:"ju367v0",largeScreen:"ju367v1"},defaultClass:"ju367v0"},"flex-end":{conditions:{smallScreen:"ju367v2",largeScreen:"ju367v3"},defaultClass:"ju367v2"},center:{conditions:{smallScreen:"ju367v4",largeScreen:"ju367v5"},defaultClass:"ju367v4"}}},display:{values:{none:{conditions:{smallScreen:"ju367v6",largeScreen:"ju367v7"},defaultClass:"ju367v6"},block:{conditions:{smallScreen:"ju367v8",largeScreen:"ju367v9"},defaultClass:"ju367v8"},flex:{conditions:{smallScreen:"ju367va",largeScreen:"ju367vb"},defaultClass:"ju367va"},inline:{conditions:{smallScreen:"ju367vc",largeScreen:"ju367vd"},defaultClass:"ju367vc"}}}}},{conditions:void 0,styles:{margin:{mappings:["marginTop","marginBottom","marginLeft","marginRight"]},marginX:{mappings:["marginLeft","marginRight"]},marginY:{mappings:["marginTop","marginBottom"]},padding:{mappings:["paddingTop","paddingBottom","paddingLeft","paddingRight"]},paddingX:{mappings:["paddingLeft","paddingRight"]},paddingY:{mappings:["paddingTop","paddingBottom"]},alignSelf:{values:{"flex-start":{defaultClass:"ju367ve"},"flex-end":{defaultClass:"ju367vf"},center:{defaultClass:"ju367vg"}}},backgroundSize:{values:{cover:{defaultClass:"ju367vh"}}},borderRadius:{values:{1:{defaultClass:"ju367vi"},6:{defaultClass:"ju367vj"},10:{defaultClass:"ju367vk"},13:{defaultClass:"ju367vl"},actionButton:{defaultClass:"ju367vm"},connectButton:{defaultClass:"ju367vn"},menuButton:{defaultClass:"ju367vo"},modal:{defaultClass:"ju367vp"},modalMobile:{defaultClass:"ju367vq"},"25%":{defaultClass:"ju367vr"},full:{defaultClass:"ju367vs"}}},borderStyle:{values:{solid:{defaultClass:"ju367vt"}}},borderWidth:{values:{0:{defaultClass:"ju367vu"},1:{defaultClass:"ju367vv"},2:{defaultClass:"ju367vw"},4:{defaultClass:"ju367vx"}}},cursor:{values:{pointer:{defaultClass:"ju367vy"},none:{defaultClass:"ju367vz"}}},pointerEvents:{values:{none:{defaultClass:"ju367v10"},all:{defaultClass:"ju367v11"}}},minHeight:{values:{8:{defaultClass:"ju367v12"},44:{defaultClass:"ju367v13"}}},flexDirection:{values:{row:{defaultClass:"ju367v14"},column:{defaultClass:"ju367v15"}}},fontFamily:{values:{body:{defaultClass:"ju367v16"}}},fontSize:{values:{12:{defaultClass:"ju367v17"},13:{defaultClass:"ju367v18"},14:{defaultClass:"ju367v19"},16:{defaultClass:"ju367v1a"},18:{defaultClass:"ju367v1b"},20:{defaultClass:"ju367v1c"},23:{defaultClass:"ju367v1d"}}},fontWeight:{values:{regular:{defaultClass:"ju367v1e"},medium:{defaultClass:"ju367v1f"},semibold:{defaultClass:"ju367v1g"},bold:{defaultClass:"ju367v1h"},heavy:{defaultClass:"ju367v1i"}}},gap:{values:{0:{defaultClass:"ju367v1j"},1:{defaultClass:"ju367v1k"},2:{defaultClass:"ju367v1l"},3:{defaultClass:"ju367v1m"},4:{defaultClass:"ju367v1n"},5:{defaultClass:"ju367v1o"},6:{defaultClass:"ju367v1p"},8:{defaultClass:"ju367v1q"},10:{defaultClass:"ju367v1r"},12:{defaultClass:"ju367v1s"},14:{defaultClass:"ju367v1t"},16:{defaultClass:"ju367v1u"},18:{defaultClass:"ju367v1v"},20:{defaultClass:"ju367v1w"},24:{defaultClass:"ju367v1x"},28:{defaultClass:"ju367v1y"},32:{defaultClass:"ju367v1z"},36:{defaultClass:"ju367v20"},44:{defaultClass:"ju367v21"},64:{defaultClass:"ju367v22"},"-1":{defaultClass:"ju367v23"}}},height:{values:{1:{defaultClass:"ju367v24"},2:{defaultClass:"ju367v25"},4:{defaultClass:"ju367v26"},8:{defaultClass:"ju367v27"},12:{defaultClass:"ju367v28"},20:{defaultClass:"ju367v29"},24:{defaultClass:"ju367v2a"},28:{defaultClass:"ju367v2b"},30:{defaultClass:"ju367v2c"},32:{defaultClass:"ju367v2d"},34:{defaultClass:"ju367v2e"},36:{defaultClass:"ju367v2f"},40:{defaultClass:"ju367v2g"},44:{defaultClass:"ju367v2h"},48:{defaultClass:"ju367v2i"},54:{defaultClass:"ju367v2j"},60:{defaultClass:"ju367v2k"},200:{defaultClass:"ju367v2l"},full:{defaultClass:"ju367v2m"},max:{defaultClass:"ju367v2n"}}},justifyContent:{values:{"flex-start":{defaultClass:"ju367v2o"},"flex-end":{defaultClass:"ju367v2p"},center:{defaultClass:"ju367v2q"},"space-between":{defaultClass:"ju367v2r"},"space-around":{defaultClass:"ju367v2s"}}},textAlign:{values:{left:{defaultClass:"ju367v2t"},center:{defaultClass:"ju367v2u"},inherit:{defaultClass:"ju367v2v"}}},marginBottom:{values:{0:{defaultClass:"ju367v2w"},1:{defaultClass:"ju367v2x"},2:{defaultClass:"ju367v2y"},3:{defaultClass:"ju367v2z"},4:{defaultClass:"ju367v30"},5:{defaultClass:"ju367v31"},6:{defaultClass:"ju367v32"},8:{defaultClass:"ju367v33"},10:{defaultClass:"ju367v34"},12:{defaultClass:"ju367v35"},14:{defaultClass:"ju367v36"},16:{defaultClass:"ju367v37"},18:{defaultClass:"ju367v38"},20:{defaultClass:"ju367v39"},24:{defaultClass:"ju367v3a"},28:{defaultClass:"ju367v3b"},32:{defaultClass:"ju367v3c"},36:{defaultClass:"ju367v3d"},44:{defaultClass:"ju367v3e"},64:{defaultClass:"ju367v3f"},"-1":{defaultClass:"ju367v3g"}}},marginLeft:{values:{0:{defaultClass:"ju367v3h"},1:{defaultClass:"ju367v3i"},2:{defaultClass:"ju367v3j"},3:{defaultClass:"ju367v3k"},4:{defaultClass:"ju367v3l"},5:{defaultClass:"ju367v3m"},6:{defaultClass:"ju367v3n"},8:{defaultClass:"ju367v3o"},10:{defaultClass:"ju367v3p"},12:{defaultClass:"ju367v3q"},14:{defaultClass:"ju367v3r"},16:{defaultClass:"ju367v3s"},18:{defaultClass:"ju367v3t"},20:{defaultClass:"ju367v3u"},24:{defaultClass:"ju367v3v"},28:{defaultClass:"ju367v3w"},32:{defaultClass:"ju367v3x"},36:{defaultClass:"ju367v3y"},44:{defaultClass:"ju367v3z"},64:{defaultClass:"ju367v40"},"-1":{defaultClass:"ju367v41"}}},marginRight:{values:{0:{defaultClass:"ju367v42"},1:{defaultClass:"ju367v43"},2:{defaultClass:"ju367v44"},3:{defaultClass:"ju367v45"},4:{defaultClass:"ju367v46"},5:{defaultClass:"ju367v47"},6:{defaultClass:"ju367v48"},8:{defaultClass:"ju367v49"},10:{defaultClass:"ju367v4a"},12:{defaultClass:"ju367v4b"},14:{defaultClass:"ju367v4c"},16:{defaultClass:"ju367v4d"},18:{defaultClass:"ju367v4e"},20:{defaultClass:"ju367v4f"},24:{defaultClass:"ju367v4g"},28:{defaultClass:"ju367v4h"},32:{defaultClass:"ju367v4i"},36:{defaultClass:"ju367v4j"},44:{defaultClass:"ju367v4k"},64:{defaultClass:"ju367v4l"},"-1":{defaultClass:"ju367v4m"}}},marginTop:{values:{0:{defaultClass:"ju367v4n"},1:{defaultClass:"ju367v4o"},2:{defaultClass:"ju367v4p"},3:{defaultClass:"ju367v4q"},4:{defaultClass:"ju367v4r"},5:{defaultClass:"ju367v4s"},6:{defaultClass:"ju367v4t"},8:{defaultClass:"ju367v4u"},10:{defaultClass:"ju367v4v"},12:{defaultClass:"ju367v4w"},14:{defaultClass:"ju367v4x"},16:{defaultClass:"ju367v4y"},18:{defaultClass:"ju367v4z"},20:{defaultClass:"ju367v50"},24:{defaultClass:"ju367v51"},28:{defaultClass:"ju367v52"},32:{defaultClass:"ju367v53"},36:{defaultClass:"ju367v54"},44:{defaultClass:"ju367v55"},64:{defaultClass:"ju367v56"},"-1":{defaultClass:"ju367v57"}}},maxWidth:{values:{1:{defaultClass:"ju367v58"},2:{defaultClass:"ju367v59"},4:{defaultClass:"ju367v5a"},8:{defaultClass:"ju367v5b"},12:{defaultClass:"ju367v5c"},20:{defaultClass:"ju367v5d"},24:{defaultClass:"ju367v5e"},28:{defaultClass:"ju367v5f"},30:{defaultClass:"ju367v5g"},32:{defaultClass:"ju367v5h"},34:{defaultClass:"ju367v5i"},36:{defaultClass:"ju367v5j"},40:{defaultClass:"ju367v5k"},44:{defaultClass:"ju367v5l"},48:{defaultClass:"ju367v5m"},54:{defaultClass:"ju367v5n"},60:{defaultClass:"ju367v5o"},200:{defaultClass:"ju367v5p"},full:{defaultClass:"ju367v5q"},max:{defaultClass:"ju367v5r"}}},minWidth:{values:{1:{defaultClass:"ju367v5s"},2:{defaultClass:"ju367v5t"},4:{defaultClass:"ju367v5u"},8:{defaultClass:"ju367v5v"},12:{defaultClass:"ju367v5w"},20:{defaultClass:"ju367v5x"},24:{defaultClass:"ju367v5y"},28:{defaultClass:"ju367v5z"},30:{defaultClass:"ju367v60"},32:{defaultClass:"ju367v61"},34:{defaultClass:"ju367v62"},36:{defaultClass:"ju367v63"},40:{defaultClass:"ju367v64"},44:{defaultClass:"ju367v65"},48:{defaultClass:"ju367v66"},54:{defaultClass:"ju367v67"},60:{defaultClass:"ju367v68"},200:{defaultClass:"ju367v69"},full:{defaultClass:"ju367v6a"},max:{defaultClass:"ju367v6b"}}},overflow:{values:{hidden:{defaultClass:"ju367v6c"}}},paddingBottom:{values:{0:{defaultClass:"ju367v6d"},1:{defaultClass:"ju367v6e"},2:{defaultClass:"ju367v6f"},3:{defaultClass:"ju367v6g"},4:{defaultClass:"ju367v6h"},5:{defaultClass:"ju367v6i"},6:{defaultClass:"ju367v6j"},8:{defaultClass:"ju367v6k"},10:{defaultClass:"ju367v6l"},12:{defaultClass:"ju367v6m"},14:{defaultClass:"ju367v6n"},16:{defaultClass:"ju367v6o"},18:{defaultClass:"ju367v6p"},20:{defaultClass:"ju367v6q"},24:{defaultClass:"ju367v6r"},28:{defaultClass:"ju367v6s"},32:{defaultClass:"ju367v6t"},36:{defaultClass:"ju367v6u"},44:{defaultClass:"ju367v6v"},64:{defaultClass:"ju367v6w"},"-1":{defaultClass:"ju367v6x"}}},paddingLeft:{values:{0:{defaultClass:"ju367v6y"},1:{defaultClass:"ju367v6z"},2:{defaultClass:"ju367v70"},3:{defaultClass:"ju367v71"},4:{defaultClass:"ju367v72"},5:{defaultClass:"ju367v73"},6:{defaultClass:"ju367v74"},8:{defaultClass:"ju367v75"},10:{defaultClass:"ju367v76"},12:{defaultClass:"ju367v77"},14:{defaultClass:"ju367v78"},16:{defaultClass:"ju367v79"},18:{defaultClass:"ju367v7a"},20:{defaultClass:"ju367v7b"},24:{defaultClass:"ju367v7c"},28:{defaultClass:"ju367v7d"},32:{defaultClass:"ju367v7e"},36:{defaultClass:"ju367v7f"},44:{defaultClass:"ju367v7g"},64:{defaultClass:"ju367v7h"},"-1":{defaultClass:"ju367v7i"}}},paddingRight:{values:{0:{defaultClass:"ju367v7j"},1:{defaultClass:"ju367v7k"},2:{defaultClass:"ju367v7l"},3:{defaultClass:"ju367v7m"},4:{defaultClass:"ju367v7n"},5:{defaultClass:"ju367v7o"},6:{defaultClass:"ju367v7p"},8:{defaultClass:"ju367v7q"},10:{defaultClass:"ju367v7r"},12:{defaultClass:"ju367v7s"},14:{defaultClass:"ju367v7t"},16:{defaultClass:"ju367v7u"},18:{defaultClass:"ju367v7v"},20:{defaultClass:"ju367v7w"},24:{defaultClass:"ju367v7x"},28:{defaultClass:"ju367v7y"},32:{defaultClass:"ju367v7z"},36:{defaultClass:"ju367v80"},44:{defaultClass:"ju367v81"},64:{defaultClass:"ju367v82"},"-1":{defaultClass:"ju367v83"}}},paddingTop:{values:{0:{defaultClass:"ju367v84"},1:{defaultClass:"ju367v85"},2:{defaultClass:"ju367v86"},3:{defaultClass:"ju367v87"},4:{defaultClass:"ju367v88"},5:{defaultClass:"ju367v89"},6:{defaultClass:"ju367v8a"},8:{defaultClass:"ju367v8b"},10:{defaultClass:"ju367v8c"},12:{defaultClass:"ju367v8d"},14:{defaultClass:"ju367v8e"},16:{defaultClass:"ju367v8f"},18:{defaultClass:"ju367v8g"},20:{defaultClass:"ju367v8h"},24:{defaultClass:"ju367v8i"},28:{defaultClass:"ju367v8j"},32:{defaultClass:"ju367v8k"},36:{defaultClass:"ju367v8l"},44:{defaultClass:"ju367v8m"},64:{defaultClass:"ju367v8n"},"-1":{defaultClass:"ju367v8o"}}},position:{values:{absolute:{defaultClass:"ju367v8p"},fixed:{defaultClass:"ju367v8q"},relative:{defaultClass:"ju367v8r"}}},WebkitUserSelect:{values:{none:{defaultClass:"ju367v8s"}}},right:{values:{0:{defaultClass:"ju367v8t"}}},transition:{values:{default:{defaultClass:"ju367v8u"},transform:{defaultClass:"ju367v8v"}}},userSelect:{values:{none:{defaultClass:"ju367v8w"}}},width:{values:{1:{defaultClass:"ju367v8x"},2:{defaultClass:"ju367v8y"},4:{defaultClass:"ju367v8z"},8:{defaultClass:"ju367v90"},12:{defaultClass:"ju367v91"},20:{defaultClass:"ju367v92"},24:{defaultClass:"ju367v93"},28:{defaultClass:"ju367v94"},30:{defaultClass:"ju367v95"},32:{defaultClass:"ju367v96"},34:{defaultClass:"ju367v97"},36:{defaultClass:"ju367v98"},40:{defaultClass:"ju367v99"},44:{defaultClass:"ju367v9a"},48:{defaultClass:"ju367v9b"},54:{defaultClass:"ju367v9c"},60:{defaultClass:"ju367v9d"},200:{defaultClass:"ju367v9e"},full:{defaultClass:"ju367v9f"},max:{defaultClass:"ju367v9g"}}},backdropFilter:{values:{modalOverlay:{defaultClass:"ju367v9h"}}}}}),V1e={colors:{accentColor:"var(--rk-colors-accentColor)",accentColorForeground:"var(--rk-colors-accentColorForeground)",actionButtonBorder:"var(--rk-colors-actionButtonBorder)",actionButtonBorderMobile:"var(--rk-colors-actionButtonBorderMobile)",actionButtonSecondaryBackground:"var(--rk-colors-actionButtonSecondaryBackground)",closeButton:"var(--rk-colors-closeButton)",closeButtonBackground:"var(--rk-colors-closeButtonBackground)",connectButtonBackground:"var(--rk-colors-connectButtonBackground)",connectButtonBackgroundError:"var(--rk-colors-connectButtonBackgroundError)",connectButtonInnerBackground:"var(--rk-colors-connectButtonInnerBackground)",connectButtonText:"var(--rk-colors-connectButtonText)",connectButtonTextError:"var(--rk-colors-connectButtonTextError)",connectionIndicator:"var(--rk-colors-connectionIndicator)",downloadBottomCardBackground:"var(--rk-colors-downloadBottomCardBackground)",downloadTopCardBackground:"var(--rk-colors-downloadTopCardBackground)",error:"var(--rk-colors-error)",generalBorder:"var(--rk-colors-generalBorder)",generalBorderDim:"var(--rk-colors-generalBorderDim)",menuItemBackground:"var(--rk-colors-menuItemBackground)",modalBackdrop:"var(--rk-colors-modalBackdrop)",modalBackground:"var(--rk-colors-modalBackground)",modalBorder:"var(--rk-colors-modalBorder)",modalText:"var(--rk-colors-modalText)",modalTextDim:"var(--rk-colors-modalTextDim)",modalTextSecondary:"var(--rk-colors-modalTextSecondary)",profileAction:"var(--rk-colors-profileAction)",profileActionHover:"var(--rk-colors-profileActionHover)",profileForeground:"var(--rk-colors-profileForeground)",selectedOptionBorder:"var(--rk-colors-selectedOptionBorder)",standby:"var(--rk-colors-standby)"},fonts:{body:"var(--rk-fonts-body)"},radii:{actionButton:"var(--rk-radii-actionButton)",connectButton:"var(--rk-radii-connectButton)",menuButton:"var(--rk-radii-menuButton)",modal:"var(--rk-radii-modal)",modalMobile:"var(--rk-radii-modalMobile)"},shadows:{connectButton:"var(--rk-shadows-connectButton)",dialog:"var(--rk-shadows-dialog)",profileDetailsAction:"var(--rk-shadows-profileDetailsAction)",selectedOption:"var(--rk-shadows-selectedOption)",selectedWallet:"var(--rk-shadows-selectedWallet)",walletLogo:"var(--rk-shadows-walletLogo)"},blurs:{modalOverlay:"var(--rk-blurs-modalOverlay)"}},gFt={shrink:"_12cbo8i6",shrinkSm:"_12cbo8i7"},bFt="_12cbo8i3 ju367v8r",yFt={grow:"_12cbo8i4",growLg:"_12cbo8i5"};function iu({active:e,hover:t}){return[bFt,t&&yFt[t],gFt[e]]}var NRe=m.createContext(null);function vFt(){const{adapter:e}=m.useContext(NRe)??{};if(!e)throw new Error("No authentication adapter found");return e}function j$(){const e=m.useContext(NRe);return(e==null?void 0:e.status)??null}function ARe(){const e=j$(),{isConnected:t}=ns();return t?e&&(e==="loading"||e==="unauthenticated")?e:"connected":"disconnected"}function sle(){return typeof navigator<"u"&&/android/i.test(navigator.userAgent)}function wFt(){return typeof navigator<"u"&&/iPhone|iPod/.test(navigator.userAgent)}function CFt(){return typeof navigator<"u"&&(/iPad/.test(navigator.userAgent)||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1)}function b5(){return wFt()||CFt()}function ou(){return sle()||b5()}var SFt="iekbcc0",NFt={a:"iekbcca",blockquote:"iekbcc2",button:"iekbcc9",input:"iekbcc8 iekbcc5 iekbcc4",mark:"iekbcc6",ol:"iekbcc1",q:"iekbcc2",select:"iekbcc7 iekbcc5 iekbcc4",table:"iekbcc3",textarea:"iekbcc5 iekbcc4",ul:"iekbcc1"},AFt=({reset:e,...t})=>{if(!e)return Jee(t);const n=NFt[e],r=Jee(t);return gMe(SFt,n,r)},wn=Ae.forwardRef(({as:e="div",className:t,testId:n,...r},s)=>{const a={},o={};for(const c in r)Jee.properties.has(c)?a[c]=r[c]:o[c]=r[c];const l=AFt({reset:typeof e=="string"?e:"div",...a});return Ae.createElement(e,{className:gMe(l,t),...o,"data-testid":n?`rk-${n.replace(/^rk-/,"")}`:void 0,ref:s})});wn.displayName="Box";var jRe=new Map,tW=new Map;async function ERe(e){const t=tW.get(e);if(t)return t;const n=async()=>e().then(async s=>(jRe.set(e,s),s)),r=n().catch(s=>n().catch(a=>{tW.delete(e)}));return tW.set(e,r),r}async function sx(...e){return await Promise.all(e.map(t=>typeof t=="function"?ERe(t):t))}function jFt(){const[,e]=m.useReducer(t=>t+1,0);return e}function ile(e){const t=typeof e=="function"?jRe.get(e):void 0,n=jFt();return m.useEffect(()=>{typeof e=="function"&&!t&&ERe(e).then(n)},[e,t,n]),typeof e=="function"?t:e}function Pc({alt:e,background:t,borderColor:n,borderRadius:r,useAsImage:s,boxShadow:a,height:o,src:l,width:c,testId:u}){const d=b5(),f=ile(l),x=f&&/^http/.test(f),[g,v]=m.useReducer(()=>!0,!1);return Ae.createElement(wn,{"aria-label":e,borderRadius:r,boxShadow:a,height:typeof o=="string"?o:void 0,overflow:"hidden",position:"relative",role:"img",style:{background:t,height:typeof o=="number"?o:void 0,width:typeof c=="number"?c:void 0},width:typeof c=="string"?c:void 0,testId:u},Ae.createElement(wn,{...x?{"aria-hidden":!0,as:"img",onLoad:v,src:f}:{"aria-hidden":!0,as:"img",src:f},height:"full",position:"absolute",...d?{WebkitUserSelect:"none"}:{},style:{WebkitTouchCallout:"none",transition:"opacity .15s linear",userSelect:"none",...!s&&x?{opacity:g?1:0}:{}},width:"full"}),n?Ae.createElement(wn,{...typeof n=="object"&&"custom"in n?{style:{borderColor:n.custom}}:{borderColor:n},borderRadius:r,borderStyle:"solid",borderWidth:"1",height:"full",position:"relative",width:"full"}):null)}var EFt="_1luule42",_Ft="_1luule43",kFt=e=>m.useMemo(()=>`${e}_${Math.round(Math.random()*1e9)}`,[e]),JE=({height:e=21,width:t=21})=>{const n=kFt("spinner");return Ae.createElement("svg",{className:EFt,fill:"none",height:e,viewBox:"0 0 21 21",width:t,xmlns:"http://www.w3.org/2000/svg"},Ae.createElement("title",null,"Loading"),Ae.createElement("clipPath",{id:n},Ae.createElement("path",{d:"M10.5 3C6.35786 3 3 6.35786 3 10.5C3 14.6421 6.35786 18 10.5 18C11.3284 18 12 18.6716 12 19.5C12 20.3284 11.3284 21 10.5 21C4.70101 21 0 16.299 0 10.5C0 4.70101 4.70101 0 10.5 0C16.299 0 21 4.70101 21 10.5C21 11.3284 20.3284 12 19.5 12C18.6716 12 18 11.3284 18 10.5C18 6.35786 14.6421 3 10.5 3Z"})),Ae.createElement("foreignObject",{clipPath:`url(#${n})`,height:"21",width:"21",x:"0",y:"0"},Ae.createElement("div",{className:_Ft})))},Qi=["#FC5C54","#FFD95A","#E95D72","#6A87C8","#5FD0F3","#75C06B","#FFDD86","#5FC6D4","#FF949A","#FF8024","#9BA1A4","#EC66FF","#FF8CBC","#FF9A23","#C5DADB","#A8CE63","#71ABFF","#FFE279","#B6B1B6","#FF6780","#A575FF","#4D82FF","#FFB35A"],W1e=[{color:Qi[0],emoji:"🌶"},{color:Qi[1],emoji:"🤑"},{color:Qi[2],emoji:"🐙"},{color:Qi[3],emoji:"🫐"},{color:Qi[4],emoji:"🐳"},{color:Qi[0],emoji:"🤶"},{color:Qi[5],emoji:"🌲"},{color:Qi[6],emoji:"🌞"},{color:Qi[7],emoji:"🐒"},{color:Qi[8],emoji:"🐵"},{color:Qi[9],emoji:"🦊"},{color:Qi[10],emoji:"🐼"},{color:Qi[11],emoji:"🦄"},{color:Qi[12],emoji:"🐷"},{color:Qi[13],emoji:"🐧"},{color:Qi[8],emoji:"🦩"},{color:Qi[14],emoji:"👽"},{color:Qi[0],emoji:"🎈"},{color:Qi[8],emoji:"🍉"},{color:Qi[1],emoji:"🎉"},{color:Qi[15],emoji:"🐲"},{color:Qi[16],emoji:"🌎"},{color:Qi[17],emoji:"🍊"},{color:Qi[18],emoji:"🐭"},{color:Qi[19],emoji:"🍣"},{color:Qi[1],emoji:"🐥"},{color:Qi[20],emoji:"👾"},{color:Qi[15],emoji:"🥦"},{color:Qi[0],emoji:"👹"},{color:Qi[17],emoji:"🙀"},{color:Qi[4],emoji:"⛱"},{color:Qi[21],emoji:"⛵️"},{color:Qi[17],emoji:"🥳"},{color:Qi[8],emoji:"🤯"},{color:Qi[22],emoji:"🤠"}];function TFt(e){let t=0;if(e.length===0)return t;for(let n=0;n<e.length;n++){const r=e.charCodeAt(n);t=(t<<5)-t+r,t|=0}return t}function IFt(e){const n=Math.abs(TFt((typeof e=="string"?e:"").toLowerCase())%W1e.length);return W1e[n??0]}var PFt=({address:e,ensImage:t,size:n})=>{const[r,s]=m.useState(!1);m.useEffect(()=>{if(t){const l=new Image;l.src=t,l.onload=()=>s(!0)}},[t]);const{color:a,emoji:o}=m.useMemo(()=>IFt(e),[e]);return t?r?Ae.createElement(wn,{backgroundSize:"cover",borderRadius:"full",position:"absolute",style:{backgroundImage:`url(${t})`,backgroundPosition:"center",height:n,width:n}}):Ae.createElement(wn,{alignItems:"center",backgroundSize:"cover",borderRadius:"full",color:"modalText",display:"flex",justifyContent:"center",position:"absolute",style:{height:n,width:n}},Ae.createElement(JE,null)):Ae.createElement(wn,{alignItems:"center",display:"flex",justifyContent:"center",overflow:"hidden",style:{...!t&&{backgroundColor:a},height:n,width:n}},o)},_Re=PFt,kRe=m.createContext(_Re);function FFt({address:e,imageUrl:t,loading:n,size:r}){const s=m.useContext(kRe);return Ae.createElement(wn,{"aria-hidden":!0,borderRadius:"full",overflow:"hidden",position:"relative",style:{height:`${r}px`,width:`${r}px`},userSelect:"none"},Ae.createElement(wn,{alignItems:"center",borderRadius:"full",display:"flex",justifyContent:"center",overflow:"hidden",position:"absolute",style:{fontSize:`${Math.round(r*.55)}px`,height:`${r}px`,transform:n?"scale(0.72)":void 0,transition:".25s ease",transitionDelay:n?void 0:".1s",width:`${r}px`,willChange:"transform"},userSelect:"none"},Ae.createElement(s,{address:e,ensImage:t,size:r})),n&&Ae.createElement(wn,{color:"accentColor",display:"flex",height:"full",position:"absolute",width:"full"},Ae.createElement(JE,{height:"100%",width:"100%"})))}var q1e={defaultLocale:"en",locale:"en"},OFt=class{constructor(e){this.listeners=new Set,this.defaultLocale=q1e.defaultLocale,this.enableFallback=!1,this.locale=q1e.locale,this.cachedLocales=[],this.translations={};for(const[t,n]of Object.entries(e))this.cachedLocales=[...this.cachedLocales,t],this.translations={...this.translations,...this.flattenTranslation(n,t)}}missingMessage(e){return`[missing: "${this.locale}.${e}" translation]`}flattenTranslation(e,t){const n={},r=(s,a)=>{for(const o of Object.keys(s)){const l=`${a}.${o}`,c=s[o];typeof c=="object"&&c!==null?r(c,l):n[l]=c}};return r(e,t),n}translateWithReplacements(e,t={}){let n=e;for(const r in t){const s=t[r];n=n.replace(`%{${r}}`,s)}return n}t(e,t,n){const r=`${this.locale}.${e}`,s=this.translations[r];if(!s){if(this.enableFallback){const a=`${this.defaultLocale}.${e}`,o=this.translations[a];if(o)return this.translateWithReplacements(o,t)}return n!=null&&n.rawKeyIfTranslationMissing?e:this.missingMessage(e)}return this.translateWithReplacements(s,t)}isLocaleCached(e){return this.cachedLocales.includes(e)}updateLocale(e){this.locale=e,this.notifyListeners()}setTranslations(e,t){this.isLocaleCached(e)||(this.cachedLocales=[...this.cachedLocales,e],this.translations={...this.translations,...this.flattenTranslation(t,e)}),this.locale=e,this.notifyListeners()}notifyListeners(){for(const e of this.listeners)e()}onChange(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}},Xh=new OFt({en:JSON.parse(Wee),"en-US":JSON.parse(Wee)});Xh.defaultLocale="en-US";Xh.locale="en-US";Xh.enableFallback=!0;var MFt=async e=>{switch(e){case"ar":case"ar-AR":return(await as(async()=>{const{default:t}=await import("./ar_AR-ZRPPM56D-d2WEfzQ_.js");return{default:t}},[])).default;case"de":case"de-DE":return(await as(async()=>{const{default:t}=await import("./de_DE-GYZFZXWH-CYZf24IR.js");return{default:t}},[])).default;case"en":case"en-US":return(await as(async()=>{const{default:t}=await Promise.resolve().then(()=>wNe);return{default:t}},void 0)).default;case"es":case"es-419":return(await as(async()=>{const{default:t}=await import("./es_419-OGVOQEFZ-D6BJPTeQ.js");return{default:t}},[])).default;case"fr":case"fr-FR":return(await as(async()=>{const{default:t}=await import("./fr_FR-Q5QBQBX2-lQoTmpTH.js");return{default:t}},[])).default;case"hi":case"hi-IN":return(await as(async()=>{const{default:t}=await import("./hi_IN-7I7LRHGW-CTQjmeYe.js");return{default:t}},[])).default;case"id":case"id-ID":return(await as(async()=>{const{default:t}=await import("./id_ID-ZMGZ2JFV-CgKQKAmU.js");return{default:t}},[])).default;case"ja":case"ja-JP":return(await as(async()=>{const{default:t}=await import("./ja_JP-NYBCHQTZ-CMaBl8Za.js");return{default:t}},[])).default;case"ko":case"ko-KR":return(await as(async()=>{const{default:t}=await import("./ko_KR-67WE736M-DHWhIjcm.js");return{default:t}},[])).default;case"ms":case"ms-MY":return(await as(async()=>{const{default:t}=await import("./ms_MY-65AJIBUS-BLlUrxe6.js");return{default:t}},[])).default;case"pt":case"pt-BR":return(await as(async()=>{const{default:t}=await import("./pt_BR-DMJANC65-DMs4DrlC.js");return{default:t}},[])).default;case"ru":case"ru-RU":return(await as(async()=>{const{default:t}=await import("./ru_RU-WER7RQ6A-DsJK55uv.js");return{default:t}},[])).default;case"th":case"th-TH":return(await as(async()=>{const{default:t}=await import("./th_TH-JOSHEZ6D-Cp87mIRZ.js");return{default:t}},[])).default;case"tr":case"tr-TR":return(await as(async()=>{const{default:t}=await import("./tr_TR-EAMG2YPO-C52_xfsf.js");return{default:t}},[])).default;case"ua":case"uk-UA":return(await as(async()=>{const{default:t}=await import("./uk_UA-GO2TRVWA-C1C1400t.js");return{default:t}},[])).default;case"vi":case"vi-VN":return(await as(async()=>{const{default:t}=await import("./vi_VN-5HLLSOJA-Dj7ferOp.js");return{default:t}},[])).default;case"zh":case"zh-CN":case"zh-Hans":return(await as(async()=>{const{default:t}=await import("./zh_CN-THPIFVWJ-Cbp71xMR.js");return{default:t}},[])).default;case"zh-HK":return(await as(async()=>{const{default:t}=await import("./zh_HK-R7XP4TGF-CyJtfKGw.js");return{default:t}},[])).default;case"zh-Hant":case"zh-TW":return(await as(async()=>{const{default:t}=await import("./zh_TW-F5LD752V-AHFgsYw-.js");return{default:t}},[])).default;default:return(await as(async()=>{const{default:t}=await Promise.resolve().then(()=>wNe);return{default:t}},void 0)).default}};async function G1e(e){if(Xh.isLocaleCached(e)){Xh.updateLocale(e);return}const n=await MFt(e);Xh.setTranslations(e,JSON.parse(n))}var RFt=()=>{var e;if(typeof window<"u"&&typeof navigator<"u"){if((e=navigator.languages)!=null&&e.length)return navigator.languages[0];if(navigator.language)return navigator.language}},cc=m.createContext({i18n:Xh}),LFt=({children:e,locale:t})=>{const[n,r]=m.useState(0),s=m.useMemo(()=>RFt(),[]);m.useEffect(()=>Xh.onChange(()=>{r(l=>l+1)}),[]),m.useEffect(()=>{t&&t!==Xh.locale?G1e(t):!t&&s&&s!==Xh.locale&&G1e(s)},[t,s]);const a=m.useMemo(()=>({t:(l,c)=>Xh.t(l,c),i18n:Xh}),[n]);return Ae.createElement(cc.Provider,{value:a},e)};function TRe(e){return e!=null}var K1e={iconBackground:"#7290CC",iconUrl:async()=>(await as(async()=>{const{default:e}=await import("./apechain-COEQ5RUI-0TDoXOYf.js");return{default:e}},[])).default},nW={iconBackground:"#96bedc",iconUrl:async()=>(await as(async()=>{const{default:e}=await import("./arbitrum-HW44W6XR-hPA5bMPt.js");return{default:e}},[])).default},Y1e={iconBackground:"#e84141",iconUrl:async()=>(await as(async()=>{const{default:e}=await import("./avalanche-MXEFEDSW-DcC5FNt3.js");return{default:e}},[])).default},rW={iconBackground:"#0052ff",iconUrl:async()=>(await as(async()=>{const{default:e}=await import("./base-Z4LFBE5D-DHfqMzJC.js");return{default:e}},[])).default},sW={iconBackground:"#814625",iconUrl:async()=>(await as(async()=>{const{default:e}=await import("./berachain-ZN3U5LDZ-CAvW_8ws.js");return{default:e}},[])).default},X1e={iconBackground:"#000000",iconUrl:async()=>(await as(async()=>{const{default:e}=await import("./blast-46UQLYYY-BV_Xlsq4.js");return{default:e}},[])).default},Q1e={iconBackground:"#ebac0e",iconUrl:async()=>(await as(async()=>{const{default:e}=await import("./bsc-RVE67I5L-DVYEF0vl.js");return{default:e}},[])).default},Z1e={iconBackground:"#FCFF52",iconUrl:async()=>(await as(async()=>{const{default:e}=await import("./celo-E6XU57FO-C5IguUgF.js");return{default:e}},[])).default},J1e={iconBackground:"#002D74",iconUrl:async()=>(await as(async()=>{const{default:e}=await import("./cronos-ROYR77VZ-Prn3LRPZ.js");return{default:e}},[])).default},DFt={iconBackground:"#A36EFD",iconUrl:async()=>(await as(async()=>{const{default:e}=await import("./degen-7ROC3GCY-9HqAkHtZ.js");return{default:e}},[])).default},mb={iconBackground:"#484c50",iconUrl:async()=>(await as(async()=>{const{default:e}=await import("./ethereum-RFBAMUVK-WsW8NXqo.js");return{default:e}},[])).default},ebe={iconBackground:"transparent",iconUrl:async()=>(await as(async()=>{const{default:e}=await import("./flow-NBCRNYVF-D2XasjKk.js");return{default:e}},[])).default},BFt={iconBackground:"#04795c",iconUrl:async()=>(await as(async()=>{const{default:e}=await import("./gnosis-Y56LN66M-D4_J-ZQH.js");return{default:e}},[])).default},tbe={iconBackground:"#000000",iconUrl:async()=>(await as(async()=>{const{default:e}=await import("./gravity-LMEBVSFN-DLxWpxhy.js");return{default:e}},[])).default},$Ft={iconBackground:"#f9f7ec",iconUrl:async()=>(await as(async()=>{const{default:e}=await import("./hardhat-NEEC6JX7-DzuWQYyS.js");return{default:e}},[])).default},UFt={iconBackground:"#000000",iconUrl:async()=>(await as(async()=>{const{default:e}=await import("./hyperevm-J6CONVCX-C6oeYIAP.js");return{default:e}},[])).default},nbe={iconBackground:"#7132F5",iconUrl:async()=>(await as(async()=>{const{default:e}=await import("./ink-4U4ZVNAB-AlM1MLfQ.js");return{default:e}},[])).default},rbe={iconBackground:"transparent",iconUrl:async()=>(await as(async()=>{const{default:e}=await import("./kaia-A33DVQBT-Fgclbhio.js");return{default:e}},[])).default},iW={iconBackground:"#ffffff",iconUrl:async()=>(await as(async()=>{const{default:e}=await import("./linea-IALBSJQC-Cmyd7vgA.js");return{default:e}},[])).default},aW={iconBackground:"#ffffff",iconUrl:async()=>(await as(async()=>{const{default:e}=await import("./manta-5V6W5D7G-BnjsGzeJ.js");return{default:e}},[])).default},sbe={iconBackground:"#000000",iconUrl:async()=>(await as(async()=>{const{default:e}=await import("./mantle-KBL3OIYT-DIpe0poV.js");return{default:e}},[])).default},gP={iconBackground:"#ff5a57",iconUrl:async()=>(await as(async()=>{const{default:e}=await import("./optimism-YWJ3IQHA-DYER-OR5.js");return{default:e}},[])).default},oW={iconBackground:"#9f71ec",iconUrl:async()=>(await as(async()=>{const{default:e}=await import("./polygon-WWEUOMKW-CNBYSB1T.js");return{default:e}},[])).default},zFt={iconBackground:"#1273EA",iconUrl:async()=>(await as(async()=>{const{default:e}=await import("./ronin-PNHX5V6H-BS-WPXjQ.js");return{default:e}},[])).default},HFt={iconBackground:"#000000",iconUrl:async()=>(await as(async()=>{const{default:e}=await import("./sanko-RHQYXGM5-OX010CbN.js");return{default:e}},[])).default},ibe={iconBackground:"#FFEEDA",iconUrl:async()=>(await as(async()=>{const{default:e}=await import("./scroll-MCKFTBRS-C2gqZSab.js");return{default:e}},[])).default},abe={iconBackground:"#F50DB4",iconUrl:async()=>(await as(async()=>{const{default:e}=await import("./unichain-OQ3BZUDH-CyMLDmFg.js");return{default:e}},[])).default},obe={iconBackground:"#f9f7ec",iconUrl:async()=>(await as(async()=>{const{default:e}=await import("./xdc-X7V4QFNF-CSGs0o6M.js");return{default:e}},[])).default},lbe={iconBackground:"#000000",iconUrl:async()=>(await as(async()=>{const{default:e}=await import("./zetachain-BMJKVYBN-IK2CZBr3.js");return{default:e}},[])).default},cbe={iconBackground:"#f9f7ec",iconUrl:async()=>(await as(async()=>{const{default:e}=await import("./zksync-UWUXFL74-Bt0brpXu.js");return{default:e}},[])).default},lW={iconBackground:"#000000",iconUrl:async()=>(await as(async()=>{const{default:e}=await import("./zora-YZH32HP3-CY3tp3EJ.js");return{default:e}},[])).default},VFt={apechain:{chainId:33139,name:"ApeChain",...K1e},apechainCurtis:{chainId:33111,name:"ApeChain Curtis",...K1e},arbitrum:{chainId:42161,name:"Arbitrum",...nW},arbitrumGoerli:{chainId:421613,...nW},arbitrumSepolia:{chainId:421614,...nW},avalanche:{chainId:43114,...Y1e},avalancheFuji:{chainId:43113,...Y1e},base:{chainId:8453,name:"Base",...rW},baseGoerli:{chainId:84531,...rW},baseSepolia:{chainId:84532,...rW},berachain:{chainId:80094,name:"Berachain",...sW},berachainArtio:{chainId:80085,name:"Berachain Artio",...sW},berachainBArtio:{chainId:80084,name:"Berachain bArtio",...sW},blast:{chainId:81457,name:"Blast",...X1e},blastSepolia:{chainId:168587773,...X1e},bsc:{chainId:56,name:"BSC",...Q1e},bscTestnet:{chainId:97,...Q1e},celo:{chainId:42220,name:"Celo",...Z1e},celoAlfajores:{chainId:44787,name:"Celo Alfajores",...Z1e},cronos:{chainId:25,...J1e},cronosTestnet:{chainId:338,...J1e},degen:{chainId:666666666,name:"Degen",...DFt},flow:{chainId:747,...ebe},flowTestnet:{chainId:545,...ebe},gnosis:{chainId:100,name:"Gnosis",...BFt},goerli:{chainId:5,...mb},gravity:{chainId:1625,name:"Gravity",...tbe},gravitySepolia:{chainId:13505,name:"Gravity Sepolia",...tbe},hardhat:{chainId:31337,...$Ft},holesky:{chainId:17e3,...mb},hyperevm:{chainId:999,...UFt},ink:{chainId:57073,...nbe},inkSepolia:{chainId:763373,...nbe},kaia:{chainId:8217,name:"Kaia",...rbe},kairos:{chainId:1001,name:"Kairos",...rbe},kovan:{chainId:42,...mb},linea:{chainId:59144,name:"Linea",...iW},lineaGoerli:{chainId:59140,name:"Linea Goerli",...iW},lineaSepolia:{chainId:59141,name:"Linea Sepolia",...iW},localhost:{chainId:1337,...mb},mainnet:{chainId:1,name:"Ethereum",...mb},manta:{chainId:169,name:"Manta",...aW},mantaSepolia:{chainId:3441006,...aW},mantaTestnet:{chainId:3441005,...aW},mantle:{chainId:5e3,...sbe},mantleTestnet:{chainId:5001,...sbe},optimism:{chainId:10,name:"Optimism",...gP},optimismGoerli:{chainId:420,...gP},optimismKovan:{chainId:69,...gP},optimismSepolia:{chainId:11155420,...gP},polygon:{chainId:137,name:"Polygon",...oW},polygonAmoy:{chainId:80002,...oW},polygonMumbai:{chainId:80001,...oW},rinkeby:{chainId:4,...mb},ronin:{chainId:2020,...zFt},ropsten:{chainId:3,...mb},sanko:{chainId:1996,name:"Sanko",...HFt},scroll:{chainId:534352,...ibe},scrollSepolia:{chainId:534351,...ibe},sepolia:{chainId:11155111,...mb},unichain:{chainId:130,...abe},unichainSepolia:{chainId:1301,...abe},xdc:{chainId:50,name:"XinFin",...obe},xdcTestnet:{chainId:51,...obe},zetachain:{chainId:7e3,name:"ZetaChain",...lbe},zetachainAthensTestnet:{chainId:7001,name:"Zeta Athens",...lbe},zkSync:{chainId:324,name:"zkSync",...cbe},zkSyncTestnet:{chainId:280,...cbe},zora:{chainId:7777777,name:"Zora",...lW},zoraSepolia:{chainId:999999999,...lW},zoraTestnet:{chainId:999,...lW}},WFt=Object.fromEntries(Object.values(VFt).filter(TRe).map(({chainId:e,...t})=>[e,t])),qFt=e=>e.map(t=>{const n=WFt[t.id]??{};return{...t,name:n.name??t.name,iconUrl:t.iconUrl??n.iconUrl,iconBackground:t.iconBackground??n.iconBackground}}),ale=m.createContext({chains:[]});function GFt({children:e,initialChain:t}){const{chains:n}=Al();return Ae.createElement(ale.Provider,{value:m.useMemo(()=>({chains:qFt(n),initialChainId:typeof t=="number"?t:t==null?void 0:t.id}),[n,t])},e)}var UA=()=>m.useContext(ale).chains,KFt=()=>m.useContext(ale).initialChainId,YFt=()=>{const e=UA();return m.useMemo(()=>{const t={};for(const n of e)t[n.id]=n;return t},[e])},IRe=m.createContext({showBalance:void 0,setShowBalance:()=>{}});function XFt({children:e}){const[t,n]=m.useState();return Ae.createElement(IRe.Provider,{value:{showBalance:t,setShowBalance:n}},e)}var QFt=()=>m.useContext(IRe);function ZFt(){const[e,t]=m.useState(!1);return m.useEffect(()=>(t(!0),()=>{t(!1)}),[]),m.useCallback(()=>e,[e])}function PRe(){const e=UA(),t=ZE.id;return e.some(r=>r.id===t)}function JFt(e){const t=PRe(),n=s=>{try{return XIt(s)}catch{}},{data:r}=lgt({chainId:ZE.id,name:e?n(e):void 0,query:{enabled:t}});return r}async function uv(e,t){if(t={headers:{},method:"get",...t,timeout:t.timeout??1e4},!e)throw new Error("rainbowFetch: Missing url argument");const n=new AbortController,r=setTimeout(()=>n.abort(),t.timeout),{body:s,params:a,headers:o,...l}=t,c=s&&typeof s=="object"?JSON.stringify(t.body):t.body,u=await fetch(`${e}${tOt(a)}`,{...l,body:c,headers:{Accept:"application/json","Content-Type":"application/json",...o},signal:n.signal});clearTimeout(r);const d=await eOt(u);if(u.ok){const{headers:g,status:v}=u;return{data:d,headers:g,status:v}}throw nOt({requestBody:s,response:u,responseBody:typeof d=="string"?{error:d}:d})}function eOt(e){const t=e.headers.get("Content-Type");return t!=null&&t.startsWith("application/json")?e.json():e.text()}function tOt(e){return e&&Object.keys(e).length?`?${new URLSearchParams(e)}`:""}function nOt({requestBody:e,response:t,responseBody:n}){const r=(n==null?void 0:n.error)||(t==null?void 0:t.statusText)||"There was an error with the request.",s=new Error(r);return s.response=t,s.responseBody=n,s.requestBody=e,s}var rOt=class{constructor(e={}){const{baseUrl:t="",...n}=e;this.baseUrl=t,this.opts=n}get(e,t){return uv(`${this.baseUrl}${e}`,{...this.opts,...t||{},method:"get"})}delete(e,t){return uv(`${this.baseUrl}${e}`,{...this.opts,...t||{},method:"delete"})}head(e,t){return uv(`${this.baseUrl}${e}`,{...this.opts,...t||{},method:"head"})}options(e,t){return uv(`${this.baseUrl}${e}`,{...this.opts,...t||{},method:"options"})}post(e,t,n){return uv(`${this.baseUrl}${e}`,{...this.opts,...n||{},body:t,method:"post"})}put(e,t,n){return uv(`${this.baseUrl}${e}`,{...this.opts,...n||{},body:t,method:"put"})}patch(e,t,n){return uv(`${this.baseUrl}${e}`,{...this.opts,...n||{},body:t,method:"patch"})}};function sOt({baseUrl:e,headers:t,params:n,timeout:r}){return new rOt({baseUrl:e,headers:t,params:n,timeout:r})}var iOt=!!(typeof process<"u"&&typeof MR<"u"&&MR.RAINBOW_PROVIDER_API_KEY),aOt=sOt({baseUrl:"https://enhanced-provider.rainbow.me",headers:{"x-api-key":typeof process<"u"&&typeof MR<"u"&&MR.RAINBOW_PROVIDER_API_KEY||"LzbasoBiLqltex3VkcQ7LRmL4PtfiiZ1EMJrizrgfonWN6byJReu/l6yrUoo3zLW"}});function oOt(e,t,n={}){return[e,t,n]}function yO(e){return`rk-ens-name-${e}`}function lOt(e){try{const t=e?JSON.parse(e):null;return typeof t=="object"?t:null}catch{return null}}function cOt(e,t){if(!ic(e))return;const n=new Date,r=new Date(n.getTime()+180*6e4);localStorage.setItem(yO(e),JSON.stringify({ensName:t,expires:r.getTime()}))}function uOt(e){const t=lOt(localStorage.getItem(yO(e)));if(!t)return null;const{ensName:n,expires:r}=t;return typeof n!="string"||Number.isNaN(Number(r))||new Date().getTime()>Number(r)?(localStorage.removeItem(yO(e)),null):n}async function dOt({address:e}){const t=uOt(e);if(t)return t;const r=(await aOt.get("/v1/resolve-ens",{params:{address:e}})).data.data;return r&&cOt(e,r),r}function fOt(e){const t=PRe(),{data:n}=cgt({chainId:ZE.id,address:e,query:{enabled:t}}),{data:r}=x_e({queryKey:oOt("address",e),queryFn:()=>dOt({address:e}),enabled:!t&&!!e&&iOt,staleTime:10*(60*1e3),retry:1});return n||r}function FRe({address:e,includeBalance:t}){const n=fOt(e),r=JFt(n),{data:s}=g_e({address:t?e:void 0});return{ensName:n,ensAvatar:r,balance:s}}function ole(){const{chain:e}=ns();return(e==null?void 0:e.id)??null}var ORe="rk-transactions";function hOt(e){try{const t=e?JSON.parse(e):{};return typeof t=="object"?t:{}}catch{return{}}}function ube(){return hOt(typeof localStorage<"u"?localStorage.getItem(ORe):null)}var pOt=/^0x([A-Fa-f0-9]{64})$/;function mOt(e){const t=[];return pOt.test(e.hash)||t.push("Invalid transaction hash"),typeof e.description!="string"&&t.push("Transaction must have a description"),typeof e.confirmations<"u"&&(!Number.isInteger(e.confirmations)||e.confirmations<1)&&t.push("Transaction confirmations must be a positiver integer"),t}function xOt({provider:e}){let t=ube(),n=e;const r=new Set,s=new Set,a=new Map;function o(P){n=P}function l(P,I){var R;return((R=t[P])==null?void 0:R[I])??[]}function c(P,I,R){const F=mOt(R);if(F.length>0)throw new Error(["Unable to add transaction",...F].join(`
`));x(P,I,U=>[{...R,status:"pending"},...U.filter(({hash:L})=>L!==R.hash)])}function u(P,I){x(P,I,()=>[])}function d(P,I,R,F){x(P,I,U=>U.map(L=>L.hash===R?{...L,status:F}:L))}async function f(P,I){await Promise.all(l(P,I).filter(R=>R.status==="pending").map(async R=>{const{confirmations:F,hash:U}=R,L=a.get(U);if(L)return await L;const z=n.waitForTransactionReceipt({confirmations:F,hash:U,timeout:3e5}).then(({status:Q})=>{a.delete(U),Q!==void 0&&(d(P,I,U,Q===0||Q==="reverted"?"failed":"confirmed"),w(Q))}).catch(()=>{d(P,I,U,"failed")});return a.set(U,z),await z}))}function x(P,I,R){t=ube(),t[P]=t[P]??{};let F=0;const U=10,L=R(t[P][I]??[]).filter(({status:z})=>z==="pending"?!0:F++<=U);t[P][I]=L.length>0?L:void 0,g(),v(),f(P,I)}function g(){localStorage.setItem(ORe,JSON.stringify(t))}function v(){for(const P of r)P()}function w(P){for(const I of s)I(P)}function C(P){return r.add(P),()=>{r.delete(P)}}function N(P){return s.add(P),()=>{s.delete(P)}}return{addTransaction:c,clearTransactions:u,getTransactions:l,onTransactionStatus:N,onChange:C,setProvider:o,waitForPendingTransactions:f}}var dbe,MRe=Ae.createContext(null);function gOt({children:e}){const t=b_e(),{address:n}=ns(),r=ole(),{refetch:s}=g_e({address:n,query:{enabled:!1}}),[a]=Ae.useState(()=>dbe??(dbe=xOt({provider:t}))),o=Ae.useCallback(l=>{l==="success"&&s()},[s]);return Ae.useEffect(()=>{a.setProvider(t)},[a,t]),Ae.useEffect(()=>{n&&r&&a.waitForPendingTransactions(n,r)},[a,n,r]),Ae.useEffect(()=>{if(a&&n&&r)return a.onTransactionStatus(o)},[a,n,r,o]),Ae.createElement(MRe.Provider,{value:a},e)}function RRe(){const e=Ae.useContext(MRe);if(!e)throw new Error("Transaction hooks must be used within RainbowKitProvider");return e}function LRe(){const e=RRe(),{address:t}=ns(),n=ole(),[r,s]=m.useState(()=>e&&t&&n?e.getTransactions(t,n):[]);return m.useEffect(()=>{if(e&&t&&n)return s(e.getTransactions(t,n)),e.onChange(()=>{s(e.getTransactions(t,n))})},[e,t,n]),r}var fbe=e=>typeof e=="function"?e():e;function bOt(e,{extends:t}={}){const n={...p1e(V1e,fbe(e))};if(!t)return n;const r=p1e(V1e,fbe(t));return Object.fromEntries(Object.entries(n).filter(([a,o])=>o!==r[a]))}function hbe(e,t={}){return Object.entries(bOt(e,t)).map(([n,r])=>`${n}:${r.replace(/[:;{}</>]/g,"")};`).join("")}var DRe={appName:void 0,disclaimer:void 0,learnMoreUrl:"https://learn.rainbow.me/understanding-web3?utm_source=rainbowkit&utm_campaign=learnmore"},iT=m.createContext(DRe),BRe=m.createContext(!1);function yOt(e,t){let n;return()=>{n&&clearTimeout(n),n=setTimeout(()=>{n=null,e()},t)}}var $Re=()=>{const[e,t]=m.useState({height:void 0,width:void 0});return m.useEffect(()=>{const n=yOt(()=>{t({height:window.innerHeight,width:window.innerWidth})},500);return window.addEventListener("resize",n),n(),()=>window.removeEventListener("resize",n)},[]),e},aT=m.createContext({connector:null,setConnector:()=>{}});function vOt({children:e}){const[t,n]=m.useState(null);return Ae.createElement(aT.Provider,{value:m.useMemo(()=>({connector:t,setConnector:n}),[t])},e)}var oT={COMPACT:"compact",WIDE:"wide"},E$=m.createContext(oT.WIDE);function wOt({children:e,modalSize:t}){const{width:n}=$Re(),r=n&&n<mFt,{connector:s}=m.useContext(aT);return Ae.createElement(E$.Provider,{value:r||s?oT.COMPACT:t},e)}var lle=m.createContext(!1),COt="rk-version";function SOt({version:e}){localStorage.setItem(COt,e)}function NOt(){const e=m.useCallback(()=>{SOt({version:"2.2.4"})},[]);m.useEffect(()=>{e()},[e])}function AOt(e,t){const n={};for(const r of e){const s=t(r);s&&(n[s]=r)}return n}function cle(){return typeof navigator<"u"&&typeof navigator.userAgent<"u"&&/Version\/([0-9._]+).*Safari/.test(navigator.userAgent)}function jOt(){return typeof document<"u"&&getComputedStyle(document.body).getPropertyValue("--arc-palette-focus")!==""}function ule(){var t,n;if(typeof navigator>"u")return"Browser";const e=(t=navigator.userAgent)==null?void 0:t.toLowerCase();return(n=navigator.brave)!=null&&n.isBrave?"Brave":(e==null?void 0:e.indexOf("edg/"))>-1?"Edge":(e==null?void 0:e.indexOf("op"))>-1?"Opera":jOt()?"Arc":(e==null?void 0:e.indexOf("chrome"))>-1?"Chrome":(e==null?void 0:e.indexOf("firefox"))>-1?"Firefox":cle()?"Safari":"Browser"}var EOt=HPt.UAParser(),{os:dle}=EOt;function _Ot(){return dle.name==="Windows"}function kOt(){return dle.name==="Mac OS"}function TOt(){return["Ubuntu","Mint","Fedora","Debian","Arch","Linux"].includes(dle.name)}function fle(){return _Ot()?"Windows":kOt()?"macOS":TOt()?"Linux":"Desktop"}var IOt=e=>{var n,r,s,a,o,l,c,u,d,f,x;const t=ule();return{Arc:(n=e==null?void 0:e.downloadUrls)==null?void 0:n.chrome,Brave:(r=e==null?void 0:e.downloadUrls)==null?void 0:r.chrome,Chrome:(s=e==null?void 0:e.downloadUrls)==null?void 0:s.chrome,Edge:((a=e==null?void 0:e.downloadUrls)==null?void 0:a.edge)||((o=e==null?void 0:e.downloadUrls)==null?void 0:o.chrome),Firefox:(l=e==null?void 0:e.downloadUrls)==null?void 0:l.firefox,Opera:((c=e==null?void 0:e.downloadUrls)==null?void 0:c.opera)||((u=e==null?void 0:e.downloadUrls)==null?void 0:u.chrome),Safari:(d=e==null?void 0:e.downloadUrls)==null?void 0:d.safari,Browser:(f=e==null?void 0:e.downloadUrls)==null?void 0:f.browserExtension}[t]??((x=e==null?void 0:e.downloadUrls)==null?void 0:x.browserExtension)},POt=e=>{var n,r,s;return(b5()?(n=e==null?void 0:e.downloadUrls)==null?void 0:n.ios:(r=e==null?void 0:e.downloadUrls)==null?void 0:r.android)??((s=e==null?void 0:e.downloadUrls)==null?void 0:s.mobile)},FOt=e=>{var n,r,s,a,o;const t=fle();return{Windows:(n=e==null?void 0:e.downloadUrls)==null?void 0:n.windows,macOS:(r=e==null?void 0:e.downloadUrls)==null?void 0:r.macos,Linux:(s=e==null?void 0:e.downloadUrls)==null?void 0:s.linux,Desktop:(a=e==null?void 0:e.downloadUrls)==null?void 0:a.desktop}[t]??((o=e==null?void 0:e.downloadUrls)==null?void 0:o.desktop)},URe=(e,t)=>e.some(n=>n.id===t),OOt=e=>!!e.isRainbowKitConnector,pbe=e=>{var t;return!!(!e.isRainbowKitConnector&&((t=e.icon)!=null&&t.replace(/\n/g,"").startsWith("data:image"))&&e.uid&&e.name)},MOt=(e,t)=>e.id==="walletConnect"&&t?{...e,walletConnectModalConnector:t}:e,ROt=({wallets:e,recentWallets:t})=>[...t,...e.filter(n=>!URe(t,n.id))],zRe="rk-recent";function LOt(e){try{const t=e?JSON.parse(e):[];return Array.isArray(t)?t:[]}catch{return[]}}function HRe(){return typeof localStorage<"u"?LOt(localStorage.getItem(zRe)):[]}function DOt(e){return[...new Set(e)]}function BOt(e){const t=DOt([e,...HRe()]);localStorage.setItem(zRe,JSON.stringify(t))}function e_(e=!1){var R,F,U;const t=UA(),n=KFt(),{connectAsync:r,connectors:s}=agt(),a=s,{setIsWalletConnectModalOpen:o}=pLe(),l=a.map(L=>({...L,...L.rkDetails||{}}));async function c(L){var ne,J;const z=await L.getChainId(),Q=await r({chainId:n??((ne=t.find(({id:X})=>X===z))==null?void 0:ne.id)??((J=t[0])==null?void 0:J.id),connector:L});return Q&&BOt(L.id),Q}async function u(L){try{o(!0),await c(L),o(!1)}catch(z){const Q=z.name==="UserRejectedRequestError"||z.message==="Connection request reset. Please try again.";if(o(!1),!Q)throw z}}const d=async(L,z)=>{const Q=await L.getProvider();return L.id==="coinbase"?Q.qrUrl:new Promise(ne=>Q.once("display_uri",J=>{ne(z(J))}))},f=l.find(L=>L.id==="walletConnect"&&L.isWalletConnectModalConnector),x=l.filter(pbe).map(L=>({...L,groupIndex:0})),g=l.filter(OOt).filter(L=>!L.isWalletConnectModalConnector).filter(L=>e?!x.some(Q=>Q.id===L.rdns):!0).map(L=>MOt(L,f)),v=[...x,...g],w=AOt(v,L=>L.id),N=HRe().map(L=>w[L]).filter(Boolean).slice(0,3),P=[],I=ROt({wallets:v,recentWallets:N});for(const L of I){if(!L)continue;const z=pbe(L),Q=URe(N,L.id);if(z){P.push({...L,iconUrl:L.icon,ready:!0,connect:()=>c(L),groupName:"Installed",recent:Q});continue}P.push({...L,ready:L.installed??!0,connect:()=>c(L),desktopDownloadUrl:FOt(L),extensionDownloadUrl:IOt(L),groupName:L.groupName,mobileDownloadUrl:POt(L),getQrCodeUri:(R=L.qrCode)!=null&&R.getUri?()=>d(L,L.qrCode.getUri):void 0,getDesktopUri:(F=L.desktop)!=null&&F.getUri?()=>d(L,L.desktop.getUri):void 0,getMobileUri:(U=L.mobile)!=null&&U.getUri?()=>{var ne;return d(L,(ne=L.mobile)==null?void 0:ne.getUri)}:void 0,recent:Q,showWalletConnectModal:L.walletConnectModalConnector?()=>u(L.walletConnectModalConnector):void 0})}return P}var VRe=async()=>(await as(async()=>{const{default:e}=await import("./assets-NU2OP443-COMs-Mo6.js");return{default:e}},[])).default,$Ot=()=>sx(VRe),UOt=()=>Ae.createElement(Pc,{background:"#d0d5de",borderRadius:"10",height:"48",src:VRe,width:"48"}),WRe=async()=>(await as(async()=>{const{default:e}=await import("./login-CWDTIDNK-DhDUYE4b.js");return{default:e}},[])).default,zOt=()=>sx(WRe),HOt=()=>Ae.createElement(Pc,{background:"#d0d5de",borderRadius:"10",height:"48",src:WRe,width:"48"}),Os=Ae.forwardRef(({as:e="div",children:t,className:n,color:r,display:s,font:a="body",id:o,size:l="16",style:c,tabIndex:u,textAlign:d="inherit",weight:f="regular",testId:x},g)=>Ae.createElement(wn,{as:e,className:n,color:r,display:s,fontFamily:a,fontSize:l,fontWeight:f,id:o,ref:g,style:c,tabIndex:u,textAlign:d,testId:x},t));Os.displayName="Text";var VOt={large:{fontSize:"16",paddingX:"24",paddingY:"10"},medium:{fontSize:"14",height:"28",paddingX:"12",paddingY:"4"},small:{fontSize:"14",paddingX:"10",paddingY:"5"}};function hd({disabled:e=!1,href:t,label:n,onClick:r,rel:s="noreferrer noopener",size:a="medium",target:o="_blank",testId:l,type:c="primary"}){const u=c==="primary",d=a!=="large",f=ou(),x=e?"actionButtonSecondaryBackground":u?"accentColor":d?"actionButtonSecondaryBackground":null,{fontSize:g,height:v,paddingX:w,paddingY:C}=VOt[a],N=!f||!d;return Ae.createElement(wn,{...t?e?{}:{as:"a",href:t,rel:s,target:o}:{as:"button",type:"button"},onClick:e?void 0:r,...N?{borderColor:f&&!d&&!u?"actionButtonBorderMobile":"actionButtonBorder",borderStyle:"solid",borderWidth:"1"}:{},borderRadius:"actionButton",className:!e&&iu({active:"shrinkSm",hover:"grow"}),display:"block",paddingX:w,paddingY:C,style:{willChange:"transform"},testId:l,textAlign:"center",transition:"transform",...x?{background:x}:{},...v?{height:v}:{}},Ae.createElement(Os,{color:e?"modalTextSecondary":u?"accentColorForeground":"accentColor",size:g,weight:"bold"},n))}var WOt=()=>ou()?Ae.createElement("svg",{"aria-hidden":!0,fill:"none",height:"11.5",viewBox:"0 0 11.5 11.5",width:"11.5",xmlns:"http://www.w3.org/2000/svg"},Ae.createElement("title",null,"Close"),Ae.createElement("path",{d:"M2.13388 0.366117C1.64573 -0.122039 0.854272 -0.122039 0.366117 0.366117C-0.122039 0.854272 -0.122039 1.64573 0.366117 2.13388L3.98223 5.75L0.366117 9.36612C-0.122039 9.85427 -0.122039 10.6457 0.366117 11.1339C0.854272 11.622 1.64573 11.622 2.13388 11.1339L5.75 7.51777L9.36612 11.1339C9.85427 11.622 10.6457 11.622 11.1339 11.1339C11.622 10.6457 11.622 9.85427 11.1339 9.36612L7.51777 5.75L11.1339 2.13388C11.622 1.64573 11.622 0.854272 11.1339 0.366117C10.6457 -0.122039 9.85427 -0.122039 9.36612 0.366117L5.75 3.98223L2.13388 0.366117Z",fill:"currentColor"})):Ae.createElement("svg",{"aria-hidden":!0,fill:"none",height:"10",viewBox:"0 0 10 10",width:"10",xmlns:"http://www.w3.org/2000/svg"},Ae.createElement("title",null,"Close"),Ae.createElement("path",{d:"M1.70711 0.292893C1.31658 -0.0976311 0.683417 -0.0976311 0.292893 0.292893C-0.0976311 0.683417 -0.0976311 1.31658 0.292893 1.70711L3.58579 5L0.292893 8.29289C-0.0976311 8.68342 -0.0976311 9.31658 0.292893 9.70711C0.683417 10.0976 1.31658 10.0976 1.70711 9.70711L5 6.41421L8.29289 9.70711C8.68342 10.0976 9.31658 10.0976 9.70711 9.70711C10.0976 9.31658 10.0976 8.68342 9.70711 8.29289L6.41421 5L9.70711 1.70711C10.0976 1.31658 10.0976 0.683417 9.70711 0.292893C9.31658 -0.0976311 8.68342 -0.0976311 8.29289 0.292893L5 3.58579L1.70711 0.292893Z",fill:"currentColor"})),W3=({"aria-label":e="Close",onClose:t})=>{const n=ou();return Ae.createElement(wn,{alignItems:"center","aria-label":e,as:"button",background:"closeButtonBackground",borderColor:"actionButtonBorder",borderRadius:"full",borderStyle:"solid",borderWidth:n?"0":"1",className:iu({active:"shrinkSm",hover:"growLg"}),color:"closeButton",display:"flex",height:n?"30":"28",justifyContent:"center",onClick:t,style:{willChange:"transform"},transition:"default",type:"button",width:n?"30":"28"},Ae.createElement(WOt,null))},qRe=async()=>(await as(async()=>{const{default:e}=await import("./sign-A7IJEUT5-CGsRnPrd.js");return{default:e}},[])).default;function qOt({onClose:e,onCloseModal:t}){const{i18n:n}=m.useContext(cc),[{status:r,...s},a]=Ae.useState({status:"idle"}),o=vFt(),l=m.useCallback(async()=>{try{const v=await o.getNonce();a(w=>({...w,nonce:v}))}catch{a(v=>({...v,errorMessage:n.t("sign_in.message.preparing_error"),status:"idle"}))}},[o,n.t]),c=m.useRef(!1);Ae.useEffect(()=>{c.current||(c.current=!0,l())},[l]);const u=ou(),{address:d,chain:f}=ns(),{signMessageAsync:x}=y_e(),g=async()=>{try{const v=f==null?void 0:f.id,{nonce:w}=s;if(!d||!v||!w)return;a(P=>({...P,errorMessage:void 0,status:"signing"}));const C=o.createMessage({address:d,chainId:v,nonce:w});let N;try{N=await x({message:C})}catch(P){return P instanceof bo?a(I=>({...I,status:"idle"})):a(I=>({...I,errorMessage:n.t("sign_in.signature.signing_error"),status:"idle"}))}a(P=>({...P,status:"verifying"}));try{if(await o.verify({message:C,signature:N})){t();return}throw new Error}catch{return a(P=>({...P,errorMessage:n.t("sign_in.signature.verifying_error"),status:"idle"}))}}catch{a({errorMessage:n.t("sign_in.signature.oops_error"),status:"idle"})}};return Ae.createElement(wn,{position:"relative"},Ae.createElement(wn,{display:"flex",paddingRight:"16",paddingTop:"16",position:"absolute",right:"0"},Ae.createElement(W3,{onClose:e})),Ae.createElement(wn,{alignItems:"center",display:"flex",flexDirection:"column",gap:u?"32":"24",padding:"24",paddingX:"18",style:{paddingTop:u?"60px":"36px"}},Ae.createElement(wn,{alignItems:"center",display:"flex",flexDirection:"column",gap:u?"6":"4",style:{maxWidth:u?320:280}},Ae.createElement(wn,{alignItems:"center",display:"flex",flexDirection:"column",gap:u?"32":"16"},Ae.createElement(Pc,{height:40,src:qRe,width:40}),Ae.createElement(Os,{color:"modalText",size:u?"20":"18",textAlign:"center",weight:"heavy"},n.t("sign_in.label"))),Ae.createElement(wn,{alignItems:"center",display:"flex",flexDirection:"column",gap:u?"16":"12"},Ae.createElement(Os,{color:"modalTextSecondary",size:u?"16":"14",textAlign:"center"},n.t("sign_in.description")),r==="idle"&&s.errorMessage?Ae.createElement(Os,{color:"error",size:u?"16":"14",textAlign:"center",weight:"bold"},s.errorMessage):null)),Ae.createElement(wn,{alignItems:u?void 0:"center",display:"flex",flexDirection:"column",gap:"8",width:"full"},Ae.createElement(hd,{disabled:!s.nonce||r==="signing"||r==="verifying",label:s.nonce?r==="signing"?n.t("sign_in.signature.waiting"):r==="verifying"?n.t("sign_in.signature.verifying"):n.t("sign_in.message.send"):n.t("sign_in.message.preparing"),onClick:g,size:u?"large":"medium",testId:"auth-message-button"}),u?Ae.createElement(hd,{label:"Cancel",onClick:e,size:"large",type:"secondary"}):Ae.createElement(wn,{as:"button",borderRadius:"full",className:iu({active:"shrink",hover:"grow"}),display:"block",onClick:e,paddingX:"10",paddingY:"5",rel:"noreferrer",style:{willChange:"transform"},target:"_blank",transition:"default"},Ae.createElement(Os,{color:"closeButton",size:u?"16":"14",weight:"bold"},n.t("sign_in.message.cancel"))))))}function GOt(){const e=UA(),t=e_(),n=j$()==="unauthenticated",r=m.useCallback(()=>{sx(...t.map(s=>s.iconUrl),...e.map(s=>s.iconUrl).filter(TRe)),ou()||($Ot(),zOt()),n&&sx(qRe)},[t,e,n]);m.useEffect(()=>{r()},[r])}var GRe="WALLETCONNECT_DEEPLINK_CHOICE";function KOt({mobileUri:e,name:t}){localStorage.setItem(GRe,JSON.stringify({href:e.split("?")[0],name:t}))}function YOt(){localStorage.removeItem(GRe)}var KRe=m.createContext(void 0),ete="data-rk",YRe=e=>({[ete]:e||""}),XOt=e=>{if(e&&!/^[a-zA-Z0-9_]+$/.test(e))throw new Error(`Invalid ID: ${e}`);return e?`[${ete}="${e}"]`:`[${ete}]`},QOt=()=>{const e=m.useContext(KRe);return YRe(e)},ZOt=dMe();function JOt({appInfo:e,avatar:t,children:n,coolMode:r=!1,id:s,initialChain:a,locale:o,modalSize:l=oT.WIDE,showRecentTransactions:c=!1,theme:u=ZOt}){if(GOt(),NOt(),n_e({onDisconnect:YOt}),typeof u=="function")throw new Error('A theme function was provided to the "theme" prop instead of a theme object. You must execute this function to get the resulting theme object.');const d=XOt(s),f={...DRe,...e},x=t??_Re;return Ae.createElement(GFt,{initialChain:a},Ae.createElement(vOt,null,Ae.createElement(LFt,{locale:o},Ae.createElement(BRe.Provider,{value:r},Ae.createElement(wOt,{modalSize:l},Ae.createElement(lle.Provider,{value:c},Ae.createElement(gOt,null,Ae.createElement(kRe.Provider,{value:x},Ae.createElement(iT.Provider,{value:f},Ae.createElement(KRe.Provider,{value:s},Ae.createElement(XFt,null,Ae.createElement(pRt,null,u?Ae.createElement("div",{...YRe(s)},Ae.createElement("style",{dangerouslySetInnerHTML:{__html:[`${d}{${hbe("lightMode"in u?u.lightMode:u)}}`,"darkMode"in u?`@media(prefers-color-scheme:dark){${d}{${hbe(u.darkMode,{extends:u.lightMode})}}}`:null].join("")}}),n):n))))))))))))}var eMt="_9pm4ki5 ju367va ju367v15 ju367v8r",tMt="_9pm4ki3 ju367v9h ju367vb3 ju367va ju367v2q ju367v8q",mbe=(e,t)=>{const n=e.querySelectorAll("button:not(:disabled), a[href]");n.length!==0&&n[t==="end"?n.length-1:0].focus()};function nMt(e){const t=m.useRef(null);return m.useEffect(()=>{const n=document.activeElement;return()=>{var r;(r=n.focus)==null||r.call(n)}},[]),m.useEffect(()=>{if(t.current){const n=t.current.querySelector("[data-auto-focus]");n?n.focus():t.current.focus()}},[]),Ae.createElement(Ae.Fragment,null,Ae.createElement("div",{onFocus:m.useCallback(()=>t.current&&mbe(t.current,"end"),[]),tabIndex:0}),Ae.createElement("div",{ref:t,style:{outline:"none"},tabIndex:-1,...e}),Ae.createElement("div",{onFocus:m.useCallback(()=>t.current&&mbe(t.current,"start"),[]),tabIndex:0}))}var rMt=e=>e.stopPropagation();function RR({children:e,onClose:t,open:n,titleId:r}){m.useEffect(()=>{const u=d=>n&&d.key==="Escape"&&t();return document.addEventListener("keydown",u),()=>document.removeEventListener("keydown",u)},[n,t]);const[s,a]=m.useState(!0);m.useEffect(()=>{a(getComputedStyle(window.document.body).overflow!=="hidden")},[]);const o=m.useCallback(()=>t(),[t]),l=QOt(),c=ou();return Ae.createElement(Ae.Fragment,null,n?Na.createPortal(Ae.createElement(bRe,{enabled:s},Ae.createElement(wn,{...l},Ae.createElement(wn,{...l,alignItems:c?"flex-end":"center","aria-labelledby":r,"aria-modal":!0,className:tMt,onClick:o,position:"fixed",role:"dialog"},Ae.createElement(nMt,{className:eMt,onClick:rMt,role:"document"},e)))),document.body):null)}var sMt="_1ckjpok7",iMt="_1ckjpok1 ju367vb6 ju367vdr ju367vp ju367vt ju367vv ju367vel ju367va ju367v15 ju367v6c ju367v8r",aMt="_1ckjpok4 _1ckjpok1 ju367vb6 ju367vdr ju367vp ju367vt ju367vv ju367vel ju367va ju367v15 ju367v6c ju367v8r",oMt="_1ckjpok6 ju367vq",lMt="_1ckjpok3 _1ckjpok1 ju367vb6 ju367vdr ju367vp ju367vt ju367vv ju367vel ju367va ju367v15 ju367v6c ju367v8r",cMt="_1ckjpok2 _1ckjpok1 ju367vb6 ju367vdr ju367vp ju367vt ju367vv ju367vel ju367va ju367v15 ju367v6c ju367v8r";function LR({bottomSheetOnMobile:e=!1,children:t,marginTop:n,padding:r="16",paddingBottom:s,wide:a=!1}){const o=ou(),c=m.useContext(E$)===oT.COMPACT;return Ae.createElement(wn,{marginTop:n},Ae.createElement(wn,{className:[a?o?cMt:c?aMt:lMt:iMt,o?oMt:null,o&&e?sMt:null].join(" ")},Ae.createElement(wn,{padding:r,paddingBottom:s??r},t)))}var xbe=["k","m","b","t"];function bP(e,t=1){return e.toString().replace(new RegExp(`(.+\\.\\d{${t}})\\d+`),"$1").replace(/(\.[1-9]*)0+$/,"$1").replace(/\.$/,"")}function XRe(e){if(e<1)return bP(e,3);if(e<10**2)return bP(e,2);if(e<10**4)return new Intl.NumberFormat().format(Number.parseFloat(bP(e,1)));const t=10**1;let n=String(e);for(let r=xbe.length-1;r>=0;r--){const s=10**((r+1)*3);if(s<=e){e=e*t/s/t,n=bP(e,1)+xbe[r];break}}return n}function QRe(e){return e.length<8?e:`${e.substring(0,4)}…${e.substring(e.length-4)}`}function ZRe(e){if(!e)return"";const t=e.split("."),n=t.pop();return t.join(".").length>24?`${t.join(".").substring(0,24)}...`:`${t.join(".")}.${n}`}var uMt=()=>Ae.createElement("svg",{fill:"none",height:"13",viewBox:"0 0 13 13",width:"13",xmlns:"http://www.w3.org/2000/svg"},Ae.createElement("title",null,"Copied"),Ae.createElement("path",{d:"M4.94568 12.2646C5.41052 12.2646 5.77283 12.0869 6.01892 11.7109L12.39 1.96973C12.5677 1.69629 12.6429 1.44336 12.6429 1.2041C12.6429 0.561523 12.1644 0.0966797 11.5082 0.0966797C11.057 0.0966797 10.7767 0.260742 10.5033 0.691406L4.9115 9.50977L2.07458 5.98926C1.82166 5.68848 1.54822 5.55176 1.16541 5.55176C0.502319 5.55176 0.0238037 6.02344 0.0238037 6.66602C0.0238037 6.95312 0.112671 7.20605 0.358765 7.48633L3.88611 11.7588C4.18005 12.1074 4.50818 12.2646 4.94568 12.2646Z",fill:"currentColor"})),dMt=()=>Ae.createElement("svg",{fill:"none",height:"16",viewBox:"0 0 17 16",width:"17",xmlns:"http://www.w3.org/2000/svg"},Ae.createElement("title",null,"Copy"),Ae.createElement("path",{d:"M3.04236 12.3027H4.18396V13.3008C4.18396 14.8525 5.03845 15.7002 6.59705 15.7002H13.6244C15.183 15.7002 16.0375 14.8525 16.0375 13.3008V6.24609C16.0375 4.69434 15.183 3.84668 13.6244 3.84668H12.4828V2.8418C12.4828 1.29688 11.6283 0.442383 10.0697 0.442383H3.04236C1.48376 0.442383 0.629272 1.29004 0.629272 2.8418V9.90332C0.629272 11.4551 1.48376 12.3027 3.04236 12.3027ZM3.23376 10.5391C2.68689 10.5391 2.39294 10.2656 2.39294 9.68457V3.06055C2.39294 2.47949 2.68689 2.21289 3.23376 2.21289H9.8783C10.4252 2.21289 10.7191 2.47949 10.7191 3.06055V3.84668H6.59705C5.03845 3.84668 4.18396 4.69434 4.18396 6.24609V10.5391H3.23376ZM6.78845 13.9365C6.24158 13.9365 5.94763 13.6699 5.94763 13.0889V6.45801C5.94763 5.87695 6.24158 5.61035 6.78845 5.61035H13.433C13.9799 5.61035 14.2738 5.87695 14.2738 6.45801V13.0889C14.2738 13.6699 13.9799 13.9365 13.433 13.9365H6.78845Z",fill:"currentColor"})),fMt=()=>Ae.createElement("svg",{fill:"none",height:"16",viewBox:"0 0 18 16",width:"18",xmlns:"http://www.w3.org/2000/svg"},Ae.createElement("title",null,"Disconnect"),Ae.createElement("path",{d:"M2.67834 15.5908H9.99963C11.5514 15.5908 12.399 14.7432 12.399 13.1777V10.2656H10.6354V12.9863C10.6354 13.5332 10.3688 13.8271 9.78772 13.8271H2.89026C2.3092 13.8271 2.0426 13.5332 2.0426 12.9863V3.15625C2.0426 2.60254 2.3092 2.30859 2.89026 2.30859H9.78772C10.3688 2.30859 10.6354 2.60254 10.6354 3.15625V5.89746H12.399V2.95801C12.399 1.39941 11.5514 0.544922 9.99963 0.544922H2.67834C1.12659 0.544922 0.278931 1.39941 0.278931 2.95801V13.1777C0.278931 14.7432 1.12659 15.5908 2.67834 15.5908ZM7.43616 8.85059H14.0875L15.0924 8.78906L14.566 9.14453L13.6842 9.96484C13.5406 10.1016 13.4586 10.2861 13.4586 10.4844C13.4586 10.8398 13.7321 11.168 14.1217 11.168C14.3199 11.168 14.4635 11.0928 14.6002 10.9561L16.7809 8.68652C16.986 8.48145 17.0543 8.27637 17.0543 8.06445C17.0543 7.85254 16.986 7.64746 16.7809 7.43555L14.6002 5.17285C14.4635 5.03613 14.3199 4.9541 14.1217 4.9541C13.7321 4.9541 13.4586 5.27539 13.4586 5.6377C13.4586 5.83594 13.5406 6.02734 13.6842 6.15723L14.566 6.98438L15.0924 7.33984L14.0875 7.27148H7.43616C7.01917 7.27148 6.65686 7.62012 6.65686 8.06445C6.65686 8.50195 7.01917 8.85059 7.43616 8.85059Z",fill:"currentColor"}));function hMt(){const e=RRe(),{address:t}=ns(),n=ole();return m.useCallback(()=>{if(!t||!n)throw new Error("No address or chain ID found");e.clearTransactions(t,n)},[e,t,n])}var JRe=e=>{var t,n;return(n=(t=e==null?void 0:e.blockExplorers)==null?void 0:t.default)==null?void 0:n.url},eLe=()=>Ae.createElement("svg",{fill:"none",height:"19",viewBox:"0 0 20 19",width:"20",xmlns:"http://www.w3.org/2000/svg"},Ae.createElement("title",null,"Link"),Ae.createElement("path",{d:"M10 18.9443C15.0977 18.9443 19.2812 14.752 19.2812 9.6543C19.2812 4.56543 15.0889 0.373047 10 0.373047C4.90234 0.373047 0.71875 4.56543 0.71875 9.6543C0.71875 14.752 4.91113 18.9443 10 18.9443ZM10 16.6328C6.1416 16.6328 3.03906 13.5215 3.03906 9.6543C3.03906 5.7959 6.13281 2.68457 10 2.68457C13.8584 2.68457 16.9697 5.7959 16.9697 9.6543C16.9785 13.5215 13.8672 16.6328 10 16.6328ZM12.7158 12.1416C13.2432 12.1416 13.5684 11.7549 13.5684 11.1836V7.19336C13.5684 6.44629 13.1377 6.05957 12.417 6.05957H8.40918C7.8291 6.05957 7.45117 6.38477 7.45117 6.91211C7.45117 7.43945 7.8291 7.77344 8.40918 7.77344H9.69238L10.7207 7.63281L9.53418 8.67871L6.73047 11.4912C6.53711 11.6758 6.41406 11.9395 6.41406 12.2031C6.41406 12.7832 6.85352 13.1699 7.39844 13.1699C7.68848 13.1699 7.92578 13.0732 8.1543 12.8623L10.9316 10.0762L11.9775 8.89844L11.8545 9.98828V11.1836C11.8545 11.7725 12.1885 12.1416 12.7158 12.1416Z",fill:"currentColor"})),pMt=()=>Ae.createElement("svg",{fill:"none",height:"19",viewBox:"0 0 20 19",width:"20",xmlns:"http://www.w3.org/2000/svg"},Ae.createElement("title",null,"Cancel"),Ae.createElement("path",{d:"M10 18.9443C15.0977 18.9443 19.2812 14.752 19.2812 9.6543C19.2812 4.56543 15.0889 0.373047 10 0.373047C4.90234 0.373047 0.71875 4.56543 0.71875 9.6543C0.71875 14.752 4.91113 18.9443 10 18.9443ZM10 16.6328C6.1416 16.6328 3.03906 13.5215 3.03906 9.6543C3.03906 5.7959 6.13281 2.68457 10 2.68457C13.8584 2.68457 16.9697 5.7959 16.9697 9.6543C16.9785 13.5215 13.8672 16.6328 10 16.6328ZM7.29297 13.3018C7.58301 13.3018 7.81152 13.2139 7.99609 13.0205L10 11.0166L12.0127 13.0205C12.1973 13.2051 12.4258 13.3018 12.707 13.3018C13.2432 13.3018 13.6562 12.8887 13.6562 12.3525C13.6562 12.0977 13.5508 11.8691 13.3662 11.6934L11.3535 9.67188L13.375 7.6416C13.5596 7.44824 13.6562 7.22852 13.6562 6.98242C13.6562 6.44629 13.2432 6.0332 12.7158 6.0332C12.4346 6.0332 12.2148 6.12109 12.0215 6.31445L10 8.32715L7.9873 6.32324C7.80273 6.12988 7.58301 6.04199 7.29297 6.04199C6.76562 6.04199 6.35254 6.45508 6.35254 6.99121C6.35254 7.2373 6.44922 7.46582 6.63379 7.6416L8.65527 9.67188L6.63379 11.6934C6.44922 11.8691 6.35254 12.1064 6.35254 12.3525C6.35254 12.8887 6.76562 13.3018 7.29297 13.3018Z",fill:"currentColor"})),mMt=()=>Ae.createElement("svg",{fill:"none",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg"},Ae.createElement("title",null,"Success"),Ae.createElement("path",{d:"M10 19.4443C15.0977 19.4443 19.2812 15.252 19.2812 10.1543C19.2812 5.06543 15.0889 0.873047 10 0.873047C4.90234 0.873047 0.71875 5.06543 0.71875 10.1543C0.71875 15.252 4.91113 19.4443 10 19.4443ZM10 17.1328C6.1416 17.1328 3.03906 14.0215 3.03906 10.1543C3.03906 6.2959 6.13281 3.18457 10 3.18457C13.8584 3.18457 16.9697 6.2959 16.9697 10.1543C16.9785 14.0215 13.8672 17.1328 10 17.1328ZM9.07715 14.3379C9.4375 14.3379 9.7627 14.1533 9.97363 13.8369L13.7441 8.00977C13.8848 7.79883 13.9814 7.5791 13.9814 7.36816C13.9814 6.84961 13.5244 6.48926 13.0322 6.48926C12.707 6.48926 12.4258 6.66504 12.2148 7.0166L9.05957 12.0967L7.5918 10.2949C7.37207 10.0225 7.13477 9.9082 6.84473 9.9082C6.33496 9.9082 5.92188 10.3125 5.92188 10.8223C5.92188 11.0684 6.00098 11.2793 6.18555 11.5078L8.1543 13.8545C8.40918 14.1709 8.70801 14.3379 9.07715 14.3379Z",fill:"currentColor"})),xMt=e=>{switch(e){case"pending":return JE;case"confirmed":return mMt;case"failed":return pMt;default:return JE}};function gMt({tx:e}){const t=ou(),n=xMt(e.status),r=e.status==="failed"?"error":"accentColor",{chain:s}=ns(),a=e.status==="confirmed"?"Confirmed":e.status==="failed"?"Failed":"Pending",o=JRe(s);return Ae.createElement(Ae.Fragment,null,Ae.createElement(wn,{...o?{as:"a",background:{hover:"profileForeground"},borderRadius:"menuButton",className:iu({active:"shrink"}),href:`${o}/tx/${e.hash}`,rel:"noreferrer noopener",target:"_blank",transition:"default"}:{},color:"modalText",display:"flex",flexDirection:"row",justifyContent:"space-between",padding:"8",width:"full"},Ae.createElement(wn,{alignItems:"center",display:"flex",flexDirection:"row",gap:t?"16":"14"},Ae.createElement(wn,{color:r},Ae.createElement(n,null)),Ae.createElement(wn,{display:"flex",flexDirection:"column",gap:t?"3":"1"},Ae.createElement(wn,null,Ae.createElement(Os,{color:"modalText",font:"body",size:t?"16":"14",weight:"bold"},e==null?void 0:e.description)),Ae.createElement(wn,null,Ae.createElement(Os,{color:e.status==="pending"?"modalTextSecondary":r,font:"body",size:"14",weight:t?"medium":"regular"},a)))),o&&Ae.createElement(wn,{alignItems:"center",color:"modalTextDim",display:"flex"},Ae.createElement(eLe,null))))}var bMt=3;function yMt({address:e}){const t=LRe(),n=hMt(),{chain:r}=ns(),s=JRe(r),a=t.slice(0,bMt),o=a.length>0,l=ou(),{appName:c}=m.useContext(iT),{i18n:u}=m.useContext(cc);return Ae.createElement(Ae.Fragment,null,Ae.createElement(wn,{display:"flex",flexDirection:"column",gap:"10",paddingBottom:"2",paddingTop:"16",paddingX:l?"8":"18"},o&&Ae.createElement(wn,{paddingBottom:l?"4":"0",paddingTop:"8",paddingX:l?"12":"6"},Ae.createElement(wn,{display:"flex",justifyContent:"space-between"},Ae.createElement(Os,{color:"modalTextSecondary",size:l?"16":"14",weight:"semibold"},u.t("profile.transactions.recent.title")),Ae.createElement(wn,{style:{marginBottom:-6,marginLeft:-10,marginRight:-10,marginTop:-6}},Ae.createElement(wn,{as:"button",background:{hover:"profileForeground"},borderRadius:"actionButton",className:iu({active:"shrink"}),onClick:n,paddingX:l?"8":"12",paddingY:l?"4":"5",transition:"default",type:"button"},Ae.createElement(Os,{color:"modalTextSecondary",size:l?"16":"14",weight:"semibold"},u.t("profile.transactions.clear.label")))))),Ae.createElement(wn,{display:"flex",flexDirection:"column",gap:"4"},o?a.map(d=>Ae.createElement(gMt,{key:d.hash,tx:d})):Ae.createElement(Ae.Fragment,null,Ae.createElement(wn,{padding:l?"12":"8"},Ae.createElement(Os,{color:"modalTextDim",size:l?"16":"14",weight:l?"medium":"bold"},c?u.t("profile.transactions.description",{appName:c}):u.t("profile.transactions.description_fallback"))),l&&Ae.createElement(wn,{background:"generalBorderDim",height:"1",marginX:"12",marginY:"8"})))),s&&Ae.createElement(wn,{paddingBottom:"18",paddingX:l?"8":"18"},Ae.createElement(wn,{alignItems:"center",as:"a",background:{hover:"profileForeground"},borderRadius:"menuButton",className:iu({active:"shrink"}),color:"modalTextDim",display:"flex",flexDirection:"row",href:`${s}/address/${e}`,justifyContent:"space-between",paddingX:"8",paddingY:"12",rel:"noreferrer noopener",style:{willChange:"transform"},target:"_blank",transition:"default",width:"full",...l?{paddingLeft:"12"}:{}},Ae.createElement(Os,{color:"modalText",font:"body",size:l?"16":"14",weight:l?"semibold":"bold"},u.t("profile.explorer.label")),Ae.createElement(eLe,null))))}function gbe({action:e,icon:t,label:n,testId:r,url:s}){const a=ou();return Ae.createElement(wn,{...s?{as:"a",href:s,rel:"noreferrer noopener",target:"_blank"}:{as:"button",type:"button"},background:{base:"profileAction",...a?{}:{hover:"profileActionHover"}},borderRadius:"menuButton",boxShadow:"profileDetailsAction",className:iu({active:"shrinkSm",hover:a?void 0:"grow"}),display:"flex",onClick:e,padding:a?"6":"8",style:{willChange:"transform"},testId:r,transition:"default",width:"full"},Ae.createElement(wn,{alignItems:"center",display:"flex",flexDirection:"column",gap:"1",justifyContent:"center",paddingTop:"2",width:"full"},Ae.createElement(wn,{color:"modalText",height:"max"},t),Ae.createElement(wn,null,Ae.createElement(Os,{color:"modalText",size:a?"12":"13",weight:"semibold"},n))))}function vMt({address:e,ensAvatar:t,ensName:n,balance:r,onClose:s,onDisconnect:a}){const o=m.useContext(lle),[l,c]=m.useState(!1),u=m.useCallback(()=>{e&&(navigator.clipboard.writeText(e),c(!0))},[e]);if(m.useEffect(()=>{if(l){const C=setTimeout(()=>{c(!1)},1500);return()=>clearTimeout(C)}},[l]),!e)return null;const d=n?ZRe(n):QRe(e),f=r==null?void 0:r.formatted,x=f?XRe(Number.parseFloat(f)):void 0,g="rk_profile_title",v=ou(),{i18n:w}=m.useContext(cc);return Ae.createElement(Ae.Fragment,null,Ae.createElement(wn,{display:"flex",flexDirection:"column"},Ae.createElement(wn,{background:"profileForeground",padding:"16"},Ae.createElement(wn,{alignItems:"center",display:"flex",flexDirection:"column",gap:v?"16":"12",justifyContent:"center",margin:"8",style:{textAlign:"center"}},Ae.createElement(wn,{style:{position:"absolute",right:16,top:16,willChange:"transform"}},Ae.createElement(W3,{onClose:s}))," ",Ae.createElement(wn,{marginTop:v?"24":"0"},Ae.createElement(FFt,{address:e,imageUrl:t,size:v?82:74})),Ae.createElement(wn,{display:"flex",flexDirection:"column",gap:v?"4":"0",textAlign:"center"},Ae.createElement(wn,{textAlign:"center"},Ae.createElement(Os,{as:"h1",color:"modalText",id:g,size:v?"20":"18",weight:"heavy"},d)),!!r&&Ae.createElement(wn,{textAlign:"center"},Ae.createElement(Os,{as:"h1",color:"modalTextSecondary",id:g,size:v?"16":"14",weight:"semibold"},x," ",r.symbol)))),Ae.createElement(wn,{display:"flex",flexDirection:"row",gap:"8",margin:"2",marginTop:"16"},Ae.createElement(gbe,{action:u,icon:l?Ae.createElement(uMt,null):Ae.createElement(dMt,null),label:l?w.t("profile.copy_address.copied"):w.t("profile.copy_address.label")}),Ae.createElement(gbe,{action:a,icon:Ae.createElement(fMt,null),label:w.t("profile.disconnect.label"),testId:"disconnect-button"}))),o&&Ae.createElement(Ae.Fragment,null,Ae.createElement(wn,{background:"generalBorder",height:"1",marginTop:"-1"}),Ae.createElement(wn,null,Ae.createElement(yMt,{address:e})))))}function wMt({onClose:e,open:t}){const{address:n}=ns(),{balance:r,ensAvatar:s,ensName:a}=FRe({address:n,includeBalance:t}),{disconnect:o}=wB();return n?Ae.createElement(Ae.Fragment,null,n&&Ae.createElement(RR,{onClose:e,open:t,titleId:"rk_account_modal_title"},Ae.createElement(LR,{bottomSheetOnMobile:!0,padding:"0"},Ae.createElement(vMt,{address:n,ensAvatar:s,ensName:a,balance:r,onClose:e,onDisconnect:o})))):null}var CMt=({size:e})=>Ae.createElement("svg",{fill:"none",height:e,viewBox:"0 0 28 28",width:e,xmlns:"http://www.w3.org/2000/svg"},Ae.createElement("title",null,"Disconnect"),Ae.createElement("path",{d:"M6.742 22.195h8.367c1.774 0 2.743-.968 2.743-2.758V16.11h-2.016v3.11c0 .625-.305.96-.969.96H6.984c-.664 0-.968-.335-.968-.96V7.984c0-.632.304-.968.968-.968h7.883c.664 0 .969.336.969.968v3.133h2.016v-3.36c0-1.78-.97-2.757-2.743-2.757H6.742C4.97 5 4 5.977 4 7.758v11.68c0 1.789.969 2.757 2.742 2.757Zm5.438-7.703h7.601l1.149-.07-.602.406-1.008.938a.816.816 0 0 0-.258.593c0 .407.313.782.758.782.227 0 .39-.086.547-.243l2.492-2.593c.235-.235.313-.47.313-.711 0-.242-.078-.477-.313-.719l-2.492-2.586c-.156-.156-.32-.25-.547-.25-.445 0-.758.367-.758.781 0 .227.094.446.258.594l1.008.945.602.407-1.149-.079H12.18a.904.904 0 0 0 0 1.805Z",fill:"currentColor"})),SMt="v9horb0",hle=Ae.forwardRef(({children:e,currentlySelected:t=!1,onClick:n,testId:r,...s},a)=>{const o=ou();return Ae.createElement(wn,{as:"button",borderRadius:"menuButton",disabled:t,display:"flex",onClick:n,ref:a,testId:r,type:"button"},Ae.createElement(wn,{borderRadius:"menuButton",className:[o?SMt:void 0,!t&&iu({active:"shrink"})],padding:o?"8":"6",transition:"default",width:"full",...t?{background:"accentColor",borderColor:"selectedOptionBorder",borderStyle:"solid",borderWidth:"1",boxShadow:"selectedOption",color:"accentColorForeground"}:{background:{hover:"menuItemBackground"},color:"modalText",transition:"default"},...s},e))});hle.displayName="MenuButton";var NMt=({chainId:e,currentChainId:t,switchChain:n,chainIconSize:r,isLoading:s,src:a,name:o,iconBackground:l,idx:c})=>{const u=ou(),{i18n:d}=m.useContext(cc),f=UA(),x=t===e;return Ae.createElement(m.Fragment,null,Ae.createElement(hle,{currentlySelected:x,onClick:x?void 0:()=>n({chainId:e}),testId:`chain-option-${e}`},Ae.createElement(wn,{fontFamily:"body",fontSize:"16",fontWeight:"bold"},Ae.createElement(wn,{alignItems:"center",display:"flex",flexDirection:"row",justifyContent:"space-between"},Ae.createElement(wn,{alignItems:"center",display:"flex",flexDirection:"row",gap:"4",height:r},a&&Ae.createElement(wn,{height:"full",marginRight:"8"},Ae.createElement(Pc,{alt:o,background:l,borderRadius:"full",height:r,src:a,width:r,testId:`chain-option-${e}-icon`})),Ae.createElement("div",null,o??o)),x&&Ae.createElement(wn,{alignItems:"center",display:"flex",flexDirection:"row",marginRight:"6"},Ae.createElement(Os,{color:"accentColorForeground",size:"14",weight:"medium"},d.t("chains.connected")),Ae.createElement(wn,{background:"connectionIndicator",borderColor:"selectedOptionBorder",borderRadius:"full",borderStyle:"solid",borderWidth:"1",height:"8",marginLeft:"8",width:"8"})),s&&Ae.createElement(wn,{alignItems:"center",display:"flex",flexDirection:"row",marginRight:"6"},Ae.createElement(Os,{color:"modalText",size:"14",weight:"medium"},d.t("chains.confirm")),Ae.createElement(wn,{background:"standby",borderRadius:"full",height:"8",marginLeft:"8",width:"8"}))))),u&&c<f.length-1&&Ae.createElement(wn,{background:"generalBorderDim",height:"1",marginX:"8"}))},AMt=NMt,jMt="_18dqw9x0",EMt="_18dqw9x1";function _Mt({onClose:e,open:t}){const{chainId:n}=ns(),{chains:r}=Al(),[s,a]=m.useState(null),{switchChain:o}=Wie({mutation:{onMutate:({chainId:v})=>{a(v)},onSuccess:()=>{s&&a(null)},onError:()=>{s&&a(null)},onSettled:()=>{e()}}}),{i18n:l}=m.useContext(cc),{disconnect:c}=wB(),u="rk_chain_modal_title",d=ou(),f=r.some(v=>v.id===n),x=d?"36":"28",g=UA();return n?Ae.createElement(RR,{onClose:e,open:t,titleId:u},Ae.createElement(LR,{bottomSheetOnMobile:!0,paddingBottom:"0"},Ae.createElement(wn,{display:"flex",flexDirection:"column",gap:"14"},Ae.createElement(wn,{display:"flex",flexDirection:"row",justifyContent:"space-between"},d&&Ae.createElement(wn,{width:"30"}),Ae.createElement(wn,{paddingBottom:"0",paddingLeft:"8",paddingTop:"4"},Ae.createElement(Os,{as:"h1",color:"modalText",id:u,size:d?"20":"18",weight:"heavy"},l.t("chains.title"))),Ae.createElement(W3,{onClose:e})),!f&&Ae.createElement(wn,{marginX:"8",textAlign:d?"center":"left"},Ae.createElement(Os,{color:"modalTextSecondary",size:"14",weight:"medium"},l.t("chains.wrong_network"))),Ae.createElement(wn,{className:d?EMt:jMt,display:"flex",flexDirection:"column",gap:"4",padding:"2",paddingBottom:"16"},g.map(({iconBackground:v,iconUrl:w,id:C,name:N},P)=>Ae.createElement(AMt,{key:C,chainId:C,currentChainId:n,switchChain:o,chainIconSize:x,isLoading:s===C,src:w,name:N,iconBackground:v,idx:P})),!f&&Ae.createElement(Ae.Fragment,null,Ae.createElement(wn,{background:"generalBorderDim",height:"1",marginX:"8"}),Ae.createElement(hle,{onClick:()=>c(),testId:"chain-option-disconnect"},Ae.createElement(wn,{color:"error",fontFamily:"body",fontSize:"16",fontWeight:"bold"},Ae.createElement(wn,{alignItems:"center",display:"flex",flexDirection:"row",justifyContent:"space-between"},Ae.createElement(wn,{alignItems:"center",display:"flex",flexDirection:"row",gap:"4",height:x},Ae.createElement(wn,{alignItems:"center",color:"error",height:x,justifyContent:"center",marginRight:"8"},Ae.createElement(CMt,{size:Number(x)})),Ae.createElement("div",null,l.t("chains.disconnect"))))))))))):null}function kMt(e,t){const n={};for(const r of e){const s=t(r);s&&(n[s]||(n[s]=[]),n[s].push(r))}return n}var ple=({children:e,href:t})=>Ae.createElement(wn,{as:"a",color:"accentColor",href:t,rel:"noreferrer",target:"_blank"},e),mle=({children:e})=>Ae.createElement(Os,{color:"modalTextSecondary",size:"12",weight:"medium"},e);function bbe({compactModeEnabled:e=!1,getWallet:t}){const{disclaimer:n,learnMoreUrl:r}=m.useContext(iT),{i18n:s}=m.useContext(cc);return Ae.createElement(Ae.Fragment,null,Ae.createElement(wn,{alignItems:"center",color:"accentColor",display:"flex",flexDirection:"column",height:"full",justifyContent:"space-around"},Ae.createElement(wn,{marginBottom:"10"},!e&&Ae.createElement(Os,{color:"modalText",size:"18",weight:"heavy"},s.t("intro.title"))),Ae.createElement(wn,{display:"flex",flexDirection:"column",gap:"32",justifyContent:"center",marginY:"20",style:{maxWidth:312}},Ae.createElement(wn,{alignItems:"center",display:"flex",flexDirection:"row",gap:"16"},Ae.createElement(wn,{borderRadius:"6",height:"48",minWidth:"48",width:"48"},Ae.createElement(UOt,null)),Ae.createElement(wn,{display:"flex",flexDirection:"column",gap:"4"},Ae.createElement(Os,{color:"modalText",size:"14",weight:"bold"},s.t("intro.digital_asset.title")),Ae.createElement(Os,{color:"modalTextSecondary",size:"14",weight:"medium"},s.t("intro.digital_asset.description")))),Ae.createElement(wn,{alignItems:"center",display:"flex",flexDirection:"row",gap:"16"},Ae.createElement(wn,{borderRadius:"6",height:"48",minWidth:"48",width:"48"},Ae.createElement(HOt,null)),Ae.createElement(wn,{display:"flex",flexDirection:"column",gap:"4"},Ae.createElement(Os,{color:"modalText",size:"14",weight:"bold"},s.t("intro.login.title")),Ae.createElement(Os,{color:"modalTextSecondary",size:"14",weight:"medium"},s.t("intro.login.description"))))),Ae.createElement(wn,{alignItems:"center",display:"flex",flexDirection:"column",gap:"12",justifyContent:"center",margin:"10"},Ae.createElement(hd,{label:s.t("intro.get.label"),onClick:t}),Ae.createElement(wn,{as:"a",className:iu({active:"shrink",hover:"grow"}),display:"block",href:r,paddingX:"12",paddingY:"4",rel:"noreferrer",style:{willChange:"transform"},target:"_blank",transition:"default"},Ae.createElement(Os,{color:"accentColor",size:"14",weight:"bold"},s.t("intro.learn_more.label")))),n&&!e&&Ae.createElement(wn,{marginBottom:"8",marginTop:"12",textAlign:"center"},Ae.createElement(n,{Link:ple,Text:mle}))))}var tLe=()=>Ae.createElement("svg",{fill:"none",height:"17",viewBox:"0 0 11 17",width:"11",xmlns:"http://www.w3.org/2000/svg"},Ae.createElement("title",null,"Back"),Ae.createElement("path",{d:"M0.99707 8.6543C0.99707 9.08496 1.15527 9.44531 1.51562 9.79688L8.16016 16.3096C8.43262 16.5732 8.74902 16.7051 9.13574 16.7051C9.90918 16.7051 10.5508 16.0811 10.5508 15.3076C10.5508 14.9121 10.3838 14.5605 10.0938 14.2705L4.30176 8.64551L10.0938 3.0293C10.3838 2.74805 10.5508 2.3877 10.5508 2.00098C10.5508 1.23633 9.90918 0.603516 9.13574 0.603516C8.74902 0.603516 8.43262 0.735352 8.16016 0.999023L1.51562 7.51172C1.15527 7.85449 1.00586 8.21484 0.99707 8.6543Z",fill:"currentColor"})),TMt=()=>Ae.createElement("svg",{fill:"none",height:"12",viewBox:"0 0 8 12",width:"8",xmlns:"http://www.w3.org/2000/svg"},Ae.createElement("title",null,"Info"),Ae.createElement("path",{d:"M3.64258 7.99609C4.19336 7.99609 4.5625 7.73828 4.68555 7.24609C4.69141 7.21094 4.70312 7.16406 4.70898 7.13477C4.80859 6.60742 5.05469 6.35547 6.04492 5.76367C7.14648 5.10156 7.67969 4.3457 7.67969 3.24414C7.67969 1.39844 6.17383 0.255859 3.95898 0.255859C2.32422 0.255859 1.05859 0.894531 0.548828 1.86719C0.396484 2.14844 0.320312 2.44727 0.320312 2.74023C0.314453 3.37305 0.742188 3.79492 1.42188 3.79492C1.91406 3.79492 2.33594 3.54883 2.53516 3.11523C2.78711 2.47656 3.23242 2.21289 3.83594 2.21289C4.55664 2.21289 5.10742 2.65234 5.10742 3.29102C5.10742 3.9707 4.7793 4.29883 3.81836 4.87891C3.02148 5.36523 2.50586 5.92773 2.50586 6.76562V6.90039C2.50586 7.55664 2.96289 7.99609 3.64258 7.99609ZM3.67188 11.4473C4.42773 11.4473 5.04297 10.8672 5.04297 10.1406C5.04297 9.41406 4.42773 8.83984 3.67188 8.83984C2.91602 8.83984 2.30664 9.41406 2.30664 10.1406C2.30664 10.8672 2.91602 11.4473 3.67188 11.4473Z",fill:"currentColor"})),IMt=({"aria-label":e="Info",onClick:t})=>{const n=ou();return Ae.createElement(wn,{alignItems:"center","aria-label":e,as:"button",background:"closeButtonBackground",borderColor:"actionButtonBorder",borderRadius:"full",borderStyle:"solid",borderWidth:n?"0":"1",className:iu({active:"shrinkSm",hover:"growLg"}),color:"closeButton",display:"flex",height:n?"30":"28",justifyContent:"center",onClick:t,style:{willChange:"transform"},transition:"default",type:"button",width:n?"30":"28"},Ae.createElement(TMt,null))},nLe=e=>{const t=m.useRef(null),n=m.useContext(BRe),r=ile(e);return m.useEffect(()=>{if(n&&t.current&&r)return FMt(t.current,r)},[n,r]),t},PMt=()=>{const e="_rk_coolMode",t=document.getElementById(e);if(t)return t;const n=document.createElement("div");return n.setAttribute("id",e),n.setAttribute("style",["overflow:hidden","position:fixed","height:100%","top:0","left:0","right:0","bottom:0","pointer-events:none","z-index:2147483647"].join(";")),document.body.appendChild(n),n},ybe=0;function FMt(e,t){ybe++;const n=[15,20,25,35,45],r=35;let s=[],a=!1,o=0,l=0;const c=PMt();function u(){const R=n[Math.floor(Math.random()*n.length)],F=Math.random()*10,U=Math.random()*25,L=Math.random()*360,z=Math.random()*35*(Math.random()<=.5?-1:1),Q=l-R/2,ne=o-R/2,J=Math.random()<=.5?-1:1,X=document.createElement("div");X.innerHTML=`<img src="${t}" width="${R}" height="${R}" style="border-radius: 25%">`,X.setAttribute("style",["position:absolute","will-change:transform",`top:${Q}px`,`left:${ne}px`,`transform:rotate(${L}deg)`].join(";")),c.appendChild(X),s.push({direction:J,element:X,left:ne,size:R,speedHorz:F,speedUp:U,spinSpeed:z,spinVal:L,top:Q})}function d(){for(const R of s)R.left=R.left-R.speedHorz*R.direction,R.top=R.top-R.speedUp,R.speedUp=Math.min(R.size,R.speedUp-1),R.spinVal=R.spinVal+R.spinSpeed,R.top>=Math.max(window.innerHeight,document.body.clientHeight)+R.size&&(s=s.filter(F=>F!==R),R.element.remove()),R.element.setAttribute("style",["position:absolute","will-change:transform",`top:${R.top}px`,`left:${R.left}px`,`transform:rotate(${R.spinVal}deg)`].join(";"))}let f;function x(){a&&s.length<r&&u(),d(),f=requestAnimationFrame(x)}x();const g="ontouchstart"in window||navigator.msMaxTouchPoints,v=g?"touchstart":"mousedown",w=g?"touchend":"mouseup",C=g?"touchmove":"mousemove",N=R=>{var F,U;"touches"in R?(o=(F=R.touches)==null?void 0:F[0].clientX,l=(U=R.touches)==null?void 0:U[0].clientY):(o=R.clientX,l=R.clientY)},P=R=>{N(R),a=!0},I=()=>{a=!1};return e.addEventListener(C,N,{passive:!1}),e.addEventListener(v,P),e.addEventListener(w,I),e.addEventListener("mouseleave",I),()=>{e.removeEventListener(C,N),e.removeEventListener(v,P),e.removeEventListener(w,I),e.removeEventListener("mouseleave",I);const R=setInterval(()=>{f&&s.length===0&&(cancelAnimationFrame(f),clearInterval(R),--ybe===0&&c.remove())},500)}}var OMt="g5kl0l0",rLe=({as:e="button",currentlySelected:t=!1,iconBackground:n,iconUrl:r,name:s,onClick:a,ready:o,recent:l,testId:c,isRainbowKitConnector:u,...d})=>{const f=nLe(r),[x,g]=Ae.useState(!1),{i18n:v}=Ae.useContext(cc);return Ae.createElement(wn,{display:"flex",flexDirection:"column",onMouseEnter:()=>g(!0),onMouseLeave:()=>g(!1),ref:f},Ae.createElement(wn,{as:e,borderRadius:"menuButton",borderStyle:"solid",borderWidth:"1",className:t?void 0:[OMt,iu({active:"shrink"})],disabled:t,onClick:a,padding:"5",style:{willChange:"transform"},testId:c,transition:"default",width:"full",...t?{background:"accentColor",borderColor:"selectedOptionBorder",boxShadow:"selectedWallet"}:{background:{hover:"menuItemBackground"}},...d},Ae.createElement(wn,{color:t?"accentColorForeground":"modalText",disabled:!o,fontFamily:"body",fontSize:"16",fontWeight:"bold",transition:"default"},Ae.createElement(wn,{alignItems:"center",display:"flex",flexDirection:"row",gap:"12"},Ae.createElement(Pc,{background:n,...!x&&u?{borderColor:"actionButtonBorder"}:{},useAsImage:!u,borderRadius:"6",height:"28",src:r,width:"28"}),Ae.createElement(wn,null,Ae.createElement(wn,{style:{marginTop:l?-2:void 0},maxWidth:"200"},s),l&&Ae.createElement(Os,{color:t?"accentColorForeground":"accentColor",size:"12",style:{lineHeight:1,marginTop:-1},weight:"medium"},v.t("connect.recent")))))))};rLe.displayName="ModalSelection";var MMt="rk-latest-id";function RMt(e){localStorage.setItem(MMt,e)}var cW=(e,t=1)=>{let n=e.replace("#","");n.length===3&&(n=`${n[0]}${n[0]}${n[1]}${n[1]}${n[2]}${n[2]}`);const r=Number.parseInt(n.substring(0,2),16),s=Number.parseInt(n.substring(2,4),16),a=Number.parseInt(n.substring(4,6),16);return t>1&&t<=100&&(t=t/100),`rgba(${r},${s},${a},${t})`},LMt=e=>e?[cW(e,.2),cW(e,.14),cW(e,.1)]:null,DMt=e=>/^#([0-9a-f]{3}){1,2}$/i.test(e),sLe=async()=>(await as(async()=>{const{default:e}=await import("./connect-MR6XDLIE-BET5HMNk.js");return{default:e}},[])).default,BMt=()=>sx(sLe),$Mt=()=>Ae.createElement(Pc,{background:"#515a70",borderColor:"generalBorder",borderRadius:"10",height:"48",src:sLe,width:"48"}),iLe=async()=>(await as(async()=>{const{default:e}=await import("./create-X4WFHLCW-De9pC3ym.js");return{default:e}},[])).default,aLe=()=>sx(iLe),UMt=()=>Ae.createElement(Pc,{background:"#e3a5e8",borderColor:"generalBorder",borderRadius:"10",height:"48",src:iLe,width:"48"}),oLe=async()=>(await as(async()=>{const{default:e}=await import("./refresh-HJGJRASX-D0rkc63_.js");return{default:e}},[])).default,zMt=()=>sx(oLe),HMt=()=>Ae.createElement(Pc,{background:"#515a70",borderColor:"generalBorder",borderRadius:"10",height:"48",src:oLe,width:"48"}),lLe=async()=>(await as(async()=>{const{default:e}=await import("./scan-DEOT2M37-1-mJ5OyF.js");return{default:e}},[])).default,cLe=()=>sx(lLe),VMt=()=>Ae.createElement(Pc,{background:"#515a70",borderColor:"generalBorder",borderRadius:"10",height:"48",src:lLe,width:"48"}),WMt="_1vwt0cg0",qMt="_1vwt0cg2 ju367v7a ju367v7v",GMt="_1vwt0cg3",KMt="_1vwt0cg4",YMt=(e,t)=>{const n=Array.prototype.slice.call(fFt.create(e,{errorCorrectionLevel:t}).modules.data,0),r=Math.sqrt(n.length);return n.reduce((s,a,o)=>(o%r===0?s.push([a]):s[s.length-1].push(a))&&s,[])};function uLe({ecl:e="M",logoBackground:t,logoMargin:n=10,logoSize:r=50,logoUrl:s,size:a=200,uri:o}){const l="20",c=a-Number.parseInt(l,10)*2,u=m.useMemo(()=>{const x=[],g=YMt(o,e),v=c/g.length;[{x:0,y:0},{x:1,y:0},{x:0,y:1}].forEach(({x:I,y:R})=>{const F=(g.length-7)*v*I,U=(g.length-7)*v*R;for(let L=0;L<3;L++)x.push(Ae.createElement("rect",{fill:L%2!==0?"white":"black",height:v*(7-L*2),key:`${L}-${I}-${R}`,rx:(L-2)*-5+(L===0?2:0),ry:(L-2)*-5+(L===0?2:0),width:v*(7-L*2),x:F+v*L,y:U+v*L}))});const C=Math.floor((r+25)/v),N=g.length/2-C/2,P=g.length/2+C/2-1;return g.forEach((I,R)=>{I.forEach((F,U)=>{g[R][U]&&(R<7&&U<7||R>g.length-8&&U<7||R<7&&U>g.length-8||R>N&&R<P&&U>N&&U<P||x.push(Ae.createElement("circle",{cx:R*v+v/2,cy:U*v+v/2,fill:"black",key:`circle-${R}-${U}`,r:v/3})))})}),x},[e,r,c,o]),d=c/2-r/2,f=r+n*2;return Ae.createElement(wn,{borderColor:"generalBorder",borderRadius:"menuButton",borderStyle:"solid",borderWidth:"1",className:WMt,padding:l,width:"max"},Ae.createElement(wn,{style:{height:c,userSelect:"none",width:c},userSelect:"none"},Ae.createElement(wn,{display:"flex",justifyContent:"center",position:"relative",style:{height:0,top:d,width:c},width:"full"},Ae.createElement(Pc,{background:t,borderColor:{custom:"rgba(0, 0, 0, 0.06)"},borderRadius:"13",height:r,src:s,width:r})),Ae.createElement("svg",{height:c,style:{all:"revert"},width:c},Ae.createElement("title",null,"QR Code"),Ae.createElement("defs",null,Ae.createElement("clipPath",{id:"clip-wrapper"},Ae.createElement("rect",{height:f,width:f})),Ae.createElement("clipPath",{id:"clip-logo"},Ae.createElement("rect",{height:r,width:r}))),Ae.createElement("rect",{fill:"transparent",height:c,width:c}),u)))}var dLe=async()=>{switch(ule()){case"Arc":return(await as(async()=>{const{default:t}=await import("./Arc-R3PUWRPJ-CUdEQO8X.js");return{default:t}},[])).default;case"Brave":return(await as(async()=>{const{default:t}=await import("./Brave-24BM36UM-C6C5mkTK.js");return{default:t}},[])).default;case"Chrome":return(await as(async()=>{const{default:t}=await import("./Chrome-TLI42HDP-BgiVz-ma.js");return{default:t}},[])).default;case"Edge":return(await as(async()=>{const{default:t}=await import("./Edge-AZ34LAFM-EBh9cG_z.js");return{default:t}},[])).default;case"Firefox":return(await as(async()=>{const{default:t}=await import("./Firefox-ZDK7RHKK-5nyhB0sj.js");return{default:t}},[])).default;case"Opera":return(await as(async()=>{const{default:t}=await import("./Opera-BKMCKUXC-CCypmVaM.js");return{default:t}},[])).default;case"Safari":return(await as(async()=>{const{default:t}=await import("./Safari-PXQIVS6N-B-Lfxb9r.js");return{default:t}},[])).default;default:return(await as(async()=>{const{default:t}=await import("./Browser-4R4QKTV2-D3ON1q-S.js");return{default:t}},[])).default}},XMt=()=>sx(dLe),fLe=async()=>{switch(fle()){case"Windows":return(await as(async()=>{const{default:t}=await import("./Windows-GTAT3OTE-K9Pt3pUF.js");return{default:t}},[])).default;case"macOS":return(await as(async()=>{const{default:t}=await import("./Macos-5QL4JBJE-DLNYPiln.js");return{default:t}},[])).default;case"Linux":return(await as(async()=>{const{default:t}=await import("./Linux-VYP66PDO--MOvpQUa.js");return{default:t}},[])).default;default:return(await as(async()=>{const{default:t}=await import("./Linux-VYP66PDO--MOvpQUa.js");return{default:t}},[])).default}},QMt=()=>sx(fLe);function ZMt({getWalletDownload:e,compactModeEnabled:t}){const r=e_().filter(a=>a.isRainbowKitConnector).splice(0,5),{i18n:s}=m.useContext(cc);return Ae.createElement(wn,{alignItems:"center",display:"flex",flexDirection:"column",height:"full",marginTop:"18",width:"full"},Ae.createElement(wn,{alignItems:"center",display:"flex",flexDirection:"column",gap:"28",height:"full",width:"full"},r==null?void 0:r.filter(a=>{var o;return a.extensionDownloadUrl||a.desktopDownloadUrl||a.qrCode&&((o=a.downloadUrls)==null?void 0:o.qrCode)}).map(a=>{const{downloadUrls:o,iconBackground:l,iconUrl:c,id:u,name:d,qrCode:f}=a,x=(o==null?void 0:o.qrCode)&&f,g=!!a.extensionDownloadUrl,v=(o==null?void 0:o.qrCode)&&g,w=(o==null?void 0:o.qrCode)&&!!a.desktopDownloadUrl;return Ae.createElement(wn,{alignItems:"center",display:"flex",gap:"16",justifyContent:"space-between",key:a.id,width:"full"},Ae.createElement(wn,{alignItems:"center",display:"flex",flexDirection:"row",gap:"16"},Ae.createElement(Pc,{background:l,borderColor:"actionButtonBorder",borderRadius:"10",height:"48",src:c,width:"48"}),Ae.createElement(wn,{display:"flex",flexDirection:"column",gap:"2"},Ae.createElement(Os,{color:"modalText",size:"14",weight:"bold"},d),Ae.createElement(Os,{color:"modalTextSecondary",size:"14",weight:"medium"},v?s.t("get.mobile_and_extension.description"):w?s.t("get.mobile_and_desktop.description"):x?s.t("get.mobile.description"):g?s.t("get.extension.description"):null))),Ae.createElement(wn,{display:"flex",flexDirection:"column",gap:"4"},Ae.createElement(hd,{label:s.t("get.action.label"),onClick:()=>e(u),type:"secondary"})))})),Ae.createElement(wn,{alignItems:"center",borderRadius:"10",display:"flex",flexDirection:"column",gap:"8",justifyContent:"space-between",marginBottom:"4",paddingY:"8",style:{maxWidth:275,textAlign:"center"}},Ae.createElement(Os,{color:"modalText",size:"14",weight:"bold"},s.t("get.looking_for.title")),Ae.createElement(Os,{color:"modalTextSecondary",size:"14",weight:"medium"},t?s.t("get.looking_for.desktop.compact_description"):s.t("get.looking_for.desktop.wide_description"))))}var uW="44";function JMt({changeWalletStep:e,compactModeEnabled:t,connectionError:n,onClose:r,qrCodeUri:s,reconnect:a,wallet:o}){const{downloadUrls:l,iconBackground:c,iconUrl:u,name:d,qrCode:f,ready:x,showWalletConnectModal:g,getDesktopUri:v}=o,w=!!v,C=cle(),{i18n:N}=m.useContext(cc),P=!!o.extensionDownloadUrl,I=(l==null?void 0:l.qrCode)&&P,R=(l==null?void 0:l.qrCode)&&!!o.desktopDownloadUrl,F=f&&s,U=async()=>{const ne=await(v==null?void 0:v());window.open(ne,C?"_blank":"_self")},L=g?{description:t?N.t("connect.walletconnect.description.compact"):N.t("connect.walletconnect.description.full"),label:N.t("connect.walletconnect.open.label"),onClick:()=>{r(),g()}}:F?{description:N.t("connect.secondary_action.get.description",{wallet:d}),label:N.t("connect.secondary_action.get.label"),onClick:()=>e(I||R?"DOWNLOAD_OPTIONS":"DOWNLOAD")}:null,{width:z}=$Re(),Q=z&&z<768;return m.useEffect(()=>{XMt(),QMt()},[]),Ae.createElement(wn,{display:"flex",flexDirection:"column",height:"full",width:"full"},F?Ae.createElement(wn,{alignItems:"center",display:"flex",height:"full",justifyContent:"center"},Ae.createElement(uLe,{logoBackground:c,logoSize:t?60:72,logoUrl:u,size:t?318:Q?Math.max(280,Math.min(z-308,382)):382,uri:s})):Ae.createElement(wn,{alignItems:"center",display:"flex",justifyContent:"center",style:{flexGrow:1}},Ae.createElement(wn,{alignItems:"center",display:"flex",flexDirection:"column",gap:"8"},Ae.createElement(wn,{borderRadius:"10",height:uW,overflow:"hidden"},Ae.createElement(Pc,{useAsImage:!o.isRainbowKitConnector,height:uW,src:u,width:uW})),Ae.createElement(wn,{alignItems:"center",display:"flex",flexDirection:"column",gap:"4",paddingX:"32",style:{textAlign:"center"}},Ae.createElement(Os,{color:"modalText",size:"18",weight:"bold"},x?N.t("connect.status.opening",{wallet:d}):P?N.t("connect.status.not_installed",{wallet:d}):N.t("connect.status.not_available",{wallet:d})),!x&&P?Ae.createElement(wn,{paddingTop:"20"},Ae.createElement(hd,{href:o.extensionDownloadUrl,label:N.t("connect.secondary_action.install.label"),type:"secondary"})):null,x&&!F&&Ae.createElement(Ae.Fragment,null,Ae.createElement(wn,{alignItems:"center",display:"flex",flexDirection:"column",justifyContent:"center"},Ae.createElement(Os,{color:"modalTextSecondary",size:"14",textAlign:"center",weight:"medium"},N.t("connect.status.confirm"))),Ae.createElement(wn,{alignItems:"center",color:"modalText",display:"flex",flexDirection:"row",height:"32",marginTop:"8"},n?Ae.createElement(hd,{label:N.t("connect.secondary_action.retry.label"),onClick:async()=>{w&&U(),a(o)}}):Ae.createElement(wn,{color:"modalTextSecondary"},Ae.createElement(JE,null))))))),Ae.createElement(wn,{alignItems:"center",borderRadius:"10",display:"flex",flexDirection:"row",gap:"8",height:"28",justifyContent:"space-between",marginTop:"12"},x&&L&&Ae.createElement(Ae.Fragment,null,Ae.createElement(Os,{color:"modalTextSecondary",size:"14",weight:"medium"},L.description),Ae.createElement(hd,{label:L.label,onClick:L.onClick,type:"secondary"}))))}var dW=({actionLabel:e,description:t,iconAccent:n,iconBackground:r,iconUrl:s,isCompact:a,onAction:o,title:l,url:c,variant:u})=>{const d=u==="browser",f=!d&&n&&LMt(n);return Ae.createElement(wn,{alignItems:"center",borderRadius:"13",display:"flex",justifyContent:"center",overflow:"hidden",paddingX:a?"18":"44",position:"relative",style:{flex:1,isolation:"isolate"},width:"full"},Ae.createElement(wn,{borderColor:"actionButtonBorder",borderRadius:"13",borderStyle:"solid",borderWidth:"1",style:{bottom:"0",left:"0",position:"absolute",right:"0",top:"0",zIndex:1}}),d&&Ae.createElement(wn,{background:"downloadTopCardBackground",height:"full",position:"absolute",style:{zIndex:0},width:"full"},Ae.createElement(wn,{display:"flex",flexDirection:"row",justifyContent:"space-between",style:{bottom:"0",filter:"blur(20px)",left:"0",position:"absolute",right:"0",top:"0",transform:"translate3d(0, 0, 0)"}},Ae.createElement(wn,{style:{filter:"blur(100px)",marginLeft:-27,marginTop:-20,opacity:.6,transform:"translate3d(0, 0, 0)"}},Ae.createElement(Pc,{borderRadius:"full",height:"200",src:s,width:"200"})),Ae.createElement(wn,{style:{filter:"blur(100px)",marginRight:0,marginTop:105,opacity:.6,overflow:"auto",transform:"translate3d(0, 0, 0)"}},Ae.createElement(Pc,{borderRadius:"full",height:"200",src:s,width:"200"})))),!d&&f&&Ae.createElement(wn,{background:"downloadBottomCardBackground",style:{bottom:"0",left:"0",position:"absolute",right:"0",top:"0"}},Ae.createElement(wn,{position:"absolute",style:{background:`radial-gradient(50% 50% at 50% 50%, ${f[0]} 0%, ${f[1]} 25%, rgba(0,0,0,0) 100%)`,height:564,left:-215,top:-197,transform:"translate3d(0, 0, 0)",width:564}}),Ae.createElement(wn,{position:"absolute",style:{background:`radial-gradient(50% 50% at 50% 50%, ${f[2]} 0%, rgba(0, 0, 0, 0) 100%)`,height:564,left:-1,top:-76,transform:"translate3d(0, 0, 0)",width:564}})),Ae.createElement(wn,{alignItems:"flex-start",display:"flex",flexDirection:"row",gap:"24",height:"max",justifyContent:"center",style:{zIndex:1}},Ae.createElement(wn,null,Ae.createElement(Pc,{height:"60",src:s,width:"60",...r?{background:r,borderColor:"generalBorder",borderRadius:"10"}:null})),Ae.createElement(wn,{display:"flex",flexDirection:"column",gap:"4",style:{flex:1},width:"full"},Ae.createElement(Os,{color:"modalText",size:"14",weight:"bold"},l),Ae.createElement(Os,{color:"modalTextSecondary",size:"14",weight:"medium"},t),Ae.createElement(wn,{marginTop:"14",width:"max"},Ae.createElement(hd,{href:c,label:e,onClick:o,size:"medium"})))))};function eRt({changeWalletStep:e,wallet:t}){const n=ule(),r=fle(),a=m.useContext(E$)==="compact",{desktop:o,desktopDownloadUrl:l,extension:c,extensionDownloadUrl:u,mobileDownloadUrl:d}=t,{i18n:f}=m.useContext(cc);return m.useEffect(()=>{aLe(),cLe(),zMt(),BMt()},[]),Ae.createElement(wn,{alignItems:"center",display:"flex",flexDirection:"column",gap:"24",height:"full",marginBottom:"8",marginTop:"4",width:"full"},Ae.createElement(wn,{alignItems:"center",display:"flex",flexDirection:"column",gap:"8",height:"full",justifyContent:"center",width:"full"},u&&Ae.createElement(dW,{actionLabel:f.t("get_options.extension.download.label",{browser:n}),description:f.t("get_options.extension.description"),iconUrl:dLe,isCompact:a,onAction:()=>e(c!=null&&c.instructions?"INSTRUCTIONS_EXTENSION":"CONNECT"),title:f.t("get_options.extension.title",{wallet:t.name,browser:n}),url:u,variant:"browser"}),l&&Ae.createElement(dW,{actionLabel:f.t("get_options.desktop.download.label",{platform:r}),description:f.t("get_options.desktop.description"),iconUrl:fLe,isCompact:a,onAction:()=>e(o!=null&&o.instructions?"INSTRUCTIONS_DESKTOP":"CONNECT"),title:f.t("get_options.desktop.title",{wallet:t.name,platform:r}),url:l,variant:"desktop"}),d&&Ae.createElement(dW,{actionLabel:f.t("get_options.mobile.download.label",{wallet:t.name}),description:f.t("get_options.mobile.description"),iconAccent:t.iconAccent,iconBackground:t.iconBackground,iconUrl:t.iconUrl,isCompact:a,onAction:()=>{e("DOWNLOAD")},title:f.t("get_options.mobile.title",{wallet:t.name}),variant:"app"})))}function tRt({changeWalletStep:e,wallet:t}){const{downloadUrls:n,qrCode:r}=t,{i18n:s}=m.useContext(cc);return m.useEffect(()=>{aLe(),cLe()},[]),Ae.createElement(wn,{alignItems:"center",display:"flex",flexDirection:"column",gap:"24",height:"full",width:"full"},Ae.createElement(wn,{style:{maxWidth:220,textAlign:"center"}},Ae.createElement(Os,{color:"modalTextSecondary",size:"14",weight:"semibold"},s.t("get_mobile.description"))),Ae.createElement(wn,{height:"full"},n!=null&&n.qrCode?Ae.createElement(uLe,{logoSize:0,size:268,uri:n.qrCode}):null),Ae.createElement(wn,{alignItems:"center",borderRadius:"10",display:"flex",flexDirection:"row",gap:"8",height:"34",justifyContent:"space-between",marginBottom:"12",paddingY:"8"},Ae.createElement(hd,{label:s.t("get_mobile.continue.label"),onClick:()=>e(r!=null&&r.instructions?"INSTRUCTIONS_MOBILE":"CONNECT")})))}var Kg={connect:()=>Ae.createElement($Mt,null),create:()=>Ae.createElement(UMt,null),install:e=>Ae.createElement(Pc,{background:e.iconBackground,borderColor:"generalBorder",borderRadius:"10",height:"48",src:e.iconUrl,width:"48"}),refresh:()=>Ae.createElement(HMt,null),scan:()=>Ae.createElement(VMt,null)};function nRt({connectWallet:e,wallet:t}){var r,s,a,o;const{i18n:n}=m.useContext(cc);return Ae.createElement(wn,{alignItems:"center",display:"flex",flexDirection:"column",height:"full",width:"full"},Ae.createElement(wn,{display:"flex",flexDirection:"column",gap:"28",height:"full",justifyContent:"center",paddingY:"32",style:{maxWidth:320}},(s=(r=t==null?void 0:t.qrCode)==null?void 0:r.instructions)==null?void 0:s.steps.map((l,c)=>{var u;return Ae.createElement(wn,{alignItems:"center",display:"flex",flexDirection:"row",gap:"16",key:c},Ae.createElement(wn,{borderRadius:"10",height:"48",minWidth:"48",overflow:"hidden",position:"relative",width:"48"},(u=Kg[l.step])==null?void 0:u.call(Kg,t)),Ae.createElement(wn,{display:"flex",flexDirection:"column",gap:"4"},Ae.createElement(Os,{color:"modalText",size:"14",weight:"bold"},n.t(l.title,void 0,{rawKeyIfTranslationMissing:!0})),Ae.createElement(Os,{color:"modalTextSecondary",size:"14",weight:"medium"},n.t(l.description,void 0,{rawKeyIfTranslationMissing:!0}))))})),Ae.createElement(wn,{alignItems:"center",display:"flex",flexDirection:"column",gap:"12",justifyContent:"center",marginBottom:"16"},Ae.createElement(hd,{label:n.t("get_instructions.mobile.connect.label"),onClick:()=>e(t)}),Ae.createElement(wn,{as:"a",className:iu({active:"shrink",hover:"grow"}),display:"block",href:(o=(a=t==null?void 0:t.qrCode)==null?void 0:a.instructions)==null?void 0:o.learnMoreUrl,paddingX:"12",paddingY:"4",rel:"noreferrer",style:{willChange:"transform"},target:"_blank",transition:"default"},Ae.createElement(Os,{color:"accentColor",size:"14",weight:"bold"},n.t("get_instructions.mobile.learn_more.label")))))}function rRt({wallet:e}){var n,r,s,a;const{i18n:t}=m.useContext(cc);return Ae.createElement(wn,{alignItems:"center",display:"flex",flexDirection:"column",height:"full",width:"full"},Ae.createElement(wn,{display:"flex",flexDirection:"column",gap:"28",height:"full",justifyContent:"center",paddingY:"32",style:{maxWidth:320}},(r=(n=e==null?void 0:e.extension)==null?void 0:n.instructions)==null?void 0:r.steps.map((o,l)=>{var c;return Ae.createElement(wn,{alignItems:"center",display:"flex",flexDirection:"row",gap:"16",key:l},Ae.createElement(wn,{borderRadius:"10",height:"48",minWidth:"48",overflow:"hidden",position:"relative",width:"48"},(c=Kg[o.step])==null?void 0:c.call(Kg,e)),Ae.createElement(wn,{display:"flex",flexDirection:"column",gap:"4"},Ae.createElement(Os,{color:"modalText",size:"14",weight:"bold"},t.t(o.title,void 0,{rawKeyIfTranslationMissing:!0})),Ae.createElement(Os,{color:"modalTextSecondary",size:"14",weight:"medium"},t.t(o.description,void 0,{rawKeyIfTranslationMissing:!0}))))})),Ae.createElement(wn,{alignItems:"center",display:"flex",flexDirection:"column",gap:"12",justifyContent:"center",marginBottom:"16"},Ae.createElement(hd,{label:t.t("get_instructions.extension.refresh.label"),onClick:window.location.reload.bind(window.location)}),Ae.createElement(wn,{as:"a",className:iu({active:"shrink",hover:"grow"}),display:"block",href:(a=(s=e==null?void 0:e.extension)==null?void 0:s.instructions)==null?void 0:a.learnMoreUrl,paddingX:"12",paddingY:"4",rel:"noreferrer",style:{willChange:"transform"},target:"_blank",transition:"default"},Ae.createElement(Os,{color:"accentColor",size:"14",weight:"bold"},t.t("get_instructions.extension.learn_more.label")))))}function sRt({connectWallet:e,wallet:t}){var r,s,a,o;const{i18n:n}=m.useContext(cc);return Ae.createElement(wn,{alignItems:"center",display:"flex",flexDirection:"column",height:"full",width:"full"},Ae.createElement(wn,{display:"flex",flexDirection:"column",gap:"28",height:"full",justifyContent:"center",paddingY:"32",style:{maxWidth:320}},(s=(r=t==null?void 0:t.desktop)==null?void 0:r.instructions)==null?void 0:s.steps.map((l,c)=>{var u;return Ae.createElement(wn,{alignItems:"center",display:"flex",flexDirection:"row",gap:"16",key:c},Ae.createElement(wn,{borderRadius:"10",height:"48",minWidth:"48",overflow:"hidden",position:"relative",width:"48"},(u=Kg[l.step])==null?void 0:u.call(Kg,t)),Ae.createElement(wn,{display:"flex",flexDirection:"column",gap:"4"},Ae.createElement(Os,{color:"modalText",size:"14",weight:"bold"},n.t(l.title,void 0,{rawKeyIfTranslationMissing:!0})),Ae.createElement(Os,{color:"modalTextSecondary",size:"14",weight:"medium"},n.t(l.description,void 0,{rawKeyIfTranslationMissing:!0}))))})),Ae.createElement(wn,{alignItems:"center",display:"flex",flexDirection:"column",gap:"12",justifyContent:"center",marginBottom:"16"},Ae.createElement(hd,{label:n.t("get_instructions.desktop.connect.label"),onClick:()=>e(t)}),Ae.createElement(wn,{as:"a",className:iu({active:"shrink",hover:"grow"}),display:"block",href:(o=(a=t==null?void 0:t.desktop)==null?void 0:a.instructions)==null?void 0:o.learnMoreUrl,paddingX:"12",paddingY:"4",rel:"noreferrer",style:{willChange:"transform"},target:"_blank",transition:"default"},Ae.createElement(Os,{color:"accentColor",size:"14",weight:"bold"},n.t("get_instructions.desktop.learn_more.label")))))}function iRt({onClose:e}){const t="rk_connect_title",[n,r]=m.useState(),[s,a]=m.useState(),[o,l]=m.useState(),c=!!(s!=null&&s.qrCode)&&o,[u,d]=m.useState(!1),x=m.useContext(E$)===oT.COMPACT,{disclaimer:g}=m.useContext(iT),{i18n:v}=m.useContext(cc),w=cle(),C=m.useRef(!1),{connector:N}=m.useContext(aT),I=e_(!N).filter(he=>he.ready||!!he.extensionDownloadUrl).sort((he,ge)=>he.groupIndex-ge.groupIndex),R=e_(),F=kMt(I,he=>he.groupName),U=["Recommended","Other","Popular","More","Others","Installed"];m.useEffect(()=>{N&&!C.current&&(re("CONNECT"),ne(N),C.current=!0)},[N]);const L=he=>{var ge,ye;d(!1),he.ready&&((ye=(ge=he==null?void 0:he.connect)==null?void 0:ge.call(he))==null||ye.catch(()=>{d(!0)}))},z=async he=>{const ge=I.find(ye=>he.id===ye.id);ge!=null&&ge.getDesktopUri&&setTimeout(async()=>{var ve;const ye=await((ve=ge==null?void 0:ge.getDesktopUri)==null?void 0:ve.call(ge));ye&&window.open(ye,w?"_blank":"_self")},0)},Q=async he=>{var ve;const ge=I.find(je=>he.id===je.id),ye=await((ve=ge==null?void 0:ge.getQrCodeUri)==null?void 0:ve.call(ge));l(ye),setTimeout(()=>{a(ge),re("CONNECT")},ye?0:50)},ne=async he=>{RMt(he.id),he.ready&&(Q(he),z(he)),L(he),r(he.id),he.ready||(a(he),re(he!=null&&he.extensionDownloadUrl?"DOWNLOAD_OPTIONS":"CONNECT"))},J=he=>{var Ie;const ge=R.find(Le=>he===Le.id),ye=(Ie=ge==null?void 0:ge.downloadUrls)==null?void 0:Ie.qrCode,ve=!!(ge!=null&&ge.desktopDownloadUrl),je=!!(ge!=null&&ge.extensionDownloadUrl);a(ge),re(ye&&(je||ve)?"DOWNLOAD_OPTIONS":ye?"DOWNLOAD":ve?"INSTRUCTIONS_DESKTOP":"INSTRUCTIONS_EXTENSION")},X=()=>{r(void 0),a(void 0),l(void 0)},re=(he,ge=!1)=>{ge&&he==="GET"&&pe==="GET"?X():!ge&&he==="GET"?Y("GET"):!ge&&he==="CONNECT"&&Y("CONNECT"),oe(he)},[pe,Y]=m.useState("NONE"),[ie,oe]=m.useState("NONE");let G=null,V=null,ee=null,ae;m.useEffect(()=>{d(!1)},[ie,s]);const Ne=!!(!!(s!=null&&s.extensionDownloadUrl)&&(s!=null&&s.mobileDownloadUrl));switch(ie){case"NONE":G=Ae.createElement(bbe,{getWallet:()=>re("GET")});break;case"LEARN_COMPACT":G=Ae.createElement(bbe,{compactModeEnabled:x,getWallet:()=>re("GET")}),V=v.t("intro.title"),ee="NONE";break;case"GET":G=Ae.createElement(ZMt,{getWalletDownload:J,compactModeEnabled:x}),V=v.t("get.title"),ee=x?"LEARN_COMPACT":"NONE";break;case"CONNECT":G=s&&Ae.createElement(JMt,{changeWalletStep:re,compactModeEnabled:x,connectionError:u,onClose:e,qrCodeUri:o,reconnect:L,wallet:s}),V=c&&(s.name==="WalletConnect"?v.t("connect_scan.fallback_title"):v.t("connect_scan.title",{wallet:s.name})),ee=x?N?null:"NONE":null,ae=x?N?()=>{}:X:()=>{};break;case"DOWNLOAD_OPTIONS":G=s&&Ae.createElement(eRt,{changeWalletStep:re,wallet:s}),V=s&&v.t("get_options.short_title",{wallet:s.name}),ee=N?"CONNECT":x?"NONE":pe;break;case"DOWNLOAD":G=s&&Ae.createElement(tRt,{changeWalletStep:re,wallet:s}),V=s&&v.t("get_mobile.title",{wallet:s.name}),ee=Ne?"DOWNLOAD_OPTIONS":pe;break;case"INSTRUCTIONS_MOBILE":G=s&&Ae.createElement(nRt,{connectWallet:ne,wallet:s}),V=s&&v.t("get_options.title",{wallet:x&&s.shortName||s.name}),ee="DOWNLOAD";break;case"INSTRUCTIONS_EXTENSION":G=s&&Ae.createElement(rRt,{wallet:s}),V=s&&v.t("get_options.title",{wallet:x&&s.shortName||s.name}),ee="DOWNLOAD_OPTIONS";break;case"INSTRUCTIONS_DESKTOP":G=s&&Ae.createElement(sRt,{connectWallet:ne,wallet:s}),V=s&&v.t("get_options.title",{wallet:x&&s.shortName||s.name}),ee="DOWNLOAD_OPTIONS";break}return Ae.createElement(wn,{display:"flex",flexDirection:"row",style:{maxHeight:x?468:504}},(x?ie==="NONE":!0)&&Ae.createElement(wn,{className:x?KMt:GMt,display:"flex",flexDirection:"column",marginTop:"16"},Ae.createElement(wn,{display:"flex",justifyContent:"space-between"},x&&g&&Ae.createElement(wn,{marginLeft:"16",width:"28"},Ae.createElement(IMt,{onClick:()=>re("LEARN_COMPACT")})),x&&!g&&Ae.createElement(wn,{marginLeft:"16",width:"28"}),Ae.createElement(wn,{marginLeft:x?"0":"6",paddingBottom:"8",paddingTop:"2",paddingX:"18"},Ae.createElement(Os,{as:"h1",color:"modalText",id:t,size:"18",weight:"heavy",testId:"connect-header-label"},v.t("connect.title"))),x&&Ae.createElement(wn,{marginRight:"16"},Ae.createElement(W3,{onClose:e}))),Ae.createElement(wn,{className:qMt,paddingBottom:"18"},Object.entries(F).map(([he,ge],ye)=>ge.length>0&&Ae.createElement(m.Fragment,{key:ye},he?Ae.createElement(wn,{marginBottom:"8",marginTop:"16",marginX:"6"},Ae.createElement(Os,{color:he==="Installed"?"accentColor":"modalTextSecondary",size:"14",weight:"bold"},U.includes(he)?v.t(`connector_group.${he.toLowerCase()}`):he)):null,Ae.createElement(wn,{display:"flex",flexDirection:"column",gap:"4"},ge.map(ve=>Ae.createElement(rLe,{currentlySelected:ve.id===n,iconBackground:ve.iconBackground,iconUrl:ve.iconUrl,key:ve.id,name:ve.name,onClick:()=>ne(ve),ready:ve.ready,recent:ve.recent,testId:`wallet-option-${ve.id}`,isRainbowKitConnector:ve.isRainbowKitConnector})))))),x&&Ae.createElement(Ae.Fragment,null,Ae.createElement(wn,{background:"generalBorder",height:"1",marginTop:"-1"}),g?Ae.createElement(wn,{paddingX:"24",paddingY:"16",textAlign:"center"},Ae.createElement(g,{Link:ple,Text:mle})):Ae.createElement(wn,{alignItems:"center",display:"flex",justifyContent:"space-between",paddingX:"24",paddingY:"16"},Ae.createElement(wn,{paddingY:"4"},Ae.createElement(Os,{color:"modalTextSecondary",size:"14",weight:"medium"},v.t("connect.new_to_ethereum.description"))),Ae.createElement(wn,{alignItems:"center",display:"flex",flexDirection:"row",gap:"4",justifyContent:"center"},Ae.createElement(wn,{className:iu({active:"shrink",hover:"grow"}),cursor:"pointer",onClick:()=>re("LEARN_COMPACT"),paddingY:"4",style:{willChange:"transform"},transition:"default"},Ae.createElement(Os,{color:"accentColor",size:"14",weight:"bold"},v.t("connect.new_to_ethereum.learn_more.label"))))))),(x?ie!=="NONE":!0)&&Ae.createElement(Ae.Fragment,null,!x&&Ae.createElement(wn,{background:"generalBorder",minWidth:"1",width:"1"}),Ae.createElement(wn,{display:"flex",flexDirection:"column",margin:"16",style:{flexGrow:1}},Ae.createElement(wn,{alignItems:"center",display:"flex",justifyContent:"space-between",marginBottom:"12"},Ae.createElement(wn,{width:"28"},ee&&Ae.createElement(wn,{as:"button",className:iu({active:"shrinkSm",hover:"growLg"}),color:"accentColor",onClick:()=>{ee&&re(ee,!0),ae==null||ae()},paddingX:"8",paddingY:"4",style:{boxSizing:"content-box",height:17,willChange:"transform"},transition:"default",type:"button"},Ae.createElement(tLe,null))),Ae.createElement(wn,{display:"flex",justifyContent:"center",style:{flexGrow:1}},V&&Ae.createElement(Os,{color:"modalText",size:"18",textAlign:"center",weight:"heavy"},V)),Ae.createElement(W3,{onClose:e})),Ae.createElement(wn,{display:"flex",flexDirection:"column",style:{minHeight:x?396:432}},Ae.createElement(wn,{alignItems:"center",display:"flex",flexDirection:"column",gap:"6",height:"full",justifyContent:"center",marginX:"8"},G)))))}var aRt="_1am14412",oRt="_1am14410",lRt="_1am14413",cRt=({wallet:e})=>Ae.createElement("svg",{className:lRt,viewBox:"0 0 86 86",width:"86",height:"86"},Ae.createElement("title",null,"Loading"),Ae.createElement("rect",{x:"3",y:"3",width:80,height:80,rx:20,ry:20,strokeDasharray:`${160/3} ${2*160/3}`,strokeDashoffset:160,className:aRt,style:{stroke:(e==null?void 0:e.iconAccent)||"#0D3887"}}));function hLe({onClose:e,wallet:t,connecting:n}){const{connect:r,iconBackground:s,iconUrl:a,id:o,name:l,getMobileUri:c,ready:u,shortName:d,showWalletConnectModal:f}=t,x=nLe(a),g=m.useRef(!1),{i18n:v}=m.useContext(cc),w=m.useCallback(async()=>{if(o!=="walletConnect"&&(async()=>{const N=await(c==null?void 0:c());if(N)if(N&&KOt({mobileUri:N,name:l}),N.startsWith("http")){const P=document.createElement("a");P.href=N,P.target="_blank",P.rel="noreferrer noopener",P.click()}else window.location.href=N})(),f){f(),e==null||e();return}r==null||r()},[r,c,f,e,l,o]);return m.useEffect(()=>{n&&!g.current&&(w(),g.current=!0)},[n,w]),Ae.createElement(wn,{as:"button",color:u?"modalText":"modalTextSecondary",disabled:!u,fontFamily:"body",key:o,onClick:w,ref:x,style:{overflow:"visible",textAlign:"center"},testId:`wallet-option-${o}`,type:"button",width:"full"},Ae.createElement(wn,{alignItems:"center",display:"flex",flexDirection:"column",justifyContent:"center"},Ae.createElement(wn,{display:"flex",alignItems:"center",justifyContent:"center",paddingBottom:"8",paddingTop:"10",position:"relative"},n?Ae.createElement(cRt,{wallet:t}):null,Ae.createElement(Pc,{background:s,borderRadius:"13",boxShadow:"walletLogo",height:"60",src:a,width:"60"})),n?null:Ae.createElement(wn,{display:"flex",flexDirection:"column",textAlign:"center"},Ae.createElement(Os,{as:"h2",color:t.ready?"modalText":"modalTextSecondary",size:"13",weight:"medium"},Ae.createElement(wn,{as:"span",position:"relative"},d??l,!t.ready&&" (unsupported)")),t.recent&&Ae.createElement(Os,{color:"accentColor",size:"12",weight:"medium"},v.t("connect.recent")))))}function uRt({onClose:e}){var g;const t="rk_connect_title",n=e_().filter(v=>v.isRainbowKitConnector),{disclaimer:r,learnMoreUrl:s}=m.useContext(iT);let a=null,o=null,l=!1,c=null;const[u,d]=m.useState("CONNECT"),{i18n:f}=m.useContext(cc),x=b5();switch(u){case"CONNECT":{a=f.t("connect.title"),l=!0,o=Ae.createElement(wn,null,Ae.createElement(wn,{background:"profileForeground",className:oRt,display:"flex",paddingBottom:"20",paddingTop:"6"},Ae.createElement(wn,{display:"flex",style:{margin:"0 auto"}},n.filter(v=>v.ready).map(v=>Ae.createElement(wn,{key:v.id,paddingX:"20"},Ae.createElement(wn,{width:"60"},Ae.createElement(hLe,{onClose:e,wallet:v})))))),Ae.createElement(wn,{background:"generalBorder",height:"1",marginBottom:"32",marginTop:"-1"}),Ae.createElement(wn,{alignItems:"center",display:"flex",flexDirection:"column",gap:"32",paddingX:"32",style:{textAlign:"center"}},Ae.createElement(wn,{display:"flex",flexDirection:"column",gap:"8",textAlign:"center"},Ae.createElement(Os,{color:"modalText",size:"16",weight:"bold"},f.t("intro.title")),Ae.createElement(Os,{color:"modalTextSecondary",size:"16"},f.t("intro.description")))),Ae.createElement(wn,{paddingTop:"32",paddingX:"20"},Ae.createElement(wn,{display:"flex",gap:"14",justifyContent:"center"},Ae.createElement(hd,{label:f.t("intro.get.label"),onClick:()=>d("GET"),size:"large",type:"secondary"}),Ae.createElement(hd,{href:s,label:f.t("intro.learn_more.label"),size:"large",type:"secondary"}))),r&&Ae.createElement(wn,{marginTop:"28",marginX:"32",textAlign:"center"},Ae.createElement(r,{Link:ple,Text:mle})));break}case"GET":{a=f.t("get.title"),c="CONNECT";const v=(g=n==null?void 0:n.filter(w=>{var C,N,P;return((C=w.downloadUrls)==null?void 0:C.ios)||((N=w.downloadUrls)==null?void 0:N.android)||((P=w.downloadUrls)==null?void 0:P.mobile)}))==null?void 0:g.splice(0,3);o=Ae.createElement(wn,null,Ae.createElement(wn,{alignItems:"center",display:"flex",flexDirection:"column",height:"full",marginBottom:"36",marginTop:"5",paddingTop:"12",width:"full"},v.map((w,C)=>{const{downloadUrls:N,iconBackground:P,iconUrl:I,name:R}=w;return!(N!=null&&N.ios)&&!(N!=null&&N.android)&&!(N!=null&&N.mobile)?null:Ae.createElement(wn,{display:"flex",gap:"16",key:w.id,paddingX:"20",width:"full"},Ae.createElement(wn,{style:{minHeight:48,minWidth:48}},Ae.createElement(Pc,{background:P,borderColor:"generalBorder",borderRadius:"10",height:"48",src:I,width:"48"})),Ae.createElement(wn,{display:"flex",flexDirection:"column",width:"full"},Ae.createElement(wn,{alignItems:"center",display:"flex",height:"48"},Ae.createElement(wn,{width:"full"},Ae.createElement(Os,{color:"modalText",size:"18",weight:"bold"},R)),Ae.createElement(hd,{href:(x?N==null?void 0:N.ios:N==null?void 0:N.android)||(N==null?void 0:N.mobile),label:f.t("get.action.label"),size:"small",type:"secondary"})),C<v.length-1&&Ae.createElement(wn,{background:"generalBorderDim",height:"1",marginY:"10",width:"full"})))})),Ae.createElement(wn,{style:{marginBottom:"42px"}}),Ae.createElement(wn,{alignItems:"center",display:"flex",flexDirection:"column",gap:"36",paddingX:"36",style:{textAlign:"center"}},Ae.createElement(wn,{display:"flex",flexDirection:"column",gap:"12",textAlign:"center"},Ae.createElement(Os,{color:"modalText",size:"16",weight:"bold"},f.t("get.looking_for.title")),Ae.createElement(Os,{color:"modalTextSecondary",size:"16"},f.t("get.looking_for.mobile.description")))));break}}return Ae.createElement(wn,{display:"flex",flexDirection:"column",paddingBottom:"36"},Ae.createElement(wn,{background:l?"profileForeground":"modalBackground",display:"flex",flexDirection:"column",paddingBottom:"4",paddingTop:"14"},Ae.createElement(wn,{display:"flex",justifyContent:"center",paddingBottom:"6",paddingX:"20",position:"relative"},c&&Ae.createElement(wn,{display:"flex",position:"absolute",style:{left:0,marginBottom:-20,marginTop:-20}},Ae.createElement(wn,{alignItems:"center",as:"button",className:iu({active:"shrinkSm",hover:"growLg"}),color:"accentColor",display:"flex",marginLeft:"4",marginTop:"20",onClick:()=>d(c),padding:"16",style:{height:17,willChange:"transform"},transition:"default",type:"button"},Ae.createElement(tLe,null))),Ae.createElement(wn,{marginTop:"4",textAlign:"center",width:"full"},Ae.createElement(Os,{as:"h1",color:"modalText",id:t,size:"20",weight:"bold"},a)),Ae.createElement(wn,{alignItems:"center",display:"flex",height:"32",paddingRight:"14",position:"absolute",right:"0"},Ae.createElement(wn,{style:{marginBottom:-20,marginTop:-20}},Ae.createElement(W3,{onClose:e}))))),Ae.createElement(wn,{display:"flex",flexDirection:"column"},o))}var dRt=({onClose:e})=>{const{connector:t}=m.useContext(aT),{i18n:n}=m.useContext(cc),r=(t==null?void 0:t.name)||"";return Ae.createElement(wn,null,Ae.createElement(wn,{display:"flex",paddingBottom:"32",justifyContent:"center",alignItems:"center",background:"profileForeground",flexDirection:"column"},Ae.createElement(wn,{width:"full",display:"flex",justifyContent:"flex-end",marginTop:"18",marginRight:"24"},Ae.createElement(W3,{onClose:e})),Ae.createElement(wn,{width:"60"},Ae.createElement(hLe,{onClose:e,wallet:t,connecting:!0})),Ae.createElement(wn,{marginTop:"20"},Ae.createElement(Os,{textAlign:"center",color:"modalText",size:"18",weight:"semibold"},n.t("connect.status.connect_mobile",{wallet:r}))),Ae.createElement(wn,{maxWidth:"full",marginTop:"8"},Ae.createElement(Os,{textAlign:"center",color:"modalText",size:"16",weight:"medium"},n.t("connect.status.confirm_mobile",{wallet:r})))))};function fRt({onClose:e}){const{connector:t}=m.useContext(aT);return ou()?t?Ae.createElement(dRt,{onClose:e}):Ae.createElement(uRt,{onClose:e}):Ae.createElement(iRt,{onClose:e})}function hRt({onClose:e,open:t}){const n="rk_connect_title",r=ARe(),{disconnect:s}=wB(),{isConnecting:a}=ns(),o=Ae.useCallback(()=>{e(),s()},[e,s]),l=Ae.useCallback(()=>{a&&s(),e()},[e,s,a]);return r==="disconnected"?Ae.createElement(RR,{onClose:l,open:t,titleId:n},Ae.createElement(LR,{bottomSheetOnMobile:!0,padding:"0",wide:!0},Ae.createElement(fRt,{onClose:l}))):r==="unauthenticated"?Ae.createElement(RR,{onClose:o,open:t,titleId:n},Ae.createElement(LR,{bottomSheetOnMobile:!0,padding:"0"},Ae.createElement(qOt,{onClose:o,onCloseModal:e}))):null}function fW(){const[e,t]=m.useState(!1);return{closeModal:m.useCallback(()=>t(!1),[]),isModalOpen:e,openModal:m.useCallback(()=>t(!0),[])}}var zA=m.createContext({accountModalOpen:!1,chainModalOpen:!1,connectModalOpen:!1,isWalletConnectModalOpen:!1,setIsWalletConnectModalOpen:()=>{}});function pRt({children:e}){const{closeModal:t,isModalOpen:n,openModal:r}=fW(),{closeModal:s,isModalOpen:a,openModal:o}=fW(),{closeModal:l,isModalOpen:c,openModal:u}=fW(),[d,f]=m.useState(!1),x=ARe(),{chainId:g}=ns(),{chains:v}=Al(),w=v.some(P=>P.id===g),C=m.useCallback(({keepConnectModalOpen:P=!1}={})=>{P||t(),s(),l()},[t,s,l]),N=j$()==="unauthenticated";return n_e({onConnect:()=>C({keepConnectModalOpen:N}),onDisconnect:()=>C()}),m.useEffect(()=>{N&&C()},[N,C]),Ae.createElement(zA.Provider,{value:m.useMemo(()=>({accountModalOpen:a,chainModalOpen:c,connectModalOpen:n,isWalletConnectModalOpen:d,openAccountModal:w&&x==="connected"?o:void 0,openChainModal:x==="connected"?u:void 0,openConnectModal:x==="disconnected"||x==="unauthenticated"?r:void 0,setIsWalletConnectModalOpen:f}),[x,a,c,n,o,u,r,w,d])},e,Ae.createElement(hRt,{onClose:t,open:n}),Ae.createElement(wMt,{onClose:s,open:a}),Ae.createElement(_Mt,{onClose:l,open:c}))}function mRt(){const{accountModalOpen:e,chainModalOpen:t,connectModalOpen:n}=m.useContext(zA);return{accountModalOpen:e,chainModalOpen:t,connectModalOpen:n}}function xRt(){const{accountModalOpen:e,openAccountModal:t}=m.useContext(zA);return{accountModalOpen:e,openAccountModal:t}}function gRt(){const{chainModalOpen:e,openChainModal:t}=m.useContext(zA);return{chainModalOpen:e,openChainModal:t}}function pLe(){const{isWalletConnectModalOpen:e,setIsWalletConnectModalOpen:t}=m.useContext(zA);return{isWalletConnectModalOpen:e,setIsWalletConnectModalOpen:t}}function y5(){const{connectModalOpen:e,openConnectModal:t}=m.useContext(zA),{isWalletConnectModalOpen:n}=pLe();return{connectModalOpen:e||n,openConnectModal:t}}var hW=()=>{};function bRt({children:e}){const t=ZFt(),{address:n}=ns(),{chainId:r}=ns(),{chains:s}=Al(),a=s.some(X=>X.id===r),o=YFt(),l=j$()??void 0,c=r?o[r]:void 0,u=(c==null?void 0:c.name)??void 0,d=(c==null?void 0:c.iconUrl)??void 0,f=(c==null?void 0:c.iconBackground)??void 0,x=ile(d),g=m.useContext(lle),v=LRe().some(({status:X})=>X==="pending")&&g,{showBalance:w}=QFt(),N=typeof w=="boolean"?w:w?xFt(w)[ou()?"smallScreen":"largeScreen"]:!0,{balance:P,ensAvatar:I,ensName:R}=FRe({address:n,includeBalance:N}),F=P?`${XRe(Number.parseFloat(P.formatted))} ${P.symbol}`:void 0,{openConnectModal:U}=y5(),{openChainModal:L}=gRt(),{openAccountModal:z}=xRt(),{accountModalOpen:Q,chainModalOpen:ne,connectModalOpen:J}=mRt();return Ae.createElement(Ae.Fragment,null,e({account:n?{address:n,balanceDecimals:P==null?void 0:P.decimals,balanceFormatted:P==null?void 0:P.formatted,balanceSymbol:P==null?void 0:P.symbol,displayBalance:F,displayName:R?ZRe(R):QRe(n),ensAvatar:I??void 0,ensName:R??void 0,hasPendingTransactions:v}:void 0,accountModalOpen:Q,authenticationStatus:l,chain:r?{hasIcon:!!d,iconBackground:f,iconUrl:x,id:r,name:u,unsupported:!a}:void 0,chainModalOpen:ne,connectModalOpen:J,mounted:t(),openAccountModal:z??hW,openChainModal:L??hW,openConnectModal:U??hW}))}bRt.displayName="ConnectButton.Custom";var mLe=({appName:e,appDescription:t,appUrl:n,appIcon:r})=>({name:e,description:t??e,url:n??(typeof window<"u"?window.location.href:""),icons:[...r?[r]:[]]});function yRt(e){return Object.fromEntries(Object.entries(e).filter(([t,n])=>n!==void 0))}function vRt(e,t){const n=[];for(const r of e)n.some(s=>s[t]===r[t])||n.push(r);return n}var wRt=(e,{projectId:t,walletConnectParameters:n,appName:r,appDescription:s,appUrl:a,appIcon:o})=>{if(!e.length)throw new Error("No wallet list was provided");for(const{wallets:g,groupName:v}of e)if(!g.length)throw new Error(`No wallets provided for group: ${v}`);let l=-1;const c=[],u=[],d=[],f=mLe({appName:r,appDescription:s,appUrl:a,appIcon:o});for(const[g,{groupName:v,wallets:w}]of e.entries())for(const C of w){l++;const N=C({projectId:t,appName:r,appIcon:o,options:{metadata:f,...n},walletConnectParameters:{metadata:f,...n}});if(N!=null&&N.iconAccent&&!DMt(N==null?void 0:N.iconAccent))throw new Error(`Property \`iconAccent\` is not a hex value for wallet: ${N.name}`);const P={...N,groupIndex:g+1,groupName:v,index:l};typeof N.hidden=="function"?d.push(P):u.push(P)}const x=vRt([...u,...d],"id");for(const{createConnector:g,groupIndex:v,groupName:w,hidden:C,...N}of x){if(typeof C=="function"&&C())continue;const P=F=>({rkDetails:yRt({...N,groupIndex:v,groupName:w,isRainbowKitConnector:!0,...F||{}})});N.id==="walletConnect"&&c.push(g(P({isWalletConnectModalConnector:!0,showQrModal:!0})));const R=g(P());c.push(R)}return c},vbe=new Map,CRt=({projectId:e,walletConnectParameters:t,rkDetailsShowQrModal:n})=>{let r={...t||{},projectId:e,showQrModal:!1};n&&(r={...r,showQrModal:!0});const s=JSON.stringify(r),a=vbe.get(s);if(a)return a;const o=rle(r);return vbe.set(s,o),o};function SRt({projectId:e,walletDetails:t,walletConnectParameters:n}){return r=>({...CRt({projectId:e,walletConnectParameters:n,rkDetailsShowQrModal:t.rkDetails.showQrModal})(r),...t})}function xle({projectId:e,walletConnectParameters:t}){const n="21fef48091f12692cad574a6f7753643";if(!e||e==="")throw new Error("No projectId found. Every dApp must now provide a WalletConnect Cloud projectId to enable WalletConnect v2 https://www.rainbowkit.com/docs/installation#configure");return e==="YOUR_PROJECT_ID"&&(e=n),r=>SRt({projectId:e,walletDetails:r,walletConnectParameters:t})}function xLe(e){const t=typeof window<"u"?window:void 0;if(typeof t>"u"||typeof t.ethereum>"u")return;const n=t.ethereum.providers;return n?n.find(r=>r[e]):t.ethereum[e]?t.ethereum:void 0}function gLe(e){const t=(n,r)=>{const[s,...a]=r.split("."),o=n[s];if(o)return a.length===0?o:t(o,a.join("."))};if(typeof window<"u")return t(window,e)}function bLe({flag:e,namespace:t}){return!!(t&&typeof gLe(t)<"u"||e&&typeof xLe(e)<"u")}function NRt({flag:e,namespace:t}){var s;const n=typeof window<"u"?window:void 0;if(typeof n>"u")return;if(t){const a=gLe(t);if(a)return a}const r=(s=n.ethereum)==null?void 0:s.providers;if(e){const a=xLe(e);if(a)return a}return typeof r<"u"&&r.length>0?r[0]:n.ethereum}function ARt(e){return t=>{const n=e?{target:()=>({id:t.rkDetails.id,name:t.rkDetails.name,provider:e})}:{};return r=>({...bB(n)(r),...t})}}function yLe({flag:e,namespace:t,target:n}){const r=n||NRt({flag:e,namespace:t});return ARt(r)}var vLe=({appName:e,appIcon:t})=>{const n=s=>s,r=b5();return{id:"coinbase",name:"Coinbase Wallet",shortName:"Coinbase",rdns:"com.coinbase.wallet",iconUrl:async()=>(await as(async()=>{const{default:s}=await import("./coinbaseWallet-WWX6LF36-BMRj6mTC.js");return{default:s}},[])).default,iconAccent:"#2c5ff6",iconBackground:"#2c5ff6",installed:!0,downloadUrls:{android:"https://play.google.com/store/apps/details?id=org.toshi",ios:"https://apps.apple.com/us/app/coinbase-wallet-store-crypto/id1278383455",mobile:"https://coinbase.com/wallet/downloads",qrCode:"https://coinbase-wallet.onelink.me/q5Sx/fdb9b250",chrome:"https://chrome.google.com/webstore/detail/coinbase-wallet-extension/hnfanknocfeofbddgcijnmhnfnkdnaad",browserExtension:"https://coinbase.com/wallet"},...r?{}:{qrCode:{getUri:n,instructions:{learnMoreUrl:"https://coinbase.com/wallet/articles/getting-started-mobile",steps:[{description:"wallet_connectors.coinbase.qr_code.step1.description",step:"install",title:"wallet_connectors.coinbase.qr_code.step1.title"},{description:"wallet_connectors.coinbase.qr_code.step2.description",step:"create",title:"wallet_connectors.coinbase.qr_code.step2.title"},{description:"wallet_connectors.coinbase.qr_code.step3.description",step:"scan",title:"wallet_connectors.coinbase.qr_code.step3.title"}]}},extension:{instructions:{learnMoreUrl:"https://coinbase.com/wallet/articles/getting-started-extension",steps:[{description:"wallet_connectors.coinbase.extension.step1.description",step:"install",title:"wallet_connectors.coinbase.extension.step1.title"},{description:"wallet_connectors.coinbase.extension.step2.description",step:"create",title:"wallet_connectors.coinbase.extension.step2.title"},{description:"wallet_connectors.coinbase.extension.step3.description",step:"refresh",title:"wallet_connectors.coinbase.extension.step3.title"}]}}},createConnector:s=>{const a=A$({appName:e,appLogoUrl:t,preference:vLe.preference});return o=>({...a(o),...s})}}};function jRt(e){return!(!(e!=null&&e.isMetaMask)||e.isBraveWallet&&!e._events&&!e._state||e.isApexWallet||e.isAvalanche||e.isBackpack||e.isBifrost||e.isBitKeep||e.isBitski||e.isBlockWallet||e.isCoinbaseWallet||e.isDawn||e.isEnkrypt||e.isExodus||e.isFrame||e.isFrontier||e.isGamestop||e.isHyperPay||e.isImToken||e.isKuCoinWallet||e.isMathWallet||e.isNestWallet||e.isOkxWallet||e.isOKExWallet||e.isOneInchIOSWallet||e.isOneInchAndroidWallet||e.isOpera||e.isPhantom||e.isPortal||e.isRabby||e.isRainbow||e.isStatus||e.isTalisman||e.isTally||e.isTokenPocket||e.isTokenary||e.isTrust||e.isTrustWallet||e.isXDEFI||e.isZeal||e.isZerion||e.__seif)}var ERt=({projectId:e,walletConnectParameters:t})=>{var a,o;const n=bLe({flag:"isMetaMask"}),r=!n,s=l=>sle()?l:b5()?`metamask://wc?uri=${encodeURIComponent(l)}`:`https://metamask.app.link/wc?uri=${encodeURIComponent(l)}`;return{id:"metaMask",name:"MetaMask",rdns:"io.metamask",iconUrl:async()=>(await as(async()=>{const{default:l}=await import("./metaMaskWallet-YFHEHW7V-BggUDXad.js");return{default:l}},[])).default,iconAccent:"#f6851a",iconBackground:"#fff",installed:r?void 0:n,downloadUrls:{android:"https://play.google.com/store/apps/details?id=io.metamask",ios:"https://apps.apple.com/us/app/metamask/id1438144202",mobile:"https://metamask.io/download",qrCode:"https://metamask.io/download",chrome:"https://chrome.google.com/webstore/detail/metamask/nkbihfbeogaeaoehlefnkodbefgpgknn",edge:"https://microsoftedge.microsoft.com/addons/detail/metamask/ejbalbakoplchlghecdalmeeeajnimhm",firefox:"https://addons.mozilla.org/firefox/addon/ether-metamask",opera:"https://addons.opera.com/extensions/details/metamask-10",browserExtension:"https://metamask.io/download"},mobile:{getUri:r?s:void 0},qrCode:r?{getUri:s,instructions:{learnMoreUrl:"https://metamask.io/faqs/",steps:[{description:"wallet_connectors.metamask.qr_code.step1.description",step:"install",title:"wallet_connectors.metamask.qr_code.step1.title"},{description:"wallet_connectors.metamask.qr_code.step2.description",step:"create",title:"wallet_connectors.metamask.qr_code.step2.title"},{description:"wallet_connectors.metamask.qr_code.step3.description",step:"refresh",title:"wallet_connectors.metamask.qr_code.step3.title"}]}}:void 0,extension:{instructions:{learnMoreUrl:"https://metamask.io/faqs/",steps:[{description:"wallet_connectors.metamask.extension.step1.description",step:"install",title:"wallet_connectors.metamask.extension.step1.title"},{description:"wallet_connectors.metamask.extension.step2.description",step:"create",title:"wallet_connectors.metamask.extension.step2.title"},{description:"wallet_connectors.metamask.extension.step3.description",step:"refresh",title:"wallet_connectors.metamask.extension.step3.title"}]}},createConnector:r?xle({projectId:e,walletConnectParameters:t}):yLe({target:typeof window<"u"?((o=(a=window.ethereum)==null?void 0:a.providers)==null?void 0:o.find(jRt))??window.ethereum:void 0})}},_Rt=({projectId:e,walletConnectParameters:t})=>{const n=bLe({flag:"isRainbow"}),r=!n,s=a=>sle()?a:b5()?`rainbow://wc?uri=${encodeURIComponent(a)}&connector=rainbowkit`:`https://rnbwapp.com/wc?uri=${encodeURIComponent(a)}&connector=rainbowkit`;return{id:"rainbow",name:"Rainbow",rdns:"me.rainbow",iconUrl:async()=>(await as(async()=>{const{default:a}=await import("./rainbowWallet-2SR6TVBF-kimcGeuf.js");return{default:a}},[])).default,iconBackground:"#0c2f78",installed:r?void 0:n,downloadUrls:{android:"https://play.google.com/store/apps/details?id=me.rainbow&referrer=utm_source%3Drainbowkit&utm_source=rainbowkit",ios:"https://apps.apple.com/app/apple-store/id1457119021?pt=119997837&ct=rainbowkit&mt=8",mobile:"https://rainbow.download?utm_source=rainbowkit",qrCode:"https://rainbow.download?utm_source=rainbowkit&utm_medium=qrcode",browserExtension:"https://rainbow.me/extension?utm_source=rainbowkit"},mobile:{getUri:r?s:void 0},qrCode:r?{getUri:s,instructions:{learnMoreUrl:"https://learn.rainbow.me/connect-to-a-website-or-app?utm_source=rainbowkit&utm_medium=connector&utm_campaign=learnmore",steps:[{description:"wallet_connectors.rainbow.qr_code.step1.description",step:"install",title:"wallet_connectors.rainbow.qr_code.step1.title"},{description:"wallet_connectors.rainbow.qr_code.step2.description",step:"create",title:"wallet_connectors.rainbow.qr_code.step2.title"},{description:"wallet_connectors.rainbow.qr_code.step3.description",step:"scan",title:"wallet_connectors.rainbow.qr_code.step3.title"}]}}:void 0,createConnector:r?xle({projectId:e,walletConnectParameters:t}):yLe({flag:"isRainbow"})}},kRt=()=>({id:"safe",name:"Safe",iconAccent:"#12ff80",iconBackground:"#fff",iconUrl:async()=>(await as(async()=>{const{default:e}=await import("./safeWallet-VUYZPLY4-CXnodgMs.js");return{default:e}},[])).default,installed:!(typeof window>"u")&&(window==null?void 0:window.parent)!==window,downloadUrls:{},createConnector:e=>t=>({...nle()(t),...e})}),TRt=({projectId:e,options:t})=>({id:"walletConnect",name:"WalletConnect",installed:void 0,iconUrl:async()=>(await as(async()=>{const{default:r}=await import("./walletConnectWallet-FNSU4KNU-B0ci71fU.js");return{default:r}},[])).default,iconBackground:"#3b99fc",qrCode:{getUri:r=>r},createConnector:xle({projectId:e,walletConnectParameters:t})}),IRt=e=>e.reduce((n,r)=>{const s=r.id;return n[s]=uj(),n},{}),PRt=({appName:e,appDescription:t,appUrl:n,appIcon:r,wallets:s,projectId:a,...o})=>{const{transports:l,chains:c,...u}=o,d=mLe({appName:e,appDescription:t,appUrl:n,appIcon:r}),f=wRt(s||[{groupName:"Popular",wallets:[kRt,_Rt,vLe,ERt,TRt]}],{projectId:a,appName:e,appDescription:t,appUrl:n,appIcon:r,walletConnectParameters:{metadata:d}});return K0t({connectors:f,chains:c,transports:l||IRt(c),...u})};function FRt({title:e,titleId:t,...n},r){return m.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?m.createElement("title",{id:t},e):null,m.createElement("path",{fillRule:"evenodd",d:"M13.836 2.477a.75.75 0 0 1 .75.75v3.182a.75.75 0 0 1-.75.75h-3.182a.75.75 0 0 1 0-1.5h1.37l-.84-.841a4.5 4.5 0 0 0-7.08.932.75.75 0 0 1-1.3-.75 6 6 0 0 1 9.44-1.242l.842.84V3.227a.75.75 0 0 1 .75-.75Zm-.911 7.5A.75.75 0 0 1 13.199 11a6 6 0 0 1-9.44 1.241l-.84-.84v1.371a.75.75 0 0 1-1.5 0V9.591a.75.75 0 0 1 .75-.75H5.35a.75.75 0 0 1 0 1.5H3.98l.841.841a4.5 4.5 0 0 0 7.08-.932.75.75 0 0 1 1.025-.273Z",clipRule:"evenodd"}))}const wbe=m.forwardRef(FRt);function ORt({title:e,titleId:t,...n},r){return m.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?m.createElement("title",{id:t},e):null,m.createElement("path",{fillRule:"evenodd",d:"M8 14a.75.75 0 0 1-.75-.75V4.56L4.03 7.78a.75.75 0 0 1-1.06-1.06l4.5-4.5a.75.75 0 0 1 1.06 0l4.5 4.5a.75.75 0 0 1-1.06 1.06L8.75 4.56v8.69A.75.75 0 0 1 8 14Z",clipRule:"evenodd"}))}const xy=m.forwardRef(ORt);function MRt({title:e,titleId:t,...n},r){return m.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?m.createElement("title",{id:t},e):null,m.createElement("path",{fillRule:"evenodd",d:"M4.22 6.22a.75.75 0 0 1 1.06 0L8 8.94l2.72-2.72a.75.75 0 1 1 1.06 1.06l-3.25 3.25a.75.75 0 0 1-1.06 0L4.22 7.28a.75.75 0 0 1 0-1.06Z",clipRule:"evenodd"}))}const RRt=m.forwardRef(MRt);function LRt({title:e,titleId:t,...n},r){return m.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?m.createElement("title",{id:t},e):null,m.createElement("path",{fillRule:"evenodd",d:"M8.75 2.5a.75.75 0 0 0-1.5 0v.508a32.661 32.661 0 0 0-4.624.434.75.75 0 0 0 .246 1.48l.13-.021-1.188 4.75a.75.75 0 0 0 .33.817A3.487 3.487 0 0 0 4 11c.68 0 1.318-.195 1.856-.532a.75.75 0 0 0 .33-.818l-1.25-5a31.31 31.31 0 0 1 2.314-.141V12.012c-.882.027-1.752.104-2.607.226a.75.75 0 0 0 .213 1.485 22.188 22.188 0 0 1 6.288 0 .75.75 0 1 0 .213-1.485 23.657 23.657 0 0 0-2.607-.226V4.509c.779.018 1.55.066 2.314.14L9.814 9.65a.75.75 0 0 0 .329.818 3.487 3.487 0 0 0 1.856.532c.68 0 1.318-.195 1.856-.532a.75.75 0 0 0 .33-.818L12.997 4.9l.13.022a.75.75 0 1 0 .247-1.48 32.66 32.66 0 0 0-4.624-.434V2.5ZM3.42 9.415a2 2 0 0 0 1.16 0L4 7.092l-.58 2.323ZM12 9.5a2 2 0 0 1-.582-.085L12 7.092l.58 2.323A2 2 0 0 1 12 9.5Z",clipRule:"evenodd"}))}const DRt=m.forwardRef(LRt);function BRt({title:e,titleId:t,...n},r){return m.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?m.createElement("title",{id:t},e):null,m.createElement("path",{fillRule:"evenodd",d:"M5 3.25V4H2.75a.75.75 0 0 0 0 1.5h.3l.815 8.15A1.5 1.5 0 0 0 5.357 15h5.285a1.5 1.5 0 0 0 1.493-1.35l.815-8.15h.3a.75.75 0 0 0 0-1.5H11v-.75A2.25 2.25 0 0 0 8.75 1h-1.5A2.25 2.25 0 0 0 5 3.25Zm2.25-.75a.75.75 0 0 0-.75.75V4h3v-.75a.75.75 0 0 0-.75-.75h-1.5ZM6.05 6a.75.75 0 0 1 .787.713l.275 5.5a.75.75 0 0 1-1.498.075l-.275-5.5A.75.75 0 0 1 6.05 6Zm3.9 0a.75.75 0 0 1 .712.787l-.275 5.5a.75.75 0 0 1-1.498-.075l.275-5.5a.75.75 0 0 1 .786-.711Z",clipRule:"evenodd"}))}const $Rt=m.forwardRef(BRt),URt=()=>{const{address:e}=ns(),{disconnect:t}=wB(),{subsExpireDay:n}=m.useContext(Qr),[r,s]=m.useState(!1),a=c=>c<=3?"red":c<=7?"yellow":"green",o=Number(n)||0,l=a(o);return i.jsxs(i.Fragment,{children:[i.jsx(f5,{open:r,setOpen:s,handleListRequest:()=>{},handlePageChange:()=>{}}),i.jsxs(MD,{as:"div",className:"relative inline-block text-left font-manrope",children:[i.jsx("div",{children:i.jsxs(FD,{className:"bg-[#232323] hover:bg-[#404040] border-none rounded-[256px] justify-start items-center gap-2 inline-flex focus:outline-none focus:ring-0 py-1.5 pl-4 pr-3 text-[13px] font-semibold text-white",children:[window.localStorage.getItem("hyperAddress")&&e.slice(0,6)+"..."+e.slice(-4),i.jsx(RRt,{className:"size-4 fill-white/60"})]})}),i.jsx(OD,{transition:!0,anchor:"bottom end",className:"origin-top-right absolute right-0 top-10 w-36 rounded-xl px-2 py-2.5 text-sm/6 text-white transition duration-100 ease-out [--anchor-gap:var(--spacing-1)] focus:outline-none data-[closed]:scale-95 data-[closed]:opacity-0 z-[60]",children:i.jsx(EC,{children:i.jsxs("button",{className:"group flex flex-col gap-[6px] items-center rounded-lg px-1 py-2 focus:outline-none focus:ring-0 border-none origin-top-right bg-[#363636] border border-[#404040] shadow-lg ring-1 ring-black ring-opacity-5 z-20 h-max w-full",children:[i.jsxs("div",{onClick:()=>{window.open("/wallet-management#hyperliquid#add-account#hyperliquid","_blank")},className:"h-8 px-1 py-3 bg-[#7445ff] rounded-md shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-[#8860ff] flex justify-center items-center gap-1 cursor-pointer relative",children:[i.jsx("div",{"data-svg-wrapper":!0,children:i.jsxs("svg",{width:"19",height:"18",viewBox:"0 0 19 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("path",{d:"M5 9H14",stroke:"white",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),i.jsx("path",{d:"M9.5 13.5V4.5",stroke:"white",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})}),i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px] min-w-max -mb-[1px]",children:"Add Account"}),i.jsx("div",{className:"absolute -top-[15.5px] right-[1px]",children:i.jsx("img",{src:rke,alt:""})})]}),i.jsx("div",{onClick:()=>{window.open("/my-profile","_blank")},className:"h-8 w-[calc(100%-6px)] px-1 py-3 bg-[#7445ff] rounded-md shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-[#8860ff] flex justify-center items-center gap-1 cursor-pointer",children:i.jsxs("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px] min-w-max -mb-[1px] flex items-center gap-2",children:[l!=="green"&&i.jsx("span",{className:`${l==="red"?"bg-[#FF4A4A]":""} ${l==="yellow"?"bg-[#FFD447]":""} w-2 h-2 min-w-2 min-h-2 rounded-full inline-block live-dot`}),"My Profile"]})}),i.jsx("div",{onClick:()=>{t(),window.localStorage.removeItem("hyperAddress"),window.localStorage.removeItem("hyperToken"),window.dispatchEvent(new Event("localStorageUpdated"))},className:"py-2 px-3 text-13px rounded-md flex justify-between items-center hover:bg-[#404040] relative w-full",children:"Disconnect"})]})})})]})]})},zRt=()=>{const e=Vo(),[t,n]=m.useState(Date.now()),{isConnected:r,address:s,isDisconnected:a}=ns(),{walletLogin:o,signIn:l,hyperToken:c,hyperAddress:u,setTelegramChatId:d,setSubscriberRole:f,setSubsExpireDay:x,setIsReferralCode:g,setIsReferralCodeName:v,setMushboomerETH:w,setMushboomerSOL:C,setIsWhitelist:N,setHyperToken:P,setHyperAddress:I,setSignModalOpen:R,signInConnectButtonOpen:F,setSignInConnectButtonOpen:U}=m.useContext(Qr),{openConnectModal:L}=y5(),z=typeof window<"u"&&window.matchMedia("(max-width:640px)").matches;m.useEffect(()=>{!a&&s==null&&!z&&(window.localStorage.removeItem("hyperToken"),window.localStorage.removeItem("hyperAddress"),P(""),I(""))},[a]);const Q=()=>{window.localStorage.getItem("hyperToken")&&c?o():l(1)};m.useEffect(()=>{F&&(R(!0),U(!1))},[F]),m.useEffect(()=>{s!=null&&window.localStorage.getItem("hyperAddress")!=null&&window.localStorage.getItem("hyperAddress").toLowerCase()!==s.toLowerCase()&&!z&&(window.localStorage.removeItem("hyperToken"),P(""))},[s,u]);const ne=m.useRef(!1);return m.useEffect(()=>{const J=async()=>{var Y,ie;if(ne.current)return;ne.current=!0;const re=window.localStorage.getItem("hyperToken"),pe=window.localStorage.getItem("hyperAddress");if(!re||!pe){ne.current=!1;return}try{const oe=await Ei(pe.toLowerCase(),re);oe!=null&&oe.success?(d(oe==null?void 0:oe.telegram_chat_id),f(oe==null?void 0:oe.subscriber_role),x(oe==null?void 0:oe.subs_expire_day),w((Y=oe==null?void 0:oe.mushboomer_counts)==null?void 0:Y.eth),C((ie=oe==null?void 0:oe.mushboomer_counts)==null?void 0:ie.sol),g(oe==null?void 0:oe.referral_code),v(oe==null?void 0:oe.refcode),N(oe==null?void 0:oe.whitelist),P(re),I(pe)):(window.localStorage.removeItem("hyperAddress"),window.localStorage.removeItem("hyperToken"),P(""),I(""))}catch(oe){console.error("Token verification error:",oe),oe.response?console.error("Server Error Response:",oe.response):oe.message?console.error("Network or Other Error:",oe.message):console.error("Unknown Error:",oe)}finally{ne.current=!1}},X=()=>{if(document.visibilityState==="visible"){const re=Date.now();re-t>1e3&&J(),n(re)}};return document.addEventListener("visibilitychange",X),()=>{document.removeEventListener("visibilitychange",X)}},[e,t]),i.jsx(i.Fragment,{children:r?s&&window.localStorage.getItem("hyperAddress")?i.jsxs("div",{className:"sm:block relative font-manrope",children:[i.jsx(URt,{}),i.jsx("div",{className:"absolute right-4",children:(s==null?void 0:s.toLowerCase())!==window.localStorage.getItem("hyperAddress")?i.jsxs("div",{className:"flex justify-end font-manrope",children:[i.jsx("img",{src:Gbt,alt:""}),i.jsx("span",{className:"text-[#D35B5B] text-[10px] leading-4 font-medium",children:"Not connected"})]}):i.jsxs("div",{className:"flex justify-end font-manrope",children:[i.jsx("img",{src:Kbt,alt:""}),i.jsx("span",{className:"text-[#0A9C55] text-[10px] leading-4 font-medium",children:"Connected"})]})})]}):i.jsx("div",{onClick:J=>Q(),style:{background:"linear-gradient(98deg, #FFF1FF 0%, #6FDBBF 28.15%, #57DCF5 57.96%, #D834D8 98.77%)"},className:"h-[30.60px] rounded-[256px] justify-center items-center gap-2.5 sm:inline-flex w-[91px] p-[1.4px] cursor-pointer font-manrope",children:i.jsx("div",{className:"text-white text-sm font-medium font-manrope leading-none w-full h-full flex items-center justify-center rounded-[256px] bg-[#161616]",children:"Sign In"})}):i.jsx("div",{onClick:()=>{L(),U(!0)},style:{background:"linear-gradient(98deg, #FFF1FF 0%, #6FDBBF 28.15%, #57DCF5 57.96%, #D834D8 98.77%)"},className:"h-[30.60px] rounded-[256px] justify-center items-center gap-2.5 sm:inline-flex w-[91px] p-[1.4px] cursor-pointer",children:i.jsx("div",{className:"text-white text-sm font-medium font-manrope leading-none w-full h-full flex items-center justify-center rounded-[256px] bg-[#161616]",children:"Connect"})})})};var X6={},pW={exports:{}},mW,Cbe;function HRt(){if(Cbe)return mW;Cbe=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return mW=e,mW}var xW,Sbe;function VRt(){if(Sbe)return xW;Sbe=1;var e=HRt();function t(){}function n(){}return n.resetWarningCache=t,xW=function(){function r(o,l,c,u,d,f){if(f!==e){var x=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw x.name="Invariant Violation",x}}r.isRequired=r;function s(){return r}var a={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:s,element:r,elementType:r,instanceOf:s,node:r,objectOf:s,oneOf:s,oneOfType:s,shape:s,exact:s,checkPropTypes:n,resetWarningCache:t};return a.PropTypes=a,a},xW}var Nbe;function _$(){return Nbe||(Nbe=1,pW.exports=VRt()()),pW.exports}var gW,Abe;function wLe(){return Abe||(Abe=1,gW={L:1,M:0,Q:3,H:2}),gW}var bW,jbe;function CLe(){return jbe||(jbe=1,bW={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8}),bW}var yW,Ebe;function WRt(){if(Ebe)return yW;Ebe=1;var e=CLe();function t(n){this.mode=e.MODE_8BIT_BYTE,this.data=n}return t.prototype={getLength:function(n){return this.data.length},write:function(n){for(var r=0;r<this.data.length;r++)n.put(this.data.charCodeAt(r),8)}},yW=t,yW}var vW,_be;function qRt(){if(_be)return vW;_be=1;var e=wLe();function t(n,r){this.totalCount=n,this.dataCount=r}return t.RS_BLOCK_TABLE=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],t.getRSBlocks=function(n,r){var s=t.getRsBlockTable(n,r);if(s==null)throw new Error("bad rs block @ typeNumber:"+n+"/errorCorrectLevel:"+r);for(var a=s.length/3,o=new Array,l=0;l<a;l++)for(var c=s[l*3+0],u=s[l*3+1],d=s[l*3+2],f=0;f<c;f++)o.push(new t(u,d));return o},t.getRsBlockTable=function(n,r){switch(r){case e.L:return t.RS_BLOCK_TABLE[(n-1)*4+0];case e.M:return t.RS_BLOCK_TABLE[(n-1)*4+1];case e.Q:return t.RS_BLOCK_TABLE[(n-1)*4+2];case e.H:return t.RS_BLOCK_TABLE[(n-1)*4+3];default:return}},vW=t,vW}var wW,kbe;function GRt(){if(kbe)return wW;kbe=1;function e(){this.buffer=new Array,this.length=0}return e.prototype={get:function(t){var n=Math.floor(t/8);return(this.buffer[n]>>>7-t%8&1)==1},put:function(t,n){for(var r=0;r<n;r++)this.putBit((t>>>n-r-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(t){var n=Math.floor(this.length/8);this.buffer.length<=n&&this.buffer.push(0),t&&(this.buffer[n]|=128>>>this.length%8),this.length++}},wW=e,wW}var CW,Tbe;function SLe(){if(Tbe)return CW;Tbe=1;for(var e={glog:function(n){if(n<1)throw new Error("glog("+n+")");return e.LOG_TABLE[n]},gexp:function(n){for(;n<0;)n+=255;for(;n>=256;)n-=255;return e.EXP_TABLE[n]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)},t=0;t<8;t++)e.EXP_TABLE[t]=1<<t;for(var t=8;t<256;t++)e.EXP_TABLE[t]=e.EXP_TABLE[t-4]^e.EXP_TABLE[t-5]^e.EXP_TABLE[t-6]^e.EXP_TABLE[t-8];for(var t=0;t<255;t++)e.LOG_TABLE[e.EXP_TABLE[t]]=t;return CW=e,CW}var SW,Ibe;function NLe(){if(Ibe)return SW;Ibe=1;var e=SLe();function t(n,r){if(n.length==null)throw new Error(n.length+"/"+r);for(var s=0;s<n.length&&n[s]==0;)s++;this.num=new Array(n.length-s+r);for(var a=0;a<n.length-s;a++)this.num[a]=n[a+s]}return t.prototype={get:function(n){return this.num[n]},getLength:function(){return this.num.length},multiply:function(n){for(var r=new Array(this.getLength()+n.getLength()-1),s=0;s<this.getLength();s++)for(var a=0;a<n.getLength();a++)r[s+a]^=e.gexp(e.glog(this.get(s))+e.glog(n.get(a)));return new t(r,0)},mod:function(n){if(this.getLength()-n.getLength()<0)return this;for(var r=e.glog(this.get(0))-e.glog(n.get(0)),s=new Array(this.getLength()),a=0;a<this.getLength();a++)s[a]=this.get(a);for(var a=0;a<n.getLength();a++)s[a]^=e.gexp(e.glog(n.get(a))+r);return new t(s,0).mod(n)}},SW=t,SW}var NW,Pbe;function KRt(){if(Pbe)return NW;Pbe=1;var e=CLe(),t=NLe(),n=SLe(),r={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},s={PATTERN_POSITION_TABLE:[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],G15:1335,G18:7973,G15_MASK:21522,getBCHTypeInfo:function(a){for(var o=a<<10;s.getBCHDigit(o)-s.getBCHDigit(s.G15)>=0;)o^=s.G15<<s.getBCHDigit(o)-s.getBCHDigit(s.G15);return(a<<10|o)^s.G15_MASK},getBCHTypeNumber:function(a){for(var o=a<<12;s.getBCHDigit(o)-s.getBCHDigit(s.G18)>=0;)o^=s.G18<<s.getBCHDigit(o)-s.getBCHDigit(s.G18);return a<<12|o},getBCHDigit:function(a){for(var o=0;a!=0;)o++,a>>>=1;return o},getPatternPosition:function(a){return s.PATTERN_POSITION_TABLE[a-1]},getMask:function(a,o,l){switch(a){case r.PATTERN000:return(o+l)%2==0;case r.PATTERN001:return o%2==0;case r.PATTERN010:return l%3==0;case r.PATTERN011:return(o+l)%3==0;case r.PATTERN100:return(Math.floor(o/2)+Math.floor(l/3))%2==0;case r.PATTERN101:return o*l%2+o*l%3==0;case r.PATTERN110:return(o*l%2+o*l%3)%2==0;case r.PATTERN111:return(o*l%3+(o+l)%2)%2==0;default:throw new Error("bad maskPattern:"+a)}},getErrorCorrectPolynomial:function(a){for(var o=new t([1],0),l=0;l<a;l++)o=o.multiply(new t([1,n.gexp(l)],0));return o},getLengthInBits:function(a,o){if(1<=o&&o<10)switch(a){case e.MODE_NUMBER:return 10;case e.MODE_ALPHA_NUM:return 9;case e.MODE_8BIT_BYTE:return 8;case e.MODE_KANJI:return 8;default:throw new Error("mode:"+a)}else if(o<27)switch(a){case e.MODE_NUMBER:return 12;case e.MODE_ALPHA_NUM:return 11;case e.MODE_8BIT_BYTE:return 16;case e.MODE_KANJI:return 10;default:throw new Error("mode:"+a)}else if(o<41)switch(a){case e.MODE_NUMBER:return 14;case e.MODE_ALPHA_NUM:return 13;case e.MODE_8BIT_BYTE:return 16;case e.MODE_KANJI:return 12;default:throw new Error("mode:"+a)}else throw new Error("type:"+o)},getLostPoint:function(a){for(var o=a.getModuleCount(),l=0,c=0;c<o;c++)for(var u=0;u<o;u++){for(var d=0,f=a.isDark(c,u),x=-1;x<=1;x++)if(!(c+x<0||o<=c+x))for(var g=-1;g<=1;g++)u+g<0||o<=u+g||x==0&&g==0||f==a.isDark(c+x,u+g)&&d++;d>5&&(l+=3+d-5)}for(var c=0;c<o-1;c++)for(var u=0;u<o-1;u++){var v=0;a.isDark(c,u)&&v++,a.isDark(c+1,u)&&v++,a.isDark(c,u+1)&&v++,a.isDark(c+1,u+1)&&v++,(v==0||v==4)&&(l+=3)}for(var c=0;c<o;c++)for(var u=0;u<o-6;u++)a.isDark(c,u)&&!a.isDark(c,u+1)&&a.isDark(c,u+2)&&a.isDark(c,u+3)&&a.isDark(c,u+4)&&!a.isDark(c,u+5)&&a.isDark(c,u+6)&&(l+=40);for(var u=0;u<o;u++)for(var c=0;c<o-6;c++)a.isDark(c,u)&&!a.isDark(c+1,u)&&a.isDark(c+2,u)&&a.isDark(c+3,u)&&a.isDark(c+4,u)&&!a.isDark(c+5,u)&&a.isDark(c+6,u)&&(l+=40);for(var w=0,u=0;u<o;u++)for(var c=0;c<o;c++)a.isDark(c,u)&&w++;var C=Math.abs(100*w/o/o-50)/5;return l+=C*10,l}};return NW=s,NW}var AW,Fbe;function YRt(){if(Fbe)return AW;Fbe=1;var e=WRt(),t=qRt(),n=GRt(),r=KRt(),s=NLe();function a(l,c){this.typeNumber=l,this.errorCorrectLevel=c,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=[]}var o=a.prototype;return o.addData=function(l){var c=new e(l);this.dataList.push(c),this.dataCache=null},o.isDark=function(l,c){if(l<0||this.moduleCount<=l||c<0||this.moduleCount<=c)throw new Error(l+","+c);return this.modules[l][c]},o.getModuleCount=function(){return this.moduleCount},o.make=function(){if(this.typeNumber<1){var l=1;for(l=1;l<40;l++){for(var c=t.getRSBlocks(l,this.errorCorrectLevel),u=new n,d=0,f=0;f<c.length;f++)d+=c[f].dataCount;for(var f=0;f<this.dataList.length;f++){var x=this.dataList[f];u.put(x.mode,4),u.put(x.getLength(),r.getLengthInBits(x.mode,l)),x.write(u)}if(u.getLengthInBits()<=d*8)break}this.typeNumber=l}this.makeImpl(!1,this.getBestMaskPattern())},o.makeImpl=function(l,c){this.moduleCount=this.typeNumber*4+17,this.modules=new Array(this.moduleCount);for(var u=0;u<this.moduleCount;u++){this.modules[u]=new Array(this.moduleCount);for(var d=0;d<this.moduleCount;d++)this.modules[u][d]=null}this.setupPositionProbePattern(0,0),this.setupPositionProbePattern(this.moduleCount-7,0),this.setupPositionProbePattern(0,this.moduleCount-7),this.setupPositionAdjustPattern(),this.setupTimingPattern(),this.setupTypeInfo(l,c),this.typeNumber>=7&&this.setupTypeNumber(l),this.dataCache==null&&(this.dataCache=a.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,c)},o.setupPositionProbePattern=function(l,c){for(var u=-1;u<=7;u++)if(!(l+u<=-1||this.moduleCount<=l+u))for(var d=-1;d<=7;d++)c+d<=-1||this.moduleCount<=c+d||(0<=u&&u<=6&&(d==0||d==6)||0<=d&&d<=6&&(u==0||u==6)||2<=u&&u<=4&&2<=d&&d<=4?this.modules[l+u][c+d]=!0:this.modules[l+u][c+d]=!1)},o.getBestMaskPattern=function(){for(var l=0,c=0,u=0;u<8;u++){this.makeImpl(!0,u);var d=r.getLostPoint(this);(u==0||l>d)&&(l=d,c=u)}return c},o.createMovieClip=function(l,c,u){var d=l.createEmptyMovieClip(c,u),f=1;this.make();for(var x=0;x<this.modules.length;x++)for(var g=x*f,v=0;v<this.modules[x].length;v++){var w=v*f,C=this.modules[x][v];C&&(d.beginFill(0,100),d.moveTo(w,g),d.lineTo(w+f,g),d.lineTo(w+f,g+f),d.lineTo(w,g+f),d.endFill())}return d},o.setupTimingPattern=function(){for(var l=8;l<this.moduleCount-8;l++)this.modules[l][6]==null&&(this.modules[l][6]=l%2==0);for(var c=8;c<this.moduleCount-8;c++)this.modules[6][c]==null&&(this.modules[6][c]=c%2==0)},o.setupPositionAdjustPattern=function(){for(var l=r.getPatternPosition(this.typeNumber),c=0;c<l.length;c++)for(var u=0;u<l.length;u++){var d=l[c],f=l[u];if(this.modules[d][f]==null)for(var x=-2;x<=2;x++)for(var g=-2;g<=2;g++)x==-2||x==2||g==-2||g==2||x==0&&g==0?this.modules[d+x][f+g]=!0:this.modules[d+x][f+g]=!1}},o.setupTypeNumber=function(l){for(var c=r.getBCHTypeNumber(this.typeNumber),u=0;u<18;u++){var d=!l&&(c>>u&1)==1;this.modules[Math.floor(u/3)][u%3+this.moduleCount-8-3]=d}for(var u=0;u<18;u++){var d=!l&&(c>>u&1)==1;this.modules[u%3+this.moduleCount-8-3][Math.floor(u/3)]=d}},o.setupTypeInfo=function(l,c){for(var u=this.errorCorrectLevel<<3|c,d=r.getBCHTypeInfo(u),f=0;f<15;f++){var x=!l&&(d>>f&1)==1;f<6?this.modules[f][8]=x:f<8?this.modules[f+1][8]=x:this.modules[this.moduleCount-15+f][8]=x}for(var f=0;f<15;f++){var x=!l&&(d>>f&1)==1;f<8?this.modules[8][this.moduleCount-f-1]=x:f<9?this.modules[8][15-f-1+1]=x:this.modules[8][15-f-1]=x}this.modules[this.moduleCount-8][8]=!l},o.mapData=function(l,c){for(var u=-1,d=this.moduleCount-1,f=7,x=0,g=this.moduleCount-1;g>0;g-=2)for(g==6&&g--;;){for(var v=0;v<2;v++)if(this.modules[d][g-v]==null){var w=!1;x<l.length&&(w=(l[x]>>>f&1)==1);var C=r.getMask(c,d,g-v);C&&(w=!w),this.modules[d][g-v]=w,f--,f==-1&&(x++,f=7)}if(d+=u,d<0||this.moduleCount<=d){d-=u,u=-u;break}}},a.PAD0=236,a.PAD1=17,a.createData=function(l,c,u){for(var d=t.getRSBlocks(l,c),f=new n,x=0;x<u.length;x++){var g=u[x];f.put(g.mode,4),f.put(g.getLength(),r.getLengthInBits(g.mode,l)),g.write(f)}for(var v=0,x=0;x<d.length;x++)v+=d[x].dataCount;if(f.getLengthInBits()>v*8)throw new Error("code length overflow. ("+f.getLengthInBits()+">"+v*8+")");for(f.getLengthInBits()+4<=v*8&&f.put(0,4);f.getLengthInBits()%8!=0;)f.putBit(!1);for(;!(f.getLengthInBits()>=v*8||(f.put(a.PAD0,8),f.getLengthInBits()>=v*8));)f.put(a.PAD1,8);return a.createBytes(f,d)},a.createBytes=function(l,c){for(var u=0,d=0,f=0,x=new Array(c.length),g=new Array(c.length),v=0;v<c.length;v++){var w=c[v].dataCount,C=c[v].totalCount-w;d=Math.max(d,w),f=Math.max(f,C),x[v]=new Array(w);for(var N=0;N<x[v].length;N++)x[v][N]=255&l.buffer[N+u];u+=w;var P=r.getErrorCorrectPolynomial(C),I=new s(x[v],P.getLength()-1),R=I.mod(P);g[v]=new Array(P.getLength()-1);for(var N=0;N<g[v].length;N++){var F=N+R.getLength()-g[v].length;g[v][N]=F>=0?R.get(F):0}}for(var U=0,N=0;N<c.length;N++)U+=c[N].totalCount;for(var L=new Array(U),z=0,N=0;N<d;N++)for(var v=0;v<c.length;v++)N<x[v].length&&(L[z++]=x[v][N]);for(var N=0;N<f;N++)for(var v=0;v<c.length;v++)N<g[v].length&&(L[z++]=g[v][N]);return L},AW=a,AW}var yP={},Obe;function XRt(){if(Obe)return yP;Obe=1,Object.defineProperty(yP,"__esModule",{value:!0});var e=Object.assign||function(u){for(var d=1;d<arguments.length;d++){var f=arguments[d];for(var x in f)Object.prototype.hasOwnProperty.call(f,x)&&(u[x]=f[x])}return u},t=_$(),n=a(t),r=ax(),s=a(r);function a(u){return u&&u.__esModule?u:{default:u}}function o(u,d){var f={};for(var x in u)d.indexOf(x)>=0||Object.prototype.hasOwnProperty.call(u,x)&&(f[x]=u[x]);return f}var l={bgColor:n.default.oneOfType([n.default.object,n.default.string]).isRequired,bgD:n.default.string.isRequired,fgColor:n.default.oneOfType([n.default.object,n.default.string]).isRequired,fgD:n.default.string.isRequired,size:n.default.number.isRequired,title:n.default.string,viewBoxSize:n.default.number.isRequired,xmlns:n.default.string},c=(0,r.forwardRef)(function(u,d){var f=u.bgColor,x=u.bgD,g=u.fgD,v=u.fgColor,w=u.size,C=u.title,N=u.viewBoxSize,P=u.xmlns,I=P===void 0?"http://www.w3.org/2000/svg":P,R=o(u,["bgColor","bgD","fgD","fgColor","size","title","viewBoxSize","xmlns"]);return s.default.createElement("svg",e({},R,{height:w,ref:d,viewBox:"0 0 "+N+" "+N,width:w,xmlns:I}),C?s.default.createElement("title",null,C):null,s.default.createElement("path",{d:x,fill:f}),s.default.createElement("path",{d:g,fill:v}))});return c.displayName="QRCodeSvg",c.propTypes=l,yP.default=c,yP}var Mbe;function QRt(){if(Mbe)return X6;Mbe=1,Object.defineProperty(X6,"__esModule",{value:!0}),X6.QRCode=void 0;var e=Object.assign||function(w){for(var C=1;C<arguments.length;C++){var N=arguments[C];for(var P in N)Object.prototype.hasOwnProperty.call(N,P)&&(w[P]=N[P])}return w},t=_$(),n=f(t),r=wLe(),s=f(r),a=YRt(),o=f(a),l=ax(),c=f(l),u=XRt(),d=f(u);function f(w){return w&&w.__esModule?w:{default:w}}function x(w,C){var N={};for(var P in w)C.indexOf(P)>=0||Object.prototype.hasOwnProperty.call(w,P)&&(N[P]=w[P]);return N}var g={bgColor:n.default.oneOfType([n.default.object,n.default.string]),fgColor:n.default.oneOfType([n.default.object,n.default.string]),level:n.default.string,size:n.default.number,value:n.default.string.isRequired},v=(0,l.forwardRef)(function(w,C){var N=w.bgColor,P=N===void 0?"#FFFFFF":N,I=w.fgColor,R=I===void 0?"#000000":I,F=w.level,U=F===void 0?"L":F,L=w.size,z=L===void 0?256:L,Q=w.value,ne=x(w,["bgColor","fgColor","level","size","value"]),J=new o.default(-1,s.default[U]);J.addData(Q),J.make();var X=J.modules;return c.default.createElement(d.default,e({},ne,{bgColor:P,bgD:X.map(function(re,pe){return re.map(function(Y,ie){return Y?"":"M "+ie+" "+pe+" l 1 0 0 1 -1 0 Z"}).join(" ")}).join(" "),fgColor:R,fgD:X.map(function(re,pe){return re.map(function(Y,ie){return Y?"M "+ie+" "+pe+" l 1 0 0 1 -1 0 Z":""}).join(" ")}).join(" "),ref:C,size:z,viewBoxSize:X.length}))});return X6.QRCode=v,v.displayName="QRCode",v.propTypes=g,X6.default=v,X6}var ZRt=QRt();const JRt=Ti(ZRt),up=({isOpen:e,onClose:t,children:n,fullscreen:r=!1,blurBackground:s=!1})=>{const[a,o]=m.useState(e),[l,c]=m.useState(!1);m.useEffect(()=>{e?(o(!0),c(!0)):(c(!1),o(!1))},[e]),m.useEffect(()=>{const d=f=>{f.key==="Escape"&&u()};return a&&(document.body.style.overflow="hidden",document.addEventListener("keydown",d)),()=>{document.body.style.overflow="",document.removeEventListener("keydown",d)}},[a]);const u=()=>{c(!1),t()};return a?Na.createPortal(i.jsxs("div",{className:`fixed inset-0 z-[9999] transition-opacity duration-0 ${l?"opacity-100":"opacity-0"} flex items-center justify-center`,children:[i.jsx("div",{className:`absolute inset-0 ${s?"backdrop-blur-md bg-black/50":"bg-black/50"}`,onClick:u}),i.jsxs("div",{className:`relative bg-[#101010] shadow-lg transform transition-transform duration-0 ${l?"translate-y-0":"translate-y-full"} ${r?"w-screen h-[100dvh] rounded-none p-0":"w-auto max-w-[95vw] max-h-[95vh] rounded-[24px] p-2"}`,onClick:d=>d.stopPropagation(),children:[n,i.jsx("div",{className:`absolute ${r?"top-4 right-4 text-white":"top-2 right-4 text-gray-400 hover:text-white"} text-2xl cursor-pointer z-50`,onClick:u,children:"×"})]})]}),document.body):null},eLt=({progress:e=0,size:t=24,strokeWidth:n=3})=>{const r=(t-n)/2,s=2*Math.PI*r,a=s-e/100*s;return i.jsxs("svg",{width:t,height:t,style:{transform:"rotate(-90deg)"},children:[i.jsx("circle",{stroke:"#FFFFFF",fill:"transparent",strokeWidth:n,r,cx:t/2,cy:t/2}),i.jsx("circle",{stroke:"#000000",fill:"transparent",strokeWidth:n,r,cx:t/2,cy:t/2,strokeDasharray:s,strokeDashoffset:a,strokeLinecap:"round"})]})},tLt=()=>{const[e,t]=m.useState(!1),[n,r]=m.useState(null),[s,a]=m.useState(0),[o,l]=m.useState(15),c=window.localStorage.getItem("hyperToken"),u=window.localStorage.getItem("hyperAddress"),d=m.useRef(null),f=m.useRef(null),x=2e3;m.useEffect(()=>{let P=null;return n&&(l(15),P=setInterval(()=>{l(I=>I<=1?(clearInterval(P),v(),0):I-1)},1e3)),()=>{P&&clearInterval(P)}},[n]);const g=()=>{r(null),a(0),t(!0)},v=()=>{t(!1),N()},w=()=>{a(0),f.current=Date.now(),d.current=setInterval(()=>{const I=(Date.now()-f.current)/x,R=Math.min(I*100,100);a(R),I>=1&&(clearInterval(d.current),d.current=null,a(100),fs.post("https://dextrabothypev2.nftinit.io/api/subscriber/sign_mobile_start/",{address:u,token:c}).then(F=>{const{temp_mobile_password:U}=F.data;r(U)}).catch(F=>{console.error("Axios error:",F)}))},30)},C=()=>{N()},N=()=>{d.current&&(clearInterval(d.current),d.current=null),a(0)};return m.useEffect(()=>()=>{d.current&&clearInterval(d.current)},[]),i.jsxs(i.Fragment,{children:[i.jsx("div",{onClick:g,className:"cursor-pointer text-white flex items-center justify-center",children:i.jsx(k6t,{className:"mr-2"})}),i.jsx(up,{isOpen:e,onClose:v,children:i.jsx("div",{className:"flex flex-col items-center text-center text-white px-4 py-6 rounded-md mx-auto",children:n?i.jsxs(i.Fragment,{children:[i.jsx("img",{src:Gi,className:"w-12 h-12 mb-4",alt:"Dextrabot"}),i.jsx("h2",{className:"mt-2 text-xl font-semibold",children:"Link Mobile Device"}),i.jsx("p",{className:"mt-2 text-sm leading-normal text-gray-300",children:"Scan this QR code with your native camera to connect."}),i.jsx("div",{className:"mt-4 bg-white p-2",children:i.jsx(JRt,{value:`${window.location.origin}/mobile-auth?temp_mobile_password=${n}`})}),i.jsxs("p",{className:"mt-4 text-sm text-gray-400",children:["This window will close automatically in"," ",i.jsx("span",{className:"text-white font-semibold",children:o})," ","seconds."]})]}):i.jsxs(i.Fragment,{children:[i.jsx("img",{src:Gi,className:"w-12 h-12 mb-4",alt:"Dextrabot"}),i.jsx("h2",{className:"mt-2 text-xl font-semibold",children:"Link Mobile Device"}),i.jsxs("p",{className:"mt-2 text-sm leading-normal text-gray-300",children:["Just open your camera and scan the QR code to log in to"," ",i.jsx("span",{className:"text-[#46eda1]",children:"Dextra."}),i.jsx("br",{}),"This QR code enables mobile copy trading (not deposits or withdrawals). Do not share this code or screenshots of it with anyone. Make sure you're not sharing your screen."]}),i.jsxs("button",{onMouseDown:w,onMouseUp:C,onMouseLeave:C,onTouchStart:w,onTouchEnd:C,className:`mt-6 flex items-center space-x-2 px-4 py-2 rounded-md
bg-[#46eda1] text-black font-medium text-sm`,children:[i.jsx("div",{className:"text-black",children:i.jsx(eLt,{progress:s,size:16,strokeWidth:3})}),i.jsx("span",{children:"Hold to Reveal"})]})]})})})]})},Ps=({className:e})=>i.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e,children:[i.jsx("path",{d:"M13.5525 10.8225L9.00001 15.375L4.44751 10.8225",stroke:"currentColor",strokeWidth:"1.5",strokeMiterlimit:"10",strokeLinecap:"round",strokeLinejoin:"round"}),i.jsx("path",{d:"M9 2.62506V15.2476",stroke:"currentColor",strokeWidth:"1.5",strokeMiterlimit:"10",strokeLinecap:"round",strokeLinejoin:"round"})]}),Fa=({content:e,positionTop:t,alignRight:n})=>i.jsxs("span",{className:`tooltip ${n?"left-5 top-1/2 -translate-y-1/2 ":t?"-top-6 -translate-x-1/2 left-1/2":"-bottom-6 -translate-x-1/2 left-1/2"} transform bg-[#353535] text-white font-manrope font-semibold text-xs leading-3 py-1 px-1.5 rounded-sm relative whitespace-nowrap`,children:[e,i.jsx("svg",{width:"10",height:"8",viewBox:"0 0 10 8",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:`absolute transform -z-1 ${n?"-rotate-90 left-1 -translate-x-full -translate-y-1/2 top-1/2 ":t?"-bottom-1 rotate-180 -translate-x-1/2 left-1/2":"-top-1 -translate-x-1/2 left-1/2"}`,children:i.jsx("path",{d:"M3.70096 1.25C4.27831 0.25 5.72169 0.25 6.29904 1.25L8.89711 5.75C9.47446 6.75 8.75278 8 7.59808 8H2.40192C1.24722 8 0.525536 6.75 1.10289 5.75L3.70096 1.25Z",fill:"#353535"})})]}),nLt=()=>{const{hyperToken:e,notificationData:t,setNotificationData:n,announcementData:r,setAnnouncementData:s,handleAnnouncement:a}=m.useContext(Qr),{isConnected:o,address:l}=ns(),[c,u]=m.useState(window.localStorage.getItem("selectedNotificationTab")||"notification"),f=localStorage.getItem("isDateNotificationFormat")||"date",[x,g]=m.useState(f),w=localStorage.getItem("isDateAnnouncementFormat")||"date",[C,N]=m.useState(w),[P,I]=m.useState(!1);m.useEffect(()=>{localStorage.setItem("isDateNotificationFormat",x)},[x]),m.useEffect(()=>{localStorage.setItem("isDateNotificationFormat",C)},[C]),m.useEffect(()=>{if(!window.localStorage.getItem("hyperToken")||!l){n([]),s([]);return}const Q=`notificationsFeedSocket_${l==null?void 0:l.toLowerCase()}`,ne=J=>{if(J.key===Q){const X=JSON.parse(J.newValue||"[]");n(X)}};return window.addEventListener("storage",ne),()=>window.removeEventListener("storage",ne)},[e,l]),m.useEffect(()=>{const L=window.localStorage.getItem("hyperToken");if(!P||c!="notification"||!L)return;const Q=`notificationsFeedSocket_${l==null?void 0:l.toLowerCase()}`;if(!t.some(X=>!X.is_read))return;const J=setTimeout(()=>{const X=t.map(re=>re.is_read?re:{...re,is_read:!0});n(X),localStorage.setItem(Q,JSON.stringify(X))},1e3);return()=>clearTimeout(J)},[t,P,c]),m.useEffect(()=>{var Q;if(!P||c!=="announcement"||!(r!=null&&r.announcements)||((Q=r==null?void 0:r.announcements)==null?void 0:Q.length)===0)return;const L="readNotSignAnnouncementIds",z=setTimeout(()=>{const ne=JSON.parse(localStorage.getItem(L)||"[]"),J=r==null?void 0:r.announcements.map(X=>X.id).filter(X=>!ne.includes(X));if(J.length>0){const X=[...ne,...J];localStorage.setItem(L,JSON.stringify(X))}},1e3);return()=>clearTimeout(z)},[r,P,c,e]);const R=async()=>{try{const L=window.localStorage.getItem("hyperToken"),z="https://dextrabothypev2.nftinit.io/api/subscriber/announcement/setlastseenannouncement/";if(!o||!L)return;const Q=await fetch(z,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:l==null?void 0:l.toLowerCase(),token:L})});if(!Q.ok)throw new Error(`Server responded with status ${Q.status}`);const ne=await Q.json();ne.success?a():console.log(ne.error_message)}catch(L){console.error("Error in handleAnnouncement:",L)}};m.useEffect(()=>{!P||c!=="announcement"||(r==null?void 0:r.new_announcement_count)>0&&e&&o&&R()},[P,c]);const F=t.filter(L=>!L.is_read).length,U=(()=>{var Q,ne;const L=l==null?void 0:l.toLowerCase(),z=window.localStorage.getItem("hyperToken");if(!L||!z){const J="readNotSignAnnouncementIds",X=new Set(JSON.parse(localStorage.getItem(J)||"[]").map(String)),re=new Date,pe=new Date;return pe.setDate(re.getDate()-2),(Q=r==null?void 0:r.announcements)==null?void 0:Q.filter(Y=>{const ie=new Date(Y==null?void 0:Y.created_at);return!X.has(String(Y==null?void 0:Y.id))&&ie>=pe}).length}if(L&&z&&(r==null?void 0:r.new_announcement_count)>0){const J="readNotSignAnnouncementIds",X=new Set(JSON.parse(localStorage.getItem(J)||"[]").map(String));return((ne=r==null?void 0:r.announcements)==null?void 0:ne.filter(pe=>pe.is_new&&!X.has(String(pe.id))).length)||0}return(r==null?void 0:r.new_announcement_count)||0})();return i.jsx(MD,{as:"div",className:"relative hidden sm:inline-block text-left",children:({open:L,close:z})=>{var Q,ne;return m.useEffect(()=>{I(L)},[L]),i.jsxs(i.Fragment,{children:[i.jsx("div",{children:i.jsxs(FD,{className:"relative inline-flex w-full justify-center rounded-md gap-x-1.5 p-1 text-[11px] font-semibold text-gray-900 shadow-sm focus:outline-none focus:ring-0 border-none bg-transparent mt-[2px]",children:[i.jsxs("div",{className:"relative",children:[U>0&&i.jsx("span",{className:"absolute flex h-6 w-6 rounded-full bg-[#FF797C] opacity-55 animate-ping duration-[30000ms] top-0 left-0"}),i.jsx("img",{src:vyt,alt:"",className:`${U>0?"bg-transparent":"bg-[#1a1a1a]"} w-[18px] h-[18px] min-w-[18px] min-h-[18px] relative z-10`})]}),(U>0||F>0)&&i.jsx("span",{className:`${U+F>99?"":"w-5 h-5"} absolute -top-1 bg-[#FF373B] text-white rounded-full flex items-center justify-center text-[10px] -right-1 p-0.5 z-20`,children:U+F>99?"99+":U+F})]})}),i.jsx(l8e,{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:i.jsxs(OD,{className:"absolute -right-3 mt-2 w-[432px] min-h-60 max-h-96 sm:max-h-[600px] origin-top-right rounded-lg bg-[#242424] ring-1 ring-black ring-opacity-5 focus:outline-none flex flex-col gap-[15px] z-[55]",children:[i.jsxs("div",{className:"flex flex-col gap-4 bg-[#242424] relative rounded-tl-lg rounded-tr-lg px-4 pt-4",children:[i.jsxs("div",{className:"flex justify-between items-center",children:[i.jsx("div",{className:"absolute -top-2 right-[21px]",children:i.jsx("img",{src:rke})}),i.jsx("span",{className:"flex gap-1.5 items-center text-white text-base font-semibold font-['Manrope'] leading-[21px] select-none",children:"Notifications"}),i.jsx("div",{className:"flex justify-center items-center gap-2",children:c!="announcement"&&i.jsxs("div",{className:"flex justify-center items-center relative has-tooltip",children:[i.jsx($Rt,{onClick:J=>{J.preventDefault();const X=window.localStorage.getItem("hyperToken");if(!l||!X)return;const re=`notificationsFeedSocket_${l==null?void 0:l.toLowerCase()}`;n([]),localStorage.removeItem(re)},className:`${(t==null?void 0:t.length)>0?"text-[#7f7f7f] hover:text-[#c8c6c6]":"text-[#7f7f7f]"} w-4 h-4 cursor-pointer -mt-[2px]`}),i.jsx("span",{className:"",children:i.jsx(Fa,{content:"Clear All",positionTop:!1,alignRight:!1})})]})})]}),i.jsx("div",{className:"flex flex-col justify-start items-start w-full",children:i.jsxs("div",{className:"flex justify-stretch w-full gap-[15px]",children:[i.jsxs("div",{onClick:()=>{u("notification"),window.localStorage.setItem("selectedNotificationTab","notification")},className:`relative ${c==="notification"?"text-white bg-[#494949] rounded-lg inline-flex justify-center items-center gap-1":"text-[#919191]"} flex h-7 px-1.5 py-1 justify-center items-center gap-2 itext-white text-[13px] font-semibold font-['Manrope'] leading-[18px] cursor-pointer select-none`,children:["Notifications",F>0&&i.jsx("div",{className:"w-[18px] h-[18px] bg-[#ff373b] rounded-[256px] inline-flex justify-center items-center gap-2.5",children:i.jsx("div",{className:"justify-start text-white text-[11px] font-bold font-['Manrope'] leading-[10px]",children:F})})]}),i.jsxs("div",{onClick:()=>{u("announcement"),window.localStorage.setItem("selectedNotificationTab","announcement")},className:`relative ${c==="announcement"?"text-white bg-[#494949] rounded-lg inline-flex justify-center items-center gap-1":"text-[#919191]"} flex h-7 px-1.5 py-1 justify-center items-center gap-2 itext-white text-[13px] font-semibold font-['Manrope'] leading-[18px] cursor-pointer select-none`,children:["Announcements",U>0&&i.jsx("div",{className:"w-[18px] h-[18px] bg-[#ff373b] rounded-[256px] inline-flex justify-center items-center gap-2.5",children:i.jsx("div",{className:"justify-start text-white text-[11px] font-bold font-['Manrope'] leading-[10px]",children:U})})]})]})})]}),i.jsx("div",{className:"px-2 mb-4 overflow-auto text-[13px] leading-4 font-semibold",children:c==="notification"&&(t==null?void 0:t.length)>0?i.jsx("div",{className:"flex flex-col items-start justify-center gap-1 w-full",children:t==null?void 0:t.map((J,X)=>i.jsx(rLt,{listenUser:J==null?void 0:J.listen_user,asset:J==null?void 0:J.coin,feeToken:J==null?void 0:J.feeToken,dir:J==null?void 0:J.dir,leverage:J==null?void 0:J.leverage,type:J==null?void 0:J.fill_direction_type,time:J==null?void 0:J.time,status:J.message,isDateFormat:x,setIsDateFormat:g,close:z,isError:J==null?void 0:J.success,traderPNL:J==null?void 0:J.trader_pnl,targetPlatform:J==null?void 0:J.target_platform},X))}):c==="announcement"&&((Q=r==null?void 0:r.announcements)==null?void 0:Q.length)>0?i.jsx("div",{className:"flex flex-col items-start justify-center gap-1 w-full",children:(ne=r==null?void 0:r.announcements)==null?void 0:ne.map((J,X)=>i.jsx(sLt,{address:J==null?void 0:J.address,content:J==null?void 0:J.content,createdAt:J==null?void 0:J.created_at,typeId:J==null?void 0:J.type_id,isDateAnnouncementFormat:C,setIsDateAnnouncementFormat:N},X))}):i.jsxs("div",{className:"w-full h-full flex flex-col items-center gap-2 py-9",children:[i.jsx("span",{children:i.jsx("img",{src:ayt,alt:""})}),i.jsx("span",{className:"text-[#9C9C9C] text-[13px] leading-4 font-semibold text-center px-4",children:"So clean! You have no new notifications"})]})})]})})]})}})},rLt=({asset:e,type:t,status:n,feeToken:r,dir:s,leverage:a,listenUser:o,time:l,isDateFormat:c,setIsDateFormat:u,close:d,isError:f,traderPNL:x,targetPlatform:g})=>{function v({date:C}){const[N,P]=m.useState(Mo(C));return m.useEffect(()=>{const I=setInterval(()=>{P(Mo(C))},1e3);return()=>clearInterval(I)},[C]),i.jsx("span",{className:"text-[#a5a5a5] text-[11px] font-normal font-manrope leading-[13px] tracking-tight",children:N.dateTime})}const w={kBONK:"BONK",kPEPE:"PEPE",kSHIB:"SHIB",kFLOKI:"FLOKI",kNEIRO:"NEIRO",kDOGS:"DOGS",kLUNC:"LUNC"};return i.jsxs("span",{onClick:()=>{window.location.pathname+window.location.hash==="/tracker#my-activities"?d():window.open("/tracker","_self")},className:"flex gap-2 items-start justify-start px-3 pt-3 pb-2 bg-[#2b2b2b] rounded-2xl min-w-full hover:bg-[#373737] cursor-pointer min-h-16 relative",children:[i.jsx("div",{className:`${f?"bg-[#67ffbd]":"bg-[#ff787b]"} w-0.5 h-10 min-h-10 absolute left-0 top-[27.5%]`}),i.jsxs("div",{className:"flex flex-col items-center gap-3",children:[i.jsx("img",{src:`https://app.hyperliquid.xyz/coins/${w[e]||(e==null?void 0:e.split("/")[0])}.svg`||dummyImage,alt:e,className:"rounded-full w-8 h-8 min-w-8 min-h-8 bg-white",loading:"lazy",onError:C=>fm(C)}),g==="hyper"?i.jsx("div",{className:"flex justify-start items-center gap-2",children:i.jsx("img",{src:dx,alt:"hyper",className:"w-4 h-4 rounded-sm"})}):g==="lighter"?i.jsx("div",{className:"flex justify-start items-center gap-2",children:i.jsx(Xf,{className:"w-4 h-4 text-[#fff]"})}):""]}),i.jsxs("div",{className:"flex flex-col items-start justify-start gap-[3px] w-full",children:[i.jsxs("div",{className:"flex justify-between items-center gap-1 w-full",children:[i.jsxs("div",{className:"flex justify-start items-center gap-1",children:[i.jsxs("div",{className:"text-white text-[13px] font-bold font-['Manrope'] leading-[18px]",children:[e,"/",r??"USDC"]}),i.jsxs("div",{className:"flex justify-start gap-1 items-center ml-[2px]",children:[i.jsxs("div",{className:`${s!=null&&s.includes("Long")?s==="Short > Long"?"text-[#67ffbd] bg-[#67ffbd]/20":s==="Long > Short"?"text-[#ff787b] bg-[#ff797c]/20":"text-[#67ffbd] bg-[#67ffbd]/20":s=="Buy"?"text-[#67ffbd] bg-[#67ffbd]/20":"text-[#ff787b] bg-[#ff797c]/20"} h-[18px] pl-1 pr-1.5 py-1 rounded-md justify-start items-center gap-0.5 inline-flex min-w-max`,children:[i.jsx("div",{className:"w-2.5 h-2.5 justify-center items-center flex",children:i.jsx("div",{className:"w-2.5 h-2.5 relative",children:s!=null&&s.includes("Long")?s==="Short > Long"?i.jsx(Ps,{className:"text-[#67FFBD] rotate-180 w-2.5 h-2.5"}):s==="Long > Short"?i.jsx(Ps,{className:"text-[#FF797C] w-2.5 h-2.5"}):i.jsx(Ps,{className:"text-[#67FFBD] rotate-180 w-2.5 h-2.5"}):s=="Buy"?i.jsx(Ps,{className:"text-[#67FFBD] rotate-180 w-2.5 h-2.5"}):i.jsx(Ps,{className:"text-[#FF797C] w-2.5 h-2.5"})})}),i.jsxs("div",{className:"text-[11px] font-semibold font-manrope leading-[8px] tracking-wide",children:[s=="Sell"?"Sell":s=="Buy"?"Buy":s=="Close Short"?"Short":s=="Close Long"?"Long":s=="Open Short"?"Short":s=="Open Long"?"Long":s||"--",a?" - "+a+"X":""]})]}),i.jsxs("div",{onClick:C=>{C.stopPropagation(),window.open(`/wallet-details/${o}`,"_blank")},className:"flex justify-start items-center gap-1 cursor-pointer min-w-max h-[18px] px-1.5 py-[3px] bg-white/20 rounded-md",children:[i.jsx("div",{className:"text-white text-xs font-semibold font-manrope leading-none ",children:o&&(o==null?void 0:o.slice(0,5))+"..."+(o==null?void 0:o.slice(-4))}),i.jsx("img",{onClick:C=>{C.stopPropagation(),navigator.clipboard.writeText(o),rn.success("Successfully copied.",{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(103, 255, 189, 0.16)",width:"280px",minWidth:"280px",height:"40px",backdropFilter:"blur(16px)"},iconTheme:{primary:"#67FFBD",secondary:"#276047"}})},src:wo,alt:"",className:"cursor-pointer"})]})]})]}),i.jsx("div",{className:"w-[18px] h-[18px] min-w-[18px] min-h-[18px] flex justify-center items-center rounded",children:i.jsx("img",{src:rae,alt:""})})]}),i.jsx("span",{className:"text-[#b7b7b7] text-xs font-medium font-['Manrope'] leading-[15px] tracking-tight select-none max-w-[92%]",children:n&&(n==null?void 0:n.length)>100?(n==null?void 0:n.slice(0,105))+"...":n}),i.jsxs("div",{className:`${x!=null&&x!==0?"justify-between":"justify-end"} flex items-center w-full`,children:[i.jsx("div",{className:`${x!=null&&x!==0?x>0?"text-[#67ffbd] bg-[#67ffbd]/20":"bg-[#ff787b]/20 text-[#ff787b]":"hidden"} text-[11px] font-semibold font-['Manrope'] leading-[8px] p-1.5 rounded-md inline-flex justify-center items-center gap-1 max-h-5`,children:x!=null&&x!==0?x>0?`+$${Er(x)}`:`-$${Er(Math.abs(x))}`:""}),i.jsx("div",{onClick:C=>{C.stopPropagation(),u(c=="time"?"date":"time")},className:"flex justify-center items-center text-[#a5a5a5] text-[11px] font-medium font-['Manrope'] leading-[13px] tracking-tight cursor-pointer min-w-max w-max",children:c=="time"?i.jsx(v,{date:l}):su(l)})]})]})]})},sLt=({address:e,content:t,createdAt:n,typeId:r,isDateAnnouncementFormat:s,setIsDateAnnouncementFormat:a})=>{function o({date:u}){const[d,f]=m.useState(Mo(u));return m.useEffect(()=>{const x=setInterval(()=>{f(Mo(u))},1e3);return()=>clearInterval(x)},[u]),i.jsx("span",{className:"text-[#a5a5a5] text-[11px] font-normal font-manrope leading-[13px] tracking-tight",children:d.dateTime})}function l(u){if(!u)return null;try{const f=new URL(u).searchParams.get("v");return f?`https://img.youtube.com/vi/${f}/default.jpg`:null}catch(d){return console.error("Invalid YouTube URL:",u,d),null}}const c=l(t==null?void 0:t.url);return i.jsxs("span",{onClick:u=>{var d;u.preventDefault(),typeof(t==null?void 0:t.url)=="string"&&t.url.trim()!==""&&window.open((d=t==null?void 0:t.url)==null?void 0:d.trim(),"_blank")},className:`${typeof(t==null?void 0:t.url)=="string"&&t.url.trim()!==""?"cursor-pointer":""} flex gap-2 items-start justify-start px-3 pt-3 pb-2 bg-[#2b2b2b] rounded-2xl min-w-full hover:bg-[#404040] min-h-16 relative`,children:[i.jsx("div",{className:`${r==1?"w-8 h-8 min-w-8 min-h-8 bg-[#ff4848] rounded-full":r==2?c?"w-[75px] h-[56px] min-w-[75px] min-h-[56px] rounded-xl":"w-8 h-8 min-w-8 min-h-8 bg-[#FF0000] rounded-full":"w-8 h-8 min-w-8 min-h-8 bg-[#191919] rounded-full"} flex justify-center items-center overflow-hidden`,children:i.jsx("img",{src:r==1?yyt:r==2?c||Cyt:wyt,alt:"",className:`${r==2?c?"w-[75px] h-[56px] min-w-[75px] min-h-[56px]":"w-[10px] h-[12px] min-w-[10px] min-h-[12px] ml-[2px]":r==3?"w-[13.92px] h-[13px] min-w-[13.92px] min-h-[13px]":"w-[18px] h-[18px] min-w-[18px] min-h-[18px]"} `,loading:"lazy",onError:u=>fm(u)})}),i.jsxs("div",{className:"flex flex-col items-start justify-start gap-[3px] w-full",children:[i.jsxs("div",{className:"flex justify-between items-center gap-1 w-full",children:[i.jsx("div",{className:"text-white text-[13px] font-bold font-['Manrope'] leading-[18px]",children:t==null?void 0:t.title}),typeof(t==null?void 0:t.url)=="string"&&t.url.trim()!==""&&i.jsx("div",{className:"w-[18px] h-[18px] min-w-[18px] min-h-[18px] flex justify-center items-center rounded",children:i.jsx("img",{src:rae,alt:""})})]}),i.jsx("span",{className:"text-[#B7B7B7] text-xs font-medium font-['Manrope'] leading-[15px] tracking-tight select-none max-w-[92%]",children:t==null?void 0:t.message}),i.jsx("div",{className:"flex justify-end items-center w-full",children:i.jsx("div",{onClick:u=>{u.stopPropagation(),a(s=="time"?"date":"time")},className:"flex justify-end items-center text-[#a5a5a5] text-[11px] font-medium font-['Manrope'] leading-[13px] tracking-tight cursor-pointer min-w-max w-max",children:s=="time"?i.jsx(o,{date:n}):su(n)})})]})]})},iLt=()=>{const{hyperToken:e}=m.useContext(Qr),[t,n]=m.useState(!1);return i.jsxs(i.Fragment,{children:[i.jsx(w$,{open:t,setOpen:n}),i.jsx("div",{className:"bg-[#171717] w-full px-2 sm:px-6 border-b border-[#2a2a2a] z-50",children:i.jsxs("div",{className:"flex items-center w-full h-16 gap-2",children:[i.jsx("div",{className:"flex-none",children:i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(eIt,{}),i.jsx("div",{onClick:()=>{window.location.href="/terminal/extended/BTC#gridbot"},className:"inline-flex font-manrope justify-center items-center gap-2 text-[13px] font-semibold text-white border border-[#6bb8ff] rounded-full px-3 py-[4px] cursor-pointer mr-2 shadow-[0_0_6px_rgba(116,192,252,0.35)] hover:shadow-[0_0_10px_rgba(116,192,252,0.55)] hover:border-[#8ccaff] hover:bg-[#1b2836] transition-all duration-200",children:"Extended Grid Bot"}),i.jsx("div",{onClick:()=>{window.location.href="/dca-bot"},className:"inline-flex font-manrope justify-center items-center gap-2 text-[13px] font-semibold text-white border border-[#6bb8ff] rounded-full px-3 py-[4px] cursor-pointer mr-2 shadow-[0_0_6px_rgba(116,192,252,0.35)] hover:shadow-[0_0_10px_rgba(116,192,252,0.55)] hover:border-[#8ccaff] hover:bg-[#1b2836] transition-all duration-200",children:"Extended DCA Bot"}),i.jsxs("div",{onClick:()=>{n(!0)},className:"inline-flex font-manrope justify-center items-center gap-2 text-[13px] font-semibold text-white border border-[#6bb8ff] rounded-full px-3 py-[4px] cursor-pointer mr-2 shadow-[0_0_6px_rgba(116,192,252,0.35)] hover:shadow-[0_0_10px_rgba(116,192,252,0.55)] hover:border-[#8ccaff] hover:bg-[#1b2836] transition-all duration-200",children:["Extended Farming",i.jsx(v0,{label:"NEW",tone:"emerald"})]})]})}),i.jsxs("div",{className:"ml-auto flex items-center",children:[i.jsx("div",{className:"hidden sm:block w-[140px] mr-[12px]",children:i.jsx(lMe,{})}),e&&i.jsx(tLt,{}),i.jsx(nLt,{}),i.jsx("span",{className:"hidden sm:block ml-2",children:i.jsx(zRt,{})})]})]})})]})},Yh=({className:e})=>i.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e,children:i.jsx("path",{d:"M9.96004 4.4751L6.70004 7.7351C6.31504 8.1201 5.68504 8.1201 5.30004 7.7351L2.04004 4.4751",stroke:"currentColor",strokeWidth:"1.5",strokeMiterlimit:"10",strokeLinecap:"round",strokeLinejoin:"round"})});var As;(function(e){e[e.QR_CODE=0]="QR_CODE",e[e.AZTEC=1]="AZTEC",e[e.CODABAR=2]="CODABAR",e[e.CODE_39=3]="CODE_39",e[e.CODE_93=4]="CODE_93",e[e.CODE_128=5]="CODE_128",e[e.DATA_MATRIX=6]="DATA_MATRIX",e[e.MAXICODE=7]="MAXICODE",e[e.ITF=8]="ITF",e[e.EAN_13=9]="EAN_13",e[e.EAN_8=10]="EAN_8",e[e.PDF_417=11]="PDF_417",e[e.RSS_14=12]="RSS_14",e[e.RSS_EXPANDED=13]="RSS_EXPANDED",e[e.UPC_A=14]="UPC_A",e[e.UPC_E=15]="UPC_E",e[e.UPC_EAN_EXTENSION=16]="UPC_EAN_EXTENSION"})(As||(As={}));var Rbe=new Map([[As.QR_CODE,"QR_CODE"],[As.AZTEC,"AZTEC"],[As.CODABAR,"CODABAR"],[As.CODE_39,"CODE_39"],[As.CODE_93,"CODE_93"],[As.CODE_128,"CODE_128"],[As.DATA_MATRIX,"DATA_MATRIX"],[As.MAXICODE,"MAXICODE"],[As.ITF,"ITF"],[As.EAN_13,"EAN_13"],[As.EAN_8,"EAN_8"],[As.PDF_417,"PDF_417"],[As.RSS_14,"RSS_14"],[As.RSS_EXPANDED,"RSS_EXPANDED"],[As.UPC_A,"UPC_A"],[As.UPC_E,"UPC_E"],[As.UPC_EAN_EXTENSION,"UPC_EAN_EXTENSION"]]),Lbe;(function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.URL=1]="URL"})(Lbe||(Lbe={}));function aLt(e){return Object.values(As).includes(e)}var DR;(function(e){e[e.SCAN_TYPE_CAMERA=0]="SCAN_TYPE_CAMERA",e[e.SCAN_TYPE_FILE=1]="SCAN_TYPE_FILE"})(DR||(DR={}));var oLt=function(){function e(){}return e.GITHUB_PROJECT_URL="https://github.com/mebjas/html5-qrcode",e.SCAN_DEFAULT_FPS=2,e.DEFAULT_DISABLE_FLIP=!1,e.DEFAULT_REMEMBER_LAST_CAMERA_USED=!0,e.DEFAULT_SUPPORTED_SCAN_TYPE=[DR.SCAN_TYPE_CAMERA,DR.SCAN_TYPE_FILE],e}(),ALe=function(){function e(t,n){this.format=t,this.formatName=n}return e.prototype.toString=function(){return this.formatName},e.create=function(t){if(!Rbe.has(t))throw"".concat(t," not in html5QrcodeSupportedFormatsTextMap");return new e(t,Rbe.get(t))},e}(),Dbe=function(){function e(){}return e.createFromText=function(t){var n={text:t};return{decodedText:t,result:n}},e.createFromQrcodeResult=function(t){return{decodedText:t.text,result:t}},e}(),tte;(function(e){e[e.UNKWOWN_ERROR=0]="UNKWOWN_ERROR",e[e.IMPLEMENTATION_ERROR=1]="IMPLEMENTATION_ERROR",e[e.NO_CODE_FOUND_ERROR=2]="NO_CODE_FOUND_ERROR"})(tte||(tte={}));var lLt=function(){function e(){}return e.createFrom=function(t){return{errorMessage:t,type:tte.UNKWOWN_ERROR}},e}(),cLt=function(){function e(t){this.verbose=t}return e.prototype.log=function(t){this.verbose&&console.log(t)},e.prototype.warn=function(t){this.verbose&&console.warn(t)},e.prototype.logError=function(t,n){(this.verbose||n===!0)&&console.error(t)},e.prototype.logErrors=function(t){if(t.length===0)throw"Logger#logError called without arguments";this.verbose&&console.error(t)},e}();function ag(e){return typeof e>"u"||e===null}var DC=function(){function e(){}return e.codeParseError=function(t){return"QR code parse error, error = ".concat(t)},e.errorGettingUserMedia=function(t){return"Error getting userMedia, error = ".concat(t)},e.onlyDeviceSupportedError=function(){return"The device doesn't support navigator.mediaDevices , only supported cameraIdOrConfig in this case is deviceId parameter (string)."},e.cameraStreamingNotSupported=function(){return"Camera streaming not supported by the browser."},e.unableToQuerySupportedDevices=function(){return"Unable to query supported devices, unknown error."},e.insecureContextCameraQueryError=function(){return"Camera access is only supported in secure context like https or localhost."},e.scannerPaused=function(){return"Scanner paused"},e}(),jLe=function(){function e(){}return e.isMediaStreamConstraintsValid=function(t,n){if(typeof t!="object"){var r=typeof t;return n.logError("videoConstraints should be of type object, the "+"object passed is of type ".concat(r,"."),!0),!1}for(var s=["autoGainControl","channelCount","echoCancellation","latency","noiseSuppression","sampleRate","sampleSize","volume"],a=new Set(s),o=Object.keys(t),l=0,c=o;l<c.length;l++){var u=c[l];if(a.has(u))return n.logError("".concat(u," is not supported videoConstaints."),!0),!1}return!0},e}(),jj={exports:{}},uLt=jj.exports,Bbe;function dLt(){return Bbe||(Bbe=1,function(e,t){(function(n,r){r(t)})(uLt,function(n){function r(dt){return dt==null}var s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(dt,y){dt.__proto__=y}||function(dt,y){for(var E in y)y.hasOwnProperty(E)&&(dt[E]=y[E])};function a(dt,y){s(dt,y);function E(){this.constructor=dt}dt.prototype=y===null?Object.create(y):(E.prototype=y.prototype,new E)}function o(dt,y){var E=Object.setPrototypeOf;E?E(dt,y):dt.__proto__=y}function l(dt,y){y===void 0&&(y=dt.constructor);var E=Error.captureStackTrace;E&&E(dt,y)}var c=function(dt){a(y,dt);function y(E){var O=this.constructor,$=dt.call(this,E)||this;return Object.defineProperty($,"name",{value:O.name,enumerable:!1}),o($,O.prototype),l($),$}return y}(Error);class u extends c{constructor(y=void 0){super(y),this.message=y}getKind(){return this.constructor.kind}}u.kind="Exception";class d extends u{}d.kind="ArgumentException";class f extends u{}f.kind="IllegalArgumentException";class x{constructor(y){if(this.binarizer=y,y===null)throw new f("Binarizer must be non-null.")}getWidth(){return this.binarizer.getWidth()}getHeight(){return this.binarizer.getHeight()}getBlackRow(y,E){return this.binarizer.getBlackRow(y,E)}getBlackMatrix(){return(this.matrix===null||this.matrix===void 0)&&(this.matrix=this.binarizer.getBlackMatrix()),this.matrix}isCropSupported(){return this.binarizer.getLuminanceSource().isCropSupported()}crop(y,E,O,$){const H=this.binarizer.getLuminanceSource().crop(y,E,O,$);return new x(this.binarizer.createBinarizer(H))}isRotateSupported(){return this.binarizer.getLuminanceSource().isRotateSupported()}rotateCounterClockwise(){const y=this.binarizer.getLuminanceSource().rotateCounterClockwise();return new x(this.binarizer.createBinarizer(y))}rotateCounterClockwise45(){const y=this.binarizer.getLuminanceSource().rotateCounterClockwise45();return new x(this.binarizer.createBinarizer(y))}toString(){try{return this.getBlackMatrix().toString()}catch{return""}}}class g extends u{static getChecksumInstance(){return new g}}g.kind="ChecksumException";class v{constructor(y){this.source=y}getLuminanceSource(){return this.source}getWidth(){return this.source.getWidth()}getHeight(){return this.source.getHeight()}}class w{static arraycopy(y,E,O,$,H){for(;H--;)O[$++]=y[E++]}static currentTimeMillis(){return Date.now()}}class C extends u{}C.kind="IndexOutOfBoundsException";class N extends C{constructor(y=void 0,E=void 0){super(E),this.index=y,this.message=E}}N.kind="ArrayIndexOutOfBoundsException";class P{static fill(y,E){for(let O=0,$=y.length;O<$;O++)y[O]=E}static fillWithin(y,E,O,$){P.rangeCheck(y.length,E,O);for(let H=E;H<O;H++)y[H]=$}static rangeCheck(y,E,O){if(E>O)throw new f("fromIndex("+E+") > toIndex("+O+")");if(E<0)throw new N(E);if(O>y)throw new N(O)}static asList(...y){return y}static create(y,E,O){return Array.from({length:y}).map(H=>Array.from({length:E}).fill(O))}static createInt32Array(y,E,O){return Array.from({length:y}).map(H=>Int32Array.from({length:E}).fill(O))}static equals(y,E){if(!y||!E||!y.length||!E.length||y.length!==E.length)return!1;for(let O=0,$=y.length;O<$;O++)if(y[O]!==E[O])return!1;return!0}static hashCode(y){if(y===null)return 0;let E=1;for(const O of y)E=31*E+O;return E}static fillUint8Array(y,E){for(let O=0;O!==y.length;O++)y[O]=E}static copyOf(y,E){return y.slice(0,E)}static copyOfUint8Array(y,E){if(y.length<=E){const O=new Uint8Array(E);return O.set(y),O}return y.slice(0,E)}static copyOfRange(y,E,O){const $=O-E,H=new Int32Array($);return w.arraycopy(y,E,H,0,$),H}static binarySearch(y,E,O){O===void 0&&(O=P.numberComparator);let $=0,H=y.length-1;for(;$<=H;){const K=H+$>>1,le=O(E,y[K]);if(le>0)$=K+1;else if(le<0)H=K-1;else return K}return-$-1}static numberComparator(y,E){return y-E}}class I{static numberOfTrailingZeros(y){let E;if(y===0)return 32;let O=31;return E=y<<16,E!==0&&(O-=16,y=E),E=y<<8,E!==0&&(O-=8,y=E),E=y<<4,E!==0&&(O-=4,y=E),E=y<<2,E!==0&&(O-=2,y=E),O-(y<<1>>>31)}static numberOfLeadingZeros(y){if(y===0)return 32;let E=1;return y>>>16||(E+=16,y<<=16),y>>>24||(E+=8,y<<=8),y>>>28||(E+=4,y<<=4),y>>>30||(E+=2,y<<=2),E-=y>>>31,E}static toHexString(y){return y.toString(16)}static toBinaryString(y){return String(parseInt(String(y),2))}static bitCount(y){return y=y-(y>>>1&1431655765),y=(y&858993459)+(y>>>2&858993459),y=y+(y>>>4)&252645135,y=y+(y>>>8),y=y+(y>>>16),y&63}static truncDivision(y,E){return Math.trunc(y/E)}static parseInt(y,E=void 0){return parseInt(y,E)}}I.MIN_VALUE_32_BITS=-2147483648,I.MAX_VALUE=Number.MAX_SAFE_INTEGER;class R{constructor(y,E){y===void 0?(this.size=0,this.bits=new Int32Array(1)):(this.size=y,E==null?this.bits=R.makeArray(y):this.bits=E)}getSize(){return this.size}getSizeInBytes(){return Math.floor((this.size+7)/8)}ensureCapacity(y){if(y>this.bits.length*32){const E=R.makeArray(y);w.arraycopy(this.bits,0,E,0,this.bits.length),this.bits=E}}get(y){return(this.bits[Math.floor(y/32)]&1<<(y&31))!==0}set(y){this.bits[Math.floor(y/32)]|=1<<(y&31)}flip(y){this.bits[Math.floor(y/32)]^=1<<(y&31)}getNextSet(y){const E=this.size;if(y>=E)return E;const O=this.bits;let $=Math.floor(y/32),H=O[$];H&=~((1<<(y&31))-1);const K=O.length;for(;H===0;){if(++$===K)return E;H=O[$]}const le=$*32+I.numberOfTrailingZeros(H);return le>E?E:le}getNextUnset(y){const E=this.size;if(y>=E)return E;const O=this.bits;let $=Math.floor(y/32),H=~O[$];H&=~((1<<(y&31))-1);const K=O.length;for(;H===0;){if(++$===K)return E;H=~O[$]}const le=$*32+I.numberOfTrailingZeros(H);return le>E?E:le}setBulk(y,E){this.bits[Math.floor(y/32)]=E}setRange(y,E){if(E<y||y<0||E>this.size)throw new f;if(E===y)return;E--;const O=Math.floor(y/32),$=Math.floor(E/32),H=this.bits;for(let K=O;K<=$;K++){const le=K>O?0:y&31,Te=(2<<(K<$?31:E&31))-(1<<le);H[K]|=Te}}clear(){const y=this.bits.length,E=this.bits;for(let O=0;O<y;O++)E[O]=0}isRange(y,E,O){if(E<y||y<0||E>this.size)throw new f;if(E===y)return!0;E--;const $=Math.floor(y/32),H=Math.floor(E/32),K=this.bits;for(let le=$;le<=H;le++){const we=le>$?0:y&31,Ze=(2<<(le<H?31:E&31))-(1<<we)&4294967295;if((K[le]&Ze)!==(O?Ze:0))return!1}return!0}appendBit(y){this.ensureCapacity(this.size+1),y&&(this.bits[Math.floor(this.size/32)]|=1<<(this.size&31)),this.size++}appendBits(y,E){if(E<0||E>32)throw new f("Num bits must be between 0 and 32");this.ensureCapacity(this.size+E);for(let O=E;O>0;O--)this.appendBit((y>>O-1&1)===1)}appendBitArray(y){const E=y.size;this.ensureCapacity(this.size+E);for(let O=0;O<E;O++)this.appendBit(y.get(O))}xor(y){if(this.size!==y.size)throw new f("Sizes don't match");const E=this.bits;for(let O=0,$=E.length;O<$;O++)E[O]^=y.bits[O]}toBytes(y,E,O,$){for(let H=0;H<$;H++){let K=0;for(let le=0;le<8;le++)this.get(y)&&(K|=1<<7-le),y++;E[O+H]=K}}getBitArray(){return this.bits}reverse(){const y=new Int32Array(this.bits.length),E=Math.floor((this.size-1)/32),O=E+1,$=this.bits;for(let H=0;H<O;H++){let K=$[H];K=K>>1&1431655765|(K&1431655765)<<1,K=K>>2&858993459|(K&858993459)<<2,K=K>>4&252645135|(K&252645135)<<4,K=K>>8&16711935|(K&16711935)<<8,K=K>>16&65535|(K&65535)<<16,y[E-H]=K}if(this.size!==O*32){const H=O*32-this.size;let K=y[0]>>>H;for(let le=1;le<O;le++){const we=y[le];K|=we<<32-H,y[le-1]=K,K=we>>>H}y[O-1]=K}this.bits=y}static makeArray(y){return new Int32Array(Math.floor((y+31)/32))}equals(y){if(!(y instanceof R))return!1;const E=y;return this.size===E.size&&P.equals(this.bits,E.bits)}hashCode(){return 31*this.size+P.hashCode(this.bits)}toString(){let y="";for(let E=0,O=this.size;E<O;E++)E&7||(y+=" "),y+=this.get(E)?"X":".";return y}clone(){return new R(this.size,this.bits.slice())}}var F;(function(dt){dt[dt.OTHER=0]="OTHER",dt[dt.PURE_BARCODE=1]="PURE_BARCODE",dt[dt.POSSIBLE_FORMATS=2]="POSSIBLE_FORMATS",dt[dt.TRY_HARDER=3]="TRY_HARDER",dt[dt.CHARACTER_SET=4]="CHARACTER_SET",dt[dt.ALLOWED_LENGTHS=5]="ALLOWED_LENGTHS",dt[dt.ASSUME_CODE_39_CHECK_DIGIT=6]="ASSUME_CODE_39_CHECK_DIGIT",dt[dt.ASSUME_GS1=7]="ASSUME_GS1",dt[dt.RETURN_CODABAR_START_END=8]="RETURN_CODABAR_START_END",dt[dt.NEED_RESULT_POINT_CALLBACK=9]="NEED_RESULT_POINT_CALLBACK",dt[dt.ALLOWED_EAN_EXTENSIONS=10]="ALLOWED_EAN_EXTENSIONS"})(F||(F={}));var U=F;class L extends u{static getFormatInstance(){return new L}}L.kind="FormatException";var z;(function(dt){dt[dt.Cp437=0]="Cp437",dt[dt.ISO8859_1=1]="ISO8859_1",dt[dt.ISO8859_2=2]="ISO8859_2",dt[dt.ISO8859_3=3]="ISO8859_3",dt[dt.ISO8859_4=4]="ISO8859_4",dt[dt.ISO8859_5=5]="ISO8859_5",dt[dt.ISO8859_6=6]="ISO8859_6",dt[dt.ISO8859_7=7]="ISO8859_7",dt[dt.ISO8859_8=8]="ISO8859_8",dt[dt.ISO8859_9=9]="ISO8859_9",dt[dt.ISO8859_10=10]="ISO8859_10",dt[dt.ISO8859_11=11]="ISO8859_11",dt[dt.ISO8859_13=12]="ISO8859_13",dt[dt.ISO8859_14=13]="ISO8859_14",dt[dt.ISO8859_15=14]="ISO8859_15",dt[dt.ISO8859_16=15]="ISO8859_16",dt[dt.SJIS=16]="SJIS",dt[dt.Cp1250=17]="Cp1250",dt[dt.Cp1251=18]="Cp1251",dt[dt.Cp1252=19]="Cp1252",dt[dt.Cp1256=20]="Cp1256",dt[dt.UnicodeBigUnmarked=21]="UnicodeBigUnmarked",dt[dt.UTF8=22]="UTF8",dt[dt.ASCII=23]="ASCII",dt[dt.Big5=24]="Big5",dt[dt.GB18030=25]="GB18030",dt[dt.EUC_KR=26]="EUC_KR"})(z||(z={}));class Q{constructor(y,E,O,...$){this.valueIdentifier=y,this.name=O,typeof E=="number"?this.values=Int32Array.from([E]):this.values=E,this.otherEncodingNames=$,Q.VALUE_IDENTIFIER_TO_ECI.set(y,this),Q.NAME_TO_ECI.set(O,this);const H=this.values;for(let K=0,le=H.length;K!==le;K++){const we=H[K];Q.VALUES_TO_ECI.set(we,this)}for(const K of $)Q.NAME_TO_ECI.set(K,this)}getValueIdentifier(){return this.valueIdentifier}getName(){return this.name}getValue(){return this.values[0]}static getCharacterSetECIByValue(y){if(y<0||y>=900)throw new L("incorect value");const E=Q.VALUES_TO_ECI.get(y);if(E===void 0)throw new L("incorect value");return E}static getCharacterSetECIByName(y){const E=Q.NAME_TO_ECI.get(y);if(E===void 0)throw new L("incorect value");return E}equals(y){if(!(y instanceof Q))return!1;const E=y;return this.getName()===E.getName()}}Q.VALUE_IDENTIFIER_TO_ECI=new Map,Q.VALUES_TO_ECI=new Map,Q.NAME_TO_ECI=new Map,Q.Cp437=new Q(z.Cp437,Int32Array.from([0,2]),"Cp437"),Q.ISO8859_1=new Q(z.ISO8859_1,Int32Array.from([1,3]),"ISO-8859-1","ISO88591","ISO8859_1"),Q.ISO8859_2=new Q(z.ISO8859_2,4,"ISO-8859-2","ISO88592","ISO8859_2"),Q.ISO8859_3=new Q(z.ISO8859_3,5,"ISO-8859-3","ISO88593","ISO8859_3"),Q.ISO8859_4=new Q(z.ISO8859_4,6,"ISO-8859-4","ISO88594","ISO8859_4"),Q.ISO8859_5=new Q(z.ISO8859_5,7,"ISO-8859-5","ISO88595","ISO8859_5"),Q.ISO8859_6=new Q(z.ISO8859_6,8,"ISO-8859-6","ISO88596","ISO8859_6"),Q.ISO8859_7=new Q(z.ISO8859_7,9,"ISO-8859-7","ISO88597","ISO8859_7"),Q.ISO8859_8=new Q(z.ISO8859_8,10,"ISO-8859-8","ISO88598","ISO8859_8"),Q.ISO8859_9=new Q(z.ISO8859_9,11,"ISO-8859-9","ISO88599","ISO8859_9"),Q.ISO8859_10=new Q(z.ISO8859_10,12,"ISO-8859-10","ISO885910","ISO8859_10"),Q.ISO8859_11=new Q(z.ISO8859_11,13,"ISO-8859-11","ISO885911","ISO8859_11"),Q.ISO8859_13=new Q(z.ISO8859_13,15,"ISO-8859-13","ISO885913","ISO8859_13"),Q.ISO8859_14=new Q(z.ISO8859_14,16,"ISO-8859-14","ISO885914","ISO8859_14"),Q.ISO8859_15=new Q(z.ISO8859_15,17,"ISO-8859-15","ISO885915","ISO8859_15"),Q.ISO8859_16=new Q(z.ISO8859_16,18,"ISO-8859-16","ISO885916","ISO8859_16"),Q.SJIS=new Q(z.SJIS,20,"SJIS","Shift_JIS"),Q.Cp1250=new Q(z.Cp1250,21,"Cp1250","windows-1250"),Q.Cp1251=new Q(z.Cp1251,22,"Cp1251","windows-1251"),Q.Cp1252=new Q(z.Cp1252,23,"Cp1252","windows-1252"),Q.Cp1256=new Q(z.Cp1256,24,"Cp1256","windows-1256"),Q.UnicodeBigUnmarked=new Q(z.UnicodeBigUnmarked,25,"UnicodeBigUnmarked","UTF-16BE","UnicodeBig"),Q.UTF8=new Q(z.UTF8,26,"UTF8","UTF-8"),Q.ASCII=new Q(z.ASCII,Int32Array.from([27,170]),"ASCII","US-ASCII"),Q.Big5=new Q(z.Big5,28,"Big5"),Q.GB18030=new Q(z.GB18030,29,"GB18030","GB2312","EUC_CN","GBK"),Q.EUC_KR=new Q(z.EUC_KR,30,"EUC_KR","EUC-KR");class ne extends u{}ne.kind="UnsupportedOperationException";class J{static decode(y,E){const O=this.encodingName(E);return this.customDecoder?this.customDecoder(y,O):typeof TextDecoder>"u"||this.shouldDecodeOnFallback(O)?this.decodeFallback(y,O):new TextDecoder(O).decode(y)}static shouldDecodeOnFallback(y){return!J.isBrowser()&&y==="ISO-8859-1"}static encode(y,E){const O=this.encodingName(E);return this.customEncoder?this.customEncoder(y,O):typeof TextEncoder>"u"?this.encodeFallback(y):new TextEncoder().encode(y)}static isBrowser(){return typeof window<"u"&&{}.toString.call(window)==="[object Window]"}static encodingName(y){return typeof y=="string"?y:y.getName()}static encodingCharacterSet(y){return y instanceof Q?y:Q.getCharacterSetECIByName(y)}static decodeFallback(y,E){const O=this.encodingCharacterSet(E);if(J.isDecodeFallbackSupported(O)){let $="";for(let H=0,K=y.length;H<K;H++){let le=y[H].toString(16);le.length<2&&(le="0"+le),$+="%"+le}return decodeURIComponent($)}if(O.equals(Q.UnicodeBigUnmarked))return String.fromCharCode.apply(null,new Uint16Array(y.buffer));throw new ne(`Encoding ${this.encodingName(E)} not supported by fallback.`)}static isDecodeFallbackSupported(y){return y.equals(Q.UTF8)||y.equals(Q.ISO8859_1)||y.equals(Q.ASCII)}static encodeFallback(y){const O=btoa(unescape(encodeURIComponent(y))).split(""),$=[];for(let H=0;H<O.length;H++)$.push(O[H].charCodeAt(0));return new Uint8Array($)}}class X{static castAsNonUtf8Char(y,E=null){const O=E?E.getName():this.ISO88591;return J.decode(new Uint8Array([y]),O)}static guessEncoding(y,E){if(E!=null&&E.get(U.CHARACTER_SET)!==void 0)return E.get(U.CHARACTER_SET).toString();const O=y.length;let $=!0,H=!0,K=!0,le=0,we=0,Te=0,Ze=0,pt=0,_t=0,Jt=0,Ct=0,Ht=0,Kt=0,An=0;const hr=y.length>3&&y[0]===239&&y[1]===187&&y[2]===191;for(let wr=0;wr<O&&($||H||K);wr++){const Sr=y[wr]&255;K&&(le>0?Sr&128?le--:K=!1:Sr&128&&(Sr&64?(le++,Sr&32?(le++,Sr&16?(le++,Sr&8?K=!1:Ze++):Te++):we++):K=!1)),$&&(Sr>127&&Sr<160?$=!1:Sr>159&&(Sr<192||Sr===215||Sr===247)&&An++),H&&(pt>0?Sr<64||Sr===127||Sr>252?H=!1:pt--:Sr===128||Sr===160||Sr>239?H=!1:Sr>160&&Sr<224?(_t++,Ct=0,Jt++,Jt>Ht&&(Ht=Jt)):Sr>127?(pt++,Jt=0,Ct++,Ct>Kt&&(Kt=Ct)):(Jt=0,Ct=0))}return K&&le>0&&(K=!1),H&&pt>0&&(H=!1),K&&(hr||we+Te+Ze>0)?X.UTF8:H&&(X.ASSUME_SHIFT_JIS||Ht>=3||Kt>=3)?X.SHIFT_JIS:$&&H?Ht===2&&_t===2||An*10>=O?X.SHIFT_JIS:X.ISO88591:$?X.ISO88591:H?X.SHIFT_JIS:K?X.UTF8:X.PLATFORM_DEFAULT_ENCODING}static format(y,...E){let O=-1;function $(K,le,we,Te,Ze,pt){if(K==="%%")return"%";if(E[++O]===void 0)return;K=Te?parseInt(Te.substr(1)):void 0;let _t=Ze?parseInt(Ze.substr(1)):void 0,Jt;switch(pt){case"s":Jt=E[O];break;case"c":Jt=E[O][0];break;case"f":Jt=parseFloat(E[O]).toFixed(K);break;case"p":Jt=parseFloat(E[O]).toPrecision(K);break;case"e":Jt=parseFloat(E[O]).toExponential(K);break;case"x":Jt=parseInt(E[O]).toString(_t||16);break;case"d":Jt=parseFloat(parseInt(E[O],_t||10).toPrecision(K)).toFixed(0);break}Jt=typeof Jt=="object"?JSON.stringify(Jt):(+Jt).toString(_t);let Ct=parseInt(we),Ht=we&&we[0]+""=="0"?"0":" ";for(;Jt.length<Ct;)Jt=le!==void 0?Jt+Ht:Ht+Jt;return Jt}let H=/%(-)?(0?[0-9]+)?([.][0-9]+)?([#][0-9]+)?([scfpexd%])/g;return y.replace(H,$)}static getBytes(y,E){return J.encode(y,E)}static getCharCode(y,E=0){return y.charCodeAt(E)}static getCharAt(y){return String.fromCharCode(y)}}X.SHIFT_JIS=Q.SJIS.getName(),X.GB2312="GB2312",X.ISO88591=Q.ISO8859_1.getName(),X.EUC_JP="EUC_JP",X.UTF8=Q.UTF8.getName(),X.PLATFORM_DEFAULT_ENCODING=X.UTF8,X.ASSUME_SHIFT_JIS=!1;class re{constructor(y=""){this.value=y}enableDecoding(y){return this.encoding=y,this}append(y){return typeof y=="string"?this.value+=y.toString():this.encoding?this.value+=X.castAsNonUtf8Char(y,this.encoding):this.value+=String.fromCharCode(y),this}appendChars(y,E,O){for(let $=E;E<E+O;$++)this.append(y[$]);return this}length(){return this.value.length}charAt(y){return this.value.charAt(y)}deleteCharAt(y){this.value=this.value.substr(0,y)+this.value.substring(y+1)}setCharAt(y,E){this.value=this.value.substr(0,y)+E+this.value.substr(y+1)}substring(y,E){return this.value.substring(y,E)}setLengthToZero(){this.value=""}toString(){return this.value}insert(y,E){this.value=this.value.substr(0,y)+E+this.value.substr(y+E.length)}}class pe{constructor(y,E,O,$){if(this.width=y,this.height=E,this.rowSize=O,this.bits=$,E==null&&(E=y),this.height=E,y<1||E<1)throw new f("Both dimensions must be greater than 0");O==null&&(O=Math.floor((y+31)/32)),this.rowSize=O,$==null&&(this.bits=new Int32Array(this.rowSize*this.height))}static parseFromBooleanArray(y){const E=y.length,O=y[0].length,$=new pe(O,E);for(let H=0;H<E;H++){const K=y[H];for(let le=0;le<O;le++)K[le]&&$.set(le,H)}return $}static parseFromString(y,E,O){if(y===null)throw new f("stringRepresentation cannot be null");const $=new Array(y.length);let H=0,K=0,le=-1,we=0,Te=0;for(;Te<y.length;)if(y.charAt(Te)===`
`||y.charAt(Te)==="\r"){if(H>K){if(le===-1)le=H-K;else if(H-K!==le)throw new f("row lengths do not match");K=H,we++}Te++}else if(y.substring(Te,Te+E.length)===E)Te+=E.length,$[H]=!0,H++;else if(y.substring(Te,Te+O.length)===O)Te+=O.length,$[H]=!1,H++;else throw new f("illegal character encountered: "+y.substring(Te));if(H>K){if(le===-1)le=H-K;else if(H-K!==le)throw new f("row lengths do not match");we++}const Ze=new pe(le,we);for(let pt=0;pt<H;pt++)$[pt]&&Ze.set(Math.floor(pt%le),Math.floor(pt/le));return Ze}get(y,E){const O=E*this.rowSize+Math.floor(y/32);return(this.bits[O]>>>(y&31)&1)!==0}set(y,E){const O=E*this.rowSize+Math.floor(y/32);this.bits[O]|=1<<(y&31)&4294967295}unset(y,E){const O=E*this.rowSize+Math.floor(y/32);this.bits[O]&=~(1<<(y&31)&4294967295)}flip(y,E){const O=E*this.rowSize+Math.floor(y/32);this.bits[O]^=1<<(y&31)&4294967295}xor(y){if(this.width!==y.getWidth()||this.height!==y.getHeight()||this.rowSize!==y.getRowSize())throw new f("input matrix dimensions do not match");const E=new R(Math.floor(this.width/32)+1),O=this.rowSize,$=this.bits;for(let H=0,K=this.height;H<K;H++){const le=H*O,we=y.getRow(H,E).getBitArray();for(let Te=0;Te<O;Te++)$[le+Te]^=we[Te]}}clear(){const y=this.bits,E=y.length;for(let O=0;O<E;O++)y[O]=0}setRegion(y,E,O,$){if(E<0||y<0)throw new f("Left and top must be nonnegative");if($<1||O<1)throw new f("Height and width must be at least 1");const H=y+O,K=E+$;if(K>this.height||H>this.width)throw new f("The region must fit inside the matrix");const le=this.rowSize,we=this.bits;for(let Te=E;Te<K;Te++){const Ze=Te*le;for(let pt=y;pt<H;pt++)we[Ze+Math.floor(pt/32)]|=1<<(pt&31)&4294967295}}getRow(y,E){E==null||E.getSize()<this.width?E=new R(this.width):E.clear();const O=this.rowSize,$=this.bits,H=y*O;for(let K=0;K<O;K++)E.setBulk(K*32,$[H+K]);return E}setRow(y,E){w.arraycopy(E.getBitArray(),0,this.bits,y*this.rowSize,this.rowSize)}rotate180(){const y=this.getWidth(),E=this.getHeight();let O=new R(y),$=new R(y);for(let H=0,K=Math.floor((E+1)/2);H<K;H++)O=this.getRow(H,O),$=this.getRow(E-1-H,$),O.reverse(),$.reverse(),this.setRow(H,$),this.setRow(E-1-H,O)}getEnclosingRectangle(){const y=this.width,E=this.height,O=this.rowSize,$=this.bits;let H=y,K=E,le=-1,we=-1;for(let Te=0;Te<E;Te++)for(let Ze=0;Ze<O;Ze++){const pt=$[Te*O+Ze];if(pt!==0){if(Te<K&&(K=Te),Te>we&&(we=Te),Ze*32<H){let _t=0;for(;!(pt<<31-_t&4294967295);)_t++;Ze*32+_t<H&&(H=Ze*32+_t)}if(Ze*32+31>le){let _t=31;for(;!(pt>>>_t);)_t--;Ze*32+_t>le&&(le=Ze*32+_t)}}}return le<H||we<K?null:Int32Array.from([H,K,le-H+1,we-K+1])}getTopLeftOnBit(){const y=this.rowSize,E=this.bits;let O=0;for(;O<E.length&&E[O]===0;)O++;if(O===E.length)return null;const $=O/y;let H=O%y*32;const K=E[O];let le=0;for(;!(K<<31-le&4294967295);)le++;return H+=le,Int32Array.from([H,$])}getBottomRightOnBit(){const y=this.rowSize,E=this.bits;let O=E.length-1;for(;O>=0&&E[O]===0;)O--;if(O<0)return null;const $=Math.floor(O/y);let H=Math.floor(O%y)*32;const K=E[O];let le=31;for(;!(K>>>le);)le--;return H+=le,Int32Array.from([H,$])}getWidth(){return this.width}getHeight(){return this.height}getRowSize(){return this.rowSize}equals(y){if(!(y instanceof pe))return!1;const E=y;return this.width===E.width&&this.height===E.height&&this.rowSize===E.rowSize&&P.equals(this.bits,E.bits)}hashCode(){let y=this.width;return y=31*y+this.width,y=31*y+this.height,y=31*y+this.rowSize,y=31*y+P.hashCode(this.bits),y}toString(y="X ",E=" ",O=`
`){return this.buildToString(y,E,O)}buildToString(y,E,O){let $=new re;for(let H=0,K=this.height;H<K;H++){for(let le=0,we=this.width;le<we;le++)$.append(this.get(le,H)?y:E);$.append(O)}return $.toString()}clone(){return new pe(this.width,this.height,this.rowSize,this.bits.slice())}}class Y extends u{static getNotFoundInstance(){return new Y}}Y.kind="NotFoundException";class ie extends v{constructor(y){super(y),this.luminances=ie.EMPTY,this.buckets=new Int32Array(ie.LUMINANCE_BUCKETS)}getBlackRow(y,E){const O=this.getLuminanceSource(),$=O.getWidth();E==null||E.getSize()<$?E=new R($):E.clear(),this.initArrays($);const H=O.getRow(y,this.luminances),K=this.buckets;for(let we=0;we<$;we++)K[(H[we]&255)>>ie.LUMINANCE_SHIFT]++;const le=ie.estimateBlackPoint(K);if($<3)for(let we=0;we<$;we++)(H[we]&255)<le&&E.set(we);else{let we=H[0]&255,Te=H[1]&255;for(let Ze=1;Ze<$-1;Ze++){const pt=H[Ze+1]&255;(Te*4-we-pt)/2<le&&E.set(Ze),we=Te,Te=pt}}return E}getBlackMatrix(){const y=this.getLuminanceSource(),E=y.getWidth(),O=y.getHeight(),$=new pe(E,O);this.initArrays(E);const H=this.buckets;for(let we=1;we<5;we++){const Te=Math.floor(O*we/5),Ze=y.getRow(Te,this.luminances),pt=Math.floor(E*4/5);for(let _t=Math.floor(E/5);_t<pt;_t++){const Jt=Ze[_t]&255;H[Jt>>ie.LUMINANCE_SHIFT]++}}const K=ie.estimateBlackPoint(H),le=y.getMatrix();for(let we=0;we<O;we++){const Te=we*E;for(let Ze=0;Ze<E;Ze++)(le[Te+Ze]&255)<K&&$.set(Ze,we)}return $}createBinarizer(y){return new ie(y)}initArrays(y){this.luminances.length<y&&(this.luminances=new Uint8ClampedArray(y));const E=this.buckets;for(let O=0;O<ie.LUMINANCE_BUCKETS;O++)E[O]=0}static estimateBlackPoint(y){const E=y.length;let O=0,$=0,H=0;for(let Ze=0;Ze<E;Ze++)y[Ze]>H&&($=Ze,H=y[Ze]),y[Ze]>O&&(O=y[Ze]);let K=0,le=0;for(let Ze=0;Ze<E;Ze++){const pt=Ze-$,_t=y[Ze]*pt*pt;_t>le&&(K=Ze,le=_t)}if($>K){const Ze=$;$=K,K=Ze}if(K-$<=E/16)throw new Y;let we=K-1,Te=-1;for(let Ze=K-1;Ze>$;Ze--){const pt=Ze-$,_t=pt*pt*(K-Ze)*(O-y[Ze]);_t>Te&&(we=Ze,Te=_t)}return we<<ie.LUMINANCE_SHIFT}}ie.LUMINANCE_BITS=5,ie.LUMINANCE_SHIFT=8-ie.LUMINANCE_BITS,ie.LUMINANCE_BUCKETS=1<<ie.LUMINANCE_BITS,ie.EMPTY=Uint8ClampedArray.from([0]);class oe extends ie{constructor(y){super(y),this.matrix=null}getBlackMatrix(){if(this.matrix!==null)return this.matrix;const y=this.getLuminanceSource(),E=y.getWidth(),O=y.getHeight();if(E>=oe.MINIMUM_DIMENSION&&O>=oe.MINIMUM_DIMENSION){const $=y.getMatrix();let H=E>>oe.BLOCK_SIZE_POWER;E&oe.BLOCK_SIZE_MASK&&H++;let K=O>>oe.BLOCK_SIZE_POWER;O&oe.BLOCK_SIZE_MASK&&K++;const le=oe.calculateBlackPoints($,H,K,E,O),we=new pe(E,O);oe.calculateThresholdForBlock($,H,K,E,O,le,we),this.matrix=we}else this.matrix=super.getBlackMatrix();return this.matrix}createBinarizer(y){return new oe(y)}static calculateThresholdForBlock(y,E,O,$,H,K,le){const we=H-oe.BLOCK_SIZE,Te=$-oe.BLOCK_SIZE;for(let Ze=0;Ze<O;Ze++){let pt=Ze<<oe.BLOCK_SIZE_POWER;pt>we&&(pt=we);const _t=oe.cap(Ze,2,O-3);for(let Jt=0;Jt<E;Jt++){let Ct=Jt<<oe.BLOCK_SIZE_POWER;Ct>Te&&(Ct=Te);const Ht=oe.cap(Jt,2,E-3);let Kt=0;for(let hr=-2;hr<=2;hr++){const wr=K[_t+hr];Kt+=wr[Ht-2]+wr[Ht-1]+wr[Ht]+wr[Ht+1]+wr[Ht+2]}const An=Kt/25;oe.thresholdBlock(y,Ct,pt,An,$,le)}}}static cap(y,E,O){return y<E?E:y>O?O:y}static thresholdBlock(y,E,O,$,H,K){for(let le=0,we=O*H+E;le<oe.BLOCK_SIZE;le++,we+=H)for(let Te=0;Te<oe.BLOCK_SIZE;Te++)(y[we+Te]&255)<=$&&K.set(E+Te,O+le)}static calculateBlackPoints(y,E,O,$,H){const K=H-oe.BLOCK_SIZE,le=$-oe.BLOCK_SIZE,we=new Array(O);for(let Te=0;Te<O;Te++){we[Te]=new Int32Array(E);let Ze=Te<<oe.BLOCK_SIZE_POWER;Ze>K&&(Ze=K);for(let pt=0;pt<E;pt++){let _t=pt<<oe.BLOCK_SIZE_POWER;_t>le&&(_t=le);let Jt=0,Ct=255,Ht=0;for(let An=0,hr=Ze*$+_t;An<oe.BLOCK_SIZE;An++,hr+=$){for(let wr=0;wr<oe.BLOCK_SIZE;wr++){const Sr=y[hr+wr]&255;Jt+=Sr,Sr<Ct&&(Ct=Sr),Sr>Ht&&(Ht=Sr)}if(Ht-Ct>oe.MIN_DYNAMIC_RANGE)for(An++,hr+=$;An<oe.BLOCK_SIZE;An++,hr+=$)for(let wr=0;wr<oe.BLOCK_SIZE;wr++)Jt+=y[hr+wr]&255}let Kt=Jt>>oe.BLOCK_SIZE_POWER*2;if(Ht-Ct<=oe.MIN_DYNAMIC_RANGE&&(Kt=Ct/2,Te>0&&pt>0)){const An=(we[Te-1][pt]+2*we[Te][pt-1]+we[Te-1][pt-1])/4;Ct<An&&(Kt=An)}we[Te][pt]=Kt}}return we}}oe.BLOCK_SIZE_POWER=3,oe.BLOCK_SIZE=1<<oe.BLOCK_SIZE_POWER,oe.BLOCK_SIZE_MASK=oe.BLOCK_SIZE-1,oe.MINIMUM_DIMENSION=oe.BLOCK_SIZE*5,oe.MIN_DYNAMIC_RANGE=24;class G{constructor(y,E){this.width=y,this.height=E}getWidth(){return this.width}getHeight(){return this.height}isCropSupported(){return!1}crop(y,E,O,$){throw new ne("This luminance source does not support cropping.")}isRotateSupported(){return!1}rotateCounterClockwise(){throw new ne("This luminance source does not support rotation by 90 degrees.")}rotateCounterClockwise45(){throw new ne("This luminance source does not support rotation by 45 degrees.")}toString(){const y=new Uint8ClampedArray(this.width);let E=new re;for(let O=0;O<this.height;O++){const $=this.getRow(O,y);for(let H=0;H<this.width;H++){const K=$[H]&255;let le;K<64?le="#":K<128?le="+":K<192?le=".":le=" ",E.append(le)}E.append(`
`)}return E.toString()}}class V extends G{constructor(y){super(y.getWidth(),y.getHeight()),this.delegate=y}getRow(y,E){const O=this.delegate.getRow(y,E),$=this.getWidth();for(let H=0;H<$;H++)O[H]=255-(O[H]&255);return O}getMatrix(){const y=this.delegate.getMatrix(),E=this.getWidth()*this.getHeight(),O=new Uint8ClampedArray(E);for(let $=0;$<E;$++)O[$]=255-(y[$]&255);return O}isCropSupported(){return this.delegate.isCropSupported()}crop(y,E,O,$){return new V(this.delegate.crop(y,E,O,$))}isRotateSupported(){return this.delegate.isRotateSupported()}invert(){return this.delegate}rotateCounterClockwise(){return new V(this.delegate.rotateCounterClockwise())}rotateCounterClockwise45(){return new V(this.delegate.rotateCounterClockwise45())}}class ee extends G{constructor(y){super(y.width,y.height),this.canvas=y,this.tempCanvasElement=null,this.buffer=ee.makeBufferFromCanvasImageData(y)}static makeBufferFromCanvasImageData(y){const E=y.getContext("2d").getImageData(0,0,y.width,y.height);return ee.toGrayscaleBuffer(E.data,y.width,y.height)}static toGrayscaleBuffer(y,E,O){const $=new Uint8ClampedArray(E*O);for(let H=0,K=0,le=y.length;H<le;H+=4,K++){let we;if(y[H+3]===0)we=255;else{const Ze=y[H],pt=y[H+1],_t=y[H+2];we=306*Ze+601*pt+117*_t+512>>10}$[K]=we}return $}getRow(y,E){if(y<0||y>=this.getHeight())throw new f("Requested row is outside the image: "+y);const O=this.getWidth(),$=y*O;return E===null?E=this.buffer.slice($,$+O):(E.length<O&&(E=new Uint8ClampedArray(O)),E.set(this.buffer.slice($,$+O))),E}getMatrix(){return this.buffer}isCropSupported(){return!0}crop(y,E,O,$){return super.crop(y,E,O,$),this}isRotateSupported(){return!0}rotateCounterClockwise(){return this.rotate(-90),this}rotateCounterClockwise45(){return this.rotate(-45),this}getTempCanvasElement(){if(this.tempCanvasElement===null){const y=this.canvas.ownerDocument.createElement("canvas");y.width=this.canvas.width,y.height=this.canvas.height,this.tempCanvasElement=y}return this.tempCanvasElement}rotate(y){const E=this.getTempCanvasElement(),O=E.getContext("2d"),$=y*ee.DEGREE_TO_RADIANS,H=this.canvas.width,K=this.canvas.height,le=Math.ceil(Math.abs(Math.cos($))*H+Math.abs(Math.sin($))*K),we=Math.ceil(Math.abs(Math.sin($))*H+Math.abs(Math.cos($))*K);return E.width=le,E.height=we,O.translate(le/2,we/2),O.rotate($),O.drawImage(this.canvas,H/-2,K/-2),this.buffer=ee.makeBufferFromCanvasImageData(E),this}invert(){return new V(this)}}ee.DEGREE_TO_RADIANS=Math.PI/180;class ae{constructor(y,E,O){this.deviceId=y,this.label=E,this.kind="videoinput",this.groupId=O||void 0}toJSON(){return{kind:this.kind,groupId:this.groupId,deviceId:this.deviceId,label:this.label}}}var fe=(globalThis||Tu||self||window||void 0)&&(globalThis||Tu||self||window||void 0).__awaiter||function(dt,y,E,O){function $(H){return H instanceof E?H:new E(function(K){K(H)})}return new(E||(E=Promise))(function(H,K){function le(Ze){try{Te(O.next(Ze))}catch(pt){K(pt)}}function we(Ze){try{Te(O.throw(Ze))}catch(pt){K(pt)}}function Te(Ze){Ze.done?H(Ze.value):$(Ze.value).then(le,we)}Te((O=O.apply(dt,y||[])).next())})};class Ne{constructor(y,E=500,O){this.reader=y,this.timeBetweenScansMillis=E,this._hints=O,this._stopContinuousDecode=!1,this._stopAsyncDecode=!1,this._timeBetweenDecodingAttempts=0}get hasNavigator(){return typeof navigator<"u"}get isMediaDevicesSuported(){return this.hasNavigator&&!!navigator.mediaDevices}get canEnumerateDevices(){return!!(this.isMediaDevicesSuported&&navigator.mediaDevices.enumerateDevices)}get timeBetweenDecodingAttempts(){return this._timeBetweenDecodingAttempts}set timeBetweenDecodingAttempts(y){this._timeBetweenDecodingAttempts=y<0?0:y}set hints(y){this._hints=y||null}get hints(){return this._hints}listVideoInputDevices(){return fe(this,void 0,void 0,function*(){if(!this.hasNavigator)throw new Error("Can't enumerate devices, navigator is not present.");if(!this.canEnumerateDevices)throw new Error("Can't enumerate devices, method not supported.");const y=yield navigator.mediaDevices.enumerateDevices(),E=[];for(const O of y){const $=O.kind==="video"?"videoinput":O.kind;if($!=="videoinput")continue;const H=O.deviceId||O.id,K=O.label||`Video device ${E.length+1}`,le=O.groupId,we={deviceId:H,label:K,kind:$,groupId:le};E.push(we)}return E})}getVideoInputDevices(){return fe(this,void 0,void 0,function*(){return(yield this.listVideoInputDevices()).map(E=>new ae(E.deviceId,E.label))})}findDeviceById(y){return fe(this,void 0,void 0,function*(){const E=yield this.listVideoInputDevices();return E?E.find(O=>O.deviceId===y):null})}decodeFromInputVideoDevice(y,E){return fe(this,void 0,void 0,function*(){return yield this.decodeOnceFromVideoDevice(y,E)})}decodeOnceFromVideoDevice(y,E){return fe(this,void 0,void 0,function*(){this.reset();let O;y?O={deviceId:{exact:y}}:O={facingMode:"environment"};const $={video:O};return yield this.decodeOnceFromConstraints($,E)})}decodeOnceFromConstraints(y,E){return fe(this,void 0,void 0,function*(){const O=yield navigator.mediaDevices.getUserMedia(y);return yield this.decodeOnceFromStream(O,E)})}decodeOnceFromStream(y,E){return fe(this,void 0,void 0,function*(){this.reset();const O=yield this.attachStreamToVideo(y,E);return yield this.decodeOnce(O)})}decodeFromInputVideoDeviceContinuously(y,E,O){return fe(this,void 0,void 0,function*(){return yield this.decodeFromVideoDevice(y,E,O)})}decodeFromVideoDevice(y,E,O){return fe(this,void 0,void 0,function*(){let $;y?$={deviceId:{exact:y}}:$={facingMode:"environment"};const H={video:$};return yield this.decodeFromConstraints(H,E,O)})}decodeFromConstraints(y,E,O){return fe(this,void 0,void 0,function*(){const $=yield navigator.mediaDevices.getUserMedia(y);return yield this.decodeFromStream($,E,O)})}decodeFromStream(y,E,O){return fe(this,void 0,void 0,function*(){this.reset();const $=yield this.attachStreamToVideo(y,E);return yield this.decodeContinuously($,O)})}stopAsyncDecode(){this._stopAsyncDecode=!0}stopContinuousDecode(){this._stopContinuousDecode=!0}attachStreamToVideo(y,E){return fe(this,void 0,void 0,function*(){const O=this.prepareVideoElement(E);return this.addVideoSource(O,y),this.videoElement=O,this.stream=y,yield this.playVideoOnLoadAsync(O),O})}playVideoOnLoadAsync(y){return new Promise((E,O)=>this.playVideoOnLoad(y,()=>E()))}playVideoOnLoad(y,E){this.videoEndedListener=()=>this.stopStreams(),this.videoCanPlayListener=()=>this.tryPlayVideo(y),y.addEventListener("ended",this.videoEndedListener),y.addEventListener("canplay",this.videoCanPlayListener),y.addEventListener("playing",E),this.tryPlayVideo(y)}isVideoPlaying(y){return y.currentTime>0&&!y.paused&&!y.ended&&y.readyState>2}tryPlayVideo(y){return fe(this,void 0,void 0,function*(){if(this.isVideoPlaying(y)){console.warn("Trying to play video that is already playing.");return}try{yield y.play()}catch{console.warn("It was not possible to play the video.")}})}getMediaElement(y,E){const O=document.getElementById(y);if(!O)throw new d(`element with id '${y}' not found`);if(O.nodeName.toLowerCase()!==E.toLowerCase())throw new d(`element with id '${y}' must be an ${E} element`);return O}decodeFromImage(y,E){if(!y&&!E)throw new d("either imageElement with a src set or an url must be provided");return E&&!y?this.decodeFromImageUrl(E):this.decodeFromImageElement(y)}decodeFromVideo(y,E){if(!y&&!E)throw new d("Either an element with a src set or an URL must be provided");return E&&!y?this.decodeFromVideoUrl(E):this.decodeFromVideoElement(y)}decodeFromVideoContinuously(y,E,O){if(y===void 0&&E===void 0)throw new d("Either an element with a src set or an URL must be provided");return E&&!y?this.decodeFromVideoUrlContinuously(E,O):this.decodeFromVideoElementContinuously(y,O)}decodeFromImageElement(y){if(!y)throw new d("An image element must be provided.");this.reset();const E=this.prepareImageElement(y);this.imageElement=E;let O;return this.isImageLoaded(E)?O=this.decodeOnce(E,!1,!0):O=this._decodeOnLoadImage(E),O}decodeFromVideoElement(y){const E=this._decodeFromVideoElementSetup(y);return this._decodeOnLoadVideo(E)}decodeFromVideoElementContinuously(y,E){const O=this._decodeFromVideoElementSetup(y);return this._decodeOnLoadVideoContinuously(O,E)}_decodeFromVideoElementSetup(y){if(!y)throw new d("A video element must be provided.");this.reset();const E=this.prepareVideoElement(y);return this.videoElement=E,E}decodeFromImageUrl(y){if(!y)throw new d("An URL must be provided.");this.reset();const E=this.prepareImageElement();this.imageElement=E;const O=this._decodeOnLoadImage(E);return E.src=y,O}decodeFromVideoUrl(y){if(!y)throw new d("An URL must be provided.");this.reset();const E=this.prepareVideoElement(),O=this.decodeFromVideoElement(E);return E.src=y,O}decodeFromVideoUrlContinuously(y,E){if(!y)throw new d("An URL must be provided.");this.reset();const O=this.prepareVideoElement(),$=this.decodeFromVideoElementContinuously(O,E);return O.src=y,$}_decodeOnLoadImage(y){return new Promise((E,O)=>{this.imageLoadedListener=()=>this.decodeOnce(y,!1,!0).then(E,O),y.addEventListener("load",this.imageLoadedListener)})}_decodeOnLoadVideo(y){return fe(this,void 0,void 0,function*(){return yield this.playVideoOnLoadAsync(y),yield this.decodeOnce(y)})}_decodeOnLoadVideoContinuously(y,E){return fe(this,void 0,void 0,function*(){yield this.playVideoOnLoadAsync(y),this.decodeContinuously(y,E)})}isImageLoaded(y){return!(!y.complete||y.naturalWidth===0)}prepareImageElement(y){let E;return typeof y>"u"&&(E=document.createElement("img"),E.width=200,E.height=200),typeof y=="string"&&(E=this.getMediaElement(y,"img")),y instanceof HTMLImageElement&&(E=y),E}prepareVideoElement(y){let E;return!y&&typeof document<"u"&&(E=document.createElement("video"),E.width=200,E.height=200),typeof y=="string"&&(E=this.getMediaElement(y,"video")),y instanceof HTMLVideoElement&&(E=y),E.setAttribute("autoplay","true"),E.setAttribute("muted","true"),E.setAttribute("playsinline","true"),E}decodeOnce(y,E=!0,O=!0){this._stopAsyncDecode=!1;const $=(H,K)=>{if(this._stopAsyncDecode){K(new Y("Video stream has ended before any code could be detected.")),this._stopAsyncDecode=void 0;return}try{const le=this.decode(y);H(le)}catch(le){const we=E&&le instanceof Y,Ze=(le instanceof g||le instanceof L)&&O;if(we||Ze)return setTimeout($,this._timeBetweenDecodingAttempts,H,K);K(le)}};return new Promise((H,K)=>$(H,K))}decodeContinuously(y,E){this._stopContinuousDecode=!1;const O=()=>{if(this._stopContinuousDecode){this._stopContinuousDecode=void 0;return}try{const $=this.decode(y);E($,null),setTimeout(O,this.timeBetweenScansMillis)}catch($){E(null,$);const H=$ instanceof g||$ instanceof L,K=$ instanceof Y;(H||K)&&setTimeout(O,this._timeBetweenDecodingAttempts)}};O()}decode(y){const E=this.createBinaryBitmap(y);return this.decodeBitmap(E)}_isHTMLVideoElement(y){return y.videoWidth!==0}drawFrameOnCanvas(y,E,O){E||(E={sx:0,sy:0,sWidth:y.videoWidth,sHeight:y.videoHeight,dx:0,dy:0,dWidth:y.videoWidth,dHeight:y.videoHeight}),O||(O=this.captureCanvasContext),O.drawImage(y,E.sx,E.sy,E.sWidth,E.sHeight,E.dx,E.dy,E.dWidth,E.dHeight)}drawImageOnCanvas(y,E,O=this.captureCanvasContext){E||(E={sx:0,sy:0,sWidth:y.naturalWidth,sHeight:y.naturalHeight,dx:0,dy:0,dWidth:y.naturalWidth,dHeight:y.naturalHeight}),O||(O=this.captureCanvasContext),O.drawImage(y,E.sx,E.sy,E.sWidth,E.sHeight,E.dx,E.dy,E.dWidth,E.dHeight)}createBinaryBitmap(y){this.getCaptureCanvasContext(y),this._isHTMLVideoElement(y)?this.drawFrameOnCanvas(y):this.drawImageOnCanvas(y);const E=this.getCaptureCanvas(y),O=new ee(E),$=new oe(O);return new x($)}getCaptureCanvasContext(y){if(!this.captureCanvasContext){const O=this.getCaptureCanvas(y).getContext("2d");this.captureCanvasContext=O}return this.captureCanvasContext}getCaptureCanvas(y){if(!this.captureCanvas){const E=this.createCaptureCanvas(y);this.captureCanvas=E}return this.captureCanvas}decodeBitmap(y){return this.reader.decode(y,this._hints)}createCaptureCanvas(y){if(typeof document>"u")return this._destroyCaptureCanvas(),null;const E=document.createElement("canvas");let O,$;return typeof y<"u"&&(y instanceof HTMLVideoElement?(O=y.videoWidth,$=y.videoHeight):y instanceof HTMLImageElement&&(O=y.naturalWidth||y.width,$=y.naturalHeight||y.height)),E.style.width=O+"px",E.style.height=$+"px",E.width=O,E.height=$,E}stopStreams(){this.stream&&(this.stream.getVideoTracks().forEach(y=>y.stop()),this.stream=void 0),this._stopAsyncDecode===!1&&this.stopAsyncDecode(),this._stopContinuousDecode===!1&&this.stopContinuousDecode()}reset(){this.stopStreams(),this._destroyVideoElement(),this._destroyImageElement(),this._destroyCaptureCanvas()}_destroyVideoElement(){this.videoElement&&(typeof this.videoEndedListener<"u"&&this.videoElement.removeEventListener("ended",this.videoEndedListener),typeof this.videoPlayingEventListener<"u"&&this.videoElement.removeEventListener("playing",this.videoPlayingEventListener),typeof this.videoCanPlayListener<"u"&&this.videoElement.removeEventListener("loadedmetadata",this.videoCanPlayListener),this.cleanVideoSource(this.videoElement),this.videoElement=void 0)}_destroyImageElement(){this.imageElement&&(this.imageLoadedListener!==void 0&&this.imageElement.removeEventListener("load",this.imageLoadedListener),this.imageElement.src=void 0,this.imageElement.removeAttribute("src"),this.imageElement=void 0)}_destroyCaptureCanvas(){this.captureCanvasContext=void 0,this.captureCanvas=void 0}addVideoSource(y,E){try{y.srcObject=E}catch{y.src=URL.createObjectURL(E)}}cleanVideoSource(y){try{y.srcObject=null}catch{y.src=""}this.videoElement.removeAttribute("src")}}class he{constructor(y,E,O=E==null?0:8*E.length,$,H,K=w.currentTimeMillis()){this.text=y,this.rawBytes=E,this.numBits=O,this.resultPoints=$,this.format=H,this.timestamp=K,this.text=y,this.rawBytes=E,O==null?this.numBits=E==null?0:8*E.length:this.numBits=O,this.resultPoints=$,this.format=H,this.resultMetadata=null,K==null?this.timestamp=w.currentTimeMillis():this.timestamp=K}getText(){return this.text}getRawBytes(){return this.rawBytes}getNumBits(){return this.numBits}getResultPoints(){return this.resultPoints}getBarcodeFormat(){return this.format}getResultMetadata(){return this.resultMetadata}putMetadata(y,E){this.resultMetadata===null&&(this.resultMetadata=new Map),this.resultMetadata.set(y,E)}putAllMetadata(y){y!==null&&(this.resultMetadata===null?this.resultMetadata=y:this.resultMetadata=new Map(y))}addResultPoints(y){const E=this.resultPoints;if(E===null)this.resultPoints=y;else if(y!==null&&y.length>0){const O=new Array(E.length+y.length);w.arraycopy(E,0,O,0,E.length),w.arraycopy(y,0,O,E.length,y.length),this.resultPoints=O}}getTimestamp(){return this.timestamp}toString(){return this.text}}var ge;(function(dt){dt[dt.AZTEC=0]="AZTEC",dt[dt.CODABAR=1]="CODABAR",dt[dt.CODE_39=2]="CODE_39",dt[dt.CODE_93=3]="CODE_93",dt[dt.CODE_128=4]="CODE_128",dt[dt.DATA_MATRIX=5]="DATA_MATRIX",dt[dt.EAN_8=6]="EAN_8",dt[dt.EAN_13=7]="EAN_13",dt[dt.ITF=8]="ITF",dt[dt.MAXICODE=9]="MAXICODE",dt[dt.PDF_417=10]="PDF_417",dt[dt.QR_CODE=11]="QR_CODE",dt[dt.RSS_14=12]="RSS_14",dt[dt.RSS_EXPANDED=13]="RSS_EXPANDED",dt[dt.UPC_A=14]="UPC_A",dt[dt.UPC_E=15]="UPC_E",dt[dt.UPC_EAN_EXTENSION=16]="UPC_EAN_EXTENSION"})(ge||(ge={}));var ye=ge,ve;(function(dt){dt[dt.OTHER=0]="OTHER",dt[dt.ORIENTATION=1]="ORIENTATION",dt[dt.BYTE_SEGMENTS=2]="BYTE_SEGMENTS",dt[dt.ERROR_CORRECTION_LEVEL=3]="ERROR_CORRECTION_LEVEL",dt[dt.ISSUE_NUMBER=4]="ISSUE_NUMBER",dt[dt.SUGGESTED_PRICE=5]="SUGGESTED_PRICE",dt[dt.POSSIBLE_COUNTRY=6]="POSSIBLE_COUNTRY",dt[dt.UPC_EAN_EXTENSION=7]="UPC_EAN_EXTENSION",dt[dt.PDF417_EXTRA_METADATA=8]="PDF417_EXTRA_METADATA",dt[dt.STRUCTURED_APPEND_SEQUENCE=9]="STRUCTURED_APPEND_SEQUENCE",dt[dt.STRUCTURED_APPEND_PARITY=10]="STRUCTURED_APPEND_PARITY"})(ve||(ve={}));var je=ve;class Ie{constructor(y,E,O,$,H=-1,K=-1){this.rawBytes=y,this.text=E,this.byteSegments=O,this.ecLevel=$,this.structuredAppendSequenceNumber=H,this.structuredAppendParity=K,this.numBits=y==null?0:8*y.length}getRawBytes(){return this.rawBytes}getNumBits(){return this.numBits}setNumBits(y){this.numBits=y}getText(){return this.text}getByteSegments(){return this.byteSegments}getECLevel(){return this.ecLevel}getErrorsCorrected(){return this.errorsCorrected}setErrorsCorrected(y){this.errorsCorrected=y}getErasures(){return this.erasures}setErasures(y){this.erasures=y}getOther(){return this.other}setOther(y){this.other=y}hasStructuredAppend(){return this.structuredAppendParity>=0&&this.structuredAppendSequenceNumber>=0}getStructuredAppendParity(){return this.structuredAppendParity}getStructuredAppendSequenceNumber(){return this.structuredAppendSequenceNumber}}class Le{exp(y){return this.expTable[y]}log(y){if(y===0)throw new f;return this.logTable[y]}static addOrSubtract(y,E){return y^E}}class Qe{constructor(y,E){if(E.length===0)throw new f;this.field=y;const O=E.length;if(O>1&&E[0]===0){let $=1;for(;$<O&&E[$]===0;)$++;$===O?this.coefficients=Int32Array.from([0]):(this.coefficients=new Int32Array(O-$),w.arraycopy(E,$,this.coefficients,0,this.coefficients.length))}else this.coefficients=E}getCoefficients(){return this.coefficients}getDegree(){return this.coefficients.length-1}isZero(){return this.coefficients[0]===0}getCoefficient(y){return this.coefficients[this.coefficients.length-1-y]}evaluateAt(y){if(y===0)return this.getCoefficient(0);const E=this.coefficients;let O;if(y===1){O=0;for(let K=0,le=E.length;K!==le;K++){const we=E[K];O=Le.addOrSubtract(O,we)}return O}O=E[0];const $=E.length,H=this.field;for(let K=1;K<$;K++)O=Le.addOrSubtract(H.multiply(y,O),E[K]);return O}addOrSubtract(y){if(!this.field.equals(y.field))throw new f("GenericGFPolys do not have same GenericGF field");if(this.isZero())return y;if(y.isZero())return this;let E=this.coefficients,O=y.coefficients;if(E.length>O.length){const K=E;E=O,O=K}let $=new Int32Array(O.length);const H=O.length-E.length;w.arraycopy(O,0,$,0,H);for(let K=H;K<O.length;K++)$[K]=Le.addOrSubtract(E[K-H],O[K]);return new Qe(this.field,$)}multiply(y){if(!this.field.equals(y.field))throw new f("GenericGFPolys do not have same GenericGF field");if(this.isZero()||y.isZero())return this.field.getZero();const E=this.coefficients,O=E.length,$=y.coefficients,H=$.length,K=new Int32Array(O+H-1),le=this.field;for(let we=0;we<O;we++){const Te=E[we];for(let Ze=0;Ze<H;Ze++)K[we+Ze]=Le.addOrSubtract(K[we+Ze],le.multiply(Te,$[Ze]))}return new Qe(le,K)}multiplyScalar(y){if(y===0)return this.field.getZero();if(y===1)return this;const E=this.coefficients.length,O=this.field,$=new Int32Array(E),H=this.coefficients;for(let K=0;K<E;K++)$[K]=O.multiply(H[K],y);return new Qe(O,$)}multiplyByMonomial(y,E){if(y<0)throw new f;if(E===0)return this.field.getZero();const O=this.coefficients,$=O.length,H=new Int32Array($+y),K=this.field;for(let le=0;le<$;le++)H[le]=K.multiply(O[le],E);return new Qe(K,H)}divide(y){if(!this.field.equals(y.field))throw new f("GenericGFPolys do not have same GenericGF field");if(y.isZero())throw new f("Divide by 0");const E=this.field;let O=E.getZero(),$=this;const H=y.getCoefficient(y.getDegree()),K=E.inverse(H);for(;$.getDegree()>=y.getDegree()&&!$.isZero();){const le=$.getDegree()-y.getDegree(),we=E.multiply($.getCoefficient($.getDegree()),K),Te=y.multiplyByMonomial(le,we),Ze=E.buildMonomial(le,we);O=O.addOrSubtract(Ze),$=$.addOrSubtract(Te)}return[O,$]}toString(){let y="";for(let E=this.getDegree();E>=0;E--){let O=this.getCoefficient(E);if(O!==0){if(O<0?(y+=" - ",O=-O):y.length>0&&(y+=" + "),E===0||O!==1){const $=this.field.log(O);$===0?y+="1":$===1?y+="a":(y+="a^",y+=$)}E!==0&&(E===1?y+="x":(y+="x^",y+=E))}}return y}}class $e extends u{}$e.kind="ArithmeticException";class it extends Le{constructor(y,E,O){super(),this.primitive=y,this.size=E,this.generatorBase=O;const $=new Int32Array(E);let H=1;for(let le=0;le<E;le++)$[le]=H,H*=2,H>=E&&(H^=y,H&=E-1);this.expTable=$;const K=new Int32Array(E);for(let le=0;le<E-1;le++)K[$[le]]=le;this.logTable=K,this.zero=new Qe(this,Int32Array.from([0])),this.one=new Qe(this,Int32Array.from([1]))}getZero(){return this.zero}getOne(){return this.one}buildMonomial(y,E){if(y<0)throw new f;if(E===0)return this.zero;const O=new Int32Array(y+1);return O[0]=E,new Qe(this,O)}inverse(y){if(y===0)throw new $e;return this.expTable[this.size-this.logTable[y]-1]}multiply(y,E){return y===0||E===0?0:this.expTable[(this.logTable[y]+this.logTable[E])%(this.size-1)]}getSize(){return this.size}getGeneratorBase(){return this.generatorBase}toString(){return"GF(0x"+I.toHexString(this.primitive)+","+this.size+")"}equals(y){return y===this}}it.AZTEC_DATA_12=new it(4201,4096,1),it.AZTEC_DATA_10=new it(1033,1024,1),it.AZTEC_DATA_6=new it(67,64,1),it.AZTEC_PARAM=new it(19,16,1),it.QR_CODE_FIELD_256=new it(285,256,0),it.DATA_MATRIX_FIELD_256=new it(301,256,1),it.AZTEC_DATA_8=it.DATA_MATRIX_FIELD_256,it.MAXICODE_FIELD_64=it.AZTEC_DATA_6;class tt extends u{}tt.kind="ReedSolomonException";class lt extends u{}lt.kind="IllegalStateException";class ft{constructor(y){this.field=y}decode(y,E){const O=this.field,$=new Qe(O,y),H=new Int32Array(E);let K=!0;for(let Jt=0;Jt<E;Jt++){const Ct=$.evaluateAt(O.exp(Jt+O.getGeneratorBase()));H[H.length-1-Jt]=Ct,Ct!==0&&(K=!1)}if(K)return;const le=new Qe(O,H),we=this.runEuclideanAlgorithm(O.buildMonomial(E,1),le,E),Te=we[0],Ze=we[1],pt=this.findErrorLocations(Te),_t=this.findErrorMagnitudes(Ze,pt);for(let Jt=0;Jt<pt.length;Jt++){const Ct=y.length-1-O.log(pt[Jt]);if(Ct<0)throw new tt("Bad error location");y[Ct]=it.addOrSubtract(y[Ct],_t[Jt])}}runEuclideanAlgorithm(y,E,O){if(y.getDegree()<E.getDegree()){const Jt=y;y=E,E=Jt}const $=this.field;let H=y,K=E,le=$.getZero(),we=$.getOne();for(;K.getDegree()>=(O/2|0);){let Jt=H,Ct=le;if(H=K,le=we,H.isZero())throw new tt("r_{i-1} was zero");K=Jt;let Ht=$.getZero();const Kt=H.getCoefficient(H.getDegree()),An=$.inverse(Kt);for(;K.getDegree()>=H.getDegree()&&!K.isZero();){const hr=K.getDegree()-H.getDegree(),wr=$.multiply(K.getCoefficient(K.getDegree()),An);Ht=Ht.addOrSubtract($.buildMonomial(hr,wr)),K=K.addOrSubtract(H.multiplyByMonomial(hr,wr))}if(we=Ht.multiply(le).addOrSubtract(Ct),K.getDegree()>=H.getDegree())throw new lt("Division algorithm failed to reduce polynomial?")}const Te=we.getCoefficient(0);if(Te===0)throw new tt("sigmaTilde(0) was zero");const Ze=$.inverse(Te),pt=we.multiplyScalar(Ze),_t=K.multiplyScalar(Ze);return[pt,_t]}findErrorLocations(y){const E=y.getDegree();if(E===1)return Int32Array.from([y.getCoefficient(1)]);const O=new Int32Array(E);let $=0;const H=this.field;for(let K=1;K<H.getSize()&&$<E;K++)y.evaluateAt(K)===0&&(O[$]=H.inverse(K),$++);if($!==E)throw new tt("Error locator degree does not match number of roots");return O}findErrorMagnitudes(y,E){const O=E.length,$=new Int32Array(O),H=this.field;for(let K=0;K<O;K++){const le=H.inverse(E[K]);let we=1;for(let Te=0;Te<O;Te++)if(K!==Te){const Ze=H.multiply(E[Te],le),pt=Ze&1?Ze&-2:Ze|1;we=H.multiply(we,pt)}$[K]=H.multiply(y.evaluateAt(le),H.inverse(we)),H.getGeneratorBase()!==0&&($[K]=H.multiply($[K],le))}return $}}var ut;(function(dt){dt[dt.UPPER=0]="UPPER",dt[dt.LOWER=1]="LOWER",dt[dt.MIXED=2]="MIXED",dt[dt.DIGIT=3]="DIGIT",dt[dt.PUNCT=4]="PUNCT",dt[dt.BINARY=5]="BINARY"})(ut||(ut={}));class qt{decode(y){this.ddata=y;let E=y.getBits(),O=this.extractBits(E),$=this.correctBits(O),H=qt.convertBoolArrayToByteArray($),K=qt.getEncodedData($),le=new Ie(H,K,null,null);return le.setNumBits($.length),le}static highLevelDecode(y){return this.getEncodedData(y)}static getEncodedData(y){let E=y.length,O=ut.UPPER,$=ut.UPPER,H="",K=0;for(;K<E;)if($===ut.BINARY){if(E-K<5)break;let le=qt.readCode(y,K,5);if(K+=5,le===0){if(E-K<11)break;le=qt.readCode(y,K,11)+31,K+=11}for(let we=0;we<le;we++){if(E-K<8){K=E;break}const Te=qt.readCode(y,K,8);H+=X.castAsNonUtf8Char(Te),K+=8}$=O}else{let le=$===ut.DIGIT?4:5;if(E-K<le)break;let we=qt.readCode(y,K,le);K+=le;let Te=qt.getCharacter($,we);Te.startsWith("CTRL_")?(O=$,$=qt.getTable(Te.charAt(5)),Te.charAt(6)==="L"&&(O=$)):(H+=Te,$=O)}return H}static getTable(y){switch(y){case"L":return ut.LOWER;case"P":return ut.PUNCT;case"M":return ut.MIXED;case"D":return ut.DIGIT;case"B":return ut.BINARY;case"U":default:return ut.UPPER}}static getCharacter(y,E){switch(y){case ut.UPPER:return qt.UPPER_TABLE[E];case ut.LOWER:return qt.LOWER_TABLE[E];case ut.MIXED:return qt.MIXED_TABLE[E];case ut.PUNCT:return qt.PUNCT_TABLE[E];case ut.DIGIT:return qt.DIGIT_TABLE[E];default:throw new lt("Bad table")}}correctBits(y){let E,O;this.ddata.getNbLayers()<=2?(O=6,E=it.AZTEC_DATA_6):this.ddata.getNbLayers()<=8?(O=8,E=it.AZTEC_DATA_8):this.ddata.getNbLayers()<=22?(O=10,E=it.AZTEC_DATA_10):(O=12,E=it.AZTEC_DATA_12);let $=this.ddata.getNbDatablocks(),H=y.length/O;if(H<$)throw new L;let K=y.length%O,le=new Int32Array(H);for(let _t=0;_t<H;_t++,K+=O)le[_t]=qt.readCode(y,K,O);try{new ft(E).decode(le,H-$)}catch(_t){throw new L(_t)}let we=(1<<O)-1,Te=0;for(let _t=0;_t<$;_t++){let Jt=le[_t];if(Jt===0||Jt===we)throw new L;(Jt===1||Jt===we-1)&&Te++}let Ze=new Array($*O-Te),pt=0;for(let _t=0;_t<$;_t++){let Jt=le[_t];if(Jt===1||Jt===we-1)Ze.fill(Jt>1,pt,pt+O-1),pt+=O-1;else for(let Ct=O-1;Ct>=0;--Ct)Ze[pt++]=(Jt&1<<Ct)!==0}return Ze}extractBits(y){let E=this.ddata.isCompact(),O=this.ddata.getNbLayers(),$=(E?11:14)+O*4,H=new Int32Array($),K=new Array(this.totalBitsInLayer(O,E));if(E)for(let le=0;le<H.length;le++)H[le]=le;else{let le=$+1+2*I.truncDivision(I.truncDivision($,2)-1,15),we=$/2,Te=I.truncDivision(le,2);for(let Ze=0;Ze<we;Ze++){let pt=Ze+I.truncDivision(Ze,15);H[we-Ze-1]=Te-pt-1,H[we+Ze]=Te+pt+1}}for(let le=0,we=0;le<O;le++){let Te=(O-le)*4+(E?9:12),Ze=le*2,pt=$-1-Ze;for(let _t=0;_t<Te;_t++){let Jt=_t*2;for(let Ct=0;Ct<2;Ct++)K[we+Jt+Ct]=y.get(H[Ze+Ct],H[Ze+_t]),K[we+2*Te+Jt+Ct]=y.get(H[Ze+_t],H[pt-Ct]),K[we+4*Te+Jt+Ct]=y.get(H[pt-Ct],H[pt-_t]),K[we+6*Te+Jt+Ct]=y.get(H[pt-_t],H[Ze+Ct])}we+=Te*8}return K}static readCode(y,E,O){let $=0;for(let H=E;H<E+O;H++)$<<=1,y[H]&&($|=1);return $}static readByte(y,E){let O=y.length-E;return O>=8?qt.readCode(y,E,8):qt.readCode(y,E,O)<<8-O}static convertBoolArrayToByteArray(y){let E=new Uint8Array((y.length+7)/8);for(let O=0;O<E.length;O++)E[O]=qt.readByte(y,8*O);return E}totalBitsInLayer(y,E){return((E?88:112)+16*y)*y}}qt.UPPER_TABLE=["CTRL_PS"," ","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","CTRL_LL","CTRL_ML","CTRL_DL","CTRL_BS"],qt.LOWER_TABLE=["CTRL_PS"," ","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","CTRL_US","CTRL_ML","CTRL_DL","CTRL_BS"],qt.MIXED_TABLE=["CTRL_PS"," ","\\1","\\2","\\3","\\4","\\5","\\6","\\7","\b"," ",`
`,"\\13","\f","\r","\\33","\\34","\\35","\\36","\\37","@","\\","^","_","`","|","~","\\177","CTRL_LL","CTRL_UL","CTRL_PL","CTRL_BS"],qt.PUNCT_TABLE=["","\r",`\r
`,". ",", ",": ","!",'"',"#","$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","?","[","]","{","}","CTRL_UL"],qt.DIGIT_TABLE=["CTRL_PS"," ","0","1","2","3","4","5","6","7","8","9",",",".","CTRL_UL","CTRL_US"];class It{constructor(){}static round(y){return y===NaN?0:y<=Number.MIN_SAFE_INTEGER?Number.MIN_SAFE_INTEGER:y>=Number.MAX_SAFE_INTEGER?Number.MAX_SAFE_INTEGER:y+(y<0?-.5:.5)|0}static distance(y,E,O,$){const H=y-O,K=E-$;return Math.sqrt(H*H+K*K)}static sum(y){let E=0;for(let O=0,$=y.length;O!==$;O++){const H=y[O];E+=H}return E}}class nn{static floatToIntBits(y){return y}}nn.MAX_VALUE=Number.MAX_SAFE_INTEGER;class jt{constructor(y,E){this.x=y,this.y=E}getX(){return this.x}getY(){return this.y}equals(y){if(y instanceof jt){const E=y;return this.x===E.x&&this.y===E.y}return!1}hashCode(){return 31*nn.floatToIntBits(this.x)+nn.floatToIntBits(this.y)}toString(){return"("+this.x+","+this.y+")"}static orderBestPatterns(y){const E=this.distance(y[0],y[1]),O=this.distance(y[1],y[2]),$=this.distance(y[0],y[2]);let H,K,le;if(O>=E&&O>=$?(K=y[0],H=y[1],le=y[2]):$>=O&&$>=E?(K=y[1],H=y[0],le=y[2]):(K=y[2],H=y[0],le=y[1]),this.crossProductZ(H,K,le)<0){const we=H;H=le,le=we}y[0]=H,y[1]=K,y[2]=le}static distance(y,E){return It.distance(y.x,y.y,E.x,E.y)}static crossProductZ(y,E,O){const $=E.x,H=E.y;return(O.x-$)*(y.y-H)-(O.y-H)*(y.x-$)}}class cn{constructor(y,E){this.bits=y,this.points=E}getBits(){return this.bits}getPoints(){return this.points}}class un extends cn{constructor(y,E,O,$,H){super(y,E),this.compact=O,this.nbDatablocks=$,this.nbLayers=H}getNbLayers(){return this.nbLayers}getNbDatablocks(){return this.nbDatablocks}isCompact(){return this.compact}}class Ft{constructor(y,E,O,$){this.image=y,this.height=y.getHeight(),this.width=y.getWidth(),E==null&&(E=Ft.INIT_SIZE),O==null&&(O=y.getWidth()/2|0),$==null&&($=y.getHeight()/2|0);const H=E/2|0;if(this.leftInit=O-H,this.rightInit=O+H,this.upInit=$-H,this.downInit=$+H,this.upInit<0||this.leftInit<0||this.downInit>=this.height||this.rightInit>=this.width)throw new Y}detect(){let y=this.leftInit,E=this.rightInit,O=this.upInit,$=this.downInit,H=!1,K=!0,le=!1,we=!1,Te=!1,Ze=!1,pt=!1;const _t=this.width,Jt=this.height;for(;K;){K=!1;let Ct=!0;for(;(Ct||!we)&&E<_t;)Ct=this.containsBlackPoint(O,$,E,!1),Ct?(E++,K=!0,we=!0):we||E++;if(E>=_t){H=!0;break}let Ht=!0;for(;(Ht||!Te)&&$<Jt;)Ht=this.containsBlackPoint(y,E,$,!0),Ht?($++,K=!0,Te=!0):Te||$++;if($>=Jt){H=!0;break}let Kt=!0;for(;(Kt||!Ze)&&y>=0;)Kt=this.containsBlackPoint(O,$,y,!1),Kt?(y--,K=!0,Ze=!0):Ze||y--;if(y<0){H=!0;break}let An=!0;for(;(An||!pt)&&O>=0;)An=this.containsBlackPoint(y,E,O,!0),An?(O--,K=!0,pt=!0):pt||O--;if(O<0){H=!0;break}K&&(le=!0)}if(!H&&le){const Ct=E-y;let Ht=null;for(let wr=1;Ht===null&&wr<Ct;wr++)Ht=this.getBlackPointOnSegment(y,$-wr,y+wr,$);if(Ht==null)throw new Y;let Kt=null;for(let wr=1;Kt===null&&wr<Ct;wr++)Kt=this.getBlackPointOnSegment(y,O+wr,y+wr,O);if(Kt==null)throw new Y;let An=null;for(let wr=1;An===null&&wr<Ct;wr++)An=this.getBlackPointOnSegment(E,O+wr,E-wr,O);if(An==null)throw new Y;let hr=null;for(let wr=1;hr===null&&wr<Ct;wr++)hr=this.getBlackPointOnSegment(E,$-wr,E-wr,$);if(hr==null)throw new Y;return this.centerEdges(hr,Ht,An,Kt)}else throw new Y}getBlackPointOnSegment(y,E,O,$){const H=It.round(It.distance(y,E,O,$)),K=(O-y)/H,le=($-E)/H,we=this.image;for(let Te=0;Te<H;Te++){const Ze=It.round(y+Te*K),pt=It.round(E+Te*le);if(we.get(Ze,pt))return new jt(Ze,pt)}return null}centerEdges(y,E,O,$){const H=y.getX(),K=y.getY(),le=E.getX(),we=E.getY(),Te=O.getX(),Ze=O.getY(),pt=$.getX(),_t=$.getY(),Jt=Ft.CORR;return H<this.width/2?[new jt(pt-Jt,_t+Jt),new jt(le+Jt,we+Jt),new jt(Te-Jt,Ze-Jt),new jt(H+Jt,K-Jt)]:[new jt(pt+Jt,_t+Jt),new jt(le+Jt,we-Jt),new jt(Te-Jt,Ze+Jt),new jt(H-Jt,K-Jt)]}containsBlackPoint(y,E,O,$){const H=this.image;if($){for(let K=y;K<=E;K++)if(H.get(K,O))return!0}else for(let K=y;K<=E;K++)if(H.get(O,K))return!0;return!1}}Ft.INIT_SIZE=10,Ft.CORR=1;class Ke{static checkAndNudgePoints(y,E){const O=y.getWidth(),$=y.getHeight();let H=!0;for(let K=0;K<E.length&&H;K+=2){const le=Math.floor(E[K]),we=Math.floor(E[K+1]);if(le<-1||le>O||we<-1||we>$)throw new Y;H=!1,le===-1?(E[K]=0,H=!0):le===O&&(E[K]=O-1,H=!0),we===-1?(E[K+1]=0,H=!0):we===$&&(E[K+1]=$-1,H=!0)}H=!0;for(let K=E.length-2;K>=0&&H;K-=2){const le=Math.floor(E[K]),we=Math.floor(E[K+1]);if(le<-1||le>O||we<-1||we>$)throw new Y;H=!1,le===-1?(E[K]=0,H=!0):le===O&&(E[K]=O-1,H=!0),we===-1?(E[K+1]=0,H=!0):we===$&&(E[K+1]=$-1,H=!0)}}}class Bt{constructor(y,E,O,$,H,K,le,we,Te){this.a11=y,this.a21=E,this.a31=O,this.a12=$,this.a22=H,this.a32=K,this.a13=le,this.a23=we,this.a33=Te}static quadrilateralToQuadrilateral(y,E,O,$,H,K,le,we,Te,Ze,pt,_t,Jt,Ct,Ht,Kt){const An=Bt.quadrilateralToSquare(y,E,O,$,H,K,le,we);return Bt.squareToQuadrilateral(Te,Ze,pt,_t,Jt,Ct,Ht,Kt).times(An)}transformPoints(y){const E=y.length,O=this.a11,$=this.a12,H=this.a13,K=this.a21,le=this.a22,we=this.a23,Te=this.a31,Ze=this.a32,pt=this.a33;for(let _t=0;_t<E;_t+=2){const Jt=y[_t],Ct=y[_t+1],Ht=H*Jt+we*Ct+pt;y[_t]=(O*Jt+K*Ct+Te)/Ht,y[_t+1]=($*Jt+le*Ct+Ze)/Ht}}transformPointsWithValues(y,E){const O=this.a11,$=this.a12,H=this.a13,K=this.a21,le=this.a22,we=this.a23,Te=this.a31,Ze=this.a32,pt=this.a33,_t=y.length;for(let Jt=0;Jt<_t;Jt++){const Ct=y[Jt],Ht=E[Jt],Kt=H*Ct+we*Ht+pt;y[Jt]=(O*Ct+K*Ht+Te)/Kt,E[Jt]=($*Ct+le*Ht+Ze)/Kt}}static squareToQuadrilateral(y,E,O,$,H,K,le,we){const Te=y-O+H-le,Ze=E-$+K-we;if(Te===0&&Ze===0)return new Bt(O-y,H-O,y,$-E,K-$,E,0,0,1);{const pt=O-H,_t=le-H,Jt=$-K,Ct=we-K,Ht=pt*Ct-_t*Jt,Kt=(Te*Ct-_t*Ze)/Ht,An=(pt*Ze-Te*Jt)/Ht;return new Bt(O-y+Kt*O,le-y+An*le,y,$-E+Kt*$,we-E+An*we,E,Kt,An,1)}}static quadrilateralToSquare(y,E,O,$,H,K,le,we){return Bt.squareToQuadrilateral(y,E,O,$,H,K,le,we).buildAdjoint()}buildAdjoint(){return new Bt(this.a22*this.a33-this.a23*this.a32,this.a23*this.a31-this.a21*this.a33,this.a21*this.a32-this.a22*this.a31,this.a13*this.a32-this.a12*this.a33,this.a11*this.a33-this.a13*this.a31,this.a12*this.a31-this.a11*this.a32,this.a12*this.a23-this.a13*this.a22,this.a13*this.a21-this.a11*this.a23,this.a11*this.a22-this.a12*this.a21)}times(y){return new Bt(this.a11*y.a11+this.a21*y.a12+this.a31*y.a13,this.a11*y.a21+this.a21*y.a22+this.a31*y.a23,this.a11*y.a31+this.a21*y.a32+this.a31*y.a33,this.a12*y.a11+this.a22*y.a12+this.a32*y.a13,this.a12*y.a21+this.a22*y.a22+this.a32*y.a23,this.a12*y.a31+this.a22*y.a32+this.a32*y.a33,this.a13*y.a11+this.a23*y.a12+this.a33*y.a13,this.a13*y.a21+this.a23*y.a22+this.a33*y.a23,this.a13*y.a31+this.a23*y.a32+this.a33*y.a33)}}class $t extends Ke{sampleGrid(y,E,O,$,H,K,le,we,Te,Ze,pt,_t,Jt,Ct,Ht,Kt,An,hr,wr){const Sr=Bt.quadrilateralToQuadrilateral($,H,K,le,we,Te,Ze,pt,_t,Jt,Ct,Ht,Kt,An,hr,wr);return this.sampleGridWithTransform(y,E,O,Sr)}sampleGridWithTransform(y,E,O,$){if(E<=0||O<=0)throw new Y;const H=new pe(E,O),K=new Float32Array(2*E);for(let le=0;le<O;le++){const we=K.length,Te=le+.5;for(let Ze=0;Ze<we;Ze+=2)K[Ze]=Ze/2+.5,K[Ze+1]=Te;$.transformPoints(K),Ke.checkAndNudgePoints(y,K);try{for(let Ze=0;Ze<we;Ze+=2)y.get(Math.floor(K[Ze]),Math.floor(K[Ze+1]))&&H.set(Ze/2,le)}catch{throw new Y}}return H}}class qe{static setGridSampler(y){qe.gridSampler=y}static getInstance(){return qe.gridSampler}}qe.gridSampler=new $t;class Ye{constructor(y,E){this.x=y,this.y=E}toResultPoint(){return new jt(this.getX(),this.getY())}getX(){return this.x}getY(){return this.y}}class ht{constructor(y){this.EXPECTED_CORNER_BITS=new Int32Array([3808,476,2107,1799]),this.image=y}detect(){return this.detectMirror(!1)}detectMirror(y){let E=this.getMatrixCenter(),O=this.getBullsEyeCorners(E);if(y){let K=O[0];O[0]=O[2],O[2]=K}this.extractParameters(O);let $=this.sampleGrid(this.image,O[this.shift%4],O[(this.shift+1)%4],O[(this.shift+2)%4],O[(this.shift+3)%4]),H=this.getMatrixCornerPoints(O);return new un($,H,this.compact,this.nbDataBlocks,this.nbLayers)}extractParameters(y){if(!this.isValidPoint(y[0])||!this.isValidPoint(y[1])||!this.isValidPoint(y[2])||!this.isValidPoint(y[3]))throw new Y;let E=2*this.nbCenterLayers,O=new Int32Array([this.sampleLine(y[0],y[1],E),this.sampleLine(y[1],y[2],E),this.sampleLine(y[2],y[3],E),this.sampleLine(y[3],y[0],E)]);this.shift=this.getRotation(O,E);let $=0;for(let K=0;K<4;K++){let le=O[(this.shift+K)%4];this.compact?($<<=7,$+=le>>1&127):($<<=10,$+=(le>>2&992)+(le>>1&31))}let H=this.getCorrectedParameterData($,this.compact);this.compact?(this.nbLayers=(H>>6)+1,this.nbDataBlocks=(H&63)+1):(this.nbLayers=(H>>11)+1,this.nbDataBlocks=(H&2047)+1)}getRotation(y,E){let O=0;y.forEach(($,H,K)=>{let le=($>>E-2<<1)+($&1);O=(O<<3)+le}),O=((O&1)<<11)+(O>>1);for(let $=0;$<4;$++)if(I.bitCount(O^this.EXPECTED_CORNER_BITS[$])<=2)return $;throw new Y}getCorrectedParameterData(y,E){let O,$;E?(O=7,$=2):(O=10,$=4);let H=O-$,K=new Int32Array(O);for(let we=O-1;we>=0;--we)K[we]=y&15,y>>=4;try{new ft(it.AZTEC_PARAM).decode(K,H)}catch{throw new Y}let le=0;for(let we=0;we<$;we++)le=(le<<4)+K[we];return le}getBullsEyeCorners(y){let E=y,O=y,$=y,H=y,K=!0;for(this.nbCenterLayers=1;this.nbCenterLayers<9;this.nbCenterLayers++){let pt=this.getFirstDifferent(E,K,1,-1),_t=this.getFirstDifferent(O,K,1,1),Jt=this.getFirstDifferent($,K,-1,1),Ct=this.getFirstDifferent(H,K,-1,-1);if(this.nbCenterLayers>2){let Ht=this.distancePoint(Ct,pt)*this.nbCenterLayers/(this.distancePoint(H,E)*(this.nbCenterLayers+2));if(Ht<.75||Ht>1.25||!this.isWhiteOrBlackRectangle(pt,_t,Jt,Ct))break}E=pt,O=_t,$=Jt,H=Ct,K=!K}if(this.nbCenterLayers!==5&&this.nbCenterLayers!==7)throw new Y;this.compact=this.nbCenterLayers===5;let le=new jt(E.getX()+.5,E.getY()-.5),we=new jt(O.getX()+.5,O.getY()+.5),Te=new jt($.getX()-.5,$.getY()+.5),Ze=new jt(H.getX()-.5,H.getY()-.5);return this.expandSquare([le,we,Te,Ze],2*this.nbCenterLayers-3,2*this.nbCenterLayers)}getMatrixCenter(){let y,E,O,$;try{let le=new Ft(this.image).detect();y=le[0],E=le[1],O=le[2],$=le[3]}catch{let we=this.image.getWidth()/2,Te=this.image.getHeight()/2;y=this.getFirstDifferent(new Ye(we+7,Te-7),!1,1,-1).toResultPoint(),E=this.getFirstDifferent(new Ye(we+7,Te+7),!1,1,1).toResultPoint(),O=this.getFirstDifferent(new Ye(we-7,Te+7),!1,-1,1).toResultPoint(),$=this.getFirstDifferent(new Ye(we-7,Te-7),!1,-1,-1).toResultPoint()}let H=It.round((y.getX()+$.getX()+E.getX()+O.getX())/4),K=It.round((y.getY()+$.getY()+E.getY()+O.getY())/4);try{let le=new Ft(this.image,15,H,K).detect();y=le[0],E=le[1],O=le[2],$=le[3]}catch{y=this.getFirstDifferent(new Ye(H+7,K-7),!1,1,-1).toResultPoint(),E=this.getFirstDifferent(new Ye(H+7,K+7),!1,1,1).toResultPoint(),O=this.getFirstDifferent(new Ye(H-7,K+7),!1,-1,1).toResultPoint(),$=this.getFirstDifferent(new Ye(H-7,K-7),!1,-1,-1).toResultPoint()}return H=It.round((y.getX()+$.getX()+E.getX()+O.getX())/4),K=It.round((y.getY()+$.getY()+E.getY()+O.getY())/4),new Ye(H,K)}getMatrixCornerPoints(y){return this.expandSquare(y,2*this.nbCenterLayers,this.getDimension())}sampleGrid(y,E,O,$,H){let K=qe.getInstance(),le=this.getDimension(),we=le/2-this.nbCenterLayers,Te=le/2+this.nbCenterLayers;return K.sampleGrid(y,le,le,we,we,Te,we,Te,Te,we,Te,E.getX(),E.getY(),O.getX(),O.getY(),$.getX(),$.getY(),H.getX(),H.getY())}sampleLine(y,E,O){let $=0,H=this.distanceResultPoint(y,E),K=H/O,le=y.getX(),we=y.getY(),Te=K*(E.getX()-y.getX())/H,Ze=K*(E.getY()-y.getY())/H;for(let pt=0;pt<O;pt++)this.image.get(It.round(le+pt*Te),It.round(we+pt*Ze))&&($|=1<<O-pt-1);return $}isWhiteOrBlackRectangle(y,E,O,$){let H=3;y=new Ye(y.getX()-H,y.getY()+H),E=new Ye(E.getX()-H,E.getY()-H),O=new Ye(O.getX()+H,O.getY()-H),$=new Ye($.getX()+H,$.getY()+H);let K=this.getColor($,y);if(K===0)return!1;let le=this.getColor(y,E);return le!==K||(le=this.getColor(E,O),le!==K)?!1:(le=this.getColor(O,$),le===K)}getColor(y,E){let O=this.distancePoint(y,E),$=(E.getX()-y.getX())/O,H=(E.getY()-y.getY())/O,K=0,le=y.getX(),we=y.getY(),Te=this.image.get(y.getX(),y.getY()),Ze=Math.ceil(O);for(let _t=0;_t<Ze;_t++)le+=$,we+=H,this.image.get(It.round(le),It.round(we))!==Te&&K++;let pt=K/O;return pt>.1&&pt<.9?0:pt<=.1===Te?1:-1}getFirstDifferent(y,E,O,$){let H=y.getX()+O,K=y.getY()+$;for(;this.isValid(H,K)&&this.image.get(H,K)===E;)H+=O,K+=$;for(H-=O,K-=$;this.isValid(H,K)&&this.image.get(H,K)===E;)H+=O;for(H-=O;this.isValid(H,K)&&this.image.get(H,K)===E;)K+=$;return K-=$,new Ye(H,K)}expandSquare(y,E,O){let $=O/(2*E),H=y[0].getX()-y[2].getX(),K=y[0].getY()-y[2].getY(),le=(y[0].getX()+y[2].getX())/2,we=(y[0].getY()+y[2].getY())/2,Te=new jt(le+$*H,we+$*K),Ze=new jt(le-$*H,we-$*K);H=y[1].getX()-y[3].getX(),K=y[1].getY()-y[3].getY(),le=(y[1].getX()+y[3].getX())/2,we=(y[1].getY()+y[3].getY())/2;let pt=new jt(le+$*H,we+$*K),_t=new jt(le-$*H,we-$*K);return[Te,pt,Ze,_t]}isValid(y,E){return y>=0&&y<this.image.getWidth()&&E>0&&E<this.image.getHeight()}isValidPoint(y){let E=It.round(y.getX()),O=It.round(y.getY());return this.isValid(E,O)}distancePoint(y,E){return It.distance(y.getX(),y.getY(),E.getX(),E.getY())}distanceResultPoint(y,E){return It.distance(y.getX(),y.getY(),E.getX(),E.getY())}getDimension(){return this.compact?4*this.nbLayers+11:this.nbLayers<=4?4*this.nbLayers+15:4*this.nbLayers+2*(I.truncDivision(this.nbLayers-4,8)+1)+15}}class Zt{decode(y,E=null){let O=null,$=new ht(y.getBlackMatrix()),H=null,K=null;try{let Ze=$.detectMirror(!1);H=Ze.getPoints(),this.reportFoundResultPoints(E,H),K=new qt().decode(Ze)}catch(Ze){O=Ze}if(K==null)try{let Ze=$.detectMirror(!0);H=Ze.getPoints(),this.reportFoundResultPoints(E,H),K=new qt().decode(Ze)}catch(Ze){throw O??Ze}let le=new he(K.getText(),K.getRawBytes(),K.getNumBits(),H,ye.AZTEC,w.currentTimeMillis()),we=K.getByteSegments();we!=null&&le.putMetadata(je.BYTE_SEGMENTS,we);let Te=K.getECLevel();return Te!=null&&le.putMetadata(je.ERROR_CORRECTION_LEVEL,Te),le}reportFoundResultPoints(y,E){if(y!=null){let O=y.get(U.NEED_RESULT_POINT_CALLBACK);O!=null&&E.forEach(($,H,K)=>{O.foundPossibleResultPoint($)})}}reset(){}}class zt extends Ne{constructor(y=500){super(new Zt,y)}}class Et{decode(y,E){try{return this.doDecode(y,E)}catch{if(E&&E.get(U.TRY_HARDER)===!0&&y.isRotateSupported()){const H=y.rotateCounterClockwise(),K=this.doDecode(H,E),le=K.getResultMetadata();let we=270;le!==null&&le.get(je.ORIENTATION)===!0&&(we=we+le.get(je.ORIENTATION)%360),K.putMetadata(je.ORIENTATION,we);const Te=K.getResultPoints();if(Te!==null){const Ze=H.getHeight();for(let pt=0;pt<Te.length;pt++)Te[pt]=new jt(Ze-Te[pt].getY()-1,Te[pt].getX())}return K}else throw new Y}}reset(){}doDecode(y,E){const O=y.getWidth(),$=y.getHeight();let H=new R(O);const K=E&&E.get(U.TRY_HARDER)===!0,le=Math.max(1,$>>(K?8:5));let we;K?we=$:we=15;const Te=Math.trunc($/2);for(let Ze=0;Ze<we;Ze++){const pt=Math.trunc((Ze+1)/2),_t=(Ze&1)===0,Jt=Te+le*(_t?pt:-pt);if(Jt<0||Jt>=$)break;try{H=y.getBlackRow(Jt,H)}catch{continue}for(let Ct=0;Ct<2;Ct++){if(Ct===1&&(H.reverse(),E&&E.get(U.NEED_RESULT_POINT_CALLBACK)===!0)){const Ht=new Map;E.forEach((Kt,An)=>Ht.set(An,Kt)),Ht.delete(U.NEED_RESULT_POINT_CALLBACK),E=Ht}try{const Ht=this.decodeRow(Jt,H,E);if(Ct===1){Ht.putMetadata(je.ORIENTATION,180);const Kt=Ht.getResultPoints();Kt!==null&&(Kt[0]=new jt(O-Kt[0].getX()-1,Kt[0].getY()),Kt[1]=new jt(O-Kt[1].getX()-1,Kt[1].getY()))}return Ht}catch{}}}throw new Y}static recordPattern(y,E,O){const $=O.length;for(let Te=0;Te<$;Te++)O[Te]=0;const H=y.getSize();if(E>=H)throw new Y;let K=!y.get(E),le=0,we=E;for(;we<H;){if(y.get(we)!==K)O[le]++;else{if(++le===$)break;O[le]=1,K=!K}we++}if(!(le===$||le===$-1&&we===H))throw new Y}static recordPatternInReverse(y,E,O){let $=O.length,H=y.get(E);for(;E>0&&$>=0;)y.get(--E)!==H&&($--,H=!H);if($>=0)throw new Y;Et.recordPattern(y,E+1,O)}static patternMatchVariance(y,E,O){const $=y.length;let H=0,K=0;for(let Te=0;Te<$;Te++)H+=y[Te],K+=E[Te];if(H<K)return Number.POSITIVE_INFINITY;const le=H/K;O*=le;let we=0;for(let Te=0;Te<$;Te++){const Ze=y[Te],pt=E[Te]*le,_t=Ze>pt?Ze-pt:pt-Ze;if(_t>O)return Number.POSITIVE_INFINITY;we+=_t}return we/H}}class nt extends Et{static findStartPattern(y){const E=y.getSize(),O=y.getNextSet(0);let $=0,H=Int32Array.from([0,0,0,0,0,0]),K=O,le=!1;const we=6;for(let Te=O;Te<E;Te++)if(y.get(Te)!==le)H[$]++;else{if($===we-1){let Ze=nt.MAX_AVG_VARIANCE,pt=-1;for(let _t=nt.CODE_START_A;_t<=nt.CODE_START_C;_t++){const Jt=Et.patternMatchVariance(H,nt.CODE_PATTERNS[_t],nt.MAX_INDIVIDUAL_VARIANCE);Jt<Ze&&(Ze=Jt,pt=_t)}if(pt>=0&&y.isRange(Math.max(0,K-(Te-K)/2),K,!1))return Int32Array.from([K,Te,pt]);K+=H[0]+H[1],H=H.slice(2,H.length-1),H[$-1]=0,H[$]=0,$--}else $++;H[$]=1,le=!le}throw new Y}static decodeCode(y,E,O){Et.recordPattern(y,O,E);let $=nt.MAX_AVG_VARIANCE,H=-1;for(let K=0;K<nt.CODE_PATTERNS.length;K++){const le=nt.CODE_PATTERNS[K],we=this.patternMatchVariance(E,le,nt.MAX_INDIVIDUAL_VARIANCE);we<$&&($=we,H=K)}if(H>=0)return H;throw new Y}decodeRow(y,E,O){const $=O&&O.get(U.ASSUME_GS1)===!0,H=nt.findStartPattern(E),K=H[2];let le=0;const we=new Uint8Array(20);we[le++]=K;let Te;switch(K){case nt.CODE_START_A:Te=nt.CODE_CODE_A;break;case nt.CODE_START_B:Te=nt.CODE_CODE_B;break;case nt.CODE_START_C:Te=nt.CODE_CODE_C;break;default:throw new L}let Ze=!1,pt=!1,_t="",Jt=H[0],Ct=H[1];const Ht=Int32Array.from([0,0,0,0,0,0]);let Kt=0,An=0,hr=K,wr=0,Sr=!0,Ss=!1,Qs=!1;for(;!Ze;){const Pi=pt;switch(pt=!1,Kt=An,An=nt.decodeCode(E,Ht,Ct),we[le++]=An,An!==nt.CODE_STOP&&(Sr=!0),An!==nt.CODE_STOP&&(wr++,hr+=wr*An),Jt=Ct,Ct+=Ht.reduce((_m,F1)=>_m+F1,0),An){case nt.CODE_START_A:case nt.CODE_START_B:case nt.CODE_START_C:throw new L}switch(Te){case nt.CODE_CODE_A:if(An<64)Qs===Ss?_t+=String.fromCharCode(32+An):_t+=String.fromCharCode(32+An+128),Qs=!1;else if(An<96)Qs===Ss?_t+=String.fromCharCode(An-64):_t+=String.fromCharCode(An+64),Qs=!1;else switch(An!==nt.CODE_STOP&&(Sr=!1),An){case nt.CODE_FNC_1:$&&(_t.length===0?_t+="]C1":_t+="");break;case nt.CODE_FNC_2:case nt.CODE_FNC_3:break;case nt.CODE_FNC_4_A:!Ss&&Qs?(Ss=!0,Qs=!1):Ss&&Qs?(Ss=!1,Qs=!1):Qs=!0;break;case nt.CODE_SHIFT:pt=!0,Te=nt.CODE_CODE_B;break;case nt.CODE_CODE_B:Te=nt.CODE_CODE_B;break;case nt.CODE_CODE_C:Te=nt.CODE_CODE_C;break;case nt.CODE_STOP:Ze=!0;break}break;case nt.CODE_CODE_B:if(An<96)Qs===Ss?_t+=String.fromCharCode(32+An):_t+=String.fromCharCode(32+An+128),Qs=!1;else switch(An!==nt.CODE_STOP&&(Sr=!1),An){case nt.CODE_FNC_1:$&&(_t.length===0?_t+="]C1":_t+="");break;case nt.CODE_FNC_2:case nt.CODE_FNC_3:break;case nt.CODE_FNC_4_B:!Ss&&Qs?(Ss=!0,Qs=!1):Ss&&Qs?(Ss=!1,Qs=!1):Qs=!0;break;case nt.CODE_SHIFT:pt=!0,Te=nt.CODE_CODE_A;break;case nt.CODE_CODE_A:Te=nt.CODE_CODE_A;break;case nt.CODE_CODE_C:Te=nt.CODE_CODE_C;break;case nt.CODE_STOP:Ze=!0;break}break;case nt.CODE_CODE_C:if(An<100)An<10&&(_t+="0"),_t+=An;else switch(An!==nt.CODE_STOP&&(Sr=!1),An){case nt.CODE_FNC_1:$&&(_t.length===0?_t+="]C1":_t+="");break;case nt.CODE_CODE_A:Te=nt.CODE_CODE_A;break;case nt.CODE_CODE_B:Te=nt.CODE_CODE_B;break;case nt.CODE_STOP:Ze=!0;break}break}Pi&&(Te=Te===nt.CODE_CODE_A?nt.CODE_CODE_B:nt.CODE_CODE_A)}const dc=Ct-Jt;if(Ct=E.getNextUnset(Ct),!E.isRange(Ct,Math.min(E.getSize(),Ct+(Ct-Jt)/2),!1))throw new Y;if(hr-=wr*Kt,hr%103!==Kt)throw new g;const Za=_t.length;if(Za===0)throw new Y;Za>0&&Sr&&(Te===nt.CODE_CODE_C?_t=_t.substring(0,Za-2):_t=_t.substring(0,Za-1));const Ja=(H[1]+H[0])/2,da=Jt+dc/2,_a=we.length,Wo=new Uint8Array(_a);for(let Pi=0;Pi<_a;Pi++)Wo[Pi]=we[Pi];const vd=[new jt(Ja,y),new jt(da,y)];return new he(_t,Wo,0,vd,ye.CODE_128,new Date().getTime())}}nt.CODE_PATTERNS=[Int32Array.from([2,1,2,2,2,2]),Int32Array.from([2,2,2,1,2,2]),Int32Array.from([2,2,2,2,2,1]),Int32Array.from([1,2,1,2,2,3]),Int32Array.from([1,2,1,3,2,2]),Int32Array.from([1,3,1,2,2,2]),Int32Array.from([1,2,2,2,1,3]),Int32Array.from([1,2,2,3,1,2]),Int32Array.from([1,3,2,2,1,2]),Int32Array.from([2,2,1,2,1,3]),Int32Array.from([2,2,1,3,1,2]),Int32Array.from([2,3,1,2,1,2]),Int32Array.from([1,1,2,2,3,2]),Int32Array.from([1,2,2,1,3,2]),Int32Array.from([1,2,2,2,3,1]),Int32Array.from([1,1,3,2,2,2]),Int32Array.from([1,2,3,1,2,2]),Int32Array.from([1,2,3,2,2,1]),Int32Array.from([2,2,3,2,1,1]),Int32Array.from([2,2,1,1,3,2]),Int32Array.from([2,2,1,2,3,1]),Int32Array.from([2,1,3,2,1,2]),Int32Array.from([2,2,3,1,1,2]),Int32Array.from([3,1,2,1,3,1]),Int32Array.from([3,1,1,2,2,2]),Int32Array.from([3,2,1,1,2,2]),Int32Array.from([3,2,1,2,2,1]),Int32Array.from([3,1,2,2,1,2]),Int32Array.from([3,2,2,1,1,2]),Int32Array.from([3,2,2,2,1,1]),Int32Array.from([2,1,2,1,2,3]),Int32Array.from([2,1,2,3,2,1]),Int32Array.from([2,3,2,1,2,1]),Int32Array.from([1,1,1,3,2,3]),Int32Array.from([1,3,1,1,2,3]),Int32Array.from([1,3,1,3,2,1]),Int32Array.from([1,1,2,3,1,3]),Int32Array.from([1,3,2,1,1,3]),Int32Array.from([1,3,2,3,1,1]),Int32Array.from([2,1,1,3,1,3]),Int32Array.from([2,3,1,1,1,3]),Int32Array.from([2,3,1,3,1,1]),Int32Array.from([1,1,2,1,3,3]),Int32Array.from([1,1,2,3,3,1]),Int32Array.from([1,3,2,1,3,1]),Int32Array.from([1,1,3,1,2,3]),Int32Array.from([1,1,3,3,2,1]),Int32Array.from([1,3,3,1,2,1]),Int32Array.from([3,1,3,1,2,1]),Int32Array.from([2,1,1,3,3,1]),Int32Array.from([2,3,1,1,3,1]),Int32Array.from([2,1,3,1,1,3]),Int32Array.from([2,1,3,3,1,1]),Int32Array.from([2,1,3,1,3,1]),Int32Array.from([3,1,1,1,2,3]),Int32Array.from([3,1,1,3,2,1]),Int32Array.from([3,3,1,1,2,1]),Int32Array.from([3,1,2,1,1,3]),Int32Array.from([3,1,2,3,1,1]),Int32Array.from([3,3,2,1,1,1]),Int32Array.from([3,1,4,1,1,1]),Int32Array.from([2,2,1,4,1,1]),Int32Array.from([4,3,1,1,1,1]),Int32Array.from([1,1,1,2,2,4]),Int32Array.from([1,1,1,4,2,2]),Int32Array.from([1,2,1,1,2,4]),Int32Array.from([1,2,1,4,2,1]),Int32Array.from([1,4,1,1,2,2]),Int32Array.from([1,4,1,2,2,1]),Int32Array.from([1,1,2,2,1,4]),Int32Array.from([1,1,2,4,1,2]),Int32Array.from([1,2,2,1,1,4]),Int32Array.from([1,2,2,4,1,1]),Int32Array.from([1,4,2,1,1,2]),Int32Array.from([1,4,2,2,1,1]),Int32Array.from([2,4,1,2,1,1]),Int32Array.from([2,2,1,1,1,4]),Int32Array.from([4,1,3,1,1,1]),Int32Array.from([2,4,1,1,1,2]),Int32Array.from([1,3,4,1,1,1]),Int32Array.from([1,1,1,2,4,2]),Int32Array.from([1,2,1,1,4,2]),Int32Array.from([1,2,1,2,4,1]),Int32Array.from([1,1,4,2,1,2]),Int32Array.from([1,2,4,1,1,2]),Int32Array.from([1,2,4,2,1,1]),Int32Array.from([4,1,1,2,1,2]),Int32Array.from([4,2,1,1,1,2]),Int32Array.from([4,2,1,2,1,1]),Int32Array.from([2,1,2,1,4,1]),Int32Array.from([2,1,4,1,2,1]),Int32Array.from([4,1,2,1,2,1]),Int32Array.from([1,1,1,1,4,3]),Int32Array.from([1,1,1,3,4,1]),Int32Array.from([1,3,1,1,4,1]),Int32Array.from([1,1,4,1,1,3]),Int32Array.from([1,1,4,3,1,1]),Int32Array.from([4,1,1,1,1,3]),Int32Array.from([4,1,1,3,1,1]),Int32Array.from([1,1,3,1,4,1]),Int32Array.from([1,1,4,1,3,1]),Int32Array.from([3,1,1,1,4,1]),Int32Array.from([4,1,1,1,3,1]),Int32Array.from([2,1,1,4,1,2]),Int32Array.from([2,1,1,2,1,4]),Int32Array.from([2,1,1,2,3,2]),Int32Array.from([2,3,3,1,1,1,2])],nt.MAX_AVG_VARIANCE=.25,nt.MAX_INDIVIDUAL_VARIANCE=.7,nt.CODE_SHIFT=98,nt.CODE_CODE_C=99,nt.CODE_CODE_B=100,nt.CODE_CODE_A=101,nt.CODE_FNC_1=102,nt.CODE_FNC_2=97,nt.CODE_FNC_3=96,nt.CODE_FNC_4_A=101,nt.CODE_FNC_4_B=100,nt.CODE_START_A=103,nt.CODE_START_B=104,nt.CODE_START_C=105,nt.CODE_STOP=106;class Ue extends Et{constructor(y=!1,E=!1){super(),this.usingCheckDigit=y,this.extendedMode=E,this.decodeRowResult="",this.counters=new Int32Array(9)}decodeRow(y,E,O){let $=this.counters;$.fill(0),this.decodeRowResult="";let H=Ue.findAsteriskPattern(E,$),K=E.getNextSet(H[1]),le=E.getSize(),we,Te;do{Ue.recordPattern(E,K,$);let Ht=Ue.toNarrowWidePattern($);if(Ht<0)throw new Y;we=Ue.patternToChar(Ht),this.decodeRowResult+=we,Te=K;for(let Kt of $)K+=Kt;K=E.getNextSet(K)}while(we!=="*");this.decodeRowResult=this.decodeRowResult.substring(0,this.decodeRowResult.length-1);let Ze=0;for(let Ht of $)Ze+=Ht;let pt=K-Te-Ze;if(K!==le&&pt*2<Ze)throw new Y;if(this.usingCheckDigit){let Ht=this.decodeRowResult.length-1,Kt=0;for(let An=0;An<Ht;An++)Kt+=Ue.ALPHABET_STRING.indexOf(this.decodeRowResult.charAt(An));if(this.decodeRowResult.charAt(Ht)!==Ue.ALPHABET_STRING.charAt(Kt%43))throw new g;this.decodeRowResult=this.decodeRowResult.substring(0,Ht)}if(this.decodeRowResult.length===0)throw new Y;let _t;this.extendedMode?_t=Ue.decodeExtended(this.decodeRowResult):_t=this.decodeRowResult;let Jt=(H[1]+H[0])/2,Ct=Te+Ze/2;return new he(_t,null,0,[new jt(Jt,y),new jt(Ct,y)],ye.CODE_39,new Date().getTime())}static findAsteriskPattern(y,E){let O=y.getSize(),$=y.getNextSet(0),H=0,K=$,le=!1,we=E.length;for(let Te=$;Te<O;Te++)if(y.get(Te)!==le)E[H]++;else{if(H===we-1){if(this.toNarrowWidePattern(E)===Ue.ASTERISK_ENCODING&&y.isRange(Math.max(0,K-Math.floor((Te-K)/2)),K,!1))return[K,Te];K+=E[0]+E[1],E.copyWithin(0,2,2+H-1),E[H-1]=0,E[H]=0,H--}else H++;E[H]=1,le=!le}throw new Y}static toNarrowWidePattern(y){let E=y.length,O=0,$;do{let H=2147483647;for(let we of y)we<H&&we>O&&(H=we);O=H,$=0;let K=0,le=0;for(let we=0;we<E;we++){let Te=y[we];Te>O&&(le|=1<<E-1-we,$++,K+=Te)}if($===3){for(let we=0;we<E&&$>0;we++){let Te=y[we];if(Te>O&&($--,Te*2>=K))return-1}return le}}while($>3);return-1}static patternToChar(y){for(let E=0;E<Ue.CHARACTER_ENCODINGS.length;E++)if(Ue.CHARACTER_ENCODINGS[E]===y)return Ue.ALPHABET_STRING.charAt(E);if(y===Ue.ASTERISK_ENCODING)return"*";throw new Y}static decodeExtended(y){let E=y.length,O="";for(let $=0;$<E;$++){let H=y.charAt($);if(H==="+"||H==="$"||H==="%"||H==="/"){let K=y.charAt($+1),le="\0";switch(H){case"+":if(K>="A"&&K<="Z")le=String.fromCharCode(K.charCodeAt(0)+32);else throw new L;break;case"$":if(K>="A"&&K<="Z")le=String.fromCharCode(K.charCodeAt(0)-64);else throw new L;break;case"%":if(K>="A"&&K<="E")le=String.fromCharCode(K.charCodeAt(0)-38);else if(K>="F"&&K<="J")le=String.fromCharCode(K.charCodeAt(0)-11);else if(K>="K"&&K<="O")le=String.fromCharCode(K.charCodeAt(0)+16);else if(K>="P"&&K<="T")le=String.fromCharCode(K.charCodeAt(0)+43);else if(K==="U")le="\0";else if(K==="V")le="@";else if(K==="W")le="`";else if(K==="X"||K==="Y"||K==="Z")le="";else throw new L;break;case"/":if(K>="A"&&K<="O")le=String.fromCharCode(K.charCodeAt(0)-32);else if(K==="Z")le=":";else throw new L;break}O+=le,$++}else O+=H}return O}}Ue.ALPHABET_STRING="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%",Ue.CHARACTER_ENCODINGS=[52,289,97,352,49,304,112,37,292,100,265,73,328,25,280,88,13,268,76,28,259,67,322,19,274,82,7,262,70,22,385,193,448,145,400,208,133,388,196,168,162,138,42],Ue.ASTERISK_ENCODING=148;class Rt extends Et{constructor(){super(...arguments),this.narrowLineWidth=-1}decodeRow(y,E,O){let $=this.decodeStart(E),H=this.decodeEnd(E),K=new re;Rt.decodeMiddle(E,$[1],H[0],K);let le=K.toString(),we=null;O!=null&&(we=O.get(U.ALLOWED_LENGTHS)),we==null&&(we=Rt.DEFAULT_ALLOWED_LENGTHS);let Te=le.length,Ze=!1,pt=0;for(let Ct of we){if(Te===Ct){Ze=!0;break}Ct>pt&&(pt=Ct)}if(!Ze&&Te>pt&&(Ze=!0),!Ze)throw new L;const _t=[new jt($[1],y),new jt(H[0],y)];return new he(le,null,0,_t,ye.ITF,new Date().getTime())}static decodeMiddle(y,E,O,$){let H=new Int32Array(10),K=new Int32Array(5),le=new Int32Array(5);for(H.fill(0),K.fill(0),le.fill(0);E<O;){Et.recordPattern(y,E,H);for(let Te=0;Te<5;Te++){let Ze=2*Te;K[Te]=H[Ze],le[Te]=H[Ze+1]}let we=Rt.decodeDigit(K);$.append(we.toString()),we=this.decodeDigit(le),$.append(we.toString()),H.forEach(function(Te){E+=Te})}}decodeStart(y){let E=Rt.skipWhiteSpace(y),O=Rt.findGuardPattern(y,E,Rt.START_PATTERN);return this.narrowLineWidth=(O[1]-O[0])/4,this.validateQuietZone(y,O[0]),O}validateQuietZone(y,E){let O=this.narrowLineWidth*10;O=O<E?O:E;for(let $=E-1;O>0&&$>=0&&!y.get($);$--)O--;if(O!==0)throw new Y}static skipWhiteSpace(y){const E=y.getSize(),O=y.getNextSet(0);if(O===E)throw new Y;return O}decodeEnd(y){y.reverse();try{let E=Rt.skipWhiteSpace(y),O;try{O=Rt.findGuardPattern(y,E,Rt.END_PATTERN_REVERSED[0])}catch(H){H instanceof Y&&(O=Rt.findGuardPattern(y,E,Rt.END_PATTERN_REVERSED[1]))}this.validateQuietZone(y,O[0]);let $=O[0];return O[0]=y.getSize()-O[1],O[1]=y.getSize()-$,O}finally{y.reverse()}}static findGuardPattern(y,E,O){let $=O.length,H=new Int32Array($),K=y.getSize(),le=!1,we=0,Te=E;H.fill(0);for(let Ze=E;Ze<K;Ze++)if(y.get(Ze)!==le)H[we]++;else{if(we===$-1){if(Et.patternMatchVariance(H,O,Rt.MAX_INDIVIDUAL_VARIANCE)<Rt.MAX_AVG_VARIANCE)return[Te,Ze];Te+=H[0]+H[1],w.arraycopy(H,2,H,0,we-1),H[we-1]=0,H[we]=0,we--}else we++;H[we]=1,le=!le}throw new Y}static decodeDigit(y){let E=Rt.MAX_AVG_VARIANCE,O=-1,$=Rt.PATTERNS.length;for(let H=0;H<$;H++){let K=Rt.PATTERNS[H],le=Et.patternMatchVariance(y,K,Rt.MAX_INDIVIDUAL_VARIANCE);le<E?(E=le,O=H):le===E&&(O=-1)}if(O>=0)return O%10;throw new Y}}Rt.PATTERNS=[Int32Array.from([1,1,2,2,1]),Int32Array.from([2,1,1,1,2]),Int32Array.from([1,2,1,1,2]),Int32Array.from([2,2,1,1,1]),Int32Array.from([1,1,2,1,2]),Int32Array.from([2,1,2,1,1]),Int32Array.from([1,2,2,1,1]),Int32Array.from([1,1,1,2,2]),Int32Array.from([2,1,1,2,1]),Int32Array.from([1,2,1,2,1]),Int32Array.from([1,1,3,3,1]),Int32Array.from([3,1,1,1,3]),Int32Array.from([1,3,1,1,3]),Int32Array.from([3,3,1,1,1]),Int32Array.from([1,1,3,1,3]),Int32Array.from([3,1,3,1,1]),Int32Array.from([1,3,3,1,1]),Int32Array.from([1,1,1,3,3]),Int32Array.from([3,1,1,3,1]),Int32Array.from([1,3,1,3,1])],Rt.MAX_AVG_VARIANCE=.38,Rt.MAX_INDIVIDUAL_VARIANCE=.5,Rt.DEFAULT_ALLOWED_LENGTHS=[6,8,10,12,14],Rt.START_PATTERN=Int32Array.from([1,1,1,1]),Rt.END_PATTERN_REVERSED=[Int32Array.from([1,1,2]),Int32Array.from([1,1,3])];class We extends Et{constructor(){super(...arguments),this.decodeRowStringBuffer=""}static findStartGuardPattern(y){let E=!1,O,$=0,H=Int32Array.from([0,0,0]);for(;!E;){H=Int32Array.from([0,0,0]),O=We.findGuardPattern(y,$,!1,this.START_END_PATTERN,H);let K=O[0];$=O[1];let le=K-($-K);le>=0&&(E=y.isRange(le,K,!1))}return O}static checkChecksum(y){return We.checkStandardUPCEANChecksum(y)}static checkStandardUPCEANChecksum(y){let E=y.length;if(E===0)return!1;let O=parseInt(y.charAt(E-1),10);return We.getStandardUPCEANChecksum(y.substring(0,E-1))===O}static getStandardUPCEANChecksum(y){let E=y.length,O=0;for(let $=E-1;$>=0;$-=2){let H=y.charAt($).charCodeAt(0)-48;if(H<0||H>9)throw new L;O+=H}O*=3;for(let $=E-2;$>=0;$-=2){let H=y.charAt($).charCodeAt(0)-48;if(H<0||H>9)throw new L;O+=H}return(1e3-O)%10}static decodeEnd(y,E){return We.findGuardPattern(y,E,!1,We.START_END_PATTERN,new Int32Array(We.START_END_PATTERN.length).fill(0))}static findGuardPatternWithoutCounters(y,E,O,$){return this.findGuardPattern(y,E,O,$,new Int32Array($.length))}static findGuardPattern(y,E,O,$,H){let K=y.getSize();E=O?y.getNextUnset(E):y.getNextSet(E);let le=0,we=E,Te=$.length,Ze=O;for(let pt=E;pt<K;pt++)if(y.get(pt)!==Ze)H[le]++;else{if(le===Te-1){if(Et.patternMatchVariance(H,$,We.MAX_INDIVIDUAL_VARIANCE)<We.MAX_AVG_VARIANCE)return Int32Array.from([we,pt]);we+=H[0]+H[1];let _t=H.slice(2,H.length-1);for(let Jt=0;Jt<le-1;Jt++)H[Jt]=_t[Jt];H[le-1]=0,H[le]=0,le--}else le++;H[le]=1,Ze=!Ze}throw new Y}static decodeDigit(y,E,O,$){this.recordPattern(y,O,E);let H=this.MAX_AVG_VARIANCE,K=-1,le=$.length;for(let we=0;we<le;we++){let Te=$[we],Ze=Et.patternMatchVariance(E,Te,We.MAX_INDIVIDUAL_VARIANCE);Ze<H&&(H=Ze,K=we)}if(K>=0)return K;throw new Y}}We.MAX_AVG_VARIANCE=.48,We.MAX_INDIVIDUAL_VARIANCE=.7,We.START_END_PATTERN=Int32Array.from([1,1,1]),We.MIDDLE_PATTERN=Int32Array.from([1,1,1,1,1]),We.END_PATTERN=Int32Array.from([1,1,1,1,1,1]),We.L_PATTERNS=[Int32Array.from([3,2,1,1]),Int32Array.from([2,2,2,1]),Int32Array.from([2,1,2,2]),Int32Array.from([1,4,1,1]),Int32Array.from([1,1,3,2]),Int32Array.from([1,2,3,1]),Int32Array.from([1,1,1,4]),Int32Array.from([1,3,1,2]),Int32Array.from([1,2,1,3]),Int32Array.from([3,1,1,2])];class at{constructor(){this.CHECK_DIGIT_ENCODINGS=[24,20,18,17,12,6,3,10,9,5],this.decodeMiddleCounters=Int32Array.from([0,0,0,0]),this.decodeRowStringBuffer=""}decodeRow(y,E,O){let $=this.decodeRowStringBuffer,H=this.decodeMiddle(E,O,$),K=$.toString(),le=at.parseExtensionString(K),we=[new jt((O[0]+O[1])/2,y),new jt(H,y)],Te=new he(K,null,0,we,ye.UPC_EAN_EXTENSION,new Date().getTime());return le!=null&&Te.putAllMetadata(le),Te}decodeMiddle(y,E,O){let $=this.decodeMiddleCounters;$[0]=0,$[1]=0,$[2]=0,$[3]=0;let H=y.getSize(),K=E[1],le=0;for(let Te=0;Te<5&&K<H;Te++){let Ze=We.decodeDigit(y,$,K,We.L_AND_G_PATTERNS);O+=String.fromCharCode(48+Ze%10);for(let pt of $)K+=pt;Ze>=10&&(le|=1<<4-Te),Te!==4&&(K=y.getNextSet(K),K=y.getNextUnset(K))}if(O.length!==5)throw new Y;let we=this.determineCheckDigit(le);if(at.extensionChecksum(O.toString())!==we)throw new Y;return K}static extensionChecksum(y){let E=y.length,O=0;for(let $=E-2;$>=0;$-=2)O+=y.charAt($).charCodeAt(0)-48;O*=3;for(let $=E-1;$>=0;$-=2)O+=y.charAt($).charCodeAt(0)-48;return O*=3,O%10}determineCheckDigit(y){for(let E=0;E<10;E++)if(y===this.CHECK_DIGIT_ENCODINGS[E])return E;throw new Y}static parseExtensionString(y){if(y.length!==5)return null;let E=at.parseExtension5String(y);return E==null?null:new Map([[je.SUGGESTED_PRICE,E]])}static parseExtension5String(y){let E;switch(y.charAt(0)){case"0":E="£";break;case"5":E="$";break;case"9":switch(y){case"90000":return null;case"99991":return"0.00";case"99990":return"Used"}E="";break;default:E="";break}let O=parseInt(y.substring(1)),$=(O/100).toString(),H=O%100,K=H<10?"0"+H:H.toString();return E+$+"."+K}}class mt{constructor(){this.decodeMiddleCounters=Int32Array.from([0,0,0,0]),this.decodeRowStringBuffer=""}decodeRow(y,E,O){let $=this.decodeRowStringBuffer,H=this.decodeMiddle(E,O,$),K=$.toString(),le=mt.parseExtensionString(K),we=[new jt((O[0]+O[1])/2,y),new jt(H,y)],Te=new he(K,null,0,we,ye.UPC_EAN_EXTENSION,new Date().getTime());return le!=null&&Te.putAllMetadata(le),Te}decodeMiddle(y,E,O){let $=this.decodeMiddleCounters;$[0]=0,$[1]=0,$[2]=0,$[3]=0;let H=y.getSize(),K=E[1],le=0;for(let we=0;we<2&&K<H;we++){let Te=We.decodeDigit(y,$,K,We.L_AND_G_PATTERNS);O+=String.fromCharCode(48+Te%10);for(let Ze of $)K+=Ze;Te>=10&&(le|=1<<1-we),we!==1&&(K=y.getNextSet(K),K=y.getNextUnset(K))}if(O.length!==2)throw new Y;if(parseInt(O.toString())%4!==le)throw new Y;return K}static parseExtensionString(y){return y.length!==2?null:new Map([[je.ISSUE_NUMBER,parseInt(y)]])}}class Dt{static decodeRow(y,E,O){let $=We.findGuardPattern(E,O,!1,this.EXTENSION_START_PATTERN,new Int32Array(this.EXTENSION_START_PATTERN.length).fill(0));try{return new at().decodeRow(y,E,$)}catch{return new mt().decodeRow(y,E,$)}}}Dt.EXTENSION_START_PATTERN=Int32Array.from([1,1,2]);class Tt extends We{constructor(){super(),this.decodeRowStringBuffer="",Tt.L_AND_G_PATTERNS=Tt.L_PATTERNS.map(y=>Int32Array.from(y));for(let y=10;y<20;y++){let E=Tt.L_PATTERNS[y-10],O=new Int32Array(E.length);for(let $=0;$<E.length;$++)O[$]=E[E.length-$-1];Tt.L_AND_G_PATTERNS[y]=O}}decodeRow(y,E,O){let $=Tt.findStartGuardPattern(E),H=O==null?null:O.get(U.NEED_RESULT_POINT_CALLBACK);if(H!=null){const Sr=new jt(($[0]+$[1])/2,y);H.foundPossibleResultPoint(Sr)}let K=this.decodeMiddle(E,$,this.decodeRowStringBuffer),le=K.rowOffset,we=K.resultString;if(H!=null){const Sr=new jt(le,y);H.foundPossibleResultPoint(Sr)}let Te=this.decodeEnd(E,le);if(H!=null){const Sr=new jt((Te[0]+Te[1])/2,y);H.foundPossibleResultPoint(Sr)}let Ze=Te[1],pt=Ze+(Ze-Te[0]);if(pt>=E.getSize()||!E.isRange(Ze,pt,!1))throw new Y;let _t=we.toString();if(_t.length<8)throw new L;if(!Tt.checkChecksum(_t))throw new g;let Jt=($[1]+$[0])/2,Ct=(Te[1]+Te[0])/2,Ht=this.getBarcodeFormat(),Kt=[new jt(Jt,y),new jt(Ct,y)],An=new he(_t,null,0,Kt,Ht,new Date().getTime()),hr=0;try{let Sr=Dt.decodeRow(y,E,Te[1]);An.putMetadata(je.UPC_EAN_EXTENSION,Sr.getText()),An.putAllMetadata(Sr.getResultMetadata()),An.addResultPoints(Sr.getResultPoints()),hr=Sr.getText().length}catch{}let wr=O==null?null:O.get(U.ALLOWED_EAN_EXTENSIONS);if(wr!=null){let Sr=!1;for(let Ss in wr)if(hr.toString()===Ss){Sr=!0;break}if(!Sr)throw new Y}return An}decodeEnd(y,E){return Tt.findGuardPattern(y,E,!1,Tt.START_END_PATTERN,new Int32Array(Tt.START_END_PATTERN.length).fill(0))}static checkChecksum(y){return Tt.checkStandardUPCEANChecksum(y)}static checkStandardUPCEANChecksum(y){let E=y.length;if(E===0)return!1;let O=parseInt(y.charAt(E-1),10);return Tt.getStandardUPCEANChecksum(y.substring(0,E-1))===O}static getStandardUPCEANChecksum(y){let E=y.length,O=0;for(let $=E-1;$>=0;$-=2){let H=y.charAt($).charCodeAt(0)-48;if(H<0||H>9)throw new L;O+=H}O*=3;for(let $=E-2;$>=0;$-=2){let H=y.charAt($).charCodeAt(0)-48;if(H<0||H>9)throw new L;O+=H}return(1e3-O)%10}}class dn extends Tt{constructor(){super(),this.decodeMiddleCounters=Int32Array.from([0,0,0,0])}decodeMiddle(y,E,O){let $=this.decodeMiddleCounters;$[0]=0,$[1]=0,$[2]=0,$[3]=0;let H=y.getSize(),K=E[1],le=0;for(let Te=0;Te<6&&K<H;Te++){let Ze=Tt.decodeDigit(y,$,K,Tt.L_AND_G_PATTERNS);O+=String.fromCharCode(48+Ze%10);for(let pt of $)K+=pt;Ze>=10&&(le|=1<<5-Te)}O=dn.determineFirstDigit(O,le),K=Tt.findGuardPattern(y,K,!0,Tt.MIDDLE_PATTERN,new Int32Array(Tt.MIDDLE_PATTERN.length).fill(0))[1];for(let Te=0;Te<6&&K<H;Te++){let Ze=Tt.decodeDigit(y,$,K,Tt.L_PATTERNS);O+=String.fromCharCode(48+Ze);for(let pt of $)K+=pt}return{rowOffset:K,resultString:O}}getBarcodeFormat(){return ye.EAN_13}static determineFirstDigit(y,E){for(let O=0;O<10;O++)if(E===this.FIRST_DIGIT_ENCODINGS[O])return y=String.fromCharCode(48+O)+y,y;throw new Y}}dn.FIRST_DIGIT_ENCODINGS=[0,11,13,14,19,25,28,21,22,26];class on extends Tt{constructor(){super(),this.decodeMiddleCounters=Int32Array.from([0,0,0,0])}decodeMiddle(y,E,O){const $=this.decodeMiddleCounters;$[0]=0,$[1]=0,$[2]=0,$[3]=0;let H=y.getSize(),K=E[1];for(let we=0;we<4&&K<H;we++){let Te=Tt.decodeDigit(y,$,K,Tt.L_PATTERNS);O+=String.fromCharCode(48+Te);for(let Ze of $)K+=Ze}K=Tt.findGuardPattern(y,K,!0,Tt.MIDDLE_PATTERN,new Int32Array(Tt.MIDDLE_PATTERN.length).fill(0))[1];for(let we=0;we<4&&K<H;we++){let Te=Tt.decodeDigit(y,$,K,Tt.L_PATTERNS);O+=String.fromCharCode(48+Te);for(let Ze of $)K+=Ze}return{rowOffset:K,resultString:O}}getBarcodeFormat(){return ye.EAN_8}}class gn extends Tt{constructor(){super(...arguments),this.ean13Reader=new dn}getBarcodeFormat(){return ye.UPC_A}decode(y,E){return this.maybeReturnResult(this.ean13Reader.decode(y))}decodeRow(y,E,O){return this.maybeReturnResult(this.ean13Reader.decodeRow(y,E,O))}decodeMiddle(y,E,O){return this.ean13Reader.decodeMiddle(y,E,O)}maybeReturnResult(y){let E=y.getText();if(E.charAt(0)==="0"){let O=new he(E.substring(1),null,null,y.getResultPoints(),ye.UPC_A);return y.getResultMetadata()!=null&&O.putAllMetadata(y.getResultMetadata()),O}else throw new Y}reset(){this.ean13Reader.reset()}}class Nn extends Tt{constructor(){super(),this.decodeMiddleCounters=new Int32Array(4)}decodeMiddle(y,E,O){const $=this.decodeMiddleCounters.map(Te=>Te);$[0]=0,$[1]=0,$[2]=0,$[3]=0;const H=y.getSize();let K=E[1],le=0;for(let Te=0;Te<6&&K<H;Te++){const Ze=Nn.decodeDigit(y,$,K,Nn.L_AND_G_PATTERNS);O+=String.fromCharCode(48+Ze%10);for(let pt of $)K+=pt;Ze>=10&&(le|=1<<5-Te)}let we=Nn.determineNumSysAndCheckDigit(O,le);return{rowOffset:K,resultString:we}}decodeEnd(y,E){return Nn.findGuardPatternWithoutCounters(y,E,!0,Nn.MIDDLE_END_PATTERN)}checkChecksum(y){return Tt.checkChecksum(Nn.convertUPCEtoUPCA(y))}static determineNumSysAndCheckDigit(y,E){for(let O=0;O<=1;O++)for(let $=0;$<10;$++)if(E===this.NUMSYS_AND_CHECK_DIGIT_PATTERNS[O][$]){let H=String.fromCharCode(48+O),K=String.fromCharCode(48+$);return H+y+K}throw Y.getNotFoundInstance()}getBarcodeFormat(){return ye.UPC_E}static convertUPCEtoUPCA(y){const E=y.slice(1,7).split("").map(H=>H.charCodeAt(0)),O=new re;O.append(y.charAt(0));let $=E[5];switch($){case 0:case 1:case 2:O.appendChars(E,0,2),O.append($),O.append("0000"),O.appendChars(E,2,3);break;case 3:O.appendChars(E,0,3),O.append("00000"),O.appendChars(E,3,2);break;case 4:O.appendChars(E,0,4),O.append("00000"),O.append(E[4]);break;default:O.appendChars(E,0,5),O.append("0000"),O.append($);break}return y.length>=8&&O.append(y.charAt(7)),O.toString()}}Nn.MIDDLE_END_PATTERN=Int32Array.from([1,1,1,1,1,1]),Nn.NUMSYS_AND_CHECK_DIGIT_PATTERNS=[Int32Array.from([56,52,50,49,44,38,35,42,41,37]),Int32Array.from([7,11,13,14,19,25,28,21,22,26])];class kn extends Et{constructor(y){super();let E=y==null?null:y.get(U.POSSIBLE_FORMATS),O=[];r(E)?(O.push(new dn),O.push(new gn),O.push(new on),O.push(new Nn)):(E.indexOf(ye.EAN_13)>-1&&O.push(new dn),E.indexOf(ye.UPC_A)>-1&&O.push(new gn),E.indexOf(ye.EAN_8)>-1&&O.push(new on),E.indexOf(ye.UPC_E)>-1&&O.push(new Nn)),this.readers=O}decodeRow(y,E,O){for(let $ of this.readers)try{const H=$.decodeRow(y,E,O),K=H.getBarcodeFormat()===ye.EAN_13&&H.getText().charAt(0)==="0",le=O==null?null:O.get(U.POSSIBLE_FORMATS),we=le==null||le.includes(ye.UPC_A);if(K&&we){const Te=H.getRawBytes(),Ze=new he(H.getText().substring(1),Te,Te?Te.length:null,H.getResultPoints(),ye.UPC_A);return Ze.putAllMetadata(H.getResultMetadata()),Ze}return H}catch{}throw new Y}reset(){for(let y of this.readers)y.reset()}}class yn extends Et{constructor(){super(),this.decodeFinderCounters=new Int32Array(4),this.dataCharacterCounters=new Int32Array(8),this.oddRoundingErrors=new Array(4),this.evenRoundingErrors=new Array(4),this.oddCounts=new Array(this.dataCharacterCounters.length/2),this.evenCounts=new Array(this.dataCharacterCounters.length/2)}getDecodeFinderCounters(){return this.decodeFinderCounters}getDataCharacterCounters(){return this.dataCharacterCounters}getOddRoundingErrors(){return this.oddRoundingErrors}getEvenRoundingErrors(){return this.evenRoundingErrors}getOddCounts(){return this.oddCounts}getEvenCounts(){return this.evenCounts}parseFinderValue(y,E){for(let O=0;O<E.length;O++)if(Et.patternMatchVariance(y,E[O],yn.MAX_INDIVIDUAL_VARIANCE)<yn.MAX_AVG_VARIANCE)return O;throw new Y}static count(y){return It.sum(new Int32Array(y))}static increment(y,E){let O=0,$=E[0];for(let H=1;H<y.length;H++)E[H]>$&&($=E[H],O=H);y[O]++}static decrement(y,E){let O=0,$=E[0];for(let H=1;H<y.length;H++)E[H]<$&&($=E[H],O=H);y[O]--}static isFinderPattern(y){let E=y[0]+y[1],O=E+y[2]+y[3],$=E/O;if($>=yn.MIN_FINDER_PATTERN_RATIO&&$<=yn.MAX_FINDER_PATTERN_RATIO){let H=Number.MAX_SAFE_INTEGER,K=Number.MIN_SAFE_INTEGER;for(let le of y)le>K&&(K=le),le<H&&(H=le);return K<10*H}return!1}}yn.MAX_AVG_VARIANCE=.2,yn.MAX_INDIVIDUAL_VARIANCE=.45,yn.MIN_FINDER_PATTERN_RATIO=9.5/12,yn.MAX_FINDER_PATTERN_RATIO=12.5/14;class Vn{constructor(y,E){this.value=y,this.checksumPortion=E}getValue(){return this.value}getChecksumPortion(){return this.checksumPortion}toString(){return this.value+"("+this.checksumPortion+")"}equals(y){if(!(y instanceof Vn))return!1;const E=y;return this.value===E.value&&this.checksumPortion===E.checksumPortion}hashCode(){return this.value^this.checksumPortion}}class Gn{constructor(y,E,O,$,H){this.value=y,this.startEnd=E,this.value=y,this.startEnd=E,this.resultPoints=new Array,this.resultPoints.push(new jt(O,H)),this.resultPoints.push(new jt($,H))}getValue(){return this.value}getStartEnd(){return this.startEnd}getResultPoints(){return this.resultPoints}equals(y){if(!(y instanceof Gn))return!1;const E=y;return this.value===E.value}hashCode(){return this.value}}class Dn{constructor(){}static getRSSvalue(y,E,O){let $=0;for(let we of y)$+=we;let H=0,K=0,le=y.length;for(let we=0;we<le-1;we++){let Te;for(Te=1,K|=1<<we;Te<y[we];Te++,K&=~(1<<we)){let Ze=Dn.combins($-Te-1,le-we-2);if(O&&K===0&&$-Te-(le-we-1)>=le-we-1&&(Ze-=Dn.combins($-Te-(le-we),le-we-2)),le-we-1>1){let pt=0;for(let _t=$-Te-(le-we-2);_t>E;_t--)pt+=Dn.combins($-Te-_t-1,le-we-3);Ze-=pt*(le-1-we)}else $-Te>E&&Ze--;H+=Ze}$-=Te}return H}static combins(y,E){let O,$;y-E>E?($=E,O=y-E):($=y-E,O=E);let H=1,K=1;for(let le=y;le>O;le--)H*=le,K<=$&&(H/=K,K++);for(;K<=$;)H/=K,K++;return H}}class Kn{static buildBitArray(y){let E=y.length*2-1;y[y.length-1].getRightChar()==null&&(E-=1);let O=12*E,$=new R(O),H=0,le=y[0].getRightChar().getValue();for(let we=11;we>=0;--we)le&1<<we&&$.set(H),H++;for(let we=1;we<y.length;++we){let Te=y[we],Ze=Te.getLeftChar().getValue();for(let pt=11;pt>=0;--pt)Ze&1<<pt&&$.set(H),H++;if(Te.getRightChar()!=null){let pt=Te.getRightChar().getValue();for(let _t=11;_t>=0;--_t)pt&1<<_t&&$.set(H),H++}}return $}}class Cn{constructor(y,E){E?this.decodedInformation=null:(this.finished=y,this.decodedInformation=E)}getDecodedInformation(){return this.decodedInformation}isFinished(){return this.finished}}class sn{constructor(y){this.newPosition=y}getNewPosition(){return this.newPosition}}class Me extends sn{constructor(y,E){super(y),this.value=E}getValue(){return this.value}isFNC1(){return this.value===Me.FNC1}}Me.FNC1="$";class en extends sn{constructor(y,E,O){super(y),O?(this.remaining=!0,this.remainingValue=this.remainingValue):(this.remaining=!1,this.remainingValue=0),this.newString=E}getNewString(){return this.newString}isRemaining(){return this.remaining}getRemainingValue(){return this.remainingValue}}class an extends sn{constructor(y,E,O){if(super(y),E<0||E>10||O<0||O>10)throw new L;this.firstDigit=E,this.secondDigit=O}getFirstDigit(){return this.firstDigit}getSecondDigit(){return this.secondDigit}getValue(){return this.firstDigit*10+this.secondDigit}isFirstDigitFNC1(){return this.firstDigit===an.FNC1}isSecondDigitFNC1(){return this.secondDigit===an.FNC1}isAnyFNC1(){return this.firstDigit===an.FNC1||this.secondDigit===an.FNC1}}an.FNC1=10;class Nt{constructor(){}static parseFieldsInGeneralPurpose(y){if(!y)return null;if(y.length<2)throw new Y;let E=y.substring(0,2);for(let H of Nt.TWO_DIGIT_DATA_LENGTH)if(H[0]===E)return H[1]===Nt.VARIABLE_LENGTH?Nt.processVariableAI(2,H[2],y):Nt.processFixedAI(2,H[1],y);if(y.length<3)throw new Y;let O=y.substring(0,3);for(let H of Nt.THREE_DIGIT_DATA_LENGTH)if(H[0]===O)return H[1]===Nt.VARIABLE_LENGTH?Nt.processVariableAI(3,H[2],y):Nt.processFixedAI(3,H[1],y);for(let H of Nt.THREE_DIGIT_PLUS_DIGIT_DATA_LENGTH)if(H[0]===O)return H[1]===Nt.VARIABLE_LENGTH?Nt.processVariableAI(4,H[2],y):Nt.processFixedAI(4,H[1],y);if(y.length<4)throw new Y;let $=y.substring(0,4);for(let H of Nt.FOUR_DIGIT_DATA_LENGTH)if(H[0]===$)return H[1]===Nt.VARIABLE_LENGTH?Nt.processVariableAI(4,H[2],y):Nt.processFixedAI(4,H[1],y);throw new Y}static processFixedAI(y,E,O){if(O.length<y)throw new Y;let $=O.substring(0,y);if(O.length<y+E)throw new Y;let H=O.substring(y,y+E),K=O.substring(y+E),le="("+$+")"+H,we=Nt.parseFieldsInGeneralPurpose(K);return we==null?le:le+we}static processVariableAI(y,E,O){let $=O.substring(0,y),H;O.length<y+E?H=O.length:H=y+E;let K=O.substring(y,H),le=O.substring(H),we="("+$+")"+K,Te=Nt.parseFieldsInGeneralPurpose(le);return Te==null?we:we+Te}}Nt.VARIABLE_LENGTH=[],Nt.TWO_DIGIT_DATA_LENGTH=[["00",18],["01",14],["02",14],["10",Nt.VARIABLE_LENGTH,20],["11",6],["12",6],["13",6],["15",6],["17",6],["20",2],["21",Nt.VARIABLE_LENGTH,20],["22",Nt.VARIABLE_LENGTH,29],["30",Nt.VARIABLE_LENGTH,8],["37",Nt.VARIABLE_LENGTH,8],["90",Nt.VARIABLE_LENGTH,30],["91",Nt.VARIABLE_LENGTH,30],["92",Nt.VARIABLE_LENGTH,30],["93",Nt.VARIABLE_LENGTH,30],["94",Nt.VARIABLE_LENGTH,30],["95",Nt.VARIABLE_LENGTH,30],["96",Nt.VARIABLE_LENGTH,30],["97",Nt.VARIABLE_LENGTH,3],["98",Nt.VARIABLE_LENGTH,30],["99",Nt.VARIABLE_LENGTH,30]],Nt.THREE_DIGIT_DATA_LENGTH=[["240",Nt.VARIABLE_LENGTH,30],["241",Nt.VARIABLE_LENGTH,30],["242",Nt.VARIABLE_LENGTH,6],["250",Nt.VARIABLE_LENGTH,30],["251",Nt.VARIABLE_LENGTH,30],["253",Nt.VARIABLE_LENGTH,17],["254",Nt.VARIABLE_LENGTH,20],["400",Nt.VARIABLE_LENGTH,30],["401",Nt.VARIABLE_LENGTH,30],["402",17],["403",Nt.VARIABLE_LENGTH,30],["410",13],["411",13],["412",13],["413",13],["414",13],["420",Nt.VARIABLE_LENGTH,20],["421",Nt.VARIABLE_LENGTH,15],["422",3],["423",Nt.VARIABLE_LENGTH,15],["424",3],["425",3],["426",3]],Nt.THREE_DIGIT_PLUS_DIGIT_DATA_LENGTH=[["310",6],["311",6],["312",6],["313",6],["314",6],["315",6],["316",6],["320",6],["321",6],["322",6],["323",6],["324",6],["325",6],["326",6],["327",6],["328",6],["329",6],["330",6],["331",6],["332",6],["333",6],["334",6],["335",6],["336",6],["340",6],["341",6],["342",6],["343",6],["344",6],["345",6],["346",6],["347",6],["348",6],["349",6],["350",6],["351",6],["352",6],["353",6],["354",6],["355",6],["356",6],["357",6],["360",6],["361",6],["362",6],["363",6],["364",6],["365",6],["366",6],["367",6],["368",6],["369",6],["390",Nt.VARIABLE_LENGTH,15],["391",Nt.VARIABLE_LENGTH,18],["392",Nt.VARIABLE_LENGTH,15],["393",Nt.VARIABLE_LENGTH,18],["703",Nt.VARIABLE_LENGTH,30]],Nt.FOUR_DIGIT_DATA_LENGTH=[["7001",13],["7002",Nt.VARIABLE_LENGTH,30],["7003",10],["8001",14],["8002",Nt.VARIABLE_LENGTH,20],["8003",Nt.VARIABLE_LENGTH,30],["8004",Nt.VARIABLE_LENGTH,30],["8005",6],["8006",18],["8007",Nt.VARIABLE_LENGTH,30],["8008",Nt.VARIABLE_LENGTH,12],["8018",18],["8020",Nt.VARIABLE_LENGTH,25],["8100",6],["8101",10],["8102",2],["8110",Nt.VARIABLE_LENGTH,70],["8200",Nt.VARIABLE_LENGTH,70]];class Yn{constructor(y){this.buffer=new re,this.information=y}decodeAllCodes(y,E){let O=E,$=null;do{let H=this.decodeGeneralPurposeField(O,$),K=Nt.parseFieldsInGeneralPurpose(H.getNewString());if(K!=null&&y.append(K),H.isRemaining()?$=""+H.getRemainingValue():$=null,O===H.getNewPosition())break;O=H.getNewPosition()}while(!0);return y.toString()}isStillNumeric(y){if(y+7>this.information.getSize())return y+4<=this.information.getSize();for(let E=y;E<y+3;++E)if(this.information.get(E))return!0;return this.information.get(y+3)}decodeNumeric(y){if(y+7>this.information.getSize()){let H=this.extractNumericValueFromBitArray(y,4);return H===0?new an(this.information.getSize(),an.FNC1,an.FNC1):new an(this.information.getSize(),H-1,an.FNC1)}let E=this.extractNumericValueFromBitArray(y,7),O=(E-8)/11,$=(E-8)%11;return new an(y+7,O,$)}extractNumericValueFromBitArray(y,E){return Yn.extractNumericValueFromBitArray(this.information,y,E)}static extractNumericValueFromBitArray(y,E,O){let $=0;for(let H=0;H<O;++H)y.get(E+H)&&($|=1<<O-H-1);return $}decodeGeneralPurposeField(y,E){this.buffer.setLengthToZero(),E!=null&&this.buffer.append(E),this.current.setPosition(y);let O=this.parseBlocks();return O!=null&&O.isRemaining()?new en(this.current.getPosition(),this.buffer.toString(),O.getRemainingValue()):new en(this.current.getPosition(),this.buffer.toString())}parseBlocks(){let y,E;do{let O=this.current.getPosition();if(this.current.isAlpha()?(E=this.parseAlphaBlock(),y=E.isFinished()):this.current.isIsoIec646()?(E=this.parseIsoIec646Block(),y=E.isFinished()):(E=this.parseNumericBlock(),y=E.isFinished()),!(O!==this.current.getPosition())&&!y)break}while(!y);return E.getDecodedInformation()}parseNumericBlock(){for(;this.isStillNumeric(this.current.getPosition());){let y=this.decodeNumeric(this.current.getPosition());if(this.current.setPosition(y.getNewPosition()),y.isFirstDigitFNC1()){let E;return y.isSecondDigitFNC1()?E=new en(this.current.getPosition(),this.buffer.toString()):E=new en(this.current.getPosition(),this.buffer.toString(),y.getSecondDigit()),new Cn(!0,E)}if(this.buffer.append(y.getFirstDigit()),y.isSecondDigitFNC1()){let E=new en(this.current.getPosition(),this.buffer.toString());return new Cn(!0,E)}this.buffer.append(y.getSecondDigit())}return this.isNumericToAlphaNumericLatch(this.current.getPosition())&&(this.current.setAlpha(),this.current.incrementPosition(4)),new Cn(!1)}parseIsoIec646Block(){for(;this.isStillIsoIec646(this.current.getPosition());){let y=this.decodeIsoIec646(this.current.getPosition());if(this.current.setPosition(y.getNewPosition()),y.isFNC1()){let E=new en(this.current.getPosition(),this.buffer.toString());return new Cn(!0,E)}this.buffer.append(y.getValue())}return this.isAlphaOr646ToNumericLatch(this.current.getPosition())?(this.current.incrementPosition(3),this.current.setNumeric()):this.isAlphaTo646ToAlphaLatch(this.current.getPosition())&&(this.current.getPosition()+5<this.information.getSize()?this.current.incrementPosition(5):this.current.setPosition(this.information.getSize()),this.current.setAlpha()),new Cn(!1)}parseAlphaBlock(){for(;this.isStillAlpha(this.current.getPosition());){let y=this.decodeAlphanumeric(this.current.getPosition());if(this.current.setPosition(y.getNewPosition()),y.isFNC1()){let E=new en(this.current.getPosition(),this.buffer.toString());return new Cn(!0,E)}this.buffer.append(y.getValue())}return this.isAlphaOr646ToNumericLatch(this.current.getPosition())?(this.current.incrementPosition(3),this.current.setNumeric()):this.isAlphaTo646ToAlphaLatch(this.current.getPosition())&&(this.current.getPosition()+5<this.information.getSize()?this.current.incrementPosition(5):this.current.setPosition(this.information.getSize()),this.current.setIsoIec646()),new Cn(!1)}isStillIsoIec646(y){if(y+5>this.information.getSize())return!1;let E=this.extractNumericValueFromBitArray(y,5);if(E>=5&&E<16)return!0;if(y+7>this.information.getSize())return!1;let O=this.extractNumericValueFromBitArray(y,7);if(O>=64&&O<116)return!0;if(y+8>this.information.getSize())return!1;let $=this.extractNumericValueFromBitArray(y,8);return $>=232&&$<253}decodeIsoIec646(y){let E=this.extractNumericValueFromBitArray(y,5);if(E===15)return new Me(y+5,Me.FNC1);if(E>=5&&E<15)return new Me(y+5,"0"+(E-5));let O=this.extractNumericValueFromBitArray(y,7);if(O>=64&&O<90)return new Me(y+7,""+(O+1));if(O>=90&&O<116)return new Me(y+7,""+(O+7));let $=this.extractNumericValueFromBitArray(y,8),H;switch($){case 232:H="!";break;case 233:H='"';break;case 234:H="%";break;case 235:H="&";break;case 236:H="'";break;case 237:H="(";break;case 238:H=")";break;case 239:H="*";break;case 240:H="+";break;case 241:H=",";break;case 242:H="-";break;case 243:H=".";break;case 244:H="/";break;case 245:H=":";break;case 246:H=";";break;case 247:H="<";break;case 248:H="=";break;case 249:H=">";break;case 250:H="?";break;case 251:H="_";break;case 252:H=" ";break;default:throw new L}return new Me(y+8,H)}isStillAlpha(y){if(y+5>this.information.getSize())return!1;let E=this.extractNumericValueFromBitArray(y,5);if(E>=5&&E<16)return!0;if(y+6>this.information.getSize())return!1;let O=this.extractNumericValueFromBitArray(y,6);return O>=16&&O<63}decodeAlphanumeric(y){let E=this.extractNumericValueFromBitArray(y,5);if(E===15)return new Me(y+5,Me.FNC1);if(E>=5&&E<15)return new Me(y+5,"0"+(E-5));let O=this.extractNumericValueFromBitArray(y,6);if(O>=32&&O<58)return new Me(y+6,""+(O+33));let $;switch(O){case 58:$="*";break;case 59:$=",";break;case 60:$="-";break;case 61:$=".";break;case 62:$="/";break;default:throw new lt("Decoding invalid alphanumeric value: "+O)}return new Me(y+6,$)}isAlphaTo646ToAlphaLatch(y){if(y+1>this.information.getSize())return!1;for(let E=0;E<5&&E+y<this.information.getSize();++E)if(E===2){if(!this.information.get(y+2))return!1}else if(this.information.get(y+E))return!1;return!0}isAlphaOr646ToNumericLatch(y){if(y+3>this.information.getSize())return!1;for(let E=y;E<y+3;++E)if(this.information.get(E))return!1;return!0}isNumericToAlphaNumericLatch(y){if(y+1>this.information.getSize())return!1;for(let E=0;E<4&&E+y<this.information.getSize();++E)if(this.information.get(y+E))return!1;return!0}}class xn{constructor(y){this.information=y,this.generalDecoder=new Yn(y)}getInformation(){return this.information}getGeneralDecoder(){return this.generalDecoder}}class Mt extends xn{constructor(y){super(y)}encodeCompressedGtin(y,E){y.append("(01)");let O=y.length();y.append("9"),this.encodeCompressedGtinWithoutAI(y,E,O)}encodeCompressedGtinWithoutAI(y,E,O){for(let $=0;$<4;++$){let H=this.getGeneralDecoder().extractNumericValueFromBitArray(E+10*$,10);H/100===0&&y.append("0"),H/10===0&&y.append("0"),y.append(H)}Mt.appendCheckDigit(y,O)}static appendCheckDigit(y,E){let O=0;for(let $=0;$<13;$++){let H=y.charAt($+E).charCodeAt(0)-48;O+=$&1?H:3*H}O=10-O%10,O===10&&(O=0),y.append(O)}}Mt.GTIN_SIZE=40;class tn extends Mt{constructor(y){super(y)}parseInformation(){let y=new re;y.append("(01)");let E=y.length(),O=this.getGeneralDecoder().extractNumericValueFromBitArray(tn.HEADER_SIZE,4);return y.append(O),this.encodeCompressedGtinWithoutAI(y,tn.HEADER_SIZE+4,E),this.getGeneralDecoder().decodeAllCodes(y,tn.HEADER_SIZE+44)}}tn.HEADER_SIZE=4;class In extends xn{constructor(y){super(y)}parseInformation(){let y=new re;return this.getGeneralDecoder().decodeAllCodes(y,In.HEADER_SIZE)}}In.HEADER_SIZE=5;class Xn extends Mt{constructor(y){super(y)}encodeCompressedWeight(y,E,O){let $=this.getGeneralDecoder().extractNumericValueFromBitArray(E,O);this.addWeightCode(y,$);let H=this.checkWeight($),K=1e5;for(let le=0;le<5;++le)H/K===0&&y.append("0"),K/=10;y.append(H)}}class or extends Xn{constructor(y){super(y)}parseInformation(){if(this.getInformation().getSize()!=or.HEADER_SIZE+Xn.GTIN_SIZE+or.WEIGHT_SIZE)throw new Y;let y=new re;return this.encodeCompressedGtin(y,or.HEADER_SIZE),this.encodeCompressedWeight(y,or.HEADER_SIZE+Xn.GTIN_SIZE,or.WEIGHT_SIZE),y.toString()}}or.HEADER_SIZE=5,or.WEIGHT_SIZE=15;class lr extends or{constructor(y){super(y)}addWeightCode(y,E){y.append("(3103)")}checkWeight(y){return y}}class Qt extends or{constructor(y){super(y)}addWeightCode(y,E){E<1e4?y.append("(3202)"):y.append("(3203)")}checkWeight(y){return y<1e4?y:y-1e4}}class zn extends Mt{constructor(y){super(y)}parseInformation(){if(this.getInformation().getSize()<zn.HEADER_SIZE+Mt.GTIN_SIZE)throw new Y;let y=new re;this.encodeCompressedGtin(y,zn.HEADER_SIZE);let E=this.getGeneralDecoder().extractNumericValueFromBitArray(zn.HEADER_SIZE+Mt.GTIN_SIZE,zn.LAST_DIGIT_SIZE);y.append("(392"),y.append(E),y.append(")");let O=this.getGeneralDecoder().decodeGeneralPurposeField(zn.HEADER_SIZE+Mt.GTIN_SIZE+zn.LAST_DIGIT_SIZE,null);return y.append(O.getNewString()),y.toString()}}zn.HEADER_SIZE=8,zn.LAST_DIGIT_SIZE=2;class Jn extends Mt{constructor(y){super(y)}parseInformation(){if(this.getInformation().getSize()<Jn.HEADER_SIZE+Mt.GTIN_SIZE)throw new Y;let y=new re;this.encodeCompressedGtin(y,Jn.HEADER_SIZE);let E=this.getGeneralDecoder().extractNumericValueFromBitArray(Jn.HEADER_SIZE+Mt.GTIN_SIZE,Jn.LAST_DIGIT_SIZE);y.append("(393"),y.append(E),y.append(")");let O=this.getGeneralDecoder().extractNumericValueFromBitArray(Jn.HEADER_SIZE+Mt.GTIN_SIZE+Jn.LAST_DIGIT_SIZE,Jn.FIRST_THREE_DIGITS_SIZE);O/100==0&&y.append("0"),O/10==0&&y.append("0"),y.append(O);let $=this.getGeneralDecoder().decodeGeneralPurposeField(Jn.HEADER_SIZE+Mt.GTIN_SIZE+Jn.LAST_DIGIT_SIZE+Jn.FIRST_THREE_DIGITS_SIZE,null);return y.append($.getNewString()),y.toString()}}Jn.HEADER_SIZE=8,Jn.LAST_DIGIT_SIZE=2,Jn.FIRST_THREE_DIGITS_SIZE=10;class Lt extends Xn{constructor(y,E,O){super(y),this.dateCode=O,this.firstAIdigits=E}parseInformation(){if(this.getInformation().getSize()!=Lt.HEADER_SIZE+Lt.GTIN_SIZE+Lt.WEIGHT_SIZE+Lt.DATE_SIZE)throw new Y;let y=new re;return this.encodeCompressedGtin(y,Lt.HEADER_SIZE),this.encodeCompressedWeight(y,Lt.HEADER_SIZE+Lt.GTIN_SIZE,Lt.WEIGHT_SIZE),this.encodeCompressedDate(y,Lt.HEADER_SIZE+Lt.GTIN_SIZE+Lt.WEIGHT_SIZE),y.toString()}encodeCompressedDate(y,E){let O=this.getGeneralDecoder().extractNumericValueFromBitArray(E,Lt.DATE_SIZE);if(O==38400)return;y.append("("),y.append(this.dateCode),y.append(")");let $=O%32;O/=32;let H=O%12+1;O/=12;let K=O;K/10==0&&y.append("0"),y.append(K),H/10==0&&y.append("0"),y.append(H),$/10==0&&y.append("0"),y.append($)}addWeightCode(y,E){y.append("("),y.append(this.firstAIdigits),y.append(E/1e5),y.append(")")}checkWeight(y){return y%1e5}}Lt.HEADER_SIZE=8,Lt.WEIGHT_SIZE=20,Lt.DATE_SIZE=16;function jn(dt){try{if(dt.get(1))return new tn(dt);if(!dt.get(2))return new In(dt);switch(Yn.extractNumericValueFromBitArray(dt,1,4)){case 4:return new lr(dt);case 5:return new Qt(dt)}switch(Yn.extractNumericValueFromBitArray(dt,1,5)){case 12:return new zn(dt);case 13:return new Jn(dt)}switch(Yn.extractNumericValueFromBitArray(dt,1,7)){case 56:return new Lt(dt,"310","11");case 57:return new Lt(dt,"320","11");case 58:return new Lt(dt,"310","13");case 59:return new Lt(dt,"320","13");case 60:return new Lt(dt,"310","15");case 61:return new Lt(dt,"320","15");case 62:return new Lt(dt,"310","17");case 63:return new Lt(dt,"320","17")}}catch(y){throw console.log(y),new lt("unknown decoder: "+dt)}}class Ee{constructor(y,E,O,$){this.leftchar=y,this.rightchar=E,this.finderpattern=O,this.maybeLast=$}mayBeLast(){return this.maybeLast}getLeftChar(){return this.leftchar}getRightChar(){return this.rightchar}getFinderPattern(){return this.finderpattern}mustBeLast(){return this.rightchar==null}toString(){return"[ "+this.leftchar+", "+this.rightchar+" : "+(this.finderpattern==null?"null":this.finderpattern.getValue())+" ]"}static equals(y,E){return y instanceof Ee?Ee.equalsOrNull(y.leftchar,E.leftchar)&&Ee.equalsOrNull(y.rightchar,E.rightchar)&&Ee.equalsOrNull(y.finderpattern,E.finderpattern):!1}static equalsOrNull(y,E){return y===null?E===null:Ee.equals(y,E)}hashCode(){return this.leftchar.getValue()^this.rightchar.getValue()^this.finderpattern.getValue()}}class h{constructor(y,E,O){this.pairs=y,this.rowNumber=E,this.wasReversed=O}getPairs(){return this.pairs}getRowNumber(){return this.rowNumber}isReversed(){return this.wasReversed}isEquivalent(y){return this.checkEqualitity(this,y)}toString(){return"{ "+this.pairs+" }"}equals(y,E){return y instanceof h?this.checkEqualitity(y,E)&&y.wasReversed===E.wasReversed:!1}checkEqualitity(y,E){if(!y||!E)return;let O;return y.forEach(($,H)=>{E.forEach(K=>{$.getLeftChar().getValue()===K.getLeftChar().getValue()&&$.getRightChar().getValue()===K.getRightChar().getValue()&&$.getFinderPatter().getValue()===K.getFinderPatter().getValue()&&(O=!0)})}),O}}class p extends yn{constructor(y){super(...arguments),this.pairs=new Array(p.MAX_PAIRS),this.rows=new Array,this.startEnd=[2],this.verbose=y===!0}decodeRow(y,E,O){this.pairs.length=0,this.startFromEven=!1;try{return p.constructResult(this.decodeRow2pairs(y,E))}catch($){this.verbose&&console.log($)}return this.pairs.length=0,this.startFromEven=!0,p.constructResult(this.decodeRow2pairs(y,E))}reset(){this.pairs.length=0,this.rows.length=0}decodeRow2pairs(y,E){let O=!1;for(;!O;)try{this.pairs.push(this.retrieveNextPair(E,this.pairs,y))}catch(H){if(H instanceof Y){if(!this.pairs.length)throw new Y;O=!0}}if(this.checkChecksum())return this.pairs;let $;if(this.rows.length?$=!0:$=!1,this.storeRow(y,!1),$){let H=this.checkRowsBoolean(!1);if(H!=null||(H=this.checkRowsBoolean(!0),H!=null))return H}throw new Y}checkRowsBoolean(y){if(this.rows.length>25)return this.rows.length=0,null;this.pairs.length=0,y&&(this.rows=this.rows.reverse());let E=null;try{E=this.checkRows(new Array,0)}catch(O){this.verbose&&console.log(O)}return y&&(this.rows=this.rows.reverse()),E}checkRows(y,E){for(let O=E;O<this.rows.length;O++){let $=this.rows[O];this.pairs.length=0;for(let K of y)this.pairs.push(K.getPairs());if(this.pairs.push($.getPairs()),!p.isValidSequence(this.pairs))continue;if(this.checkChecksum())return this.pairs;let H=new Array(y);H.push($);try{return this.checkRows(H,O+1)}catch(K){this.verbose&&console.log(K)}}throw new Y}static isValidSequence(y){for(let E of p.FINDER_PATTERN_SEQUENCES){if(y.length>E.length)continue;let O=!0;for(let $=0;$<y.length;$++)if(y[$].getFinderPattern().getValue()!=E[$]){O=!1;break}if(O)return!0}return!1}storeRow(y,E){let O=0,$=!1,H=!1;for(;O<this.rows.length;){let K=this.rows[O];if(K.getRowNumber()>y){H=K.isEquivalent(this.pairs);break}$=K.isEquivalent(this.pairs),O++}H||$||p.isPartialRow(this.pairs,this.rows)||(this.rows.push(O,new h(this.pairs,y,E)),this.removePartialRows(this.pairs,this.rows))}removePartialRows(y,E){for(let O of E)if(O.getPairs().length!==y.length){for(let $ of O.getPairs())for(let H of y)if(Ee.equals($,H))break}}static isPartialRow(y,E){for(let O of E){let $=!0;for(let H of y){let K=!1;for(let le of O.getPairs())if(H.equals(le)){K=!0;break}if(!K){$=!1;break}}if($)return!0}return!1}getRows(){return this.rows}static constructResult(y){let E=Kn.buildBitArray(y),$=jn(E).parseInformation(),H=y[0].getFinderPattern().getResultPoints(),K=y[y.length-1].getFinderPattern().getResultPoints(),le=[H[0],H[1],K[0],K[1]];return new he($,null,null,le,ye.RSS_EXPANDED,null)}checkChecksum(){let y=this.pairs.get(0),E=y.getLeftChar(),O=y.getRightChar();if(O==null)return!1;let $=O.getChecksumPortion(),H=2;for(let le=1;le<this.pairs.size();++le){let we=this.pairs.get(le);$+=we.getLeftChar().getChecksumPortion(),H++;let Te=we.getRightChar();Te!=null&&($+=Te.getChecksumPortion(),H++)}return $%=211,211*(H-4)+$==E.getValue()}static getNextSecondBar(y,E){let O;return y.get(E)?(O=y.getNextUnset(E),O=y.getNextSet(O)):(O=y.getNextSet(E),O=y.getNextUnset(O)),O}retrieveNextPair(y,E,O){let $=E.length%2==0;this.startFromEven&&($=!$);let H,K=!0,le=-1;do this.findNextPair(y,E,le),H=this.parseFoundFinderPattern(y,O,$),H==null?le=p.getNextSecondBar(y,this.startEnd[0]):K=!1;while(K);let we=this.decodeDataCharacter(y,H,$,!0);if(!this.isEmptyPair(E)&&E[E.length-1].mustBeLast())throw new Y;let Te;try{Te=this.decodeDataCharacter(y,H,$,!1)}catch(Ze){Te=null,this.verbose&&console.log(Ze)}return new Ee(we,Te,H,!0)}isEmptyPair(y){return y.length===0}findNextPair(y,E,O){let $=this.getDecodeFinderCounters();$[0]=0,$[1]=0,$[2]=0,$[3]=0;let H=y.getSize(),K;O>=0?K=O:this.isEmptyPair(E)?K=0:K=E[E.length-1].getFinderPattern().getStartEnd()[1];let le=E.length%2!=0;this.startFromEven&&(le=!le);let we=!1;for(;K<H&&(we=!y.get(K),!!we);)K++;let Te=0,Ze=K;for(let pt=K;pt<H;pt++)if(y.get(pt)!=we)$[Te]++;else{if(Te==3){if(le&&p.reverseCounters($),p.isFinderPattern($)){this.startEnd[0]=Ze,this.startEnd[1]=pt;return}le&&p.reverseCounters($),Ze+=$[0]+$[1],$[0]=$[2],$[1]=$[3],$[2]=0,$[3]=0,Te--}else Te++;$[Te]=1,we=!we}throw new Y}static reverseCounters(y){let E=y.length;for(let O=0;O<E/2;++O){let $=y[O];y[O]=y[E-O-1],y[E-O-1]=$}}parseFoundFinderPattern(y,E,O){let $,H,K;if(O){let Te=this.startEnd[0]-1;for(;Te>=0&&!y.get(Te);)Te--;Te++,$=this.startEnd[0]-Te,H=Te,K=this.startEnd[1]}else H=this.startEnd[0],K=y.getNextUnset(this.startEnd[1]+1),$=K-this.startEnd[1];let le=this.getDecodeFinderCounters();w.arraycopy(le,0,le,1,le.length-1),le[0]=$;let we;try{we=this.parseFinderValue(le,p.FINDER_PATTERNS)}catch{return null}return new Gn(we,[H,K],H,K,E)}decodeDataCharacter(y,E,O,$){let H=this.getDataCharacterCounters();for(let da=0;da<H.length;da++)H[da]=0;if($)p.recordPatternInReverse(y,E.getStartEnd()[0],H);else{p.recordPattern(y,E.getStartEnd()[1],H);for(let da=0,_a=H.length-1;da<_a;da++,_a--){let Wo=H[da];H[da]=H[_a],H[_a]=Wo}}let K=17,le=It.sum(new Int32Array(H))/K,we=(E.getStartEnd()[1]-E.getStartEnd()[0])/15;if(Math.abs(le-we)/we>.3)throw new Y;let Te=this.getOddCounts(),Ze=this.getEvenCounts(),pt=this.getOddRoundingErrors(),_t=this.getEvenRoundingErrors();for(let da=0;da<H.length;da++){let _a=1*H[da]/le,Wo=_a+.5;if(Wo<1){if(_a<.3)throw new Y;Wo=1}else if(Wo>8){if(_a>8.7)throw new Y;Wo=8}let vd=da/2;da&1?(Ze[vd]=Wo,_t[vd]=_a-Wo):(Te[vd]=Wo,pt[vd]=_a-Wo)}this.adjustOddEvenCounts(K);let Jt=4*E.getValue()+(O?0:2)+($?0:1)-1,Ct=0,Ht=0;for(let da=Te.length-1;da>=0;da--){if(p.isNotA1left(E,O,$)){let _a=p.WEIGHTS[Jt][2*da];Ht+=Te[da]*_a}Ct+=Te[da]}let Kt=0;for(let da=Ze.length-1;da>=0;da--)if(p.isNotA1left(E,O,$)){let _a=p.WEIGHTS[Jt][2*da+1];Kt+=Ze[da]*_a}let An=Ht+Kt;if(Ct&1||Ct>13||Ct<4)throw new Y;let hr=(13-Ct)/2,wr=p.SYMBOL_WIDEST[hr],Sr=9-wr,Ss=Dn.getRSSvalue(Te,wr,!0),Qs=Dn.getRSSvalue(Ze,Sr,!1),dc=p.EVEN_TOTAL_SUBSET[hr],Za=p.GSUM[hr],Ja=Ss*dc+Qs+Za;return new Vn(Ja,An)}static isNotA1left(y,E,O){return!(y.getValue()==0&&E&&O)}adjustOddEvenCounts(y){let E=It.sum(new Int32Array(this.getOddCounts())),O=It.sum(new Int32Array(this.getEvenCounts())),$=!1,H=!1;E>13?H=!0:E<4&&($=!0);let K=!1,le=!1;O>13?le=!0:O<4&&(K=!0);let we=E+O-y,Te=(E&1)==1,Ze=(O&1)==0;if(we==1)if(Te){if(Ze)throw new Y;H=!0}else{if(!Ze)throw new Y;le=!0}else if(we==-1)if(Te){if(Ze)throw new Y;$=!0}else{if(!Ze)throw new Y;K=!0}else if(we==0){if(Te){if(!Ze)throw new Y;E<O?($=!0,le=!0):(H=!0,K=!0)}else if(Ze)throw new Y}else throw new Y;if($){if(H)throw new Y;p.increment(this.getOddCounts(),this.getOddRoundingErrors())}if(H&&p.decrement(this.getOddCounts(),this.getOddRoundingErrors()),K){if(le)throw new Y;p.increment(this.getEvenCounts(),this.getOddRoundingErrors())}le&&p.decrement(this.getEvenCounts(),this.getEvenRoundingErrors())}}p.SYMBOL_WIDEST=[7,5,4,3,1],p.EVEN_TOTAL_SUBSET=[4,20,52,104,204],p.GSUM=[0,348,1388,2948,3988],p.FINDER_PATTERNS=[Int32Array.from([1,8,4,1]),Int32Array.from([3,6,4,1]),Int32Array.from([3,4,6,1]),Int32Array.from([3,2,8,1]),Int32Array.from([2,6,5,1]),Int32Array.from([2,2,9,1])],p.WEIGHTS=[[1,3,9,27,81,32,96,77],[20,60,180,118,143,7,21,63],[189,145,13,39,117,140,209,205],[193,157,49,147,19,57,171,91],[62,186,136,197,169,85,44,132],[185,133,188,142,4,12,36,108],[113,128,173,97,80,29,87,50],[150,28,84,41,123,158,52,156],[46,138,203,187,139,206,196,166],[76,17,51,153,37,111,122,155],[43,129,176,106,107,110,119,146],[16,48,144,10,30,90,59,177],[109,116,137,200,178,112,125,164],[70,210,208,202,184,130,179,115],[134,191,151,31,93,68,204,190],[148,22,66,198,172,94,71,2],[6,18,54,162,64,192,154,40],[120,149,25,75,14,42,126,167],[79,26,78,23,69,207,199,175],[103,98,83,38,114,131,182,124],[161,61,183,127,170,88,53,159],[55,165,73,8,24,72,5,15],[45,135,194,160,58,174,100,89]],p.FINDER_PAT_A=0,p.FINDER_PAT_B=1,p.FINDER_PAT_C=2,p.FINDER_PAT_D=3,p.FINDER_PAT_E=4,p.FINDER_PAT_F=5,p.FINDER_PATTERN_SEQUENCES=[[p.FINDER_PAT_A,p.FINDER_PAT_A],[p.FINDER_PAT_A,p.FINDER_PAT_B,p.FINDER_PAT_B],[p.FINDER_PAT_A,p.FINDER_PAT_C,p.FINDER_PAT_B,p.FINDER_PAT_D],[p.FINDER_PAT_A,p.FINDER_PAT_E,p.FINDER_PAT_B,p.FINDER_PAT_D,p.FINDER_PAT_C],[p.FINDER_PAT_A,p.FINDER_PAT_E,p.FINDER_PAT_B,p.FINDER_PAT_D,p.FINDER_PAT_D,p.FINDER_PAT_F],[p.FINDER_PAT_A,p.FINDER_PAT_E,p.FINDER_PAT_B,p.FINDER_PAT_D,p.FINDER_PAT_E,p.FINDER_PAT_F,p.FINDER_PAT_F],[p.FINDER_PAT_A,p.FINDER_PAT_A,p.FINDER_PAT_B,p.FINDER_PAT_B,p.FINDER_PAT_C,p.FINDER_PAT_C,p.FINDER_PAT_D,p.FINDER_PAT_D],[p.FINDER_PAT_A,p.FINDER_PAT_A,p.FINDER_PAT_B,p.FINDER_PAT_B,p.FINDER_PAT_C,p.FINDER_PAT_C,p.FINDER_PAT_D,p.FINDER_PAT_E,p.FINDER_PAT_E],[p.FINDER_PAT_A,p.FINDER_PAT_A,p.FINDER_PAT_B,p.FINDER_PAT_B,p.FINDER_PAT_C,p.FINDER_PAT_C,p.FINDER_PAT_D,p.FINDER_PAT_E,p.FINDER_PAT_F,p.FINDER_PAT_F],[p.FINDER_PAT_A,p.FINDER_PAT_A,p.FINDER_PAT_B,p.FINDER_PAT_B,p.FINDER_PAT_C,p.FINDER_PAT_D,p.FINDER_PAT_D,p.FINDER_PAT_E,p.FINDER_PAT_E,p.FINDER_PAT_F,p.FINDER_PAT_F]],p.MAX_PAIRS=11;class S extends Vn{constructor(y,E,O){super(y,E),this.count=0,this.finderPattern=O}getFinderPattern(){return this.finderPattern}getCount(){return this.count}incrementCount(){this.count++}}class _ extends yn{constructor(){super(...arguments),this.possibleLeftPairs=[],this.possibleRightPairs=[]}decodeRow(y,E,O){const $=this.decodePair(E,!1,y,O);_.addOrTally(this.possibleLeftPairs,$),E.reverse();let H=this.decodePair(E,!0,y,O);_.addOrTally(this.possibleRightPairs,H),E.reverse();for(let K of this.possibleLeftPairs)if(K.getCount()>1){for(let le of this.possibleRightPairs)if(le.getCount()>1&&_.checkChecksum(K,le))return _.constructResult(K,le)}throw new Y}static addOrTally(y,E){if(E==null)return;let O=!1;for(let $ of y)if($.getValue()===E.getValue()){$.incrementCount(),O=!0;break}O||y.push(E)}reset(){this.possibleLeftPairs.length=0,this.possibleRightPairs.length=0}static constructResult(y,E){let O=4537077*y.getValue()+E.getValue(),$=new String(O).toString(),H=new re;for(let Te=13-$.length;Te>0;Te--)H.append("0");H.append($);let K=0;for(let Te=0;Te<13;Te++){let Ze=H.charAt(Te).charCodeAt(0)-48;K+=Te&1?Ze:3*Ze}K=10-K%10,K===10&&(K=0),H.append(K.toString());let le=y.getFinderPattern().getResultPoints(),we=E.getFinderPattern().getResultPoints();return new he(H.toString(),null,0,[le[0],le[1],we[0],we[1]],ye.RSS_14,new Date().getTime())}static checkChecksum(y,E){let O=(y.getChecksumPortion()+16*E.getChecksumPortion())%79,$=9*y.getFinderPattern().getValue()+E.getFinderPattern().getValue();return $>72&&$--,$>8&&$--,O===$}decodePair(y,E,O,$){try{let H=this.findFinderPattern(y,E),K=this.parseFoundFinderPattern(y,O,E,H),le=$==null?null:$.get(U.NEED_RESULT_POINT_CALLBACK);if(le!=null){let Ze=(H[0]+H[1])/2;E&&(Ze=y.getSize()-1-Ze),le.foundPossibleResultPoint(new jt(Ze,O))}let we=this.decodeDataCharacter(y,K,!0),Te=this.decodeDataCharacter(y,K,!1);return new S(1597*we.getValue()+Te.getValue(),we.getChecksumPortion()+4*Te.getChecksumPortion(),K)}catch{return null}}decodeDataCharacter(y,E,O){let $=this.getDataCharacterCounters();for(let Kt=0;Kt<$.length;Kt++)$[Kt]=0;if(O)Et.recordPatternInReverse(y,E.getStartEnd()[0],$);else{Et.recordPattern(y,E.getStartEnd()[1]+1,$);for(let Kt=0,An=$.length-1;Kt<An;Kt++,An--){let hr=$[Kt];$[Kt]=$[An],$[An]=hr}}let H=O?16:15,K=It.sum(new Int32Array($))/H,le=this.getOddCounts(),we=this.getEvenCounts(),Te=this.getOddRoundingErrors(),Ze=this.getEvenRoundingErrors();for(let Kt=0;Kt<$.length;Kt++){let An=$[Kt]/K,hr=Math.floor(An+.5);hr<1?hr=1:hr>8&&(hr=8);let wr=Math.floor(Kt/2);Kt&1?(we[wr]=hr,Ze[wr]=An-hr):(le[wr]=hr,Te[wr]=An-hr)}this.adjustOddEvenCounts(O,H);let pt=0,_t=0;for(let Kt=le.length-1;Kt>=0;Kt--)_t*=9,_t+=le[Kt],pt+=le[Kt];let Jt=0,Ct=0;for(let Kt=we.length-1;Kt>=0;Kt--)Jt*=9,Jt+=we[Kt],Ct+=we[Kt];let Ht=_t+3*Jt;if(O){if(pt&1||pt>12||pt<4)throw new Y;let Kt=(12-pt)/2,An=_.OUTSIDE_ODD_WIDEST[Kt],hr=9-An,wr=Dn.getRSSvalue(le,An,!1),Sr=Dn.getRSSvalue(we,hr,!0),Ss=_.OUTSIDE_EVEN_TOTAL_SUBSET[Kt],Qs=_.OUTSIDE_GSUM[Kt];return new Vn(wr*Ss+Sr+Qs,Ht)}else{if(Ct&1||Ct>10||Ct<4)throw new Y;let Kt=(10-Ct)/2,An=_.INSIDE_ODD_WIDEST[Kt],hr=9-An,wr=Dn.getRSSvalue(le,An,!0),Sr=Dn.getRSSvalue(we,hr,!1),Ss=_.INSIDE_ODD_TOTAL_SUBSET[Kt],Qs=_.INSIDE_GSUM[Kt];return new Vn(Sr*Ss+wr+Qs,Ht)}}findFinderPattern(y,E){let O=this.getDecodeFinderCounters();O[0]=0,O[1]=0,O[2]=0,O[3]=0;let $=y.getSize(),H=!1,K=0;for(;K<$&&(H=!y.get(K),E!==H);)K++;let le=0,we=K;for(let Te=K;Te<$;Te++)if(y.get(Te)!==H)O[le]++;else{if(le===3){if(yn.isFinderPattern(O))return[we,Te];we+=O[0]+O[1],O[0]=O[2],O[1]=O[3],O[2]=0,O[3]=0,le--}else le++;O[le]=1,H=!H}throw new Y}parseFoundFinderPattern(y,E,O,$){let H=y.get($[0]),K=$[0]-1;for(;K>=0&&H!==y.get(K);)K--;K++;const le=$[0]-K,we=this.getDecodeFinderCounters(),Te=new Int32Array(we.length);w.arraycopy(we,0,Te,1,we.length-1),Te[0]=le;const Ze=this.parseFinderValue(Te,_.FINDER_PATTERNS);let pt=K,_t=$[1];return O&&(pt=y.getSize()-1-pt,_t=y.getSize()-1-_t),new Gn(Ze,[K,$[1]],pt,_t,E)}adjustOddEvenCounts(y,E){let O=It.sum(new Int32Array(this.getOddCounts())),$=It.sum(new Int32Array(this.getEvenCounts())),H=!1,K=!1,le=!1,we=!1;y?(O>12?K=!0:O<4&&(H=!0),$>12?we=!0:$<4&&(le=!0)):(O>11?K=!0:O<5&&(H=!0),$>10?we=!0:$<4&&(le=!0));let Te=O+$-E,Ze=(O&1)===(y?1:0),pt=($&1)===1;if(Te===1)if(Ze){if(pt)throw new Y;K=!0}else{if(!pt)throw new Y;we=!0}else if(Te===-1)if(Ze){if(pt)throw new Y;H=!0}else{if(!pt)throw new Y;le=!0}else if(Te===0){if(Ze){if(!pt)throw new Y;O<$?(H=!0,we=!0):(K=!0,le=!0)}else if(pt)throw new Y}else throw new Y;if(H){if(K)throw new Y;yn.increment(this.getOddCounts(),this.getOddRoundingErrors())}if(K&&yn.decrement(this.getOddCounts(),this.getOddRoundingErrors()),le){if(we)throw new Y;yn.increment(this.getEvenCounts(),this.getOddRoundingErrors())}we&&yn.decrement(this.getEvenCounts(),this.getEvenRoundingErrors())}}_.OUTSIDE_EVEN_TOTAL_SUBSET=[1,10,34,70,126],_.INSIDE_ODD_TOTAL_SUBSET=[4,20,48,81],_.OUTSIDE_GSUM=[0,161,961,2015,2715],_.INSIDE_GSUM=[0,336,1036,1516],_.OUTSIDE_ODD_WIDEST=[8,6,4,3,1],_.INSIDE_ODD_WIDEST=[2,4,6,8],_.FINDER_PATTERNS=[Int32Array.from([3,8,2,1]),Int32Array.from([3,5,5,1]),Int32Array.from([3,3,7,1]),Int32Array.from([3,1,9,1]),Int32Array.from([2,7,4,1]),Int32Array.from([2,5,6,1]),Int32Array.from([2,3,8,1]),Int32Array.from([1,5,7,1]),Int32Array.from([1,3,9,1])];class k extends Et{constructor(y,E){super(),this.readers=[],this.verbose=E===!0;const O=y?y.get(U.POSSIBLE_FORMATS):null,$=y&&y.get(U.ASSUME_CODE_39_CHECK_DIGIT)!==void 0;O?((O.includes(ye.EAN_13)||O.includes(ye.UPC_A)||O.includes(ye.EAN_8)||O.includes(ye.UPC_E))&&this.readers.push(new kn(y)),O.includes(ye.CODE_39)&&this.readers.push(new Ue($)),O.includes(ye.CODE_128)&&this.readers.push(new nt),O.includes(ye.ITF)&&this.readers.push(new Rt),O.includes(ye.RSS_14)&&this.readers.push(new _),O.includes(ye.RSS_EXPANDED)&&this.readers.push(new p(this.verbose))):(this.readers.push(new kn(y)),this.readers.push(new Ue),this.readers.push(new kn(y)),this.readers.push(new nt),this.readers.push(new Rt),this.readers.push(new _),this.readers.push(new p(this.verbose)))}decodeRow(y,E,O){for(let $=0;$<this.readers.length;$++)try{return this.readers[$].decodeRow(y,E,O)}catch{}throw new Y}reset(){this.readers.forEach(y=>y.reset())}}class T extends Ne{constructor(y=500,E){super(new k(E),y,E)}}class B{constructor(y,E,O){this.ecCodewords=y,this.ecBlocks=[E],O&&this.ecBlocks.push(O)}getECCodewords(){return this.ecCodewords}getECBlocks(){return this.ecBlocks}}class q{constructor(y,E){this.count=y,this.dataCodewords=E}getCount(){return this.count}getDataCodewords(){return this.dataCodewords}}class te{constructor(y,E,O,$,H,K){this.versionNumber=y,this.symbolSizeRows=E,this.symbolSizeColumns=O,this.dataRegionSizeRows=$,this.dataRegionSizeColumns=H,this.ecBlocks=K;let le=0;const we=K.getECCodewords(),Te=K.getECBlocks();for(let Ze of Te)le+=Ze.getCount()*(Ze.getDataCodewords()+we);this.totalCodewords=le}getVersionNumber(){return this.versionNumber}getSymbolSizeRows(){return this.symbolSizeRows}getSymbolSizeColumns(){return this.symbolSizeColumns}getDataRegionSizeRows(){return this.dataRegionSizeRows}getDataRegionSizeColumns(){return this.dataRegionSizeColumns}getTotalCodewords(){return this.totalCodewords}getECBlocks(){return this.ecBlocks}static getVersionForDimensions(y,E){if(y&1||E&1)throw new L;for(let O of te.VERSIONS)if(O.symbolSizeRows===y&&O.symbolSizeColumns===E)return O;throw new L}toString(){return""+this.versionNumber}static buildVersions(){return[new te(1,10,10,8,8,new B(5,new q(1,3))),new te(2,12,12,10,10,new B(7,new q(1,5))),new te(3,14,14,12,12,new B(10,new q(1,8))),new te(4,16,16,14,14,new B(12,new q(1,12))),new te(5,18,18,16,16,new B(14,new q(1,18))),new te(6,20,20,18,18,new B(18,new q(1,22))),new te(7,22,22,20,20,new B(20,new q(1,30))),new te(8,24,24,22,22,new B(24,new q(1,36))),new te(9,26,26,24,24,new B(28,new q(1,44))),new te(10,32,32,14,14,new B(36,new q(1,62))),new te(11,36,36,16,16,new B(42,new q(1,86))),new te(12,40,40,18,18,new B(48,new q(1,114))),new te(13,44,44,20,20,new B(56,new q(1,144))),new te(14,48,48,22,22,new B(68,new q(1,174))),new te(15,52,52,24,24,new B(42,new q(2,102))),new te(16,64,64,14,14,new B(56,new q(2,140))),new te(17,72,72,16,16,new B(36,new q(4,92))),new te(18,80,80,18,18,new B(48,new q(4,114))),new te(19,88,88,20,20,new B(56,new q(4,144))),new te(20,96,96,22,22,new B(68,new q(4,174))),new te(21,104,104,24,24,new B(56,new q(6,136))),new te(22,120,120,18,18,new B(68,new q(6,175))),new te(23,132,132,20,20,new B(62,new q(8,163))),new te(24,144,144,22,22,new B(62,new q(8,156),new q(2,155))),new te(25,8,18,6,16,new B(7,new q(1,5))),new te(26,8,32,6,14,new B(11,new q(1,10))),new te(27,12,26,10,24,new B(14,new q(1,16))),new te(28,12,36,10,16,new B(18,new q(1,22))),new te(29,16,36,14,16,new B(24,new q(1,32))),new te(30,16,48,14,22,new B(28,new q(1,49)))]}}te.VERSIONS=te.buildVersions();class ue{constructor(y){const E=y.getHeight();if(E<8||E>144||E&1)throw new L;this.version=ue.readVersion(y),this.mappingBitMatrix=this.extractDataRegion(y),this.readMappingMatrix=new pe(this.mappingBitMatrix.getWidth(),this.mappingBitMatrix.getHeight())}getVersion(){return this.version}static readVersion(y){const E=y.getHeight(),O=y.getWidth();return te.getVersionForDimensions(E,O)}readCodewords(){const y=new Int8Array(this.version.getTotalCodewords());let E=0,O=4,$=0;const H=this.mappingBitMatrix.getHeight(),K=this.mappingBitMatrix.getWidth();let le=!1,we=!1,Te=!1,Ze=!1;do if(O===H&&$===0&&!le)y[E++]=this.readCorner1(H,K)&255,O-=2,$+=2,le=!0;else if(O===H-2&&$===0&&K&3&&!we)y[E++]=this.readCorner2(H,K)&255,O-=2,$+=2,we=!0;else if(O===H+4&&$===2&&!(K&7)&&!Te)y[E++]=this.readCorner3(H,K)&255,O-=2,$+=2,Te=!0;else if(O===H-2&&$===0&&(K&7)===4&&!Ze)y[E++]=this.readCorner4(H,K)&255,O-=2,$+=2,Ze=!0;else{do O<H&&$>=0&&!this.readMappingMatrix.get($,O)&&(y[E++]=this.readUtah(O,$,H,K)&255),O-=2,$+=2;while(O>=0&&$<K);O+=1,$+=3;do O>=0&&$<K&&!this.readMappingMatrix.get($,O)&&(y[E++]=this.readUtah(O,$,H,K)&255),O+=2,$-=2;while(O<H&&$>=0);O+=3,$+=1}while(O<H||$<K);if(E!==this.version.getTotalCodewords())throw new L;return y}readModule(y,E,O,$){return y<0&&(y+=O,E+=4-(O+4&7)),E<0&&(E+=$,y+=4-($+4&7)),this.readMappingMatrix.set(E,y),this.mappingBitMatrix.get(E,y)}readUtah(y,E,O,$){let H=0;return this.readModule(y-2,E-2,O,$)&&(H|=1),H<<=1,this.readModule(y-2,E-1,O,$)&&(H|=1),H<<=1,this.readModule(y-1,E-2,O,$)&&(H|=1),H<<=1,this.readModule(y-1,E-1,O,$)&&(H|=1),H<<=1,this.readModule(y-1,E,O,$)&&(H|=1),H<<=1,this.readModule(y,E-2,O,$)&&(H|=1),H<<=1,this.readModule(y,E-1,O,$)&&(H|=1),H<<=1,this.readModule(y,E,O,$)&&(H|=1),H}readCorner1(y,E){let O=0;return this.readModule(y-1,0,y,E)&&(O|=1),O<<=1,this.readModule(y-1,1,y,E)&&(O|=1),O<<=1,this.readModule(y-1,2,y,E)&&(O|=1),O<<=1,this.readModule(0,E-2,y,E)&&(O|=1),O<<=1,this.readModule(0,E-1,y,E)&&(O|=1),O<<=1,this.readModule(1,E-1,y,E)&&(O|=1),O<<=1,this.readModule(2,E-1,y,E)&&(O|=1),O<<=1,this.readModule(3,E-1,y,E)&&(O|=1),O}readCorner2(y,E){let O=0;return this.readModule(y-3,0,y,E)&&(O|=1),O<<=1,this.readModule(y-2,0,y,E)&&(O|=1),O<<=1,this.readModule(y-1,0,y,E)&&(O|=1),O<<=1,this.readModule(0,E-4,y,E)&&(O|=1),O<<=1,this.readModule(0,E-3,y,E)&&(O|=1),O<<=1,this.readModule(0,E-2,y,E)&&(O|=1),O<<=1,this.readModule(0,E-1,y,E)&&(O|=1),O<<=1,this.readModule(1,E-1,y,E)&&(O|=1),O}readCorner3(y,E){let O=0;return this.readModule(y-1,0,y,E)&&(O|=1),O<<=1,this.readModule(y-1,E-1,y,E)&&(O|=1),O<<=1,this.readModule(0,E-3,y,E)&&(O|=1),O<<=1,this.readModule(0,E-2,y,E)&&(O|=1),O<<=1,this.readModule(0,E-1,y,E)&&(O|=1),O<<=1,this.readModule(1,E-3,y,E)&&(O|=1),O<<=1,this.readModule(1,E-2,y,E)&&(O|=1),O<<=1,this.readModule(1,E-1,y,E)&&(O|=1),O}readCorner4(y,E){let O=0;return this.readModule(y-3,0,y,E)&&(O|=1),O<<=1,this.readModule(y-2,0,y,E)&&(O|=1),O<<=1,this.readModule(y-1,0,y,E)&&(O|=1),O<<=1,this.readModule(0,E-2,y,E)&&(O|=1),O<<=1,this.readModule(0,E-1,y,E)&&(O|=1),O<<=1,this.readModule(1,E-1,y,E)&&(O|=1),O<<=1,this.readModule(2,E-1,y,E)&&(O|=1),O<<=1,this.readModule(3,E-1,y,E)&&(O|=1),O}extractDataRegion(y){const E=this.version.getSymbolSizeRows(),O=this.version.getSymbolSizeColumns();if(y.getHeight()!==E)throw new f("Dimension of bitMatrix must match the version size");const $=this.version.getDataRegionSizeRows(),H=this.version.getDataRegionSizeColumns(),K=E/$|0,le=O/H|0,we=K*$,Te=le*H,Ze=new pe(Te,we);for(let pt=0;pt<K;++pt){const _t=pt*$;for(let Jt=0;Jt<le;++Jt){const Ct=Jt*H;for(let Ht=0;Ht<$;++Ht){const Kt=pt*($+2)+1+Ht,An=_t+Ht;for(let hr=0;hr<H;++hr){const wr=Jt*(H+2)+1+hr;if(y.get(wr,Kt)){const Sr=Ct+hr;Ze.set(Sr,An)}}}}}return Ze}}class de{constructor(y,E){this.numDataCodewords=y,this.codewords=E}static getDataBlocks(y,E){const O=E.getECBlocks();let $=0;const H=O.getECBlocks();for(let Ht of H)$+=Ht.getCount();const K=new Array($);let le=0;for(let Ht of H)for(let Kt=0;Kt<Ht.getCount();Kt++){const An=Ht.getDataCodewords(),hr=O.getECCodewords()+An;K[le++]=new de(An,new Uint8Array(hr))}const Te=K[0].codewords.length-O.getECCodewords(),Ze=Te-1;let pt=0;for(let Ht=0;Ht<Ze;Ht++)for(let Kt=0;Kt<le;Kt++)K[Kt].codewords[Ht]=y[pt++];const _t=E.getVersionNumber()===24,Jt=_t?8:le;for(let Ht=0;Ht<Jt;Ht++)K[Ht].codewords[Te-1]=y[pt++];const Ct=K[0].codewords.length;for(let Ht=Te;Ht<Ct;Ht++)for(let Kt=0;Kt<le;Kt++){const An=_t?(Kt+8)%le:Kt,hr=_t&&An>7?Ht-1:Ht;K[An].codewords[hr]=y[pt++]}if(pt!==y.length)throw new f;return K}getNumDataCodewords(){return this.numDataCodewords}getCodewords(){return this.codewords}}class xe{constructor(y){this.bytes=y,this.byteOffset=0,this.bitOffset=0}getBitOffset(){return this.bitOffset}getByteOffset(){return this.byteOffset}readBits(y){if(y<1||y>32||y>this.available())throw new f(""+y);let E=0,O=this.bitOffset,$=this.byteOffset;const H=this.bytes;if(O>0){const K=8-O,le=y<K?y:K,we=K-le,Te=255>>8-le<<we;E=(H[$]&Te)>>we,y-=le,O+=le,O===8&&(O=0,$++)}if(y>0){for(;y>=8;)E=E<<8|H[$]&255,$++,y-=8;if(y>0){const K=8-y,le=255>>K<<K;E=E<<y|(H[$]&le)>>K,O+=y}}return this.bitOffset=O,this.byteOffset=$,E}available(){return 8*(this.bytes.length-this.byteOffset)-this.bitOffset}}var Se;(function(dt){dt[dt.PAD_ENCODE=0]="PAD_ENCODE",dt[dt.ASCII_ENCODE=1]="ASCII_ENCODE",dt[dt.C40_ENCODE=2]="C40_ENCODE",dt[dt.TEXT_ENCODE=3]="TEXT_ENCODE",dt[dt.ANSIX12_ENCODE=4]="ANSIX12_ENCODE",dt[dt.EDIFACT_ENCODE=5]="EDIFACT_ENCODE",dt[dt.BASE256_ENCODE=6]="BASE256_ENCODE"})(Se||(Se={}));class ke{static decode(y){const E=new xe(y),O=new re,$=new re,H=new Array;let K=Se.ASCII_ENCODE;do if(K===Se.ASCII_ENCODE)K=this.decodeAsciiSegment(E,O,$);else{switch(K){case Se.C40_ENCODE:this.decodeC40Segment(E,O);break;case Se.TEXT_ENCODE:this.decodeTextSegment(E,O);break;case Se.ANSIX12_ENCODE:this.decodeAnsiX12Segment(E,O);break;case Se.EDIFACT_ENCODE:this.decodeEdifactSegment(E,O);break;case Se.BASE256_ENCODE:this.decodeBase256Segment(E,O,H);break;default:throw new L}K=Se.ASCII_ENCODE}while(K!==Se.PAD_ENCODE&&E.available()>0);return $.length()>0&&O.append($.toString()),new Ie(y,O.toString(),H.length===0?null:H,null)}static decodeAsciiSegment(y,E,O){let $=!1;do{let H=y.readBits(8);if(H===0)throw new L;if(H<=128)return $&&(H+=128),E.append(String.fromCharCode(H-1)),Se.ASCII_ENCODE;if(H===129)return Se.PAD_ENCODE;if(H<=229){const K=H-130;K<10&&E.append("0"),E.append(""+K)}else switch(H){case 230:return Se.C40_ENCODE;case 231:return Se.BASE256_ENCODE;case 232:E.append("");break;case 233:case 234:break;case 235:$=!0;break;case 236:E.append("[)>05"),O.insert(0,"");break;case 237:E.append("[)>06"),O.insert(0,"");break;case 238:return Se.ANSIX12_ENCODE;case 239:return Se.TEXT_ENCODE;case 240:return Se.EDIFACT_ENCODE;case 241:break;default:if(H!==254||y.available()!==0)throw new L;break}}while(y.available()>0);return Se.ASCII_ENCODE}static decodeC40Segment(y,E){let O=!1;const $=[];let H=0;do{if(y.available()===8)return;const K=y.readBits(8);if(K===254)return;this.parseTwoBytes(K,y.readBits(8),$);for(let le=0;le<3;le++){const we=$[le];switch(H){case 0:if(we<3)H=we+1;else if(we<this.C40_BASIC_SET_CHARS.length){const Te=this.C40_BASIC_SET_CHARS[we];O?(E.append(String.fromCharCode(Te.charCodeAt(0)+128)),O=!1):E.append(Te)}else throw new L;break;case 1:O?(E.append(String.fromCharCode(we+128)),O=!1):E.append(String.fromCharCode(we)),H=0;break;case 2:if(we<this.C40_SHIFT2_SET_CHARS.length){const Te=this.C40_SHIFT2_SET_CHARS[we];O?(E.append(String.fromCharCode(Te.charCodeAt(0)+128)),O=!1):E.append(Te)}else switch(we){case 27:E.append("");break;case 30:O=!0;break;default:throw new L}H=0;break;case 3:O?(E.append(String.fromCharCode(we+224)),O=!1):E.append(String.fromCharCode(we+96)),H=0;break;default:throw new L}}}while(y.available()>0)}static decodeTextSegment(y,E){let O=!1,$=[],H=0;do{if(y.available()===8)return;const K=y.readBits(8);if(K===254)return;this.parseTwoBytes(K,y.readBits(8),$);for(let le=0;le<3;le++){const we=$[le];switch(H){case 0:if(we<3)H=we+1;else if(we<this.TEXT_BASIC_SET_CHARS.length){const Te=this.TEXT_BASIC_SET_CHARS[we];O?(E.append(String.fromCharCode(Te.charCodeAt(0)+128)),O=!1):E.append(Te)}else throw new L;break;case 1:O?(E.append(String.fromCharCode(we+128)),O=!1):E.append(String.fromCharCode(we)),H=0;break;case 2:if(we<this.TEXT_SHIFT2_SET_CHARS.length){const Te=this.TEXT_SHIFT2_SET_CHARS[we];O?(E.append(String.fromCharCode(Te.charCodeAt(0)+128)),O=!1):E.append(Te)}else switch(we){case 27:E.append("");break;case 30:O=!0;break;default:throw new L}H=0;break;case 3:if(we<this.TEXT_SHIFT3_SET_CHARS.length){const Te=this.TEXT_SHIFT3_SET_CHARS[we];O?(E.append(String.fromCharCode(Te.charCodeAt(0)+128)),O=!1):E.append(Te),H=0}else throw new L;break;default:throw new L}}}while(y.available()>0)}static decodeAnsiX12Segment(y,E){const O=[];do{if(y.available()===8)return;const $=y.readBits(8);if($===254)return;this.parseTwoBytes($,y.readBits(8),O);for(let H=0;H<3;H++){const K=O[H];switch(K){case 0:E.append("\r");break;case 1:E.append("*");break;case 2:E.append(">");break;case 3:E.append(" ");break;default:if(K<14)E.append(String.fromCharCode(K+44));else if(K<40)E.append(String.fromCharCode(K+51));else throw new L;break}}}while(y.available()>0)}static parseTwoBytes(y,E,O){let $=(y<<8)+E-1,H=Math.floor($/1600);O[0]=H,$-=H*1600,H=Math.floor($/40),O[1]=H,O[2]=$-H*40}static decodeEdifactSegment(y,E){do{if(y.available()<=16)return;for(let O=0;O<4;O++){let $=y.readBits(6);if($===31){const H=8-y.getBitOffset();H!==8&&y.readBits(H);return}$&32||($|=64),E.append(String.fromCharCode($))}}while(y.available()>0)}static decodeBase256Segment(y,E,O){let $=1+y.getByteOffset();const H=this.unrandomize255State(y.readBits(8),$++);let K;if(H===0?K=y.available()/8|0:H<250?K=H:K=250*(H-249)+this.unrandomize255State(y.readBits(8),$++),K<0)throw new L;const le=new Uint8Array(K);for(let we=0;we<K;we++){if(y.available()<8)throw new L;le[we]=this.unrandomize255State(y.readBits(8),$++)}O.push(le);try{E.append(J.decode(le,X.ISO88591))}catch(we){throw new lt("Platform does not support required encoding: "+we.message)}}static unrandomize255State(y,E){const O=149*E%255+1,$=y-O;return $>=0?$:$+256}}ke.C40_BASIC_SET_CHARS=["*","*","*"," ","0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],ke.C40_SHIFT2_SET_CHARS=["!",'"',"#","$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","?","@","[","\\","]","^","_"],ke.TEXT_BASIC_SET_CHARS=["*","*","*"," ","0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"],ke.TEXT_SHIFT2_SET_CHARS=ke.C40_SHIFT2_SET_CHARS,ke.TEXT_SHIFT3_SET_CHARS=["`","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","{","|","}","~",""];class Re{constructor(){this.rsDecoder=new ft(it.DATA_MATRIX_FIELD_256)}decode(y){const E=new ue(y),O=E.getVersion(),$=E.readCodewords(),H=de.getDataBlocks($,O);let K=0;for(let Te of H)K+=Te.getNumDataCodewords();const le=new Uint8Array(K),we=H.length;for(let Te=0;Te<we;Te++){const Ze=H[Te],pt=Ze.getCodewords(),_t=Ze.getNumDataCodewords();this.correctErrors(pt,_t);for(let Jt=0;Jt<_t;Jt++)le[Jt*we+Te]=pt[Jt]}return ke.decode(le)}correctErrors(y,E){const O=new Int32Array(y);try{this.rsDecoder.decode(O,y.length-E)}catch{throw new g}for(let $=0;$<E;$++)y[$]=O[$]}}class Ge{constructor(y){this.image=y,this.rectangleDetector=new Ft(this.image)}detect(){const y=this.rectangleDetector.detect();let E=this.detectSolid1(y);if(E=this.detectSolid2(E),E[3]=this.correctTopRight(E),!E[3])throw new Y;E=this.shiftToModuleCenter(E);const O=E[0],$=E[1],H=E[2],K=E[3];let le=this.transitionsBetween(O,K)+1,we=this.transitionsBetween(H,K)+1;(le&1)===1&&(le+=1),(we&1)===1&&(we+=1),4*le<7*we&&4*we<7*le&&(le=we=Math.max(le,we));let Te=Ge.sampleGrid(this.image,O,$,H,K,le,we);return new cn(Te,[O,$,H,K])}static shiftPoint(y,E,O){let $=(E.getX()-y.getX())/(O+1),H=(E.getY()-y.getY())/(O+1);return new jt(y.getX()+$,y.getY()+H)}static moveAway(y,E,O){let $=y.getX(),H=y.getY();return $<E?$-=1:$+=1,H<O?H-=1:H+=1,new jt($,H)}detectSolid1(y){let E=y[0],O=y[1],$=y[3],H=y[2],K=this.transitionsBetween(E,O),le=this.transitionsBetween(O,$),we=this.transitionsBetween($,H),Te=this.transitionsBetween(H,E),Ze=K,pt=[H,E,O,$];return Ze>le&&(Ze=le,pt[0]=E,pt[1]=O,pt[2]=$,pt[3]=H),Ze>we&&(Ze=we,pt[0]=O,pt[1]=$,pt[2]=H,pt[3]=E),Ze>Te&&(pt[0]=$,pt[1]=H,pt[2]=E,pt[3]=O),pt}detectSolid2(y){let E=y[0],O=y[1],$=y[2],H=y[3],K=this.transitionsBetween(E,H),le=Ge.shiftPoint(O,$,(K+1)*4),we=Ge.shiftPoint($,O,(K+1)*4),Te=this.transitionsBetween(le,E),Ze=this.transitionsBetween(we,H);return Te<Ze?(y[0]=E,y[1]=O,y[2]=$,y[3]=H):(y[0]=O,y[1]=$,y[2]=H,y[3]=E),y}correctTopRight(y){let E=y[0],O=y[1],$=y[2],H=y[3],K=this.transitionsBetween(E,H),le=this.transitionsBetween(O,H),we=Ge.shiftPoint(E,O,(le+1)*4),Te=Ge.shiftPoint($,O,(K+1)*4);K=this.transitionsBetween(we,H),le=this.transitionsBetween(Te,H);let Ze=new jt(H.getX()+($.getX()-O.getX())/(K+1),H.getY()+($.getY()-O.getY())/(K+1)),pt=new jt(H.getX()+(E.getX()-O.getX())/(le+1),H.getY()+(E.getY()-O.getY())/(le+1));if(!this.isValid(Ze))return this.isValid(pt)?pt:null;if(!this.isValid(pt))return Ze;let _t=this.transitionsBetween(we,Ze)+this.transitionsBetween(Te,Ze),Jt=this.transitionsBetween(we,pt)+this.transitionsBetween(Te,pt);return _t>Jt?Ze:pt}shiftToModuleCenter(y){let E=y[0],O=y[1],$=y[2],H=y[3],K=this.transitionsBetween(E,H)+1,le=this.transitionsBetween($,H)+1,we=Ge.shiftPoint(E,O,le*4),Te=Ge.shiftPoint($,O,K*4);K=this.transitionsBetween(we,H)+1,le=this.transitionsBetween(Te,H)+1,(K&1)===1&&(K+=1),(le&1)===1&&(le+=1);let Ze=(E.getX()+O.getX()+$.getX()+H.getX())/4,pt=(E.getY()+O.getY()+$.getY()+H.getY())/4;E=Ge.moveAway(E,Ze,pt),O=Ge.moveAway(O,Ze,pt),$=Ge.moveAway($,Ze,pt),H=Ge.moveAway(H,Ze,pt);let _t,Jt;return we=Ge.shiftPoint(E,O,le*4),we=Ge.shiftPoint(we,H,K*4),_t=Ge.shiftPoint(O,E,le*4),_t=Ge.shiftPoint(_t,$,K*4),Te=Ge.shiftPoint($,H,le*4),Te=Ge.shiftPoint(Te,O,K*4),Jt=Ge.shiftPoint(H,$,le*4),Jt=Ge.shiftPoint(Jt,E,K*4),[we,_t,Te,Jt]}isValid(y){return y.getX()>=0&&y.getX()<this.image.getWidth()&&y.getY()>0&&y.getY()<this.image.getHeight()}static sampleGrid(y,E,O,$,H,K,le){return qe.getInstance().sampleGrid(y,K,le,.5,.5,K-.5,.5,K-.5,le-.5,.5,le-.5,E.getX(),E.getY(),H.getX(),H.getY(),$.getX(),$.getY(),O.getX(),O.getY())}transitionsBetween(y,E){let O=Math.trunc(y.getX()),$=Math.trunc(y.getY()),H=Math.trunc(E.getX()),K=Math.trunc(E.getY()),le=Math.abs(K-$)>Math.abs(H-O);if(le){let Ht=O;O=$,$=Ht,Ht=H,H=K,K=Ht}let we=Math.abs(H-O),Te=Math.abs(K-$),Ze=-we/2,pt=$<K?1:-1,_t=O<H?1:-1,Jt=0,Ct=this.image.get(le?$:O,le?O:$);for(let Ht=O,Kt=$;Ht!==H;Ht+=_t){let An=this.image.get(le?Kt:Ht,le?Ht:Kt);if(An!==Ct&&(Jt++,Ct=An),Ze+=Te,Ze>0){if(Kt===K)break;Kt+=pt,Ze-=we}}return Jt}}class Fe{constructor(){this.decoder=new Re}decode(y,E=null){let O,$;if(E!=null&&E.has(U.PURE_BARCODE)){const Te=Fe.extractPureBits(y.getBlackMatrix());O=this.decoder.decode(Te),$=Fe.NO_POINTS}else{const Te=new Ge(y.getBlackMatrix()).detect();O=this.decoder.decode(Te.getBits()),$=Te.getPoints()}const H=O.getRawBytes(),K=new he(O.getText(),H,8*H.length,$,ye.DATA_MATRIX,w.currentTimeMillis()),le=O.getByteSegments();le!=null&&K.putMetadata(je.BYTE_SEGMENTS,le);const we=O.getECLevel();return we!=null&&K.putMetadata(je.ERROR_CORRECTION_LEVEL,we),K}reset(){}static extractPureBits(y){const E=y.getTopLeftOnBit(),O=y.getBottomRightOnBit();if(E==null||O==null)throw new Y;const $=this.moduleSize(E,y);let H=E[1];const K=O[1];let le=E[0];const Te=(O[0]-le+1)/$,Ze=(K-H+1)/$;if(Te<=0||Ze<=0)throw new Y;const pt=$/2;H+=pt,le+=pt;const _t=new pe(Te,Ze);for(let Jt=0;Jt<Ze;Jt++){const Ct=H+Jt*$;for(let Ht=0;Ht<Te;Ht++)y.get(le+Ht*$,Ct)&&_t.set(Ht,Jt)}return _t}static moduleSize(y,E){const O=E.getWidth();let $=y[0];const H=y[1];for(;$<O&&E.get($,H);)$++;if($===O)throw new Y;const K=$-y[0];if(K===0)throw new Y;return K}}Fe.NO_POINTS=[];class st extends Ne{constructor(y=500){super(new Fe,y)}}var se;(function(dt){dt[dt.L=0]="L",dt[dt.M=1]="M",dt[dt.Q=2]="Q",dt[dt.H=3]="H"})(se||(se={}));class Ce{constructor(y,E,O){this.value=y,this.stringValue=E,this.bits=O,Ce.FOR_BITS.set(O,this),Ce.FOR_VALUE.set(y,this)}getValue(){return this.value}getBits(){return this.bits}static fromString(y){switch(y){case"L":return Ce.L;case"M":return Ce.M;case"Q":return Ce.Q;case"H":return Ce.H;default:throw new d(y+"not available")}}toString(){return this.stringValue}equals(y){if(!(y instanceof Ce))return!1;const E=y;return this.value===E.value}static forBits(y){if(y<0||y>=Ce.FOR_BITS.size)throw new f;return Ce.FOR_BITS.get(y)}}Ce.FOR_BITS=new Map,Ce.FOR_VALUE=new Map,Ce.L=new Ce(se.L,"L",1),Ce.M=new Ce(se.M,"M",0),Ce.Q=new Ce(se.Q,"Q",3),Ce.H=new Ce(se.H,"H",2);class Be{constructor(y){this.errorCorrectionLevel=Ce.forBits(y>>3&3),this.dataMask=y&7}static numBitsDiffering(y,E){return I.bitCount(y^E)}static decodeFormatInformation(y,E){const O=Be.doDecodeFormatInformation(y,E);return O!==null?O:Be.doDecodeFormatInformation(y^Be.FORMAT_INFO_MASK_QR,E^Be.FORMAT_INFO_MASK_QR)}static doDecodeFormatInformation(y,E){let O=Number.MAX_SAFE_INTEGER,$=0;for(const H of Be.FORMAT_INFO_DECODE_LOOKUP){const K=H[0];if(K===y||K===E)return new Be(H[1]);let le=Be.numBitsDiffering(y,K);le<O&&($=H[1],O=le),y!==E&&(le=Be.numBitsDiffering(E,K),le<O&&($=H[1],O=le))}return O<=3?new Be($):null}getErrorCorrectionLevel(){return this.errorCorrectionLevel}getDataMask(){return this.dataMask}hashCode(){return this.errorCorrectionLevel.getBits()<<3|this.dataMask}equals(y){if(!(y instanceof Be))return!1;const E=y;return this.errorCorrectionLevel===E.errorCorrectionLevel&&this.dataMask===E.dataMask}}Be.FORMAT_INFO_MASK_QR=21522,Be.FORMAT_INFO_DECODE_LOOKUP=[Int32Array.from([21522,0]),Int32Array.from([20773,1]),Int32Array.from([24188,2]),Int32Array.from([23371,3]),Int32Array.from([17913,4]),Int32Array.from([16590,5]),Int32Array.from([20375,6]),Int32Array.from([19104,7]),Int32Array.from([30660,8]),Int32Array.from([29427,9]),Int32Array.from([32170,10]),Int32Array.from([30877,11]),Int32Array.from([26159,12]),Int32Array.from([25368,13]),Int32Array.from([27713,14]),Int32Array.from([26998,15]),Int32Array.from([5769,16]),Int32Array.from([5054,17]),Int32Array.from([7399,18]),Int32Array.from([6608,19]),Int32Array.from([1890,20]),Int32Array.from([597,21]),Int32Array.from([3340,22]),Int32Array.from([2107,23]),Int32Array.from([13663,24]),Int32Array.from([12392,25]),Int32Array.from([16177,26]),Int32Array.from([14854,27]),Int32Array.from([9396,28]),Int32Array.from([8579,29]),Int32Array.from([11994,30]),Int32Array.from([11245,31])];class De{constructor(y,...E){this.ecCodewordsPerBlock=y,this.ecBlocks=E}getECCodewordsPerBlock(){return this.ecCodewordsPerBlock}getNumBlocks(){let y=0;const E=this.ecBlocks;for(const O of E)y+=O.getCount();return y}getTotalECCodewords(){return this.ecCodewordsPerBlock*this.getNumBlocks()}getECBlocks(){return this.ecBlocks}}class _e{constructor(y,E){this.count=y,this.dataCodewords=E}getCount(){return this.count}getDataCodewords(){return this.dataCodewords}}class Je{constructor(y,E,...O){this.versionNumber=y,this.alignmentPatternCenters=E,this.ecBlocks=O;let $=0;const H=O[0].getECCodewordsPerBlock(),K=O[0].getECBlocks();for(const le of K)$+=le.getCount()*(le.getDataCodewords()+H);this.totalCodewords=$}getVersionNumber(){return this.versionNumber}getAlignmentPatternCenters(){return this.alignmentPatternCenters}getTotalCodewords(){return this.totalCodewords}getDimensionForVersion(){return 17+4*this.versionNumber}getECBlocksForLevel(y){return this.ecBlocks[y.getValue()]}static getProvisionalVersionForDimension(y){if(y%4!==1)throw new L;try{return this.getVersionForNumber((y-17)/4)}catch{throw new L}}static getVersionForNumber(y){if(y<1||y>40)throw new f;return Je.VERSIONS[y-1]}static decodeVersionInformation(y){let E=Number.MAX_SAFE_INTEGER,O=0;for(let $=0;$<Je.VERSION_DECODE_INFO.length;$++){const H=Je.VERSION_DECODE_INFO[$];if(H===y)return Je.getVersionForNumber($+7);const K=Be.numBitsDiffering(y,H);K<E&&(O=$+7,E=K)}return E<=3?Je.getVersionForNumber(O):null}buildFunctionPattern(){const y=this.getDimensionForVersion(),E=new pe(y);E.setRegion(0,0,9,9),E.setRegion(y-8,0,8,9),E.setRegion(0,y-8,9,8);const O=this.alignmentPatternCenters.length;for(let $=0;$<O;$++){const H=this.alignmentPatternCenters[$]-2;for(let K=0;K<O;K++)$===0&&(K===0||K===O-1)||$===O-1&&K===0||E.setRegion(this.alignmentPatternCenters[K]-2,H,5,5)}return E.setRegion(6,9,1,y-17),E.setRegion(9,6,y-17,1),this.versionNumber>6&&(E.setRegion(y-11,0,3,6),E.setRegion(0,y-11,6,3)),E}toString(){return""+this.versionNumber}}Je.VERSION_DECODE_INFO=Int32Array.from([31892,34236,39577,42195,48118,51042,55367,58893,63784,68472,70749,76311,79154,84390,87683,92361,96236,102084,102881,110507,110734,117786,119615,126325,127568,133589,136944,141498,145311,150283,152622,158308,161089,167017]),Je.VERSIONS=[new Je(1,new Int32Array(0),new De(7,new _e(1,19)),new De(10,new _e(1,16)),new De(13,new _e(1,13)),new De(17,new _e(1,9))),new Je(2,Int32Array.from([6,18]),new De(10,new _e(1,34)),new De(16,new _e(1,28)),new De(22,new _e(1,22)),new De(28,new _e(1,16))),new Je(3,Int32Array.from([6,22]),new De(15,new _e(1,55)),new De(26,new _e(1,44)),new De(18,new _e(2,17)),new De(22,new _e(2,13))),new Je(4,Int32Array.from([6,26]),new De(20,new _e(1,80)),new De(18,new _e(2,32)),new De(26,new _e(2,24)),new De(16,new _e(4,9))),new Je(5,Int32Array.from([6,30]),new De(26,new _e(1,108)),new De(24,new _e(2,43)),new De(18,new _e(2,15),new _e(2,16)),new De(22,new _e(2,11),new _e(2,12))),new Je(6,Int32Array.from([6,34]),new De(18,new _e(2,68)),new De(16,new _e(4,27)),new De(24,new _e(4,19)),new De(28,new _e(4,15))),new Je(7,Int32Array.from([6,22,38]),new De(20,new _e(2,78)),new De(18,new _e(4,31)),new De(18,new _e(2,14),new _e(4,15)),new De(26,new _e(4,13),new _e(1,14))),new Je(8,Int32Array.from([6,24,42]),new De(24,new _e(2,97)),new De(22,new _e(2,38),new _e(2,39)),new De(22,new _e(4,18),new _e(2,19)),new De(26,new _e(4,14),new _e(2,15))),new Je(9,Int32Array.from([6,26,46]),new De(30,new _e(2,116)),new De(22,new _e(3,36),new _e(2,37)),new De(20,new _e(4,16),new _e(4,17)),new De(24,new _e(4,12),new _e(4,13))),new Je(10,Int32Array.from([6,28,50]),new De(18,new _e(2,68),new _e(2,69)),new De(26,new _e(4,43),new _e(1,44)),new De(24,new _e(6,19),new _e(2,20)),new De(28,new _e(6,15),new _e(2,16))),new Je(11,Int32Array.from([6,30,54]),new De(20,new _e(4,81)),new De(30,new _e(1,50),new _e(4,51)),new De(28,new _e(4,22),new _e(4,23)),new De(24,new _e(3,12),new _e(8,13))),new Je(12,Int32Array.from([6,32,58]),new De(24,new _e(2,92),new _e(2,93)),new De(22,new _e(6,36),new _e(2,37)),new De(26,new _e(4,20),new _e(6,21)),new De(28,new _e(7,14),new _e(4,15))),new Je(13,Int32Array.from([6,34,62]),new De(26,new _e(4,107)),new De(22,new _e(8,37),new _e(1,38)),new De(24,new _e(8,20),new _e(4,21)),new De(22,new _e(12,11),new _e(4,12))),new Je(14,Int32Array.from([6,26,46,66]),new De(30,new _e(3,115),new _e(1,116)),new De(24,new _e(4,40),new _e(5,41)),new De(20,new _e(11,16),new _e(5,17)),new De(24,new _e(11,12),new _e(5,13))),new Je(15,Int32Array.from([6,26,48,70]),new De(22,new _e(5,87),new _e(1,88)),new De(24,new _e(5,41),new _e(5,42)),new De(30,new _e(5,24),new _e(7,25)),new De(24,new _e(11,12),new _e(7,13))),new Je(16,Int32Array.from([6,26,50,74]),new De(24,new _e(5,98),new _e(1,99)),new De(28,new _e(7,45),new _e(3,46)),new De(24,new _e(15,19),new _e(2,20)),new De(30,new _e(3,15),new _e(13,16))),new Je(17,Int32Array.from([6,30,54,78]),new De(28,new _e(1,107),new _e(5,108)),new De(28,new _e(10,46),new _e(1,47)),new De(28,new _e(1,22),new _e(15,23)),new De(28,new _e(2,14),new _e(17,15))),new Je(18,Int32Array.from([6,30,56,82]),new De(30,new _e(5,120),new _e(1,121)),new De(26,new _e(9,43),new _e(4,44)),new De(28,new _e(17,22),new _e(1,23)),new De(28,new _e(2,14),new _e(19,15))),new Je(19,Int32Array.from([6,30,58,86]),new De(28,new _e(3,113),new _e(4,114)),new De(26,new _e(3,44),new _e(11,45)),new De(26,new _e(17,21),new _e(4,22)),new De(26,new _e(9,13),new _e(16,14))),new Je(20,Int32Array.from([6,34,62,90]),new De(28,new _e(3,107),new _e(5,108)),new De(26,new _e(3,41),new _e(13,42)),new De(30,new _e(15,24),new _e(5,25)),new De(28,new _e(15,15),new _e(10,16))),new Je(21,Int32Array.from([6,28,50,72,94]),new De(28,new _e(4,116),new _e(4,117)),new De(26,new _e(17,42)),new De(28,new _e(17,22),new _e(6,23)),new De(30,new _e(19,16),new _e(6,17))),new Je(22,Int32Array.from([6,26,50,74,98]),new De(28,new _e(2,111),new _e(7,112)),new De(28,new _e(17,46)),new De(30,new _e(7,24),new _e(16,25)),new De(24,new _e(34,13))),new Je(23,Int32Array.from([6,30,54,78,102]),new De(30,new _e(4,121),new _e(5,122)),new De(28,new _e(4,47),new _e(14,48)),new De(30,new _e(11,24),new _e(14,25)),new De(30,new _e(16,15),new _e(14,16))),new Je(24,Int32Array.from([6,28,54,80,106]),new De(30,new _e(6,117),new _e(4,118)),new De(28,new _e(6,45),new _e(14,46)),new De(30,new _e(11,24),new _e(16,25)),new De(30,new _e(30,16),new _e(2,17))),new Je(25,Int32Array.from([6,32,58,84,110]),new De(26,new _e(8,106),new _e(4,107)),new De(28,new _e(8,47),new _e(13,48)),new De(30,new _e(7,24),new _e(22,25)),new De(30,new _e(22,15),new _e(13,16))),new Je(26,Int32Array.from([6,30,58,86,114]),new De(28,new _e(10,114),new _e(2,115)),new De(28,new _e(19,46),new _e(4,47)),new De(28,new _e(28,22),new _e(6,23)),new De(30,new _e(33,16),new _e(4,17))),new Je(27,Int32Array.from([6,34,62,90,118]),new De(30,new _e(8,122),new _e(4,123)),new De(28,new _e(22,45),new _e(3,46)),new De(30,new _e(8,23),new _e(26,24)),new De(30,new _e(12,15),new _e(28,16))),new Je(28,Int32Array.from([6,26,50,74,98,122]),new De(30,new _e(3,117),new _e(10,118)),new De(28,new _e(3,45),new _e(23,46)),new De(30,new _e(4,24),new _e(31,25)),new De(30,new _e(11,15),new _e(31,16))),new Je(29,Int32Array.from([6,30,54,78,102,126]),new De(30,new _e(7,116),new _e(7,117)),new De(28,new _e(21,45),new _e(7,46)),new De(30,new _e(1,23),new _e(37,24)),new De(30,new _e(19,15),new _e(26,16))),new Je(30,Int32Array.from([6,26,52,78,104,130]),new De(30,new _e(5,115),new _e(10,116)),new De(28,new _e(19,47),new _e(10,48)),new De(30,new _e(15,24),new _e(25,25)),new De(30,new _e(23,15),new _e(25,16))),new Je(31,Int32Array.from([6,30,56,82,108,134]),new De(30,new _e(13,115),new _e(3,116)),new De(28,new _e(2,46),new _e(29,47)),new De(30,new _e(42,24),new _e(1,25)),new De(30,new _e(23,15),new _e(28,16))),new Je(32,Int32Array.from([6,34,60,86,112,138]),new De(30,new _e(17,115)),new De(28,new _e(10,46),new _e(23,47)),new De(30,new _e(10,24),new _e(35,25)),new De(30,new _e(19,15),new _e(35,16))),new Je(33,Int32Array.from([6,30,58,86,114,142]),new De(30,new _e(17,115),new _e(1,116)),new De(28,new _e(14,46),new _e(21,47)),new De(30,new _e(29,24),new _e(19,25)),new De(30,new _e(11,15),new _e(46,16))),new Je(34,Int32Array.from([6,34,62,90,118,146]),new De(30,new _e(13,115),new _e(6,116)),new De(28,new _e(14,46),new _e(23,47)),new De(30,new _e(44,24),new _e(7,25)),new De(30,new _e(59,16),new _e(1,17))),new Je(35,Int32Array.from([6,30,54,78,102,126,150]),new De(30,new _e(12,121),new _e(7,122)),new De(28,new _e(12,47),new _e(26,48)),new De(30,new _e(39,24),new _e(14,25)),new De(30,new _e(22,15),new _e(41,16))),new Je(36,Int32Array.from([6,24,50,76,102,128,154]),new De(30,new _e(6,121),new _e(14,122)),new De(28,new _e(6,47),new _e(34,48)),new De(30,new _e(46,24),new _e(10,25)),new De(30,new _e(2,15),new _e(64,16))),new Je(37,Int32Array.from([6,28,54,80,106,132,158]),new De(30,new _e(17,122),new _e(4,123)),new De(28,new _e(29,46),new _e(14,47)),new De(30,new _e(49,24),new _e(10,25)),new De(30,new _e(24,15),new _e(46,16))),new Je(38,Int32Array.from([6,32,58,84,110,136,162]),new De(30,new _e(4,122),new _e(18,123)),new De(28,new _e(13,46),new _e(32,47)),new De(30,new _e(48,24),new _e(14,25)),new De(30,new _e(42,15),new _e(32,16))),new Je(39,Int32Array.from([6,26,54,82,110,138,166]),new De(30,new _e(20,117),new _e(4,118)),new De(28,new _e(40,47),new _e(7,48)),new De(30,new _e(43,24),new _e(22,25)),new De(30,new _e(10,15),new _e(67,16))),new Je(40,Int32Array.from([6,30,58,86,114,142,170]),new De(30,new _e(19,118),new _e(6,119)),new De(28,new _e(18,47),new _e(31,48)),new De(30,new _e(34,24),new _e(34,25)),new De(30,new _e(20,15),new _e(61,16)))];var ct;(function(dt){dt[dt.DATA_MASK_000=0]="DATA_MASK_000",dt[dt.DATA_MASK_001=1]="DATA_MASK_001",dt[dt.DATA_MASK_010=2]="DATA_MASK_010",dt[dt.DATA_MASK_011=3]="DATA_MASK_011",dt[dt.DATA_MASK_100=4]="DATA_MASK_100",dt[dt.DATA_MASK_101=5]="DATA_MASK_101",dt[dt.DATA_MASK_110=6]="DATA_MASK_110",dt[dt.DATA_MASK_111=7]="DATA_MASK_111"})(ct||(ct={}));class gt{constructor(y,E){this.value=y,this.isMasked=E}unmaskBitMatrix(y,E){for(let O=0;O<E;O++)for(let $=0;$<E;$++)this.isMasked(O,$)&&y.flip($,O)}}gt.values=new Map([[ct.DATA_MASK_000,new gt(ct.DATA_MASK_000,(dt,y)=>(dt+y&1)===0)],[ct.DATA_MASK_001,new gt(ct.DATA_MASK_001,(dt,y)=>(dt&1)===0)],[ct.DATA_MASK_010,new gt(ct.DATA_MASK_010,(dt,y)=>y%3===0)],[ct.DATA_MASK_011,new gt(ct.DATA_MASK_011,(dt,y)=>(dt+y)%3===0)],[ct.DATA_MASK_100,new gt(ct.DATA_MASK_100,(dt,y)=>(Math.floor(dt/2)+Math.floor(y/3)&1)===0)],[ct.DATA_MASK_101,new gt(ct.DATA_MASK_101,(dt,y)=>dt*y%6===0)],[ct.DATA_MASK_110,new gt(ct.DATA_MASK_110,(dt,y)=>dt*y%6<3)],[ct.DATA_MASK_111,new gt(ct.DATA_MASK_111,(dt,y)=>(dt+y+dt*y%3&1)===0)]]);class Xt{constructor(y){const E=y.getHeight();if(E<21||(E&3)!==1)throw new L;this.bitMatrix=y}readFormatInformation(){if(this.parsedFormatInfo!==null&&this.parsedFormatInfo!==void 0)return this.parsedFormatInfo;let y=0;for(let H=0;H<6;H++)y=this.copyBit(H,8,y);y=this.copyBit(7,8,y),y=this.copyBit(8,8,y),y=this.copyBit(8,7,y);for(let H=5;H>=0;H--)y=this.copyBit(8,H,y);const E=this.bitMatrix.getHeight();let O=0;const $=E-7;for(let H=E-1;H>=$;H--)O=this.copyBit(8,H,O);for(let H=E-8;H<E;H++)O=this.copyBit(H,8,O);if(this.parsedFormatInfo=Be.decodeFormatInformation(y,O),this.parsedFormatInfo!==null)return this.parsedFormatInfo;throw new L}readVersion(){if(this.parsedVersion!==null&&this.parsedVersion!==void 0)return this.parsedVersion;const y=this.bitMatrix.getHeight(),E=Math.floor((y-17)/4);if(E<=6)return Je.getVersionForNumber(E);let O=0;const $=y-11;for(let K=5;K>=0;K--)for(let le=y-9;le>=$;le--)O=this.copyBit(le,K,O);let H=Je.decodeVersionInformation(O);if(H!==null&&H.getDimensionForVersion()===y)return this.parsedVersion=H,H;O=0;for(let K=5;K>=0;K--)for(let le=y-9;le>=$;le--)O=this.copyBit(K,le,O);if(H=Je.decodeVersionInformation(O),H!==null&&H.getDimensionForVersion()===y)return this.parsedVersion=H,H;throw new L}copyBit(y,E,O){return(this.isMirror?this.bitMatrix.get(E,y):this.bitMatrix.get(y,E))?O<<1|1:O<<1}readCodewords(){const y=this.readFormatInformation(),E=this.readVersion(),O=gt.values.get(y.getDataMask()),$=this.bitMatrix.getHeight();O.unmaskBitMatrix(this.bitMatrix,$);const H=E.buildFunctionPattern();let K=!0;const le=new Uint8Array(E.getTotalCodewords());let we=0,Te=0,Ze=0;for(let pt=$-1;pt>0;pt-=2){pt===6&&pt--;for(let _t=0;_t<$;_t++){const Jt=K?$-1-_t:_t;for(let Ct=0;Ct<2;Ct++)H.get(pt-Ct,Jt)||(Ze++,Te<<=1,this.bitMatrix.get(pt-Ct,Jt)&&(Te|=1),Ze===8&&(le[we++]=Te,Ze=0,Te=0))}K=!K}if(we!==E.getTotalCodewords())throw new L;return le}remask(){if(this.parsedFormatInfo===null)return;const y=gt.values[this.parsedFormatInfo.getDataMask()],E=this.bitMatrix.getHeight();y.unmaskBitMatrix(this.bitMatrix,E)}setMirror(y){this.parsedVersion=null,this.parsedFormatInfo=null,this.isMirror=y}mirror(){const y=this.bitMatrix;for(let E=0,O=y.getWidth();E<O;E++)for(let $=E+1,H=y.getHeight();$<H;$++)y.get(E,$)!==y.get($,E)&&(y.flip($,E),y.flip(E,$))}}class wt{constructor(y,E){this.numDataCodewords=y,this.codewords=E}static getDataBlocks(y,E,O){if(y.length!==E.getTotalCodewords())throw new f;const $=E.getECBlocksForLevel(O);let H=0;const K=$.getECBlocks();for(const Ct of K)H+=Ct.getCount();const le=new Array(H);let we=0;for(const Ct of K)for(let Ht=0;Ht<Ct.getCount();Ht++){const Kt=Ct.getDataCodewords(),An=$.getECCodewordsPerBlock()+Kt;le[we++]=new wt(Kt,new Uint8Array(An))}const Te=le[0].codewords.length;let Ze=le.length-1;for(;Ze>=0&&le[Ze].codewords.length!==Te;)Ze--;Ze++;const pt=Te-$.getECCodewordsPerBlock();let _t=0;for(let Ct=0;Ct<pt;Ct++)for(let Ht=0;Ht<we;Ht++)le[Ht].codewords[Ct]=y[_t++];for(let Ct=Ze;Ct<we;Ct++)le[Ct].codewords[pt]=y[_t++];const Jt=le[0].codewords.length;for(let Ct=pt;Ct<Jt;Ct++)for(let Ht=0;Ht<we;Ht++){const Kt=Ht<Ze?Ct:Ct+1;le[Ht].codewords[Kt]=y[_t++]}return le}getNumDataCodewords(){return this.numDataCodewords}getCodewords(){return this.codewords}}var Xe;(function(dt){dt[dt.TERMINATOR=0]="TERMINATOR",dt[dt.NUMERIC=1]="NUMERIC",dt[dt.ALPHANUMERIC=2]="ALPHANUMERIC",dt[dt.STRUCTURED_APPEND=3]="STRUCTURED_APPEND",dt[dt.BYTE=4]="BYTE",dt[dt.ECI=5]="ECI",dt[dt.KANJI=6]="KANJI",dt[dt.FNC1_FIRST_POSITION=7]="FNC1_FIRST_POSITION",dt[dt.FNC1_SECOND_POSITION=8]="FNC1_SECOND_POSITION",dt[dt.HANZI=9]="HANZI"})(Xe||(Xe={}));class Oe{constructor(y,E,O,$){this.value=y,this.stringValue=E,this.characterCountBitsForVersions=O,this.bits=$,Oe.FOR_BITS.set($,this),Oe.FOR_VALUE.set(y,this)}static forBits(y){const E=Oe.FOR_BITS.get(y);if(E===void 0)throw new f;return E}getCharacterCountBits(y){const E=y.getVersionNumber();let O;return E<=9?O=0:E<=26?O=1:O=2,this.characterCountBitsForVersions[O]}getValue(){return this.value}getBits(){return this.bits}equals(y){if(!(y instanceof Oe))return!1;const E=y;return this.value===E.value}toString(){return this.stringValue}}Oe.FOR_BITS=new Map,Oe.FOR_VALUE=new Map,Oe.TERMINATOR=new Oe(Xe.TERMINATOR,"TERMINATOR",Int32Array.from([0,0,0]),0),Oe.NUMERIC=new Oe(Xe.NUMERIC,"NUMERIC",Int32Array.from([10,12,14]),1),Oe.ALPHANUMERIC=new Oe(Xe.ALPHANUMERIC,"ALPHANUMERIC",Int32Array.from([9,11,13]),2),Oe.STRUCTURED_APPEND=new Oe(Xe.STRUCTURED_APPEND,"STRUCTURED_APPEND",Int32Array.from([0,0,0]),3),Oe.BYTE=new Oe(Xe.BYTE,"BYTE",Int32Array.from([8,16,16]),4),Oe.ECI=new Oe(Xe.ECI,"ECI",Int32Array.from([0,0,0]),7),Oe.KANJI=new Oe(Xe.KANJI,"KANJI",Int32Array.from([8,10,12]),8),Oe.FNC1_FIRST_POSITION=new Oe(Xe.FNC1_FIRST_POSITION,"FNC1_FIRST_POSITION",Int32Array.from([0,0,0]),5),Oe.FNC1_SECOND_POSITION=new Oe(Xe.FNC1_SECOND_POSITION,"FNC1_SECOND_POSITION",Int32Array.from([0,0,0]),9),Oe.HANZI=new Oe(Xe.HANZI,"HANZI",Int32Array.from([8,10,12]),13);class bt{static decode(y,E,O,$){const H=new xe(y);let K=new re;const le=new Array;let we=-1,Te=-1;try{let Ze=null,pt=!1,_t;do{if(H.available()<4)_t=Oe.TERMINATOR;else{const Jt=H.readBits(4);_t=Oe.forBits(Jt)}switch(_t){case Oe.TERMINATOR:break;case Oe.FNC1_FIRST_POSITION:case Oe.FNC1_SECOND_POSITION:pt=!0;break;case Oe.STRUCTURED_APPEND:if(H.available()<16)throw new L;we=H.readBits(8),Te=H.readBits(8);break;case Oe.ECI:const Jt=bt.parseECIValue(H);if(Ze=Q.getCharacterSetECIByValue(Jt),Ze===null)throw new L;break;case Oe.HANZI:const Ct=H.readBits(4),Ht=H.readBits(_t.getCharacterCountBits(E));Ct===bt.GB2312_SUBSET&&bt.decodeHanziSegment(H,K,Ht);break;default:const Kt=H.readBits(_t.getCharacterCountBits(E));switch(_t){case Oe.NUMERIC:bt.decodeNumericSegment(H,K,Kt);break;case Oe.ALPHANUMERIC:bt.decodeAlphanumericSegment(H,K,Kt,pt);break;case Oe.BYTE:bt.decodeByteSegment(H,K,Kt,Ze,le,$);break;case Oe.KANJI:bt.decodeKanjiSegment(H,K,Kt);break;default:throw new L}break}}while(_t!==Oe.TERMINATOR)}catch{throw new L}return new Ie(y,K.toString(),le.length===0?null:le,O===null?null:O.toString(),we,Te)}static decodeHanziSegment(y,E,O){if(O*13>y.available())throw new L;const $=new Uint8Array(2*O);let H=0;for(;O>0;){const K=y.readBits(13);let le=K/96<<8&4294967295|K%96;le<959?le+=41377:le+=42657,$[H]=le>>8&255,$[H+1]=le&255,H+=2,O--}try{E.append(J.decode($,X.GB2312))}catch(K){throw new L(K)}}static decodeKanjiSegment(y,E,O){if(O*13>y.available())throw new L;const $=new Uint8Array(2*O);let H=0;for(;O>0;){const K=y.readBits(13);let le=K/192<<8&4294967295|K%192;le<7936?le+=33088:le+=49472,$[H]=le>>8,$[H+1]=le,H+=2,O--}try{E.append(J.decode($,X.SHIFT_JIS))}catch(K){throw new L(K)}}static decodeByteSegment(y,E,O,$,H,K){if(8*O>y.available())throw new L;const le=new Uint8Array(O);for(let Te=0;Te<O;Te++)le[Te]=y.readBits(8);let we;$===null?we=X.guessEncoding(le,K):we=$.getName();try{E.append(J.decode(le,we))}catch(Te){throw new L(Te)}H.push(le)}static toAlphaNumericChar(y){if(y>=bt.ALPHANUMERIC_CHARS.length)throw new L;return bt.ALPHANUMERIC_CHARS[y]}static decodeAlphanumericSegment(y,E,O,$){const H=E.length();for(;O>1;){if(y.available()<11)throw new L;const K=y.readBits(11);E.append(bt.toAlphaNumericChar(Math.floor(K/45))),E.append(bt.toAlphaNumericChar(K%45)),O-=2}if(O===1){if(y.available()<6)throw new L;E.append(bt.toAlphaNumericChar(y.readBits(6)))}if($)for(let K=H;K<E.length();K++)E.charAt(K)==="%"&&(K<E.length()-1&&E.charAt(K+1)==="%"?E.deleteCharAt(K+1):E.setCharAt(K,""))}static decodeNumericSegment(y,E,O){for(;O>=3;){if(y.available()<10)throw new L;const $=y.readBits(10);if($>=1e3)throw new L;E.append(bt.toAlphaNumericChar(Math.floor($/100))),E.append(bt.toAlphaNumericChar(Math.floor($/10)%10)),E.append(bt.toAlphaNumericChar($%10)),O-=3}if(O===2){if(y.available()<7)throw new L;const $=y.readBits(7);if($>=100)throw new L;E.append(bt.toAlphaNumericChar(Math.floor($/10))),E.append(bt.toAlphaNumericChar($%10))}else if(O===1){if(y.available()<4)throw new L;const $=y.readBits(4);if($>=10)throw new L;E.append(bt.toAlphaNumericChar($))}}static parseECIValue(y){const E=y.readBits(8);if(!(E&128))return E&127;if((E&192)===128){const O=y.readBits(8);return(E&63)<<8&4294967295|O}if((E&224)===192){const O=y.readBits(16);return(E&31)<<16&4294967295|O}throw new L}}bt.ALPHANUMERIC_CHARS="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:",bt.GB2312_SUBSET=1;class kt{constructor(y){this.mirrored=y}isMirrored(){return this.mirrored}applyMirroredCorrection(y){if(!this.mirrored||y===null||y.length<3)return;const E=y[0];y[0]=y[2],y[2]=E}}class Ut{constructor(){this.rsDecoder=new ft(it.QR_CODE_FIELD_256)}decodeBooleanArray(y,E){return this.decodeBitMatrix(pe.parseFromBooleanArray(y),E)}decodeBitMatrix(y,E){const O=new Xt(y);let $=null;try{return this.decodeBitMatrixParser(O,E)}catch(H){$=H}try{O.remask(),O.setMirror(!0),O.readVersion(),O.readFormatInformation(),O.mirror();const H=this.decodeBitMatrixParser(O,E);return H.setOther(new kt(!0)),H}catch(H){throw $!==null?$:H}}decodeBitMatrixParser(y,E){const O=y.readVersion(),$=y.readFormatInformation().getErrorCorrectionLevel(),H=y.readCodewords(),K=wt.getDataBlocks(H,O,$);let le=0;for(const Ze of K)le+=Ze.getNumDataCodewords();const we=new Uint8Array(le);let Te=0;for(const Ze of K){const pt=Ze.getCodewords(),_t=Ze.getNumDataCodewords();this.correctErrors(pt,_t);for(let Jt=0;Jt<_t;Jt++)we[Te++]=pt[Jt]}return bt.decode(we,O,$,E)}correctErrors(y,E){const O=new Int32Array(y);try{this.rsDecoder.decode(O,y.length-E)}catch{throw new g}for(let $=0;$<E;$++)y[$]=O[$]}}class fn extends jt{constructor(y,E,O){super(y,E),this.estimatedModuleSize=O}aboutEquals(y,E,O){if(Math.abs(E-this.getY())<=y&&Math.abs(O-this.getX())<=y){const $=Math.abs(y-this.estimatedModuleSize);return $<=1||$<=this.estimatedModuleSize}return!1}combineEstimate(y,E,O){const $=(this.getX()+E)/2,H=(this.getY()+y)/2,K=(this.estimatedModuleSize+O)/2;return new fn($,H,K)}}class On{constructor(y,E,O,$,H,K,le){this.image=y,this.startX=E,this.startY=O,this.width=$,this.height=H,this.moduleSize=K,this.resultPointCallback=le,this.possibleCenters=[],this.crossCheckStateCount=new Int32Array(3)}find(){const y=this.startX,E=this.height,O=this.width,$=y+O,H=this.startY+E/2,K=new Int32Array(3),le=this.image;for(let we=0;we<E;we++){const Te=H+(we&1?-Math.floor((we+1)/2):Math.floor((we+1)/2));K[0]=0,K[1]=0,K[2]=0;let Ze=y;for(;Ze<$&&!le.get(Ze,Te);)Ze++;let pt=0;for(;Ze<$;){if(le.get(Ze,Te))if(pt===1)K[1]++;else if(pt===2){if(this.foundPatternCross(K)){const _t=this.handlePossibleCenter(K,Te,Ze);if(_t!==null)return _t}K[0]=K[2],K[1]=1,K[2]=0,pt=1}else K[++pt]++;else pt===1&&pt++,K[pt]++;Ze++}if(this.foundPatternCross(K)){const _t=this.handlePossibleCenter(K,Te,$);if(_t!==null)return _t}}if(this.possibleCenters.length!==0)return this.possibleCenters[0];throw new Y}static centerFromEnd(y,E){return E-y[2]-y[1]/2}foundPatternCross(y){const E=this.moduleSize,O=E/2;for(let $=0;$<3;$++)if(Math.abs(E-y[$])>=O)return!1;return!0}crossCheckVertical(y,E,O,$){const H=this.image,K=H.getHeight(),le=this.crossCheckStateCount;le[0]=0,le[1]=0,le[2]=0;let we=y;for(;we>=0&&H.get(E,we)&&le[1]<=O;)le[1]++,we--;if(we<0||le[1]>O)return NaN;for(;we>=0&&!H.get(E,we)&&le[0]<=O;)le[0]++,we--;if(le[0]>O)return NaN;for(we=y+1;we<K&&H.get(E,we)&&le[1]<=O;)le[1]++,we++;if(we===K||le[1]>O)return NaN;for(;we<K&&!H.get(E,we)&&le[2]<=O;)le[2]++,we++;if(le[2]>O)return NaN;const Te=le[0]+le[1]+le[2];return 5*Math.abs(Te-$)>=2*$?NaN:this.foundPatternCross(le)?On.centerFromEnd(le,we):NaN}handlePossibleCenter(y,E,O){const $=y[0]+y[1]+y[2],H=On.centerFromEnd(y,O),K=this.crossCheckVertical(E,H,2*y[1],$);if(!isNaN(K)){const le=(y[0]+y[1]+y[2])/3;for(const Te of this.possibleCenters)if(Te.aboutEquals(le,K,H))return Te.combineEstimate(K,H,le);const we=new fn(H,K,le);this.possibleCenters.push(we),this.resultPointCallback!==null&&this.resultPointCallback!==void 0&&this.resultPointCallback.foundPossibleResultPoint(we)}return null}}class Sn extends jt{constructor(y,E,O,$){super(y,E),this.estimatedModuleSize=O,this.count=$,$===void 0&&(this.count=1)}getEstimatedModuleSize(){return this.estimatedModuleSize}getCount(){return this.count}aboutEquals(y,E,O){if(Math.abs(E-this.getY())<=y&&Math.abs(O-this.getX())<=y){const $=Math.abs(y-this.estimatedModuleSize);return $<=1||$<=this.estimatedModuleSize}return!1}combineEstimate(y,E,O){const $=this.count+1,H=(this.count*this.getX()+E)/$,K=(this.count*this.getY()+y)/$,le=(this.count*this.estimatedModuleSize+O)/$;return new Sn(H,K,le,$)}}class yr{constructor(y){this.bottomLeft=y[0],this.topLeft=y[1],this.topRight=y[2]}getBottomLeft(){return this.bottomLeft}getTopLeft(){return this.topLeft}getTopRight(){return this.topRight}}class Pn{constructor(y,E){this.image=y,this.resultPointCallback=E,this.possibleCenters=[],this.crossCheckStateCount=new Int32Array(5),this.resultPointCallback=E}getImage(){return this.image}getPossibleCenters(){return this.possibleCenters}find(y){const E=y!=null&&y.get(U.TRY_HARDER)!==void 0,O=y!=null&&y.get(U.PURE_BARCODE)!==void 0,$=this.image,H=$.getHeight(),K=$.getWidth();let le=Math.floor(3*H/(4*Pn.MAX_MODULES));(le<Pn.MIN_SKIP||E)&&(le=Pn.MIN_SKIP);let we=!1;const Te=new Int32Array(5);for(let pt=le-1;pt<H&&!we;pt+=le){Te[0]=0,Te[1]=0,Te[2]=0,Te[3]=0,Te[4]=0;let _t=0;for(let Jt=0;Jt<K;Jt++)if($.get(Jt,pt))(_t&1)===1&&_t++,Te[_t]++;else if(_t&1)Te[_t]++;else if(_t===4)if(Pn.foundPatternCross(Te)){if(this.handlePossibleCenter(Te,pt,Jt,O)===!0)if(le=2,this.hasSkipped===!0)we=this.haveMultiplyConfirmedCenters();else{const Ht=this.findRowSkip();Ht>Te[2]&&(pt+=Ht-Te[2]-le,Jt=K-1)}else{Te[0]=Te[2],Te[1]=Te[3],Te[2]=Te[4],Te[3]=1,Te[4]=0,_t=3;continue}_t=0,Te[0]=0,Te[1]=0,Te[2]=0,Te[3]=0,Te[4]=0}else Te[0]=Te[2],Te[1]=Te[3],Te[2]=Te[4],Te[3]=1,Te[4]=0,_t=3;else Te[++_t]++;Pn.foundPatternCross(Te)&&this.handlePossibleCenter(Te,pt,K,O)===!0&&(le=Te[0],this.hasSkipped&&(we=this.haveMultiplyConfirmedCenters()))}const Ze=this.selectBestPatterns();return jt.orderBestPatterns(Ze),new yr(Ze)}static centerFromEnd(y,E){return E-y[4]-y[3]-y[2]/2}static foundPatternCross(y){let E=0;for(let H=0;H<5;H++){const K=y[H];if(K===0)return!1;E+=K}if(E<7)return!1;const O=E/7,$=O/2;return Math.abs(O-y[0])<$&&Math.abs(O-y[1])<$&&Math.abs(3*O-y[2])<3*$&&Math.abs(O-y[3])<$&&Math.abs(O-y[4])<$}getCrossCheckStateCount(){const y=this.crossCheckStateCount;return y[0]=0,y[1]=0,y[2]=0,y[3]=0,y[4]=0,y}crossCheckDiagonal(y,E,O,$){const H=this.getCrossCheckStateCount();let K=0;const le=this.image;for(;y>=K&&E>=K&&le.get(E-K,y-K);)H[2]++,K++;if(y<K||E<K)return!1;for(;y>=K&&E>=K&&!le.get(E-K,y-K)&&H[1]<=O;)H[1]++,K++;if(y<K||E<K||H[1]>O)return!1;for(;y>=K&&E>=K&&le.get(E-K,y-K)&&H[0]<=O;)H[0]++,K++;if(H[0]>O)return!1;const we=le.getHeight(),Te=le.getWidth();for(K=1;y+K<we&&E+K<Te&&le.get(E+K,y+K);)H[2]++,K++;if(y+K>=we||E+K>=Te)return!1;for(;y+K<we&&E+K<Te&&!le.get(E+K,y+K)&&H[3]<O;)H[3]++,K++;if(y+K>=we||E+K>=Te||H[3]>=O)return!1;for(;y+K<we&&E+K<Te&&le.get(E+K,y+K)&&H[4]<O;)H[4]++,K++;if(H[4]>=O)return!1;const Ze=H[0]+H[1]+H[2]+H[3]+H[4];return Math.abs(Ze-$)<2*$&&Pn.foundPatternCross(H)}crossCheckVertical(y,E,O,$){const H=this.image,K=H.getHeight(),le=this.getCrossCheckStateCount();let we=y;for(;we>=0&&H.get(E,we);)le[2]++,we--;if(we<0)return NaN;for(;we>=0&&!H.get(E,we)&&le[1]<=O;)le[1]++,we--;if(we<0||le[1]>O)return NaN;for(;we>=0&&H.get(E,we)&&le[0]<=O;)le[0]++,we--;if(le[0]>O)return NaN;for(we=y+1;we<K&&H.get(E,we);)le[2]++,we++;if(we===K)return NaN;for(;we<K&&!H.get(E,we)&&le[3]<O;)le[3]++,we++;if(we===K||le[3]>=O)return NaN;for(;we<K&&H.get(E,we)&&le[4]<O;)le[4]++,we++;if(le[4]>=O)return NaN;const Te=le[0]+le[1]+le[2]+le[3]+le[4];return 5*Math.abs(Te-$)>=2*$?NaN:Pn.foundPatternCross(le)?Pn.centerFromEnd(le,we):NaN}crossCheckHorizontal(y,E,O,$){const H=this.image,K=H.getWidth(),le=this.getCrossCheckStateCount();let we=y;for(;we>=0&&H.get(we,E);)le[2]++,we--;if(we<0)return NaN;for(;we>=0&&!H.get(we,E)&&le[1]<=O;)le[1]++,we--;if(we<0||le[1]>O)return NaN;for(;we>=0&&H.get(we,E)&&le[0]<=O;)le[0]++,we--;if(le[0]>O)return NaN;for(we=y+1;we<K&&H.get(we,E);)le[2]++,we++;if(we===K)return NaN;for(;we<K&&!H.get(we,E)&&le[3]<O;)le[3]++,we++;if(we===K||le[3]>=O)return NaN;for(;we<K&&H.get(we,E)&&le[4]<O;)le[4]++,we++;if(le[4]>=O)return NaN;const Te=le[0]+le[1]+le[2]+le[3]+le[4];return 5*Math.abs(Te-$)>=$?NaN:Pn.foundPatternCross(le)?Pn.centerFromEnd(le,we):NaN}handlePossibleCenter(y,E,O,$){const H=y[0]+y[1]+y[2]+y[3]+y[4];let K=Pn.centerFromEnd(y,O),le=this.crossCheckVertical(E,Math.floor(K),y[2],H);if(!isNaN(le)&&(K=this.crossCheckHorizontal(Math.floor(K),Math.floor(le),y[2],H),!isNaN(K)&&(!$||this.crossCheckDiagonal(Math.floor(le),Math.floor(K),y[2],H)))){const we=H/7;let Te=!1;const Ze=this.possibleCenters;for(let pt=0,_t=Ze.length;pt<_t;pt++){const Jt=Ze[pt];if(Jt.aboutEquals(we,le,K)){Ze[pt]=Jt.combineEstimate(le,K,we),Te=!0;break}}if(!Te){const pt=new Sn(K,le,we);Ze.push(pt),this.resultPointCallback!==null&&this.resultPointCallback!==void 0&&this.resultPointCallback.foundPossibleResultPoint(pt)}return!0}return!1}findRowSkip(){if(this.possibleCenters.length<=1)return 0;let E=null;for(const O of this.possibleCenters)if(O.getCount()>=Pn.CENTER_QUORUM)if(E==null)E=O;else return this.hasSkipped=!0,Math.floor((Math.abs(E.getX()-O.getX())-Math.abs(E.getY()-O.getY()))/2);return 0}haveMultiplyConfirmedCenters(){let y=0,E=0;const O=this.possibleCenters.length;for(const K of this.possibleCenters)K.getCount()>=Pn.CENTER_QUORUM&&(y++,E+=K.getEstimatedModuleSize());if(y<3)return!1;const $=E/O;let H=0;for(const K of this.possibleCenters)H+=Math.abs(K.getEstimatedModuleSize()-$);return H<=.05*E}selectBestPatterns(){const y=this.possibleCenters.length;if(y<3)throw new Y;const E=this.possibleCenters;let O;if(y>3){let $=0,H=0;for(const we of this.possibleCenters){const Te=we.getEstimatedModuleSize();$+=Te,H+=Te*Te}O=$/y;let K=Math.sqrt(H/y-O*O);E.sort((we,Te)=>{const Ze=Math.abs(Te.getEstimatedModuleSize()-O),pt=Math.abs(we.getEstimatedModuleSize()-O);return Ze<pt?-1:Ze>pt?1:0});const le=Math.max(.2*O,K);for(let we=0;we<E.length&&E.length>3;we++){const Te=E[we];Math.abs(Te.getEstimatedModuleSize()-O)>le&&(E.splice(we,1),we--)}}if(E.length>3){let $=0;for(const H of E)$+=H.getEstimatedModuleSize();O=$/E.length,E.sort((H,K)=>{if(K.getCount()===H.getCount()){const le=Math.abs(K.getEstimatedModuleSize()-O),we=Math.abs(H.getEstimatedModuleSize()-O);return le<we?1:le>we?-1:0}else return K.getCount()-H.getCount()}),E.splice(3)}return[E[0],E[1],E[2]]}}Pn.CENTER_QUORUM=2,Pn.MIN_SKIP=3,Pn.MAX_MODULES=57;class En{constructor(y){this.image=y}getImage(){return this.image}getResultPointCallback(){return this.resultPointCallback}detect(y){this.resultPointCallback=y==null?null:y.get(U.NEED_RESULT_POINT_CALLBACK);const O=new Pn(this.image,this.resultPointCallback).find(y);return this.processFinderPatternInfo(O)}processFinderPatternInfo(y){const E=y.getTopLeft(),O=y.getTopRight(),$=y.getBottomLeft(),H=this.calculateModuleSize(E,O,$);if(H<1)throw new Y("No pattern found in proccess finder.");const K=En.computeDimension(E,O,$,H),le=Je.getProvisionalVersionForDimension(K),we=le.getDimensionForVersion()-7;let Te=null;if(le.getAlignmentPatternCenters().length>0){const Jt=O.getX()-E.getX()+$.getX(),Ct=O.getY()-E.getY()+$.getY(),Ht=1-3/we,Kt=Math.floor(E.getX()+Ht*(Jt-E.getX())),An=Math.floor(E.getY()+Ht*(Ct-E.getY()));for(let hr=4;hr<=16;hr<<=1)try{Te=this.findAlignmentInRegion(H,Kt,An,hr);break}catch(wr){if(!(wr instanceof Y))throw wr}}const Ze=En.createTransform(E,O,$,Te,K),pt=En.sampleGrid(this.image,Ze,K);let _t;return Te===null?_t=[$,E,O]:_t=[$,E,O,Te],new cn(pt,_t)}static createTransform(y,E,O,$,H){const K=H-3.5;let le,we,Te,Ze;return $!==null?(le=$.getX(),we=$.getY(),Te=K-3,Ze=Te):(le=E.getX()-y.getX()+O.getX(),we=E.getY()-y.getY()+O.getY(),Te=K,Ze=K),Bt.quadrilateralToQuadrilateral(3.5,3.5,K,3.5,Te,Ze,3.5,K,y.getX(),y.getY(),E.getX(),E.getY(),le,we,O.getX(),O.getY())}static sampleGrid(y,E,O){return qe.getInstance().sampleGridWithTransform(y,O,O,E)}static computeDimension(y,E,O,$){const H=It.round(jt.distance(y,E)/$),K=It.round(jt.distance(y,O)/$);let le=Math.floor((H+K)/2)+7;switch(le&3){case 0:le++;break;case 2:le--;break;case 3:throw new Y("Dimensions could be not found.")}return le}calculateModuleSize(y,E,O){return(this.calculateModuleSizeOneWay(y,E)+this.calculateModuleSizeOneWay(y,O))/2}calculateModuleSizeOneWay(y,E){const O=this.sizeOfBlackWhiteBlackRunBothWays(Math.floor(y.getX()),Math.floor(y.getY()),Math.floor(E.getX()),Math.floor(E.getY())),$=this.sizeOfBlackWhiteBlackRunBothWays(Math.floor(E.getX()),Math.floor(E.getY()),Math.floor(y.getX()),Math.floor(y.getY()));return isNaN(O)?$/7:isNaN($)?O/7:(O+$)/14}sizeOfBlackWhiteBlackRunBothWays(y,E,O,$){let H=this.sizeOfBlackWhiteBlackRun(y,E,O,$),K=1,le=y-(O-y);le<0?(K=y/(y-le),le=0):le>=this.image.getWidth()&&(K=(this.image.getWidth()-1-y)/(le-y),le=this.image.getWidth()-1);let we=Math.floor(E-($-E)*K);return K=1,we<0?(K=E/(E-we),we=0):we>=this.image.getHeight()&&(K=(this.image.getHeight()-1-E)/(we-E),we=this.image.getHeight()-1),le=Math.floor(y+(le-y)*K),H+=this.sizeOfBlackWhiteBlackRun(y,E,le,we),H-1}sizeOfBlackWhiteBlackRun(y,E,O,$){const H=Math.abs($-E)>Math.abs(O-y);if(H){let Jt=y;y=E,E=Jt,Jt=O,O=$,$=Jt}const K=Math.abs(O-y),le=Math.abs($-E);let we=-K/2;const Te=y<O?1:-1,Ze=E<$?1:-1;let pt=0;const _t=O+Te;for(let Jt=y,Ct=E;Jt!==_t;Jt+=Te){const Ht=H?Ct:Jt,Kt=H?Jt:Ct;if(pt===1===this.image.get(Ht,Kt)){if(pt===2)return It.distance(Jt,Ct,y,E);pt++}if(we+=le,we>0){if(Ct===$)break;Ct+=Ze,we-=K}}return pt===2?It.distance(O+Te,$,y,E):NaN}findAlignmentInRegion(y,E,O,$){const H=Math.floor($*y),K=Math.max(0,E-H),le=Math.min(this.image.getWidth()-1,E+H);if(le-K<y*3)throw new Y("Alignment top exceeds estimated module size.");const we=Math.max(0,O-H),Te=Math.min(this.image.getHeight()-1,O+H);if(Te-we<y*3)throw new Y("Alignment bottom exceeds estimated module size.");return new On(this.image,K,we,le-K,Te-we,y,this.resultPointCallback).find()}}class $n{constructor(){this.decoder=new Ut}getDecoder(){return this.decoder}decode(y,E){let O,$;if(E!=null&&E.get(U.PURE_BARCODE)!==void 0){const we=$n.extractPureBits(y.getBlackMatrix());O=this.decoder.decodeBitMatrix(we,E),$=$n.NO_POINTS}else{const we=new En(y.getBlackMatrix()).detect(E);O=this.decoder.decodeBitMatrix(we.getBits(),E),$=we.getPoints()}O.getOther()instanceof kt&&O.getOther().applyMirroredCorrection($);const H=new he(O.getText(),O.getRawBytes(),void 0,$,ye.QR_CODE,void 0),K=O.getByteSegments();K!==null&&H.putMetadata(je.BYTE_SEGMENTS,K);const le=O.getECLevel();return le!==null&&H.putMetadata(je.ERROR_CORRECTION_LEVEL,le),O.hasStructuredAppend()&&(H.putMetadata(je.STRUCTURED_APPEND_SEQUENCE,O.getStructuredAppendSequenceNumber()),H.putMetadata(je.STRUCTURED_APPEND_PARITY,O.getStructuredAppendParity())),H}reset(){}static extractPureBits(y){const E=y.getTopLeftOnBit(),O=y.getBottomRightOnBit();if(E===null||O===null)throw new Y;const $=this.moduleSize(E,y);let H=E[1],K=O[1],le=E[0],we=O[0];if(le>=we||H>=K)throw new Y;if(K-H!==we-le&&(we=le+(K-H),we>=y.getWidth()))throw new Y;const Te=Math.round((we-le+1)/$),Ze=Math.round((K-H+1)/$);if(Te<=0||Ze<=0)throw new Y;if(Ze!==Te)throw new Y;const pt=Math.floor($/2);H+=pt,le+=pt;const _t=le+Math.floor((Te-1)*$)-we;if(_t>0){if(_t>pt)throw new Y;le-=_t}const Jt=H+Math.floor((Ze-1)*$)-K;if(Jt>0){if(Jt>pt)throw new Y;H-=Jt}const Ct=new pe(Te,Ze);for(let Ht=0;Ht<Ze;Ht++){const Kt=H+Math.floor(Ht*$);for(let An=0;An<Te;An++)y.get(le+Math.floor(An*$),Kt)&&Ct.set(An,Ht)}return Ct}static moduleSize(y,E){const O=E.getHeight(),$=E.getWidth();let H=y[0],K=y[1],le=!0,we=0;for(;H<$&&K<O;){if(le!==E.get(H,K)){if(++we===5)break;le=!le}H++,K++}if(H===$||K===O)throw new Y;return(H-y[0])/7}}$n.NO_POINTS=new Array;class Bn{PDF417Common(){}static getBitCountSum(y){return It.sum(y)}static toIntArray(y){if(y==null||!y.length)return Bn.EMPTY_INT_ARRAY;const E=new Int32Array(y.length);let O=0;for(const $ of y)E[O++]=$;return E}static getCodeword(y){const E=P.binarySearch(Bn.SYMBOL_TABLE,y&262143);return E<0?-1:(Bn.CODEWORD_TABLE[E]-1)%Bn.NUMBER_OF_CODEWORDS}}Bn.NUMBER_OF_CODEWORDS=929,Bn.MAX_CODEWORDS_IN_BARCODE=Bn.NUMBER_OF_CODEWORDS-1,Bn.MIN_ROWS_IN_BARCODE=3,Bn.MAX_ROWS_IN_BARCODE=90,Bn.MODULES_IN_CODEWORD=17,Bn.MODULES_IN_STOP_PATTERN=18,Bn.BARS_IN_MODULE=8,Bn.EMPTY_INT_ARRAY=new Int32Array([]),Bn.SYMBOL_TABLE=Int32Array.from([66142,66170,66206,66236,66290,66292,66350,66382,66396,66454,66470,66476,66594,66600,66614,66626,66628,66632,66640,66654,66662,66668,66682,66690,66718,66720,66748,66758,66776,66798,66802,66804,66820,66824,66832,66846,66848,66876,66880,66936,66950,66956,66968,66992,67006,67022,67036,67042,67044,67048,67062,67118,67150,67164,67214,67228,67256,67294,67322,67350,67366,67372,67398,67404,67416,67438,67474,67476,67490,67492,67496,67510,67618,67624,67650,67656,67664,67678,67686,67692,67706,67714,67716,67728,67742,67744,67772,67782,67788,67800,67822,67826,67828,67842,67848,67870,67872,67900,67904,67960,67974,67992,68016,68030,68046,68060,68066,68068,68072,68086,68104,68112,68126,68128,68156,68160,68216,68336,68358,68364,68376,68400,68414,68448,68476,68494,68508,68536,68546,68548,68552,68560,68574,68582,68588,68654,68686,68700,68706,68708,68712,68726,68750,68764,68792,68802,68804,68808,68816,68830,68838,68844,68858,68878,68892,68920,68976,68990,68994,68996,69e3,69008,69022,69024,69052,69062,69068,69080,69102,69106,69108,69142,69158,69164,69190,69208,69230,69254,69260,69272,69296,69310,69326,69340,69386,69394,69396,69410,69416,69430,69442,69444,69448,69456,69470,69478,69484,69554,69556,69666,69672,69698,69704,69712,69726,69754,69762,69764,69776,69790,69792,69820,69830,69836,69848,69870,69874,69876,69890,69918,69920,69948,69952,70008,70022,70040,70064,70078,70094,70108,70114,70116,70120,70134,70152,70174,70176,70264,70384,70412,70448,70462,70496,70524,70542,70556,70584,70594,70600,70608,70622,70630,70636,70664,70672,70686,70688,70716,70720,70776,70896,71136,71180,71192,71216,71230,71264,71292,71360,71416,71452,71480,71536,71550,71554,71556,71560,71568,71582,71584,71612,71622,71628,71640,71662,71726,71732,71758,71772,71778,71780,71784,71798,71822,71836,71864,71874,71880,71888,71902,71910,71916,71930,71950,71964,71992,72048,72062,72066,72068,72080,72094,72096,72124,72134,72140,72152,72174,72178,72180,72206,72220,72248,72304,72318,72416,72444,72456,72464,72478,72480,72508,72512,72568,72588,72600,72624,72638,72654,72668,72674,72676,72680,72694,72726,72742,72748,72774,72780,72792,72814,72838,72856,72880,72894,72910,72924,72930,72932,72936,72950,72966,72972,72984,73008,73022,73056,73084,73102,73116,73144,73156,73160,73168,73182,73190,73196,73210,73226,73234,73236,73250,73252,73256,73270,73282,73284,73296,73310,73318,73324,73346,73348,73352,73360,73374,73376,73404,73414,73420,73432,73454,73498,73518,73522,73524,73550,73564,73570,73572,73576,73590,73800,73822,73858,73860,73872,73886,73888,73916,73944,73970,73972,73992,74014,74016,74044,74048,74104,74118,74136,74160,74174,74210,74212,74216,74230,74244,74256,74270,74272,74360,74480,74502,74508,74544,74558,74592,74620,74638,74652,74680,74690,74696,74704,74726,74732,74782,74784,74812,74992,75232,75288,75326,75360,75388,75456,75512,75576,75632,75646,75650,75652,75664,75678,75680,75708,75718,75724,75736,75758,75808,75836,75840,75896,76016,76256,76736,76824,76848,76862,76896,76924,76992,77048,77296,77340,77368,77424,77438,77536,77564,77572,77576,77584,77600,77628,77632,77688,77702,77708,77720,77744,77758,77774,77788,77870,77902,77916,77922,77928,77966,77980,78008,78018,78024,78032,78046,78060,78074,78094,78136,78192,78206,78210,78212,78224,78238,78240,78268,78278,78284,78296,78322,78324,78350,78364,78448,78462,78560,78588,78600,78622,78624,78652,78656,78712,78726,78744,78768,78782,78798,78812,78818,78820,78824,78838,78862,78876,78904,78960,78974,79072,79100,79296,79352,79368,79376,79390,79392,79420,79424,79480,79600,79628,79640,79664,79678,79712,79740,79772,79800,79810,79812,79816,79824,79838,79846,79852,79894,79910,79916,79942,79948,79960,79982,79988,80006,80024,80048,80062,80078,80092,80098,80100,80104,80134,80140,80176,80190,80224,80252,80270,80284,80312,80328,80336,80350,80358,80364,80378,80390,80396,80408,80432,80446,80480,80508,80576,80632,80654,80668,80696,80752,80766,80776,80784,80798,80800,80828,80844,80856,80878,80882,80884,80914,80916,80930,80932,80936,80950,80962,80968,80976,80990,80998,81004,81026,81028,81040,81054,81056,81084,81094,81100,81112,81134,81154,81156,81160,81168,81182,81184,81212,81216,81272,81286,81292,81304,81328,81342,81358,81372,81380,81384,81398,81434,81454,81458,81460,81486,81500,81506,81508,81512,81526,81550,81564,81592,81602,81604,81608,81616,81630,81638,81644,81702,81708,81722,81734,81740,81752,81774,81778,81780,82050,82078,82080,82108,82180,82184,82192,82206,82208,82236,82240,82296,82316,82328,82352,82366,82402,82404,82408,82440,82448,82462,82464,82492,82496,82552,82672,82694,82700,82712,82736,82750,82784,82812,82830,82882,82884,82888,82896,82918,82924,82952,82960,82974,82976,83004,83008,83064,83184,83424,83468,83480,83504,83518,83552,83580,83648,83704,83740,83768,83824,83838,83842,83844,83848,83856,83872,83900,83910,83916,83928,83950,83984,84e3,84028,84032,84088,84208,84448,84928,85040,85054,85088,85116,85184,85240,85488,85560,85616,85630,85728,85756,85764,85768,85776,85790,85792,85820,85824,85880,85894,85900,85912,85936,85966,85980,86048,86080,86136,86256,86496,86976,88160,88188,88256,88312,88560,89056,89200,89214,89312,89340,89536,89592,89608,89616,89632,89664,89720,89840,89868,89880,89904,89952,89980,89998,90012,90040,90190,90204,90254,90268,90296,90306,90308,90312,90334,90382,90396,90424,90480,90494,90500,90504,90512,90526,90528,90556,90566,90572,90584,90610,90612,90638,90652,90680,90736,90750,90848,90876,90884,90888,90896,90910,90912,90940,90944,91e3,91014,91020,91032,91056,91070,91086,91100,91106,91108,91112,91126,91150,91164,91192,91248,91262,91360,91388,91584,91640,91664,91678,91680,91708,91712,91768,91888,91928,91952,91966,92e3,92028,92046,92060,92088,92098,92100,92104,92112,92126,92134,92140,92188,92216,92272,92384,92412,92608,92664,93168,93200,93214,93216,93244,93248,93304,93424,93664,93720,93744,93758,93792,93820,93888,93944,93980,94008,94064,94078,94084,94088,94096,94110,94112,94140,94150,94156,94168,94246,94252,94278,94284,94296,94318,94342,94348,94360,94384,94398,94414,94428,94440,94470,94476,94488,94512,94526,94560,94588,94606,94620,94648,94658,94660,94664,94672,94686,94694,94700,94714,94726,94732,94744,94768,94782,94816,94844,94912,94968,94990,95004,95032,95088,95102,95112,95120,95134,95136,95164,95180,95192,95214,95218,95220,95244,95256,95280,95294,95328,95356,95424,95480,95728,95758,95772,95800,95856,95870,95968,95996,96008,96016,96030,96032,96060,96064,96120,96152,96176,96190,96220,96226,96228,96232,96290,96292,96296,96310,96322,96324,96328,96336,96350,96358,96364,96386,96388,96392,96400,96414,96416,96444,96454,96460,96472,96494,96498,96500,96514,96516,96520,96528,96542,96544,96572,96576,96632,96646,96652,96664,96688,96702,96718,96732,96738,96740,96744,96758,96772,96776,96784,96798,96800,96828,96832,96888,97008,97030,97036,97048,97072,97086,97120,97148,97166,97180,97208,97220,97224,97232,97246,97254,97260,97326,97330,97332,97358,97372,97378,97380,97384,97398,97422,97436,97464,97474,97476,97480,97488,97502,97510,97516,97550,97564,97592,97648,97666,97668,97672,97680,97694,97696,97724,97734,97740,97752,97774,97830,97836,97850,97862,97868,97880,97902,97906,97908,97926,97932,97944,97968,97998,98012,98018,98020,98024,98038,98618,98674,98676,98838,98854,98874,98892,98904,98926,98930,98932,98968,99006,99042,99044,99048,99062,99166,99194,99246,99286,99350,99366,99372,99386,99398,99416,99438,99442,99444,99462,99504,99518,99534,99548,99554,99556,99560,99574,99590,99596,99608,99632,99646,99680,99708,99726,99740,99768,99778,99780,99784,99792,99806,99814,99820,99834,99858,99860,99874,99880,99894,99906,99920,99934,99962,99970,99972,99976,99984,99998,1e5,100028,100038,100044,100056,100078,100082,100084,100142,100174,100188,100246,100262,100268,100306,100308,100390,100396,100410,100422,100428,100440,100462,100466,100468,100486,100504,100528,100542,100558,100572,100578,100580,100584,100598,100620,100656,100670,100704,100732,100750,100792,100802,100808,100816,100830,100838,100844,100858,100888,100912,100926,100960,100988,101056,101112,101148,101176,101232,101246,101250,101252,101256,101264,101278,101280,101308,101318,101324,101336,101358,101362,101364,101410,101412,101416,101430,101442,101448,101456,101470,101478,101498,101506,101508,101520,101534,101536,101564,101580,101618,101620,101636,101640,101648,101662,101664,101692,101696,101752,101766,101784,101838,101858,101860,101864,101934,101938,101940,101966,101980,101986,101988,101992,102030,102044,102072,102082,102084,102088,102096,102138,102166,102182,102188,102214,102220,102232,102254,102282,102290,102292,102306,102308,102312,102326,102444,102458,102470,102476,102488,102514,102516,102534,102552,102576,102590,102606,102620,102626,102632,102646,102662,102668,102704,102718,102752,102780,102798,102812,102840,102850,102856,102864,102878,102886,102892,102906,102936,102974,103008,103036,103104,103160,103224,103280,103294,103298,103300,103312,103326,103328,103356,103366,103372,103384,103406,103410,103412,103472,103486,103520,103548,103616,103672,103920,103992,104048,104062,104160,104188,104194,104196,104200,104208,104224,104252,104256,104312,104326,104332,104344,104368,104382,104398,104412,104418,104420,104424,104482,104484,104514,104520,104528,104542,104550,104570,104578,104580,104592,104606,104608,104636,104652,104690,104692,104706,104712,104734,104736,104764,104768,104824,104838,104856,104910,104930,104932,104936,104968,104976,104990,104992,105020,105024,105080,105200,105240,105278,105312,105372,105410,105412,105416,105424,105446,105518,105524,105550,105564,105570,105572,105576,105614,105628,105656,105666,105672,105680,105702,105722,105742,105756,105784,105840,105854,105858,105860,105864,105872,105888,105932,105970,105972,106006,106022,106028,106054,106060,106072,106100,106118,106124,106136,106160,106174,106190,106210,106212,106216,106250,106258,106260,106274,106276,106280,106306,106308,106312,106320,106334,106348,106394,106414,106418,106420,106566,106572,106610,106612,106630,106636,106648,106672,106686,106722,106724,106728,106742,106758,106764,106776,106800,106814,106848,106876,106894,106908,106936,106946,106948,106952,106960,106974,106982,106988,107032,107056,107070,107104,107132,107200,107256,107292,107320,107376,107390,107394,107396,107400,107408,107422,107424,107452,107462,107468,107480,107502,107506,107508,107544,107568,107582,107616,107644,107712,107768,108016,108060,108088,108144,108158,108256,108284,108290,108292,108296,108304,108318,108320,108348,108352,108408,108422,108428,108440,108464,108478,108494,108508,108514,108516,108520,108592,108640,108668,108736,108792,109040,109536,109680,109694,109792,109820,110016,110072,110084,110088,110096,110112,110140,110144,110200,110320,110342,110348,110360,110384,110398,110432,110460,110478,110492,110520,110532,110536,110544,110558,110658,110686,110714,110722,110724,110728,110736,110750,110752,110780,110796,110834,110836,110850,110852,110856,110864,110878,110880,110908,110912,110968,110982,111e3,111054,111074,111076,111080,111108,111112,111120,111134,111136,111164,111168,111224,111344,111372,111422,111456,111516,111554,111556,111560,111568,111590,111632,111646,111648,111676,111680,111736,111856,112096,112152,112224,112252,112320,112440,112514,112516,112520,112528,112542,112544,112588,112686,112718,112732,112782,112796,112824,112834,112836,112840,112848,112870,112890,112910,112924,112952,113008,113022,113026,113028,113032,113040,113054,113056,113100,113138,113140,113166,113180,113208,113264,113278,113376,113404,113416,113424,113440,113468,113472,113560,113614,113634,113636,113640,113686,113702,113708,113734,113740,113752,113778,113780,113798,113804,113816,113840,113854,113870,113890,113892,113896,113926,113932,113944,113968,113982,114016,114044,114076,114114,114116,114120,114128,114150,114170,114194,114196,114210,114212,114216,114242,114244,114248,114256,114270,114278,114306,114308,114312,114320,114334,114336,114364,114380,114420,114458,114478,114482,114484,114510,114524,114530,114532,114536,114842,114866,114868,114970,114994,114996,115042,115044,115048,115062,115130,115226,115250,115252,115278,115292,115298,115300,115304,115318,115342,115394,115396,115400,115408,115422,115430,115436,115450,115478,115494,115514,115526,115532,115570,115572,115738,115758,115762,115764,115790,115804,115810,115812,115816,115830,115854,115868,115896,115906,115912,115920,115934,115942,115948,115962,115996,116024,116080,116094,116098,116100,116104,116112,116126,116128,116156,116166,116172,116184,116206,116210,116212,116246,116262,116268,116282,116294,116300,116312,116334,116338,116340,116358,116364,116376,116400,116414,116430,116444,116450,116452,116456,116498,116500,116514,116520,116534,116546,116548,116552,116560,116574,116582,116588,116602,116654,116694,116714,116762,116782,116786,116788,116814,116828,116834,116836,116840,116854,116878,116892,116920,116930,116936,116944,116958,116966,116972,116986,117006,117048,117104,117118,117122,117124,117136,117150,117152,117180,117190,117196,117208,117230,117234,117236,117304,117360,117374,117472,117500,117506,117508,117512,117520,117536,117564,117568,117624,117638,117644,117656,117680,117694,117710,117724,117730,117732,117736,117750,117782,117798,117804,117818,117830,117848,117874,117876,117894,117936,117950,117966,117986,117988,117992,118022,118028,118040,118064,118078,118112,118140,118172,118210,118212,118216,118224,118238,118246,118266,118306,118312,118338,118352,118366,118374,118394,118402,118404,118408,118416,118430,118432,118460,118476,118514,118516,118574,118578,118580,118606,118620,118626,118628,118632,118678,118694,118700,118730,118738,118740,118830,118834,118836,118862,118876,118882,118884,118888,118902,118926,118940,118968,118978,118980,118984,118992,119006,119014,119020,119034,119068,119096,119152,119166,119170,119172,119176,119184,119198,119200,119228,119238,119244,119256,119278,119282,119284,119324,119352,119408,119422,119520,119548,119554,119556,119560,119568,119582,119584,119612,119616,119672,119686,119692,119704,119728,119742,119758,119772,119778,119780,119784,119798,119920,119934,120032,120060,120256,120312,120324,120328,120336,120352,120384,120440,120560,120582,120588,120600,120624,120638,120672,120700,120718,120732,120760,120770,120772,120776,120784,120798,120806,120812,120870,120876,120890,120902,120908,120920,120946,120948,120966,120972,120984,121008,121022,121038,121058,121060,121064,121078,121100,121112,121136,121150,121184,121212,121244,121282,121284,121288,121296,121318,121338,121356,121368,121392,121406,121440,121468,121536,121592,121656,121730,121732,121736,121744,121758,121760,121804,121842,121844,121890,121922,121924,121928,121936,121950,121958,121978,121986,121988,121992,122e3,122014,122016,122044,122060,122098,122100,122116,122120,122128,122142,122144,122172,122176,122232,122246,122264,122318,122338,122340,122344,122414,122418,122420,122446,122460,122466,122468,122472,122510,122524,122552,122562,122564,122568,122576,122598,122618,122646,122662,122668,122694,122700,122712,122738,122740,122762,122770,122772,122786,122788,122792,123018,123026,123028,123042,123044,123048,123062,123098,123146,123154,123156,123170,123172,123176,123190,123202,123204,123208,123216,123238,123244,123258,123290,123314,123316,123402,123410,123412,123426,123428,123432,123446,123458,123464,123472,123486,123494,123500,123514,123522,123524,123528,123536,123552,123580,123590,123596,123608,123630,123634,123636,123674,123698,123700,123740,123746,123748,123752,123834,123914,123922,123924,123938,123944,123958,123970,123976,123984,123998,124006,124012,124026,124034,124036,124048,124062,124064,124092,124102,124108,124120,124142,124146,124148,124162,124164,124168,124176,124190,124192,124220,124224,124280,124294,124300,124312,124336,124350,124366,124380,124386,124388,124392,124406,124442,124462,124466,124468,124494,124508,124514,124520,124558,124572,124600,124610,124612,124616,124624,124646,124666,124694,124710,124716,124730,124742,124748,124760,124786,124788,124818,124820,124834,124836,124840,124854,124946,124948,124962,124964,124968,124982,124994,124996,125e3,125008,125022,125030,125036,125050,125058,125060,125064,125072,125086,125088,125116,125126,125132,125144,125166,125170,125172,125186,125188,125192,125200,125216,125244,125248,125304,125318,125324,125336,125360,125374,125390,125404,125410,125412,125416,125430,125444,125448,125456,125472,125504,125560,125680,125702,125708,125720,125744,125758,125792,125820,125838,125852,125880,125890,125892,125896,125904,125918,125926,125932,125978,125998,126002,126004,126030,126044,126050,126052,126056,126094,126108,126136,126146,126148,126152,126160,126182,126202,126222,126236,126264,126320,126334,126338,126340,126344,126352,126366,126368,126412,126450,126452,126486,126502,126508,126522,126534,126540,126552,126574,126578,126580,126598,126604,126616,126640,126654,126670,126684,126690,126692,126696,126738,126754,126756,126760,126774,126786,126788,126792,126800,126814,126822,126828,126842,126894,126898,126900,126934,127126,127142,127148,127162,127178,127186,127188,127254,127270,127276,127290,127302,127308,127320,127342,127346,127348,127370,127378,127380,127394,127396,127400,127450,127510,127526,127532,127546,127558,127576,127598,127602,127604,127622,127628,127640,127664,127678,127694,127708,127714,127716,127720,127734,127754,127762,127764,127778,127784,127810,127812,127816,127824,127838,127846,127866,127898,127918,127922,127924,128022,128038,128044,128058,128070,128076,128088,128110,128114,128116,128134,128140,128152,128176,128190,128206,128220,128226,128228,128232,128246,128262,128268,128280,128304,128318,128352,128380,128398,128412,128440,128450,128452,128456,128464,128478,128486,128492,128506,128522,128530,128532,128546,128548,128552,128566,128578,128580,128584,128592,128606,128614,128634,128642,128644,128648,128656,128670,128672,128700,128716,128754,128756,128794,128814,128818,128820,128846,128860,128866,128868,128872,128886,128918,128934,128940,128954,128978,128980,129178,129198,129202,129204,129238,129258,129306,129326,129330,129332,129358,129372,129378,129380,129384,129398,129430,129446,129452,129466,129482,129490,129492,129562,129582,129586,129588,129614,129628,129634,129636,129640,129654,129678,129692,129720,129730,129732,129736,129744,129758,129766,129772,129814,129830,129836,129850,129862,129868,129880,129902,129906,129908,129930,129938,129940,129954,129956,129960,129974,130010]),Bn.CODEWORD_TABLE=Int32Array.from([2627,1819,2622,2621,1813,1812,2729,2724,2723,2779,2774,2773,902,896,908,868,865,861,859,2511,873,871,1780,835,2493,825,2491,842,837,844,1764,1762,811,810,809,2483,807,2482,806,2480,815,814,813,812,2484,817,816,1745,1744,1742,1746,2655,2637,2635,2626,2625,2623,2628,1820,2752,2739,2737,2728,2727,2725,2730,2785,2783,2778,2777,2775,2780,787,781,747,739,736,2413,754,752,1719,692,689,681,2371,678,2369,700,697,694,703,1688,1686,642,638,2343,631,2341,627,2338,651,646,643,2345,654,652,1652,1650,1647,1654,601,599,2322,596,2321,594,2319,2317,611,610,608,606,2324,603,2323,615,614,612,1617,1616,1614,1612,616,1619,1618,2575,2538,2536,905,901,898,909,2509,2507,2504,870,867,864,860,2512,875,872,1781,2490,2489,2487,2485,1748,836,834,832,830,2494,827,2492,843,841,839,845,1765,1763,2701,2676,2674,2653,2648,2656,2634,2633,2631,2629,1821,2638,2636,2770,2763,2761,2750,2745,2753,2736,2735,2733,2731,1848,2740,2738,2786,2784,591,588,576,569,566,2296,1590,537,534,526,2276,522,2274,545,542,539,548,1572,1570,481,2245,466,2242,462,2239,492,485,482,2249,496,494,1534,1531,1528,1538,413,2196,406,2191,2188,425,419,2202,415,2199,432,430,427,1472,1467,1464,433,1476,1474,368,367,2160,365,2159,362,2157,2155,2152,378,377,375,2166,372,2165,369,2162,383,381,379,2168,1419,1418,1416,1414,385,1411,384,1423,1422,1420,1424,2461,802,2441,2439,790,786,783,794,2409,2406,2403,750,742,738,2414,756,753,1720,2367,2365,2362,2359,1663,693,691,684,2373,680,2370,702,699,696,704,1690,1687,2337,2336,2334,2332,1624,2329,1622,640,637,2344,634,2342,630,2340,650,648,645,2346,655,653,1653,1651,1649,1655,2612,2597,2595,2571,2568,2565,2576,2534,2529,2526,1787,2540,2537,907,904,900,910,2503,2502,2500,2498,1768,2495,1767,2510,2508,2506,869,866,863,2513,876,874,1782,2720,2713,2711,2697,2694,2691,2702,2672,2670,2664,1828,2678,2675,2647,2646,2644,2642,1823,2639,1822,2654,2652,2650,2657,2771,1855,2765,2762,1850,1849,2751,2749,2747,2754,353,2148,344,342,336,2142,332,2140,345,1375,1373,306,2130,299,2128,295,2125,319,314,311,2132,1354,1352,1349,1356,262,257,2101,253,2096,2093,274,273,267,2107,263,2104,280,278,275,1316,1311,1308,1320,1318,2052,202,2050,2044,2040,219,2063,212,2060,208,2055,224,221,2066,1260,1258,1252,231,1248,229,1266,1264,1261,1268,155,1998,153,1996,1994,1991,1988,165,164,2007,162,2006,159,2003,2e3,172,171,169,2012,166,2010,1186,1184,1182,1179,175,1176,173,1192,1191,1189,1187,176,1194,1193,2313,2307,2305,592,589,2294,2292,2289,578,572,568,2297,580,1591,2272,2267,2264,1547,538,536,529,2278,525,2275,547,544,541,1574,1571,2237,2235,2229,1493,2225,1489,478,2247,470,2244,465,2241,493,488,484,2250,498,495,1536,1533,1530,1539,2187,2186,2184,2182,1432,2179,1430,2176,1427,414,412,2197,409,2195,405,2193,2190,426,424,421,2203,418,2201,431,429,1473,1471,1469,1466,434,1477,1475,2478,2472,2470,2459,2457,2454,2462,803,2437,2432,2429,1726,2443,2440,792,789,785,2401,2399,2393,1702,2389,1699,2411,2408,2405,745,741,2415,758,755,1721,2358,2357,2355,2353,1661,2350,1660,2347,1657,2368,2366,2364,2361,1666,690,687,2374,683,2372,701,698,705,1691,1689,2619,2617,2610,2608,2605,2613,2593,2588,2585,1803,2599,2596,2563,2561,2555,1797,2551,1795,2573,2570,2567,2577,2525,2524,2522,2520,1786,2517,1785,2514,1783,2535,2533,2531,2528,1788,2541,2539,906,903,911,2721,1844,2715,2712,1838,1836,2699,2696,2693,2703,1827,1826,1824,2673,2671,2669,2666,1829,2679,2677,1858,1857,2772,1854,1853,1851,1856,2766,2764,143,1987,139,1986,135,133,131,1984,128,1983,125,1981,138,137,136,1985,1133,1132,1130,112,110,1974,107,1973,104,1971,1969,122,121,119,117,1977,114,1976,124,1115,1114,1112,1110,1117,1116,84,83,1953,81,1952,78,1950,1948,1945,94,93,91,1959,88,1958,85,1955,99,97,95,1961,1086,1085,1083,1081,1078,100,1090,1089,1087,1091,49,47,1917,44,1915,1913,1910,1907,59,1926,56,1925,53,1922,1919,66,64,1931,61,1929,1042,1040,1038,71,1035,70,1032,68,1048,1047,1045,1043,1050,1049,12,10,1869,1867,1864,1861,21,1880,19,1877,1874,1871,28,1888,25,1886,22,1883,982,980,977,974,32,30,991,989,987,984,34,995,994,992,2151,2150,2147,2146,2144,356,355,354,2149,2139,2138,2136,2134,1359,343,341,338,2143,335,2141,348,347,346,1376,1374,2124,2123,2121,2119,1326,2116,1324,310,308,305,2131,302,2129,298,2127,320,318,316,313,2133,322,321,1355,1353,1351,1357,2092,2091,2089,2087,1276,2084,1274,2081,1271,259,2102,256,2100,252,2098,2095,272,269,2108,266,2106,281,279,277,1317,1315,1313,1310,282,1321,1319,2039,2037,2035,2032,1203,2029,1200,1197,207,2053,205,2051,201,2049,2046,2043,220,218,2064,215,2062,211,2059,228,226,223,2069,1259,1257,1254,232,1251,230,1267,1265,1263,2316,2315,2312,2311,2309,2314,2304,2303,2301,2299,1593,2308,2306,590,2288,2287,2285,2283,1578,2280,1577,2295,2293,2291,579,577,574,571,2298,582,581,1592,2263,2262,2260,2258,1545,2255,1544,2252,1541,2273,2271,2269,2266,1550,535,532,2279,528,2277,546,543,549,1575,1573,2224,2222,2220,1486,2217,1485,2214,1482,1479,2238,2236,2234,2231,1496,2228,1492,480,477,2248,473,2246,469,2243,490,487,2251,497,1537,1535,1532,2477,2476,2474,2479,2469,2468,2466,2464,1730,2473,2471,2453,2452,2450,2448,1729,2445,1728,2460,2458,2456,2463,805,804,2428,2427,2425,2423,1725,2420,1724,2417,1722,2438,2436,2434,2431,1727,2444,2442,793,791,788,795,2388,2386,2384,1697,2381,1696,2378,1694,1692,2402,2400,2398,2395,1703,2392,1701,2412,2410,2407,751,748,744,2416,759,757,1807,2620,2618,1806,1805,2611,2609,2607,2614,1802,1801,1799,2594,2592,2590,2587,1804,2600,2598,1794,1793,1791,1789,2564,2562,2560,2557,1798,2554,1796,2574,2572,2569,2578,1847,1846,2722,1843,1842,1840,1845,2716,2714,1835,1834,1832,1830,1839,1837,2700,2698,2695,2704,1817,1811,1810,897,862,1777,829,826,838,1760,1758,808,2481,1741,1740,1738,1743,2624,1818,2726,2776,782,740,737,1715,686,679,695,1682,1680,639,628,2339,647,644,1645,1643,1640,1648,602,600,597,595,2320,593,2318,609,607,604,1611,1610,1608,1606,613,1615,1613,2328,926,924,892,886,899,857,850,2505,1778,824,823,821,819,2488,818,2486,833,831,828,840,1761,1759,2649,2632,2630,2746,2734,2732,2782,2781,570,567,1587,531,527,523,540,1566,1564,476,467,463,2240,486,483,1524,1521,1518,1529,411,403,2192,399,2189,423,416,1462,1457,1454,428,1468,1465,2210,366,363,2158,360,2156,357,2153,376,373,370,2163,1410,1409,1407,1405,382,1402,380,1417,1415,1412,1421,2175,2174,777,774,771,784,732,725,722,2404,743,1716,676,674,668,2363,665,2360,685,1684,1681,626,624,622,2335,620,2333,617,2330,641,635,649,1646,1644,1642,2566,928,925,2530,2527,894,891,888,2501,2499,2496,858,856,854,851,1779,2692,2668,2665,2645,2643,2640,2651,2768,2759,2757,2744,2743,2741,2748,352,1382,340,337,333,1371,1369,307,300,296,2126,315,312,1347,1342,1350,261,258,250,2097,246,2094,271,268,264,1306,1301,1298,276,1312,1309,2115,203,2048,195,2045,191,2041,213,209,2056,1246,1244,1238,225,1234,222,1256,1253,1249,1262,2080,2079,154,1997,150,1995,147,1992,1989,163,160,2004,156,2001,1175,1174,1172,1170,1167,170,1164,167,1185,1183,1180,1177,174,1190,1188,2025,2024,2022,587,586,564,559,556,2290,573,1588,520,518,512,2268,508,2265,530,1568,1565,461,457,2233,450,2230,446,2226,479,471,489,1526,1523,1520,397,395,2185,392,2183,389,2180,2177,410,2194,402,422,1463,1461,1459,1456,1470,2455,799,2433,2430,779,776,773,2397,2394,2390,734,728,724,746,1717,2356,2354,2351,2348,1658,677,675,673,670,667,688,1685,1683,2606,2589,2586,2559,2556,2552,927,2523,2521,2518,2515,1784,2532,895,893,890,2718,2709,2707,2689,2687,2684,2663,2662,2660,2658,1825,2667,2769,1852,2760,2758,142,141,1139,1138,134,132,129,126,1982,1129,1128,1126,1131,113,111,108,105,1972,101,1970,120,118,115,1109,1108,1106,1104,123,1113,1111,82,79,1951,75,1949,72,1946,92,89,86,1956,1077,1076,1074,1072,98,1069,96,1084,1082,1079,1088,1968,1967,48,45,1916,42,1914,39,1911,1908,60,57,54,1923,50,1920,1031,1030,1028,1026,67,1023,65,1020,62,1041,1039,1036,1033,69,1046,1044,1944,1943,1941,11,9,1868,7,1865,1862,1859,20,1878,16,1875,13,1872,970,968,966,963,29,960,26,23,983,981,978,975,33,971,31,990,988,985,1906,1904,1902,993,351,2145,1383,331,330,328,326,2137,323,2135,339,1372,1370,294,293,291,289,2122,286,2120,283,2117,309,303,317,1348,1346,1344,245,244,242,2090,239,2088,236,2085,2082,260,2099,249,270,1307,1305,1303,1300,1314,189,2038,186,2036,183,2033,2030,2026,206,198,2047,194,216,1247,1245,1243,1240,227,1237,1255,2310,2302,2300,2286,2284,2281,565,563,561,558,575,1589,2261,2259,2256,2253,1542,521,519,517,514,2270,511,533,1569,1567,2223,2221,2218,2215,1483,2211,1480,459,456,453,2232,449,474,491,1527,1525,1522,2475,2467,2465,2451,2449,2446,801,800,2426,2424,2421,2418,1723,2435,780,778,775,2387,2385,2382,2379,1695,2375,1693,2396,735,733,730,727,749,1718,2616,2615,2604,2603,2601,2584,2583,2581,2579,1800,2591,2550,2549,2547,2545,1792,2542,1790,2558,929,2719,1841,2710,2708,1833,1831,2690,2688,2686,1815,1809,1808,1774,1756,1754,1737,1736,1734,1739,1816,1711,1676,1674,633,629,1638,1636,1633,1641,598,1605,1604,1602,1600,605,1609,1607,2327,887,853,1775,822,820,1757,1755,1584,524,1560,1558,468,464,1514,1511,1508,1519,408,404,400,1452,1447,1444,417,1458,1455,2208,364,361,358,2154,1401,1400,1398,1396,374,1393,371,1408,1406,1403,1413,2173,2172,772,726,723,1712,672,669,666,682,1678,1675,625,623,621,618,2331,636,632,1639,1637,1635,920,918,884,880,889,849,848,847,846,2497,855,852,1776,2641,2742,2787,1380,334,1367,1365,301,297,1340,1338,1335,1343,255,251,247,1296,1291,1288,265,1302,1299,2113,204,196,192,2042,1232,1230,1224,214,1220,210,1242,1239,1235,1250,2077,2075,151,148,1993,144,1990,1163,1162,1160,1158,1155,161,1152,157,1173,1171,1168,1165,168,1181,1178,2021,2020,2018,2023,585,560,557,1585,516,509,1562,1559,458,447,2227,472,1516,1513,1510,398,396,393,390,2181,386,2178,407,1453,1451,1449,1446,420,1460,2209,769,764,720,712,2391,729,1713,664,663,661,659,2352,656,2349,671,1679,1677,2553,922,919,2519,2516,885,883,881,2685,2661,2659,2767,2756,2755,140,1137,1136,130,127,1125,1124,1122,1127,109,106,102,1103,1102,1100,1098,116,1107,1105,1980,80,76,73,1947,1068,1067,1065,1063,90,1060,87,1075,1073,1070,1080,1966,1965,46,43,40,1912,36,1909,1019,1018,1016,1014,58,1011,55,1008,51,1029,1027,1024,1021,63,1037,1034,1940,1939,1937,1942,8,1866,4,1863,1,1860,956,954,952,949,946,17,14,969,967,964,961,27,957,24,979,976,972,1901,1900,1898,1896,986,1905,1903,350,349,1381,329,327,324,1368,1366,292,290,287,284,2118,304,1341,1339,1337,1345,243,240,237,2086,233,2083,254,1297,1295,1293,1290,1304,2114,190,187,184,2034,180,2031,177,2027,199,1233,1231,1229,1226,217,1223,1241,2078,2076,584,555,554,552,550,2282,562,1586,507,506,504,502,2257,499,2254,515,1563,1561,445,443,441,2219,438,2216,435,2212,460,454,475,1517,1515,1512,2447,798,797,2422,2419,770,768,766,2383,2380,2376,721,719,717,714,731,1714,2602,2582,2580,2548,2546,2543,923,921,2717,2706,2705,2683,2682,2680,1771,1752,1750,1733,1732,1731,1735,1814,1707,1670,1668,1631,1629,1626,1634,1599,1598,1596,1594,1603,1601,2326,1772,1753,1751,1581,1554,1552,1504,1501,1498,1509,1442,1437,1434,401,1448,1445,2206,1392,1391,1389,1387,1384,359,1399,1397,1394,1404,2171,2170,1708,1672,1669,619,1632,1630,1628,1773,1378,1363,1361,1333,1328,1336,1286,1281,1278,248,1292,1289,2111,1218,1216,1210,197,1206,193,1228,1225,1221,1236,2073,2071,1151,1150,1148,1146,152,1143,149,1140,145,1161,1159,1156,1153,158,1169,1166,2017,2016,2014,2019,1582,510,1556,1553,452,448,1506,1500,394,391,387,1443,1441,1439,1436,1450,2207,765,716,713,1709,662,660,657,1673,1671,916,914,879,878,877,882,1135,1134,1121,1120,1118,1123,1097,1096,1094,1092,103,1101,1099,1979,1059,1058,1056,1054,77,1051,74,1066,1064,1061,1071,1964,1963,1007,1006,1004,1002,999,41,996,37,1017,1015,1012,1009,52,1025,1022,1936,1935,1933,1938,942,940,938,935,932,5,2,955,953,950,947,18,943,15,965,962,958,1895,1894,1892,1890,973,1899,1897,1379,325,1364,1362,288,285,1334,1332,1330,241,238,234,1287,1285,1283,1280,1294,2112,188,185,181,178,2028,1219,1217,1215,1212,200,1209,1227,2074,2072,583,553,551,1583,505,503,500,513,1557,1555,444,442,439,436,2213,455,451,1507,1505,1502,796,763,762,760,767,711,710,708,706,2377,718,715,1710,2544,917,915,2681,1627,1597,1595,2325,1769,1749,1747,1499,1438,1435,2204,1390,1388,1385,1395,2169,2167,1704,1665,1662,1625,1623,1620,1770,1329,1282,1279,2109,1214,1207,1222,2068,2065,1149,1147,1144,1141,146,1157,1154,2013,2011,2008,2015,1579,1549,1546,1495,1487,1433,1431,1428,1425,388,1440,2205,1705,658,1667,1664,1119,1095,1093,1978,1057,1055,1052,1062,1962,1960,1005,1003,1e3,997,38,1013,1010,1932,1930,1927,1934,941,939,936,933,6,930,3,951,948,944,1889,1887,1884,1881,959,1893,1891,35,1377,1360,1358,1327,1325,1322,1331,1277,1275,1272,1269,235,1284,2110,1205,1204,1201,1198,182,1195,179,1213,2070,2067,1580,501,1551,1548,440,437,1497,1494,1490,1503,761,709,707,1706,913,912,2198,1386,2164,2161,1621,1766,2103,1208,2058,2054,1145,1142,2005,2002,1999,2009,1488,1429,1426,2200,1698,1659,1656,1975,1053,1957,1954,1001,998,1924,1921,1918,1928,937,934,931,1879,1876,1873,1870,945,1885,1882,1323,1273,1270,2105,1202,1199,1196,1211,2061,2057,1576,1543,1540,1484,1481,1478,1491,1700]);class _r{constructor(y,E){this.bits=y,this.points=E}getBits(){return this.bits}getPoints(){return this.points}}class sr{static detectMultiple(y,E,O){let $=y.getBlackMatrix(),H=sr.detect(O,$);return H.length||($=$.clone(),$.rotate180(),H=sr.detect(O,$)),new _r($,H)}static detect(y,E){const O=new Array;let $=0,H=0,K=!1;for(;$<E.getHeight();){const le=sr.findVertices(E,$,H);if(le[0]==null&&le[3]==null){if(!K)break;K=!1,H=0;for(const we of O)we[1]!=null&&($=Math.trunc(Math.max($,we[1].getY()))),we[3]!=null&&($=Math.max($,Math.trunc(we[3].getY())));$+=sr.ROW_STEP;continue}if(K=!0,O.push(le),!y)break;le[2]!=null?(H=Math.trunc(le[2].getX()),$=Math.trunc(le[2].getY())):(H=Math.trunc(le[4].getX()),$=Math.trunc(le[4].getY()))}return O}static findVertices(y,E,O){const $=y.getHeight(),H=y.getWidth(),K=new Array(8);return sr.copyToResult(K,sr.findRowsWithPattern(y,$,H,E,O,sr.START_PATTERN),sr.INDEXES_START_PATTERN),K[4]!=null&&(O=Math.trunc(K[4].getX()),E=Math.trunc(K[4].getY())),sr.copyToResult(K,sr.findRowsWithPattern(y,$,H,E,O,sr.STOP_PATTERN),sr.INDEXES_STOP_PATTERN),K}static copyToResult(y,E,O){for(let $=0;$<O.length;$++)y[O[$]]=E[$]}static findRowsWithPattern(y,E,O,$,H,K){const le=new Array(4);let we=!1;const Te=new Int32Array(K.length);for(;$<E;$+=sr.ROW_STEP){let pt=sr.findGuardPattern(y,H,$,O,!1,K,Te);if(pt!=null){for(;$>0;){const _t=sr.findGuardPattern(y,H,--$,O,!1,K,Te);if(_t!=null)pt=_t;else{$++;break}}le[0]=new jt(pt[0],$),le[1]=new jt(pt[1],$),we=!0;break}}let Ze=$+1;if(we){let pt=0,_t=Int32Array.from([Math.trunc(le[0].getX()),Math.trunc(le[1].getX())]);for(;Ze<E;Ze++){const Jt=sr.findGuardPattern(y,_t[0],Ze,O,!1,K,Te);if(Jt!=null&&Math.abs(_t[0]-Jt[0])<sr.MAX_PATTERN_DRIFT&&Math.abs(_t[1]-Jt[1])<sr.MAX_PATTERN_DRIFT)_t=Jt,pt=0;else{if(pt>sr.SKIPPED_ROW_COUNT_MAX)break;pt++}}Ze-=pt+1,le[2]=new jt(_t[0],Ze),le[3]=new jt(_t[1],Ze)}return Ze-$<sr.BARCODE_MIN_HEIGHT&&P.fill(le,null),le}static findGuardPattern(y,E,O,$,H,K,le){P.fillWithin(le,0,le.length,0);let we=E,Te=0;for(;y.get(we,O)&&we>0&&Te++<sr.MAX_PIXEL_DRIFT;)we--;let Ze=we,pt=0,_t=K.length;for(let Jt=H;Ze<$;Ze++)if(y.get(Ze,O)!==Jt)le[pt]++;else{if(pt===_t-1){if(sr.patternMatchVariance(le,K,sr.MAX_INDIVIDUAL_VARIANCE)<sr.MAX_AVG_VARIANCE)return new Int32Array([we,Ze]);we+=le[0]+le[1],w.arraycopy(le,2,le,0,pt-1),le[pt-1]=0,le[pt]=0,pt--}else pt++;le[pt]=1,Jt=!Jt}return pt===_t-1&&sr.patternMatchVariance(le,K,sr.MAX_INDIVIDUAL_VARIANCE)<sr.MAX_AVG_VARIANCE?new Int32Array([we,Ze-1]):null}static patternMatchVariance(y,E,O){let $=y.length,H=0,K=0;for(let Te=0;Te<$;Te++)H+=y[Te],K+=E[Te];if(H<K)return 1/0;let le=H/K;O*=le;let we=0;for(let Te=0;Te<$;Te++){let Ze=y[Te],pt=E[Te]*le,_t=Ze>pt?Ze-pt:pt-Ze;if(_t>O)return 1/0;we+=_t}return we/H}}sr.INDEXES_START_PATTERN=Int32Array.from([0,4,1,5]),sr.INDEXES_STOP_PATTERN=Int32Array.from([6,2,7,3]),sr.MAX_AVG_VARIANCE=.42,sr.MAX_INDIVIDUAL_VARIANCE=.8,sr.START_PATTERN=Int32Array.from([8,1,1,1,1,1,1,3]),sr.STOP_PATTERN=Int32Array.from([7,1,1,3,1,1,1,2,1]),sr.MAX_PIXEL_DRIFT=3,sr.MAX_PATTERN_DRIFT=5,sr.SKIPPED_ROW_COUNT_MAX=25,sr.ROW_STEP=5,sr.BARCODE_MIN_HEIGHT=10;class rr{constructor(y,E){if(E.length===0)throw new f;this.field=y;let O=E.length;if(O>1&&E[0]===0){let $=1;for(;$<O&&E[$]===0;)$++;$===O?this.coefficients=new Int32Array([0]):(this.coefficients=new Int32Array(O-$),w.arraycopy(E,$,this.coefficients,0,this.coefficients.length))}else this.coefficients=E}getCoefficients(){return this.coefficients}getDegree(){return this.coefficients.length-1}isZero(){return this.coefficients[0]===0}getCoefficient(y){return this.coefficients[this.coefficients.length-1-y]}evaluateAt(y){if(y===0)return this.getCoefficient(0);if(y===1){let $=0;for(let H of this.coefficients)$=this.field.add($,H);return $}let E=this.coefficients[0],O=this.coefficients.length;for(let $=1;$<O;$++)E=this.field.add(this.field.multiply(y,E),this.coefficients[$]);return E}add(y){if(!this.field.equals(y.field))throw new f("ModulusPolys do not have same ModulusGF field");if(this.isZero())return y;if(y.isZero())return this;let E=this.coefficients,O=y.coefficients;if(E.length>O.length){let K=E;E=O,O=K}let $=new Int32Array(O.length),H=O.length-E.length;w.arraycopy(O,0,$,0,H);for(let K=H;K<O.length;K++)$[K]=this.field.add(E[K-H],O[K]);return new rr(this.field,$)}subtract(y){if(!this.field.equals(y.field))throw new f("ModulusPolys do not have same ModulusGF field");return y.isZero()?this:this.add(y.negative())}multiply(y){return y instanceof rr?this.multiplyOther(y):this.multiplyScalar(y)}multiplyOther(y){if(!this.field.equals(y.field))throw new f("ModulusPolys do not have same ModulusGF field");if(this.isZero()||y.isZero())return new rr(this.field,new Int32Array([0]));let E=this.coefficients,O=E.length,$=y.coefficients,H=$.length,K=new Int32Array(O+H-1);for(let le=0;le<O;le++){let we=E[le];for(let Te=0;Te<H;Te++)K[le+Te]=this.field.add(K[le+Te],this.field.multiply(we,$[Te]))}return new rr(this.field,K)}negative(){let y=this.coefficients.length,E=new Int32Array(y);for(let O=0;O<y;O++)E[O]=this.field.subtract(0,this.coefficients[O]);return new rr(this.field,E)}multiplyScalar(y){if(y===0)return new rr(this.field,new Int32Array([0]));if(y===1)return this;let E=this.coefficients.length,O=new Int32Array(E);for(let $=0;$<E;$++)O[$]=this.field.multiply(this.coefficients[$],y);return new rr(this.field,O)}multiplyByMonomial(y,E){if(y<0)throw new f;if(E===0)return new rr(this.field,new Int32Array([0]));let O=this.coefficients.length,$=new Int32Array(O+y);for(let H=0;H<O;H++)$[H]=this.field.multiply(this.coefficients[H],E);return new rr(this.field,$)}toString(){let y=new re;for(let E=this.getDegree();E>=0;E--){let O=this.getCoefficient(E);O!==0&&(O<0?(y.append(" - "),O=-O):y.length()>0&&y.append(" + "),(E===0||O!==1)&&y.append(O),E!==0&&(E===1?y.append("x"):(y.append("x^"),y.append(E))))}return y.toString()}}class Rr{add(y,E){return(y+E)%this.modulus}subtract(y,E){return(this.modulus+y-E)%this.modulus}exp(y){return this.expTable[y]}log(y){if(y===0)throw new f;return this.logTable[y]}inverse(y){if(y===0)throw new $e;return this.expTable[this.modulus-this.logTable[y]-1]}multiply(y,E){return y===0||E===0?0:this.expTable[(this.logTable[y]+this.logTable[E])%(this.modulus-1)]}getSize(){return this.modulus}equals(y){return y===this}}class Jr extends Rr{constructor(y,E){super(),this.modulus=y,this.expTable=new Int32Array(y),this.logTable=new Int32Array(y);let O=1;for(let $=0;$<y;$++)this.expTable[$]=O,O=O*E%y;for(let $=0;$<y-1;$++)this.logTable[this.expTable[$]]=$;this.zero=new rr(this,new Int32Array([0])),this.one=new rr(this,new Int32Array([1]))}getZero(){return this.zero}getOne(){return this.one}buildMonomial(y,E){if(y<0)throw new f;if(E===0)return this.zero;let O=new Int32Array(y+1);return O[0]=E,new rr(this,O)}}Jr.PDF417_GF=new Jr(Bn.NUMBER_OF_CODEWORDS,3);class ws{constructor(){this.field=Jr.PDF417_GF}decode(y,E,O){let $=new rr(this.field,y),H=new Int32Array(E),K=!1;for(let Ct=E;Ct>0;Ct--){let Ht=$.evaluateAt(this.field.exp(Ct));H[E-Ct]=Ht,Ht!==0&&(K=!0)}if(!K)return 0;let le=this.field.getOne();if(O!=null)for(const Ct of O){let Ht=this.field.exp(y.length-1-Ct),Kt=new rr(this.field,new Int32Array([this.field.subtract(0,Ht),1]));le=le.multiply(Kt)}let we=new rr(this.field,H),Te=this.runEuclideanAlgorithm(this.field.buildMonomial(E,1),we,E),Ze=Te[0],pt=Te[1],_t=this.findErrorLocations(Ze),Jt=this.findErrorMagnitudes(pt,Ze,_t);for(let Ct=0;Ct<_t.length;Ct++){let Ht=y.length-1-this.field.log(_t[Ct]);if(Ht<0)throw g.getChecksumInstance();y[Ht]=this.field.subtract(y[Ht],Jt[Ct])}return _t.length}runEuclideanAlgorithm(y,E,O){if(y.getDegree()<E.getDegree()){let _t=y;y=E,E=_t}let $=y,H=E,K=this.field.getZero(),le=this.field.getOne();for(;H.getDegree()>=Math.round(O/2);){let _t=$,Jt=K;if($=H,K=le,$.isZero())throw g.getChecksumInstance();H=_t;let Ct=this.field.getZero(),Ht=$.getCoefficient($.getDegree()),Kt=this.field.inverse(Ht);for(;H.getDegree()>=$.getDegree()&&!H.isZero();){let An=H.getDegree()-$.getDegree(),hr=this.field.multiply(H.getCoefficient(H.getDegree()),Kt);Ct=Ct.add(this.field.buildMonomial(An,hr)),H=H.subtract($.multiplyByMonomial(An,hr))}le=Ct.multiply(K).subtract(Jt).negative()}let we=le.getCoefficient(0);if(we===0)throw g.getChecksumInstance();let Te=this.field.inverse(we),Ze=le.multiply(Te),pt=H.multiply(Te);return[Ze,pt]}findErrorLocations(y){let E=y.getDegree(),O=new Int32Array(E),$=0;for(let H=1;H<this.field.getSize()&&$<E;H++)y.evaluateAt(H)===0&&(O[$]=this.field.inverse(H),$++);if($!==E)throw g.getChecksumInstance();return O}findErrorMagnitudes(y,E,O){let $=E.getDegree(),H=new Int32Array($);for(let Te=1;Te<=$;Te++)H[$-Te]=this.field.multiply(Te,E.getCoefficient(Te));let K=new rr(this.field,H),le=O.length,we=new Int32Array(le);for(let Te=0;Te<le;Te++){let Ze=this.field.inverse(O[Te]),pt=this.field.subtract(0,y.evaluateAt(Ze)),_t=this.field.inverse(K.evaluateAt(Ze));we[Te]=this.field.multiply(pt,_t)}return we}}class ls{constructor(y,E,O,$,H){y instanceof ls?this.constructor_2(y):this.constructor_1(y,E,O,$,H)}constructor_1(y,E,O,$,H){const K=E==null||O==null,le=$==null||H==null;if(K&&le)throw new Y;K?(E=new jt(0,$.getY()),O=new jt(0,H.getY())):le&&($=new jt(y.getWidth()-1,E.getY()),H=new jt(y.getWidth()-1,O.getY())),this.image=y,this.topLeft=E,this.bottomLeft=O,this.topRight=$,this.bottomRight=H,this.minX=Math.trunc(Math.min(E.getX(),O.getX())),this.maxX=Math.trunc(Math.max($.getX(),H.getX())),this.minY=Math.trunc(Math.min(E.getY(),$.getY())),this.maxY=Math.trunc(Math.max(O.getY(),H.getY()))}constructor_2(y){this.image=y.image,this.topLeft=y.getTopLeft(),this.bottomLeft=y.getBottomLeft(),this.topRight=y.getTopRight(),this.bottomRight=y.getBottomRight(),this.minX=y.getMinX(),this.maxX=y.getMaxX(),this.minY=y.getMinY(),this.maxY=y.getMaxY()}static merge(y,E){return y==null?E:E==null?y:new ls(y.image,y.topLeft,y.bottomLeft,E.topRight,E.bottomRight)}addMissingRows(y,E,O){let $=this.topLeft,H=this.bottomLeft,K=this.topRight,le=this.bottomRight;if(y>0){let we=O?this.topLeft:this.topRight,Te=Math.trunc(we.getY()-y);Te<0&&(Te=0);let Ze=new jt(we.getX(),Te);O?$=Ze:K=Ze}if(E>0){let we=O?this.bottomLeft:this.bottomRight,Te=Math.trunc(we.getY()+E);Te>=this.image.getHeight()&&(Te=this.image.getHeight()-1);let Ze=new jt(we.getX(),Te);O?H=Ze:le=Ze}return new ls(this.image,$,H,K,le)}getMinX(){return this.minX}getMaxX(){return this.maxX}getMinY(){return this.minY}getMaxY(){return this.maxY}getTopLeft(){return this.topLeft}getTopRight(){return this.topRight}getBottomLeft(){return this.bottomLeft}getBottomRight(){return this.bottomRight}}class et{constructor(y,E,O,$){this.columnCount=y,this.errorCorrectionLevel=$,this.rowCountUpperPart=E,this.rowCountLowerPart=O,this.rowCount=E+O}getColumnCount(){return this.columnCount}getErrorCorrectionLevel(){return this.errorCorrectionLevel}getRowCount(){return this.rowCount}getRowCountUpperPart(){return this.rowCountUpperPart}getRowCountLowerPart(){return this.rowCountLowerPart}}class yt{constructor(){this.buffer=""}static form(y,E){let O=-1;function $(K,le,we,Te,Ze,pt){if(K==="%%")return"%";if(E[++O]===void 0)return;K=Te?parseInt(Te.substr(1)):void 0;let _t=Ze?parseInt(Ze.substr(1)):void 0,Jt;switch(pt){case"s":Jt=E[O];break;case"c":Jt=E[O][0];break;case"f":Jt=parseFloat(E[O]).toFixed(K);break;case"p":Jt=parseFloat(E[O]).toPrecision(K);break;case"e":Jt=parseFloat(E[O]).toExponential(K);break;case"x":Jt=parseInt(E[O]).toString(_t||16);break;case"d":Jt=parseFloat(parseInt(E[O],_t||10).toPrecision(K)).toFixed(0);break}Jt=typeof Jt=="object"?JSON.stringify(Jt):(+Jt).toString(_t);let Ct=parseInt(we),Ht=we&&we[0]+""=="0"?"0":" ";for(;Jt.length<Ct;)Jt=le!==void 0?Jt+Ht:Ht+Jt;return Jt}let H=/%(-)?(0?[0-9]+)?([.][0-9]+)?([#][0-9]+)?([scfpexd%])/g;return y.replace(H,$)}format(y,...E){this.buffer+=yt.form(y,E)}toString(){return this.buffer}}class Tn{constructor(y){this.boundingBox=new ls(y),this.codewords=new Array(y.getMaxY()-y.getMinY()+1)}getCodewordNearby(y){let E=this.getCodeword(y);if(E!=null)return E;for(let O=1;O<Tn.MAX_NEARBY_DISTANCE;O++){let $=this.imageRowToCodewordIndex(y)-O;if($>=0&&(E=this.codewords[$],E!=null)||($=this.imageRowToCodewordIndex(y)+O,$<this.codewords.length&&(E=this.codewords[$],E!=null)))return E}return null}imageRowToCodewordIndex(y){return y-this.boundingBox.getMinY()}setCodeword(y,E){this.codewords[this.imageRowToCodewordIndex(y)]=E}getCodeword(y){return this.codewords[this.imageRowToCodewordIndex(y)]}getBoundingBox(){return this.boundingBox}getCodewords(){return this.codewords}toString(){const y=new yt;let E=0;for(const O of this.codewords){if(O==null){y.format("%3d: | %n",E++);continue}y.format("%3d: %3d|%3d%n",E++,O.getRowNumber(),O.getValue())}return y.toString()}}Tn.MAX_NEARBY_DISTANCE=5;class tr{constructor(){this.values=new Map}setValue(y){y=Math.trunc(y);let E=this.values.get(y);E==null&&(E=0),E++,this.values.set(y,E)}getValue(){let y=-1,E=new Array;for(const[O,$]of this.values.entries()){const H={getKey:()=>O,getValue:()=>$};H.getValue()>y?(y=H.getValue(),E=[],E.push(H.getKey())):H.getValue()===y&&E.push(H.getKey())}return Bn.toIntArray(E)}getConfidence(y){return this.values.get(y)}}class Ar extends Tn{constructor(y,E){super(y),this._isLeft=E}setRowNumbers(){for(let y of this.getCodewords())y!=null&&y.setRowNumberAsRowIndicatorColumn()}adjustCompleteIndicatorColumnRowNumbers(y){let E=this.getCodewords();this.setRowNumbers(),this.removeIncorrectCodewords(E,y);let O=this.getBoundingBox(),$=this._isLeft?O.getTopLeft():O.getTopRight(),H=this._isLeft?O.getBottomLeft():O.getBottomRight(),K=this.imageRowToCodewordIndex(Math.trunc($.getY())),le=this.imageRowToCodewordIndex(Math.trunc(H.getY())),we=-1,Te=1,Ze=0;for(let pt=K;pt<le;pt++){if(E[pt]==null)continue;let _t=E[pt],Jt=_t.getRowNumber()-we;if(Jt===0)Ze++;else if(Jt===1)Te=Math.max(Te,Ze),Ze=1,we=_t.getRowNumber();else if(Jt<0||_t.getRowNumber()>=y.getRowCount()||Jt>pt)E[pt]=null;else{let Ct;Te>2?Ct=(Te-2)*Jt:Ct=Jt;let Ht=Ct>=pt;for(let Kt=1;Kt<=Ct&&!Ht;Kt++)Ht=E[pt-Kt]!=null;Ht?E[pt]=null:(we=_t.getRowNumber(),Ze=1)}}}getRowHeights(){let y=this.getBarcodeMetadata();if(y==null)return null;this.adjustIncompleteIndicatorColumnRowNumbers(y);let E=new Int32Array(y.getRowCount());for(let O of this.getCodewords())if(O!=null){let $=O.getRowNumber();if($>=E.length)continue;E[$]++}return E}adjustIncompleteIndicatorColumnRowNumbers(y){let E=this.getBoundingBox(),O=this._isLeft?E.getTopLeft():E.getTopRight(),$=this._isLeft?E.getBottomLeft():E.getBottomRight(),H=this.imageRowToCodewordIndex(Math.trunc(O.getY())),K=this.imageRowToCodewordIndex(Math.trunc($.getY())),le=this.getCodewords(),we=-1;for(let Te=H;Te<K;Te++){if(le[Te]==null)continue;let Ze=le[Te];Ze.setRowNumberAsRowIndicatorColumn();let pt=Ze.getRowNumber()-we;pt===0||(pt===1?we=Ze.getRowNumber():Ze.getRowNumber()>=y.getRowCount()?le[Te]=null:we=Ze.getRowNumber())}}getBarcodeMetadata(){let y=this.getCodewords(),E=new tr,O=new tr,$=new tr,H=new tr;for(let le of y){if(le==null)continue;le.setRowNumberAsRowIndicatorColumn();let we=le.getValue()%30,Te=le.getRowNumber();switch(this._isLeft||(Te+=2),Te%3){case 0:O.setValue(we*3+1);break;case 1:H.setValue(we/3),$.setValue(we%3);break;case 2:E.setValue(we+1);break}}if(E.getValue().length===0||O.getValue().length===0||$.getValue().length===0||H.getValue().length===0||E.getValue()[0]<1||O.getValue()[0]+$.getValue()[0]<Bn.MIN_ROWS_IN_BARCODE||O.getValue()[0]+$.getValue()[0]>Bn.MAX_ROWS_IN_BARCODE)return null;let K=new et(E.getValue()[0],O.getValue()[0],$.getValue()[0],H.getValue()[0]);return this.removeIncorrectCodewords(y,K),K}removeIncorrectCodewords(y,E){for(let O=0;O<y.length;O++){let $=y[O];if(y[O]==null)continue;let H=$.getValue()%30,K=$.getRowNumber();if(K>E.getRowCount()){y[O]=null;continue}switch(this._isLeft||(K+=2),K%3){case 0:H*3+1!==E.getRowCountUpperPart()&&(y[O]=null);break;case 1:(Math.trunc(H/3)!==E.getErrorCorrectionLevel()||H%3!==E.getRowCountLowerPart())&&(y[O]=null);break;case 2:H+1!==E.getColumnCount()&&(y[O]=null);break}}}isLeft(){return this._isLeft}toString(){return"IsLeft: "+this._isLeft+`
`+super.toString()}}class Br{constructor(y,E){this.ADJUST_ROW_NUMBER_SKIP=2,this.barcodeMetadata=y,this.barcodeColumnCount=y.getColumnCount(),this.boundingBox=E,this.detectionResultColumns=new Array(this.barcodeColumnCount+2)}getDetectionResultColumns(){this.adjustIndicatorColumnRowNumbers(this.detectionResultColumns[0]),this.adjustIndicatorColumnRowNumbers(this.detectionResultColumns[this.barcodeColumnCount+1]);let y=Bn.MAX_CODEWORDS_IN_BARCODE,E;do E=y,y=this.adjustRowNumbersAndGetCount();while(y>0&&y<E);return this.detectionResultColumns}adjustIndicatorColumnRowNumbers(y){y!=null&&y.adjustCompleteIndicatorColumnRowNumbers(this.barcodeMetadata)}adjustRowNumbersAndGetCount(){let y=this.adjustRowNumbersByRow();if(y===0)return 0;for(let E=1;E<this.barcodeColumnCount+1;E++){let O=this.detectionResultColumns[E].getCodewords();for(let $=0;$<O.length;$++)O[$]!=null&&(O[$].hasValidRowNumber()||this.adjustRowNumbers(E,$,O))}return y}adjustRowNumbersByRow(){return this.adjustRowNumbersFromBothRI(),this.adjustRowNumbersFromLRI()+this.adjustRowNumbersFromRRI()}adjustRowNumbersFromBothRI(){if(this.detectionResultColumns[0]==null||this.detectionResultColumns[this.barcodeColumnCount+1]==null)return;let y=this.detectionResultColumns[0].getCodewords(),E=this.detectionResultColumns[this.barcodeColumnCount+1].getCodewords();for(let O=0;O<y.length;O++)if(y[O]!=null&&E[O]!=null&&y[O].getRowNumber()===E[O].getRowNumber())for(let $=1;$<=this.barcodeColumnCount;$++){let H=this.detectionResultColumns[$].getCodewords()[O];H!=null&&(H.setRowNumber(y[O].getRowNumber()),H.hasValidRowNumber()||(this.detectionResultColumns[$].getCodewords()[O]=null))}}adjustRowNumbersFromRRI(){if(this.detectionResultColumns[this.barcodeColumnCount+1]==null)return 0;let y=0,E=this.detectionResultColumns[this.barcodeColumnCount+1].getCodewords();for(let O=0;O<E.length;O++){if(E[O]==null)continue;let $=E[O].getRowNumber(),H=0;for(let K=this.barcodeColumnCount+1;K>0&&H<this.ADJUST_ROW_NUMBER_SKIP;K--){let le=this.detectionResultColumns[K].getCodewords()[O];le!=null&&(H=Br.adjustRowNumberIfValid($,H,le),le.hasValidRowNumber()||y++)}}return y}adjustRowNumbersFromLRI(){if(this.detectionResultColumns[0]==null)return 0;let y=0,E=this.detectionResultColumns[0].getCodewords();for(let O=0;O<E.length;O++){if(E[O]==null)continue;let $=E[O].getRowNumber(),H=0;for(let K=1;K<this.barcodeColumnCount+1&&H<this.ADJUST_ROW_NUMBER_SKIP;K++){let le=this.detectionResultColumns[K].getCodewords()[O];le!=null&&(H=Br.adjustRowNumberIfValid($,H,le),le.hasValidRowNumber()||y++)}}return y}static adjustRowNumberIfValid(y,E,O){return O==null||O.hasValidRowNumber()||(O.isValidRowNumber(y)?(O.setRowNumber(y),E=0):++E),E}adjustRowNumbers(y,E,O){if(!this.detectionResultColumns[y-1])return;let $=O[E],H=this.detectionResultColumns[y-1].getCodewords(),K=H;this.detectionResultColumns[y+1]!=null&&(K=this.detectionResultColumns[y+1].getCodewords());let le=new Array(14);le[2]=H[E],le[3]=K[E],E>0&&(le[0]=O[E-1],le[4]=H[E-1],le[5]=K[E-1]),E>1&&(le[8]=O[E-2],le[10]=H[E-2],le[11]=K[E-2]),E<O.length-1&&(le[1]=O[E+1],le[6]=H[E+1],le[7]=K[E+1]),E<O.length-2&&(le[9]=O[E+2],le[12]=H[E+2],le[13]=K[E+2]);for(let we of le)if(Br.adjustRowNumber($,we))return}static adjustRowNumber(y,E){return E==null?!1:E.hasValidRowNumber()&&E.getBucket()===y.getBucket()?(y.setRowNumber(E.getRowNumber()),!0):!1}getBarcodeColumnCount(){return this.barcodeColumnCount}getBarcodeRowCount(){return this.barcodeMetadata.getRowCount()}getBarcodeECLevel(){return this.barcodeMetadata.getErrorCorrectionLevel()}setBoundingBox(y){this.boundingBox=y}getBoundingBox(){return this.boundingBox}setDetectionResultColumn(y,E){this.detectionResultColumns[y]=E}getDetectionResultColumn(y){return this.detectionResultColumns[y]}toString(){let y=this.detectionResultColumns[0];y==null&&(y=this.detectionResultColumns[this.barcodeColumnCount+1]);let E=new yt;for(let O=0;O<y.getCodewords().length;O++){E.format("CW %3d:",O);for(let $=0;$<this.barcodeColumnCount+2;$++){if(this.detectionResultColumns[$]==null){E.format(" | ");continue}let H=this.detectionResultColumns[$].getCodewords()[O];if(H==null){E.format(" | ");continue}E.format(" %3d|%3d",H.getRowNumber(),H.getValue())}E.format("%n")}return E.toString()}}class Vr{constructor(y,E,O,$){this.rowNumber=Vr.BARCODE_ROW_UNKNOWN,this.startX=Math.trunc(y),this.endX=Math.trunc(E),this.bucket=Math.trunc(O),this.value=Math.trunc($)}hasValidRowNumber(){return this.isValidRowNumber(this.rowNumber)}isValidRowNumber(y){return y!==Vr.BARCODE_ROW_UNKNOWN&&this.bucket===y%3*3}setRowNumberAsRowIndicatorColumn(){this.rowNumber=Math.trunc(Math.trunc(this.value/30)*3+Math.trunc(this.bucket/3))}getWidth(){return this.endX-this.startX}getStartX(){return this.startX}getEndX(){return this.endX}getBucket(){return this.bucket}getValue(){return this.value}getRowNumber(){return this.rowNumber}setRowNumber(y){this.rowNumber=y}toString(){return this.rowNumber+"|"+this.value}}Vr.BARCODE_ROW_UNKNOWN=-1;class dr{static initialize(){for(let y=0;y<Bn.SYMBOL_TABLE.length;y++){let E=Bn.SYMBOL_TABLE[y],O=E&1;for(let $=0;$<Bn.BARS_IN_MODULE;$++){let H=0;for(;(E&1)===O;)H+=1,E>>=1;O=E&1,dr.RATIOS_TABLE[y]||(dr.RATIOS_TABLE[y]=new Array(Bn.BARS_IN_MODULE)),dr.RATIOS_TABLE[y][Bn.BARS_IN_MODULE-$-1]=Math.fround(H/Bn.MODULES_IN_CODEWORD)}}this.bSymbolTableReady=!0}static getDecodedValue(y){let E=dr.getDecodedCodewordValue(dr.sampleBitCounts(y));return E!==-1?E:dr.getClosestDecodedValue(y)}static sampleBitCounts(y){let E=It.sum(y),O=new Int32Array(Bn.BARS_IN_MODULE),$=0,H=0;for(let K=0;K<Bn.MODULES_IN_CODEWORD;K++){let le=E/(2*Bn.MODULES_IN_CODEWORD)+K*E/Bn.MODULES_IN_CODEWORD;H+y[$]<=le&&(H+=y[$],$++),O[$]++}return O}static getDecodedCodewordValue(y){let E=dr.getBitValue(y);return Bn.getCodeword(E)===-1?-1:E}static getBitValue(y){let E=0;for(let O=0;O<y.length;O++)for(let $=0;$<y[O];$++)E=E<<1|(O%2===0?1:0);return Math.trunc(E)}static getClosestDecodedValue(y){let E=It.sum(y),O=new Array(Bn.BARS_IN_MODULE);if(E>1)for(let K=0;K<O.length;K++)O[K]=Math.fround(y[K]/E);let $=nn.MAX_VALUE,H=-1;this.bSymbolTableReady||dr.initialize();for(let K=0;K<dr.RATIOS_TABLE.length;K++){let le=0,we=dr.RATIOS_TABLE[K];for(let Te=0;Te<Bn.BARS_IN_MODULE;Te++){let Ze=Math.fround(we[Te]-O[Te]);if(le+=Math.fround(Ze*Ze),le>=$)break}le<$&&($=le,H=Bn.SYMBOL_TABLE[K])}return H}}dr.bSymbolTableReady=!1,dr.RATIOS_TABLE=new Array(Bn.SYMBOL_TABLE.length).map(dt=>new Array(Bn.BARS_IN_MODULE));class jr{constructor(){this.segmentCount=-1,this.fileSize=-1,this.timestamp=-1,this.checksum=-1}getSegmentIndex(){return this.segmentIndex}setSegmentIndex(y){this.segmentIndex=y}getFileId(){return this.fileId}setFileId(y){this.fileId=y}getOptionalData(){return this.optionalData}setOptionalData(y){this.optionalData=y}isLastSegment(){return this.lastSegment}setLastSegment(y){this.lastSegment=y}getSegmentCount(){return this.segmentCount}setSegmentCount(y){this.segmentCount=y}getSender(){return this.sender||null}setSender(y){this.sender=y}getAddressee(){return this.addressee||null}setAddressee(y){this.addressee=y}getFileName(){return this.fileName}setFileName(y){this.fileName=y}getFileSize(){return this.fileSize}setFileSize(y){this.fileSize=y}getChecksum(){return this.checksum}setChecksum(y){this.checksum=y}getTimestamp(){return this.timestamp}setTimestamp(y){this.timestamp=y}}class ps{static parseLong(y,E=void 0){return parseInt(y,E)}}class gr extends u{}gr.kind="NullPointerException";class es{writeBytes(y){this.writeBytesOffset(y,0,y.length)}writeBytesOffset(y,E,O){if(y==null)throw new gr;if(E<0||E>y.length||O<0||E+O>y.length||E+O<0)throw new C;if(O===0)return;for(let $=0;$<O;$++)this.write(y[E+$])}flush(){}close(){}}class Gs extends u{}class Es extends es{constructor(y=32){if(super(),this.count=0,y<0)throw new f("Negative initial size: "+y);this.buf=new Uint8Array(y)}ensureCapacity(y){y-this.buf.length>0&&this.grow(y)}grow(y){let O=this.buf.length<<1;if(O-y<0&&(O=y),O<0){if(y<0)throw new Gs;O=I.MAX_VALUE}this.buf=P.copyOfUint8Array(this.buf,O)}write(y){this.ensureCapacity(this.count+1),this.buf[this.count]=y,this.count+=1}writeBytesOffset(y,E,O){if(E<0||E>y.length||O<0||E+O-y.length>0)throw new C;this.ensureCapacity(this.count+O),w.arraycopy(y,E,this.buf,this.count,O),this.count+=O}writeTo(y){y.writeBytesOffset(this.buf,0,this.count)}reset(){this.count=0}toByteArray(){return P.copyOfUint8Array(this.buf,this.count)}size(){return this.count}toString(y){return y?typeof y=="string"?this.toString_string(y):this.toString_number(y):this.toString_void()}toString_void(){return new String(this.buf).toString()}toString_string(y){return new String(this.buf).toString()}toString_number(y){return new String(this.buf).toString()}close(){}}var xr;(function(dt){dt[dt.ALPHA=0]="ALPHA",dt[dt.LOWER=1]="LOWER",dt[dt.MIXED=2]="MIXED",dt[dt.PUNCT=3]="PUNCT",dt[dt.ALPHA_SHIFT=4]="ALPHA_SHIFT",dt[dt.PUNCT_SHIFT=5]="PUNCT_SHIFT"})(xr||(xr={}));function Gt(){if(typeof window<"u")return window.BigInt||null;if(typeof Tu<"u")return Tu.BigInt||null;if(typeof self<"u")return self.BigInt||null;throw new Error("Can't search globals for BigInt!")}let ce;function rt(dt){if(typeof ce>"u"&&(ce=Gt()),ce===null)throw new Error("BigInt is not supported!");return ce(dt)}function Pt(){let dt=[];dt[0]=rt(1);let y=rt(900);dt[1]=y;for(let E=2;E<16;E++)dt[E]=dt[E-1]*y;return dt}class vt{static decode(y,E){let O=new re(""),$=Q.ISO8859_1;O.enableDecoding($);let H=1,K=y[H++],le=new jr;for(;H<y[0];){switch(K){case vt.TEXT_COMPACTION_MODE_LATCH:H=vt.textCompaction(y,H,O);break;case vt.BYTE_COMPACTION_MODE_LATCH:case vt.BYTE_COMPACTION_MODE_LATCH_6:H=vt.byteCompaction(K,y,$,H,O);break;case vt.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:O.append(y[H++]);break;case vt.NUMERIC_COMPACTION_MODE_LATCH:H=vt.numericCompaction(y,H,O);break;case vt.ECI_CHARSET:Q.getCharacterSetECIByValue(y[H++]);break;case vt.ECI_GENERAL_PURPOSE:H+=2;break;case vt.ECI_USER_DEFINED:H++;break;case vt.BEGIN_MACRO_PDF417_CONTROL_BLOCK:H=vt.decodeMacroBlock(y,H,le);break;case vt.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:case vt.MACRO_PDF417_TERMINATOR:throw new L;default:H--,H=vt.textCompaction(y,H,O);break}if(H<y.length)K=y[H++];else throw L.getFormatInstance()}if(O.length()===0)throw L.getFormatInstance();let we=new Ie(null,O.toString(),null,E);return we.setOther(le),we}static decodeMacroBlock(y,E,O){if(E+vt.NUMBER_OF_SEQUENCE_CODEWORDS>y[0])throw L.getFormatInstance();let $=new Int32Array(vt.NUMBER_OF_SEQUENCE_CODEWORDS);for(let le=0;le<vt.NUMBER_OF_SEQUENCE_CODEWORDS;le++,E++)$[le]=y[E];O.setSegmentIndex(I.parseInt(vt.decodeBase900toBase10($,vt.NUMBER_OF_SEQUENCE_CODEWORDS)));let H=new re;E=vt.textCompaction(y,E,H),O.setFileId(H.toString());let K=-1;for(y[E]===vt.BEGIN_MACRO_PDF417_OPTIONAL_FIELD&&(K=E+1);E<y[0];)switch(y[E]){case vt.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:switch(E++,y[E]){case vt.MACRO_PDF417_OPTIONAL_FIELD_FILE_NAME:let le=new re;E=vt.textCompaction(y,E+1,le),O.setFileName(le.toString());break;case vt.MACRO_PDF417_OPTIONAL_FIELD_SENDER:let we=new re;E=vt.textCompaction(y,E+1,we),O.setSender(we.toString());break;case vt.MACRO_PDF417_OPTIONAL_FIELD_ADDRESSEE:let Te=new re;E=vt.textCompaction(y,E+1,Te),O.setAddressee(Te.toString());break;case vt.MACRO_PDF417_OPTIONAL_FIELD_SEGMENT_COUNT:let Ze=new re;E=vt.numericCompaction(y,E+1,Ze),O.setSegmentCount(I.parseInt(Ze.toString()));break;case vt.MACRO_PDF417_OPTIONAL_FIELD_TIME_STAMP:let pt=new re;E=vt.numericCompaction(y,E+1,pt),O.setTimestamp(ps.parseLong(pt.toString()));break;case vt.MACRO_PDF417_OPTIONAL_FIELD_CHECKSUM:let _t=new re;E=vt.numericCompaction(y,E+1,_t),O.setChecksum(I.parseInt(_t.toString()));break;case vt.MACRO_PDF417_OPTIONAL_FIELD_FILE_SIZE:let Jt=new re;E=vt.numericCompaction(y,E+1,Jt),O.setFileSize(ps.parseLong(Jt.toString()));break;default:throw L.getFormatInstance()}break;case vt.MACRO_PDF417_TERMINATOR:E++,O.setLastSegment(!0);break;default:throw L.getFormatInstance()}if(K!==-1){let le=E-K;O.isLastSegment()&&le--,O.setOptionalData(P.copyOfRange(y,K,K+le))}return E}static textCompaction(y,E,O){let $=new Int32Array((y[0]-E)*2),H=new Int32Array((y[0]-E)*2),K=0,le=!1;for(;E<y[0]&&!le;){let we=y[E++];if(we<vt.TEXT_COMPACTION_MODE_LATCH)$[K]=we/30,$[K+1]=we%30,K+=2;else switch(we){case vt.TEXT_COMPACTION_MODE_LATCH:$[K++]=vt.TEXT_COMPACTION_MODE_LATCH;break;case vt.BYTE_COMPACTION_MODE_LATCH:case vt.BYTE_COMPACTION_MODE_LATCH_6:case vt.NUMERIC_COMPACTION_MODE_LATCH:case vt.BEGIN_MACRO_PDF417_CONTROL_BLOCK:case vt.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:case vt.MACRO_PDF417_TERMINATOR:E--,le=!0;break;case vt.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:$[K]=vt.MODE_SHIFT_TO_BYTE_COMPACTION_MODE,we=y[E++],H[K]=we,K++;break}}return vt.decodeTextCompaction($,H,K,O),E}static decodeTextCompaction(y,E,O,$){let H=xr.ALPHA,K=xr.ALPHA,le=0;for(;le<O;){let we=y[le],Te="";switch(H){case xr.ALPHA:if(we<26)Te=String.fromCharCode(65+we);else switch(we){case 26:Te=" ";break;case vt.LL:H=xr.LOWER;break;case vt.ML:H=xr.MIXED;break;case vt.PS:K=H,H=xr.PUNCT_SHIFT;break;case vt.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:$.append(E[le]);break;case vt.TEXT_COMPACTION_MODE_LATCH:H=xr.ALPHA;break}break;case xr.LOWER:if(we<26)Te=String.fromCharCode(97+we);else switch(we){case 26:Te=" ";break;case vt.AS:K=H,H=xr.ALPHA_SHIFT;break;case vt.ML:H=xr.MIXED;break;case vt.PS:K=H,H=xr.PUNCT_SHIFT;break;case vt.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:$.append(E[le]);break;case vt.TEXT_COMPACTION_MODE_LATCH:H=xr.ALPHA;break}break;case xr.MIXED:if(we<vt.PL)Te=vt.MIXED_CHARS[we];else switch(we){case vt.PL:H=xr.PUNCT;break;case 26:Te=" ";break;case vt.LL:H=xr.LOWER;break;case vt.AL:H=xr.ALPHA;break;case vt.PS:K=H,H=xr.PUNCT_SHIFT;break;case vt.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:$.append(E[le]);break;case vt.TEXT_COMPACTION_MODE_LATCH:H=xr.ALPHA;break}break;case xr.PUNCT:if(we<vt.PAL)Te=vt.PUNCT_CHARS[we];else switch(we){case vt.PAL:H=xr.ALPHA;break;case vt.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:$.append(E[le]);break;case vt.TEXT_COMPACTION_MODE_LATCH:H=xr.ALPHA;break}break;case xr.ALPHA_SHIFT:if(H=K,we<26)Te=String.fromCharCode(65+we);else switch(we){case 26:Te=" ";break;case vt.TEXT_COMPACTION_MODE_LATCH:H=xr.ALPHA;break}break;case xr.PUNCT_SHIFT:if(H=K,we<vt.PAL)Te=vt.PUNCT_CHARS[we];else switch(we){case vt.PAL:H=xr.ALPHA;break;case vt.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:$.append(E[le]);break;case vt.TEXT_COMPACTION_MODE_LATCH:H=xr.ALPHA;break}break}Te!==""&&$.append(Te),le++}}static byteCompaction(y,E,O,$,H){let K=new Es,le=0,we=0,Te=!1;switch(y){case vt.BYTE_COMPACTION_MODE_LATCH:let Ze=new Int32Array(6),pt=E[$++];for(;$<E[0]&&!Te;)switch(Ze[le++]=pt,we=900*we+pt,pt=E[$++],pt){case vt.TEXT_COMPACTION_MODE_LATCH:case vt.BYTE_COMPACTION_MODE_LATCH:case vt.NUMERIC_COMPACTION_MODE_LATCH:case vt.BYTE_COMPACTION_MODE_LATCH_6:case vt.BEGIN_MACRO_PDF417_CONTROL_BLOCK:case vt.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:case vt.MACRO_PDF417_TERMINATOR:$--,Te=!0;break;default:if(le%5===0&&le>0){for(let _t=0;_t<6;++_t)K.write(Number(rt(we)>>rt(8*(5-_t))));we=0,le=0}break}$===E[0]&&pt<vt.TEXT_COMPACTION_MODE_LATCH&&(Ze[le++]=pt);for(let _t=0;_t<le;_t++)K.write(Ze[_t]);break;case vt.BYTE_COMPACTION_MODE_LATCH_6:for(;$<E[0]&&!Te;){let _t=E[$++];if(_t<vt.TEXT_COMPACTION_MODE_LATCH)le++,we=900*we+_t;else switch(_t){case vt.TEXT_COMPACTION_MODE_LATCH:case vt.BYTE_COMPACTION_MODE_LATCH:case vt.NUMERIC_COMPACTION_MODE_LATCH:case vt.BYTE_COMPACTION_MODE_LATCH_6:case vt.BEGIN_MACRO_PDF417_CONTROL_BLOCK:case vt.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:case vt.MACRO_PDF417_TERMINATOR:$--,Te=!0;break}if(le%5===0&&le>0){for(let Jt=0;Jt<6;++Jt)K.write(Number(rt(we)>>rt(8*(5-Jt))));we=0,le=0}}break}return H.append(J.decode(K.toByteArray(),O)),$}static numericCompaction(y,E,O){let $=0,H=!1,K=new Int32Array(vt.MAX_NUMERIC_CODEWORDS);for(;E<y[0]&&!H;){let le=y[E++];if(E===y[0]&&(H=!0),le<vt.TEXT_COMPACTION_MODE_LATCH)K[$]=le,$++;else switch(le){case vt.TEXT_COMPACTION_MODE_LATCH:case vt.BYTE_COMPACTION_MODE_LATCH:case vt.BYTE_COMPACTION_MODE_LATCH_6:case vt.BEGIN_MACRO_PDF417_CONTROL_BLOCK:case vt.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:case vt.MACRO_PDF417_TERMINATOR:E--,H=!0;break}($%vt.MAX_NUMERIC_CODEWORDS===0||le===vt.NUMERIC_COMPACTION_MODE_LATCH||H)&&$>0&&(O.append(vt.decodeBase900toBase10(K,$)),$=0)}return E}static decodeBase900toBase10(y,E){let O=rt(0);for(let H=0;H<E;H++)O+=vt.EXP900[E-H-1]*rt(y[H]);let $=O.toString();if($.charAt(0)!=="1")throw new L;return $.substring(1)}}vt.TEXT_COMPACTION_MODE_LATCH=900,vt.BYTE_COMPACTION_MODE_LATCH=901,vt.NUMERIC_COMPACTION_MODE_LATCH=902,vt.BYTE_COMPACTION_MODE_LATCH_6=924,vt.ECI_USER_DEFINED=925,vt.ECI_GENERAL_PURPOSE=926,vt.ECI_CHARSET=927,vt.BEGIN_MACRO_PDF417_CONTROL_BLOCK=928,vt.BEGIN_MACRO_PDF417_OPTIONAL_FIELD=923,vt.MACRO_PDF417_TERMINATOR=922,vt.MODE_SHIFT_TO_BYTE_COMPACTION_MODE=913,vt.MAX_NUMERIC_CODEWORDS=15,vt.MACRO_PDF417_OPTIONAL_FIELD_FILE_NAME=0,vt.MACRO_PDF417_OPTIONAL_FIELD_SEGMENT_COUNT=1,vt.MACRO_PDF417_OPTIONAL_FIELD_TIME_STAMP=2,vt.MACRO_PDF417_OPTIONAL_FIELD_SENDER=3,vt.MACRO_PDF417_OPTIONAL_FIELD_ADDRESSEE=4,vt.MACRO_PDF417_OPTIONAL_FIELD_FILE_SIZE=5,vt.MACRO_PDF417_OPTIONAL_FIELD_CHECKSUM=6,vt.PL=25,vt.LL=27,vt.AS=27,vt.ML=28,vt.AL=28,vt.PS=29,vt.PAL=29,vt.PUNCT_CHARS=`;<>@[\\]_\`~!\r ,:
-.$/"|*()?{}'`,vt.MIXED_CHARS="0123456789&\r ,:#-.$/+%*=^",vt.EXP900=Gt()?Pt():[],vt.NUMBER_OF_SEQUENCE_CODEWORDS=2;class ln{constructor(){}static decode(y,E,O,$,H,K,le){let we=new ls(y,E,O,$,H),Te=null,Ze=null,pt;for(let Ct=!0;;Ct=!1){if(E!=null&&(Te=ln.getRowIndicatorColumn(y,we,E,!0,K,le)),$!=null&&(Ze=ln.getRowIndicatorColumn(y,we,$,!1,K,le)),pt=ln.merge(Te,Ze),pt==null)throw Y.getNotFoundInstance();let Ht=pt.getBoundingBox();if(Ct&&Ht!=null&&(Ht.getMinY()<we.getMinY()||Ht.getMaxY()>we.getMaxY()))we=Ht;else break}pt.setBoundingBox(we);let _t=pt.getBarcodeColumnCount()+1;pt.setDetectionResultColumn(0,Te),pt.setDetectionResultColumn(_t,Ze);let Jt=Te!=null;for(let Ct=1;Ct<=_t;Ct++){let Ht=Jt?Ct:_t-Ct;if(pt.getDetectionResultColumn(Ht)!==void 0)continue;let Kt;Ht===0||Ht===_t?Kt=new Ar(we,Ht===0):Kt=new Tn(we),pt.setDetectionResultColumn(Ht,Kt);let An=-1,hr=An;for(let wr=we.getMinY();wr<=we.getMaxY();wr++){if(An=ln.getStartColumn(pt,Ht,wr,Jt),An<0||An>we.getMaxX()){if(hr===-1)continue;An=hr}let Sr=ln.detectCodeword(y,we.getMinX(),we.getMaxX(),Jt,An,wr,K,le);Sr!=null&&(Kt.setCodeword(wr,Sr),hr=An,K=Math.min(K,Sr.getWidth()),le=Math.max(le,Sr.getWidth()))}}return ln.createDecoderResult(pt)}static merge(y,E){if(y==null&&E==null)return null;let O=ln.getBarcodeMetadata(y,E);if(O==null)return null;let $=ls.merge(ln.adjustBoundingBox(y),ln.adjustBoundingBox(E));return new Br(O,$)}static adjustBoundingBox(y){if(y==null)return null;let E=y.getRowHeights();if(E==null)return null;let O=ln.getMax(E),$=0;for(let le of E)if($+=O-le,le>0)break;let H=y.getCodewords();for(let le=0;$>0&&H[le]==null;le++)$--;let K=0;for(let le=E.length-1;le>=0&&(K+=O-E[le],!(E[le]>0));le--);for(let le=H.length-1;K>0&&H[le]==null;le--)K--;return y.getBoundingBox().addMissingRows($,K,y.isLeft())}static getMax(y){let E=-1;for(let O of y)E=Math.max(E,O);return E}static getBarcodeMetadata(y,E){let O;if(y==null||(O=y.getBarcodeMetadata())==null)return E==null?null:E.getBarcodeMetadata();let $;return E==null||($=E.getBarcodeMetadata())==null?O:O.getColumnCount()!==$.getColumnCount()&&O.getErrorCorrectionLevel()!==$.getErrorCorrectionLevel()&&O.getRowCount()!==$.getRowCount()?null:O}static getRowIndicatorColumn(y,E,O,$,H,K){let le=new Ar(E,$);for(let we=0;we<2;we++){let Te=we===0?1:-1,Ze=Math.trunc(Math.trunc(O.getX()));for(let pt=Math.trunc(Math.trunc(O.getY()));pt<=E.getMaxY()&&pt>=E.getMinY();pt+=Te){let _t=ln.detectCodeword(y,0,y.getWidth(),$,Ze,pt,H,K);_t!=null&&(le.setCodeword(pt,_t),$?Ze=_t.getStartX():Ze=_t.getEndX())}}return le}static adjustCodewordCount(y,E){let O=E[0][1],$=O.getValue(),H=y.getBarcodeColumnCount()*y.getBarcodeRowCount()-ln.getNumberOfECCodeWords(y.getBarcodeECLevel());if($.length===0){if(H<1||H>Bn.MAX_CODEWORDS_IN_BARCODE)throw Y.getNotFoundInstance();O.setValue(H)}else $[0]!==H&&O.setValue(H)}static createDecoderResult(y){let E=ln.createBarcodeMatrix(y);ln.adjustCodewordCount(y,E);let O=new Array,$=new Int32Array(y.getBarcodeRowCount()*y.getBarcodeColumnCount()),H=[],K=new Array;for(let we=0;we<y.getBarcodeRowCount();we++)for(let Te=0;Te<y.getBarcodeColumnCount();Te++){let Ze=E[we][Te+1].getValue(),pt=we*y.getBarcodeColumnCount()+Te;Ze.length===0?O.push(pt):Ze.length===1?$[pt]=Ze[0]:(K.push(pt),H.push(Ze))}let le=new Array(H.length);for(let we=0;we<le.length;we++)le[we]=H[we];return ln.createDecoderResultFromAmbiguousValues(y.getBarcodeECLevel(),$,Bn.toIntArray(O),Bn.toIntArray(K),le)}static createDecoderResultFromAmbiguousValues(y,E,O,$,H){let K=new Int32Array($.length),le=100;for(;le-- >0;){for(let we=0;we<K.length;we++)E[$[we]]=H[we][K[we]];try{return ln.decodeCodewords(E,y,O)}catch(we){if(!(we instanceof g))throw we}if(K.length===0)throw g.getChecksumInstance();for(let we=0;we<K.length;we++)if(K[we]<H[we].length-1){K[we]++;break}else if(K[we]=0,we===K.length-1)throw g.getChecksumInstance()}throw g.getChecksumInstance()}static createBarcodeMatrix(y){let E=Array.from({length:y.getBarcodeRowCount()},()=>new Array(y.getBarcodeColumnCount()+2));for(let $=0;$<E.length;$++)for(let H=0;H<E[$].length;H++)E[$][H]=new tr;let O=0;for(let $ of y.getDetectionResultColumns()){if($!=null){for(let H of $.getCodewords())if(H!=null){let K=H.getRowNumber();if(K>=0){if(K>=E.length)continue;E[K][O].setValue(H.getValue())}}}O++}return E}static isValidBarcodeColumn(y,E){return E>=0&&E<=y.getBarcodeColumnCount()+1}static getStartColumn(y,E,O,$){let H=$?1:-1,K=null;if(ln.isValidBarcodeColumn(y,E-H)&&(K=y.getDetectionResultColumn(E-H).getCodeword(O)),K!=null)return $?K.getEndX():K.getStartX();if(K=y.getDetectionResultColumn(E).getCodewordNearby(O),K!=null)return $?K.getStartX():K.getEndX();if(ln.isValidBarcodeColumn(y,E-H)&&(K=y.getDetectionResultColumn(E-H).getCodewordNearby(O)),K!=null)return $?K.getEndX():K.getStartX();let le=0;for(;ln.isValidBarcodeColumn(y,E-H);){E-=H;for(let we of y.getDetectionResultColumn(E).getCodewords())if(we!=null)return($?we.getEndX():we.getStartX())+H*le*(we.getEndX()-we.getStartX());le++}return $?y.getBoundingBox().getMinX():y.getBoundingBox().getMaxX()}static detectCodeword(y,E,O,$,H,K,le,we){H=ln.adjustCodewordStartColumn(y,E,O,$,H,K);let Te=ln.getModuleBitCount(y,E,O,$,H,K);if(Te==null)return null;let Ze,pt=It.sum(Te);if($)Ze=H+pt;else{for(let Ct=0;Ct<Te.length/2;Ct++){let Ht=Te[Ct];Te[Ct]=Te[Te.length-1-Ct],Te[Te.length-1-Ct]=Ht}Ze=H,H=Ze-pt}if(!ln.checkCodewordSkew(pt,le,we))return null;let _t=dr.getDecodedValue(Te),Jt=Bn.getCodeword(_t);return Jt===-1?null:new Vr(H,Ze,ln.getCodewordBucketNumber(_t),Jt)}static getModuleBitCount(y,E,O,$,H,K){let le=H,we=new Int32Array(8),Te=0,Ze=$?1:-1,pt=$;for(;($?le<O:le>=E)&&Te<we.length;)y.get(le,K)===pt?(we[Te]++,le+=Ze):(Te++,pt=!pt);return Te===we.length||le===($?O:E)&&Te===we.length-1?we:null}static getNumberOfECCodeWords(y){return 2<<y}static adjustCodewordStartColumn(y,E,O,$,H,K){let le=H,we=$?-1:1;for(let Te=0;Te<2;Te++){for(;($?le>=E:le<O)&&$===y.get(le,K);){if(Math.abs(H-le)>ln.CODEWORD_SKEW_SIZE)return H;le+=we}we=-we,$=!$}return le}static checkCodewordSkew(y,E,O){return E-ln.CODEWORD_SKEW_SIZE<=y&&y<=O+ln.CODEWORD_SKEW_SIZE}static decodeCodewords(y,E,O){if(y.length===0)throw L.getFormatInstance();let $=1<<E+1,H=ln.correctErrors(y,O,$);ln.verifyCodewordCount(y,$);let K=vt.decode(y,""+E);return K.setErrorsCorrected(H),K.setErasures(O.length),K}static correctErrors(y,E,O){if(E!=null&&E.length>O/2+ln.MAX_ERRORS||O<0||O>ln.MAX_EC_CODEWORDS)throw g.getChecksumInstance();return ln.errorCorrection.decode(y,O,E)}static verifyCodewordCount(y,E){if(y.length<4)throw L.getFormatInstance();let O=y[0];if(O>y.length)throw L.getFormatInstance();if(O===0)if(E<y.length)y[0]=y.length-E;else throw L.getFormatInstance()}static getBitCountForCodeword(y){let E=new Int32Array(8),O=0,$=E.length-1;for(;!((y&1)!==O&&(O=y&1,$--,$<0));)E[$]++,y>>=1;return E}static getCodewordBucketNumber(y){return y instanceof Int32Array?this.getCodewordBucketNumber_Int32Array(y):this.getCodewordBucketNumber_number(y)}static getCodewordBucketNumber_number(y){return ln.getCodewordBucketNumber(ln.getBitCountForCodeword(y))}static getCodewordBucketNumber_Int32Array(y){return(y[0]-y[2]+y[4]-y[6]+9)%9}static toString(y){let E=new yt;for(let O=0;O<y.length;O++){E.format("Row %2d: ",O);for(let $=0;$<y[O].length;$++){let H=y[O][$];H.getValue().length===0?E.format(" ",null):E.format("%4d(%2d)",H.getValue()[0],H.getConfidence(H.getValue()[0]))}E.format("%n")}return E.toString()}}ln.CODEWORD_SKEW_SIZE=2,ln.MAX_ERRORS=3,ln.MAX_EC_CODEWORDS=512,ln.errorCorrection=new ws;class mn{decode(y,E=null){let O=mn.decode(y,E,!1);if(O==null||O.length===0||O[0]==null)throw Y.getNotFoundInstance();return O[0]}decodeMultiple(y,E=null){try{return mn.decode(y,E,!0)}catch(O){throw O instanceof L||O instanceof g?Y.getNotFoundInstance():O}}static decode(y,E,O){const $=new Array,H=sr.detectMultiple(y,E,O);for(const K of H.getPoints()){const le=ln.decode(H.getBits(),K[4],K[5],K[6],K[7],mn.getMinCodewordWidth(K),mn.getMaxCodewordWidth(K)),we=new he(le.getText(),le.getRawBytes(),void 0,K,ye.PDF_417);we.putMetadata(je.ERROR_CORRECTION_LEVEL,le.getECLevel());const Te=le.getOther();Te!=null&&we.putMetadata(je.PDF417_EXTRA_METADATA,Te),$.push(we)}return $.map(K=>K)}static getMaxWidth(y,E){return y==null||E==null?0:Math.trunc(Math.abs(y.getX()-E.getX()))}static getMinWidth(y,E){return y==null||E==null?I.MAX_VALUE:Math.trunc(Math.abs(y.getX()-E.getX()))}static getMaxCodewordWidth(y){return Math.floor(Math.max(Math.max(mn.getMaxWidth(y[0],y[4]),mn.getMaxWidth(y[6],y[2])*Bn.MODULES_IN_CODEWORD/Bn.MODULES_IN_STOP_PATTERN),Math.max(mn.getMaxWidth(y[1],y[5]),mn.getMaxWidth(y[7],y[3])*Bn.MODULES_IN_CODEWORD/Bn.MODULES_IN_STOP_PATTERN)))}static getMinCodewordWidth(y){return Math.floor(Math.min(Math.min(mn.getMinWidth(y[0],y[4]),mn.getMinWidth(y[6],y[2])*Bn.MODULES_IN_CODEWORD/Bn.MODULES_IN_STOP_PATTERN),Math.min(mn.getMinWidth(y[1],y[5]),mn.getMinWidth(y[7],y[3])*Bn.MODULES_IN_CODEWORD/Bn.MODULES_IN_STOP_PATTERN)))}reset(){}}class cr extends u{}cr.kind="ReaderException";class Nr{constructor(y,E){this.verbose=y===!0,E&&this.setHints(E)}decode(y,E){return E&&this.setHints(E),this.decodeInternal(y)}decodeWithState(y){return(this.readers===null||this.readers===void 0)&&this.setHints(null),this.decodeInternal(y)}setHints(y){this.hints=y;const E=!r(y)&&y.get(U.TRY_HARDER)===!0,O=r(y)?null:y.get(U.POSSIBLE_FORMATS),$=new Array;if(!r(O)){const H=O.some(K=>K===ye.UPC_A||K===ye.UPC_E||K===ye.EAN_13||K===ye.EAN_8||K===ye.CODABAR||K===ye.CODE_39||K===ye.CODE_93||K===ye.CODE_128||K===ye.ITF||K===ye.RSS_14||K===ye.RSS_EXPANDED);H&&!E&&$.push(new k(y,this.verbose)),O.includes(ye.QR_CODE)&&$.push(new $n),O.includes(ye.DATA_MATRIX)&&$.push(new Fe),O.includes(ye.AZTEC)&&$.push(new Zt),O.includes(ye.PDF_417)&&$.push(new mn),H&&E&&$.push(new k(y,this.verbose))}$.length===0&&(E||$.push(new k(y,this.verbose)),$.push(new $n),$.push(new Fe),$.push(new Zt),$.push(new mn),E&&$.push(new k(y,this.verbose))),this.readers=$}reset(){if(this.readers!==null)for(const y of this.readers)y.reset()}decodeInternal(y){if(this.readers===null)throw new cr("No readers where selected, nothing can be read.");for(const E of this.readers)try{return E.decode(y,this.hints)}catch(O){if(O instanceof cr)continue}throw new Y("No MultiFormat Readers were able to detect the code.")}}class fr extends Ne{constructor(y=null,E=500){const O=new Nr;O.setHints(y),super(O,E)}decodeBitmap(y){return this.reader.decodeWithState(y)}}class ur extends Ne{constructor(y=500){super(new mn,y)}}class Yr extends Ne{constructor(y=500){super(new $n,y)}}var ss;(function(dt){dt[dt.ERROR_CORRECTION=0]="ERROR_CORRECTION",dt[dt.CHARACTER_SET=1]="CHARACTER_SET",dt[dt.DATA_MATRIX_SHAPE=2]="DATA_MATRIX_SHAPE",dt[dt.MIN_SIZE=3]="MIN_SIZE",dt[dt.MAX_SIZE=4]="MAX_SIZE",dt[dt.MARGIN=5]="MARGIN",dt[dt.PDF417_COMPACT=6]="PDF417_COMPACT",dt[dt.PDF417_COMPACTION=7]="PDF417_COMPACTION",dt[dt.PDF417_DIMENSIONS=8]="PDF417_DIMENSIONS",dt[dt.AZTEC_LAYERS=9]="AZTEC_LAYERS",dt[dt.QR_VERSION=10]="QR_VERSION"})(ss||(ss={}));var Ir=ss;class mr{constructor(y){this.field=y,this.cachedGenerators=[],this.cachedGenerators.push(new Qe(y,Int32Array.from([1])))}buildGenerator(y){const E=this.cachedGenerators;if(y>=E.length){let O=E[E.length-1];const $=this.field;for(let H=E.length;H<=y;H++){const K=O.multiply(new Qe($,Int32Array.from([1,$.exp(H-1+$.getGeneratorBase())])));E.push(K),O=K}}return E[y]}encode(y,E){if(E===0)throw new f("No error correction bytes");const O=y.length-E;if(O<=0)throw new f("No data bytes provided");const $=this.buildGenerator(E),H=new Int32Array(O);w.arraycopy(y,0,H,0,O);let K=new Qe(this.field,H);K=K.multiplyByMonomial(E,1);const we=K.divide($)[1].getCoefficients(),Te=E-we.length;for(let Ze=0;Ze<Te;Ze++)y[O+Ze]=0;w.arraycopy(we,0,y,O+Te,we.length)}}class Qn{constructor(){}static applyMaskPenaltyRule1(y){return Qn.applyMaskPenaltyRule1Internal(y,!0)+Qn.applyMaskPenaltyRule1Internal(y,!1)}static applyMaskPenaltyRule2(y){let E=0;const O=y.getArray(),$=y.getWidth(),H=y.getHeight();for(let K=0;K<H-1;K++){const le=O[K];for(let we=0;we<$-1;we++){const Te=le[we];Te===le[we+1]&&Te===O[K+1][we]&&Te===O[K+1][we+1]&&E++}}return Qn.N2*E}static applyMaskPenaltyRule3(y){let E=0;const O=y.getArray(),$=y.getWidth(),H=y.getHeight();for(let K=0;K<H;K++)for(let le=0;le<$;le++){const we=O[K];le+6<$&&we[le]===1&&we[le+1]===0&&we[le+2]===1&&we[le+3]===1&&we[le+4]===1&&we[le+5]===0&&we[le+6]===1&&(Qn.isWhiteHorizontal(we,le-4,le)||Qn.isWhiteHorizontal(we,le+7,le+11))&&E++,K+6<H&&O[K][le]===1&&O[K+1][le]===0&&O[K+2][le]===1&&O[K+3][le]===1&&O[K+4][le]===1&&O[K+5][le]===0&&O[K+6][le]===1&&(Qn.isWhiteVertical(O,le,K-4,K)||Qn.isWhiteVertical(O,le,K+7,K+11))&&E++}return E*Qn.N3}static isWhiteHorizontal(y,E,O){E=Math.max(E,0),O=Math.min(O,y.length);for(let $=E;$<O;$++)if(y[$]===1)return!1;return!0}static isWhiteVertical(y,E,O,$){O=Math.max(O,0),$=Math.min($,y.length);for(let H=O;H<$;H++)if(y[H][E]===1)return!1;return!0}static applyMaskPenaltyRule4(y){let E=0;const O=y.getArray(),$=y.getWidth(),H=y.getHeight();for(let we=0;we<H;we++){const Te=O[we];for(let Ze=0;Ze<$;Ze++)Te[Ze]===1&&E++}const K=y.getHeight()*y.getWidth();return Math.floor(Math.abs(E*2-K)*10/K)*Qn.N4}static getDataMaskBit(y,E,O){let $,H;switch(y){case 0:$=O+E&1;break;case 1:$=O&1;break;case 2:$=E%3;break;case 3:$=(O+E)%3;break;case 4:$=Math.floor(O/2)+Math.floor(E/3)&1;break;case 5:H=O*E,$=(H&1)+H%3;break;case 6:H=O*E,$=(H&1)+H%3&1;break;case 7:H=O*E,$=H%3+(O+E&1)&1;break;default:throw new f("Invalid mask pattern: "+y)}return $===0}static applyMaskPenaltyRule1Internal(y,E){let O=0;const $=E?y.getHeight():y.getWidth(),H=E?y.getWidth():y.getHeight(),K=y.getArray();for(let le=0;le<$;le++){let we=0,Te=-1;for(let Ze=0;Ze<H;Ze++){const pt=E?K[le][Ze]:K[Ze][le];pt===Te?we++:(we>=5&&(O+=Qn.N1+(we-5)),we=1,Te=pt)}we>=5&&(O+=Qn.N1+(we-5))}return O}}Qn.N1=3,Qn.N2=3,Qn.N3=40,Qn.N4=10;class xs{constructor(y,E){this.width=y,this.height=E;const O=new Array(E);for(let $=0;$!==E;$++)O[$]=new Uint8Array(y);this.bytes=O}getHeight(){return this.height}getWidth(){return this.width}get(y,E){return this.bytes[E][y]}getArray(){return this.bytes}setNumber(y,E,O){this.bytes[E][y]=O}setBoolean(y,E,O){this.bytes[E][y]=O?1:0}clear(y){for(const E of this.bytes)P.fill(E,y)}equals(y){if(!(y instanceof xs))return!1;const E=y;if(this.width!==E.width||this.height!==E.height)return!1;for(let O=0,$=this.height;O<$;++O){const H=this.bytes[O],K=E.bytes[O];for(let le=0,we=this.width;le<we;++le)if(H[le]!==K[le])return!1}return!0}toString(){const y=new re;for(let E=0,O=this.height;E<O;++E){const $=this.bytes[E];for(let H=0,K=this.width;H<K;++H)switch($[H]){case 0:y.append(" 0");break;case 1:y.append(" 1");break;default:y.append(" ");break}y.append(`
`)}return y.toString()}}class Xs{constructor(){this.maskPattern=-1}getMode(){return this.mode}getECLevel(){return this.ecLevel}getVersion(){return this.version}getMaskPattern(){return this.maskPattern}getMatrix(){return this.matrix}toString(){const y=new re;return y.append(`<<
`),y.append(" mode: "),y.append(this.mode?this.mode.toString():"null"),y.append(`
ecLevel: `),y.append(this.ecLevel?this.ecLevel.toString():"null"),y.append(`
version: `),y.append(this.version?this.version.toString():"null"),y.append(`
maskPattern: `),y.append(this.maskPattern.toString()),this.matrix?(y.append(`
matrix:
`),y.append(this.matrix.toString())):y.append(`
matrix: null
`),y.append(`>>
`),y.toString()}setMode(y){this.mode=y}setECLevel(y){this.ecLevel=y}setVersion(y){this.version=y}setMaskPattern(y){this.maskPattern=y}setMatrix(y){this.matrix=y}static isValidMaskPattern(y){return y>=0&&y<Xs.NUM_MASK_PATTERNS}}Xs.NUM_MASK_PATTERNS=8;class ii extends u{}ii.kind="WriterException";class Pr{constructor(){}static clearMatrix(y){y.clear(255)}static buildMatrix(y,E,O,$,H){Pr.clearMatrix(H),Pr.embedBasicPatterns(O,H),Pr.embedTypeInfo(E,$,H),Pr.maybeEmbedVersionInfo(O,H),Pr.embedDataBits(y,$,H)}static embedBasicPatterns(y,E){Pr.embedPositionDetectionPatternsAndSeparators(E),Pr.embedDarkDotAtLeftBottomCorner(E),Pr.maybeEmbedPositionAdjustmentPatterns(y,E),Pr.embedTimingPatterns(E)}static embedTypeInfo(y,E,O){const $=new R;Pr.makeTypeInfoBits(y,E,$);for(let H=0,K=$.getSize();H<K;++H){const le=$.get($.getSize()-1-H),we=Pr.TYPE_INFO_COORDINATES[H],Te=we[0],Ze=we[1];if(O.setBoolean(Te,Ze,le),H<8){const pt=O.getWidth()-H-1;O.setBoolean(pt,8,le)}else{const _t=O.getHeight()-7+(H-8);O.setBoolean(8,_t,le)}}}static maybeEmbedVersionInfo(y,E){if(y.getVersionNumber()<7)return;const O=new R;Pr.makeVersionInfoBits(y,O);let $=6*3-1;for(let H=0;H<6;++H)for(let K=0;K<3;++K){const le=O.get($);$--,E.setBoolean(H,E.getHeight()-11+K,le),E.setBoolean(E.getHeight()-11+K,H,le)}}static embedDataBits(y,E,O){let $=0,H=-1,K=O.getWidth()-1,le=O.getHeight()-1;for(;K>0;){for(K===6&&(K-=1);le>=0&&le<O.getHeight();){for(let we=0;we<2;++we){const Te=K-we;if(!Pr.isEmpty(O.get(Te,le)))continue;let Ze;$<y.getSize()?(Ze=y.get($),++$):Ze=!1,E!==255&&Qn.getDataMaskBit(E,Te,le)&&(Ze=!Ze),O.setBoolean(Te,le,Ze)}le+=H}H=-H,le+=H,K-=2}if($!==y.getSize())throw new ii("Not all bits consumed: "+$+"/"+y.getSize())}static findMSBSet(y){return 32-I.numberOfLeadingZeros(y)}static calculateBCHCode(y,E){if(E===0)throw new f("0 polynomial");const O=Pr.findMSBSet(E);for(y<<=O-1;Pr.findMSBSet(y)>=O;)y^=E<<Pr.findMSBSet(y)-O;return y}static makeTypeInfoBits(y,E,O){if(!Xs.isValidMaskPattern(E))throw new ii("Invalid mask pattern");const $=y.getBits()<<3|E;O.appendBits($,5);const H=Pr.calculateBCHCode($,Pr.TYPE_INFO_POLY);O.appendBits(H,10);const K=new R;if(K.appendBits(Pr.TYPE_INFO_MASK_PATTERN,15),O.xor(K),O.getSize()!==15)throw new ii("should not happen but we got: "+O.getSize())}static makeVersionInfoBits(y,E){E.appendBits(y.getVersionNumber(),6);const O=Pr.calculateBCHCode(y.getVersionNumber(),Pr.VERSION_INFO_POLY);if(E.appendBits(O,12),E.getSize()!==18)throw new ii("should not happen but we got: "+E.getSize())}static isEmpty(y){return y===255}static embedTimingPatterns(y){for(let E=8;E<y.getWidth()-8;++E){const O=(E+1)%2;Pr.isEmpty(y.get(E,6))&&y.setNumber(E,6,O),Pr.isEmpty(y.get(6,E))&&y.setNumber(6,E,O)}}static embedDarkDotAtLeftBottomCorner(y){if(y.get(8,y.getHeight()-8)===0)throw new ii;y.setNumber(8,y.getHeight()-8,1)}static embedHorizontalSeparationPattern(y,E,O){for(let $=0;$<8;++$){if(!Pr.isEmpty(O.get(y+$,E)))throw new ii;O.setNumber(y+$,E,0)}}static embedVerticalSeparationPattern(y,E,O){for(let $=0;$<7;++$){if(!Pr.isEmpty(O.get(y,E+$)))throw new ii;O.setNumber(y,E+$,0)}}static embedPositionAdjustmentPattern(y,E,O){for(let $=0;$<5;++$){const H=Pr.POSITION_ADJUSTMENT_PATTERN[$];for(let K=0;K<5;++K)O.setNumber(y+K,E+$,H[K])}}static embedPositionDetectionPattern(y,E,O){for(let $=0;$<7;++$){const H=Pr.POSITION_DETECTION_PATTERN[$];for(let K=0;K<7;++K)O.setNumber(y+K,E+$,H[K])}}static embedPositionDetectionPatternsAndSeparators(y){const E=Pr.POSITION_DETECTION_PATTERN[0].length;Pr.embedPositionDetectionPattern(0,0,y),Pr.embedPositionDetectionPattern(y.getWidth()-E,0,y),Pr.embedPositionDetectionPattern(0,y.getWidth()-E,y);const O=8;Pr.embedHorizontalSeparationPattern(0,O-1,y),Pr.embedHorizontalSeparationPattern(y.getWidth()-O,O-1,y),Pr.embedHorizontalSeparationPattern(0,y.getWidth()-O,y);const $=7;Pr.embedVerticalSeparationPattern($,0,y),Pr.embedVerticalSeparationPattern(y.getHeight()-$-1,0,y),Pr.embedVerticalSeparationPattern($,y.getHeight()-$,y)}static maybeEmbedPositionAdjustmentPatterns(y,E){if(y.getVersionNumber()<2)return;const O=y.getVersionNumber()-1,$=Pr.POSITION_ADJUSTMENT_PATTERN_COORDINATE_TABLE[O];for(let H=0,K=$.length;H!==K;H++){const le=$[H];if(le>=0)for(let we=0;we!==K;we++){const Te=$[we];Te>=0&&Pr.isEmpty(E.get(Te,le))&&Pr.embedPositionAdjustmentPattern(Te-2,le-2,E)}}}}Pr.POSITION_DETECTION_PATTERN=Array.from([Int32Array.from([1,1,1,1,1,1,1]),Int32Array.from([1,0,0,0,0,0,1]),Int32Array.from([1,0,1,1,1,0,1]),Int32Array.from([1,0,1,1,1,0,1]),Int32Array.from([1,0,1,1,1,0,1]),Int32Array.from([1,0,0,0,0,0,1]),Int32Array.from([1,1,1,1,1,1,1])]),Pr.POSITION_ADJUSTMENT_PATTERN=Array.from([Int32Array.from([1,1,1,1,1]),Int32Array.from([1,0,0,0,1]),Int32Array.from([1,0,1,0,1]),Int32Array.from([1,0,0,0,1]),Int32Array.from([1,1,1,1,1])]),Pr.POSITION_ADJUSTMENT_PATTERN_COORDINATE_TABLE=Array.from([Int32Array.from([-1,-1,-1,-1,-1,-1,-1]),Int32Array.from([6,18,-1,-1,-1,-1,-1]),Int32Array.from([6,22,-1,-1,-1,-1,-1]),Int32Array.from([6,26,-1,-1,-1,-1,-1]),Int32Array.from([6,30,-1,-1,-1,-1,-1]),Int32Array.from([6,34,-1,-1,-1,-1,-1]),Int32Array.from([6,22,38,-1,-1,-1,-1]),Int32Array.from([6,24,42,-1,-1,-1,-1]),Int32Array.from([6,26,46,-1,-1,-1,-1]),Int32Array.from([6,28,50,-1,-1,-1,-1]),Int32Array.from([6,30,54,-1,-1,-1,-1]),Int32Array.from([6,32,58,-1,-1,-1,-1]),Int32Array.from([6,34,62,-1,-1,-1,-1]),Int32Array.from([6,26,46,66,-1,-1,-1]),Int32Array.from([6,26,48,70,-1,-1,-1]),Int32Array.from([6,26,50,74,-1,-1,-1]),Int32Array.from([6,30,54,78,-1,-1,-1]),Int32Array.from([6,30,56,82,-1,-1,-1]),Int32Array.from([6,30,58,86,-1,-1,-1]),Int32Array.from([6,34,62,90,-1,-1,-1]),Int32Array.from([6,28,50,72,94,-1,-1]),Int32Array.from([6,26,50,74,98,-1,-1]),Int32Array.from([6,30,54,78,102,-1,-1]),Int32Array.from([6,28,54,80,106,-1,-1]),Int32Array.from([6,32,58,84,110,-1,-1]),Int32Array.from([6,30,58,86,114,-1,-1]),Int32Array.from([6,34,62,90,118,-1,-1]),Int32Array.from([6,26,50,74,98,122,-1]),Int32Array.from([6,30,54,78,102,126,-1]),Int32Array.from([6,26,52,78,104,130,-1]),Int32Array.from([6,30,56,82,108,134,-1]),Int32Array.from([6,34,60,86,112,138,-1]),Int32Array.from([6,30,58,86,114,142,-1]),Int32Array.from([6,34,62,90,118,146,-1]),Int32Array.from([6,30,54,78,102,126,150]),Int32Array.from([6,24,50,76,102,128,154]),Int32Array.from([6,28,54,80,106,132,158]),Int32Array.from([6,32,58,84,110,136,162]),Int32Array.from([6,26,54,82,110,138,166]),Int32Array.from([6,30,58,86,114,142,170])]),Pr.TYPE_INFO_COORDINATES=Array.from([Int32Array.from([8,0]),Int32Array.from([8,1]),Int32Array.from([8,2]),Int32Array.from([8,3]),Int32Array.from([8,4]),Int32Array.from([8,5]),Int32Array.from([8,7]),Int32Array.from([8,8]),Int32Array.from([7,8]),Int32Array.from([5,8]),Int32Array.from([4,8]),Int32Array.from([3,8]),Int32Array.from([2,8]),Int32Array.from([1,8]),Int32Array.from([0,8])]),Pr.VERSION_INFO_POLY=7973,Pr.TYPE_INFO_POLY=1335,Pr.TYPE_INFO_MASK_PATTERN=21522;class vn{constructor(y,E){this.dataBytes=y,this.errorCorrectionBytes=E}getDataBytes(){return this.dataBytes}getErrorCorrectionBytes(){return this.errorCorrectionBytes}}class Mn{constructor(){}static calculateMaskPenalty(y){return Qn.applyMaskPenaltyRule1(y)+Qn.applyMaskPenaltyRule2(y)+Qn.applyMaskPenaltyRule3(y)+Qn.applyMaskPenaltyRule4(y)}static encode(y,E,O=null){let $=Mn.DEFAULT_BYTE_MODE_ENCODING;const H=O!==null&&O.get(Ir.CHARACTER_SET)!==void 0;H&&($=O.get(Ir.CHARACTER_SET).toString());const K=this.chooseMode(y,$),le=new R;if(K===Oe.BYTE&&(H||Mn.DEFAULT_BYTE_MODE_ENCODING!==$)){const wr=Q.getCharacterSetECIByName($);wr!==void 0&&this.appendECI(wr,le)}this.appendModeInfo(K,le);const we=new R;this.appendBytes(y,K,we,$);let Te;if(O!==null&&O.get(Ir.QR_VERSION)!==void 0){const wr=Number.parseInt(O.get(Ir.QR_VERSION).toString(),10);Te=Je.getVersionForNumber(wr);const Sr=this.calculateBitsNeeded(K,le,we,Te);if(!this.willFit(Sr,Te,E))throw new ii("Data too big for requested version")}else Te=this.recommendVersion(E,K,le,we);const Ze=new R;Ze.appendBitArray(le);const pt=K===Oe.BYTE?we.getSizeInBytes():y.length;this.appendLengthInfo(pt,Te,K,Ze),Ze.appendBitArray(we);const _t=Te.getECBlocksForLevel(E),Jt=Te.getTotalCodewords()-_t.getTotalECCodewords();this.terminateBits(Jt,Ze);const Ct=this.interleaveWithECBytes(Ze,Te.getTotalCodewords(),Jt,_t.getNumBlocks()),Ht=new Xs;Ht.setECLevel(E),Ht.setMode(K),Ht.setVersion(Te);const Kt=Te.getDimensionForVersion(),An=new xs(Kt,Kt),hr=this.chooseMaskPattern(Ct,E,Te,An);return Ht.setMaskPattern(hr),Pr.buildMatrix(Ct,E,Te,hr,An),Ht.setMatrix(An),Ht}static recommendVersion(y,E,O,$){const H=this.calculateBitsNeeded(E,O,$,Je.getVersionForNumber(1)),K=this.chooseVersion(H,y),le=this.calculateBitsNeeded(E,O,$,K);return this.chooseVersion(le,y)}static calculateBitsNeeded(y,E,O,$){return E.getSize()+y.getCharacterCountBits($)+O.getSize()}static getAlphanumericCode(y){return y<Mn.ALPHANUMERIC_TABLE.length?Mn.ALPHANUMERIC_TABLE[y]:-1}static chooseMode(y,E=null){if(Q.SJIS.getName()===E&&this.isOnlyDoubleByteKanji(y))return Oe.KANJI;let O=!1,$=!1;for(let H=0,K=y.length;H<K;++H){const le=y.charAt(H);if(Mn.isDigit(le))O=!0;else if(this.getAlphanumericCode(le.charCodeAt(0))!==-1)$=!0;else return Oe.BYTE}return $?Oe.ALPHANUMERIC:O?Oe.NUMERIC:Oe.BYTE}static isOnlyDoubleByteKanji(y){let E;try{E=J.encode(y,Q.SJIS)}catch{return!1}const O=E.length;if(O%2!==0)return!1;for(let $=0;$<O;$+=2){const H=E[$]&255;if((H<129||H>159)&&(H<224||H>235))return!1}return!0}static chooseMaskPattern(y,E,O,$){let H=Number.MAX_SAFE_INTEGER,K=-1;for(let le=0;le<Xs.NUM_MASK_PATTERNS;le++){Pr.buildMatrix(y,E,O,le,$);let we=this.calculateMaskPenalty($);we<H&&(H=we,K=le)}return K}static chooseVersion(y,E){for(let O=1;O<=40;O++){const $=Je.getVersionForNumber(O);if(Mn.willFit(y,$,E))return $}throw new ii("Data too big")}static willFit(y,E,O){const $=E.getTotalCodewords(),K=E.getECBlocksForLevel(O).getTotalECCodewords(),le=$-K,we=(y+7)/8;return le>=we}static terminateBits(y,E){const O=y*8;if(E.getSize()>O)throw new ii("data bits cannot fit in the QR Code"+E.getSize()+" > "+O);for(let K=0;K<4&&E.getSize()<O;++K)E.appendBit(!1);const $=E.getSize()&7;if($>0)for(let K=$;K<8;K++)E.appendBit(!1);const H=y-E.getSizeInBytes();for(let K=0;K<H;++K)E.appendBits(K&1?17:236,8);if(E.getSize()!==O)throw new ii("Bits size does not equal capacity")}static getNumDataBytesAndNumECBytesForBlockID(y,E,O,$,H,K){if($>=O)throw new ii("Block ID too large");const le=y%O,we=O-le,Te=Math.floor(y/O),Ze=Te+1,pt=Math.floor(E/O),_t=pt+1,Jt=Te-pt,Ct=Ze-_t;if(Jt!==Ct)throw new ii("EC bytes mismatch");if(O!==we+le)throw new ii("RS blocks mismatch");if(y!==(pt+Jt)*we+(_t+Ct)*le)throw new ii("Total bytes mismatch");$<we?(H[0]=pt,K[0]=Jt):(H[0]=_t,K[0]=Ct)}static interleaveWithECBytes(y,E,O,$){if(y.getSizeInBytes()!==O)throw new ii("Number of bits and data bytes does not match");let H=0,K=0,le=0;const we=new Array;for(let Ze=0;Ze<$;++Ze){const pt=new Int32Array(1),_t=new Int32Array(1);Mn.getNumDataBytesAndNumECBytesForBlockID(E,O,$,Ze,pt,_t);const Jt=pt[0],Ct=new Uint8Array(Jt);y.toBytes(8*H,Ct,0,Jt);const Ht=Mn.generateECBytes(Ct,_t[0]);we.push(new vn(Ct,Ht)),K=Math.max(K,Jt),le=Math.max(le,Ht.length),H+=pt[0]}if(O!==H)throw new ii("Data bytes does not match offset");const Te=new R;for(let Ze=0;Ze<K;++Ze)for(const pt of we){const _t=pt.getDataBytes();Ze<_t.length&&Te.appendBits(_t[Ze],8)}for(let Ze=0;Ze<le;++Ze)for(const pt of we){const _t=pt.getErrorCorrectionBytes();Ze<_t.length&&Te.appendBits(_t[Ze],8)}if(E!==Te.getSizeInBytes())throw new ii("Interleaving error: "+E+" and "+Te.getSizeInBytes()+" differ.");return Te}static generateECBytes(y,E){const O=y.length,$=new Int32Array(O+E);for(let K=0;K<O;K++)$[K]=y[K]&255;new mr(it.QR_CODE_FIELD_256).encode($,E);const H=new Uint8Array(E);for(let K=0;K<E;K++)H[K]=$[O+K];return H}static appendModeInfo(y,E){E.appendBits(y.getBits(),4)}static appendLengthInfo(y,E,O,$){const H=O.getCharacterCountBits(E);if(y>=1<<H)throw new ii(y+" is bigger than "+((1<<H)-1));$.appendBits(y,H)}static appendBytes(y,E,O,$){switch(E){case Oe.NUMERIC:Mn.appendNumericBytes(y,O);break;case Oe.ALPHANUMERIC:Mn.appendAlphanumericBytes(y,O);break;case Oe.BYTE:Mn.append8BitBytes(y,O,$);break;case Oe.KANJI:Mn.appendKanjiBytes(y,O);break;default:throw new ii("Invalid mode: "+E)}}static getDigit(y){return y.charCodeAt(0)-48}static isDigit(y){const E=Mn.getDigit(y);return E>=0&&E<=9}static appendNumericBytes(y,E){const O=y.length;let $=0;for(;$<O;){const H=Mn.getDigit(y.charAt($));if($+2<O){const K=Mn.getDigit(y.charAt($+1)),le=Mn.getDigit(y.charAt($+2));E.appendBits(H*100+K*10+le,10),$+=3}else if($+1<O){const K=Mn.getDigit(y.charAt($+1));E.appendBits(H*10+K,7),$+=2}else E.appendBits(H,4),$++}}static appendAlphanumericBytes(y,E){const O=y.length;let $=0;for(;$<O;){const H=Mn.getAlphanumericCode(y.charCodeAt($));if(H===-1)throw new ii;if($+1<O){const K=Mn.getAlphanumericCode(y.charCodeAt($+1));if(K===-1)throw new ii;E.appendBits(H*45+K,11),$+=2}else E.appendBits(H,6),$++}}static append8BitBytes(y,E,O){let $;try{$=J.encode(y,O)}catch(H){throw new ii(H)}for(let H=0,K=$.length;H!==K;H++){const le=$[H];E.appendBits(le,8)}}static appendKanjiBytes(y,E){let O;try{O=J.encode(y,Q.SJIS)}catch(H){throw new ii(H)}const $=O.length;for(let H=0;H<$;H+=2){const K=O[H]&255,le=O[H+1]&255,we=K<<8&4294967295|le;let Te=-1;if(we>=33088&&we<=40956?Te=we-33088:we>=57408&&we<=60351&&(Te=we-49472),Te===-1)throw new ii("Invalid byte sequence");const Ze=(Te>>8)*192+(Te&255);E.appendBits(Ze,13)}}static appendECI(y,E){E.appendBits(Oe.ECI.getBits(),4),E.appendBits(y.getValue(),8)}}Mn.ALPHANUMERIC_TABLE=Int32Array.from([-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,36,-1,-1,-1,37,38,-1,-1,-1,-1,39,40,-1,41,42,43,0,1,2,3,4,5,6,7,8,9,44,-1,-1,-1,-1,-1,-1,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,-1,-1,-1,-1,-1]),Mn.DEFAULT_BYTE_MODE_ENCODING=Q.UTF8.getName();class ot{write(y,E,O,$=null){if(y.length===0)throw new f("Found empty contents");if(E<0||O<0)throw new f("Requested dimensions are too small: "+E+"x"+O);let H=Ce.L,K=ot.QUIET_ZONE_SIZE;$!==null&&($.get(Ir.ERROR_CORRECTION)!==void 0&&(H=Ce.fromString($.get(Ir.ERROR_CORRECTION).toString())),$.get(Ir.MARGIN)!==void 0&&(K=Number.parseInt($.get(Ir.MARGIN).toString(),10)));const le=Mn.encode(y,H,$);return this.renderResult(le,E,O,K)}writeToDom(y,E,O,$,H=null){typeof y=="string"&&(y=document.querySelector(y));const K=this.write(E,O,$,H);y&&y.appendChild(K)}renderResult(y,E,O,$){const H=y.getMatrix();if(H===null)throw new lt;const K=H.getWidth(),le=H.getHeight(),we=K+$*2,Te=le+$*2,Ze=Math.max(E,we),pt=Math.max(O,Te),_t=Math.min(Math.floor(Ze/we),Math.floor(pt/Te)),Jt=Math.floor((Ze-K*_t)/2),Ct=Math.floor((pt-le*_t)/2),Ht=this.createSVGElement(Ze,pt);for(let Kt=0,An=Ct;Kt<le;Kt++,An+=_t)for(let hr=0,wr=Jt;hr<K;hr++,wr+=_t)if(H.get(hr,Kt)===1){const Sr=this.createSvgRectElement(wr,An,_t,_t);Ht.appendChild(Sr)}return Ht}createSVGElement(y,E){const O=document.createElementNS(ot.SVG_NS,"svg");return O.setAttributeNS(null,"height",y.toString()),O.setAttributeNS(null,"width",E.toString()),O}createSvgRectElement(y,E,O,$){const H=document.createElementNS(ot.SVG_NS,"rect");return H.setAttributeNS(null,"x",y.toString()),H.setAttributeNS(null,"y",E.toString()),H.setAttributeNS(null,"height",O.toString()),H.setAttributeNS(null,"width",$.toString()),H.setAttributeNS(null,"fill","#000000"),H}}ot.QUIET_ZONE_SIZE=4,ot.SVG_NS="http://www.w3.org/2000/svg";class Vt{encode(y,E,O,$,H){if(y.length===0)throw new f("Found empty contents");if(E!==ye.QR_CODE)throw new f("Can only encode QR_CODE, but got "+E);if(O<0||$<0)throw new f(`Requested dimensions are too small: ${O}x${$}`);let K=Ce.L,le=Vt.QUIET_ZONE_SIZE;H!==null&&(H.get(Ir.ERROR_CORRECTION)!==void 0&&(K=Ce.fromString(H.get(Ir.ERROR_CORRECTION).toString())),H.get(Ir.MARGIN)!==void 0&&(le=Number.parseInt(H.get(Ir.MARGIN).toString(),10)));const we=Mn.encode(y,K,H);return Vt.renderResult(we,O,$,le)}static renderResult(y,E,O,$){const H=y.getMatrix();if(H===null)throw new lt;const K=H.getWidth(),le=H.getHeight(),we=K+$*2,Te=le+$*2,Ze=Math.max(E,we),pt=Math.max(O,Te),_t=Math.min(Math.floor(Ze/we),Math.floor(pt/Te)),Jt=Math.floor((Ze-K*_t)/2),Ct=Math.floor((pt-le*_t)/2),Ht=new pe(Ze,pt);for(let Kt=0,An=Ct;Kt<le;Kt++,An+=_t)for(let hr=0,wr=Jt;hr<K;hr++,wr+=_t)H.get(hr,Kt)===1&&Ht.setRegion(wr,An,_t,_t);return Ht}}Vt.QUIET_ZONE_SIZE=4;class er{encode(y,E,O,$,H){let K;switch(E){case ye.QR_CODE:K=new Vt;break;default:throw new f("No encoder available for format "+E)}return K.encode(y,E,O,$,H)}}class Wn extends G{constructor(y,E,O,$,H,K,le,we){if(super(K,le),this.yuvData=y,this.dataWidth=E,this.dataHeight=O,this.left=$,this.top=H,$+K>E||H+le>O)throw new f("Crop rectangle does not fit within image data.");we&&this.reverseHorizontal(K,le)}getRow(y,E){if(y<0||y>=this.getHeight())throw new f("Requested row is outside the image: "+y);const O=this.getWidth();(E==null||E.length<O)&&(E=new Uint8ClampedArray(O));const $=(y+this.top)*this.dataWidth+this.left;return w.arraycopy(this.yuvData,$,E,0,O),E}getMatrix(){const y=this.getWidth(),E=this.getHeight();if(y===this.dataWidth&&E===this.dataHeight)return this.yuvData;const O=y*E,$=new Uint8ClampedArray(O);let H=this.top*this.dataWidth+this.left;if(y===this.dataWidth)return w.arraycopy(this.yuvData,H,$,0,O),$;for(let K=0;K<E;K++){const le=K*y;w.arraycopy(this.yuvData,H,$,le,y),H+=this.dataWidth}return $}isCropSupported(){return!0}crop(y,E,O,$){return new Wn(this.yuvData,this.dataWidth,this.dataHeight,this.left+y,this.top+E,O,$,!1)}renderThumbnail(){const y=this.getWidth()/Wn.THUMBNAIL_SCALE_FACTOR,E=this.getHeight()/Wn.THUMBNAIL_SCALE_FACTOR,O=new Int32Array(y*E),$=this.yuvData;let H=this.top*this.dataWidth+this.left;for(let K=0;K<E;K++){const le=K*y;for(let we=0;we<y;we++){const Te=$[H+we*Wn.THUMBNAIL_SCALE_FACTOR]&255;O[le+we]=4278190080|Te*65793}H+=this.dataWidth*Wn.THUMBNAIL_SCALE_FACTOR}return O}getThumbnailWidth(){return this.getWidth()/Wn.THUMBNAIL_SCALE_FACTOR}getThumbnailHeight(){return this.getHeight()/Wn.THUMBNAIL_SCALE_FACTOR}reverseHorizontal(y,E){const O=this.yuvData;for(let $=0,H=this.top*this.dataWidth+this.left;$<E;$++,H+=this.dataWidth){const K=H+y/2;for(let le=H,we=H+y-1;le<K;le++,we--){const Te=O[le];O[le]=O[we],O[we]=Te}}}invert(){return new V(this)}}Wn.THUMBNAIL_SCALE_FACTOR=2;class Fr extends G{constructor(y,E,O,$,H,K,le){if(super(E,O),this.dataWidth=$,this.dataHeight=H,this.left=K,this.top=le,y.BYTES_PER_ELEMENT===4){const we=E*O,Te=new Uint8ClampedArray(we);for(let Ze=0;Ze<we;Ze++){const pt=y[Ze],_t=pt>>16&255,Jt=pt>>7&510,Ct=pt&255;Te[Ze]=(_t+Jt+Ct)/4&255}this.luminances=Te}else this.luminances=y;if($===void 0&&(this.dataWidth=E),H===void 0&&(this.dataHeight=O),K===void 0&&(this.left=0),le===void 0&&(this.top=0),this.left+E>this.dataWidth||this.top+O>this.dataHeight)throw new f("Crop rectangle does not fit within image data.")}getRow(y,E){if(y<0||y>=this.getHeight())throw new f("Requested row is outside the image: "+y);const O=this.getWidth();(E==null||E.length<O)&&(E=new Uint8ClampedArray(O));const $=(y+this.top)*this.dataWidth+this.left;return w.arraycopy(this.luminances,$,E,0,O),E}getMatrix(){const y=this.getWidth(),E=this.getHeight();if(y===this.dataWidth&&E===this.dataHeight)return this.luminances;const O=y*E,$=new Uint8ClampedArray(O);let H=this.top*this.dataWidth+this.left;if(y===this.dataWidth)return w.arraycopy(this.luminances,H,$,0,O),$;for(let K=0;K<E;K++){const le=K*y;w.arraycopy(this.luminances,H,$,le,y),H+=this.dataWidth}return $}isCropSupported(){return!0}crop(y,E,O,$){return new Fr(this.luminances,O,$,this.dataWidth,this.dataHeight,this.left+y,this.top+E)}invert(){return new V(this)}}class kr extends Q{static forName(y){return this.getCharacterSetECIByName(y)}}class ts{}ts.ISO_8859_1=Q.ISO8859_1;class Ms{isCompact(){return this.compact}setCompact(y){this.compact=y}getSize(){return this.size}setSize(y){this.size=y}getLayers(){return this.layers}setLayers(y){this.layers=y}getCodeWords(){return this.codeWords}setCodeWords(y){this.codeWords=y}getMatrix(){return this.matrix}setMatrix(y){this.matrix=y}}class At{static singletonList(y){return[y]}static min(y,E){return y.sort(E)[0]}}class ir{constructor(y){this.previous=y}getPrevious(){return this.previous}}class Hn extends ir{constructor(y,E,O){super(y),this.value=E,this.bitCount=O}appendTo(y,E){y.appendBits(this.value,this.bitCount)}add(y,E){return new Hn(this,y,E)}addBinaryShift(y,E){return console.warn("addBinaryShift on SimpleToken, this simply returns a copy of this token"),new Hn(this,y,E)}toString(){let y=this.value&(1<<this.bitCount)-1;return y|=1<<this.bitCount,"<"+I.toBinaryString(y|1<<this.bitCount).substring(1)+">"}}class Hr extends Hn{constructor(y,E,O){super(y,0,0),this.binaryShiftStart=E,this.binaryShiftByteCount=O}appendTo(y,E){for(let O=0;O<this.binaryShiftByteCount;O++)(O===0||O===31&&this.binaryShiftByteCount<=62)&&(y.appendBits(31,5),this.binaryShiftByteCount>62?y.appendBits(this.binaryShiftByteCount-31,16):O===0?y.appendBits(Math.min(this.binaryShiftByteCount,31),5):y.appendBits(this.binaryShiftByteCount-31,5)),y.appendBits(E[this.binaryShiftStart+O],8)}addBinaryShift(y,E){return new Hr(this,y,E)}toString(){return"<"+this.binaryShiftStart+"::"+(this.binaryShiftStart+this.binaryShiftByteCount-1)+">"}}function os(dt,y,E){return new Hr(dt,y,E)}function is(dt,y,E){return new Hn(dt,y,E)}const ms=["UPPER","LOWER","DIGIT","MIXED","PUNCT"],gs=0,$i=1,Bs=2,bs=3,Tr=4,ga=new Hn(null,0,0),El=[Int32Array.from([0,(5<<16)+28,(5<<16)+30,(5<<16)+29,656318]),Int32Array.from([(9<<16)+480+14,0,(5<<16)+30,(5<<16)+29,656318]),Int32Array.from([(4<<16)+14,(9<<16)+448+28,0,(9<<16)+448+29,932798]),Int32Array.from([(5<<16)+29,(5<<16)+28,656318,0,(5<<16)+30]),Int32Array.from([(5<<16)+31,656380,656382,656381,0])];function _l(dt){for(let y of dt)P.fill(y,-1);return dt[gs][Tr]=0,dt[$i][Tr]=0,dt[$i][gs]=28,dt[bs][Tr]=0,dt[Bs][Tr]=0,dt[Bs][gs]=15,dt}const Bu=_l(P.createInt32Array(6,6));class ba{constructor(y,E,O,$){this.token=y,this.mode=E,this.binaryShiftByteCount=O,this.bitCount=$}getMode(){return this.mode}getToken(){return this.token}getBinaryShiftByteCount(){return this.binaryShiftByteCount}getBitCount(){return this.bitCount}latchAndAppend(y,E){let O=this.bitCount,$=this.token;if(y!==this.mode){let K=El[this.mode][y];$=is($,K&65535,K>>16),O+=K>>16}let H=y===Bs?4:5;return $=is($,E,H),new ba($,y,0,O+H)}shiftAndAppend(y,E){let O=this.token,$=this.mode===Bs?4:5;return O=is(O,Bu[this.mode][y],$),O=is(O,E,5),new ba(O,this.mode,0,this.bitCount+$+5)}addBinaryShiftChar(y){let E=this.token,O=this.mode,$=this.bitCount;if(this.mode===Tr||this.mode===Bs){let le=El[O][gs];E=is(E,le&65535,le>>16),$+=le>>16,O=gs}let H=this.binaryShiftByteCount===0||this.binaryShiftByteCount===31?18:this.binaryShiftByteCount===62?9:8,K=new ba(E,O,this.binaryShiftByteCount+1,$+H);return K.binaryShiftByteCount===2078&&(K=K.endBinaryShift(y+1)),K}endBinaryShift(y){if(this.binaryShiftByteCount===0)return this;let E=this.token;return E=os(E,y-this.binaryShiftByteCount,this.binaryShiftByteCount),new ba(E,this.mode,0,this.bitCount)}isBetterThanOrEqualTo(y){let E=this.bitCount+(El[this.mode][y.mode]>>16);return this.binaryShiftByteCount<y.binaryShiftByteCount?E+=ba.calculateBinaryShiftCost(y)-ba.calculateBinaryShiftCost(this):this.binaryShiftByteCount>y.binaryShiftByteCount&&y.binaryShiftByteCount>0&&(E+=10),E<=y.bitCount}toBitArray(y){let E=[];for(let $=this.endBinaryShift(y.length).token;$!==null;$=$.getPrevious())E.unshift($);let O=new R;for(const $ of E)$.appendTo(O,y);return O}toString(){return X.format("%s bits=%d bytes=%d",ms[this.mode],this.bitCount,this.binaryShiftByteCount)}static calculateBinaryShiftCost(y){return y.binaryShiftByteCount>62?21:y.binaryShiftByteCount>31?20:y.binaryShiftByteCount>0?10:0}}ba.INITIAL_STATE=new ba(ga,gs,0,0);function kl(dt){const y=X.getCharCode(" "),E=X.getCharCode("."),O=X.getCharCode(",");dt[gs][y]=1;const $=X.getCharCode("Z"),H=X.getCharCode("A");for(let _t=H;_t<=$;_t++)dt[gs][_t]=_t-H+2;dt[$i][y]=1;const K=X.getCharCode("z"),le=X.getCharCode("a");for(let _t=le;_t<=K;_t++)dt[$i][_t]=_t-le+2;dt[Bs][y]=1;const we=X.getCharCode("9"),Te=X.getCharCode("0");for(let _t=Te;_t<=we;_t++)dt[Bs][_t]=_t-Te+2;dt[Bs][O]=12,dt[Bs][E]=13;const Ze=["\0"," ","","","","","","","\x07","\b"," ",`
`,"\v","\f","\r","\x1B","","","","","@","\\","^","_","`","|","~",""];for(let _t=0;_t<Ze.length;_t++)dt[bs][X.getCharCode(Ze[_t])]=_t;const pt=["\0","\r","\0","\0","\0","\0","!","'","#","$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","?","[","]","{","}"];for(let _t=0;_t<pt.length;_t++)X.getCharCode(pt[_t])>0&&(dt[Tr][X.getCharCode(pt[_t])]=_t);return dt}const px=kl(P.createInt32Array(5,256));class $u{constructor(y){this.text=y}encode(){const y=X.getCharCode(" "),E=X.getCharCode(`
`);let O=At.singletonList(ba.INITIAL_STATE);for(let H=0;H<this.text.length;H++){let K,le=H+1<this.text.length?this.text[H+1]:0;switch(this.text[H]){case X.getCharCode("\r"):K=le===E?2:0;break;case X.getCharCode("."):K=le===y?3:0;break;case X.getCharCode(","):K=le===y?4:0;break;case X.getCharCode(":"):K=le===y?5:0;break;default:K=0}K>0?(O=$u.updateStateListForPair(O,H,K),H++):O=this.updateStateListForChar(O,H)}return At.min(O,(H,K)=>H.getBitCount()-K.getBitCount()).toBitArray(this.text)}updateStateListForChar(y,E){const O=[];for(let $ of y)this.updateStateForChar($,E,O);return $u.simplifyStates(O)}updateStateForChar(y,E,O){let $=this.text[E]&255,H=px[y.getMode()][$]>0,K=null;for(let le=0;le<=Tr;le++){let we=px[le][$];if(we>0){if(K==null&&(K=y.endBinaryShift(E)),!H||le===y.getMode()||le===Bs){const Te=K.latchAndAppend(le,we);O.push(Te)}if(!H&&Bu[y.getMode()][le]>=0){const Te=K.shiftAndAppend(le,we);O.push(Te)}}}if(y.getBinaryShiftByteCount()>0||px[y.getMode()][$]===0){let le=y.addBinaryShiftChar(E);O.push(le)}}static updateStateListForPair(y,E,O){const $=[];for(let H of y)this.updateStateForPair(H,E,O,$);return this.simplifyStates($)}static updateStateForPair(y,E,O,$){let H=y.endBinaryShift(E);if($.push(H.latchAndAppend(Tr,O)),y.getMode()!==Tr&&$.push(H.shiftAndAppend(Tr,O)),O===3||O===4){let K=H.latchAndAppend(Bs,16-O).latchAndAppend(Bs,1);$.push(K)}if(y.getBinaryShiftByteCount()>0){let K=y.addBinaryShiftChar(E).addBinaryShiftChar(E+1);$.push(K)}}static simplifyStates(y){let E=[];for(const O of y){let $=!0;for(const H of E){if(H.isBetterThanOrEqualTo(O)){$=!1;break}O.isBetterThanOrEqualTo(H)&&(E=E.filter(K=>K!==H))}$&&E.push(O)}return E}}class gi{constructor(){}static encodeBytes(y){return gi.encode(y,gi.DEFAULT_EC_PERCENT,gi.DEFAULT_AZTEC_LAYERS)}static encode(y,E,O){let $=new $u(y).encode(),H=I.truncDivision($.getSize()*E,100)+11,K=$.getSize()+H,le,we,Te,Ze,pt;if(O!==gi.DEFAULT_AZTEC_LAYERS){if(le=O<0,we=Math.abs(O),we>(le?gi.MAX_NB_BITS_COMPACT:gi.MAX_NB_BITS))throw new f(X.format("Illegal value %s for layers",O));Te=gi.totalBitsInLayer(we,le),Ze=gi.WORD_SIZE[we];let Sr=Te-Te%Ze;if(pt=gi.stuffBits($,Ze),pt.getSize()+H>Sr)throw new f("Data to large for user specified layer");if(le&&pt.getSize()>Ze*64)throw new f("Data to large for user specified layer")}else{Ze=0,pt=null;for(let Sr=0;;Sr++){if(Sr>gi.MAX_NB_BITS)throw new f("Data too large for an Aztec code");if(le=Sr<=3,we=le?Sr+1:Sr,Te=gi.totalBitsInLayer(we,le),K>Te)continue;(pt==null||Ze!==gi.WORD_SIZE[we])&&(Ze=gi.WORD_SIZE[we],pt=gi.stuffBits($,Ze));let Ss=Te-Te%Ze;if(!(le&&pt.getSize()>Ze*64)&&pt.getSize()+H<=Ss)break}}let _t=gi.generateCheckWords(pt,Te,Ze),Jt=pt.getSize()/Ze,Ct=gi.generateModeMessage(le,we,Jt),Ht=(le?11:14)+we*4,Kt=new Int32Array(Ht),An;if(le){An=Ht;for(let Sr=0;Sr<Kt.length;Sr++)Kt[Sr]=Sr}else{An=Ht+1+2*I.truncDivision(I.truncDivision(Ht,2)-1,15);let Sr=I.truncDivision(Ht,2),Ss=I.truncDivision(An,2);for(let Qs=0;Qs<Sr;Qs++){let dc=Qs+I.truncDivision(Qs,15);Kt[Sr-Qs-1]=Ss-dc-1,Kt[Sr+Qs]=Ss+dc+1}}let hr=new pe(An);for(let Sr=0,Ss=0;Sr<we;Sr++){let Qs=(we-Sr)*4+(le?9:12);for(let dc=0;dc<Qs;dc++){let Za=dc*2;for(let Ja=0;Ja<2;Ja++)_t.get(Ss+Za+Ja)&&hr.set(Kt[Sr*2+Ja],Kt[Sr*2+dc]),_t.get(Ss+Qs*2+Za+Ja)&&hr.set(Kt[Sr*2+dc],Kt[Ht-1-Sr*2-Ja]),_t.get(Ss+Qs*4+Za+Ja)&&hr.set(Kt[Ht-1-Sr*2-Ja],Kt[Ht-1-Sr*2-dc]),_t.get(Ss+Qs*6+Za+Ja)&&hr.set(Kt[Ht-1-Sr*2-dc],Kt[Sr*2+Ja])}Ss+=Qs*8}if(gi.drawModeMessage(hr,le,An,Ct),le)gi.drawBullsEye(hr,I.truncDivision(An,2),5);else{gi.drawBullsEye(hr,I.truncDivision(An,2),7);for(let Sr=0,Ss=0;Sr<I.truncDivision(Ht,2)-1;Sr+=15,Ss+=16)for(let Qs=I.truncDivision(An,2)&1;Qs<An;Qs+=2)hr.set(I.truncDivision(An,2)-Ss,Qs),hr.set(I.truncDivision(An,2)+Ss,Qs),hr.set(Qs,I.truncDivision(An,2)-Ss),hr.set(Qs,I.truncDivision(An,2)+Ss)}let wr=new Ms;return wr.setCompact(le),wr.setSize(An),wr.setLayers(we),wr.setCodeWords(Jt),wr.setMatrix(hr),wr}static drawBullsEye(y,E,O){for(let $=0;$<O;$+=2)for(let H=E-$;H<=E+$;H++)y.set(H,E-$),y.set(H,E+$),y.set(E-$,H),y.set(E+$,H);y.set(E-O,E-O),y.set(E-O+1,E-O),y.set(E-O,E-O+1),y.set(E+O,E-O),y.set(E+O,E-O+1),y.set(E+O,E+O-1)}static generateModeMessage(y,E,O){let $=new R;return y?($.appendBits(E-1,2),$.appendBits(O-1,6),$=gi.generateCheckWords($,28,4)):($.appendBits(E-1,5),$.appendBits(O-1,11),$=gi.generateCheckWords($,40,4)),$}static drawModeMessage(y,E,O,$){let H=I.truncDivision(O,2);if(E)for(let K=0;K<7;K++){let le=H-3+K;$.get(K)&&y.set(le,H-5),$.get(K+7)&&y.set(H+5,le),$.get(20-K)&&y.set(le,H+5),$.get(27-K)&&y.set(H-5,le)}else for(let K=0;K<10;K++){let le=H-5+K+I.truncDivision(K,5);$.get(K)&&y.set(le,H-7),$.get(K+10)&&y.set(H+7,le),$.get(29-K)&&y.set(le,H+7),$.get(39-K)&&y.set(H-7,le)}}static generateCheckWords(y,E,O){let $=y.getSize()/O,H=new mr(gi.getGF(O)),K=I.truncDivision(E,O),le=gi.bitsToWords(y,O,K);H.encode(le,K-$);let we=E%O,Te=new R;Te.appendBits(0,we);for(const Ze of Array.from(le))Te.appendBits(Ze,O);return Te}static bitsToWords(y,E,O){let $=new Int32Array(O),H,K;for(H=0,K=y.getSize()/E;H<K;H++){let le=0;for(let we=0;we<E;we++)le|=y.get(H*E+we)?1<<E-we-1:0;$[H]=le}return $}static getGF(y){switch(y){case 4:return it.AZTEC_PARAM;case 6:return it.AZTEC_DATA_6;case 8:return it.AZTEC_DATA_8;case 10:return it.AZTEC_DATA_10;case 12:return it.AZTEC_DATA_12;default:throw new f("Unsupported word size "+y)}}static stuffBits(y,E){let O=new R,$=y.getSize(),H=(1<<E)-2;for(let K=0;K<$;K+=E){let le=0;for(let we=0;we<E;we++)(K+we>=$||y.get(K+we))&&(le|=1<<E-1-we);(le&H)===H?(O.appendBits(le&H,E),K--):le&H?O.appendBits(le,E):(O.appendBits(le|1,E),K--)}return O}static totalBitsInLayer(y,E){return((E?88:112)+16*y)*y}}gi.DEFAULT_EC_PERCENT=33,gi.DEFAULT_AZTEC_LAYERS=0,gi.MAX_NB_BITS=32,gi.MAX_NB_BITS_COMPACT=4,gi.WORD_SIZE=Int32Array.from([4,6,6,8,8,8,8,8,8,10,10,10,10,10,10,10,10,10,10,10,10,10,10,12,12,12,12,12,12,12,12,12,12]);class yd{encode(y,E,O,$){return this.encodeWithHints(y,E,O,$,null)}encodeWithHints(y,E,O,$,H){let K=ts.ISO_8859_1,le=gi.DEFAULT_EC_PERCENT,we=gi.DEFAULT_AZTEC_LAYERS;return H!=null&&(H.has(Ir.CHARACTER_SET)&&(K=kr.forName(H.get(Ir.CHARACTER_SET).toString())),H.has(Ir.ERROR_CORRECTION)&&(le=I.parseInt(H.get(Ir.ERROR_CORRECTION).toString())),H.has(Ir.AZTEC_LAYERS)&&(we=I.parseInt(H.get(Ir.AZTEC_LAYERS).toString()))),yd.encodeLayers(y,E,O,$,K,le,we)}static encodeLayers(y,E,O,$,H,K,le){if(E!==ye.AZTEC)throw new f("Can only encode AZTEC, but got "+E);let we=gi.encode(X.getBytes(y,H),K,le);return yd.renderResult(we,O,$)}static renderResult(y,E,O){let $=y.getMatrix();if($==null)throw new lt;let H=$.getWidth(),K=$.getHeight(),le=Math.max(E,H),we=Math.max(O,K),Te=Math.min(le/H,we/K),Ze=(le-H*Te)/2,pt=(we-K*Te)/2,_t=new pe(le,we);for(let Jt=0,Ct=pt;Jt<K;Jt++,Ct+=Te)for(let Ht=0,Kt=Ze;Ht<H;Ht++,Kt+=Te)$.get(Ht,Jt)&&_t.setRegion(Kt,Ct,Te,Te);return _t}}n.AbstractExpandedDecoder=xn,n.ArgumentException=d,n.ArithmeticException=$e,n.AztecCode=Ms,n.AztecCodeReader=Zt,n.AztecCodeWriter=yd,n.AztecDecoder=qt,n.AztecDetector=ht,n.AztecDetectorResult=un,n.AztecEncoder=gi,n.AztecHighLevelEncoder=$u,n.AztecPoint=Ye,n.BarcodeFormat=ye,n.Binarizer=v,n.BinaryBitmap=x,n.BitArray=R,n.BitMatrix=pe,n.BitSource=xe,n.BrowserAztecCodeReader=zt,n.BrowserBarcodeReader=T,n.BrowserCodeReader=Ne,n.BrowserDatamatrixCodeReader=st,n.BrowserMultiFormatReader=fr,n.BrowserPDF417Reader=ur,n.BrowserQRCodeReader=Yr,n.BrowserQRCodeSvgWriter=ot,n.CharacterSetECI=Q,n.ChecksumException=g,n.Code128Reader=nt,n.Code39Reader=Ue,n.DataMatrixDecodedBitStreamParser=ke,n.DataMatrixReader=Fe,n.DecodeHintType=U,n.DecoderResult=Ie,n.DefaultGridSampler=$t,n.DetectorResult=cn,n.EAN13Reader=dn,n.EncodeHintType=Ir,n.Exception=u,n.FormatException=L,n.GenericGF=it,n.GenericGFPoly=Qe,n.GlobalHistogramBinarizer=ie,n.GridSampler=Ke,n.GridSamplerInstance=qe,n.HTMLCanvasElementLuminanceSource=ee,n.HybridBinarizer=oe,n.ITFReader=Rt,n.IllegalArgumentException=f,n.IllegalStateException=lt,n.InvertedLuminanceSource=V,n.LuminanceSource=G,n.MathUtils=It,n.MultiFormatOneDReader=k,n.MultiFormatReader=Nr,n.MultiFormatWriter=er,n.NotFoundException=Y,n.OneDReader=Et,n.PDF417DecodedBitStreamParser=vt,n.PDF417DecoderErrorCorrection=ws,n.PDF417Reader=mn,n.PDF417ResultMetadata=jr,n.PerspectiveTransform=Bt,n.PlanarYUVLuminanceSource=Wn,n.QRCodeByteMatrix=xs,n.QRCodeDataMask=gt,n.QRCodeDecodedBitStreamParser=bt,n.QRCodeDecoderErrorCorrectionLevel=Ce,n.QRCodeDecoderFormatInformation=Be,n.QRCodeEncoder=Mn,n.QRCodeEncoderQRCode=Xs,n.QRCodeMaskUtil=Qn,n.QRCodeMatrixUtil=Pr,n.QRCodeMode=Oe,n.QRCodeReader=$n,n.QRCodeVersion=Je,n.QRCodeWriter=Vt,n.RGBLuminanceSource=Fr,n.RSS14Reader=_,n.RSSExpandedReader=p,n.ReaderException=cr,n.ReedSolomonDecoder=ft,n.ReedSolomonEncoder=mr,n.ReedSolomonException=tt,n.Result=he,n.ResultMetadataType=je,n.ResultPoint=jt,n.StringUtils=X,n.UnsupportedOperationException=ne,n.VideoInputDevice=ae,n.WhiteRectangleDetector=Ft,n.WriterException=ii,n.ZXingArrays=P,n.ZXingCharset=kr,n.ZXingInteger=I,n.ZXingStandardCharsets=ts,n.ZXingStringBuilder=re,n.ZXingStringEncoding=J,n.ZXingSystem=w,n.createAbstractExpandedDecoder=jn,Object.defineProperty(n,"__esModule",{value:!0})})}(jj,jj.exports)),jj.exports}var po=dLt();const fLt=Ti(po),hLt=FNe({__proto__:null,default:fLt},[po]);var $be=function(){function e(t,n,r){if(this.formatMap=new Map([[As.QR_CODE,po.BarcodeFormat.QR_CODE],[As.AZTEC,po.BarcodeFormat.AZTEC],[As.CODABAR,po.BarcodeFormat.CODABAR],[As.CODE_39,po.BarcodeFormat.CODE_39],[As.CODE_93,po.BarcodeFormat.CODE_93],[As.CODE_128,po.BarcodeFormat.CODE_128],[As.DATA_MATRIX,po.BarcodeFormat.DATA_MATRIX],[As.MAXICODE,po.BarcodeFormat.MAXICODE],[As.ITF,po.BarcodeFormat.ITF],[As.EAN_13,po.BarcodeFormat.EAN_13],[As.EAN_8,po.BarcodeFormat.EAN_8],[As.PDF_417,po.BarcodeFormat.PDF_417],[As.RSS_14,po.BarcodeFormat.RSS_14],[As.RSS_EXPANDED,po.BarcodeFormat.RSS_EXPANDED],[As.UPC_A,po.BarcodeFormat.UPC_A],[As.UPC_E,po.BarcodeFormat.UPC_E],[As.UPC_EAN_EXTENSION,po.BarcodeFormat.UPC_EAN_EXTENSION]]),this.reverseFormatMap=this.createReverseFormatMap(),!hLt)throw"Use html5qrcode.min.js without edit, ZXing not found.";this.verbose=n,this.logger=r;var s=this.createZXingFormats(t),a=new Map;a.set(po.DecodeHintType.POSSIBLE_FORMATS,s),a.set(po.DecodeHintType.TRY_HARDER,!1),this.hints=a}return e.prototype.decodeAsync=function(t){var n=this;return new Promise(function(r,s){try{r(n.decode(t))}catch(a){s(a)}})},e.prototype.decode=function(t){var n=new po.MultiFormatReader(this.verbose,this.hints),r=new po.HTMLCanvasElementLuminanceSource(t),s=new po.BinaryBitmap(new po.HybridBinarizer(r)),a=n.decode(s);return{text:a.text,format:ALe.create(this.toHtml5QrcodeSupportedFormats(a.format)),debugData:this.createDebugData()}},e.prototype.createReverseFormatMap=function(){var t=new Map;return this.formatMap.forEach(function(n,r,s){t.set(n,r)}),t},e.prototype.toHtml5QrcodeSupportedFormats=function(t){if(!this.reverseFormatMap.has(t))throw"reverseFormatMap doesn't have ".concat(t);return this.reverseFormatMap.get(t)},e.prototype.createZXingFormats=function(t){for(var n=[],r=0,s=t;r<s.length;r++){var a=s[r];this.formatMap.has(a)?n.push(this.formatMap.get(a)):this.logger.logError("".concat(a," is not supported by")+"ZXingHtml5QrcodeShim")}return n},e.prototype.createDebugData=function(){return{decoderName:"zxing-js"}},e}(),pLt=function(e,t,n,r){function s(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?a(d.value):s(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})},mLt=function(e,t){var n={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,s,a,o;return o={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function l(u){return function(d){return c([u,d])}}function c(u){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,u[0]&&(n=0)),n;)try{if(r=1,s&&(a=u[0]&2?s.return:u[0]?s.throw||((a=s.return)&&a.call(s),0):s.next)&&!(a=a.call(s,u[1])).done)return a;switch(s=0,a&&(u=[u[0]&2,a.value]),u[0]){case 0:case 1:a=u;break;case 4:return n.label++,{value:u[1],done:!1};case 5:n.label++,s=u[1],u=[0];continue;case 7:u=n.ops.pop(),n.trys.pop();continue;default:if(a=n.trys,!(a=a.length>0&&a[a.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!a||u[1]>a[0]&&u[1]<a[3])){n.label=u[1];break}if(u[0]===6&&n.label<a[1]){n.label=a[1],a=u;break}if(a&&n.label<a[2]){n.label=a[2],n.ops.push(u);break}a[2]&&n.ops.pop(),n.trys.pop();continue}u=t.call(e,n)}catch(d){u=[6,d],s=0}finally{r=a=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}},Ube=function(){function e(t,n,r){if(this.formatMap=new Map([[As.QR_CODE,"qr_code"],[As.AZTEC,"aztec"],[As.CODABAR,"codabar"],[As.CODE_39,"code_39"],[As.CODE_93,"code_93"],[As.CODE_128,"code_128"],[As.DATA_MATRIX,"data_matrix"],[As.ITF,"itf"],[As.EAN_13,"ean_13"],[As.EAN_8,"ean_8"],[As.PDF_417,"pdf417"],[As.UPC_A,"upc_a"],[As.UPC_E,"upc_e"]]),this.reverseFormatMap=this.createReverseFormatMap(),!e.isSupported())throw"Use html5qrcode.min.js without edit, Use BarcodeDetectorDelegate only if it isSupported();";this.verbose=n,this.logger=r;var s=this.createBarcodeDetectorFormats(t);if(this.detector=new BarcodeDetector(s),!this.detector)throw"BarcodeDetector detector not supported"}return e.isSupported=function(){if(!("BarcodeDetector"in window))return!1;var t=new BarcodeDetector({formats:["qr_code"]});return typeof t<"u"},e.prototype.decodeAsync=function(t){return pLt(this,void 0,void 0,function(){var n,r;return mLt(this,function(s){switch(s.label){case 0:return[4,this.detector.detect(t)];case 1:if(n=s.sent(),!n||n.length===0)throw"No barcode or QR code detected.";return r=this.selectLargestBarcode(n),[2,{text:r.rawValue,format:ALe.create(this.toHtml5QrcodeSupportedFormats(r.format)),debugData:this.createDebugData()}]}})})},e.prototype.selectLargestBarcode=function(t){for(var n=null,r=0,s=0,a=t;s<a.length;s++){var o=a[s],l=o.boundingBox.width*o.boundingBox.height;l>r&&(r=l,n=o)}if(!n)throw"No largest barcode found";return n},e.prototype.createBarcodeDetectorFormats=function(t){for(var n=[],r=0,s=t;r<s.length;r++){var a=s[r];this.formatMap.has(a)?n.push(this.formatMap.get(a)):this.logger.warn("".concat(a," is not supported by")+"BarcodeDetectorDelegate")}return{formats:n}},e.prototype.toHtml5QrcodeSupportedFormats=function(t){if(!this.reverseFormatMap.has(t))throw"reverseFormatMap doesn't have ".concat(t);return this.reverseFormatMap.get(t)},e.prototype.createReverseFormatMap=function(){var t=new Map;return this.formatMap.forEach(function(n,r,s){t.set(n,r)}),t},e.prototype.createDebugData=function(){return{decoderName:"BarcodeDetector"}},e}(),zbe=function(e,t,n,r){function s(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?a(d.value):s(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})},Hbe=function(e,t){var n={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,s,a,o;return o={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function l(u){return function(d){return c([u,d])}}function c(u){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,u[0]&&(n=0)),n;)try{if(r=1,s&&(a=u[0]&2?s.return:u[0]?s.throw||((a=s.return)&&a.call(s),0):s.next)&&!(a=a.call(s,u[1])).done)return a;switch(s=0,a&&(u=[u[0]&2,a.value]),u[0]){case 0:case 1:a=u;break;case 4:return n.label++,{value:u[1],done:!1};case 5:n.label++,s=u[1],u=[0];continue;case 7:u=n.ops.pop(),n.trys.pop();continue;default:if(a=n.trys,!(a=a.length>0&&a[a.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!a||u[1]>a[0]&&u[1]<a[3])){n.label=u[1];break}if(u[0]===6&&n.label<a[1]){n.label=a[1],a=u;break}if(a&&n.label<a[2]){n.label=a[2],n.ops.push(u);break}a[2]&&n.ops.pop(),n.trys.pop();continue}u=t.call(e,n)}catch(d){u=[6,d],s=0}finally{r=a=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}},xLt=function(){function e(t,n,r,s){this.EXECUTIONS_TO_REPORT_PERFORMANCE=100,this.executions=0,this.executionResults=[],this.wasPrimaryDecoderUsedInLastDecode=!1,this.verbose=r,n&&Ube.isSupported()?(this.primaryDecoder=new Ube(t,r,s),this.secondaryDecoder=new $be(t,r,s)):this.primaryDecoder=new $be(t,r,s)}return e.prototype.decodeAsync=function(t){return zbe(this,void 0,void 0,function(){var n;return Hbe(this,function(r){switch(r.label){case 0:n=performance.now(),r.label=1;case 1:return r.trys.push([1,,3,4]),[4,this.getDecoder().decodeAsync(t)];case 2:return[2,r.sent()];case 3:return this.possiblyLogPerformance(n),[7];case 4:return[2]}})})},e.prototype.decodeRobustlyAsync=function(t){return zbe(this,void 0,void 0,function(){var n,r;return Hbe(this,function(s){switch(s.label){case 0:n=performance.now(),s.label=1;case 1:return s.trys.push([1,3,4,5]),[4,this.primaryDecoder.decodeAsync(t)];case 2:return[2,s.sent()];case 3:if(r=s.sent(),this.secondaryDecoder)return[2,this.secondaryDecoder.decodeAsync(t)];throw r;case 4:return this.possiblyLogPerformance(n),[7];case 5:return[2]}})})},e.prototype.getDecoder=function(){return this.secondaryDecoder?this.wasPrimaryDecoderUsedInLastDecode===!1?(this.wasPrimaryDecoderUsedInLastDecode=!0,this.primaryDecoder):(this.wasPrimaryDecoderUsedInLastDecode=!1,this.secondaryDecoder):this.primaryDecoder},e.prototype.possiblyLogPerformance=function(t){if(this.verbose){var n=performance.now()-t;this.executionResults.push(n),this.executions++,this.possiblyFlushPerformanceReport()}},e.prototype.possiblyFlushPerformanceReport=function(){if(!(this.executions<this.EXECUTIONS_TO_REPORT_PERFORMANCE)){for(var t=0,n=0,r=this.executionResults;n<r.length;n++){var s=r[n];t+=s}var a=t/this.executionResults.length;console.log("".concat(a," ms for ").concat(this.executionResults.length," last runs.")),this.executions=0,this.executionResults=[]}},e}(),gle=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,s){r.__proto__=s}||function(r,s){for(var a in s)Object.prototype.hasOwnProperty.call(s,a)&&(r[a]=s[a])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),BR=function(e,t,n,r){function s(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?a(d.value):s(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})},$R=function(e,t){var n={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,s,a,o;return o={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function l(u){return function(d){return c([u,d])}}function c(u){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,u[0]&&(n=0)),n;)try{if(r=1,s&&(a=u[0]&2?s.return:u[0]?s.throw||((a=s.return)&&a.call(s),0):s.next)&&!(a=a.call(s,u[1])).done)return a;switch(s=0,a&&(u=[u[0]&2,a.value]),u[0]){case 0:case 1:a=u;break;case 4:return n.label++,{value:u[1],done:!1};case 5:n.label++,s=u[1],u=[0];continue;case 7:u=n.ops.pop(),n.trys.pop();continue;default:if(a=n.trys,!(a=a.length>0&&a[a.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!a||u[1]>a[0]&&u[1]<a[3])){n.label=u[1];break}if(u[0]===6&&n.label<a[1]){n.label=a[1],a=u;break}if(a&&n.label<a[2]){n.label=a[2],n.ops.push(u);break}a[2]&&n.ops.pop(),n.trys.pop();continue}u=t.call(e,n)}catch(d){u=[6,d],s=0}finally{r=a=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}},ELe=function(){function e(t,n){this.name=t,this.track=n}return e.prototype.isSupported=function(){return this.track.getCapabilities?this.name in this.track.getCapabilities():!1},e.prototype.apply=function(t){var n={};n[this.name]=t;var r={advanced:[n]};return this.track.applyConstraints(r)},e.prototype.value=function(){var t=this.track.getSettings();if(this.name in t){var n=t[this.name];return n}return null},e}(),gLt=function(e){gle(t,e);function t(n,r){return e.call(this,n,r)||this}return t.prototype.min=function(){return this.getCapabilities().min},t.prototype.max=function(){return this.getCapabilities().max},t.prototype.step=function(){return this.getCapabilities().step},t.prototype.apply=function(n){var r={};r[this.name]=n;var s={advanced:[r]};return this.track.applyConstraints(s)},t.prototype.getCapabilities=function(){this.failIfNotSupported();var n=this.track.getCapabilities(),r=n[this.name];return{min:r.min,max:r.max,step:r.step}},t.prototype.failIfNotSupported=function(){if(!this.isSupported())throw new Error("".concat(this.name," capability not supported"))},t}(ELe),bLt=function(e){gle(t,e);function t(n){return e.call(this,"zoom",n)||this}return t}(gLt),yLt=function(e){gle(t,e);function t(n){return e.call(this,"torch",n)||this}return t}(ELe),vLt=function(){function e(t){this.track=t}return e.prototype.zoomFeature=function(){return new bLt(this.track)},e.prototype.torchFeature=function(){return new yLt(this.track)},e}(),wLt=function(){function e(t,n,r){this.isClosed=!1,this.parentElement=t,this.mediaStream=n,this.callbacks=r,this.surface=this.createVideoElement(this.parentElement.clientWidth),t.append(this.surface)}return e.prototype.createVideoElement=function(t){var n=document.createElement("video");return n.style.width="".concat(t,"px"),n.style.display="block",n.muted=!0,n.setAttribute("muted","true"),n.playsInline=!0,n},e.prototype.setupSurface=function(){var t=this;this.surface.onabort=function(){throw"RenderedCameraImpl video surface onabort() called"},this.surface.onerror=function(){throw"RenderedCameraImpl video surface onerror() called"};var n=function(){var r=t.surface.clientWidth,s=t.surface.clientHeight;t.callbacks.onRenderSurfaceReady(r,s),t.surface.removeEventListener("playing",n)};this.surface.addEventListener("playing",n),this.surface.srcObject=this.mediaStream,this.surface.play()},e.create=function(t,n,r,s){return BR(this,void 0,void 0,function(){var a,o;return $R(this,function(l){switch(l.label){case 0:return a=new e(t,n,s),r.aspectRatio?(o={aspectRatio:r.aspectRatio},[4,a.getFirstTrackOrFail().applyConstraints(o)]):[3,2];case 1:l.sent(),l.label=2;case 2:return a.setupSurface(),[2,a]}})})},e.prototype.failIfClosed=function(){if(this.isClosed)throw"The RenderedCamera has already been closed."},e.prototype.getFirstTrackOrFail=function(){if(this.failIfClosed(),this.mediaStream.getVideoTracks().length===0)throw"No video tracks found";return this.mediaStream.getVideoTracks()[0]},e.prototype.pause=function(){this.failIfClosed(),this.surface.pause()},e.prototype.resume=function(t){this.failIfClosed();var n=this,r=function(){setTimeout(t,200),n.surface.removeEventListener("playing",r)};this.surface.addEventListener("playing",r),this.surface.play()},e.prototype.isPaused=function(){return this.failIfClosed(),this.surface.paused},e.prototype.getSurface=function(){return this.failIfClosed(),this.surface},e.prototype.getRunningTrackCapabilities=function(){return this.getFirstTrackOrFail().getCapabilities()},e.prototype.getRunningTrackSettings=function(){return this.getFirstTrackOrFail().getSettings()},e.prototype.applyVideoConstraints=function(t){return BR(this,void 0,void 0,function(){return $R(this,function(n){if("aspectRatio"in t)throw"Changing 'aspectRatio' in run-time is not yet supported.";return[2,this.getFirstTrackOrFail().applyConstraints(t)]})})},e.prototype.close=function(){if(this.isClosed)return Promise.resolve();var t=this;return new Promise(function(n,r){var s=t.mediaStream.getVideoTracks(),a=s.length,o=0;t.mediaStream.getVideoTracks().forEach(function(l){t.mediaStream.removeTrack(l),l.stop(),++o,o>=a&&(t.isClosed=!0,t.parentElement.removeChild(t.surface),n())})})},e.prototype.getCapabilities=function(){return new vLt(this.getFirstTrackOrFail())},e}(),CLt=function(){function e(t){this.mediaStream=t}return e.prototype.render=function(t,n,r){return BR(this,void 0,void 0,function(){return $R(this,function(s){return[2,wLt.create(t,this.mediaStream,n,r)]})})},e.create=function(t){return BR(this,void 0,void 0,function(){var n,r;return $R(this,function(s){switch(s.label){case 0:if(!navigator.mediaDevices)throw"navigator.mediaDevices not supported";return n={audio:!1,video:t},[4,navigator.mediaDevices.getUserMedia(n)];case 1:return r=s.sent(),[2,new e(r)]}})})},e}(),Vbe=function(e,t,n,r){function s(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?a(d.value):s(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})},Wbe=function(e,t){var n={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,s,a,o;return o={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function l(u){return function(d){return c([u,d])}}function c(u){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,u[0]&&(n=0)),n;)try{if(r=1,s&&(a=u[0]&2?s.return:u[0]?s.throw||((a=s.return)&&a.call(s),0):s.next)&&!(a=a.call(s,u[1])).done)return a;switch(s=0,a&&(u=[u[0]&2,a.value]),u[0]){case 0:case 1:a=u;break;case 4:return n.label++,{value:u[1],done:!1};case 5:n.label++,s=u[1],u=[0];continue;case 7:u=n.ops.pop(),n.trys.pop();continue;default:if(a=n.trys,!(a=a.length>0&&a[a.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!a||u[1]>a[0]&&u[1]<a[3])){n.label=u[1];break}if(u[0]===6&&n.label<a[1]){n.label=a[1],a=u;break}if(a&&n.label<a[2]){n.label=a[2],n.ops.push(u);break}a[2]&&n.ops.pop(),n.trys.pop();continue}u=t.call(e,n)}catch(d){u=[6,d],s=0}finally{r=a=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}},SLt=function(){function e(){}return e.failIfNotSupported=function(){return Vbe(this,void 0,void 0,function(){return Wbe(this,function(t){if(!navigator.mediaDevices)throw"navigator.mediaDevices not supported";return[2,new e]})})},e.prototype.create=function(t){return Vbe(this,void 0,void 0,function(){return Wbe(this,function(n){return[2,CLt.create(t)]})})},e}(),NLt=function(e,t,n,r){function s(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?a(d.value):s(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})},ALt=function(e,t){var n={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,s,a,o;return o={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function l(u){return function(d){return c([u,d])}}function c(u){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,u[0]&&(n=0)),n;)try{if(r=1,s&&(a=u[0]&2?s.return:u[0]?s.throw||((a=s.return)&&a.call(s),0):s.next)&&!(a=a.call(s,u[1])).done)return a;switch(s=0,a&&(u=[u[0]&2,a.value]),u[0]){case 0:case 1:a=u;break;case 4:return n.label++,{value:u[1],done:!1};case 5:n.label++,s=u[1],u=[0];continue;case 7:u=n.ops.pop(),n.trys.pop();continue;default:if(a=n.trys,!(a=a.length>0&&a[a.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!a||u[1]>a[0]&&u[1]<a[3])){n.label=u[1];break}if(u[0]===6&&n.label<a[1]){n.label=a[1],a=u;break}if(a&&n.label<a[2]){n.label=a[2],n.ops.push(u);break}a[2]&&n.ops.pop(),n.trys.pop();continue}u=t.call(e,n)}catch(d){u=[6,d],s=0}finally{r=a=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}},jLt=function(){function e(){}return e.retrieve=function(){if(navigator.mediaDevices)return e.getCamerasFromMediaDevices();var t=MediaStreamTrack;return MediaStreamTrack&&t.getSources?e.getCamerasFromMediaStreamTrack():e.rejectWithError()},e.rejectWithError=function(){var t=DC.unableToQuerySupportedDevices();return e.isHttpsOrLocalhost()||(t=DC.insecureContextCameraQueryError()),Promise.reject(t)},e.isHttpsOrLocalhost=function(){if(location.protocol==="https:")return!0;var t=location.host.split(":")[0];return t==="127.0.0.1"||t==="localhost"},e.getCamerasFromMediaDevices=function(){return NLt(this,void 0,void 0,function(){var t,n,r,s,a,o,l;return ALt(this,function(c){switch(c.label){case 0:return t=function(u){for(var d=u.getVideoTracks(),f=0,x=d;f<x.length;f++){var g=x[f];g.enabled=!1,g.stop(),u.removeTrack(g)}},[4,navigator.mediaDevices.getUserMedia({audio:!1,video:!0})];case 1:return n=c.sent(),[4,navigator.mediaDevices.enumerateDevices()];case 2:for(r=c.sent(),s=[],a=0,o=r;a<o.length;a++)l=o[a],l.kind==="videoinput"&&s.push({id:l.deviceId,label:l.label});return t(n),[2,s]}})})},e.getCamerasFromMediaStreamTrack=function(){return new Promise(function(t,n){var r=function(a){for(var o=[],l=0,c=a;l<c.length;l++){var u=c[l];u.kind==="video"&&o.push({id:u.id,label:u.label})}t(o)},s=MediaStreamTrack;s.getSources(r)})},e}(),Zo;(function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.NOT_STARTED=1]="NOT_STARTED",e[e.SCANNING=2]="SCANNING",e[e.PAUSED=3]="PAUSED"})(Zo||(Zo={}));var ELt=function(){function e(){this.state=Zo.NOT_STARTED,this.onGoingTransactionNewState=Zo.UNKNOWN}return e.prototype.directTransition=function(t){this.failIfTransitionOngoing(),this.validateTransition(t),this.state=t},e.prototype.startTransition=function(t){return this.failIfTransitionOngoing(),this.validateTransition(t),this.onGoingTransactionNewState=t,this},e.prototype.execute=function(){if(this.onGoingTransactionNewState===Zo.UNKNOWN)throw"Transaction is already cancelled, cannot execute().";var t=this.onGoingTransactionNewState;this.onGoingTransactionNewState=Zo.UNKNOWN,this.directTransition(t)},e.prototype.cancel=function(){if(this.onGoingTransactionNewState===Zo.UNKNOWN)throw"Transaction is already cancelled, cannot cancel().";this.onGoingTransactionNewState=Zo.UNKNOWN},e.prototype.getState=function(){return this.state},e.prototype.failIfTransitionOngoing=function(){if(this.onGoingTransactionNewState!==Zo.UNKNOWN)throw"Cannot transition to a new state, already under transition"},e.prototype.validateTransition=function(t){switch(this.state){case Zo.UNKNOWN:throw"Transition from unknown is not allowed";case Zo.NOT_STARTED:this.failIfNewStateIs(t,[Zo.PAUSED]);break;case Zo.SCANNING:break;case Zo.PAUSED:break}},e.prototype.failIfNewStateIs=function(t,n){for(var r=0,s=n;r<s.length;r++){var a=s[r];if(t===a)throw"Cannot transition from ".concat(this.state," to ").concat(t)}},e}(),_Lt=function(){function e(t){this.stateManager=t}return e.prototype.startTransition=function(t){return this.stateManager.startTransition(t)},e.prototype.directTransition=function(t){this.stateManager.directTransition(t)},e.prototype.getState=function(){return this.stateManager.getState()},e.prototype.canScanFile=function(){return this.stateManager.getState()===Zo.NOT_STARTED},e.prototype.isScanning=function(){return this.stateManager.getState()!==Zo.NOT_STARTED},e.prototype.isStrictlyScanning=function(){return this.stateManager.getState()===Zo.SCANNING},e.prototype.isPaused=function(){return this.stateManager.getState()===Zo.PAUSED},e}(),kLt=function(){function e(){}return e.create=function(){return new _Lt(new ELt)},e}(),TLt=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,s){r.__proto__=s}||function(r,s){for(var a in s)Object.prototype.hasOwnProperty.call(s,a)&&(r[a]=s[a])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),_f=function(e){TLt(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.DEFAULT_WIDTH=300,t.DEFAULT_WIDTH_OFFSET=2,t.FILE_SCAN_MIN_HEIGHT=300,t.FILE_SCAN_HIDDEN_CANVAS_PADDING=100,t.MIN_QR_BOX_SIZE=50,t.SHADED_LEFT=1,t.SHADED_RIGHT=2,t.SHADED_TOP=3,t.SHADED_BOTTOM=4,t.SHADED_REGION_ELEMENT_ID="qr-shaded-region",t.VERBOSE=!1,t.BORDER_SHADER_DEFAULT_COLOR="#ffffff",t.BORDER_SHADER_MATCH_COLOR="rgb(90, 193, 56)",t}(oLt),ILt=function(){function e(t,n){this.logger=n,this.fps=_f.SCAN_DEFAULT_FPS,t?(t.fps&&(this.fps=t.fps),this.disableFlip=t.disableFlip===!0,this.qrbox=t.qrbox,this.aspectRatio=t.aspectRatio,this.videoConstraints=t.videoConstraints):this.disableFlip=_f.DEFAULT_DISABLE_FLIP}return e.prototype.isMediaStreamConstraintsValid=function(){return this.videoConstraints?jLe.isMediaStreamConstraintsValid(this.videoConstraints,this.logger):(this.logger.logError("Empty videoConstraints",!0),!1)},e.prototype.isShadedBoxEnabled=function(){return!ag(this.qrbox)},e.create=function(t,n){return new e(t,n)},e}(),qbe=function(){function e(t,n){if(this.element=null,this.canvasElement=null,this.scannerPausedUiElement=null,this.hasBorderShaders=null,this.borderShaders=null,this.qrMatch=null,this.renderedCamera=null,this.qrRegion=null,this.context=null,this.lastScanImageFile=null,this.isScanning=!1,!document.getElementById(t))throw"HTML Element with id=".concat(t," not found");this.elementId=t,this.verbose=!1;var r;typeof n=="boolean"?this.verbose=n===!0:n&&(r=n,this.verbose=r.verbose===!0,r.experimentalFeatures),this.logger=new cLt(this.verbose),this.qrcode=new xLt(this.getSupportedFormats(n),this.getUseBarCodeDetectorIfSupported(r),this.verbose,this.logger),this.foreverScanTimeout,this.shouldScan=!0,this.stateManagerProxy=kLt.create()}return e.prototype.start=function(t,n,r,s){var a=this;if(!t)throw"cameraIdOrConfig is required";if(!r||typeof r!="function")throw"qrCodeSuccessCallback is required and should be a function.";var o;s?o=s:o=this.verbose?this.logger.log:function(){};var l=ILt.create(n,this.logger);this.clearElement();var c=!1;l.videoConstraints&&(l.isMediaStreamConstraintsValid()?c=!0:this.logger.logError("'videoConstraints' is not valid 'MediaStreamConstraints, it will be ignored.'",!0));var u=c,d=document.getElementById(this.elementId);d.clientWidth?d.clientWidth:_f.DEFAULT_WIDTH,d.style.position="relative",this.shouldScan=!0,this.element=d;var f=this,x=this.stateManagerProxy.startTransition(Zo.SCANNING);return new Promise(function(g,v){var w=u?l.videoConstraints:f.createVideoConstraints(t);if(!w){x.cancel(),v("videoConstraints should be defined");return}var C={};(!u||l.aspectRatio)&&(C.aspectRatio=l.aspectRatio);var N={onRenderSurfaceReady:function(P,I){f.setupUi(P,I,l),f.isScanning=!0,f.foreverScan(l,r,o)}};SLt.failIfNotSupported().then(function(P){P.create(w).then(function(I){return I.render(a.element,C,N).then(function(R){f.renderedCamera=R,x.execute(),g(null)}).catch(function(R){x.cancel(),v(R)})}).catch(function(I){x.cancel(),v(DC.errorGettingUserMedia(I))})}).catch(function(P){x.cancel(),v(DC.cameraStreamingNotSupported())})})},e.prototype.pause=function(t){if(!this.stateManagerProxy.isStrictlyScanning())throw"Cannot pause, scanner is not scanning.";this.stateManagerProxy.directTransition(Zo.PAUSED),this.showPausedState(),(ag(t)||t!==!0)&&(t=!1),t&&this.renderedCamera&&this.renderedCamera.pause()},e.prototype.resume=function(){if(!this.stateManagerProxy.isPaused())throw"Cannot result, scanner is not paused.";if(!this.renderedCamera)throw"renderedCamera doesn't exist while trying resume()";var t=this,n=function(){t.stateManagerProxy.directTransition(Zo.SCANNING),t.hidePausedState()};if(!this.renderedCamera.isPaused()){n();return}this.renderedCamera.resume(function(){n()})},e.prototype.getState=function(){return this.stateManagerProxy.getState()},e.prototype.stop=function(){var t=this;if(!this.stateManagerProxy.isScanning())throw"Cannot stop, scanner is not running or paused.";var n=this.stateManagerProxy.startTransition(Zo.NOT_STARTED);this.shouldScan=!1,this.foreverScanTimeout&&clearTimeout(this.foreverScanTimeout);var r=function(){if(t.element){var a=document.getElementById(_f.SHADED_REGION_ELEMENT_ID);a&&t.element.removeChild(a)}},s=this;return this.renderedCamera.close().then(function(){return s.renderedCamera=null,s.element&&(s.element.removeChild(s.canvasElement),s.canvasElement=null),r(),s.qrRegion&&(s.qrRegion=null),s.context&&(s.context=null),n.execute(),s.hidePausedState(),s.isScanning=!1,Promise.resolve()})},e.prototype.scanFile=function(t,n){return this.scanFileV2(t,n).then(function(r){return r.decodedText})},e.prototype.scanFileV2=function(t,n){var r=this;if(!t||!(t instanceof File))throw"imageFile argument is mandatory and should be instance of File. Use 'event.target.files[0]'.";if(ag(n)&&(n=!0),!this.stateManagerProxy.canScanFile())throw"Cannot start file scan - ongoing camera scan";return new Promise(function(s,a){r.possiblyCloseLastScanImageFile(),r.clearElement(),r.lastScanImageFile=URL.createObjectURL(t);var o=new Image;o.onload=function(){var l=o.width,c=o.height,u=document.getElementById(r.elementId),d=u.clientWidth?u.clientWidth:_f.DEFAULT_WIDTH,f=Math.max(u.clientHeight?u.clientHeight:c,_f.FILE_SCAN_MIN_HEIGHT),x=r.computeCanvasDrawConfig(l,c,d,f);if(n){var g=r.createCanvasElement(d,f,"qr-canvas-visible");g.style.display="inline-block",u.appendChild(g);var v=g.getContext("2d");if(!v)throw"Unable to get 2d context from canvas";v.canvas.width=d,v.canvas.height=f,v.drawImage(o,0,0,l,c,x.x,x.y,x.width,x.height)}var w=_f.FILE_SCAN_HIDDEN_CANVAS_PADDING,C=Math.max(o.width,x.width),N=Math.max(o.height,x.height),P=C+2*w,I=N+2*w,R=r.createCanvasElement(P,I);u.appendChild(R);var F=R.getContext("2d");if(!F)throw"Unable to get 2d context from canvas";F.canvas.width=P,F.canvas.height=I,F.drawImage(o,0,0,l,c,w,w,C,N);try{r.qrcode.decodeRobustlyAsync(R).then(function(U){s(Dbe.createFromQrcodeResult(U))}).catch(a)}catch(U){a("QR code parse error, error = ".concat(U))}},o.onerror=a,o.onabort=a,o.onstalled=a,o.onsuspend=a,o.src=URL.createObjectURL(t)})},e.prototype.clear=function(){this.clearElement()},e.getCameras=function(){return jLt.retrieve()},e.prototype.getRunningTrackCapabilities=function(){return this.getRenderedCameraOrFail().getRunningTrackCapabilities()},e.prototype.getRunningTrackSettings=function(){return this.getRenderedCameraOrFail().getRunningTrackSettings()},e.prototype.getRunningTrackCameraCapabilities=function(){return this.getRenderedCameraOrFail().getCapabilities()},e.prototype.applyVideoConstraints=function(t){if(t){if(!jLe.isMediaStreamConstraintsValid(t,this.logger))throw"invalid videoConstaints passed, check logs for more details"}else throw"videoConstaints is required argument.";return this.getRenderedCameraOrFail().applyVideoConstraints(t)},e.prototype.getRenderedCameraOrFail=function(){if(this.renderedCamera==null)throw"Scanning is not in running state, call this API only when QR code scanning using camera is in running state.";return this.renderedCamera},e.prototype.getSupportedFormats=function(t){var n=[As.QR_CODE,As.AZTEC,As.CODABAR,As.CODE_39,As.CODE_93,As.CODE_128,As.DATA_MATRIX,As.MAXICODE,As.ITF,As.EAN_13,As.EAN_8,As.PDF_417,As.RSS_14,As.RSS_EXPANDED,As.UPC_A,As.UPC_E,As.UPC_EAN_EXTENSION];if(!t||typeof t=="boolean"||!t.formatsToSupport)return n;if(!Array.isArray(t.formatsToSupport))throw"configOrVerbosityFlag.formatsToSupport should be undefined or an array.";if(t.formatsToSupport.length===0)throw"Atleast 1 formatsToSupport is needed.";for(var r=[],s=0,a=t.formatsToSupport;s<a.length;s++){var o=a[s];aLt(o)?r.push(o):this.logger.warn("Invalid format: ".concat(o," passed in config, ignoring."))}if(r.length===0)throw"None of formatsToSupport match supported values.";return r},e.prototype.getUseBarCodeDetectorIfSupported=function(t){if(ag(t))return!0;if(!ag(t.useBarCodeDetectorIfSupported))return t.useBarCodeDetectorIfSupported!==!1;if(ag(t.experimentalFeatures))return!0;var n=t.experimentalFeatures;return ag(n.useBarCodeDetectorIfSupported)?!0:n.useBarCodeDetectorIfSupported!==!1},e.prototype.validateQrboxSize=function(t,n,r){var s=this,a=r.qrbox;this.validateQrboxConfig(a);var o=this.toQrdimensions(t,n,a),l=function(u){if(u<_f.MIN_QR_BOX_SIZE)throw"minimum size of 'config.qrbox' dimension value is"+" ".concat(_f.MIN_QR_BOX_SIZE,"px.")},c=function(u){return u>t&&(s.logger.warn("`qrbox.width` or `qrbox` is larger than the width of the root element. The width will be truncated to the width of root element."),u=t),u};l(o.width),l(o.height),o.width=c(o.width)},e.prototype.validateQrboxConfig=function(t){if(typeof t!="number"&&typeof t!="function"&&(t.width===void 0||t.height===void 0))throw"Invalid instance of QrDimensions passed for 'config.qrbox'. Both 'width' and 'height' should be set."},e.prototype.toQrdimensions=function(t,n,r){if(typeof r=="number")return{width:r,height:r};if(typeof r=="function")try{return r(t,n)}catch(s){throw new Error("qrbox config was passed as a function but it failed with unknown error"+s)}return r},e.prototype.setupUi=function(t,n,r){r.isShadedBoxEnabled()&&this.validateQrboxSize(t,n,r);var s=ag(r.qrbox)?{width:t,height:n}:r.qrbox;this.validateQrboxConfig(s);var a=this.toQrdimensions(t,n,s);a.height>n&&this.logger.warn("[Html5Qrcode] config.qrbox has height that isgreater than the height of the video stream. Shading will be ignored");var o=r.isShadedBoxEnabled()&&a.height<=n,l={x:0,y:0,width:t,height:n},c=o?this.getShadedRegionBounds(t,n,a):l,u=this.createCanvasElement(c.width,c.height),d={willReadFrequently:!0},f=u.getContext("2d",d);f.canvas.width=c.width,f.canvas.height=c.height,this.element.append(u),o&&this.possiblyInsertShadingElement(this.element,t,n,a),this.createScannerPausedUiElement(this.element),this.qrRegion=c,this.context=f,this.canvasElement=u},e.prototype.createScannerPausedUiElement=function(t){var n=document.createElement("div");n.innerText=DC.scannerPaused(),n.style.display="none",n.style.position="absolute",n.style.top="0px",n.style.zIndex="1",n.style.background="rgba(9, 9, 9, 0.46)",n.style.color="#FFECEC",n.style.textAlign="center",n.style.width="100%",t.appendChild(n),this.scannerPausedUiElement=n},e.prototype.scanContext=function(t,n){var r=this;return this.stateManagerProxy.isPaused()?Promise.resolve(!1):this.qrcode.decodeAsync(this.canvasElement).then(function(s){return t(s.text,Dbe.createFromQrcodeResult(s)),r.possiblyUpdateShaders(!0),!0}).catch(function(s){r.possiblyUpdateShaders(!1);var a=DC.codeParseError(s);return n(a,lLt.createFrom(a)),!1})},e.prototype.foreverScan=function(t,n,r){var s=this;if(this.shouldScan&&this.renderedCamera){var a=this.renderedCamera.getSurface(),o=a.videoWidth/a.clientWidth,l=a.videoHeight/a.clientHeight;if(!this.qrRegion)throw"qrRegion undefined when localMediaStream is ready.";var c=this.qrRegion.width*o,u=this.qrRegion.height*l,d=this.qrRegion.x*o,f=this.qrRegion.y*l;this.context.drawImage(a,d,f,c,u,0,0,this.qrRegion.width,this.qrRegion.height);var x=function(){s.foreverScanTimeout=setTimeout(function(){s.foreverScan(t,n,r)},s.getTimeoutFps(t.fps))};this.scanContext(n,r).then(function(g){!g&&t.disableFlip!==!0?(s.context.translate(s.context.canvas.width,0),s.context.scale(-1,1),s.scanContext(n,r).finally(function(){x()})):x()}).catch(function(g){s.logger.logError("Error happend while scanning context",g),x()})}},e.prototype.createVideoConstraints=function(t){if(typeof t=="string")return{deviceId:{exact:t}};if(typeof t=="object"){var n="facingMode",r="deviceId",s={user:!0,environment:!0},a="exact",o=function(v){if(v in s)return!0;throw"config has invalid 'facingMode' value = "+"'".concat(v,"'")},l=Object.keys(t);if(l.length!==1)throw"'cameraIdOrConfig' object should have exactly 1 key,"+" if passed as an object, found ".concat(l.length," keys");var c=Object.keys(t)[0];if(c!==n&&c!==r)throw"Only '".concat(n,"' and '").concat(r,"' ")+" are supported for 'cameraIdOrConfig'";if(c===n){var u=t.facingMode;if(typeof u=="string"){if(o(u))return{facingMode:u}}else if(typeof u=="object")if(a in u){if(o(u["".concat(a)]))return{facingMode:{exact:u["".concat(a)]}}}else throw"'facingMode' should be string or object with"+" ".concat(a," as key.");else{var d=typeof u;throw"Invalid type of 'facingMode' = ".concat(d)}}else{var f=t.deviceId;if(typeof f=="string")return{deviceId:f};if(typeof f=="object"){if(a in f)return{deviceId:{exact:f["".concat(a)]}};throw"'deviceId' should be string or object with"+" ".concat(a," as key.")}else{var x=typeof f;throw"Invalid type of 'deviceId' = ".concat(x)}}}var g=typeof t;throw"Invalid type of 'cameraIdOrConfig' = ".concat(g)},e.prototype.computeCanvasDrawConfig=function(t,n,r,s){if(t<=r&&n<=s){var a=(r-t)/2,o=(s-n)/2;return{x:a,y:o,width:t,height:n}}else{var l=t,c=n;return t>r&&(n=r/t*n,t=r),n>s&&(t=s/n*t,n=s),this.logger.log("Image downsampled from "+"".concat(l,"X").concat(c)+" to ".concat(t,"X").concat(n,".")),this.computeCanvasDrawConfig(t,n,r,s)}},e.prototype.clearElement=function(){if(this.stateManagerProxy.isScanning())throw"Cannot clear while scan is ongoing, close it first.";var t=document.getElementById(this.elementId);t&&(t.innerHTML="")},e.prototype.possiblyUpdateShaders=function(t){this.qrMatch!==t&&(this.hasBorderShaders&&this.borderShaders&&this.borderShaders.length&&this.borderShaders.forEach(function(n){n.style.backgroundColor=t?_f.BORDER_SHADER_MATCH_COLOR:_f.BORDER_SHADER_DEFAULT_COLOR}),this.qrMatch=t)},e.prototype.possiblyCloseLastScanImageFile=function(){this.lastScanImageFile&&(URL.revokeObjectURL(this.lastScanImageFile),this.lastScanImageFile=null)},e.prototype.createCanvasElement=function(t,n,r){var s=t,a=n,o=document.createElement("canvas");return o.style.width="".concat(s,"px"),o.style.height="".concat(a,"px"),o.style.display="none",o.id=ag(r)?"qr-canvas":r,o},e.prototype.getShadedRegionBounds=function(t,n,r){if(r.width>t||r.height>n)throw"'config.qrbox' dimensions should not be greater than the dimensions of the root HTML element.";return{x:(t-r.width)/2,y:(n-r.height)/2,width:r.width,height:r.height}},e.prototype.possiblyInsertShadingElement=function(t,n,r,s){if(!(n-s.width<1||r-s.height<1)){var a=document.createElement("div");a.style.position="absolute";var o=(n-s.width)/2,l=(r-s.height)/2;if(a.style.borderLeft="".concat(o,"px solid rgba(0, 0, 0, 0.48)"),a.style.borderRight="".concat(o,"px solid rgba(0, 0, 0, 0.48)"),a.style.borderTop="".concat(l,"px solid rgba(0, 0, 0, 0.48)"),a.style.borderBottom="".concat(l,"px solid rgba(0, 0, 0, 0.48)"),a.style.boxSizing="border-box",a.style.top="0px",a.style.bottom="0px",a.style.left="0px",a.style.right="0px",a.id="".concat(_f.SHADED_REGION_ELEMENT_ID),n-s.width<11||r-s.height<11)this.hasBorderShaders=!1;else{var c=5,u=40;this.insertShaderBorders(a,u,c,-c,null,0,!0),this.insertShaderBorders(a,u,c,-c,null,0,!1),this.insertShaderBorders(a,u,c,null,-c,0,!0),this.insertShaderBorders(a,u,c,null,-c,0,!1),this.insertShaderBorders(a,c,u+c,-c,null,-c,!0),this.insertShaderBorders(a,c,u+c,null,-c,-c,!0),this.insertShaderBorders(a,c,u+c,-c,null,-c,!1),this.insertShaderBorders(a,c,u+c,null,-c,-c,!1),this.hasBorderShaders=!0}t.append(a)}},e.prototype.insertShaderBorders=function(t,n,r,s,a,o,l){var c=document.createElement("div");c.style.position="absolute",c.style.backgroundColor=_f.BORDER_SHADER_DEFAULT_COLOR,c.style.width="".concat(n,"px"),c.style.height="".concat(r,"px"),s!==null&&(c.style.top="".concat(s,"px")),a!==null&&(c.style.bottom="".concat(a,"px")),l?c.style.left="".concat(o,"px"):c.style.right="".concat(o,"px"),this.borderShaders||(this.borderShaders=[]),this.borderShaders.push(c),t.appendChild(c)},e.prototype.showPausedState=function(){if(!this.scannerPausedUiElement)throw"[internal error] scanner paused UI element not found";this.scannerPausedUiElement.style.display="block"},e.prototype.hidePausedState=function(){if(!this.scannerPausedUiElement)throw"[internal error] scanner paused UI element not found";this.scannerPausedUiElement.style.display="none"},e.prototype.getTimeoutFps=function(t){return 1e3/t},e}(),Gbe;(function(e){e[e.STATUS_DEFAULT=0]="STATUS_DEFAULT",e[e.STATUS_SUCCESS=1]="STATUS_SUCCESS",e[e.STATUS_WARNING=2]="STATUS_WARNING",e[e.STATUS_REQUESTING_PERMISSION=3]="STATUS_REQUESTING_PERMISSION"})(Gbe||(Gbe={}));function t_(){const[e,t]=m.useState(!1),[n,r]=m.useState([]),[s,a]=m.useState(null),[o,l]=m.useState(null),c=m.useRef(null);m.useEffect(()=>{l(localStorage.getItem("hyperAddress"))},[]),m.useEffect(()=>{e&&qbe.getCameras().then(d=>{r(d||[]);const x=d.find(g=>/back|environment/i.test(g.label))||d[0];x&&a(x.id)})},[e]),m.useEffect(()=>{if(!e||!s)return;const d=new qbe("reader"),f={deviceId:{exact:s}},x={fps:10,qrbox:250};return d.start(f,x,g=>window.location.href=g,console.error),()=>d.stop().then(()=>d.clear())},[e,s]);const u=()=>{l(null),window.localStorage.removeItem("hyperAddress"),window.localStorage.removeItem("hyperToken"),setHyperToken(""),setHyperAddress(""),window.location.reload()};return i.jsxs(i.Fragment,{children:[i.jsx("div",{onClick:o?u:()=>t(!0),className:"font-bold w-full",children:o?i.jsx("span",{className:"text-red-400",children:"Logout"}):i.jsx("span",{className:"text-white",children:"Connect"})}),e&&i.jsx("div",{className:"fixed inset-0 grid place-items-center bg-black/60",children:i.jsxs("div",{className:"bg-[#1b1b1b] p-4 rounded-xl space-y-4",children:[i.jsx("select",{value:s||"",onChange:d=>a(d.target.value),className:"w-full p-2 rounded text-sm bg-slate-950 font-manrope font-bold",children:n.map(d=>i.jsx("option",{value:d.id,children:d.label||d.id},d.id))}),i.jsx("div",{id:"reader",ref:c,className:"w-[300px]"}),i.jsx("button",{onClick:()=>t(!1),className:"w-full p-2 rounded text-sm bg-red-400 text-black font-bold font-manrope",children:"Close"})]})})]})}const PLt=()=>{const[e,t]=m.useState(!1),[n,r]=m.useState(!1),[s,a]=m.useState(!1),[o,l]=m.useState(!1),[c,u]=m.useState(!1),[d,f]=m.useState(!1),[x,g]=m.useState(!1),[v,w]=m.useState(!1),[C,N]=m.useState(!1),P=()=>{t(!e)};return i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"bg-[#171717] w-full px-2 sm:px-6 flex justify-between items-center border-b border-[#2a2a2a] z-50 h-[60px]",children:[i.jsx(hl,{to:"/",className:"cursor-pointer",children:i.jsx("div",{className:"flex justify-start items-center gap-[8.09px] font-manrope",children:i.jsxs("div",{className:"flex justify-start items-center min-w-max",children:[i.jsx("img",{src:Gi,alt:"Dextrabot",className:"w-[30.91321px] h-8"}),i.jsx("span",{className:"text-white font-manrope text-sm ml-2 font-semibold",children:"Dextrabot"})]})})}),i.jsxs("div",{className:"w-[84px] h-6 p-2 bg-[#232323] rounded-[256px] justify-start items-center gap-2.5 hidden sm:inline-flex cursor-not-allowed",children:[i.jsxs("div",{className:"h-4 justify-start items-center gap-[5px] flex",children:[i.jsx("img",{src:dx,alt:"Dextrabot",className:"w-3.5 h-3.5"}),i.jsx("div",{className:"text-white text-[11px] font-extrabold font-manrope leading-none",children:"HYPE"})]}),i.jsx("div",{className:"w-3 h-3 justify-center items-center flex",children:i.jsx(Yh,{className:"text-white w-3 h-3"})})]}),i.jsx("div",{onClick:P,className:"p-2 bg-[#171717] cursor-pointer",children:i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6 fill-current text-white",viewBox:"0 0 24 24",stroke:"currentColor",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 6h16M4 12h16M4 18h16"})})})]}),e&&i.jsxs("div",{className:"fixed inset-0 w-screen h-screen bg-[#171717]/10 z-50 backdrop-blur-xl overflow-hidden",children:[i.jsx("div",{onClick:P,className:"absolute top-3 right-2 p-2 bg-transparent cursor-pointer",children:i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6 fill-current text-white",viewBox:"0 0 24 24",stroke:"currentColor",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})}),i.jsx("div",{className:"w-full h-full px-4 pt-5 pb-16 overflow-y-auto",children:i.jsxs("div",{className:"flex flex-col gap-2 w-full text-xl font-manrope items-start text-left [&>a]:text-white [&>a]:font-bold",children:[i.jsx(t_,{}),i.jsx(hl,{to:"/terminal/BTC",onClick:()=>t(!1),children:"Terminal"}),i.jsx(hl,{to:"/discover-wallets",onClick:()=>t(!1),children:"Discover Wallets"}),i.jsx(hl,{to:"/hyperliquid-vaults",onClick:()=>t(!1),children:"Discover Vaults"}),i.jsx(hl,{to:"/copy-trade",onClick:()=>t(!1),children:"My Copy Trading"}),i.jsx(hl,{to:"/wallet-management",onClick:()=>t(!1),children:"Wallet Management"}),i.jsx(hl,{to:"/ticker",onClick:()=>t(!1),children:"Ticker"}),i.jsx(hl,{to:"/leaderboard",onClick:()=>t(!1),children:"Leaderboard"}),i.jsx(hl,{to:"/referral",onClick:()=>t(!1),children:"Referral"}),i.jsx(hl,{to:"/tracked-wallets",onClick:()=>t(!1),children:"Tracked Wallets"}),i.jsx(hl,{to:"/tracker",onClick:()=>t(!1),children:"My Activities"}),i.jsx(hl,{to:"/hyperliquid-whale-trades",onClick:()=>t(!1),children:"Whale trades"}),i.jsx(hl,{to:"/back-testing",onClick:()=>t(!1),children:"Backtest"}),i.jsx(hl,{to:"/hyperliquid-fee-calculator ",onClick:()=>t(!1),children:"HL Fee Calculator"}),i.jsxs(hl,{to:"/terminal/extended/BTC#gridbot",onClick:()=>t(!1),children:["Extended Grid Bot ",i.jsx(v0,{})]}),i.jsxs(hl,{to:"/dca-bot",onClick:()=>t(!1),children:["Extended DCA Bot ",i.jsx(v0,{})]}),i.jsxs("div",{onClick:()=>g(!0),className:"text-white font-bold cursor-pointer inline-flex items-center",children:["Extended Farming ",i.jsx(v0,{tone:"emerald",label:"SMART"})]}),i.jsxs(hl,{to:"/terminal/lighter/BTC#gridbot",onClick:()=>t(!1),children:["Lighter Grid Bot ",i.jsx(v0,{})]}),i.jsxs(hl,{to:"/terminal/hyperliquid/BTC#gridbot",onClick:()=>t(!1),children:["HL Grid Bot ",i.jsx(v0,{})]}),i.jsx(hl,{to:"/market-maker",onClick:()=>t(!1),children:"HL Market Maker"}),i.jsx("div",{onClick:()=>a(!0),className:"text-white font-bold cursor-pointer",children:"Aster Farming"}),i.jsx("div",{onClick:()=>r(!0),className:"text-white font-bold cursor-pointer",children:"BasedApp Farming"}),i.jsx("div",{onClick:()=>l(!0),className:"text-white font-bold cursor-pointer inline-flex items-center",children:"Lighter Farming"}),i.jsx("div",{onClick:()=>u(!0),className:"text-white font-bold cursor-pointer inline-flex items-center",children:"Apex Farming"}),i.jsx("div",{onClick:()=>f(!0),className:"text-white font-bold cursor-pointer inline-flex items-center",children:"Variational Farming"}),i.jsx("div",{onClick:()=>w(!0),className:"text-white font-bold cursor-pointer inline-flex items-center",children:"Paradex Farming"}),i.jsx("div",{onClick:()=>N(!0),className:"text-white font-bold cursor-pointer inline-flex items-center",children:"Pacifica Farming"})]})})]}),i.jsx(zoe,{open:n,setOpen:r}),i.jsx(Hoe,{open:s,setOpen:a}),i.jsx(Voe,{open:o,setOpen:l}),i.jsx(Woe,{open:c,setOpen:u}),i.jsx(qoe,{open:d,setOpen:f}),i.jsx(w$,{open:x,setOpen:g}),i.jsx(Goe,{open:v,setOpen:w}),i.jsx(Koe,{open:C,setOpen:N})]})},_Le=({className:e})=>i.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",className:e,children:[i.jsx("path",{d:"M1 9L9 1",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),i.jsx("path",{d:"M9 9L1 1",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),FLt=()=>{var pe,Y,ie,oe,G,V;const e=m.useRef(null),[t,n]=m.useState(!1),[r,s]=m.useState([]),[a,o]=m.useState([]),[l,c]=m.useState(!1),[u,d]=m.useState(!1),[f,x]=m.useState(()=>{const ee=localStorage.getItem("isToasterMinimized");return ee===null?!1:ee==="true"});m.useEffect(()=>{localStorage.setItem("isToasterMinimized",f)},[f]);const[g,v]=m.useState([]),C=localStorage.getItem("isDateToasterFormat")||"date",[N,P]=m.useState(C);m.useEffect(()=>{localStorage.setItem("isDateToasterFormat",N)},[N]);const[I,R]=m.useState(0),F=m.useRef(null),[U,L]=m.useState(null),[z,Q]=m.useState(0),ne=1e4;m.useEffect(()=>{if(l||r.length===0||t){clearInterval(F.current);return}const ee=Date.now();return L(ee),F.current=setTimeout(()=>{R(ae=>(ae+1)%r.length),Q(0)},ne-z),()=>clearTimeout(F.current)},[l,r.length,t,I,z]),m.useEffect(()=>{I>=(r==null?void 0:r.length)&&R(0)},[r]);async function J(){try{d(!0);const ee=await fetch("https://dextrabothypev2.nftinit.io/api/hyper/analysis/getallmetrics/");if(!ee.ok)throw new Error(`Server responded with status ${ee.status}`);const ae=await ee.json();ae&&s(ae.refcodes)}catch(ee){return console.error("Error fetching metrics:",ee.message),null}finally{d(!1)}}m.useEffect(()=>{let ee;return f||(J(),ee=setInterval(()=>{J()},6e4)),()=>{ee&&clearInterval(ee)}},[f]),m.useEffect(()=>{var ee;if((r==null?void 0:r.length)>0)if((a==null?void 0:a.length)<(r==null?void 0:r.length)){const ae=[...a??[]],fe=Array.from({length:(r==null?void 0:r.length)-((a==null?void 0:a.length)??0)},(ye,ve)=>ve+((a==null?void 0:a.length)??0)),Ne=fe==null?void 0:fe.sort(()=>Math.random()-.5),he=[...ae,...Ne??[]];o(he);const ge=he==null?void 0:he.map(ye=>r==null?void 0:r[ye]);v(ge)}else{const ae=(ee=a==null?void 0:a.map(fe=>r==null?void 0:r[fe]))==null?void 0:ee.filter(Boolean);v(ae)}},[r]);const[X,re]=m.useState(!1);return i.jsxs("div",{className:"absolute right-6 bottom-[72px] sm:bottom-6 rounded-[20px] z-50",children:[f&&i.jsx("div",{onClick:()=>{x(ee=>{const ae=!ee;return localStorage.setItem("isToasterMinimized",ae?"true":"false"),ae})},className:"fixed bottom-10 right-4 z-50 cursor-pointer bg-[#2a2a2a]/60 hover:bg-[#2a2a2a] rounded-full w-12 h-12 flex items-center justify-center shadow-md group",children:i.jsx("img",{src:ake,alt:"Toggle",className:"w-8 h-8 opacity-90 group-hover:opacity-100"})}),(!f||X)&&i.jsxs("div",{style:{background:"rgba(32, 32, 32, 0.86)",boxShadow:"0px 4px 16px 0px rgba(0, 0, 0, 0.32)",backdropFilter:"blur(16px)"},className:`${X?"bounceShrink-Close-Toaster-Close":""} w-full h-full min-h-full relative rounded-[20px]`,children:[i.jsxs("div",{onClick:()=>{c(!l)},style:{backgroundColor:"rgba(40, 40, 42, 0.75)",backdropFilter:"blur(10px)"},className:`${(r==null?void 0:r.length)>0?"":"hidden"} cursor-pointer w-full h-[20px] rounded-t-full flex justify-center items-center relative`,children:[i.jsx("div",{className:"w-[36px] h-[4px] bg-[rgba(255,255,255,0.3)] rounded-[2px]"}),i.jsx("div",{onClick:ee=>{ee.stopPropagation(),re(!0),setTimeout(()=>{x(ae=>{const fe=!ae;return localStorage.setItem("isToasterMinimized",fe?"true":"false"),fe}),re(!1)},600)},className:"w-6 h-4 rounded-[2px] absolute group right-[14px]",children:i.jsx("span",{className:"flex items-center justify-center h-full",children:i.jsx(_Le,{className:"w-2 h-2 text-[#7A7A7A] group-hover:text-white"})})})]}),i.jsx("div",{className:`${l?"max-h-[70vh] lg:max-h-[75vh] min-h-[100px] overflow-y-scroll pl-2 py-2 pr-1 rounded-[20px]":"min-h-full h-full p-0 rounded-b-[20px]"} flex flex-col items-start gap-2 bg-transparent max-w-[356px] transition-all duration-300 overflow-hidden`,children:!l&&(r==null?void 0:r.length)>0?i.jsx("div",{style:{backgroundColor:" rgba(32, 32, 32, 0.86)",boxShadow:"0px 4px 16px 0px rgba(0, 0, 0, 0.64)",backdropFilter:"blur(16px)"},onMouseEnter:()=>{e.current&&(e.current.style.animationPlayState="paused"),n(!0),U&&Q(ee=>ee+(Date.now()-U))},onMouseLeave:()=>{e.current&&(e.current.style.animationPlayState="running"),n(!1)},className:"relative h-full w-full overflow-hidden",children:i.jsx("div",{className:"w-full h-full flex flex-col justify-start items-start animate-fade-slide transition-all duration-500",children:i.jsx(Kbe,{content:(pe=g[I])==null?void 0:pe.result,createdAt:(Y=g[I])==null?void 0:Y.created_at,category:(ie=g[I])==null?void 0:ie.category,metric:(oe=g[I])==null?void 0:oe.metric,metricId:(G=g[I])==null?void 0:G.metric_definition_id,isDeleted:(V=g[I])==null?void 0:V.is_deleted,isDateToasterFormat:N,setIsDateToasterFormat:P,isDropdownOpen:l,activeIndex:I,progressRef:e})},`toast-${I}`)}):g==null?void 0:g.map((ee,ae)=>i.jsx(Kbe,{content:ee==null?void 0:ee.result,createdAt:ee==null?void 0:ee.created_at,category:ee==null?void 0:ee.category,metric:ee==null?void 0:ee.metric,metricId:ee==null?void 0:ee.metric_definition_id,isDeleted:ee==null?void 0:ee.is_deleted,isDateToasterFormat:N,setIsDateToasterFormat:P,isDropdownOpen:l,progressRef:e},ae))})]})]})},Kbe=({content:e,createdAt:t,category:n,metric:r,metricId:s,isDeleted:a,isDateToasterFormat:o,setIsDateToasterFormat:l,isDropdownOpen:c,activeIndex:u,progressRef:d})=>{var P,I;function f({date:R}){const[F,U]=m.useState(Mo(R));return m.useEffect(()=>{const L=setInterval(()=>{U(Mo(R))},1e3);return()=>clearInterval(L)},[R]),i.jsxs("span",{className:"text-[#989898] text-[11px] font-normal font-inter leading-[13px] tracking-tight italic",children:["updated ",F==null?void 0:F.dateTime]})}const x=s===1||s===2||s===3,g=s===4||s===5||s===6,v=s===7||s===8||s===9,w=s===1||s===4||s===7,C=s===2||s===5||s===8,N=s===3||s===6||s===9;return i.jsxs("div",{onClick:R=>{R.preventDefault(),window.open(`/wallet-details/${(e==null?void 0:e.dextraaddress)||(e==null?void 0:e.sourceaddress)}`,"_blank")},style:x?{background:"rgba(32, 32, 32, 0.86)",boxShadow:"0px 4px 16px 0px rgba(0, 0, 0, 0.32)",backdropFilter:"blur(16px)"}:g?{background:"#FF42170A",boxShadow:"0px 4px 16px 0px rgba(0, 0, 0, 0.32)",backdropFilter:"blur(16px)"}:v?{background:"#00FF910A",boxShadow:"0px 4px 16px 0px rgba(0, 0, 0, 0.32)",backdropFilter:"blur(16px)"}:{},className:`${c?"rounded-[20px]":"rounded-b-[20px]"} ${x||v?"min-h-[107px]":g?"min-h-[123px]":""}
w-full flex gap-2 items-start justify-start px-3 pt-3 pb-2 bg-[#2b2b2b] hover:bg-[#404040] relative overflow-hidden cursor-pointer`,children:[i.jsx("div",{className:"w-10 h-10 rounded-[256px] blur-xl absolute -z-10 top-2 left-2"}),i.jsx("div",{style:x?{backgroundColor:"#FFC526"}:g?{background:"linear-gradient(180deg, #FF7300 0%, #FF2525 100%)",backgroundBlendMode:"lighten, normal, normal",boxShadow:"0px 4px 24px 0px rgba(255, 96, 10, 0.32), 0px 1px 1px 0px rgba(255, 255, 255, 0.32) inset"}:v?{background:"linear-gradient(180deg, #00FF90 0%, #00FF4D 100%)",boxShadow:"0px 4px 24px 0px rgba(44, 255, 163, 0.32), 0px 1px 1px 0px rgba(255, 255, 255, 0.32) inset"}:{},className:`${c?"":"toaster-animation-shake-animate"} flex justify-center items-center overflow-hidden w-10 h-10 min-w-10 min-h-10 rounded-full`,children:i.jsx("img",{src:`${x?ake:g?ske:v?jyt:""}`,alt:"",className:`${x?"w-[40px] h-[40px] min-w-[40px] min-h-[40px]":"w-[24px] h-[24px] min-w-[24px] min-h-[24px]"}`,loading:"lazy",onError:R=>fm(R)})}),i.jsxs("div",{className:"flex flex-col items-start justify-start gap-[3px] w-full",children:[i.jsxs("div",{className:"flex justify-between items-center gap-1",children:[i.jsxs("p",{className:"text-white text-[13px] font-semibold font-['Manrope'] leading-[16px]",children:[i.jsxs("span",{className:"inline-flex justify-start items-center gap-1 cursor-pointer min-w-max max-w-max h-[18px] p-1 mr-1 bg-white/[0.06] rounded-md",children:[i.jsx("span",{className:"text-white text-[13px] font-semibold font-manrope leading-none ",children:e!=null&&e.dextraaddress||e!=null&&e.sourceaddress?((P=(e==null?void 0:e.dextraaddress)||(e==null?void 0:e.sourceaddress))==null?void 0:P.slice(0,5))+".."+((I=(e==null?void 0:e.dextraaddress)||(e==null?void 0:e.sourceaddress))==null?void 0:I.slice(-4)):"--"}),i.jsx("img",{onClick:R=>{R.stopPropagation(),navigator.clipboard.writeText((e==null?void 0:e.dextraaddress)||(e==null?void 0:e.sourceaddress)),rn.success("Successfully copied.",{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(103, 255, 189, 0.16)",width:"280px",minWidth:"280px",height:"40px",backdropFilter:"blur(16px)"},iconTheme:{primary:"#67FFBD",secondary:"#276047"}})},src:wo,alt:"",className:"cursor-pointer"})]}),x?`is one of ${w?"today's":C?"week's":N?"month's":""} most profitable Top Follower Wallets!`:g?`has generated $${e!=null&&e.earned_rpnl?Er(e==null?void 0:e.earned_rpnl):"-"} in profits for its followers ${w?"today":C?"this week":N?"this month":""} - a wallet you’ll want to watch!`:v?`is one of ${w?"today's":C?"this week's":N?"this month's":""} most copied wallets!`:""]}),i.jsx("div",{className:`${x?"-mt-[18px]":g?"-mt-[30px]":v?"-mt-[16px]":""} w-[18px] h-[18px] min-w-[18px] min-h-[18px] flex justify-center items-start rounded `,children:i.jsx("img",{src:rae,alt:""})})]}),i.jsxs("div",{className:"flex justify-start items-center gap-1 mt-2",children:[i.jsxs("div",{className:`${c?"":"toaster-animation-shake-new-profit-animate"} p-1.5 bg-[#67ffbd]/20 rounded-md inline-flex justify-center items-center gap-1 max-h-5`,children:[v&&i.jsx("img",{src:Eyt,alt:"",className:"w-[14px] h-[14px]"}),g&&i.jsx("img",{src:_yt,alt:"",className:"w-[14px] h-[10px]"}),i.jsx("div",{className:"justify-start text-[#67ffbd] text-[11px] font-semibold font-['Manrope'] leading-[8px]",children:x?`+$${e!=null&&e.rpnl?Er(e==null?void 0:e.rpnl):"-"}`:g?`+$${e!=null&&e.earned_rpnl?Er(e==null?void 0:e.earned_rpnl):"-"}`:v?Er(e==null?void 0:e.copier_count):""})]}),i.jsx("div",{className:`${x?"bg-white/20":g?"bg-[#FF670029]":v?"bg-[#67FFBD29]":""} p-1.5 rounded-md inline-flex justify-center items-center gap-1`,children:i.jsx("div",{className:`${x?"text-white":g?"text-[#FF6700]":v?"text-[#67FFBD]":""} justify-start text-[11px] font-semibold font-['Manrope'] leading-[8px]`,children:x?"Top Follower Wallets":g?"Top Source Wallets":v?"Most Copied Wallets":""})}),i.jsx("div",{className:`${x?"bg-white/20":g?"bg-[#FF670029]":v?"bg-[#67FFBD29]":""} w-max p-1.5 rounded-md inline-flex justify-center items-center gap-1"
`,children:i.jsx("div",{className:`${x?"text-white":g?"text-[#FF6700]":v?"text-[#67FFBD]":""} justify-start text-[11px] font-semibold font-['Manrope'] leading-[8px]`,children:w?"1D":C?"7D":N?"30D":""})})]}),i.jsxs("div",{className:`${c?"justify-start":"justify-between"} flex items-center w-full mt-1.5`,children:[i.jsx("div",{onClick:R=>{R.stopPropagation(),l(o=="date"?"time":"date")},className:"flex justify-end items-center text-[#989898] text-[11px] font-medium font-['Inter'] leading-[13px] tracking-tight cursor-pointer min-w-max w-max italic",children:o=="date"?i.jsx(f,{date:t}):su(t)}),!c&&i.jsx("div",{className:"w-[26px] h-[3px] bg-[#3a3a3a] rounded overflow-hidden",children:!c&&i.jsx("div",{ref:d,className:"h-full bg-white progress-bar-animate"},`progress-${u}`)})]})]})]})},OLt=()=>i.jsx("div",{onClick:()=>{window.open("https://x.com/dextrabot","_blank")},className:"flex justify-center items-center bg-transparent rounded-full cursor-pointer h-6 w-6 min-h-6",children:i.jsx("img",{src:Nyt,alt:"",className:"w-[14px] h-[14px]"})}),MLt=()=>i.jsx("div",{onClick:()=>{window.open("https://discord.gg/dextrabot","_blank")},className:"flex justify-center items-center gap-2.5 bg-transparent rounded-2xl cursor-pointer h-6 w-6 min-h-6",children:i.jsx("img",{src:ike,alt:"",className:"w-[14px] h-[14px]"})}),RLt=()=>i.jsx("div",{onClick:()=>{window.open("https://t.me/Dextrabot_Official","_blank")},className:"flex justify-center items-center gap-2.5 bg-transparent rounded-2xl cursor-pointer h-6 w-6 min-h-6",children:i.jsx("img",{src:Ayt,alt:"",className:"w-[14px] h-[14px]"})}),LLt=()=>i.jsxs("div",{onClick:()=>window.open("https://docs.dextrabot.com/","_blank"),className:"h-6 w-max min-h-6 py-[5px] rounded-[256px] flex justify-start items-center gap-2 cursor-pointer",children:[i.jsx("img",{src:l5,className:"w-[14px] h-[14px]"}),i.jsx("div",{className:"min-w-max text-white text-xs font-medium font-manrope leading-none pointer-events-none",children:"Docs"})]}),DLt=({open:e,setOpen:t,favoriteName:n,setFavoriteName:r,likeError:s,like:a,setLikeError:o})=>i.jsxs(Ea,{open:e,onClose:()=>{},className:"relative z-50 font-manrope",children:[i.jsx(ja,{transition:!0,style:{backgroundColor:"rgba(0, 0, 0, 0.48)"},className:"fixed inset-0 transition-opacity data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in"}),i.jsx("div",{className:"fixed inset-0 z-50 w-screen overflow-y-auto",children:i.jsx("div",{className:"flex min-h-full items-end justify-center p-4 text-center sm:items-center sm:p-0",children:i.jsx(xa,{transition:!0,className:"relative transform overflow-hidden bg-[#101010] text-left shadow-xl transition-all data-[closed]:translate-y-4 data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in data-[closed]:sm:translate-y-0 data-[closed]:sm:scale-95 rounded-3xl",children:i.jsx("div",{className:"flex flex-col justify-start items-center gap-8 w-[400px] h-max relative bg-[#252525] rounded-3xl pt-4 pb-[34px]",children:i.jsxs(i.Fragment,{children:[i.jsx("div",{onClick:()=>{t(!1),r(""),o("")},className:"cursor-pointer flex w-full items-center justify-end absolute right-2 top-1",children:i.jsx("span",{className:"absolute top-2 right-2 w-9 h-9 rounded-full p-1 flex justify-center items-center hover:bg-[#7535FE]",children:i.jsx("img",{className:"p-1",src:Ba})})}),i.jsx("div",{className:"pt-4",children:i.jsx("img",{src:Zbt,alt:"",className:"w-[64px h-[64px]"})}),i.jsxs("div",{className:"flex flex-col items-center justify-start gap-4",children:[i.jsx("div",{className:"w-80 text-center text-white text-2xl font-semibold font-manrope leading-7 pt-[3px]",children:"Track Wallet"}),i.jsx("div",{className:"w-[248px] text-center text-white/60 text-sm font-medium font-manrope leading-none tracking-tight -mt-[8px]",children:"Enter tag for your wallet"}),i.jsxs("div",{className:"flex justify-start items-center gap-1.5 w-full pt-[39px] pl-[20px]",children:[i.jsx("div",{className:"text-[#b7b7b7] text-[13px] font-semibold font-manrope leading-[8px]",children:"Tag"}),i.jsx("div",{className:"text-[#7b7b7b] text-sm font-medium font-inter leading-[8px]",children:"(ex:twain_wallet)"})]}),i.jsx("input",{type:"text",value:n,onChange:l=>r(l.target.value),placeholder:"Wallet Tag",className:"px-2.5 py-3 focus:outline-none focus:ring-0 outline-none w-[286px] min-w-[286px] h-8 bg-[#1b1b1b] rounded-[10px] border border-[#303030] text-white placeholder:text-[#7b7b7b] placeholder:text-sm placeholder:font-medium placeholder:font-inter placeholder:leading-[8px] -mt-[2px]"}),i.jsxs("div",{onClick:()=>{a(n)},className:"w-[285px] h-8 pl-2 pr-3.5 py-3 bg-[#7445ff] rounded-[10px] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-[#8860ff] justify-center items-center gap-1.5 inline-flex cursor-pointer -mt-[2px]",children:[i.jsx("div",{"data-svg-wrapper":!0,children:i.jsxs("svg",{width:"19",height:"18",viewBox:"0 0 19 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("path",{d:"M5 9H14",stroke:"white",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),i.jsx("path",{d:"M9.5 13.5V4.5",stroke:"white",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})}),i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px]",children:"Track"})]}),i.jsx("div",{className:"text-[#ff6e67] text-xs font-semibold font-manrope absolute bottom-2.5 mx-auto w-full pl-[58px]",children:s&&s})]})]})})})})})]});function v5({walletAddress:e,children:t}){const{isConnected:n,address:r}=ns(),{trackedWatchList:s,getTrackedWatchList:a,setSignModalOpen:o}=m.useContext(Qr),[l,c]=m.useState(""),[u,d]=m.useState(!1),[f,x]=m.useState(""),g=async C=>{try{const N=window.localStorage.getItem("hyperToken"),P="https://dextrabothypev2.nftinit.io/api/hyper/tracker/save/",I=window.localStorage.getItem("hyperAddress");if(N||o(!0),!C){x("Please enter a wallet label.");return}const R=await fetch(P,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:r?r.toLowerCase():I,token:N,track_address:e,tag:C})});R.ok;const F=await R.json();F.success?(a(),c(""),d(!1),x(""),rn.success(i.jsxs(i.Fragment,{children:[i.jsx("span",{children:e.slice(0,5)+"..."+e.slice(-3)}),i.jsxs("span",{style:{color:"#67ffbd",paddingLeft:"5px"},children:[" ","added to tracked wallets"]})]}),{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(103, 255, 189, 0.32)",width:"380px",minWidth:"380px",height:"40px",backdropFilter:"blur(48px)"},iconTheme:{primary:"#67FFBD",secondary:"#276047"}})):(console.log(F.error_message),rn.error(F.error_message),x(F.error_message))}catch(N){console.error("Error in like function:",N),rn.error(N.message||"Something went wrong!"),x(N.message)}},v=async()=>{try{const C=window.localStorage.getItem("hyperToken"),N=window.localStorage.getItem("hyperAddress"),P="https://dextrabothypev2.nftinit.io/api/hyper/tracker/unfollow/";C||o(!0);const I=await fetch(P,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:r?r.toLowerCase():N,token:C,track_address:e})});if(!I.ok)throw new Error(`Failed to unlike: ${I.status} ${I.statusText}`);const R=await I.json();R.success?(a(),rn.success(i.jsxs(i.Fragment,{children:[i.jsx("span",{children:e.slice(0,5)+"..."+e.slice(-3)}),i.jsxs("span",{style:{color:"#ff797c",paddingLeft:"5px"},children:[" ","removed from tracked wallets"]})]}),{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(255, 121, 124, 0.32)",width:"400px",minWidth:"400px",height:"40px",backdropFilter:"blur(48px)"},iconTheme:{primary:"#ff797c",secondary:"#7d3031"}})):(console.error(R.error_message),rn.error(R.error_message))}catch(C){console.error("Error in unlike function:",C),rn.error(C.message||"Something went wrong!")}},w=()=>{window.localStorage.getItem("hyperToken")?d(!0):o(!0)};return i.jsxs(i.Fragment,{children:[i.jsx(DLt,{open:u,setOpen:d,like:g,favoriteName:l,setFavoriteName:c,likeError:f,setLikeError:x}),i.jsx("div",{className:"",onClick:()=>{s!=null&&s.some(C=>C.wallet_address===e)?v():w()},children:t})]})}function BLt({open:e,setOpen:t,copyTradeSave:n}){return i.jsxs(Ea,{open:e,onClose:t,className:"relative z-50 font-manrope",children:[i.jsx(ja,{transition:!0,style:{backgroundColor:"rgba(0, 0, 0, 0.48)"},className:"fixed inset-0 transition-opacity data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in"}),i.jsx("div",{className:"fixed inset-0 z-50 w-screen overflow-y-auto",children:i.jsx("div",{className:"flex min-h-full items-end justify-center p-4 text-center sm:items-center sm:p-0",children:i.jsx(xa,{transition:!0,className:"relative transform overflow-hidden bg-[#101010] text-left shadow-xl transition-all data-[closed]:translate-y-4 data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in data-[closed]:sm:translate-y-0 data-[closed]:sm:scale-95 rounded-3xl",children:i.jsx("div",{className:"flex flex-col justify-start items-center gap-8 w-[400px] h-max relative bg-[#252525] rounded-3xl pt-4 pb-6",children:i.jsxs(i.Fragment,{children:[i.jsx("div",{onClick:()=>{t(!1)},className:"cursor-pointer flex w-full items-center justify-end absolute right-2 top-1",children:i.jsx("span",{className:"absolute top-2 right-2 w-9 h-9 rounded-full p-1 flex justify-center items-center hover:bg-[#7535FE]",children:i.jsx("img",{className:"p-1",src:Ba})})}),i.jsx("div",{className:"pt-4",children:i.jsx("img",{src:Gi,alt:"",className:"w-[86px h-[86px]"})}),i.jsxs("div",{className:"flex flex-col justify-start items-center gap-2",children:[i.jsx("div",{className:"w-80 text-center text-white text-2xl font-semibold font-manropeleading-7",children:"Are you sure?"}),i.jsx("div",{className:"w-[348px] text-center text-white/60 text-[16px] font-medium font-manrope leading-5",children:"You have not set a Stop Loss or Take Profit for this trade. In order to set a secondary security option for potential Hyperliquid data delays, server issues, or other technical disruptions, you may want to set up your own stop loss and take profit values."})]}),i.jsxs("div",{className:"flex items-center justify-center gap-4",children:[i.jsx("div",{onClick:()=>{t(!1)},className:"h-8 px-4 py-3 rounded-xl shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-white justify-center items-center gap-2.5 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px]",children:"Cancel"})}),i.jsx("div",{onClick:()=>{n()},className:"h-8 px-2.5 bg-[#7445ff] rounded-[10px] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-[#8860ff] justify-center items-center gap-1.5 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px]",children:"Yes"})})]})]})})})})})]})}const ra=(e,t=null)=>{t&&e.target.src===t?e.target.src=Va:t&&e.target.src!==t?e.target.src=t:e.target.src!==Va&&(e.target.src=Va)};function $Lt({positions:e,loading:t}){const[n,r]=m.useState(!1),[s,a]=m.useState("upnl"),[o,l]=m.useState("desc"),c=d=>{s===d?l(o==="asc"?"desc":"asc"):(a(d),l("asc"))},u=m.useMemo(()=>{if(!e||e.length===0)return[];const d=[...e];return s&&d.sort((f,x)=>{var g,v;if(s==="coin"){const w=((g=f.asset)==null?void 0:g.toLowerCase())||"",C=((v=x.asset)==null?void 0:v.toLowerCase())||"";return w<C?o==="asc"?-1:1:w>C?o==="asc"?1:-1:0}if(s==="upnl"){const w=parseFloat(f.unrealizedPnl)||0,C=parseFloat(x.unrealizedPnl)||0;return w<C?o==="asc"?-1:1:w>C?o==="asc"?1:-1:0}return 0}),d},[e,s,o]);return m.useEffect(()=>{if(t)r(!1);else{r(!1);const d=setTimeout(()=>{r(!0)},500);return()=>clearTimeout(d)}},[t]),t||!n?i.jsx("div",{className:"flex w-full justify-center items-center text-center h-[36vh] max-h-[170px]",children:i.jsx(Da,{})}):!u||u.length===0?i.jsx("div",{className:"flex w-full justify-center items-center text-center h-[36vh] max-h-[170px]",children:i.jsxs("div",{className:"flex flex-col justify-center items-center gap-3",children:[i.jsx("img",{src:ac,alt:""}),i.jsx("div",{className:"flex flex-col items-center h-max gap-3",children:i.jsx("div",{className:"text-[#d3d3d3] text-sm font-semibold font-manrope leading-[8px] pt-3",children:"No open positions are currently available"})})]})}):i.jsx("div",{className:"relative w-full",children:i.jsx("div",{className:"w-full overflow-y-auto max-h-[156px] h-full flex-grow mt-[1px] mb-3 pb-24",children:i.jsxs("table",{className:"w-full relative border-separate border-spacing-y-1",children:[i.jsx("thead",{className:"sticky top-0 z-[3] whitespace-nowrap",children:i.jsxs("tr",{className:"w-full z-[4] font-semibold leading-[13px] tracking-[0.26px] text-[#9b9b9b] bg-[#242424] text-[13px] font-manrope mr-3",children:[i.jsx("th",{scope:"col",className:"sticky left-0 h-10 pl-2 sm:pl-6 min-w-[80px] z-[8] cursor-pointer",onClick:()=>c("coin"),children:i.jsxs("div",{className:"flex items-center justify-start w-full gap-1 min-w-max max-w-max",children:["Coin",s==="coin"?o==="asc"?i.jsx(P3,{}):i.jsx(I3,{}):i.jsx(F3,{})]})}),i.jsx("th",{scope:"col",className:"px-1",children:i.jsx("div",{className:"flex items-center justify-start w-full gap-1 min-w-max max-w-max",children:"Type"})}),i.jsx("th",{scope:"col",className:"px-4 text-right cursor-pointer",onClick:()=>c("upnl"),children:i.jsxs("div",{className:"inline-flex items-center justify-end w-full gap-1",children:[i.jsx("span",{children:"uPnL"}),s==="upnl"?o==="asc"?i.jsx(P3,{}):i.jsx(I3,{}):i.jsx(F3,{})]})})]})}),i.jsx("tbody",{children:u.map((d,f)=>{const x=parseFloat(d.unrealizedPnl)>=0,g=d.type==="Long"?"text-[#67FFBD] rotate-180":"text-[#FF797C]";return i.jsxs("tr",{className:`relative group hover:bg-[#222222] text-white h-[32px] max-h-[32px] rounded-2xl ${f%2===0?"bg-[#202020]":"bg-[#2D2D2D]"}`,children:[i.jsx("td",{scope:"row",className:"sticky left-0 z-[2] rounded-l-xl",children:i.jsx("div",{onClick:()=>{window.open(`/terminal/${d==null?void 0:d.asset}`,"_blank")},className:"flex justify-start items-center gap-2 pl-2 sm:pl-6 h-8 max-h-14 cursor-pointer",children:i.jsxs("div",{className:"flex justify-start items-center gap-1.5",children:[i.jsx("div",{className:"w-5 h-5 rounded-full",children:i.jsx("img",{src:`https://app.hyperliquid.xyz/coins/${d==null?void 0:d.asset}.svg`,alt:d==null?void 0:d.asset,className:"rounded-full w-5 h-5 min-w-5 min-h-5",loading:"lazy",onError:v=>ra(v)})}),i.jsx("div",{className:"text-white text-sm font-semibold font-manrope leading-[13px] tracking-tight",children:d.asset})]})})}),i.jsx("td",{children:i.jsx("div",{className:"flex justify-start items-center gap-2 h-8 max-h-8",children:i.jsxs("div",{className:`${d.type==="Long"?"text-[#67ffbd] bg-[#67ffbd]/20":"text-[#ff787b] bg-[#ff797c]/20"} h-5 pl-1 pr-1.5 py-1 rounded-md justify-start items-center gap-0.5 inline-flex`,children:[i.jsx("div",{className:"w-3 h-3 justify-center items-center flex",children:i.jsx("div",{className:"w-3 h-3 relative",children:i.jsx(Ps,{className:`${g} w-3 h-3`})})}),i.jsx("div",{className:"text-[11px] font-semibold font-manrope leading-[8px] tracking-wide uppercase",children:d.type})]})})}),i.jsx("td",{className:"rounded-r-xl text-right pr-2",children:i.jsx("div",{className:`${x?"text-[#67ffbd]":"text-[#ff787b]"} text-sm font-semibold font-manrope leading-[13px] tracking-tight`,children:`$${Er(d.unrealizedPnl||0)}`})})]},f)})})]})})})}const{min:ULt,max:zLt}=Math,s3=(e,t=0,n=1)=>ULt(zLt(t,e),n),ble=e=>{e._clipped=!1,e._unclipped=e.slice(0);for(let t=0;t<=3;t++)t<3?((e[t]<0||e[t]>255)&&(e._clipped=!0),e[t]=s3(e[t],0,255)):t===3&&(e[t]=s3(e[t],0,1));return e},kLe={};for(let e of["Boolean","Number","String","Function","Array","Date","RegExp","Undefined","Null"])kLe[`[object ${e}]`]=e.toLowerCase();function Vi(e){return kLe[Object.prototype.toString.call(e)]||"object"}const Ii=(e,t=null)=>e.length>=3?Array.prototype.slice.call(e):Vi(e[0])=="object"&&t?t.split("").filter(n=>e[0][n]!==void 0).map(n=>e[0][n]):e[0].slice(0),HA=e=>{if(e.length<2)return null;const t=e.length-1;return Vi(e[t])=="string"?e[t].toLowerCase():null},{PI:k$,min:TLe,max:ILe}=Math,tp=e=>Math.round(e*100)/100,nte=e=>Math.round(e*100)/100,pg=k$*2,jW=k$/3,HLt=k$/180,VLt=180/k$;function PLe(e){return[...e.slice(0,3).reverse(),...e.slice(3)]}const ji={format:{},autodetect:[]};let Zr=class{constructor(...t){const n=this;if(Vi(t[0])==="object"&&t[0].constructor&&t[0].constructor===this.constructor)return t[0];let r=HA(t),s=!1;if(!r){s=!0,ji.sorted||(ji.autodetect=ji.autodetect.sort((a,o)=>o.p-a.p),ji.sorted=!0);for(let a of ji.autodetect)if(r=a.test(...t),r)break}if(ji.format[r]){const a=ji.format[r].apply(null,s?t:t.slice(0,-1));n._rgb=ble(a)}else throw new Error("unknown format: "+t);n._rgb.length===3&&n._rgb.push(1)}toString(){return Vi(this.hex)=="function"?this.hex():`[${this._rgb.join(",")}]`}};const WLt="3.1.2",xi=(...e)=>new Zr(...e);xi.version=WLt;const yN={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",laserlemon:"#ffff54",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrod:"#fafad2",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",maroon2:"#7f0000",maroon3:"#b03060",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",purple2:"#7f007f",purple3:"#a020f0",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},qLt=/^#?([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/,GLt=/^#?([A-Fa-f0-9]{8}|[A-Fa-f0-9]{4})$/,FLe=e=>{if(e.match(qLt)){(e.length===4||e.length===7)&&(e=e.substr(1)),e.length===3&&(e=e.split(""),e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]);const t=parseInt(e,16),n=t>>16,r=t>>8&255,s=t&255;return[n,r,s,1]}if(e.match(GLt)){(e.length===5||e.length===9)&&(e=e.substr(1)),e.length===4&&(e=e.split(""),e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]+e[3]+e[3]);const t=parseInt(e,16),n=t>>24&255,r=t>>16&255,s=t>>8&255,a=Math.round((t&255)/255*100)/100;return[n,r,s,a]}throw new Error(`unknown hex color: ${e}`)},{round:vP}=Math,OLe=(...e)=>{let[t,n,r,s]=Ii(e,"rgba"),a=HA(e)||"auto";s===void 0&&(s=1),a==="auto"&&(a=s<1?"rgba":"rgb"),t=vP(t),n=vP(n),r=vP(r);let l="000000"+(t<<16|n<<8|r).toString(16);l=l.substr(l.length-6);let c="0"+vP(s*255).toString(16);switch(c=c.substr(c.length-2),a.toLowerCase()){case"rgba":return`#${l}${c}`;case"argb":return`#${c}${l}`;default:return`#${l}`}};Zr.prototype.name=function(){const e=OLe(this._rgb,"rgb");for(let t of Object.keys(yN))if(yN[t]===e)return t.toLowerCase();return e};ji.format.named=e=>{if(e=e.toLowerCase(),yN[e])return FLe(yN[e]);throw new Error("unknown color name: "+e)};ji.autodetect.push({p:5,test:(e,...t)=>{if(!t.length&&Vi(e)==="string"&&yN[e.toLowerCase()])return"named"}});Zr.prototype.alpha=function(e,t=!1){return e!==void 0&&Vi(e)==="number"?t?(this._rgb[3]=e,this):new Zr([this._rgb[0],this._rgb[1],this._rgb[2],e],"rgb"):this._rgb[3]};Zr.prototype.clipped=function(){return this._rgb._clipped||!1};const $0={Kn:18,labWhitePoint:"d65",Xn:.95047,Yn:1,Zn:1.08883,t0:.137931034,t1:.206896552,t2:.12841855,t3:.008856452,kE:216/24389,kKE:8,kK:24389/27,RefWhiteRGB:{X:.95047,Y:1,Z:1.08883},MtxRGB2XYZ:{m00:.4124564390896922,m01:.21267285140562253,m02:.0193338955823293,m10:.357576077643909,m11:.715152155287818,m12:.11919202588130297,m20:.18043748326639894,m21:.07217499330655958,m22:.9503040785363679},MtxXYZ2RGB:{m00:3.2404541621141045,m01:-.9692660305051868,m02:.055643430959114726,m10:-1.5371385127977166,m11:1.8760108454466942,m12:-.2040259135167538,m20:-.498531409556016,m21:.041556017530349834,m22:1.0572251882231791},As:.9414285350000001,Bs:1.040417467,Cs:1.089532651,MtxAdaptMa:{m00:.8951,m01:-.7502,m02:.0389,m10:.2664,m11:1.7135,m12:-.0685,m20:-.1614,m21:.0367,m22:1.0296},MtxAdaptMaI:{m00:.9869929054667123,m01:.43230526972339456,m02:-.008528664575177328,m10:-.14705425642099013,m11:.5183602715367776,m12:.04004282165408487,m20:.15996265166373125,m21:.0492912282128556,m22:.9684866957875502}},KLt=new Map([["a",[1.0985,.35585]],["b",[1.0985,.35585]],["c",[.98074,1.18232]],["d50",[.96422,.82521]],["d55",[.95682,.92149]],["d65",[.95047,1.08883]],["e",[1,1,1]],["f2",[.99186,.67393]],["f7",[.95041,1.08747]],["f11",[1.00962,.6435]],["icc",[.96422,.82521]]]);function Lg(e){const t=KLt.get(String(e).toLowerCase());if(!t)throw new Error("unknown Lab illuminant "+e);$0.labWhitePoint=e,$0.Xn=t[0],$0.Zn=t[1]}function n_(){return $0.labWhitePoint}const yle=(...e)=>{e=Ii(e,"lab");const[t,n,r]=e,[s,a,o]=YLt(t,n,r),[l,c,u]=MLe(s,a,o);return[l,c,u,e.length>3?e[3]:1]},YLt=(e,t,n)=>{const{kE:r,kK:s,kKE:a,Xn:o,Yn:l,Zn:c}=$0,u=(e+16)/116,d=.002*t+u,f=u-.005*n,x=d*d*d,g=f*f*f,v=x>r?x:(116*d-16)/s,w=e>a?Math.pow((e+16)/116,3):e/s,C=g>r?g:(116*f-16)/s,N=v*o,P=w*l,I=C*c;return[N,P,I]},EW=e=>{const t=Math.sign(e);return e=Math.abs(e),(e<=.0031308?e*12.92:1.055*Math.pow(e,1/2.4)-.055)*t},MLe=(e,t,n)=>{const{MtxAdaptMa:r,MtxAdaptMaI:s,MtxXYZ2RGB:a,RefWhiteRGB:o,Xn:l,Yn:c,Zn:u}=$0,d=l*r.m00+c*r.m10+u*r.m20,f=l*r.m01+c*r.m11+u*r.m21,x=l*r.m02+c*r.m12+u*r.m22,g=o.X*r.m00+o.Y*r.m10+o.Z*r.m20,v=o.X*r.m01+o.Y*r.m11+o.Z*r.m21,w=o.X*r.m02+o.Y*r.m12+o.Z*r.m22,C=(e*r.m00+t*r.m10+n*r.m20)*(g/d),N=(e*r.m01+t*r.m11+n*r.m21)*(v/f),P=(e*r.m02+t*r.m12+n*r.m22)*(w/x),I=C*s.m00+N*s.m10+P*s.m20,R=C*s.m01+N*s.m11+P*s.m21,F=C*s.m02+N*s.m12+P*s.m22,U=EW(I*a.m00+R*a.m10+F*a.m20),L=EW(I*a.m01+R*a.m11+F*a.m21),z=EW(I*a.m02+R*a.m12+F*a.m22);return[U*255,L*255,z*255]},vle=(...e)=>{const[t,n,r,...s]=Ii(e,"rgb"),[a,o,l]=RLe(t,n,r),[c,u,d]=XLt(a,o,l);return[c,u,d,...s.length>0&&s[0]<1?[s[0]]:[]]};function XLt(e,t,n){const{Xn:r,Yn:s,Zn:a,kE:o,kK:l}=$0,c=e/r,u=t/s,d=n/a,f=c>o?Math.pow(c,1/3):(l*c+16)/116,x=u>o?Math.pow(u,1/3):(l*u+16)/116,g=d>o?Math.pow(d,1/3):(l*d+16)/116;return[116*x-16,500*(f-x),200*(x-g)]}function _W(e){const t=Math.sign(e);return e=Math.abs(e),(e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4))*t}const RLe=(e,t,n)=>{e=_W(e/255),t=_W(t/255),n=_W(n/255);const{MtxRGB2XYZ:r,MtxAdaptMa:s,MtxAdaptMaI:a,Xn:o,Yn:l,Zn:c,As:u,Bs:d,Cs:f}=$0;let x=e*r.m00+t*r.m10+n*r.m20,g=e*r.m01+t*r.m11+n*r.m21,v=e*r.m02+t*r.m12+n*r.m22;const w=o*s.m00+l*s.m10+c*s.m20,C=o*s.m01+l*s.m11+c*s.m21,N=o*s.m02+l*s.m12+c*s.m22;let P=x*s.m00+g*s.m10+v*s.m20,I=x*s.m01+g*s.m11+v*s.m21,R=x*s.m02+g*s.m12+v*s.m22;return P*=w/u,I*=C/d,R*=N/f,x=P*a.m00+I*a.m10+R*a.m20,g=P*a.m01+I*a.m11+R*a.m21,v=P*a.m02+I*a.m12+R*a.m22,[x,g,v]};Zr.prototype.lab=function(){return vle(this._rgb)};const QLt=(...e)=>new Zr(...e,"lab");Object.assign(xi,{lab:QLt,getLabWhitePoint:n_,setLabWhitePoint:Lg});ji.format.lab=yle;ji.autodetect.push({p:2,test:(...e)=>{if(e=Ii(e,"lab"),Vi(e)==="array"&&e.length===3)return"lab"}});Zr.prototype.darken=function(e=1){const t=this,n=t.lab();return n[0]-=$0.Kn*e,new Zr(n,"lab").alpha(t.alpha(),!0)};Zr.prototype.brighten=function(e=1){return this.darken(-e)};Zr.prototype.darker=Zr.prototype.darken;Zr.prototype.brighter=Zr.prototype.brighten;Zr.prototype.get=function(e){const[t,n]=e.split("."),r=this[t]();if(n){const s=t.indexOf(n)-(t.substr(0,2)==="ok"?2:0);if(s>-1)return r[s];throw new Error(`unknown channel ${n} in mode ${t}`)}else return r};const{pow:ZLt}=Math,JLt=1e-7,eDt=20;Zr.prototype.luminance=function(e,t="rgb"){if(e!==void 0&&Vi(e)==="number"){if(e===0)return new Zr([0,0,0,this._rgb[3]],"rgb");if(e===1)return new Zr([255,255,255,this._rgb[3]],"rgb");let n=this.luminance(),r=eDt;const s=(o,l)=>{const c=o.interpolate(l,.5,t),u=c.luminance();return Math.abs(e-u)<JLt||!r--?c:u>e?s(o,c):s(c,l)},a=(n>e?s(new Zr([0,0,0]),this):s(this,new Zr([255,255,255]))).rgb();return new Zr([...a,this._rgb[3]])}return tDt(...this._rgb.slice(0,3))};const tDt=(e,t,n)=>(e=kW(e),t=kW(t),n=kW(n),.2126*e+.7152*t+.0722*n),kW=e=>(e/=255,e<=.03928?e/12.92:ZLt((e+.055)/1.055,2.4)),Fu={},vN=(e,t,n=.5,...r)=>{let s=r[0]||"lrgb";if(!Fu[s]&&!r.length&&(s=Object.keys(Fu)[0]),!Fu[s])throw new Error(`interpolation mode ${s} is not defined`);return Vi(e)!=="object"&&(e=new Zr(e)),Vi(t)!=="object"&&(t=new Zr(t)),Fu[s](e,t,n).alpha(e.alpha()+n*(t.alpha()-e.alpha()))};Zr.prototype.mix=Zr.prototype.interpolate=function(e,t=.5,...n){return vN(this,e,t,...n)};Zr.prototype.premultiply=function(e=!1){const t=this._rgb,n=t[3];return e?(this._rgb=[t[0]*n,t[1]*n,t[2]*n,n],this):new Zr([t[0]*n,t[1]*n,t[2]*n,n],"rgb")};const{sin:nDt,cos:rDt}=Math,LLe=(...e)=>{let[t,n,r]=Ii(e,"lch");return isNaN(r)&&(r=0),r=r*HLt,[t,rDt(r)*n,nDt(r)*n]},wle=(...e)=>{e=Ii(e,"lch");const[t,n,r]=e,[s,a,o]=LLe(t,n,r),[l,c,u]=yle(s,a,o);return[l,c,u,e.length>3?e[3]:1]},sDt=(...e)=>{const t=PLe(Ii(e,"hcl"));return wle(...t)},{sqrt:iDt,atan2:aDt,round:oDt}=Math,DLe=(...e)=>{const[t,n,r]=Ii(e,"lab"),s=iDt(n*n+r*r);let a=(aDt(r,n)*VLt+360)%360;return oDt(s*1e4)===0&&(a=Number.NaN),[t,s,a]},Cle=(...e)=>{const[t,n,r,...s]=Ii(e,"rgb"),[a,o,l]=vle(t,n,r),[c,u,d]=DLe(a,o,l);return[c,u,d,...s.length>0&&s[0]<1?[s[0]]:[]]};Zr.prototype.lch=function(){return Cle(this._rgb)};Zr.prototype.hcl=function(){return PLe(Cle(this._rgb))};const lDt=(...e)=>new Zr(...e,"lch"),cDt=(...e)=>new Zr(...e,"hcl");Object.assign(xi,{lch:lDt,hcl:cDt});ji.format.lch=wle;ji.format.hcl=sDt;["lch","hcl"].forEach(e=>ji.autodetect.push({p:2,test:(...t)=>{if(t=Ii(t,e),Vi(t)==="array"&&t.length===3)return e}}));Zr.prototype.saturate=function(e=1){const t=this,n=t.lch();return n[1]+=$0.Kn*e,n[1]<0&&(n[1]=0),new Zr(n,"lch").alpha(t.alpha(),!0)};Zr.prototype.desaturate=function(e=1){return this.saturate(-e)};Zr.prototype.set=function(e,t,n=!1){const[r,s]=e.split("."),a=this[r]();if(s){const o=r.indexOf(s)-(r.substr(0,2)==="ok"?2:0);if(o>-1){if(Vi(t)=="string")switch(t.charAt(0)){case"+":a[o]+=+t;break;case"-":a[o]+=+t;break;case"*":a[o]*=+t.substr(1);break;case"/":a[o]/=+t.substr(1);break;default:a[o]=+t}else if(Vi(t)==="number")a[o]=t;else throw new Error("unsupported value for Color.set");const l=new Zr(a,r);return n?(this._rgb=l._rgb,this):l}throw new Error(`unknown channel ${s} in mode ${r}`)}else return a};Zr.prototype.tint=function(e=.5,...t){return vN(this,"white",e,...t)};Zr.prototype.shade=function(e=.5,...t){return vN(this,"black",e,...t)};const uDt=(e,t,n)=>{const r=e._rgb,s=t._rgb;return new Zr(r[0]+n*(s[0]-r[0]),r[1]+n*(s[1]-r[1]),r[2]+n*(s[2]-r[2]),"rgb")};Fu.rgb=uDt;const{sqrt:TW,pow:Q6}=Math,dDt=(e,t,n)=>{const[r,s,a]=e._rgb,[o,l,c]=t._rgb;return new Zr(TW(Q6(r,2)*(1-n)+Q6(o,2)*n),TW(Q6(s,2)*(1-n)+Q6(l,2)*n),TW(Q6(a,2)*(1-n)+Q6(c,2)*n),"rgb")};Fu.lrgb=dDt;const fDt=(e,t,n)=>{const r=e.lab(),s=t.lab();return new Zr(r[0]+n*(s[0]-r[0]),r[1]+n*(s[1]-r[1]),r[2]+n*(s[2]-r[2]),"lab")};Fu.lab=fDt;const VA=(e,t,n,r)=>{let s,a;r==="hsl"?(s=e.hsl(),a=t.hsl()):r==="hsv"?(s=e.hsv(),a=t.hsv()):r==="hcg"?(s=e.hcg(),a=t.hcg()):r==="hsi"?(s=e.hsi(),a=t.hsi()):r==="lch"||r==="hcl"?(r="hcl",s=e.hcl(),a=t.hcl()):r==="oklch"&&(s=e.oklch().reverse(),a=t.oklch().reverse());let o,l,c,u,d,f;(r.substr(0,1)==="h"||r==="oklch")&&([o,c,d]=s,[l,u,f]=a);let x,g,v,w;return!isNaN(o)&&!isNaN(l)?(l>o&&l-o>180?w=l-(o+360):l<o&&o-l>180?w=l+360-o:w=l-o,g=o+n*w):isNaN(o)?isNaN(l)?g=Number.NaN:(g=l,(d==1||d==0)&&r!="hsv"&&(x=u)):(g=o,(f==1||f==0)&&r!="hsv"&&(x=c)),x===void 0&&(x=c+n*(u-c)),v=d+n*(f-d),r==="oklch"?new Zr([v,x,g],r):new Zr([g,x,v],r)},BLe=(e,t,n)=>VA(e,t,n,"lch");Fu.lch=BLe;Fu.hcl=BLe;const hDt=e=>{if(Vi(e)=="number"&&e>=0&&e<=16777215){const t=e>>16,n=e>>8&255,r=e&255;return[t,n,r,1]}throw new Error("unknown num color: "+e)},pDt=(...e)=>{const[t,n,r]=Ii(e,"rgb");return(t<<16)+(n<<8)+r};Zr.prototype.num=function(){return pDt(this._rgb)};const mDt=(...e)=>new Zr(...e,"num");Object.assign(xi,{num:mDt});ji.format.num=hDt;ji.autodetect.push({p:5,test:(...e)=>{if(e.length===1&&Vi(e[0])==="number"&&e[0]>=0&&e[0]<=16777215)return"num"}});const xDt=(e,t,n)=>{const r=e.num(),s=t.num();return new Zr(r+n*(s-r),"num")};Fu.num=xDt;const{floor:gDt}=Math,bDt=(...e)=>{e=Ii(e,"hcg");let[t,n,r]=e,s,a,o;r=r*255;const l=n*255;if(n===0)s=a=o=r;else{t===360&&(t=0),t>360&&(t-=360),t<0&&(t+=360),t/=60;const c=gDt(t),u=t-c,d=r*(1-n),f=d+l*(1-u),x=d+l*u,g=d+l;switch(c){case 0:[s,a,o]=[g,x,d];break;case 1:[s,a,o]=[f,g,d];break;case 2:[s,a,o]=[d,g,x];break;case 3:[s,a,o]=[d,f,g];break;case 4:[s,a,o]=[x,d,g];break;case 5:[s,a,o]=[g,d,f];break}}return[s,a,o,e.length>3?e[3]:1]},yDt=(...e)=>{const[t,n,r]=Ii(e,"rgb"),s=TLe(t,n,r),a=ILe(t,n,r),o=a-s,l=o*100/255,c=s/(255-o)*100;let u;return o===0?u=Number.NaN:(t===a&&(u=(n-r)/o),n===a&&(u=2+(r-t)/o),r===a&&(u=4+(t-n)/o),u*=60,u<0&&(u+=360)),[u,l,c]};Zr.prototype.hcg=function(){return yDt(this._rgb)};const vDt=(...e)=>new Zr(...e,"hcg");xi.hcg=vDt;ji.format.hcg=bDt;ji.autodetect.push({p:1,test:(...e)=>{if(e=Ii(e,"hcg"),Vi(e)==="array"&&e.length===3)return"hcg"}});const wDt=(e,t,n)=>VA(e,t,n,"hcg");Fu.hcg=wDt;const{cos:Z6}=Math,CDt=(...e)=>{e=Ii(e,"hsi");let[t,n,r]=e,s,a,o;return isNaN(t)&&(t=0),isNaN(n)&&(n=0),t>360&&(t-=360),t<0&&(t+=360),t/=360,t<1/3?(o=(1-n)/3,s=(1+n*Z6(pg*t)/Z6(jW-pg*t))/3,a=1-(o+s)):t<2/3?(t-=1/3,s=(1-n)/3,a=(1+n*Z6(pg*t)/Z6(jW-pg*t))/3,o=1-(s+a)):(t-=2/3,a=(1-n)/3,o=(1+n*Z6(pg*t)/Z6(jW-pg*t))/3,s=1-(a+o)),s=s3(r*s*3),a=s3(r*a*3),o=s3(r*o*3),[s*255,a*255,o*255,e.length>3?e[3]:1]},{min:SDt,sqrt:NDt,acos:ADt}=Math,jDt=(...e)=>{let[t,n,r]=Ii(e,"rgb");t/=255,n/=255,r/=255;let s;const a=SDt(t,n,r),o=(t+n+r)/3,l=o>0?1-a/o:0;return l===0?s=NaN:(s=(t-n+(t-r))/2,s/=NDt((t-n)*(t-n)+(t-r)*(n-r)),s=ADt(s),r>n&&(s=pg-s),s/=pg),[s*360,l,o]};Zr.prototype.hsi=function(){return jDt(this._rgb)};const EDt=(...e)=>new Zr(...e,"hsi");xi.hsi=EDt;ji.format.hsi=CDt;ji.autodetect.push({p:2,test:(...e)=>{if(e=Ii(e,"hsi"),Vi(e)==="array"&&e.length===3)return"hsi"}});const _Dt=(e,t,n)=>VA(e,t,n,"hsi");Fu.hsi=_Dt;const rte=(...e)=>{e=Ii(e,"hsl");const[t,n,r]=e;let s,a,o;if(n===0)s=a=o=r*255;else{const l=[0,0,0],c=[0,0,0],u=r<.5?r*(1+n):r+n-r*n,d=2*r-u,f=t/360;l[0]=f+1/3,l[1]=f,l[2]=f-1/3;for(let x=0;x<3;x++)l[x]<0&&(l[x]+=1),l[x]>1&&(l[x]-=1),6*l[x]<1?c[x]=d+(u-d)*6*l[x]:2*l[x]<1?c[x]=u:3*l[x]<2?c[x]=d+(u-d)*(2/3-l[x])*6:c[x]=d;[s,a,o]=[c[0]*255,c[1]*255,c[2]*255]}return e.length>3?[s,a,o,e[3]]:[s,a,o,1]},$Le=(...e)=>{e=Ii(e,"rgba");let[t,n,r]=e;t/=255,n/=255,r/=255;const s=TLe(t,n,r),a=ILe(t,n,r),o=(a+s)/2;let l,c;return a===s?(l=0,c=Number.NaN):l=o<.5?(a-s)/(a+s):(a-s)/(2-a-s),t==a?c=(n-r)/(a-s):n==a?c=2+(r-t)/(a-s):r==a&&(c=4+(t-n)/(a-s)),c*=60,c<0&&(c+=360),e.length>3&&e[3]!==void 0?[c,l,o,e[3]]:[c,l,o]};Zr.prototype.hsl=function(){return $Le(this._rgb)};const kDt=(...e)=>new Zr(...e,"hsl");xi.hsl=kDt;ji.format.hsl=rte;ji.autodetect.push({p:2,test:(...e)=>{if(e=Ii(e,"hsl"),Vi(e)==="array"&&e.length===3)return"hsl"}});const TDt=(e,t,n)=>VA(e,t,n,"hsl");Fu.hsl=TDt;const{floor:IDt}=Math,PDt=(...e)=>{e=Ii(e,"hsv");let[t,n,r]=e,s,a,o;if(r*=255,n===0)s=a=o=r;else{t===360&&(t=0),t>360&&(t-=360),t<0&&(t+=360),t/=60;const l=IDt(t),c=t-l,u=r*(1-n),d=r*(1-n*c),f=r*(1-n*(1-c));switch(l){case 0:[s,a,o]=[r,f,u];break;case 1:[s,a,o]=[d,r,u];break;case 2:[s,a,o]=[u,r,f];break;case 3:[s,a,o]=[u,d,r];break;case 4:[s,a,o]=[f,u,r];break;case 5:[s,a,o]=[r,u,d];break}}return[s,a,o,e.length>3?e[3]:1]},{min:FDt,max:ODt}=Math,MDt=(...e)=>{e=Ii(e,"rgb");let[t,n,r]=e;const s=FDt(t,n,r),a=ODt(t,n,r),o=a-s;let l,c,u;return u=a/255,a===0?(l=Number.NaN,c=0):(c=o/a,t===a&&(l=(n-r)/o),n===a&&(l=2+(r-t)/o),r===a&&(l=4+(t-n)/o),l*=60,l<0&&(l+=360)),[l,c,u]};Zr.prototype.hsv=function(){return MDt(this._rgb)};const RDt=(...e)=>new Zr(...e,"hsv");xi.hsv=RDt;ji.format.hsv=PDt;ji.autodetect.push({p:2,test:(...e)=>{if(e=Ii(e,"hsv"),Vi(e)==="array"&&e.length===3)return"hsv"}});const LDt=(e,t,n)=>VA(e,t,n,"hsv");Fu.hsv=LDt;function UR(e,t){let n=e.length;Array.isArray(e[0])||(e=[e]),Array.isArray(t[0])||(t=t.map(o=>[o]));let r=t[0].length,s=t[0].map((o,l)=>t.map(c=>c[l])),a=e.map(o=>s.map(l=>Array.isArray(o)?o.reduce((c,u,d)=>c+u*(l[d]||0),0):l.reduce((c,u)=>c+u*o,0)));return n===1&&(a=a[0]),r===1?a.map(o=>o[0]):a}const Sle=(...e)=>{e=Ii(e,"lab");const[t,n,r,...s]=e,[a,o,l]=DDt([t,n,r]),[c,u,d]=MLe(a,o,l);return[c,u,d,...s.length>0&&s[0]<1?[s[0]]:[]]};function DDt(e){var t=[[1.2268798758459243,-.5578149944602171,.2813910456659647],[-.0405757452148008,1.112286803280317,-.0717110580655164],[-.0763729366746601,-.4214933324022432,1.5869240198367816]],n=[[1,.3963377773761749,.2158037573099136],[1,-.1055613458156586,-.0638541728258133],[1,-.0894841775298119,-1.2914855480194092]],r=UR(n,e);return UR(t,r.map(s=>s**3))}const Nle=(...e)=>{const[t,n,r,...s]=Ii(e,"rgb"),a=RLe(t,n,r);return[...BDt(a),...s.length>0&&s[0]<1?[s[0]]:[]]};function BDt(e){const t=[[.819022437996703,.3619062600528904,-.1288737815209879],[.0329836539323885,.9292868615863434,.0361446663506424],[.0481771893596242,.2642395317527308,.6335478284694309]],n=[[.210454268309314,.7936177747023054,-.0040720430116193],[1.9779985324311684,-2.42859224204858,.450593709617411],[.0259040424655478,.7827717124575296,-.8086757549230774]],r=UR(t,e);return UR(n,r.map(s=>Math.cbrt(s)))}Zr.prototype.oklab=function(){return Nle(this._rgb)};const $Dt=(...e)=>new Zr(...e,"oklab");Object.assign(xi,{oklab:$Dt});ji.format.oklab=Sle;ji.autodetect.push({p:2,test:(...e)=>{if(e=Ii(e,"oklab"),Vi(e)==="array"&&e.length===3)return"oklab"}});const UDt=(e,t,n)=>{const r=e.oklab(),s=t.oklab();return new Zr(r[0]+n*(s[0]-r[0]),r[1]+n*(s[1]-r[1]),r[2]+n*(s[2]-r[2]),"oklab")};Fu.oklab=UDt;const zDt=(e,t,n)=>VA(e,t,n,"oklch");Fu.oklch=zDt;const{pow:IW,sqrt:PW,PI:FW,cos:Ybe,sin:Xbe,atan2:HDt}=Math,VDt=(e,t="lrgb",n=null)=>{const r=e.length;n||(n=Array.from(new Array(r)).map(()=>1));const s=r/n.reduce(function(f,x){return f+x});if(n.forEach((f,x)=>{n[x]*=s}),e=e.map(f=>new Zr(f)),t==="lrgb")return WDt(e,n);const a=e.shift(),o=a.get(t),l=[];let c=0,u=0;for(let f=0;f<o.length;f++)if(o[f]=(o[f]||0)*n[0],l.push(isNaN(o[f])?0:n[0]),t.charAt(f)==="h"&&!isNaN(o[f])){const x=o[f]/180*FW;c+=Ybe(x)*n[0],u+=Xbe(x)*n[0]}let d=a.alpha()*n[0];e.forEach((f,x)=>{const g=f.get(t);d+=f.alpha()*n[x+1];for(let v=0;v<o.length;v++)if(!isNaN(g[v]))if(l[v]+=n[x+1],t.charAt(v)==="h"){const w=g[v]/180*FW;c+=Ybe(w)*n[x+1],u+=Xbe(w)*n[x+1]}else o[v]+=g[v]*n[x+1]});for(let f=0;f<o.length;f++)if(t.charAt(f)==="h"){let x=HDt(u/l[f],c/l[f])/FW*180;for(;x<0;)x+=360;for(;x>=360;)x-=360;o[f]=x}else o[f]=o[f]/l[f];return d/=r,new Zr(o,t).alpha(d>.99999?1:d,!0)},WDt=(e,t)=>{const n=e.length,r=[0,0,0,0];for(let s=0;s<e.length;s++){const a=e[s],o=t[s]/n,l=a._rgb;r[0]+=IW(l[0],2)*o,r[1]+=IW(l[1],2)*o,r[2]+=IW(l[2],2)*o,r[3]+=l[3]*o}return r[0]=PW(r[0]),r[1]=PW(r[1]),r[2]=PW(r[2]),r[3]>.9999999&&(r[3]=1),new Zr(ble(r))},{pow:qDt}=Math;function zR(e){let t="rgb",n=xi("#ccc"),r=0,s=[0,1],a=[],o=[0,0],l=!1,c=[],u=!1,d=0,f=1,x=!1,g={},v=!0,w=1;const C=function(L){if(L=L||["#fff","#000"],L&&Vi(L)==="string"&&xi.brewer&&xi.brewer[L.toLowerCase()]&&(L=xi.brewer[L.toLowerCase()]),Vi(L)==="array"){L.length===1&&(L=[L[0],L[0]]),L=L.slice(0);for(let z=0;z<L.length;z++)L[z]=xi(L[z]);a.length=0;for(let z=0;z<L.length;z++)a.push(z/(L.length-1))}return F(),c=L},N=function(L){if(l!=null){const z=l.length-1;let Q=0;for(;Q<z&&L>=l[Q];)Q++;return Q-1}return 0};let P=L=>L,I=L=>L;const R=function(L,z){let Q,ne;if(z==null&&(z=!1),isNaN(L)||L===null)return n;z?ne=L:l&&l.length>2?ne=N(L)/(l.length-2):f!==d?ne=(L-d)/(f-d):ne=1,ne=I(ne),z||(ne=P(ne)),w!==1&&(ne=qDt(ne,w)),ne=o[0]+ne*(1-o[0]-o[1]),ne=s3(ne,0,1);const J=Math.floor(ne*1e4);if(v&&g[J])Q=g[J];else{if(Vi(c)==="array")for(let X=0;X<a.length;X++){const re=a[X];if(ne<=re){Q=c[X];break}if(ne>=re&&X===a.length-1){Q=c[X];break}if(ne>re&&ne<a[X+1]){ne=(ne-re)/(a[X+1]-re),Q=xi.interpolate(c[X],c[X+1],ne,t);break}}else Vi(c)==="function"&&(Q=c(ne));v&&(g[J]=Q)}return Q};var F=()=>g={};C(e);const U=function(L){const z=xi(R(L));return u&&z[u]?z[u]():z};return U.classes=function(L){if(L!=null){if(Vi(L)==="array")l=L,s=[L[0],L[L.length-1]];else{const z=xi.analyze(s);L===0?l=[z.min,z.max]:l=xi.limits(z,"e",L)}return U}return l},U.domain=function(L){if(!arguments.length)return s;d=L[0],f=L[L.length-1],a=[];const z=c.length;if(L.length===z&&d!==f)for(let Q of Array.from(L))a.push((Q-d)/(f-d));else{for(let Q=0;Q<z;Q++)a.push(Q/(z-1));if(L.length>2){const Q=L.map((J,X)=>X/(L.length-1)),ne=L.map(J=>(J-d)/(f-d));ne.every((J,X)=>Q[X]===J)||(I=J=>{if(J<=0||J>=1)return J;let X=0;for(;J>=ne[X+1];)X++;const re=(J-ne[X])/(ne[X+1]-ne[X]);return Q[X]+re*(Q[X+1]-Q[X])})}}return s=[d,f],U},U.mode=function(L){return arguments.length?(t=L,F(),U):t},U.range=function(L,z){return C(L),U},U.out=function(L){return u=L,U},U.spread=function(L){return arguments.length?(r=L,U):r},U.correctLightness=function(L){return L==null&&(L=!0),x=L,F(),x?P=function(z){const Q=R(0,!0).lab()[0],ne=R(1,!0).lab()[0],J=Q>ne;let X=R(z,!0).lab()[0];const re=Q+(ne-Q)*z;let pe=X-re,Y=0,ie=1,oe=20;for(;Math.abs(pe)>.01&&oe-- >0;)(function(){return J&&(pe*=-1),pe<0?(Y=z,z+=(ie-z)*.5):(ie=z,z+=(Y-z)*.5),X=R(z,!0).lab()[0],pe=X-re})();return z}:P=z=>z,U},U.padding=function(L){return L!=null?(Vi(L)==="number"&&(L=[L,L]),o=L,U):o},U.colors=function(L,z){arguments.length<2&&(z="hex");let Q=[];if(arguments.length===0)Q=c.slice(0);else if(L===1)Q=[U(.5)];else if(L>1){const ne=s[0],J=s[1]-ne;Q=GDt(0,L).map(X=>U(ne+X/(L-1)*J))}else{e=[];let ne=[];if(l&&l.length>2)for(let J=1,X=l.length,re=1<=X;re?J<X:J>X;re?J++:J--)ne.push((l[J-1]+l[J])*.5);else ne=s;Q=ne.map(J=>U(J))}return xi[z]&&(Q=Q.map(ne=>ne[z]())),Q},U.cache=function(L){return L!=null?(v=L,U):v},U.gamma=function(L){return L!=null?(w=L,U):w},U.nodata=function(L){return L!=null?(n=xi(L),U):n},U}function GDt(e,t,n){let r=[],s=e<t,a=t;for(let o=e;s?o<a:o>a;s?o++:o--)r.push(o);return r}const KDt=function(e){let t=[1,1];for(let n=1;n<e;n++){let r=[1];for(let s=1;s<=t.length;s++)r[s]=(t[s]||0)+t[s-1];t=r}return t},YDt=function(e){let t,n,r,s;if(e=e.map(a=>new Zr(a)),e.length===2)[n,r]=e.map(a=>a.lab()),t=function(a){const o=[0,1,2].map(l=>n[l]+a*(r[l]-n[l]));return new Zr(o,"lab")};else if(e.length===3)[n,r,s]=e.map(a=>a.lab()),t=function(a){const o=[0,1,2].map(l=>(1-a)*(1-a)*n[l]+2*(1-a)*a*r[l]+a*a*s[l]);return new Zr(o,"lab")};else if(e.length===4){let a;[n,r,s,a]=e.map(o=>o.lab()),t=function(o){const l=[0,1,2].map(c=>(1-o)*(1-o)*(1-o)*n[c]+3*(1-o)*(1-o)*o*r[c]+3*(1-o)*o*o*s[c]+o*o*o*a[c]);return new Zr(l,"lab")}}else if(e.length>=5){let a,o,l;a=e.map(c=>c.lab()),l=e.length-1,o=KDt(l),t=function(c){const u=1-c,d=[0,1,2].map(f=>a.reduce((x,g,v)=>x+o[v]*u**(l-v)*c**v*g[f],0));return new Zr(d,"lab")}}else throw new RangeError("No point in running bezier with only one color.");return t},XDt=e=>{const t=YDt(e);return t.scale=()=>zR(t),t},{round:ULe}=Math;Zr.prototype.rgb=function(e=!0){return e===!1?this._rgb.slice(0,3):this._rgb.slice(0,3).map(ULe)};Zr.prototype.rgba=function(e=!0){return this._rgb.slice(0,4).map((t,n)=>n<3?e===!1?t:ULe(t):t)};const QDt=(...e)=>new Zr(...e,"rgb");Object.assign(xi,{rgb:QDt});ji.format.rgb=(...e)=>{const t=Ii(e,"rgba");return t[3]===void 0&&(t[3]=1),t};ji.autodetect.push({p:3,test:(...e)=>{if(e=Ii(e,"rgba"),Vi(e)==="array"&&(e.length===3||e.length===4&&Vi(e[3])=="number"&&e[3]>=0&&e[3]<=1))return"rgb"}});const wm=(e,t,n)=>{if(!wm[n])throw new Error("unknown blend mode "+n);return wm[n](e,t)},h2=e=>(t,n)=>{const r=xi(n).rgb(),s=xi(t).rgb();return xi.rgb(e(r,s))},p2=e=>(t,n)=>{const r=[];return r[0]=e(t[0],n[0]),r[1]=e(t[1],n[1]),r[2]=e(t[2],n[2]),r},ZDt=e=>e,JDt=(e,t)=>e*t/255,eBt=(e,t)=>e>t?t:e,tBt=(e,t)=>e>t?e:t,nBt=(e,t)=>255*(1-(1-e/255)*(1-t/255)),rBt=(e,t)=>t<128?2*e*t/255:255*(1-2*(1-e/255)*(1-t/255)),sBt=(e,t)=>255*(1-(1-t/255)/(e/255)),iBt=(e,t)=>e===255?255:(e=255*(t/255)/(1-e/255),e>255?255:e);wm.normal=h2(p2(ZDt));wm.multiply=h2(p2(JDt));wm.screen=h2(p2(nBt));wm.overlay=h2(p2(rBt));wm.darken=h2(p2(eBt));wm.lighten=h2(p2(tBt));wm.dodge=h2(p2(iBt));wm.burn=h2(p2(sBt));const{pow:aBt,sin:oBt,cos:lBt}=Math;function cBt(e=300,t=-1.5,n=1,r=1,s=[0,1]){let a=0,o;Vi(s)==="array"?o=s[1]-s[0]:(o=0,s=[s,s]);const l=function(c){const u=pg*((e+120)/360+t*c),d=aBt(s[0]+o*c,r),x=(a!==0?n[0]+c*a:n)*d*(1-d)/2,g=lBt(u),v=oBt(u),w=d+x*(-.14861*g+1.78277*v),C=d+x*(-.29227*g-.90649*v),N=d+x*(1.97294*g);return xi(ble([w*255,C*255,N*255,1]))};return l.start=function(c){return c==null?e:(e=c,l)},l.rotations=function(c){return c==null?t:(t=c,l)},l.gamma=function(c){return c==null?r:(r=c,l)},l.hue=function(c){return c==null?n:(n=c,Vi(n)==="array"?(a=n[1]-n[0],a===0&&(n=n[1])):a=0,l)},l.lightness=function(c){return c==null?s:(Vi(c)==="array"?(s=c,o=c[1]-c[0]):(s=[c,c],o=0),l)},l.scale=()=>xi.scale(l),l.hue(n),l}const uBt="0123456789abcdef",{floor:dBt,random:fBt}=Math,hBt=()=>{let e="#";for(let t=0;t<6;t++)e+=uBt.charAt(dBt(fBt()*16));return new Zr(e,"hex")},{log:Qbe,pow:pBt,floor:mBt,abs:xBt}=Math;function zLe(e,t=null){const n={min:Number.MAX_VALUE,max:Number.MAX_VALUE*-1,sum:0,values:[],count:0};return Vi(e)==="object"&&(e=Object.values(e)),e.forEach(r=>{t&&Vi(r)==="object"&&(r=r[t]),r!=null&&!isNaN(r)&&(n.values.push(r),n.sum+=r,r<n.min&&(n.min=r),r>n.max&&(n.max=r),n.count+=1)}),n.domain=[n.min,n.max],n.limits=(r,s)=>HLe(n,r,s),n}function HLe(e,t="equal",n=7){Vi(e)=="array"&&(e=zLe(e));const{min:r,max:s}=e,a=e.values.sort((l,c)=>l-c);if(n===1)return[r,s];const o=[];if(t.substr(0,1)==="c"&&(o.push(r),o.push(s)),t.substr(0,1)==="e"){o.push(r);for(let l=1;l<n;l++)o.push(r+l/n*(s-r));o.push(s)}else if(t.substr(0,1)==="l"){if(r<=0)throw new Error("Logarithmic scales are only possible for values > 0");const l=Math.LOG10E*Qbe(r),c=Math.LOG10E*Qbe(s);o.push(r);for(let u=1;u<n;u++)o.push(pBt(10,l+u/n*(c-l)));o.push(s)}else if(t.substr(0,1)==="q"){o.push(r);for(let l=1;l<n;l++){const c=(a.length-1)*l/n,u=mBt(c);if(u===c)o.push(a[u]);else{const d=c-u;o.push(a[u]*(1-d)+a[u+1]*d)}}o.push(s)}else if(t.substr(0,1)==="k"){let l;const c=a.length,u=new Array(c),d=new Array(n);let f=!0,x=0,g=null;g=[],g.push(r);for(let C=1;C<n;C++)g.push(r+C/n*(s-r));for(g.push(s);f;){for(let N=0;N<n;N++)d[N]=0;for(let N=0;N<c;N++){const P=a[N];let I=Number.MAX_VALUE,R;for(let F=0;F<n;F++){const U=xBt(g[F]-P);U<I&&(I=U,R=F),d[R]++,u[N]=R}}const C=new Array(n);for(let N=0;N<n;N++)C[N]=null;for(let N=0;N<c;N++)l=u[N],C[l]===null?C[l]=a[N]:C[l]+=a[N];for(let N=0;N<n;N++)C[N]*=1/d[N];f=!1;for(let N=0;N<n;N++)if(C[N]!==g[N]){f=!0;break}g=C,x++,x>200&&(f=!1)}const v={};for(let C=0;C<n;C++)v[C]=[];for(let C=0;C<c;C++)l=u[C],v[l].push(a[C]);let w=[];for(let C=0;C<n;C++)w.push(v[C][0]),w.push(v[C][v[C].length-1]);w=w.sort((C,N)=>C-N),o.push(w[0]);for(let C=1;C<w.length;C+=2){const N=w[C];!isNaN(N)&&o.indexOf(N)===-1&&o.push(N)}}return o}const gBt=(e,t)=>{e=new Zr(e),t=new Zr(t);const n=e.luminance(),r=t.luminance();return n>r?(n+.05)/(r+.05):(r+.05)/(n+.05)};/**
* @license
*
* The APCA contrast prediction algorithm is based of the formulas published
* in the APCA-1.0.98G specification by Myndex. The specification is available at:
* https://raw.githubusercontent.com/Myndex/apca-w3/master/images/APCAw3_0.1.17_APCA0.0.98G.svg
*
* Note that the APCA implementation is still beta, so please update to
* future versions of chroma.js when they become available.
*
* You can read more about the APCA Readability Criterion at
* https://readtech.org/ARC/
*/const Zbe=.027,bBt=5e-4,yBt=.1,Jbe=1.14,wP=.022,eye=1.414,vBt=(e,t)=>{e=new Zr(e),t=new Zr(t),e.alpha()<1&&(e=vN(t,e,e.alpha(),"rgb"));const n=tye(...e.rgb()),r=tye(...t.rgb()),s=n>=wP?n:n+Math.pow(wP-n,eye),a=r>=wP?r:r+Math.pow(wP-r,eye),o=Math.pow(a,.56)-Math.pow(s,.57),l=Math.pow(a,.65)-Math.pow(s,.62),c=Math.abs(a-s)<bBt?0:s<a?o*Jbe:l*Jbe;return(Math.abs(c)<yBt?0:c>0?c-Zbe:c+Zbe)*100};function tye(e,t,n){return .2126729*Math.pow(e/255,2.4)+.7151522*Math.pow(t/255,2.4)+.072175*Math.pow(n/255,2.4)}const{sqrt:qx,pow:Pl,min:wBt,max:CBt,atan2:nye,abs:rye,cos:CP,sin:sye,exp:SBt,PI:iye}=Math;function NBt(e,t,n=1,r=1,s=1){var a=function(Ne){return 360*Ne/(2*iye)},o=function(Ne){return 2*iye*Ne/360};e=new Zr(e),t=new Zr(t);const[l,c,u]=Array.from(e.lab()),[d,f,x]=Array.from(t.lab()),g=(l+d)/2,v=qx(Pl(c,2)+Pl(u,2)),w=qx(Pl(f,2)+Pl(x,2)),C=(v+w)/2,N=.5*(1-qx(Pl(C,7)/(Pl(C,7)+Pl(25,7)))),P=c*(1+N),I=f*(1+N),R=qx(Pl(P,2)+Pl(u,2)),F=qx(Pl(I,2)+Pl(x,2)),U=(R+F)/2,L=a(nye(u,P)),z=a(nye(x,I)),Q=L>=0?L:L+360,ne=z>=0?z:z+360,J=rye(Q-ne)>180?(Q+ne+360)/2:(Q+ne)/2,X=1-.17*CP(o(J-30))+.24*CP(o(2*J))+.32*CP(o(3*J+6))-.2*CP(o(4*J-63));let re=ne-Q;re=rye(re)<=180?re:ne<=Q?re+360:re-360,re=2*qx(R*F)*sye(o(re)/2);const pe=d-l,Y=F-R,ie=1+.015*Pl(g-50,2)/qx(20+Pl(g-50,2)),oe=1+.045*U,G=1+.015*U*X,V=30*SBt(-Pl((J-275)/25,2)),ae=-(2*qx(Pl(U,7)/(Pl(U,7)+Pl(25,7))))*sye(2*o(V)),fe=qx(Pl(pe/(n*ie),2)+Pl(Y/(r*oe),2)+Pl(re/(s*G),2)+ae*(Y/(r*oe))*(re/(s*G)));return CBt(0,wBt(100,fe))}function ABt(e,t,n="lab"){e=new Zr(e),t=new Zr(t);const r=e.get(n),s=t.get(n);let a=0;for(let o in r){const l=(r[o]||0)-(s[o]||0);a+=l*l}return Math.sqrt(a)}const jBt=(...e)=>{try{return new Zr(...e),!0}catch{return!1}},EBt={cool(){return zR([xi.hsl(180,1,.9),xi.hsl(250,.7,.4)])},hot(){return zR(["#000","#f00","#ff0","#fff"]).mode("rgb")}},ste={OrRd:["#fff7ec","#fee8c8","#fdd49e","#fdbb84","#fc8d59","#ef6548","#d7301f","#b30000","#7f0000"],PuBu:["#fff7fb","#ece7f2","#d0d1e6","#a6bddb","#74a9cf","#3690c0","#0570b0","#045a8d","#023858"],BuPu:["#f7fcfd","#e0ecf4","#bfd3e6","#9ebcda","#8c96c6","#8c6bb1","#88419d","#810f7c","#4d004b"],Oranges:["#fff5eb","#fee6ce","#fdd0a2","#fdae6b","#fd8d3c","#f16913","#d94801","#a63603","#7f2704"],BuGn:["#f7fcfd","#e5f5f9","#ccece6","#99d8c9","#66c2a4","#41ae76","#238b45","#006d2c","#00441b"],YlOrBr:["#ffffe5","#fff7bc","#fee391","#fec44f","#fe9929","#ec7014","#cc4c02","#993404","#662506"],YlGn:["#ffffe5","#f7fcb9","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#006837","#004529"],Reds:["#fff5f0","#fee0d2","#fcbba1","#fc9272","#fb6a4a","#ef3b2c","#cb181d","#a50f15","#67000d"],RdPu:["#fff7f3","#fde0dd","#fcc5c0","#fa9fb5","#f768a1","#dd3497","#ae017e","#7a0177","#49006a"],Greens:["#f7fcf5","#e5f5e0","#c7e9c0","#a1d99b","#74c476","#41ab5d","#238b45","#006d2c","#00441b"],YlGnBu:["#ffffd9","#edf8b1","#c7e9b4","#7fcdbb","#41b6c4","#1d91c0","#225ea8","#253494","#081d58"],Purples:["#fcfbfd","#efedf5","#dadaeb","#bcbddc","#9e9ac8","#807dba","#6a51a3","#54278f","#3f007d"],GnBu:["#f7fcf0","#e0f3db","#ccebc5","#a8ddb5","#7bccc4","#4eb3d3","#2b8cbe","#0868ac","#084081"],Greys:["#ffffff","#f0f0f0","#d9d9d9","#bdbdbd","#969696","#737373","#525252","#252525","#000000"],YlOrRd:["#ffffcc","#ffeda0","#fed976","#feb24c","#fd8d3c","#fc4e2a","#e31a1c","#bd0026","#800026"],PuRd:["#f7f4f9","#e7e1ef","#d4b9da","#c994c7","#df65b0","#e7298a","#ce1256","#980043","#67001f"],Blues:["#f7fbff","#deebf7","#c6dbef","#9ecae1","#6baed6","#4292c6","#2171b5","#08519c","#08306b"],PuBuGn:["#fff7fb","#ece2f0","#d0d1e6","#a6bddb","#67a9cf","#3690c0","#02818a","#016c59","#014636"],Viridis:["#440154","#482777","#3f4a8a","#31678e","#26838f","#1f9d8a","#6cce5a","#b6de2b","#fee825"],Spectral:["#9e0142","#d53e4f","#f46d43","#fdae61","#fee08b","#ffffbf","#e6f598","#abdda4","#66c2a5","#3288bd","#5e4fa2"],RdYlGn:["#a50026","#d73027","#f46d43","#fdae61","#fee08b","#ffffbf","#d9ef8b","#a6d96a","#66bd63","#1a9850","#006837"],RdBu:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#f7f7f7","#d1e5f0","#92c5de","#4393c3","#2166ac","#053061"],PiYG:["#8e0152","#c51b7d","#de77ae","#f1b6da","#fde0ef","#f7f7f7","#e6f5d0","#b8e186","#7fbc41","#4d9221","#276419"],PRGn:["#40004b","#762a83","#9970ab","#c2a5cf","#e7d4e8","#f7f7f7","#d9f0d3","#a6dba0","#5aae61","#1b7837","#00441b"],RdYlBu:["#a50026","#d73027","#f46d43","#fdae61","#fee090","#ffffbf","#e0f3f8","#abd9e9","#74add1","#4575b4","#313695"],BrBG:["#543005","#8c510a","#bf812d","#dfc27d","#f6e8c3","#f5f5f5","#c7eae5","#80cdc1","#35978f","#01665e","#003c30"],RdGy:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#ffffff","#e0e0e0","#bababa","#878787","#4d4d4d","#1a1a1a"],PuOr:["#7f3b08","#b35806","#e08214","#fdb863","#fee0b6","#f7f7f7","#d8daeb","#b2abd2","#8073ac","#542788","#2d004b"],Set2:["#66c2a5","#fc8d62","#8da0cb","#e78ac3","#a6d854","#ffd92f","#e5c494","#b3b3b3"],Accent:["#7fc97f","#beaed4","#fdc086","#ffff99","#386cb0","#f0027f","#bf5b17","#666666"],Set1:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00","#ffff33","#a65628","#f781bf","#999999"],Set3:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9","#bc80bd","#ccebc5","#ffed6f"],Dark2:["#1b9e77","#d95f02","#7570b3","#e7298a","#66a61e","#e6ab02","#a6761d","#666666"],Paired:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00","#cab2d6","#6a3d9a","#ffff99","#b15928"],Pastel2:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4","#e6f5c9","#fff2ae","#f1e2cc","#cccccc"],Pastel1:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6","#ffffcc","#e5d8bd","#fddaec","#f2f2f2"]},VLe=Object.keys(ste),aye=new Map(VLe.map(e=>[e.toLowerCase(),e])),_Bt=typeof Proxy=="function"?new Proxy(ste,{get(e,t){const n=t.toLowerCase();if(aye.has(n))return e[aye.get(n)]},getOwnPropertyNames(){return Object.getOwnPropertyNames(VLe)}}):ste,kBt=(...e)=>{e=Ii(e,"cmyk");const[t,n,r,s]=e,a=e.length>4?e[4]:1;return s===1?[0,0,0,a]:[t>=1?0:255*(1-t)*(1-s),n>=1?0:255*(1-n)*(1-s),r>=1?0:255*(1-r)*(1-s),a]},{max:oye}=Math,TBt=(...e)=>{let[t,n,r]=Ii(e,"rgb");t=t/255,n=n/255,r=r/255;const s=1-oye(t,oye(n,r)),a=s<1?1/(1-s):0,o=(1-t-s)*a,l=(1-n-s)*a,c=(1-r-s)*a;return[o,l,c,s]};Zr.prototype.cmyk=function(){return TBt(this._rgb)};const IBt=(...e)=>new Zr(...e,"cmyk");Object.assign(xi,{cmyk:IBt});ji.format.cmyk=kBt;ji.autodetect.push({p:2,test:(...e)=>{if(e=Ii(e,"cmyk"),Vi(e)==="array"&&e.length===4)return"cmyk"}});const PBt=(...e)=>{const t=Ii(e,"hsla");let n=HA(e)||"lsa";return t[0]=tp(t[0]||0)+"deg",t[1]=tp(t[1]*100)+"%",t[2]=tp(t[2]*100)+"%",n==="hsla"||t.length>3&&t[3]<1?(t[3]="/ "+(t.length>3?t[3]:1),n="hsla"):t.length=3,`${n.substr(0,3)}(${t.join(" ")})`},FBt=(...e)=>{const t=Ii(e,"lab");let n=HA(e)||"lab";return t[0]=tp(t[0])+"%",t[1]=tp(t[1]),t[2]=tp(t[2]),n==="laba"||t.length>3&&t[3]<1?t[3]="/ "+(t.length>3?t[3]:1):t.length=3,`lab(${t.join(" ")})`},OBt=(...e)=>{const t=Ii(e,"lch");let n=HA(e)||"lab";return t[0]=tp(t[0])+"%",t[1]=tp(t[1]),t[2]=isNaN(t[2])?"none":tp(t[2])+"deg",n==="lcha"||t.length>3&&t[3]<1?t[3]="/ "+(t.length>3?t[3]:1):t.length=3,`lch(${t.join(" ")})`},MBt=(...e)=>{const t=Ii(e,"lab");return t[0]=tp(t[0]*100)+"%",t[1]=nte(t[1]),t[2]=nte(t[2]),t.length>3&&t[3]<1?t[3]="/ "+(t.length>3?t[3]:1):t.length=3,`oklab(${t.join(" ")})`},WLe=(...e)=>{const[t,n,r,...s]=Ii(e,"rgb"),[a,o,l]=Nle(t,n,r),[c,u,d]=DLe(a,o,l);return[c,u,d,...s.length>0&&s[0]<1?[s[0]]:[]]},RBt=(...e)=>{const t=Ii(e,"lch");return t[0]=tp(t[0]*100)+"%",t[1]=nte(t[1]),t[2]=isNaN(t[2])?"none":tp(t[2])+"deg",t.length>3&&t[3]<1?t[3]="/ "+(t.length>3?t[3]:1):t.length=3,`oklch(${t.join(" ")})`},{round:OW}=Math,LBt=(...e)=>{const t=Ii(e,"rgba");let n=HA(e)||"rgb";if(n.substr(0,3)==="hsl")return PBt($Le(t),n);if(n.substr(0,3)==="lab"){const r=n_();Lg("d50");const s=FBt(vle(t),n);return Lg(r),s}if(n.substr(0,3)==="lch"){const r=n_();Lg("d50");const s=OBt(Cle(t),n);return Lg(r),s}return n.substr(0,5)==="oklab"?MBt(Nle(t)):n.substr(0,5)==="oklch"?RBt(WLe(t)):(t[0]=OW(t[0]),t[1]=OW(t[1]),t[2]=OW(t[2]),(n==="rgba"||t.length>3&&t[3]<1)&&(t[3]="/ "+(t.length>3?t[3]:1),n="rgba"),`${n.substr(0,3)}(${t.slice(0,n==="rgb"?3:4).join(" ")})`)},qLe=(...e)=>{e=Ii(e,"lch");const[t,n,r,...s]=e,[a,o,l]=LLe(t,n,r),[c,u,d]=Sle(a,o,l);return[c,u,d,...s.length>0&&s[0]<1?[s[0]]:[]]},Yg=/((?:-?\d+)|(?:-?\d+(?:\.\d+)?)%|none)/.source,hm=/((?:-?(?:\d+(?:\.\d*)?|\.\d+)%?)|none)/.source,HR=/((?:-?(?:\d+(?:\.\d*)?|\.\d+)%)|none)/.source,dp=/\s*/.source,WA=/\s+/.source,Ale=/\s*,\s*/.source,T$=/((?:-?(?:\d+(?:\.\d*)?|\.\d+)(?:deg)?)|none)/.source,qA=/\s*(?:\/\s*((?:[01]|[01]?\.\d+)|\d+(?:\.\d+)?%))?/.source,GLe=new RegExp("^rgba?\\("+dp+[Yg,Yg,Yg].join(WA)+qA+"\\)$"),KLe=new RegExp("^rgb\\("+dp+[Yg,Yg,Yg].join(Ale)+dp+"\\)$"),YLe=new RegExp("^rgba\\("+dp+[Yg,Yg,Yg,hm].join(Ale)+dp+"\\)$"),XLe=new RegExp("^hsla?\\("+dp+[T$,HR,HR].join(WA)+qA+"\\)$"),QLe=new RegExp("^hsl?\\("+dp+[T$,HR,HR].join(Ale)+dp+"\\)$"),ZLe=/^hsla\(\s*(-?\d+(?:\.\d+)?),\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)$/,JLe=new RegExp("^lab\\("+dp+[hm,hm,hm].join(WA)+qA+"\\)$"),eDe=new RegExp("^lch\\("+dp+[hm,hm,T$].join(WA)+qA+"\\)$"),tDe=new RegExp("^oklab\\("+dp+[hm,hm,hm].join(WA)+qA+"\\)$"),nDe=new RegExp("^oklch\\("+dp+[hm,hm,T$].join(WA)+qA+"\\)$"),{round:rDe}=Math,J6=e=>e.map((t,n)=>n<=2?s3(rDe(t),0,255):t),Fl=(e,t=0,n=100,r=!1)=>(typeof e=="string"&&e.endsWith("%")&&(e=parseFloat(e.substring(0,e.length-1))/100,r?e=t+(e+1)*.5*(n-t):e=t+e*(n-t)),+e),Gu=(e,t)=>e==="none"?t:e,jle=e=>{if(e=e.toLowerCase().trim(),e==="transparent")return[0,0,0,0];let t;if(ji.format.named)try{return ji.format.named(e)}catch{}if((t=e.match(GLe))||(t=e.match(KLe))){let n=t.slice(1,4);for(let s=0;s<3;s++)n[s]=+Fl(Gu(n[s],0),0,255);n=J6(n);const r=t[4]!==void 0?+Fl(t[4],0,1):1;return n[3]=r,n}if(t=e.match(YLe)){const n=t.slice(1,5);for(let r=0;r<4;r++)n[r]=+Fl(n[r],0,255);return n}if((t=e.match(XLe))||(t=e.match(QLe))){const n=t.slice(1,4);n[0]=+Gu(n[0].replace("deg",""),0),n[1]=+Fl(Gu(n[1],0),0,100)*.01,n[2]=+Fl(Gu(n[2],0),0,100)*.01;const r=J6(rte(n)),s=t[4]!==void 0?+Fl(t[4],0,1):1;return r[3]=s,r}if(t=e.match(ZLe)){const n=t.slice(1,4);n[1]*=.01,n[2]*=.01;const r=rte(n);for(let s=0;s<3;s++)r[s]=rDe(r[s]);return r[3]=+t[4],r}if(t=e.match(JLe)){const n=t.slice(1,4);n[0]=Fl(Gu(n[0],0),0,100),n[1]=Fl(Gu(n[1],0),-125,125,!0),n[2]=Fl(Gu(n[2],0),-125,125,!0);const r=n_();Lg("d50");const s=J6(yle(n));Lg(r);const a=t[4]!==void 0?+Fl(t[4],0,1):1;return s[3]=a,s}if(t=e.match(eDe)){const n=t.slice(1,4);n[0]=Fl(n[0],0,100),n[1]=Fl(Gu(n[1],0),0,150,!1),n[2]=+Gu(n[2].replace("deg",""),0);const r=n_();Lg("d50");const s=J6(wle(n));Lg(r);const a=t[4]!==void 0?+Fl(t[4],0,1):1;return s[3]=a,s}if(t=e.match(tDe)){const n=t.slice(1,4);n[0]=Fl(Gu(n[0],0),0,1),n[1]=Fl(Gu(n[1],0),-.4,.4,!0),n[2]=Fl(Gu(n[2],0),-.4,.4,!0);const r=J6(Sle(n)),s=t[4]!==void 0?+Fl(t[4],0,1):1;return r[3]=s,r}if(t=e.match(nDe)){const n=t.slice(1,4);n[0]=Fl(Gu(n[0],0),0,1),n[1]=Fl(Gu(n[1],0),0,.4,!1),n[2]=+Gu(n[2].replace("deg",""),0);const r=J6(qLe(n)),s=t[4]!==void 0?+Fl(t[4],0,1):1;return r[3]=s,r}};jle.test=e=>GLe.test(e)||XLe.test(e)||JLe.test(e)||eDe.test(e)||tDe.test(e)||nDe.test(e)||KLe.test(e)||YLe.test(e)||QLe.test(e)||ZLe.test(e)||e==="transparent";Zr.prototype.css=function(e){return LBt(this._rgb,e)};const DBt=(...e)=>new Zr(...e,"css");xi.css=DBt;ji.format.css=jle;ji.autodetect.push({p:5,test:(e,...t)=>{if(!t.length&&Vi(e)==="string"&&jle.test(e))return"css"}});ji.format.gl=(...e)=>{const t=Ii(e,"rgba");return t[0]*=255,t[1]*=255,t[2]*=255,t};const BBt=(...e)=>new Zr(...e,"gl");xi.gl=BBt;Zr.prototype.gl=function(){const e=this._rgb;return[e[0]/255,e[1]/255,e[2]/255,e[3]]};Zr.prototype.hex=function(e){return OLe(this._rgb,e)};const $Bt=(...e)=>new Zr(...e,"hex");xi.hex=$Bt;ji.format.hex=FLe;ji.autodetect.push({p:4,test:(e,...t)=>{if(!t.length&&Vi(e)==="string"&&[3,4,5,6,7,8,9].indexOf(e.length)>=0)return"hex"}});const{log:SP}=Math,sDe=e=>{const t=e/100;let n,r,s;return t<66?(n=255,r=t<6?0:-155.25485562709179-.44596950469579133*(r=t-2)+104.49216199393888*SP(r),s=t<20?0:-254.76935184120902+.8274096064007395*(s=t-10)+115.67994401066147*SP(s)):(n=351.97690566805693+.114206453784165*(n=t-55)-40.25366309332127*SP(n),r=325.4494125711974+.07943456536662342*(r=t-50)-28.0852963507957*SP(r),s=255),[n,r,s,1]},{round:UBt}=Math,zBt=(...e)=>{const t=Ii(e,"rgb"),n=t[0],r=t[2];let s=1e3,a=4e4;const o=.4;let l;for(;a-s>o;){l=(a+s)*.5;const c=sDe(l);c[2]/c[0]>=r/n?a=l:s=l}return UBt(l)};Zr.prototype.temp=Zr.prototype.kelvin=Zr.prototype.temperature=function(){return zBt(this._rgb)};const MW=(...e)=>new Zr(...e,"temp");Object.assign(xi,{temp:MW,kelvin:MW,temperature:MW});ji.format.temp=ji.format.kelvin=ji.format.temperature=sDe;Zr.prototype.oklch=function(){return WLe(this._rgb)};const HBt=(...e)=>new Zr(...e,"oklch");Object.assign(xi,{oklch:HBt});ji.format.oklch=qLe;ji.autodetect.push({p:2,test:(...e)=>{if(e=Ii(e,"oklch"),Vi(e)==="array"&&e.length===3)return"oklch"}});Object.assign(xi,{analyze:zLe,average:VDt,bezier:XDt,blend:wm,brewer:_Bt,Color:Zr,colors:yN,contrast:gBt,contrastAPCA:vBt,cubehelix:cBt,deltaE:NBt,distance:ABt,input:ji,interpolate:vN,limits:HLe,mix:vN,random:hBt,scale:zR,scales:EBt,valid:jBt});const VBt=({className:e})=>i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"17",height:"16",viewBox:"0 0 17 16",fill:"none",className:e,children:i.jsx("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M7.875 3.67C7.875 3.025 7.315 2.5 6.625 2.5C5.935 2.5 5.375 3.025 5.375 3.67C5.375 4.316 5.935 4.84 6.625 4.84C7.315 4.84 7.875 4.316 7.875 3.67ZM7.875 12.33C7.875 11.684 7.315 11.16 6.625 11.16C5.935 11.16 5.375 11.684 5.375 12.33C5.375 12.975 5.935 13.5 6.625 13.5C7.315 13.5 7.875 12.975 7.875 12.33ZM6.625 6.83C7.315 6.83 7.875 7.355 7.875 8C7.875 8.645 7.315 9.17 6.625 9.17C5.935 9.17 5.375 8.645 5.375 8C5.375 7.355 5.935 6.83 6.625 6.83ZM11.625 3.67C11.625 3.025 11.065 2.5 10.375 2.5C9.685 2.5 9.125 3.025 9.125 3.67C9.125 4.316 9.685 4.84 10.375 4.84C11.065 4.84 11.625 4.316 11.625 3.67ZM10.375 11.16C11.065 11.16 11.625 11.684 11.625 12.33C11.625 12.975 11.065 13.5 10.375 13.5C9.685 13.5 9.125 12.975 9.125 12.33C9.125 11.684 9.685 11.16 10.375 11.16ZM11.625 8C11.625 7.355 11.065 6.83 10.375 6.83C9.685 6.83 9.125 7.355 9.125 8C9.125 8.645 9.685 9.17 10.375 9.17C11.065 9.17 11.625 8.645 11.625 8Z",fill:"currentColor"})}),nw=({className:e})=>i.jsxs("svg",{width:"7",height:"8",viewBox:"0 0 7 8",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e,children:[i.jsx("path",{d:"M0.660034 6.83L6.32003 1.17",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),i.jsx("path",{d:"M6.32003 6.83L0.660034 1.17",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})]}),RW=({dataCoin:e,coinInclude:t,coinExclude:n,setCoinInclude:r,setCoinExclude:s,isLoadingCoin:a})=>{const[o,l]=m.useState(!1),[c,u]=m.useState(""),d=()=>{l(C=>!C)};m.useEffect(()=>{const C=e.filter(N=>!(n!=null&&n.includes(N.value))).map(N=>N.value);r(C)},[e,n]);const f=C=>{t!=null&&t.includes(C)?(r(t.filter(N=>N!==C)),s([...n,C])):(s(n.filter(N=>N!==C)),r([...t,C]))},x=()=>{const C=e.map(N=>N.value);r(C),s([])},g=()=>{const C=e.map(N=>N.value);s(C),r([])},v=e==null?void 0:e.filter(C=>{var N;return(N=C.label.toLowerCase())==null?void 0:N.includes(c.toLowerCase())}),w=()=>{u("")};return i.jsxs("div",{className:"col-span-1 flex flex-col gap-[4px] justify-start w-full max-w-full z-3",children:[i.jsxs("div",{className:"flex justify-start items-center gap-2",children:[i.jsx("span",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px]",children:"Asset Management"}),i.jsxs("div",{className:"flex items-center has-tooltip relative",children:[i.jsx(Ni,{className:"text-[#7C7C7C] w-4 min-w-4 min-h-4 h-4 relative"}),i.jsx("span",{children:i.jsx(ro,{content:"Choose which assets to include or exclude from copy trading. You can customize which coins you want to trade.",positionTop:!1,alignRight:!0,tooltipCss:"max-w-[180px] min-w-[180px] leading-[16px] mt-6"})})]})]}),i.jsxs("div",{className:"relative w-full max-w-full",children:[i.jsxs("div",{className:" flex justify-between items-center bg-[#353535] text-white rounded-md py-3 px-2.5 cursor-pointer select-none h-8",onClick:d,children:[i.jsx("div",{className:"flex justify-start items-center text-[#7c7c7c] text-sm font-semibold font-manrope leading-[8px]",children:i.jsxs("div",{className:"flex justify-start items-center gap-[3px]",children:[i.jsx("div",{className:"w-1.5 h-1.5 bg-[#67ffbd] rounded-full"}),i.jsxs("div",{className:"text-white text-[11px] font-semibold font-manrope leading-[8px]",children:["Include"," ",i.jsx("span",{className:`${(t==null?void 0:t.length)>0?"text-[#67ffbd]":"text-white"} text-[11px] font-semibold font-manrope leading-[8px]`,children:`(${t==null?void 0:t.length})`})]}),i.jsx("div",{className:"w-1.5 h-1.5 bg-[#ff787b] rounded-full ml-[6px]"}),i.jsxs("div",{className:"text-white text-[11px] font-semibold font-manrope leading-[8px]",children:["Exclude"," ",i.jsx("span",{className:`${(n==null?void 0:n.length)>0?"text-[#ff787b]":"text-white"} text-[11px] font-semibold font-manrope leading-[8px]`,children:`(${n==null?void 0:n.length})`})]})]})}),i.jsx(Yh,{className:`w-3.5 h-3.5 transition ${o?"rotate-180":""}`})]}),o&&i.jsxs("div",{className:"w-full bg-[#353535] rounded-md mt-[2px] p-1 transition-all duration-200",children:[i.jsxs("div",{className:"flex justify-between items-center space-x-4 mb-2",children:[i.jsxs("div",{className:"flex justify-start items-center gap-2",children:[i.jsx("div",{onClick:x,className:"h-4 p-1.5 rounded-md outline outline-1 outline-[#67ffbd] inline-flex justify-start items-center gap-2 cursor-pointer",children:i.jsx("div",{className:"justify-start text-[#67ffbd] text-[11px] font-semibold font-manrope leading-[8px]",children:"Select All Include"})}),i.jsx("div",{onClick:g,className:"h-4 p-1.5 rounded-md outline outline-1 outline-[#ff787b] inline-flex justify-start items-center gap-2 cursor-pointer",children:i.jsx("div",{className:"justify-start text-[#ff787b] text-[11px] font-semibold font-manrope leading-[8px]",children:"Select All Exclude"})})]}),i.jsxs("div",{className:"flex items-center relative",children:[i.jsx("input",{type:"text",placeholder:"Search Coin",value:c,onChange:C=>u(C.target.value),className:`${c?"border border-[#7F7F7F]":""} py-[4px] bg-[#1B1B1B] border border-[#303030] rounded-md block text-white text-sm font-medium font-inter leading-[8px] w-full sm:w-[153px] lg:w-full pl-[30px] pr-6 focus:outline-none placeholder:text-[#7F7F7F] placeholder:font-inter placeholder:text-sm placeholder:font-medium placeholder:leading-[8px] h-[32px]`}),i.jsx(_y,{className:"text-[#646464] absolute left-1.5"}),c&&i.jsx("span",{onClick:w,className:"flex justify-center items-center cursor-pointer absolute right-2 w-[10px] h-[10px]",children:i.jsx(nw,{className:"hover:text-[#cdcdcd] text-[#7C7C7C] w-[10px] h-[10px]"})})]})]}),i.jsx("div",{className:"max-h-[230px] overflow-y-auto scrollbar-custom-scrollbar-dark",children:a?i.jsx("span",{className:"flex justify-center items-center w-full text-[#7e7e7e] text-sm font-medium font-inter leading-[8px] my-2",children:"Loading..."}):!v||v.length===0?i.jsx("span",{className:"flex justify-center items-center w-full text-[#7e7e7e] text-sm font-medium font-inter leading-[8px] my-4",children:c?"No coins match your search":"No data available at the moment. Please try again later."}):v==null?void 0:v.map((C,N)=>i.jsxs("div",{className:`${t!=null&&t.includes(C.value)?"bg-[#67ffbd]/20 hover:bg-[#67ffbd]/30":"bg-[#ff797c]/20 hover:bg-[#ff797c]/30"} flex justify-between items-center h-8 p-2 text-xs text-white rounded-md mb-[2px]`,children:[i.jsxs("div",{className:"flex justify-start items-center gap-[26px]",children:[i.jsx(VBt,{className:`${t!=null&&t.includes(C.value)?"text-[#67FFBD]":"text-[#FF797C]"} w-4 h-4`}),i.jsxs("div",{className:"flex justify-start items-center gap-1.5",children:[i.jsx("img",{src:C==null?void 0:C.icon,alt:C==null?void 0:C.icon,className:"rounded-full w-5 h-5 min-w-5 min-h-5",loading:"lazy",onError:P=>fm(P)}),i.jsx("span",{className:`${t!=null&&t.includes(C.value)?"text-[#67FFBD]":"text-[#FF797C]"} justify-start text-[11px] font-semibold font-manrope leading-[13px] tracking-tight`,children:C.label})]})]}),i.jsxs("div",{className:"flex space-x-2",children:[i.jsx("div",{onClick:()=>f(C.value),className:`${t!=null&&t.includes(C.value)?"bg-green-500 border-[#67ffbd]":"border-[#cdcdcd]"} h-4 p-1.5 rounded-md border inline-flex justify-start items-center gap-2 text-white cursor-pointer`,children:i.jsx("div",{className:"justify-start text-[11px] font-semibold font-manrope leading-[8px]",children:"Include"})}),i.jsx("div",{onClick:()=>f(C.value),className:`${t!=null&&t.includes(C.value)?"border-[#cdcdcd]":"bg-[#ff787b] border-[#ff787b]"} h-4 p-1.5 rounded-md border inline-flex justify-start items-center gap-2 text-white cursor-pointer`,children:i.jsx("div",{className:"justify-start text-[11px] font-semibold font-manrope leading-[8px]",children:"Exclude"})})]})]},N))})]})]})]})},LW=new Map,WBt=e=>{if(!e)return Math.floor(Math.random()*1240);const t=e.toLowerCase().replace(/^0x/,"");return parseInt(t.slice(0,8),16)%1240};function iDe({wallet:e,className:t=""}){const[n,r]=m.useState(()=>LW.get(e)||null),[s,a]=m.useState(!1);return m.useEffect(()=>{if(LW.has(e))return;const o=WBt(e);fs.get(`https://apiv7.nftinit.io/api/f5WNdSBmQ/${o}`).then(({data:l})=>{let c=l==null?void 0:l.image;c!=null&&c.startsWith("ipfs://")&&(c=`https://ipfs.io/ipfs/${c.slice(7)}`),LW.set(e,c),r(c)}).catch(console.error)},[e]),n?i.jsx("img",{src:n,alt:"NFT avatar",className:`${t} ${s?"":"invisible"}`,onLoad:()=>a(!0),onError:()=>a(!0)}):i.jsx("div",{className:`${t} bg-gray-800 rounded-full animate-pulse`})}const qBt=({open:e,setOpen:t,setCopyTradeModal:n,onClose:r,setIsUnderstand:s})=>i.jsxs(Ea,{open:e,onClose:()=>{},className:"relative z-50 font-manrope",children:[i.jsx(ja,{transition:!0,style:{backgroundColor:"rgba(0, 0, 0, 0.48)"},className:"fixed inset-0 transition-opacity data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in"}),i.jsx("div",{className:"fixed inset-0 z-50 w-screen overflow-y-auto",children:i.jsx("div",{className:"flex min-h-full justify-center p-4 text-center items-center sm:p-0",children:i.jsx(xa,{transition:!0,className:"relative transform overflow-hidden bg-[#101010] text-left shadow-xl transition-all data-[closed]:translate-y-4 data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in data-[closed]:sm:translate-y-0 data-[closed]:sm:scale-95 rounded-3xl",children:i.jsx("div",{className:"flex flex-col justify-start items-center gap-8 w-[320px] sm:w-[480px] h-max relative bg-[#252525] rounded-3xl pt-4 pb-6",children:i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"pt-4",children:i.jsx("img",{src:Gi,alt:"",className:"w-[86px h-[86px]"})}),i.jsxs("div",{className:"flex flex-col justify-start items-center gap-4",children:[i.jsx("div",{className:"w-80 sm:w-96 text-center text-white font-manrope text-[16px] sm:text-[20px] font-semibold leading-[8px]",children:"Potential Bot Wallet Detected"}),i.jsx("div",{className:"w-[270px] sm:w-[398px] text-center text-white/60 text-[13px] sm:text-[16px] font-medium font-manrope leading-5",children:"The wallet you're trying to copy trade appears to be likely operated by a bot. Following bot wallets may result in significant financial losses as they often use automated strategies that may not be profitable."})]}),i.jsxs("div",{className:"flex items-center justify-center gap-4",children:[i.jsx("div",{onClick:()=>{t(!1),r()},className:"h-8 px-4 py-3 rounded-xl shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-white justify-center items-center gap-2.5 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px]",children:"Cancel"})}),i.jsx("div",{onClick:()=>{t(!1),s(!0)},className:"h-8 px-2.5 bg-[#7445ff] rounded-[10px] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-[#8860ff] justify-center items-center gap-1.5 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px]",children:"I Understand, Continue"})})]})]})})})})})]}),GBt=({open:e,setOpen:t,setCopyTradeModal:n,onClose:r,setIsLighterUnderstand:s})=>i.jsxs(Ea,{open:e,onClose:()=>{},className:"relative z-50 font-manrope",children:[i.jsx(ja,{transition:!0,style:{backgroundColor:"rgba(0, 0, 0, 0.48)"},className:"fixed inset-0 transition-opacity data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in"}),i.jsx("div",{className:"fixed inset-0 z-50 w-screen overflow-y-auto",children:i.jsx("div",{className:"flex min-h-full justify-center p-4 text-center items-center sm:p-0",children:i.jsx(xa,{transition:!0,className:"relative transform overflow-hidden bg-[#101010] text-left shadow-xl transition-all data-[closed]:translate-y-4 data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in data-[closed]:sm:translate-y-0 data-[closed]:sm:scale-95 rounded-3xl",children:i.jsx("div",{className:"flex flex-col justify-start items-center gap-8 w-[320px] sm:w-[480px] h-max relative bg-[#252525] rounded-3xl pt-4 pb-6",children:i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"pt-4",children:i.jsx("img",{src:Gi,alt:"",className:"w-[86px h-[86px]"})}),i.jsxs("div",{className:"flex flex-col justify-start items-center gap-4",children:[i.jsx("div",{className:"w-80 sm:w-96 text-center text-white font-manrope text-[16px] sm:text-[20px] font-semibold leading-[8px]",children:"Rate Limit Warning"}),i.jsx("div",{className:"w-[270px] sm:w-[410px] text-center text-white/60 text-[13px] sm:text-[16px] font-medium font-manrope leading-5",children:"The wallet you’re trying to follow may execute frequent transactions. To ensure reliable copy-trading without rate-limit interruptions, please switch your account type to Premium before proceeding. Otherwise, trades may fail to execute due to API rate restrictions."}),i.jsxs("div",{onClick:()=>window.open("https://docs.lighter.xyz/perpetual-futures/account-types","_blank"),className:"flex justify-center items-center w-max gap-1.5 rounded-[10px] cursor-pointer",children:[i.jsx("div",{className:"text-white text-sm font-medium font-manrope leading-[18px] tracking-tight w-full sm:max-w-[500px] mb-2",children:"Learn more about Lighter account types here"}),i.jsx("img",{src:gm,alt:"routing",className:"w-3 h-3 mb-2"})]})]}),i.jsxs("div",{className:"flex items-center justify-center gap-4",children:[i.jsx("div",{onClick:()=>{t(!1),r()},className:"h-8 px-4 py-3 rounded-xl shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-white justify-center items-center gap-2.5 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px]",children:"Cancel"})}),i.jsx("div",{onClick:()=>{t(!1),s(!0)},className:"h-8 px-2.5 bg-[#7445ff] rounded-[10px] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-[#8860ff] justify-center items-center gap-1.5 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px]",children:"I Understand, Continue"})})]})]})})})})})]}),KBt=({checkAccountCopy:e,setIsLighterSub:t,setLighterSubError:n,setSlotCount:r,setSlotSubsCount:s,setSlotUsingCount:a,setSlotTotalCount:o,setSlotCountWallets:l})=>{const{setSignModalOpen:c,setTelegramChatId:u,setSubscriberRole:d,setSubsExpireDay:f,setMushboomerETH:x,setMushboomerSOL:g,setIsReferralCode:v,setIsReferralCodeName:w,setIsWhitelist:C,setHyperToken:N,setHyperAddress:P}=m.useContext(Qr),{address:I}=ns(),[R,F]=m.useState(!1),[U,L]=m.useState(!1),[z,Q]=m.useState(""),[ne,J]=m.useState(""),[X,re]=m.useState(""),[pe,Y]=m.useState(!1),ie=async()=>{var fe,Ne,he,ge,ye,ve;const ee=window.localStorage.getItem("hyperToken"),ae=window.localStorage.getItem("hyperAddress");if(!(!ee||!ae))try{Y(!0);const je=await Ei(ae.toLowerCase(),ee);je!=null&&je.success?(u(je==null?void 0:je.telegram_chat_id),d(je==null?void 0:je.subscriber_role),f(je==null?void 0:je.subs_expire_day),x((fe=je==null?void 0:je.mushboomer_counts)==null?void 0:fe.eth),g((Ne=je==null?void 0:je.mushboomer_counts)==null?void 0:Ne.sol),v(je==null?void 0:je.referral_code),w(je==null?void 0:je.refcode),C(je==null?void 0:je.whitelist),N(ee),P(ae),re(je==null?void 0:je.farming_tools),t(je==null?void 0:je.farming_tools),Y(!1),je!=null&&je.farming_tools&&n(!1),r((he=je==null?void 0:je.copy_trade_slots_info)==null?void 0:he.extra_slot_count),s((ge=je==null?void 0:je.copy_trade_slots_info)==null?void 0:ge.subs_slot_count),a((ye=je==null?void 0:je.copy_trade_slots_info)==null?void 0:ye.using_slot_count),o((ve=je==null?void 0:je.copy_trade_slots_info)==null?void 0:ve.total_slot_count),l(je==null?void 0:je.copy_trade_slots_wallets)):(window.localStorage.removeItem("hyperToken"),window.localStorage.removeItem("hyperAddress"),N(""),P(""),Y(!1))}catch(je){console.error("Token verification error:",je),console.error(je.message||"An unknown error occurred."),Y(!1)}},oe=async()=>new Sl(window.ethereum).eth.getAccounts(ae=>ae),G=async(ee="farming",ae=24,fe=5e3)=>{ae<=0||(await new Promise(Ne=>setTimeout(Ne,fe)),await ie(),ee==="farming"&&!X?G(ee,ae-1,fe):e())},V=async()=>{J("");const ee=window.localStorage.getItem("hyperToken"),ae=window.localStorage.getItem("hyperAddress");if(!ee||!I){c(!0);return}L(!0),F(!0);try{await window.ethereum.request({method:"wallet_switchEthereumChain",params:[{chainId:"0x1"}]})}catch(he){console.error("Failed to switch network",he),F(!1);return}const fe=new Sl(window.ethereum);var Ne=await oe();if(Ne.length>0?Ne=Ne[0]:Ne=void 0,Ne){const ge={from:Ne,to:"0xdEAe8586eD227A5096EBae47342fFc1ED99f13F9",value:"120000000000000000"};await fe.eth.sendTransaction(ge).then(ye=>{console.log("txHash :>> ",ye),F(!1),Q(ye.transactionHash),fetch("https://dextrabothypev2.nftinit.io/api/hyper/payment/save/",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:I?I.toLowerCase():ae,token:ee,payment_tx:ye.transactionHash,payment_role:"farming_tools"})}),ie(),G("farming")}).catch(ye=>{console.log(ye),ye.code===-32003||ye.message.includes("insufficient funds")?J("Insufficient funds."):ye.message==="MetaMask Tx Signature: User denied transaction signature."&&L(!1)})}else await fe.eth.requestAccounts()};return i.jsxs(i.Fragment,{children:[i.jsx(bd,{open:U,setOpen:L,transactionHash:z,transactionLoading:R,paymentPresaleRole:X,errorFunds:ne,activeMethod:2}),i.jsx("div",{children:i.jsx("div",{onClick:()=>{V()},className:"flex items-center justify-center h-8 px-6 rounded-[10px] text-[13px] border bg-[#7446FF] border-[#8861FF] hover:bg-[#5834C3] cursor-pointer min-w-max font-semibold",children:"Subscribe / 0.12 ETH"})})]})},Ele=({open:e=!1,setOpen:t=()=>{},oldSlotCount:n,checkAccountTrade:r,tradeMarket:s})=>{const{address:a}=ns(),{setSignModalOpen:o,setTelegramChatId:l,setSubscriberRole:c,setSubsExpireDay:u,setMushboomerETH:d,setMushboomerSOL:f,setIsReferralCode:x,setIsReferralCodeName:g,setIsWhitelist:v,setHyperToken:w,setHyperAddress:C}=m.useContext(Qr),[N,P]=m.useState(1),[I,R]=m.useState(!1),[F,U]=m.useState(!1),[L,z]=m.useState(""),[Q,ne]=m.useState(""),[J,X]=m.useState(""),re=ae=>/^\d*$/.test(ae),pe=ae=>{["e","E","+","-"].includes(ae.key)&&ae.preventDefault()};m.useEffect(()=>{e||P(1)},[e]);const Y=m.useRef(J);m.useEffect(()=>{Y.current=J},[J]);const ie=m.useMemo(()=>{if(N==="")return!1;const ae=Number(N);return Number.isInteger(ae)&&ae>=1},[N]),oe=async()=>{var Ne,he,ge;const ae=window.localStorage.getItem("hyperToken"),fe=window.localStorage.getItem("hyperAddress");if(!(!ae||!fe))try{const ye=await Ei(fe.toLowerCase(),ae);ye!=null&&ye.success?(l(ye==null?void 0:ye.telegram_chat_id),c(ye==null?void 0:ye.subscriber_role),u(ye==null?void 0:ye.subs_expire_day),d((Ne=ye==null?void 0:ye.mushboomer_counts)==null?void 0:Ne.eth),f((he=ye==null?void 0:ye.mushboomer_counts)==null?void 0:he.sol),x(ye==null?void 0:ye.referral_code),g(ye==null?void 0:ye.refcode),v(ye==null?void 0:ye.whitelist),w(ae),C(fe),X((ge=ye==null?void 0:ye.copy_trade_slots_info)==null?void 0:ge.extra_slot_count)):(window.localStorage.removeItem("hyperToken"),window.localStorage.removeItem("hyperAddress"),w(""),C(""))}catch(ye){console.error("Token verification error:",ye),console.error(ye.message||"An unknown error occurred.")}},G=async()=>new Sl(window.ethereum).eth.getAccounts(fe=>fe),V=async(ae="slot",fe=24,Ne=5e3)=>{fe<=0||(await new Promise(he=>setTimeout(he,Ne)),await oe(),ae==="slot"&&Y.current<=n?V(ae,fe-1,Ne):r())},ee=async ae=>{ne("");const fe=window.localStorage.getItem("hyperToken"),Ne=window.localStorage.getItem("hyperAddress");if(!fe||!a){o(!0);return}U(!0),R(!0);try{await window.ethereum.request({method:"wallet_switchEthereumChain",params:[{chainId:"0x1"}]})}catch(ye){console.error("Failed to switch network",ye),R(!1);return}const he=new Sl(window.ethereum);var ge=await G();if(ge.length>0?ge=ge[0]:ge=void 0,ge){const ve=ae*.012,je=he.utils.toWei(ve.toString(),"ether"),Ie={from:ge,to:"0xdEAe8586eD227A5096EBae47342fFc1ED99f13F9",value:je};await he.eth.sendTransaction(Ie).then(Le=>{console.log("txHash :>> ",Le),R(!1),z(Le.transactionHash),fetch("https://dextrabothypev2.nftinit.io/api/hyper/slots_payment/save/",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:a?a.toLowerCase():Ne,token:fe,payment_tx:Le.transactionHash,slot_role:"lighter_copy_trade",slot_qty:Number(N)})}),oe(),V("slot")}).catch(Le=>{console.log(Le),Le.code===-32003||Le.message.includes("insufficient funds")?ne("Insufficient funds."):Le.message==="MetaMask Tx Signature: User denied transaction signature."&&U(!1)})}else await he.eth.requestAccounts()};return e?i.jsxs(i.Fragment,{children:[i.jsx(bd,{open:F,setOpen:U,transactionHash:L,transactionLoading:I,paymentPresaleRole:!(J<=n),errorFunds:Q,activeMethod:2}),i.jsxs("div",{className:"fixed inset-0 z-[51] flex items-center justify-center",children:[i.jsx("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-[2px]",onClick:()=>t(!1)}),i.jsx("div",{className:"relative w-[380px] max-w-[92vw] rounded-3xl bg-[#1B1B1B] text-white shadow-xl border border-[#404040] max-h-[97dvh] overflow-y-auto p-5",children:i.jsxs("div",{className:"flex flex-col w-full gap-4",children:[i.jsx("div",{className:"text-white/90 font-manrope text-[18px] font-semibold leading-4 mx-auto",children:"Get more slots"}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Slot Count"}),i.jsxs("div",{className:"flex items-center justify-center gap-2",children:[i.jsx("button",{onClick:()=>P(ae=>{const fe=Number(ae||0);return fe>1?String(fe-1):"1"}),className:"w-8 h-8 flex items-center justify-center rounded-md bg-[#242424] border border-[#353535] text-[#bbb] hover:text-white hover:border-[#555] transition-all",children:"–"}),i.jsx("input",{value:N,onChange:ae=>{const fe=ae.target.value.trim();if(fe==="")return P("");re(fe)&&P(fe)},onKeyDown:pe,inputMode:"numeric",autoComplete:"off",placeholder:"e.g. 10",className:"w-full h-8 text-center rounded-md bg-[#242424] border border-[#353535] text-white text-[13px] outline-none placeholder:text-[#7F7F7F]"}),i.jsx("button",{onClick:()=>P(ae=>{const fe=Number(ae||0);return String(fe+1)}),className:"w-8 h-8 flex items-center justify-center rounded-md bg-[#242424] border border-[#353535] text-[#bbb] hover:text-white hover:border-[#555] transition-all",children:"+"})]}),N!==""&&!ie&&i.jsx("div",{className:"text-[#FF797C] text-[12px]",children:"Enter an integer that is at least 1."})]}),i.jsxs("div",{className:"text-[13px] text-[#7C7C7C] font-semibold flex items-center gap-1",children:["Total Price:",i.jsxs("span",{className:"bg-[#1E1E1E] text-[#F8D4AB] font-bold px-2 py-[2px] rounded-md border border-[#3A3A3A]",children:[(N*.012).toFixed(3)," ETH"]})]}),i.jsx("div",{onClick:ae=>{ae.preventDefault(),ie&&ee(N)},className:`flex items-center justify-center h-8 px-6 rounded-[10px] text-[13px] border bg-[#7446FF] border-[#8861FF] hover:bg-[#5834C3] min-w-max font-semibold ${ie?"bg-[#7446FF] border-[#8861FF] hover:bg-[#5834C3] cursor-pointer":"bg-[#2a2a2a] border-[#3a3a3a] opacity-60 cursor-not-allowed"}`,children:"Buy"})]})})]})]}):null},YBt=({normalizedCopyTradeList:e,selectedWmIndex:t,setSelectedWmIndex:n,getSettingList:r,setIsNewSetting:s})=>i.jsxs("div",{children:[i.jsx("span",{className:"text-[#9B9B9B] font-manrope text-[10px] font-semibold leading-[13px] tracking-[0.8px]",children:"ACTIVE BOTS"}),(e==null?void 0:e.length)>0?i.jsxs("div",{className:"flex flex-col gap-2.5 p-2.5 mt-1.5 border border-white/5 rounded-xl bg-gradient-to-b from-[#1a1a1a] to-[#141414] shadow-lg",children:[i.jsxs("button",{onClick:r,className:`${t===null?"bg-[#2d4a3e] border border-[#3a6b5a] text-white shadow-[0_0_0_1px_rgba(116,70,255,0.3)]":"bg-[#181818] border border-[#7446FF40] text-white hover:bg-[#5834C320] hover:border-[#5834C370]"} px-3 py-2 rounded-lg text-left text-[12px] font-semibold transition-all duration-200 flex items-center justify-start gap-2 relative group`,children:[i.jsx("div",{className:`${t===null?"bg-[#3a6b5a] group-hover:bg-[#2d4a3e]":"bg-[#7446FF30] group-hover:bg-[#5834C350]"} flex items-center justify-center w-4 h-4 rounded transition-colors`,children:i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:`${t===null?"text-[#fff]":"text-[#7446FF]"} w-3 h-3 `,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:3,children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 4v16m8-8H4"})})}),i.jsx("span",{children:"Copy with Another Wallet"}),i.jsx("span",{className:`${t===null?"text-white bg-[#3a6b5a]":"text-white bg-[#7446FF]"} ml-auto px-1.5 py-0.5 rounded text-[9px] font-bold `,children:"NEW"})]}),i.jsx("div",{className:"w-full h-px bg-white/5"}),i.jsx("div",{className:"flex flex-col gap-2 max-h-[21vh] overflow-y-scroll scrollbar-custom-scrollbar-dark",children:e==null?void 0:e.map((a,o)=>{var l,c,u,d;return i.jsxs("button",{onClick:()=>{n(o),s(!1)},className:`px-3 py-2 rounded-lg text-left text-[12px] font-medium transition-all duration-200
${t===o?"bg-[#2d4a3e] border border-[#3a6b5a] text-white shadow-[0_0_0_1px_rgba(58,107,90,0.3)]":"bg-[#181818] border border-[#2a2a2a] text-white hover:bg-[#1f1f1f] hover:border-[#353535]"} flex justify-between items-center gap-2`,children:[i.jsxs("div",{className:"flex justify-start items-center gap-2",children:[i.jsx("div",{className:"flex justify-start items-center gap-2",children:(a==null?void 0:a.target_platform)==="hyper"?i.jsx(i.Fragment,{children:i.jsx("img",{src:"https://app.hyperliquid.xyz/coins/HYPE.svg",className:"w-4 h-4"})}):i.jsx(i.Fragment,{children:i.jsx(Mg,{className:"w-4 h-4 text-white"})})}),i.jsx("span",{className:`min-w-max ${t===o?"text-white":"text-[#d3d3d3]"}`,children:((l=a==null?void 0:a.wm_name)==null?void 0:l.length)>15?`${(c=a==null?void 0:a.wm_name)==null?void 0:c.slice(0,15)}...`:a==null?void 0:a.wm_name}),i.jsx("span",{className:"text-[#9b9b9b]",children:"-"}),i.jsx("span",{className:t===o?"text-white":"text-[#d3d3d3]",children:((u=a==null?void 0:a.tag)==null?void 0:u.length)>18?`${(d=a==null?void 0:a.tag)==null?void 0:d.slice(0,18)}...`:a==null?void 0:a.tag})]}),i.jsx(mi,{content:`${a!=null&&a.copy_trait_mode?"Run: ON":"Run: OFF"}`,children:i.jsx("div",{className:"flex justify-start items-center has-tooltip relative",children:i.jsx("span",{className:"flex items-center gap-2",children:i.jsx("span",{className:`w-2.5 h-2.5 rounded-full ${a!=null&&a.copy_trait_mode?"bg-green-500":"bg-red-500"}`})})})})]},o)})})]}):i.jsxs("div",{className:"flex flex-col justify-center items-center gap-3",children:[i.jsx("img",{src:ac,alt:""}),i.jsx("div",{className:"flex flex-col items-center h-max gap-3",children:i.jsx("div",{className:"text-[#d3d3d3] text-sm font-semibold font-manrope leading-[8px] pt-3",children:"No trades have been made with this wallet."})})]})]});function w5({open:e,setOpen:t,copyTradeData:n,copyTradeWallet:r,setCopyTradeWallet:s,isScalper:a,setCopyTradeData:o,sourcePage:l="default"}){var Wn,Fr,kr,ts,Ms;const{getCopyTradeWatchList:c,copyTradeWatchList:u,mushboomerETH:d,mushboomerSOL:f,trackedWatchList:x,isWhitelist:g,setTelegramChatId:v,setSubscriberRole:w,setSubsExpireDay:C,setMushboomerETH:N,setMushboomerSOL:P,setIsReferralCode:I,setIsReferralCodeName:R,setIsWhitelist:F,setHyperToken:U,setHyperAddress:L}=m.useContext(Qr),{address:z}=ns(),[Q,ne]=m.useState(!1),[J,X]=m.useState(!1),[re,pe]=m.useState("method_two"),[Y,ie]=m.useState("All"),[oe,G]=m.useState([]),[V,ee]=m.useState(!1),[ae,fe]=m.useState(null),[Ne,he]=m.useState(!1),[ge,ye]=m.useState(!1),[ve,je]=m.useState(!1),[Ie,Le]=m.useState(!1),[Qe,$e]=m.useState(!1),[it,tt]=m.useState(!1),[lt,ft]=m.useState(!1),[ut,qt]=m.useState(!1),[It,nn]=m.useState(""),[jt,cn]=m.useState(""),[un,Ft]=m.useState(""),[Ke,Bt]=m.useState(""),[$t,qe]=m.useState(""),[Ye,ht]=m.useState(""),[Zt,zt]=m.useState(""),[Et,nt]=m.useState(""),[Ue,Rt]=m.useState(100),[We,at]=m.useState(!0),[mt,Dt]=m.useState(!0),[Tt,dn]=m.useState(!1),[on,gn]=m.useState(!0),[Nn,kn]=m.useState(!0),[yn,Vn]=m.useState(null),[Gn,Dn]=m.useState(null),[Kn,Cn]=m.useState(""),[sn,Me]=m.useState(""),[en,an]=m.useState({inputValue:"",selectValue:"%"}),[Nt,Yn]=m.useState({inputValue:"",selectValue:"%"}),[xn,Mt]=m.useState([]),[tn,In]=m.useState(!0),[Xn,or]=m.useState([]),[lr,Qt]=m.useState([]);m.useState(!1),m.useState(!1);const[zn,Jn]=m.useState(!1),[Lt,jn]=m.useState(null),[Ee,h]=m.useState(null),[p,S]=m.useState(null),[_,k]=m.useState(null),[T,B]=m.useState(!1),[q,te]=m.useState(!1),[ue,de]=m.useState(!1),[xe,Se]=m.useState(!1),[ke,Re]=m.useState(!1),Ge=m.useRef(null),[Fe,st]=m.useState(null),[se,Ce]=m.useState(!1),Be=m.useRef(null),[De,_e]=m.useState(!1),[Je,ct]=m.useState(!1),[gt,Xt]=m.useState(!1),[wt,Xe]=m.useState([]),[Oe,bt]=m.useState([]),[kt,Ut]=m.useState(!1),[fn,On]=m.useState(!1),[Sn,yr]=m.useState(!1),[Pn,En]=m.useState(0),[$n,Bn]=m.useState(0),[_r,sr]=m.useState(0),[rr,Rr]=m.useState(0),[Jr,ws]=m.useState(null),[ls,et]=m.useState(!1),[yt,Tn]=m.useState(!1),[tr,Ar]=m.useState([]),[Br,Vr]=m.useState(null),[dr,jr]=m.useState(!1),ps=async At=>{var os,is,ms,gs,$i,Bs;if(!e)return;const ir=At||Fe,Hn=window.localStorage.getItem("hyperToken"),Hr=window.localStorage.getItem("hyperAddress");if(!(!Hn||!Hr))try{yr(!0);const bs=await Ei(Hr.toLowerCase(),Hn);bs!=null&&bs.success?(v(bs==null?void 0:bs.telegram_chat_id),w(bs==null?void 0:bs.subscriber_role),C(bs==null?void 0:bs.subs_expire_day),N((os=bs==null?void 0:bs.mushboomer_counts)==null?void 0:os.eth),P((is=bs==null?void 0:bs.mushboomer_counts)==null?void 0:is.sol),I(bs==null?void 0:bs.referral_code),R(bs==null?void 0:bs.refcode),F(bs==null?void 0:bs.whitelist),U(Hn),L(Hr),En((ms=bs==null?void 0:bs.copy_trade_slots_info)==null?void 0:ms.extra_slot_count),Bn((gs=bs==null?void 0:bs.copy_trade_slots_info)==null?void 0:gs.subs_slot_count),sr(($i=bs==null?void 0:bs.copy_trade_slots_info)==null?void 0:$i.using_slot_count),Rr((Bs=bs==null?void 0:bs.copy_trade_slots_info)==null?void 0:Bs.total_slot_count),Ar(bs==null?void 0:bs.copy_trade_slots_wallets),Ut(bs==null?void 0:bs.farming_tools),ir==="lighter"?bs!=null&&bs.farming_tools?On(!1):On(!0):On(!1),yr(!1)):(window.localStorage.removeItem("hyperToken"),window.localStorage.removeItem("hyperAddress"),U(""),L(""),yr(!1))}catch(bs){console.error("Token verification error:",bs),console.error(bs.message||"An unknown error occurred."),yr(!1)}};m.useEffect(()=>{if(e)if(kt&&rr==0&&Fe==="lighter"&&yn){const At=tr==null?void 0:tr.includes(yn);Tn(!At)}else Tn(!1)},[yn,Fe,rr,kt,e]);const gr=m.useMemo(()=>n?Array.isArray(n)?n:[]:[],[n]);m.useEffect(()=>{if(l==="default"||!l||!gr.length)return;const At=gr.findIndex(ir=>(ir==null?void 0:ir.wallet_id)===l);At!==-1&&Vr(At)},[l,gr]),m.useEffect(()=>{l!=="default"||!gr.length||Br===null&&Vr(0)},[gr,l]);const es=gr[Br]||null,Gs=m.useMemo(()=>!dr||!yn?!1:gr.some(At=>(At==null?void 0:At.wallet_id)===yn),[dr,yn,gr,Fe]);function Es(At){return String(At).trim().toUpperCase()}const xr=At=>{At&&(nn(At==null?void 0:At.margin_used_rate),cn(At==null?void 0:At.min_usd_per_order),Ft(At==null?void 0:At.max_usd_per_order),Bt(At==null?void 0:At.max_usd_per_positions),qe(At==null?void 0:At.initial_order_max_usd),ht(At==null?void 0:At.margin_used_amount),zt(At==null?void 0:At.increase_limit),nt(At==null?void 0:At.copy_current_percentage),Rt((At==null?void 0:At.scaling)==null?100:At==null?void 0:At.scaling),ie((At==null?void 0:At.position_type)===0?"All":(At==null?void 0:At.position_type)===1?"LONG":(At==null?void 0:At.position_type)===2?"SHORT":"All"),st(At!=null&&At.target_platform?(At==null?void 0:At.target_platform)==="hyper"?"hyper":At==null?void 0:At.target_platform:"hyper"),pe((At==null?void 0:At.method_type)===1?"method_one":(At==null?void 0:At.method_type)===2?"method_two":(At==null?void 0:At.method_type)===2e3?"method_twothousand":"method_two"),at((At==null?void 0:At.copy_trait_mode)==null?!0:At==null?void 0:At.copy_trait_mode),Dt((At==null?void 0:At.open_with_increase)!==null?At==null?void 0:At.open_with_increase:!0),dn((At==null?void 0:At.included_twaps)!==null?At==null?void 0:At.included_twaps:!1),gn((At==null?void 0:At.future_listed_tokens)!==null?At==null?void 0:At.future_listed_tokens:!0),kn((At==null?void 0:At.copy_current)!==null?At==null?void 0:At.copy_current:!0),Vn(At==null?void 0:At.wallet_id),Dn(At==null?void 0:At.wallet_id),Cn(At==null?void 0:At.tag),Me(At==null?void 0:At.comments),an({inputValue:At==null?void 0:At.stop_loss_amount,selectValue:(At==null?void 0:At.stop_loss_type)??"%"}),Yn({inputValue:At==null?void 0:At.target_price_amount,selectValue:At==null?void 0:At.target_price_type}),or((At==null?void 0:At.include_coins)||[]),Qt((At==null?void 0:At.exclude_coins)||[]),xs(At!=null&&At.target_platform?(At==null?void 0:At.target_platform)==="hyper"?"hyper":At==null?void 0:At.target_platform:"hyper"))};m.useEffect(()=>{es===null&&n!==null?dr||xr(Array.isArray(n)?n[0]:n):xr(es)},[es,n]),m.useEffect(()=>{e&&n===null&&(async()=>{try{const At=window.localStorage.getItem("hyperToken"),ir=window.localStorage.getItem("hyperAddress");if(!At)return;const[Hn,Hr]=await Promise.all([fetch("https://dextrabothypev2.nftinit.io/api/wallet/confirmed-list",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:z?z.toLowerCase():ir,token:At})}),fetch("https://dextrabothypev2.nftinit.io/api/wallet/list-lighter",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:z?z.toLowerCase():ir,token:At})})]),[os,is]=await Promise.all([Hn.json(),Hr.json()]),ms=os!=null&&os.success?os.data:[],gs=is!=null&&is.success?is.data:[];ms.length>0?st("hyper"):gs.length>0?st("lighter"):st("hyper")}catch(At){console.error("Wallet auto-select error:",At)}})()},[e,n]);const Gt=u==null?void 0:u.some(At=>(At==null?void 0:At.wallet_address)===r),ce=async()=>{try{const At=window.localStorage.getItem("hyperToken"),ir=window.localStorage.getItem("hyperAddress");if(!At){setSignModalOpen(!0);return}const Hn="https://dextrabothypev2.nftinit.io/api/hyper/following/get_setting/",Hr={address:z?z.toLowerCase():ir,token:At},os=await fetch(Hn,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(Hr)});if(!os.ok)throw new Error(`Server responded with status ${os.status}`);const is=await os.json();if(is.success){jr(!0);const ms=is==null?void 0:is.data;xr(ms),Vr(null)}else console.log(is.error_message),rn.error(is.error_message)}catch(At){console.error("Error in like function:",At),rn.error(At.message||"Something went wrong!")}},rt=At=>{let ir=At.target.value;if(ir===""){an(Hn=>({...Hn,inputValue:""}));return}/^\d*\.?\d{0,2}$/.test(ir)&&an(Hn=>({...Hn,inputValue:ir}))},Pt=At=>{let ir=At.target.value;if(ir===""){Yn(Hn=>({...Hn,inputValue:""}));return}/^\d*\.?\d{0,2}$/.test(ir)&&Yn(Hn=>({...Hn,inputValue:ir}))},vt=At=>{let ir=At.target.value.trim();if(ir===""){nn(null);return}/^\d*\.?\d{0,2}$/.test(ir)&&nn(ir)},ln=At=>{let ir=At.target.value.trim();if(ir===""){cn(null);return}if(/^\d*\.?\d{0,2}$/.test(ir)){cn(ir);const Hn=parseFloat(ir),Hr=re==="method_twothousand"&&(un!=null&&!isNaN(un)&&un&&Hn>Number(un)||Ke!=null&&!isNaN(Ke)&&Ke&&Hn>Number(Ke));tt(Hr);const os=re==="method_twothousand"&&un!=null&&!isNaN(un)&&un&&Hn!=null&&!isNaN(Hn)&&Hn&&Hn>Number(un);$e(os);const is=re==="method_twothousand"&&Ke!=null&&!isNaN(Ke)&&Ke&&Hn>Number(Ke);qt(is)}},mn=At=>{let ir=At.target.value.trim();if(ir===""){Ft(null);return}if(/^\d*\.?\d{0,2}$/.test(ir)){Ft(ir);const Hn=parseFloat(ir),Hr=re==="method_twothousand"&&(Hn==null||isNaN(Hn)||!Hn||jt!=null&&!isNaN(jt)&&jt&&Hn<Number(jt)||Hn!=null&&!isNaN(Hn)&&Hn&&Ke!=null&&!isNaN(Ke)&&Ke&&Hn>Number(Ke));$e(Hr);const os=re==="method_twothousand"&&jt!=null&&!isNaN(jt)&&jt&&Hn<Number(jt);tt(os);const is=re==="method_twothousand"&&Hn!=null&&!isNaN(Hn)&&Hn&&Ke!=null&&!isNaN(Ke)&&Ke&&Hn>Number(Ke);qt(is)}},cr=At=>{let ir=At.target.value.trim();if(ir===""){qe(null);return}if(/^\d*\.?\d{0,2}$/.test(ir)){qe(ir);const Hn=parseFloat(ir),Hr=re==="method_twothousand"&&Ke!=null&&!isNaN(Ke)&&Ke&&Hn&&Hn>Number(Ke);ft(Hr),qt(Hr)}},Nr=At=>{let ir=At.target.value.trim();if(ir===""){Bt(null);return}if(/^\d*\.?\d{0,2}$/.test(ir)){Bt(ir);const Hn=parseFloat(ir),Hr=re==="method_twothousand"&&(un!=null&&!isNaN(un)&&un&&Hn<Number(un)||jt!=null&&!isNaN(jt)&&jt&&Hn<Number(jt)||$t!=null&&!isNaN($t)&&$t&&Hn<Number($t));qt(Hr);const os=re==="method_twothousand"&&un!=null&&!isNaN(un)&&un&&Hn!=null&&!isNaN(Hn)&&Hn&&Hn<Number(un);$e(os);const is=re==="method_twothousand"&&jt!=null&&!isNaN(jt)&&jt&&Hn<Number(jt);tt(is);const ms=re==="method_twothousand"&&$t!=null&&!isNaN($t)&&$t&&Hn<Number($t);ft(ms)}},fr=At=>{Cn(At.target.value),je(!1)},ur=At=>{let ir=At.target.value;if(ir===""){ht("");return}/^\d*\.?\d{0,2}$/.test(ir)&&ht(ir),ye(!1)},Yr=At=>{let ir=At.target.value;if(ir===""){zt("");return}/^\d*\.?\d{0,2}$/.test(ir)&&zt(ir)},ss=At=>{let ir=At.target.value;if(ir===""){Rt("");return}/^\d*\.?\d{0,2}$/.test(ir)&&Rt(ir)},Ir=At=>{["-","+","e"].includes(At.key)&&At.preventDefault()};async function mr(){try{X(!0);const At=yn,ir=window.localStorage.getItem("hyperToken"),Hn="https://dextrabothypev2.nftinit.io/",Hr=window.localStorage.getItem("hyperAddress");if(!ir||!r)throw new Error("Authentication token is missing. Please log in again.");const is=await(await fetch(Hn+"api/test_app/following/save/",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:z?z.toLowerCase():Hr,token:ir,follow_address:r.toLowerCase(),copy_trait_mode:We??!1,open_with_increase:mt??!1,included_twaps:Tt??!1,future_listed_tokens:on??!1,copy_current:Nn??!1,margin_used_rate:It??null,min_usd_per_order:jt??null,max_usd_per_order:un??null,max_usd_per_positions:Ke??null,initial_order_max_usd:$t||null,margin_used_amount:Ye||null,increase_limit:Zt||null,copy_current_percentage:Et||null,scaling:Ue||null,method_type:re=="method_two"?2:re=="method_twothousand"?2e3:re=="method_one"?1:null,position_type:Y=="All"?0:Y=="LONG"?1:Y=="SHORT"?2:null,tag:Kn??null,comments:sn??null,stop_loss_amount:en.inputValue?en.inputValue:null,stop_loss_type:en.selectValue??"%",target_price_amount:Nt.inputValue?Nt.inputValue:null,target_price_type:Nt.selectValue??"%",wallet_id:yn??null,include_coins:Array.isArray(Xn)&&(Xn==null?void 0:Xn.length)>0?Xn:null,exclude_coins:Array.isArray(lr)&&(lr==null?void 0:lr.length)>0?lr:null,target_platform:Fe??"hyper"})})).json();if(is.success){X(!1),c();const ms=Array.isArray(is.data)?is.data.filter(Bs=>{var bs;return((bs=Bs==null?void 0:Bs.wallet_address)==null?void 0:bs.toLowerCase())===(r==null?void 0:r.toLowerCase())}):[],gs=ms==null?void 0:ms.sort((Bs,bs)=>new Date(bs.created_at)-new Date(Bs.created_at));o(gs);const $i=gs==null?void 0:gs.findIndex(Bs=>(Bs==null?void 0:Bs.wallet_id)===At);Vr($i!==-1?$i:0),ps(Fe),Jn(!1),rn.success(`${(r==null?void 0:r.slice(0,5))+"..."+(r==null?void 0:r.slice(-3))} ${Gt?"Copy Trade settings saved":"Successfully added to Copy Trade"}`,{style:{border:"1px solid #22c55e",padding:"16px",color:"#fff",borderRadius:"999px",background:"#14532d",height:"60px",width:"440px",minWidth:"440px",whiteSpace:"nowrap"},iconTheme:{primary:"#22c55e",secondary:"#FFFAEE"}}),jr(!1)}else X(!1),rn.error(is.error_message||"Registration failed.")}catch(At){console.error("Error in copyTradeSave:",At),rn.error(At.message||"An unexpected error occurred."),X(!1)}}const Qn=async()=>{try{ne(!0);const At=window.localStorage.getItem("hyperToken"),ir="https://dextrabothypev2.nftinit.io/api/test_app/following/unfollow/",Hn=window.localStorage.getItem("hyperAddress");if(!At||!r)throw new Error("Required information is missing. Please log in or connect your wallet.");const Hr=await fetch(ir,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:z?z.toLowerCase():Hn,token:At,follow_address:r,target_platform:Fe??"hyper",wallet_id:yn??null})});if(!Hr.ok)throw new Error(`Failed to unlike: ${Hr.status} ${Hr.statusText}`);const os=await Hr.json();if(os.success){ne(!1),c();const is=Array.isArray(os.data)?os.data.filter(gs=>{var $i;return(($i=gs==null?void 0:gs.wallet_address)==null?void 0:$i.toLowerCase())===(r==null?void 0:r.toLowerCase())}):[],ms=Array.isArray(is)?[...is].sort((gs,$i)=>new Date($i.created_at)-new Date(gs.created_at)):[];o(ms),ms.length>0?Vr(0):Vr(null),ps(Fe),is&&is.length===0&&ce(),rn.success(`${r.slice(0,5)+"..."+r.slice(-3)} Successfully removed from Copy Trade`,{style:{border:"1px solid #22c55e",padding:"16px",color:"#fff",borderRadius:"999px",background:"#14532d",height:"60px",width:"480px",minWidth:"480px"},iconTheme:{primary:"#22c55e",secondary:"#FFFAEE"}})}else console.error(os.error_message),rn.error(os.error_message),ne(!1)}catch(At){console.error("Error in unlike function:",At),rn.error(At.message||"Something went wrong!"),ne(!1)}},xs=async At=>{if(!e)return;const ir=At||Fe;try{ee(!0);const Hn=window.localStorage.getItem("hyperToken"),Hr=window.localStorage.getItem("hyperAddress"),os=ir==="hyper"?"https://dextrabothypev2.nftinit.io/api/wallet/confirmed-list":"https://dextrabothypev2.nftinit.io/api/wallet/list-lighter";if(!Hn)return;const ms=await(await fetch(os,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:z?z.toLowerCase():Hr,token:Hn})})).json();ms.success?(G(ms==null?void 0:ms.data),ee(!1)):(console.log(ms.error_message),ee(!1),fe(ms.error_message))}catch(Hn){console.error("Error generate wallet list:",Hn),ee(!1),fe(Hn.message)}},Xs=async()=>{try{const At=window.localStorage.getItem("hyperToken"),ir=window.localStorage.getItem("hyperAddress");if(!At)return;const[Hn,Hr]=await Promise.all([fetch("https://dextrabothypev2.nftinit.io/api/wallet/confirmed-list",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:z?z.toLowerCase():ir,token:At})}),fetch("https://dextrabothypev2.nftinit.io/api/wallet/list-lighter",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:z?z.toLowerCase():ir,token:At})})]),[os,is]=await Promise.all([Hn.json(),Hr.json()]);os.success&&Xe(os.data),is!=null&&is.success&&bt(is.data)}catch(At){console.error("Error fetching wallet lists:",At)}},ii=At=>At!=null&&At.assetPositions?At.assetPositions.filter(ir=>{if(!ir.position||!ir.position.szi)return!1;const Hn=parseFloat(ir.position.szi);return!isNaN(Hn)&&Hn!==0}).map(ir=>{const Hn=ir.position,Hr=parseFloat(Hn.szi),os=parseFloat(Hn.entryPx),is=parseFloat(Hn.positionValue),ms=parseFloat(Hn.unrealizedPnl),gs=parseFloat(Hn.returnOnEquity)*100,$i=parseFloat(Hn.marginUsed),Bs=Hn.leverage.value,bs=parseFloat(Hn.cumFunding.sinceOpen),Tr=Hr>0?"Long":"Short";return{asset:Hn.coin,type:Tr,size:Math.abs(Hr),entryPrice:os.toFixed(2),currentPrice:(is/Math.abs(Hr)).toFixed(2),leverage:Bs,positionValue:is.toFixed(2),marginUsed:$i.toFixed(2),unrealizedPnl:ms.toFixed(2),roe:gs.toFixed(2),funding:bs.toFixed(4),liquidationPrice:Hn.liquidationPx?parseFloat(Hn.liquidationPx).toFixed(2):"N/A"}}):[];m.useEffect(()=>{const At=async()=>{const Hr=await fs.post("https://api-ui.hyperliquid.xyz/info",{type:"clearinghouseState",user:r});if(Hr.data){jn(Hr.data);const os=ii(Hr.data);h(os)}},ir=async()=>{var os,is,ms;const Hr=await fs.post("https://api-ui.hyperliquid.xyz/info",{type:"portfolio",user:r});if(Hr.data){const gs=((is=(os=Hr.data.find(Bs=>Bs[0]==="perpMonth"))==null?void 0:os[1])==null?void 0:is.pnlHistory)||[],$i=((ms=gs[gs.length-1])==null?void 0:ms[1])??0;S($i)}},Hn=async()=>{var is;const os=await(await fetch(`https://dextradata.nftinit.io/api/hyper/get_wallets_profit_new/?period=30&order=-perp_pnl&offset=0&limit=50&user_token=${r}`)).json();k(((is=os==null?void 0:os.results[0])==null?void 0:is.win_complated_rate)||"-")};r&&(At(),ir(),Hn())},[r]),m.useEffect(()=>{if(!e)return;let At=!1;async function ir(){var Hn,Hr;try{In(!0);const is=await(await fetch("https://dextrabothypev2.nftinit.io/api/hyper/get_coins/")).json(),ms=()=>xi.random().hex(),gs={kBONK:"BONK",kPEPE:"PEPE",kSHIB:"SHIB",kFLOKI:"FLOKI",kNEIRO:"NEIRO",kDOGS:"DOGS",kLUNC:"LUNC"},$i=(Hr=(Hn=is.coins)==null?void 0:Hn.filter(Bs=>!Bs.startsWith("@")&&!Bs.endsWith("/USDC")))==null?void 0:Hr.map(Bs=>({value:Bs,label:Bs.endsWith("/USDC")?Bs+" (Spot)":Bs,color:ms(),icon:`https://app.hyperliquid.xyz/coins/${gs[Bs]||Bs.split("/")[0]}.svg`}));At||(Mt($i),In(!1))}catch(os){At||(console.error("Data retrieval error:",os),In(!1))}}return ir(),()=>{At=!0}},[e]),m.useEffect(()=>{e&&(xs(Fe),ps(Fe))},[Fe,e]),m.useEffect(()=>{e&&Xs()},[e]),m.useEffect(()=>{if(!e||!Gt||!es||!Array.isArray(xn)||xn.length===0)return;const At=xn.map(ms=>typeof ms=="string"?ms:ms.value).filter(Boolean),ir=new Map(At.map(ms=>[Es(ms),ms])),Hn=At.map(Es),Hr=new Set([...(es.include_coins||[]).map(Es),...(es.exclude_coins||[]).map(Es)]),os=Hn.filter(ms=>!Hr.has(ms));if(os.length===0)return;const is=os.map(ms=>ir.get(ms)||ms);es.future_listed_tokens?or(ms=>Array.from(new Set([...ms||[],...is]))):Qt(ms=>Array.from(new Set([...ms||[],...is])))},[e,Gt,xn,es]),m.useEffect(()=>{e||(t(!1),nn(null),cn(null),Ft(null),Bt(null),qe(null),ht(null),zt(null),nt(null),Rt(100),pe("method_two"),st(null),ie("All"),at(!0),Dt(!0),dn(!1),gn(!0),kn(!0),Vn(null),Dn(null),Cn(null),Me(null),an({inputValue:null,selectValue:"%"}),Yn({inputValue:null,selectValue:"%"}),or(null),Qt(null),he(!1),ye(!1),$e(!1),tt(!1),ft(!1),qt(!1),je(!1),Le(!1),de(!1),Xt(!1),Re(!1),Ce(!1),Ut(!1),On(!1),Tn(!1),jr(!1),G([]),o(null),Vr(null))},[e]),m.useEffect(()=>{const At=oe.find(ir=>(ir==null?void 0:ir.wallet_id)===(n==null?void 0:n.wallet_id));At&&Vn(At==null?void 0:At.wallet_id)},[oe,n]),m.useEffect(()=>{Fe==="lighter"?(Ue!==""&&Number(Ue)>100?Le(!0):Le(!1),On(!kt)):(Le(!1),On(!1))},[Ue,Fe]);const Pr=At=>{Vn(At??null),he(!1),Re(!1)},vn=At=>{st(At),Ce(!1),kn(!1),At==="lighter"&&(re=="method_twothousand"||re=="method_one")&&pe("method_two"),Vn(null)},Mn=()=>{xs(Fe)};m.useEffect(()=>{const At=ir=>{Ge.current&&!Ge.current.contains(ir.target)&&Re(!1),Be.current&&!Be.current.contains(ir.target)&&Ce(!1)};return document.addEventListener("mousedown",At),()=>{document.removeEventListener("mousedown",At)}},[]);const ot=[Ne,ge,Qe,it,lt,ut,ve,fn,yt].filter(Boolean).length;m.useEffect(()=>{e&&a&&!q&&(u!=null&&u.some(At=>(At==null?void 0:At.wallet_address)===r)||B(!0),te(!0)),e||te(!1)},[e,a]),m.useEffect(()=>{e&&a&&!Je&&Fe!==null&&!T&&(u!=null&&u.some(At=>(At==null?void 0:At.wallet_address)===r)||Fe==="lighter"&&_e(!0),ct(!0)),e||ct(!1)},[e,a,Fe,T]);const Vt=()=>{_e(!1),B(!1),t(!1)},er=[{id:1,label:"Hyperliquid",value:"hyper"},{id:2,label:"Lighter",value:"lighter"}];return i.jsxs(i.Fragment,{children:[i.jsx(BLt,{open:zn,setOpen:Jn,copyTradeSave:mr}),i.jsx(qBt,{open:T,setOpen:B,setCopyTradeModal:t,onClose:Vt,setIsUnderstand:de}),i.jsx(f5,{open:xe,setOpen:Se,handleListRequest:xs,handlePageChange:()=>{}}),i.jsx(GBt,{open:De,setOpen:_e,setCopyTradeModal:t,onClose:Vt,setIsLighterUnderstand:Xt}),ls&&Na.createPortal(i.jsx(Ele,{open:ls,setOpen:et,oldSlotCount:Jr,checkAccountTrade:ps,tradeMarket:"copyTrade"}),document.body),i.jsxs(Ea,{open:e,onClose:Vt,className:"relative z-50",children:[i.jsx(ja,{transition:!0,style:{backgroundColor:"rgba(0, 0, 0, 0.48)"},className:"fixed inset-0 transition-opacity data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in"}),i.jsx("div",{className:"fixed inset-0 z-50 w-screen overflow-y-auto",children:i.jsx("div",{className:"flex min-h-full items-end justify-center p-4 text-center sm:items-center sm:p-0",children:i.jsx(xa,{transition:!0,className:"relative transform overflow-hidden bg-[#1B1B1B] text-left shadow-xl transition-all data-[closed]:translate-y-4 data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in data-[closed]:sm:translate-y-0 data-[closed]:sm:scale-95 rounded-3xl w-full lg:w-[70%]",children:i.jsx("div",{className:`${a&&!ue&&T&&!(u!=null&&u.some(At=>(At==null?void 0:At.wallet_address)===r))?"blur-3xl":""} flex flex-col justify-start items-center gap-8 w-full h-max relative bg-[#1B1B1B] rounded-3xl py-2 text-white font-manrope px-2`,children:i.jsx(i.Fragment,{children:V?i.jsx("div",{role:"status",className:"flex justify-center items-center w-full my-[30px]",children:i.jsx(Da,{})}):g||d>0||f>0?(oe==null?void 0:oe.length)>0||(wt==null?void 0:wt.length)>0||(Oe==null?void 0:Oe.length)>0?i.jsxs("div",{className:"flex flex-col lg:flex-row w-full",children:[i.jsxs("div",{className:"w-full lg:w-2/5 min-h-full bg-[#242424] rounded-2xl",children:[i.jsx("div",{className:"absolute right-5 top-5 z-50 bg-black/70 backdrop-blur-md rounded-full w-6 h-6 flex lg:hidden justify-center items-center font-bold font-manrope text-xs",onClick:()=>t(!1),children:i.jsx(HIe,{})}),i.jsx("div",{style:{backgroundImage:`url(${ryt})`,backgroundSize:"cover",backgroundPosition:"center"},className:"h-24 p-4 rounded-t-xl relative",children:i.jsx("div",{className:"absolute top-16 w-[64px] h-[64px] rounded-full bg-[#53BAA1] border-4 border-[#242424] flex items-center justify-center",children:i.jsx(iDe,{wallet:r,className:"w-full h-full rounded-full object-cover"})})}),i.jsxs("div",{className:"p-4 mt-6 ml-1",children:[i.jsxs("div",{className:"flex items-center gap-1",children:[i.jsx("a",{className:"text-white font-manrope text-[16px] font-semibold leading-[13px] tracking-[0.32px] cursor-pointer hover:text-white",href:`/wallet-details/${r}`,target:"_blank",rel:"noreferrer",children:r?r.slice(0,6)+"..."+r.slice(-4):"-"}),i.jsx("span",{children:i.jsx("img",{onClick:At=>{At.stopPropagation(),navigator.clipboard.writeText(r),rn.success("Successfully copied.",{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(103, 255, 189, 0.16)",width:"280px",minWidth:"280px",height:"40px",backdropFilter:"blur(16px)"},iconTheme:{primary:"#67FFBD",secondary:"#276047"}})},src:wo,alt:"",className:"cursor-pointer"})}),i.jsx("span",{className:"ml-auto cursor-pointer",children:i.jsx(v5,{walletAddress:r,children:i.jsx("div",{className:"w-[18px] h-[18px] justify-center items-center flex cursor-pointer",children:x.some(At=>At.wallet_address===r)?i.jsx("img",{src:o5,alt:"",className:"w-3.5 h-3.5 min-w-3.5 min-h-3.5"}):i.jsx("img",{src:NA,alt:"",className:"w-3.5 h-3.5 min-w-3.5 min-h-3.5"})})})})]}),i.jsxs("div",{className:"w-full mt-0.5",children:[i.jsxs("div",{className:"w-full border-b border-[#353535] flex relative",children:[i.jsxs("div",{className:"w-1/2 relative py-3 after:content-[''] after:absolute after:top-1/2 after:-translate-y-1/2 after:right-0 after:h-2/4 after:w-[1px] after:bg-[#353535]",children:[i.jsx("div",{className:"text-[#9B9B9B] font-manrope text-[10px] font-semibold leading-[13px] tracking-[0.8px] mb-[8px]",children:"PERP EQUITY"}),i.jsxs("div",{className:"text-[#67FFBD] font-manrope text-[16px] font-semibold leading-[13px] tracking-[0.32px]",children:["$",Lt?Er(Lt==null?void 0:Lt.marginSummary.accountValue):"-"]})]}),i.jsxs("div",{className:"w-1/2 flex flex-col justify-center items-end py-3",children:[i.jsx("div",{className:"text-[#9B9B9B] font-manrope text-[10px] font-semibold leading-[13px] tracking-[0.8px] mb-[8px]",children:"uPnL"}),i.jsxs("div",{className:`${Lt&&Ee&&Ee.reduce((At,ir)=>At+parseFloat(ir.unrealizedPnl),0)>=0?"text-[#67FFBD]":"text-[#FF7173]"} font-manrope text-[16px] font-semibold leading-[13px] tracking-[0.32px]`,children:["$",Lt&&Ee?Er(Math.abs(Ee.reduce((At,ir)=>At+parseFloat(ir.unrealizedPnl||0),0))):"-"]})]})]}),i.jsxs("div",{className:"w-full border-b border-[#353535] flex relative",children:[i.jsxs("div",{className:"w-1/2 relative py-3 after:content-[''] after:absolute after:top-1/2 after:-translate-y-1/2 after:right-0 after:h-2/4 after:w-[1px] after:bg-[#353535]",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("div",{className:"text-[#9B9B9B] font-manrope text-[10px] font-semibold leading-[13px] tracking-[0.8px] mb-[8px]",children:"WIN RATE"}),i.jsx("div",{className:"text-[#67FFBD] bg-[rgba(103,255,189,0.16)] h-[18px] px-1.5 py-[5px] rounded-md justify-start items-center gap-2 inline-flex cursor-pointer relative -top-1",children:i.jsx("div",{className:"text-[11px] font-semibold font-manrope leading-[8px]",children:"30D"})})]}),i.jsxs("div",{className:"text-white font-manrope text-[16px] font-semibold leading-[13px] tracking-[0.32px]",children:[_,"%"]})]}),i.jsxs("div",{className:"w-1/2 flex flex-col justify-center items-end py-3",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("div",{className:"text-[#9B9B9B] font-manrope text-[10px] font-semibold leading-[13px] tracking-[0.8px] mb-[8px]",children:"PnL"}),i.jsx("div",{className:"text-[#67FFBD] bg-[rgba(103,255,189,0.16)] h-[18px] px-1.5 py-[5px] rounded-md justify-start items-center gap-2 inline-flex cursor-pointer relative -top-1",children:i.jsx("div",{className:"text-[11px] font-semibold font-manrope leading-[8px]",children:"30D"})})]}),i.jsxs("div",{className:`${p&&p>=0?"text-[#67FFBD]":"text-[#FF7173]"} font-manrope text-[16px] font-semibold leading-[13px] tracking-[0.32px]`,children:["$",p?Er(Math.abs(p)):"-"]})]})]}),i.jsxs("div",{className:"mt-3",children:[i.jsx("div",{className:"text-[#9B9B9B] font-manrope text-[10px] font-semibold leading-[13px] tracking-[0.8px]",children:"OPEN POSITIONS"}),i.jsx($Lt,{positions:Ee})]}),i.jsx("div",{className:"w-full h-px bg-[#353535] mb-1"}),i.jsx("div",{className:"mt-2",children:i.jsx(YBt,{normalizedCopyTradeList:gr,selectedWmIndex:Br,setSelectedWmIndex:Vr,getSettingList:ce,setIsNewSetting:jr})})]})]})]}),i.jsxs("div",{className:"flex w-full lg:w-3/5 flex-col justify-start items-center gap-2 p-4 rounded-2xl bg-[#242424] ml-0 lg:ml-4 mt-4 lg:mt-0 relative",children:[i.jsx("div",{role:"status",className:`${J||Q?"block":"hidden"} flex justify-center items-center w-full h-full absolute bg-[#101010]/80 z-50 -mt-[64px] rounded-3xl`,children:i.jsx(Da,{})}),i.jsxs("div",{className:"flex-col justify-between items-center gap-4 w-full border-b border-[#353535] pb-3",children:[ot>0&&i.jsxs("div",{className:"absolute right-4 flex sm:hidden rounded-[8px] bg-[rgba(255,121,124,0.16)] backdrop-blur-[16px] w-12 h-10 justify-center items-center text-[#FF797C] font-manrope text-[12px] font-semibold leading-[12px] tracking-[0.22px] gap-2",children:[i.jsx("img",{src:ec,alt:"Dextrabot"}),ot]}),i.jsxs("div",{className:"flex flex-col items-baseline justify-start sm:flex-row sm:justify-between sm:items-start lg:flex-col lg:items-baseline lg:justify-start xl:flex-row xl:items-start xl:justify-between gap-3 sm:gap-1 lg:gap-3 xl:gap-1 space-y-3",children:[i.jsxs("div",{className:"flex flex-col items-start justify-start space-y-2",children:[i.jsxs("span",{className:"text-[#7C7C7C] font-manrope text-[13px] font-semibold leading-[8px] min-w-max max-h-[12px] flex items-center gap-1",children:[i.jsxs("div",{className:"flex items-center gap-1",children:["Select target platform",i.jsxs("div",{className:"flex items-center has-tooltip relative",children:[i.jsx(Ni,{className:"text-[#7C7C7C] w-3.5 min-w-3.5 min-h-3.5 h-3.5"}),i.jsx("span",{children:i.jsx(ro,{content:i.jsxs("div",{className:"text-[9px] flex flex-col gap-1 text-white",children:[i.jsx("span",{className:"uppercase",children:"Hyperliquid"}),i.jsxs("ul",{className:"list-disc pl-4",children:[i.jsx("li",{children:"Method II"}),i.jsx("li",{children:"Method III"})]}),i.jsx("span",{className:"text-[#fff] uppercase mt-2",children:"Lighter"}),i.jsx("ul",{className:"list-disc pl-4",children:i.jsx("li",{children:"Method III"})})]}),positionTop:!1,alignRight:!0,tooltipCss:"max-w-[100px] min-w-[100px] mt-10 leading-[16px]"})})]})]}),i.jsx(v0,{})]}),i.jsxs("div",{ref:Be,className:"relative w-full max-w-[250px]",children:[i.jsxs("div",{className:`${Gt&&!dr?"cursor-not-allowed":"cursor-pointer"} rounded-md bg-[#353535] text-white px-2 h-8 flex items-center justify-between`,onClick:At=>{At.preventDefault(),(!Gt&&dr||Gt&&dr||!Gt&&!dr)&&Ce(!se)},children:[i.jsxs("span",{className:"text-white font-inter text-[14px] font-medium leading-[8px] tracking-[-0.28px] flex items-center gap-2",children:[Fe==="hyper"?i.jsx("img",{src:"https://app.hyperliquid.xyz/coins/HYPE.svg",className:"w-4 h-4"}):i.jsx(Mg,{className:"w-4 h-4 text-white"}),Fe==="hyper"?"Hyperliquid":"Lighter"]}),i.jsx("svg",{className:`w-4 h-4 ml-2 transform transition ${se?"rotate-180":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),se&&i.jsx("div",{className:"absolute z-10 mt-1 w-full bg-[#353535] rounded-md shadow-lg overflow-hidden p-1",children:i.jsx("div",{className:"flex flex-col gap-[2px] max-h-[170px] overflow-y-auto",children:er==null?void 0:er.map(At=>i.jsxs("div",{onClick:ir=>{ir.preventDefault(),(!Gt&&dr||Gt&&dr||!Gt&&!dr)&&(vn(At.value),At.value==="lighter"&&!gt&&a&&_e(!0))},className:`py-2 px-2 h-8 min-h-8 flex justify-between items-center rounded-md font-inter text-[14px] font-medium leading-[8px] tracking-[-0.28px] ${At.value===Fe?"bg-[#2c2c2c]":"hover:bg-[#2c2c2c]"} text-white ${Gt&&!dr?"cursor-not-allowed":"cursor-pointer"}`,children:[i.jsxs("span",{className:"text-white flex items-center gap-2",children:[At.label==="Hyperliquid"?i.jsx("img",{src:"https://app.hyperliquid.xyz/coins/HYPE.svg",className:"w-4 h-4"}):i.jsx(Mg,{className:"w-4 h-4 text-white"}),At.label]}),At.value===Fe&&i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 text-[#1de674]",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})})]},At.id))})})]})]}),i.jsxs("div",{className:"flex justify-start items-center gap-2",children:[i.jsx("div",{onClick:()=>{Mn()},className:"hidden sm:flex lg:hidden xl:flex justify-center items-center cursor-pointer",children:i.jsx(wbe,{className:"w-4 h-4 text-[#929292] hover:text-white"})}),i.jsxs("div",{className:"flex flex-col items-start justify-start space-y-2",children:[i.jsx("span",{className:"text-[#7C7C7C] font-manrope text-[13px] font-semibold leading-[8px] -mt-2",children:"Select your wallet"}),i.jsxs("div",{ref:Ge,className:"relative w-full min-w-[240px] max-w-[260px]",children:[i.jsxs("div",{className:"rounded-md bg-[#353535] text-white px-2 h-8 flex items-center justify-between cursor-pointer min-w-max sm:min-w-[260px]",onClick:()=>Re(!ke),children:[i.jsx("span",{className:"text-white font-inter text-[14px] font-medium leading-[8px] tracking-[-0.28px]",children:yn?((Wn=oe==null?void 0:oe.find(At=>(At==null?void 0:At.wallet_id)===yn))==null?void 0:Wn.wallet_name)==="Dextrabot"&&((Fr=oe==null?void 0:oe.find(At=>(At==null?void 0:At.wallet_id)===yn))==null?void 0:Fr.version)===3?((kr=oe==null?void 0:oe.find(At=>(At==null?void 0:At.wallet_id)===yn))==null?void 0:kr.wallet_name)+" (API-AGENT) Wallet":(ts=oe==null?void 0:oe.find(At=>(At==null?void 0:At.wallet_id)===yn))==null?void 0:ts.wallet_name:"Select"}),i.jsx("svg",{className:`w-4 h-4 ml-2 transform transition ${ke?"rotate-180":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),ke&&i.jsxs("div",{className:"absolute z-10 mt-1 w-full bg-[#353535] rounded-md shadow-lg overflow-hidden px-2.5 py-1.5",children:[i.jsxs("div",{onClick:()=>{const At=Fe==="hyper"?"hyperliquid":"lighter";window.open(`/wallet-management#${At}#add-account#${At}`,"_blank"),Re(!1)},className:"px-3 py-2 text-[#1de674] font-semibold text-sm cursor-pointer flex justify-start items-center gap-1.5 border border-[#8860ff] rounded-md my-1 bg-[#7445ff]",children:[i.jsx("div",{"data-svg-wrapper":!0,children:i.jsxs("svg",{width:"19",height:"18",viewBox:"0 0 19 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("path",{d:"M5 9H14",stroke:"white",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),i.jsx("path",{d:"M9.5 13.5V4.5",stroke:"white",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})}),i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px]",children:"Add Account"})]}),i.jsx("div",{className:"flex flex-col gap-[2px] max-h-[170px] overflow-y-auto",children:oe&&((Ms=[...oe].sort((At,ir)=>{var os,is;const Hn=(os=At==null?void 0:At.wallet_name)==null?void 0:os.includes("Dextrabot"),Hr=(is=ir==null?void 0:ir.wallet_name)==null?void 0:is.includes("Dextrabot");return Hn&&!Hr?-1:!Hn&&Hr?1:0}))==null?void 0:Ms.map((At,ir)=>i.jsxs("div",{onClick:Hn=>{Hn.preventDefault(),(!Gt&&dr||Gt&&dr||!Gt&&!dr)&&Pr(At==null?void 0:At.wallet_id)},className:`py-2 px-2 h-8 min-h-8 flex justify-between items-center rounded-md font-inter text-[14px] font-medium leading-[8px] tracking-[-0.28px] ${Gt&&!dr?"cursor-not-allowed":"cursor-pointer"} ${(At==null?void 0:At.wallet_id)===yn?"bg-[#2c2c2c]":"hover:bg-[#2c2c2c]"} text-white`,children:[i.jsx("span",{className:"text-white",children:(At==null?void 0:At.wallet_name)==="Dextrabot"&&(At==null?void 0:At.version)===3?(At==null?void 0:At.wallet_name)+" (API-AGENT) Wallet":At==null?void 0:At.wallet_name}),(At==null?void 0:At.wallet_id)===yn&&i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 text-[#1de674]",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})})]},(At==null?void 0:At.wallet_id)??ir)))})]}),Ne&&i.jsx("div",{className:"absolute top-8 left-0 px-3 py-1 bg-[#3b2626] rounded-md h-7",children:i.jsx("div",{className:"text-[#ff787b] text-xs font-semibold font-manrope",children:"You need to choose a wallet"})})]})]}),i.jsx("div",{onClick:()=>{Mn()},className:"flex sm:hidden lg:flex xl:hidden justify-center items-center cursor-pointer",children:i.jsx(wbe,{className:"w-4 h-4 text-[#929292] hover:text-white"})})]})]})]}),i.jsxs("div",{className:"flex flex-row items-center justify-between rounded-md w-full",children:[i.jsxs("div",{className:"flex flex-col items-start justify-between rounded-md",children:[i.jsxs("div",{className:"flex items-center space-x-3",children:[i.jsx("div",{className:"w-8 lg:w-12 h-8 lg:h-12 flex items-center justify-center rounded-full bg-[rgba(255,217,121,0.16)]",children:i.jsx("span",{className:"text-[#F2C94C] text-xl",children:i.jsx("img",{src:syt,alt:"Dextrabot",className:"w-[18px] h-[18px]"})})}),i.jsxs("div",{className:"space-y-1",children:[i.jsx("span",{className:"text-white font-manrope text-[14px] font-semibold leading-[8px]",children:"Trade Settings"}),i.jsx("div",{className:"text-[#979797] font-manrope text-[12px] font-normal leading-[8px] tracking-[0.24px]",children:"Make your settings for this Trader"})]})]}),i.jsx("div",{className:`${fn||Fe==="hyper"?"hidden":""} flex justify-center items-center space-x-4 mt-1 ml-10 lg:ml-[60px]`,children:i.jsxs("a",{href:"https://docs.dextrabot.com/copy-trade/methodology",target:"_blank",rel:"noopener noreferrer",className:"flex items-center bg-[#4A4A4A] rounded-lg text-[#CECECE] font-manrope text-[11px] font-semibold leading-[8px] px-3 py-2 hover:text-white",children:[i.jsx("img",{src:qme,alt:"Dextrabot",className:"w-4 h-4 mr-2"}),"Methodology"]})})]}),fn||Fe==="hyper"?i.jsx("div",{className:"flex justify-center items-center space-x-4 mt-2 ml-10 lg:ml-[60px]",children:i.jsxs("a",{href:"https://docs.dextrabot.com/copy-trade/methodology",target:"_blank",rel:"noopener noreferrer",className:"flex items-center bg-[#4A4A4A] rounded-lg text-[#CECECE] font-manrope text-[11px] font-semibold leading-[8px] px-3 py-2 hover:text-white",children:[i.jsx("img",{src:qme,alt:"Dextrabot",className:"w-4 h-4 mr-2"}),"Methodology"]})}):Fe==="lighter"&&i.jsxs("div",{className:"flex flex-col items-start justify-center gap-2",children:[i.jsxs("div",{className:"flex items-center justify-between text-[13px] text-[#7C7C7C] font-semibold w-full",children:[i.jsx("span",{className:"pl-[2px]",children:"Slot"}),i.jsxs("div",{className:"flex items-center gap-1",children:[i.jsx(s5,{className:"w-3 h-3 text-[#67FFBD] fill-[#67FFBD]"}),i.jsxs("span",{className:"text-[#67FFBD] font-medium",children:[_r||0,"/",rr+_r||0]})]})]}),i.jsx("div",{onClick:()=>{ws(Pn),et(!0)},className:"flex items-center justify-center h-8 px-2 sm:px-6 rounded-[10px] text-[11px] sm:text-[13px] border bg-[#7446FF] border-[#8861FF] hover:bg-[#5834C3] cursor-pointer min-w-max font-semibold",children:"Get more slots"})]})]}),i.jsx("div",{className:`${fn?"mt-2":""} flex flex-col justify-start items-start w-full`,children:i.jsxs("div",{className:"flex justify-stretch w-full gap-[5px] xl:gap-[14px] pt-[2px] border-b border-[#353535]",children:[i.jsxs("div",{onClick:()=>{(re!=="method_two"&&re!=="method_twothousand"&&Fe==="hyper"||(re=="method_two"||re=="method_twothousand")&&(!Gt||Gt&&dr)&&Fe==="hyper")&&pe("method_one")},className:`relative ${re==="method_one"?"bg-[rgba(103,255,189,0.16)] text-[#67FFBD]":"text-[#7C7C7C]"} flex-1 h-[37px] px-2 py-1.5 justify-center items-center gap-2 inline-flex text-[14px] font-medium leading-[8px] tracking-[-0.28px] rounded-tl-lg rounded-tr-lg ${(re==="method_two"||re==="method_twothousand")&&Gt&&!dr||Fe!=="hyper"?"cursor-not-allowed":"cursor-pointer"} min-w-max`,children:[i.jsxs("span",{className:"relative",children:["Method I"," ",i.jsx("div",{className:"text-[#ff787b] bg-[#ff797c]/20 text-[9px] font-semibold font-manrope leading-[8px] rounded-md p-1 absolute -top-4 left-[45px] lg:hidden animate-bounce",children:"LEGACY"})]}),i.jsx("div",{className:"text-[#ff787b] bg-[#ff797c]/20 text-[11px] font-semibold font-manrope leading-[8px] rounded-md p-2 hidden lg:flex",children:"LEGACY"}),re==="method_one"&&i.jsx("div",{className:"absolute bottom-0 left-0 w-full h-[1px] bg-[#67FFBD]"})]}),i.jsxs("div",{onClick:()=>{(re!=="method_one"&&re!=="method_two"&&Fe==="hyper"||(re=="method_one"||re=="method_two")&&(!Gt||Gt&&dr)&&Fe==="hyper")&&pe("method_twothousand")},className:`relative ${re==="method_twothousand"?"bg-[rgba(103,255,189,0.16)] text-[#67FFBD]":"text-[#7C7C7C]"} flex-1 h-[37px] px-2 py-1.5 justify-center items-center gap-2 inline-flex text-[14px] font-medium leading-[8px] tracking-[-0.28px] ${(re==="method_one"||re==="method_two")&&Gt&&!dr||Fe!=="hyper"?"cursor-not-allowed":"cursor-pointer"} rounded-tl-lg rounded-tr-lg min-w-max`,children:["Method II",re==="method_twothousand"&&i.jsx("div",{className:"absolute bottom-0 left-0 w-full h-[1px] bg-[#67FFBD]"})]}),i.jsxs("div",{onClick:()=>{(re!=="method_one"&&re!=="method_twothousand"||(re=="method_one"||re=="method_twothousand")&&(!Gt||Gt&&dr))&&pe("method_two")},className:`relative ${re==="method_two"?"bg-[rgba(103,255,189,0.16)] text-[#67FFBD]":"text-[#7C7C7C]"} flex-1 h-[37px] px-2 py-1.5 justify-center items-center gap-x-2 inline-flex text-[14px] font-medium leading-[8px] tracking-[-0.28px] rounded-tl-lg rounded-tr-lg ${(re==="method_one"||re==="method_twothousand")&&Gt&&!dr?"cursor-not-allowed":"cursor-pointer"}`,children:[i.jsxs("div",{className:"flex justify-center flex-grow whitespace-nowrap text-center gap-2",children:["Method III"," ",i.jsx("span",{className:"hidden lg:block",children:"(Mirror)"})]}),i.jsx("div",{className:"bg-[rgba(103,255,189,0.16)] text-[#67FFBD] text-[11px] font-semibold font-manrope leading-[8px] rounded-md p-2 hidden lg:flex",children:"Preferred"}),re==="method_two"&&i.jsx("div",{className:"absolute bottom-0 left-0 w-full h-[1px] bg-[#67FFBD]"})]})]})}),re==="method_one"&&i.jsxs("div",{className:"w-full space-y-4 mt-4",children:[i.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[i.jsxs("div",{className:"flex flex-col justify-start",children:[i.jsx("p",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px] hidden lg:block",children:"Use % of Trader margin per position"}),i.jsx("p",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px] block lg:hidden",children:"Use % of Trader Margin"}),i.jsx("div",{className:"flex mt-2 relative",children:i.jsxs("div",{className:"relative w-full",children:[i.jsx("span",{className:"absolute left-1 top-1/2 -translate-y-1/2 text-[#7F7F7F] font-semibold mr-2",children:"%"}),i.jsx("input",{value:It||"",onChange:vt,type:"text",name:"marginUsedRate",onKeyDown:Ir,autoComplete:"off",min:"0",placeholder:"Used Rate",className:`shadow-sm py-0.5 bg-[#303030] block text-xs sm:text-sm font-semibold font-manrope
leading-none rounded-md w-full h-8 pl-6 pr-2
${It?"border border-[#C5C5C5]":""}
outline-[#404040] placeholder:text-[#7F7F7F]`})]})})]}),i.jsxs("div",{className:"flex flex-col justify-start relative",children:[i.jsx("p",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px]",children:"Initial Margin Cap"}),i.jsxs("div",{className:"flex mt-2 relative",children:[i.jsx("span",{className:"absolute left-1 top-1/2 -translate-y-1/2 text-[#7F7F7F] font-semibold mr-2",children:"$"}),i.jsx("input",{value:Ye||"",onChange:ur,type:"text",name:"marginUsedAmount",onKeyDown:Ir,autoComplete:"off",min:"0",placeholder:"Amount",className:`shadow-sm py-0.5 bg-[#303030] block text-xs sm:text-sm font-semibold font-manrope
leading-none rounded-md w-full h-8 pl-6 pr-7
${ge?"border border-[#FF797C]":Ye?"border border-[#C5C5C5]":""}
outline-[#404040] placeholder:text-[#7F7F7F]`})]})]})]}),i.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[i.jsxs("div",{className:"flex flex-col items-start justify-start",children:[i.jsx("p",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px]",children:"Margin Increase Limit"}),i.jsxs("div",{className:"flex mt-2 relative w-full",children:[i.jsx("span",{className:"absolute left-1 top-1/2 -translate-y-1/2 text-[#7F7F7F] font-semibold mr-2",children:"$"}),i.jsx("input",{value:Zt||"",onChange:Yr,type:"text",name:"marginIncreaseLimit",onKeyDown:Ir,autoComplete:"off",min:"0",placeholder:"Increase Limit",className:`shadow-sm py-0.5 bg-[#303030] block text-xs sm:text-sm font-semibold font-manrope
leading-none rounded-md w-full h-8 pl-6 pr-7
${Zt?"border border-[#C5C5C5]":""}
outline-[#404040] placeholder:text-[#7F7F7F]`})]})]}),i.jsxs("div",{className:"flex flex-col justify-start gap-2",children:[i.jsx("span",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px] hidden lg:block",children:"Copy Increase as Open Position"}),i.jsx("span",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px] block lg:hidden",children:"Copy Inc. as Open Pos."}),i.jsxs("span",{className:"flex justify-between w-full items-center gap-2 bg-[#353535] p-1 rounded-md px-2 h-8",children:[i.jsx("span",{className:"text-white font-inter text-[13px] font-medium leading-[8px] tracking-[-0.26px]",children:mt?"On":"Off"}),i.jsx(Eo,{checked:mt,onChange:Dt,className:`${mt?"bg-[#1DE674]":"bg-white/10"} group relative flex h-5 w-9 cursor-pointer rounded-full p-1
transition-colors duration-200 ease-in-out focus:outline-none`,children:i.jsx("span",{"aria-hidden":"true",className:`pointer-events-none inline-block size-4 -mt-[3px] translate-x-0
rounded-full bg-white ring-0 shadow-lg transition duration-200 ease-in-out
group-data-[checked]:translate-x-3`})})]})]})]}),i.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[i.jsxs("div",{className:"flex flex-col justify-start my-1 sm:my-1.5",children:[i.jsx("p",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px]",children:"Stop Loss"}),i.jsxs("div",{className:"flex mt-2 relative",children:[i.jsx("span",{className:"absolute left-1 top-1/2 -translate-y-1/2 text-[#7F7F7F] font-semibold mr-2",children:"%"}),i.jsx("input",{type:"text",value:en.inputValue||"",onChange:rt,onKeyDown:Ir,autoComplete:"off",min:"0",placeholder:"Stop Loss",className:`shadow-sm py-0.5 bg-[#303030] block text-xs sm:text-sm font-semibold font-manrope
leading-none rounded-md w-full h-8 pl-6 pr-14
${en.inputValue?"border border-[#C5C5C5]":""}
outline-[#404040] placeholder:text-[#7F7F7F]`})]})]}),i.jsxs("div",{className:"flex flex-col justify-start my-1 sm:my-1.5",children:[i.jsx("p",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px]",children:"Take Profit"}),i.jsxs("div",{className:"flex mt-2 relative",children:[i.jsx("span",{className:"absolute left-1 top-1/2 -translate-y-1/2 text-[#7F7F7F] font-semibold mr-2",children:"%"}),i.jsx("input",{type:"text",value:Nt.inputValue||"",onChange:Pt,onKeyDown:Ir,autoComplete:"off",min:"0",placeholder:"Take Profit",className:`shadow-sm py-0.5 bg-[#303030] block text-xs sm:text-sm font-semibold font-manrope
leading-none rounded-md w-full h-8 pl-6 pr-14
${Nt.inputValue?"border border-[#C5C5C5]":""}
outline-[#404040] placeholder:text-[#7F7F7F]`})]})]})]}),i.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[i.jsxs("div",{className:"flex flex-col justify-start gap-2",children:[i.jsx("span",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px]",children:"Include TWAP Orders"}),i.jsxs("span",{className:"flex justify-between w-full items-center gap-2 bg-[#353535] p-1 rounded-md px-2 h-8",children:[i.jsx("span",{className:"text-white font-inter text-[13px] font-medium leading-[8px] tracking-[-0.26px]",children:Tt?"On":"Off"}),i.jsx(Eo,{checked:Tt,onChange:dn,className:`${Tt?"bg-[#1DE674]":"bg-white/10"} group relative flex h-5 w-9 cursor-pointer rounded-full p-1
transition-colors duration-200 ease-in-out focus:outline-none`,children:i.jsx("span",{"aria-hidden":"true",className:`pointer-events-none inline-block size-4 -mt-[3px] translate-x-0
rounded-full bg-white ring-0 shadow-lg transition duration-200 ease-in-out
group-data-[checked]:translate-x-3`})})]})]}),i.jsxs("div",{className:"flex flex-col justify-start gap-2",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px]",children:"Direction Filter"}),i.jsxs("div",{className:"hidden items-center has-tooltip relative",children:[i.jsx(Ni,{className:"text-[#7C7C7C] w-4 min-w-4 min-h-4 h-4 relative"}),i.jsx("span",{children:i.jsx(ro,{content:"When enabled, automatically copy trades for new tokens when they get listed on the exchange.",positionTop:!1,alignRight:!0,tooltipCss:"max-w-[120px] min-w-[120px] leading-[16px] mt-8"})})]})]}),i.jsxs("div",{className:"flex justify-start items-center gap-1.5 w-max h-max rounded-lg border border-[#333333] p-1",children:[i.jsx(Gx,{title:"All",set_click:()=>ie("All"),isPositionType:Y}),i.jsx(Gx,{title:"LONG",set_click:()=>ie("LONG"),isPositionType:Y}),i.jsx(Gx,{title:"SHORT",set_click:()=>ie("SHORT"),isPositionType:Y})]})]})]}),i.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[i.jsxs("div",{className:"flex flex-col items-start justify-start gap-1",children:[i.jsxs("div",{className:"flex items-center gap-2 -mt-1",children:[i.jsx("span",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px]",children:"Copy Current"}),i.jsxs("div",{className:"flex items-center has-tooltip relative",children:[i.jsx(Ni,{className:"text-[#7C7C7C] w-4 min-w-4 min-h-4 h-4"}),i.jsx("span",{children:i.jsx(ro,{content:Gt?"This option can only be set when starting copy trading. It cannot be changed later.":"If enabled, your wallet will immediately copy all currently open positions from the Source Wallet.",positionTop:!1,alignRight:!0,tooltipCss:"max-w-[300px] min-w-[120px] mt-8 leading-[16px]"})})]})]}),i.jsxs("div",{className:"flex justify-between w-full items-center gap-2 bg-[#353535] p-1 rounded-md px-2 h-8",children:[i.jsx("span",{className:"text-white font-inter text-[13px] font-medium leading-[8px] tracking-[-0.26px]",children:Nn?"On":"Off"}),i.jsx(Eo,{checked:Nn,onChange:At=>{(!Gt||Gt&&dr)&&We&&kn(At)},className:`${Nn?"bg-[#1DE674]":"bg-white/10"} group relative flex h-5 w-9
${Gt&&!dr||!We?"cursor-not-allowed opacity-50":"cursor-pointer"}
rounded-full p-1 transition-colors duration-200 ease-in-out focus:outline-none`,children:i.jsx("span",{"aria-hidden":"true",className:`pointer-events-none inline-block size-4 -mt-[3px] translate-x-0
rounded-full bg-white ring-0 shadow-lg transition duration-200 ease-in-out
${Nn?"translate-x-3":""}`})})]})]}),i.jsxs("div",{className:"flex flex-col justify-start gap-1",children:[i.jsxs("div",{className:"flex items-center gap-2 -mt-1",children:[i.jsx("span",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px]",children:"Future Listed Tokens"}),i.jsxs("div",{className:"flex items-center has-tooltip relative",children:[i.jsx(Ni,{className:"text-[#7C7C7C] w-4 min-w-4 min-h-4 h-4 relative"}),i.jsx("span",{children:i.jsx(ro,{content:"When enabled, automatically copy trades for new tokens when they get listed on the exchange.",positionTop:!1,alignRight:!0,tooltipCss:"max-w-[120px] min-w-[120px] leading-[16px] mt-8"})})]})]}),i.jsxs("span",{className:"flex justify-between w-full items-center gap-2 bg-[#353535] p-1 rounded-md px-2 h-8",children:[i.jsx("span",{className:"text-white font-inter text-[13px] font-medium leading-[8px] tracking-[-0.26px]",children:on?"On":"Off"}),i.jsx(Eo,{checked:on,onChange:gn,className:`${on?"bg-[#1DE674]":"bg-white/10"} group relative flex h-5 w-9 cursor-pointer rounded-full p-1
transition-colors duration-200 ease-in-out focus:outline-none`,children:i.jsx("span",{"aria-hidden":"true",className:`pointer-events-none inline-block size-4 -mt-[3px] translate-x-0
rounded-full bg-white ring-0 shadow-lg transition duration-200 ease-in-out
group-data-[checked]:translate-x-3`})})]})]})]}),i.jsx("div",{className:"grid grid-cols-1 gap-4",children:i.jsx("div",{className:"flex flex-col items-start justify-start",children:i.jsx("div",{className:"flex relative w-full",children:i.jsx(RW,{dataCoin:xn,coinInclude:Xn,coinExclude:lr,setCoinInclude:or,setCoinExclude:Qt,isLoadingCoin:tn})})})}),i.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[i.jsxs("div",{className:"relative flex flex-col justify-start",children:[i.jsx("p",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px]",children:"Tag"}),i.jsx("div",{className:"flex mt-2 relative",children:i.jsx("input",{type:"text",value:Kn||"",onChange:fr,placeholder:"Tag",className:`shadow-sm py-0.5 bg-[#303030] block text-xs sm:text-sm font-semibold font-manrope
leading-none rounded-md w-full h-8 pl-2 pr-7
${ve?"border border-[#FF797C]":""}
outline-[#404040] placeholder:text-[#7F7F7F]`})})]}),i.jsxs("div",{className:"flex flex-col items-start justify-start gap-1",children:[i.jsxs("div",{className:"flex items-center gap-2 -mt-1",children:[i.jsx("span",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px]",children:"Run"}),i.jsxs("div",{className:"flex items-center has-tooltip relative",children:[i.jsx(Ni,{className:"text-[#7C7C7C] w-4 min-w-4 min-h-4 h-4 relative"}),i.jsx("span",{children:i.jsx(ro,{content:"When ON, copy trading will start immediately after saving. When OFF, settings will be saved but trading remains paused.",positionTop:!1,alignRight:!0,tooltipCss:"max-w-[180px] min-w-[180px] leading-[16px] mt-6"})})]})]}),i.jsxs("div",{className:"flex justify-between w-full items-center gap-2 bg-[#353535] p-1 rounded-md px-2 h-8",children:[i.jsx("span",{className:"text-white font-inter text-[13px] font-medium leading-[8px] tracking-[-0.26px]",children:We?"On":"Off"}),i.jsx(Eo,{checked:We,onChange:At=>{at(At),At||kn(!1)},className:`${We?"bg-[#1DE674]":"bg-white/10"} group relative flex h-5 w-9 cursor-pointer rounded-full p-1
transition-colors duration-200 ease-in-out focus:outline-none`,children:i.jsx("span",{"aria-hidden":"true",className:`pointer-events-none inline-block size-4 -mt-[3px]
translate-x-0 rounded-full bg-white ring-0 shadow-lg
transition duration-200 ease-in-out group-data-[checked]:translate-x-3`})})]})]})]})]}),re==="method_twothousand"&&i.jsxs("div",{className:"w-full space-y-4 mt-4",children:[i.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[i.jsxs("div",{className:"flex flex-col items-start justify-start",children:[i.jsxs("div",{className:`${ut?"-mt-1":""} flex items-center gap-2`,children:[i.jsx("span",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px]",children:"Max. Margin per Positions (Optional)"}),i.jsxs("div",{className:`${ut?"flex":"hidden"} items-center has-tooltip relative`,children:[i.jsx("img",{src:ec,alt:"Dextrabot",className:"w-4 min-w-4 min-h-4 h-4"}),i.jsx("span",{children:i.jsx(ro,{content:"Must be greater than or equal to Min Margin per Order, greater than or equal to Max Margin per Order, and greater than or equal to Initial Margin Cap.",positionTop:!1,alignRight:!0,tooltipCss:"max-w-[300px] min-w-[120px] mt-8 leading-[16px]"})})]})]}),i.jsxs("div",{className:`${ut?"mt-1":"mt-2"} flex w-full relative`,children:[i.jsx("span",{className:"absolute left-1 top-1/2 -translate-y-1/2 text-[#7F7F7F] font-semibold mr-2",children:"$"}),i.jsx("input",{value:Ke||"",onChange:Nr,type:"text",name:"maxUsdPerpPositions",onKeyDown:Ir,autoComplete:"off",min:"0",placeholder:"Amount",className:`shadow-sm py-0.5 bg-[#303030] block text-xs sm:text-sm font-semibold font-manrope
leading-none rounded-md w-full h-8 pl-6 pr-2
${ut?"border border-[#FF797C] focus:outline-none focus:ring-0":Ke?"border border-[#C5C5C5] focus:outline-none focus:ring-0":"outline-[#404040]"}
placeholder:text-[#7F7F7F]`})]})]}),i.jsxs("div",{className:"flex flex-col justify-start gap-1",children:[i.jsxs("div",{className:`${lt?"-mt-1":""} flex items-center gap-2`,children:[i.jsx("span",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px]",children:"Initial Margin Cap (Optional)"}),i.jsxs("div",{className:`${lt?"flex":"hidden"} items-center has-tooltip relative`,children:[i.jsx("img",{src:ec,alt:"Dextrabot",className:"w-4 min-w-4 min-h-4 h-4"}),i.jsx("span",{children:i.jsx(ro,{content:"Must be less than or equal to Max Margin per Position.",positionTop:!1,alignRight:!0,tooltipCss:"max-w-[300px] min-w-[120px] mt-8 leading-[16px]"})})]})]}),i.jsxs("div",{className:`${lt?"":"mt-1"} flex w-full relative`,children:[i.jsx("span",{className:"absolute left-1 top-1/2 -translate-y-1/2 text-[#7F7F7F] font-semibold mr-2",children:"$"}),i.jsx("input",{value:$t||"",onChange:cr,type:"text",name:"initialOrderMaxUsd",onKeyDown:Ir,autoComplete:"off",min:"0",placeholder:"Amount",className:`shadow-sm py-0.5 bg-[#303030] block text-xs sm:text-sm font-semibold font-manrope leading-none rounded-md w-full h-8 pl-6 pr-7
${lt?"border border-[#FF797C] focus:outline-none focus:ring-0":$t?"border border-[#C5C5C5] focus:outline-none focus:ring-0":"outline-[#404040]"} placeholder:text-[#7F7F7F]`})]})]})]}),i.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[i.jsxs("div",{className:"flex flex-col items-start justify-start",children:[i.jsxs("div",{className:`${it?"-mt-1":""} flex items-center gap-2`,children:[i.jsx("span",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px]",children:"Min. Margin per Order (Optional)"}),i.jsxs("div",{className:`${it?"flex":"hidden"} items-center has-tooltip relative`,children:[i.jsx("img",{src:ec,alt:"Dextrabot",className:"w-4 min-w-4 min-h-4 h-4"}),i.jsx("span",{children:i.jsx(ro,{content:"Must be less than or equal to Max Margin per Order and less than or equal to Max Margin per Position.",positionTop:!1,alignRight:!0,tooltipCss:"max-w-[300px] min-w-[120px] mt-8 leading-[16px]"})})]})]}),i.jsxs("div",{className:`${it?"mt-1":"mt-2"} flex w-full relative`,children:[i.jsx("span",{className:"absolute left-1 top-1/2 -translate-y-1/2 text-[#7F7F7F] font-semibold mr-2",children:"$"}),i.jsx("input",{value:jt||"",onChange:ln,type:"text",name:"minUsdPerOrder",onKeyDown:Ir,autoComplete:"off",min:"0",placeholder:"Amount",className:`shadow-sm py-0.5 bg-[#303030] block text-xs sm:text-sm font-semibold font-manrope
leading-none rounded-md w-full h-8 pl-6 pr-2
${it?"border border-[#FF797C] focus:outline-none focus:ring-0":jt?"border border-[#C5C5C5] focus:outline-none focus:ring-0":"outline-[#404040]"}
placeholder:text-[#7F7F7F]`})]})]}),i.jsxs("div",{className:"flex flex-col justify-start gap-1",children:[i.jsxs("div",{className:`${Qe&&(Ke||jt)?"-mt-1":""} flex items-center gap-2`,children:[i.jsx("span",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px]",children:"Max. Margin per Order"}),i.jsxs("div",{className:`${Qe&&(Ke||jt)?"flex":"hidden"} items-center has-tooltip relative`,children:[i.jsx("img",{src:ec,alt:"Dextrabot",className:"w-4 min-w-4 min-h-4 h-4"}),i.jsx("span",{children:i.jsx(ro,{content:"Must be greater than or equal to Min Margin per Order and less than or equal to Max Margin per Position.",positionTop:!1,alignRight:!0,tooltipCss:"max-w-[300px] min-w-[120px] mt-8 leading-[16px]"})})]})]}),i.jsxs("div",{className:`${Qe&&(Ke||jt)?"":"mt-1"} flex w-full relative`,children:[i.jsx("span",{className:"absolute left-1 top-1/2 -translate-y-1/2 text-[#7F7F7F] font-semibold mr-2",children:"$"}),i.jsx("input",{value:un||"",onChange:mn,type:"text",name:"maxUsdPerOrder",onKeyDown:Ir,autoComplete:"off",min:"0",placeholder:"Amount",className:`shadow-sm py-0.5 bg-[#303030] block text-xs sm:text-sm font-semibold font-manrope
leading-none rounded-md w-full h-8 pl-6 pr-2
${Qe?"border border-[#FF797C] focus:outline-none focus:ring-0":un?"border border-[#C5C5C5] focus:outline-none focus:ring-0":"outline-[#404040]"}
placeholder:text-[#7F7F7F]`})]})]})]}),i.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[i.jsxs("div",{className:"flex flex-col items-start justify-start gap-1",children:[i.jsxs("div",{className:"flex items-center gap-2 -mt-1",children:[i.jsx("span",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px]",children:"Copy Current"}),i.jsxs("div",{className:"flex items-center has-tooltip relative",children:[i.jsx(Ni,{className:"text-[#7C7C7C] w-4 min-w-4 min-h-4 h-4"}),i.jsx("span",{children:i.jsx(ro,{content:Gt?"This option can only be set when starting copy trading. It cannot be changed later.":"If enabled, your wallet will immediately copy all currently open positions from the Source Wallet.",positionTop:!1,alignRight:!0,tooltipCss:"max-w-[300px] min-w-[120px] mt-8 leading-[16px]"})})]})]}),i.jsxs("div",{className:"flex justify-between w-full items-center gap-2 bg-[#353535] p-1 rounded-md px-2 h-8",children:[i.jsx("span",{className:"text-white font-inter text-[13px] font-medium leading-[8px] tracking-[-0.26px]",children:Nn?"On":"Off"}),i.jsx(Eo,{checked:Nn,onChange:At=>{(!Gt||Gt&&dr)&&We&&kn(At)},className:`${Nn?"bg-[#1DE674]":"bg-white/10"} group relative flex h-5 w-9
${Gt&&!dr||!We?"cursor-not-allowed opacity-50":"cursor-pointer"}
rounded-full p-1 transition-colors duration-200 ease-in-out focus:outline-none`,children:i.jsx("span",{"aria-hidden":"true",className:`pointer-events-none inline-block size-4 -mt-[3px] translate-x-0
rounded-full bg-white ring-0 shadow-lg transition duration-200 ease-in-out
${Nn?"translate-x-3":""}`})})]})]}),i.jsxs("div",{className:"flex flex-col justify-start gap-2",children:[i.jsx("span",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px] hidden lg:block",children:"Copy Increase as Open Position"}),i.jsx("span",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px] block lg:hidden",children:"Copy Inc. as Open Pos."}),i.jsxs("span",{className:"flex justify-between w-full items-center gap-2 bg-[#353535] p-1 rounded-md px-2 h-8",children:[i.jsx("span",{className:"text-white font-inter text-[13px] font-medium leading-[8px] tracking-[-0.26px]",children:mt?"On":"Off"}),i.jsx(Eo,{checked:mt,onChange:Dt,className:`${mt?"bg-[#1DE674]":"bg-white/10"} group relative flex h-5 w-9 cursor-pointer rounded-full p-1
transition-colors duration-200 ease-in-out focus:outline-none`,children:i.jsx("span",{"aria-hidden":"true",className:`pointer-events-none inline-block size-4 -mt-[3px] translate-x-0
rounded-full bg-white ring-0 shadow-lg transition duration-200 ease-in-out
group-data-[checked]:translate-x-3`})})]})]})]}),i.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[i.jsxs("div",{className:"flex items-center justify-start gap-1",children:[i.jsxs("div",{className:"flex flex-col justify-start my-1 sm:my-1.5",children:[i.jsx("p",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px]",children:"Stop Loss"}),i.jsxs("div",{className:"flex mt-2 relative",children:[i.jsx("span",{className:"absolute left-1 top-1/2 -translate-y-1/2 text-[#7F7F7F] font-semibold mr-2",children:"%"}),i.jsx("input",{type:"text",value:en.inputValue||"",onChange:rt,onKeyDown:Ir,autoComplete:"off",min:"0",placeholder:"Stop Loss",className:`shadow-sm py-0.5 bg-[#303030] block text-xs sm:text-sm font-semibold font-manrope
leading-none rounded-md w-full h-8 pl-6 pr-2
${en.inputValue?"border border-[#C5C5C5]":""}
outline-[#404040] placeholder:text-[#7F7F7F]`})]})]}),i.jsxs("div",{className:"flex flex-col justify-start my-1 sm:my-1.5",children:[i.jsx("p",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px]",children:"Take Profit"}),i.jsxs("div",{className:"flex mt-2 relative",children:[i.jsx("span",{className:"absolute left-1 top-1/2 -translate-y-1/2 text-[#7F7F7F] font-semibold mr-2",children:"%"}),i.jsx("input",{type:"text",value:Nt.inputValue||"",onChange:Pt,onKeyDown:Ir,autoComplete:"off",min:"0",placeholder:"Take Profit",className:`shadow-sm py-0.5 bg-[#303030] block text-xs sm:text-sm font-semibold font-manrope
leading-none rounded-md w-full h-8 pl-6 pr-2
${Nt.inputValue?"border border-[#C5C5C5]":""}
outline-[#404040] placeholder:text-[#7F7F7F]`})]})]})]}),i.jsxs("div",{className:"flex flex-col justify-start gap-2 mt-[6px]",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px]",children:"Direction Filter"}),i.jsxs("div",{className:"hidden items-center has-tooltip relative",children:[i.jsx(Ni,{className:"text-[#7C7C7C] w-4 min-w-4 min-h-4 h-4 relative"}),i.jsx("span",{children:i.jsx(ro,{content:"When enabled, automatically copy trades for new tokens when they get listed on the exchange.",positionTop:!1,alignRight:!0,tooltipCss:"max-w-[120px] min-w-[120px] leading-[16px] mt-8"})})]})]}),i.jsxs("div",{className:"flex justify-start items-center gap-1.5 w-max h-max rounded-lg border border-[#333333] p-1",children:[i.jsx(Gx,{title:"All",set_click:()=>ie("All"),isPositionType:Y}),i.jsx(Gx,{title:"LONG",set_click:()=>ie("LONG"),isPositionType:Y}),i.jsx(Gx,{title:"SHORT",set_click:()=>ie("SHORT"),isPositionType:Y})]})]})]}),i.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[i.jsxs("div",{className:"flex flex-col justify-start gap-2",children:[i.jsx("span",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px]",children:"Include TWAP Orders"}),i.jsxs("span",{className:"flex justify-between w-full items-center gap-2 bg-[#353535] p-1 rounded-md px-2 h-8",children:[i.jsx("span",{className:"text-white font-inter text-[13px] font-medium leading-[8px] tracking-[-0.26px]",children:Tt?"On":"Off"}),i.jsx(Eo,{checked:Tt,onChange:dn,className:`${Tt?"bg-[#1DE674]":"bg-white/10"} group relative flex h-5 w-9 cursor-pointer rounded-full p-1
transition-colors duration-200 ease-in-out focus:outline-none`,children:i.jsx("span",{"aria-hidden":"true",className:`pointer-events-none inline-block size-4 -mt-[3px] translate-x-0
rounded-full bg-white ring-0 shadow-lg transition duration-200 ease-in-out
group-data-[checked]:translate-x-3`})})]})]}),i.jsxs("div",{className:"flex flex-col justify-start gap-1",children:[i.jsxs("div",{className:"flex items-center gap-2 -mt-1",children:[i.jsx("span",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px]",children:"Future Listed Tokens"}),i.jsxs("div",{className:"flex items-center has-tooltip relative",children:[i.jsx(Ni,{className:"text-[#7C7C7C] w-4 min-w-4 min-h-4 h-4 relative"}),i.jsx("span",{children:i.jsx(ro,{content:"When enabled, automatically copy trades for new tokens when they get listed on the exchange.",positionTop:!1,alignRight:!0,tooltipCss:"max-w-[120px] min-w-[120px] leading-[16px] mt-8"})})]})]}),i.jsxs("span",{className:"flex justify-between w-full items-center gap-2 bg-[#353535] p-1 rounded-md px-2 h-8",children:[i.jsx("span",{className:"text-white font-inter text-[13px] font-medium leading-[8px] tracking-[-0.26px]",children:on?"On":"Off"}),i.jsx(Eo,{checked:on,onChange:gn,className:`${on?"bg-[#1DE674]":"bg-white/10"} group relative flex h-5 w-9 cursor-pointer rounded-full p-1
transition-colors duration-200 ease-in-out focus:outline-none`,children:i.jsx("span",{"aria-hidden":"true",className:`pointer-events-none inline-block size-4 -mt-[3px] translate-x-0
rounded-full bg-white ring-0 shadow-lg transition duration-200 ease-in-out
group-data-[checked]:translate-x-3`})})]})]})]}),i.jsx("div",{className:"grid grid-cols-1 gap-4",children:i.jsx("div",{className:"flex flex-col items-start justify-start",children:i.jsx("div",{className:"flex relative w-full",children:i.jsx(RW,{dataCoin:xn,coinInclude:Xn,coinExclude:lr,setCoinInclude:or,setCoinExclude:Qt,isLoadingCoin:tn})})})}),i.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[i.jsxs("div",{className:"relative flex flex-col justify-start",children:[i.jsx("p",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px]",children:"Tag"}),i.jsx("div",{className:"flex mt-2 relative",children:i.jsx("input",{type:"text",value:Kn||"",onChange:fr,placeholder:"Tag",className:`shadow-sm py-0.5 bg-[#303030] block text-xs sm:text-sm font-semibold font-manrope
leading-none rounded-md w-full h-8 pl-2 pr-7
${ve?"border border-[#FF797C]":""}
outline-[#404040] placeholder:text-[#7F7F7F]`})})]}),i.jsxs("div",{className:"flex flex-col items-start justify-start gap-1",children:[i.jsxs("div",{className:"flex items-center gap-2 -mt-1",children:[i.jsx("span",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px]",children:"Run"}),i.jsxs("div",{className:"flex items-center has-tooltip relative",children:[i.jsx(Ni,{className:"text-[#7C7C7C] w-4 min-w-4 min-h-4 h-4 relative"}),i.jsx("span",{children:i.jsx(ro,{content:"When ON, copy trading will start immediately after saving. When OFF, settings will be saved but trading remains paused.",positionTop:!1,alignRight:!0,tooltipCss:"max-w-[180px] min-w-[180px] leading-[16px] mt-6"})})]})]}),i.jsxs("div",{className:"flex justify-between w-full items-center gap-2 bg-[#353535] p-1 rounded-md px-2 h-8",children:[i.jsx("span",{className:"text-white font-inter text-[13px] font-medium leading-[8px] tracking-[-0.26px]",children:We?"On":"Off"}),i.jsx(Eo,{checked:We,onChange:At=>{at(At),At||kn(!1)},className:`${We?"bg-[#1DE674]":"bg-white/10"} group relative flex h-5 w-9 cursor-pointer rounded-full p-1
transition-colors duration-200 ease-in-out focus:outline-none`,children:i.jsx("span",{"aria-hidden":"true",className:`pointer-events-none inline-block size-4 -mt-[3px]
translate-x-0 rounded-full bg-white ring-0 shadow-lg
transition duration-200 ease-in-out group-data-[checked]:translate-x-3`})})]})]})]})]}),re==="method_two"&&i.jsxs("div",{className:"w-full space-y-4 mt-4",children:[i.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[i.jsxs("div",{className:"flex flex-col items-start justify-start",children:[i.jsx("p",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px]",children:"Scaling"}),i.jsxs("div",{className:"flex mt-2 w-full relative",children:[i.jsx("span",{className:"absolute left-1 top-1/2 -translate-y-1/2 text-[#7F7F7F] font-semibold mr-2",children:"%"}),i.jsx("input",{value:Ue||"",onChange:ss,type:"text",name:"scalingPercentage",onKeyDown:Ir,autoComplete:"off",min:"0",placeholder:"Scaling",className:`shadow-sm py-0.5 bg-[#303030] block text-xs sm:text-sm font-semibold font-manrope
leading-none rounded-md w-full h-8 pl-6 pr-7 ${Ue?Ie?"border border-[#D97706]":"border border-[#C5C5C5]":""}
outline-[#404040] placeholder:text-[#7F7F7F]`}),Ie&&i.jsxs("span",{className:"absolute left-0 top-11 -translate-y-1/2 text-[#F59E0B] font-semibold text-[9px] leading-2 flex",children:[i.jsx(IM,{className:"w-4 h-4 text-[#F59E0B]"}),i.jsx("span",{className:"text-[9px] leading-[10px] ml-1",children:"If scaling produces sizes above your available margin, orders will fail."})]})]})]}),i.jsxs("div",{className:"flex flex-col justify-start gap-2",children:[i.jsx("span",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px] hidden lg:block",children:"Copy Increase as Open Position"}),i.jsx("span",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px] block lg:hidden",children:"Copy Inc. as Open Pos."}),i.jsxs("span",{className:"flex justify-between w-full items-center gap-2 bg-[#353535] p-1 rounded-md px-2 h-8",children:[i.jsx("span",{className:"text-white font-inter text-[13px] font-medium leading-[8px] tracking-[-0.26px]",children:mt?"On":"Off"}),i.jsx(Eo,{checked:mt,onChange:Dt,className:`${mt?"bg-[#1DE674]":"bg-white/10"} group relative flex h-5 w-9 cursor-pointer rounded-full p-1
transition-colors duration-200 ease-in-out focus:outline-none`,children:i.jsx("span",{"aria-hidden":"true",className:`pointer-events-none inline-block size-4 -mt-[3px] translate-x-0
rounded-full bg-white ring-0 shadow-lg transition duration-200 ease-in-out
group-data-[checked]:translate-x-3`})})]})]})]}),i.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[i.jsxs("div",{className:"flex flex-col justify-start my-1 sm:my-1.5",children:[i.jsx("p",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px]",children:"Stop Loss"}),i.jsxs("div",{className:"flex mt-2 relative",children:[i.jsx("span",{className:"absolute left-1 top-1/2 -translate-y-1/2 text-[#7F7F7F] font-semibold mr-2",children:"%"}),i.jsx("input",{type:"text",value:en.inputValue||"",onChange:rt,onKeyDown:Ir,autoComplete:"off",min:"0",placeholder:"Stop Loss",className:`shadow-sm py-0.5 bg-[#303030] block text-xs sm:text-sm font-semibold font-manrope
leading-none rounded-md w-full h-8 pl-6 pr-14
${en.inputValue?"border border-[#C5C5C5]":""}
outline-[#404040] placeholder:text-[#7F7F7F]`})]})]}),i.jsxs("div",{className:"flex flex-col justify-start my-1 sm:my-1.5",children:[i.jsx("p",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px]",children:"Take Profit"}),i.jsxs("div",{className:"flex mt-2 relative",children:[i.jsx("span",{className:"absolute left-1 top-1/2 -translate-y-1/2 text-[#7F7F7F] font-semibold mr-2",children:"%"}),i.jsx("input",{type:"text",value:Nt.inputValue||"",onChange:Pt,onKeyDown:Ir,autoComplete:"off",min:"0",placeholder:"Take Profit",className:`shadow-sm py-0.5 bg-[#303030] block text-xs sm:text-sm font-semibold font-manrope
leading-none rounded-md w-full h-8 pl-6 pr-14
${Nt.inputValue?"border border-[#C5C5C5]":""}
outline-[#404040] placeholder:text-[#7F7F7F]`})]})]})]}),i.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[i.jsxs("div",{className:"flex flex-col justify-start gap-2",children:[i.jsx("span",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px]",children:"Include TWAP Orders"}),i.jsxs("span",{className:"flex justify-between w-full items-center gap-2 bg-[#353535] p-1 rounded-md px-2 h-8",children:[i.jsx("span",{className:"text-white font-inter text-[13px] font-medium leading-[8px] tracking-[-0.26px]",children:Tt?"On":"Off"}),i.jsx(Eo,{checked:Tt,onChange:dn,className:`${Tt?"bg-[#1DE674]":"bg-white/10"} group relative flex h-5 w-9 cursor-pointer rounded-full p-1
transition-colors duration-200 ease-in-out focus:outline-none`,children:i.jsx("span",{"aria-hidden":"true",className:`pointer-events-none inline-block size-4 -mt-[3px] translate-x-0
rounded-full bg-white ring-0 shadow-lg transition duration-200 ease-in-out
group-data-[checked]:translate-x-3`})})]})]}),i.jsxs("div",{className:"flex flex-col justify-start gap-2",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px]",children:"Direction Filter"}),i.jsxs("div",{className:"hidden items-center has-tooltip relative",children:[i.jsx(Ni,{className:"text-[#7C7C7C] w-4 min-w-4 min-h-4 h-4 relative"}),i.jsx("span",{children:i.jsx(ro,{content:"When enabled, automatically copy trades for new tokens when they get listed on the exchange.",positionTop:!1,alignRight:!0,tooltipCss:"max-w-[120px] min-w-[120px] leading-[16px] mt-8"})})]})]}),i.jsxs("div",{className:"flex justify-start items-center gap-1.5 w-max h-max rounded-lg border border-[#333333] p-1",children:[i.jsx(Gx,{title:"All",set_click:()=>ie("All"),isPositionType:Y}),i.jsx(Gx,{title:"LONG",set_click:()=>ie("LONG"),isPositionType:Y}),i.jsx(Gx,{title:"SHORT",set_click:()=>ie("SHORT"),isPositionType:Y})]})]})]}),i.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[i.jsxs("div",{className:"flex flex-col items-start justify-start gap-1",children:[i.jsxs("div",{className:"flex items-center gap-2 -mt-1",children:[i.jsx("span",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px]",children:"Copy Current"}),i.jsxs("div",{className:"flex items-center has-tooltip relative",children:[i.jsx(Ni,{className:"text-[#7C7C7C] w-4 min-w-4 min-h-4 h-4"}),i.jsx("span",{children:i.jsx(ro,{content:Fe==="lighter"?"Coming Soon":Gt?"This option can only be set when starting copy trading. It cannot be changed later.":"If enabled, your wallet will immediately copy all currently open positions from the Source Wallet.",positionTop:!1,alignRight:!0,tooltipCss:`${Fe==="lighter"?"max-w-[120px]":"mt-8 max-w-[300px]"} min-w-[120px] leading-[16px]`})})]})]}),i.jsxs("div",{className:"flex justify-between w-full items-center gap-2 bg-[#353535] p-1 rounded-md px-2 h-8",children:[i.jsx("span",{className:"text-white font-inter text-[13px] font-medium leading-[8px] tracking-[-0.26px]",children:Nn?"On":"Off"}),i.jsx(Eo,{checked:Nn,onChange:At=>{(!Gt||Gt&&dr)&&We&&Fe==="hyper"&&kn(At)},className:`${Nn?"bg-[#1DE674]":"bg-white/10"} group relative flex h-5 w-9
${Gt&&!dr||!We||Fe==="lighter"?"cursor-not-allowed opacity-50":"cursor-pointer"}
rounded-full p-1 transition-colors duration-200 ease-in-out focus:outline-none`,children:i.jsx("span",{"aria-hidden":"true",className:`pointer-events-none inline-block size-4 -mt-[3px] translate-x-0
rounded-full bg-white ring-0 shadow-lg transition duration-200 ease-in-out
${Nn?"translate-x-3":""}`})})]})]}),i.jsxs("div",{className:"flex flex-col justify-start gap-1",children:[i.jsxs("div",{className:"flex items-center gap-2 -mt-1",children:[i.jsx("span",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px]",children:"Future Listed Tokens"}),i.jsxs("div",{className:"flex items-center has-tooltip relative",children:[i.jsx(Ni,{className:"text-[#7C7C7C] w-4 min-w-4 min-h-4 h-4 relative"}),i.jsx("span",{children:i.jsx(ro,{content:"When enabled, automatically copy trades for new tokens when they get listed on the exchange.",positionTop:!1,alignRight:!0,tooltipCss:"max-w-[120px] min-w-[120px] leading-[16px] mt-8"})})]})]}),i.jsxs("span",{className:"flex justify-between w-full items-center gap-2 bg-[#353535] p-1 rounded-md px-2 h-8",children:[i.jsx("span",{className:"text-white font-inter text-[13px] font-medium leading-[8px] tracking-[-0.26px]",children:on?"On":"Off"}),i.jsx(Eo,{checked:on,onChange:gn,className:`${on?"bg-[#1DE674]":"bg-white/10"} group relative flex h-5 w-9 cursor-pointer rounded-full p-1
transition-colors duration-200 ease-in-out focus:outline-none`,children:i.jsx("span",{"aria-hidden":"true",className:`pointer-events-none inline-block size-4 -mt-[3px] translate-x-0
rounded-full bg-white ring-0 shadow-lg transition duration-200 ease-in-out
group-data-[checked]:translate-x-3`})})]})]})]}),i.jsx("div",{className:"grid grid-cols-1 gap-4",children:i.jsx("div",{className:"flex flex-col items-start justify-start",children:i.jsx("div",{className:"flex relative w-full",children:i.jsx(RW,{dataCoin:xn,coinInclude:Xn,coinExclude:lr,setCoinInclude:or,setCoinExclude:Qt,isLoadingCoin:tn})})})}),i.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[i.jsxs("div",{className:"relative flex flex-col justify-start",children:[i.jsx("p",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px]",children:"Tag"}),i.jsx("div",{className:"flex mt-2 relative",children:i.jsx("input",{type:"text",value:Kn||"",onChange:fr,placeholder:"Tag",className:`shadow-sm py-0.5 bg-[#303030] block text-xs sm:text-sm font-semibold font-manrope
leading-none rounded-md w-full h-8 pl-2 pr-7
${ve?"border border-[#FF797C]":""}
outline-[#404040] placeholder:text-[#7F7F7F]`})})]}),i.jsxs("div",{className:"flex flex-col items-start justify-start gap-1",children:[i.jsxs("div",{className:"flex items-center gap-2 -mt-1",children:[i.jsx("span",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px]",children:"Run"}),i.jsxs("div",{className:"flex items-center has-tooltip relative",children:[i.jsx(Ni,{className:"text-[#7C7C7C] w-4 min-w-4 min-h-4 h-4 relative"}),i.jsx("span",{children:i.jsx(ro,{content:"When ON, copy trading will start immediately after saving. When OFF, settings will be saved but trading remains paused.",positionTop:!1,alignRight:!0,tooltipCss:"max-w-[180px] min-w-[180px] leading-[16px] mt-6"})})]})]}),i.jsxs("div",{className:"flex justify-between w-full items-center gap-2 bg-[#353535] p-1 rounded-md px-2 h-8",children:[i.jsx("span",{className:"text-white font-inter text-[13px] font-medium leading-[8px] tracking-[-0.26px]",children:We?"On":"Off"}),i.jsx(Eo,{checked:We,onChange:At=>{at(At),At||kn(!1)},className:`${We?"bg-[#1DE674]":"bg-white/10"} group relative flex h-5 w-9 cursor-pointer rounded-full p-1
transition-colors duration-200 ease-in-out focus:outline-none`,children:i.jsx("span",{"aria-hidden":"true",className:`pointer-events-none inline-block size-4 -mt-[3px]
translate-x-0 rounded-full bg-white ring-0 shadow-lg
transition duration-200 ease-in-out group-data-[checked]:translate-x-3`})})]})]})]}),Fe==="lighter"?fn?i.jsx("div",{className:"text-[#FF797C] font-semibold text-[10px] leading-4 border border-[#ff797c]/30 rounded-md px-3 py-1",children:"Copy Trading on Lighter requires an active Dextrabot subscription. Get access to copy this trader and more."}):yt?i.jsx("div",{className:"text-[#FF797C] font-semibold text-[10px] leading-4 border border-[#ff797c]/30 rounded-md px-3 py-1",children:"Your current slot count is not sufficient for this action. To proceed, please purchase additional slots using the ‘Get more slots’ button."}):Gs?i.jsx("div",{className:"text-[#FF797C] font-semibold text-[10px] leading-4 border border-[#ff797c]/30 rounded-md px-3 py-1",children:"This wallet already has an active Copy Trade. Please select a different wallet to create a new Copy Trade."}):i.jsx("div",{className:"text-[#F59E0B] font-semibold text-[10px] leading-4 border border-[#D97706] rounded-md px-3 py-1",children:"All positions opened via Lighter Copy Trade are executed in Cross Margin Mode."}):Gs&&i.jsx("div",{className:"text-[#FF797C] font-semibold text-[10px] leading-4 border border-[#ff797c]/30 rounded-md px-3 py-1",children:"This wallet already has an active Copy Trade. Please select a different wallet to create a new Copy Trade."})]}),i.jsxs("div",{className:"flex items-center w-full mt-auto h-16 border-t border-t-[#353535] bg-[rgba(27,27,27,0.32)] backdrop-blur-[16px] p-2 rounded-b-2xl",children:[ot>0&&!fn&&i.jsxs("div",{className:"hidden sm:flex rounded-[8px] bg-[rgba(255,121,124,0.16)] backdrop-blur-[16px] w-12 h-10 justify-center items-center text-[#FF797C] font-manrope text-[12px] font-semibold leading-[12px] tracking-[0.22px] gap-2",children:[i.jsx("img",{src:ec,alt:"Dextrabot"}),ot]}),i.jsxs("div",{className:"flex items-center gap-2 ml-auto",children:[i.jsx("button",{onClick:()=>t(!1),className:"rounded-[12px] border bg-black/5 border-[#353535] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] hover:border-white px-[24px] py-[12px] font-inter font-[13px] mr-2 h-[32px] flex items-center justify-center text-medium leading-[8px] tracking-[-0.26px]",children:"Cancel"}),i.jsx("button",{onClick:At=>{yn!=null&&!isNaN(yn)&&(re!=="method_one"||Ye!=null&&!isNaN(Ye)&&Ye)&&(re!=="method_twothousand"||un!=null&&!isNaN(un)&&un&&(!(Ke!=null&&!isNaN(Ke)&&Ke)||Number(Ke)>=Number(un)&&(!(jt!=null&&!isNaN(jt)&&jt)||Number(Ke)>=Number(jt))&&(!($t!=null&&!isNaN($t)&&$t)||Number(Ke)>=Number($t)))&&(!(jt!=null&&!isNaN(jt)&&jt)||Number(un)>=Number(jt)))&&Kn&&(Fe!=="lighter"||kt)&&(Fe!=="lighter"||!yt)?!en.inputValue||!Nt.inputValue?Jn(!0):mr():(he(yn==null||isNaN(yn)),ye(re==="method_one"&&(Ye==null||isNaN(Ye)||!Ye)),$e(re==="method_twothousand"&&(un==null||isNaN(un)||!un||un!=null&&!isNaN(un)&&un&&jt!=null&&!isNaN(jt)&&jt&&Number(jt)>Number(un)||un!=null&&!isNaN(un)&&un&&Ke!=null&&!isNaN(Ke)&&Ke&&Number(un)>Number(Ke))),tt(re==="method_twothousand"&&(un!=null&&!isNaN(un)&&un&&jt!=null&&!isNaN(jt)&&jt&&Number(jt)>Number(un)||Ke!=null&&!isNaN(Ke)&&Ke&&jt!=null&&!isNaN(jt)&&jt&&Number(jt)>Number(Ke))),ft(re==="method_twothousand"&&Ke!=null&&!isNaN(Ke)&&Ke&&$t!=null&&!isNaN($t)&&$t&&Number($t)>Number(Ke)),qt(re==="method_twothousand"&&Ke!=null&&!isNaN(Ke)&&Ke&&(un!=null&&!isNaN(un)&&un&&Number(un)>Number(Ke)||jt!=null&&!isNaN(jt)&&jt&&Number(jt)>Number(Ke)||$t!=null&&!isNaN($t)&&$t&&Number($t)>Number(Ke))),je(!Kn||Kn===""),Le(Fe==="lighter"&&Ue&&Ue>100),On(Fe==="lighter"&&!kt))},type:"button",className:`${re==="method_one"||Fe==="lighter"&&fn||Fe==="lighter"&&yt||Gs?"hidden":""} rounded-[10px] border border-[#8861FF] bg-[#7446FF] hover:bg-[#5834C3] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] font-inter px-[24px] py-[12px] font-[13px] h-[32px] flex items-center justify-center text-medium mr-2 leading-[8px] tracking-[-0.26px]`,children:"Apply"}),ot>0&&Fe==="lighter"&&fn&&i.jsx(KBt,{checkAccountCopy:ps,setIsLighterSub:Ut,setLighterSubError:On,setSlotCount:En,setSlotSubsCount:Bn,setSlotUsingCount:sr,setSlotTotalCount:Rr,setSlotCountWallets:Ar}),ot>0&&!fn&&yt&&Fe==="lighter"&&i.jsx("div",{onClick:()=>{ws(Pn),et(!0)},className:"flex items-center justify-center h-8 px-2 sm:px-6 rounded-[10px] text-[11px] sm:text-[13px] border bg-[#7446FF] border-[#8861FF] hover:bg-[#5834C3] cursor-pointer min-w-max font-semibold",children:"Get more slots"}),i.jsx("button",{onClick:At=>{At.preventDefault(),u!=null&&u.some(ir=>ir.wallet_address===r)&&Qn()},type:"button",className:`rounded-[12px] border border-[#353535] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] hover:border-[#FF797C] font-inter px-[24px] py-[12px] font-[13px] h-[32px] text-medium leading-[8px] tracking-[-0.26px] flex !text-[#FF797C] items-center justify-center bg-[rgba(27,27,27,0.32)]" ${u!=null&&u.some(At=>At.wallet_address===r)&&!dr?"":"hidden"}`,children:"Delete"})]})]})]})]}):i.jsxs("div",{className:"flex flex-col items-center justify-center gap-4 my-16 px-4",children:[i.jsx("div",{className:"py-4",children:i.jsx("img",{src:Gi,alt:"",className:"w-[86px h-[86px]"})}),i.jsx("span",{className:"text-center mb-5 font-bold mt-3 text-[21px]",children:"Wallet Required!"}),i.jsx("span",{className:"text-center mb-5 font-medium px-10 -mt-6",children:"You need to create and fund at least one wallet before starting copy trading."}),i.jsx("div",{onClick:()=>{window.location.href="/wallet-management"},className:"w-[284px] h-8 px-6 py-3 bg-[#7445ff] rounded-[10px] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-[#8860ff] justify-center items-center gap-2.5 inline-flex cursor-pointer ",children:i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px]",children:"Go to Wallet Management"})})]}):i.jsxs("div",{className:"flex flex-col items-center justify-center gap-4 mt-16 mb-8 px-4 text-white",children:[i.jsx("div",{className:"pt-4",children:i.jsx("img",{src:Gi,alt:"",className:"w-[86px h-[86px]"})}),i.jsx("span",{className:"text-center mb-5 font-bold mt-10 text-[21px]",children:"Closed Beta Has Started! 🚀"}),i.jsx("span",{className:"text-center mb-5 font-medium px-10 -mt-6",children:"Follow our Discord to stay updated and be ready for the full launch!"}),i.jsx("span",{className:"text-center mb-5 font-medium px-10 -mt-6",children:"Early access requirements:"}),i.jsx("div",{onClick:()=>{window.open("https://www.tensor.trade/trade/mushboomers","_blank")},className:"w-[184px] h-8 px-6 py-3 bg-[#7445ff] rounded-[10px] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-[#8860ff] justify-center items-center gap-2.5 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px]",children:"Mushboomers Sol"})}),i.jsx("div",{onClick:()=>{window.open("https://blur.io/collection/mushboomers","_blank")},className:"w-[184px] h-8 px-6 py-3 bg-[#7445ff] rounded-[10px] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-[#8860ff] justify-center items-center gap-2.5 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px]",children:"Mushboomers Eth"})}),i.jsx("div",{onClick:()=>{window.open("https://discord.gg/dextrabot","_blank")},className:"w-[184px] h-8 px-6 py-3 bg-[#7445ff] rounded-[10px] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-[#8860ff] justify-center items-center gap-2.5 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px]",children:"Join Our Discord"})})]})})})})})})]})]})}const Gx=({title:e,set_click:t,isPositionType:n})=>i.jsx("div",{onClick:t,className:`${n==e?n=="LONG"?"bg-[#67ffbd]/20 text-[#67FFBD]":n=="SHORT"?"bg-[#ff797c]/20 text-[#FF797C]":(n=="All","bg-[#3d3d3d] text-white"):"bg-transparent text-[#9b9b9b]"} text-[13px] font-medium font-manrope leading-[8px] cursor-pointer flex justify-center items-center min-w-max rounded-md px-[6px] sm:px-[10px] h-[22px]`,children:e});function aDe(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(n=aDe(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function sa(){for(var e,t,n=0,r="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=aDe(e))&&(r&&(r+=" "),r+=t);return r}var DW,lye;function df(){if(lye)return DW;lye=1;var e=Array.isArray;return DW=e,DW}var BW,cye;function oDe(){if(cye)return BW;cye=1;var e=typeof Tu=="object"&&Tu&&Tu.Object===Object&&Tu;return BW=e,BW}var $W,uye;function hx(){if(uye)return $W;uye=1;var e=oDe(),t=typeof self=="object"&&self&&self.Object===Object&&self,n=e||t||Function("return this")();return $W=n,$W}var UW,dye;function lT(){if(dye)return UW;dye=1;var e=hx(),t=e.Symbol;return UW=t,UW}var zW,fye;function XBt(){if(fye)return zW;fye=1;var e=lT(),t=Object.prototype,n=t.hasOwnProperty,r=t.toString,s=e?e.toStringTag:void 0;function a(o){var l=n.call(o,s),c=o[s];try{o[s]=void 0;var u=!0}catch{}var d=r.call(o);return u&&(l?o[s]=c:delete o[s]),d}return zW=a,zW}var HW,hye;function QBt(){if(hye)return HW;hye=1;var e=Object.prototype,t=e.toString;function n(r){return t.call(r)}return HW=n,HW}var VW,pye;function k1(){if(pye)return VW;pye=1;var e=lT(),t=XBt(),n=QBt(),r="[object Null]",s="[object Undefined]",a=e?e.toStringTag:void 0;function o(l){return l==null?l===void 0?s:r:a&&a in Object(l)?t(l):n(l)}return VW=o,VW}var WW,mye;function T1(){if(mye)return WW;mye=1;function e(t){return t!=null&&typeof t=="object"}return WW=e,WW}var qW,xye;function GA(){if(xye)return qW;xye=1;var e=k1(),t=T1(),n="[object Symbol]";function r(s){return typeof s=="symbol"||t(s)&&e(s)==n}return qW=r,qW}var GW,gye;function _le(){if(gye)return GW;gye=1;var e=df(),t=GA(),n=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,r=/^\w*$/;function s(a,o){if(e(a))return!1;var l=typeof a;return l=="number"||l=="symbol"||l=="boolean"||a==null||t(a)?!0:r.test(a)||!n.test(a)||o!=null&&a in Object(o)}return GW=s,GW}var KW,bye;function m2(){if(bye)return KW;bye=1;function e(t){var n=typeof t;return t!=null&&(n=="object"||n=="function")}return KW=e,KW}var YW,yye;function kle(){if(yye)return YW;yye=1;var e=k1(),t=m2(),n="[object AsyncFunction]",r="[object Function]",s="[object GeneratorFunction]",a="[object Proxy]";function o(l){if(!t(l))return!1;var c=e(l);return c==r||c==s||c==n||c==a}return YW=o,YW}var XW,vye;function ZBt(){if(vye)return XW;vye=1;var e=hx(),t=e["__core-js_shared__"];return XW=t,XW}var QW,wye;function JBt(){if(wye)return QW;wye=1;var e=ZBt(),t=function(){var r=/[^.]+$/.exec(e&&e.keys&&e.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""}();function n(r){return!!t&&t in r}return QW=n,QW}var ZW,Cye;function lDe(){if(Cye)return ZW;Cye=1;var e=Function.prototype,t=e.toString;function n(r){if(r!=null){try{return t.call(r)}catch{}try{return r+""}catch{}}return""}return ZW=n,ZW}var JW,Sye;function e$t(){if(Sye)return JW;Sye=1;var e=kle(),t=JBt(),n=m2(),r=lDe(),s=/[\\^$.*+?()[\]{}|]/g,a=/^\[object .+?Constructor\]$/,o=Function.prototype,l=Object.prototype,c=o.toString,u=l.hasOwnProperty,d=RegExp("^"+c.call(u).replace(s,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function f(x){if(!n(x)||t(x))return!1;var g=e(x)?d:a;return g.test(r(x))}return JW=f,JW}var eq,Nye;function t$t(){if(Nye)return eq;Nye=1;function e(t,n){return t==null?void 0:t[n]}return eq=e,eq}var tq,Aye;function C5(){if(Aye)return tq;Aye=1;var e=e$t(),t=t$t();function n(r,s){var a=t(r,s);return e(a)?a:void 0}return tq=n,tq}var nq,jye;function I$(){if(jye)return nq;jye=1;var e=C5(),t=e(Object,"create");return nq=t,nq}var rq,Eye;function n$t(){if(Eye)return rq;Eye=1;var e=I$();function t(){this.__data__=e?e(null):{},this.size=0}return rq=t,rq}var sq,_ye;function r$t(){if(_ye)return sq;_ye=1;function e(t){var n=this.has(t)&&delete this.__data__[t];return this.size-=n?1:0,n}return sq=e,sq}var iq,kye;function s$t(){if(kye)return iq;kye=1;var e=I$(),t="__lodash_hash_undefined__",n=Object.prototype,r=n.hasOwnProperty;function s(a){var o=this.__data__;if(e){var l=o[a];return l===t?void 0:l}return r.call(o,a)?o[a]:void 0}return iq=s,iq}var aq,Tye;function i$t(){if(Tye)return aq;Tye=1;var e=I$(),t=Object.prototype,n=t.hasOwnProperty;function r(s){var a=this.__data__;return e?a[s]!==void 0:n.call(a,s)}return aq=r,aq}var oq,Iye;function a$t(){if(Iye)return oq;Iye=1;var e=I$(),t="__lodash_hash_undefined__";function n(r,s){var a=this.__data__;return this.size+=this.has(r)?0:1,a[r]=e&&s===void 0?t:s,this}return oq=n,oq}var lq,Pye;function o$t(){if(Pye)return lq;Pye=1;var e=n$t(),t=r$t(),n=s$t(),r=i$t(),s=a$t();function a(o){var l=-1,c=o==null?0:o.length;for(this.clear();++l<c;){var u=o[l];this.set(u[0],u[1])}}return a.prototype.clear=e,a.prototype.delete=t,a.prototype.get=n,a.prototype.has=r,a.prototype.set=s,lq=a,lq}var cq,Fye;function l$t(){if(Fye)return cq;Fye=1;function e(){this.__data__=[],this.size=0}return cq=e,cq}var uq,Oye;function Tle(){if(Oye)return uq;Oye=1;function e(t,n){return t===n||t!==t&&n!==n}return uq=e,uq}var dq,Mye;function P$(){if(Mye)return dq;Mye=1;var e=Tle();function t(n,r){for(var s=n.length;s--;)if(e(n[s][0],r))return s;return-1}return dq=t,dq}var fq,Rye;function c$t(){if(Rye)return fq;Rye=1;var e=P$(),t=Array.prototype,n=t.splice;function r(s){var a=this.__data__,o=e(a,s);if(o<0)return!1;var l=a.length-1;return o==l?a.pop():n.call(a,o,1),--this.size,!0}return fq=r,fq}var hq,Lye;function u$t(){if(Lye)return hq;Lye=1;var e=P$();function t(n){var r=this.__data__,s=e(r,n);return s<0?void 0:r[s][1]}return hq=t,hq}var pq,Dye;function d$t(){if(Dye)return pq;Dye=1;var e=P$();function t(n){return e(this.__data__,n)>-1}return pq=t,pq}var mq,Bye;function f$t(){if(Bye)return mq;Bye=1;var e=P$();function t(n,r){var s=this.__data__,a=e(s,n);return a<0?(++this.size,s.push([n,r])):s[a][1]=r,this}return mq=t,mq}var xq,$ye;function F$(){if($ye)return xq;$ye=1;var e=l$t(),t=c$t(),n=u$t(),r=d$t(),s=f$t();function a(o){var l=-1,c=o==null?0:o.length;for(this.clear();++l<c;){var u=o[l];this.set(u[0],u[1])}}return a.prototype.clear=e,a.prototype.delete=t,a.prototype.get=n,a.prototype.has=r,a.prototype.set=s,xq=a,xq}var gq,Uye;function Ile(){if(Uye)return gq;Uye=1;var e=C5(),t=hx(),n=e(t,"Map");return gq=n,gq}var bq,zye;function h$t(){if(zye)return bq;zye=1;var e=o$t(),t=F$(),n=Ile();function r(){this.size=0,this.__data__={hash:new e,map:new(n||t),string:new e}}return bq=r,bq}var yq,Hye;function p$t(){if(Hye)return yq;Hye=1;function e(t){var n=typeof t;return n=="string"||n=="number"||n=="symbol"||n=="boolean"?t!=="__proto__":t===null}return yq=e,yq}var vq,Vye;function O$(){if(Vye)return vq;Vye=1;var e=p$t();function t(n,r){var s=n.__data__;return e(r)?s[typeof r=="string"?"string":"hash"]:s.map}return vq=t,vq}var wq,Wye;function m$t(){if(Wye)return wq;Wye=1;var e=O$();function t(n){var r=e(this,n).delete(n);return this.size-=r?1:0,r}return wq=t,wq}var Cq,qye;function x$t(){if(qye)return Cq;qye=1;var e=O$();function t(n){return e(this,n).get(n)}return Cq=t,Cq}var Sq,Gye;function g$t(){if(Gye)return Sq;Gye=1;var e=O$();function t(n){return e(this,n).has(n)}return Sq=t,Sq}var Nq,Kye;function b$t(){if(Kye)return Nq;Kye=1;var e=O$();function t(n,r){var s=e(this,n),a=s.size;return s.set(n,r),this.size+=s.size==a?0:1,this}return Nq=t,Nq}var Aq,Yye;function Ple(){if(Yye)return Aq;Yye=1;var e=h$t(),t=m$t(),n=x$t(),r=g$t(),s=b$t();function a(o){var l=-1,c=o==null?0:o.length;for(this.clear();++l<c;){var u=o[l];this.set(u[0],u[1])}}return a.prototype.clear=e,a.prototype.delete=t,a.prototype.get=n,a.prototype.has=r,a.prototype.set=s,Aq=a,Aq}var jq,Xye;function cDe(){if(Xye)return jq;Xye=1;var e=Ple(),t="Expected a function";function n(r,s){if(typeof r!="function"||s!=null&&typeof s!="function")throw new TypeError(t);var a=function(){var o=arguments,l=s?s.apply(this,o):o[0],c=a.cache;if(c.has(l))return c.get(l);var u=r.apply(this,o);return a.cache=c.set(l,u)||c,u};return a.cache=new(n.Cache||e),a}return n.Cache=e,jq=n,jq}var Eq,Qye;function y$t(){if(Qye)return Eq;Qye=1;var e=cDe(),t=500;function n(r){var s=e(r,function(o){return a.size===t&&a.clear(),o}),a=s.cache;return s}return Eq=n,Eq}var _q,Zye;function v$t(){if(Zye)return _q;Zye=1;var e=y$t(),t=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,n=/\\(\\)?/g,r=e(function(s){var a=[];return s.charCodeAt(0)===46&&a.push(""),s.replace(t,function(o,l,c,u){a.push(c?u.replace(n,"$1"):l||o)}),a});return _q=r,_q}var kq,Jye;function Fle(){if(Jye)return kq;Jye=1;function e(t,n){for(var r=-1,s=t==null?0:t.length,a=Array(s);++r<s;)a[r]=n(t[r],r,t);return a}return kq=e,kq}var Tq,e2e;function w$t(){if(e2e)return Tq;e2e=1;var e=lT(),t=Fle(),n=df(),r=GA(),s=e?e.prototype:void 0,a=s?s.toString:void 0;function o(l){if(typeof l=="string")return l;if(n(l))return t(l,o)+"";if(r(l))return a?a.call(l):"";var c=l+"";return c=="0"&&1/l==-1/0?"-0":c}return Tq=o,Tq}var Iq,t2e;function uDe(){if(t2e)return Iq;t2e=1;var e=w$t();function t(n){return n==null?"":e(n)}return Iq=t,Iq}var Pq,n2e;function dDe(){if(n2e)return Pq;n2e=1;var e=df(),t=_le(),n=v$t(),r=uDe();function s(a,o){return e(a)?a:t(a,o)?[a]:n(r(a))}return Pq=s,Pq}var Fq,r2e;function M$(){if(r2e)return Fq;r2e=1;var e=GA();function t(n){if(typeof n=="string"||e(n))return n;var r=n+"";return r=="0"&&1/n==-1/0?"-0":r}return Fq=t,Fq}var Oq,s2e;function Ole(){if(s2e)return Oq;s2e=1;var e=dDe(),t=M$();function n(r,s){s=e(s,r);for(var a=0,o=s.length;r!=null&&a<o;)r=r[t(s[a++])];return a&&a==o?r:void 0}return Oq=n,Oq}var Mq,i2e;function fDe(){if(i2e)return Mq;i2e=1;var e=Ole();function t(n,r,s){var a=n==null?void 0:e(n,r);return a===void 0?s:a}return Mq=t,Mq}var C$t=fDe();const np=Ti(C$t);var Rq,a2e;function S$t(){if(a2e)return Rq;a2e=1;function e(t){return t==null}return Rq=e,Rq}var N$t=S$t();const wi=Ti(N$t);var Lq,o2e;function A$t(){if(o2e)return Lq;o2e=1;var e=k1(),t=df(),n=T1(),r="[object String]";function s(a){return typeof a=="string"||!t(a)&&n(a)&&e(a)==r}return Lq=s,Lq}var j$t=A$t();const q3=Ti(j$t);var E$t=kle();const Ai=Ti(E$t);var _$t=m2();const KA=Ti(_$t);var Dq={exports:{}},Ia={};/**
* @license React
* react-is.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var l2e;function k$t(){if(l2e)return Ia;l2e=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),o=Symbol.for("react.context"),l=Symbol.for("react.server_context"),c=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),d=Symbol.for("react.suspense_list"),f=Symbol.for("react.memo"),x=Symbol.for("react.lazy"),g=Symbol.for("react.offscreen"),v;v=Symbol.for("react.module.reference");function w(C){if(typeof C=="object"&&C!==null){var N=C.$$typeof;switch(N){case e:switch(C=C.type,C){case n:case s:case r:case u:case d:return C;default:switch(C=C&&C.$$typeof,C){case l:case o:case c:case x:case f:case a:return C;default:return N}}case t:return N}}}return Ia.ContextConsumer=o,Ia.ContextProvider=a,Ia.Element=e,Ia.ForwardRef=c,Ia.Fragment=n,Ia.Lazy=x,Ia.Memo=f,Ia.Portal=t,Ia.Profiler=s,Ia.StrictMode=r,Ia.Suspense=u,Ia.SuspenseList=d,Ia.isAsyncMode=function(){return!1},Ia.isConcurrentMode=function(){return!1},Ia.isContextConsumer=function(C){return w(C)===o},Ia.isContextProvider=function(C){return w(C)===a},Ia.isElement=function(C){return typeof C=="object"&&C!==null&&C.$$typeof===e},Ia.isForwardRef=function(C){return w(C)===c},Ia.isFragment=function(C){return w(C)===n},Ia.isLazy=function(C){return w(C)===x},Ia.isMemo=function(C){return w(C)===f},Ia.isPortal=function(C){return w(C)===t},Ia.isProfiler=function(C){return w(C)===s},Ia.isStrictMode=function(C){return w(C)===r},Ia.isSuspense=function(C){return w(C)===u},Ia.isSuspenseList=function(C){return w(C)===d},Ia.isValidElementType=function(C){return typeof C=="string"||typeof C=="function"||C===n||C===s||C===r||C===u||C===d||C===g||typeof C=="object"&&C!==null&&(C.$$typeof===x||C.$$typeof===f||C.$$typeof===a||C.$$typeof===o||C.$$typeof===c||C.$$typeof===v||C.getModuleId!==void 0)},Ia.typeOf=w,Ia}var c2e;function T$t(){return c2e||(c2e=1,Dq.exports=k$t()),Dq.exports}var I$t=T$t(),Bq,u2e;function hDe(){if(u2e)return Bq;u2e=1;var e=k1(),t=T1(),n="[object Number]";function r(s){return typeof s=="number"||t(s)&&e(s)==n}return Bq=r,Bq}var $q,d2e;function P$t(){if(d2e)return $q;d2e=1;var e=hDe();function t(n){return e(n)&&n!=+n}return $q=t,$q}var F$t=P$t();const YA=Ti(F$t);var O$t=hDe();const M$t=Ti(O$t);var lm=function(t){return t===0?0:t>0?1:-1},rw=function(t){return q3(t)&&t.indexOf("%")===t.length-1},rs=function(t){return M$t(t)&&!YA(t)},rc=function(t){return rs(t)||q3(t)},R$t=0,S5=function(t){var n=++R$t;return"".concat(t||"").concat(n)},G3=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!rs(t)&&!q3(t))return r;var a;if(rw(t)){var o=t.indexOf("%");a=n*parseFloat(t.slice(0,o))/100}else a=+t;return YA(a)&&(a=r),s&&a>n&&(a=n),a},Mb=function(t){if(!t)return null;var n=Object.keys(t);return n&&n.length?t[n[0]]:null},L$t=function(t){if(!Array.isArray(t))return!1;for(var n=t.length,r={},s=0;s<n;s++)if(!r[t[s]])r[t[s]]=!0;else return!0;return!1},wl=function(t,n){return rs(t)&&rs(n)?function(r){return t+r*(n-t)}:function(){return n}};function VR(e,t,n){return!e||!e.length?null:e.find(function(r){return r&&(typeof t=="function"?t(r):np(r,t))===n})}var D$t=function(t){if(!t||!t.length)return null;for(var n=t.length,r=0,s=0,a=0,o=0,l=1/0,c=-1/0,u=0,d=0,f=0;f<n;f++)u=t[f].cx||0,d=t[f].cy||0,r+=u,s+=d,a+=u*d,o+=u*u,l=Math.min(l,u),c=Math.max(c,u);var x=n*o!==r*r?(n*a-r*s)/(n*o-r*r):0;return{xmin:l,xmax:c,a:x,b:(s-x*r)/n}},B$t=function(t,n){return rs(t)&&rs(n)?t-n:q3(t)&&q3(n)?t.localeCompare(n):t instanceof Date&&n instanceof Date?t.getTime()-n.getTime():String(t).localeCompare(String(n))};function h4(e,t){for(var n in e)if({}.hasOwnProperty.call(e,n)&&(!{}.hasOwnProperty.call(t,n)||e[n]!==t[n]))return!1;for(var r in t)if({}.hasOwnProperty.call(t,r)&&!{}.hasOwnProperty.call(e,r))return!1;return!0}function ite(e){"@babel/helpers - typeof";return ite=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},ite(e)}var $$t=["viewBox","children"],U$t=["aria-activedescendant","aria-atomic","aria-autocomplete","aria-busy","aria-checked","aria-colcount","aria-colindex","aria-colspan","aria-controls","aria-current","aria-describedby","aria-details","aria-disabled","aria-errormessage","aria-expanded","aria-flowto","aria-haspopup","aria-hidden","aria-invalid","aria-keyshortcuts","aria-label","aria-labelledby","aria-level","aria-live","aria-modal","aria-multiline","aria-multiselectable","aria-orientation","aria-owns","aria-placeholder","aria-posinset","aria-pressed","aria-readonly","aria-relevant","aria-required","aria-roledescription","aria-rowcount","aria-rowindex","aria-rowspan","aria-selected","aria-setsize","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext","className","color","height","id","lang","max","media","method","min","name","style","target","width","role","tabIndex","accentHeight","accumulate","additive","alignmentBaseline","allowReorder","alphabetic","amplitude","arabicForm","ascent","attributeName","attributeType","autoReverse","azimuth","baseFrequency","baselineShift","baseProfile","bbox","begin","bias","by","calcMode","capHeight","clip","clipPath","clipPathUnits","clipRule","colorInterpolation","colorInterpolationFilters","colorProfile","colorRendering","contentScriptType","contentStyleType","cursor","cx","cy","d","decelerate","descent","diffuseConstant","direction","display","divisor","dominantBaseline","dur","dx","dy","edgeMode","elevation","enableBackground","end","exponent","externalResourcesRequired","fill","fillOpacity","fillRule","filter","filterRes","filterUnits","floodColor","floodOpacity","focusable","fontFamily","fontSize","fontSizeAdjust","fontStretch","fontStyle","fontVariant","fontWeight","format","from","fx","fy","g1","g2","glyphName","glyphOrientationHorizontal","glyphOrientationVertical","glyphRef","gradientTransform","gradientUnits","hanging","horizAdvX","horizOriginX","href","ideographic","imageRendering","in2","in","intercept","k1","k2","k3","k4","k","kernelMatrix","kernelUnitLength","kerning","keyPoints","keySplines","keyTimes","lengthAdjust","letterSpacing","lightingColor","limitingConeAngle","local","markerEnd","markerHeight","markerMid","markerStart","markerUnits","markerWidth","mask","maskContentUnits","maskUnits","mathematical","mode","numOctaves","offset","opacity","operator","order","orient","orientation","origin","overflow","overlinePosition","overlineThickness","paintOrder","panose1","pathLength","patternContentUnits","patternTransform","patternUnits","pointerEvents","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","r","radius","refX","refY","renderingIntent","repeatCount","repeatDur","requiredExtensions","requiredFeatures","restart","result","rotate","rx","ry","seed","shapeRendering","slope","spacing","specularConstant","specularExponent","speed","spreadMethod","startOffset","stdDeviation","stemh","stemv","stitchTiles","stopColor","stopOpacity","strikethroughPosition","strikethroughThickness","string","stroke","strokeDasharray","strokeDashoffset","strokeLinecap","strokeLinejoin","strokeMiterlimit","strokeOpacity","strokeWidth","surfaceScale","systemLanguage","tableValues","targetX","targetY","textAnchor","textDecoration","textLength","textRendering","to","transform","u1","u2","underlinePosition","underlineThickness","unicode","unicodeBidi","unicodeRange","unitsPerEm","vAlphabetic","values","vectorEffect","version","vertAdvY","vertOriginX","vertOriginY","vHanging","vIdeographic","viewTarget","visibility","vMathematical","widths","wordSpacing","writingMode","x1","x2","x","xChannelSelector","xHeight","xlinkActuate","xlinkArcrole","xlinkHref","xlinkRole","xlinkShow","xlinkTitle","xlinkType","xmlBase","xmlLang","xmlns","xmlnsXlink","xmlSpace","y1","y2","y","yChannelSelector","z","zoomAndPan","ref","key","angle"],f2e=["points","pathLength"],Uq={svg:$$t,polygon:f2e,polyline:f2e},Mle=["dangerouslySetInnerHTML","onCopy","onCopyCapture","onCut","onCutCapture","onPaste","onPasteCapture","onCompositionEnd","onCompositionEndCapture","onCompositionStart","onCompositionStartCapture","onCompositionUpdate","onCompositionUpdateCapture","onFocus","onFocusCapture","onBlur","onBlurCapture","onChange","onChangeCapture","onBeforeInput","onBeforeInputCapture","onInput","onInputCapture","onReset","onResetCapture","onSubmit","onSubmitCapture","onInvalid","onInvalidCapture","onLoad","onLoadCapture","onError","onErrorCapture","onKeyDown","onKeyDownCapture","onKeyPress","onKeyPressCapture","onKeyUp","onKeyUpCapture","onAbort","onAbortCapture","onCanPlay","onCanPlayCapture","onCanPlayThrough","onCanPlayThroughCapture","onDurationChange","onDurationChangeCapture","onEmptied","onEmptiedCapture","onEncrypted","onEncryptedCapture","onEnded","onEndedCapture","onLoadedData","onLoadedDataCapture","onLoadedMetadata","onLoadedMetadataCapture","onLoadStart","onLoadStartCapture","onPause","onPauseCapture","onPlay","onPlayCapture","onPlaying","onPlayingCapture","onProgress","onProgressCapture","onRateChange","onRateChangeCapture","onSeeked","onSeekedCapture","onSeeking","onSeekingCapture","onStalled","onStalledCapture","onSuspend","onSuspendCapture","onTimeUpdate","onTimeUpdateCapture","onVolumeChange","onVolumeChangeCapture","onWaiting","onWaitingCapture","onAuxClick","onAuxClickCapture","onClick","onClickCapture","onContextMenu","onContextMenuCapture","onDoubleClick","onDoubleClickCapture","onDrag","onDragCapture","onDragEnd","onDragEndCapture","onDragEnter","onDragEnterCapture","onDragExit","onDragExitCapture","onDragLeave","onDragLeaveCapture","onDragOver","onDragOverCapture","onDragStart","onDragStartCapture","onDrop","onDropCapture","onMouseDown","onMouseDownCapture","onMouseEnter","onMouseLeave","onMouseMove","onMouseMoveCapture","onMouseOut","onMouseOutCapture","onMouseOver","onMouseOverCapture","onMouseUp","onMouseUpCapture","onSelect","onSelectCapture","onTouchCancel","onTouchCancelCapture","onTouchEnd","onTouchEndCapture","onTouchMove","onTouchMoveCapture","onTouchStart","onTouchStartCapture","onPointerDown","onPointerDownCapture","onPointerMove","onPointerMoveCapture","onPointerUp","onPointerUpCapture","onPointerCancel","onPointerCancelCapture","onPointerEnter","onPointerEnterCapture","onPointerLeave","onPointerLeaveCapture","onPointerOver","onPointerOverCapture","onPointerOut","onPointerOutCapture","onGotPointerCapture","onGotPointerCaptureCapture","onLostPointerCapture","onLostPointerCaptureCapture","onScroll","onScrollCapture","onWheel","onWheelCapture","onAnimationStart","onAnimationStartCapture","onAnimationEnd","onAnimationEndCapture","onAnimationIteration","onAnimationIterationCapture","onTransitionEnd","onTransitionEndCapture"],WR=function(t,n){if(!t||typeof t=="function"||typeof t=="boolean")return null;var r=t;if(m.isValidElement(t)&&(r=t.props),!KA(r))return null;var s={};return Object.keys(r).forEach(function(a){Mle.includes(a)&&(s[a]=n||function(o){return r[a](r,o)})}),s},z$t=function(t,n,r){return function(s){return t(n,r,s),null}},r_=function(t,n,r){if(!KA(t)||ite(t)!=="object")return null;var s=null;return Object.keys(t).forEach(function(a){var o=t[a];Mle.includes(a)&&typeof o=="function"&&(s||(s={}),s[a]=z$t(o,n,r))}),s},H$t=["children"],V$t=["children"];function h2e(e,t){if(e==null)return{};var n=W$t(e,t),r,s;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(s=0;s<a.length;s++)r=a[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function W$t(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function ate(e){"@babel/helpers - typeof";return ate=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},ate(e)}var p2e={click:"onClick",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",touchcancel:"onTouchCancel",touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart",contextmenu:"onContextMenu",dblclick:"onDoubleClick"},Xg=function(t){return typeof t=="string"?t:t?t.displayName||t.name||"Component":""},m2e=null,zq=null,Rle=function e(t){if(t===m2e&&Array.isArray(zq))return zq;var n=[];return m.Children.forEach(t,function(r){wi(r)||(I$t.isFragment(r)?n=n.concat(e(r.props.children)):n.push(r))}),zq=n,m2e=t,n};function sf(e,t){var n=[],r=[];return Array.isArray(t)?r=t.map(function(s){return Xg(s)}):r=[Xg(t)],Rle(e).forEach(function(s){var a=np(s,"type.displayName")||np(s,"type.name");r.indexOf(a)!==-1&&n.push(s)}),n}function Mf(e,t){var n=sf(e,t);return n[0]}var x2e=function(t){if(!t||!t.props)return!1;var n=t.props,r=n.width,s=n.height;return!(!rs(r)||r<=0||!rs(s)||s<=0)},q$t=["a","altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColormatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-url","foreignObject","g","glyph","glyphRef","hkern","image","line","lineGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","script","set","stop","style","svg","switch","symbol","text","textPath","title","tref","tspan","use","view","vkern"],G$t=function(t){return t&&t.type&&q3(t.type)&&q$t.indexOf(t.type)>=0},pDe=function(t){return t&&ate(t)==="object"&&"clipDot"in t},K$t=function(t,n,r,s){var a,o=(a=Uq==null?void 0:Uq[s])!==null&&a!==void 0?a:[];return n.startsWith("data-")||!Ai(t)&&(s&&o.includes(n)||U$t.includes(n))||r&&Mle.includes(n)},vi=function(t,n,r){if(!t||typeof t=="function"||typeof t=="boolean")return null;var s=t;if(m.isValidElement(t)&&(s=t.props),!KA(s))return null;var a={};return Object.keys(s).forEach(function(o){var l;K$t((l=s)===null||l===void 0?void 0:l[o],o,n,r)&&(a[o]=s[o])}),a},ote=function e(t,n){if(t===n)return!0;var r=m.Children.count(t);if(r!==m.Children.count(n))return!1;if(r===0)return!0;if(r===1)return g2e(Array.isArray(t)?t[0]:t,Array.isArray(n)?n[0]:n);for(var s=0;s<r;s++){var a=t[s],o=n[s];if(Array.isArray(a)||Array.isArray(o)){if(!e(a,o))return!1}else if(!g2e(a,o))return!1}return!0},g2e=function(t,n){if(wi(t)&&wi(n))return!0;if(!wi(t)&&!wi(n)){var r=t.props||{},s=r.children,a=h2e(r,H$t),o=n.props||{},l=o.children,c=h2e(o,V$t);return s&&l?h4(a,c)&&ote(s,l):!s&&!l?h4(a,c):!1}return!1},b2e=function(t,n){var r=[],s={};return Rle(t).forEach(function(a,o){if(G$t(a))r.push(a);else if(a){var l=Xg(a.type),c=n[l]||{},u=c.handler,d=c.once;if(u&&(!d||!s[l])){var f=u(a,l,o);r.push(f),s[l]=!0}}}),r},Y$t=function(t){var n=t&&t.type;return n&&p2e[n]?p2e[n]:null},X$t=function(t,n){return Rle(n).indexOf(t)},Q$t=["children","width","height","viewBox","className","style","title","desc"];function lte(){return lte=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},lte.apply(this,arguments)}function Z$t(e,t){if(e==null)return{};var n=J$t(e,t),r,s;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(s=0;s<a.length;s++)r=a[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function J$t(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function cte(e){var t=e.children,n=e.width,r=e.height,s=e.viewBox,a=e.className,o=e.style,l=e.title,c=e.desc,u=Z$t(e,Q$t),d=s||{width:n,height:r,x:0,y:0},f=sa("recharts-surface",a);return Ae.createElement("svg",lte({},vi(u,!0,"svg"),{className:f,width:n,height:r,style:o,viewBox:"".concat(d.x," ").concat(d.y," ").concat(d.width," ").concat(d.height)}),Ae.createElement("title",null,l),Ae.createElement("desc",null,c),t)}var eUt=["children","className"];function ute(){return ute=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ute.apply(this,arguments)}function tUt(e,t){if(e==null)return{};var n=nUt(e,t),r,s;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(s=0;s<a.length;s++)r=a[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function nUt(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var Sa=Ae.forwardRef(function(e,t){var n=e.children,r=e.className,s=tUt(e,eUt),a=sa("recharts-layer",r);return Ae.createElement("g",ute({className:a},vi(s,!0),{ref:t}),n)}),Qg=function(t,n){for(var r=arguments.length,s=new Array(r>2?r-2:0),a=2;a<r;a++)s[a-2]=arguments[a]},Hq,y2e;function rUt(){if(y2e)return Hq;y2e=1;function e(t,n,r){var s=-1,a=t.length;n<0&&(n=-n>a?0:a+n),r=r>a?a:r,r<0&&(r+=a),a=n>r?0:r-n>>>0,n>>>=0;for(var o=Array(a);++s<a;)o[s]=t[s+n];return o}return Hq=e,Hq}var Vq,v2e;function sUt(){if(v2e)return Vq;v2e=1;var e=rUt();function t(n,r,s){var a=n.length;return s=s===void 0?a:s,!r&&s>=a?n:e(n,r,s)}return Vq=t,Vq}var Wq,w2e;function mDe(){if(w2e)return Wq;w2e=1;var e="\\ud800-\\udfff",t="\\u0300-\\u036f",n="\\ufe20-\\ufe2f",r="\\u20d0-\\u20ff",s=t+n+r,a="\\ufe0e\\ufe0f",o="\\u200d",l=RegExp("["+o+e+s+a+"]");function c(u){return l.test(u)}return Wq=c,Wq}var qq,C2e;function iUt(){if(C2e)return qq;C2e=1;function e(t){return t.split("")}return qq=e,qq}var Gq,S2e;function aUt(){if(S2e)return Gq;S2e=1;var e="\\ud800-\\udfff",t="\\u0300-\\u036f",n="\\ufe20-\\ufe2f",r="\\u20d0-\\u20ff",s=t+n+r,a="\\ufe0e\\ufe0f",o="["+e+"]",l="["+s+"]",c="\\ud83c[\\udffb-\\udfff]",u="(?:"+l+"|"+c+")",d="[^"+e+"]",f="(?:\\ud83c[\\udde6-\\uddff]){2}",x="[\\ud800-\\udbff][\\udc00-\\udfff]",g="\\u200d",v=u+"?",w="["+a+"]?",C="(?:"+g+"(?:"+[d,f,x].join("|")+")"+w+v+")*",N=w+v+C,P="(?:"+[d+l+"?",l,f,x,o].join("|")+")",I=RegExp(c+"(?="+c+")|"+P+N,"g");function R(F){return F.match(I)||[]}return Gq=R,Gq}var Kq,N2e;function oUt(){if(N2e)return Kq;N2e=1;var e=iUt(),t=mDe(),n=aUt();function r(s){return t(s)?n(s):e(s)}return Kq=r,Kq}var Yq,A2e;function lUt(){if(A2e)return Yq;A2e=1;var e=sUt(),t=mDe(),n=oUt(),r=uDe();function s(a){return function(o){o=r(o);var l=t(o)?n(o):void 0,c=l?l[0]:o.charAt(0),u=l?e(l,1).join(""):o.slice(1);return c[a]()+u}}return Yq=s,Yq}var Xq,j2e;function cUt(){if(j2e)return Xq;j2e=1;var e=lUt(),t=e("toUpperCase");return Xq=t,Xq}var uUt=cUt();const R$=Ti(uUt);function io(e){return function(){return e}}const xDe=Math.cos,qR=Math.sin,Em=Math.sqrt,GR=Math.PI,L$=2*GR,dte=Math.PI,fte=2*dte,kv=1e-6,dUt=fte-kv;function gDe(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function fUt(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return gDe;const n=10**t;return function(r){this._+=r[0];for(let s=1,a=r.length;s<a;++s)this._+=Math.round(arguments[s]*n)/n+r[s]}}class hUt{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?gDe:fUt(t)}moveTo(t,n){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,n){this._append`L${this._x1=+t},${this._y1=+n}`}quadraticCurveTo(t,n,r,s){this._append`Q${+t},${+n},${this._x1=+r},${this._y1=+s}`}bezierCurveTo(t,n,r,s,a,o){this._append`C${+t},${+n},${+r},${+s},${this._x1=+a},${this._y1=+o}`}arcTo(t,n,r,s,a){if(t=+t,n=+n,r=+r,s=+s,a=+a,a<0)throw new Error(`negative radius: ${a}`);let o=this._x1,l=this._y1,c=r-t,u=s-n,d=o-t,f=l-n,x=d*d+f*f;if(this._x1===null)this._append`M${this._x1=t},${this._y1=n}`;else if(x>kv)if(!(Math.abs(f*c-u*d)>kv)||!a)this._append`L${this._x1=t},${this._y1=n}`;else{let g=r-o,v=s-l,w=c*c+u*u,C=g*g+v*v,N=Math.sqrt(w),P=Math.sqrt(x),I=a*Math.tan((dte-Math.acos((w+x-C)/(2*N*P)))/2),R=I/P,F=I/N;Math.abs(R-1)>kv&&this._append`L${t+R*d},${n+R*f}`,this._append`A${a},${a},0,0,${+(f*g>d*v)},${this._x1=t+F*c},${this._y1=n+F*u}`}}arc(t,n,r,s,a,o){if(t=+t,n=+n,r=+r,o=!!o,r<0)throw new Error(`negative radius: ${r}`);let l=r*Math.cos(s),c=r*Math.sin(s),u=t+l,d=n+c,f=1^o,x=o?s-a:a-s;this._x1===null?this._append`M${u},${d}`:(Math.abs(this._x1-u)>kv||Math.abs(this._y1-d)>kv)&&this._append`L${u},${d}`,r&&(x<0&&(x=x%fte+fte),x>dUt?this._append`A${r},${r},0,1,${f},${t-l},${n-c}A${r},${r},0,1,${f},${this._x1=u},${this._y1=d}`:x>kv&&this._append`A${r},${r},0,${+(x>=dte)},${f},${this._x1=t+r*Math.cos(a)},${this._y1=n+r*Math.sin(a)}`)}rect(t,n,r,s){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${r=+r}v${+s}h${-r}Z`}toString(){return this._}}function Lle(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{const r=Math.floor(n);if(!(r>=0))throw new RangeError(`invalid digits: ${n}`);t=r}return e},()=>new hUt(t)}function Dle(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function bDe(e){this._context=e}bDe.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function D$(e){return new bDe(e)}function yDe(e){return e[0]}function vDe(e){return e[1]}function wDe(e,t){var n=io(!0),r=null,s=D$,a=null,o=Lle(l);e=typeof e=="function"?e:e===void 0?yDe:io(e),t=typeof t=="function"?t:t===void 0?vDe:io(t);function l(c){var u,d=(c=Dle(c)).length,f,x=!1,g;for(r==null&&(a=s(g=o())),u=0;u<=d;++u)!(u<d&&n(f=c[u],u,c))===x&&((x=!x)?a.lineStart():a.lineEnd()),x&&a.point(+e(f,u,c),+t(f,u,c));if(g)return a=null,g+""||null}return l.x=function(c){return arguments.length?(e=typeof c=="function"?c:io(+c),l):e},l.y=function(c){return arguments.length?(t=typeof c=="function"?c:io(+c),l):t},l.defined=function(c){return arguments.length?(n=typeof c=="function"?c:io(!!c),l):n},l.curve=function(c){return arguments.length?(s=c,r!=null&&(a=s(r)),l):s},l.context=function(c){return arguments.length?(c==null?r=a=null:a=s(r=c),l):r},l}function NP(e,t,n){var r=null,s=io(!0),a=null,o=D$,l=null,c=Lle(u);e=typeof e=="function"?e:e===void 0?yDe:io(+e),t=typeof t=="function"?t:io(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?vDe:io(+n);function u(f){var x,g,v,w=(f=Dle(f)).length,C,N=!1,P,I=new Array(w),R=new Array(w);for(a==null&&(l=o(P=c())),x=0;x<=w;++x){if(!(x<w&&s(C=f[x],x,f))===N)if(N=!N)g=x,l.areaStart(),l.lineStart();else{for(l.lineEnd(),l.lineStart(),v=x-1;v>=g;--v)l.point(I[v],R[v]);l.lineEnd(),l.areaEnd()}N&&(I[x]=+e(C,x,f),R[x]=+t(C,x,f),l.point(r?+r(C,x,f):I[x],n?+n(C,x,f):R[x]))}if(P)return l=null,P+""||null}function d(){return wDe().defined(s).curve(o).context(a)}return u.x=function(f){return arguments.length?(e=typeof f=="function"?f:io(+f),r=null,u):e},u.x0=function(f){return arguments.length?(e=typeof f=="function"?f:io(+f),u):e},u.x1=function(f){return arguments.length?(r=f==null?null:typeof f=="function"?f:io(+f),u):r},u.y=function(f){return arguments.length?(t=typeof f=="function"?f:io(+f),n=null,u):t},u.y0=function(f){return arguments.length?(t=typeof f=="function"?f:io(+f),u):t},u.y1=function(f){return arguments.length?(n=f==null?null:typeof f=="function"?f:io(+f),u):n},u.lineX0=u.lineY0=function(){return d().x(e).y(t)},u.lineY1=function(){return d().x(e).y(n)},u.lineX1=function(){return d().x(r).y(t)},u.defined=function(f){return arguments.length?(s=typeof f=="function"?f:io(!!f),u):s},u.curve=function(f){return arguments.length?(o=f,a!=null&&(l=o(a)),u):o},u.context=function(f){return arguments.length?(f==null?a=l=null:l=o(a=f),u):a},u}class CDe{constructor(t,n){this._context=t,this._x=n}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,n){switch(t=+t,n=+n,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,n,t,n):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+n)/2,t,this._y0,t,n);break}}this._x0=t,this._y0=n}}function pUt(e){return new CDe(e,!0)}function mUt(e){return new CDe(e,!1)}const Ble={draw(e,t){const n=Em(t/GR);e.moveTo(n,0),e.arc(0,0,n,0,L$)}},xUt={draw(e,t){const n=Em(t/5)/2;e.moveTo(-3*n,-n),e.lineTo(-n,-n),e.lineTo(-n,-3*n),e.lineTo(n,-3*n),e.lineTo(n,-n),e.lineTo(3*n,-n),e.lineTo(3*n,n),e.lineTo(n,n),e.lineTo(n,3*n),e.lineTo(-n,3*n),e.lineTo(-n,n),e.lineTo(-3*n,n),e.closePath()}},SDe=Em(1/3),gUt=SDe*2,bUt={draw(e,t){const n=Em(t/gUt),r=n*SDe;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},yUt={draw(e,t){const n=Em(t),r=-n/2;e.rect(r,r,n,n)}},vUt=.8908130915292852,NDe=qR(GR/10)/qR(7*GR/10),wUt=qR(L$/10)*NDe,CUt=-xDe(L$/10)*NDe,SUt={draw(e,t){const n=Em(t*vUt),r=wUt*n,s=CUt*n;e.moveTo(0,-n),e.lineTo(r,s);for(let a=1;a<5;++a){const o=L$*a/5,l=xDe(o),c=qR(o);e.lineTo(c*n,-l*n),e.lineTo(l*r-c*s,c*r+l*s)}e.closePath()}},Qq=Em(3),NUt={draw(e,t){const n=-Em(t/(Qq*3));e.moveTo(0,n*2),e.lineTo(-Qq*n,-n),e.lineTo(Qq*n,-n),e.closePath()}},wh=-.5,Ch=Em(3)/2,hte=1/Em(12),AUt=(hte/2+1)*3,jUt={draw(e,t){const n=Em(t/AUt),r=n/2,s=n*hte,a=r,o=n*hte+n,l=-a,c=o;e.moveTo(r,s),e.lineTo(a,o),e.lineTo(l,c),e.lineTo(wh*r-Ch*s,Ch*r+wh*s),e.lineTo(wh*a-Ch*o,Ch*a+wh*o),e.lineTo(wh*l-Ch*c,Ch*l+wh*c),e.lineTo(wh*r+Ch*s,wh*s-Ch*r),e.lineTo(wh*a+Ch*o,wh*o-Ch*a),e.lineTo(wh*l+Ch*c,wh*c-Ch*l),e.closePath()}};function EUt(e,t){let n=null,r=Lle(s);e=typeof e=="function"?e:io(e||Ble),t=typeof t=="function"?t:io(t===void 0?64:+t);function s(){let a;if(n||(n=a=r()),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),a)return n=null,a+""||null}return s.type=function(a){return arguments.length?(e=typeof a=="function"?a:io(a),s):e},s.size=function(a){return arguments.length?(t=typeof a=="function"?a:io(+a),s):t},s.context=function(a){return arguments.length?(n=a??null,s):n},s}function KR(){}function YR(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function ADe(e){this._context=e}ADe.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:YR(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:YR(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function _Ut(e){return new ADe(e)}function jDe(e){this._context=e}jDe.prototype={areaStart:KR,areaEnd:KR,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:YR(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function kUt(e){return new jDe(e)}function EDe(e){this._context=e}EDe.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,r=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:YR(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function TUt(e){return new EDe(e)}function _De(e){this._context=e}_De.prototype={areaStart:KR,areaEnd:KR,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function IUt(e){return new _De(e)}function E2e(e){return e<0?-1:1}function _2e(e,t,n){var r=e._x1-e._x0,s=t-e._x1,a=(e._y1-e._y0)/(r||s<0&&-0),o=(n-e._y1)/(s||r<0&&-0),l=(a*s+o*r)/(r+s);return(E2e(a)+E2e(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(l))||0}function k2e(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function Zq(e,t,n){var r=e._x0,s=e._y0,a=e._x1,o=e._y1,l=(a-r)/3;e._context.bezierCurveTo(r+l,s+l*t,a-l,o-l*n,a,o)}function XR(e){this._context=e}XR.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:Zq(this,this._t0,k2e(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,Zq(this,k2e(this,n=_2e(this,e,t)),n);break;default:Zq(this,this._t0,n=_2e(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function kDe(e){this._context=new TDe(e)}(kDe.prototype=Object.create(XR.prototype)).point=function(e,t){XR.prototype.point.call(this,t,e)};function TDe(e){this._context=e}TDe.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,s,a){this._context.bezierCurveTo(t,e,r,n,a,s)}};function PUt(e){return new XR(e)}function FUt(e){return new kDe(e)}function IDe(e){this._context=e}IDe.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),n===2)this._context.lineTo(e[1],t[1]);else for(var r=T2e(e),s=T2e(t),a=0,o=1;o<n;++a,++o)this._context.bezierCurveTo(r[0][a],s[0][a],r[1][a],s[1][a],e[o],t[o]);(this._line||this._line!==0&&n===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function T2e(e){var t,n=e.length-1,r,s=new Array(n),a=new Array(n),o=new Array(n);for(s[0]=0,a[0]=2,o[0]=e[0]+2*e[1],t=1;t<n-1;++t)s[t]=1,a[t]=4,o[t]=4*e[t]+2*e[t+1];for(s[n-1]=2,a[n-1]=7,o[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)r=s[t]/a[t-1],a[t]-=r,o[t]-=r*o[t-1];for(s[n-1]=o[n-1]/a[n-1],t=n-2;t>=0;--t)s[t]=(o[t]-s[t+1])/a[t];for(a[n-1]=(e[n]+s[n-1])/2,t=0;t<n-1;++t)a[t]=2*e[t+1]-s[t+1];return[s,a]}function OUt(e){return new IDe(e)}function B$(e,t){this._context=e,this._t=t}B$.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}break}}this._x=e,this._y=t}};function MUt(e){return new B$(e,.5)}function RUt(e){return new B$(e,0)}function LUt(e){return new B$(e,1)}function wN(e,t){if((o=e.length)>1)for(var n=1,r,s,a=e[t[0]],o,l=a.length;n<o;++n)for(s=a,a=e[t[n]],r=0;r<l;++r)a[r][1]+=a[r][0]=isNaN(s[r][1])?s[r][0]:s[r][1]}function pte(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function DUt(e,t){return e[t]}function BUt(e){const t=[];return t.key=e,t}function $Ut(){var e=io([]),t=pte,n=wN,r=DUt;function s(a){var o=Array.from(e.apply(this,arguments),BUt),l,c=o.length,u=-1,d;for(const f of a)for(l=0,++u;l<c;++l)(o[l][u]=[0,+r(f,o[l].key,u,a)]).data=f;for(l=0,d=Dle(t(o));l<c;++l)o[d[l]].index=l;return n(o,d),o}return s.keys=function(a){return arguments.length?(e=typeof a=="function"?a:io(Array.from(a)),s):e},s.value=function(a){return arguments.length?(r=typeof a=="function"?a:io(+a),s):r},s.order=function(a){return arguments.length?(t=a==null?pte:typeof a=="function"?a:io(Array.from(a)),s):t},s.offset=function(a){return arguments.length?(n=a??wN,s):n},s}function UUt(e,t){if((r=e.length)>0){for(var n,r,s=0,a=e[0].length,o;s<a;++s){for(o=n=0;n<r;++n)o+=e[n][s][1]||0;if(o)for(n=0;n<r;++n)e[n][s][1]/=o}wN(e,t)}}function zUt(e,t){if((s=e.length)>0){for(var n=0,r=e[t[0]],s,a=r.length;n<a;++n){for(var o=0,l=0;o<s;++o)l+=e[o][n][1]||0;r[n][1]+=r[n][0]=-l/2}wN(e,t)}}function HUt(e,t){if(!(!((o=e.length)>0)||!((a=(s=e[t[0]]).length)>0))){for(var n=0,r=1,s,a,o;r<a;++r){for(var l=0,c=0,u=0;l<o;++l){for(var d=e[t[l]],f=d[r][1]||0,x=d[r-1][1]||0,g=(f-x)/2,v=0;v<l;++v){var w=e[t[v]],C=w[r][1]||0,N=w[r-1][1]||0;g+=C-N}c+=f,u+=g*f}s[r-1][1]+=s[r-1][0]=n,c&&(n-=u/c)}s[r-1][1]+=s[r-1][0]=n,wN(e,t)}}function s_(e){"@babel/helpers - typeof";return s_=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},s_(e)}var VUt=["type","size","sizeType"];function mte(){return mte=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},mte.apply(this,arguments)}function I2e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function P2e(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?I2e(Object(n),!0).forEach(function(r){WUt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):I2e(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function WUt(e,t,n){return t=qUt(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function qUt(e){var t=GUt(e,"string");return s_(t)=="symbol"?t:t+""}function GUt(e,t){if(s_(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(s_(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function KUt(e,t){if(e==null)return{};var n=YUt(e,t),r,s;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(s=0;s<a.length;s++)r=a[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function YUt(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var PDe={symbolCircle:Ble,symbolCross:xUt,symbolDiamond:bUt,symbolSquare:yUt,symbolStar:SUt,symbolTriangle:NUt,symbolWye:jUt},XUt=Math.PI/180,QUt=function(t){var n="symbol".concat(R$(t));return PDe[n]||Ble},ZUt=function(t,n,r){if(n==="area")return t;switch(r){case"cross":return 5*t*t/9;case"diamond":return .5*t*t/Math.sqrt(3);case"square":return t*t;case"star":{var s=18*XUt;return 1.25*t*t*(Math.tan(s)-Math.tan(s*2)*Math.pow(Math.tan(s),2))}case"triangle":return Math.sqrt(3)*t*t/4;case"wye":return(21-10*Math.sqrt(3))*t*t/8;default:return Math.PI*t*t/4}},JUt=function(t,n){PDe["symbol".concat(R$(t))]=n},$$=function(t){var n=t.type,r=n===void 0?"circle":n,s=t.size,a=s===void 0?64:s,o=t.sizeType,l=o===void 0?"area":o,c=KUt(t,VUt),u=P2e(P2e({},c),{},{type:r,size:a,sizeType:l}),d=function(){var C=QUt(r),N=EUt().type(C).size(ZUt(a,l,r));return N()},f=u.className,x=u.cx,g=u.cy,v=vi(u,!0);return x===+x&&g===+g&&a===+a?Ae.createElement("path",mte({},v,{className:sa("recharts-symbols",f),transform:"translate(".concat(x,", ").concat(g,")"),d:d()})):null};$$.registerSymbol=JUt;function CN(e){"@babel/helpers - typeof";return CN=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},CN(e)}function xte(){return xte=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},xte.apply(this,arguments)}function F2e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function ezt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?F2e(Object(n),!0).forEach(function(r){i_(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):F2e(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function tzt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function nzt(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,ODe(r.key),r)}}function rzt(e,t,n){return nzt(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function szt(e,t,n){return t=QR(t),izt(e,FDe()?Reflect.construct(t,n||[],QR(e).constructor):t.apply(e,n))}function izt(e,t){if(t&&(CN(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return azt(e)}function azt(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function FDe(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(FDe=function(){return!!e})()}function QR(e){return QR=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},QR(e)}function ozt(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&>e(e,t)}function gte(e,t){return gte=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},gte(e,t)}function i_(e,t,n){return t=ODe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ODe(e){var t=lzt(e,"string");return CN(t)=="symbol"?t:t+""}function lzt(e,t){if(CN(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(CN(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Ip=32,$le=function(e){function t(){return tzt(this,t),szt(this,t,arguments)}return ozt(t,e),rzt(t,[{key:"renderIcon",value:function(r){var s=this.props.inactiveColor,a=Ip/2,o=Ip/6,l=Ip/3,c=r.inactive?s:r.color;if(r.type==="plainline")return Ae.createElement("line",{strokeWidth:4,fill:"none",stroke:c,strokeDasharray:r.payload.strokeDasharray,x1:0,y1:a,x2:Ip,y2:a,className:"recharts-legend-icon"});if(r.type==="line")return Ae.createElement("path",{strokeWidth:4,fill:"none",stroke:c,d:"M0,".concat(a,"h").concat(l,`
A`).concat(o,",").concat(o,",0,1,1,").concat(2*l,",").concat(a,`
H`).concat(Ip,"M").concat(2*l,",").concat(a,`
A`).concat(o,",").concat(o,",0,1,1,").concat(l,",").concat(a),className:"recharts-legend-icon"});if(r.type==="rect")return Ae.createElement("path",{stroke:"none",fill:c,d:"M0,".concat(Ip/8,"h").concat(Ip,"v").concat(Ip*3/4,"h").concat(-32,"z"),className:"recharts-legend-icon"});if(Ae.isValidElement(r.legendIcon)){var u=ezt({},r);return delete u.legendIcon,Ae.cloneElement(r.legendIcon,u)}return Ae.createElement($$,{fill:c,cx:a,cy:a,size:Ip,sizeType:"diameter",type:r.type})}},{key:"renderItems",value:function(){var r=this,s=this.props,a=s.payload,o=s.iconSize,l=s.layout,c=s.formatter,u=s.inactiveColor,d={x:0,y:0,width:Ip,height:Ip},f={display:l==="horizontal"?"inline-block":"block",marginRight:10},x={display:"inline-block",verticalAlign:"middle",marginRight:4};return a.map(function(g,v){var w=g.formatter||c,C=sa(i_(i_({"recharts-legend-item":!0},"legend-item-".concat(v),!0),"inactive",g.inactive));if(g.type==="none")return null;var N=Ai(g.value)?null:g.value;Qg(!Ai(g.value),`The name property is also required when using a function for the dataKey of a chart's cartesian components. Ex: <Bar name="Name of my Data"/>`);var P=g.inactive?u:g.color;return Ae.createElement("li",xte({className:C,style:f,key:"legend-item-".concat(v)},r_(r.props,g,v)),Ae.createElement(cte,{width:o,height:o,viewBox:d,style:x},r.renderIcon(g)),Ae.createElement("span",{className:"recharts-legend-item-text",style:{color:P}},w?w(N,g,v):N))})}},{key:"render",value:function(){var r=this.props,s=r.payload,a=r.layout,o=r.align;if(!s||!s.length)return null;var l={padding:0,margin:0,textAlign:a==="horizontal"?o:"left"};return Ae.createElement("ul",{className:"recharts-default-legend",style:l},this.renderItems())}}])}(m.PureComponent);i_($le,"displayName","Legend");i_($le,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var Jq,O2e;function czt(){if(O2e)return Jq;O2e=1;var e=F$();function t(){this.__data__=new e,this.size=0}return Jq=t,Jq}var eG,M2e;function uzt(){if(M2e)return eG;M2e=1;function e(t){var n=this.__data__,r=n.delete(t);return this.size=n.size,r}return eG=e,eG}var tG,R2e;function dzt(){if(R2e)return tG;R2e=1;function e(t){return this.__data__.get(t)}return tG=e,tG}var nG,L2e;function fzt(){if(L2e)return nG;L2e=1;function e(t){return this.__data__.has(t)}return nG=e,nG}var rG,D2e;function hzt(){if(D2e)return rG;D2e=1;var e=F$(),t=Ile(),n=Ple(),r=200;function s(a,o){var l=this.__data__;if(l instanceof e){var c=l.__data__;if(!t||c.length<r-1)return c.push([a,o]),this.size=++l.size,this;l=this.__data__=new n(c)}return l.set(a,o),this.size=l.size,this}return rG=s,rG}var sG,B2e;function MDe(){if(B2e)return sG;B2e=1;var e=F$(),t=czt(),n=uzt(),r=dzt(),s=fzt(),a=hzt();function o(l){var c=this.__data__=new e(l);this.size=c.size}return o.prototype.clear=t,o.prototype.delete=n,o.prototype.get=r,o.prototype.has=s,o.prototype.set=a,sG=o,sG}var iG,$2e;function pzt(){if($2e)return iG;$2e=1;var e="__lodash_hash_undefined__";function t(n){return this.__data__.set(n,e),this}return iG=t,iG}var aG,U2e;function mzt(){if(U2e)return aG;U2e=1;function e(t){return this.__data__.has(t)}return aG=e,aG}var oG,z2e;function RDe(){if(z2e)return oG;z2e=1;var e=Ple(),t=pzt(),n=mzt();function r(s){var a=-1,o=s==null?0:s.length;for(this.__data__=new e;++a<o;)this.add(s[a])}return r.prototype.add=r.prototype.push=t,r.prototype.has=n,oG=r,oG}var lG,H2e;function LDe(){if(H2e)return lG;H2e=1;function e(t,n){for(var r=-1,s=t==null?0:t.length;++r<s;)if(n(t[r],r,t))return!0;return!1}return lG=e,lG}var cG,V2e;function DDe(){if(V2e)return cG;V2e=1;function e(t,n){return t.has(n)}return cG=e,cG}var uG,W2e;function BDe(){if(W2e)return uG;W2e=1;var e=RDe(),t=LDe(),n=DDe(),r=1,s=2;function a(o,l,c,u,d,f){var x=c&r,g=o.length,v=l.length;if(g!=v&&!(x&&v>g))return!1;var w=f.get(o),C=f.get(l);if(w&&C)return w==l&&C==o;var N=-1,P=!0,I=c&s?new e:void 0;for(f.set(o,l),f.set(l,o);++N<g;){var R=o[N],F=l[N];if(u)var U=x?u(F,R,N,l,o,f):u(R,F,N,o,l,f);if(U!==void 0){if(U)continue;P=!1;break}if(I){if(!t(l,function(L,z){if(!n(I,z)&&(R===L||d(R,L,c,u,f)))return I.push(z)})){P=!1;break}}else if(!(R===F||d(R,F,c,u,f))){P=!1;break}}return f.delete(o),f.delete(l),P}return uG=a,uG}var dG,q2e;function xzt(){if(q2e)return dG;q2e=1;var e=hx(),t=e.Uint8Array;return dG=t,dG}var fG,G2e;function gzt(){if(G2e)return fG;G2e=1;function e(t){var n=-1,r=Array(t.size);return t.forEach(function(s,a){r[++n]=[a,s]}),r}return fG=e,fG}var hG,K2e;function Ule(){if(K2e)return hG;K2e=1;function e(t){var n=-1,r=Array(t.size);return t.forEach(function(s){r[++n]=s}),r}return hG=e,hG}var pG,Y2e;function bzt(){if(Y2e)return pG;Y2e=1;var e=lT(),t=xzt(),n=Tle(),r=BDe(),s=gzt(),a=Ule(),o=1,l=2,c="[object Boolean]",u="[object Date]",d="[object Error]",f="[object Map]",x="[object Number]",g="[object RegExp]",v="[object Set]",w="[object String]",C="[object Symbol]",N="[object ArrayBuffer]",P="[object DataView]",I=e?e.prototype:void 0,R=I?I.valueOf:void 0;function F(U,L,z,Q,ne,J,X){switch(z){case P:if(U.byteLength!=L.byteLength||U.byteOffset!=L.byteOffset)return!1;U=U.buffer,L=L.buffer;case N:return!(U.byteLength!=L.byteLength||!J(new t(U),new t(L)));case c:case u:case x:return n(+U,+L);case d:return U.name==L.name&&U.message==L.message;case g:case w:return U==L+"";case f:var re=s;case v:var pe=Q&o;if(re||(re=a),U.size!=L.size&&!pe)return!1;var Y=X.get(U);if(Y)return Y==L;Q|=l,X.set(U,L);var ie=r(re(U),re(L),Q,ne,J,X);return X.delete(U),ie;case C:if(R)return R.call(U)==R.call(L)}return!1}return pG=F,pG}var mG,X2e;function $De(){if(X2e)return mG;X2e=1;function e(t,n){for(var r=-1,s=n.length,a=t.length;++r<s;)t[a+r]=n[r];return t}return mG=e,mG}var xG,Q2e;function yzt(){if(Q2e)return xG;Q2e=1;var e=$De(),t=df();function n(r,s,a){var o=s(r);return t(r)?o:e(o,a(r))}return xG=n,xG}var gG,Z2e;function vzt(){if(Z2e)return gG;Z2e=1;function e(t,n){for(var r=-1,s=t==null?0:t.length,a=0,o=[];++r<s;){var l=t[r];n(l,r,t)&&(o[a++]=l)}return o}return gG=e,gG}var bG,J2e;function wzt(){if(J2e)return bG;J2e=1;function e(){return[]}return bG=e,bG}var yG,eve;function Czt(){if(eve)return yG;eve=1;var e=vzt(),t=wzt(),n=Object.prototype,r=n.propertyIsEnumerable,s=Object.getOwnPropertySymbols,a=s?function(o){return o==null?[]:(o=Object(o),e(s(o),function(l){return r.call(o,l)}))}:t;return yG=a,yG}var vG,tve;function Szt(){if(tve)return vG;tve=1;function e(t,n){for(var r=-1,s=Array(t);++r<t;)s[r]=n(r);return s}return vG=e,vG}var wG,nve;function Nzt(){if(nve)return wG;nve=1;var e=k1(),t=T1(),n="[object Arguments]";function r(s){return t(s)&&e(s)==n}return wG=r,wG}var CG,rve;function zle(){if(rve)return CG;rve=1;var e=Nzt(),t=T1(),n=Object.prototype,r=n.hasOwnProperty,s=n.propertyIsEnumerable,a=e(function(){return arguments}())?e:function(o){return t(o)&&r.call(o,"callee")&&!s.call(o,"callee")};return CG=a,CG}var Ej={exports:{}},SG,sve;function Azt(){if(sve)return SG;sve=1;function e(){return!1}return SG=e,SG}Ej.exports;var ive;function UDe(){return ive||(ive=1,function(e,t){var n=hx(),r=Azt(),s=t&&!t.nodeType&&t,a=s&&!0&&e&&!e.nodeType&&e,o=a&&a.exports===s,l=o?n.Buffer:void 0,c=l?l.isBuffer:void 0,u=c||r;e.exports=u}(Ej,Ej.exports)),Ej.exports}var NG,ave;function Hle(){if(ave)return NG;ave=1;var e=9007199254740991,t=/^(?:0|[1-9]\d*)$/;function n(r,s){var a=typeof r;return s=s??e,!!s&&(a=="number"||a!="symbol"&&t.test(r))&&r>-1&&r%1==0&&r<s}return NG=n,NG}var AG,ove;function Vle(){if(ove)return AG;ove=1;var e=9007199254740991;function t(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=e}return AG=t,AG}var jG,lve;function jzt(){if(lve)return jG;lve=1;var e=k1(),t=Vle(),n=T1(),r="[object Arguments]",s="[object Array]",a="[object Boolean]",o="[object Date]",l="[object Error]",c="[object Function]",u="[object Map]",d="[object Number]",f="[object Object]",x="[object RegExp]",g="[object Set]",v="[object String]",w="[object WeakMap]",C="[object ArrayBuffer]",N="[object DataView]",P="[object Float32Array]",I="[object Float64Array]",R="[object Int8Array]",F="[object Int16Array]",U="[object Int32Array]",L="[object Uint8Array]",z="[object Uint8ClampedArray]",Q="[object Uint16Array]",ne="[object Uint32Array]",J={};J[P]=J[I]=J[R]=J[F]=J[U]=J[L]=J[z]=J[Q]=J[ne]=!0,J[r]=J[s]=J[C]=J[a]=J[N]=J[o]=J[l]=J[c]=J[u]=J[d]=J[f]=J[x]=J[g]=J[v]=J[w]=!1;function X(re){return n(re)&&t(re.length)&&!!J[e(re)]}return jG=X,jG}var EG,cve;function zDe(){if(cve)return EG;cve=1;function e(t){return function(n){return t(n)}}return EG=e,EG}var _j={exports:{}};_j.exports;var uve;function Ezt(){return uve||(uve=1,function(e,t){var n=oDe(),r=t&&!t.nodeType&&t,s=r&&!0&&e&&!e.nodeType&&e,a=s&&s.exports===r,o=a&&n.process,l=function(){try{var c=s&&s.require&&s.require("util").types;return c||o&&o.binding&&o.binding("util")}catch{}}();e.exports=l}(_j,_j.exports)),_j.exports}var _G,dve;function HDe(){if(dve)return _G;dve=1;var e=jzt(),t=zDe(),n=Ezt(),r=n&&n.isTypedArray,s=r?t(r):e;return _G=s,_G}var kG,fve;function _zt(){if(fve)return kG;fve=1;var e=Szt(),t=zle(),n=df(),r=UDe(),s=Hle(),a=HDe(),o=Object.prototype,l=o.hasOwnProperty;function c(u,d){var f=n(u),x=!f&&t(u),g=!f&&!x&&r(u),v=!f&&!x&&!g&&a(u),w=f||x||g||v,C=w?e(u.length,String):[],N=C.length;for(var P in u)(d||l.call(u,P))&&!(w&&(P=="length"||g&&(P=="offset"||P=="parent")||v&&(P=="buffer"||P=="byteLength"||P=="byteOffset")||s(P,N)))&&C.push(P);return C}return kG=c,kG}var TG,hve;function kzt(){if(hve)return TG;hve=1;var e=Object.prototype;function t(n){var r=n&&n.constructor,s=typeof r=="function"&&r.prototype||e;return n===s}return TG=t,TG}var IG,pve;function VDe(){if(pve)return IG;pve=1;function e(t,n){return function(r){return t(n(r))}}return IG=e,IG}var PG,mve;function Tzt(){if(mve)return PG;mve=1;var e=VDe(),t=e(Object.keys,Object);return PG=t,PG}var FG,xve;function Izt(){if(xve)return FG;xve=1;var e=kzt(),t=Tzt(),n=Object.prototype,r=n.hasOwnProperty;function s(a){if(!e(a))return t(a);var o=[];for(var l in Object(a))r.call(a,l)&&l!="constructor"&&o.push(l);return o}return FG=s,FG}var OG,gve;function cT(){if(gve)return OG;gve=1;var e=kle(),t=Vle();function n(r){return r!=null&&t(r.length)&&!e(r)}return OG=n,OG}var MG,bve;function U$(){if(bve)return MG;bve=1;var e=_zt(),t=Izt(),n=cT();function r(s){return n(s)?e(s):t(s)}return MG=r,MG}var RG,yve;function Pzt(){if(yve)return RG;yve=1;var e=yzt(),t=Czt(),n=U$();function r(s){return e(s,n,t)}return RG=r,RG}var LG,vve;function Fzt(){if(vve)return LG;vve=1;var e=Pzt(),t=1,n=Object.prototype,r=n.hasOwnProperty;function s(a,o,l,c,u,d){var f=l&t,x=e(a),g=x.length,v=e(o),w=v.length;if(g!=w&&!f)return!1;for(var C=g;C--;){var N=x[C];if(!(f?N in o:r.call(o,N)))return!1}var P=d.get(a),I=d.get(o);if(P&&I)return P==o&&I==a;var R=!0;d.set(a,o),d.set(o,a);for(var F=f;++C<g;){N=x[C];var U=a[N],L=o[N];if(c)var z=f?c(L,U,N,o,a,d):c(U,L,N,a,o,d);if(!(z===void 0?U===L||u(U,L,l,c,d):z)){R=!1;break}F||(F=N=="constructor")}if(R&&!F){var Q=a.constructor,ne=o.constructor;Q!=ne&&"constructor"in a&&"constructor"in o&&!(typeof Q=="function"&&Q instanceof Q&&typeof ne=="function"&&ne instanceof ne)&&(R=!1)}return d.delete(a),d.delete(o),R}return LG=s,LG}var DG,wve;function Ozt(){if(wve)return DG;wve=1;var e=C5(),t=hx(),n=e(t,"DataView");return DG=n,DG}var BG,Cve;function Mzt(){if(Cve)return BG;Cve=1;var e=C5(),t=hx(),n=e(t,"Promise");return BG=n,BG}var $G,Sve;function WDe(){if(Sve)return $G;Sve=1;var e=C5(),t=hx(),n=e(t,"Set");return $G=n,$G}var UG,Nve;function Rzt(){if(Nve)return UG;Nve=1;var e=C5(),t=hx(),n=e(t,"WeakMap");return UG=n,UG}var zG,Ave;function Lzt(){if(Ave)return zG;Ave=1;var e=Ozt(),t=Ile(),n=Mzt(),r=WDe(),s=Rzt(),a=k1(),o=lDe(),l="[object Map]",c="[object Object]",u="[object Promise]",d="[object Set]",f="[object WeakMap]",x="[object DataView]",g=o(e),v=o(t),w=o(n),C=o(r),N=o(s),P=a;return(e&&P(new e(new ArrayBuffer(1)))!=x||t&&P(new t)!=l||n&&P(n.resolve())!=u||r&&P(new r)!=d||s&&P(new s)!=f)&&(P=function(I){var R=a(I),F=R==c?I.constructor:void 0,U=F?o(F):"";if(U)switch(U){case g:return x;case v:return l;case w:return u;case C:return d;case N:return f}return R}),zG=P,zG}var HG,jve;function Dzt(){if(jve)return HG;jve=1;var e=MDe(),t=BDe(),n=bzt(),r=Fzt(),s=Lzt(),a=df(),o=UDe(),l=HDe(),c=1,u="[object Arguments]",d="[object Array]",f="[object Object]",x=Object.prototype,g=x.hasOwnProperty;function v(w,C,N,P,I,R){var F=a(w),U=a(C),L=F?d:s(w),z=U?d:s(C);L=L==u?f:L,z=z==u?f:z;var Q=L==f,ne=z==f,J=L==z;if(J&&o(w)){if(!o(C))return!1;F=!0,Q=!1}if(J&&!Q)return R||(R=new e),F||l(w)?t(w,C,N,P,I,R):n(w,C,L,N,P,I,R);if(!(N&c)){var X=Q&&g.call(w,"__wrapped__"),re=ne&&g.call(C,"__wrapped__");if(X||re){var pe=X?w.value():w,Y=re?C.value():C;return R||(R=new e),I(pe,Y,N,P,R)}}return J?(R||(R=new e),r(w,C,N,P,I,R)):!1}return HG=v,HG}var VG,Eve;function Wle(){if(Eve)return VG;Eve=1;var e=Dzt(),t=T1();function n(r,s,a,o,l){return r===s?!0:r==null||s==null||!t(r)&&!t(s)?r!==r&&s!==s:e(r,s,a,o,n,l)}return VG=n,VG}var WG,_ve;function Bzt(){if(_ve)return WG;_ve=1;var e=MDe(),t=Wle(),n=1,r=2;function s(a,o,l,c){var u=l.length,d=u,f=!c;if(a==null)return!d;for(a=Object(a);u--;){var x=l[u];if(f&&x[2]?x[1]!==a[x[0]]:!(x[0]in a))return!1}for(;++u<d;){x=l[u];var g=x[0],v=a[g],w=x[1];if(f&&x[2]){if(v===void 0&&!(g in a))return!1}else{var C=new e;if(c)var N=c(v,w,g,a,o,C);if(!(N===void 0?t(w,v,n|r,c,C):N))return!1}}return!0}return WG=s,WG}var qG,kve;function qDe(){if(kve)return qG;kve=1;var e=m2();function t(n){return n===n&&!e(n)}return qG=t,qG}var GG,Tve;function $zt(){if(Tve)return GG;Tve=1;var e=qDe(),t=U$();function n(r){for(var s=t(r),a=s.length;a--;){var o=s[a],l=r[o];s[a]=[o,l,e(l)]}return s}return GG=n,GG}var KG,Ive;function GDe(){if(Ive)return KG;Ive=1;function e(t,n){return function(r){return r==null?!1:r[t]===n&&(n!==void 0||t in Object(r))}}return KG=e,KG}var YG,Pve;function Uzt(){if(Pve)return YG;Pve=1;var e=Bzt(),t=$zt(),n=GDe();function r(s){var a=t(s);return a.length==1&&a[0][2]?n(a[0][0],a[0][1]):function(o){return o===s||e(o,s,a)}}return YG=r,YG}var XG,Fve;function zzt(){if(Fve)return XG;Fve=1;function e(t,n){return t!=null&&n in Object(t)}return XG=e,XG}var QG,Ove;function Hzt(){if(Ove)return QG;Ove=1;var e=dDe(),t=zle(),n=df(),r=Hle(),s=Vle(),a=M$();function o(l,c,u){c=e(c,l);for(var d=-1,f=c.length,x=!1;++d<f;){var g=a(c[d]);if(!(x=l!=null&&u(l,g)))break;l=l[g]}return x||++d!=f?x:(f=l==null?0:l.length,!!f&&s(f)&&r(g,f)&&(n(l)||t(l)))}return QG=o,QG}var ZG,Mve;function Vzt(){if(Mve)return ZG;Mve=1;var e=zzt(),t=Hzt();function n(r,s){return r!=null&&t(r,s,e)}return ZG=n,ZG}var JG,Rve;function Wzt(){if(Rve)return JG;Rve=1;var e=Wle(),t=fDe(),n=Vzt(),r=_le(),s=qDe(),a=GDe(),o=M$(),l=1,c=2;function u(d,f){return r(d)&&s(f)?a(o(d),f):function(x){var g=t(x,d);return g===void 0&&g===f?n(x,d):e(f,g,l|c)}}return JG=u,JG}var eK,Lve;function XA(){if(Lve)return eK;Lve=1;function e(t){return t}return eK=e,eK}var tK,Dve;function qzt(){if(Dve)return tK;Dve=1;function e(t){return function(n){return n==null?void 0:n[t]}}return tK=e,tK}var nK,Bve;function Gzt(){if(Bve)return nK;Bve=1;var e=Ole();function t(n){return function(r){return e(r,n)}}return nK=t,nK}var rK,$ve;function Kzt(){if($ve)return rK;$ve=1;var e=qzt(),t=Gzt(),n=_le(),r=M$();function s(a){return n(a)?e(r(a)):t(a)}return rK=s,rK}var sK,Uve;function x2(){if(Uve)return sK;Uve=1;var e=Uzt(),t=Wzt(),n=XA(),r=df(),s=Kzt();function a(o){return typeof o=="function"?o:o==null?n:typeof o=="object"?r(o)?t(o[0],o[1]):e(o):s(o)}return sK=a,sK}var iK,zve;function KDe(){if(zve)return iK;zve=1;function e(t,n,r,s){for(var a=t.length,o=r+(s?1:-1);s?o--:++o<a;)if(n(t[o],o,t))return o;return-1}return iK=e,iK}var aK,Hve;function Yzt(){if(Hve)return aK;Hve=1;function e(t){return t!==t}return aK=e,aK}var oK,Vve;function Xzt(){if(Vve)return oK;Vve=1;function e(t,n,r){for(var s=r-1,a=t.length;++s<a;)if(t[s]===n)return s;return-1}return oK=e,oK}var lK,Wve;function Qzt(){if(Wve)return lK;Wve=1;var e=KDe(),t=Yzt(),n=Xzt();function r(s,a,o){return a===a?n(s,a,o):e(s,t,o)}return lK=r,lK}var cK,qve;function Zzt(){if(qve)return cK;qve=1;var e=Qzt();function t(n,r){var s=n==null?0:n.length;return!!s&&e(n,r,0)>-1}return cK=t,cK}var uK,Gve;function Jzt(){if(Gve)return uK;Gve=1;function e(t,n,r){for(var s=-1,a=t==null?0:t.length;++s<a;)if(r(n,t[s]))return!0;return!1}return uK=e,uK}var dK,Kve;function eHt(){if(Kve)return dK;Kve=1;function e(){}return dK=e,dK}var fK,Yve;function tHt(){if(Yve)return fK;Yve=1;var e=WDe(),t=eHt(),n=Ule(),r=1/0,s=e&&1/n(new e([,-0]))[1]==r?function(a){return new e(a)}:t;return fK=s,fK}var hK,Xve;function nHt(){if(Xve)return hK;Xve=1;var e=RDe(),t=Zzt(),n=Jzt(),r=DDe(),s=tHt(),a=Ule(),o=200;function l(c,u,d){var f=-1,x=t,g=c.length,v=!0,w=[],C=w;if(d)v=!1,x=n;else if(g>=o){var N=u?null:s(c);if(N)return a(N);v=!1,x=r,C=new e}else C=u?[]:w;e:for(;++f<g;){var P=c[f],I=u?u(P):P;if(P=d||P!==0?P:0,v&&I===I){for(var R=C.length;R--;)if(C[R]===I)continue e;u&&C.push(I),w.push(P)}else x(C,I,d)||(C!==w&&C.push(I),w.push(P))}return w}return hK=l,hK}var pK,Qve;function rHt(){if(Qve)return pK;Qve=1;var e=x2(),t=nHt();function n(r,s){return r&&r.length?t(r,e(s,2)):[]}return pK=n,pK}var sHt=rHt();const Zve=Ti(sHt);function YDe(e,t,n){return t===!0?Zve(e,n):Ai(t)?Zve(e,t):e}function SN(e){"@babel/helpers - typeof";return SN=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},SN(e)}var iHt=["ref"];function Jve(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function Kx(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Jve(Object(n),!0).forEach(function(r){z$(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Jve(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function aHt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ewe(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,QDe(r.key),r)}}function oHt(e,t,n){return ewe(e.prototype,t),ewe(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function lHt(e,t,n){return t=ZR(t),cHt(e,XDe()?Reflect.construct(t,n,ZR(e).constructor):t.apply(e,n))}function cHt(e,t){if(t&&(SN(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return uHt(e)}function uHt(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function XDe(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(XDe=function(){return!!e})()}function ZR(e){return ZR=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},ZR(e)}function dHt(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&&bte(e,t)}function bte(e,t){return bte=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},bte(e,t)}function z$(e,t,n){return t=QDe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function QDe(e){var t=fHt(e,"string");return SN(t)=="symbol"?t:t+""}function fHt(e,t){if(SN(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(SN(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function hHt(e,t){if(e==null)return{};var n=pHt(e,t),r,s;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(s=0;s<a.length;s++)r=a[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function pHt(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function mHt(e){return e.value}function xHt(e,t){if(Ae.isValidElement(e))return Ae.cloneElement(e,t);if(typeof e=="function")return Ae.createElement(e,t);t.ref;var n=hHt(t,iHt);return Ae.createElement($le,n)}var twe=1,i3=function(e){function t(){var n;aHt(this,t);for(var r=arguments.length,s=new Array(r),a=0;a<r;a++)s[a]=arguments[a];return n=lHt(this,t,[].concat(s)),z$(n,"lastBoundingBox",{width:-1,height:-1}),n}return dHt(t,e),oHt(t,[{key:"componentDidMount",value:function(){this.updateBBox()}},{key:"componentDidUpdate",value:function(){this.updateBBox()}},{key:"getBBox",value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var r=this.wrapperNode.getBoundingClientRect();return r.height=this.wrapperNode.offsetHeight,r.width=this.wrapperNode.offsetWidth,r}return null}},{key:"updateBBox",value:function(){var r=this.props.onBBoxUpdate,s=this.getBBox();s?(Math.abs(s.width-this.lastBoundingBox.width)>twe||Math.abs(s.height-this.lastBoundingBox.height)>twe)&&(this.lastBoundingBox.width=s.width,this.lastBoundingBox.height=s.height,r&&r(s)):(this.lastBoundingBox.width!==-1||this.lastBoundingBox.height!==-1)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1,r&&r(null))}},{key:"getBBoxSnapshot",value:function(){return this.lastBoundingBox.width>=0&&this.lastBoundingBox.height>=0?Kx({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(r){var s=this.props,a=s.layout,o=s.align,l=s.verticalAlign,c=s.margin,u=s.chartWidth,d=s.chartHeight,f,x;if(!r||(r.left===void 0||r.left===null)&&(r.right===void 0||r.right===null))if(o==="center"&&a==="vertical"){var g=this.getBBoxSnapshot();f={left:((u||0)-g.width)/2}}else f=o==="right"?{right:c&&c.right||0}:{left:c&&c.left||0};if(!r||(r.top===void 0||r.top===null)&&(r.bottom===void 0||r.bottom===null))if(l==="middle"){var v=this.getBBoxSnapshot();x={top:((d||0)-v.height)/2}}else x=l==="bottom"?{bottom:c&&c.bottom||0}:{top:c&&c.top||0};return Kx(Kx({},f),x)}},{key:"render",value:function(){var r=this,s=this.props,a=s.content,o=s.width,l=s.height,c=s.wrapperStyle,u=s.payloadUniqBy,d=s.payload,f=Kx(Kx({position:"absolute",width:o||"auto",height:l||"auto"},this.getDefaultPosition(c)),c);return Ae.createElement("div",{className:"recharts-legend-wrapper",style:f,ref:function(g){r.wrapperNode=g}},xHt(a,Kx(Kx({},this.props),{},{payload:YDe(d,u,mHt)})))}}],[{key:"getWithHeight",value:function(r,s){var a=Kx(Kx({},this.defaultProps),r.props),o=a.layout;return o==="vertical"&&rs(r.props.height)?{height:r.props.height}:o==="horizontal"?{width:r.props.width||s}:null}}])}(m.PureComponent);z$(i3,"displayName","Legend");z$(i3,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var mK,nwe;function gHt(){if(nwe)return mK;nwe=1;var e=lT(),t=zle(),n=df(),r=e?e.isConcatSpreadable:void 0;function s(a){return n(a)||t(a)||!!(r&&a&&a[r])}return mK=s,mK}var xK,rwe;function ZDe(){if(rwe)return xK;rwe=1;var e=$De(),t=gHt();function n(r,s,a,o,l){var c=-1,u=r.length;for(a||(a=t),l||(l=[]);++c<u;){var d=r[c];s>0&&a(d)?s>1?n(d,s-1,a,o,l):e(l,d):o||(l[l.length]=d)}return l}return xK=n,xK}var gK,swe;function bHt(){if(swe)return gK;swe=1;function e(t){return function(n,r,s){for(var a=-1,o=Object(n),l=s(n),c=l.length;c--;){var u=l[t?c:++a];if(r(o[u],u,o)===!1)break}return n}}return gK=e,gK}var bK,iwe;function yHt(){if(iwe)return bK;iwe=1;var e=bHt(),t=e();return bK=t,bK}var yK,awe;function JDe(){if(awe)return yK;awe=1;var e=yHt(),t=U$();function n(r,s){return r&&e(r,s,t)}return yK=n,yK}var vK,owe;function vHt(){if(owe)return vK;owe=1;var e=cT();function t(n,r){return function(s,a){if(s==null)return s;if(!e(s))return n(s,a);for(var o=s.length,l=r?o:-1,c=Object(s);(r?l--:++l<o)&&a(c[l],l,c)!==!1;);return s}}return vK=t,vK}var wK,lwe;function qle(){if(lwe)return wK;lwe=1;var e=JDe(),t=vHt(),n=t(e);return wK=n,wK}var CK,cwe;function eBe(){if(cwe)return CK;cwe=1;var e=qle(),t=cT();function n(r,s){var a=-1,o=t(r)?Array(r.length):[];return e(r,function(l,c,u){o[++a]=s(l,c,u)}),o}return CK=n,CK}var SK,uwe;function wHt(){if(uwe)return SK;uwe=1;function e(t,n){var r=t.length;for(t.sort(n);r--;)t[r]=t[r].value;return t}return SK=e,SK}var NK,dwe;function CHt(){if(dwe)return NK;dwe=1;var e=GA();function t(n,r){if(n!==r){var s=n!==void 0,a=n===null,o=n===n,l=e(n),c=r!==void 0,u=r===null,d=r===r,f=e(r);if(!u&&!f&&!l&&n>r||l&&c&&d&&!u&&!f||a&&c&&d||!s&&d||!o)return 1;if(!a&&!l&&!f&&n<r||f&&s&&o&&!a&&!l||u&&s&&o||!c&&o||!d)return-1}return 0}return NK=t,NK}var AK,fwe;function SHt(){if(fwe)return AK;fwe=1;var e=CHt();function t(n,r,s){for(var a=-1,o=n.criteria,l=r.criteria,c=o.length,u=s.length;++a<c;){var d=e(o[a],l[a]);if(d){if(a>=u)return d;var f=s[a];return d*(f=="desc"?-1:1)}}return n.index-r.index}return AK=t,AK}var jK,hwe;function NHt(){if(hwe)return jK;hwe=1;var e=Fle(),t=Ole(),n=x2(),r=eBe(),s=wHt(),a=zDe(),o=SHt(),l=XA(),c=df();function u(d,f,x){f.length?f=e(f,function(w){return c(w)?function(C){return t(C,w.length===1?w[0]:w)}:w}):f=[l];var g=-1;f=e(f,a(n));var v=r(d,function(w,C,N){var P=e(f,function(I){return I(w)});return{criteria:P,index:++g,value:w}});return s(v,function(w,C){return o(w,C,x)})}return jK=u,jK}var EK,pwe;function AHt(){if(pwe)return EK;pwe=1;function e(t,n,r){switch(r.length){case 0:return t.call(n);case 1:return t.call(n,r[0]);case 2:return t.call(n,r[0],r[1]);case 3:return t.call(n,r[0],r[1],r[2])}return t.apply(n,r)}return EK=e,EK}var _K,mwe;function jHt(){if(mwe)return _K;mwe=1;var e=AHt(),t=Math.max;function n(r,s,a){return s=t(s===void 0?r.length-1:s,0),function(){for(var o=arguments,l=-1,c=t(o.length-s,0),u=Array(c);++l<c;)u[l]=o[s+l];l=-1;for(var d=Array(s+1);++l<s;)d[l]=o[l];return d[s]=a(u),e(r,this,d)}}return _K=n,_K}var kK,xwe;function EHt(){if(xwe)return kK;xwe=1;function e(t){return function(){return t}}return kK=e,kK}var TK,gwe;function tBe(){if(gwe)return TK;gwe=1;var e=C5(),t=function(){try{var n=e(Object,"defineProperty");return n({},"",{}),n}catch{}}();return TK=t,TK}var IK,bwe;function _Ht(){if(bwe)return IK;bwe=1;var e=EHt(),t=tBe(),n=XA(),r=t?function(s,a){return t(s,"toString",{configurable:!0,enumerable:!1,value:e(a),writable:!0})}:n;return IK=r,IK}var PK,ywe;function kHt(){if(ywe)return PK;ywe=1;var e=800,t=16,n=Date.now;function r(s){var a=0,o=0;return function(){var l=n(),c=t-(l-o);if(o=l,c>0){if(++a>=e)return arguments[0]}else a=0;return s.apply(void 0,arguments)}}return PK=r,PK}var FK,vwe;function THt(){if(vwe)return FK;vwe=1;var e=_Ht(),t=kHt(),n=t(e);return FK=n,FK}var OK,wwe;function IHt(){if(wwe)return OK;wwe=1;var e=XA(),t=jHt(),n=THt();function r(s,a){return n(t(s,a,e),s+"")}return OK=r,OK}var MK,Cwe;function H$(){if(Cwe)return MK;Cwe=1;var e=Tle(),t=cT(),n=Hle(),r=m2();function s(a,o,l){if(!r(l))return!1;var c=typeof o;return(c=="number"?t(l)&&n(o,l.length):c=="string"&&o in l)?e(l[o],a):!1}return MK=s,MK}var RK,Swe;function PHt(){if(Swe)return RK;Swe=1;var e=ZDe(),t=NHt(),n=IHt(),r=H$(),s=n(function(a,o){if(a==null)return[];var l=o.length;return l>1&&r(a,o[0],o[1])?o=[]:l>2&&r(o[0],o[1],o[2])&&(o=[o[0]]),t(a,e(o,1),[])});return RK=s,RK}var FHt=PHt();const Gle=Ti(FHt);function a_(e){"@babel/helpers - typeof";return a_=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},a_(e)}function yte(){return yte=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},yte.apply(this,arguments)}function OHt(e,t){return DHt(e)||LHt(e,t)||RHt(e,t)||MHt()}function MHt(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function RHt(e,t){if(e){if(typeof e=="string")return Nwe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Nwe(e,t)}}function Nwe(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function LHt(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,s,a,o,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(d){u=!0,s=d}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw s}}return l}}function DHt(e){if(Array.isArray(e))return e}function Awe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function LK(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Awe(Object(n),!0).forEach(function(r){BHt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Awe(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function BHt(e,t,n){return t=$Ht(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function $Ht(e){var t=UHt(e,"string");return a_(t)=="symbol"?t:t+""}function UHt(e,t){if(a_(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(a_(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function zHt(e){return Array.isArray(e)&&rc(e[0])&&rc(e[1])?e.join(" ~ "):e}var HHt=function(t){var n=t.separator,r=n===void 0?" : ":n,s=t.contentStyle,a=s===void 0?{}:s,o=t.itemStyle,l=o===void 0?{}:o,c=t.labelStyle,u=c===void 0?{}:c,d=t.payload,f=t.formatter,x=t.itemSorter,g=t.wrapperClassName,v=t.labelClassName,w=t.label,C=t.labelFormatter,N=t.accessibilityLayer,P=N===void 0?!1:N,I=function(){if(d&&d.length){var X={padding:0,margin:0},re=(x?Gle(d,x):d).map(function(pe,Y){if(pe.type==="none")return null;var ie=LK({display:"block",paddingTop:4,paddingBottom:4,color:pe.color||"#000"},l),oe=pe.formatter||f||zHt,G=pe.value,V=pe.name,ee=G,ae=V;if(ee!=null&&ae!=null){var fe=oe(G,V,pe,Y,d);if(Array.isArray(fe)){var Ne=OHt(fe,2);ee=Ne[0],ae=Ne[1]}else ee=fe}return Ae.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(Y),style:ie},rc(ae)?Ae.createElement("span",{className:"recharts-tooltip-item-name"},ae):null,rc(ae)?Ae.createElement("span",{className:"recharts-tooltip-item-separator"},r):null,Ae.createElement("span",{className:"recharts-tooltip-item-value"},ee),Ae.createElement("span",{className:"recharts-tooltip-item-unit"},pe.unit||""))});return Ae.createElement("ul",{className:"recharts-tooltip-item-list",style:X},re)}return null},R=LK({margin:0,padding:10,backgroundColor:"#fff",border:"1px solid #ccc",whiteSpace:"nowrap"},a),F=LK({margin:0},u),U=!wi(w),L=U?w:"",z=sa("recharts-default-tooltip",g),Q=sa("recharts-tooltip-label",v);U&&C&&d!==void 0&&d!==null&&(L=C(w,d));var ne=P?{role:"status","aria-live":"assertive"}:{};return Ae.createElement("div",yte({className:z,style:R},ne),Ae.createElement("p",{className:Q,style:F},Ae.isValidElement(L)?L:"".concat(L)),I())};function o_(e){"@babel/helpers - typeof";return o_=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},o_(e)}function AP(e,t,n){return t=VHt(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function VHt(e){var t=WHt(e,"string");return o_(t)=="symbol"?t:t+""}function WHt(e,t){if(o_(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(o_(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var O7="recharts-tooltip-wrapper",qHt={visibility:"hidden"};function GHt(e){var t=e.coordinate,n=e.translateX,r=e.translateY;return sa(O7,AP(AP(AP(AP({},"".concat(O7,"-right"),rs(n)&&t&&rs(t.x)&&n>=t.x),"".concat(O7,"-left"),rs(n)&&t&&rs(t.x)&&n<t.x),"".concat(O7,"-bottom"),rs(r)&&t&&rs(t.y)&&r>=t.y),"".concat(O7,"-top"),rs(r)&&t&&rs(t.y)&&r<t.y))}function jwe(e){var t=e.allowEscapeViewBox,n=e.coordinate,r=e.key,s=e.offsetTopLeft,a=e.position,o=e.reverseDirection,l=e.tooltipDimension,c=e.viewBox,u=e.viewBoxDimension;if(a&&rs(a[r]))return a[r];var d=n[r]-l-s,f=n[r]+s;if(t[r])return o[r]?d:f;if(o[r]){var x=d,g=c[r];return x<g?Math.max(f,c[r]):Math.max(d,c[r])}var v=f+l,w=c[r]+u;return v>w?Math.max(d,c[r]):Math.max(f,c[r])}function KHt(e){var t=e.translateX,n=e.translateY,r=e.useTranslate3d;return{transform:r?"translate3d(".concat(t,"px, ").concat(n,"px, 0)"):"translate(".concat(t,"px, ").concat(n,"px)")}}function YHt(e){var t=e.allowEscapeViewBox,n=e.coordinate,r=e.offsetTopLeft,s=e.position,a=e.reverseDirection,o=e.tooltipBox,l=e.useTranslate3d,c=e.viewBox,u,d,f;return o.height>0&&o.width>0&&n?(d=jwe({allowEscapeViewBox:t,coordinate:n,key:"x",offsetTopLeft:r,position:s,reverseDirection:a,tooltipDimension:o.width,viewBox:c,viewBoxDimension:c.width}),f=jwe({allowEscapeViewBox:t,coordinate:n,key:"y",offsetTopLeft:r,position:s,reverseDirection:a,tooltipDimension:o.height,viewBox:c,viewBoxDimension:c.height}),u=KHt({translateX:d,translateY:f,useTranslate3d:l})):u=qHt,{cssProperties:u,cssClasses:GHt({translateX:d,translateY:f,coordinate:n})}}function NN(e){"@babel/helpers - typeof";return NN=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},NN(e)}function Ewe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function _we(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Ewe(Object(n),!0).forEach(function(r){wte(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ewe(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function XHt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function QHt(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,rBe(r.key),r)}}function ZHt(e,t,n){return QHt(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function JHt(e,t,n){return t=JR(t),eVt(e,nBe()?Reflect.construct(t,n,JR(e).constructor):t.apply(e,n))}function eVt(e,t){if(t&&(NN(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return tVt(e)}function tVt(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function nBe(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(nBe=function(){return!!e})()}function JR(e){return JR=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},JR(e)}function nVt(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&&vte(e,t)}function vte(e,t){return vte=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},vte(e,t)}function wte(e,t,n){return t=rBe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function rBe(e){var t=rVt(e,"string");return NN(t)=="symbol"?t:t+""}function rVt(e,t){if(NN(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(NN(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var kwe=1,sVt=function(e){function t(){var n;XHt(this,t);for(var r=arguments.length,s=new Array(r),a=0;a<r;a++)s[a]=arguments[a];return n=JHt(this,t,[].concat(s)),wte(n,"state",{dismissed:!1,dismissedAtCoordinate:{x:0,y:0},lastBoundingBox:{width:-1,height:-1}}),wte(n,"handleKeyDown",function(o){if(o.key==="Escape"){var l,c,u,d;n.setState({dismissed:!0,dismissedAtCoordinate:{x:(l=(c=n.props.coordinate)===null||c===void 0?void 0:c.x)!==null&&l!==void 0?l:0,y:(u=(d=n.props.coordinate)===null||d===void 0?void 0:d.y)!==null&&u!==void 0?u:0}})}}),n}return nVt(t,e),ZHt(t,[{key:"updateBBox",value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var r=this.wrapperNode.getBoundingClientRect();(Math.abs(r.width-this.state.lastBoundingBox.width)>kwe||Math.abs(r.height-this.state.lastBoundingBox.height)>kwe)&&this.setState({lastBoundingBox:{width:r.width,height:r.height}})}else(this.state.lastBoundingBox.width!==-1||this.state.lastBoundingBox.height!==-1)&&this.setState({lastBoundingBox:{width:-1,height:-1}})}},{key:"componentDidMount",value:function(){document.addEventListener("keydown",this.handleKeyDown),this.updateBBox()}},{key:"componentWillUnmount",value:function(){document.removeEventListener("keydown",this.handleKeyDown)}},{key:"componentDidUpdate",value:function(){var r,s;this.props.active&&this.updateBBox(),this.state.dismissed&&(((r=this.props.coordinate)===null||r===void 0?void 0:r.x)!==this.state.dismissedAtCoordinate.x||((s=this.props.coordinate)===null||s===void 0?void 0:s.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}},{key:"render",value:function(){var r=this,s=this.props,a=s.active,o=s.allowEscapeViewBox,l=s.animationDuration,c=s.animationEasing,u=s.children,d=s.coordinate,f=s.hasPayload,x=s.isAnimationActive,g=s.offset,v=s.position,w=s.reverseDirection,C=s.useTranslate3d,N=s.viewBox,P=s.wrapperStyle,I=YHt({allowEscapeViewBox:o,coordinate:d,offsetTopLeft:g,position:v,reverseDirection:w,tooltipBox:this.state.lastBoundingBox,useTranslate3d:C,viewBox:N}),R=I.cssClasses,F=I.cssProperties,U=_we(_we({transition:x&&a?"transform ".concat(l,"ms ").concat(c):void 0},F),{},{pointerEvents:"none",visibility:!this.state.dismissed&&a&&f?"visible":"hidden",position:"absolute",top:0,left:0},P);return Ae.createElement("div",{tabIndex:-1,className:R,style:U,ref:function(z){r.wrapperNode=z}},u)}}])}(m.PureComponent),iVt=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},pm={isSsr:iVt(),get:function(t){return pm[t]},set:function(t,n){if(typeof t=="string")pm[t]=n;else{var r=Object.keys(t);r&&r.length&&r.forEach(function(s){pm[s]=t[s]})}}};function AN(e){"@babel/helpers - typeof";return AN=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},AN(e)}function Twe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function Iwe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Twe(Object(n),!0).forEach(function(r){Kle(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Twe(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function aVt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function oVt(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,iBe(r.key),r)}}function lVt(e,t,n){return oVt(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function cVt(e,t,n){return t=eL(t),uVt(e,sBe()?Reflect.construct(t,n||[],eL(e).constructor):t.apply(e,n))}function uVt(e,t){if(t&&(AN(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return dVt(e)}function dVt(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function sBe(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(sBe=function(){return!!e})()}function eL(e){return eL=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},eL(e)}function fVt(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&&Cte(e,t)}function Cte(e,t){return Cte=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},Cte(e,t)}function Kle(e,t,n){return t=iBe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function iBe(e){var t=hVt(e,"string");return AN(t)=="symbol"?t:t+""}function hVt(e,t){if(AN(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(AN(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function pVt(e){return e.dataKey}function mVt(e,t){return Ae.isValidElement(e)?Ae.cloneElement(e,t):typeof e=="function"?Ae.createElement(e,t):Ae.createElement(HHt,t)}var Yp=function(e){function t(){return aVt(this,t),cVt(this,t,arguments)}return fVt(t,e),lVt(t,[{key:"render",value:function(){var r=this,s=this.props,a=s.active,o=s.allowEscapeViewBox,l=s.animationDuration,c=s.animationEasing,u=s.content,d=s.coordinate,f=s.filterNull,x=s.isAnimationActive,g=s.offset,v=s.payload,w=s.payloadUniqBy,C=s.position,N=s.reverseDirection,P=s.useTranslate3d,I=s.viewBox,R=s.wrapperStyle,F=v??[];f&&F.length&&(F=YDe(v.filter(function(L){return L.value!=null&&(L.hide!==!0||r.props.includeHidden)}),w,pVt));var U=F.length>0;return Ae.createElement(sVt,{allowEscapeViewBox:o,animationDuration:l,animationEasing:c,isAnimationActive:x,active:a,coordinate:d,hasPayload:U,offset:g,position:C,reverseDirection:N,useTranslate3d:P,viewBox:I,wrapperStyle:R},mVt(u,Iwe(Iwe({},this.props),{},{payload:F})))}}])}(m.PureComponent);Kle(Yp,"displayName","Tooltip");Kle(Yp,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!pm.isSsr,itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:" : ",trigger:"hover",useTranslate3d:!1,viewBox:{x:0,y:0,height:0,width:0},wrapperStyle:{}});var DK,Pwe;function xVt(){if(Pwe)return DK;Pwe=1;var e=hx(),t=function(){return e.Date.now()};return DK=t,DK}var BK,Fwe;function gVt(){if(Fwe)return BK;Fwe=1;var e=/\s/;function t(n){for(var r=n.length;r--&&e.test(n.charAt(r)););return r}return BK=t,BK}var $K,Owe;function bVt(){if(Owe)return $K;Owe=1;var e=gVt(),t=/^\s+/;function n(r){return r&&r.slice(0,e(r)+1).replace(t,"")}return $K=n,$K}var UK,Mwe;function aBe(){if(Mwe)return UK;Mwe=1;var e=bVt(),t=m2(),n=GA(),r=NaN,s=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,o=/^0o[0-7]+$/i,l=parseInt;function c(u){if(typeof u=="number")return u;if(n(u))return r;if(t(u)){var d=typeof u.valueOf=="function"?u.valueOf():u;u=t(d)?d+"":d}if(typeof u!="string")return u===0?u:+u;u=e(u);var f=a.test(u);return f||o.test(u)?l(u.slice(2),f?2:8):s.test(u)?r:+u}return UK=c,UK}var zK,Rwe;function oBe(){if(Rwe)return zK;Rwe=1;var e=m2(),t=xVt(),n=aBe(),r="Expected a function",s=Math.max,a=Math.min;function o(l,c,u){var d,f,x,g,v,w,C=0,N=!1,P=!1,I=!0;if(typeof l!="function")throw new TypeError(r);c=n(c)||0,e(u)&&(N=!!u.leading,P="maxWait"in u,x=P?s(n(u.maxWait)||0,c):x,I="trailing"in u?!!u.trailing:I);function R(re){var pe=d,Y=f;return d=f=void 0,C=re,g=l.apply(Y,pe),g}function F(re){return C=re,v=setTimeout(z,c),N?R(re):g}function U(re){var pe=re-w,Y=re-C,ie=c-pe;return P?a(ie,x-Y):ie}function L(re){var pe=re-w,Y=re-C;return w===void 0||pe>=c||pe<0||P&&Y>=x}function z(){var re=t();if(L(re))return Q(re);v=setTimeout(z,U(re))}function Q(re){return v=void 0,I&&d?R(re):(d=f=void 0,g)}function ne(){v!==void 0&&clearTimeout(v),C=0,d=w=f=v=void 0}function J(){return v===void 0?g:Q(t())}function X(){var re=t(),pe=L(re);if(d=arguments,f=this,w=re,pe){if(v===void 0)return F(w);if(P)return clearTimeout(v),v=setTimeout(z,c),R(w)}return v===void 0&&(v=setTimeout(z,c)),g}return X.cancel=ne,X.flush=J,X}return zK=o,zK}var HK,Lwe;function yVt(){if(Lwe)return HK;Lwe=1;var e=oBe(),t=m2(),n="Expected a function";function r(s,a,o){var l=!0,c=!0;if(typeof s!="function")throw new TypeError(n);return t(o)&&(l="leading"in o?!!o.leading:l,c="trailing"in o?!!o.trailing:c),e(s,a,{leading:l,maxWait:a,trailing:c})}return HK=r,HK}var vVt=yVt();const lBe=Ti(vVt);function l_(e){"@babel/helpers - typeof";return l_=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},l_(e)}function Dwe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function jP(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Dwe(Object(n),!0).forEach(function(r){wVt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Dwe(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function wVt(e,t,n){return t=CVt(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function CVt(e){var t=SVt(e,"string");return l_(t)=="symbol"?t:t+""}function SVt(e,t){if(l_(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(l_(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function NVt(e,t){return _Vt(e)||EVt(e,t)||jVt(e,t)||AVt()}function AVt(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function jVt(e,t){if(e){if(typeof e=="string")return Bwe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Bwe(e,t)}}function Bwe(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function EVt(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,s,a,o,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(d){u=!0,s=d}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw s}}return l}}function _Vt(e){if(Array.isArray(e))return e}var cBe=m.forwardRef(function(e,t){var n=e.aspect,r=e.initialDimension,s=r===void 0?{width:-1,height:-1}:r,a=e.width,o=a===void 0?"100%":a,l=e.height,c=l===void 0?"100%":l,u=e.minWidth,d=u===void 0?0:u,f=e.minHeight,x=e.maxHeight,g=e.children,v=e.debounce,w=v===void 0?0:v,C=e.id,N=e.className,P=e.onResize,I=e.style,R=I===void 0?{}:I,F=m.useRef(null),U=m.useRef();U.current=P,m.useImperativeHandle(t,function(){return Object.defineProperty(F.current,"current",{get:function(){return console.warn("The usage of ref.current.current is deprecated and will no longer be supported."),F.current},configurable:!0})});var L=m.useState({containerWidth:s.width,containerHeight:s.height}),z=NVt(L,2),Q=z[0],ne=z[1],J=m.useCallback(function(re,pe){ne(function(Y){var ie=Math.round(re),oe=Math.round(pe);return Y.containerWidth===ie&&Y.containerHeight===oe?Y:{containerWidth:ie,containerHeight:oe}})},[]);m.useEffect(function(){var re=function(V){var ee,ae=V[0].contentRect,fe=ae.width,Ne=ae.height;J(fe,Ne),(ee=U.current)===null||ee===void 0||ee.call(U,fe,Ne)};w>0&&(re=lBe(re,w,{trailing:!0,leading:!1}));var pe=new ResizeObserver(re),Y=F.current.getBoundingClientRect(),ie=Y.width,oe=Y.height;return J(ie,oe),pe.observe(F.current),function(){pe.disconnect()}},[J,w]);var X=m.useMemo(function(){var re=Q.containerWidth,pe=Q.containerHeight;if(re<0||pe<0)return null;Qg(rw(o)||rw(c),`The width(%s) and height(%s) are both fixed numbers,
maybe you don't need to use a ResponsiveContainer.`,o,c),Qg(!n||n>0,"The aspect(%s) must be greater than zero.",n);var Y=rw(o)?re:o,ie=rw(c)?pe:c;n&&n>0&&(Y?ie=Y/n:ie&&(Y=ie*n),x&&ie>x&&(ie=x)),Qg(Y>0||ie>0,`The width(%s) and height(%s) of chart should be greater than 0,
please check the style of container, or the props width(%s) and height(%s),
or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the
height and width.`,Y,ie,o,c,d,f,n);var oe=!Array.isArray(g)&&Xg(g.type).endsWith("Chart");return Ae.Children.map(g,function(G){return Ae.isValidElement(G)?m.cloneElement(G,jP({width:Y,height:ie},oe?{style:jP({height:"100%",width:"100%",maxHeight:ie,maxWidth:Y},G.props.style)}:{})):G})},[n,g,c,x,f,d,Q,o]);return Ae.createElement("div",{id:C?"".concat(C):void 0,className:sa("recharts-responsive-container",N),style:jP(jP({},R),{},{width:o,height:c,minWidth:d,minHeight:f,maxHeight:x}),ref:F},X)}),Yle=function(t){return null};Yle.displayName="Cell";function c_(e){"@babel/helpers - typeof";return c_=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},c_(e)}function $we(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function Ste(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?$we(Object(n),!0).forEach(function(r){kVt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$we(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function kVt(e,t,n){return t=TVt(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function TVt(e){var t=IVt(e,"string");return c_(t)=="symbol"?t:t+""}function IVt(e,t){if(c_(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(c_(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var eC={widthCache:{},cacheCount:0},PVt=2e3,FVt={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},Uwe="recharts_measurement_span";function OVt(e){var t=Ste({},e);return Object.keys(t).forEach(function(n){t[n]||delete t[n]}),t}var s9=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||pm.isSsr)return{width:0,height:0};var r=OVt(n),s=JSON.stringify({text:t,copyStyle:r});if(eC.widthCache[s])return eC.widthCache[s];try{var a=document.getElementById(Uwe);a||(a=document.createElement("span"),a.setAttribute("id",Uwe),a.setAttribute("aria-hidden","true"),document.body.appendChild(a));var o=Ste(Ste({},FVt),r);Object.assign(a.style,o),a.textContent="".concat(t);var l=a.getBoundingClientRect(),c={width:l.width,height:l.height};return eC.widthCache[s]=c,++eC.cacheCount>PVt&&(eC.cacheCount=0,eC.widthCache={}),c}catch{return{width:0,height:0}}},MVt=function(t){return{top:t.top+window.scrollY-document.documentElement.clientTop,left:t.left+window.scrollX-document.documentElement.clientLeft}};function u_(e){"@babel/helpers - typeof";return u_=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},u_(e)}function tL(e,t){return BVt(e)||DVt(e,t)||LVt(e,t)||RVt()}function RVt(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function LVt(e,t){if(e){if(typeof e=="string")return zwe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return zwe(e,t)}}function zwe(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function DVt(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,s,a,o,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(d){u=!0,s=d}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw s}}return l}}function BVt(e){if(Array.isArray(e))return e}function $Vt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Hwe(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,zVt(r.key),r)}}function UVt(e,t,n){return Hwe(e.prototype,t),Hwe(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function zVt(e){var t=HVt(e,"string");return u_(t)=="symbol"?t:t+""}function HVt(e,t){if(u_(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(u_(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Vwe=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,Wwe=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,VVt=/^px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q$/,WVt=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,uBe={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},qVt=Object.keys(uBe),BC="NaN";function GVt(e,t){return e*uBe[t]}var EP=function(){function e(t,n){$Vt(this,e),this.num=t,this.unit=n,this.num=t,this.unit=n,Number.isNaN(t)&&(this.unit=""),n!==""&&!VVt.test(n)&&(this.num=NaN,this.unit=""),qVt.includes(n)&&(this.num=GVt(t,n),this.unit="px")}return UVt(e,[{key:"add",value:function(n){return this.unit!==n.unit?new e(NaN,""):new e(this.num+n.num,this.unit)}},{key:"subtract",value:function(n){return this.unit!==n.unit?new e(NaN,""):new e(this.num-n.num,this.unit)}},{key:"multiply",value:function(n){return this.unit!==""&&n.unit!==""&&this.unit!==n.unit?new e(NaN,""):new e(this.num*n.num,this.unit||n.unit)}},{key:"divide",value:function(n){return this.unit!==""&&n.unit!==""&&this.unit!==n.unit?new e(NaN,""):new e(this.num/n.num,this.unit||n.unit)}},{key:"toString",value:function(){return"".concat(this.num).concat(this.unit)}},{key:"isNaN",value:function(){return Number.isNaN(this.num)}}],[{key:"parse",value:function(n){var r,s=(r=WVt.exec(n))!==null&&r!==void 0?r:[],a=tL(s,3),o=a[1],l=a[2];return new e(parseFloat(o),l??"")}}])}();function dBe(e){if(e.includes(BC))return BC;for(var t=e;t.includes("*")||t.includes("/");){var n,r=(n=Vwe.exec(t))!==null&&n!==void 0?n:[],s=tL(r,4),a=s[1],o=s[2],l=s[3],c=EP.parse(a??""),u=EP.parse(l??""),d=o==="*"?c.multiply(u):c.divide(u);if(d.isNaN())return BC;t=t.replace(Vwe,d.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var f,x=(f=Wwe.exec(t))!==null&&f!==void 0?f:[],g=tL(x,4),v=g[1],w=g[2],C=g[3],N=EP.parse(v??""),P=EP.parse(C??""),I=w==="+"?N.add(P):N.subtract(P);if(I.isNaN())return BC;t=t.replace(Wwe,I.toString())}return t}var qwe=/\(([^()]*)\)/;function KVt(e){for(var t=e;t.includes("(");){var n=qwe.exec(t),r=tL(n,2),s=r[1];t=t.replace(qwe,dBe(s))}return t}function YVt(e){var t=e.replace(/\s+/g,"");return t=KVt(t),t=dBe(t),t}function XVt(e){try{return YVt(e)}catch{return BC}}function VK(e){var t=XVt(e.slice(5,-1));return t===BC?"":t}var QVt=["x","y","lineHeight","capHeight","scaleToFit","textAnchor","verticalAnchor","fill"],ZVt=["dx","dy","angle","className","breakAll"];function Nte(){return Nte=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Nte.apply(this,arguments)}function Gwe(e,t){if(e==null)return{};var n=JVt(e,t),r,s;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(s=0;s<a.length;s++)r=a[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function JVt(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function Kwe(e,t){return rWt(e)||nWt(e,t)||tWt(e,t)||eWt()}function eWt(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function tWt(e,t){if(e){if(typeof e=="string")return Ywe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ywe(e,t)}}function Ywe(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function nWt(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,s,a,o,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(d){u=!0,s=d}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw s}}return l}}function rWt(e){if(Array.isArray(e))return e}var fBe=/[ \f\n\r\t\v\u2028\u2029]+/,hBe=function(t){var n=t.children,r=t.breakAll,s=t.style;try{var a=[];wi(n)||(r?a=n.toString().split(""):a=n.toString().split(fBe));var o=a.map(function(c){return{word:c,width:s9(c,s).width}}),l=r?0:s9(" ",s).width;return{wordsWithComputedWidth:o,spaceWidth:l}}catch{return null}},sWt=function(t,n,r,s,a){var o=t.maxLines,l=t.children,c=t.style,u=t.breakAll,d=rs(o),f=l,x=function(){var Y=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return Y.reduce(function(ie,oe){var G=oe.word,V=oe.width,ee=ie[ie.length-1];if(ee&&(s==null||a||ee.width+V+r<Number(s)))ee.words.push(G),ee.width+=V+r;else{var ae={words:[G],width:V};ie.push(ae)}return ie},[])},g=x(n),v=function(Y){return Y.reduce(function(ie,oe){return ie.width>oe.width?ie:oe})};if(!d)return g;for(var w="…",C=function(Y){var ie=f.slice(0,Y),oe=hBe({breakAll:u,style:c,children:ie+w}).wordsWithComputedWidth,G=x(oe),V=G.length>o||v(G).width>Number(s);return[V,G]},N=0,P=f.length-1,I=0,R;N<=P&&I<=f.length-1;){var F=Math.floor((N+P)/2),U=F-1,L=C(U),z=Kwe(L,2),Q=z[0],ne=z[1],J=C(F),X=Kwe(J,1),re=X[0];if(!Q&&!re&&(N=F+1),Q&&re&&(P=F-1),!Q&&re){R=ne;break}I++}return R||g},Xwe=function(t){var n=wi(t)?[]:t.toString().split(fBe);return[{words:n}]},iWt=function(t){var n=t.width,r=t.scaleToFit,s=t.children,a=t.style,o=t.breakAll,l=t.maxLines;if((n||r)&&!pm.isSsr){var c,u,d=hBe({breakAll:o,children:s,style:a});if(d){var f=d.wordsWithComputedWidth,x=d.spaceWidth;c=f,u=x}else return Xwe(s);return sWt({breakAll:o,children:s,maxLines:l,style:a},c,u,n,r)}return Xwe(s)},Qwe="#808080",nL=function(t){var n=t.x,r=n===void 0?0:n,s=t.y,a=s===void 0?0:s,o=t.lineHeight,l=o===void 0?"1em":o,c=t.capHeight,u=c===void 0?"0.71em":c,d=t.scaleToFit,f=d===void 0?!1:d,x=t.textAnchor,g=x===void 0?"start":x,v=t.verticalAnchor,w=v===void 0?"end":v,C=t.fill,N=C===void 0?Qwe:C,P=Gwe(t,QVt),I=m.useMemo(function(){return iWt({breakAll:P.breakAll,children:P.children,maxLines:P.maxLines,scaleToFit:f,style:P.style,width:P.width})},[P.breakAll,P.children,P.maxLines,f,P.style,P.width]),R=P.dx,F=P.dy,U=P.angle,L=P.className,z=P.breakAll,Q=Gwe(P,ZVt);if(!rc(r)||!rc(a))return null;var ne=r+(rs(R)?R:0),J=a+(rs(F)?F:0),X;switch(w){case"start":X=VK("calc(".concat(u,")"));break;case"middle":X=VK("calc(".concat((I.length-1)/2," * -").concat(l," + (").concat(u," / 2))"));break;default:X=VK("calc(".concat(I.length-1," * -").concat(l,")"));break}var re=[];if(f){var pe=I[0].width,Y=P.width;re.push("scale(".concat((rs(Y)?Y/pe:1)/pe,")"))}return U&&re.push("rotate(".concat(U,", ").concat(ne,", ").concat(J,")")),re.length&&(Q.transform=re.join(" ")),Ae.createElement("text",Nte({},vi(Q,!0),{x:ne,y:J,className:sa("recharts-text",L),textAnchor:g,fill:N.includes("url")?Qwe:N}),I.map(function(ie,oe){var G=ie.words.join(z?"":" ");return Ae.createElement("tspan",{x:ne,dy:oe===0?X:l,key:"".concat(G,"-").concat(oe)},G)}))};function ky(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function aWt(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function Xle(e){let t,n,r;e.length!==2?(t=ky,n=(l,c)=>ky(e(l),c),r=(l,c)=>e(l)-c):(t=e===ky||e===aWt?e:oWt,n=e,r=e);function s(l,c,u=0,d=l.length){if(u<d){if(t(c,c)!==0)return d;do{const f=u+d>>>1;n(l[f],c)<0?u=f+1:d=f}while(u<d)}return u}function a(l,c,u=0,d=l.length){if(u<d){if(t(c,c)!==0)return d;do{const f=u+d>>>1;n(l[f],c)<=0?u=f+1:d=f}while(u<d)}return u}function o(l,c,u=0,d=l.length){const f=s(l,c,u,d-1);return f>u&&r(l[f-1],c)>-r(l[f],c)?f-1:f}return{left:s,center:o,right:a}}function oWt(){return 0}function pBe(e){return e===null?NaN:+e}function*lWt(e,t){for(let n of e)n!=null&&(n=+n)>=n&&(yield n)}const cWt=Xle(ky),uT=cWt.right;Xle(pBe).center;class Zwe extends Map{constructor(t,n=fWt){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(const[r,s]of t)this.set(r,s)}get(t){return super.get(Jwe(this,t))}has(t){return super.has(Jwe(this,t))}set(t,n){return super.set(uWt(this,t),n)}delete(t){return super.delete(dWt(this,t))}}function Jwe({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function uWt({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function dWt({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function fWt(e){return e!==null&&typeof e=="object"?e.valueOf():e}function hWt(e=ky){if(e===ky)return mBe;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,n)=>{const r=e(t,n);return r||r===0?r:(e(n,n)===0)-(e(t,t)===0)}}function mBe(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}const pWt=Math.sqrt(50),mWt=Math.sqrt(10),xWt=Math.sqrt(2);function rL(e,t,n){const r=(t-e)/Math.max(0,n),s=Math.floor(Math.log10(r)),a=r/Math.pow(10,s),o=a>=pWt?10:a>=mWt?5:a>=xWt?2:1;let l,c,u;return s<0?(u=Math.pow(10,-s)/o,l=Math.round(e*u),c=Math.round(t*u),l/u<e&&++l,c/u>t&&--c,u=-u):(u=Math.pow(10,s)*o,l=Math.round(e/u),c=Math.round(t/u),l*u<e&&++l,c*u>t&&--c),c<l&&.5<=n&&n<2?rL(e,t,n*2):[l,c,u]}function Ate(e,t,n){if(t=+t,e=+e,n=+n,!(n>0))return[];if(e===t)return[e];const r=t<e,[s,a,o]=r?rL(t,e,n):rL(e,t,n);if(!(a>=s))return[];const l=a-s+1,c=new Array(l);if(r)if(o<0)for(let u=0;u<l;++u)c[u]=(a-u)/-o;else for(let u=0;u<l;++u)c[u]=(a-u)*o;else if(o<0)for(let u=0;u<l;++u)c[u]=(s+u)/-o;else for(let u=0;u<l;++u)c[u]=(s+u)*o;return c}function jte(e,t,n){return t=+t,e=+e,n=+n,rL(e,t,n)[2]}function Ete(e,t,n){t=+t,e=+e,n=+n;const r=t<e,s=r?jte(t,e,n):jte(e,t,n);return(r?-1:1)*(s<0?1/-s:s)}function e3e(e,t){let n;for(const r of e)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);return n}function t3e(e,t){let n;for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);return n}function xBe(e,t,n=0,r=1/0,s){if(t=Math.floor(t),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(e.length-1,r)),!(n<=t&&t<=r))return e;for(s=s===void 0?mBe:hWt(s);r>n;){if(r-n>600){const c=r-n+1,u=t-n+1,d=Math.log(c),f=.5*Math.exp(2*d/3),x=.5*Math.sqrt(d*f*(c-f)/c)*(u-c/2<0?-1:1),g=Math.max(n,Math.floor(t-u*f/c+x)),v=Math.min(r,Math.floor(t+(c-u)*f/c+x));xBe(e,t,g,v,s)}const a=e[t];let o=n,l=r;for(M7(e,n,t),s(e[r],a)>0&&M7(e,n,r);o<l;){for(M7(e,o,l),++o,--l;s(e[o],a)<0;)++o;for(;s(e[l],a)>0;)--l}s(e[n],a)===0?M7(e,n,l):(++l,M7(e,l,r)),l<=t&&(n=l+1),t<=l&&(r=l-1)}return e}function M7(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function gWt(e,t,n){if(e=Float64Array.from(lWt(e)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return t3e(e);if(t>=1)return e3e(e);var r,s=(r-1)*t,a=Math.floor(s),o=e3e(xBe(e,a).subarray(0,a+1)),l=t3e(e.subarray(a+1));return o+(l-o)*(s-a)}}function bWt(e,t,n=pBe){if(!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return+n(e[0],0,e);if(t>=1)return+n(e[r-1],r-1,e);var r,s=(r-1)*t,a=Math.floor(s),o=+n(e[a],a,e),l=+n(e[a+1],a+1,e);return o+(l-o)*(s-a)}}function yWt(e,t,n){e=+e,t=+t,n=(s=arguments.length)<2?(t=e,e=0,1):s<3?1:+n;for(var r=-1,s=Math.max(0,Math.ceil((t-e)/n))|0,a=new Array(s);++r<s;)a[r]=e+r*n;return a}function pp(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function I1(e,t){switch(arguments.length){case 0:break;case 1:{typeof e=="function"?this.interpolator(e):this.range(e);break}default:{this.domain(e),typeof t=="function"?this.interpolator(t):this.range(t);break}}return this}const _te=Symbol("implicit");function Qle(){var e=new Zwe,t=[],n=[],r=_te;function s(a){let o=e.get(a);if(o===void 0){if(r!==_te)return r;e.set(a,o=t.push(a)-1)}return n[o%n.length]}return s.domain=function(a){if(!arguments.length)return t.slice();t=[],e=new Zwe;for(const o of a)e.has(o)||e.set(o,t.push(o)-1);return s},s.range=function(a){return arguments.length?(n=Array.from(a),s):n.slice()},s.unknown=function(a){return arguments.length?(r=a,s):r},s.copy=function(){return Qle(t,n).unknown(r)},pp.apply(s,arguments),s}function d_(){var e=Qle().unknown(void 0),t=e.domain,n=e.range,r=0,s=1,a,o,l=!1,c=0,u=0,d=.5;delete e.unknown;function f(){var x=t().length,g=s<r,v=g?s:r,w=g?r:s;a=(w-v)/Math.max(1,x-c+u*2),l&&(a=Math.floor(a)),v+=(w-v-a*(x-c))*d,o=a*(1-c),l&&(v=Math.round(v),o=Math.round(o));var C=yWt(x).map(function(N){return v+a*N});return n(g?C.reverse():C)}return e.domain=function(x){return arguments.length?(t(x),f()):t()},e.range=function(x){return arguments.length?([r,s]=x,r=+r,s=+s,f()):[r,s]},e.rangeRound=function(x){return[r,s]=x,r=+r,s=+s,l=!0,f()},e.bandwidth=function(){return o},e.step=function(){return a},e.round=function(x){return arguments.length?(l=!!x,f()):l},e.padding=function(x){return arguments.length?(c=Math.min(1,u=+x),f()):c},e.paddingInner=function(x){return arguments.length?(c=Math.min(1,x),f()):c},e.paddingOuter=function(x){return arguments.length?(u=+x,f()):u},e.align=function(x){return arguments.length?(d=Math.max(0,Math.min(1,x)),f()):d},e.copy=function(){return d_(t(),[r,s]).round(l).paddingInner(c).paddingOuter(u).align(d)},pp.apply(f(),arguments)}function gBe(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return gBe(t())},e}function i9(){return gBe(d_.apply(null,arguments).paddingInner(1))}function Zle(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function bBe(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function dT(){}var f_=.7,sL=1/f_,p4="\\s*([+-]?\\d+)\\s*",h_="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",U0="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",vWt=/^#([0-9a-f]{3,8})$/,wWt=new RegExp(`^rgb\\(${p4},${p4},${p4}\\)$`),CWt=new RegExp(`^rgb\\(${U0},${U0},${U0}\\)$`),SWt=new RegExp(`^rgba\\(${p4},${p4},${p4},${h_}\\)$`),NWt=new RegExp(`^rgba\\(${U0},${U0},${U0},${h_}\\)$`),AWt=new RegExp(`^hsl\\(${h_},${U0},${U0}\\)$`),jWt=new RegExp(`^hsla\\(${h_},${U0},${U0},${h_}\\)$`),n3e={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};Zle(dT,p_,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:r3e,formatHex:r3e,formatHex8:EWt,formatHsl:_Wt,formatRgb:s3e,toString:s3e});function r3e(){return this.rgb().formatHex()}function EWt(){return this.rgb().formatHex8()}function _Wt(){return yBe(this).formatHsl()}function s3e(){return this.rgb().formatRgb()}function p_(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=vWt.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?i3e(t):n===3?new Zd(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?_P(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?_P(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=wWt.exec(e))?new Zd(t[1],t[2],t[3],1):(t=CWt.exec(e))?new Zd(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=SWt.exec(e))?_P(t[1],t[2],t[3],t[4]):(t=NWt.exec(e))?_P(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=AWt.exec(e))?l3e(t[1],t[2]/100,t[3]/100,1):(t=jWt.exec(e))?l3e(t[1],t[2]/100,t[3]/100,t[4]):n3e.hasOwnProperty(e)?i3e(n3e[e]):e==="transparent"?new Zd(NaN,NaN,NaN,0):null}function i3e(e){return new Zd(e>>16&255,e>>8&255,e&255,1)}function _P(e,t,n,r){return r<=0&&(e=t=n=NaN),new Zd(e,t,n,r)}function kWt(e){return e instanceof dT||(e=p_(e)),e?(e=e.rgb(),new Zd(e.r,e.g,e.b,e.opacity)):new Zd}function kte(e,t,n,r){return arguments.length===1?kWt(e):new Zd(e,t,n,r??1)}function Zd(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}Zle(Zd,kte,bBe(dT,{brighter(e){return e=e==null?sL:Math.pow(sL,e),new Zd(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?f_:Math.pow(f_,e),new Zd(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Zd(a3(this.r),a3(this.g),a3(this.b),iL(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:a3e,formatHex:a3e,formatHex8:TWt,formatRgb:o3e,toString:o3e}));function a3e(){return`#${sw(this.r)}${sw(this.g)}${sw(this.b)}`}function TWt(){return`#${sw(this.r)}${sw(this.g)}${sw(this.b)}${sw((isNaN(this.opacity)?1:this.opacity)*255)}`}function o3e(){const e=iL(this.opacity);return`${e===1?"rgb(":"rgba("}${a3(this.r)}, ${a3(this.g)}, ${a3(this.b)}${e===1?")":`, ${e})`}`}function iL(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function a3(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function sw(e){return e=a3(e),(e<16?"0":"")+e.toString(16)}function l3e(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new sm(e,t,n,r)}function yBe(e){if(e instanceof sm)return new sm(e.h,e.s,e.l,e.opacity);if(e instanceof dT||(e=p_(e)),!e)return new sm;if(e instanceof sm)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,s=Math.min(t,n,r),a=Math.max(t,n,r),o=NaN,l=a-s,c=(a+s)/2;return l?(t===a?o=(n-r)/l+(n<r)*6:n===a?o=(r-t)/l+2:o=(t-n)/l+4,l/=c<.5?a+s:2-a-s,o*=60):l=c>0&&c<1?0:o,new sm(o,l,c,e.opacity)}function IWt(e,t,n,r){return arguments.length===1?yBe(e):new sm(e,t,n,r??1)}function sm(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Zle(sm,IWt,bBe(dT,{brighter(e){return e=e==null?sL:Math.pow(sL,e),new sm(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?f_:Math.pow(f_,e),new sm(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,s=2*n-r;return new Zd(WK(e>=240?e-240:e+120,s,r),WK(e,s,r),WK(e<120?e+240:e-120,s,r),this.opacity)},clamp(){return new sm(c3e(this.h),kP(this.s),kP(this.l),iL(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=iL(this.opacity);return`${e===1?"hsl(":"hsla("}${c3e(this.h)}, ${kP(this.s)*100}%, ${kP(this.l)*100}%${e===1?")":`, ${e})`}`}}));function c3e(e){return e=(e||0)%360,e<0?e+360:e}function kP(e){return Math.max(0,Math.min(1,e||0))}function WK(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const Jle=e=>()=>e;function PWt(e,t){return function(n){return e+n*t}}function FWt(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function OWt(e){return(e=+e)==1?vBe:function(t,n){return n-t?FWt(t,n,e):Jle(isNaN(t)?n:t)}}function vBe(e,t){var n=t-e;return n?PWt(e,n):Jle(isNaN(e)?t:e)}const u3e=function e(t){var n=OWt(t);function r(s,a){var o=n((s=kte(s)).r,(a=kte(a)).r),l=n(s.g,a.g),c=n(s.b,a.b),u=vBe(s.opacity,a.opacity);return function(d){return s.r=o(d),s.g=l(d),s.b=c(d),s.opacity=u(d),s+""}}return r.gamma=e,r}(1);function MWt(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),s;return function(a){for(s=0;s<n;++s)r[s]=e[s]*(1-a)+t[s]*a;return r}}function RWt(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function LWt(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,s=new Array(r),a=new Array(n),o;for(o=0;o<r;++o)s[o]=QA(e[o],t[o]);for(;o<n;++o)a[o]=t[o];return function(l){for(o=0;o<r;++o)a[o]=s[o](l);return a}}function DWt(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function aL(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function BWt(e,t){var n={},r={},s;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(s in t)s in e?n[s]=QA(e[s],t[s]):r[s]=t[s];return function(a){for(s in n)r[s]=n[s](a);return r}}var Tte=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,qK=new RegExp(Tte.source,"g");function $Wt(e){return function(){return e}}function UWt(e){return function(t){return e(t)+""}}function zWt(e,t){var n=Tte.lastIndex=qK.lastIndex=0,r,s,a,o=-1,l=[],c=[];for(e=e+"",t=t+"";(r=Tte.exec(e))&&(s=qK.exec(t));)(a=s.index)>n&&(a=t.slice(n,a),l[o]?l[o]+=a:l[++o]=a),(r=r[0])===(s=s[0])?l[o]?l[o]+=s:l[++o]=s:(l[++o]=null,c.push({i:o,x:aL(r,s)})),n=qK.lastIndex;return n<t.length&&(a=t.slice(n),l[o]?l[o]+=a:l[++o]=a),l.length<2?c[0]?UWt(c[0].x):$Wt(t):(t=c.length,function(u){for(var d=0,f;d<t;++d)l[(f=c[d]).i]=f.x(u);return l.join("")})}function QA(e,t){var n=typeof t,r;return t==null||n==="boolean"?Jle(t):(n==="number"?aL:n==="string"?(r=p_(t))?(t=r,u3e):zWt:t instanceof p_?u3e:t instanceof Date?DWt:RWt(t)?MWt:Array.isArray(t)?LWt:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?BWt:aL)(e,t)}function ece(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function HWt(e,t){t===void 0&&(t=e,e=QA);for(var n=0,r=t.length-1,s=t[0],a=new Array(r<0?0:r);n<r;)a[n]=e(s,s=t[++n]);return function(o){var l=Math.max(0,Math.min(r-1,Math.floor(o*=r)));return a[l](o-l)}}function VWt(e){return function(){return e}}function oL(e){return+e}var d3e=[0,1];function ld(e){return e}function Ite(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:VWt(isNaN(t)?NaN:.5)}function WWt(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function qWt(e,t,n){var r=e[0],s=e[1],a=t[0],o=t[1];return s<r?(r=Ite(s,r),a=n(o,a)):(r=Ite(r,s),a=n(a,o)),function(l){return a(r(l))}}function GWt(e,t,n){var r=Math.min(e.length,t.length)-1,s=new Array(r),a=new Array(r),o=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++o<r;)s[o]=Ite(e[o],e[o+1]),a[o]=n(t[o],t[o+1]);return function(l){var c=uT(e,l,1,r)-1;return a[c](s[c](l))}}function fT(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function V$(){var e=d3e,t=d3e,n=QA,r,s,a,o=ld,l,c,u;function d(){var x=Math.min(e.length,t.length);return o!==ld&&(o=WWt(e[0],e[x-1])),l=x>2?GWt:qWt,c=u=null,f}function f(x){return x==null||isNaN(x=+x)?a:(c||(c=l(e.map(r),t,n)))(r(o(x)))}return f.invert=function(x){return o(s((u||(u=l(t,e.map(r),aL)))(x)))},f.domain=function(x){return arguments.length?(e=Array.from(x,oL),d()):e.slice()},f.range=function(x){return arguments.length?(t=Array.from(x),d()):t.slice()},f.rangeRound=function(x){return t=Array.from(x),n=ece,d()},f.clamp=function(x){return arguments.length?(o=x?!0:ld,d()):o!==ld},f.interpolate=function(x){return arguments.length?(n=x,d()):n},f.unknown=function(x){return arguments.length?(a=x,f):a},function(x,g){return r=x,s=g,d()}}function tce(){return V$()(ld,ld)}function KWt(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function lL(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var n,r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function jN(e){return e=lL(Math.abs(e)),e?e[1]:NaN}function YWt(e,t){return function(n,r){for(var s=n.length,a=[],o=0,l=e[0],c=0;s>0&&l>0&&(c+l+1>r&&(l=Math.max(1,r-c)),a.push(n.substring(s-=l,s+l)),!((c+=l+1)>r));)l=e[o=(o+1)%e.length];return a.reverse().join(t)}}function XWt(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var QWt=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function m_(e){if(!(t=QWt.exec(e)))throw new Error("invalid format: "+e);var t;return new nce({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}m_.prototype=nce.prototype;function nce(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}nce.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function ZWt(e){e:for(var t=e.length,n=1,r=-1,s;n<t;++n)switch(e[n]){case".":r=s=n;break;case"0":r===0&&(r=n),s=n;break;default:if(!+e[n])break e;r>0&&(r=0);break}return r>0?e.slice(0,r)+e.slice(s+1):e}var wBe;function JWt(e,t){var n=lL(e,t);if(!n)return e+"";var r=n[0],s=n[1],a=s-(wBe=Math.max(-8,Math.min(8,Math.floor(s/3)))*3)+1,o=r.length;return a===o?r:a>o?r+new Array(a-o+1).join("0"):a>0?r.slice(0,a)+"."+r.slice(a):"0."+new Array(1-a).join("0")+lL(e,Math.max(0,t+a-1))[0]}function f3e(e,t){var n=lL(e,t);if(!n)return e+"";var r=n[0],s=n[1];return s<0?"0."+new Array(-s).join("0")+r:r.length>s+1?r.slice(0,s+1)+"."+r.slice(s+1):r+new Array(s-r.length+2).join("0")}const h3e={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:KWt,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>f3e(e*100,t),r:f3e,s:JWt,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function p3e(e){return e}var m3e=Array.prototype.map,x3e=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function eqt(e){var t=e.grouping===void 0||e.thousands===void 0?p3e:YWt(m3e.call(e.grouping,Number),e.thousands+""),n=e.currency===void 0?"":e.currency[0]+"",r=e.currency===void 0?"":e.currency[1]+"",s=e.decimal===void 0?".":e.decimal+"",a=e.numerals===void 0?p3e:XWt(m3e.call(e.numerals,String)),o=e.percent===void 0?"%":e.percent+"",l=e.minus===void 0?"−":e.minus+"",c=e.nan===void 0?"NaN":e.nan+"";function u(f){f=m_(f);var x=f.fill,g=f.align,v=f.sign,w=f.symbol,C=f.zero,N=f.width,P=f.comma,I=f.precision,R=f.trim,F=f.type;F==="n"?(P=!0,F="g"):h3e[F]||(I===void 0&&(I=12),R=!0,F="g"),(C||x==="0"&&g==="=")&&(C=!0,x="0",g="=");var U=w==="$"?n:w==="#"&&/[boxX]/.test(F)?"0"+F.toLowerCase():"",L=w==="$"?r:/[%p]/.test(F)?o:"",z=h3e[F],Q=/[defgprs%]/.test(F);I=I===void 0?6:/[gprs]/.test(F)?Math.max(1,Math.min(21,I)):Math.max(0,Math.min(20,I));function ne(J){var X=U,re=L,pe,Y,ie;if(F==="c")re=z(J)+re,J="";else{J=+J;var oe=J<0||1/J<0;if(J=isNaN(J)?c:z(Math.abs(J),I),R&&(J=ZWt(J)),oe&&+J==0&&v!=="+"&&(oe=!1),X=(oe?v==="("?v:l:v==="-"||v==="("?"":v)+X,re=(F==="s"?x3e[8+wBe/3]:"")+re+(oe&&v==="("?")":""),Q){for(pe=-1,Y=J.length;++pe<Y;)if(ie=J.charCodeAt(pe),48>ie||ie>57){re=(ie===46?s+J.slice(pe+1):J.slice(pe))+re,J=J.slice(0,pe);break}}}P&&!C&&(J=t(J,1/0));var G=X.length+J.length+re.length,V=G<N?new Array(N-G+1).join(x):"";switch(P&&C&&(J=t(V+J,V.length?N-re.length:1/0),V=""),g){case"<":J=X+J+re+V;break;case"=":J=X+V+J+re;break;case"^":J=V.slice(0,G=V.length>>1)+X+J+re+V.slice(G);break;default:J=V+X+J+re;break}return a(J)}return ne.toString=function(){return f+""},ne}function d(f,x){var g=u((f=m_(f),f.type="f",f)),v=Math.max(-8,Math.min(8,Math.floor(jN(x)/3)))*3,w=Math.pow(10,-v),C=x3e[8+v/3];return function(N){return g(w*N)+C}}return{format:u,formatPrefix:d}}var TP,rce,CBe;tqt({thousands:",",grouping:[3],currency:["$",""]});function tqt(e){return TP=eqt(e),rce=TP.format,CBe=TP.formatPrefix,TP}function nqt(e){return Math.max(0,-jN(Math.abs(e)))}function rqt(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(jN(t)/3)))*3-jN(Math.abs(e)))}function sqt(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,jN(t)-jN(e))+1}function SBe(e,t,n,r){var s=Ete(e,t,n),a;switch(r=m_(r??",f"),r.type){case"s":{var o=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(a=rqt(s,o))&&(r.precision=a),CBe(r,o)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(a=sqt(s,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=a-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(a=nqt(s))&&(r.precision=a-(r.type==="%")*2);break}}return rce(r)}function g2(e){var t=e.domain;return e.ticks=function(n){var r=t();return Ate(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var s=t();return SBe(s[0],s[s.length-1],n??10,r)},e.nice=function(n){n==null&&(n=10);var r=t(),s=0,a=r.length-1,o=r[s],l=r[a],c,u,d=10;for(l<o&&(u=o,o=l,l=u,u=s,s=a,a=u);d-- >0;){if(u=jte(o,l,n),u===c)return r[s]=o,r[a]=l,t(r);if(u>0)o=Math.floor(o/u)*u,l=Math.ceil(l/u)*u;else if(u<0)o=Math.ceil(o*u)/u,l=Math.floor(l*u)/u;else break;c=u}return e},e}function cL(){var e=tce();return e.copy=function(){return fT(e,cL())},pp.apply(e,arguments),g2(e)}function NBe(e){var t;function n(r){return r==null||isNaN(r=+r)?t:r}return n.invert=n,n.domain=n.range=function(r){return arguments.length?(e=Array.from(r,oL),n):e.slice()},n.unknown=function(r){return arguments.length?(t=r,n):t},n.copy=function(){return NBe(e).unknown(t)},e=arguments.length?Array.from(e,oL):[0,1],g2(n)}function ABe(e,t){e=e.slice();var n=0,r=e.length-1,s=e[n],a=e[r],o;return a<s&&(o=n,n=r,r=o,o=s,s=a,a=o),e[n]=t.floor(s),e[r]=t.ceil(a),e}function g3e(e){return Math.log(e)}function b3e(e){return Math.exp(e)}function iqt(e){return-Math.log(-e)}function aqt(e){return-Math.exp(-e)}function oqt(e){return isFinite(e)?+("1e"+e):e<0?0:e}function lqt(e){return e===10?oqt:e===Math.E?Math.exp:t=>Math.pow(e,t)}function cqt(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function y3e(e){return(t,n)=>-e(-t,n)}function sce(e){const t=e(g3e,b3e),n=t.domain;let r=10,s,a;function o(){return s=cqt(r),a=lqt(r),n()[0]<0?(s=y3e(s),a=y3e(a),e(iqt,aqt)):e(g3e,b3e),t}return t.base=function(l){return arguments.length?(r=+l,o()):r},t.domain=function(l){return arguments.length?(n(l),o()):n()},t.ticks=l=>{const c=n();let u=c[0],d=c[c.length-1];const f=d<u;f&&([u,d]=[d,u]);let x=s(u),g=s(d),v,w;const C=l==null?10:+l;let N=[];if(!(r%1)&&g-x<C){if(x=Math.floor(x),g=Math.ceil(g),u>0){for(;x<=g;++x)for(v=1;v<r;++v)if(w=x<0?v/a(-x):v*a(x),!(w<u)){if(w>d)break;N.push(w)}}else for(;x<=g;++x)for(v=r-1;v>=1;--v)if(w=x>0?v/a(-x):v*a(x),!(w<u)){if(w>d)break;N.push(w)}N.length*2<C&&(N=Ate(u,d,C))}else N=Ate(x,g,Math.min(g-x,C)).map(a);return f?N.reverse():N},t.tickFormat=(l,c)=>{if(l==null&&(l=10),c==null&&(c=r===10?"s":","),typeof c!="function"&&(!(r%1)&&(c=m_(c)).precision==null&&(c.trim=!0),c=rce(c)),l===1/0)return c;const u=Math.max(1,r*l/t.ticks().length);return d=>{let f=d/a(Math.round(s(d)));return f*r<r-.5&&(f*=r),f<=u?c(d):""}},t.nice=()=>n(ABe(n(),{floor:l=>a(Math.floor(s(l))),ceil:l=>a(Math.ceil(s(l)))})),t}function jBe(){const e=sce(V$()).domain([1,10]);return e.copy=()=>fT(e,jBe()).base(e.base()),pp.apply(e,arguments),e}function v3e(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function w3e(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function ice(e){var t=1,n=e(v3e(t),w3e(t));return n.constant=function(r){return arguments.length?e(v3e(t=+r),w3e(t)):t},g2(n)}function EBe(){var e=ice(V$());return e.copy=function(){return fT(e,EBe()).constant(e.constant())},pp.apply(e,arguments)}function C3e(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function uqt(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function dqt(e){return e<0?-e*e:e*e}function ace(e){var t=e(ld,ld),n=1;function r(){return n===1?e(ld,ld):n===.5?e(uqt,dqt):e(C3e(n),C3e(1/n))}return t.exponent=function(s){return arguments.length?(n=+s,r()):n},g2(t)}function oce(){var e=ace(V$());return e.copy=function(){return fT(e,oce()).exponent(e.exponent())},pp.apply(e,arguments),e}function fqt(){return oce.apply(null,arguments).exponent(.5)}function S3e(e){return Math.sign(e)*e*e}function hqt(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function _Be(){var e=tce(),t=[0,1],n=!1,r;function s(a){var o=hqt(e(a));return isNaN(o)?r:n?Math.round(o):o}return s.invert=function(a){return e.invert(S3e(a))},s.domain=function(a){return arguments.length?(e.domain(a),s):e.domain()},s.range=function(a){return arguments.length?(e.range((t=Array.from(a,oL)).map(S3e)),s):t.slice()},s.rangeRound=function(a){return s.range(a).round(!0)},s.round=function(a){return arguments.length?(n=!!a,s):n},s.clamp=function(a){return arguments.length?(e.clamp(a),s):e.clamp()},s.unknown=function(a){return arguments.length?(r=a,s):r},s.copy=function(){return _Be(e.domain(),t).round(n).clamp(e.clamp()).unknown(r)},pp.apply(s,arguments),g2(s)}function kBe(){var e=[],t=[],n=[],r;function s(){var o=0,l=Math.max(1,t.length);for(n=new Array(l-1);++o<l;)n[o-1]=bWt(e,o/l);return a}function a(o){return o==null||isNaN(o=+o)?r:t[uT(n,o)]}return a.invertExtent=function(o){var l=t.indexOf(o);return l<0?[NaN,NaN]:[l>0?n[l-1]:e[0],l<n.length?n[l]:e[e.length-1]]},a.domain=function(o){if(!arguments.length)return e.slice();e=[];for(let l of o)l!=null&&!isNaN(l=+l)&&e.push(l);return e.sort(ky),s()},a.range=function(o){return arguments.length?(t=Array.from(o),s()):t.slice()},a.unknown=function(o){return arguments.length?(r=o,a):r},a.quantiles=function(){return n.slice()},a.copy=function(){return kBe().domain(e).range(t).unknown(r)},pp.apply(a,arguments)}function TBe(){var e=0,t=1,n=1,r=[.5],s=[0,1],a;function o(c){return c!=null&&c<=c?s[uT(r,c,0,n)]:a}function l(){var c=-1;for(r=new Array(n);++c<n;)r[c]=((c+1)*t-(c-n)*e)/(n+1);return o}return o.domain=function(c){return arguments.length?([e,t]=c,e=+e,t=+t,l()):[e,t]},o.range=function(c){return arguments.length?(n=(s=Array.from(c)).length-1,l()):s.slice()},o.invertExtent=function(c){var u=s.indexOf(c);return u<0?[NaN,NaN]:u<1?[e,r[0]]:u>=n?[r[n-1],t]:[r[u-1],r[u]]},o.unknown=function(c){return arguments.length&&(a=c),o},o.thresholds=function(){return r.slice()},o.copy=function(){return TBe().domain([e,t]).range(s).unknown(a)},pp.apply(g2(o),arguments)}function IBe(){var e=[.5],t=[0,1],n,r=1;function s(a){return a!=null&&a<=a?t[uT(e,a,0,r)]:n}return s.domain=function(a){return arguments.length?(e=Array.from(a),r=Math.min(e.length,t.length-1),s):e.slice()},s.range=function(a){return arguments.length?(t=Array.from(a),r=Math.min(e.length,t.length-1),s):t.slice()},s.invertExtent=function(a){var o=t.indexOf(a);return[e[o-1],e[o]]},s.unknown=function(a){return arguments.length?(n=a,s):n},s.copy=function(){return IBe().domain(e).range(t).unknown(n)},pp.apply(s,arguments)}const GK=new Date,KK=new Date;function uc(e,t,n,r){function s(a){return e(a=arguments.length===0?new Date:new Date(+a)),a}return s.floor=a=>(e(a=new Date(+a)),a),s.ceil=a=>(e(a=new Date(a-1)),t(a,1),e(a),a),s.round=a=>{const o=s(a),l=s.ceil(a);return a-o<l-a?o:l},s.offset=(a,o)=>(t(a=new Date(+a),o==null?1:Math.floor(o)),a),s.range=(a,o,l)=>{const c=[];if(a=s.ceil(a),l=l==null?1:Math.floor(l),!(a<o)||!(l>0))return c;let u;do c.push(u=new Date(+a)),t(a,l),e(a);while(u<a&&a<o);return c},s.filter=a=>uc(o=>{if(o>=o)for(;e(o),!a(o);)o.setTime(o-1)},(o,l)=>{if(o>=o)if(l<0)for(;++l<=0;)for(;t(o,-1),!a(o););else for(;--l>=0;)for(;t(o,1),!a(o););}),n&&(s.count=(a,o)=>(GK.setTime(+a),KK.setTime(+o),e(GK),e(KK),Math.floor(n(GK,KK))),s.every=a=>(a=Math.floor(a),!isFinite(a)||!(a>0)?null:a>1?s.filter(r?o=>r(o)%a===0:o=>s.count(0,o)%a===0):s)),s}const uL=uc(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);uL.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?uc(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):uL);uL.range;const Dg=1e3,Zh=Dg*60,Bg=Zh*60,x1=Bg*24,lce=x1*7,N3e=x1*30,YK=x1*365,iw=uc(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*Dg)},(e,t)=>(t-e)/Dg,e=>e.getUTCSeconds());iw.range;const cce=uc(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Dg)},(e,t)=>{e.setTime(+e+t*Zh)},(e,t)=>(t-e)/Zh,e=>e.getMinutes());cce.range;const uce=uc(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*Zh)},(e,t)=>(t-e)/Zh,e=>e.getUTCMinutes());uce.range;const dce=uc(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Dg-e.getMinutes()*Zh)},(e,t)=>{e.setTime(+e+t*Bg)},(e,t)=>(t-e)/Bg,e=>e.getHours());dce.range;const fce=uc(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Bg)},(e,t)=>(t-e)/Bg,e=>e.getUTCHours());fce.range;const hT=uc(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Zh)/x1,e=>e.getDate()-1);hT.range;const W$=uc(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/x1,e=>e.getUTCDate()-1);W$.range;const PBe=uc(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/x1,e=>Math.floor(e/x1));PBe.range;function N5(e){return uc(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,n)=>{t.setDate(t.getDate()+n*7)},(t,n)=>(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*Zh)/lce)}const q$=N5(0),dL=N5(1),pqt=N5(2),mqt=N5(3),EN=N5(4),xqt=N5(5),gqt=N5(6);q$.range;dL.range;pqt.range;mqt.range;EN.range;xqt.range;gqt.range;function A5(e){return uc(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCDate(t.getUTCDate()+n*7)},(t,n)=>(n-t)/lce)}const G$=A5(0),fL=A5(1),bqt=A5(2),yqt=A5(3),_N=A5(4),vqt=A5(5),wqt=A5(6);G$.range;fL.range;bqt.range;yqt.range;_N.range;vqt.range;wqt.range;const hce=uc(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());hce.range;const pce=uc(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());pce.range;const g1=uc(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());g1.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:uc(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)});g1.range;const b1=uc(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());b1.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:uc(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)});b1.range;function FBe(e,t,n,r,s,a){const o=[[iw,1,Dg],[iw,5,5*Dg],[iw,15,15*Dg],[iw,30,30*Dg],[a,1,Zh],[a,5,5*Zh],[a,15,15*Zh],[a,30,30*Zh],[s,1,Bg],[s,3,3*Bg],[s,6,6*Bg],[s,12,12*Bg],[r,1,x1],[r,2,2*x1],[n,1,lce],[t,1,N3e],[t,3,3*N3e],[e,1,YK]];function l(u,d,f){const x=d<u;x&&([u,d]=[d,u]);const g=f&&typeof f.range=="function"?f:c(u,d,f),v=g?g.range(u,+d+1):[];return x?v.reverse():v}function c(u,d,f){const x=Math.abs(d-u)/f,g=Xle(([,,C])=>C).right(o,x);if(g===o.length)return e.every(Ete(u/YK,d/YK,f));if(g===0)return uL.every(Math.max(Ete(u,d,f),1));const[v,w]=o[x/o[g-1][2]<o[g][2]/x?g-1:g];return v.every(w)}return[l,c]}const[Cqt,Sqt]=FBe(b1,pce,G$,PBe,fce,uce),[Nqt,Aqt]=FBe(g1,hce,q$,hT,dce,cce);function XK(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function QK(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function R7(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function jqt(e){var t=e.dateTime,n=e.date,r=e.time,s=e.periods,a=e.days,o=e.shortDays,l=e.months,c=e.shortMonths,u=L7(s),d=D7(s),f=L7(a),x=D7(a),g=L7(o),v=D7(o),w=L7(l),C=D7(l),N=L7(c),P=D7(c),I={a:oe,A:G,b:V,B:ee,c:null,d:T3e,e:T3e,f:Yqt,g:iGt,G:oGt,H:qqt,I:Gqt,j:Kqt,L:OBe,m:Xqt,M:Qqt,p:ae,q:fe,Q:F3e,s:O3e,S:Zqt,u:Jqt,U:eGt,V:tGt,w:nGt,W:rGt,x:null,X:null,y:sGt,Y:aGt,Z:lGt,"%":P3e},R={a:Ne,A:he,b:ge,B:ye,c:null,d:I3e,e:I3e,f:fGt,g:CGt,G:NGt,H:cGt,I:uGt,j:dGt,L:RBe,m:hGt,M:pGt,p:ve,q:je,Q:F3e,s:O3e,S:mGt,u:xGt,U:gGt,V:bGt,w:yGt,W:vGt,x:null,X:null,y:wGt,Y:SGt,Z:AGt,"%":P3e},F={a:ne,A:J,b:X,B:re,c:pe,d:_3e,e:_3e,f:zqt,g:E3e,G:j3e,H:k3e,I:k3e,j:Dqt,L:Uqt,m:Lqt,M:Bqt,p:Q,q:Rqt,Q:Vqt,s:Wqt,S:$qt,u:Iqt,U:Pqt,V:Fqt,w:Tqt,W:Oqt,x:Y,X:ie,y:E3e,Y:j3e,Z:Mqt,"%":Hqt};I.x=U(n,I),I.X=U(r,I),I.c=U(t,I),R.x=U(n,R),R.X=U(r,R),R.c=U(t,R);function U(Ie,Le){return function(Qe){var $e=[],it=-1,tt=0,lt=Ie.length,ft,ut,qt;for(Qe instanceof Date||(Qe=new Date(+Qe));++it<lt;)Ie.charCodeAt(it)===37&&($e.push(Ie.slice(tt,it)),(ut=A3e[ft=Ie.charAt(++it)])!=null?ft=Ie.charAt(++it):ut=ft==="e"?" ":"0",(qt=Le[ft])&&(ft=qt(Qe,ut)),$e.push(ft),tt=it+1);return $e.push(Ie.slice(tt,it)),$e.join("")}}function L(Ie,Le){return function(Qe){var $e=R7(1900,void 0,1),it=z($e,Ie,Qe+="",0),tt,lt;if(it!=Qe.length)return null;if("Q"in $e)return new Date($e.Q);if("s"in $e)return new Date($e.s*1e3+("L"in $e?$e.L:0));if(Le&&!("Z"in $e)&&($e.Z=0),"p"in $e&&($e.H=$e.H%12+$e.p*12),$e.m===void 0&&($e.m="q"in $e?$e.q:0),"V"in $e){if($e.V<1||$e.V>53)return null;"w"in $e||($e.w=1),"Z"in $e?(tt=QK(R7($e.y,0,1)),lt=tt.getUTCDay(),tt=lt>4||lt===0?fL.ceil(tt):fL(tt),tt=W$.offset(tt,($e.V-1)*7),$e.y=tt.getUTCFullYear(),$e.m=tt.getUTCMonth(),$e.d=tt.getUTCDate()+($e.w+6)%7):(tt=XK(R7($e.y,0,1)),lt=tt.getDay(),tt=lt>4||lt===0?dL.ceil(tt):dL(tt),tt=hT.offset(tt,($e.V-1)*7),$e.y=tt.getFullYear(),$e.m=tt.getMonth(),$e.d=tt.getDate()+($e.w+6)%7)}else("W"in $e||"U"in $e)&&("w"in $e||($e.w="u"in $e?$e.u%7:"W"in $e?1:0),lt="Z"in $e?QK(R7($e.y,0,1)).getUTCDay():XK(R7($e.y,0,1)).getDay(),$e.m=0,$e.d="W"in $e?($e.w+6)%7+$e.W*7-(lt+5)%7:$e.w+$e.U*7-(lt+6)%7);return"Z"in $e?($e.H+=$e.Z/100|0,$e.M+=$e.Z%100,QK($e)):XK($e)}}function z(Ie,Le,Qe,$e){for(var it=0,tt=Le.length,lt=Qe.length,ft,ut;it<tt;){if($e>=lt)return-1;if(ft=Le.charCodeAt(it++),ft===37){if(ft=Le.charAt(it++),ut=F[ft in A3e?Le.charAt(it++):ft],!ut||($e=ut(Ie,Qe,$e))<0)return-1}else if(ft!=Qe.charCodeAt($e++))return-1}return $e}function Q(Ie,Le,Qe){var $e=u.exec(Le.slice(Qe));return $e?(Ie.p=d.get($e[0].toLowerCase()),Qe+$e[0].length):-1}function ne(Ie,Le,Qe){var $e=g.exec(Le.slice(Qe));return $e?(Ie.w=v.get($e[0].toLowerCase()),Qe+$e[0].length):-1}function J(Ie,Le,Qe){var $e=f.exec(Le.slice(Qe));return $e?(Ie.w=x.get($e[0].toLowerCase()),Qe+$e[0].length):-1}function X(Ie,Le,Qe){var $e=N.exec(Le.slice(Qe));return $e?(Ie.m=P.get($e[0].toLowerCase()),Qe+$e[0].length):-1}function re(Ie,Le,Qe){var $e=w.exec(Le.slice(Qe));return $e?(Ie.m=C.get($e[0].toLowerCase()),Qe+$e[0].length):-1}function pe(Ie,Le,Qe){return z(Ie,t,Le,Qe)}function Y(Ie,Le,Qe){return z(Ie,n,Le,Qe)}function ie(Ie,Le,Qe){return z(Ie,r,Le,Qe)}function oe(Ie){return o[Ie.getDay()]}function G(Ie){return a[Ie.getDay()]}function V(Ie){return c[Ie.getMonth()]}function ee(Ie){return l[Ie.getMonth()]}function ae(Ie){return s[+(Ie.getHours()>=12)]}function fe(Ie){return 1+~~(Ie.getMonth()/3)}function Ne(Ie){return o[Ie.getUTCDay()]}function he(Ie){return a[Ie.getUTCDay()]}function ge(Ie){return c[Ie.getUTCMonth()]}function ye(Ie){return l[Ie.getUTCMonth()]}function ve(Ie){return s[+(Ie.getUTCHours()>=12)]}function je(Ie){return 1+~~(Ie.getUTCMonth()/3)}return{format:function(Ie){var Le=U(Ie+="",I);return Le.toString=function(){return Ie},Le},parse:function(Ie){var Le=L(Ie+="",!1);return Le.toString=function(){return Ie},Le},utcFormat:function(Ie){var Le=U(Ie+="",R);return Le.toString=function(){return Ie},Le},utcParse:function(Ie){var Le=L(Ie+="",!0);return Le.toString=function(){return Ie},Le}}}var A3e={"-":"",_:" ",0:"0"},Rc=/^\s*\d+/,Eqt=/^%/,_qt=/[\\^$*+?|[\]().{}]/g;function ma(e,t,n){var r=e<0?"-":"",s=(r?-e:e)+"",a=s.length;return r+(a<n?new Array(n-a+1).join(t)+s:s)}function kqt(e){return e.replace(_qt,"\\$&")}function L7(e){return new RegExp("^(?:"+e.map(kqt).join("|")+")","i")}function D7(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function Tqt(e,t,n){var r=Rc.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function Iqt(e,t,n){var r=Rc.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function Pqt(e,t,n){var r=Rc.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function Fqt(e,t,n){var r=Rc.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function Oqt(e,t,n){var r=Rc.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function j3e(e,t,n){var r=Rc.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function E3e(e,t,n){var r=Rc.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function Mqt(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function Rqt(e,t,n){var r=Rc.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function Lqt(e,t,n){var r=Rc.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function _3e(e,t,n){var r=Rc.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function Dqt(e,t,n){var r=Rc.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function k3e(e,t,n){var r=Rc.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function Bqt(e,t,n){var r=Rc.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function $qt(e,t,n){var r=Rc.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function Uqt(e,t,n){var r=Rc.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function zqt(e,t,n){var r=Rc.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function Hqt(e,t,n){var r=Eqt.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function Vqt(e,t,n){var r=Rc.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function Wqt(e,t,n){var r=Rc.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function T3e(e,t){return ma(e.getDate(),t,2)}function qqt(e,t){return ma(e.getHours(),t,2)}function Gqt(e,t){return ma(e.getHours()%12||12,t,2)}function Kqt(e,t){return ma(1+hT.count(g1(e),e),t,3)}function OBe(e,t){return ma(e.getMilliseconds(),t,3)}function Yqt(e,t){return OBe(e,t)+"000"}function Xqt(e,t){return ma(e.getMonth()+1,t,2)}function Qqt(e,t){return ma(e.getMinutes(),t,2)}function Zqt(e,t){return ma(e.getSeconds(),t,2)}function Jqt(e){var t=e.getDay();return t===0?7:t}function eGt(e,t){return ma(q$.count(g1(e)-1,e),t,2)}function MBe(e){var t=e.getDay();return t>=4||t===0?EN(e):EN.ceil(e)}function tGt(e,t){return e=MBe(e),ma(EN.count(g1(e),e)+(g1(e).getDay()===4),t,2)}function nGt(e){return e.getDay()}function rGt(e,t){return ma(dL.count(g1(e)-1,e),t,2)}function sGt(e,t){return ma(e.getFullYear()%100,t,2)}function iGt(e,t){return e=MBe(e),ma(e.getFullYear()%100,t,2)}function aGt(e,t){return ma(e.getFullYear()%1e4,t,4)}function oGt(e,t){var n=e.getDay();return e=n>=4||n===0?EN(e):EN.ceil(e),ma(e.getFullYear()%1e4,t,4)}function lGt(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+ma(t/60|0,"0",2)+ma(t%60,"0",2)}function I3e(e,t){return ma(e.getUTCDate(),t,2)}function cGt(e,t){return ma(e.getUTCHours(),t,2)}function uGt(e,t){return ma(e.getUTCHours()%12||12,t,2)}function dGt(e,t){return ma(1+W$.count(b1(e),e),t,3)}function RBe(e,t){return ma(e.getUTCMilliseconds(),t,3)}function fGt(e,t){return RBe(e,t)+"000"}function hGt(e,t){return ma(e.getUTCMonth()+1,t,2)}function pGt(e,t){return ma(e.getUTCMinutes(),t,2)}function mGt(e,t){return ma(e.getUTCSeconds(),t,2)}function xGt(e){var t=e.getUTCDay();return t===0?7:t}function gGt(e,t){return ma(G$.count(b1(e)-1,e),t,2)}function LBe(e){var t=e.getUTCDay();return t>=4||t===0?_N(e):_N.ceil(e)}function bGt(e,t){return e=LBe(e),ma(_N.count(b1(e),e)+(b1(e).getUTCDay()===4),t,2)}function yGt(e){return e.getUTCDay()}function vGt(e,t){return ma(fL.count(b1(e)-1,e),t,2)}function wGt(e,t){return ma(e.getUTCFullYear()%100,t,2)}function CGt(e,t){return e=LBe(e),ma(e.getUTCFullYear()%100,t,2)}function SGt(e,t){return ma(e.getUTCFullYear()%1e4,t,4)}function NGt(e,t){var n=e.getUTCDay();return e=n>=4||n===0?_N(e):_N.ceil(e),ma(e.getUTCFullYear()%1e4,t,4)}function AGt(){return"+0000"}function P3e(){return"%"}function F3e(e){return+e}function O3e(e){return Math.floor(+e/1e3)}var tC,DBe,BBe;jGt({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function jGt(e){return tC=jqt(e),DBe=tC.format,tC.parse,BBe=tC.utcFormat,tC.utcParse,tC}function EGt(e){return new Date(e)}function _Gt(e){return e instanceof Date?+e:+new Date(+e)}function mce(e,t,n,r,s,a,o,l,c,u){var d=tce(),f=d.invert,x=d.domain,g=u(".%L"),v=u(":%S"),w=u("%I:%M"),C=u("%I %p"),N=u("%a %d"),P=u("%b %d"),I=u("%B"),R=u("%Y");function F(U){return(c(U)<U?g:l(U)<U?v:o(U)<U?w:a(U)<U?C:r(U)<U?s(U)<U?N:P:n(U)<U?I:R)(U)}return d.invert=function(U){return new Date(f(U))},d.domain=function(U){return arguments.length?x(Array.from(U,_Gt)):x().map(EGt)},d.ticks=function(U){var L=x();return e(L[0],L[L.length-1],U??10)},d.tickFormat=function(U,L){return L==null?F:u(L)},d.nice=function(U){var L=x();return(!U||typeof U.range!="function")&&(U=t(L[0],L[L.length-1],U??10)),U?x(ABe(L,U)):d},d.copy=function(){return fT(d,mce(e,t,n,r,s,a,o,l,c,u))},d}function kGt(){return pp.apply(mce(Nqt,Aqt,g1,hce,q$,hT,dce,cce,iw,DBe).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function TGt(){return pp.apply(mce(Cqt,Sqt,b1,pce,G$,W$,fce,uce,iw,BBe).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function K$(){var e=0,t=1,n,r,s,a,o=ld,l=!1,c;function u(f){return f==null||isNaN(f=+f)?c:o(s===0?.5:(f=(a(f)-n)*s,l?Math.max(0,Math.min(1,f)):f))}u.domain=function(f){return arguments.length?([e,t]=f,n=a(e=+e),r=a(t=+t),s=n===r?0:1/(r-n),u):[e,t]},u.clamp=function(f){return arguments.length?(l=!!f,u):l},u.interpolator=function(f){return arguments.length?(o=f,u):o};function d(f){return function(x){var g,v;return arguments.length?([g,v]=x,o=f(g,v),u):[o(0),o(1)]}}return u.range=d(QA),u.rangeRound=d(ece),u.unknown=function(f){return arguments.length?(c=f,u):c},function(f){return a=f,n=f(e),r=f(t),s=n===r?0:1/(r-n),u}}function b2(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function $Be(){var e=g2(K$()(ld));return e.copy=function(){return b2(e,$Be())},I1.apply(e,arguments)}function UBe(){var e=sce(K$()).domain([1,10]);return e.copy=function(){return b2(e,UBe()).base(e.base())},I1.apply(e,arguments)}function zBe(){var e=ice(K$());return e.copy=function(){return b2(e,zBe()).constant(e.constant())},I1.apply(e,arguments)}function xce(){var e=ace(K$());return e.copy=function(){return b2(e,xce()).exponent(e.exponent())},I1.apply(e,arguments)}function IGt(){return xce.apply(null,arguments).exponent(.5)}function HBe(){var e=[],t=ld;function n(r){if(r!=null&&!isNaN(r=+r))return t((uT(e,r,1)-1)/(e.length-1))}return n.domain=function(r){if(!arguments.length)return e.slice();e=[];for(let s of r)s!=null&&!isNaN(s=+s)&&e.push(s);return e.sort(ky),n},n.interpolator=function(r){return arguments.length?(t=r,n):t},n.range=function(){return e.map((r,s)=>t(s/(e.length-1)))},n.quantiles=function(r){return Array.from({length:r+1},(s,a)=>gWt(e,a/r))},n.copy=function(){return HBe(t).domain(e)},I1.apply(n,arguments)}function Y$(){var e=0,t=.5,n=1,r=1,s,a,o,l,c,u=ld,d,f=!1,x;function g(w){return isNaN(w=+w)?x:(w=.5+((w=+d(w))-a)*(r*w<r*a?l:c),u(f?Math.max(0,Math.min(1,w)):w))}g.domain=function(w){return arguments.length?([e,t,n]=w,s=d(e=+e),a=d(t=+t),o=d(n=+n),l=s===a?0:.5/(a-s),c=a===o?0:.5/(o-a),r=a<s?-1:1,g):[e,t,n]},g.clamp=function(w){return arguments.length?(f=!!w,g):f},g.interpolator=function(w){return arguments.length?(u=w,g):u};function v(w){return function(C){var N,P,I;return arguments.length?([N,P,I]=C,u=HWt(w,[N,P,I]),g):[u(0),u(.5),u(1)]}}return g.range=v(QA),g.rangeRound=v(ece),g.unknown=function(w){return arguments.length?(x=w,g):x},function(w){return d=w,s=w(e),a=w(t),o=w(n),l=s===a?0:.5/(a-s),c=a===o?0:.5/(o-a),r=a<s?-1:1,g}}function VBe(){var e=g2(Y$()(ld));return e.copy=function(){return b2(e,VBe())},I1.apply(e,arguments)}function WBe(){var e=sce(Y$()).domain([.1,1,10]);return e.copy=function(){return b2(e,WBe()).base(e.base())},I1.apply(e,arguments)}function qBe(){var e=ice(Y$());return e.copy=function(){return b2(e,qBe()).constant(e.constant())},I1.apply(e,arguments)}function gce(){var e=ace(Y$());return e.copy=function(){return b2(e,gce()).exponent(e.exponent())},I1.apply(e,arguments)}function PGt(){return gce.apply(null,arguments).exponent(.5)}const M3e=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:d_,scaleDiverging:VBe,scaleDivergingLog:WBe,scaleDivergingPow:gce,scaleDivergingSqrt:PGt,scaleDivergingSymlog:qBe,scaleIdentity:NBe,scaleImplicit:_te,scaleLinear:cL,scaleLog:jBe,scaleOrdinal:Qle,scalePoint:i9,scalePow:oce,scaleQuantile:kBe,scaleQuantize:TBe,scaleRadial:_Be,scaleSequential:$Be,scaleSequentialLog:UBe,scaleSequentialPow:xce,scaleSequentialQuantile:HBe,scaleSequentialSqrt:IGt,scaleSequentialSymlog:zBe,scaleSqrt:fqt,scaleSymlog:EBe,scaleThreshold:IBe,scaleTime:kGt,scaleUtc:TGt,tickFormat:SBe},Symbol.toStringTag,{value:"Module"}));var ZK,R3e;function GBe(){if(R3e)return ZK;R3e=1;var e=GA();function t(n,r,s){for(var a=-1,o=n.length;++a<o;){var l=n[a],c=r(l);if(c!=null&&(u===void 0?c===c&&!e(c):s(c,u)))var u=c,d=l}return d}return ZK=t,ZK}var JK,L3e;function FGt(){if(L3e)return JK;L3e=1;function e(t,n){return t>n}return JK=e,JK}var eY,D3e;function OGt(){if(D3e)return eY;D3e=1;var e=GBe(),t=FGt(),n=XA();function r(s){return s&&s.length?e(s,n,t):void 0}return eY=r,eY}var MGt=OGt();const gy=Ti(MGt);var tY,B3e;function RGt(){if(B3e)return tY;B3e=1;function e(t,n){return t<n}return tY=e,tY}var nY,$3e;function LGt(){if($3e)return nY;$3e=1;var e=GBe(),t=RGt(),n=XA();function r(s){return s&&s.length?e(s,n,t):void 0}return nY=r,nY}var DGt=LGt();const X$=Ti(DGt);var rY,U3e;function BGt(){if(U3e)return rY;U3e=1;var e=Fle(),t=x2(),n=eBe(),r=df();function s(a,o){var l=r(a)?e:n;return l(a,t(o,3))}return rY=s,rY}var sY,z3e;function $Gt(){if(z3e)return sY;z3e=1;var e=ZDe(),t=BGt();function n(r,s){return e(t(r,s),1)}return sY=n,sY}var UGt=$Gt();const zGt=Ti(UGt);var iY,H3e;function HGt(){if(H3e)return iY;H3e=1;var e=Wle();function t(n,r){return e(n,r)}return iY=t,iY}var VGt=HGt();const K3=Ti(VGt);var ZA=1e9,WGt={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},yce,Fo=!0,fp="[DecimalError] ",o3=fp+"Invalid argument: ",bce=fp+"Exponent out of range: ",JA=Math.floor,Tv=Math.pow,qGt=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Df,Nc=1e7,yo=7,KBe=9007199254740991,hL=JA(KBe/yo),ks={};ks.absoluteValue=ks.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};ks.comparedTo=ks.cmp=function(e){var t,n,r,s,a=this;if(e=new a.constructor(e),a.s!==e.s)return a.s||-e.s;if(a.e!==e.e)return a.e>e.e^a.s<0?1:-1;for(r=a.d.length,s=e.d.length,t=0,n=r<s?r:s;t<n;++t)if(a.d[t]!==e.d[t])return a.d[t]>e.d[t]^a.s<0?1:-1;return r===s?0:r>s^a.s<0?1:-1};ks.decimalPlaces=ks.dp=function(){var e=this,t=e.d.length-1,n=(t-e.e)*yo;if(t=e.d[t],t)for(;t%10==0;t/=10)n--;return n<0?0:n};ks.dividedBy=ks.div=function(e){return Zg(this,new this.constructor(e))};ks.dividedToIntegerBy=ks.idiv=function(e){var t=this,n=t.constructor;return Ya(Zg(t,new n(e),0,1),n.precision)};ks.equals=ks.eq=function(e){return!this.cmp(e)};ks.exponent=function(){return Vl(this)};ks.greaterThan=ks.gt=function(e){return this.cmp(e)>0};ks.greaterThanOrEqualTo=ks.gte=function(e){return this.cmp(e)>=0};ks.isInteger=ks.isint=function(){return this.e>this.d.length-2};ks.isNegative=ks.isneg=function(){return this.s<0};ks.isPositive=ks.ispos=function(){return this.s>0};ks.isZero=function(){return this.s===0};ks.lessThan=ks.lt=function(e){return this.cmp(e)<0};ks.lessThanOrEqualTo=ks.lte=function(e){return this.cmp(e)<1};ks.logarithm=ks.log=function(e){var t,n=this,r=n.constructor,s=r.precision,a=s+5;if(e===void 0)e=new r(10);else if(e=new r(e),e.s<1||e.eq(Df))throw Error(fp+"NaN");if(n.s<1)throw Error(fp+(n.s?"NaN":"-Infinity"));return n.eq(Df)?new r(0):(Fo=!1,t=Zg(x_(n,a),x_(e,a),a),Fo=!0,Ya(t,s))};ks.minus=ks.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?QBe(t,e):YBe(t,(e.s=-e.s,e))};ks.modulo=ks.mod=function(e){var t,n=this,r=n.constructor,s=r.precision;if(e=new r(e),!e.s)throw Error(fp+"NaN");return n.s?(Fo=!1,t=Zg(n,e,0,1).times(e),Fo=!0,n.minus(t)):Ya(new r(n),s)};ks.naturalExponential=ks.exp=function(){return XBe(this)};ks.naturalLogarithm=ks.ln=function(){return x_(this)};ks.negated=ks.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};ks.plus=ks.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?YBe(t,e):QBe(t,(e.s=-e.s,e))};ks.precision=ks.sd=function(e){var t,n,r,s=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(o3+e);if(t=Vl(s)+1,r=s.d.length-1,n=r*yo+1,r=s.d[r],r){for(;r%10==0;r/=10)n--;for(r=s.d[0];r>=10;r/=10)n++}return e&&t>n?t:n};ks.squareRoot=ks.sqrt=function(){var e,t,n,r,s,a,o,l=this,c=l.constructor;if(l.s<1){if(!l.s)return new c(0);throw Error(fp+"NaN")}for(e=Vl(l),Fo=!1,s=Math.sqrt(+l),s==0||s==1/0?(t=k0(l.d),(t.length+e)%2==0&&(t+="0"),s=Math.sqrt(t),e=JA((e+1)/2)-(e<0||e%2),s==1/0?t="5e"+e:(t=s.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),r=new c(t)):r=new c(s.toString()),n=c.precision,s=o=n+3;;)if(a=r,r=a.plus(Zg(l,a,o+2)).times(.5),k0(a.d).slice(0,o)===(t=k0(r.d)).slice(0,o)){if(t=t.slice(o-3,o+1),s==o&&t=="4999"){if(Ya(a,n+1,0),a.times(a).eq(l)){r=a;break}}else if(t!="9999")break;o+=4}return Fo=!0,Ya(r,n)};ks.times=ks.mul=function(e){var t,n,r,s,a,o,l,c,u,d=this,f=d.constructor,x=d.d,g=(e=new f(e)).d;if(!d.s||!e.s)return new f(0);for(e.s*=d.s,n=d.e+e.e,c=x.length,u=g.length,c<u&&(a=x,x=g,g=a,o=c,c=u,u=o),a=[],o=c+u,r=o;r--;)a.push(0);for(r=u;--r>=0;){for(t=0,s=c+r;s>r;)l=a[s]+g[r]*x[s-r-1]+t,a[s--]=l%Nc|0,t=l/Nc|0;a[s]=(a[s]+t)%Nc|0}for(;!a[--o];)a.pop();return t?++n:a.shift(),e.d=a,e.e=n,Fo?Ya(e,f.precision):e};ks.toDecimalPlaces=ks.todp=function(e,t){var n=this,r=n.constructor;return n=new r(n),e===void 0?n:(ix(e,0,ZA),t===void 0?t=r.rounding:ix(t,0,8),Ya(n,e+Vl(n)+1,t))};ks.toExponential=function(e,t){var n,r=this,s=r.constructor;return e===void 0?n=Y3(r,!0):(ix(e,0,ZA),t===void 0?t=s.rounding:ix(t,0,8),r=Ya(new s(r),e+1,t),n=Y3(r,!0,e+1)),n};ks.toFixed=function(e,t){var n,r,s=this,a=s.constructor;return e===void 0?Y3(s):(ix(e,0,ZA),t===void 0?t=a.rounding:ix(t,0,8),r=Ya(new a(s),e+Vl(s)+1,t),n=Y3(r.abs(),!1,e+Vl(r)+1),s.isneg()&&!s.isZero()?"-"+n:n)};ks.toInteger=ks.toint=function(){var e=this,t=e.constructor;return Ya(new t(e),Vl(e)+1,t.rounding)};ks.toNumber=function(){return+this};ks.toPower=ks.pow=function(e){var t,n,r,s,a,o,l=this,c=l.constructor,u=12,d=+(e=new c(e));if(!e.s)return new c(Df);if(l=new c(l),!l.s){if(e.s<1)throw Error(fp+"Infinity");return l}if(l.eq(Df))return l;if(r=c.precision,e.eq(Df))return Ya(l,r);if(t=e.e,n=e.d.length-1,o=t>=n,a=l.s,o){if((n=d<0?-d:d)<=KBe){for(s=new c(Df),t=Math.ceil(r/yo+4),Fo=!1;n%2&&(s=s.times(l),W3e(s.d,t)),n=JA(n/2),n!==0;)l=l.times(l),W3e(l.d,t);return Fo=!0,e.s<0?new c(Df).div(s):Ya(s,r)}}else if(a<0)throw Error(fp+"NaN");return a=a<0&&e.d[Math.max(t,n)]&1?-1:1,l.s=1,Fo=!1,s=e.times(x_(l,r+u)),Fo=!0,s=XBe(s),s.s=a,s};ks.toPrecision=function(e,t){var n,r,s=this,a=s.constructor;return e===void 0?(n=Vl(s),r=Y3(s,n<=a.toExpNeg||n>=a.toExpPos)):(ix(e,1,ZA),t===void 0?t=a.rounding:ix(t,0,8),s=Ya(new a(s),e,t),n=Vl(s),r=Y3(s,e<=n||n<=a.toExpNeg,e)),r};ks.toSignificantDigits=ks.tosd=function(e,t){var n=this,r=n.constructor;return e===void 0?(e=r.precision,t=r.rounding):(ix(e,1,ZA),t===void 0?t=r.rounding:ix(t,0,8)),Ya(new r(n),e,t)};ks.toString=ks.valueOf=ks.val=ks.toJSON=ks[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=Vl(e),n=e.constructor;return Y3(e,t<=n.toExpNeg||t>=n.toExpPos)};function YBe(e,t){var n,r,s,a,o,l,c,u,d=e.constructor,f=d.precision;if(!e.s||!t.s)return t.s||(t=new d(e)),Fo?Ya(t,f):t;if(c=e.d,u=t.d,o=e.e,s=t.e,c=c.slice(),a=o-s,a){for(a<0?(r=c,a=-a,l=u.length):(r=u,s=o,l=c.length),o=Math.ceil(f/yo),l=o>l?o+1:l+1,a>l&&(a=l,r.length=1),r.reverse();a--;)r.push(0);r.reverse()}for(l=c.length,a=u.length,l-a<0&&(a=l,r=u,u=c,c=r),n=0;a;)n=(c[--a]=c[a]+u[a]+n)/Nc|0,c[a]%=Nc;for(n&&(c.unshift(n),++s),l=c.length;c[--l]==0;)c.pop();return t.d=c,t.e=s,Fo?Ya(t,f):t}function ix(e,t,n){if(e!==~~e||e<t||e>n)throw Error(o3+e)}function k0(e){var t,n,r,s=e.length-1,a="",o=e[0];if(s>0){for(a+=o,t=1;t<s;t++)r=e[t]+"",n=yo-r.length,n&&(a+=Ib(n)),a+=r;o=e[t],r=o+"",n=yo-r.length,n&&(a+=Ib(n))}else if(o===0)return"0";for(;o%10===0;)o/=10;return a+o}var Zg=function(){function e(r,s){var a,o=0,l=r.length;for(r=r.slice();l--;)a=r[l]*s+o,r[l]=a%Nc|0,o=a/Nc|0;return o&&r.unshift(o),r}function t(r,s,a,o){var l,c;if(a!=o)c=a>o?1:-1;else for(l=c=0;l<a;l++)if(r[l]!=s[l]){c=r[l]>s[l]?1:-1;break}return c}function n(r,s,a){for(var o=0;a--;)r[a]-=o,o=r[a]<s[a]?1:0,r[a]=o*Nc+r[a]-s[a];for(;!r[0]&&r.length>1;)r.shift()}return function(r,s,a,o){var l,c,u,d,f,x,g,v,w,C,N,P,I,R,F,U,L,z,Q=r.constructor,ne=r.s==s.s?1:-1,J=r.d,X=s.d;if(!r.s)return new Q(r);if(!s.s)throw Error(fp+"Division by zero");for(c=r.e-s.e,L=X.length,F=J.length,g=new Q(ne),v=g.d=[],u=0;X[u]==(J[u]||0);)++u;if(X[u]>(J[u]||0)&&--c,a==null?P=a=Q.precision:o?P=a+(Vl(r)-Vl(s))+1:P=a,P<0)return new Q(0);if(P=P/yo+2|0,u=0,L==1)for(d=0,X=X[0],P++;(u<F||d)&&P--;u++)I=d*Nc+(J[u]||0),v[u]=I/X|0,d=I%X|0;else{for(d=Nc/(X[0]+1)|0,d>1&&(X=e(X,d),J=e(J,d),L=X.length,F=J.length),R=L,w=J.slice(0,L),C=w.length;C<L;)w[C++]=0;z=X.slice(),z.unshift(0),U=X[0],X[1]>=Nc/2&&++U;do d=0,l=t(X,w,L,C),l<0?(N=w[0],L!=C&&(N=N*Nc+(w[1]||0)),d=N/U|0,d>1?(d>=Nc&&(d=Nc-1),f=e(X,d),x=f.length,C=w.length,l=t(f,w,x,C),l==1&&(d--,n(f,L<x?z:X,x))):(d==0&&(l=d=1),f=X.slice()),x=f.length,x<C&&f.unshift(0),n(w,f,C),l==-1&&(C=w.length,l=t(X,w,L,C),l<1&&(d++,n(w,L<C?z:X,C))),C=w.length):l===0&&(d++,w=[0]),v[u++]=d,l&&w[0]?w[C++]=J[R]||0:(w=[J[R]],C=1);while((R++<F||w[0]!==void 0)&&P--)}return v[0]||v.shift(),g.e=c,Ya(g,o?a+Vl(g)+1:a)}}();function XBe(e,t){var n,r,s,a,o,l,c=0,u=0,d=e.constructor,f=d.precision;if(Vl(e)>16)throw Error(bce+Vl(e));if(!e.s)return new d(Df);for(t==null?(Fo=!1,l=f):l=t,o=new d(.03125);e.abs().gte(.1);)e=e.times(o),u+=5;for(r=Math.log(Tv(2,u))/Math.LN10*2+5|0,l+=r,n=s=a=new d(Df),d.precision=l;;){if(s=Ya(s.times(e),l),n=n.times(++c),o=a.plus(Zg(s,n,l)),k0(o.d).slice(0,l)===k0(a.d).slice(0,l)){for(;u--;)a=Ya(a.times(a),l);return d.precision=f,t==null?(Fo=!0,Ya(a,f)):a}a=o}}function Vl(e){for(var t=e.e*yo,n=e.d[0];n>=10;n/=10)t++;return t}function aY(e,t,n){if(t>e.LN10.sd())throw Fo=!0,n&&(e.precision=n),Error(fp+"LN10 precision limit exceeded");return Ya(new e(e.LN10),t)}function Ib(e){for(var t="";e--;)t+="0";return t}function x_(e,t){var n,r,s,a,o,l,c,u,d,f=1,x=10,g=e,v=g.d,w=g.constructor,C=w.precision;if(g.s<1)throw Error(fp+(g.s?"NaN":"-Infinity"));if(g.eq(Df))return new w(0);if(t==null?(Fo=!1,u=C):u=t,g.eq(10))return t==null&&(Fo=!0),aY(w,u);if(u+=x,w.precision=u,n=k0(v),r=n.charAt(0),a=Vl(g),Math.abs(a)<15e14){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)g=g.times(e),n=k0(g.d),r=n.charAt(0),f++;a=Vl(g),r>1?(g=new w("0."+n),a++):g=new w(r+"."+n.slice(1))}else return c=aY(w,u+2,C).times(a+""),g=x_(new w(r+"."+n.slice(1)),u-x).plus(c),w.precision=C,t==null?(Fo=!0,Ya(g,C)):g;for(l=o=g=Zg(g.minus(Df),g.plus(Df),u),d=Ya(g.times(g),u),s=3;;){if(o=Ya(o.times(d),u),c=l.plus(Zg(o,new w(s),u)),k0(c.d).slice(0,u)===k0(l.d).slice(0,u))return l=l.times(2),a!==0&&(l=l.plus(aY(w,u+2,C).times(a+""))),l=Zg(l,new w(f),u),w.precision=C,t==null?(Fo=!0,Ya(l,C)):l;l=c,s+=2}}function V3e(e,t){var n,r,s;for((n=t.indexOf("."))>-1&&(t=t.replace(".","")),(r=t.search(/e/i))>0?(n<0&&(n=r),n+=+t.slice(r+1),t=t.substring(0,r)):n<0&&(n=t.length),r=0;t.charCodeAt(r)===48;)++r;for(s=t.length;t.charCodeAt(s-1)===48;)--s;if(t=t.slice(r,s),t){if(s-=r,n=n-r-1,e.e=JA(n/yo),e.d=[],r=(n+1)%yo,n<0&&(r+=yo),r<s){for(r&&e.d.push(+t.slice(0,r)),s-=yo;r<s;)e.d.push(+t.slice(r,r+=yo));t=t.slice(r),r=yo-t.length}else r-=s;for(;r--;)t+="0";if(e.d.push(+t),Fo&&(e.e>hL||e.e<-hL))throw Error(bce+n)}else e.s=0,e.e=0,e.d=[0];return e}function Ya(e,t,n){var r,s,a,o,l,c,u,d,f=e.d;for(o=1,a=f[0];a>=10;a/=10)o++;if(r=t-o,r<0)r+=yo,s=t,u=f[d=0];else{if(d=Math.ceil((r+1)/yo),a=f.length,d>=a)return e;for(u=a=f[d],o=1;a>=10;a/=10)o++;r%=yo,s=r-yo+o}if(n!==void 0&&(a=Tv(10,o-s-1),l=u/a%10|0,c=t<0||f[d+1]!==void 0||u%a,c=n<4?(l||c)&&(n==0||n==(e.s<0?3:2)):l>5||l==5&&(n==4||c||n==6&&(r>0?s>0?u/Tv(10,o-s):0:f[d-1])%10&1||n==(e.s<0?8:7))),t<1||!f[0])return c?(a=Vl(e),f.length=1,t=t-a-1,f[0]=Tv(10,(yo-t%yo)%yo),e.e=JA(-t/yo)||0):(f.length=1,f[0]=e.e=e.s=0),e;if(r==0?(f.length=d,a=1,d--):(f.length=d+1,a=Tv(10,yo-r),f[d]=s>0?(u/Tv(10,o-s)%Tv(10,s)|0)*a:0),c)for(;;)if(d==0){(f[0]+=a)==Nc&&(f[0]=1,++e.e);break}else{if(f[d]+=a,f[d]!=Nc)break;f[d--]=0,a=1}for(r=f.length;f[--r]===0;)f.pop();if(Fo&&(e.e>hL||e.e<-hL))throw Error(bce+Vl(e));return e}function QBe(e,t){var n,r,s,a,o,l,c,u,d,f,x=e.constructor,g=x.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new x(e),Fo?Ya(t,g):t;if(c=e.d,f=t.d,r=t.e,u=e.e,c=c.slice(),o=u-r,o){for(d=o<0,d?(n=c,o=-o,l=f.length):(n=f,r=u,l=c.length),s=Math.max(Math.ceil(g/yo),l)+2,o>s&&(o=s,n.length=1),n.reverse(),s=o;s--;)n.push(0);n.reverse()}else{for(s=c.length,l=f.length,d=s<l,d&&(l=s),s=0;s<l;s++)if(c[s]!=f[s]){d=c[s]<f[s];break}o=0}for(d&&(n=c,c=f,f=n,t.s=-t.s),l=c.length,s=f.length-l;s>0;--s)c[l++]=0;for(s=f.length;s>o;){if(c[--s]<f[s]){for(a=s;a&&c[--a]===0;)c[a]=Nc-1;--c[a],c[s]+=Nc}c[s]-=f[s]}for(;c[--l]===0;)c.pop();for(;c[0]===0;c.shift())--r;return c[0]?(t.d=c,t.e=r,Fo?Ya(t,g):t):new x(0)}function Y3(e,t,n){var r,s=Vl(e),a=k0(e.d),o=a.length;return t?(n&&(r=n-o)>0?a=a.charAt(0)+"."+a.slice(1)+Ib(r):o>1&&(a=a.charAt(0)+"."+a.slice(1)),a=a+(s<0?"e":"e+")+s):s<0?(a="0."+Ib(-s-1)+a,n&&(r=n-o)>0&&(a+=Ib(r))):s>=o?(a+=Ib(s+1-o),n&&(r=n-s-1)>0&&(a=a+"."+Ib(r))):((r=s+1)<o&&(a=a.slice(0,r)+"."+a.slice(r)),n&&(r=n-o)>0&&(s+1===o&&(a+="."),a+=Ib(r))),e.s<0?"-"+a:a}function W3e(e,t){if(e.length>t)return e.length=t,!0}function ZBe(e){var t,n,r;function s(a){var o=this;if(!(o instanceof s))return new s(a);if(o.constructor=s,a instanceof s){o.s=a.s,o.e=a.e,o.d=(a=a.d)?a.slice():a;return}if(typeof a=="number"){if(a*0!==0)throw Error(o3+a);if(a>0)o.s=1;else if(a<0)a=-a,o.s=-1;else{o.s=0,o.e=0,o.d=[0];return}if(a===~~a&&a<1e7){o.e=0,o.d=[a];return}return V3e(o,a.toString())}else if(typeof a!="string")throw Error(o3+a);if(a.charCodeAt(0)===45?(a=a.slice(1),o.s=-1):o.s=1,qGt.test(a))V3e(o,a);else throw Error(o3+a)}if(s.prototype=ks,s.ROUND_UP=0,s.ROUND_DOWN=1,s.ROUND_CEIL=2,s.ROUND_FLOOR=3,s.ROUND_HALF_UP=4,s.ROUND_HALF_DOWN=5,s.ROUND_HALF_EVEN=6,s.ROUND_HALF_CEIL=7,s.ROUND_HALF_FLOOR=8,s.clone=ZBe,s.config=s.set=GGt,e===void 0&&(e={}),e)for(r=["precision","rounding","toExpNeg","toExpPos","LN10"],t=0;t<r.length;)e.hasOwnProperty(n=r[t++])||(e[n]=this[n]);return s.config(e),s}function GGt(e){if(!e||typeof e!="object")throw Error(fp+"Object expected");var t,n,r,s=["precision",1,ZA,"rounding",0,8,"toExpNeg",-1/0,0,"toExpPos",0,1/0];for(t=0;t<s.length;t+=3)if((r=e[n=s[t]])!==void 0)if(JA(r)===r&&r>=s[t+1]&&r<=s[t+2])this[n]=r;else throw Error(o3+n+": "+r);if((r=e[n="LN10"])!==void 0)if(r==Math.LN10)this[n]=new this(r);else throw Error(o3+n+": "+r);return this}var yce=ZBe(WGt);Df=new yce(1);const za=yce;function KGt(e){return ZGt(e)||QGt(e)||XGt(e)||YGt()}function YGt(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function XGt(e,t){if(e){if(typeof e=="string")return Pte(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Pte(e,t)}}function QGt(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function ZGt(e){if(Array.isArray(e))return Pte(e)}function Pte(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var JGt=function(t){return t},JBe={"@@functional/placeholder":!0},e$e=function(t){return t===JBe},q3e=function(t){return function n(){return arguments.length===0||arguments.length===1&&e$e(arguments.length<=0?void 0:arguments[0])?n:t.apply(void 0,arguments)}},eKt=function e(t,n){return t===1?n:q3e(function(){for(var r=arguments.length,s=new Array(r),a=0;a<r;a++)s[a]=arguments[a];var o=s.filter(function(l){return l!==JBe}).length;return o>=t?n.apply(void 0,s):e(t-o,q3e(function(){for(var l=arguments.length,c=new Array(l),u=0;u<l;u++)c[u]=arguments[u];var d=s.map(function(f){return e$e(f)?c.shift():f});return n.apply(void 0,KGt(d).concat(c))}))})},Q$=function(t){return eKt(t.length,t)},Fte=function(t,n){for(var r=[],s=t;s<n;++s)r[s-t]=s;return r},tKt=Q$(function(e,t){return Array.isArray(t)?t.map(e):Object.keys(t).map(function(n){return t[n]}).map(e)}),nKt=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];if(!n.length)return JGt;var s=n.reverse(),a=s[0],o=s.slice(1);return function(){return o.reduce(function(l,c){return c(l)},a.apply(void 0,arguments))}},Ote=function(t){return Array.isArray(t)?t.reverse():t.split("").reverse.join("")},t$e=function(t){var n=null,r=null;return function(){for(var s=arguments.length,a=new Array(s),o=0;o<s;o++)a[o]=arguments[o];return n&&a.every(function(l,c){return l===n[c]})||(n=a,r=t.apply(void 0,a)),r}};function rKt(e){var t;return e===0?t=1:t=Math.floor(new za(e).abs().log(10).toNumber())+1,t}function sKt(e,t,n){for(var r=new za(e),s=0,a=[];r.lt(t)&&s<1e5;)a.push(r.toNumber()),r=r.add(n),s++;return a}var iKt=Q$(function(e,t,n){var r=+e,s=+t;return r+n*(s-r)}),aKt=Q$(function(e,t,n){var r=t-+e;return r=r||1/0,(n-e)/r}),oKt=Q$(function(e,t,n){var r=t-+e;return r=r||1/0,Math.max(0,Math.min(1,(n-e)/r))});const Z$={rangeStep:sKt,getDigitCount:rKt,interpolateNumber:iKt,uninterpolateNumber:aKt,uninterpolateTruncation:oKt};function Mte(e){return uKt(e)||cKt(e)||n$e(e)||lKt()}function lKt(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function cKt(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function uKt(e){if(Array.isArray(e))return Rte(e)}function g_(e,t){return hKt(e)||fKt(e,t)||n$e(e,t)||dKt()}function dKt(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function n$e(e,t){if(e){if(typeof e=="string")return Rte(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Rte(e,t)}}function Rte(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function fKt(e,t){if(!(typeof Symbol>"u"||!(Symbol.iterator in Object(e)))){var n=[],r=!0,s=!1,a=void 0;try{for(var o=e[Symbol.iterator](),l;!(r=(l=o.next()).done)&&(n.push(l.value),!(t&&n.length===t));r=!0);}catch(c){s=!0,a=c}finally{try{!r&&o.return!=null&&o.return()}finally{if(s)throw a}}return n}}function hKt(e){if(Array.isArray(e))return e}function r$e(e){var t=g_(e,2),n=t[0],r=t[1],s=n,a=r;return n>r&&(s=r,a=n),[s,a]}function s$e(e,t,n){if(e.lte(0))return new za(0);var r=Z$.getDigitCount(e.toNumber()),s=new za(10).pow(r),a=e.div(s),o=r!==1?.05:.1,l=new za(Math.ceil(a.div(o).toNumber())).add(n).mul(o),c=l.mul(s);return t?c:new za(Math.ceil(c))}function pKt(e,t,n){var r=1,s=new za(e);if(!s.isint()&&n){var a=Math.abs(e);a<1?(r=new za(10).pow(Z$.getDigitCount(e)-1),s=new za(Math.floor(s.div(r).toNumber())).mul(r)):a>1&&(s=new za(Math.floor(e)))}else e===0?s=new za(Math.floor((t-1)/2)):n||(s=new za(Math.floor(e)));var o=Math.floor((t-1)/2),l=nKt(tKt(function(c){return s.add(new za(c-o).mul(r)).toNumber()}),Fte);return l(0,t)}function i$e(e,t,n,r){var s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((t-e)/(n-1)))return{step:new za(0),tickMin:new za(0),tickMax:new za(0)};var a=s$e(new za(t).sub(e).div(n-1),r,s),o;e<=0&&t>=0?o=new za(0):(o=new za(e).add(t).div(2),o=o.sub(new za(o).mod(a)));var l=Math.ceil(o.sub(e).div(a).toNumber()),c=Math.ceil(new za(t).sub(o).div(a).toNumber()),u=l+c+1;return u>n?i$e(e,t,n,r,s+1):(u<n&&(c=t>0?c+(n-u):c,l=t>0?l:l+(n-u)),{step:a,tickMin:o.sub(new za(l).mul(a)),tickMax:o.add(new za(c).mul(a))})}function mKt(e){var t=g_(e,2),n=t[0],r=t[1],s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=Math.max(s,2),l=r$e([n,r]),c=g_(l,2),u=c[0],d=c[1];if(u===-1/0||d===1/0){var f=d===1/0?[u].concat(Mte(Fte(0,s-1).map(function(){return 1/0}))):[].concat(Mte(Fte(0,s-1).map(function(){return-1/0})),[d]);return n>r?Ote(f):f}if(u===d)return pKt(u,s,a);var x=i$e(u,d,o,a),g=x.step,v=x.tickMin,w=x.tickMax,C=Z$.rangeStep(v,w.add(new za(.1).mul(g)),g);return n>r?Ote(C):C}function xKt(e,t){var n=g_(e,2),r=n[0],s=n[1],a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=r$e([r,s]),l=g_(o,2),c=l[0],u=l[1];if(c===-1/0||u===1/0)return[r,s];if(c===u)return[c];var d=Math.max(t,2),f=s$e(new za(u).sub(c).div(d-1),a,0),x=[].concat(Mte(Z$.rangeStep(new za(c),new za(u).sub(new za(.99).mul(f)),f)),[u]);return r>s?Ote(x):x}var gKt=t$e(mKt),bKt=t$e(xKt),yKt="Invariant failed";function X3(e,t){throw new Error(yKt)}var vKt=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function kN(e){"@babel/helpers - typeof";return kN=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},kN(e)}function pL(){return pL=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},pL.apply(this,arguments)}function wKt(e,t){return AKt(e)||NKt(e,t)||SKt(e,t)||CKt()}function CKt(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function SKt(e,t){if(e){if(typeof e=="string")return G3e(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return G3e(e,t)}}function G3e(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function NKt(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,s,a,o,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(d){u=!0,s=d}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw s}}return l}}function AKt(e){if(Array.isArray(e))return e}function jKt(e,t){if(e==null)return{};var n=EKt(e,t),r,s;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(s=0;s<a.length;s++)r=a[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function EKt(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function _Kt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function kKt(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,l$e(r.key),r)}}function TKt(e,t,n){return kKt(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function IKt(e,t,n){return t=mL(t),PKt(e,a$e()?Reflect.construct(t,n||[],mL(e).constructor):t.apply(e,n))}function PKt(e,t){if(t&&(kN(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return FKt(e)}function FKt(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function a$e(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(a$e=function(){return!!e})()}function mL(e){return mL=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},mL(e)}function OKt(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&&Lte(e,t)}function Lte(e,t){return Lte=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},Lte(e,t)}function o$e(e,t,n){return t=l$e(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function l$e(e){var t=MKt(e,"string");return kN(t)=="symbol"?t:t+""}function MKt(e,t){if(kN(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(kN(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var e8=function(e){function t(){return _Kt(this,t),IKt(this,t,arguments)}return OKt(t,e),TKt(t,[{key:"render",value:function(){var r=this.props,s=r.offset,a=r.layout,o=r.width,l=r.dataKey,c=r.data,u=r.dataPointFormatter,d=r.xAxis,f=r.yAxis,x=jKt(r,vKt),g=vi(x,!1);this.props.direction==="x"&&d.type!=="number"&&X3();var v=c.map(function(w){var C=u(w,l),N=C.x,P=C.y,I=C.value,R=C.errorVal;if(!R)return null;var F=[],U,L;if(Array.isArray(R)){var z=wKt(R,2);U=z[0],L=z[1]}else U=L=R;if(a==="vertical"){var Q=d.scale,ne=P+s,J=ne+o,X=ne-o,re=Q(I-U),pe=Q(I+L);F.push({x1:pe,y1:J,x2:pe,y2:X}),F.push({x1:re,y1:ne,x2:pe,y2:ne}),F.push({x1:re,y1:J,x2:re,y2:X})}else if(a==="horizontal"){var Y=f.scale,ie=N+s,oe=ie-o,G=ie+o,V=Y(I-U),ee=Y(I+L);F.push({x1:oe,y1:ee,x2:G,y2:ee}),F.push({x1:ie,y1:V,x2:ie,y2:ee}),F.push({x1:oe,y1:V,x2:G,y2:V})}return Ae.createElement(Sa,pL({className:"recharts-errorBar",key:"bar-".concat(F.map(function(ae){return"".concat(ae.x1,"-").concat(ae.x2,"-").concat(ae.y1,"-").concat(ae.y2)}))},g),F.map(function(ae){return Ae.createElement("line",pL({},ae,{key:"line-".concat(ae.x1,"-").concat(ae.x2,"-").concat(ae.y1,"-").concat(ae.y2)}))}))});return Ae.createElement(Sa,{className:"recharts-errorBars"},v)}}])}(Ae.Component);o$e(e8,"defaultProps",{stroke:"black",strokeWidth:1.5,width:5,offset:0,layout:"horizontal"});o$e(e8,"displayName","ErrorBar");function b_(e){"@babel/helpers - typeof";return b_=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},b_(e)}function K3e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function dv(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?K3e(Object(n),!0).forEach(function(r){RKt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):K3e(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function RKt(e,t,n){return t=LKt(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function LKt(e){var t=DKt(e,"string");return b_(t)=="symbol"?t:t+""}function DKt(e,t){if(b_(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(b_(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var c$e=function(t){var n=t.children,r=t.formattedGraphicalItems,s=t.legendWidth,a=t.legendContent,o=Mf(n,i3);if(!o)return null;var l=i3.defaultProps,c=l!==void 0?dv(dv({},l),o.props):{},u;return o.props&&o.props.payload?u=o.props&&o.props.payload:a==="children"?u=(r||[]).reduce(function(d,f){var x=f.item,g=f.props,v=g.sectors||g.data||[];return d.concat(v.map(function(w){return{type:o.props.iconType||x.props.legendType,value:w.name,color:w.fill,payload:w}}))},[]):u=(r||[]).map(function(d){var f=d.item,x=f.type.defaultProps,g=x!==void 0?dv(dv({},x),f.props):{},v=g.dataKey,w=g.name,C=g.legendType,N=g.hide;return{inactive:N,dataKey:v,type:c.iconType||C||"square",color:vce(f),value:w||v,payload:g}}),dv(dv(dv({},c),i3.getWithHeight(o,s)),{},{payload:u,item:o})};function y_(e){"@babel/helpers - typeof";return y_=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},y_(e)}function Y3e(e){return zKt(e)||UKt(e)||$Kt(e)||BKt()}function BKt(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function $Kt(e,t){if(e){if(typeof e=="string")return Dte(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Dte(e,t)}}function UKt(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function zKt(e){if(Array.isArray(e))return Dte(e)}function Dte(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function X3e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function tl(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?X3e(Object(n),!0).forEach(function(r){m4(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):X3e(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function m4(e,t,n){return t=HKt(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function HKt(e){var t=VKt(e,"string");return y_(t)=="symbol"?t:t+""}function VKt(e,t){if(y_(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(y_(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function sc(e,t,n){return wi(e)||wi(t)?n:rc(t)?np(e,t,n):Ai(t)?t(e):n}function a9(e,t,n,r){var s=zGt(e,function(l){return sc(l,t)});if(n==="number"){var a=s.filter(function(l){return rs(l)||parseFloat(l)});return a.length?[X$(a),gy(a)]:[1/0,-1/0]}var o=r?s.filter(function(l){return!wi(l)}):s;return o.map(function(l){return rc(l)||l instanceof Date?l:""})}var WKt=function(t){var n,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],s=arguments.length>2?arguments[2]:void 0,a=arguments.length>3?arguments[3]:void 0,o=-1,l=(n=r==null?void 0:r.length)!==null&&n!==void 0?n:0;if(l<=1)return 0;if(a&&a.axisType==="angleAxis"&&Math.abs(Math.abs(a.range[1]-a.range[0])-360)<=1e-6)for(var c=a.range,u=0;u<l;u++){var d=u>0?s[u-1].coordinate:s[l-1].coordinate,f=s[u].coordinate,x=u>=l-1?s[0].coordinate:s[u+1].coordinate,g=void 0;if(lm(f-d)!==lm(x-f)){var v=[];if(lm(x-f)===lm(c[1]-c[0])){g=x;var w=f+c[1]-c[0];v[0]=Math.min(w,(w+d)/2),v[1]=Math.max(w,(w+d)/2)}else{g=d;var C=x+c[1]-c[0];v[0]=Math.min(f,(C+f)/2),v[1]=Math.max(f,(C+f)/2)}var N=[Math.min(f,(g+f)/2),Math.max(f,(g+f)/2)];if(t>N[0]&&t<=N[1]||t>=v[0]&&t<=v[1]){o=s[u].index;break}}else{var P=Math.min(d,x),I=Math.max(d,x);if(t>(P+f)/2&&t<=(I+f)/2){o=s[u].index;break}}}else for(var R=0;R<l;R++)if(R===0&&t<=(r[R].coordinate+r[R+1].coordinate)/2||R>0&&R<l-1&&t>(r[R].coordinate+r[R-1].coordinate)/2&&t<=(r[R].coordinate+r[R+1].coordinate)/2||R===l-1&&t>(r[R].coordinate+r[R-1].coordinate)/2){o=r[R].index;break}return o},vce=function(t){var n,r=t,s=r.type.displayName,a=(n=t.type)!==null&&n!==void 0&&n.defaultProps?tl(tl({},t.type.defaultProps),t.props):t.props,o=a.stroke,l=a.fill,c;switch(s){case"Line":c=o;break;case"Area":case"Radar":c=o&&o!=="none"?o:l;break;default:c=l;break}return c},qKt=function(t){var n=t.barSize,r=t.totalSize,s=t.stackGroups,a=s===void 0?{}:s;if(!a)return{};for(var o={},l=Object.keys(a),c=0,u=l.length;c<u;c++)for(var d=a[l[c]].stackGroups,f=Object.keys(d),x=0,g=f.length;x<g;x++){var v=d[f[x]],w=v.items,C=v.cateAxisId,N=w.filter(function(L){return Xg(L.type).indexOf("Bar")>=0});if(N&&N.length){var P=N[0].type.defaultProps,I=P!==void 0?tl(tl({},P),N[0].props):N[0].props,R=I.barSize,F=I[C];o[F]||(o[F]=[]);var U=wi(R)?n:R;o[F].push({item:N[0],stackList:N.slice(1),barSize:wi(U)?void 0:G3(U,r,0)})}}return o},GKt=function(t){var n=t.barGap,r=t.barCategoryGap,s=t.bandSize,a=t.sizeList,o=a===void 0?[]:a,l=t.maxBarSize,c=o.length;if(c<1)return null;var u=G3(n,s,0,!0),d,f=[];if(o[0].barSize===+o[0].barSize){var x=!1,g=s/c,v=o.reduce(function(R,F){return R+F.barSize||0},0);v+=(c-1)*u,v>=s&&(v-=(c-1)*u,u=0),v>=s&&g>0&&(x=!0,g*=.9,v=c*g);var w=(s-v)/2>>0,C={offset:w-u,size:0};d=o.reduce(function(R,F){var U={item:F.item,position:{offset:C.offset+C.size+u,size:x?g:F.barSize}},L=[].concat(Y3e(R),[U]);return C=L[L.length-1].position,F.stackList&&F.stackList.length&&F.stackList.forEach(function(z){L.push({item:z,position:C})}),L},f)}else{var N=G3(r,s,0,!0);s-2*N-(c-1)*u<=0&&(u=0);var P=(s-2*N-(c-1)*u)/c;P>1&&(P>>=0);var I=l===+l?Math.min(P,l):P;d=o.reduce(function(R,F,U){var L=[].concat(Y3e(R),[{item:F.item,position:{offset:N+(P+u)*U+(P-I)/2,size:I}}]);return F.stackList&&F.stackList.length&&F.stackList.forEach(function(z){L.push({item:z,position:L[L.length-1].position})}),L},f)}return d},KKt=function(t,n,r,s){var a=r.children,o=r.width,l=r.margin,c=o-(l.left||0)-(l.right||0),u=c$e({children:a,legendWidth:c});if(u){var d=s||{},f=d.width,x=d.height,g=u.align,v=u.verticalAlign,w=u.layout;if((w==="vertical"||w==="horizontal"&&v==="middle")&&g!=="center"&&rs(t[g]))return tl(tl({},t),{},m4({},g,t[g]+(f||0)));if((w==="horizontal"||w==="vertical"&&g==="center")&&v!=="middle"&&rs(t[v]))return tl(tl({},t),{},m4({},v,t[v]+(x||0)))}return t},YKt=function(t,n,r){return wi(n)?!0:t==="horizontal"?n==="yAxis":t==="vertical"||r==="x"?n==="xAxis":r==="y"?n==="yAxis":!0},u$e=function(t,n,r,s,a){var o=n.props.children,l=sf(o,e8).filter(function(u){return YKt(s,a,u.props.direction)});if(l&&l.length){var c=l.map(function(u){return u.props.dataKey});return t.reduce(function(u,d){var f=sc(d,r);if(wi(f))return u;var x=Array.isArray(f)?[X$(f),gy(f)]:[f,f],g=c.reduce(function(v,w){var C=sc(d,w,0),N=x[0]-Math.abs(Array.isArray(C)?C[0]:C),P=x[1]+Math.abs(Array.isArray(C)?C[1]:C);return[Math.min(N,v[0]),Math.max(P,v[1])]},[1/0,-1/0]);return[Math.min(g[0],u[0]),Math.max(g[1],u[1])]},[1/0,-1/0])}return null},XKt=function(t,n,r,s,a){var o=n.map(function(l){return u$e(t,l,r,a,s)}).filter(function(l){return!wi(l)});return o&&o.length?o.reduce(function(l,c){return[Math.min(l[0],c[0]),Math.max(l[1],c[1])]},[1/0,-1/0]):null},d$e=function(t,n,r,s,a){var o=n.map(function(c){var u=c.props.dataKey;return r==="number"&&u&&u$e(t,c,u,s)||a9(t,u,r,a)});if(r==="number")return o.reduce(function(c,u){return[Math.min(c[0],u[0]),Math.max(c[1],u[1])]},[1/0,-1/0]);var l={};return o.reduce(function(c,u){for(var d=0,f=u.length;d<f;d++)l[u[d]]||(l[u[d]]=!0,c.push(u[d]));return c},[])},f$e=function(t,n){return t==="horizontal"&&n==="xAxis"||t==="vertical"&&n==="yAxis"||t==="centric"&&n==="angleAxis"||t==="radial"&&n==="radiusAxis"},h$e=function(t,n,r,s){if(s)return t.map(function(c){return c.coordinate});var a,o,l=t.map(function(c){return c.coordinate===n&&(a=!0),c.coordinate===r&&(o=!0),c.coordinate});return a||l.push(n),o||l.push(r),l},$g=function(t,n,r){if(!t)return null;var s=t.scale,a=t.duplicateDomain,o=t.type,l=t.range,c=t.realScaleType==="scaleBand"?s.bandwidth()/2:2,u=(n||r)&&o==="category"&&s.bandwidth?s.bandwidth()/c:0;if(u=t.axisType==="angleAxis"&&(l==null?void 0:l.length)>=2?lm(l[0]-l[1])*2*u:u,n&&(t.ticks||t.niceTicks)){var d=(t.ticks||t.niceTicks).map(function(f){var x=a?a.indexOf(f):f;return{coordinate:s(x)+u,value:f,offset:u}});return d.filter(function(f){return!YA(f.coordinate)})}return t.isCategorical&&t.categoricalDomain?t.categoricalDomain.map(function(f,x){return{coordinate:s(f)+u,value:f,index:x,offset:u}}):s.ticks&&!r?s.ticks(t.tickCount).map(function(f){return{coordinate:s(f)+u,value:f,offset:u}}):s.domain().map(function(f,x){return{coordinate:s(f)+u,value:a?a[f]:f,index:x,offset:u}})},oY=new WeakMap,IP=function(t,n){if(typeof n!="function")return t;oY.has(t)||oY.set(t,new WeakMap);var r=oY.get(t);if(r.has(n))return r.get(n);var s=function(){t.apply(void 0,arguments),n.apply(void 0,arguments)};return r.set(n,s),s},QKt=function(t,n,r){var s=t.scale,a=t.type,o=t.layout,l=t.axisType;if(s==="auto")return o==="radial"&&l==="radiusAxis"?{scale:d_(),realScaleType:"band"}:o==="radial"&&l==="angleAxis"?{scale:cL(),realScaleType:"linear"}:a==="category"&&n&&(n.indexOf("LineChart")>=0||n.indexOf("AreaChart")>=0||n.indexOf("ComposedChart")>=0&&!r)?{scale:i9(),realScaleType:"point"}:a==="category"?{scale:d_(),realScaleType:"band"}:{scale:cL(),realScaleType:"linear"};if(q3(s)){var c="scale".concat(R$(s));return{scale:(M3e[c]||i9)(),realScaleType:M3e[c]?c:"point"}}return Ai(s)?{scale:s}:{scale:i9(),realScaleType:"point"}},Q3e=1e-4,ZKt=function(t){var n=t.domain();if(!(!n||n.length<=2)){var r=n.length,s=t.range(),a=Math.min(s[0],s[1])-Q3e,o=Math.max(s[0],s[1])+Q3e,l=t(n[0]),c=t(n[r-1]);(l<a||l>o||c<a||c>o)&&t.domain([n[0],n[r-1]])}},JKt=function(t,n){if(!t)return null;for(var r=0,s=t.length;r<s;r++)if(t[r].item===n)return t[r].position;return null},eYt=function(t,n){if(!n||n.length!==2||!rs(n[0])||!rs(n[1]))return t;var r=Math.min(n[0],n[1]),s=Math.max(n[0],n[1]),a=[t[0],t[1]];return(!rs(t[0])||t[0]<r)&&(a[0]=r),(!rs(t[1])||t[1]>s)&&(a[1]=s),a[0]>s&&(a[0]=s),a[1]<r&&(a[1]=r),a},tYt=function(t){var n=t.length;if(!(n<=0))for(var r=0,s=t[0].length;r<s;++r)for(var a=0,o=0,l=0;l<n;++l){var c=YA(t[l][r][1])?t[l][r][0]:t[l][r][1];c>=0?(t[l][r][0]=a,t[l][r][1]=a+c,a=t[l][r][1]):(t[l][r][0]=o,t[l][r][1]=o+c,o=t[l][r][1])}},nYt=function(t){var n=t.length;if(!(n<=0))for(var r=0,s=t[0].length;r<s;++r)for(var a=0,o=0;o<n;++o){var l=YA(t[o][r][1])?t[o][r][0]:t[o][r][1];l>=0?(t[o][r][0]=a,t[o][r][1]=a+l,a=t[o][r][1]):(t[o][r][0]=0,t[o][r][1]=0)}},rYt={sign:tYt,expand:UUt,none:wN,silhouette:zUt,wiggle:HUt,positive:nYt},sYt=function(t,n,r){var s=n.map(function(l){return l.props.dataKey}),a=rYt[r],o=$Ut().keys(s).value(function(l,c){return+sc(l,c,0)}).order(pte).offset(a);return o(t)},iYt=function(t,n,r,s,a,o){if(!t)return null;var l=o?n.reverse():n,c={},u=l.reduce(function(f,x){var g,v=(g=x.type)!==null&&g!==void 0&&g.defaultProps?tl(tl({},x.type.defaultProps),x.props):x.props,w=v.stackId,C=v.hide;if(C)return f;var N=v[r],P=f[N]||{hasStack:!1,stackGroups:{}};if(rc(w)){var I=P.stackGroups[w]||{numericAxisId:r,cateAxisId:s,items:[]};I.items.push(x),P.hasStack=!0,P.stackGroups[w]=I}else P.stackGroups[S5("_stackId_")]={numericAxisId:r,cateAxisId:s,items:[x]};return tl(tl({},f),{},m4({},N,P))},c),d={};return Object.keys(u).reduce(function(f,x){var g=u[x];if(g.hasStack){var v={};g.stackGroups=Object.keys(g.stackGroups).reduce(function(w,C){var N=g.stackGroups[C];return tl(tl({},w),{},m4({},C,{numericAxisId:r,cateAxisId:s,items:N.items,stackedData:sYt(t,N.items,a)}))},v)}return tl(tl({},f),{},m4({},x,g))},d)},aYt=function(t,n){var r=n.realScaleType,s=n.type,a=n.tickCount,o=n.originalDomain,l=n.allowDecimals,c=r||n.scale;if(c!=="auto"&&c!=="linear")return null;if(a&&s==="number"&&o&&(o[0]==="auto"||o[1]==="auto")){var u=t.domain();if(!u.length)return null;var d=gKt(u,a,l);return t.domain([X$(d),gy(d)]),{niceTicks:d}}if(a&&s==="number"){var f=t.domain(),x=bKt(f,a,l);return{niceTicks:x}}return null};function TN(e){var t=e.axis,n=e.ticks,r=e.bandSize,s=e.entry,a=e.index,o=e.dataKey;if(t.type==="category"){if(!t.allowDuplicatedCategory&&t.dataKey&&!wi(s[t.dataKey])){var l=VR(n,"value",s[t.dataKey]);if(l)return l.coordinate+r/2}return n[a]?n[a].coordinate+r/2:null}var c=sc(s,wi(o)?t.dataKey:o);return wi(c)?null:t.scale(c)}var Z3e=function(t){var n=t.axis,r=t.ticks,s=t.offset,a=t.bandSize,o=t.entry,l=t.index;if(n.type==="category")return r[l]?r[l].coordinate+s:null;var c=sc(o,n.dataKey,n.domain[l]);return wi(c)?null:n.scale(c)-a/2+s},oYt=function(t){var n=t.numericAxis,r=n.scale.domain();if(n.type==="number"){var s=Math.min(r[0],r[1]),a=Math.max(r[0],r[1]);return s<=0&&a>=0?0:a<0?a:s}return r[0]},lYt=function(t,n){var r,s=(r=t.type)!==null&&r!==void 0&&r.defaultProps?tl(tl({},t.type.defaultProps),t.props):t.props,a=s.stackId;if(rc(a)){var o=n[a];if(o){var l=o.items.indexOf(t);return l>=0?o.stackedData[l]:null}}return null},cYt=function(t){return t.reduce(function(n,r){return[X$(r.concat([n[0]]).filter(rs)),gy(r.concat([n[1]]).filter(rs))]},[1/0,-1/0])},p$e=function(t,n,r){return Object.keys(t).reduce(function(s,a){var o=t[a],l=o.stackedData,c=l.reduce(function(u,d){var f=cYt(d.slice(n,r+1));return[Math.min(u[0],f[0]),Math.max(u[1],f[1])]},[1/0,-1/0]);return[Math.min(c[0],s[0]),Math.max(c[1],s[1])]},[1/0,-1/0]).map(function(s){return s===1/0||s===-1/0?0:s})},J3e=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,e5e=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,Bte=function(t,n,r){if(Ai(t))return t(n,r);if(!Array.isArray(t))return n;var s=[];if(rs(t[0]))s[0]=r?t[0]:Math.min(t[0],n[0]);else if(J3e.test(t[0])){var a=+J3e.exec(t[0])[1];s[0]=n[0]-a}else Ai(t[0])?s[0]=t[0](n[0]):s[0]=n[0];if(rs(t[1]))s[1]=r?t[1]:Math.max(t[1],n[1]);else if(e5e.test(t[1])){var o=+e5e.exec(t[1])[1];s[1]=n[1]+o}else Ai(t[1])?s[1]=t[1](n[1]):s[1]=n[1];return s},xL=function(t,n,r){if(t&&t.scale&&t.scale.bandwidth){var s=t.scale.bandwidth();if(!r||s>0)return s}if(t&&n&&n.length>=2){for(var a=Gle(n,function(f){return f.coordinate}),o=1/0,l=1,c=a.length;l<c;l++){var u=a[l],d=a[l-1];o=Math.min((u.coordinate||0)-(d.coordinate||0),o)}return o===1/0?0:o}return r?void 0:0},t5e=function(t,n,r){return!t||!t.length||K3(t,np(r,"type.defaultProps.domain"))?n:t},m$e=function(t,n){var r=t.type.defaultProps?tl(tl({},t.type.defaultProps),t.props):t.props,s=r.dataKey,a=r.name,o=r.unit,l=r.formatter,c=r.tooltipType,u=r.chartType,d=r.hide;return tl(tl({},vi(t,!1)),{},{dataKey:s,unit:o,formatter:l,name:a||s,color:vce(t),value:sc(n,s),type:c,payload:n,chartType:u,hide:d})};function v_(e){"@babel/helpers - typeof";return v_=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},v_(e)}function n5e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function r5e(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?n5e(Object(n),!0).forEach(function(r){uYt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):n5e(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function uYt(e,t,n){return t=dYt(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function dYt(e){var t=fYt(e,"string");return v_(t)=="symbol"?t:t+""}function fYt(e,t){if(v_(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(v_(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var gL=Math.PI/180,hYt=function(t){return t*180/Math.PI},tu=function(t,n,r,s){return{x:t+Math.cos(-gL*s)*r,y:n+Math.sin(-gL*s)*r}},pYt=function(t,n){var r=t.x,s=t.y,a=n.x,o=n.y;return Math.sqrt(Math.pow(r-a,2)+Math.pow(s-o,2))},mYt=function(t,n){var r=t.x,s=t.y,a=n.cx,o=n.cy,l=pYt({x:r,y:s},{x:a,y:o});if(l<=0)return{radius:l};var c=(r-a)/l,u=Math.acos(c);return s>o&&(u=2*Math.PI-u),{radius:l,angle:hYt(u),angleInRadian:u}},xYt=function(t){var n=t.startAngle,r=t.endAngle,s=Math.floor(n/360),a=Math.floor(r/360),o=Math.min(s,a);return{startAngle:n-o*360,endAngle:r-o*360}},gYt=function(t,n){var r=n.startAngle,s=n.endAngle,a=Math.floor(r/360),o=Math.floor(s/360),l=Math.min(a,o);return t+l*360},s5e=function(t,n){var r=t.x,s=t.y,a=mYt({x:r,y:s},n),o=a.radius,l=a.angle,c=n.innerRadius,u=n.outerRadius;if(o<c||o>u)return!1;if(o===0)return!0;var d=xYt(n),f=d.startAngle,x=d.endAngle,g=l,v;if(f<=x){for(;g>x;)g-=360;for(;g<f;)g+=360;v=g>=f&&g<=x}else{for(;g>f;)g-=360;for(;g<x;)g+=360;v=g>=x&&g<=f}return v?r5e(r5e({},n),{},{radius:o,angle:gYt(g,n)}):null};function w_(e){"@babel/helpers - typeof";return w_=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},w_(e)}var bYt=["offset"];function yYt(e){return SYt(e)||CYt(e)||wYt(e)||vYt()}function vYt(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function wYt(e,t){if(e){if(typeof e=="string")return $te(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return $te(e,t)}}function CYt(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function SYt(e){if(Array.isArray(e))return $te(e)}function $te(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function NYt(e,t){if(e==null)return{};var n=AYt(e,t),r,s;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(s=0;s<a.length;s++)r=a[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function AYt(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function i5e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function Ql(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?i5e(Object(n),!0).forEach(function(r){jYt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i5e(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function jYt(e,t,n){return t=EYt(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function EYt(e){var t=_Yt(e,"string");return w_(t)=="symbol"?t:t+""}function _Yt(e,t){if(w_(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(w_(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function C_(){return C_=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},C_.apply(this,arguments)}var kYt=function(t){var n=t.value,r=t.formatter,s=wi(t.children)?n:t.children;return Ai(r)?r(s):s},TYt=function(t,n){var r=lm(n-t),s=Math.min(Math.abs(n-t),360);return r*s},IYt=function(t,n,r){var s=t.position,a=t.viewBox,o=t.offset,l=t.className,c=a,u=c.cx,d=c.cy,f=c.innerRadius,x=c.outerRadius,g=c.startAngle,v=c.endAngle,w=c.clockWise,C=(f+x)/2,N=TYt(g,v),P=N>=0?1:-1,I,R;s==="insideStart"?(I=g+P*o,R=w):s==="insideEnd"?(I=v-P*o,R=!w):s==="end"&&(I=v+P*o,R=w),R=N<=0?R:!R;var F=tu(u,d,C,I),U=tu(u,d,C,I+(R?1:-1)*359),L="M".concat(F.x,",").concat(F.y,`
A`).concat(C,",").concat(C,",0,1,").concat(R?0:1,`,
`).concat(U.x,",").concat(U.y),z=wi(t.id)?S5("recharts-radial-line-"):t.id;return Ae.createElement("text",C_({},r,{dominantBaseline:"central",className:sa("recharts-radial-bar-label",l)}),Ae.createElement("defs",null,Ae.createElement("path",{id:z,d:L})),Ae.createElement("textPath",{xlinkHref:"#".concat(z)},n))},PYt=function(t){var n=t.viewBox,r=t.offset,s=t.position,a=n,o=a.cx,l=a.cy,c=a.innerRadius,u=a.outerRadius,d=a.startAngle,f=a.endAngle,x=(d+f)/2;if(s==="outside"){var g=tu(o,l,u+r,x),v=g.x,w=g.y;return{x:v,y:w,textAnchor:v>=o?"start":"end",verticalAnchor:"middle"}}if(s==="center")return{x:o,y:l,textAnchor:"middle",verticalAnchor:"middle"};if(s==="centerTop")return{x:o,y:l,textAnchor:"middle",verticalAnchor:"start"};if(s==="centerBottom")return{x:o,y:l,textAnchor:"middle",verticalAnchor:"end"};var C=(c+u)/2,N=tu(o,l,C,x),P=N.x,I=N.y;return{x:P,y:I,textAnchor:"middle",verticalAnchor:"middle"}},FYt=function(t){var n=t.viewBox,r=t.parentViewBox,s=t.offset,a=t.position,o=n,l=o.x,c=o.y,u=o.width,d=o.height,f=d>=0?1:-1,x=f*s,g=f>0?"end":"start",v=f>0?"start":"end",w=u>=0?1:-1,C=w*s,N=w>0?"end":"start",P=w>0?"start":"end";if(a==="top"){var I={x:l+u/2,y:c-f*s,textAnchor:"middle",verticalAnchor:g};return Ql(Ql({},I),r?{height:Math.max(c-r.y,0),width:u}:{})}if(a==="bottom"){var R={x:l+u/2,y:c+d+x,textAnchor:"middle",verticalAnchor:v};return Ql(Ql({},R),r?{height:Math.max(r.y+r.height-(c+d),0),width:u}:{})}if(a==="left"){var F={x:l-C,y:c+d/2,textAnchor:N,verticalAnchor:"middle"};return Ql(Ql({},F),r?{width:Math.max(F.x-r.x,0),height:d}:{})}if(a==="right"){var U={x:l+u+C,y:c+d/2,textAnchor:P,verticalAnchor:"middle"};return Ql(Ql({},U),r?{width:Math.max(r.x+r.width-U.x,0),height:d}:{})}var L=r?{width:u,height:d}:{};return a==="insideLeft"?Ql({x:l+C,y:c+d/2,textAnchor:P,verticalAnchor:"middle"},L):a==="insideRight"?Ql({x:l+u-C,y:c+d/2,textAnchor:N,verticalAnchor:"middle"},L):a==="insideTop"?Ql({x:l+u/2,y:c+x,textAnchor:"middle",verticalAnchor:v},L):a==="insideBottom"?Ql({x:l+u/2,y:c+d-x,textAnchor:"middle",verticalAnchor:g},L):a==="insideTopLeft"?Ql({x:l+C,y:c+x,textAnchor:P,verticalAnchor:v},L):a==="insideTopRight"?Ql({x:l+u-C,y:c+x,textAnchor:N,verticalAnchor:v},L):a==="insideBottomLeft"?Ql({x:l+C,y:c+d-x,textAnchor:P,verticalAnchor:g},L):a==="insideBottomRight"?Ql({x:l+u-C,y:c+d-x,textAnchor:N,verticalAnchor:g},L):KA(a)&&(rs(a.x)||rw(a.x))&&(rs(a.y)||rw(a.y))?Ql({x:l+G3(a.x,u),y:c+G3(a.y,d),textAnchor:"end",verticalAnchor:"end"},L):Ql({x:l+u/2,y:c+d/2,textAnchor:"middle",verticalAnchor:"middle"},L)},OYt=function(t){return"cx"in t&&rs(t.cx)};function ju(e){var t=e.offset,n=t===void 0?5:t,r=NYt(e,bYt),s=Ql({offset:n},r),a=s.viewBox,o=s.position,l=s.value,c=s.children,u=s.content,d=s.className,f=d===void 0?"":d,x=s.textBreakAll;if(!a||wi(l)&&wi(c)&&!m.isValidElement(u)&&!Ai(u))return null;if(m.isValidElement(u))return m.cloneElement(u,s);var g;if(Ai(u)){if(g=m.createElement(u,s),m.isValidElement(g))return g}else g=kYt(s);var v=OYt(a),w=vi(s,!0);if(v&&(o==="insideStart"||o==="insideEnd"||o==="end"))return IYt(s,g,w);var C=v?PYt(s):FYt(s);return Ae.createElement(nL,C_({className:sa("recharts-label",f)},w,C,{breakAll:x}),g)}ju.displayName="Label";var x$e=function(t){var n=t.cx,r=t.cy,s=t.angle,a=t.startAngle,o=t.endAngle,l=t.r,c=t.radius,u=t.innerRadius,d=t.outerRadius,f=t.x,x=t.y,g=t.top,v=t.left,w=t.width,C=t.height,N=t.clockWise,P=t.labelViewBox;if(P)return P;if(rs(w)&&rs(C)){if(rs(f)&&rs(x))return{x:f,y:x,width:w,height:C};if(rs(g)&&rs(v))return{x:g,y:v,width:w,height:C}}return rs(f)&&rs(x)?{x:f,y:x,width:0,height:0}:rs(n)&&rs(r)?{cx:n,cy:r,startAngle:a||s||0,endAngle:o||s||0,innerRadius:u||0,outerRadius:d||c||l||0,clockWise:N}:t.viewBox?t.viewBox:{}},MYt=function(t,n){return t?t===!0?Ae.createElement(ju,{key:"label-implicit",viewBox:n}):rc(t)?Ae.createElement(ju,{key:"label-implicit",viewBox:n,value:t}):m.isValidElement(t)?t.type===ju?m.cloneElement(t,{key:"label-implicit",viewBox:n}):Ae.createElement(ju,{key:"label-implicit",content:t,viewBox:n}):Ai(t)?Ae.createElement(ju,{key:"label-implicit",content:t,viewBox:n}):KA(t)?Ae.createElement(ju,C_({viewBox:n},t,{key:"label-implicit"})):null:null},RYt=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!t||!t.children&&r&&!t.label)return null;var s=t.children,a=x$e(t),o=sf(s,ju).map(function(c,u){return m.cloneElement(c,{viewBox:n||a,key:"label-".concat(u)})});if(!r)return o;var l=MYt(t.label,n||a);return[l].concat(yYt(o))};ju.parseViewBox=x$e;ju.renderCallByParent=RYt;var lY,a5e;function LYt(){if(a5e)return lY;a5e=1;function e(t){var n=t==null?0:t.length;return n?t[n-1]:void 0}return lY=e,lY}var DYt=LYt();const BYt=Ti(DYt);function S_(e){"@babel/helpers - typeof";return S_=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},S_(e)}var $Yt=["valueAccessor"],UYt=["data","dataKey","clockWise","id","textBreakAll"];function zYt(e){return qYt(e)||WYt(e)||VYt(e)||HYt()}function HYt(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function VYt(e,t){if(e){if(typeof e=="string")return Ute(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ute(e,t)}}function WYt(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function qYt(e){if(Array.isArray(e))return Ute(e)}function Ute(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function bL(){return bL=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},bL.apply(this,arguments)}function o5e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function l5e(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?o5e(Object(n),!0).forEach(function(r){GYt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o5e(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function GYt(e,t,n){return t=KYt(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function KYt(e){var t=YYt(e,"string");return S_(t)=="symbol"?t:t+""}function YYt(e,t){if(S_(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(S_(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function c5e(e,t){if(e==null)return{};var n=XYt(e,t),r,s;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(s=0;s<a.length;s++)r=a[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function XYt(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var QYt=function(t){return Array.isArray(t.value)?BYt(t.value):t.value};function z0(e){var t=e.valueAccessor,n=t===void 0?QYt:t,r=c5e(e,$Yt),s=r.data,a=r.dataKey,o=r.clockWise,l=r.id,c=r.textBreakAll,u=c5e(r,UYt);return!s||!s.length?null:Ae.createElement(Sa,{className:"recharts-label-list"},s.map(function(d,f){var x=wi(a)?n(d,f):sc(d&&d.payload,a),g=wi(l)?{}:{id:"".concat(l,"-").concat(f)};return Ae.createElement(ju,bL({},vi(d,!0),u,g,{parentViewBox:d.parentViewBox,value:x,textBreakAll:c,viewBox:ju.parseViewBox(wi(o)?d:l5e(l5e({},d),{},{clockWise:o})),key:"label-".concat(f),index:f}))}))}z0.displayName="LabelList";function ZYt(e,t){return e?e===!0?Ae.createElement(z0,{key:"labelList-implicit",data:t}):Ae.isValidElement(e)||Ai(e)?Ae.createElement(z0,{key:"labelList-implicit",data:t,content:e}):KA(e)?Ae.createElement(z0,bL({data:t},e,{key:"labelList-implicit"})):null:null}function JYt(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!e||!e.children&&n&&!e.label)return null;var r=e.children,s=sf(r,z0).map(function(o,l){return m.cloneElement(o,{data:t,key:"labelList-".concat(l)})});if(!n)return s;var a=ZYt(e.label,t);return[a].concat(zYt(s))}z0.renderCallByParent=JYt;function N_(e){"@babel/helpers - typeof";return N_=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},N_(e)}function zte(){return zte=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},zte.apply(this,arguments)}function u5e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function d5e(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?u5e(Object(n),!0).forEach(function(r){eXt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):u5e(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function eXt(e,t,n){return t=tXt(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function tXt(e){var t=nXt(e,"string");return N_(t)=="symbol"?t:t+""}function nXt(e,t){if(N_(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(N_(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var rXt=function(t,n){var r=lm(n-t),s=Math.min(Math.abs(n-t),359.999);return r*s},PP=function(t){var n=t.cx,r=t.cy,s=t.radius,a=t.angle,o=t.sign,l=t.isExternal,c=t.cornerRadius,u=t.cornerIsExternal,d=c*(l?1:-1)+s,f=Math.asin(c/d)/gL,x=u?a:a+o*f,g=tu(n,r,d,x),v=tu(n,r,s,x),w=u?a-o*f:a,C=tu(n,r,d*Math.cos(f*gL),w);return{center:g,circleTangency:v,lineTangency:C,theta:f}},g$e=function(t){var n=t.cx,r=t.cy,s=t.innerRadius,a=t.outerRadius,o=t.startAngle,l=t.endAngle,c=rXt(o,l),u=o+c,d=tu(n,r,a,o),f=tu(n,r,a,u),x="M ".concat(d.x,",").concat(d.y,`
A `).concat(a,",").concat(a,`,0,
`).concat(+(Math.abs(c)>180),",").concat(+(o>u),`,
`).concat(f.x,",").concat(f.y,`
`);if(s>0){var g=tu(n,r,s,o),v=tu(n,r,s,u);x+="L ".concat(v.x,",").concat(v.y,`
A `).concat(s,",").concat(s,`,0,
`).concat(+(Math.abs(c)>180),",").concat(+(o<=u),`,
`).concat(g.x,",").concat(g.y," Z")}else x+="L ".concat(n,",").concat(r," Z");return x},sXt=function(t){var n=t.cx,r=t.cy,s=t.innerRadius,a=t.outerRadius,o=t.cornerRadius,l=t.forceCornerRadius,c=t.cornerIsExternal,u=t.startAngle,d=t.endAngle,f=lm(d-u),x=PP({cx:n,cy:r,radius:a,angle:u,sign:f,cornerRadius:o,cornerIsExternal:c}),g=x.circleTangency,v=x.lineTangency,w=x.theta,C=PP({cx:n,cy:r,radius:a,angle:d,sign:-f,cornerRadius:o,cornerIsExternal:c}),N=C.circleTangency,P=C.lineTangency,I=C.theta,R=c?Math.abs(u-d):Math.abs(u-d)-w-I;if(R<0)return l?"M ".concat(v.x,",").concat(v.y,`
a`).concat(o,",").concat(o,",0,0,1,").concat(o*2,`,0
a`).concat(o,",").concat(o,",0,0,1,").concat(-o*2,`,0
`):g$e({cx:n,cy:r,innerRadius:s,outerRadius:a,startAngle:u,endAngle:d});var F="M ".concat(v.x,",").concat(v.y,`
A`).concat(o,",").concat(o,",0,0,").concat(+(f<0),",").concat(g.x,",").concat(g.y,`
A`).concat(a,",").concat(a,",0,").concat(+(R>180),",").concat(+(f<0),",").concat(N.x,",").concat(N.y,`
A`).concat(o,",").concat(o,",0,0,").concat(+(f<0),",").concat(P.x,",").concat(P.y,`
`);if(s>0){var U=PP({cx:n,cy:r,radius:s,angle:u,sign:f,isExternal:!0,cornerRadius:o,cornerIsExternal:c}),L=U.circleTangency,z=U.lineTangency,Q=U.theta,ne=PP({cx:n,cy:r,radius:s,angle:d,sign:-f,isExternal:!0,cornerRadius:o,cornerIsExternal:c}),J=ne.circleTangency,X=ne.lineTangency,re=ne.theta,pe=c?Math.abs(u-d):Math.abs(u-d)-Q-re;if(pe<0&&o===0)return"".concat(F,"L").concat(n,",").concat(r,"Z");F+="L".concat(X.x,",").concat(X.y,`
A`).concat(o,",").concat(o,",0,0,").concat(+(f<0),",").concat(J.x,",").concat(J.y,`
A`).concat(s,",").concat(s,",0,").concat(+(pe>180),",").concat(+(f>0),",").concat(L.x,",").concat(L.y,`
A`).concat(o,",").concat(o,",0,0,").concat(+(f<0),",").concat(z.x,",").concat(z.y,"Z")}else F+="L".concat(n,",").concat(r,"Z");return F},iXt={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},b$e=function(t){var n=d5e(d5e({},iXt),t),r=n.cx,s=n.cy,a=n.innerRadius,o=n.outerRadius,l=n.cornerRadius,c=n.forceCornerRadius,u=n.cornerIsExternal,d=n.startAngle,f=n.endAngle,x=n.className;if(o<a||d===f)return null;var g=sa("recharts-sector",x),v=o-a,w=G3(l,v,0,!0),C;return w>0&&Math.abs(d-f)<360?C=sXt({cx:r,cy:s,innerRadius:a,outerRadius:o,cornerRadius:Math.min(w,v/2),forceCornerRadius:c,cornerIsExternal:u,startAngle:d,endAngle:f}):C=g$e({cx:r,cy:s,innerRadius:a,outerRadius:o,startAngle:d,endAngle:f}),Ae.createElement("path",zte({},vi(n,!0),{className:g,d:C,role:"img"}))};function A_(e){"@babel/helpers - typeof";return A_=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},A_(e)}function Hte(){return Hte=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Hte.apply(this,arguments)}function f5e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function h5e(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?f5e(Object(n),!0).forEach(function(r){aXt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):f5e(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function aXt(e,t,n){return t=oXt(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function oXt(e){var t=lXt(e,"string");return A_(t)=="symbol"?t:t+""}function lXt(e,t){if(A_(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(A_(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var p5e={curveBasisClosed:kUt,curveBasisOpen:TUt,curveBasis:_Ut,curveBumpX:pUt,curveBumpY:mUt,curveLinearClosed:IUt,curveLinear:D$,curveMonotoneX:PUt,curveMonotoneY:FUt,curveNatural:OUt,curveStep:MUt,curveStepAfter:LUt,curveStepBefore:RUt},FP=function(t){return t.x===+t.x&&t.y===+t.y},B7=function(t){return t.x},$7=function(t){return t.y},cXt=function(t,n){if(Ai(t))return t;var r="curve".concat(R$(t));return(r==="curveMonotone"||r==="curveBump")&&n?p5e["".concat(r).concat(n==="vertical"?"Y":"X")]:p5e[r]||D$},uXt=function(t){var n=t.type,r=n===void 0?"linear":n,s=t.points,a=s===void 0?[]:s,o=t.baseLine,l=t.layout,c=t.connectNulls,u=c===void 0?!1:c,d=cXt(r,l),f=u?a.filter(function(w){return FP(w)}):a,x;if(Array.isArray(o)){var g=u?o.filter(function(w){return FP(w)}):o,v=f.map(function(w,C){return h5e(h5e({},w),{},{base:g[C]})});return l==="vertical"?x=NP().y($7).x1(B7).x0(function(w){return w.base.x}):x=NP().x(B7).y1($7).y0(function(w){return w.base.y}),x.defined(FP).curve(d),x(v)}return l==="vertical"&&rs(o)?x=NP().y($7).x1(B7).x0(o):rs(o)?x=NP().x(B7).y1($7).y0(o):x=wDe().x(B7).y($7),x.defined(FP).curve(d),x(f)},l3=function(t){var n=t.className,r=t.points,s=t.path,a=t.pathRef;if((!r||!r.length)&&!s)return null;var o=r&&r.length?uXt(t):s;return Ae.createElement("path",Hte({},vi(t,!1),WR(t),{className:sa("recharts-curve",n),d:o,ref:a}))},dXt=_$();const Pa=Ti(dXt);var fXt=Object.getOwnPropertyNames,hXt=Object.getOwnPropertySymbols,pXt=Object.prototype.hasOwnProperty;function m5e(e,t){return function(r,s,a){return e(r,s,a)&&t(r,s,a)}}function OP(e){return function(n,r,s){if(!n||!r||typeof n!="object"||typeof r!="object")return e(n,r,s);var a=s.cache,o=a.get(n),l=a.get(r);if(o&&l)return o===r&&l===n;a.set(n,r),a.set(r,n);var c=e(n,r,s);return a.delete(n),a.delete(r),c}}function x5e(e){return fXt(e).concat(hXt(e))}var mXt=Object.hasOwn||function(e,t){return pXt.call(e,t)};function j5(e,t){return e===t||!e&&!t&&e!==e&&t!==t}var xXt="__v",gXt="__o",bXt="_owner",g5e=Object.getOwnPropertyDescriptor,b5e=Object.keys;function yXt(e,t,n){var r=e.length;if(t.length!==r)return!1;for(;r-- >0;)if(!n.equals(e[r],t[r],r,r,e,t,n))return!1;return!0}function vXt(e,t){return j5(e.getTime(),t.getTime())}function wXt(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function CXt(e,t){return e===t}function y5e(e,t,n){var r=e.size;if(r!==t.size)return!1;if(!r)return!0;for(var s=new Array(r),a=e.entries(),o,l,c=0;(o=a.next())&&!o.done;){for(var u=t.entries(),d=!1,f=0;(l=u.next())&&!l.done;){if(s[f]){f++;continue}var x=o.value,g=l.value;if(n.equals(x[0],g[0],c,f,e,t,n)&&n.equals(x[1],g[1],x[0],g[0],e,t,n)){d=s[f]=!0;break}f++}if(!d)return!1;c++}return!0}var SXt=j5;function NXt(e,t,n){var r=b5e(e),s=r.length;if(b5e(t).length!==s)return!1;for(;s-- >0;)if(!y$e(e,t,n,r[s]))return!1;return!0}function U7(e,t,n){var r=x5e(e),s=r.length;if(x5e(t).length!==s)return!1;for(var a,o,l;s-- >0;)if(a=r[s],!y$e(e,t,n,a)||(o=g5e(e,a),l=g5e(t,a),(o||l)&&(!o||!l||o.configurable!==l.configurable||o.enumerable!==l.enumerable||o.writable!==l.writable)))return!1;return!0}function AXt(e,t){return j5(e.valueOf(),t.valueOf())}function jXt(e,t){return e.source===t.source&&e.flags===t.flags}function v5e(e,t,n){var r=e.size;if(r!==t.size)return!1;if(!r)return!0;for(var s=new Array(r),a=e.values(),o,l;(o=a.next())&&!o.done;){for(var c=t.values(),u=!1,d=0;(l=c.next())&&!l.done;){if(!s[d]&&n.equals(o.value,l.value,o.value,l.value,e,t,n)){u=s[d]=!0;break}d++}if(!u)return!1}return!0}function EXt(e,t){var n=e.length;if(t.length!==n)return!1;for(;n-- >0;)if(e[n]!==t[n])return!1;return!0}function _Xt(e,t){return e.hostname===t.hostname&&e.pathname===t.pathname&&e.protocol===t.protocol&&e.port===t.port&&e.hash===t.hash&&e.username===t.username&&e.password===t.password}function y$e(e,t,n,r){return(r===bXt||r===gXt||r===xXt)&&(e.$$typeof||t.$$typeof)?!0:mXt(t,r)&&n.equals(e[r],t[r],r,r,e,t,n)}var kXt="[object Arguments]",TXt="[object Boolean]",IXt="[object Date]",PXt="[object Error]",FXt="[object Map]",OXt="[object Number]",MXt="[object Object]",RXt="[object RegExp]",LXt="[object Set]",DXt="[object String]",BXt="[object URL]",$Xt=Array.isArray,w5e=typeof ArrayBuffer=="function"&&ArrayBuffer.isView?ArrayBuffer.isView:null,C5e=Object.assign,UXt=Object.prototype.toString.call.bind(Object.prototype.toString);function zXt(e){var t=e.areArraysEqual,n=e.areDatesEqual,r=e.areErrorsEqual,s=e.areFunctionsEqual,a=e.areMapsEqual,o=e.areNumbersEqual,l=e.areObjectsEqual,c=e.arePrimitiveWrappersEqual,u=e.areRegExpsEqual,d=e.areSetsEqual,f=e.areTypedArraysEqual,x=e.areUrlsEqual;return function(v,w,C){if(v===w)return!0;if(v==null||w==null)return!1;var N=typeof v;if(N!==typeof w)return!1;if(N!=="object")return N==="number"?o(v,w,C):N==="function"?s(v,w,C):!1;var P=v.constructor;if(P!==w.constructor)return!1;if(P===Object)return l(v,w,C);if($Xt(v))return t(v,w,C);if(w5e!=null&&w5e(v))return f(v,w,C);if(P===Date)return n(v,w,C);if(P===RegExp)return u(v,w,C);if(P===Map)return a(v,w,C);if(P===Set)return d(v,w,C);var I=UXt(v);return I===IXt?n(v,w,C):I===RXt?u(v,w,C):I===FXt?a(v,w,C):I===LXt?d(v,w,C):I===MXt?typeof v.then!="function"&&typeof w.then!="function"&&l(v,w,C):I===BXt?x(v,w,C):I===PXt?r(v,w,C):I===kXt?l(v,w,C):I===TXt||I===OXt||I===DXt?c(v,w,C):!1}}function HXt(e){var t=e.circular,n=e.createCustomConfig,r=e.strict,s={areArraysEqual:r?U7:yXt,areDatesEqual:vXt,areErrorsEqual:wXt,areFunctionsEqual:CXt,areMapsEqual:r?m5e(y5e,U7):y5e,areNumbersEqual:SXt,areObjectsEqual:r?U7:NXt,arePrimitiveWrappersEqual:AXt,areRegExpsEqual:jXt,areSetsEqual:r?m5e(v5e,U7):v5e,areTypedArraysEqual:r?U7:EXt,areUrlsEqual:_Xt};if(n&&(s=C5e({},s,n(s))),t){var a=OP(s.areArraysEqual),o=OP(s.areMapsEqual),l=OP(s.areObjectsEqual),c=OP(s.areSetsEqual);s=C5e({},s,{areArraysEqual:a,areMapsEqual:o,areObjectsEqual:l,areSetsEqual:c})}return s}function VXt(e){return function(t,n,r,s,a,o,l){return e(t,n,l)}}function WXt(e){var t=e.circular,n=e.comparator,r=e.createState,s=e.equals,a=e.strict;if(r)return function(c,u){var d=r(),f=d.cache,x=f===void 0?t?new WeakMap:void 0:f,g=d.meta;return n(c,u,{cache:x,equals:s,meta:g,strict:a})};if(t)return function(c,u){return n(c,u,{cache:new WeakMap,equals:s,meta:void 0,strict:a})};var o={cache:void 0,equals:s,meta:void 0,strict:a};return function(c,u){return n(c,u,o)}}var qXt=y2();y2({strict:!0});y2({circular:!0});y2({circular:!0,strict:!0});y2({createInternalComparator:function(){return j5}});y2({strict:!0,createInternalComparator:function(){return j5}});y2({circular:!0,createInternalComparator:function(){return j5}});y2({circular:!0,createInternalComparator:function(){return j5},strict:!0});function y2(e){e===void 0&&(e={});var t=e.circular,n=t===void 0?!1:t,r=e.createInternalComparator,s=e.createState,a=e.strict,o=a===void 0?!1:a,l=HXt(e),c=zXt(l),u=r?r(c):VXt(c);return WXt({circular:n,comparator:c,createState:s,equals:u,strict:o})}function GXt(e){typeof requestAnimationFrame<"u"&&requestAnimationFrame(e)}function S5e(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=-1,r=function s(a){n<0&&(n=a),a-n>t?(e(a),n=-1):GXt(s)};requestAnimationFrame(r)}function Vte(e){"@babel/helpers - typeof";return Vte=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},Vte(e)}function KXt(e){return ZXt(e)||QXt(e)||XXt(e)||YXt()}function YXt(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function XXt(e,t){if(e){if(typeof e=="string")return N5e(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return N5e(e,t)}}function N5e(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function QXt(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function ZXt(e){if(Array.isArray(e))return e}function JXt(){var e={},t=function(){return null},n=!1,r=function s(a){if(!n){if(Array.isArray(a)){if(!a.length)return;var o=a,l=KXt(o),c=l[0],u=l.slice(1);if(typeof c=="number"){S5e(s.bind(null,u),c);return}s(c),S5e(s.bind(null,u));return}Vte(a)==="object"&&(e=a,t(e)),typeof a=="function"&&a()}};return{stop:function(){n=!0},start:function(a){n=!1,r(a)},subscribe:function(a){return t=a,function(){t=function(){return null}}}}}function j_(e){"@babel/helpers - typeof";return j_=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},j_(e)}function A5e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function j5e(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?A5e(Object(n),!0).forEach(function(r){v$e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):A5e(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function v$e(e,t,n){return t=eQt(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function eQt(e){var t=tQt(e,"string");return j_(t)==="symbol"?t:String(t)}function tQt(e,t){if(j_(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(j_(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var nQt=function(t,n){return[Object.keys(t),Object.keys(n)].reduce(function(r,s){return r.filter(function(a){return s.includes(a)})})},rQt=function(t){return t},sQt=function(t){return t.replace(/([A-Z])/g,function(n){return"-".concat(n.toLowerCase())})},o9=function(t,n){return Object.keys(n).reduce(function(r,s){return j5e(j5e({},r),{},v$e({},s,t(s,n[s])))},{})},E5e=function(t,n,r){return t.map(function(s){return"".concat(sQt(s)," ").concat(n,"ms ").concat(r)}).join(",")};function iQt(e,t){return lQt(e)||oQt(e,t)||w$e(e,t)||aQt()}function aQt(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function oQt(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,s,a,o,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(d){u=!0,s=d}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw s}}return l}}function lQt(e){if(Array.isArray(e))return e}function cQt(e){return fQt(e)||dQt(e)||w$e(e)||uQt()}function uQt(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function w$e(e,t){if(e){if(typeof e=="string")return Wte(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Wte(e,t)}}function dQt(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function fQt(e){if(Array.isArray(e))return Wte(e)}function Wte(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var yL=1e-4,C$e=function(t,n){return[0,3*t,3*n-6*t,3*t-3*n+1]},S$e=function(t,n){return t.map(function(r,s){return r*Math.pow(n,s)}).reduce(function(r,s){return r+s})},_5e=function(t,n){return function(r){var s=C$e(t,n);return S$e(s,r)}},hQt=function(t,n){return function(r){var s=C$e(t,n),a=[].concat(cQt(s.map(function(o,l){return o*l}).slice(1)),[0]);return S$e(a,r)}},k5e=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var s=n[0],a=n[1],o=n[2],l=n[3];if(n.length===1)switch(n[0]){case"linear":s=0,a=0,o=1,l=1;break;case"ease":s=.25,a=.1,o=.25,l=1;break;case"ease-in":s=.42,a=0,o=1,l=1;break;case"ease-out":s=.42,a=0,o=.58,l=1;break;case"ease-in-out":s=0,a=0,o=.58,l=1;break;default:{var c=n[0].split("(");if(c[0]==="cubic-bezier"&&c[1].split(")")[0].split(",").length===4){var u=c[1].split(")")[0].split(",").map(function(C){return parseFloat(C)}),d=iQt(u,4);s=d[0],a=d[1],o=d[2],l=d[3]}}}var f=_5e(s,o),x=_5e(a,l),g=hQt(s,o),v=function(N){return N>1?1:N<0?0:N},w=function(N){for(var P=N>1?1:N,I=P,R=0;R<8;++R){var F=f(I)-P,U=g(I);if(Math.abs(F-P)<yL||U<yL)return x(I);I=v(I-F/U)}return x(I)};return w.isStepper=!1,w},pQt=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=t.stiff,r=n===void 0?100:n,s=t.damping,a=s===void 0?8:s,o=t.dt,l=o===void 0?17:o,c=function(d,f,x){var g=-(d-f)*r,v=x*a,w=x+(g-v)*l/1e3,C=x*l/1e3+d;return Math.abs(C-f)<yL&&Math.abs(w)<yL?[f,0]:[C,w]};return c.isStepper=!0,c.dt=l,c},mQt=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var s=n[0];if(typeof s=="string")switch(s){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return k5e(s);case"spring":return pQt();default:if(s.split("(")[0]==="cubic-bezier")return k5e(s)}return typeof s=="function"?s:null};function E_(e){"@babel/helpers - typeof";return E_=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},E_(e)}function T5e(e){return bQt(e)||gQt(e)||N$e(e)||xQt()}function xQt(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function gQt(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function bQt(e){if(Array.isArray(e))return Gte(e)}function I5e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function qc(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?I5e(Object(n),!0).forEach(function(r){qte(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):I5e(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function qte(e,t,n){return t=yQt(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function yQt(e){var t=vQt(e,"string");return E_(t)==="symbol"?t:String(t)}function vQt(e,t){if(E_(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(E_(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function wQt(e,t){return NQt(e)||SQt(e,t)||N$e(e,t)||CQt()}function CQt(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function N$e(e,t){if(e){if(typeof e=="string")return Gte(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Gte(e,t)}}function Gte(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function SQt(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,s,a,o,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(d){u=!0,s=d}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw s}}return l}}function NQt(e){if(Array.isArray(e))return e}var vL=function(t,n,r){return t+(n-t)*r},Kte=function(t){var n=t.from,r=t.to;return n!==r},AQt=function e(t,n,r){var s=o9(function(a,o){if(Kte(o)){var l=t(o.from,o.to,o.velocity),c=wQt(l,2),u=c[0],d=c[1];return qc(qc({},o),{},{from:u,velocity:d})}return o},n);return r<1?o9(function(a,o){return Kte(o)?qc(qc({},o),{},{velocity:vL(o.velocity,s[a].velocity,r),from:vL(o.from,s[a].from,r)}):o},n):e(t,s,r-1)};const jQt=function(e,t,n,r,s){var a=nQt(e,t),o=a.reduce(function(C,N){return qc(qc({},C),{},qte({},N,[e[N],t[N]]))},{}),l=a.reduce(function(C,N){return qc(qc({},C),{},qte({},N,{from:e[N],velocity:0,to:t[N]}))},{}),c=-1,u,d,f=function(){return null},x=function(){return o9(function(N,P){return P.from},l)},g=function(){return!Object.values(l).filter(Kte).length},v=function(N){u||(u=N);var P=N-u,I=P/n.dt;l=AQt(n,l,I),s(qc(qc(qc({},e),t),x())),u=N,g()||(c=requestAnimationFrame(f))},w=function(N){d||(d=N);var P=(N-d)/r,I=o9(function(F,U){return vL.apply(void 0,T5e(U).concat([n(P)]))},o);if(s(qc(qc(qc({},e),t),I)),P<1)c=requestAnimationFrame(f);else{var R=o9(function(F,U){return vL.apply(void 0,T5e(U).concat([n(1)]))},o);s(qc(qc(qc({},e),t),R))}};return f=n.isStepper?v:w,function(){return requestAnimationFrame(f),function(){cancelAnimationFrame(c)}}};function IN(e){"@babel/helpers - typeof";return IN=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},IN(e)}var EQt=["children","begin","duration","attributeName","easing","isActive","steps","from","to","canBegin","onAnimationEnd","shouldReAnimate","onAnimationReStart"];function _Qt(e,t){if(e==null)return{};var n=kQt(e,t),r,s;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(s=0;s<a.length;s++)r=a[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function kQt(e,t){if(e==null)return{};var n={},r=Object.keys(e),s,a;for(a=0;a<r.length;a++)s=r[a],!(t.indexOf(s)>=0)&&(n[s]=e[s]);return n}function cY(e){return FQt(e)||PQt(e)||IQt(e)||TQt()}function TQt(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function IQt(e,t){if(e){if(typeof e=="string")return Yte(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Yte(e,t)}}function PQt(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function FQt(e){if(Array.isArray(e))return Yte(e)}function Yte(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function P5e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function Pp(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?P5e(Object(n),!0).forEach(function(r){kj(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):P5e(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function kj(e,t,n){return t=A$e(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function OQt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function MQt(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,A$e(r.key),r)}}function RQt(e,t,n){return MQt(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function A$e(e){var t=LQt(e,"string");return IN(t)==="symbol"?t:String(t)}function LQt(e,t){if(IN(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(IN(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function DQt(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&&Xte(e,t)}function Xte(e,t){return Xte=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},Xte(e,t)}function BQt(e){var t=$Qt();return function(){var r=wL(e),s;if(t){var a=wL(this).constructor;s=Reflect.construct(r,arguments,a)}else s=r.apply(this,arguments);return Qte(this,s)}}function Qte(e,t){if(t&&(IN(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Zte(e)}function Zte(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function $Qt(){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 wL(e){return wL=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},wL(e)}var Cm=function(e){DQt(n,e);var t=BQt(n);function n(r,s){var a;OQt(this,n),a=t.call(this,r,s);var o=a.props,l=o.isActive,c=o.attributeName,u=o.from,d=o.to,f=o.steps,x=o.children,g=o.duration;if(a.handleStyleChange=a.handleStyleChange.bind(Zte(a)),a.changeStyle=a.changeStyle.bind(Zte(a)),!l||g<=0)return a.state={style:{}},typeof x=="function"&&(a.state={style:d}),Qte(a);if(f&&f.length)a.state={style:f[0].style};else if(u){if(typeof x=="function")return a.state={style:u},Qte(a);a.state={style:c?kj({},c,u):u}}else a.state={style:{}};return a}return RQt(n,[{key:"componentDidMount",value:function(){var s=this.props,a=s.isActive,o=s.canBegin;this.mounted=!0,!(!a||!o)&&this.runAnimation(this.props)}},{key:"componentDidUpdate",value:function(s){var a=this.props,o=a.isActive,l=a.canBegin,c=a.attributeName,u=a.shouldReAnimate,d=a.to,f=a.from,x=this.state.style;if(l){if(!o){var g={style:c?kj({},c,d):d};this.state&&x&&(c&&x[c]!==d||!c&&x!==d)&&this.setState(g);return}if(!(qXt(s.to,d)&&s.canBegin&&s.isActive)){var v=!s.canBegin||!s.isActive;this.manager&&this.manager.stop(),this.stopJSAnimation&&this.stopJSAnimation();var w=v||u?f:s.to;if(this.state&&x){var C={style:c?kj({},c,w):w};(c&&x[c]!==w||!c&&x!==w)&&this.setState(C)}this.runAnimation(Pp(Pp({},this.props),{},{from:w,begin:0}))}}}},{key:"componentWillUnmount",value:function(){this.mounted=!1;var s=this.props.onAnimationEnd;this.unSubscribe&&this.unSubscribe(),this.manager&&(this.manager.stop(),this.manager=null),this.stopJSAnimation&&this.stopJSAnimation(),s&&s()}},{key:"handleStyleChange",value:function(s){this.changeStyle(s)}},{key:"changeStyle",value:function(s){this.mounted&&this.setState({style:s})}},{key:"runJSAnimation",value:function(s){var a=this,o=s.from,l=s.to,c=s.duration,u=s.easing,d=s.begin,f=s.onAnimationEnd,x=s.onAnimationStart,g=jQt(o,l,mQt(u),c,this.changeStyle),v=function(){a.stopJSAnimation=g()};this.manager.start([x,d,v,c,f])}},{key:"runStepAnimation",value:function(s){var a=this,o=s.steps,l=s.begin,c=s.onAnimationStart,u=o[0],d=u.style,f=u.duration,x=f===void 0?0:f,g=function(w,C,N){if(N===0)return w;var P=C.duration,I=C.easing,R=I===void 0?"ease":I,F=C.style,U=C.properties,L=C.onAnimationEnd,z=N>0?o[N-1]:C,Q=U||Object.keys(F);if(typeof R=="function"||R==="spring")return[].concat(cY(w),[a.runJSAnimation.bind(a,{from:z.style,to:F,duration:P,easing:R}),P]);var ne=E5e(Q,P,R),J=Pp(Pp(Pp({},z.style),F),{},{transition:ne});return[].concat(cY(w),[J,P,L]).filter(rQt)};return this.manager.start([c].concat(cY(o.reduce(g,[d,Math.max(x,l)])),[s.onAnimationEnd]))}},{key:"runAnimation",value:function(s){this.manager||(this.manager=JXt());var a=s.begin,o=s.duration,l=s.attributeName,c=s.to,u=s.easing,d=s.onAnimationStart,f=s.onAnimationEnd,x=s.steps,g=s.children,v=this.manager;if(this.unSubscribe=v.subscribe(this.handleStyleChange),typeof u=="function"||typeof g=="function"||u==="spring"){this.runJSAnimation(s);return}if(x.length>1){this.runStepAnimation(s);return}var w=l?kj({},l,c):c,C=E5e(Object.keys(w),o,u);v.start([d,a,Pp(Pp({},w),{},{transition:C}),o,f])}},{key:"render",value:function(){var s=this.props,a=s.children;s.begin;var o=s.duration;s.attributeName,s.easing;var l=s.isActive;s.steps,s.from,s.to,s.canBegin,s.onAnimationEnd,s.shouldReAnimate,s.onAnimationReStart;var c=_Qt(s,EQt),u=m.Children.count(a),d=this.state.style;if(typeof a=="function")return a(d);if(!l||u===0||o<=0)return a;var f=function(g){var v=g.props,w=v.style,C=w===void 0?{}:w,N=v.className,P=m.cloneElement(g,Pp(Pp({},c),{},{style:Pp(Pp({},C),d),className:N}));return P};return u===1?f(m.Children.only(a)):Ae.createElement("div",null,m.Children.map(a,function(x){return f(x)}))}}]),n}(m.PureComponent);Cm.displayName="Animate";Cm.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}};Cm.propTypes={from:Pa.oneOfType([Pa.object,Pa.string]),to:Pa.oneOfType([Pa.object,Pa.string]),attributeName:Pa.string,duration:Pa.number,begin:Pa.number,easing:Pa.oneOfType([Pa.string,Pa.func]),steps:Pa.arrayOf(Pa.shape({duration:Pa.number.isRequired,style:Pa.object.isRequired,easing:Pa.oneOfType([Pa.oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),Pa.func]),properties:Pa.arrayOf("string"),onAnimationEnd:Pa.func})),children:Pa.oneOfType([Pa.node,Pa.func]),isActive:Pa.bool,canBegin:Pa.bool,onAnimationEnd:Pa.func,shouldReAnimate:Pa.bool,onAnimationStart:Pa.func,onAnimationReStart:Pa.func};function __(e){"@babel/helpers - typeof";return __=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},__(e)}function CL(){return CL=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},CL.apply(this,arguments)}function UQt(e,t){return WQt(e)||VQt(e,t)||HQt(e,t)||zQt()}function zQt(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function HQt(e,t){if(e){if(typeof e=="string")return F5e(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return F5e(e,t)}}function F5e(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function VQt(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,s,a,o,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(d){u=!0,s=d}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw s}}return l}}function WQt(e){if(Array.isArray(e))return e}function O5e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function M5e(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?O5e(Object(n),!0).forEach(function(r){qQt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):O5e(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function qQt(e,t,n){return t=GQt(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function GQt(e){var t=KQt(e,"string");return __(t)=="symbol"?t:t+""}function KQt(e,t){if(__(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(__(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var R5e=function(t,n,r,s,a){var o=Math.min(Math.abs(r)/2,Math.abs(s)/2),l=s>=0?1:-1,c=r>=0?1:-1,u=s>=0&&r>=0||s<0&&r<0?1:0,d;if(o>0&&a instanceof Array){for(var f=[0,0,0,0],x=0,g=4;x<g;x++)f[x]=a[x]>o?o:a[x];d="M".concat(t,",").concat(n+l*f[0]),f[0]>0&&(d+="A ".concat(f[0],",").concat(f[0],",0,0,").concat(u,",").concat(t+c*f[0],",").concat(n)),d+="L ".concat(t+r-c*f[1],",").concat(n),f[1]>0&&(d+="A ".concat(f[1],",").concat(f[1],",0,0,").concat(u,`,
`).concat(t+r,",").concat(n+l*f[1])),d+="L ".concat(t+r,",").concat(n+s-l*f[2]),f[2]>0&&(d+="A ".concat(f[2],",").concat(f[2],",0,0,").concat(u,`,
`).concat(t+r-c*f[2],",").concat(n+s)),d+="L ".concat(t+c*f[3],",").concat(n+s),f[3]>0&&(d+="A ".concat(f[3],",").concat(f[3],",0,0,").concat(u,`,
`).concat(t,",").concat(n+s-l*f[3])),d+="Z"}else if(o>0&&a===+a&&a>0){var v=Math.min(o,a);d="M ".concat(t,",").concat(n+l*v,`
A `).concat(v,",").concat(v,",0,0,").concat(u,",").concat(t+c*v,",").concat(n,`
L `).concat(t+r-c*v,",").concat(n,`
A `).concat(v,",").concat(v,",0,0,").concat(u,",").concat(t+r,",").concat(n+l*v,`
L `).concat(t+r,",").concat(n+s-l*v,`
A `).concat(v,",").concat(v,",0,0,").concat(u,",").concat(t+r-c*v,",").concat(n+s,`
L `).concat(t+c*v,",").concat(n+s,`
A `).concat(v,",").concat(v,",0,0,").concat(u,",").concat(t,",").concat(n+s-l*v," Z")}else d="M ".concat(t,",").concat(n," h ").concat(r," v ").concat(s," h ").concat(-r," Z");return d},YQt=function(t,n){if(!t||!n)return!1;var r=t.x,s=t.y,a=n.x,o=n.y,l=n.width,c=n.height;if(Math.abs(l)>0&&Math.abs(c)>0){var u=Math.min(a,a+l),d=Math.max(a,a+l),f=Math.min(o,o+c),x=Math.max(o,o+c);return r>=u&&r<=d&&s>=f&&s<=x}return!1},XQt={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},wce=function(t){var n=M5e(M5e({},XQt),t),r=m.useRef(),s=m.useState(-1),a=UQt(s,2),o=a[0],l=a[1];m.useEffect(function(){if(r.current&&r.current.getTotalLength)try{var R=r.current.getTotalLength();R&&l(R)}catch{}},[]);var c=n.x,u=n.y,d=n.width,f=n.height,x=n.radius,g=n.className,v=n.animationEasing,w=n.animationDuration,C=n.animationBegin,N=n.isAnimationActive,P=n.isUpdateAnimationActive;if(c!==+c||u!==+u||d!==+d||f!==+f||d===0||f===0)return null;var I=sa("recharts-rectangle",g);return P?Ae.createElement(Cm,{canBegin:o>0,from:{width:d,height:f,x:c,y:u},to:{width:d,height:f,x:c,y:u},duration:w,animationEasing:v,isActive:P},function(R){var F=R.width,U=R.height,L=R.x,z=R.y;return Ae.createElement(Cm,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:C,duration:w,isActive:N,easing:v},Ae.createElement("path",CL({},vi(n,!0),{className:I,d:R5e(L,z,F,U,x),ref:r})))}):Ae.createElement("path",CL({},vi(n,!0),{className:I,d:R5e(c,u,d,f,x)}))};function Jte(){return Jte=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Jte.apply(this,arguments)}var J$=function(t){var n=t.cx,r=t.cy,s=t.r,a=t.className,o=sa("recharts-dot",a);return n===+n&&r===+r&&s===+s?Ae.createElement("circle",Jte({},vi(t,!1),WR(t),{className:o,cx:n,cy:r,r:s})):null};function k_(e){"@babel/helpers - typeof";return k_=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},k_(e)}var QQt=["x","y","top","left","width","height","className"];function ene(){return ene=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ene.apply(this,arguments)}function L5e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function ZQt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?L5e(Object(n),!0).forEach(function(r){JQt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):L5e(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function JQt(e,t,n){return t=eZt(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function eZt(e){var t=tZt(e,"string");return k_(t)=="symbol"?t:t+""}function tZt(e,t){if(k_(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(k_(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function nZt(e,t){if(e==null)return{};var n=rZt(e,t),r,s;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(s=0;s<a.length;s++)r=a[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function rZt(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var sZt=function(t,n,r,s,a,o){return"M".concat(t,",").concat(a,"v").concat(s,"M").concat(o,",").concat(n,"h").concat(r)},iZt=function(t){var n=t.x,r=n===void 0?0:n,s=t.y,a=s===void 0?0:s,o=t.top,l=o===void 0?0:o,c=t.left,u=c===void 0?0:c,d=t.width,f=d===void 0?0:d,x=t.height,g=x===void 0?0:x,v=t.className,w=nZt(t,QQt),C=ZQt({x:r,y:a,top:l,left:u,width:f,height:g},w);return!rs(r)||!rs(a)||!rs(f)||!rs(g)||!rs(l)||!rs(u)?null:Ae.createElement("path",ene({},vi(C,!0),{className:sa("recharts-cross",v),d:sZt(r,a,f,g,l,u)}))},uY,D5e;function aZt(){if(D5e)return uY;D5e=1;var e=VDe(),t=e(Object.getPrototypeOf,Object);return uY=t,uY}var dY,B5e;function oZt(){if(B5e)return dY;B5e=1;var e=k1(),t=aZt(),n=T1(),r="[object Object]",s=Function.prototype,a=Object.prototype,o=s.toString,l=a.hasOwnProperty,c=o.call(Object);function u(d){if(!n(d)||e(d)!=r)return!1;var f=t(d);if(f===null)return!0;var x=l.call(f,"constructor")&&f.constructor;return typeof x=="function"&&x instanceof x&&o.call(x)==c}return dY=u,dY}var lZt=oZt();const cZt=Ti(lZt);var fY,$5e;function uZt(){if($5e)return fY;$5e=1;var e=k1(),t=T1(),n="[object Boolean]";function r(s){return s===!0||s===!1||t(s)&&e(s)==n}return fY=r,fY}var dZt=uZt();const fZt=Ti(dZt);function T_(e){"@babel/helpers - typeof";return T_=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},T_(e)}function SL(){return SL=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},SL.apply(this,arguments)}function hZt(e,t){return gZt(e)||xZt(e,t)||mZt(e,t)||pZt()}function pZt(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function mZt(e,t){if(e){if(typeof e=="string")return U5e(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return U5e(e,t)}}function U5e(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function xZt(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,s,a,o,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(d){u=!0,s=d}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw s}}return l}}function gZt(e){if(Array.isArray(e))return e}function z5e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function H5e(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?z5e(Object(n),!0).forEach(function(r){bZt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):z5e(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function bZt(e,t,n){return t=yZt(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function yZt(e){var t=vZt(e,"string");return T_(t)=="symbol"?t:t+""}function vZt(e,t){if(T_(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(T_(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var V5e=function(t,n,r,s,a){var o=r-s,l;return l="M ".concat(t,",").concat(n),l+="L ".concat(t+r,",").concat(n),l+="L ".concat(t+r-o/2,",").concat(n+a),l+="L ".concat(t+r-o/2-s,",").concat(n+a),l+="L ".concat(t,",").concat(n," Z"),l},wZt={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},CZt=function(t){var n=H5e(H5e({},wZt),t),r=m.useRef(),s=m.useState(-1),a=hZt(s,2),o=a[0],l=a[1];m.useEffect(function(){if(r.current&&r.current.getTotalLength)try{var I=r.current.getTotalLength();I&&l(I)}catch{}},[]);var c=n.x,u=n.y,d=n.upperWidth,f=n.lowerWidth,x=n.height,g=n.className,v=n.animationEasing,w=n.animationDuration,C=n.animationBegin,N=n.isUpdateAnimationActive;if(c!==+c||u!==+u||d!==+d||f!==+f||x!==+x||d===0&&f===0||x===0)return null;var P=sa("recharts-trapezoid",g);return N?Ae.createElement(Cm,{canBegin:o>0,from:{upperWidth:0,lowerWidth:0,height:x,x:c,y:u},to:{upperWidth:d,lowerWidth:f,height:x,x:c,y:u},duration:w,animationEasing:v,isActive:N},function(I){var R=I.upperWidth,F=I.lowerWidth,U=I.height,L=I.x,z=I.y;return Ae.createElement(Cm,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:C,duration:w,easing:v},Ae.createElement("path",SL({},vi(n,!0),{className:P,d:V5e(L,z,R,F,U),ref:r})))}):Ae.createElement("g",null,Ae.createElement("path",SL({},vi(n,!0),{className:P,d:V5e(c,u,d,f,x)})))},SZt=["option","shapeType","propTransformer","activeClassName","isActive"];function I_(e){"@babel/helpers - typeof";return I_=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},I_(e)}function NZt(e,t){if(e==null)return{};var n=AZt(e,t),r,s;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(s=0;s<a.length;s++)r=a[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function AZt(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function W5e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function NL(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?W5e(Object(n),!0).forEach(function(r){jZt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):W5e(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function jZt(e,t,n){return t=EZt(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function EZt(e){var t=_Zt(e,"string");return I_(t)=="symbol"?t:t+""}function _Zt(e,t){if(I_(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(I_(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function kZt(e,t){return NL(NL({},t),e)}function TZt(e,t){return e==="symbols"}function q5e(e){var t=e.shapeType,n=e.elementProps;switch(t){case"rectangle":return Ae.createElement(wce,n);case"trapezoid":return Ae.createElement(CZt,n);case"sector":return Ae.createElement(b$e,n);case"symbols":if(TZt(t))return Ae.createElement($$,n);break;default:return null}}function IZt(e){return m.isValidElement(e)?e.props:e}function tne(e){var t=e.option,n=e.shapeType,r=e.propTransformer,s=r===void 0?kZt:r,a=e.activeClassName,o=a===void 0?"recharts-active-shape":a,l=e.isActive,c=NZt(e,SZt),u;if(m.isValidElement(t))u=m.cloneElement(t,NL(NL({},c),IZt(t)));else if(Ai(t))u=t(c);else if(cZt(t)&&!fZt(t)){var d=s(t,c);u=Ae.createElement(q5e,{shapeType:n,elementProps:d})}else{var f=c;u=Ae.createElement(q5e,{shapeType:n,elementProps:f})}return l?Ae.createElement(Sa,{className:o},u):u}function eU(e,t){return t!=null&&"trapezoids"in e.props}function tU(e,t){return t!=null&&"sectors"in e.props}function P_(e,t){return t!=null&&"points"in e.props}function PZt(e,t){var n,r,s=e.x===(t==null||(n=t.labelViewBox)===null||n===void 0?void 0:n.x)||e.x===t.x,a=e.y===(t==null||(r=t.labelViewBox)===null||r===void 0?void 0:r.y)||e.y===t.y;return s&&a}function FZt(e,t){var n=e.endAngle===t.endAngle,r=e.startAngle===t.startAngle;return n&&r}function OZt(e,t){var n=e.x===t.x,r=e.y===t.y,s=e.z===t.z;return n&&r&&s}function MZt(e,t){var n;return eU(e,t)?n=PZt:tU(e,t)?n=FZt:P_(e,t)&&(n=OZt),n}function RZt(e,t){var n;return eU(e,t)?n="trapezoids":tU(e,t)?n="sectors":P_(e,t)&&(n="points"),n}function LZt(e,t){if(eU(e,t)){var n;return(n=t.tooltipPayload)===null||n===void 0||(n=n[0])===null||n===void 0||(n=n.payload)===null||n===void 0?void 0:n.payload}if(tU(e,t)){var r;return(r=t.tooltipPayload)===null||r===void 0||(r=r[0])===null||r===void 0||(r=r.payload)===null||r===void 0?void 0:r.payload}return P_(e,t)?t.payload:{}}function DZt(e){var t=e.activeTooltipItem,n=e.graphicalItem,r=e.itemData,s=RZt(n,t),a=LZt(n,t),o=r.filter(function(c,u){var d=K3(a,c),f=n.props[s].filter(function(v){var w=MZt(n,t);return w(v,t)}),x=n.props[s].indexOf(f[f.length-1]),g=u===x;return d&&g}),l=r.indexOf(o[o.length-1]);return l}var hY,G5e;function BZt(){if(G5e)return hY;G5e=1;var e=Math.ceil,t=Math.max;function n(r,s,a,o){for(var l=-1,c=t(e((s-r)/(a||1)),0),u=Array(c);c--;)u[o?c:++l]=r,r+=a;return u}return hY=n,hY}var pY,K5e;function j$e(){if(K5e)return pY;K5e=1;var e=aBe(),t=1/0,n=17976931348623157e292;function r(s){if(!s)return s===0?s:0;if(s=e(s),s===t||s===-1/0){var a=s<0?-1:1;return a*n}return s===s?s:0}return pY=r,pY}var mY,Y5e;function $Zt(){if(Y5e)return mY;Y5e=1;var e=BZt(),t=H$(),n=j$e();function r(s){return function(a,o,l){return l&&typeof l!="number"&&t(a,o,l)&&(o=l=void 0),a=n(a),o===void 0?(o=a,a=0):o=n(o),l=l===void 0?a<o?1:-1:n(l),e(a,o,l,s)}}return mY=r,mY}var xY,X5e;function UZt(){if(X5e)return xY;X5e=1;var e=$Zt(),t=e();return xY=t,xY}var zZt=UZt();const AL=Ti(zZt);function F_(e){"@babel/helpers - typeof";return F_=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},F_(e)}function Q5e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function Z5e(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Q5e(Object(n),!0).forEach(function(r){E$e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Q5e(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function E$e(e,t,n){return t=HZt(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function HZt(e){var t=VZt(e,"string");return F_(t)=="symbol"?t:t+""}function VZt(e,t){if(F_(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(F_(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var WZt=["Webkit","Moz","O","ms"],qZt=function(t,n){var r=t.replace(/(\w)/,function(a){return a.toUpperCase()}),s=WZt.reduce(function(a,o){return Z5e(Z5e({},a),{},E$e({},o+r,n))},{});return s[t]=n,s};function PN(e){"@babel/helpers - typeof";return PN=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},PN(e)}function jL(){return jL=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},jL.apply(this,arguments)}function J5e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function gY(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?J5e(Object(n),!0).forEach(function(r){Tf(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):J5e(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function GZt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function e6e(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,k$e(r.key),r)}}function KZt(e,t,n){return e6e(e.prototype,t),e6e(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function YZt(e,t,n){return t=EL(t),XZt(e,_$e()?Reflect.construct(t,n,EL(e).constructor):t.apply(e,n))}function XZt(e,t){if(t&&(PN(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return QZt(e)}function QZt(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _$e(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(_$e=function(){return!!e})()}function EL(e){return EL=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},EL(e)}function ZZt(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&&nne(e,t)}function nne(e,t){return nne=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},nne(e,t)}function Tf(e,t,n){return t=k$e(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function k$e(e){var t=JZt(e,"string");return PN(t)=="symbol"?t:t+""}function JZt(e,t){if(PN(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(PN(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var eJt=function(t){var n=t.data,r=t.startIndex,s=t.endIndex,a=t.x,o=t.width,l=t.travellerWidth;if(!n||!n.length)return{};var c=n.length,u=i9().domain(AL(0,c)).range([a,a+o-l]),d=u.domain().map(function(f){return u(f)});return{isTextActive:!1,isSlideMoving:!1,isTravellerMoving:!1,isTravellerFocused:!1,startX:u(r),endX:u(s),scale:u,scaleValues:d}},t6e=function(t){return t.changedTouches&&!!t.changedTouches.length},FN=function(e){function t(n){var r;return GZt(this,t),r=YZt(this,t,[n]),Tf(r,"handleDrag",function(s){r.leaveTimer&&(clearTimeout(r.leaveTimer),r.leaveTimer=null),r.state.isTravellerMoving?r.handleTravellerMove(s):r.state.isSlideMoving&&r.handleSlideDrag(s)}),Tf(r,"handleTouchMove",function(s){s.changedTouches!=null&&s.changedTouches.length>0&&r.handleDrag(s.changedTouches[0])}),Tf(r,"handleDragEnd",function(){r.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var s=r.props,a=s.endIndex,o=s.onDragEnd,l=s.startIndex;o==null||o({endIndex:a,startIndex:l})}),r.detachDragEndListener()}),Tf(r,"handleLeaveWrapper",function(){(r.state.isTravellerMoving||r.state.isSlideMoving)&&(r.leaveTimer=window.setTimeout(r.handleDragEnd,r.props.leaveTimeOut))}),Tf(r,"handleEnterSlideOrTraveller",function(){r.setState({isTextActive:!0})}),Tf(r,"handleLeaveSlideOrTraveller",function(){r.setState({isTextActive:!1})}),Tf(r,"handleSlideDragStart",function(s){var a=t6e(s)?s.changedTouches[0]:s;r.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:a.pageX}),r.attachDragEndListener()}),r.travellerDragStartHandlers={startX:r.handleTravellerDragStart.bind(r,"startX"),endX:r.handleTravellerDragStart.bind(r,"endX")},r.state={},r}return ZZt(t,e),KZt(t,[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(r){var s=r.startX,a=r.endX,o=this.state.scaleValues,l=this.props,c=l.gap,u=l.data,d=u.length-1,f=Math.min(s,a),x=Math.max(s,a),g=t.getIndexInRange(o,f),v=t.getIndexInRange(o,x);return{startIndex:g-g%c,endIndex:v===d?d:v-v%c}}},{key:"getTextOfTick",value:function(r){var s=this.props,a=s.data,o=s.tickFormatter,l=s.dataKey,c=sc(a[r],l,r);return Ai(o)?o(c,r):c}},{key:"attachDragEndListener",value:function(){window.addEventListener("mouseup",this.handleDragEnd,!0),window.addEventListener("touchend",this.handleDragEnd,!0),window.addEventListener("mousemove",this.handleDrag,!0)}},{key:"detachDragEndListener",value:function(){window.removeEventListener("mouseup",this.handleDragEnd,!0),window.removeEventListener("touchend",this.handleDragEnd,!0),window.removeEventListener("mousemove",this.handleDrag,!0)}},{key:"handleSlideDrag",value:function(r){var s=this.state,a=s.slideMoveStartX,o=s.startX,l=s.endX,c=this.props,u=c.x,d=c.width,f=c.travellerWidth,x=c.startIndex,g=c.endIndex,v=c.onChange,w=r.pageX-a;w>0?w=Math.min(w,u+d-f-l,u+d-f-o):w<0&&(w=Math.max(w,u-o,u-l));var C=this.getIndex({startX:o+w,endX:l+w});(C.startIndex!==x||C.endIndex!==g)&&v&&v(C),this.setState({startX:o+w,endX:l+w,slideMoveStartX:r.pageX})}},{key:"handleTravellerDragStart",value:function(r,s){var a=t6e(s)?s.changedTouches[0]:s;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:r,brushMoveStartX:a.pageX}),this.attachDragEndListener()}},{key:"handleTravellerMove",value:function(r){var s=this.state,a=s.brushMoveStartX,o=s.movingTravellerId,l=s.endX,c=s.startX,u=this.state[o],d=this.props,f=d.x,x=d.width,g=d.travellerWidth,v=d.onChange,w=d.gap,C=d.data,N={startX:this.state.startX,endX:this.state.endX},P=r.pageX-a;P>0?P=Math.min(P,f+x-g-u):P<0&&(P=Math.max(P,f-u)),N[o]=u+P;var I=this.getIndex(N),R=I.startIndex,F=I.endIndex,U=function(){var z=C.length-1;return o==="startX"&&(l>c?R%w===0:F%w===0)||l<c&&F===z||o==="endX"&&(l>c?F%w===0:R%w===0)||l>c&&F===z};this.setState(Tf(Tf({},o,u+P),"brushMoveStartX",r.pageX),function(){v&&U()&&v(I)})}},{key:"handleTravellerMoveKeyboard",value:function(r,s){var a=this,o=this.state,l=o.scaleValues,c=o.startX,u=o.endX,d=this.state[s],f=l.indexOf(d);if(f!==-1){var x=f+r;if(!(x===-1||x>=l.length)){var g=l[x];s==="startX"&&g>=u||s==="endX"&&g<=c||this.setState(Tf({},s,g),function(){a.props.onChange(a.getIndex({startX:a.state.startX,endX:a.state.endX}))})}}}},{key:"renderBackground",value:function(){var r=this.props,s=r.x,a=r.y,o=r.width,l=r.height,c=r.fill,u=r.stroke;return Ae.createElement("rect",{stroke:u,fill:c,x:s,y:a,width:o,height:l})}},{key:"renderPanorama",value:function(){var r=this.props,s=r.x,a=r.y,o=r.width,l=r.height,c=r.data,u=r.children,d=r.padding,f=m.Children.only(u);return f?Ae.cloneElement(f,{x:s,y:a,width:o,height:l,margin:d,compact:!0,data:c}):null}},{key:"renderTravellerLayer",value:function(r,s){var a,o,l=this,c=this.props,u=c.y,d=c.travellerWidth,f=c.height,x=c.traveller,g=c.ariaLabel,v=c.data,w=c.startIndex,C=c.endIndex,N=Math.max(r,this.props.x),P=gY(gY({},vi(this.props,!1)),{},{x:N,y:u,width:d,height:f}),I=g||"Min value: ".concat((a=v[w])===null||a===void 0?void 0:a.name,", Max value: ").concat((o=v[C])===null||o===void 0?void 0:o.name);return Ae.createElement(Sa,{tabIndex:0,role:"slider","aria-label":I,"aria-valuenow":r,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[s],onTouchStart:this.travellerDragStartHandlers[s],onKeyDown:function(F){["ArrowLeft","ArrowRight"].includes(F.key)&&(F.preventDefault(),F.stopPropagation(),l.handleTravellerMoveKeyboard(F.key==="ArrowRight"?1:-1,s))},onFocus:function(){l.setState({isTravellerFocused:!0})},onBlur:function(){l.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},t.renderTraveller(x,P))}},{key:"renderSlide",value:function(r,s){var a=this.props,o=a.y,l=a.height,c=a.stroke,u=a.travellerWidth,d=Math.min(r,s)+u,f=Math.max(Math.abs(s-r)-u,0);return Ae.createElement("rect",{className:"recharts-brush-slide",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.handleSlideDragStart,onTouchStart:this.handleSlideDragStart,style:{cursor:"move"},stroke:"none",fill:c,fillOpacity:.2,x:d,y:o,width:f,height:l})}},{key:"renderText",value:function(){var r=this.props,s=r.startIndex,a=r.endIndex,o=r.y,l=r.height,c=r.travellerWidth,u=r.stroke,d=this.state,f=d.startX,x=d.endX,g=5,v={pointerEvents:"none",fill:u};return Ae.createElement(Sa,{className:"recharts-brush-texts"},Ae.createElement(nL,jL({textAnchor:"end",verticalAnchor:"middle",x:Math.min(f,x)-g,y:o+l/2},v),this.getTextOfTick(s)),Ae.createElement(nL,jL({textAnchor:"start",verticalAnchor:"middle",x:Math.max(f,x)+c+g,y:o+l/2},v),this.getTextOfTick(a)))}},{key:"render",value:function(){var r=this.props,s=r.data,a=r.className,o=r.children,l=r.x,c=r.y,u=r.width,d=r.height,f=r.alwaysShowText,x=this.state,g=x.startX,v=x.endX,w=x.isTextActive,C=x.isSlideMoving,N=x.isTravellerMoving,P=x.isTravellerFocused;if(!s||!s.length||!rs(l)||!rs(c)||!rs(u)||!rs(d)||u<=0||d<=0)return null;var I=sa("recharts-brush",a),R=Ae.Children.count(o)===1,F=qZt("userSelect","none");return Ae.createElement(Sa,{className:I,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:F},this.renderBackground(),R&&this.renderPanorama(),this.renderSlide(g,v),this.renderTravellerLayer(g,"startX"),this.renderTravellerLayer(v,"endX"),(w||C||N||P||f)&&this.renderText())}}],[{key:"renderDefaultTraveller",value:function(r){var s=r.x,a=r.y,o=r.width,l=r.height,c=r.stroke,u=Math.floor(a+l/2)-1;return Ae.createElement(Ae.Fragment,null,Ae.createElement("rect",{x:s,y:a,width:o,height:l,fill:c,stroke:"none"}),Ae.createElement("line",{x1:s+1,y1:u,x2:s+o-1,y2:u,fill:"none",stroke:"#fff"}),Ae.createElement("line",{x1:s+1,y1:u+2,x2:s+o-1,y2:u+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(r,s){var a;return Ae.isValidElement(r)?a=Ae.cloneElement(r,s):Ai(r)?a=r(s):a=t.renderDefaultTraveller(s),a}},{key:"getDerivedStateFromProps",value:function(r,s){var a=r.data,o=r.width,l=r.x,c=r.travellerWidth,u=r.updateId,d=r.startIndex,f=r.endIndex;if(a!==s.prevData||u!==s.prevUpdateId)return gY({prevData:a,prevTravellerWidth:c,prevUpdateId:u,prevX:l,prevWidth:o},a&&a.length?eJt({data:a,width:o,x:l,travellerWidth:c,startIndex:d,endIndex:f}):{scale:null,scaleValues:null});if(s.scale&&(o!==s.prevWidth||l!==s.prevX||c!==s.prevTravellerWidth)){s.scale.range([l,l+o-c]);var x=s.scale.domain().map(function(g){return s.scale(g)});return{prevData:a,prevTravellerWidth:c,prevUpdateId:u,prevX:l,prevWidth:o,startX:s.scale(r.startIndex),endX:s.scale(r.endIndex),scaleValues:x}}return null}},{key:"getIndexInRange",value:function(r,s){for(var a=r.length,o=0,l=a-1;l-o>1;){var c=Math.floor((o+l)/2);r[c]>s?l=c:o=c}return s>=r[l]?l:o}}])}(m.PureComponent);Tf(FN,"displayName","Brush");Tf(FN,"defaultProps",{height:40,travellerWidth:5,gap:1,fill:"#fff",stroke:"#666",padding:{top:1,right:1,bottom:1,left:1},leaveTimeOut:1e3,alwaysShowText:!1});var bY,n6e;function tJt(){if(n6e)return bY;n6e=1;var e=qle();function t(n,r){var s;return e(n,function(a,o,l){return s=r(a,o,l),!s}),!!s}return bY=t,bY}var yY,r6e;function nJt(){if(r6e)return yY;r6e=1;var e=LDe(),t=x2(),n=tJt(),r=df(),s=H$();function a(o,l,c){var u=r(o)?e:n;return c&&s(o,l,c)&&(l=void 0),u(o,t(l,3))}return yY=a,yY}var rJt=nJt();const sJt=Ti(rJt);var H0=function(t,n){var r=t.alwaysShow,s=t.ifOverflow;return r&&(s="extendDomain"),s===n},vY,s6e;function iJt(){if(s6e)return vY;s6e=1;var e=tBe();function t(n,r,s){r=="__proto__"&&e?e(n,r,{configurable:!0,enumerable:!0,value:s,writable:!0}):n[r]=s}return vY=t,vY}var wY,i6e;function aJt(){if(i6e)return wY;i6e=1;var e=iJt(),t=JDe(),n=x2();function r(s,a){var o={};return a=n(a,3),t(s,function(l,c,u){e(o,c,a(l,c,u))}),o}return wY=r,wY}var oJt=aJt();const lJt=Ti(oJt);var CY,a6e;function cJt(){if(a6e)return CY;a6e=1;function e(t,n){for(var r=-1,s=t==null?0:t.length;++r<s;)if(!n(t[r],r,t))return!1;return!0}return CY=e,CY}var SY,o6e;function uJt(){if(o6e)return SY;o6e=1;var e=qle();function t(n,r){var s=!0;return e(n,function(a,o,l){return s=!!r(a,o,l),s}),s}return SY=t,SY}var NY,l6e;function dJt(){if(l6e)return NY;l6e=1;var e=cJt(),t=uJt(),n=x2(),r=df(),s=H$();function a(o,l,c){var u=r(o)?e:t;return c&&s(o,l,c)&&(l=void 0),u(o,n(l,3))}return NY=a,NY}var fJt=dJt();const T$e=Ti(fJt);var hJt=["x","y"];function O_(e){"@babel/helpers - typeof";return O_=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},O_(e)}function rne(){return rne=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},rne.apply(this,arguments)}function c6e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function z7(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?c6e(Object(n),!0).forEach(function(r){pJt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):c6e(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function pJt(e,t,n){return t=mJt(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function mJt(e){var t=xJt(e,"string");return O_(t)=="symbol"?t:t+""}function xJt(e,t){if(O_(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(O_(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function gJt(e,t){if(e==null)return{};var n=bJt(e,t),r,s;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(s=0;s<a.length;s++)r=a[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function bJt(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function yJt(e,t){var n=e.x,r=e.y,s=gJt(e,hJt),a="".concat(n),o=parseInt(a,10),l="".concat(r),c=parseInt(l,10),u="".concat(t.height||s.height),d=parseInt(u,10),f="".concat(t.width||s.width),x=parseInt(f,10);return z7(z7(z7(z7(z7({},t),s),o?{x:o}:{}),c?{y:c}:{}),{},{height:d,width:x,name:t.name,radius:t.radius})}function u6e(e){return Ae.createElement(tne,rne({shapeType:"rectangle",propTransformer:yJt,activeClassName:"recharts-active-bar"},e))}var vJt=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return function(r,s){if(typeof t=="number")return t;var a=typeof r=="number";return a?t(r,s):(a||X3(),n)}},wJt=["value","background"],I$e;function ON(e){"@babel/helpers - typeof";return ON=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},ON(e)}function CJt(e,t){if(e==null)return{};var n=SJt(e,t),r,s;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(s=0;s<a.length;s++)r=a[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function SJt(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function _L(){return _L=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},_L.apply(this,arguments)}function d6e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function Ml(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?d6e(Object(n),!0).forEach(function(r){by(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):d6e(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function NJt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function f6e(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,F$e(r.key),r)}}function AJt(e,t,n){return f6e(e.prototype,t),f6e(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function jJt(e,t,n){return t=kL(t),EJt(e,P$e()?Reflect.construct(t,n,kL(e).constructor):t.apply(e,n))}function EJt(e,t){if(t&&(ON(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return _Jt(e)}function _Jt(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function P$e(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(P$e=function(){return!!e})()}function kL(e){return kL=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},kL(e)}function kJt(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&&sne(e,t)}function sne(e,t){return sne=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},sne(e,t)}function by(e,t,n){return t=F$e(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function F$e(e){var t=TJt(e,"string");return ON(t)=="symbol"?t:t+""}function TJt(e,t){if(ON(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(ON(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var t8=function(e){function t(){var n;NJt(this,t);for(var r=arguments.length,s=new Array(r),a=0;a<r;a++)s[a]=arguments[a];return n=jJt(this,t,[].concat(s)),by(n,"state",{isAnimationFinished:!1}),by(n,"id",S5("recharts-bar-")),by(n,"handleAnimationEnd",function(){var o=n.props.onAnimationEnd;n.setState({isAnimationFinished:!0}),o&&o()}),by(n,"handleAnimationStart",function(){var o=n.props.onAnimationStart;n.setState({isAnimationFinished:!1}),o&&o()}),n}return kJt(t,e),AJt(t,[{key:"renderRectanglesStatically",value:function(r){var s=this,a=this.props,o=a.shape,l=a.dataKey,c=a.activeIndex,u=a.activeBar,d=vi(this.props,!1);return r&&r.map(function(f,x){var g=x===c,v=g?u:o,w=Ml(Ml(Ml({},d),f),{},{isActive:g,option:v,index:x,dataKey:l,onAnimationStart:s.handleAnimationStart,onAnimationEnd:s.handleAnimationEnd});return Ae.createElement(Sa,_L({className:"recharts-bar-rectangle"},r_(s.props,f,x),{key:"rectangle-".concat(f==null?void 0:f.x,"-").concat(f==null?void 0:f.y,"-").concat(f==null?void 0:f.value,"-").concat(x)}),Ae.createElement(u6e,w))})}},{key:"renderRectanglesWithAnimation",value:function(){var r=this,s=this.props,a=s.data,o=s.layout,l=s.isAnimationActive,c=s.animationBegin,u=s.animationDuration,d=s.animationEasing,f=s.animationId,x=this.state.prevData;return Ae.createElement(Cm,{begin:c,duration:u,isActive:l,easing:d,from:{t:0},to:{t:1},key:"bar-".concat(f),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(g){var v=g.t,w=a.map(function(C,N){var P=x&&x[N];if(P){var I=wl(P.x,C.x),R=wl(P.y,C.y),F=wl(P.width,C.width),U=wl(P.height,C.height);return Ml(Ml({},C),{},{x:I(v),y:R(v),width:F(v),height:U(v)})}if(o==="horizontal"){var L=wl(0,C.height),z=L(v);return Ml(Ml({},C),{},{y:C.y+C.height-z,height:z})}var Q=wl(0,C.width),ne=Q(v);return Ml(Ml({},C),{},{width:ne})});return Ae.createElement(Sa,null,r.renderRectanglesStatically(w))})}},{key:"renderRectangles",value:function(){var r=this.props,s=r.data,a=r.isAnimationActive,o=this.state.prevData;return a&&s&&s.length&&(!o||!K3(o,s))?this.renderRectanglesWithAnimation():this.renderRectanglesStatically(s)}},{key:"renderBackground",value:function(){var r=this,s=this.props,a=s.data,o=s.dataKey,l=s.activeIndex,c=vi(this.props.background,!1);return a.map(function(u,d){u.value;var f=u.background,x=CJt(u,wJt);if(!f)return null;var g=Ml(Ml(Ml(Ml(Ml({},x),{},{fill:"#eee"},f),c),r_(r.props,u,d)),{},{onAnimationStart:r.handleAnimationStart,onAnimationEnd:r.handleAnimationEnd,dataKey:o,index:d,className:"recharts-bar-background-rectangle"});return Ae.createElement(u6e,_L({key:"background-bar-".concat(d),option:r.props.background,isActive:d===l},g))})}},{key:"renderErrorBar",value:function(r,s){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var a=this.props,o=a.data,l=a.xAxis,c=a.yAxis,u=a.layout,d=a.children,f=sf(d,e8);if(!f)return null;var x=u==="vertical"?o[0].height/2:o[0].width/2,g=function(C,N){var P=Array.isArray(C.value)?C.value[1]:C.value;return{x:C.x,y:C.y,value:P,errorVal:sc(C,N)}},v={clipPath:r?"url(#clipPath-".concat(s,")"):null};return Ae.createElement(Sa,v,f.map(function(w){return Ae.cloneElement(w,{key:"error-bar-".concat(s,"-").concat(w.props.dataKey),data:o,xAxis:l,yAxis:c,layout:u,offset:x,dataPointFormatter:g})}))}},{key:"render",value:function(){var r=this.props,s=r.hide,a=r.data,o=r.className,l=r.xAxis,c=r.yAxis,u=r.left,d=r.top,f=r.width,x=r.height,g=r.isAnimationActive,v=r.background,w=r.id;if(s||!a||!a.length)return null;var C=this.state.isAnimationFinished,N=sa("recharts-bar",o),P=l&&l.allowDataOverflow,I=c&&c.allowDataOverflow,R=P||I,F=wi(w)?this.id:w;return Ae.createElement(Sa,{className:N},P||I?Ae.createElement("defs",null,Ae.createElement("clipPath",{id:"clipPath-".concat(F)},Ae.createElement("rect",{x:P?u:u-f/2,y:I?d:d-x/2,width:P?f:f*2,height:I?x:x*2}))):null,Ae.createElement(Sa,{className:"recharts-bar-rectangles",clipPath:R?"url(#clipPath-".concat(F,")"):null},v?this.renderBackground():null,this.renderRectangles()),this.renderErrorBar(R,F),(!g||C)&&z0.renderCallByParent(this.props,a))}}],[{key:"getDerivedStateFromProps",value:function(r,s){return r.animationId!==s.prevAnimationId?{prevAnimationId:r.animationId,curData:r.data,prevData:s.curData}:r.data!==s.curData?{curData:r.data}:null}}])}(m.PureComponent);I$e=t8;by(t8,"displayName","Bar");by(t8,"defaultProps",{xAxisId:0,yAxisId:0,legendType:"rect",minPointSize:0,hide:!1,data:[],layout:"vertical",activeBar:!1,isAnimationActive:!pm.isSsr,animationBegin:0,animationDuration:400,animationEasing:"ease"});by(t8,"getComposedData",function(e){var t=e.props,n=e.item,r=e.barPosition,s=e.bandSize,a=e.xAxis,o=e.yAxis,l=e.xAxisTicks,c=e.yAxisTicks,u=e.stackedData,d=e.dataStartIndex,f=e.displayedData,x=e.offset,g=JKt(r,n);if(!g)return null;var v=t.layout,w=n.type.defaultProps,C=w!==void 0?Ml(Ml({},w),n.props):n.props,N=C.dataKey,P=C.children,I=C.minPointSize,R=v==="horizontal"?o:a,F=u?R.scale.domain():null,U=oYt({numericAxis:R}),L=sf(P,Yle),z=f.map(function(Q,ne){var J,X,re,pe,Y,ie;u?J=eYt(u[d+ne],F):(J=sc(Q,N),Array.isArray(J)||(J=[U,J]));var oe=vJt(I,I$e.defaultProps.minPointSize)(J[1],ne);if(v==="horizontal"){var G,V=[o.scale(J[0]),o.scale(J[1])],ee=V[0],ae=V[1];X=Z3e({axis:a,ticks:l,bandSize:s,offset:g.offset,entry:Q,index:ne}),re=(G=ae??ee)!==null&&G!==void 0?G:void 0,pe=g.size;var fe=ee-ae;if(Y=Number.isNaN(fe)?0:fe,ie={x:X,y:o.y,width:pe,height:o.height},Math.abs(oe)>0&&Math.abs(Y)<Math.abs(oe)){var Ne=lm(Y||oe)*(Math.abs(oe)-Math.abs(Y));re-=Ne,Y+=Ne}}else{var he=[a.scale(J[0]),a.scale(J[1])],ge=he[0],ye=he[1];if(X=ge,re=Z3e({axis:o,ticks:c,bandSize:s,offset:g.offset,entry:Q,index:ne}),pe=ye-ge,Y=g.size,ie={x:a.x,y:re,width:a.width,height:Y},Math.abs(oe)>0&&Math.abs(pe)<Math.abs(oe)){var ve=lm(pe||oe)*(Math.abs(oe)-Math.abs(pe));pe+=ve}}return Ml(Ml(Ml({},Q),{},{x:X,y:re,width:pe,height:Y,value:u?J:J[1],payload:Q,background:ie},L[ne]&&L[ne].props),{},{tooltipPayload:[m$e(n,Q)],tooltipPosition:{x:X+pe/2,y:re+Y/2}})});return Ml({data:z,layout:v},x)});function M_(e){"@babel/helpers - typeof";return M_=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},M_(e)}function IJt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function h6e(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,O$e(r.key),r)}}function PJt(e,t,n){return h6e(e.prototype,t),h6e(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function p6e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function Xp(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?p6e(Object(n),!0).forEach(function(r){nU(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):p6e(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function nU(e,t,n){return t=O$e(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function O$e(e){var t=FJt(e,"string");return M_(t)=="symbol"?t:t+""}function FJt(e,t){if(M_(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(M_(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var M$e=function(t,n,r,s,a){var o=t.width,l=t.height,c=t.layout,u=t.children,d=Object.keys(n),f={left:r.left,leftMirror:r.left,right:o-r.right,rightMirror:o-r.right,top:r.top,topMirror:r.top,bottom:l-r.bottom,bottomMirror:l-r.bottom},x=!!Mf(u,t8);return d.reduce(function(g,v){var w=n[v],C=w.orientation,N=w.domain,P=w.padding,I=P===void 0?{}:P,R=w.mirror,F=w.reversed,U="".concat(C).concat(R?"Mirror":""),L,z,Q,ne,J;if(w.type==="number"&&(w.padding==="gap"||w.padding==="no-gap")){var X=N[1]-N[0],re=1/0,pe=w.categoricalDomain.sort(B$t);if(pe.forEach(function(he,ge){ge>0&&(re=Math.min((he||0)-(pe[ge-1]||0),re))}),Number.isFinite(re)){var Y=re/X,ie=w.layout==="vertical"?r.height:r.width;if(w.padding==="gap"&&(L=Y*ie/2),w.padding==="no-gap"){var oe=G3(t.barCategoryGap,Y*ie),G=Y*ie/2;L=G-oe-(G-oe)/ie*oe}}}s==="xAxis"?z=[r.left+(I.left||0)+(L||0),r.left+r.width-(I.right||0)-(L||0)]:s==="yAxis"?z=c==="horizontal"?[r.top+r.height-(I.bottom||0),r.top+(I.top||0)]:[r.top+(I.top||0)+(L||0),r.top+r.height-(I.bottom||0)-(L||0)]:z=w.range,F&&(z=[z[1],z[0]]);var V=QKt(w,a,x),ee=V.scale,ae=V.realScaleType;ee.domain(N).range(z),ZKt(ee);var fe=aYt(ee,Xp(Xp({},w),{},{realScaleType:ae}));s==="xAxis"?(J=C==="top"&&!R||C==="bottom"&&R,Q=r.left,ne=f[U]-J*w.height):s==="yAxis"&&(J=C==="left"&&!R||C==="right"&&R,Q=f[U]-J*w.width,ne=r.top);var Ne=Xp(Xp(Xp({},w),fe),{},{realScaleType:ae,x:Q,y:ne,scale:ee,width:s==="xAxis"?r.width:w.width,height:s==="yAxis"?r.height:w.height});return Ne.bandSize=xL(Ne,fe),!w.hide&&s==="xAxis"?f[U]+=(J?-1:1)*Ne.height:w.hide||(f[U]+=(J?-1:1)*Ne.width),Xp(Xp({},g),{},nU({},v,Ne))},{})},R$e=function(t,n){var r=t.x,s=t.y,a=n.x,o=n.y;return{x:Math.min(r,a),y:Math.min(s,o),width:Math.abs(a-r),height:Math.abs(o-s)}},OJt=function(t){var n=t.x1,r=t.y1,s=t.x2,a=t.y2;return R$e({x:n,y:r},{x:s,y:a})},L$e=function(){function e(t){IJt(this,e),this.scale=t}return PJt(e,[{key:"domain",get:function(){return this.scale.domain}},{key:"range",get:function(){return this.scale.range}},{key:"rangeMin",get:function(){return this.range()[0]}},{key:"rangeMax",get:function(){return this.range()[1]}},{key:"bandwidth",get:function(){return this.scale.bandwidth}},{key:"apply",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=r.bandAware,a=r.position;if(n!==void 0){if(a)switch(a){case"start":return this.scale(n);case"middle":{var o=this.bandwidth?this.bandwidth()/2:0;return this.scale(n)+o}case"end":{var l=this.bandwidth?this.bandwidth():0;return this.scale(n)+l}default:return this.scale(n)}if(s){var c=this.bandwidth?this.bandwidth()/2:0;return this.scale(n)+c}return this.scale(n)}}},{key:"isInRange",value:function(n){var r=this.range(),s=r[0],a=r[r.length-1];return s<=a?n>=s&&n<=a:n>=a&&n<=s}}],[{key:"create",value:function(n){return new e(n)}}])}();nU(L$e,"EPS",1e-4);var Cce=function(t){var n=Object.keys(t).reduce(function(r,s){return Xp(Xp({},r),{},nU({},s,L$e.create(t[s])))},{});return Xp(Xp({},n),{},{apply:function(s){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=a.bandAware,l=a.position;return lJt(s,function(c,u){return n[u].apply(c,{bandAware:o,position:l})})},isInRange:function(s){return T$e(s,function(a,o){return n[o].isInRange(a)})}})};function MJt(e){return(e%180+180)%180}var RJt=function(t){var n=t.width,r=t.height,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=MJt(s),o=a*Math.PI/180,l=Math.atan(r/n),c=o>l&&o<Math.PI-l?r/Math.sin(o):n/Math.cos(o);return Math.abs(c)},AY,m6e;function LJt(){if(m6e)return AY;m6e=1;var e=x2(),t=cT(),n=U$();function r(s){return function(a,o,l){var c=Object(a);if(!t(a)){var u=e(o,3);a=n(a),o=function(f){return u(c[f],f,c)}}var d=s(a,o,l);return d>-1?c[u?a[d]:d]:void 0}}return AY=r,AY}var jY,x6e;function DJt(){if(x6e)return jY;x6e=1;var e=j$e();function t(n){var r=e(n),s=r%1;return r===r?s?r-s:r:0}return jY=t,jY}var EY,g6e;function BJt(){if(g6e)return EY;g6e=1;var e=KDe(),t=x2(),n=DJt(),r=Math.max;function s(a,o,l){var c=a==null?0:a.length;if(!c)return-1;var u=l==null?0:n(l);return u<0&&(u=r(c+u,0)),e(a,t(o,3),u)}return EY=s,EY}var _Y,b6e;function $Jt(){if(b6e)return _Y;b6e=1;var e=LJt(),t=BJt(),n=e(t);return _Y=n,_Y}var UJt=$Jt();const zJt=Ti(UJt);var HJt=cDe();const VJt=Ti(HJt);var WJt=VJt(function(e){return{x:e.left,y:e.top,width:e.width,height:e.height}},function(e){return["l",e.left,"t",e.top,"w",e.width,"h",e.height].join("")}),Sce=m.createContext(void 0),Nce=m.createContext(void 0),D$e=m.createContext(void 0),B$e=m.createContext({}),$$e=m.createContext(void 0),U$e=m.createContext(0),z$e=m.createContext(0),y6e=function(t){var n=t.state,r=n.xAxisMap,s=n.yAxisMap,a=n.offset,o=t.clipPathId,l=t.children,c=t.width,u=t.height,d=WJt(a);return Ae.createElement(Sce.Provider,{value:r},Ae.createElement(Nce.Provider,{value:s},Ae.createElement(B$e.Provider,{value:a},Ae.createElement(D$e.Provider,{value:d},Ae.createElement($$e.Provider,{value:o},Ae.createElement(U$e.Provider,{value:u},Ae.createElement(z$e.Provider,{value:c},l)))))))},qJt=function(){return m.useContext($$e)},H$e=function(t){var n=m.useContext(Sce);n==null&&X3();var r=n[t];return r==null&&X3(),r},GJt=function(){var t=m.useContext(Sce);return Mb(t)},KJt=function(){var t=m.useContext(Nce),n=zJt(t,function(r){return T$e(r.domain,Number.isFinite)});return n||Mb(t)},V$e=function(t){var n=m.useContext(Nce);n==null&&X3();var r=n[t];return r==null&&X3(),r},YJt=function(){var t=m.useContext(D$e);return t},XJt=function(){return m.useContext(B$e)},Ace=function(){return m.useContext(z$e)},jce=function(){return m.useContext(U$e)};function MN(e){"@babel/helpers - typeof";return MN=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},MN(e)}function QJt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ZJt(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,q$e(r.key),r)}}function JJt(e,t,n){return ZJt(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function een(e,t,n){return t=TL(t),ten(e,W$e()?Reflect.construct(t,n||[],TL(e).constructor):t.apply(e,n))}function ten(e,t){if(t&&(MN(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return nen(e)}function nen(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function W$e(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(W$e=function(){return!!e})()}function TL(e){return TL=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},TL(e)}function ren(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&&ine(e,t)}function ine(e,t){return ine=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},ine(e,t)}function v6e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function w6e(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?v6e(Object(n),!0).forEach(function(r){Ece(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):v6e(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Ece(e,t,n){return t=q$e(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function q$e(e){var t=sen(e,"string");return MN(t)=="symbol"?t:t+""}function sen(e,t){if(MN(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(MN(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ien(e,t){return cen(e)||len(e,t)||oen(e,t)||aen()}function aen(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function oen(e,t){if(e){if(typeof e=="string")return C6e(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return C6e(e,t)}}function C6e(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function len(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,s,a,o,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(d){u=!0,s=d}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw s}}return l}}function cen(e){if(Array.isArray(e))return e}function ane(){return ane=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ane.apply(this,arguments)}var uen=function(t,n){var r;return Ae.isValidElement(t)?r=Ae.cloneElement(t,n):Ai(t)?r=t(n):r=Ae.createElement("line",ane({},n,{className:"recharts-reference-line-line"})),r},den=function(t,n,r,s,a,o,l,c,u){var d=a.x,f=a.y,x=a.width,g=a.height;if(r){var v=u.y,w=t.y.apply(v,{position:o});if(H0(u,"discard")&&!t.y.isInRange(w))return null;var C=[{x:d+x,y:w},{x:d,y:w}];return c==="left"?C.reverse():C}if(n){var N=u.x,P=t.x.apply(N,{position:o});if(H0(u,"discard")&&!t.x.isInRange(P))return null;var I=[{x:P,y:f+g},{x:P,y:f}];return l==="top"?I.reverse():I}if(s){var R=u.segment,F=R.map(function(U){return t.apply(U,{position:o})});return H0(u,"discard")&&sJt(F,function(U){return!t.isInRange(U)})?null:F}return null};function fen(e){var t=e.x,n=e.y,r=e.segment,s=e.xAxisId,a=e.yAxisId,o=e.shape,l=e.className,c=e.alwaysShow,u=qJt(),d=H$e(s),f=V$e(a),x=YJt();if(!u||!x)return null;Qg(c===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var g=Cce({x:d.scale,y:f.scale}),v=rc(t),w=rc(n),C=r&&r.length===2,N=den(g,v,w,C,x,e.position,d.orientation,f.orientation,e);if(!N)return null;var P=ien(N,2),I=P[0],R=I.x,F=I.y,U=P[1],L=U.x,z=U.y,Q=H0(e,"hidden")?"url(#".concat(u,")"):void 0,ne=w6e(w6e({clipPath:Q},vi(e,!0)),{},{x1:R,y1:F,x2:L,y2:z});return Ae.createElement(Sa,{className:sa("recharts-reference-line",l)},uen(o,ne),ju.renderCallByParent(e,OJt({x1:R,y1:F,x2:L,y2:z})))}var _ce=function(e){function t(){return QJt(this,t),een(this,t,arguments)}return ren(t,e),JJt(t,[{key:"render",value:function(){return Ae.createElement(fen,this.props)}}])}(Ae.Component);Ece(_ce,"displayName","ReferenceLine");Ece(_ce,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,fill:"none",stroke:"#ccc",fillOpacity:1,strokeWidth:1,position:"middle"});function one(){return one=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},one.apply(this,arguments)}function RN(e){"@babel/helpers - typeof";return RN=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},RN(e)}function S6e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function N6e(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?S6e(Object(n),!0).forEach(function(r){rU(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):S6e(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function hen(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function pen(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,K$e(r.key),r)}}function men(e,t,n){return pen(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function xen(e,t,n){return t=IL(t),gen(e,G$e()?Reflect.construct(t,n||[],IL(e).constructor):t.apply(e,n))}function gen(e,t){if(t&&(RN(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return ben(e)}function ben(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function G$e(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(G$e=function(){return!!e})()}function IL(e){return IL=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},IL(e)}function yen(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&&lne(e,t)}function lne(e,t){return lne=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},lne(e,t)}function rU(e,t,n){return t=K$e(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function K$e(e){var t=ven(e,"string");return RN(t)=="symbol"?t:t+""}function ven(e,t){if(RN(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(RN(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var wen=function(t){var n=t.x,r=t.y,s=t.xAxis,a=t.yAxis,o=Cce({x:s.scale,y:a.scale}),l=o.apply({x:n,y:r},{bandAware:!0});return H0(t,"discard")&&!o.isInRange(l)?null:l},sU=function(e){function t(){return hen(this,t),xen(this,t,arguments)}return yen(t,e),men(t,[{key:"render",value:function(){var r=this.props,s=r.x,a=r.y,o=r.r,l=r.alwaysShow,c=r.clipPathId,u=rc(s),d=rc(a);if(Qg(l===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.'),!u||!d)return null;var f=wen(this.props);if(!f)return null;var x=f.x,g=f.y,v=this.props,w=v.shape,C=v.className,N=H0(this.props,"hidden")?"url(#".concat(c,")"):void 0,P=N6e(N6e({clipPath:N},vi(this.props,!0)),{},{cx:x,cy:g});return Ae.createElement(Sa,{className:sa("recharts-reference-dot",C)},t.renderDot(w,P),ju.renderCallByParent(this.props,{x:x-o,y:g-o,width:2*o,height:2*o}))}}])}(Ae.Component);rU(sU,"displayName","ReferenceDot");rU(sU,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#fff",stroke:"#ccc",fillOpacity:1,strokeWidth:1});rU(sU,"renderDot",function(e,t){var n;return Ae.isValidElement(e)?n=Ae.cloneElement(e,t):Ai(e)?n=e(t):n=Ae.createElement(J$,one({},t,{cx:t.cx,cy:t.cy,className:"recharts-reference-dot-dot"})),n});function cne(){return cne=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},cne.apply(this,arguments)}function LN(e){"@babel/helpers - typeof";return LN=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},LN(e)}function A6e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function j6e(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?A6e(Object(n),!0).forEach(function(r){iU(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):A6e(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Cen(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Sen(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,X$e(r.key),r)}}function Nen(e,t,n){return Sen(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Aen(e,t,n){return t=PL(t),jen(e,Y$e()?Reflect.construct(t,n||[],PL(e).constructor):t.apply(e,n))}function jen(e,t){if(t&&(LN(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Een(e)}function Een(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Y$e(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Y$e=function(){return!!e})()}function PL(e){return PL=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},PL(e)}function _en(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&&une(e,t)}function une(e,t){return une=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},une(e,t)}function iU(e,t,n){return t=X$e(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function X$e(e){var t=ken(e,"string");return LN(t)=="symbol"?t:t+""}function ken(e,t){if(LN(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(LN(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Ten=function(t,n,r,s,a){var o=a.x1,l=a.x2,c=a.y1,u=a.y2,d=a.xAxis,f=a.yAxis;if(!d||!f)return null;var x=Cce({x:d.scale,y:f.scale}),g={x:t?x.x.apply(o,{position:"start"}):x.x.rangeMin,y:r?x.y.apply(c,{position:"start"}):x.y.rangeMin},v={x:n?x.x.apply(l,{position:"end"}):x.x.rangeMax,y:s?x.y.apply(u,{position:"end"}):x.y.rangeMax};return H0(a,"discard")&&(!x.isInRange(g)||!x.isInRange(v))?null:R$e(g,v)},aU=function(e){function t(){return Cen(this,t),Aen(this,t,arguments)}return _en(t,e),Nen(t,[{key:"render",value:function(){var r=this.props,s=r.x1,a=r.x2,o=r.y1,l=r.y2,c=r.className,u=r.alwaysShow,d=r.clipPathId;Qg(u===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var f=rc(s),x=rc(a),g=rc(o),v=rc(l),w=this.props.shape;if(!f&&!x&&!g&&!v&&!w)return null;var C=Ten(f,x,g,v,this.props);if(!C&&!w)return null;var N=H0(this.props,"hidden")?"url(#".concat(d,")"):void 0;return Ae.createElement(Sa,{className:sa("recharts-reference-area",c)},t.renderRect(w,j6e(j6e({clipPath:N},vi(this.props,!0)),C)),ju.renderCallByParent(this.props,C))}}])}(Ae.Component);iU(aU,"displayName","ReferenceArea");iU(aU,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#ccc",fillOpacity:.5,stroke:"none",strokeWidth:1});iU(aU,"renderRect",function(e,t){var n;return Ae.isValidElement(e)?n=Ae.cloneElement(e,t):Ai(e)?n=e(t):n=Ae.createElement(wce,cne({},t,{className:"recharts-reference-area-rect"})),n});function Q$e(e,t,n){if(t<1)return[];if(t===1&&n===void 0)return e;for(var r=[],s=0;s<e.length;s+=t)r.push(e[s]);return r}function Ien(e,t,n){var r={width:e.width+t.width,height:e.height+t.height};return RJt(r,n)}function Pen(e,t,n){var r=n==="width",s=e.x,a=e.y,o=e.width,l=e.height;return t===1?{start:r?s:a,end:r?s+o:a+l}:{start:r?s+o:a+l,end:r?s:a}}function FL(e,t,n,r,s){if(e*t<e*r||e*t>e*s)return!1;var a=n();return e*(t-e*a/2-r)>=0&&e*(t+e*a/2-s)<=0}function Fen(e,t){return Q$e(e,t+1)}function Oen(e,t,n,r,s){for(var a=(r||[]).slice(),o=t.start,l=t.end,c=0,u=1,d=o,f=function(){var v=r==null?void 0:r[c];if(v===void 0)return{v:Q$e(r,u)};var w=c,C,N=function(){return C===void 0&&(C=n(v,w)),C},P=v.coordinate,I=c===0||FL(e,P,N,d,l);I||(c=0,d=o,u+=1),I&&(d=P+e*(N()/2+s),c+=u)},x;u<=a.length;)if(x=f(),x)return x.v;return[]}function R_(e){"@babel/helpers - typeof";return R_=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},R_(e)}function E6e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function Cu(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?E6e(Object(n),!0).forEach(function(r){Men(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):E6e(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Men(e,t,n){return t=Ren(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ren(e){var t=Len(e,"string");return R_(t)=="symbol"?t:t+""}function Len(e,t){if(R_(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(R_(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Den(e,t,n,r,s){for(var a=(r||[]).slice(),o=a.length,l=t.start,c=t.end,u=function(x){var g=a[x],v,w=function(){return v===void 0&&(v=n(g,x)),v};if(x===o-1){var C=e*(g.coordinate+e*w()/2-c);a[x]=g=Cu(Cu({},g),{},{tickCoord:C>0?g.coordinate-C*e:g.coordinate})}else a[x]=g=Cu(Cu({},g),{},{tickCoord:g.coordinate});var N=FL(e,g.tickCoord,w,l,c);N&&(c=g.tickCoord-e*(w()/2+s),a[x]=Cu(Cu({},g),{},{isShow:!0}))},d=o-1;d>=0;d--)u(d);return a}function Ben(e,t,n,r,s,a){var o=(r||[]).slice(),l=o.length,c=t.start,u=t.end;if(a){var d=r[l-1],f=n(d,l-1),x=e*(d.coordinate+e*f/2-u);o[l-1]=d=Cu(Cu({},d),{},{tickCoord:x>0?d.coordinate-x*e:d.coordinate});var g=FL(e,d.tickCoord,function(){return f},c,u);g&&(u=d.tickCoord-e*(f/2+s),o[l-1]=Cu(Cu({},d),{},{isShow:!0}))}for(var v=a?l-1:l,w=function(P){var I=o[P],R,F=function(){return R===void 0&&(R=n(I,P)),R};if(P===0){var U=e*(I.coordinate-e*F()/2-c);o[P]=I=Cu(Cu({},I),{},{tickCoord:U<0?I.coordinate-U*e:I.coordinate})}else o[P]=I=Cu(Cu({},I),{},{tickCoord:I.coordinate});var L=FL(e,I.tickCoord,F,c,u);L&&(c=I.tickCoord+e*(F()/2+s),o[P]=Cu(Cu({},I),{},{isShow:!0}))},C=0;C<v;C++)w(C);return o}function kce(e,t,n){var r=e.tick,s=e.ticks,a=e.viewBox,o=e.minTickGap,l=e.orientation,c=e.interval,u=e.tickFormatter,d=e.unit,f=e.angle;if(!s||!s.length||!r)return[];if(rs(c)||pm.isSsr)return Fen(s,typeof c=="number"&&rs(c)?c:0);var x=[],g=l==="top"||l==="bottom"?"width":"height",v=d&&g==="width"?s9(d,{fontSize:t,letterSpacing:n}):{width:0,height:0},w=function(I,R){var F=Ai(u)?u(I.value,R):I.value;return g==="width"?Ien(s9(F,{fontSize:t,letterSpacing:n}),v,f):s9(F,{fontSize:t,letterSpacing:n})[g]},C=s.length>=2?lm(s[1].coordinate-s[0].coordinate):1,N=Pen(a,C,g);return c==="equidistantPreserveStart"?Oen(C,N,w,s,o):(c==="preserveStart"||c==="preserveStartEnd"?x=Ben(C,N,w,s,o,c==="preserveStartEnd"):x=Den(C,N,w,s,o),x.filter(function(P){return P.isShow}))}var $en=["viewBox"],Uen=["viewBox"],zen=["ticks"];function DN(e){"@babel/helpers - typeof";return DN=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},DN(e)}function $C(){return $C=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},$C.apply(this,arguments)}function _6e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function Ku(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?_6e(Object(n),!0).forEach(function(r){Tce(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_6e(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function kY(e,t){if(e==null)return{};var n=Hen(e,t),r,s;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(s=0;s<a.length;s++)r=a[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Hen(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function Ven(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function k6e(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,J$e(r.key),r)}}function Wen(e,t,n){return k6e(e.prototype,t),k6e(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function qen(e,t,n){return t=OL(t),Gen(e,Z$e()?Reflect.construct(t,n,OL(e).constructor):t.apply(e,n))}function Gen(e,t){if(t&&(DN(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Ken(e)}function Ken(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Z$e(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Z$e=function(){return!!e})()}function OL(e){return OL=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},OL(e)}function Yen(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&&dne(e,t)}function dne(e,t){return dne=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},dne(e,t)}function Tce(e,t,n){return t=J$e(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function J$e(e){var t=Xen(e,"string");return DN(t)=="symbol"?t:t+""}function Xen(e,t){if(DN(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(DN(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var n8=function(e){function t(n){var r;return Ven(this,t),r=qen(this,t,[n]),r.state={fontSize:"",letterSpacing:""},r}return Yen(t,e),Wen(t,[{key:"shouldComponentUpdate",value:function(r,s){var a=r.viewBox,o=kY(r,$en),l=this.props,c=l.viewBox,u=kY(l,Uen);return!h4(a,c)||!h4(o,u)||!h4(s,this.state)}},{key:"componentDidMount",value:function(){var r=this.layerReference;if(r){var s=r.getElementsByClassName("recharts-cartesian-axis-tick-value")[0];s&&this.setState({fontSize:window.getComputedStyle(s).fontSize,letterSpacing:window.getComputedStyle(s).letterSpacing})}}},{key:"getTickLineCoord",value:function(r){var s=this.props,a=s.x,o=s.y,l=s.width,c=s.height,u=s.orientation,d=s.tickSize,f=s.mirror,x=s.tickMargin,g,v,w,C,N,P,I=f?-1:1,R=r.tickSize||d,F=rs(r.tickCoord)?r.tickCoord:r.coordinate;switch(u){case"top":g=v=r.coordinate,C=o+ +!f*c,w=C-I*R,P=w-I*x,N=F;break;case"left":w=C=r.coordinate,v=a+ +!f*l,g=v-I*R,N=g-I*x,P=F;break;case"right":w=C=r.coordinate,v=a+ +f*l,g=v+I*R,N=g+I*x,P=F;break;default:g=v=r.coordinate,C=o+ +f*c,w=C+I*R,P=w+I*x,N=F;break}return{line:{x1:g,y1:w,x2:v,y2:C},tick:{x:N,y:P}}}},{key:"getTickTextAnchor",value:function(){var r=this.props,s=r.orientation,a=r.mirror,o;switch(s){case"left":o=a?"start":"end";break;case"right":o=a?"end":"start";break;default:o="middle";break}return o}},{key:"getTickVerticalAnchor",value:function(){var r=this.props,s=r.orientation,a=r.mirror,o="end";switch(s){case"left":case"right":o="middle";break;case"top":o=a?"start":"end";break;default:o=a?"end":"start";break}return o}},{key:"renderAxisLine",value:function(){var r=this.props,s=r.x,a=r.y,o=r.width,l=r.height,c=r.orientation,u=r.mirror,d=r.axisLine,f=Ku(Ku(Ku({},vi(this.props,!1)),vi(d,!1)),{},{fill:"none"});if(c==="top"||c==="bottom"){var x=+(c==="top"&&!u||c==="bottom"&&u);f=Ku(Ku({},f),{},{x1:s,y1:a+x*l,x2:s+o,y2:a+x*l})}else{var g=+(c==="left"&&!u||c==="right"&&u);f=Ku(Ku({},f),{},{x1:s+g*o,y1:a,x2:s+g*o,y2:a+l})}return Ae.createElement("line",$C({},f,{className:sa("recharts-cartesian-axis-line",np(d,"className"))}))}},{key:"renderTicks",value:function(r,s,a){var o=this,l=this.props,c=l.tickLine,u=l.stroke,d=l.tick,f=l.tickFormatter,x=l.unit,g=kce(Ku(Ku({},this.props),{},{ticks:r}),s,a),v=this.getTickTextAnchor(),w=this.getTickVerticalAnchor(),C=vi(this.props,!1),N=vi(d,!1),P=Ku(Ku({},C),{},{fill:"none"},vi(c,!1)),I=g.map(function(R,F){var U=o.getTickLineCoord(R),L=U.line,z=U.tick,Q=Ku(Ku(Ku(Ku({textAnchor:v,verticalAnchor:w},C),{},{stroke:"none",fill:u},N),z),{},{index:F,payload:R,visibleTicksCount:g.length,tickFormatter:f});return Ae.createElement(Sa,$C({className:"recharts-cartesian-axis-tick",key:"tick-".concat(R.value,"-").concat(R.coordinate,"-").concat(R.tickCoord)},r_(o.props,R,F)),c&&Ae.createElement("line",$C({},P,L,{className:sa("recharts-cartesian-axis-tick-line",np(c,"className"))})),d&&t.renderTickItem(d,Q,"".concat(Ai(f)?f(R.value,F):R.value).concat(x||"")))});return Ae.createElement("g",{className:"recharts-cartesian-axis-ticks"},I)}},{key:"render",value:function(){var r=this,s=this.props,a=s.axisLine,o=s.width,l=s.height,c=s.ticksGenerator,u=s.className,d=s.hide;if(d)return null;var f=this.props,x=f.ticks,g=kY(f,zen),v=x;return Ai(c)&&(v=x&&x.length>0?c(this.props):c(g)),o<=0||l<=0||!v||!v.length?null:Ae.createElement(Sa,{className:sa("recharts-cartesian-axis",u),ref:function(C){r.layerReference=C}},a&&this.renderAxisLine(),this.renderTicks(v,this.state.fontSize,this.state.letterSpacing),ju.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(r,s,a){var o;return Ae.isValidElement(r)?o=Ae.cloneElement(r,s):Ai(r)?o=r(s):o=Ae.createElement(nL,$C({},s,{className:"recharts-cartesian-axis-tick-value"}),a),o}}])}(m.Component);Tce(n8,"displayName","CartesianAxis");Tce(n8,"defaultProps",{x:0,y:0,width:0,height:0,viewBox:{x:0,y:0,width:0,height:0},orientation:"bottom",ticks:[],stroke:"#666",tickLine:!0,axisLine:!0,tick:!0,mirror:!1,minTickGap:5,tickSize:6,tickMargin:2,interval:"preserveEnd"});var Qen=["x1","y1","x2","y2","key"],Zen=["offset"];function Q3(e){"@babel/helpers - typeof";return Q3=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},Q3(e)}function T6e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function Eu(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?T6e(Object(n),!0).forEach(function(r){Jen(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):T6e(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Jen(e,t,n){return t=etn(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function etn(e){var t=ttn(e,"string");return Q3(t)=="symbol"?t:t+""}function ttn(e,t){if(Q3(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Q3(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function aw(){return aw=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},aw.apply(this,arguments)}function I6e(e,t){if(e==null)return{};var n=ntn(e,t),r,s;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(s=0;s<a.length;s++)r=a[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function ntn(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var rtn=function(t){var n=t.fill;if(!n||n==="none")return null;var r=t.fillOpacity,s=t.x,a=t.y,o=t.width,l=t.height,c=t.ry;return Ae.createElement("rect",{x:s,y:a,ry:c,width:o,height:l,stroke:"none",fill:n,fillOpacity:r,className:"recharts-cartesian-grid-bg"})};function eUe(e,t){var n;if(Ae.isValidElement(e))n=Ae.cloneElement(e,t);else if(Ai(e))n=e(t);else{var r=t.x1,s=t.y1,a=t.x2,o=t.y2,l=t.key,c=I6e(t,Qen),u=vi(c,!1);u.offset;var d=I6e(u,Zen);n=Ae.createElement("line",aw({},d,{x1:r,y1:s,x2:a,y2:o,fill:"none",key:l}))}return n}function stn(e){var t=e.x,n=e.width,r=e.horizontal,s=r===void 0?!0:r,a=e.horizontalPoints;if(!s||!a||!a.length)return null;var o=a.map(function(l,c){var u=Eu(Eu({},e),{},{x1:t,y1:l,x2:t+n,y2:l,key:"line-".concat(c),index:c});return eUe(s,u)});return Ae.createElement("g",{className:"recharts-cartesian-grid-horizontal"},o)}function itn(e){var t=e.y,n=e.height,r=e.vertical,s=r===void 0?!0:r,a=e.verticalPoints;if(!s||!a||!a.length)return null;var o=a.map(function(l,c){var u=Eu(Eu({},e),{},{x1:l,y1:t,x2:l,y2:t+n,key:"line-".concat(c),index:c});return eUe(s,u)});return Ae.createElement("g",{className:"recharts-cartesian-grid-vertical"},o)}function atn(e){var t=e.horizontalFill,n=e.fillOpacity,r=e.x,s=e.y,a=e.width,o=e.height,l=e.horizontalPoints,c=e.horizontal,u=c===void 0?!0:c;if(!u||!t||!t.length)return null;var d=l.map(function(x){return Math.round(x+s-s)}).sort(function(x,g){return x-g});s!==d[0]&&d.unshift(0);var f=d.map(function(x,g){var v=!d[g+1],w=v?s+o-x:d[g+1]-x;if(w<=0)return null;var C=g%t.length;return Ae.createElement("rect",{key:"react-".concat(g),y:x,x:r,height:w,width:a,stroke:"none",fill:t[C],fillOpacity:n,className:"recharts-cartesian-grid-bg"})});return Ae.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},f)}function otn(e){var t=e.vertical,n=t===void 0?!0:t,r=e.verticalFill,s=e.fillOpacity,a=e.x,o=e.y,l=e.width,c=e.height,u=e.verticalPoints;if(!n||!r||!r.length)return null;var d=u.map(function(x){return Math.round(x+a-a)}).sort(function(x,g){return x-g});a!==d[0]&&d.unshift(0);var f=d.map(function(x,g){var v=!d[g+1],w=v?a+l-x:d[g+1]-x;if(w<=0)return null;var C=g%r.length;return Ae.createElement("rect",{key:"react-".concat(g),x,y:o,width:w,height:c,stroke:"none",fill:r[C],fillOpacity:s,className:"recharts-cartesian-grid-bg"})});return Ae.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},f)}var ltn=function(t,n){var r=t.xAxis,s=t.width,a=t.height,o=t.offset;return h$e(kce(Eu(Eu(Eu({},n8.defaultProps),r),{},{ticks:$g(r,!0),viewBox:{x:0,y:0,width:s,height:a}})),o.left,o.left+o.width,n)},ctn=function(t,n){var r=t.yAxis,s=t.width,a=t.height,o=t.offset;return h$e(kce(Eu(Eu(Eu({},n8.defaultProps),r),{},{ticks:$g(r,!0),viewBox:{x:0,y:0,width:s,height:a}})),o.top,o.top+o.height,n)},nC={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[]};function tUe(e){var t,n,r,s,a,o,l=Ace(),c=jce(),u=XJt(),d=Eu(Eu({},e),{},{stroke:(t=e.stroke)!==null&&t!==void 0?t:nC.stroke,fill:(n=e.fill)!==null&&n!==void 0?n:nC.fill,horizontal:(r=e.horizontal)!==null&&r!==void 0?r:nC.horizontal,horizontalFill:(s=e.horizontalFill)!==null&&s!==void 0?s:nC.horizontalFill,vertical:(a=e.vertical)!==null&&a!==void 0?a:nC.vertical,verticalFill:(o=e.verticalFill)!==null&&o!==void 0?o:nC.verticalFill,x:rs(e.x)?e.x:u.left,y:rs(e.y)?e.y:u.top,width:rs(e.width)?e.width:u.width,height:rs(e.height)?e.height:u.height}),f=d.x,x=d.y,g=d.width,v=d.height,w=d.syncWithTicks,C=d.horizontalValues,N=d.verticalValues,P=GJt(),I=KJt();if(!rs(g)||g<=0||!rs(v)||v<=0||!rs(f)||f!==+f||!rs(x)||x!==+x)return null;var R=d.verticalCoordinatesGenerator||ltn,F=d.horizontalCoordinatesGenerator||ctn,U=d.horizontalPoints,L=d.verticalPoints;if((!U||!U.length)&&Ai(F)){var z=C&&C.length,Q=F({yAxis:I?Eu(Eu({},I),{},{ticks:z?C:I.ticks}):void 0,width:l,height:c,offset:u},z?!0:w);Qg(Array.isArray(Q),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(Q3(Q),"]")),Array.isArray(Q)&&(U=Q)}if((!L||!L.length)&&Ai(R)){var ne=N&&N.length,J=R({xAxis:P?Eu(Eu({},P),{},{ticks:ne?N:P.ticks}):void 0,width:l,height:c,offset:u},ne?!0:w);Qg(Array.isArray(J),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(Q3(J),"]")),Array.isArray(J)&&(L=J)}return Ae.createElement("g",{className:"recharts-cartesian-grid"},Ae.createElement(rtn,{fill:d.fill,fillOpacity:d.fillOpacity,x:d.x,y:d.y,width:d.width,height:d.height,ry:d.ry}),Ae.createElement(stn,aw({},d,{offset:u,horizontalPoints:U,xAxis:P,yAxis:I})),Ae.createElement(itn,aw({},d,{offset:u,verticalPoints:L,xAxis:P,yAxis:I})),Ae.createElement(atn,aw({},d,{horizontalPoints:U})),Ae.createElement(otn,aw({},d,{verticalPoints:L})))}tUe.displayName="CartesianGrid";var utn=["type","layout","connectNulls","ref"],dtn=["key"];function BN(e){"@babel/helpers - typeof";return BN=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},BN(e)}function P6e(e,t){if(e==null)return{};var n=ftn(e,t),r,s;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(s=0;s<a.length;s++)r=a[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function ftn(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function l9(){return l9=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},l9.apply(this,arguments)}function F6e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function Ef(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?F6e(Object(n),!0).forEach(function(r){Qp(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):F6e(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function rC(e){return xtn(e)||mtn(e)||ptn(e)||htn()}function htn(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ptn(e,t){if(e){if(typeof e=="string")return fne(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return fne(e,t)}}function mtn(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function xtn(e){if(Array.isArray(e))return fne(e)}function fne(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function gtn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function O6e(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,rUe(r.key),r)}}function btn(e,t,n){return O6e(e.prototype,t),O6e(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function ytn(e,t,n){return t=ML(t),vtn(e,nUe()?Reflect.construct(t,n,ML(e).constructor):t.apply(e,n))}function vtn(e,t){if(t&&(BN(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return wtn(e)}function wtn(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function nUe(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(nUe=function(){return!!e})()}function ML(e){return ML=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},ML(e)}function Ctn(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&&hne(e,t)}function hne(e,t){return hne=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},hne(e,t)}function Qp(e,t,n){return t=rUe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function rUe(e){var t=Stn(e,"string");return BN(t)=="symbol"?t:t+""}function Stn(e,t){if(BN(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(BN(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var T0=function(e){function t(){var n;gtn(this,t);for(var r=arguments.length,s=new Array(r),a=0;a<r;a++)s[a]=arguments[a];return n=ytn(this,t,[].concat(s)),Qp(n,"state",{isAnimationFinished:!0,totalLength:0}),Qp(n,"generateSimpleStrokeDasharray",function(o,l){return"".concat(l,"px ").concat(o-l,"px")}),Qp(n,"getStrokeDasharray",function(o,l,c){var u=c.reduce(function(N,P){return N+P});if(!u)return n.generateSimpleStrokeDasharray(l,o);for(var d=Math.floor(o/u),f=o%u,x=l-o,g=[],v=0,w=0;v<c.length;w+=c[v],++v)if(w+c[v]>f){g=[].concat(rC(c.slice(0,v)),[f-w]);break}var C=g.length%2===0?[0,x]:[x];return[].concat(rC(t.repeat(c,d)),rC(g),C).map(function(N){return"".concat(N,"px")}).join(", ")}),Qp(n,"id",S5("recharts-line-")),Qp(n,"pathRef",function(o){n.mainCurve=o}),Qp(n,"handleAnimationEnd",function(){n.setState({isAnimationFinished:!0}),n.props.onAnimationEnd&&n.props.onAnimationEnd()}),Qp(n,"handleAnimationStart",function(){n.setState({isAnimationFinished:!1}),n.props.onAnimationStart&&n.props.onAnimationStart()}),n}return Ctn(t,e),btn(t,[{key:"componentDidMount",value:function(){if(this.props.isAnimationActive){var r=this.getTotalLength();this.setState({totalLength:r})}}},{key:"componentDidUpdate",value:function(){if(this.props.isAnimationActive){var r=this.getTotalLength();r!==this.state.totalLength&&this.setState({totalLength:r})}}},{key:"getTotalLength",value:function(){var r=this.mainCurve;try{return r&&r.getTotalLength&&r.getTotalLength()||0}catch{return 0}}},{key:"renderErrorBar",value:function(r,s){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var a=this.props,o=a.points,l=a.xAxis,c=a.yAxis,u=a.layout,d=a.children,f=sf(d,e8);if(!f)return null;var x=function(w,C){return{x:w.x,y:w.y,value:w.value,errorVal:sc(w.payload,C)}},g={clipPath:r?"url(#clipPath-".concat(s,")"):null};return Ae.createElement(Sa,g,f.map(function(v){return Ae.cloneElement(v,{key:"bar-".concat(v.props.dataKey),data:o,xAxis:l,yAxis:c,layout:u,dataPointFormatter:x})}))}},{key:"renderDots",value:function(r,s,a){var o=this.props.isAnimationActive;if(o&&!this.state.isAnimationFinished)return null;var l=this.props,c=l.dot,u=l.points,d=l.dataKey,f=vi(this.props,!1),x=vi(c,!0),g=u.map(function(w,C){var N=Ef(Ef(Ef({key:"dot-".concat(C),r:3},f),x),{},{index:C,cx:w.x,cy:w.y,value:w.value,dataKey:d,payload:w.payload,points:u});return t.renderDotItem(c,N)}),v={clipPath:r?"url(#clipPath-".concat(s?"":"dots-").concat(a,")"):null};return Ae.createElement(Sa,l9({className:"recharts-line-dots",key:"dots"},v),g)}},{key:"renderCurveStatically",value:function(r,s,a,o){var l=this.props,c=l.type,u=l.layout,d=l.connectNulls;l.ref;var f=P6e(l,utn),x=Ef(Ef(Ef({},vi(f,!0)),{},{fill:"none",className:"recharts-line-curve",clipPath:s?"url(#clipPath-".concat(a,")"):null,points:r},o),{},{type:c,layout:u,connectNulls:d});return Ae.createElement(l3,l9({},x,{pathRef:this.pathRef}))}},{key:"renderCurveWithAnimation",value:function(r,s){var a=this,o=this.props,l=o.points,c=o.strokeDasharray,u=o.isAnimationActive,d=o.animationBegin,f=o.animationDuration,x=o.animationEasing,g=o.animationId,v=o.animateNewValues,w=o.width,C=o.height,N=this.state,P=N.prevPoints,I=N.totalLength;return Ae.createElement(Cm,{begin:d,duration:f,isActive:u,easing:x,from:{t:0},to:{t:1},key:"line-".concat(g),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(R){var F=R.t;if(P){var U=P.length/l.length,L=l.map(function(X,re){var pe=Math.floor(re*U);if(P[pe]){var Y=P[pe],ie=wl(Y.x,X.x),oe=wl(Y.y,X.y);return Ef(Ef({},X),{},{x:ie(F),y:oe(F)})}if(v){var G=wl(w*2,X.x),V=wl(C/2,X.y);return Ef(Ef({},X),{},{x:G(F),y:V(F)})}return Ef(Ef({},X),{},{x:X.x,y:X.y})});return a.renderCurveStatically(L,r,s)}var z=wl(0,I),Q=z(F),ne;if(c){var J="".concat(c).split(/[,\s]+/gim).map(function(X){return parseFloat(X)});ne=a.getStrokeDasharray(Q,I,J)}else ne=a.generateSimpleStrokeDasharray(I,Q);return a.renderCurveStatically(l,r,s,{strokeDasharray:ne})})}},{key:"renderCurve",value:function(r,s){var a=this.props,o=a.points,l=a.isAnimationActive,c=this.state,u=c.prevPoints,d=c.totalLength;return l&&o&&o.length&&(!u&&d>0||!K3(u,o))?this.renderCurveWithAnimation(r,s):this.renderCurveStatically(o,r,s)}},{key:"render",value:function(){var r,s=this.props,a=s.hide,o=s.dot,l=s.points,c=s.className,u=s.xAxis,d=s.yAxis,f=s.top,x=s.left,g=s.width,v=s.height,w=s.isAnimationActive,C=s.id;if(a||!l||!l.length)return null;var N=this.state.isAnimationFinished,P=l.length===1,I=sa("recharts-line",c),R=u&&u.allowDataOverflow,F=d&&d.allowDataOverflow,U=R||F,L=wi(C)?this.id:C,z=(r=vi(o,!1))!==null&&r!==void 0?r:{r:3,strokeWidth:2},Q=z.r,ne=Q===void 0?3:Q,J=z.strokeWidth,X=J===void 0?2:J,re=pDe(o)?o:{},pe=re.clipDot,Y=pe===void 0?!0:pe,ie=ne*2+X;return Ae.createElement(Sa,{className:I},R||F?Ae.createElement("defs",null,Ae.createElement("clipPath",{id:"clipPath-".concat(L)},Ae.createElement("rect",{x:R?x:x-g/2,y:F?f:f-v/2,width:R?g:g*2,height:F?v:v*2})),!Y&&Ae.createElement("clipPath",{id:"clipPath-dots-".concat(L)},Ae.createElement("rect",{x:x-ie/2,y:f-ie/2,width:g+ie,height:v+ie}))):null,!P&&this.renderCurve(U,L),this.renderErrorBar(U,L),(P||o)&&this.renderDots(U,Y,L),(!w||N)&&z0.renderCallByParent(this.props,l))}}],[{key:"getDerivedStateFromProps",value:function(r,s){return r.animationId!==s.prevAnimationId?{prevAnimationId:r.animationId,curPoints:r.points,prevPoints:s.curPoints}:r.points!==s.curPoints?{curPoints:r.points}:null}},{key:"repeat",value:function(r,s){for(var a=r.length%2!==0?[].concat(rC(r),[0]):r,o=[],l=0;l<s;++l)o=[].concat(rC(o),rC(a));return o}},{key:"renderDotItem",value:function(r,s){var a;if(Ae.isValidElement(r))a=Ae.cloneElement(r,s);else if(Ai(r))a=r(s);else{var o=s.key,l=P6e(s,dtn),c=sa("recharts-line-dot",typeof r!="boolean"?r.className:"");a=Ae.createElement(J$,l9({key:o},l,{className:c}))}return a}}])}(m.PureComponent);Qp(T0,"displayName","Line");Qp(T0,"defaultProps",{xAxisId:0,yAxisId:0,connectNulls:!1,activeDot:!0,dot:!0,legendType:"line",stroke:"#3182bd",strokeWidth:1,fill:"#fff",points:[],isAnimationActive:!pm.isSsr,animateNewValues:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",hide:!1,label:!1});Qp(T0,"getComposedData",function(e){var t=e.props,n=e.xAxis,r=e.yAxis,s=e.xAxisTicks,a=e.yAxisTicks,o=e.dataKey,l=e.bandSize,c=e.displayedData,u=e.offset,d=t.layout,f=c.map(function(x,g){var v=sc(x,o);return d==="horizontal"?{x:TN({axis:n,ticks:s,bandSize:l,entry:x,index:g}),y:wi(v)?null:r.scale(v),value:v,payload:x}:{x:wi(v)?null:n.scale(v),y:TN({axis:r,ticks:a,bandSize:l,entry:x,index:g}),value:v,payload:x}});return Ef({points:f,layout:d},u)});var Ntn=["layout","type","stroke","connectNulls","isRange","ref"],Atn=["key"],sUe;function $N(e){"@babel/helpers - typeof";return $N=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},$N(e)}function iUe(e,t){if(e==null)return{};var n=jtn(e,t),r,s;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(s=0;s<a.length;s++)r=a[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function jtn(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function ow(){return ow=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ow.apply(this,arguments)}function M6e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function jb(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?M6e(Object(n),!0).forEach(function(r){I0(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):M6e(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Etn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function R6e(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,oUe(r.key),r)}}function _tn(e,t,n){return R6e(e.prototype,t),R6e(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function ktn(e,t,n){return t=RL(t),Ttn(e,aUe()?Reflect.construct(t,n,RL(e).constructor):t.apply(e,n))}function Ttn(e,t){if(t&&($N(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Itn(e)}function Itn(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function aUe(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(aUe=function(){return!!e})()}function RL(e){return RL=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},RL(e)}function Ptn(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&&pne(e,t)}function pne(e,t){return pne=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},pne(e,t)}function I0(e,t,n){return t=oUe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function oUe(e){var t=Ftn(e,"string");return $N(t)=="symbol"?t:t+""}function Ftn(e,t){if($N(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if($N(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var E5=function(e){function t(){var n;Etn(this,t);for(var r=arguments.length,s=new Array(r),a=0;a<r;a++)s[a]=arguments[a];return n=ktn(this,t,[].concat(s)),I0(n,"state",{isAnimationFinished:!0}),I0(n,"id",S5("recharts-area-")),I0(n,"handleAnimationEnd",function(){var o=n.props.onAnimationEnd;n.setState({isAnimationFinished:!0}),Ai(o)&&o()}),I0(n,"handleAnimationStart",function(){var o=n.props.onAnimationStart;n.setState({isAnimationFinished:!1}),Ai(o)&&o()}),n}return Ptn(t,e),_tn(t,[{key:"renderDots",value:function(r,s,a){var o=this.props.isAnimationActive,l=this.state.isAnimationFinished;if(o&&!l)return null;var c=this.props,u=c.dot,d=c.points,f=c.dataKey,x=vi(this.props,!1),g=vi(u,!0),v=d.map(function(C,N){var P=jb(jb(jb({key:"dot-".concat(N),r:3},x),g),{},{index:N,cx:C.x,cy:C.y,dataKey:f,value:C.value,payload:C.payload,points:d});return t.renderDotItem(u,P)}),w={clipPath:r?"url(#clipPath-".concat(s?"":"dots-").concat(a,")"):null};return Ae.createElement(Sa,ow({className:"recharts-area-dots"},w),v)}},{key:"renderHorizontalRect",value:function(r){var s=this.props,a=s.baseLine,o=s.points,l=s.strokeWidth,c=o[0].x,u=o[o.length-1].x,d=r*Math.abs(c-u),f=gy(o.map(function(x){return x.y||0}));return rs(a)&&typeof a=="number"?f=Math.max(a,f):a&&Array.isArray(a)&&a.length&&(f=Math.max(gy(a.map(function(x){return x.y||0})),f)),rs(f)?Ae.createElement("rect",{x:c<u?c:c-d,y:0,width:d,height:Math.floor(f+(l?parseInt("".concat(l),10):1))}):null}},{key:"renderVerticalRect",value:function(r){var s=this.props,a=s.baseLine,o=s.points,l=s.strokeWidth,c=o[0].y,u=o[o.length-1].y,d=r*Math.abs(c-u),f=gy(o.map(function(x){return x.x||0}));return rs(a)&&typeof a=="number"?f=Math.max(a,f):a&&Array.isArray(a)&&a.length&&(f=Math.max(gy(a.map(function(x){return x.x||0})),f)),rs(f)?Ae.createElement("rect",{x:0,y:c<u?c:c-d,width:f+(l?parseInt("".concat(l),10):1),height:Math.floor(d)}):null}},{key:"renderClipRect",value:function(r){var s=this.props.layout;return s==="vertical"?this.renderVerticalRect(r):this.renderHorizontalRect(r)}},{key:"renderAreaStatically",value:function(r,s,a,o){var l=this.props,c=l.layout,u=l.type,d=l.stroke,f=l.connectNulls,x=l.isRange;l.ref;var g=iUe(l,Ntn);return Ae.createElement(Sa,{clipPath:a?"url(#clipPath-".concat(o,")"):null},Ae.createElement(l3,ow({},vi(g,!0),{points:r,connectNulls:f,type:u,baseLine:s,layout:c,stroke:"none",className:"recharts-area-area"})),d!=="none"&&Ae.createElement(l3,ow({},vi(this.props,!1),{className:"recharts-area-curve",layout:c,type:u,connectNulls:f,fill:"none",points:r})),d!=="none"&&x&&Ae.createElement(l3,ow({},vi(this.props,!1),{className:"recharts-area-curve",layout:c,type:u,connectNulls:f,fill:"none",points:s})))}},{key:"renderAreaWithAnimation",value:function(r,s){var a=this,o=this.props,l=o.points,c=o.baseLine,u=o.isAnimationActive,d=o.animationBegin,f=o.animationDuration,x=o.animationEasing,g=o.animationId,v=this.state,w=v.prevPoints,C=v.prevBaseLine;return Ae.createElement(Cm,{begin:d,duration:f,isActive:u,easing:x,from:{t:0},to:{t:1},key:"area-".concat(g),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(N){var P=N.t;if(w){var I=w.length/l.length,R=l.map(function(z,Q){var ne=Math.floor(Q*I);if(w[ne]){var J=w[ne],X=wl(J.x,z.x),re=wl(J.y,z.y);return jb(jb({},z),{},{x:X(P),y:re(P)})}return z}),F;if(rs(c)&&typeof c=="number"){var U=wl(C,c);F=U(P)}else if(wi(c)||YA(c)){var L=wl(C,0);F=L(P)}else F=c.map(function(z,Q){var ne=Math.floor(Q*I);if(C[ne]){var J=C[ne],X=wl(J.x,z.x),re=wl(J.y,z.y);return jb(jb({},z),{},{x:X(P),y:re(P)})}return z});return a.renderAreaStatically(R,F,r,s)}return Ae.createElement(Sa,null,Ae.createElement("defs",null,Ae.createElement("clipPath",{id:"animationClipPath-".concat(s)},a.renderClipRect(P))),Ae.createElement(Sa,{clipPath:"url(#animationClipPath-".concat(s,")")},a.renderAreaStatically(l,c,r,s)))})}},{key:"renderArea",value:function(r,s){var a=this.props,o=a.points,l=a.baseLine,c=a.isAnimationActive,u=this.state,d=u.prevPoints,f=u.prevBaseLine,x=u.totalLength;return c&&o&&o.length&&(!d&&x>0||!K3(d,o)||!K3(f,l))?this.renderAreaWithAnimation(r,s):this.renderAreaStatically(o,l,r,s)}},{key:"render",value:function(){var r,s=this.props,a=s.hide,o=s.dot,l=s.points,c=s.className,u=s.top,d=s.left,f=s.xAxis,x=s.yAxis,g=s.width,v=s.height,w=s.isAnimationActive,C=s.id;if(a||!l||!l.length)return null;var N=this.state.isAnimationFinished,P=l.length===1,I=sa("recharts-area",c),R=f&&f.allowDataOverflow,F=x&&x.allowDataOverflow,U=R||F,L=wi(C)?this.id:C,z=(r=vi(o,!1))!==null&&r!==void 0?r:{r:3,strokeWidth:2},Q=z.r,ne=Q===void 0?3:Q,J=z.strokeWidth,X=J===void 0?2:J,re=pDe(o)?o:{},pe=re.clipDot,Y=pe===void 0?!0:pe,ie=ne*2+X;return Ae.createElement(Sa,{className:I},R||F?Ae.createElement("defs",null,Ae.createElement("clipPath",{id:"clipPath-".concat(L)},Ae.createElement("rect",{x:R?d:d-g/2,y:F?u:u-v/2,width:R?g:g*2,height:F?v:v*2})),!Y&&Ae.createElement("clipPath",{id:"clipPath-dots-".concat(L)},Ae.createElement("rect",{x:d-ie/2,y:u-ie/2,width:g+ie,height:v+ie}))):null,P?null:this.renderArea(U,L),(o||P)&&this.renderDots(U,Y,L),(!w||N)&&z0.renderCallByParent(this.props,l))}}],[{key:"getDerivedStateFromProps",value:function(r,s){return r.animationId!==s.prevAnimationId?{prevAnimationId:r.animationId,curPoints:r.points,curBaseLine:r.baseLine,prevPoints:s.curPoints,prevBaseLine:s.curBaseLine}:r.points!==s.curPoints||r.baseLine!==s.curBaseLine?{curPoints:r.points,curBaseLine:r.baseLine}:null}}])}(m.PureComponent);sUe=E5;I0(E5,"displayName","Area");I0(E5,"defaultProps",{stroke:"#3182bd",fill:"#3182bd",fillOpacity:.6,xAxisId:0,yAxisId:0,legendType:"line",connectNulls:!1,points:[],dot:!1,activeDot:!0,hide:!1,isAnimationActive:!pm.isSsr,animationBegin:0,animationDuration:1500,animationEasing:"ease"});I0(E5,"getBaseValue",function(e,t,n,r){var s=e.layout,a=e.baseValue,o=t.props.baseValue,l=o??a;if(rs(l)&&typeof l=="number")return l;var c=s==="horizontal"?r:n,u=c.scale.domain();if(c.type==="number"){var d=Math.max(u[0],u[1]),f=Math.min(u[0],u[1]);return l==="dataMin"?f:l==="dataMax"||d<0?d:Math.max(Math.min(u[0],u[1]),0)}return l==="dataMin"?u[0]:l==="dataMax"?u[1]:u[0]});I0(E5,"getComposedData",function(e){var t=e.props,n=e.item,r=e.xAxis,s=e.yAxis,a=e.xAxisTicks,o=e.yAxisTicks,l=e.bandSize,c=e.dataKey,u=e.stackedData,d=e.dataStartIndex,f=e.displayedData,x=e.offset,g=t.layout,v=u&&u.length,w=sUe.getBaseValue(t,n,r,s),C=g==="horizontal",N=!1,P=f.map(function(R,F){var U;v?U=u[d+F]:(U=sc(R,c),Array.isArray(U)?N=!0:U=[w,U]);var L=U[1]==null||v&&sc(R,c)==null;return C?{x:TN({axis:r,ticks:a,bandSize:l,entry:R,index:F}),y:L?null:s.scale(U[1]),value:U,payload:R}:{x:L?null:r.scale(U[1]),y:TN({axis:s,ticks:o,bandSize:l,entry:R,index:F}),value:U,payload:R}}),I;return v||N?I=P.map(function(R){var F=Array.isArray(R.value)?R.value[0]:null;return C?{x:R.x,y:F!=null&&R.y!=null?s.scale(F):null}:{x:F!=null?r.scale(F):null,y:R.y}}):I=C?s.scale(w):r.scale(w),jb({points:P,baseLine:I,layout:g,isRange:N},x)});I0(E5,"renderDotItem",function(e,t){var n;if(Ae.isValidElement(e))n=Ae.cloneElement(e,t);else if(Ai(e))n=e(t);else{var r=sa("recharts-area-dot",typeof e!="boolean"?e.className:""),s=t.key,a=iUe(t,Atn);n=Ae.createElement(J$,ow({},a,{key:s,className:r}))}return n});function UN(e){"@babel/helpers - typeof";return UN=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},UN(e)}function Otn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Mtn(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,uUe(r.key),r)}}function Rtn(e,t,n){return Mtn(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ltn(e,t,n){return t=LL(t),Dtn(e,lUe()?Reflect.construct(t,n||[],LL(e).constructor):t.apply(e,n))}function Dtn(e,t){if(t&&(UN(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Btn(e)}function Btn(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function lUe(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(lUe=function(){return!!e})()}function LL(e){return LL=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},LL(e)}function $tn(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&&mne(e,t)}function mne(e,t){return mne=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},mne(e,t)}function cUe(e,t,n){return t=uUe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function uUe(e){var t=Utn(e,"string");return UN(t)=="symbol"?t:t+""}function Utn(e,t){if(UN(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(UN(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var oU=function(e){function t(){return Otn(this,t),Ltn(this,t,arguments)}return $tn(t,e),Rtn(t,[{key:"render",value:function(){return null}}])}(Ae.Component);cUe(oU,"displayName","ZAxis");cUe(oU,"defaultProps",{zAxisId:0,range:[64,64],scale:"auto",type:"number"});var ztn=["option","isActive"];function c9(){return c9=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},c9.apply(this,arguments)}function Htn(e,t){if(e==null)return{};var n=Vtn(e,t),r,s;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(s=0;s<a.length;s++)r=a[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Vtn(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function Wtn(e){var t=e.option,n=e.isActive,r=Htn(e,ztn);return typeof t=="string"?Ae.createElement(tne,c9({option:Ae.createElement($$,c9({type:t},r)),isActive:n,shapeType:"symbols"},r)):Ae.createElement(tne,c9({option:t,isActive:n,shapeType:"symbols"},r))}function zN(e){"@babel/helpers - typeof";return zN=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},zN(e)}function u9(){return u9=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},u9.apply(this,arguments)}function L6e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function Oh(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?L6e(Object(n),!0).forEach(function(r){yy(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):L6e(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function qtn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function D6e(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,fUe(r.key),r)}}function Gtn(e,t,n){return D6e(e.prototype,t),D6e(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ktn(e,t,n){return t=DL(t),Ytn(e,dUe()?Reflect.construct(t,n,DL(e).constructor):t.apply(e,n))}function Ytn(e,t){if(t&&(zN(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Xtn(e)}function Xtn(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function dUe(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(dUe=function(){return!!e})()}function DL(e){return DL=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},DL(e)}function Qtn(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&&xne(e,t)}function xne(e,t){return xne=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},xne(e,t)}function yy(e,t,n){return t=fUe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function fUe(e){var t=Ztn(e,"string");return zN(t)=="symbol"?t:t+""}function Ztn(e,t){if(zN(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(zN(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var lU=function(e){function t(){var n;qtn(this,t);for(var r=arguments.length,s=new Array(r),a=0;a<r;a++)s[a]=arguments[a];return n=Ktn(this,t,[].concat(s)),yy(n,"state",{isAnimationFinished:!1}),yy(n,"handleAnimationEnd",function(){n.setState({isAnimationFinished:!0})}),yy(n,"handleAnimationStart",function(){n.setState({isAnimationFinished:!1})}),yy(n,"id",S5("recharts-scatter-")),n}return Qtn(t,e),Gtn(t,[{key:"renderSymbolsStatically",value:function(r){var s=this,a=this.props,o=a.shape,l=a.activeShape,c=a.activeIndex,u=vi(this.props,!1);return r.map(function(d,f){var x=c===f,g=x?l:o,v=Oh(Oh({},u),d);return Ae.createElement(Sa,u9({className:"recharts-scatter-symbol",key:"symbol-".concat(d==null?void 0:d.cx,"-").concat(d==null?void 0:d.cy,"-").concat(d==null?void 0:d.size,"-").concat(f)},r_(s.props,d,f),{role:"img"}),Ae.createElement(Wtn,u9({option:g,isActive:x,key:"symbol-".concat(f)},v)))})}},{key:"renderSymbolsWithAnimation",value:function(){var r=this,s=this.props,a=s.points,o=s.isAnimationActive,l=s.animationBegin,c=s.animationDuration,u=s.animationEasing,d=s.animationId,f=this.state.prevPoints;return Ae.createElement(Cm,{begin:l,duration:c,isActive:o,easing:u,from:{t:0},to:{t:1},key:"pie-".concat(d),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(x){var g=x.t,v=a.map(function(w,C){var N=f&&f[C];if(N){var P=wl(N.cx,w.cx),I=wl(N.cy,w.cy),R=wl(N.size,w.size);return Oh(Oh({},w),{},{cx:P(g),cy:I(g),size:R(g)})}var F=wl(0,w.size);return Oh(Oh({},w),{},{size:F(g)})});return Ae.createElement(Sa,null,r.renderSymbolsStatically(v))})}},{key:"renderSymbols",value:function(){var r=this.props,s=r.points,a=r.isAnimationActive,o=this.state.prevPoints;return a&&s&&s.length&&(!o||!K3(o,s))?this.renderSymbolsWithAnimation():this.renderSymbolsStatically(s)}},{key:"renderErrorBar",value:function(){var r=this.props.isAnimationActive;if(r&&!this.state.isAnimationFinished)return null;var s=this.props,a=s.points,o=s.xAxis,l=s.yAxis,c=s.children,u=sf(c,e8);return u?u.map(function(d,f){var x=d.props,g=x.direction,v=x.dataKey;return Ae.cloneElement(d,{key:"".concat(g,"-").concat(v,"-").concat(a[f]),data:a,xAxis:o,yAxis:l,layout:g==="x"?"vertical":"horizontal",dataPointFormatter:function(C,N){return{x:C.cx,y:C.cy,value:g==="x"?+C.node.x:+C.node.y,errorVal:sc(C,N)}}})}):null}},{key:"renderLine",value:function(){var r=this.props,s=r.points,a=r.line,o=r.lineType,l=r.lineJointType,c=vi(this.props,!1),u=vi(a,!1),d,f;if(o==="joint")d=s.map(function(I){return{x:I.cx,y:I.cy}});else if(o==="fitting"){var x=D$t(s),g=x.xmin,v=x.xmax,w=x.a,C=x.b,N=function(R){return w*R+C};d=[{x:g,y:N(g)},{x:v,y:N(v)}]}var P=Oh(Oh(Oh({},c),{},{fill:"none",stroke:c&&c.fill},u),{},{points:d});return Ae.isValidElement(a)?f=Ae.cloneElement(a,P):Ai(a)?f=a(P):f=Ae.createElement(l3,u9({},P,{type:l})),Ae.createElement(Sa,{className:"recharts-scatter-line",key:"recharts-scatter-line"},f)}},{key:"render",value:function(){var r=this.props,s=r.hide,a=r.points,o=r.line,l=r.className,c=r.xAxis,u=r.yAxis,d=r.left,f=r.top,x=r.width,g=r.height,v=r.id,w=r.isAnimationActive;if(s||!a||!a.length)return null;var C=this.state.isAnimationFinished,N=sa("recharts-scatter",l),P=c&&c.allowDataOverflow,I=u&&u.allowDataOverflow,R=P||I,F=wi(v)?this.id:v;return Ae.createElement(Sa,{className:N,clipPath:R?"url(#clipPath-".concat(F,")"):null},P||I?Ae.createElement("defs",null,Ae.createElement("clipPath",{id:"clipPath-".concat(F)},Ae.createElement("rect",{x:P?d:d-x/2,y:I?f:f-g/2,width:P?x:x*2,height:I?g:g*2}))):null,o&&this.renderLine(),this.renderErrorBar(),Ae.createElement(Sa,{key:"recharts-scatter-symbols"},this.renderSymbols()),(!w||C)&&z0.renderCallByParent(this.props,a))}}],[{key:"getDerivedStateFromProps",value:function(r,s){return r.animationId!==s.prevAnimationId?{prevAnimationId:r.animationId,curPoints:r.points,prevPoints:s.curPoints}:r.points!==s.curPoints?{curPoints:r.points}:null}}])}(m.PureComponent);yy(lU,"displayName","Scatter");yy(lU,"defaultProps",{xAxisId:0,yAxisId:0,zAxisId:0,legendType:"circle",lineType:"joint",lineJointType:"linear",data:[],shape:"circle",hide:!1,isAnimationActive:!pm.isSsr,animationBegin:0,animationDuration:400,animationEasing:"linear"});yy(lU,"getComposedData",function(e){var t=e.xAxis,n=e.yAxis,r=e.zAxis,s=e.item,a=e.displayedData,o=e.xAxisTicks,l=e.yAxisTicks,c=e.offset,u=s.props.tooltipType,d=sf(s.props.children,Yle),f=wi(t.dataKey)?s.props.dataKey:t.dataKey,x=wi(n.dataKey)?s.props.dataKey:n.dataKey,g=r&&r.dataKey,v=r?r.range:oU.defaultProps.range,w=v&&v[0],C=t.scale.bandwidth?t.scale.bandwidth():0,N=n.scale.bandwidth?n.scale.bandwidth():0,P=a.map(function(I,R){var F=sc(I,f),U=sc(I,x),L=!wi(g)&&sc(I,g)||"-",z=[{name:wi(t.dataKey)?s.props.name:t.name||t.dataKey,unit:t.unit||"",value:F,payload:I,dataKey:f,type:u},{name:wi(n.dataKey)?s.props.name:n.name||n.dataKey,unit:n.unit||"",value:U,payload:I,dataKey:x,type:u}];L!=="-"&&z.push({name:r.name||r.dataKey,unit:r.unit||"",value:L,payload:I,dataKey:g,type:u});var Q=TN({axis:t,ticks:o,bandSize:C,entry:I,index:R,dataKey:f}),ne=TN({axis:n,ticks:l,bandSize:N,entry:I,index:R,dataKey:x}),J=L!=="-"?r.scale(L):w,X=Math.sqrt(Math.max(J,0)/Math.PI);return Oh(Oh({},I),{},{cx:Q,cy:ne,x:Q-X,y:ne-X,xAxis:t,yAxis:n,zAxis:r,width:2*X,height:2*X,size:J,node:{x:F,y:U,z:L},tooltipPayload:z,tooltipPosition:{x:Q,y:ne},payload:I},d[R]&&d[R].props)});return Oh({points:P},c)});function HN(e){"@babel/helpers - typeof";return HN=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},HN(e)}function Jtn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function enn(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,mUe(r.key),r)}}function tnn(e,t,n){return enn(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function nnn(e,t,n){return t=BL(t),rnn(e,hUe()?Reflect.construct(t,n||[],BL(e).constructor):t.apply(e,n))}function rnn(e,t){if(t&&(HN(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return snn(e)}function snn(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function hUe(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(hUe=function(){return!!e})()}function BL(e){return BL=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},BL(e)}function inn(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&&gne(e,t)}function gne(e,t){return gne=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},gne(e,t)}function pUe(e,t,n){return t=mUe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function mUe(e){var t=ann(e,"string");return HN(t)=="symbol"?t:t+""}function ann(e,t){if(HN(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(HN(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function bne(){return bne=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},bne.apply(this,arguments)}function onn(e){var t=e.xAxisId,n=Ace(),r=jce(),s=H$e(t);return s==null?null:Ae.createElement(n8,bne({},s,{className:sa("recharts-".concat(s.axisType," ").concat(s.axisType),s.className),viewBox:{x:0,y:0,width:n,height:r},ticksGenerator:function(o){return $g(o,!0)}}))}var r8=function(e){function t(){return Jtn(this,t),nnn(this,t,arguments)}return inn(t,e),tnn(t,[{key:"render",value:function(){return Ae.createElement(onn,this.props)}}])}(Ae.Component);pUe(r8,"displayName","XAxis");pUe(r8,"defaultProps",{allowDecimals:!0,hide:!1,orientation:"bottom",width:0,height:30,mirror:!1,xAxisId:0,tickCount:5,type:"category",padding:{left:0,right:0},allowDataOverflow:!1,scale:"auto",reversed:!1,allowDuplicatedCategory:!0});function VN(e){"@babel/helpers - typeof";return VN=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},VN(e)}function lnn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function cnn(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,bUe(r.key),r)}}function unn(e,t,n){return cnn(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function dnn(e,t,n){return t=$L(t),fnn(e,xUe()?Reflect.construct(t,n||[],$L(e).constructor):t.apply(e,n))}function fnn(e,t){if(t&&(VN(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return hnn(e)}function hnn(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function xUe(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(xUe=function(){return!!e})()}function $L(e){return $L=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},$L(e)}function pnn(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&&yne(e,t)}function yne(e,t){return yne=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},yne(e,t)}function gUe(e,t,n){return t=bUe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function bUe(e){var t=mnn(e,"string");return VN(t)=="symbol"?t:t+""}function mnn(e,t){if(VN(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(VN(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function vne(){return vne=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},vne.apply(this,arguments)}var xnn=function(t){var n=t.yAxisId,r=Ace(),s=jce(),a=V$e(n);return a==null?null:Ae.createElement(n8,vne({},a,{className:sa("recharts-".concat(a.axisType," ").concat(a.axisType),a.className),viewBox:{x:0,y:0,width:r,height:s},ticksGenerator:function(l){return $g(l,!0)}}))},s8=function(e){function t(){return lnn(this,t),dnn(this,t,arguments)}return pnn(t,e),unn(t,[{key:"render",value:function(){return Ae.createElement(xnn,this.props)}}])}(Ae.Component);gUe(s8,"displayName","YAxis");gUe(s8,"defaultProps",{allowDuplicatedCategory:!0,allowDecimals:!0,hide:!1,orientation:"left",width:60,height:0,mirror:!1,yAxisId:0,tickCount:5,type:"number",padding:{top:0,bottom:0},allowDataOverflow:!1,scale:"auto",reversed:!1});function B6e(e){return vnn(e)||ynn(e)||bnn(e)||gnn()}function gnn(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function bnn(e,t){if(e){if(typeof e=="string")return wne(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return wne(e,t)}}function ynn(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function vnn(e){if(Array.isArray(e))return wne(e)}function wne(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Cne=function(t,n,r,s,a){var o=sf(t,_ce),l=sf(t,sU),c=[].concat(B6e(o),B6e(l)),u=sf(t,aU),d="".concat(s,"Id"),f=s[0],x=n;if(c.length&&(x=c.reduce(function(w,C){if(C.props[d]===r&&H0(C.props,"extendDomain")&&rs(C.props[f])){var N=C.props[f];return[Math.min(w[0],N),Math.max(w[1],N)]}return w},x)),u.length){var g="".concat(f,"1"),v="".concat(f,"2");x=u.reduce(function(w,C){if(C.props[d]===r&&H0(C.props,"extendDomain")&&rs(C.props[g])&&rs(C.props[v])){var N=C.props[g],P=C.props[v];return[Math.min(w[0],N,P),Math.max(w[1],N,P)]}return w},x)}return a&&a.length&&(x=a.reduce(function(w,C){return rs(C)?[Math.min(w[0],C),Math.max(w[1],C)]:w},x)),x},TY={exports:{}},$6e;function wnn(){return $6e||($6e=1,function(e){var t=Object.prototype.hasOwnProperty,n="~";function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(n=!1));function s(c,u,d){this.fn=c,this.context=u,this.once=d||!1}function a(c,u,d,f,x){if(typeof d!="function")throw new TypeError("The listener must be a function");var g=new s(d,f||c,x),v=n?n+u:u;return c._events[v]?c._events[v].fn?c._events[v]=[c._events[v],g]:c._events[v].push(g):(c._events[v]=g,c._eventsCount++),c}function o(c,u){--c._eventsCount===0?c._events=new r:delete c._events[u]}function l(){this._events=new r,this._eventsCount=0}l.prototype.eventNames=function(){var u=[],d,f;if(this._eventsCount===0)return u;for(f in d=this._events)t.call(d,f)&&u.push(n?f.slice(1):f);return Object.getOwnPropertySymbols?u.concat(Object.getOwnPropertySymbols(d)):u},l.prototype.listeners=function(u){var d=n?n+u:u,f=this._events[d];if(!f)return[];if(f.fn)return[f.fn];for(var x=0,g=f.length,v=new Array(g);x<g;x++)v[x]=f[x].fn;return v},l.prototype.listenerCount=function(u){var d=n?n+u:u,f=this._events[d];return f?f.fn?1:f.length:0},l.prototype.emit=function(u,d,f,x,g,v){var w=n?n+u:u;if(!this._events[w])return!1;var C=this._events[w],N=arguments.length,P,I;if(C.fn){switch(C.once&&this.removeListener(u,C.fn,void 0,!0),N){case 1:return C.fn.call(C.context),!0;case 2:return C.fn.call(C.context,d),!0;case 3:return C.fn.call(C.context,d,f),!0;case 4:return C.fn.call(C.context,d,f,x),!0;case 5:return C.fn.call(C.context,d,f,x,g),!0;case 6:return C.fn.call(C.context,d,f,x,g,v),!0}for(I=1,P=new Array(N-1);I<N;I++)P[I-1]=arguments[I];C.fn.apply(C.context,P)}else{var R=C.length,F;for(I=0;I<R;I++)switch(C[I].once&&this.removeListener(u,C[I].fn,void 0,!0),N){case 1:C[I].fn.call(C[I].context);break;case 2:C[I].fn.call(C[I].context,d);break;case 3:C[I].fn.call(C[I].context,d,f);break;case 4:C[I].fn.call(C[I].context,d,f,x);break;default:if(!P)for(F=1,P=new Array(N-1);F<N;F++)P[F-1]=arguments[F];C[I].fn.apply(C[I].context,P)}}return!0},l.prototype.on=function(u,d,f){return a(this,u,d,f,!1)},l.prototype.once=function(u,d,f){return a(this,u,d,f,!0)},l.prototype.removeListener=function(u,d,f,x){var g=n?n+u:u;if(!this._events[g])return this;if(!d)return o(this,g),this;var v=this._events[g];if(v.fn)v.fn===d&&(!x||v.once)&&(!f||v.context===f)&&o(this,g);else{for(var w=0,C=[],N=v.length;w<N;w++)(v[w].fn!==d||x&&!v[w].once||f&&v[w].context!==f)&&C.push(v[w]);C.length?this._events[g]=C.length===1?C[0]:C:o(this,g)}return this},l.prototype.removeAllListeners=function(u){var d;return u?(d=n?n+u:u,this._events[d]&&o(this,d)):(this._events=new r,this._eventsCount=0),this},l.prototype.off=l.prototype.removeListener,l.prototype.addListener=l.prototype.on,l.prefixed=n,l.EventEmitter=l,e.exports=l}(TY)),TY.exports}var Cnn=wnn();const Snn=Ti(Cnn);var IY=new Snn,PY="recharts.syncMouseEvents";function L_(e){"@babel/helpers - typeof";return L_=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},L_(e)}function Nnn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ann(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,yUe(r.key),r)}}function jnn(e,t,n){return Ann(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function FY(e,t,n){return t=yUe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function yUe(e){var t=Enn(e,"string");return L_(t)=="symbol"?t:t+""}function Enn(e,t){if(L_(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(L_(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var _nn=function(){function e(){Nnn(this,e),FY(this,"activeIndex",0),FY(this,"coordinateList",[]),FY(this,"layout","horizontal")}return jnn(e,[{key:"setDetails",value:function(n){var r,s=n.coordinateList,a=s===void 0?null:s,o=n.container,l=o===void 0?null:o,c=n.layout,u=c===void 0?null:c,d=n.offset,f=d===void 0?null:d,x=n.mouseHandlerCallback,g=x===void 0?null:x;this.coordinateList=(r=a??this.coordinateList)!==null&&r!==void 0?r:[],this.container=l??this.container,this.layout=u??this.layout,this.offset=f??this.offset,this.mouseHandlerCallback=g??this.mouseHandlerCallback,this.activeIndex=Math.min(Math.max(this.activeIndex,0),this.coordinateList.length-1)}},{key:"focus",value:function(){this.spoofMouse()}},{key:"keyboardEvent",value:function(n){if(this.coordinateList.length!==0)switch(n.key){case"ArrowRight":{if(this.layout!=="horizontal")return;this.activeIndex=Math.min(this.activeIndex+1,this.coordinateList.length-1),this.spoofMouse();break}case"ArrowLeft":{if(this.layout!=="horizontal")return;this.activeIndex=Math.max(this.activeIndex-1,0),this.spoofMouse();break}}}},{key:"setIndex",value:function(n){this.activeIndex=n}},{key:"spoofMouse",value:function(){var n,r;if(this.layout==="horizontal"&&this.coordinateList.length!==0){var s=this.container.getBoundingClientRect(),a=s.x,o=s.y,l=s.height,c=this.coordinateList[this.activeIndex].coordinate,u=((n=window)===null||n===void 0?void 0:n.scrollX)||0,d=((r=window)===null||r===void 0?void 0:r.scrollY)||0,f=a+c+u,x=o+this.offset.top+l/2+d;this.mouseHandlerCallback({pageX:f,pageY:x})}}}])}();function knn(e,t,n){if(n==="number"&&t===!0&&Array.isArray(e)){var r=e==null?void 0:e[0],s=e==null?void 0:e[1];if(r&&s&&rs(r)&&rs(s))return!0}return!1}function Tnn(e,t,n,r){var s=r/2;return{stroke:"none",fill:"#ccc",x:e==="horizontal"?t.x-s:n.left+.5,y:e==="horizontal"?n.top+.5:t.y-s,width:e==="horizontal"?r:n.width-1,height:e==="horizontal"?n.height-1:r}}function vUe(e){var t=e.cx,n=e.cy,r=e.radius,s=e.startAngle,a=e.endAngle,o=tu(t,n,r,s),l=tu(t,n,r,a);return{points:[o,l],cx:t,cy:n,radius:r,startAngle:s,endAngle:a}}function Inn(e,t,n){var r,s,a,o;if(e==="horizontal")r=t.x,a=r,s=n.top,o=n.top+n.height;else if(e==="vertical")s=t.y,o=s,r=n.left,a=n.left+n.width;else if(t.cx!=null&&t.cy!=null)if(e==="centric"){var l=t.cx,c=t.cy,u=t.innerRadius,d=t.outerRadius,f=t.angle,x=tu(l,c,u,f),g=tu(l,c,d,f);r=x.x,s=x.y,a=g.x,o=g.y}else return vUe(t);return[{x:r,y:s},{x:a,y:o}]}function D_(e){"@babel/helpers - typeof";return D_=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},D_(e)}function U6e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function MP(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?U6e(Object(n),!0).forEach(function(r){Pnn(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):U6e(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Pnn(e,t,n){return t=Fnn(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Fnn(e){var t=Onn(e,"string");return D_(t)=="symbol"?t:t+""}function Onn(e,t){if(D_(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(D_(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Mnn(e){var t,n,r=e.element,s=e.tooltipEventType,a=e.isActive,o=e.activeCoordinate,l=e.activePayload,c=e.offset,u=e.activeTooltipIndex,d=e.tooltipAxisBandSize,f=e.layout,x=e.chartName,g=(t=r.props.cursor)!==null&&t!==void 0?t:(n=r.type.defaultProps)===null||n===void 0?void 0:n.cursor;if(!r||!g||!a||!o||x!=="ScatterChart"&&s!=="axis")return null;var v,w=l3;if(x==="ScatterChart")v=o,w=iZt;else if(x==="BarChart")v=Tnn(f,o,c,d),w=wce;else if(f==="radial"){var C=vUe(o),N=C.cx,P=C.cy,I=C.radius,R=C.startAngle,F=C.endAngle;v={cx:N,cy:P,startAngle:R,endAngle:F,innerRadius:I,outerRadius:I},w=b$e}else v={points:Inn(f,o,c)},w=l3;var U=MP(MP(MP(MP({stroke:"#ccc",pointerEvents:"none"},c),v),vi(g,!1)),{},{payload:l,payloadIndex:u,className:sa("recharts-tooltip-cursor",g.className)});return m.isValidElement(g)?m.cloneElement(g,U):m.createElement(w,U)}var Rnn=["item"],Lnn=["children","className","width","height","style","compact","title","desc"];function WN(e){"@babel/helpers - typeof";return WN=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},WN(e)}function UC(){return UC=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},UC.apply(this,arguments)}function z6e(e,t){return $nn(e)||Bnn(e,t)||CUe(e,t)||Dnn()}function Dnn(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Bnn(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,s,a,o,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(d){u=!0,s=d}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw s}}return l}}function $nn(e){if(Array.isArray(e))return e}function H6e(e,t){if(e==null)return{};var n=Unn(e,t),r,s;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(s=0;s<a.length;s++)r=a[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Unn(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function znn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Hnn(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,SUe(r.key),r)}}function Vnn(e,t,n){return Hnn(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Wnn(e,t,n){return t=UL(t),qnn(e,wUe()?Reflect.construct(t,n,UL(e).constructor):t.apply(e,n))}function qnn(e,t){if(t&&(WN(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Gnn(e)}function Gnn(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function wUe(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(wUe=function(){return!!e})()}function UL(e){return UL=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},UL(e)}function Knn(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&&Sne(e,t)}function Sne(e,t){return Sne=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},Sne(e,t)}function qN(e){return Qnn(e)||Xnn(e)||CUe(e)||Ynn()}function Ynn(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function CUe(e,t){if(e){if(typeof e=="string")return Nne(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Nne(e,t)}}function Xnn(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Qnn(e){if(Array.isArray(e))return Nne(e)}function Nne(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function V6e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function Cr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?V6e(Object(n),!0).forEach(function(r){ei(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):V6e(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ei(e,t,n){return t=SUe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function SUe(e){var t=Znn(e,"string");return WN(t)=="symbol"?t:t+""}function Znn(e,t){if(WN(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(WN(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Jnn={xAxis:["bottom","top"],yAxis:["left","right"]},ern={width:"100%",height:"100%"},NUe={x:0,y:0};function RP(e){return e}var trn=function(t,n){return n==="horizontal"?t.x:n==="vertical"?t.y:n==="centric"?t.angle:t.radius},nrn=function(t,n,r,s){var a=n.find(function(d){return d&&d.index===r});if(a){if(t==="horizontal")return{x:a.coordinate,y:s.y};if(t==="vertical")return{x:s.x,y:a.coordinate};if(t==="centric"){var o=a.coordinate,l=s.radius;return Cr(Cr(Cr({},s),tu(s.cx,s.cy,l,o)),{},{angle:o,radius:l})}var c=a.coordinate,u=s.angle;return Cr(Cr(Cr({},s),tu(s.cx,s.cy,c,u)),{},{angle:u,radius:c})}return NUe},cU=function(t,n){var r=n.graphicalItems,s=n.dataStartIndex,a=n.dataEndIndex,o=(r??[]).reduce(function(l,c){var u=c.props.data;return u&&u.length?[].concat(qN(l),qN(u)):l},[]);return o.length>0?o:t&&t.length&&rs(s)&&rs(a)?t.slice(s,a+1):[]};function AUe(e){return e==="number"?[0,"auto"]:void 0}var Ane=function(t,n,r,s){var a=t.graphicalItems,o=t.tooltipAxis,l=cU(n,t);return r<0||!a||!a.length||r>=l.length?null:a.reduce(function(c,u){var d,f=(d=u.props.data)!==null&&d!==void 0?d:n;f&&t.dataStartIndex+t.dataEndIndex!==0&&t.dataEndIndex-t.dataStartIndex>=r&&(f=f.slice(t.dataStartIndex,t.dataEndIndex+1));var x;if(o.dataKey&&!o.allowDuplicatedCategory){var g=f===void 0?l:f;x=VR(g,o.dataKey,s)}else x=f&&f[r]||l[r];return x?[].concat(qN(c),[m$e(u,x)]):c},[])},W6e=function(t,n,r,s){var a=s||{x:t.chartX,y:t.chartY},o=trn(a,r),l=t.orderedTooltipTicks,c=t.tooltipAxis,u=t.tooltipTicks,d=WKt(o,l,u,c);if(d>=0&&u){var f=u[d]&&u[d].value,x=Ane(t,n,d,f),g=nrn(r,l,d,a);return{activeTooltipIndex:d,activeLabel:f,activePayload:x,activeCoordinate:g}}return null},rrn=function(t,n){var r=n.axes,s=n.graphicalItems,a=n.axisType,o=n.axisIdKey,l=n.stackGroups,c=n.dataStartIndex,u=n.dataEndIndex,d=t.layout,f=t.children,x=t.stackOffset,g=f$e(d,a);return r.reduce(function(v,w){var C,N=w.type.defaultProps!==void 0?Cr(Cr({},w.type.defaultProps),w.props):w.props,P=N.type,I=N.dataKey,R=N.allowDataOverflow,F=N.allowDuplicatedCategory,U=N.scale,L=N.ticks,z=N.includeHidden,Q=N[o];if(v[Q])return v;var ne=cU(t.data,{graphicalItems:s.filter(function(fe){var Ne,he=o in fe.props?fe.props[o]:(Ne=fe.type.defaultProps)===null||Ne===void 0?void 0:Ne[o];return he===Q}),dataStartIndex:c,dataEndIndex:u}),J=ne.length,X,re,pe;knn(N.domain,R,P)&&(X=Bte(N.domain,null,R),g&&(P==="number"||U!=="auto")&&(pe=a9(ne,I,"category")));var Y=AUe(P);if(!X||X.length===0){var ie,oe=(ie=N.domain)!==null&&ie!==void 0?ie:Y;if(I){if(X=a9(ne,I,P),P==="category"&&g){var G=L$t(X);F&&G?(re=X,X=AL(0,J)):F||(X=t5e(oe,X,w).reduce(function(fe,Ne){return fe.indexOf(Ne)>=0?fe:[].concat(qN(fe),[Ne])},[]))}else if(P==="category")F?X=X.filter(function(fe){return fe!==""&&!wi(fe)}):X=t5e(oe,X,w).reduce(function(fe,Ne){return fe.indexOf(Ne)>=0||Ne===""||wi(Ne)?fe:[].concat(qN(fe),[Ne])},[]);else if(P==="number"){var V=XKt(ne,s.filter(function(fe){var Ne,he,ge=o in fe.props?fe.props[o]:(Ne=fe.type.defaultProps)===null||Ne===void 0?void 0:Ne[o],ye="hide"in fe.props?fe.props.hide:(he=fe.type.defaultProps)===null||he===void 0?void 0:he.hide;return ge===Q&&(z||!ye)}),I,a,d);V&&(X=V)}g&&(P==="number"||U!=="auto")&&(pe=a9(ne,I,"category"))}else g?X=AL(0,J):l&&l[Q]&&l[Q].hasStack&&P==="number"?X=x==="expand"?[0,1]:p$e(l[Q].stackGroups,c,u):X=d$e(ne,s.filter(function(fe){var Ne=o in fe.props?fe.props[o]:fe.type.defaultProps[o],he="hide"in fe.props?fe.props.hide:fe.type.defaultProps.hide;return Ne===Q&&(z||!he)}),P,d,!0);if(P==="number")X=Cne(f,X,Q,a,L),oe&&(X=Bte(oe,X,R));else if(P==="category"&&oe){var ee=oe,ae=X.every(function(fe){return ee.indexOf(fe)>=0});ae&&(X=ee)}}return Cr(Cr({},v),{},ei({},Q,Cr(Cr({},N),{},{axisType:a,domain:X,categoricalDomain:pe,duplicateDomain:re,originalDomain:(C=N.domain)!==null&&C!==void 0?C:Y,isCategorical:g,layout:d})))},{})},srn=function(t,n){var r=n.graphicalItems,s=n.Axis,a=n.axisType,o=n.axisIdKey,l=n.stackGroups,c=n.dataStartIndex,u=n.dataEndIndex,d=t.layout,f=t.children,x=cU(t.data,{graphicalItems:r,dataStartIndex:c,dataEndIndex:u}),g=x.length,v=f$e(d,a),w=-1;return r.reduce(function(C,N){var P=N.type.defaultProps!==void 0?Cr(Cr({},N.type.defaultProps),N.props):N.props,I=P[o],R=AUe("number");if(!C[I]){w++;var F;return v?F=AL(0,g):l&&l[I]&&l[I].hasStack?(F=p$e(l[I].stackGroups,c,u),F=Cne(f,F,I,a)):(F=Bte(R,d$e(x,r.filter(function(U){var L,z,Q=o in U.props?U.props[o]:(L=U.type.defaultProps)===null||L===void 0?void 0:L[o],ne="hide"in U.props?U.props.hide:(z=U.type.defaultProps)===null||z===void 0?void 0:z.hide;return Q===I&&!ne}),"number",d),s.defaultProps.allowDataOverflow),F=Cne(f,F,I,a)),Cr(Cr({},C),{},ei({},I,Cr(Cr({axisType:a},s.defaultProps),{},{hide:!0,orientation:np(Jnn,"".concat(a,".").concat(w%2),null),domain:F,originalDomain:R,isCategorical:v,layout:d})))}return C},{})},irn=function(t,n){var r=n.axisType,s=r===void 0?"xAxis":r,a=n.AxisComp,o=n.graphicalItems,l=n.stackGroups,c=n.dataStartIndex,u=n.dataEndIndex,d=t.children,f="".concat(s,"Id"),x=sf(d,a),g={};return x.length?g=rrn(t,{axes:x,graphicalItems:o,axisType:s,axisIdKey:f,stackGroups:l,dataStartIndex:c,dataEndIndex:u}):o&&o.length&&(g=srn(t,{Axis:a,graphicalItems:o,axisType:s,axisIdKey:f,stackGroups:l,dataStartIndex:c,dataEndIndex:u})),g},arn=function(t){var n=Mb(t),r=$g(n,!1,!0);return{tooltipTicks:r,orderedTooltipTicks:Gle(r,function(s){return s.coordinate}),tooltipAxis:n,tooltipAxisBandSize:xL(n,r)}},q6e=function(t){var n=t.children,r=t.defaultShowTooltip,s=Mf(n,FN),a=0,o=0;return t.data&&t.data.length!==0&&(o=t.data.length-1),s&&s.props&&(s.props.startIndex>=0&&(a=s.props.startIndex),s.props.endIndex>=0&&(o=s.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:a,dataEndIndex:o,activeTooltipIndex:-1,isTooltipActive:!!r}},orn=function(t){return!t||!t.length?!1:t.some(function(n){var r=Xg(n&&n.type);return r&&r.indexOf("Bar")>=0})},G6e=function(t){return t==="horizontal"?{numericAxisName:"yAxis",cateAxisName:"xAxis"}:t==="vertical"?{numericAxisName:"xAxis",cateAxisName:"yAxis"}:t==="centric"?{numericAxisName:"radiusAxis",cateAxisName:"angleAxis"}:{numericAxisName:"angleAxis",cateAxisName:"radiusAxis"}},lrn=function(t,n){var r=t.props,s=t.graphicalItems,a=t.xAxisMap,o=a===void 0?{}:a,l=t.yAxisMap,c=l===void 0?{}:l,u=r.width,d=r.height,f=r.children,x=r.margin||{},g=Mf(f,FN),v=Mf(f,i3),w=Object.keys(c).reduce(function(F,U){var L=c[U],z=L.orientation;return!L.mirror&&!L.hide?Cr(Cr({},F),{},ei({},z,F[z]+L.width)):F},{left:x.left||0,right:x.right||0}),C=Object.keys(o).reduce(function(F,U){var L=o[U],z=L.orientation;return!L.mirror&&!L.hide?Cr(Cr({},F),{},ei({},z,np(F,"".concat(z))+L.height)):F},{top:x.top||0,bottom:x.bottom||0}),N=Cr(Cr({},C),w),P=N.bottom;g&&(N.bottom+=g.props.height||FN.defaultProps.height),v&&n&&(N=KKt(N,s,r,n));var I=u-N.left-N.right,R=d-N.top-N.bottom;return Cr(Cr({brushBottom:P},N),{},{width:Math.max(I,0),height:Math.max(R,0)})},crn=function(t,n){if(n==="xAxis")return t[n].width;if(n==="yAxis")return t[n].height},jUe=function(t){var n=t.chartName,r=t.GraphicalChild,s=t.defaultTooltipEventType,a=s===void 0?"axis":s,o=t.validateTooltipEventTypes,l=o===void 0?["axis"]:o,c=t.axisComponents,u=t.legendContent,d=t.formatAxisMap,f=t.defaultProps,x=function(N,P){var I=P.graphicalItems,R=P.stackGroups,F=P.offset,U=P.updateId,L=P.dataStartIndex,z=P.dataEndIndex,Q=N.barSize,ne=N.layout,J=N.barGap,X=N.barCategoryGap,re=N.maxBarSize,pe=G6e(ne),Y=pe.numericAxisName,ie=pe.cateAxisName,oe=orn(I),G=[];return I.forEach(function(V,ee){var ae=cU(N.data,{graphicalItems:[V],dataStartIndex:L,dataEndIndex:z}),fe=V.type.defaultProps!==void 0?Cr(Cr({},V.type.defaultProps),V.props):V.props,Ne=fe.dataKey,he=fe.maxBarSize,ge=fe["".concat(Y,"Id")],ye=fe["".concat(ie,"Id")],ve={},je=c.reduce(function(jt,cn){var un=P["".concat(cn.axisType,"Map")],Ft=fe["".concat(cn.axisType,"Id")];un&&un[Ft]||cn.axisType==="zAxis"||X3();var Ke=un[Ft];return Cr(Cr({},jt),{},ei(ei({},cn.axisType,Ke),"".concat(cn.axisType,"Ticks"),$g(Ke)))},ve),Ie=je[ie],Le=je["".concat(ie,"Ticks")],Qe=R&&R[ge]&&R[ge].hasStack&&lYt(V,R[ge].stackGroups),$e=Xg(V.type).indexOf("Bar")>=0,it=xL(Ie,Le),tt=[],lt=oe&&qKt({barSize:Q,stackGroups:R,totalSize:crn(je,ie)});if($e){var ft,ut,qt=wi(he)?re:he,It=(ft=(ut=xL(Ie,Le,!0))!==null&&ut!==void 0?ut:qt)!==null&&ft!==void 0?ft:0;tt=GKt({barGap:J,barCategoryGap:X,bandSize:It!==it?It:it,sizeList:lt[ye],maxBarSize:qt}),It!==it&&(tt=tt.map(function(jt){return Cr(Cr({},jt),{},{position:Cr(Cr({},jt.position),{},{offset:jt.position.offset-It/2})})}))}var nn=V&&V.type&&V.type.getComposedData;nn&&G.push({props:Cr(Cr({},nn(Cr(Cr({},je),{},{displayedData:ae,props:N,dataKey:Ne,item:V,bandSize:it,barPosition:tt,offset:F,stackedData:Qe,layout:ne,dataStartIndex:L,dataEndIndex:z}))),{},ei(ei(ei({key:V.key||"item-".concat(ee)},Y,je[Y]),ie,je[ie]),"animationId",U)),childIndex:X$t(V,N.children),item:V})}),G},g=function(N,P){var I=N.props,R=N.dataStartIndex,F=N.dataEndIndex,U=N.updateId;if(!x2e({props:I}))return null;var L=I.children,z=I.layout,Q=I.stackOffset,ne=I.data,J=I.reverseStackOrder,X=G6e(z),re=X.numericAxisName,pe=X.cateAxisName,Y=sf(L,r),ie=iYt(ne,Y,"".concat(re,"Id"),"".concat(pe,"Id"),Q,J),oe=c.reduce(function(fe,Ne){var he="".concat(Ne.axisType,"Map");return Cr(Cr({},fe),{},ei({},he,irn(I,Cr(Cr({},Ne),{},{graphicalItems:Y,stackGroups:Ne.axisType===re&&ie,dataStartIndex:R,dataEndIndex:F}))))},{}),G=lrn(Cr(Cr({},oe),{},{props:I,graphicalItems:Y}),P==null?void 0:P.legendBBox);Object.keys(oe).forEach(function(fe){oe[fe]=d(I,oe[fe],G,fe.replace("Map",""),n)});var V=oe["".concat(pe,"Map")],ee=arn(V),ae=x(I,Cr(Cr({},oe),{},{dataStartIndex:R,dataEndIndex:F,updateId:U,graphicalItems:Y,stackGroups:ie,offset:G}));return Cr(Cr({formattedGraphicalItems:ae,graphicalItems:Y,offset:G,stackGroups:ie},ee),oe)},v=function(C){function N(P){var I,R,F;return znn(this,N),F=Wnn(this,N,[P]),ei(F,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),ei(F,"accessibilityManager",new _nn),ei(F,"handleLegendBBoxUpdate",function(U){if(U){var L=F.state,z=L.dataStartIndex,Q=L.dataEndIndex,ne=L.updateId;F.setState(Cr({legendBBox:U},g({props:F.props,dataStartIndex:z,dataEndIndex:Q,updateId:ne},Cr(Cr({},F.state),{},{legendBBox:U}))))}}),ei(F,"handleReceiveSyncEvent",function(U,L,z){if(F.props.syncId===U){if(z===F.eventEmitterSymbol&&typeof F.props.syncMethod!="function")return;F.applySyncEvent(L)}}),ei(F,"handleBrushChange",function(U){var L=U.startIndex,z=U.endIndex;if(L!==F.state.dataStartIndex||z!==F.state.dataEndIndex){var Q=F.state.updateId;F.setState(function(){return Cr({dataStartIndex:L,dataEndIndex:z},g({props:F.props,dataStartIndex:L,dataEndIndex:z,updateId:Q},F.state))}),F.triggerSyncEvent({dataStartIndex:L,dataEndIndex:z})}}),ei(F,"handleMouseEnter",function(U){var L=F.getMouseInfo(U);if(L){var z=Cr(Cr({},L),{},{isTooltipActive:!0});F.setState(z),F.triggerSyncEvent(z);var Q=F.props.onMouseEnter;Ai(Q)&&Q(z,U)}}),ei(F,"triggeredAfterMouseMove",function(U){var L=F.getMouseInfo(U),z=L?Cr(Cr({},L),{},{isTooltipActive:!0}):{isTooltipActive:!1};F.setState(z),F.triggerSyncEvent(z);var Q=F.props.onMouseMove;Ai(Q)&&Q(z,U)}),ei(F,"handleItemMouseEnter",function(U){F.setState(function(){return{isTooltipActive:!0,activeItem:U,activePayload:U.tooltipPayload,activeCoordinate:U.tooltipPosition||{x:U.cx,y:U.cy}}})}),ei(F,"handleItemMouseLeave",function(){F.setState(function(){return{isTooltipActive:!1}})}),ei(F,"handleMouseMove",function(U){U.persist(),F.throttleTriggeredAfterMouseMove(U)}),ei(F,"handleMouseLeave",function(U){F.throttleTriggeredAfterMouseMove.cancel();var L={isTooltipActive:!1};F.setState(L),F.triggerSyncEvent(L);var z=F.props.onMouseLeave;Ai(z)&&z(L,U)}),ei(F,"handleOuterEvent",function(U){var L=Y$t(U),z=np(F.props,"".concat(L));if(L&&Ai(z)){var Q,ne;/.*touch.*/i.test(L)?ne=F.getMouseInfo(U.changedTouches[0]):ne=F.getMouseInfo(U),z((Q=ne)!==null&&Q!==void 0?Q:{},U)}}),ei(F,"handleClick",function(U){var L=F.getMouseInfo(U);if(L){var z=Cr(Cr({},L),{},{isTooltipActive:!0});F.setState(z),F.triggerSyncEvent(z);var Q=F.props.onClick;Ai(Q)&&Q(z,U)}}),ei(F,"handleMouseDown",function(U){var L=F.props.onMouseDown;if(Ai(L)){var z=F.getMouseInfo(U);L(z,U)}}),ei(F,"handleMouseUp",function(U){var L=F.props.onMouseUp;if(Ai(L)){var z=F.getMouseInfo(U);L(z,U)}}),ei(F,"handleTouchMove",function(U){U.changedTouches!=null&&U.changedTouches.length>0&&F.throttleTriggeredAfterMouseMove(U.changedTouches[0])}),ei(F,"handleTouchStart",function(U){U.changedTouches!=null&&U.changedTouches.length>0&&F.handleMouseDown(U.changedTouches[0])}),ei(F,"handleTouchEnd",function(U){U.changedTouches!=null&&U.changedTouches.length>0&&F.handleMouseUp(U.changedTouches[0])}),ei(F,"handleDoubleClick",function(U){var L=F.props.onDoubleClick;if(Ai(L)){var z=F.getMouseInfo(U);L(z,U)}}),ei(F,"handleContextMenu",function(U){var L=F.props.onContextMenu;if(Ai(L)){var z=F.getMouseInfo(U);L(z,U)}}),ei(F,"triggerSyncEvent",function(U){F.props.syncId!==void 0&&IY.emit(PY,F.props.syncId,U,F.eventEmitterSymbol)}),ei(F,"applySyncEvent",function(U){var L=F.props,z=L.layout,Q=L.syncMethod,ne=F.state.updateId,J=U.dataStartIndex,X=U.dataEndIndex;if(U.dataStartIndex!==void 0||U.dataEndIndex!==void 0)F.setState(Cr({dataStartIndex:J,dataEndIndex:X},g({props:F.props,dataStartIndex:J,dataEndIndex:X,updateId:ne},F.state)));else if(U.activeTooltipIndex!==void 0){var re=U.chartX,pe=U.chartY,Y=U.activeTooltipIndex,ie=F.state,oe=ie.offset,G=ie.tooltipTicks;if(!oe)return;if(typeof Q=="function")Y=Q(G,U);else if(Q==="value"){Y=-1;for(var V=0;V<G.length;V++)if(G[V].value===U.activeLabel){Y=V;break}}var ee=Cr(Cr({},oe),{},{x:oe.left,y:oe.top}),ae=Math.min(re,ee.x+ee.width),fe=Math.min(pe,ee.y+ee.height),Ne=G[Y]&&G[Y].value,he=Ane(F.state,F.props.data,Y),ge=G[Y]?{x:z==="horizontal"?G[Y].coordinate:ae,y:z==="horizontal"?fe:G[Y].coordinate}:NUe;F.setState(Cr(Cr({},U),{},{activeLabel:Ne,activeCoordinate:ge,activePayload:he,activeTooltipIndex:Y}))}else F.setState(U)}),ei(F,"renderCursor",function(U){var L,z=F.state,Q=z.isTooltipActive,ne=z.activeCoordinate,J=z.activePayload,X=z.offset,re=z.activeTooltipIndex,pe=z.tooltipAxisBandSize,Y=F.getTooltipEventType(),ie=(L=U.props.active)!==null&&L!==void 0?L:Q,oe=F.props.layout,G=U.key||"_recharts-cursor";return Ae.createElement(Mnn,{key:G,activeCoordinate:ne,activePayload:J,activeTooltipIndex:re,chartName:n,element:U,isActive:ie,layout:oe,offset:X,tooltipAxisBandSize:pe,tooltipEventType:Y})}),ei(F,"renderPolarAxis",function(U,L,z){var Q=np(U,"type.axisType"),ne=np(F.state,"".concat(Q,"Map")),J=U.type.defaultProps,X=J!==void 0?Cr(Cr({},J),U.props):U.props,re=ne&&ne[X["".concat(Q,"Id")]];return m.cloneElement(U,Cr(Cr({},re),{},{className:sa(Q,re.className),key:U.key||"".concat(L,"-").concat(z),ticks:$g(re,!0)}))}),ei(F,"renderPolarGrid",function(U){var L=U.props,z=L.radialLines,Q=L.polarAngles,ne=L.polarRadius,J=F.state,X=J.radiusAxisMap,re=J.angleAxisMap,pe=Mb(X),Y=Mb(re),ie=Y.cx,oe=Y.cy,G=Y.innerRadius,V=Y.outerRadius;return m.cloneElement(U,{polarAngles:Array.isArray(Q)?Q:$g(Y,!0).map(function(ee){return ee.coordinate}),polarRadius:Array.isArray(ne)?ne:$g(pe,!0).map(function(ee){return ee.coordinate}),cx:ie,cy:oe,innerRadius:G,outerRadius:V,key:U.key||"polar-grid",radialLines:z})}),ei(F,"renderLegend",function(){var U=F.state.formattedGraphicalItems,L=F.props,z=L.children,Q=L.width,ne=L.height,J=F.props.margin||{},X=Q-(J.left||0)-(J.right||0),re=c$e({children:z,formattedGraphicalItems:U,legendWidth:X,legendContent:u});if(!re)return null;var pe=re.item,Y=H6e(re,Rnn);return m.cloneElement(pe,Cr(Cr({},Y),{},{chartWidth:Q,chartHeight:ne,margin:J,onBBoxUpdate:F.handleLegendBBoxUpdate}))}),ei(F,"renderTooltip",function(){var U,L=F.props,z=L.children,Q=L.accessibilityLayer,ne=Mf(z,Yp);if(!ne)return null;var J=F.state,X=J.isTooltipActive,re=J.activeCoordinate,pe=J.activePayload,Y=J.activeLabel,ie=J.offset,oe=(U=ne.props.active)!==null&&U!==void 0?U:X;return m.cloneElement(ne,{viewBox:Cr(Cr({},ie),{},{x:ie.left,y:ie.top}),active:oe,label:Y,payload:oe?pe:[],coordinate:re,accessibilityLayer:Q})}),ei(F,"renderBrush",function(U){var L=F.props,z=L.margin,Q=L.data,ne=F.state,J=ne.offset,X=ne.dataStartIndex,re=ne.dataEndIndex,pe=ne.updateId;return m.cloneElement(U,{key:U.key||"_recharts-brush",onChange:IP(F.handleBrushChange,U.props.onChange),data:Q,x:rs(U.props.x)?U.props.x:J.left,y:rs(U.props.y)?U.props.y:J.top+J.height+J.brushBottom-(z.bottom||0),width:rs(U.props.width)?U.props.width:J.width,startIndex:X,endIndex:re,updateId:"brush-".concat(pe)})}),ei(F,"renderReferenceElement",function(U,L,z){if(!U)return null;var Q=F,ne=Q.clipPathId,J=F.state,X=J.xAxisMap,re=J.yAxisMap,pe=J.offset,Y=U.type.defaultProps||{},ie=U.props,oe=ie.xAxisId,G=oe===void 0?Y.xAxisId:oe,V=ie.yAxisId,ee=V===void 0?Y.yAxisId:V;return m.cloneElement(U,{key:U.key||"".concat(L,"-").concat(z),xAxis:X[G],yAxis:re[ee],viewBox:{x:pe.left,y:pe.top,width:pe.width,height:pe.height},clipPathId:ne})}),ei(F,"renderActivePoints",function(U){var L=U.item,z=U.activePoint,Q=U.basePoint,ne=U.childIndex,J=U.isRange,X=[],re=L.props.key,pe=L.item.type.defaultProps!==void 0?Cr(Cr({},L.item.type.defaultProps),L.item.props):L.item.props,Y=pe.activeDot,ie=pe.dataKey,oe=Cr(Cr({index:ne,dataKey:ie,cx:z.x,cy:z.y,r:4,fill:vce(L.item),strokeWidth:2,stroke:"#fff",payload:z.payload,value:z.value},vi(Y,!1)),WR(Y));return X.push(N.renderActiveDot(Y,oe,"".concat(re,"-activePoint-").concat(ne))),Q?X.push(N.renderActiveDot(Y,Cr(Cr({},oe),{},{cx:Q.x,cy:Q.y}),"".concat(re,"-basePoint-").concat(ne))):J&&X.push(null),X}),ei(F,"renderGraphicChild",function(U,L,z){var Q=F.filterFormatItem(U,L,z);if(!Q)return null;var ne=F.getTooltipEventType(),J=F.state,X=J.isTooltipActive,re=J.tooltipAxis,pe=J.activeTooltipIndex,Y=J.activeLabel,ie=F.props.children,oe=Mf(ie,Yp),G=Q.props,V=G.points,ee=G.isRange,ae=G.baseLine,fe=Q.item.type.defaultProps!==void 0?Cr(Cr({},Q.item.type.defaultProps),Q.item.props):Q.item.props,Ne=fe.activeDot,he=fe.hide,ge=fe.activeBar,ye=fe.activeShape,ve=!!(!he&&X&&oe&&(Ne||ge||ye)),je={};ne!=="axis"&&oe&&oe.props.trigger==="click"?je={onClick:IP(F.handleItemMouseEnter,U.props.onClick)}:ne!=="axis"&&(je={onMouseLeave:IP(F.handleItemMouseLeave,U.props.onMouseLeave),onMouseEnter:IP(F.handleItemMouseEnter,U.props.onMouseEnter)});var Ie=m.cloneElement(U,Cr(Cr({},Q.props),je));function Le(cn){return typeof re.dataKey=="function"?re.dataKey(cn.payload):null}if(ve)if(pe>=0){var Qe,$e;if(re.dataKey&&!re.allowDuplicatedCategory){var it=typeof re.dataKey=="function"?Le:"payload.".concat(re.dataKey.toString());Qe=VR(V,it,Y),$e=ee&&ae&&VR(ae,it,Y)}else Qe=V==null?void 0:V[pe],$e=ee&&ae&&ae[pe];if(ye||ge){var tt=U.props.activeIndex!==void 0?U.props.activeIndex:pe;return[m.cloneElement(U,Cr(Cr(Cr({},Q.props),je),{},{activeIndex:tt})),null,null]}if(!wi(Qe))return[Ie].concat(qN(F.renderActivePoints({item:Q,activePoint:Qe,basePoint:$e,childIndex:pe,isRange:ee})))}else{var lt,ft=(lt=F.getItemByXY(F.state.activeCoordinate))!==null&<!==void 0?lt:{graphicalItem:Ie},ut=ft.graphicalItem,qt=ut.item,It=qt===void 0?U:qt,nn=ut.childIndex,jt=Cr(Cr(Cr({},Q.props),je),{},{activeIndex:nn});return[m.cloneElement(It,jt),null,null]}return ee?[Ie,null,null]:[Ie,null]}),ei(F,"renderCustomized",function(U,L,z){return m.cloneElement(U,Cr(Cr({key:"recharts-customized-".concat(z)},F.props),F.state))}),ei(F,"renderMap",{CartesianGrid:{handler:RP,once:!0},ReferenceArea:{handler:F.renderReferenceElement},ReferenceLine:{handler:RP},ReferenceDot:{handler:F.renderReferenceElement},XAxis:{handler:RP},YAxis:{handler:RP},Brush:{handler:F.renderBrush,once:!0},Bar:{handler:F.renderGraphicChild},Line:{handler:F.renderGraphicChild},Area:{handler:F.renderGraphicChild},Radar:{handler:F.renderGraphicChild},RadialBar:{handler:F.renderGraphicChild},Scatter:{handler:F.renderGraphicChild},Pie:{handler:F.renderGraphicChild},Funnel:{handler:F.renderGraphicChild},Tooltip:{handler:F.renderCursor,once:!0},PolarGrid:{handler:F.renderPolarGrid,once:!0},PolarAngleAxis:{handler:F.renderPolarAxis},PolarRadiusAxis:{handler:F.renderPolarAxis},Customized:{handler:F.renderCustomized}}),F.clipPathId="".concat((I=P.id)!==null&&I!==void 0?I:S5("recharts"),"-clip"),F.throttleTriggeredAfterMouseMove=lBe(F.triggeredAfterMouseMove,(R=P.throttleDelay)!==null&&R!==void 0?R:1e3/60),F.state={},F}return Knn(N,C),Vnn(N,[{key:"componentDidMount",value:function(){var I,R;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(I=this.props.margin.left)!==null&&I!==void 0?I:0,top:(R=this.props.margin.top)!==null&&R!==void 0?R:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var I=this.props,R=I.children,F=I.data,U=I.height,L=I.layout,z=Mf(R,Yp);if(z){var Q=z.props.defaultIndex;if(!(typeof Q!="number"||Q<0||Q>this.state.tooltipTicks.length-1)){var ne=this.state.tooltipTicks[Q]&&this.state.tooltipTicks[Q].value,J=Ane(this.state,F,Q,ne),X=this.state.tooltipTicks[Q].coordinate,re=(this.state.offset.top+U)/2,pe=L==="horizontal",Y=pe?{x:X,y:re}:{y:X,x:re},ie=this.state.formattedGraphicalItems.find(function(G){var V=G.item;return V.type.name==="Scatter"});ie&&(Y=Cr(Cr({},Y),ie.props.points[Q].tooltipPosition),J=ie.props.points[Q].tooltipPayload);var oe={activeTooltipIndex:Q,isTooltipActive:!0,activeLabel:ne,activePayload:J,activeCoordinate:Y};this.setState(oe),this.renderCursor(z),this.accessibilityManager.setIndex(Q)}}}},{key:"getSnapshotBeforeUpdate",value:function(I,R){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==R.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==I.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==I.margin){var F,U;this.accessibilityManager.setDetails({offset:{left:(F=this.props.margin.left)!==null&&F!==void 0?F:0,top:(U=this.props.margin.top)!==null&&U!==void 0?U:0}})}return null}},{key:"componentDidUpdate",value:function(I){ote([Mf(I.children,Yp)],[Mf(this.props.children,Yp)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var I=Mf(this.props.children,Yp);if(I&&typeof I.props.shared=="boolean"){var R=I.props.shared?"axis":"item";return l.indexOf(R)>=0?R:a}return a}},{key:"getMouseInfo",value:function(I){if(!this.container)return null;var R=this.container,F=R.getBoundingClientRect(),U=MVt(F),L={chartX:Math.round(I.pageX-U.left),chartY:Math.round(I.pageY-U.top)},z=F.width/R.offsetWidth||1,Q=this.inRange(L.chartX,L.chartY,z);if(!Q)return null;var ne=this.state,J=ne.xAxisMap,X=ne.yAxisMap,re=this.getTooltipEventType(),pe=W6e(this.state,this.props.data,this.props.layout,Q);if(re!=="axis"&&J&&X){var Y=Mb(J).scale,ie=Mb(X).scale,oe=Y&&Y.invert?Y.invert(L.chartX):null,G=ie&&ie.invert?ie.invert(L.chartY):null;return Cr(Cr({},L),{},{xValue:oe,yValue:G},pe)}return pe?Cr(Cr({},L),pe):null}},{key:"inRange",value:function(I,R){var F=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,U=this.props.layout,L=I/F,z=R/F;if(U==="horizontal"||U==="vertical"){var Q=this.state.offset,ne=L>=Q.left&&L<=Q.left+Q.width&&z>=Q.top&&z<=Q.top+Q.height;return ne?{x:L,y:z}:null}var J=this.state,X=J.angleAxisMap,re=J.radiusAxisMap;if(X&&re){var pe=Mb(X);return s5e({x:L,y:z},pe)}return null}},{key:"parseEventsOfWrapper",value:function(){var I=this.props.children,R=this.getTooltipEventType(),F=Mf(I,Yp),U={};F&&R==="axis"&&(F.props.trigger==="click"?U={onClick:this.handleClick}:U={onMouseEnter:this.handleMouseEnter,onDoubleClick:this.handleDoubleClick,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd,onContextMenu:this.handleContextMenu});var L=WR(this.props,this.handleOuterEvent);return Cr(Cr({},L),U)}},{key:"addListener",value:function(){IY.on(PY,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){IY.removeListener(PY,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(I,R,F){for(var U=this.state.formattedGraphicalItems,L=0,z=U.length;L<z;L++){var Q=U[L];if(Q.item===I||Q.props.key===I.key||R===Xg(Q.item.type)&&F===Q.childIndex)return Q}return null}},{key:"renderClipPath",value:function(){var I=this.clipPathId,R=this.state.offset,F=R.left,U=R.top,L=R.height,z=R.width;return Ae.createElement("defs",null,Ae.createElement("clipPath",{id:I},Ae.createElement("rect",{x:F,y:U,height:L,width:z})))}},{key:"getXScales",value:function(){var I=this.state.xAxisMap;return I?Object.entries(I).reduce(function(R,F){var U=z6e(F,2),L=U[0],z=U[1];return Cr(Cr({},R),{},ei({},L,z.scale))},{}):null}},{key:"getYScales",value:function(){var I=this.state.yAxisMap;return I?Object.entries(I).reduce(function(R,F){var U=z6e(F,2),L=U[0],z=U[1];return Cr(Cr({},R),{},ei({},L,z.scale))},{}):null}},{key:"getXScaleByAxisId",value:function(I){var R;return(R=this.state.xAxisMap)===null||R===void 0||(R=R[I])===null||R===void 0?void 0:R.scale}},{key:"getYScaleByAxisId",value:function(I){var R;return(R=this.state.yAxisMap)===null||R===void 0||(R=R[I])===null||R===void 0?void 0:R.scale}},{key:"getItemByXY",value:function(I){var R=this.state,F=R.formattedGraphicalItems,U=R.activeItem;if(F&&F.length)for(var L=0,z=F.length;L<z;L++){var Q=F[L],ne=Q.props,J=Q.item,X=J.type.defaultProps!==void 0?Cr(Cr({},J.type.defaultProps),J.props):J.props,re=Xg(J.type);if(re==="Bar"){var pe=(ne.data||[]).find(function(G){return YQt(I,G)});if(pe)return{graphicalItem:Q,payload:pe}}else if(re==="RadialBar"){var Y=(ne.data||[]).find(function(G){return s5e(I,G)});if(Y)return{graphicalItem:Q,payload:Y}}else if(eU(Q,U)||tU(Q,U)||P_(Q,U)){var ie=DZt({graphicalItem:Q,activeTooltipItem:U,itemData:X.data}),oe=X.activeIndex===void 0?ie:X.activeIndex;return{graphicalItem:Cr(Cr({},Q),{},{childIndex:oe}),payload:P_(Q,U)?X.data[ie]:Q.props.data[ie]}}}return null}},{key:"render",value:function(){var I=this;if(!x2e(this))return null;var R=this.props,F=R.children,U=R.className,L=R.width,z=R.height,Q=R.style,ne=R.compact,J=R.title,X=R.desc,re=H6e(R,Lnn),pe=vi(re,!1);if(ne)return Ae.createElement(y6e,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},Ae.createElement(cte,UC({},pe,{width:L,height:z,title:J,desc:X}),this.renderClipPath(),b2e(F,this.renderMap)));if(this.props.accessibilityLayer){var Y,ie;pe.tabIndex=(Y=this.props.tabIndex)!==null&&Y!==void 0?Y:0,pe.role=(ie=this.props.role)!==null&&ie!==void 0?ie:"application",pe.onKeyDown=function(G){I.accessibilityManager.keyboardEvent(G)},pe.onFocus=function(){I.accessibilityManager.focus()}}var oe=this.parseEventsOfWrapper();return Ae.createElement(y6e,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},Ae.createElement("div",UC({className:sa("recharts-wrapper",U),style:Cr({position:"relative",cursor:"default",width:L,height:z},Q)},oe,{ref:function(V){I.container=V}}),Ae.createElement(cte,UC({},pe,{width:L,height:z,title:J,desc:X,style:ern}),this.renderClipPath(),b2e(F,this.renderMap)),this.renderLegend(),this.renderTooltip()))}}])}(m.Component);ei(v,"displayName",n),ei(v,"defaultProps",Cr({layout:"horizontal",stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:{top:5,right:5,bottom:5,left:5},reverseStackOrder:!1,syncMethod:"index"},f)),ei(v,"getDerivedStateFromProps",function(C,N){var P=C.dataKey,I=C.data,R=C.children,F=C.width,U=C.height,L=C.layout,z=C.stackOffset,Q=C.margin,ne=N.dataStartIndex,J=N.dataEndIndex;if(N.updateId===void 0){var X=q6e(C);return Cr(Cr(Cr({},X),{},{updateId:0},g(Cr(Cr({props:C},X),{},{updateId:0}),N)),{},{prevDataKey:P,prevData:I,prevWidth:F,prevHeight:U,prevLayout:L,prevStackOffset:z,prevMargin:Q,prevChildren:R})}if(P!==N.prevDataKey||I!==N.prevData||F!==N.prevWidth||U!==N.prevHeight||L!==N.prevLayout||z!==N.prevStackOffset||!h4(Q,N.prevMargin)){var re=q6e(C),pe={chartX:N.chartX,chartY:N.chartY,isTooltipActive:N.isTooltipActive},Y=Cr(Cr({},W6e(N,I,L)),{},{updateId:N.updateId+1}),ie=Cr(Cr(Cr({},re),pe),Y);return Cr(Cr(Cr({},ie),g(Cr({props:C},ie),N)),{},{prevDataKey:P,prevData:I,prevWidth:F,prevHeight:U,prevLayout:L,prevStackOffset:z,prevMargin:Q,prevChildren:R})}if(!ote(R,N.prevChildren)){var oe,G,V,ee,ae=Mf(R,FN),fe=ae&&(oe=(G=ae.props)===null||G===void 0?void 0:G.startIndex)!==null&&oe!==void 0?oe:ne,Ne=ae&&(V=(ee=ae.props)===null||ee===void 0?void 0:ee.endIndex)!==null&&V!==void 0?V:J,he=fe!==ne||Ne!==J,ge=!wi(I),ye=ge&&!he?N.updateId:N.updateId+1;return Cr(Cr({updateId:ye},g(Cr(Cr({props:C},N),{},{updateId:ye,dataStartIndex:fe,dataEndIndex:Ne}),N)),{},{prevChildren:R,dataStartIndex:fe,dataEndIndex:Ne})}return null}),ei(v,"renderActiveDot",function(C,N,P){var I;return m.isValidElement(C)?I=m.cloneElement(C,N):Ai(C)?I=C(N):I=Ae.createElement(J$,N),Ae.createElement(Sa,{className:"recharts-active-dot",key:P},I)});var w=m.forwardRef(function(N,P){return Ae.createElement(v,UC({},N,{ref:P}))});return w.displayName=v.displayName,w},urn=jUe({chartName:"LineChart",GraphicalChild:T0,axisComponents:[{axisType:"xAxis",AxisComp:r8},{axisType:"yAxis",AxisComp:s8}],formatAxisMap:M$e}),drn=jUe({chartName:"ComposedChart",GraphicalChild:[T0,E5,t8,lU],axisComponents:[{axisType:"xAxis",AxisComp:r8},{axisType:"yAxis",AxisComp:s8},{axisType:"zAxis",AxisComp:oU}],formatAxisMap:M$e});const frn=({wallet:e})=>{const[t,n]=m.useState([]),[r]=m.useState("allTime"),[s]=m.useState("pnlHistory"),[a,o]=m.useState(!1),l=m.useRef(null),c=e||"";return m.useEffect(()=>{let u=new AbortController;const d=async()=>{var x,g,v;const f=`perp${r.charAt(0).toUpperCase()+r.slice(1)}`;o(!0);try{const P=(((g=(x=(await fs.post("https://api-ui.hyperliquid.xyz/info",{type:"portfolio",user:c},{headers:{Accept:"*/*","Content-Type":"application/json"},signal:u.signal})).data.find(I=>I[0]===f))==null?void 0:x[1])==null?void 0:g[s])||[]).map(([I,R])=>({time:new Date(I).getTime(),value:parseFloat(R)}));n(P)}catch(w){((v=w.response)==null?void 0:v.status)===429?(console.warn("Error 429..."),l.current=setTimeout(d,15e3)):w.name!=="CanceledError"&&(console.error("Error fetching chart data:",w),l.current=setTimeout(d,15e3))}finally{o(!1)}};return d(),()=>{u.abort(),l.current&&clearTimeout(l.current)}},[r,s,c]),i.jsx("div",{className:"bg-transparent rounded-2xl w-full",style:{minHeight:"40px"},children:a?i.jsx("div",{className:"w-full h-full flex justify-center items-center",children:i.jsx(XNe,{className:"w-5 h-5 -mb-[41px]"})}):t.length===0?i.jsx("div",{className:"w-full h-full flex justify-center items-center",children:i.jsx("span",{className:"text-gray-600 text-xs -mb-[41px]",children:"No chart data"})}):i.jsx(cBe,{width:"100%",height:40,children:i.jsxs(urn,{data:t,children:[i.jsx(r8,{dataKey:"time",hide:!0}),i.jsx(s8,{hide:!0}),i.jsx(Yp,{cursor:{stroke:"#555",strokeWidth:1},content:({active:u,payload:d})=>{if(u&&d&&d.length){const f=d[0].payload,x=new Date(f.time),g=x.toLocaleDateString("en-GB",{month:"short",day:"2-digit"}).toUpperCase(),v=x.toLocaleTimeString("en-GB",{hour:"2-digit",minute:"2-digit"});return i.jsxs("div",{style:{background:"#1B1B1B",padding:"6px 10px",borderRadius:"12px",fontSize:"12px",color:"#fff",border:"1px solid #353535"},children:[i.jsxs("div",{className:"text-[12px] font-medium text-[#909090]",children:[g," ",v]}),i.jsxs("div",{className:"text-[14px] font-semibold flex items-center",children:[i.jsx("span",{className:"inline-block w-[8px] h-[8px] bg-[#67FFBD] rounded-full mr-1"}),i.jsx("span",{className:"text-[#67FFBD] mr-2",children:"PnL"}),i.jsxs("span",{children:["$",Er(f.value)]})]})]})}return null},wrapperStyle:{marginLeft:"-40px",marginTop:"-50px"}}),i.jsx(T0,{type:"monotone",dataKey:"value",stroke:"#67FFBD",strokeWidth:2,dot:!1,isAnimationActive:!1})]})})})},hrn="https://dextradata.nftinit.io/api/hyper/analytics/wallet_backtest_summary/?format=json&limit=48&offset=0&order_by=three_month_pnl&order_dir=desc",prn=({handleAddedTime:e})=>{const{trackedWatchList:t,copyTradeWatchList:n,setSignModalOpen:r}=m.useContext(Qr),{address:s}=ns(),[a,o]=m.useState([]),[l,c]=m.useState(!0),[u,d]=m.useState(null),[f,x]=m.useState(1),g=typeof window<"u"&&window.innerWidth>640?4:2,[v,w]=m.useState(!1),[C,N]=m.useState(null),[P,I]=m.useState(null),[R,F]=m.useState("");m.useEffect(()=>{(async()=>{try{c(!0),d(null);const J=await fetch(hrn);if(!J.ok)throw new Error(`HTTP error! status: ${J.status}`);const X=await J.json();o((X==null?void 0:X.data)||[])}catch{d("Failed to fetch wallets.")}finally{c(!1)}})()},[]);const U=async({walletAddress:ne,isFollow:J,isScalper:X})=>{try{F(ne);const re=window.localStorage.getItem("hyperToken"),pe=window.localStorage.getItem("hyperAddress");if(!re){r(!0);return}const Y=J?"https://dextrabothypev2.nftinit.io/api/test_app/following/info/":"https://dextrabothypev2.nftinit.io/api/hyper/following/get_setting/",ie=J?{address:s?s.toLowerCase():pe,token:re,follow_address:ne.toLowerCase()}:{address:s?s.toLowerCase():pe,token:re},oe=await fetch(Y,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(ie)});if(!oe.ok)throw new Error(`Server responded with status ${oe.status}`);const G=await oe.json();G.success?(N(Array.isArray(G==null?void 0:G.data)?[...G.data].sort((V,ee)=>new Date(ee.created_at||0)-new Date(V.created_at||0)):G==null?void 0:G.data),I(X),w(!0)):rn.error(G.error_message)}catch(re){rn.error(re.message||"Something went wrong!")}},L=Math.ceil(a.length/g),z=(f-1)*g,Q=a.slice(z,z+g);return i.jsxs(i.Fragment,{children:[i.jsx(w5,{open:v,setOpen:w,copyTradeData:C,copyTradeWallet:R,setCopyTradeWallet:F,isScalper:P,setCopyTradeData:N}),i.jsx("div",{className:"grid grid-cols-2 gap-4 w-full",children:l?i.jsx("div",{className:"flex justify-center items-center w-full h-[300px] col-span-2",children:i.jsx(Da,{})}):i.jsxs(i.Fragment,{children:[Q==null?void 0:Q.map((ne,J)=>{var pe,Y,ie,oe,G,V,ee,ae,fe;const X=t==null?void 0:t.some(Ne=>Ne.wallet_address===(ne==null?void 0:ne.user_token)),re=n==null?void 0:n.some(Ne=>Ne.wallet_address===(ne==null?void 0:ne.user_token));return i.jsx(im.div,{initial:{opacity:0,y:16,scale:.98},animate:{opacity:1,y:0,scale:1},transition:{duration:.5,delay:J*.06,ease:[.22,1,.36,1]},whileHover:{y:-4,scale:1.01},whileTap:{scale:.99},className:"col-span-2 md:col-span-1 w-full relative rounded-[18px] p-[1px] bg-gradient-to-br from-[#67ffbd33] via-[#67ffbd66] to-[#67ffbd99]",children:i.jsxs("div",{className:"flex flex-col items-start justify-start gap-4 w-full min-h-max sm:min-h-[220px] rounded-[18px] border border-[#2a2a2a] p-4 bg-[#0a0a0a]",children:[i.jsxs("div",{className:"flex justify-start items-center gap-1.5 sm:gap-2 w-full",children:[i.jsx("img",{src:Gi,alt:"",className:"w-7 h-7 sm:w-8 sm:h-8 rounded-md"}),i.jsx("div",{onClick:()=>{window.open(`/wallet-details/${ne==null?void 0:ne.user_token}`,"_blank"),e()},className:"text-white text-[12px] sm:text-base font-semibold font-manrope leading-none tracking-wide cursor-pointer",children:(ne==null?void 0:ne.user_token)&&(ne==null?void 0:ne.user_token.slice(0,6))+"..."+(ne==null?void 0:ne.user_token.slice(-4))}),i.jsx(v5,{walletAddress:ne==null?void 0:ne.user_token,children:i.jsx("div",{className:"w-[18px] h-[18px] justify-center items-center flex cursor-pointer",children:X?i.jsx("img",{src:o5,alt:"",className:"w-3.5 h-3.5 min-w-3.5 min-h-3.5"}):i.jsx("img",{src:NA,alt:"",className:"w-3.5 h-3.5 min-w-3.5 min-h-3.5"})})}),i.jsx(frn,{wallet:ne==null?void 0:ne.user_token})]}),i.jsxs("div",{className:"flex flex-col items-start gap-4 w-full",children:[i.jsxs("div",{className:"flex flex-col items-start justify-start sm:flex-row sm:justify-between sm:items-center gap-2 md:gap-6 lg:gap-10 min-w-full h-[120px] sm:h-auto overflow-y-auto sm:overflow-hidden pr-2 sm:pr-0",children:[i.jsx(OY,{title:"PNL",data:[{label:"7D:",value:(pe=ne==null?void 0:ne.source_data)==null?void 0:pe.portfolio_perp_week_pnl,format:Fs},{label:"30D:",value:(Y=ne==null?void 0:ne.source_data)==null?void 0:Y.portfolio_perp_month_pnl,format:Fs},{label:"90D:",value:(ie=ne==null?void 0:ne.source_data)==null?void 0:ie.portfolio_perp_3month_pnl,format:Fs}]}),i.jsx(OY,{title:"Growth Rate",data:[{label:"7D:",value:(oe=ne==null?void 0:ne.source_data)==null?void 0:oe.portfolio_perp_week_growth_rate},{label:"30D:",value:(G=ne==null?void 0:ne.source_data)==null?void 0:G.portfolio_perp_month_growth_rate},{label:"90D:",value:(V=ne==null?void 0:ne.source_data)==null?void 0:V.portfolio_perp_3month_growth_rate}]}),i.jsx(OY,{title:"Drawdown",data:[{label:"7D:",value:(ee=ne==null?void 0:ne.source_data)==null?void 0:ee.portfolio_perp_week_dd,format:Fs},{label:"30D:",value:(ae=ne==null?void 0:ne.source_data)==null?void 0:ae.portfolio_perp_month_dd,format:Fs},{label:"90D:",value:(fe=ne==null?void 0:ne.source_data)==null?void 0:fe.portfolio_perp_3month_dd,format:Fs}]})]}),i.jsxs(im.button,{onClick:Ne=>{Ne.preventDefault(),U({walletAddress:ne==null?void 0:ne.user_token,isFollow:re,isScalper:ne==null?void 0:ne.is_scalper})},whileHover:{scale:1.02},whileTap:{scale:.98},className:`relative overflow-hidden w-full h-9 rounded-xl px-4 inline-flex items-center justify-center font-semibold cursor-pointer ${re?"bg-[#67ffbd] text-[#161616]":"text-[#161616]"}`,children:[i.jsx("span",{className:"relative z-10",children:re?"Adjust Copy":"Copy Trade"}),!re&&i.jsxs(i.Fragment,{children:[i.jsx(im.span,{"aria-hidden":!0,className:"pointer-events-none absolute inset-0 rounded-xl",style:{background:"linear-gradient(90deg, #67FFCD 0%, #67FFBD 50%, #67FFFD 100%)",backgroundSize:"300% 100%"},initial:{backgroundPosition:"0% 50%",opacity:1},animate:{backgroundPosition:["0% 50%","100% 50%","0% 50%"]},transition:{duration:3.2,repeat:1/0,ease:"linear"}}),i.jsx(im.span,{"aria-hidden":!0,className:"pointer-events-none absolute -inset-1 rounded-xl blur-lg",style:{background:"radial-gradient(60% 60% at 50% 50%, rgba(117,53,254,0.55), transparent 60%)"},initial:{opacity:.6},animate:{opacity:[.55,.95,.55],scale:[1,1.03,1]},transition:{duration:1.6,repeat:1/0,ease:"easeInOut"}})]})]})]})]})},`${z+J}-${ne==null?void 0:ne.user_token}`)}),i.jsxs("div",{className:"flex justify-center items-center gap-4 w-full col-span-2",children:[i.jsx("button",{className:"px-3 py-1 rounded bg-[#333] text-white disabled:opacity-50 focus:outline-none focus:ring-0 border-none",onClick:()=>x(ne=>ne-1),disabled:f===1,children:"Prev"}),i.jsxs("span",{className:"text-white text-sm",children:["Page ",f," of ",L]}),i.jsx("button",{className:"px-3 py-1 rounded bg-[#333] text-white disabled:opacity-50 focus:outline-none focus:ring-0 border-none",onClick:()=>x(ne=>ne+1),disabled:f===L,children:"Next"})]})]})})]})},OY=({title:e,data:t})=>i.jsxs("div",{className:"flex flex-col justify-start items-start gap-4 w-full",children:[i.jsxs("div",{className:"flex flex-col items-start gap-2 w-full",children:[i.jsx("div",{className:"text-[#fff] text-xs font-normal font-manrope leading-[13px] tracking-wide min-w-max",children:e}),t.map((n,r)=>i.jsxs("div",{className:"flex justify-between sm:justify-start items-center gap-2 w-full",children:[i.jsx("span",{className:"flex justify-start items-center text-[#9b9b9b] text-xs font-medium min-w-[30px]",children:n.label}),i.jsxs("span",{className:`${n.value==null||isNaN(parseFloat(n.value))||n.value==0?"text-white":n.value>0?"text-[#1DE6A3]":"text-[#FF7173]"} text-sm font-semibold font-manrope leading-[13px] flex items-center justify-end gap-0.5 tracking-[0.28px]`,children:[e==="Growth Rate"||e==="Drawdown"?"":"$",n.format?n.format(Math.abs(n.value)):Fs(n.value),e==="Growth Rate"||e==="Drawdown"?"%":""]})]},r))]}),(e==="Growth Rate"||e==="PNL")&&i.jsx("div",{className:"h-px w-full min-w-full sm:hidden bg-[#404040]"})]}),mrn=({open:e,setOpen:t,sevenSelectShow:n})=>{const[r,s]=m.useState(!1),a=()=>{if(n)if(r){const l=Date.now()+6048e5;localStorage.setItem("dailyPicksBlockedUntil",l.toString())}else localStorage.setItem("dailyPicksDismissedAt",Date.now().toString());t(!1)},o=()=>{if(n)if(r){const l=Date.now()+6048e5;localStorage.setItem("dailyPicksBlockedUntil",l.toString())}else localStorage.setItem("dailyPicksDismissedAt",Date.now().toString())};return i.jsxs(Ea,{open:e,onClose:a,className:"relative z-50",children:[i.jsx(ja,{as:im.div,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 backdrop-blur-md",style:{background:"radial-gradient(120% 120% at 10% 10%, rgba(117,53,254,0.26), transparent 60%), radial-gradient(120% 120% at 90% 10%, rgba(103,255,189,0.20), transparent 60%), rgba(0,0,0,0.55)"}}),i.jsx("div",{className:"fixed inset-0 z-50 w-screen overflow-y-auto",children:i.jsx("div",{className:"flex min-h-full items-center justify-center p-4 text-center sm:p-0",children:i.jsx(xa,{as:im.div,initial:{opacity:0,y:22,scale:.985},animate:{opacity:1,y:0,scale:1},transition:{type:"spring",bounce:.22,duration:.5},className:"relative transform overflow-hidden rounded-3xl w-full xl:w-[70%] 2xl:w-[60%] p-[1px] bg-gradient-to-br from-black/90 via-black/70 to-black/50",children:i.jsxs("div",{className:"relative flex flex-col justify-start items-center gap-6 w-full min-h-[420px] p-4 sm:p-8 rounded-3xl",children:[i.jsxs("div",{className:"absolute inset-0 -z-10 overflow-hidden rounded-3xl",children:[i.jsx(im.div,{className:"absolute -inset-28 opacity-60",style:{background:"radial-gradient(60% 60% at 20% 20%, rgba(103,255,189,0.18) 0%, transparent 60%), radial-gradient(60% 60% at 80% 30%, rgba(117,53,254,0.18) 0%, transparent 60%), radial-gradient(70% 70% at 50% 90%, rgba(255,121,124,0.18) 0%, transparent 60%)"},animate:{rotate:[0,360]},transition:{duration:60,repeat:1/0,ease:"linear"}}),i.jsx("div",{className:"absolute inset-0 bg-[radial-gradient(ellipse_at_top,rgba(255,255,255,0.06),transparent_60%)]"}),i.jsx("div",{className:"absolute inset-0 bg-[linear-gradient(rgba(255,255,255,0.06)_1px,transparent_1px),linear-gradient(90deg,rgba(255,255,255,0.06)_1px,transparent_1px)] bg-[size:18px_18px] opacity-10"})]}),i.jsx("button",{onClick:a,className:"cursor-pointer flex w-9 h-9 absolute right-3 top-3 rounded-full p-1 justify-center items-center hover:bg-[#7535FE]/70",children:i.jsx("img",{className:"p-1",src:Ba,alt:"close"})}),i.jsx("div",{className:"flex justify-start items-center w-full",children:i.jsxs("div",{className:"flex flex-col items-start w-full gap-3 sm:gap-5",children:[i.jsx("div",{className:"text-white font-manrope text-[20px] sm:text-[22px] font-extrabold leading-none -ml-[3px] tracking-[-0.2px]",children:"🔥 Daily Picks"}),i.jsx("div",{className:"text-[13px] sm:text-[14px] text-start text-white/90 font-manrope font-semibold leading-[18px] max-w-[70ch]",children:"Our algorithm highlights traders with proven skills, strong profits, and low drawdowns — ready for you to copy."})]})}),i.jsx("div",{className:"flex justify-start items-center w-full",children:i.jsx(prn,{handleAddedTime:o})}),n&&i.jsxs("div",{className:"flex justify-start items-center gap-2 w-full",children:[i.jsx("input",{type:"checkbox",checked:r,onChange:l=>s(l.target.checked),className:"w-4 h-4 accent-[#7535FE]"}),i.jsx("label",{className:"text-[12px] sm:text-[13px] text-white/90 font-manrope font-semibold leading-[16px]",children:"Don’t show this popup again for the next 7 days"})]})]})})})})]})},xrn=()=>{const[e,t]=m.useState(!1);return i.jsxs(i.Fragment,{children:[i.jsx(mrn,{open:e,setOpen:t,sevenSelectShow:!1}),i.jsxs("div",{onClick:()=>t(!0),className:"flex justify-start items-center gap-1.5 rounded-2xl text-white bg-transparent px-2 py-0.5 cursor-pointer w-max",children:[i.jsxs("svg",{className:"bn-svg !text-[16px] w-3.5 h-3.5 -mt-[1.5px]",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("path",{d:"M3.3 20.7h17.4V6.3H3.3v14.4zm19.2.3l-.008.153a1.5 1.5 0 01-1.339 1.34L21 22.5H3l-.153-.008a1.5 1.5 0 01-1.34-1.339L1.5 21V6a1.5 1.5 0 011.347-1.492L3 4.5h18l.153.008A1.5 1.5 0 0122.5 6v15z",fill:"currentColor"}),i.jsx("path",{d:"M6.1 5V2.5a.9.9 0 011.8 0V5a.9.9 0 01-1.8 0zM16.1 5V2.5a.9.9 0 011.8 0V5a.9.9 0 01-1.8 0zM21 9.1l.092.004a.9.9 0 010 1.792L21 10.9H2.5a.9.9 0 010-1.8H21zM11.1 12.5v4.517l-1.507-1.32a.9.9 0 00-1.186 1.356l3 2.625.066.052a.9.9 0 001.12-.052l3-2.625.066-.065a.9.9 0 00-1.18-1.347l-.072.056-1.507 1.32V12.5a.9.9 0 00-1.8 0z",fill:"currentColor"})]}),i.jsx("span",{className:"text-white text-[11px] font-semibold font-manrope",children:"Daily Picks"})]})]})};function grn(){return i.jsx("div",{className:"fixed bottom-0 left-0 right-0 z-[60] h-[30px] bg-[#0B0B0B]/70 backdrop-blur",children:i.jsxs("div",{className:"flex justify-between items-center h-full w-full gap-2 sm:gap-4 pl-2 sm:pl-4 pr-5",children:[i.jsx("div",{className:"flex justify-start items-center",children:i.jsx(xrn,{})}),i.jsxs("div",{className:"h-full w-full flex items-center justify-end gap-2",children:[i.jsx(OLt,{}),i.jsx(MLt,{}),i.jsx(RLt,{}),i.jsx(LLt,{})]})]})})}const brn=()=>{const e=oc();return i.jsxs("div",{className:"flex flex-col items-stretch justify-start w-screen h-[100dvh] overflow-hidden p-0 m-0 realtive",children:[(e.pathname==="/discover-wallets"||e.pathname==="/hyperliquid-whale-trades")&&i.jsx(FLt,{}),i.jsx("div",{className:"hidden sm:block",children:i.jsx(iLt,{})}),i.jsx("div",{className:"block sm:hidden",children:i.jsx(PLt,{})}),i.jsx("div",{style:{height:"calc(100vh - 4.875rem)"},className:"flex flex-col items-stretch justify-start flex-grow h-full w-[100vw] overflow-auto",children:i.jsx("main",{children:i.jsx(WKe,{})})}),i.jsx(grn,{})]})},aa=({info1:e,info2:t,padding:n,icon:r,info1_Color:s,info2_Color:a,rowTwo:o,info3:l})=>i.jsxs("div",{className:`${n||"pl-1 pr-2"} flex flex-col gap-2 font-manrope`,children:[i.jsxs("div",{className:`${s} ${o?"-mt-3.5":""} text-sm font-semibold font-manrope leading-[13px] flex items-center justify-end gap-0.5 tracking-[0.28px]`,children:[i.jsx("img",{src:r,alt:"",className:""}),l?i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"text-[#1DE6A3]",children:e})," /"," ",i.jsx("span",{className:"text-[#FF7173]",children:l})]}):e]}),t&&i.jsx("div",{className:`${a} text-xs font-normal not-italic font-inter flex items-center justify-end leading-3 min-w-max text-[#979797]`,children:t})]}),Xa=({className:e})=>i.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e,children:i.jsx("path",{d:"M11.9467 5.45312H7.79341H4.05341C3.41341 5.45312 3.09341 6.22646 3.54674 6.67979L7.00008 10.1331C7.55341 10.6865 8.45341 10.6865 9.00674 10.1331L10.3201 8.81979L12.4601 6.67979C12.9067 6.22646 12.5867 5.45312 11.9467 5.45312Z",fill:"currentColor"})}),uU=({sortKey:e,state:t,className:n})=>"-"+e===t?i.jsx(Xa,{className:"text-white hover:text-[#D8D3D3] group-hover:text-[#D8D3D3] rotate-180 "+n}):e===t?i.jsx(Xa,{className:"text-white hover:text-[#D8D3D3] group-hover:text-[#D8D3D3] "+n}):i.jsx(Xa,{className:"text-[#9B9B9B] hover:text-[#D8D3D3] group-hover:text-[#D8D3D3] "+n}),Yo=({title:e,sortKey:t,sortOption:n,setSortOption:r,isFilterIcon:s,isFilter:a})=>{const o=()=>{r(n===`-${t}`?t:`-${t}`)};return i.jsx(i.Fragment,{children:i.jsxs("div",{onClick:()=>o(),className:`${e==="Wallet"?"sm:sticky left-0 h-8":s?"justify-end":"justify-start"} flex items-center gap-1 min-w-max font-manrope cursor-pointer`,children:[i.jsx("div",{className:`${n===t||n===`-${t}`?"text-white":""} cursor-pointer flex items-center justify-end group`,children:e}),i.jsx(uU,{sortKey:t,state:n,className:""})]})})};function Ol(e){const[t,n]=m.useState(e.minFilterType||""),[r,s]=m.useState(e.maxFilterType||"");m.useEffect(()=>{n(e.minFilterType||"")},[e.minFilterType]),m.useEffect(()=>{s(e.maxFilterType||"")},[e.maxFilterType]);const a=()=>{e.handleChange({target:{name:e.minInputName,value:t}})},o=()=>{e.handleChange({target:{name:e.maxInputName,value:r}})},l=f=>f.preventDefault(),c=f=>f.target.addEventListener("wheel",l,{passive:!1}),u=f=>f.target.removeEventListener("wheel",l),d=f=>{["-","+","e"].includes(f.key)&&f.preventDefault()};return i.jsxs("div",{className:"col-span-1 flex flex-col justify-start max-w-full z-3 font-manrope gap-[13px]",children:[i.jsxs("p",{className:"text-[#c9c9c9] text-[13px] font-semibold font-manrope leading-[8px] flex justify-start items-center gap-1",children:[e.name,e.isTooltip&&i.jsxs("span",{className:"flex justify-start items-center has-tooltip relative",children:[i.jsx(Ni,{className:"text-[#c9c9c9] w-4 min-w-4 min-h-4 h-4"}),i.jsx("span",{children:i.jsx(Fa,{content:"Snapshot data per hour",positionTop:!1,alignRight:!0})})]})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("input",{value:t,onChange:f=>n(f.target.value),onBlur:a,onFocus:c,onBlurCapture:u,type:"number",name:e.minInputName,onKeyDown:["Win Count","Loss Count","Trades Count","Tx Count","Perp Equity","Margin %","Margin Used","Avg. Lvg.","Drawdown PnL"].includes(e.name)?d:void 0,placeholder:"Min",className:`py-0.5 bg-[#1b1b1b] rounded-md border border-[#303030] h-8 block text-white text-sm font-medium font-inter leading-[8px] w-1/2 px-2 ${t!==""?"border border-[#8d67ff]":""} focus:ring-1 focus:ring-[#8d67ff] focus:outline-none placeholder:text-[#535353] placeholder:text-sm placeholder:font-medium placeholder:font-inter placeholder:leading-[8px]`}),i.jsx("input",{value:r,onChange:f=>s(f.target.value),onBlur:o,onFocus:c,onBlurCapture:u,type:"number",name:e.maxInputName,onKeyDown:["Win Count","Loss Count","Trades Count","Tx Count","Perp Equity","Margin %","Margin Used","Avg. Lvg.","Drawdown PnL"].includes(e.name)?d:void 0,placeholder:"Max",className:`bg-[#1b1b1b] rounded-md border border-[#303030] py-0.5 h-8 block sm:text-sm font-semibold font-manrope leading-none w-1/2 px-2 ${r!==""?"border border-[#8d67ff]":""} focus:ring-1 focus:ring-[#8d67ff] focus:outline-none placeholder:text-[#535353] placeholder:text-sm placeholder:font-medium placeholder:font-inter placeholder:leading-[8px]`})]})]})}function K6e(e){m.useEffect(()=>{const s=e.minFilterType,a=e.maxFilterType;s&&e.setMinValue(t(s)),a&&e.setMaxValue(t(a))},[e.minInputName,e.maxInputName]);const t=s=>{const a=new Date(Number(s));if(isNaN(a.getTime()))return"";const o=a.getFullYear(),l=String(a.getMonth()+1).padStart(2,"0"),c=String(a.getDate()).padStart(2,"0");return String(a.getHours()).padStart(2,"0"),String(a.getMinutes()).padStart(2,"0"),`${o}-${l}-${c}`},n=s=>{const{name:a,value:o}=s.target;if(!o){e.setAdvancedFilters(c=>({...c,[a]:""})),a===e.minInputName?e.setMinValue(""):a===e.maxInputName&&e.setMaxValue("");return}const l=new Date(o).getTime();e.setAdvancedFilters(c=>({...c,[a]:l})),a===e.minInputName?e.setMinValue(o):a===e.maxInputName&&e.setMaxValue(o)},r=async()=>{const s={...e.advancedFilters,[e.minInputName]:"",[e.maxInputName]:""};e.setMinValue(""),e.setMaxValue(""),e.setAdvancedFilters(s)};return i.jsxs("div",{className:"col-span-1 flex flex-col justify-start gap-[7px] min-w-max xl:w-full z-3 font-manrope",children:[i.jsxs("div",{className:"flex justify-between items-center",children:[i.jsx("p",{className:"text-[#c9c9c9] text-[13px] font-semibold font-manrope leading-[8px]",children:e.name}),i.jsx("div",{onClick:()=>{r()},className:"h-5 px-2 py-1.5 rounded-md border border-[#353535] justify-start items-center gap-2 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-[#cdcdcd] text-[11px] font-semibold font-manrope leading-[8px] pointer-events-none",children:"Clear"})})]}),i.jsxs("div",{className:"flex flex-col gap-1",children:[i.jsx("input",{value:e.minValue||"",onChange:n,type:"date",name:e.minInputName,placeholder:"Min",className:`${e.minValue!==void 0&&e.minValue!==null&&e.minValue!==""?"border border-[#8d67ff] input-data-time-local-white-full":"input-data-time-local-dark-empty"} shadow-sm py-0.5 bg-[#1b1b1b] h-8 border border-[#303030] block sm:text-sm font-semibold font-manrope leading-none rounded-md w-full px-2 focus:ring-1 focus:ring-[#8d67ff] focus:outline-none placeholder:text-[#535353]`}),i.jsx("input",{value:e.maxValue||"",onChange:n,type:"date",name:e.maxInputName,placeholder:"Max",className:`${e.maxValue!==void 0&&e.maxValue!==null&&e.maxValue!==""?"border border-[#8d67ff] input-data-time-local-white-full":"input-data-time-local-dark-empty"} shadow-sm py-0.5 bg-[#1b1b1b] h-8 border border-[#303030] block sm:text-sm font-semibold font-manrope leading-none rounded-md w-full px-2 focus:ring-1 focus:ring-[#8d67ff] focus:outline-none placeholder:text-[#535353]`})]})]})}const yrn=({className:e})=>i.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e,children:i.jsx("path",{d:"M11.62 5.22084L7.81667 9.02417C7.3675 9.47334 6.6325 9.47334 6.18334 9.02417L2.38 5.22084",stroke:"#7C7C7C",strokeWidth:"1.5",strokeMiterlimit:"10",strokeLinecap:"round",strokeLinejoin:"round"})}),MY=({title:e,titleInfo:t,icon:n,children:r})=>{const[s,a]=m.useState(!1),o=()=>{a(!s)};return i.jsxs("div",{className:"overflow-hidden w-full border-t border-t-[#353535]",children:[i.jsxs("div",{className:"w-full flex items-center justify-between pt-3 cursor-pointer",onClick:o,children:[i.jsxs("div",{className:"flex items-center",children:[n&&i.jsx("span",{className:"w-[18px] h-[18px] mr-[8px]",children:n}),i.jsx("span",{className:"text-white font-manrope text-[13px] font-semibold leading-[8px]",children:e}),i.jsx("span",{className:`${t>0?"bg-[#67ffbd]/40 text-[#7bf4bf] shadow-2xl shadow-green-500 text-[10px] font-bold flex justify-center items-center rounded-md px-1.5 py-1 tracking-wide ml-1":"text-white text-[13px] font-semibold"} font-['Manrope'] leading-[8px] `,children:t>0?t:"(0)"})]}),i.jsx("span",{className:`transform transition-transform duration-300 ${s?"rotate-180":"rotate-0"}`,children:i.jsx(yrn,{})})]}),i.jsx("div",{className:`flex flex-col transition-[opacity,padding] duration-300 ease-in-out ${s?"opacity-100 pt-4 pb-4 space-y-4 m-1":"opacity-0 h-0 p-0"}`,children:s&&r})]})},vrn=({className:e})=>i.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e,children:[i.jsx("path",{d:"M11.1375 2.96251V5.81251H10.0125V2.96251C10.0125 2.76001 9.8325 2.66251 9.7125 2.66251C9.675 2.66251 9.6375 2.67001 9.6 2.68501L3.6525 4.92751C3.255 5.07751 3 5.45251 3 5.88001V6.38251C2.3175 6.89251 1.875 7.71001 1.875 8.63251V5.88001C1.875 4.98751 2.4225 4.19251 3.255 3.87751L9.21 1.62751C9.375 1.56751 9.5475 1.53751 9.7125 1.53751C10.4625 1.53751 11.1375 2.14501 11.1375 2.96251Z",fill:"currentColor"}),i.jsx("path",{d:"M16.125 10.875V11.625C16.125 11.8275 15.9675 11.9925 15.7575 12H14.6625C14.265 12 13.905 11.7075 13.875 11.3175C13.8525 11.085 13.9425 10.8675 14.0925 10.7175C14.2275 10.575 14.415 10.5 14.6175 10.5H15.75C15.9675 10.5075 16.125 10.6725 16.125 10.875Z",fill:"currentColor"}),i.jsx("path",{d:"M14.61 9.7125H15.375C15.7875 9.7125 16.125 9.375 16.125 8.9625V8.6325C16.125 7.08 14.8575 5.8125 13.305 5.8125H4.695C4.0575 5.8125 3.4725 6.0225 3 6.3825C2.3175 6.8925 1.875 7.71 1.875 8.6325V13.68C1.875 15.2325 3.1425 16.5 4.695 16.5H13.305C14.8575 16.5 16.125 15.2325 16.125 13.68V13.5375C16.125 13.125 15.7875 12.7875 15.375 12.7875H14.7225C14.0025 12.7875 13.3125 12.345 13.125 11.6475C12.9675 11.0775 13.155 10.53 13.53 10.1625C13.8075 9.8775 14.19 9.7125 14.61 9.7125ZM10.5 9.5625H5.25C4.9425 9.5625 4.6875 9.3075 4.6875 9C4.6875 8.6925 4.9425 8.4375 5.25 8.4375H10.5C10.8075 8.4375 11.0625 8.6925 11.0625 9C11.0625 9.3075 10.8075 9.5625 10.5 9.5625Z",fill:"currentColor"})]}),wrn=({className:e})=>i.jsx("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e,children:i.jsx("path",{d:"M12.1425 1.5H5.8575C3.1275 1.5 1.5 3.1275 1.5 5.8575V12.135C1.5 14.8725 3.1275 16.5 5.8575 16.5H12.135C14.865 16.5 16.4925 14.8725 16.4925 12.1425V5.8575C16.5 3.1275 14.8725 1.5 12.1425 1.5ZM12.945 7.47L11.2125 9.705C10.995 9.9825 10.6875 10.1625 10.335 10.2C9.9825 10.245 9.6375 10.1475 9.36 9.93L7.9875 8.85C7.935 8.805 7.875 8.805 7.845 8.8125C7.815 8.8125 7.7625 8.8275 7.7175 8.8875L5.9325 11.205C5.82 11.3475 5.655 11.4225 5.49 11.4225C5.37 11.4225 5.25 11.385 5.145 11.3025C4.8975 11.115 4.8525 10.7625 5.04 10.515L6.825 8.1975C7.0425 7.92 7.35 7.74 7.7025 7.695C8.0475 7.65 8.4 7.7475 8.6775 7.965L10.05 9.045C10.1025 9.09 10.155 9.09 10.1925 9.0825C10.2225 9.0825 10.275 9.0675 10.32 9.0075L12.0525 6.7725C12.24 6.525 12.6 6.48 12.84 6.675C13.0875 6.8775 13.1325 7.23 12.945 7.47Z",fill:"white"})}),Crn=({className:e})=>i.jsx("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e,children:i.jsx("path",{d:"M12.1425 1.5H5.8575C3.1275 1.5 1.5 3.1275 1.5 5.8575V12.135C1.5 14.8725 3.1275 16.5 5.8575 16.5H12.135C14.865 16.5 16.4925 14.8725 16.4925 12.1425V5.8575C16.5 3.1275 14.8725 1.5 12.1425 1.5ZM7.5975 10.875C7.815 11.0925 7.815 11.4525 7.5975 11.67C7.485 11.7825 7.3425 11.835 7.2 11.835C7.0575 11.835 6.915 11.7825 6.8025 11.67L4.935 9.8025C4.4925 9.36 4.4925 8.6475 4.935 8.205L6.8025 6.3375C7.02 6.12 7.38 6.12 7.5975 6.3375C7.815 6.555 7.815 6.915 7.5975 7.1325L5.73 9L7.5975 10.875ZM13.065 9.795L11.1975 11.6625C11.085 11.775 10.9425 11.8275 10.8 11.8275C10.6575 11.8275 10.515 11.775 10.4025 11.6625C10.185 11.445 10.185 11.085 10.4025 10.8675L12.27 9L10.4025 7.125C10.185 6.9075 10.185 6.5475 10.4025 6.33C10.62 6.1125 10.98 6.1125 11.1975 6.33L13.065 8.1975C13.5075 8.64 13.5075 9.36 13.065 9.795Z",fill:"white"})});oBe();function Srn(e){var Q,ne,J,X,re,pe,Y,ie,oe,G;const[t,n]=m.useState(!1),r=m.useRef(null),[s,a]=m.useState(!1),o=m.useRef(null);m.useEffect(()=>{var ee;const V=(ee=e.advancedFilters)==null?void 0:ee.coin;if(e.dataCoin.length>0){const fe=V.split(",").map(Ne=>e.dataCoin.find(he=>he.value===Ne)).filter(Boolean);e.setSelectedCoins(fe)}},[e.dataCoin]),m.useEffect(()=>{var ee;const V=(ee=e.advancedFilters)==null?void 0:ee.refcode;if(V&&e.dataReferral.length>0){const fe=V.split(",").map(Ne=>e.dataReferral.find(he=>he.value===Ne)).filter(Boolean);e.setSelectedReferrals(fe)}},[e.dataReferral]);const l=V=>{if(!V)return;const ae=Array.isArray(V)?V:[V],fe=e.selectedCoins||[],Ne=[...fe,...ae.filter(ye=>!fe.some(ve=>ve.value===ye.value))],ge=Ne.map(ye=>ye.value).join(",");e.setSelectedCoins(Ne),e.setAdvancedFilters(ye=>({...ye,coin:ge}))},c=V=>{if(!V)return;const ae=Array.isArray(V)?V:[V],fe=e.selectedReferrals||[],Ne=[...fe,...ae.filter(ge=>!fe.some(ye=>ye.value===ge.value))],he=Ne.map(ge=>ge.value);he.join(","),e.setSelectedReferrals(Ne),e.setAdvancedFilters(ge=>({...ge,refcode:he}))},u=V=>{const{name:ee,value:ae}=V.target;e.setAdvancedFilters(fe=>({...fe,[ee]:ae}))},d={control:(V,{isFocused:ee})=>{var ae,fe,Ne,he,ge,ye,ve,je;return{...V,display:"flex",alignItems:"center",paddingLeft:"21px",backgroundColor:"#353535",minHeight:"32px",maxHeight:"32px",border:Array.isArray((ae=e.advancedFilters)==null?void 0:ae.coin)&&((fe=e.advancedFilters)==null?void 0:fe.coin.length)>0||typeof((Ne=e.advancedFilters)==null?void 0:Ne.coin)=="string"&&((he=e.advancedFilters)==null?void 0:he.coin.trim())!==""?"1px solid #8d67ff":"none",boxShadow:"none",borderRadius:"6px",":hover":{border:Array.isArray((ge=e.advancedFilters)==null?void 0:ge.coin)&&((ye=e.advancedFilters)==null?void 0:ye.coin.length)>0||typeof((ve=e.advancedFilters)==null?void 0:ve.coin)=="string"&&((je=e.advancedFilters)==null?void 0:je.coin.trim())!==""?"1px solid #8d67ff":"none"}}},menu:V=>({...V,backgroundColor:"#353535",maxWidth:"248px"}),menuList:V=>({...V,backgroundColor:"#353535",maxHeight:"180px",zIndex:50}),clearIndicator:V=>({...V,color:"#b3b3b3",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",width:"20px",height:"20px",minWidth:"20px",minHeight:"20px",padding:"0px",paddingRight:"5px",":hover":{color:"white"}}),dropdownIndicator:V=>({...V,color:"#b3b3b3",cursor:"pointer",alignItems:"center",justifyContent:"center",width:"25px",height:"25px",minWidth:"25px",minHeight:"25px",padding:"0px",paddingRight:"5px",paddingLeft:"5px",display:"none",":hover":{color:"white"}}),indicatorSeparator:()=>({display:"none"}),option:(V,{data:ee,isDisabled:ae,isFocused:fe,isSelected:Ne})=>{const he=xi(ee.color);return{...V,fontSize:"14px",fontWeight:"600",backgroundColor:ae?void 0:Ne?ee.color:fe?he.alpha(.1).css():void 0,color:"white",cursor:ae?"not-allowed":"pointer",":active":{...V[":active"],backgroundColor:ae?void 0:Ne?ee.color:he.alpha(.9).css()}}},multiValue:(V,{data:ee})=>{const ae=xi(ee.color);return{...V,backgroundColor:ae.alpha(.4).css()}},multiValueLabel:(V,{data:ee})=>({...V,color:"white"}),multiValueRemove:(V,{data:ee})=>({...V,color:"white",":hover":{backgroundColor:"rgba(255, 255, 255, 0.3)",color:"white"}}),input:V=>({...V,color:"white"}),valueContainer:V=>({...V,paddingTop:"0px",fontSize:"14px",fontWeight:"600"})},f={control:(V,{isFocused:ee})=>{var ae,fe,Ne,he,ge,ye,ve,je;return{...V,display:"flex",alignItems:"center",paddingLeft:"21px",backgroundColor:"#353535",minHeight:"32px",maxHeight:"32px",border:Array.isArray((ae=e.advancedFilters)==null?void 0:ae.refcode)&&((fe=e.advancedFilters)==null?void 0:fe.refcode.length)>0||typeof((Ne=e.advancedFilters)==null?void 0:Ne.refcode)=="string"&&((he=e.advancedFilters)==null?void 0:he.refcode.trim())!==""?"1px solid #8d67ff":"none",boxShadow:"none",borderRadius:"6px",":hover":{border:Array.isArray((ge=e.advancedFilters)==null?void 0:ge.refcode)&&((ye=e.advancedFilters)==null?void 0:ye.refcode.length)>0||typeof((ve=e.advancedFilters)==null?void 0:ve.refcode)=="string"&&((je=e.advancedFilters)==null?void 0:je.refcode.trim())!==""?"1px solid #8d67ff":"none"}}},menu:V=>({...V,backgroundColor:"#353535",maxWidth:"248px"}),menuList:V=>({...V,backgroundColor:"#353535",maxHeight:"180px",zIndex:4}),clearIndicator:V=>({...V,color:"#b3b3b3",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",width:"20px",height:"20px",minWidth:"20px",minHeight:"20px",padding:"0px",paddingRight:"5px",":hover":{color:"white"}}),dropdownIndicator:V=>({...V,color:"#b3b3b3",cursor:"pointer",alignItems:"center",justifyContent:"center",width:"25px",height:"25px",minWidth:"25px",minHeight:"25px",padding:"0px",paddingRight:"5px",paddingLeft:"5px",display:"none",":hover":{color:"white"}}),indicatorSeparator:()=>({display:"none"}),option:(V,{data:ee,isDisabled:ae,isFocused:fe,isSelected:Ne})=>{const he=xi(ee.color);return{...V,fontSize:"14px",fontWeight:"600",backgroundColor:ae?void 0:Ne?ee.color:fe?he.alpha(.1).css():void 0,color:"white",cursor:ae?"not-allowed":"pointer",":active":{...V[":active"],backgroundColor:ae?void 0:Ne?ee.color:he.alpha(.9).css()}}},multiValue:(V,{data:ee})=>{const ae=xi(ee.color);return{...V,backgroundColor:ae.alpha(.4).css()}},multiValueLabel:(V,{data:ee})=>({...V,color:"white"}),multiValueRemove:(V,{data:ee})=>({...V,color:"white",":hover":{backgroundColor:"rgba(255, 255, 255, 0.3)",color:"white"}}),input:V=>({...V,color:"white"}),valueContainer:V=>({...V,paddingTop:"0px",fontSize:"14px",fontWeight:"600"})},x=(V,ee)=>{var fe;const ae=(fe=ee.selectedCoins)==null?void 0:fe.filter(Ne=>Ne.value!==V.value);ee.setSelectedCoins(ae),ee.setAdvancedFilters(Ne=>({...Ne,coin:ae==null?void 0:ae.map(ge=>ge.value)}))},g=(V,ee)=>{var fe;const ae=(fe=ee.selectedReferrals)==null?void 0:fe.filter(Ne=>Ne.value!==V.value);ee.setSelectedReferrals(ae),ee.setAdvancedFilters(Ne=>({...Ne,refcode:ae==null?void 0:ae.map(ge=>ge.value)}))};m.useEffect(()=>{const V=ee=>{r.current&&!r.current.contains(ee.target)&&n(!1)};return document.addEventListener("mousedown",V),()=>{document.removeEventListener("mousedown",V)}},[]),m.useEffect(()=>{const V=ee=>{o.current&&!o.current.contains(ee.target)&&a(!1)};return document.addEventListener("mousedown",V),()=>{document.removeEventListener("mousedown",V)}},[]);const v=async()=>{e.setAdvancedFilters(V=>({...V,user_token:""}))},w=({src:V,alt:ee})=>{const[ae,fe]=Ae.useState(!1);return ae?i.jsx("div",{className:"rounded-full w-5 h-5 min-w-5 min-h-5 mr-1 bg-[#4F4F4F] flex items-center justify-center",children:i.jsx("span",{className:"text-white text-xs"})}):i.jsx("img",{src:V,alt:ee,className:"rounded-full w-5 h-5 min-w-5 min-h-5 mr-1",loading:"lazy",onError:()=>fe(!0)})},C=V=>{const{data:ee,innerRef:ae,innerProps:fe,selectProps:Ne}=V,he=Ne.styles.option({},V);return i.jsxs("div",{ref:ae,...fe,style:he,className:"flex items-center p-2",children:[i.jsx(w,{src:ee.icon,alt:ee.label}),ee.label]})},N=(V,ee)=>ee.reduce((ae,fe)=>{const Ne=V[fe];return Ne!==void 0&&Ne!==""&&Ne!==null&&ae++,ae},0),P=()=>{const V=e.advancedFilters.is_favorite_wallet?"":!0;e.setAdvancedFilters(ee=>({...ee,is_favorite_wallet:V}))},I=["min_pnl","max_pnl","min_win_complated_rate","max_win_complated_rate","min_complated_trades_count","max_complated_trades_count","min_complated_win_count","max_complated_win_count","min_complated_loss_count","max_complated_loss_count","min_long_kar","max_long_kar","min_short_kar","max_short_kar","min_long_win_rate","max_long_win_rate","min_short_win_rate","max_short_win_rate","min_rTx_count","max_rTx_count"],R=["min_pnl","max_pnl"],F=["min_uPnl","max_uPnl","max_sharpe","min_sharpe","max_growth_rate","min_growth_rate","max_perp_dd","min_perp_dd","max_perp_dd_pnl","min_perp_dd_pnl","min_perp_equity","max_perp_equity","min_margin_roi","max_margin_roi","min_margin_used_percentage","max_margin_used_percentage","min_margin_used","max_margin_used","min_avg_uLeverage_value","max_avg_uLeverage_value","min_funding","max_funding","min_rToken_count","max_rToken_count","min_uToken_count","max_uToken_count"],U=["min_uPnl","max_uPnl","max_perp_dd_pnl","min_perp_dd_pnl","min_perp_equity","max_perp_equity","min_margin_roi","max_margin_roi","min_margin_used_percentage","max_margin_used_percentage","min_margin_used","max_margin_used","min_avg_uLeverage_value","max_avg_uLeverage_value","min_funding","max_funding","min_uToken_count","max_uToken_count"],L=["min_uPnl","max_uPnl","max_perp_dd_pnl","min_perp_dd_pnl","min_perp_equity","max_perp_equity","min_margin_roi","max_margin_roi","min_margin_used_percentage","max_margin_used_percentage","min_margin_used","max_margin_used","min_avg_uLeverage_value","max_avg_uLeverage_value","min_funding","max_funding","min_rToken_count","max_rToken_count","min_uToken_count","max_uToken_count"],z=["min_first_time","max_first_time","min_end_time","max_end_time"];return i.jsxs("div",{className:"text-white flex flex-wrap justify-start sm:justify-center font-manrope gap-4 pt-2",children:[i.jsxs("div",{className:"col-span-1 flex flex-col justify-start gap-[7px] w-full z-3",children:[i.jsxs("div",{className:"flex justify-between items-center",children:[i.jsx("p",{className:"text-[#c9c9c9] text-[13px] font-semibold font-manrope leading-[8px]",children:"Search Wallet"}),i.jsx("div",{onClick:()=>{v()},className:"h-5 px-2 py-1.5 rounded-md border border-[#353535] justify-start items-center gap-2 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-[#cdcdcd] text-[11px] font-semibold font-manrope leading-[8px] pointer-events-none",children:"Clear"})})]}),i.jsxs("div",{className:"flex items-center relative",children:[i.jsx("input",{value:(Q=e.advancedFilters)==null?void 0:Q.user_token,onChange:u,type:"text",name:"user_token",placeholder:"Search Wallet",className:`${(ne=e.advancedFilters)!=null&&ne.user_token?"border border-[#8d67ff]":""} py-[4px] bg-[#353535] rounded-md block text-white text-sm font-medium font-inter leading-[8px] w-full sm:w-full pl-[30px] pr-2 focus:ring-1 focus:ring-[#8d67ff] focus:outline-none placeholder:text-[#7F7F7F] placeholder:font-inter placeholder:text-sm placeholder:font-medium placeholder:leading-[8px] h-[32px]`}),i.jsx(_y,{className:"text-[#646464] absolute left-1.5"})]})]}),e.period!=999&&i.jsxs("div",{className:"col-span-1 flex flex-col gap-[7px] justify-start w-full z-3",children:[i.jsxs("div",{className:"flex justify-between items-center",children:[i.jsx("div",{className:"text-[#c9c9c9] text-[13px] font-semibold font-manrope leading-[8px]",children:"Search Coin"}),i.jsx("div",{onClick:()=>{e.setSelectedCoins([]),e.setAdvancedFilters(V=>({...V,coin:[]}))},className:"h-5 px-2 py-1.5 rounded-md border border-[#353535] justify-start items-center gap-2 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-[#cdcdcd] text-[11px] font-semibold font-manrope leading-[8px] pointer-events-none",children:"Clear Coins"})})]}),i.jsx("div",{className:"float-left w-full",ref:r,children:i.jsxs("div",{className:"min-w-full relative",children:[i.jsx(_y,{className:"text-[#646464] absolute left-[6px] top-[7px] z-10"}),i.jsx(Cl,{closeMenuOnSelect:!1,value:[],isMulti:!0,options:e.dataCoin.filter(V=>Array.isArray(e.selectedCoins)&&!e.selectedCoins.some(ee=>ee.value===V.value)),components:{Option:C},styles:d,onChange:l,menuIsOpen:t,onMenuOpen:()=>n(!0),placeholder:e.isLoadingCoin?i.jsx("span",{className:"text-[#7e7e7e] text-sm font-medium font-inter leading-[8px]",children:"Loading..."}):i.jsx("span",{className:"text-[#7e7e7e] text-sm font-medium font-inter leading-[8px]",children:"Search Coin"}),noOptionsMessage:()=>e.isLoadingCoin?i.jsx("span",{className:"text-[#7e7e7e] text-sm font-medium font-inter leading-[8px]",children:"Loading..."}):i.jsx("span",{className:"text-[#7e7e7e] text-sm font-medium font-inter leading-[8px]",children:"No data available"})}),i.jsx("div",{className:`absolute top-[220px] z-[4] left-0 w-full max-w-[248px] bg-[#303030] flex flex-wrap gap-1 p-2 border border-[#3a3a3a] mt-1 ${t?"block":"hidden"} ${t&&((J=e.selectedCoins)==null?void 0:J.length)>0?"block":"hidden"}`,children:e.selectedCoins&&((X=e.selectedCoins)==null?void 0:X.map(V=>i.jsxs("div",{className:"h-6 pl-1 rounded-md border border-[#3a3a3a] justify-start items-center gap-0.5 flex",children:[i.jsx(w,{src:V==null?void 0:V.icon,alt:V==null?void 0:V.value}),i.jsx("div",{className:"text-[#cdcdcd] text-[11px] font-semibold font-manrope leading-[8px] py-1 min-w-max",children:V.label}),i.jsx("div",{onClick:ee=>{ee.stopPropagation(),x(V,e)},className:"cursor-pointer group w-full h-full flex justify-center items-center pr-1.5 py-1",children:i.jsx(nw,{className:"group-hover:text-[#cdcdcd] text-[#7C7C7C] w-[5.66px] h-[5.66px] min-w-[5.66px] min-h-[5.66px]"})})]},V.value)))}),i.jsx("div",{className:`${((re=e.selectedCoins)==null?void 0:re.length)>0?"mt-2.5":""} flex flex-wrap gap-1 max-w-[248px]`,children:e.selectedCoins&&((pe=e.selectedCoins)==null?void 0:pe.map(V=>i.jsxs("div",{className:"h-6 pl-1.5 rounded-md border border-[#3a3a3a] justify-start items-center gap-1.5 flex",children:[i.jsx(w,{src:V==null?void 0:V.icon,alt:V==null?void 0:V.value}),i.jsx("div",{className:"text-[#cdcdcd] text-[11px] font-semibold font-manrope leading-[8px] py-1 min-w-max",children:V.label}),i.jsx("div",{onClick:()=>x(V,e),className:"cursor-pointer group w-full h-full flex justify-center items-center pr-1.5 py-1",children:i.jsx(nw,{className:"group-hover:text-[#cdcdcd] text-[#7C7C7C] w-[5.66px] h-[5.66px] min-w-[5.66px] min-h-[5.66px]"})})]},V.value)))})]})})]}),i.jsxs("div",{className:"flex justify-between items-center gap-1 w-full h-8 bg-[#353535] rounded-xl px-2.5",children:[i.jsxs("div",{className:"flex justify-start items-center gap-1 w-max",children:[i.jsx("div",{style:{boxShadow:"0px 4px 24px 0px #FF600A, 0px 1px 1px 0px rgba(255, 255, 255, 0.32) inset"},className:"w-[18px] h-[18px] px-2 py-1.5 bg-gradient-to-b from-[#ff7200] to-[#ff2525] rounded-[5px] flex justify-center items-center",children:i.jsx("img",{src:ske,alt:"",className:"w-[9.67px] h-[12px] min-w-[9.67px] min-h-[12px]"})}),i.jsx("span",{className:"text-white text-[13px] font-semibold font-['Manrope'] leading-[8px] ml-1",children:"Show Popular Wallets"})]}),i.jsx("div",{onClick:P,style:{boxShadow:"0px 1px 1px 0px rgba(255, 255, 255, 0.32) inset"},className:`w-[17px] h-[17px] rounded-md flex items-center justify-center transition-all
${e.advancedFilters.is_favorite_wallet?"bg-[#3ec78c] border-[#3ec78c]":"bg-transparent border border-[#12d782]"}
cursor-pointer
`,children:e.advancedFilters.is_favorite_wallet&&i.jsx("svg",{className:"w-[12px] h-[12px] text-[#0c623d]",fill:"none",stroke:"currentColor",strokeWidth:"3",viewBox:"0 0 24 24",children:i.jsx("polyline",{points:"20 6 9 17 4 12"})})}),i.jsx("input",{type:"checkbox",checked:e.advancedFilters.is_favorite_wallet===!0,onChange:P,className:"hidden"})]}),i.jsxs("div",{className:"col-span-1 flex flex-col gap-[7px] justify-start w-full z-3 bg-[#353535] rounded-xl pt-3 pb-1 px-1",children:[i.jsxs("div",{className:"flex justify-start items-center gap-1",children:[i.jsx("div",{style:{boxShadow:"0px 4px 24px 0px #9137FF, 0px 1px 1px 0px rgba(255, 255, 255, 0.32) inset"},className:"flex justify-center items-center w-[18px] h-[18px] px-2 py-1.5 bg-[#8b2cff] rounded-[5px] ml-[5px]",children:i.jsx("img",{src:Syt,alt:"",className:"w-[16px] h-[16px] min-w-[16px] min-h-[16px]"})}),i.jsx("div",{className:"flex justify-start text-white text-[13px] font-semibold font-['Manrope'] leading-[8px] ml-[5px]",children:"Filter by Referrer"})]}),i.jsxs("div",{className:"flex flex-col gap-[7px] bg-[#1f1f1f] rounded-xl p-2.5",children:[i.jsxs("div",{className:"flex justify-between items-center",children:[i.jsx("div",{className:"flex justify-start items-center gap-1",children:i.jsx("div",{className:"text-[#c9c9c9] text-[13px] font-semibold font-['Manrope'] leading-[8px]",children:"Filter by Referrer"})}),i.jsx("div",{onClick:()=>{e.setSelectedReferrals([]),e.setAdvancedFilters(V=>({...V,refcode:[]}))},className:"h-5 px-2 py-1.5 rounded-md border border-[#353535] justify-start items-center gap-2 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-[#cdcdcd] text-[11px] font-semibold font-manrope leading-[8px] pointer-events-none",children:"Clear"})})]}),i.jsx("div",{className:"float-left w-full",ref:o,children:i.jsxs("div",{className:"min-w-full relative",children:[i.jsx(_y,{className:`${t?"-z-10":"z-10"} text-[#646464] absolute left-[6px] top-[7px]`}),i.jsx(Cl,{closeMenuOnSelect:!1,value:[],isMulti:!0,options:e.dataReferral.filter(V=>Array.isArray(e.selectedReferrals)&&!e.selectedReferrals.some(ee=>ee.value===V.value)),styles:f,onChange:c,menuIsOpen:s,onMenuOpen:()=>a(!0),placeholder:e.isLoadingReferral?i.jsx("span",{className:"text-[#7e7e7e] text-sm font-medium font-inter leading-[8px]",children:"Loading..."}):i.jsx("span",{className:"text-[#7e7e7e] text-sm font-medium font-inter leading-[8px]",children:"Search Referrer"}),noOptionsMessage:()=>e.isLoadingReferral?i.jsx("span",{className:"text-[#7e7e7e] text-sm font-medium font-inter leading-[8px]",children:"Loading..."}):i.jsx("span",{className:"text-[#7e7e7e] text-sm font-medium font-inter leading-[8px]",children:"No data available"})}),i.jsx("div",{className:`absolute top-[220px] z-[4] left-0 w-full max-w-[248px] bg-[#303030] flex flex-wrap gap-1 p-2 border border-[#3a3a3a] mt-1 ${s?"block":"hidden"} ${s&&((Y=e.selectedReferrals)==null?void 0:Y.length)>0?"block":"hidden"}`,children:e.selectedReferrals&&((ie=e.selectedReferrals)==null?void 0:ie.map(V=>i.jsxs("div",{className:"h-6 pl-1 rounded-md border border-[#3a3a3a] justify-start items-center gap-0.5 flex",children:[i.jsx("div",{className:"text-[#cdcdcd] text-[11px] font-semibold font-manrope leading-[8px] py-1 min-w-max",children:V.label}),i.jsx("div",{onClick:ee=>{ee.stopPropagation(),g(V,e)},className:"cursor-pointer group w-full h-full flex justify-center items-center pr-1.5 py-1",children:i.jsx(nw,{className:"group-hover:text-[#cdcdcd] text-[#7C7C7C] w-[5.66px] h-[5.66px] min-w-[5.66px] min-h-[5.66px]"})})]},V.value)))}),i.jsx("div",{className:`${((oe=e.selectedReferrals)==null?void 0:oe.length)>0?"mt-2.5":""} flex flex-wrap gap-1 max-w-[248px]`,children:e.selectedReferrals&&((G=e.selectedReferrals)==null?void 0:G.map(V=>i.jsxs("div",{className:"h-6 pl-1.5 rounded-md border border-[#3a3a3a] justify-start items-center gap-1.5 flex",children:[i.jsx("div",{className:"text-[#cdcdcd] text-[11px] font-semibold font-manrope leading-[8px] py-1 min-w-max",children:V.label}),i.jsx("div",{onClick:()=>g(V,e),className:"cursor-pointer group w-full h-full flex justify-center items-center pr-1.5 py-1",children:i.jsx(nw,{className:"group-hover:text-[#cdcdcd] text-[#7C7C7C] w-[5.66px] h-[5.66px] min-w-[5.66px] min-h-[5.66px]"})})]},V.value)))})]})})]})]}),i.jsxs(MY,{title:"Wallet Filters",titleInfo:N(e.advancedFilters,e.period!=999?I:R),icon:i.jsx(vrn,{className:"text-white"}),children:[i.jsx(Ol,{minFilterType:e.advancedFilters.min_pnl,maxFilterType:e.advancedFilters.max_pnl,handleChange:u,minInputName:"min_pnl",maxInputName:"max_pnl",name:"PnL",isTooltip:!1}),e.period!=999&&i.jsx(Ol,{minFilterType:e.advancedFilters.min_win_complated_rate,maxFilterType:e.advancedFilters.max_win_complated_rate,handleChange:u,minInputName:"min_win_complated_rate",maxInputName:"max_win_complated_rate",name:"Win Rate",isTooltip:!1}),e.period!=999&&i.jsx(Ol,{minFilterType:e.advancedFilters.min_complated_trades_count,maxFilterType:e.advancedFilters.max_complated_trades_count,handleChange:u,minInputName:"min_complated_trades_count",maxInputName:"max_complated_trades_count",name:"Trades Count",isTooltip:!1}),e.period!=999&&i.jsx(Ol,{minFilterType:e.advancedFilters.min_complated_win_count,maxFilterType:e.advancedFilters.max_complated_win_count,handleChange:u,minInputName:"min_complated_win_count",maxInputName:"max_complated_win_count",name:"Win Count",isTooltip:!1}),e.period!=999&&i.jsx(Ol,{minFilterType:e.advancedFilters.min_complated_loss_count,maxFilterType:e.advancedFilters.max_complated_loss_count,handleChange:u,minInputName:"min_complated_loss_count",maxInputName:"max_complated_loss_count",name:"Loss Count",isTooltip:!1}),e.period!=999&&i.jsx(Ol,{minFilterType:e.advancedFilters.min_long_kar,maxFilterType:e.advancedFilters.max_long_kar,handleChange:u,minInputName:"min_long_kar",maxInputName:"max_long_kar",name:"Long PnL",isTooltip:!1}),e.period!=999&&i.jsx(Ol,{minFilterType:e.advancedFilters.min_short_kar,maxFilterType:e.advancedFilters.max_short_kar,handleChange:u,minInputName:"min_short_kar",maxInputName:"max_short_kar",name:"Short PnL",isTooltip:!1}),e.period!=999&&i.jsx(Ol,{minFilterType:e.advancedFilters.min_rTx_count,maxFilterType:e.advancedFilters.max_rTx_count,handleChange:u,minInputName:"min_rTx_count",maxInputName:"max_rTx_count",name:"Tx Count",isTooltip:!1})]}),i.jsxs(MY,{title:"Performance Filters",titleInfo:N(e.advancedFilters,e.period==999?U:e.period==1?L:F),icon:i.jsx(wrn,{}),children:[i.jsx(Ol,{minFilterType:e.advancedFilters.min_uPnl,maxFilterType:e.advancedFilters.max_uPnl,handleChange:u,minInputName:"min_uPnl",maxInputName:"max_uPnl",name:"uPnL",isTooltip:!1}),e.period!=1&&e.period!=999&&i.jsx(Ol,{minFilterType:e.advancedFilters.min_growth_rate,maxFilterType:e.advancedFilters.max_growth_rate,handleChange:u,minInputName:"min_growth_rate",maxInputName:"max_growth_rate",name:"Growth Rate",isTooltip:!1}),e.period!=1&&e.period!=999&&i.jsx(Ol,{minFilterType:e.advancedFilters.min_perp_dd,maxFilterType:e.advancedFilters.max_perp_dd,handleChange:u,minInputName:"min_perp_dd",maxInputName:"max_perp_dd",name:"Drawdown",isTooltip:!1}),e.period!=1&&e.period!=999&&i.jsx(Ol,{minFilterType:e.advancedFilters.min_sharpe,maxFilterType:e.advancedFilters.max_sharpe,handleChange:u,minInputName:"min_sharpe",maxInputName:"max_sharpe",name:"Sharpe",isTooltip:!1}),i.jsx(Ol,{minFilterType:e.advancedFilters.min_perp_equity,maxFilterType:e.advancedFilters.max_perp_equity,handleChange:u,minInputName:"min_perp_equity",maxInputName:"max_perp_equity",name:"Perp Equity",isTooltip:!1}),i.jsx(Ol,{minFilterType:e.advancedFilters.min_margin_roi,maxFilterType:e.advancedFilters.max_margin_roi,handleChange:u,minInputName:"min_margin_roi",maxInputName:"max_margin_roi",name:"ROE",isTooltip:!1}),i.jsx(Ol,{minFilterType:e.advancedFilters.min_margin_used_percentage,maxFilterType:e.advancedFilters.max_margin_used_percentage,handleChange:u,minInputName:"min_margin_used_percentage",maxInputName:"max_margin_used_percentage",name:"Margin %",isTooltip:!1}),i.jsx(Ol,{minFilterType:e.advancedFilters.min_margin_used,maxFilterType:e.advancedFilters.max_margin_used,handleChange:u,minInputName:"min_margin_used",maxInputName:"max_margin_used",name:"Margin Used",isTooltip:!1}),i.jsx(Ol,{minFilterType:e.advancedFilters.min_avg_uLeverage_value,maxFilterType:e.advancedFilters.max_avg_uLeverage_value,handleChange:u,minInputName:"min_avg_uLeverage_value",maxInputName:"max_avg_uLeverage_value",name:"Avg. Lvg.",isTooltip:!1}),i.jsx(Ol,{minFilterType:e.advancedFilters.min_funding,maxFilterType:e.advancedFilters.max_funding,handleChange:u,minInputName:"min_funding",maxInputName:"max_funding",name:"Funding",isTooltip:!1}),e.period!=999&&i.jsx(Ol,{minFilterType:e.advancedFilters.min_rToken_count,maxFilterType:e.advancedFilters.max_rToken_count,handleChange:u,minInputName:"min_rToken_count",maxInputName:"max_rToken_count",name:"rToken",isTooltip:!1}),i.jsx(Ol,{minFilterType:e.advancedFilters.min_uToken_count,maxFilterType:e.advancedFilters.max_uToken_count,handleChange:u,minInputName:"min_uToken_count",maxInputName:"max_uToken_count",name:"uToken",isTooltip:!1})]}),e.period!=999&&i.jsxs(MY,{title:"Date Filters",titleInfo:N(e.advancedFilters,z),icon:i.jsx(Crn,{}),children:[i.jsx(K6e,{minFilterType:e.advancedFilters.min_first_time,maxFilterType:e.advancedFilters.max_first_time,advancedFilters:e.advancedFilters,setAdvancedFilters:e.setAdvancedFilters,minInputName:"min_first_time",maxInputName:"max_first_time",name:"First Tx Time",minValue:e.minFirstValue,maxValue:e.maxFirstValue,setMinValue:e.setMinFirstValue,setMaxValue:e.setMaxFirstValue,setFilters:e.setFilters}),i.jsx(K6e,{minFilterType:e.advancedFilters.min_end_time,maxFilterType:e.advancedFilters.max_end_time,advancedFilters:e.advancedFilters,setAdvancedFilters:e.setAdvancedFilters,minInputName:"min_end_time",maxInputName:"max_end_time",name:"Last Tx Time",minValue:e.minEndValue,maxValue:e.maxEndValue,setMinValue:e.setMinEndValue,setMaxValue:e.setMaxEndValue,setFilters:e.setFilters})]})]})}const Nrn=({period:e,advancedFilters:t,setAdvancedFilters:n,resetFilters:r,setFilters:s,minFirstValue:a,setMinFirstValue:o,maxFirstValue:l,setMaxFirstValue:c,minEndValue:u,setMinEndValue:d,maxEndValue:f,setMaxEndValue:x,dataCoin:g,selectedCoins:v,setSelectedCoins:w,isLoadingCoin:C,setIsLoadingCoin:N,dataReferral:P,selectedReferrals:I,setSelectedReferrals:R,isLoadingReferral:F,setIsLoadingReferral:U})=>{const[L,z]=m.useState(!1);return m.useEffect(()=>{localStorage.getItem("fire_ref_modal_seen")||z(!0)},[]),i.jsx(i.Fragment,{children:i.jsxs("div",{className:"bg-[#232323] rounded-2xl min-h-[340px] sm:max-h-full lg:min-h-[66vh] order-last lg:order-none lg:w-min min-w-[286px] lg:max-w-[286px] p-1 py-3 font-manrope overflow-hidden relative h-[calc(100vh-150px)] sm:h-[calc(100vh-125px)]",children:[i.jsxs("div",{className:"w-full flex justify-between items-center pt-[2px] pl-3 pr-1 pb-[10px]",children:[i.jsx("div",{className:"text-white text-base font-semibold font-manrope leading-[8px]",children:"Filters"}),i.jsx("div",{className:"flex sm:hidden justify-center",children:i.jsx("div",{onClick:()=>s(),className:"w-[134px] h-6 px-6 py-3 bg-[#7445ff] rounded-[10px] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-[#8860ff] justify-center items-center gap-2.5 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px] pointer-events-none",children:"Search"})})}),i.jsx("div",{onClick:()=>{r()},className:"h-5 px-2 py-1.5 bg-[#3d3d3d] rounded-md justify-start items-center gap-2 inline-flex mr-3 cursor-pointer",children:i.jsx("div",{className:"text-[#cdcdcd] text-[11px] font-semibold font-manrope leading-[8px] pointer-events-none",children:"Clear All"})})]}),i.jsx("div",{className:"h-full w-full overflow-y-scroll font-manrope py-1 px-3",children:i.jsx("div",{className:"font-manrope font-normal pb-[120px] sm:pb-[80px] max-w-full lg:max-w-[256px]",children:i.jsx(Srn,{period:e,resetFilters:r,setFilters:s,advancedFilters:t,setAdvancedFilters:n,minFirstValue:a,setMinFirstValue:o,maxFirstValue:l,setMaxFirstValue:c,minEndValue:u,setMinEndValue:d,maxEndValue:f,setMaxEndValue:x,dataCoin:g,selectedCoins:v,setSelectedCoins:w,isLoadingCoin:C,setIsLoadingCoin:N,dataReferral:P,selectedReferrals:I,setSelectedReferrals:R,isLoadingReferral:F,setIsLoadingReferral:U})})}),i.jsx("div",{className:"hidden sm:block absolute bottom-0 w-full",children:i.jsx("div",{className:"sticky h-12 bg-[#1b1b1b]/30 rounded-bl-2xl rounded-br-2xl border-t border-[#353535] backdrop-blur-[32px] min-h-14 pt-[11px] w-full z-10",children:i.jsx("div",{className:"flex justify-center -ml-3",children:i.jsx("div",{onClick:()=>s(),className:"w-[234px] h-8 px-6 py-3 bg-[#7445ff] rounded-[10px] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-[#8860ff] justify-center items-center gap-2.5 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px] pointer-events-none",children:"Search"})})})})})]})})},EUe=()=>i.jsxs("div",{className:"flex items-center justify-center gap-4 px-4 py-2 flex-col",children:[i.jsx("div",{className:"p-4 bg-#FFA756 bg-opacity-20 rounded-full",children:i.jsx("img",{src:Wbt,alt:"",className:"w-8 h-8"})}),i.jsxs("div",{className:"flex flex-col items-center justify-center gap-1",children:[i.jsx("div",{className:"text-#FFA756",children:"No Data"}),i.jsxs("div",{className:"text-#767676",children:["There isn't any data"," ",i.jsxs("span",{children:["for this",i.jsx("br",{})," time range at the moment"]})]})]})]}),Y6e=({content:e,positionTop:t,alignRight:n,type:r})=>{const s=e?r==="coin"?e.split(", ").map(a=>{const[o,l]=a.split(" (");return{name:o,value:l==null?void 0:l.replace(")","")}}):r==="position"?e==null?void 0:e.map(a=>({name:a.coin,value:a.unrealized_pnl})):[]:[];return i.jsx("span",{className:`tooltip ${n?"left-5 top-1/2 -translate-y-1/2 ":t?"-top-6 translate-x-[10%] -left-[20%]":"-top-6 translate-x-[10%] right-[20%] mr-9"} transform text-white font-manrope font-semibold text-xs leading-3 whitespace-nowrap mt-1`,children:i.jsxs("div",{className:`${t?"ml-6":"mr-6"} border border-[#404040] bg-[#222222] p-2 rounded-sm relative`,children:[i.jsx("div",{className:"overflow-y-auto scroll-design-search-scroll w-max min-h-[31px] h-max max-h-[160px]",children:i.jsx("ul",{style:{margin:0,padding:0,listStyle:"none"},children:(s==null?void 0:s.length)>0?s==null?void 0:s.map((a,o)=>i.jsxs("li",{className:`${o===(s==null?void 0:s.length)-1?"mb-0":"mb-[5px]"} flex justify-between pl-1 pr-2 h-max p-2 rounded border border-[#7d7c7c]`,children:[i.jsx("span",{className:`${(a==null?void 0:a.value)==null||isNaN(parseFloat(a==null?void 0:a.value))||(a==null?void 0:a.value)==0?"text-white":(a==null?void 0:a.value)>0?"text-[#1DE6A3]":"text-[#FF7173]"} flex justify-start items-center gap-1 min-w-20 border-r border-white`,children:a==null?void 0:a.name}),i.jsx("span",{className:`${(a==null?void 0:a.value)==null||isNaN(parseFloat(a==null?void 0:a.value))||(a==null?void 0:a.value)==0?"text-white":(a==null?void 0:a.value)>0?"text-[#1DE6A3]":"text-[#FF7173]"} pl-4`,children:`${(a==null?void 0:a.value)==null||isNaN(parseFloat(a==null?void 0:a.value))?"-":Fs(Math.abs(a==null?void 0:a.value))}`})]},o)):i.jsx("span",{children:"No data available"})})}),i.jsx("svg",{width:"10",height:"8",viewBox:"0 0 10 8",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:`absolute transform -z-1 ${n?"-rotate-90 left-1 -translate-x-full -translate-y-1/2 top-1/2 ":t?"-left-2 top-[15%] -rotate-90 -translate-y-1/2":"-right-2 top-[15%] rotate-90 -translate-y-1/2"}`,children:i.jsx("path",{d:"M3.70096 1.25C4.27831 0.25 5.72169 0.25 6.29904 1.25L8.89711 5.75C9.47446 6.75 8.75278 8 7.59808 8H2.40192C1.24722 8 0.525536 6.75 1.10289 5.75L3.70096 1.25Z",fill:"#404040",stroke:"#404040"})})]})})},Ice=({periods:e,selectedPeriod:t,handlePeriod:n,borderColor:r})=>i.jsx(i.Fragment,{children:e?i.jsx("div",{className:`${r=="ticker"?"border-[#333333]":"border-[#232323]"} flex items-center justify-center w-max h-[28px] rounded-lg border font-manrope p-[3px] `,children:e.map((s,a)=>i.jsx("button",{onClick:o=>n(o.target.dataset.value),"data-value":s.value,className:`${s.value===t?"bg-[#3d3d3d] text-white":"bg-transparent text-[#9b9b9b]"} flex justify-center items-center uppercase font-manrope focus:outline-none focus:ring-0 border-none rounded-md text-xs font-bold leading-[8px] tracking-wide h-5 w-[35.5px] sm:w-[48px]`,children:s.name},a))}):null});function Arn({currentPage:e,offset:t,setOffset:n,totalPage:r,totalWalletCount:s}){return i.jsxs("header",{className:"flex items-center justify-between gap-2 z-4 bg-[#161616] font-manrope",children:[i.jsxs("div",{className:"flex justify-center items-center gap-1",children:[i.jsx(Ni,{className:"text-white hidden sm:block"}),i.jsxs("div",{className:"flex justify-start items-center gap-1",children:[i.jsx("span",{className:"text-white text-[12px] font-semibold font-manrope leading-[14px]",children:s}),i.jsx("span",{className:"text-[#7e7e7e] text-[12px] font-semibold font-manrope leading-[14px]",children:"wallets found"})]})]}),i.jsxs("div",{className:"flex items-center justify-start gap-[4px]",children:[i.jsx("button",{onClick:e===1?()=>{}:()=>n(t===0?0:t-50),type:"button",className:e===1?"relative inline-flex items-center p-1.5 text-sm font-medium text-white/20 rounded-md focus:ring-0 focus:outline-none border-none cursor-not-allowed bg-[#3d3d3d] w-6 h-6":"relative inline-flex items-center p-1.5 rounded-md bg-[#3d3d3d] text-sm font-medium text-white hover:bg-white/40 focus:outline-none focus:ring-0 border-none focus:z-10",children:i.jsx(Yh,{className:`${e===1?"text-white/30":"text-white"} w-3 h-3 rotate-90`})}),i.jsxs("div",{type:"button",className:"-ml-px relative inline-flex items-center px-2 py-2 bg-[#3d3d3d]/60 text-sm font-medium text-white focus:z-10 focus:outline-none focus:ring-0 outline-none min-w-max h-6 max-h-6 rounded-md",children:[e," / ",r]}),i.jsx("button",{onClick:e===r||r===0?()=>{}:()=>n(t+50),type:"button",className:e===r?"bg-[#3d3d3d] w-6 h-6 cursor-not-allowed relative inline-flex items-center p-1.5 rounded-md text-sm font-medium text-black focus:z-10 focus:outline-none focus:ring-0 border-none":"relative inline-flex items-center p-1.5 rounded-md bg-[#3d3d3d] w-6 h-6 text-sm font-medium text-white hover:bg-white/40 focus:z-10 focus:outline-none focus:ring-0 border-none",children:i.jsx(Yh,{className:`${e===r?"text-white/30":"text-white"} w-3 h-3 -rotate-90`})})]})]})}const jrn=({info1:e,info2:t,padding:n,icon:r,info1_Color:s,info2_Color:a,rowTwo:o,info3:l})=>i.jsxs("div",{className:`${n||"pl-1 pr-2"} flex flex-col gap-2 font-manrope`,children:[t&&i.jsx("div",{className:`${a} text-xs font-normal not-italic font-inter flex items-center justify-end leading-3 min-w-max text-white`,children:t}),i.jsxs("div",{className:`${s} ${o?"-mt-3.5":""} text-sm font-semibold font-manrope leading-[13px] flex items-center justify-end gap-0.5 tracking-[0.28px]`,children:[i.jsx("img",{src:r,alt:"",className:""}),l?i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"text-[#1DE6A3]",children:e})," /"," ",i.jsx("span",{className:"text-[#FF7173]",children:l})]}):e]})]});function Ern({open:e,setOpen:t}){return i.jsxs(Ea,{open:e,onClose:t,className:"relative z-50 font-manrope",children:[i.jsx(ja,{transition:!0,style:{backgroundColor:"rgba(0, 0, 0, 0.48)"},className:"fixed inset-0 transition-opacity data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in"}),i.jsx("div",{className:"fixed inset-0 z-50 w-screen overflow-y-auto",children:i.jsx("div",{className:"flex min-h-full items-end justify-center p-4 text-center sm:items-center sm:p-0",children:i.jsx(xa,{transition:!0,className:"relative transform overflow-hidden bg-[#101010] text-left shadow-xl transition-all data-[closed]:translate-y-4 data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in data-[closed]:sm:translate-y-0 data-[closed]:sm:scale-95 rounded-3xl",children:i.jsx("div",{className:"flex flex-col justify-start items-center gap-8 w-[400px] h-max relative bg-[#252525] rounded-3xl pt-4 pb-6",children:i.jsxs(i.Fragment,{children:[i.jsx("div",{onClick:()=>{t(!1)},className:"cursor-pointer flex w-full items-center justify-end absolute right-2 top-1",children:i.jsx("span",{className:"absolute top-2 right-2 w-9 h-9 rounded-full p-1 flex justify-center items-center hover:bg-[#7535FE]",children:i.jsx("img",{className:"p-1",src:Ba})})}),i.jsx("div",{className:"pt-4",children:i.jsx("img",{src:Gi,alt:"",className:"w-[86px h-[86px]"})}),i.jsxs("div",{className:"flex flex-col items-center justify-start gap-4",children:[i.jsx("div",{className:"text-center text-white text-[32px] font-manrope font-semibold leading-loose",children:"Coming Soon"}),i.jsx("div",{className:"w-[300px] text-center text-white/60 text-sm font-medium font-manrope leading-[18px] tracking-[0.28px] pt-4 pb-8 px-5",children:"Join Dextrabot on Discord for the latest features and announcements!"}),i.jsx("div",{onClick:()=>{window.open("https://discord.gg/dextrabot","_blank"),t(!1)},className:"flex justify-center items-center w-[348px] h-12 bg-[#7446FF] rounded-2xl mt-2 cursor-pointer",children:i.jsx("div",{className:"text-center text-white text-sm font-semibold font-manrope leading-[0.28px] tracking-tight",children:"Join Dextrabot on Discord"})})]})]})})})})})]})}function _rn(e,t){if(e.match(/^[a-z]+:\/\//i))return e;if(e.match(/^\/\//))return window.location.protocol+e;if(e.match(/^[a-z]+:/i))return e;const n=document.implementation.createHTMLDocument(),r=n.createElement("base"),s=n.createElement("a");return n.head.appendChild(r),n.body.appendChild(s),t&&(r.href=t),s.href=e,s.href}const krn=(()=>{let e=0;const t=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(e+=1,`u${t()}${e}`)})();function Ty(e){const t=[];for(let n=0,r=e.length;n<r;n++)t.push(e[n]);return t}let sC=null;function _Ue(e={}){return sC||(e.includeStyleProperties?(sC=e.includeStyleProperties,sC):(sC=Ty(window.getComputedStyle(document.documentElement)),sC))}function zL(e,t){const r=(e.ownerDocument.defaultView||window).getComputedStyle(e).getPropertyValue(t);return r?parseFloat(r.replace("px","")):0}function Trn(e){const t=zL(e,"border-left-width"),n=zL(e,"border-right-width");return e.clientWidth+t+n}function Irn(e){const t=zL(e,"border-top-width"),n=zL(e,"border-bottom-width");return e.clientHeight+t+n}function kUe(e,t={}){const n=t.width||Trn(e),r=t.height||Irn(e);return{width:n,height:r}}function Prn(){let e,t;try{t=process}catch{}const n=t&&t.env?t.env.devicePixelRatio:null;return n&&(e=parseInt(n,10),Number.isNaN(e)&&(e=1)),e||window.devicePixelRatio||1}const Af=16384;function Frn(e){(e.width>Af||e.height>Af)&&(e.width>Af&&e.height>Af?e.width>e.height?(e.height*=Af/e.width,e.width=Af):(e.width*=Af/e.height,e.height=Af):e.width>Af?(e.height*=Af/e.width,e.width=Af):(e.width*=Af/e.height,e.height=Af))}function HL(e){return new Promise((t,n)=>{const r=new Image;r.onload=()=>{r.decode().then(()=>{requestAnimationFrame(()=>t(r))})},r.onerror=n,r.crossOrigin="anonymous",r.decoding="async",r.src=e})}async function Orn(e){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then(t=>`data:image/svg+xml;charset=utf-8,${t}`)}async function Mrn(e,t,n){const r="http://www.w3.org/2000/svg",s=document.createElementNS(r,"svg"),a=document.createElementNS(r,"foreignObject");return s.setAttribute("width",`${t}`),s.setAttribute("height",`${n}`),s.setAttribute("viewBox",`0 0 ${t} ${n}`),a.setAttribute("width","100%"),a.setAttribute("height","100%"),a.setAttribute("x","0"),a.setAttribute("y","0"),a.setAttribute("externalResourcesRequired","true"),s.appendChild(a),a.appendChild(e),Orn(s)}const af=(e,t)=>{if(e instanceof t)return!0;const n=Object.getPrototypeOf(e);return n===null?!1:n.constructor.name===t.name||af(n,t)};function Rrn(e){const t=e.getPropertyValue("content");return`${e.cssText} content: '${t.replace(/'|"/g,"")}';`}function Lrn(e,t){return _Ue(t).map(n=>{const r=e.getPropertyValue(n),s=e.getPropertyPriority(n);return`${n}: ${r}${s?" !important":""};`}).join(" ")}function Drn(e,t,n,r){const s=`.${e}:${t}`,a=n.cssText?Rrn(n):Lrn(n,r);return document.createTextNode(`${s}{${a}}`)}function X6e(e,t,n,r){const s=window.getComputedStyle(e,n),a=s.getPropertyValue("content");if(a===""||a==="none")return;const o=krn();try{t.className=`${t.className} ${o}`}catch{return}const l=document.createElement("style");l.appendChild(Drn(o,n,s,r)),t.appendChild(l)}function Brn(e,t,n){X6e(e,t,":before",n),X6e(e,t,":after",n)}const Q6e="application/font-woff",Z6e="image/jpeg",$rn={woff:Q6e,woff2:Q6e,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:Z6e,jpeg:Z6e,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function Urn(e){const t=/\.([^./]*?)$/g.exec(e);return t?t[1]:""}function Pce(e){const t=Urn(e).toLowerCase();return $rn[t]||""}function zrn(e){return e.split(/,/)[1]}function jne(e){return e.search(/^(data:)/)!==-1}function Hrn(e,t){return`data:${t};base64,${e}`}async function TUe(e,t,n){const r=await fetch(e,t);if(r.status===404)throw new Error(`Resource "${r.url}" not found`);const s=await r.blob();return new Promise((a,o)=>{const l=new FileReader;l.onerror=o,l.onloadend=()=>{try{a(n({res:r,result:l.result}))}catch(c){o(c)}},l.readAsDataURL(s)})}const RY={};function Vrn(e,t,n){let r=e.replace(/\?.*/,"");return n&&(r=e),/ttf|otf|eot|woff2?/i.test(r)&&(r=r.replace(/.*\//,"")),t?`[${t}]${r}`:r}async function Fce(e,t,n){const r=Vrn(e,t,n.includeQueryParams);if(RY[r]!=null)return RY[r];n.cacheBust&&(e+=(/\?/.test(e)?"&":"?")+new Date().getTime());let s;try{const a=await TUe(e,n.fetchRequestInit,({res:o,result:l})=>(t||(t=o.headers.get("Content-Type")||""),zrn(l)));s=Hrn(a,t)}catch(a){s=n.imagePlaceholder||"";let o=`Failed to fetch resource: ${e}`;a&&(o=typeof a=="string"?a:a.message),o&&console.warn(o)}return RY[r]=s,s}async function Wrn(e){const t=e.toDataURL();return t==="data:,"?e.cloneNode(!1):HL(t)}async function qrn(e,t){if(e.currentSrc){const a=document.createElement("canvas"),o=a.getContext("2d");a.width=e.clientWidth,a.height=e.clientHeight,o==null||o.drawImage(e,0,0,a.width,a.height);const l=a.toDataURL();return HL(l)}const n=e.poster,r=Pce(n),s=await Fce(n,r,t);return HL(s)}async function Grn(e,t){var n;try{if(!((n=e==null?void 0:e.contentDocument)===null||n===void 0)&&n.body)return await dU(e.contentDocument.body,t,!0)}catch{}return e.cloneNode(!1)}async function Krn(e,t){return af(e,HTMLCanvasElement)?Wrn(e):af(e,HTMLVideoElement)?qrn(e,t):af(e,HTMLIFrameElement)?Grn(e,t):e.cloneNode(IUe(e))}const Yrn=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SLOT",IUe=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SVG";async function Xrn(e,t,n){var r,s;if(IUe(t))return t;let a=[];return Yrn(e)&&e.assignedNodes?a=Ty(e.assignedNodes()):af(e,HTMLIFrameElement)&&(!((r=e.contentDocument)===null||r===void 0)&&r.body)?a=Ty(e.contentDocument.body.childNodes):a=Ty(((s=e.shadowRoot)!==null&&s!==void 0?s:e).childNodes),a.length===0||af(e,HTMLVideoElement)||await a.reduce((o,l)=>o.then(()=>dU(l,n)).then(c=>{c&&t.appendChild(c)}),Promise.resolve()),t}function Qrn(e,t,n){const r=t.style;if(!r)return;const s=window.getComputedStyle(e);s.cssText?(r.cssText=s.cssText,r.transformOrigin=s.transformOrigin):_Ue(n).forEach(a=>{let o=s.getPropertyValue(a);a==="font-size"&&o.endsWith("px")&&(o=`${Math.floor(parseFloat(o.substring(0,o.length-2)))-.1}px`),af(e,HTMLIFrameElement)&&a==="display"&&o==="inline"&&(o="block"),a==="d"&&t.getAttribute("d")&&(o=`path(${t.getAttribute("d")})`),r.setProperty(a,o,s.getPropertyPriority(a))})}function Zrn(e,t){af(e,HTMLTextAreaElement)&&(t.innerHTML=e.value),af(e,HTMLInputElement)&&t.setAttribute("value",e.value)}function Jrn(e,t){if(af(e,HTMLSelectElement)){const n=t,r=Array.from(n.children).find(s=>e.value===s.getAttribute("value"));r&&r.setAttribute("selected","")}}function esn(e,t,n){return af(t,Element)&&(Qrn(e,t,n),Brn(e,t,n),Zrn(e,t),Jrn(e,t)),t}async function tsn(e,t){const n=e.querySelectorAll?e.querySelectorAll("use"):[];if(n.length===0)return e;const r={};for(let a=0;a<n.length;a++){const l=n[a].getAttribute("xlink:href");if(l){const c=e.querySelector(l),u=document.querySelector(l);!c&&u&&!r[l]&&(r[l]=await dU(u,t,!0))}}const s=Object.values(r);if(s.length){const a="http://www.w3.org/1999/xhtml",o=document.createElementNS(a,"svg");o.setAttribute("xmlns",a),o.style.position="absolute",o.style.width="0",o.style.height="0",o.style.overflow="hidden",o.style.display="none";const l=document.createElementNS(a,"defs");o.appendChild(l);for(let c=0;c<s.length;c++)l.appendChild(s[c]);e.appendChild(o)}return e}async function dU(e,t,n){return!n&&t.filter&&!t.filter(e)?null:Promise.resolve(e).then(r=>Krn(r,t)).then(r=>Xrn(e,r,t)).then(r=>esn(e,r,t)).then(r=>tsn(r,t))}const PUe=/url\((['"]?)([^'"]+?)\1\)/g,nsn=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,rsn=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function ssn(e){const t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}function isn(e){const t=[];return e.replace(PUe,(n,r,s)=>(t.push(s),n)),t.filter(n=>!jne(n))}async function asn(e,t,n,r,s){try{const a=n?_rn(t,n):t,o=Pce(t);let l;return s||(l=await Fce(a,o,r)),e.replace(ssn(t),`$1${l}$3`)}catch{}return e}function osn(e,{preferredFontFormat:t}){return t?e.replace(rsn,n=>{for(;;){const[r,,s]=nsn.exec(n)||[];if(!s)return"";if(s===t)return`src: ${r};`}}):e}function FUe(e){return e.search(PUe)!==-1}async function OUe(e,t,n){if(!FUe(e))return e;const r=osn(e,n);return isn(r).reduce((a,o)=>a.then(l=>asn(l,o,t,n)),Promise.resolve(r))}async function iC(e,t,n){var r;const s=(r=t.style)===null||r===void 0?void 0:r.getPropertyValue(e);if(s){const a=await OUe(s,null,n);return t.style.setProperty(e,a,t.style.getPropertyPriority(e)),!0}return!1}async function lsn(e,t){await iC("background",e,t)||await iC("background-image",e,t),await iC("mask",e,t)||await iC("-webkit-mask",e,t)||await iC("mask-image",e,t)||await iC("-webkit-mask-image",e,t)}async function csn(e,t){const n=af(e,HTMLImageElement);if(!(n&&!jne(e.src))&&!(af(e,SVGImageElement)&&!jne(e.href.baseVal)))return;const r=n?e.src:e.href.baseVal,s=await Fce(r,Pce(r),t);await new Promise((a,o)=>{e.onload=a,e.onerror=t.onImageErrorHandler?(...c)=>{try{a(t.onImageErrorHandler(...c))}catch(u){o(u)}}:o;const l=e;l.decode&&(l.decode=a),l.loading==="lazy"&&(l.loading="eager"),n?(e.srcset="",e.src=s):e.href.baseVal=s})}async function usn(e,t){const r=Ty(e.childNodes).map(s=>MUe(s,t));await Promise.all(r).then(()=>e)}async function MUe(e,t){af(e,Element)&&(await lsn(e,t),await csn(e,t),await usn(e,t))}function dsn(e,t){const{style:n}=e;t.backgroundColor&&(n.backgroundColor=t.backgroundColor),t.width&&(n.width=`${t.width}px`),t.height&&(n.height=`${t.height}px`);const r=t.style;return r!=null&&Object.keys(r).forEach(s=>{n[s]=r[s]}),e}const J6e={};async function eCe(e){let t=J6e[e];if(t!=null)return t;const r=await(await fetch(e)).text();return t={url:e,cssText:r},J6e[e]=t,t}async function tCe(e,t){let n=e.cssText;const r=/url\(["']?([^"')]+)["']?\)/g,a=(n.match(/url\([^)]+\)/g)||[]).map(async o=>{let l=o.replace(r,"$1");return l.startsWith("https://")||(l=new URL(l,e.url).href),TUe(l,t.fetchRequestInit,({result:c})=>(n=n.replace(o,`url(${c})`),[o,c]))});return Promise.all(a).then(()=>n)}function nCe(e){if(e==null)return[];const t=[],n=/(\/\*[\s\S]*?\*\/)/gi;let r=e.replace(n,"");const s=new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})","gi");for(;;){const c=s.exec(r);if(c===null)break;t.push(c[0])}r=r.replace(s,"");const a=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,o="((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})",l=new RegExp(o,"gi");for(;;){let c=a.exec(r);if(c===null){if(c=l.exec(r),c===null)break;a.lastIndex=l.lastIndex}else l.lastIndex=a.lastIndex;t.push(c[0])}return t}async function fsn(e,t){const n=[],r=[];return e.forEach(s=>{if("cssRules"in s)try{Ty(s.cssRules||[]).forEach((a,o)=>{if(a.type===CSSRule.IMPORT_RULE){let l=o+1;const c=a.href,u=eCe(c).then(d=>tCe(d,t)).then(d=>nCe(d).forEach(f=>{try{s.insertRule(f,f.startsWith("@import")?l+=1:s.cssRules.length)}catch(x){console.error("Error inserting rule from remote css",{rule:f,error:x})}})).catch(d=>{console.error("Error loading remote css",d.toString())});r.push(u)}})}catch(a){const o=e.find(l=>l.href==null)||document.styleSheets[0];s.href!=null&&r.push(eCe(s.href).then(l=>tCe(l,t)).then(l=>nCe(l).forEach(c=>{o.insertRule(c,o.cssRules.length)})).catch(l=>{console.error("Error loading remote stylesheet",l)})),console.error("Error inlining remote css file",a)}}),Promise.all(r).then(()=>(e.forEach(s=>{if("cssRules"in s)try{Ty(s.cssRules||[]).forEach(a=>{n.push(a)})}catch(a){console.error(`Error while reading CSS rules from ${s.href}`,a)}}),n))}function hsn(e){return e.filter(t=>t.type===CSSRule.FONT_FACE_RULE).filter(t=>FUe(t.style.getPropertyValue("src")))}async function psn(e,t){if(e.ownerDocument==null)throw new Error("Provided element is not within a Document");const n=Ty(e.ownerDocument.styleSheets),r=await fsn(n,t);return hsn(r)}function RUe(e){return e.trim().replace(/["']/g,"")}function msn(e){const t=new Set;function n(r){(r.style.fontFamily||getComputedStyle(r).fontFamily).split(",").forEach(a=>{t.add(RUe(a))}),Array.from(r.children).forEach(a=>{a instanceof HTMLElement&&n(a)})}return n(e),t}async function xsn(e,t){const n=await psn(e,t),r=msn(e);return(await Promise.all(n.filter(a=>r.has(RUe(a.style.fontFamily))).map(a=>{const o=a.parentStyleSheet?a.parentStyleSheet.href:null;return OUe(a.cssText,o,t)}))).join(`
`)}async function gsn(e,t){const n=t.fontEmbedCSS!=null?t.fontEmbedCSS:t.skipFonts?null:await xsn(e,t);if(n){const r=document.createElement("style"),s=document.createTextNode(n);r.appendChild(s),e.firstChild?e.insertBefore(r,e.firstChild):e.appendChild(r)}}async function bsn(e,t={}){const{width:n,height:r}=kUe(e,t),s=await dU(e,t,!0);return await gsn(s,t),await MUe(s,t),dsn(s,t),await Mrn(s,n,r)}async function ysn(e,t={}){const{width:n,height:r}=kUe(e,t),s=await bsn(e,t),a=await HL(s),o=document.createElement("canvas"),l=o.getContext("2d"),c=t.pixelRatio||Prn(),u=t.canvasWidth||n,d=t.canvasHeight||r;return o.width=u*c,o.height=d*c,t.skipAutoScale||Frn(o),o.style.width=`${u}`,o.style.height=`${d}`,t.backgroundColor&&(l.fillStyle=t.backgroundColor,l.fillRect(0,0,o.width,o.height)),l.drawImage(a,0,0,o.width,o.height),o}async function P1(e,t={}){return(await ysn(e,t)).toDataURL()}function vsn({open:e,setOpen:t,data:n,setTradeInfo:r,period:s}){const a=m.useRef(null),o=async()=>{if(a.current)try{await document.fonts.ready,await new Promise(u=>setTimeout(u,500));const l=await P1(a.current,{cacheBust:!0,backgroundColor:null,useCORS:!0,style:{transform:"scale(1)",transformOrigin:"top left"}}),c=document.createElement("a");c.href=l,c.download="dextrabot.png",document.body.appendChild(c),c.click(),document.body.removeChild(c),rn.success("PNG successfully downloaded!")}catch(l){console.error("Error generating PNG:",l),rn.error("Failed to download PNG.")}};return i.jsxs(Ea,{open:e,onClose:()=>{},className:"relative z-50 font-manrope",children:[i.jsx(ja,{transition:!0,style:{backgroundColor:"rgba(0, 0, 0, 0.48)"},className:"fixed inset-0 transition-opacity data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in"}),i.jsx("div",{className:"fixed inset-0 z-50 w-screen overflow-y-auto",children:i.jsx("div",{className:"flex min-h-full items-end justify-center p-4 text-center sm:items-center sm:p-0",children:i.jsx(xa,{transition:!0,className:"relative bg-[#101010] text-left shadow-xl transition-all data-[closed]:translate-y-4 data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in data-[closed]:sm:translate-y-0 scale-75",children:i.jsx("div",{className:"flex flex-col justify-start items-center gap-8 w-max relative bg-[#1b1b1b] rounded-2xl",children:i.jsxs(i.Fragment,{children:[i.jsx("div",{onClick:()=>{t(!1),setTimeout(()=>{r(l=>({...l,pnl:0,winRate:0,tradeCount:0,longWinRate:0,shortWinRate:0,leverage:0,roe:0,unrealizedPnL:0}))},300)},className:"cursor-pointer flex w-full items-center justify-end absolute right-2 top-1",children:i.jsx("span",{className:"absolute top-2 right-2 w-9 h-9 rounded-full p-1 flex justify-center items-center hover:bg-[#7535FE]",children:i.jsx("img",{className:"p-1",src:Ba})})}),i.jsxs("div",{className:"flex flex-col items-start justify-start gap-4 w-full",children:[i.jsx("div",{className:"flex justify-start items-center w-full pt-6 pl-6 text-white text-base font-semibold font-manrope leading-[8px]",children:"Share PnL"}),i.jsxs("div",{className:"flex justify-start items-center w-full gap-2 px-2 pb-2.5",children:[i.jsx("div",{ref:a,style:{overflow:"visible",position:"relative"},className:"w-[838px] h-[608px] rounded-2xl border border-dashed border-[#353535] justify-center items-center inline-flex overflow-hidden",children:i.jsxs("div",{className:"w-[830px] h-[600px] rounded-xl flex justify-start items-center bg-[#0F1211]",children:[i.jsx("div",{className:"flex justify-start items-center w-[482px] max-h-[600px] bg-[#0F1211] rounded-xl share-pnl-background",children:i.jsxs("div",{className:"flex flex-col items-start gap-4 px-[42px] py-[40px] h-full w-full",children:[i.jsxs("div",{className:"flex justify-start items-center gap-4 relative",children:[i.jsx("img",{src:EA,alt:"",className:"w-12 h-12 max-w-12 min-h-12"}),i.jsx("p",{className:"flex justify-center items-center text-white text-2xl font-semibold font-manrope",children:"Dextrabot - Copy Trade"})]}),i.jsxs("div",{className:`${s==999?"mt-20":"mt-[44px]"} flex flex-col items-start justify-start gap-2 `,children:[i.jsx("div",{className:"text-white/50 text-lg font-medium font-manrope tracking-wider flex",children:"PnL"}),i.jsx("div",{className:`${(n==null?void 0:n.pnl)>=0?"text-[#67ffbd]":"text-[#ff6767]"} text-[66px] font-semibold font-manrope leading-[52px] inline-flex justify-center items-center min-w-max`,children:(n==null?void 0:n.pnl)==null||isNaN(parseFloat(n==null?void 0:n.pnl))?"--":`$${Fs(Math.abs(n==null?void 0:n.pnl))}`})]}),i.jsxs("div",{className:`${s==999?"hidden":""} flex justify-start items-start gap-[65px] pt-[26px]`,children:[i.jsxs("div",{className:"flex flex-col justify-start items-start gap-[2px] max-h-max min-w-[140px]",children:[i.jsx("div",{className:"text-white/50 text-lg font-medium font-manrope tracking-wider flex",children:"WIN RATE"}),i.jsx("div",{className:"text-white text-[32px] font-semibold font-manrope leading-none flex",children:`${(n==null?void 0:n.winRate)==null||isNaN(parseFloat(n==null?void 0:n.winRate))?"--":(n==null?void 0:n.winRate)+"%"}`})]}),i.jsxs("div",{className:"flex flex-col justify-start items-start gap-[2px] max-h-max",children:[i.jsx("div",{className:"text-white/50 text-lg font-medium font-manrope tracking-wider flex",children:"TX COUNT"}),i.jsx("div",{className:"text-white text-[32px] font-semibold font-manrope leading-none flex",children:`${(n==null?void 0:n.tradeCount)==null||isNaN(parseFloat(n==null?void 0:n.tradeCount))?"--":Fs(n==null?void 0:n.tradeCount)}`})]})]}),i.jsxs("div",{className:`${s==999?"hidden":""} flex justify-start items-start gap-[65px] pt-[8px]`,children:[i.jsxs("div",{className:"flex flex-col justify-start items-start gap-[2px] max-h-max",children:[i.jsx("div",{className:"text-white/50 text-lg font-medium font-manrope tracking-wider flex",children:"LONG WIN RATE"}),i.jsx("div",{className:"text-white text-[32px] font-semibold font-manrope leading-none flex",children:`${(n==null?void 0:n.longWinRate)==null||isNaN(parseFloat(n==null?void 0:n.longWinRate))?"--":(n==null?void 0:n.longWinRate)+"%"}`})]}),i.jsxs("div",{className:"flex flex-col justify-start items-start gap-[2px] max-h-max",children:[i.jsx("div",{className:"text-white/50 text-lg font-medium font-manrope tracking-wider flex",children:"SHORT WIN RATE"}),i.jsx("div",{className:"text-white text-[32px] font-semibold font-manrope leading-none flex",children:`${(n==null?void 0:n.shortWinRate)==null||isNaN(parseFloat(n==null?void 0:n.shortWinRate))?"--":(n==null?void 0:n.shortWinRate)+"%"}`})]})]}),(n==null?void 0:n.referral)&&i.jsx("div",{className:`${s==999?"pt-[150px]":"pt-[26px]"} flex justify-start items-start gap-[65px]`,children:i.jsxs("div",{className:"flex flex-col justify-start items-start gap-[2px] max-h-max",children:[i.jsx("div",{className:"text-white/50 text-lg font-medium font-manrope leading-loose tracking-wider flex",children:"REFERRAL"}),i.jsx("div",{className:"text-white text-[32px] font-semibold font-manrope leading-none flex",children:n!=null&&n.referral?n==null?void 0:n.referral:"--"})]})}),i.jsx("div",{className:`${n!=null&&n.referral?"pt-[1px]":s==999?"pt-[240px]":"pt-[82px]"} flex justify-start items-start `,children:i.jsx("div",{className:"text-[#828483] text-lg font-medium font-manrope leading-loose tracking-wide",children:n!=null&&n.referral?`https://app.dextrabot.com/referral/${n==null?void 0:n.referral}`:"https://app.dextrabot.com"})})]})}),i.jsx("div",{className:"flex justify-center items-center h-[600px] max-h-[600px] bg-[#0F1211] rounded-tr-xl rounded-br-xl max-w-[378px] overflow-hidden",children:(n==null?void 0:n.pnl)>=0?i.jsx("img",{src:AA,alt:"",className:"h-full"}):i.jsx("img",{src:jA,alt:"",className:"h-full"})})]})}),i.jsxs("div",{className:"flex flex-col items-start justify-between gap-4 w-[400px] h-[600px] bg-[#232323] rounded-2xl p-4",children:[i.jsxs("div",{className:"flex flex-col justify-start items-start w-full gap-4",children:[i.jsx("div",{className:"text-white text-base font-semibold font-manrope leading-[21px]",children:"Customization"}),i.jsx("div",{className:"text-[#b1b1b1] text-[13px] font-semibold font-manrope leading-[8px] pt-0.5",children:"Referral Code"}),i.jsxs("div",{className:"flex justify-start items-center gap-2 px-2.5 w-full h-8 bg-[#1b1b1b] rounded-md border border-[#303030]",children:[i.jsx("div",{className:"text-[#7b7b7b] text-sm font-medium font-inter leading-[8px]",children:"#"}),i.jsx("div",{className:"text-white text-sm font-medium font-inter leading-[8px]",children:n!=null&&n.referral?n==null?void 0:n.referral:"--"})]}),i.jsx("div",{className:"text-[#b1b1b1] text-[13px] font-semibold font-manrope leading-[8px] pt-0.5",children:"Comment"}),i.jsx("div",{className:"flex justify-start items-center gap-2 p-2 w-full h-max bg-[#1b1b1b] rounded-lg border border-[#303030]",children:i.jsx("div",{className:"w-max text-[#909090] text-sm font-normal font-inter leading-[18px]",children:n!=null&&n.referral?i.jsxs("span",{children:["Numbers don’t lie! 🔥 Total Profit:"," ",(n==null?void 0:n.pnl)>=0?"":"-",(n==null?void 0:n.pnl)==null||isNaN(parseFloat(n==null?void 0:n.pnl))?"--":`$${Fs(Math.abs(n==null?void 0:n.pnl))}`," ","🚀 Tap into the best trades with Dextrabot on Hyperliquid! Copy top traders and save 4% on fees using my referral: ",n==null?void 0:n.referral," ","@Dextrabot"," "]}):i.jsxs("span",{children:["Numbers don’t lie! 🔥 Total Profit:"," ",(n==null?void 0:n.pnl)>=0?"":"-",(n==null?void 0:n.pnl)==null||isNaN(parseFloat(n==null?void 0:n.pnl))?"--":`$${Fs(Math.abs(n==null?void 0:n.pnl))}`," ","🚀 Tap into the best trades with Dextrabot on Hyperliquid! Copy top traders! @Dextrabot"]})})})]}),i.jsxs("div",{className:"flex flex-col items-start justify-center gap-2.5 w-full",children:[i.jsx("div",{onClick:l=>{l.stopPropagation(),navigator.clipboard.writeText(n!=null&&n.referral?`https://app.dextrabot.com/referral/${n==null?void 0:n.referral}`:"https://app.dextrabot.com"),rn.success("Successfully copied.",{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(103, 255, 189, 0.16)",width:"280px",minWidth:"280px",height:"40px",backdropFilter:"blur(16px)"},iconTheme:{primary:"#67FFBD",secondary:"#276047"}})},className:"w-full h-8 px-4 py-3 rounded-[10px] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-[#353535] justify-center items-center gap-2.5 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px]",children:"Copy URL"})}),i.jsx("div",{onClick:()=>{o()},className:"w-full h-8 px-4 py-3 rounded-[10px] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-[#353535] justify-center items-center gap-2.5 inline-flex has-tooltip relative cursor-pointer",children:i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px]",children:"Download PNG"})}),i.jsx("a",{href:`https://x.com/intent/post?url=${n!=null&&n.referral?`https://app.dextrabot.com/referral/${n==null?void 0:n.referral}`:"https://app.dextrabot.com"}&text=Numbers%20don’t%20lie!%20🔥%20Total%20Profit:%20${(n==null?void 0:n.pnl)==null||isNaN(parseFloat(n==null?void 0:n.pnl))?"--":`${(n==null?void 0:n.pnl)>=0?"":"-"}%24${Fs(Math.abs(n==null?void 0:n.pnl))}`}%20🚀%20Tap%20into%20the%20best%20trades%20with%20Dextrabot%20on%20Hyperliquid!%20Copy%20top%20traders${n!=null&&n.referral&&(n==null?void 0:n.referral)!=="--"?`%20and%20save%204%25%20on%20fees%20using%20my%20referral:%20${n==null?void 0:n.referral}`:"!"}%20%40Dextrabot%0A`,target:"_blank",className:"w-full h-8 px-6 py-3 bg-white rounded-[10px] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border justify-center items-center gap-2.5 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-[#363636] text-[13px] font-medium font-inter leading-[8px]",children:"Share on X"})})]})]})]})]})]})})})})})]})}function wsn({open:e,setOpen:t,data:n,setTradeInfo:r}){const s=m.useRef(null),a=async()=>{if(s.current)try{await document.fonts.ready,await new Promise(c=>setTimeout(c,500));const o=await P1(s.current,{cacheBust:!0,backgroundColor:null,useCORS:!0,style:{transform:"scale(1)",transformOrigin:"top left"}}),l=document.createElement("a");l.href=o,l.download="dextrabot.png",document.body.appendChild(l),l.click(),document.body.removeChild(l),rn.success("PNG successfully downloaded!")}catch(o){console.error("Error generating PNG:",o),rn.error("Failed to download PNG.")}};return i.jsxs(Ea,{open:e,onClose:()=>{},className:"relative z-50 font-manrope",children:[i.jsx(ja,{transition:!0,style:{backgroundColor:"rgba(0, 0, 0, 0.48)"},className:"fixed inset-0 transition-opacity data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in"}),i.jsx("div",{className:"fixed inset-0 z-50 w-screen overflow-y-auto",children:i.jsx("div",{className:"flex min-h-full items-end justify-center p-4 text-center sm:items-center sm:p-0",children:i.jsx(xa,{transition:!0,className:"relative bg-[#101010] text-left shadow-xl transition-all data-[closed]:translate-y-4 data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in data-[closed]:sm:translate-y-0 scale-75",children:i.jsx("div",{className:"flex flex-col justify-start items-center gap-8 w-max relative bg-[#1b1b1b] rounded-2xl",children:i.jsxs(i.Fragment,{children:[i.jsx("div",{onClick:()=>{t(!1),setTimeout(()=>{r(o=>({...o,pnl:0,winRate:0,tradeCount:0,longWinRate:0,shortWinRate:0,leverage:0,roe:0,unrealizedPnL:0}))},300)},className:"cursor-pointer flex w-full items-center justify-end absolute right-2 top-1",children:i.jsx("span",{className:"absolute top-2 right-2 w-9 h-9 rounded-full p-1 flex justify-center items-center hover:bg-[#7535FE]",children:i.jsx("img",{className:"p-1",src:Ba})})}),i.jsxs("div",{className:"flex flex-col items-start justify-start gap-4 w-full",children:[i.jsx("div",{className:"flex justify-start items-center w-full pt-6 pl-6 text-white text-base font-semibold font-manrope leading-[8px]",children:"Share PnL"}),i.jsxs("div",{className:"flex justify-start items-center w-full gap-2 px-2 pb-2.5",children:[i.jsx("div",{ref:s,style:{overflow:"visible",position:"relative"},className:"w-[858px] h-[608px] rounded-2xl border border-dashed border-[#353535] justify-center items-center inline-flex overflow-hidden",children:i.jsxs("div",{className:"w-[850px] h-[600px] rounded-xl flex justify-start items-center bg-[#0F1211]",children:[i.jsx("div",{className:"flex justify-start items-center w-[502px] max-h-[600px] bg-[#0F1211] rounded-xl share-pnl-background",children:i.jsxs("div",{className:"flex flex-col items-start gap-4 px-[42px] py-[40px] h-full w-full",children:[i.jsxs("div",{className:"flex justify-start items-center gap-4 relative",children:[i.jsx("img",{src:EA,alt:"",className:"w-12 h-12 max-w-12 min-h-12"}),i.jsx("p",{className:"flex justify-center items-center text-white text-2xl font-semibold font-manrope",children:"Dextrabot - Copy Trade"})]}),i.jsxs("div",{className:"flex flex-col items-start justify-start",children:[i.jsx("div",{className:"flex justify-start items-center gap-2 relative mt-16",children:i.jsx("div",{className:"bg-[#67ffbd]/20 text-[#67ffbd] h-9 min-w-[64px] px-3 flex-shrink-0 rounded-md flex justify-center items-center text-[20px] font-semibold font-manrope tracking-wide",children:`${(n==null?void 0:n.leverage)==null||isNaN(parseFloat(n==null?void 0:n.leverage))?"--":`${parseFloat(n==null?void 0:n.leverage).toFixed(2)}x`}`})}),i.jsxs("div",{className:`${(n==null?void 0:n.roe)>=0?"text-[#67ffbd]":"text-[#ff6767]"} text-[86px] font-semibold font-manrope leading-[92px] inline-flex justify-center items-center min-w-max`,children:[(n==null?void 0:n.roe)>=0?"+":"-",`${(n==null?void 0:n.roe)==null||isNaN(parseFloat(n==null?void 0:n.roe))?"--":`${Fs(Math.abs(n==null?void 0:n.roe))}%`}`]})]}),i.jsx("div",{className:"flex justify-start items-start gap-[65px] pt-[22px]",children:i.jsxs("div",{className:"flex flex-col justify-start items-start gap-[2px] max-h-max min-w-[130px]",children:[i.jsx("div",{className:"text-white/50 text-lg font-medium font-manrope tracking-wider flex",children:"UNREALIZED PNL"}),i.jsx("div",{className:`${(n==null?void 0:n.unrealizedPnL)==null||isNaN(parseFloat(n==null?void 0:n.unrealizedPnL))||(n==null?void 0:n.unrealizedPnL)==0?"text-white":(n==null?void 0:n.unrealizedPnL)>0?"text-[#1DE6A3]":"text-[#FF7173]"} text-[32px] font-semibold font-manrope leading-none flex`,children:(n==null?void 0:n.unrealizedPnL)==null||isNaN(parseFloat(n==null?void 0:n.unrealizedPnL))?"--":`$${Fs(Math.abs(n==null?void 0:n.unrealizedPnL))}`})]})}),(n==null?void 0:n.referral)&&i.jsx("div",{className:"flex justify-start items-start gap-[65px] pt-[26px]",children:i.jsxs("div",{className:"flex flex-col justify-start items-start gap-[2px] max-h-max",children:[i.jsx("div",{className:"text-white/50 text-lg font-medium font-manrope leading-loose tracking-wider flex",children:"REFERRAL"}),i.jsx("div",{className:"text-white text-[32px] font-semibold font-manrope leading-none flex",children:n!=null&&n.referral?n==null?void 0:n.referral:"--"})]})}),i.jsx("div",{className:`${n!=null&&n.referral?"pt-[16px]":"pt-[112px]"} flex justify-start items-start`,children:i.jsx("div",{className:"text-[#828483] text-lg font-medium font-manrope leading-loose tracking-wide",children:n!=null&&n.referral?`https://app.dextrabot.com/referral/${n==null?void 0:n.referral}`:"https://app.dextrabot.com"})})]})}),i.jsx("div",{className:"flex justify-center items-center h-[600px] max-h-[600px] bg-[#0F1211] rounded-tr-xl rounded-br-xl max-w-[398px] overflow-hidden",children:(n==null?void 0:n.roe)>=0?i.jsx("img",{src:AA,alt:"",className:"h-full"}):i.jsx("img",{src:jA,alt:"",className:"h-full"})})]})}),i.jsxs("div",{className:"flex flex-col items-start justify-between gap-4 w-[400px] h-[600px] bg-[#232323] rounded-2xl p-4",children:[i.jsxs("div",{className:"flex flex-col justify-start items-start w-full gap-4",children:[i.jsx("div",{className:"text-white text-base font-semibold font-manrope leading-[21px]",children:"Customization"}),i.jsx("div",{className:"text-[#b1b1b1] text-[13px] font-semibold font-manrope leading-[8px] pt-0.5",children:"Referral Code"}),i.jsxs("div",{className:"flex justify-start items-center gap-2 px-2.5 w-full h-8 bg-[#1b1b1b] rounded-md border border-[#303030]",children:[i.jsx("div",{className:"text-[#7b7b7b] text-sm font-medium font-inter leading-[8px]",children:"#"}),i.jsx("div",{className:"text-white text-sm font-medium font-inter leading-[8px]",children:n!=null&&n.referral?n==null?void 0:n.referral:"--"})]}),i.jsx("div",{className:"text-[#b1b1b1] text-[13px] font-semibold font-manrope leading-[8px] pt-0.5",children:"Comment"}),i.jsx("div",{className:"flex justify-start items-center gap-2 p-2 w-full h-max bg-[#1b1b1b] rounded-lg border border-[#303030]",children:i.jsx("div",{className:"w-max text-[#909090] text-sm font-normal font-inter leading-[18px]",children:n!=null&&n.referral?i.jsxs("span",{children:["Numbers don’t lie! 🔥 Unrealized PnL:"," ",(n==null?void 0:n.unrealizedPnL)>=0?"":"-",(n==null?void 0:n.unrealizedPnL)==null||isNaN(parseFloat(n==null?void 0:n.unrealizedPnL))?"--":`$${Fs(Math.abs(n==null?void 0:n.unrealizedPnL))}`," ","🚀 Tap into the best trades with Dextrabot on Hyperliquid! Copy top traders and save 4% on fees using my referral: ",n==null?void 0:n.referral," ","@Dextrabot"," "]}):i.jsxs("span",{children:["Numbers don’t lie! 🔥 Unrealized PnL:"," ",(n==null?void 0:n.unrealizedPnL)>=0?"":"-",(n==null?void 0:n.unrealizedPnL)==null||isNaN(parseFloat(n==null?void 0:n.unrealizedPnL))?"--":`$${Fs(Math.abs(n==null?void 0:n.unrealizedPnL))}`," ","🚀 Tap into the best trades with Dextrabot on Hyperliquid! Copy top traders! @Dextrabot"]})})})]}),i.jsxs("div",{className:"flex flex-col items-start justify-center gap-2.5 w-full",children:[i.jsx("div",{onClick:o=>{o.stopPropagation(),navigator.clipboard.writeText(n!=null&&n.referral?`https://app.dextrabot.com/referral/${n==null?void 0:n.referral}`:"https://app.dextrabot.com"),rn.success("Successfully copied.",{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(103, 255, 189, 0.16)",width:"280px",minWidth:"280px",height:"40px",backdropFilter:"blur(16px)"},iconTheme:{primary:"#67FFBD",secondary:"#276047"}})},className:"w-full h-8 px-4 py-3 rounded-[10px] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-[#353535] justify-center items-center gap-2.5 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px]",children:"Copy URL"})}),i.jsx("div",{onClick:()=>{a()},className:"w-full h-8 px-4 py-3 rounded-[10px] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-[#353535] justify-center items-center gap-2.5 inline-flex has-tooltip relative cursor-pointer",children:i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px]",children:"Download PNG"})}),i.jsx("a",{href:`https://x.com/intent/post?url=${n!=null&&n.referral?`https://app.dextrabot.com/referral/${n==null?void 0:n.referral}`:"https://app.dextrabot.com"}&text=Numbers%20don’t%20lie!%20🔥%20Unrealized%20PnL:%20${(n==null?void 0:n.unrealizedPnL)==null||isNaN(parseFloat(n==null?void 0:n.unrealizedPnL))?"--":`${(n==null?void 0:n.unrealizedPnL)>=0?"":"-"}$${Fs(Math.abs(n==null?void 0:n.unrealizedPnL))}`}%20🚀%20Tap%20into%20the%20best%20trades%20with%20Dextrabot%20on%20Hyperliquid!%20Copy%20top%20traders${n!=null&&n.referral&&(n==null?void 0:n.referral)!=="--"?`%20and%20save%204%25%20on%20fees%20using%20my%20referral:%20${n==null?void 0:n.referral}`:"!"}%20%40Dextrabot%0A`,target:"_blank",className:"w-full h-8 px-6 py-3 bg-white rounded-[10px] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border justify-center items-center gap-2.5 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-[#363636] text-[13px] font-medium font-inter leading-[8px]",children:"Share on X"})})]})]})]})]})]})})})})})]})}const LUe=()=>{const[e,t]=m.useState(!1);m.useEffect(()=>{(()=>{localStorage.getItem("isCopyTradeIntroductionModal")||(t(!0),localStorage.removeItem("copyTradeIntroductionModal"))})()},[]),m.useEffect(()=>{const r=s=>{s.key==="Escape"&&(localStorage.setItem("isCopyTradeIntroductionModal","true"),t(!1))};return document.addEventListener("keydown",r),()=>{document.removeEventListener("keydown",r)}},[]);const n=()=>{localStorage.setItem("isCopyTradeIntroductionModal","true"),t(!1)};return i.jsxs(Ea,{open:e,onClose:n,className:"relative z-50 font-manrope hidden lg:block",children:[i.jsx(ja,{transition:!0,style:{backgroundColor:"rgba(0, 0, 0, 0.48)"},className:"fixed inset-0 transition-opacity data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in"}),i.jsx("div",{className:"fixed inset-0 z-50 w-screen overflow-y-auto",children:i.jsx("div",{className:"flex min-h-full items-end justify-center p-4 text-center sm:items-center sm:p-0",children:i.jsx(xa,{transition:!0,className:"relative transform overflow-hidden bg-[#1b1b1b] text-left shadow-xl transition-all data-[closed]:translate-y-4 data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in data-[closed]:sm:translate-y-0 data-[closed]:sm:scale-95 rounded-3xl",children:i.jsx("div",{className:"flex flex-col justify-start items-center gap-8 w-[480px] h-max relative bg-[#1b1b1b] rounded-3xl pb-8",children:i.jsxs(i.Fragment,{children:[i.jsx("div",{onClick:()=>{n()},className:"cursor-pointer flex w-full items-center justify-end absolute right-2 top-1",children:i.jsx("span",{className:"absolute top-2 right-2 w-9 h-9 rounded-full p-1 flex justify-center items-center hover:bg-[#67FFBD52]",children:i.jsx("img",{className:"p-1",src:Ba})})}),i.jsx("div",{className:"pt-2 px-2",children:i.jsx("img",{src:iyt,alt:""})}),i.jsxs("div",{className:"flex flex-col items-center justify-start gap-4 pt-[14px]",children:[i.jsxs("div",{className:"text-center justify-center",children:[i.jsxs("span",{className:"text-white text-2xl font-semibold font-manrope leading-7 tracking-tight",children:["You can start"," "]}),i.jsx("span",{className:"text-[#67ffbd] text-2xl font-semibold font-manrope leading-7 tracking-tight",children:"Copy Trading"}),i.jsxs("span",{className:"text-white text-2xl font-semibold font-manrope leading-7 tracking-tight",children:[" ","now!"]})]}),i.jsx("div",{className:"w-[320px] text-center justify-start text-[#979797] text-[13px] font-normal font-manrope leading-4 tracking-tight",children:"Hyperliquid Copy Trading is live on Dextrabot. Best wallets. Auto trades. Simple. 🚀"})]})]})})})})})]})},Csn=({info1:e,info2:t,info3:n,padding:r,icon:s,info1_Color:a,info2_Color:o,info3_Color:l,rowTwo:c})=>i.jsx("div",{className:`${r||"pl-1 pr-2"} flex flex-col gap-2 font-manrope`,children:i.jsx("div",{className:`${c?"-mt-3.5":""} text-sm font-semibold font-manrope leading-[13px] flex items-center justify-end gap-0.5 tracking-[0.28px] text-white`,children:e=="--"&&t=="--"&&n=="--"?"--":i.jsxs(i.Fragment,{children:[i.jsx("span",{className:`${a}`,children:`${e}/`}),i.jsx("span",{className:`${o}`,children:`${t}/`}),i.jsx("span",{className:`${l}`,children:`${n}`})]})})}),Ssn=({setCurrentPage:e,offset:t,setOffset:n,setTotalPage:r,setTotalWalletCount:s,period:a,periods:o,totalPage:l,totalWalletCount:c,currentPage:u,handlePeriodChange:d})=>{const[f,x]=m.useState([]),[g,v]=m.useState(!0),[w,C]=m.useState(null),{hyperToken:N,copyTradeWatchList:P,getCopyTradeWatchList:I,trackedWatchList:R,getTrackedWatchList:F,setSignModalOpen:U,setTelegramChatId:L,setSubscriberRole:z,setSubsExpireDay:Q,setMushboomerETH:ne,setMushboomerSOL:J,setIsReferralCode:X,isReferralCodeName:re,setIsReferralCodeName:pe,setIsWhitelist:Y,setHyperToken:ie,setHyperAddress:oe}=m.useContext(Qr),{isConnected:G,address:V}=ns();Vo(),oc();const[ee,ae]=m.useState(!1),[fe,Ne]=m.useState(null),[he,ge]=m.useState(null),[ye,ve]=m.useState(""),[je,Ie]=m.useState(""),[Le,Qe]=m.useState(""),[$e,it]=m.useState(""),[tt,lt]=m.useState(""),[ft,ut]=m.useState([]),[qt,It]=m.useState(!0),[nn,jt]=m.useState([]),[cn,un]=m.useState([]),[Ft,Ke]=m.useState(!0),[Bt,$t]=m.useState([]),[qe,Ye]=m.useState(!1),[ht,Zt]=m.useState(!1),zt=`portfolio_perp_${{1:"day",7:"week",30:"month",90:"3month",999:"all_time"}[a]||"day"}_pnl`,Et=`portfolio_perp_${{1:"day",7:"week",30:"month",90:"3month",999:"all_time"}[a]||"day"}_dd`,nt=`portfolio_perp_${{1:"day",7:"week",30:"month",90:"3month",999:"all_time"}[a]||"day"}_growth_rate`,Ue=`portfolio_perp_${{1:"day",7:"week",30:"month",90:"3month",999:"all_time"}[a]||"day"}_sharpe`;function Rt(Me){if(!Me)return"--";const en=parseInt(Me==null?void 0:Me.split(":")[0]),an=parseInt(Me==null?void 0:Me.split(":")[1]);return`${en}h ${an}m`}m.useEffect(()=>{(async()=>{var Nt,Yn;const en=window.localStorage.getItem("hyperToken"),an=window.localStorage.getItem("hyperAddress");if(!(!en||!an))try{const xn=await Ei(an.toLowerCase(),en);xn!=null&&xn.success?(L(xn==null?void 0:xn.telegram_chat_id),z(xn==null?void 0:xn.subscriber_role),Q(xn==null?void 0:xn.subs_expire_day),ne((Nt=xn==null?void 0:xn.mushboomer_counts)==null?void 0:Nt.eth),J((Yn=xn==null?void 0:xn.mushboomer_counts)==null?void 0:Yn.sol),X(xn==null?void 0:xn.referral_code),pe(xn==null?void 0:xn.refcode),Y(xn==null?void 0:xn.whitelist),ie(en),oe(an)):(window.localStorage.removeItem("hyperToken"),window.localStorage.removeItem("hyperAddress"),ie(""),oe(""))}catch(xn){console.error("Token verification error:",xn),console.error(xn.message||"An unknown error occurred.")}})()},[]);const We={kBONK:"BONK",kPEPE:"PEPE",kSHIB:"SHIB",kFLOKI:"FLOKI",kNEIRO:"NEIRO",kDOGS:"DOGS",kLUNC:"LUNC"};m.useEffect(()=>{(async()=>{var en,an;try{const Yn=await(await fetch("https://dextrabothypev2.nftinit.io/api/hyper/get_coins/")).json(),xn=()=>xi.random().hex(),Mt=(an=(en=Yn.coins)==null?void 0:en.filter(tn=>!tn.startsWith("@")&&!tn.endsWith("/USDC")))==null?void 0:an.map(tn=>({value:tn,label:tn.endsWith("/USDC")?tn+" (Spot)":tn,color:xn(),icon:`https://app.hyperliquid.xyz/coins/${We[tn]||(tn==null?void 0:tn.split("/")[0])}.svg`}));ut(Mt),It(!1)}catch(Nt){console.error("Data retrieval error:",Nt),It(!1)}})()},[]),m.useEffect(()=>{(async()=>{var en,an;try{const Yn=await(await fetch("https://dextrabothypev2.nftinit.io/api/hyper/get_refcodes/")).json(),xn=()=>xi.random().hex(),Mt=(an=(en=Yn==null?void 0:Yn.refcodes)==null?void 0:en.filter(tn=>tn.code!=="DEXTRABOT"))==null?void 0:an.slice(0,1300).map(tn=>({value:tn.code,label:tn.code,color:xn()}));un(Mt),Ke(!1)}catch(Nt){console.error("Data retrieval error:",Nt),Ke(!1)}})()},[]);const at=Me=>{const en=["Growth Rate","Drawdown","Drawdown PnL","Sharpe"],an=[{header:"Popular Wallet",value:Nt=>{const Yn=Number(Nt.copier_count)||0;return Yn===0?"":Yn<=5?"F":Yn<=10?"FF":"FFF"}},{header:"Wallet",value:Nt=>Nt.user_token},{header:"PnL",value:Nt=>(Nt==null?void 0:Nt[zt])==null||isNaN(+(Nt==null?void 0:Nt[zt]))?"--":`$${Fs(Nt==null?void 0:Nt[zt])}`},{header:"uPnL",value:Nt=>Nt.total_unrealized_pnl==null||isNaN(+Nt.total_unrealized_pnl)?"--":`$${Fs(Nt.total_unrealized_pnl)}`},{header:"Perp Equity",value:Nt=>Nt.portfolio_perp_all_time_value==null||isNaN(+Nt.portfolio_perp_all_time_value)?"--":`$${Fs(Math.abs(Nt.portfolio_perp_all_time_value))}`},{header:"Win Rate",value:Nt=>Nt.win_complated_rate==null||isNaN(+Nt.win_complated_rate)||Me==999?"--":`%${Math.abs(Nt.win_complated_rate)}`},{header:"Trades Count",value:Nt=>Nt.complated_trades_count==null||isNaN(+Nt.complated_trades_count)||Me==999?"--":`${Fs(Math.abs(Nt.complated_trades_count))}`},{header:"Win Count",value:Nt=>Nt.complated_win_count==null||isNaN(+Nt.complated_win_count)||Me==999?"--":`${Fs(Math.abs(Nt.complated_win_count))}`},{header:"Loss Count",value:Nt=>Nt.complated_loss_count==null||isNaN(+Nt.complated_loss_count)?"--":`${Fs(Math.abs(Nt.complated_loss_count))}`},{header:"Long PnL",value:Nt=>Nt.long_kar==null||isNaN(+Nt.long_kar)||Me==999?"--":`$${Fs(Math.abs(Nt.long_kar))}`},{header:"Short PnL",value:Nt=>Nt.short_kar==null||isNaN(+Nt.short_kar)||Me==999?"--":`$${Fs(Nt.short_kar)}`},{header:"Growth Rate",value:Nt=>(Nt==null?void 0:Nt[nt])==null||isNaN(+(Nt==null?void 0:Nt[nt]))||Me==1||Me==999?"--":`%${Fs(Nt==null?void 0:Nt[nt])}`},{header:"Drawdown",value:Nt=>(Nt==null?void 0:Nt[Et])==null||isNaN(+(Nt==null?void 0:Nt[Et]))||Me==999?"--":`%${Fs(Nt==null?void 0:Nt[Et])}`},{header:"Sharpe",value:Nt=>(Nt==null?void 0:Nt[Ue])==null||isNaN(+(Nt==null?void 0:Nt[Ue]))||Me==999?"--":`${Nt==null?void 0:Nt[Ue]}`},{header:"Tx Count",value:Nt=>Nt.rtx_count==null||isNaN(+Nt.rtx_count)||Me==999?"--":`${Fs(Nt.rtx_count)}`},{header:"ROE (%)",value:Nt=>Nt.margin_roi==null||isNaN(+Nt.margin_roi)?"--":`${Fs(Nt.margin_roi)}%`},{header:"Margin / Used",value:Nt=>Nt.margin_used==null||isNaN(+Nt.margin_used)||Nt.margin_percentage==null||isNaN(+Nt.margin_percentage)?"--":`${Fs(Nt.margin_used)} / %${parseFloat(Nt.margin_percentage).toFixed(2)}`},{header:"Avg. Lvg.",value:Nt=>Nt.avg_uleverage_value==null||isNaN(+Nt.avg_uleverage_value)?"--":`${parseFloat(Nt.avg_uleverage_value).toFixed(2)}x`},{header:"Funding",value:Nt=>Nt.funding==null||isNaN(+Nt.funding)?"--":`$${Fs(Nt.funding)}`},{header:"rToken #",value:Nt=>Nt.token_count==null||isNaN(+Nt.token_count)||Me==999?"--":Fs(Nt.token_count)},{header:"uToken #",value:Nt=>Nt.position_count==null||isNaN(+Nt.position_count)?"--":Fs(Nt.position_count)},{header:"Avg. Dur.",value:Nt=>Me==999?"--":`${Rt(Nt.complated_avg_duration)}`},{header:"First Tx Time",value:Nt=>Me==999?"--":FI(Nt.first_time)},{header:"Last Tx Time",value:Nt=>Me==999?"--":FI(Nt.end_time)}];return Me===1?an.filter(Nt=>!en.includes(Nt.header)):an},mt=()=>{if(!(f!=null&&f.length))return;const Me=new Date,en=Xn=>Xn.toString().padStart(2,"0"),an=`discoverwallet_${en(Me.getDate())}${en(Me.getMonth()+1)}${Me.getFullYear()}_${en(Me.getHours())}${en(Me.getMinutes())}.csv`,Nt=at(a),Yn=Nt.map(Xn=>`"${Xn.header}"`).join(","),xn=f==null?void 0:f.map(Xn=>Nt==null?void 0:Nt.map(or=>`"${or.value(Xn)}"`).join(",")),Mt=new Blob([Yn+`\r
`+xn.join(`\r
`)],{type:"text/csv;charset=utf-8;"}),tn=URL.createObjectURL(Mt);Object.assign(document.createElement("a"),{href:tn,download:an}).click(),URL.revokeObjectURL(tn)},[Dt,Tt]=m.useState("-perp_pnl"),[dn,on]=m.useState({max_first_time:"",min_first_time:"",max_end_time:"",min_end_time:"",max_short_kar:"",min_short_kar:"",max_long_kar:"",min_long_kar:"",max_pnl:"",min_pnl:"",max_uPnl:"",min_uPnl:"",max_rToken_count:"",min_rToken_count:"",max_uToken_count:"",min_uToken_count:"",max_perp_equity:"",min_perp_equity:"",max_margin_used:"",min_margin_used:"",max_margin_used_percentage:"",min_margin_used_percentage:"",max_avg_uLeverage_value:"",min_avg_uLeverage_value:"",max_funding:"",min_funding:"",max_margin_roi:"",min_margin_roi:"",max_rTx_count:"",min_rTx_count:"",max_sharpe:"",min_sharpe:"",max_growth_rate:"",min_growth_rate:"",max_perp_dd:"",min_perp_dd:"",max_perp_dd_pnl:"",min_perp_dd_pnl:"",max_win_complated_rate:"",min_win_complated_rate:"",max_complated_trades_count:"",min_complated_trades_count:"",max_complated_win_count:"",min_complated_win_count:"",max_complated_loss_count:"",min_complated_loss_count:"",user_token:"",coin:"",refcode:"",is_favorite_wallet:""});m.useEffect(()=>{async function Me(){try{v(!0);const en={period:a===999?"all_time":a,order:Dt,offset:t===-50?"0":t.toString(),limit:"50",...dn},an=Object.entries(en).filter(([tn,In])=>In!=null).map(([tn,In])=>`${encodeURIComponent(tn)}=${encodeURIComponent(In)}`).join("&"),Nt=`https://dextradata.nftinit.io/api/hyper/${a==999?"get_wallets_profit_all_time":"get_wallets_profit_new"}/?${an}`,Yn=await fetch(Nt.toString());if(!Yn.ok)throw new Error(`HTTP error! status: ${Yn.status}`);const xn=await Yn.json();r(Math.ceil(xn.count/50)),s(xn.count),e((t+50)/50),window.localStorage.getItem("hyperToken")&&(I(),F()),x(xn.results)}catch(en){x([]),console.error("Error fetching data:",en),C(en.message)}finally{v(!1)}}Me()},[t,Dt,a]);async function gn(Me){try{v(!0);const en={period:a===999?"all_time":a,order:Dt,offset:t===-50?"0":t.toString(),limit:"50",...dn},an=Object.entries(en).filter(([tn,In])=>In!=null).map(([tn,In])=>`${encodeURIComponent(tn)}=${encodeURIComponent(In)}`).join("&"),Nt=`https://dextradata.nftinit.io/api/hyper/${a==999?"get_wallets_profit_all_time":"get_wallets_profit_new"}/?${an}`,Yn=await fetch(Nt);if(!Yn.ok)throw new Error(`HTTP error! status: ${Yn.status}`);const xn=await Yn.json();e(1),r(Math.ceil(xn.count/50)),s(xn.count),n(0),window.localStorage.getItem("hyperToken")&&(I(),F()),x(xn.results)}catch(en){x([]),console.error("Error fetching data:",en),C(en.message)}finally{v(!1)}}async function Nn(Me){try{v(!0);const en=await fetch(`https://dextradata.nftinit.io/api/hyper/${a==999?"get_wallets_profit_all_time":"get_wallets_profit_new"}/?period=${a==999?"all_time":a}&order=${Dt}&offset=0&limit=50`);if(!en.ok)throw new Error(`HTTP error! status: ${en.status}`);const an=await en.json();e(50/50),r(Math.ceil(an.count/50)),s(an.count),n(0),x(an.results),window.localStorage.getItem("hyperToken")&&(I(),F()),on({max_first_time:"",min_first_time:"",max_end_time:"",min_end_time:"",max_short_kar:"",min_short_kar:"",max_long_kar:"",min_long_kar:"",max_pnl:"",min_pnl:"",max_uPnl:"",min_uPnl:"",max_rToken_count:"",min_rToken_count:"",max_uToken_count:"",min_uToken_count:"",max_perp_equity:"",min_perp_equity:"",max_margin_used:"",min_margin_used:"",max_margin_used_percentage:"",min_margin_used_percentage:"",max_avg_uLeverage_value:"",min_avg_uLeverage_value:"",max_funding:"",min_funding:"",max_margin_roi:"",min_margin_roi:"",max_rTx_count:"",min_rTx_count:"",max_sharpe:"",min_sharpe:"",max_growth_rate:"",min_growth_rate:"",max_perp_dd:"",min_perp_dd:"",max_perp_dd_pnl:"",min_perp_dd_pnl:"",max_win_complated_rate:"",min_win_complated_rate:"",max_complated_trades_count:"",min_complated_trades_count:"",max_complated_win_count:"",min_complated_win_count:"",max_complated_loss_count:"",min_complated_loss_count:"",user_token:"",coin:"",refcode:"",is_favorite_wallet:""}),Ie(""),Qe(""),it(""),lt(""),jt([])}catch(en){x([]),console.error("Error resetting filters:",en),C(en.message)}finally{v(!1)}}const kn=async({walletAddress:Me,isFollow:en,isScalper:an})=>{try{ve(Me);const Nt=window.localStorage.getItem("hyperToken"),Yn=window.localStorage.getItem("hyperAddress");if(!Nt){U(!0);return}const xn=en?"https://dextrabothypev2.nftinit.io/api/test_app/following/info/":"https://dextrabothypev2.nftinit.io/api/hyper/following/get_setting/",Mt=en?{address:V?V.toLowerCase():Yn,token:Nt,follow_address:Me.toLowerCase()}:{address:V?V.toLowerCase():Yn,token:Nt},tn=await fetch(xn,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(Mt)});if(!tn.ok)throw new Error(`Server responded with status ${tn.status}`);const In=await tn.json();In.success?(Ne(Array.isArray(In==null?void 0:In.data)?[...In.data].sort((Xn,or)=>new Date(or.created_at||0)-new Date(Xn.created_at||0)):In==null?void 0:In.data),ge(an),ae(!0)):(console.log(In.error_message),rn.error(In.error_message))}catch(Nt){console.error("Error in like function:",Nt),rn.error(Nt.message||"Something went wrong!")}},yn=Me=>Me>=640&&Me<1024?7:Me>=1024&&Me<1240?6:Me>=1240&&Me<1540?7:Me>=1540?10:4,[Vn,Gn]=m.useState(!1),[Dn,Kn]=m.useState(!1),[Cn,sn]=m.useState({pnl:0,winRate:0,tradeCount:0,longWinRate:0,shortWinRate:0,leverage:0,roe:0,unrealizedPnL:0,referral:""});return i.jsxs(i.Fragment,{children:[i.jsx(LUe,{}),i.jsx(Ern,{open:qe,setOpen:Ye}),i.jsx(w5,{open:ee,setOpen:ae,copyTradeData:fe,setCopyTradeData:Ne,copyTradeWallet:ye,setCopyTradeWallet:ve,isScalper:he}),i.jsx(vsn,{open:Vn,setOpen:Gn,data:Cn,setTradeInfo:sn,period:a}),i.jsx(wsn,{open:Dn,setOpen:Kn,data:Cn,setTradeInfo:sn}),i.jsxs("div",{className:"block lg:hidden w-full p-2 space-y-2",children:[i.jsx(lMe,{}),i.jsx("button",{className:"px-2 py-2 text-xs font-bold rounded-2xl border border-gray-600 text-white hover:bg-[#1D1D1D] bg-[#171717] h-8 font-manrope w-full",onClick:mt,children:"Export CSV"})]}),i.jsx("div",{className:"lg:hidden flex w-full p-2",children:i.jsx("button",{className:"px-2 py-2 text-xs font-medium rounded-2xl border border-gray-600 text-white hover:bg-[#1D1D1D] w-full bg-[#171717]",onClick:()=>Zt(!ht),children:ht?"Hide Filters":"Show Filters"})}),i.jsxs("div",{className:"flex-grow flex flex-col lg:flex-row items-start justify-start gap-2 lg:gap-6 bg-[#161616] w-full h-full overflow-y-scroll pl-1 sm:pl-4 pt-1 sm:pt-4 pr-0.5 pb-3 font-manrope relative",children:[i.jsx("div",{className:`${ht?"block":"hidden"} lg:flex flex-shrink-0 lg:w-auto w-full lg:max-w-none max-w-full h-full`,children:i.jsx(Nrn,{period:a,advancedFilters:dn,setAdvancedFilters:on,resetFilters:Nn,setFilters:gn,minFirstValue:je,setMinFirstValue:Ie,maxFirstValue:Le,setMaxFirstValue:Qe,minEndValue:$e,setMinEndValue:it,maxEndValue:tt,setMaxEndValue:lt,dataCoin:ft,selectedCoins:nn,setSelectedCoins:jt,isLoadingCoin:qt,setIsLoadingCoin:It,dataReferral:cn,selectedReferrals:Bt,setSelectedReferrals:$t,isLoadingReferral:Ft,setIsLoadingReferral:Ke})}),i.jsxs("div",{className:"flex flex-col items-stretch justify-start gap-[10px] bg-[#161616] max-h-full lg:min-w-0 lg:flex-grow max-w-full lg:max-w-none overflow-auto font-manrope",children:[i.jsxs("div",{className:"sticky sm:static top-0 sm:mt-2 flex flex-row sm:flex-col items-center sm:items-start justify-between sm:justify-start gap-2 font-manrope max-w-full w-full bg-[#161616] pl-2 sm:pl-0 pb-2 sm:pb-0 pr-2 sm:pr-0 z-10",children:[i.jsxs("div",{className:"flex flex-col items-start justify-start gap-2 min-w-max mt-[10px] sm:mt-0",children:[i.jsx("div",{className:"text-[#7e7e7e] text-[11px] font-medium font-inter leading-[8px]",children:"Hype / Explore"}),i.jsx("div",{className:"flex items-center justify-start gap-4",children:i.jsx("div",{className:"text-white text-[16px] sm:text-[18px] font-medium font-manrope leading-[21px]",children:"Discover Wallets"})})]}),i.jsxs("div",{className:"flex flex-col sm:flex-row items-end sm:items-center justify-between w-full gap-1 pr-0 sm:pr-2",children:[i.jsx("div",{className:"flex",children:i.jsx(Ice,{periods:o,selectedPeriod:a,handlePeriod:d,borderColor:"discover"})}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(Arn,{offset:t,setOffset:n,totalPage:l,totalWalletCount:c,currentPage:u}),i.jsx("div",{className:"hidden lg:block",children:i.jsx("button",{className:"px-2 py-2 text-xs font-bold rounded-2xl border border-gray-600 text-white hover:bg-[#1D1D1D] bg-[#171717] h-8 font-manrope",onClick:mt,children:"Export CSV"})})]})]})]}),i.jsx("div",{className:"w-full overflow-scroll h-[calc(100vh-200px)] flex-grow bg-[#161616] rounded mt-2 sm:mt-0",children:i.jsxs("table",{className:"w-full relative",children:[i.jsx("thead",{className:"sticky top-0 z-[3] bg-[#161616] whitespace-nowrap",children:i.jsxs("tr",{className:"w-full z-[4] font-semibold leading-[13px] tracking-[0.26px] text-[#9b9b9b] text-[13px] font-manrope mr-10",children:[i.jsx("th",{scope:"col",className:"sm:sticky bg-[#161616] sm:left-0 h-10 pl-2 sm:pl-4 min-w-[130px] sm:min-w-[130px] z-[8]",children:i.jsx("div",{className:"flex items-center justify-start w-full gap-1 min-w-max max-w-max ",children:i.jsx("div",{className:"flex items-center justify-start group",children:"Action"})})}),i.jsx("th",{scope:"col",className:"sm:sticky bg-[#161616] sm:left-[130px] h-10 px-1 min-w-[50px] sm:min-w-[50px] z-[8]",children:i.jsxs("div",{className:"flex justify-start items-center w-full",children:[i.jsx("div",{className:"flex justify-start items-center gap-1",children:i.jsxs("div",{className:"flex justify-start items-center has-tooltip relative",children:["🔥",i.jsx("span",{className:"",children:i.jsx(ro,{content:"🔥🔥🔥 Copytrend indicator. More flames = more followers.",positionTop:!1,alignRight:!1,tooltipCss:"max-w-[215px] min-w-[215px] leading-[16px] -mb-5"})})]})}),i.jsx(Yo,{title:"",sortKey:"copier_count",sortOption:Dt,setSortOption:Tt,isFilterIcon:!1,isFilter:!1})]})}),i.jsx("th",{scope:"col",className:"sm:sticky bg-[#161616] sm:left-[180px] h-10 px-1 min-w-[120px] sm:min-w-[140px] z-[7]",children:i.jsx(Yo,{title:"Wallet",sortKey:"user_token",sortOption:Dt,setSortOption:Tt,isFilterIcon:!1,isFilter:!1})}),i.jsx("th",{scope:"col",className:"min-w-[120px] sm:min-w-[140px] px-1",children:i.jsxs("div",{className:"flex justify-end items-center w-full gap-1",children:[i.jsx("div",{className:"flex justify-end items-center gap-1",children:i.jsxs("div",{className:"hidden justify-end items-center has-tooltip relative",children:[i.jsx(Ni,{className:"text-[#7C7C7C] w-4 min-w-4 min-h-4 h-4"}),i.jsx("span",{className:"",children:i.jsx(ro,{content:"Realized profit/loss from completed trades.",positionTop:!1,alignRight:!1,tooltipCss:"max-w-[200px] min-w-[200px] leading-[16px] -mb-5"})})]})}),i.jsx(Yo,{title:"PnL",sortKey:"perp_pnl",sortOption:Dt,setSortOption:Tt,isFilterIcon:!0,isFilter:!1})]})}),i.jsx("th",{scope:"col",className:"min-w-[140px] sm:min-w-[170px] px-1",children:i.jsxs("div",{className:"flex justify-end items-center w-full gap-1",children:[i.jsx("div",{className:"flex justify-end items-center gap-1 w-full",children:i.jsxs("div",{className:"hidden justify-end items-center has-tooltip relative",children:[i.jsx(Ni,{className:"text-[#7C7C7C] w-4 min-w-4 min-h-4 h-4"}),i.jsx("span",{className:"",children:i.jsx(Fa,{content:"Snapshot data per hour",positionTop:!1,alignRight:!1})})]})}),i.jsx(Yo,{title:"uPnL",sortKey:"total_unrealized_pnl",sortOption:Dt,setSortOption:Tt,isFilterIcon:!0,isFilter:!1})]})}),i.jsx("th",{scope:"col",className:"min-w-[150px] sm:min-w-[170px] px-1",children:i.jsxs("div",{className:"flex justify-end items-center w-full gap-1",children:[i.jsx("div",{className:"flex justify-end items-center gap-1 w-full",children:i.jsxs("div",{className:"hidden justify-end items-center has-tooltip relative",children:[i.jsx(Ni,{className:"text-[#7C7C7C] w-4 min-w-4 min-h-4 h-4"}),i.jsx("span",{className:"",children:i.jsx(Fa,{content:"Snapshot data per hour",positionTop:!1,alignRight:!1})})]})}),i.jsx(Yo,{title:"Perp Equity",sortKey:"portfolio_perp_all_time_value",sortOption:Dt,setSortOption:Tt,isFilterIcon:!0,isFilter:!1})]})}),i.jsx("th",{scope:"col",className:`${a==999?"hidden":"min-w-[140px] sm:min-w-[165px] px-1"}`,children:i.jsxs("div",{className:"flex justify-end items-center w-full gap-1",children:[i.jsx("div",{className:"flex justify-end items-center gap-1 w-full",children:i.jsxs("div",{className:"hidden justify-end items-center has-tooltip relative",children:[i.jsx(Ni,{className:"text-[#7C7C7C] w-4 min-w-4 min-h-4 h-4"}),i.jsx("span",{className:"",children:i.jsx(Fa,{content:"Snapshot data per hour",positionTop:!1,alignRight:!1})})]})}),i.jsx(Yo,{title:"Win Rate",sortKey:"win_complated_rate",sortOption:Dt,setSortOption:Tt,isFilterIcon:!0,isFilter:!1})]})}),i.jsx("th",{scope:"col",className:`${a==999?"hidden":"min-w-[170px] sm:min-w-[200px] px-1"} `,children:i.jsxs("div",{className:"flex justify-end items-center w-full gap-1",children:[i.jsx("div",{className:"flex justify-end items-center gap-1 w-full",children:i.jsxs("div",{className:"hidden justify-end items-center has-tooltip relative",children:[i.jsx(Ni,{className:"text-[#7C7C7C] w-4 min-w-4 min-h-4 h-4"}),i.jsx("span",{className:"",children:i.jsx(Fa,{content:"Snapshot data per hour",positionTop:!1,alignRight:!1})})]})}),i.jsx(Yo,{title:"Total/Win/Loss",sortKey:"complated_trades_count",sortOption:Dt,setSortOption:Tt,isFilterIcon:!0,isFilter:!1})]})}),i.jsx("th",{scope:"col",className:`${a==999?"hidden":"min-w-[130px] sm:min-w-[160px] px-1"} `,children:i.jsxs("div",{className:"flex justify-end items-center w-full gap-1",children:[i.jsx("div",{className:"flex justify-end items-center gap-1 w-full",children:i.jsxs("div",{className:"hidden justify-end items-center has-tooltip relative",children:[i.jsx(Ni,{className:"text-[#7C7C7C] w-4 min-w-4 min-h-4 h-4"}),i.jsx("span",{className:"",children:i.jsx(Fa,{content:"Snapshot data per hour",positionTop:!1,alignRight:!1})})]})}),i.jsx(Yo,{title:"Long PnL",sortKey:"long_kar",sortOption:Dt,setSortOption:Tt,isFilterIcon:!0,isFilter:!1})]})}),i.jsx("th",{scope:"col",className:`${a==999?"hidden":"min-w-[130px] sm:min-w-[160px] px-1"} `,children:i.jsxs("div",{className:"flex justify-end items-center w-full gap-1",children:[i.jsx("div",{className:"flex justify-end items-center gap-1 w-full",children:i.jsxs("div",{className:"hidden justify-end items-center has-tooltip relative",children:[i.jsx(Ni,{className:"text-[#7C7C7C] w-4 min-w-4 min-h-4 h-4"}),i.jsx("span",{className:"",children:i.jsx(Fa,{content:"Snapshot data per hour",positionTop:!1,alignRight:!1})})]})}),i.jsx(Yo,{title:"Short PnL",sortKey:"short_kar",sortOption:Dt,setSortOption:Tt,isFilterIcon:!0,isFilter:!1})]})}),i.jsx("th",{scope:"col",className:`${a==1||a==999?"min-w-[120px] sm:min-w-[150px] px-1":"min-w-[150px] sm:min-w-[170px] px-1"} `,children:i.jsxs("div",{className:"flex justify-end items-center w-full gap-1",children:[i.jsx("div",{className:"flex justify-end items-center gap-1 w-full",children:i.jsxs("div",{className:`${a==1||a==999?"flex":"hidden"} justify-end items-center has-tooltip relative`,children:[i.jsx(Ni,{className:"text-[#7C7C7C] w-4 min-w-4 min-h-4 h-4"}),i.jsx("span",{className:"",children:i.jsx(ro,{content:"Available for 7, 30, 90 days",positionTop:!1,alignRight:!1,tooltipCss:"max-w-[180px] min-w-[180px] leading-[16px] h-10 -mb-2"})})]})}),a==1||a==999?i.jsx("div",{className:"flex items-center justify-start",children:"Growth Rate"}):i.jsx(Yo,{title:"Growth Rate",sortKey:"growth_rate",sortOption:Dt,setSortOption:Tt,isFilterIcon:!0,isFilter:!1})]})}),i.jsx("th",{scope:"col",className:`${a==1||a==999?"min-w-[120px] sm:min-w-[140px] px-1":"min-w-[140px] sm:min-w-[160px] px-1"} `,children:i.jsxs("div",{className:"flex justify-end items-center w-full gap-1",children:[i.jsx("div",{className:"flex justify-end items-center gap-1 w-full",children:i.jsxs("div",{className:`${a==1||a==999?"flex":"hidden"} justify-end items-center has-tooltip relative`,children:[i.jsx(Ni,{className:"text-[#7C7C7C] w-4 min-w-4 min-h-4 h-4"}),i.jsx("span",{className:"",children:i.jsx(ro,{content:"Available for 7, 30, 90 days",positionTop:!1,alignRight:!1,tooltipCss:"max-w-[180px] min-w-[180px] leading-[16px] h-10 -mb-2"})})]})}),a==1||a==999?i.jsx("div",{className:"flex items-center justify-start",children:"Drawdown"}):i.jsx(Yo,{title:"Drawdown",sortKey:"perp_dd",sortOption:Dt,setSortOption:Tt,isFilterIcon:!0,isFilter:!1})]})}),i.jsx("th",{scope:"col",className:`${a==1||a==999?"min-w-[100px] sm:min-w-[120px] px-1":"min-w-[120px] sm:min-w-[145px] px-1"} `,children:i.jsxs("div",{className:"flex justify-end items-center w-full gap-1",children:[i.jsx("div",{className:"flex justify-end items-center gap-1 w-full",children:i.jsxs("div",{className:"flex justify-end items-center has-tooltip relative",children:[i.jsx(Ni,{className:"text-[#7C7C7C] w-4 min-w-4 min-h-4 h-4"}),i.jsx("span",{className:"",children:i.jsx(ro,{content:a==1||a==999?"Available for 7, 30, 90 days":"Sharpe_tooltip",positionTop:!1,alignRight:!1,tooltipCss:a==1||a==999?"max-w-[180px] min-w-[180px] leading-[16px] h-10 -mb-2":"max-w-[80px] min-w-[80px] leading-[16px] -mb-12"})})]})}),a==1||a==999?i.jsx("div",{className:"flex items-center justify-start",children:"Sharpe"}):i.jsx(Yo,{title:"Sharpe",sortKey:"sharpe",sortOption:Dt,setSortOption:Tt,isFilterIcon:!0,isFilter:!1})]})}),i.jsx("th",{scope:"col",className:`${a==999?"hidden":"min-w-[130px] sm:min-w-[150px] px-1"} `,children:i.jsxs("div",{className:"flex justify-end items-center w-full gap-1",children:[i.jsx("div",{className:"flex justify-end items-center gap-1 w-full",children:i.jsxs("div",{className:"hidden justify-end items-center has-tooltip relative",children:[i.jsx(Ni,{className:"text-[#7C7C7C] w-4 min-w-4 min-h-4 h-4"}),i.jsx("span",{className:"",children:i.jsx(Fa,{content:"Snapshot data per hour",positionTop:!1,alignRight:!1})})]})}),i.jsx(Yo,{title:"Tx Count",sortKey:"rtx_count",sortOption:Dt,setSortOption:Tt,isFilterIcon:!0,isFilter:!1})]})}),i.jsx("th",{scope:"col",className:"min-w-[110px] sm:min-w-[135px] px-1",children:i.jsxs("div",{className:"flex justify-end items-center w-full gap-1",children:[i.jsx("div",{className:"flex justify-end items-center gap-1 w-full",children:i.jsxs("div",{className:"hidden justify-end items-center has-tooltip relative",children:[i.jsx(Ni,{className:"text-[#7C7C7C] w-4 min-w-4 min-h-4 h-4"}),i.jsx("span",{className:"",children:i.jsx(Fa,{content:"Snapshot data per hour",positionTop:!1,alignRight:!1})})]})}),i.jsx(Yo,{title:"ROE",sortKey:"margin_roi",sortOption:Dt,setSortOption:Tt,isFilterIcon:!0,isFilter:!1})]})}),i.jsx("th",{scope:"col",className:"min-w-[125px] sm:min-w-[150px] px-1",children:i.jsxs("div",{className:"flex justify-end items-center w-full gap-1",children:[i.jsx("div",{className:"flex justify-end items-center gap-1 w-full",children:i.jsxs("div",{className:"hidden justify-end items-center has-tooltip relative",children:[i.jsx(Ni,{className:"text-[#7C7C7C] w-4 min-w-4 min-h-4 h-4"}),i.jsx("span",{className:"",children:i.jsx(Fa,{content:"Snapshot data per hour",positionTop:!1,alignRight:!1})})]})}),i.jsx(Yo,{title:"Margin",sortKey:"margin_percentage",sortOption:Dt,setSortOption:Tt,isFilterIcon:!0,isFilter:!1})]})}),i.jsx("th",{scope:"col",className:"min-w-[130px] sm:min-w-[150px] px-1",children:i.jsxs("div",{className:"flex justify-end items-center w-full gap-1",children:[i.jsx("div",{className:"flex justify-end items-center gap-1 w-full",children:i.jsxs("div",{className:"hidden justify-end items-center has-tooltip relative",children:[i.jsx(Ni,{className:"text-[#7C7C7C] w-4 min-w-4 min-h-4 h-4"}),i.jsx("span",{children:i.jsx(Fa,{content:"Snapshot data per hour",positionTop:!1,alignRight:!1})})]})}),i.jsx(Yo,{title:"Avg. Lvg.",sortKey:"avg_uleverage_value",sortOption:Dt,setSortOption:Tt,isFilterIcon:!0,isFilter:!1})]})}),i.jsx("th",{scope:"col",className:"min-w-[125px] sm:min-w-[155px] px-1",children:i.jsxs("div",{className:"flex justify-end items-center w-full gap-1",children:[i.jsx("div",{className:"flex justify-end items-center gap-1 w-full",children:i.jsxs("div",{className:"hidden justify-end items-center has-tooltip relative",children:[i.jsx(Ni,{className:"text-[#7C7C7C] w-4 min-w-4 min-h-4 h-4"}),i.jsx("span",{className:"",children:i.jsx(Fa,{content:"Snapshot data per hour",positionTop:!1,alignRight:!1})})]})}),i.jsx(Yo,{title:"Funding",sortKey:"funding",sortOption:Dt,setSortOption:Tt,isFilterIcon:!0,isFilter:!1})]})}),i.jsx("th",{scope:"col",className:`${a==999?"hidden":"min-w-[130px] sm:min-w-[150px] pr-1"} `,children:i.jsxs("div",{className:"flex justify-end items-center w-full gap-1",children:[i.jsx("div",{className:"flex justify-end items-center gap-1 w-full",children:i.jsxs("div",{className:"hidden justify-end items-center has-tooltip relative",children:[i.jsx(Ni,{className:"text-[#7C7C7C] w-4 min-w-4 min-h-4 h-4"}),i.jsx("span",{className:"",children:i.jsx(Fa,{content:"Snapshot data per hour",positionTop:!1,alignRight:!1})})]})}),i.jsx(Yo,{title:"rToken #",sortKey:"token_count",sortOption:Dt,setSortOption:Tt,isFilterIcon:!0,isFilter:!1})]})}),i.jsx("th",{scope:"col",className:`${a==999?"min-w-[120px] sm:min-w-[150px] pl-1 pr-7":"min-w-[120px] sm:min-w-[150px] pr-1"}`,children:i.jsxs("div",{className:"flex justify-end items-center w-full gap-1",children:[i.jsx("div",{className:"flex justify-end items-center gap-1 w-full",children:i.jsxs("div",{className:"hidden justify-end items-center has-tooltip relative",children:[i.jsx(Ni,{className:"text-[#7C7C7C] w-4 min-w-4 min-h-4 h-4"}),i.jsx("span",{className:"",children:i.jsx(Fa,{content:"Snapshot data per hour",positionTop:!1,alignRight:!1})})]})}),i.jsx(Yo,{title:"uToken #",sortKey:"position_count",sortOption:Dt,setSortOption:Tt,isFilterIcon:!0,isFilter:!1})]})}),i.jsx("th",{scope:"col",className:`${a==999?"hidden":"min-w-[120px] sm:min-w-[150px] pr-1"} `,children:i.jsxs("div",{className:"flex justify-end items-center w-full gap-1",children:[i.jsx("div",{className:"flex justify-end items-center gap-1 w-full",children:i.jsxs("div",{className:"hidden justify-end items-center has-tooltip relative",children:[i.jsx(Ni,{className:"text-[#7C7C7C] w-4 min-w-4 min-h-4 h-4"}),i.jsx("span",{className:"",children:i.jsx(Fa,{content:"Snapshot data per hour",positionTop:!1,alignRight:!1})})]})}),i.jsx(Yo,{title:"Avg. Dur.",sortKey:"complated_avg_duration",sortOption:Dt,setSortOption:Tt,isFilterIcon:!0,isFilter:!1})]})}),i.jsx("th",{scope:"col",className:`${a==999?"hidden":"min-w-[140px] sm:min-w-[160px] pl-1 pr-1.5"} `,children:i.jsx(Yo,{title:"First Tx Time",sortKey:"first_time",sortOption:Dt,setSortOption:Tt,isFilterIcon:!0,isFilter:!1})}),i.jsx("th",{scope:"col",className:`${a==999?"hidden":"min-w-[150px] sm:min-w-[180px] pl-1 pr-7"} `,children:i.jsx(Yo,{title:"Last Tx Time",sortKey:"end_time",sortOption:Dt,setSortOption:Tt,isFilterIcon:!0,isFilter:!1})})]})}),i.jsx("tbody",{children:!f||g?i.jsx("tr",{className:"text-center w-full h-full",children:i.jsx("td",{colSpan:yn(window.innerWidth),className:"h-[30vh]",children:i.jsx("div",{className:"flex min-h-[46vh] lg:min-h-[66vh] flex-col justify-center items-center fixed top-[20%] lg:top-[25%] left-[45%] sm:left-[50%] lg:left-[60%] 2xl:left-[55%] z-10",children:i.jsx(Da,{})})})}):w&&!f?i.jsx("tr",{className:"text-center w-full h-full",children:i.jsx("td",{colSpan:yn(window.innerWidth),className:"h-[30vh]",children:i.jsx("div",{className:"flex min-h-[46vh] lg:min-h-[66vh] flex-col justify-center items-center fixed top-[20%] lg:top-[25%] left-[45%] sm:left-[50%] lg:left-[60%] 2xl:left-[55%] z-10",children:i.jsx(Error,{})})})}):(f==null?void 0:f.length)==0?i.jsx("tr",{className:"text-center w-full h-full",children:i.jsx("td",{colSpan:yn(window.innerWidth),className:"h-[30vh]",children:!ht&&i.jsx("div",{className:"flex flex-col justify-center items-center fixed top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2",children:i.jsx(EUe,{})})})}):f&&(f==null?void 0:f.map((Me,en)=>i.jsxs(Ae.Fragment,{children:[i.jsxs("tr",{className:`${en%2==0?"bg-[#1b1b1b]":"bg-[#1f1f1f]"} relative group hover:bg-[#222222] h-[56px] max-h-[56px] text-white rounded-2xl`,style:{margin:"2px"},children:[i.jsx("td",{scope:"row",className:`${en%2==0?"bg-[#1b1b1b]":"bg-[#1f1f1f]"} sm:sticky sm:left-0 z-[2] group-hover:bg-[#222222] sm:rounded-l-2xl`,children:i.jsx("div",{className:"group-hover:bg-[#222222] flex justify-start items-center gap-2 pl-2 sm:pl-4 h-14 max-h-14 rounded-2xl",children:i.jsxs("div",{className:"flex justify-start items-center gap-1.5",children:[i.jsx("div",{onClick:an=>{an.preventDefault();const Nt=P==null?void 0:P.some(Yn=>Yn.wallet_address===(Me==null?void 0:Me.user_token));kn({walletAddress:Me==null?void 0:Me.user_token,isFollow:Nt,isScalper:Me==null?void 0:Me.is_scalper})},className:`
${P.some(an=>an.wallet_address===(Me==null?void 0:Me.user_token))?"bg-[#67ffbd] text-[#161616] font-semibold":"border border-[#67ffbd] bg-[#161616] text-[#67ffbd] hover:bg-[#67ffbd] hover:text-[#161616] font-bold"}
h-[22px] rounded-[256px] justify-center items-center gap-1 inline-flex cursor-pointer text-xs font-['Manrope'] leading-[8px] tracking-tight px-2 min-w-max`,children:"Copy Trade"}),i.jsx(v5,{walletAddress:Me==null?void 0:Me.user_token,children:i.jsx("div",{className:"w-[18px] h-[18px] justify-center items-center flex cursor-pointer",children:R.some(an=>an.wallet_address===(Me==null?void 0:Me.user_token))?i.jsx("img",{src:o5,alt:"",className:"w-3.5 h-3.5 min-w-3.5 min-h-3.5"}):i.jsx("img",{src:NA,alt:"",className:"w-3.5 h-3.5 min-w-3.5 min-h-3.5"})})})]})})}),i.jsx("td",{scope:"row",className:`${en%2==0?"bg-[#1b1b1b]":"bg-[#1f1f1f]"} sm:sticky sm:left-[130px] z-[2] group-hover:bg-[#222222]`,children:i.jsx("div",{className:"group-hover:bg-[#222222] flex justify-start items-center gap-2 h-14 max-h-14",children:i.jsx("div",{className:"flex justify-start items-center gap-1.5 mr-6 sm:mr-0",children:i.jsx("div",{className:"pl-2 pr-2 flex flex-col gap-2 font-manrope hover:scale-125 transition-transform duration-150 cursor-pointer",children:i.jsxs("div",{className:"flex items-center justify-end gap-[3px]",children:[i.jsx("div",{className:`${Me!=null&&Me.is_favorite_wallet?"":"hidden"} relative w-1 h-[16px] bg-[#4a3131] rounded-md`,children:i.jsx("div",{className:`${(Me==null?void 0:Me.copier_count)>=1&&(Me==null?void 0:Me.copier_count)<=5?"bg-[#FFAA22] shadow-[0px_2px_4px_0px_rgba(255,170,34,0.32)]":(Me==null?void 0:Me.copier_count)>5&&(Me==null?void 0:Me.copier_count)<=10?"bg-[#FF8C00] shadow-[0px_2px_4px_0px_rgba(255,140,0,0.32)]":(Me==null?void 0:Me.copier_count)>10?"bg-gradient-to-b from-[#ff0000] to-[#ff8c00] shadow-[0px_2px_4px_0px_rgba(255,45,45,0.32)]":"bg-[#FF8C00] shadow-[0px_2px_4px_0px_rgba(255,140,0,0.32)]"} absolute bottom-0 w-full rounded-md`,style:{height:`${(Me==null?void 0:Me.copier_count)>=1&&(Me==null?void 0:Me.copier_count)<=5?25:(Me==null?void 0:Me.copier_count)>5&&(Me==null?void 0:Me.copier_count)<=10?50:(Me==null?void 0:Me.copier_count)>10?100:0}%`,transition:"height 0.3s ease"}})}),i.jsx("span",{className:"text-[14px] text-white font-semibold font-manrope leading-[8px]",children:Me!=null&&Me.is_favorite_wallet?"🔥":""})]})})})})}),i.jsx("td",{scope:"row",className:`${en%2==0?"bg-[#1b1b1b]":"bg-[#1f1f1f]"} sm:sticky sm:left-[180px] z-[2] group-hover:bg-[#222222]`,children:i.jsx("div",{onClick:()=>{window.open(`/wallet-details/${Me==null?void 0:Me.user_token}`,"_blank")},className:"cursor-pointer group-hover:bg-[#222222] flex justify-start items-center gap-2 h-14 max-h-14",children:i.jsxs("div",{className:"flex justify-start items-center gap-1.5 mr-6 sm:mr-0",children:[i.jsx(aa,{info1:`${(Me==null?void 0:Me.user_token).slice(0,5)+"..."+(Me==null?void 0:Me.user_token).slice(-4)}`,info1_Color:"text-white",rowTwo:!1}),i.jsx("img",{onClick:an=>{an.stopPropagation(),navigator.clipboard.writeText(Me==null?void 0:Me.user_token),rn.success("Successfully copied.",{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(103, 255, 189, 0.16)",width:"280px",minWidth:"280px",height:"40px",backdropFilter:"blur(16px)"},iconTheme:{primary:"#67FFBD",secondary:"#276047"}})},src:wo,alt:"",className:"cursor-pointer"})]})})}),i.jsx("td",{className:"",children:i.jsxs("div",{onClick:an=>{an.preventDefault(),(Me==null?void 0:Me[zt])!=null&&!isNaN(parseFloat(Me==null?void 0:Me[zt]))&&(sn(Nt=>({...Nt,pnl:Me==null?void 0:Me[zt],winRate:Me==null?void 0:Me.win_complated_rate,tradeCount:Me==null?void 0:Me.rtx_count,longWinRate:Me==null?void 0:Me.long_win_rate,shortWinRate:Me==null?void 0:Me.short_win_rate,roe:Me==null?void 0:Me.margin_roi,referral:window.localStorage.getItem("hyperToken")?re:null})),Gn(!0))},className:`${(Me==null?void 0:Me[zt])!=null&&!isNaN(parseFloat(Me==null?void 0:Me[zt]))?"cursor-pointer":""} flex justify-end items-center gap-1 min-w-max px-1`,children:[i.jsx(aa,{info1:`$${Fs(Math.abs(Me==null?void 0:Me[zt]))}`,info1_Color:`${(Me==null?void 0:Me[zt])==null||isNaN(parseFloat(Me==null?void 0:Me[zt]))||(Me==null?void 0:Me[zt])==0?"text-white":(Me==null?void 0:Me[zt])>0?"text-[#1DE6A3]":"text-[#FF7173]"}`,rowTwo:!1}),(Me==null?void 0:Me[zt])!=null&&!isNaN(parseFloat(Me==null?void 0:Me[zt]))&&i.jsx("div",{className:"flex justify-center items-center rounded",children:i.jsx("img",{src:gm,alt:"",className:"w-[14px] h-[14px] min-w-[14px] min-h-[14px]"})})]})}),i.jsx("td",{className:"",children:i.jsxs("div",{onClick:an=>{an.preventDefault(),(Me==null?void 0:Me.total_unrealized_pnl)!=null&&!isNaN(parseFloat(Me==null?void 0:Me.total_unrealized_pnl))&&(sn(Nt=>({...Nt,pnl:Me==null?void 0:Me[zt],unrealizedPnL:Me==null?void 0:Me.total_unrealized_pnl,roe:Me==null?void 0:Me.margin_roi,leverage:Me==null?void 0:Me.avg_uleverage_value,referral:N?re:null})),Kn(!0))},className:`${(Me==null?void 0:Me.total_unrealized_pnl)!=null&&!isNaN(parseFloat(Me==null?void 0:Me.total_unrealized_pnl))?"cursor-pointer":""} flex justify-end items-center gap-1 min-w-max px-1`,children:[i.jsx(aa,{info1:(Me==null?void 0:Me.total_unrealized_pnl)==null||isNaN(parseFloat(Me==null?void 0:Me.total_unrealized_pnl))?"--":`$${Fs(Math.abs(Me==null?void 0:Me.total_unrealized_pnl))}`,info1_Color:`${(Me==null?void 0:Me.total_unrealized_pnl)==null||isNaN(parseFloat(Me==null?void 0:Me.total_unrealized_pnl))||(Me==null?void 0:Me.total_unrealized_pnl)==0?"text-white":(Me==null?void 0:Me.total_unrealized_pnl)>0?"text-[#1DE6A3]":"text-[#FF7173]"}`,rowTwo:!1}),(Me==null?void 0:Me.total_unrealized_pnl)!=null&&!isNaN(parseFloat(Me==null?void 0:Me.total_unrealized_pnl))&&i.jsx("div",{className:"flex justify-center items-center rounded",children:i.jsx("img",{src:gm,alt:"",className:"w-[14px] h-[14px] min-w-[14px] min-h-[14px]"})})]})}),i.jsx("td",{className:"",children:i.jsx(aa,{info1:(Me==null?void 0:Me.portfolio_perp_all_time_value)==null||isNaN(parseFloat(Me==null?void 0:Me.portfolio_perp_all_time_value))?"--":`$${Fs(Math.abs(Me==null?void 0:Me.portfolio_perp_all_time_value))}`,info1_Color:`${(Me==null?void 0:Me.portfolio_perp_all_time_value)==null||isNaN(parseFloat(Me==null?void 0:Me.portfolio_perp_all_time_value))||(Me==null?void 0:Me.portfolio_perp_all_time_value)==0?"text-white":(Me==null?void 0:Me.portfolio_perp_all_time_value)>0?"text-[#1DE6A3]":"text-[#FF7173]"}`,rowTwo:!1})}),i.jsx("td",{className:`${a==999?"hidden":""}`,children:i.jsx(aa,{info1:(Me==null?void 0:Me.win_complated_rate)==null||isNaN(parseFloat(Me==null?void 0:Me.win_complated_rate))?"--":`${Math.abs(Me==null?void 0:Me.win_complated_rate)}%`,info1_Color:"text-white",rowTwo:!1})}),i.jsx("td",{className:`${a==999?"hidden":""}`,children:i.jsx(Csn,{info1:(Me==null?void 0:Me.complated_trades_count)==null||isNaN(parseFloat(Me==null?void 0:Me.complated_trades_count))?"--":`${Fs(Math.abs(Me==null?void 0:Me.complated_trades_count))}`,info2:(Me==null?void 0:Me.complated_win_count)==null||isNaN(parseFloat(Me==null?void 0:Me.complated_win_count))?"--":`${Fs(Math.abs(Me==null?void 0:Me.complated_win_count))}`,info3:(Me==null?void 0:Me.complated_loss_count)==null||isNaN(parseFloat(Me==null?void 0:Me.complated_loss_count))?"--":`${Fs(Math.abs(Me==null?void 0:Me.complated_loss_count))}`,info1_Color:"text-white",info2_Color:"text-[#1DE6A3]",info3_Color:"text-[#FF7173]",rowTwo:!1})}),i.jsx("td",{className:`${a==999?"hidden":""}`,children:i.jsx(aa,{info1:(Me==null?void 0:Me.long_kar)==null||isNaN(parseFloat(Me==null?void 0:Me.long_kar))?"--":`$${Fs(Math.abs(Me==null?void 0:Me.long_kar))}`,info1_Color:`${(Me==null?void 0:Me.long_kar)==null||isNaN(parseFloat(Me==null?void 0:Me.long_kar))||(Me==null?void 0:Me.long_kar)==0?"text-white":(Me==null?void 0:Me.long_kar)>0?"text-[#1DE6A3]":"text-[#FF7173]"}`,rowTwo:!1})}),i.jsx("td",{className:`${a==999?"hidden":""}`,children:i.jsx(aa,{info1:`$${(Me==null?void 0:Me.short_kar)==null||isNaN(parseFloat(Me==null?void 0:Me.short_kar))?"--":Fs(Math.abs(Me==null?void 0:Me.short_kar))}`,info1_Color:`${(Me==null?void 0:Me.short_kar)==null||isNaN(parseFloat(Me==null?void 0:Me.short_kar))||(Me==null?void 0:Me.short_kar)==0?"text-white":(Me==null?void 0:Me.short_kar)>0?"text-[#1DE6A3]":"text-[#FF7173]"}`,rowTwo:!1})}),i.jsx("td",{children:a==1||a==999?i.jsx("div",{className:"space-y-2 flex justify-end items-center",children:i.jsx(mi,{content:"Available for 7, 30, 90 days",children:i.jsx("div",{className:"text-gray-500 text-sm font-semibold font-manrope leading-[13px] flex items-center justify-end gap-0.5 tracking-[0.28px] w-max pl-16 h-10",children:"--"})})}):i.jsx(aa,{info1:`${a==1||a==999||(Me==null?void 0:Me[nt])==null||isNaN(parseFloat(Me==null?void 0:Me[nt]))||nt=="portfolio_perp_day_growth_rate"?"--":`${Fs(Me==null?void 0:Me[nt])}%`}`,info1_Color:`${a==1||a==999?"text-gray-600":(Me==null?void 0:Me[nt])==null||isNaN(parseFloat(Me==null?void 0:Me[nt]))||nt=="portfolio_perp_day_growth_rate"||(Me==null?void 0:Me[nt])==0?"text-white":(Me==null?void 0:Me[nt])>0?"text-[#1DE6A3]":"text-[#FF7173]"}`,rowTwo:!1})}),i.jsx("td",{children:a==1||a==999?i.jsx("div",{className:"space-y-2 flex justify-end items-center",children:i.jsx(mi,{content:"Available for 7, 30, 90 days",children:i.jsx("div",{className:"text-gray-500 text-sm font-semibold font-manrope leading-[13px] flex items-center justify-end gap-0.5 tracking-[0.28px] w-max pl-16 h-10",children:"--"})})}):i.jsx(aa,{info1:`${a==1||a==999||(Me==null?void 0:Me[Et])==null||isNaN(parseFloat(Me==null?void 0:Me[Et]))||Et=="portfolio_perp_day_dd"?"--":`${Fs(Math.abs(Me==null?void 0:Me[Et]))}%`}`,info1_Color:`${a==1||a==999?"text-gray-600":(Me==null?void 0:Me[Et])==null||isNaN(parseFloat(Me==null?void 0:Me[Et]))||Et=="portfolio_perp_day_dd"||(Me==null?void 0:Me[Et])==0?"text-white":(Me==null?void 0:Me[Et])>0?"text-[#1DE6A3]":"text-[#FF7173]"}`,rowTwo:!1})}),i.jsx("td",{children:a==1||a==999?i.jsx("div",{className:"space-y-2 flex justify-end items-center",children:i.jsx(mi,{content:"Available for 7, 30, 90 days",children:i.jsx("div",{className:"text-gray-500 text-sm font-semibold font-manrope leading-[13px] flex items-center justify-end gap-0.5 tracking-[0.28px] w-max pl-16 h-10",children:"--"})})}):i.jsx(aa,{info1:`${a==1||a==999||(Me==null?void 0:Me[Ue])==null||isNaN(parseFloat(Me==null?void 0:Me[Ue]))||Ue=="portfolio_perp_day_sharpe"?"--":`${Er(Me==null?void 0:Me[Ue])}`}`,info1_Color:`${a==1||a==999?"text-gray-600":(Me==null?void 0:Me[Ue])==null||isNaN(parseFloat(Me==null?void 0:Me[Ue]))||Ue=="portfolio_perp_day_sharpe"?"text-white":(Me==null?void 0:Me[Ue])>=1&&(Me==null?void 0:Me[Ue])<=2?"text-[#E5BB18]":(Me==null?void 0:Me[Ue])>2?"text-[#1DE6A3]":"text-[#FF7173]"}`,rowTwo:!1})}),i.jsx("td",{className:`${a==999?"hidden":""}`,children:i.jsx(aa,{info1:`${(Me==null?void 0:Me.rtx_count)==null||isNaN(parseFloat(Me==null?void 0:Me.rtx_count))?"--":Fs(Me==null?void 0:Me.rtx_count)}`,info1_Color:"text-white",rowTwo:!1})}),i.jsx("td",{children:i.jsx(aa,{info1:`${(Me==null?void 0:Me.margin_roi)==null||isNaN(parseFloat(Me==null?void 0:Me.margin_roi))?"--":`${Fs(Math.abs(Me==null?void 0:Me.margin_roi))}%`}`,info1_Color:`${(Me==null?void 0:Me.margin_roi)==null||isNaN(parseFloat(Me==null?void 0:Me.margin_roi))||(Me==null?void 0:Me.margin_roi)==0?"text-white":(Me==null?void 0:Me.margin_roi)>0?"text-[#1DE6A3]":"text-[#FF7173]"}`,rowTwo:!1})}),i.jsx("td",{children:i.jsx(jrn,{info1:`${(Me==null?void 0:Me.margin_used)==null||isNaN(parseFloat(Me==null?void 0:Me.margin_used))?"--":Fs(Me==null?void 0:Me.margin_used)}`,info2:`${(Me==null?void 0:Me.margin_percentage)==null||isNaN(parseFloat(Me==null?void 0:Me.margin_percentage))?"--":parseFloat(Me==null?void 0:Me.margin_percentage).toFixed(2)+"%"}`,info1_Color:"text-white",info2_Color:"text-[#979797]",rowTwo:!1})}),i.jsx("td",{children:i.jsx(aa,{info1:`${(Me==null?void 0:Me.avg_uleverage_value)==null||isNaN(parseFloat(Me==null?void 0:Me.avg_uleverage_value))?"--":`${parseFloat(Me==null?void 0:Me.avg_uleverage_value).toFixed(2)}x`}`,info1_Color:"text-white",rowTwo:!1})}),i.jsx("td",{children:i.jsx(aa,{info1:`${(Me==null?void 0:Me.funding)==null||isNaN(parseFloat(Me==null?void 0:Me.funding))?"--":`$${Fs(Math.abs(Me==null?void 0:Me.funding))}`}`,info1_Color:`${(Me==null?void 0:Me.funding)==null||isNaN(parseFloat(Me==null?void 0:Me.funding))||(Me==null?void 0:Me.funding)==0?"text-white":(Me==null?void 0:Me.funding)<0?"text-[#1DE6A3]":"text-[#FF7173]"}`,rowTwo:!1})}),i.jsx("td",{className:`${a==999?"hidden":""}`,children:i.jsx("div",{className:"px-1 flex flex-col items-end gap-1",children:i.jsx("div",{className:"text-sm font-medium font-manrope leading-none flex items-center justify-center gap-0.5",children:i.jsxs("div",{className:"has-tooltip relative w-5 h-5",children:[i.jsx("div",{className:"pl-1 pr-2 flex flex-col items-center gap-2 font-manrope w-full h-full has-tooltip",children:i.jsx("div",{className:`${(Me==null?void 0:Me.token_count)>0?"underline underline-offset-2":""} text-white text-sm font-semibold font-manrope leading-[13px] flex items-center justify-end gap-0.5 tracking-[0.28px]`,children:(Me==null?void 0:Me.token_count)==null||isNaN(parseFloat(Me==null?void 0:Me.token_count))?"--":Fs(Me==null?void 0:Me.token_count)})}),(Me==null?void 0:Me.token_count)>0&&i.jsx(Y6e,{content:Me==null?void 0:Me.coins_with_profit,positionTop:!0,alignRight:!1,type:"coin"})]})})})}),i.jsx("td",{className:`${a==999?"pr-6 sm:rounded-r-2xl":""} `,children:i.jsx("div",{className:"px-1 flex flex-col items-end gap-1",children:i.jsx("div",{className:"text-sm font-medium font-manrope leading-none flex items-center justify-center gap-0.5",children:i.jsxs("div",{className:"has-tooltip relative w-5 h-5",children:[i.jsx("div",{className:"pl-1 pr-2 flex flex-col items-center gap-2 font-manrope w-full h-full has-tooltip",children:i.jsx("div",{className:`${(Me==null?void 0:Me.position_count)>0?"underline underline-offset-2":""} text-white text-sm font-semibold font-manrope leading-[13px] flex items-center justify-end gap-0.5 tracking-[0.28px]`,children:(Me==null?void 0:Me.position_count)==null||isNaN(parseFloat(Me==null?void 0:Me.position_count))?"--":Fs(Me==null?void 0:Me.position_count)})}),(Me==null?void 0:Me.position_count)>0&&i.jsx(Y6e,{content:Me==null?void 0:Me.open_positions,positionTop:a!=999,alignRight:!1,type:"position"})]})})})}),i.jsx("td",{className:`${a==999?"hidden":""}`,children:i.jsx(aa,{info1:`${Rt(Me==null?void 0:Me.complated_avg_duration)}`,info1_Color:"text-white",rowTwo:!1})}),i.jsx("td",{className:`${a==999?"hidden":""}`,children:i.jsx(aa,{info1:`${FI(Me==null?void 0:Me.first_time)}`,info1_Color:"text-white",rowTwo:!1})}),i.jsx("td",{className:`${a==999?"hidden":"pr-6 sm:rounded-r-2xl"}`,children:i.jsx(aa,{info1:`${FI(Me==null?void 0:Me.end_time)}`,info1_Color:"text-white",rowTwo:!1})})]}),i.jsx("tr",{children:i.jsx("td",{colSpan:"100",style:{height:"2px"}})})]},en)))})]})})]})]})]})};var LY,rCe;function Nsn(){if(rCe)return LY;rCe=1;var e=typeof Element<"u",t=typeof Map=="function",n=typeof Set=="function",r=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function s(a,o){if(a===o)return!0;if(a&&o&&typeof a=="object"&&typeof o=="object"){if(a.constructor!==o.constructor)return!1;var l,c,u;if(Array.isArray(a)){if(l=a.length,l!=o.length)return!1;for(c=l;c--!==0;)if(!s(a[c],o[c]))return!1;return!0}var d;if(t&&a instanceof Map&&o instanceof Map){if(a.size!==o.size)return!1;for(d=a.entries();!(c=d.next()).done;)if(!o.has(c.value[0]))return!1;for(d=a.entries();!(c=d.next()).done;)if(!s(c.value[1],o.get(c.value[0])))return!1;return!0}if(n&&a instanceof Set&&o instanceof Set){if(a.size!==o.size)return!1;for(d=a.entries();!(c=d.next()).done;)if(!o.has(c.value[0]))return!1;return!0}if(r&&ArrayBuffer.isView(a)&&ArrayBuffer.isView(o)){if(l=a.length,l!=o.length)return!1;for(c=l;c--!==0;)if(a[c]!==o[c])return!1;return!0}if(a.constructor===RegExp)return a.source===o.source&&a.flags===o.flags;if(a.valueOf!==Object.prototype.valueOf&&typeof a.valueOf=="function"&&typeof o.valueOf=="function")return a.valueOf()===o.valueOf();if(a.toString!==Object.prototype.toString&&typeof a.toString=="function"&&typeof o.toString=="function")return a.toString()===o.toString();if(u=Object.keys(a),l=u.length,l!==Object.keys(o).length)return!1;for(c=l;c--!==0;)if(!Object.prototype.hasOwnProperty.call(o,u[c]))return!1;if(e&&a instanceof Element)return!1;for(c=l;c--!==0;)if(!((u[c]==="_owner"||u[c]==="__v"||u[c]==="__o")&&a.$$typeof)&&!s(a[u[c]],o[u[c]]))return!1;return!0}return a!==a&&o!==o}return LY=function(o,l){try{return s(o,l)}catch(c){if((c.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw c}},LY}var Asn=Nsn();const jsn=Ti(Asn);var DY,sCe;function Esn(){if(sCe)return DY;sCe=1;var e=function(t,n,r,s,a,o,l,c){if(!t){var u;if(n===void 0)u=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var d=[r,s,a,o,l,c],f=0;u=new Error(n.replace(/%s/g,function(){return d[f++]})),u.name="Invariant Violation"}throw u.framesToPop=1,u}};return DY=e,DY}var _sn=Esn();const iCe=Ti(_sn);var BY,aCe;function ksn(){return aCe||(aCe=1,BY=function(t,n,r,s){var a=r?r.call(s,t,n):void 0;if(a!==void 0)return!!a;if(t===n)return!0;if(typeof t!="object"||!t||typeof n!="object"||!n)return!1;var o=Object.keys(t),l=Object.keys(n);if(o.length!==l.length)return!1;for(var c=Object.prototype.hasOwnProperty.bind(n),u=0;u<o.length;u++){var d=o[u];if(!c(d))return!1;var f=t[d],x=n[d];if(a=r?r.call(s,f,x,d):void 0,a===!1||a===void 0&&f!==x)return!1}return!0}),BY}var Tsn=ksn();const Isn=Ti(Tsn);var DUe=(e=>(e.BASE="base",e.BODY="body",e.HEAD="head",e.HTML="html",e.LINK="link",e.META="meta",e.NOSCRIPT="noscript",e.SCRIPT="script",e.STYLE="style",e.TITLE="title",e.FRAGMENT="Symbol(react.fragment)",e))(DUe||{}),$Y={link:{rel:["amphtml","canonical","alternate"]},script:{type:["application/ld+json"]},meta:{charset:"",name:["generator","robots","description"],property:["og:type","og:title","og:url","og:image","og:image:alt","og:description","twitter:url","twitter:title","twitter:description","twitter:image","twitter:image:alt","twitter:card","twitter:site"]}},oCe=Object.values(DUe),Oce={accesskey:"accessKey",charset:"charSet",class:"className",contenteditable:"contentEditable",contextmenu:"contextMenu","http-equiv":"httpEquiv",itemprop:"itemProp",tabindex:"tabIndex"},Psn=Object.entries(Oce).reduce((e,[t,n])=>(e[n]=t,e),{}),cm="data-rh",x4={DEFAULT_TITLE:"defaultTitle",DEFER:"defer",ENCODE_SPECIAL_CHARACTERS:"encodeSpecialCharacters",ON_CHANGE_CLIENT_STATE:"onChangeClientState",TITLE_TEMPLATE:"titleTemplate",PRIORITIZE_SEO_TAGS:"prioritizeSeoTags"},g4=(e,t)=>{for(let n=e.length-1;n>=0;n-=1){const r=e[n];if(Object.prototype.hasOwnProperty.call(r,t))return r[t]}return null},Fsn=e=>{let t=g4(e,"title");const n=g4(e,x4.TITLE_TEMPLATE);if(Array.isArray(t)&&(t=t.join("")),n&&t)return n.replace(/%s/g,()=>t);const r=g4(e,x4.DEFAULT_TITLE);return t||r||void 0},Osn=e=>g4(e,x4.ON_CHANGE_CLIENT_STATE)||(()=>{}),UY=(e,t)=>t.filter(n=>typeof n[e]<"u").map(n=>n[e]).reduce((n,r)=>({...n,...r}),{}),Msn=(e,t)=>t.filter(n=>typeof n.base<"u").map(n=>n.base).reverse().reduce((n,r)=>{if(!n.length){const s=Object.keys(r);for(let a=0;a<s.length;a+=1){const l=s[a].toLowerCase();if(e.indexOf(l)!==-1&&r[l])return n.concat(r)}}return n},[]),Rsn=e=>console&&typeof console.warn=="function"&&console.warn(e),H7=(e,t,n)=>{const r={};return n.filter(s=>Array.isArray(s[e])?!0:(typeof s[e]<"u"&&Rsn(`Helmet: ${e} should be of type "Array". Instead found type "${typeof s[e]}"`),!1)).map(s=>s[e]).reverse().reduce((s,a)=>{const o={};a.filter(c=>{let u;const d=Object.keys(c);for(let x=0;x<d.length;x+=1){const g=d[x],v=g.toLowerCase();t.indexOf(v)!==-1&&!(u==="rel"&&c[u].toLowerCase()==="canonical")&&!(v==="rel"&&c[v].toLowerCase()==="stylesheet")&&(u=v),t.indexOf(g)!==-1&&(g==="innerHTML"||g==="cssText"||g==="itemprop")&&(u=g)}if(!u||!c[u])return!1;const f=c[u].toLowerCase();return r[u]||(r[u]={}),o[u]||(o[u]={}),r[u][f]?!1:(o[u][f]=!0,!0)}).reverse().forEach(c=>s.push(c));const l=Object.keys(o);for(let c=0;c<l.length;c+=1){const u=l[c],d={...r[u],...o[u]};r[u]=d}return s},[]).reverse()},Lsn=(e,t)=>{if(Array.isArray(e)&&e.length){for(let n=0;n<e.length;n+=1)if(e[n][t])return!0}return!1},Dsn=e=>({baseTag:Msn(["href"],e),bodyAttributes:UY("bodyAttributes",e),defer:g4(e,x4.DEFER),encode:g4(e,x4.ENCODE_SPECIAL_CHARACTERS),htmlAttributes:UY("htmlAttributes",e),linkTags:H7("link",["rel","href"],e),metaTags:H7("meta",["name","charset","http-equiv","property","itemprop"],e),noscriptTags:H7("noscript",["innerHTML"],e),onChangeClientState:Osn(e),scriptTags:H7("script",["src","innerHTML"],e),styleTags:H7("style",["cssText"],e),title:Fsn(e),titleAttributes:UY("titleAttributes",e),prioritizeSeoTags:Lsn(e,x4.PRIORITIZE_SEO_TAGS)}),BUe=e=>Array.isArray(e)?e.join(""):e,Bsn=(e,t)=>{const n=Object.keys(e);for(let r=0;r<n.length;r+=1)if(t[n[r]]&&t[n[r]].includes(e[n[r]]))return!0;return!1},zY=(e,t)=>Array.isArray(e)?e.reduce((n,r)=>(Bsn(r,t)?n.priority.push(r):n.default.push(r),n),{priority:[],default:[]}):{default:e,priority:[]},lCe=(e,t)=>({...e,[t]:void 0}),$sn=["noscript","script","style"],Ene=(e,t=!0)=>t===!1?String(e):String(e).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'"),$Ue=e=>Object.keys(e).reduce((t,n)=>{const r=typeof e[n]<"u"?`${n}="${e[n]}"`:`${n}`;return t?`${t} ${r}`:r},""),Usn=(e,t,n,r)=>{const s=$Ue(n),a=BUe(t);return s?`<${e} ${cm}="true" ${s}>${Ene(a,r)}</${e}>`:`<${e} ${cm}="true">${Ene(a,r)}</${e}>`},zsn=(e,t,n=!0)=>t.reduce((r,s)=>{const a=s,o=Object.keys(a).filter(u=>!(u==="innerHTML"||u==="cssText")).reduce((u,d)=>{const f=typeof a[d]>"u"?d:`${d}="${Ene(a[d],n)}"`;return u?`${u} ${f}`:f},""),l=a.innerHTML||a.cssText||"",c=$sn.indexOf(e)===-1;return`${r}<${e} ${cm}="true" ${o}${c?"/>":`>${l}</${e}>`}`},""),UUe=(e,t={})=>Object.keys(e).reduce((n,r)=>{const s=Oce[r];return n[s||r]=e[r],n},t),Hsn=(e,t,n)=>{const r={key:t,[cm]:!0},s=UUe(n,r);return[Ae.createElement("title",s,t)]},vO=(e,t)=>t.map((n,r)=>{const s={key:r,[cm]:!0};return Object.keys(n).forEach(a=>{const l=Oce[a]||a;if(l==="innerHTML"||l==="cssText"){const c=n.innerHTML||n.cssText;s.dangerouslySetInnerHTML={__html:c}}else s[l]=n[a]}),Ae.createElement(e,s)}),Mh=(e,t,n=!0)=>{switch(e){case"title":return{toComponent:()=>Hsn(e,t.title,t.titleAttributes),toString:()=>Usn(e,t.title,t.titleAttributes,n)};case"bodyAttributes":case"htmlAttributes":return{toComponent:()=>UUe(t),toString:()=>$Ue(t)};default:return{toComponent:()=>vO(e,t),toString:()=>zsn(e,t,n)}}},Vsn=({metaTags:e,linkTags:t,scriptTags:n,encode:r})=>{const s=zY(e,$Y.meta),a=zY(t,$Y.link),o=zY(n,$Y.script);return{priorityMethods:{toComponent:()=>[...vO("meta",s.priority),...vO("link",a.priority),...vO("script",o.priority)],toString:()=>`${Mh("meta",s.priority,r)} ${Mh("link",a.priority,r)} ${Mh("script",o.priority,r)}`},metaTags:s.default,linkTags:a.default,scriptTags:o.default}},Wsn=e=>{const{baseTag:t,bodyAttributes:n,encode:r=!0,htmlAttributes:s,noscriptTags:a,styleTags:o,title:l="",titleAttributes:c,prioritizeSeoTags:u}=e;let{linkTags:d,metaTags:f,scriptTags:x}=e,g={toComponent:()=>{},toString:()=>""};return u&&({priorityMethods:g,linkTags:d,metaTags:f,scriptTags:x}=Vsn(e)),{priority:g,base:Mh("base",t,r),bodyAttributes:Mh("bodyAttributes",n,r),htmlAttributes:Mh("htmlAttributes",s,r),link:Mh("link",d,r),meta:Mh("meta",f,r),noscript:Mh("noscript",a,r),script:Mh("script",x,r),style:Mh("style",o,r),title:Mh("title",{title:l,titleAttributes:c},r)}},zUe=Wsn,LP=[],HUe=!!(typeof window<"u"&&window.document&&window.document.createElement),_ne=class{constructor(e,t){Un(this,"instances",[]);Un(this,"canUseDOM",HUe);Un(this,"context");Un(this,"value",{setHelmet:e=>{this.context.helmet=e},helmetInstances:{get:()=>this.canUseDOM?LP:this.instances,add:e=>{(this.canUseDOM?LP:this.instances).push(e)},remove:e=>{const t=(this.canUseDOM?LP:this.instances).indexOf(e);(this.canUseDOM?LP:this.instances).splice(t,1)}}});this.context=e,this.canUseDOM=t||!1,t||(e.helmet=zUe({baseTag:[],bodyAttributes:{},encodeSpecialCharacters:!0,htmlAttributes:{},linkTags:[],metaTags:[],noscriptTags:[],scriptTags:[],styleTags:[],title:"",titleAttributes:{}}))}},qsn={},VUe=Ae.createContext(qsn),Uw,So=(Uw=class extends m.Component{constructor(n){super(n);Un(this,"helmetData");this.helmetData=new _ne(this.props.context||{},Uw.canUseDOM)}render(){return Ae.createElement(VUe.Provider,{value:this.helmetData.value},this.props.children)}},Un(Uw,"canUseDOM",HUe),Uw),aC=(e,t)=>{const n=document.head||document.querySelector("head"),r=n.querySelectorAll(`${e}[${cm}]`),s=[].slice.call(r),a=[];let o;return t&&t.length&&t.forEach(l=>{const c=document.createElement(e);for(const u in l)if(Object.prototype.hasOwnProperty.call(l,u))if(u==="innerHTML")c.innerHTML=l.innerHTML;else if(u==="cssText")c.styleSheet?c.styleSheet.cssText=l.cssText:c.appendChild(document.createTextNode(l.cssText));else{const d=u,f=typeof l[d]>"u"?"":l[d];c.setAttribute(u,f)}c.setAttribute(cm,"true"),s.some((u,d)=>(o=d,c.isEqualNode(u)))?s.splice(o,1):a.push(c)}),s.forEach(l=>{var c;return(c=l.parentNode)==null?void 0:c.removeChild(l)}),a.forEach(l=>n.appendChild(l)),{oldTags:s,newTags:a}},kne=(e,t)=>{const n=document.getElementsByTagName(e)[0];if(!n)return;const r=n.getAttribute(cm),s=r?r.split(","):[],a=[...s],o=Object.keys(t);for(const l of o){const c=t[l]||"";n.getAttribute(l)!==c&&n.setAttribute(l,c),s.indexOf(l)===-1&&s.push(l);const u=a.indexOf(l);u!==-1&&a.splice(u,1)}for(let l=a.length-1;l>=0;l-=1)n.removeAttribute(a[l]);s.length===a.length?n.removeAttribute(cm):n.getAttribute(cm)!==o.join(",")&&n.setAttribute(cm,o.join(","))},Gsn=(e,t)=>{typeof e<"u"&&document.title!==e&&(document.title=BUe(e)),kne("title",t)},cCe=(e,t)=>{const{baseTag:n,bodyAttributes:r,htmlAttributes:s,linkTags:a,metaTags:o,noscriptTags:l,onChangeClientState:c,scriptTags:u,styleTags:d,title:f,titleAttributes:x}=e;kne("body",r),kne("html",s),Gsn(f,x);const g={baseTag:aC("base",n),linkTags:aC("link",a),metaTags:aC("meta",o),noscriptTags:aC("noscript",l),scriptTags:aC("script",u),styleTags:aC("style",d)},v={},w={};Object.keys(g).forEach(C=>{const{newTags:N,oldTags:P}=g[C];N.length&&(v[C]=N),P.length&&(w[C]=g[C].oldTags)}),t&&t(),c(e,v,w)},V7=null,Ksn=e=>{V7&&cancelAnimationFrame(V7),e.defer?V7=requestAnimationFrame(()=>{cCe(e,()=>{V7=null})}):(cCe(e),V7=null)},Ysn=Ksn,uCe=class extends m.Component{constructor(){super(...arguments);Un(this,"rendered",!1)}shouldComponentUpdate(t){return!Isn(t,this.props)}componentDidUpdate(){this.emitChange()}componentWillUnmount(){const{helmetInstances:t}=this.props.context;t.remove(this),this.emitChange()}emitChange(){const{helmetInstances:t,setHelmet:n}=this.props.context;let r=null;const s=Dsn(t.get().map(a=>{const o={...a.props};return delete o.context,o}));So.canUseDOM?Ysn(s):r=zUe(s),n(r)}init(){if(this.rendered)return;this.rendered=!0;const{helmetInstances:t}=this.props.context;t.add(this),this.emitChange()}render(){return this.init(),null}},oQ,Ro=(oQ=class extends m.Component{shouldComponentUpdate(e){return!jsn(lCe(this.props,"helmetData"),lCe(e,"helmetData"))}mapNestedChildrenToProps(e,t){if(!t)return null;switch(e.type){case"script":case"noscript":return{innerHTML:t};case"style":return{cssText:t};default:throw new Error(`<${e.type} /> elements are self-closing and can not contain children. Refer to our API for more information.`)}}flattenArrayTypeChildren(e,t,n,r){return{...t,[e.type]:[...t[e.type]||[],{...n,...this.mapNestedChildrenToProps(e,r)}]}}mapObjectTypeChildren(e,t,n,r){switch(e.type){case"title":return{...t,[e.type]:r,titleAttributes:{...n}};case"body":return{...t,bodyAttributes:{...n}};case"html":return{...t,htmlAttributes:{...n}};default:return{...t,[e.type]:{...n}}}}mapArrayTypeChildrenToProps(e,t){let n={...t};return Object.keys(e).forEach(r=>{n={...n,[r]:e[r]}}),n}warnOnInvalidChildren(e,t){return iCe(oCe.some(n=>e.type===n),typeof e.type=="function"?"You may be attempting to nest <Helmet> components within each other, which is not allowed. Refer to our API for more information.":`Only elements types ${oCe.join(", ")} are allowed. Helmet does not support rendering <${e.type}> elements. Refer to our API for more information.`),iCe(!t||typeof t=="string"||Array.isArray(t)&&!t.some(n=>typeof n!="string"),`Helmet expects a string as a child of <${e.type}>. Did you forget to wrap your children in braces? ( <${e.type}>{\`\`}</${e.type}> ) Refer to our API for more information.`),!0}mapChildrenToProps(e,t){let n={};return Ae.Children.forEach(e,r=>{if(!r||!r.props)return;const{children:s,...a}=r.props,o=Object.keys(a).reduce((c,u)=>(c[Psn[u]||u]=a[u],c),{});let{type:l}=r;switch(typeof l=="symbol"?l=l.toString():this.warnOnInvalidChildren(r,s),l){case"Symbol(react.fragment)":t=this.mapChildrenToProps(s,t);break;case"link":case"meta":case"noscript":case"script":case"style":n=this.flattenArrayTypeChildren(r,n,o,s);break;default:t=this.mapObjectTypeChildren(r,t,o,s);break}}),this.mapArrayTypeChildrenToProps(n,t)}render(){const{children:e,...t}=this.props;let n={...t},{helmetData:r}=t;if(e&&(n=this.mapChildrenToProps(e,n)),r&&!(r instanceof _ne)){const s=r;r=new _ne(s.context,!0),delete n.helmetData}return r?Ae.createElement(uCe,{...n,context:r.value}):Ae.createElement(VUe.Consumer,null,s=>Ae.createElement(uCe,{...n,context:s}))}},Un(oQ,"defaultProps",{defer:!0,encodeSpecialCharacters:!0,prioritizeSeoTags:!1}),oQ);const Xsn=()=>{const[e,t]=m.useState(1),[n,r]=m.useState("-"),[s,a]=m.useState("-"),o=0,[l,c]=m.useState(o),u=[{index:0,name:"1D",value:1},{index:1,name:"7D",value:7},{index:2,name:"30D",value:30},{index:3,name:"90D",value:90},{index:4,name:"All",value:999}],d=parseInt(localStorage.getItem("discover_period")),f=!isNaN(d)&&u[d]?u[d].value:u[1].value,[x,g]=m.useState(f),v=w=>{g(Number(w)),localStorage.setItem("discover_period",u.findIndex(C=>C.value===Number(w)).toFixed(0))};return i.jsxs(i.Fragment,{children:[i.jsx(So,{children:i.jsxs(Ro,{children:[i.jsx("title",{children:"Discover Top HyperLiquid Wallets for Copy Trading - Dextrabot"}),i.jsx("meta",{name:"description",content:"Find and analyze the best HyperLiquid wallets for copy trading. Use powerful filters to discover profitable traders and automate your trades effortlessly."}),i.jsx("meta",{name:"og:title",content:"Discover Top HyperLiquid Wallets for Copy Trading - Dextrabot"}),i.jsx("meta",{name:"og:description",content:"Find and analyze the best HyperLiquid wallets for copy trading. Use powerful filters to discover profitable traders and automate your trades effortlessly."}),i.jsx("meta",{name:"og:image",content:"https://app.dextrabot.com/dextrabotIcon.png"}),i.jsx("meta",{name:"og:url",content:"https://app.dextrabot.com/discover-wallets"})]})}),i.jsx("div",{className:"flex flex-col items-stretch justify-start sm:justify-center text-white w-full bg-[#161616] overflow-hidden min-h-[calc(100vh)] sm:min-h-[calc(100vh-5rem)] sm:h-[calc(100vh-5rem)] overflow-y-auto sm:pb-0",children:i.jsx(Ssn,{currentPage:e,setCurrentPage:t,offset:l,setOffset:c,totalPage:n,totalWalletCount:s,setTotalPage:r,setTotalWalletCount:a,period:x,periods:u,handlePeriodChange:v})})]})},hi=({title:e,sortKey:t,sortOption:n,setSortOption:r,isFilterIcon:s})=>{const a=()=>{r(n===`-${t}`?t:`-${t}`)};return i.jsx(i.Fragment,{children:i.jsxs("div",{onClick:()=>a(),className:`${e==="Wallet"?"sm:sticky left-0 h-8":s?"justify-end":"justify-start"} flex items-center gap-1 min-w-max font-manrope`,children:[i.jsx("div",{className:`${n.includes(t)?"text-white":""} cursor-pointer flex items-center justify-end group`,children:e}),i.jsx(uU,{sortKey:t,state:n,className:""})]})})};var DP={},BP={exports:{}};/*!
* ApexCharts v3.54.1
* (c) 2018-2024 ApexCharts
* Released under the MIT License.
*/var dCe;function Qsn(){return dCe||(dCe=1,function(e,t){function n(Ee,h){(h==null||h>Ee.length)&&(h=Ee.length);for(var p=0,S=Array(h);p<h;p++)S[p]=Ee[p];return S}function r(Ee){if(Ee===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return Ee}function s(Ee,h){if(!(Ee instanceof h))throw new TypeError("Cannot call a class as a function")}function a(Ee,h){for(var p=0;p<h.length;p++){var S=h[p];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(Ee,P(S.key),S)}}function o(Ee,h,p){return h&&a(Ee.prototype,h),p&&a(Ee,p),Object.defineProperty(Ee,"prototype",{writable:!1}),Ee}function l(Ee,h){var p=typeof Symbol<"u"&&Ee[Symbol.iterator]||Ee["@@iterator"];if(!p){if(Array.isArray(Ee)||(p=R(Ee))||h){p&&(Ee=p);var S=0,_=function(){};return{s:_,n:function(){return S>=Ee.length?{done:!0}:{done:!1,value:Ee[S++]}},e:function(q){throw q},f:_}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var k,T=!0,B=!1;return{s:function(){p=p.call(Ee)},n:function(){var q=p.next();return T=q.done,q},e:function(q){B=!0,k=q},f:function(){try{T||p.return==null||p.return()}finally{if(B)throw k}}}}function c(Ee){var h=x();return function(){var p,S=d(Ee);if(h){var _=d(this).constructor;p=Reflect.construct(S,arguments,_)}else p=S.apply(this,arguments);return function(k,T){if(T&&(typeof T=="object"||typeof T=="function"))return T;if(T!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return r(k)}(this,p)}}function u(Ee,h,p){return(h=P(h))in Ee?Object.defineProperty(Ee,h,{value:p,enumerable:!0,configurable:!0,writable:!0}):Ee[h]=p,Ee}function d(Ee){return d=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(h){return h.__proto__||Object.getPrototypeOf(h)},d(Ee)}function f(Ee,h){if(typeof h!="function"&&h!==null)throw new TypeError("Super expression must either be null or a function");Ee.prototype=Object.create(h&&h.prototype,{constructor:{value:Ee,writable:!0,configurable:!0}}),Object.defineProperty(Ee,"prototype",{writable:!1}),h&&w(Ee,h)}function x(){try{var Ee=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(x=function(){return!!Ee})()}function g(Ee,h){var p=Object.keys(Ee);if(Object.getOwnPropertySymbols){var S=Object.getOwnPropertySymbols(Ee);h&&(S=S.filter(function(_){return Object.getOwnPropertyDescriptor(Ee,_).enumerable})),p.push.apply(p,S)}return p}function v(Ee){for(var h=1;h<arguments.length;h++){var p=arguments[h]!=null?arguments[h]:{};h%2?g(Object(p),!0).forEach(function(S){u(Ee,S,p[S])}):Object.getOwnPropertyDescriptors?Object.defineProperties(Ee,Object.getOwnPropertyDescriptors(p)):g(Object(p)).forEach(function(S){Object.defineProperty(Ee,S,Object.getOwnPropertyDescriptor(p,S))})}return Ee}function w(Ee,h){return w=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(p,S){return p.__proto__=S,p},w(Ee,h)}function C(Ee,h){return function(p){if(Array.isArray(p))return p}(Ee)||function(p,S){var _=p==null?null:typeof Symbol<"u"&&p[Symbol.iterator]||p["@@iterator"];if(_!=null){var k,T,B,q,te=[],ue=!0,de=!1;try{if(B=(_=_.call(p)).next,S===0){if(Object(_)!==_)return;ue=!1}else for(;!(ue=(k=B.call(_)).done)&&(te.push(k.value),te.length!==S);ue=!0);}catch(xe){de=!0,T=xe}finally{try{if(!ue&&_.return!=null&&(q=_.return(),Object(q)!==q))return}finally{if(de)throw T}}return te}}(Ee,h)||R(Ee,h)||function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function N(Ee){return function(h){if(Array.isArray(h))return n(h)}(Ee)||function(h){if(typeof Symbol<"u"&&h[Symbol.iterator]!=null||h["@@iterator"]!=null)return Array.from(h)}(Ee)||R(Ee)||function(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function P(Ee){var h=function(p,S){if(typeof p!="object"||!p)return p;var _=p[Symbol.toPrimitive];if(_!==void 0){var k=_.call(p,S||"default");if(typeof k!="object")return k;throw new TypeError("@@toPrimitive must return a primitive value.")}return(S==="string"?String:Number)(p)}(Ee,"string");return typeof h=="symbol"?h:h+""}function I(Ee){return I=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(h){return typeof h}:function(h){return h&&typeof Symbol=="function"&&h.constructor===Symbol&&h!==Symbol.prototype?"symbol":typeof h},I(Ee)}function R(Ee,h){if(Ee){if(typeof Ee=="string")return n(Ee,h);var p={}.toString.call(Ee).slice(8,-1);return p==="Object"&&Ee.constructor&&(p=Ee.constructor.name),p==="Map"||p==="Set"?Array.from(Ee):p==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(p)?n(Ee,h):void 0}}var F=function(){function Ee(){s(this,Ee)}return o(Ee,[{key:"shadeRGBColor",value:function(h,p){var S=p.split(","),_=h<0?0:255,k=h<0?-1*h:h,T=parseInt(S[0].slice(4),10),B=parseInt(S[1],10),q=parseInt(S[2],10);return"rgb("+(Math.round((_-T)*k)+T)+","+(Math.round((_-B)*k)+B)+","+(Math.round((_-q)*k)+q)+")"}},{key:"shadeHexColor",value:function(h,p){var S=parseInt(p.slice(1),16),_=h<0?0:255,k=h<0?-1*h:h,T=S>>16,B=S>>8&255,q=255&S;return"#"+(16777216+65536*(Math.round((_-T)*k)+T)+256*(Math.round((_-B)*k)+B)+(Math.round((_-q)*k)+q)).toString(16).slice(1)}},{key:"shadeColor",value:function(h,p){return Ee.isColorHex(p)?this.shadeHexColor(h,p):this.shadeRGBColor(h,p)}}],[{key:"bind",value:function(h,p){return function(){return h.apply(p,arguments)}}},{key:"isObject",value:function(h){return h&&I(h)==="object"&&!Array.isArray(h)&&h!=null}},{key:"is",value:function(h,p){return Object.prototype.toString.call(p)==="[object "+h+"]"}},{key:"listToArray",value:function(h){var p,S=[];for(p=0;p<h.length;p++)S[p]=h[p];return S}},{key:"extend",value:function(h,p){var S=this;typeof Object.assign!="function"&&(Object.assign=function(k){if(k==null)throw new TypeError("Cannot convert undefined or null to object");for(var T=Object(k),B=1;B<arguments.length;B++){var q=arguments[B];if(q!=null)for(var te in q)q.hasOwnProperty(te)&&(T[te]=q[te])}return T});var _=Object.assign({},h);return this.isObject(h)&&this.isObject(p)&&Object.keys(p).forEach(function(k){S.isObject(p[k])&&k in h?_[k]=S.extend(h[k],p[k]):Object.assign(_,u({},k,p[k]))}),_}},{key:"extendArray",value:function(h,p){var S=[];return h.map(function(_){S.push(Ee.extend(p,_))}),h=S}},{key:"monthMod",value:function(h){return h%12}},{key:"clone",value:function(h){if(Ee.is("Array",h)){for(var p=[],S=0;S<h.length;S++)p[S]=this.clone(h[S]);return p}if(Ee.is("Null",h))return null;if(Ee.is("Date",h))return h;if(I(h)==="object"){var _={};for(var k in h)h.hasOwnProperty(k)&&(_[k]=this.clone(h[k]));return _}return h}},{key:"log10",value:function(h){return Math.log(h)/Math.LN10}},{key:"roundToBase10",value:function(h){return Math.pow(10,Math.floor(Math.log10(h)))}},{key:"roundToBase",value:function(h,p){return Math.pow(p,Math.floor(Math.log(h)/Math.log(p)))}},{key:"parseNumber",value:function(h){return h===null?h:parseFloat(h)}},{key:"stripNumber",value:function(h){var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2;return Number.isInteger(h)?h:parseFloat(h.toPrecision(p))}},{key:"randomId",value:function(){return(Math.random()+1).toString(36).substring(4)}},{key:"noExponents",value:function(h){var p=String(h).split(/[eE]/);if(p.length===1)return p[0];var S="",_=h<0?"-":"",k=p[0].replace(".",""),T=Number(p[1])+1;if(T<0){for(S=_+"0.";T++;)S+="0";return S+k.replace(/^-/,"")}for(T-=k.length;T--;)S+="0";return k+S}},{key:"getDimensions",value:function(h){var p=getComputedStyle(h,null),S=h.clientHeight,_=h.clientWidth;return S-=parseFloat(p.paddingTop)+parseFloat(p.paddingBottom),[_-=parseFloat(p.paddingLeft)+parseFloat(p.paddingRight),S]}},{key:"getBoundingClientRect",value:function(h){var p=h.getBoundingClientRect();return{top:p.top,right:p.right,bottom:p.bottom,left:p.left,width:h.clientWidth,height:h.clientHeight,x:p.left,y:p.top}}},{key:"getLargestStringFromArr",value:function(h){return h.reduce(function(p,S){return Array.isArray(S)&&(S=S.reduce(function(_,k){return _.length>k.length?_:k})),p.length>S.length?p:S},0)}},{key:"hexToRgba",value:function(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"#999999",p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:.6;h.substring(0,1)!=="#"&&(h="#999999");var S=h.replace("#","");S=S.match(new RegExp("(.{"+S.length/3+"})","g"));for(var _=0;_<S.length;_++)S[_]=parseInt(S[_].length===1?S[_]+S[_]:S[_],16);return p!==void 0&&S.push(p),"rgba("+S.join(",")+")"}},{key:"getOpacityFromRGBA",value:function(h){return parseFloat(h.replace(/^.*,(.+)\)/,"$1"))}},{key:"rgb2hex",value:function(h){return(h=h.match(/^rgba?[\s+]?\([\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?/i))&&h.length===4?"#"+("0"+parseInt(h[1],10).toString(16)).slice(-2)+("0"+parseInt(h[2],10).toString(16)).slice(-2)+("0"+parseInt(h[3],10).toString(16)).slice(-2):""}},{key:"isColorHex",value:function(h){return/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)|(^#[0-9A-F]{8}$)/i.test(h)}},{key:"getPolygonPos",value:function(h,p){for(var S=[],_=2*Math.PI/p,k=0;k<p;k++){var T={};T.x=h*Math.sin(k*_),T.y=-h*Math.cos(k*_),S.push(T)}return S}},{key:"polarToCartesian",value:function(h,p,S,_){var k=(_-90)*Math.PI/180;return{x:h+S*Math.cos(k),y:p+S*Math.sin(k)}}},{key:"escapeString",value:function(h){var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"x",S=h.toString().slice();return S=S.replace(/[` ~!@#$%^&*()|+\=?;:'",.<>{}[\]\\/]/gi,p)}},{key:"negToZero",value:function(h){return h<0?0:h}},{key:"moveIndexInArray",value:function(h,p,S){if(S>=h.length)for(var _=S-h.length+1;_--;)h.push(void 0);return h.splice(S,0,h.splice(p,1)[0]),h}},{key:"extractNumber",value:function(h){return parseFloat(h.replace(/[^\d.]*/g,""))}},{key:"findAncestor",value:function(h,p){for(;(h=h.parentElement)&&!h.classList.contains(p););return h}},{key:"setELstyles",value:function(h,p){for(var S in p)p.hasOwnProperty(S)&&(h.style.key=p[S])}},{key:"preciseAddition",value:function(h,p){var S=(String(h).split(".")[1]||"").length,_=(String(p).split(".")[1]||"").length,k=Math.pow(10,Math.max(S,_));return(Math.round(h*k)+Math.round(p*k))/k}},{key:"isNumber",value:function(h){return!isNaN(h)&&parseFloat(Number(h))===h&&!isNaN(parseInt(h,10))}},{key:"isFloat",value:function(h){return Number(h)===h&&h%1!=0}},{key:"isSafari",value:function(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}},{key:"isFirefox",value:function(){return navigator.userAgent.toLowerCase().indexOf("firefox")>-1}},{key:"isMsEdge",value:function(){var h=window.navigator.userAgent,p=h.indexOf("Edge/");return p>0&&parseInt(h.substring(p+5,h.indexOf(".",p)),10)}},{key:"getGCD",value:function(h,p){var S=arguments.length>2&&arguments[2]!==void 0?arguments[2]:7,_=Math.pow(10,S-Math.floor(Math.log10(Math.max(h,p))));for(h=Math.round(Math.abs(h)*_),p=Math.round(Math.abs(p)*_);p;){var k=p;p=h%p,h=k}return h/_}},{key:"getPrimeFactors",value:function(h){for(var p=[],S=2;h>=2;)h%S==0?(p.push(S),h/=S):S++;return p}},{key:"mod",value:function(h,p){var S=arguments.length>2&&arguments[2]!==void 0?arguments[2]:7,_=Math.pow(10,S-Math.floor(Math.log10(Math.max(h,p))));return(h=Math.round(Math.abs(h)*_))%(p=Math.round(Math.abs(p)*_))/_}}]),Ee}(),U=function(){function Ee(h){s(this,Ee),this.ctx=h,this.w=h.w,this.setEasingFunctions()}return o(Ee,[{key:"setEasingFunctions",value:function(){var h;if(!this.w.globals.easing){switch(this.w.config.chart.animations.easing){case"linear":h="-";break;case"easein":h="<";break;case"easeout":h=">";break;case"easeinout":default:h="<>";break;case"swing":h=function(p){var S=1.70158;return(p-=1)*p*((S+1)*p+S)+1};break;case"bounce":h=function(p){return p<1/2.75?7.5625*p*p:p<2/2.75?7.5625*(p-=1.5/2.75)*p+.75:p<2.5/2.75?7.5625*(p-=2.25/2.75)*p+.9375:7.5625*(p-=2.625/2.75)*p+.984375};break;case"elastic":h=function(p){return p===!!p?p:Math.pow(2,-10*p)*Math.sin((p-.075)*(2*Math.PI)/.3)+1}}this.w.globals.easing=h}}},{key:"animateLine",value:function(h,p,S,_){h.attr(p).animate(_).attr(S)}},{key:"animateMarker",value:function(h,p,S,_){h.attr({opacity:0}).animate(p,S).attr({opacity:1}).afterAll(function(){_()})}},{key:"animateRect",value:function(h,p,S,_,k){h.attr(p).animate(_).attr(S).afterAll(function(){return k()})}},{key:"animatePathsGradually",value:function(h){var p=h.el,S=h.realIndex,_=h.j,k=h.fill,T=h.pathFrom,B=h.pathTo,q=h.speed,te=h.delay,ue=this.w,de=0;ue.config.chart.animations.animateGradually.enabled&&(de=ue.config.chart.animations.animateGradually.delay),ue.config.chart.animations.dynamicAnimation.enabled&&ue.globals.dataChanged&&ue.config.chart.type!=="bar"&&(de=0),this.morphSVG(p,S,_,ue.config.chart.type!=="line"||ue.globals.comboCharts?k:"stroke",T,B,q,te*de)}},{key:"showDelayedElements",value:function(){this.w.globals.delayedElements.forEach(function(h){var p=h.el;p.classList.remove("apexcharts-element-hidden"),p.classList.add("apexcharts-hidden-element-shown")})}},{key:"animationCompleted",value:function(h){var p=this.w;p.globals.animationEnded||(p.globals.animationEnded=!0,this.showDelayedElements(),typeof p.config.chart.events.animationEnd=="function"&&p.config.chart.events.animationEnd(this.ctx,{el:h,w:p}))}},{key:"morphSVG",value:function(h,p,S,_,k,T,B,q){var te=this,ue=this.w;k||(k=h.attr("pathFrom")),T||(T=h.attr("pathTo"));var de=function(xe){return ue.config.chart.type==="radar"&&(B=1),"M 0 ".concat(ue.globals.gridHeight)};(!k||k.indexOf("undefined")>-1||k.indexOf("NaN")>-1)&&(k=de()),(!T||T.indexOf("undefined")>-1||T.indexOf("NaN")>-1)&&(T=de()),ue.globals.shouldAnimate||(B=1),h.plot(k).animate(1,ue.globals.easing,q).plot(k).animate(B,ue.globals.easing,q).plot(T).afterAll(function(){F.isNumber(S)?S===ue.globals.series[ue.globals.maxValsInArrayIndex].length-2&&ue.globals.shouldAnimate&&te.animationCompleted(h):_!=="none"&&ue.globals.shouldAnimate&&(!ue.globals.comboCharts&&p===ue.globals.series.length-1||ue.globals.comboCharts)&&te.animationCompleted(h),te.showDelayedElements()})}}]),Ee}(),L=function(){function Ee(h){s(this,Ee),this.ctx=h,this.w=h.w}return o(Ee,[{key:"getDefaultFilter",value:function(h,p){var S=this.w;h.unfilter(!0),new window.SVG.Filter().size("120%","180%","-5%","-40%"),S.config.states.normal.filter!=="none"?this.applyFilter(h,p,S.config.states.normal.filter.type,S.config.states.normal.filter.value):S.config.chart.dropShadow.enabled&&this.dropShadow(h,S.config.chart.dropShadow,p)}},{key:"addNormalFilter",value:function(h,p){var S=this.w;S.config.chart.dropShadow.enabled&&!h.node.classList.contains("apexcharts-marker")&&this.dropShadow(h,S.config.chart.dropShadow,p)}},{key:"addLightenFilter",value:function(h,p,S){var _=this,k=this.w,T=S.intensity;h.unfilter(!0),new window.SVG.Filter,h.filter(function(B){var q=k.config.chart.dropShadow;(q.enabled?_.addShadow(B,p,q):B).componentTransfer({rgb:{type:"linear",slope:1.5,intercept:T}})}),h.filterer.node.setAttribute("filterUnits","userSpaceOnUse"),this._scaleFilterSize(h.filterer.node)}},{key:"addDarkenFilter",value:function(h,p,S){var _=this,k=this.w,T=S.intensity;h.unfilter(!0),new window.SVG.Filter,h.filter(function(B){var q=k.config.chart.dropShadow;(q.enabled?_.addShadow(B,p,q):B).componentTransfer({rgb:{type:"linear",slope:T}})}),h.filterer.node.setAttribute("filterUnits","userSpaceOnUse"),this._scaleFilterSize(h.filterer.node)}},{key:"applyFilter",value:function(h,p,S){var _=arguments.length>3&&arguments[3]!==void 0?arguments[3]:.5;switch(S){case"none":this.addNormalFilter(h,p);break;case"lighten":this.addLightenFilter(h,p,{intensity:_});break;case"darken":this.addDarkenFilter(h,p,{intensity:_})}}},{key:"addShadow",value:function(h,p,S){var _,k=this.w,T=S.blur,B=S.top,q=S.left,te=S.color,ue=S.opacity;if(((_=k.config.chart.dropShadow.enabledOnSeries)===null||_===void 0?void 0:_.length)>0&&k.config.chart.dropShadow.enabledOnSeries.indexOf(p)===-1)return h;var de=h.flood(Array.isArray(te)?te[p]:te,ue).composite(h.sourceAlpha,"in").offset(q,B).gaussianBlur(T).merge(h.source);return h.blend(h.source,de)}},{key:"dropShadow",value:function(h,p){var S,_,k=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,T=p.top,B=p.left,q=p.blur,te=p.color,ue=p.opacity,de=p.noUserSpaceOnUse,xe=this.w;return h.unfilter(!0),F.isMsEdge()&&xe.config.chart.type==="radialBar"||((S=xe.config.chart.dropShadow.enabledOnSeries)===null||S===void 0?void 0:S.length)>0&&((_=xe.config.chart.dropShadow.enabledOnSeries)===null||_===void 0?void 0:_.indexOf(k))===-1||(te=Array.isArray(te)?te[k]:te,h.filter(function(Se){var ke=null;ke=F.isSafari()||F.isFirefox()||F.isMsEdge()?Se.flood(te,ue).composite(Se.sourceAlpha,"in").offset(B,T).gaussianBlur(q):Se.flood(te,ue).composite(Se.sourceAlpha,"in").offset(B,T).gaussianBlur(q).merge(Se.source),Se.blend(Se.source,ke)}),de||h.filterer.node.setAttribute("filterUnits","userSpaceOnUse"),this._scaleFilterSize(h.filterer.node)),h}},{key:"setSelectionFilter",value:function(h,p,S){var _=this.w;if(_.globals.selectedDataPoints[p]!==void 0&&_.globals.selectedDataPoints[p].indexOf(S)>-1){h.node.setAttribute("selected",!0);var k=_.config.states.active.filter;k!=="none"&&this.applyFilter(h,p,k.type,k.value)}}},{key:"_scaleFilterSize",value:function(h){(function(p){for(var S in p)p.hasOwnProperty(S)&&h.setAttribute(S,p[S])})({width:"200%",height:"200%",x:"-50%",y:"-50%"})}}]),Ee}(),z=function(){function Ee(h){s(this,Ee),this.ctx=h,this.w=h.w}return o(Ee,[{key:"roundPathCorners",value:function(h,p){function S(Je,ct,gt){var Xt=ct.x-Je.x,wt=ct.y-Je.y,Xe=Math.sqrt(Xt*Xt+wt*wt);return _(Je,ct,Math.min(1,gt/Xe))}function _(Je,ct,gt){return{x:Je.x+(ct.x-Je.x)*gt,y:Je.y+(ct.y-Je.y)*gt}}function k(Je,ct){Je.length>2&&(Je[Je.length-2]=ct.x,Je[Je.length-1]=ct.y)}function T(Je){return{x:parseFloat(Je[Je.length-2]),y:parseFloat(Je[Je.length-1])}}h.indexOf("NaN")>-1&&(h="");var B=h.split(/[,\s]/).reduce(function(Je,ct){var gt=ct.match("([a-zA-Z])(.+)");return gt?(Je.push(gt[1]),Je.push(gt[2])):Je.push(ct),Je},[]).reduce(function(Je,ct){return parseFloat(ct)==ct&&Je.length?Je[Je.length-1].push(ct):Je.push([ct]),Je},[]),q=[];if(B.length>1){var te=T(B[0]),ue=null;B[B.length-1][0]=="Z"&&B[0].length>2&&(ue=["L",te.x,te.y],B[B.length-1]=ue),q.push(B[0]);for(var de=1;de<B.length;de++){var xe=q[q.length-1],Se=B[de],ke=Se==ue?B[1]:B[de+1];if(ke&&xe&&xe.length>2&&Se[0]=="L"&&ke.length>2&&ke[0]=="L"){var Re,Ge,Fe=T(xe),st=T(Se),se=T(ke);Re=S(st,Fe,p),Ge=S(st,se,p),k(Se,Re),Se.origPoint=st,q.push(Se);var Ce=_(Re,st,.5),Be=_(st,Ge,.5),De=["C",Ce.x,Ce.y,Be.x,Be.y,Ge.x,Ge.y];De.origPoint=st,q.push(De)}else q.push(Se)}if(ue){var _e=T(q[q.length-1]);q.push(["Z"]),k(q[0],_e)}}else q=B;return q.reduce(function(Je,ct){return Je+ct.join(" ")+" "},"")}},{key:"drawLine",value:function(h,p,S,_){var k=arguments.length>4&&arguments[4]!==void 0?arguments[4]:"#a8a8a8",T=arguments.length>5&&arguments[5]!==void 0?arguments[5]:0,B=arguments.length>6&&arguments[6]!==void 0?arguments[6]:null,q=arguments.length>7&&arguments[7]!==void 0?arguments[7]:"butt";return this.w.globals.dom.Paper.line().attr({x1:h,y1:p,x2:S,y2:_,stroke:k,"stroke-dasharray":T,"stroke-width":B,"stroke-linecap":q})}},{key:"drawRect",value:function(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,S=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,_=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,k=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,T=arguments.length>5&&arguments[5]!==void 0?arguments[5]:"#fefefe",B=arguments.length>6&&arguments[6]!==void 0?arguments[6]:1,q=arguments.length>7&&arguments[7]!==void 0?arguments[7]:null,te=arguments.length>8&&arguments[8]!==void 0?arguments[8]:null,ue=arguments.length>9&&arguments[9]!==void 0?arguments[9]:0,de=this.w.globals.dom.Paper.rect();return de.attr({x:h,y:p,width:S>0?S:0,height:_>0?_:0,rx:k,ry:k,opacity:B,"stroke-width":q!==null?q:0,stroke:te!==null?te:"none","stroke-dasharray":ue}),de.node.setAttribute("fill",T),de}},{key:"drawPolygon",value:function(h){var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"#e1e1e1",S=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,_=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"none";return this.w.globals.dom.Paper.polygon(h).attr({fill:_,stroke:p,"stroke-width":S})}},{key:"drawCircle",value:function(h){var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;h<0&&(h=0);var S=this.w.globals.dom.Paper.circle(2*h);return p!==null&&S.attr(p),S}},{key:"drawPath",value:function(h){var p=h.d,S=p===void 0?"":p,_=h.stroke,k=_===void 0?"#a8a8a8":_,T=h.strokeWidth,B=T===void 0?1:T,q=h.fill,te=h.fillOpacity,ue=te===void 0?1:te,de=h.strokeOpacity,xe=de===void 0?1:de,Se=h.classes,ke=h.strokeLinecap,Re=ke===void 0?null:ke,Ge=h.strokeDashArray,Fe=Ge===void 0?0:Ge,st=this.w;return Re===null&&(Re=st.config.stroke.lineCap),(S.indexOf("undefined")>-1||S.indexOf("NaN")>-1)&&(S="M 0 ".concat(st.globals.gridHeight)),st.globals.dom.Paper.path(S).attr({fill:q,"fill-opacity":ue,stroke:k,"stroke-opacity":xe,"stroke-linecap":Re,"stroke-width":B,"stroke-dasharray":Fe,class:Se})}},{key:"group",value:function(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,p=this.w.globals.dom.Paper.group();return h!==null&&p.attr(h),p}},{key:"move",value:function(h,p){var S=["M",h,p].join(" ");return S}},{key:"line",value:function(h,p){var S=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,_=null;return S===null?_=[" L",h,p].join(" "):S==="H"?_=[" H",h].join(" "):S==="V"&&(_=[" V",p].join(" ")),_}},{key:"curve",value:function(h,p,S,_,k,T){var B=["C",h,p,S,_,k,T].join(" ");return B}},{key:"quadraticCurve",value:function(h,p,S,_){return["Q",h,p,S,_].join(" ")}},{key:"arc",value:function(h,p,S,_,k,T,B){var q="A";arguments.length>7&&arguments[7]!==void 0&&arguments[7]&&(q="a");var te=[q,h,p,S,_,k,T,B].join(" ");return te}},{key:"renderPaths",value:function(h){var p,S=h.j,_=h.realIndex,k=h.pathFrom,T=h.pathTo,B=h.stroke,q=h.strokeWidth,te=h.strokeLinecap,ue=h.fill,de=h.animationDelay,xe=h.initialSpeed,Se=h.dataChangeSpeed,ke=h.className,Re=h.chartType,Ge=h.shouldClipToGrid,Fe=Ge===void 0||Ge,st=h.bindEventsOnPaths,se=st===void 0||st,Ce=h.drawShadow,Be=Ce===void 0||Ce,De=this.w,_e=new L(this.ctx),Je=new U(this.ctx),ct=this.w.config.chart.animations.enabled,gt=ct&&this.w.config.chart.animations.dynamicAnimation.enabled,Xt=!!(ct&&!De.globals.resized||gt&&De.globals.dataChanged&&De.globals.shouldAnimate);Xt?p=k:(p=T,De.globals.animationEnded=!0);var wt=De.config.stroke.dashArray,Xe=0;Xe=Array.isArray(wt)?wt[_]:De.config.stroke.dashArray;var Oe=this.drawPath({d:p,stroke:B,strokeWidth:q,fill:ue,fillOpacity:1,classes:ke,strokeLinecap:te,strokeDashArray:Xe});if(Oe.attr("index",_),Fe&&(Re==="bar"&&!De.globals.isHorizontal||De.globals.comboCharts?Oe.attr({"clip-path":"url(#gridRectBarMask".concat(De.globals.cuid,")")}):Oe.attr({"clip-path":"url(#gridRectMask".concat(De.globals.cuid,")")})),De.config.states.normal.filter.type!=="none")_e.getDefaultFilter(Oe,_);else if(De.config.chart.dropShadow.enabled&&Be){var bt=De.config.chart.dropShadow;_e.dropShadow(Oe,bt,_)}se&&(Oe.node.addEventListener("mouseenter",this.pathMouseEnter.bind(this,Oe)),Oe.node.addEventListener("mouseleave",this.pathMouseLeave.bind(this,Oe)),Oe.node.addEventListener("mousedown",this.pathMouseDown.bind(this,Oe))),Oe.attr({pathTo:T,pathFrom:k});var kt={el:Oe,j:S,realIndex:_,pathFrom:k,pathTo:T,fill:ue,strokeWidth:q,delay:de};return!ct||De.globals.resized||De.globals.dataChanged?!De.globals.resized&&De.globals.dataChanged||Je.showDelayedElements():Je.animatePathsGradually(v(v({},kt),{},{speed:xe})),De.globals.dataChanged&>&&Xt&&Je.animatePathsGradually(v(v({},kt),{},{speed:Se})),Oe}},{key:"drawPattern",value:function(h,p,S){var _=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"#a8a8a8",k=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;return this.w.globals.dom.Paper.pattern(p,S,function(T){h==="horizontalLines"?T.line(0,0,S,0).stroke({color:_,width:k+1}):h==="verticalLines"?T.line(0,0,0,p).stroke({color:_,width:k+1}):h==="slantedLines"?T.line(0,0,p,S).stroke({color:_,width:k}):h==="squares"?T.rect(p,S).fill("none").stroke({color:_,width:k}):h==="circles"&&T.circle(p).fill("none").stroke({color:_,width:k})})}},{key:"drawGradient",value:function(h,p,S,_,k){var T,B=arguments.length>5&&arguments[5]!==void 0?arguments[5]:null,q=arguments.length>6&&arguments[6]!==void 0?arguments[6]:null,te=arguments.length>7&&arguments[7]!==void 0?arguments[7]:null,ue=arguments.length>8&&arguments[8]!==void 0?arguments[8]:0,de=this.w;p.length<9&&p.indexOf("#")===0&&(p=F.hexToRgba(p,_)),S.length<9&&S.indexOf("#")===0&&(S=F.hexToRgba(S,k));var xe=0,Se=1,ke=1,Re=null;q!==null&&(xe=q[0]!==void 0?q[0]/100:0,Se=q[1]!==void 0?q[1]/100:1,ke=q[2]!==void 0?q[2]/100:1,Re=q[3]!==void 0?q[3]/100:null);var Ge=!(de.config.chart.type!=="donut"&&de.config.chart.type!=="pie"&&de.config.chart.type!=="polarArea"&&de.config.chart.type!=="bubble");if(T=te===null||te.length===0?de.globals.dom.Paper.gradient(Ge?"radial":"linear",function(se){se.at(xe,p,_),se.at(Se,S,k),se.at(ke,S,k),Re!==null&&se.at(Re,p,_)}):de.globals.dom.Paper.gradient(Ge?"radial":"linear",function(se){(Array.isArray(te[ue])?te[ue]:te).forEach(function(Ce){se.at(Ce.offset/100,Ce.color,Ce.opacity)})}),Ge){var Fe=de.globals.gridWidth/2,st=de.globals.gridHeight/2;de.config.chart.type!=="bubble"?T.attr({gradientUnits:"userSpaceOnUse",cx:Fe,cy:st,r:B}):T.attr({cx:.5,cy:.5,r:.8,fx:.2,fy:.2})}else h==="vertical"?T.from(0,0).to(0,1):h==="diagonal"?T.from(0,0).to(1,1):h==="horizontal"?T.from(0,1).to(1,1):h==="diagonal2"&&T.from(1,0).to(0,1);return T}},{key:"getTextBasedOnMaxWidth",value:function(h){var p=h.text,S=h.maxWidth,_=h.fontSize,k=h.fontFamily,T=this.getTextRects(p,_,k),B=T.width/p.length,q=Math.floor(S/B);return S<T.width?p.slice(0,q-3)+"...":p}},{key:"drawText",value:function(h){var p=this,S=h.x,_=h.y,k=h.text,T=h.textAnchor,B=h.fontSize,q=h.fontFamily,te=h.fontWeight,ue=h.foreColor,de=h.opacity,xe=h.maxWidth,Se=h.cssClass,ke=Se===void 0?"":Se,Re=h.isPlainText,Ge=Re===void 0||Re,Fe=h.dominantBaseline,st=Fe===void 0?"auto":Fe,se=this.w;k===void 0&&(k="");var Ce=k;T||(T="start"),ue&&ue.length||(ue=se.config.chart.foreColor),q=q||se.config.chart.fontFamily,te=te||"regular";var Be,De={maxWidth:xe,fontSize:B=B||"11px",fontFamily:q};return Array.isArray(k)?Be=se.globals.dom.Paper.text(function(_e){for(var Je=0;Je<k.length;Je++)Ce=k[Je],xe&&(Ce=p.getTextBasedOnMaxWidth(v({text:k[Je]},De))),Je===0?_e.tspan(Ce):_e.tspan(Ce).newLine()}):(xe&&(Ce=this.getTextBasedOnMaxWidth(v({text:k},De))),Be=Ge?se.globals.dom.Paper.plain(k):se.globals.dom.Paper.text(function(_e){return _e.tspan(Ce)})),Be.attr({x:S,y:_,"text-anchor":T,"dominant-baseline":st,"font-size":B,"font-family":q,"font-weight":te,fill:ue,class:"apexcharts-text "+ke}),Be.node.style.fontFamily=q,Be.node.style.opacity=de,Be}},{key:"getMarkerPath",value:function(h,p,S,_){var k="";switch(S){case"cross":k="M ".concat(h-(_/=1.4)," ").concat(p-_," L ").concat(h+_," ").concat(p+_," M ").concat(h-_," ").concat(p+_," L ").concat(h+_," ").concat(p-_);break;case"plus":k="M ".concat(h-(_/=1.12)," ").concat(p," L ").concat(h+_," ").concat(p," M ").concat(h," ").concat(p-_," L ").concat(h," ").concat(p+_);break;case"star":case"sparkle":var T=5;_*=1.15,S==="sparkle"&&(_/=1.1,T=4);for(var B=Math.PI/T,q=0;q<=2*T;q++){var te=q*B,ue=q%2==0?_:_/2;k+=(q===0?"M":"L")+(h+ue*Math.sin(te))+","+(p-ue*Math.cos(te))}k+="Z";break;case"triangle":k="M ".concat(h," ").concat(p-_,`
L `).concat(h+_," ").concat(p+_,`
L `).concat(h-_," ").concat(p+_,`
Z`);break;case"square":case"rect":k="M ".concat(h-(_/=1.125)," ").concat(p-_,`
L `).concat(h+_," ").concat(p-_,`
L `).concat(h+_," ").concat(p+_,`
L `).concat(h-_," ").concat(p+_,`
Z`);break;case"diamond":_*=1.05,k="M ".concat(h," ").concat(p-_,`
L `).concat(h+_," ").concat(p,`
L `).concat(h," ").concat(p+_,`
L `).concat(h-_," ").concat(p,`
Z`);break;case"line":k="M ".concat(h-(_/=1.1)," ").concat(p,`
L `).concat(h+_," ").concat(p);break;default:_*=2,k="M ".concat(h,", ").concat(p,`
m -`).concat(_/2,`, 0
a `).concat(_/2,",").concat(_/2," 0 1,0 ").concat(_,`,0
a `).concat(_/2,",").concat(_/2," 0 1,0 -").concat(_,",0")}return k}},{key:"drawMarkerShape",value:function(h,p,S,_,k){var T=this.drawPath({d:this.getMarkerPath(h,p,S,_,k),stroke:k.pointStrokeColor,strokeDashArray:k.pointStrokeDashArray,strokeWidth:k.pointStrokeWidth,fill:k.pointFillColor,fillOpacity:k.pointFillOpacity,strokeOpacity:k.pointStrokeOpacity});return T.attr({cx:h,cy:p,shape:k.shape,class:k.class?k.class:""}),T}},{key:"drawMarker",value:function(h,p,S){h=h||0;var _=S.pSize||0;return F.isNumber(p)||(_=0,p=0),this.drawMarkerShape(h,p,S==null?void 0:S.shape,_,v(v({},S),S.shape==="line"||S.shape==="plus"||S.shape==="cross"?{pointStrokeColor:S.pointFillColor,pointStrokeOpacity:S.pointFillOpacity}:{}))}},{key:"pathMouseEnter",value:function(h,p){var S=this.w,_=new L(this.ctx),k=parseInt(h.node.getAttribute("index"),10),T=parseInt(h.node.getAttribute("j"),10);if(typeof S.config.chart.events.dataPointMouseEnter=="function"&&S.config.chart.events.dataPointMouseEnter(p,this.ctx,{seriesIndex:k,dataPointIndex:T,w:S}),this.ctx.events.fireEvent("dataPointMouseEnter",[p,this.ctx,{seriesIndex:k,dataPointIndex:T,w:S}]),(S.config.states.active.filter.type==="none"||h.node.getAttribute("selected")!=="true")&&S.config.states.hover.filter.type!=="none"&&!S.globals.isTouchDevice){var B=S.config.states.hover.filter;_.applyFilter(h,k,B.type,B.value)}}},{key:"pathMouseLeave",value:function(h,p){var S=this.w,_=new L(this.ctx),k=parseInt(h.node.getAttribute("index"),10),T=parseInt(h.node.getAttribute("j"),10);typeof S.config.chart.events.dataPointMouseLeave=="function"&&S.config.chart.events.dataPointMouseLeave(p,this.ctx,{seriesIndex:k,dataPointIndex:T,w:S}),this.ctx.events.fireEvent("dataPointMouseLeave",[p,this.ctx,{seriesIndex:k,dataPointIndex:T,w:S}]),S.config.states.active.filter.type!=="none"&&h.node.getAttribute("selected")==="true"||S.config.states.hover.filter.type!=="none"&&_.getDefaultFilter(h,k)}},{key:"pathMouseDown",value:function(h,p){var S=this.w,_=new L(this.ctx),k=parseInt(h.node.getAttribute("index"),10),T=parseInt(h.node.getAttribute("j"),10),B="false";if(h.node.getAttribute("selected")==="true"){if(h.node.setAttribute("selected","false"),S.globals.selectedDataPoints[k].indexOf(T)>-1){var q=S.globals.selectedDataPoints[k].indexOf(T);S.globals.selectedDataPoints[k].splice(q,1)}}else{if(!S.config.states.active.allowMultipleDataPointsSelection&&S.globals.selectedDataPoints.length>0){S.globals.selectedDataPoints=[];var te=S.globals.dom.Paper.select(".apexcharts-series path").members,ue=S.globals.dom.Paper.select(".apexcharts-series circle, .apexcharts-series rect").members,de=function(ke){Array.prototype.forEach.call(ke,function(Re){Re.node.setAttribute("selected","false"),_.getDefaultFilter(Re,k)})};de(te),de(ue)}h.node.setAttribute("selected","true"),B="true",S.globals.selectedDataPoints[k]===void 0&&(S.globals.selectedDataPoints[k]=[]),S.globals.selectedDataPoints[k].push(T)}if(B==="true"){var xe=S.config.states.active.filter;if(xe!=="none")_.applyFilter(h,k,xe.type,xe.value);else if(S.config.states.hover.filter!=="none"&&!S.globals.isTouchDevice){var Se=S.config.states.hover.filter;_.applyFilter(h,k,Se.type,Se.value)}}else S.config.states.active.filter.type!=="none"&&(S.config.states.hover.filter.type==="none"||S.globals.isTouchDevice?_.getDefaultFilter(h,k):(Se=S.config.states.hover.filter,_.applyFilter(h,k,Se.type,Se.value)));typeof S.config.chart.events.dataPointSelection=="function"&&S.config.chart.events.dataPointSelection(p,this.ctx,{selectedDataPoints:S.globals.selectedDataPoints,seriesIndex:k,dataPointIndex:T,w:S}),p&&this.ctx.events.fireEvent("dataPointSelection",[p,this.ctx,{selectedDataPoints:S.globals.selectedDataPoints,seriesIndex:k,dataPointIndex:T,w:S}])}},{key:"rotateAroundCenter",value:function(h){var p={};return h&&typeof h.getBBox=="function"&&(p=h.getBBox()),{x:p.x+p.width/2,y:p.y+p.height/2}}},{key:"getTextRects",value:function(h,p,S,_){var k=!(arguments.length>4&&arguments[4]!==void 0)||arguments[4],T=this.w,B=this.drawText({x:-200,y:-200,text:h,textAnchor:"start",fontSize:p,fontFamily:S,foreColor:"#fff",opacity:0});_&&B.attr("transform",_),T.globals.dom.Paper.add(B);var q=B.bbox();return k||(q=B.node.getBoundingClientRect()),B.remove(),{width:q.width,height:q.height}}},{key:"placeTextWithEllipsis",value:function(h,p,S){if(typeof h.getComputedTextLength=="function"&&(h.textContent=p,p.length>0&&h.getComputedTextLength()>=S/1.1)){for(var _=p.length-3;_>0;_-=3)if(h.getSubStringLength(0,_)<=S/1.1)return void(h.textContent=p.substring(0,_)+"...");h.textContent="."}}}],[{key:"setAttrs",value:function(h,p){for(var S in p)p.hasOwnProperty(S)&&h.setAttribute(S,p[S])}}]),Ee}(),Q=function(){function Ee(h){s(this,Ee),this.ctx=h,this.w=h.w}return o(Ee,[{key:"getStackedSeriesTotals",value:function(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],p=this.w,S=[];if(p.globals.series.length===0)return S;for(var _=0;_<p.globals.series[p.globals.maxValsInArrayIndex].length;_++){for(var k=0,T=0;T<p.globals.series.length;T++)p.globals.series[T][_]!==void 0&&h.indexOf(T)===-1&&(k+=p.globals.series[T][_]);S.push(k)}return S}},{key:"getSeriesTotalByIndex",value:function(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return h===null?this.w.config.series.reduce(function(p,S){return p+S},0):this.w.globals.series[h].reduce(function(p,S){return p+S},0)}},{key:"getStackedSeriesTotalsByGroups",value:function(){var h=this,p=this.w,S=[];return p.globals.seriesGroups.forEach(function(_){var k=[];p.config.series.forEach(function(B,q){_.indexOf(p.globals.seriesNames[q])>-1&&k.push(q)});var T=p.globals.series.map(function(B,q){return k.indexOf(q)===-1?q:-1}).filter(function(B){return B!==-1});S.push(h.getStackedSeriesTotals(T))}),S}},{key:"setSeriesYAxisMappings",value:function(){var h=this.w.globals,p=this.w.config,S=[],_=[],k=[],T=h.series.length>p.yaxis.length||p.yaxis.some(function(de){return Array.isArray(de.seriesName)});p.series.forEach(function(de,xe){k.push(xe),_.push(null)}),p.yaxis.forEach(function(de,xe){S[xe]=[]});var B=[];p.yaxis.forEach(function(de,xe){var Se=!1;if(de.seriesName){var ke=[];Array.isArray(de.seriesName)?ke=de.seriesName:ke.push(de.seriesName),ke.forEach(function(Re){p.series.forEach(function(Ge,Fe){if(Ge.name===Re){var st=Fe;xe===Fe||T?!T||k.indexOf(Fe)>-1?S[xe].push([xe,Fe]):console.warn("Series '"+Ge.name+"' referenced more than once in what looks like the new style. That is, when using either seriesName: [], or when there are more series than yaxes."):(S[Fe].push([Fe,xe]),st=xe),Se=!0,(st=k.indexOf(st))!==-1&&k.splice(st,1)}})})}Se||B.push(xe)}),S=S.map(function(de,xe){var Se=[];return de.forEach(function(ke){_[ke[1]]=ke[0],Se.push(ke[1])}),Se});for(var q=p.yaxis.length-1,te=0;te<B.length&&(q=B[te],S[q]=[],k);te++){var ue=k[0];k.shift(),S[q].push(ue),_[ue]=q}k.forEach(function(de){S[q].push(de),_[de]=q}),h.seriesYAxisMap=S.map(function(de){return de}),h.seriesYAxisReverseMap=_.map(function(de){return de}),h.seriesYAxisMap.forEach(function(de,xe){de.forEach(function(Se){p.series[Se]&&p.series[Se].group===void 0&&(p.series[Se].group="apexcharts-axis-".concat(xe.toString()))})})}},{key:"isSeriesNull",value:function(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return(h===null?this.w.config.series.filter(function(p){return p!==null}):this.w.config.series[h].data.filter(function(p){return p!==null})).length===0}},{key:"seriesHaveSameValues",value:function(h){return this.w.globals.series[h].every(function(p,S,_){return p===_[0]})}},{key:"getCategoryLabels",value:function(h){var p=this.w,S=h.slice();return p.config.xaxis.convertedCatToNumeric&&(S=h.map(function(_,k){return p.config.xaxis.labels.formatter(_-p.globals.minX+1)})),S}},{key:"getLargestSeries",value:function(){var h=this.w;h.globals.maxValsInArrayIndex=h.globals.series.map(function(p){return p.length}).indexOf(Math.max.apply(Math,h.globals.series.map(function(p){return p.length})))}},{key:"getLargestMarkerSize",value:function(){var h=this.w,p=0;return h.globals.markers.size.forEach(function(S){p=Math.max(p,S)}),h.config.markers.discrete&&h.config.markers.discrete.length&&h.config.markers.discrete.forEach(function(S){p=Math.max(p,S.size)}),p>0&&(h.config.markers.hover.size>0?p=h.config.markers.hover.size:p+=h.config.markers.hover.sizeOffset),h.globals.markers.largestSize=p,p}},{key:"getSeriesTotals",value:function(){var h=this.w;h.globals.seriesTotals=h.globals.series.map(function(p,S){var _=0;if(Array.isArray(p))for(var k=0;k<p.length;k++)_+=p[k];else _+=p;return _})}},{key:"getSeriesTotalsXRange",value:function(h,p){var S=this.w;return S.globals.series.map(function(_,k){for(var T=0,B=0;B<_.length;B++)S.globals.seriesX[k][B]>h&&S.globals.seriesX[k][B]<p&&(T+=_[B]);return T})}},{key:"getPercentSeries",value:function(){var h=this.w;h.globals.seriesPercent=h.globals.series.map(function(p,S){var _=[];if(Array.isArray(p))for(var k=0;k<p.length;k++){var T=h.globals.stackedSeriesTotals[k],B=0;T&&(B=100*p[k]/T),_.push(B)}else{var q=100*p/h.globals.seriesTotals.reduce(function(te,ue){return te+ue},0);_.push(q)}return _})}},{key:"getCalculatedRatios",value:function(){var h,p,S,_=this,k=this.w,T=k.globals,B=[],q=0,te=[],ue=.1,de=0;if(T.yRange=[],T.isMultipleYAxis)for(var xe=0;xe<T.minYArr.length;xe++)T.yRange.push(Math.abs(T.minYArr[xe]-T.maxYArr[xe])),te.push(0);else T.yRange.push(Math.abs(T.minY-T.maxY));T.xRange=Math.abs(T.maxX-T.minX),T.zRange=Math.abs(T.maxZ-T.minZ);for(var Se=0;Se<T.yRange.length;Se++)B.push(T.yRange[Se]/T.gridHeight);if(p=T.xRange/T.gridWidth,h=T.yRange/T.gridWidth,S=T.xRange/T.gridHeight,(q=T.zRange/T.gridHeight*16)||(q=1),T.minY!==Number.MIN_VALUE&&Math.abs(T.minY)!==0&&(T.hasNegs=!0),k.globals.seriesYAxisReverseMap.length>0){var ke=function(Ge,Fe){var st=k.config.yaxis[k.globals.seriesYAxisReverseMap[Fe]],se=Ge<0?-1:1;return Ge=Math.abs(Ge),st.logarithmic&&(Ge=_.getBaseLog(st.logBase,Ge)),-se*Ge/B[Fe]};if(T.isMultipleYAxis){te=[];for(var Re=0;Re<B.length;Re++)te.push(ke(T.minYArr[Re],Re))}else(te=[]).push(ke(T.minY,0)),T.minY!==Number.MIN_VALUE&&Math.abs(T.minY)!==0&&(ue=-T.minY/h,de=T.minX/p)}else(te=[]).push(0),ue=0,de=0;return{yRatio:B,invertedYRatio:h,zRatio:q,xRatio:p,invertedXRatio:S,baseLineInvertedY:ue,baseLineY:te,baseLineX:de}}},{key:"getLogSeries",value:function(h){var p=this,S=this.w;return S.globals.seriesLog=h.map(function(_,k){var T=S.globals.seriesYAxisReverseMap[k];return S.config.yaxis[T]&&S.config.yaxis[T].logarithmic?_.map(function(B){return B===null?null:p.getLogVal(S.config.yaxis[T].logBase,B,k)}):_}),S.globals.invalidLogScale?h:S.globals.seriesLog}},{key:"getBaseLog",value:function(h,p){return Math.log(p)/Math.log(h)}},{key:"getLogVal",value:function(h,p,S){if(p<=0)return 0;var _=this.w,k=_.globals.minYArr[S]===0?-1:this.getBaseLog(h,_.globals.minYArr[S]),T=(_.globals.maxYArr[S]===0?0:this.getBaseLog(h,_.globals.maxYArr[S]))-k;return p<1?p/T:(this.getBaseLog(h,p)-k)/T}},{key:"getLogYRatios",value:function(h){var p=this,S=this.w,_=this.w.globals;return _.yLogRatio=h.slice(),_.logYRange=_.yRange.map(function(k,T){var B=S.globals.seriesYAxisReverseMap[T];if(S.config.yaxis[B]&&p.w.config.yaxis[B].logarithmic){var q,te=-Number.MAX_VALUE,ue=Number.MIN_VALUE;return _.seriesLog.forEach(function(de,xe){de.forEach(function(Se){S.config.yaxis[xe]&&S.config.yaxis[xe].logarithmic&&(te=Math.max(Se,te),ue=Math.min(Se,ue))})}),q=Math.pow(_.yRange[T],Math.abs(ue-te)/_.yRange[T]),_.yLogRatio[T]=q/_.gridHeight,q}}),_.invalidLogScale?h.slice():_.yLogRatio}},{key:"drawSeriesByGroup",value:function(h,p,S,_){var k=this.w,T=[];return h.series.length>0&&p.forEach(function(B){var q=[],te=[];h.i.forEach(function(ue,de){k.config.series[ue].group===B&&(q.push(h.series[de]),te.push(ue))}),q.length>0&&T.push(_.draw(q,S,te))}),T}}],[{key:"checkComboSeries",value:function(h,p){var S=!1,_=0,k=0;return p===void 0&&(p="line"),h.length&&h[0].type!==void 0&&h.forEach(function(T){T.type!=="bar"&&T.type!=="column"&&T.type!=="candlestick"&&T.type!=="boxPlot"||_++,T.type!==void 0&&T.type!==p&&k++}),k>0&&(S=!0),{comboBarCount:_,comboCharts:S}}},{key:"extendArrayProps",value:function(h,p,S){var _,k,T,B,q,te;return(_=p)!==null&&_!==void 0&&_.yaxis&&(p=h.extendYAxis(p,S)),(k=p)!==null&&k!==void 0&&k.annotations&&(p.annotations.yaxis&&(p=h.extendYAxisAnnotations(p)),(T=p)!==null&&T!==void 0&&(B=T.annotations)!==null&&B!==void 0&&B.xaxis&&(p=h.extendXAxisAnnotations(p)),(q=p)!==null&&q!==void 0&&(te=q.annotations)!==null&&te!==void 0&&te.points&&(p=h.extendPointAnnotations(p))),p}}]),Ee}(),ne=function(){function Ee(h){s(this,Ee),this.w=h.w,this.annoCtx=h}return o(Ee,[{key:"setOrientations",value:function(h){var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,S=this.w;if(h.label.orientation==="vertical"){var _=p!==null?p:0,k=S.globals.dom.baseEl.querySelector(".apexcharts-xaxis-annotations .apexcharts-xaxis-annotation-label[rel='".concat(_,"']"));if(k!==null){var T=k.getBoundingClientRect();k.setAttribute("x",parseFloat(k.getAttribute("x"))-T.height+4);var B=h.label.position==="top"?T.width:-T.width;k.setAttribute("y",parseFloat(k.getAttribute("y"))+B);var q=this.annoCtx.graphics.rotateAroundCenter(k),te=q.x,ue=q.y;k.setAttribute("transform","rotate(-90 ".concat(te," ").concat(ue,")"))}}}},{key:"addBackgroundToAnno",value:function(h,p){var S=this.w;if(!h||!p.label.text||!String(p.label.text).trim())return null;var _=S.globals.dom.baseEl.querySelector(".apexcharts-grid").getBoundingClientRect(),k=h.getBoundingClientRect(),T=p.label.style.padding,B=T.left,q=T.right,te=T.top,ue=T.bottom;if(p.label.orientation==="vertical"){var de=[B,q,te,ue];te=de[0],ue=de[1],B=de[2],q=de[3]}var xe=k.left-_.left-B,Se=k.top-_.top-te,ke=this.annoCtx.graphics.drawRect(xe-S.globals.barPadForNumericAxis,Se,k.width+B+q,k.height+te+ue,p.label.borderRadius,p.label.style.background,1,p.label.borderWidth,p.label.borderColor,0);return p.id&&ke.node.classList.add(p.id),ke}},{key:"annotationsBackground",value:function(){var h=this,p=this.w,S=function(_,k,T){var B=p.globals.dom.baseEl.querySelector(".apexcharts-".concat(T,"-annotations .apexcharts-").concat(T,"-annotation-label[rel='").concat(k,"']"));if(B){var q=B.parentNode,te=h.addBackgroundToAnno(B,_);te&&(q.insertBefore(te.node,B),_.label.mouseEnter&&te.node.addEventListener("mouseenter",_.label.mouseEnter.bind(h,_)),_.label.mouseLeave&&te.node.addEventListener("mouseleave",_.label.mouseLeave.bind(h,_)),_.label.click&&te.node.addEventListener("click",_.label.click.bind(h,_)))}};p.config.annotations.xaxis.forEach(function(_,k){return S(_,k,"xaxis")}),p.config.annotations.yaxis.forEach(function(_,k){return S(_,k,"yaxis")}),p.config.annotations.points.forEach(function(_,k){return S(_,k,"point")})}},{key:"getY1Y2",value:function(h,p){var S,_=this.w,k=h==="y1"?p.y:p.y2,T=!1;if(this.annoCtx.invertAxis){var B=_.config.xaxis.convertedCatToNumeric?_.globals.categoryLabels:_.globals.labels,q=B.indexOf(k),te=_.globals.dom.baseEl.querySelector(".apexcharts-yaxis-texts-g text:nth-child(".concat(q+1,")"));S=te?parseFloat(te.getAttribute("y")):(_.globals.gridHeight/B.length-1)*(q+1)-_.globals.barHeight,p.seriesIndex!==void 0&&_.globals.barHeight&&(S-=_.globals.barHeight/2*(_.globals.series.length-1)-_.globals.barHeight*p.seriesIndex)}else{var ue,de=_.globals.seriesYAxisMap[p.yAxisIndex][0],xe=_.config.yaxis[p.yAxisIndex].logarithmic?new Q(this.annoCtx.ctx).getLogVal(_.config.yaxis[p.yAxisIndex].logBase,k,de)/_.globals.yLogRatio[de]:(k-_.globals.minYArr[de])/(_.globals.yRange[de]/_.globals.gridHeight);S=_.globals.gridHeight-Math.min(Math.max(xe,0),_.globals.gridHeight),T=xe>_.globals.gridHeight||xe<0,!p.marker||p.y!==void 0&&p.y!==null||(S=0),(ue=_.config.yaxis[p.yAxisIndex])!==null&&ue!==void 0&&ue.reversed&&(S=xe)}return typeof k=="string"&&k.includes("px")&&(S=parseFloat(k)),{yP:S,clipped:T}}},{key:"getX1X2",value:function(h,p){var S=this.w,_=h==="x1"?p.x:p.x2,k=this.annoCtx.invertAxis?S.globals.minY:S.globals.minX,T=this.annoCtx.invertAxis?S.globals.maxY:S.globals.maxX,B=this.annoCtx.invertAxis?S.globals.yRange[0]:S.globals.xRange,q=!1,te=this.annoCtx.inversedReversedAxis?(T-_)/(B/S.globals.gridWidth):(_-k)/(B/S.globals.gridWidth);return S.config.xaxis.type!=="category"&&!S.config.xaxis.convertedCatToNumeric||this.annoCtx.invertAxis||S.globals.dataFormatXNumeric||S.config.chart.sparkline.enabled||(te=this.getStringX(_)),typeof _=="string"&&_.includes("px")&&(te=parseFloat(_)),_==null&&p.marker&&(te=S.globals.gridWidth),p.seriesIndex!==void 0&&S.globals.barWidth&&!this.annoCtx.invertAxis&&(te-=S.globals.barWidth/2*(S.globals.series.length-1)-S.globals.barWidth*p.seriesIndex),te>S.globals.gridWidth?(te=S.globals.gridWidth,q=!0):te<0&&(te=0,q=!0),{x:te,clipped:q}}},{key:"getStringX",value:function(h){var p=this.w,S=h;p.config.xaxis.convertedCatToNumeric&&p.globals.categoryLabels.length&&(h=p.globals.categoryLabels.indexOf(h)+1);var _=p.globals.labels.map(function(T){return Array.isArray(T)?T.join(" "):T}).indexOf(h),k=p.globals.dom.baseEl.querySelector(".apexcharts-xaxis-texts-g text:nth-child(".concat(_+1,")"));return k&&(S=parseFloat(k.getAttribute("x"))),S}}]),Ee}(),J=function(){function Ee(h){s(this,Ee),this.w=h.w,this.annoCtx=h,this.invertAxis=this.annoCtx.invertAxis,this.helpers=new ne(this.annoCtx)}return o(Ee,[{key:"addXaxisAnnotation",value:function(h,p,S){var _,k=this.w,T=this.helpers.getX1X2("x1",h),B=T.x,q=T.clipped,te=!0,ue=h.label.text,de=h.strokeDashArray;if(F.isNumber(B)){if(h.x2===null||h.x2===void 0){if(!q){var xe=this.annoCtx.graphics.drawLine(B+h.offsetX,0+h.offsetY,B+h.offsetX,k.globals.gridHeight+h.offsetY,h.borderColor,de,h.borderWidth);p.appendChild(xe.node),h.id&&xe.node.classList.add(h.id)}}else{var Se=this.helpers.getX1X2("x2",h);if(_=Se.x,te=Se.clipped,!q||!te){if(_<B){var ke=B;B=_,_=ke}var Re=this.annoCtx.graphics.drawRect(B+h.offsetX,0+h.offsetY,_-B,k.globals.gridHeight+h.offsetY,0,h.fillColor,h.opacity,1,h.borderColor,de);Re.node.classList.add("apexcharts-annotation-rect"),Re.attr("clip-path","url(#gridRectMask".concat(k.globals.cuid,")")),p.appendChild(Re.node),h.id&&Re.node.classList.add(h.id)}}if(!q||!te){var Ge=this.annoCtx.graphics.getTextRects(ue,parseFloat(h.label.style.fontSize)),Fe=h.label.position==="top"?4:h.label.position==="center"?k.globals.gridHeight/2+(h.label.orientation==="vertical"?Ge.width/2:0):k.globals.gridHeight,st=this.annoCtx.graphics.drawText({x:B+h.label.offsetX,y:Fe+h.label.offsetY-(h.label.orientation==="vertical"?h.label.position==="top"?Ge.width/2-12:-Ge.width/2:0),text:ue,textAnchor:h.label.textAnchor,fontSize:h.label.style.fontSize,fontFamily:h.label.style.fontFamily,fontWeight:h.label.style.fontWeight,foreColor:h.label.style.color,cssClass:"apexcharts-xaxis-annotation-label ".concat(h.label.style.cssClass," ").concat(h.id?h.id:"")});st.attr({rel:S}),p.appendChild(st.node),this.annoCtx.helpers.setOrientations(h,S)}}}},{key:"drawXAxisAnnotations",value:function(){var h=this,p=this.w,S=this.annoCtx.graphics.group({class:"apexcharts-xaxis-annotations"});return p.config.annotations.xaxis.map(function(_,k){h.addXaxisAnnotation(_,S.node,k)}),S}}]),Ee}(),X=function(){function Ee(h){s(this,Ee),this.ctx=h,this.w=h.w,this.months31=[1,3,5,7,8,10,12],this.months30=[2,4,6,9,11],this.daysCntOfYear=[0,31,59,90,120,151,181,212,243,273,304,334]}return o(Ee,[{key:"isValidDate",value:function(h){return typeof h!="number"&&!isNaN(this.parseDate(h))}},{key:"getTimeStamp",value:function(h){return Date.parse(h)?this.w.config.xaxis.labels.datetimeUTC?new Date(new Date(h).toISOString().substr(0,25)).getTime():new Date(h).getTime():h}},{key:"getDate",value:function(h){return this.w.config.xaxis.labels.datetimeUTC?new Date(new Date(h).toUTCString()):new Date(h)}},{key:"parseDate",value:function(h){var p=Date.parse(h);if(!isNaN(p))return this.getTimeStamp(h);var S=Date.parse(h.replace(/-/g,"/").replace(/[a-z]+/gi," "));return S=this.getTimeStamp(S)}},{key:"parseDateWithTimezone",value:function(h){return Date.parse(h.replace(/-/g,"/").replace(/[a-z]+/gi," "))}},{key:"formatDate",value:function(h,p){var S=this.w.globals.locale,_=this.w.config.xaxis.labels.datetimeUTC,k=["\0"].concat(N(S.months)),T=[""].concat(N(S.shortMonths)),B=[""].concat(N(S.days)),q=[""].concat(N(S.shortDays));function te(Je,ct){var gt=Je+"";for(ct=ct||2;gt.length<ct;)gt="0"+gt;return gt}var ue=_?h.getUTCFullYear():h.getFullYear();p=(p=(p=p.replace(/(^|[^\\])yyyy+/g,"$1"+ue)).replace(/(^|[^\\])yy/g,"$1"+ue.toString().substr(2,2))).replace(/(^|[^\\])y/g,"$1"+ue);var de=(_?h.getUTCMonth():h.getMonth())+1;p=(p=(p=(p=p.replace(/(^|[^\\])MMMM+/g,"$1"+k[0])).replace(/(^|[^\\])MMM/g,"$1"+T[0])).replace(/(^|[^\\])MM/g,"$1"+te(de))).replace(/(^|[^\\])M/g,"$1"+de);var xe=_?h.getUTCDate():h.getDate();p=(p=(p=(p=p.replace(/(^|[^\\])dddd+/g,"$1"+B[0])).replace(/(^|[^\\])ddd/g,"$1"+q[0])).replace(/(^|[^\\])dd/g,"$1"+te(xe))).replace(/(^|[^\\])d/g,"$1"+xe);var Se=_?h.getUTCHours():h.getHours(),ke=Se>12?Se-12:Se===0?12:Se;p=(p=(p=(p=p.replace(/(^|[^\\])HH+/g,"$1"+te(Se))).replace(/(^|[^\\])H/g,"$1"+Se)).replace(/(^|[^\\])hh+/g,"$1"+te(ke))).replace(/(^|[^\\])h/g,"$1"+ke);var Re=_?h.getUTCMinutes():h.getMinutes();p=(p=p.replace(/(^|[^\\])mm+/g,"$1"+te(Re))).replace(/(^|[^\\])m/g,"$1"+Re);var Ge=_?h.getUTCSeconds():h.getSeconds();p=(p=p.replace(/(^|[^\\])ss+/g,"$1"+te(Ge))).replace(/(^|[^\\])s/g,"$1"+Ge);var Fe=_?h.getUTCMilliseconds():h.getMilliseconds();p=p.replace(/(^|[^\\])fff+/g,"$1"+te(Fe,3)),Fe=Math.round(Fe/10),p=p.replace(/(^|[^\\])ff/g,"$1"+te(Fe)),Fe=Math.round(Fe/10);var st=Se<12?"AM":"PM";p=(p=(p=p.replace(/(^|[^\\])f/g,"$1"+Fe)).replace(/(^|[^\\])TT+/g,"$1"+st)).replace(/(^|[^\\])T/g,"$1"+st.charAt(0));var se=st.toLowerCase();p=(p=p.replace(/(^|[^\\])tt+/g,"$1"+se)).replace(/(^|[^\\])t/g,"$1"+se.charAt(0));var Ce=-h.getTimezoneOffset(),Be=_||!Ce?"Z":Ce>0?"+":"-";if(!_){var De=(Ce=Math.abs(Ce))%60;Be+=te(Math.floor(Ce/60))+":"+te(De)}p=p.replace(/(^|[^\\])K/g,"$1"+Be);var _e=(_?h.getUTCDay():h.getDay())+1;return p=(p=(p=(p=(p=p.replace(new RegExp(B[0],"g"),B[_e])).replace(new RegExp(q[0],"g"),q[_e])).replace(new RegExp(k[0],"g"),k[de])).replace(new RegExp(T[0],"g"),T[de])).replace(/\\(.)/g,"$1")}},{key:"getTimeUnitsfromTimestamp",value:function(h,p,S){var _=this.w;_.config.xaxis.min!==void 0&&(h=_.config.xaxis.min),_.config.xaxis.max!==void 0&&(p=_.config.xaxis.max);var k=this.getDate(h),T=this.getDate(p),B=this.formatDate(k,"yyyy MM dd HH mm ss fff").split(" "),q=this.formatDate(T,"yyyy MM dd HH mm ss fff").split(" ");return{minMillisecond:parseInt(B[6],10),maxMillisecond:parseInt(q[6],10),minSecond:parseInt(B[5],10),maxSecond:parseInt(q[5],10),minMinute:parseInt(B[4],10),maxMinute:parseInt(q[4],10),minHour:parseInt(B[3],10),maxHour:parseInt(q[3],10),minDate:parseInt(B[2],10),maxDate:parseInt(q[2],10),minMonth:parseInt(B[1],10)-1,maxMonth:parseInt(q[1],10)-1,minYear:parseInt(B[0],10),maxYear:parseInt(q[0],10)}}},{key:"isLeapYear",value:function(h){return h%4==0&&h%100!=0||h%400==0}},{key:"calculcateLastDaysOfMonth",value:function(h,p,S){return this.determineDaysOfMonths(h,p)-S}},{key:"determineDaysOfYear",value:function(h){var p=365;return this.isLeapYear(h)&&(p=366),p}},{key:"determineRemainingDaysOfYear",value:function(h,p,S){var _=this.daysCntOfYear[p]+S;return p>1&&this.isLeapYear()&&_++,_}},{key:"determineDaysOfMonths",value:function(h,p){var S=30;switch(h=F.monthMod(h),!0){case this.months30.indexOf(h)>-1:h===2&&(S=this.isLeapYear(p)?29:28);break;case this.months31.indexOf(h)>-1:default:S=31}return S}}]),Ee}(),re=function(){function Ee(h){s(this,Ee),this.ctx=h,this.w=h.w,this.tooltipKeyFormat="dd MMM"}return o(Ee,[{key:"xLabelFormat",value:function(h,p,S,_){var k=this.w;if(k.config.xaxis.type==="datetime"&&k.config.xaxis.labels.formatter===void 0&&k.config.tooltip.x.formatter===void 0){var T=new X(this.ctx);return T.formatDate(T.getDate(p),k.config.tooltip.x.format)}return h(p,S,_)}},{key:"defaultGeneralFormatter",value:function(h){return Array.isArray(h)?h.map(function(p){return p}):h}},{key:"defaultYFormatter",value:function(h,p,S){var _=this.w;if(F.isNumber(h))if(_.globals.yValueDecimal!==0)h=h.toFixed(p.decimalsInFloat!==void 0?p.decimalsInFloat:_.globals.yValueDecimal);else{var k=h.toFixed(0);h=h==k?k:h.toFixed(1)}return h}},{key:"setLabelFormatters",value:function(){var h=this,p=this.w;return p.globals.xaxisTooltipFormatter=function(S){return h.defaultGeneralFormatter(S)},p.globals.ttKeyFormatter=function(S){return h.defaultGeneralFormatter(S)},p.globals.ttZFormatter=function(S){return S},p.globals.legendFormatter=function(S){return h.defaultGeneralFormatter(S)},p.config.xaxis.labels.formatter!==void 0?p.globals.xLabelFormatter=p.config.xaxis.labels.formatter:p.globals.xLabelFormatter=function(S){if(F.isNumber(S)){if(!p.config.xaxis.convertedCatToNumeric&&p.config.xaxis.type==="numeric"){if(F.isNumber(p.config.xaxis.decimalsInFloat))return S.toFixed(p.config.xaxis.decimalsInFloat);var _=p.globals.maxX-p.globals.minX;return _>0&&_<100?S.toFixed(1):S.toFixed(0)}return p.globals.isBarHorizontal&&p.globals.maxY-p.globals.minYArr<4?S.toFixed(1):S.toFixed(0)}return S},typeof p.config.tooltip.x.formatter=="function"?p.globals.ttKeyFormatter=p.config.tooltip.x.formatter:p.globals.ttKeyFormatter=p.globals.xLabelFormatter,typeof p.config.xaxis.tooltip.formatter=="function"&&(p.globals.xaxisTooltipFormatter=p.config.xaxis.tooltip.formatter),(Array.isArray(p.config.tooltip.y)||p.config.tooltip.y.formatter!==void 0)&&(p.globals.ttVal=p.config.tooltip.y),p.config.tooltip.z.formatter!==void 0&&(p.globals.ttZFormatter=p.config.tooltip.z.formatter),p.config.legend.formatter!==void 0&&(p.globals.legendFormatter=p.config.legend.formatter),p.config.yaxis.forEach(function(S,_){S.labels.formatter!==void 0?p.globals.yLabelFormatters[_]=S.labels.formatter:p.globals.yLabelFormatters[_]=function(k){return p.globals.xyCharts?Array.isArray(k)?k.map(function(T){return h.defaultYFormatter(T,S,_)}):h.defaultYFormatter(k,S,_):k}}),p.globals}},{key:"heatmapLabelFormatters",value:function(){var h=this.w;if(h.config.chart.type==="heatmap"){h.globals.yAxisScale[0].result=h.globals.seriesNames.slice();var p=h.globals.seriesNames.reduce(function(S,_){return S.length>_.length?S:_},0);h.globals.yAxisScale[0].niceMax=p,h.globals.yAxisScale[0].niceMin=p}}}]),Ee}(),pe=function(){function Ee(h){s(this,Ee),this.ctx=h,this.w=h.w}return o(Ee,[{key:"getLabel",value:function(h,p,S,_){var k=arguments.length>4&&arguments[4]!==void 0?arguments[4]:[],T=arguments.length>5&&arguments[5]!==void 0?arguments[5]:"12px",B=!(arguments.length>6&&arguments[6]!==void 0)||arguments[6],q=this.w,te=h[_]===void 0?"":h[_],ue=te,de=q.globals.xLabelFormatter,xe=q.config.xaxis.labels.formatter,Se=!1,ke=new re(this.ctx),Re=te;B&&(ue=ke.xLabelFormat(de,te,Re,{i:_,dateFormatter:new X(this.ctx).formatDate,w:q}),xe!==void 0&&(ue=xe(te,h[_],{i:_,dateFormatter:new X(this.ctx).formatDate,w:q})));var Ge,Fe;p.length>0?(Ge=p[_].unit,Fe=null,p.forEach(function(Be){Be.unit==="month"?Fe="year":Be.unit==="day"?Fe="month":Be.unit==="hour"?Fe="day":Be.unit==="minute"&&(Fe="hour")}),Se=Fe===Ge,S=p[_].position,ue=p[_].value):q.config.xaxis.type==="datetime"&&xe===void 0&&(ue=""),ue===void 0&&(ue=""),ue=Array.isArray(ue)?ue:ue.toString();var st=new z(this.ctx),se={};se=q.globals.rotateXLabels&&B?st.getTextRects(ue,parseInt(T,10),null,"rotate(".concat(q.config.xaxis.labels.rotate," 0 0)"),!1):st.getTextRects(ue,parseInt(T,10));var Ce=!q.config.xaxis.labels.showDuplicates&&this.ctx.timeScale;return!Array.isArray(ue)&&(String(ue)==="NaN"||k.indexOf(ue)>=0&&Ce)&&(ue=""),{x:S,text:ue,textRect:se,isBold:Se}}},{key:"checkLabelBasedOnTickamount",value:function(h,p,S){var _=this.w,k=_.config.xaxis.tickAmount;return k==="dataPoints"&&(k=Math.round(_.globals.gridWidth/120)),k>S||h%Math.round(S/(k+1))==0||(p.text=""),p}},{key:"checkForOverflowingLabels",value:function(h,p,S,_,k){var T=this.w;if(h===0&&T.globals.skipFirstTimelinelabel&&(p.text=""),h===S-1&&T.globals.skipLastTimelinelabel&&(p.text=""),T.config.xaxis.labels.hideOverlappingLabels&&_.length>0){var B=k[k.length-1];p.x<B.textRect.width/(T.globals.rotateXLabels?Math.abs(T.config.xaxis.labels.rotate)/12:1.01)+B.x&&(p.text="")}return p}},{key:"checkForReversedLabels",value:function(h,p){var S=this.w;return S.config.yaxis[h]&&S.config.yaxis[h].reversed&&p.reverse(),p}},{key:"yAxisAllSeriesCollapsed",value:function(h){var p=this.w.globals;return!p.seriesYAxisMap[h].some(function(S){return p.collapsedSeriesIndices.indexOf(S)===-1})}},{key:"translateYAxisIndex",value:function(h){var p=this.w,S=p.globals,_=p.config.yaxis;return S.series.length>_.length||_.some(function(k){return Array.isArray(k.seriesName)})?h:S.seriesYAxisReverseMap[h]}},{key:"isYAxisHidden",value:function(h){var p=this.w,S=p.config.yaxis[h];if(!S.show||this.yAxisAllSeriesCollapsed(h))return!0;if(!S.showForNullSeries){var _=p.globals.seriesYAxisMap[h],k=new Q(this.ctx);return _.every(function(T){return k.isSeriesNull(T)})}return!1}},{key:"getYAxisForeColor",value:function(h,p){var S=this.w;return Array.isArray(h)&&S.globals.yAxisScale[p]&&this.ctx.theme.pushExtraColors(h,S.globals.yAxisScale[p].result.length,!1),h}},{key:"drawYAxisTicks",value:function(h,p,S,_,k,T,B){var q=this.w,te=new z(this.ctx),ue=q.globals.translateY+q.config.yaxis[k].labels.offsetY;if(q.globals.isBarHorizontal?ue=0:q.config.chart.type==="heatmap"&&(ue+=T/2),_.show&&p>0){q.config.yaxis[k].opposite===!0&&(h+=_.width);for(var de=p;de>=0;de--){var xe=te.drawLine(h+S.offsetX-_.width+_.offsetX,ue+_.offsetY,h+S.offsetX+_.offsetX,ue+_.offsetY,_.color);B.add(xe),ue+=T}}}}]),Ee}(),Y=function(){function Ee(h){s(this,Ee),this.w=h.w,this.annoCtx=h,this.helpers=new ne(this.annoCtx),this.axesUtils=new pe(this.annoCtx)}return o(Ee,[{key:"addYaxisAnnotation",value:function(h,p,S){var _,k=this.w,T=h.strokeDashArray,B=this.helpers.getY1Y2("y1",h),q=B.yP,te=B.clipped,ue=!0,de=!1,xe=h.label.text;if(h.y2===null||h.y2===void 0){if(!te){de=!0;var Se=this.annoCtx.graphics.drawLine(0+h.offsetX,q+h.offsetY,this._getYAxisAnnotationWidth(h),q+h.offsetY,h.borderColor,T,h.borderWidth);p.appendChild(Se.node),h.id&&Se.node.classList.add(h.id)}}else{if(_=(B=this.helpers.getY1Y2("y2",h)).yP,ue=B.clipped,_>q){var ke=q;q=_,_=ke}if(!te||!ue){de=!0;var Re=this.annoCtx.graphics.drawRect(0+h.offsetX,_+h.offsetY,this._getYAxisAnnotationWidth(h),q-_,0,h.fillColor,h.opacity,1,h.borderColor,T);Re.node.classList.add("apexcharts-annotation-rect"),Re.attr("clip-path","url(#gridRectMask".concat(k.globals.cuid,")")),p.appendChild(Re.node),h.id&&Re.node.classList.add(h.id)}}if(de){var Ge=h.label.position==="right"?k.globals.gridWidth:h.label.position==="center"?k.globals.gridWidth/2:0,Fe=this.annoCtx.graphics.drawText({x:Ge+h.label.offsetX,y:(_??q)+h.label.offsetY-3,text:xe,textAnchor:h.label.textAnchor,fontSize:h.label.style.fontSize,fontFamily:h.label.style.fontFamily,fontWeight:h.label.style.fontWeight,foreColor:h.label.style.color,cssClass:"apexcharts-yaxis-annotation-label ".concat(h.label.style.cssClass," ").concat(h.id?h.id:"")});Fe.attr({rel:S}),p.appendChild(Fe.node)}}},{key:"_getYAxisAnnotationWidth",value:function(h){var p=this.w;return p.globals.gridWidth,(h.width.indexOf("%")>-1?p.globals.gridWidth*parseInt(h.width,10)/100:parseInt(h.width,10))+h.offsetX}},{key:"drawYAxisAnnotations",value:function(){var h=this,p=this.w,S=this.annoCtx.graphics.group({class:"apexcharts-yaxis-annotations"});return p.config.annotations.yaxis.forEach(function(_,k){_.yAxisIndex=h.axesUtils.translateYAxisIndex(_.yAxisIndex),h.axesUtils.isYAxisHidden(_.yAxisIndex)&&h.axesUtils.yAxisAllSeriesCollapsed(_.yAxisIndex)||h.addYaxisAnnotation(_,S.node,k)}),S}}]),Ee}(),ie=function(){function Ee(h){s(this,Ee),this.w=h.w,this.annoCtx=h,this.helpers=new ne(this.annoCtx)}return o(Ee,[{key:"addPointAnnotation",value:function(h,p,S){if(!(this.w.globals.collapsedSeriesIndices.indexOf(h.seriesIndex)>-1)){var _=this.helpers.getX1X2("x1",h),k=_.x,T=_.clipped,B=(_=this.helpers.getY1Y2("y1",h)).yP,q=_.clipped;if(F.isNumber(k)&&!q&&!T){var te={pSize:h.marker.size,pointStrokeWidth:h.marker.strokeWidth,pointFillColor:h.marker.fillColor,pointStrokeColor:h.marker.strokeColor,shape:h.marker.shape,pRadius:h.marker.radius,class:"apexcharts-point-annotation-marker ".concat(h.marker.cssClass," ").concat(h.id?h.id:"")},ue=this.annoCtx.graphics.drawMarker(k+h.marker.offsetX,B+h.marker.offsetY,te);p.appendChild(ue.node);var de=h.label.text?h.label.text:"",xe=this.annoCtx.graphics.drawText({x:k+h.label.offsetX,y:B+h.label.offsetY-h.marker.size-parseFloat(h.label.style.fontSize)/1.6,text:de,textAnchor:h.label.textAnchor,fontSize:h.label.style.fontSize,fontFamily:h.label.style.fontFamily,fontWeight:h.label.style.fontWeight,foreColor:h.label.style.color,cssClass:"apexcharts-point-annotation-label ".concat(h.label.style.cssClass," ").concat(h.id?h.id:"")});if(xe.attr({rel:S}),p.appendChild(xe.node),h.customSVG.SVG){var Se=this.annoCtx.graphics.group({class:"apexcharts-point-annotations-custom-svg "+h.customSVG.cssClass});Se.attr({transform:"translate(".concat(k+h.customSVG.offsetX,", ").concat(B+h.customSVG.offsetY,")")}),Se.node.innerHTML=h.customSVG.SVG,p.appendChild(Se.node)}if(h.image.path){var ke=h.image.width?h.image.width:20,Re=h.image.height?h.image.height:20;ue=this.annoCtx.addImage({x:k+h.image.offsetX-ke/2,y:B+h.image.offsetY-Re/2,width:ke,height:Re,path:h.image.path,appendTo:".apexcharts-point-annotations"})}h.mouseEnter&&ue.node.addEventListener("mouseenter",h.mouseEnter.bind(this,h)),h.mouseLeave&&ue.node.addEventListener("mouseleave",h.mouseLeave.bind(this,h)),h.click&&ue.node.addEventListener("click",h.click.bind(this,h))}}}},{key:"drawPointAnnotations",value:function(){var h=this,p=this.w,S=this.annoCtx.graphics.group({class:"apexcharts-point-annotations"});return p.config.annotations.points.map(function(_,k){h.addPointAnnotation(_,S.node,k)}),S}}]),Ee}(),oe={name:"en",options:{months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],toolbar:{exportToSVG:"Download SVG",exportToPNG:"Download PNG",exportToCSV:"Download CSV",menu:"Menu",selection:"Selection",selectionZoom:"Selection Zoom",zoomIn:"Zoom In",zoomOut:"Zoom Out",pan:"Panning",reset:"Reset Zoom"}}},G=function(){function Ee(){s(this,Ee),this.yAxis={show:!0,showAlways:!1,showForNullSeries:!0,seriesName:void 0,opposite:!1,reversed:!1,logarithmic:!1,logBase:10,tickAmount:void 0,stepSize:void 0,forceNiceScale:!1,max:void 0,min:void 0,floating:!1,decimalsInFloat:void 0,labels:{show:!0,showDuplicates:!1,minWidth:0,maxWidth:160,offsetX:0,offsetY:0,align:void 0,rotate:0,padding:20,style:{colors:[],fontSize:"11px",fontWeight:400,fontFamily:void 0,cssClass:""},formatter:void 0},axisBorder:{show:!1,color:"#e0e0e0",width:1,offsetX:0,offsetY:0},axisTicks:{show:!1,color:"#e0e0e0",width:6,offsetX:0,offsetY:0},title:{text:void 0,rotate:-90,offsetY:0,offsetX:0,style:{color:void 0,fontSize:"11px",fontWeight:900,fontFamily:void 0,cssClass:""}},tooltip:{enabled:!1,offsetX:0},crosshairs:{show:!0,position:"front",stroke:{color:"#b6b6b6",width:1,dashArray:0}}},this.pointAnnotation={id:void 0,x:0,y:null,yAxisIndex:0,seriesIndex:void 0,mouseEnter:void 0,mouseLeave:void 0,click:void 0,marker:{size:4,fillColor:"#fff",strokeWidth:2,strokeColor:"#333",shape:"circle",offsetX:0,offsetY:0,cssClass:""},label:{borderColor:"#c2c2c2",borderWidth:1,borderRadius:2,text:void 0,textAnchor:"middle",offsetX:0,offsetY:0,mouseEnter:void 0,mouseLeave:void 0,click:void 0,style:{background:"#fff",color:void 0,fontSize:"11px",fontFamily:void 0,fontWeight:400,cssClass:"",padding:{left:5,right:5,top:2,bottom:2}}},customSVG:{SVG:void 0,cssClass:void 0,offsetX:0,offsetY:0},image:{path:void 0,width:20,height:20,offsetX:0,offsetY:0}},this.yAxisAnnotation={id:void 0,y:0,y2:null,strokeDashArray:1,fillColor:"#c2c2c2",borderColor:"#c2c2c2",borderWidth:1,opacity:.3,offsetX:0,offsetY:0,width:"100%",yAxisIndex:0,label:{borderColor:"#c2c2c2",borderWidth:1,borderRadius:2,text:void 0,textAnchor:"end",position:"right",offsetX:0,offsetY:-3,mouseEnter:void 0,mouseLeave:void 0,click:void 0,style:{background:"#fff",color:void 0,fontSize:"11px",fontFamily:void 0,fontWeight:400,cssClass:"",padding:{left:5,right:5,top:2,bottom:2}}}},this.xAxisAnnotation={id:void 0,x:0,x2:null,strokeDashArray:1,fillColor:"#c2c2c2",borderColor:"#c2c2c2",borderWidth:1,opacity:.3,offsetX:0,offsetY:0,label:{borderColor:"#c2c2c2",borderWidth:1,borderRadius:2,text:void 0,textAnchor:"middle",orientation:"vertical",position:"top",offsetX:0,offsetY:0,mouseEnter:void 0,mouseLeave:void 0,click:void 0,style:{background:"#fff",color:void 0,fontSize:"11px",fontFamily:void 0,fontWeight:400,cssClass:"",padding:{left:5,right:5,top:2,bottom:2}}}},this.text={x:0,y:0,text:"",textAnchor:"start",foreColor:void 0,fontSize:"13px",fontFamily:void 0,fontWeight:400,appendTo:".apexcharts-annotations",backgroundColor:"transparent",borderColor:"#c2c2c2",borderRadius:0,borderWidth:0,paddingLeft:4,paddingRight:4,paddingTop:2,paddingBottom:2}}return o(Ee,[{key:"init",value:function(){return{annotations:{yaxis:[this.yAxisAnnotation],xaxis:[this.xAxisAnnotation],points:[this.pointAnnotation],texts:[],images:[],shapes:[]},chart:{animations:{enabled:!0,easing:"easeinout",speed:800,animateGradually:{delay:150,enabled:!0},dynamicAnimation:{enabled:!0,speed:350}},background:"",locales:[oe],defaultLocale:"en",dropShadow:{enabled:!1,enabledOnSeries:void 0,top:2,left:2,blur:4,color:"#000",opacity:.35},events:{animationEnd:void 0,beforeMount:void 0,mounted:void 0,updated:void 0,click:void 0,mouseMove:void 0,mouseLeave:void 0,xAxisLabelClick:void 0,legendClick:void 0,markerClick:void 0,selection:void 0,dataPointSelection:void 0,dataPointMouseEnter:void 0,dataPointMouseLeave:void 0,beforeZoom:void 0,beforeResetZoom:void 0,zoomed:void 0,scrolled:void 0,brushScrolled:void 0},foreColor:"#373d3f",fontFamily:"Helvetica, Arial, sans-serif",height:"auto",parentHeightOffset:15,redrawOnParentResize:!0,redrawOnWindowResize:!0,id:void 0,group:void 0,nonce:void 0,offsetX:0,offsetY:0,selection:{enabled:!1,type:"x",fill:{color:"#24292e",opacity:.1},stroke:{width:1,color:"#24292e",opacity:.4,dashArray:3},xaxis:{min:void 0,max:void 0},yaxis:{min:void 0,max:void 0}},sparkline:{enabled:!1},brush:{enabled:!1,autoScaleYaxis:!0,target:void 0,targets:void 0},stacked:!1,stackOnlyBar:!0,stackType:"normal",toolbar:{show:!0,offsetX:0,offsetY:0,tools:{download:!0,selection:!0,zoom:!0,zoomin:!0,zoomout:!0,pan:!0,reset:!0,customIcons:[]},export:{csv:{filename:void 0,columnDelimiter:",",headerCategory:"category",headerValue:"value",categoryFormatter:void 0,valueFormatter:void 0},png:{filename:void 0},svg:{filename:void 0},scale:void 0,width:void 0},autoSelected:"zoom"},type:"line",width:"100%",zoom:{enabled:!0,type:"x",autoScaleYaxis:!1,allowMouseWheelZoom:!0,zoomedArea:{fill:{color:"#90CAF9",opacity:.4},stroke:{color:"#0D47A1",opacity:.4,width:1}}}},plotOptions:{line:{isSlopeChart:!1},area:{fillTo:"origin"},bar:{horizontal:!1,columnWidth:"70%",barHeight:"70%",distributed:!1,borderRadius:0,borderRadiusApplication:"around",borderRadiusWhenStacked:"last",rangeBarOverlap:!0,rangeBarGroupRows:!1,hideZeroBarsWhenGrouped:!1,isDumbbell:!1,dumbbellColors:void 0,isFunnel:!1,isFunnel3d:!0,colors:{ranges:[],backgroundBarColors:[],backgroundBarOpacity:1,backgroundBarRadius:0},dataLabels:{position:"top",maxItems:100,hideOverflowingLabels:!0,orientation:"horizontal",total:{enabled:!1,formatter:void 0,offsetX:0,offsetY:0,style:{color:"#373d3f",fontSize:"12px",fontFamily:void 0,fontWeight:600}}}},bubble:{zScaling:!0,minBubbleRadius:void 0,maxBubbleRadius:void 0},candlestick:{colors:{upward:"#00B746",downward:"#EF403C"},wick:{useFillColor:!0}},boxPlot:{colors:{upper:"#00E396",lower:"#008FFB"}},heatmap:{radius:2,enableShades:!0,shadeIntensity:.5,reverseNegativeShade:!1,distributed:!1,useFillColorAsStroke:!1,colorScale:{inverse:!1,ranges:[],min:void 0,max:void 0}},treemap:{enableShades:!0,shadeIntensity:.5,distributed:!1,reverseNegativeShade:!1,useFillColorAsStroke:!1,borderRadius:4,dataLabels:{format:"scale"},colorScale:{inverse:!1,ranges:[],min:void 0,max:void 0}},radialBar:{inverseOrder:!1,startAngle:0,endAngle:360,offsetX:0,offsetY:0,hollow:{margin:5,size:"50%",background:"transparent",image:void 0,imageWidth:150,imageHeight:150,imageOffsetX:0,imageOffsetY:0,imageClipped:!0,position:"front",dropShadow:{enabled:!1,top:0,left:0,blur:3,color:"#000",opacity:.5}},track:{show:!0,startAngle:void 0,endAngle:void 0,background:"#f2f2f2",strokeWidth:"97%",opacity:1,margin:5,dropShadow:{enabled:!1,top:0,left:0,blur:3,color:"#000",opacity:.5}},dataLabels:{show:!0,name:{show:!0,fontSize:"16px",fontFamily:void 0,fontWeight:600,color:void 0,offsetY:0,formatter:function(h){return h}},value:{show:!0,fontSize:"14px",fontFamily:void 0,fontWeight:400,color:void 0,offsetY:16,formatter:function(h){return h+"%"}},total:{show:!1,label:"Total",fontSize:"16px",fontWeight:600,fontFamily:void 0,color:void 0,formatter:function(h){return h.globals.seriesTotals.reduce(function(p,S){return p+S},0)/h.globals.series.length+"%"}}},barLabels:{enabled:!1,offsetX:0,offsetY:0,useSeriesColors:!0,fontFamily:void 0,fontWeight:600,fontSize:"16px",formatter:function(h){return h},onClick:void 0}},pie:{customScale:1,offsetX:0,offsetY:0,startAngle:0,endAngle:360,expandOnClick:!0,dataLabels:{offset:0,minAngleToShowLabel:10},donut:{size:"65%",background:"transparent",labels:{show:!1,name:{show:!0,fontSize:"16px",fontFamily:void 0,fontWeight:600,color:void 0,offsetY:-10,formatter:function(h){return h}},value:{show:!0,fontSize:"20px",fontFamily:void 0,fontWeight:400,color:void 0,offsetY:10,formatter:function(h){return h}},total:{show:!1,showAlways:!1,label:"Total",fontSize:"16px",fontWeight:400,fontFamily:void 0,color:void 0,formatter:function(h){return h.globals.seriesTotals.reduce(function(p,S){return p+S},0)}}}}},polarArea:{rings:{strokeWidth:1,strokeColor:"#e8e8e8"},spokes:{strokeWidth:1,connectorColors:"#e8e8e8"}},radar:{size:void 0,offsetX:0,offsetY:0,polygons:{strokeWidth:1,strokeColors:"#e8e8e8",connectorColors:"#e8e8e8",fill:{colors:void 0}}}},colors:void 0,dataLabels:{enabled:!0,enabledOnSeries:void 0,formatter:function(h){return h!==null?h:""},textAnchor:"middle",distributed:!1,offsetX:0,offsetY:0,style:{fontSize:"12px",fontFamily:void 0,fontWeight:600,colors:void 0},background:{enabled:!0,foreColor:"#fff",borderRadius:2,padding:4,opacity:.9,borderWidth:1,borderColor:"#fff",dropShadow:{enabled:!1,top:1,left:1,blur:1,color:"#000",opacity:.45}},dropShadow:{enabled:!1,top:1,left:1,blur:1,color:"#000",opacity:.45}},fill:{type:"solid",colors:void 0,opacity:.85,gradient:{shade:"dark",type:"horizontal",shadeIntensity:.5,gradientToColors:void 0,inverseColors:!0,opacityFrom:1,opacityTo:1,stops:[0,50,100],colorStops:[]},image:{src:[],width:void 0,height:void 0},pattern:{style:"squares",width:6,height:6,strokeWidth:2}},forecastDataPoints:{count:0,fillOpacity:.5,strokeWidth:void 0,dashArray:4},grid:{show:!0,borderColor:"#e0e0e0",strokeDashArray:0,position:"back",xaxis:{lines:{show:!1}},yaxis:{lines:{show:!0}},row:{colors:void 0,opacity:.5},column:{colors:void 0,opacity:.5},padding:{top:0,right:10,bottom:0,left:12}},labels:[],legend:{show:!0,showForSingleSeries:!1,showForNullSeries:!0,showForZeroSeries:!0,floating:!1,position:"bottom",horizontalAlign:"center",inverseOrder:!1,fontSize:"12px",fontFamily:void 0,fontWeight:400,width:void 0,height:void 0,formatter:void 0,tooltipHoverFormatter:void 0,offsetX:-20,offsetY:4,customLegendItems:[],labels:{colors:void 0,useSeriesColors:!1},markers:{size:7,fillColors:void 0,strokeWidth:1,shape:void 0,offsetX:0,offsetY:0,customHTML:void 0,onClick:void 0},itemMargin:{horizontal:5,vertical:4},onItemClick:{toggleDataSeries:!0},onItemHover:{highlightDataSeries:!0}},markers:{discrete:[],size:0,colors:void 0,strokeColors:"#fff",strokeWidth:2,strokeOpacity:.9,strokeDashArray:0,fillOpacity:1,shape:"circle",offsetX:0,offsetY:0,showNullDataPoints:!0,onClick:void 0,onDblClick:void 0,hover:{size:void 0,sizeOffset:3}},noData:{text:void 0,align:"center",verticalAlign:"middle",offsetX:0,offsetY:0,style:{color:void 0,fontSize:"14px",fontFamily:void 0}},responsive:[],series:void 0,states:{normal:{filter:{type:"none",value:0}},hover:{filter:{type:"lighten",value:.1}},active:{allowMultipleDataPointsSelection:!1,filter:{type:"darken",value:.5}}},title:{text:void 0,align:"left",margin:5,offsetX:0,offsetY:0,floating:!1,style:{fontSize:"14px",fontWeight:900,fontFamily:void 0,color:void 0}},subtitle:{text:void 0,align:"left",margin:5,offsetX:0,offsetY:30,floating:!1,style:{fontSize:"12px",fontWeight:400,fontFamily:void 0,color:void 0}},stroke:{show:!0,curve:"smooth",lineCap:"butt",width:2,colors:void 0,dashArray:0,fill:{type:"solid",colors:void 0,opacity:.85,gradient:{shade:"dark",type:"horizontal",shadeIntensity:.5,gradientToColors:void 0,inverseColors:!0,opacityFrom:1,opacityTo:1,stops:[0,50,100],colorStops:[]}}},tooltip:{enabled:!0,enabledOnSeries:void 0,shared:!0,hideEmptySeries:!1,followCursor:!1,intersect:!1,inverseOrder:!1,custom:void 0,fillSeriesColor:!1,theme:"light",cssClass:"",style:{fontSize:"12px",fontFamily:void 0},onDatasetHover:{highlightDataSeries:!1},x:{show:!0,format:"dd MMM",formatter:void 0},y:{formatter:void 0,title:{formatter:function(h){return h?h+": ":""}}},z:{formatter:void 0,title:"Size: "},marker:{show:!0,fillColors:void 0},items:{display:"flex"},fixed:{enabled:!1,position:"topRight",offsetX:0,offsetY:0}},xaxis:{type:"category",categories:[],convertedCatToNumeric:!1,offsetX:0,offsetY:0,overwriteCategories:void 0,labels:{show:!0,rotate:-45,rotateAlways:!1,hideOverlappingLabels:!0,trim:!1,minHeight:void 0,maxHeight:120,showDuplicates:!0,style:{colors:[],fontSize:"12px",fontWeight:400,fontFamily:void 0,cssClass:""},offsetX:0,offsetY:0,format:void 0,formatter:void 0,datetimeUTC:!0,datetimeFormatter:{year:"yyyy",month:"MMM 'yy",day:"dd MMM",hour:"HH:mm",minute:"HH:mm:ss",second:"HH:mm:ss"}},group:{groups:[],style:{colors:[],fontSize:"12px",fontWeight:400,fontFamily:void 0,cssClass:""}},axisBorder:{show:!0,color:"#e0e0e0",width:"100%",height:1,offsetX:0,offsetY:0},axisTicks:{show:!0,color:"#e0e0e0",height:6,offsetX:0,offsetY:0},stepSize:void 0,tickAmount:void 0,tickPlacement:"on",min:void 0,max:void 0,range:void 0,floating:!1,decimalsInFloat:void 0,position:"bottom",title:{text:void 0,offsetX:0,offsetY:0,style:{color:void 0,fontSize:"12px",fontWeight:900,fontFamily:void 0,cssClass:""}},crosshairs:{show:!0,width:1,position:"back",opacity:.9,stroke:{color:"#b6b6b6",width:1,dashArray:3},fill:{type:"solid",color:"#B1B9C4",gradient:{colorFrom:"#D8E3F0",colorTo:"#BED1E6",stops:[0,100],opacityFrom:.4,opacityTo:.5}},dropShadow:{enabled:!1,left:0,top:0,blur:1,opacity:.4}},tooltip:{enabled:!0,offsetY:0,formatter:void 0,style:{fontSize:"12px",fontFamily:void 0}}},yaxis:this.yAxis,theme:{mode:"",palette:"palette1",monochrome:{enabled:!1,color:"#008FFB",shadeTo:"light",shadeIntensity:.65}}}}}]),Ee}(),V=function(){function Ee(h){s(this,Ee),this.ctx=h,this.w=h.w,this.graphics=new z(this.ctx),this.w.globals.isBarHorizontal&&(this.invertAxis=!0),this.helpers=new ne(this),this.xAxisAnnotations=new J(this),this.yAxisAnnotations=new Y(this),this.pointsAnnotations=new ie(this),this.w.globals.isBarHorizontal&&this.w.config.yaxis[0].reversed&&(this.inversedReversedAxis=!0),this.xDivision=this.w.globals.gridWidth/this.w.globals.dataPoints}return o(Ee,[{key:"drawAxesAnnotations",value:function(){var h=this.w;if(h.globals.axisCharts&&h.globals.dataPoints){for(var p=this.yAxisAnnotations.drawYAxisAnnotations(),S=this.xAxisAnnotations.drawXAxisAnnotations(),_=this.pointsAnnotations.drawPointAnnotations(),k=h.config.chart.animations.enabled,T=[p,S,_],B=[S.node,p.node,_.node],q=0;q<3;q++)h.globals.dom.elGraphical.add(T[q]),!k||h.globals.resized||h.globals.dataChanged||h.config.chart.type!=="scatter"&&h.config.chart.type!=="bubble"&&h.globals.dataPoints>1&&B[q].classList.add("apexcharts-element-hidden"),h.globals.delayedElements.push({el:B[q],index:0});this.helpers.annotationsBackground()}}},{key:"drawImageAnnos",value:function(){var h=this;this.w.config.annotations.images.map(function(p,S){h.addImage(p,S)})}},{key:"drawTextAnnos",value:function(){var h=this;this.w.config.annotations.texts.map(function(p,S){h.addText(p,S)})}},{key:"addXaxisAnnotation",value:function(h,p,S){this.xAxisAnnotations.addXaxisAnnotation(h,p,S)}},{key:"addYaxisAnnotation",value:function(h,p,S){this.yAxisAnnotations.addYaxisAnnotation(h,p,S)}},{key:"addPointAnnotation",value:function(h,p,S){this.pointsAnnotations.addPointAnnotation(h,p,S)}},{key:"addText",value:function(h,p){var S=h.x,_=h.y,k=h.text,T=h.textAnchor,B=h.foreColor,q=h.fontSize,te=h.fontFamily,ue=h.fontWeight,de=h.cssClass,xe=h.backgroundColor,Se=h.borderWidth,ke=h.strokeDashArray,Re=h.borderRadius,Ge=h.borderColor,Fe=h.appendTo,st=Fe===void 0?".apexcharts-svg":Fe,se=h.paddingLeft,Ce=se===void 0?4:se,Be=h.paddingRight,De=Be===void 0?4:Be,_e=h.paddingBottom,Je=_e===void 0?2:_e,ct=h.paddingTop,gt=ct===void 0?2:ct,Xt=this.w,wt=this.graphics.drawText({x:S,y:_,text:k,textAnchor:T||"start",fontSize:q||"12px",fontWeight:ue||"regular",fontFamily:te||Xt.config.chart.fontFamily,foreColor:B||Xt.config.chart.foreColor,cssClass:de}),Xe=Xt.globals.dom.baseEl.querySelector(st);Xe&&Xe.appendChild(wt.node);var Oe=wt.bbox();if(k){var bt=this.graphics.drawRect(Oe.x-Ce,Oe.y-gt,Oe.width+Ce+De,Oe.height+Je+gt,Re,xe||"transparent",1,Se,Ge,ke);Xe.insertBefore(bt.node,wt.node)}}},{key:"addImage",value:function(h,p){var S=this.w,_=h.path,k=h.x,T=k===void 0?0:k,B=h.y,q=B===void 0?0:B,te=h.width,ue=te===void 0?20:te,de=h.height,xe=de===void 0?20:de,Se=h.appendTo,ke=Se===void 0?".apexcharts-svg":Se,Re=S.globals.dom.Paper.image(_);Re.size(ue,xe).move(T,q);var Ge=S.globals.dom.baseEl.querySelector(ke);return Ge&&Ge.appendChild(Re.node),Re}},{key:"addXaxisAnnotationExternal",value:function(h,p,S){return this.addAnnotationExternal({params:h,pushToMemory:p,context:S,type:"xaxis",contextMethod:S.addXaxisAnnotation}),S}},{key:"addYaxisAnnotationExternal",value:function(h,p,S){return this.addAnnotationExternal({params:h,pushToMemory:p,context:S,type:"yaxis",contextMethod:S.addYaxisAnnotation}),S}},{key:"addPointAnnotationExternal",value:function(h,p,S){return this.invertAxis===void 0&&(this.invertAxis=S.w.globals.isBarHorizontal),this.addAnnotationExternal({params:h,pushToMemory:p,context:S,type:"point",contextMethod:S.addPointAnnotation}),S}},{key:"addAnnotationExternal",value:function(h){var p=h.params,S=h.pushToMemory,_=h.context,k=h.type,T=h.contextMethod,B=_,q=B.w,te=q.globals.dom.baseEl.querySelector(".apexcharts-".concat(k,"-annotations")),ue=te.childNodes.length+1,de=new G,xe=Object.assign({},k==="xaxis"?de.xAxisAnnotation:k==="yaxis"?de.yAxisAnnotation:de.pointAnnotation),Se=F.extend(xe,p);switch(k){case"xaxis":this.addXaxisAnnotation(Se,te,ue);break;case"yaxis":this.addYaxisAnnotation(Se,te,ue);break;case"point":this.addPointAnnotation(Se,te,ue)}var ke=q.globals.dom.baseEl.querySelector(".apexcharts-".concat(k,"-annotations .apexcharts-").concat(k,"-annotation-label[rel='").concat(ue,"']")),Re=this.helpers.addBackgroundToAnno(ke,Se);return Re&&te.insertBefore(Re.node,ke),S&&q.globals.memory.methodsToExec.push({context:B,id:Se.id?Se.id:F.randomId(),method:T,label:"addAnnotation",params:p}),_}},{key:"clearAnnotations",value:function(h){for(var p=h.w,S=p.globals.dom.baseEl.querySelectorAll(".apexcharts-yaxis-annotations, .apexcharts-xaxis-annotations, .apexcharts-point-annotations"),_=p.globals.memory.methodsToExec.length-1;_>=0;_--)p.globals.memory.methodsToExec[_].label!=="addText"&&p.globals.memory.methodsToExec[_].label!=="addAnnotation"||p.globals.memory.methodsToExec.splice(_,1);S=F.listToArray(S),Array.prototype.forEach.call(S,function(k){for(;k.firstChild;)k.removeChild(k.firstChild)})}},{key:"removeAnnotation",value:function(h,p){var S=h.w,_=S.globals.dom.baseEl.querySelectorAll(".".concat(p));_&&(S.globals.memory.methodsToExec.map(function(k,T){k.id===p&&S.globals.memory.methodsToExec.splice(T,1)}),Array.prototype.forEach.call(_,function(k){k.parentElement.removeChild(k)}))}}]),Ee}(),ee=function(Ee){var h,p=Ee.isTimeline,S=Ee.ctx,_=Ee.seriesIndex,k=Ee.dataPointIndex,T=Ee.y1,B=Ee.y2,q=Ee.w,te=q.globals.seriesRangeStart[_][k],ue=q.globals.seriesRangeEnd[_][k],de=q.globals.labels[k],xe=q.config.series[_].name?q.config.series[_].name:"",Se=q.globals.ttKeyFormatter,ke=q.config.tooltip.y.title.formatter,Re={w:q,seriesIndex:_,dataPointIndex:k,start:te,end:ue};typeof ke=="function"&&(xe=ke(xe,Re)),(h=q.config.series[_].data[k])!==null&&h!==void 0&&h.x&&(de=q.config.series[_].data[k].x),p||q.config.xaxis.type==="datetime"&&(de=new re(S).xLabelFormat(q.globals.ttKeyFormatter,de,de,{i:void 0,dateFormatter:new X(S).formatDate,w:q})),typeof Se=="function"&&(de=Se(de,Re)),Number.isFinite(T)&&Number.isFinite(B)&&(te=T,ue=B);var Ge="",Fe="",st=q.globals.colors[_];if(q.config.tooltip.x.formatter===void 0)if(q.config.xaxis.type==="datetime"){var se=new X(S);Ge=se.formatDate(se.getDate(te),q.config.tooltip.x.format),Fe=se.formatDate(se.getDate(ue),q.config.tooltip.x.format)}else Ge=te,Fe=ue;else Ge=q.config.tooltip.x.formatter(te),Fe=q.config.tooltip.x.formatter(ue);return{start:te,end:ue,startVal:Ge,endVal:Fe,ylabel:de,color:st,seriesName:xe}},ae=function(Ee){var h=Ee.color,p=Ee.seriesName,S=Ee.ylabel,_=Ee.start,k=Ee.end,T=Ee.seriesIndex,B=Ee.dataPointIndex,q=Ee.ctx.tooltip.tooltipLabels.getFormatters(T);_=q.yLbFormatter(_),k=q.yLbFormatter(k);var te=q.yLbFormatter(Ee.w.globals.series[T][B]),ue=`<span class="value start-value">
`.concat(_,`
</span> <span class="separator">-</span> <span class="value end-value">
`).concat(k,`
</span>`);return'<div class="apexcharts-tooltip-rangebar"><div> <span class="series-name" style="color: '+h+'">'+(p||"")+'</span></div><div> <span class="category">'+S+": </span> "+(Ee.w.globals.comboCharts?Ee.w.config.series[T].type==="rangeArea"||Ee.w.config.series[T].type==="rangeBar"?ue:"<span>".concat(te,"</span>"):ue)+" </div></div>"},fe=function(){function Ee(h){s(this,Ee),this.opts=h}return o(Ee,[{key:"hideYAxis",value:function(){this.opts.yaxis[0].show=!1,this.opts.yaxis[0].title.text="",this.opts.yaxis[0].axisBorder.show=!1,this.opts.yaxis[0].axisTicks.show=!1,this.opts.yaxis[0].floating=!0}},{key:"line",value:function(){return{chart:{animations:{easing:"swing"}},dataLabels:{enabled:!1},stroke:{width:5,curve:"straight"},markers:{size:0,hover:{sizeOffset:6}},xaxis:{crosshairs:{width:1}}}}},{key:"sparkline",value:function(h){return this.hideYAxis(),F.extend(h,{grid:{show:!1,padding:{left:0,right:0,top:0,bottom:0}},legend:{show:!1},xaxis:{labels:{show:!1},tooltip:{enabled:!1},axisBorder:{show:!1},axisTicks:{show:!1}},chart:{toolbar:{show:!1},zoom:{enabled:!1}},dataLabels:{enabled:!1}})}},{key:"slope",value:function(){return this.hideYAxis(),{chart:{toolbar:{show:!1},zoom:{enabled:!1}},dataLabels:{enabled:!0,formatter:function(h,p){var S=p.w.config.series[p.seriesIndex].name;return h!==null?S+": "+h:""},background:{enabled:!1},offsetX:-5},grid:{xaxis:{lines:{show:!0}},yaxis:{lines:{show:!1}}},xaxis:{position:"top",labels:{style:{fontSize:14,fontWeight:900}},tooltip:{enabled:!1},crosshairs:{show:!1}},markers:{size:8,hover:{sizeOffset:1}},legend:{show:!1},tooltip:{shared:!1,intersect:!0,followCursor:!0},stroke:{width:5,curve:"straight"}}}},{key:"bar",value:function(){return{chart:{stacked:!1,animations:{easing:"swing"}},plotOptions:{bar:{dataLabels:{position:"center"}}},dataLabels:{style:{colors:["#fff"]},background:{enabled:!1}},stroke:{width:0,lineCap:"round"},fill:{opacity:.85},legend:{markers:{shape:"square"}},tooltip:{shared:!1,intersect:!0},xaxis:{tooltip:{enabled:!1},tickPlacement:"between",crosshairs:{width:"barWidth",position:"back",fill:{type:"gradient"},dropShadow:{enabled:!1},stroke:{width:0}}}}}},{key:"funnel",value:function(){return this.hideYAxis(),v(v({},this.bar()),{},{chart:{animations:{easing:"linear",speed:800,animateGradually:{enabled:!1}}},plotOptions:{bar:{horizontal:!0,borderRadiusApplication:"around",borderRadius:0,dataLabels:{position:"center"}}},grid:{show:!1,padding:{left:0,right:0}},xaxis:{labels:{show:!1},tooltip:{enabled:!1},axisBorder:{show:!1},axisTicks:{show:!1}}})}},{key:"candlestick",value:function(){var h=this;return{stroke:{width:1,colors:["#333"]},fill:{opacity:1},dataLabels:{enabled:!1},tooltip:{shared:!0,custom:function(p){var S=p.seriesIndex,_=p.dataPointIndex,k=p.w;return h._getBoxTooltip(k,S,_,["Open","High","","Low","Close"],"candlestick")}},states:{active:{filter:{type:"none"}}},xaxis:{crosshairs:{width:1}}}}},{key:"boxPlot",value:function(){var h=this;return{chart:{animations:{dynamicAnimation:{enabled:!1}}},stroke:{width:1,colors:["#24292e"]},dataLabels:{enabled:!1},tooltip:{shared:!0,custom:function(p){var S=p.seriesIndex,_=p.dataPointIndex,k=p.w;return h._getBoxTooltip(k,S,_,["Minimum","Q1","Median","Q3","Maximum"],"boxPlot")}},markers:{size:7,strokeWidth:1,strokeColors:"#111"},xaxis:{crosshairs:{width:1}}}}},{key:"rangeBar",value:function(){return{chart:{animations:{animateGradually:!1}},stroke:{width:0,lineCap:"square"},plotOptions:{bar:{borderRadius:0,dataLabels:{position:"center"}}},dataLabels:{enabled:!1,formatter:function(h,p){p.ctx;var S=p.seriesIndex,_=p.dataPointIndex,k=p.w,T=function(){var B=k.globals.seriesRangeStart[S][_];return k.globals.seriesRangeEnd[S][_]-B};return k.globals.comboCharts?k.config.series[S].type==="rangeBar"||k.config.series[S].type==="rangeArea"?T():h:T()},background:{enabled:!1},style:{colors:["#fff"]}},markers:{size:10},tooltip:{shared:!1,followCursor:!0,custom:function(h){return h.w.config.plotOptions&&h.w.config.plotOptions.bar&&h.w.config.plotOptions.bar.horizontal?function(p){var S=ee(v(v({},p),{},{isTimeline:!0})),_=S.color,k=S.seriesName,T=S.ylabel,B=S.startVal,q=S.endVal;return ae(v(v({},p),{},{color:_,seriesName:k,ylabel:T,start:B,end:q}))}(h):function(p){var S=ee(p),_=S.color,k=S.seriesName,T=S.ylabel,B=S.start,q=S.end;return ae(v(v({},p),{},{color:_,seriesName:k,ylabel:T,start:B,end:q}))}(h)}},xaxis:{tickPlacement:"between",tooltip:{enabled:!1},crosshairs:{stroke:{width:0}}}}}},{key:"dumbbell",value:function(h){var p,S;return(p=h.plotOptions.bar)!==null&&p!==void 0&&p.barHeight||(h.plotOptions.bar.barHeight=2),(S=h.plotOptions.bar)!==null&&S!==void 0&&S.columnWidth||(h.plotOptions.bar.columnWidth=2),h}},{key:"area",value:function(){return{stroke:{width:4,fill:{type:"solid",gradient:{inverseColors:!1,shade:"light",type:"vertical",opacityFrom:.65,opacityTo:.5,stops:[0,100,100]}}},fill:{type:"gradient",gradient:{inverseColors:!1,shade:"light",type:"vertical",opacityFrom:.65,opacityTo:.5,stops:[0,100,100]}},markers:{size:0,hover:{sizeOffset:6}},tooltip:{followCursor:!1}}}},{key:"rangeArea",value:function(){return{stroke:{curve:"straight",width:0},fill:{type:"solid",opacity:.6},markers:{size:0},states:{hover:{filter:{type:"none"}},active:{filter:{type:"none"}}},tooltip:{intersect:!1,shared:!0,followCursor:!0,custom:function(h){return function(p){var S=ee(p),_=S.color,k=S.seriesName,T=S.ylabel,B=S.start,q=S.end;return ae(v(v({},p),{},{color:_,seriesName:k,ylabel:T,start:B,end:q}))}(h)}}}}},{key:"brush",value:function(h){return F.extend(h,{chart:{toolbar:{autoSelected:"selection",show:!1},zoom:{enabled:!1}},dataLabels:{enabled:!1},stroke:{width:1},tooltip:{enabled:!1},xaxis:{tooltip:{enabled:!1}}})}},{key:"stacked100",value:function(h){h.dataLabels=h.dataLabels||{},h.dataLabels.formatter=h.dataLabels.formatter||void 0;var p=h.dataLabels.formatter;return h.yaxis.forEach(function(S,_){h.yaxis[_].min=0,h.yaxis[_].max=100}),h.chart.type==="bar"&&(h.dataLabels.formatter=p||function(S){return typeof S=="number"&&S?S.toFixed(0)+"%":S}),h}},{key:"stackedBars",value:function(){var h=this.bar();return v(v({},h),{},{plotOptions:v(v({},h.plotOptions),{},{bar:v(v({},h.plotOptions.bar),{},{borderRadiusApplication:"end",borderRadiusWhenStacked:"last"})})})}},{key:"convertCatToNumeric",value:function(h){return h.xaxis.convertedCatToNumeric=!0,h}},{key:"convertCatToNumericXaxis",value:function(h,p,S){h.xaxis.type="numeric",h.xaxis.labels=h.xaxis.labels||{},h.xaxis.labels.formatter=h.xaxis.labels.formatter||function(T){return F.isNumber(T)?Math.floor(T):T};var _=h.xaxis.labels.formatter,k=h.xaxis.categories&&h.xaxis.categories.length?h.xaxis.categories:h.labels;return S&&S.length&&(k=S.map(function(T){return Array.isArray(T)?T:String(T)})),k&&k.length&&(h.xaxis.labels.formatter=function(T){return F.isNumber(T)?_(k[Math.floor(T)-1]):_(T)}),h.xaxis.categories=[],h.labels=[],h.xaxis.tickAmount=h.xaxis.tickAmount||"dataPoints",h}},{key:"bubble",value:function(){return{dataLabels:{style:{colors:["#fff"]}},tooltip:{shared:!1,intersect:!0},xaxis:{crosshairs:{width:0}},fill:{type:"solid",gradient:{shade:"light",inverse:!0,shadeIntensity:.55,opacityFrom:.4,opacityTo:.8}}}}},{key:"scatter",value:function(){return{dataLabels:{enabled:!1},tooltip:{shared:!1,intersect:!0},markers:{size:6,strokeWidth:1,hover:{sizeOffset:2}}}}},{key:"heatmap",value:function(){return{chart:{stacked:!1},fill:{opacity:1},dataLabels:{style:{colors:["#fff"]}},stroke:{colors:["#fff"]},tooltip:{followCursor:!0,marker:{show:!1},x:{show:!1}},legend:{position:"top",markers:{shape:"square"}},grid:{padding:{right:20}}}}},{key:"treemap",value:function(){return{chart:{zoom:{enabled:!1}},dataLabels:{style:{fontSize:14,fontWeight:600,colors:["#fff"]}},stroke:{show:!0,width:2,colors:["#fff"]},legend:{show:!1},fill:{opacity:1,gradient:{stops:[0,100]}},tooltip:{followCursor:!0,x:{show:!1}},grid:{padding:{left:0,right:0}},xaxis:{crosshairs:{show:!1},tooltip:{enabled:!1}}}}},{key:"pie",value:function(){return{chart:{toolbar:{show:!1}},plotOptions:{pie:{donut:{labels:{show:!1}}}},dataLabels:{formatter:function(h){return h.toFixed(1)+"%"},style:{colors:["#fff"]},background:{enabled:!1},dropShadow:{enabled:!0}},stroke:{colors:["#fff"]},fill:{opacity:1,gradient:{shade:"light",stops:[0,100]}},tooltip:{theme:"dark",fillSeriesColor:!0},legend:{position:"right"},grid:{padding:{left:0,right:0,top:0,bottom:0}}}}},{key:"donut",value:function(){return{chart:{toolbar:{show:!1}},dataLabels:{formatter:function(h){return h.toFixed(1)+"%"},style:{colors:["#fff"]},background:{enabled:!1},dropShadow:{enabled:!0}},stroke:{colors:["#fff"]},fill:{opacity:1,gradient:{shade:"light",shadeIntensity:.35,stops:[80,100],opacityFrom:1,opacityTo:1}},tooltip:{theme:"dark",fillSeriesColor:!0},legend:{position:"right"},grid:{padding:{left:0,right:0,top:0,bottom:0}}}}},{key:"polarArea",value:function(){return{chart:{toolbar:{show:!1}},dataLabels:{formatter:function(h){return h.toFixed(1)+"%"},enabled:!1},stroke:{show:!0,width:2},fill:{opacity:.7},tooltip:{theme:"dark",fillSeriesColor:!0},legend:{position:"right"},grid:{padding:{left:0,right:0,top:0,bottom:0}}}}},{key:"radar",value:function(){return this.opts.yaxis[0].labels.offsetY=this.opts.yaxis[0].labels.offsetY?this.opts.yaxis[0].labels.offsetY:6,{dataLabels:{enabled:!1,style:{fontSize:"11px"}},stroke:{width:2},markers:{size:5,strokeWidth:1,strokeOpacity:1},fill:{opacity:.2},tooltip:{shared:!1,intersect:!0,followCursor:!0},grid:{show:!1,padding:{left:0,right:0,top:0,bottom:0}},xaxis:{labels:{formatter:function(h){return h},style:{colors:["#a8a8a8"],fontSize:"11px"}},tooltip:{enabled:!1},crosshairs:{show:!1}}}}},{key:"radialBar",value:function(){return{chart:{animations:{dynamicAnimation:{enabled:!0,speed:800}},toolbar:{show:!1}},fill:{gradient:{shade:"dark",shadeIntensity:.4,inverseColors:!1,type:"diagonal2",opacityFrom:1,opacityTo:1,stops:[70,98,100]}},legend:{show:!1,position:"right"},tooltip:{enabled:!1,fillSeriesColor:!0},grid:{padding:{left:0,right:0,top:0,bottom:0}}}}},{key:"_getBoxTooltip",value:function(h,p,S,_,k){var T=h.globals.seriesCandleO[p][S],B=h.globals.seriesCandleH[p][S],q=h.globals.seriesCandleM[p][S],te=h.globals.seriesCandleL[p][S],ue=h.globals.seriesCandleC[p][S];return h.config.series[p].type&&h.config.series[p].type!==k?`<div class="apexcharts-custom-tooltip">
`.concat(h.config.series[p].name?h.config.series[p].name:"series-"+(p+1),": <strong>").concat(h.globals.series[p][S],`</strong>
</div>`):'<div class="apexcharts-tooltip-box apexcharts-tooltip-'.concat(h.config.chart.type,'">')+"<div>".concat(_[0],': <span class="value">')+T+"</span></div>"+"<div>".concat(_[1],': <span class="value">')+B+"</span></div>"+(q?"<div>".concat(_[2],': <span class="value">')+q+"</span></div>":"")+"<div>".concat(_[3],': <span class="value">')+te+"</span></div>"+"<div>".concat(_[4],': <span class="value">')+ue+"</span></div></div>"}}]),Ee}(),Ne=function(){function Ee(h){s(this,Ee),this.opts=h}return o(Ee,[{key:"init",value:function(h){var p=h.responsiveOverride,S=this.opts,_=new G,k=new fe(S);this.chartType=S.chart.type,S=this.extendYAxis(S),S=this.extendAnnotations(S);var T=_.init(),B={};if(S&&I(S)==="object"){var q,te,ue,de,xe,Se,ke,Re,Ge,Fe,st={};st=["line","area","bar","candlestick","boxPlot","rangeBar","rangeArea","bubble","scatter","heatmap","treemap","pie","polarArea","donut","radar","radialBar"].indexOf(S.chart.type)!==-1?k[S.chart.type]():k.line(),(q=S.plotOptions)!==null&&q!==void 0&&(te=q.bar)!==null&&te!==void 0&&te.isFunnel&&(st=k.funnel()),S.chart.stacked&&S.chart.type==="bar"&&(st=k.stackedBars()),(ue=S.chart.brush)!==null&&ue!==void 0&&ue.enabled&&(st=k.brush(st)),(de=S.plotOptions)!==null&&de!==void 0&&(xe=de.line)!==null&&xe!==void 0&&xe.isSlopeChart&&(st=k.slope()),S.chart.stacked&&S.chart.stackType==="100%"&&(S=k.stacked100(S)),(Se=S.plotOptions)!==null&&Se!==void 0&&(ke=Se.bar)!==null&&ke!==void 0&&ke.isDumbbell&&(S=k.dumbbell(S)),this.checkForDarkTheme(window.Apex),this.checkForDarkTheme(S),S.xaxis=S.xaxis||window.Apex.xaxis||{},p||(S.xaxis.convertedCatToNumeric=!1),((Re=(S=this.checkForCatToNumericXAxis(this.chartType,st,S)).chart.sparkline)!==null&&Re!==void 0&&Re.enabled||(Ge=window.Apex.chart)!==null&&Ge!==void 0&&(Fe=Ge.sparkline)!==null&&Fe!==void 0&&Fe.enabled)&&(st=k.sparkline(st)),B=F.extend(T,st)}var se=F.extend(B,window.Apex);return T=F.extend(se,S),T=this.handleUserInputErrors(T)}},{key:"checkForCatToNumericXAxis",value:function(h,p,S){var _,k,T=new fe(S),B=(h==="bar"||h==="boxPlot")&&((_=S.plotOptions)===null||_===void 0||(k=_.bar)===null||k===void 0?void 0:k.horizontal),q=h==="pie"||h==="polarArea"||h==="donut"||h==="radar"||h==="radialBar"||h==="heatmap",te=S.xaxis.type!=="datetime"&&S.xaxis.type!=="numeric",ue=S.xaxis.tickPlacement?S.xaxis.tickPlacement:p.xaxis&&p.xaxis.tickPlacement;return B||q||!te||ue==="between"||(S=T.convertCatToNumeric(S)),S}},{key:"extendYAxis",value:function(h,p){var S=new G;(h.yaxis===void 0||!h.yaxis||Array.isArray(h.yaxis)&&h.yaxis.length===0)&&(h.yaxis={}),h.yaxis.constructor!==Array&&window.Apex.yaxis&&window.Apex.yaxis.constructor!==Array&&(h.yaxis=F.extend(h.yaxis,window.Apex.yaxis)),h.yaxis.constructor!==Array?h.yaxis=[F.extend(S.yAxis,h.yaxis)]:h.yaxis=F.extendArray(h.yaxis,S.yAxis);var _=!1;h.yaxis.forEach(function(T){T.logarithmic&&(_=!0)});var k=h.series;return p&&!k&&(k=p.config.series),_&&k.length!==h.yaxis.length&&k.length&&(h.yaxis=k.map(function(T,B){if(T.name||(k[B].name="series-".concat(B+1)),h.yaxis[B])return h.yaxis[B].seriesName=k[B].name,h.yaxis[B];var q=F.extend(S.yAxis,h.yaxis[0]);return q.show=!1,q})),_&&k.length>1&&k.length!==h.yaxis.length&&console.warn("A multi-series logarithmic chart should have equal number of series and y-axes"),h}},{key:"extendAnnotations",value:function(h){return h.annotations===void 0&&(h.annotations={},h.annotations.yaxis=[],h.annotations.xaxis=[],h.annotations.points=[]),h=this.extendYAxisAnnotations(h),h=this.extendXAxisAnnotations(h),h=this.extendPointAnnotations(h)}},{key:"extendYAxisAnnotations",value:function(h){var p=new G;return h.annotations.yaxis=F.extendArray(h.annotations.yaxis!==void 0?h.annotations.yaxis:[],p.yAxisAnnotation),h}},{key:"extendXAxisAnnotations",value:function(h){var p=new G;return h.annotations.xaxis=F.extendArray(h.annotations.xaxis!==void 0?h.annotations.xaxis:[],p.xAxisAnnotation),h}},{key:"extendPointAnnotations",value:function(h){var p=new G;return h.annotations.points=F.extendArray(h.annotations.points!==void 0?h.annotations.points:[],p.pointAnnotation),h}},{key:"checkForDarkTheme",value:function(h){h.theme&&h.theme.mode==="dark"&&(h.tooltip||(h.tooltip={}),h.tooltip.theme!=="light"&&(h.tooltip.theme="dark"),h.chart.foreColor||(h.chart.foreColor="#f6f7f8"),h.theme.palette||(h.theme.palette="palette4"))}},{key:"handleUserInputErrors",value:function(h){var p=h;if(p.tooltip.shared&&p.tooltip.intersect)throw new Error("tooltip.shared cannot be enabled when tooltip.intersect is true. Turn off any other option by setting it to false.");if(p.chart.type==="bar"&&p.plotOptions.bar.horizontal){if(p.yaxis.length>1)throw new Error("Multiple Y Axis for bars are not supported. Switch to column chart by setting plotOptions.bar.horizontal=false");p.yaxis[0].reversed&&(p.yaxis[0].opposite=!0),p.xaxis.tooltip.enabled=!1,p.yaxis[0].tooltip.enabled=!1,p.chart.zoom.enabled=!1}return p.chart.type!=="bar"&&p.chart.type!=="rangeBar"||p.tooltip.shared&&p.xaxis.crosshairs.width==="barWidth"&&p.series.length>1&&(p.xaxis.crosshairs.width="tickWidth"),p.chart.type!=="candlestick"&&p.chart.type!=="boxPlot"||p.yaxis[0].reversed&&(console.warn("Reversed y-axis in ".concat(p.chart.type," chart is not supported.")),p.yaxis[0].reversed=!1),p}}]),Ee}(),he=function(){function Ee(){s(this,Ee)}return o(Ee,[{key:"initGlobalVars",value:function(h){h.series=[],h.seriesCandleO=[],h.seriesCandleH=[],h.seriesCandleM=[],h.seriesCandleL=[],h.seriesCandleC=[],h.seriesRangeStart=[],h.seriesRangeEnd=[],h.seriesRange=[],h.seriesPercent=[],h.seriesGoals=[],h.seriesX=[],h.seriesZ=[],h.seriesNames=[],h.seriesTotals=[],h.seriesLog=[],h.seriesColors=[],h.stackedSeriesTotals=[],h.seriesXvalues=[],h.seriesYvalues=[],h.labels=[],h.hasXaxisGroups=!1,h.groups=[],h.barGroups=[],h.lineGroups=[],h.areaGroups=[],h.hasSeriesGroups=!1,h.seriesGroups=[],h.categoryLabels=[],h.timescaleLabels=[],h.noLabelsProvided=!1,h.resizeTimer=null,h.selectionResizeTimer=null,h.lastWheelExecution=0,h.delayedElements=[],h.pointsArray=[],h.dataLabelsRects=[],h.isXNumeric=!1,h.skipLastTimelinelabel=!1,h.skipFirstTimelinelabel=!1,h.isDataXYZ=!1,h.isMultiLineX=!1,h.isMultipleYAxis=!1,h.maxY=-Number.MAX_VALUE,h.minY=Number.MIN_VALUE,h.minYArr=[],h.maxYArr=[],h.maxX=-Number.MAX_VALUE,h.minX=Number.MAX_VALUE,h.initialMaxX=-Number.MAX_VALUE,h.initialMinX=Number.MAX_VALUE,h.maxDate=0,h.minDate=Number.MAX_VALUE,h.minZ=Number.MAX_VALUE,h.maxZ=-Number.MAX_VALUE,h.minXDiff=Number.MAX_VALUE,h.yAxisScale=[],h.xAxisScale=null,h.xAxisTicksPositions=[],h.yLabelsCoords=[],h.yTitleCoords=[],h.barPadForNumericAxis=0,h.padHorizontal=0,h.xRange=0,h.yRange=[],h.zRange=0,h.dataPoints=0,h.xTickAmount=0,h.multiAxisTickAmount=0}},{key:"globalVars",value:function(h){return{chartID:null,cuid:null,events:{beforeMount:[],mounted:[],updated:[],clicked:[],selection:[],dataPointSelection:[],zoomed:[],scrolled:[]},colors:[],clientX:null,clientY:null,fill:{colors:[]},stroke:{colors:[]},dataLabels:{style:{colors:[]}},radarPolygons:{fill:{colors:[]}},markers:{colors:[],size:h.markers.size,largestSize:0},animationEnded:!1,isTouchDevice:"ontouchstart"in window||navigator.msMaxTouchPoints,isDirty:!1,isExecCalled:!1,initialConfig:null,initialSeries:[],lastXAxis:[],lastYAxis:[],columnSeries:null,labels:[],timescaleLabels:[],noLabelsProvided:!1,allSeriesCollapsed:!1,collapsedSeries:[],collapsedSeriesIndices:[],ancillaryCollapsedSeries:[],ancillaryCollapsedSeriesIndices:[],risingSeries:[],dataFormatXNumeric:!1,capturedSeriesIndex:-1,capturedDataPointIndex:-1,selectedDataPoints:[],invalidLogScale:!1,ignoreYAxisIndexes:[],maxValsInArrayIndex:0,radialSize:0,selection:void 0,zoomEnabled:h.chart.toolbar.autoSelected==="zoom"&&h.chart.toolbar.tools.zoom&&h.chart.zoom.enabled,panEnabled:h.chart.toolbar.autoSelected==="pan"&&h.chart.toolbar.tools.pan,selectionEnabled:h.chart.toolbar.autoSelected==="selection"&&h.chart.toolbar.tools.selection,yaxis:null,mousedown:!1,lastClientPosition:{},visibleXRange:void 0,yValueDecimal:0,total:0,SVGNS:"http://www.w3.org/2000/svg",svgWidth:0,svgHeight:0,noData:!1,locale:{},dom:{},memory:{methodsToExec:[]},shouldAnimate:!0,skipLastTimelinelabel:!1,skipFirstTimelinelabel:!1,delayedElements:[],axisCharts:!0,isDataXYZ:!1,isSlopeChart:h.plotOptions.line.isSlopeChart,resized:!1,resizeTimer:null,comboCharts:!1,dataChanged:!1,previousPaths:[],allSeriesHasEqualX:!0,pointsArray:[],dataLabelsRects:[],lastDrawnDataLabelsIndexes:[],hasNullValues:!1,easing:null,zoomed:!1,gridWidth:0,gridHeight:0,rotateXLabels:!1,defaultLabels:!1,xLabelFormatter:void 0,yLabelFormatters:[],xaxisTooltipFormatter:void 0,ttKeyFormatter:void 0,ttVal:void 0,ttZFormatter:void 0,LINE_HEIGHT_RATIO:1.618,xAxisLabelsHeight:0,xAxisGroupLabelsHeight:0,xAxisLabelsWidth:0,yAxisLabelsWidth:0,scaleX:1,scaleY:1,translateX:0,translateY:0,translateYAxisX:[],yAxisWidths:[],translateXAxisY:0,translateXAxisX:0,tooltip:null,niceScaleAllowedMagMsd:[[1,1,2,5,5,5,10,10,10,10,10],[1,1,2,5,5,5,10,10,10,10,10]],niceScaleDefaultTicks:[1,2,4,4,6,6,6,6,6,6,6,6,6,6,6,6,6,6,12,12,12,12,12,12,12,12,12,24],seriesYAxisMap:[],seriesYAxisReverseMap:[]}}},{key:"init",value:function(h){var p=this.globalVars(h);return this.initGlobalVars(p),p.initialConfig=F.extend({},h),p.initialSeries=F.clone(h.series),p.lastXAxis=F.clone(p.initialConfig.xaxis),p.lastYAxis=F.clone(p.initialConfig.yaxis),p}}]),Ee}(),ge=function(){function Ee(h){s(this,Ee),this.opts=h}return o(Ee,[{key:"init",value:function(){var h=new Ne(this.opts).init({responsiveOverride:!1});return{config:h,globals:new he().init(h)}}}]),Ee}(),ye=function(){function Ee(h){s(this,Ee),this.ctx=h,this.w=h.w,this.opts=null,this.seriesIndex=0,this.patternIDs=[]}return o(Ee,[{key:"clippedImgArea",value:function(h){var p=this.w,S=p.config,_=parseInt(p.globals.gridWidth,10),k=parseInt(p.globals.gridHeight,10),T=_>k?_:k,B=h.image,q=0,te=0;h.width===void 0&&h.height===void 0?S.fill.image.width!==void 0&&S.fill.image.height!==void 0?(q=S.fill.image.width+1,te=S.fill.image.height):(q=T+1,te=T):(q=h.width,te=h.height);var ue=document.createElementNS(p.globals.SVGNS,"pattern");z.setAttrs(ue,{id:h.patternID,patternUnits:h.patternUnits?h.patternUnits:"userSpaceOnUse",width:q+"px",height:te+"px"});var de=document.createElementNS(p.globals.SVGNS,"image");ue.appendChild(de),de.setAttributeNS(window.SVG.xlink,"href",B),z.setAttrs(de,{x:0,y:0,preserveAspectRatio:"none",width:q+"px",height:te+"px"}),de.style.opacity=h.opacity,p.globals.dom.elDefs.node.appendChild(ue)}},{key:"getSeriesIndex",value:function(h){var p=this.w,S=p.config.chart.type;return(S==="bar"||S==="rangeBar")&&p.config.plotOptions.bar.distributed||S==="heatmap"||S==="treemap"?this.seriesIndex=h.seriesNumber:this.seriesIndex=h.seriesNumber%p.globals.series.length,this.seriesIndex}},{key:"fillPath",value:function(h){var p=this.w;this.opts=h;var S,_,k,T=this.w.config;this.seriesIndex=this.getSeriesIndex(h);var B=this.getFillColors()[this.seriesIndex];p.globals.seriesColors[this.seriesIndex]!==void 0&&(B=p.globals.seriesColors[this.seriesIndex]),typeof B=="function"&&(B=B({seriesIndex:this.seriesIndex,dataPointIndex:h.dataPointIndex,value:h.value,w:p}));var q=h.fillType?h.fillType:this.getFillType(this.seriesIndex),te=Array.isArray(T.fill.opacity)?T.fill.opacity[this.seriesIndex]:T.fill.opacity;h.color&&(B=h.color),B||(B="#fff",console.warn("undefined color - ApexCharts"));var ue=B;if(B.indexOf("rgb")===-1?B.length<9&&(ue=F.hexToRgba(B,te)):B.indexOf("rgba")>-1&&(te=F.getOpacityFromRGBA(B)),h.opacity&&(te=h.opacity),q==="pattern"&&(_=this.handlePatternFill({fillConfig:h.fillConfig,patternFill:_,fillColor:B,fillOpacity:te,defaultColor:ue})),q==="gradient"&&(k=this.handleGradientFill({fillConfig:h.fillConfig,fillColor:B,fillOpacity:te,i:this.seriesIndex})),q==="image"){var de=T.fill.image.src,xe=h.patternID?h.patternID:"",Se="pattern".concat(p.globals.cuid).concat(h.seriesNumber+1).concat(xe);this.patternIDs.indexOf(Se)===-1&&(this.clippedImgArea({opacity:te,image:Array.isArray(de)?h.seriesNumber<de.length?de[h.seriesNumber]:de[0]:de,width:h.width?h.width:void 0,height:h.height?h.height:void 0,patternUnits:h.patternUnits,patternID:Se}),this.patternIDs.push(Se)),S="url(#".concat(Se,")")}else S=q==="gradient"?k:q==="pattern"?_:ue;return h.solid&&(S=ue),S}},{key:"getFillType",value:function(h){var p=this.w;return Array.isArray(p.config.fill.type)?p.config.fill.type[h]:p.config.fill.type}},{key:"getFillColors",value:function(){var h=this.w,p=h.config,S=this.opts,_=[];return h.globals.comboCharts?h.config.series[this.seriesIndex].type==="line"?Array.isArray(h.globals.stroke.colors)?_=h.globals.stroke.colors:_.push(h.globals.stroke.colors):Array.isArray(h.globals.fill.colors)?_=h.globals.fill.colors:_.push(h.globals.fill.colors):p.chart.type==="line"?Array.isArray(h.globals.stroke.colors)?_=h.globals.stroke.colors:_.push(h.globals.stroke.colors):Array.isArray(h.globals.fill.colors)?_=h.globals.fill.colors:_.push(h.globals.fill.colors),S.fillColors!==void 0&&(_=[],Array.isArray(S.fillColors)?_=S.fillColors.slice():_.push(S.fillColors)),_}},{key:"handlePatternFill",value:function(h){var p=h.fillConfig,S=h.patternFill,_=h.fillColor,k=h.fillOpacity,T=h.defaultColor,B=this.w.config.fill;p&&(B=p);var q=this.opts,te=new z(this.ctx),ue=Array.isArray(B.pattern.strokeWidth)?B.pattern.strokeWidth[this.seriesIndex]:B.pattern.strokeWidth,de=_;return Array.isArray(B.pattern.style)?S=B.pattern.style[q.seriesNumber]!==void 0?te.drawPattern(B.pattern.style[q.seriesNumber],B.pattern.width,B.pattern.height,de,ue,k):T:S=te.drawPattern(B.pattern.style,B.pattern.width,B.pattern.height,de,ue,k),S}},{key:"handleGradientFill",value:function(h){var p=h.fillColor,S=h.fillOpacity,_=h.fillConfig,k=h.i,T=this.w.config.fill;_&&(T=v(v({},T),_));var B,q=this.opts,te=new z(this.ctx),ue=new F,de=T.gradient.type,xe=p,Se=T.gradient.opacityFrom===void 0?S:Array.isArray(T.gradient.opacityFrom)?T.gradient.opacityFrom[k]:T.gradient.opacityFrom;xe.indexOf("rgba")>-1&&(Se=F.getOpacityFromRGBA(xe));var ke=T.gradient.opacityTo===void 0?S:Array.isArray(T.gradient.opacityTo)?T.gradient.opacityTo[k]:T.gradient.opacityTo;if(T.gradient.gradientToColors===void 0||T.gradient.gradientToColors.length===0)B=T.gradient.shade==="dark"?ue.shadeColor(-1*parseFloat(T.gradient.shadeIntensity),p.indexOf("rgb")>-1?F.rgb2hex(p):p):ue.shadeColor(parseFloat(T.gradient.shadeIntensity),p.indexOf("rgb")>-1?F.rgb2hex(p):p);else if(T.gradient.gradientToColors[q.seriesNumber]){var Re=T.gradient.gradientToColors[q.seriesNumber];B=Re,Re.indexOf("rgba")>-1&&(ke=F.getOpacityFromRGBA(Re))}else B=p;if(T.gradient.gradientFrom&&(xe=T.gradient.gradientFrom),T.gradient.gradientTo&&(B=T.gradient.gradientTo),T.gradient.inverseColors){var Ge=xe;xe=B,B=Ge}return xe.indexOf("rgb")>-1&&(xe=F.rgb2hex(xe)),B.indexOf("rgb")>-1&&(B=F.rgb2hex(B)),te.drawGradient(de,xe,B,Se,ke,q.size,T.gradient.stops,T.gradient.colorStops,k)}}]),Ee}(),ve=function(){function Ee(h,p){s(this,Ee),this.ctx=h,this.w=h.w}return o(Ee,[{key:"setGlobalMarkerSize",value:function(){var h=this.w;if(h.globals.markers.size=Array.isArray(h.config.markers.size)?h.config.markers.size:[h.config.markers.size],h.globals.markers.size.length>0){if(h.globals.markers.size.length<h.globals.series.length+1)for(var p=0;p<=h.globals.series.length;p++)h.globals.markers.size[p]===void 0&&h.globals.markers.size.push(h.globals.markers.size[0])}else h.globals.markers.size=h.config.series.map(function(S){return h.config.markers.size})}},{key:"plotChartMarkers",value:function(h,p,S,_){var k,T=arguments.length>4&&arguments[4]!==void 0&&arguments[4],B=this.w,q=p,te=h,ue=null,de=new z(this.ctx),xe=B.config.markers.discrete&&B.config.markers.discrete.length;if((B.globals.markers.size[p]>0||T||xe)&&(ue=de.group({class:T||xe?"":"apexcharts-series-markers"})).attr("clip-path","url(#gridRectMarkerMask".concat(B.globals.cuid,")")),Array.isArray(te.x))for(var Se=0;Se<te.x.length;Se++){var ke=S;S===1&&Se===0&&(ke=0),S===1&&Se===1&&(ke=1);var Re="apexcharts-marker";if(B.config.chart.type!=="line"&&B.config.chart.type!=="area"||B.globals.comboCharts||B.config.tooltip.intersect||(Re+=" no-pointer-events"),(Array.isArray(B.config.markers.size)?B.globals.markers.size[p]>0:B.config.markers.size>0)||T||xe){F.isNumber(te.y[Se])?Re+=" w".concat(F.randomId()):Re="apexcharts-nullpoint";var Ge=this.getMarkerConfig({cssClass:Re,seriesIndex:p,dataPointIndex:ke});B.config.series[q].data[ke]&&(B.config.series[q].data[ke].fillColor&&(Ge.pointFillColor=B.config.series[q].data[ke].fillColor),B.config.series[q].data[ke].strokeColor&&(Ge.pointStrokeColor=B.config.series[q].data[ke].strokeColor)),_!==void 0&&(Ge.pSize=_),(te.x[Se]<-B.globals.markers.largestSize||te.x[Se]>B.globals.gridWidth+B.globals.markers.largestSize||te.y[Se]<-B.globals.markers.largestSize||te.y[Se]>B.globals.gridHeight+B.globals.markers.largestSize)&&(Ge.pSize=0),(k=de.drawMarker(te.x[Se],te.y[Se],Ge)).attr("rel",ke),k.attr("j",ke),k.attr("index",p),k.node.setAttribute("default-marker-size",Ge.pSize),new L(this.ctx).setSelectionFilter(k,p,ke),this.addEvents(k),ue&&ue.add(k)}else B.globals.pointsArray[p]===void 0&&(B.globals.pointsArray[p]=[]),B.globals.pointsArray[p].push([te.x[Se],te.y[Se]])}return ue}},{key:"getMarkerConfig",value:function(h){var p=h.cssClass,S=h.seriesIndex,_=h.dataPointIndex,k=_===void 0?null:_,T=h.radius,B=T===void 0?null:T,q=h.size,te=q===void 0?null:q,ue=h.strokeWidth,de=ue===void 0?null:ue,xe=this.w,Se=this.getMarkerStyle(S),ke=te===null?xe.globals.markers.size[S]:te,Re=xe.config.markers;return k!==null&&Re.discrete.length&&Re.discrete.map(function(Ge){Ge.seriesIndex===S&&Ge.dataPointIndex===k&&(Se.pointStrokeColor=Ge.strokeColor,Se.pointFillColor=Ge.fillColor,ke=Ge.size,Se.pointShape=Ge.shape)}),{pSize:B===null?ke:B,pRadius:B!==null?B:Re.radius,pointStrokeWidth:de!==null?de:Array.isArray(Re.strokeWidth)?Re.strokeWidth[S]:Re.strokeWidth,pointStrokeColor:Se.pointStrokeColor,pointFillColor:Se.pointFillColor,shape:Se.pointShape||(Array.isArray(Re.shape)?Re.shape[S]:Re.shape),class:p,pointStrokeOpacity:Array.isArray(Re.strokeOpacity)?Re.strokeOpacity[S]:Re.strokeOpacity,pointStrokeDashArray:Array.isArray(Re.strokeDashArray)?Re.strokeDashArray[S]:Re.strokeDashArray,pointFillOpacity:Array.isArray(Re.fillOpacity)?Re.fillOpacity[S]:Re.fillOpacity,seriesIndex:S}}},{key:"addEvents",value:function(h){var p=this.w,S=new z(this.ctx);h.node.addEventListener("mouseenter",S.pathMouseEnter.bind(this.ctx,h)),h.node.addEventListener("mouseleave",S.pathMouseLeave.bind(this.ctx,h)),h.node.addEventListener("mousedown",S.pathMouseDown.bind(this.ctx,h)),h.node.addEventListener("click",p.config.markers.onClick),h.node.addEventListener("dblclick",p.config.markers.onDblClick),h.node.addEventListener("touchstart",S.pathMouseDown.bind(this.ctx,h),{passive:!0})}},{key:"getMarkerStyle",value:function(h){var p=this.w,S=p.globals.markers.colors,_=p.config.markers.strokeColor||p.config.markers.strokeColors;return{pointStrokeColor:Array.isArray(_)?_[h]:_,pointFillColor:Array.isArray(S)?S[h]:S}}}]),Ee}(),je=function(){function Ee(h){s(this,Ee),this.ctx=h,this.w=h.w,this.initialAnim=this.w.config.chart.animations.enabled}return o(Ee,[{key:"draw",value:function(h,p,S){var _=this.w,k=new z(this.ctx),T=S.realIndex,B=S.pointsPos,q=S.zRatio,te=S.elParent,ue=k.group({class:"apexcharts-series-markers apexcharts-series-".concat(_.config.chart.type)});if(ue.attr("clip-path","url(#gridRectMarkerMask".concat(_.globals.cuid,")")),Array.isArray(B.x))for(var de=0;de<B.x.length;de++){var xe=p+1,Se=!0;p===0&&de===0&&(xe=0),p===0&&de===1&&(xe=1);var ke=_.globals.markers.size[T];if(q!==1/0){var Re=_.config.plotOptions.bubble;ke=_.globals.seriesZ[T][xe],Re.zScaling&&(ke/=q),Re.minBubbleRadius&&ke<Re.minBubbleRadius&&(ke=Re.minBubbleRadius),Re.maxBubbleRadius&&ke>Re.maxBubbleRadius&&(ke=Re.maxBubbleRadius)}var Ge=B.x[de],Fe=B.y[de];if(ke=ke||0,Fe!==null&&_.globals.series[T][xe]!==void 0||(Se=!1),Se){var st=this.drawPoint(Ge,Fe,ke,T,xe,p);ue.add(st)}te.add(ue)}}},{key:"drawPoint",value:function(h,p,S,_,k,T){var B=this.w,q=_,te=new U(this.ctx),ue=new L(this.ctx),de=new ye(this.ctx),xe=new ve(this.ctx),Se=new z(this.ctx),ke=xe.getMarkerConfig({cssClass:"apexcharts-marker",seriesIndex:q,dataPointIndex:k,radius:B.config.chart.type==="bubble"||B.globals.comboCharts&&B.config.series[_]&&B.config.series[_].type==="bubble"?S:null}),Re=de.fillPath({seriesNumber:_,dataPointIndex:k,color:ke.pointFillColor,patternUnits:"objectBoundingBox",value:B.globals.series[_][T]}),Ge=Se.drawMarker(h,p,ke);if(B.config.series[q].data[k]&&B.config.series[q].data[k].fillColor&&(Re=B.config.series[q].data[k].fillColor),Ge.attr({fill:Re}),B.config.chart.dropShadow.enabled){var Fe=B.config.chart.dropShadow;ue.dropShadow(Ge,Fe,_)}if(!this.initialAnim||B.globals.dataChanged||B.globals.resized)B.globals.animationEnded=!0;else{var st=B.config.chart.animations.speed;te.animateMarker(Ge,st,B.globals.easing,function(){window.setTimeout(function(){te.animationCompleted(Ge)},100)})}return Ge.attr({rel:k,j:k,index:_,"default-marker-size":ke.pSize}),ue.setSelectionFilter(Ge,_,k),xe.addEvents(Ge),Ge.node.classList.add("apexcharts-marker"),Ge}},{key:"centerTextInBubble",value:function(h){var p=this.w;return{y:h+=parseInt(p.config.dataLabels.style.fontSize,10)/4}}}]),Ee}(),Ie=function(){function Ee(h){s(this,Ee),this.ctx=h,this.w=h.w}return o(Ee,[{key:"dataLabelsCorrection",value:function(h,p,S,_,k,T,B){var q=this.w,te=!1,ue=new z(this.ctx).getTextRects(S,B),de=ue.width,xe=ue.height;p<0&&(p=0),p>q.globals.gridHeight+xe&&(p=q.globals.gridHeight+xe/2),q.globals.dataLabelsRects[_]===void 0&&(q.globals.dataLabelsRects[_]=[]),q.globals.dataLabelsRects[_].push({x:h,y:p,width:de,height:xe});var Se=q.globals.dataLabelsRects[_].length-2,ke=q.globals.lastDrawnDataLabelsIndexes[_]!==void 0?q.globals.lastDrawnDataLabelsIndexes[_][q.globals.lastDrawnDataLabelsIndexes[_].length-1]:0;if(q.globals.dataLabelsRects[_][Se]!==void 0){var Re=q.globals.dataLabelsRects[_][ke];(h>Re.x+Re.width||p>Re.y+Re.height||p+xe<Re.y||h+de<Re.x)&&(te=!0)}return(k===0||T)&&(te=!0),{x:h,y:p,textRects:ue,drawnextLabel:te}}},{key:"drawDataLabel",value:function(h){var p=this,S=h.type,_=h.pos,k=h.i,T=h.j,B=h.isRangeStart,q=h.strokeWidth,te=q===void 0?2:q,ue=this.w,de=new z(this.ctx),xe=ue.config.dataLabels,Se=0,ke=0,Re=T,Ge=null;if(ue.globals.collapsedSeriesIndices.indexOf(k)!==-1||!xe.enabled||!Array.isArray(_.x))return Ge;Ge=de.group({class:"apexcharts-data-labels"});for(var Fe=0;Fe<_.x.length;Fe++)if(Se=_.x[Fe]+xe.offsetX,ke=_.y[Fe]+xe.offsetY+te,!isNaN(Se)){T===1&&Fe===0&&(Re=0),T===1&&Fe===1&&(Re=1);var st=ue.globals.series[k][Re];S==="rangeArea"&&(st=B?ue.globals.seriesRangeStart[k][Re]:ue.globals.seriesRangeEnd[k][Re]);var se="",Ce=function(De){return ue.config.dataLabels.formatter(De,{ctx:p.ctx,seriesIndex:k,dataPointIndex:Re,w:ue})};ue.config.chart.type==="bubble"?(se=Ce(st=ue.globals.seriesZ[k][Re]),ke=_.y[Fe],ke=new je(this.ctx).centerTextInBubble(ke,k,Re).y):st!==void 0&&(se=Ce(st));var Be=ue.config.dataLabels.textAnchor;ue.globals.isSlopeChart&&(Be=Re===0?"end":Re===ue.config.series[k].data.length-1?"start":"middle"),this.plotDataLabelsText({x:Se,y:ke,text:se,i:k,j:Re,parent:Ge,offsetCorrection:!0,dataLabelsConfig:ue.config.dataLabels,textAnchor:Be})}return Ge}},{key:"plotDataLabelsText",value:function(h){var p=this.w,S=new z(this.ctx),_=h.x,k=h.y,T=h.i,B=h.j,q=h.text,te=h.textAnchor,ue=h.fontSize,de=h.parent,xe=h.dataLabelsConfig,Se=h.color,ke=h.alwaysDrawDataLabel,Re=h.offsetCorrection,Ge=h.className,Fe=null;if(Array.isArray(p.config.dataLabels.enabledOnSeries)&&p.config.dataLabels.enabledOnSeries.indexOf(T)<0)return Fe;var st={x:_,y:k,drawnextLabel:!0,textRects:null};Re&&(st=this.dataLabelsCorrection(_,k,q,T,B,ke,parseInt(xe.style.fontSize,10))),p.globals.zoomed||(_=st.x,k=st.y),st.textRects&&(_<-20-st.textRects.width||_>p.globals.gridWidth+st.textRects.width+30)&&(q="");var se=p.globals.dataLabels.style.colors[T];((p.config.chart.type==="bar"||p.config.chart.type==="rangeBar")&&p.config.plotOptions.bar.distributed||p.config.dataLabels.distributed)&&(se=p.globals.dataLabels.style.colors[B]),typeof se=="function"&&(se=se({series:p.globals.series,seriesIndex:T,dataPointIndex:B,w:p})),Se&&(se=Se);var Ce=xe.offsetX,Be=xe.offsetY;if(p.config.chart.type!=="bar"&&p.config.chart.type!=="rangeBar"||(Ce=0,Be=0),p.globals.isSlopeChart&&(B!==0&&(Ce=-2*xe.offsetX+5),B!==0&&B!==p.config.series[T].data.length-1&&(Ce=0)),st.drawnextLabel){if((Fe=S.drawText({width:100,height:parseInt(xe.style.fontSize,10),x:_+Ce,y:k+Be,foreColor:se,textAnchor:te||xe.textAnchor,text:q,fontSize:ue||xe.style.fontSize,fontFamily:xe.style.fontFamily,fontWeight:xe.style.fontWeight||"normal"})).attr({class:Ge||"apexcharts-datalabel",cx:_,cy:k}),xe.dropShadow.enabled){var De=xe.dropShadow;new L(this.ctx).dropShadow(Fe,De)}de.add(Fe),p.globals.lastDrawnDataLabelsIndexes[T]===void 0&&(p.globals.lastDrawnDataLabelsIndexes[T]=[]),p.globals.lastDrawnDataLabelsIndexes[T].push(B)}return Fe}},{key:"addBackgroundToDataLabel",value:function(h,p){var S=this.w,_=S.config.dataLabels.background,k=_.padding,T=_.padding/2,B=p.width,q=p.height,te=new z(this.ctx).drawRect(p.x-k,p.y-T/2,B+2*k,q+T,_.borderRadius,S.config.chart.background!=="transparent"&&S.config.chart.background?S.config.chart.background:"#fff",_.opacity,_.borderWidth,_.borderColor);return _.dropShadow.enabled&&new L(this.ctx).dropShadow(te,_.dropShadow),te}},{key:"dataLabelsBackground",value:function(){var h=this.w;if(h.config.chart.type!=="bubble")for(var p=h.globals.dom.baseEl.querySelectorAll(".apexcharts-datalabels text"),S=0;S<p.length;S++){var _=p[S],k=_.getBBox(),T=null;if(k.width&&k.height&&(T=this.addBackgroundToDataLabel(_,k)),T){_.parentNode.insertBefore(T.node,_);var B=_.getAttribute("fill");h.config.chart.animations.enabled&&!h.globals.resized&&!h.globals.dataChanged?T.animate().attr({fill:B}):T.attr({fill:B}),_.setAttribute("fill",h.config.dataLabels.background.foreColor)}}}},{key:"bringForward",value:function(){for(var h=this.w,p=h.globals.dom.baseEl.querySelectorAll(".apexcharts-datalabels"),S=h.globals.dom.baseEl.querySelector(".apexcharts-plot-series:last-child"),_=0;_<p.length;_++)S&&S.insertBefore(p[_],S.nextSibling)}}]),Ee}(),Le=function(){function Ee(h){s(this,Ee),this.ctx=h,this.w=h.w,this.legendInactiveClass="legend-mouseover-inactive"}return o(Ee,[{key:"getAllSeriesEls",value:function(){return this.w.globals.dom.baseEl.getElementsByClassName("apexcharts-series")}},{key:"getSeriesByName",value:function(h){return this.w.globals.dom.baseEl.querySelector(".apexcharts-inner .apexcharts-series[seriesName='".concat(F.escapeString(h),"']"))}},{key:"isSeriesHidden",value:function(h){var p=this.getSeriesByName(h),S=parseInt(p.getAttribute("data:realIndex"),10);return{isHidden:p.classList.contains("apexcharts-series-collapsed"),realIndex:S}}},{key:"addCollapsedClassToSeries",value:function(h,p){var S=this.w;function _(k){for(var T=0;T<k.length;T++)k[T].index===p&&h.node.classList.add("apexcharts-series-collapsed")}_(S.globals.collapsedSeries),_(S.globals.ancillaryCollapsedSeries)}},{key:"toggleSeries",value:function(h){var p=this.isSeriesHidden(h);return this.ctx.legend.legendHelpers.toggleDataSeries(p.realIndex,p.isHidden),p.isHidden}},{key:"showSeries",value:function(h){var p=this.isSeriesHidden(h);p.isHidden&&this.ctx.legend.legendHelpers.toggleDataSeries(p.realIndex,!0)}},{key:"hideSeries",value:function(h){var p=this.isSeriesHidden(h);p.isHidden||this.ctx.legend.legendHelpers.toggleDataSeries(p.realIndex,!1)}},{key:"resetSeries",value:function(){var h=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0],p=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],S=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2],_=this.w,k=F.clone(_.globals.initialSeries);_.globals.previousPaths=[],S?(_.globals.collapsedSeries=[],_.globals.ancillaryCollapsedSeries=[],_.globals.collapsedSeriesIndices=[],_.globals.ancillaryCollapsedSeriesIndices=[]):k=this.emptyCollapsedSeries(k),_.config.series=k,h&&(p&&(_.globals.zoomed=!1,this.ctx.updateHelpers.revertDefaultAxisMinMax()),this.ctx.updateHelpers._updateSeries(k,_.config.chart.animations.dynamicAnimation.enabled))}},{key:"emptyCollapsedSeries",value:function(h){for(var p=this.w,S=0;S<h.length;S++)p.globals.collapsedSeriesIndices.indexOf(S)>-1&&(h[S].data=[]);return h}},{key:"highlightSeries",value:function(h){var p=this.w,S=this.getSeriesByName(h),_=parseInt(S==null?void 0:S.getAttribute("data:realIndex"),10),k=p.globals.dom.baseEl.querySelectorAll(".apexcharts-series, .apexcharts-datalabels, .apexcharts-yaxis"),T=null,B=null,q=null;if(p.globals.axisCharts||p.config.chart.type==="radialBar")if(p.globals.axisCharts){T=p.globals.dom.baseEl.querySelector(".apexcharts-series[data\\:realIndex='".concat(_,"']")),B=p.globals.dom.baseEl.querySelector(".apexcharts-datalabels[data\\:realIndex='".concat(_,"']"));var te=p.globals.seriesYAxisReverseMap[_];q=p.globals.dom.baseEl.querySelector(".apexcharts-yaxis[rel='".concat(te,"']"))}else T=p.globals.dom.baseEl.querySelector(".apexcharts-series[rel='".concat(_+1,"']"));else T=p.globals.dom.baseEl.querySelector(".apexcharts-series[rel='".concat(_+1,"'] path"));for(var ue=0;ue<k.length;ue++)k[ue].classList.add(this.legendInactiveClass);if(T)p.globals.axisCharts||T.parentNode.classList.remove(this.legendInactiveClass),T.classList.remove(this.legendInactiveClass),B!==null&&B.classList.remove(this.legendInactiveClass),q!==null&&q.classList.remove(this.legendInactiveClass);else for(var de=0;de<k.length;de++)k[de].classList.remove(this.legendInactiveClass)}},{key:"toggleSeriesOnHover",value:function(h,p){var S=this.w;p||(p=h.target);var _=S.globals.dom.baseEl.querySelectorAll(".apexcharts-series, .apexcharts-datalabels, .apexcharts-yaxis");if(h.type==="mousemove"){var k=parseInt(p.getAttribute("rel"),10)-1;this.highlightSeries(S.globals.seriesNames[k])}else if(h.type==="mouseout")for(var T=0;T<_.length;T++)_[T].classList.remove(this.legendInactiveClass)}},{key:"highlightRangeInSeries",value:function(h,p){var S=this,_=this.w,k=_.globals.dom.baseEl.getElementsByClassName("apexcharts-heatmap-rect"),T=function(te){for(var ue=0;ue<k.length;ue++)k[ue].classList[te](S.legendInactiveClass)};if(h.type==="mousemove"){var B=parseInt(p.getAttribute("rel"),10)-1;T("add");var q=_.config.plotOptions.heatmap.colorScale.ranges;(function(te,ue){for(var de=0;de<k.length;de++){var xe=Number(k[de].getAttribute("val"));xe>=te.from&&(xe<te.to||te.to===ue&&xe===ue)&&k[de].classList.remove(S.legendInactiveClass)}})(q[B],q.reduce(function(te,ue){return Math.max(te,ue.to)},0))}else h.type==="mouseout"&&T("remove")}},{key:"getActiveConfigSeriesIndex",value:function(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"asc",p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],S=this.w,_=0;if(S.config.series.length>1){for(var k=S.config.series.map(function(B,q){return B.data&&B.data.length>0&&S.globals.collapsedSeriesIndices.indexOf(q)===-1&&(!S.globals.comboCharts||p.length===0||p.length&&p.indexOf(S.config.series[q].type)>-1)?q:-1}),T=h==="asc"?0:k.length-1;h==="asc"?T<k.length:T>=0;h==="asc"?T++:T--)if(k[T]!==-1){_=k[T];break}}return _}},{key:"getBarSeriesIndices",value:function(){return this.w.globals.comboCharts?this.w.config.series.map(function(h,p){return h.type==="bar"||h.type==="column"?p:-1}).filter(function(h){return h!==-1}):this.w.config.series.map(function(h,p){return p})}},{key:"getPreviousPaths",value:function(){var h=this.w;function p(T,B,q){for(var te=T[B].childNodes,ue={type:q,paths:[],realIndex:T[B].getAttribute("data:realIndex")},de=0;de<te.length;de++)if(te[de].hasAttribute("pathTo")){var xe=te[de].getAttribute("pathTo");ue.paths.push({d:xe})}h.globals.previousPaths.push(ue)}h.globals.previousPaths=[],["line","area","bar","rangebar","rangeArea","candlestick","radar"].forEach(function(T){for(var B,q=(B=T,h.globals.dom.baseEl.querySelectorAll(".apexcharts-".concat(B,"-series .apexcharts-series"))),te=0;te<q.length;te++)p(q,te,T)}),this.handlePrevBubbleScatterPaths("bubble"),this.handlePrevBubbleScatterPaths("scatter");var S=h.globals.dom.baseEl.querySelectorAll(".apexcharts-".concat(h.config.chart.type," .apexcharts-series"));if(S.length>0)for(var _=function(T){for(var B=h.globals.dom.baseEl.querySelectorAll(".apexcharts-".concat(h.config.chart.type," .apexcharts-series[data\\:realIndex='").concat(T,"'] rect")),q=[],te=function(de){var xe=function(ke){return B[de].getAttribute(ke)},Se={x:parseFloat(xe("x")),y:parseFloat(xe("y")),width:parseFloat(xe("width")),height:parseFloat(xe("height"))};q.push({rect:Se,color:B[de].getAttribute("color")})},ue=0;ue<B.length;ue++)te(ue);h.globals.previousPaths.push(q)},k=0;k<S.length;k++)_(k);h.globals.axisCharts||(h.globals.previousPaths=h.globals.series)}},{key:"handlePrevBubbleScatterPaths",value:function(h){var p=this.w,S=p.globals.dom.baseEl.querySelectorAll(".apexcharts-".concat(h,"-series .apexcharts-series"));if(S.length>0)for(var _=0;_<S.length;_++){for(var k=p.globals.dom.baseEl.querySelectorAll(".apexcharts-".concat(h,"-series .apexcharts-series[data\\:realIndex='").concat(_,"'] circle")),T=[],B=0;B<k.length;B++)T.push({x:k[B].getAttribute("cx"),y:k[B].getAttribute("cy"),r:k[B].getAttribute("r")});p.globals.previousPaths.push(T)}}},{key:"clearPreviousPaths",value:function(){var h=this.w;h.globals.previousPaths=[],h.globals.allSeriesCollapsed=!1}},{key:"handleNoData",value:function(){var h=this.w,p=h.config.noData,S=new z(this.ctx),_=h.globals.svgWidth/2,k=h.globals.svgHeight/2,T="middle";if(h.globals.noData=!0,h.globals.animationEnded=!0,p.align==="left"?(_=10,T="start"):p.align==="right"&&(_=h.globals.svgWidth-10,T="end"),p.verticalAlign==="top"?k=50:p.verticalAlign==="bottom"&&(k=h.globals.svgHeight-50),_+=p.offsetX,k=k+parseInt(p.style.fontSize,10)+2+p.offsetY,p.text!==void 0&&p.text!==""){var B=S.drawText({x:_,y:k,text:p.text,textAnchor:T,fontSize:p.style.fontSize,fontFamily:p.style.fontFamily,foreColor:p.style.color,opacity:1,class:"apexcharts-text-nodata"});h.globals.dom.Paper.add(B)}}},{key:"setNullSeriesToZeroValues",value:function(h){for(var p=this.w,S=0;S<h.length;S++)if(h[S].length===0)for(var _=0;_<h[p.globals.maxValsInArrayIndex].length;_++)h[S].push(0);return h}},{key:"hasAllSeriesEqualX",value:function(){for(var h=!0,p=this.w,S=this.filteredSeriesX(),_=0;_<S.length-1;_++)if(S[_][0]!==S[_+1][0]){h=!1;break}return p.globals.allSeriesHasEqualX=h,h}},{key:"filteredSeriesX",value:function(){var h=this.w.globals.seriesX.map(function(p){return p.length>0?p:[]});return h}}]),Ee}(),Qe=function(){function Ee(h){s(this,Ee),this.ctx=h,this.w=h.w,this.twoDSeries=[],this.threeDSeries=[],this.twoDSeriesX=[],this.seriesGoals=[],this.coreUtils=new Q(this.ctx)}return o(Ee,[{key:"isMultiFormat",value:function(){return this.isFormatXY()||this.isFormat2DArray()}},{key:"isFormatXY",value:function(){var h=this.w.config.series.slice(),p=new Le(this.ctx);if(this.activeSeriesIndex=p.getActiveConfigSeriesIndex(),h[this.activeSeriesIndex].data!==void 0&&h[this.activeSeriesIndex].data.length>0&&h[this.activeSeriesIndex].data[0]!==null&&h[this.activeSeriesIndex].data[0].x!==void 0&&h[this.activeSeriesIndex].data[0]!==null)return!0}},{key:"isFormat2DArray",value:function(){var h=this.w.config.series.slice(),p=new Le(this.ctx);if(this.activeSeriesIndex=p.getActiveConfigSeriesIndex(),h[this.activeSeriesIndex].data!==void 0&&h[this.activeSeriesIndex].data.length>0&&h[this.activeSeriesIndex].data[0]!==void 0&&h[this.activeSeriesIndex].data[0]!==null&&h[this.activeSeriesIndex].data[0].constructor===Array)return!0}},{key:"handleFormat2DArray",value:function(h,p){for(var S=this.w.config,_=this.w.globals,k=S.chart.type==="boxPlot"||S.series[p].type==="boxPlot",T=0;T<h[p].data.length;T++)if(h[p].data[T][1]!==void 0&&(Array.isArray(h[p].data[T][1])&&h[p].data[T][1].length===4&&!k?this.twoDSeries.push(F.parseNumber(h[p].data[T][1][3])):h[p].data[T].length>=5?this.twoDSeries.push(F.parseNumber(h[p].data[T][4])):this.twoDSeries.push(F.parseNumber(h[p].data[T][1])),_.dataFormatXNumeric=!0),S.xaxis.type==="datetime"){var B=new Date(h[p].data[T][0]);B=new Date(B).getTime(),this.twoDSeriesX.push(B)}else this.twoDSeriesX.push(h[p].data[T][0]);for(var q=0;q<h[p].data.length;q++)h[p].data[q][2]!==void 0&&(this.threeDSeries.push(h[p].data[q][2]),_.isDataXYZ=!0)}},{key:"handleFormatXY",value:function(h,p){var S=this.w.config,_=this.w.globals,k=new X(this.ctx),T=p;_.collapsedSeriesIndices.indexOf(p)>-1&&(T=this.activeSeriesIndex);for(var B=0;B<h[p].data.length;B++)h[p].data[B].y!==void 0&&(Array.isArray(h[p].data[B].y)?this.twoDSeries.push(F.parseNumber(h[p].data[B].y[h[p].data[B].y.length-1])):this.twoDSeries.push(F.parseNumber(h[p].data[B].y))),h[p].data[B].goals!==void 0&&Array.isArray(h[p].data[B].goals)?(this.seriesGoals[p]===void 0&&(this.seriesGoals[p]=[]),this.seriesGoals[p].push(h[p].data[B].goals)):(this.seriesGoals[p]===void 0&&(this.seriesGoals[p]=[]),this.seriesGoals[p].push(null));for(var q=0;q<h[T].data.length;q++){var te=typeof h[T].data[q].x=="string",ue=Array.isArray(h[T].data[q].x),de=!ue&&!!k.isValidDate(h[T].data[q].x);if(te||de)if(te||S.xaxis.convertedCatToNumeric){var xe=_.isBarHorizontal&&_.isRangeData;S.xaxis.type!=="datetime"||xe?(this.fallbackToCategory=!0,this.twoDSeriesX.push(h[T].data[q].x),isNaN(h[T].data[q].x)||this.w.config.xaxis.type==="category"||typeof h[T].data[q].x=="string"||(_.isXNumeric=!0)):this.twoDSeriesX.push(k.parseDate(h[T].data[q].x))}else S.xaxis.type==="datetime"?this.twoDSeriesX.push(k.parseDate(h[T].data[q].x.toString())):(_.dataFormatXNumeric=!0,_.isXNumeric=!0,this.twoDSeriesX.push(parseFloat(h[T].data[q].x)));else ue?(this.fallbackToCategory=!0,this.twoDSeriesX.push(h[T].data[q].x)):(_.isXNumeric=!0,_.dataFormatXNumeric=!0,this.twoDSeriesX.push(h[T].data[q].x))}if(h[p].data[0]&&h[p].data[0].z!==void 0){for(var Se=0;Se<h[p].data.length;Se++)this.threeDSeries.push(h[p].data[Se].z);_.isDataXYZ=!0}}},{key:"handleRangeData",value:function(h,p){var S=this.w.globals,_={};return this.isFormat2DArray()?_=this.handleRangeDataFormat("array",h,p):this.isFormatXY()&&(_=this.handleRangeDataFormat("xy",h,p)),S.seriesRangeStart.push(_.start===void 0?[]:_.start),S.seriesRangeEnd.push(_.end===void 0?[]:_.end),S.seriesRange.push(_.rangeUniques),S.seriesRange.forEach(function(k,T){k&&k.forEach(function(B,q){B.y.forEach(function(te,ue){for(var de=0;de<B.y.length;de++)if(ue!==de){var xe=te.y1,Se=te.y2,ke=B.y[de].y1;xe<=B.y[de].y2&&ke<=Se&&(B.overlaps.indexOf(te.rangeName)<0&&B.overlaps.push(te.rangeName),B.overlaps.indexOf(B.y[de].rangeName)<0&&B.overlaps.push(B.y[de].rangeName))}})})}),_}},{key:"handleCandleStickBoxData",value:function(h,p){var S=this.w.globals,_={};return this.isFormat2DArray()?_=this.handleCandleStickBoxDataFormat("array",h,p):this.isFormatXY()&&(_=this.handleCandleStickBoxDataFormat("xy",h,p)),S.seriesCandleO[p]=_.o,S.seriesCandleH[p]=_.h,S.seriesCandleM[p]=_.m,S.seriesCandleL[p]=_.l,S.seriesCandleC[p]=_.c,_}},{key:"handleRangeDataFormat",value:function(h,p,S){var _=[],k=[],T=p[S].data.filter(function(ue,de,xe){return de===xe.findIndex(function(Se){return Se.x===ue.x})}).map(function(ue,de){return{x:ue.x,overlaps:[],y:[]}});if(h==="array")for(var B=0;B<p[S].data.length;B++)Array.isArray(p[S].data[B])?(_.push(p[S].data[B][1][0]),k.push(p[S].data[B][1][1])):(_.push(p[S].data[B]),k.push(p[S].data[B]));else if(h==="xy")for(var q=function(ue){var de=Array.isArray(p[S].data[ue].y),xe=F.randomId(),Se=p[S].data[ue].x,ke={y1:de?p[S].data[ue].y[0]:p[S].data[ue].y,y2:de?p[S].data[ue].y[1]:p[S].data[ue].y,rangeName:xe};p[S].data[ue].rangeName=xe;var Re=T.findIndex(function(Ge){return Ge.x===Se});T[Re].y.push(ke),_.push(ke.y1),k.push(ke.y2)},te=0;te<p[S].data.length;te++)q(te);return{start:_,end:k,rangeUniques:T}}},{key:"handleCandleStickBoxDataFormat",value:function(h,p,S){var _=this.w,k=_.config.chart.type==="boxPlot"||_.config.series[S].type==="boxPlot",T=[],B=[],q=[],te=[],ue=[];if(h==="array")if(k&&p[S].data[0].length===6||!k&&p[S].data[0].length===5)for(var de=0;de<p[S].data.length;de++)T.push(p[S].data[de][1]),B.push(p[S].data[de][2]),k?(q.push(p[S].data[de][3]),te.push(p[S].data[de][4]),ue.push(p[S].data[de][5])):(te.push(p[S].data[de][3]),ue.push(p[S].data[de][4]));else for(var xe=0;xe<p[S].data.length;xe++)Array.isArray(p[S].data[xe][1])&&(T.push(p[S].data[xe][1][0]),B.push(p[S].data[xe][1][1]),k?(q.push(p[S].data[xe][1][2]),te.push(p[S].data[xe][1][3]),ue.push(p[S].data[xe][1][4])):(te.push(p[S].data[xe][1][2]),ue.push(p[S].data[xe][1][3])));else if(h==="xy")for(var Se=0;Se<p[S].data.length;Se++)Array.isArray(p[S].data[Se].y)&&(T.push(p[S].data[Se].y[0]),B.push(p[S].data[Se].y[1]),k?(q.push(p[S].data[Se].y[2]),te.push(p[S].data[Se].y[3]),ue.push(p[S].data[Se].y[4])):(te.push(p[S].data[Se].y[2]),ue.push(p[S].data[Se].y[3])));return{o:T,h:B,m:q,l:te,c:ue}}},{key:"parseDataAxisCharts",value:function(h){var p=this,S=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.ctx,_=this.w.config,k=this.w.globals,T=new X(S),B=_.labels.length>0?_.labels.slice():_.xaxis.categories.slice();k.isRangeBar=_.chart.type==="rangeBar"&&k.isBarHorizontal,k.hasXaxisGroups=_.xaxis.type==="category"&&_.xaxis.group.groups.length>0,k.hasXaxisGroups&&(k.groups=_.xaxis.group.groups),h.forEach(function(Se,ke){Se.name!==void 0?k.seriesNames.push(Se.name):k.seriesNames.push("series-"+parseInt(ke+1,10))}),this.coreUtils.setSeriesYAxisMappings();var q=[],te=N(new Set(_.series.map(function(Se){return Se.group})));_.series.forEach(function(Se,ke){var Re=te.indexOf(Se.group);q[Re]||(q[Re]=[]),q[Re].push(k.seriesNames[ke])}),k.seriesGroups=q;for(var ue=function(){for(var Se=0;Se<B.length;Se++)if(typeof B[Se]=="string"){if(!T.isValidDate(B[Se]))throw new Error("You have provided invalid Date format. Please provide a valid JavaScript Date");p.twoDSeriesX.push(T.parseDate(B[Se]))}else p.twoDSeriesX.push(B[Se])},de=0;de<h.length;de++){if(this.twoDSeries=[],this.twoDSeriesX=[],this.threeDSeries=[],h[de].data===void 0)return void console.error("It is a possibility that you may have not included 'data' property in series.");if(_.chart.type!=="rangeBar"&&_.chart.type!=="rangeArea"&&h[de].type!=="rangeBar"&&h[de].type!=="rangeArea"||(k.isRangeData=!0,_.chart.type!=="rangeBar"&&_.chart.type!=="rangeArea"||this.handleRangeData(h,de)),this.isMultiFormat())this.isFormat2DArray()?this.handleFormat2DArray(h,de):this.isFormatXY()&&this.handleFormatXY(h,de),_.chart.type!=="candlestick"&&h[de].type!=="candlestick"&&_.chart.type!=="boxPlot"&&h[de].type!=="boxPlot"||this.handleCandleStickBoxData(h,de),k.series.push(this.twoDSeries),k.labels.push(this.twoDSeriesX),k.seriesX.push(this.twoDSeriesX),k.seriesGoals=this.seriesGoals,de!==this.activeSeriesIndex||this.fallbackToCategory||(k.isXNumeric=!0);else{_.xaxis.type==="datetime"?(k.isXNumeric=!0,ue(),k.seriesX.push(this.twoDSeriesX)):_.xaxis.type==="numeric"&&(k.isXNumeric=!0,B.length>0&&(this.twoDSeriesX=B,k.seriesX.push(this.twoDSeriesX))),k.labels.push(this.twoDSeriesX);var xe=h[de].data.map(function(Se){return F.parseNumber(Se)});k.series.push(xe)}k.seriesZ.push(this.threeDSeries),h[de].color!==void 0?k.seriesColors.push(h[de].color):k.seriesColors.push(void 0)}return this.w}},{key:"parseDataNonAxisCharts",value:function(h){var p=this.w.globals,S=this.w.config;p.series=h.slice(),p.seriesNames=S.labels.slice();for(var _=0;_<p.series.length;_++)p.seriesNames[_]===void 0&&p.seriesNames.push("series-"+(_+1));return this.w}},{key:"handleExternalLabelsData",value:function(h){var p=this.w.config,S=this.w.globals;p.xaxis.categories.length>0?S.labels=p.xaxis.categories:p.labels.length>0?S.labels=p.labels.slice():this.fallbackToCategory?(S.labels=S.labels[0],S.seriesRange.length&&(S.seriesRange.map(function(_){_.forEach(function(k){S.labels.indexOf(k.x)<0&&k.x&&S.labels.push(k.x)})}),S.labels=Array.from(new Set(S.labels.map(JSON.stringify)),JSON.parse)),p.xaxis.convertedCatToNumeric&&(new fe(p).convertCatToNumericXaxis(p,this.ctx,S.seriesX[0]),this._generateExternalLabels(h))):this._generateExternalLabels(h)}},{key:"_generateExternalLabels",value:function(h){var p=this.w.globals,S=this.w.config,_=[];if(p.axisCharts){if(p.series.length>0)if(this.isFormatXY())for(var k=S.series.map(function(de,xe){return de.data.filter(function(Se,ke,Re){return Re.findIndex(function(Ge){return Ge.x===Se.x})===ke})}),T=k.reduce(function(de,xe,Se,ke){return ke[de].length>xe.length?de:Se},0),B=0;B<k[T].length;B++)_.push(B+1);else for(var q=0;q<p.series[p.maxValsInArrayIndex].length;q++)_.push(q+1);p.seriesX=[];for(var te=0;te<h.length;te++)p.seriesX.push(_);this.w.globals.isBarHorizontal||(p.isXNumeric=!0)}if(_.length===0){_=p.axisCharts?[]:p.series.map(function(de,xe){return xe+1});for(var ue=0;ue<h.length;ue++)p.seriesX.push(_)}p.labels=_,S.xaxis.convertedCatToNumeric&&(p.categoryLabels=_.map(function(de){return S.xaxis.labels.formatter(de)})),p.noLabelsProvided=!0}},{key:"parseData",value:function(h){var p=this.w,S=p.config,_=p.globals;if(this.excludeCollapsedSeriesInYAxis(),this.fallbackToCategory=!1,this.ctx.core.resetGlobals(),this.ctx.core.isMultipleY(),_.axisCharts?(this.parseDataAxisCharts(h),this.coreUtils.getLargestSeries()):this.parseDataNonAxisCharts(h),S.chart.stacked){var k=new Le(this.ctx);_.series=k.setNullSeriesToZeroValues(_.series)}this.coreUtils.getSeriesTotals(),_.axisCharts&&(_.stackedSeriesTotals=this.coreUtils.getStackedSeriesTotals(),_.stackedSeriesTotalsByGroups=this.coreUtils.getStackedSeriesTotalsByGroups()),this.coreUtils.getPercentSeries(),_.dataFormatXNumeric||_.isXNumeric&&(S.xaxis.type!=="numeric"||S.labels.length!==0||S.xaxis.categories.length!==0)||this.handleExternalLabelsData(h);for(var T=this.coreUtils.getCategoryLabels(_.labels),B=0;B<T.length;B++)if(Array.isArray(T[B])){_.isMultiLineX=!0;break}}},{key:"excludeCollapsedSeriesInYAxis",value:function(){var h=this.w,p=[];h.globals.seriesYAxisMap.forEach(function(S,_){var k=0;S.forEach(function(T){h.globals.collapsedSeriesIndices.indexOf(T)!==-1&&k++}),k>0&&k==S.length&&p.push(_)}),h.globals.ignoreYAxisIndexes=p.map(function(S){return S})}}]),Ee}(),$e=function(){function Ee(h){s(this,Ee),this.ctx=h,this.w=h.w}return o(Ee,[{key:"scaleSvgNode",value:function(h,p){var S=parseFloat(h.getAttributeNS(null,"width")),_=parseFloat(h.getAttributeNS(null,"height"));h.setAttributeNS(null,"width",S*p),h.setAttributeNS(null,"height",_*p),h.setAttributeNS(null,"viewBox","0 0 "+S+" "+_)}},{key:"getSvgString",value:function(){var h=this;return new Promise(function(p){var S=h.w,_=S.config.chart.toolbar.export.width,k=S.config.chart.toolbar.export.scale||_/S.globals.svgWidth;k||(k=1);var T=h.w.globals.dom.Paper.svg(),B=h.w.globals.dom.Paper.node.cloneNode(!0);k!==1&&h.scaleSvgNode(B,k),h.convertImagesToBase64(B).then(function(){T=new XMLSerializer().serializeToString(B),p(T.replace(/ /g," "))})})}},{key:"convertImagesToBase64",value:function(h){var p=this,S=h.getElementsByTagName("image"),_=Array.from(S).map(function(k){var T=k.getAttributeNS("http://www.w3.org/1999/xlink","href");return T&&!T.startsWith("data:")?p.getBase64FromUrl(T).then(function(B){k.setAttributeNS("http://www.w3.org/1999/xlink","href",B)}).catch(function(B){console.error("Error converting image to base64:",B)}):Promise.resolve()});return Promise.all(_)}},{key:"getBase64FromUrl",value:function(h){return new Promise(function(p,S){var _=new Image;_.crossOrigin="Anonymous",_.onload=function(){var k=document.createElement("canvas");k.width=_.width,k.height=_.height,k.getContext("2d").drawImage(_,0,0),p(k.toDataURL())},_.onerror=S,_.src=h})}},{key:"cleanup",value:function(){var h=this.w,p=h.globals.dom.baseEl.getElementsByClassName("apexcharts-xcrosshairs"),S=h.globals.dom.baseEl.getElementsByClassName("apexcharts-ycrosshairs"),_=h.globals.dom.baseEl.querySelectorAll(".apexcharts-zoom-rect, .apexcharts-selection-rect");Array.prototype.forEach.call(_,function(k){k.setAttribute("width",0)}),p&&p[0]&&(p[0].setAttribute("x",-500),p[0].setAttribute("x1",-500),p[0].setAttribute("x2",-500)),S&&S[0]&&(S[0].setAttribute("y",-100),S[0].setAttribute("y1",-100),S[0].setAttribute("y2",-100))}},{key:"svgUrl",value:function(){var h=this;return new Promise(function(p){h.cleanup(),h.getSvgString().then(function(S){var _=new Blob([S],{type:"image/svg+xml;charset=utf-8"});p(URL.createObjectURL(_))})})}},{key:"dataURI",value:function(h){var p=this;return new Promise(function(S){var _=p.w,k=h?h.scale||h.width/_.globals.svgWidth:1;p.cleanup();var T=document.createElement("canvas");T.width=_.globals.svgWidth*k,T.height=parseInt(_.globals.dom.elWrap.style.height,10)*k;var B=_.config.chart.background!=="transparent"&&_.config.chart.background?_.config.chart.background:"#fff",q=T.getContext("2d");q.fillStyle=B,q.fillRect(0,0,T.width*k,T.height*k),p.getSvgString().then(function(te){var ue="data:image/svg+xml,"+encodeURIComponent(te),de=new Image;de.crossOrigin="anonymous",de.onload=function(){if(q.drawImage(de,0,0),T.msToBlob){var xe=T.msToBlob();S({blob:xe})}else{var Se=T.toDataURL("image/png");S({imgURI:Se})}},de.src=ue})})}},{key:"exportToSVG",value:function(){var h=this;this.svgUrl().then(function(p){h.triggerDownload(p,h.w.config.chart.toolbar.export.svg.filename,".svg")})}},{key:"exportToPng",value:function(){var h=this,p=this.w.config.chart.toolbar.export.scale,S=this.w.config.chart.toolbar.export.width,_=p?{scale:p}:S?{width:S}:void 0;this.dataURI(_).then(function(k){var T=k.imgURI,B=k.blob;B?navigator.msSaveOrOpenBlob(B,h.w.globals.chartID+".png"):h.triggerDownload(T,h.w.config.chart.toolbar.export.png.filename,".png")})}},{key:"exportToCSV",value:function(h){var p=this,S=h.series,_=h.fileName,k=h.columnDelimiter,T=k===void 0?",":k,B=h.lineDelimiter,q=B===void 0?`
`:B,te=this.w;S||(S=te.config.series);var ue,de,xe=[],Se=[],ke="",Re=te.globals.series.map(function(_e,Je){return te.globals.collapsedSeriesIndices.indexOf(Je)===-1?_e:[]}),Ge=function(_e){return typeof te.config.chart.toolbar.export.csv.categoryFormatter=="function"?te.config.chart.toolbar.export.csv.categoryFormatter(_e):te.config.xaxis.type==="datetime"&&String(_e).length>=10?new Date(_e).toDateString():F.isNumber(_e)?_e:_e.split(T).join("")},Fe=function(_e){return typeof te.config.chart.toolbar.export.csv.valueFormatter=="function"?te.config.chart.toolbar.export.csv.valueFormatter(_e):_e},st=Math.max.apply(Math,N(S.map(function(_e){return _e.data?_e.data.length:0}))),se=new Qe(this.ctx),Ce=new pe(this.ctx),Be=function(_e){var Je="";if(te.globals.axisCharts){if(te.config.xaxis.type==="category"||te.config.xaxis.convertedCatToNumeric)if(te.globals.isBarHorizontal){var ct=te.globals.yLabelFormatters[0],gt=new Le(p.ctx).getActiveConfigSeriesIndex();Je=ct(te.globals.labels[_e],{seriesIndex:gt,dataPointIndex:_e,w:te})}else Je=Ce.getLabel(te.globals.labels,te.globals.timescaleLabels,0,_e).text;te.config.xaxis.type==="datetime"&&(te.config.xaxis.categories.length?Je=te.config.xaxis.categories[_e]:te.config.labels.length&&(Je=te.config.labels[_e]))}else Je=te.config.labels[_e];return Je===null?"nullvalue":(Array.isArray(Je)&&(Je=Je.join(" ")),F.isNumber(Je)?Je:Je.split(T).join(""))},De=function(_e,Je){if(xe.length&&Je===0&&Se.push(xe.join(T)),_e.data){_e.data=_e.data.length&&_e.data||N(Array(st)).map(function(){return""});for(var ct=0;ct<_e.data.length;ct++){xe=[];var gt=Be(ct);if(gt!=="nullvalue"){if(gt||(se.isFormatXY()?gt=S[Je].data[ct].x:se.isFormat2DArray()&&(gt=S[Je].data[ct]?S[Je].data[ct][0]:"")),Je===0){xe.push(Ge(gt));for(var Xt=0;Xt<te.globals.series.length;Xt++){var wt,Xe=se.isFormatXY()?(wt=S[Xt].data[ct])===null||wt===void 0?void 0:wt.y:Re[Xt][ct];xe.push(Fe(Xe))}}(te.config.chart.type==="candlestick"||_e.type&&_e.type==="candlestick")&&(xe.pop(),xe.push(te.globals.seriesCandleO[Je][ct]),xe.push(te.globals.seriesCandleH[Je][ct]),xe.push(te.globals.seriesCandleL[Je][ct]),xe.push(te.globals.seriesCandleC[Je][ct])),(te.config.chart.type==="boxPlot"||_e.type&&_e.type==="boxPlot")&&(xe.pop(),xe.push(te.globals.seriesCandleO[Je][ct]),xe.push(te.globals.seriesCandleH[Je][ct]),xe.push(te.globals.seriesCandleM[Je][ct]),xe.push(te.globals.seriesCandleL[Je][ct]),xe.push(te.globals.seriesCandleC[Je][ct])),te.config.chart.type==="rangeBar"&&(xe.pop(),xe.push(te.globals.seriesRangeStart[Je][ct]),xe.push(te.globals.seriesRangeEnd[Je][ct])),xe.length&&Se.push(xe.join(T))}}}};xe.push(te.config.chart.toolbar.export.csv.headerCategory),te.config.chart.type==="boxPlot"?(xe.push("minimum"),xe.push("q1"),xe.push("median"),xe.push("q3"),xe.push("maximum")):te.config.chart.type==="candlestick"?(xe.push("open"),xe.push("high"),xe.push("low"),xe.push("close")):te.config.chart.type==="rangeBar"?(xe.push("minimum"),xe.push("maximum")):S.map(function(_e,Je){var ct=(_e.name?_e.name:"series-".concat(Je))+"";te.globals.axisCharts&&xe.push(ct.split(T).join("")?ct.split(T).join(""):"series-".concat(Je))}),te.globals.axisCharts||(xe.push(te.config.chart.toolbar.export.csv.headerValue),Se.push(xe.join(T))),te.globals.allSeriesHasEqualX||!te.globals.axisCharts||te.config.xaxis.categories.length||te.config.labels.length?S.map(function(_e,Je){te.globals.axisCharts?De(_e,Je):((xe=[]).push(Ge(te.globals.labels[Je])),xe.push(Fe(Re[Je])),Se.push(xe.join(T)))}):(ue=new Set,de={},S.forEach(function(_e,Je){_e==null||_e.data.forEach(function(ct){var gt,Xt;if(se.isFormatXY())gt=ct.x,Xt=ct.y;else{if(!se.isFormat2DArray())return;gt=ct[0],Xt=ct[1]}de[gt]||(de[gt]=Array(S.length).fill("")),de[gt][Je]=Fe(Xt),ue.add(gt)})}),xe.length&&Se.push(xe.join(T)),Array.from(ue).sort().forEach(function(_e){Se.push([Ge(_e),de[_e].join(T)])})),ke+=Se.join(q),this.triggerDownload("data:text/csv; charset=utf-8,"+encodeURIComponent("\uFEFF"+ke),_||te.config.chart.toolbar.export.csv.filename,".csv")}},{key:"triggerDownload",value:function(h,p,S){var _=document.createElement("a");_.href=h,_.download=(p||this.w.globals.chartID)+S,document.body.appendChild(_),_.click(),document.body.removeChild(_)}}]),Ee}(),it=function(){function Ee(h,p){s(this,Ee),this.ctx=h,this.elgrid=p,this.w=h.w;var S=this.w;this.axesUtils=new pe(h),this.xaxisLabels=S.globals.labels.slice(),S.globals.timescaleLabels.length>0&&!S.globals.isBarHorizontal&&(this.xaxisLabels=S.globals.timescaleLabels.slice()),S.config.xaxis.overwriteCategories&&(this.xaxisLabels=S.config.xaxis.overwriteCategories),this.drawnLabels=[],this.drawnLabelsRects=[],S.config.xaxis.position==="top"?this.offY=0:this.offY=S.globals.gridHeight,this.offY=this.offY+S.config.xaxis.axisBorder.offsetY,this.isCategoryBarHorizontal=S.config.chart.type==="bar"&&S.config.plotOptions.bar.horizontal,this.xaxisFontSize=S.config.xaxis.labels.style.fontSize,this.xaxisFontFamily=S.config.xaxis.labels.style.fontFamily,this.xaxisForeColors=S.config.xaxis.labels.style.colors,this.xaxisBorderWidth=S.config.xaxis.axisBorder.width,this.isCategoryBarHorizontal&&(this.xaxisBorderWidth=S.config.yaxis[0].axisBorder.width.toString()),this.xaxisBorderWidth.indexOf("%")>-1?this.xaxisBorderWidth=S.globals.gridWidth*parseInt(this.xaxisBorderWidth,10)/100:this.xaxisBorderWidth=parseInt(this.xaxisBorderWidth,10),this.xaxisBorderHeight=S.config.xaxis.axisBorder.height,this.yaxis=S.config.yaxis[0]}return o(Ee,[{key:"drawXaxis",value:function(){var h=this.w,p=new z(this.ctx),S=p.group({class:"apexcharts-xaxis",transform:"translate(".concat(h.config.xaxis.offsetX,", ").concat(h.config.xaxis.offsetY,")")}),_=p.group({class:"apexcharts-xaxis-texts-g",transform:"translate(".concat(h.globals.translateXAxisX,", ").concat(h.globals.translateXAxisY,")")});S.add(_);for(var k=[],T=0;T<this.xaxisLabels.length;T++)k.push(this.xaxisLabels[T]);if(this.drawXAxisLabelAndGroup(!0,p,_,k,h.globals.isXNumeric,function(ke,Re){return Re}),h.globals.hasXaxisGroups){var B=h.globals.groups;k=[];for(var q=0;q<B.length;q++)k.push(B[q].title);var te={};h.config.xaxis.group.style&&(te.xaxisFontSize=h.config.xaxis.group.style.fontSize,te.xaxisFontFamily=h.config.xaxis.group.style.fontFamily,te.xaxisForeColors=h.config.xaxis.group.style.colors,te.fontWeight=h.config.xaxis.group.style.fontWeight,te.cssClass=h.config.xaxis.group.style.cssClass),this.drawXAxisLabelAndGroup(!1,p,_,k,!1,function(ke,Re){return B[ke].cols*Re},te)}if(h.config.xaxis.title.text!==void 0){var ue=p.group({class:"apexcharts-xaxis-title"}),de=p.drawText({x:h.globals.gridWidth/2+h.config.xaxis.title.offsetX,y:this.offY+parseFloat(this.xaxisFontSize)+(h.config.xaxis.position==="bottom"?h.globals.xAxisLabelsHeight:-h.globals.xAxisLabelsHeight-10)+h.config.xaxis.title.offsetY,text:h.config.xaxis.title.text,textAnchor:"middle",fontSize:h.config.xaxis.title.style.fontSize,fontFamily:h.config.xaxis.title.style.fontFamily,fontWeight:h.config.xaxis.title.style.fontWeight,foreColor:h.config.xaxis.title.style.color,cssClass:"apexcharts-xaxis-title-text "+h.config.xaxis.title.style.cssClass});ue.add(de),S.add(ue)}if(h.config.xaxis.axisBorder.show){var xe=h.globals.barPadForNumericAxis,Se=p.drawLine(h.globals.padHorizontal+h.config.xaxis.axisBorder.offsetX-xe,this.offY,this.xaxisBorderWidth+xe,this.offY,h.config.xaxis.axisBorder.color,0,this.xaxisBorderHeight);this.elgrid&&this.elgrid.elGridBorders&&h.config.grid.show?this.elgrid.elGridBorders.add(Se):S.add(Se)}return S}},{key:"drawXAxisLabelAndGroup",value:function(h,p,S,_,k,T){var B,q=this,te=arguments.length>6&&arguments[6]!==void 0?arguments[6]:{},ue=[],de=[],xe=this.w,Se=te.xaxisFontSize||this.xaxisFontSize,ke=te.xaxisFontFamily||this.xaxisFontFamily,Re=te.xaxisForeColors||this.xaxisForeColors,Ge=te.fontWeight||xe.config.xaxis.labels.style.fontWeight,Fe=te.cssClass||xe.config.xaxis.labels.style.cssClass,st=xe.globals.padHorizontal,se=_.length,Ce=xe.config.xaxis.type==="category"?xe.globals.dataPoints:se;if(Ce===0&&se>Ce&&(Ce=se),k){var Be=Ce>1?Ce-1:Ce;B=xe.globals.gridWidth/Math.min(Be,se-1),st=st+T(0,B)/2+xe.config.xaxis.labels.offsetX}else B=xe.globals.gridWidth/Ce,st=st+T(0,B)+xe.config.xaxis.labels.offsetX;for(var De=function(Je){var ct=st-T(Je,B)/2+xe.config.xaxis.labels.offsetX;Je===0&&se===1&&B/2===st&&Ce===1&&(ct=xe.globals.gridWidth/2);var gt=q.axesUtils.getLabel(_,xe.globals.timescaleLabels,ct,Je,ue,Se,h),Xt=28;if(xe.globals.rotateXLabels&&h&&(Xt=22),xe.config.xaxis.title.text&&xe.config.xaxis.position==="top"&&(Xt+=parseFloat(xe.config.xaxis.title.style.fontSize)+2),h||(Xt=Xt+parseFloat(Se)+(xe.globals.xAxisLabelsHeight-xe.globals.xAxisGroupLabelsHeight)+(xe.globals.rotateXLabels?10:0)),gt=xe.config.xaxis.tickAmount!==void 0&&xe.config.xaxis.tickAmount!=="dataPoints"&&xe.config.xaxis.type!=="datetime"?q.axesUtils.checkLabelBasedOnTickamount(Je,gt,se):q.axesUtils.checkForOverflowingLabels(Je,gt,se,ue,de),xe.config.xaxis.labels.show){var wt=p.drawText({x:gt.x,y:q.offY+xe.config.xaxis.labels.offsetY+Xt-(xe.config.xaxis.position==="top"?xe.globals.xAxisHeight+xe.config.xaxis.axisTicks.height-2:0),text:gt.text,textAnchor:"middle",fontWeight:gt.isBold?600:Ge,fontSize:Se,fontFamily:ke,foreColor:Array.isArray(Re)?h&&xe.config.xaxis.convertedCatToNumeric?Re[xe.globals.minX+Je-1]:Re[Je]:Re,isPlainText:!1,cssClass:(h?"apexcharts-xaxis-label ":"apexcharts-xaxis-group-label ")+Fe});if(S.add(wt),wt.on("click",function(Oe){if(typeof xe.config.chart.events.xAxisLabelClick=="function"){var bt=Object.assign({},xe,{labelIndex:Je});xe.config.chart.events.xAxisLabelClick(Oe,q.ctx,bt)}}),h){var Xe=document.createElementNS(xe.globals.SVGNS,"title");Xe.textContent=Array.isArray(gt.text)?gt.text.join(" "):gt.text,wt.node.appendChild(Xe),gt.text!==""&&(ue.push(gt.text),de.push(gt))}}Je<se-1&&(st+=T(Je+1,B))},_e=0;_e<=se-1;_e++)De(_e)}},{key:"drawXaxisInversed",value:function(h){var p,S,_=this,k=this.w,T=new z(this.ctx),B=k.config.yaxis[0].opposite?k.globals.translateYAxisX[h]:0,q=T.group({class:"apexcharts-yaxis apexcharts-xaxis-inversed",rel:h}),te=T.group({class:"apexcharts-yaxis-texts-g apexcharts-xaxis-inversed-texts-g",transform:"translate("+B+", 0)"});q.add(te);var ue=[];if(k.config.yaxis[h].show)for(var de=0;de<this.xaxisLabels.length;de++)ue.push(this.xaxisLabels[de]);p=k.globals.gridHeight/ue.length,S=-p/2.2;var xe=k.globals.yLabelFormatters[0],Se=k.config.yaxis[0].labels;if(Se.show)for(var ke=function(Be){var De=ue[Be]===void 0?"":ue[Be];De=xe(De,{seriesIndex:h,dataPointIndex:Be,w:k});var _e=_.axesUtils.getYAxisForeColor(Se.style.colors,h),Je=0;Array.isArray(De)&&(Je=De.length/2*parseInt(Se.style.fontSize,10));var ct=Se.offsetX-15,gt="end";_.yaxis.opposite&&(gt="start"),k.config.yaxis[0].labels.align==="left"?(ct=Se.offsetX,gt="start"):k.config.yaxis[0].labels.align==="center"?(ct=Se.offsetX,gt="middle"):k.config.yaxis[0].labels.align==="right"&&(gt="end");var Xt=T.drawText({x:ct,y:S+p+Se.offsetY-Je,text:De,textAnchor:gt,foreColor:Array.isArray(_e)?_e[Be]:_e,fontSize:Se.style.fontSize,fontFamily:Se.style.fontFamily,fontWeight:Se.style.fontWeight,isPlainText:!1,cssClass:"apexcharts-yaxis-label "+Se.style.cssClass,maxWidth:Se.maxWidth});te.add(Xt),Xt.on("click",function(Oe){if(typeof k.config.chart.events.xAxisLabelClick=="function"){var bt=Object.assign({},k,{labelIndex:Be});k.config.chart.events.xAxisLabelClick(Oe,_.ctx,bt)}});var wt=document.createElementNS(k.globals.SVGNS,"title");if(wt.textContent=Array.isArray(De)?De.join(" "):De,Xt.node.appendChild(wt),k.config.yaxis[h].labels.rotate!==0){var Xe=T.rotateAroundCenter(Xt.node);Xt.node.setAttribute("transform","rotate(".concat(k.config.yaxis[h].labels.rotate," 0 ").concat(Xe.y,")"))}S+=p},Re=0;Re<=ue.length-1;Re++)ke(Re);if(k.config.yaxis[0].title.text!==void 0){var Ge=T.group({class:"apexcharts-yaxis-title apexcharts-xaxis-title-inversed",transform:"translate("+B+", 0)"}),Fe=T.drawText({x:k.config.yaxis[0].title.offsetX,y:k.globals.gridHeight/2+k.config.yaxis[0].title.offsetY,text:k.config.yaxis[0].title.text,textAnchor:"middle",foreColor:k.config.yaxis[0].title.style.color,fontSize:k.config.yaxis[0].title.style.fontSize,fontWeight:k.config.yaxis[0].title.style.fontWeight,fontFamily:k.config.yaxis[0].title.style.fontFamily,cssClass:"apexcharts-yaxis-title-text "+k.config.yaxis[0].title.style.cssClass});Ge.add(Fe),q.add(Ge)}var st=0;this.isCategoryBarHorizontal&&k.config.yaxis[0].opposite&&(st=k.globals.gridWidth);var se=k.config.xaxis.axisBorder;if(se.show){var Ce=T.drawLine(k.globals.padHorizontal+se.offsetX+st,1+se.offsetY,k.globals.padHorizontal+se.offsetX+st,k.globals.gridHeight+se.offsetY,se.color,0);this.elgrid&&this.elgrid.elGridBorders&&k.config.grid.show?this.elgrid.elGridBorders.add(Ce):q.add(Ce)}return k.config.yaxis[0].axisTicks.show&&this.axesUtils.drawYAxisTicks(st,ue.length,k.config.yaxis[0].axisBorder,k.config.yaxis[0].axisTicks,0,p,q),q}},{key:"drawXaxisTicks",value:function(h,p,S){var _=this.w,k=h;if(!(h<0||h-2>_.globals.gridWidth)){var T=this.offY+_.config.xaxis.axisTicks.offsetY;if(p=p+T+_.config.xaxis.axisTicks.height,_.config.xaxis.position==="top"&&(p=T-_.config.xaxis.axisTicks.height),_.config.xaxis.axisTicks.show){var B=new z(this.ctx).drawLine(h+_.config.xaxis.axisTicks.offsetX,T+_.config.xaxis.offsetY,k+_.config.xaxis.axisTicks.offsetX,p+_.config.xaxis.offsetY,_.config.xaxis.axisTicks.color);S.add(B),B.node.classList.add("apexcharts-xaxis-tick")}}}},{key:"getXAxisTicksPositions",value:function(){var h=this.w,p=[],S=this.xaxisLabels.length,_=h.globals.padHorizontal;if(h.globals.timescaleLabels.length>0)for(var k=0;k<S;k++)_=this.xaxisLabels[k].position,p.push(_);else for(var T=S,B=0;B<T;B++){var q=T;h.globals.isXNumeric&&h.config.chart.type!=="bar"&&(q-=1),_+=h.globals.gridWidth/q,p.push(_)}return p}},{key:"xAxisLabelCorrections",value:function(){var h=this.w,p=new z(this.ctx),S=h.globals.dom.baseEl.querySelector(".apexcharts-xaxis-texts-g"),_=h.globals.dom.baseEl.querySelectorAll(".apexcharts-xaxis-texts-g text:not(.apexcharts-xaxis-group-label)"),k=h.globals.dom.baseEl.querySelectorAll(".apexcharts-yaxis-inversed text"),T=h.globals.dom.baseEl.querySelectorAll(".apexcharts-xaxis-inversed-texts-g text tspan");if(h.globals.rotateXLabels||h.config.xaxis.labels.rotateAlways)for(var B=0;B<_.length;B++){var q=p.rotateAroundCenter(_[B]);q.y=q.y-1,q.x=q.x+1,_[B].setAttribute("transform","rotate(".concat(h.config.xaxis.labels.rotate," ").concat(q.x," ").concat(q.y,")")),_[B].setAttribute("text-anchor","end"),S.setAttribute("transform","translate(0, ".concat(-10,")"));var te=_[B].childNodes;h.config.xaxis.labels.trim&&Array.prototype.forEach.call(te,function(Se){p.placeTextWithEllipsis(Se,Se.textContent,h.globals.xAxisLabelsHeight-(h.config.legend.position==="bottom"?20:10))})}else(function(){for(var Se=h.globals.gridWidth/(h.globals.labels.length+1),ke=0;ke<_.length;ke++){var Re=_[ke].childNodes;h.config.xaxis.labels.trim&&h.config.xaxis.type!=="datetime"&&Array.prototype.forEach.call(Re,function(Ge){p.placeTextWithEllipsis(Ge,Ge.textContent,Se)})}})();if(k.length>0){var ue=k[k.length-1].getBBox(),de=k[0].getBBox();ue.x<-20&&k[k.length-1].parentNode.removeChild(k[k.length-1]),de.x+de.width>h.globals.gridWidth&&!h.globals.isBarHorizontal&&k[0].parentNode.removeChild(k[0]);for(var xe=0;xe<T.length;xe++)p.placeTextWithEllipsis(T[xe],T[xe].textContent,h.config.yaxis[0].labels.maxWidth-(h.config.yaxis[0].title.text?2*parseFloat(h.config.yaxis[0].title.style.fontSize):0)-15)}}}]),Ee}(),tt=function(){function Ee(h){s(this,Ee),this.ctx=h,this.w=h.w;var p=this.w;this.xaxisLabels=p.globals.labels.slice(),this.axesUtils=new pe(h),this.isRangeBar=p.globals.seriesRange.length&&p.globals.isBarHorizontal,p.globals.timescaleLabels.length>0&&(this.xaxisLabels=p.globals.timescaleLabels.slice())}return o(Ee,[{key:"drawGridArea",value:function(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,p=this.w,S=new z(this.ctx);h||(h=S.group({class:"apexcharts-grid"}));var _=S.drawLine(p.globals.padHorizontal,1,p.globals.padHorizontal,p.globals.gridHeight,"transparent"),k=S.drawLine(p.globals.padHorizontal,p.globals.gridHeight,p.globals.gridWidth,p.globals.gridHeight,"transparent");return h.add(k),h.add(_),h}},{key:"drawGrid",value:function(){if(this.w.globals.axisCharts){var h=this.renderGrid();return this.drawGridArea(h.el),h}return null}},{key:"createGridMask",value:function(){var h=this.w,p=h.globals,S=new z(this.ctx),_=Array.isArray(h.config.stroke.width)?Math.max.apply(Math,N(h.config.stroke.width)):h.config.stroke.width,k=function(ue){var de=document.createElementNS(p.SVGNS,"clipPath");return de.setAttribute("id",ue),de};p.dom.elGridRectMask=k("gridRectMask".concat(p.cuid)),p.dom.elGridRectBarMask=k("gridRectBarMask".concat(p.cuid)),p.dom.elGridRectMarkerMask=k("gridRectMarkerMask".concat(p.cuid)),p.dom.elForecastMask=k("forecastMask".concat(p.cuid)),p.dom.elNonForecastMask=k("nonForecastMask".concat(p.cuid));var T=0,B=0;(["bar","rangeBar","candlestick","boxPlot"].includes(h.config.chart.type)||h.globals.comboBarCount>0)&&h.globals.isXNumeric&&!h.globals.isBarHorizontal&&(T=Math.max(h.config.grid.padding.left,p.barPadForNumericAxis),B=Math.max(h.config.grid.padding.right,p.barPadForNumericAxis)),p.dom.elGridRect=S.drawRect(0,0,p.gridWidth,p.gridHeight,0,"#fff"),p.dom.elGridRectBar=S.drawRect(-_/2-T-2,-_/2-2,p.gridWidth+_+B+T+4,p.gridHeight+_+4,0,"#fff");var q=h.globals.markers.largestSize;p.dom.elGridRectMarker=S.drawRect(-q,-q,p.gridWidth+2*q,p.gridHeight+2*q,0,"#fff"),p.dom.elGridRectMask.appendChild(p.dom.elGridRect.node),p.dom.elGridRectBarMask.appendChild(p.dom.elGridRectBar.node),p.dom.elGridRectMarkerMask.appendChild(p.dom.elGridRectMarker.node);var te=p.dom.baseEl.querySelector("defs");te.appendChild(p.dom.elGridRectMask),te.appendChild(p.dom.elGridRectBarMask),te.appendChild(p.dom.elGridRectMarkerMask),te.appendChild(p.dom.elForecastMask),te.appendChild(p.dom.elNonForecastMask)}},{key:"_drawGridLines",value:function(h){var p=h.i,S=h.x1,_=h.y1,k=h.x2,T=h.y2,B=h.xCount,q=h.parent,te=this.w;if(!(p===0&&te.globals.skipFirstTimelinelabel||p===B-1&&te.globals.skipLastTimelinelabel&&!te.config.xaxis.labels.formatter||te.config.chart.type==="radar")){te.config.grid.xaxis.lines.show&&this._drawGridLine({i:p,x1:S,y1:_,x2:k,y2:T,xCount:B,parent:q});var ue=0;if(te.globals.hasXaxisGroups&&te.config.xaxis.tickPlacement==="between"){var de=te.globals.groups;if(de){for(var xe=0,Se=0;xe<p&&Se<de.length;Se++)xe+=de[Se].cols;xe===p&&(ue=.6*te.globals.xAxisLabelsHeight)}}new it(this.ctx).drawXaxisTicks(S,ue,te.globals.dom.elGraphical)}}},{key:"_drawGridLine",value:function(h){var p=h.i,S=h.x1,_=h.y1,k=h.x2,T=h.y2,B=h.xCount,q=h.parent,te=this.w,ue=q.node.classList.contains("apexcharts-gridlines-horizontal"),de=te.globals.barPadForNumericAxis,xe=_===0&&T===0||S===0&&k===0||_===te.globals.gridHeight&&T===te.globals.gridHeight||te.globals.isBarHorizontal&&(p===0||p===B-1),Se=new z(this).drawLine(S-(ue?de:0),_,k+(ue?de:0),T,te.config.grid.borderColor,te.config.grid.strokeDashArray);Se.node.classList.add("apexcharts-gridline"),xe&&te.config.grid.show?this.elGridBorders.add(Se):q.add(Se)}},{key:"_drawGridBandRect",value:function(h){var p=h.c,S=h.x1,_=h.y1,k=h.x2,T=h.y2,B=h.type,q=this.w,te=new z(this.ctx),ue=q.globals.barPadForNumericAxis,de=q.config.grid[B].colors[p],xe=te.drawRect(S-(B==="row"?ue:0),_,k+(B==="row"?2*ue:0),T,0,de,q.config.grid[B].opacity);this.elg.add(xe),xe.attr("clip-path","url(#gridRectMask".concat(q.globals.cuid,")")),xe.node.classList.add("apexcharts-grid-".concat(B))}},{key:"_drawXYLines",value:function(h){var p=this,S=h.xCount,_=h.tickAmount,k=this.w;if(k.config.grid.xaxis.lines.show||k.config.xaxis.axisTicks.show){var T,B=k.globals.padHorizontal,q=k.globals.gridHeight;k.globals.timescaleLabels.length?function(ke){for(var Re=ke.xC,Ge=ke.x1,Fe=ke.y1,st=ke.x2,se=ke.y2,Ce=0;Ce<Re;Ce++)Ge=p.xaxisLabels[Ce].position,st=p.xaxisLabels[Ce].position,p._drawGridLines({i:Ce,x1:Ge,y1:Fe,x2:st,y2:se,xCount:S,parent:p.elgridLinesV})}({xC:S,x1:B,y1:0,x2:T,y2:q}):(k.globals.isXNumeric&&(S=k.globals.xAxisScale.result.length),function(ke){for(var Re=ke.xC,Ge=ke.x1,Fe=ke.y1,st=ke.x2,se=ke.y2,Ce=0;Ce<Re+(k.globals.isXNumeric?0:1);Ce++)Ce===0&&Re===1&&k.globals.dataPoints===1&&(st=Ge=k.globals.gridWidth/2),p._drawGridLines({i:Ce,x1:Ge,y1:Fe,x2:st,y2:se,xCount:S,parent:p.elgridLinesV}),st=Ge+=k.globals.gridWidth/(k.globals.isXNumeric?Re-1:Re)}({xC:S,x1:B,y1:0,x2:T,y2:q}))}if(k.config.grid.yaxis.lines.show){var te=0,ue=0,de=k.globals.gridWidth,xe=_+1;this.isRangeBar&&(xe=k.globals.labels.length);for(var Se=0;Se<xe+(this.isRangeBar?1:0);Se++)this._drawGridLine({i:Se,xCount:xe+(this.isRangeBar?1:0),x1:0,y1:te,x2:de,y2:ue,parent:this.elgridLinesH}),ue=te+=k.globals.gridHeight/(this.isRangeBar?xe:_)}}},{key:"_drawInvertedXYLines",value:function(h){var p=h.xCount,S=this.w;if(S.config.grid.xaxis.lines.show||S.config.xaxis.axisTicks.show)for(var _,k=S.globals.padHorizontal,T=S.globals.gridHeight,B=0;B<p+1;B++)S.config.grid.xaxis.lines.show&&this._drawGridLine({i:B,xCount:p+1,x1:k,y1:0,x2:_,y2:T,parent:this.elgridLinesV}),new it(this.ctx).drawXaxisTicks(k,0,S.globals.dom.elGraphical),_=k+=S.globals.gridWidth/p;if(S.config.grid.yaxis.lines.show)for(var q=0,te=0,ue=S.globals.gridWidth,de=0;de<S.globals.dataPoints+1;de++)this._drawGridLine({i:de,xCount:S.globals.dataPoints+1,x1:0,y1:q,x2:ue,y2:te,parent:this.elgridLinesH}),te=q+=S.globals.gridHeight/S.globals.dataPoints}},{key:"renderGrid",value:function(){var h=this.w,p=h.globals,S=new z(this.ctx);this.elg=S.group({class:"apexcharts-grid"}),this.elgridLinesH=S.group({class:"apexcharts-gridlines-horizontal"}),this.elgridLinesV=S.group({class:"apexcharts-gridlines-vertical"}),this.elGridBorders=S.group({class:"apexcharts-grid-borders"}),this.elg.add(this.elgridLinesH),this.elg.add(this.elgridLinesV),h.config.grid.show||(this.elgridLinesV.hide(),this.elgridLinesH.hide(),this.elGridBorders.hide());for(var _=0;_<p.seriesYAxisMap.length&&p.ignoreYAxisIndexes.includes(_);)_++;_===p.seriesYAxisMap.length&&(_=0);var k,T=p.yAxisScale[_].result.length-1;if(!p.isBarHorizontal||this.isRangeBar){var B,q,te;k=this.xaxisLabels.length,this.isRangeBar&&(T=p.labels.length,h.config.xaxis.tickAmount&&h.config.xaxis.labels.formatter&&(k=h.config.xaxis.tickAmount),((B=p.yAxisScale)===null||B===void 0||(q=B[_])===null||q===void 0||(te=q.result)===null||te===void 0?void 0:te.length)>0&&h.config.xaxis.type!=="datetime"&&(k=p.yAxisScale[_].result.length-1)),this._drawXYLines({xCount:k,tickAmount:T})}else k=T,T=p.xTickAmount,this._drawInvertedXYLines({xCount:k,tickAmount:T});return this.drawGridBands(k,T),{el:this.elg,elGridBorders:this.elGridBorders,xAxisTickWidth:p.gridWidth/k}}},{key:"drawGridBands",value:function(h,p){var S,_,k=this,T=this.w;if(((S=T.config.grid.row.colors)===null||S===void 0?void 0:S.length)>0&&function(ke,Re,Ge,Fe,st,se){for(var Ce=0,Be=0;Ce<Re;Ce++,Be++)Be>=T.config.grid[ke].colors.length&&(Be=0),k._drawGridBandRect({c:Be,x1:Ge,y1:Fe,x2:st,y2:se,type:ke}),Fe+=T.globals.gridHeight/p}("row",p,0,0,T.globals.gridWidth,T.globals.gridHeight/p),((_=T.config.grid.column.colors)===null||_===void 0?void 0:_.length)>0){var B=T.globals.isBarHorizontal||T.config.xaxis.tickPlacement!=="on"||T.config.xaxis.type!=="category"&&!T.config.xaxis.convertedCatToNumeric?h:h-1;T.globals.isXNumeric&&(B=T.globals.xAxisScale.result.length-1);for(var q=T.globals.padHorizontal,te=T.globals.padHorizontal+T.globals.gridWidth/B,ue=T.globals.gridHeight,de=0,xe=0;de<h;de++,xe++){var Se;xe>=T.config.grid.column.colors.length&&(xe=0),T.config.xaxis.type==="datetime"&&(q=this.xaxisLabels[de].position,te=(((Se=this.xaxisLabels[de+1])===null||Se===void 0?void 0:Se.position)||T.globals.gridWidth)-this.xaxisLabels[de].position),this._drawGridBandRect({c:xe,x1:q,y1:0,x2:te,y2:ue,type:"column"}),q+=T.globals.gridWidth/B}}}}]),Ee}(),lt=function(){function Ee(h){s(this,Ee),this.ctx=h,this.w=h.w,this.coreUtils=new Q(this.ctx)}return o(Ee,[{key:"niceScale",value:function(h,p){var S,_,k,T,B=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,q=1e-11,te=this.w,ue=te.globals;ue.isBarHorizontal?(S=te.config.xaxis,_=Math.max((ue.svgWidth-100)/25,2)):(S=te.config.yaxis[B],_=Math.max((ue.svgHeight-100)/15,2)),F.isNumber(_)||(_=10),k=S.min!==void 0&&S.min!==null,T=S.max!==void 0&&S.min!==null;var de=S.stepSize!==void 0&&S.stepSize!==null,xe=S.tickAmount!==void 0&&S.tickAmount!==null,Se=xe?S.tickAmount:ue.niceScaleDefaultTicks[Math.min(Math.round(_/2),ue.niceScaleDefaultTicks.length-1)];if(ue.isMultipleYAxis&&!xe&&ue.multiAxisTickAmount>0&&(Se=ue.multiAxisTickAmount,xe=!0),Se=Se==="dataPoints"?ue.dataPoints-1:Math.abs(Math.round(Se)),(h===Number.MIN_VALUE&&p===0||!F.isNumber(h)&&!F.isNumber(p)||h===Number.MIN_VALUE&&p===-Number.MAX_VALUE)&&(h=F.isNumber(S.min)?S.min:0,p=F.isNumber(S.max)?S.max:h+Se,ue.allSeriesCollapsed=!1),h>p){console.warn("axis.min cannot be greater than axis.max: swapping min and max");var ke=p;p=h,h=ke}else h===p&&(h=h===0?0:h-1,p=p===0?2:p+1);var Re=[];Se<1&&(Se=1);var Ge=Se,Fe=Math.abs(p-h);!k&&h>0&&h/Fe<.15&&(h=0,k=!0),!T&&p<0&&-p/Fe<.15&&(p=0,T=!0);var st=(Fe=Math.abs(p-h))/Ge,se=st,Ce=Math.floor(Math.log10(se)),Be=Math.pow(10,Ce),De=Math.ceil(se/Be);if(st=se=(De=ue.niceScaleAllowedMagMsd[ue.yValueDecimal===0?0:1][De])*Be,ue.isBarHorizontal&&S.stepSize&&S.type!=="datetime"?(st=S.stepSize,de=!0):de&&(st=S.stepSize),de&&S.forceNiceScale){var _e=Math.floor(Math.log10(st));st*=Math.pow(10,Ce-_e)}if(k&&T){var Je=Fe/Ge;if(xe)if(de)if(F.mod(Fe,st)!=0){var ct=F.getGCD(st,Je);st=Je/ct<10?ct:Je}else F.mod(st,Je)==0?st=Je:(Je=st,xe=!1);else st=Je;else if(de)F.mod(Fe,st)==0?Je=st:st=Je;else if(F.mod(Fe,st)==0)Je=st;else{Je=Fe/(Ge=Math.ceil(Fe/st));var gt=F.getGCD(Fe,st);Fe/gt<_&&(Je=gt),st=Je}Ge=Math.round(Fe/st)}else{if(k||T){if(T)if(xe)h=p-st*Ge;else{var Xt=h;h=st*Math.floor(h/st),Math.abs(p-h)/F.getGCD(Fe,st)>_&&(h=p-st*Se,h+=st*Math.floor((Xt-h)/st))}else if(k)if(xe)p=h+st*Ge;else{var wt=p;p=st*Math.ceil(p/st),Math.abs(p-h)/F.getGCD(Fe,st)>_&&(p=h+st*Se,p+=st*Math.ceil((wt-p)/st))}}else if(ue.isMultipleYAxis&&xe){var Xe=st*Math.floor(h/st),Oe=Xe+st*Ge;Oe<p&&(st*=2),Oe=p,p=(h=Xe)+st*Ge,Fe=Math.abs(p-h),h>0&&h<Math.abs(Oe-p)&&(h=0,p=st*Ge),p<0&&-p<Math.abs(Xe-h)&&(p=0,h=-st*Ge)}else h=st*Math.floor(h/st),p=st*Math.ceil(p/st);Fe=Math.abs(p-h),st=F.getGCD(Fe,st),Ge=Math.round(Fe/st)}if(xe||k||T||(Ge=Math.ceil((Fe-q)/(st+q)))>16&&F.getPrimeFactors(Ge).length<2&&Ge++,!xe&&S.forceNiceScale&&ue.yValueDecimal===0&&Ge>Fe&&(Ge=Fe,st=Math.round(Fe/Ge)),Ge>_&&(!xe&&!de||S.forceNiceScale)){var bt=F.getPrimeFactors(Ge),kt=bt.length-1,Ut=Ge;e:for(var fn=0;fn<kt;fn++)for(var On=0;On<=kt-fn;On++){for(var Sn=Math.min(On+fn,kt),yr=Ut,Pn=1,En=On;En<=Sn;En++)Pn*=bt[En];if((yr/=Pn)<_){Ut=yr;break e}}st=Ut===Ge?Fe:Fe/Ut,Ge=Math.round(Fe/st)}ue.isMultipleYAxis&&ue.multiAxisTickAmount==0&&ue.ignoreYAxisIndexes.indexOf(B)<0&&(ue.multiAxisTickAmount=Ge);var $n=h-st,Bn=st*q;do $n+=st,Re.push(F.stripNumber($n,7));while(p-$n>Bn);return{result:Re,niceMin:Re[0],niceMax:Re[Re.length-1]}}},{key:"linearScale",value:function(h,p){var S=arguments.length>2&&arguments[2]!==void 0?arguments[2]:10,_=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,k=arguments.length>4&&arguments[4]!==void 0?arguments[4]:void 0,T=Math.abs(p-h),B=[];if(h===p)return{result:B=[h],niceMin:B[0],niceMax:B[B.length-1]};(S=this._adjustTicksForSmallRange(S,_,T))==="dataPoints"&&(S=this.w.globals.dataPoints-1),k||(k=T/S),k=Math.round(10*(k+Number.EPSILON))/10,S===Number.MAX_VALUE&&(S=5,k=1);for(var q=h;S>=0;)B.push(q),q=F.preciseAddition(q,k),S-=1;return{result:B,niceMin:B[0],niceMax:B[B.length-1]}}},{key:"logarithmicScaleNice",value:function(h,p,S){p<=0&&(p=Math.max(h,S)),h<=0&&(h=Math.min(p,S));for(var _=[],k=Math.ceil(Math.log(p)/Math.log(S)+1),T=Math.floor(Math.log(h)/Math.log(S));T<k;T++)_.push(Math.pow(S,T));return{result:_,niceMin:_[0],niceMax:_[_.length-1]}}},{key:"logarithmicScale",value:function(h,p,S){p<=0&&(p=Math.max(h,S)),h<=0&&(h=Math.min(p,S));for(var _=[],k=Math.log(p)/Math.log(S),T=Math.log(h)/Math.log(S),B=k-T,q=Math.round(B),te=B/q,ue=0,de=T;ue<q;ue++,de+=te)_.push(Math.pow(S,de));return _.push(Math.pow(S,k)),{result:_,niceMin:h,niceMax:p}}},{key:"_adjustTicksForSmallRange",value:function(h,p,S){var _=h;if(p!==void 0&&this.w.config.yaxis[p].labels.formatter&&this.w.config.yaxis[p].tickAmount===void 0){var k=Number(this.w.config.yaxis[p].labels.formatter(1));F.isNumber(k)&&this.w.globals.yValueDecimal===0&&(_=Math.ceil(S))}return _<h?_:h}},{key:"setYScaleForIndex",value:function(h,p,S){var _=this.w.globals,k=this.w.config,T=_.isBarHorizontal?k.xaxis:k.yaxis[h];_.yAxisScale[h]===void 0&&(_.yAxisScale[h]=[]);var B=Math.abs(S-p);T.logarithmic&&B<=5&&(_.invalidLogScale=!0),T.logarithmic&&B>5?(_.allSeriesCollapsed=!1,_.yAxisScale[h]=T.forceNiceScale?this.logarithmicScaleNice(p,S,T.logBase):this.logarithmicScale(p,S,T.logBase)):S!==-Number.MAX_VALUE&&F.isNumber(S)&&p!==Number.MAX_VALUE&&F.isNumber(p)?(_.allSeriesCollapsed=!1,_.yAxisScale[h]=this.niceScale(p,S,h)):_.yAxisScale[h]=this.niceScale(Number.MIN_VALUE,0,h)}},{key:"setXScale",value:function(h,p){var S=this.w,_=S.globals,k=Math.abs(p-h);if(p!==-Number.MAX_VALUE&&F.isNumber(p)){var T=_.xTickAmount+1;k<10&&k>1&&(T=k),_.xAxisScale=this.linearScale(h,p,T,0,S.config.xaxis.stepSize)}else _.xAxisScale=this.linearScale(0,10,10);return _.xAxisScale}},{key:"scaleMultipleYAxes",value:function(){var h=this,p=this.w.config,S=this.w.globals;this.coreUtils.setSeriesYAxisMappings();var _=S.seriesYAxisMap,k=S.minYArr,T=S.maxYArr;S.allSeriesCollapsed=!0,S.barGroups=[],_.forEach(function(B,q){var te=[];B.forEach(function(ue){var de=p.series[ue].group;te.indexOf(de)<0&&te.push(de)}),B.length>0?function(){var ue,de,xe=Number.MAX_VALUE,Se=-Number.MAX_VALUE,ke=xe,Re=Se;if(p.chart.stacked)(function(){var st=new Array(S.dataPoints).fill(0),se=[],Ce=[],Be=[];te.forEach(function(){se.push(st.map(function(){return Number.MIN_VALUE})),Ce.push(st.map(function(){return Number.MIN_VALUE})),Be.push(st.map(function(){return Number.MIN_VALUE}))});for(var De=function(Je){!ue&&p.series[B[Je]].type&&(ue=p.series[B[Je]].type);var ct=B[Je];de=p.series[ct].group?p.series[ct].group:"axis-".concat(q),!(S.collapsedSeriesIndices.indexOf(ct)<0&&S.ancillaryCollapsedSeriesIndices.indexOf(ct)<0)||(S.allSeriesCollapsed=!1,te.forEach(function(gt,Xt){if(p.series[ct].group===gt)for(var wt=0;wt<S.series[ct].length;wt++){var Xe=S.series[ct][wt];Xe>=0?Ce[Xt][wt]+=Xe:Be[Xt][wt]+=Xe,se[Xt][wt]+=Xe,ke=Math.min(ke,Xe),Re=Math.max(Re,Xe)}})),ue!=="bar"&&ue!=="column"||S.barGroups.push(de)},_e=0;_e<B.length;_e++)De(_e);ue||(ue=p.chart.type),ue==="bar"||ue==="column"?te.forEach(function(Je,ct){xe=Math.min(xe,Math.min.apply(null,Be[ct])),Se=Math.max(Se,Math.max.apply(null,Ce[ct]))}):(te.forEach(function(Je,ct){ke=Math.min(ke,Math.min.apply(null,se[ct])),Re=Math.max(Re,Math.max.apply(null,se[ct]))}),xe=ke,Se=Re),xe===Number.MIN_VALUE&&Se===Number.MIN_VALUE&&(Se=-Number.MAX_VALUE)})();else for(var Ge=0;Ge<B.length;Ge++){var Fe=B[Ge];xe=Math.min(xe,k[Fe]),Se=Math.max(Se,T[Fe]),!(S.collapsedSeriesIndices.indexOf(Fe)<0&&S.ancillaryCollapsedSeriesIndices.indexOf(Fe)<0)||(S.allSeriesCollapsed=!1)}p.yaxis[q].min!==void 0&&(xe=typeof p.yaxis[q].min=="function"?p.yaxis[q].min(xe):p.yaxis[q].min),p.yaxis[q].max!==void 0&&(Se=typeof p.yaxis[q].max=="function"?p.yaxis[q].max(Se):p.yaxis[q].max),S.barGroups=S.barGroups.filter(function(st,se,Ce){return Ce.indexOf(st)===se}),h.setYScaleForIndex(q,xe,Se),B.forEach(function(st){k[st]=S.yAxisScale[q].niceMin,T[st]=S.yAxisScale[q].niceMax})}():h.setYScaleForIndex(q,0,-Number.MAX_VALUE)})}}]),Ee}(),ft=function(){function Ee(h){s(this,Ee),this.ctx=h,this.w=h.w,this.scales=new lt(h)}return o(Ee,[{key:"init",value:function(){this.setYRange(),this.setXRange(),this.setZRange()}},{key:"getMinYMaxY",value:function(h){var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.MAX_VALUE,S=arguments.length>2&&arguments[2]!==void 0?arguments[2]:-Number.MAX_VALUE,_=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null,k=this.w.config,T=this.w.globals,B=-Number.MAX_VALUE,q=Number.MIN_VALUE;_===null&&(_=h+1);var te=T.series,ue=te,de=te;k.chart.type==="candlestick"?(ue=T.seriesCandleL,de=T.seriesCandleH):k.chart.type==="boxPlot"?(ue=T.seriesCandleO,de=T.seriesCandleC):T.isRangeData&&(ue=T.seriesRangeStart,de=T.seriesRangeEnd);var xe=!1;if(T.seriesX.length>=_){var Se,ke=(Se=T.brushSource)===null||Se===void 0?void 0:Se.w.config.chart.brush;(k.chart.zoom.enabled&&k.chart.zoom.autoScaleYaxis||ke!=null&&ke.enabled&&ke!=null&&ke.autoScaleYaxis)&&(xe=!0)}for(var Re=h;Re<_;Re++){T.dataPoints=Math.max(T.dataPoints,te[Re].length);var Ge=k.series[Re].type;T.categoryLabels.length&&(T.dataPoints=T.categoryLabels.filter(function(Be){return Be!==void 0}).length),T.labels.length&&k.xaxis.type!=="datetime"&&T.series.reduce(function(Be,De){return Be+De.length},0)!==0&&(T.dataPoints=Math.max(T.dataPoints,T.labels.length));var Fe=0,st=te[Re].length-1;if(xe){if(k.xaxis.min)for(;Fe<st&&T.seriesX[Re][Fe]<k.xaxis.min;Fe++);if(k.xaxis.max)for(;st>Fe&&T.seriesX[Re][st]>k.xaxis.max;st--);}for(var se=Fe;se<=st&&se<T.series[Re].length;se++){var Ce=te[Re][se];if(Ce!==null&&F.isNumber(Ce)){switch(de[Re][se]!==void 0&&(B=Math.max(B,de[Re][se]),p=Math.min(p,de[Re][se])),ue[Re][se]!==void 0&&(p=Math.min(p,ue[Re][se]),S=Math.max(S,ue[Re][se])),Ge){case"candlestick":T.seriesCandleC[Re][se]!==void 0&&(B=Math.max(B,T.seriesCandleH[Re][se]),p=Math.min(p,T.seriesCandleL[Re][se]));break;case"boxPlot":T.seriesCandleC[Re][se]!==void 0&&(B=Math.max(B,T.seriesCandleC[Re][se]),p=Math.min(p,T.seriesCandleO[Re][se]))}Ge&&Ge!=="candlestick"&&Ge!=="boxPlot"&&Ge!=="rangeArea"&&Ge!=="rangeBar"&&(B=Math.max(B,T.series[Re][se]),p=Math.min(p,T.series[Re][se])),S=B,T.seriesGoals[Re]&&T.seriesGoals[Re][se]&&Array.isArray(T.seriesGoals[Re][se])&&T.seriesGoals[Re][se].forEach(function(Be){q!==Number.MIN_VALUE&&(q=Math.min(q,Be.value),p=q),B=Math.max(B,Be.value),S=B}),F.isFloat(Ce)&&(Ce=F.noExponents(Ce),T.yValueDecimal=Math.max(T.yValueDecimal,Ce.toString().split(".")[1].length)),q>ue[Re][se]&&ue[Re][se]<0&&(q=ue[Re][se])}else T.hasNullValues=!0}Ge!=="bar"&&Ge!=="column"||(q<0&&B<0&&(B=0,S=Math.max(S,0)),q===Number.MIN_VALUE&&(q=0,p=Math.min(p,0)))}return k.chart.type==="rangeBar"&&T.seriesRangeStart.length&&T.isBarHorizontal&&(q=p),k.chart.type==="bar"&&(q<0&&B<0&&(B=0),q===Number.MIN_VALUE&&(q=0)),{minY:q,maxY:B,lowestY:p,highestY:S}}},{key:"setYRange",value:function(){var h=this.w.globals,p=this.w.config;h.maxY=-Number.MAX_VALUE,h.minY=Number.MIN_VALUE;var S,_=Number.MAX_VALUE;if(h.isMultipleYAxis){_=Number.MAX_VALUE;for(var k=0;k<h.series.length;k++)S=this.getMinYMaxY(k),h.minYArr[k]=S.lowestY,h.maxYArr[k]=S.highestY,_=Math.min(_,S.lowestY)}return S=this.getMinYMaxY(0,_,null,h.series.length),p.chart.type==="bar"?(h.minY=S.minY,h.maxY=S.maxY):(h.minY=S.lowestY,h.maxY=S.highestY),_=S.lowestY,p.chart.stacked&&this._setStackedMinMax(),p.chart.type==="line"||p.chart.type==="area"||p.chart.type==="scatter"||p.chart.type==="candlestick"||p.chart.type==="boxPlot"||p.chart.type==="rangeBar"&&!h.isBarHorizontal?h.minY===Number.MIN_VALUE&&_!==-Number.MAX_VALUE&&_!==h.maxY&&(h.minY=_):h.minY=h.minY!==Number.MIN_VALUE?Math.min(S.minY,h.minY):S.minY,p.yaxis.forEach(function(T,B){T.max!==void 0&&(typeof T.max=="number"?h.maxYArr[B]=T.max:typeof T.max=="function"&&(h.maxYArr[B]=T.max(h.isMultipleYAxis?h.maxYArr[B]:h.maxY)),h.maxY=h.maxYArr[B]),T.min!==void 0&&(typeof T.min=="number"?h.minYArr[B]=T.min:typeof T.min=="function"&&(h.minYArr[B]=T.min(h.isMultipleYAxis?h.minYArr[B]===Number.MIN_VALUE?0:h.minYArr[B]:h.minY)),h.minY=h.minYArr[B])}),h.isBarHorizontal&&["min","max"].forEach(function(T){p.xaxis[T]!==void 0&&typeof p.xaxis[T]=="number"&&(T==="min"?h.minY=p.xaxis[T]:h.maxY=p.xaxis[T])}),h.isMultipleYAxis?(this.scales.scaleMultipleYAxes(),h.minY=_):(this.scales.setYScaleForIndex(0,h.minY,h.maxY),h.minY=h.yAxisScale[0].niceMin,h.maxY=h.yAxisScale[0].niceMax,h.minYArr[0]=h.minY,h.maxYArr[0]=h.maxY),h.barGroups=[],h.lineGroups=[],h.areaGroups=[],p.series.forEach(function(T){switch(T.type||p.chart.type){case"bar":case"column":h.barGroups.push(T.group);break;case"line":h.lineGroups.push(T.group);break;case"area":h.areaGroups.push(T.group)}}),h.barGroups=h.barGroups.filter(function(T,B,q){return q.indexOf(T)===B}),h.lineGroups=h.lineGroups.filter(function(T,B,q){return q.indexOf(T)===B}),h.areaGroups=h.areaGroups.filter(function(T,B,q){return q.indexOf(T)===B}),{minY:h.minY,maxY:h.maxY,minYArr:h.minYArr,maxYArr:h.maxYArr,yAxisScale:h.yAxisScale}}},{key:"setXRange",value:function(){var h=this.w.globals,p=this.w.config,S=p.xaxis.type==="numeric"||p.xaxis.type==="datetime"||p.xaxis.type==="category"&&!h.noLabelsProvided||h.noLabelsProvided||h.isXNumeric;if(h.isXNumeric&&function(){for(var q=0;q<h.series.length;q++)if(h.labels[q])for(var te=0;te<h.labels[q].length;te++)h.labels[q][te]!==null&&F.isNumber(h.labels[q][te])&&(h.maxX=Math.max(h.maxX,h.labels[q][te]),h.initialMaxX=Math.max(h.maxX,h.labels[q][te]),h.minX=Math.min(h.minX,h.labels[q][te]),h.initialMinX=Math.min(h.minX,h.labels[q][te]))}(),h.noLabelsProvided&&p.xaxis.categories.length===0&&(h.maxX=h.labels[h.labels.length-1],h.initialMaxX=h.labels[h.labels.length-1],h.minX=1,h.initialMinX=1),h.isXNumeric||h.noLabelsProvided||h.dataFormatXNumeric){var _=10;if(p.xaxis.tickAmount===void 0)_=Math.round(h.svgWidth/150),p.xaxis.type==="numeric"&&h.dataPoints<30&&(_=h.dataPoints-1),_>h.dataPoints&&h.dataPoints!==0&&(_=h.dataPoints-1);else if(p.xaxis.tickAmount==="dataPoints"){if(h.series.length>1&&(_=h.series[h.maxValsInArrayIndex].length-1),h.isXNumeric){var k=h.maxX-h.minX;k<30&&(_=k-1)}}else _=p.xaxis.tickAmount;if(h.xTickAmount=_,p.xaxis.max!==void 0&&typeof p.xaxis.max=="number"&&(h.maxX=p.xaxis.max),p.xaxis.min!==void 0&&typeof p.xaxis.min=="number"&&(h.minX=p.xaxis.min),p.xaxis.range!==void 0&&(h.minX=h.maxX-p.xaxis.range),h.minX!==Number.MAX_VALUE&&h.maxX!==-Number.MAX_VALUE)if(p.xaxis.convertedCatToNumeric&&!h.dataFormatXNumeric){for(var T=[],B=h.minX-1;B<h.maxX;B++)T.push(B+1);h.xAxisScale={result:T,niceMin:T[0],niceMax:T[T.length-1]}}else h.xAxisScale=this.scales.setXScale(h.minX,h.maxX);else h.xAxisScale=this.scales.linearScale(0,_,_,0,p.xaxis.stepSize),h.noLabelsProvided&&h.labels.length>0&&(h.xAxisScale=this.scales.linearScale(1,h.labels.length,_-1,0,p.xaxis.stepSize),h.seriesX=h.labels.slice());S&&(h.labels=h.xAxisScale.result.slice())}return h.isBarHorizontal&&h.labels.length&&(h.xTickAmount=h.labels.length),this._handleSingleDataPoint(),this._getMinXDiff(),{minX:h.minX,maxX:h.maxX}}},{key:"setZRange",value:function(){var h=this.w.globals;if(h.isDataXYZ){for(var p=0;p<h.series.length;p++)if(h.seriesZ[p]!==void 0)for(var S=0;S<h.seriesZ[p].length;S++)h.seriesZ[p][S]!==null&&F.isNumber(h.seriesZ[p][S])&&(h.maxZ=Math.max(h.maxZ,h.seriesZ[p][S]),h.minZ=Math.min(h.minZ,h.seriesZ[p][S]))}}},{key:"_handleSingleDataPoint",value:function(){var h=this.w.globals,p=this.w.config;if(h.minX===h.maxX){var S=new X(this.ctx);if(p.xaxis.type==="datetime"){var _=S.getDate(h.minX);p.xaxis.labels.datetimeUTC?_.setUTCDate(_.getUTCDate()-2):_.setDate(_.getDate()-2),h.minX=new Date(_).getTime();var k=S.getDate(h.maxX);p.xaxis.labels.datetimeUTC?k.setUTCDate(k.getUTCDate()+2):k.setDate(k.getDate()+2),h.maxX=new Date(k).getTime()}else(p.xaxis.type==="numeric"||p.xaxis.type==="category"&&!h.noLabelsProvided)&&(h.minX=h.minX-2,h.initialMinX=h.minX,h.maxX=h.maxX+2,h.initialMaxX=h.maxX)}}},{key:"_getMinXDiff",value:function(){var h=this.w.globals;h.isXNumeric&&h.seriesX.forEach(function(p,S){p.length===1&&p.push(h.seriesX[h.maxValsInArrayIndex][h.seriesX[h.maxValsInArrayIndex].length-1]);var _=p.slice();_.sort(function(k,T){return k-T}),_.forEach(function(k,T){if(T>0){var B=k-_[T-1];B>0&&(h.minXDiff=Math.min(B,h.minXDiff))}}),h.dataPoints!==1&&h.minXDiff!==Number.MAX_VALUE||(h.minXDiff=.5)})}},{key:"_setStackedMinMax",value:function(){var h=this,p=this.w.globals;if(p.series.length){var S=p.seriesGroups;S.length||(S=[this.w.globals.seriesNames.map(function(T){return T})]);var _={},k={};S.forEach(function(T){_[T]=[],k[T]=[],h.w.config.series.map(function(B,q){return T.indexOf(p.seriesNames[q])>-1?q:null}).filter(function(B){return B!==null}).forEach(function(B){for(var q=0;q<p.series[p.maxValsInArrayIndex].length;q++){var te,ue,de,xe;_[T][q]===void 0&&(_[T][q]=0,k[T][q]=0),(h.w.config.chart.stacked&&!p.comboCharts||h.w.config.chart.stacked&&p.comboCharts&&(!h.w.config.chart.stackOnlyBar||((te=h.w.config.series)===null||te===void 0||(ue=te[B])===null||ue===void 0?void 0:ue.type)==="bar"||((de=h.w.config.series)===null||de===void 0||(xe=de[B])===null||xe===void 0?void 0:xe.type)==="column"))&&p.series[B][q]!==null&&F.isNumber(p.series[B][q])&&(p.series[B][q]>0?_[T][q]+=parseFloat(p.series[B][q])+1e-4:k[T][q]+=parseFloat(p.series[B][q]))}})}),Object.entries(_).forEach(function(T){var B=C(T,1)[0];_[B].forEach(function(q,te){p.maxY=Math.max(p.maxY,_[B][te]),p.minY=Math.min(p.minY,k[B][te])})})}}}]),Ee}(),ut=function(){function Ee(h,p){s(this,Ee),this.ctx=h,this.elgrid=p,this.w=h.w;var S=this.w;this.xaxisFontSize=S.config.xaxis.labels.style.fontSize,this.axisFontFamily=S.config.xaxis.labels.style.fontFamily,this.xaxisForeColors=S.config.xaxis.labels.style.colors,this.isCategoryBarHorizontal=S.config.chart.type==="bar"&&S.config.plotOptions.bar.horizontal,this.xAxisoffX=S.config.xaxis.position==="bottom"?S.globals.gridHeight:0,this.drawnLabels=[],this.axesUtils=new pe(h)}return o(Ee,[{key:"drawYaxis",value:function(h){var p=this.w,S=new z(this.ctx),_=p.config.yaxis[h].labels.style,k=_.fontSize,T=_.fontFamily,B=_.fontWeight,q=S.group({class:"apexcharts-yaxis",rel:h,transform:"translate(".concat(p.globals.translateYAxisX[h],", 0)")});if(this.axesUtils.isYAxisHidden(h))return q;var te=S.group({class:"apexcharts-yaxis-texts-g"});q.add(te);var ue=p.globals.yAxisScale[h].result.length-1,de=p.globals.gridHeight/ue,xe=p.globals.yLabelFormatters[h],Se=this.axesUtils.checkForReversedLabels(h,p.globals.yAxisScale[h].result.slice());if(p.config.yaxis[h].labels.show){var ke=p.globals.translateY+p.config.yaxis[h].labels.offsetY;p.globals.isBarHorizontal?ke=0:p.config.chart.type==="heatmap"&&(ke-=de/2),ke+=parseInt(k,10)/3;for(var Re=ue;Re>=0;Re--){var Ge=xe(Se[Re],Re,p),Fe=p.config.yaxis[h].labels.padding;p.config.yaxis[h].opposite&&p.config.yaxis.length!==0&&(Fe*=-1);var st=this.getTextAnchor(p.config.yaxis[h].labels.align,p.config.yaxis[h].opposite),se=this.axesUtils.getYAxisForeColor(_.colors,h),Ce=Array.isArray(se)?se[Re]:se,Be=F.listToArray(p.globals.dom.baseEl.querySelectorAll(".apexcharts-yaxis[rel='".concat(h,"'] .apexcharts-yaxis-label tspan"))).map(function(_e){return _e.textContent}),De=S.drawText({x:Fe,y:ke,text:Be.includes(Ge)&&!p.config.yaxis[h].labels.showDuplicates?"":Ge,textAnchor:st,fontSize:k,fontFamily:T,fontWeight:B,maxWidth:p.config.yaxis[h].labels.maxWidth,foreColor:Ce,isPlainText:!1,cssClass:"apexcharts-yaxis-label ".concat(_.cssClass)});te.add(De),this.addTooltip(De,Ge),p.config.yaxis[h].labels.rotate!==0&&this.rotateLabel(S,De,firstLabel,p.config.yaxis[h].labels.rotate),ke+=de}}return this.addYAxisTitle(S,q,h),this.addAxisBorder(S,q,h,ue,de),q}},{key:"getTextAnchor",value:function(h,p){return h==="left"?"start":h==="center"?"middle":h==="right"?"end":p?"start":"end"}},{key:"addTooltip",value:function(h,p){var S=document.createElementNS(this.w.globals.SVGNS,"title");S.textContent=Array.isArray(p)?p.join(" "):p,h.node.appendChild(S)}},{key:"rotateLabel",value:function(h,p,S,_){var k=h.rotateAroundCenter(S.node),T=h.rotateAroundCenter(p.node);p.node.setAttribute("transform","rotate(".concat(_," ").concat(k.x," ").concat(T.y,")"))}},{key:"addYAxisTitle",value:function(h,p,S){var _=this.w;if(_.config.yaxis[S].title.text!==void 0){var k=h.group({class:"apexcharts-yaxis-title"}),T=_.config.yaxis[S].opposite?_.globals.translateYAxisX[S]:0,B=h.drawText({x:T,y:_.globals.gridHeight/2+_.globals.translateY+_.config.yaxis[S].title.offsetY,text:_.config.yaxis[S].title.text,textAnchor:"end",foreColor:_.config.yaxis[S].title.style.color,fontSize:_.config.yaxis[S].title.style.fontSize,fontWeight:_.config.yaxis[S].title.style.fontWeight,fontFamily:_.config.yaxis[S].title.style.fontFamily,cssClass:"apexcharts-yaxis-title-text ".concat(_.config.yaxis[S].title.style.cssClass)});k.add(B),p.add(k)}}},{key:"addAxisBorder",value:function(h,p,S,_,k){var T=this.w,B=T.config.yaxis[S].axisBorder,q=31+B.offsetX;if(T.config.yaxis[S].opposite&&(q=-31-B.offsetX),B.show){var te=h.drawLine(q,T.globals.translateY+B.offsetY-2,q,T.globals.gridHeight+T.globals.translateY+B.offsetY+2,B.color,0,B.width);p.add(te)}T.config.yaxis[S].axisTicks.show&&this.axesUtils.drawYAxisTicks(q,_,B,T.config.yaxis[S].axisTicks,S,k,p)}},{key:"drawYaxisInversed",value:function(h){var p=this.w,S=new z(this.ctx),_=S.group({class:"apexcharts-xaxis apexcharts-yaxis-inversed"}),k=S.group({class:"apexcharts-xaxis-texts-g",transform:"translate(".concat(p.globals.translateXAxisX,", ").concat(p.globals.translateXAxisY,")")});_.add(k);var T=p.globals.yAxisScale[h].result.length-1,B=p.globals.gridWidth/T+.1,q=B+p.config.xaxis.labels.offsetX,te=p.globals.xLabelFormatter,ue=this.axesUtils.checkForReversedLabels(h,p.globals.yAxisScale[h].result.slice()),de=p.globals.timescaleLabels;if(de.length>0&&(this.xaxisLabels=de.slice(),T=(ue=de.slice()).length),p.config.xaxis.labels.show)for(var xe=de.length?0:T;de.length?xe<de.length:xe>=0;de.length?xe++:xe--){var Se=te(ue[xe],xe,p),ke=p.globals.gridWidth+p.globals.padHorizontal-(q-B+p.config.xaxis.labels.offsetX);if(de.length){var Re=this.axesUtils.getLabel(ue,de,ke,xe,this.drawnLabels,this.xaxisFontSize);ke=Re.x,Se=Re.text,this.drawnLabels.push(Re.text),xe===0&&p.globals.skipFirstTimelinelabel&&(Se=""),xe===ue.length-1&&p.globals.skipLastTimelinelabel&&(Se="")}var Ge=S.drawText({x:ke,y:this.xAxisoffX+p.config.xaxis.labels.offsetY+30-(p.config.xaxis.position==="top"?p.globals.xAxisHeight+p.config.xaxis.axisTicks.height-2:0),text:Se,textAnchor:"middle",foreColor:Array.isArray(this.xaxisForeColors)?this.xaxisForeColors[h]:this.xaxisForeColors,fontSize:this.xaxisFontSize,fontFamily:this.xaxisFontFamily,fontWeight:p.config.xaxis.labels.style.fontWeight,isPlainText:!1,cssClass:"apexcharts-xaxis-label ".concat(p.config.xaxis.labels.style.cssClass)});k.add(Ge),Ge.tspan(Se),this.addTooltip(Ge,Se),q+=B}return this.inversedYAxisTitleText(_),this.inversedYAxisBorder(_),_}},{key:"inversedYAxisBorder",value:function(h){var p=this.w,S=new z(this.ctx),_=p.config.xaxis.axisBorder;if(_.show){var k=0;p.config.chart.type==="bar"&&p.globals.isXNumeric&&(k-=15);var T=S.drawLine(p.globals.padHorizontal+k+_.offsetX,this.xAxisoffX,p.globals.gridWidth,this.xAxisoffX,_.color,0,_.height);this.elgrid&&this.elgrid.elGridBorders&&p.config.grid.show?this.elgrid.elGridBorders.add(T):h.add(T)}}},{key:"inversedYAxisTitleText",value:function(h){var p=this.w,S=new z(this.ctx);if(p.config.xaxis.title.text!==void 0){var _=S.group({class:"apexcharts-xaxis-title apexcharts-yaxis-title-inversed"}),k=S.drawText({x:p.globals.gridWidth/2+p.config.xaxis.title.offsetX,y:this.xAxisoffX+parseFloat(this.xaxisFontSize)+parseFloat(p.config.xaxis.title.style.fontSize)+p.config.xaxis.title.offsetY+20,text:p.config.xaxis.title.text,textAnchor:"middle",fontSize:p.config.xaxis.title.style.fontSize,fontFamily:p.config.xaxis.title.style.fontFamily,fontWeight:p.config.xaxis.title.style.fontWeight,foreColor:p.config.xaxis.title.style.color,cssClass:"apexcharts-xaxis-title-text ".concat(p.config.xaxis.title.style.cssClass)});_.add(k),h.add(_)}}},{key:"yAxisTitleRotate",value:function(h,p){var S=this.w,_=new z(this.ctx),k=S.globals.dom.baseEl.querySelector(".apexcharts-yaxis[rel='".concat(h,"'] .apexcharts-yaxis-texts-g")),T=k?k.getBoundingClientRect():{width:0,height:0},B=S.globals.dom.baseEl.querySelector(".apexcharts-yaxis[rel='".concat(h,"'] .apexcharts-yaxis-title text")),q=B?B.getBoundingClientRect():{width:0,height:0};if(B){var te=this.xPaddingForYAxisTitle(h,T,q,p);B.setAttribute("x",te.xPos-(p?10:0));var ue=_.rotateAroundCenter(B);B.setAttribute("transform","rotate(".concat(p?-1*S.config.yaxis[h].title.rotate:S.config.yaxis[h].title.rotate," ").concat(ue.x," ").concat(ue.y,")"))}}},{key:"xPaddingForYAxisTitle",value:function(h,p,S,_){var k=this.w,T=0,B=10;return k.config.yaxis[h].title.text===void 0||h<0?{xPos:T,padd:0}:(_?T=p.width+k.config.yaxis[h].title.offsetX+S.width/2+B/2:(T=-1*p.width+k.config.yaxis[h].title.offsetX+B/2+S.width/2,k.globals.isBarHorizontal&&(B=25,T=-1*p.width-k.config.yaxis[h].title.offsetX-B)),{xPos:T,padd:B})}},{key:"setYAxisXPosition",value:function(h,p){var S=this.w,_=0,k=0,T=18,B=1;S.config.yaxis.length>1&&(this.multipleYs=!0),S.config.yaxis.forEach(function(q,te){var ue=S.globals.ignoreYAxisIndexes.includes(te)||!q.show||q.floating||h[te].width===0,de=h[te].width+p[te].width;q.opposite?S.globals.isBarHorizontal?(k=S.globals.gridWidth+S.globals.translateX-1,S.globals.translateYAxisX[te]=k-q.labels.offsetX):(k=S.globals.gridWidth+S.globals.translateX+B,ue||(B+=de+20),S.globals.translateYAxisX[te]=k-q.labels.offsetX+20):(_=S.globals.translateX-T,ue||(T+=de+20),S.globals.translateYAxisX[te]=_+q.labels.offsetX)})}},{key:"setYAxisTextAlignments",value:function(){var h=this.w;F.listToArray(h.globals.dom.baseEl.getElementsByClassName("apexcharts-yaxis")).forEach(function(p,S){var _=h.config.yaxis[S];if(_&&!_.floating&&_.labels.align!==void 0){var k=h.globals.dom.baseEl.querySelector(".apexcharts-yaxis[rel='".concat(S,"'] .apexcharts-yaxis-texts-g")),T=F.listToArray(h.globals.dom.baseEl.querySelectorAll(".apexcharts-yaxis[rel='".concat(S,"'] .apexcharts-yaxis-label"))),B=k.getBoundingClientRect();T.forEach(function(q){q.setAttribute("text-anchor",_.labels.align)}),_.labels.align!=="left"||_.opposite?_.labels.align==="center"?k.setAttribute("transform","translate(".concat(B.width/2*(_.opposite?1:-1),", 0)")):_.labels.align==="right"&&_.opposite&&k.setAttribute("transform","translate(".concat(B.width,", 0)")):k.setAttribute("transform","translate(-".concat(B.width,", 0)"))}})}}]),Ee}(),qt=function(){function Ee(h){s(this,Ee),this.ctx=h,this.w=h.w,this.documentEvent=F.bind(this.documentEvent,this)}return o(Ee,[{key:"addEventListener",value:function(h,p){var S=this.w;S.globals.events.hasOwnProperty(h)?S.globals.events[h].push(p):S.globals.events[h]=[p]}},{key:"removeEventListener",value:function(h,p){var S=this.w;if(S.globals.events.hasOwnProperty(h)){var _=S.globals.events[h].indexOf(p);_!==-1&&S.globals.events[h].splice(_,1)}}},{key:"fireEvent",value:function(h,p){var S=this.w;if(S.globals.events.hasOwnProperty(h)){p&&p.length||(p=[]);for(var _=S.globals.events[h],k=_.length,T=0;T<k;T++)_[T].apply(null,p)}}},{key:"setupEventHandlers",value:function(){var h=this,p=this.w,S=this.ctx,_=p.globals.dom.baseEl.querySelector(p.globals.chartClass);this.ctx.eventList.forEach(function(k){_.addEventListener(k,function(T){var B=Object.assign({},p,{seriesIndex:p.globals.axisCharts?p.globals.capturedSeriesIndex:0,dataPointIndex:p.globals.capturedDataPointIndex});T.type==="mousemove"||T.type==="touchmove"?typeof p.config.chart.events.mouseMove=="function"&&p.config.chart.events.mouseMove(T,S,B):T.type==="mouseleave"||T.type==="touchleave"?typeof p.config.chart.events.mouseLeave=="function"&&p.config.chart.events.mouseLeave(T,S,B):(T.type==="mouseup"&&T.which===1||T.type==="touchend")&&(typeof p.config.chart.events.click=="function"&&p.config.chart.events.click(T,S,B),S.ctx.events.fireEvent("click",[T,S,B]))},{capture:!1,passive:!0})}),this.ctx.eventList.forEach(function(k){p.globals.dom.baseEl.addEventListener(k,h.documentEvent,{passive:!0})}),this.ctx.core.setupBrushHandler()}},{key:"documentEvent",value:function(h){var p=this.w,S=h.target.className;if(h.type==="click"){var _=p.globals.dom.baseEl.querySelector(".apexcharts-menu");_&&_.classList.contains("apexcharts-menu-open")&&S!=="apexcharts-menu-icon"&&_.classList.remove("apexcharts-menu-open")}p.globals.clientX=h.type==="touchmove"?h.touches[0].clientX:h.clientX,p.globals.clientY=h.type==="touchmove"?h.touches[0].clientY:h.clientY}}]),Ee}(),It=function(){function Ee(h){s(this,Ee),this.ctx=h,this.w=h.w}return o(Ee,[{key:"setCurrentLocaleValues",value:function(h){var p=this.w.config.chart.locales;window.Apex.chart&&window.Apex.chart.locales&&window.Apex.chart.locales.length>0&&(p=this.w.config.chart.locales.concat(window.Apex.chart.locales));var S=p.filter(function(k){return k.name===h})[0];if(!S)throw new Error("Wrong locale name provided. Please make sure you set the correct locale name in options");var _=F.extend(oe,S);this.w.globals.locale=_.options}}]),Ee}(),nn=function(){function Ee(h){s(this,Ee),this.ctx=h,this.w=h.w}return o(Ee,[{key:"drawAxis",value:function(h,p){var S,_,k=this,T=this.w.globals,B=this.w.config,q=new it(this.ctx,p),te=new ut(this.ctx,p);T.axisCharts&&h!=="radar"&&(T.isBarHorizontal?(_=te.drawYaxisInversed(0),S=q.drawXaxisInversed(0),T.dom.elGraphical.add(S),T.dom.elGraphical.add(_)):(S=q.drawXaxis(),T.dom.elGraphical.add(S),B.yaxis.map(function(ue,de){if(T.ignoreYAxisIndexes.indexOf(de)===-1&&(_=te.drawYaxis(de),T.dom.Paper.add(_),k.w.config.grid.position==="back")){var xe=T.dom.Paper.children()[1];xe.remove(),T.dom.Paper.add(xe)}})))}}]),Ee}(),jt=function(){function Ee(h){s(this,Ee),this.ctx=h,this.w=h.w}return o(Ee,[{key:"drawXCrosshairs",value:function(){var h=this.w,p=new z(this.ctx),S=new L(this.ctx),_=h.config.xaxis.crosshairs.fill.gradient,k=h.config.xaxis.crosshairs.dropShadow,T=h.config.xaxis.crosshairs.fill.type,B=_.colorFrom,q=_.colorTo,te=_.opacityFrom,ue=_.opacityTo,de=_.stops,xe=k.enabled,Se=k.left,ke=k.top,Re=k.blur,Ge=k.color,Fe=k.opacity,st=h.config.xaxis.crosshairs.fill.color;if(h.config.xaxis.crosshairs.show){T==="gradient"&&(st=p.drawGradient("vertical",B,q,te,ue,null,de,null));var se=p.drawRect();h.config.xaxis.crosshairs.width===1&&(se=p.drawLine());var Ce=h.globals.gridHeight;(!F.isNumber(Ce)||Ce<0)&&(Ce=0);var Be=h.config.xaxis.crosshairs.width;(!F.isNumber(Be)||Be<0)&&(Be=0),se.attr({class:"apexcharts-xcrosshairs",x:0,y:0,y2:Ce,width:Be,height:Ce,fill:st,filter:"none","fill-opacity":h.config.xaxis.crosshairs.opacity,stroke:h.config.xaxis.crosshairs.stroke.color,"stroke-width":h.config.xaxis.crosshairs.stroke.width,"stroke-dasharray":h.config.xaxis.crosshairs.stroke.dashArray}),xe&&(se=S.dropShadow(se,{left:Se,top:ke,blur:Re,color:Ge,opacity:Fe})),h.globals.dom.elGraphical.add(se)}}},{key:"drawYCrosshairs",value:function(){var h=this.w,p=new z(this.ctx),S=h.config.yaxis[0].crosshairs,_=h.globals.barPadForNumericAxis;if(h.config.yaxis[0].crosshairs.show){var k=p.drawLine(-_,0,h.globals.gridWidth+_,0,S.stroke.color,S.stroke.dashArray,S.stroke.width);k.attr({class:"apexcharts-ycrosshairs"}),h.globals.dom.elGraphical.add(k)}var T=p.drawLine(-_,0,h.globals.gridWidth+_,0,S.stroke.color,0,0);T.attr({class:"apexcharts-ycrosshairs-hidden"}),h.globals.dom.elGraphical.add(T)}}]),Ee}(),cn=function(){function Ee(h){s(this,Ee),this.ctx=h,this.w=h.w}return o(Ee,[{key:"checkResponsiveConfig",value:function(h){var p=this,S=this.w,_=S.config;if(_.responsive.length!==0){var k=_.responsive.slice();k.sort(function(te,ue){return te.breakpoint>ue.breakpoint?1:ue.breakpoint>te.breakpoint?-1:0}).reverse();var T=new Ne({}),B=function(){var te=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},ue=k[0].breakpoint,de=window.innerWidth>0?window.innerWidth:screen.width;if(de>ue){var xe=F.clone(S.globals.initialConfig);xe.series=F.clone(S.config.series);var Se=Q.extendArrayProps(T,xe,S);te=F.extend(Se,te),te=F.extend(S.config,te),p.overrideResponsiveOptions(te)}else for(var ke=0;ke<k.length;ke++)de<k[ke].breakpoint&&(te=Q.extendArrayProps(T,k[ke].options,S),te=F.extend(S.config,te),p.overrideResponsiveOptions(te))};if(h){var q=Q.extendArrayProps(T,h,S);q=F.extend(S.config,q),B(q=F.extend(q,h))}else B({})}}},{key:"overrideResponsiveOptions",value:function(h){var p=new Ne(h).init({responsiveOverride:!0});this.w.config=p}}]),Ee}(),un=function(){function Ee(h){s(this,Ee),this.ctx=h,this.w=h.w,this.colors=[],this.isColorFn=!1,this.isHeatmapDistributed=this.checkHeatmapDistributed(),this.isBarDistributed=this.checkBarDistributed()}return o(Ee,[{key:"checkHeatmapDistributed",value:function(){var h=this.w.config,p=h.chart,S=h.plotOptions;return p.type==="treemap"&&S.treemap&&S.treemap.distributed||p.type==="heatmap"&&S.heatmap&&S.heatmap.distributed}},{key:"checkBarDistributed",value:function(){var h=this.w.config,p=h.chart,S=h.plotOptions;return S.bar&&S.bar.distributed&&(p.type==="bar"||p.type==="rangeBar")}},{key:"init",value:function(){this.setDefaultColors()}},{key:"setDefaultColors",value:function(){var h=this.w,p=new F;h.globals.dom.elWrap.classList.add("apexcharts-theme-".concat(h.config.theme.mode));var S=N(h.config.colors||h.config.fill.colors||[]);h.globals.colors=this.getColors(S),this.applySeriesColors(h.globals.seriesColors,h.globals.colors),h.config.theme.monochrome.enabled&&(h.globals.colors=this.getMonochromeColors(h.config.theme.monochrome,h.globals.series,p));var _=h.globals.colors.slice();this.pushExtraColors(h.globals.colors),this.applyColorTypes(["fill","stroke"],_),this.applyDataLabelsColors(_),this.applyRadarPolygonsColors(),this.applyMarkersColors(_)}},{key:"getColors",value:function(h){var p=this,S=this.w;return h&&h.length!==0?Array.isArray(h)&&h.length>0&&typeof h[0]=="function"?(this.isColorFn=!0,S.config.series.map(function(_,k){var T=h[k]||h[0];return typeof T=="function"?T({value:S.globals.axisCharts?S.globals.series[k][0]||0:S.globals.series[k],seriesIndex:k,dataPointIndex:k,w:p.w}):T})):h:this.predefined()}},{key:"applySeriesColors",value:function(h,p){h.forEach(function(S,_){S&&(p[_]=S)})}},{key:"getMonochromeColors",value:function(h,p,S){var _=h.color,k=h.shadeIntensity,T=h.shadeTo,B=this.isBarDistributed||this.isHeatmapDistributed?p[0].length*p.length:p.length,q=1/(B/k),te=0;return Array.from({length:B},function(){var ue=T==="dark"?S.shadeColor(-1*te,_):S.shadeColor(te,_);return te+=q,ue})}},{key:"applyColorTypes",value:function(h,p){var S=this,_=this.w;h.forEach(function(k){_.globals[k].colors=_.config[k].colors===void 0?S.isColorFn?_.config.colors:p:_.config[k].colors.slice(),S.pushExtraColors(_.globals[k].colors)})}},{key:"applyDataLabelsColors",value:function(h){var p=this.w;p.globals.dataLabels.style.colors=p.config.dataLabels.style.colors===void 0?h:p.config.dataLabels.style.colors.slice(),this.pushExtraColors(p.globals.dataLabels.style.colors,50)}},{key:"applyRadarPolygonsColors",value:function(){var h=this.w;h.globals.radarPolygons.fill.colors=h.config.plotOptions.radar.polygons.fill.colors===void 0?[h.config.theme.mode==="dark"?"#424242":"none"]:h.config.plotOptions.radar.polygons.fill.colors.slice(),this.pushExtraColors(h.globals.radarPolygons.fill.colors,20)}},{key:"applyMarkersColors",value:function(h){var p=this.w;p.globals.markers.colors=p.config.markers.colors===void 0?h:p.config.markers.colors.slice(),this.pushExtraColors(p.globals.markers.colors)}},{key:"pushExtraColors",value:function(h,p){var S=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,_=this.w,k=p||_.globals.series.length;if(S===null&&(S=this.isBarDistributed||this.isHeatmapDistributed||_.config.chart.type==="heatmap"&&_.config.plotOptions.heatmap&&_.config.plotOptions.heatmap.colorScale.inverse),S&&_.globals.series.length&&(k=_.globals.series[_.globals.maxValsInArrayIndex].length*_.globals.series.length),h.length<k)for(var T=k-h.length,B=0;B<T;B++)h.push(h[B])}},{key:"updateThemeOptions",value:function(h){h.chart=h.chart||{},h.tooltip=h.tooltip||{};var p=h.theme.mode,S=p==="dark"?"palette4":p==="light"?"palette1":h.theme.palette||"palette1",_=p==="dark"?"#f6f7f8":p==="light"?"#373d3f":h.chart.foreColor||"#373d3f";return h.tooltip.theme=p||"light",h.chart.foreColor=_,h.theme.palette=S,h}},{key:"predefined",value:function(){var h={palette1:["#008FFB","#00E396","#FEB019","#FF4560","#775DD0"],palette2:["#3f51b5","#03a9f4","#4caf50","#f9ce1d","#FF9800"],palette3:["#33b2df","#546E7A","#d4526e","#13d8aa","#A5978B"],palette4:["#4ecdc4","#c7f464","#81D4FA","#fd6a6a","#546E7A"],palette5:["#2b908f","#f9a3a4","#90ee7e","#fa4443","#69d2e7"],palette6:["#449DD1","#F86624","#EA3546","#662E9B","#C5D86D"],palette7:["#D7263D","#1B998B","#2E294E","#F46036","#E2C044"],palette8:["#662E9B","#F86624","#F9C80E","#EA3546","#43BCCD"],palette9:["#5C4742","#A5978B","#8D5B4C","#5A2A27","#C4BBAF"],palette10:["#A300D6","#7D02EB","#5653FE","#2983FF","#00B1F2"],default:["#008FFB","#00E396","#FEB019","#FF4560","#775DD0"]};return h[this.w.config.theme.palette]||h.default}}]),Ee}(),Ft=function(){function Ee(h){s(this,Ee),this.ctx=h,this.w=h.w}return o(Ee,[{key:"draw",value:function(){this.drawTitleSubtitle("title"),this.drawTitleSubtitle("subtitle")}},{key:"drawTitleSubtitle",value:function(h){var p=this.w,S=h==="title"?p.config.title:p.config.subtitle,_=p.globals.svgWidth/2,k=S.offsetY,T="middle";if(S.align==="left"?(_=10,T="start"):S.align==="right"&&(_=p.globals.svgWidth-10,T="end"),_+=S.offsetX,k=k+parseInt(S.style.fontSize,10)+S.margin/2,S.text!==void 0){var B=new z(this.ctx).drawText({x:_,y:k,text:S.text,textAnchor:T,fontSize:S.style.fontSize,fontFamily:S.style.fontFamily,fontWeight:S.style.fontWeight,foreColor:S.style.color,opacity:1});B.node.setAttribute("class","apexcharts-".concat(h,"-text")),p.globals.dom.Paper.add(B)}}}]),Ee}(),Ke=function(){function Ee(h){s(this,Ee),this.w=h.w,this.dCtx=h}return o(Ee,[{key:"getTitleSubtitleCoords",value:function(h){var p=this.w,S=0,_=0,k=h==="title"?p.config.title.floating:p.config.subtitle.floating,T=p.globals.dom.baseEl.querySelector(".apexcharts-".concat(h,"-text"));if(T!==null&&!k){var B=T.getBoundingClientRect();S=B.width,_=p.globals.axisCharts?B.height+5:B.height}return{width:S,height:_}}},{key:"getLegendsRect",value:function(){var h=this.w,p=h.globals.dom.elLegendWrap;h.config.legend.height||h.config.legend.position!=="top"&&h.config.legend.position!=="bottom"||(p.style.maxHeight=h.globals.svgHeight/2+"px");var S=Object.assign({},F.getBoundingClientRect(p));return p!==null&&!h.config.legend.floating&&h.config.legend.show?this.dCtx.lgRect={x:S.x,y:S.y,height:S.height,width:S.height===0?0:S.width}:this.dCtx.lgRect={x:0,y:0,height:0,width:0},h.config.legend.position!=="left"&&h.config.legend.position!=="right"||1.5*this.dCtx.lgRect.width>h.globals.svgWidth&&(this.dCtx.lgRect.width=h.globals.svgWidth/1.5),this.dCtx.lgRect}},{key:"getDatalabelsRect",value:function(){var h=this,p=this.w,S=[];p.config.series.forEach(function(q,te){q.data.forEach(function(ue,de){var xe;xe=p.globals.series[te][de],_=p.config.dataLabels.formatter(xe,{ctx:h.dCtx.ctx,seriesIndex:te,dataPointIndex:de,w:p}),S.push(_)})});var _=F.getLargestStringFromArr(S),k=new z(this.dCtx.ctx),T=p.config.dataLabels.style,B=k.getTextRects(_,parseInt(T.fontSize),T.fontFamily);return{width:1.05*B.width,height:B.height}}},{key:"getLargestStringFromMultiArr",value:function(h,p){var S=h;if(this.w.globals.isMultiLineX){var _=p.map(function(T,B){return Array.isArray(T)?T.length:1}),k=Math.max.apply(Math,N(_));S=p[_.indexOf(k)]}return S}}]),Ee}(),Bt=function(){function Ee(h){s(this,Ee),this.w=h.w,this.dCtx=h}return o(Ee,[{key:"getxAxisLabelsCoords",value:function(){var h,p=this.w,S=p.globals.labels.slice();if(p.config.xaxis.convertedCatToNumeric&&S.length===0&&(S=p.globals.categoryLabels),p.globals.timescaleLabels.length>0){var _=this.getxAxisTimeScaleLabelsCoords();h={width:_.width,height:_.height},p.globals.rotateXLabels=!1}else{this.dCtx.lgWidthForSideLegends=p.config.legend.position!=="left"&&p.config.legend.position!=="right"||p.config.legend.floating?0:this.dCtx.lgRect.width;var k=p.globals.xLabelFormatter,T=F.getLargestStringFromArr(S),B=this.dCtx.dimHelpers.getLargestStringFromMultiArr(T,S);p.globals.isBarHorizontal&&(B=T=p.globals.yAxisScale[0].result.reduce(function(ke,Re){return ke.length>Re.length?ke:Re},0));var q=new re(this.dCtx.ctx),te=T;T=q.xLabelFormat(k,T,te,{i:void 0,dateFormatter:new X(this.dCtx.ctx).formatDate,w:p}),B=q.xLabelFormat(k,B,te,{i:void 0,dateFormatter:new X(this.dCtx.ctx).formatDate,w:p}),(p.config.xaxis.convertedCatToNumeric&&T===void 0||String(T).trim()==="")&&(B=T="1");var ue=new z(this.dCtx.ctx),de=ue.getTextRects(T,p.config.xaxis.labels.style.fontSize),xe=de;if(T!==B&&(xe=ue.getTextRects(B,p.config.xaxis.labels.style.fontSize)),(h={width:de.width>=xe.width?de.width:xe.width,height:de.height>=xe.height?de.height:xe.height}).width*S.length>p.globals.svgWidth-this.dCtx.lgWidthForSideLegends-this.dCtx.yAxisWidth-this.dCtx.gridPad.left-this.dCtx.gridPad.right&&p.config.xaxis.labels.rotate!==0||p.config.xaxis.labels.rotateAlways){if(!p.globals.isBarHorizontal){p.globals.rotateXLabels=!0;var Se=function(ke){return ue.getTextRects(ke,p.config.xaxis.labels.style.fontSize,p.config.xaxis.labels.style.fontFamily,"rotate(".concat(p.config.xaxis.labels.rotate," 0 0)"),!1)};de=Se(T),T!==B&&(xe=Se(B)),h.height=(de.height>xe.height?de.height:xe.height)/1.5,h.width=de.width>xe.width?de.width:xe.width}}else p.globals.rotateXLabels=!1}return p.config.xaxis.labels.show||(h={width:0,height:0}),{width:h.width,height:h.height}}},{key:"getxAxisGroupLabelsCoords",value:function(){var h,p=this.w;if(!p.globals.hasXaxisGroups)return{width:0,height:0};var S,_=((h=p.config.xaxis.group.style)===null||h===void 0?void 0:h.fontSize)||p.config.xaxis.labels.style.fontSize,k=p.globals.groups.map(function(de){return de.title}),T=F.getLargestStringFromArr(k),B=this.dCtx.dimHelpers.getLargestStringFromMultiArr(T,k),q=new z(this.dCtx.ctx),te=q.getTextRects(T,_),ue=te;return T!==B&&(ue=q.getTextRects(B,_)),S={width:te.width>=ue.width?te.width:ue.width,height:te.height>=ue.height?te.height:ue.height},p.config.xaxis.labels.show||(S={width:0,height:0}),{width:S.width,height:S.height}}},{key:"getxAxisTitleCoords",value:function(){var h=this.w,p=0,S=0;if(h.config.xaxis.title.text!==void 0){var _=new z(this.dCtx.ctx).getTextRects(h.config.xaxis.title.text,h.config.xaxis.title.style.fontSize);p=_.width,S=_.height}return{width:p,height:S}}},{key:"getxAxisTimeScaleLabelsCoords",value:function(){var h,p=this.w;this.dCtx.timescaleLabels=p.globals.timescaleLabels.slice();var S=this.dCtx.timescaleLabels.map(function(k){return k.value}),_=S.reduce(function(k,T){return k===void 0?(console.error("You have possibly supplied invalid Date format. Please supply a valid JavaScript Date"),0):k.length>T.length?k:T},0);return 1.05*(h=new z(this.dCtx.ctx).getTextRects(_,p.config.xaxis.labels.style.fontSize)).width*S.length>p.globals.gridWidth&&p.config.xaxis.labels.rotate!==0&&(p.globals.overlappingXLabels=!0),h}},{key:"additionalPaddingXLabels",value:function(h){var p=this,S=this.w,_=S.globals,k=S.config,T=k.xaxis.type,B=h.width;_.skipLastTimelinelabel=!1,_.skipFirstTimelinelabel=!1;var q=S.config.yaxis[0].opposite&&S.globals.isBarHorizontal,te=function(ue,de){k.yaxis.length>1&&function(xe){return _.collapsedSeriesIndices.indexOf(xe)!==-1}(de)||function(xe){if(p.dCtx.timescaleLabels&&p.dCtx.timescaleLabels.length){var Se=p.dCtx.timescaleLabels[0],ke=p.dCtx.timescaleLabels[p.dCtx.timescaleLabels.length-1].position+B/1.75-p.dCtx.yAxisWidthRight,Re=Se.position-B/1.75+p.dCtx.yAxisWidthLeft,Ge=S.config.legend.position==="right"&&p.dCtx.lgRect.width>0?p.dCtx.lgRect.width:0;ke>_.svgWidth-_.translateX-Ge&&(_.skipLastTimelinelabel=!0),Re<-(xe.show&&!xe.floating||k.chart.type!=="bar"&&k.chart.type!=="candlestick"&&k.chart.type!=="rangeBar"&&k.chart.type!=="boxPlot"?10:B/1.75)&&(_.skipFirstTimelinelabel=!0)}else T==="datetime"?p.dCtx.gridPad.right<B&&!_.rotateXLabels&&(_.skipLastTimelinelabel=!0):T!=="datetime"&&p.dCtx.gridPad.right<B/2-p.dCtx.yAxisWidthRight&&!_.rotateXLabels&&!S.config.xaxis.labels.trim&&(p.dCtx.xPadRight=B/2+1)}(ue)};k.yaxis.forEach(function(ue,de){q?(p.dCtx.gridPad.left<B&&(p.dCtx.xPadLeft=B/2+1),p.dCtx.xPadRight=B/2+1):te(ue,de)})}}]),Ee}(),$t=function(){function Ee(h){s(this,Ee),this.w=h.w,this.dCtx=h}return o(Ee,[{key:"getyAxisLabelsCoords",value:function(){var h=this,p=this.w,S=[],_=10,k=new pe(this.dCtx.ctx);return p.config.yaxis.map(function(T,B){var q={seriesIndex:B,dataPointIndex:-1,w:p},te=p.globals.yAxisScale[B],ue=0;if(!k.isYAxisHidden(B)&&T.labels.show&&T.labels.minWidth!==void 0&&(ue=T.labels.minWidth),!k.isYAxisHidden(B)&&T.labels.show&&te.result.length){var de=p.globals.yLabelFormatters[B],xe=te.niceMin===Number.MIN_VALUE?0:te.niceMin,Se=te.result.reduce(function(Ce,Be){var De,_e;return((De=String(de(Ce,q)))===null||De===void 0?void 0:De.length)>((_e=String(de(Be,q)))===null||_e===void 0?void 0:_e.length)?Ce:Be},xe),ke=Se=de(Se,q);if(Se!==void 0&&Se.length!==0||(Se=te.niceMax),p.globals.isBarHorizontal){_=0;var Re=p.globals.labels.slice();Se=F.getLargestStringFromArr(Re),Se=de(Se,{seriesIndex:B,dataPointIndex:-1,w:p}),ke=h.dCtx.dimHelpers.getLargestStringFromMultiArr(Se,Re)}var Ge=new z(h.dCtx.ctx),Fe="rotate(".concat(T.labels.rotate," 0 0)"),st=Ge.getTextRects(Se,T.labels.style.fontSize,T.labels.style.fontFamily,Fe,!1),se=st;Se!==ke&&(se=Ge.getTextRects(ke,T.labels.style.fontSize,T.labels.style.fontFamily,Fe,!1)),S.push({width:(ue>se.width||ue>st.width?ue:se.width>st.width?se.width:st.width)+_,height:se.height>st.height?se.height:st.height})}else S.push({width:0,height:0})}),S}},{key:"getyAxisTitleCoords",value:function(){var h=this,p=this.w,S=[];return p.config.yaxis.map(function(_,k){if(_.show&&_.title.text!==void 0){var T=new z(h.dCtx.ctx),B="rotate(".concat(_.title.rotate," 0 0)"),q=T.getTextRects(_.title.text,_.title.style.fontSize,_.title.style.fontFamily,B,!1);S.push({width:q.width,height:q.height})}else S.push({width:0,height:0})}),S}},{key:"getTotalYAxisWidth",value:function(){var h=this.w,p=0,S=0,_=0,k=h.globals.yAxisScale.length>1?10:0,T=new pe(this.dCtx.ctx),B=function(q,te){var ue=h.config.yaxis[te].floating,de=0;q.width>0&&!ue?(de=q.width+k,function(xe){return h.globals.ignoreYAxisIndexes.indexOf(xe)>-1}(te)&&(de=de-q.width-k)):de=ue||T.isYAxisHidden(te)?0:5,h.config.yaxis[te].opposite?_+=de:S+=de,p+=de};return h.globals.yLabelsCoords.map(function(q,te){B(q,te)}),h.globals.yTitleCoords.map(function(q,te){B(q,te)}),h.globals.isBarHorizontal&&!h.config.yaxis[0].floating&&(p=h.globals.yLabelsCoords[0].width+h.globals.yTitleCoords[0].width+15),this.dCtx.yAxisWidthLeft=S,this.dCtx.yAxisWidthRight=_,p}}]),Ee}(),qe=function(){function Ee(h){s(this,Ee),this.w=h.w,this.dCtx=h}return o(Ee,[{key:"gridPadForColumnsInNumericAxis",value:function(h){var p=this.w,S=p.config,_=p.globals;if(_.noData||_.collapsedSeries.length+_.ancillaryCollapsedSeries.length===S.series.length)return 0;var k=function(Se){return["bar","rangeBar","candlestick","boxPlot"].includes(Se)},T=S.chart.type,B=0,q=k(T)?S.series.length:1;_.comboBarCount>0&&(q=_.comboBarCount),_.collapsedSeries.forEach(function(Se){k(Se.type)&&(q-=1)}),S.chart.stacked&&(q=1);var te=k(T)||_.comboBarCount>0,ue=Math.abs(_.initialMaxX-_.initialMinX);if(te&&_.isXNumeric&&!_.isBarHorizontal&&q>0&&ue!==0){ue<=3&&(ue=_.dataPoints);var de=ue/h,xe=_.minXDiff&&_.minXDiff/de>0?_.minXDiff/de:0;xe>h/2&&(xe/=2),(B=xe*parseInt(S.plotOptions.bar.columnWidth,10)/100)<1&&(B=1),_.barPadForNumericAxis=B}return B}},{key:"gridPadFortitleSubtitle",value:function(){var h=this,p=this.w,S=p.globals,_=this.dCtx.isSparkline||!S.axisCharts?0:10;["title","subtitle"].forEach(function(B){p.config[B].text!==void 0?_+=p.config[B].margin:_+=h.dCtx.isSparkline||!S.axisCharts?0:5}),!p.config.legend.show||p.config.legend.position!=="bottom"||p.config.legend.floating||S.axisCharts||(_+=10);var k=this.dCtx.dimHelpers.getTitleSubtitleCoords("title"),T=this.dCtx.dimHelpers.getTitleSubtitleCoords("subtitle");S.gridHeight-=k.height+T.height+_,S.translateY+=k.height+T.height+_}},{key:"setGridXPosForDualYAxis",value:function(h,p){var S=this.w,_=new pe(this.dCtx.ctx);S.config.yaxis.forEach(function(k,T){S.globals.ignoreYAxisIndexes.indexOf(T)!==-1||k.floating||_.isYAxisHidden(T)||(k.opposite&&(S.globals.translateX-=p[T].width+h[T].width+parseInt(k.labels.style.fontSize,10)/1.2+12),S.globals.translateX<2&&(S.globals.translateX=2))})}}]),Ee}(),Ye=function(){function Ee(h){s(this,Ee),this.ctx=h,this.w=h.w,this.lgRect={},this.yAxisWidth=0,this.yAxisWidthLeft=0,this.yAxisWidthRight=0,this.xAxisHeight=0,this.isSparkline=this.w.config.chart.sparkline.enabled,this.dimHelpers=new Ke(this),this.dimYAxis=new $t(this),this.dimXAxis=new Bt(this),this.dimGrid=new qe(this),this.lgWidthForSideLegends=0,this.gridPad=this.w.config.grid.padding,this.xPadRight=0,this.xPadLeft=0}return o(Ee,[{key:"plotCoords",value:function(){var h=this,p=this.w,S=p.globals;this.lgRect=this.dimHelpers.getLegendsRect(),this.datalabelsCoords={width:0,height:0};var _=Array.isArray(p.config.stroke.width)?Math.max.apply(Math,N(p.config.stroke.width)):p.config.stroke.width;this.isSparkline&&((p.config.markers.discrete.length>0||p.config.markers.size>0)&&Object.entries(this.gridPad).forEach(function(T){var B=C(T,2),q=B[0],te=B[1];h.gridPad[q]=Math.max(te,h.w.globals.markers.largestSize/1.5)}),this.gridPad.top=Math.max(_/2,this.gridPad.top),this.gridPad.bottom=Math.max(_/2,this.gridPad.bottom)),S.axisCharts?this.setDimensionsForAxisCharts():this.setDimensionsForNonAxisCharts(),this.dimGrid.gridPadFortitleSubtitle(),S.gridHeight=S.gridHeight-this.gridPad.top-this.gridPad.bottom,S.gridWidth=S.gridWidth-this.gridPad.left-this.gridPad.right-this.xPadRight-this.xPadLeft;var k=this.dimGrid.gridPadForColumnsInNumericAxis(S.gridWidth);S.gridWidth=S.gridWidth-2*k,S.translateX=S.translateX+this.gridPad.left+this.xPadLeft+(k>0?k:0),S.translateY=S.translateY+this.gridPad.top}},{key:"setDimensionsForAxisCharts",value:function(){var h=this,p=this.w,S=p.globals,_=this.dimYAxis.getyAxisLabelsCoords(),k=this.dimYAxis.getyAxisTitleCoords();S.isSlopeChart&&(this.datalabelsCoords=this.dimHelpers.getDatalabelsRect()),p.globals.yLabelsCoords=[],p.globals.yTitleCoords=[],p.config.yaxis.map(function(Se,ke){p.globals.yLabelsCoords.push({width:_[ke].width,index:ke}),p.globals.yTitleCoords.push({width:k[ke].width,index:ke})}),this.yAxisWidth=this.dimYAxis.getTotalYAxisWidth();var T=this.dimXAxis.getxAxisLabelsCoords(),B=this.dimXAxis.getxAxisGroupLabelsCoords(),q=this.dimXAxis.getxAxisTitleCoords();this.conditionalChecksForAxisCoords(T,q,B),S.translateXAxisY=p.globals.rotateXLabels?this.xAxisHeight/8:-4,S.translateXAxisX=p.globals.rotateXLabels&&p.globals.isXNumeric&&p.config.xaxis.labels.rotate<=-45?-this.xAxisWidth/4:0,p.globals.isBarHorizontal&&(S.rotateXLabels=!1,S.translateXAxisY=parseInt(p.config.xaxis.labels.style.fontSize,10)/1.5*-1),S.translateXAxisY=S.translateXAxisY+p.config.xaxis.labels.offsetY,S.translateXAxisX=S.translateXAxisX+p.config.xaxis.labels.offsetX;var te=this.yAxisWidth,ue=this.xAxisHeight;S.xAxisLabelsHeight=this.xAxisHeight-q.height,S.xAxisGroupLabelsHeight=S.xAxisLabelsHeight-T.height,S.xAxisLabelsWidth=this.xAxisWidth,S.xAxisHeight=this.xAxisHeight;var de=10;(p.config.chart.type==="radar"||this.isSparkline)&&(te=0,ue=0),this.isSparkline&&(this.lgRect={height:0,width:0}),(this.isSparkline||p.config.chart.type==="treemap")&&(te=0,ue=0,de=0),this.isSparkline||p.config.chart.type==="treemap"||this.dimXAxis.additionalPaddingXLabels(T);var xe=function(){S.translateX=te+h.datalabelsCoords.width,S.gridHeight=S.svgHeight-h.lgRect.height-ue-(h.isSparkline||p.config.chart.type==="treemap"?0:p.globals.rotateXLabels?10:15),S.gridWidth=S.svgWidth-te-2*h.datalabelsCoords.width};switch(p.config.xaxis.position==="top"&&(de=S.xAxisHeight-p.config.xaxis.axisTicks.height-5),p.config.legend.position){case"bottom":S.translateY=de,xe();break;case"top":S.translateY=this.lgRect.height+de,xe();break;case"left":S.translateY=de,S.translateX=this.lgRect.width+te+this.datalabelsCoords.width,S.gridHeight=S.svgHeight-ue-12,S.gridWidth=S.svgWidth-this.lgRect.width-te-2*this.datalabelsCoords.width;break;case"right":S.translateY=de,S.translateX=te+this.datalabelsCoords.width,S.gridHeight=S.svgHeight-ue-12,S.gridWidth=S.svgWidth-this.lgRect.width-te-2*this.datalabelsCoords.width-5;break;default:throw new Error("Legend position not supported")}this.dimGrid.setGridXPosForDualYAxis(k,_),new ut(this.ctx).setYAxisXPosition(_,k)}},{key:"setDimensionsForNonAxisCharts",value:function(){var h=this.w,p=h.globals,S=h.config,_=0;h.config.legend.show&&!h.config.legend.floating&&(_=20);var k=S.chart.type==="pie"||S.chart.type==="polarArea"||S.chart.type==="donut"?"pie":"radialBar",T=S.plotOptions[k].offsetY,B=S.plotOptions[k].offsetX;if(!S.legend.show||S.legend.floating){p.gridHeight=p.svgHeight;var q=p.dom.elWrap.getBoundingClientRect().width;return p.gridWidth=Math.min(q,p.gridHeight),p.translateY=T,void(p.translateX=B+(p.svgWidth-p.gridWidth)/2)}switch(S.legend.position){case"bottom":p.gridHeight=p.svgHeight-this.lgRect.height,p.gridWidth=p.svgWidth,p.translateY=T-10,p.translateX=B+(p.svgWidth-p.gridWidth)/2;break;case"top":p.gridHeight=p.svgHeight-this.lgRect.height,p.gridWidth=p.svgWidth,p.translateY=this.lgRect.height+T+10,p.translateX=B+(p.svgWidth-p.gridWidth)/2;break;case"left":p.gridWidth=p.svgWidth-this.lgRect.width-_,p.gridHeight=S.chart.height!=="auto"?p.svgHeight:p.gridWidth,p.translateY=T,p.translateX=B+this.lgRect.width+_;break;case"right":p.gridWidth=p.svgWidth-this.lgRect.width-_-5,p.gridHeight=S.chart.height!=="auto"?p.svgHeight:p.gridWidth,p.translateY=T,p.translateX=B+10;break;default:throw new Error("Legend position not supported")}}},{key:"conditionalChecksForAxisCoords",value:function(h,p,S){var _=this.w,k=_.globals.hasXaxisGroups?2:1,T=S.height+h.height+p.height,B=_.globals.isMultiLineX?1.2:_.globals.LINE_HEIGHT_RATIO,q=_.globals.rotateXLabels?22:10,te=_.globals.rotateXLabels&&_.config.legend.position==="bottom"?10:0;this.xAxisHeight=T*B+k*q+te,this.xAxisWidth=h.width,this.xAxisHeight-p.height>_.config.xaxis.labels.maxHeight&&(this.xAxisHeight=_.config.xaxis.labels.maxHeight),_.config.xaxis.labels.minHeight&&this.xAxisHeight<_.config.xaxis.labels.minHeight&&(this.xAxisHeight=_.config.xaxis.labels.minHeight),_.config.xaxis.floating&&(this.xAxisHeight=0);var ue=0,de=0;_.config.yaxis.forEach(function(xe){ue+=xe.labels.minWidth,de+=xe.labels.maxWidth}),this.yAxisWidth<ue&&(this.yAxisWidth=ue),this.yAxisWidth>de&&(this.yAxisWidth=de)}}]),Ee}(),ht=function(){function Ee(h){s(this,Ee),this.w=h.w,this.lgCtx=h}return o(Ee,[{key:"getLegendStyles",value:function(){var h,p,S,_=document.createElement("style");_.setAttribute("type","text/css");var k=((h=this.lgCtx.ctx)===null||h===void 0||(p=h.opts)===null||p===void 0||(S=p.chart)===null||S===void 0?void 0:S.nonce)||this.w.config.chart.nonce;k&&_.setAttribute("nonce",k);var T=document.createTextNode(`
.apexcharts-flip-y {
transform: scaleY(-1) translateY(-100%);
transform-origin: top;
transform-box: fill-box;
}
.apexcharts-flip-x {
transform: scaleX(-1);
transform-origin: center;
transform-box: fill-box;
}
.apexcharts-legend {
display: flex;
overflow: auto;
padding: 0 10px;
}
.apexcharts-legend.apx-legend-position-bottom, .apexcharts-legend.apx-legend-position-top {
flex-wrap: wrap
}
.apexcharts-legend.apx-legend-position-right, .apexcharts-legend.apx-legend-position-left {
flex-direction: column;
bottom: 0;
}
.apexcharts-legend.apx-legend-position-bottom.apexcharts-align-left, .apexcharts-legend.apx-legend-position-top.apexcharts-align-left, .apexcharts-legend.apx-legend-position-right, .apexcharts-legend.apx-legend-position-left {
justify-content: flex-start;
}
.apexcharts-legend.apx-legend-position-bottom.apexcharts-align-center, .apexcharts-legend.apx-legend-position-top.apexcharts-align-center {
justify-content: center;
}
.apexcharts-legend.apx-legend-position-bottom.apexcharts-align-right, .apexcharts-legend.apx-legend-position-top.apexcharts-align-right {
justify-content: flex-end;
}
.apexcharts-legend-series {
cursor: pointer;
line-height: normal;
display: flex;
align-items: center;
}
.apexcharts-legend-text {
position: relative;
font-size: 14px;
}
.apexcharts-legend-text *, .apexcharts-legend-marker * {
pointer-events: none;
}
.apexcharts-legend-marker {
position: relative;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
margin-right: 1px;
}
.apexcharts-legend-series.apexcharts-no-click {
cursor: auto;
}
.apexcharts-legend .apexcharts-hidden-zero-series, .apexcharts-legend .apexcharts-hidden-null-series {
display: none !important;
}
.apexcharts-inactive-legend {
opacity: 0.45;
}`);return _.appendChild(T),_}},{key:"getLegendDimensions",value:function(){var h=this.w.globals.dom.baseEl.querySelector(".apexcharts-legend").getBoundingClientRect(),p=h.width;return{clwh:h.height,clww:p}}},{key:"appendToForeignObject",value:function(){this.w.globals.dom.elLegendForeign.appendChild(this.getLegendStyles())}},{key:"toggleDataSeries",value:function(h,p){var S=this,_=this.w;if(_.globals.axisCharts||_.config.chart.type==="radialBar"){_.globals.resized=!0;var k=null,T=null;_.globals.risingSeries=[],_.globals.axisCharts?(k=_.globals.dom.baseEl.querySelector(".apexcharts-series[data\\:realIndex='".concat(h,"']")),T=parseInt(k.getAttribute("data:realIndex"),10)):(k=_.globals.dom.baseEl.querySelector(".apexcharts-series[rel='".concat(h+1,"']")),T=parseInt(k.getAttribute("rel"),10)-1),p?[{cs:_.globals.collapsedSeries,csi:_.globals.collapsedSeriesIndices},{cs:_.globals.ancillaryCollapsedSeries,csi:_.globals.ancillaryCollapsedSeriesIndices}].forEach(function(ue){S.riseCollapsedSeries(ue.cs,ue.csi,T)}):this.hideSeries({seriesEl:k,realIndex:T})}else{var B=_.globals.dom.Paper.select(" .apexcharts-series[rel='".concat(h+1,"'] path")),q=_.config.chart.type;if(q==="pie"||q==="polarArea"||q==="donut"){var te=_.config.plotOptions.pie.donut.labels;new z(this.lgCtx.ctx).pathMouseDown(B.members[0],null),this.lgCtx.ctx.pie.printDataLabelsInner(B.members[0].node,te)}B.fire("click")}}},{key:"getSeriesAfterCollapsing",value:function(h){var p=h.realIndex,S=this.w,_=S.globals,k=F.clone(S.config.series);if(_.axisCharts){var T=S.config.yaxis[_.seriesYAxisReverseMap[p]],B={index:p,data:k[p].data.slice(),type:k[p].type||S.config.chart.type};if(T&&T.show&&T.showAlways)_.ancillaryCollapsedSeriesIndices.indexOf(p)<0&&(_.ancillaryCollapsedSeries.push(B),_.ancillaryCollapsedSeriesIndices.push(p));else if(_.collapsedSeriesIndices.indexOf(p)<0){_.collapsedSeries.push(B),_.collapsedSeriesIndices.push(p);var q=_.risingSeries.indexOf(p);_.risingSeries.splice(q,1)}}else _.collapsedSeries.push({index:p,data:k[p]}),_.collapsedSeriesIndices.push(p);return _.allSeriesCollapsed=_.collapsedSeries.length+_.ancillaryCollapsedSeries.length===S.config.series.length,this._getSeriesBasedOnCollapsedState(k)}},{key:"hideSeries",value:function(h){for(var p=h.seriesEl,S=h.realIndex,_=this.w,k=this.getSeriesAfterCollapsing({realIndex:S}),T=p.childNodes,B=0;B<T.length;B++)T[B].classList.contains("apexcharts-series-markers-wrap")&&(T[B].classList.contains("apexcharts-hide")?T[B].classList.remove("apexcharts-hide"):T[B].classList.add("apexcharts-hide"));this.lgCtx.ctx.updateHelpers._updateSeries(k,_.config.chart.animations.dynamicAnimation.enabled)}},{key:"riseCollapsedSeries",value:function(h,p,S){var _=this.w,k=F.clone(_.config.series);if(h.length>0){for(var T=0;T<h.length;T++)h[T].index===S&&(_.globals.axisCharts?k[S].data=h[T].data.slice():k[S]=h[T].data,k[S].hidden=!1,h.splice(T,1),p.splice(T,1),_.globals.risingSeries.push(S));k=this._getSeriesBasedOnCollapsedState(k),this.lgCtx.ctx.updateHelpers._updateSeries(k,_.config.chart.animations.dynamicAnimation.enabled)}}},{key:"_getSeriesBasedOnCollapsedState",value:function(h){var p=this.w,S=0;return p.globals.axisCharts?h.forEach(function(_,k){p.globals.collapsedSeriesIndices.indexOf(k)<0&&p.globals.ancillaryCollapsedSeriesIndices.indexOf(k)<0||(h[k].data=[],S++)}):h.forEach(function(_,k){!p.globals.collapsedSeriesIndices.indexOf(k)<0&&(h[k]=0,S++)}),p.globals.allSeriesCollapsed=S===h.length,h}}]),Ee}(),Zt=function(){function Ee(h){s(this,Ee),this.ctx=h,this.w=h.w,this.onLegendClick=this.onLegendClick.bind(this),this.onLegendHovered=this.onLegendHovered.bind(this),this.isBarsDistributed=this.w.config.chart.type==="bar"&&this.w.config.plotOptions.bar.distributed&&this.w.config.series.length===1,this.legendHelpers=new ht(this)}return o(Ee,[{key:"init",value:function(){var h=this.w,p=h.globals,S=h.config,_=S.legend.showForSingleSeries&&p.series.length===1||this.isBarsDistributed||p.series.length>1;if(this.legendHelpers.appendToForeignObject(),(_||!p.axisCharts)&&S.legend.show){for(;p.dom.elLegendWrap.firstChild;)p.dom.elLegendWrap.removeChild(p.dom.elLegendWrap.firstChild);this.drawLegends(),S.legend.position==="bottom"||S.legend.position==="top"?this.legendAlignHorizontal():S.legend.position!=="right"&&S.legend.position!=="left"||this.legendAlignVertical()}}},{key:"createLegendMarker",value:function(h){var p=h.i,S=h.fillcolor,_=this.w,k=document.createElement("span");k.classList.add("apexcharts-legend-marker");var T=_.config.legend.markers.shape||_.config.markers.shape,B=T;Array.isArray(T)&&(B=T[p]);var q=Array.isArray(_.config.legend.markers.size)?parseFloat(_.config.legend.markers.size[p]):parseFloat(_.config.legend.markers.size),te=Array.isArray(_.config.legend.markers.offsetX)?parseFloat(_.config.legend.markers.offsetX[p]):parseFloat(_.config.legend.markers.offsetX),ue=Array.isArray(_.config.legend.markers.offsetY)?parseFloat(_.config.legend.markers.offsetY[p]):parseFloat(_.config.legend.markers.offsetY),de=Array.isArray(_.config.legend.markers.strokeWidth)?parseFloat(_.config.legend.markers.strokeWidth[p]):parseFloat(_.config.legend.markers.strokeWidth),xe=k.style;if(xe.height=2*(q+de)+"px",xe.width=2*(q+de)+"px",xe.left=te+"px",xe.top=ue+"px",_.config.legend.markers.customHTML)xe.background="transparent",xe.color=S[p],Array.isArray(_.config.legend.markers.customHTML)?_.config.legend.markers.customHTML[p]&&(k.innerHTML=_.config.legend.markers.customHTML[p]()):k.innerHTML=_.config.legend.markers.customHTML();else{var Se=new ve(this.ctx).getMarkerConfig({cssClass:"apexcharts-legend-marker apexcharts-marker apexcharts-marker-".concat(B),seriesIndex:p,strokeWidth:de,size:q}),ke=SVG(k).size("100%","100%"),Re=new z(this.ctx).drawMarker(0,0,v(v({},Se),{},{pointFillColor:Array.isArray(S)?S[p]:Se.pointFillColor,shape:B}));SVG.select(".apexcharts-legend-marker.apexcharts-marker").members.forEach(function(Ge){Ge.node.classList.contains("apexcharts-marker-triangle")?Ge.node.style.transform="translate(50%, 45%)":Ge.node.style.transform="translate(50%, 50%)"}),ke.add(Re)}return k}},{key:"drawLegends",value:function(){var h=this,p=this.w,S=p.config.legend.fontFamily,_=p.globals.seriesNames,k=p.config.legend.markers.fillColors?p.config.legend.markers.fillColors.slice():p.globals.colors.slice();if(p.config.chart.type==="heatmap"){var T=p.config.plotOptions.heatmap.colorScale.ranges;_=T.map(function(Be){return Be.name?Be.name:Be.from+" - "+Be.to}),k=T.map(function(Be){return Be.color})}else this.isBarsDistributed&&(_=p.globals.labels.slice());p.config.legend.customLegendItems.length&&(_=p.config.legend.customLegendItems);for(var B=p.globals.legendFormatter,q=p.config.legend.inverseOrder,te=q?_.length-1:0;q?te>=0:te<=_.length-1;q?te--:te++){var ue,de=B(_[te],{seriesIndex:te,w:p}),xe=!1,Se=!1;if(p.globals.collapsedSeries.length>0)for(var ke=0;ke<p.globals.collapsedSeries.length;ke++)p.globals.collapsedSeries[ke].index===te&&(xe=!0);if(p.globals.ancillaryCollapsedSeriesIndices.length>0)for(var Re=0;Re<p.globals.ancillaryCollapsedSeriesIndices.length;Re++)p.globals.ancillaryCollapsedSeriesIndices[Re]===te&&(Se=!0);var Ge=this.createLegendMarker({i:te,fillcolor:k});z.setAttrs(Ge,{rel:te+1,"data:collapsed":xe||Se}),(xe||Se)&&Ge.classList.add("apexcharts-inactive-legend");var Fe=document.createElement("div"),st=document.createElement("span");st.classList.add("apexcharts-legend-text"),st.innerHTML=Array.isArray(de)?de.join(" "):de;var se=p.config.legend.labels.useSeriesColors?p.globals.colors[te]:Array.isArray(p.config.legend.labels.colors)?(ue=p.config.legend.labels.colors)===null||ue===void 0?void 0:ue[te]:p.config.legend.labels.colors;se||(se=p.config.chart.foreColor),st.style.color=se,st.style.fontSize=parseFloat(p.config.legend.fontSize)+"px",st.style.fontWeight=p.config.legend.fontWeight,st.style.fontFamily=S||p.config.chart.fontFamily,z.setAttrs(st,{rel:te+1,i:te,"data:default-text":encodeURIComponent(de),"data:collapsed":xe||Se}),Fe.appendChild(Ge),Fe.appendChild(st);var Ce=new Q(this.ctx);p.config.legend.showForZeroSeries||Ce.getSeriesTotalByIndex(te)===0&&Ce.seriesHaveSameValues(te)&&!Ce.isSeriesNull(te)&&p.globals.collapsedSeriesIndices.indexOf(te)===-1&&p.globals.ancillaryCollapsedSeriesIndices.indexOf(te)===-1&&Fe.classList.add("apexcharts-hidden-zero-series"),p.config.legend.showForNullSeries||Ce.isSeriesNull(te)&&p.globals.collapsedSeriesIndices.indexOf(te)===-1&&p.globals.ancillaryCollapsedSeriesIndices.indexOf(te)===-1&&Fe.classList.add("apexcharts-hidden-null-series"),p.globals.dom.elLegendWrap.appendChild(Fe),p.globals.dom.elLegendWrap.classList.add("apexcharts-align-".concat(p.config.legend.horizontalAlign)),p.globals.dom.elLegendWrap.classList.add("apx-legend-position-"+p.config.legend.position),Fe.classList.add("apexcharts-legend-series"),Fe.style.margin="".concat(p.config.legend.itemMargin.vertical,"px ").concat(p.config.legend.itemMargin.horizontal,"px"),p.globals.dom.elLegendWrap.style.width=p.config.legend.width?p.config.legend.width+"px":"",p.globals.dom.elLegendWrap.style.height=p.config.legend.height?p.config.legend.height+"px":"",z.setAttrs(Fe,{rel:te+1,seriesName:F.escapeString(_[te]),"data:collapsed":xe||Se}),(xe||Se)&&Fe.classList.add("apexcharts-inactive-legend"),p.config.legend.onItemClick.toggleDataSeries||Fe.classList.add("apexcharts-no-click")}p.globals.dom.elWrap.addEventListener("click",h.onLegendClick,!0),p.config.legend.onItemHover.highlightDataSeries&&p.config.legend.customLegendItems.length===0&&(p.globals.dom.elWrap.addEventListener("mousemove",h.onLegendHovered,!0),p.globals.dom.elWrap.addEventListener("mouseout",h.onLegendHovered,!0))}},{key:"setLegendWrapXY",value:function(h,p){var S=this.w,_=S.globals.dom.elLegendWrap,k=_.clientHeight,T=0,B=0;if(S.config.legend.position==="bottom")B=S.globals.svgHeight-Math.min(k,S.globals.svgHeight/2)-5;else if(S.config.legend.position==="top"){var q=new Ye(this.ctx),te=q.dimHelpers.getTitleSubtitleCoords("title").height,ue=q.dimHelpers.getTitleSubtitleCoords("subtitle").height;B=(te>0?te-10:0)+(ue>0?ue-10:0)}_.style.position="absolute",T=T+h+S.config.legend.offsetX,B=B+p+S.config.legend.offsetY,_.style.left=T+"px",_.style.top=B+"px",S.config.legend.position==="right"&&(_.style.left="auto",_.style.right=25+S.config.legend.offsetX+"px"),["width","height"].forEach(function(de){_.style[de]&&(_.style[de]=parseInt(S.config.legend[de],10)+"px")})}},{key:"legendAlignHorizontal",value:function(){var h=this.w;h.globals.dom.elLegendWrap.style.right=0;var p=new Ye(this.ctx),S=p.dimHelpers.getTitleSubtitleCoords("title"),_=p.dimHelpers.getTitleSubtitleCoords("subtitle"),k=0;h.config.legend.position==="top"&&(k=S.height+_.height+h.config.title.margin+h.config.subtitle.margin-10),this.setLegendWrapXY(20,k)}},{key:"legendAlignVertical",value:function(){var h=this.w,p=this.legendHelpers.getLegendDimensions(),S=0;h.config.legend.position==="left"&&(S=20),h.config.legend.position==="right"&&(S=h.globals.svgWidth-p.clww-10),this.setLegendWrapXY(S,20)}},{key:"onLegendHovered",value:function(h){var p=this.w,S=h.target.classList.contains("apexcharts-legend-series")||h.target.classList.contains("apexcharts-legend-text")||h.target.classList.contains("apexcharts-legend-marker");if(p.config.chart.type==="heatmap"||this.isBarsDistributed){if(S){var _=parseInt(h.target.getAttribute("rel"),10)-1;this.ctx.events.fireEvent("legendHover",[this.ctx,_,this.w]),new Le(this.ctx).highlightRangeInSeries(h,h.target)}}else!h.target.classList.contains("apexcharts-inactive-legend")&&S&&new Le(this.ctx).toggleSeriesOnHover(h,h.target)}},{key:"onLegendClick",value:function(h){var p=this.w;if(!p.config.legend.customLegendItems.length&&(h.target.classList.contains("apexcharts-legend-series")||h.target.classList.contains("apexcharts-legend-text")||h.target.classList.contains("apexcharts-legend-marker"))){var S=parseInt(h.target.getAttribute("rel"),10)-1,_=h.target.getAttribute("data:collapsed")==="true",k=this.w.config.chart.events.legendClick;typeof k=="function"&&k(this.ctx,S,this.w),this.ctx.events.fireEvent("legendClick",[this.ctx,S,this.w]);var T=this.w.config.legend.markers.onClick;typeof T=="function"&&h.target.classList.contains("apexcharts-legend-marker")&&(T(this.ctx,S,this.w),this.ctx.events.fireEvent("legendMarkerClick",[this.ctx,S,this.w])),p.config.chart.type!=="treemap"&&p.config.chart.type!=="heatmap"&&!this.isBarsDistributed&&p.config.legend.onItemClick.toggleDataSeries&&this.legendHelpers.toggleDataSeries(S,_)}}}]),Ee}(),zt=function(){function Ee(h){s(this,Ee),this.ctx=h,this.w=h.w;var p=this.w;this.ev=this.w.config.chart.events,this.selectedClass="apexcharts-selected",this.localeValues=this.w.globals.locale.toolbar,this.minX=p.globals.minX,this.maxX=p.globals.maxX}return o(Ee,[{key:"createToolbar",value:function(){var h=this,p=this.w,S=function(){return document.createElement("div")},_=S();if(_.setAttribute("class","apexcharts-toolbar"),_.style.top=p.config.chart.toolbar.offsetY+"px",_.style.right=3-p.config.chart.toolbar.offsetX+"px",p.globals.dom.elWrap.appendChild(_),this.elZoom=S(),this.elZoomIn=S(),this.elZoomOut=S(),this.elPan=S(),this.elSelection=S(),this.elZoomReset=S(),this.elMenuIcon=S(),this.elMenu=S(),this.elCustomIcons=[],this.t=p.config.chart.toolbar.tools,Array.isArray(this.t.customIcons))for(var k=0;k<this.t.customIcons.length;k++)this.elCustomIcons.push(S());var T=[],B=function(de,xe,Se){var ke=de.toLowerCase();h.t[ke]&&p.config.chart.zoom.enabled&&T.push({el:xe,icon:typeof h.t[ke]=="string"?h.t[ke]:Se,title:h.localeValues[de],class:"apexcharts-".concat(ke,"-icon")})};B("zoomIn",this.elZoomIn,`<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
<path d="M0 0h24v24H0z" fill="none"/>
<path d="M13 7h-2v4H7v2h4v4h2v-4h4v-2h-4V7zm-1-5C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8z"/>
</svg>
`),B("zoomOut",this.elZoomOut,`<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
<path d="M0 0h24v24H0z" fill="none"/>
<path d="M7 11v2h10v-2H7zm5-9C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8z"/>
</svg>
`);var q=function(de){h.t[de]&&p.config.chart[de].enabled&&T.push({el:de==="zoom"?h.elZoom:h.elSelection,icon:typeof h.t[de]=="string"?h.t[de]:de==="zoom"?`<svg xmlns="http://www.w3.org/2000/svg" fill="#000000" height="24" viewBox="0 0 24 24" width="24">
<path d="M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"/>
<path d="M0 0h24v24H0V0z" fill="none"/>
<path d="M12 10h-2v2H9v-2H7V9h2V7h1v2h2v1z"/>
</svg>`:`<svg fill="#6E8192" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg">
<path d="M0 0h24v24H0z" fill="none"/>
<path d="M3 5h2V3c-1.1 0-2 .9-2 2zm0 8h2v-2H3v2zm4 8h2v-2H7v2zM3 9h2V7H3v2zm10-6h-2v2h2V3zm6 0v2h2c0-1.1-.9-2-2-2zM5 21v-2H3c0 1.1.9 2 2 2zm-2-4h2v-2H3v2zM9 3H7v2h2V3zm2 18h2v-2h-2v2zm8-8h2v-2h-2v2zm0 8c1.1 0 2-.9 2-2h-2v2zm0-12h2V7h-2v2zm0 8h2v-2h-2v2zm-4 4h2v-2h-2v2zm0-16h2V3h-2v2z"/>
</svg>`,title:h.localeValues[de==="zoom"?"selectionZoom":"selection"],class:p.globals.isTouchDevice?"apexcharts-element-hidden":"apexcharts-".concat(de,"-icon")})};q("zoom"),q("selection"),this.t.pan&&p.config.chart.zoom.enabled&&T.push({el:this.elPan,icon:typeof this.t.pan=="string"?this.t.pan:`<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="#000000" height="24" viewBox="0 0 24 24" width="24">
<defs>
<path d="M0 0h24v24H0z" id="a"/>
</defs>
<clipPath id="b">
<use overflow="visible" xlink:href="#a"/>
</clipPath>
<path clip-path="url(#b)" d="M23 5.5V20c0 2.2-1.8 4-4 4h-7.3c-1.08 0-2.1-.43-2.85-1.19L1 14.83s1.26-1.23 1.3-1.25c.22-.19.49-.29.79-.29.22 0 .42.06.6.16.04.01 4.31 2.46 4.31 2.46V4c0-.83.67-1.5 1.5-1.5S11 3.17 11 4v7h1V1.5c0-.83.67-1.5 1.5-1.5S15 .67 15 1.5V11h1V2.5c0-.83.67-1.5 1.5-1.5s1.5.67 1.5 1.5V11h1V5.5c0-.83.67-1.5 1.5-1.5s1.5.67 1.5 1.5z"/>
</svg>`,title:this.localeValues.pan,class:p.globals.isTouchDevice?"apexcharts-element-hidden":"apexcharts-pan-icon"}),B("reset",this.elZoomReset,`<svg fill="#000000" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg">
<path d="M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z"/>
<path d="M0 0h24v24H0z" fill="none"/>
</svg>`),this.t.download&&T.push({el:this.elMenuIcon,icon:typeof this.t.download=="string"?this.t.download:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0V0z"/><path d="M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z"/></svg>',title:this.localeValues.menu,class:"apexcharts-menu-icon"});for(var te=0;te<this.elCustomIcons.length;te++)T.push({el:this.elCustomIcons[te],icon:this.t.customIcons[te].icon,title:this.t.customIcons[te].title,index:this.t.customIcons[te].index,class:"apexcharts-toolbar-custom-icon "+this.t.customIcons[te].class});T.forEach(function(de,xe){de.index&&F.moveIndexInArray(T,xe,de.index)});for(var ue=0;ue<T.length;ue++)z.setAttrs(T[ue].el,{class:T[ue].class,title:T[ue].title}),T[ue].el.innerHTML=T[ue].icon,_.appendChild(T[ue].el);this._createHamburgerMenu(_),p.globals.zoomEnabled?this.elZoom.classList.add(this.selectedClass):p.globals.panEnabled?this.elPan.classList.add(this.selectedClass):p.globals.selectionEnabled&&this.elSelection.classList.add(this.selectedClass),this.addToolbarEventListeners()}},{key:"_createHamburgerMenu",value:function(h){this.elMenuItems=[],h.appendChild(this.elMenu),z.setAttrs(this.elMenu,{class:"apexcharts-menu"});for(var p=[{name:"exportSVG",title:this.localeValues.exportToSVG},{name:"exportPNG",title:this.localeValues.exportToPNG},{name:"exportCSV",title:this.localeValues.exportToCSV}],S=0;S<p.length;S++)this.elMenuItems.push(document.createElement("div")),this.elMenuItems[S].innerHTML=p[S].title,z.setAttrs(this.elMenuItems[S],{class:"apexcharts-menu-item ".concat(p[S].name),title:p[S].title}),this.elMenu.appendChild(this.elMenuItems[S])}},{key:"addToolbarEventListeners",value:function(){var h=this;this.elZoomReset.addEventListener("click",this.handleZoomReset.bind(this)),this.elSelection.addEventListener("click",this.toggleZoomSelection.bind(this,"selection")),this.elZoom.addEventListener("click",this.toggleZoomSelection.bind(this,"zoom")),this.elZoomIn.addEventListener("click",this.handleZoomIn.bind(this)),this.elZoomOut.addEventListener("click",this.handleZoomOut.bind(this)),this.elPan.addEventListener("click",this.togglePanning.bind(this)),this.elMenuIcon.addEventListener("click",this.toggleMenu.bind(this)),this.elMenuItems.forEach(function(S){S.classList.contains("exportSVG")?S.addEventListener("click",h.handleDownload.bind(h,"svg")):S.classList.contains("exportPNG")?S.addEventListener("click",h.handleDownload.bind(h,"png")):S.classList.contains("exportCSV")&&S.addEventListener("click",h.handleDownload.bind(h,"csv"))});for(var p=0;p<this.t.customIcons.length;p++)this.elCustomIcons[p].addEventListener("click",this.t.customIcons[p].click.bind(this,this.ctx,this.ctx.w))}},{key:"toggleZoomSelection",value:function(h){this.ctx.getSyncedCharts().forEach(function(p){p.ctx.toolbar.toggleOtherControls();var S=h==="selection"?p.ctx.toolbar.elSelection:p.ctx.toolbar.elZoom,_=h==="selection"?"selectionEnabled":"zoomEnabled";p.w.globals[_]=!p.w.globals[_],S.classList.contains(p.ctx.toolbar.selectedClass)?S.classList.remove(p.ctx.toolbar.selectedClass):S.classList.add(p.ctx.toolbar.selectedClass)})}},{key:"getToolbarIconsReference",value:function(){var h=this.w;this.elZoom||(this.elZoom=h.globals.dom.baseEl.querySelector(".apexcharts-zoom-icon")),this.elPan||(this.elPan=h.globals.dom.baseEl.querySelector(".apexcharts-pan-icon")),this.elSelection||(this.elSelection=h.globals.dom.baseEl.querySelector(".apexcharts-selection-icon"))}},{key:"enableZoomPanFromToolbar",value:function(h){this.toggleOtherControls(),h==="pan"?this.w.globals.panEnabled=!0:this.w.globals.zoomEnabled=!0;var p=h==="pan"?this.elPan:this.elZoom,S=h==="pan"?this.elZoom:this.elPan;p&&p.classList.add(this.selectedClass),S&&S.classList.remove(this.selectedClass)}},{key:"togglePanning",value:function(){this.ctx.getSyncedCharts().forEach(function(h){h.ctx.toolbar.toggleOtherControls(),h.w.globals.panEnabled=!h.w.globals.panEnabled,h.ctx.toolbar.elPan.classList.contains(h.ctx.toolbar.selectedClass)?h.ctx.toolbar.elPan.classList.remove(h.ctx.toolbar.selectedClass):h.ctx.toolbar.elPan.classList.add(h.ctx.toolbar.selectedClass)})}},{key:"toggleOtherControls",value:function(){var h=this,p=this.w;p.globals.panEnabled=!1,p.globals.zoomEnabled=!1,p.globals.selectionEnabled=!1,this.getToolbarIconsReference(),[this.elPan,this.elSelection,this.elZoom].forEach(function(S){S&&S.classList.remove(h.selectedClass)})}},{key:"handleZoomIn",value:function(){var h=this.w;h.globals.isRangeBar&&(this.minX=h.globals.minY,this.maxX=h.globals.maxY);var p=(this.minX+this.maxX)/2,S=(this.minX+p)/2,_=(this.maxX+p)/2,k=this._getNewMinXMaxX(S,_);h.globals.disableZoomIn||this.zoomUpdateOptions(k.minX,k.maxX)}},{key:"handleZoomOut",value:function(){var h=this.w;if(h.globals.isRangeBar&&(this.minX=h.globals.minY,this.maxX=h.globals.maxY),!(h.config.xaxis.type==="datetime"&&new Date(this.minX).getUTCFullYear()<1e3)){var p=(this.minX+this.maxX)/2,S=this.minX-(p-this.minX),_=this.maxX-(p-this.maxX),k=this._getNewMinXMaxX(S,_);h.globals.disableZoomOut||this.zoomUpdateOptions(k.minX,k.maxX)}}},{key:"_getNewMinXMaxX",value:function(h,p){var S=this.w.config.xaxis.convertedCatToNumeric;return{minX:S?Math.floor(h):h,maxX:S?Math.floor(p):p}}},{key:"zoomUpdateOptions",value:function(h,p){var S=this.w;if(h!==void 0||p!==void 0){if(!(S.config.xaxis.convertedCatToNumeric&&(h<1&&(h=1,p=S.globals.dataPoints),p-h<2))){var _={min:h,max:p},k=this.getBeforeZoomRange(_);k&&(_=k.xaxis);var T={xaxis:_},B=F.clone(S.globals.initialConfig.yaxis);S.config.chart.group||(T.yaxis=B),this.w.globals.zoomed=!0,this.ctx.updateHelpers._updateOptions(T,!1,this.w.config.chart.animations.dynamicAnimation.enabled),this.zoomCallback(_,B)}}else this.handleZoomReset()}},{key:"zoomCallback",value:function(h,p){typeof this.ev.zoomed=="function"&&this.ev.zoomed(this.ctx,{xaxis:h,yaxis:p})}},{key:"getBeforeZoomRange",value:function(h,p){var S=null;return typeof this.ev.beforeZoom=="function"&&(S=this.ev.beforeZoom(this,{xaxis:h,yaxis:p})),S}},{key:"toggleMenu",value:function(){var h=this;window.setTimeout(function(){h.elMenu.classList.contains("apexcharts-menu-open")?h.elMenu.classList.remove("apexcharts-menu-open"):h.elMenu.classList.add("apexcharts-menu-open")},0)}},{key:"handleDownload",value:function(h){var p=this.w,S=new $e(this.ctx);switch(h){case"svg":S.exportToSVG(this.ctx);break;case"png":S.exportToPng(this.ctx);break;case"csv":S.exportToCSV({series:p.config.series,columnDelimiter:p.config.chart.toolbar.export.csv.columnDelimiter})}}},{key:"handleZoomReset",value:function(h){this.ctx.getSyncedCharts().forEach(function(p){var S=p.w;if(S.globals.lastXAxis.min=S.globals.initialConfig.xaxis.min,S.globals.lastXAxis.max=S.globals.initialConfig.xaxis.max,p.updateHelpers.revertDefaultAxisMinMax(),typeof S.config.chart.events.beforeResetZoom=="function"){var _=S.config.chart.events.beforeResetZoom(p,S);_&&p.updateHelpers.revertDefaultAxisMinMax(_)}typeof S.config.chart.events.zoomed=="function"&&p.ctx.toolbar.zoomCallback({min:S.config.xaxis.min,max:S.config.xaxis.max}),S.globals.zoomed=!1;var k=p.ctx.series.emptyCollapsedSeries(F.clone(S.globals.initialSeries));p.updateHelpers._updateSeries(k,S.config.chart.animations.dynamicAnimation.enabled)})}},{key:"destroy",value:function(){this.elZoom=null,this.elZoomIn=null,this.elZoomOut=null,this.elPan=null,this.elSelection=null,this.elZoomReset=null,this.elMenuIcon=null}}]),Ee}(),Et=function(Ee){f(p,zt);var h=c(p);function p(S){var _;return s(this,p),(_=h.call(this,S)).ctx=S,_.w=S.w,_.dragged=!1,_.graphics=new z(_.ctx),_.eventList=["mousedown","mouseleave","mousemove","touchstart","touchmove","mouseup","touchend","wheel"],_.clientX=0,_.clientY=0,_.startX=0,_.endX=0,_.dragX=0,_.startY=0,_.endY=0,_.dragY=0,_.moveDirection="none",_.debounceTimer=null,_.debounceDelay=100,_.wheelDelay=400,_}return o(p,[{key:"init",value:function(S){var _=this,k=S.xyRatios,T=this.w,B=this;this.xyRatios=k,this.zoomRect=this.graphics.drawRect(0,0,0,0),this.selectionRect=this.graphics.drawRect(0,0,0,0),this.gridRect=T.globals.dom.baseEl.querySelector(".apexcharts-grid"),this.zoomRect.node.classList.add("apexcharts-zoom-rect"),this.selectionRect.node.classList.add("apexcharts-selection-rect"),T.globals.dom.elGraphical.add(this.zoomRect),T.globals.dom.elGraphical.add(this.selectionRect),T.config.chart.selection.type==="x"?this.slDraggableRect=this.selectionRect.draggable({minX:0,minY:0,maxX:T.globals.gridWidth,maxY:T.globals.gridHeight}).on("dragmove",this.selectionDragging.bind(this,"dragging")):T.config.chart.selection.type==="y"?this.slDraggableRect=this.selectionRect.draggable({minX:0,maxX:T.globals.gridWidth}).on("dragmove",this.selectionDragging.bind(this,"dragging")):this.slDraggableRect=this.selectionRect.draggable().on("dragmove",this.selectionDragging.bind(this,"dragging")),this.preselectedSelection(),this.hoverArea=T.globals.dom.baseEl.querySelector("".concat(T.globals.chartClass," .apexcharts-svg")),this.hoverArea.classList.add("apexcharts-zoomable"),this.eventList.forEach(function(q){_.hoverArea.addEventListener(q,B.svgMouseEvents.bind(B,k),{capture:!1,passive:!0})}),T.config.chart.zoom.allowMouseWheelZoom&&this.hoverArea.addEventListener("wheel",B.mouseWheelEvent.bind(B),{capture:!1,passive:!1})}},{key:"destroy",value:function(){this.slDraggableRect&&(this.slDraggableRect.draggable(!1),this.slDraggableRect.off(),this.selectionRect.off()),this.selectionRect=null,this.zoomRect=null,this.gridRect=null}},{key:"svgMouseEvents",value:function(S,_){var k=this.w,T=this,B=this.ctx.toolbar,q=k.globals.zoomEnabled?k.config.chart.zoom.type:k.config.chart.selection.type,te=k.config.chart.toolbar.autoSelected;if(_.shiftKey?(this.shiftWasPressed=!0,B.enableZoomPanFromToolbar(te==="pan"?"zoom":"pan")):this.shiftWasPressed&&(B.enableZoomPanFromToolbar(te),this.shiftWasPressed=!1),_.target){var ue,de=_.target.classList;if(_.target.parentNode&&_.target.parentNode!==null&&(ue=_.target.parentNode.classList),!(de.contains("apexcharts-selection-rect")||de.contains("apexcharts-legend-marker")||de.contains("apexcharts-legend-text")||ue&&ue.contains("apexcharts-toolbar"))){if(T.clientX=_.type==="touchmove"||_.type==="touchstart"?_.touches[0].clientX:_.type==="touchend"?_.changedTouches[0].clientX:_.clientX,T.clientY=_.type==="touchmove"||_.type==="touchstart"?_.touches[0].clientY:_.type==="touchend"?_.changedTouches[0].clientY:_.clientY,_.type==="mousedown"&&_.which===1){var xe=T.gridRect.getBoundingClientRect();T.startX=T.clientX-xe.left,T.startY=T.clientY-xe.top,T.dragged=!1,T.w.globals.mousedown=!0}if((_.type==="mousemove"&&_.which===1||_.type==="touchmove")&&(T.dragged=!0,k.globals.panEnabled?(k.globals.selection=null,T.w.globals.mousedown&&T.panDragging({context:T,zoomtype:q,xyRatios:S})):(T.w.globals.mousedown&&k.globals.zoomEnabled||T.w.globals.mousedown&&k.globals.selectionEnabled)&&(T.selection=T.selectionDrawing({context:T,zoomtype:q}))),_.type==="mouseup"||_.type==="touchend"||_.type==="mouseleave"){var Se,ke=(Se=T.gridRect)===null||Se===void 0?void 0:Se.getBoundingClientRect();ke&&T.w.globals.mousedown&&(T.endX=T.clientX-ke.left,T.endY=T.clientY-ke.top,T.dragX=Math.abs(T.endX-T.startX),T.dragY=Math.abs(T.endY-T.startY),(k.globals.zoomEnabled||k.globals.selectionEnabled)&&T.selectionDrawn({context:T,zoomtype:q}),k.globals.panEnabled&&k.config.xaxis.convertedCatToNumeric&&T.delayedPanScrolled()),k.globals.zoomEnabled&&T.hideSelectionRect(this.selectionRect),T.dragged=!1,T.w.globals.mousedown=!1}this.makeSelectionRectDraggable()}}}},{key:"mouseWheelEvent",value:function(S){var _=this,k=this.w;S.preventDefault();var T=Date.now();T-k.globals.lastWheelExecution>this.wheelDelay&&(this.executeMouseWheelZoom(S),k.globals.lastWheelExecution=T),this.debounceTimer&&clearTimeout(this.debounceTimer),this.debounceTimer=setTimeout(function(){T-k.globals.lastWheelExecution>_.wheelDelay&&(_.executeMouseWheelZoom(S),k.globals.lastWheelExecution=T)},this.debounceDelay)}},{key:"executeMouseWheelZoom",value:function(S){var _,k=this.w;this.minX=k.globals.isRangeBar?k.globals.minY:k.globals.minX,this.maxX=k.globals.isRangeBar?k.globals.maxY:k.globals.maxX;var T=(_=this.gridRect)===null||_===void 0?void 0:_.getBoundingClientRect();if(T){var B,q,te,ue=(S.clientX-T.left)/T.width,de=this.minX,xe=this.maxX,Se=xe-de;if(S.deltaY<0){var ke=de+ue*Se;q=ke-(B=.5*Se)/2,te=ke+B/2}else q=de-(B=1.5*Se)/2,te=xe+B/2;if(!k.globals.isRangeBar){q=Math.max(q,k.globals.initialMinX),te=Math.min(te,k.globals.initialMaxX);var Re=.01*(k.globals.initialMaxX-k.globals.initialMinX);if(te-q<Re){var Ge=(q+te)/2;q=Ge-Re/2,te=Ge+Re/2}}var Fe=this._getNewMinXMaxX(q,te);isNaN(Fe.minX)||isNaN(Fe.maxX)||this.zoomUpdateOptions(Fe.minX,Fe.maxX)}}},{key:"makeSelectionRectDraggable",value:function(){var S=this.w;if(this.selectionRect){var _=this.selectionRect.node.getBoundingClientRect();_.width>0&&_.height>0&&this.slDraggableRect.selectize({points:"l, r",pointSize:8,pointType:"rect"}).resize({constraint:{minX:0,minY:0,maxX:S.globals.gridWidth,maxY:S.globals.gridHeight}}).on("resizing",this.selectionDragging.bind(this,"resizing"))}}},{key:"preselectedSelection",value:function(){var S=this.w,_=this.xyRatios;if(!S.globals.zoomEnabled){if(S.globals.selection!==void 0&&S.globals.selection!==null)this.drawSelectionRect(S.globals.selection);else if(S.config.chart.selection.xaxis.min!==void 0&&S.config.chart.selection.xaxis.max!==void 0){var k=(S.config.chart.selection.xaxis.min-S.globals.minX)/_.xRatio,T=S.globals.gridWidth-(S.globals.maxX-S.config.chart.selection.xaxis.max)/_.xRatio-k;S.globals.isRangeBar&&(k=(S.config.chart.selection.xaxis.min-S.globals.yAxisScale[0].niceMin)/_.invertedYRatio,T=(S.config.chart.selection.xaxis.max-S.config.chart.selection.xaxis.min)/_.invertedYRatio);var B={x:k,y:0,width:T,height:S.globals.gridHeight,translateX:0,translateY:0,selectionEnabled:!0};this.drawSelectionRect(B),this.makeSelectionRectDraggable(),typeof S.config.chart.events.selection=="function"&&S.config.chart.events.selection(this.ctx,{xaxis:{min:S.config.chart.selection.xaxis.min,max:S.config.chart.selection.xaxis.max},yaxis:{}})}}}},{key:"drawSelectionRect",value:function(S){var _=S.x,k=S.y,T=S.width,B=S.height,q=S.translateX,te=q===void 0?0:q,ue=S.translateY,de=ue===void 0?0:ue,xe=this.w,Se=this.zoomRect,ke=this.selectionRect;if(this.dragged||xe.globals.selection!==null){var Re={transform:"translate("+te+", "+de+")"};xe.globals.zoomEnabled&&this.dragged&&(T<0&&(T=1),Se.attr({x:_,y:k,width:T,height:B,fill:xe.config.chart.zoom.zoomedArea.fill.color,"fill-opacity":xe.config.chart.zoom.zoomedArea.fill.opacity,stroke:xe.config.chart.zoom.zoomedArea.stroke.color,"stroke-width":xe.config.chart.zoom.zoomedArea.stroke.width,"stroke-opacity":xe.config.chart.zoom.zoomedArea.stroke.opacity}),z.setAttrs(Se.node,Re)),xe.globals.selectionEnabled&&(ke.attr({x:_,y:k,width:T>0?T:0,height:B>0?B:0,fill:xe.config.chart.selection.fill.color,"fill-opacity":xe.config.chart.selection.fill.opacity,stroke:xe.config.chart.selection.stroke.color,"stroke-width":xe.config.chart.selection.stroke.width,"stroke-dasharray":xe.config.chart.selection.stroke.dashArray,"stroke-opacity":xe.config.chart.selection.stroke.opacity}),z.setAttrs(ke.node,Re))}}},{key:"hideSelectionRect",value:function(S){S&&S.attr({x:0,y:0,width:0,height:0})}},{key:"selectionDrawing",value:function(S){var _=S.context,k=S.zoomtype,T=this.w,B=_,q=this.gridRect.getBoundingClientRect(),te=B.startX-1,ue=B.startY,de=!1,xe=!1,Se=B.clientX-q.left-te,ke=B.clientY-q.top-ue,Re={};return Math.abs(Se+te)>T.globals.gridWidth?Se=T.globals.gridWidth-te:B.clientX-q.left<0&&(Se=te),te>B.clientX-q.left&&(de=!0,Se=Math.abs(Se)),ue>B.clientY-q.top&&(xe=!0,ke=Math.abs(ke)),Re=k==="x"?{x:de?te-Se:te,y:0,width:Se,height:T.globals.gridHeight}:k==="y"?{x:0,y:xe?ue-ke:ue,width:T.globals.gridWidth,height:ke}:{x:de?te-Se:te,y:xe?ue-ke:ue,width:Se,height:ke},B.drawSelectionRect(Re),B.selectionDragging("resizing"),Re}},{key:"selectionDragging",value:function(S,_){var k=this,T=this.w,B=this.xyRatios,q=this.selectionRect,te=0;S==="resizing"&&(te=30);var ue=function(xe){return parseFloat(q.node.getAttribute(xe))},de={x:ue("x"),y:ue("y"),width:ue("width"),height:ue("height")};T.globals.selection=de,typeof T.config.chart.events.selection=="function"&&T.globals.selectionEnabled&&(clearTimeout(this.w.globals.selectionResizeTimer),this.w.globals.selectionResizeTimer=window.setTimeout(function(){var xe,Se,ke,Re,Ge=k.gridRect.getBoundingClientRect(),Fe=q.node.getBoundingClientRect();T.globals.isRangeBar?(xe=T.globals.yAxisScale[0].niceMin+(Fe.left-Ge.left)*B.invertedYRatio,Se=T.globals.yAxisScale[0].niceMin+(Fe.right-Ge.left)*B.invertedYRatio,ke=0,Re=1):(xe=T.globals.xAxisScale.niceMin+(Fe.left-Ge.left)*B.xRatio,Se=T.globals.xAxisScale.niceMin+(Fe.right-Ge.left)*B.xRatio,ke=T.globals.yAxisScale[0].niceMin+(Ge.bottom-Fe.bottom)*B.yRatio[0],Re=T.globals.yAxisScale[0].niceMax-(Fe.top-Ge.top)*B.yRatio[0]);var st={xaxis:{min:xe,max:Se},yaxis:{min:ke,max:Re}};T.config.chart.events.selection(k.ctx,st),T.config.chart.brush.enabled&&T.config.chart.events.brushScrolled!==void 0&&T.config.chart.events.brushScrolled(k.ctx,st)},te))}},{key:"selectionDrawn",value:function(S){var _=S.context,k=S.zoomtype,T=this.w,B=_,q=this.xyRatios,te=this.ctx.toolbar;if(B.startX>B.endX){var ue=B.startX;B.startX=B.endX,B.endX=ue}if(B.startY>B.endY){var de=B.startY;B.startY=B.endY,B.endY=de}var xe=void 0,Se=void 0;T.globals.isRangeBar?(xe=T.globals.yAxisScale[0].niceMin+B.startX*q.invertedYRatio,Se=T.globals.yAxisScale[0].niceMin+B.endX*q.invertedYRatio):(xe=T.globals.xAxisScale.niceMin+B.startX*q.xRatio,Se=T.globals.xAxisScale.niceMin+B.endX*q.xRatio);var ke=[],Re=[];if(T.config.yaxis.forEach(function(De,_e){var Je=T.globals.seriesYAxisMap[_e][0];ke.push(T.globals.yAxisScale[_e].niceMax-q.yRatio[Je]*B.startY),Re.push(T.globals.yAxisScale[_e].niceMax-q.yRatio[Je]*B.endY)}),B.dragged&&(B.dragX>10||B.dragY>10)&&xe!==Se){if(T.globals.zoomEnabled){var Ge=F.clone(T.globals.initialConfig.yaxis),Fe=F.clone(T.globals.initialConfig.xaxis);if(T.globals.zoomed=!0,T.config.xaxis.convertedCatToNumeric&&(xe=Math.floor(xe),Se=Math.floor(Se),xe<1&&(xe=1,Se=T.globals.dataPoints),Se-xe<2&&(Se=xe+1)),k!=="xy"&&k!=="x"||(Fe={min:xe,max:Se}),k!=="xy"&&k!=="y"||Ge.forEach(function(De,_e){Ge[_e].min=Re[_e],Ge[_e].max=ke[_e]}),te){var st=te.getBeforeZoomRange(Fe,Ge);st&&(Fe=st.xaxis?st.xaxis:Fe,Ge=st.yaxis?st.yaxis:Ge)}var se={xaxis:Fe};T.config.chart.group||(se.yaxis=Ge),B.ctx.updateHelpers._updateOptions(se,!1,B.w.config.chart.animations.dynamicAnimation.enabled),typeof T.config.chart.events.zoomed=="function"&&te.zoomCallback(Fe,Ge)}else if(T.globals.selectionEnabled){var Ce,Be=null;Ce={min:xe,max:Se},k!=="xy"&&k!=="y"||(Be=F.clone(T.config.yaxis)).forEach(function(De,_e){Be[_e].min=Re[_e],Be[_e].max=ke[_e]}),T.globals.selection=B.selection,typeof T.config.chart.events.selection=="function"&&T.config.chart.events.selection(B.ctx,{xaxis:Ce,yaxis:Be})}}}},{key:"panDragging",value:function(S){var _=S.context,k=this.w,T=_;if(k.globals.lastClientPosition.x!==void 0){var B=k.globals.lastClientPosition.x-T.clientX,q=k.globals.lastClientPosition.y-T.clientY;Math.abs(B)>Math.abs(q)&&B>0?this.moveDirection="left":Math.abs(B)>Math.abs(q)&&B<0?this.moveDirection="right":Math.abs(q)>Math.abs(B)&&q>0?this.moveDirection="up":Math.abs(q)>Math.abs(B)&&q<0&&(this.moveDirection="down")}k.globals.lastClientPosition={x:T.clientX,y:T.clientY};var te=k.globals.isRangeBar?k.globals.minY:k.globals.minX,ue=k.globals.isRangeBar?k.globals.maxY:k.globals.maxX;k.config.xaxis.convertedCatToNumeric||T.panScrolled(te,ue)}},{key:"delayedPanScrolled",value:function(){var S=this.w,_=S.globals.minX,k=S.globals.maxX,T=(S.globals.maxX-S.globals.minX)/2;this.moveDirection==="left"?(_=S.globals.minX+T,k=S.globals.maxX+T):this.moveDirection==="right"&&(_=S.globals.minX-T,k=S.globals.maxX-T),_=Math.floor(_),k=Math.floor(k),this.updateScrolledChart({xaxis:{min:_,max:k}},_,k)}},{key:"panScrolled",value:function(S,_){var k=this.w,T=this.xyRatios,B=F.clone(k.globals.initialConfig.yaxis),q=T.xRatio,te=k.globals.minX,ue=k.globals.maxX;k.globals.isRangeBar&&(q=T.invertedYRatio,te=k.globals.minY,ue=k.globals.maxY),this.moveDirection==="left"?(S=te+k.globals.gridWidth/15*q,_=ue+k.globals.gridWidth/15*q):this.moveDirection==="right"&&(S=te-k.globals.gridWidth/15*q,_=ue-k.globals.gridWidth/15*q),k.globals.isRangeBar||(S<k.globals.initialMinX||_>k.globals.initialMaxX)&&(S=te,_=ue);var de={xaxis:{min:S,max:_}};k.config.chart.group||(de.yaxis=B),this.updateScrolledChart(de,S,_)}},{key:"updateScrolledChart",value:function(S,_,k){var T=this.w;this.ctx.updateHelpers._updateOptions(S,!1,!1),typeof T.config.chart.events.scrolled=="function"&&T.config.chart.events.scrolled(this.ctx,{xaxis:{min:_,max:k}})}}]),p}(),nt=function(){function Ee(h){s(this,Ee),this.w=h.w,this.ttCtx=h,this.ctx=h.ctx}return o(Ee,[{key:"getNearestValues",value:function(h){var p=h.hoverArea,S=h.elGrid,_=h.clientX,k=h.clientY,T=this.w,B=S.getBoundingClientRect(),q=B.width,te=B.height,ue=q/(T.globals.dataPoints-1),de=te/T.globals.dataPoints,xe=this.hasBars();!T.globals.comboCharts&&!xe||T.config.xaxis.convertedCatToNumeric||(ue=q/T.globals.dataPoints);var Se=_-B.left-T.globals.barPadForNumericAxis,ke=k-B.top;Se<0||ke<0||Se>q||ke>te?(p.classList.remove("hovering-zoom"),p.classList.remove("hovering-pan")):T.globals.zoomEnabled?(p.classList.remove("hovering-pan"),p.classList.add("hovering-zoom")):T.globals.panEnabled&&(p.classList.remove("hovering-zoom"),p.classList.add("hovering-pan"));var Re=Math.round(Se/ue),Ge=Math.floor(ke/de);xe&&!T.config.xaxis.convertedCatToNumeric&&(Re=Math.ceil(Se/ue),Re-=1);var Fe=null,st=null,se=T.globals.seriesXvalues.map(function(Je){return Je.filter(function(ct){return F.isNumber(ct)})}),Ce=T.globals.seriesYvalues.map(function(Je){return Je.filter(function(ct){return F.isNumber(ct)})});if(T.globals.isXNumeric){var Be=this.ttCtx.getElGrid().getBoundingClientRect(),De=Se*(Be.width/q),_e=ke*(Be.height/te);Fe=(st=this.closestInMultiArray(De,_e,se,Ce)).index,Re=st.j,Fe!==null&&(se=T.globals.seriesXvalues[Fe],Re=(st=this.closestInArray(De,se)).index)}return T.globals.capturedSeriesIndex=Fe===null?-1:Fe,(!Re||Re<1)&&(Re=0),T.globals.isBarHorizontal?T.globals.capturedDataPointIndex=Ge:T.globals.capturedDataPointIndex=Re,{capturedSeries:Fe,j:T.globals.isBarHorizontal?Ge:Re,hoverX:Se,hoverY:ke}}},{key:"closestInMultiArray",value:function(h,p,S,_){var k=this.w,T=0,B=null,q=-1;k.globals.series.length>1?T=this.getFirstActiveXArray(S):B=0;var te=S[T][0],ue=Math.abs(h-te);if(S.forEach(function(Se){Se.forEach(function(ke,Re){var Ge=Math.abs(h-ke);Ge<=ue&&(ue=Ge,q=Re)})}),q!==-1){var de=_[T][q],xe=Math.abs(p-de);B=T,_.forEach(function(Se,ke){var Re=Math.abs(p-Se[q]);Re<=xe&&(xe=Re,B=ke)})}return{index:B,j:q}}},{key:"getFirstActiveXArray",value:function(h){for(var p=this.w,S=0,_=h.map(function(T,B){return T.length>0?B:-1}),k=0;k<_.length;k++)if(_[k]!==-1&&p.globals.collapsedSeriesIndices.indexOf(k)===-1&&p.globals.ancillaryCollapsedSeriesIndices.indexOf(k)===-1){S=_[k];break}return S}},{key:"closestInArray",value:function(h,p){for(var S=p[0],_=null,k=Math.abs(h-S),T=0;T<p.length;T++){var B=Math.abs(h-p[T]);B<k&&(k=B,_=T)}return{index:_}}},{key:"isXoverlap",value:function(h){var p=[],S=this.w.globals.seriesX.filter(function(k){return k[0]!==void 0});if(S.length>0)for(var _=0;_<S.length-1;_++)S[_][h]!==void 0&&S[_+1][h]!==void 0&&S[_][h]!==S[_+1][h]&&p.push("unEqual");return p.length===0}},{key:"isInitialSeriesSameLen",value:function(){for(var h=!0,p=this.w.globals.initialSeries,S=0;S<p.length-1;S++)if(p[S].data.length!==p[S+1].data.length){h=!1;break}return h}},{key:"getBarsHeight",value:function(h){return N(h).reduce(function(p,S){return p+S.getBBox().height},0)}},{key:"getElMarkers",value:function(h){return typeof h=="number"?this.w.globals.dom.baseEl.querySelectorAll(".apexcharts-series[data\\:realIndex='".concat(h,"'] .apexcharts-series-markers-wrap > *")):this.w.globals.dom.baseEl.querySelectorAll(".apexcharts-series-markers-wrap > *")}},{key:"getAllMarkers",value:function(){var h=this.w.globals.dom.baseEl.querySelectorAll(".apexcharts-series-markers-wrap");(h=N(h)).sort(function(S,_){var k=Number(S.getAttribute("data:realIndex")),T=Number(_.getAttribute("data:realIndex"));return T<k?1:T>k?-1:0});var p=[];return h.forEach(function(S){p.push(S.querySelector(".apexcharts-marker"))}),p}},{key:"hasMarkers",value:function(h){return this.getElMarkers(h).length>0}},{key:"getPathFromPoint",value:function(h,p){var S=Number(h.getAttribute("cx")),_=Number(h.getAttribute("cy")),k=h.getAttribute("shape");return new z(this.ctx).getMarkerPath(S,_,k,p)}},{key:"getElBars",value:function(){return this.w.globals.dom.baseEl.querySelectorAll(".apexcharts-bar-series, .apexcharts-candlestick-series, .apexcharts-boxPlot-series, .apexcharts-rangebar-series")}},{key:"hasBars",value:function(){return this.getElBars().length>0}},{key:"getHoverMarkerSize",value:function(h){var p=this.w,S=p.config.markers.hover.size;return S===void 0&&(S=p.globals.markers.size[h]+p.config.markers.hover.sizeOffset),S}},{key:"toggleAllTooltipSeriesGroups",value:function(h){var p=this.w,S=this.ttCtx;S.allTooltipSeriesGroups.length===0&&(S.allTooltipSeriesGroups=p.globals.dom.baseEl.querySelectorAll(".apexcharts-tooltip-series-group"));for(var _=S.allTooltipSeriesGroups,k=0;k<_.length;k++)h==="enable"?(_[k].classList.add("apexcharts-active"),_[k].style.display=p.config.tooltip.items.display):(_[k].classList.remove("apexcharts-active"),_[k].style.display="none")}}]),Ee}(),Ue=function(){function Ee(h){s(this,Ee),this.w=h.w,this.ctx=h.ctx,this.ttCtx=h,this.tooltipUtil=new nt(h)}return o(Ee,[{key:"drawSeriesTexts",value:function(h){var p=h.shared,S=p===void 0||p,_=h.ttItems,k=h.i,T=k===void 0?0:k,B=h.j,q=B===void 0?null:B,te=h.y1,ue=h.y2,de=h.e,xe=this.w;xe.config.tooltip.custom!==void 0?this.handleCustomTooltip({i:T,j:q,y1:te,y2:ue,w:xe}):this.toggleActiveInactiveSeries(S,T);var Se=this.getValuesToPrint({i:T,j:q});this.printLabels({i:T,j:q,values:Se,ttItems:_,shared:S,e:de});var ke=this.ttCtx.getElTooltip();this.ttCtx.tooltipRect.ttWidth=ke.getBoundingClientRect().width,this.ttCtx.tooltipRect.ttHeight=ke.getBoundingClientRect().height}},{key:"printLabels",value:function(h){var p,S=this,_=h.i,k=h.j,T=h.values,B=h.ttItems,q=h.shared,te=h.e,ue=this.w,de=[],xe=function(Be){return ue.globals.seriesGoals[Be]&&ue.globals.seriesGoals[Be][k]&&Array.isArray(ue.globals.seriesGoals[Be][k])},Se=T.xVal,ke=T.zVal,Re=T.xAxisTTVal,Ge="",Fe=ue.globals.colors[_];k!==null&&ue.config.plotOptions.bar.distributed&&(Fe=ue.globals.colors[k]);for(var st=function(Be,De){var _e=S.getFormatters(_);Ge=S.getSeriesName({fn:_e.yLbTitleFormatter,index:_,seriesIndex:_,j:k}),ue.config.chart.type==="treemap"&&(Ge=_e.yLbTitleFormatter(String(ue.config.series[_].data[k].x),{series:ue.globals.series,seriesIndex:_,dataPointIndex:k,w:ue}));var Je=ue.config.tooltip.inverseOrder?De:Be;if(ue.globals.axisCharts){var ct=function(wt){var Xe,Oe,bt,kt;return ue.globals.isRangeData?_e.yLbFormatter((Xe=ue.globals.seriesRangeStart)===null||Xe===void 0||(Oe=Xe[wt])===null||Oe===void 0?void 0:Oe[k],{series:ue.globals.seriesRangeStart,seriesIndex:wt,dataPointIndex:k,w:ue})+" - "+_e.yLbFormatter((bt=ue.globals.seriesRangeEnd)===null||bt===void 0||(kt=bt[wt])===null||kt===void 0?void 0:kt[k],{series:ue.globals.seriesRangeEnd,seriesIndex:wt,dataPointIndex:k,w:ue}):_e.yLbFormatter(ue.globals.series[wt][k],{series:ue.globals.series,seriesIndex:wt,dataPointIndex:k,w:ue})};if(q)_e=S.getFormatters(Je),Ge=S.getSeriesName({fn:_e.yLbTitleFormatter,index:Je,seriesIndex:_,j:k}),Fe=ue.globals.colors[Je],p=ct(Je),xe(Je)&&(de=ue.globals.seriesGoals[Je][k].map(function(wt){return{attrs:wt,val:_e.yLbFormatter(wt.value,{seriesIndex:Je,dataPointIndex:k,w:ue})}}));else{var gt,Xt=te==null||(gt=te.target)===null||gt===void 0?void 0:gt.getAttribute("fill");Xt&&(Xt.indexOf("url")!==-1?Xt.indexOf("Pattern")!==-1&&(Fe=ue.globals.dom.baseEl.querySelector(Xt.substr(4).slice(0,-1)).childNodes[0].getAttribute("stroke")):Fe=Xt),p=ct(_),xe(_)&&Array.isArray(ue.globals.seriesGoals[_][k])&&(de=ue.globals.seriesGoals[_][k].map(function(wt){return{attrs:wt,val:_e.yLbFormatter(wt.value,{seriesIndex:_,dataPointIndex:k,w:ue})}}))}}k===null&&(p=_e.yLbFormatter(ue.globals.series[_],v(v({},ue),{},{seriesIndex:_,dataPointIndex:_}))),S.DOMHandling({i:_,t:Je,j:k,ttItems:B,values:{val:p,goalVals:de,xVal:Se,xAxisTTVal:Re,zVal:ke},seriesName:Ge,shared:q,pColor:Fe})},se=0,Ce=ue.globals.series.length-1;se<ue.globals.series.length;se++,Ce--)st(se,Ce)}},{key:"getFormatters",value:function(h){var p,S=this.w,_=S.globals.yLabelFormatters[h];return S.globals.ttVal!==void 0?Array.isArray(S.globals.ttVal)?(_=S.globals.ttVal[h]&&S.globals.ttVal[h].formatter,p=S.globals.ttVal[h]&&S.globals.ttVal[h].title&&S.globals.ttVal[h].title.formatter):(_=S.globals.ttVal.formatter,typeof S.globals.ttVal.title.formatter=="function"&&(p=S.globals.ttVal.title.formatter)):p=S.config.tooltip.y.title.formatter,typeof _!="function"&&(_=S.globals.yLabelFormatters[0]?S.globals.yLabelFormatters[0]:function(k){return k}),typeof p!="function"&&(p=function(k){return k}),{yLbFormatter:_,yLbTitleFormatter:p}}},{key:"getSeriesName",value:function(h){var p=h.fn,S=h.index,_=h.seriesIndex,k=h.j,T=this.w;return p(String(T.globals.seriesNames[S]),{series:T.globals.series,seriesIndex:_,dataPointIndex:k,w:T})}},{key:"DOMHandling",value:function(h){h.i;var p=h.t,S=h.j,_=h.ttItems,k=h.values,T=h.seriesName,B=h.shared,q=h.pColor,te=this.w,ue=this.ttCtx,de=k.val,xe=k.goalVals,Se=k.xVal,ke=k.xAxisTTVal,Re=k.zVal,Ge=null;Ge=_[p].children,te.config.tooltip.fillSeriesColor&&(_[p].style.backgroundColor=q,Ge[0].style.display="none"),ue.showTooltipTitle&&(ue.tooltipTitle===null&&(ue.tooltipTitle=te.globals.dom.baseEl.querySelector(".apexcharts-tooltip-title")),ue.tooltipTitle.innerHTML=Se),ue.isXAxisTooltipEnabled&&(ue.xaxisTooltipText.innerHTML=ke!==""?ke:Se);var Fe=_[p].querySelector(".apexcharts-tooltip-text-y-label");Fe&&(Fe.innerHTML=T||"");var st=_[p].querySelector(".apexcharts-tooltip-text-y-value");st&&(st.innerHTML=de!==void 0?de:""),Ge[0]&&Ge[0].classList.contains("apexcharts-tooltip-marker")&&(te.config.tooltip.marker.fillColors&&Array.isArray(te.config.tooltip.marker.fillColors)&&(q=te.config.tooltip.marker.fillColors[p]),Ge[0].style.backgroundColor=q),te.config.tooltip.marker.show||(Ge[0].style.display="none");var se=_[p].querySelector(".apexcharts-tooltip-text-goals-label"),Ce=_[p].querySelector(".apexcharts-tooltip-text-goals-value");if(xe.length&&te.globals.seriesGoals[p]){var Be=function(){var Je="<div >",ct="<div>";xe.forEach(function(gt,Xt){Je+=' <div style="display: flex"><span class="apexcharts-tooltip-marker" style="background-color: '.concat(gt.attrs.strokeColor,'; height: 3px; border-radius: 0; top: 5px;"></span> ').concat(gt.attrs.name,"</div>"),ct+="<div>".concat(gt.val,"</div>")}),se.innerHTML=Je+"</div>",Ce.innerHTML=ct+"</div>"};B?te.globals.seriesGoals[p][S]&&Array.isArray(te.globals.seriesGoals[p][S])?Be():(se.innerHTML="",Ce.innerHTML=""):Be()}else se.innerHTML="",Ce.innerHTML="";if(Re!==null&&(_[p].querySelector(".apexcharts-tooltip-text-z-label").innerHTML=te.config.tooltip.z.title,_[p].querySelector(".apexcharts-tooltip-text-z-value").innerHTML=Re!==void 0?Re:""),B&&Ge[0]){if(te.config.tooltip.hideEmptySeries){var De=_[p].querySelector(".apexcharts-tooltip-marker"),_e=_[p].querySelector(".apexcharts-tooltip-text");parseFloat(de)==0?(De.style.display="none",_e.style.display="none"):(De.style.display="block",_e.style.display="block")}de==null||te.globals.ancillaryCollapsedSeriesIndices.indexOf(p)>-1||te.globals.collapsedSeriesIndices.indexOf(p)>-1||Array.isArray(ue.tConfig.enabledOnSeries)&&ue.tConfig.enabledOnSeries.indexOf(p)===-1?Ge[0].parentNode.style.display="none":Ge[0].parentNode.style.display=te.config.tooltip.items.display}else Array.isArray(ue.tConfig.enabledOnSeries)&&ue.tConfig.enabledOnSeries.indexOf(p)===-1&&(Ge[0].parentNode.style.display="none")}},{key:"toggleActiveInactiveSeries",value:function(h,p){var S=this.w;if(h)this.tooltipUtil.toggleAllTooltipSeriesGroups("enable");else{this.tooltipUtil.toggleAllTooltipSeriesGroups("disable");var _=S.globals.dom.baseEl.querySelector(".apexcharts-tooltip-series-group-".concat(p));_&&(_.classList.add("apexcharts-active"),_.style.display=S.config.tooltip.items.display)}}},{key:"getValuesToPrint",value:function(h){var p=h.i,S=h.j,_=this.w,k=this.ctx.series.filteredSeriesX(),T="",B="",q=null,te=null,ue={series:_.globals.series,seriesIndex:p,dataPointIndex:S,w:_},de=_.globals.ttZFormatter;S===null?te=_.globals.series[p]:_.globals.isXNumeric&&_.config.chart.type!=="treemap"?(T=k[p][S],k[p].length===0&&(T=k[this.tooltipUtil.getFirstActiveXArray(k)][S])):T=new Qe(this.ctx).isFormatXY()?_.config.series[p].data[S]!==void 0?_.config.series[p].data[S].x:"":_.globals.labels[S]!==void 0?_.globals.labels[S]:"";var xe=T;return _.globals.isXNumeric&&_.config.xaxis.type==="datetime"?T=new re(this.ctx).xLabelFormat(_.globals.ttKeyFormatter,xe,xe,{i:void 0,dateFormatter:new X(this.ctx).formatDate,w:this.w}):T=_.globals.isBarHorizontal?_.globals.yLabelFormatters[0](xe,ue):_.globals.xLabelFormatter(xe,ue),_.config.tooltip.x.formatter!==void 0&&(T=_.globals.ttKeyFormatter(xe,ue)),_.globals.seriesZ.length>0&&_.globals.seriesZ[p].length>0&&(q=de(_.globals.seriesZ[p][S],_)),B=typeof _.config.xaxis.tooltip.formatter=="function"?_.globals.xaxisTooltipFormatter(xe,ue):T,{val:Array.isArray(te)?te.join(" "):te,xVal:Array.isArray(T)?T.join(" "):T,xAxisTTVal:Array.isArray(B)?B.join(" "):B,zVal:q}}},{key:"handleCustomTooltip",value:function(h){var p=h.i,S=h.j,_=h.y1,k=h.y2,T=h.w,B=this.ttCtx.getElTooltip(),q=T.config.tooltip.custom;Array.isArray(q)&&q[p]&&(q=q[p]),B.innerHTML=q({ctx:this.ctx,series:T.globals.series,seriesIndex:p,dataPointIndex:S,y1:_,y2:k,w:T})}}]),Ee}(),Rt=function(){function Ee(h){s(this,Ee),this.ttCtx=h,this.ctx=h.ctx,this.w=h.w}return o(Ee,[{key:"moveXCrosshairs",value:function(h){var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,S=this.ttCtx,_=this.w,k=S.getElXCrosshairs(),T=h-S.xcrosshairsWidth/2,B=_.globals.labels.slice().length;if(p!==null&&(T=_.globals.gridWidth/B*p),k===null||_.globals.isBarHorizontal||(k.setAttribute("x",T),k.setAttribute("x1",T),k.setAttribute("x2",T),k.setAttribute("y2",_.globals.gridHeight),k.classList.add("apexcharts-active")),T<0&&(T=0),T>_.globals.gridWidth&&(T=_.globals.gridWidth),S.isXAxisTooltipEnabled){var q=T;_.config.xaxis.crosshairs.width!=="tickWidth"&&_.config.xaxis.crosshairs.width!=="barWidth"||(q=T+S.xcrosshairsWidth/2),this.moveXAxisTooltip(q)}}},{key:"moveYCrosshairs",value:function(h){var p=this.ttCtx;p.ycrosshairs!==null&&z.setAttrs(p.ycrosshairs,{y1:h,y2:h}),p.ycrosshairsHidden!==null&&z.setAttrs(p.ycrosshairsHidden,{y1:h,y2:h})}},{key:"moveXAxisTooltip",value:function(h){var p=this.w,S=this.ttCtx;if(S.xaxisTooltip!==null&&S.xcrosshairsWidth!==0){S.xaxisTooltip.classList.add("apexcharts-active");var _=S.xaxisOffY+p.config.xaxis.tooltip.offsetY+p.globals.translateY+1+p.config.xaxis.offsetY;if(h-=S.xaxisTooltip.getBoundingClientRect().width/2,!isNaN(h)){h+=p.globals.translateX;var k;k=new z(this.ctx).getTextRects(S.xaxisTooltipText.innerHTML),S.xaxisTooltipText.style.minWidth=k.width+"px",S.xaxisTooltip.style.left=h+"px",S.xaxisTooltip.style.top=_+"px"}}}},{key:"moveYAxisTooltip",value:function(h){var p=this.w,S=this.ttCtx;S.yaxisTTEls===null&&(S.yaxisTTEls=p.globals.dom.baseEl.querySelectorAll(".apexcharts-yaxistooltip"));var _=parseInt(S.ycrosshairsHidden.getAttribute("y1"),10),k=p.globals.translateY+_,T=S.yaxisTTEls[h].getBoundingClientRect().height,B=p.globals.translateYAxisX[h]-2;p.config.yaxis[h].opposite&&(B-=26),k-=T/2,p.globals.ignoreYAxisIndexes.indexOf(h)===-1?(S.yaxisTTEls[h].classList.add("apexcharts-active"),S.yaxisTTEls[h].style.top=k+"px",S.yaxisTTEls[h].style.left=B+p.config.yaxis[h].tooltip.offsetX+"px"):S.yaxisTTEls[h].classList.remove("apexcharts-active")}},{key:"moveTooltip",value:function(h,p){var S=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,_=this.w,k=this.ttCtx,T=k.getElTooltip(),B=k.tooltipRect,q=S!==null?parseFloat(S):1,te=parseFloat(h)+q+5,ue=parseFloat(p)+q/2;if(te>_.globals.gridWidth/2&&(te=te-B.ttWidth-q-10),te>_.globals.gridWidth-B.ttWidth-10&&(te=_.globals.gridWidth-B.ttWidth),te<-20&&(te=-20),_.config.tooltip.followCursor){var de=k.getElGrid().getBoundingClientRect();(te=k.e.clientX-de.left)>_.globals.gridWidth/2&&(te-=k.tooltipRect.ttWidth),(ue=k.e.clientY+_.globals.translateY-de.top)>_.globals.gridHeight/2&&(ue-=k.tooltipRect.ttHeight)}else _.globals.isBarHorizontal||B.ttHeight/2+ue>_.globals.gridHeight&&(ue=_.globals.gridHeight-B.ttHeight+_.globals.translateY);isNaN(te)||(te+=_.globals.translateX,T.style.left=te+"px",T.style.top=ue+"px")}},{key:"moveMarkers",value:function(h,p){var S=this.w,_=this.ttCtx;if(S.globals.markers.size[h]>0)for(var k=S.globals.dom.baseEl.querySelectorAll(" .apexcharts-series[data\\:realIndex='".concat(h,"'] .apexcharts-marker")),T=0;T<k.length;T++)parseInt(k[T].getAttribute("rel"),10)===p&&(_.marker.resetPointsSize(),_.marker.enlargeCurrentPoint(p,k[T]));else _.marker.resetPointsSize(),this.moveDynamicPointOnHover(p,h)}},{key:"moveDynamicPointOnHover",value:function(h,p){var S,_,k,T,B=this.w,q=this.ttCtx,te=new z(this.ctx),ue=B.globals.pointsArray,de=q.tooltipUtil.getHoverMarkerSize(p),xe=B.config.series[p].type;if(!xe||xe!=="column"&&xe!=="candlestick"&&xe!=="boxPlot"){k=(S=ue[p][h])===null||S===void 0?void 0:S[0],T=((_=ue[p][h])===null||_===void 0?void 0:_[1])||0;var Se=B.globals.dom.baseEl.querySelector(".apexcharts-series[data\\:realIndex='".concat(p,"'] .apexcharts-series-markers path"));if(Se&&T<B.globals.gridHeight&&T>0){var ke=Se.getAttribute("shape"),Re=te.getMarkerPath(k,T,ke,1.5*de);Se.setAttribute("d",Re)}this.moveXCrosshairs(k),q.fixedTooltip||this.moveTooltip(k,T,de)}}},{key:"moveDynamicPointsOnHover",value:function(h){var p,S=this.ttCtx,_=S.w,k=0,T=0,B=_.globals.pointsArray,q=new Le(this.ctx),te=new z(this.ctx);p=q.getActiveConfigSeriesIndex("asc",["line","area","scatter","bubble"]);var ue=S.tooltipUtil.getHoverMarkerSize(p);B[p]&&(k=B[p][h][0],T=B[p][h][1]);var de=S.tooltipUtil.getAllMarkers();if(de!==null)for(var xe=0;xe<_.globals.series.length;xe++){var Se=B[xe];if(_.globals.comboCharts&&Se===void 0&&de.splice(xe,0,null),Se&&Se.length){var ke=B[xe][h][1],Re=void 0;de[xe].setAttribute("cx",k);var Ge=de[xe].getAttribute("shape");if(_.config.chart.type==="rangeArea"&&!_.globals.comboCharts){var Fe=h+_.globals.series[xe].length;Re=B[xe][Fe][1],ke-=Math.abs(ke-Re)/2}if(ke!==null&&!isNaN(ke)&&ke<_.globals.gridHeight+ue&&ke+ue>0){var st=te.getMarkerPath(k,ke,Ge,ue);de[xe].setAttribute("d",st)}else de[xe].setAttribute("d","")}}this.moveXCrosshairs(k),S.fixedTooltip||this.moveTooltip(k,T||_.globals.gridHeight,ue)}},{key:"moveStickyTooltipOverBars",value:function(h,p){var S=this.w,_=this.ttCtx,k=S.globals.columnSeries?S.globals.columnSeries.length:S.globals.series.length,T=k>=2&&k%2==0?Math.floor(k/2):Math.floor(k/2)+1;S.globals.isBarHorizontal&&(T=new Le(this.ctx).getActiveConfigSeriesIndex("desc")+1);var B=S.globals.dom.baseEl.querySelector(".apexcharts-bar-series .apexcharts-series[rel='".concat(T,"'] path[j='").concat(h,"'], .apexcharts-candlestick-series .apexcharts-series[rel='").concat(T,"'] path[j='").concat(h,"'], .apexcharts-boxPlot-series .apexcharts-series[rel='").concat(T,"'] path[j='").concat(h,"'], .apexcharts-rangebar-series .apexcharts-series[rel='").concat(T,"'] path[j='").concat(h,"']"));B||typeof p!="number"||(B=S.globals.dom.baseEl.querySelector(".apexcharts-bar-series .apexcharts-series[data\\:realIndex='".concat(p,"'] path[j='").concat(h,`'],
.apexcharts-candlestick-series .apexcharts-series[data\\:realIndex='`).concat(p,"'] path[j='").concat(h,`'],
.apexcharts-boxPlot-series .apexcharts-series[data\\:realIndex='`).concat(p,"'] path[j='").concat(h,`'],
.apexcharts-rangebar-series .apexcharts-series[data\\:realIndex='`).concat(p,"'] path[j='").concat(h,"']")));var q=B?parseFloat(B.getAttribute("cx")):0,te=B?parseFloat(B.getAttribute("cy")):0,ue=B?parseFloat(B.getAttribute("barWidth")):0,de=_.getElGrid().getBoundingClientRect(),xe=B&&(B.classList.contains("apexcharts-candlestick-area")||B.classList.contains("apexcharts-boxPlot-area"));S.globals.isXNumeric?(B&&!xe&&(q-=k%2!=0?ue/2:0),B&&xe&&S.globals.comboCharts&&(q-=ue/2)):S.globals.isBarHorizontal||(q=_.xAxisTicksPositions[h-1]+_.dataPointsDividedWidth/2,isNaN(q)&&(q=_.xAxisTicksPositions[h]-_.dataPointsDividedWidth/2)),S.globals.isBarHorizontal?te-=_.tooltipRect.ttHeight:S.config.tooltip.followCursor?te=_.e.clientY-de.top-_.tooltipRect.ttHeight/2:te+_.tooltipRect.ttHeight+15>S.globals.gridHeight&&(te=S.globals.gridHeight),S.globals.isBarHorizontal||this.moveXCrosshairs(q),_.fixedTooltip||this.moveTooltip(q,te||S.globals.gridHeight)}}]),Ee}(),We=function(){function Ee(h){s(this,Ee),this.w=h.w,this.ttCtx=h,this.ctx=h.ctx,this.tooltipPosition=new Rt(h)}return o(Ee,[{key:"drawDynamicPoints",value:function(){var h=this.w,p=new z(this.ctx),S=new ve(this.ctx),_=h.globals.dom.baseEl.querySelectorAll(".apexcharts-series");_=N(_),h.config.chart.stacked&&_.sort(function(de,xe){return parseFloat(de.getAttribute("data:realIndex"))-parseFloat(xe.getAttribute("data:realIndex"))});for(var k=0;k<_.length;k++){var T=_[k].querySelector(".apexcharts-series-markers-wrap");if(T!==null){var B=void 0,q="apexcharts-marker w".concat((Math.random()+1).toString(36).substring(4));h.config.chart.type!=="line"&&h.config.chart.type!=="area"||h.globals.comboCharts||h.config.tooltip.intersect||(q+=" no-pointer-events");var te=S.getMarkerConfig({cssClass:q,seriesIndex:Number(T.getAttribute("data:realIndex"))});(B=p.drawMarker(0,0,te)).node.setAttribute("default-marker-size",0);var ue=document.createElementNS(h.globals.SVGNS,"g");ue.classList.add("apexcharts-series-markers"),ue.appendChild(B.node),T.appendChild(ue)}}}},{key:"enlargeCurrentPoint",value:function(h,p){var S=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,_=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null,k=this.w;k.config.chart.type!=="bubble"&&this.newPointSize(h,p);var T=p.getAttribute("cx"),B=p.getAttribute("cy");if(S!==null&&_!==null&&(T=S,B=_),this.tooltipPosition.moveXCrosshairs(T),!this.fixedTooltip){if(k.config.chart.type==="radar"){var q=this.ttCtx.getElGrid().getBoundingClientRect();T=this.ttCtx.e.clientX-q.left}this.tooltipPosition.moveTooltip(T,B,k.config.markers.hover.size)}}},{key:"enlargePoints",value:function(h){for(var p=this.w,S=this,_=this.ttCtx,k=h,T=p.globals.dom.baseEl.querySelectorAll(".apexcharts-series:not(.apexcharts-series-collapsed) .apexcharts-marker"),B=p.config.markers.hover.size,q=0;q<T.length;q++){var te=T[q].getAttribute("rel"),ue=T[q].getAttribute("index");if(B===void 0&&(B=p.globals.markers.size[ue]+p.config.markers.hover.sizeOffset),k===parseInt(te,10)){S.newPointSize(k,T[q]);var de=T[q].getAttribute("cx"),xe=T[q].getAttribute("cy");S.tooltipPosition.moveXCrosshairs(de),_.fixedTooltip||S.tooltipPosition.moveTooltip(de,xe,B)}else S.oldPointSize(T[q])}}},{key:"newPointSize",value:function(h,p){var S=this.w,_=S.config.markers.hover.size,k=h===0?p.parentNode.firstChild:p.parentNode.lastChild;if(k.getAttribute("default-marker-size")!=="0"){var T=parseInt(k.getAttribute("index"),10);_===void 0&&(_=S.globals.markers.size[T]+S.config.markers.hover.sizeOffset),_<0&&(_=0);var B=this.ttCtx.tooltipUtil.getPathFromPoint(p,_);p.setAttribute("d",B)}}},{key:"oldPointSize",value:function(h){var p=parseFloat(h.getAttribute("default-marker-size")),S=this.ttCtx.tooltipUtil.getPathFromPoint(h,p);h.setAttribute("d",S)}},{key:"resetPointsSize",value:function(){for(var h=this.w.globals.dom.baseEl.querySelectorAll(".apexcharts-series:not(.apexcharts-series-collapsed) .apexcharts-marker"),p=0;p<h.length;p++){var S=parseFloat(h[p].getAttribute("default-marker-size"));if(F.isNumber(S)&&S>=0){var _=this.ttCtx.tooltipUtil.getPathFromPoint(h[p],S);h[p].setAttribute("d",_)}else h[p].setAttribute("d","M0,0")}}}]),Ee}(),at=function(){function Ee(h){s(this,Ee),this.w=h.w;var p=this.w;this.ttCtx=h,this.isVerticalGroupedRangeBar=!p.globals.isBarHorizontal&&p.config.chart.type==="rangeBar"&&p.config.plotOptions.bar.rangeBarGroupRows}return o(Ee,[{key:"getAttr",value:function(h,p){return parseFloat(h.target.getAttribute(p))}},{key:"handleHeatTreeTooltip",value:function(h){var p=h.e,S=h.opt,_=h.x,k=h.y,T=h.type,B=this.ttCtx,q=this.w;if(p.target.classList.contains("apexcharts-".concat(T,"-rect"))){var te=this.getAttr(p,"i"),ue=this.getAttr(p,"j"),de=this.getAttr(p,"cx"),xe=this.getAttr(p,"cy"),Se=this.getAttr(p,"width"),ke=this.getAttr(p,"height");if(B.tooltipLabels.drawSeriesTexts({ttItems:S.ttItems,i:te,j:ue,shared:!1,e:p}),q.globals.capturedSeriesIndex=te,q.globals.capturedDataPointIndex=ue,_=de+B.tooltipRect.ttWidth/2+Se,k=xe+B.tooltipRect.ttHeight/2-ke/2,B.tooltipPosition.moveXCrosshairs(de+Se/2),_>q.globals.gridWidth/2&&(_=de-B.tooltipRect.ttWidth/2+Se),B.w.config.tooltip.followCursor){var Re=q.globals.dom.elWrap.getBoundingClientRect();_=q.globals.clientX-Re.left-(_>q.globals.gridWidth/2?B.tooltipRect.ttWidth:0),k=q.globals.clientY-Re.top-(k>q.globals.gridHeight/2?B.tooltipRect.ttHeight:0)}}return{x:_,y:k}}},{key:"handleMarkerTooltip",value:function(h){var p,S,_=h.e,k=h.opt,T=h.x,B=h.y,q=this.w,te=this.ttCtx;if(_.target.classList.contains("apexcharts-marker")){var ue=parseInt(k.paths.getAttribute("cx"),10),de=parseInt(k.paths.getAttribute("cy"),10),xe=parseFloat(k.paths.getAttribute("val"));if(S=parseInt(k.paths.getAttribute("rel"),10),p=parseInt(k.paths.parentNode.parentNode.parentNode.getAttribute("rel"),10)-1,te.intersect){var Se=F.findAncestor(k.paths,"apexcharts-series");Se&&(p=parseInt(Se.getAttribute("data:realIndex"),10))}if(te.tooltipLabels.drawSeriesTexts({ttItems:k.ttItems,i:p,j:S,shared:!te.showOnIntersect&&q.config.tooltip.shared,e:_}),_.type==="mouseup"&&te.markerClick(_,p,S),q.globals.capturedSeriesIndex=p,q.globals.capturedDataPointIndex=S,T=ue,B=de+q.globals.translateY-1.4*te.tooltipRect.ttHeight,te.w.config.tooltip.followCursor){var ke=te.getElGrid().getBoundingClientRect();B=te.e.clientY+q.globals.translateY-ke.top}xe<0&&(B=de),te.marker.enlargeCurrentPoint(S,k.paths,T,B)}return{x:T,y:B}}},{key:"handleBarTooltip",value:function(h){var p,S,_=h.e,k=h.opt,T=this.w,B=this.ttCtx,q=B.getElTooltip(),te=0,ue=0,de=0,xe=this.getBarTooltipXY({e:_,opt:k});p=xe.i;var Se=xe.j;T.globals.capturedSeriesIndex=p,T.globals.capturedDataPointIndex=Se,T.globals.isBarHorizontal&&B.tooltipUtil.hasBars()||!T.config.tooltip.shared?(ue=xe.x,de=xe.y,S=Array.isArray(T.config.stroke.width)?T.config.stroke.width[p]:T.config.stroke.width,te=ue):T.globals.comboCharts||T.config.tooltip.shared||(te/=2),isNaN(de)&&(de=T.globals.svgHeight-B.tooltipRect.ttHeight);var ke=parseInt(k.paths.parentNode.getAttribute("data:realIndex"),10);if(T.globals.isMultipleYAxis?T.config.yaxis[ke]&&T.config.yaxis[ke].reversed:T.config.yaxis[0].reversed,ue+B.tooltipRect.ttWidth>T.globals.gridWidth?ue-=B.tooltipRect.ttWidth:ue<0&&(ue=0),B.w.config.tooltip.followCursor){var Re=B.getElGrid().getBoundingClientRect();de=B.e.clientY-Re.top}B.tooltip===null&&(B.tooltip=T.globals.dom.baseEl.querySelector(".apexcharts-tooltip")),T.config.tooltip.shared||(T.globals.comboBarCount>0?B.tooltipPosition.moveXCrosshairs(te+S/2):B.tooltipPosition.moveXCrosshairs(te)),!B.fixedTooltip&&(!T.config.tooltip.shared||T.globals.isBarHorizontal&&B.tooltipUtil.hasBars())&&(de=de+T.globals.translateY-B.tooltipRect.ttHeight/2,q.style.left=ue+T.globals.translateX+"px",q.style.top=de+"px")}},{key:"getBarTooltipXY",value:function(h){var p=this,S=h.e,_=h.opt,k=this.w,T=null,B=this.ttCtx,q=0,te=0,ue=0,de=0,xe=0,Se=S.target.classList;if(Se.contains("apexcharts-bar-area")||Se.contains("apexcharts-candlestick-area")||Se.contains("apexcharts-boxPlot-area")||Se.contains("apexcharts-rangebar-area")){var ke=S.target,Re=ke.getBoundingClientRect(),Ge=_.elGrid.getBoundingClientRect(),Fe=Re.height;xe=Re.height;var st=Re.width,se=parseInt(ke.getAttribute("cx"),10),Ce=parseInt(ke.getAttribute("cy"),10);de=parseFloat(ke.getAttribute("barWidth"));var Be=S.type==="touchmove"?S.touches[0].clientX:S.clientX;T=parseInt(ke.getAttribute("j"),10),q=parseInt(ke.parentNode.getAttribute("rel"),10)-1;var De=ke.getAttribute("data-range-y1"),_e=ke.getAttribute("data-range-y2");k.globals.comboCharts&&(q=parseInt(ke.parentNode.getAttribute("data:realIndex"),10));var Je=function(gt){return k.globals.isXNumeric?se-st/2:p.isVerticalGroupedRangeBar?se+st/2:se-B.dataPointsDividedWidth+st/2},ct=function(){return Ce-B.dataPointsDividedHeight+Fe/2-B.tooltipRect.ttHeight/2};B.tooltipLabels.drawSeriesTexts({ttItems:_.ttItems,i:q,j:T,y1:De?parseInt(De,10):null,y2:_e?parseInt(_e,10):null,shared:!B.showOnIntersect&&k.config.tooltip.shared,e:S}),k.config.tooltip.followCursor?k.globals.isBarHorizontal?(te=Be-Ge.left+15,ue=ct()):(te=Je(),ue=S.clientY-Ge.top-B.tooltipRect.ttHeight/2-15):k.globals.isBarHorizontal?((te=se)<B.xyRatios.baseLineInvertedY&&(te=se-B.tooltipRect.ttWidth),ue=ct()):(te=Je(),ue=Ce)}return{x:te,y:ue,barHeight:xe,barWidth:de,i:q,j:T}}}]),Ee}(),mt=function(){function Ee(h){s(this,Ee),this.w=h.w,this.ttCtx=h}return o(Ee,[{key:"drawXaxisTooltip",value:function(){var h=this.w,p=this.ttCtx,S=h.config.xaxis.position==="bottom";p.xaxisOffY=S?h.globals.gridHeight+1:-h.globals.xAxisHeight-h.config.xaxis.axisTicks.height+3;var _=S?"apexcharts-xaxistooltip apexcharts-xaxistooltip-bottom":"apexcharts-xaxistooltip apexcharts-xaxistooltip-top",k=h.globals.dom.elWrap;p.isXAxisTooltipEnabled&&h.globals.dom.baseEl.querySelector(".apexcharts-xaxistooltip")===null&&(p.xaxisTooltip=document.createElement("div"),p.xaxisTooltip.setAttribute("class",_+" apexcharts-theme-"+h.config.tooltip.theme),k.appendChild(p.xaxisTooltip),p.xaxisTooltipText=document.createElement("div"),p.xaxisTooltipText.classList.add("apexcharts-xaxistooltip-text"),p.xaxisTooltipText.style.fontFamily=h.config.xaxis.tooltip.style.fontFamily||h.config.chart.fontFamily,p.xaxisTooltipText.style.fontSize=h.config.xaxis.tooltip.style.fontSize,p.xaxisTooltip.appendChild(p.xaxisTooltipText))}},{key:"drawYaxisTooltip",value:function(){for(var h=this.w,p=this.ttCtx,S=0;S<h.config.yaxis.length;S++){var _=h.config.yaxis[S].opposite||h.config.yaxis[S].crosshairs.opposite;p.yaxisOffX=_?h.globals.gridWidth+1:1;var k="apexcharts-yaxistooltip apexcharts-yaxistooltip-".concat(S,_?" apexcharts-yaxistooltip-right":" apexcharts-yaxistooltip-left"),T=h.globals.dom.elWrap;h.globals.dom.baseEl.querySelector(".apexcharts-yaxistooltip apexcharts-yaxistooltip-".concat(S))===null&&(p.yaxisTooltip=document.createElement("div"),p.yaxisTooltip.setAttribute("class",k+" apexcharts-theme-"+h.config.tooltip.theme),T.appendChild(p.yaxisTooltip),S===0&&(p.yaxisTooltipText=[]),p.yaxisTooltipText[S]=document.createElement("div"),p.yaxisTooltipText[S].classList.add("apexcharts-yaxistooltip-text"),p.yaxisTooltip.appendChild(p.yaxisTooltipText[S]))}}},{key:"setXCrosshairWidth",value:function(){var h=this.w,p=this.ttCtx,S=p.getElXCrosshairs();if(p.xcrosshairsWidth=parseInt(h.config.xaxis.crosshairs.width,10),h.globals.comboCharts){var _=h.globals.dom.baseEl.querySelector(".apexcharts-bar-area");if(_!==null&&h.config.xaxis.crosshairs.width==="barWidth"){var k=parseFloat(_.getAttribute("barWidth"));p.xcrosshairsWidth=k}else if(h.config.xaxis.crosshairs.width==="tickWidth"){var T=h.globals.labels.length;p.xcrosshairsWidth=h.globals.gridWidth/T}}else if(h.config.xaxis.crosshairs.width==="tickWidth"){var B=h.globals.labels.length;p.xcrosshairsWidth=h.globals.gridWidth/B}else if(h.config.xaxis.crosshairs.width==="barWidth"){var q=h.globals.dom.baseEl.querySelector(".apexcharts-bar-area");if(q!==null){var te=parseFloat(q.getAttribute("barWidth"));p.xcrosshairsWidth=te}else p.xcrosshairsWidth=1}h.globals.isBarHorizontal&&(p.xcrosshairsWidth=0),S!==null&&p.xcrosshairsWidth>0&&S.setAttribute("width",p.xcrosshairsWidth)}},{key:"handleYCrosshair",value:function(){var h=this.w,p=this.ttCtx;p.ycrosshairs=h.globals.dom.baseEl.querySelector(".apexcharts-ycrosshairs"),p.ycrosshairsHidden=h.globals.dom.baseEl.querySelector(".apexcharts-ycrosshairs-hidden")}},{key:"drawYaxisTooltipText",value:function(h,p,S){var _=this.ttCtx,k=this.w,T=k.globals,B=T.seriesYAxisMap[h];if(_.yaxisTooltips[h]&&B.length>0){var q=T.yLabelFormatters[h],te=_.getElGrid().getBoundingClientRect(),ue=B[0],de=0;S.yRatio.length>1&&(de=ue);var xe=(p-te.top)*S.yRatio[de],Se=T.maxYArr[ue]-T.minYArr[ue],ke=T.minYArr[ue]+(Se-xe);k.config.yaxis[h].reversed&&(ke=T.maxYArr[ue]-(Se-xe)),_.tooltipPosition.moveYCrosshairs(p-te.top),_.yaxisTooltipText[h].innerHTML=q(ke),_.tooltipPosition.moveYAxisTooltip(h)}}}]),Ee}(),Dt=function(){function Ee(h){s(this,Ee),this.ctx=h,this.w=h.w;var p=this.w;this.tConfig=p.config.tooltip,this.tooltipUtil=new nt(this),this.tooltipLabels=new Ue(this),this.tooltipPosition=new Rt(this),this.marker=new We(this),this.intersect=new at(this),this.axesTooltip=new mt(this),this.showOnIntersect=this.tConfig.intersect,this.showTooltipTitle=this.tConfig.x.show,this.fixedTooltip=this.tConfig.fixed.enabled,this.xaxisTooltip=null,this.yaxisTTEls=null,this.isBarShared=!p.globals.isBarHorizontal&&this.tConfig.shared,this.lastHoverTime=Date.now()}return o(Ee,[{key:"getElTooltip",value:function(h){return h||(h=this),h.w.globals.dom.baseEl?h.w.globals.dom.baseEl.querySelector(".apexcharts-tooltip"):null}},{key:"getElXCrosshairs",value:function(){return this.w.globals.dom.baseEl.querySelector(".apexcharts-xcrosshairs")}},{key:"getElGrid",value:function(){return this.w.globals.dom.baseEl.querySelector(".apexcharts-grid")}},{key:"drawTooltip",value:function(h){var p=this.w;this.xyRatios=h,this.isXAxisTooltipEnabled=p.config.xaxis.tooltip.enabled&&p.globals.axisCharts,this.yaxisTooltips=p.config.yaxis.map(function(T,B){return!!(T.show&&T.tooltip.enabled&&p.globals.axisCharts)}),this.allTooltipSeriesGroups=[],p.globals.axisCharts||(this.showTooltipTitle=!1);var S=document.createElement("div");if(S.classList.add("apexcharts-tooltip"),p.config.tooltip.cssClass&&S.classList.add(p.config.tooltip.cssClass),S.classList.add("apexcharts-theme-".concat(this.tConfig.theme)),p.globals.dom.elWrap.appendChild(S),p.globals.axisCharts){this.axesTooltip.drawXaxisTooltip(),this.axesTooltip.drawYaxisTooltip(),this.axesTooltip.setXCrosshairWidth(),this.axesTooltip.handleYCrosshair();var _=new it(this.ctx);this.xAxisTicksPositions=_.getXAxisTicksPositions()}if(!p.globals.comboCharts&&!this.tConfig.intersect&&p.config.chart.type!=="rangeBar"||this.tConfig.shared||(this.showOnIntersect=!0),p.config.markers.size!==0&&p.globals.markers.largestSize!==0||this.marker.drawDynamicPoints(this),p.globals.collapsedSeries.length!==p.globals.series.length){this.dataPointsDividedHeight=p.globals.gridHeight/p.globals.dataPoints,this.dataPointsDividedWidth=p.globals.gridWidth/p.globals.dataPoints,this.showTooltipTitle&&(this.tooltipTitle=document.createElement("div"),this.tooltipTitle.classList.add("apexcharts-tooltip-title"),this.tooltipTitle.style.fontFamily=this.tConfig.style.fontFamily||p.config.chart.fontFamily,this.tooltipTitle.style.fontSize=this.tConfig.style.fontSize,S.appendChild(this.tooltipTitle));var k=p.globals.series.length;(p.globals.xyCharts||p.globals.comboCharts)&&this.tConfig.shared&&(k=this.showOnIntersect?1:p.globals.series.length),this.legendLabels=p.globals.dom.baseEl.querySelectorAll(".apexcharts-legend-text"),this.ttItems=this.createTTElements(k),this.addSVGEvents()}}},{key:"createTTElements",value:function(h){for(var p=this,S=this.w,_=[],k=this.getElTooltip(),T=function(q){var te=document.createElement("div");te.classList.add("apexcharts-tooltip-series-group","apexcharts-tooltip-series-group-".concat(q)),te.style.order=S.config.tooltip.inverseOrder?h-q:q+1;var ue=document.createElement("span");ue.classList.add("apexcharts-tooltip-marker"),ue.style.backgroundColor=S.globals.colors[q],te.appendChild(ue);var de=document.createElement("div");de.classList.add("apexcharts-tooltip-text"),de.style.fontFamily=p.tConfig.style.fontFamily||S.config.chart.fontFamily,de.style.fontSize=p.tConfig.style.fontSize,["y","goals","z"].forEach(function(xe){var Se=document.createElement("div");Se.classList.add("apexcharts-tooltip-".concat(xe,"-group"));var ke=document.createElement("span");ke.classList.add("apexcharts-tooltip-text-".concat(xe,"-label")),Se.appendChild(ke);var Re=document.createElement("span");Re.classList.add("apexcharts-tooltip-text-".concat(xe,"-value")),Se.appendChild(Re),de.appendChild(Se)}),te.appendChild(de),k.appendChild(te),_.push(te)},B=0;B<h;B++)T(B);return _}},{key:"addSVGEvents",value:function(){var h=this.w,p=h.config.chart.type,S=this.getElTooltip(),_=!(p!=="bar"&&p!=="candlestick"&&p!=="boxPlot"&&p!=="rangeBar"),k=p==="area"||p==="line"||p==="scatter"||p==="bubble"||p==="radar",T=h.globals.dom.Paper.node,B=this.getElGrid();B&&(this.seriesBound=B.getBoundingClientRect());var q,te=[],ue=[],de={hoverArea:T,elGrid:B,tooltipEl:S,tooltipY:te,tooltipX:ue,ttItems:this.ttItems};if(h.globals.axisCharts&&(k?q=h.globals.dom.baseEl.querySelectorAll(".apexcharts-series[data\\:longestSeries='true'] .apexcharts-marker"):_?q=h.globals.dom.baseEl.querySelectorAll(".apexcharts-series .apexcharts-bar-area, .apexcharts-series .apexcharts-candlestick-area, .apexcharts-series .apexcharts-boxPlot-area, .apexcharts-series .apexcharts-rangebar-area"):p!=="heatmap"&&p!=="treemap"||(q=h.globals.dom.baseEl.querySelectorAll(".apexcharts-series .apexcharts-heatmap, .apexcharts-series .apexcharts-treemap")),q&&q.length))for(var xe=0;xe<q.length;xe++)te.push(q[xe].getAttribute("cy")),ue.push(q[xe].getAttribute("cx"));if(h.globals.xyCharts&&!this.showOnIntersect||h.globals.comboCharts&&!this.showOnIntersect||_&&this.tooltipUtil.hasBars()&&this.tConfig.shared)this.addPathsEventListeners([T],de);else if(_&&!h.globals.comboCharts||k&&this.showOnIntersect)this.addDatapointEventsListeners(de);else if(!h.globals.axisCharts||p==="heatmap"||p==="treemap"){var Se=h.globals.dom.baseEl.querySelectorAll(".apexcharts-series");this.addPathsEventListeners(Se,de)}if(this.showOnIntersect){var ke=h.globals.dom.baseEl.querySelectorAll(".apexcharts-line-series .apexcharts-marker, .apexcharts-area-series .apexcharts-marker");ke.length>0&&this.addPathsEventListeners(ke,de),this.tooltipUtil.hasBars()&&!this.tConfig.shared&&this.addDatapointEventsListeners(de)}}},{key:"drawFixedTooltipRect",value:function(){var h=this.w,p=this.getElTooltip(),S=p.getBoundingClientRect(),_=S.width+10,k=S.height+10,T=this.tConfig.fixed.offsetX,B=this.tConfig.fixed.offsetY,q=this.tConfig.fixed.position.toLowerCase();return q.indexOf("right")>-1&&(T=T+h.globals.svgWidth-_+10),q.indexOf("bottom")>-1&&(B=B+h.globals.svgHeight-k-10),p.style.left=T+"px",p.style.top=B+"px",{x:T,y:B,ttWidth:_,ttHeight:k}}},{key:"addDatapointEventsListeners",value:function(h){var p=this.w.globals.dom.baseEl.querySelectorAll(".apexcharts-series-markers .apexcharts-marker, .apexcharts-bar-area, .apexcharts-candlestick-area, .apexcharts-boxPlot-area, .apexcharts-rangebar-area");this.addPathsEventListeners(p,h)}},{key:"addPathsEventListeners",value:function(h,p){for(var S=this,_=function(T){var B={paths:h[T],tooltipEl:p.tooltipEl,tooltipY:p.tooltipY,tooltipX:p.tooltipX,elGrid:p.elGrid,hoverArea:p.hoverArea,ttItems:p.ttItems};["mousemove","mouseup","touchmove","mouseout","touchend"].map(function(q){return h[T].addEventListener(q,S.onSeriesHover.bind(S,B),{capture:!1,passive:!0})})},k=0;k<h.length;k++)_(k)}},{key:"onSeriesHover",value:function(h,p){var S=this,_=Date.now()-this.lastHoverTime;_>=100?this.seriesHover(h,p):(clearTimeout(this.seriesHoverTimeout),this.seriesHoverTimeout=setTimeout(function(){S.seriesHover(h,p)},100-_))}},{key:"seriesHover",value:function(h,p){var S=this;this.lastHoverTime=Date.now();var _=[],k=this.w;k.config.chart.group&&(_=this.ctx.getGroupedCharts()),k.globals.axisCharts&&(k.globals.minX===-1/0&&k.globals.maxX===1/0||k.globals.dataPoints===0)||(_.length?_.forEach(function(T){var B=S.getElTooltip(T),q={paths:h.paths,tooltipEl:B,tooltipY:h.tooltipY,tooltipX:h.tooltipX,elGrid:h.elGrid,hoverArea:h.hoverArea,ttItems:T.w.globals.tooltip.ttItems};T.w.globals.minX===S.w.globals.minX&&T.w.globals.maxX===S.w.globals.maxX&&T.w.globals.tooltip.seriesHoverByContext({chartCtx:T,ttCtx:T.w.globals.tooltip,opt:q,e:p})}):this.seriesHoverByContext({chartCtx:this.ctx,ttCtx:this.w.globals.tooltip,opt:h,e:p}))}},{key:"seriesHoverByContext",value:function(h){var p=h.chartCtx,S=h.ttCtx,_=h.opt,k=h.e,T=p.w,B=this.getElTooltip(p);B&&(S.tooltipRect={x:0,y:0,ttWidth:B.getBoundingClientRect().width,ttHeight:B.getBoundingClientRect().height},S.e=k,S.tooltipUtil.hasBars()&&!T.globals.comboCharts&&!S.isBarShared&&this.tConfig.onDatasetHover.highlightDataSeries&&new Le(p).toggleSeriesOnHover(k,k.target.parentNode),S.fixedTooltip&&S.drawFixedTooltipRect(),T.globals.axisCharts?S.axisChartsTooltips({e:k,opt:_,tooltipRect:S.tooltipRect}):S.nonAxisChartsTooltips({e:k,opt:_,tooltipRect:S.tooltipRect}))}},{key:"axisChartsTooltips",value:function(h){var p,S,_=h.e,k=h.opt,T=this.w,B=k.elGrid.getBoundingClientRect(),q=_.type==="touchmove"?_.touches[0].clientX:_.clientX,te=_.type==="touchmove"?_.touches[0].clientY:_.clientY;if(this.clientY=te,this.clientX=q,T.globals.capturedSeriesIndex=-1,T.globals.capturedDataPointIndex=-1,te<B.top||te>B.top+B.height)this.handleMouseOut(k);else{if(Array.isArray(this.tConfig.enabledOnSeries)&&!T.config.tooltip.shared){var ue=parseInt(k.paths.getAttribute("index"),10);if(this.tConfig.enabledOnSeries.indexOf(ue)<0)return void this.handleMouseOut(k)}var de=this.getElTooltip(),xe=this.getElXCrosshairs(),Se=[];T.config.chart.group&&(Se=this.ctx.getSyncedCharts());var ke=T.globals.xyCharts||T.config.chart.type==="bar"&&!T.globals.isBarHorizontal&&this.tooltipUtil.hasBars()&&this.tConfig.shared||T.globals.comboCharts&&this.tooltipUtil.hasBars();if(_.type==="mousemove"||_.type==="touchmove"||_.type==="mouseup"){if(T.globals.collapsedSeries.length+T.globals.ancillaryCollapsedSeries.length===T.globals.series.length)return;xe!==null&&xe.classList.add("apexcharts-active");var Re=this.yaxisTooltips.filter(function(st){return st===!0});if(this.ycrosshairs!==null&&Re.length&&this.ycrosshairs.classList.add("apexcharts-active"),ke&&!this.showOnIntersect||Se.length>1)this.handleStickyTooltip(_,q,te,k);else if(T.config.chart.type==="heatmap"||T.config.chart.type==="treemap"){var Ge=this.intersect.handleHeatTreeTooltip({e:_,opt:k,x:p,y:S,type:T.config.chart.type});p=Ge.x,S=Ge.y,de.style.left=p+"px",de.style.top=S+"px"}else this.tooltipUtil.hasBars()&&this.intersect.handleBarTooltip({e:_,opt:k}),this.tooltipUtil.hasMarkers()&&this.intersect.handleMarkerTooltip({e:_,opt:k,x:p,y:S});if(this.yaxisTooltips.length)for(var Fe=0;Fe<T.config.yaxis.length;Fe++)this.axesTooltip.drawYaxisTooltipText(Fe,te,this.xyRatios);T.globals.dom.baseEl.classList.add("apexcharts-tooltip-active"),k.tooltipEl.classList.add("apexcharts-active")}else _.type!=="mouseout"&&_.type!=="touchend"||this.handleMouseOut(k)}}},{key:"nonAxisChartsTooltips",value:function(h){var p=h.e,S=h.opt,_=h.tooltipRect,k=this.w,T=S.paths.getAttribute("rel"),B=this.getElTooltip(),q=k.globals.dom.elWrap.getBoundingClientRect();if(p.type==="mousemove"||p.type==="touchmove"){k.globals.dom.baseEl.classList.add("apexcharts-tooltip-active"),B.classList.add("apexcharts-active"),this.tooltipLabels.drawSeriesTexts({ttItems:S.ttItems,i:parseInt(T,10)-1,shared:!1});var te=k.globals.clientX-q.left-_.ttWidth/2,ue=k.globals.clientY-q.top-_.ttHeight-10;if(B.style.left=te+"px",B.style.top=ue+"px",k.config.legend.tooltipHoverFormatter){var de=T-1,xe=(0,k.config.legend.tooltipHoverFormatter)(this.legendLabels[de].getAttribute("data:default-text"),{seriesIndex:de,dataPointIndex:de,w:k});this.legendLabels[de].innerHTML=xe}}else p.type!=="mouseout"&&p.type!=="touchend"||(B.classList.remove("apexcharts-active"),k.globals.dom.baseEl.classList.remove("apexcharts-tooltip-active"),k.config.legend.tooltipHoverFormatter&&this.legendLabels.forEach(function(Se){var ke=Se.getAttribute("data:default-text");Se.innerHTML=decodeURIComponent(ke)}))}},{key:"handleStickyTooltip",value:function(h,p,S,_){var k=this.w,T=this.tooltipUtil.getNearestValues({context:this,hoverArea:_.hoverArea,elGrid:_.elGrid,clientX:p,clientY:S}),B=T.j,q=T.capturedSeries;k.globals.collapsedSeriesIndices.includes(q)&&(q=null);var te=_.elGrid.getBoundingClientRect();if(T.hoverX<0||T.hoverX>te.width)this.handleMouseOut(_);else if(q!==null)this.handleStickyCapturedSeries(h,q,_,B);else if(this.tooltipUtil.isXoverlap(B)||k.globals.isBarHorizontal){var ue=k.globals.series.findIndex(function(de,xe){return!k.globals.collapsedSeriesIndices.includes(xe)});this.create(h,this,ue,B,_.ttItems)}}},{key:"handleStickyCapturedSeries",value:function(h,p,S,_){var k=this.w;if(!this.tConfig.shared&&k.globals.series[p][_]===null)return void this.handleMouseOut(S);if(k.globals.series[p][_]!==void 0)this.tConfig.shared&&this.tooltipUtil.isXoverlap(_)&&this.tooltipUtil.isInitialSeriesSameLen()?this.create(h,this,p,_,S.ttItems):this.create(h,this,p,_,S.ttItems,!1);else if(this.tooltipUtil.isXoverlap(_)){var T=k.globals.series.findIndex(function(B,q){return!k.globals.collapsedSeriesIndices.includes(q)});this.create(h,this,T,_,S.ttItems)}}},{key:"deactivateHoverFilter",value:function(){for(var h=this.w,p=new z(this.ctx),S=h.globals.dom.Paper.select(".apexcharts-bar-area"),_=0;_<S.length;_++)p.pathMouseLeave(S[_])}},{key:"handleMouseOut",value:function(h){var p=this.w,S=this.getElXCrosshairs();if(p.globals.dom.baseEl.classList.remove("apexcharts-tooltip-active"),h.tooltipEl.classList.remove("apexcharts-active"),this.deactivateHoverFilter(),p.config.chart.type!=="bubble"&&this.marker.resetPointsSize(),S!==null&&S.classList.remove("apexcharts-active"),this.ycrosshairs!==null&&this.ycrosshairs.classList.remove("apexcharts-active"),this.isXAxisTooltipEnabled&&this.xaxisTooltip.classList.remove("apexcharts-active"),this.yaxisTooltips.length){this.yaxisTTEls===null&&(this.yaxisTTEls=p.globals.dom.baseEl.querySelectorAll(".apexcharts-yaxistooltip"));for(var _=0;_<this.yaxisTTEls.length;_++)this.yaxisTTEls[_].classList.remove("apexcharts-active")}p.config.legend.tooltipHoverFormatter&&this.legendLabels.forEach(function(k){var T=k.getAttribute("data:default-text");k.innerHTML=decodeURIComponent(T)})}},{key:"markerClick",value:function(h,p,S){var _=this.w;typeof _.config.chart.events.markerClick=="function"&&_.config.chart.events.markerClick(h,this.ctx,{seriesIndex:p,dataPointIndex:S,w:_}),this.ctx.events.fireEvent("markerClick",[h,this.ctx,{seriesIndex:p,dataPointIndex:S,w:_}])}},{key:"create",value:function(h,p,S,_,k){var T,B,q,te,ue,de,xe,Se,ke,Re,Ge,Fe,st,se,Ce,Be,De=arguments.length>5&&arguments[5]!==void 0?arguments[5]:null,_e=this.w,Je=p;h.type==="mouseup"&&this.markerClick(h,S,_),De===null&&(De=this.tConfig.shared);var ct=this.tooltipUtil.hasMarkers(S),gt=this.tooltipUtil.getElBars();if(_e.config.legend.tooltipHoverFormatter){var Xt=_e.config.legend.tooltipHoverFormatter,wt=Array.from(this.legendLabels);wt.forEach(function(Pn){var En=Pn.getAttribute("data:default-text");Pn.innerHTML=decodeURIComponent(En)});for(var Xe=0;Xe<wt.length;Xe++){var Oe=wt[Xe],bt=parseInt(Oe.getAttribute("i"),10),kt=decodeURIComponent(Oe.getAttribute("data:default-text")),Ut=Xt(kt,{seriesIndex:De?bt:S,dataPointIndex:_,w:_e});if(De)Oe.innerHTML=_e.globals.collapsedSeriesIndices.indexOf(bt)<0?Ut:kt;else if(Oe.innerHTML=bt===S?Ut:kt,S===bt)break}}var fn=v(v({ttItems:k,i:S,j:_},((T=_e.globals.seriesRange)===null||T===void 0||(B=T[S])===null||B===void 0||(q=B[_])===null||q===void 0||(te=q.y[0])===null||te===void 0?void 0:te.y1)!==void 0&&{y1:(ue=_e.globals.seriesRange)===null||ue===void 0||(de=ue[S])===null||de===void 0||(xe=de[_])===null||xe===void 0||(Se=xe.y[0])===null||Se===void 0?void 0:Se.y1}),((ke=_e.globals.seriesRange)===null||ke===void 0||(Re=ke[S])===null||Re===void 0||(Ge=Re[_])===null||Ge===void 0||(Fe=Ge.y[0])===null||Fe===void 0?void 0:Fe.y2)!==void 0&&{y2:(st=_e.globals.seriesRange)===null||st===void 0||(se=st[S])===null||se===void 0||(Ce=se[_])===null||Ce===void 0||(Be=Ce.y[0])===null||Be===void 0?void 0:Be.y2});if(De){if(Je.tooltipLabels.drawSeriesTexts(v(v({},fn),{},{shared:!this.showOnIntersect&&this.tConfig.shared})),ct)_e.globals.markers.largestSize>0?Je.marker.enlargePoints(_):Je.tooltipPosition.moveDynamicPointsOnHover(_);else if(this.tooltipUtil.hasBars()&&(this.barSeriesHeight=this.tooltipUtil.getBarsHeight(gt),this.barSeriesHeight>0)){var On=new z(this.ctx),Sn=_e.globals.dom.Paper.select(".apexcharts-bar-area[j='".concat(_,"']"));this.deactivateHoverFilter(),this.tooltipPosition.moveStickyTooltipOverBars(_,S);for(var yr=0;yr<Sn.length;yr++)On.pathMouseEnter(Sn[yr])}}else Je.tooltipLabels.drawSeriesTexts(v({shared:!1},fn)),this.tooltipUtil.hasBars()&&Je.tooltipPosition.moveStickyTooltipOverBars(_,S),ct&&Je.tooltipPosition.moveMarkers(S,_)}}]),Ee}(),Tt=function(){function Ee(h){s(this,Ee),this.w=h.w,this.barCtx=h,this.totalFormatter=this.w.config.plotOptions.bar.dataLabels.total.formatter,this.totalFormatter||(this.totalFormatter=this.w.config.dataLabels.formatter)}return o(Ee,[{key:"handleBarDataLabels",value:function(h){var p,S,_=h.x,k=h.y,T=h.y1,B=h.y2,q=h.i,te=h.j,ue=h.realIndex,de=h.columnGroupIndex,xe=h.series,Se=h.barHeight,ke=h.barWidth,Re=h.barXPosition,Ge=h.barYPosition,Fe=h.visibleSeries,st=h.renderedPath,se=this.w,Ce=new z(this.barCtx.ctx),Be=Array.isArray(this.barCtx.strokeWidth)?this.barCtx.strokeWidth[ue]:this.barCtx.strokeWidth;se.globals.isXNumeric&&!se.globals.isBarHorizontal?(p=_+parseFloat(ke*(Fe+1)),S=k+parseFloat(Se*(Fe+1))-Be):(p=_+parseFloat(ke*Fe),S=k+parseFloat(Se*Fe));var De,_e=null,Je=_,ct=k,gt={},Xt=se.config.dataLabels,wt=this.barCtx.barOptions.dataLabels,Xe=this.barCtx.barOptions.dataLabels.total;Ge!==void 0&&this.barCtx.isRangeBar&&(S=Ge,ct=Ge),Re!==void 0&&this.barCtx.isVerticalGroupedRangeBar&&(p=Re,Je=Re);var Oe=Xt.offsetX,bt=Xt.offsetY,kt={width:0,height:0};if(se.config.dataLabels.enabled){var Ut=se.globals.series[q][te];kt=Ce.getTextRects(se.config.dataLabels.formatter?se.config.dataLabels.formatter(Ut,v(v({},se),{},{seriesIndex:q,dataPointIndex:te,w:se})):se.globals.yLabelFormatters[0](Ut),parseFloat(Xt.style.fontSize))}var fn={x:_,y:k,i:q,j:te,realIndex:ue,columnGroupIndex:de,renderedPath:st,bcx:p,bcy:S,barHeight:Se,barWidth:ke,textRects:kt,strokeWidth:Be,dataLabelsX:Je,dataLabelsY:ct,dataLabelsConfig:Xt,barDataLabelsConfig:wt,barTotalDataLabelsConfig:Xe,offX:Oe,offY:bt};return gt=this.barCtx.isHorizontal?this.calculateBarsDataLabelsPosition(fn):this.calculateColumnsDataLabelsPosition(fn),st.attr({cy:gt.bcy,cx:gt.bcx,j:te,val:se.globals.series[q][te],barHeight:Se,barWidth:ke}),De=this.drawCalculatedDataLabels({x:gt.dataLabelsX,y:gt.dataLabelsY,val:this.barCtx.isRangeBar?[T,B]:se.config.chart.stackType==="100%"?xe[ue][te]:se.globals.series[ue][te],i:ue,j:te,barWidth:ke,barHeight:Se,textRects:kt,dataLabelsConfig:Xt}),se.config.chart.stacked&&Xe.enabled&&(_e=this.drawTotalDataLabels({x:gt.totalDataLabelsX,y:gt.totalDataLabelsY,barWidth:ke,barHeight:Se,realIndex:ue,textAnchor:gt.totalDataLabelsAnchor,val:this.getStackedTotalDataLabel({realIndex:ue,j:te}),dataLabelsConfig:Xt,barTotalDataLabelsConfig:Xe})),{dataLabels:De,totalDataLabels:_e}}},{key:"getStackedTotalDataLabel",value:function(h){var p=h.realIndex,S=h.j,_=this.w,k=this.barCtx.stackedSeriesTotals[S];return this.totalFormatter&&(k=this.totalFormatter(k,v(v({},_),{},{seriesIndex:p,dataPointIndex:S,w:_}))),k}},{key:"calculateColumnsDataLabelsPosition",value:function(h){var p=this.w,S=h.i,_=h.j,k=h.realIndex;h.columnGroupIndex;var T,B,q=h.y,te=h.bcx,ue=h.barWidth,de=h.barHeight,xe=h.textRects,Se=h.dataLabelsX,ke=h.dataLabelsY,Re=h.dataLabelsConfig,Ge=h.barDataLabelsConfig,Fe=h.barTotalDataLabelsConfig,st=h.strokeWidth,se=h.offX,Ce=h.offY,Be=te;de=Math.abs(de);var De=p.config.plotOptions.bar.dataLabels.orientation==="vertical",_e=this.barCtx.barHelpers.getZeroValueEncounters({i:S,j:_}).zeroEncounters;te-=st/2;var Je=p.globals.gridWidth/p.globals.dataPoints;this.barCtx.isVerticalGroupedRangeBar?Se+=ue/2:(Se=p.globals.isXNumeric?te-ue/2+se:te-Je+ue/2+se,_e>0&&p.config.plotOptions.bar.hideZeroBarsWhenGrouped&&(Se-=ue*_e)),De&&(Se=Se+xe.height/2-st/2-2);var ct=p.globals.series[S][_]<0,gt=q;switch(this.barCtx.isReversed&&(gt=q+(ct?de:-de)),Ge.position){case"center":ke=De?ct?gt-de/2+Ce:gt+de/2-Ce:ct?gt-de/2+xe.height/2+Ce:gt+de/2+xe.height/2-Ce;break;case"bottom":ke=De?ct?gt-de+Ce:gt+de-Ce:ct?gt-de+xe.height+st+Ce:gt+de-xe.height/2+st-Ce;break;case"top":ke=De?ct?gt+Ce:gt-Ce:ct?gt-xe.height/2-Ce:gt+xe.height+Ce}if(this.barCtx.lastActiveBarSerieIndex===k&&Fe.enabled){var Xt=new z(this.barCtx.ctx).getTextRects(this.getStackedTotalDataLabel({realIndex:k,j:_}),Re.fontSize);T=ct?gt-Xt.height/2-Ce-Fe.offsetY+18:gt+Xt.height+Ce+Fe.offsetY-18;var wt=Je;B=Be+(p.globals.isXNumeric?-ue*p.globals.barGroups.length/2:p.globals.barGroups.length*ue/2-(p.globals.barGroups.length-1)*ue-wt)+Fe.offsetX}return p.config.chart.stacked||(ke<0?ke=0+st:ke+xe.height/3>p.globals.gridHeight&&(ke=p.globals.gridHeight-st)),{bcx:te,bcy:q,dataLabelsX:Se,dataLabelsY:ke,totalDataLabelsX:B,totalDataLabelsY:T,totalDataLabelsAnchor:"middle"}}},{key:"calculateBarsDataLabelsPosition",value:function(h){var p=this.w,S=h.x,_=h.i,k=h.j,T=h.realIndex,B=h.bcy,q=h.barHeight,te=h.barWidth,ue=h.textRects,de=h.dataLabelsX,xe=h.strokeWidth,Se=h.dataLabelsConfig,ke=h.barDataLabelsConfig,Re=h.barTotalDataLabelsConfig,Ge=h.offX,Fe=h.offY,st=p.globals.gridHeight/p.globals.dataPoints;te=Math.abs(te);var se,Ce,Be=B-(this.barCtx.isRangeBar?0:st)+q/2+ue.height/2+Fe-3,De="start",_e=p.globals.series[_][k]<0,Je=S;switch(this.barCtx.isReversed&&(Je=S+(_e?-te:te),De=_e?"start":"end"),ke.position){case"center":de=_e?Je+te/2-Ge:Math.max(ue.width/2,Je-te/2)+Ge;break;case"bottom":de=_e?Je+te-xe-Ge:Je-te+xe+Ge;break;case"top":de=_e?Je-xe-Ge:Je-xe+Ge}if(this.barCtx.lastActiveBarSerieIndex===T&&Re.enabled){var ct=new z(this.barCtx.ctx).getTextRects(this.getStackedTotalDataLabel({realIndex:T,j:k}),Se.fontSize);_e?(se=Je-xe-Ge-Re.offsetX,De="end"):se=Je+Ge+Re.offsetX+(this.barCtx.isReversed?-(te+xe):xe),Ce=Be-ue.height/2+ct.height/2+Re.offsetY+xe}return p.config.chart.stacked||(Se.textAnchor==="start"?de-ue.width<0?de=_e?ue.width+xe:xe:de+ue.width>p.globals.gridWidth&&(de=_e?p.globals.gridWidth-xe:p.globals.gridWidth-ue.width-xe):Se.textAnchor==="middle"?de-ue.width/2<0?de=ue.width/2+xe:de+ue.width/2>p.globals.gridWidth&&(de=p.globals.gridWidth-ue.width/2-xe):Se.textAnchor==="end"&&(de<1?de=ue.width+xe:de+1>p.globals.gridWidth&&(de=p.globals.gridWidth-ue.width-xe))),{bcx:S,bcy:B,dataLabelsX:de,dataLabelsY:Be,totalDataLabelsX:se,totalDataLabelsY:Ce,totalDataLabelsAnchor:De}}},{key:"drawCalculatedDataLabels",value:function(h){var p=h.x,S=h.y,_=h.val,k=h.i,T=h.j,B=h.textRects,q=h.barHeight,te=h.barWidth,ue=h.dataLabelsConfig,de=this.w,xe="rotate(0)";de.config.plotOptions.bar.dataLabels.orientation==="vertical"&&(xe="rotate(-90, ".concat(p,", ").concat(S,")"));var Se=new Ie(this.barCtx.ctx),ke=new z(this.barCtx.ctx),Re=ue.formatter,Ge=null,Fe=de.globals.collapsedSeriesIndices.indexOf(k)>-1;if(ue.enabled&&!Fe){Ge=ke.group({class:"apexcharts-data-labels",transform:xe});var st="";_!==void 0&&(st=Re(_,v(v({},de),{},{seriesIndex:k,dataPointIndex:T,w:de}))),!_&&de.config.plotOptions.bar.hideZeroBarsWhenGrouped&&(st="");var se=de.globals.series[k][T]<0,Ce=de.config.plotOptions.bar.dataLabels.position;de.config.plotOptions.bar.dataLabels.orientation==="vertical"&&(Ce==="top"&&(ue.textAnchor=se?"end":"start"),Ce==="center"&&(ue.textAnchor="middle"),Ce==="bottom"&&(ue.textAnchor=se?"end":"start")),this.barCtx.isRangeBar&&this.barCtx.barOptions.dataLabels.hideOverflowingLabels&&te<ke.getTextRects(st,parseFloat(ue.style.fontSize)).width&&(st=""),de.config.chart.stacked&&this.barCtx.barOptions.dataLabels.hideOverflowingLabels&&(this.barCtx.isHorizontal?B.width/1.6>Math.abs(te)&&(st=""):B.height/1.6>Math.abs(q)&&(st=""));var Be=v({},ue);this.barCtx.isHorizontal&&_<0&&(ue.textAnchor==="start"?Be.textAnchor="end":ue.textAnchor==="end"&&(Be.textAnchor="start")),Se.plotDataLabelsText({x:p,y:S,text:st,i:k,j:T,parent:Ge,dataLabelsConfig:Be,alwaysDrawDataLabel:!0,offsetCorrection:!0})}return Ge}},{key:"drawTotalDataLabels",value:function(h){var p=h.x,S=h.y,_=h.val,k=h.realIndex,T=h.textAnchor,B=h.barTotalDataLabelsConfig;this.w;var q,te=new z(this.barCtx.ctx);return B.enabled&&p!==void 0&&S!==void 0&&this.barCtx.lastActiveBarSerieIndex===k&&(q=te.drawText({x:p,y:S,foreColor:B.style.color,text:_,textAnchor:T,fontFamily:B.style.fontFamily,fontSize:B.style.fontSize,fontWeight:B.style.fontWeight})),q}}]),Ee}(),dn=function(){function Ee(h){s(this,Ee),this.w=h.w,this.barCtx=h}return o(Ee,[{key:"initVariables",value:function(h){var p=this.w;this.barCtx.series=h,this.barCtx.totalItems=0,this.barCtx.seriesLen=0,this.barCtx.visibleI=-1,this.barCtx.visibleItems=1;for(var S=0;S<h.length;S++)if(h[S].length>0&&(this.barCtx.seriesLen=this.barCtx.seriesLen+1,this.barCtx.totalItems+=h[S].length),p.globals.isXNumeric)for(var _=0;_<h[S].length;_++)p.globals.seriesX[S][_]>p.globals.minX&&p.globals.seriesX[S][_]<p.globals.maxX&&this.barCtx.visibleItems++;else this.barCtx.visibleItems=p.globals.dataPoints;this.arrBorderRadius=this.createBorderRadiusArr(p.globals.series),this.barCtx.seriesLen===0&&(this.barCtx.seriesLen=1),this.barCtx.zeroSerieses=[],p.globals.comboCharts||this.checkZeroSeries({series:h})}},{key:"initialPositions",value:function(){var h,p,S,_,k,T,B,q,te=this.w,ue=te.globals.dataPoints;this.barCtx.isRangeBar&&(ue=te.globals.labels.length);var de=this.barCtx.seriesLen;if(te.config.plotOptions.bar.rangeBarGroupRows&&(de=1),this.barCtx.isHorizontal)k=(S=te.globals.gridHeight/ue)/de,te.globals.isXNumeric&&(k=(S=te.globals.gridHeight/this.barCtx.totalItems)/this.barCtx.seriesLen),k=k*parseInt(this.barCtx.barOptions.barHeight,10)/100,String(this.barCtx.barOptions.barHeight).indexOf("%")===-1&&(k=parseInt(this.barCtx.barOptions.barHeight,10)),q=this.barCtx.baseLineInvertedY+te.globals.padHorizontal+(this.barCtx.isReversed?te.globals.gridWidth:0)-(this.barCtx.isReversed?2*this.barCtx.baseLineInvertedY:0),this.barCtx.isFunnel&&(q=te.globals.gridWidth/2),p=(S-k*this.barCtx.seriesLen)/2;else{if(_=te.globals.gridWidth/this.barCtx.visibleItems,te.config.xaxis.convertedCatToNumeric&&(_=te.globals.gridWidth/te.globals.dataPoints),T=_/de*parseInt(this.barCtx.barOptions.columnWidth,10)/100,te.globals.isXNumeric){var xe=this.barCtx.xRatio;te.globals.minXDiff&&te.globals.minXDiff!==.5&&te.globals.minXDiff/xe>0&&(_=te.globals.minXDiff/xe),(T=_/de*parseInt(this.barCtx.barOptions.columnWidth,10)/100)<1&&(T=1)}String(this.barCtx.barOptions.columnWidth).indexOf("%")===-1&&(T=parseInt(this.barCtx.barOptions.columnWidth,10)),B=te.globals.gridHeight-this.barCtx.baseLineY[this.barCtx.translationsIndex]-(this.barCtx.isReversed?te.globals.gridHeight:0)+(this.barCtx.isReversed?2*this.barCtx.baseLineY[this.barCtx.translationsIndex]:0),h=te.globals.padHorizontal+(_-T*this.barCtx.seriesLen)/2}return te.globals.barHeight=k,te.globals.barWidth=T,{x:h,y:p,yDivision:S,xDivision:_,barHeight:k,barWidth:T,zeroH:B,zeroW:q}}},{key:"initializeStackedPrevVars",value:function(h){h.w.globals.seriesGroups.forEach(function(p){h[p]||(h[p]={}),h[p].prevY=[],h[p].prevX=[],h[p].prevYF=[],h[p].prevXF=[],h[p].prevYVal=[],h[p].prevXVal=[]})}},{key:"initializeStackedXYVars",value:function(h){h.w.globals.seriesGroups.forEach(function(p){h[p]||(h[p]={}),h[p].xArrj=[],h[p].xArrjF=[],h[p].xArrjVal=[],h[p].yArrj=[],h[p].yArrjF=[],h[p].yArrjVal=[]})}},{key:"getPathFillColor",value:function(h,p,S,_){var k,T,B,q,te,ue=this.w,de=this.barCtx.ctx.fill,xe=null,Se=this.barCtx.barOptions.distributed?S:p;return this.barCtx.barOptions.colors.ranges.length>0&&this.barCtx.barOptions.colors.ranges.map(function(ke){h[p][S]>=ke.from&&h[p][S]<=ke.to&&(xe=ke.color)}),(k=ue.config.series[p].data[S])!==null&&k!==void 0&&k.fillColor&&(xe=ue.config.series[p].data[S].fillColor),de.fillPath({seriesNumber:this.barCtx.barOptions.distributed?Se:_,dataPointIndex:S,color:xe,value:h[p][S],fillConfig:(T=ue.config.series[p].data[S])===null||T===void 0?void 0:T.fill,fillType:(B=ue.config.series[p].data[S])!==null&&B!==void 0&&(q=B.fill)!==null&&q!==void 0&&q.type?(te=ue.config.series[p].data[S])===null||te===void 0?void 0:te.fill.type:Array.isArray(ue.config.fill.type)?ue.config.fill.type[_]:ue.config.fill.type})}},{key:"getStrokeWidth",value:function(h,p,S){var _=0,k=this.w;return this.barCtx.series[h][p]?this.barCtx.isNullValue=!1:this.barCtx.isNullValue=!0,k.config.stroke.show&&(this.barCtx.isNullValue||(_=Array.isArray(this.barCtx.strokeWidth)?this.barCtx.strokeWidth[S]:this.barCtx.strokeWidth)),_}},{key:"createBorderRadiusArr",value:function(h){var p=this.w,S=!this.w.config.chart.stacked||p.config.plotOptions.bar.borderRadiusWhenStacked!=="last"||p.config.plotOptions.bar.borderRadius<=0,_=h.length,k=h[0].length,T=Array.from({length:_},function(){return Array(k).fill(S?"top":"none")});if(S)return T;for(var B=0;B<k;B++){for(var q=[],te=[],ue=0,de=0;de<_;de++){var xe=h[de][B];xe>0?(q.push(de),ue++):xe<0&&(te.push(de),ue++)}if(q.length>0&&te.length===0)if(q.length===1)T[q[0]][B]="both";else{var Se,ke=q[0],Re=q[q.length-1],Ge=l(q);try{for(Ge.s();!(Se=Ge.n()).done;){var Fe=Se.value;T[Fe][B]=Fe===ke?"bottom":Fe===Re?"top":"none"}}catch(bt){Ge.e(bt)}finally{Ge.f()}}else if(te.length>0&&q.length===0)if(te.length===1)T[te[0]][B]="both";else{var st,se=te[0],Ce=te[te.length-1],Be=l(te);try{for(Be.s();!(st=Be.n()).done;){var De=st.value;T[De][B]=De===se?"bottom":De===Ce?"top":"none"}}catch(bt){Be.e(bt)}finally{Be.f()}}else if(q.length>0&&te.length>0){var _e,Je=q[q.length-1],ct=l(q);try{for(ct.s();!(_e=ct.n()).done;){var gt=_e.value;T[gt][B]=gt===Je?"top":"none"}}catch(bt){ct.e(bt)}finally{ct.f()}var Xt,wt=te[te.length-1],Xe=l(te);try{for(Xe.s();!(Xt=Xe.n()).done;){var Oe=Xt.value;T[Oe][B]=Oe===wt?"bottom":"none"}}catch(bt){Xe.e(bt)}finally{Xe.f()}}else ue===1&&(T[q[0]||te[0]][B]="both")}return T}},{key:"barBackground",value:function(h){var p=h.j,S=h.i,_=h.x1,k=h.x2,T=h.y1,B=h.y2,q=h.elSeries,te=this.w,ue=new z(this.barCtx.ctx),de=new Le(this.barCtx.ctx).getActiveConfigSeriesIndex();if(this.barCtx.barOptions.colors.backgroundBarColors.length>0&&de===S){p>=this.barCtx.barOptions.colors.backgroundBarColors.length&&(p%=this.barCtx.barOptions.colors.backgroundBarColors.length);var xe=this.barCtx.barOptions.colors.backgroundBarColors[p],Se=ue.drawRect(_!==void 0?_:0,T!==void 0?T:0,k!==void 0?k:te.globals.gridWidth,B!==void 0?B:te.globals.gridHeight,this.barCtx.barOptions.colors.backgroundBarRadius,xe,this.barCtx.barOptions.colors.backgroundBarOpacity);q.add(Se),Se.node.classList.add("apexcharts-backgroundBar")}}},{key:"getColumnPaths",value:function(h){var p,S=h.barWidth,_=h.barXPosition,k=h.y1,T=h.y2,B=h.strokeWidth,q=h.isReversed,te=h.series,ue=h.seriesGroup,de=h.realIndex,xe=h.i,Se=h.j,ke=h.w,Re=new z(this.barCtx.ctx);(B=Array.isArray(B)?B[de]:B)||(B=0);var Ge=S,Fe=_;(p=ke.config.series[de].data[Se])!==null&&p!==void 0&&p.columnWidthOffset&&(Fe=_-ke.config.series[de].data[Se].columnWidthOffset/2,Ge=S+ke.config.series[de].data[Se].columnWidthOffset);var st=B/2,se=Fe+st,Ce=Fe+Ge-st,Be=(te[xe][Se]>=0?1:-1)*(q?-1:1);k+=.001-st*Be,T+=.001+st*Be;var De=Re.move(se,k),_e=Re.move(se,k),Je=Re.line(Ce,k);if(ke.globals.previousPaths.length>0&&(_e=this.barCtx.getPreviousPath(de,Se,!1)),De=De+Re.line(se,T)+Re.line(Ce,T)+Je+(ke.config.plotOptions.bar.borderRadiusApplication==="around"||this.arrBorderRadius[de][Se]==="both"?" Z":" z"),_e=_e+Re.line(se,k)+Je+Je+Je+Je+Je+Re.line(se,k)+(ke.config.plotOptions.bar.borderRadiusApplication==="around"||this.arrBorderRadius[de][Se]==="both"?" Z":" z"),this.arrBorderRadius[de][Se]!=="none"&&(De=Re.roundPathCorners(De,ke.config.plotOptions.bar.borderRadius)),ke.config.chart.stacked){var ct=this.barCtx;(ct=this.barCtx[ue]).yArrj.push(T-st*Be),ct.yArrjF.push(Math.abs(k-T+B*Be)),ct.yArrjVal.push(this.barCtx.series[xe][Se])}return{pathTo:De,pathFrom:_e}}},{key:"getBarpaths",value:function(h){var p,S=h.barYPosition,_=h.barHeight,k=h.x1,T=h.x2,B=h.strokeWidth,q=h.isReversed,te=h.series,ue=h.seriesGroup,de=h.realIndex,xe=h.i,Se=h.j,ke=h.w,Re=new z(this.barCtx.ctx);(B=Array.isArray(B)?B[de]:B)||(B=0);var Ge=S,Fe=_;(p=ke.config.series[de].data[Se])!==null&&p!==void 0&&p.barHeightOffset&&(Ge=S-ke.config.series[de].data[Se].barHeightOffset/2,Fe=_+ke.config.series[de].data[Se].barHeightOffset);var st=B/2,se=Ge+st,Ce=Ge+Fe-st,Be=(te[xe][Se]>=0?1:-1)*(q?-1:1);k+=.001+st*Be,T+=.001-st*Be;var De=Re.move(k,se),_e=Re.move(k,se);ke.globals.previousPaths.length>0&&(_e=this.barCtx.getPreviousPath(de,Se,!1));var Je=Re.line(k,Ce);if(De=De+Re.line(T,se)+Re.line(T,Ce)+Je+(ke.config.plotOptions.bar.borderRadiusApplication==="around"||this.arrBorderRadius[de][Se]==="both"?" Z":" z"),_e=_e+Re.line(k,se)+Je+Je+Je+Je+Je+Re.line(k,se)+(ke.config.plotOptions.bar.borderRadiusApplication==="around"||this.arrBorderRadius[de][Se]==="both"?" Z":" z"),this.arrBorderRadius[de][Se]!=="none"&&(De=Re.roundPathCorners(De,ke.config.plotOptions.bar.borderRadius)),ke.config.chart.stacked){var ct=this.barCtx;(ct=this.barCtx[ue]).xArrj.push(T+st*Be),ct.xArrjF.push(Math.abs(k-T-B*Be)),ct.xArrjVal.push(this.barCtx.series[xe][Se])}return{pathTo:De,pathFrom:_e}}},{key:"checkZeroSeries",value:function(h){for(var p=h.series,S=this.w,_=0;_<p.length;_++){for(var k=0,T=0;T<p[S.globals.maxValsInArrayIndex].length;T++)k+=p[_][T];k===0&&this.barCtx.zeroSerieses.push(_)}}},{key:"getXForValue",value:function(h,p){var S=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2]?p:null;return h!=null&&(S=p+h/this.barCtx.invertedYRatio-2*(this.barCtx.isReversed?h/this.barCtx.invertedYRatio:0)),S}},{key:"getYForValue",value:function(h,p,S){var _=!(arguments.length>3&&arguments[3]!==void 0)||arguments[3]?p:null;return h!=null&&(_=p-h/this.barCtx.yRatio[S]+2*(this.barCtx.isReversed?h/this.barCtx.yRatio[S]:0)),_}},{key:"getGoalValues",value:function(h,p,S,_,k,T){var B=this,q=this.w,te=[],ue=function(Se,ke){var Re;te.push((u(Re={},h,h==="x"?B.getXForValue(Se,p,!1):B.getYForValue(Se,S,T,!1)),u(Re,"attrs",ke),Re))};if(q.globals.seriesGoals[_]&&q.globals.seriesGoals[_][k]&&Array.isArray(q.globals.seriesGoals[_][k])&&q.globals.seriesGoals[_][k].forEach(function(Se){ue(Se.value,Se)}),this.barCtx.barOptions.isDumbbell&&q.globals.seriesRange.length){var de=this.barCtx.barOptions.dumbbellColors?this.barCtx.barOptions.dumbbellColors:q.globals.colors,xe={strokeHeight:h==="x"?0:q.globals.markers.size[_],strokeWidth:h==="x"?q.globals.markers.size[_]:0,strokeDashArray:0,strokeLineCap:"round",strokeColor:Array.isArray(de[_])?de[_][0]:de[_]};ue(q.globals.seriesRangeStart[_][k],xe),ue(q.globals.seriesRangeEnd[_][k],v(v({},xe),{},{strokeColor:Array.isArray(de[_])?de[_][1]:de[_]}))}return te}},{key:"drawGoalLine",value:function(h){var p=h.barXPosition,S=h.barYPosition,_=h.goalX,k=h.goalY,T=h.barWidth,B=h.barHeight,q=new z(this.barCtx.ctx),te=q.group({className:"apexcharts-bar-goals-groups"});te.node.classList.add("apexcharts-element-hidden"),this.barCtx.w.globals.delayedElements.push({el:te.node}),te.attr("clip-path","url(#gridRectMarkerMask".concat(this.barCtx.w.globals.cuid,")"));var ue=null;return this.barCtx.isHorizontal?Array.isArray(_)&&_.forEach(function(de){if(de.x>=-1&&de.x<=q.w.globals.gridWidth+1){var xe=de.attrs.strokeHeight!==void 0?de.attrs.strokeHeight:B/2,Se=S+xe+B/2;ue=q.drawLine(de.x,Se-2*xe,de.x,Se,de.attrs.strokeColor?de.attrs.strokeColor:void 0,de.attrs.strokeDashArray,de.attrs.strokeWidth?de.attrs.strokeWidth:2,de.attrs.strokeLineCap),te.add(ue)}}):Array.isArray(k)&&k.forEach(function(de){if(de.y>=-1&&de.y<=q.w.globals.gridHeight+1){var xe=de.attrs.strokeWidth!==void 0?de.attrs.strokeWidth:T/2,Se=p+xe+T/2;ue=q.drawLine(Se-2*xe,de.y,Se,de.y,de.attrs.strokeColor?de.attrs.strokeColor:void 0,de.attrs.strokeDashArray,de.attrs.strokeHeight?de.attrs.strokeHeight:2,de.attrs.strokeLineCap),te.add(ue)}}),te}},{key:"drawBarShadow",value:function(h){var p=h.prevPaths,S=h.currPaths,_=h.color,k=this.w,T=p.x,B=p.x1,q=p.barYPosition,te=S.x,ue=S.x1,de=S.barYPosition,xe=q+S.barHeight,Se=new z(this.barCtx.ctx),ke=new F,Re=Se.move(B,xe)+Se.line(T,xe)+Se.line(te,de)+Se.line(ue,de)+Se.line(B,xe)+(k.config.plotOptions.bar.borderRadiusApplication==="around"||this.arrBorderRadius[realIndex][j]==="both"?" Z":" z");return Se.drawPath({d:Re,fill:ke.shadeColor(.5,F.rgb2hex(_)),stroke:"none",strokeWidth:0,fillOpacity:1,classes:"apexcharts-bar-shadows"})}},{key:"getZeroValueEncounters",value:function(h){var p,S=h.i,_=h.j,k=this.w,T=0,B=0;return(k.config.plotOptions.bar.horizontal?k.globals.series.map(function(q,te){return te}):((p=k.globals.columnSeries)===null||p===void 0?void 0:p.i.map(function(q){return q}))||[]).forEach(function(q){var te=k.globals.seriesPercent[q][_];te&&T++,q<S&&te===0&&B++}),{nonZeroColumns:T,zeroEncounters:B}}},{key:"getGroupIndex",value:function(h){var p=this.w,S=p.globals.seriesGroups.findIndex(function(T){return T.indexOf(p.globals.seriesNames[h])>-1}),_=this.barCtx.columnGroupIndices,k=_.indexOf(S);return k<0&&(_.push(S),k=_.length-1),{groupIndex:S,columnGroupIndex:k}}}]),Ee}(),on=function(){function Ee(h,p){s(this,Ee),this.ctx=h,this.w=h.w;var S=this.w;this.barOptions=S.config.plotOptions.bar,this.isHorizontal=this.barOptions.horizontal,this.strokeWidth=S.config.stroke.width,this.isNullValue=!1,this.isRangeBar=S.globals.seriesRange.length&&this.isHorizontal,this.isVerticalGroupedRangeBar=!S.globals.isBarHorizontal&&S.globals.seriesRange.length&&S.config.plotOptions.bar.rangeBarGroupRows,this.isFunnel=this.barOptions.isFunnel,this.xyRatios=p,this.xyRatios!==null&&(this.xRatio=p.xRatio,this.yRatio=p.yRatio,this.invertedXRatio=p.invertedXRatio,this.invertedYRatio=p.invertedYRatio,this.baseLineY=p.baseLineY,this.baseLineInvertedY=p.baseLineInvertedY),this.yaxisIndex=0,this.translationsIndex=0,this.seriesLen=0,this.pathArr=[];var _=new Le(this.ctx);this.lastActiveBarSerieIndex=_.getActiveConfigSeriesIndex("desc",["bar","column"]),this.columnGroupIndices=[];var k=_.getBarSeriesIndices(),T=new Q(this.ctx);this.stackedSeriesTotals=T.getStackedSeriesTotals(this.w.config.series.map(function(B,q){return k.indexOf(q)===-1?q:-1}).filter(function(B){return B!==-1})),this.barHelpers=new dn(this)}return o(Ee,[{key:"draw",value:function(h,p){var S=this.w,_=new z(this.ctx),k=new Q(this.ctx,S);h=k.getLogSeries(h),this.series=h,this.yRatio=k.getLogYRatios(this.yRatio),this.barHelpers.initVariables(h);var T=_.group({class:"apexcharts-bar-series apexcharts-plot-series"});S.config.dataLabels.enabled&&this.totalItems>this.barOptions.dataLabels.maxItems&&console.warn("WARNING: DataLabels are enabled but there are too many to display. This may cause performance issue when rendering - ApexCharts");for(var B=0,q=0;B<h.length;B++,q++){var te,ue,de,xe,Se=void 0,ke=void 0,Re=[],Ge=[],Fe=S.globals.comboCharts?p[B]:B,st=this.barHelpers.getGroupIndex(Fe).columnGroupIndex,se=_.group({class:"apexcharts-series",rel:B+1,seriesName:F.escapeString(S.globals.seriesNames[Fe]),"data:realIndex":Fe});this.ctx.series.addCollapsedClassToSeries(se,Fe),h[B].length>0&&(this.visibleI=this.visibleI+1);var Ce=0,Be=0;this.yRatio.length>1&&(this.yaxisIndex=S.globals.seriesYAxisReverseMap[Fe],this.translationsIndex=Fe);var De=this.translationsIndex;this.isReversed=S.config.yaxis[this.yaxisIndex]&&S.config.yaxis[this.yaxisIndex].reversed;var _e=this.barHelpers.initialPositions();ke=_e.y,Ce=_e.barHeight,ue=_e.yDivision,xe=_e.zeroW,Se=_e.x,Be=_e.barWidth,te=_e.xDivision,de=_e.zeroH,this.horizontal||Ge.push(Se+Be/2);var Je=_.group({class:"apexcharts-datalabels","data:realIndex":Fe});S.globals.delayedElements.push({el:Je.node}),Je.node.classList.add("apexcharts-element-hidden");var ct=_.group({class:"apexcharts-bar-goals-markers"}),gt=_.group({class:"apexcharts-bar-shadows"});S.globals.delayedElements.push({el:gt.node}),gt.node.classList.add("apexcharts-element-hidden");for(var Xt=0;Xt<h[B].length;Xt++){var wt=this.barHelpers.getStrokeWidth(B,Xt,Fe),Xe=null,Oe={indexes:{i:B,j:Xt,realIndex:Fe,translationsIndex:De,bc:q},x:Se,y:ke,strokeWidth:wt,elSeries:se};this.isHorizontal?(Xe=this.drawBarPaths(v(v({},Oe),{},{barHeight:Ce,zeroW:xe,yDivision:ue})),Be=this.series[B][Xt]/this.invertedYRatio):(Xe=this.drawColumnPaths(v(v({},Oe),{},{xDivision:te,barWidth:Be,zeroH:de})),Ce=this.series[B][Xt]/this.yRatio[De]);var bt=this.barHelpers.getPathFillColor(h,B,Xt,Fe);if(this.isFunnel&&this.barOptions.isFunnel3d&&this.pathArr.length&&Xt>0){var kt=this.barHelpers.drawBarShadow({color:typeof bt=="string"&&(bt==null?void 0:bt.indexOf("url"))===-1?bt:F.hexToRgba(S.globals.colors[B]),prevPaths:this.pathArr[this.pathArr.length-1],currPaths:Xe});kt&>.add(kt)}this.pathArr.push(Xe);var Ut=this.barHelpers.drawGoalLine({barXPosition:Xe.barXPosition,barYPosition:Xe.barYPosition,goalX:Xe.goalX,goalY:Xe.goalY,barHeight:Ce,barWidth:Be});Ut&&ct.add(Ut),ke=Xe.y,Se=Xe.x,Xt>0&&Ge.push(Se+Be/2),Re.push(ke),this.renderSeries({realIndex:Fe,pathFill:bt,j:Xt,i:B,columnGroupIndex:st,pathFrom:Xe.pathFrom,pathTo:Xe.pathTo,strokeWidth:wt,elSeries:se,x:Se,y:ke,series:h,barHeight:Math.abs(Xe.barHeight?Xe.barHeight:Ce),barWidth:Math.abs(Xe.barWidth?Xe.barWidth:Be),elDataLabelsWrap:Je,elGoalsMarkers:ct,elBarShadows:gt,visibleSeries:this.visibleI,type:"bar"})}S.globals.seriesXvalues[Fe]=Ge,S.globals.seriesYvalues[Fe]=Re,T.add(se)}return T}},{key:"renderSeries",value:function(h){var p=h.realIndex,S=h.pathFill,_=h.lineFill,k=h.j,T=h.i,B=h.columnGroupIndex,q=h.pathFrom,te=h.pathTo,ue=h.strokeWidth,de=h.elSeries,xe=h.x,Se=h.y,ke=h.y1,Re=h.y2,Ge=h.series,Fe=h.barHeight,st=h.barWidth,se=h.barXPosition,Ce=h.barYPosition,Be=h.elDataLabelsWrap,De=h.elGoalsMarkers,_e=h.elBarShadows,Je=h.visibleSeries,ct=h.type,gt=h.classes,Xt=this.w,wt=new z(this.ctx);if(!_){var Xe=typeof Xt.globals.stroke.colors[p]=="function"?function(fn){var On,Sn=Xt.config.stroke.colors;return Array.isArray(Sn)&&Sn.length>0&&((On=Sn[fn])||(On=""),typeof On=="function")?On({value:Xt.globals.series[fn][k],dataPointIndex:k,w:Xt}):On}(p):Xt.globals.stroke.colors[p];_=this.barOptions.distributed?Xt.globals.stroke.colors[k]:Xe}Xt.config.series[T].data[k]&&Xt.config.series[T].data[k].strokeColor&&(_=Xt.config.series[T].data[k].strokeColor),this.isNullValue&&(S="none");var Oe=k/Xt.config.chart.animations.animateGradually.delay*(Xt.config.chart.animations.speed/Xt.globals.dataPoints)/2.4,bt=wt.renderPaths({i:T,j:k,realIndex:p,pathFrom:q,pathTo:te,stroke:_,strokeWidth:ue,strokeLineCap:Xt.config.stroke.lineCap,fill:S,animationDelay:Oe,initialSpeed:Xt.config.chart.animations.speed,dataChangeSpeed:Xt.config.chart.animations.dynamicAnimation.speed,className:"apexcharts-".concat(ct,"-area ").concat(gt),chartType:ct});bt.attr("clip-path","url(#gridRectBarMask".concat(Xt.globals.cuid,")"));var kt=Xt.config.forecastDataPoints;kt.count>0&&k>=Xt.globals.dataPoints-kt.count&&(bt.node.setAttribute("stroke-dasharray",kt.dashArray),bt.node.setAttribute("stroke-width",kt.strokeWidth),bt.node.setAttribute("fill-opacity",kt.fillOpacity)),ke!==void 0&&Re!==void 0&&(bt.attr("data-range-y1",ke),bt.attr("data-range-y2",Re)),new L(this.ctx).setSelectionFilter(bt,p,k),de.add(bt);var Ut=new Tt(this).handleBarDataLabels({x:xe,y:Se,y1:ke,y2:Re,i:T,j:k,series:Ge,realIndex:p,columnGroupIndex:B,barHeight:Fe,barWidth:st,barXPosition:se,barYPosition:Ce,renderedPath:bt,visibleSeries:Je});return Ut.dataLabels!==null&&Be.add(Ut.dataLabels),Ut.totalDataLabels&&Be.add(Ut.totalDataLabels),de.add(Be),De&&de.add(De),_e&&de.add(_e),de}},{key:"drawBarPaths",value:function(h){var p,S=h.indexes,_=h.barHeight,k=h.strokeWidth,T=h.zeroW,B=h.x,q=h.y,te=h.yDivision,ue=h.elSeries,de=this.w,xe=S.i,Se=S.j;if(de.globals.isXNumeric)p=(q=(de.globals.seriesX[xe][Se]-de.globals.minX)/this.invertedXRatio-_)+_*this.visibleI;else if(de.config.plotOptions.bar.hideZeroBarsWhenGrouped){var ke=0,Re=0;de.globals.seriesPercent.forEach(function(Fe,st){Fe[Se]&&ke++,st<xe&&Fe[Se]===0&&Re++}),ke>0&&(_=this.seriesLen*_/ke),p=q+_*this.visibleI,p-=_*Re}else p=q+_*this.visibleI;this.isFunnel&&(T-=(this.barHelpers.getXForValue(this.series[xe][Se],T)-T)/2),B=this.barHelpers.getXForValue(this.series[xe][Se],T);var Ge=this.barHelpers.getBarpaths({barYPosition:p,barHeight:_,x1:T,x2:B,strokeWidth:k,isReversed:this.isReversed,series:this.series,realIndex:S.realIndex,i:xe,j:Se,w:de});return de.globals.isXNumeric||(q+=te),this.barHelpers.barBackground({j:Se,i:xe,y1:p-_*this.visibleI,y2:_*this.seriesLen,elSeries:ue}),{pathTo:Ge.pathTo,pathFrom:Ge.pathFrom,x1:T,x:B,y:q,goalX:this.barHelpers.getGoalValues("x",T,null,xe,Se),barYPosition:p,barHeight:_}}},{key:"drawColumnPaths",value:function(h){var p,S=h.indexes,_=h.x,k=h.y,T=h.xDivision,B=h.barWidth,q=h.zeroH,te=h.strokeWidth,ue=h.elSeries,de=this.w,xe=S.realIndex,Se=S.translationsIndex,ke=S.i,Re=S.j,Ge=S.bc;if(de.globals.isXNumeric){var Fe=this.getBarXForNumericXAxis({x:_,j:Re,realIndex:xe,barWidth:B});_=Fe.x,p=Fe.barXPosition}else if(de.config.plotOptions.bar.hideZeroBarsWhenGrouped){var st=this.barHelpers.getZeroValueEncounters({i:ke,j:Re}),se=st.nonZeroColumns,Ce=st.zeroEncounters;se>0&&(B=this.seriesLen*B/se),p=_+B*this.visibleI,p-=B*Ce}else p=_+B*this.visibleI;k=this.barHelpers.getYForValue(this.series[ke][Re],q,Se);var Be=this.barHelpers.getColumnPaths({barXPosition:p,barWidth:B,y1:q,y2:k,strokeWidth:te,isReversed:this.isReversed,series:this.series,realIndex:xe,i:ke,j:Re,w:de});return de.globals.isXNumeric||(_+=T),this.barHelpers.barBackground({bc:Ge,j:Re,i:ke,x1:p-te/2-B*this.visibleI,x2:B*this.seriesLen+te/2,elSeries:ue}),{pathTo:Be.pathTo,pathFrom:Be.pathFrom,x:_,y:k,goalY:this.barHelpers.getGoalValues("y",null,q,ke,Re,Se),barXPosition:p,barWidth:B}}},{key:"getBarXForNumericXAxis",value:function(h){var p=h.x,S=h.barWidth,_=h.realIndex,k=h.j,T=this.w,B=_;return T.globals.seriesX[_].length||(B=T.globals.maxValsInArrayIndex),T.globals.seriesX[B][k]&&(p=(T.globals.seriesX[B][k]-T.globals.minX)/this.xRatio-S*this.seriesLen/2),{barXPosition:p+S*this.visibleI,x:p}}},{key:"getPreviousPath",value:function(h,p){for(var S,_=this.w,k=0;k<_.globals.previousPaths.length;k++){var T=_.globals.previousPaths[k];T.paths&&T.paths.length>0&&parseInt(T.realIndex,10)===parseInt(h,10)&&_.globals.previousPaths[k].paths[p]!==void 0&&(S=_.globals.previousPaths[k].paths[p].d)}return S}}]),Ee}(),gn=function(Ee){f(p,on);var h=c(p);function p(){return s(this,p),h.apply(this,arguments)}return o(p,[{key:"draw",value:function(S,_){var k=this,T=this.w;this.graphics=new z(this.ctx),this.bar=new on(this.ctx,this.xyRatios);var B=new Q(this.ctx,T);S=B.getLogSeries(S),this.yRatio=B.getLogYRatios(this.yRatio),this.barHelpers.initVariables(S),T.config.chart.stackType==="100%"&&(S=T.globals.comboCharts?_.map(function(ke){return T.globals.seriesPercent[ke]}):T.globals.seriesPercent.slice()),this.series=S,this.barHelpers.initializeStackedPrevVars(this);for(var q=this.graphics.group({class:"apexcharts-bar-series apexcharts-plot-series"}),te=0,ue=0,de=function(ke,Re){var Ge=void 0,Fe=void 0,st=void 0,se=void 0,Ce=T.globals.comboCharts?_[ke]:ke,Be=k.barHelpers.getGroupIndex(Ce),De=Be.groupIndex,_e=Be.columnGroupIndex;k.groupCtx=k[T.globals.seriesGroups[De]];var Je=[],ct=[],gt=0;k.yRatio.length>1&&(k.yaxisIndex=T.globals.seriesYAxisReverseMap[Ce][0],gt=Ce),k.isReversed=T.config.yaxis[k.yaxisIndex]&&T.config.yaxis[k.yaxisIndex].reversed;var Xt=k.graphics.group({class:"apexcharts-series",seriesName:F.escapeString(T.globals.seriesNames[Ce]),rel:ke+1,"data:realIndex":Ce});k.ctx.series.addCollapsedClassToSeries(Xt,Ce);var wt=k.graphics.group({class:"apexcharts-datalabels","data:realIndex":Ce}),Xe=k.graphics.group({class:"apexcharts-bar-goals-markers"}),Oe=0,bt=0,kt=k.initialPositions(te,ue,Ge,Fe,st,se,gt);ue=kt.y,Oe=kt.barHeight,Fe=kt.yDivision,se=kt.zeroW,te=kt.x,bt=kt.barWidth,Ge=kt.xDivision,st=kt.zeroH,T.globals.barHeight=Oe,T.globals.barWidth=bt,k.barHelpers.initializeStackedXYVars(k),k.groupCtx.prevY.length===1&&k.groupCtx.prevY[0].every(function($n){return isNaN($n)})&&(k.groupCtx.prevY[0]=k.groupCtx.prevY[0].map(function(){return st}),k.groupCtx.prevYF[0]=k.groupCtx.prevYF[0].map(function(){return 0}));for(var Ut=0;Ut<T.globals.dataPoints;Ut++){var fn=k.barHelpers.getStrokeWidth(ke,Ut,Ce),On={indexes:{i:ke,j:Ut,realIndex:Ce,translationsIndex:gt,bc:Re},strokeWidth:fn,x:te,y:ue,elSeries:Xt,columnGroupIndex:_e,seriesGroup:T.globals.seriesGroups[De]},Sn=null;k.isHorizontal?(Sn=k.drawStackedBarPaths(v(v({},On),{},{zeroW:se,barHeight:Oe,yDivision:Fe})),bt=k.series[ke][Ut]/k.invertedYRatio):(Sn=k.drawStackedColumnPaths(v(v({},On),{},{xDivision:Ge,barWidth:bt,zeroH:st})),Oe=k.series[ke][Ut]/k.yRatio[gt]);var yr=k.barHelpers.drawGoalLine({barXPosition:Sn.barXPosition,barYPosition:Sn.barYPosition,goalX:Sn.goalX,goalY:Sn.goalY,barHeight:Oe,barWidth:bt});yr&&Xe.add(yr),ue=Sn.y,te=Sn.x,Je.push(te),ct.push(ue);var Pn=k.barHelpers.getPathFillColor(S,ke,Ut,Ce),En="";T.globals.isBarHorizontal?k.barHelpers.arrBorderRadius[Ce][Ut]==="bottom"&&T.globals.series[Ce][Ut]>0&&(En="apexcharts-flip-x"):k.barHelpers.arrBorderRadius[Ce][Ut]==="bottom"&&T.globals.series[Ce][Ut]>0&&(En="apexcharts-flip-y"),Xt=k.renderSeries({realIndex:Ce,pathFill:Pn,j:Ut,i:ke,columnGroupIndex:_e,pathFrom:Sn.pathFrom,pathTo:Sn.pathTo,strokeWidth:fn,elSeries:Xt,x:te,y:ue,series:S,barHeight:Oe,barWidth:bt,elDataLabelsWrap:wt,elGoalsMarkers:Xe,type:"bar",visibleSeries:_e,classes:En})}T.globals.seriesXvalues[Ce]=Je,T.globals.seriesYvalues[Ce]=ct,k.groupCtx.prevY.push(k.groupCtx.yArrj),k.groupCtx.prevYF.push(k.groupCtx.yArrjF),k.groupCtx.prevYVal.push(k.groupCtx.yArrjVal),k.groupCtx.prevX.push(k.groupCtx.xArrj),k.groupCtx.prevXF.push(k.groupCtx.xArrjF),k.groupCtx.prevXVal.push(k.groupCtx.xArrjVal),q.add(Xt)},xe=0,Se=0;xe<S.length;xe++,Se++)de(xe,Se);return q}},{key:"initialPositions",value:function(S,_,k,T,B,q,te){var ue,de,xe=this.w;if(this.isHorizontal){T=xe.globals.gridHeight/xe.globals.dataPoints;var Se=xe.config.plotOptions.bar.barHeight;ue=String(Se).indexOf("%")===-1?parseInt(Se,10):T*parseInt(Se,10)/100,q=xe.globals.padHorizontal+(this.isReversed?xe.globals.gridWidth-this.baseLineInvertedY:this.baseLineInvertedY),_=(T-ue)/2}else{de=k=xe.globals.gridWidth/xe.globals.dataPoints;var ke=xe.config.plotOptions.bar.columnWidth;xe.globals.isXNumeric&&xe.globals.dataPoints>1?de=(k=xe.globals.minXDiff/this.xRatio)*parseInt(this.barOptions.columnWidth,10)/100:String(ke).indexOf("%")===-1?de=parseInt(ke,10):de*=parseInt(ke,10)/100,B=this.isReversed?this.baseLineY[te]:xe.globals.gridHeight-this.baseLineY[te],S=xe.globals.padHorizontal+(k-de)/2}var Re=xe.globals.barGroups.length||1;return{x:S,y:_,yDivision:T,xDivision:k,barHeight:ue/Re,barWidth:de/Re,zeroH:B,zeroW:q}}},{key:"drawStackedBarPaths",value:function(S){for(var _,k=S.indexes,T=S.barHeight,B=S.strokeWidth,q=S.zeroW,te=S.x,ue=S.y,de=S.columnGroupIndex,xe=S.seriesGroup,Se=S.yDivision,ke=S.elSeries,Re=this.w,Ge=ue+de*T,Fe=k.i,st=k.j,se=k.realIndex,Ce=k.translationsIndex,Be=0,De=0;De<this.groupCtx.prevXF.length;De++)Be+=this.groupCtx.prevXF[De][st];var _e;if((_e=xe.indexOf(Re.config.series[se].name))>0){var Je=q;this.groupCtx.prevXVal[_e-1][st]<0?Je=this.series[Fe][st]>=0?this.groupCtx.prevX[_e-1][st]+Be-2*(this.isReversed?Be:0):this.groupCtx.prevX[_e-1][st]:this.groupCtx.prevXVal[_e-1][st]>=0&&(Je=this.series[Fe][st]>=0?this.groupCtx.prevX[_e-1][st]:this.groupCtx.prevX[_e-1][st]-Be+2*(this.isReversed?Be:0)),_=Je}else _=q;te=this.series[Fe][st]===null?_:_+this.series[Fe][st]/this.invertedYRatio-2*(this.isReversed?this.series[Fe][st]/this.invertedYRatio:0);var ct=this.barHelpers.getBarpaths({barYPosition:Ge,barHeight:T,x1:_,x2:te,strokeWidth:B,isReversed:this.isReversed,series:this.series,realIndex:k.realIndex,seriesGroup:xe,i:Fe,j:st,w:Re});return this.barHelpers.barBackground({j:st,i:Fe,y1:Ge,y2:T,elSeries:ke}),ue+=Se,{pathTo:ct.pathTo,pathFrom:ct.pathFrom,goalX:this.barHelpers.getGoalValues("x",q,null,Fe,st,Ce),barXPosition:_,barYPosition:Ge,x:te,y:ue}}},{key:"drawStackedColumnPaths",value:function(S){var _=S.indexes,k=S.x,T=S.y,B=S.xDivision,q=S.barWidth,te=S.zeroH,ue=S.columnGroupIndex,de=S.seriesGroup,xe=S.elSeries,Se=this.w,ke=_.i,Re=_.j,Ge=_.bc,Fe=_.realIndex,st=_.translationsIndex;if(Se.globals.isXNumeric){var se=Se.globals.seriesX[Fe][Re];se||(se=0),k=(se-Se.globals.minX)/this.xRatio-q/2*Se.globals.barGroups.length}for(var Ce,Be=k+ue*q,De=0,_e=0;_e<this.groupCtx.prevYF.length;_e++)De+=isNaN(this.groupCtx.prevYF[_e][Re])?0:this.groupCtx.prevYF[_e][Re];var Je=ke;if(de&&(Je=de.indexOf(Se.globals.seriesNames[Fe])),Je>0&&!Se.globals.isXNumeric||Je>0&&Se.globals.isXNumeric&&Se.globals.seriesX[Fe-1][Re]===Se.globals.seriesX[Fe][Re]){var ct,gt,Xt,wt=Math.min(this.yRatio.length+1,Fe+1);if(this.groupCtx.prevY[Je-1]!==void 0&&this.groupCtx.prevY[Je-1].length)for(var Xe=1;Xe<wt;Xe++){var Oe;if(!isNaN((Oe=this.groupCtx.prevY[Je-Xe])===null||Oe===void 0?void 0:Oe[Re])){Xt=this.groupCtx.prevY[Je-Xe][Re];break}}for(var bt=1;bt<wt;bt++){var kt,Ut;if(((kt=this.groupCtx.prevYVal[Je-bt])===null||kt===void 0?void 0:kt[Re])<0){gt=this.series[ke][Re]>=0?Xt-De+2*(this.isReversed?De:0):Xt;break}if(((Ut=this.groupCtx.prevYVal[Je-bt])===null||Ut===void 0?void 0:Ut[Re])>=0){gt=this.series[ke][Re]>=0?Xt:Xt+De-2*(this.isReversed?De:0);break}}gt===void 0&&(gt=Se.globals.gridHeight),Ce=(ct=this.groupCtx.prevYF[0])!==null&&ct!==void 0&&ct.every(function(On){return On===0})&&this.groupCtx.prevYF.slice(1,Je).every(function(On){return On.every(function(Sn){return isNaN(Sn)})})?te:gt}else Ce=te;T=this.series[ke][Re]?Ce-this.series[ke][Re]/this.yRatio[st]+2*(this.isReversed?this.series[ke][Re]/this.yRatio[st]:0):Ce;var fn=this.barHelpers.getColumnPaths({barXPosition:Be,barWidth:q,y1:Ce,y2:T,yRatio:this.yRatio[st],strokeWidth:this.strokeWidth,isReversed:this.isReversed,series:this.series,seriesGroup:de,realIndex:_.realIndex,i:ke,j:Re,w:Se});return this.barHelpers.barBackground({bc:Ge,j:Re,i:ke,x1:Be,x2:q,elSeries:xe}),{pathTo:fn.pathTo,pathFrom:fn.pathFrom,goalY:this.barHelpers.getGoalValues("y",null,te,ke,Re),barXPosition:Be,x:Se.globals.isXNumeric?k:k+B,y:T}}}]),p}(),Nn=function(Ee){f(p,on);var h=c(p);function p(){return s(this,p),h.apply(this,arguments)}return o(p,[{key:"draw",value:function(S,_,k){var T=this,B=this.w,q=new z(this.ctx),te=B.globals.comboCharts?_:B.config.chart.type,ue=new ye(this.ctx);this.candlestickOptions=this.w.config.plotOptions.candlestick,this.boxOptions=this.w.config.plotOptions.boxPlot,this.isHorizontal=B.config.plotOptions.bar.horizontal;var de=new Q(this.ctx,B);S=de.getLogSeries(S),this.series=S,this.yRatio=de.getLogYRatios(this.yRatio),this.barHelpers.initVariables(S);for(var xe=q.group({class:"apexcharts-".concat(te,"-series apexcharts-plot-series")}),Se=function(Re){T.isBoxPlot=B.config.chart.type==="boxPlot"||B.config.series[Re].type==="boxPlot";var Ge,Fe,st,se,Ce=void 0,Be=void 0,De=[],_e=[],Je=B.globals.comboCharts?k[Re]:Re,ct=T.barHelpers.getGroupIndex(Je).columnGroupIndex,gt=q.group({class:"apexcharts-series",seriesName:F.escapeString(B.globals.seriesNames[Je]),rel:Re+1,"data:realIndex":Je});T.ctx.series.addCollapsedClassToSeries(gt,Je),S[Re].length>0&&(T.visibleI=T.visibleI+1);var Xt,wt,Xe=0;T.yRatio.length>1&&(T.yaxisIndex=B.globals.seriesYAxisReverseMap[Je][0],Xe=Je);var Oe=T.barHelpers.initialPositions();Be=Oe.y,Xt=Oe.barHeight,Fe=Oe.yDivision,se=Oe.zeroW,Ce=Oe.x,wt=Oe.barWidth,Ge=Oe.xDivision,st=Oe.zeroH,_e.push(Ce+wt/2);for(var bt=q.group({class:"apexcharts-datalabels","data:realIndex":Je}),kt=function(fn){var On=T.barHelpers.getStrokeWidth(Re,fn,Je),Sn=null,yr={indexes:{i:Re,j:fn,realIndex:Je,translationsIndex:Xe},x:Ce,y:Be,strokeWidth:On,elSeries:gt};Sn=T.isHorizontal?T.drawHorizontalBoxPaths(v(v({},yr),{},{yDivision:Fe,barHeight:Xt,zeroW:se})):T.drawVerticalBoxPaths(v(v({},yr),{},{xDivision:Ge,barWidth:wt,zeroH:st})),Be=Sn.y,Ce=Sn.x,fn>0&&_e.push(Ce+wt/2),De.push(Be),Sn.pathTo.forEach(function(Pn,En){var $n=!T.isBoxPlot&&T.candlestickOptions.wick.useFillColor?Sn.color[En]:B.globals.stroke.colors[Re],Bn=ue.fillPath({seriesNumber:Je,dataPointIndex:fn,color:Sn.color[En],value:S[Re][fn]});T.renderSeries({realIndex:Je,pathFill:Bn,lineFill:$n,j:fn,i:Re,pathFrom:Sn.pathFrom,pathTo:Pn,strokeWidth:On,elSeries:gt,x:Ce,y:Be,series:S,columnGroupIndex:ct,barHeight:Xt,barWidth:wt,elDataLabelsWrap:bt,visibleSeries:T.visibleI,type:B.config.chart.type})})},Ut=0;Ut<B.globals.dataPoints;Ut++)kt(Ut);B.globals.seriesXvalues[Je]=_e,B.globals.seriesYvalues[Je]=De,xe.add(gt)},ke=0;ke<S.length;ke++)Se(ke);return xe}},{key:"drawVerticalBoxPaths",value:function(S){var _=S.indexes,k=S.x;S.y;var T=S.xDivision,B=S.barWidth,q=S.zeroH,te=S.strokeWidth,ue=this.w,de=new z(this.ctx),xe=_.i,Se=_.j,ke=!0,Re=ue.config.plotOptions.candlestick.colors.upward,Ge=ue.config.plotOptions.candlestick.colors.downward,Fe="";this.isBoxPlot&&(Fe=[this.boxOptions.colors.lower,this.boxOptions.colors.upper]);var st=this.yRatio[_.translationsIndex],se=_.realIndex,Ce=this.getOHLCValue(se,Se),Be=q,De=q;Ce.o>Ce.c&&(ke=!1);var _e=Math.min(Ce.o,Ce.c),Je=Math.max(Ce.o,Ce.c),ct=Ce.m;ue.globals.isXNumeric&&(k=(ue.globals.seriesX[se][Se]-ue.globals.minX)/this.xRatio-B/2);var gt=k+B*this.visibleI;this.series[xe][Se]===void 0||this.series[xe][Se]===null?(_e=q,Je=q):(_e=q-_e/st,Je=q-Je/st,Be=q-Ce.h/st,De=q-Ce.l/st,ct=q-Ce.m/st);var Xt=de.move(gt,q),wt=de.move(gt+B/2,_e);return ue.globals.previousPaths.length>0&&(wt=this.getPreviousPath(se,Se,!0)),Xt=this.isBoxPlot?[de.move(gt,_e)+de.line(gt+B/2,_e)+de.line(gt+B/2,Be)+de.line(gt+B/4,Be)+de.line(gt+B-B/4,Be)+de.line(gt+B/2,Be)+de.line(gt+B/2,_e)+de.line(gt+B,_e)+de.line(gt+B,ct)+de.line(gt,ct)+de.line(gt,_e+te/2),de.move(gt,ct)+de.line(gt+B,ct)+de.line(gt+B,Je)+de.line(gt+B/2,Je)+de.line(gt+B/2,De)+de.line(gt+B-B/4,De)+de.line(gt+B/4,De)+de.line(gt+B/2,De)+de.line(gt+B/2,Je)+de.line(gt,Je)+de.line(gt,ct)+"z"]:[de.move(gt,Je)+de.line(gt+B/2,Je)+de.line(gt+B/2,Be)+de.line(gt+B/2,Je)+de.line(gt+B,Je)+de.line(gt+B,_e)+de.line(gt+B/2,_e)+de.line(gt+B/2,De)+de.line(gt+B/2,_e)+de.line(gt,_e)+de.line(gt,Je-te/2)],wt+=de.move(gt,_e),ue.globals.isXNumeric||(k+=T),{pathTo:Xt,pathFrom:wt,x:k,y:Je,barXPosition:gt,color:this.isBoxPlot?Fe:ke?[Re]:[Ge]}}},{key:"drawHorizontalBoxPaths",value:function(S){var _=S.indexes;S.x;var k=S.y,T=S.yDivision,B=S.barHeight,q=S.zeroW,te=S.strokeWidth,ue=this.w,de=new z(this.ctx),xe=_.i,Se=_.j,ke=this.boxOptions.colors.lower;this.isBoxPlot&&(ke=[this.boxOptions.colors.lower,this.boxOptions.colors.upper]);var Re=this.invertedYRatio,Ge=_.realIndex,Fe=this.getOHLCValue(Ge,Se),st=q,se=q,Ce=Math.min(Fe.o,Fe.c),Be=Math.max(Fe.o,Fe.c),De=Fe.m;ue.globals.isXNumeric&&(k=(ue.globals.seriesX[Ge][Se]-ue.globals.minX)/this.invertedXRatio-B/2);var _e=k+B*this.visibleI;this.series[xe][Se]===void 0||this.series[xe][Se]===null?(Ce=q,Be=q):(Ce=q+Ce/Re,Be=q+Be/Re,st=q+Fe.h/Re,se=q+Fe.l/Re,De=q+Fe.m/Re);var Je=de.move(q,_e),ct=de.move(Ce,_e+B/2);return ue.globals.previousPaths.length>0&&(ct=this.getPreviousPath(Ge,Se,!0)),Je=[de.move(Ce,_e)+de.line(Ce,_e+B/2)+de.line(st,_e+B/2)+de.line(st,_e+B/2-B/4)+de.line(st,_e+B/2+B/4)+de.line(st,_e+B/2)+de.line(Ce,_e+B/2)+de.line(Ce,_e+B)+de.line(De,_e+B)+de.line(De,_e)+de.line(Ce+te/2,_e),de.move(De,_e)+de.line(De,_e+B)+de.line(Be,_e+B)+de.line(Be,_e+B/2)+de.line(se,_e+B/2)+de.line(se,_e+B-B/4)+de.line(se,_e+B/4)+de.line(se,_e+B/2)+de.line(Be,_e+B/2)+de.line(Be,_e)+de.line(De,_e)+"z"],ct+=de.move(Ce,_e),ue.globals.isXNumeric||(k+=T),{pathTo:Je,pathFrom:ct,x:Be,y:k,barYPosition:_e,color:ke}}},{key:"getOHLCValue",value:function(S,_){var k=this.w;return{o:this.isBoxPlot?k.globals.seriesCandleH[S][_]:k.globals.seriesCandleO[S][_],h:this.isBoxPlot?k.globals.seriesCandleO[S][_]:k.globals.seriesCandleH[S][_],m:k.globals.seriesCandleM[S][_],l:this.isBoxPlot?k.globals.seriesCandleC[S][_]:k.globals.seriesCandleL[S][_],c:this.isBoxPlot?k.globals.seriesCandleL[S][_]:k.globals.seriesCandleC[S][_]}}}]),p}(),kn=function(){function Ee(h){s(this,Ee),this.ctx=h,this.w=h.w}return o(Ee,[{key:"checkColorRange",value:function(){var h=this.w,p=!1,S=h.config.plotOptions[h.config.chart.type];return S.colorScale.ranges.length>0&&S.colorScale.ranges.map(function(_,k){_.from<=0&&(p=!0)}),p}},{key:"getShadeColor",value:function(h,p,S,_){var k=this.w,T=1,B=k.config.plotOptions[h].shadeIntensity,q=this.determineColor(h,p,S);k.globals.hasNegs||_?T=k.config.plotOptions[h].reverseNegativeShade?q.percent<0?q.percent/100*(1.25*B):(1-q.percent/100)*(1.25*B):q.percent<=0?1-(1+q.percent/100)*B:(1-q.percent/100)*B:(T=1-q.percent/100,h==="treemap"&&(T=(1-q.percent/100)*(1.25*B)));var te=q.color,ue=new F;if(k.config.plotOptions[h].enableShades)if(this.w.config.theme.mode==="dark"){var de=ue.shadeColor(-1*T,q.color);te=F.hexToRgba(F.isColorHex(de)?de:F.rgb2hex(de),k.config.fill.opacity)}else{var xe=ue.shadeColor(T,q.color);te=F.hexToRgba(F.isColorHex(xe)?xe:F.rgb2hex(xe),k.config.fill.opacity)}return{color:te,colorProps:q}}},{key:"determineColor",value:function(h,p,S){var _=this.w,k=_.globals.series[p][S],T=_.config.plotOptions[h],B=T.colorScale.inverse?S:p;T.distributed&&_.config.chart.type==="treemap"&&(B=S);var q=_.globals.colors[B],te=null,ue=Math.min.apply(Math,N(_.globals.series[p])),de=Math.max.apply(Math,N(_.globals.series[p]));T.distributed||h!=="heatmap"||(ue=_.globals.minY,de=_.globals.maxY),T.colorScale.min!==void 0&&(ue=T.colorScale.min<_.globals.minY?T.colorScale.min:_.globals.minY,de=T.colorScale.max>_.globals.maxY?T.colorScale.max:_.globals.maxY);var xe=Math.abs(de)+Math.abs(ue),Se=100*k/(xe===0?xe-1e-6:xe);return T.colorScale.ranges.length>0&&T.colorScale.ranges.map(function(ke,Re){if(k>=ke.from&&k<=ke.to){q=ke.color,te=ke.foreColor?ke.foreColor:null,ue=ke.from,de=ke.to;var Ge=Math.abs(de)+Math.abs(ue);Se=100*k/(Ge===0?Ge-1e-6:Ge)}}),{color:q,foreColor:te,percent:Se}}},{key:"calculateDataLabels",value:function(h){var p=h.text,S=h.x,_=h.y,k=h.i,T=h.j,B=h.colorProps,q=h.fontSize,te=this.w.config.dataLabels,ue=new z(this.ctx),de=new Ie(this.ctx),xe=null;if(te.enabled){xe=ue.group({class:"apexcharts-data-labels"});var Se=te.offsetX,ke=te.offsetY,Re=S+Se,Ge=_+parseFloat(te.style.fontSize)/3+ke;de.plotDataLabelsText({x:Re,y:Ge,text:p,i:k,j:T,color:B.foreColor,parent:xe,fontSize:q,dataLabelsConfig:te})}return xe}},{key:"addListeners",value:function(h){var p=new z(this.ctx);h.node.addEventListener("mouseenter",p.pathMouseEnter.bind(this,h)),h.node.addEventListener("mouseleave",p.pathMouseLeave.bind(this,h)),h.node.addEventListener("mousedown",p.pathMouseDown.bind(this,h))}}]),Ee}(),yn=function(){function Ee(h,p){s(this,Ee),this.ctx=h,this.w=h.w,this.xRatio=p.xRatio,this.yRatio=p.yRatio,this.dynamicAnim=this.w.config.chart.animations.dynamicAnimation,this.helpers=new kn(h),this.rectRadius=this.w.config.plotOptions.heatmap.radius,this.strokeWidth=this.w.config.stroke.show?this.w.config.stroke.width:0}return o(Ee,[{key:"draw",value:function(h){var p=this.w,S=new z(this.ctx),_=S.group({class:"apexcharts-heatmap"});_.attr("clip-path","url(#gridRectMask".concat(p.globals.cuid,")"));var k=p.globals.gridWidth/p.globals.dataPoints,T=p.globals.gridHeight/p.globals.series.length,B=0,q=!1;this.negRange=this.helpers.checkColorRange();var te=h.slice();p.config.yaxis[0].reversed&&(q=!0,te.reverse());for(var ue=q?0:te.length-1;q?ue<te.length:ue>=0;q?ue++:ue--){var de=S.group({class:"apexcharts-series apexcharts-heatmap-series",seriesName:F.escapeString(p.globals.seriesNames[ue]),rel:ue+1,"data:realIndex":ue});if(this.ctx.series.addCollapsedClassToSeries(de,ue),p.config.chart.dropShadow.enabled){var xe=p.config.chart.dropShadow;new L(this.ctx).dropShadow(de,xe,ue)}for(var Se=0,ke=p.config.plotOptions.heatmap.shadeIntensity,Re=0;Re<te[ue].length;Re++){var Ge=this.helpers.getShadeColor(p.config.chart.type,ue,Re,this.negRange),Fe=Ge.color,st=Ge.colorProps;p.config.fill.type==="image"&&(Fe=new ye(this.ctx).fillPath({seriesNumber:ue,dataPointIndex:Re,opacity:p.globals.hasNegs?st.percent<0?1-(1+st.percent/100):ke+st.percent/100:st.percent/100,patternID:F.randomId(),width:p.config.fill.image.width?p.config.fill.image.width:k,height:p.config.fill.image.height?p.config.fill.image.height:T}));var se=this.rectRadius,Ce=S.drawRect(Se,B,k,T,se);if(Ce.attr({cx:Se,cy:B}),Ce.node.classList.add("apexcharts-heatmap-rect"),de.add(Ce),Ce.attr({fill:Fe,i:ue,index:ue,j:Re,val:h[ue][Re],"stroke-width":this.strokeWidth,stroke:p.config.plotOptions.heatmap.useFillColorAsStroke?Fe:p.globals.stroke.colors[0],color:Fe}),this.helpers.addListeners(Ce),p.config.chart.animations.enabled&&!p.globals.dataChanged){var Be=1;p.globals.resized||(Be=p.config.chart.animations.speed),this.animateHeatMap(Ce,Se,B,k,T,Be)}if(p.globals.dataChanged){var De=1;if(this.dynamicAnim.enabled&&p.globals.shouldAnimate){De=this.dynamicAnim.speed;var _e=p.globals.previousPaths[ue]&&p.globals.previousPaths[ue][Re]&&p.globals.previousPaths[ue][Re].color;_e||(_e="rgba(255, 255, 255, 0)"),this.animateHeatColor(Ce,F.isColorHex(_e)?_e:F.rgb2hex(_e),F.isColorHex(Fe)?Fe:F.rgb2hex(Fe),De)}}var Je=(0,p.config.dataLabels.formatter)(p.globals.series[ue][Re],{value:p.globals.series[ue][Re],seriesIndex:ue,dataPointIndex:Re,w:p}),ct=this.helpers.calculateDataLabels({text:Je,x:Se+k/2,y:B+T/2,i:ue,j:Re,colorProps:st,series:te});ct!==null&&de.add(ct),Se+=k}B+=T,_.add(de)}var gt=p.globals.yAxisScale[0].result.slice();return p.config.yaxis[0].reversed?gt.unshift(""):gt.push(""),p.globals.yAxisScale[0].result=gt,_}},{key:"animateHeatMap",value:function(h,p,S,_,k,T){var B=new U(this.ctx);B.animateRect(h,{x:p+_/2,y:S+k/2,width:0,height:0},{x:p,y:S,width:_,height:k},T,function(){B.animationCompleted(h)})}},{key:"animateHeatColor",value:function(h,p,S,_){h.attr({fill:p}).animate(_).attr({fill:S})}}]),Ee}(),Vn=function(){function Ee(h){s(this,Ee),this.ctx=h,this.w=h.w}return o(Ee,[{key:"drawYAxisTexts",value:function(h,p,S,_){var k=this.w,T=k.config.yaxis[0],B=k.globals.yLabelFormatters[0];return new z(this.ctx).drawText({x:h+T.labels.offsetX,y:p+T.labels.offsetY,text:B(_,S),textAnchor:"middle",fontSize:T.labels.style.fontSize,fontFamily:T.labels.style.fontFamily,foreColor:Array.isArray(T.labels.style.colors)?T.labels.style.colors[S]:T.labels.style.colors})}}]),Ee}(),Gn=function(){function Ee(h){s(this,Ee),this.ctx=h,this.w=h.w;var p=this.w;this.chartType=this.w.config.chart.type,this.initialAnim=this.w.config.chart.animations.enabled,this.dynamicAnim=this.initialAnim&&this.w.config.chart.animations.dynamicAnimation.enabled,this.animBeginArr=[0],this.animDur=0,this.donutDataLabels=this.w.config.plotOptions.pie.donut.labels,this.lineColorArr=p.globals.stroke.colors!==void 0?p.globals.stroke.colors:p.globals.colors,this.defaultSize=Math.min(p.globals.gridWidth,p.globals.gridHeight),this.centerY=this.defaultSize/2,this.centerX=p.globals.gridWidth/2,p.config.chart.type==="radialBar"?this.fullAngle=360:this.fullAngle=Math.abs(p.config.plotOptions.pie.endAngle-p.config.plotOptions.pie.startAngle),this.initialAngle=p.config.plotOptions.pie.startAngle%this.fullAngle,p.globals.radialSize=this.defaultSize/2.05-p.config.stroke.width-(p.config.chart.sparkline.enabled?0:p.config.chart.dropShadow.blur),this.donutSize=p.globals.radialSize*parseInt(p.config.plotOptions.pie.donut.size,10)/100;var S=p.config.plotOptions.pie.customScale,_=p.globals.gridWidth/2,k=p.globals.gridHeight/2;this.translateX=_-_*S,this.translateY=k-k*S,this.dataLabelsGroup=new z(this.ctx).group({class:"apexcharts-datalabels-group",transform:"translate(".concat(this.translateX,", ").concat(this.translateY,") scale(").concat(S,")")}),this.maxY=0,this.sliceLabels=[],this.sliceSizes=[],this.prevSectorAngleArr=[]}return o(Ee,[{key:"draw",value:function(h){var p=this,S=this.w,_=new z(this.ctx),k=_.group({class:"apexcharts-pie"});if(S.globals.noData)return k;for(var T=0,B=0;B<h.length;B++)T+=F.negToZero(h[B]);var q=[],te=_.group();T===0&&(T=1e-5),h.forEach(function(se){p.maxY=Math.max(p.maxY,se)}),S.config.yaxis[0].max&&(this.maxY=S.config.yaxis[0].max),S.config.grid.position==="back"&&this.chartType==="polarArea"&&this.drawPolarElements(k);for(var ue=0;ue<h.length;ue++){var de=this.fullAngle*F.negToZero(h[ue])/T;q.push(de),this.chartType==="polarArea"?(q[ue]=this.fullAngle/h.length,this.sliceSizes.push(S.globals.radialSize*h[ue]/this.maxY)):this.sliceSizes.push(S.globals.radialSize)}if(S.globals.dataChanged){for(var xe,Se=0,ke=0;ke<S.globals.previousPaths.length;ke++)Se+=F.negToZero(S.globals.previousPaths[ke]);for(var Re=0;Re<S.globals.previousPaths.length;Re++)xe=this.fullAngle*F.negToZero(S.globals.previousPaths[Re])/Se,this.prevSectorAngleArr.push(xe)}if(this.donutSize<0&&(this.donutSize=0),this.chartType==="donut"){var Ge=_.drawCircle(this.donutSize);Ge.attr({cx:this.centerX,cy:this.centerY,fill:S.config.plotOptions.pie.donut.background?S.config.plotOptions.pie.donut.background:"transparent"}),te.add(Ge)}var Fe=this.drawArcs(q,h);if(this.sliceLabels.forEach(function(se){Fe.add(se)}),te.attr({transform:"translate(".concat(this.translateX,", ").concat(this.translateY,") scale(").concat(S.config.plotOptions.pie.customScale,")")}),te.add(Fe),k.add(te),this.donutDataLabels.show){var st=this.renderInnerDataLabels(this.dataLabelsGroup,this.donutDataLabels,{hollowSize:this.donutSize,centerX:this.centerX,centerY:this.centerY,opacity:this.donutDataLabels.show});k.add(st)}return S.config.grid.position==="front"&&this.chartType==="polarArea"&&this.drawPolarElements(k),k}},{key:"drawArcs",value:function(h,p){var S=this.w,_=new L(this.ctx),k=new z(this.ctx),T=new ye(this.ctx),B=k.group({class:"apexcharts-slices"}),q=this.initialAngle,te=this.initialAngle,ue=this.initialAngle,de=this.initialAngle;this.strokeWidth=S.config.stroke.show?S.config.stroke.width:0;for(var xe=0;xe<h.length;xe++){var Se=k.group({class:"apexcharts-series apexcharts-pie-series",seriesName:F.escapeString(S.globals.seriesNames[xe]),rel:xe+1,"data:realIndex":xe});B.add(Se),te=de,ue=(q=ue)+h[xe],de=te+this.prevSectorAngleArr[xe];var ke=ue<q?this.fullAngle+ue-q:ue-q,Re=T.fillPath({seriesNumber:xe,size:this.sliceSizes[xe],value:p[xe]}),Ge=this.getChangedPath(te,de),Fe=k.drawPath({d:Ge,stroke:Array.isArray(this.lineColorArr)?this.lineColorArr[xe]:this.lineColorArr,strokeWidth:0,fill:Re,fillOpacity:S.config.fill.opacity,classes:"apexcharts-pie-area apexcharts-".concat(this.chartType.toLowerCase(),"-slice-").concat(xe)});if(Fe.attr({index:0,j:xe}),_.setSelectionFilter(Fe,0,xe),S.config.chart.dropShadow.enabled){var st=S.config.chart.dropShadow;_.dropShadow(Fe,st,xe)}this.addListeners(Fe,this.donutDataLabels),z.setAttrs(Fe.node,{"data:angle":ke,"data:startAngle":q,"data:strokeWidth":this.strokeWidth,"data:value":p[xe]});var se={x:0,y:0};this.chartType==="pie"||this.chartType==="polarArea"?se=F.polarToCartesian(this.centerX,this.centerY,S.globals.radialSize/1.25+S.config.plotOptions.pie.dataLabels.offset,(q+ke/2)%this.fullAngle):this.chartType==="donut"&&(se=F.polarToCartesian(this.centerX,this.centerY,(S.globals.radialSize+this.donutSize)/2+S.config.plotOptions.pie.dataLabels.offset,(q+ke/2)%this.fullAngle)),Se.add(Fe);var Ce=0;if(!this.initialAnim||S.globals.resized||S.globals.dataChanged?this.animBeginArr.push(0):((Ce=ke/this.fullAngle*S.config.chart.animations.speed)===0&&(Ce=1),this.animDur=Ce+this.animDur,this.animBeginArr.push(this.animDur)),this.dynamicAnim&&S.globals.dataChanged?this.animatePaths(Fe,{size:this.sliceSizes[xe],endAngle:ue,startAngle:q,prevStartAngle:te,prevEndAngle:de,animateStartingPos:!0,i:xe,animBeginArr:this.animBeginArr,shouldSetPrevPaths:!0,dur:S.config.chart.animations.dynamicAnimation.speed}):this.animatePaths(Fe,{size:this.sliceSizes[xe],endAngle:ue,startAngle:q,i:xe,totalItems:h.length-1,animBeginArr:this.animBeginArr,dur:Ce}),S.config.plotOptions.pie.expandOnClick&&this.chartType!=="polarArea"&&Fe.node.addEventListener("mouseup",this.pieClicked.bind(this,xe)),S.globals.selectedDataPoints[0]!==void 0&&S.globals.selectedDataPoints[0].indexOf(xe)>-1&&this.pieClicked(xe),S.config.dataLabels.enabled){var Be=se.x,De=se.y,_e=100*ke/this.fullAngle+"%";if(ke!==0&&S.config.plotOptions.pie.dataLabels.minAngleToShowLabel<h[xe]){var Je=S.config.dataLabels.formatter;Je!==void 0&&(_e=Je(S.globals.seriesPercent[xe][0],{seriesIndex:xe,w:S}));var ct=S.globals.dataLabels.style.colors[xe],gt=k.group({class:"apexcharts-datalabels"}),Xt=k.drawText({x:Be,y:De,text:_e,textAnchor:"middle",fontSize:S.config.dataLabels.style.fontSize,fontFamily:S.config.dataLabels.style.fontFamily,fontWeight:S.config.dataLabels.style.fontWeight,foreColor:ct});if(gt.add(Xt),S.config.dataLabels.dropShadow.enabled){var wt=S.config.dataLabels.dropShadow;_.dropShadow(Xt,wt)}Xt.node.classList.add("apexcharts-pie-label"),S.config.chart.animations.animate&&S.globals.resized===!1&&(Xt.node.classList.add("apexcharts-pie-label-delay"),Xt.node.style.animationDelay=S.config.chart.animations.speed/940+"s"),this.sliceLabels.push(gt)}}}return B}},{key:"addListeners",value:function(h,p){var S=new z(this.ctx);h.node.addEventListener("mouseenter",S.pathMouseEnter.bind(this,h)),h.node.addEventListener("mouseleave",S.pathMouseLeave.bind(this,h)),h.node.addEventListener("mouseleave",this.revertDataLabelsInner.bind(this,h.node,p)),h.node.addEventListener("mousedown",S.pathMouseDown.bind(this,h)),this.donutDataLabels.total.showAlways||(h.node.addEventListener("mouseenter",this.printDataLabelsInner.bind(this,h.node,p)),h.node.addEventListener("mousedown",this.printDataLabelsInner.bind(this,h.node,p)))}},{key:"animatePaths",value:function(h,p){var S=this.w,_=p.endAngle<p.startAngle?this.fullAngle+p.endAngle-p.startAngle:p.endAngle-p.startAngle,k=_,T=p.startAngle,B=p.startAngle;p.prevStartAngle!==void 0&&p.prevEndAngle!==void 0&&(T=p.prevEndAngle,k=p.prevEndAngle<p.prevStartAngle?this.fullAngle+p.prevEndAngle-p.prevStartAngle:p.prevEndAngle-p.prevStartAngle),p.i===S.config.series.length-1&&(_+B>this.fullAngle?p.endAngle=p.endAngle-(_+B):_+B<this.fullAngle&&(p.endAngle=p.endAngle+(this.fullAngle-(_+B)))),_===this.fullAngle&&(_=this.fullAngle-.01),this.animateArc(h,T,B,_,k,p)}},{key:"animateArc",value:function(h,p,S,_,k,T){var B,q=this,te=this.w,ue=new U(this.ctx),de=T.size;(isNaN(p)||isNaN(k))&&(p=S,k=_,T.dur=0);var xe=_,Se=S,ke=p<S?this.fullAngle+p-S:p-S;te.globals.dataChanged&&T.shouldSetPrevPaths&&T.prevEndAngle&&(B=q.getPiePath({me:q,startAngle:T.prevStartAngle,angle:T.prevEndAngle<T.prevStartAngle?this.fullAngle+T.prevEndAngle-T.prevStartAngle:T.prevEndAngle-T.prevStartAngle,size:de}),h.attr({d:B})),T.dur!==0?h.animate(T.dur,te.globals.easing,T.animBeginArr[T.i]).afterAll(function(){q.chartType!=="pie"&&q.chartType!=="donut"&&q.chartType!=="polarArea"||this.animate(te.config.chart.animations.dynamicAnimation.speed).attr({"stroke-width":q.strokeWidth}),T.i===te.config.series.length-1&&ue.animationCompleted(h)}).during(function(Re){xe=ke+(_-ke)*Re,T.animateStartingPos&&(xe=k+(_-k)*Re,Se=p-k+(S-(p-k))*Re),B=q.getPiePath({me:q,startAngle:Se,angle:xe,size:de}),h.node.setAttribute("data:pathOrig",B),h.attr({d:B})}):(B=q.getPiePath({me:q,startAngle:Se,angle:_,size:de}),T.isTrack||(te.globals.animationEnded=!0),h.node.setAttribute("data:pathOrig",B),h.attr({d:B,"stroke-width":q.strokeWidth}))}},{key:"pieClicked",value:function(h){var p,S=this.w,_=this,k=_.sliceSizes[h]+(S.config.plotOptions.pie.expandOnClick?4:0),T=S.globals.dom.Paper.select(".apexcharts-".concat(_.chartType.toLowerCase(),"-slice-").concat(h)).members[0];if(T.attr("data:pieClicked")!=="true"){var B=S.globals.dom.baseEl.getElementsByClassName("apexcharts-pie-area");Array.prototype.forEach.call(B,function(de){de.setAttribute("data:pieClicked","false");var xe=de.getAttribute("data:pathOrig");xe&&de.setAttribute("d",xe)}),S.globals.capturedDataPointIndex=h,T.attr("data:pieClicked","true");var q=parseInt(T.attr("data:startAngle"),10),te=parseInt(T.attr("data:angle"),10);p=_.getPiePath({me:_,startAngle:q,angle:te,size:k}),te!==360&&T.plot(p)}else{T.attr({"data:pieClicked":"false"}),this.revertDataLabelsInner(T.node,this.donutDataLabels);var ue=T.attr("data:pathOrig");T.attr({d:ue})}}},{key:"getChangedPath",value:function(h,p){var S="";return this.dynamicAnim&&this.w.globals.dataChanged&&(S=this.getPiePath({me:this,startAngle:h,angle:p-h,size:this.size})),S}},{key:"getPiePath",value:function(h){var p,S=h.me,_=h.startAngle,k=h.angle,T=h.size,B=new z(this.ctx),q=_,te=Math.PI*(q-90)/180,ue=k+_;Math.ceil(ue)>=this.fullAngle+this.w.config.plotOptions.pie.startAngle%this.fullAngle&&(ue=this.fullAngle+this.w.config.plotOptions.pie.startAngle%this.fullAngle-.01),Math.ceil(ue)>this.fullAngle&&(ue-=this.fullAngle);var de=Math.PI*(ue-90)/180,xe=S.centerX+T*Math.cos(te),Se=S.centerY+T*Math.sin(te),ke=S.centerX+T*Math.cos(de),Re=S.centerY+T*Math.sin(de),Ge=F.polarToCartesian(S.centerX,S.centerY,S.donutSize,ue),Fe=F.polarToCartesian(S.centerX,S.centerY,S.donutSize,q),st=k>180?1:0,se=["M",xe,Se,"A",T,T,0,st,1,ke,Re];return p=S.chartType==="donut"?[].concat(se,["L",Ge.x,Ge.y,"A",S.donutSize,S.donutSize,0,st,0,Fe.x,Fe.y,"L",xe,Se,"z"]).join(" "):S.chartType==="pie"||S.chartType==="polarArea"?[].concat(se,["L",S.centerX,S.centerY,"L",xe,Se]).join(" "):[].concat(se).join(" "),B.roundPathCorners(p,2*this.strokeWidth)}},{key:"drawPolarElements",value:function(h){var p=this.w,S=new lt(this.ctx),_=new z(this.ctx),k=new Vn(this.ctx),T=_.group(),B=_.group(),q=S.niceScale(0,Math.ceil(this.maxY),0),te=q.result.reverse(),ue=q.result.length;this.maxY=q.niceMax;for(var de=p.globals.radialSize,xe=de/(ue-1),Se=0;Se<ue-1;Se++){var ke=_.drawCircle(de);if(ke.attr({cx:this.centerX,cy:this.centerY,fill:"none","stroke-width":p.config.plotOptions.polarArea.rings.strokeWidth,stroke:p.config.plotOptions.polarArea.rings.strokeColor}),p.config.yaxis[0].show){var Re=k.drawYAxisTexts(this.centerX,this.centerY-de+parseInt(p.config.yaxis[0].labels.style.fontSize,10)/2,Se,te[Se]);B.add(Re)}T.add(ke),de-=xe}this.drawSpokes(h),h.add(T),h.add(B)}},{key:"renderInnerDataLabels",value:function(h,p,S){var _=this.w,k=new z(this.ctx),T=p.total.show;h.node.innerHTML="",h.node.style.opacity=S.opacity;var B,q,te=S.centerX,ue=this.donutDataLabels.total.label?S.centerY:S.centerY-S.centerY/6;B=p.name.color===void 0?_.globals.colors[0]:p.name.color;var de=p.name.fontSize,xe=p.name.fontFamily,Se=p.name.fontWeight;q=p.value.color===void 0?_.config.chart.foreColor:p.value.color;var ke=p.value.formatter,Re="",Ge="";if(T?(B=p.total.color,de=p.total.fontSize,xe=p.total.fontFamily,Se=p.total.fontWeight,Ge=this.donutDataLabels.total.label?p.total.label:"",Re=p.total.formatter(_)):_.globals.series.length===1&&(Re=ke(_.globals.series[0],_),Ge=_.globals.seriesNames[0]),Ge&&(Ge=p.name.formatter(Ge,p.total.show,_)),p.name.show){var Fe=k.drawText({x:te,y:ue+parseFloat(p.name.offsetY),text:Ge,textAnchor:"middle",foreColor:B,fontSize:de,fontWeight:Se,fontFamily:xe});Fe.node.classList.add("apexcharts-datalabel-label"),h.add(Fe)}if(p.value.show){var st=p.name.show?parseFloat(p.value.offsetY)+16:p.value.offsetY,se=k.drawText({x:te,y:ue+st,text:Re,textAnchor:"middle",foreColor:q,fontWeight:p.value.fontWeight,fontSize:p.value.fontSize,fontFamily:p.value.fontFamily});se.node.classList.add("apexcharts-datalabel-value"),h.add(se)}return h}},{key:"printInnerLabels",value:function(h,p,S,_){var k,T=this.w;_?k=h.name.color===void 0?T.globals.colors[parseInt(_.parentNode.getAttribute("rel"),10)-1]:h.name.color:T.globals.series.length>1&&h.total.show&&(k=h.total.color);var B=T.globals.dom.baseEl.querySelector(".apexcharts-datalabel-label"),q=T.globals.dom.baseEl.querySelector(".apexcharts-datalabel-value");S=(0,h.value.formatter)(S,T),_||typeof h.total.formatter!="function"||(S=h.total.formatter(T));var te=p===h.total.label;p=this.donutDataLabels.total.label?h.name.formatter(p,te,T):"",B!==null&&(B.textContent=p),q!==null&&(q.textContent=S),B!==null&&(B.style.fill=k)}},{key:"printDataLabelsInner",value:function(h,p){var S=this.w,_=h.getAttribute("data:value"),k=S.globals.seriesNames[parseInt(h.parentNode.getAttribute("rel"),10)-1];S.globals.series.length>1&&this.printInnerLabels(p,k,_,h);var T=S.globals.dom.baseEl.querySelector(".apexcharts-datalabels-group");T!==null&&(T.style.opacity=1)}},{key:"drawSpokes",value:function(h){var p=this,S=this.w,_=new z(this.ctx),k=S.config.plotOptions.polarArea.spokes;if(k.strokeWidth!==0){for(var T=[],B=360/S.globals.series.length,q=0;q<S.globals.series.length;q++)T.push(F.polarToCartesian(this.centerX,this.centerY,S.globals.radialSize,S.config.plotOptions.pie.startAngle+B*q));T.forEach(function(te,ue){var de=_.drawLine(te.x,te.y,p.centerX,p.centerY,Array.isArray(k.connectorColors)?k.connectorColors[ue]:k.connectorColors);h.add(de)})}}},{key:"revertDataLabelsInner",value:function(){var h=this.w;if(this.donutDataLabels.show){var p=h.globals.dom.Paper.select(".apexcharts-datalabels-group").members[0],S=this.renderInnerDataLabels(p,this.donutDataLabels,{hollowSize:this.donutSize,centerX:this.centerX,centerY:this.centerY,opacity:this.donutDataLabels.show});h.globals.dom.Paper.select(".apexcharts-radialbar, .apexcharts-pie").members[0].add(S)}}}]),Ee}(),Dn=function(){function Ee(h){s(this,Ee),this.ctx=h,this.w=h.w,this.chartType=this.w.config.chart.type,this.initialAnim=this.w.config.chart.animations.enabled,this.dynamicAnim=this.initialAnim&&this.w.config.chart.animations.dynamicAnimation.enabled,this.animDur=0;var p=this.w;this.graphics=new z(this.ctx),this.lineColorArr=p.globals.stroke.colors!==void 0?p.globals.stroke.colors:p.globals.colors,this.defaultSize=p.globals.svgHeight<p.globals.svgWidth?p.globals.gridHeight:p.globals.gridWidth,this.isLog=p.config.yaxis[0].logarithmic,this.logBase=p.config.yaxis[0].logBase,this.coreUtils=new Q(this.ctx),this.maxValue=this.isLog?this.coreUtils.getLogVal(this.logBase,p.globals.maxY,0):p.globals.maxY,this.minValue=this.isLog?this.coreUtils.getLogVal(this.logBase,this.w.globals.minY,0):p.globals.minY,this.polygons=p.config.plotOptions.radar.polygons,this.strokeWidth=p.config.stroke.show?p.config.stroke.width:0,this.size=this.defaultSize/2.1-this.strokeWidth-p.config.chart.dropShadow.blur,p.config.xaxis.labels.show&&(this.size=this.size-p.globals.xAxisLabelsWidth/1.75),p.config.plotOptions.radar.size!==void 0&&(this.size=p.config.plotOptions.radar.size),this.dataRadiusOfPercent=[],this.dataRadius=[],this.angleArr=[],this.yaxisLabelsTextsPos=[]}return o(Ee,[{key:"draw",value:function(h){var p=this,S=this.w,_=new ye(this.ctx),k=[],T=new Ie(this.ctx);h.length&&(this.dataPointsLen=h[S.globals.maxValsInArrayIndex].length),this.disAngle=2*Math.PI/this.dataPointsLen;var B=S.globals.gridWidth/2,q=S.globals.gridHeight/2,te=B+S.config.plotOptions.radar.offsetX,ue=q+S.config.plotOptions.radar.offsetY,de=this.graphics.group({class:"apexcharts-radar-series apexcharts-plot-series",transform:"translate(".concat(te||0,", ").concat(ue||0,")")}),xe=[],Se=null,ke=null;if(this.yaxisLabels=this.graphics.group({class:"apexcharts-yaxis"}),h.forEach(function(Ge,Fe){var st=Ge.length===S.globals.dataPoints,se=p.graphics.group().attr({class:"apexcharts-series","data:longestSeries":st,seriesName:F.escapeString(S.globals.seriesNames[Fe]),rel:Fe+1,"data:realIndex":Fe});p.dataRadiusOfPercent[Fe]=[],p.dataRadius[Fe]=[],p.angleArr[Fe]=[],Ge.forEach(function(Xe,Oe){var bt=Math.abs(p.maxValue-p.minValue);Xe-=p.minValue,p.isLog&&(Xe=p.coreUtils.getLogVal(p.logBase,Xe,0)),p.dataRadiusOfPercent[Fe][Oe]=Xe/bt,p.dataRadius[Fe][Oe]=p.dataRadiusOfPercent[Fe][Oe]*p.size,p.angleArr[Fe][Oe]=Oe*p.disAngle}),xe=p.getDataPointsPos(p.dataRadius[Fe],p.angleArr[Fe]);var Ce=p.createPaths(xe,{x:0,y:0});Se=p.graphics.group({class:"apexcharts-series-markers-wrap apexcharts-element-hidden"}),ke=p.graphics.group({class:"apexcharts-datalabels","data:realIndex":Fe}),S.globals.delayedElements.push({el:Se.node,index:Fe});var Be={i:Fe,realIndex:Fe,animationDelay:Fe,initialSpeed:S.config.chart.animations.speed,dataChangeSpeed:S.config.chart.animations.dynamicAnimation.speed,className:"apexcharts-radar",shouldClipToGrid:!1,bindEventsOnPaths:!1,stroke:S.globals.stroke.colors[Fe],strokeLineCap:S.config.stroke.lineCap},De=null;S.globals.previousPaths.length>0&&(De=p.getPreviousPath(Fe));for(var _e=0;_e<Ce.linePathsTo.length;_e++){var Je=p.graphics.renderPaths(v(v({},Be),{},{pathFrom:De===null?Ce.linePathsFrom[_e]:De,pathTo:Ce.linePathsTo[_e],strokeWidth:Array.isArray(p.strokeWidth)?p.strokeWidth[Fe]:p.strokeWidth,fill:"none",drawShadow:!1}));se.add(Je);var ct=_.fillPath({seriesNumber:Fe}),gt=p.graphics.renderPaths(v(v({},Be),{},{pathFrom:De===null?Ce.areaPathsFrom[_e]:De,pathTo:Ce.areaPathsTo[_e],strokeWidth:0,fill:ct,drawShadow:!1}));if(S.config.chart.dropShadow.enabled){var Xt=new L(p.ctx),wt=S.config.chart.dropShadow;Xt.dropShadow(gt,Object.assign({},wt,{noUserSpaceOnUse:!0}),Fe)}se.add(gt)}Ge.forEach(function(Xe,Oe){var bt=new ve(p.ctx).getMarkerConfig({cssClass:"apexcharts-marker",seriesIndex:Fe,dataPointIndex:Oe}),kt=p.graphics.drawMarker(xe[Oe].x,xe[Oe].y,bt);kt.attr("rel",Oe),kt.attr("j",Oe),kt.attr("index",Fe),kt.node.setAttribute("default-marker-size",bt.pSize);var Ut=p.graphics.group({class:"apexcharts-series-markers"});Ut&&Ut.add(kt),Se.add(Ut),se.add(Se);var fn=S.config.dataLabels;if(fn.enabled){var On=fn.formatter(S.globals.series[Fe][Oe],{seriesIndex:Fe,dataPointIndex:Oe,w:S});T.plotDataLabelsText({x:xe[Oe].x,y:xe[Oe].y,text:On,textAnchor:"middle",i:Fe,j:Fe,parent:ke,offsetCorrection:!1,dataLabelsConfig:v({},fn)})}se.add(ke)}),k.push(se)}),this.drawPolygons({parent:de}),S.config.xaxis.labels.show){var Re=this.drawXAxisTexts();de.add(Re)}return k.forEach(function(Ge){de.add(Ge)}),de.add(this.yaxisLabels),de}},{key:"drawPolygons",value:function(h){for(var p=this,S=this.w,_=h.parent,k=new Vn(this.ctx),T=S.globals.yAxisScale[0].result.reverse(),B=T.length,q=[],te=this.size/(B-1),ue=0;ue<B;ue++)q[ue]=te*ue;q.reverse();var de=[],xe=[];q.forEach(function(Se,ke){var Re=F.getPolygonPos(Se,p.dataPointsLen),Ge="";Re.forEach(function(Fe,st){if(ke===0){var se=p.graphics.drawLine(Fe.x,Fe.y,0,0,Array.isArray(p.polygons.connectorColors)?p.polygons.connectorColors[st]:p.polygons.connectorColors);xe.push(se)}st===0&&p.yaxisLabelsTextsPos.push({x:Fe.x,y:Fe.y}),Ge+=Fe.x+","+Fe.y+" "}),de.push(Ge)}),de.forEach(function(Se,ke){var Re=p.polygons.strokeColors,Ge=p.polygons.strokeWidth,Fe=p.graphics.drawPolygon(Se,Array.isArray(Re)?Re[ke]:Re,Array.isArray(Ge)?Ge[ke]:Ge,S.globals.radarPolygons.fill.colors[ke]);_.add(Fe)}),xe.forEach(function(Se){_.add(Se)}),S.config.yaxis[0].show&&this.yaxisLabelsTextsPos.forEach(function(Se,ke){var Re=k.drawYAxisTexts(Se.x,Se.y,ke,T[ke]);p.yaxisLabels.add(Re)})}},{key:"drawXAxisTexts",value:function(){var h=this,p=this.w,S=p.config.xaxis.labels,_=this.graphics.group({class:"apexcharts-xaxis"}),k=F.getPolygonPos(this.size,this.dataPointsLen);return p.globals.labels.forEach(function(T,B){var q=p.config.xaxis.labels.formatter,te=new Ie(h.ctx);if(k[B]){var ue=h.getTextPos(k[B],h.size),de=q(T,{seriesIndex:-1,dataPointIndex:B,w:p});te.plotDataLabelsText({x:ue.newX,y:ue.newY,text:de,textAnchor:ue.textAnchor,i:B,j:B,parent:_,className:"apexcharts-xaxis-label",color:Array.isArray(S.style.colors)&&S.style.colors[B]?S.style.colors[B]:"#a8a8a8",dataLabelsConfig:v({textAnchor:ue.textAnchor,dropShadow:{enabled:!1}},S),offsetCorrection:!1}).on("click",function(xe){if(typeof p.config.chart.events.xAxisLabelClick=="function"){var Se=Object.assign({},p,{labelIndex:B});p.config.chart.events.xAxisLabelClick(xe,h.ctx,Se)}})}}),_}},{key:"createPaths",value:function(h,p){var S=this,_=[],k=[],T=[],B=[];if(h.length){k=[this.graphics.move(p.x,p.y)],B=[this.graphics.move(p.x,p.y)];var q=this.graphics.move(h[0].x,h[0].y),te=this.graphics.move(h[0].x,h[0].y);h.forEach(function(ue,de){q+=S.graphics.line(ue.x,ue.y),te+=S.graphics.line(ue.x,ue.y),de===h.length-1&&(q+="Z",te+="Z")}),_.push(q),T.push(te)}return{linePathsFrom:k,linePathsTo:_,areaPathsFrom:B,areaPathsTo:T}}},{key:"getTextPos",value:function(h,p){var S="middle",_=h.x,k=h.y;return Math.abs(h.x)>=10?h.x>0?(S="start",_+=10):h.x<0&&(S="end",_-=10):S="middle",Math.abs(h.y)>=p-10&&(h.y<0?k-=10:h.y>0&&(k+=10)),{textAnchor:S,newX:_,newY:k}}},{key:"getPreviousPath",value:function(h){for(var p=this.w,S=null,_=0;_<p.globals.previousPaths.length;_++){var k=p.globals.previousPaths[_];k.paths.length>0&&parseInt(k.realIndex,10)===parseInt(h,10)&&p.globals.previousPaths[_].paths[0]!==void 0&&(S=p.globals.previousPaths[_].paths[0].d)}return S}},{key:"getDataPointsPos",value:function(h,p){var S=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.dataPointsLen;h=h||[],p=p||[];for(var _=[],k=0;k<S;k++){var T={};T.x=h[k]*Math.sin(p[k]),T.y=-h[k]*Math.cos(p[k]),_.push(T)}return _}}]),Ee}(),Kn=function(Ee){f(p,Gn);var h=c(p);function p(S){var _;s(this,p),(_=h.call(this,S)).ctx=S,_.w=S.w,_.animBeginArr=[0],_.animDur=0;var k=_.w;return _.startAngle=k.config.plotOptions.radialBar.startAngle,_.endAngle=k.config.plotOptions.radialBar.endAngle,_.totalAngle=Math.abs(k.config.plotOptions.radialBar.endAngle-k.config.plotOptions.radialBar.startAngle),_.trackStartAngle=k.config.plotOptions.radialBar.track.startAngle,_.trackEndAngle=k.config.plotOptions.radialBar.track.endAngle,_.barLabels=_.w.config.plotOptions.radialBar.barLabels,_.donutDataLabels=_.w.config.plotOptions.radialBar.dataLabels,_.radialDataLabels=_.donutDataLabels,_.trackStartAngle||(_.trackStartAngle=_.startAngle),_.trackEndAngle||(_.trackEndAngle=_.endAngle),_.endAngle===360&&(_.endAngle=359.99),_.margin=parseInt(k.config.plotOptions.radialBar.track.margin,10),_.onBarLabelClick=_.onBarLabelClick.bind(r(_)),_}return o(p,[{key:"draw",value:function(S){var _=this.w,k=new z(this.ctx),T=k.group({class:"apexcharts-radialbar"});if(_.globals.noData)return T;var B=k.group(),q=this.defaultSize/2,te=_.globals.gridWidth/2,ue=this.defaultSize/2.05;_.config.chart.sparkline.enabled||(ue=ue-_.config.stroke.width-_.config.chart.dropShadow.blur);var de=_.globals.fill.colors;if(_.config.plotOptions.radialBar.track.show){var xe=this.drawTracks({size:ue,centerX:te,centerY:q,colorArr:de,series:S});B.add(xe)}var Se=this.drawArcs({size:ue,centerX:te,centerY:q,colorArr:de,series:S}),ke=360;_.config.plotOptions.radialBar.startAngle<0&&(ke=this.totalAngle);var Re=(360-ke)/360;if(_.globals.radialSize=ue-ue*Re,this.radialDataLabels.value.show){var Ge=Math.max(this.radialDataLabels.value.offsetY,this.radialDataLabels.name.offsetY);_.globals.radialSize+=Ge*Re}return B.add(Se.g),_.config.plotOptions.radialBar.hollow.position==="front"&&(Se.g.add(Se.elHollow),Se.dataLabels&&Se.g.add(Se.dataLabels)),T.add(B),T}},{key:"drawTracks",value:function(S){var _=this.w,k=new z(this.ctx),T=k.group({class:"apexcharts-tracks"}),B=new L(this.ctx),q=new ye(this.ctx),te=this.getStrokeWidth(S);S.size=S.size-te/2;for(var ue=0;ue<S.series.length;ue++){var de=k.group({class:"apexcharts-radialbar-track apexcharts-track"});T.add(de),de.attr({rel:ue+1}),S.size=S.size-te-this.margin;var xe=_.config.plotOptions.radialBar.track,Se=q.fillPath({seriesNumber:0,size:S.size,fillColors:Array.isArray(xe.background)?xe.background[ue]:xe.background,solid:!0}),ke=this.trackStartAngle,Re=this.trackEndAngle;Math.abs(Re)+Math.abs(ke)>=360&&(Re=360-Math.abs(this.startAngle)-.1);var Ge=k.drawPath({d:"",stroke:Se,strokeWidth:te*parseInt(xe.strokeWidth,10)/100,fill:"none",strokeOpacity:xe.opacity,classes:"apexcharts-radialbar-area"});if(xe.dropShadow.enabled){var Fe=xe.dropShadow;B.dropShadow(Ge,Fe)}de.add(Ge),Ge.attr("id","apexcharts-radialbarTrack-"+ue),this.animatePaths(Ge,{centerX:S.centerX,centerY:S.centerY,endAngle:Re,startAngle:ke,size:S.size,i:ue,totalItems:2,animBeginArr:0,dur:0,isTrack:!0,easing:_.globals.easing})}return T}},{key:"drawArcs",value:function(S){var _=this.w,k=new z(this.ctx),T=new ye(this.ctx),B=new L(this.ctx),q=k.group(),te=this.getStrokeWidth(S);S.size=S.size-te/2;var ue=_.config.plotOptions.radialBar.hollow.background,de=S.size-te*S.series.length-this.margin*S.series.length-te*parseInt(_.config.plotOptions.radialBar.track.strokeWidth,10)/100/2,xe=de-_.config.plotOptions.radialBar.hollow.margin;_.config.plotOptions.radialBar.hollow.image!==void 0&&(ue=this.drawHollowImage(S,q,de,ue));var Se=this.drawHollow({size:xe,centerX:S.centerX,centerY:S.centerY,fill:ue||"transparent"});if(_.config.plotOptions.radialBar.hollow.dropShadow.enabled){var ke=_.config.plotOptions.radialBar.hollow.dropShadow;B.dropShadow(Se,ke)}var Re=1;!this.radialDataLabels.total.show&&_.globals.series.length>1&&(Re=0);var Ge=null;if(this.radialDataLabels.show){var Fe=_.globals.dom.Paper.select(".apexcharts-datalabels-group").members[0];Ge=this.renderInnerDataLabels(Fe,this.radialDataLabels,{hollowSize:de,centerX:S.centerX,centerY:S.centerY,opacity:Re})}_.config.plotOptions.radialBar.hollow.position==="back"&&(q.add(Se),Ge&&q.add(Ge));var st=!1;_.config.plotOptions.radialBar.inverseOrder&&(st=!0);for(var se=st?S.series.length-1:0;st?se>=0:se<S.series.length;st?se--:se++){var Ce=k.group({class:"apexcharts-series apexcharts-radial-series",seriesName:F.escapeString(_.globals.seriesNames[se])});q.add(Ce),Ce.attr({rel:se+1,"data:realIndex":se}),this.ctx.series.addCollapsedClassToSeries(Ce,se),S.size=S.size-te-this.margin;var Be=T.fillPath({seriesNumber:se,size:S.size,value:S.series[se]}),De=this.startAngle,_e=void 0,Je=F.negToZero(S.series[se]>100?100:S.series[se])/100,ct=Math.round(this.totalAngle*Je)+this.startAngle,gt=void 0;_.globals.dataChanged&&(_e=this.startAngle,gt=Math.round(this.totalAngle*F.negToZero(_.globals.previousPaths[se])/100)+_e),Math.abs(ct)+Math.abs(De)>360&&(ct-=.01),Math.abs(gt)+Math.abs(_e)>360&&(gt-=.01);var Xt=ct-De,wt=Array.isArray(_.config.stroke.dashArray)?_.config.stroke.dashArray[se]:_.config.stroke.dashArray,Xe=k.drawPath({d:"",stroke:Be,strokeWidth:te,fill:"none",fillOpacity:_.config.fill.opacity,classes:"apexcharts-radialbar-area apexcharts-radialbar-slice-"+se,strokeDashArray:wt});if(z.setAttrs(Xe.node,{"data:angle":Xt,"data:value":S.series[se]}),_.config.chart.dropShadow.enabled){var Oe=_.config.chart.dropShadow;B.dropShadow(Xe,Oe,se)}if(B.setSelectionFilter(Xe,0,se),this.addListeners(Xe,this.radialDataLabels),Ce.add(Xe),Xe.attr({index:0,j:se}),this.barLabels.enabled){var bt=F.polarToCartesian(S.centerX,S.centerY,S.size,De),kt=this.barLabels.formatter(_.globals.seriesNames[se],{seriesIndex:se,w:_}),Ut=["apexcharts-radialbar-label"];this.barLabels.onClick||Ut.push("apexcharts-no-click");var fn=this.barLabels.useSeriesColors?_.globals.colors[se]:_.config.chart.foreColor;fn||(fn=_.config.chart.foreColor);var On=bt.x+this.barLabels.offsetX,Sn=bt.y+this.barLabels.offsetY,yr=k.drawText({x:On,y:Sn,text:kt,textAnchor:"end",dominantBaseline:"middle",fontFamily:this.barLabels.fontFamily,fontWeight:this.barLabels.fontWeight,fontSize:this.barLabels.fontSize,foreColor:fn,cssClass:Ut.join(" ")});yr.on("click",this.onBarLabelClick),yr.attr({rel:se+1}),De!==0&&yr.attr({"transform-origin":"".concat(On," ").concat(Sn),transform:"rotate(".concat(De," 0 0)")}),Ce.add(yr)}var Pn=0;!this.initialAnim||_.globals.resized||_.globals.dataChanged||(Pn=_.config.chart.animations.speed),_.globals.dataChanged&&(Pn=_.config.chart.animations.dynamicAnimation.speed),this.animDur=Pn/(1.2*S.series.length)+this.animDur,this.animBeginArr.push(this.animDur),this.animatePaths(Xe,{centerX:S.centerX,centerY:S.centerY,endAngle:ct,startAngle:De,prevEndAngle:gt,prevStartAngle:_e,size:S.size,i:se,totalItems:2,animBeginArr:this.animBeginArr,dur:Pn,shouldSetPrevPaths:!0,easing:_.globals.easing})}return{g:q,elHollow:Se,dataLabels:Ge}}},{key:"drawHollow",value:function(S){var _=new z(this.ctx).drawCircle(2*S.size);return _.attr({class:"apexcharts-radialbar-hollow",cx:S.centerX,cy:S.centerY,r:S.size,fill:S.fill}),_}},{key:"drawHollowImage",value:function(S,_,k,T){var B=this.w,q=new ye(this.ctx),te=F.randomId(),ue=B.config.plotOptions.radialBar.hollow.image;if(B.config.plotOptions.radialBar.hollow.imageClipped)q.clippedImgArea({width:k,height:k,image:ue,patternID:"pattern".concat(B.globals.cuid).concat(te)}),T="url(#pattern".concat(B.globals.cuid).concat(te,")");else{var de=B.config.plotOptions.radialBar.hollow.imageWidth,xe=B.config.plotOptions.radialBar.hollow.imageHeight;if(de===void 0&&xe===void 0){var Se=B.globals.dom.Paper.image(ue).loaded(function(Re){this.move(S.centerX-Re.width/2+B.config.plotOptions.radialBar.hollow.imageOffsetX,S.centerY-Re.height/2+B.config.plotOptions.radialBar.hollow.imageOffsetY)});_.add(Se)}else{var ke=B.globals.dom.Paper.image(ue).loaded(function(Re){this.move(S.centerX-de/2+B.config.plotOptions.radialBar.hollow.imageOffsetX,S.centerY-xe/2+B.config.plotOptions.radialBar.hollow.imageOffsetY),this.size(de,xe)});_.add(ke)}}return T}},{key:"getStrokeWidth",value:function(S){var _=this.w;return S.size*(100-parseInt(_.config.plotOptions.radialBar.hollow.size,10))/100/(S.series.length+1)-this.margin}},{key:"onBarLabelClick",value:function(S){var _=parseInt(S.target.getAttribute("rel"),10)-1,k=this.barLabels.onClick,T=this.w;k&&k(T.globals.seriesNames[_],{w:T,seriesIndex:_})}}]),p}(),Cn=function(Ee){f(p,on);var h=c(p);function p(){return s(this,p),h.apply(this,arguments)}return o(p,[{key:"draw",value:function(S,_){var k=this.w,T=new z(this.ctx);this.rangeBarOptions=this.w.config.plotOptions.rangeBar,this.series=S,this.seriesRangeStart=k.globals.seriesRangeStart,this.seriesRangeEnd=k.globals.seriesRangeEnd,this.barHelpers.initVariables(S);for(var B=T.group({class:"apexcharts-rangebar-series apexcharts-plot-series"}),q=0;q<S.length;q++){var te,ue,de,xe,Se=void 0,ke=void 0,Re=k.globals.comboCharts?_[q]:q,Ge=this.barHelpers.getGroupIndex(Re).columnGroupIndex,Fe=T.group({class:"apexcharts-series",seriesName:F.escapeString(k.globals.seriesNames[Re]),rel:q+1,"data:realIndex":Re});this.ctx.series.addCollapsedClassToSeries(Fe,Re),S[q].length>0&&(this.visibleI=this.visibleI+1);var st=0,se=0,Ce=0;this.yRatio.length>1&&(this.yaxisIndex=k.globals.seriesYAxisReverseMap[Re][0],Ce=Re);var Be=this.barHelpers.initialPositions();ke=Be.y,xe=Be.zeroW,Se=Be.x,se=Be.barWidth,st=Be.barHeight,te=Be.xDivision,ue=Be.yDivision,de=Be.zeroH;for(var De=T.group({class:"apexcharts-datalabels","data:realIndex":Re}),_e=T.group({class:"apexcharts-rangebar-goals-markers"}),Je=0;Je<k.globals.dataPoints;Je++){var ct=this.barHelpers.getStrokeWidth(q,Je,Re),gt=this.seriesRangeStart[q][Je],Xt=this.seriesRangeEnd[q][Je],wt=null,Xe=null,Oe=null,bt={x:Se,y:ke,strokeWidth:ct,elSeries:Fe},kt=this.seriesLen;if(k.config.plotOptions.bar.rangeBarGroupRows&&(kt=1),k.config.series[q].data[Je]===void 0)break;if(this.isHorizontal){Oe=ke+st*this.visibleI;var Ut=(ue-st*kt)/2;if(k.config.series[q].data[Je].x){var fn=this.detectOverlappingBars({i:q,j:Je,barYPosition:Oe,srty:Ut,barHeight:st,yDivision:ue,initPositions:Be});st=fn.barHeight,Oe=fn.barYPosition}se=(wt=this.drawRangeBarPaths(v({indexes:{i:q,j:Je,realIndex:Re},barHeight:st,barYPosition:Oe,zeroW:xe,yDivision:ue,y1:gt,y2:Xt},bt))).barWidth}else{k.globals.isXNumeric&&(Se=(k.globals.seriesX[q][Je]-k.globals.minX)/this.xRatio-se/2),Xe=Se+se*this.visibleI;var On=(te-se*kt)/2;if(k.config.series[q].data[Je].x){var Sn=this.detectOverlappingBars({i:q,j:Je,barXPosition:Xe,srtx:On,barWidth:se,xDivision:te,initPositions:Be});se=Sn.barWidth,Xe=Sn.barXPosition}st=(wt=this.drawRangeColumnPaths(v({indexes:{i:q,j:Je,realIndex:Re,translationsIndex:Ce},barWidth:se,barXPosition:Xe,zeroH:de,xDivision:te},bt))).barHeight}var yr=this.barHelpers.drawGoalLine({barXPosition:wt.barXPosition,barYPosition:Oe,goalX:wt.goalX,goalY:wt.goalY,barHeight:st,barWidth:se});yr&&_e.add(yr),ke=wt.y,Se=wt.x;var Pn=this.barHelpers.getPathFillColor(S,q,Je,Re),En=k.globals.stroke.colors[Re];this.renderSeries({realIndex:Re,pathFill:Pn,lineFill:En,j:Je,i:q,x:Se,y:ke,y1:gt,y2:Xt,pathFrom:wt.pathFrom,pathTo:wt.pathTo,strokeWidth:ct,elSeries:Fe,series:S,barHeight:st,barWidth:se,barXPosition:Xe,barYPosition:Oe,columnGroupIndex:Ge,elDataLabelsWrap:De,elGoalsMarkers:_e,visibleSeries:this.visibleI,type:"rangebar"})}B.add(Fe)}return B}},{key:"detectOverlappingBars",value:function(S){var _=S.i,k=S.j,T=S.barYPosition,B=S.barXPosition,q=S.srty,te=S.srtx,ue=S.barHeight,de=S.barWidth,xe=S.yDivision,Se=S.xDivision,ke=S.initPositions,Re=this.w,Ge=[],Fe=Re.config.series[_].data[k].rangeName,st=Re.config.series[_].data[k].x,se=Array.isArray(st)?st.join(" "):st,Ce=Re.globals.labels.map(function(De){return Array.isArray(De)?De.join(" "):De}).indexOf(se),Be=Re.globals.seriesRange[_].findIndex(function(De){return De.x===se&&De.overlaps.length>0});return this.isHorizontal?(T=Re.config.plotOptions.bar.rangeBarGroupRows?q+xe*Ce:q+ue*this.visibleI+xe*Ce,Be>-1&&!Re.config.plotOptions.bar.rangeBarOverlap&&(Ge=Re.globals.seriesRange[_][Be].overlaps).indexOf(Fe)>-1&&(T=(ue=ke.barHeight/Ge.length)*this.visibleI+xe*(100-parseInt(this.barOptions.barHeight,10))/100/2+ue*(this.visibleI+Ge.indexOf(Fe))+xe*Ce)):(Ce>-1&&!Re.globals.timescaleLabels.length&&(B=Re.config.plotOptions.bar.rangeBarGroupRows?te+Se*Ce:te+de*this.visibleI+Se*Ce),Be>-1&&!Re.config.plotOptions.bar.rangeBarOverlap&&(Ge=Re.globals.seriesRange[_][Be].overlaps).indexOf(Fe)>-1&&(B=(de=ke.barWidth/Ge.length)*this.visibleI+Se*(100-parseInt(this.barOptions.barWidth,10))/100/2+de*(this.visibleI+Ge.indexOf(Fe))+Se*Ce)),{barYPosition:T,barXPosition:B,barHeight:ue,barWidth:de}}},{key:"drawRangeColumnPaths",value:function(S){var _=S.indexes,k=S.x,T=S.xDivision,B=S.barWidth,q=S.barXPosition,te=S.zeroH,ue=this.w,de=_.i,xe=_.j,Se=_.realIndex,ke=_.translationsIndex,Re=this.yRatio[ke],Ge=this.getRangeValue(Se,xe),Fe=Math.min(Ge.start,Ge.end),st=Math.max(Ge.start,Ge.end);this.series[de][xe]===void 0||this.series[de][xe]===null?Fe=te:(Fe=te-Fe/Re,st=te-st/Re);var se=Math.abs(st-Fe),Ce=this.barHelpers.getColumnPaths({barXPosition:q,barWidth:B,y1:Fe,y2:st,strokeWidth:this.strokeWidth,series:this.seriesRangeEnd,realIndex:Se,i:Se,j:xe,w:ue});if(ue.globals.isXNumeric){var Be=this.getBarXForNumericXAxis({x:k,j:xe,realIndex:Se,barWidth:B});k=Be.x,q=Be.barXPosition}else k+=T;return{pathTo:Ce.pathTo,pathFrom:Ce.pathFrom,barHeight:se,x:k,y:Ge.start<0&&Ge.end<0?Fe:st,goalY:this.barHelpers.getGoalValues("y",null,te,de,xe,ke),barXPosition:q}}},{key:"preventBarOverflow",value:function(S){var _=this.w;return S<0&&(S=0),S>_.globals.gridWidth&&(S=_.globals.gridWidth),S}},{key:"drawRangeBarPaths",value:function(S){var _=S.indexes,k=S.y,T=S.y1,B=S.y2,q=S.yDivision,te=S.barHeight,ue=S.barYPosition,de=S.zeroW,xe=this.w,Se=_.realIndex,ke=_.j,Re=this.preventBarOverflow(de+T/this.invertedYRatio),Ge=this.preventBarOverflow(de+B/this.invertedYRatio),Fe=this.getRangeValue(Se,ke),st=Math.abs(Ge-Re),se=this.barHelpers.getBarpaths({barYPosition:ue,barHeight:te,x1:Re,x2:Ge,strokeWidth:this.strokeWidth,series:this.seriesRangeEnd,i:Se,realIndex:Se,j:ke,w:xe});return xe.globals.isXNumeric||(k+=q),{pathTo:se.pathTo,pathFrom:se.pathFrom,barWidth:st,x:Fe.start<0&&Fe.end<0?Re:Ge,goalX:this.barHelpers.getGoalValues("x",de,null,Se,ke),y:k}}},{key:"getRangeValue",value:function(S,_){var k=this.w;return{start:k.globals.seriesRangeStart[S][_],end:k.globals.seriesRangeEnd[S][_]}}}]),p}(),sn=function(){function Ee(h){s(this,Ee),this.w=h.w,this.lineCtx=h}return o(Ee,[{key:"sameValueSeriesFix",value:function(h,p){var S=this.w;if((S.config.fill.type==="gradient"||S.config.fill.type[h]==="gradient")&&new Q(this.lineCtx.ctx,S).seriesHaveSameValues(h)){var _=p[h].slice();_[_.length-1]=_[_.length-1]+1e-6,p[h]=_}return p}},{key:"calculatePoints",value:function(h){var p=h.series,S=h.realIndex,_=h.x,k=h.y,T=h.i,B=h.j,q=h.prevY,te=this.w,ue=[],de=[];if(B===0){var xe=this.lineCtx.categoryAxisCorrection+te.config.markers.offsetX;te.globals.isXNumeric&&(xe=(te.globals.seriesX[S][0]-te.globals.minX)/this.lineCtx.xRatio+te.config.markers.offsetX),ue.push(xe),de.push(F.isNumber(p[T][0])?q+te.config.markers.offsetY:null),ue.push(_+te.config.markers.offsetX),de.push(F.isNumber(p[T][B+1])?k+te.config.markers.offsetY:null)}else ue.push(_+te.config.markers.offsetX),de.push(F.isNumber(p[T][B+1])?k+te.config.markers.offsetY:null);return{x:ue,y:de}}},{key:"checkPreviousPaths",value:function(h){for(var p=h.pathFromLine,S=h.pathFromArea,_=h.realIndex,k=this.w,T=0;T<k.globals.previousPaths.length;T++){var B=k.globals.previousPaths[T];(B.type==="line"||B.type==="area")&&B.paths.length>0&&parseInt(B.realIndex,10)===parseInt(_,10)&&(B.type==="line"?(this.lineCtx.appendPathFrom=!1,p=k.globals.previousPaths[T].paths[0].d):B.type==="area"&&(this.lineCtx.appendPathFrom=!1,S=k.globals.previousPaths[T].paths[0].d,k.config.stroke.show&&k.globals.previousPaths[T].paths[1]&&(p=k.globals.previousPaths[T].paths[1].d)))}return{pathFromLine:p,pathFromArea:S}}},{key:"determineFirstPrevY",value:function(h){var p,S,_,k=h.i,T=h.realIndex,B=h.series,q=h.prevY,te=h.lineYPosition,ue=h.translationsIndex,de=this.w,xe=de.config.chart.stacked&&!de.globals.comboCharts||de.config.chart.stacked&&de.globals.comboCharts&&(!this.w.config.chart.stackOnlyBar||((p=this.w.config.series[T])===null||p===void 0?void 0:p.type)==="bar"||((S=this.w.config.series[T])===null||S===void 0?void 0:S.type)==="column");if(((_=B[k])===null||_===void 0?void 0:_[0])!==void 0)q=(te=xe&&k>0?this.lineCtx.prevSeriesY[k-1][0]:this.lineCtx.zeroY)-B[k][0]/this.lineCtx.yRatio[ue]+2*(this.lineCtx.isReversed?B[k][0]/this.lineCtx.yRatio[ue]:0);else if(xe&&k>0&&B[k][0]===void 0){for(var Se=k-1;Se>=0;Se--)if(B[Se][0]!==null&&B[Se][0]!==void 0){q=te=this.lineCtx.prevSeriesY[Se][0];break}}return{prevY:q,lineYPosition:te}}}]),Ee}(),Me=function(Ee){for(var h,p,S,_,k=function(ue){for(var de=[],xe=ue[0],Se=ue[1],ke=de[0]=Nt(xe,Se),Re=1,Ge=ue.length-1;Re<Ge;Re++)xe=Se,Se=ue[Re+1],de[Re]=.5*(ke+(ke=Nt(xe,Se)));return de[Re]=ke,de}(Ee),T=Ee.length-1,B=[],q=0;q<T;q++)S=Nt(Ee[q],Ee[q+1]),Math.abs(S)<1e-6?k[q]=k[q+1]=0:(_=(h=k[q]/S)*h+(p=k[q+1]/S)*p)>9&&(_=3*S/Math.sqrt(_),k[q]=_*h,k[q+1]=_*p);for(var te=0;te<=T;te++)_=(Ee[Math.min(T,te+1)][0]-Ee[Math.max(0,te-1)][0])/(6*(1+k[te]*k[te])),B.push([_||0,k[te]*_||0]);return B},en=function(Ee){var h=Me(Ee),p=Ee[1],S=Ee[0],_=[],k=h[1],T=h[0];_.push(S,[S[0]+T[0],S[1]+T[1],p[0]-k[0],p[1]-k[1],p[0],p[1]]);for(var B=2,q=h.length;B<q;B++){var te=Ee[B],ue=h[B];_.push([te[0]-ue[0],te[1]-ue[1],te[0],te[1]])}return _},an=function(Ee,h,p){var S=Ee.slice(h,p);if(h){if(p-h>1&&S[1].length<6){var _=S[0].length;S[1]=[2*S[0][_-2]-S[0][_-4],2*S[0][_-1]-S[0][_-3]].concat(S[1])}S[0]=S[0].slice(-2)}return S};function Nt(Ee,h){return(h[1]-Ee[1])/(h[0]-Ee[0])}var Yn=function(){function Ee(h,p,S){s(this,Ee),this.ctx=h,this.w=h.w,this.xyRatios=p,this.pointsChart=!(this.w.config.chart.type!=="bubble"&&this.w.config.chart.type!=="scatter")||S,this.scatter=new je(this.ctx),this.noNegatives=this.w.globals.minX===Number.MAX_VALUE,this.lineHelpers=new sn(this),this.markers=new ve(this.ctx),this.prevSeriesY=[],this.categoryAxisCorrection=0,this.yaxisIndex=0}return o(Ee,[{key:"draw",value:function(h,p,S,_){var k,T=this.w,B=new z(this.ctx),q=T.globals.comboCharts?p:T.config.chart.type,te=B.group({class:"apexcharts-".concat(q,"-series apexcharts-plot-series")}),ue=new Q(this.ctx,T);this.yRatio=this.xyRatios.yRatio,this.zRatio=this.xyRatios.zRatio,this.xRatio=this.xyRatios.xRatio,this.baseLineY=this.xyRatios.baseLineY,h=ue.getLogSeries(h),this.yRatio=ue.getLogYRatios(this.yRatio),this.prevSeriesY=[];for(var de=[],xe=0;xe<h.length;xe++){h=this.lineHelpers.sameValueSeriesFix(xe,h);var Se=T.globals.comboCharts?S[xe]:xe,ke=this.yRatio.length>1?Se:0;this._initSerieVariables(h,xe,Se);var Re=[],Ge=[],Fe=[],st=T.globals.padHorizontal+this.categoryAxisCorrection;this.ctx.series.addCollapsedClassToSeries(this.elSeries,Se),T.globals.isXNumeric&&T.globals.seriesX.length>0&&(st=(T.globals.seriesX[Se][0]-T.globals.minX)/this.xRatio),Fe.push(st);var se,Ce=st,Be=void 0,De=Ce,_e=this.zeroY,Je=this.zeroY;_e=this.lineHelpers.determineFirstPrevY({i:xe,realIndex:Se,series:h,prevY:_e,lineYPosition:0,translationsIndex:ke}).prevY,T.config.stroke.curve==="monotoneCubic"&&h[xe][0]===null?Re.push(null):Re.push(_e),se=_e,q==="rangeArea"&&(Be=Je=this.lineHelpers.determineFirstPrevY({i:xe,realIndex:Se,series:_,prevY:Je,lineYPosition:0,translationsIndex:ke}).prevY,Ge.push(Re[0]!==null?Je:null));var ct=this._calculatePathsFrom({type:q,series:h,i:xe,realIndex:Se,translationsIndex:ke,prevX:De,prevY:_e,prevY2:Je}),gt=[Re[0]],Xt=[Ge[0]],wt={type:q,series:h,realIndex:Se,translationsIndex:ke,i:xe,x:st,y:1,pX:Ce,pY:se,pathsFrom:ct,linePaths:[],areaPaths:[],seriesIndex:S,lineYPosition:0,xArrj:Fe,yArrj:Re,y2Arrj:Ge,seriesRangeEnd:_},Xe=this._iterateOverDataPoints(v(v({},wt),{},{iterations:q==="rangeArea"?h[xe].length-1:void 0,isRangeStart:!0}));if(q==="rangeArea"){for(var Oe=this._calculatePathsFrom({series:_,i:xe,realIndex:Se,prevX:De,prevY:Je}),bt=this._iterateOverDataPoints(v(v({},wt),{},{series:_,xArrj:[st],yArrj:gt,y2Arrj:Xt,pY:Be,areaPaths:Xe.areaPaths,pathsFrom:Oe,iterations:_[xe].length-1,isRangeStart:!1})),kt=Xe.linePaths.length/2,Ut=0;Ut<kt;Ut++)Xe.linePaths[Ut]=bt.linePaths[Ut+kt]+Xe.linePaths[Ut];Xe.linePaths.splice(kt),Xe.pathFromLine=bt.pathFromLine+Xe.pathFromLine}else Xe.pathFromArea+="z";this._handlePaths({type:q,realIndex:Se,i:xe,paths:Xe}),this.elSeries.add(this.elPointsMain),this.elSeries.add(this.elDataLabelsWrap),de.push(this.elSeries)}if(((k=T.config.series[0])===null||k===void 0?void 0:k.zIndex)!==void 0&&de.sort(function(Sn,yr){return Number(Sn.node.getAttribute("zIndex"))-Number(yr.node.getAttribute("zIndex"))}),T.config.chart.stacked)for(var fn=de.length-1;fn>=0;fn--)te.add(de[fn]);else for(var On=0;On<de.length;On++)te.add(de[On]);return te}},{key:"_initSerieVariables",value:function(h,p,S){var _=this.w,k=new z(this.ctx);this.xDivision=_.globals.gridWidth/(_.globals.dataPoints-(_.config.xaxis.tickPlacement==="on"?1:0)),this.strokeWidth=Array.isArray(_.config.stroke.width)?_.config.stroke.width[S]:_.config.stroke.width;var T=0;this.yRatio.length>1&&(this.yaxisIndex=_.globals.seriesYAxisReverseMap[S],T=S),this.isReversed=_.config.yaxis[this.yaxisIndex]&&_.config.yaxis[this.yaxisIndex].reversed,this.zeroY=_.globals.gridHeight-this.baseLineY[T]-(this.isReversed?_.globals.gridHeight:0)+(this.isReversed?2*this.baseLineY[T]:0),this.areaBottomY=this.zeroY,(this.zeroY>_.globals.gridHeight||_.config.plotOptions.area.fillTo==="end")&&(this.areaBottomY=_.globals.gridHeight),this.categoryAxisCorrection=this.xDivision/2,this.elSeries=k.group({class:"apexcharts-series",zIndex:_.config.series[S].zIndex!==void 0?_.config.series[S].zIndex:S,seriesName:F.escapeString(_.globals.seriesNames[S])}),this.elPointsMain=k.group({class:"apexcharts-series-markers-wrap","data:realIndex":S}),this.elDataLabelsWrap=k.group({class:"apexcharts-datalabels","data:realIndex":S});var B=h[p].length===_.globals.dataPoints;this.elSeries.attr({"data:longestSeries":B,rel:p+1,"data:realIndex":S}),this.appendPathFrom=!0}},{key:"_calculatePathsFrom",value:function(h){var p,S,_,k,T=h.type,B=h.series,q=h.i,te=h.realIndex,ue=h.translationsIndex,de=h.prevX,xe=h.prevY,Se=h.prevY2,ke=this.w,Re=new z(this.ctx);if(B[q][0]===null){for(var Ge=0;Ge<B[q].length;Ge++)if(B[q][Ge]!==null){de=this.xDivision*Ge,xe=this.zeroY-B[q][Ge]/this.yRatio[ue],p=Re.move(de,xe),S=Re.move(de,this.areaBottomY);break}}else p=Re.move(de,xe),T==="rangeArea"&&(p=Re.move(de,Se)+Re.line(de,xe)),S=Re.move(de,this.areaBottomY)+Re.line(de,xe);if(_=Re.move(0,this.zeroY)+Re.line(0,this.zeroY),k=Re.move(0,this.zeroY)+Re.line(0,this.zeroY),ke.globals.previousPaths.length>0){var Fe=this.lineHelpers.checkPreviousPaths({pathFromLine:_,pathFromArea:k,realIndex:te});_=Fe.pathFromLine,k=Fe.pathFromArea}return{prevX:de,prevY:xe,linePath:p,areaPath:S,pathFromLine:_,pathFromArea:k}}},{key:"_handlePaths",value:function(h){var p=h.type,S=h.realIndex,_=h.i,k=h.paths,T=this.w,B=new z(this.ctx),q=new ye(this.ctx);this.prevSeriesY.push(k.yArrj),T.globals.seriesXvalues[S]=k.xArrj,T.globals.seriesYvalues[S]=k.yArrj;var te=T.config.forecastDataPoints;if(te.count>0&&p!=="rangeArea"){var ue=T.globals.seriesXvalues[S][T.globals.seriesXvalues[S].length-te.count-1],de=B.drawRect(ue,0,T.globals.gridWidth,T.globals.gridHeight,0);T.globals.dom.elForecastMask.appendChild(de.node);var xe=B.drawRect(0,0,ue,T.globals.gridHeight,0);T.globals.dom.elNonForecastMask.appendChild(xe.node)}this.pointsChart||T.globals.delayedElements.push({el:this.elPointsMain.node,index:S});var Se={i:_,realIndex:S,animationDelay:_,initialSpeed:T.config.chart.animations.speed,dataChangeSpeed:T.config.chart.animations.dynamicAnimation.speed,className:"apexcharts-".concat(p)};if(p==="area")for(var ke=q.fillPath({seriesNumber:S}),Re=0;Re<k.areaPaths.length;Re++){var Ge=B.renderPaths(v(v({},Se),{},{pathFrom:k.pathFromArea,pathTo:k.areaPaths[Re],stroke:"none",strokeWidth:0,strokeLineCap:null,fill:ke}));this.elSeries.add(Ge)}if(T.config.stroke.show&&!this.pointsChart){var Fe=null;if(p==="line")Fe=q.fillPath({seriesNumber:S,i:_});else if(T.config.stroke.fill.type==="solid")Fe=T.globals.stroke.colors[S];else{var st=T.config.fill;T.config.fill=T.config.stroke.fill,Fe=q.fillPath({seriesNumber:S,i:_}),T.config.fill=st}for(var se=0;se<k.linePaths.length;se++){var Ce=Fe;p==="rangeArea"&&(Ce=q.fillPath({seriesNumber:S}));var Be=v(v({},Se),{},{pathFrom:k.pathFromLine,pathTo:k.linePaths[se],stroke:Fe,strokeWidth:this.strokeWidth,strokeLineCap:T.config.stroke.lineCap,fill:p==="rangeArea"?Ce:"none"}),De=B.renderPaths(Be);if(this.elSeries.add(De),De.attr("fill-rule","evenodd"),te.count>0&&p!=="rangeArea"){var _e=B.renderPaths(Be);_e.node.setAttribute("stroke-dasharray",te.dashArray),te.strokeWidth&&_e.node.setAttribute("stroke-width",te.strokeWidth),this.elSeries.add(_e),_e.attr("clip-path","url(#forecastMask".concat(T.globals.cuid,")")),De.attr("clip-path","url(#nonForecastMask".concat(T.globals.cuid,")"))}}}}},{key:"_iterateOverDataPoints",value:function(h){var p,S,_=this,k=h.type,T=h.series,B=h.iterations,q=h.realIndex,te=h.translationsIndex,ue=h.i,de=h.x,xe=h.y,Se=h.pX,ke=h.pY,Re=h.pathsFrom,Ge=h.linePaths,Fe=h.areaPaths,st=h.seriesIndex,se=h.lineYPosition,Ce=h.xArrj,Be=h.yArrj,De=h.y2Arrj,_e=h.isRangeStart,Je=h.seriesRangeEnd,ct=this.w,gt=new z(this.ctx),Xt=this.yRatio,wt=Re.prevY,Xe=Re.linePath,Oe=Re.areaPath,bt=Re.pathFromLine,kt=Re.pathFromArea,Ut=F.isNumber(ct.globals.minYArr[q])?ct.globals.minYArr[q]:ct.globals.minY;B||(B=ct.globals.dataPoints>1?ct.globals.dataPoints-1:ct.globals.dataPoints);var fn=function(Rr,Jr){return Jr-Rr/Xt[te]+2*(_.isReversed?Rr/Xt[te]:0)},On=xe,Sn=ct.config.chart.stacked&&!ct.globals.comboCharts||ct.config.chart.stacked&&ct.globals.comboCharts&&(!this.w.config.chart.stackOnlyBar||((p=this.w.config.series[q])===null||p===void 0?void 0:p.type)==="bar"||((S=this.w.config.series[q])===null||S===void 0?void 0:S.type)==="column"),yr=ct.config.stroke.curve;Array.isArray(yr)&&(yr=Array.isArray(st)?yr[st[ue]]:yr[ue]);for(var Pn,En=0,$n=0;$n<B;$n++){var Bn=T[ue][$n+1]===void 0||T[ue][$n+1]===null;if(ct.globals.isXNumeric){var _r=ct.globals.seriesX[q][$n+1];ct.globals.seriesX[q][$n+1]===void 0&&(_r=ct.globals.seriesX[q][B-1]),de=(_r-ct.globals.minX)/this.xRatio}else de+=this.xDivision;Sn?ue>0&&ct.globals.collapsedSeries.length<ct.config.series.length-1?se=this.prevSeriesY[function(Rr){for(var Jr=Rr;Jr>0;Jr--){if(!(ct.globals.collapsedSeriesIndices.indexOf((st==null?void 0:st[Jr])||Jr)>-1))return Jr;Jr--}return 0}(ue-1)][$n+1]:se=this.zeroY:se=this.zeroY,Bn?xe=fn(Ut,se):(xe=fn(T[ue][$n+1],se),k==="rangeArea"&&(On=fn(Je[ue][$n+1],se))),Ce.push(de),!Bn||ct.config.stroke.curve!=="smooth"&&ct.config.stroke.curve!=="monotoneCubic"?(Be.push(xe),De.push(On)):(Be.push(null),De.push(null));var sr=this.lineHelpers.calculatePoints({series:T,x:de,y:xe,realIndex:q,i:ue,j:$n,prevY:wt}),rr=this._createPaths({type:k,series:T,i:ue,realIndex:q,j:$n,x:de,y:xe,y2:On,xArrj:Ce,yArrj:Be,y2Arrj:De,pX:Se,pY:ke,pathState:En,segmentStartX:Pn,linePath:Xe,areaPath:Oe,linePaths:Ge,areaPaths:Fe,curve:yr,isRangeStart:_e});Fe=rr.areaPaths,Ge=rr.linePaths,Se=rr.pX,ke=rr.pY,En=rr.pathState,Pn=rr.segmentStartX,Oe=rr.areaPath,Xe=rr.linePath,!this.appendPathFrom||yr==="monotoneCubic"&&k==="rangeArea"||(bt+=gt.line(de,this.zeroY),kt+=gt.line(de,this.zeroY)),this.handleNullDataPoints(T,sr,ue,$n,q),this._handleMarkersAndLabels({type:k,pointsPos:sr,i:ue,j:$n,realIndex:q,isRangeStart:_e})}return{yArrj:Be,xArrj:Ce,pathFromArea:kt,areaPaths:Fe,pathFromLine:bt,linePaths:Ge,linePath:Xe,areaPath:Oe}}},{key:"_handleMarkersAndLabels",value:function(h){var p=h.type,S=h.pointsPos,_=h.isRangeStart,k=h.i,T=h.j,B=h.realIndex,q=this.w,te=new Ie(this.ctx);if(this.pointsChart)this.scatter.draw(this.elSeries,T,{realIndex:B,pointsPos:S,zRatio:this.zRatio,elParent:this.elPointsMain});else{q.globals.series[k].length>1&&this.elPointsMain.node.classList.add("apexcharts-element-hidden");var ue=this.markers.plotChartMarkers(S,B,T+1);ue!==null&&this.elPointsMain.add(ue)}var de=te.drawDataLabel({type:p,isRangeStart:_,pos:S,i:B,j:T+1});de!==null&&this.elDataLabelsWrap.add(de)}},{key:"_createPaths",value:function(h){var p=h.type,S=h.series,_=h.i;h.realIndex;var k,T=h.j,B=h.x,q=h.y,te=h.xArrj,ue=h.yArrj,de=h.y2,xe=h.y2Arrj,Se=h.pX,ke=h.pY,Re=h.pathState,Ge=h.segmentStartX,Fe=h.linePath,st=h.areaPath,se=h.linePaths,Ce=h.areaPaths,Be=h.curve,De=h.isRangeStart,_e=new z(this.ctx),Je=this.areaBottomY,ct=p==="rangeArea",gt=p==="rangeArea"&&De;switch(Be){case"monotoneCubic":var Xt=De?ue:xe;switch(Re){case 0:if(Xt[T+1]===null)break;Re=1;case 1:if(!(ct?te.length===S[_].length:T===S[_].length-2))break;case 2:var wt=De?te:te.slice().reverse(),Xe=De?Xt:Xt.slice().reverse(),Oe=(k=Xe,wt.map(function(_r,sr){return[_r,k[sr]]}).filter(function(_r){return _r[1]!==null})),bt=Oe.length>1?en(Oe):Oe,kt=[];ct&&(gt?Ce=Oe:kt=Ce.reverse());var Ut=0,fn=0;if(function(_r,sr){for(var rr=function(ls){var et=[],yt=0;return ls.forEach(function(Tn){Tn!==null?yt++:yt>0&&(et.push(yt),yt=0)}),yt>0&&et.push(yt),et}(_r),Rr=[],Jr=0,ws=0;Jr<rr.length;ws+=rr[Jr++])Rr[Jr]=an(sr,ws,ws+rr[Jr]);return Rr}(Xe,bt).forEach(function(_r){Ut++;var sr=function(Jr){for(var ws="",ls=0;ls<Jr.length;ls++){var et=Jr[ls],yt=et.length;yt>4?(ws+="C".concat(et[0],", ").concat(et[1]),ws+=", ".concat(et[2],", ").concat(et[3]),ws+=", ".concat(et[4],", ").concat(et[5])):yt>2&&(ws+="S".concat(et[0],", ").concat(et[1]),ws+=", ".concat(et[2],", ").concat(et[3]))}return ws}(_r),rr=fn,Rr=(fn+=_r.length)-1;gt?Fe=_e.move(Oe[rr][0],Oe[rr][1])+sr:ct?Fe=_e.move(kt[rr][0],kt[rr][1])+_e.line(Oe[rr][0],Oe[rr][1])+sr+_e.line(kt[Rr][0],kt[Rr][1]):(Fe=_e.move(Oe[rr][0],Oe[rr][1])+sr,st=Fe+_e.line(Oe[Rr][0],Je)+_e.line(Oe[rr][0],Je)+"z",Ce.push(st)),se.push(Fe)}),ct&&Ut>1&&!gt){var On=se.slice(Ut).reverse();se.splice(Ut),On.forEach(function(_r){return se.push(_r)})}Re=0}break;case"smooth":var Sn=.35*(B-Se);if(S[_][T]===null)Re=0;else switch(Re){case 0:if(Ge=Se,Fe=gt?_e.move(Se,xe[T])+_e.line(Se,ke):_e.move(Se,ke),st=_e.move(Se,ke),S[_][T+1]===null){se.push(Fe),Ce.push(st);break}if(Re=1,T<S[_].length-2){var yr=_e.curve(Se+Sn,ke,B-Sn,q,B,q);Fe+=yr,st+=yr;break}case 1:if(S[_][T+1]===null)Fe+=gt?_e.line(Se,de):_e.move(Se,ke),st+=_e.line(Se,Je)+_e.line(Ge,Je)+"z",se.push(Fe),Ce.push(st),Re=-1;else{var Pn=_e.curve(Se+Sn,ke,B-Sn,q,B,q);Fe+=Pn,st+=Pn,T>=S[_].length-2&&(gt&&(Fe+=_e.curve(B,q,B,q,B,de)+_e.move(B,de)),st+=_e.curve(B,q,B,q,B,Je)+_e.line(Ge,Je)+"z",se.push(Fe),Ce.push(st),Re=-1)}}Se=B,ke=q;break;default:var En=function(_r,sr,rr){var Rr=[];switch(_r){case"stepline":Rr=_e.line(sr,null,"H")+_e.line(null,rr,"V");break;case"linestep":Rr=_e.line(null,rr,"V")+_e.line(sr,null,"H");break;case"straight":Rr=_e.line(sr,rr)}return Rr};if(S[_][T]===null)Re=0;else switch(Re){case 0:if(Ge=Se,Fe=gt?_e.move(Se,xe[T])+_e.line(Se,ke):_e.move(Se,ke),st=_e.move(Se,ke),S[_][T+1]===null){se.push(Fe),Ce.push(st);break}if(Re=1,T<S[_].length-2){var $n=En(Be,B,q);Fe+=$n,st+=$n;break}case 1:if(S[_][T+1]===null)Fe+=gt?_e.line(Se,de):_e.move(Se,ke),st+=_e.line(Se,Je)+_e.line(Ge,Je)+"z",se.push(Fe),Ce.push(st),Re=-1;else{var Bn=En(Be,B,q);Fe+=Bn,st+=Bn,T>=S[_].length-2&&(gt&&(Fe+=_e.line(B,de)),st+=_e.line(B,Je)+_e.line(Ge,Je)+"z",se.push(Fe),Ce.push(st),Re=-1)}}Se=B,ke=q}return{linePaths:se,areaPaths:Ce,pX:Se,pY:ke,pathState:Re,segmentStartX:Ge,linePath:Fe,areaPath:st}}},{key:"handleNullDataPoints",value:function(h,p,S,_,k){var T=this.w;if(h[S][_]===null&&T.config.markers.showNullDataPoints||h[S].length===1){var B=this.strokeWidth-T.config.markers.strokeWidth/2;B>0||(B=0);var q=this.markers.plotChartMarkers(p,k,_+1,B,!0);q!==null&&this.elPointsMain.add(q)}}}]),Ee}();window.TreemapSquared={},window.TreemapSquared.generate=function(){function Ee(B,q,te,ue){this.xoffset=B,this.yoffset=q,this.height=ue,this.width=te,this.shortestEdge=function(){return Math.min(this.height,this.width)},this.getCoordinates=function(de){var xe,Se=[],ke=this.xoffset,Re=this.yoffset,Ge=k(de)/this.height,Fe=k(de)/this.width;if(this.width>=this.height)for(xe=0;xe<de.length;xe++)Se.push([ke,Re,ke+Ge,Re+de[xe]/Ge]),Re+=de[xe]/Ge;else for(xe=0;xe<de.length;xe++)Se.push([ke,Re,ke+de[xe]/Fe,Re+Fe]),ke+=de[xe]/Fe;return Se},this.cutArea=function(de){var xe;if(this.width>=this.height){var Se=de/this.height,ke=this.width-Se;xe=new Ee(this.xoffset+Se,this.yoffset,ke,this.height)}else{var Re=de/this.width,Ge=this.height-Re;xe=new Ee(this.xoffset,this.yoffset+Re,this.width,Ge)}return xe}}function h(B,q,te,ue,de){ue=ue===void 0?0:ue,de=de===void 0?0:de;var xe=p(function(Se,ke){var Re,Ge=[],Fe=ke/k(Se);for(Re=0;Re<Se.length;Re++)Ge[Re]=Se[Re]*Fe;return Ge}(B,q*te),[],new Ee(ue,de,q,te),[]);return function(Se){var ke,Re,Ge=[];for(ke=0;ke<Se.length;ke++)for(Re=0;Re<Se[ke].length;Re++)Ge.push(Se[ke][Re]);return Ge}(xe)}function p(B,q,te,ue){var de,xe,Se;if(B.length!==0)return de=te.shortestEdge(),function(ke,Re,Ge){var Fe;if(ke.length===0)return!0;(Fe=ke.slice()).push(Re);var st=S(ke,Ge),se=S(Fe,Ge);return st>=se}(q,xe=B[0],de)?(q.push(xe),p(B.slice(1),q,te,ue)):(Se=te.cutArea(k(q),ue),ue.push(te.getCoordinates(q)),p(B,[],Se,ue)),ue;ue.push(te.getCoordinates(q))}function S(B,q){var te=Math.min.apply(Math,B),ue=Math.max.apply(Math,B),de=k(B);return Math.max(Math.pow(q,2)*ue/Math.pow(de,2),Math.pow(de,2)/(Math.pow(q,2)*te))}function _(B){return B&&B.constructor===Array}function k(B){var q,te=0;for(q=0;q<B.length;q++)te+=B[q];return te}function T(B){var q,te=0;if(_(B[0]))for(q=0;q<B.length;q++)te+=T(B[q]);else te=k(B);return te}return function B(q,te,ue,de,xe){de=de===void 0?0:de,xe=xe===void 0?0:xe;var Se,ke,Re=[],Ge=[];if(_(q[0])){for(ke=0;ke<q.length;ke++)Re[ke]=T(q[ke]);for(Se=h(Re,te,ue,de,xe),ke=0;ke<q.length;ke++)Ge.push(B(q[ke],Se[ke][2]-Se[ke][0],Se[ke][3]-Se[ke][1],Se[ke][0],Se[ke][1]))}else Ge=h(q,te,ue,de,xe);return Ge}}();var xn,Mt,tn=function(){function Ee(h,p){s(this,Ee),this.ctx=h,this.w=h.w,this.strokeWidth=this.w.config.stroke.width,this.helpers=new kn(h),this.dynamicAnim=this.w.config.chart.animations.dynamicAnimation,this.labels=[]}return o(Ee,[{key:"draw",value:function(h){var p=this,S=this.w,_=new z(this.ctx),k=new ye(this.ctx),T=_.group({class:"apexcharts-treemap"});if(S.globals.noData)return T;var B=[];return h.forEach(function(q){var te=q.map(function(ue){return Math.abs(ue)});B.push(te)}),this.negRange=this.helpers.checkColorRange(),S.config.series.forEach(function(q,te){q.data.forEach(function(ue){Array.isArray(p.labels[te])||(p.labels[te]=[]),p.labels[te].push(ue.x)})}),window.TreemapSquared.generate(B,S.globals.gridWidth,S.globals.gridHeight).forEach(function(q,te){var ue=_.group({class:"apexcharts-series apexcharts-treemap-series",seriesName:F.escapeString(S.globals.seriesNames[te]),rel:te+1,"data:realIndex":te});if(S.config.chart.dropShadow.enabled){var de=S.config.chart.dropShadow;new L(p.ctx).dropShadow(T,de,te)}var xe=_.group({class:"apexcharts-data-labels"});q.forEach(function(Se,ke){var Re=Se[0],Ge=Se[1],Fe=Se[2],st=Se[3],se=_.drawRect(Re,Ge,Fe-Re,st-Ge,S.config.plotOptions.treemap.borderRadius,"#fff",1,p.strokeWidth,S.config.plotOptions.treemap.useFillColorAsStroke?Be:S.globals.stroke.colors[te]);se.attr({cx:Re,cy:Ge,index:te,i:te,j:ke,width:Fe-Re,height:st-Ge});var Ce=p.helpers.getShadeColor(S.config.chart.type,te,ke,p.negRange),Be=Ce.color;S.config.series[te].data[ke]!==void 0&&S.config.series[te].data[ke].fillColor&&(Be=S.config.series[te].data[ke].fillColor);var De=k.fillPath({color:Be,seriesNumber:te,dataPointIndex:ke});se.node.classList.add("apexcharts-treemap-rect"),se.attr({fill:De}),p.helpers.addListeners(se);var _e={x:Re+(Fe-Re)/2,y:Ge+(st-Ge)/2,width:0,height:0},Je={x:Re,y:Ge,width:Fe-Re,height:st-Ge};if(S.config.chart.animations.enabled&&!S.globals.dataChanged){var ct=1;S.globals.resized||(ct=S.config.chart.animations.speed),p.animateTreemap(se,_e,Je,ct)}if(S.globals.dataChanged){var gt=1;p.dynamicAnim.enabled&&S.globals.shouldAnimate&&(gt=p.dynamicAnim.speed,S.globals.previousPaths[te]&&S.globals.previousPaths[te][ke]&&S.globals.previousPaths[te][ke].rect&&(_e=S.globals.previousPaths[te][ke].rect),p.animateTreemap(se,_e,Je,gt))}var Xt=p.getFontSize(Se),wt=S.config.dataLabels.formatter(p.labels[te][ke],{value:S.globals.series[te][ke],seriesIndex:te,dataPointIndex:ke,w:S});S.config.plotOptions.treemap.dataLabels.format==="truncate"&&(Xt=parseInt(S.config.dataLabels.style.fontSize,10),wt=p.truncateLabels(wt,Xt,Re,Ge,Fe,st));var Xe=null;S.globals.series[te][ke]&&(Xe=p.helpers.calculateDataLabels({text:wt,x:(Re+Fe)/2,y:(Ge+st)/2+p.strokeWidth/2+Xt/3,i:te,j:ke,colorProps:Ce,fontSize:Xt,series:h})),S.config.dataLabels.enabled&&Xe&&p.rotateToFitLabel(Xe,Xt,wt,Re,Ge,Fe,st),ue.add(se),Xe!==null&&ue.add(Xe)}),ue.add(xe),T.add(ue)}),T}},{key:"getFontSize",value:function(h){var p=this.w,S,_,k,T,B=function q(te){var ue,de=0;if(Array.isArray(te[0]))for(ue=0;ue<te.length;ue++)de+=q(te[ue]);else for(ue=0;ue<te.length;ue++)de+=te[ue].length;return de}(this.labels)/function q(te){var ue,de=0;if(Array.isArray(te[0]))for(ue=0;ue<te.length;ue++)de+=q(te[ue]);else for(ue=0;ue<te.length;ue++)de+=1;return de}(this.labels);return S=h[2]-h[0],_=h[3]-h[1],k=S*_,T=Math.pow(k,.5),Math.min(T/B,parseInt(p.config.dataLabels.style.fontSize,10))}},{key:"rotateToFitLabel",value:function(h,p,S,_,k,T,B){var q=new z(this.ctx),te=q.getTextRects(S,p);if(te.width+this.w.config.stroke.width+5>T-_&&te.width<=B-k){var ue=q.rotateAroundCenter(h.node);h.node.setAttribute("transform","rotate(-90 ".concat(ue.x," ").concat(ue.y,") translate(").concat(te.height/3,")"))}}},{key:"truncateLabels",value:function(h,p,S,_,k,T){var B=new z(this.ctx),q=B.getTextRects(h,p).width+this.w.config.stroke.width+5>k-S&&T-_>k-S?T-_:k-S,te=B.getTextBasedOnMaxWidth({text:h,maxWidth:q,fontSize:p});return h.length!==te.length&&q/p<5?"":te}},{key:"animateTreemap",value:function(h,p,S,_){var k=new U(this.ctx);k.animateRect(h,{x:p.x,y:p.y,width:p.width,height:p.height},{x:S.x,y:S.y,width:S.width,height:S.height},_,function(){k.animationCompleted(h)})}}]),Ee}(),In=86400,Xn=10/In,or=function(){function Ee(h){s(this,Ee),this.ctx=h,this.w=h.w,this.timeScaleArray=[],this.utc=this.w.config.xaxis.labels.datetimeUTC}return o(Ee,[{key:"calculateTimeScaleTicks",value:function(h,p){var S=this,_=this.w;if(_.globals.allSeriesCollapsed)return _.globals.labels=[],_.globals.timescaleLabels=[],[];var k=new X(this.ctx),T=(p-h)/864e5;this.determineInterval(T),_.globals.disableZoomIn=!1,_.globals.disableZoomOut=!1,T<Xn?_.globals.disableZoomIn=!0:T>5e4&&(_.globals.disableZoomOut=!0);var B=k.getTimeUnitsfromTimestamp(h,p,this.utc),q=_.globals.gridWidth/T,te=q/24,ue=te/60,de=ue/60,xe=Math.floor(24*T),Se=Math.floor(1440*T),ke=Math.floor(T*In),Re=Math.floor(T),Ge=Math.floor(T/30),Fe=Math.floor(T/365),st={minMillisecond:B.minMillisecond,minSecond:B.minSecond,minMinute:B.minMinute,minHour:B.minHour,minDate:B.minDate,minMonth:B.minMonth,minYear:B.minYear},se={firstVal:st,currentMillisecond:st.minMillisecond,currentSecond:st.minSecond,currentMinute:st.minMinute,currentHour:st.minHour,currentMonthDate:st.minDate,currentDate:st.minDate,currentMonth:st.minMonth,currentYear:st.minYear,daysWidthOnXAxis:q,hoursWidthOnXAxis:te,minutesWidthOnXAxis:ue,secondsWidthOnXAxis:de,numberOfSeconds:ke,numberOfMinutes:Se,numberOfHours:xe,numberOfDays:Re,numberOfMonths:Ge,numberOfYears:Fe};switch(this.tickInterval){case"years":this.generateYearScale(se);break;case"months":case"half_year":this.generateMonthScale(se);break;case"months_days":case"months_fortnight":case"days":case"week_days":this.generateDayScale(se);break;case"hours":this.generateHourScale(se);break;case"minutes_fives":case"minutes":this.generateMinuteScale(se);break;case"seconds_tens":case"seconds_fives":case"seconds":this.generateSecondScale(se)}var Ce=this.timeScaleArray.map(function(Be){var De={position:Be.position,unit:Be.unit,year:Be.year,day:Be.day?Be.day:1,hour:Be.hour?Be.hour:0,month:Be.month+1};return Be.unit==="month"?v(v({},De),{},{day:1,value:Be.value+1}):Be.unit==="day"||Be.unit==="hour"?v(v({},De),{},{value:Be.value}):Be.unit==="minute"?v(v({},De),{},{value:Be.value,minute:Be.value}):Be.unit==="second"?v(v({},De),{},{value:Be.value,minute:Be.minute,second:Be.second}):Be});return Ce.filter(function(Be){var De=1,_e=Math.ceil(_.globals.gridWidth/120),Je=Be.value;_.config.xaxis.tickAmount!==void 0&&(_e=_.config.xaxis.tickAmount),Ce.length>_e&&(De=Math.floor(Ce.length/_e));var ct=!1,gt=!1;switch(S.tickInterval){case"years":Be.unit==="year"&&(ct=!0);break;case"half_year":De=7,Be.unit==="year"&&(ct=!0);break;case"months":De=1,Be.unit==="year"&&(ct=!0);break;case"months_fortnight":De=15,Be.unit!=="year"&&Be.unit!=="month"||(ct=!0),Je===30&&(gt=!0);break;case"months_days":De=10,Be.unit==="month"&&(ct=!0),Je===30&&(gt=!0);break;case"week_days":De=8,Be.unit==="month"&&(ct=!0);break;case"days":De=1,Be.unit==="month"&&(ct=!0);break;case"hours":Be.unit==="day"&&(ct=!0);break;case"minutes_fives":case"seconds_fives":Je%5!=0&&(gt=!0);break;case"seconds_tens":Je%10!=0&&(gt=!0)}if(S.tickInterval==="hours"||S.tickInterval==="minutes_fives"||S.tickInterval==="seconds_tens"||S.tickInterval==="seconds_fives"){if(!gt)return!0}else if((Je%De==0||ct)&&!gt)return!0})}},{key:"recalcDimensionsBasedOnFormat",value:function(h,p){var S=this.w,_=this.formatDates(h),k=this.removeOverlappingTS(_);S.globals.timescaleLabels=k.slice(),new Ye(this.ctx).plotCoords()}},{key:"determineInterval",value:function(h){var p=24*h,S=60*p;switch(!0){case h/365>5:this.tickInterval="years";break;case h>800:this.tickInterval="half_year";break;case h>180:this.tickInterval="months";break;case h>90:this.tickInterval="months_fortnight";break;case h>60:this.tickInterval="months_days";break;case h>30:this.tickInterval="week_days";break;case h>2:this.tickInterval="days";break;case p>2.4:this.tickInterval="hours";break;case S>15:this.tickInterval="minutes_fives";break;case S>5:this.tickInterval="minutes";break;case S>1:this.tickInterval="seconds_tens";break;case 60*S>20:this.tickInterval="seconds_fives";break;default:this.tickInterval="seconds"}}},{key:"generateYearScale",value:function(h){var p=h.firstVal,S=h.currentMonth,_=h.currentYear,k=h.daysWidthOnXAxis,T=h.numberOfYears,B=p.minYear,q=0,te=new X(this.ctx),ue="year";if(p.minDate>1||p.minMonth>0){var de=te.determineRemainingDaysOfYear(p.minYear,p.minMonth,p.minDate);q=(te.determineDaysOfYear(p.minYear)-de+1)*k,B=p.minYear+1,this.timeScaleArray.push({position:q,value:B,unit:ue,year:B,month:F.monthMod(S+1)})}else p.minDate===1&&p.minMonth===0&&this.timeScaleArray.push({position:q,value:B,unit:ue,year:_,month:F.monthMod(S+1)});for(var xe=B,Se=q,ke=0;ke<T;ke++)xe++,Se=te.determineDaysOfYear(xe-1)*k+Se,this.timeScaleArray.push({position:Se,value:xe,unit:ue,year:xe,month:1})}},{key:"generateMonthScale",value:function(h){var p=h.firstVal,S=h.currentMonthDate,_=h.currentMonth,k=h.currentYear,T=h.daysWidthOnXAxis,B=h.numberOfMonths,q=_,te=0,ue=new X(this.ctx),de="month",xe=0;if(p.minDate>1){te=(ue.determineDaysOfMonths(_+1,p.minYear)-S+1)*T,q=F.monthMod(_+1);var Se=k+xe,ke=F.monthMod(q),Re=q;q===0&&(de="year",Re=Se,ke=1,Se+=xe+=1),this.timeScaleArray.push({position:te,value:Re,unit:de,year:Se,month:ke})}else this.timeScaleArray.push({position:te,value:q,unit:de,year:k,month:F.monthMod(_)});for(var Ge=q+1,Fe=te,st=0,se=1;st<B;st++,se++){(Ge=F.monthMod(Ge))===0?(de="year",xe+=1):de="month";var Ce=this._getYear(k,Ge,xe);Fe=ue.determineDaysOfMonths(Ge,Ce)*T+Fe;var Be=Ge===0?Ce:Ge;this.timeScaleArray.push({position:Fe,value:Be,unit:de,year:Ce,month:Ge===0?1:Ge}),Ge++}}},{key:"generateDayScale",value:function(h){var p=h.firstVal,S=h.currentMonth,_=h.currentYear,k=h.hoursWidthOnXAxis,T=h.numberOfDays,B=new X(this.ctx),q="day",te=p.minDate+1,ue=te,de=function(se,Ce,Be){return se>B.determineDaysOfMonths(Ce+1,Be)&&(ue=1,q="month",Se=Ce+=1),Ce},xe=(24-p.minHour)*k,Se=te,ke=de(ue,S,_);p.minHour===0&&p.minDate===1?(xe=0,Se=F.monthMod(p.minMonth),q="month",ue=p.minDate):p.minDate!==1&&p.minHour===0&&p.minMinute===0&&(xe=0,te=p.minDate,Se=te,ke=de(ue=te,S,_)),this.timeScaleArray.push({position:xe,value:Se,unit:q,year:this._getYear(_,ke,0),month:F.monthMod(ke),day:ue});for(var Re=xe,Ge=0;Ge<T;Ge++){q="day",ke=de(ue+=1,ke,this._getYear(_,ke,0));var Fe=this._getYear(_,ke,0);Re=24*k+Re;var st=ue===1?F.monthMod(ke):ue;this.timeScaleArray.push({position:Re,value:st,unit:q,year:Fe,month:F.monthMod(ke),day:st})}}},{key:"generateHourScale",value:function(h){var p=h.firstVal,S=h.currentDate,_=h.currentMonth,k=h.currentYear,T=h.minutesWidthOnXAxis,B=h.numberOfHours,q=new X(this.ctx),te="hour",ue=function(De,_e){return De>q.determineDaysOfMonths(_e+1,k)&&(Ge=1,_e+=1),{month:_e,date:Ge}},de=function(De,_e){return De>q.determineDaysOfMonths(_e+1,k)?_e+=1:_e},xe=60-(p.minMinute+p.minSecond/60),Se=xe*T,ke=p.minHour+1,Re=ke;xe===60&&(Se=0,Re=ke=p.minHour);var Ge=S;Re>=24&&(Re=0,Ge+=1,te="day");var Fe=ue(Ge,_).month;Fe=de(Ge,Fe),this.timeScaleArray.push({position:Se,value:ke,unit:te,day:Ge,hour:Re,year:k,month:F.monthMod(Fe)}),Re++;for(var st=Se,se=0;se<B;se++){te="hour",Re>=24&&(Re=0,te="day",Fe=ue(Ge+=1,Fe).month,Fe=de(Ge,Fe));var Ce=this._getYear(k,Fe,0);st=60*T+st;var Be=Re===0?Ge:Re;this.timeScaleArray.push({position:st,value:Be,unit:te,hour:Re,day:Ge,year:Ce,month:F.monthMod(Fe)}),Re++}}},{key:"generateMinuteScale",value:function(h){for(var p=h.currentMillisecond,S=h.currentSecond,_=h.currentMinute,k=h.currentHour,T=h.currentDate,B=h.currentMonth,q=h.currentYear,te=h.minutesWidthOnXAxis,ue=h.secondsWidthOnXAxis,de=h.numberOfMinutes,xe=_+1,Se=T,ke=B,Re=q,Ge=k,Fe=(60-S-p/1e3)*ue,st=0;st<de;st++)xe>=60&&(xe=0,(Ge+=1)===24&&(Ge=0)),this.timeScaleArray.push({position:Fe,value:xe,unit:"minute",hour:Ge,minute:xe,day:Se,year:this._getYear(Re,ke,0),month:F.monthMod(ke)}),Fe+=te,xe++}},{key:"generateSecondScale",value:function(h){for(var p=h.currentMillisecond,S=h.currentSecond,_=h.currentMinute,k=h.currentHour,T=h.currentDate,B=h.currentMonth,q=h.currentYear,te=h.secondsWidthOnXAxis,ue=h.numberOfSeconds,de=S+1,xe=_,Se=T,ke=B,Re=q,Ge=k,Fe=(1e3-p)/1e3*te,st=0;st<ue;st++)de>=60&&(de=0,++xe>=60&&(xe=0,++Ge===24&&(Ge=0))),this.timeScaleArray.push({position:Fe,value:de,unit:"second",hour:Ge,minute:xe,second:de,day:Se,year:this._getYear(Re,ke,0),month:F.monthMod(ke)}),Fe+=te,de++}},{key:"createRawDateString",value:function(h,p){var S=h.year;return h.month===0&&(h.month=1),S+="-"+("0"+h.month.toString()).slice(-2),h.unit==="day"?S+=h.unit==="day"?"-"+("0"+p).slice(-2):"-01":S+="-"+("0"+(h.day?h.day:"1")).slice(-2),h.unit==="hour"?S+=h.unit==="hour"?"T"+("0"+p).slice(-2):"T00":S+="T"+("0"+(h.hour?h.hour:"0")).slice(-2),h.unit==="minute"?S+=":"+("0"+p).slice(-2):S+=":"+(h.minute?("0"+h.minute).slice(-2):"00"),h.unit==="second"?S+=":"+("0"+p).slice(-2):S+=":00",this.utc&&(S+=".000Z"),S}},{key:"formatDates",value:function(h){var p=this,S=this.w;return h.map(function(_){var k=_.value.toString(),T=new X(p.ctx),B=p.createRawDateString(_,k),q=T.getDate(T.parseDate(B));if(p.utc||(q=T.getDate(T.parseDateWithTimezone(B))),S.config.xaxis.labels.format===void 0){var te="dd MMM",ue=S.config.xaxis.labels.datetimeFormatter;_.unit==="year"&&(te=ue.year),_.unit==="month"&&(te=ue.month),_.unit==="day"&&(te=ue.day),_.unit==="hour"&&(te=ue.hour),_.unit==="minute"&&(te=ue.minute),_.unit==="second"&&(te=ue.second),k=T.formatDate(q,te)}else k=T.formatDate(q,S.config.xaxis.labels.format);return{dateString:B,position:_.position,value:k,unit:_.unit,year:_.year,month:_.month}})}},{key:"removeOverlappingTS",value:function(h){var p,S=this,_=new z(this.ctx),k=!1;h.length>0&&h[0].value&&h.every(function(q){return q.value.length===h[0].value.length})&&(k=!0,p=_.getTextRects(h[0].value).width);var T=0,B=h.map(function(q,te){if(te>0&&S.w.config.xaxis.labels.hideOverlappingLabels){var ue=k?p:_.getTextRects(h[T].value).width,de=h[T].position;return q.position>de+ue+10?(T=te,q):null}return q});return B=B.filter(function(q){return q!==null})}},{key:"_getYear",value:function(h,p,S){return h+Math.floor(p/12)+S}}]),Ee}(),lr=function(){function Ee(h,p){s(this,Ee),this.ctx=p,this.w=p.w,this.el=h}return o(Ee,[{key:"setupElements",value:function(){var h=this.w,p=h.globals,S=h.config,_=S.chart.type;p.axisCharts=["line","area","bar","rangeBar","rangeArea","candlestick","boxPlot","scatter","bubble","radar","heatmap","treemap"].includes(_),p.xyCharts=["line","area","bar","rangeBar","rangeArea","candlestick","boxPlot","scatter","bubble"].includes(_),p.isBarHorizontal=["bar","rangeBar","boxPlot"].includes(_)&&S.plotOptions.bar.horizontal,p.chartClass=".apexcharts".concat(p.chartID),p.dom.baseEl=this.el,p.dom.elWrap=document.createElement("div"),z.setAttrs(p.dom.elWrap,{id:p.chartClass.substring(1),class:"apexcharts-canvas ".concat(p.chartClass.substring(1))}),this.el.appendChild(p.dom.elWrap),p.dom.Paper=new window.SVG.Doc(p.dom.elWrap),p.dom.Paper.attr({class:"apexcharts-svg","xmlns:data":"ApexChartsNS",transform:"translate(".concat(S.chart.offsetX,", ").concat(S.chart.offsetY,")")}),p.dom.Paper.node.style.background=S.theme.mode!=="dark"||S.chart.background?S.theme.mode!=="light"||S.chart.background?S.chart.background:"#fff":"#424242",this.setSVGDimensions(),p.dom.elLegendForeign=document.createElementNS(p.SVGNS,"foreignObject"),z.setAttrs(p.dom.elLegendForeign,{x:0,y:0,width:p.svgWidth,height:p.svgHeight}),p.dom.elLegendWrap=document.createElement("div"),p.dom.elLegendWrap.classList.add("apexcharts-legend"),p.dom.elLegendWrap.setAttribute("xmlns","http://www.w3.org/1999/xhtml"),p.dom.elLegendForeign.appendChild(p.dom.elLegendWrap),p.dom.Paper.node.appendChild(p.dom.elLegendForeign),p.dom.elGraphical=p.dom.Paper.group().attr({class:"apexcharts-inner apexcharts-graphical"}),p.dom.elDefs=p.dom.Paper.defs(),p.dom.Paper.add(p.dom.elGraphical),p.dom.elGraphical.add(p.dom.elDefs)}},{key:"plotChartType",value:function(h,p){var S=this.w,_=this.ctx,k=S.config,T=S.globals,B={line:{series:[],i:[]},area:{series:[],i:[]},scatter:{series:[],i:[]},bubble:{series:[],i:[]},column:{series:[],i:[]},candlestick:{series:[],i:[]},boxPlot:{series:[],i:[]},rangeBar:{series:[],i:[]},rangeArea:{series:[],seriesRangeEnd:[],i:[]}},q=k.chart.type||"line",te=null,ue=0;T.series.forEach(function(De,_e){var Je=h[_e].type||q;B[Je]?(Je==="rangeArea"?(B[Je].series.push(T.seriesRangeStart[_e]),B[Je].seriesRangeEnd.push(T.seriesRangeEnd[_e])):B[Je].series.push(De),B[Je].i.push(_e),Je!=="column"&&Je!=="bar"||(S.globals.columnSeries=B.column)):["heatmap","treemap","pie","donut","polarArea","radialBar","radar"].includes(Je)?te=Je:Je==="bar"?(B.column.series.push(De),B.column.i.push(_e)):console.warn("You have specified an unrecognized series type (".concat(Je,").")),q!==Je&&Je!=="scatter"&&ue++}),ue>0&&(te&&console.warn("Chart or series type ".concat(te," cannot appear with other chart or series types.")),B.column.series.length>0&&k.plotOptions.bar.horizontal&&(ue-=B.column.series.length,B.column={series:[],i:[]},S.globals.columnSeries={series:[],i:[]},console.warn("Horizontal bars are not supported in a mixed/combo chart. Please turn off `plotOptions.bar.horizontal`"))),T.comboCharts||(T.comboCharts=ue>0);var de=new Yn(_,p),xe=new Nn(_,p);_.pie=new Gn(_);var Se=new Kn(_);_.rangeBar=new Cn(_,p);var ke=new Dn(_),Re=[];if(T.comboCharts){var Ge,Fe,st=new Q(_);if(B.area.series.length>0&&(Ge=Re).push.apply(Ge,N(st.drawSeriesByGroup(B.area,T.areaGroups,"area",de))),B.column.series.length>0)if(k.chart.stacked){var se=new gn(_,p);Re.push(se.draw(B.column.series,B.column.i))}else _.bar=new on(_,p),Re.push(_.bar.draw(B.column.series,B.column.i));if(B.rangeArea.series.length>0&&Re.push(de.draw(B.rangeArea.series,"rangeArea",B.rangeArea.i,B.rangeArea.seriesRangeEnd)),B.line.series.length>0&&(Fe=Re).push.apply(Fe,N(st.drawSeriesByGroup(B.line,T.lineGroups,"line",de))),B.candlestick.series.length>0&&Re.push(xe.draw(B.candlestick.series,"candlestick",B.candlestick.i)),B.boxPlot.series.length>0&&Re.push(xe.draw(B.boxPlot.series,"boxPlot",B.boxPlot.i)),B.rangeBar.series.length>0&&Re.push(_.rangeBar.draw(B.rangeBar.series,B.rangeBar.i)),B.scatter.series.length>0){var Ce=new Yn(_,p,!0);Re.push(Ce.draw(B.scatter.series,"scatter",B.scatter.i))}if(B.bubble.series.length>0){var Be=new Yn(_,p,!0);Re.push(Be.draw(B.bubble.series,"bubble",B.bubble.i))}}else switch(k.chart.type){case"line":Re=de.draw(T.series,"line");break;case"area":Re=de.draw(T.series,"area");break;case"bar":k.chart.stacked?Re=new gn(_,p).draw(T.series):(_.bar=new on(_,p),Re=_.bar.draw(T.series));break;case"candlestick":Re=new Nn(_,p).draw(T.series,"candlestick");break;case"boxPlot":Re=new Nn(_,p).draw(T.series,k.chart.type);break;case"rangeBar":Re=_.rangeBar.draw(T.series);break;case"rangeArea":Re=de.draw(T.seriesRangeStart,"rangeArea",void 0,T.seriesRangeEnd);break;case"heatmap":Re=new yn(_,p).draw(T.series);break;case"treemap":Re=new tn(_,p).draw(T.series);break;case"pie":case"donut":case"polarArea":Re=_.pie.draw(T.series);break;case"radialBar":Re=Se.draw(T.series);break;case"radar":Re=ke.draw(T.series);break;default:Re=de.draw(T.series)}return Re}},{key:"setSVGDimensions",value:function(){var h=this.w,p=h.globals,S=h.config;S.chart.width=S.chart.width||"100%",S.chart.height=S.chart.height||"auto",p.svgWidth=S.chart.width,p.svgHeight=S.chart.height;var _=F.getDimensions(this.el),k=S.chart.width.toString().split(/[0-9]+/g).pop();k==="%"?F.isNumber(_[0])&&(_[0].width===0&&(_=F.getDimensions(this.el.parentNode)),p.svgWidth=_[0]*parseInt(S.chart.width,10)/100):k!=="px"&&k!==""||(p.svgWidth=parseInt(S.chart.width,10));var T=String(S.chart.height).toString().split(/[0-9]+/g).pop();if(p.svgHeight!=="auto"&&p.svgHeight!=="")if(T==="%"){var B=F.getDimensions(this.el.parentNode);p.svgHeight=B[1]*parseInt(S.chart.height,10)/100}else p.svgHeight=parseInt(S.chart.height,10);else p.svgHeight=p.axisCharts?p.svgWidth/1.61:p.svgWidth/1.2;if(p.svgWidth=Math.max(p.svgWidth,0),p.svgHeight=Math.max(p.svgHeight,0),z.setAttrs(p.dom.Paper.node,{width:p.svgWidth,height:p.svgHeight}),T!=="%"){var q=S.chart.sparkline.enabled?0:p.axisCharts?S.chart.parentHeightOffset:0;p.dom.Paper.node.parentNode.parentNode.style.minHeight="".concat(p.svgHeight+q,"px")}p.dom.elWrap.style.width="".concat(p.svgWidth,"px"),p.dom.elWrap.style.height="".concat(p.svgHeight,"px")}},{key:"shiftGraphPosition",value:function(){var h=this.w.globals,p=h.translateY,S=h.translateX;z.setAttrs(h.dom.elGraphical.node,{transform:"translate(".concat(S,", ").concat(p,")")})}},{key:"resizeNonAxisCharts",value:function(){var h=this.w,p=h.globals,S=0,_=h.config.chart.sparkline.enabled?1:15;_+=h.config.grid.padding.bottom,["top","bottom"].includes(h.config.legend.position)&&h.config.legend.show&&!h.config.legend.floating&&(S=new Zt(this.ctx).legendHelpers.getLegendDimensions().clwh+7);var k=h.globals.dom.baseEl.querySelector(".apexcharts-radialbar, .apexcharts-pie"),T=2.05*h.globals.radialSize;if(k&&!h.config.chart.sparkline.enabled&&h.config.plotOptions.radialBar.startAngle!==0){var B=F.getBoundingClientRect(k);T=B.bottom;var q=B.bottom-B.top;T=Math.max(2.05*h.globals.radialSize,q)}var te=Math.ceil(T+p.translateY+S+_);p.dom.elLegendForeign&&p.dom.elLegendForeign.setAttribute("height",te),h.config.chart.height&&String(h.config.chart.height).includes("%")||(p.dom.elWrap.style.height="".concat(te,"px"),z.setAttrs(p.dom.Paper.node,{height:te}),p.dom.Paper.node.parentNode.parentNode.style.minHeight="".concat(te,"px"))}},{key:"coreCalculations",value:function(){new ft(this.ctx).init()}},{key:"resetGlobals",value:function(){var h=this,p=function(){return h.w.config.series.map(function(){return[]})},S=new he,_=this.w.globals;S.initGlobalVars(_),_.seriesXvalues=p(),_.seriesYvalues=p()}},{key:"isMultipleY",value:function(){return!!(Array.isArray(this.w.config.yaxis)&&this.w.config.yaxis.length>1)&&(this.w.globals.isMultipleYAxis=!0,!0)}},{key:"xySettings",value:function(){var h=this.w,p=null;if(h.globals.axisCharts){if(h.config.xaxis.crosshairs.position==="back"&&new jt(this.ctx).drawXCrosshairs(),h.config.yaxis[0].crosshairs.position==="back"&&new jt(this.ctx).drawYCrosshairs(),h.config.xaxis.type==="datetime"&&h.config.xaxis.labels.formatter===void 0){this.ctx.timeScale=new or(this.ctx);var S=[];isFinite(h.globals.minX)&&isFinite(h.globals.maxX)&&!h.globals.isBarHorizontal?S=this.ctx.timeScale.calculateTimeScaleTicks(h.globals.minX,h.globals.maxX):h.globals.isBarHorizontal&&(S=this.ctx.timeScale.calculateTimeScaleTicks(h.globals.minY,h.globals.maxY)),this.ctx.timeScale.recalcDimensionsBasedOnFormat(S)}p=new Q(this.ctx).getCalculatedRatios()}return p}},{key:"updateSourceChart",value:function(h){this.ctx.w.globals.selection=void 0,this.ctx.updateHelpers._updateOptions({chart:{selection:{xaxis:{min:h.w.globals.minX,max:h.w.globals.maxX}}}},!1,!1)}},{key:"setupBrushHandler",value:function(){var h=this,p=this.w;if(p.config.chart.brush.enabled&&typeof p.config.chart.events.selection!="function"){var S=Array.isArray(p.config.chart.brush.targets)?p.config.chart.brush.targets:[p.config.chart.brush.target];S.forEach(function(_){var k=ApexCharts.getChartByID(_);k.w.globals.brushSource=h.ctx,typeof k.w.config.chart.events.zoomed!="function"&&(k.w.config.chart.events.zoomed=function(){return h.updateSourceChart(k)}),typeof k.w.config.chart.events.scrolled!="function"&&(k.w.config.chart.events.scrolled=function(){return h.updateSourceChart(k)})}),p.config.chart.events.selection=function(_,k){S.forEach(function(T){ApexCharts.getChartByID(T).ctx.updateHelpers._updateOptions({xaxis:{min:k.xaxis.min,max:k.xaxis.max}},!1,!1,!1,!1)})}}}}]),Ee}(),Qt=function(){function Ee(h){s(this,Ee),this.ctx=h,this.w=h.w}return o(Ee,[{key:"_updateOptions",value:function(h){var p=this,S=arguments.length>1&&arguments[1]!==void 0&&arguments[1],_=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2],k=!(arguments.length>3&&arguments[3]!==void 0)||arguments[3],T=arguments.length>4&&arguments[4]!==void 0&&arguments[4];return new Promise(function(B){var q=[p.ctx];k&&(q=p.ctx.getSyncedCharts()),p.ctx.w.globals.isExecCalled&&(q=[p.ctx],p.ctx.w.globals.isExecCalled=!1),q.forEach(function(te,ue){var de=te.w;if(de.globals.shouldAnimate=_,S||(de.globals.resized=!0,de.globals.dataChanged=!0,_&&te.series.getPreviousPaths()),h&&I(h)==="object"&&(te.config=new Ne(h),h=Q.extendArrayProps(te.config,h,de),te.w.globals.chartID!==p.ctx.w.globals.chartID&&delete h.series,de.config=F.extend(de.config,h),T&&(de.globals.lastXAxis=h.xaxis?F.clone(h.xaxis):[],de.globals.lastYAxis=h.yaxis?F.clone(h.yaxis):[],de.globals.initialConfig=F.extend({},de.config),de.globals.initialSeries=F.clone(de.config.series),h.series))){for(var xe=0;xe<de.globals.collapsedSeriesIndices.length;xe++){var Se=de.config.series[de.globals.collapsedSeriesIndices[xe]];de.globals.collapsedSeries[xe].data=de.globals.axisCharts?Se.data.slice():Se}for(var ke=0;ke<de.globals.ancillaryCollapsedSeriesIndices.length;ke++){var Re=de.config.series[de.globals.ancillaryCollapsedSeriesIndices[ke]];de.globals.ancillaryCollapsedSeries[ke].data=de.globals.axisCharts?Re.data.slice():Re}te.series.emptyCollapsedSeries(de.config.series)}return te.update(h).then(function(){ue===q.length-1&&B(te)})})})}},{key:"_updateSeries",value:function(h,p){var S=this,_=arguments.length>2&&arguments[2]!==void 0&&arguments[2];return new Promise(function(k){var T,B=S.w;return B.globals.shouldAnimate=p,B.globals.dataChanged=!0,p&&S.ctx.series.getPreviousPaths(),B.globals.axisCharts?((T=h.map(function(q,te){return S._extendSeries(q,te)})).length===0&&(T=[{data:[]}]),B.config.series=T):B.config.series=h.slice(),_&&(B.globals.initialConfig.series=F.clone(B.config.series),B.globals.initialSeries=F.clone(B.config.series)),S.ctx.update().then(function(){k(S.ctx)})})}},{key:"_extendSeries",value:function(h,p){var S=this.w,_=S.config.series[p];return v(v({},S.config.series[p]),{},{name:h.name?h.name:_==null?void 0:_.name,color:h.color?h.color:_==null?void 0:_.color,type:h.type?h.type:_==null?void 0:_.type,group:h.group?h.group:_==null?void 0:_.group,hidden:h.hidden!==void 0?h.hidden:_==null?void 0:_.hidden,data:h.data?h.data:_==null?void 0:_.data,zIndex:h.zIndex!==void 0?h.zIndex:p})}},{key:"toggleDataPointSelection",value:function(h,p){var S=this.w,_=null,k=".apexcharts-series[data\\:realIndex='".concat(h,"']");return S.globals.axisCharts?_=S.globals.dom.Paper.select("".concat(k," path[j='").concat(p,"'], ").concat(k," circle[j='").concat(p,"'], ").concat(k," rect[j='").concat(p,"']")).members[0]:p===void 0&&(_=S.globals.dom.Paper.select("".concat(k," path[j='").concat(h,"']")).members[0],S.config.chart.type!=="pie"&&S.config.chart.type!=="polarArea"&&S.config.chart.type!=="donut"||this.ctx.pie.pieClicked(h)),_?(new z(this.ctx).pathMouseDown(_,null),_.node?_.node:null):(console.warn("toggleDataPointSelection: Element not found"),null)}},{key:"forceXAxisUpdate",value:function(h){var p=this.w;if(["min","max"].forEach(function(_){h.xaxis[_]!==void 0&&(p.config.xaxis[_]=h.xaxis[_],p.globals.lastXAxis[_]=h.xaxis[_])}),h.xaxis.categories&&h.xaxis.categories.length&&(p.config.xaxis.categories=h.xaxis.categories),p.config.xaxis.convertedCatToNumeric){var S=new fe(h);h=S.convertCatToNumericXaxis(h,this.ctx)}return h}},{key:"forceYAxisUpdate",value:function(h){return h.chart&&h.chart.stacked&&h.chart.stackType==="100%"&&(Array.isArray(h.yaxis)?h.yaxis.forEach(function(p,S){h.yaxis[S].min=0,h.yaxis[S].max=100}):(h.yaxis.min=0,h.yaxis.max=100)),h}},{key:"revertDefaultAxisMinMax",value:function(h){var p=this,S=this.w,_=S.globals.lastXAxis,k=S.globals.lastYAxis;h&&h.xaxis&&(_=h.xaxis),h&&h.yaxis&&(k=h.yaxis),S.config.xaxis.min=_.min,S.config.xaxis.max=_.max;var T=function(B){k[B]!==void 0&&(S.config.yaxis[B].min=k[B].min,S.config.yaxis[B].max=k[B].max)};S.config.yaxis.map(function(B,q){S.globals.zoomed||k[q]!==void 0?T(q):p.ctx.opts.yaxis[q]!==void 0&&(B.min=p.ctx.opts.yaxis[q].min,B.max=p.ctx.opts.yaxis[q].max)})}}]),Ee}();xn=typeof window<"u"?window:void 0,Mt=function(Ee,h){var p=(this!==void 0?this:Ee).SVG=function(se){if(p.supported)return se=new p.Doc(se),p.parser.draw||p.prepare(),se};if(p.ns="http://www.w3.org/2000/svg",p.xmlns="http://www.w3.org/2000/xmlns/",p.xlink="http://www.w3.org/1999/xlink",p.svgjs="http://svgjs.dev",p.supported=!0,!p.supported)return!1;p.did=1e3,p.eid=function(se){return"Svgjs"+ue(se)+p.did++},p.create=function(se){var Ce=h.createElementNS(this.ns,se);return Ce.setAttribute("id",this.eid(se)),Ce},p.extend=function(){var se,Ce;Ce=(se=[].slice.call(arguments)).pop();for(var Be=se.length-1;Be>=0;Be--)if(se[Be])for(var De in Ce)se[Be].prototype[De]=Ce[De];p.Set&&p.Set.inherit&&p.Set.inherit()},p.invent=function(se){var Ce=typeof se.create=="function"?se.create:function(){this.constructor.call(this,p.create(se.create))};return se.inherit&&(Ce.prototype=new se.inherit),se.extend&&p.extend(Ce,se.extend),se.construct&&p.extend(se.parent||p.Container,se.construct),Ce},p.adopt=function(se){return se?se.instance?se.instance:((Ce=se.nodeName=="svg"?se.parentNode instanceof Ee.SVGElement?new p.Nested:new p.Doc:se.nodeName=="linearGradient"?new p.Gradient("linear"):se.nodeName=="radialGradient"?new p.Gradient("radial"):p[ue(se.nodeName)]?new p[ue(se.nodeName)]:new p.Element(se)).type=se.nodeName,Ce.node=se,se.instance=Ce,Ce instanceof p.Doc&&Ce.namespace().defs(),Ce.setData(JSON.parse(se.getAttribute("svgjs:data"))||{}),Ce):null;var Ce},p.prepare=function(){var se=h.getElementsByTagName("body")[0],Ce=(se?new p.Doc(se):p.adopt(h.documentElement).nested()).size(2,0);p.parser={body:se||h.documentElement,draw:Ce.style("opacity:0;position:absolute;left:-100%;top:-100%;overflow:hidden").node,poly:Ce.polyline().node,path:Ce.path().node,native:p.create("svg")}},p.parser={native:p.create("svg")},h.addEventListener("DOMContentLoaded",function(){p.parser.draw||p.prepare()},!1),p.regex={numberAndUnit:/^([+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?)([a-z%]*)$/i,hex:/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,rgb:/rgb\((\d+),(\d+),(\d+)\)/,reference:/#([a-z0-9\-_]+)/i,transforms:/\)\s*,?\s*/,whitespace:/\s/g,isHex:/^#[a-f0-9]{3,6}$/i,isRgb:/^rgb\(/,isCss:/[^:]+:[^;]+;?/,isBlank:/^(\s+)?$/,isNumber:/^[+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,isPercent:/^-?[\d\.]+%$/,isImage:/\.(jpg|jpeg|png|gif|svg)(\?[^=]+.*)?/i,delimiter:/[\s,]+/,hyphen:/([^e])\-/gi,pathLetters:/[MLHVCSQTAZ]/gi,isPathLetter:/[MLHVCSQTAZ]/i,numbersWithDots:/((\d?\.\d+(?:e[+-]?\d+)?)((?:\.\d+(?:e[+-]?\d+)?)+))+/gi,dots:/\./g},p.utils={map:function(se,Ce){for(var Be=se.length,De=[],_e=0;_e<Be;_e++)De.push(Ce(se[_e]));return De},filter:function(se,Ce){for(var Be=se.length,De=[],_e=0;_e<Be;_e++)Ce(se[_e])&&De.push(se[_e]);return De},filterSVGElements:function(se){return this.filter(se,function(Ce){return Ce instanceof Ee.SVGElement})}},p.defaults={attrs:{"fill-opacity":1,"stroke-opacity":1,"stroke-width":0,"stroke-linejoin":"miter","stroke-linecap":"butt",fill:"#000000",stroke:"#000000",opacity:1,x:0,y:0,cx:0,cy:0,width:0,height:0,r:0,rx:0,ry:0,offset:0,"stop-opacity":1,"stop-color":"#000000","font-size":16,"font-family":"Helvetica, Arial, sans-serif","text-anchor":"start"}},p.Color=function(se){var Ce,Be;this.r=0,this.g=0,this.b=0,se&&(typeof se=="string"?p.regex.isRgb.test(se)?(Ce=p.regex.rgb.exec(se.replace(p.regex.whitespace,"")),this.r=parseInt(Ce[1]),this.g=parseInt(Ce[2]),this.b=parseInt(Ce[3])):p.regex.isHex.test(se)&&(Ce=p.regex.hex.exec((Be=se).length==4?["#",Be.substring(1,2),Be.substring(1,2),Be.substring(2,3),Be.substring(2,3),Be.substring(3,4),Be.substring(3,4)].join(""):Be),this.r=parseInt(Ce[1],16),this.g=parseInt(Ce[2],16),this.b=parseInt(Ce[3],16)):I(se)==="object"&&(this.r=se.r,this.g=se.g,this.b=se.b))},p.extend(p.Color,{toString:function(){return this.toHex()},toHex:function(){return"#"+de(this.r)+de(this.g)+de(this.b)},toRgb:function(){return"rgb("+[this.r,this.g,this.b].join()+")"},brightness:function(){return this.r/255*.3+this.g/255*.59+this.b/255*.11},morph:function(se){return this.destination=new p.Color(se),this},at:function(se){return this.destination?(se=se<0?0:se>1?1:se,new p.Color({r:~~(this.r+(this.destination.r-this.r)*se),g:~~(this.g+(this.destination.g-this.g)*se),b:~~(this.b+(this.destination.b-this.b)*se)})):this}}),p.Color.test=function(se){return se+="",p.regex.isHex.test(se)||p.regex.isRgb.test(se)},p.Color.isRgb=function(se){return se&&typeof se.r=="number"&&typeof se.g=="number"&&typeof se.b=="number"},p.Color.isColor=function(se){return p.Color.isRgb(se)||p.Color.test(se)},p.Array=function(se,Ce){(se=(se||[]).valueOf()).length==0&&Ce&&(se=Ce.valueOf()),this.value=this.parse(se)},p.extend(p.Array,{toString:function(){return this.value.join(" ")},valueOf:function(){return this.value},parse:function(se){return se=se.valueOf(),Array.isArray(se)?se:this.split(se)}}),p.PointArray=function(se,Ce){p.Array.call(this,se,Ce||[[0,0]])},p.PointArray.prototype=new p.Array,p.PointArray.prototype.constructor=p.PointArray;for(var S={M:function(se,Ce,Be){return Ce.x=Be.x=se[0],Ce.y=Be.y=se[1],["M",Ce.x,Ce.y]},L:function(se,Ce){return Ce.x=se[0],Ce.y=se[1],["L",se[0],se[1]]},H:function(se,Ce){return Ce.x=se[0],["H",se[0]]},V:function(se,Ce){return Ce.y=se[0],["V",se[0]]},C:function(se,Ce){return Ce.x=se[4],Ce.y=se[5],["C",se[0],se[1],se[2],se[3],se[4],se[5]]},Q:function(se,Ce){return Ce.x=se[2],Ce.y=se[3],["Q",se[0],se[1],se[2],se[3]]},S:function(se,Ce){return Ce.x=se[2],Ce.y=se[3],["S",se[0],se[1],se[2],se[3]]},Z:function(se,Ce,Be){return Ce.x=Be.x,Ce.y=Be.y,["Z"]}},_="mlhvqtcsaz".split(""),k=0,T=_.length;k<T;++k)S[_[k]]=function(se){return function(Ce,Be,De){if(se=="H")Ce[0]=Ce[0]+Be.x;else if(se=="V")Ce[0]=Ce[0]+Be.y;else if(se=="A")Ce[5]=Ce[5]+Be.x,Ce[6]=Ce[6]+Be.y;else for(var _e=0,Je=Ce.length;_e<Je;++_e)Ce[_e]=Ce[_e]+(_e%2?Be.y:Be.x);if(S&&typeof S[se]=="function")return S[se](Ce,Be,De)}}(_[k].toUpperCase());p.PathArray=function(se,Ce){p.Array.call(this,se,Ce||[["M",0,0]])},p.PathArray.prototype=new p.Array,p.PathArray.prototype.constructor=p.PathArray,p.extend(p.PathArray,{toString:function(){return function(se){for(var Ce=0,Be=se.length,De="";Ce<Be;Ce++)De+=se[Ce][0],se[Ce][1]!=null&&(De+=se[Ce][1],se[Ce][2]!=null&&(De+=" ",De+=se[Ce][2],se[Ce][3]!=null&&(De+=" ",De+=se[Ce][3],De+=" ",De+=se[Ce][4],se[Ce][5]!=null&&(De+=" ",De+=se[Ce][5],De+=" ",De+=se[Ce][6],se[Ce][7]!=null&&(De+=" ",De+=se[Ce][7])))));return De+" "}(this.value)},move:function(se,Ce){var Be=this.bbox();return Be.x,Be.y,this},at:function(se){if(!this.destination)return this;for(var Ce=this.value,Be=this.destination.value,De=[],_e=new p.PathArray,Je=0,ct=Ce.length;Je<ct;Je++){De[Je]=[Ce[Je][0]];for(var gt=1,Xt=Ce[Je].length;gt<Xt;gt++)De[Je][gt]=Ce[Je][gt]+(Be[Je][gt]-Ce[Je][gt])*se;De[Je][0]==="A"&&(De[Je][4]=+(De[Je][4]!=0),De[Je][5]=+(De[Je][5]!=0))}return _e.value=De,_e},parse:function(se){if(se instanceof p.PathArray)return se.valueOf();var Ce,Be={M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2,A:7,Z:0};se=typeof se=="string"?se.replace(p.regex.numbersWithDots,q).replace(p.regex.pathLetters," $& ").replace(p.regex.hyphen,"$1 -").trim().split(p.regex.delimiter):se.reduce(function(Xt,wt){return[].concat.call(Xt,wt)},[]);var De=[],_e=new p.Point,Je=new p.Point,ct=0,gt=se.length;do p.regex.isPathLetter.test(se[ct])?(Ce=se[ct],++ct):Ce=="M"?Ce="L":Ce=="m"&&(Ce="l"),De.push(S[Ce].call(null,se.slice(ct,ct+=Be[Ce.toUpperCase()]).map(parseFloat),_e,Je));while(gt>ct);return De},bbox:function(){return p.parser.draw||p.prepare(),p.parser.path.setAttribute("d",this.toString()),p.parser.path.getBBox()}}),p.Number=p.invent({create:function(se,Ce){this.value=0,this.unit=Ce||"",typeof se=="number"?this.value=isNaN(se)?0:isFinite(se)?se:se<0?-34e37:34e37:typeof se=="string"?(Ce=se.match(p.regex.numberAndUnit))&&(this.value=parseFloat(Ce[1]),Ce[5]=="%"?this.value/=100:Ce[5]=="s"&&(this.value*=1e3),this.unit=Ce[5]):se instanceof p.Number&&(this.value=se.valueOf(),this.unit=se.unit)},extend:{toString:function(){return(this.unit=="%"?~~(1e8*this.value)/1e6:this.unit=="s"?this.value/1e3:this.value)+this.unit},toJSON:function(){return this.toString()},valueOf:function(){return this.value},plus:function(se){return se=new p.Number(se),new p.Number(this+se,this.unit||se.unit)},minus:function(se){return se=new p.Number(se),new p.Number(this-se,this.unit||se.unit)},times:function(se){return se=new p.Number(se),new p.Number(this*se,this.unit||se.unit)},divide:function(se){return se=new p.Number(se),new p.Number(this/se,this.unit||se.unit)},to:function(se){var Ce=new p.Number(this);return typeof se=="string"&&(Ce.unit=se),Ce},morph:function(se){return this.destination=new p.Number(se),se.relative&&(this.destination.value+=this.value),this},at:function(se){return this.destination?new p.Number(this.destination).minus(this).times(se).plus(this):this}}}),p.Element=p.invent({create:function(se){this._stroke=p.defaults.attrs.stroke,this._event=null,this.dom={},(this.node=se)&&(this.type=se.nodeName,this.node.instance=this,this._stroke=se.getAttribute("stroke")||this._stroke)},extend:{x:function(se){return this.attr("x",se)},y:function(se){return this.attr("y",se)},cx:function(se){return se==null?this.x()+this.width()/2:this.x(se-this.width()/2)},cy:function(se){return se==null?this.y()+this.height()/2:this.y(se-this.height()/2)},move:function(se,Ce){return this.x(se).y(Ce)},center:function(se,Ce){return this.cx(se).cy(Ce)},width:function(se){return this.attr("width",se)},height:function(se){return this.attr("height",se)},size:function(se,Ce){var Be=xe(this,se,Ce);return this.width(new p.Number(Be.width)).height(new p.Number(Be.height))},clone:function(se){this.writeDataToDom();var Ce=Re(this.node.cloneNode(!0));return se?se.add(Ce):this.after(Ce),Ce},remove:function(){return this.parent()&&this.parent().removeElement(this),this},replace:function(se){return this.after(se).remove(),se},addTo:function(se){return se.put(this)},putIn:function(se){return se.add(this)},id:function(se){return this.attr("id",se)},show:function(){return this.style("display","")},hide:function(){return this.style("display","none")},visible:function(){return this.style("display")!="none"},toString:function(){return this.attr("id")},classes:function(){var se=this.attr("class");return se==null?[]:se.trim().split(p.regex.delimiter)},hasClass:function(se){return this.classes().indexOf(se)!=-1},addClass:function(se){if(!this.hasClass(se)){var Ce=this.classes();Ce.push(se),this.attr("class",Ce.join(" "))}return this},removeClass:function(se){return this.hasClass(se)&&this.attr("class",this.classes().filter(function(Ce){return Ce!=se}).join(" ")),this},toggleClass:function(se){return this.hasClass(se)?this.removeClass(se):this.addClass(se)},reference:function(se){return p.get(this.attr(se))},parent:function(se){var Ce=this;if(!Ce.node.parentNode)return null;if(Ce=p.adopt(Ce.node.parentNode),!se)return Ce;for(;Ce&&Ce.node instanceof Ee.SVGElement;){if(typeof se=="string"?Ce.matches(se):Ce instanceof se)return Ce;if(!Ce.node.parentNode||Ce.node.parentNode.nodeName=="#document")return null;Ce=p.adopt(Ce.node.parentNode)}},doc:function(){return this instanceof p.Doc?this:this.parent(p.Doc)},parents:function(se){var Ce=[],Be=this;do{if(!(Be=Be.parent(se))||!Be.node)break;Ce.push(Be)}while(Be.parent);return Ce},matches:function(se){return function(Ce,Be){return(Ce.matches||Ce.matchesSelector||Ce.msMatchesSelector||Ce.mozMatchesSelector||Ce.webkitMatchesSelector||Ce.oMatchesSelector).call(Ce,Be)}(this.node,se)},native:function(){return this.node},svg:function(se){var Ce=h.createElementNS("http://www.w3.org/2000/svg","svg");if(!(se&&this instanceof p.Parent))return Ce.appendChild(se=h.createElementNS("http://www.w3.org/2000/svg","svg")),this.writeDataToDom(),se.appendChild(this.node.cloneNode(!0)),Ce.innerHTML.replace(/^<svg>/,"").replace(/<\/svg>$/,"");Ce.innerHTML="<svg>"+se.replace(/\n/,"").replace(/<([\w:-]+)([^<]+?)\/>/g,"<$1$2></$1>")+"</svg>";for(var Be=0,De=Ce.firstChild.childNodes.length;Be<De;Be++)this.node.appendChild(Ce.firstChild.firstChild);return this},writeDataToDom:function(){return(this.each||this.lines)&&(this.each?this:this.lines()).each(function(){this.writeDataToDom()}),this.node.removeAttribute("svgjs:data"),Object.keys(this.dom).length&&this.node.setAttribute("svgjs:data",JSON.stringify(this.dom)),this},setData:function(se){return this.dom=se,this},is:function(se){return function(Ce,Be){return Ce instanceof Be}(this,se)}}}),p.easing={"-":function(se){return se},"<>":function(se){return-Math.cos(se*Math.PI)/2+.5},">":function(se){return Math.sin(se*Math.PI/2)},"<":function(se){return 1-Math.cos(se*Math.PI/2)}},p.morph=function(se){return function(Ce,Be){return new p.MorphObj(Ce,Be).at(se)}},p.Situation=p.invent({create:function(se){this.init=!1,this.reversed=!1,this.reversing=!1,this.duration=new p.Number(se.duration).valueOf(),this.delay=new p.Number(se.delay).valueOf(),this.start=+new Date+this.delay,this.finish=this.start+this.duration,this.ease=se.ease,this.loop=0,this.loops=!1,this.animations={},this.attrs={},this.styles={},this.transforms=[],this.once={}}}),p.FX=p.invent({create:function(se){this._target=se,this.situations=[],this.active=!1,this.situation=null,this.paused=!1,this.lastPos=0,this.pos=0,this.absPos=0,this._speed=1},extend:{animate:function(se,Ce,Be){I(se)==="object"&&(Ce=se.ease,Be=se.delay,se=se.duration);var De=new p.Situation({duration:se||1e3,delay:Be||0,ease:p.easing[Ce||"-"]||Ce});return this.queue(De),this},target:function(se){return se&&se instanceof p.Element?(this._target=se,this):this._target},timeToAbsPos:function(se){return(se-this.situation.start)/(this.situation.duration/this._speed)},absPosToTime:function(se){return this.situation.duration/this._speed*se+this.situation.start},startAnimFrame:function(){this.stopAnimFrame(),this.animationFrame=Ee.requestAnimationFrame((function(){this.step()}).bind(this))},stopAnimFrame:function(){Ee.cancelAnimationFrame(this.animationFrame)},start:function(){return!this.active&&this.situation&&(this.active=!0,this.startCurrent()),this},startCurrent:function(){return this.situation.start=+new Date+this.situation.delay/this._speed,this.situation.finish=this.situation.start+this.situation.duration/this._speed,this.initAnimations().step()},queue:function(se){return(typeof se=="function"||se instanceof p.Situation)&&this.situations.push(se),this.situation||(this.situation=this.situations.shift()),this},dequeue:function(){return this.stop(),this.situation=this.situations.shift(),this.situation&&(this.situation instanceof p.Situation?this.start():this.situation.call(this)),this},initAnimations:function(){var se,Ce=this.situation;if(Ce.init)return this;for(var Be in Ce.animations){se=this.target()[Be](),Array.isArray(se)||(se=[se]),Array.isArray(Ce.animations[Be])||(Ce.animations[Be]=[Ce.animations[Be]]);for(var De=se.length;De--;)Ce.animations[Be][De]instanceof p.Number&&(se[De]=new p.Number(se[De])),Ce.animations[Be][De]=se[De].morph(Ce.animations[Be][De])}for(var Be in Ce.attrs)Ce.attrs[Be]=new p.MorphObj(this.target().attr(Be),Ce.attrs[Be]);for(var Be in Ce.styles)Ce.styles[Be]=new p.MorphObj(this.target().style(Be),Ce.styles[Be]);return Ce.initialTransformation=this.target().matrixify(),Ce.init=!0,this},clearQueue:function(){return this.situations=[],this},clearCurrent:function(){return this.situation=null,this},stop:function(se,Ce){var Be=this.active;return this.active=!1,Ce&&this.clearQueue(),se&&this.situation&&(!Be&&this.startCurrent(),this.atEnd()),this.stopAnimFrame(),this.clearCurrent()},after:function(se){var Ce=this.last();return this.target().on("finished.fx",function Be(De){De.detail.situation==Ce&&(se.call(this,Ce),this.off("finished.fx",Be))}),this._callStart()},during:function(se){var Ce=this.last(),Be=function(De){De.detail.situation==Ce&&se.call(this,De.detail.pos,p.morph(De.detail.pos),De.detail.eased,Ce)};return this.target().off("during.fx",Be).on("during.fx",Be),this.after(function(){this.off("during.fx",Be)}),this._callStart()},afterAll:function(se){var Ce=function Be(De){se.call(this),this.off("allfinished.fx",Be)};return this.target().off("allfinished.fx",Ce).on("allfinished.fx",Ce),this._callStart()},last:function(){return this.situations.length?this.situations[this.situations.length-1]:this.situation},add:function(se,Ce,Be){return this.last()[Be||"animations"][se]=Ce,this._callStart()},step:function(se){var Ce,Be,De;se||(this.absPos=this.timeToAbsPos(+new Date)),this.situation.loops!==!1?(Ce=Math.max(this.absPos,0),Be=Math.floor(Ce),this.situation.loops===!0||Be<this.situation.loops?(this.pos=Ce-Be,De=this.situation.loop,this.situation.loop=Be):(this.absPos=this.situation.loops,this.pos=1,De=this.situation.loop-1,this.situation.loop=this.situation.loops),this.situation.reversing&&(this.situation.reversed=this.situation.reversed!=!!((this.situation.loop-De)%2))):(this.absPos=Math.min(this.absPos,1),this.pos=this.absPos),this.pos<0&&(this.pos=0),this.situation.reversed&&(this.pos=1-this.pos);var _e=this.situation.ease(this.pos);for(var Je in this.situation.once)Je>this.lastPos&&Je<=_e&&(this.situation.once[Je].call(this.target(),this.pos,_e),delete this.situation.once[Je]);return this.active&&this.target().fire("during",{pos:this.pos,eased:_e,fx:this,situation:this.situation}),this.situation?(this.eachAt(),this.pos==1&&!this.situation.reversed||this.situation.reversed&&this.pos==0?(this.stopAnimFrame(),this.target().fire("finished",{fx:this,situation:this.situation}),this.situations.length||(this.target().fire("allfinished"),this.situations.length||(this.target().off(".fx"),this.active=!1)),this.active?this.dequeue():this.clearCurrent()):!this.paused&&this.active&&this.startAnimFrame(),this.lastPos=_e,this):this},eachAt:function(){var se,Ce=this,Be=this.target(),De=this.situation;for(var _e in De.animations)se=[].concat(De.animations[_e]).map(function(gt){return typeof gt!="string"&>.at?gt.at(De.ease(Ce.pos),Ce.pos):gt}),Be[_e].apply(Be,se);for(var _e in De.attrs)se=[_e].concat(De.attrs[_e]).map(function(Xt){return typeof Xt!="string"&&Xt.at?Xt.at(De.ease(Ce.pos),Ce.pos):Xt}),Be.attr.apply(Be,se);for(var _e in De.styles)se=[_e].concat(De.styles[_e]).map(function(Xt){return typeof Xt!="string"&&Xt.at?Xt.at(De.ease(Ce.pos),Ce.pos):Xt}),Be.style.apply(Be,se);if(De.transforms.length){se=De.initialTransformation,_e=0;for(var Je=De.transforms.length;_e<Je;_e++){var ct=De.transforms[_e];ct instanceof p.Matrix?se=ct.relative?se.multiply(new p.Matrix().morph(ct).at(De.ease(this.pos))):se.morph(ct).at(De.ease(this.pos)):(ct.relative||ct.undo(se.extract()),se=se.multiply(ct.at(De.ease(this.pos))))}Be.matrix(se)}return this},once:function(se,Ce,Be){var De=this.last();return Be||(se=De.ease(se)),De.once[se]=Ce,this},_callStart:function(){return setTimeout((function(){this.start()}).bind(this),0),this}},parent:p.Element,construct:{animate:function(se,Ce,Be){return(this.fx||(this.fx=new p.FX(this))).animate(se,Ce,Be)},delay:function(se){return(this.fx||(this.fx=new p.FX(this))).delay(se)},stop:function(se,Ce){return this.fx&&this.fx.stop(se,Ce),this},finish:function(){return this.fx&&this.fx.finish(),this}}}),p.MorphObj=p.invent({create:function(se,Ce){return p.Color.isColor(Ce)?new p.Color(se).morph(Ce):p.regex.delimiter.test(se)?p.regex.pathLetters.test(se)?new p.PathArray(se).morph(Ce):new p.Array(se).morph(Ce):p.regex.numberAndUnit.test(Ce)?new p.Number(se).morph(Ce):(this.value=se,void(this.destination=Ce))},extend:{at:function(se,Ce){return Ce<1?this.value:this.destination},valueOf:function(){return this.value}}}),p.extend(p.FX,{attr:function(se,Ce,Be){if(I(se)==="object")for(var De in se)this.attr(De,se[De]);else this.add(se,Ce,"attrs");return this},plot:function(se,Ce,Be,De){return arguments.length==4?this.plot([se,Ce,Be,De]):this.add("plot",new(this.target()).morphArray(se))}}),p.Box=p.invent({create:function(se,Ce,Be,De){if(!(I(se)!=="object"||se instanceof p.Element))return p.Box.call(this,se.left!=null?se.left:se.x,se.top!=null?se.top:se.y,se.width,se.height);var _e;arguments.length==4&&(this.x=se,this.y=Ce,this.width=Be,this.height=De),(_e=this).x==null&&(_e.x=0,_e.y=0,_e.width=0,_e.height=0),_e.w=_e.width,_e.h=_e.height,_e.x2=_e.x+_e.width,_e.y2=_e.y+_e.height,_e.cx=_e.x+_e.width/2,_e.cy=_e.y+_e.height/2}}),p.BBox=p.invent({create:function(se){if(p.Box.apply(this,[].slice.call(arguments)),se instanceof p.Element){var Ce;try{if(!h.documentElement.contains){for(var Be=se.node;Be.parentNode;)Be=Be.parentNode;if(Be!=h)throw new Error("Element not in the dom")}Ce=se.node.getBBox()}catch{if(se instanceof p.Shape){p.parser.draw||p.prepare();var De=se.clone(p.parser.draw.instance).show();De&&De.node&&typeof De.node.getBBox=="function"&&(Ce=De.node.getBBox()),De&&typeof De.remove=="function"&&De.remove()}else Ce={x:se.node.clientLeft,y:se.node.clientTop,width:se.node.clientWidth,height:se.node.clientHeight}}p.Box.call(this,Ce)}},inherit:p.Box,parent:p.Element,construct:{bbox:function(){return new p.BBox(this)}}}),p.BBox.prototype.constructor=p.BBox,p.Matrix=p.invent({create:function(se){var Ce=ke([1,0,0,1,0,0]);se=se===null?Ce:se instanceof p.Element?se.matrixify():typeof se=="string"?ke(se.split(p.regex.delimiter).map(parseFloat)):arguments.length==6?ke([].slice.call(arguments)):Array.isArray(se)?ke(se):se&&I(se)==="object"?se:Ce;for(var Be=Fe.length-1;Be>=0;--Be)this[Fe[Be]]=se[Fe[Be]]!=null?se[Fe[Be]]:Ce[Fe[Be]]},extend:{extract:function(){var se=Se(this,0,1);Se(this,1,0);var Ce=180/Math.PI*Math.atan2(se.y,se.x)-90;return{x:this.e,y:this.f,transformedX:(this.e*Math.cos(Ce*Math.PI/180)+this.f*Math.sin(Ce*Math.PI/180))/Math.sqrt(this.a*this.a+this.b*this.b),transformedY:(this.f*Math.cos(Ce*Math.PI/180)+this.e*Math.sin(-Ce*Math.PI/180))/Math.sqrt(this.c*this.c+this.d*this.d),rotation:Ce,a:this.a,b:this.b,c:this.c,d:this.d,e:this.e,f:this.f,matrix:new p.Matrix(this)}},clone:function(){return new p.Matrix(this)},morph:function(se){return this.destination=new p.Matrix(se),this},multiply:function(se){return new p.Matrix(this.native().multiply(function(Ce){return Ce instanceof p.Matrix||(Ce=new p.Matrix(Ce)),Ce}(se).native()))},inverse:function(){return new p.Matrix(this.native().inverse())},translate:function(se,Ce){return new p.Matrix(this.native().translate(se||0,Ce||0))},native:function(){for(var se=p.parser.native.createSVGMatrix(),Ce=Fe.length-1;Ce>=0;Ce--)se[Fe[Ce]]=this[Fe[Ce]];return se},toString:function(){return"matrix("+Ge(this.a)+","+Ge(this.b)+","+Ge(this.c)+","+Ge(this.d)+","+Ge(this.e)+","+Ge(this.f)+")"}},parent:p.Element,construct:{ctm:function(){return new p.Matrix(this.node.getCTM())},screenCTM:function(){if(this instanceof p.Nested){var se=this.rect(1,1),Ce=se.node.getScreenCTM();return se.remove(),new p.Matrix(Ce)}return new p.Matrix(this.node.getScreenCTM())}}}),p.Point=p.invent({create:function(se,Ce){var Be;Be=Array.isArray(se)?{x:se[0],y:se[1]}:I(se)==="object"?{x:se.x,y:se.y}:se!=null?{x:se,y:Ce??se}:{x:0,y:0},this.x=Be.x,this.y=Be.y},extend:{clone:function(){return new p.Point(this)},morph:function(se,Ce){return this.destination=new p.Point(se,Ce),this}}}),p.extend(p.Element,{point:function(se,Ce){return new p.Point(se,Ce).transform(this.screenCTM().inverse())}}),p.extend(p.Element,{attr:function(se,Ce,Be){if(se==null){for(se={},Be=(Ce=this.node.attributes).length-1;Be>=0;Be--)se[Ce[Be].nodeName]=p.regex.isNumber.test(Ce[Be].nodeValue)?parseFloat(Ce[Be].nodeValue):Ce[Be].nodeValue;return se}if(I(se)==="object")for(var De in se)this.attr(De,se[De]);else if(Ce===null)this.node.removeAttribute(se);else{if(Ce==null)return(Ce=this.node.getAttribute(se))==null?p.defaults.attrs[se]:p.regex.isNumber.test(Ce)?parseFloat(Ce):Ce;se=="stroke-width"?this.attr("stroke",parseFloat(Ce)>0?this._stroke:null):se=="stroke"&&(this._stroke=Ce),se!="fill"&&se!="stroke"||(p.regex.isImage.test(Ce)&&(Ce=this.doc().defs().image(Ce,0,0)),Ce instanceof p.Image&&(Ce=this.doc().defs().pattern(0,0,function(){this.add(Ce)}))),typeof Ce=="number"?Ce=new p.Number(Ce):p.Color.isColor(Ce)?Ce=new p.Color(Ce):Array.isArray(Ce)&&(Ce=new p.Array(Ce)),se=="leading"?this.leading&&this.leading(Ce):typeof Be=="string"?this.node.setAttributeNS(Be,se,Ce.toString()):this.node.setAttribute(se,Ce.toString()),!this.rebuild||se!="font-size"&&se!="x"||this.rebuild(se,Ce)}return this}}),p.extend(p.Element,{transform:function(se,Ce){var Be;return I(se)!=="object"?(Be=new p.Matrix(this).extract(),typeof se=="string"?Be[se]:Be):(Be=new p.Matrix(this),Ce=!!Ce||!!se.relative,se.a!=null&&(Be=Ce?Be.multiply(new p.Matrix(se)):new p.Matrix(se)),this.attr("transform",Be))}}),p.extend(p.Element,{untransform:function(){return this.attr("transform",null)},matrixify:function(){return(this.attr("transform")||"").split(p.regex.transforms).slice(0,-1).map(function(se){var Ce=se.trim().split("(");return[Ce[0],Ce[1].split(p.regex.delimiter).map(function(Be){return parseFloat(Be)})]}).reduce(function(se,Ce){return Ce[0]=="matrix"?se.multiply(ke(Ce[1])):se[Ce[0]].apply(se,Ce[1])},new p.Matrix)},toParent:function(se){if(this==se)return this;var Ce=this.screenCTM(),Be=se.screenCTM().inverse();return this.addTo(se).untransform().transform(Be.multiply(Ce)),this},toDoc:function(){return this.toParent(this.doc())}}),p.Transformation=p.invent({create:function(se,Ce){if(arguments.length>1&&typeof Ce!="boolean")return this.constructor.call(this,[].slice.call(arguments));if(Array.isArray(se))for(var Be=0,De=this.arguments.length;Be<De;++Be)this[this.arguments[Be]]=se[Be];else if(se&&I(se)==="object")for(Be=0,De=this.arguments.length;Be<De;++Be)this[this.arguments[Be]]=se[this.arguments[Be]];this.inversed=!1,Ce===!0&&(this.inversed=!0)}}),p.Translate=p.invent({parent:p.Matrix,inherit:p.Transformation,create:function(se,Ce){this.constructor.apply(this,[].slice.call(arguments))},extend:{arguments:["transformedX","transformedY"],method:"translate"}}),p.extend(p.Element,{style:function(se,Ce){if(arguments.length==0)return this.node.style.cssText||"";if(arguments.length<2)if(I(se)==="object")for(var Be in se)this.style(Be,se[Be]);else{if(!p.regex.isCss.test(se))return this.node.style[te(se)];for(se=se.split(/\s*;\s*/).filter(function(De){return!!De}).map(function(De){return De.split(/\s*:\s*/)});Ce=se.pop();)this.style(Ce[0],Ce[1])}else this.node.style[te(se)]=Ce===null||p.regex.isBlank.test(Ce)?"":Ce;return this}}),p.Parent=p.invent({create:function(se){this.constructor.call(this,se)},inherit:p.Element,extend:{children:function(){return p.utils.map(p.utils.filterSVGElements(this.node.childNodes),function(se){return p.adopt(se)})},add:function(se,Ce){return Ce==null?this.node.appendChild(se.node):se.node!=this.node.childNodes[Ce]&&this.node.insertBefore(se.node,this.node.childNodes[Ce]),this},put:function(se,Ce){return this.add(se,Ce),se},has:function(se){return this.index(se)>=0},index:function(se){return[].slice.call(this.node.childNodes).indexOf(se.node)},get:function(se){return p.adopt(this.node.childNodes[se])},first:function(){return this.get(0)},last:function(){return this.get(this.node.childNodes.length-1)},each:function(se,Ce){for(var Be=this.children(),De=0,_e=Be.length;De<_e;De++)Be[De]instanceof p.Element&&se.apply(Be[De],[De,Be]),Ce&&Be[De]instanceof p.Container&&Be[De].each(se,Ce);return this},removeElement:function(se){return this.node.removeChild(se.node),this},clear:function(){for(;this.node.hasChildNodes();)this.node.removeChild(this.node.lastChild);return delete this._defs,this},defs:function(){return this.doc().defs()}}}),p.extend(p.Parent,{ungroup:function(se,Ce){return Ce===0||this instanceof p.Defs||this.node==p.parser.draw||(se=se||(this instanceof p.Doc?this:this.parent(p.Parent)),Ce=Ce||1/0,this.each(function(){return this instanceof p.Defs?this:this instanceof p.Parent?this.ungroup(se,Ce-1):this.toParent(se)}),this.node.firstChild||this.remove()),this},flatten:function(se,Ce){return this.ungroup(se,Ce)}}),p.Container=p.invent({create:function(se){this.constructor.call(this,se)},inherit:p.Parent}),p.ViewBox=p.invent({parent:p.Container,construct:{}}),["click","dblclick","mousedown","mouseup","mouseover","mouseout","mousemove","touchstart","touchmove","touchleave","touchend","touchcancel"].forEach(function(se){p.Element.prototype[se]=function(Ce){return p.on(this.node,se,Ce),this}}),p.listeners=[],p.handlerMap=[],p.listenerId=0,p.on=function(se,Ce,Be,De,_e){var Je=Be.bind(De||se.instance||se),ct=(p.handlerMap.indexOf(se)+1||p.handlerMap.push(se))-1,gt=Ce.split(".")[0],Xt=Ce.split(".")[1]||"*";p.listeners[ct]=p.listeners[ct]||{},p.listeners[ct][gt]=p.listeners[ct][gt]||{},p.listeners[ct][gt][Xt]=p.listeners[ct][gt][Xt]||{},Be._svgjsListenerId||(Be._svgjsListenerId=++p.listenerId),p.listeners[ct][gt][Xt][Be._svgjsListenerId]=Je,se.addEventListener(gt,Je,_e||{passive:!1})},p.off=function(se,Ce,Be){var De=p.handlerMap.indexOf(se),_e=Ce&&Ce.split(".")[0],Je=Ce&&Ce.split(".")[1],ct="";if(De!=-1)if(Be){if(typeof Be=="function"&&(Be=Be._svgjsListenerId),!Be)return;p.listeners[De][_e]&&p.listeners[De][_e][Je||"*"]&&(se.removeEventListener(_e,p.listeners[De][_e][Je||"*"][Be],!1),delete p.listeners[De][_e][Je||"*"][Be])}else if(Je&&_e){if(p.listeners[De][_e]&&p.listeners[De][_e][Je]){for(var gt in p.listeners[De][_e][Je])p.off(se,[_e,Je].join("."),gt);delete p.listeners[De][_e][Je]}}else if(Je)for(var Xt in p.listeners[De])for(var ct in p.listeners[De][Xt])Je===ct&&p.off(se,[Xt,Je].join("."));else if(_e){if(p.listeners[De][_e]){for(var ct in p.listeners[De][_e])p.off(se,[_e,ct].join("."));delete p.listeners[De][_e]}}else{for(var Xt in p.listeners[De])p.off(se,Xt);delete p.listeners[De],delete p.handlerMap[De]}},p.extend(p.Element,{on:function(se,Ce,Be,De){return p.on(this.node,se,Ce,Be,De),this},off:function(se,Ce){return p.off(this.node,se,Ce),this},fire:function(se,Ce){return se instanceof Ee.Event?this.node.dispatchEvent(se):this.node.dispatchEvent(se=new p.CustomEvent(se,{detail:Ce,cancelable:!0})),this._event=se,this},event:function(){return this._event}}),p.Defs=p.invent({create:"defs",inherit:p.Container}),p.G=p.invent({create:"g",inherit:p.Container,extend:{x:function(se){return se==null?this.transform("x"):this.transform({x:se-this.x()},!0)}},construct:{group:function(){return this.put(new p.G)}}}),p.Doc=p.invent({create:function(se){se&&((se=typeof se=="string"?h.getElementById(se):se).nodeName=="svg"?this.constructor.call(this,se):(this.constructor.call(this,p.create("svg")),se.appendChild(this.node),this.size("100%","100%")),this.namespace().defs())},inherit:p.Container,extend:{namespace:function(){return this.attr({xmlns:p.ns,version:"1.1"}).attr("xmlns:xlink",p.xlink,p.xmlns).attr("xmlns:svgjs",p.svgjs,p.xmlns)},defs:function(){var se;return this._defs||((se=this.node.getElementsByTagName("defs")[0])?this._defs=p.adopt(se):this._defs=new p.Defs,this.node.appendChild(this._defs.node)),this._defs},parent:function(){return this.node.parentNode&&this.node.parentNode.nodeName!="#document"?this.node.parentNode:null},remove:function(){return this.parent()&&this.parent().removeChild(this.node),this},clear:function(){for(;this.node.hasChildNodes();)this.node.removeChild(this.node.lastChild);return delete this._defs,p.parser.draw&&!p.parser.draw.parentNode&&this.node.appendChild(p.parser.draw),this},clone:function(se){this.writeDataToDom();var Ce=this.node,Be=Re(Ce.cloneNode(!0));return se?(se.node||se).appendChild(Be.node):Ce.parentNode.insertBefore(Be.node,Ce.nextSibling),Be}}}),p.extend(p.Element,{}),p.Gradient=p.invent({create:function(se){this.constructor.call(this,p.create(se+"Gradient")),this.type=se},inherit:p.Container,extend:{at:function(se,Ce,Be){return this.put(new p.Stop).update(se,Ce,Be)},update:function(se){return this.clear(),typeof se=="function"&&se.call(this,this),this},fill:function(){return"url(#"+this.id()+")"},toString:function(){return this.fill()},attr:function(se,Ce,Be){return se=="transform"&&(se="gradientTransform"),p.Container.prototype.attr.call(this,se,Ce,Be)}},construct:{gradient:function(se,Ce){return this.defs().gradient(se,Ce)}}}),p.extend(p.Gradient,p.FX,{from:function(se,Ce){return(this._target||this).type=="radial"?this.attr({fx:new p.Number(se),fy:new p.Number(Ce)}):this.attr({x1:new p.Number(se),y1:new p.Number(Ce)})},to:function(se,Ce){return(this._target||this).type=="radial"?this.attr({cx:new p.Number(se),cy:new p.Number(Ce)}):this.attr({x2:new p.Number(se),y2:new p.Number(Ce)})}}),p.extend(p.Defs,{gradient:function(se,Ce){return this.put(new p.Gradient(se)).update(Ce)}}),p.Stop=p.invent({create:"stop",inherit:p.Element,extend:{update:function(se){return(typeof se=="number"||se instanceof p.Number)&&(se={offset:arguments[0],color:arguments[1],opacity:arguments[2]}),se.opacity!=null&&this.attr("stop-opacity",se.opacity),se.color!=null&&this.attr("stop-color",se.color),se.offset!=null&&this.attr("offset",new p.Number(se.offset)),this}}}),p.Pattern=p.invent({create:"pattern",inherit:p.Container,extend:{fill:function(){return"url(#"+this.id()+")"},update:function(se){return this.clear(),typeof se=="function"&&se.call(this,this),this},toString:function(){return this.fill()},attr:function(se,Ce,Be){return se=="transform"&&(se="patternTransform"),p.Container.prototype.attr.call(this,se,Ce,Be)}},construct:{pattern:function(se,Ce,Be){return this.defs().pattern(se,Ce,Be)}}}),p.extend(p.Defs,{pattern:function(se,Ce,Be){return this.put(new p.Pattern).update(Be).attr({x:0,y:0,width:se,height:Ce,patternUnits:"userSpaceOnUse"})}}),p.Shape=p.invent({create:function(se){this.constructor.call(this,se)},inherit:p.Element}),p.Symbol=p.invent({create:"symbol",inherit:p.Container,construct:{symbol:function(){return this.put(new p.Symbol)}}}),p.Use=p.invent({create:"use",inherit:p.Shape,extend:{element:function(se,Ce){return this.attr("href",(Ce||"")+"#"+se,p.xlink)}},construct:{use:function(se,Ce){return this.put(new p.Use).element(se,Ce)}}}),p.Rect=p.invent({create:"rect",inherit:p.Shape,construct:{rect:function(se,Ce){return this.put(new p.Rect).size(se,Ce)}}}),p.Circle=p.invent({create:"circle",inherit:p.Shape,construct:{circle:function(se){return this.put(new p.Circle).rx(new p.Number(se).divide(2)).move(0,0)}}}),p.extend(p.Circle,p.FX,{rx:function(se){return this.attr("r",se)},ry:function(se){return this.rx(se)}}),p.Ellipse=p.invent({create:"ellipse",inherit:p.Shape,construct:{ellipse:function(se,Ce){return this.put(new p.Ellipse).size(se,Ce).move(0,0)}}}),p.extend(p.Ellipse,p.Rect,p.FX,{rx:function(se){return this.attr("rx",se)},ry:function(se){return this.attr("ry",se)}}),p.extend(p.Circle,p.Ellipse,{x:function(se){return se==null?this.cx()-this.rx():this.cx(se+this.rx())},y:function(se){return se==null?this.cy()-this.ry():this.cy(se+this.ry())},cx:function(se){return se==null?this.attr("cx"):this.attr("cx",se)},cy:function(se){return se==null?this.attr("cy"):this.attr("cy",se)},width:function(se){return se==null?2*this.rx():this.rx(new p.Number(se).divide(2))},height:function(se){return se==null?2*this.ry():this.ry(new p.Number(se).divide(2))},size:function(se,Ce){var Be=xe(this,se,Ce);return this.rx(new p.Number(Be.width).divide(2)).ry(new p.Number(Be.height).divide(2))}}),p.Line=p.invent({create:"line",inherit:p.Shape,extend:{array:function(){return new p.PointArray([[this.attr("x1"),this.attr("y1")],[this.attr("x2"),this.attr("y2")]])},plot:function(se,Ce,Be,De){return se==null?this.array():(se=Ce!==void 0?{x1:se,y1:Ce,x2:Be,y2:De}:new p.PointArray(se).toLine(),this.attr(se))},move:function(se,Ce){return this.attr(this.array().move(se,Ce).toLine())},size:function(se,Ce){var Be=xe(this,se,Ce);return this.attr(this.array().size(Be.width,Be.height).toLine())}},construct:{line:function(se,Ce,Be,De){return p.Line.prototype.plot.apply(this.put(new p.Line),se!=null?[se,Ce,Be,De]:[0,0,0,0])}}}),p.Polyline=p.invent({create:"polyline",inherit:p.Shape,construct:{polyline:function(se){return this.put(new p.Polyline).plot(se||new p.PointArray)}}}),p.Polygon=p.invent({create:"polygon",inherit:p.Shape,construct:{polygon:function(se){return this.put(new p.Polygon).plot(se||new p.PointArray)}}}),p.extend(p.Polyline,p.Polygon,{array:function(){return this._array||(this._array=new p.PointArray(this.attr("points")))},plot:function(se){return se==null?this.array():this.clear().attr("points",typeof se=="string"?se:this._array=new p.PointArray(se))},clear:function(){return delete this._array,this},move:function(se,Ce){return this.attr("points",this.array().move(se,Ce))},size:function(se,Ce){var Be=xe(this,se,Ce);return this.attr("points",this.array().size(Be.width,Be.height))}}),p.extend(p.Line,p.Polyline,p.Polygon,{morphArray:p.PointArray,x:function(se){return se==null?this.bbox().x:this.move(se,this.bbox().y)},y:function(se){return se==null?this.bbox().y:this.move(this.bbox().x,se)},width:function(se){var Ce=this.bbox();return se==null?Ce.width:this.size(se,Ce.height)},height:function(se){var Ce=this.bbox();return se==null?Ce.height:this.size(Ce.width,se)}}),p.Path=p.invent({create:"path",inherit:p.Shape,extend:{morphArray:p.PathArray,array:function(){return this._array||(this._array=new p.PathArray(this.attr("d")))},plot:function(se){return se==null?this.array():this.clear().attr("d",typeof se=="string"?se:this._array=new p.PathArray(se))},clear:function(){return delete this._array,this}},construct:{path:function(se){return this.put(new p.Path).plot(se||new p.PathArray)}}}),p.Image=p.invent({create:"image",inherit:p.Shape,extend:{load:function(se){if(!se)return this;var Ce=this,Be=new Ee.Image;return p.on(Be,"load",function(){p.off(Be);var De=Ce.parent(p.Pattern);De!==null&&(Ce.width()==0&&Ce.height()==0&&Ce.size(Be.width,Be.height),De&&De.width()==0&&De.height()==0&&De.size(Ce.width(),Ce.height()),typeof Ce._loaded=="function"&&Ce._loaded.call(Ce,{width:Be.width,height:Be.height,ratio:Be.width/Be.height,url:se}))}),p.on(Be,"error",function(De){p.off(Be),typeof Ce._error=="function"&&Ce._error.call(Ce,De)}),this.attr("href",Be.src=this.src=se,p.xlink)},loaded:function(se){return this._loaded=se,this},error:function(se){return this._error=se,this}},construct:{image:function(se,Ce,Be){return this.put(new p.Image).load(se).size(Ce||0,Be||Ce||0)}}}),p.Text=p.invent({create:function(){this.constructor.call(this,p.create("text")),this.dom.leading=new p.Number(1.3),this._rebuild=!0,this._build=!1,this.attr("font-family",p.defaults.attrs["font-family"])},inherit:p.Shape,extend:{x:function(se){return se==null?this.attr("x"):this.attr("x",se)},text:function(se){if(se===void 0){se="";for(var Ce=this.node.childNodes,Be=0,De=Ce.length;Be<De;++Be)Be!=0&&Ce[Be].nodeType!=3&&p.adopt(Ce[Be]).dom.newLined==1&&(se+=`
`),se+=Ce[Be].textContent;return se}if(this.clear().build(!0),typeof se=="function")se.call(this,this);else{Be=0;for(var _e=(se=se.split(`
`)).length;Be<_e;Be++)this.tspan(se[Be]).newLine()}return this.build(!1).rebuild()},size:function(se){return this.attr("font-size",se).rebuild()},leading:function(se){return se==null?this.dom.leading:(this.dom.leading=new p.Number(se),this.rebuild())},lines:function(){var se=(this.textPath&&this.textPath()||this).node,Ce=p.utils.map(p.utils.filterSVGElements(se.childNodes),function(Be){return p.adopt(Be)});return new p.Set(Ce)},rebuild:function(se){if(typeof se=="boolean"&&(this._rebuild=se),this._rebuild){var Ce=this,Be=0,De=this.dom.leading*new p.Number(this.attr("font-size"));this.lines().each(function(){this.dom.newLined&&(Ce.textPath()||this.attr("x",Ce.attr("x")),this.text()==`
`?Be+=De:(this.attr("dy",De+Be),Be=0))}),this.fire("rebuild")}return this},build:function(se){return this._build=!!se,this},setData:function(se){return this.dom=se,this.dom.leading=new p.Number(se.leading||1.3),this}},construct:{text:function(se){return this.put(new p.Text).text(se)},plain:function(se){return this.put(new p.Text).plain(se)}}}),p.Tspan=p.invent({create:"tspan",inherit:p.Shape,extend:{text:function(se){return se==null?this.node.textContent+(this.dom.newLined?`
`:""):(typeof se=="function"?se.call(this,this):this.plain(se),this)},dx:function(se){return this.attr("dx",se)},dy:function(se){return this.attr("dy",se)},newLine:function(){var se=this.parent(p.Text);return this.dom.newLined=!0,this.dy(se.dom.leading*se.attr("font-size")).attr("x",se.x())}}}),p.extend(p.Text,p.Tspan,{plain:function(se){return this._build===!1&&this.clear(),this.node.appendChild(h.createTextNode(se)),this},tspan:function(se){var Ce=(this.textPath&&this.textPath()||this).node,Be=new p.Tspan;return this._build===!1&&this.clear(),Ce.appendChild(Be.node),Be.text(se)},clear:function(){for(var se=(this.textPath&&this.textPath()||this).node;se.hasChildNodes();)se.removeChild(se.lastChild);return this},length:function(){return this.node.getComputedTextLength()}}),p.TextPath=p.invent({create:"textPath",inherit:p.Parent,parent:p.Text,construct:{morphArray:p.PathArray,array:function(){var se=this.track();return se?se.array():null},plot:function(se){var Ce=this.track(),Be=null;return Ce&&(Be=Ce.plot(se)),se==null?Be:this},track:function(){var se=this.textPath();if(se)return se.reference("href")},textPath:function(){if(this.node.firstChild&&this.node.firstChild.nodeName=="textPath")return p.adopt(this.node.firstChild)}}}),p.Nested=p.invent({create:function(){this.constructor.call(this,p.create("svg")),this.style("overflow","visible")},inherit:p.Container,construct:{nested:function(){return this.put(new p.Nested)}}});var B={stroke:["color","width","opacity","linecap","linejoin","miterlimit","dasharray","dashoffset"],fill:["color","opacity","rule"],prefix:function(se,Ce){return Ce=="color"?se:se+"-"+Ce}};function q(se,Ce,Be,De){return Be+De.replace(p.regex.dots," .")}function te(se){return se.toLowerCase().replace(/-(.)/g,function(Ce,Be){return Be.toUpperCase()})}function ue(se){return se.charAt(0).toUpperCase()+se.slice(1)}function de(se){var Ce=se.toString(16);return Ce.length==1?"0"+Ce:Ce}function xe(se,Ce,Be){if(Ce==null||Be==null){var De=se.bbox();Ce==null?Ce=De.width/De.height*Be:Be==null&&(Be=De.height/De.width*Ce)}return{width:Ce,height:Be}}function Se(se,Ce,Be){return{x:Ce*se.a+Be*se.c+0,y:Ce*se.b+Be*se.d+0}}function ke(se){return{a:se[0],b:se[1],c:se[2],d:se[3],e:se[4],f:se[5]}}function Re(se){for(var Ce=se.childNodes.length-1;Ce>=0;Ce--)se.childNodes[Ce]instanceof Ee.SVGElement&&Re(se.childNodes[Ce]);return p.adopt(se).id(p.eid(se.nodeName))}function Ge(se){return Math.abs(se)>1e-37?se:0}["fill","stroke"].forEach(function(se){var Ce={};Ce[se]=function(Be){if(Be===void 0)return this;if(typeof Be=="string"||p.Color.isRgb(Be)||Be&&typeof Be.fill=="function")this.attr(se,Be);else for(var De=B[se].length-1;De>=0;De--)Be[B[se][De]]!=null&&this.attr(B.prefix(se,B[se][De]),Be[B[se][De]]);return this},p.extend(p.Element,p.FX,Ce)}),p.extend(p.Element,p.FX,{translate:function(se,Ce){return this.transform({x:se,y:Ce})},matrix:function(se){return this.attr("transform",new p.Matrix(arguments.length==6?[].slice.call(arguments):se))},opacity:function(se){return this.attr("opacity",se)},dx:function(se){return this.x(new p.Number(se).plus(this instanceof p.FX?0:this.x()),!0)},dy:function(se){return this.y(new p.Number(se).plus(this instanceof p.FX?0:this.y()),!0)}}),p.extend(p.Path,{length:function(){return this.node.getTotalLength()},pointAt:function(se){return this.node.getPointAtLength(se)}}),p.Set=p.invent({create:function(se){Array.isArray(se)?this.members=se:this.clear()},extend:{add:function(){for(var se=[].slice.call(arguments),Ce=0,Be=se.length;Ce<Be;Ce++)this.members.push(se[Ce]);return this},remove:function(se){var Ce=this.index(se);return Ce>-1&&this.members.splice(Ce,1),this},each:function(se){for(var Ce=0,Be=this.members.length;Ce<Be;Ce++)se.apply(this.members[Ce],[Ce,this.members]);return this},clear:function(){return this.members=[],this},length:function(){return this.members.length},has:function(se){return this.index(se)>=0},index:function(se){return this.members.indexOf(se)},get:function(se){return this.members[se]},first:function(){return this.get(0)},last:function(){return this.get(this.members.length-1)},valueOf:function(){return this.members}},construct:{set:function(se){return new p.Set(se)}}}),p.FX.Set=p.invent({create:function(se){this.set=se}}),p.Set.inherit=function(){var se=[];for(var Ce in p.Shape.prototype)typeof p.Shape.prototype[Ce]=="function"&&typeof p.Set.prototype[Ce]!="function"&&se.push(Ce);for(var Ce in se.forEach(function(De){p.Set.prototype[De]=function(){for(var _e=0,Je=this.members.length;_e<Je;_e++)this.members[_e]&&typeof this.members[_e][De]=="function"&&this.members[_e][De].apply(this.members[_e],arguments);return De=="animate"?this.fx||(this.fx=new p.FX.Set(this)):this}}),se=[],p.FX.prototype)typeof p.FX.prototype[Ce]=="function"&&typeof p.FX.Set.prototype[Ce]!="function"&&se.push(Ce);se.forEach(function(Be){p.FX.Set.prototype[Be]=function(){for(var De=0,_e=this.set.members.length;De<_e;De++)this.set.members[De].fx[Be].apply(this.set.members[De].fx,arguments);return this}})},p.extend(p.Element,{}),p.extend(p.Element,{remember:function(se,Ce){if(I(arguments[0])==="object")for(var Be in se)this.remember(Be,se[Be]);else{if(arguments.length==1)return this.memory()[se];this.memory()[se]=Ce}return this},forget:function(){if(arguments.length==0)this._memory={};else for(var se=arguments.length-1;se>=0;se--)delete this.memory()[arguments[se]];return this},memory:function(){return this._memory||(this._memory={})}}),p.get=function(se){var Ce=h.getElementById(function(Be){var De=(Be||"").toString().match(p.regex.reference);if(De)return De[1]}(se)||se);return p.adopt(Ce)},p.select=function(se,Ce){return new p.Set(p.utils.map((Ce||h).querySelectorAll(se),function(Be){return p.adopt(Be)}))},p.extend(p.Parent,{select:function(se){return p.select(se,this.node)}});var Fe="abcdef".split("");if(typeof Ee.CustomEvent!="function"){var st=function(se,Ce){Ce=Ce||{bubbles:!1,cancelable:!1,detail:void 0};var Be=h.createEvent("CustomEvent");return Be.initCustomEvent(se,Ce.bubbles,Ce.cancelable,Ce.detail),Be};st.prototype=Ee.Event.prototype,p.CustomEvent=st}else p.CustomEvent=Ee.CustomEvent;return p},I(t)==="object"?e.exports=xn.document?Mt(xn,xn.document):function(Ee){return Mt(Ee,Ee.document)}:xn.SVG=Mt(xn,xn.document),(function(){SVG.Filter=SVG.invent({create:"filter",inherit:SVG.Parent,extend:{source:"SourceGraphic",sourceAlpha:"SourceAlpha",background:"BackgroundImage",backgroundAlpha:"BackgroundAlpha",fill:"FillPaint",stroke:"StrokePaint",autoSetIn:!0,put:function(T,B){return this.add(T,B),!T.attr("in")&&this.autoSetIn&&T.attr("in",this.source),T.attr("result")||T.attr("result",T),T},blend:function(T,B,q){return this.put(new SVG.BlendEffect(T,B,q))},colorMatrix:function(T,B){return this.put(new SVG.ColorMatrixEffect(T,B))},convolveMatrix:function(T){return this.put(new SVG.ConvolveMatrixEffect(T))},componentTransfer:function(T){return this.put(new SVG.ComponentTransferEffect(T))},composite:function(T,B,q){return this.put(new SVG.CompositeEffect(T,B,q))},flood:function(T,B){return this.put(new SVG.FloodEffect(T,B))},offset:function(T,B){return this.put(new SVG.OffsetEffect(T,B))},image:function(T){return this.put(new SVG.ImageEffect(T))},merge:function(){var T=[void 0];for(var B in arguments)T.push(arguments[B]);return this.put(new(SVG.MergeEffect.bind.apply(SVG.MergeEffect,T)))},gaussianBlur:function(T,B){return this.put(new SVG.GaussianBlurEffect(T,B))},morphology:function(T,B){return this.put(new SVG.MorphologyEffect(T,B))},diffuseLighting:function(T,B,q){return this.put(new SVG.DiffuseLightingEffect(T,B,q))},displacementMap:function(T,B,q,te,ue){return this.put(new SVG.DisplacementMapEffect(T,B,q,te,ue))},specularLighting:function(T,B,q,te){return this.put(new SVG.SpecularLightingEffect(T,B,q,te))},tile:function(){return this.put(new SVG.TileEffect)},turbulence:function(T,B,q,te,ue){return this.put(new SVG.TurbulenceEffect(T,B,q,te,ue))},toString:function(){return"url(#"+this.attr("id")+")"}}}),SVG.extend(SVG.Defs,{filter:function(T){var B=this.put(new SVG.Filter);return typeof T=="function"&&T.call(B,B),B}}),SVG.extend(SVG.Container,{filter:function(T){return this.defs().filter(T)}}),SVG.extend(SVG.Element,SVG.G,SVG.Nested,{filter:function(T){return this.filterer=T instanceof SVG.Element?T:this.doc().filter(T),this.doc()&&this.filterer.doc()!==this.doc()&&this.doc().defs().add(this.filterer),this.attr("filter",this.filterer),this.filterer},unfilter:function(T){return this.filterer&&T===!0&&this.filterer.remove(),delete this.filterer,this.attr("filter",null)}}),SVG.Effect=SVG.invent({create:function(){this.constructor.call(this)},inherit:SVG.Element,extend:{in:function(T){return T==null?this.parent()&&this.parent().select('[result="'+this.attr("in")+'"]').get(0)||this.attr("in"):this.attr("in",T)},result:function(T){return T==null?this.attr("result"):this.attr("result",T)},toString:function(){return this.result()}}}),SVG.ParentEffect=SVG.invent({create:function(){this.constructor.call(this)},inherit:SVG.Parent,extend:{in:function(T){return T==null?this.parent()&&this.parent().select('[result="'+this.attr("in")+'"]').get(0)||this.attr("in"):this.attr("in",T)},result:function(T){return T==null?this.attr("result"):this.attr("result",T)},toString:function(){return this.result()}}});var Ee={blend:function(T,B){return this.parent()&&this.parent().blend(this,T,B)},colorMatrix:function(T,B){return this.parent()&&this.parent().colorMatrix(T,B).in(this)},convolveMatrix:function(T){return this.parent()&&this.parent().convolveMatrix(T).in(this)},componentTransfer:function(T){return this.parent()&&this.parent().componentTransfer(T).in(this)},composite:function(T,B){return this.parent()&&this.parent().composite(this,T,B)},flood:function(T,B){return this.parent()&&this.parent().flood(T,B)},offset:function(T,B){return this.parent()&&this.parent().offset(T,B).in(this)},image:function(T){return this.parent()&&this.parent().image(T)},merge:function(){return this.parent()&&this.parent().merge.apply(this.parent(),[this].concat(arguments))},gaussianBlur:function(T,B){return this.parent()&&this.parent().gaussianBlur(T,B).in(this)},morphology:function(T,B){return this.parent()&&this.parent().morphology(T,B).in(this)},diffuseLighting:function(T,B,q){return this.parent()&&this.parent().diffuseLighting(T,B,q).in(this)},displacementMap:function(T,B,q,te){return this.parent()&&this.parent().displacementMap(this,T,B,q,te)},specularLighting:function(T,B,q,te){return this.parent()&&this.parent().specularLighting(T,B,q,te).in(this)},tile:function(){return this.parent()&&this.parent().tile().in(this)},turbulence:function(T,B,q,te,ue){return this.parent()&&this.parent().turbulence(T,B,q,te,ue).in(this)}};SVG.extend(SVG.Effect,Ee),SVG.extend(SVG.ParentEffect,Ee),SVG.ChildEffect=SVG.invent({create:function(){this.constructor.call(this)},inherit:SVG.Element,extend:{in:function(T){this.attr("in",T)}}});var h={blend:function(T,B,q){this.attr({in:T,in2:B,mode:q||"normal"})},colorMatrix:function(T,B){T=="matrix"&&(B=_(B)),this.attr({type:T,values:B===void 0?null:B})},convolveMatrix:function(T){T=_(T),this.attr({order:Math.sqrt(T.split(" ").length),kernelMatrix:T})},composite:function(T,B,q){this.attr({in:T,in2:B,operator:q})},flood:function(T,B){this.attr("flood-color",T),B!=null&&this.attr("flood-opacity",B)},offset:function(T,B){this.attr({dx:T,dy:B})},image:function(T){this.attr("href",T,SVG.xlink)},displacementMap:function(T,B,q,te,ue){this.attr({in:T,in2:B,scale:q,xChannelSelector:te,yChannelSelector:ue})},gaussianBlur:function(T,B){T!=null||B!=null?this.attr("stdDeviation",function(q){if(!Array.isArray(q))return q;for(var te=0,ue=q.length,de=[];te<ue;te++)de.push(q[te]);return de.join(" ")}(Array.prototype.slice.call(arguments))):this.attr("stdDeviation","0 0")},morphology:function(T,B){this.attr({operator:T,radius:B})},tile:function(){},turbulence:function(T,B,q,te,ue){this.attr({numOctaves:B,seed:q,stitchTiles:te,baseFrequency:T,type:ue})}},p={merge:function(){var T;if(arguments[0]instanceof SVG.Set){var B=this;arguments[0].each(function(te){this instanceof SVG.MergeNode?B.put(this):(this instanceof SVG.Effect||this instanceof SVG.ParentEffect)&&B.put(new SVG.MergeNode(this))})}else{T=Array.isArray(arguments[0])?arguments[0]:arguments;for(var q=0;q<T.length;q++)T[q]instanceof SVG.MergeNode?this.put(T[q]):this.put(new SVG.MergeNode(T[q]))}},componentTransfer:function(T){if(this.rgb=new SVG.Set,["r","g","b","a"].forEach((function(q){this[q]=new SVG["Func"+q.toUpperCase()]("identity"),this.rgb.add(this[q]),this.node.appendChild(this[q].node)}).bind(this)),T)for(var B in T.rgb&&(["r","g","b"].forEach((function(q){this[q].attr(T.rgb)}).bind(this)),delete T.rgb),T)this[B].attr(T[B])},diffuseLighting:function(T,B,q){this.attr({surfaceScale:T,diffuseConstant:B,kernelUnitLength:q})},specularLighting:function(T,B,q,te){this.attr({surfaceScale:T,diffuseConstant:B,specularExponent:q,kernelUnitLength:te})}},S={distantLight:function(T,B){this.attr({azimuth:T,elevation:B})},pointLight:function(T,B,q){this.attr({x:T,y:B,z:q})},spotLight:function(T,B,q,te,ue,de){this.attr({x:T,y:B,z:q,pointsAtX:te,pointsAtY:ue,pointsAtZ:de})},mergeNode:function(T){this.attr("in",T)}};function _(T){return Array.isArray(T)&&(T=new SVG.Array(T)),T.toString().replace(/^\s+/,"").replace(/\s+$/,"").replace(/\s+/g," ")}function k(){var T=function(){};for(var B in typeof arguments[arguments.length-1]=="function"&&(T=arguments[arguments.length-1],Array.prototype.splice.call(arguments,arguments.length-1,1)),arguments)for(var q in arguments[B])T(arguments[B][q],q,arguments[B])}["r","g","b","a"].forEach(function(T){S["Func"+T.toUpperCase()]=function(B){switch(this.attr("type",B),B){case"table":this.attr("tableValues",arguments[1]);break;case"linear":this.attr("slope",arguments[1]),this.attr("intercept",arguments[2]);break;case"gamma":this.attr("amplitude",arguments[1]),this.attr("exponent",arguments[2]),this.attr("offset",arguments[2])}}}),k(h,function(T,B){var q=B.charAt(0).toUpperCase()+B.slice(1);SVG[q+"Effect"]=SVG.invent({create:function(){this.constructor.call(this,SVG.create("fe"+q)),T.apply(this,arguments),this.result(this.attr("id")+"Out")},inherit:SVG.Effect,extend:{}})}),k(p,function(T,B){var q=B.charAt(0).toUpperCase()+B.slice(1);SVG[q+"Effect"]=SVG.invent({create:function(){this.constructor.call(this,SVG.create("fe"+q)),T.apply(this,arguments),this.result(this.attr("id")+"Out")},inherit:SVG.ParentEffect,extend:{}})}),k(S,function(T,B){var q=B.charAt(0).toUpperCase()+B.slice(1);SVG[q]=SVG.invent({create:function(){this.constructor.call(this,SVG.create("fe"+q)),T.apply(this,arguments)},inherit:SVG.ChildEffect,extend:{}})}),SVG.extend(SVG.MergeEffect,{in:function(T){return T instanceof SVG.MergeNode?this.add(T,0):this.add(new SVG.MergeNode(T),0),this}}),SVG.extend(SVG.CompositeEffect,SVG.BlendEffect,SVG.DisplacementMapEffect,{in2:function(T){return T==null?this.parent()&&this.parent().select('[result="'+this.attr("in2")+'"]').get(0)||this.attr("in2"):this.attr("in2",T)}}),SVG.filter={sepiatone:[.343,.669,.119,0,0,.249,.626,.13,0,0,.172,.334,.111,0,0,0,0,0,1,0]}}).call(void 0),function(){function Ee(k,T,B,q,te,ue,de){for(var xe=k.slice(T,B||de),Se=q.slice(te,ue||de),ke=0,Re={pos:[0,0],start:[0,0]},Ge={pos:[0,0],start:[0,0]};xe[ke]=h.call(Re,xe[ke]),Se[ke]=h.call(Ge,Se[ke]),xe[ke][0]!=Se[ke][0]||xe[ke][0]=="M"||xe[ke][0]=="A"&&(xe[ke][4]!=Se[ke][4]||xe[ke][5]!=Se[ke][5])?(Array.prototype.splice.apply(xe,[ke,1].concat(S.call(Re,xe[ke]))),Array.prototype.splice.apply(Se,[ke,1].concat(S.call(Ge,Se[ke])))):(xe[ke]=p.call(Re,xe[ke]),Se[ke]=p.call(Ge,Se[ke])),!(++ke==xe.length&&ke==Se.length);)ke==xe.length&&xe.push(["C",Re.pos[0],Re.pos[1],Re.pos[0],Re.pos[1],Re.pos[0],Re.pos[1]]),ke==Se.length&&Se.push(["C",Ge.pos[0],Ge.pos[1],Ge.pos[0],Ge.pos[1],Ge.pos[0],Ge.pos[1]]);return{start:xe,dest:Se}}function h(k){switch(k[0]){case"z":case"Z":k[0]="L",k[1]=this.start[0],k[2]=this.start[1];break;case"H":k[0]="L",k[2]=this.pos[1];break;case"V":k[0]="L",k[2]=k[1],k[1]=this.pos[0];break;case"T":k[0]="Q",k[3]=k[1],k[4]=k[2],k[1]=this.reflection[1],k[2]=this.reflection[0];break;case"S":k[0]="C",k[6]=k[4],k[5]=k[3],k[4]=k[2],k[3]=k[1],k[2]=this.reflection[1],k[1]=this.reflection[0]}return k}function p(k){var T=k.length;return this.pos=[k[T-2],k[T-1]],"SCQT".indexOf(k[0])!=-1&&(this.reflection=[2*this.pos[0]-k[T-4],2*this.pos[1]-k[T-3]]),k}function S(k){var T=[k];switch(k[0]){case"M":return this.pos=this.start=[k[1],k[2]],T;case"L":k[5]=k[3]=k[1],k[6]=k[4]=k[2],k[1]=this.pos[0],k[2]=this.pos[1];break;case"Q":k[6]=k[4],k[5]=k[3],k[4]=1*k[4]/3+2*k[2]/3,k[3]=1*k[3]/3+2*k[1]/3,k[2]=1*this.pos[1]/3+2*k[2]/3,k[1]=1*this.pos[0]/3+2*k[1]/3;break;case"A":T=function(B,q){var te,ue,de,xe,Se,ke,Re,Ge,Fe,st,se,Ce,Be,De,_e,Je,ct,gt,Xt,wt,Xe,Oe,bt,kt,Ut,fn,On=Math.abs(q[1]),Sn=Math.abs(q[2]),yr=q[3]%360,Pn=q[4],En=q[5],$n=q[6],Bn=q[7],_r=new SVG.Point(B),sr=new SVG.Point($n,Bn),rr=[];if(On===0||Sn===0||_r.x===sr.x&&_r.y===sr.y)return[["C",_r.x,_r.y,sr.x,sr.y,sr.x,sr.y]];for(te=new SVG.Point((_r.x-sr.x)/2,(_r.y-sr.y)/2).transform(new SVG.Matrix().rotate(yr)),(ue=te.x*te.x/(On*On)+te.y*te.y/(Sn*Sn))>1&&(On*=ue=Math.sqrt(ue),Sn*=ue),de=new SVG.Matrix().rotate(yr).scale(1/On,1/Sn).rotate(-yr),_r=_r.transform(de),sr=sr.transform(de),xe=[sr.x-_r.x,sr.y-_r.y],ke=xe[0]*xe[0]+xe[1]*xe[1],Se=Math.sqrt(ke),xe[0]/=Se,xe[1]/=Se,Re=ke<4?Math.sqrt(1-ke/4):0,Pn===En&&(Re*=-1),Ge=new SVG.Point((sr.x+_r.x)/2+Re*-xe[1],(sr.y+_r.y)/2+Re*xe[0]),Fe=new SVG.Point(_r.x-Ge.x,_r.y-Ge.y),st=new SVG.Point(sr.x-Ge.x,sr.y-Ge.y),se=Math.acos(Fe.x/Math.sqrt(Fe.x*Fe.x+Fe.y*Fe.y)),Fe.y<0&&(se*=-1),Ce=Math.acos(st.x/Math.sqrt(st.x*st.x+st.y*st.y)),st.y<0&&(Ce*=-1),En&&se>Ce&&(Ce+=2*Math.PI),!En&&se<Ce&&(Ce-=2*Math.PI),De=Math.ceil(2*Math.abs(se-Ce)/Math.PI),Je=[],ct=se,Be=(Ce-se)/De,_e=4*Math.tan(Be/4)/3,Xe=0;Xe<=De;Xe++)Xt=Math.cos(ct),gt=Math.sin(ct),wt=new SVG.Point(Ge.x+Xt,Ge.y+gt),Je[Xe]=[new SVG.Point(wt.x+_e*gt,wt.y-_e*Xt),wt,new SVG.Point(wt.x-_e*gt,wt.y+_e*Xt)],ct+=Be;for(Je[0][0]=Je[0][1].clone(),Je[Je.length-1][2]=Je[Je.length-1][1].clone(),de=new SVG.Matrix().rotate(yr).scale(On,Sn).rotate(-yr),Xe=0,Oe=Je.length;Xe<Oe;Xe++)Je[Xe][0]=Je[Xe][0].transform(de),Je[Xe][1]=Je[Xe][1].transform(de),Je[Xe][2]=Je[Xe][2].transform(de);for(Xe=1,Oe=Je.length;Xe<Oe;Xe++)bt=(wt=Je[Xe-1][2]).x,kt=wt.y,Ut=(wt=Je[Xe][0]).x,fn=wt.y,$n=(wt=Je[Xe][1]).x,Bn=wt.y,rr.push(["C",bt,kt,Ut,fn,$n,Bn]);return rr}(this.pos,k),k=T[0]}return k[0]="C",this.pos=[k[5],k[6]],this.reflection=[2*k[5]-k[3],2*k[6]-k[4]],T}function _(k,T){if(T===!1)return!1;for(var B=T,q=k.length;B<q;++B)if(k[B][0]=="M")return B;return!1}SVG.extend(SVG.PathArray,{morph:function(k){for(var T=this.value,B=this.parse(k),q=0,te=0,ue=!1,de=!1;q!==!1||te!==!1;){var xe;ue=_(T,q!==!1&&q+1),de=_(B,te!==!1&&te+1),q===!1&&(q=(xe=new SVG.PathArray(Se.start).bbox()).height==0||xe.width==0?T.push(T[0])-1:T.push(["M",xe.x+xe.width/2,xe.y+xe.height/2])-1),te===!1&&(te=(xe=new SVG.PathArray(Se.dest).bbox()).height==0||xe.width==0?B.push(B[0])-1:B.push(["M",xe.x+xe.width/2,xe.y+xe.height/2])-1);var Se=Ee(T,q,ue,B,te,de);T=T.slice(0,q).concat(Se.start,ue===!1?[]:T.slice(ue)),B=B.slice(0,te).concat(Se.dest,de===!1?[]:B.slice(de)),q=ue!==!1&&q+Se.start.length,te=de!==!1&&te+Se.dest.length}return this.value=T,this.destination=new SVG.PathArray,this.destination.value=B,this}})}(),(function(){function Ee(h){h.remember("_draggable",this),this.el=h}Ee.prototype.init=function(h,p){var S=this;this.constraint=h,this.value=p,this.el.on("mousedown.drag",function(_){S.start(_)}),this.el.on("touchstart.drag",function(_){S.start(_)})},Ee.prototype.transformPoint=function(h,p){var S=(h=h||window.event).changedTouches&&h.changedTouches[0]||h;return this.p.x=S.clientX-(p||0),this.p.y=S.clientY,this.p.matrixTransform(this.m)},Ee.prototype.getBBox=function(){var h=this.el.bbox();return this.el instanceof SVG.Nested&&(h=this.el.rbox()),(this.el instanceof SVG.G||this.el instanceof SVG.Use||this.el instanceof SVG.Nested)&&(h.x=this.el.x(),h.y=this.el.y()),h},Ee.prototype.start=function(h){if(h.type!="click"&&h.type!="mousedown"&&h.type!="mousemove"||(h.which||h.buttons)==1){var p=this;if(this.el.fire("beforedrag",{event:h,handler:this}),!this.el.event().defaultPrevented){h.preventDefault(),h.stopPropagation(),this.parent=this.parent||this.el.parent(SVG.Nested)||this.el.parent(SVG.Doc),this.p=this.parent.node.createSVGPoint(),this.m=this.el.node.getScreenCTM().inverse();var S,_=this.getBBox();if(this.el instanceof SVG.Text)switch(S=this.el.node.getComputedTextLength(),this.el.attr("text-anchor")){case"middle":S/=2;break;case"start":S=0}this.startPoints={point:this.transformPoint(h,S),box:_,transform:this.el.transform()},SVG.on(window,"mousemove.drag",function(k){p.drag(k)}),SVG.on(window,"touchmove.drag",function(k){p.drag(k)}),SVG.on(window,"mouseup.drag",function(k){p.end(k)}),SVG.on(window,"touchend.drag",function(k){p.end(k)}),this.el.fire("dragstart",{event:h,p:this.startPoints.point,m:this.m,handler:this})}}},Ee.prototype.drag=function(h){var p=this.getBBox(),S=this.transformPoint(h),_=this.startPoints.box.x+S.x-this.startPoints.point.x,k=this.startPoints.box.y+S.y-this.startPoints.point.y,T=this.constraint,B=S.x-this.startPoints.point.x,q=S.y-this.startPoints.point.y;if(this.el.fire("dragmove",{event:h,p:S,m:this.m,handler:this}),this.el.event().defaultPrevented)return S;if(typeof T=="function"){var te=T.call(this.el,_,k,this.m);typeof te=="boolean"&&(te={x:te,y:te}),te.x===!0?this.el.x(_):te.x!==!1&&this.el.x(te.x),te.y===!0?this.el.y(k):te.y!==!1&&this.el.y(te.y)}else typeof T=="object"&&(T.minX!=null&&_<T.minX?B=(_=T.minX)-this.startPoints.box.x:T.maxX!=null&&_>T.maxX-p.width&&(B=(_=T.maxX-p.width)-this.startPoints.box.x),T.minY!=null&&k<T.minY?q=(k=T.minY)-this.startPoints.box.y:T.maxY!=null&&k>T.maxY-p.height&&(q=(k=T.maxY-p.height)-this.startPoints.box.y),T.snapToGrid!=null&&(_-=_%T.snapToGrid,k-=k%T.snapToGrid,B-=B%T.snapToGrid,q-=q%T.snapToGrid),this.el instanceof SVG.G?this.el.matrix(this.startPoints.transform).transform({x:B,y:q},!0):this.el.move(_,k));return S},Ee.prototype.end=function(h){var p=this.drag(h);this.el.fire("dragend",{event:h,p,m:this.m,handler:this}),SVG.off(window,"mousemove.drag"),SVG.off(window,"touchmove.drag"),SVG.off(window,"mouseup.drag"),SVG.off(window,"touchend.drag")},SVG.extend(SVG.Element,{draggable:function(h,p){typeof h!="function"&&typeof h!="object"||(p=h,h=!0);var S=this.remember("_draggable")||new Ee(this);return(h=h===void 0||h)?S.init(p||{},h):(this.off("mousedown.drag"),this.off("touchstart.drag")),this}})}).call(void 0),function(){function Ee(h){this.el=h,h.remember("_selectHandler",this),this.pointSelection={isSelected:!1},this.rectSelection={isSelected:!1},this.pointsList={lt:[0,0],rt:["width",0],rb:["width","height"],lb:[0,"height"],t:["width",0],r:["width","height"],b:["width","height"],l:[0,"height"]},this.pointCoord=function(p,S,_){var k=typeof p!="string"?p:S[p];return _?k/2:k},this.pointCoords=function(p,S){var _=this.pointsList[p];return{x:this.pointCoord(_[0],S,p==="t"||p==="b"),y:this.pointCoord(_[1],S,p==="r"||p==="l")}}}Ee.prototype.init=function(h,p){var S=this.el.bbox();this.options={};var _=this.el.selectize.defaults.points;for(var k in this.el.selectize.defaults)this.options[k]=this.el.selectize.defaults[k],p[k]!==void 0&&(this.options[k]=p[k]);var T=["points","pointsExclude"];for(var k in T){var B=this.options[T[k]];typeof B=="string"?B=B.length>0?B.split(/\s*,\s*/i):[]:typeof B=="boolean"&&T[k]==="points"&&(B=B?_:[]),this.options[T[k]]=B}this.options.points=[_,this.options.points].reduce(function(q,te){return q.filter(function(ue){return te.indexOf(ue)>-1})}),this.options.points=[this.options.points,this.options.pointsExclude].reduce(function(q,te){return q.filter(function(ue){return te.indexOf(ue)<0})}),this.parent=this.el.parent(),this.nested=this.nested||this.parent.group(),this.nested.matrix(new SVG.Matrix(this.el).translate(S.x,S.y)),this.options.deepSelect&&["line","polyline","polygon"].indexOf(this.el.type)!==-1?this.selectPoints(h):this.selectRect(h),this.observe(),this.cleanup()},Ee.prototype.selectPoints=function(h){return this.pointSelection.isSelected=h,this.pointSelection.set||(this.pointSelection.set=this.parent.set(),this.drawPoints()),this},Ee.prototype.getPointArray=function(){var h=this.el.bbox();return this.el.array().valueOf().map(function(p){return[p[0]-h.x,p[1]-h.y]})},Ee.prototype.drawPoints=function(){for(var h=this,p=this.getPointArray(),S=0,_=p.length;S<_;++S){var k=function(B){return function(q){(q=q||window.event).preventDefault?q.preventDefault():q.returnValue=!1,q.stopPropagation();var te=q.pageX||q.touches[0].pageX,ue=q.pageY||q.touches[0].pageY;h.el.fire("point",{x:te,y:ue,i:B,event:q})}}(S),T=this.drawPoint(p[S][0],p[S][1]).addClass(this.options.classPoints).addClass(this.options.classPoints+"_point").on("touchstart",k).on("mousedown",k);this.pointSelection.set.add(T)}},Ee.prototype.drawPoint=function(h,p){var S=this.options.pointType;switch(S){case"circle":return this.drawCircle(h,p);case"rect":return this.drawRect(h,p);default:if(typeof S=="function")return S.call(this,h,p);throw new Error("Unknown "+S+" point type!")}},Ee.prototype.drawCircle=function(h,p){return this.nested.circle(this.options.pointSize).center(h,p)},Ee.prototype.drawRect=function(h,p){return this.nested.rect(this.options.pointSize,this.options.pointSize).center(h,p)},Ee.prototype.updatePointSelection=function(){var h=this.getPointArray();this.pointSelection.set.each(function(p){this.cx()===h[p][0]&&this.cy()===h[p][1]||this.center(h[p][0],h[p][1])})},Ee.prototype.updateRectSelection=function(){var h=this,p=this.el.bbox();if(this.rectSelection.set.get(0).attr({width:p.width,height:p.height}),this.options.points.length&&this.options.points.map(function(_,k){var T=h.pointCoords(_,p);h.rectSelection.set.get(k+1).center(T.x,T.y)}),this.options.rotationPoint){var S=this.rectSelection.set.length();this.rectSelection.set.get(S-1).center(p.width/2,20)}},Ee.prototype.selectRect=function(h){var p=this,S=this.el.bbox();function _(B){return function(q){(q=q||window.event).preventDefault?q.preventDefault():q.returnValue=!1,q.stopPropagation();var te=q.pageX||q.touches[0].pageX,ue=q.pageY||q.touches[0].pageY;p.el.fire(B,{x:te,y:ue,event:q})}}if(this.rectSelection.isSelected=h,this.rectSelection.set=this.rectSelection.set||this.parent.set(),this.rectSelection.set.get(0)||this.rectSelection.set.add(this.nested.rect(S.width,S.height).addClass(this.options.classRect)),this.options.points.length&&this.rectSelection.set.length()<2&&(this.options.points.map(function(B,q){var te=p.pointCoords(B,S),ue=p.drawPoint(te.x,te.y).attr("class",p.options.classPoints+"_"+B).on("mousedown",_(B)).on("touchstart",_(B));p.rectSelection.set.add(ue)}),this.rectSelection.set.each(function(){this.addClass(p.options.classPoints)})),this.options.rotationPoint&&(this.options.points&&!this.rectSelection.set.get(9)||!this.options.points&&!this.rectSelection.set.get(1))){var k=function(B){(B=B||window.event).preventDefault?B.preventDefault():B.returnValue=!1,B.stopPropagation();var q=B.pageX||B.touches[0].pageX,te=B.pageY||B.touches[0].pageY;p.el.fire("rot",{x:q,y:te,event:B})},T=this.drawPoint(S.width/2,20).attr("class",this.options.classPoints+"_rot").on("touchstart",k).on("mousedown",k);this.rectSelection.set.add(T)}},Ee.prototype.handler=function(){var h=this.el.bbox();this.nested.matrix(new SVG.Matrix(this.el).translate(h.x,h.y)),this.rectSelection.isSelected&&this.updateRectSelection(),this.pointSelection.isSelected&&this.updatePointSelection()},Ee.prototype.observe=function(){var h=this;if(MutationObserver)if(this.rectSelection.isSelected||this.pointSelection.isSelected)this.observerInst=this.observerInst||new MutationObserver(function(){h.handler()}),this.observerInst.observe(this.el.node,{attributes:!0});else try{this.observerInst.disconnect(),delete this.observerInst}catch{}else this.el.off("DOMAttrModified.select"),(this.rectSelection.isSelected||this.pointSelection.isSelected)&&this.el.on("DOMAttrModified.select",function(){h.handler()})},Ee.prototype.cleanup=function(){!this.rectSelection.isSelected&&this.rectSelection.set&&(this.rectSelection.set.each(function(){this.remove()}),this.rectSelection.set.clear(),delete this.rectSelection.set),!this.pointSelection.isSelected&&this.pointSelection.set&&(this.pointSelection.set.each(function(){this.remove()}),this.pointSelection.set.clear(),delete this.pointSelection.set),this.pointSelection.isSelected||this.rectSelection.isSelected||(this.nested.remove(),delete this.nested)},SVG.extend(SVG.Element,{selectize:function(h,p){return typeof h=="object"&&(p=h,h=!0),(this.remember("_selectHandler")||new Ee(this)).init(h===void 0||h,p||{}),this}}),SVG.Element.prototype.selectize.defaults={points:["lt","rt","rb","lb","t","r","b","l"],pointsExclude:[],classRect:"svg_select_boundingRect",classPoints:"svg_select_points",pointSize:7,rotationPoint:!0,deepSelect:!1,pointType:"circle"}}(),function(){(function(){function Ee(h){h.remember("_resizeHandler",this),this.el=h,this.parameters={},this.lastUpdateCall=null,this.p=h.doc().node.createSVGPoint()}Ee.prototype.transformPoint=function(h,p,S){return this.p.x=h-(this.offset.x-window.pageXOffset),this.p.y=p-(this.offset.y-window.pageYOffset),this.p.matrixTransform(S||this.m)},Ee.prototype._extractPosition=function(h){return{x:h.clientX!=null?h.clientX:h.touches[0].clientX,y:h.clientY!=null?h.clientY:h.touches[0].clientY}},Ee.prototype.init=function(h){var p=this;if(this.stop(),h!=="stop"){for(var S in this.options={},this.el.resize.defaults)this.options[S]=this.el.resize.defaults[S],h[S]!==void 0&&(this.options[S]=h[S]);this.el.on("lt.resize",function(_){p.resize(_||window.event)}),this.el.on("rt.resize",function(_){p.resize(_||window.event)}),this.el.on("rb.resize",function(_){p.resize(_||window.event)}),this.el.on("lb.resize",function(_){p.resize(_||window.event)}),this.el.on("t.resize",function(_){p.resize(_||window.event)}),this.el.on("r.resize",function(_){p.resize(_||window.event)}),this.el.on("b.resize",function(_){p.resize(_||window.event)}),this.el.on("l.resize",function(_){p.resize(_||window.event)}),this.el.on("rot.resize",function(_){p.resize(_||window.event)}),this.el.on("point.resize",function(_){p.resize(_||window.event)}),this.update()}},Ee.prototype.stop=function(){return this.el.off("lt.resize"),this.el.off("rt.resize"),this.el.off("rb.resize"),this.el.off("lb.resize"),this.el.off("t.resize"),this.el.off("r.resize"),this.el.off("b.resize"),this.el.off("l.resize"),this.el.off("rot.resize"),this.el.off("point.resize"),this},Ee.prototype.resize=function(h){var p=this;this.m=this.el.node.getScreenCTM().inverse(),this.offset={x:window.pageXOffset,y:window.pageYOffset};var S=this._extractPosition(h.detail.event);if(this.parameters={type:this.el.type,p:this.transformPoint(S.x,S.y),x:h.detail.x,y:h.detail.y,box:this.el.bbox(),rotation:this.el.transform().rotation},this.el.type==="text"&&(this.parameters.fontSize=this.el.attr()["font-size"]),h.detail.i!==void 0){var _=this.el.array().valueOf();this.parameters.i=h.detail.i,this.parameters.pointCoords=[_[h.detail.i][0],_[h.detail.i][1]]}switch(h.type){case"lt":this.calc=function(k,T){var B=this.snapToGrid(k,T);if(this.parameters.box.width-B[0]>0&&this.parameters.box.height-B[1]>0){if(this.parameters.type==="text")return this.el.move(this.parameters.box.x+B[0],this.parameters.box.y),void this.el.attr("font-size",this.parameters.fontSize-B[0]);B=this.checkAspectRatio(B),this.el.move(this.parameters.box.x+B[0],this.parameters.box.y+B[1]).size(this.parameters.box.width-B[0],this.parameters.box.height-B[1])}};break;case"rt":this.calc=function(k,T){var B=this.snapToGrid(k,T,2);if(this.parameters.box.width+B[0]>0&&this.parameters.box.height-B[1]>0){if(this.parameters.type==="text")return this.el.move(this.parameters.box.x-B[0],this.parameters.box.y),void this.el.attr("font-size",this.parameters.fontSize+B[0]);B=this.checkAspectRatio(B,!0),this.el.move(this.parameters.box.x,this.parameters.box.y+B[1]).size(this.parameters.box.width+B[0],this.parameters.box.height-B[1])}};break;case"rb":this.calc=function(k,T){var B=this.snapToGrid(k,T,0);if(this.parameters.box.width+B[0]>0&&this.parameters.box.height+B[1]>0){if(this.parameters.type==="text")return this.el.move(this.parameters.box.x-B[0],this.parameters.box.y),void this.el.attr("font-size",this.parameters.fontSize+B[0]);B=this.checkAspectRatio(B),this.el.move(this.parameters.box.x,this.parameters.box.y).size(this.parameters.box.width+B[0],this.parameters.box.height+B[1])}};break;case"lb":this.calc=function(k,T){var B=this.snapToGrid(k,T,1);if(this.parameters.box.width-B[0]>0&&this.parameters.box.height+B[1]>0){if(this.parameters.type==="text")return this.el.move(this.parameters.box.x+B[0],this.parameters.box.y),void this.el.attr("font-size",this.parameters.fontSize-B[0]);B=this.checkAspectRatio(B,!0),this.el.move(this.parameters.box.x+B[0],this.parameters.box.y).size(this.parameters.box.width-B[0],this.parameters.box.height+B[1])}};break;case"t":this.calc=function(k,T){var B=this.snapToGrid(k,T,2);if(this.parameters.box.height-B[1]>0){if(this.parameters.type==="text")return;this.el.move(this.parameters.box.x,this.parameters.box.y+B[1]).height(this.parameters.box.height-B[1])}};break;case"r":this.calc=function(k,T){var B=this.snapToGrid(k,T,0);if(this.parameters.box.width+B[0]>0){if(this.parameters.type==="text")return;this.el.move(this.parameters.box.x,this.parameters.box.y).width(this.parameters.box.width+B[0])}};break;case"b":this.calc=function(k,T){var B=this.snapToGrid(k,T,0);if(this.parameters.box.height+B[1]>0){if(this.parameters.type==="text")return;this.el.move(this.parameters.box.x,this.parameters.box.y).height(this.parameters.box.height+B[1])}};break;case"l":this.calc=function(k,T){var B=this.snapToGrid(k,T,1);if(this.parameters.box.width-B[0]>0){if(this.parameters.type==="text")return;this.el.move(this.parameters.box.x+B[0],this.parameters.box.y).width(this.parameters.box.width-B[0])}};break;case"rot":this.calc=function(k,T){var B=k+this.parameters.p.x,q=T+this.parameters.p.y,te=Math.atan2(this.parameters.p.y-this.parameters.box.y-this.parameters.box.height/2,this.parameters.p.x-this.parameters.box.x-this.parameters.box.width/2),ue=Math.atan2(q-this.parameters.box.y-this.parameters.box.height/2,B-this.parameters.box.x-this.parameters.box.width/2),de=this.parameters.rotation+180*(ue-te)/Math.PI+this.options.snapToAngle/2;this.el.center(this.parameters.box.cx,this.parameters.box.cy).rotate(de-de%this.options.snapToAngle,this.parameters.box.cx,this.parameters.box.cy)};break;case"point":this.calc=function(k,T){var B=this.snapToGrid(k,T,this.parameters.pointCoords[0],this.parameters.pointCoords[1]),q=this.el.array().valueOf();q[this.parameters.i][0]=this.parameters.pointCoords[0]+B[0],q[this.parameters.i][1]=this.parameters.pointCoords[1]+B[1],this.el.plot(q)}}this.el.fire("resizestart",{dx:this.parameters.x,dy:this.parameters.y,event:h}),SVG.on(window,"touchmove.resize",function(k){p.update(k||window.event)}),SVG.on(window,"touchend.resize",function(){p.done()}),SVG.on(window,"mousemove.resize",function(k){p.update(k||window.event)}),SVG.on(window,"mouseup.resize",function(){p.done()})},Ee.prototype.update=function(h){if(h){var p=this._extractPosition(h),S=this.transformPoint(p.x,p.y),_=S.x-this.parameters.p.x,k=S.y-this.parameters.p.y;this.lastUpdateCall=[_,k],this.calc(_,k),this.el.fire("resizing",{dx:_,dy:k,event:h})}else this.lastUpdateCall&&this.calc(this.lastUpdateCall[0],this.lastUpdateCall[1])},Ee.prototype.done=function(){this.lastUpdateCall=null,SVG.off(window,"mousemove.resize"),SVG.off(window,"mouseup.resize"),SVG.off(window,"touchmove.resize"),SVG.off(window,"touchend.resize"),this.el.fire("resizedone")},Ee.prototype.snapToGrid=function(h,p,S,_){var k;return _!==void 0?k=[(S+h)%this.options.snapToGrid,(_+p)%this.options.snapToGrid]:(S=S??3,k=[(this.parameters.box.x+h+(1&S?0:this.parameters.box.width))%this.options.snapToGrid,(this.parameters.box.y+p+(2&S?0:this.parameters.box.height))%this.options.snapToGrid]),h<0&&(k[0]-=this.options.snapToGrid),p<0&&(k[1]-=this.options.snapToGrid),h-=Math.abs(k[0])<this.options.snapToGrid/2?k[0]:k[0]-(h<0?-this.options.snapToGrid:this.options.snapToGrid),p-=Math.abs(k[1])<this.options.snapToGrid/2?k[1]:k[1]-(p<0?-this.options.snapToGrid:this.options.snapToGrid),this.constraintToBox(h,p,S,_)},Ee.prototype.constraintToBox=function(h,p,S,_){var k,T,B=this.options.constraint||{};return _!==void 0?(k=S,T=_):(k=this.parameters.box.x+(1&S?0:this.parameters.box.width),T=this.parameters.box.y+(2&S?0:this.parameters.box.height)),B.minX!==void 0&&k+h<B.minX&&(h=B.minX-k),B.maxX!==void 0&&k+h>B.maxX&&(h=B.maxX-k),B.minY!==void 0&&T+p<B.minY&&(p=B.minY-T),B.maxY!==void 0&&T+p>B.maxY&&(p=B.maxY-T),[h,p]},Ee.prototype.checkAspectRatio=function(h,p){if(!this.options.saveAspectRatio)return h;var S=h.slice(),_=this.parameters.box.width/this.parameters.box.height,k=this.parameters.box.width+h[0],T=this.parameters.box.height-h[1],B=k/T;return B<_?(S[1]=k/_-this.parameters.box.height,p&&(S[1]=-S[1])):B>_&&(S[0]=this.parameters.box.width-T*_,p&&(S[0]=-S[0])),S},SVG.extend(SVG.Element,{resize:function(h){return(this.remember("_resizeHandler")||new Ee(this)).init(h||{}),this}}),SVG.Element.prototype.resize.defaults={snapToAngle:.1,snapToGrid:1,constraint:{},saveAspectRatio:!1}}).call(this)}(),window.Apex===void 0&&(window.Apex={});var zn=function(){function Ee(h){s(this,Ee),this.ctx=h,this.w=h.w}return o(Ee,[{key:"initModules",value:function(){this.ctx.publicMethods=["updateOptions","updateSeries","appendData","appendSeries","isSeriesHidden","highlightSeries","toggleSeries","showSeries","hideSeries","setLocale","resetSeries","zoomX","toggleDataPointSelection","dataURI","exportToCSV","addXaxisAnnotation","addYaxisAnnotation","addPointAnnotation","clearAnnotations","removeAnnotation","paper","destroy"],this.ctx.eventList=["click","mousedown","mousemove","mouseleave","touchstart","touchmove","touchleave","mouseup","touchend"],this.ctx.animations=new U(this.ctx),this.ctx.axes=new nn(this.ctx),this.ctx.core=new lr(this.ctx.el,this.ctx),this.ctx.config=new Ne({}),this.ctx.data=new Qe(this.ctx),this.ctx.grid=new tt(this.ctx),this.ctx.graphics=new z(this.ctx),this.ctx.coreUtils=new Q(this.ctx),this.ctx.crosshairs=new jt(this.ctx),this.ctx.events=new qt(this.ctx),this.ctx.exports=new $e(this.ctx),this.ctx.fill=new ye(this.ctx),this.ctx.localization=new It(this.ctx),this.ctx.options=new G,this.ctx.responsive=new cn(this.ctx),this.ctx.series=new Le(this.ctx),this.ctx.theme=new un(this.ctx),this.ctx.formatters=new re(this.ctx),this.ctx.titleSubtitle=new Ft(this.ctx),this.ctx.legend=new Zt(this.ctx),this.ctx.toolbar=new zt(this.ctx),this.ctx.tooltip=new Dt(this.ctx),this.ctx.dimensions=new Ye(this.ctx),this.ctx.updateHelpers=new Qt(this.ctx),this.ctx.zoomPanSelection=new Et(this.ctx),this.ctx.w.globals.tooltip=new Dt(this.ctx)}}]),Ee}(),Jn=function(){function Ee(h){s(this,Ee),this.ctx=h,this.w=h.w}return o(Ee,[{key:"clear",value:function(h){var p=h.isUpdating;this.ctx.zoomPanSelection&&this.ctx.zoomPanSelection.destroy(),this.ctx.toolbar&&this.ctx.toolbar.destroy(),this.ctx.animations=null,this.ctx.axes=null,this.ctx.annotations=null,this.ctx.core=null,this.ctx.data=null,this.ctx.grid=null,this.ctx.series=null,this.ctx.responsive=null,this.ctx.theme=null,this.ctx.formatters=null,this.ctx.titleSubtitle=null,this.ctx.legend=null,this.ctx.dimensions=null,this.ctx.options=null,this.ctx.crosshairs=null,this.ctx.zoomPanSelection=null,this.ctx.updateHelpers=null,this.ctx.toolbar=null,this.ctx.localization=null,this.ctx.w.globals.tooltip=null,this.clearDomElements({isUpdating:p})}},{key:"killSVG",value:function(h){h.each(function(){this.removeClass("*"),this.off(),this.stop()},!0),h.ungroup(),h.clear()}},{key:"clearDomElements",value:function(h){var p=this,S=h.isUpdating,_=this.w.globals.dom.Paper.node;_.parentNode&&_.parentNode.parentNode&&!S&&(_.parentNode.parentNode.style.minHeight="unset");var k=this.w.globals.dom.baseEl;k&&this.ctx.eventList.forEach(function(B){k.removeEventListener(B,p.ctx.events.documentEvent)});var T=this.w.globals.dom;if(this.ctx.el!==null)for(;this.ctx.el.firstChild;)this.ctx.el.removeChild(this.ctx.el.firstChild);this.killSVG(T.Paper),T.Paper.remove(),T.elWrap=null,T.elGraphical=null,T.elLegendWrap=null,T.elLegendForeign=null,T.baseEl=null,T.elGridRect=null,T.elGridRectMask=null,T.elGridRectBarMask=null,T.elGridRectMarkerMask=null,T.elForecastMask=null,T.elNonForecastMask=null,T.elDefs=null}}]),Ee}(),Lt=new WeakMap,jn=function(){function Ee(h,p){s(this,Ee),this.opts=p,this.ctx=this,this.w=new ge(p).init(),this.el=h,this.w.globals.cuid=F.randomId(),this.w.globals.chartID=this.w.config.chart.id?F.escapeString(this.w.config.chart.id):this.w.globals.cuid,new zn(this).initModules(),this.create=F.bind(this.create,this),this.windowResizeHandler=this._windowResizeHandler.bind(this),this.parentResizeHandler=this._parentResizeCallback.bind(this)}return o(Ee,[{key:"render",value:function(){var h=this;return new Promise(function(p,S){if(h.el!==null){Apex._chartInstances===void 0&&(Apex._chartInstances=[]),h.w.config.chart.id&&Apex._chartInstances.push({id:h.w.globals.chartID,group:h.w.config.chart.group,chart:h}),h.setLocale(h.w.config.chart.defaultLocale);var _=h.w.config.chart.events.beforeMount;typeof _=="function"&&_(h,h.w),h.events.fireEvent("beforeMount",[h,h.w]),window.addEventListener("resize",h.windowResizeHandler),function(xe,Se){var ke=!1;if(xe.nodeType!==Node.DOCUMENT_FRAGMENT_NODE){var Re=xe.getBoundingClientRect();xe.style.display!=="none"&&Re.width!==0||(ke=!0)}var Ge=new ResizeObserver(function(Fe){ke&&Se.call(xe,Fe),ke=!0});xe.nodeType===Node.DOCUMENT_FRAGMENT_NODE?Array.from(xe.children).forEach(function(Fe){return Ge.observe(Fe)}):Ge.observe(xe),Lt.set(Se,Ge)}(h.el.parentNode,h.parentResizeHandler);var k=h.el.getRootNode&&h.el.getRootNode(),T=F.is("ShadowRoot",k),B=h.el.ownerDocument,q=T?k.getElementById("apexcharts-css"):B.getElementById("apexcharts-css");if(!q){var te;(q=document.createElement("style")).id="apexcharts-css",q.textContent=`@keyframes opaque {
0% {
opacity: 0
}
to {
opacity: 1
}
}
@keyframes resizeanim {
0%,
to {
opacity: 0
}
}
.apexcharts-canvas {
position: relative;
direction: ltr !important;
user-select: none
}
.apexcharts-canvas ::-webkit-scrollbar {
-webkit-appearance: none;
width: 6px
}
.apexcharts-canvas ::-webkit-scrollbar-thumb {
border-radius: 4px;
background-color: rgba(0, 0, 0, .5);
box-shadow: 0 0 1px rgba(255, 255, 255, .5);
-webkit-box-shadow: 0 0 1px rgba(255, 255, 255, .5)
}
.apexcharts-inner {
position: relative
}
.apexcharts-text tspan {
font-family: inherit
}
rect.legend-mouseover-inactive,
.legend-mouseover-inactive rect,
.legend-mouseover-inactive path,
.legend-mouseover-inactive circle,
.legend-mouseover-inactive line,
.legend-mouseover-inactive text.apexcharts-yaxis-title-text,
.legend-mouseover-inactive text.apexcharts-yaxis-label {
transition: .15s ease all;
opacity: .2
}
.apexcharts-legend-text {
padding-left: 15px;
margin-left: -15px;
}
.apexcharts-series-collapsed {
opacity: 0
}
.apexcharts-tooltip {
border-radius: 5px;
box-shadow: 2px 2px 6px -4px #999;
cursor: default;
font-size: 14px;
left: 62px;
opacity: 0;
pointer-events: none;
position: absolute;
top: 20px;
display: flex;
flex-direction: column;
overflow: hidden;
white-space: nowrap;
z-index: 12;
transition: .15s ease all
}
.apexcharts-tooltip.apexcharts-active {
opacity: 1;
transition: .15s ease all
}
.apexcharts-tooltip.apexcharts-theme-light {
border: 1px solid #e3e3e3;
background: rgba(255, 255, 255, .96)
}
.apexcharts-tooltip.apexcharts-theme-dark {
color: #fff;
background: rgba(30, 30, 30, .8)
}
.apexcharts-tooltip * {
font-family: inherit
}
.apexcharts-tooltip-title {
padding: 6px;
font-size: 15px;
margin-bottom: 4px
}
.apexcharts-tooltip.apexcharts-theme-light .apexcharts-tooltip-title {
background: #eceff1;
border-bottom: 1px solid #ddd
}
.apexcharts-tooltip.apexcharts-theme-dark .apexcharts-tooltip-title {
background: rgba(0, 0, 0, .7);
border-bottom: 1px solid #333
}
.apexcharts-tooltip-text-goals-value,
.apexcharts-tooltip-text-y-value,
.apexcharts-tooltip-text-z-value {
display: inline-block;
margin-left: 5px;
font-weight: 600
}
.apexcharts-tooltip-text-goals-label:empty,
.apexcharts-tooltip-text-goals-value:empty,
.apexcharts-tooltip-text-y-label:empty,
.apexcharts-tooltip-text-y-value:empty,
.apexcharts-tooltip-text-z-value:empty,
.apexcharts-tooltip-title:empty {
display: none
}
.apexcharts-tooltip-text-goals-label,
.apexcharts-tooltip-text-goals-value {
padding: 6px 0 5px
}
.apexcharts-tooltip-goals-group,
.apexcharts-tooltip-text-goals-label,
.apexcharts-tooltip-text-goals-value {
display: flex
}
.apexcharts-tooltip-text-goals-label:not(:empty),
.apexcharts-tooltip-text-goals-value:not(:empty) {
margin-top: -6px
}
.apexcharts-tooltip-marker {
width: 12px;
height: 12px;
position: relative;
top: 0;
margin-right: 10px;
border-radius: 50%
}
.apexcharts-tooltip-series-group {
padding: 0 10px;
display: none;
text-align: left;
justify-content: left;
align-items: center
}
.apexcharts-tooltip-series-group.apexcharts-active .apexcharts-tooltip-marker {
opacity: 1
}
.apexcharts-tooltip-series-group.apexcharts-active,
.apexcharts-tooltip-series-group:last-child {
padding-bottom: 4px
}
.apexcharts-tooltip-y-group {
padding: 6px 0 5px
}
.apexcharts-custom-tooltip,
.apexcharts-tooltip-box {
padding: 4px 8px
}
.apexcharts-tooltip-boxPlot {
display: flex;
flex-direction: column-reverse
}
.apexcharts-tooltip-box>div {
margin: 4px 0
}
.apexcharts-tooltip-box span.value {
font-weight: 700
}
.apexcharts-tooltip-rangebar {
padding: 5px 8px
}
.apexcharts-tooltip-rangebar .category {
font-weight: 600;
color: #777
}
.apexcharts-tooltip-rangebar .series-name {
font-weight: 700;
display: block;
margin-bottom: 5px
}
.apexcharts-xaxistooltip,
.apexcharts-yaxistooltip {
opacity: 0;
pointer-events: none;
color: #373d3f;
font-size: 13px;
text-align: center;
border-radius: 2px;
position: absolute;
z-index: 10;
background: #eceff1;
border: 1px solid #90a4ae
}
.apexcharts-xaxistooltip {
padding: 9px 10px;
transition: .15s ease all
}
.apexcharts-xaxistooltip.apexcharts-theme-dark {
background: rgba(0, 0, 0, .7);
border: 1px solid rgba(0, 0, 0, .5);
color: #fff
}
.apexcharts-xaxistooltip:after,
.apexcharts-xaxistooltip:before {
left: 50%;
border: solid transparent;
content: " ";
height: 0;
width: 0;
position: absolute;
pointer-events: none
}
.apexcharts-xaxistooltip:after {
border-color: transparent;
border-width: 6px;
margin-left: -6px
}
.apexcharts-xaxistooltip:before {
border-color: transparent;
border-width: 7px;
margin-left: -7px
}
.apexcharts-xaxistooltip-bottom:after,
.apexcharts-xaxistooltip-bottom:before {
bottom: 100%
}
.apexcharts-xaxistooltip-top:after,
.apexcharts-xaxistooltip-top:before {
top: 100%
}
.apexcharts-xaxistooltip-bottom:after {
border-bottom-color: #eceff1
}
.apexcharts-xaxistooltip-bottom:before {
border-bottom-color: #90a4ae
}
.apexcharts-xaxistooltip-bottom.apexcharts-theme-dark:after,
.apexcharts-xaxistooltip-bottom.apexcharts-theme-dark:before {
border-bottom-color: rgba(0, 0, 0, .5)
}
.apexcharts-xaxistooltip-top:after {
border-top-color: #eceff1
}
.apexcharts-xaxistooltip-top:before {
border-top-color: #90a4ae
}
.apexcharts-xaxistooltip-top.apexcharts-theme-dark:after,
.apexcharts-xaxistooltip-top.apexcharts-theme-dark:before {
border-top-color: rgba(0, 0, 0, .5)
}
.apexcharts-xaxistooltip.apexcharts-active {
opacity: 1;
transition: .15s ease all
}
.apexcharts-yaxistooltip {
padding: 4px 10px
}
.apexcharts-yaxistooltip.apexcharts-theme-dark {
background: rgba(0, 0, 0, .7);
border: 1px solid rgba(0, 0, 0, .5);
color: #fff
}
.apexcharts-yaxistooltip:after,
.apexcharts-yaxistooltip:before {
top: 50%;
border: solid transparent;
content: " ";
height: 0;
width: 0;
position: absolute;
pointer-events: none
}
.apexcharts-yaxistooltip:after {
border-color: transparent;
border-width: 6px;
margin-top: -6px
}
.apexcharts-yaxistooltip:before {
border-color: transparent;
border-width: 7px;
margin-top: -7px
}
.apexcharts-yaxistooltip-left:after,
.apexcharts-yaxistooltip-left:before {
left: 100%
}
.apexcharts-yaxistooltip-right:after,
.apexcharts-yaxistooltip-right:before {
right: 100%
}
.apexcharts-yaxistooltip-left:after {
border-left-color: #eceff1
}
.apexcharts-yaxistooltip-left:before {
border-left-color: #90a4ae
}
.apexcharts-yaxistooltip-left.apexcharts-theme-dark:after,
.apexcharts-yaxistooltip-left.apexcharts-theme-dark:before {
border-left-color: rgba(0, 0, 0, .5)
}
.apexcharts-yaxistooltip-right:after {
border-right-color: #eceff1
}
.apexcharts-yaxistooltip-right:before {
border-right-color: #90a4ae
}
.apexcharts-yaxistooltip-right.apexcharts-theme-dark:after,
.apexcharts-yaxistooltip-right.apexcharts-theme-dark:before {
border-right-color: rgba(0, 0, 0, .5)
}
.apexcharts-yaxistooltip.apexcharts-active {
opacity: 1
}
.apexcharts-yaxistooltip-hidden {
display: none
}
.apexcharts-xcrosshairs,
.apexcharts-ycrosshairs {
pointer-events: none;
opacity: 0;
transition: .15s ease all
}
.apexcharts-xcrosshairs.apexcharts-active,
.apexcharts-ycrosshairs.apexcharts-active {
opacity: 1;
transition: .15s ease all
}
.apexcharts-ycrosshairs-hidden {
opacity: 0
}
.apexcharts-selection-rect {
cursor: move
}
.svg_select_boundingRect,
.svg_select_points_rot {
pointer-events: none;
opacity: 0;
visibility: hidden
}
.apexcharts-selection-rect+g .svg_select_boundingRect,
.apexcharts-selection-rect+g .svg_select_points_rot {
opacity: 0;
visibility: hidden
}
.apexcharts-selection-rect+g .svg_select_points_l,
.apexcharts-selection-rect+g .svg_select_points_r {
cursor: ew-resize;
opacity: 1;
visibility: visible
}
.svg_select_points {
fill: #efefef;
stroke: #333;
rx: 2
}
.apexcharts-svg.apexcharts-zoomable.hovering-zoom {
cursor: crosshair
}
.apexcharts-svg.apexcharts-zoomable.hovering-pan {
cursor: move
}
.apexcharts-menu-icon,
.apexcharts-pan-icon,
.apexcharts-reset-icon,
.apexcharts-selection-icon,
.apexcharts-toolbar-custom-icon,
.apexcharts-zoom-icon,
.apexcharts-zoomin-icon,
.apexcharts-zoomout-icon {
cursor: pointer;
width: 20px;
height: 20px;
line-height: 24px;
color: #6e8192;
text-align: center
}
.apexcharts-menu-icon svg,
.apexcharts-reset-icon svg,
.apexcharts-zoom-icon svg,
.apexcharts-zoomin-icon svg,
.apexcharts-zoomout-icon svg {
fill: #6e8192
}
.apexcharts-selection-icon svg {
fill: #444;
transform: scale(.76)
}
.apexcharts-theme-dark .apexcharts-menu-icon svg,
.apexcharts-theme-dark .apexcharts-pan-icon svg,
.apexcharts-theme-dark .apexcharts-reset-icon svg,
.apexcharts-theme-dark .apexcharts-selection-icon svg,
.apexcharts-theme-dark .apexcharts-toolbar-custom-icon svg,
.apexcharts-theme-dark .apexcharts-zoom-icon svg,
.apexcharts-theme-dark .apexcharts-zoomin-icon svg,
.apexcharts-theme-dark .apexcharts-zoomout-icon svg {
fill: #f3f4f5
}
.apexcharts-canvas .apexcharts-reset-zoom-icon.apexcharts-selected svg,
.apexcharts-canvas .apexcharts-selection-icon.apexcharts-selected svg,
.apexcharts-canvas .apexcharts-zoom-icon.apexcharts-selected svg {
fill: #008ffb
}
.apexcharts-theme-light .apexcharts-menu-icon:hover svg,
.apexcharts-theme-light .apexcharts-reset-icon:hover svg,
.apexcharts-theme-light .apexcharts-selection-icon:not(.apexcharts-selected):hover svg,
.apexcharts-theme-light .apexcharts-zoom-icon:not(.apexcharts-selected):hover svg,
.apexcharts-theme-light .apexcharts-zoomin-icon:hover svg,
.apexcharts-theme-light .apexcharts-zoomout-icon:hover svg {
fill: #333
}
.apexcharts-menu-icon,
.apexcharts-selection-icon {
position: relative
}
.apexcharts-reset-icon {
margin-left: 5px
}
.apexcharts-menu-icon,
.apexcharts-reset-icon,
.apexcharts-zoom-icon {
transform: scale(.85)
}
.apexcharts-zoomin-icon,
.apexcharts-zoomout-icon {
transform: scale(.7)
}
.apexcharts-zoomout-icon {
margin-right: 3px
}
.apexcharts-pan-icon {
transform: scale(.62);
position: relative;
left: 1px;
top: 0
}
.apexcharts-pan-icon svg {
fill: #fff;
stroke: #6e8192;
stroke-width: 2
}
.apexcharts-pan-icon.apexcharts-selected svg {
stroke: #008ffb
}
.apexcharts-pan-icon:not(.apexcharts-selected):hover svg {
stroke: #333
}
.apexcharts-toolbar {
position: absolute;
z-index: 11;
max-width: 176px;
text-align: right;
border-radius: 3px;
padding: 0 6px 2px;
display: flex;
justify-content: space-between;
align-items: center
}
.apexcharts-menu {
background: #fff;
position: absolute;
top: 100%;
border: 1px solid #ddd;
border-radius: 3px;
padding: 3px;
right: 10px;
opacity: 0;
min-width: 110px;
transition: .15s ease all;
pointer-events: none
}
.apexcharts-menu.apexcharts-menu-open {
opacity: 1;
pointer-events: all;
transition: .15s ease all
}
.apexcharts-menu-item {
padding: 6px 7px;
font-size: 12px;
cursor: pointer
}
.apexcharts-theme-light .apexcharts-menu-item:hover {
background: #eee
}
.apexcharts-theme-dark .apexcharts-menu {
background: rgba(0, 0, 0, .7);
color: #fff
}
@media screen and (min-width:768px) {
.apexcharts-canvas:hover .apexcharts-toolbar {
opacity: 1
}
}
.apexcharts-canvas .apexcharts-element-hidden,
.apexcharts-datalabel.apexcharts-element-hidden,
.apexcharts-hide .apexcharts-series-points {
opacity: 0;
}
.apexcharts-hidden-element-shown {
opacity: 1;
transition: 0.25s ease all;
}
.apexcharts-datalabel,
.apexcharts-datalabel-label,
.apexcharts-datalabel-value,
.apexcharts-datalabels,
.apexcharts-pie-label {
cursor: default;
pointer-events: none
}
.apexcharts-pie-label-delay {
opacity: 0;
animation-name: opaque;
animation-duration: .3s;
animation-fill-mode: forwards;
animation-timing-function: ease
}
.apexcharts-radialbar-label {
cursor: pointer;
}
.apexcharts-annotation-rect,
.apexcharts-area-series .apexcharts-area,
.apexcharts-area-series .apexcharts-series-markers .apexcharts-marker.no-pointer-events,
.apexcharts-gridline,
.apexcharts-line,
.apexcharts-line-series .apexcharts-series-markers .apexcharts-marker.no-pointer-events,
.apexcharts-point-annotation-label,
.apexcharts-radar-series path:not(.apexcharts-marker),
.apexcharts-radar-series polygon,
.apexcharts-toolbar svg,
.apexcharts-tooltip .apexcharts-marker,
.apexcharts-xaxis-annotation-label,
.apexcharts-yaxis-annotation-label,
.apexcharts-zoom-rect {
pointer-events: none
}
.apexcharts-tooltip-active .apexcharts-marker {
transition: .15s ease all
}
.resize-triggers {
animation: 1ms resizeanim;
visibility: hidden;
opacity: 0;
height: 100%;
width: 100%;
overflow: hidden
}
.contract-trigger:before,
.resize-triggers,
.resize-triggers>div {
content: " ";
display: block;
position: absolute;
top: 0;
left: 0
}
.resize-triggers>div {
height: 100%;
width: 100%;
background: #eee;
overflow: auto
}
.contract-trigger:before {
overflow: hidden;
width: 200%;
height: 200%
}
.apexcharts-bar-goals-markers {
pointer-events: none
}
.apexcharts-bar-shadows {
pointer-events: none
}
.apexcharts-rangebar-goals-markers {
pointer-events: none
}
`;var ue=((te=h.opts.chart)===null||te===void 0?void 0:te.nonce)||h.w.config.chart.nonce;ue&&q.setAttribute("nonce",ue),T?k.prepend(q):B.head.appendChild(q)}var de=h.create(h.w.config.series,{});if(!de)return p(h);h.mount(de).then(function(){typeof h.w.config.chart.events.mounted=="function"&&h.w.config.chart.events.mounted(h,h.w),h.events.fireEvent("mounted",[h,h.w]),p(de)}).catch(function(xe){S(xe)})}else S(new Error("Element not found"))})}},{key:"create",value:function(h,p){var S=this,_=this.w;new zn(this).initModules();var k=this.w.globals;if(k.noData=!1,k.animationEnded=!1,this.responsive.checkResponsiveConfig(p),_.config.xaxis.convertedCatToNumeric&&new fe(_.config).convertCatToNumericXaxis(_.config,this.ctx),this.el===null||(this.core.setupElements(),_.config.chart.type==="treemap"&&(_.config.grid.show=!1,_.config.yaxis[0].show=!1),k.svgWidth===0))return k.animationEnded=!0,null;var T=h;h.forEach(function(xe,Se){xe.hidden&&(T=S.legend.legendHelpers.getSeriesAfterCollapsing({realIndex:Se}))});var B=Q.checkComboSeries(T,_.config.chart.type);k.comboCharts=B.comboCharts,k.comboBarCount=B.comboBarCount;var q=T.every(function(xe){return xe.data&&xe.data.length===0});(T.length===0||q&&k.collapsedSeries.length<1)&&this.series.handleNoData(),this.events.setupEventHandlers(),this.data.parseData(T),this.theme.init(),new ve(this).setGlobalMarkerSize(),this.formatters.setLabelFormatters(),this.titleSubtitle.draw(),k.noData&&k.collapsedSeries.length!==k.series.length&&!_.config.legend.showForSingleSeries||this.legend.init(),this.series.hasAllSeriesEqualX(),k.axisCharts&&(this.core.coreCalculations(),_.config.xaxis.type!=="category"&&this.formatters.setLabelFormatters(),this.ctx.toolbar.minX=_.globals.minX,this.ctx.toolbar.maxX=_.globals.maxX),this.formatters.heatmapLabelFormatters(),new Q(this).getLargestMarkerSize(),this.dimensions.plotCoords();var te=this.core.xySettings();this.grid.createGridMask();var ue=this.core.plotChartType(T,te),de=new Ie(this);return de.bringForward(),_.config.dataLabels.background.enabled&&de.dataLabelsBackground(),this.core.shiftGraphPosition(),{elGraph:ue,xyRatios:te,dimensions:{plot:{left:_.globals.translateX,top:_.globals.translateY,width:_.globals.gridWidth,height:_.globals.gridHeight}}}}},{key:"mount",value:function(){var h=this,p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,S=this,_=S.w;return new Promise(function(k,T){if(S.el===null)return T(new Error("Not enough data to display or target element not found"));(p===null||_.globals.allSeriesCollapsed)&&S.series.handleNoData(),S.grid=new tt(S);var B,q,te=S.grid.drawGrid();if(S.annotations=new V(S),S.annotations.drawImageAnnos(),S.annotations.drawTextAnnos(),_.config.grid.position==="back"&&(te&&_.globals.dom.elGraphical.add(te.el),te!=null&&(B=te.elGridBorders)!==null&&B!==void 0&&B.node&&_.globals.dom.elGraphical.add(te.elGridBorders)),Array.isArray(p.elGraph))for(var ue=0;ue<p.elGraph.length;ue++)_.globals.dom.elGraphical.add(p.elGraph[ue]);else _.globals.dom.elGraphical.add(p.elGraph);_.config.grid.position==="front"&&(te&&_.globals.dom.elGraphical.add(te.el),te!=null&&(q=te.elGridBorders)!==null&&q!==void 0&&q.node&&_.globals.dom.elGraphical.add(te.elGridBorders)),_.config.xaxis.crosshairs.position==="front"&&S.crosshairs.drawXCrosshairs(),_.config.yaxis[0].crosshairs.position==="front"&&S.crosshairs.drawYCrosshairs(),_.config.chart.type!=="treemap"&&S.axes.drawAxis(_.config.chart.type,te);var de=new it(h.ctx,te),xe=new ut(h.ctx,te);if(te!==null&&(de.xAxisLabelCorrections(te.xAxisTickWidth),xe.setYAxisTextAlignments(),_.config.yaxis.map(function(ke,Re){_.globals.ignoreYAxisIndexes.indexOf(Re)===-1&&xe.yAxisTitleRotate(Re,ke.opposite)})),S.annotations.drawAxesAnnotations(),!_.globals.noData){if(_.config.tooltip.enabled&&!_.globals.noData&&S.w.globals.tooltip.drawTooltip(p.xyRatios),_.globals.axisCharts&&(_.globals.isXNumeric||_.config.xaxis.convertedCatToNumeric||_.globals.isRangeBar))(_.config.chart.zoom.enabled||_.config.chart.selection&&_.config.chart.selection.enabled||_.config.chart.pan&&_.config.chart.pan.enabled)&&S.zoomPanSelection.init({xyRatios:p.xyRatios});else{var Se=_.config.chart.toolbar.tools;["zoom","zoomin","zoomout","selection","pan","reset"].forEach(function(ke){Se[ke]=!1})}_.config.chart.toolbar.show&&!_.globals.allSeriesCollapsed&&S.toolbar.createToolbar()}_.globals.memory.methodsToExec.length>0&&_.globals.memory.methodsToExec.forEach(function(ke){ke.method(ke.params,!1,ke.context)}),_.globals.axisCharts||_.globals.noData||S.core.resizeNonAxisCharts(),k(S)})}},{key:"destroy",value:function(){var h,p;window.removeEventListener("resize",this.windowResizeHandler),this.el.parentNode,h=this.parentResizeHandler,(p=Lt.get(h))&&(p.disconnect(),Lt.delete(h));var S=this.w.config.chart.id;S&&Apex._chartInstances.forEach(function(_,k){_.id===F.escapeString(S)&&Apex._chartInstances.splice(k,1)}),new Jn(this.ctx).clear({isUpdating:!1})}},{key:"updateOptions",value:function(h){var p=this,S=arguments.length>1&&arguments[1]!==void 0&&arguments[1],_=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2],k=!(arguments.length>3&&arguments[3]!==void 0)||arguments[3],T=!(arguments.length>4&&arguments[4]!==void 0)||arguments[4],B=this.w;return B.globals.selection=void 0,h.series&&(this.series.resetSeries(!1,!0,!1),h.series.length&&h.series[0].data&&(h.series=h.series.map(function(q,te){return p.updateHelpers._extendSeries(q,te)})),this.updateHelpers.revertDefaultAxisMinMax()),h.xaxis&&(h=this.updateHelpers.forceXAxisUpdate(h)),h.yaxis&&(h=this.updateHelpers.forceYAxisUpdate(h)),B.globals.collapsedSeriesIndices.length>0&&this.series.clearPreviousPaths(),h.theme&&(h=this.theme.updateThemeOptions(h)),this.updateHelpers._updateOptions(h,S,_,k,T)}},{key:"updateSeries",value:function(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],p=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],S=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2];return this.series.resetSeries(!1),this.updateHelpers.revertDefaultAxisMinMax(),this.updateHelpers._updateSeries(h,p,S)}},{key:"appendSeries",value:function(h){var p=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],S=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2],_=this.w.config.series.slice();return _.push(h),this.series.resetSeries(!1),this.updateHelpers.revertDefaultAxisMinMax(),this.updateHelpers._updateSeries(_,p,S)}},{key:"appendData",value:function(h){var p=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],S=this;S.w.globals.dataChanged=!0,S.series.getPreviousPaths();for(var _=S.w.config.series.slice(),k=0;k<_.length;k++)if(h[k]!==null&&h[k]!==void 0)for(var T=0;T<h[k].data.length;T++)_[k].data.push(h[k].data[T]);return S.w.config.series=_,p&&(S.w.globals.initialSeries=F.clone(S.w.config.series)),this.update()}},{key:"update",value:function(h){var p=this;return new Promise(function(S,_){new Jn(p.ctx).clear({isUpdating:!0});var k=p.create(p.w.config.series,h);if(!k)return S(p);p.mount(k).then(function(){typeof p.w.config.chart.events.updated=="function"&&p.w.config.chart.events.updated(p,p.w),p.events.fireEvent("updated",[p,p.w]),p.w.globals.isDirty=!0,S(p)}).catch(function(T){_(T)})})}},{key:"getSyncedCharts",value:function(){var h=this.getGroupedCharts(),p=[this];return h.length&&(p=[],h.forEach(function(S){p.push(S)})),p}},{key:"getGroupedCharts",value:function(){var h=this;return Apex._chartInstances.filter(function(p){if(p.group)return!0}).map(function(p){return h.w.config.chart.group===p.group?p.chart:h})}},{key:"toggleSeries",value:function(h){return this.series.toggleSeries(h)}},{key:"highlightSeriesOnLegendHover",value:function(h,p){return this.series.toggleSeriesOnHover(h,p)}},{key:"showSeries",value:function(h){this.series.showSeries(h)}},{key:"hideSeries",value:function(h){this.series.hideSeries(h)}},{key:"highlightSeries",value:function(h){this.series.highlightSeries(h)}},{key:"isSeriesHidden",value:function(h){this.series.isSeriesHidden(h)}},{key:"resetSeries",value:function(){var h=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0],p=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];this.series.resetSeries(h,p)}},{key:"addEventListener",value:function(h,p){this.events.addEventListener(h,p)}},{key:"removeEventListener",value:function(h,p){this.events.removeEventListener(h,p)}},{key:"addXaxisAnnotation",value:function(h){var p=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],S=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0,_=this;S&&(_=S),_.annotations.addXaxisAnnotationExternal(h,p,_)}},{key:"addYaxisAnnotation",value:function(h){var p=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],S=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0,_=this;S&&(_=S),_.annotations.addYaxisAnnotationExternal(h,p,_)}},{key:"addPointAnnotation",value:function(h){var p=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],S=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0,_=this;S&&(_=S),_.annotations.addPointAnnotationExternal(h,p,_)}},{key:"clearAnnotations",value:function(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:void 0,p=this;h&&(p=h),p.annotations.clearAnnotations(p)}},{key:"removeAnnotation",value:function(h){var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:void 0,S=this;p&&(S=p),S.annotations.removeAnnotation(S,h)}},{key:"getChartArea",value:function(){return this.w.globals.dom.baseEl.querySelector(".apexcharts-inner")}},{key:"getSeriesTotalXRange",value:function(h,p){return this.coreUtils.getSeriesTotalsXRange(h,p)}},{key:"getHighestValueInSeries",value:function(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return new ft(this.ctx).getMinYMaxY(h).highestY}},{key:"getLowestValueInSeries",value:function(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return new ft(this.ctx).getMinYMaxY(h).lowestY}},{key:"getSeriesTotal",value:function(){return this.w.globals.seriesTotals}},{key:"toggleDataPointSelection",value:function(h,p){return this.updateHelpers.toggleDataPointSelection(h,p)}},{key:"zoomX",value:function(h,p){this.ctx.toolbar.zoomUpdateOptions(h,p)}},{key:"setLocale",value:function(h){this.localization.setCurrentLocaleValues(h)}},{key:"dataURI",value:function(h){return new $e(this.ctx).dataURI(h)}},{key:"exportToCSV",value:function(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return new $e(this.ctx).exportToCSV(h)}},{key:"paper",value:function(){return this.w.globals.dom.Paper}},{key:"_parentResizeCallback",value:function(){this.w.globals.animationEnded&&this.w.config.chart.redrawOnParentResize&&this._windowResize()}},{key:"_windowResize",value:function(){var h=this;clearTimeout(this.w.globals.resizeTimer),this.w.globals.resizeTimer=window.setTimeout(function(){h.w.globals.resized=!0,h.w.globals.dataChanged=!1,h.ctx.update()},150)}},{key:"_windowResizeHandler",value:function(){var h=this.w.config.chart.redrawOnWindowResize;typeof h=="function"&&(h=h()),h&&this._windowResize()}}],[{key:"getChartByID",value:function(h){var p=F.escapeString(h);if(Apex._chartInstances){var S=Apex._chartInstances.filter(function(_){return _.id===p})[0];return S&&S.chart}}},{key:"initOnLoad",value:function(){for(var h=document.querySelectorAll("[data-apexcharts]"),p=0;p<h.length;p++)new Ee(h[p],JSON.parse(h[p].getAttribute("data-options"))).render()}},{key:"exec",value:function(h,p){var S=this.getChartByID(h);if(S){S.w.globals.isExecCalled=!0;var _=null;if(S.publicMethods.indexOf(p)!==-1){for(var k=arguments.length,T=new Array(k>2?k-2:0),B=2;B<k;B++)T[B-2]=arguments[B];_=S[p].apply(S,T)}return _}}},{key:"merge",value:function(h,p){return F.extend(h,p)}}]),Ee}();e.exports=jn}(BP,BP.exports)),BP.exports}var fCe;function Zsn(){if(fCe)return DP;fCe=1,Object.defineProperty(DP,"__esModule",{value:!0});var e=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(C){return typeof C}:function(C){return C&&typeof Symbol=="function"&&C.constructor===Symbol&&C!==Symbol.prototype?"symbol":typeof C},t=Object.assign||function(C){for(var N=1;N<arguments.length;N++){var P,I=arguments[N];for(P in I)Object.prototype.hasOwnProperty.call(I,P)&&(C[P]=I[P])}return C},n=function(){function C(N,P){for(var I=0;I<P.length;I++){var R=P[I];R.enumerable=R.enumerable||!1,R.configurable=!0,"value"in R&&(R.writable=!0),Object.defineProperty(N,R.key,R)}}return function(N,P,I){return P&&C(N.prototype,P),I&&C(N,I),N}}(),r=Qsn(),s=u(r),a=ax(),o=u(a),l=_$(),c=u(l);function u(C){return C&&C.__esModule?C:{default:C}}function d(C,N,P){return N in C?Object.defineProperty(C,N,{value:P,enumerable:!0,configurable:!0,writable:!0}):C[N]=P,C}function f(C,N){var P,I={};for(P in C)0<=N.indexOf(P)||Object.prototype.hasOwnProperty.call(C,P)&&(I[P]=C[P]);return I}function x(C,N){if(!(C instanceof N))throw new TypeError("Cannot call a class as a function")}function g(C,N){if(C)return!N||typeof N!="object"&&typeof N!="function"?C:N;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}function v(C,N){if(typeof N!="function"&&N!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof N);C.prototype=Object.create(N&&N.prototype,{constructor:{value:C,enumerable:!1,writable:!0,configurable:!0}}),N&&(Object.setPrototypeOf?Object.setPrototypeOf(C,N):C.__proto__=N)}window.ApexCharts=s.default;var w=function(){function C(N){x(this,C);var P=g(this,(C.__proto__||Object.getPrototypeOf(C)).call(this,N));return o.default.createRef?P.chartRef=o.default.createRef():P.setRef=function(I){return P.chartRef=I},P.chart=null,P}return v(C,a.Component),n(C,[{key:"render",value:function(){var N=f(this.props,[]);return o.default.createElement("div",t({ref:o.default.createRef?this.chartRef:this.setRef},N))}},{key:"componentDidMount",value:function(){var N=o.default.createRef?this.chartRef.current:this.chartRef;this.chart=new s.default(N,this.getConfig()),this.chart.render()}},{key:"getConfig",value:function(){var F=this.props,N=F.type,P=F.height,I=F.width,R=F.series,F=F.options;return this.extend(F,{chart:{type:N,height:P,width:I},series:R})}},{key:"isObject",value:function(N){return N&&(N===void 0?"undefined":e(N))==="object"&&!Array.isArray(N)&&N!=null}},{key:"extend",value:function(N,P){var I=this,R=(typeof Object.assign!="function"&&(Object.assign=function(F){if(F==null)throw new TypeError("Cannot convert undefined or null to object");for(var U=Object(F),L=1;L<arguments.length;L++){var z=arguments[L];if(z!=null)for(var Q in z)z.hasOwnProperty(Q)&&(U[Q]=z[Q])}return U}),Object.assign({},N));return this.isObject(N)&&this.isObject(P)&&Object.keys(P).forEach(function(F){I.isObject(P[F])&&F in N?R[F]=I.extend(N[F],P[F]):Object.assign(R,d({},F,P[F]))}),R}},{key:"componentDidUpdate",value:function(N){if(!this.chart)return null;var R=this.props,L=R.options,P=R.series,I=R.height,R=R.width,F=JSON.stringify(N.options),U=JSON.stringify(N.series),L=JSON.stringify(L),z=JSON.stringify(P);F===L&&U===z&&I===N.height&&R===N.width||(U!==z&&F===L&&I===N.height&&R===N.width?this.chart.updateSeries(P):this.chart.updateOptions(this.getConfig()))}},{key:"componentWillUnmount",value:function(){this.chart&&typeof this.chart.destroy=="function"&&this.chart.destroy()}}]),C}();return(DP.default=w).propTypes={type:c.default.string.isRequired,width:c.default.oneOfType([c.default.string,c.default.number]),height:c.default.oneOfType([c.default.string,c.default.number]),series:c.default.array.isRequired,options:c.default.object.isRequired},w.defaultProps={type:"line",width:"100%",height:"auto"},DP}var Jsn=Zsn();const VL=Ti(Jsn),ein=()=>{const[e,t]=m.useState([]),[n,r]=m.useState(localStorage.getItem("discover_period")==0?"day":localStorage.getItem("discover_period")==1?"week":localStorage.getItem("discover_period")==2?"month":localStorage.getItem("discover_period")==3?"threeMonth":"allTime"),[s,a]=m.useState("pnlHistory"),[o,l]=m.useState("perp only"),c=t5(),u=(c==null?void 0:c.walletAddress)||"",d=n==="day",{setLatestPnL:f}=m.useContext(Qr);m.useEffect(()=>{const v=async()=>{var N,P,I,R,F,U,L,z,Q,ne,J,X,re,pe,Y,ie,oe,G,V,ee,ae,fe,Ne;const C=o==="combined"?n:`perp${n.charAt(0).toUpperCase()+n.slice(1)}`;try{const ge=(await fs.post("https://api-ui.hyperliquid.xyz/info",{type:"portfolio",user:u},{headers:{Accept:"*/*","Content-Type":"application/json"}})).data,ve=Date.now()-90*24*60*60*1e3,je=(ht,Zt=!1)=>{const zt=(ht==null?void 0:ht.filter(([Et])=>Number(Et)>=ve))||[];if(Zt&&zt.length>0){const Et=parseFloat(zt[0][1]);return zt.map(([nt,Ue])=>[nt,(parseFloat(Ue)-Et).toString()])}return zt},Ie=ge.find(ht=>ht[0]==="allTime"),Le=ge.find(ht=>ht[0]==="perpAllTime"),Qe={accountValueHistory:je((N=Ie==null?void 0:Ie[1])==null?void 0:N.accountValueHistory,!1),pnlHistory:je((P=Ie==null?void 0:Ie[1])==null?void 0:P.pnlHistory,!0),vlm:(I=Ie==null?void 0:Ie[1])==null?void 0:I.vlm},$e={accountValueHistory:je((R=Le==null?void 0:Le[1])==null?void 0:R.accountValueHistory,!1),pnlHistory:je((F=Le==null?void 0:Le[1])==null?void 0:F.pnlHistory,!0),vlm:(U=Le==null?void 0:Le[1])==null?void 0:U.vlm},it=[...ge,["threeMonth",Qe],["perpThreeMonth",$e]],tt=((z=(L=it.find(ht=>ht[0]===C))==null?void 0:L[1])==null?void 0:z[s])||[];t(tt);const lt=o==="combined"?"day":"perpDay",ft=o==="combined"?"week":"perpWeek",ut=o==="combined"?"month":"perpMonth",qt=o==="combined"?"allTime":"perpAllTime",It=o==="combined"?"threeMonth":"perpThreeMonth",nn=((ne=(Q=it.find(ht=>ht[0]===lt))==null?void 0:Q[1])==null?void 0:ne.pnlHistory)||[],jt=((X=(J=it.find(ht=>ht[0]===ft))==null?void 0:J[1])==null?void 0:X.pnlHistory)||[],cn=((pe=(re=it.find(ht=>ht[0]===ut))==null?void 0:re[1])==null?void 0:pe.pnlHistory)||[],un=((ie=(Y=it.find(ht=>ht[0]===qt))==null?void 0:Y[1])==null?void 0:ie.pnlHistory)||[],Ft=((G=(oe=it.find(ht=>ht[0]===It))==null?void 0:oe[1])==null?void 0:G.pnlHistory)||[],Ke=((V=nn[nn.length-1])==null?void 0:V[1])??0,Bt=((ee=jt[jt.length-1])==null?void 0:ee[1])??0,$t=((ae=cn[cn.length-1])==null?void 0:ae[1])??0,qe=((fe=Ft[Ft.length-1])==null?void 0:fe[1])??0,Ye=((Ne=un[un.length-1])==null?void 0:Ne[1])??0;f({activeRange:n,day:Ke,week:Bt,month:$t,threeMonth:qe,all:Ye})}catch(he){console.error("Error fetching data:",he)}};v();const w=setInterval(v,3e4);return()=>clearInterval(w)},[n,s,o,u]);const x=m.useMemo(()=>({colors:["#67FFBD"],stroke:{width:3,curve:"smooth"},chart:{type:"area",stacked:!1,background:"transparent",foreColor:"#ffffff",height:"100%",zoom:{type:"x",enabled:!0,autoScaleYaxis:!0},toolbar:{autoSelected:"zoom",show:!1}},theme:{mode:"dark"},grid:{borderColor:"#2E2E2E",strokeDashArray:5,xaxis:{lines:{show:!0}},yaxis:{lines:{show:!0}}},dataLabels:{enabled:!1},markers:{size:0,colors:["#3CAD7C"]},fill:{type:"gradient",gradient:{shadeIntensity:1,inverseColors:!1,opacityFrom:.5,opacityTo:0,stops:[0,90,100],gradientToColors:["#67FFBD52"]}},yaxis:{labels:{formatter:v=>`$${Er(v)}.00`,style:{colors:"#909090",fontSize:"14px",fontWeight:500,fontFamily:"Manrope",letterSpacing:"0.72px"}}},xaxis:{type:"datetime",labels:{style:{colors:"#FFFFFF",fontSize:"12px",fontWeight:500,fontFamily:"Manrope",letterSpacing:"0.72px"},formatter:function(v,w){const C=new Date(w);if(d)return C.toLocaleTimeString("en-GB",{hour:"2-digit",minute:"2-digit"});const N=`'${C.getFullYear().toString().slice(-2)}`;return`${C.toLocaleDateString("en-US",{month:"short",day:"2-digit"}).toUpperCase()} ${N}`}}},tooltip:{custom:function({series:v,seriesIndex:w,dataPointIndex:C,w:N}){var U,L;const P=v[w][C],I=(L=(U=N.globals.seriesX)==null?void 0:U[w])==null?void 0:L[C],R=N.globals.seriesNames[w];return`
<div class="p-2 rounded-2xl">
<p class="text-[12px] font-medium text-[#909090]">${I?new Date(I).toLocaleDateString("en-GB",{month:"short",day:"2-digit"}).toUpperCase():"-"}</p>
<div class="text-[14px] font-semibold flex items-center">
<span class="inline-block w-[10px] h-[10px] bg-[#67FFBD] rounded-full mr-1"></span>
<span class="text-[#67FFBD] mr-2">${R}</span>
<span>$${Er(P)}</span>
</div>
</div>`},followCursor:!0,intersect:!1,shared:!0}}),[n]),g=[{name:s==="pnlHistory"?"PnL":"Account Value",data:e.map(([v,w])=>[parseInt(v),parseFloat(w)])}];return i.jsxs("div",{className:"p-0 lg:p-[16px] pb-0 bg-[#1B1B1B] rounded-2xl ml-0 lg:ml-2 mt-2 lg:mt-0 mb-2 lg:mb-0",children:[i.jsxs("div",{className:"flex flex-col lg:flex-row justify-start items-center px-2 lg:px-0",children:[i.jsx("div",{className:"flex justify-center w-full lg:flex-none lg:w-auto bg-[#202020] rounded-2xl p-1 text-[12px] font-semibold mt-2 lg:mt-0",children:["24H","1W","1M","3M","All"].map(v=>i.jsx("button",{className:`flex-1 rounded-2xl hover:border-[#67FFBD] hover:rounded-2xl ${n==={"24H":"day","1W":"week","1M":"month","3M":"threeMonth",All:"allTime"}[v]?"text-white bg-[#353535] rounded-2xl":"text-white bg-transparent"}`,onClick:()=>{r({"24H":"day","1W":"week","1M":"month","3M":"threeMonth",All:"allTime"}[v]),localStorage.setItem("discover_period",{"24H":0,"1W":1,"1M":2,"3M":3,All:4}[v])},children:v},v))}),i.jsx("div",{className:"flex justify-center w-full lg:flex-none lg:w-auto ml-0 lg:ml-auto bg-[#202020] rounded-2xl p-1 text-[12px] font-semibold mr-0 lg:mr-8 mt-2 lg:mt-0",children:["Combined","Perp Only"].map(v=>i.jsx("button",{className:`rounded-2xl hover:border-[#67FFBD] hover:rounded-2xl ${o===v.toLowerCase()?"text-[#67FFBD] bg-[rgba(103,255,189,0.16)] rounded-2xl":"text-white bg-transparent"}`,onClick:()=>l(v.toLowerCase()),children:v},v))}),i.jsx("div",{className:"flex justify-center w-full lg:flex-none lg:w-auto bg-[#202020] rounded-2xl p-1 text-[12px] font-semibold mt-2 lg:mt-0",children:["PnL","Account Value"].map(v=>i.jsx("button",{className:`rounded-2xl hover:border-[#67FFBD] hover:rounded-2xl ${s===(v==="PnL"?"pnlHistory":"accountValueHistory")?"text-[#67FFBD] bg-[rgba(103,255,189,0.16)] rounded-2xl":"text-white bg-transparent"}`,onClick:()=>a(v==="PnL"?"pnlHistory":"accountValueHistory"),children:v},v))})]}),i.jsxs("div",{className:" text-white relative",children:[i.jsxs("div",{className:"absolute inset-0 flex items-center justify-center pointer-events-none ",children:[i.jsx("h1",{className:"sr-only",children:"Hyperliquid Wallet Overview & Trade History"}),i.jsx("span",{className:"text-[70px] sm:text-[100px] md:text-[140px] lg:text-[100px] xl:text-[140px] text-gray-600 opacity-20 font-bold font-manrope",children:"dextrabot"})]}),i.jsx(VL,{options:x,series:g,type:"area",height:410})]})]})};var Yx={},W7={},hCe;function WUe(){if(hCe)return W7;hCe=1,Object.defineProperty(W7,"__esModule",{value:!0}),W7.parseLengthAndUnit=t,W7.cssValue=n;var e={cm:!0,mm:!0,in:!0,px:!0,pt:!0,pc:!0,em:!0,ex:!0,ch:!0,rem:!0,vw:!0,vh:!0,vmin:!0,vmax:!0,"%":!0};function t(r){if(typeof r=="number")return{value:r,unit:"px"};var s,a=(r.match(/^[0-9.]*/)||"").toString();a.includes(".")?s=parseFloat(a):s=parseInt(a,10);var o=(r.match(/[^0-9]*$/)||"").toString();return e[o]?{value:s,unit:o}:(console.warn("React Spinners: ".concat(r," is not a valid css value. Defaulting to ").concat(s,"px.")),{value:s,unit:"px"})}function n(r){var s=t(r);return"".concat(s.value).concat(s.unit)}return W7}var q7={},pCe;function qUe(){if(pCe)return q7;pCe=1,Object.defineProperty(q7,"__esModule",{value:!0}),q7.createAnimation=void 0;var e=function(t,n,r){var s="react-spinners-".concat(t,"-").concat(r);if(typeof window>"u"||!window.document)return s;var a=document.createElement("style");document.head.appendChild(a);var o=a.sheet,l=`
@keyframes `.concat(s,` {
`).concat(n,`
}
`);return o&&o.insertRule(l,0),s};return q7.createAnimation=e,q7}var mCe;function tin(){if(mCe)return Yx;mCe=1;var e=Yx.__assign||function(){return e=Object.assign||function(d){for(var f,x=1,g=arguments.length;x<g;x++){f=arguments[x];for(var v in f)Object.prototype.hasOwnProperty.call(f,v)&&(d[v]=f[v])}return d},e.apply(this,arguments)},t=Yx.__createBinding||(Object.create?function(d,f,x,g){g===void 0&&(g=x);var v=Object.getOwnPropertyDescriptor(f,x);(!v||("get"in v?!f.__esModule:v.writable||v.configurable))&&(v={enumerable:!0,get:function(){return f[x]}}),Object.defineProperty(d,g,v)}:function(d,f,x,g){g===void 0&&(g=x),d[g]=f[x]}),n=Yx.__setModuleDefault||(Object.create?function(d,f){Object.defineProperty(d,"default",{enumerable:!0,value:f})}:function(d,f){d.default=f}),r=Yx.__importStar||function(){var d=function(f){return d=Object.getOwnPropertyNames||function(x){var g=[];for(var v in x)Object.prototype.hasOwnProperty.call(x,v)&&(g[g.length]=v);return g},d(f)};return function(f){if(f&&f.__esModule)return f;var x={};if(f!=null)for(var g=d(f),v=0;v<g.length;v++)g[v]!=="default"&&t(x,f,g[v]);return n(x,f),x}}(),s=Yx.__rest||function(d,f){var x={};for(var g in d)Object.prototype.hasOwnProperty.call(d,g)&&f.indexOf(g)<0&&(x[g]=d[g]);if(d!=null&&typeof Object.getOwnPropertySymbols=="function")for(var v=0,g=Object.getOwnPropertySymbols(d);v<g.length;v++)f.indexOf(g[v])<0&&Object.prototype.propertyIsEnumerable.call(d,g[v])&&(x[g[v]]=d[g[v]]);return x};Object.defineProperty(Yx,"__esModule",{value:!0});var a=r(ax()),o=WUe(),l=qUe(),c=(0,l.createAnimation)("ClipLoader","0% {transform: rotate(0deg) scale(1)} 50% {transform: rotate(180deg) scale(0.8)} 100% {transform: rotate(360deg) scale(1)}","clip");function u(d){var f=d.loading,x=f===void 0?!0:f,g=d.color,v=g===void 0?"#000000":g,w=d.speedMultiplier,C=w===void 0?1:w,N=d.cssOverride,P=N===void 0?{}:N,I=d.size,R=I===void 0?35:I,F=s(d,["loading","color","speedMultiplier","cssOverride","size"]),U=e({background:"transparent !important",width:(0,o.cssValue)(R),height:(0,o.cssValue)(R),borderRadius:"100%",border:"2px solid",borderTopColor:v,borderBottomColor:"transparent",borderLeftColor:v,borderRightColor:v,display:"inline-block",animation:"".concat(c," ").concat(.75/C,"s 0s infinite linear"),animationFillMode:"both"},P);return x?a.createElement("span",e({style:U},F)):null}return Yx.default=u,Yx}var nin=tin();const Yy=Ti(nin),Pg=e=>Number(e).toLocaleString("en-US",{maximumFractionDigits:2}),Tj=e=>!isFinite(e)||isNaN(e)?"-":`${Math.floor(e)}h ${Math.round((e-Math.floor(e))*60)}m`,Mce=({className:e="h-5"})=>i.jsx("div",{className:`w-full bg-gray-700/40 rounded animate-pulse ${e}`}),rin=e=>{var n;const t={totalTrades:e.length,totalPnL:0,totalFees:0,longPnL:0,shortPnL:0,wins:0,durSum:0,minDur:1/0,maxDur:-1/0,medianDur:0,perfByAsset:{},bestTrades:[],liquidations:{}};for(const r of e){t.totalPnL+=r.total_pnl||0,t.totalFees+=Math.abs(r.total_fee),r.position_side==="Long"?t.longPnL+=r.total_pnl||0:t.shortPnL+=r.total_pnl||0,r.total_pnl>0&&t.wins++,t.durSum+=r.duration_hours||0,t.minDur=Math.min(t.minDur,r.duration_hours||0),t.maxDur=Math.max(t.maxDur,r.duration_hours||0);const s=t.perfByAsset[r.coin]??(t.perfByAsset[r.coin]={coin:r.coin,pnl:0,fee:0,count:0});if(s.pnl+=r.total_pnl,s.fee+=r.total_fee,s.count++,r.isLiquidated){const a=r.coin,o=((n=t.liquidations)==null?void 0:n[a])??{coin:a,count:0,totalPrice:0,totalPnL:0};o.count+=r.liquidationCount||1,o.totalPrice+=r.isLiqudationPrice||0,o.totalPnL+=r.total_pnl||0,t.liquidations[a]=o}t.bestTrades.length<6?(t.bestTrades.push(r),t.bestTrades.sort((a,o)=>o.total_pnl-a.total_pnl)):r.total_pnl>t.bestTrades[5].total_pnl&&(t.bestTrades[5]=r,t.bestTrades.sort((a,o)=>o.total_pnl-a.total_pnl))}return t.grossPnL=t.totalPnL-t.totalFees,t.longPct=t.longPnL/(t.longPnL+t.shortPnL||1)*100,t.shortPct=100-t.longPct,t.winRate=t.totalTrades?t.wins/t.totalTrades*100:0,t.avgDur=t.totalTrades?t.durSum/t.totalTrades:0,t.medianDur=(t.minDur+t.maxDur)/2,t.perfByAsset=Object.values(t.perfByAsset).sort((r,s)=>s.pnl-r.pnl),t.liquidations=Object.values(t.liquidations).sort((r,s)=>s.count-r.count),t};function sin({trades:e}){const[t,n]=m.useState(!1),r=m.useMemo(()=>e?rin(e):null,[e]),s=m.useMemo(()=>{var c;return(c=r==null?void 0:r.perfByAsset)!=null&&c.length?Math.max(...r.perfByAsset.map(u=>Math.abs(u.pnl))):1},[r]),a=!r,o=r?new Date(Math.min(...e.map(c=>c.open_time))).toLocaleDateString():"-",l=r?new Date(Math.max(...e.map(c=>c.close_time??Date.now()))).toLocaleDateString():"-";return i.jsxs(i.Fragment,{children:[i.jsx("button",{onClick:()=>n(!0),className:"bg-[rgba(255,255,255,0.16)] text-[#ffffff] h-6 sm:h-8 px-1 sm:px-3 py-[1px] sm:py-[5px] rounded-[256px] inline-flex items-center gap-2 text-[14px] font-semibold",children:"Trade Details"}),i.jsxs(up,{isOpen:t,onClose:()=>n(!1),children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("h1",{className:"text-lg font-semibold text-white",children:"Trade Details"}),a&&i.jsx(Yy,{color:"#fff",size:20})]}),i.jsxs("div",{className:"mb-4 text-xs text-white",children:[o," – ",l]}),!a&&(!r||r.totalTrades===0)?i.jsx(iin,{}):i.jsx(ain,{stats:r,maxCoinPnl:s,loading:a})]})]})}function iin(){return i.jsxs("div",{className:"w-full h-[60vh] flex flex-col items-center justify-center text-white text-sm",children:[i.jsx(j6t,{className:"w-14 h-14 mb-4"}),i.jsx("p",{children:"No Trade Details"}),i.jsx("p",{className:"opacity-70",children:"Not enough trading activity detected to generate statistics."})]})}function ain({stats:e,maxCoinPnl:t,loading:n}){return i.jsxs("div",{className:"flex flex-col sm:flex-row w-[90vw] gap-6 max-h-[80vh] h-[80vh] font-manrope",children:[i.jsxs("div",{className:"space-y-6 w-full sm:w-3/2 overflow-y-auto",children:[i.jsxs("div",{className:"grid grid-cols-2 gap-6",children:[i.jsx(G7,{title:"Total PnL",loading:n,children:e&&i.jsxs(i.Fragment,{children:[i.jsxs("p",{className:`text-xl font-semibold ${e.totalPnL-e.totalFees>=0?"text-[#67FFBD]":"text-[#FF7173]"}`,children:["$",Pg(e.totalPnL-e.totalFees)]}),i.jsx(xb,{label:"Gross:",value:`$${Pg(e.grossPnL+e.totalFees)}`}),i.jsx(xb,{label:"Fees:",value:`$${Pg(e.totalFees)}`,red:!0})]})}),i.jsx(G7,{title:"Position Split",loading:n,children:e&&i.jsxs(i.Fragment,{children:[i.jsx(xb,{label:"Long PnL",value:`$${Pg(Math.abs(e.longPnL))}`,green:!0}),i.jsx(xb,{label:"Short PnL",value:`$${Pg(Math.abs(e.shortPnL))}`,green:!0}),i.jsx("div",{className:"h-2 bg-gray-700 rounded mt-2 overflow-hidden",children:i.jsx("div",{className:"h-2 bg-[#67FFBD]",style:{width:`${e.longPct}%`}})})]})}),i.jsx(G7,{title:"Performance",loading:n,children:e&&i.jsxs(i.Fragment,{children:[i.jsxs("p",{className:"text-xl font-semibold text-white",children:[e.winRate.toFixed(2),"%"]}),i.jsx(xb,{label:"Winning:",value:e.wins}),i.jsx(xb,{label:"Total:",value:e.totalTrades})]})}),i.jsx(G7,{title:"Trade Duration",loading:n,children:e&&i.jsxs(i.Fragment,{children:[i.jsx("p",{className:"text-xl font-semibold text-white",children:Tj(e.avgDur)}),i.jsx(xb,{label:"Range:",value:`${Tj(e.minDur)} – ${Tj(e.maxDur)}`}),i.jsx(xb,{label:"Median:",value:Tj(e.medianDur)})]})})]}),i.jsx(lin,{stats:e,loading:n})]}),i.jsxs("div",{className:"rounded-2xl w-full sm:w-1/3 h-full flex flex-col gap-4",children:[i.jsx(cin,{stats:e,loading:n,maxCoinPnl:t}),i.jsx(G7,{title:"Liquidations",loading:n,children:e&&e.liquidations.length>0?i.jsx(oin,{data:e.liquidations}):i.jsx("p",{className:"text-white text-lg text-center font-bold",children:"No liquidations"})})]})]})}function G7({title:e,loading:t,children:n}){return i.jsxs("div",{className:"bg-[#161616] p-4 rounded-2xl flex flex-col justify-between min-h-[140px]",children:[i.jsx("h2",{className:"text-sm uppercase tracking-wider text-white font-bold mb-3",children:e}),t?i.jsx(Mce,{className:"h-10"}):n]})}function oin({data:e}){return i.jsx("div",{className:"overflow-x-auto",children:i.jsxs("table",{className:"w-full text-sm font-bold text-white",children:[i.jsx("thead",{children:i.jsxs("tr",{className:"border-b border-gray-600 text-sm font-bold",children:[i.jsx("th",{className:"py-1 text-left",children:"Coin"}),i.jsx("th",{className:"py-1 text-right",children:"Total Loss"}),i.jsx("th",{className:"py-1 text-right",children:"Total Liqs"})]})}),i.jsx("tbody",{children:e.map(t=>i.jsxs("tr",{className:"border-b border-gray-700 last:border-0",children:[i.jsx("td",{className:"py-1",children:i.jsxs("a",{href:`/terminal/${t.coin}`,target:"_blank",rel:"noopener noreferrer",className:"flex items-center text-white hover:text-gray-400",children:[i.jsx("img",{src:`https://app.hyperliquid.xyz/coins/${t.coin}.svg`,alt:t.coin,className:"w-5 h-5 mr-2",loading:"lazy",onError:n=>replaceBrokenImgSrc(n)}),t.coin]})}),i.jsxs("td",{className:"py-1 text-right text-[#FF7173]",children:["$",Pg(Math.abs(t.totalPnL))]}),i.jsx("td",{className:"py-1 text-right",children:t.count})]},t.coin))})]})})}function xb({label:e,value:t,red:n,green:r}){return i.jsxs("div",{className:"flex justify-between text-sm",children:[i.jsx("span",{className:"text-white font-semibold",children:e}),i.jsx("span",{className:n?"text-[#FF7173] font-semibold":r?"text-[#67FFBD] font-semibold":"font-semibold text-white",children:t})]})}function lin({stats:e,loading:t}){return i.jsxs("div",{className:"bg-[#161616] p-4 rounded-2xl",children:[i.jsx("h2",{className:"text-sm uppercase tracking-wider text-white mb-4 font-bold",children:"Best Trades"}),t?i.jsx("div",{className:"grid grid-cols-2 gap-4",children:Array.from({length:6}).map((n,r)=>i.jsx(Mce,{className:"h-20"},r))}):i.jsx("div",{className:"grid grid-cols-2 gap-4",children:e.bestTrades.map(n=>i.jsxs("div",{className:"bg-[#111] p-3 rounded-2xl space-y-1 text-sm",children:[i.jsxs("div",{className:"flex justify-between",children:[i.jsx("span",{className:"font-semibold text-white",children:n.coin}),i.jsx("span",{className:n.position_side==="Long"?"text-[#67FFBD]":"text-[#FF7173]",children:i.jsxs("span",{className:"text-lg font-bold",children:["$",Pg(Math.abs(n.total_pnl))]})})]}),i.jsx("span",{className:`px-2 py-[1px] rounded text-[11px] font-semibold ${n.position_side==="Long"?"bg-[#67FFBD]/20 text-[#67FFBD]":"bg-[#FF7173]/30 text-[#FF7173]"}`,children:n.position_side}),i.jsxs("div",{className:"text-white font-semibold",children:["Duration: ",Tj(n.duration_hours)]}),i.jsx("div",{className:"text-white text-xs font-semibold",children:new Date(n.close_time).toLocaleDateString()})]},n.id??`${n.coin}-${n.close_time}`))})]})}function cin({stats:e,loading:t,maxCoinPnl:n}){return i.jsxs("div",{className:"bg-[#161616] p-4 overflow-y-auto",children:[i.jsx("h2",{className:"text-sm uppercase tracking-wider text-white mb-4 font-bold",children:"Performance by Asset"}),t?i.jsx("div",{className:"space-y-3",children:Array.from({length:10}).map((r,s)=>i.jsx(Mce,{className:"h-6"},s))}):e.perfByAsset.map(r=>{const s=`${Math.abs(r.pnl)/n*100}%`;return i.jsxs("div",{className:"mb-4 space-y-1",children:[i.jsxs("div",{className:"flex justify-between text-sm font-semibold",children:[i.jsxs("span",{className:"text-white",children:[r.coin,i.jsxs("span",{className:"text-white text-xs ml-2",children:[r.count," trades"]})]}),i.jsxs("span",{className:"text-[#67FFBD]",children:["$",Pg(Math.abs(r.pnl))]})]}),i.jsxs("div",{className:"text-[11px] text-white font-semibold",children:["Fees: $",Pg(Math.abs(r.fee))]}),i.jsx("div",{className:"relative h-1 bg-gray-700 rounded overflow-hidden",children:i.jsx("div",{className:"absolute h-1 left-0 top-0 bg-[#67FFBD]",style:{width:s}})})]},r.coin)})]})}const GUe="https://api.hyperliquid.xyz/info",Tne=2e3,KUe=365*24*60*60*1e3*2;async function YUe(e,t){const{data:n}=await fs.post(GUe,{type:"userFillsByTime",user:e,startTime:t,aggregateByTime:!0},{headers:{"Content-Type":"application/json"},timeout:1e4});return n}async function Rce(e){let t=Date.now()-KUe;const n=[],r=new Set;for(;;){const s=await YUe(e,t);if(!(s!=null&&s.length))break;for(const a of s)r.has(a.tid)||(r.add(a.tid),n.push(a));if(s.length<Tne)break;t=Math.max(...s.map(a=>a.time))+1}return n.sort((s,a)=>s.time-a.time)}async function Lce(e){const{data:t}=await fs.post(GUe,{type:"userTwapSliceFills",user:e},{headers:{"Content-Type":"application/json"},timeout:1e4});return t}async function uin(e,t){let n=Date.now()-KUe;const r=[],s=new Set;let a=0;for(;;){const c=await YUe(e,n);if(!(c!=null&&c.length))break;for(const f of c)s.has(f.tid)||(s.add(f.tid),r.push(f));a++;let u=0,d=0;if(r.forEach(f=>{f.fee&&(u+=parseFloat(f.fee)),f.builderFee&&(d+=parseFloat(f.builderFee))}),t({totalFee:u,totalBuilderFee:d,totalFills:r.length,requestCount:a,hasMoreData:c.length>=Tne,fills:r.slice(0,10),isComplete:!1}),c.length<Tne)break;n=Math.max(...c.map(f=>f.time))+1}let o=0,l=0;return r.forEach(c=>{c.fee&&(o+=parseFloat(c.fee)),c.builderFee&&(l+=parseFloat(c.builderFee))}),t({totalFee:o,totalBuilderFee:l,totalFills:r.length,requestCount:a,hasMoreData:!1,fills:r.slice(0,10),isComplete:!0}),r.sort((c,u)=>c.time-u.time)}function xCe(e,t,n=1e-9,r=0){if(n<0||r<0)throw new RangeError("tolerances must be non-negative");if(e===t)return!0;if(!Number.isFinite(e)||!Number.isFinite(t))return!1;const s=Math.abs(t-e);return s<=Math.abs(n*t)||s<=Math.abs(n*e)||s<=r}function Dce(e){const t=[],n={},r=e.slice().sort((s,a)=>s.time-a.time);for(const s of r)try{const a=s.coin,o=s.dir,l=Math.abs(+s.sz),c=+s.px,u=Math.abs(+s.startPosition),d=+s.builderFee||0,f=+s.fee||0,x=+s.closedPnl||0,g=+s.time,v=s.twapId??null,w=o.startsWith("Open"),C=o.startsWith("Close"),N=o.includes(">"),P=!!s.liquidation;if(w){if(xCe(u,0))n[a]={coin:a,open_time:g,last_fill_time:g,position_side:o.includes("Long")?"Long":"Short",total_size:l,close_size:0,entry_price_wma:c,close_px:c,total_fee:f,total_pnl:0,transaction_count:1,isClosed:!1,oids:[s.oid],has_builder_fee:d!==0,builder_fee:d,twapId:v};else{const I=n[a]??(n[a]={}),R=(I.total_size||0)+l;I.oids=(I.oids||[]).concat(s.oid),I.entry_price_wma=((I.entry_price_wma||0)*(I.total_size||0)+c*l)/R,I.total_size=R,I.last_fill_time=g,I.transaction_count=(I.transaction_count||0)+1,I.total_fee=(I.total_fee||0)+f,I.has_builder_fee=I.has_builder_fee||d!==0,I.builder_fee=(I.builder_fee||0)+d,I.twapId=v}continue}if(N){const I=n[a];I&&(I.close_size+=l,I.total_pnl+=x,I.total_fee+=f,I.last_fill_time=g,I.close_px=c,I.transaction_count++,I.oids.push(s.oid),I.has_builder_fee=I.has_builder_fee||d!==0,I.builder_fee=(I.builder_fee||0)+d,I.twapId=v,I.isClosed=!0,I.close_time=g,I.duration_hours=(g-I.open_time)/36e5,t.push(I),delete n[a]);const R=Math.max(Math.abs(l)-Math.abs(u),0);R>0&&(n[a]={coin:a,open_time:g,last_fill_time:g,position_side:o.includes("Long")?"Long":"Short",total_size:R,close_size:0,entry_price_wma:c,close_px:c,total_fee:f,total_pnl:0,transaction_count:1,isClosed:!1,isLiquidated:!1,oids:[s.oid],has_builder_fee:d!==0,builder_fee:d,twapId:v});continue}if(C||P){const I=n[a];if(!I)continue;I.close_size+=l,I.total_pnl+=x,I.total_fee+=f,I.last_fill_time=g,I.close_px=c,I.transaction_count++,I.oids.push(s.oid),I.has_builder_fee=I.has_builder_fee||d!==0,I.builder_fee=(I.builder_fee||0)+d,I.twapId=v,P&&(I.isLiquidated=!0,I.liquidation_px_sum=(I.liquidation_px_sum||0)+c,I.liquidationCount=(I.liquidationCount||0)+1),xCe(Math.abs(l),Math.abs(u),1e-6)&&(I.isClosed=!0,I.close_time=g,I.duration_hours=(g-I.open_time)/36e5,t.push(I),delete n[a])}}catch{}return{closed_positions:t,current_positions:n,min_open_time:t.length?Math.min(...t.map(s=>s.open_time)):null,end_time:Date.now()}}const $f=({className:e})=>i.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e,children:[i.jsx("path",{d:"M15.1668 11.6665C15.1668 11.9398 14.9402 12.1665 14.6668 12.1665H10.0002V12.3332C10.0002 13.3332 9.40016 13.6665 8.66683 13.6665H4.66683C3.9335 13.6665 3.3335 13.3332 3.3335 12.3332V12.1665H1.3335C1.06016 12.1665 0.833496 11.9398 0.833496 11.6665C0.833496 11.3932 1.06016 11.1665 1.3335 11.1665H3.3335V10.9998C3.3335 9.99984 3.9335 9.6665 4.66683 9.6665H8.66683C9.40016 9.6665 10.0002 9.99984 10.0002 10.9998V11.1665H14.6668C14.9402 11.1665 15.1668 11.3932 15.1668 11.6665Z",fill:"currentColor"}),i.jsx("path",{d:"M15.1668 4.3335C15.1668 4.60683 14.9402 4.8335 14.6668 4.8335H12.6668V5.00016C12.6668 6.00016 12.0668 6.3335 11.3335 6.3335H7.3335C6.60016 6.3335 6.00016 6.00016 6.00016 5.00016V4.8335H1.3335C1.06016 4.8335 0.833496 4.60683 0.833496 4.3335C0.833496 4.06016 1.06016 3.8335 1.3335 3.8335H6.00016V3.66683C6.00016 2.66683 6.60016 2.3335 7.3335 2.3335H11.3335C12.0668 2.3335 12.6668 2.66683 12.6668 3.66683V3.8335H14.6668C14.9402 3.8335 15.1668 4.06016 15.1668 4.3335Z",fill:"currentColor"})]});function pT({open:e,setOpen:t,data:n,setTradeInfo:r,pnlTitle:s="UNREALIZED PNL",showPnl:a=!0}){const o=m.useRef(null),l=async()=>{if(o.current)try{await document.fonts.ready,await new Promise(C=>setTimeout(C,500));const v=await P1(o.current,{cacheBust:!0,backgroundColor:null,useCORS:!1,style:{transform:"scale(1)",transformOrigin:"top left"}}),w=document.createElement("a");w.href=v,w.download="dextrabot.png",document.body.appendChild(w),w.click(),document.body.removeChild(w),rn.success("PNG successfully downloaded!")}catch(v){console.error("Error generating PNG:",v),rn.error("Failed to download PNG.")}},[c,u]=m.useState(),[d,f]=m.useState(!0),x=async v=>{f(!0);try{const C=await(await fetch(`https://api.cors.lol/?url=${encodeURIComponent(v)}`)).blob();return new Promise((N,P)=>{const I=new FileReader;I.onloadend=()=>N(I.result),I.onerror=P,I.readAsDataURL(C)})}catch(w){throw console.error("Image conversion failed:",w),w}finally{f(!1)}},g={kBONK:"BONK",kPEPE:"PEPE",kSHIB:"SHIB",kFLOKI:"FLOKI",kNEIRO:"NEIRO",kDOGS:"DOGS",kLUNC:"LUNC"};return m.useEffect(()=>{var v;n!=null&&n.coin&&x(`https://app.hyperliquid.xyz/coins/${g[n==null?void 0:n.coin]||((v=n==null?void 0:n.coin)==null?void 0:v.split("/")[0])}.svg`).then(w=>u(w)).catch(()=>u(Va))},[n==null?void 0:n.coin]),i.jsxs(Ea,{open:e,onClose:()=>{},className:"relative z-50 font-manrope",children:[i.jsx(ja,{transition:!0,style:{backgroundColor:"rgba(0, 0, 0, 0.48)"},className:"fixed inset-0 transition-opacity data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in"}),i.jsx("div",{className:"fixed inset-0 z-50 w-screen overflow-y-auto",children:i.jsx("div",{className:"flex min-h-full items-end justify-center p-4 text-center sm:items-center sm:p-0",children:i.jsx(xa,{transition:!0,className:"relative bg-[#101010] text-left shadow-xl transition-all data-[closed]:translate-y-4 data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in data-[closed]:sm:translate-y-0 scale-75",children:i.jsx("div",{className:"flex flex-col justify-start items-center gap-8 w-max relative bg-[#1b1b1b] rounded-2xl",children:i.jsxs(i.Fragment,{children:[i.jsx("div",{onClick:()=>{t(!1),setTimeout(()=>{r(v=>({...v,coin:"",type:"",leverage:0,roe:0,entryPrice:0,markPrice:0,positionDistribution:0,pnl:0,closePx:0}))},300)},className:"cursor-pointer flex w-full items-center justify-end absolute right-2 top-1",children:i.jsx("span",{className:"absolute top-2 right-2 w-9 h-9 rounded-full p-1 flex justify-center items-center hover:bg-[#7535FE]",children:i.jsx("img",{className:"p-1",src:Ba})})}),i.jsxs("div",{className:"flex flex-col items-start justify-start gap-4 w-full",children:[i.jsx("div",{className:"flex justify-start items-center w-full pt-6 pl-6 text-white text-base font-semibold font-manrope leading-[8px]",children:"Share PnL"}),i.jsxs("div",{className:"flex justify-start items-center w-full gap-2 px-2 pb-2.5",children:[i.jsx("div",{ref:o,style:{overflow:"visible",position:"relative"},className:"w-[858px] h-[608px] rounded-2xl border border-dashed border-[#353535] justify-center items-center inline-flex overflow-hidden",children:i.jsxs("div",{className:"w-[850px] h-[600px] rounded-xl flex justify-start items-center bg-[#0F1211]",children:[i.jsx("div",{className:"flex justify-start items-center w-[502px] max-h-[600px] bg-[#0F1211] rounded-xl share-pnl-background",children:i.jsxs("div",{className:"flex flex-col items-start gap-4 px-[22px] py-[40px] h-full w-full",children:[i.jsxs("div",{className:"flex justify-start items-center gap-4 relative",children:[i.jsx("img",{src:EA,alt:"",className:"w-12 h-12 max-w-12 min-h-12"}),i.jsx("p",{className:"flex justify-center items-center text-white text-2xl font-semibold font-manrope",children:"Dextrabot - Copy Trade"})]}),i.jsxs("div",{className:"flex flex-col items-start justify-start ",children:[i.jsxs("div",{className:"flex justify-start items-center gap-2 relative mt-6",children:[i.jsx("div",{className:"w-8 h-8 rounded-full flex justify-center items-center",children:i.jsx("div",{className:"w-8 h-8 rounded-full flex justify-center items-center",children:d?i.jsxs("div",{role:"status",className:"flex justify-center items-center h-5 min-h-5 w-[34px] px-0.5 py-1.5 rounded-md",children:[i.jsxs("svg",{"aria-hidden":"true",className:"inline w-4 h-4 text-gray-200 animate-spin dark:text-gray-600 fill-[#67FFBD]",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),i.jsx("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]}),i.jsx("span",{className:"sr-only",children:"Loading..."})]}):i.jsx("img",{src:c||Va,alt:"",className:"rounded-full w-8 h-8",loading:"lazy",onError:v=>ra(v)})})}),i.jsx("div",{className:"text-white text-[32px] font-semibold font-manrope flex items-center",children:n!=null&&n.coin?n==null?void 0:n.coin.replace("xyz:",""):"--"}),i.jsx("div",{className:`${(n==null?void 0:n.type)=="Long"?"bg-[#67ffbd]/20 text-[#67ffbd]":"bg-[#ff797c]/20 text-[#ff787b]"} h-9 w-20 min-w-[80px] w-auto px-3 flex-shrink-0 rounded-md flex justify-center items-center text-[20px] font-semibold font-manrope uppercase tracking-wide`,children:n!=null&&n.type?n==null?void 0:n.type:"--"}),i.jsxs("div",{className:`${(n==null?void 0:n.type)=="Long"?"bg-[#67ffbd]/20 text-[#67ffbd]":"bg-[#ff797c]/20 text-[#ff787b]"} h-9 w-16 min-w-[64px] px-3 flex-shrink-0 rounded-md flex justify-center items-center text-[20px] font-semibold font-manrope tracking-wide`,children:[n!=null&&n.leverage?n==null?void 0:n.leverage:"--","x"]})]}),i.jsxs("div",{className:`${(n==null?void 0:n.roe)>=0?"text-[#67ffbd]":"text-[#ff6767]"} text-[86px] font-semibold font-manrope leading-[92px] inline-flex justify-center items-center min-w-max`,children:[(n==null?void 0:n.roe)>=0?"+":"-",ao(Math.abs(n==null?void 0:n.roe)),"%"]})]}),i.jsxs("div",{className:"flex justify-start items-start gap-[45px] pt-[12px]",children:[s&&i.jsxs("div",{className:"flex flex-col justify-start items-start gap-[2px] max-h-max",children:[i.jsx("div",{className:"text-white/50 text-lg font-medium font-manrope tracking-wider flex",children:s}),i.jsx("div",{className:`${(n==null?void 0:n.pnl)>=0?"text-[#67ffbd]":"text-[#ff787b]"} text-[32px] font-semibold font-manrope leading-none flex`,children:n!=null&&n.pnl?`$${ao(Math.abs(n==null?void 0:n.pnl).toFixed(2))}`:ao(Math.abs(n==null?void 0:n.pnl))})]}),i.jsxs("div",{className:"flex flex-col justify-start items-start gap-[2px] max-h-max",children:[i.jsx("div",{className:"text-white/50 text-lg font-medium font-manrope tracking-wider flex",children:"ENTRY PRICE"}),i.jsx("div",{className:"text-white text-[32px] font-semibold font-manrope leading-none flex",children:n!=null&&n.entryPrice?`$${Er(n==null?void 0:n.entryPrice)}`:Er(n==null?void 0:n.entryPrice)})]})]}),i.jsx("div",{className:"flex justify-start items-start gap-[45px] pt-[12px]",children:i.jsxs("div",{className:"flex flex-col justify-start items-start gap-[2px] max-h-max",children:[i.jsx("div",{className:"text-white/50 text-lg font-medium font-manrope tracking-wider flex",children:"MARK PRICE"}),i.jsx("div",{className:"text-white text-[32px] font-semibold font-manrope leading-none flex",children:n!=null&&n.markPrice?`$${Er(n==null?void 0:n.markPrice)}`:Er(n==null?void 0:n.markPrice)})]})}),(n==null?void 0:n.referral)&&(n==null?void 0:n.referral)!="--"&&i.jsx("div",{className:"flex justify-start items-start gap-[65px] pt-[20px]",children:i.jsxs("div",{className:"flex flex-col justify-start items-start gap-[2px] max-h-max",children:[i.jsx("div",{className:"text-white/50 text-lg font-medium font-manrope leading-loose tracking-wider flex",children:"REFERRAL"}),i.jsx("div",{className:"text-white text-[32px] font-semibold font-manrope leading-none flex",children:n!=null&&n.referral&&(n==null?void 0:n.referral)!="--"?n==null?void 0:n.referral:"--"})]})}),i.jsx("div",{className:`${n!=null&&n.referral&&(n==null?void 0:n.referral)!="--"?"pt-[8px]":"pt-[90px]"} flex justify-start items-start`,children:i.jsx("div",{className:"text-[#828483] text-lg font-medium font-manrope leading-loose tracking-wide",children:n!=null&&n.referral&&(n==null?void 0:n.referral)!="--"?`https://app.dextrabot.com/referral/${n==null?void 0:n.referral}`:"https://app.dextrabot.com"})})]})}),i.jsx("div",{className:"flex justify-center items-center h-[600px] max-h-[600px] bg-[#0F1211] rounded-tr-xl rounded-br-xl max-w-[378px] overflow-hidden",children:(n==null?void 0:n.roe)>=0?i.jsx("img",{src:AA,alt:"",className:"h-full"}):i.jsx("img",{src:jA,alt:"",className:"h-full"})})]})}),i.jsxs("div",{className:"flex flex-col items-start justify-between gap-4 w-[400px] h-[600px] bg-[#232323] rounded-2xl p-4",children:[i.jsxs("div",{className:"flex flex-col justify-start items-start w-full gap-4",children:[i.jsx("div",{className:"text-white text-base font-semibold font-manrope leading-[21px]",children:"Customization"}),i.jsx("div",{className:"text-[#b1b1b1] text-[13px] font-semibold font-manrope leading-[8px] pt-0.5",children:"Referral Code"}),i.jsxs("div",{className:"flex justify-start items-center gap-2 px-2.5 w-full h-8 bg-[#1b1b1b] rounded-md border border-[#303030]",children:[i.jsx("div",{className:"text-[#7b7b7b] text-sm font-medium font-inter leading-[8px]",children:"#"}),i.jsx("div",{className:"text-white text-sm font-medium font-inter leading-[8px]",children:n!=null&&n.referral&&(n==null?void 0:n.referral)!="--"?n==null?void 0:n.referral:"--"})]}),i.jsx("div",{className:"text-[#b1b1b1] text-[13px] font-semibold font-manrope leading-[8px] pt-0.5",children:"Comment"}),i.jsx("div",{className:"flex justify-start items-center gap-2 p-2 w-full h-max bg-[#1b1b1b] rounded-lg border border-[#303030]",children:i.jsx("div",{className:"w-max text-[#909090] text-sm font-normal font-inter leading-[18px]",children:n!=null&&n.referral&&(n==null?void 0:n.referral)!="--"?i.jsxs("span",{children:["Profit like the pros! 🤑 Copy top traders automatically with Dextrabot. Use my referral"," ",n==null?void 0:n.referral," & save 4% on fees! @Dextrabot 🚀"]}):i.jsx("span",{children:"Profit like the pros! 🤑 Copy top traders automatically with @Dextrabot 🚀"})})})]}),i.jsxs("div",{className:"flex flex-col items-start justify-center gap-2.5 w-full",children:[i.jsx("div",{onClick:v=>{v.stopPropagation(),navigator.clipboard.writeText(n!=null&&n.referral&&(n==null?void 0:n.referral)!="--"?`https://app.dextrabot.com/referral/${n==null?void 0:n.referral}`:"https://app.dextrabot.com"),rn.success("Successfully copied.",{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(103, 255, 189, 0.16)",width:"280px",minWidth:"280px",height:"40px",backdropFilter:"blur(16px)"},iconTheme:{primary:"#67FFBD",secondary:"#276047"}})},className:"w-full h-8 px-4 py-3 rounded-[10px] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-[#353535] justify-center items-center gap-2.5 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px]",children:"Copy URL"})}),i.jsx("div",{onClick:v=>{v.preventDefault(),d||l()},className:`${d?"cursor-not-allowed":"cursor-pointer"} w-full h-8 px-4 py-3 rounded-[10px] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-[#353535] justify-center items-center gap-2.5 inline-flex has-tooltip relative`,children:i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px]",children:d?"Hang tight! Your image is on the way... 🚀":"Download PNG"})}),i.jsx("a",{href:`https://x.com/intent/post?url=${n!=null&&n.referral&&(n==null?void 0:n.referral)!=="--"?`https://app.dextrabot.com/referral/${n==null?void 0:n.referral}`:"https://app.dextrabot.com"}&text=Profit%20like%20the%20pros!%20🤑%20Copy%20top%20traders%20automatically${n!=null&&n.referral&&(n==null?void 0:n.referral)!=="--"?`%20with%20Dextrabot.%20Use%20my%20referral%20${n==null?void 0:n.referral}%20and%20save%204%25%20on%20fees!`:"%20with%20%40Dextrabot"}%20🚀%0A`,target:"_blank",className:"w-full h-8 px-6 py-3 bg-white rounded-[10px] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border justify-center items-center gap-2.5 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-[#363636] text-[13px] font-medium font-inter leading-[8px]",children:"Share on X"})})]})]})]})]})]})})})})})]})}function din({open:e,setOpen:t,data:n,setTradeInfo:r}){var o,l;const s=m.useRef(null),a=async()=>{if(s.current)try{await document.fonts.ready,await new Promise(d=>setTimeout(d,500));const c=await P1(s.current,{cacheBust:!0,backgroundColor:null,useCORS:!0,style:{transform:"scale(1)",transformOrigin:"top left"}}),u=document.createElement("a");u.href=c,u.download="dextrabot.png",document.body.appendChild(u),u.click(),document.body.removeChild(u),rn.success("PNG successfully downloaded!")}catch(c){console.error("Error generating PNG:",c),rn.error("Failed to download PNG.")}};return i.jsxs(Ea,{open:e,onClose:()=>{},className:"relative z-50 font-manrope",children:[i.jsx(ja,{transition:!0,style:{backgroundColor:"rgba(0, 0, 0, 0.48)"},className:"fixed inset-0 transition-opacity data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in"}),i.jsx("div",{className:"fixed inset-0 z-50 w-screen overflow-y-auto",children:i.jsx("div",{className:"flex min-h-full items-end justify-center p-4 text-center sm:items-center sm:p-0",children:i.jsx(xa,{transition:!0,className:"relative bg-[#101010] text-left shadow-xl transition-all data-[closed]:translate-y-4 data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in data-[closed]:sm:translate-y-0 scale-75",children:i.jsx("div",{className:"flex flex-col justify-start items-center gap-8 w-max relative bg-[#1b1b1b] rounded-2xl",children:i.jsxs(i.Fragment,{children:[i.jsx("div",{onClick:()=>{t(!1),setTimeout(()=>{r(c=>({...c,coin:"",type:"",leverage:0,roe:0,entryPrice:0,markPrice:0,positionDistribution:0,pnl:0,closePx:0}))},300)},className:"cursor-pointer flex w-full items-center justify-end absolute right-2 top-1",children:i.jsx("span",{className:"absolute top-2 right-2 w-9 h-9 rounded-full p-1 flex justify-center items-center hover:bg-[#7535FE]",children:i.jsx("img",{className:"p-1",src:Ba})})}),i.jsxs("div",{className:"flex flex-col items-start justify-start gap-4 w-full",children:[i.jsx("div",{className:"flex justify-start items-center w-full pt-6 pl-6 text-white text-base font-semibold font-manrope leading-[8px]",children:"Share PnL"}),i.jsxs("div",{className:"flex justify-start items-center w-full gap-2 px-2 pb-2.5",children:[i.jsx("div",{ref:s,style:{overflow:"visible",position:"relative"},className:"w-[878px] h-[608px] rounded-2xl border border-dashed border-[#353535] justify-center items-center inline-flex overflow-hidden",children:i.jsxs("div",{className:"w-[870px] h-[600px] rounded-xl flex justify-start items-center bg-[#0F1211]",children:[i.jsx("div",{className:"flex justify-start items-center w-[522px] max-h-[600px] bg-[#0F1211] rounded-xl share-pnl-background",children:i.jsxs("div",{className:"flex flex-col items-start gap-4 px-[20px] py-[30px] h-full w-full",children:[i.jsxs("div",{className:"flex justify-start items-center gap-4 relative",children:[i.jsx("img",{src:EA,alt:"",className:"w-12 h-12 max-w-12 min-h-12"}),i.jsx("p",{className:"flex justify-center items-center text-white text-2xl font-semibold font-manrope",children:"Dextrabot - Copy Trade"})]}),i.jsxs("div",{className:"flex flex-col items-start justify-start",children:[i.jsxs("div",{className:"flex justify-start items-center gap-2 relative mt-[30px]",children:[i.jsx("div",{className:`${(n==null?void 0:n.type)=="LONG"?"bg-[#67ffbd]/20 text-[#67ffbd]":"bg-[#ff797c]/20 text-[#ff787b]"} h-9 min-w-[80px] px-3 flex-shrink-0 rounded-md flex justify-center items-center text-[20px] font-semibold font-manrope uppercase tracking-wide`,children:n!=null&&n.type?n==null?void 0:n.type:"--"}),i.jsx("div",{className:`${(n==null?void 0:n.type)=="LONG"?"bg-[#67ffbd]/20 text-[#67ffbd]":"bg-[#ff797c]/20 text-[#ff787b]"} h-9 min-w-[64px] px-3 flex-shrink-0 rounded-md flex justify-center items-center text-[20px] font-semibold font-manrope tracking-wide`,children:n!=null&&n.leverage?(n==null?void 0:n.leverage)==null||isNaN(parseFloat(n==null?void 0:n.leverage))?"--":parseFloat(n==null?void 0:n.leverage).toFixed(2)+"x":"--"})]}),i.jsxs("div",{className:`${n!=null&&n.roe&&(n==null?void 0:n.roe)>=0?"text-[#67ffbd]":"text-[#ff6767]"} text-[86px] font-semibold font-manrope leading-[92px] inline-flex justify-center items-center`,children:[n!=null&&n.roe&&(n==null?void 0:n.roe)>=0?"+":"-",(n==null?void 0:n.roe)==null||isNaN(parseFloat(n==null?void 0:n.roe))?"":Fs(Math.abs(n==null?void 0:n.roe))+"%"]})]}),i.jsxs("div",{className:"flex justify-start items-start gap-[30px] pt-[18px]",children:[i.jsxs("div",{className:"flex flex-col justify-start items-start gap-[2px] max-h-max",children:[i.jsx("div",{className:"text-white/50 text-lg font-medium font-manrope tracking-wider flex",children:"UNREALIZED PNL"}),i.jsx("div",{className:`${(n==null?void 0:n.entryPrice)>=0?"text-[#67ffbd]":"text-[#ff6767]"} text-[32px] font-semibold font-manrope leading-none flex min-w-[180px]`,children:n!=null&&n.entryPrice?`$${Er(Math.abs(n==null?void 0:n.entryPrice))}`:"--"})]}),i.jsxs("div",{className:"flex flex-col justify-start items-start gap-[2px] max-h-max",children:[i.jsx("div",{className:"text-white/50 text-lg font-medium font-manrope tracking-wider flex min-w-max",children:"POSITION DISTRIBUTION"}),i.jsx("div",{className:"text-white text-[24px] font-semibold font-manrope leading-none flex min-w-max pt-1",children:n!=null&&n.positionDistribution?i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"text-[#67ffbd]",children:n==null?void 0:n.positionDistribution.split("/")[0].trim()}),i.jsx("span",{className:"text-white mx-1",children:"/"}),i.jsx("span",{className:"text-[#ff6767]",children:(o=n==null?void 0:n.positionDistribution.split("/")[1])==null?void 0:o.trim()})]}):i.jsx("span",{className:"text-white",children:"--"})})]})]}),i.jsx("div",{className:"flex justify-start items-start gap-[65px] pt-[8px]",children:i.jsxs("div",{className:"flex flex-col justify-start items-start gap-[2px] max-h-max",children:[i.jsx("div",{className:"text-white/50 text-lg font-medium font-manrope leading-loose tracking-wider flex",children:"CURRENT WIN RATE"}),i.jsx("div",{className:"text-[24px] font-semibold font-manrope leading-none flex min-w-max",children:n!=null&&n.markPrice?i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"text-[#67ffbd]",children:n==null?void 0:n.markPrice.split("/")[0].trim()}),i.jsx("span",{className:"text-white mx-1",children:"/"}),i.jsx("span",{className:"text-white",children:(l=n==null?void 0:n.markPrice.split("/")[1])==null?void 0:l.trim()})]}):i.jsx("span",{className:"text-white",children:"--"})})]})}),(n==null?void 0:n.referral)&&i.jsx("div",{className:"flex justify-start items-start gap-[65px] pt-[16px]",children:i.jsxs("div",{className:"flex flex-col justify-start items-start gap-[2px] max-h-max",children:[i.jsx("div",{className:"text-white/50 text-lg font-medium font-manrope leading-loose tracking-wider flex",children:"REFERRAL"}),i.jsx("div",{className:"text-white text-[32px] font-semibold font-manrope leading-none flex",children:n!=null&&n.referral?n==null?void 0:n.referral:"--"})]})}),i.jsx("div",{className:`${n!=null&&n.referral?"pt-[1px]":"pt-[90px]"} flex justify-start items-start`,children:i.jsx("div",{className:"text-[#828483] text-lg font-medium font-manrope leading-loose tracking-wide",children:n!=null&&n.referral?`https://app.dextrabot.com/referral/${n==null?void 0:n.referral}`:"https://app.dextrabot.com"})})]})}),i.jsx("div",{className:"flex justify-center items-center h-[600px] max-h-[600px] bg-[#0F1211] rounded-tr-xl rounded-br-xl max-w-[398px] overflow-hidden",children:n!=null&&n.entryPrice&&(n==null?void 0:n.entryPrice)>=0?i.jsx("img",{src:AA,alt:"",className:"h-full"}):i.jsx("img",{src:jA,alt:"",className:"h-full"})})]})}),i.jsxs("div",{className:"flex flex-col items-start justify-between gap-4 w-[400px] h-[600px] bg-[#232323] rounded-2xl p-4",children:[i.jsxs("div",{className:"flex flex-col justify-start items-start w-full gap-4",children:[i.jsx("div",{className:"text-white text-base font-semibold font-manrope leading-[21px]",children:"Customization"}),i.jsx("div",{className:"text-[#b1b1b1] text-[13px] font-semibold font-manrope leading-[8px] pt-0.5",children:"Referral Code"}),i.jsxs("div",{className:"flex justify-start items-center gap-2 px-2.5 w-full h-8 bg-[#1b1b1b] rounded-md border border-[#303030]",children:[i.jsx("div",{className:"text-[#7b7b7b] text-sm font-medium font-inter leading-[8px]",children:"#"}),i.jsx("div",{className:"text-white text-sm font-medium font-inter leading-[8px]",children:n!=null&&n.referral?n==null?void 0:n.referral:"--"})]}),i.jsx("div",{className:"text-[#b1b1b1] text-[13px] font-semibold font-manrope leading-[8px] pt-0.5",children:"Comment"}),i.jsx("div",{className:"flex justify-start items-center gap-2 p-2 w-full h-max bg-[#1b1b1b] rounded-lg border border-[#303030]",children:i.jsx("div",{className:"w-max text-[#909090] text-sm font-normal font-inter leading-[18px]",children:n!=null&&n.referral?i.jsxs("span",{children:["Profit like the pros! 🤑 Copy top traders automatically with Dextrabot. Use my referral"," ",n==null?void 0:n.referral," & save 4% on fees! @Dextrabot 🚀"]}):i.jsx("span",{children:"Profit like the pros! 🤑 Copy top traders automatically with @Dextrabot 🚀"})})})]}),i.jsxs("div",{className:"flex flex-col items-start justify-center gap-2.5 w-full",children:[i.jsx("div",{onClick:c=>{c.stopPropagation(),navigator.clipboard.writeText(n!=null&&n.referral?`https://app.dextrabot.com/referral/${n==null?void 0:n.referral}`:"https://app.dextrabot.com"),rn.success("Successfully copied.",{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(103, 255, 189, 0.16)",width:"280px",minWidth:"280px",height:"40px",backdropFilter:"blur(16px)"},iconTheme:{primary:"#67FFBD",secondary:"#276047"}})},className:"w-full h-8 px-4 py-3 rounded-[10px] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-[#353535] justify-center items-center gap-2.5 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px]",children:"Copy URL"})}),i.jsx("div",{onClick:()=>{a()},className:"w-full h-8 px-4 py-3 rounded-[10px] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-[#353535] justify-center items-center gap-2.5 inline-flex has-tooltip relative cursor-pointer",children:i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px]",children:"Download PNG"})}),i.jsx("a",{href:`https://x.com/intent/post?url=${n!=null&&n.referral&&(n==null?void 0:n.referral)!=="--"?`https://app.dextrabot.com/referral/${n==null?void 0:n.referral}`:"https://app.dextrabot.com"}&text=Profit%20like%20the%20pros!%20🤑%20Copy%20top%20traders%20automatically${n!=null&&n.referral&&(n==null?void 0:n.referral)!=="--"?`%20with%20Dextrabot.%20Use%20my%20referral%20${n==null?void 0:n.referral}%20and%20save%204%25%20on%20fees!`:"%20with%20%40Dextrabot"}%20🚀%0A`,target:"_blank",className:"w-full h-8 px-6 py-3 bg-white rounded-[10px] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border justify-center items-center gap-2.5 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-[#363636] text-[13px] font-medium font-inter leading-[8px]",children:"Share on X"})})]})]})]})]})]})})})})})]})}function fin({open:e,setOpen:t,data:n,setShare:r,setTradeInfo:s}){var x;const a=m.useRef(null),o=async()=>{if(a.current)try{await document.fonts.ready,await new Promise(w=>setTimeout(w,500));const g=await P1(a.current,{cacheBust:!0,backgroundColor:null,useCORS:!0,style:{transform:"scale(1)",transformOrigin:"top left"}}),v=document.createElement("a");v.href=g,v.download="dextrabot.png",document.body.appendChild(v),v.click(),document.body.removeChild(v),rn.success("PNG successfully downloaded!")}catch(g){console.error("Error generating PNG:",g),rn.error("Failed to download PNG.")}},[l,c]=m.useState(),[u,d]=m.useState(!0),f=async g=>{d(!0);try{const w=await(await fetch(`https://api.allorigins.win/raw?url=${encodeURIComponent(g)}`)).blob();return new Promise((C,N)=>{const P=new FileReader;P.onloadend=()=>C(P.result),P.onerror=N,P.readAsDataURL(w)})}catch(v){throw console.error("Image conversion failed:",v),v}finally{d(!1)}};return m.useEffect(()=>{n!=null&&n.coin&&f(`https://app.hyperliquid.xyz/coins/${n==null?void 0:n.coin}.svg`).then(g=>c(g)).catch(()=>c(Va))},[n==null?void 0:n.coin]),i.jsxs(Ea,{open:e,onClose:()=>{},className:"relative z-50 font-manrope",children:[i.jsx(ja,{transition:!0,style:{backgroundColor:"rgba(0, 0, 0, 0.48)"},className:"fixed inset-0 transition-opacity data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in"}),i.jsx("div",{className:"fixed inset-0 z-50 w-screen overflow-y-auto",children:i.jsx("div",{className:"flex min-h-full items-end justify-center p-4 text-center sm:items-center sm:p-0",children:i.jsx(xa,{transition:!0,className:"relative bg-[#101010] text-left shadow-xl transition-all data-[closed]:translate-y-4 data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in data-[closed]:sm:translate-y-0 scale-75",children:i.jsx("div",{className:"flex flex-col justify-start items-center gap-8 w-max relative bg-[#1b1b1b] rounded-2xl",children:i.jsxs(i.Fragment,{children:[i.jsx("div",{onClick:()=>{t(!1),r(!1),setTimeout(()=>{s(g=>({...g,coin:"",type:"",leverage:0,roe:0,entryPrice:0,markPrice:0,positionDistribution:0,pnl:0,closePx:0}))},300)},className:"cursor-pointer flex w-full items-center justify-end absolute right-2 top-1",children:i.jsx("span",{className:"absolute top-2 right-2 w-9 h-9 rounded-full p-1 flex justify-center items-center hover:bg-[#7535FE]",children:i.jsx("img",{className:"p-1",src:Ba})})}),i.jsxs("div",{className:"flex flex-col items-start justify-start gap-4 w-full",children:[i.jsx("div",{className:"flex justify-start items-center w-full pt-6 pl-6 text-white text-base font-semibold font-manrope leading-[8px]",children:"Share PnL"}),i.jsxs("div",{className:"flex justify-start items-center w-full gap-2 px-2 pb-2.5",children:[i.jsx("div",{ref:a,style:{overflow:"visible",position:"relative"},className:"w-[858px] h-[608px] rounded-2xl border border-dashed border-[#353535] justify-center items-center inline-flex overflow-hidden",children:i.jsxs("div",{className:"w-[850px] h-[600px] rounded-xl flex justify-start items-center bg-[#0F1211]",children:[i.jsx("div",{className:"flex justify-start items-center w-[502px] max-h-[600px] bg-[#0F1211] rounded-xl share-pnl-background",children:i.jsxs("div",{className:"flex flex-col items-start gap-4 px-[22px] py-[40px] h-full w-full",children:[i.jsxs("div",{className:"flex justify-start items-center gap-4 relative",children:[i.jsx("img",{src:EA,alt:"",className:"w-12 h-12 max-w-12 min-h-12"}),i.jsx("p",{className:"flex justify-center items-center text-white text-2xl font-semibold font-manrope",children:"Dextrabot - Copy Trade"})]}),i.jsxs("div",{className:"flex flex-col items-start justify-start ",children:[i.jsxs("div",{className:"flex justify-start items-center gap-2 relative mt-6",children:[i.jsx("div",{className:"w-8 h-8 rounded-full flex justify-center items-center",children:i.jsx("div",{className:"w-8 h-8 rounded-full flex justify-center items-center",children:u?i.jsxs("div",{role:"status",className:"flex justify-center items-center h-5 min-h-5 w-[34px] px-0.5 py-1.5 rounded-md",children:[i.jsxs("svg",{"aria-hidden":"true",class:"inline w-4 h-4 text-gray-200 animate-spin dark:text-gray-600 fill-[#67FFBD]",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),i.jsx("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]}),i.jsx("span",{class:"sr-only",children:"Loading..."})]}):i.jsx("img",{src:l||Va,alt:"",className:"rounded-full w-8 h-8",loading:"lazy",onError:g=>ra(g)})})}),i.jsx("div",{className:"text-white text-[32px] font-semibold font-manrope flex items-center",children:n!=null&&n.coin?n==null?void 0:n.coin:"--"}),i.jsx("div",{className:`${(x=n==null?void 0:n.type)!=null&&x.includes("Long")?"bg-[#67ffbd]/20 text-[#67ffbd]":"bg-[#ff797c]/20 text-[#ff787b]"} h-9 w-auto px-3 flex-shrink-0 rounded-md flex justify-center items-center text-[20px] font-semibold font-manrope uppercase tracking-wide`,children:n!=null&&n.type?n==null?void 0:n.type:"-"})]}),i.jsxs("div",{className:`${(n==null?void 0:n.pnl)>=0?"text-[#67ffbd]":"text-[#ff6767]"} text-[86px] font-semibold font-manrope leading-[92px] inline-flex justify-center items-center min-w-max`,children:[(n==null?void 0:n.pnl)>=0?"+":"-","$",ao(Math.abs((n==null?void 0:n.pnl)-(n!=null&&n.builderFee?n.builderFee:0)))]})]}),i.jsxs("div",{className:"flex justify-start items-start gap-[45px] pt-[12px]",children:[i.jsxs("div",{className:"flex flex-col justify-start items-start gap-[2px] max-h-max",children:[i.jsx("div",{className:"text-white/50 text-lg font-medium font-manrope tracking-wider flex",children:"ENTRY PRICE"}),i.jsx("div",{className:"text-white text-[32px] font-semibold font-manrope leading-none flex",children:n!=null&&n.entryPrice?`$${fy(n==null?void 0:n.entryPrice)}`:fy(n==null?void 0:n.entryPrice)})]}),i.jsxs("div",{className:"flex flex-col justify-start items-start gap-[2px] max-h-max",children:[i.jsx("div",{className:"text-white/50 text-lg font-medium font-manrope tracking-wider flex",children:"MARK PRICE"}),i.jsx("div",{className:"text-white text-[32px] font-semibold font-manrope leading-none flex",children:n!=null&&n.markPrice?`$${fy(n==null?void 0:n.markPrice)}`:fy(n==null?void 0:n.markPrice)})]})]}),i.jsx("div",{className:"flex justify-start items-start gap-[65px] pt-[20px]",children:i.jsxs("div",{className:"flex flex-col justify-start items-start gap-[2px] max-h-max",children:[i.jsx("div",{className:"text-white/50 text-lg font-medium font-manrope leading-loose tracking-wider flex",children:"REFERRAL"}),i.jsx("div",{className:"text-white text-[32px] font-semibold font-manrope leading-none flex",children:n!=null&&n.referral?n==null?void 0:n.referral:"--"})]})}),i.jsx("div",{className:"flex justify-start items-start pt-[8px]",children:i.jsx("div",{className:"text-[#828483] text-lg font-medium font-manrope leading-loose tracking-wide",children:n!=null&&n.referral?`https://app.dextrabot.com/referral/${n==null?void 0:n.referral}`:"https://app.dextrabot.com"})})]})}),i.jsx("div",{className:"flex justify-center items-center h-[600px] max-h-[600px] bg-[#0F1211] rounded-tr-xl rounded-br-xl max-w-[378px] overflow-hidden",children:(n==null?void 0:n.roe)>=0?i.jsx("img",{src:AA,alt:"",className:"h-full"}):i.jsx("img",{src:jA,alt:"",className:"h-full"})})]})}),i.jsxs("div",{className:"flex flex-col items-start justify-between gap-4 w-[400px] h-[600px] bg-[#232323] rounded-2xl p-4",children:[i.jsxs("div",{className:"flex flex-col justify-start items-start w-full gap-4",children:[i.jsx("div",{className:"text-white text-base font-semibold font-manrope leading-[21px]",children:"Customization"}),i.jsx("div",{className:"text-[#b1b1b1] text-[13px] font-semibold font-manrope leading-[8px] pt-0.5",children:"Referral Code"}),i.jsxs("div",{className:"flex justify-start items-center gap-2 px-2.5 w-full h-8 bg-[#1b1b1b] rounded-md border border-[#303030]",children:[i.jsx("div",{className:"text-[#7b7b7b] text-sm font-medium font-inter leading-[8px]",children:"#"}),i.jsx("div",{className:"text-white text-sm font-medium font-inter leading-[8px]",children:n!=null&&n.referral?n==null?void 0:n.referral:"--"})]}),i.jsx("div",{className:"text-[#b1b1b1] text-[13px] font-semibold font-manrope leading-[8px] pt-0.5",children:"Comment"}),i.jsx("div",{className:"flex justify-start items-center gap-2 p-2 w-full h-max bg-[#1b1b1b] rounded-lg border border-[#303030]",children:i.jsx("div",{className:"w-max text-[#909090] text-sm font-normal font-inter leading-[18px]",children:n!=null&&n.referral?i.jsxs("span",{children:["Profit like the pros! 🤑 Copy top traders automatically with Dextrabot. Use my referral"," ",n==null?void 0:n.referral," & save 4% on fees! @Dextrabot 🚀"]}):i.jsx("span",{children:"Profit like the pros! 🤑 Copy top traders automatically with @Dextrabot 🚀"})})})]}),i.jsxs("div",{className:"flex flex-col items-start justify-center gap-2.5 w-full",children:[i.jsx("div",{onClick:g=>{g.stopPropagation(),navigator.clipboard.writeText(n!=null&&n.referral?`https://app.dextrabot.com/referral/${n==null?void 0:n.referral}`:"https://app.dextrabot.com"),rn.success("Successfully copied.",{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(103, 255, 189, 0.16)",width:"280px",minWidth:"280px",height:"40px",backdropFilter:"blur(16px)"},iconTheme:{primary:"#67FFBD",secondary:"#276047"}})},className:"w-full h-8 px-4 py-3 rounded-[10px] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-[#353535] justify-center items-center gap-2.5 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px]",children:"Copy URL"})}),i.jsx("div",{onClick:g=>{g.preventDefault(),u||o()},className:`${u?"cursor-not-allowed":"cursor-pointer"} w-full h-8 px-4 py-3 rounded-[10px] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-[#353535] justify-center items-center gap-2.5 inline-flex has-tooltip relative`,children:i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px]",children:u?"Hang tight! Your image is on the way... 🚀":"Download PNG"})}),i.jsx("a",{href:`https://x.com/intent/post?url=${n!=null&&n.referral&&(n==null?void 0:n.referral)!=="--"?`https://app.dextrabot.com/referral/${n==null?void 0:n.referral}`:"https://app.dextrabot.com"}&text=Profit%20like%20the%20pros!%20🤑%20Copy%20top%20traders%20automatically${n!=null&&n.referral&&(n==null?void 0:n.referral)!=="--"?`%20with%20Dextrabot.%20Use%20my%20referral%20${n==null?void 0:n.referral}%20and%20save%204%25%20on%20fees!`:"%20with%20%40Dextrabot"}%20🚀%0A`,target:"_blank",className:"w-full h-8 px-6 py-3 bg-white rounded-[10px] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border justify-center items-center gap-2.5 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-[#363636] text-[13px] font-medium font-inter leading-[8px]",children:"Share on X"})})]})]})]})]})]})})})})})]})}const hin=({wallet:e,wallets:t})=>{const[n,r]=m.useState([]),[s,a]=m.useState(!0),[o,l]=m.useState("oid"),[c,u]=m.useState(""),[d,f]=m.useState(!1),x=m.useRef(null),g=m.useRef(null),[v,w]=m.useState(!1),[C,N]=m.useState(null);m.useContext(Qr);const[P,I]=m.useState({key:null,direction:null});m.useEffect(()=>{function pe(Y){g.current&&!g.current.contains(Y.target)&&setIsDropdownOpen(!1),x.current&&!x.current.contains(Y.target)&&f(!1)}return document.addEventListener("mousedown",pe),()=>document.removeEventListener("mousedown",pe)},[]);const R=pe=>`${pe.time}_${pe.coin}_${pe.dir}_${pe.px}_${pe.sz}`;m.useEffect(()=>{if(!t||t.length===0)return;const pe=t.map(ie=>ie.wallet_address.toLowerCase());if(pe.length===0)return;let Y=!0;return(async()=>{try{const ie=(await Promise.all(pe.map(G=>fs.post("https://api-ui.hyperliquid.xyz/info",{aggregateByTime:!0,type:"userFills",user:G})))).flatMap(G=>G.data??[]);if(!Y)return;const oe=new Map;ie.forEach(G=>{const V=R(G);oe.has(V)||oe.set(V,G)}),r(Array.from(oe.values()).sort((G,V)=>V.time-G.time))}catch(ie){console.error("Multi-wallet trade fetch error:",ie)}finally{Y&&a(!1)}})(),()=>{Y=!1}},[t]),m.useEffect(()=>{const pe=new WebSocket("wss://api-ui.hyperliquid.xyz/ws");return pe.onopen=()=>{pe.send(JSON.stringify({method:"subscribe",subscription:{type:"userFills",user:e,aggregateByTime:!0}}))},pe.onmessage=Y=>{const ie=JSON.parse(Y.data);ie&&ie.data&&Array.isArray(ie.data.fills)&&r(oe=>{const G=[...oe];return ie.data.fills.forEach(V=>{const ee=R(V);G.some(ae=>R(ae)===ee)||G.push(V)}),G.sort((V,ee)=>ee.time-V.time)})},()=>pe.close()},[]),m.useEffect(()=>{(async()=>{try{const Y=await fs.post("https://api-ui.hyperliquid.xyz/info",{aggregateByTime:!0,type:"userFills",user:e});r(Y.data||[])}catch(Y){console.error("Error fetching trade data:",Y)}finally{a(!1)}})()},[e]);const F=pe=>{let Y="asc";P.key===pe&&(P.direction==="asc"?Y="desc":P.direction==="desc"&&(Y=null)),I({key:pe,direction:Y})};let U=[...n];c&&(U=U.filter(pe=>String(pe.oid).includes(c)));const L=U.sort((pe,Y)=>{if(!P.key||!P.direction)return 0;const ie=(V,ee)=>{switch(ee){case"sz":return parseFloat(V.sz);case"closedPnl":return parseFloat(V.closedPnl||0)-parseFloat(V.fee||0);case"fee":return parseFloat(V.fee);case"tradeValue":return parseFloat(V.px)*parseFloat(V.sz);default:return V[ee]}},oe=ie(pe,P.key),G=ie(Y,P.key);return oe<G?P.direction==="asc"?-1:1:oe>G?P.direction==="asc"?1:-1:0}),z=pe=>{if(P.key===pe){if(P.direction==="asc")return i.jsx(P3,{className:"inline ml-2 text-white"});if(P.direction==="desc")return i.jsx(I3,{className:"inline ml-2 text-white"})}return i.jsx(F3,{className:"inline ml-2 text-white"})},ne=localStorage.getItem("isDateTradeHistoryFormat")||"date",[J,X]=m.useState(ne);m.useEffect(()=>{localStorage.setItem("isDateTradeHistoryFormat",J)},[J]);function re({date:pe}){const[Y,ie]=m.useState(Mo(pe));return m.useEffect(()=>{const oe=setInterval(()=>{ie(Mo(pe))},1e3);return()=>clearInterval(oe)},[pe]),i.jsx("span",{className:"text-white leading-[13px] tracking-[0.26px] text-[13px] font-semibold font-manrope",children:Y.dateTime})}return i.jsxs("div",{className:"relative w-full text-white text-sm font-semibold font-manrope leading-[13px] tracking-tight",children:[i.jsx(fin,{open:v,setOpen:w,data:C,setShare:()=>{},setTradeInfo:()=>{}}),i.jsx("div",{className:"w-full overflow-x-auto min-h-[60vh] max-h-[60vh] h-full flex-grow mt-1 mb-3 bg-[#161616] border-collapse rounded-lg pb-24",children:i.jsxs("table",{className:"w-max sm:w-full relative border-separate border-spacing-y-1",children:[i.jsx("thead",{className:"sticky top-0 z-[3] whitespace-nowrap bg-[#161616]",children:i.jsxs("tr",{className:"w-full z-[4] font-semibold leading-[13px] tracking-[0.26px] text-[13px] font-manrope relative h-[32px] max-h-[32px] text-white",children:[i.jsxs("th",{className:" text-left cursor-pointer",onClick:()=>F("time"),children:["Time ",z("time")]}),i.jsxs("th",{className:" text-left cursor-pointer",onClick:()=>F("coin"),children:["Coin ",z("coin")]}),i.jsxs("th",{className:" text-left cursor-pointer",onClick:()=>F("dir"),children:["Direction ",z("dir")]}),i.jsxs("th",{className:" text-left cursor-pointer",onClick:()=>F("px"),children:["Price ",z("px")]}),i.jsxs("th",{className:" text-left cursor-pointer",onClick:()=>F("sz"),children:["Size ",z("sz")]}),i.jsxs("th",{className:" text-left cursor-pointer",onClick:()=>F("tradeValue"),children:["Trade Value ",z("tradeValue")]}),i.jsxs("th",{className:" text-left cursor-pointer",onClick:()=>F("fee"),children:["Fee (USDC) ",z("fee")]}),i.jsxs("th",{className:" text-left cursor-pointer",onClick:()=>F("closedPnl"),children:["Closed PNL ",z("closedPnl")]}),i.jsx("th",{children:i.jsxs("div",{className:"flex justify-start items-center gap-2",children:[i.jsx(hi,{title:"Order ID",sortKey:"oid",sortOption:o,setSortOption:l,isFilterIcon:!0}),i.jsxs("div",{className:"flex items-center justify-start",children:[i.jsx("button",{onClick:()=>f(!d),className:`${c?"bg-gray-900":"bg-[#555555]"} inline-flex items-center p-1 rounded hover:bg-gray-700 focus:outline-none focus:ring-0 border-none`,children:i.jsx($f,{className:`w-4 h-4 ${c?"text-blue-500":"text-white"}`})}),d&&i.jsxs("div",{ref:x,className:`absolute right-[30px] mt-32 w-[208px]
bg-[#222] border border-gray-700 rounded shadow-lg p-2 z-10`,children:[i.jsxs("div",{className:"flex justify-between items-center px-2 pb-2 border-b border-gray-600",children:[i.jsx("span",{className:"text-white text-sm font-semibold",children:"Filter"}),i.jsx("div",{onClick:()=>u(""),className:"h-5 px-2 py-1.5 bg-[#3d3d3d] rounded-md justify-start items-center gap-2 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-[#cdcdcd] text-[11px] font-semibold font-manrope leading-[8px] pointer-events-none",children:"Clear All"})})]}),i.jsx("input",{type:"number",value:c,onChange:pe=>u(pe.target.value),className:"bg-[#333] rounded text-white py-1 px-2 text-sm outline-none mt-2 placeholder:text-sm placeholder:font-semibold placeholder:font-manrope placeholder:text-[#7c7c7c]",placeholder:"Order ID"})]})]})]})})]})}),i.jsx("tbody",{children:s?i.jsx("tr",{children:i.jsx("td",{colSpan:"8",className:"text-center p-4",children:"Loading..."})}):L.map((pe,Y)=>{var ie,oe;return i.jsxs("tr",{className:"relative group bg-[#1b1b1b] hover:bg-[#222222] h-[32px] max-h-[32px] text-white rounded-2xl",children:[i.jsx("td",{onClick:()=>{X(J=="time"?"date":"time")},className:"text-left rounded-l-2xl cursor-pointer",children:J=="time"?i.jsx(re,{date:pe.time}):su(pe.time)}),i.jsx("td",{className:"text-left",children:i.jsx("a",{href:`/terminal/${pe.coin}`,target:"_blank",rel:"noopener noreferrer",className:"text-white hover:text-gray-400",children:pe.coin})}),i.jsx("td",{className:`text-left ${pe!=null&&pe.liquidation?"text-[#ff787b]":(ie=pe.dir)!=null&&ie.includes("Short")?"text-[#ff6b6b]":(oe=pe.dir)!=null&&oe.includes("Long")?"text-[#4ae3b5]":"text-white"}`,children:pe!=null&&pe.liquidation?`Market Liquidation: ${(pe==null?void 0:pe.dir)=="Sell"?"Sell":(pe==null?void 0:pe.dir)=="Buy"?"Buy":(pe==null?void 0:pe.dir)=="Close Short"?"Close Short":(pe==null?void 0:pe.dir)=="Close Long"?"Close Long":(pe==null?void 0:pe.dir)=="Open Short"?"Close Short":(pe==null?void 0:pe.dir)=="Open Long"?"Close Long":"Close "+(pe==null?void 0:pe.dir)}`:pe==null?void 0:pe.dir}),i.jsxs("td",{className:"text-left",children:["$",parseFloat(pe.px).toFixed(2)]}),i.jsx("td",{className:"text-left",children:Er(parseFloat(pe.sz))}),i.jsxs("td",{className:"text-left",children:["$",Er(parseFloat(pe.px)*parseFloat(pe.sz))]}),i.jsxs("td",{className:"text-left",children:[Er(parseFloat(pe.fee)),pe.builderFee&&i.jsxs("span",{className:"text-xs",children:["(",Er(parseFloat(pe.builderFee))," ","builder fee)"]})]}),i.jsxs("td",{className:`text-left ${parseFloat(pe.closedPnl)-parseFloat(pe.fee)>0?"text-[#4ae3b5]":parseFloat(pe.closedPnl)-parseFloat(pe.fee)<0?"text-[#ff6b6b]":"text-white"}`,children:["$",Er(parseFloat(pe.closedPnl)-parseFloat(pe.fee))]}),i.jsx("td",{className:"rounded-r-2xl ",children:pe.oid})]},Y)})})]})})]})};var Ij={exports:{}};/**
* @license
* Lodash <https://lodash.com/>
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
* Released under MIT license <https://lodash.com/license>
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
*/var pin=Ij.exports,gCe;function min(){return gCe||(gCe=1,function(e,t){(function(){var n,r="4.17.21",s=200,a="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",o="Expected a function",l="Invalid `variable` option passed into `_.template`",c="__lodash_hash_undefined__",u=500,d="__lodash_placeholder__",f=1,x=2,g=4,v=1,w=2,C=1,N=2,P=4,I=8,R=16,F=32,U=64,L=128,z=256,Q=512,ne=30,J="...",X=800,re=16,pe=1,Y=2,ie=3,oe=1/0,G=9007199254740991,V=17976931348623157e292,ee=NaN,ae=4294967295,fe=ae-1,Ne=ae>>>1,he=[["ary",L],["bind",C],["bindKey",N],["curry",I],["curryRight",R],["flip",Q],["partial",F],["partialRight",U],["rearg",z]],ge="[object Arguments]",ye="[object Array]",ve="[object AsyncFunction]",je="[object Boolean]",Ie="[object Date]",Le="[object DOMException]",Qe="[object Error]",$e="[object Function]",it="[object GeneratorFunction]",tt="[object Map]",lt="[object Number]",ft="[object Null]",ut="[object Object]",qt="[object Promise]",It="[object Proxy]",nn="[object RegExp]",jt="[object Set]",cn="[object String]",un="[object Symbol]",Ft="[object Undefined]",Ke="[object WeakMap]",Bt="[object WeakSet]",$t="[object ArrayBuffer]",qe="[object DataView]",Ye="[object Float32Array]",ht="[object Float64Array]",Zt="[object Int8Array]",zt="[object Int16Array]",Et="[object Int32Array]",nt="[object Uint8Array]",Ue="[object Uint8ClampedArray]",Rt="[object Uint16Array]",We="[object Uint32Array]",at=/\b__p \+= '';/g,mt=/\b(__p \+=) '' \+/g,Dt=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Tt=/&(?:amp|lt|gt|quot|#39);/g,dn=/[&<>"']/g,on=RegExp(Tt.source),gn=RegExp(dn.source),Nn=/<%-([\s\S]+?)%>/g,kn=/<%([\s\S]+?)%>/g,yn=/<%=([\s\S]+?)%>/g,Vn=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Gn=/^\w*$/,Dn=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Kn=/[\\^$.*+?()[\]{}|]/g,Cn=RegExp(Kn.source),sn=/^\s+/,Me=/\s/,en=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,an=/\{\n\/\* \[wrapped with (.+)\] \*/,Nt=/,? & /,Yn=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,xn=/[()=,{}\[\]\/\s]/,Mt=/\\(\\)?/g,tn=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,In=/\w*$/,Xn=/^[-+]0x[0-9a-f]+$/i,or=/^0b[01]+$/i,lr=/^\[object .+?Constructor\]$/,Qt=/^0o[0-7]+$/i,zn=/^(?:0|[1-9]\d*)$/,Jn=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Lt=/($^)/,jn=/['\n\r\u2028\u2029\\]/g,Ee="\\ud800-\\udfff",h="\\u0300-\\u036f",p="\\ufe20-\\ufe2f",S="\\u20d0-\\u20ff",_=h+p+S,k="\\u2700-\\u27bf",T="a-z\\xdf-\\xf6\\xf8-\\xff",B="\\xac\\xb1\\xd7\\xf7",q="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",te="\\u2000-\\u206f",ue=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",de="A-Z\\xc0-\\xd6\\xd8-\\xde",xe="\\ufe0e\\ufe0f",Se=B+q+te+ue,ke="['’]",Re="["+Ee+"]",Ge="["+Se+"]",Fe="["+_+"]",st="\\d+",se="["+k+"]",Ce="["+T+"]",Be="[^"+Ee+Se+st+k+T+de+"]",De="\\ud83c[\\udffb-\\udfff]",_e="(?:"+Fe+"|"+De+")",Je="[^"+Ee+"]",ct="(?:\\ud83c[\\udde6-\\uddff]){2}",gt="[\\ud800-\\udbff][\\udc00-\\udfff]",Xt="["+de+"]",wt="\\u200d",Xe="(?:"+Ce+"|"+Be+")",Oe="(?:"+Xt+"|"+Be+")",bt="(?:"+ke+"(?:d|ll|m|re|s|t|ve))?",kt="(?:"+ke+"(?:D|LL|M|RE|S|T|VE))?",Ut=_e+"?",fn="["+xe+"]?",On="(?:"+wt+"(?:"+[Je,ct,gt].join("|")+")"+fn+Ut+")*",Sn="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",yr="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Pn=fn+Ut+On,En="(?:"+[se,ct,gt].join("|")+")"+Pn,$n="(?:"+[Je+Fe+"?",Fe,ct,gt,Re].join("|")+")",Bn=RegExp(ke,"g"),_r=RegExp(Fe,"g"),sr=RegExp(De+"(?="+De+")|"+$n+Pn,"g"),rr=RegExp([Xt+"?"+Ce+"+"+bt+"(?="+[Ge,Xt,"$"].join("|")+")",Oe+"+"+kt+"(?="+[Ge,Xt+Xe,"$"].join("|")+")",Xt+"?"+Xe+"+"+bt,Xt+"+"+kt,yr,Sn,st,En].join("|"),"g"),Rr=RegExp("["+wt+Ee+_+xe+"]"),Jr=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,ws=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],ls=-1,et={};et[Ye]=et[ht]=et[Zt]=et[zt]=et[Et]=et[nt]=et[Ue]=et[Rt]=et[We]=!0,et[ge]=et[ye]=et[$t]=et[je]=et[qe]=et[Ie]=et[Qe]=et[$e]=et[tt]=et[lt]=et[ut]=et[nn]=et[jt]=et[cn]=et[Ke]=!1;var yt={};yt[ge]=yt[ye]=yt[$t]=yt[qe]=yt[je]=yt[Ie]=yt[Ye]=yt[ht]=yt[Zt]=yt[zt]=yt[Et]=yt[tt]=yt[lt]=yt[ut]=yt[nn]=yt[jt]=yt[cn]=yt[un]=yt[nt]=yt[Ue]=yt[Rt]=yt[We]=!0,yt[Qe]=yt[$e]=yt[Ke]=!1;var Tn={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},tr={"&":"&","<":"<",">":">",'"':""","'":"'"},Ar={"&":"&","<":"<",">":">",""":'"',"'":"'"},Br={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Vr=parseFloat,dr=parseInt,jr=typeof Tu=="object"&&Tu&&Tu.Object===Object&&Tu,ps=typeof self=="object"&&self&&self.Object===Object&&self,gr=jr||ps||Function("return this")(),es=t&&!t.nodeType&&t,Gs=es&&!0&&e&&!e.nodeType&&e,Es=Gs&&Gs.exports===es,xr=Es&&jr.process,Gt=function(){try{var Ct=Gs&&Gs.require&&Gs.require("util").types;return Ct||xr&&xr.binding&&xr.binding("util")}catch{}}(),ce=Gt&&Gt.isArrayBuffer,rt=Gt&&Gt.isDate,Pt=Gt&&Gt.isMap,vt=Gt&&Gt.isRegExp,ln=Gt&&Gt.isSet,mn=Gt&&Gt.isTypedArray;function cr(Ct,Ht,Kt){switch(Kt.length){case 0:return Ct.call(Ht);case 1:return Ct.call(Ht,Kt[0]);case 2:return Ct.call(Ht,Kt[0],Kt[1]);case 3:return Ct.call(Ht,Kt[0],Kt[1],Kt[2])}return Ct.apply(Ht,Kt)}function Nr(Ct,Ht,Kt,An){for(var hr=-1,wr=Ct==null?0:Ct.length;++hr<wr;){var Sr=Ct[hr];Ht(An,Sr,Kt(Sr),Ct)}return An}function fr(Ct,Ht){for(var Kt=-1,An=Ct==null?0:Ct.length;++Kt<An&&Ht(Ct[Kt],Kt,Ct)!==!1;);return Ct}function ur(Ct,Ht){for(var Kt=Ct==null?0:Ct.length;Kt--&&Ht(Ct[Kt],Kt,Ct)!==!1;);return Ct}function Yr(Ct,Ht){for(var Kt=-1,An=Ct==null?0:Ct.length;++Kt<An;)if(!Ht(Ct[Kt],Kt,Ct))return!1;return!0}function ss(Ct,Ht){for(var Kt=-1,An=Ct==null?0:Ct.length,hr=0,wr=[];++Kt<An;){var Sr=Ct[Kt];Ht(Sr,Kt,Ct)&&(wr[hr++]=Sr)}return wr}function Ir(Ct,Ht){var Kt=Ct==null?0:Ct.length;return!!Kt&&Wn(Ct,Ht,0)>-1}function mr(Ct,Ht,Kt){for(var An=-1,hr=Ct==null?0:Ct.length;++An<hr;)if(Kt(Ht,Ct[An]))return!0;return!1}function Qn(Ct,Ht){for(var Kt=-1,An=Ct==null?0:Ct.length,hr=Array(An);++Kt<An;)hr[Kt]=Ht(Ct[Kt],Kt,Ct);return hr}function xs(Ct,Ht){for(var Kt=-1,An=Ht.length,hr=Ct.length;++Kt<An;)Ct[hr+Kt]=Ht[Kt];return Ct}function Xs(Ct,Ht,Kt,An){var hr=-1,wr=Ct==null?0:Ct.length;for(An&&wr&&(Kt=Ct[++hr]);++hr<wr;)Kt=Ht(Kt,Ct[hr],hr,Ct);return Kt}function ii(Ct,Ht,Kt,An){var hr=Ct==null?0:Ct.length;for(An&&hr&&(Kt=Ct[--hr]);hr--;)Kt=Ht(Kt,Ct[hr],hr,Ct);return Kt}function Pr(Ct,Ht){for(var Kt=-1,An=Ct==null?0:Ct.length;++Kt<An;)if(Ht(Ct[Kt],Kt,Ct))return!0;return!1}var vn=Ms("length");function Mn(Ct){return Ct.split("")}function ot(Ct){return Ct.match(Yn)||[]}function Vt(Ct,Ht,Kt){var An;return Kt(Ct,function(hr,wr,Sr){if(Ht(hr,wr,Sr))return An=wr,!1}),An}function er(Ct,Ht,Kt,An){for(var hr=Ct.length,wr=Kt+(An?1:-1);An?wr--:++wr<hr;)if(Ht(Ct[wr],wr,Ct))return wr;return-1}function Wn(Ct,Ht,Kt){return Ht===Ht?O(Ct,Ht,Kt):er(Ct,kr,Kt)}function Fr(Ct,Ht,Kt,An){for(var hr=Kt-1,wr=Ct.length;++hr<wr;)if(An(Ct[hr],Ht))return hr;return-1}function kr(Ct){return Ct!==Ct}function ts(Ct,Ht){var Kt=Ct==null?0:Ct.length;return Kt?Hr(Ct,Ht)/Kt:ee}function Ms(Ct){return function(Ht){return Ht==null?n:Ht[Ct]}}function At(Ct){return function(Ht){return Ct==null?n:Ct[Ht]}}function ir(Ct,Ht,Kt,An,hr){return hr(Ct,function(wr,Sr,Ss){Kt=An?(An=!1,wr):Ht(Kt,wr,Sr,Ss)}),Kt}function Hn(Ct,Ht){var Kt=Ct.length;for(Ct.sort(Ht);Kt--;)Ct[Kt]=Ct[Kt].value;return Ct}function Hr(Ct,Ht){for(var Kt,An=-1,hr=Ct.length;++An<hr;){var wr=Ht(Ct[An]);wr!==n&&(Kt=Kt===n?wr:Kt+wr)}return Kt}function os(Ct,Ht){for(var Kt=-1,An=Array(Ct);++Kt<Ct;)An[Kt]=Ht(Kt);return An}function is(Ct,Ht){return Qn(Ht,function(Kt){return[Kt,Ct[Kt]]})}function ms(Ct){return Ct&&Ct.slice(0,le(Ct)+1).replace(sn,"")}function gs(Ct){return function(Ht){return Ct(Ht)}}function $i(Ct,Ht){return Qn(Ht,function(Kt){return Ct[Kt]})}function Bs(Ct,Ht){return Ct.has(Ht)}function bs(Ct,Ht){for(var Kt=-1,An=Ct.length;++Kt<An&&Wn(Ht,Ct[Kt],0)>-1;);return Kt}function Tr(Ct,Ht){for(var Kt=Ct.length;Kt--&&Wn(Ht,Ct[Kt],0)>-1;);return Kt}function ga(Ct,Ht){for(var Kt=Ct.length,An=0;Kt--;)Ct[Kt]===Ht&&++An;return An}var El=At(Tn),_l=At(tr);function Bu(Ct){return"\\"+Br[Ct]}function ba(Ct,Ht){return Ct==null?n:Ct[Ht]}function kl(Ct){return Rr.test(Ct)}function px(Ct){return Jr.test(Ct)}function $u(Ct){for(var Ht,Kt=[];!(Ht=Ct.next()).done;)Kt.push(Ht.value);return Kt}function gi(Ct){var Ht=-1,Kt=Array(Ct.size);return Ct.forEach(function(An,hr){Kt[++Ht]=[hr,An]}),Kt}function yd(Ct,Ht){return function(Kt){return Ct(Ht(Kt))}}function dt(Ct,Ht){for(var Kt=-1,An=Ct.length,hr=0,wr=[];++Kt<An;){var Sr=Ct[Kt];(Sr===Ht||Sr===d)&&(Ct[Kt]=d,wr[hr++]=Kt)}return wr}function y(Ct){var Ht=-1,Kt=Array(Ct.size);return Ct.forEach(function(An){Kt[++Ht]=An}),Kt}function E(Ct){var Ht=-1,Kt=Array(Ct.size);return Ct.forEach(function(An){Kt[++Ht]=[An,An]}),Kt}function O(Ct,Ht,Kt){for(var An=Kt-1,hr=Ct.length;++An<hr;)if(Ct[An]===Ht)return An;return-1}function $(Ct,Ht,Kt){for(var An=Kt+1;An--;)if(Ct[An]===Ht)return An;return An}function H(Ct){return kl(Ct)?Te(Ct):vn(Ct)}function K(Ct){return kl(Ct)?Ze(Ct):Mn(Ct)}function le(Ct){for(var Ht=Ct.length;Ht--&&Me.test(Ct.charAt(Ht)););return Ht}var we=At(Ar);function Te(Ct){for(var Ht=sr.lastIndex=0;sr.test(Ct);)++Ht;return Ht}function Ze(Ct){return Ct.match(sr)||[]}function pt(Ct){return Ct.match(rr)||[]}var _t=function Ct(Ht){Ht=Ht==null?gr:Jt.defaults(gr.Object(),Ht,Jt.pick(gr,ws));var Kt=Ht.Array,An=Ht.Date,hr=Ht.Error,wr=Ht.Function,Sr=Ht.Math,Ss=Ht.Object,Qs=Ht.RegExp,dc=Ht.String,Za=Ht.TypeError,Ja=Kt.prototype,da=wr.prototype,_a=Ss.prototype,Wo=Ht["__core-js_shared__"],vd=da.toString,Pi=_a.hasOwnProperty,_m=0,F1=function(){var D=/[^.]+$/.exec(Wo&&Wo.keys&&Wo.keys.IE_PROTO||"");return D?"Symbol(src)_1."+D:""}(),N2=_a.toString,T5=vd.call(Ss),AT=gr._,jT=Qs("^"+vd.call(Pi).replace(Kn,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),A2=Es?Ht.Buffer:n,mp=Ht.Symbol,j2=Ht.Uint8Array,d8=A2?A2.allocUnsafe:n,hf=yd(Ss.getPrototypeOf,Ss),I5=Ss.create,P5=_a.propertyIsEnumerable,F5=Ja.splice,ET=mp?mp.isConcatSpreadable:n,xp=mp?mp.iterator:n,mx=mp?mp.toStringTag:n,E2=function(){try{var D=Bm(Ss,"defineProperty");return D({},"",{}),D}catch{}}(),_T=Ht.clearTimeout!==gr.clearTimeout&&Ht.clearTimeout,Wa=An&&An.now!==gr.Date.now&&An.now,f8=Ht.setTimeout!==gr.setTimeout&&Ht.setTimeout,xx=Sr.ceil,km=Sr.floor,O5=Ss.getOwnPropertySymbols,h8=A2?A2.isBuffer:n,O1=Ht.isFinite,M5=Ja.join,M1=yd(Ss.keys,Ss),qo=Sr.max,fc=Sr.min,TU=An.now,kT=Ht.parseInt,_2=Sr.random,R5=Ja.reverse,k2=Bm(Ht,"DataView"),gx=Bm(Ht,"Map"),T2=Bm(Ht,"Promise"),Tm=Bm(Ht,"Set"),I2=Bm(Ht,"WeakMap"),R1=Bm(Ss,"create"),L5=I2&&new I2,L1={},p8=$m(k2),Im=$m(gx),TT=$m(T2),D1=$m(Tm),eh=$m(I2),Pm=mp?mp.prototype:n,Uu=Pm?Pm.valueOf:n,D5=Pm?Pm.toString:n;function Ot(D){if(Ko(D)&&!Si(D)&&!(D instanceof Ci)){if(D instanceof hc)return D;if(Pi.call(D,"__wrapped__"))return sI(D)}return new hc(D)}var B1=function(){function D(){}return function(W){if(!Do(W))return{};if(I5)return I5(W);D.prototype=W;var be=new D;return D.prototype=n,be}}();function th(){}function hc(D,W){this.__wrapped__=D,this.__actions__=[],this.__chain__=!!W,this.__index__=0,this.__values__=n}Ot.templateSettings={escape:Nn,evaluate:kn,interpolate:yn,variable:"",imports:{_:Ot}},Ot.prototype=th.prototype,Ot.prototype.constructor=Ot,hc.prototype=B1(th.prototype),hc.prototype.constructor=hc;function Ci(D){this.__wrapped__=D,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=ae,this.__views__=[]}function B5(){var D=new Ci(this.__wrapped__);return D.__actions__=Bc(this.__actions__),D.__dir__=this.__dir__,D.__filtered__=this.__filtered__,D.__iteratees__=Bc(this.__iteratees__),D.__takeCount__=this.__takeCount__,D.__views__=Bc(this.__views__),D}function m8(){if(this.__filtered__){var D=new Ci(this);D.__dir__=-1,D.__filtered__=!0}else D=this.clone(),D.__dir__*=-1;return D}function $1(){var D=this.__wrapped__.value(),W=this.__dir__,be=Si(D),Ve=W<0,xt=be?D.length:0,Yt=H8(0,xt,this.__views__),pn=Yt.start,Fn=Yt.end,qn=Fn-pn,Or=Ve?Fn:pn-1,Mr=this.__iteratees__,zr=Mr.length,cs=0,Rs=fc(qn,this.__takeCount__);if(!be||!Ve&&xt==qn&&Rs==qn)return K1(D,this.__actions__);var Zs=[];e:for(;qn--&&cs<Rs;){Or+=W;for(var Mi=-1,Js=D[Or];++Mi<zr;){var qi=Mr[Mi],Xi=qi.iteratee,Sf=qi.type,qu=Xi(Js);if(Sf==Y)Js=qu;else if(!qu){if(Sf==pe)continue e;break e}}Zs[cs++]=Js}return Zs}Ci.prototype=B1(th.prototype),Ci.prototype.constructor=Ci;function lu(D){var W=-1,be=D==null?0:D.length;for(this.clear();++W<be;){var Ve=D[W];this.set(Ve[0],Ve[1])}}function qa(){this.__data__=R1?R1(null):{},this.size=0}function $a(D){var W=this.has(D)&&delete this.__data__[D];return this.size-=W?1:0,W}function Fm(D){var W=this.__data__;if(R1){var be=W[D];return be===c?n:be}return Pi.call(W,D)?W[D]:n}function pc(D){var W=this.__data__;return R1?W[D]!==n:Pi.call(W,D)}function cu(D,W){var be=this.__data__;return this.size+=this.has(D)?0:1,be[D]=R1&&W===n?c:W,this}lu.prototype.clear=qa,lu.prototype.delete=$a,lu.prototype.get=Fm,lu.prototype.has=pc,lu.prototype.set=cu;function Dc(D){var W=-1,be=D==null?0:D.length;for(this.clear();++W<be;){var Ve=D[W];this.set(Ve[0],Ve[1])}}function U1(){this.__data__=[],this.size=0}function uu(D){var W=this.__data__,be=xc(W,D);if(be<0)return!1;var Ve=W.length-1;return be==Ve?W.pop():F5.call(W,be,1),--this.size,!0}function $5(D){var W=this.__data__,be=xc(W,D);return be<0?n:W[be][1]}function IT(D){return xc(this.__data__,D)>-1}function PT(D,W){var be=this.__data__,Ve=xc(be,D);return Ve<0?(++this.size,be.push([D,W])):be[Ve][1]=W,this}Dc.prototype.clear=U1,Dc.prototype.delete=uu,Dc.prototype.get=$5,Dc.prototype.has=IT,Dc.prototype.set=PT;function wd(D){var W=-1,be=D==null?0:D.length;for(this.clear();++W<be;){var Ve=D[W];this.set(Ve[0],Ve[1])}}function FT(){this.size=0,this.__data__={hash:new lu,map:new(gx||Dc),string:new lu}}function gp(D){var W=G2(this,D).delete(D);return this.size-=W?1:0,W}function U5(D){return G2(this,D).get(D)}function x8(D){return G2(this,D).has(D)}function OT(D,W){var be=G2(this,D),Ve=be.size;return be.set(D,W),this.size+=be.size==Ve?0:1,this}wd.prototype.clear=FT,wd.prototype.delete=gp,wd.prototype.get=U5,wd.prototype.has=x8,wd.prototype.set=OT;function bx(D){var W=-1,be=D==null?0:D.length;for(this.__data__=new wd;++W<be;)this.add(D[W])}function Om(D){return this.__data__.set(D,c),this}function z1(D){return this.__data__.has(D)}bx.prototype.add=bx.prototype.push=Om,bx.prototype.has=z1;function mc(D){var W=this.__data__=new Dc(D);this.size=W.size}function z5(){this.__data__=new Dc,this.size=0}function H5(D){var W=this.__data__,be=W.delete(D);return this.size=W.size,be}function Cd(D){return this.__data__.get(D)}function Sd(D){return this.__data__.has(D)}function yx(D,W){var be=this.__data__;if(be instanceof Dc){var Ve=be.__data__;if(!gx||Ve.length<s-1)return Ve.push([D,W]),this.size=++be.size,this;be=this.__data__=new wd(Ve)}return be.set(D,W),this.size=be.size,this}mc.prototype.clear=z5,mc.prototype.delete=H5,mc.prototype.get=Cd,mc.prototype.has=Sd,mc.prototype.set=yx;function nh(D,W){var be=Si(D),Ve=!be&&iv(D),xt=!be&&!Ve&&sb(D),Yt=!be&&!Ve&&!xt&&O6(D),pn=be||Ve||xt||Yt,Fn=pn?os(D.length,dc):[],qn=Fn.length;for(var Or in D)(W||Pi.call(D,Or))&&!(pn&&(Or=="length"||xt&&(Or=="offset"||Or=="parent")||Yt&&(Or=="buffer"||Or=="byteLength"||Or=="byteOffset")||to(Or,qn)))&&Fn.push(Or);return Fn}function rh(D){var W=D.length;return W?D[q1(0,W-1)]:n}function vx(D,W){return m6(Bc(D),bp(W,0,D.length))}function MT(D){return m6(Bc(D))}function P2(D,W,be){(be!==n&&!_p(D[W],be)||be===n&&!(W in D))&&sh(D,W,be)}function wx(D,W,be){var Ve=D[W];(!(Pi.call(D,W)&&_p(Ve,be))||be===n&&!(W in D))&&sh(D,W,be)}function xc(D,W){for(var be=D.length;be--;)if(_p(D[be][0],W))return be;return-1}function zu(D,W,be,Ve){return ah(D,function(xt,Yt,pn){W(Ve,xt,be(xt),pn)}),Ve}function Ga(D,W){return D&&mf(W,yc(W),D)}function pf(D,W){return D&&mf(W,Pd(W),D)}function sh(D,W,be){W=="__proto__"&&E2?E2(D,W,{configurable:!0,enumerable:!0,value:be,writable:!0}):D[W]=be}function V5(D,W){for(var be=-1,Ve=W.length,xt=Kt(Ve),Yt=D==null;++be<Ve;)xt[be]=Yt?n:ZU(D,W[be]);return xt}function bp(D,W,be){return D===D&&(be!==n&&(D=D<=be?D:be),W!==n&&(D=D>=W?D:W)),D}function du(D,W,be,Ve,xt,Yt){var pn,Fn=W&f,qn=W&x,Or=W&g;if(be&&(pn=xt?be(D,Ve,xt,Yt):be(D)),pn!==n)return pn;if(!Do(D))return D;var Mr=Si(D);if(Mr){if(pn=Y2(D),!Fn)return Bc(D,pn)}else{var zr=Kl(D),cs=zr==$e||zr==it;if(sb(D))return I8(D,Fn);if(zr==ut||zr==ge||cs&&!xt){if(pn=qn||cs?{}:Yl(D),!Fn)return qn?PU(D,pf(pn,D)):r6(D,Ga(pn,D))}else{if(!yt[zr])return xt?D:{};pn=FU(D,zr,Fn)}}Yt||(Yt=new mc);var Rs=Yt.get(D);if(Rs)return Rs;Yt.set(D,pn),ede(D)?D.forEach(function(Js){pn.add(du(Js,W,be,Js,D,Yt))}):Zue(D)&&D.forEach(function(Js,qi){pn.set(qi,du(Js,W,be,qi,D,Yt))});var Zs=Or?qn?q2:W2:qn?Pd:yc,Mi=Mr?n:Zs(D);return fr(Mi||D,function(Js,qi){Mi&&(qi=Js,Js=D[qi]),wx(pn,qi,du(Js,W,be,qi,D,Yt))}),pn}function RT(D){var W=yc(D);return function(be){return F2(be,D,W)}}function F2(D,W,be){var Ve=be.length;if(D==null)return!Ve;for(D=Ss(D);Ve--;){var xt=be[Ve],Yt=W[xt],pn=D[xt];if(pn===n&&!(xt in D)||!Yt(pn))return!1}return!0}function g8(D,W,be){if(typeof D!="function")throw new Za(o);return tb(function(){D.apply(n,be)},W)}function ih(D,W,be,Ve){var xt=-1,Yt=Ir,pn=!0,Fn=D.length,qn=[],Or=W.length;if(!Fn)return qn;be&&(W=Qn(W,gs(be))),Ve?(Yt=mr,pn=!1):W.length>=s&&(Yt=Bs,pn=!1,W=new bx(W));e:for(;++xt<Fn;){var Mr=D[xt],zr=be==null?Mr:be(Mr);if(Mr=Ve||Mr!==0?Mr:0,pn&&zr===zr){for(var cs=Or;cs--;)if(W[cs]===zr)continue e;qn.push(Mr)}else Yt(W,zr,Ve)||qn.push(Mr)}return qn}var ah=_d(Hu),LT=_d(Mm,!0);function O2(D,W){var be=!0;return ah(D,function(Ve,xt,Yt){return be=!!W(Ve,xt,Yt),be}),be}function Cx(D,W,be){for(var Ve=-1,xt=D.length;++Ve<xt;){var Yt=D[Ve],pn=W(Yt);if(pn!=null&&(Fn===n?pn===pn&&!Cf(pn):be(pn,Fn)))var Fn=pn,qn=Yt}return qn}function DT(D,W,be,Ve){var xt=D.length;for(be=Oi(be),be<0&&(be=-be>xt?0:xt+be),Ve=Ve===n||Ve>xt?xt:Oi(Ve),Ve<0&&(Ve+=xt),Ve=be>Ve?0:nde(Ve);be<Ve;)D[be++]=W;return D}function b8(D,W){var be=[];return ah(D,function(Ve,xt,Yt){W(Ve,xt,Yt)&&be.push(Ve)}),be}function No(D,W,be,Ve,xt){var Yt=-1,pn=D.length;for(be||(be=f6),xt||(xt=[]);++Yt<pn;){var Fn=D[Yt];W>0&&be(Fn)?W>1?No(Fn,W-1,be,Ve,xt):xs(xt,Fn):Ve||(xt[xt.length]=Fn)}return xt}var W5=i6(),M2=i6(!0);function Hu(D,W){return D&&W5(D,W,yc)}function Mm(D,W){return D&&M2(D,W,yc)}function H1(D,W){return ss(W,function(be){return Ox(D[be])})}function yp(D,W){W=ch(W,D);for(var be=0,Ve=W.length;D!=null&&be<Ve;)D=D[yf(W[be++])];return be&&be==Ve?D:n}function q5(D,W,be){var Ve=W(D);return Si(D)?Ve:xs(Ve,be(D))}function ql(D){return D==null?D===n?Ft:ft:mx&&mx in Ss(D)?d6(D):W8(D)}function Rm(D,W){return D>W}function Nd(D,W){return D!=null&&Pi.call(D,W)}function Sx(D,W){return D!=null&&W in Ss(D)}function y8(D,W,be){return D>=fc(W,be)&&D<qo(W,be)}function G5(D,W,be){for(var Ve=be?mr:Ir,xt=D[0].length,Yt=D.length,pn=Yt,Fn=Kt(Yt),qn=1/0,Or=[];pn--;){var Mr=D[pn];pn&&W&&(Mr=Qn(Mr,gs(W))),qn=fc(Mr.length,qn),Fn[pn]=!be&&(W||xt>=120&&Mr.length>=120)?new bx(pn&&Mr):n}Mr=D[0];var zr=-1,cs=Fn[0];e:for(;++zr<xt&&Or.length<qn;){var Rs=Mr[zr],Zs=W?W(Rs):Rs;if(Rs=be||Rs!==0?Rs:0,!(cs?Bs(cs,Zs):Ve(Or,Zs,be))){for(pn=Yt;--pn;){var Mi=Fn[pn];if(!(Mi?Bs(Mi,Zs):Ve(D[pn],Zs,be)))continue e}cs&&cs.push(Zs),Or.push(Rs)}}return Or}function vp(D,W,be,Ve){return Hu(D,function(xt,Yt,pn){W(Ve,be(xt),Yt,pn)}),Ve}function Ad(D,W,be){W=ch(W,D),D=Tl(D,W);var Ve=D==null?D:D[yf(zc(W))];return Ve==null?n:cr(Ve,D,be)}function K5(D){return Ko(D)&&ql(D)==ge}function BT(D){return Ko(D)&&ql(D)==$t}function wp(D){return Ko(D)&&ql(D)==Ie}function jd(D,W,be,Ve,xt){return D===W?!0:D==null||W==null||!Ko(D)&&!Ko(W)?D!==D&&W!==W:Y5(D,W,be,Ve,jd,xt)}function Y5(D,W,be,Ve,xt,Yt){var pn=Si(D),Fn=Si(W),qn=pn?ye:Kl(D),Or=Fn?ye:Kl(W);qn=qn==ge?ut:qn,Or=Or==ge?ut:Or;var Mr=qn==ut,zr=Or==ut,cs=qn==Or;if(cs&&sb(D)){if(!sb(W))return!1;pn=!0,Mr=!1}if(cs&&!Mr)return Yt||(Yt=new mc),pn||O6(D)?U8(D,W,be,Ve,xt,Yt):z8(D,W,qn,be,Ve,xt,Yt);if(!(be&v)){var Rs=Mr&&Pi.call(D,"__wrapped__"),Zs=zr&&Pi.call(W,"__wrapped__");if(Rs||Zs){var Mi=Rs?D.value():D,Js=Zs?W.value():W;return Yt||(Yt=new mc),xt(Mi,Js,be,Ve,Yt)}}return cs?(Yt||(Yt=new mc),XT(D,W,be,Ve,xt,Yt)):!1}function $T(D){return Ko(D)&&Kl(D)==tt}function V1(D,W,be,Ve){var xt=be.length,Yt=xt,pn=!Ve;if(D==null)return!Yt;for(D=Ss(D);xt--;){var Fn=be[xt];if(pn&&Fn[2]?Fn[1]!==D[Fn[0]]:!(Fn[0]in D))return!1}for(;++xt<Yt;){Fn=be[xt];var qn=Fn[0],Or=D[qn],Mr=Fn[1];if(pn&&Fn[2]){if(Or===n&&!(qn in D))return!1}else{var zr=new mc;if(Ve)var cs=Ve(Or,Mr,qn,D,W,zr);if(!(cs===n?jd(Mr,Or,v|w,Ve,zr):cs))return!1}}return!0}function v8(D){if(!Do(D)||JT(D))return!1;var W=Ox(D)?jT:lr;return W.test($m(D))}function R2(D){return Ko(D)&&ql(D)==nn}function oh(D){return Ko(D)&&Kl(D)==jt}function L2(D){return Ko(D)&&bI(D.length)&&!!et[ql(D)]}function W1(D){return typeof D=="function"?D:D==null?Fd:typeof D=="object"?Si(D)?eo(D[0],D[1]):X5(D):hde(D)}function Cp(D){if(!jp(D))return M1(D);var W=[];for(var be in Ss(D))Pi.call(D,be)&&be!="constructor"&&W.push(be);return W}function w8(D){if(!Do(D))return nI(D);var W=jp(D),be=[];for(var Ve in D)Ve=="constructor"&&(W||!Pi.call(D,Ve))||be.push(Ve);return be}function Lm(D,W){return D<W}function C8(D,W){var be=-1,Ve=Id(D)?Kt(D.length):[];return ah(D,function(xt,Yt,pn){Ve[++be]=W(xt,Yt,pn)}),Ve}function X5(D){var W=K2(D);return W.length==1&&W[0][2]?h6(W[0][0],W[0][1]):function(be){return be===D||V1(be,D,W)}}function eo(D,W){return ys(D)&&Q2(W)?h6(yf(D),W):function(be){var Ve=ZU(be,D);return Ve===n&&Ve===W?JU(be,D):jd(W,Ve,v|w)}}function Nx(D,W,be,Ve,xt){D!==W&&W5(W,function(Yt,pn){if(xt||(xt=new mc),Do(Yt))S8(D,W,pn,be,Nx,Ve,xt);else{var Fn=Ve?Ve(fh(D,pn),Yt,pn+"",D,W,xt):n;Fn===n&&(Fn=Yt),P2(D,pn,Fn)}},Pd)}function S8(D,W,be,Ve,xt,Yt,pn){var Fn=fh(D,be),qn=fh(W,be),Or=pn.get(qn);if(Or){P2(D,be,Or);return}var Mr=Yt?Yt(Fn,qn,be+"",D,W,pn):n,zr=Mr===n;if(zr){var cs=Si(qn),Rs=!cs&&sb(qn),Zs=!cs&&!Rs&&O6(qn);Mr=qn,cs||Rs||Zs?Si(Fn)?Mr=Fn:dl(Fn)?Mr=Bc(Fn):Rs?(zr=!1,Mr=I8(qn,!0)):Zs?(zr=!1,Mr=WT(qn,!0)):Mr=[]:c7(qn)||iv(qn)?(Mr=Fn,iv(Fn)?Mr=rde(Fn):(!Do(Fn)||Ox(Fn))&&(Mr=Yl(qn))):zr=!1}zr&&(pn.set(qn,Mr),xt(Mr,qn,Ve,Yt,pn),pn.delete(qn)),P2(D,be,Mr)}function Q5(D,W){var be=D.length;if(be)return W+=W<0?be:0,to(W,be)?D[W]:n}function D2(D,W,be){W.length?W=Qn(W,function(Yt){return Si(Yt)?function(pn){return yp(pn,Yt.length===1?Yt[0]:Yt)}:Yt}):W=[Fd];var Ve=-1;W=Qn(W,gs(Ws()));var xt=C8(D,function(Yt,pn,Fn){var qn=Qn(W,function(Or){return Or(Yt)});return{criteria:qn,index:++Ve,value:Yt}});return Hn(xt,function(Yt,pn){return IU(Yt,pn,be)})}function N8(D,W){return Dm(D,W,function(be,Ve){return JU(D,Ve)})}function Dm(D,W,be){for(var Ve=-1,xt=W.length,Yt={};++Ve<xt;){var pn=W[Ve],Fn=yp(D,pn);be(Fn,pn)&&jx(Yt,ch(pn,D),Fn)}return Yt}function fo(D){return function(W){return yp(W,D)}}function Lo(D,W,be,Ve){var xt=Ve?Fr:Wn,Yt=-1,pn=W.length,Fn=D;for(D===W&&(W=Bc(W)),be&&(Fn=Qn(D,gs(be)));++Yt<pn;)for(var qn=0,Or=W[Yt],Mr=be?be(Or):Or;(qn=xt(Fn,Mr,qn,Ve))>-1;)Fn!==D&&F5.call(Fn,qn,1),F5.call(D,qn,1);return D}function ll(D,W){for(var be=D?W.length:0,Ve=be-1;be--;){var xt=W[be];if(be==Ve||xt!==Yt){var Yt=xt;to(xt)?F5.call(D,xt,1):e6(D,xt)}}return D}function q1(D,W){return D+km(_2()*(W-D+1))}function B2(D,W,be,Ve){for(var xt=-1,Yt=qo(xx((W-D)/(be||1)),0),pn=Kt(Yt);Yt--;)pn[Ve?Yt:++xt]=D,D+=be;return pn}function Ax(D,W){var be="";if(!D||W<1||W>G)return be;do W%2&&(be+=D),W=km(W/2),W&&(D+=D);while(W);return be}function Fi(D,W){return Vu(p6(D,W,Fd),D+"")}function gc(D){return rh(M6(D))}function A8(D,W){var be=M6(D);return m6(be,bp(W,0,be.length))}function jx(D,W,be,Ve){if(!Do(D))return D;W=ch(W,D);for(var xt=-1,Yt=W.length,pn=Yt-1,Fn=D;Fn!=null&&++xt<Yt;){var qn=yf(W[xt]),Or=be;if(qn==="__proto__"||qn==="constructor"||qn==="prototype")return D;if(xt!=pn){var Mr=Fn[qn];Or=Ve?Ve(Mr,qn,Fn):n,Or===n&&(Or=Do(Mr)?Mr:to(W[xt+1])?[]:{})}wx(Fn,qn,Or),Fn=Fn[qn]}return D}var Z5=L5?function(D,W){return L5.set(D,W),D}:Fd,lh=E2?function(D,W){return E2(D,"toString",{configurable:!0,enumerable:!1,value:tz(W),writable:!0})}:Fd;function Ed(D){return m6(M6(D))}function bc(D,W,be){var Ve=-1,xt=D.length;W<0&&(W=-W>xt?0:xt+W),be=be>xt?xt:be,be<0&&(be+=xt),xt=W>be?0:be-W>>>0,W>>>=0;for(var Yt=Kt(xt);++Ve<xt;)Yt[Ve]=D[Ve+W];return Yt}function j8(D,W){var be;return ah(D,function(Ve,xt,Yt){return be=W(Ve,xt,Yt),!be}),!!be}function G1(D,W,be){var Ve=0,xt=D==null?Ve:D.length;if(typeof W=="number"&&W===W&&xt<=Ne){for(;Ve<xt;){var Yt=Ve+xt>>>1,pn=D[Yt];pn!==null&&!Cf(pn)&&(be?pn<=W:pn<W)?Ve=Yt+1:xt=Yt}return xt}return J5(D,W,Fd,be)}function J5(D,W,be,Ve){var xt=0,Yt=D==null?0:D.length;if(Yt===0)return 0;W=be(W);for(var pn=W!==W,Fn=W===null,qn=Cf(W),Or=W===n;xt<Yt;){var Mr=km((xt+Yt)/2),zr=be(D[Mr]),cs=zr!==n,Rs=zr===null,Zs=zr===zr,Mi=Cf(zr);if(pn)var Js=Ve||Zs;else Or?Js=Zs&&(Ve||cs):Fn?Js=Zs&&cs&&(Ve||!Rs):qn?Js=Zs&&cs&&!Rs&&(Ve||!Mi):Rs||Mi?Js=!1:Js=Ve?zr<=W:zr<W;Js?xt=Mr+1:Yt=Mr}return fc(Yt,fe)}function E8(D,W){for(var be=-1,Ve=D.length,xt=0,Yt=[];++be<Ve;){var pn=D[be],Fn=W?W(pn):pn;if(!be||!_p(Fn,qn)){var qn=Fn;Yt[xt++]=pn===0?0:pn}}return Yt}function _8(D){return typeof D=="number"?D:Cf(D)?ee:+D}function fu(D){if(typeof D=="string")return D;if(Si(D))return Qn(D,fu)+"";if(Cf(D))return D5?D5.call(D):"";var W=D+"";return W=="0"&&1/D==-1/0?"-0":W}function Sp(D,W,be){var Ve=-1,xt=Ir,Yt=D.length,pn=!0,Fn=[],qn=Fn;if(be)pn=!1,xt=mr;else if(Yt>=s){var Or=W?null:YT(D);if(Or)return y(Or);pn=!1,xt=Bs,qn=new bx}else qn=W?[]:Fn;e:for(;++Ve<Yt;){var Mr=D[Ve],zr=W?W(Mr):Mr;if(Mr=be||Mr!==0?Mr:0,pn&&zr===zr){for(var cs=qn.length;cs--;)if(qn[cs]===zr)continue e;W&&qn.push(zr),Fn.push(Mr)}else xt(qn,zr,be)||(qn!==Fn&&qn.push(zr),Fn.push(Mr))}return Fn}function e6(D,W){return W=ch(W,D),D=Tl(D,W),D==null||delete D[yf(zc(W))]}function k8(D,W,be,Ve){return jx(D,W,be(yp(D,W)),Ve)}function $2(D,W,be,Ve){for(var xt=D.length,Yt=Ve?xt:-1;(Ve?Yt--:++Yt<xt)&&W(D[Yt],Yt,D););return be?bc(D,Ve?0:Yt,Ve?Yt+1:xt):bc(D,Ve?Yt+1:0,Ve?xt:Yt)}function K1(D,W){var be=D;return be instanceof Ci&&(be=be.value()),Xs(W,function(Ve,xt){return xt.func.apply(xt.thisArg,xs([Ve],xt.args))},be)}function t6(D,W,be){var Ve=D.length;if(Ve<2)return Ve?Sp(D[0]):[];for(var xt=-1,Yt=Kt(Ve);++xt<Ve;)for(var pn=D[xt],Fn=-1;++Fn<Ve;)Fn!=xt&&(Yt[xt]=ih(Yt[xt]||pn,D[Fn],W,be));return Sp(No(Yt,1),W,be)}function U2(D,W,be){for(var Ve=-1,xt=D.length,Yt=W.length,pn={};++Ve<xt;){var Fn=Ve<Yt?W[Ve]:n;be(pn,D[Ve],Fn)}return pn}function Y1(D){return dl(D)?D:[]}function n6(D){return typeof D=="function"?D:Fd}function ch(D,W){return Si(D)?D:ys(D,W)?[D]:K8(ka(D))}var UT=Fi;function Np(D,W,be){var Ve=D.length;return be=be===n?Ve:be,!W&&be>=Ve?D:bc(D,W,be)}var T8=_T||function(D){return gr.clearTimeout(D)};function I8(D,W){if(W)return D.slice();var be=D.length,Ve=d8?d8(be):new D.constructor(be);return D.copy(Ve),Ve}function z2(D){var W=new D.constructor(D.byteLength);return new j2(W).set(new j2(D)),W}function zT(D,W){var be=W?z2(D.buffer):D.buffer;return new D.constructor(be,D.byteOffset,D.byteLength)}function HT(D){var W=new D.constructor(D.source,In.exec(D));return W.lastIndex=D.lastIndex,W}function VT(D){return Uu?Ss(Uu.call(D)):{}}function WT(D,W){var be=W?z2(D.buffer):D.buffer;return new D.constructor(be,D.byteOffset,D.length)}function P8(D,W){if(D!==W){var be=D!==n,Ve=D===null,xt=D===D,Yt=Cf(D),pn=W!==n,Fn=W===null,qn=W===W,Or=Cf(W);if(!Fn&&!Or&&!Yt&&D>W||Yt&&pn&&qn&&!Fn&&!Or||Ve&&pn&&qn||!be&&qn||!xt)return 1;if(!Ve&&!Yt&&!Or&&D<W||Or&&be&&xt&&!Ve&&!Yt||Fn&&be&&xt||!pn&&xt||!qn)return-1}return 0}function IU(D,W,be){for(var Ve=-1,xt=D.criteria,Yt=W.criteria,pn=xt.length,Fn=be.length;++Ve<pn;){var qn=P8(xt[Ve],Yt[Ve]);if(qn){if(Ve>=Fn)return qn;var Or=be[Ve];return qn*(Or=="desc"?-1:1)}}return D.index-W.index}function qT(D,W,be,Ve){for(var xt=-1,Yt=D.length,pn=be.length,Fn=-1,qn=W.length,Or=qo(Yt-pn,0),Mr=Kt(qn+Or),zr=!Ve;++Fn<qn;)Mr[Fn]=W[Fn];for(;++xt<pn;)(zr||xt<Yt)&&(Mr[be[xt]]=D[xt]);for(;Or--;)Mr[Fn++]=D[xt++];return Mr}function F8(D,W,be,Ve){for(var xt=-1,Yt=D.length,pn=-1,Fn=be.length,qn=-1,Or=W.length,Mr=qo(Yt-Fn,0),zr=Kt(Mr+Or),cs=!Ve;++xt<Mr;)zr[xt]=D[xt];for(var Rs=xt;++qn<Or;)zr[Rs+qn]=W[qn];for(;++pn<Fn;)(cs||xt<Yt)&&(zr[Rs+be[pn]]=D[xt++]);return zr}function Bc(D,W){var be=-1,Ve=D.length;for(W||(W=Kt(Ve));++be<Ve;)W[be]=D[be];return W}function mf(D,W,be,Ve){var xt=!be;be||(be={});for(var Yt=-1,pn=W.length;++Yt<pn;){var Fn=W[Yt],qn=Ve?Ve(be[Fn],D[Fn],Fn,be,D):n;qn===n&&(qn=D[Fn]),xt?sh(be,Fn,qn):wx(be,Fn,qn)}return be}function r6(D,W){return mf(D,xf(D),W)}function PU(D,W){return mf(D,QT(D),W)}function s6(D,W){return function(be,Ve){var xt=Si(be)?Nr:zu,Yt=W?W():{};return xt(be,D,Ws(Ve,2),Yt)}}function X1(D){return Fi(function(W,be){var Ve=-1,xt=be.length,Yt=xt>1?be[xt-1]:n,pn=xt>2?be[2]:n;for(Yt=D.length>3&&typeof Yt=="function"?(xt--,Yt):n,pn&&Uc(be[0],be[1],pn)&&(Yt=xt<3?n:Yt,xt=1),W=Ss(W);++Ve<xt;){var Fn=be[Ve];Fn&&D(W,Fn,Ve,Yt)}return W})}function _d(D,W){return function(be,Ve){if(be==null)return be;if(!Id(be))return D(be,Ve);for(var xt=be.length,Yt=W?xt:-1,pn=Ss(be);(W?Yt--:++Yt<xt)&&Ve(pn[Yt],Yt,pn)!==!1;);return be}}function i6(D){return function(W,be,Ve){for(var xt=-1,Yt=Ss(W),pn=Ve(W),Fn=pn.length;Fn--;){var qn=pn[D?Fn:++xt];if(be(Yt[qn],qn,Yt)===!1)break}return W}}function a6(D,W,be){var Ve=W&C,xt=Q1(D);function Yt(){var pn=this&&this!==gr&&this instanceof Yt?xt:D;return pn.apply(Ve?be:this,arguments)}return Yt}function O8(D){return function(W){W=ka(W);var be=kl(W)?K(W):n,Ve=be?be[0]:W.charAt(0),xt=be?Np(be,1).join(""):W.slice(1);return Ve[D]()+xt}}function Ex(D){return function(W){return Xs(dde(ude(W).replace(Bn,"")),D,"")}}function Q1(D){return function(){var W=arguments;switch(W.length){case 0:return new D;case 1:return new D(W[0]);case 2:return new D(W[0],W[1]);case 3:return new D(W[0],W[1],W[2]);case 4:return new D(W[0],W[1],W[2],W[3]);case 5:return new D(W[0],W[1],W[2],W[3],W[4]);case 6:return new D(W[0],W[1],W[2],W[3],W[4],W[5]);case 7:return new D(W[0],W[1],W[2],W[3],W[4],W[5],W[6])}var be=B1(D.prototype),Ve=D.apply(be,W);return Do(Ve)?Ve:be}}function M8(D,W,be){var Ve=Q1(D);function xt(){for(var Yt=arguments.length,pn=Kt(Yt),Fn=Yt,qn=Ap(xt);Fn--;)pn[Fn]=arguments[Fn];var Or=Yt<3&&pn[0]!==qn&&pn[Yt-1]!==qn?[]:dt(pn,qn);if(Yt-=Or.length,Yt<be)return $c(D,W,Z1,xt.placeholder,n,pn,Or,n,n,be-Yt);var Mr=this&&this!==gr&&this instanceof xt?Ve:D;return cr(Mr,this,pn)}return xt}function _x(D){return function(W,be,Ve){var xt=Ss(W);if(!Id(W)){var Yt=Ws(be,3);W=yc(W),be=function(Fn){return Yt(xt[Fn],Fn,xt)}}var pn=D(W,be,Ve);return pn>-1?xt[Yt?W[pn]:pn]:n}}function o6(D){return dh(function(W){var be=W.length,Ve=be,xt=hc.prototype.thru;for(D&&W.reverse();Ve--;){var Yt=W[Ve];if(typeof Yt!="function")throw new Za(o);if(xt&&!pn&&J1(Yt)=="wrapper")var pn=new hc([],!0)}for(Ve=pn?Ve:be;++Ve<be;){Yt=W[Ve];var Fn=J1(Yt),qn=Fn=="wrapper"?u6(Yt):n;qn&&X2(qn[0])&&qn[1]==(L|I|F|z)&&!qn[4].length&&qn[9]==1?pn=pn[J1(qn[0])].apply(pn,qn[3]):pn=Yt.length==1&&X2(Yt)?pn[Fn]():pn.thru(Yt)}return function(){var Or=arguments,Mr=Or[0];if(pn&&Or.length==1&&Si(Mr))return pn.plant(Mr).value();for(var zr=0,cs=be?W[zr].apply(this,Or):Mr;++zr<be;)cs=W[zr].call(this,cs);return cs}})}function Z1(D,W,be,Ve,xt,Yt,pn,Fn,qn,Or){var Mr=W&L,zr=W&C,cs=W&N,Rs=W&(I|R),Zs=W&Q,Mi=cs?n:Q1(D);function Js(){for(var qi=arguments.length,Xi=Kt(qi),Sf=qi;Sf--;)Xi[Sf]=arguments[Sf];if(Rs)var qu=Ap(Js),Nf=ga(Xi,qu);if(Ve&&(Xi=qT(Xi,Ve,xt,Rs)),Yt&&(Xi=F8(Xi,Yt,pn,Rs)),qi-=Nf,Rs&&qi<Or){var fl=dt(Xi,qu);return $c(D,W,Z1,Js.placeholder,be,Xi,fl,Fn,qn,Or-qi)}var kp=zr?be:this,Rx=cs?kp[D]:D;return qi=Xi.length,Fn?Xi=gf(Xi,Fn):Zs&&qi>1&&Xi.reverse(),Mr&&qn<qi&&(Xi.length=qn),this&&this!==gr&&this instanceof Js&&(Rx=Mi||Q1(Rx)),Rx.apply(kp,Xi)}return Js}function GT(D,W){return function(be,Ve){return vp(be,D,W(Ve),{})}}function H2(D,W){return function(be,Ve){var xt;if(be===n&&Ve===n)return W;if(be!==n&&(xt=be),Ve!==n){if(xt===n)return Ve;typeof be=="string"||typeof Ve=="string"?(be=fu(be),Ve=fu(Ve)):(be=_8(be),Ve=_8(Ve)),xt=D(be,Ve)}return xt}}function l6(D){return dh(function(W){return W=Qn(W,gs(Ws())),Fi(function(be){var Ve=this;return D(W,function(xt){return cr(xt,Ve,be)})})})}function V2(D,W){W=W===n?" ":fu(W);var be=W.length;if(be<2)return be?Ax(W,D):W;var Ve=Ax(W,xx(D/H(W)));return kl(W)?Np(K(Ve),0,D).join(""):Ve.slice(0,D)}function KT(D,W,be,Ve){var xt=W&C,Yt=Q1(D);function pn(){for(var Fn=-1,qn=arguments.length,Or=-1,Mr=Ve.length,zr=Kt(Mr+qn),cs=this&&this!==gr&&this instanceof pn?Yt:D;++Or<Mr;)zr[Or]=Ve[Or];for(;qn--;)zr[Or++]=arguments[++Fn];return cr(cs,xt?be:this,zr)}return pn}function R8(D){return function(W,be,Ve){return Ve&&typeof Ve!="number"&&Uc(W,be,Ve)&&(be=Ve=n),W=Mx(W),be===n?(be=W,W=0):be=Mx(be),Ve=Ve===n?W<be?1:-1:Mx(Ve),B2(W,be,Ve,D)}}function c6(D){return function(W,be){return typeof W=="string"&&typeof be=="string"||(W=hh(W),be=hh(be)),D(W,be)}}function $c(D,W,be,Ve,xt,Yt,pn,Fn,qn,Or){var Mr=W&I,zr=Mr?pn:n,cs=Mr?n:pn,Rs=Mr?Yt:n,Zs=Mr?n:Yt;W|=Mr?F:U,W&=~(Mr?U:F),W&P||(W&=-4);var Mi=[D,W,xt,Rs,zr,Zs,cs,Fn,qn,Or],Js=be.apply(n,Mi);return X2(D)&&q8(Js,Mi),Js.placeholder=Ve,G8(Js,D,W)}function Gl(D){var W=Sr[D];return function(be,Ve){if(be=hh(be),Ve=Ve==null?0:fc(Oi(Ve),292),Ve&&O1(be)){var xt=(ka(be)+"e").split("e"),Yt=W(xt[0]+"e"+(+xt[1]+Ve));return xt=(ka(Yt)+"e").split("e"),+(xt[0]+"e"+(+xt[1]-Ve))}return W(be)}}var YT=Tm&&1/y(new Tm([,-0]))[1]==oe?function(D){return new Tm(D)}:sz;function L8(D){return function(W){var be=Kl(W);return be==tt?gi(W):be==jt?E(W):is(W,D(W))}}function uh(D,W,be,Ve,xt,Yt,pn,Fn){var qn=W&N;if(!qn&&typeof D!="function")throw new Za(o);var Or=Ve?Ve.length:0;if(Or||(W&=-97,Ve=xt=n),pn=pn===n?pn:qo(Oi(pn),0),Fn=Fn===n?Fn:Oi(Fn),Or-=xt?xt.length:0,W&U){var Mr=Ve,zr=xt;Ve=xt=n}var cs=qn?n:u6(D),Rs=[D,W,be,Ve,xt,Mr,zr,Yt,pn,Fn];if(cs&&tI(Rs,cs),D=Rs[0],W=Rs[1],be=Rs[2],Ve=Rs[3],xt=Rs[4],Fn=Rs[9]=Rs[9]===n?qn?0:D.length:qo(Rs[9]-Or,0),!Fn&&W&(I|R)&&(W&=-25),!W||W==C)var Zs=a6(D,W,be);else W==I||W==R?Zs=M8(D,W,Fn):(W==F||W==(C|F))&&!xt.length?Zs=KT(D,W,be,Ve):Zs=Z1.apply(n,Rs);var Mi=cs?Z5:q8;return G8(Mi(Zs,Rs),D,W)}function D8(D,W,be,Ve){return D===n||_p(D,_a[be])&&!Pi.call(Ve,be)?W:D}function B8(D,W,be,Ve,xt,Yt){return Do(D)&&Do(W)&&(Yt.set(W,D),Nx(D,W,n,B8,Yt),Yt.delete(W)),D}function $8(D){return c7(D)?n:D}function U8(D,W,be,Ve,xt,Yt){var pn=be&v,Fn=D.length,qn=W.length;if(Fn!=qn&&!(pn&&qn>Fn))return!1;var Or=Yt.get(D),Mr=Yt.get(W);if(Or&&Mr)return Or==W&&Mr==D;var zr=-1,cs=!0,Rs=be&w?new bx:n;for(Yt.set(D,W),Yt.set(W,D);++zr<Fn;){var Zs=D[zr],Mi=W[zr];if(Ve)var Js=pn?Ve(Mi,Zs,zr,W,D,Yt):Ve(Zs,Mi,zr,D,W,Yt);if(Js!==n){if(Js)continue;cs=!1;break}if(Rs){if(!Pr(W,function(qi,Xi){if(!Bs(Rs,Xi)&&(Zs===qi||xt(Zs,qi,be,Ve,Yt)))return Rs.push(Xi)})){cs=!1;break}}else if(!(Zs===Mi||xt(Zs,Mi,be,Ve,Yt))){cs=!1;break}}return Yt.delete(D),Yt.delete(W),cs}function z8(D,W,be,Ve,xt,Yt,pn){switch(be){case qe:if(D.byteLength!=W.byteLength||D.byteOffset!=W.byteOffset)return!1;D=D.buffer,W=W.buffer;case $t:return!(D.byteLength!=W.byteLength||!Yt(new j2(D),new j2(W)));case je:case Ie:case lt:return _p(+D,+W);case Qe:return D.name==W.name&&D.message==W.message;case nn:case cn:return D==W+"";case tt:var Fn=gi;case jt:var qn=Ve&v;if(Fn||(Fn=y),D.size!=W.size&&!qn)return!1;var Or=pn.get(D);if(Or)return Or==W;Ve|=w,pn.set(D,W);var Mr=U8(Fn(D),Fn(W),Ve,xt,Yt,pn);return pn.delete(D),Mr;case un:if(Uu)return Uu.call(D)==Uu.call(W)}return!1}function XT(D,W,be,Ve,xt,Yt){var pn=be&v,Fn=W2(D),qn=Fn.length,Or=W2(W),Mr=Or.length;if(qn!=Mr&&!pn)return!1;for(var zr=qn;zr--;){var cs=Fn[zr];if(!(pn?cs in W:Pi.call(W,cs)))return!1}var Rs=Yt.get(D),Zs=Yt.get(W);if(Rs&&Zs)return Rs==W&&Zs==D;var Mi=!0;Yt.set(D,W),Yt.set(W,D);for(var Js=pn;++zr<qn;){cs=Fn[zr];var qi=D[cs],Xi=W[cs];if(Ve)var Sf=pn?Ve(Xi,qi,cs,W,D,Yt):Ve(qi,Xi,cs,D,W,Yt);if(!(Sf===n?qi===Xi||xt(qi,Xi,be,Ve,Yt):Sf)){Mi=!1;break}Js||(Js=cs=="constructor")}if(Mi&&!Js){var qu=D.constructor,Nf=W.constructor;qu!=Nf&&"constructor"in D&&"constructor"in W&&!(typeof qu=="function"&&qu instanceof qu&&typeof Nf=="function"&&Nf instanceof Nf)&&(Mi=!1)}return Yt.delete(D),Yt.delete(W),Mi}function dh(D){return Vu(p6(D,n,g6),D+"")}function W2(D){return q5(D,yc,xf)}function q2(D){return q5(D,Pd,QT)}var u6=L5?function(D){return L5.get(D)}:sz;function J1(D){for(var W=D.name+"",be=L1[W],Ve=Pi.call(L1,W)?be.length:0;Ve--;){var xt=be[Ve],Yt=xt.func;if(Yt==null||Yt==D)return xt.name}return W}function Ap(D){var W=Pi.call(Ot,"placeholder")?Ot:D;return W.placeholder}function Ws(){var D=Ot.iteratee||nz;return D=D===nz?W1:D,arguments.length?D(arguments[0],arguments[1]):D}function G2(D,W){var be=D.__data__;return eb(W)?be[typeof W=="string"?"string":"hash"]:be.map}function K2(D){for(var W=yc(D),be=W.length;be--;){var Ve=W[be],xt=D[Ve];W[be]=[Ve,xt,Q2(xt)]}return W}function Bm(D,W){var be=ba(D,W);return v8(be)?be:n}function d6(D){var W=Pi.call(D,mx),be=D[mx];try{D[mx]=n;var Ve=!0}catch{}var xt=N2.call(D);return Ve&&(W?D[mx]=be:delete D[mx]),xt}var xf=O5?function(D){return D==null?[]:(D=Ss(D),ss(O5(D),function(W){return P5.call(D,W)}))}:iz,QT=O5?function(D){for(var W=[];D;)xs(W,xf(D)),D=hf(D);return W}:iz,Kl=ql;(k2&&Kl(new k2(new ArrayBuffer(1)))!=qe||gx&&Kl(new gx)!=tt||T2&&Kl(T2.resolve())!=qt||Tm&&Kl(new Tm)!=jt||I2&&Kl(new I2)!=Ke)&&(Kl=function(D){var W=ql(D),be=W==ut?D.constructor:n,Ve=be?$m(be):"";if(Ve)switch(Ve){case p8:return qe;case Im:return tt;case TT:return qt;case D1:return jt;case eh:return Ke}return W});function H8(D,W,be){for(var Ve=-1,xt=be.length;++Ve<xt;){var Yt=be[Ve],pn=Yt.size;switch(Yt.type){case"drop":D+=pn;break;case"dropRight":W-=pn;break;case"take":W=fc(W,D+pn);break;case"takeRight":D=qo(D,W-pn);break}}return{start:D,end:W}}function ZT(D){var W=D.match(an);return W?W[1].split(Nt):[]}function V8(D,W,be){W=ch(W,D);for(var Ve=-1,xt=W.length,Yt=!1;++Ve<xt;){var pn=yf(W[Ve]);if(!(Yt=D!=null&&be(D,pn)))break;D=D[pn]}return Yt||++Ve!=xt?Yt:(xt=D==null?0:D.length,!!xt&&bI(xt)&&to(pn,xt)&&(Si(D)||iv(D)))}function Y2(D){var W=D.length,be=new D.constructor(W);return W&&typeof D[0]=="string"&&Pi.call(D,"index")&&(be.index=D.index,be.input=D.input),be}function Yl(D){return typeof D.constructor=="function"&&!jp(D)?B1(hf(D)):{}}function FU(D,W,be){var Ve=D.constructor;switch(W){case $t:return z2(D);case je:case Ie:return new Ve(+D);case qe:return zT(D,be);case Ye:case ht:case Zt:case zt:case Et:case nt:case Ue:case Rt:case We:return WT(D,be);case tt:return new Ve;case lt:case cn:return new Ve(D);case nn:return HT(D);case jt:return new Ve;case un:return VT(D)}}function OU(D,W){var be=W.length;if(!be)return D;var Ve=be-1;return W[Ve]=(be>1?"& ":"")+W[Ve],W=W.join(be>2?", ":" "),D.replace(en,`{
/* [wrapped with `+W+`] */
`)}function f6(D){return Si(D)||iv(D)||!!(ET&&D&&D[ET])}function to(D,W){var be=typeof D;return W=W??G,!!W&&(be=="number"||be!="symbol"&&zn.test(D))&&D>-1&&D%1==0&&D<W}function Uc(D,W,be){if(!Do(be))return!1;var Ve=typeof W;return(Ve=="number"?Id(be)&&to(W,be.length):Ve=="string"&&W in be)?_p(be[W],D):!1}function ys(D,W){if(Si(D))return!1;var be=typeof D;return be=="number"||be=="symbol"||be=="boolean"||D==null||Cf(D)?!0:Gn.test(D)||!Vn.test(D)||W!=null&&D in Ss(W)}function eb(D){var W=typeof D;return W=="string"||W=="number"||W=="symbol"||W=="boolean"?D!=="__proto__":D===null}function X2(D){var W=J1(D),be=Ot[W];if(typeof be!="function"||!(W in Ci.prototype))return!1;if(D===be)return!0;var Ve=u6(be);return!!Ve&&D===Ve[0]}function JT(D){return!!F1&&F1 in D}var MU=Wo?Ox:az;function jp(D){var W=D&&D.constructor,be=typeof W=="function"&&W.prototype||_a;return D===be}function Q2(D){return D===D&&!Do(D)}function h6(D,W){return function(be){return be==null?!1:be[D]===W&&(W!==n||D in Ss(be))}}function eI(D){var W=Xr(D,function(Ve){return be.size===u&&be.clear(),Ve}),be=W.cache;return W}function tI(D,W){var be=D[1],Ve=W[1],xt=be|Ve,Yt=xt<(C|N|L),pn=Ve==L&&be==I||Ve==L&&be==z&&D[7].length<=W[8]||Ve==(L|z)&&W[7].length<=W[8]&&be==I;if(!(Yt||pn))return D;Ve&C&&(D[2]=W[2],xt|=be&C?0:P);var Fn=W[3];if(Fn){var qn=D[3];D[3]=qn?qT(qn,Fn,W[4]):Fn,D[4]=qn?dt(D[3],d):W[4]}return Fn=W[5],Fn&&(qn=D[5],D[5]=qn?F8(qn,Fn,W[6]):Fn,D[6]=qn?dt(D[5],d):W[6]),Fn=W[7],Fn&&(D[7]=Fn),Ve&L&&(D[8]=D[8]==null?W[8]:fc(D[8],W[8])),D[9]==null&&(D[9]=W[9]),D[0]=W[0],D[1]=xt,D}function nI(D){var W=[];if(D!=null)for(var be in Ss(D))W.push(be);return W}function W8(D){return N2.call(D)}function p6(D,W,be){return W=qo(W===n?D.length-1:W,0),function(){for(var Ve=arguments,xt=-1,Yt=qo(Ve.length-W,0),pn=Kt(Yt);++xt<Yt;)pn[xt]=Ve[W+xt];xt=-1;for(var Fn=Kt(W+1);++xt<W;)Fn[xt]=Ve[xt];return Fn[W]=be(pn),cr(D,this,Fn)}}function Tl(D,W){return W.length<2?D:yp(D,bc(W,0,-1))}function gf(D,W){for(var be=D.length,Ve=fc(W.length,be),xt=Bc(D);Ve--;){var Yt=W[Ve];D[Ve]=to(Yt,be)?xt[Yt]:n}return D}function fh(D,W){if(!(W==="constructor"&&typeof D[W]=="function")&&W!="__proto__")return D[W]}var q8=bf(Z5),tb=f8||function(D,W){return gr.setTimeout(D,W)},Vu=bf(lh);function G8(D,W,be){var Ve=W+"";return Vu(D,OU(Ve,rI(ZT(Ve),be)))}function bf(D){var W=0,be=0;return function(){var Ve=TU(),xt=re-(Ve-be);if(be=Ve,xt>0){if(++W>=X)return arguments[0]}else W=0;return D.apply(n,arguments)}}function m6(D,W){var be=-1,Ve=D.length,xt=Ve-1;for(W=W===n?Ve:W;++be<W;){var Yt=q1(be,xt),pn=D[Yt];D[Yt]=D[be],D[be]=pn}return D.length=W,D}var K8=eI(function(D){var W=[];return D.charCodeAt(0)===46&&W.push(""),D.replace(Dn,function(be,Ve,xt,Yt){W.push(xt?Yt.replace(Mt,"$1"):Ve||be)}),W});function yf(D){if(typeof D=="string"||Cf(D))return D;var W=D+"";return W=="0"&&1/D==-1/0?"-0":W}function $m(D){if(D!=null){try{return vd.call(D)}catch{}try{return D+""}catch{}}return""}function rI(D,W){return fr(he,function(be){var Ve="_."+be[0];W&be[1]&&!Ir(D,Ve)&&D.push(Ve)}),D.sort()}function sI(D){if(D instanceof Ci)return D.clone();var W=new hc(D.__wrapped__,D.__chain__);return W.__actions__=Bc(D.__actions__),W.__index__=D.__index__,W.__values__=D.__values__,W}function x6(D,W,be){(be?Uc(D,W,be):W===n)?W=1:W=qo(Oi(W),0);var Ve=D==null?0:D.length;if(!Ve||W<1)return[];for(var xt=0,Yt=0,pn=Kt(xx(Ve/W));xt<Ve;)pn[Yt++]=bc(D,xt,xt+=W);return pn}function Y8(D){for(var W=-1,be=D==null?0:D.length,Ve=0,xt=[];++W<be;){var Yt=D[W];Yt&&(xt[Ve++]=Yt)}return xt}function kd(){var D=arguments.length;if(!D)return[];for(var W=Kt(D-1),be=arguments[0],Ve=D;Ve--;)W[Ve-1]=arguments[Ve];return xs(Si(be)?Bc(be):[be],No(W,1))}var Yi=Fi(function(D,W){return dl(D)?ih(D,No(W,1,dl,!0)):[]}),Il=Fi(function(D,W){var be=zc(W);return dl(be)&&(be=n),dl(D)?ih(D,No(W,1,dl,!0),Ws(be,2)):[]}),Go=Fi(function(D,W){var be=zc(W);return dl(be)&&(be=n),dl(D)?ih(D,No(W,1,dl,!0),n,be):[]});function Xl(D,W,be){var Ve=D==null?0:D.length;return Ve?(W=be||W===n?1:Oi(W),bc(D,W<0?0:W,Ve)):[]}function Wu(D,W,be){var Ve=D==null?0:D.length;return Ve?(W=be||W===n?1:Oi(W),W=Ve-W,bc(D,0,W<0?0:W)):[]}function nb(D,W){return D&&D.length?$2(D,Ws(W,3),!0,!0):[]}function cl(D,W){return D&&D.length?$2(D,Ws(W,3),!0):[]}function Z2(D,W,be,Ve){var xt=D==null?0:D.length;return xt?(be&&typeof be!="number"&&Uc(D,W,be)&&(be=0,Ve=xt),DT(D,W,be,Ve)):[]}function Um(D,W,be){var Ve=D==null?0:D.length;if(!Ve)return-1;var xt=be==null?0:Oi(be);return xt<0&&(xt=qo(Ve+xt,0)),er(D,Ws(W,3),xt)}function J2(D,W,be){var Ve=D==null?0:D.length;if(!Ve)return-1;var xt=Ve-1;return be!==n&&(xt=Oi(be),xt=be<0?qo(Ve+xt,0):fc(xt,Ve-1)),er(D,Ws(W,3),xt,!0)}function g6(D){var W=D==null?0:D.length;return W?No(D,1):[]}function ev(D){var W=D==null?0:D.length;return W?No(D,oe):[]}function hu(D,W){var be=D==null?0:D.length;return be?(W=W===n?1:Oi(W),No(D,W)):[]}function X8(D){for(var W=-1,be=D==null?0:D.length,Ve={};++W<be;){var xt=D[W];Ve[xt[0]]=xt[1]}return Ve}function kx(D){return D&&D.length?D[0]:n}function Ep(D,W,be){var Ve=D==null?0:D.length;if(!Ve)return-1;var xt=be==null?0:Oi(be);return xt<0&&(xt=qo(Ve+xt,0)),Wn(D,W,xt)}function b6(D){var W=D==null?0:D.length;return W?bc(D,0,-1):[]}var Q8=Fi(function(D){var W=Qn(D,Y1);return W.length&&W[0]===D[0]?G5(W):[]}),zm=Fi(function(D){var W=zc(D),be=Qn(D,Y1);return W===zc(be)?W=n:be.pop(),be.length&&be[0]===D[0]?G5(be,Ws(W,2)):[]}),y6=Fi(function(D){var W=zc(D),be=Qn(D,Y1);return W=typeof W=="function"?W:n,W&&be.pop(),be.length&&be[0]===D[0]?G5(be,n,W):[]});function Hm(D,W){return D==null?"":M5.call(D,W)}function zc(D){var W=D==null?0:D.length;return W?D[W-1]:n}function tv(D,W,be){var Ve=D==null?0:D.length;if(!Ve)return-1;var xt=Ve;return be!==n&&(xt=Oi(be),xt=xt<0?qo(Ve+xt,0):fc(xt,Ve-1)),W===W?$(D,W,xt):er(D,kr,xt,!0)}function Z8(D,W){return D&&D.length?Q5(D,Oi(W)):n}var v6=Fi(nv);function nv(D,W){return D&&D.length&&W&&W.length?Lo(D,W):D}function Hc(D,W,be){return D&&D.length&&W&&W.length?Lo(D,W,Ws(be,2)):D}function Vm(D,W,be){return D&&D.length&&W&&W.length?Lo(D,W,n,be):D}var vf=dh(function(D,W){var be=D==null?0:D.length,Ve=V5(D,W);return ll(D,Qn(W,function(xt){return to(xt,be)?+xt:xt}).sort(P8)),Ve});function pu(D,W){var be=[];if(!(D&&D.length))return be;var Ve=-1,xt=[],Yt=D.length;for(W=Ws(W,3);++Ve<Yt;){var pn=D[Ve];W(pn,Ve,D)&&(be.push(pn),xt.push(Ve))}return ll(D,xt),be}function w6(D){return D==null?D:R5.call(D)}function J8(D,W,be){var Ve=D==null?0:D.length;return Ve?(be&&typeof be!="number"&&Uc(D,W,be)?(W=0,be=Ve):(W=W==null?0:Oi(W),be=be===n?Ve:Oi(be)),bc(D,W,be)):[]}function e7(D,W){return G1(D,W)}function RU(D,W,be){return J5(D,W,Ws(be,2))}function Wm(D,W){var be=D==null?0:D.length;if(be){var Ve=G1(D,W);if(Ve<be&&_p(D[Ve],W))return Ve}return-1}function iI(D,W){return G1(D,W,!0)}function t7(D,W,be){return J5(D,W,Ws(be,2),!0)}function Tx(D,W){var be=D==null?0:D.length;if(be){var Ve=G1(D,W,!0)-1;if(_p(D[Ve],W))return Ve}return-1}function n7(D){return D&&D.length?E8(D):[]}function Ix(D,W){return D&&D.length?E8(D,Ws(W,2)):[]}function aI(D){var W=D==null?0:D.length;return W?bc(D,1,W):[]}function oI(D,W,be){return D&&D.length?(W=be||W===n?1:Oi(W),bc(D,0,W<0?0:W)):[]}function r7(D,W,be){var Ve=D==null?0:D.length;return Ve?(W=be||W===n?1:Oi(W),W=Ve-W,bc(D,W<0?0:W,Ve)):[]}function C6(D,W){return D&&D.length?$2(D,Ws(W,3),!1,!0):[]}function LU(D,W){return D&&D.length?$2(D,Ws(W,3)):[]}var DU=Fi(function(D){return Sp(No(D,1,dl,!0))}),lI=Fi(function(D){var W=zc(D);return dl(W)&&(W=n),Sp(No(D,1,dl,!0),Ws(W,2))}),cI=Fi(function(D){var W=zc(D);return W=typeof W=="function"?W:n,Sp(No(D,1,dl,!0),n,W)});function Px(D){return D&&D.length?Sp(D):[]}function BU(D,W){return D&&D.length?Sp(D,Ws(W,2)):[]}function rb(D,W){return W=typeof W=="function"?W:n,D&&D.length?Sp(D,n,W):[]}function S6(D){if(!(D&&D.length))return[];var W=0;return D=ss(D,function(be){if(dl(be))return W=qo(be.length,W),!0}),os(W,function(be){return Qn(D,Ms(be))})}function ho(D,W){if(!(D&&D.length))return[];var be=S6(D);return W==null?be:Qn(be,function(Ve){return cr(W,n,Ve)})}var $U=Fi(function(D,W){return dl(D)?ih(D,W):[]}),uI=Fi(function(D){return t6(ss(D,dl))}),UU=Fi(function(D){var W=zc(D);return dl(W)&&(W=n),t6(ss(D,dl),Ws(W,2))}),zU=Fi(function(D){var W=zc(D);return W=typeof W=="function"?W:n,t6(ss(D,dl),n,W)}),dI=Fi(S6);function fI(D,W){return U2(D||[],W||[],wx)}function HU(D,W){return U2(D||[],W||[],jx)}var Td=Fi(function(D){var W=D.length,be=W>1?D[W-1]:n;return be=typeof be=="function"?(D.pop(),be):n,ho(D,be)});function N6(D){var W=Ot(D);return W.__chain__=!0,W}function VU(D,W){return W(D),D}function wf(D,W){return W(D)}var A6=dh(function(D){var W=D.length,be=W?D[0]:0,Ve=this.__wrapped__,xt=function(Yt){return V5(Yt,D)};return W>1||this.__actions__.length||!(Ve instanceof Ci)||!to(be)?this.thru(xt):(Ve=Ve.slice(be,+be+(W?1:0)),Ve.__actions__.push({func:wf,args:[xt],thisArg:n}),new hc(Ve,this.__chain__).thru(function(Yt){return W&&!Yt.length&&Yt.push(n),Yt}))});function Fx(){return N6(this)}function j6(){return new hc(this.value(),this.__chain__)}function s7(){this.__values__===n&&(this.__values__=tde(this.value()));var D=this.__index__>=this.__values__.length,W=D?n:this.__values__[this.__index__++];return{done:D,value:W}}function i7(){return this}function WU(D){for(var W,be=this;be instanceof th;){var Ve=sI(be);Ve.__index__=0,Ve.__values__=n,W?xt.__wrapped__=Ve:W=Ve;var xt=Ve;be=be.__wrapped__}return xt.__wrapped__=D,W}function a7(){var D=this.__wrapped__;if(D instanceof Ci){var W=D;return this.__actions__.length&&(W=new Ci(this)),W=W.reverse(),W.__actions__.push({func:wf,args:[w6],thisArg:n}),new hc(W,this.__chain__)}return this.thru(w6)}function qU(){return K1(this.__wrapped__,this.__actions__)}var hI=s6(function(D,W,be){Pi.call(D,be)?++D[be]:sh(D,be,1)});function pI(D,W,be){var Ve=Si(D)?Yr:O2;return be&&Uc(D,W,be)&&(W=n),Ve(D,Ws(W,3))}function E6(D,W){var be=Si(D)?ss:b8;return be(D,Ws(W,3))}var _6=_x(Um),mI=_x(J2);function o7(D,W){return No(P6(D,W),1)}function xI(D,W){return No(P6(D,W),oe)}function l7(D,W,be){return be=be===n?1:Oi(be),No(P6(D,W),be)}function rv(D,W){var be=Si(D)?fr:ah;return be(D,Ws(W,3))}function k6(D,W){var be=Si(D)?ur:LT;return be(D,Ws(W,3))}var T6=s6(function(D,W,be){Pi.call(D,be)?D[be].push(W):sh(D,be,[W])});function gI(D,W,be,Ve){D=Id(D)?D:M6(D),be=be&&!Ve?Oi(be):0;var xt=D.length;return be<0&&(be=qo(xt+be,0)),yI(D)?be<=xt&&D.indexOf(W,be)>-1:!!xt&&Wn(D,W,be)>-1}var GU=Fi(function(D,W,be){var Ve=-1,xt=typeof W=="function",Yt=Id(D)?Kt(D.length):[];return ah(D,function(pn){Yt[++Ve]=xt?cr(W,pn,be):Ad(pn,W,be)}),Yt}),I6=s6(function(D,W,be){sh(D,be,W)});function P6(D,W){var be=Si(D)?Qn:C8;return be(D,Ws(W,3))}function sv(D,W,be,Ve){return D==null?[]:(Si(W)||(W=W==null?[]:[W]),be=Ve?n:be,Si(be)||(be=be==null?[]:[be]),D2(D,W,be))}var KU=s6(function(D,W,be){D[be?0:1].push(W)},function(){return[[],[]]});function F6(D,W,be){var Ve=Si(D)?Xs:ir,xt=arguments.length<3;return Ve(D,Ws(W,4),be,xt,ah)}function A(D,W,be){var Ve=Si(D)?ii:ir,xt=arguments.length<3;return Ve(D,Ws(W,4),be,xt,LT)}function M(D,W){var be=Si(D)?ss:b8;return be(D,Is(Ws(W,3)))}function Z(D){var W=Si(D)?rh:gc;return W(D)}function me(D,W,be){(be?Uc(D,W,be):W===n)?W=1:W=Oi(W);var Ve=Si(D)?vx:A8;return Ve(D,W)}function Pe(D){var W=Si(D)?MT:Ed;return W(D)}function He(D){if(D==null)return 0;if(Id(D))return yI(D)?H(D):D.length;var W=Kl(D);return W==tt||W==jt?D.size:Cp(D).length}function St(D,W,be){var Ve=Si(D)?Pr:j8;return be&&Uc(D,W,be)&&(W=n),Ve(D,Ws(W,3))}var hn=Fi(function(D,W){if(D==null)return[];var be=W.length;return be>1&&Uc(D,W[0],W[1])?W=[]:be>2&&Uc(W[0],W[1],W[2])&&(W=[W[0]]),D2(D,No(W,1),[])}),_n=Wa||function(){return gr.Date.now()};function ar(D,W){if(typeof W!="function")throw new Za(o);return D=Oi(D),function(){if(--D<1)return W.apply(this,arguments)}}function Ur(D,W,be){return W=be?n:W,W=D&&W==null?D.length:W,uh(D,L,n,n,n,n,W)}function Wr(D,W){var be;if(typeof W!="function")throw new Za(o);return D=Oi(D),function(){return--D>0&&(be=W.apply(this,arguments)),D<=1&&(W=n),be}}var $r=Fi(function(D,W,be){var Ve=C;if(be.length){var xt=dt(be,Ap($r));Ve|=F}return uh(D,Ve,W,be,xt)}),ds=Fi(function(D,W,be){var Ve=C|N;if(be.length){var xt=dt(be,Ap(ds));Ve|=F}return uh(W,Ve,D,be,xt)});function Ns(D,W,be){W=be?n:W;var Ve=uh(D,I,n,n,n,n,n,W);return Ve.placeholder=Ns.placeholder,Ve}function Ts(D,W,be){W=be?n:W;var Ve=uh(D,R,n,n,n,n,n,W);return Ve.placeholder=Ts.placeholder,Ve}function Ao(D,W,be){var Ve,xt,Yt,pn,Fn,qn,Or=0,Mr=!1,zr=!1,cs=!0;if(typeof D!="function")throw new Za(o);W=hh(W)||0,Do(be)&&(Mr=!!be.leading,zr="maxWait"in be,Yt=zr?qo(hh(be.maxWait)||0,W):Yt,cs="trailing"in be?!!be.trailing:cs);function Rs(fl){var kp=Ve,Rx=xt;return Ve=xt=n,Or=fl,pn=D.apply(Rx,kp),pn}function Zs(fl){return Or=fl,Fn=tb(qi,W),Mr?Rs(fl):pn}function Mi(fl){var kp=fl-qn,Rx=fl-Or,pde=W-kp;return zr?fc(pde,Yt-Rx):pde}function Js(fl){var kp=fl-qn,Rx=fl-Or;return qn===n||kp>=W||kp<0||zr&&Rx>=Yt}function qi(){var fl=_n();if(Js(fl))return Xi(fl);Fn=tb(qi,Mi(fl))}function Xi(fl){return Fn=n,cs&&Ve?Rs(fl):(Ve=xt=n,pn)}function Sf(){Fn!==n&&T8(Fn),Or=0,Ve=qn=xt=Fn=n}function qu(){return Fn===n?pn:Xi(_n())}function Nf(){var fl=_n(),kp=Js(fl);if(Ve=arguments,xt=this,qn=fl,kp){if(Fn===n)return Zs(qn);if(zr)return T8(Fn),Fn=tb(qi,W),Rs(qn)}return Fn===n&&(Fn=tb(qi,W)),pn}return Nf.cancel=Sf,Nf.flush=qu,Nf}var Zn=Fi(function(D,W){return g8(D,1,W)}),Ln=Fi(function(D,W,be){return g8(D,hh(W)||0,be)});function nr(D){return uh(D,Q)}function Xr(D,W){if(typeof D!="function"||W!=null&&typeof W!="function")throw new Za(o);var be=function(){var Ve=arguments,xt=W?W.apply(this,Ve):Ve[0],Yt=be.cache;if(Yt.has(xt))return Yt.get(xt);var pn=D.apply(this,Ve);return be.cache=Yt.set(xt,pn)||Yt,pn};return be.cache=new(Xr.Cache||wd),be}Xr.Cache=wd;function Is(D){if(typeof D!="function")throw new Za(o);return function(){var W=arguments;switch(W.length){case 0:return!D.call(this);case 1:return!D.call(this,W[0]);case 2:return!D.call(this,W[0],W[1]);case 3:return!D.call(this,W[0],W[1],W[2])}return!D.apply(this,W)}}function zs(D){return Wr(2,D)}var Hs=UT(function(D,W){W=W.length==1&&Si(W[0])?Qn(W[0],gs(Ws())):Qn(No(W,1),gs(Ws()));var be=W.length;return Fi(function(Ve){for(var xt=-1,Yt=fc(Ve.length,be);++xt<Yt;)Ve[xt]=W[xt].call(this,Ve[xt]);return cr(D,this,Ve)})}),Ys=Fi(function(D,W){var be=dt(W,Ap(Ys));return uh(D,F,n,W,be)}),ul=Fi(function(D,W){var be=dt(W,Ap(ul));return uh(D,U,n,W,be)}),ia=dh(function(D,W){return uh(D,z,n,n,n,W)});function qm(D,W){if(typeof D!="function")throw new Za(o);return W=W===n?W:Oi(W),Fi(D,W)}function YU(D,W){if(typeof D!="function")throw new Za(o);return W=W==null?0:qo(Oi(W),0),Fi(function(be){var Ve=be[W],xt=Np(be,0,W);return Ve&&xs(xt,Ve),cr(D,this,xt)})}function AWe(D,W,be){var Ve=!0,xt=!0;if(typeof D!="function")throw new Za(o);return Do(be)&&(Ve="leading"in be?!!be.leading:Ve,xt="trailing"in be?!!be.trailing:xt),Ao(D,W,{leading:Ve,maxWait:W,trailing:xt})}function jWe(D){return Ur(D,1)}function EWe(D,W){return Ys(n6(W),D)}function _We(){if(!arguments.length)return[];var D=arguments[0];return Si(D)?D:[D]}function kWe(D){return du(D,g)}function TWe(D,W){return W=typeof W=="function"?W:n,du(D,g,W)}function IWe(D){return du(D,f|g)}function PWe(D,W){return W=typeof W=="function"?W:n,du(D,f|g,W)}function FWe(D,W){return W==null||F2(D,W,yc(W))}function _p(D,W){return D===W||D!==D&&W!==W}var OWe=c6(Rm),MWe=c6(function(D,W){return D>=W}),iv=K5(function(){return arguments}())?K5:function(D){return Ko(D)&&Pi.call(D,"callee")&&!P5.call(D,"callee")},Si=Kt.isArray,RWe=ce?gs(ce):BT;function Id(D){return D!=null&&bI(D.length)&&!Ox(D)}function dl(D){return Ko(D)&&Id(D)}function LWe(D){return D===!0||D===!1||Ko(D)&&ql(D)==je}var sb=h8||az,DWe=rt?gs(rt):wp;function BWe(D){return Ko(D)&&D.nodeType===1&&!c7(D)}function $We(D){if(D==null)return!0;if(Id(D)&&(Si(D)||typeof D=="string"||typeof D.splice=="function"||sb(D)||O6(D)||iv(D)))return!D.length;var W=Kl(D);if(W==tt||W==jt)return!D.size;if(jp(D))return!Cp(D).length;for(var be in D)if(Pi.call(D,be))return!1;return!0}function UWe(D,W){return jd(D,W)}function zWe(D,W,be){be=typeof be=="function"?be:n;var Ve=be?be(D,W):n;return Ve===n?jd(D,W,n,be):!!Ve}function XU(D){if(!Ko(D))return!1;var W=ql(D);return W==Qe||W==Le||typeof D.message=="string"&&typeof D.name=="string"&&!c7(D)}function HWe(D){return typeof D=="number"&&O1(D)}function Ox(D){if(!Do(D))return!1;var W=ql(D);return W==$e||W==it||W==ve||W==It}function Que(D){return typeof D=="number"&&D==Oi(D)}function bI(D){return typeof D=="number"&&D>-1&&D%1==0&&D<=G}function Do(D){var W=typeof D;return D!=null&&(W=="object"||W=="function")}function Ko(D){return D!=null&&typeof D=="object"}var Zue=Pt?gs(Pt):$T;function VWe(D,W){return D===W||V1(D,W,K2(W))}function WWe(D,W,be){return be=typeof be=="function"?be:n,V1(D,W,K2(W),be)}function qWe(D){return Jue(D)&&D!=+D}function GWe(D){if(MU(D))throw new hr(a);return v8(D)}function KWe(D){return D===null}function YWe(D){return D==null}function Jue(D){return typeof D=="number"||Ko(D)&&ql(D)==lt}function c7(D){if(!Ko(D)||ql(D)!=ut)return!1;var W=hf(D);if(W===null)return!0;var be=Pi.call(W,"constructor")&&W.constructor;return typeof be=="function"&&be instanceof be&&vd.call(be)==T5}var QU=vt?gs(vt):R2;function XWe(D){return Que(D)&&D>=-9007199254740991&&D<=G}var ede=ln?gs(ln):oh;function yI(D){return typeof D=="string"||!Si(D)&&Ko(D)&&ql(D)==cn}function Cf(D){return typeof D=="symbol"||Ko(D)&&ql(D)==un}var O6=mn?gs(mn):L2;function QWe(D){return D===n}function ZWe(D){return Ko(D)&&Kl(D)==Ke}function JWe(D){return Ko(D)&&ql(D)==Bt}var eqe=c6(Lm),tqe=c6(function(D,W){return D<=W});function tde(D){if(!D)return[];if(Id(D))return yI(D)?K(D):Bc(D);if(xp&&D[xp])return $u(D[xp]());var W=Kl(D),be=W==tt?gi:W==jt?y:M6;return be(D)}function Mx(D){if(!D)return D===0?D:0;if(D=hh(D),D===oe||D===-1/0){var W=D<0?-1:1;return W*V}return D===D?D:0}function Oi(D){var W=Mx(D),be=W%1;return W===W?be?W-be:W:0}function nde(D){return D?bp(Oi(D),0,ae):0}function hh(D){if(typeof D=="number")return D;if(Cf(D))return ee;if(Do(D)){var W=typeof D.valueOf=="function"?D.valueOf():D;D=Do(W)?W+"":W}if(typeof D!="string")return D===0?D:+D;D=ms(D);var be=or.test(D);return be||Qt.test(D)?dr(D.slice(2),be?2:8):Xn.test(D)?ee:+D}function rde(D){return mf(D,Pd(D))}function nqe(D){return D?bp(Oi(D),-9007199254740991,G):D===0?D:0}function ka(D){return D==null?"":fu(D)}var rqe=X1(function(D,W){if(jp(W)||Id(W)){mf(W,yc(W),D);return}for(var be in W)Pi.call(W,be)&&wx(D,be,W[be])}),sde=X1(function(D,W){mf(W,Pd(W),D)}),vI=X1(function(D,W,be,Ve){mf(W,Pd(W),D,Ve)}),sqe=X1(function(D,W,be,Ve){mf(W,yc(W),D,Ve)}),iqe=dh(V5);function aqe(D,W){var be=B1(D);return W==null?be:Ga(be,W)}var oqe=Fi(function(D,W){D=Ss(D);var be=-1,Ve=W.length,xt=Ve>2?W[2]:n;for(xt&&Uc(W[0],W[1],xt)&&(Ve=1);++be<Ve;)for(var Yt=W[be],pn=Pd(Yt),Fn=-1,qn=pn.length;++Fn<qn;){var Or=pn[Fn],Mr=D[Or];(Mr===n||_p(Mr,_a[Or])&&!Pi.call(D,Or))&&(D[Or]=Yt[Or])}return D}),lqe=Fi(function(D){return D.push(n,B8),cr(ide,n,D)});function cqe(D,W){return Vt(D,Ws(W,3),Hu)}function uqe(D,W){return Vt(D,Ws(W,3),Mm)}function dqe(D,W){return D==null?D:W5(D,Ws(W,3),Pd)}function fqe(D,W){return D==null?D:M2(D,Ws(W,3),Pd)}function hqe(D,W){return D&&Hu(D,Ws(W,3))}function pqe(D,W){return D&&Mm(D,Ws(W,3))}function mqe(D){return D==null?[]:H1(D,yc(D))}function xqe(D){return D==null?[]:H1(D,Pd(D))}function ZU(D,W,be){var Ve=D==null?n:yp(D,W);return Ve===n?be:Ve}function gqe(D,W){return D!=null&&V8(D,W,Nd)}function JU(D,W){return D!=null&&V8(D,W,Sx)}var bqe=GT(function(D,W,be){W!=null&&typeof W.toString!="function"&&(W=N2.call(W)),D[W]=be},tz(Fd)),yqe=GT(function(D,W,be){W!=null&&typeof W.toString!="function"&&(W=N2.call(W)),Pi.call(D,W)?D[W].push(be):D[W]=[be]},Ws),vqe=Fi(Ad);function yc(D){return Id(D)?nh(D):Cp(D)}function Pd(D){return Id(D)?nh(D,!0):w8(D)}function wqe(D,W){var be={};return W=Ws(W,3),Hu(D,function(Ve,xt,Yt){sh(be,W(Ve,xt,Yt),Ve)}),be}function Cqe(D,W){var be={};return W=Ws(W,3),Hu(D,function(Ve,xt,Yt){sh(be,xt,W(Ve,xt,Yt))}),be}var Sqe=X1(function(D,W,be){Nx(D,W,be)}),ide=X1(function(D,W,be,Ve){Nx(D,W,be,Ve)}),Nqe=dh(function(D,W){var be={};if(D==null)return be;var Ve=!1;W=Qn(W,function(Yt){return Yt=ch(Yt,D),Ve||(Ve=Yt.length>1),Yt}),mf(D,q2(D),be),Ve&&(be=du(be,f|x|g,$8));for(var xt=W.length;xt--;)e6(be,W[xt]);return be});function Aqe(D,W){return ade(D,Is(Ws(W)))}var jqe=dh(function(D,W){return D==null?{}:N8(D,W)});function ade(D,W){if(D==null)return{};var be=Qn(q2(D),function(Ve){return[Ve]});return W=Ws(W),Dm(D,be,function(Ve,xt){return W(Ve,xt[0])})}function Eqe(D,W,be){W=ch(W,D);var Ve=-1,xt=W.length;for(xt||(xt=1,D=n);++Ve<xt;){var Yt=D==null?n:D[yf(W[Ve])];Yt===n&&(Ve=xt,Yt=be),D=Ox(Yt)?Yt.call(D):Yt}return D}function _qe(D,W,be){return D==null?D:jx(D,W,be)}function kqe(D,W,be,Ve){return Ve=typeof Ve=="function"?Ve:n,D==null?D:jx(D,W,be,Ve)}var ode=L8(yc),lde=L8(Pd);function Tqe(D,W,be){var Ve=Si(D),xt=Ve||sb(D)||O6(D);if(W=Ws(W,4),be==null){var Yt=D&&D.constructor;xt?be=Ve?new Yt:[]:Do(D)?be=Ox(Yt)?B1(hf(D)):{}:be={}}return(xt?fr:Hu)(D,function(pn,Fn,qn){return W(be,pn,Fn,qn)}),be}function Iqe(D,W){return D==null?!0:e6(D,W)}function Pqe(D,W,be){return D==null?D:k8(D,W,n6(be))}function Fqe(D,W,be,Ve){return Ve=typeof Ve=="function"?Ve:n,D==null?D:k8(D,W,n6(be),Ve)}function M6(D){return D==null?[]:$i(D,yc(D))}function Oqe(D){return D==null?[]:$i(D,Pd(D))}function Mqe(D,W,be){return be===n&&(be=W,W=n),be!==n&&(be=hh(be),be=be===be?be:0),W!==n&&(W=hh(W),W=W===W?W:0),bp(hh(D),W,be)}function Rqe(D,W,be){return W=Mx(W),be===n?(be=W,W=0):be=Mx(be),D=hh(D),y8(D,W,be)}function Lqe(D,W,be){if(be&&typeof be!="boolean"&&Uc(D,W,be)&&(W=be=n),be===n&&(typeof W=="boolean"?(be=W,W=n):typeof D=="boolean"&&(be=D,D=n)),D===n&&W===n?(D=0,W=1):(D=Mx(D),W===n?(W=D,D=0):W=Mx(W)),D>W){var Ve=D;D=W,W=Ve}if(be||D%1||W%1){var xt=_2();return fc(D+xt*(W-D+Vr("1e-"+((xt+"").length-1))),W)}return q1(D,W)}var Dqe=Ex(function(D,W,be){return W=W.toLowerCase(),D+(be?cde(W):W)});function cde(D){return ez(ka(D).toLowerCase())}function ude(D){return D=ka(D),D&&D.replace(Jn,El).replace(_r,"")}function Bqe(D,W,be){D=ka(D),W=fu(W);var Ve=D.length;be=be===n?Ve:bp(Oi(be),0,Ve);var xt=be;return be-=W.length,be>=0&&D.slice(be,xt)==W}function $qe(D){return D=ka(D),D&&gn.test(D)?D.replace(dn,_l):D}function Uqe(D){return D=ka(D),D&&Cn.test(D)?D.replace(Kn,"\\$&"):D}var zqe=Ex(function(D,W,be){return D+(be?"-":"")+W.toLowerCase()}),Hqe=Ex(function(D,W,be){return D+(be?" ":"")+W.toLowerCase()}),Vqe=O8("toLowerCase");function Wqe(D,W,be){D=ka(D),W=Oi(W);var Ve=W?H(D):0;if(!W||Ve>=W)return D;var xt=(W-Ve)/2;return V2(km(xt),be)+D+V2(xx(xt),be)}function qqe(D,W,be){D=ka(D),W=Oi(W);var Ve=W?H(D):0;return W&&Ve<W?D+V2(W-Ve,be):D}function Gqe(D,W,be){D=ka(D),W=Oi(W);var Ve=W?H(D):0;return W&&Ve<W?V2(W-Ve,be)+D:D}function Kqe(D,W,be){return be||W==null?W=0:W&&(W=+W),kT(ka(D).replace(sn,""),W||0)}function Yqe(D,W,be){return(be?Uc(D,W,be):W===n)?W=1:W=Oi(W),Ax(ka(D),W)}function Xqe(){var D=arguments,W=ka(D[0]);return D.length<3?W:W.replace(D[1],D[2])}var Qqe=Ex(function(D,W,be){return D+(be?"_":"")+W.toLowerCase()});function Zqe(D,W,be){return be&&typeof be!="number"&&Uc(D,W,be)&&(W=be=n),be=be===n?ae:be>>>0,be?(D=ka(D),D&&(typeof W=="string"||W!=null&&!QU(W))&&(W=fu(W),!W&&kl(D))?Np(K(D),0,be):D.split(W,be)):[]}var Jqe=Ex(function(D,W,be){return D+(be?" ":"")+ez(W)});function eGe(D,W,be){return D=ka(D),be=be==null?0:bp(Oi(be),0,D.length),W=fu(W),D.slice(be,be+W.length)==W}function tGe(D,W,be){var Ve=Ot.templateSettings;be&&Uc(D,W,be)&&(W=n),D=ka(D),W=vI({},W,Ve,D8);var xt=vI({},W.imports,Ve.imports,D8),Yt=yc(xt),pn=$i(xt,Yt),Fn,qn,Or=0,Mr=W.interpolate||Lt,zr="__p += '",cs=Qs((W.escape||Lt).source+"|"+Mr.source+"|"+(Mr===yn?tn:Lt).source+"|"+(W.evaluate||Lt).source+"|$","g"),Rs="//# sourceURL="+(Pi.call(W,"sourceURL")?(W.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++ls+"]")+`
`;D.replace(cs,function(Js,qi,Xi,Sf,qu,Nf){return Xi||(Xi=Sf),zr+=D.slice(Or,Nf).replace(jn,Bu),qi&&(Fn=!0,zr+=`' +
__e(`+qi+`) +
'`),qu&&(qn=!0,zr+=`';
`+qu+`;
__p += '`),Xi&&(zr+=`' +
((__t = (`+Xi+`)) == null ? '' : __t) +
'`),Or=Nf+Js.length,Js}),zr+=`';
`;var Zs=Pi.call(W,"variable")&&W.variable;if(!Zs)zr=`with (obj) {
`+zr+`
}
`;else if(xn.test(Zs))throw new hr(l);zr=(qn?zr.replace(at,""):zr).replace(mt,"$1").replace(Dt,"$1;"),zr="function("+(Zs||"obj")+`) {
`+(Zs?"":`obj || (obj = {});
`)+"var __t, __p = ''"+(Fn?", __e = _.escape":"")+(qn?`, __j = Array.prototype.join;
function print() { __p += __j.call(arguments, '') }
`:`;
`)+zr+`return __p
}`;var Mi=fde(function(){return wr(Yt,Rs+"return "+zr).apply(n,pn)});if(Mi.source=zr,XU(Mi))throw Mi;return Mi}function nGe(D){return ka(D).toLowerCase()}function rGe(D){return ka(D).toUpperCase()}function sGe(D,W,be){if(D=ka(D),D&&(be||W===n))return ms(D);if(!D||!(W=fu(W)))return D;var Ve=K(D),xt=K(W),Yt=bs(Ve,xt),pn=Tr(Ve,xt)+1;return Np(Ve,Yt,pn).join("")}function iGe(D,W,be){if(D=ka(D),D&&(be||W===n))return D.slice(0,le(D)+1);if(!D||!(W=fu(W)))return D;var Ve=K(D),xt=Tr(Ve,K(W))+1;return Np(Ve,0,xt).join("")}function aGe(D,W,be){if(D=ka(D),D&&(be||W===n))return D.replace(sn,"");if(!D||!(W=fu(W)))return D;var Ve=K(D),xt=bs(Ve,K(W));return Np(Ve,xt).join("")}function oGe(D,W){var be=ne,Ve=J;if(Do(W)){var xt="separator"in W?W.separator:xt;be="length"in W?Oi(W.length):be,Ve="omission"in W?fu(W.omission):Ve}D=ka(D);var Yt=D.length;if(kl(D)){var pn=K(D);Yt=pn.length}if(be>=Yt)return D;var Fn=be-H(Ve);if(Fn<1)return Ve;var qn=pn?Np(pn,0,Fn).join(""):D.slice(0,Fn);if(xt===n)return qn+Ve;if(pn&&(Fn+=qn.length-Fn),QU(xt)){if(D.slice(Fn).search(xt)){var Or,Mr=qn;for(xt.global||(xt=Qs(xt.source,ka(In.exec(xt))+"g")),xt.lastIndex=0;Or=xt.exec(Mr);)var zr=Or.index;qn=qn.slice(0,zr===n?Fn:zr)}}else if(D.indexOf(fu(xt),Fn)!=Fn){var cs=qn.lastIndexOf(xt);cs>-1&&(qn=qn.slice(0,cs))}return qn+Ve}function lGe(D){return D=ka(D),D&&on.test(D)?D.replace(Tt,we):D}var cGe=Ex(function(D,W,be){return D+(be?" ":"")+W.toUpperCase()}),ez=O8("toUpperCase");function dde(D,W,be){return D=ka(D),W=be?n:W,W===n?px(D)?pt(D):ot(D):D.match(W)||[]}var fde=Fi(function(D,W){try{return cr(D,n,W)}catch(be){return XU(be)?be:new hr(be)}}),uGe=dh(function(D,W){return fr(W,function(be){be=yf(be),sh(D,be,$r(D[be],D))}),D});function dGe(D){var W=D==null?0:D.length,be=Ws();return D=W?Qn(D,function(Ve){if(typeof Ve[1]!="function")throw new Za(o);return[be(Ve[0]),Ve[1]]}):[],Fi(function(Ve){for(var xt=-1;++xt<W;){var Yt=D[xt];if(cr(Yt[0],this,Ve))return cr(Yt[1],this,Ve)}})}function fGe(D){return RT(du(D,f))}function tz(D){return function(){return D}}function hGe(D,W){return D==null||D!==D?W:D}var pGe=o6(),mGe=o6(!0);function Fd(D){return D}function nz(D){return W1(typeof D=="function"?D:du(D,f))}function xGe(D){return X5(du(D,f))}function gGe(D,W){return eo(D,du(W,f))}var bGe=Fi(function(D,W){return function(be){return Ad(be,D,W)}}),yGe=Fi(function(D,W){return function(be){return Ad(D,be,W)}});function rz(D,W,be){var Ve=yc(W),xt=H1(W,Ve);be==null&&!(Do(W)&&(xt.length||!Ve.length))&&(be=W,W=D,D=this,xt=H1(W,yc(W)));var Yt=!(Do(be)&&"chain"in be)||!!be.chain,pn=Ox(D);return fr(xt,function(Fn){var qn=W[Fn];D[Fn]=qn,pn&&(D.prototype[Fn]=function(){var Or=this.__chain__;if(Yt||Or){var Mr=D(this.__wrapped__),zr=Mr.__actions__=Bc(this.__actions__);return zr.push({func:qn,args:arguments,thisArg:D}),Mr.__chain__=Or,Mr}return qn.apply(D,xs([this.value()],arguments))})}),D}function vGe(){return gr._===this&&(gr._=AT),this}function sz(){}function wGe(D){return D=Oi(D),Fi(function(W){return Q5(W,D)})}var CGe=l6(Qn),SGe=l6(Yr),NGe=l6(Pr);function hde(D){return ys(D)?Ms(yf(D)):fo(D)}function AGe(D){return function(W){return D==null?n:yp(D,W)}}var jGe=R8(),EGe=R8(!0);function iz(){return[]}function az(){return!1}function _Ge(){return{}}function kGe(){return""}function TGe(){return!0}function IGe(D,W){if(D=Oi(D),D<1||D>G)return[];var be=ae,Ve=fc(D,ae);W=Ws(W),D-=ae;for(var xt=os(Ve,W);++be<D;)W(be);return xt}function PGe(D){return Si(D)?Qn(D,yf):Cf(D)?[D]:Bc(K8(ka(D)))}function FGe(D){var W=++_m;return ka(D)+W}var OGe=H2(function(D,W){return D+W},0),MGe=Gl("ceil"),RGe=H2(function(D,W){return D/W},1),LGe=Gl("floor");function DGe(D){return D&&D.length?Cx(D,Fd,Rm):n}function BGe(D,W){return D&&D.length?Cx(D,Ws(W,2),Rm):n}function $Ge(D){return ts(D,Fd)}function UGe(D,W){return ts(D,Ws(W,2))}function zGe(D){return D&&D.length?Cx(D,Fd,Lm):n}function HGe(D,W){return D&&D.length?Cx(D,Ws(W,2),Lm):n}var VGe=H2(function(D,W){return D*W},1),WGe=Gl("round"),qGe=H2(function(D,W){return D-W},0);function GGe(D){return D&&D.length?Hr(D,Fd):0}function KGe(D,W){return D&&D.length?Hr(D,Ws(W,2)):0}return Ot.after=ar,Ot.ary=Ur,Ot.assign=rqe,Ot.assignIn=sde,Ot.assignInWith=vI,Ot.assignWith=sqe,Ot.at=iqe,Ot.before=Wr,Ot.bind=$r,Ot.bindAll=uGe,Ot.bindKey=ds,Ot.castArray=_We,Ot.chain=N6,Ot.chunk=x6,Ot.compact=Y8,Ot.concat=kd,Ot.cond=dGe,Ot.conforms=fGe,Ot.constant=tz,Ot.countBy=hI,Ot.create=aqe,Ot.curry=Ns,Ot.curryRight=Ts,Ot.debounce=Ao,Ot.defaults=oqe,Ot.defaultsDeep=lqe,Ot.defer=Zn,Ot.delay=Ln,Ot.difference=Yi,Ot.differenceBy=Il,Ot.differenceWith=Go,Ot.drop=Xl,Ot.dropRight=Wu,Ot.dropRightWhile=nb,Ot.dropWhile=cl,Ot.fill=Z2,Ot.filter=E6,Ot.flatMap=o7,Ot.flatMapDeep=xI,Ot.flatMapDepth=l7,Ot.flatten=g6,Ot.flattenDeep=ev,Ot.flattenDepth=hu,Ot.flip=nr,Ot.flow=pGe,Ot.flowRight=mGe,Ot.fromPairs=X8,Ot.functions=mqe,Ot.functionsIn=xqe,Ot.groupBy=T6,Ot.initial=b6,Ot.intersection=Q8,Ot.intersectionBy=zm,Ot.intersectionWith=y6,Ot.invert=bqe,Ot.invertBy=yqe,Ot.invokeMap=GU,Ot.iteratee=nz,Ot.keyBy=I6,Ot.keys=yc,Ot.keysIn=Pd,Ot.map=P6,Ot.mapKeys=wqe,Ot.mapValues=Cqe,Ot.matches=xGe,Ot.matchesProperty=gGe,Ot.memoize=Xr,Ot.merge=Sqe,Ot.mergeWith=ide,Ot.method=bGe,Ot.methodOf=yGe,Ot.mixin=rz,Ot.negate=Is,Ot.nthArg=wGe,Ot.omit=Nqe,Ot.omitBy=Aqe,Ot.once=zs,Ot.orderBy=sv,Ot.over=CGe,Ot.overArgs=Hs,Ot.overEvery=SGe,Ot.overSome=NGe,Ot.partial=Ys,Ot.partialRight=ul,Ot.partition=KU,Ot.pick=jqe,Ot.pickBy=ade,Ot.property=hde,Ot.propertyOf=AGe,Ot.pull=v6,Ot.pullAll=nv,Ot.pullAllBy=Hc,Ot.pullAllWith=Vm,Ot.pullAt=vf,Ot.range=jGe,Ot.rangeRight=EGe,Ot.rearg=ia,Ot.reject=M,Ot.remove=pu,Ot.rest=qm,Ot.reverse=w6,Ot.sampleSize=me,Ot.set=_qe,Ot.setWith=kqe,Ot.shuffle=Pe,Ot.slice=J8,Ot.sortBy=hn,Ot.sortedUniq=n7,Ot.sortedUniqBy=Ix,Ot.split=Zqe,Ot.spread=YU,Ot.tail=aI,Ot.take=oI,Ot.takeRight=r7,Ot.takeRightWhile=C6,Ot.takeWhile=LU,Ot.tap=VU,Ot.throttle=AWe,Ot.thru=wf,Ot.toArray=tde,Ot.toPairs=ode,Ot.toPairsIn=lde,Ot.toPath=PGe,Ot.toPlainObject=rde,Ot.transform=Tqe,Ot.unary=jWe,Ot.union=DU,Ot.unionBy=lI,Ot.unionWith=cI,Ot.uniq=Px,Ot.uniqBy=BU,Ot.uniqWith=rb,Ot.unset=Iqe,Ot.unzip=S6,Ot.unzipWith=ho,Ot.update=Pqe,Ot.updateWith=Fqe,Ot.values=M6,Ot.valuesIn=Oqe,Ot.without=$U,Ot.words=dde,Ot.wrap=EWe,Ot.xor=uI,Ot.xorBy=UU,Ot.xorWith=zU,Ot.zip=dI,Ot.zipObject=fI,Ot.zipObjectDeep=HU,Ot.zipWith=Td,Ot.entries=ode,Ot.entriesIn=lde,Ot.extend=sde,Ot.extendWith=vI,rz(Ot,Ot),Ot.add=OGe,Ot.attempt=fde,Ot.camelCase=Dqe,Ot.capitalize=cde,Ot.ceil=MGe,Ot.clamp=Mqe,Ot.clone=kWe,Ot.cloneDeep=IWe,Ot.cloneDeepWith=PWe,Ot.cloneWith=TWe,Ot.conformsTo=FWe,Ot.deburr=ude,Ot.defaultTo=hGe,Ot.divide=RGe,Ot.endsWith=Bqe,Ot.eq=_p,Ot.escape=$qe,Ot.escapeRegExp=Uqe,Ot.every=pI,Ot.find=_6,Ot.findIndex=Um,Ot.findKey=cqe,Ot.findLast=mI,Ot.findLastIndex=J2,Ot.findLastKey=uqe,Ot.floor=LGe,Ot.forEach=rv,Ot.forEachRight=k6,Ot.forIn=dqe,Ot.forInRight=fqe,Ot.forOwn=hqe,Ot.forOwnRight=pqe,Ot.get=ZU,Ot.gt=OWe,Ot.gte=MWe,Ot.has=gqe,Ot.hasIn=JU,Ot.head=kx,Ot.identity=Fd,Ot.includes=gI,Ot.indexOf=Ep,Ot.inRange=Rqe,Ot.invoke=vqe,Ot.isArguments=iv,Ot.isArray=Si,Ot.isArrayBuffer=RWe,Ot.isArrayLike=Id,Ot.isArrayLikeObject=dl,Ot.isBoolean=LWe,Ot.isBuffer=sb,Ot.isDate=DWe,Ot.isElement=BWe,Ot.isEmpty=$We,Ot.isEqual=UWe,Ot.isEqualWith=zWe,Ot.isError=XU,Ot.isFinite=HWe,Ot.isFunction=Ox,Ot.isInteger=Que,Ot.isLength=bI,Ot.isMap=Zue,Ot.isMatch=VWe,Ot.isMatchWith=WWe,Ot.isNaN=qWe,Ot.isNative=GWe,Ot.isNil=YWe,Ot.isNull=KWe,Ot.isNumber=Jue,Ot.isObject=Do,Ot.isObjectLike=Ko,Ot.isPlainObject=c7,Ot.isRegExp=QU,Ot.isSafeInteger=XWe,Ot.isSet=ede,Ot.isString=yI,Ot.isSymbol=Cf,Ot.isTypedArray=O6,Ot.isUndefined=QWe,Ot.isWeakMap=ZWe,Ot.isWeakSet=JWe,Ot.join=Hm,Ot.kebabCase=zqe,Ot.last=zc,Ot.lastIndexOf=tv,Ot.lowerCase=Hqe,Ot.lowerFirst=Vqe,Ot.lt=eqe,Ot.lte=tqe,Ot.max=DGe,Ot.maxBy=BGe,Ot.mean=$Ge,Ot.meanBy=UGe,Ot.min=zGe,Ot.minBy=HGe,Ot.stubArray=iz,Ot.stubFalse=az,Ot.stubObject=_Ge,Ot.stubString=kGe,Ot.stubTrue=TGe,Ot.multiply=VGe,Ot.nth=Z8,Ot.noConflict=vGe,Ot.noop=sz,Ot.now=_n,Ot.pad=Wqe,Ot.padEnd=qqe,Ot.padStart=Gqe,Ot.parseInt=Kqe,Ot.random=Lqe,Ot.reduce=F6,Ot.reduceRight=A,Ot.repeat=Yqe,Ot.replace=Xqe,Ot.result=Eqe,Ot.round=WGe,Ot.runInContext=Ct,Ot.sample=Z,Ot.size=He,Ot.snakeCase=Qqe,Ot.some=St,Ot.sortedIndex=e7,Ot.sortedIndexBy=RU,Ot.sortedIndexOf=Wm,Ot.sortedLastIndex=iI,Ot.sortedLastIndexBy=t7,Ot.sortedLastIndexOf=Tx,Ot.startCase=Jqe,Ot.startsWith=eGe,Ot.subtract=qGe,Ot.sum=GGe,Ot.sumBy=KGe,Ot.template=tGe,Ot.times=IGe,Ot.toFinite=Mx,Ot.toInteger=Oi,Ot.toLength=nde,Ot.toLower=nGe,Ot.toNumber=hh,Ot.toSafeInteger=nqe,Ot.toString=ka,Ot.toUpper=rGe,Ot.trim=sGe,Ot.trimEnd=iGe,Ot.trimStart=aGe,Ot.truncate=oGe,Ot.unescape=lGe,Ot.uniqueId=FGe,Ot.upperCase=cGe,Ot.upperFirst=ez,Ot.each=rv,Ot.eachRight=k6,Ot.first=kx,rz(Ot,function(){var D={};return Hu(Ot,function(W,be){Pi.call(Ot.prototype,be)||(D[be]=W)}),D}(),{chain:!1}),Ot.VERSION=r,fr(["bind","bindKey","curry","curryRight","partial","partialRight"],function(D){Ot[D].placeholder=Ot}),fr(["drop","take"],function(D,W){Ci.prototype[D]=function(be){be=be===n?1:qo(Oi(be),0);var Ve=this.__filtered__&&!W?new Ci(this):this.clone();return Ve.__filtered__?Ve.__takeCount__=fc(be,Ve.__takeCount__):Ve.__views__.push({size:fc(be,ae),type:D+(Ve.__dir__<0?"Right":"")}),Ve},Ci.prototype[D+"Right"]=function(be){return this.reverse()[D](be).reverse()}}),fr(["filter","map","takeWhile"],function(D,W){var be=W+1,Ve=be==pe||be==ie;Ci.prototype[D]=function(xt){var Yt=this.clone();return Yt.__iteratees__.push({iteratee:Ws(xt,3),type:be}),Yt.__filtered__=Yt.__filtered__||Ve,Yt}}),fr(["head","last"],function(D,W){var be="take"+(W?"Right":"");Ci.prototype[D]=function(){return this[be](1).value()[0]}}),fr(["initial","tail"],function(D,W){var be="drop"+(W?"":"Right");Ci.prototype[D]=function(){return this.__filtered__?new Ci(this):this[be](1)}}),Ci.prototype.compact=function(){return this.filter(Fd)},Ci.prototype.find=function(D){return this.filter(D).head()},Ci.prototype.findLast=function(D){return this.reverse().find(D)},Ci.prototype.invokeMap=Fi(function(D,W){return typeof D=="function"?new Ci(this):this.map(function(be){return Ad(be,D,W)})}),Ci.prototype.reject=function(D){return this.filter(Is(Ws(D)))},Ci.prototype.slice=function(D,W){D=Oi(D);var be=this;return be.__filtered__&&(D>0||W<0)?new Ci(be):(D<0?be=be.takeRight(-D):D&&(be=be.drop(D)),W!==n&&(W=Oi(W),be=W<0?be.dropRight(-W):be.take(W-D)),be)},Ci.prototype.takeRightWhile=function(D){return this.reverse().takeWhile(D).reverse()},Ci.prototype.toArray=function(){return this.take(ae)},Hu(Ci.prototype,function(D,W){var be=/^(?:filter|find|map|reject)|While$/.test(W),Ve=/^(?:head|last)$/.test(W),xt=Ot[Ve?"take"+(W=="last"?"Right":""):W],Yt=Ve||/^find/.test(W);xt&&(Ot.prototype[W]=function(){var pn=this.__wrapped__,Fn=Ve?[1]:arguments,qn=pn instanceof Ci,Or=Fn[0],Mr=qn||Si(pn),zr=function(qi){var Xi=xt.apply(Ot,xs([qi],Fn));return Ve&&cs?Xi[0]:Xi};Mr&&be&&typeof Or=="function"&&Or.length!=1&&(qn=Mr=!1);var cs=this.__chain__,Rs=!!this.__actions__.length,Zs=Yt&&!cs,Mi=qn&&!Rs;if(!Yt&&Mr){pn=Mi?pn:new Ci(this);var Js=D.apply(pn,Fn);return Js.__actions__.push({func:wf,args:[zr],thisArg:n}),new hc(Js,cs)}return Zs&&Mi?D.apply(this,Fn):(Js=this.thru(zr),Zs?Ve?Js.value()[0]:Js.value():Js)})}),fr(["pop","push","shift","sort","splice","unshift"],function(D){var W=Ja[D],be=/^(?:push|sort|unshift)$/.test(D)?"tap":"thru",Ve=/^(?:pop|shift)$/.test(D);Ot.prototype[D]=function(){var xt=arguments;if(Ve&&!this.__chain__){var Yt=this.value();return W.apply(Si(Yt)?Yt:[],xt)}return this[be](function(pn){return W.apply(Si(pn)?pn:[],xt)})}}),Hu(Ci.prototype,function(D,W){var be=Ot[W];if(be){var Ve=be.name+"";Pi.call(L1,Ve)||(L1[Ve]=[]),L1[Ve].push({name:W,func:be})}}),L1[Z1(n,N).name]=[{name:"wrapper",func:n}],Ci.prototype.clone=B5,Ci.prototype.reverse=m8,Ci.prototype.value=$1,Ot.prototype.at=A6,Ot.prototype.chain=Fx,Ot.prototype.commit=j6,Ot.prototype.next=s7,Ot.prototype.plant=WU,Ot.prototype.reverse=a7,Ot.prototype.toJSON=Ot.prototype.valueOf=Ot.prototype.value=qU,Ot.prototype.first=Ot.prototype.head,xp&&(Ot.prototype[xp]=i7),Ot},Jt=_t();Gs?((Gs.exports=Jt)._=Jt,es._=Jt):gr._=Jt}).call(pin)}(Ij,Ij.exports)),Ij.exports}var xin=min();const bCe=Ti(xin),gin=({wallet:e="",wallets:t=[]})=>{const[n,r]=m.useState([]),[s,a]=m.useState(!0),[o,l]=m.useState({key:null,direction:null}),c=C=>C.filter(Boolean).map(N=>{var P,I;return typeof N=="string"?N.toLowerCase():((I=(P=N==null?void 0:N.wallet_address)==null?void 0:P.toLowerCase)==null?void 0:I.call(P))||""}).filter(Boolean);m.useEffect(()=>{(async()=>{a(!0);const N=t&&t.length?c(t):[e];if(!N[0]){r([]),a(!1);return}const P=Date.now()-30*24*60*60*1e3;try{const R=(await Promise.all(N.map(F=>fs.post("https://api-ui.hyperliquid.xyz/info",{type:"userNonFundingLedgerUpdates",user:F,startTime:P})))).flatMap(F=>F.data||[]).sort((F,U)=>U.time-F.time);r(R)}catch(I){console.error("Error fetching transaction data:",I)}finally{a(!1)}})()},[e,JSON.stringify(t)]);const u=C=>{let N="asc";o.key===C&&(o.direction==="asc"?N="desc":o.direction==="desc"&&(N=null)),l({key:C,direction:N})},d=[...n].sort((C,N)=>{if(!o.key||!o.direction)return 0;const P=bCe.get(C,o.key),I=bCe.get(N,o.key);return P<I?o.direction==="asc"?-1:1:P>I?o.direction==="asc"?1:-1:0}),f=C=>{if(o.key===C){if(o.direction==="asc")return i.jsx(P3,{className:"inline ml-2 text-white"});if(o.direction==="desc")return i.jsx(I3,{className:"inline ml-2 text-white"})}return i.jsx(F3,{className:"inline ml-2 text-white"})},x=localStorage.getItem("isDateDepositWithdrawFormat")||"date",[g,v]=m.useState(x);m.useEffect(()=>{localStorage.setItem("isDateDepositWithdrawFormat",g)},[g]);const w=({date:C})=>{const[N,P]=m.useState(Mo(C));return m.useEffect(()=>{const I=setInterval(()=>P(Mo(C)),1e3);return()=>clearInterval(I)},[C]),i.jsx("span",{className:"text-white text-[13px] font-semibold font-manrope",children:N.dateTime})};return i.jsx("div",{className:"relative w-full text-white text-sm font-semibold font-manrope leading-[13px] tracking-tight",children:i.jsx("div",{className:"w-full overflow-scroll min-h-[60vh] max-h-[60vh] h-full mt-1 mb-3 bg-[#161616] rounded-lg pb-24",children:i.jsxs("table",{className:"w-full table-auto relative border-separate border-spacing-y-1",children:[i.jsx("thead",{className:"sticky top-0 bg-[#161616]",children:i.jsxs("tr",{className:"text-[#9b9b9b] text-left",children:[i.jsxs("th",{onClick:()=>u("time"),className:"cursor-pointer",children:["Time ",f("time")]}),i.jsxs("th",{onClick:()=>u("delta.type"),className:"cursor-pointer",children:["Type ",f("delta.type")]}),i.jsxs("th",{onClick:()=>u("asset"),className:"cursor-pointer",children:["Asset ",f("asset")]}),i.jsxs("th",{onClick:()=>u("delta.usdc"),className:"cursor-pointer",children:["Amount ",f("delta.usdc")]}),i.jsx("th",{children:"Transaction"})]})}),i.jsx("tbody",{children:s?i.jsx("tr",{children:i.jsx("td",{colSpan:5,className:"text-center p-4",children:"Loading…"})}):d.length===0?i.jsx("tr",{children:i.jsx("td",{colSpan:5,className:"text-center p-4",children:"No transactions available"})}):d.map((C,N)=>i.jsxs("tr",{className:"bg-[#1b1b1b] hover:bg-[#222222] h-[32px] text-white",children:[i.jsx("td",{className:"cursor-pointer",onClick:()=>v(g==="time"?"date":"time"),children:g==="time"?i.jsx(w,{date:C.time}):su(C.time)}),i.jsx("td",{className:C.delta.type==="deposit"?"text-[#4ae3b5]":C.delta.type==="withdraw"?"text-[#ff6b6b]":"",children:C.delta.type?C.delta.type[0].toUpperCase()+C.delta.type.slice(1):"Unknown"}),i.jsx("td",{children:"-"}),i.jsxs("td",{children:["$",Er(+C.delta.usdc)]}),i.jsx("td",{className:"break-all",children:KD(C.hash)})]},N))})]})})})};function Ine(){return Ine=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ine.apply(null,arguments)}function yCe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Pne(e,t){return Pne=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},Pne(e,t)}function bin(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Pne(e,t)}var vCe=Number.isNaN||function(t){return typeof t=="number"&&t!==t};function yin(e,t){return!!(e===t||vCe(e)&&vCe(t))}function vin(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(!yin(e[n],t[n]))return!1;return!0}function HY(e,t){t===void 0&&(t=vin);var n,r=[],s,a=!1;function o(){for(var l=[],c=0;c<arguments.length;c++)l[c]=arguments[c];return a&&n===this&&t(l,r)||(s=e.apply(this,l),a=!0,n=this,r=l),s}return o}var win=typeof performance=="object"&&typeof performance.now=="function",wCe=win?function(){return performance.now()}:function(){return Date.now()};function CCe(e){cancelAnimationFrame(e.id)}function Cin(e,t){var n=wCe();function r(){wCe()-n>=t?e.call(null):s.id=requestAnimationFrame(r)}var s={id:requestAnimationFrame(r)};return s}var VY=-1;function SCe(e){if(e===void 0&&(e=!1),VY===-1||e){var t=document.createElement("div"),n=t.style;n.width="50px",n.height="50px",n.overflow="scroll",document.body.appendChild(t),VY=t.offsetWidth-t.clientWidth,document.body.removeChild(t)}return VY}var oC=null;function NCe(e){if(e===void 0&&(e=!1),oC===null||e){var t=document.createElement("div"),n=t.style;n.width="50px",n.height="50px",n.overflow="scroll",n.direction="rtl";var r=document.createElement("div"),s=r.style;return s.width="100px",s.height="100px",t.appendChild(r),document.body.appendChild(t),t.scrollLeft>0?oC="positive-descending":(t.scrollLeft=1,t.scrollLeft===0?oC="negative":oC="positive-ascending"),document.body.removeChild(t),oC}return oC}var Sin=150,Nin=function(t,n){return t};function Ain(e){var t,n=e.getItemOffset,r=e.getEstimatedTotalSize,s=e.getItemSize,a=e.getOffsetForIndexAndAlignment,o=e.getStartIndexForOffset,l=e.getStopIndexForStartIndex,c=e.initInstanceProps,u=e.shouldResetStyleCacheOnItemSizeChange,d=e.validateProps;return t=function(f){bin(x,f);function x(v){var w;return w=f.call(this,v)||this,w._instanceProps=c(w.props,yCe(w)),w._outerRef=void 0,w._resetIsScrollingTimeoutId=null,w.state={instance:yCe(w),isScrolling:!1,scrollDirection:"forward",scrollOffset:typeof w.props.initialScrollOffset=="number"?w.props.initialScrollOffset:0,scrollUpdateWasRequested:!1},w._callOnItemsRendered=void 0,w._callOnItemsRendered=HY(function(C,N,P,I){return w.props.onItemsRendered({overscanStartIndex:C,overscanStopIndex:N,visibleStartIndex:P,visibleStopIndex:I})}),w._callOnScroll=void 0,w._callOnScroll=HY(function(C,N,P){return w.props.onScroll({scrollDirection:C,scrollOffset:N,scrollUpdateWasRequested:P})}),w._getItemStyle=void 0,w._getItemStyle=function(C){var N=w.props,P=N.direction,I=N.itemSize,R=N.layout,F=w._getItemStyleCache(u&&I,u&&R,u&&P),U;if(F.hasOwnProperty(C))U=F[C];else{var L=n(w.props,C,w._instanceProps),z=s(w.props,C,w._instanceProps),Q=P==="horizontal"||R==="horizontal",ne=P==="rtl",J=Q?L:0;F[C]=U={position:"absolute",left:ne?void 0:J,right:ne?J:void 0,top:Q?0:L,height:Q?"100%":z,width:Q?z:"100%"}}return U},w._getItemStyleCache=void 0,w._getItemStyleCache=HY(function(C,N,P){return{}}),w._onScrollHorizontal=function(C){var N=C.currentTarget,P=N.clientWidth,I=N.scrollLeft,R=N.scrollWidth;w.setState(function(F){if(F.scrollOffset===I)return null;var U=w.props.direction,L=I;if(U==="rtl")switch(NCe()){case"negative":L=-I;break;case"positive-descending":L=R-P-I;break}return L=Math.max(0,Math.min(L,R-P)),{isScrolling:!0,scrollDirection:F.scrollOffset<L?"forward":"backward",scrollOffset:L,scrollUpdateWasRequested:!1}},w._resetIsScrollingDebounced)},w._onScrollVertical=function(C){var N=C.currentTarget,P=N.clientHeight,I=N.scrollHeight,R=N.scrollTop;w.setState(function(F){if(F.scrollOffset===R)return null;var U=Math.max(0,Math.min(R,I-P));return{isScrolling:!0,scrollDirection:F.scrollOffset<U?"forward":"backward",scrollOffset:U,scrollUpdateWasRequested:!1}},w._resetIsScrollingDebounced)},w._outerRefSetter=function(C){var N=w.props.outerRef;w._outerRef=C,typeof N=="function"?N(C):N!=null&&typeof N=="object"&&N.hasOwnProperty("current")&&(N.current=C)},w._resetIsScrollingDebounced=function(){w._resetIsScrollingTimeoutId!==null&&CCe(w._resetIsScrollingTimeoutId),w._resetIsScrollingTimeoutId=Cin(w._resetIsScrolling,Sin)},w._resetIsScrolling=function(){w._resetIsScrollingTimeoutId=null,w.setState({isScrolling:!1},function(){w._getItemStyleCache(-1,null)})},w}x.getDerivedStateFromProps=function(w,C){return jin(w,C),d(w),null};var g=x.prototype;return g.scrollTo=function(w){w=Math.max(0,w),this.setState(function(C){return C.scrollOffset===w?null:{scrollDirection:C.scrollOffset<w?"forward":"backward",scrollOffset:w,scrollUpdateWasRequested:!0}},this._resetIsScrollingDebounced)},g.scrollToItem=function(w,C){C===void 0&&(C="auto");var N=this.props,P=N.itemCount,I=N.layout,R=this.state.scrollOffset;w=Math.max(0,Math.min(w,P-1));var F=0;if(this._outerRef){var U=this._outerRef;I==="vertical"?F=U.scrollWidth>U.clientWidth?SCe():0:F=U.scrollHeight>U.clientHeight?SCe():0}this.scrollTo(a(this.props,w,C,R,this._instanceProps,F))},g.componentDidMount=function(){var w=this.props,C=w.direction,N=w.initialScrollOffset,P=w.layout;if(typeof N=="number"&&this._outerRef!=null){var I=this._outerRef;C==="horizontal"||P==="horizontal"?I.scrollLeft=N:I.scrollTop=N}this._callPropsCallbacks()},g.componentDidUpdate=function(){var w=this.props,C=w.direction,N=w.layout,P=this.state,I=P.scrollOffset,R=P.scrollUpdateWasRequested;if(R&&this._outerRef!=null){var F=this._outerRef;if(C==="horizontal"||N==="horizontal")if(C==="rtl")switch(NCe()){case"negative":F.scrollLeft=-I;break;case"positive-ascending":F.scrollLeft=I;break;default:var U=F.clientWidth,L=F.scrollWidth;F.scrollLeft=L-U-I;break}else F.scrollLeft=I;else F.scrollTop=I}this._callPropsCallbacks()},g.componentWillUnmount=function(){this._resetIsScrollingTimeoutId!==null&&CCe(this._resetIsScrollingTimeoutId)},g.render=function(){var w=this.props,C=w.children,N=w.className,P=w.direction,I=w.height,R=w.innerRef,F=w.innerElementType,U=w.innerTagName,L=w.itemCount,z=w.itemData,Q=w.itemKey,ne=Q===void 0?Nin:Q,J=w.layout,X=w.outerElementType,re=w.outerTagName,pe=w.style,Y=w.useIsScrolling,ie=w.width,oe=this.state.isScrolling,G=P==="horizontal"||J==="horizontal",V=G?this._onScrollHorizontal:this._onScrollVertical,ee=this._getRangeToRender(),ae=ee[0],fe=ee[1],Ne=[];if(L>0)for(var he=ae;he<=fe;he++)Ne.push(m.createElement(C,{data:z,key:ne(he,z),index:he,isScrolling:Y?oe:void 0,style:this._getItemStyle(he)}));var ge=r(this.props,this._instanceProps);return m.createElement(X||re||"div",{className:N,onScroll:V,ref:this._outerRefSetter,style:Ine({position:"relative",height:I,width:ie,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:P},pe)},m.createElement(F||U||"div",{children:Ne,ref:R,style:{height:G?"100%":ge,pointerEvents:oe?"none":void 0,width:G?ge:"100%"}}))},g._callPropsCallbacks=function(){if(typeof this.props.onItemsRendered=="function"){var w=this.props.itemCount;if(w>0){var C=this._getRangeToRender(),N=C[0],P=C[1],I=C[2],R=C[3];this._callOnItemsRendered(N,P,I,R)}}if(typeof this.props.onScroll=="function"){var F=this.state,U=F.scrollDirection,L=F.scrollOffset,z=F.scrollUpdateWasRequested;this._callOnScroll(U,L,z)}},g._getRangeToRender=function(){var w=this.props,C=w.itemCount,N=w.overscanCount,P=this.state,I=P.isScrolling,R=P.scrollDirection,F=P.scrollOffset;if(C===0)return[0,0,0,0];var U=o(this.props,F,this._instanceProps),L=l(this.props,U,F,this._instanceProps),z=!I||R==="backward"?Math.max(1,N):1,Q=!I||R==="forward"?Math.max(1,N):1;return[Math.max(0,U-z),Math.max(0,Math.min(C-1,L+Q)),U,L]},x}(m.PureComponent),t.defaultProps={direction:"ltr",itemData:void 0,layout:"vertical",overscanCount:2,useIsScrolling:!1},t}var jin=function(t,n){t.children,t.direction,t.height,t.layout,t.innerTagName,t.outerTagName,t.width,n.instance},Ein=Ain({getItemOffset:function(t,n){var r=t.itemSize;return n*r},getItemSize:function(t,n){var r=t.itemSize;return r},getEstimatedTotalSize:function(t){var n=t.itemCount,r=t.itemSize;return r*n},getOffsetForIndexAndAlignment:function(t,n,r,s,a,o){var l=t.direction,c=t.height,u=t.itemCount,d=t.itemSize,f=t.layout,x=t.width,g=l==="horizontal"||f==="horizontal",v=g?x:c,w=Math.max(0,u*d-v),C=Math.min(w,n*d),N=Math.max(0,n*d-v+d+o);switch(r==="smart"&&(s>=N-v&&s<=C+v?r="auto":r="center"),r){case"start":return C;case"end":return N;case"center":{var P=Math.round(N+(C-N)/2);return P<Math.ceil(v/2)?0:P>w+Math.floor(v/2)?w:P}case"auto":default:return s>=N&&s<=C?s:s<N?N:C}},getStartIndexForOffset:function(t,n){var r=t.itemCount,s=t.itemSize;return Math.max(0,Math.min(r-1,Math.floor(n/s)))},getStopIndexForStartIndex:function(t,n,r){var s=t.direction,a=t.height,o=t.itemCount,l=t.itemSize,c=t.layout,u=t.width,d=s==="horizontal"||c==="horizontal",f=n*l,x=d?u:a,g=Math.ceil((x+r-f)/l);return Math.max(0,Math.min(o-1,n+g-1))},initInstanceProps:function(t){},shouldResetStyleCacheOnItemSizeChange:!0,validateProps:function(t){t.itemSize}}),wO={exports:{}},_in=wO.exports,ACe;function kin(){return ACe||(ACe=1,function(e,t){(function(n,r){e.exports=r()})(_in,function(){var n=1e3,r=6e4,s=36e5,a="millisecond",o="second",l="minute",c="hour",u="day",d="week",f="month",x="quarter",g="year",v="date",w="Invalid Date",C=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,N=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,P={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(pe){var Y=["th","st","nd","rd"],ie=pe%100;return"["+pe+(Y[(ie-20)%10]||Y[ie]||Y[0])+"]"}},I=function(pe,Y,ie){var oe=String(pe);return!oe||oe.length>=Y?pe:""+Array(Y+1-oe.length).join(ie)+pe},R={s:I,z:function(pe){var Y=-pe.utcOffset(),ie=Math.abs(Y),oe=Math.floor(ie/60),G=ie%60;return(Y<=0?"+":"-")+I(oe,2,"0")+":"+I(G,2,"0")},m:function pe(Y,ie){if(Y.date()<ie.date())return-pe(ie,Y);var oe=12*(ie.year()-Y.year())+(ie.month()-Y.month()),G=Y.clone().add(oe,f),V=ie-G<0,ee=Y.clone().add(oe+(V?-1:1),f);return+(-(oe+(ie-G)/(V?G-ee:ee-G))||0)},a:function(pe){return pe<0?Math.ceil(pe)||0:Math.floor(pe)},p:function(pe){return{M:f,y:g,w:d,d:u,D:v,h:c,m:l,s:o,ms:a,Q:x}[pe]||String(pe||"").toLowerCase().replace(/s$/,"")},u:function(pe){return pe===void 0}},F="en",U={};U[F]=P;var L="$isDayjsObject",z=function(pe){return pe instanceof X||!(!pe||!pe[L])},Q=function pe(Y,ie,oe){var G;if(!Y)return F;if(typeof Y=="string"){var V=Y.toLowerCase();U[V]&&(G=V),ie&&(U[V]=ie,G=V);var ee=Y.split("-");if(!G&&ee.length>1)return pe(ee[0])}else{var ae=Y.name;U[ae]=Y,G=ae}return!oe&&G&&(F=G),G||!oe&&F},ne=function(pe,Y){if(z(pe))return pe.clone();var ie=typeof Y=="object"?Y:{};return ie.date=pe,ie.args=arguments,new X(ie)},J=R;J.l=Q,J.i=z,J.w=function(pe,Y){return ne(pe,{locale:Y.$L,utc:Y.$u,x:Y.$x,$offset:Y.$offset})};var X=function(){function pe(ie){this.$L=Q(ie.locale,null,!0),this.parse(ie),this.$x=this.$x||ie.x||{},this[L]=!0}var Y=pe.prototype;return Y.parse=function(ie){this.$d=function(oe){var G=oe.date,V=oe.utc;if(G===null)return new Date(NaN);if(J.u(G))return new Date;if(G instanceof Date)return new Date(G);if(typeof G=="string"&&!/Z$/i.test(G)){var ee=G.match(C);if(ee){var ae=ee[2]-1||0,fe=(ee[7]||"0").substring(0,3);return V?new Date(Date.UTC(ee[1],ae,ee[3]||1,ee[4]||0,ee[5]||0,ee[6]||0,fe)):new Date(ee[1],ae,ee[3]||1,ee[4]||0,ee[5]||0,ee[6]||0,fe)}}return new Date(G)}(ie),this.init()},Y.init=function(){var ie=this.$d;this.$y=ie.getFullYear(),this.$M=ie.getMonth(),this.$D=ie.getDate(),this.$W=ie.getDay(),this.$H=ie.getHours(),this.$m=ie.getMinutes(),this.$s=ie.getSeconds(),this.$ms=ie.getMilliseconds()},Y.$utils=function(){return J},Y.isValid=function(){return this.$d.toString()!==w},Y.isSame=function(ie,oe){var G=ne(ie);return this.startOf(oe)<=G&&G<=this.endOf(oe)},Y.isAfter=function(ie,oe){return ne(ie)<this.startOf(oe)},Y.isBefore=function(ie,oe){return this.endOf(oe)<ne(ie)},Y.$g=function(ie,oe,G){return J.u(ie)?this[oe]:this.set(G,ie)},Y.unix=function(){return Math.floor(this.valueOf()/1e3)},Y.valueOf=function(){return this.$d.getTime()},Y.startOf=function(ie,oe){var G=this,V=!!J.u(oe)||oe,ee=J.p(ie),ae=function(Ie,Le){var Qe=J.w(G.$u?Date.UTC(G.$y,Le,Ie):new Date(G.$y,Le,Ie),G);return V?Qe:Qe.endOf(u)},fe=function(Ie,Le){return J.w(G.toDate()[Ie].apply(G.toDate("s"),(V?[0,0,0,0]:[23,59,59,999]).slice(Le)),G)},Ne=this.$W,he=this.$M,ge=this.$D,ye="set"+(this.$u?"UTC":"");switch(ee){case g:return V?ae(1,0):ae(31,11);case f:return V?ae(1,he):ae(0,he+1);case d:var ve=this.$locale().weekStart||0,je=(Ne<ve?Ne+7:Ne)-ve;return ae(V?ge-je:ge+(6-je),he);case u:case v:return fe(ye+"Hours",0);case c:return fe(ye+"Minutes",1);case l:return fe(ye+"Seconds",2);case o:return fe(ye+"Milliseconds",3);default:return this.clone()}},Y.endOf=function(ie){return this.startOf(ie,!1)},Y.$set=function(ie,oe){var G,V=J.p(ie),ee="set"+(this.$u?"UTC":""),ae=(G={},G[u]=ee+"Date",G[v]=ee+"Date",G[f]=ee+"Month",G[g]=ee+"FullYear",G[c]=ee+"Hours",G[l]=ee+"Minutes",G[o]=ee+"Seconds",G[a]=ee+"Milliseconds",G)[V],fe=V===u?this.$D+(oe-this.$W):oe;if(V===f||V===g){var Ne=this.clone().set(v,1);Ne.$d[ae](fe),Ne.init(),this.$d=Ne.set(v,Math.min(this.$D,Ne.daysInMonth())).$d}else ae&&this.$d[ae](fe);return this.init(),this},Y.set=function(ie,oe){return this.clone().$set(ie,oe)},Y.get=function(ie){return this[J.p(ie)]()},Y.add=function(ie,oe){var G,V=this;ie=Number(ie);var ee=J.p(oe),ae=function(he){var ge=ne(V);return J.w(ge.date(ge.date()+Math.round(he*ie)),V)};if(ee===f)return this.set(f,this.$M+ie);if(ee===g)return this.set(g,this.$y+ie);if(ee===u)return ae(1);if(ee===d)return ae(7);var fe=(G={},G[l]=r,G[c]=s,G[o]=n,G)[ee]||1,Ne=this.$d.getTime()+ie*fe;return J.w(Ne,this)},Y.subtract=function(ie,oe){return this.add(-1*ie,oe)},Y.format=function(ie){var oe=this,G=this.$locale();if(!this.isValid())return G.invalidDate||w;var V=ie||"YYYY-MM-DDTHH:mm:ssZ",ee=J.z(this),ae=this.$H,fe=this.$m,Ne=this.$M,he=G.weekdays,ge=G.months,ye=G.meridiem,ve=function(Le,Qe,$e,it){return Le&&(Le[Qe]||Le(oe,V))||$e[Qe].slice(0,it)},je=function(Le){return J.s(ae%12||12,Le,"0")},Ie=ye||function(Le,Qe,$e){var it=Le<12?"AM":"PM";return $e?it.toLowerCase():it};return V.replace(N,function(Le,Qe){return Qe||function($e){switch($e){case"YY":return String(oe.$y).slice(-2);case"YYYY":return J.s(oe.$y,4,"0");case"M":return Ne+1;case"MM":return J.s(Ne+1,2,"0");case"MMM":return ve(G.monthsShort,Ne,ge,3);case"MMMM":return ve(ge,Ne);case"D":return oe.$D;case"DD":return J.s(oe.$D,2,"0");case"d":return String(oe.$W);case"dd":return ve(G.weekdaysMin,oe.$W,he,2);case"ddd":return ve(G.weekdaysShort,oe.$W,he,3);case"dddd":return he[oe.$W];case"H":return String(ae);case"HH":return J.s(ae,2,"0");case"h":return je(1);case"hh":return je(2);case"a":return Ie(ae,fe,!0);case"A":return Ie(ae,fe,!1);case"m":return String(fe);case"mm":return J.s(fe,2,"0");case"s":return String(oe.$s);case"ss":return J.s(oe.$s,2,"0");case"SSS":return J.s(oe.$ms,3,"0");case"Z":return ee}return null}(Le)||ee.replace(":","")})},Y.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},Y.diff=function(ie,oe,G){var V,ee=this,ae=J.p(oe),fe=ne(ie),Ne=(fe.utcOffset()-this.utcOffset())*r,he=this-fe,ge=function(){return J.m(ee,fe)};switch(ae){case g:V=ge()/12;break;case f:V=ge();break;case x:V=ge()/3;break;case d:V=(he-Ne)/6048e5;break;case u:V=(he-Ne)/864e5;break;case c:V=he/s;break;case l:V=he/r;break;case o:V=he/n;break;default:V=he}return G?V:J.a(V)},Y.daysInMonth=function(){return this.endOf(f).$D},Y.$locale=function(){return U[this.$L]},Y.locale=function(ie,oe){if(!ie)return this.$L;var G=this.clone(),V=Q(ie,oe,!0);return V&&(G.$L=V),G},Y.clone=function(){return J.w(this.$d,this)},Y.toDate=function(){return new Date(this.valueOf())},Y.toJSON=function(){return this.isValid()?this.toISOString():null},Y.toISOString=function(){return this.$d.toISOString()},Y.toString=function(){return this.$d.toUTCString()},pe}(),re=X.prototype;return ne.prototype=re,[["$ms",a],["$s",o],["$m",l],["$H",c],["$W",u],["$M",f],["$y",g],["$D",v]].forEach(function(pe){re[pe[1]]=function(Y){return this.$g(Y,pe[0],pe[1])}}),ne.extend=function(pe,Y){return pe.$i||(pe(Y,X,ne),pe.$i=!0),ne},ne.locale=Q,ne.isDayjs=z,ne.unix=function(pe){return ne(1e3*pe)},ne.en=U[F],ne.Ls=U,ne.p={},ne})}(wO)),wO.exports}var Tin=kin();const WY=Ti(Tin),Iin=Ae.forwardRef(function({style:t,...n},r){const s=t&&t.pointerEvents==="none"?{...t,pointerEvents:"auto"}:t;return i.jsx("div",{ref:r,style:s,...n})}),Ru=({data:e,columns:t,tableClassName:n,theadClassName:r,tbodyClassName:s,rowClassName:a,cellClassName:o,rowHeight:l=36,listHeight:c=500,rowKey:u,onVisibleRows:d,onRowClick:f,loading:x=!1,skeletonRowCount:g=10,skeletonRenderer:v,emptyState:w=null,loadingState:C=null})=>{const[N,P]=m.useState({key:null,direction:null}),[I,R]=m.useState({}),[F,U]=m.useState(null),[L,z]=m.useState(null),[Q,ne]=m.useState({top:0,left:0}),J=m.useRef(null),X=m.useRef(null);m.useEffect(()=>{function tt(lt){J.current&&!J.current.contains(lt.target)&&(U(null),z(null))}return document.addEventListener("mousedown",tt),()=>document.removeEventListener("mousedown",tt)},[]),m.useEffect(()=>{F&&(L==null?void 0:L.filterType)==="text"&&setTimeout(()=>{var tt;return(tt=X.current)==null?void 0:tt.focus()},0)},[F,L]);function re(tt,lt,ft){return tt.filter(ut=>lt.every(qt=>{const It=ft[qt.key];if(!qt.filterType||!It)return!0;const nn=ut[qt.key];if(It.filterType==="text"){const jt=It.value||"";return nn==null?void 0:nn.toString().toLowerCase().includes(jt.toLowerCase())}if(It.filterType==="select")return!It.values||It.values.length===0?!0:It.values.includes(nn);if(It.filterType==="dateRange"){if(!nn)return!1;const jt=WY(nn);return!(It.start&&jt.isBefore(WY(It.start))||It.end&&jt.isAfter(WY(It.end)))}if(It.filterType==="numberRange"){const jt=parseFloat(It.min),cn=parseFloat(It.max),un=parseFloat(nn);return!(!isNaN(jt)&&un<jt||!isNaN(cn)&&un>cn)}return!0}))}function pe(tt,lt){if(!lt.key||!lt.direction)return tt;const ft=t.find(ut=>ut.key===lt.key);return ft?[...tt].sort((ut,qt)=>{const It=ft.sortValue?ft.sortValue(ut):ut[lt.key],nn=ft.sortValue?ft.sortValue(qt):qt[lt.key],jt=It==null||It==="-",cn=nn==null||nn==="-";return jt&&cn?0:jt?1:cn?-1:typeof It=="number"&&typeof nn=="number"?lt.direction==="asc"?It-nn:nn-It:typeof It=="string"&&typeof nn=="string"?lt.direction==="asc"?It.localeCompare(nn):nn.localeCompare(It):It<nn?lt.direction==="asc"?-1:1:It>nn?lt.direction==="asc"?1:-1:0}):tt}function Y(tt){P(lt=>lt.key===tt?lt.direction==="asc"?{key:tt,direction:"desc"}:lt.direction==="desc"?{key:null,direction:null}:{key:tt,direction:"asc"}:{key:tt,direction:"asc"})}function ie(tt){if(N.key===tt){if(N.direction==="asc")return i.jsx(P3,{className:"inline ml-1"});if(N.direction==="desc")return i.jsx(I3,{className:"inline ml-1"})}return i.jsx(F3,{className:"inline ml-1"})}function oe(tt,lt){R(ft=>{const ut=ft[tt]||{};return{...ft,[tt]:{...ut,...lt}}})}function G(tt){R(lt=>{const ft={...lt};return delete ft[tt],ft})}function V(tt,lt){const ft=tt.currentTarget.getBoundingClientRect(),ut=ft.left+ft.width/2-192/2+window.scrollX,qt=ft.bottom+window.scrollY;if(ne({top:qt,left:ut}),F===lt.key)U(null),z(null);else{U(lt.key);const It=I[lt.key]||{};z({filterType:lt.filterType,value:It.value||"",values:It.values||[],start:It.start||"",end:It.end||"",min:It.min||"",max:It.max||""})}}function ee(tt){L&&oe(tt,L),U(null),z(null)}function ae(tt){if(!L)return null;const lt=L.filterType;return vre.createPortal(i.jsxs("div",{ref:J,style:{position:"absolute",top:Q.top,left:Q.left,zIndex:9999},children:[lt==="text"&&i.jsxs("div",{className:"bg-black/10 border border-gray-400 text-white p-2 font-inter font-semibold shadow-xl w-48 rounded-2xl backdrop-blur-lg",children:[i.jsx("input",{ref:X,type:"text",value:L.value,onChange:ft=>z(ut=>({...ut,value:ft.target.value})),className:"p-1 mb-2 border border-gray-600 bg-gray-600 text-white rounded w-full h-6"}),i.jsxs("div",{className:"flex justify-between",children:[i.jsx("button",{onClick:()=>{G(tt.key),U(null),z(null)},className:"text-xs px-2 py-1 bg-black/10 border border-[#FF797C] text-[#FF797C] font-semibold hover:bg-black/50",children:"Clear"}),i.jsx("button",{onClick:()=>ee(tt.key),className:"text-xs px-2 py-1 bg-[rgba(103,255,189,0.16)] text-[#67FFBD] font-semibold",children:"Apply"})]})]}),lt==="select"&&i.jsxs("div",{className:"bg-black/10 border border-gray-400 text-white p-2 font-inter font-semibold shadow-xl w-48 max-h-48 overflow-y-auto rounded-2xl backdrop-blur-lg",children:[(tt.options||[]).map(ft=>{const ut=L.values,qt=ut.includes(ft);return i.jsxs("label",{className:"block cursor-pointer hover:bg-gray-700 p-1 rounded",children:[i.jsx("input",{type:"checkbox",className:"mr-2",checked:qt,onChange:()=>{z(qt?It=>({...It,values:ut.filter(nn=>nn!==ft)}):It=>({...It,values:[...ut,ft]}))}}),ft]},ft)}),i.jsxs("div",{className:"flex justify-between mt-2",children:[i.jsx("button",{onClick:()=>{G(tt.key),U(null),z(null)},className:"text-xs px-2 py-1 bg-black/10 border border-[#FF797C] text-[#FF797C] font-semibold hover:bg-black/50",children:"Clear"}),i.jsx("button",{onClick:()=>ee(tt.key),className:"text-xs px-2 py-1 bg-[rgba(103,255,189,0.16)] text-[#67FFBD] font-semibold",children:"Apply"})]})]}),lt==="dateRange"&&i.jsxs("div",{className:"bg-black/10 border border-gray-400 text-white p-2 font-inter font-semibold shadow-xl w-52 rounded-2xl backdrop-blur-lg",children:[i.jsxs("div",{className:"mb-2",children:[i.jsx("label",{className:"block text-xs mb-1",children:"Start"}),i.jsx("input",{type:"date",className:"p-1 mb-2 border border-gray-600 bg-gray-700 text-white rounded w-full h-6 text-xs",value:L.start,onChange:ft=>z(ut=>({...ut,start:ft.target.value}))})]}),i.jsxs("div",{className:"mb-2",children:[i.jsx("label",{className:"block text-xs mb-1",children:"End"}),i.jsx("input",{type:"date",className:"p-1 border border-gray-600 bg-gray-700 text-white rounded w-full h-6 text-xs",value:L.end,onChange:ft=>z(ut=>({...ut,end:ft.target.value}))})]}),i.jsxs("div",{className:"flex justify-between",children:[i.jsx("button",{onClick:()=>{G(tt.key),U(null),z(null)},className:"text-xs px-2 py-1 bg-black/10 border border-[#FF797C] text-[#FF797C] font-semibold hover:bg-black/50",children:"Clear"}),i.jsx("button",{onClick:()=>ee(tt.key),className:"text-xs px-2 py-1 bg-[rgba(103,255,189,0.16)] text-[#67FFBD] font-semibold",children:"Apply"})]})]}),lt==="numberRange"&&i.jsxs("div",{className:"bg-black/10 border-2 border-gray-700 text-white p-2 font-inter font-semibold shadow-xl w-48 rounded-2xl backdrop-blur-lg",children:[i.jsxs("div",{className:"mb-2",children:[i.jsx("label",{className:"block text-xs mb-1",children:"Min"}),i.jsx("input",{type:"number",step:"any",className:"p-1 mb-2 border border-gray-600 bg-gray-700 text-white rounded w-full h-6",value:L.min,onChange:ft=>z(ut=>({...ut,min:ft.target.value}))})]}),i.jsxs("div",{className:"mb-2",children:[i.jsx("label",{className:"block text-xs mb-1",children:"Max"}),i.jsx("input",{type:"number",step:"any",className:"p-1 border border-gray-600 bg-gray-700 text-white rounded w-full h-6",value:L.max,onChange:ft=>z(ut=>({...ut,max:ft.target.value}))})]}),i.jsxs("div",{className:"flex justify-between",children:[i.jsx("button",{onClick:()=>{G(tt.key),U(null),z(null)},className:"text-xs px-2 py-1 bg-black/10 border border-[#FF797C] text-[#FF797C] font-semibold hover:bg-black/50",children:"Clear"}),i.jsx("button",{onClick:()=>ee(tt.key),className:"text-xs px-2 py-1 bg-[rgba(103,255,189,0.16)] text-[#67FFBD] font-semibold",children:"Apply"})]})]})]}),document.body)}const fe=Array.isArray(e)?e:[],Ne=x?[]:pe(re(fe,t,I),N),he=t.map(tt=>tt.width||"minmax(0, 100%)").join(" "),ge=t.map((tt,lt)=>typeof tt.skeletonWidth=="number"?tt.skeletonWidth:60+lt*23%80),ye=Object.keys(I).length>0,ve=!x&&Ne.length===0;function je({w:tt}){return i.jsx("span",{className:"block h-[14px] rounded bg-[#242424] animate-pulse",style:{width:tt}})}function Ie({index:tt,style:lt}){return i.jsx("div",{style:{...lt,display:"grid",gridTemplateColumns:he,alignItems:"center"},className:`relative bg-[#1b1b1b] text-white rounded-xl my-[1px] h-[32px] max-h-[32px] leading-[32px] font-inter text-sm font-semibold ${typeof a=="function"?a({},tt)||"":a||""}`,children:t.map((ft,ut)=>i.jsx("div",{className:`px-4 ${typeof o=="function"?o(ft,{},tt)||"":o||""}`,children:v?v({column:ft,index:tt,width:ge[ut]}):i.jsx(je,{w:ge[ut]})},`sk-${ft.key}-${ut}`))})}function Le({index:tt,style:lt}){if(tt<0||tt>=Ne.length)return null;const ft=Ne[tt];return i.jsx("div",{onClick:()=>f&&f(ft),style:{...lt,display:"grid",gridTemplateColumns:he,alignItems:"center"},className:`relative group bg-[#1b1b1b] hover:bg-[#222222] text-white rounded-xl my-[1px] h-[32px] max-h-[32px] leading-[32px] font-inter text-sm font-semibold ${typeof a=="function"?a(ft,tt)||"":a||""}`,children:t.map(ut=>{const qt=ut.render?ut.render(ft[ut.key],ft,tt):ft[ut.key];return i.jsx("div",{className:`px-4 overflow-hidden whitespace-nowrap ${typeof o=="function"?o(ut,ft,tt)||"":o||""}`,children:qt},ut.key)})})}const Qe=x?g:Ne.length,$e=x?void 0:u?tt=>u(Ne[tt]):void 0,it=tt=>tt.headerTooltip?i.jsx(mi,{content:tt.headerTooltip,align:tt.headerTooltipAlign||"center",children:i.jsx("span",{className:"inline-flex underline decoration-dotted underline-offset-2 cursor-help pointer-events-auto",children:tt.label})}):tt.label;return i.jsx("div",{className:`w-full relative ${n||""}`,children:i.jsx("div",{className:"overflow-x-auto",children:i.jsxs("div",{className:"min-w-max",children:[i.jsx("div",{className:`sticky top-0 z-10 bg-[#161616] font-inter text-sm font-bold text-white ${r||""}`,style:{display:"grid",gridTemplateColumns:he},children:t.map(tt=>i.jsxs("div",{className:"px-3 py-1 text-left inline-flex items-center w-fit hover:bg-[#262626] hover:rounded-[6px] hover:text-white cursor-pointer transition-all",onClick:()=>!x&&tt.sortable&&Y(tt.key),children:[it(tt),tt.sortable&&i.jsx("span",{className:"ml-1",children:ie(tt.key)}),tt.filterType&&i.jsx("span",{className:"ml-2 cursor-pointer",onClick:lt=>{lt.stopPropagation(),x||V(lt,tt)},children:i.jsx(E6t,{className:"w-3 h-3"})}),F===tt.key&&ae(tt)]},tt.key))}),x&&C?i.jsx("div",{className:`${s||""} min-w-max`,children:typeof C=="function"?C({hasFilters:ye}):C}):ve?i.jsx("div",{className:`${s||""} min-w-max text-xs text-center text-[#9B9B9B]`,children:typeof w=="function"?w({hasFilters:ye}):w}):i.jsx(Ein,{className:`${s||""} min-w-max`,height:c,itemCount:Qe,itemSize:l,itemKey:$e,innerElementType:Iin,width:"100%",onItemsRendered:({visibleStartIndex:tt,visibleStopIndex:lt})=>!x&&d&&d(Ne.slice(tt,lt+1)),children:x?Ie:Le})]})})})},$P=e=>Number(e).toLocaleString("en-US",{maximumFractionDigits:2}),Pin=e=>!isFinite(e)||isNaN(e)?"-":`${Math.floor(e)}h ${Math.round((e-Math.floor(e))*60)}m`,Fin=(e,t,n,r)=>{const s=e*t/n;return r/s*100};function Oin({trades:e,generatedWallets:t,wallet:n,wallets:r}){const[s,a]=m.useState(!1),[o,l]=m.useState(null),[c,u]=m.useState(()=>new Map),[d,f]=m.useState(new Map),[x,g]=m.useState(new Map),[v,w]=m.useState([]),[C,N]=m.useState(!0),P=m.useRef(new Set),I=m.useRef(new Set),{isReferralCodeName:R}=m.useContext(Qr),F=m.useCallback(G=>{const V=G==null?void 0:G.toLowerCase();return V?(r==null?void 0:r.length)>0?r.some(ee=>{var ae;return((ae=ee.wallet_address)==null?void 0:ae.toLowerCase())===V}):(n==null?void 0:n.toLowerCase())===V:!1},[r,n]),U=m.useMemo(()=>r&&r.length?v:Array.isArray(e)?e:[],[r,v,e]),L=m.useCallback(async G=>{const V=localStorage.getItem("hyperAddress"),ee=localStorage.getItem("hyperToken");if(!(!V||!ee||G.length===0))try{const{data:ae}=await fs.post("https://dextrabothypev2.nftinit.io/api/hyper/order/get_leverage_with_oids/",{address:V,token:ee,position_oids:G},{headers:{"Content-Type":"application/json"}});if(ae&&ae.success){const fe=parseFloat(ae.leverage);f(Ne=>{const he=new Map(Ne);return G.forEach(ge=>he.set(String(ge),fe)),he})}}catch(ae){console.error("leverage fetch error:",ae)}},[]),z=m.useCallback(async G=>{const V=localStorage.getItem("hyperAddress"),ee=localStorage.getItem("hyperToken");if(!(!V||!ee||G.length===0))try{const{data:ae}=await fs.post("https://dextrabothypev2.nftinit.io/api/hyper/order/get_position_details_with_oids/",{address:V,token:ee,position_oids:G},{headers:{"Content-Type":"application/json"}});ae&&ae.success&&g(fe=>{const Ne=new Map(fe);return ae.data.forEach(he=>Ne.set(String(he.oid),he)),Ne})}catch(ae){console.error("source details fetch error:",ae)}},[]),Q=m.useMemo(()=>(r??[]).map(G=>{var V;return(V=G.wallet_address)==null?void 0:V.toLowerCase()}).sort().join(","),[r]);m.useEffect(()=>{if(Q===""){N(!1),w([]);return}let G=!1;return N(!0),a(!1),P.current.clear(),I.current.clear(),f(new Map),g(new Map),u(new Map),(async()=>{try{const V=Q.split(","),ee=(await Promise.all(V.map(async fe=>{const[Ne,he]=await Promise.all([Rce(fe),Lce(fe)]),ge=[...Ne,...he.map(({fill:ye,twapId:ve})=>({...ye,twapId:ve}))];return Dce(ge).closed_positions||[]}))).flat();if(G)return;const ae=ee.sort((fe,Ne)=>(Ne.close_time||0)-(fe.close_time||0));w(ae),l(null)}catch(V){console.error("multi-wallet completed-trades fetch:",V)}finally{G||N(!1)}})(),()=>{G=!0}},[Q]);const ne=m.useCallback(G=>{const V=new Set,ee=new Set;G.forEach(ae=>{((t==null?void 0:t.some(Ne=>F(Ne.wallet_address)))||!1)&&ae.has_builder_fee&&(ae.oids||[]).forEach(Ne=>{P.current.has(Ne)||V.add(Ne),I.current.has(Ne)||ee.add(Ne)})}),V.size>0&&(V.forEach(ae=>P.current.add(ae)),L([...V])),ee.size>0&&(ee.forEach(ae=>I.current.add(ae)),z([...ee]))},[t,F,L,z]);function J({date:G}){const[V,ee]=m.useState(Mo(G));return m.useEffect(()=>{const ae=setInterval(()=>{ee(Mo(G))},1e3);return()=>clearInterval(ae)},[G]),i.jsx("span",{className:"text-white text-sm font-bold font-manrope leading-[13px] tracking-[0.18px] min-w-max",children:V.dateTime})}const X=G=>u(V=>new Map(V).set(G,!V.get(G))),re=(G,V)=>c.get(V)?i.jsx(J,{date:G}):su(G),pe=m.useMemo(()=>[...new Set(U.map(G=>G.coin))],[U]),Y=m.useMemo(()=>U.map(G=>({...G,uid:G.trade_id||G.oid||`${G.open_time}_${G.close_time}`,liqStatus:G.isLiquidated?"Liquidated":"Not Liquidated"})).sort((G,V)=>(V.close_time||0)-(G.close_time||0)),[U]),ie=async G=>{var ge;const V=localStorage.getItem("hyperAddress"),ee=localStorage.getItem("hyperToken"),ae=G.oids??[];let fe=G.leverage??G.positionDistribution??0;if(V&&ee&&ae.length>0)try{fe=((ge=(await fs.post("https://dextrabothypev2.nftinit.io/api/hyper/order/get_leverage_with_oids/",{address:V,token:ee,position_oids:ae},{headers:{"Content-Type":"application/json"}})).data)==null?void 0:ge.leverage)??fe}catch(ye){console.error("Leverage fetch failed:",ye)}const Ne=Fin(G.entry_price_wma,G.total_size,fe,G.total_pnl),he=ye=>Math.abs(ye)<1?ye.toFixed(4):ye.toFixed(2);l({coin:G.coin,type:G.position_side,leverage:fe,roe:he(Ne),entryPrice:G.entry_price_wma,markPrice:G.close_px,positionDistribution:G.total_size,pnl:G.total_pnl-G.total_fee,closePx:G.close_px,referral:R??"--"}),a(!0)},oe=m.useMemo(()=>[{key:"coin",label:"Coin",sortable:!0,filterType:"text",render:(G,V)=>i.jsxs("a",{href:`/terminal/${V.coin}`,target:"_blank",rel:"noopener noreferrer",className:"flex items-center text-white hover:text-gray-400",children:[i.jsx("img",{src:`https://app.hyperliquid.xyz/coins/${V.coin}.svg`,alt:V.coin,className:"w-5 h-5 mr-2",loading:"lazy",onError:ra}),V.coin]})},{key:"source_tag",label:"Source Tag",sortable:!0,filterType:"text",render:(G,V)=>{const ee=x.get(V.oids&&String(V.oids[0]));return ee?i.jsx("a",{href:`/wallet-details/${ee.copy_trader_wallet}`,className:"text-white hover:text-white",children:ee.source_tag||"--"}):"--"}},{key:"position_side",label:"Direction",sortable:!0,filterType:"text",render:(G,V)=>{const ae={Sell:"Sell",Buy:"Buy","Close Short":"Short","Close Long":"Long","Open Short":"Short","Open Long":"Long"}[G]??G??"--",fe=["buy","long"].includes(ae.toLowerCase()),Ne=["sell","short"].includes(ae.toLowerCase()),he=(()=>{if(!(((t==null?void 0:t.some(ve=>F(ve.wallet_address)))||!1)&&V.has_builder_fee))return"";const ye=d.get(V.oids&&String(V.oids[0]));return ye?` - ${ye}x`:""})();return i.jsxs("div",{className:`h-5 pl-1 pr-1.5 py-1 rounded-md inline-flex items-center gap-0.5 ${fe?"text-[#67ffbd] bg-[#67ffbd]/20":Ne?"text-[#ff787b] bg-[#ff797c]/20":"text-white"}`,children:[i.jsx(Ps,{className:`w-3 h-3 ${fe?"fill-[#67ffbd] rotate-180":Ne?"fill-[#ff787b]":""}`}),i.jsxs("span",{className:"text-[11px] font-semibold uppercase",children:[ae,he," "]})]})}},{key:"total_size",label:"Size",sortable:!0,filterType:"numberRange",render:$P},{key:"entry_price_wma",label:"Entry Price",sortable:!0,filterType:"numberRange",render:$P},{key:"close_px",label:"Close Price",sortable:!0,filterType:"numberRange",render:$P},{key:"total_pnl",label:"PnL",sortable:!0,filterType:"numberRange",sortValue:G=>G.total_pnl-G.total_fee,render:(G,V)=>{const ee=(t==null?void 0:t.some(ae=>F(ae.wallet_address)))||!1;return i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsxs("span",{className:V.total_pnl-V.total_fee>0?"text-[#4ae3b5]":V.total_pnl-V.total_fee<0?"text-[#ff6b6b]":"text-white",children:["$",$P(Math.abs(V.total_pnl-V.total_fee))]}),ee&&V.has_builder_fee&&i.jsx("img",{src:gm,alt:"share",className:"w-4 h-4 cursor-pointer",onClick:ae=>{ae.stopPropagation(),ie(V)}})]})}},{key:"total_fee",label:"Fee (USDC)",sortable:!0,filterType:"numberRange",width:"240px",render:(G,V)=>i.jsxs("span",{children:[Er(parseFloat(V.total_fee))," ",V.builder_fee?i.jsxs("span",{className:"text-xs",children:["(",Er(parseFloat(V.builder_fee))," builder fee)"]}):""]})},{key:"duration_hours",label:"Duration",sortable:!0,filterType:"numberRange",render:Pin},{key:"open_time",label:"Opened",sortable:!0,filterType:"dateRange",render:(G,V)=>i.jsx("div",{onClick:()=>X(V.uid),className:"cursor-pointer",children:re(V.open_time,V.uid)}),width:"200px"},{key:"close_time",label:"Closed",sortable:!0,filterType:"dateRange",render:(G,V)=>i.jsx("div",{onClick:()=>X(V.uid),className:"cursor-pointer",children:re(V.close_time,V.uid)}),width:"200px"}],[pe,c,d,x,t,F]);return i.jsxs(i.Fragment,{children:[C?i.jsx("div",{className:"py-4 text-center text-white font-bold",children:"Loading…"}):U.length===0?i.jsx("div",{className:"py-4 text-center text-white font-bold",children:"No completed trades"}):i.jsx(Ru,{data:Y,columns:oe,tableClassName:"min-w-full border-separate border-spacing-y-1",theadClassName:"sticky top-0 bg-[#161616]",rowClassName:"bg-[#1b1b1b] hover:bg-[#222222] text-white",rowKey:G=>G.uid,onVisibleRows:ne}),s&&i.jsx(pT,{open:s,setOpen:a,data:o,setShare:()=>{},setTradeInfo:()=>{},pnlTitle:"REALIZED PNL"})]})}const Min=({data:e,setData:t,wallet:n,coinNameData:r})=>{var G;const[s,a]=m.useState(!1),[o,l]=m.useState(!1),[c,u]=m.useState(!1),[d,f]=m.useState(""),[x,g]=m.useState(""),v=m.useRef(null),w=m.useRef(null),N=localStorage.getItem("isDateTwapFillsFormat")||"date",[P,I]=m.useState(N);m.useEffect(()=>{localStorage.setItem("isDateTwapFillsFormat",P)},[P]);const R="-time",[F,U]=m.useState(R),L=V=>{const ee=r.find(ae=>ae.label===V);return ee?ee.value.toUpperCase():V==null?void 0:V.toUpperCase()},z=e==null?void 0:e.filter(V=>d?L(V.coin).includes(d.toUpperCase()):!0).filter(V=>{var ee,ae;return x?(ae=(ee=V==null?void 0:V.oid)==null?void 0:ee.toString())==null?void 0:ae.includes(x):!0}),Q=V=>z==null?void 0:z.sort((ee,ae)=>{const fe=ee.coin?ee.coin.toUpperCase():"",Ne=ae.coin?ae.coin.toUpperCase():"",he=je=>parseFloat(je.closedPnl||0)-parseFloat(je.fee||0),ge=(je="")=>{const Ie=je.toLowerCase(),Le=Ie.includes("long")||Ie==="buy",Qe=Ie.includes("short")||Ie==="sell";return Le&&!Qe?3:Le&&Qe?2:Qe&&!Le?1:0},ye=parseFloat(ee.sz)*parseFloat(ee.px),ve=parseFloat(ae.sz)*parseFloat(ae.px);return V==="-price"?ae.px-ee.px:V==="price"?ee.px-ae.px:V==="-size"?ae.sz-ee.sz:V==="size"?ee.sz-ae.sz:V==="-fee"?ae.fee-ee.fee:V==="fee"?ee.fee-ae.fee:V==="-closedPnl"?he(ae)-he(ee):V==="closedPnl"?he(ee)-he(ae):V==="-oid"?ae.oid-ee.oid:V==="oid"?ee.oid-ae.oid:V==="-coin"?fe<Ne?-1:fe>Ne?1:0:V==="coin"?fe>Ne?-1:fe<Ne?1:0:V==="-time"?new Date(ae.time)-new Date(ee.time):V==="time"?new Date(ee.time)-new Date(ae.time):V==="-dir"?ge(ae.dir)-ge(ee.dir):V==="dir"?ge(ee.dir)-ge(ae.dir):V==="-tradeValue"?ve-ye:V==="tradeValue"?ye-ve:0});m.useEffect(()=>{(async()=>{try{a(!0);const ee=await fs.post("https://api-ui.hyperliquid.xyz/info",{type:"userTwapSliceFills",user:n}),fe=((ee==null?void 0:ee.data)||[]).map(Ne=>({...Ne.fill,twapId:Ne.twapId||null}));t(fe==null?void 0:fe.sort((Ne,he)=>he.time-Ne.time))}catch(ee){console.error("Error fetching twap data:",ee)}finally{a(!1)}})()},[n]),m.useEffect(()=>{function V(ee){v.current&&!v.current.contains(ee.target)&&l(!1),w.current&&!w.current.contains(ee.target)&&u(!1)}return document.addEventListener("mousedown",V),()=>document.removeEventListener("mousedown",V)},[]);const ne=m.useRef(null),J=()=>{ne.current&&(ne.current.scrollLeft-=200)},X=()=>{ne.current&&(ne.current.scrollLeft+=200)},re=()=>{ne.current&&(ne.current.scrollTop+=200)},pe=()=>{ne.current&&(ne.current.scrollTop-=200)},Y=V=>V>=640&&V<1024?5:V>=1024&&V<1240?8:V>=1240&&V<1540||V>=1540?9:4;function ie({date:V}){const[ee,ae]=m.useState(Mo(V));return m.useEffect(()=>{const fe=setInterval(()=>{ae(Mo(V))},1e3);return()=>clearInterval(fe)},[V]),i.jsx("span",{className:"text-white text-[13px] font-normal font-manrope leading-[13px] tracking-[0.18px] min-w-max",children:ee.dateTime})}const oe={kBONK:"BONK",kPEPE:"PEPE",kSHIB:"SHIB",kFLOKI:"FLOKI",kNEIRO:"NEIRO",kDOGS:"DOGS",kLUNC:"LUNC"};return i.jsxs("div",{className:"relative w-full ",children:[i.jsxs("div",{className:"absolute -top-6 right-2 z-10 justify-start items-center gap-2 hidden lg:flex",children:[i.jsx("button",{onClick:J,className:"bg-[#353535] hover:bg-gray-600 text-white p-1 rounded-lg focus:outline-none focus:ring-0 border-none block lg:hidden",children:i.jsx("span",{className:"w-6 h-6",children:i.jsx(Bl,{className:"text-gray-300 w-4 h-4 rotate-90"})})}),i.jsx("button",{onClick:X,className:"bg-[#353535] hover:bg-gray-600 text-white p-1 rounded-lg focus:outline-none focus:ring-0 border-none block lg:hidden",children:i.jsx("span",{className:"w-6 h-6",children:i.jsx(Bl,{className:"text-gray-300 w-4 h-4 -rotate-90"})})}),i.jsx("button",{onClick:pe,className:"bg-[#353535] hover:bg-gray-600 text-white p-1 rounded-lg focus:outline-none focus:ring-0 border-none",children:i.jsx("span",{className:"w-6 h-6",children:i.jsx(Bl,{className:"text-gray-300 w-4 h-4 -rotate-180"})})}),i.jsx("button",{onClick:re,className:"bg-[#353535] hover:bg-gray-600 text-white p-1 rounded-lg focus:outline-none focus:ring-0 border-none",children:i.jsx("span",{className:"w-6 h-6",children:i.jsx(Bl,{className:"text-gray-300 w-4 h-4 "})})})]}),i.jsx("div",{ref:ne,className:"w-full overflow-scroll min-h-[60vh] max-h-[60vh] h-full flex-grow mt-1 mb-3 bg-[#161616] rounded-lg pb-24",children:i.jsxs("table",{className:"w-full relative",children:[i.jsx("thead",{className:"sticky top-0 z-[3] bg-[#161616] whitespace-nowrap",children:i.jsxs("tr",{className:"w-full z-[4] font-semibold leading-[13px] tracking-[0.26px] text-[#9b9b9b] text-[13px] font-manrope mr-3",children:[i.jsx(jCe,{className:"bg-[#161616] h-10 pl-2 sm:pl-6 min-w-[180px] sm:min-w-[220px] z-[8]",title:"Time",sortKey:"time",sortOption:F,setSortOption:U}),i.jsx("th",{scope:"col",className:"pl-4 min-w-[120px] max-w-[120px] sm:min-w-[150px] sm:max-w-[150px] px-1",children:i.jsxs("div",{className:"flex justify-start items-center gap-2 relative",children:[i.jsx(hi,{title:"Coin",sortKey:"coin",sortOption:F,setSortOption:U,isFilterIcon:!1}),i.jsxs("div",{className:"flex items-center justify-start",children:[i.jsx("button",{onClick:()=>l(!o),className:`${d?"bg-gray-900":"bg-[#555555]"} inline-flex items-center p-1 rounded hover:bg-gray-700 focus:outline-none focus:ring-0 border-none`,children:i.jsx($f,{className:`w-4 h-4 ${d?"text-blue-500":"text-white"}`})}),o&&i.jsxs("div",{ref:v,className:`absolute left-[58px] mt-32 w-[208px]
bg-[#222] border border-gray-700 rounded shadow-lg p-2 z-10`,children:[i.jsxs("div",{className:"flex justify-between items-center px-2 pb-2 border-b border-gray-600",children:[i.jsx("span",{className:"text-white text-sm font-semibold",children:"Filter"}),i.jsx("div",{onClick:()=>f(""),className:"h-5 px-2 py-1.5 bg-[#3d3d3d] rounded-md justify-start items-center gap-2 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-[#cdcdcd] text-[11px] font-semibold font-manrope leading-[8px] pointer-events-none",children:"Clear All"})})]}),i.jsx("input",{type:"text",value:d,onChange:V=>f(V.target.value),className:"bg-[#333] rounded text-white py-1 px-2 text-sm outline-none mt-2 placeholder:text-sm placeholder:font-semibold placeholder:font-manrope placeholder:text-[#7c7c7c]",placeholder:"Coin"})]})]})]})}),i.jsx(jCe,{className:"pl-4 min-w-[120px] max-w-[120px] sm:min-w-[130px] sm:max-w-[130px] px-1",title:"Direction",sortKey:"dir",sortOption:F,setSortOption:U}),i.jsx(K7,{className:"min-w-[70px] max-w-[70px] sm:min-w-[100px] sm:max-w-[100px] px-1",title:"Price",sortKey:"price",sortOption:F,setSortOption:U}),i.jsx(K7,{className:"min-w-[90px] max-w-[90px] sm:min-w-[130px] sm:max-w-[130px] px-1",title:"Size",sortKey:"size",sortOption:F,setSortOption:U}),i.jsx(K7,{className:"min-w-[130px] max-w-[130px] sm:min-w-[150px] sm:max-w-[150px] px-1",title:"Trade Value",sortKey:"tradeValue",sortOption:F,setSortOption:U}),i.jsx(K7,{className:"min-w-[90px] max-w-[90px] sm:min-w-[120px] sm:max-w-[120px] px-1",title:"Fee",sortKey:"fee",sortOption:F,setSortOption:U}),i.jsx(K7,{className:"min-w-[120px] max-w-[120px] sm:min-w-[150px] sm:max-w-[150px] px-1",title:"Closed PnL",sortKey:"closedPnl",sortOption:F,setSortOption:U}),i.jsx("th",{scope:"col",className:"min-w-[160px] max-w-[160px] sm:min-w-[200px] sm:max-w-[200px] pl-1 pr-8",children:i.jsxs("div",{className:"flex justify-end items-center gap-2",children:[i.jsx(hi,{title:"Order ID",sortKey:"oid",sortOption:F,setSortOption:U,isFilterIcon:!0}),i.jsxs("div",{className:"flex items-center justify-start",children:[i.jsx("button",{onClick:()=>u(!c),className:`${x?"bg-gray-900":"bg-[#555555]"} inline-flex items-center p-1 rounded hover:bg-gray-700 focus:outline-none focus:ring-0 border-none`,children:i.jsx($f,{className:`w-4 h-4 ${x?"text-blue-500":"text-white"}`})}),c&&i.jsxs("div",{ref:w,className:`absolute right-[30px] mt-32 w-[208px]
bg-[#222] border border-gray-700 rounded shadow-lg p-2 z-10`,children:[i.jsxs("div",{className:"flex justify-between items-center px-2 pb-2 border-b border-gray-600",children:[i.jsx("span",{className:"text-white text-sm font-semibold",children:"Filter"}),i.jsx("div",{onClick:()=>g(""),className:"h-5 px-2 py-1.5 bg-[#3d3d3d] rounded-md justify-start items-center gap-2 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-[#cdcdcd] text-[11px] font-semibold font-manrope leading-[8px] pointer-events-none",children:"Clear All"})})]}),i.jsx("input",{type:"number",value:x,onChange:V=>g(V.target.value),className:"bg-[#333] rounded text-white py-1 px-2 text-sm outline-none mt-2 placeholder:text-sm placeholder:font-semibold placeholder:font-manrope placeholder:text-[#7c7c7c]",placeholder:"Order ID"})]})]})]})})]})}),i.jsx("tbody",{children:s||Q(F).length==0?i.jsx("tr",{className:"text-center w-full h-full",children:i.jsx("td",{colSpan:Y(window.innerWidth),className:"h-[36vh]",children:i.jsx("div",{className:"flex w-full justify-center items-center",children:i.jsx("div",{className:"flex min-h-[36vh] w-[100%] sm:w-[75%] max-w-[300px] sm:max-w-[700px] justify-center items-center text-center",children:s?i.jsx(Da,{}):i.jsxs("div",{className:"flex flex-col justify-center items-center gap-3",children:[i.jsx("img",{src:ac,alt:""}),i.jsxs("div",{className:"flex flex-col items-center h-max gap-3",children:[i.jsx("div",{className:"text-[#d3d3d3] text-sm font-semibold font-manrope leading-[8px] pt-3",children:"No TWAP fills available at the moment."}),i.jsx("div",{className:"text-center -mt-2",children:i.jsx("span",{className:"text-[#979797] text-[13px] font-normal font-manrope leading-[14px] tracking-wide",children:"Your TWAP orders will appear here once they start executing."})})]})]})})})})}):(G=Q(F))==null?void 0:G.map((V,ee)=>{var ae,fe,Ne,he,ge,ye;return i.jsxs(Ae.Fragment,{children:[i.jsxs("tr",{className:"relative group bg-[#1b1b1b] hover:bg-[#222222] h-[32px] max-h-[32px] text-white rounded-2xl",style:{margin:"2px"},children:[i.jsx("td",{scope:"row",onClick:()=>{I(P=="time"?"date":"time")},className:"bg-[#1b1b1b] group-hover:bg-[#222222] sm:rounded-l-2xl cursor-pointer",children:i.jsx("div",{className:"pl-2 sm:pl-5 flex flex-col items-start gap-2 font-manrope min-w-max text-white text-sm font-normal leading-[13px] tracking-[0.18px]",children:P=="time"?i.jsx(ie,{date:V.time}):su(V.time)})}),i.jsx("td",{className:"text-left cursor-pointer",children:i.jsx("div",{onClick:()=>{var ve;window.open(`/terminal/${((ve=r==null?void 0:r.find(je=>je.label===V.coin))==null?void 0:ve.value)||V.coin}`,"_blank")},className:"group-hover:bg-[#222222] flex justify-start items-center gap-2 pl-4 h-8 max-h-14 rounded-2xl cursor-pointer",children:i.jsxs("div",{className:"flex justify-start items-center gap-1.5",children:[i.jsx("div",{className:"w-5 h-5 rounded-full",children:i.jsx("img",{src:`https://app.hyperliquid.xyz/coins/${((ae=r==null?void 0:r.find(ve=>ve.label===V.coin))==null?void 0:ae.value)||oe[V.coin]||((fe=V.coin)==null?void 0:fe.split("/")[0])}.svg`||Va,alt:V==null?void 0:V.coin,className:"rounded-full w-5 h-5 min-w-5 min-h-5",loading:"lazy",onError:ve=>ra(ve)})}),i.jsx("div",{className:"text-white text-sm font-semibold font-manrope leading-[13px] tracking-tight",children:(()=>{const ve=r.find(je=>je.label===V.coin);return ve?ve.value:V.coin})()})]})})}),i.jsx("td",{scope:"row",className:"z-[2] pl-3 bg-[#1b1b1b] group-hover:bg-[#222222]",children:i.jsx("div",{className:"group-hover:bg-[#222222] flex justify-start items-center gap-2 h-8 max-h-8",children:i.jsx("div",{className:"text-white h-5 pl-1 pr-1.5 py-1 rounded-md justify-start items-center gap-0.5 inline-flex",children:i.jsx("div",{className:`text-left ${V!=null&&V.liquidation?"text-white":(Ne=V.dir)!=null&&Ne.includes("Short")||(he=V.dir)!=null&&he.includes("Sell")?"text-[#ff6b6b]":(ge=V.dir)!=null&&ge.includes("Long")||(ye=V.dir)!=null&&ye.includes("Buy")?"text-[#4ae3b5]":"text-white"} text-sm font-semibold font-manrope leading-[13px] tracking-[0.18px]`,children:V!=null&&V.liquidation?"Liquidation":V.dir?V.dir:"--"})})})}),i.jsx("td",{scope:"row",className:"z-[2] pl-4 bg-[#1b1b1b] group-hover:bg-[#222222]",children:i.jsx("div",{className:"group-hover:bg-[#222222] flex justify-end items-center gap-2 h-8 max-h-8",children:i.jsx("div",{className:"text-white h-5 pl-1 pr-1.5 py-1 rounded-md justify-end items-center gap-0.5 inline-flex",children:i.jsx("div",{className:"text-white text-sm font-semibold font-manrope leading-[13px] tracking-[0.18px]",children:V.px!=null&&!isNaN(parseFloat(V.px))?`$${parseFloat(V.px).toFixed(2)}`:"--"})})})}),i.jsx("td",{children:i.jsx("div",{className:"px-1 flex flex-col items-end gap-2 font-manrope",children:i.jsx("div",{className:"text-white text-sm font-semibold font-manrope leading-[13px] tracking-[0.18px]",children:V.sz!=null&&!isNaN(parseFloat(V.sz))?Er(parseFloat(V.sz)):"--"})})}),i.jsx("td",{children:i.jsx("div",{className:"px-1 flex flex-col items-end gap-2 font-manrope",children:i.jsx("div",{className:"text-white text-sm font-semibold font-manrope leading-[13px] tracking-[0.18px]",children:V.px!=null&&V.sz!=null&&!isNaN(parseFloat(V.px))&&!isNaN(parseFloat(V.sz))?i.jsxs(i.Fragment,{children:["$",Er(parseFloat(V.px)*parseFloat(V.sz))]}):"--"})})}),i.jsx("td",{children:i.jsx("div",{className:"px-1 flex flex-col items-end gap-2 font-manrope",children:i.jsx("div",{className:"text-white text-sm font-semibold font-manrope leading-[13px] tracking-[0.18px]",children:V.fee!=null&&!isNaN(parseFloat(V.fee))?Er(parseFloat(V.fee)):"--"})})}),i.jsx("td",{children:i.jsx("div",{className:"px-1 flex flex-col items-end gap-2 font-manrope",children:i.jsx("div",{className:`text-left ${parseFloat(V.closedPnl)-parseFloat(V.fee)>0?"text-[#4ae3b5]":parseFloat(V.closedPnl)-parseFloat(V.fee)<0?"text-[#ff6b6b]":"text-white"} text-sm font-normal font-manrope leading-[13px] tracking-[0.18px]`,children:V.closedPnl!=null&&V.fee!=null&&!isNaN(parseFloat(V.closedPnl))&&!isNaN(parseFloat(V.fee))?i.jsxs(i.Fragment,{children:["$",Er(Math.abs(parseFloat(V.closedPnl)-parseFloat(V.fee)))]}):"--"})})}),i.jsx("td",{className:"sm:rounded-r-2xl mr-3",children:i.jsx("div",{className:"pl-1 pr-8 flex flex-col items-end gap-2 font-manrope",children:i.jsx("div",{className:"text-left text-[#979797] text-sm font-normal font-manrope leading-[13px] tracking-[0.18px]",children:V!=null&&V.oid?V==null?void 0:V.oid:"--"})})})]},ee),i.jsx("tr",{children:i.jsx("td",{colSpan:"100",style:{height:"2px"}})})]},ee)})})]})})]})},K7=({className:e,title:t,sortKey:n,sortOption:r,setSortOption:s})=>i.jsx("th",{scope:"col",className:e,children:i.jsx(hi,{title:t,sortKey:n,sortOption:r,setSortOption:s,isFilterIcon:!0})}),jCe=({className:e,title:t,sortKey:n,sortOption:r,setSortOption:s})=>i.jsx("th",{scope:"col",className:e,children:i.jsx(hi,{title:t,sortKey:n,sortOption:r,setSortOption:s,isFilterIcon:!1})}),lC="https://api-ui.hyperliquid.xyz/info",Rin="wss://api.hyperliquid.xyz/ws",XUe=({initialAddress:e="",wallets:t})=>{var Es,xr,Gt;m.useState(e);const[n,r]=m.useState([]),[s,a]=m.useState([]),o=m.useRef({}),[l,c]=m.useState(!1),[u,d]=m.useState(!0),[f,x]=m.useState(1),[g,v]=m.useState(null),[w,C]=m.useState(!1),[N,P]=m.useState("positions"),I=m.useRef(null),R=Vo(),F=m.useRef(e),U=m.useRef(null),L=m.useRef(null),[z,Q]=m.useState({});m.useState(!1),m.useState("");const[ne,J]=m.useState(null),{getTrackedWatchList:X,hyperToken:re,copyTradeWatchList:pe,getCopyTradeWatchList:Y,setTelegramChatId:ie,setSubscriberRole:oe,setSubsExpireDay:G,setMushboomerETH:V,setMushboomerSOL:ee,setIsReferralCode:ae,isReferralCodeName:fe,setIsReferralCodeName:Ne,setIsWhitelist:he,setHyperToken:ge,setHyperAddress:ye,setSignModalOpen:ve,latestPnL:je}=m.useContext(Qr),{isConnected:Ie,address:Le}=ns();m.useState(!1),m.useState(!1),m.useState(null),m.useState("");const[Qe,$e]=m.useState(!1);m.useState(!1);const[it,tt]=m.useState({}),[lt,ft]=m.useState(!1),[ut,qt]=m.useState([]),[It,nn]=m.useState(null);It||je.activeRange;const jt=oc(),cn=jt.pathname.includes("/wallet-management");m.useEffect(()=>{nn(null)},[je.activeRange]);const un=[{label:"@10",value:"GMEOW"},{label:"@112",value:"MEOW"},{label:"@115",value:"HOLD"},{label:"@117",value:"BERA"},{label:"@12",value:"XULIAN"},{label:"@123",value:"FARM"},{label:"@131",value:"ORA"},{label:"@132",value:"LIQD"},{label:"@134",value:"STAR"},{label:"@135",value:"SENT"},{label:"@136",value:"SOLV"},{label:"@16",value:"CZ"},{label:"@18",value:"ANSEM"},{label:"@21",value:"KOBE"},{label:"@22",value:"HAPPY"},{label:"@25",value:"BIGBEN"},{label:"@3",value:"MANLET"},{label:"@30",value:"FARMED"},{label:"@31",value:"GPT"},{label:"@32",value:"PURRPS"},{label:"@33",value:"BID"},{label:"@34",value:"HODL"},{label:"@1",value:"HFUN"},{label:"@100",value:"UP"},{label:"@101",value:"NIGGO"},{label:"@102",value:"HOP"},{label:"@103",value:"LUCKY"},{label:"@104",value:"COPE"},{label:"@105",value:"HPYH"},{label:"@106",value:"YAP"},{label:"@107",value:"HYPE"},{label:"@108",value:"CHEF"},{label:"@109",value:"WOW"},{label:"@11",value:"PEPE"},{label:"@110",value:"STEEL"},{label:"@111",value:"RETARD"},{label:"@113",value:"NEIRO"},{label:"@114",value:"PEAR"},{label:"@116",value:"MUNCH"},{label:"@118",value:"GENESY"},{label:"@119",value:"BUBZ"},{label:"@120",value:"PICKL"},{label:"@121",value:"SHEEP"},{label:"@122",value:"LAUNCH"},{label:"@124",value:"FLASK"},{label:"@125",value:"VAULT"},{label:"@126",value:"CAT"},{label:"@127",value:"HYENA"},{label:"@128",value:"DEPIN"},{label:"@129",value:"MON"},{label:"@13",value:"RUG"},{label:"@130",value:"BEATS"},{label:"@133",value:"H"},{label:"@137",value:"FLY"},{label:"@138",value:"TIME"},{label:"@139",value:"SOVRN"},{label:"@14",value:"ILIENS"},{label:"@15",value:"FUCKY"},{label:"@17",value:"BAGS"},{label:"@19",value:"TATE"},{label:"@2",value:"LICK"},{label:"@20",value:"PUMP"},{label:"@23",value:"SCHIZO"},{label:"@24",value:"SELL"},{label:"@26",value:"CATNIP"},{label:"@27",value:"HBOOST"},{label:"@28",value:"SUCKY"},{label:"@29",value:"GUP"},{label:"@35",value:"VEGAS"},{label:"@37",value:"VAPOR"},{label:"@38",value:"PANDA"},{label:"@39",value:"PILL"},{label:"@40",value:"ADHD"},{label:"@41",value:"FUN"},{label:"@42",value:"LADY"},{label:"@46",value:"DROP"},{label:"@47",value:"MBAPPE"},{label:"@48",value:"TEST"},{label:"@49",value:"RAGE"},{label:"@5",value:"SIX"},{label:"@50",value:"FRAC"},{label:"@51",value:"ATEHUN"},{label:"@52",value:"COZY"},{label:"@53",value:"ARI"},{label:"@54",value:"WASH"},{label:"@55",value:"ANT"},{label:"@59",value:"CATBAL"},{label:"@60",value:"TJIF"},{label:"@61",value:"GUESS"},{label:"@62",value:"MAXI"},{label:"@63",value:"NMTD"},{label:"@66",value:"RISE"},{label:"@67",value:"CINDY"},{label:"@70",value:"FRIED"},{label:"@73",value:"RANK"},{label:"@74",value:"OMNIX"},{label:"@75",value:"RIP"},{label:"@76",value:"G"},{label:"@77",value:"BOZO"},{label:"@78",value:"SPH"},{label:"@82",value:"BUSSY"},{label:"@83",value:"FATCAT"},{label:"@84",value:"SHREK"},{label:"@85",value:"PIP"},{label:"@86",value:"LQNA"},{label:"@87",value:"NASDAQ"},{label:"@88",value:"YEETI"},{label:"@9",value:"TRUMP"},{label:"@90",value:"FEIT"},{label:"@92",value:"VIZN"},{label:"@93",value:"STRICT"},{label:"@94",value:"AUTIST"},{label:"@96",value:"HGOD"},{label:"@97",value:"LIQUID"},{label:"@36",value:"ASI"},{label:"@4",value:"JEFF"},{label:"@43",value:"MOG"},{label:"@44",value:"HPEPE"},{label:"@45",value:"JEET"},{label:"@57",value:"RICH"},{label:"@58",value:"LORA"},{label:"@6",value:"WAGMI"},{label:"@65",value:"PIGEON"},{label:"@64",value:"HPUMP"},{label:"@69",value:"STACK"},{label:"@7",value:"CAPPY"},{label:"@72",value:"NOCEX"},{label:"@79",value:"SHOE"},{label:"@80",value:"MONAD"},{label:"@81",value:"HOPE"},{label:"@89",value:"SYLVI"},{label:"@91",value:"FRUDO"},{label:"@95",value:"MAGA"},{label:"@99",value:"EARTH"},{label:"@56",value:"NFT"},{label:"@8",value:"POINTS"},{label:"@68",value:"CHINA"},{label:"@141",value:"GOD"}];function Ft(ce,rt){const Pt=rt.map(({fill:vt,twapId:ln})=>({...vt,twapId:ln}));return[...ce,...Pt]}const Ke=(ce,rt)=>{const Pt=Et(rt,ce);o.current={...o.current,[ce]:Pt},a(Object.values(o.current).flat()),d(!1)};m.useEffect(()=>{e&&(async()=>{const ce=await Rce(e),rt=await Lce(e),Pt=Ft(ce,rt),{closed_positions:vt}=Dce(Pt);J(vt)})()},[e]);const Bt=(t??[]).map(ce=>{var rt;return(rt=ce.wallet_address)==null?void 0:rt.toLowerCase()}).filter(Boolean),$t=m.useMemo(()=>[...new Set(Bt)].sort().join("|"),[Bt.join("|")]);m.useEffect(()=>{if(!t||t.length===0)return;const ce=t.map(Pt=>Pt.wallet_address.toLowerCase());if(ce.length===0)return;let rt=!0;return c(!0),d(!0),(async()=>{try{const Pt=await Promise.all(ce.map(async Nr=>{const[fr,ur]=await Promise.all([fs.post(lC,{aggregateByTime:!0,type:"userFills",user:Nr}),fs.post(lC,{type:"clearinghouseState",user:Nr})]);return{addr:Nr,fills:fr.data??[],state:ur.data}}));if(!rt)return;const vt=Pt.flatMap(Nr=>Nr.fills),ln=ht(vt);r(ln);const mn=Pt.flatMap(Nr=>{var fr;return(fr=Nr.state)!=null&&fr.assetPositions?Nr.state.assetPositions.map(ur=>({...ur,_wallet:Nr.addr})):[]}),cr=Et({assetPositions:mn});a(cr),qe(ce)}catch(Pt){console.error("Multi-wallet fetch error:",Pt)}finally{rt&&c(!1)}})(),()=>{rt=!1}},[$t]),m.useEffect(()=>(e&&(F.current=e,Ye(e)),()=>{I.current&&(I.current.close(),I.current=null),U.current&&(clearTimeout(U.current),U.current=null),L.current&&(clearInterval(L.current),L.current=null)}),[e]),m.useEffect(()=>{const ce=async()=>{var rt;document.visibilityState==="visible"&&(((rt=I.current)==null?void 0:rt.readyState)!==WebSocket.OPEN&&qe(F.current.split("|")),F.current.split("|").forEach(Pt=>{fs.post(lC,{type:"clearinghouseState",user:Pt}).then(vt=>Ke(Pt,vt.data))}))};return document.addEventListener("visibilitychange",ce),()=>document.removeEventListener("visibilitychange",ce)},[]),m.useEffect(()=>{const ce=localStorage.getItem("favoriteAddresses");ce&&Q(JSON.parse(ce))},[]);const qe=ce=>{var Pt;const rt=Array.isArray(ce)?ce:[ce];o.current={},a([]),!(((Pt=I.current)==null?void 0:Pt.readyState)===WebSocket.OPEN&&F.current===Le)&&(L.current&&(clearInterval(L.current),L.current=null),U.current&&(clearTimeout(U.current),U.current=null),I.current&&(I.current.close(),I.current=null),F.current=rt.join("|"),I.current=new WebSocket(Rin),I.current.onopen=()=>{console.log("WebSocket Connected"),C(!0);const vt=[];rt.forEach(ln=>{vt.push({method:"subscribe",subscription:{aggregateByTime:!0,type:"userFills",user:ln}},{method:"subscribe",subscription:{type:"user",user:ln}},{method:"subscribe",subscription:{type:"webData2",user:ln}},{method:"subscribe",subscription:{type:"userTwapSliceFills",user:ln}})}),vt.forEach(ln=>{I.current.send(JSON.stringify(ln))}),L.current=setInterval(()=>{var ln;if(((ln=I.current)==null?void 0:ln.readyState)===WebSocket.OPEN){const mn={id:99,method:"ping"};I.current.send(JSON.stringify(mn))}},3e4)},I.current.onclose=vt=>{C(!1),L.current&&(clearInterval(L.current),L.current=null),vt.code!==1e3&&(U.current||(U.current=setTimeout(()=>{U.current=null,F.current===Le&&qe([Le])},5e3)))},I.current.onerror=vt=>{console.error("WebSocket Error:",vt),C(!1)},I.current.onmessage=vt=>{var ln,mn,cr,Nr;try{const fr=JSON.parse(vt.data);if(fr.method==="pong"||fr.result==="success")return;if(fr.channel==="userFills"&&((ln=fr.data)!=null&&ln.fills)&&F.current.toLowerCase()===fr.data.user.toLowerCase()&&r(ur=>{const Yr=ur.flatMap(Qn=>Qn.fills),ss=new Map;Yr.forEach(Qn=>{ss.set(Qn.hash,!0)});const Ir=fr.data.fills.filter(Qn=>!ss.has(Qn.hash));if(Ir.length===0)return ur;const mr=[...Ir,...Yr];return ht(mr)}),fr.channel==="webData2"&&((mn=fr.data)!=null&&mn.clearinghouseState)&&(v(fr.data.clearinghouseState),Ke(fr.data.user.toLowerCase(),fr.data.clearinghouseState)),fr.channel==="user"&&((cr=fr.data)!=null&&cr.fills&&r(ur=>{const Yr=ur.flatMap(Qn=>Qn.fills),ss=new Map;Yr.forEach(Qn=>{ss.set(Qn.hash,!0)});const Ir=fr.data.fills.filter(Qn=>!ss.has(Qn.hash));if(Ir.length===0)return ur;const mr=[...Ir,...Yr];return ht(mr)}),(Nr=fr.data)!=null&&Nr.state)){v(fr.data.state);const ur=Et(fr.data.state);a(ur)}if(fr.channel==="userTwapSliceFills"){const ur=fr==null?void 0:fr.data;if(!ut||ut.length===0||!ur||ur.length===0)return;const Yr=ur==null?void 0:ur.map(Ir=>({...Ir.fill,twapId:Ir.twapId||null})),ss=[...ut];Yr.forEach(Ir=>{const mr=ss==null?void 0:ss.findIndex(Qn=>Qn.oid===Ir.oid);mr!==-1?ss[mr]={...ss[mr],...Ir}:ss.unshift(Ir)}),qt(ss)}}catch(fr){console.error("Error processing WebSocket message:",fr),console.error("Raw message that caused error:",vt.data)}})},Ye=async ce=>{const[rt,Pt]=await Promise.all([fs.post(lC,{aggregateByTime:!0,type:"userFills",user:ce}),fs.post(lC,{type:"clearinghouseState",user:ce})]);if(Pt.data&&Ke(ce.toLowerCase(),Pt.data),!ce){rn.error("Please enter a wallet address");return}if(!ce.match(/^0x[a-fA-F0-9]{40}$/)){rn.error("Please enter a valid Ethereum address");return}c(!0),d(!0);try{ce!==e&&R(`/wallet-details/${ce}`),qe(ce);const vt=await fs.post(lC,{aggregateByTime:!0,type:"userFills",user:ce});if(vt.data&&Array.isArray(vt.data)){const ln=ht(vt.data);r(ln),x(1)}else console.error("Invalid response format:",vt.data)}catch(vt){console.error("Error fetching data:",vt)}finally{c(!1)}},ht=ce=>{const rt=[...ce].sort((vt,ln)=>ln.time-vt.time),Pt=new Map;return rt.forEach(vt=>{var mn;const ln=vt.oid;if(!Pt.has(ln)){const cr=rt.filter(mr=>mr.oid===vt.oid),Nr=cr.reduce((mr,Qn)=>mr+parseFloat(Qn.sz),0),fr=cr.map(mr=>parseFloat(mr.startPosition));let ur;fr.includes(0)?ur=0:fr.every(mr=>mr>0)?ur=Math.max(...fr):fr.every(mr=>mr<0)?ur=Math.min(...fr):ur=cr.reduce((mr,Qn)=>mr+parseFloat(Qn.startPosition),0);const Yr=cr.reduce((mr,Qn)=>mr+parseFloat(Qn.sz)*parseFloat(Qn.px),0),ss=cr.reduce((mr,Qn)=>mr+parseFloat(Qn.closedPnl||0),0),Ir=((mn=cr.find(mr=>mr.dir==="Long > Short"||mr.dir==="Short > Long"))==null?void 0:mn.dir)||"";Pt.set(ln,{oid:vt.oid,asset:vt.coin,direction:Ir==""?vt.dir:Ir,fills:cr,totalSize:Nr,totalStartPositions:ur,totalValue:Yr,pnl:ss,latestFill:vt.time,isLiquidation:!!vt.liquidation})}}),Array.from(Pt.values()).sort((vt,ln)=>ln.latestFill-vt.latestFill)},Zt=ce=>{const rt=new Date(ce),Pt=rt.toLocaleString("en-US",{month:"short"}),vt=rt.getDate(),ln=rt.getFullYear(),mn=rt.getHours().toString().padStart(2,"0"),cr=rt.getMinutes().toString().padStart(2,"0"),Nr=rt.getHours()>=12?" PM":" AM";return`${Pt} ${vt}, ${ln}, ${mn}:${cr} ${Nr}`},zt=n,Et=(ce,rt="")=>{if(!(ce!=null&&ce.assetPositions))return[];const Pt=new Map;return n.forEach(vt=>{vt.fills.forEach(ln=>{let mn="";ln.dir.includes("Open")?mn=ln.dir.includes("Long")?"Long":"Short":ln.side==="B"?mn="Long":ln.side==="S"&&(mn="Short");const cr=`${ln.coin}-${mn}`;(!Pt.has(cr)||ln.time<Pt.get(cr))&&Pt.set(cr,ln.time)})}),ce.assetPositions.filter(vt=>{if(!vt.position||!vt.position.szi)return!1;const ln=parseFloat(vt.position.szi);return!isNaN(ln)&&ln!==0}).map(vt=>{const ln=vt._wallet||rt||(e==null?void 0:e.toLowerCase()),mn=vt.position,cr=parseFloat(mn.szi),Nr=parseFloat(mn.entryPx),fr=parseFloat(mn.positionValue),ur=parseFloat(mn.unrealizedPnl),Yr=parseFloat(mn.returnOnEquity)*100,ss=parseFloat(mn.marginUsed),Ir=mn.leverage.value,mr=mn.leverage.type,Qn=parseFloat(mn.cumFunding.sinceOpen),xs=cr>0?"Long":"Short",Xs=Pt.get(`${mn.coin}-${xs}`);return{wallet:ln,asset:mn.coin,type:xs,size:cr,entryPrice:Nr.toFixed(4),currentPrice:(fr/Math.abs(cr)).toFixed(4),leverage:Ir,marginMode:mr,positionValue:fr.toFixed(2),marginUsed:ss.toFixed(2),unrealizedPnl:ur.toFixed(2),roe:Yr.toFixed(2),funding:Qn.toFixed(4),startTime:Xs?Zt(Xs):"N/A",liquidationPrice:mn.liquidationPx?parseFloat(mn.liquidationPx).toFixed(2):"N/A"}})};m.useEffect(()=>{window.localStorage.getItem("hyperToken")&&(X(),Y())},[]);const nt=m.useRef(null),Ue=()=>{nt.current&&(nt.current.scrollLeft-=200)},Rt=()=>{nt.current&&(nt.current.scrollLeft+=200)},We=()=>{nt.current&&(nt.current.scrollTop+=200)},at=()=>{nt.current&&(nt.current.scrollTop-=200)};m.useRef(null);const mt=m.useRef(null),Dt=()=>{mt.current&&(mt.current.scrollLeft-=200)},Tt=()=>{mt.current&&(mt.current.scrollLeft+=200)},dn=()=>{mt.current&&(mt.current.scrollTop+=200)},on=()=>{mt.current&&(mt.current.scrollTop-=200)};m.useRef(null),m.useEffect(()=>{(async()=>{var vt,ln;const rt=window.localStorage.getItem("hyperToken"),Pt=window.localStorage.getItem("hyperAddress");if(!(!rt||!Pt))try{const mn=await Ei(Pt.toLowerCase(),rt);mn!=null&&mn.success?(ie(mn==null?void 0:mn.telegram_chat_id),oe(mn==null?void 0:mn.subscriber_role),G(mn==null?void 0:mn.subs_expire_day),V((vt=mn==null?void 0:mn.mushboomer_counts)==null?void 0:vt.eth),ee((ln=mn==null?void 0:mn.mushboomer_counts)==null?void 0:ln.sol),ae(mn==null?void 0:mn.referral_code),Ne(mn==null?void 0:mn.refcode),he(mn==null?void 0:mn.whitelist)):(window.localStorage.removeItem("hyperToken"),window.localStorage.removeItem("hyperAddress"),ge(""),ye(""))}catch(mn){console.error("Token verification error:",mn),console.error(mn.message||"An unknown error occurred.")}})()},[]);const gn=["Open Position","Increase","Decrease","Changed Position","Position Closed","Spot","Liquidation"],Nn="-latestFill",[kn,yn]=m.useState(Nn),[Vn,Gn]=m.useState([]),[Dn,Kn]=m.useState(""),[Cn,sn]=m.useState(""),[Me,en]=m.useState(""),[an,Nt]=m.useState(!1),[Yn,xn]=m.useState(!1),[Mt,tn]=m.useState(!1),[In,Xn]=m.useState(!1),or=m.useRef(null),lr=m.useRef(null),Qt=m.useRef(null),zn=m.useRef(null),Jn=ce=>{Gn(rt=>rt.includes(ce)?rt.filter(Pt=>Pt!==ce):[...rt,ce])};m.useEffect(()=>{function ce(rt){or.current&&!or.current.contains(rt.target)&&Nt(!1),lr.current&&!lr.current.contains(rt.target)&&xn(!1),Qt.current&&!Qt.current.contains(rt.target)&&tn(!1),zn.current&&!zn.current.contains(rt.target)&&Xn(!1)}return document.addEventListener("mousedown",ce),()=>document.removeEventListener("mousedown",ce)},[]);const Lt=zt.map(ce=>{let rt=ce.isLiquidation?"Liquidation":ce.totalStartPositions==0?"Open Position":ce.direction!="Short > Long"&&ce.direction!="Long > Short"?(ce==null?void 0:ce.totalSize)-Math.abs(ce==null?void 0:ce.totalStartPositions)==0&&(ce.direction=="Close Long"||ce.direction=="Close Short")?"Position Closed":ce.direction=="Open Short"||ce.direction=="Open Long"?"Increase":ce.direction=="Close Long"||ce.direction=="Close Short"?"Decrease":ce.direction=="Sell"||ce.direction=="Buy"?"Spot":"Changed Position":ce.direction=="Short > Long"||ce.direction=="Long > Short"?"Changed Position":"Open Position";return{...ce,computedType:rt}}),jn=ce=>{const rt=un.find(Pt=>Pt.label===ce);return rt?rt.value.toUpperCase():ce==null?void 0:ce.toUpperCase()},Ee=Lt.filter(ce=>Vn.length?Vn.includes(ce.computedType):!0).filter(ce=>{var rt,Pt;return Dn?(Pt=(rt=ce==null?void 0:ce.oid)==null?void 0:rt.toString())==null?void 0:Pt.includes(Dn):!0}).filter(ce=>Cn?jn(ce.asset).includes(Cn.toUpperCase()):!0),h=ce=>Ee==null?void 0:Ee.sort((rt,Pt)=>{var ss,Ir,mr,Qn;const vt=rt.totalSize?rt.totalValue/rt.totalSize:0,ln=Pt.totalSize?Pt.totalValue/Pt.totalSize:0,mn=xs=>{const Xs=un.find(ii=>ii.label===xs);return Xs?Xs.value.toUpperCase():xs==null?void 0:xs.toUpperCase()},cr=mn(rt.asset),Nr=mn(Pt.asset),fr=xs=>{if(!xs)return"";const Xs=xs.toLowerCase();return Xs.includes("short")?"Short":Xs.includes("long")?"Long":Xs==="buy"?"Buy":Xs==="sell"?"Sell":xs},ur=fr(rt.direction),Yr=fr(Pt.direction);if(ce==="-totalSize")return Pt.totalSize-rt.totalSize;if(ce==="totalSize")return rt.totalSize-Pt.totalSize;if(ce==="-pnl")return Pt.pnl-rt.pnl;if(ce==="pnl")return rt.pnl-Pt.pnl;if(ce==="-fills")return(((ss=Pt.fills)==null?void 0:ss.length)||0)-(((Ir=rt.fills)==null?void 0:Ir.length)||0);if(ce==="fills")return(((mr=rt.fills)==null?void 0:mr.length)||0)-(((Qn=Pt.fills)==null?void 0:Qn.length)||0);if(ce==="-latestFill")return new Date(Pt.latestFill)-new Date(rt.latestFill);if(ce==="latestFill")return new Date(rt.latestFill)-new Date(Pt.latestFill);if(ce==="-avgPrice")return ln-vt;if(ce==="avgPrice")return vt-ln;if(ce==="-oid")return Pt.oid-rt.oid;if(ce==="oid")return rt.oid-Pt.oid;if(ce==="direction"){const xs={Short:1,Sell:2,Long:3,Buy:4};return(xs[ur]||99)-(xs[Yr]||99)}else if(ce==="-direction"){const xs={Long:1,Buy:2,Short:3,Sell:4};return(xs[ur]||99)-(xs[Yr]||99)}else{if(ce==="-coin")return cr<Nr?-1:cr>Nr?1:0;if(ce==="coin")return cr>Nr?-1:cr<Nr?1:0}return 0}),p=h(kn).filter(ce=>(ce.totalStartPositions==0?"Open Position":ce.direction!="Short > Long"&&ce.direction!="Long > Short"?(ce==null?void 0:ce.totalSize)-Math.abs(ce==null?void 0:ce.totalStartPositions)==0&&(ce.direction=="Close Long"||ce.direction=="Close Short")?"Position Closed":ce.direction=="Open Short"||ce.direction=="Open Long"?"Increase":ce.direction=="Close Long"||ce.direction=="Close Short"?"Decrease":ce.direction=="Sell"||ce.direction=="Buy"?"Spot":"Changed Position":ce.direction=="Short > Long"||ce.direction=="Long > Short"?"Changed Position":"Open Position")==="Open Position"),S={};p.forEach(ce=>{var vt;const rt=ce==null?void 0:ce.asset,Pt=new Date(ce==null?void 0:ce.latestFill).getTime();if(!S[rt])S[rt]=ce;else{const ln=new Date((vt=S[rt])==null?void 0:vt.latestFill).getTime();Pt>ln&&(S[rt]=ce)}});const _=Object.values(S),[k,T]=m.useState([]),B=s==null?void 0:s.filter(ce=>{var rt;return Me?(rt=ce.asset)==null?void 0:rt.toLowerCase().includes(Me.toLowerCase()):!0}).map(ce=>{const rt=_.find(vt=>(vt==null?void 0:vt.asset)===(ce==null?void 0:ce.asset)),Pt=k.find(vt=>vt.coin===ce.asset&&(vt.wallet||"").toLowerCase()===(ce.wallet||"").toLowerCase());return{...ce,latestFill:(rt==null?void 0:rt.latestFill)||null,tagName:(Pt==null?void 0:Pt.tag)||null,tagWallet:(Pt==null?void 0:Pt.cp_wallet)||null}}),q="-unrealizedPnl",[te,ue]=m.useState(q),de=ce=>B==null?void 0:B.sort((rt,Pt)=>{const vt=rt.tagName?rt.tagName.toUpperCase():"",ln=Pt.tagName?Pt.tagName.toUpperCase():"",mn=rt.asset?rt.asset.toUpperCase():"",cr=Pt.asset?Pt.asset.toUpperCase():"",Nr=rt.type==="Long"?1:0,fr=Pt.type==="Long"?1:0,ur=rt.type==="Short"?1:0,Yr=Pt.type==="Short"?1:0;return ce==="-unrealizedPnl"?Pt.unrealizedPnl-rt.unrealizedPnl:ce==="unrealizedPnl"?rt.unrealizedPnl-Pt.unrealizedPnl:ce==="-roe"?Pt.roe-rt.roe:ce==="roe"?rt.roe-Pt.roe:ce==="-size"?Pt.size-rt.size:ce==="size"?rt.size-Pt.size:ce==="-entryPrice"?Pt.entryPrice-rt.entryPrice:ce==="entryPrice"?rt.entryPrice-Pt.entryPrice:ce==="-currentPrice"?Pt.currentPrice-rt.currentPrice:ce==="currentPrice"?rt.currentPrice-Pt.currentPrice:ce==="-leverage"?Pt.leverage-rt.leverage:ce==="leverage"?rt.leverage-Pt.leverage:ce==="-positionValue"?Pt.positionValue-rt.positionValue:ce==="positionValue"?rt.positionValue-Pt.positionValue:ce==="-marginUsed"?Pt.marginUsed-rt.marginUsed:ce==="marginUsed"?rt.marginUsed-Pt.marginUsed:ce==="funding"?Pt.funding-rt.funding:ce==="-funding"?rt.funding-Pt.funding:ce==="-liquidationPrice"?Pt.liquidationPrice-rt.liquidationPrice:ce==="liquidationPrice"?rt.liquidationPrice-Pt.liquidationPrice:ce==="-entryTime"?new Date(Pt.latestFill)-new Date(rt.latestFill):ce==="entryTime"?new Date(rt.latestFill)-new Date(Pt.latestFill):ce==="-source_tag"?vt<ln?-1:vt>ln?1:0:ce==="source_tag"?vt>ln?-1:vt<ln?1:0:ce==="-type_leverage"?Nr!==fr?fr-Nr:Pt.leverage-rt.leverage:ce==="type_leverage"?ur!==Yr?Yr-ur:Pt.leverage-rt.leverage:ce==="-asset"?mn<cr?-1:mn>cr?1:0:ce==="asset"?mn>cr?-1:mn<cr?1:0:0}),[xe,Se]=m.useState([]),[ke,Re]=m.useState(!0),[Ge,Fe]=m.useState(null),[st,se]=m.useState([]),[Ce,Be]=m.useState(!0),[De,_e]=m.useState(null),[Je,ct]=m.useState([]),[gt,Xt]=m.useState(!0),[wt,Xe]=m.useState(null);async function Oe(){try{Re(!0);const ce=await fetch(`https://dextradata.nftinit.io/api/hyper/get_wallets_profit_new/?period=1&order=-perp_pnl&offset=0&limit=50&user_token=${e}`);if(!ce.ok)throw new Error(`HTTP error! status: ${ce.status}`);const rt=await ce.json();Se(rt.results)}catch(ce){console.error("Error resetting filters:",ce),Fe(ce.message)}finally{Re(!1)}}async function bt(){try{Be(!0);const ce=await fetch(`https://dextradata.nftinit.io/api/hyper/get_wallets_profit_new/?period=7&order=-perp_pnl&offset=0&limit=50&user_token=${e}`);if(!ce.ok)throw new Error(`HTTP error! status: ${ce.status}`);const rt=await ce.json();se(rt.results)}catch(ce){console.error("Error resetting filters:",ce),_e(ce.message)}finally{Be(!1)}}async function kt(){try{Xt(!0);const ce=await fetch(`https://dextradata.nftinit.io/api/hyper/get_wallets_profit_new/?period=30&order=-perp_pnl&offset=0&limit=50&user_token=${e}`);if(!ce.ok)throw new Error(`HTTP error! status: ${ce.status}`);const rt=await ce.json();ct(rt.results)}catch(ce){console.error("Error resetting filters:",ce),Xe(ce.message)}finally{Xt(!1)}}m.useEffect(()=>{Oe(),bt(),kt()},[]),m.useState("7D"),m.useState("7D"),s.length,s.filter(ce=>ce.unrealizedPnl>=0).length;const[Ut,fn]=m.useState({coin:"",type:"",leverage:0,roe:0,entryPrice:0,markPrice:0,referral:"",positionDistribution:0,pnl:0,closePx:0});((Es=de(te))==null?void 0:Es.reduce((ce,rt)=>ce+((rt==null?void 0:rt.leverage)||0),0))/(((xr=de(te))==null?void 0:xr.length)||1),(Gt=de(te))==null||Gt.reduce((ce,rt)=>{const Pt=parseFloat(rt==null?void 0:rt.funding)||0;return ce+Pt},0);const yr=localStorage.getItem("isDateOpenPositionsFormat")||"date",[Pn,En]=m.useState(yr);m.useEffect(()=>{localStorage.setItem("isDateOpenPositionsFormat",Pn)},[Pn]);const Bn=localStorage.getItem("isDateFillsFormat")||"date",[_r,sr]=m.useState(Bn);m.useEffect(()=>{localStorage.setItem("isDateFillsFormat",_r)},[_r]);function rr({date:ce}){const[rt,Pt]=m.useState(Mo(ce));return m.useEffect(()=>{const vt=setInterval(()=>{Pt(Mo(ce))},1e3);return()=>clearInterval(vt)},[ce]),i.jsx("span",{className:"text-white text-sm font-normal font-manrope leading-[13px] tracking-[0.18px] min-w-max",children:rt.dateTime})}const[Rr,Jr]=m.useState([]),ws=async()=>{try{const ce=window.localStorage.getItem("hyperToken");if(!ce){ve(!0);return}const rt="https://dextrabothypev2.nftinit.io/api/wallet/list",Pt=window.localStorage.getItem("hyperAddress"),ln=await(await fetch(rt,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:Le?Le.toLowerCase():Pt,token:ce,balance:"false"})})).json();ln!=null&&ln.success?(Jr(ln.data||[]),Br(ln.data)):console.log(ln.error_message)}catch(ce){console.error("Error fetching generate wallet list:",ce)}};m.useEffect(()=>{window.localStorage.getItem("hyperToken")&&ws()},[re]);const[ls,et]=m.useState([]),[yt,Tn]=m.useState(!0),[tr,Ar]=m.useState(!1);m.useEffect(()=>{B&&B.length>0&&(Vr(),Rr.length>0&&yt&&Br())},[B]);const Br=()=>{ls.length!==0&&(dr(ls),yt&&Tn(!1))};m.useEffect(()=>{const ce=window.localStorage.getItem("hyperToken");ls.length&&ce&&dr(ls)},[ls]);const Vr=()=>{const ce=window.localStorage.getItem("hyperToken");let rt=!1;const Pt=[...ls];B.forEach(vt=>{var Nr;const ln=vt.asset,mn=(Nr=vt.wallet||e)==null?void 0:Nr.toLowerCase();Pt.some(fr=>fr.coin===ln&&(fr.wallet||"").toLowerCase()===mn)||(Pt.push({coin:ln,wallet:mn}),rt=!0)}),rt&&(et(Pt),Rr.some(ln=>ln.wallet_address===(e==null?void 0:e.toLowerCase()))&&ce&&dr(Pt))},dr=async ce=>{if(!tr)try{Ar(!0);const rt=window.localStorage.getItem("hyperToken"),Pt="https://dextrabothypev2.nftinit.io/api/hyper/following/position_info/";if(!rt||!ce){Ar(!1);return}rt||ve(!0);const vt=window.localStorage.getItem("hyperAddress"),mn=await(await fetch(Pt,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:Le?Le.toLowerCase():vt,token:rt,positions:ce})})).json();mn.success?T(mn==null?void 0:mn.data):(console.log(mn.error_message),rn.error(mn.error_message))}catch(rt){console.error("Error tag request",rt),rn.error(rt.message)}finally{Ar(!1)}},jr=(t==null?void 0:t.length)>1||Rr.some(ce=>ce.wallet_address===(e==null?void 0:e.toLowerCase())),ps=async(ce,rt,Pt,vt,ln)=>{if(!ce||!Pt||!vt||!ln){console.error("Close order called with invalid parameters"),rn.error("Close order called with invalid parameters");return}const mn=`${vt}_${Pt}_${ln}`;try{tt(ss=>({...ss,[mn]:!0}));const cr=window.localStorage.getItem("hyperToken"),Nr="https://dextrabothypev2.nftinit.io/api/hyper/order/close_order_new/";if(!cr){ve(!0),tt(ss=>({...ss,[mn]:!1}));return}const fr=window.localStorage.getItem("hyperAddress"),ur=await fetch(Nr,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:Le?Le.toLowerCase():fr,token:cr,coin:Pt,wallet_id:ce.toString(),leverage:vt,size:ln})});if(!ur.ok)throw new Error(`Server responded with status ${ur.status}`);const Yr=await ur.json();Yr.success?(tt(ss=>({...ss,[mn]:!1})),rn.success("Close order operation successful.",{style:{border:"1px solid #22c55e",padding:"16px",color:"#fff",borderRadius:"999px",background:"#14532d",height:"60px"},iconTheme:{primary:"#22c55e",secondary:"#FFFAEE"}})):Yr.status=="ok"?(tt(ss=>({...ss,[mn]:!1})),rn.success("Close order operation successful.",{style:{border:"1px solid #22c55e",padding:"16px",color:"#fff",borderRadius:"999px",background:"#14532d",height:"60px"},iconTheme:{primary:"#22c55e",secondary:"#FFFAEE"}})):(console.error("Something went wrong!"),rn.error("Something went wrong!"),tt(ss=>({...ss,[mn]:!1})))}catch{console.error("Something went wrong!"),rn.error("Something went wrong!"),tt(Nr=>({...Nr,[mn]:!1}))}},gr=async(ce=[])=>{if(ce.length!==0){ft(!0);try{await Promise.all(ce.map(rt=>es(rt)))}finally{ft(!1)}}},es=async ce=>{if((B==null?void 0:B.length)===0){rn.success("There are no open positions to closes.",{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(255, 121, 124, 0.32)",width:"400px",minWidth:"400px",height:"40px",backdropFilter:"blur(48px)"},iconTheme:{primary:"#ff797c",secondary:"#7d3031"}});return}if(!ce){console.error("Close order called with invalid parameters"),rn.error("Close order called with invalid parameters");return}try{ft(!0);const rt=window.localStorage.getItem("hyperToken"),Pt="https://dextrabothypev2.nftinit.io/api/hyper/order/close_order_all_new/";if(!rt){ve(!0),ft(!1);return}const vt=window.localStorage.getItem("hyperAddress"),ln=await fetch(Pt,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:Le?Le.toLowerCase():vt,token:rt,wallet_id:ce.toString()})});if(!ln.ok)throw new Error(`Server responded with status ${ln.status}`);const mn=await ln.json();mn.status=="ok"?(ft(!1),rn.success("Close order operation successful.",{style:{border:"1px solid #22c55e",padding:"16px",color:"#fff",borderRadius:"999px",background:"#14532d",height:"60px",width:"400px",minWidth:"400px"},iconTheme:{primary:"#22c55e",secondary:"#FFFAEE"}})):mn.success?(ft(!1),rn.success("There are no open positions to close.",{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(255, 121, 124, 0.32)",width:"400px",minWidth:"400px",height:"40px",backdropFilter:"blur(48px)"},iconTheme:{primary:"#ff797c",secondary:"#7d3031"}})):(console.log("Close order operation failed."),rn.error("Close order operation failed."),ft(!1))}catch(rt){throw console.error("Something went wrong!"),rn.error("Something went wrong!"),ft(!1),rt}},Gs={kBONK:"BONK",kPEPE:"PEPE",kSHIB:"SHIB",kFLOKI:"FLOKI",kNEIRO:"NEIRO",kDOGS:"DOGS",kLUNC:"LUNC"};return i.jsxs("div",{className:"w-full",children:[i.jsx(pT,{open:Qe,setOpen:$e,data:Ut,setTradeInfo:fn}),i.jsxs("div",{className:"flex justify-start items-center w-full gap-2 mb-2 mx-4 mt-4 relative overflow-x-auto whitespace-nowrap scrollbar-hide [-ms-overflow-style:none] [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:[i.jsx("div",{className:"absolute bottom-0 left-0 w-[80%] h-[1px] bg-[#2A2A2A]"}),i.jsx("div",{onClick:()=>P("positions"),className:`${N==="positions"?"active text-[#67FFBD] border-b border-[#67FFBD] z-20":"text-[#C1C1C1]"} h-6 px-2 py-3 flex justify-center items-center gap-2.5 cursor-pointer font-manrope font-semibold pb-4 hover:text-[#67FFBD]`,children:i.jsxs("div",{className:"flex items-center text-[13px] font-semibold font-manrope leading-[8px] pointer-events-none min-w-max",children:[i.jsx("span",{className:"mr-2",children:"Open Positions"}),i.jsx("span",{className:"flex w-[22px] h-[22px] px-3 justify-center items-center gap-[2px] flex-shrink-0 rounded-md bg-[rgba(103,255,189,0.16)] text-[14px] font-semibold font-manrope",children:s.length})]})}),i.jsx("div",{onClick:()=>P("fills"),className:`${N==="fills"?"active text-[#67FFBD] border-b border-[#67FFBD] z-20":"text-[#C1C1C1]"} h-6 px-2 py-3 flex justify-center items-center gap-2.5 cursor-pointer font-manrope font-semibold pb-4 hover:text-[#67FFBD]`,children:i.jsx("div",{className:"text-[13px] font-semibold font-manrope leading-[8px] pointer-events-none",children:"Fills"})}),i.jsx("div",{onClick:()=>P("trade-history"),className:`${N==="trade-history"?"active text-[#67FFBD] border-b border-[#67FFBD] z-20":"text-[#C1C1C1]"} h-6 px-2 py-3 flex justify-center items-center gap-2.5 cursor-pointer font-manrope font-semibold pb-4 hover:text-[#67FFBD]`,children:i.jsx("div",{className:" text-[13px] font-semibold font-manrope leading-[8px] pointer-events-none",children:"Trade History"})}),i.jsx("div",{onClick:()=>P("twap-history"),className:`${N==="twap-history"?"active text-[#67FFBD] border-b border-[#67FFBD] z-20":"text-[#C1C1C1]"} ${jt.pathname.startsWith("/wallet-details")?"":"hidden"} h-6 px-2 py-3 flex justify-center items-center gap-2.5 cursor-pointer font-manrope font-semibold pb-4 hover:text-[#67FFBD]`,children:i.jsx("div",{className:" text-[13px] font-semibold font-manrope leading-[8px] pointer-events-none",children:"Twap History"})}),i.jsx("div",{onClick:()=>P("completed-trades"),className:`${N==="completed-trades"?"active text-[#67FFBD] border-b border-[#67FFBD] z-20":"text-[#C1C1C1]"} h-6 px-2 py-3 flex justify-center items-center gap-2.5 cursor-pointer font-manrope font-semibold pb-4 hover:text-[#67FFBD]`,children:i.jsx("div",{className:" text-[13px] font-semibold font-manrope leading-[8px] pointer-events-none",children:"Completed Trades"})}),i.jsx("div",{onClick:()=>P("deposit-withdraw"),className:`${N==="deposit-withdraw"?"active text-[#67FFBD] border-b border-[#67FFBD] z-20":"text-[#C1C1C1]"} h-6 px-2 py-3 flex justify-center items-center gap-2.5 cursor-pointer font-manrope font-semibold pb-4 hover:text-[#67FFBD]`,children:i.jsx("div",{className:" text-[13px] font-semibold font-manrope leading-[8px] pointer-events-none",children:"Deposits & Withdrawals"})}),!cn&&i.jsxs("div",{onClick:()=>window.open(`https://hypurrscan.io/address/${e}`,"_blank"),className:"h-6 px-2 py-3 justify-center items-center gap-2.5 inline-flex cursor-pointer",children:[i.jsx("img",{src:eyt,className:"w-[19px] h-[18px]"}),i.jsx("div",{className:"text-[#C1C1C1] text-[13px] font-semibold font-manrope leading-[8px] hover:text-[#67FFBD]",children:"HypurrScan"})]})]}),N==="fills"?i.jsxs("div",{className:"relative w-full ",children:[i.jsxs("div",{className:"absolute -top-6 right-2 z-10 justify-start items-center gap-2 hidden lg:flex",children:[i.jsx("button",{onClick:Dt,className:"bg-[#353535] hover:bg-gray-600 text-white p-1 rounded-lg focus:outline-none focus:ring-0 border-none block lg:hidden",children:i.jsx("span",{className:"w-6 h-6",children:i.jsx(Bl,{className:"text-gray-300 w-4 h-4 rotate-90"})})}),i.jsx("button",{onClick:Tt,className:"bg-[#353535] hover:bg-gray-600 text-white p-1 rounded-lg focus:outline-none focus:ring-0 border-none block lg:hidden",children:i.jsx("span",{className:"w-6 h-6",children:i.jsx(Bl,{className:"text-gray-300 w-4 h-4 -rotate-90"})})}),i.jsx("button",{onClick:on,className:"bg-[#353535] hover:bg-gray-600 text-white p-1 rounded-lg focus:outline-none focus:ring-0 border-none",children:i.jsx("span",{className:"w-6 h-6",children:i.jsx(Bl,{className:"text-gray-300 w-4 h-4 -rotate-180"})})}),i.jsx("button",{onClick:dn,className:"bg-[#353535] hover:bg-gray-600 text-white p-1 rounded-lg focus:outline-none focus:ring-0 border-none",children:i.jsx("span",{className:"w-6 h-6",children:i.jsx(Bl,{className:"text-gray-300 w-4 h-4 "})})})]}),i.jsx("div",{ref:mt,className:"w-full overflow-scroll min-h-[60vh] max-h-[60vh] h-full flex-grow mt-1 mb-3 bg-[#161616] rounded-lg pb-24",children:i.jsxs("table",{className:"w-full relative",children:[i.jsx("thead",{className:"sticky top-0 z-[3] bg-[#161616] whitespace-nowrap",children:i.jsxs("tr",{className:"w-full z-[4] font-semibold leading-[13px] tracking-[0.26px] text-[#9b9b9b] text-[13px] font-manrope mr-3",children:[i.jsx("th",{scope:"col",className:"sticky bg-[#161616] left-0 h-10 pl-2 sm:pl-6 min-w-[130px] max-w-[130px] sm:min-w-[150px] sm:max-w-[150px] z-[8]",children:i.jsxs("div",{className:"flex justify-start items-center gap-2 relative",children:[i.jsx(hi,{title:"Coin",sortKey:"coin",sortOption:kn,setSortOption:yn,isFilterIcon:!1}),i.jsxs("div",{className:"flex items-center justify-start",children:[i.jsx("button",{onClick:()=>tn(!Mt),className:`${Cn?"bg-gray-900":"bg-[#555555]"} inline-flex items-center p-1 rounded hover:bg-gray-700 focus:outline-none focus:ring-0 border-none`,children:i.jsx($f,{className:`w-4 h-4 ${Cn?"text-blue-500":"text-white"}`})}),Mt&&i.jsxs("div",{ref:Qt,className:`absolute left-[58px] mt-32 w-[208px]
bg-[#222] border border-gray-700 rounded shadow-lg p-2 z-10`,children:[i.jsxs("div",{className:"flex justify-between items-center px-2 pb-2 border-b border-gray-600",children:[i.jsx("span",{className:"text-white text-sm font-semibold",children:"Filter"}),i.jsx("div",{onClick:()=>sn(""),className:"h-5 px-2 py-1.5 bg-[#3d3d3d] rounded-md justify-start items-center gap-2 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-[#cdcdcd] text-[11px] font-semibold font-manrope leading-[8px] pointer-events-none",children:"Clear All"})})]}),i.jsx("input",{type:"text",value:Cn,onChange:ce=>sn(ce.target.value),className:"bg-[#333] rounded text-white py-1 px-2 text-sm outline-none mt-2 placeholder:text-sm placeholder:font-semibold placeholder:font-manrope placeholder:text-[#7c7c7c]",placeholder:"Coin"})]})]})]})}),i.jsx(qY,{className:"pl-4 min-w-[120px] max-w-[120px] sm:min-w-[144px] sm:max-w-[144px] px-1",title:"Direction",sortKey:"direction",sortOption:kn,setSortOption:yn}),i.jsx("th",{scope:"col",className:"pl-4 min-w-[150px] max-w-[150px] px-1 relative",children:i.jsxs("div",{className:"flex items-center justify-start w-full gap-1 min-w-max max-w-max",children:[i.jsx("div",{className:"flex items-center justify-start group",children:"Type"}),i.jsx("button",{onClick:()=>Nt(!an),className:`${Vn.length>0?"bg-gray-900":"bg-[#555555]"} ml-2 inline-flex items-center p-1 rounded hover:bg-gray-700 focus:outline-none focus:ring-0 border-none`,children:i.jsx($f,{className:`w-4 h-4 ${Vn.length>0?"text-blue-500":"text-white"}`})}),an&&i.jsxs("div",{ref:or,className:"absolute left-[60px] mt-60 w-48 bg-[#222] border border-gray-700 rounded shadow-lg p-2 z-10",children:[i.jsxs("div",{className:"flex justify-between items-center px-2 pb-2 border-b border-gray-600",children:[i.jsx("span",{className:"text-white text-sm font-semibold",children:"Filter"}),i.jsx("div",{onClick:()=>Gn([]),className:"h-5 px-2 py-1.5 bg-[#3d3d3d] rounded-md justify-start items-center gap-2 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-[#cdcdcd] text-[11px] font-semibold font-manrope leading-[8px] pointer-events-none",children:"Clear All"})})]}),gn.map(ce=>i.jsxs("label",{className:"flex items-center gap-2 p-[7px] h-6 relative rounded hover:bg-[#464646] cursor-pointer text-white text-[13px] font-semibold font-manrope leading-[8px]",children:[i.jsx("input",{type:"checkbox",checked:Vn.includes(ce),onChange:()=>Jn(ce),className:"mr-2 bg-[#3b3b3b] hidden "}),i.jsx("div",{className:`w-4 h-4 max-w-4 max-h-4 flex items-center justify-center border ${Vn.includes(ce)?"bg-[#3ec78c] border-[#3ec78c]":"border-[#9d9d9d]"} w-[18px] h-[18px] relative rounded border`,children:Vn.includes(ce)&&i.jsx("img",{src:Yc,alt:"",className:"w-[8.50px] h-[5.66px] ml-[1px]"})}),ce]},ce))]})]})}),i.jsx(Md,{className:"min-w-[80px] max-w-[80px] px-1",title:"Size",sortKey:"totalSize",sortOption:kn,setSortOption:yn}),i.jsx(Md,{className:"min-w-[110px] max-w-[110px] sm:min-w-[130px] sm:max-w-[130px] px-1",title:"Avg. Price",sortKey:"avgPrice",sortOption:kn,setSortOption:yn}),i.jsx(Md,{className:"min-w-[100px] max-w-[100px] sm:min-w-[120px] sm:max-w-[120px] px-1",title:"PnL",sortKey:"pnl",sortOption:kn,setSortOption:yn}),i.jsx(Md,{className:"min-w-[100px] max-w-[100px] sm:min-w-[120px] sm:max-w-[120px] px-1",title:"Fill Count",sortKey:"fills",sortOption:kn,setSortOption:yn}),i.jsx(Md,{className:"min-w-[200px] max-w-[200px] px-1",title:"Latest Fill",sortKey:"latestFill",sortOption:kn,setSortOption:yn}),i.jsx("th",{scope:"col",className:"min-w-[160px] max-w-[160px] pl-1 pr-8 relative",children:i.jsxs("div",{className:"flex justify-end items-center gap-2",children:[i.jsx(hi,{title:"Order ID",sortKey:"oid",sortOption:kn,setSortOption:yn,isFilterIcon:!0}),i.jsxs("div",{className:"flex items-center justify-start",children:[i.jsx("button",{onClick:()=>xn(!Yn),className:`${Dn?"bg-gray-900":"bg-[#555555]"} inline-flex items-center p-1 rounded hover:bg-gray-700 focus:outline-none focus:ring-0 border-none`,children:i.jsx($f,{className:`w-4 h-4 ${Dn?"text-blue-500":"text-white"}`})}),Yn&&i.jsxs("div",{ref:lr,className:`absolute right-[30px] mt-32 w-[208px]
bg-[#222] border border-gray-700 rounded shadow-lg p-2 z-10`,children:[i.jsxs("div",{className:"flex justify-between items-center px-2 pb-2 border-b border-gray-600",children:[i.jsx("span",{className:"text-white text-sm font-semibold",children:"Filter"}),i.jsx("div",{onClick:()=>Kn(""),className:"h-5 px-2 py-1.5 bg-[#3d3d3d] rounded-md justify-start items-center gap-2 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-[#cdcdcd] text-[11px] font-semibold font-manrope leading-[8px] pointer-events-none",children:"Clear All"})})]}),i.jsx("input",{type:"number",value:Dn,onChange:ce=>Kn(ce.target.value),className:"bg-[#333] rounded text-white py-1 px-2 text-sm outline-none mt-2 placeholder:text-sm placeholder:font-semibold placeholder:font-manrope placeholder:text-[#7c7c7c]",placeholder:"Order ID"})]})]})]})})]})}),i.jsx("tbody",{children:h(kn).length==0?i.jsx("tr",{className:"text-center w-full h-full",children:i.jsx("td",{colSpan:window.innerWidth>=640&&window.innerWidth<768?5:window.innerWidth>=768&&window.innerWidth<1024?6:window.innerWidth>=1024&&window.innerWidth<1240?8:window.innerWidth>=1240&&window.innerWidth<1540?10:window.innerWidth>=1540?12:4,className:"h-[36vh]",children:i.jsx("div",{className:"flex w-full justify-center items-center",children:i.jsx("div",{className:"flex min-h-[36vh] w-[100%] sm:w-[75%] max-w-[300px] sm:max-w-[700px] justify-center items-center text-center",children:i.jsxs("div",{className:"flex flex-col justify-center items-center gap-3",children:[i.jsx("img",{src:ac,alt:""}),i.jsxs("div",{className:"flex flex-col items-center h-max gap-3",children:[i.jsx("div",{className:"text-[#d3d3d3] text-sm font-semibold font-manrope leading-[8px] pt-3",children:"No fills are currently available"}),i.jsx("div",{className:"text-center -mt-2",children:i.jsx("span",{className:"text-[#979797] text-[13px] font-normal font-manrope leading-[14px] tracking-wide",children:"To view completed trades, please check your order history"})})]})]})})})})}):h(kn).map((ce,rt)=>{var vt,ln,mn,cr,Nr,fr;const Pt=ce.totalValue/ce.totalSize;return(vt=ce==null?void 0:ce.direction)==null||vt.includes("Long"),i.jsxs(Ae.Fragment,{children:[i.jsxs("tr",{className:"relative group bg-[#1b1b1b] hover:bg-[#222222] h-[32px] max-h-[32px] text-white rounded-2xl",style:{margin:"2px"},children:[i.jsx("td",{scope:"row",className:"sticky left-0 z-[2] bg-[#1b1b1b] group-hover:bg-[#222222] sm:rounded-l-2xl",children:i.jsx("div",{onClick:()=>{var ur;window.open(`/terminal/${((ur=un.find(Yr=>Yr.label===ce.asset))==null?void 0:ur.value)||ce.asset}`,"_blank")},className:"group-hover:bg-[#222222] flex justify-start items-center gap-2 pl-2 sm:pl-6 h-8 max-h-14 rounded-2xl cursor-pointer",children:i.jsxs("div",{className:"flex justify-start items-center gap-1.5",children:[i.jsx("div",{className:"w-5 h-5 rounded-full",children:i.jsx("img",{src:`https://app.hyperliquid.xyz/coins/${((ln=un.find(ur=>ur.label===ce.asset))==null?void 0:ln.value)||Gs[ce.asset]||((mn=ce.asset)==null?void 0:mn.split("/")[0])}.svg`||Va,alt:ce==null?void 0:ce.asset,className:"rounded-full w-5 h-5 min-w-5 min-h-5",loading:"lazy",onError:ur=>ra(ur)})}),i.jsx("div",{className:"text-white text-sm font-semibold font-manrope leading-[13px] tracking-tight",children:(()=>{const ur=un.find(Yr=>Yr.label===ce.asset);return ur?ur.value:ce.asset})()})]})})}),i.jsx("td",{scope:"row",className:"z-[2] pl-4 bg-[#1b1b1b] group-hover:bg-[#222222]",children:i.jsx("div",{className:"group-hover:bg-[#222222] flex justify-start items-center gap-2 h-8 max-h-8",children:i.jsxs("div",{className:`${(cr=ce.direction)!=null&&cr.includes("Long")?ce.direction==="Short > Long"?"text-[#67ffbd] bg-[#67ffbd]/20":ce.direction==="Long > Short"?"text-[#ff787b] bg-[#ff797c]/20":"text-[#67ffbd] bg-[#67ffbd]/20":ce.direction=="Buy"?"text-[#67ffbd] bg-[#67ffbd]/20":"text-[#ff787b] bg-[#ff797c]/20"} h-5 pl-1 pr-1.5 py-1 rounded-md justify-start items-center gap-0.5 inline-flex`,children:[i.jsx("div",{className:"w-3 h-3 justify-center items-center flex",children:i.jsx("div",{className:"w-3 h-3 relative",children:(Nr=ce.direction)!=null&&Nr.includes("Long")?ce.direction==="Short > Long"?i.jsx(Ps,{className:"text-[#67FFBD] rotate-180 w-3 h-3"}):ce.direction==="Long > Short"?i.jsx(Ps,{className:"text-[#FF797C] w-3 h-3"}):i.jsx(Ps,{className:"text-[#67FFBD] rotate-180 w-3 h-3"}):ce.direction=="Buy"?i.jsx(Ps,{className:"text-[#67FFBD] rotate-180 w-3 h-3"}):i.jsx(Ps,{className:"text-[#FF797C] w-3 h-3"})})}),i.jsx("div",{className:" text-[11px] font-semibold font-manrope leading-[8px] tracking-wide",children:ce.direction=="Sell"?"Sell":ce.direction=="Buy"?"Buy":ce.direction=="Close Short"?"Short":ce.direction=="Close Long"?"Long":ce.direction=="Open Short"?"Short":ce.direction=="Open Long"?"Long":ce.direction})]})})}),i.jsx("td",{scope:"row",className:"z-[2] pl-4 bg-[#1b1b1b] group-hover:bg-[#222222]",children:i.jsx("div",{className:"group-hover:bg-[#222222] flex justify-start items-center gap-2 h-8 max-h-8",children:i.jsx("div",{className:"text-white h-5 pl-1 pr-1.5 py-1 rounded-md justify-start items-center gap-0.5 inline-flex",children:i.jsx("div",{className:`${ce!=null&&ce.isLiquidation?"text-[#ff787b]":"text-white"} text-sm font-semibold font-manrope leading-[13px] tracking-[0.18px] min-w-max`,children:ce!=null&&ce.isLiquidation?`Market Liquidation: ${ce.direction=="Sell"?"Sell":ce.direction=="Buy"?"Buy":ce.direction=="Close Short"?"Close Short":ce.direction=="Close Long"?"Close Long":ce.direction=="Open Short"?"Close Short":ce.direction=="Open Long"?"Close Long":"Close "+ce.direction} `:ce.totalStartPositions==0?"Open Position":ce.direction!="Short > Long"&&ce.direction!="Long > Short"?(ce==null?void 0:ce.totalSize)-Math.abs(ce==null?void 0:ce.totalStartPositions)==0&&(ce.direction=="Close Long"||ce.direction=="Close Short")?"Position Closed":ce.direction=="Open Short"||ce.direction=="Open Long"?"Increase":ce.direction=="Close Long"||ce.direction=="Close Short"?"Decrease":ce.direction=="Sell"||ce.direction=="Buy"?"Spot":"Changed Position":ce.direction=="Short > Long"||ce.direction=="Long > Short"?"Changed Position":"Open Position"})})})}),i.jsx("td",{children:i.jsx("div",{className:"px-1 flex flex-col items-end gap-2 font-manrope",children:i.jsx("div",{className:"text-white text-sm font-semibold font-manrope leading-[13px] tracking-[0.18px]",children:ao(ce.totalSize)})})}),i.jsx("td",{children:i.jsx("div",{className:"px-1 flex flex-col items-end gap-2 font-manrope",children:i.jsx("div",{className:"text-white text-sm font-semibold font-manrope leading-[13px] tracking-[0.18px]",children:Pt?`$${Sv(Pt)}`:Sv(Pt)})})}),i.jsx("td",{children:i.jsx("div",{className:`${ce.pnl,""} px-1 flex justify-end gap-2 font-manrope min-w-max`,children:i.jsx("div",{className:`${ce.pnl>=0?"text-[#67ffbd]":"text-[#ff787b]"} text-sm font-semibold font-manrope leading-[13px] tracking-[0.18px]`,children:ce.pnl?`$${Sv(Math.abs(ce.pnl))}`:Sv(Math.abs(ce.pnl))})})}),i.jsx("td",{children:i.jsx("div",{className:"px-1 flex flex-col items-end gap-2 font-manrope",children:i.jsxs("div",{className:"text-white text-sm font-semibold font-manrope leading-[13px] tracking-[0.18px]",children:[(fr=ce==null?void 0:ce.fills)==null?void 0:fr.length," Fills"]})})}),i.jsx("td",{children:i.jsx("div",{onClick:()=>{sr(_r=="time"?"date":"time")},className:"px-1 flex flex-col items-end gap-2 font-manrope cursor-pointer",children:i.jsx("div",{className:"text-white text-sm font-normal font-manrope leading-[13px] tracking-[0.18px]",children:_r=="time"?i.jsx(rr,{date:ce.latestFill}):su(ce.latestFill)})})}),i.jsx("td",{className:"sm:rounded-r-2xl mr-3",children:i.jsx("div",{className:"pl-1 pr-8 flex flex-col items-end gap-2 font-manrope",children:i.jsx("div",{className:"text-[#979797] text-sm font-normal font-manrope leading-[13px] tracking-[0.18px]",children:ce==null?void 0:ce.oid})})})]},rt),i.jsx("tr",{children:i.jsx("td",{colSpan:"100",style:{height:"2px"}})})]},rt)})})]})})]}):N==="positions"?i.jsxs("div",{className:"relative w-full ",children:[i.jsxs("div",{className:"absolute -top-6 right-2 z-10 hidden lg:flex justify-start items-center gap-2",children:[i.jsx("button",{onClick:Ue,className:"bg-[#353535] hover:bg-gray-600 text-white p-1 rounded-lg focus:outline-none focus:ring-0 border-none",children:i.jsx("span",{className:"w-6 h-6",children:i.jsx(Bl,{className:"text-gray-300 w-4 h-4 rotate-90"})})}),i.jsx("button",{onClick:Rt,className:"bg-[#353535] hover:bg-gray-600 text-white p-1 rounded-lg focus:outline-none focus:ring-0 border-none",children:i.jsx("span",{className:"w-6 h-6",children:i.jsx(Bl,{className:"text-gray-300 w-4 h-4 -rotate-90"})})}),i.jsx("button",{onClick:at,className:"bg-[#353535] hover:bg-gray-600 text-white p-1 rounded-lg focus:outline-none focus:ring-0 border-none",children:i.jsx("span",{className:"w-6 h-6",children:i.jsx(Bl,{className:"text-gray-300 w-4 h-4 -rotate-180"})})}),i.jsx("button",{onClick:We,className:"bg-[#353535] hover:bg-gray-600 text-white p-1 rounded-lg focus:outline-none focus:ring-0 border-none",children:i.jsx("span",{className:"w-6 h-6",children:i.jsx(Bl,{className:"text-gray-300 w-4 h-4 "})})})]}),i.jsx("div",{ref:nt,className:"w-full overflow-scroll min-h-[60vh] max-h-[60vh] h-full flex-grow mt-1 mb-3 bg-[#161616] border-collapse rounded-lg pb-24",children:i.jsxs("table",{className:"w-full relative",children:[i.jsx("thead",{className:"sticky top-0 z-[3] bg-[#161616] whitespace-nowrap",children:i.jsxs("tr",{className:"w-full z-[4] font-semibold leading-[13px] tracking-[0.26px] text-[#9b9b9b] text-[13px] font-manrope mr-3",children:[i.jsx("th",{scope:"col",className:"sticky bg-[#161616] left-0 h-10 pl-2 sm:pl-6 min-w-[130px] sm:min-w-[145px] z-[8]",children:i.jsxs("div",{className:"flex justify-start items-center gap-2 relative",children:[i.jsx(hi,{title:"Coin",sortKey:"asset",sortOption:te,setSortOption:ue,isFilterIcon:!1}),i.jsxs("div",{className:"flex items-center justify-start",children:[i.jsx("button",{onClick:()=>Xn(!In),className:`${Me?"bg-gray-900":"bg-[#555555]"} inline-flex items-center p-1 rounded hover:bg-gray-700 focus:outline-none focus:ring-0 border-none`,children:i.jsx($f,{className:`w-4 h-4 ${Me?"text-blue-500":"text-white"}`})}),In&&i.jsxs("div",{ref:zn,className:`absolute left-[58px] mt-32 w-[208px]
bg-[#222] border border-gray-700 rounded shadow-lg p-2 z-10`,children:[i.jsxs("div",{className:"flex justify-between items-center px-2 pb-2 border-b border-gray-600",children:[i.jsx("span",{className:"text-white text-sm font-semibold",children:"Filter"}),i.jsx("div",{onClick:()=>en(""),className:"h-5 px-2 py-1.5 bg-[#3d3d3d] rounded-md justify-start items-center gap-2 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-[#cdcdcd] text-[11px] font-semibold font-manrope leading-[8px] pointer-events-none",children:"Clear All"})})]}),i.jsx("input",{type:"text",value:Me,onChange:ce=>en(ce.target.value),className:"bg-[#333] rounded text-white py-1 px-2 text-sm outline-none mt-2 placeholder:text-sm placeholder:font-semibold placeholder:font-manrope placeholder:text-[#7c7c7c]",placeholder:"Coin"})]})]})]})}),jr&&i.jsx(qY,{className:"min-w-[130px] sm:min-w-[130px] px-1",title:"Source Tag",sortKey:"source_tag",sortOption:te,setSortOption:ue}),i.jsx(qY,{className:"min-w-[100px] sm:min-w-[120px] px-1",title:"Type",sortKey:"type_leverage",sortOption:te,setSortOption:ue}),i.jsx(Md,{className:"min-w-[80px] sm:min-w-[80px] px-1",title:"Size",sortKey:"size",sortOption:te,setSortOption:ue}),i.jsx(Md,{className:"min-w-[130px] sm:min-w-[145px] px-1",title:"Position Value",sortKey:"positionValue",sortOption:te,setSortOption:ue}),i.jsx(Md,{className:"min-w-[120px] sm:min-w-[120px] px-1",title:"Entry Price",sortKey:"entryPrice",sortOption:te,setSortOption:ue}),i.jsx(Md,{className:"min-w-[120px] sm:min-w-[120px] px-1",title:"Mark Price",sortKey:"currentPrice",sortOption:te,setSortOption:ue}),i.jsx(Md,{className:"min-w-[100px] sm:min-w-[160px] px-1",title:"PnL(ROE%)",sortKey:"unrealizedPnl",sortOption:te,setSortOption:ue}),i.jsx(Md,{className:"min-w-[120px] sm:min-w-[120px] px-1",title:"Liq. Price",sortKey:"liquidationPrice",sortOption:te,setSortOption:ue}),i.jsx(Md,{className:"min-w-[120px] sm:min-w-[130px] px-1",title:"Margin",sortKey:"marginUsed",sortOption:te,setSortOption:ue}),i.jsx(Md,{className:"min-w-[110px] sm:min-w-[130px] px-1",title:"Funding",sortKey:"funding",sortOption:te,setSortOption:ue}),i.jsx(Md,{className:`${jr?"pr-0":"pr-8"} min-w-[185px] sm:min-w-[185px] pl-1`,title:"Entry Time",sortKey:"entryTime",sortOption:te,setSortOption:ue}),jr&&i.jsx("th",{scope:"col",className:"min-w-[130px] sm:min-w-[150px] pl-1 pr-5",children:i.jsx("div",{className:"flex items-center justify-end w-full gap-1 min-w-max",children:i.jsx("div",{className:"flex items-center justify-end group",children:i.jsxs("div",{onClick:ce=>{if(ce.preventDefault(),lt)return;const Pt=(t!=null&&t.length?t.map(vt=>vt.wallet_address.toLowerCase()):[e==null?void 0:e.toLowerCase()]).map(vt=>{var ln;return(ln=Rr.find(mn=>mn.wallet_address===vt))==null?void 0:ln.wallet_id}).filter(Boolean);gr(Pt)},className:"h-[26px] pl-1 pr-2 py-1.5 bg-[#67ffbd]/20 hover:bg-[#67ffbd]/30 rounded-md inline-flex justify-start items-center gap-2 cursor-pointer",children:[i.jsx("div",{className:"",children:i.jsx("img",{src:nae,alt:"",className:"w-4 h-4"})}),lt?i.jsxs("div",{role:"status",className:"flex justify-center items-center h-5 min-h-5 w-[66px] px-2 py-1.5 rounded-md",children:[i.jsxs("svg",{"aria-hidden":"true",className:"inline w-4 h-4 text-gray-200 animate-spin dark:text-gray-600 fill-[#67FFBD]",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),i.jsx("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]}),i.jsx("span",{className:"sr-only",children:"Loading..."})]}):i.jsx("div",{className:"justify-start text-[#67ffbd] text-[11px] font-semibold font-manrope leading-[8px] tracking-tight",children:"Fast Close All"})]})})})})]})}),i.jsx("tbody",{children:!s||s.length==0?i.jsx("tr",{className:"text-center w-full h-full",children:i.jsx("td",{colSpan:window.innerWidth>=640&&window.innerWidth<768?5:window.innerWidth>=768&&window.innerWidth<1024?6:window.innerWidth>=1024&&window.innerWidth<1240?8:window.innerWidth>=1240&&window.innerWidth<1540?10:window.innerWidth>=1540?12:4,className:"h-[36vh]",children:i.jsx("div",{className:"flex w-full justify-center items-center",children:i.jsx("div",{className:"flex min-h-[36vh] w-[100%] sm:w-[75%] max-w-[300px] sm:max-w-[700px] justify-center items-center text-center",children:u?i.jsx(Da,{}):i.jsxs("div",{className:"flex flex-col justify-center items-center gap-3",children:[i.jsx("img",{src:ac,alt:""}),i.jsxs("div",{className:"flex flex-col items-center h-max gap-3",children:[i.jsx("div",{className:"text-[#d3d3d3] text-sm font-semibold font-manrope leading-[8px] pt-3",children:"No open positions are currently available"}),i.jsxs("div",{className:"text-center -mt-2",children:[i.jsxs("span",{className:"text-[#979797] text-[13px] font-normal font-manrope leading-[14px] tracking-wide",children:["To discover a different wallet, you can use the"," "]}),i.jsx("span",{className:"text-white text-[13px] font-normal font-manrope leading-[14px] tracking-wide",children:"'Discover Wallets'"}),i.jsxs("span",{className:"text-[#979797] text-[13px] font-normal font-manrope leading-[14px] tracking-wide",children:[" ","tab above."]})]})]})]})})})})}):B==null?void 0:B.map((ce,rt)=>{var Pt,vt,ln,mn,cr;return i.jsxs(Ae.Fragment,{children:[i.jsxs("tr",{className:"relative group bg-[#1b1b1b] hover:bg-[#222222] h-[32px] max-h-[32px] text-white rounded-2xl",style:{margin:"2px"},children:[i.jsx("td",{scope:"row",className:"sticky left-0 z-[2] bg-[#1b1b1b] group-hover:bg-[#222222] sm:rounded-l-2xl",children:i.jsx("div",{onClick:()=>{window.open(`/terminal/${ce==null?void 0:ce.asset}`,"_blank")},className:"group-hover:bg-[#222222] flex justify-start items-center gap-2 pl-2 sm:pl-6 h-8 max-h-14 rounded-2xl cursor-pointer",children:i.jsxs("div",{className:"flex justify-start items-center gap-1.5",children:[i.jsx("div",{className:"w-5 h-5 rounded-full",children:i.jsx("img",{src:`https://app.hyperliquid.xyz/coins/${Gs[ce.asset]||((Pt=ce.asset)==null?void 0:Pt.split("/")[0])}.svg`||Va,alt:ce==null?void 0:ce.asset,className:"rounded-full w-5 h-5 min-w-5 min-h-5",loading:"lazy",onError:Nr=>ra(Nr)})}),i.jsx("div",{className:"text-white text-sm font-semibold font-manrope leading-[13px] tracking-[0.18px]",children:ce.asset})]})})}),jr&&i.jsx("td",{children:i.jsx("div",{onClick:Nr=>{Nr.preventDefault(),ce!=null&&ce.tagWallet&&(ce==null?void 0:ce.tagWallet)!=null&&window.open(`/wallet-details/${ce==null?void 0:ce.tagWallet}`,"_blank")},className:`${ce!=null&&ce.tagWallet&&(ce==null?void 0:ce.tagWallet)!=null?"cursor-pointer":""} pl-1 pr-2 flex flex-col items-start gap-2 font-manrope`,children:i.jsxs("div",{className:"text-white text-sm font-semibold font-manrope leading-[13px] tracking-[0.18px] has-tooltip relative",children:[(ce==null?void 0:ce.tagName)==null||(ce==null?void 0:ce.tagName)==""?"--":((vt=ce==null?void 0:ce.tagName)==null?void 0:vt.length)>10?((ln=ce==null?void 0:ce.tagName)==null?void 0:ln.slice(0,10))+"...":ce==null?void 0:ce.tagName,(ce==null?void 0:ce.tagName)&&(ce==null?void 0:ce.tagName.length)>10&&i.jsx("span",{children:i.jsx(Fa,{content:`${ce==null?void 0:ce.tagName}`,positionTop:!0,alignRight:!1})})]})})}),i.jsx("td",{scope:"row",className:"z-[2] bg-[#1b1b1b] group-hover:bg-[#222222]",children:i.jsx("div",{className:"group-hover:bg-[#222222] flex justify-start items-center gap-2 h-8 max-h-8",children:i.jsxs("div",{className:`${ce.type==="Long"?"text-[#67ffbd] bg-[#67ffbd]/20":"text-[#ff787b] bg-[#ff797c]/20"} h-5 pl-1 pr-1.5 py-1 rounded-md justify-start items-center gap-0.5 inline-flex`,children:[i.jsx("div",{className:"w-3 h-3 justify-center items-center flex",children:i.jsx("div",{className:"w-3 h-3 relative",children:ce.type==="Long"?i.jsx(Ps,{className:"text-[#67FFBD] rotate-180 w-3 h-3"}):i.jsx(Ps,{className:"text-[#FF797C] w-3 h-3"})})}),i.jsxs("div",{className:" text-[11px] font-semibold font-manrope leading-[8px] tracking-wide uppercase",children:[ce.type," - ",ce==null?void 0:ce.leverage,"x"]})]})})}),i.jsx("td",{children:i.jsx("div",{className:"pl-1 pr-2 flex flex-col items-end gap-2 font-manrope",children:i.jsx("div",{className:"text-white text-sm font-semibold font-manrope leading-[13px] tracking-tight",children:ao(Math.abs(ce.size))})})}),i.jsx("td",{children:i.jsx("div",{className:"pl-1 pr-2 flex flex-col items-end gap-2 font-manrope",children:i.jsx("div",{className:"text-white text-sm font-semibold font-manrope leading-[13px] tracking-[0.18px]",children:ce.positionValue?`$${ao(ce.positionValue)}`:ao(ce.positionValue)})})}),i.jsx("td",{children:i.jsx("div",{className:"pl-1 pr-2 flex flex-col items-end gap-2 font-manrope",children:i.jsx("div",{className:"text-white text-sm font-semibold font-manrope leading-[13px] tracking-[0.18px]",children:ce.entryPrice?`$${Er(ce.entryPrice)}`:Er(ce.entryPrice)})})}),i.jsx("td",{children:i.jsx("div",{className:"pl-1 pr-2 flex flex-col items-end gap-2 font-manrope",children:i.jsx("div",{className:"text-white text-sm font-semibold font-manrope leading-[13px] tracking-[0.18px]",children:ce.currentPrice?`$${Er(ce.currentPrice)}`:Er(ce.currentPrice)})})}),i.jsx("td",{children:i.jsxs("div",{onClick:()=>{fn(Nr=>({...Nr,coin:ce.asset,type:ce.type,leverage:ce.leverage,roe:ce.roe,entryPrice:ce.entryPrice,markPrice:ce.currentPrice,pnl:ce.unrealizedPnl,referral:window.localStorage.getItem("hyperToken")?fe:null})),$e(!0)},className:"pl-1 pr-2 flex justify-end gap-2 font-manrope cursor-pointer min-w-max",children:[i.jsxs("div",{className:`${ce.unrealizedPnl>=0?"text-[#67ffbd]":"text-[#ff787b]"} text-sm font-semibold font-manrope leading-[13px] tracking-[0.18px]`,children:[ce.unrealizedPnl?`$${ao(Math.abs(ce.unrealizedPnl))}`:ao(Math.abs(ce.unrealizedPnl)),` (${ao(Math.abs(ce==null?void 0:ce.roe))}%)`]}),i.jsx("div",{className:"flex justify-center items-center rounded",children:i.jsx("img",{src:gm,alt:"",className:"w-[14px] h-[14px] min-w-[14px] min-h-[14px]"})})]})}),i.jsx("td",{children:i.jsx("div",{className:"pl-1 pr-2 flex flex-col items-end gap-2 font-manrope",children:i.jsx("div",{className:"text-white text-sm font-semibold font-manrope leading-[13px] tracking-[0.18px]",children:ce.liquidationPrice!=null&&ce.liquidationPrice!==""&&!isNaN(ce.liquidationPrice)?`$${ao(ce.liquidationPrice)}`:ao(ce.liquidationPrice)})})}),i.jsx("td",{children:i.jsx("div",{className:"pl-1 pr-2 flex flex-col items-end gap-2 font-manrope",children:i.jsxs("div",{className:"text-white text-sm font-semibold font-manrope leading-[13px] tracking-[0.18px] min-w-max",children:[ce.marginUsed?`$${ao(ce.marginUsed)}`:ao(ce.marginUsed)," (",((mn=ce==null?void 0:ce.marginMode)==null?void 0:mn.charAt(0).toUpperCase())+((cr=ce==null?void 0:ce.marginMode)==null?void 0:cr.slice(1)),")"]})})}),i.jsx("td",{children:i.jsx("div",{className:"pl-1 pr-2 flex flex-col items-end gap-2 font-manrope",children:i.jsx("div",{className:`${ce.funding<=0?"text-[#67ffbd]":"text-[#ff787b]"} text-sm font-semibold font-manrope leading-[13px] tracking-[0.18px]`,children:ce.funding?`$${Sv(Math.abs(ce.funding))}`:Sv(Math.abs(ce.funding))})})}),i.jsx("td",{className:`${jr?"":"pr-8 sm:rounded-r-2xl"}`,children:i.jsx("div",{onClick:()=>{En(Pn=="time"?"date":"time")},className:"pl-1 flex flex-col items-end gap-2 font-manrope cursor-pointer",children:i.jsx("div",{className:"text-white text-sm font-normal font-manrope leading-[13px] tracking-[0.18px] min-w-max",children:ce!=null&&ce.latestFill?Pn=="time"?i.jsx(rr,{date:ce==null?void 0:ce.latestFill}):su(ce==null?void 0:ce.latestFill):i.jsx("span",{className:"text-[#979797]",children:"--"})})})}),jr&&i.jsx("td",{className:"pr-5 sm:rounded-r-2xl",children:i.jsx("div",{className:"pl-1 flex flex-col items-end gap-2 font-manrope",children:it[`${ce==null?void 0:ce.leverage}_${ce==null?void 0:ce.asset}_${ce==null?void 0:ce.size}`]?i.jsxs("div",{role:"status",className:"flex justify-center items-center h-5 min-h-5 w-[54px] px-2 py-1.5 rounded-md",children:[i.jsxs("svg",{"aria-hidden":"true",className:"inline w-4 h-4 text-gray-200 animate-spin dark:text-gray-600 fill-[#67FFBD]",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),i.jsx("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]}),i.jsx("span",{className:"sr-only",children:"Loading..."})]}):i.jsx("div",{onClick:()=>{const Nr=Rr.find(Yr=>{var ss;return Yr.wallet_address===((ss=ce.wallet||e)==null?void 0:ss.toLowerCase())}),fr=Nr==null?void 0:Nr.wallet_id,ur=Nr==null?void 0:Nr.wallet_address;fr&&ps(fr,ur,ce==null?void 0:ce.asset,ce==null?void 0:ce.leverage,ce==null?void 0:ce.size)},className:"h-5 px-2 py-1.5 rounded-md border border-white justify-start items-center gap-2 inline-flex",children:i.jsx("div",{className:"text-white text-[11px] font-semibold font-manrope leading-[8px] tracking-tight cursor-pointer",children:"Market"})})})})]}),i.jsx("tr",{children:i.jsx("td",{colSpan:"100",style:{height:"2px"}})})]},rt)})})]})})]}):N==="twap-history"&&jt.pathname.startsWith("/wallet-details")?i.jsx(Min,{data:ut,setData:qt,wallet:e,coinNameData:un}):N==="trade-history"?i.jsx(hin,{wallet:e,wallets:t}):N==="completed-trades"?i.jsx(Oin,{trades:ne,generatedWallets:Rr,wallet:e,wallets:t}):N==="deposit-withdraw"?i.jsx(gin,{wallet:e,wallets:t}):""]})},Md=({className:e,title:t,sortKey:n,sortOption:r,setSortOption:s})=>i.jsx("th",{scope:"col",className:e,children:i.jsx(hi,{title:t,sortKey:n,sortOption:r,setSortOption:s,isFilterIcon:!0})}),qY=({className:e,title:t,sortKey:n,sortOption:r,setSortOption:s})=>i.jsx("th",{scope:"col",className:e,children:i.jsx(hi,{title:t,sortKey:n,sortOption:r,setSortOption:s,isFilterIcon:!1})});function GY({walletAddress:e}){const[t,n]=m.useState(!1),[r,s]=m.useState(0),[a,o]=m.useState([]),[l,c]=m.useState({}),[u,d]=m.useState(null),[f,x]=m.useState(""),[g,v]=m.useState(""),w=()=>{fs.post("https://dextrabothypev2.nftinit.io/api/hyper/wallet/getwalletreportsdetail/",{wallet_address:e}).then(P=>{s(P.data.report_count||0);const I=P.data.report_detail.reduce((R,F)=>(R[F.report_type_id]=(R[F.report_type_id]||0)+1,R),{});c(I)})};m.useEffect(()=>{w()},[e]),m.useEffect(()=>{const P=I=>{I.key==="Escape"&&n(!1)};return t&&window.addEventListener("keydown",P),()=>{window.removeEventListener("keydown",P)}},[t]);const C=()=>{a.length||fs.get("https://dextrabothypev2.nftinit.io/api/hyper/wallet/getreporttypes/").then(P=>{var I;return o(((I=P.data)==null?void 0:I.data)||[])})},N=()=>{if(!u){v("Please select a report type");return}const P=localStorage.getItem("hyperAddress"),I=localStorage.getItem("hyperToken");fs.post("https://dextrabothypev2.nftinit.io/api/hyper/wallet/walletreport/",{address:P,token:I,reported_wallet_address:e,report_type_id:u,message:f}).then(()=>{n(!1),d(null),x(""),w()})};return i.jsxs(i.Fragment,{children:[i.jsxs("button",{onClick:()=>{n(!0),C()},className:"relative flex items-center gap-2 px-5 py-2 rounded-full bg-[#2d2d2d] hover:bg-[#3b3b3b] text-sm font-semibold text-white font-manrope",children:["Report",r>0&&i.jsx("span",{className:"bg-red-600 text-white text-xs font-bold rounded-full px-1 font-manrope w-5 h-5 flex justify-center items-center",children:r})]}),t&&i.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 p-4",onClick:()=>n(!1),children:i.jsxs("div",{className:"w-full max-w-md rounded-2xl bg-[#1b1b1b] p-6 text-white shadow-lg relative border border-[#3B3B3B]",onClick:P=>P.stopPropagation(),children:[i.jsx("div",{className:"absolute top-4 right-4 w-7 h-7 rounded-[8px] bg-[#3D3D3D] flex items-center justify-center text-sm cursor-pointer hover:bg-[#565656]",onClick:()=>n(!1),children:i.jsx(HIe,{className:"text-[#CECECE] mt-[1px]"})}),i.jsx("h2",{className:"text-lg font-bold mb-1 font-manrope",children:"Report Trader"}),i.jsx("p",{className:"text-xs mb-6 text-[#a1a1a1] font-manrope",children:"You can report this wallet to help determine if it is Delta Neutral or Bot."}),i.jsx("div",{className:"flex justify-center w-full gap-4 mb-6",children:a.map(P=>i.jsxs("button",{onClick:()=>{d(P.id),v("")},className:`flex items-center gap-2 px-3 py-3 rounded-full text-[13px] font-semibold transition-all hover:bg-white hover:text-[#161616] ${u===P.id?"bg-white text-[#161616]":"bg-[#1f1f1f] border border-[#353535]"}`,children:[P.name,i.jsx("span",{className:"bg-[#FFC940] text-[#30260E] text-13px font-bold rounded-[6px] px-2",children:l[P.id]||0})]},P.id))}),i.jsx("label",{className:"block text-xs mb-1",children:"Comment (Optional)"}),i.jsx("textarea",{value:f,onChange:P=>x(P.target.value),placeholder:"Describe the behavior or issue you're reporting...",className:"w-full h-24 rounded-lg bg-[#111] border border-[#2d2d2d] p-3 text-sm outline-none placeholder-[#555] resize-none mb-6"}),g&&i.jsx("p",{className:"text-red-500 text-xs font-semibold mb-4 text-center",children:g}),i.jsx("div",{className:"w-full flex justify-center",children:i.jsx("button",{onClick:N,className:"flex bg-[#1f1f1f] w-[128px] h-[32px] px-[16px] py-[12px] justify-center items-center gap-[10px] shrink-0 rounded-[12px] border border-[#353535] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] text-white font-inter text-[13px] font-medium leading-[8px] tracking-[-0.26px] hover:bg-white hover:text-[#161616]",disabled:!localStorage.getItem("hyperAddress"),children:"Report"})})]})})]})}const ECe="https://api-ui.hyperliquid.xyz/info",Lin="wss://api.hyperliquid.xyz/ws",Din=({initialAddress:e=""})=>{var Es,xr,Gt;const[t,n]=m.useState(e),[r,s]=m.useState([]),[a,o]=m.useState([]),[l,c]=m.useState(!1),[u,d]=m.useState(1),[f,x]=m.useState(null),[g,v]=m.useState(!1),w=m.useRef(null),C=Vo(),N=m.useRef(e),P=m.useRef(null),I=m.useRef(null),R=m.useRef(null),[F,U]=m.useState({}),[L,z]=m.useState(!1),[Q,ne]=m.useState(""),[J,X]=m.useState(null),{trackedWatchList:re,getTrackedWatchList:pe,hyperToken:Y,copyTradeWatchList:ie,getCopyTradeWatchList:oe,setTelegramChatId:G,setSubscriberRole:V,setSubsExpireDay:ee,setMushboomerETH:ae,setMushboomerSOL:fe,setIsReferralCode:Ne,isReferralCodeName:he,setIsReferralCodeName:ge,setIsWhitelist:ye,setHyperToken:ve,setHyperAddress:je,setSignModalOpen:Ie,latestPnL:Le}=m.useContext(Qr),{isConnected:Qe,address:$e}=ns(),[it,tt]=m.useState(!1),[lt,ft]=m.useState(!1),[ut,qt]=m.useState(null),[It,nn]=m.useState(null),[jt,cn]=m.useState(""),[un,Ft]=m.useState(!1),[Ke,Bt]=m.useState(localStorage.getItem("discover_period")==0?"day":localStorage.getItem("discover_period")==1?"week":localStorage.getItem("discover_period")==2?"month":localStorage.getItem("discover_period")==3?"threeMonth":null),$t=Ke||Le.activeRange;m.useEffect(()=>{Bt(null)},[Le.activeRange]);const qe=[{label:"@10",value:"GMEOW"},{label:"@112",value:"MEOW"},{label:"@115",value:"HOLD"},{label:"@117",value:"BERA"},{label:"@12",value:"XULIAN"},{label:"@123",value:"FARM"},{label:"@131",value:"ORA"},{label:"@132",value:"LIQD"},{label:"@134",value:"STAR"},{label:"@135",value:"SENT"},{label:"@136",value:"SOLV"},{label:"@16",value:"CZ"},{label:"@18",value:"ANSEM"},{label:"@21",value:"KOBE"},{label:"@22",value:"HAPPY"},{label:"@25",value:"BIGBEN"},{label:"@3",value:"MANLET"},{label:"@30",value:"FARMED"},{label:"@31",value:"GPT"},{label:"@32",value:"PURRPS"},{label:"@33",value:"BID"},{label:"@34",value:"HODL"},{label:"@1",value:"HFUN"},{label:"@100",value:"UP"},{label:"@101",value:"NIGGO"},{label:"@102",value:"HOP"},{label:"@103",value:"LUCKY"},{label:"@104",value:"COPE"},{label:"@105",value:"HPYH"},{label:"@106",value:"YAP"},{label:"@107",value:"HYPE"},{label:"@108",value:"CHEF"},{label:"@109",value:"WOW"},{label:"@11",value:"PEPE"},{label:"@110",value:"STEEL"},{label:"@111",value:"RETARD"},{label:"@113",value:"NEIRO"},{label:"@114",value:"PEAR"},{label:"@116",value:"MUNCH"},{label:"@118",value:"GENESY"},{label:"@119",value:"BUBZ"},{label:"@120",value:"PICKL"},{label:"@121",value:"SHEEP"},{label:"@122",value:"LAUNCH"},{label:"@124",value:"FLASK"},{label:"@125",value:"VAULT"},{label:"@126",value:"CAT"},{label:"@127",value:"HYENA"},{label:"@128",value:"DEPIN"},{label:"@129",value:"MON"},{label:"@13",value:"RUG"},{label:"@130",value:"BEATS"},{label:"@133",value:"H"},{label:"@137",value:"FLY"},{label:"@138",value:"TIME"},{label:"@139",value:"SOVRN"},{label:"@14",value:"ILIENS"},{label:"@15",value:"FUCKY"},{label:"@17",value:"BAGS"},{label:"@19",value:"TATE"},{label:"@2",value:"LICK"},{label:"@20",value:"PUMP"},{label:"@23",value:"SCHIZO"},{label:"@24",value:"SELL"},{label:"@26",value:"CATNIP"},{label:"@27",value:"HBOOST"},{label:"@28",value:"SUCKY"},{label:"@29",value:"GUP"},{label:"@35",value:"VEGAS"},{label:"@37",value:"VAPOR"},{label:"@38",value:"PANDA"},{label:"@39",value:"PILL"},{label:"@40",value:"ADHD"},{label:"@41",value:"FUN"},{label:"@42",value:"LADY"},{label:"@46",value:"DROP"},{label:"@47",value:"MBAPPE"},{label:"@48",value:"TEST"},{label:"@49",value:"RAGE"},{label:"@5",value:"SIX"},{label:"@50",value:"FRAC"},{label:"@51",value:"ATEHUN"},{label:"@52",value:"COZY"},{label:"@53",value:"ARI"},{label:"@54",value:"WASH"},{label:"@55",value:"ANT"},{label:"@59",value:"CATBAL"},{label:"@60",value:"TJIF"},{label:"@61",value:"GUESS"},{label:"@62",value:"MAXI"},{label:"@63",value:"NMTD"},{label:"@66",value:"RISE"},{label:"@67",value:"CINDY"},{label:"@70",value:"FRIED"},{label:"@73",value:"RANK"},{label:"@74",value:"OMNIX"},{label:"@75",value:"RIP"},{label:"@76",value:"G"},{label:"@77",value:"BOZO"},{label:"@78",value:"SPH"},{label:"@82",value:"BUSSY"},{label:"@83",value:"FATCAT"},{label:"@84",value:"SHREK"},{label:"@85",value:"PIP"},{label:"@86",value:"LQNA"},{label:"@87",value:"NASDAQ"},{label:"@88",value:"YEETI"},{label:"@9",value:"TRUMP"},{label:"@90",value:"FEIT"},{label:"@92",value:"VIZN"},{label:"@93",value:"STRICT"},{label:"@94",value:"AUTIST"},{label:"@96",value:"HGOD"},{label:"@97",value:"LIQUID"},{label:"@36",value:"ASI"},{label:"@4",value:"JEFF"},{label:"@43",value:"MOG"},{label:"@44",value:"HPEPE"},{label:"@45",value:"JEET"},{label:"@57",value:"RICH"},{label:"@58",value:"LORA"},{label:"@6",value:"WAGMI"},{label:"@65",value:"PIGEON"},{label:"@64",value:"HPUMP"},{label:"@69",value:"STACK"},{label:"@7",value:"CAPPY"},{label:"@72",value:"NOCEX"},{label:"@79",value:"SHOE"},{label:"@80",value:"MONAD"},{label:"@81",value:"HOPE"},{label:"@89",value:"SYLVI"},{label:"@91",value:"FRUDO"},{label:"@95",value:"MAGA"},{label:"@99",value:"EARTH"},{label:"@56",value:"NFT"},{label:"@8",value:"POINTS"},{label:"@68",value:"CHINA"},{label:"@141",value:"GOD"}];function Ye(ce,rt){const Pt=rt.map(({fill:vt,twapId:ln})=>({...vt,twapId:ln}));return[...ce,...Pt]}m.useEffect(()=>{e&&(async()=>{const ce=await Rce(e),rt=await Lce(e),Pt=Ye(ce,rt),{closed_positions:vt}=Dce(Pt);X(vt)})()},[e]),m.useEffect(()=>(e&&(N.current=e,zt(e),We(e)),()=>{w.current&&(w.current.close(),w.current=null),P.current&&(clearTimeout(P.current),P.current=null),I.current&&(clearInterval(I.current),I.current=null),R.current&&(clearInterval(R.current),R.current=null)}),[e]),m.useEffect(()=>{const ce=localStorage.getItem("favoriteAddresses");ce&&U(JSON.parse(ce))},[]),m.useCallback(()=>{if(F[t]){const ce={...F};delete ce[t],U(ce),localStorage.setItem("favoriteAddresses",JSON.stringify(ce))}else z(!0),ne("")},[t,F]),m.useCallback(()=>{if(!Q.trim())return;const ce={...F,[t]:{name:Q,address:t}};U(ce),localStorage.setItem("favoriteAddresses",JSON.stringify(ce)),z(!1)},[Q,t,F]),m.useCallback(ce=>{ce&&(n(ce),zt(ce),C(`/wallet-details/${ce}`))},[]);const ht=ce=>{var rt;((rt=w.current)==null?void 0:rt.readyState)===WebSocket.OPEN&&N.current===ce||(I.current&&(clearInterval(I.current),I.current=null),P.current&&(clearTimeout(P.current),P.current=null),w.current&&(w.current.close(),w.current=null),N.current=ce,w.current=new WebSocket(Lin),w.current.onopen=()=>{console.log("WebSocket Connected"),v(!0),[{method:"subscribe",subscription:{aggregateByTime:!0,type:"userFills",user:ce}},{method:"subscribe",subscription:{type:"user",user:ce}}].forEach(vt=>{w.current.send(JSON.stringify(vt))}),I.current=setInterval(()=>{var vt;if(((vt=w.current)==null?void 0:vt.readyState)===WebSocket.OPEN){const ln={id:99,method:"ping"};w.current.send(JSON.stringify(ln))}},3e4)},w.current.onclose=Pt=>{v(!1),I.current&&(clearInterval(I.current),I.current=null),Pt.code!==1e3&&(P.current||(P.current=setTimeout(()=>{P.current=null,N.current===ce&&ht(ce)},5e3)))},w.current.onerror=Pt=>{console.error("WebSocket Error:",Pt),v(!1)},w.current.onmessage=Pt=>{var vt,ln,mn;try{const cr=JSON.parse(Pt.data);if(cr.method==="pong"||cr.result==="success")return;if(cr.channel==="userFills"&&((vt=cr.data)!=null&&vt.fills)&&N.current.toLowerCase()===cr.data.user.toLowerCase()&&(s(Nr=>{const fr=Nr.flatMap(Ir=>Ir.fills),ur=new Map;fr.forEach(Ir=>{ur.set(Ir.hash,!0)});const Yr=cr.data.fills.filter(Ir=>!ur.has(Ir.hash));if(Yr.length===0)return Nr;const ss=[...Yr,...fr];return Et(ss)}),R.current||We(N.current)),cr.channel==="user"&&((ln=cr.data)!=null&&ln.fills&&s(Nr=>{const fr=Nr.flatMap(Ir=>Ir.fills),ur=new Map;fr.forEach(Ir=>{ur.set(Ir.hash,!0)});const Yr=cr.data.fills.filter(Ir=>!ur.has(Ir.hash));if(Yr.length===0)return Nr;const ss=[...Yr,...fr];return Et(ss)}),(mn=cr.data)!=null&&mn.state)){x(cr.data.state);const Nr=Rt(cr.data.state);o(Nr)}}catch(cr){console.error("Error processing WebSocket message:",cr),console.error("Raw message that caused error:",Pt.data)}})},Zt=async ce=>{try{tt(!0);const rt=await fs.post(ECe,{type:"clearinghouseState",user:ce});if(rt.data){x(rt.data);const Pt=Rt(rt.data);o(Pt),tt(!1),Pt.length>0&&!R.current?We(ce):Pt.length===0&&R.current&&(clearInterval(R.current),R.current=null)}}catch(rt){console.error("Error fetching user state:",rt),tt(!1)}},zt=async ce=>{if(!ce){rn.error("Please enter a wallet address");return}if(!ce.match(/^0x[a-fA-F0-9]{40}$/)){rn.error("Please enter a valid Ethereum address");return}c(!0);try{ce!==e&&C(`/wallet-details/${ce}`),ht(ce);const[rt]=await Promise.all([fs.post(ECe,{aggregateByTime:!0,type:"userFills",user:ce}),Zt(ce)]);if(rt.data&&Array.isArray(rt.data)){const Pt=Et(rt.data);s(Pt),d(1)}else console.error("Invalid response format:",rt.data)}catch(rt){console.error("Error fetching data:",rt)}finally{c(!1)}},Et=ce=>{const rt=[...ce].sort((vt,ln)=>ln.time-vt.time),Pt=new Map;return rt.forEach(vt=>{var mn;const ln=vt.oid;if(!Pt.has(ln)){const cr=rt.filter(mr=>mr.oid===vt.oid),Nr=cr.reduce((mr,Qn)=>mr+parseFloat(Qn.sz),0),fr=cr.map(mr=>parseFloat(mr.startPosition));let ur;fr.includes(0)?ur=0:fr.every(mr=>mr>0)?ur=Math.max(...fr):fr.every(mr=>mr<0)?ur=Math.min(...fr):ur=cr.reduce((mr,Qn)=>mr+parseFloat(Qn.startPosition),0);const Yr=cr.reduce((mr,Qn)=>mr+parseFloat(Qn.sz)*parseFloat(Qn.px),0),ss=cr.reduce((mr,Qn)=>mr+parseFloat(Qn.closedPnl||0),0),Ir=((mn=cr.find(mr=>mr.dir==="Long > Short"||mr.dir==="Short > Long"))==null?void 0:mn.dir)||"";Pt.set(ln,{oid:vt.oid,asset:vt.coin,direction:Ir==""?vt.dir:Ir,fills:cr,totalSize:Nr,totalStartPositions:ur,totalValue:Yr,pnl:ss,latestFill:vt.time})}}),Array.from(Pt.values()).sort((vt,ln)=>ln.latestFill-vt.latestFill)},nt=ce=>{const rt=new Date(ce),Pt=rt.toLocaleString("en-US",{month:"short"}),vt=rt.getDate(),ln=rt.getFullYear(),mn=rt.getHours().toString().padStart(2,"0"),cr=rt.getMinutes().toString().padStart(2,"0"),Nr=rt.getHours()>=12?" PM":" AM";return`${Pt} ${vt}, ${ln}, ${mn}:${cr} ${Nr}`},Ue=r,Rt=ce=>{if(!(ce!=null&&ce.assetPositions))return[];const rt=new Map;return r.forEach(Pt=>{Pt.fills.forEach(vt=>{let ln="";vt.dir.includes("Open")?ln=vt.dir.includes("Long")?"Long":"Short":vt.side==="B"?ln="Long":vt.side==="S"&&(ln="Short");const mn=`${vt.coin}-${ln}`;(!rt.has(mn)||vt.time<rt.get(mn))&&rt.set(mn,vt.time)})}),ce.assetPositions.filter(Pt=>{if(!Pt.position||!Pt.position.szi)return!1;const vt=parseFloat(Pt.position.szi);return!isNaN(vt)&&vt!==0}).map(Pt=>{const vt=Pt.position,ln=parseFloat(vt.szi),mn=parseFloat(vt.entryPx),cr=parseFloat(vt.positionValue),Nr=parseFloat(vt.unrealizedPnl),fr=parseFloat(vt.returnOnEquity)*100,ur=parseFloat(vt.marginUsed),Yr=vt.leverage.value,ss=vt.leverage.type,Ir=parseFloat(vt.cumFunding.sinceOpen),mr=ln>0?"Long":"Short",Qn=rt.get(`${vt.coin}-${mr}`);return{asset:vt.coin,type:mr,size:ln,entryPrice:mn.toFixed(4),currentPrice:(cr/Math.abs(ln)).toFixed(4),leverage:Yr,marginMode:ss,positionValue:cr.toFixed(2),marginUsed:ur.toFixed(2),unrealizedPnl:Nr.toFixed(2),roe:fr.toFixed(2),funding:Ir.toFixed(4),startTime:Qn?nt(Qn):"N/A",liquidationPrice:vt.liquidationPx?parseFloat(vt.liquidationPx).toFixed(2):"N/A"}})},We=ce=>{R.current&&(clearInterval(R.current),R.current=null),R.current=setInterval(()=>{Zt(ce)},7e3)},at=ce=>ce>=1e6?`${(ce/1e6).toFixed(2)}M`:ce>=1e3?`${(ce/1e3).toFixed(2)}K`:ce.toFixed(2);m.useEffect(()=>{window.localStorage.getItem("hyperToken")&&(pe(),oe())},[]);const mt=m.useRef(null),Dt=()=>{mt.current&&(mt.current.scrollLeft-=200)},Tt=()=>{mt.current&&(mt.current.scrollLeft+=200)};m.useEffect(()=>{(async()=>{var vt,ln;const rt=window.localStorage.getItem("hyperToken"),Pt=window.localStorage.getItem("hyperAddress");if(!(!rt||!Pt))try{const mn=await Ei(Pt.toLowerCase(),rt);mn!=null&&mn.success?(G(mn==null?void 0:mn.telegram_chat_id),V(mn==null?void 0:mn.subscriber_role),ee(mn==null?void 0:mn.subs_expire_day),ae((vt=mn==null?void 0:mn.mushboomer_counts)==null?void 0:vt.eth),fe((ln=mn==null?void 0:mn.mushboomer_counts)==null?void 0:ln.sol),Ne(mn==null?void 0:mn.referral_code),ge(mn==null?void 0:mn.refcode),ye(mn==null?void 0:mn.whitelist)):(window.localStorage.removeItem("hyperToken"),window.localStorage.removeItem("hyperAddress"),ve(""),je(""))}catch(mn){console.error("Token verification error:",mn),console.error(mn.message||"An unknown error occurred.")}})()},[]);const dn=async({walletAddress:ce,isFollow:rt,isScalper:Pt})=>{try{cn(ce);const vt=window.localStorage.getItem("hyperToken"),ln=window.localStorage.getItem("hyperAddress");if(!vt){Ie(!0);return}const mn=rt?"https://dextrabothypev2.nftinit.io/api/test_app/following/info/":"https://dextrabothypev2.nftinit.io/api/hyper/following/get_setting/",cr=rt?{address:$e?$e.toLowerCase():ln,token:vt,follow_address:ce.toLowerCase()}:{address:$e?$e.toLowerCase():ln,token:vt},Nr=await fetch(mn,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(cr)});if(!Nr.ok)throw new Error(`Server responded with status ${Nr.status}`);const fr=await Nr.json();fr.success?(qt(Array.isArray(fr==null?void 0:fr.data)?[...fr.data].sort((ur,Yr)=>new Date(Yr.created_at||0)-new Date(ur.created_at||0)):fr==null?void 0:fr.data),nn(Pt),ft(!0)):(console.log(fr.error_message),rn.error(fr.error_message))}catch(vt){console.error("Error in like function:",vt),rn.error(vt.message||"Something went wrong!")}},on="-latestFill",[gn,Nn]=m.useState(on),[kn,yn]=m.useState([]),[Vn,Gn]=m.useState(""),[Dn,Kn]=m.useState(""),[Cn,sn]=m.useState(""),[Me,en]=m.useState(!1),[an,Nt]=m.useState(!1),[Yn,xn]=m.useState(!1),[Mt,tn]=m.useState(!1),In=m.useRef(null),Xn=m.useRef(null),or=m.useRef(null),lr=m.useRef(null);m.useEffect(()=>{function ce(rt){In.current&&!In.current.contains(rt.target)&&en(!1),Xn.current&&!Xn.current.contains(rt.target)&&Nt(!1),or.current&&!or.current.contains(rt.target)&&xn(!1),lr.current&&!lr.current.contains(rt.target)&&tn(!1)}return document.addEventListener("mousedown",ce),()=>document.removeEventListener("mousedown",ce)},[]);const Qt=Ue.map(ce=>{let rt=ce.totalStartPositions==0?"Open Position":ce.direction!="Short > Long"&&ce.direction!="Long > Short"?(ce==null?void 0:ce.totalSize)-Math.abs(ce==null?void 0:ce.totalStartPositions)==0&&(ce.direction=="Close Long"||ce.direction=="Close Short")?"Position Closed":ce.direction=="Open Short"||ce.direction=="Open Long"?"Increase":ce.direction=="Close Long"||ce.direction=="Close Short"?"Decrease":ce.direction=="Sell"||ce.direction=="Buy"?"Spot":"Changed Position":ce.direction=="Short > Long"||ce.direction=="Long > Short"?"Changed Position":"Open Position";return{...ce,computedType:rt}}),zn=ce=>{const rt=qe.find(Pt=>Pt.label===ce);return rt?rt.value.toUpperCase():ce==null?void 0:ce.toUpperCase()},Jn=Qt.filter(ce=>kn.length?kn.includes(ce.computedType):!0).filter(ce=>{var rt,Pt;return Vn?(Pt=(rt=ce==null?void 0:ce.oid)==null?void 0:rt.toString())==null?void 0:Pt.includes(Vn):!0}).filter(ce=>Dn?zn(ce.asset).includes(Dn.toUpperCase()):!0),jn=(ce=>Jn==null?void 0:Jn.sort((rt,Pt)=>{var ss,Ir,mr,Qn;const vt=rt.totalSize?rt.totalValue/rt.totalSize:0,ln=Pt.totalSize?Pt.totalValue/Pt.totalSize:0,mn=xs=>{const Xs=qe.find(ii=>ii.label===xs);return Xs?Xs.value.toUpperCase():xs==null?void 0:xs.toUpperCase()},cr=mn(rt.asset),Nr=mn(Pt.asset),fr=xs=>{if(!xs)return"";const Xs=xs.toLowerCase();return Xs.includes("short")?"Short":Xs.includes("long")?"Long":Xs==="buy"?"Buy":Xs==="sell"?"Sell":xs},ur=fr(rt.direction),Yr=fr(Pt.direction);if(ce==="-totalSize")return Pt.totalSize-rt.totalSize;if(ce==="totalSize")return rt.totalSize-Pt.totalSize;if(ce==="-pnl")return Pt.pnl-rt.pnl;if(ce==="pnl")return rt.pnl-Pt.pnl;if(ce==="-fills")return(((ss=Pt.fills)==null?void 0:ss.length)||0)-(((Ir=rt.fills)==null?void 0:Ir.length)||0);if(ce==="fills")return(((mr=rt.fills)==null?void 0:mr.length)||0)-(((Qn=Pt.fills)==null?void 0:Qn.length)||0);if(ce==="-latestFill")return new Date(Pt.latestFill)-new Date(rt.latestFill);if(ce==="latestFill")return new Date(rt.latestFill)-new Date(Pt.latestFill);if(ce==="-avgPrice")return ln-vt;if(ce==="avgPrice")return vt-ln;if(ce==="-oid")return Pt.oid-rt.oid;if(ce==="oid")return rt.oid-Pt.oid;if(ce==="direction"){const xs={Short:1,Sell:2,Long:3,Buy:4};return(xs[ur]||99)-(xs[Yr]||99)}else if(ce==="-direction"){const xs={Long:1,Buy:2,Short:3,Sell:4};return(xs[ur]||99)-(xs[Yr]||99)}else{if(ce==="-coin")return cr<Nr?-1:cr>Nr?1:0;if(ce==="coin")return cr>Nr?-1:cr<Nr?1:0}return 0}))(gn).filter(ce=>(ce.totalStartPositions==0?"Open Position":ce.direction!="Short > Long"&&ce.direction!="Long > Short"?(ce==null?void 0:ce.totalSize)-Math.abs(ce==null?void 0:ce.totalStartPositions)==0&&(ce.direction=="Close Long"||ce.direction=="Close Short")?"Position Closed":ce.direction=="Open Short"||ce.direction=="Open Long"?"Increase":ce.direction=="Close Long"||ce.direction=="Close Short"?"Decrease":ce.direction=="Sell"||ce.direction=="Buy"?"Spot":"Changed Position":ce.direction=="Short > Long"||ce.direction=="Long > Short"?"Changed Position":"Open Position")==="Open Position"),Ee={};jn.forEach(ce=>{var vt;const rt=ce==null?void 0:ce.asset,Pt=new Date(ce==null?void 0:ce.latestFill).getTime();if(!Ee[rt])Ee[rt]=ce;else{const ln=new Date((vt=Ee[rt])==null?void 0:vt.latestFill).getTime();Pt>ln&&(Ee[rt]=ce)}});const h=Object.values(Ee),[p,S]=m.useState([]),_=a==null?void 0:a.filter(ce=>{var rt;return Cn?(rt=ce.asset)==null?void 0:rt.toLowerCase().includes(Cn.toLowerCase()):!0}).map(ce=>{const rt=h.find(vt=>(vt==null?void 0:vt.asset)===(ce==null?void 0:ce.asset)),Pt=p.find(vt=>(vt==null?void 0:vt.coin)===(ce==null?void 0:ce.asset));return{...ce,latestFill:(rt==null?void 0:rt.latestFill)||null,tagName:(Pt==null?void 0:Pt.tag)||null,tagWallet:(Pt==null?void 0:Pt.cp_wallet)||null}}),k="-unrealizedPnl",[T,B]=m.useState(k),q=ce=>_==null?void 0:_.sort((rt,Pt)=>{const vt=rt.tagName?rt.tagName.toUpperCase():"",ln=Pt.tagName?Pt.tagName.toUpperCase():"",mn=rt.asset?rt.asset.toUpperCase():"",cr=Pt.asset?Pt.asset.toUpperCase():"",Nr=rt.type==="Long"?1:0,fr=Pt.type==="Long"?1:0,ur=rt.type==="Short"?1:0,Yr=Pt.type==="Short"?1:0;return ce==="-unrealizedPnl"?Pt.unrealizedPnl-rt.unrealizedPnl:ce==="unrealizedPnl"?rt.unrealizedPnl-Pt.unrealizedPnl:ce==="-roe"?Pt.roe-rt.roe:ce==="roe"?rt.roe-Pt.roe:ce==="-size"?Pt.size-rt.size:ce==="size"?rt.size-Pt.size:ce==="-entryPrice"?Pt.entryPrice-rt.entryPrice:ce==="entryPrice"?rt.entryPrice-Pt.entryPrice:ce==="-currentPrice"?Pt.currentPrice-rt.currentPrice:ce==="currentPrice"?rt.currentPrice-Pt.currentPrice:ce==="-leverage"?Pt.leverage-rt.leverage:ce==="leverage"?rt.leverage-Pt.leverage:ce==="-positionValue"?Pt.positionValue-rt.positionValue:ce==="positionValue"?rt.positionValue-Pt.positionValue:ce==="-marginUsed"?Pt.marginUsed-rt.marginUsed:ce==="marginUsed"?rt.marginUsed-Pt.marginUsed:ce==="funding"?Pt.funding-rt.funding:ce==="-funding"?rt.funding-Pt.funding:ce==="-liquidationPrice"?Pt.liquidationPrice-rt.liquidationPrice:ce==="liquidationPrice"?rt.liquidationPrice-Pt.liquidationPrice:ce==="-entryTime"?new Date(Pt.latestFill)-new Date(rt.latestFill):ce==="entryTime"?new Date(rt.latestFill)-new Date(Pt.latestFill):ce==="-source_tag"?vt<ln?-1:vt>ln?1:0:ce==="source_tag"?vt>ln?-1:vt<ln?1:0:ce==="-type_leverage"?Nr!==fr?fr-Nr:Pt.leverage-rt.leverage:ce==="type_leverage"?ur!==Yr?Yr-ur:Pt.leverage-rt.leverage:ce==="-asset"?mn<cr?-1:mn>cr?1:0:ce==="asset"?mn>cr?-1:mn<cr?1:0:0}),[te,ue]=m.useState([]),[de,xe]=m.useState([]),[Se,ke]=m.useState([]),[Re,Ge]=m.useState([]),[Fe,st]=m.useState([]);async function se(){try{const ce=await fetch(`https://dextradata.nftinit.io/api/hyper/get_wallets_profit_new/?period=1&order=-perp_pnl&offset=0&limit=50&user_token=${e}`);if(!ce.ok)throw new Error(`HTTP error! status: ${ce.status}`);const rt=await ce.json();ue(rt.results)}catch(ce){console.error("Error resetting filters:",ce)}}async function Ce(){try{const ce=await fetch(`https://dextradata.nftinit.io/api/hyper/get_wallets_profit_new/?period=7&order=-perp_pnl&offset=0&limit=50&user_token=${e}`);if(!ce.ok)throw new Error(`HTTP error! status: ${ce.status}`);const rt=await ce.json();xe(rt.results)}catch(ce){console.error("Error resetting filters:",ce)}}async function Be(){try{const ce=await fetch(`https://dextradata.nftinit.io/api/hyper/get_wallets_profit_new/?period=30&order=-perp_pnl&offset=0&limit=50&user_token=${e}`);if(!ce.ok)throw new Error(`HTTP error! status: ${ce.status}`);const rt=await ce.json();ke(rt.results)}catch(ce){console.error("Error resetting filters:",ce)}}async function De(){try{const ce=await fetch(`https://dextradata.nftinit.io/api/hyper/get_wallets_profit_new/?period=90&order=-perp_pnl&offset=0&limit=50&user_token=${e}`);if(!ce.ok)throw new Error(`HTTP error! status: ${ce.status}`);const rt=await ce.json();Ge(rt.results)}catch(ce){console.error("Error resetting filters:",ce)}}async function _e(){try{const ce=await fetch(`https://dextradata.nftinit.io/api/hyper/wallet/details/?user_token=${e}`);if(!ce.ok)throw new Error(`HTTP error! status: ${ce.status}`);const rt=await ce.json();st(rt)}catch(ce){console.error("Error pnlSharpeRateData:",ce)}}m.useEffect(()=>{se(),Ce(),Be(),De(),_e()},[]);const[Je,ct]=m.useState(localStorage.getItem("discover_period")==0?"1D":localStorage.getItem("discover_period")==1?"7D":localStorage.getItem("discover_period")==2?"30D":localStorage.getItem("discover_period")==3||localStorage.getItem("discover_period")==4?"90D":"7D"),[gt,Xt]=m.useState(localStorage.getItem("discover_period")==0?"1D":localStorage.getItem("discover_period")==1?"7D":localStorage.getItem("discover_period")==2?"30D":localStorage.getItem("discover_period")==3||localStorage.getItem("discover_period")==4?"90D":"7D"),[wt,Xe]=m.useState(localStorage.getItem("discover_period")==1?"7D":localStorage.getItem("discover_period")==2?"30D":localStorage.getItem("discover_period")==3||localStorage.getItem("discover_period")==4?"90D":"7D"),Oe=Je==="1D"?te:Je==="7D"?de:Je==="30D"?Se:Re,bt=gt==="1D"?te:gt==="7D"?de:gt==="30D"?Se:Re,kt=a.length,Ut=a.filter(ce=>ce.unrealizedPnl>=0).length,fn=kt>0?Ut/kt*100:0,[On,Sn]=m.useState({coin:"",type:"",leverage:0,roe:0,entryPrice:0,markPrice:0,referral:"",positionDistribution:0,pnl:0,closePx:0}),Pn=((Es=q(T))==null?void 0:Es.reduce((ce,rt)=>ce+((rt==null?void 0:rt.leverage)||0),0))/(((xr=q(T))==null?void 0:xr.length)||1),En=(Gt=q(T))==null?void 0:Gt.reduce((ce,rt)=>{const Pt=parseFloat(rt==null?void 0:rt.funding)||0;return ce+Pt},0),Bn=localStorage.getItem("isDateOpenPositionsFormat")||"date",[_r,sr]=m.useState(Bn);m.useEffect(()=>{localStorage.setItem("isDateOpenPositionsFormat",_r)},[_r]);const Rr=localStorage.getItem("isDateFillsFormat")||"date",[Jr,ws]=m.useState(Rr);m.useEffect(()=>{localStorage.setItem("isDateFillsFormat",Jr)},[Jr]);const[ls,et]=m.useState([]),yt=async()=>{try{const ce=window.localStorage.getItem("hyperToken");if(!ce){Ie(!0);return}const rt="https://dextrabothypev2.nftinit.io/api/wallet/list",Pt=window.localStorage.getItem("hyperAddress"),ln=await(await fetch(rt,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:$e?$e.toLowerCase():Pt,token:ce,balance:"false"})})).json();ln!=null&&ln.success?(et(ln.data||[]),gr(ln.data)):console.log(ln.error_message)}catch(ce){console.error("Error fetching generate wallet list:",ce)}};m.useEffect(()=>{window.localStorage.getItem("hyperToken")&&yt()},[Y]);const Tn=ls==null?void 0:ls.find(ce=>(ce==null?void 0:ce.wallet_address)===(e==null?void 0:e.toLowerCase())),tr=ie==null?void 0:ie.find(ce=>(ce==null?void 0:ce.wallet_address)===(e==null?void 0:e.toLowerCase())),[Ar,Br]=m.useState([]),[Vr,dr]=m.useState(!0),[jr,ps]=m.useState(!1);m.useEffect(()=>{_&&_.length>0&&(es(),ls.length>0&&Vr&&gr())},[_]);const gr=ce=>{const rt=[...Ar];rt.length>0&&((ce==null?void 0:ce.some(vt=>(vt==null?void 0:vt.wallet_address)===(e==null?void 0:e.toLowerCase())))?Gs(rt):Vr&&(Gs(rt),dr(!1)))},es=()=>{const ce=window.localStorage.getItem("hyperToken");let rt=!1;const Pt=[...Ar];_==null||_.forEach(vt=>{const ln=vt.asset;(Pt==null?void 0:Pt.some(cr=>cr.coin===ln))||(Pt==null||Pt.push({coin:ln,wallet:e}),rt=!0)}),rt&&(Br(Pt),ls!=null&&ls.some(ln=>(ln==null?void 0:ln.wallet_address)===(e==null?void 0:e.toLowerCase()))&&ce&&Gs(Pt))},Gs=async ce=>{if(!jr)try{ps(!0);const rt=window.localStorage.getItem("hyperToken"),Pt="https://dextrabothypev2.nftinit.io/api/hyper/following/position_info/";if(!rt||!ce){ps(!1);return}rt||Ie(!0);const vt=window.localStorage.getItem("hyperAddress"),mn=await(await fetch(Pt,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:$e?$e.toLowerCase():vt,token:rt,positions:ce})})).json();mn.success?S(mn==null?void 0:mn.data):(console.log(mn.error_message),rn.error(mn.error_message))}catch(rt){console.error("Error tag request",rt),rn.error(rt.message)}finally{ps(!1)}};return i.jsxs(i.Fragment,{children:[i.jsx(LUe,{}),i.jsx(w5,{open:lt,setOpen:ft,copyTradeData:ut,copyTradeWallet:jt,setCopyTradeWallet:cn,isScalper:It,setCopyTradeData:qt}),i.jsx(din,{open:un,setOpen:Ft,data:On,setTradeInfo:Sn}),i.jsxs("div",{className:"min-h-max flex flex-col items-center justify-start text-white bg-[#161616] dark:bg-inherit w-full gap-1 overflow-hidden font-manrope",children:[i.jsxs("div",{className:"flex flex-col items-start justify-center gap-4 w-full mt-1 sm-mt-0",children:[i.jsxs("div",{className:"flex justify-start items-center gap-1 h-max min-h-[45px] sm:min-h-max relative w-full",children:[i.jsxs("div",{className:"flex flex-col sm:flex-row items-start justify-start sm:items-center gap-1",children:[i.jsxs("div",{className:"flex justify-start items-center gap-1",children:[i.jsx(iDe,{wallet:e,className:"w-10 h-10 rounded-full"}),i.jsxs("div",{className:`${ls.some(ce=>(ce==null?void 0:ce.wallet_address)==(e==null?void 0:e.toLowerCase()))?"bg-[#67ffbd]/20 rounded-xl p-[7px]":""} flex justify-start items-center gap-1 ml-1`,children:[i.jsx("div",{className:"flex flex-col items-start justify-center gap-1",children:i.jsx("div",{className:`${ls.some(ce=>(ce==null?void 0:ce.wallet_address)==(e==null?void 0:e.toLowerCase()))?"text-[#67ffbd]":"text-white"} text-base sm:text-[24px] font-semibold font-manrope leading-none tracking-wide`,children:e&&e.slice(0,6)+"..."+e.slice(-4)})}),i.jsxs("svg",{onClick:ce=>{ce.stopPropagation(),navigator.clipboard.writeText(e),rn.success("Successfully copied.")},className:"cursor-pointer",width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("path",{d:"M12 9.675V12.825C12 15.45 10.95 16.5 8.325 16.5H5.175C2.55 16.5 1.5 15.45 1.5 12.825V9.675C1.5 7.05 2.55 6 5.175 6H8.325C10.95 6 12 7.05 12 9.675Z",stroke:`${ls.some(ce=>(ce==null?void 0:ce.wallet_address)==(e==null?void 0:e.toLowerCase()))?"#67FFBD":"#909090"}`,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),i.jsx("path",{d:"M16.5 5.175V8.325C16.5 10.95 15.45 12 12.825 12H12V9.675C12 7.05 10.95 6 8.325 6H6V5.175C6 2.55 7.05 1.5 9.675 1.5H12.825C15.45 1.5 16.5 2.55 16.5 5.175Z",stroke:`${ls.some(ce=>(ce==null?void 0:ce.wallet_address)==(e==null?void 0:e.toLowerCase()))?"#67FFBD":"#909090"}`,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),i.jsxs("div",{className:`${ls.some(ce=>(ce==null?void 0:ce.wallet_address)==(e==null?void 0:e.toLowerCase()))?"ml-1 p-1":""} flex justify-start items-center h-6 bg-[#67ffbd]/20 rounded-md gap-0.5 has-tooltip relative min-w-max`,children:[Tn&&i.jsx("div",{className:"text-[#67ffbd] text-sm font-semibold font-manrope leading-[8px]",children:Tn.wallet_name.length>13?Tn.wallet_name.slice(0,13)+"...":Tn.wallet_name}),Tn&&Tn.wallet_name.length>13&&i.jsx("span",{className:"",children:i.jsx(Fa,{content:`${Tn==null?void 0:Tn.wallet_name}`,positionTop:!1,alignRight:!1})})]}),i.jsxs("div",{className:`${ie.some(ce=>ce.wallet_address===e)?Tn?"ml-1 p-1":"ml-0.5 mr-2 p-1":""} flex justify-start items-center h-6 bg-[#67ffbd]/20 rounded-md gap-0.5 has-tooltip relative min-w-max`,children:[tr&&i.jsx("div",{className:"text-[#67ffbd] text-sm font-semibold font-manrope leading-[8px]",children:(tr==null?void 0:tr.tag.length)>13?(tr==null?void 0:tr.tag.slice(0,13))+"...":tr==null?void 0:tr.tag}),tr&&tr.tag.length>13&&i.jsx("span",{className:"",children:i.jsx(Fa,{content:`${tr==null?void 0:tr.tag}`,positionTop:!1,alignRight:!1})})]})]}),i.jsx(v5,{walletAddress:e,children:i.jsx("div",{className:`${re.some(ce=>ce.wallet_address===e),"bg-[rgba(255,217,121,0.16)]"} w-6 h-6sm:w-8 sm:h-8 px-2 sm:px-4 py-1 rounded-full justify-center items-center inline-flex cursor-pointer`,children:i.jsx("div",{className:"w-[18px] h-[18px] justify-center items-center flex",children:re.some(ce=>ce.wallet_address===e)?i.jsx("img",{src:o5,alt:"",className:"w-4 h-4 min-w-4 min-h-4"}):i.jsx("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"w-4 h-4",children:i.jsx("path",{d:"M10.2967 2.6325L11.6167 5.2725C11.7967 5.64 12.2767 5.9925 12.6817 6.06L15.0742 6.4575C16.6042 6.7125 16.9642 7.8225 15.8617 8.9175L14.0017 10.7775C13.6867 11.0925 13.5142 11.7 13.6117 12.135L14.1442 14.4375C14.5642 16.26 13.5967 16.965 11.9842 16.0125L9.7417 14.685C9.3367 14.445 8.6692 14.445 8.2567 14.685L6.0142 16.0125C4.4092 16.965 3.4342 16.2525 3.8542 14.4375L4.3867 12.135C4.4842 11.7 4.3117 11.0925 3.9967 10.7775L2.1367 8.9175C1.0417 7.8225 1.3942 6.7125 2.9242 6.4575L5.3167 6.06C5.7142 5.9925 6.1942 5.64 6.3742 5.2725L7.6942 2.6325C8.4142 1.2 9.5842 1.2 10.2967 2.6325Z",stroke:"#FFD979",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})})})})]}),i.jsxs("div",{className:"flex gap-2",children:[i.jsx("div",{onClick:ce=>{var vt;ce.preventDefault();const rt=ie==null?void 0:ie.some(ln=>ln.wallet_address===e),Pt=(de==null?void 0:de.length)>0?(vt=de[0])==null?void 0:vt.is_scalper:!1;dn({walletAddress:e,isFollow:rt,isScalper:Pt})},className:`${ie.some(ce=>ce.wallet_address===e)?"bg-[#ffd979]/60 text-white/80":"bg-[rgba(103,255,189,0.16)] text-[#67FFBD]"} h-6 sm:h-8 px-2 sm:px-3 py-[1px] sm:py-[5px] rounded-[256px] justify-start items-center gap-2 inline-flex cursor-pointer min-w-max has-tooltip relative ml-8 sm:ml-2`,children:i.jsx("div",{className:"text-[14px] font-semibold font-manrope leading-[8px]min-w-max",children:ie.some(ce=>ce.wallet_address===e)?"Edit Copy Trade":"Copy Trade"})}),i.jsx("div",{className:"sm:hidden h-6 flex justify-end",children:Y&&i.jsx(GY,{walletAddress:e})})]}),i.jsx(sin,{traderWallet:e,trades:J})]}),i.jsxs("div",{className:"absolute right-0 flex justify-end",children:[Y&&i.jsx(GY,{walletAddress:e}),i.jsx("div",{className:"absolute right-0 hidden sm:flex",children:Y&&i.jsx(GY,{walletAddress:e})})]})]}),i.jsxs("div",{className:"flex w-full flex-wrap",children:[i.jsxs("div",{className:"w-full lg:w-4/12 order-2 lg:order-1",children:[i.jsx("div",{ref:mt,className:"flex w-full justify-start items-center",children:i.jsxs("div",{className:"grid grid-cols-2 gap-2 w-full",children:[i.jsxs("div",{className:"flex flex-col justify-between items-start w-full h-32 bg-[#1c1c1c] rounded-2xl p-4",children:[i.jsxs("div",{className:"flex flex-col items-start justify-center gap-2",children:[i.jsx("div",{className:"text-[#9b9b9b] text-[13px] font-manrope leading-[13px] font-medium tracking-[0.18px]",children:"Perp Equity"}),i.jsxs("div",{className:"text-white font-semibold font-manrope leading-[13px] tracking-[0.18px] text-[18px]",children:["$",f?Er(f==null?void 0:f.marginSummary.accountValue):"-"]})]}),i.jsxs("div",{className:"flex flex-col items-start justify-center gap-3 w-full",children:[i.jsxs("div",{className:"flex items-center justify-between gap-1 w-full",children:[i.jsx("div",{className:"text-[#7e7e7e] text-[11px] font-medium font-inter leading-[8px] tracking-[0.18px]",children:"Margin Usage"}),i.jsxs("div",{className:"text-[#7e7e7e] text-[11px] font-medium font-inter leading-[8px] tracking-[0.18px]",children:[f?(parseFloat(f.marginSummary.totalMarginUsed)/parseFloat(f.marginSummary.accountValue)*100).toFixed(2):"-","%"]})]}),i.jsx("div",{className:"w-full h-1 bg-[#414141] rounded-[256px]",children:i.jsx("div",{style:f?{width:`${parseFloat(f.marginSummary.totalMarginUsed)/parseFloat(f.marginSummary.accountValue)*100}%`}:{width:"0%"},className:"h-1 bg-white rounded-[256px]"})})]})]}),i.jsxs("div",{className:"flex flex-col justify-between items-start w-full h-32 bg-[#1c1c1c] rounded-2xl p-4",children:[i.jsxs("div",{className:"flex flex-col items-start justify-center gap-2",children:[i.jsxs("div",{onClick:()=>{Sn(ce=>({...ce,coin:"--",type:f?parseFloat(f.marginSummary.totalNtlPos)===0?"NEUTRAL":a.reduce((rt,Pt)=>rt+(Pt.type==="Long"?parseFloat(Pt.positionValue):-parseFloat(Pt.positionValue)),0)>0?"LONG":"SHORT":"--",leverage:Pn&&Pn!=0?`${parseFloat(Pn).toFixed(2)}x`:"--",roe:bt.length>0?bt.map(rt=>rt==null?void 0:rt.margin_roi).join(", "):"--",entryPrice:f?a.reduce((rt,Pt)=>rt+parseFloat(Pt.unrealizedPnl||0),0):"-",markPrice:kt>0?`${Ut} / ${kt} (${Ut/kt*100===0||Ut/kt*100===100?Ut/kt*100:(Ut/kt*100).toFixed(2)}%)`:"--",positionDistribution:f?`${isNaN(a.reduce((rt,Pt)=>Pt.type==="Long"?rt+parseFloat(Pt.positionValue):rt,0)/parseFloat(f.marginSummary.totalNtlPos)*100)?0:a.reduce((rt,Pt)=>Pt.type==="Long"?rt+parseFloat(Pt.positionValue):rt,0)/parseFloat(f.marginSummary.totalNtlPos)*100===0||a.reduce((rt,Pt)=>Pt.type==="Long"?rt+parseFloat(Pt.positionValue):rt,0)/parseFloat(f.marginSummary.totalNtlPos)*100===100?a.reduce((rt,Pt)=>Pt.type==="Long"?rt+parseFloat(Pt.positionValue):rt,0)/parseFloat(f.marginSummary.totalNtlPos)*100:(a.reduce((rt,Pt)=>Pt.type==="Long"?rt+parseFloat(Pt.positionValue):rt,0)/parseFloat(f.marginSummary.totalNtlPos)*100).toFixed(2)}% / ${isNaN(a.reduce((rt,Pt)=>Pt.type==="Short"?rt+parseFloat(Pt.positionValue):rt,0)/parseFloat(f.marginSummary.totalNtlPos)*100)?0:a.reduce((rt,Pt)=>Pt.type==="Short"?rt+parseFloat(Pt.positionValue):rt,0)/parseFloat(f.marginSummary.totalNtlPos)*100===0||a.reduce((rt,Pt)=>Pt.type==="Short"?rt+parseFloat(Pt.positionValue):rt,0)/parseFloat(f.marginSummary.totalNtlPos)*100===100?a.reduce((rt,Pt)=>Pt.type==="Short"?rt+parseFloat(Pt.positionValue):rt,0)/parseFloat(f.marginSummary.totalNtlPos)*100:(a.reduce((rt,Pt)=>Pt.type==="Short"?rt+parseFloat(Pt.positionValue):rt,0)/parseFloat(f.marginSummary.totalNtlPos)*100).toFixed(2)}%`:"-",referral:window.localStorage.getItem("hyperToken")?he:null})),Ft(!0)},className:"flex justify-start items-center gap-2.5 cursor-pointer",children:[i.jsx("div",{className:"text-[#9b9b9b] text-[13px] font-manrope leading-[13px] font-medium tracking-[0.18px]",children:"uPnL"}),i.jsxs("div",{className:"flex justify-center items-center rounded-[8px] bg-[rgba(103,255,189,0.16)] gap-1 py-1 px-2",children:[i.jsx("span",{children:i.jsx("img",{src:oyt,alt:"Dextrabot"})}),i.jsx("span",{className:"text-[#67FFBD] font-manrope text-[11px] not-italic font-semibold leading-[8px] tracking-[0.11px]",children:"Share"})]})]}),i.jsxs("div",{className:`${f&&a.reduce((ce,rt)=>ce+parseFloat(rt.unrealizedPnl),0)>=0?"text-[#67FFBD]":"text-[#FF7173]"} font-semibold font-manrope leading-[13px] tracking-[0.18px] text-[18px]`,children:["$",f?Er(Math.abs(a.reduce((ce,rt)=>ce+parseFloat(rt.unrealizedPnl||0),0))):"-"]})]}),i.jsx("div",{className:"flex flex-col justify-start items-start",children:i.jsxs("div",{className:"flex flex-col items-start justify-center gap-2",children:[i.jsx("div",{className:"text-[#9b9b9b] text-[13px] font-manrope leading-[13px] font-medium tracking-[0.18px]",children:"Current Win Rate"}),i.jsxs("div",{className:"text-white font-semibold font-manrope leading-[13px] tracking-[0.18px] text-[18px] min-w-max",children:[i.jsx("span",{className:"text-[#67FFBD]",children:Ut})," ","/ ",kt," (",fn==0?"0":fn!=0&&fn!=100?fn.toFixed(2):fn,"%)"]})]})})]}),i.jsxs("div",{className:"flex flex-col justify-start items-start w-full h-32 bg-[#1c1c1c] rounded-2xl p-4 relative",children:[i.jsxs("div",{className:"flex justify-end items-center gap-1 w-auto absolute right-1.5 top-1.5 bg-[#272727] rounded-2xl",children:[i.jsx("div",{onClick:()=>{ct("1D"),localStorage.setItem("discover_period",0)},className:`${Je==="1D"?"text-[#67FFBD] bg-[rgba(103,255,189,0.16)]":"bg-[#272727] text-[#959595]"} h-[18px] px-1.5 py-[5px] rounded-md justify-start items-center gap-2 inline-flex cursor-pointer`,children:i.jsx("div",{className:"text-[11px] font-semibold font-manrope leading-[8px]",children:"1D"})}),i.jsx("div",{onClick:()=>{ct("7D"),localStorage.setItem("discover_period",1)},className:`${Je==="7D"?"text-[#67FFBD] bg-[rgba(103,255,189,0.16)]":"bg-[#272727] text-[#959595]"} h-[18px] px-1.5 py-[5px] rounded-md justify-start items-center gap-2 inline-flex cursor-pointer`,children:i.jsx("div",{className:"text-[11px] font-semibold font-manrope leading-[8px]",children:"7D"})}),i.jsx("div",{onClick:()=>{ct("30D"),localStorage.setItem("discover_period",2)},className:`${Je==="30D"?"text-[#67FFBD] bg-[rgba(103,255,189,0.16)]":"bg-[#272727] text-[#959595]"} h-[18px] px-1.5 py-[5px] rounded-md justify-start items-center gap-2 inline-flex cursor-pointer`,children:i.jsx("div",{className:"text-[11px] font-semibold font-manrope leading-[8px]",children:"30D"})}),i.jsx("div",{onClick:()=>{ct("90D"),localStorage.setItem("discover_period",3)},className:`${Je==="90D"?"text-[#67FFBD] bg-[rgba(103,255,189,0.16)]":"bg-[#272727] text-[#959595]"} h-[18px] px-1.5 py-[5px] rounded-md justify-start items-center gap-2 inline-flex cursor-pointer`,children:i.jsx("div",{className:"text-[11px] font-semibold font-manrope leading-[8px]",children:"90D"})})]}),(Oe==null?void 0:Oe.length)>0?Oe==null?void 0:Oe.map((ce,rt)=>i.jsxs("div",{className:"flex flex-col space-y-4 sm:space-y-6 mt-4 sm:mt-0 lg:space-y-4 lg:mt-4 xl:space-y-6 xl:mt-0 justify-center items-start",children:[i.jsxs("div",{className:"flex flex-col items-start justify-center gap-2",children:[i.jsx("div",{className:"text-[#9b9b9b] text-[13px] font-manrope leading-[13px] font-medium tracking-[0.18px]",children:"Win Rate"}),i.jsx("div",{className:"text-white text-lg font-semibold font-manrope leading-[13px] tracking-[0.18px]",children:(ce==null?void 0:ce.win_complated_rate)==null||isNaN(parseFloat(ce==null?void 0:ce.win_complated_rate))?"--":(ce==null?void 0:ce.win_complated_rate)+"%"})]}),i.jsxs("div",{className:"flex flex-col items-start justify-center gap-2",children:[i.jsx("div",{className:"text-[#9b9b9b] text-[13px] font-manrope leading-[13px] font-medium tracking-[0.18px]",children:"Tx Count"}),i.jsx("div",{className:"text-white text-lg font-semibold font-manrope leading-[13px] tracking-[0.18px]",children:(ce==null?void 0:ce.rtx_count)==null||isNaN(parseFloat(ce==null?void 0:ce.rtx_count))?"--":Fs(ce==null?void 0:ce.rtx_count)})]})]},rt)):i.jsxs("div",{className:"flex flex-col justify-start items-start",children:[i.jsxs("div",{className:"flex flex-col items-start justify-center mt-4 sm:mt-0 lg:mt-4 xl:mt-0 gap-1 sm:gap-2 lg:gap-1 xl:gap-2",children:[i.jsx("div",{className:"text-[#9b9b9b] text-[13px] font-manrope leading-[13px] font-medium tracking-[0.18px]",children:"Win Rate"}),i.jsx("div",{className:"text-white text-xs font-semibold font-manrope leading-[13px] tracking-[0.18px]",children:"No trades in this period"}),i.jsx("div",{className:"w-36 h-px mt-2 sm:mt-[6px] xl:mt-[8px] mb-[8px] sm:mb-[14px] lg:mb-[8px] xl:mb-[14px] bg-[#353535]"})]}),i.jsxs("div",{className:"flex flex-col items-start justify-center gap-2",children:[i.jsx("div",{className:"text-[#9b9b9b] text-[13px] font-manrope leading-[13px] font-medium tracking-[0.18px]",children:"Trade Count"}),i.jsx("div",{className:"text-white text-xs font-semibold font-manrope leading-[13px] tracking-[0.18px]",children:"No trades in this period"})]})]})]}),i.jsxs("div",{className:"flex flex-col justify-start items-start w-full h-32 bg-[#1c1c1c] rounded-2xl p-4 relative",children:[i.jsxs("div",{className:"flex justify-end items-center gap-0.5 absolute right-1.5 top-1.5 bg-[#272727] w-auto rounded-2xl",children:[i.jsx("div",{onClick:()=>{Bt("day"),Xt("1D"),localStorage.setItem("discover_period",0)},className:`${$t==="day"?"text-[#67FFBD] bg-[rgba(103,255,189,0.16)]":"bg-[#272727] text-[#959595]"} h-[18px] px-1.5 py-[5px] rounded-md justify-start items-center gap-2 inline-flex cursor-pointer`,children:i.jsx("div",{className:"text-[11px] font-semibold font-manrope leading-[8px]",children:"1D"})}),i.jsx("div",{onClick:()=>{Bt("week"),Xt("7D"),localStorage.setItem("discover_period",1)},className:`${$t==="week"?"text-[#67FFBD] bg-[rgba(103,255,189,0.16)]":"bg-[#272727] text-[#959595]"} h-[18px] px-1.5 py-[5px] rounded-md justify-start items-center gap-2 inline-flex cursor-pointer`,children:i.jsx("div",{className:"text-[11px] font-semibold font-manrope leading-[8px]",children:"7D"})}),i.jsx("div",{onClick:()=>{Bt("month"),Xt("30D"),localStorage.setItem("discover_period",2)},className:`${$t==="month"?"text-[#67FFBD] bg-[rgba(103,255,189,0.16)]":"bg-[#272727] text-[#959595]"} h-[18px] px-1.5 py-[5px] rounded-md justify-start items-center gap-2 inline-flex cursor-pointer`,children:i.jsx("div",{className:"text-[11px] font-semibold font-manrope leading-[8px]",children:"30D"})}),i.jsx("div",{onClick:()=>{Bt("threeMonth"),Xt("90D"),localStorage.setItem("discover_period",3)},className:`${$t==="threeMonth"?"text-[#67FFBD] bg-[rgba(103,255,189,0.16)]":"bg-[#272727] text-[#959595]"} h-[18px] px-1.5 py-[5px] rounded-md justify-start items-center gap-2 inline-flex cursor-pointer`,children:i.jsx("div",{className:"text-[11px] font-semibold font-manrope leading-[8px]",children:"90D"})}),i.jsx("div",{onClick:()=>{Bt("allTime"),Xt("90D"),localStorage.setItem("discover_period",4)},className:`${$t==="allTime"?"text-[#67FFBD] bg-[rgba(103,255,189,0.16)]":"bg-[#272727] text-[#959595]"} h-[18px] px-1.5 py-[5px] rounded-md justify-start items-center gap-2 inline-flex cursor-pointer`,children:i.jsx("div",{className:"text-[11px] font-semibold font-manrope leading-[8px]",children:"All"})})]}),i.jsxs("div",{className:`${!(bt!=null&&bt.length)>0?"space-y-1.5 sm:space-y-3.5 lg:space-y-1.5 xl:space-y-3.5":"space-y-4 sm:space-y-6 lg:space-y-4 xl:space-y-6"} flex flex-col justify-center items-start mt-4 sm:mt-0 lg:mt-4 xl:mt-0`,children:[i.jsxs("div",{className:"flex flex-col items-start justify-center gap-2",children:[i.jsx("div",{className:"text-[#9b9b9b] text-[13px] font-manrope leading-[13px] font-medium tracking-[0.18px]",children:"PnL"}),Le?i.jsx("div",{className:`${Le.day===0||Le.week===0||Le.month===0||Le.threeMonth===0||Le.all===0?"text-white":$t==="day"?Le.day>0?"text-[#67FFBD]":Le.day<0?"text-[#FF7173]":"text-white":$t==="week"?Le.week>0?"text-[#67FFBD]":Le.week<0?"text-[#FF7173]":"text-white":$t==="month"?Le.month>0?"text-[#67FFBD]":Le.month<0?"text-[#FF7173]":"text-white":$t==="threeMonth"?Le.threeMonth>0?"text-[#67FFBD]":Le.threeMonth<0?"text-[#FF7173]":"text-white":$t==="allTime"?Le.all>0?"text-[#67FFBD]":Le.all<0?"text-[#FF7173]":"text-white":"text-white"} text-lg font-semibold font-manrope leading-[13px] tracking-[0.18px]`,children:(()=>{const ce={day:Le.day,week:Le.week,month:Le.month,threeMonth:Le.threeMonth,allTime:Le.all}[$t];return`$${Fs(Math.abs(ce))}`})()}):i.jsx("div",{className:"text-white text-xs font-semibold font-manrope leading-[13px] tracking-[0.18px]",children:"No trades in this period"})]}),!(bt!=null&&bt.length)>0&&i.jsx("div",{className:"w-36 h-px bg-[#353535]"}),i.jsxs("div",{className:"flex flex-col items-start justify-center gap-2",children:[i.jsx("div",{className:"text-[#9b9b9b] text-[13px] font-manrope leading-[13px] font-medium tracking-[0.18px]",children:"ROE"}),(bt==null?void 0:bt.length)>0?bt==null?void 0:bt.map((ce,rt)=>i.jsx("div",{className:`${(ce==null?void 0:ce.margin_roi)==null||isNaN(parseFloat(ce==null?void 0:ce.margin_roi))||(ce==null?void 0:ce.margin_roi)==0?"text-white":(ce==null?void 0:ce.margin_roi)>0?"text-[#67FFBD]":"text-[#FF7173]"} text-lg font-semibold font-manrope leading-[13px] tracking-[0.18px]`,children:(ce==null?void 0:ce.margin_roi)==null||isNaN(parseFloat(ce==null?void 0:ce.margin_roi))?"--":Fs(Math.abs(ce==null?void 0:ce.margin_roi))+"%"})):i.jsx("div",{className:"text-white text-xs font-semibold font-manrope leading-[13px] tracking-[0.18px]",children:"No trades in this period"})]})]})]}),i.jsxs("div",{className:"flex flex-col justify-between items-start w-full h-32 bg-[#1c1c1c] rounded-2xl p-4",children:[i.jsxs("div",{className:"flex flex-col items-start justify-center gap-2",children:[i.jsx("div",{className:"text-[#9b9b9b] text-[13px] font-manrope leading-[13px] font-medium tracking-[0.18px]",children:"Direction Bias"}),i.jsx("div",{className:"text-white font-semibold font-manrope leading-[13px] tracking-[0.18px] text-[18px]",children:f?parseFloat(f.marginSummary.totalNtlPos)===0?i.jsx("span",{children:"NEUTRAL"}):a.reduce((ce,rt)=>ce+(rt.type==="Long"?parseFloat(rt.positionValue):-parseFloat(rt.positionValue)),0)>0?i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"direction-icon text-[#67FFBD]",children:"↗"}),i.jsx("span",{className:"text-[#67FFBD]",children:"LONG"})]}):i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"direction-icon text-[#FF7173]",children:"↘"}),i.jsx("span",{className:"text-[#FF7173]",children:"SHORT"})]}):"-"})]}),i.jsxs("div",{className:"flex flex-col items-start justify-center gap-3 w-full",children:[i.jsxs("div",{className:"flex items-center justify-between gap-1 w-full",children:[i.jsx("div",{className:"text-[#7e7e7e] text-[11px] font-medium font-inter leading-[8px] tracking-[0.18px]",children:"Long Exposure"}),i.jsxs("div",{className:"text-[#7e7e7e] text-[11px] font-medium font-inter leading-[8px] tracking-[0.18px]",children:[f?(a.reduce((ce,rt)=>rt.type==="Long"?ce+parseFloat(rt.positionValue):ce,0)/parseFloat(f.marginSummary.totalNtlPos)*100).toFixed(2):"-","%"]})]}),i.jsx("div",{className:"w-full h-1 bg-[#414141] rounded-[256px]",children:i.jsx("div",{style:f?{width:`${a.reduce((ce,rt)=>rt.type==="Long"?ce+parseFloat(rt.positionValue):ce,0)/parseFloat(f.marginSummary.totalNtlPos)*100}%`}:{width:"0%"},className:"h-1 bg-white rounded-[256px]"})})]})]}),i.jsxs("div",{className:"flex flex-col justify-between items-start w-full h-32 bg-[#1c1c1c] rounded-2xl p-4",children:[i.jsxs("div",{className:"flex flex-col items-start justify-center gap-2",children:[i.jsx("div",{className:"text-[#9b9b9b] text-[13px] font-manrope leading-[13px] font-medium tracking-[0.18px]",children:"Position Distribution"}),i.jsx("div",{className:"text-white text-base font-semibold font-manrope leading-[13px] tracking-[0.18px] text-[18px]",children:i.jsxs("span",{className:"float-right flex gap-3",children:[i.jsxs("span",{className:"text-[#67FFBD]",children:[f?isNaN(a.reduce((ce,rt)=>rt.type==="Long"?ce+parseFloat(rt.positionValue):ce,0)/parseFloat(f.marginSummary.totalNtlPos)*100)?0:(a.reduce((ce,rt)=>rt.type==="Long"?ce+parseFloat(rt.positionValue):ce,0)/parseFloat(f.marginSummary.totalNtlPos)*100).toFixed(2):"-","%"]}),i.jsxs("span",{className:"text-[#FF7173]",children:[f?isNaN(a.reduce((ce,rt)=>rt.type==="Short"?ce+parseFloat(rt.positionValue):ce,0)/parseFloat(f.marginSummary.totalNtlPos)*100)?0:(a.reduce((ce,rt)=>rt.type==="Short"?ce+parseFloat(rt.positionValue):ce,0)/parseFloat(f.marginSummary.totalNtlPos)*100).toFixed(2):"-","%"]})]})})]}),i.jsxs("div",{className:"flex flex-col items-start justify-start gap-2 w-full",children:[i.jsx("div",{className:"text-white bg-transparent text-xs font-medium font-inter leading-[8px] tracking-[0.18px] w-full",children:i.jsxs("span",{className:"flex justify-between items-center",children:[i.jsx("span",{className:"text-[#67ffbd]",children:f?at(a.reduce((ce,rt)=>rt.type==="Long"?ce+parseFloat(rt.positionValue):ce,0)):"-"}),i.jsx("span",{className:"text-[#ff787b]",children:f?at(a.reduce((ce,rt)=>rt.type==="Short"?ce+parseFloat(rt.positionValue):ce,0)):"-"})]})}),i.jsxs("div",{className:"h-1 w-full bg-[#161616] rounded-[256px] flex gap-[2px] overflow-hidden",children:[i.jsx("div",{style:f?isNaN(a.reduce((ce,rt)=>rt.type==="Long"?ce+parseFloat(rt.positionValue):ce,0)/parseFloat(f.marginSummary.totalNtlPos)*100)?{width:"0%"}:{width:`${a.reduce((ce,rt)=>rt.type==="Long"?ce+parseFloat(rt.positionValue):ce,0)/parseFloat(f.marginSummary.totalNtlPos)*100}%`}:{width:"0%"},className:"flex justify-center items-center h-1 bg-[#67FFBD] rounded-[256px] text-[#67ffbd] text-[11px] font-bold font-inter leading-[8px] tracking-[0.18px]"}),i.jsx("div",{style:f?isNaN(a.reduce((ce,rt)=>rt.type==="Short"?ce+parseFloat(rt.positionValue):ce,0)/parseFloat(f.marginSummary.totalNtlPos)*100)?{width:"0%"}:{width:`${a.reduce((ce,rt)=>rt.type==="Short"?ce+parseFloat(rt.positionValue):ce,0)/parseFloat(f.marginSummary.totalNtlPos)*100}%`}:{width:"0%"},className:"bg-[#FF797C] h-1 rounded-[256px] flex justify-center items-center text-[#67ffbd] text-[11px] font-bold font-inter leading-[8px] tracking-[0.18px]"})]})]})]}),i.jsxs("div",{className:"col-span-2 flex gap-2 w-full",children:[i.jsxs("div",{className:"flex flex-col justify-start items-start flex-[0.7] h-[92px] bg-[#1c1c1c] rounded-2xl p-[11px] relative gap-[14px]",children:[i.jsx("div",{className:"flex flex-col justify-start items-start",children:i.jsxs("div",{className:"flex flex-col items-start justify-center gap-[2px]",children:[i.jsx("div",{className:"text-[#9b9b9b] text-[10px] font-semibold font-['Manrope'] leading-[13px] tracking-wide uppercase",children:"Avg Leverage"}),i.jsx("div",{className:"text-white text-sm font-semibold font-['Manrope'] leading-[13px] tracking-tight",children:Pn&&Pn!=0?`${parseFloat(Pn).toFixed(2)}x`:"--"})]})}),i.jsx("div",{className:"flex flex-col justify-start items-start",children:i.jsxs("div",{className:"flex flex-col items-start justify-center gap-[2px]",children:[i.jsx("div",{className:"text-[#9b9b9b] text-[10px] font-semibold font-['Manrope'] leading-[13px] tracking-wide uppercase",children:"Funding"}),i.jsx("div",{className:`${En<=0?"text-[#67FFBD]":"text-[#FF7173]"} text-sm font-semibold font-['Manrope'] leading-[13px] tracking-tight`,children:En&&En!=0?`$${Sv(Math.abs(En))}`:"--"})]})})]}),i.jsxs("div",{className:"flex flex-col justify-start items-start flex-[2] h-[92px] bg-[#1c1c1c] rounded-2xl p-1 relative w-full",children:[i.jsx("div",{className:"absolute left-2.5 top-[11px] text-[#9b9b9b] text-[13px] font-medium font-['Manrope'] leading-none tracking-tight",children:"Performance"}),i.jsxs("div",{className:"flex justify-end items-center gap-1 w-auto absolute right-[9px] top-[9px] bg-[#272727] rounded-2xl",children:[i.jsx("div",{onClick:()=>{Xe("7D"),localStorage.setItem("discover_period",1)},className:`${wt==="7D"?"text-[#67FFBD] bg-[rgba(103,255,189,0.16)]":"bg-[#272727] text-[#959595]"} h-[18px] px-1.5 py-[5px] rounded-md justify-start items-center gap-2 inline-flex cursor-pointer`,children:i.jsx("div",{className:"text-[11px] font-semibold font-manrope leading-[8px]",children:"7D"})}),i.jsx("div",{onClick:()=>{Xe("30D"),localStorage.setItem("discover_period",2)},className:`${wt==="30D"?"text-[#67FFBD] bg-[rgba(103,255,189,0.16)]":"bg-[#272727] text-[#959595]"} h-[18px] px-1.5 py-[5px] rounded-md justify-start items-center gap-2 inline-flex cursor-pointer`,children:i.jsx("div",{className:"text-[11px] font-semibold font-manrope leading-[8px]",children:"30D"})}),i.jsx("div",{onClick:()=>{Xe("90D"),localStorage.setItem("discover_period",3)},className:`${wt==="90D"?"text-[#67FFBD] bg-[rgba(103,255,189,0.16)]":"bg-[#272727] text-[#959595]"} h-[18px] px-1.5 py-[5px] rounded-md justify-start items-center gap-2 inline-flex cursor-pointer`,children:i.jsx("div",{className:"text-[11px] font-semibold font-manrope leading-[8px]",children:"90D"})})]}),Fe?i.jsxs("div",{className:"flex justify-between items-start gap-1 w-full mt-[43px]",children:[i.jsxs("div",{className:"flex-[0.6] p-1.5 h-[41px] bg-[#2e2e2e] rounded-[10px] flex flex-col items-start justify-center gap-[2px]",children:[i.jsxs("div",{className:"text-[#9b9b9b] text-[10px] font-semibold font-['Manrope'] leading-[13px] tracking-wide uppercase flex justify-start items-center gap-0.5",children:["Sharpe",i.jsx("div",{className:"flex justify-end items-center gap-1 w-full",children:i.jsxs("div",{className:"flex justify-end items-center has-tooltip relative",children:[i.jsx(Ni,{className:"text-[#7C7C7C] w-3 min-w-3 min-h-3 h-3"}),i.jsx("span",{className:"",children:i.jsx(ro,{content:"Sharpe_tooltip",positionTop:!1,alignRight:!1,tooltipCss:"max-w-[80px] min-w-[80px] leading-[16px] -mb-12"})})]})})]}),i.jsx("div",{className:`${(wt==="7D"?Fe==null?void 0:Fe.portfolio_perp_week_sharpe:wt==="30D"?Fe==null?void 0:Fe.portfolio_perp_month_sharpe:Fe==null?void 0:Fe.portfolio_perp_3month_sharpe)>=1&&(wt==="7D"?Fe==null?void 0:Fe.portfolio_perp_week_sharpe:wt==="30D"?Fe==null?void 0:Fe.portfolio_perp_month_sharpe:Fe==null?void 0:Fe.portfolio_perp_3month_sharpe)<=2?"text-[#E5BB18]":(wt==="7D"?Fe==null?void 0:Fe.portfolio_perp_week_sharp:wt==="30D"?Fe==null?void 0:Fe.portfolio_perp_month_sharpe:Fe==null?void 0:Fe.portfolio_perp_3month_sharpe)>2?"text-[#1DE6A3]":"text-[#FF7173]"} text-base font-semibold font-['Manrope'] leading-[13px] tracking-tight`,children:wt==="7D"?(Fe==null?void 0:Fe.portfolio_perp_week_sharpe)==null||isNaN(parseFloat(Fe==null?void 0:Fe.portfolio_perp_week_sharpe))?"--":Er(Fe==null?void 0:Fe.portfolio_perp_week_sharpe):wt==="30D"?(Fe==null?void 0:Fe.portfolio_perp_month_sharpe)==null||isNaN(parseFloat(Fe==null?void 0:Fe.portfolio_perp_month_sharpe))?"--":Er(Fe==null?void 0:Fe.portfolio_perp_month_sharpe):(Fe==null?void 0:Fe.portfolio_perp_3month_sharpe)==null||isNaN(parseFloat(Fe==null?void 0:Fe.portfolio_perp_3month_sharpe))?"--":Er(Fe==null?void 0:Fe.portfolio_perp_3month_sharpe)})]}),i.jsxs("div",{className:"flex-1 p-1.5 h-[41px] bg-[#2e2e2e] rounded-[10px] flex flex-col items-start justify-center gap-[2px]",children:[i.jsx("div",{className:"text-[#9b9b9b] text-[10px] font-semibold font-['Manrope'] leading-[13px] tracking-wide min-w-max uppercase",children:"Growth Rate"}),i.jsx("div",{className:`${(wt==="7D"?Fe==null?void 0:Fe.portfolio_perp_week_growth_rate:wt==="30D"?Fe==null?void 0:Fe.portfolio_perp_month_growth_rate:Fe==null?void 0:Fe.portfolio_perp_3month_growth_rate)==0?"text-white":(wt==="7D"?Fe==null?void 0:Fe.portfolio_perp_week_growth_rate:wt==="30D"?Fe==null?void 0:Fe.portfolio_perp_month_growth_rate:Fe==null?void 0:Fe.portfolio_perp_3month_growth_rate)>0?"text-[#67FFBD]":"text-[#FF7173]"} text-base font-semibold font-['Manrope'] leading-[13px] tracking-tight`,children:wt==="7D"?(Fe==null?void 0:Fe.portfolio_perp_week_growth_rate)==null||isNaN(parseFloat(Fe==null?void 0:Fe.portfolio_perp_week_growth_rate))?"--":Fs(Fe==null?void 0:Fe.portfolio_perp_week_growth_rate)+"%":wt==="30D"?(Fe==null?void 0:Fe.portfolio_perp_month_growth_rate)==null||isNaN(parseFloat(Fe==null?void 0:Fe.portfolio_perp_month_growth_rate))?"--":Fs(Fe==null?void 0:Fe.portfolio_perp_month_growth_rate)+"%":(Fe==null?void 0:Fe.portfolio_perp_3month_growth_rate)==null||isNaN(parseFloat(Fe==null?void 0:Fe.portfolio_perp_3month_growth_rate))?"--":Fs(Fe==null?void 0:Fe.portfolio_perp_3month_growth_rate)+"%"})]}),i.jsxs("div",{className:"flex-[0.9] p-1.5 h-[41px] bg-[#2e2e2e] rounded-[10px] flex flex-col items-start justify-center gap-[2px]",children:[i.jsx("div",{className:"text-[#9b9b9b] text-[10px] font-semibold font-['Manrope'] leading-[13px] tracking-wide uppercase",children:"Drawdown"}),i.jsx("div",{className:`${(wt==="7D"?Fe==null?void 0:Fe.portfolio_perp_week_dd:wt==="30D"?Fe==null?void 0:Fe.portfolio_perp_month_dd:Fe==null?void 0:Fe.portfolio_perp_3month_dd)==0?"text-white":(wt==="7D"?Fe==null?void 0:Fe.portfolio_perp_week_dd:wt==="30D"?Fe==null?void 0:Fe.portfolio_perp_month_dd:Fe==null?void 0:Fe.portfolio_perp_3month_dd)>0?"text-[#67FFBD]":"text-[#FF7173]"} text-base font-semibold font-['Manrope'] leading-[13px] tracking-tight`,children:wt==="7D"?(Fe==null?void 0:Fe.portfolio_perp_week_dd)==null||isNaN(parseFloat(Fe==null?void 0:Fe.portfolio_perp_week_dd))?"--":Fs(Math.abs(Fe==null?void 0:Fe.portfolio_perp_week_dd))+"%":wt==="30D"?(Fe==null?void 0:Fe.portfolio_perp_month_dd)==null||isNaN(parseFloat(Fe==null?void 0:Fe.portfolio_perp_month_dd))?"--":Fs(Math.abs(Fe==null?void 0:Fe.portfolio_perp_month_dd))+"%":(Fe==null?void 0:Fe.portfolio_perp_3month_dd)==null||isNaN(parseFloat(Fe==null?void 0:Fe.portfolio_perp_3month_dd))?"--":Fs(Math.abs(Fe==null?void 0:Fe.portfolio_perp_3month_dd))+"%"})]})]}):i.jsx("div",{className:"flex flex-col justify-start items-start mt-[43px] mx-auto",children:i.jsx("div",{className:"text-white text-xs font-semibold font-manrope leading-[13px] tracking-[0.18px]",children:"No trades in this period"})})]})]})]})}),i.jsxs("div",{className:"absolute sm:hidden -bottom-8 right-2 z-10 flex justify-start items-center gap-2",children:[i.jsx("button",{onClick:Dt,className:"bg-[#353535] hover:bg-gray-600 text-white p-1 rounded-lg focus:outline-none focus:ring-0 border-none block lg:hidden",children:i.jsx("span",{className:"w-6 h-6",children:i.jsx(Bl,{className:"text-gray-300 w-4 h-4 rotate-90"})})}),i.jsx("button",{onClick:Tt,className:"bg-[#353535] hover:bg-gray-600 text-white p-1 rounded-lg focus:outline-none focus:ring-0 border-none block lg:hidden",children:i.jsx("span",{className:"w-6 h-6",children:i.jsx(Bl,{className:"text-gray-300 w-4 h-4 -rotate-90"})})})]})]}),i.jsx("div",{className:"w-full lg:w-8/12 h-full order-1 lg:order-2",children:i.jsx(ein,{})})]})]}),i.jsx(XUe,{initialAddress:e})]})]})},Bin=()=>{const e=t5(),t=(e==null?void 0:e.walletAddress.toLowerCase())||"";return i.jsxs(i.Fragment,{children:[i.jsx(So,{children:i.jsxs(Ro,{children:[i.jsxs("title",{children:["Explore ",`${t}`," - Hyperliquid Wallet Overview & History - Dextrabot"]}),i.jsx("meta",{name:"description",content:`Explore real-time transactions, holdings, and insights for ${t} on HyperLiquid. Track wallet activity and make data-driven trading decisions.`}),i.jsx("meta",{name:"og:title",content:`Explore ${t} - Hyperliquid Wallet Overview & History - Dextrabot`}),i.jsx("meta",{name:"og:description",content:`Explore real-time transactions, holdings, and insights for ${t} on HyperLiquid. Track wallet activity and make data-driven trading decisions.`}),i.jsx("meta",{name:"og:image",content:"https://app.dextrabot.com/dextrabotIcon.png"}),i.jsx("meta",{name:"og:url",content:`https://app.dextrabot.com/wallet-details/${t}`})]})}),i.jsx("div",{className:"flex justify-center items-start w-full h-screen min-h-max px-2 pt-3 sm:px-6 sm:pt-4 bg-[#161616]",children:i.jsx(Din,{initialAddress:t})})]})},$in=({isOpen:e,onClose:t,children:n,zIndex:r=9999,closeOnBackdropClick:s=!0})=>(m.useEffect(()=>(e?document.body.style.overflow="hidden":document.body.style.overflow="",()=>{document.body.style.overflow=""}),[e]),e?vre.createPortal(i.jsxs("div",{className:"fixed inset-0 flex justify-center items-center pointer-events-auto",style:{zIndex:r},children:[i.jsx("div",{onClick:s?t:void 0,className:"absolute inset-0 bg-black bg-opacity-50 backdrop-blur-sm transition-opacity duration-300"}),i.jsx("div",{className:"relative bg-[#252525] rounded-3xl shadow-lg w-[400px] max-w-full pointer-events-auto",children:n})]}),document.body):null);function Uin(){const{signModalOpen:e,setSignModalOpen:t,signIn:n,hyperToken:r,walletLogin:s}=m.useContext(Qr),{isConnected:a}=ns(),{openConnectModal:o}=y5(),l=typeof window<"u"&&window.matchMedia("(max-width:640px)").matches,c=()=>{window.localStorage.getItem("hyperToken")&&r?s():(n(1),t(!1))};return i.jsx($in,{isOpen:e,onClose:()=>t(!1),children:i.jsxs("div",{className:"flex flex-col items-center gap-8 w-[400px] bg-[#252525] rounded-3xl py-4 relative pointer-events-auto",children:[i.jsx("span",{onClick:()=>t(!1),className:"absolute top-2 right-2 w-9 h-9 rounded-full flex items-center justify-center hover:bg-[#7535FE] cursor-pointer",children:i.jsx("img",{src:Ba,alt:"close",className:"p-1"})}),i.jsx("img",{src:Gi,alt:"dextrabot",className:"w-[86px] h-[86px] mt-4"}),i.jsxs("div",{className:"flex flex-col items-center gap-2",children:[i.jsx("div",{className:"text-white text-[32px] leading-none",children:"Welcome Dextrabot"}),i.jsx("div",{className:"text-white/60 text-sm leading-none",children:l?"Scan the QR code to continue":"Connect your wallet to continue"})]}),i.jsx("div",{className:"flex justify-center items-center w-[348px] h-12 bg-[#7536ff] rounded-2xl cursor-pointer text-center",children:a?l?i.jsx(t_,{}):i.jsx("div",{onClick:c,className:"flex justify-center items-center w-[348px] h-12 bg-[#7536ff] rounded-2xl cursor-pointer",children:i.jsx("span",{className:"text-white text-sm leading-none",children:"Wallet Sign‑in"})}):l?i.jsx("div",{className:"flex justify-center items-center w-[348px] h-12 bg-[#7536ff] rounded-2xl",children:i.jsx("span",{className:"text-white text-sm leading-none",children:i.jsx(t_,{})})}):i.jsx("div",{onClick:o,className:"flex justify-center items-center w-[348px] h-12 bg-[#7536ff] rounded-2xl cursor-pointer",children:i.jsx("div",{className:"text-center text-white text-sm font-manrope leading-none",children:"Connect Wallet"})})}),i.jsxs("div",{className:"text-center pt-2",children:[i.jsx("span",{className:"text-white/60 text-xs",children:"Do you need support? "}),i.jsx("span",{onClick:()=>window.open("https://discord.gg/dextrabot","_blank"),className:"text-[#b593ff] text-xs cursor-pointer",children:"Join Discord"})]})]})})}const zl=()=>i.jsxs("div",{className:"flex items-center justify-center gap-4 px-4 py-2 flex-col",children:[i.jsx("div",{className:"p-4 bg-[#ff356629] rounded-full",children:i.jsx("img",{src:Vbt,alt:"",className:"w-8 h-8"})}),i.jsxs("div",{className:"flex flex-col items-center justify-center gap-1",children:[i.jsx("div",{className:"text-[#FF3566]",children:"Error"}),i.jsxs("div",{className:"text-[#767676]",children:["We encountered a problem"," ",i.jsxs("span",{children:["wait a",i.jsx("br",{})," moment before try again"]})]})]})]}),zin=({data:e,loading:t,error:n,trackerData:r,isRequest:s,setIsRequest:a})=>{var ye;const{trackedWatchList:o,getTrackedWatchList:l,setSignModalOpen:c}=m.useContext(Qr),{isConnected:u,address:d}=ns(),[f,x]=m.useState(!1),[g,v]=m.useState(null),[w,C]=m.useState(null),[N,P]=m.useState(""),[I,R]=m.useState([]),[F,U]=m.useState(!1),[L,z]=m.useState({}),Q="-tag",[ne,J]=m.useState(Q),X=ve=>r.sort((je,Ie)=>{const Le=I.find(qt=>qt.wallet_address===je.wallet_address)||{},Qe=I.find(qt=>qt.wallet_address===Ie.wallet_address)||{},$e=Le.data?Le.data.reduce((qt,It)=>qt+parseFloat(It.unrealizedPnl||0),0):Le.unrealizedPnl||0,it=Qe.data?Qe.data.reduce((qt,It)=>qt+parseFloat(It.unrealizedPnl||0),0):Qe.unrealizedPnl||0,tt=je.tag?je.tag.toUpperCase():"",lt=Ie.tag?Ie.tag.toUpperCase():"",ft=je.wallet_address?je.wallet_address.toLowerCase():"",ut=Ie.wallet_address?Ie.wallet_address.toLowerCase():"";return ve==="tag"?tt<lt?-1:tt>lt?1:0:ve==="-tag"?tt>lt?-1:tt<lt?1:0:ve==="-wallet_address"?ft<ut?-1:ft>ut?1:0:ve==="wallet_address"?ft>ut?-1:ft<ut?1:0:ve==="perp_equity"?(Le.perp_equity||0)-(Qe.perp_equity||0):ve==="-perp_equity"?(Qe.perp_equity||0)-(Le.perp_equity||0):ve==="margin_usage"?(Le.margin_usage||0)-(Qe.margin_usage||0):ve==="-margin_usage"?(Qe.margin_usage||0)-(Le.margin_usage||0):ve==="unrealizedPnl"?$e-it:ve==="-unrealizedPnl"?it-$e:ve==="-expire_date"?new Date(Ie.expire_date)-new Date(je.expire_date):ve==="expire_date"?new Date(je.expire_date)-new Date(Ie.expire_date):0}),re=async({walletAddress:ve,isFollow:je,isScalper:Ie})=>{try{P(ve);const Le=window.localStorage.getItem("hyperToken"),Qe=window.localStorage.getItem("hyperAddress");if(!Le){c(!0);return}const $e=je?"https://dextrabothypev2.nftinit.io/api/test_app/following/info/":"https://dextrabothypev2.nftinit.io/api/hyper/following/get_setting/",it=je?{address:d?d.toLowerCase():Qe,token:Le,follow_address:ve.toLowerCase()}:{address:d?d.toLowerCase():Qe,token:Le},tt=await fetch($e,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(it)});if(!tt.ok)throw new zl(`Server responded with status ${tt.status}`);const lt=await tt.json();lt.success?(v(Array.isArray(lt==null?void 0:lt.data)?[...lt.data].sort((ft,ut)=>new Date(ut.created_at||0)-new Date(ft.created_at||0)):lt==null?void 0:lt.data),C(Ie),x(!0)):(console.log(lt.error_message),rn.error(lt.error_message))}catch(Le){console.error("Error in like function:",Le),rn.error(Le.message||"Something went wrong!")}},pe=ve=>ve!=null&&ve.assetPositions?ve.assetPositions.filter(je=>{if(!je.position||!je.position.szi)return!1;const Ie=parseFloat(je.position.szi);return!isNaN(Ie)&&Ie!==0}).map(je=>{const Ie=je.position,Le=parseFloat(Ie.szi),Qe=parseFloat(Ie.entryPx),$e=parseFloat(Ie.positionValue),it=parseFloat(Ie.unrealizedPnl),tt=parseFloat(Ie.returnOnEquity)*100,lt=parseFloat(Ie.marginUsed),ft=Ie.leverage.value,ut=parseFloat(Ie.cumFunding.sinceOpen),qt=Le>0?"Long":"Short";return{asset:Ie.coin,type:qt,size:Math.abs(Le),entryPrice:Qe.toFixed(2),currentPrice:($e/Math.abs(Le)).toFixed(2),leverage:ft,positionValue:$e.toFixed(2),marginUsed:lt.toFixed(2),unrealizedPnl:it.toFixed(2),roe:tt.toFixed(2),funding:ut.toFixed(4),liquidationPrice:Ie.liquidationPx?parseFloat(Ie.liquidationPx).toFixed(2):"N/A"}}):[],Y=async ve=>{try{const Ie=await fs.post("https://api-ui.hyperliquid.xyz/info",{type:"clearinghouseState",user:ve});if(Ie.data){const Le=pe(Ie.data);R(Qe=>{var $e,it,tt,lt;return[...Qe,{wallet_address:ve,perp_equity:(it=($e=Ie==null?void 0:Ie.data)==null?void 0:$e.marginSummary)==null?void 0:it.accountValue,margin_usage:parseFloat((tt=Ie==null?void 0:Ie.data)==null?void 0:tt.marginSummary.totalMarginUsed)/parseFloat((lt=Ie==null?void 0:Ie.data)==null?void 0:lt.marginSummary.accountValue),data:Le}]})}}catch(je){console.error("Error fetching user state from HyperState:",je)}},ie=async ve=>{try{const je=window.localStorage.getItem("hyperToken"),Ie="https://dextrabothypev2.nftinit.io/api/hyper/tracker/getclearinghousestate/",Le=window.localStorage.getItem("hyperAddress"),Qe=await fetch(Ie,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:d?d.toLowerCase():Le,token:je,follow_address:ve})});if(Qe.ok){const $e=await Qe.json();if($e.success){const it=pe($e==null?void 0:$e.data);R(tt=>{var lt;return[...tt,{wallet_address:ve,perp_equity:(lt=$e==null?void 0:$e.data.marginSummary)==null?void 0:lt.accountValue,margin_usage:parseFloat($e==null?void 0:$e.data.marginSummary.totalMarginUsed)/parseFloat($e==null?void 0:$e.data.marginSummary.accountValue),data:it}]})}}else if(Qe.status===500)console.warn(`Received 500 error for ${ve}, retrying with getUserHyperState`),await Y(ve);else throw new zl(`Request failed with status ${Qe.status}`)}catch(je){console.error("Error fetching user state:",je)}},oe=m.useRef(!1);m.useEffect(()=>{!t&&s&&!oe.current&&(oe.current=!0,(async()=>{for(let je=0;je<r.length;je++){const Ie=r[je];ie(Ie==null?void 0:Ie.wallet_address.toLowerCase()).catch(Le=>{console.error(`Error fetching user state for wallet ${Ie.wallet_address}:`,Le)}),await new Promise(Le=>setTimeout(Le,500))}})())},[s,t,r]);const G=async(ve,je)=>{try{const Ie=window.localStorage.getItem("hyperToken"),Le="https://dextrabothypev2.nftinit.io/api/hyper/tracker/extend_tracker_expiry/";if(!Ie||!ve||!je)return;z(tt=>({...tt,[je]:!0}));const Qe=window.localStorage.getItem("hyperAddress"),$e=await fetch(Le,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:d?d==null?void 0:d.toLowerCase():Qe,token:Ie,tracker_id:ve})});if(!$e.ok)throw new zl(`Failed to unlike: ${$e.status} ${$e.statusText}`);const it=await $e.json();it.success?(z(tt=>({...tt,[je]:!1})),l(),rn.success(`${je.slice(0,5)}...${je.slice(-3)} Tracker successfully renewed`,{style:{border:"1px solid #22c55e",padding:"16px",color:"#fff",borderRadius:"999px",background:"#14532d",height:"60px",minWidth:"400px"},iconTheme:{primary:"#22c55e",secondary:"#FFFAEE"}})):(rn.error(it.error_message),z(tt=>({...tt,[je]:!1})))}catch(Ie){rn.error(Ie.message||"Something went wrong!"),z(Le=>({...Le,[je]:!1}))}},V=m.useRef(null),ee=()=>{V.current&&(V.current.scrollLeft-=100)},ae=()=>{V.current&&(V.current.scrollLeft+=100)},fe=()=>{V.current&&(V.current.scrollTop+=200)},Ne=()=>{V.current&&(V.current.scrollTop-=200)},he=ve=>{const je=new Date(ve),Ie=new Date,Le=new Date(je.getFullYear(),je.getMonth(),je.getDate()),Qe=new Date(Ie.getFullYear(),Ie.getMonth(),Ie.getDate());return(Le-Qe)/(1e3*60*60*24)<=3},ge=ve=>ve>=640&&ve<1024?5:ve>=1024&&ve<1240?6:ve>=1240&&ve<1540||ve>=1540?7:3;return i.jsxs(i.Fragment,{children:[i.jsx(w5,{open:f,setOpen:x,copyTradeData:g,copyTradeWallet:N,setCopyTradeWallet:P,isScalper:w,setCopyTradeData:v}),i.jsxs("div",{className:"flex flex-col items-stretch justify-start gap-[17px] text-white bg-[#161616] w-full h-full font-manrope",children:[i.jsxs("div",{className:"flex flex-col items-start justify-start gap-2 font-manrope max-w-full w-full bg-[#161616] pl-2 sm:pl-0 pt-4",children:[i.jsx("div",{className:"text-[#7e7e7e] text-[11px] font-medium font-inter leading-[8px]",children:"Hype / Explore"}),i.jsx("div",{className:"flex items-center justify-start gap-4",children:i.jsx("div",{className:"text-white text-lg font-medium font-manrope leading-[21px]",children:"Tracked Wallets"})})]}),i.jsxs("div",{className:"relative w-full h-full",children:[i.jsxs("div",{className:"absolute hidden -top-6 right-4 z-10 lg:flex justify-start items-center gap-2",children:[i.jsx("button",{onClick:ee,className:"bg-[#353535] hover:bg-gray-600 text-white p-1 rounded-lg focus:outline-none focus:ring-0 border-none block lg:hidden",children:i.jsx("span",{className:"w-6 h-6",children:i.jsx(Xa,{className:"text-gray-300 w-4 h-4 rotate-90"})})}),i.jsx("button",{onClick:ae,className:"bg-[#353535] hover:bg-gray-600 text-white p-1 rounded-lg focus:outline-none focus:ring-0 border-none block lg:hidden",children:i.jsx("span",{className:"w-6 h-6",children:i.jsx(Xa,{className:"text-gray-300 w-4 h-4 -rotate-90"})})}),i.jsx("button",{onClick:Ne,className:"bg-[#353535] hover:bg-gray-600 text-white p-1 rounded-lg focus:outline-none focus:ring-0 border-none",children:i.jsx("span",{className:"w-6 h-6",children:i.jsx(Xa,{className:"text-gray-300 w-4 h-4 -rotate-180"})})}),i.jsx("button",{onClick:fe,className:"bg-[#353535] hover:bg-gray-600 text-white p-1 rounded-lg focus:outline-none focus:ring-0 border-none",children:i.jsx("span",{className:"w-6 h-6",children:i.jsx(Xa,{className:"text-gray-300 w-4 h-4 "})})})]}),i.jsx("div",{className:"w-full max-w-[1260px] h-full overflow-x-scroll relative overflow-y-scroll flex-grow",ref:V,children:i.jsxs("table",{className:"w-full relative mb-20",children:[i.jsx("thead",{className:"sticky top-0 z-[3] bg-[#161616] whitespace-nowrap",children:i.jsxs("tr",{className:"w-full z-[4] text-[#9b9b9b] text-[13px] font-semibold font-manrope leading-[13px] tracking-tight",children:[i.jsx("th",{scope:"col",className:"font-medium sm:sticky bg-[#161616] sm:left-0 h-8 pl-3 min-w-[130px] sm:min-w-[130px] z-[8]",children:i.jsx("div",{className:"flex items-center justify-start w-full min-w-max sticky left-0 h-8",children:i.jsx("div",{className:"flex items-center justify-start",children:"Actions"})})}),i.jsx("th",{scope:"col",className:"sm:sticky bg-[#161616] sm:left-[130px] h-10 px-1 min-w-[130px] sm:min-w-[150px] z-[8]",children:i.jsx(hi,{title:"Tag",sortKey:"tag",sortOption:ne,setSortOption:J,isFilterIcon:!1})}),i.jsx("th",{scope:"col",className:"sm:sticky bg-[#161616] left-[260px] sm:left-[280px] h-10 px-1 min-w-[135px] sm:min-w-[195px] z-[8]",children:i.jsx(hi,{title:"Wallet",sortKey:"wallet_address",sortOption:ne,setSortOption:J,isFilterIcon:!1})}),i.jsx("th",{scope:"col",className:"min-w-[140px] sm:min-w-[130px] px-1",children:i.jsx(hi,{title:"Perp Equity",sortKey:"perp_equity",sortOption:ne,setSortOption:J,isFilterIcon:!0})}),i.jsx("th",{scope:"col",className:"min-w-[130px] sm:min-w-[144px] px-1",children:i.jsx(hi,{title:"Margin Usage",sortKey:"margin_usage",sortOption:ne,setSortOption:J,isFilterIcon:!0})}),i.jsx("th",{scope:"col",className:"min-w-[120px] sm:min-w-[150px] px-1",children:i.jsx(hi,{title:"uPnL",sortKey:"unrealizedPnl",sortOption:ne,setSortOption:J,isFilterIcon:!0})}),i.jsx("th",{scope:"col",className:"min-w-max pl-6 sm:pl-12 pr-1",children:i.jsxs("div",{className:"flex justify-end items-center w-full gap-1",children:[i.jsx("div",{className:"flex justify-end items-center gap-1 w-full",children:i.jsxs("div",{className:"flex justify-end items-center has-tooltip relative",children:[i.jsx(Ni,{className:"text-[#7C7C7C] w-4 min-w-4 min-h-4 h-4"}),i.jsx("span",{className:"",children:i.jsx(ro,{content:"Trackers stay active for 15 days. If not renewed, they will automatically stop after that period.",positionTop:!1,alignRight:!1,tooltipCss:"max-w-[200px] min-w-[200px] leading-[16px] -mb-[52px]"})})]})}),i.jsx(hi,{title:"Expire Date",sortKey:"expire_date",sortOption:ne,setSortOption:J,isFilterIcon:!0})]})}),i.jsx("th",{scope:"col",className:"min-w-max pl-1 pr-4",children:i.jsx("div",{className:"flex justify-end items-center w-full gap-1"})})]})}),i.jsx("tbody",{children:!r||t?i.jsx("tr",{className:"text-center w-full h-full",children:i.jsx("td",{colSpan:ge(window.innerWidth),className:"h-[30vh]",children:i.jsx("div",{className:"flex min-h-[66vh] flex-col justify-center items-center -mt-16 ml-[45%] w-max",children:i.jsx(Da,{})})})}):n&&!r?i.jsx("tr",{className:"text-center w-full h-full",children:i.jsx("td",{colSpan:ge(window.innerWidth),className:"h-[30vh]",children:i.jsx("div",{className:"flex min-h-[66vh] flex-col justify-center items-center ml-[33%] w-max",children:i.jsx(zl,{})})})}):(r==null?void 0:r.length)==0?i.jsx("tr",{className:"text-center w-full h-full",children:i.jsx("td",{colSpan:ge(window.innerWidth),className:"h-[30vh]",children:i.jsx("div",{className:"flex min-h-[44vh] h-66 flex-col justify-center items-center ml-[33%] w-max",children:i.jsx("div",{className:"flex items-center justify-center gap-4 px-4 py-2 flex-col",children:i.jsxs("div",{className:"flex flex-col justify-center items-center gap-3 -ml-16",children:[i.jsx("img",{src:ac,alt:""}),i.jsxs("div",{className:"flex flex-col items-center h-max gap-3",children:[i.jsx("div",{className:"text-[#d3d3d3] text-sm font-semibold font-manrope leading-[8px] pt-3",children:"You have not yet added a wallet to your follow list."}),i.jsxs("div",{className:"text-center -mt-2",children:[i.jsxs("span",{className:"text-[#979797] text-[13px] font-normal font-manrope leading-[14px] tracking-wide",children:["Please visit the"," "]}),i.jsx("span",{className:"text-white text-[13px] font-normal font-manrope leading-[14px] tracking-wide",children:"'Discover Wallets'"}),i.jsxs("span",{className:"text-[#979797] text-[13px] font-normal font-manrope leading-[14px] tracking-wide",children:[" ","page to follow wallets."]})]})]})]})})})})}):(ye=X(ne))==null?void 0:ye.map((ve,je)=>{var Le,Qe;const Ie=I.find($e=>$e.wallet_address===ve.wallet_address);return i.jsxs("tr",{className:`${je%2===0,"bg-[#161616]"} relative group hover:bg-[#222222] h-[56px] border-b border-[#232323] text-white`,children:[i.jsx("td",{scope:"row",className:`${je%2==0,"bg-[#161616]"} sm:sticky sm:left-0 z-[2] group-hover:bg-[#222222]`,children:i.jsx("div",{className:"group-hover:bg-[#222222] flex justify-start items-center gap-2 pl-2 h-14 max-h-14",children:i.jsxs("div",{className:"flex justify-start items-center gap-1.5",children:[i.jsx("div",{onClick:$e=>{$e.preventDefault();const it=e==null?void 0:e.some(tt=>tt.wallet_address===(ve==null?void 0:ve.wallet_address));re({walletAddress:ve==null?void 0:ve.wallet_address,isFollow:it,isScalper:ve==null?void 0:ve.is_scalper})},className:`${e!=null&&e.some($e=>$e.wallet_address===(ve==null?void 0:ve.wallet_address))?"bg-[#67ffbd] text-[#161616] font-semibold":"border border-[#67ffbd] bg-[#161616] text-[#67ffbd] hover:bg-[#67ffbd] hover:text-[#161616] font-bold"} h-[22px] rounded-[256px] justify-center items-center gap-1 inline-flex cursor-pointer text-xs font-['Manrope'] leading-[8px] tracking-tight px-2 min-w-max`,children:"Copy Trade"}),i.jsx(v5,{walletAddress:ve==null?void 0:ve.wallet_address,children:i.jsx("div",{className:"w-[18px] h-[18px] justify-center items-center flex cursor-pointer",children:o.some($e=>$e.wallet_address===(ve==null?void 0:ve.wallet_address))?i.jsx("img",{src:o5,alt:"",className:"w-3.5 h-3.5 min-w-3.5 min-h-3.5"}):i.jsx("img",{src:NA,alt:"",className:"w-3.5 h-3.5 min-w-3.5 min-h-3.5"})})})]})})}),i.jsx("td",{scope:"row",className:`${je%2===0,"bg-[#161616]"} sm:sticky sm:left-[130px] z-[2] group-hover:bg-[#222222]`,children:i.jsx("div",{className:"group-hover:bg-[#222222] flex justify-start items-center gap-4 min-h-[56px]",children:i.jsx("div",{className:"group-hover:bg-[#222222] flex justify-start items-center gap-2 h-16 max-h-16",children:i.jsxs("div",{className:"flex justify-start items-center gap-1.5 has-tooltip relative",children:[i.jsx(aa,{info1:ve!=null&&ve.tag?(ve==null?void 0:ve.tag.length)>=13?(ve==null?void 0:ve.tag).slice(0,13)+"...":ve==null?void 0:ve.tag:"--",info1_Color:"text-white",rowTwo:!1}),(ve==null?void 0:ve.tag)&&(ve==null?void 0:ve.tag.length)>=13&&i.jsx("span",{className:"-ml-[9px]",children:i.jsx(Fa,{content:`${ve==null?void 0:ve.tag}`,positionTop:!0,alignRight:!1})})]})})})}),i.jsx("td",{scope:"row",className:`${je%2===0,"bg-[#161616]"} sm:sticky sm:left-[280px] z-[2] group-hover:bg-[#222222]`,children:i.jsx("div",{className:"group-hover:bg-[#222222] flex justify-start items-center gap-4 min-h-[56px]",children:i.jsxs("div",{onClick:()=>{window.open(`/wallet-details/${ve==null?void 0:ve.wallet_address}`,"_blank")},className:"cursor-pointer group-hover:bg-[#222222] flex justify-start items-center gap-2 h-16 max-h-16",children:[i.jsx("div",{className:"fle justify-center items-center",children:i.jsx("div",{className:"w-4 h-4 sm:w-8 sm:h-8 bg-[#4a4a4a] rounded-full",children:i.jsx("img",{src:Gi,alt:"dextra",className:"w-4 h-4 sm:w-8 sm:h-8",loading:"lazy",onError:$e=>{$e.target.onerror=null,$e.target.src="https://app.dextrabot.com/dextrabotIcon.png"}})})}),i.jsxs("div",{className:"flex justify-start items-center gap-1.5",children:[i.jsx(aa,{info1:`${(ve==null?void 0:ve.wallet_address).slice(0,5)+"..."+(ve==null?void 0:ve.wallet_address).slice(-4)}`,info1_Color:"text-white",rowTwo:!1}),i.jsx("img",{onClick:$e=>{$e.stopPropagation(),navigator.clipboard.writeText(ve==null?void 0:ve.wallet_address),rn.success("Successfully copied.",{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(103, 255, 189, 0.16)",width:"280px",minWidth:"280px",height:"40px",backdropFilter:"blur(16px)"},iconTheme:{primary:"#67FFBD",secondary:"#276047"}})},src:wo,alt:"",className:"cursor-pointer"})]})]})})}),i.jsx("td",{className:"pr-1",children:F?i.jsx(Jm,{info:"Loading...",textColor:"text-white"}):Ie?i.jsx(Jm,{info:(Ie==null?void 0:Ie.perp_equity)!=0?`$${Er(Ie==null?void 0:Ie.perp_equity)}`:"$0",textColor:"text-white"}):i.jsx(Jm,{info:"Loading...",textColor:"text-white"})}),i.jsx("td",{className:"pr-1",children:F?i.jsx(Jm,{info:"Loading...",textColor:"text-white"}):Ie?i.jsx(Jm,{info:isNaN(Ie==null?void 0:Ie.margin_usage)?"0%":`${((Ie==null?void 0:Ie.margin_usage)*100).toFixed(2)}%`,textColor:"text-white"}):i.jsx(Jm,{info:"Loading...",textColor:"text-white"})}),i.jsx("td",{className:"pr-1",children:F?i.jsx(Jm,{info:"Loading...",textColor:"text-white"}):Ie?i.jsx(Jm,{info:(Ie==null?void 0:Ie.data)!=0?`$${Er(Math.abs((Le=Ie==null?void 0:Ie.data)==null?void 0:Le.reduce(($e,it)=>$e+parseFloat(it.unrealizedPnl||0),0)))}`:"$0",textColor:`${((Qe=Ie==null?void 0:Ie.data)==null?void 0:Qe.reduce(($e,it)=>$e+parseFloat(it.unrealizedPnl),0))>=0?"text-[#4ae3b5]":"text-[#ff6b6b]"}`}):i.jsx(Jm,{info:"Loading...",textColor:"text-white"})}),i.jsx("td",{className:"pr-1 min-w-max pl-6 sm:pl-12",children:i.jsxs("div",{className:"flex justify-end items-center gap-0.5 min-w-max",children:[he(ve==null?void 0:ve.expire_date)&&i.jsxs("div",{className:"flex justify-end items-center has-tooltip relative min-w-max",children:[i.jsx("img",{src:kyt,alt:"",className:"w-[14px] min-w-[14px] min-h-[14px] h-[14px]"}),i.jsx("span",{className:"",children:i.jsx(ro,{content:`This tracker will expire on ${p3(ve==null?void 0:ve.expire_date)}. Click ‘Renew’ to keep it active.`,positionTop:!1,alignRight:!1,tooltipCss:"max-w-[210px] min-w-[210px] leading-[16px] -mb-[36px]"})})]}),i.jsx(Jm,{info:ve!=null&&ve.expire_date?p3(ve==null?void 0:ve.expire_date):"--",textColor:"text-white"})]})}),i.jsx("td",{className:"pr-4 min-w-max pl-1",children:i.jsx("div",{className:"flex justify-end items-center gap-0.5 min-w-max",children:he(ve==null?void 0:ve.expire_date)&&(L[ve==null?void 0:ve.wallet_address]?i.jsxs("div",{role:"status",className:"flex justify-center items-center h-5 min-h-5 w-[67px] px-2 py-1.5 rounded-md",children:[i.jsxs("svg",{"aria-hidden":"true",className:"inline w-[14px] h-4 text-gray-200 animate-spin dark:text-gray-600 fill-[#67FFBD]",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),i.jsx("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]}),i.jsx("span",{className:"sr-only",children:"Loading..."})]}):i.jsxs("div",{onClick:()=>{G(ve==null?void 0:ve.id,ve==null?void 0:ve.wallet_address)},className:"h-[21px] px-1 py-1.5 bg-[#ffaa47]/20 hover:bg-[#ffaa47]/30 rounded-md flex justify-start items-center gap-1 cursor-pointer ml-[6px]",children:[i.jsx("img",{src:Tyt,alt:""}),i.jsx("div",{className:"justify-start text-[#ffaa46] text-[11px] font-semibold font-['Manrope'] leading-[8px]",children:"Renew"})]}))})})]},je)})})]})})]})]})]})},Jm=({info:e,textColor:t})=>i.jsx("div",{className:"flex flex-col items-end gap-0.5",children:i.jsx("div",{className:`${t} text-sm font-semibold font-manrope leading-none flex items-center justify-start pl-1 gap-0.5`,children:e})}),fU=()=>{const{isConnected:e}=ns(),{openConnectModal:t}=y5(),{walletLogin:n,signIn:r}=m.useContext(Qr),s=typeof window<"u"&&window.matchMedia("(max-width: 640px)").matches,a=()=>{window.localStorage.getItem("hyperToken")?n():r(1)};return i.jsxs("div",{className:"flex flex-col justify-center items-center gap-8 w-[400px] h-max bg-[#252525] rounded-3xl py-4 font-manrope",children:[i.jsx("img",{src:Gi,alt:"",className:"w-[86px] h-[86px] mt-4"}),i.jsxs("div",{className:"flex flex-col items-center gap-2",children:[i.jsx("div",{className:"text-white text-[32px] leading-none",children:"Welcome Dextrabot"}),i.jsx("div",{className:"text-white/60 text-sm leading-none",children:s?"Scan the QR code to continue":"Connect your wallet to continue"})]}),i.jsx("div",{className:"flex justify-center items-center w-[348px] h-12 bg-[#7536ff] rounded-2xl cursor-pointer my-10 text-center",children:e?s?i.jsx(t_,{}):i.jsx("div",{onClick:a,className:"flex justify-center items-center w-[348px] h-12 bg-[#7536ff] rounded-2xl cursor-pointer",children:i.jsx("span",{className:"text-white text-sm leading-none",children:"Wallet Sign‑in"})}):i.jsx("div",{onClick:()=>s?null:t(),className:"flex justify-center items-center w-[348px] h-12 bg-[#7536ff] rounded-2xl cursor-pointer",children:i.jsx("span",{className:"text-white text-sm leading-none",children:s?i.jsx(t_,{}):"Connect Wallet"})})}),i.jsxs("div",{className:"text-center pt-2",children:[i.jsx("span",{className:"text-white/60 text-xs",children:"Do you need support? "}),i.jsx("span",{className:"text-[#b593ff] text-xs cursor-not-allowed",children:"Join Discord"})]})]})},Hin=()=>{const[e,t]=m.useState(!1),[n,r]=m.useState(!1);ns();const{hyperToken:s,copyTradeWatchList:a,getCopyTradeWatchList:o,trackedWatchList:l,setTrackedWatchList:c,getTrackedWatchList:u,trackedWatchListLoading:d,trackedWatchListError:f,setTelegramChatId:x,setSubscriberRole:g,setSubsExpireDay:v,setMushboomerETH:w,setMushboomerSOL:C,setIsReferralCode:N,setIsReferralCodeName:P,setIsWhitelist:I,setHyperToken:R,setHyperAddress:F}=m.useContext(Qr);return m.useEffect(()=>{!n&&window.localStorage.getItem("hyperToken")&&(o(),u(),t(!0),r(!0))},[n,s]),m.useEffect(()=>{(async()=>{var Q,ne;const L=window.localStorage.getItem("hyperToken"),z=window.localStorage.getItem("hyperAddress");if(!(!L||!z))try{const J=await Ei(z,L);J!=null&&J.success?(x(J==null?void 0:J.telegram_chat_id),g(J==null?void 0:J.subscriber_role),v(J==null?void 0:J.subs_expire_day),w((Q=J==null?void 0:J.mushboomer_counts)==null?void 0:Q.eth),C((ne=J==null?void 0:J.mushboomer_counts)==null?void 0:ne.sol),N(J==null?void 0:J.referral_code),P(J==null?void 0:J.refcode),I(J==null?void 0:J.whitelist),R(L),F(z)):(window.localStorage.removeItem("hyperToken"),window.localStorage.removeItem("hyperAddress"),R(""),F(""))}catch(J){console.error("Token verification error:",J),console.error(J.message||"An unknown error occurred.")}})()},[]),i.jsxs(i.Fragment,{children:[i.jsx(So,{children:i.jsxs(Ro,{children:[i.jsx("title",{children:"Track & Follow Your Favorite Hyperliquids Wallets - Dextrabot"}),i.jsx("meta",{name:"description",content:"Track and follow your favorite HyperLiquid wallets with DextraBot. Get real-time updates on their transactions and trading activity to make smarter moves."}),i.jsx("meta",{name:"og:title",content:"Track & Follow Your Favorite Hyperliquids Wallets - Dextrabot"}),i.jsx("meta",{name:"og:description",content:"Track and follow your favorite HyperLiquid wallets with DextraBot. Get real-time updates on their transactions and trading activity to make smarter moves."}),i.jsx("meta",{name:"og:image",content:"https://app.dextrabot.com/dextrabotIcon.png"}),i.jsx("meta",{name:"og:url",content:"https://app.dextrabot.com/tracked-wallets"})]})}),i.jsx("div",{style:{height:"calc(100vh - 5rem)"},className:"flex justify-center items-center w-full h-full px-1 pt-1 sm:px-6 sm:pt-6 bg-[#161616] overflow-hidden",children:i.jsx("div",{className:"flex flex-col items-stretch justify-center h-full gap-[26px] w-full xl:w-max flex-grow xl:flex-grow-0",children:window.localStorage.getItem("hyperToken")?i.jsx(zin,{data:a,loading:d,error:f,trackerData:l,isRequest:e,setIsRequest:t}):i.jsx("div",{className:"flex justify-center items-center w-full",children:i.jsx(fU,{})})})})]})},Vin=()=>{m.useRef([]);const e=m.useRef(null),{isConnected:t,address:n}=ns(),{setSignModalOpen:r,trackedWatchList:s,hyperToken:a}=m.useContext(Qr),o=m.useRef(a),[l,c]=m.useState(!1),d=localStorage.getItem("isDateTrackedWalletsFormat")||"date",[f,x]=m.useState(d);m.useEffect(()=>{localStorage.setItem("isDateTrackedWalletsFormat",f)},[f]);const[g,v]=m.useState([]);function w(L){const z={};return L.forEach(ne=>{const{oid:J,px:X,dir:re,side:pe,crossed:Y,feeToken:ie,listen_user:oe,cloid:G,coin:V,subs_address:ee,sz:ae,closedPnl:fe,fee:Ne,time:he,startPosition:ge,insert_date:ye,hash:ve}=ne;z[J]||(z[J]={oid:J,px:X,dir:re,side:pe,crossed:Y,feeToken:ie,listen_user:oe,cloid:G,coin:V,subs_address:ee,totalSize:0,totalStartPositions:0,totalClosedPnl:0,totalFee:0,closestTime:he,earliestStartPosition:ge,insertDate:ye,hashes:[],hasZeroStartPosition:!1}),parseFloat(ge)===0&&(z[J].hasZeroStartPosition=!0),z[J].hasZeroStartPosition?z[J].totalStartPositions=0:z[J].totalStartPositions+=parseFloat(ge),z[J].totalSize+=parseFloat(ae),z[J].totalClosedPnl+=parseFloat(fe),z[J].totalFee+=parseFloat(Ne),new Date(he)>new Date(z[J].closestTime)&&(z[J].closestTime=he),new Date(he)>new Date(z[J].insertDate)&&(z[J].insertDate=ye),new Date(he)<new Date(z[J].closestTime)&&(z[J].earliestStartPosition=ge),z[J].hashes.push(ve)}),Object.keys(z).map(ne=>({oid:ne,...z[ne]}))}async function C(){const L=window.localStorage.getItem("hyperToken");try{c(!0);const z="https://dextrabothypev2.nftinit.io/api/hyper/feed/",Q=window.localStorage.getItem("hyperAddress");L||r(!0);const ne=await fetch(z,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:n?n.toLowerCase():Q,token:L,offset:0})});if(!ne.ok)throw new Error(`Server responded with status ${ne.status}`);const J=await ne.json();if(J.success){const X=w(J==null?void 0:J.data);v(X)}else console.log(J.error_message)}catch(z){console.log("Error :>> ",z),c(!1)}finally{c(!1)}}m.useEffect(()=>{C()},[window.localStorage.getItem("hyperToken")]);function N(L,z){const Q={};return L.forEach(ne=>{Q[ne.oid]={...ne}}),z.forEach(ne=>{const{oid:J,px:X,dir:re,side:pe,crossed:Y,feeToken:ie,listen_user:oe,cloid:G,coin:V,subs_address:ee,sz:ae,closedPnl:fe,fee:Ne,time:he,startPosition:ge,insert_date:ye,hash:ve}=ne;Q[J]||(Q[J]={oid:J,px:X,dir:re,side:pe,crossed:Y,feeToken:ie,listen_user:oe,cloid:G,coin:V,subs_address:ee,totalSize:0,totalStartPositions:0,totalClosedPnl:0,totalFee:0,closestTime:he,earliestStartPosition:ge,insertDate:ye,hashes:[],hasZeroStartPosition:!1}),parseFloat(ge)===0&&(Q[J].hasZeroStartPosition=!0),Q[J].hasZeroStartPosition?Q[J].totalStartPositions=0:Q[J].totalStartPositions+=parseFloat(ge),Q[J].totalSize+=parseFloat(ae),Q[J].totalClosedPnl+=parseFloat(fe),Q[J].totalFee+=parseFloat(Ne),new Date(he)>new Date(Q[J].closestTime)&&(Q[J].closestTime=he),new Date(he)>new Date(Q[J].insertDate)&&(Q[J].insertDate=ye),new Date(he)<new Date(Q[J].closestTime)&&(Q[J].earliestStartPosition=ge),Q[J].hashes.push(ve)}),Object.values(Q).sort((ne,J)=>new Date(J.closestTime)-new Date(ne.closestTime))}const P=m.useRef(!1),I=m.useRef(n),R=m.useRef(s);m.useEffect(()=>{I.current=n},[n]),m.useEffect(()=>{o.current=a},[a]),m.useEffect(()=>{R.current=s},[s]);const F="hyper_get_message";m.useEffect(()=>{if(!a||P.current)return;const L=Ny("https://dextrabothypesocketv2.nftinit.io/");return e.current=L,P.current=!0,e.current.on("connect",()=>{console.log("Socket connected");const z=()=>{var J;const Q=(J=I.current)==null?void 0:J.toLowerCase(),ne=o.current;Q&&ne?L.emit("subscribe",{login:Q,token:ne}):setTimeout(z,300)};z()}),e.current.on(F,function(z){if(z){const Q=Array.isArray(z)?z:[z];v(ne=>{const J=N([],Q);let X=ne.filter(Y=>Q.some(ie=>ie.oid===Y.oid)),re=[];X.length>0?re=N(J,X):re=J;const pe=ne.filter(Y=>!Q.some(ie=>ie.oid===Y.oid));return[...re,...pe]})}}),e.current.io.on("reconnect_attempt",z=>{console.log("reconnect_attempt",z)}),e.current.io.on("reconnect",z=>{console.log("reconnect",z),e.current.emit("room",F)}),e.current.io.on("reconnect_failed",()=>{console.log("reconnect_failed")}),e.current.io.on("reconnect_error",z=>{console.log("reconnect_error",z)}),e.current.io.on("error",z=>{console.log("error",z)}),e.current.on("disconnect",()=>{console.log("Socket disconnected"),P.current=!1}),()=>{e.current.disconnect(),console.log("Socket cleanup on unmount")}},[a]);function U({date:L}){const[z,Q]=m.useState(Mo(L));return m.useEffect(()=>{const ne=setInterval(()=>{Q(Mo(L))},1e3);return()=>clearInterval(ne)},[L]),i.jsx("span",{className:"text-[#a5a5a5] text-[11px] font-normal font-manrope leading-[13px] tracking-tight",children:z.dateTime})}return i.jsx("div",{className:"flex flex-col items-start justify-start mt-4 overflow-scroll max-h-full",children:!g||g.length==0?i.jsx("div",{className:"flex w-full justify-center items-center",children:i.jsx("div",{className:"flex min-h-[36vh] w-[100%] sm:w-[75%] min-w-[880px] max-w-[700px] justify-center items-center text-center mt-44",children:l?i.jsx(Da,{}):i.jsx("div",{className:"flex justify-center items-center min-w-[480px]",children:i.jsxs("div",{className:"flex flex-col justify-center items-center gap-3 min-w-max overflow-x-hidden",children:[i.jsx("img",{src:ac,alt:""}),i.jsxs("div",{className:"flex flex-col items-center h-max gap-3",children:[i.jsx("div",{className:"text-[#d3d3d3] text-sm font-semibold font-manrope leading-[8px] pt-3",children:"The activities of the favorited wallets will be displayed on this page."}),i.jsx("div",{className:"text-center -mt-2",children:i.jsxs("span",{className:"text-[#979797] text-[13px] font-normal font-manrope leading-[14px] tracking-wide",children:["Feed page includes the activities occur after a wallet is favorited."," "]})})]})]})})})}):i.jsx("ul",{className:"flex flex-col items-start justify-start gap-1",children:Array.isArray(g)&&g.slice(0,250).map(L=>{var z,Q,ne,J,X,re,pe;return i.jsx("li",{children:i.jsxs("div",{className:"flex justify-start items-start gap-[11px]",children:[i.jsxs("div",{className:"flex flex-col items-start justify-start h-full",children:[i.jsx("div",{className:`${(z=L==null?void 0:L.dir)!=null&&z.includes("Long")?(L==null?void 0:L.dir)==="Short > Long"?"bg-[#67ffbd]/20":(L==null?void 0:L.dir)==="Long > Short"?"bg-[#ff797c]/20":"bg-[#67ffbd]/20":(L==null?void 0:L.dir)=="Buy"?"bg-[#67ffbd]/20":"bg-[#ff797c]/20"} flex justify-center items-center w-6 h-6 rounded-full`,children:i.jsx("div",{className:"w-3 h-3 relative",children:(Q=L==null?void 0:L.dir)!=null&&Q.includes("Long")?(L==null?void 0:L.dir)==="Short > Long"?i.jsx(Ps,{className:"text-[#67FFBD] rotate-180 w-3 h-3"}):(L==null?void 0:L.dir)==="Long > Short"?i.jsx(Ps,{className:"text-[#FF797C] w-3 h-3"}):i.jsx(Ps,{className:"text-[#67FFBD] rotate-180 w-3 h-3"}):(L==null?void 0:L.dir)=="Buy"?i.jsx(Ps,{className:"text-[#67FFBD] rotate-180 w-3 h-3"}):i.jsx(Ps,{className:"text-[#FF797C] w-3 h-3"})})}),i.jsx("div",{className:"flex justify-center w-6",children:i.jsx("div",{className:"w-[1px] min-h-[123px] h-full border border-[#242424]"})})]}),i.jsxs("div",{className:"flex flex-col items-start justify-start gap-[6px] min-w-[640px] w-full h-[138px] min-h-[138px] rounded-[18px] border border-[#232323] p-2",children:[i.jsxs("div",{className:"flex justify-between items-center gap-2 w-full px-1",children:[i.jsxs("div",{className:"flex justify-start items-center gap-1.5",children:[i.jsx("div",{className:"w-8 h-8 bg-[#6ed8ff] rounded-full",children:i.jsx("img",{src:Gi,alt:"",className:"w-8 h-8"})}),i.jsxs("div",{className:"flex flex-col items-start justify-center gap-[2px] ",children:[i.jsxs("div",{onClick:()=>{window.open(`/wallet-details/${L==null?void 0:L.listen_user}`,"_blank")},className:"flex justify-start items-center gap-1.5 cursor-pointer",children:[i.jsx("div",{className:"text-white text-base font-semibold font-manrope leading-none",children:(L==null?void 0:L.listen_user)&&((ne=L==null?void 0:L.listen_user)==null?void 0:ne.slice(0,5))+"..."+((J=L==null?void 0:L.listen_user)==null?void 0:J.slice(-4))}),i.jsx("img",{onClick:Y=>{Y.stopPropagation(),navigator.clipboard.writeText(L==null?void 0:L.listen_user),rn.success("Successfully copied.",{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(103, 255, 189, 0.16)",width:"280px",minWidth:"280px",height:"40px",backdropFilter:"blur(16px)"},iconTheme:{primary:"#67FFBD",secondary:"#276047"}})},src:wo,alt:"",className:"cursor-pointer"})]}),i.jsxs("div",{className:"flex justify-start items-center gap-1.5 text-[#a5a5a5] text-[11px] font-normal font-manrope leading-[13px] tracking-tight",children:[i.jsxs("span",{className:"text-white text-[11px] font-normal font-['Manrope'] leading-[13px] tracking-tight min-w-max ml-[1px]",children:["Order ID:"," ",i.jsx("span",{className:"text-[#a5a5a5]",children:(L==null?void 0:L.oid)&&(L==null?void 0:L.oid)})]}),i.jsx("span",{onClick:Y=>{Y.stopPropagation(),navigator.clipboard.writeText(L==null?void 0:L.oid),rn.success("Successfully copied.",{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(103, 255, 189, 0.16)",width:"280px",minWidth:"280px",height:"40px",backdropFilter:"blur(16px)"},iconTheme:{primary:"#67FFBD",secondary:"#276047"}})},className:"cursor-pointer pr-0.5",children:i.jsx("img",{src:wo,alt:"",className:"w-3.5 h-3.5 min-w-3.5 min-h-3.5"})})]})]})]}),i.jsxs("div",{className:"flex flex-col items-end justify-start gap-[2px] w-full pl-2 pt-2",children:[i.jsx("div",{onClick:()=>{x(f=="time"?"date":"time")},className:"text-[#a5a5a5] text-[11px] font-normal font-manrope leading-[13px] tracking-tight cursor-pointer",children:f=="time"?i.jsx(U,{date:L==null?void 0:L.closestTime}):su(L==null?void 0:L.closestTime)}),i.jsxs("div",{className:"flex justify-start items-center gap-2 -m-[2px]",children:[i.jsxs("div",{children:[i.jsxs("span",{className:"text-[#9b9b9b] text-[13px] font-normal font-manrope leading-[21px] tracking-tight",children:["opened a new"," ",(L==null?void 0:L.dir)=="Sell"?"spot sell":(L==null?void 0:L.dir)=="Buy"?"spot buy":(X=L==null?void 0:L.dir)==null?void 0:X.toLowerCase()," ","position for"," "]}),i.jsxs("span",{className:"pl-1 text-white text-[13px] font-normal font-manrope leading-[21px] tracking-tight",children:[L==null?void 0:L.coin,"/",L==null?void 0:L.feeToken]})]}),i.jsx("div",{className:"w-5 h-5 bg-transparent rounded-[256px]",children:i.jsx("img",{src:`https://app.hyperliquid.xyz/coins/${L==null?void 0:L.coin}.svg`||Va,alt:L==null?void 0:L.coin,className:"rounded-full w-5 h-5 min-w-5 min-h-5",loading:"lazy",onError:Y=>ra(Y)})})]})]})]}),i.jsx("div",{className:"w-full min-w-[850px] h-[72px] min-h-[72px] bg-[#232323] rounded-xl border border-[#353535] pt-4 pl-4",children:i.jsxs("div",{className:"flex justify-start items-center gap-4 overflow-x-scroll scroll-smooth",children:[i.jsxs("div",{className:"sticky left-0 z-[8] bg-[#232323] flex justify-start items-center gap-4",children:[i.jsxs("div",{className:"flex flex-col justify-start items-start gap-1",children:[i.jsx("div",{className:"text-[#9b9b9b] text-xs font-normal font-manrope leading-[13px] tracking-wide",children:"Asset"}),i.jsxs("div",{className:"flex justify-start items-center gap-1",children:[i.jsx("div",{className:"w-5 h-5 bg-transparent rounded-[256px]",children:i.jsx("img",{src:`https://app.hyperliquid.xyz/coins/${L==null?void 0:L.coin}.svg`||Va,alt:L==null?void 0:L.coin,className:"rounded-full w-5 h-5 min-w-5 min-h-5",loading:"lazy",onError:Y=>ra(Y)})}),i.jsxs("div",{className:"text-white text-sm font-semibold font-manrope leading-[13px] tracking-tight",children:[L==null?void 0:L.coin,"/",L==null?void 0:L.feeToken]})]})]}),i.jsx("div",{className:"w-px h-8 bg-[#353535]"})]}),i.jsxs("div",{className:"flex justify-start items-center gap-4",children:[i.jsxs("div",{className:"flex flex-col justify-start items-start gap-1",children:[i.jsx("div",{className:"text-[#9b9b9b] text-xs font-normal font-manrope leading-[13px] tracking-wide",children:"Direction"}),i.jsx("div",{className:"flex justify-start items-center",children:i.jsxs("div",{className:`${(re=L==null?void 0:L.dir)!=null&&re.includes("Long")?(L==null?void 0:L.dir)==="Short > Long"?"text-[#67ffbd] bg-[#67ffbd]/20":(L==null?void 0:L.dir)==="Long > Short"?"text-[#ff787b] bg-[#ff797c]/20":"text-[#67ffbd] bg-[#67ffbd]/20":(L==null?void 0:L.dir)=="Buy"?"text-[#67ffbd] bg-[#67ffbd]/20":"text-[#ff787b] bg-[#ff797c]/20"} h-5 pl-1 pr-1.5 py-1 rounded-md justify-start items-center gap-0.5 inline-flex min-w-max`,children:[i.jsx("div",{className:"w-3 h-3 justify-center items-center flex",children:i.jsx("div",{className:"w-3 h-3 relative",children:(pe=L==null?void 0:L.dir)!=null&&pe.includes("Long")?(L==null?void 0:L.dir)==="Short > Long"?i.jsx(Ps,{className:"text-[#67FFBD] rotate-180 w-3 h-3"}):(L==null?void 0:L.dir)==="Long > Short"?i.jsx(Ps,{className:"text-[#FF797C] w-3 h-3"}):i.jsx(Ps,{className:"text-[#67FFBD] rotate-180 w-3 h-3"}):(L==null?void 0:L.dir)=="Buy"?i.jsx(Ps,{className:"text-[#67FFBD] rotate-180 w-3 h-3"}):i.jsx(Ps,{className:"text-[#FF797C] w-3 h-3"})})}),i.jsx("div",{className:"text-[11px] font-semibold font-manrope leading-[8px] tracking-wide",children:(L==null?void 0:L.dir)=="Sell"?"Sell":(L==null?void 0:L.dir)=="Buy"?"Buy":(L==null?void 0:L.dir)=="Close Short"?"Short":(L==null?void 0:L.dir)=="Close Long"?"Long":(L==null?void 0:L.dir)=="Open Short"?"Short":(L==null?void 0:L.dir)=="Open Long"?"Long":L==null?void 0:L.dir})]})})]}),i.jsx("div",{className:"w-px h-8 bg-[#353535]"})]}),i.jsxs("div",{className:"flex justify-start items-center gap-4",children:[i.jsx(cC,{title:"Type",value:(L==null?void 0:L.totalStartPositions)==0?"Open Position":(L==null?void 0:L.dir)!="Short > Long"&&(L==null?void 0:L.dir)!="Long > Short"?(L==null?void 0:L.totalSize)-Math.abs(L==null?void 0:L.totalStartPositions)==0&&((L==null?void 0:L.dir)=="Close Long"||(L==null?void 0:L.dir)=="Close Short")?"Position Closed":(L==null?void 0:L.dir)=="Open Short"||(L==null?void 0:L.dir)=="Open Long"?"Increase":(L==null?void 0:L.dir)=="Close Long"||(L==null?void 0:L.dir)=="Close Short"?"Decrease":(L==null?void 0:L.dir)=="Sell"||(L==null?void 0:L.dir)=="Buy"?"Spot":"Changed Position":(L==null?void 0:L.dir)=="Short > Long"||(L==null?void 0:L.dir)=="Long > Short"?"Changed Position":"Open Position",color:"text-white"}),i.jsx("div",{className:"w-px h-8 bg-[#353535]"})]}),i.jsxs("div",{className:"flex justify-start items-center gap-4",children:[i.jsx(cC,{title:"Price",value:Er(L==null?void 0:L.px),color:"text-white"}),i.jsx("div",{className:"w-px h-8 bg-[#353535]"})]}),i.jsxs("div",{className:"flex justify-start items-center gap-4",children:[i.jsx(cC,{title:"Size",value:Er(L==null?void 0:L.totalSize),color:"text-white"}),i.jsx("div",{className:"w-px h-8 bg-[#353535]"})]}),i.jsxs("div",{className:"flex justify-start items-center gap-4",children:[i.jsx(cC,{title:"PnL",value:L!=null&&L.totalClosedPnl?`$${Er(Math.abs(L==null?void 0:L.totalClosedPnl))}`:Er(Math.abs(L==null?void 0:L.totalClosedPnl)),color:`${(L==null?void 0:L.totalClosedPnl)>=0?"text-[#67ffbd]":"text-[#ff787b]"}`}),i.jsx("div",{className:"w-px h-8 bg-[#353535]"})]}),i.jsxs("div",{className:"flex justify-start items-center gap-4",children:[i.jsx(cC,{title:"Fee",value:L!=null&&L.totalFee?`$${Er(Math.abs(L==null?void 0:L.totalFee))}`:Er(Math.abs(L==null?void 0:L.totalFee)),color:`${(L==null?void 0:L.totalFee)>=0?"text-[#67ffbd]":"text-[#ff787b]"}`}),i.jsx("div",{className:"w-px h-8 bg-[#353535]"})]}),i.jsxs("div",{className:"flex justify-start items-center gap-4",children:[i.jsx(cC,{title:"Margin Mode",value:L!=null&&L.crossed?"Cross":"Isolated",color:"text-white"}),i.jsx("div",{className:"w-px h-8 bg-transparent"})]})]})})]})]})},L.oid)})})})},cC=({title:e,value:t,color:n})=>i.jsxs("div",{className:"flex flex-col justify-start items-start gap-1 min-w-max",children:[i.jsx("div",{className:"text-[#9b9b9b] text-xs font-normal font-manrope leading-[13px] tracking-wide min-w-max",children:e}),i.jsx("div",{className:"flex justify-start items-center min-w-max",children:i.jsx("div",{className:`${n} text-sm font-semibold font-manrope leading-[13px] tracking-tight min-w-max`,children:t})})]}),Win="https://dextrabothypesocketv2.nftinit.io/";function qin(){var Q,ne;const{isConnected:e,address:t}=ns(),{setSignModalOpen:n,trackedWatchList:r,hyperToken:s}=m.useContext(Qr),a=m.useRef(null),[o,l]=m.useState([]),[c,u]=m.useState(!1),f=localStorage.getItem("isDateTrackedWalletsFormat")||"date",[x,g]=m.useState(f),[v,w]=m.useState(null);function C({date:J}){const[X,re]=m.useState(Mo(J));return m.useEffect(()=>{const pe=setInterval(()=>re(Mo(J)),1e3);return()=>clearInterval(pe)},[J]),i.jsx("span",{className:"text-[11px] text-[#a5a5a5] font-normal",children:X.dateTime})}m.useEffect(()=>{localStorage.setItem("isDateTrackedWalletsFormat",x)},[x]);function N(J){const X={};return J.forEach(re=>{const{oid:pe,px:Y,dir:ie,side:oe,crossed:G,feeToken:V,listen_user:ee,cloid:ae,coin:fe,subs_address:Ne,sz:he,closedPnl:ge,fee:ye,time:ve,startPosition:je,insert_date:Ie,hash:Le}=re;X[pe]||(X[pe]={oid:pe,px:Y,dir:ie,side:oe,crossed:G,feeToken:V,listen_user:ee,cloid:ae,coin:fe,subs_address:Ne,totalSize:0,totalClosedPnl:0,totalFee:0,earliestStartPosition:je,hasZeroStartPosition:!1,closestTime:ve,insertDate:Ie,hashes:[]}),parseFloat(je)===0&&(X[pe].hasZeroStartPosition=!0),X[pe].totalSize+=parseFloat(he),X[pe].totalClosedPnl+=parseFloat(ge),X[pe].totalFee+=parseFloat(ye),new Date(ve)>new Date(X[pe].closestTime)&&(X[pe].closestTime=ve),new Date(ve)>new Date(X[pe].insertDate)&&(X[pe].insertDate=Ie),X[pe].hashes.push(Le)}),Object.keys(X).map(re=>({oid:re,...X[re]}))}async function P(){const J=window.localStorage.getItem("hyperToken");try{u(!0),J||n(!0);const X=await fetch("https://dextrabothypev2.nftinit.io/api/hyper/feed/",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:t.toLowerCase(),token:J,offset:0})});if(!X.ok)throw new Error(`Server responded with status ${X.status}`);const re=await X.json();if(re.success){const pe=N(re==null?void 0:re.data);l(pe)}}catch(X){console.log("Error :>> ",X)}finally{u(!1)}}function I(J,X){const re={};return J.forEach(pe=>{re[pe.oid]={...pe}}),X.forEach(pe=>{const{oid:Y,px:ie,dir:oe,side:G,crossed:V,feeToken:ee,listen_user:ae,cloid:fe,coin:Ne,subs_address:he,sz:ge,closedPnl:ye,fee:ve,time:je,startPosition:Ie,insert_date:Le,hash:Qe}=pe;re[Y]||(re[Y]={oid:Y,px:ie,dir:oe,side:G,crossed:V,feeToken:ee,listen_user:ae,cloid:fe,coin:Ne,subs_address:he,totalSize:0,totalClosedPnl:0,totalFee:0,hasZeroStartPosition:!1,earliestStartPosition:Ie,closestTime:je,insertDate:Le,hashes:[]}),parseFloat(Ie)===0&&(re[Y].hasZeroStartPosition=!0),re[Y].totalSize+=parseFloat(ge),re[Y].totalClosedPnl+=parseFloat(ye),re[Y].totalFee+=parseFloat(ve),new Date(je)>new Date(re[Y].closestTime)&&(re[Y].closestTime=je),new Date(je)>new Date(re[Y].insertDate)&&(re[Y].insertDate=Le),re[Y].hashes.push(Qe)}),Object.values(re).sort((pe,Y)=>new Date(Y.closestTime)-new Date(pe.closestTime))}m.useEffect(()=>{P()},[window.localStorage.getItem("hyperToken")]),m.useEffect(()=>{a.current=Ny(Win);const J=window.localStorage.getItem("hyperToken");return a.current.on("connect",()=>{r==null||r.map(X=>X.wallet_address),a.current.emit("subscribe",{login:t.toLowerCase(),token:J})}),a.current.on("hyper_get_message",X=>{if(X){const re=Array.isArray(X)?X:[X];l(pe=>{const Y=I([],re);let ie=pe.filter(V=>re.some(ee=>ee.oid===V.oid)),oe=[];ie.length>0?oe=I(Y,ie):oe=Y;const G=pe.filter(V=>!re.some(ee=>ee.oid===V.oid));return[...oe,...G]})}}),()=>{a.current.disconnect()}},[s]);const R=J=>J?J.includes("Long")?J==="Short > Long"?"bg-[#67ffbd]/20 text-[#67ffbd]":J==="Long > Short"?"bg-[#ff797c]/20 text-[#ff797c]":"bg-[#67ffbd]/20 text-[#67ffbd]":J==="Buy"?"bg-[#67ffbd]/20 text-[#67ffbd]":"bg-[#ff797c]/20 text-[#ff797c]":"bg-[#767676]/20 text-[#cccccc]",F=J=>J?J.includes("Long")?J==="Short > Long"?i.jsx(Ps,{className:"text-[#67ffbd] rotate-180 w-3 h-3"}):J==="Long > Short"?i.jsx(Ps,{className:"text-[#ff797c] w-3 h-3"}):i.jsx(Ps,{className:"text-[#67ffbd] rotate-180 w-3 h-3"}):J==="Buy"?i.jsx(Ps,{className:"text-[#67ffbd] rotate-180 w-3 h-3"}):i.jsx(Ps,{className:"text-[#ff797c] w-3 h-3"}):i.jsx(Ps,{className:"text-[#767676] w-3 h-3"}),U=J=>{const X=J==null?void 0:J.hasZeroStartPosition,re=J.dir==="Close Short"||J.dir==="Close Long"||J.dir==="Short > Long"||J.dir==="Long > Short";return X||re?{text:"Closed",icon:pM}:{text:"Open",icon:mM}},L=J=>w(J),z=()=>w(null);return i.jsxs("div",{className:"flex flex-col w-full pb-2",children:[!o||o.length===0?i.jsx("div",{className:"flex w-full justify-center items-center",children:i.jsx("div",{className:"flex min-h-[36vh] w-full sm:w-[75%] max-w-[700px] justify-center items-center text-center mt-44",children:c?i.jsx(Da,{}):i.jsx("div",{className:"flex justify-center items-center min-w-[320px]",children:i.jsxs("div",{className:"flex flex-col justify-center items-center gap-3 min-w-max overflow-x-hidden",children:[i.jsx("img",{src:ac,alt:""}),i.jsxs("div",{className:"flex flex-col items-center h-max gap-3",children:[i.jsx("div",{className:"text-[#d3d3d3] text-sm font-semibold font-manrope leading-[8px] pt-3",children:"The activities of the favorited wallets will be displayed on this page."}),i.jsx("div",{className:"text-center -mt-2",children:i.jsx("span",{className:"text-[#979797] text-[13px] font-normal font-manrope leading-[14px] tracking-wide",children:"Feed page includes the activities occur after a wallet is favorited."})})]})]})})})}):i.jsx("div",{className:"flex flex-col gap-3 w-full mt-3",children:o.slice(0,250).map(J=>(U(J),i.jsxs("div",{className:"border-2 border-[#232323] rounded-xl p-3 flex items-start gap-3 cursor-pointer",onClick:()=>L(J),children:[i.jsx("div",{className:"w-8 h-8 bg-[#6ed8ff] rounded-full flex items-center justify-center",children:i.jsx("img",{src:Gi,alt:"",className:"w-6 h-6"})}),i.jsxs("div",{className:"flex flex-col gap-1",children:[i.jsxs("div",{className:"flex items-center gap-2 text-white text-sm font-semibold",children:[J!=null&&J.listen_user?J.listen_user.slice(0,5)+"..."+J.listen_user.slice(-4):"-",i.jsx("img",{src:wo,alt:"",className:"w-4 h-4 cursor-pointer",onClick:X=>{X.stopPropagation(),navigator.clipboard.writeText((J==null?void 0:J.listen_user)||""),rn.success("Successfully copied.",{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(103, 255, 189, 0.16)",width:"280px",minWidth:"280px",height:"40px",backdropFilter:"blur(16px)"},iconTheme:{primary:"#67FFBD",secondary:"#276047"}})}})]}),i.jsxs("div",{className:"flex flex-col text-xs text-[#a5a5a5]",children:[i.jsx("span",{children:su(J==null?void 0:J.closestTime)}),i.jsx(C,{date:J==null?void 0:J.closestTime})]}),i.jsxs("div",{className:"text-xs font-semibold",children:[i.jsx("span",{className:"text-white",children:"Size:"})," ",J!=null&&J.totalSize?Er(J==null?void 0:J.totalSize):"-"]}),i.jsxs("div",{className:"text-xs font-semibold",children:[i.jsx("span",{className:"text-white",children:"Price:"})," ",J!=null&&J.px?"$"+Er(J==null?void 0:J.px):"-"]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsxs("div",{className:"flex justify-start items-center gap-1",children:[i.jsx("div",{className:"w-5 h-5 bg-transparent rounded-[256px]",children:i.jsx("img",{src:`https://app.hyperliquid.xyz/coins/${J==null?void 0:J.coin}.svg`||Va,alt:J==null?void 0:J.coin,className:"rounded-full w-5 h-5 min-w-5 min-h-5",loading:"lazy",onError:X=>ra(X)})}),i.jsxs("div",{className:"text-[13px] text-white font-bold font-manrope leading-[13px] tracking-tight",children:[J==null?void 0:J.coin,"/",J==null?void 0:J.feeToken]})]}),i.jsxs("div",{className:`${R(J==null?void 0:J.dir)} h-5 pl-2 pr-2 py-1 rounded-md flex items-center gap-1 w-max mt-1`,children:[i.jsx("div",{className:"w-3 h-3",children:F(J==null?void 0:J.dir)}),i.jsx("div",{className:"text-[11px] font-semibold",children:(J==null?void 0:J.dir)||"-"})]})]})]})]},J.oid)))}),v&&i.jsx(up,{isOpen:!!v,onClose:()=>z(),children:i.jsxs("div",{className:"flex flex-col gap-4 p-2",children:[i.jsxs("div",{className:"flex gap-2 items-center",children:[i.jsx("div",{className:"w-8 h-8 bg-[#6ed8ff] rounded-full flex items-center justify-center",children:i.jsx("img",{src:Gi,alt:"",className:"w-6 h-6"})}),i.jsxs("div",{className:"flex flex-col",children:[i.jsxs("div",{className:"flex gap-2",children:[i.jsx("div",{className:"text-white text-sm font-semibold",children:v!=null&&v.listen_user?v.listen_user.slice(0,5)+"..."+v.listen_user.slice(-4):"-"}),i.jsx("img",{src:wo,alt:"",className:"w-4 h-4 cursor-pointer",onClick:J=>{J.stopPropagation(),navigator.clipboard.writeText((v==null?void 0:v.listen_user)||"")}})]}),i.jsx("div",{className:"flex flex-col text-[11px] text-[#a5a5a5]",children:x==="time"?i.jsx(C,{date:v==null?void 0:v.closestTime}):su(v==null?void 0:v.closestTime)})]})]}),i.jsxs("div",{className:"flex flex-col gap-2 text-sm text-[#9b9b9b]",children:[i.jsxs("div",{className:"text-white flex items-center gap-2",children:[i.jsx("img",{src:U(v).icon,alt:"",className:"w-4 h-4"}),"Status: ",U(v).text]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-white",children:"Order ID:"})," ",(v==null?void 0:v.oid)||"-"]}),i.jsxs("div",{className:"flex items-center gap-1",children:[i.jsx("span",{className:"text-white",children:"Direction:"}),i.jsxs("div",{className:`${R(v==null?void 0:v.dir)} h-5 pl-2 pr-2 py-1 rounded-md flex items-center gap-1`,children:[i.jsx("div",{className:"w-3 h-3",children:F(v==null?void 0:v.dir)}),i.jsx("div",{className:"text-[11px] font-semibold",children:(v==null?void 0:v.dir)||"-"})]})]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-white",children:"Price:"})," ",v!=null&&v.px?"$"+Er(v==null?void 0:v.px):"-"]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-white",children:"Size:"})," ",v!=null&&v.totalSize?Er(v==null?void 0:v.totalSize):"-"]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-white",children:"PnL:"})," ",v!=null&&v.totalClosedPnl?"$"+Er(Math.abs(v==null?void 0:v.totalClosedPnl)):"-"]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-white",children:"Fee:"})," ",v!=null&&v.totalFee?"$"+Er(Math.abs(v==null?void 0:v.totalFee)):"-"]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-white",children:"Margin Mode:"})," ",v!=null&&v.crossed?"Cross":"Isolated"]}),i.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[i.jsx("img",{src:`https://app.hyperliquid.xyz/coins/${v==null?void 0:v.coin}.svg`||Va,onError:J=>ra(J),alt:"",className:"w-5 h-5"}),i.jsxs("span",{className:"font-bold text-white",children:[v==null?void 0:v.coin,"/",(v==null?void 0:v.feeToken)||"USDC"]})]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-white",children:"Fills:"})," ",(Q=v==null?void 0:v.hashes)!=null&&Q.length?((ne=v==null?void 0:v.hashes)==null?void 0:ne.length)+" fill(s)":"0"]})]})]})})]})}const Gin=({open:e,setOpen:t,handleTelegramClick:n})=>(m.useContext(Qr),ns(),y5(),i.jsxs(Ea,{open:e,onClose:t,className:"relative z-50 font-manrope",children:[i.jsx(ja,{transition:!0,style:{backgroundColor:"rgba(0, 0, 0, 0.48)"},className:"fixed inset-0 transition-opacity data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in"}),i.jsx("div",{className:"fixed inset-0 z-50 w-screen overflow-y-auto",children:i.jsx("div",{className:"flex min-h-full items-end justify-center p-4 text-center sm:items-center sm:p-0",children:i.jsx(xa,{transition:!0,className:"relative transform overflow-hidden bg-[#101010] text-left shadow-xl transition-all data-[closed]:translate-y-4 data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in data-[closed]:sm:translate-y-0 data-[closed]:sm:scale-95 rounded-3xl",children:i.jsx("div",{className:"flex flex-col justify-start items-center gap-8 w-[400px] h-max relative bg-[#252525] rounded-3xl pt-4 pb-8",children:i.jsxs(i.Fragment,{children:[i.jsx("div",{onClick:()=>{t(!1)},className:"cursor-pointer flex w-full items-center justify-end absolute right-2 top-1",children:i.jsx("span",{className:"absolute top-2 right-2 w-9 h-9 rounded-full p-1 flex justify-center items-center hover:bg-[#7535FE]",children:i.jsx("img",{className:"p-1",src:Ba})})}),i.jsx("div",{className:"pt-4",children:i.jsx("img",{src:Gi,alt:"",className:"w-[86px h-[86px]"})}),i.jsxs("div",{className:"flex flex-col justify-start items-center gap-2",children:[i.jsx("div",{className:"text-center text-white text-[32px] font-manrope leading-none",children:"Welcome Dextrabot"}),i.jsx("div",{className:"text-center text-white/60 text-sm font-manrope leading-none",children:"You can connect to Telegram here."})]}),i.jsx("div",{onClick:()=>{n(),t(!1)},className:"flex justify-center items-center w-[348px] h-12 bg-[#7536ff] rounded-2xl cursor-pointer",children:i.jsx("div",{className:"text-center font-semibold text-white text-sm font-manrope leading-3",children:"Join Telegram"})})]})})})})})]})),Kin=({open:e,setOpen:t,setIsfilterModal:n,handleTelegramClick:r})=>{const[s,a]=m.useState(!1),o=()=>{a(!1),n(!1),t(!1)};return i.jsxs(Ea,{open:e,onClose:o,className:"relative z-50 font-manrope",children:[i.jsx(ja,{transition:!0,style:{backgroundColor:"rgba(0, 0, 0, 0.48)"},className:"fixed inset-0 transition-opacity data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in"}),i.jsx("div",{className:"fixed inset-0 z-50 w-screen overflow-y-auto",children:i.jsx("div",{className:"flex min-h-full items-center justify-center p-4 text-center sm:p-0",children:i.jsx(xa,{transition:!0,className:"relative transform overflow-hidden bg-[#101010] text-left shadow-xl transition-all data-[closed]:translate-y-4 data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in data-[closed]:sm:translate-y-0 data-[closed]:sm:scale-95 rounded-3xl",children:i.jsx("div",{className:"flex flex-col justify-start items-center gap-8 w-[310px] sm:w-[400px] h-max relative bg-white rounded-3xl pt-4 pb-8",children:i.jsxs(i.Fragment,{children:[i.jsx("div",{onClick:l=>{l.preventDefault(),s?(t(!1),n(!1),a(!1)):t(!1)},className:"cursor-pointer flex w-full items-center justify-end absolute right-2 top-1",children:i.jsx("span",{className:`${s?"bg-[#1DE674] hover:bg-[#16c765]":"bg-[#e3e3e3] hover:bg-[#d4d4d4]"} absolute top-2 right-2 w-9 h-9 rounded-full p-1 flex justify-center items-center `,children:i.jsx(_Le,{className:"w-4 h-4 text-black"})})}),i.jsx("div",{className:"pt-4",children:i.jsx("img",{src:Fyt,alt:"",className:""})}),i.jsx("div",{className:"flex flex-col justify-start items-center gap-2 -mt-5",children:i.jsx("div",{className:"text-[#232323] text-[21px] font-semibold font-['Manrope']",children:"Telegram Setup"})}),i.jsx("div",{onClick:l=>{l.preventDefault(),s||r(),setTimeout(()=>{a(!0)},500)},className:`${s?"bg-[#1DE674] cursor-text":"bg-[#e3e3e3] hover:bg-[#d4d4d4] cursor-pointer"} w-60 h-8 px-6 py-3 rounded-[10px] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] inline-flex justify-center items-center gap-2.5 mb-2 select-none`,children:i.jsx("div",{className:"justify-start text-[#0a321c] text-[13px] font-semibold font-['Inter'] leading-[8px] min-w-max",children:s?"Successful":"Join Telegram"})})]})})})})})]})},Yin=({open:e,setOpen:t,handleTelegramClick:n})=>{const{setSignModalOpen:r}=m.useContext(Qr),{address:s}=ns(),[a,o]=m.useState([]),[l,c]=m.useState([]),[u,d]=m.useState(null),[f,x]=m.useState(!1),[g,v]=m.useState(!1),[w,C]=m.useState(!1),[N,P]=m.useState(""),[I,R]=m.useState(!1),[F]=m.useState(["Open Position","Increase","Decrease","Changed Position","Position Closed","Twaps"]),[U,L]=m.useState([]),[z,Q]=m.useState(!1),ne=async()=>{var ye;const he=window.localStorage.getItem("hyperToken"),ge=window.localStorage.getItem("hyperAddress");if(!he){r(!0);return}try{x(!0);const je=await(await fetch("https://dextrabothypev2.nftinit.io/api/hyper/trade/feed/tag_list/",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:s?s==null?void 0:s.toLowerCase():ge,token:he})})).json();if(je.success){const Ie=(je==null?void 0:je.data)||[],Le=u?((ye=u==null?void 0:u.message_filters)==null?void 0:ye.source)||[]:[],Qe=[...Ie].sort(($e,it)=>{const tt=Le==null?void 0:Le.includes($e.wallet_address),lt=Le==null?void 0:Le.includes(it.wallet_address);return Number(lt)-Number(tt)});o(Qe),await J(Qe)}else P((je==null?void 0:je.error_message)||"Failed to fetch source wallets"),console.error("API Error:",je==null?void 0:je.error_message)}catch(ve){console.error("Fetch Error:",ve),P("Failed to fetch source wallets")}finally{setTimeout(()=>{x(!1)},200)}},J=async he=>{var ve;const ge=window.localStorage.getItem("hyperToken"),ye=window.localStorage.getItem("hyperAddress");if(!ge){r(!0);return}try{v(!0);const Ie=await(await fetch("https://dextrabothypev2.nftinit.io/api/subscriber/get_telegram_filter/",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:s?s==null?void 0:s.toLowerCase():ye,token:ge})})).json();if(Ie.success){const Le=Ie==null?void 0:Ie.filters;if(d(Le),Le===null){const Qe=he==null?void 0:he.map($e=>`${$e.wallet_address}::${$e.tag}`);c(Qe),L([...F])}else{const Qe=((ve=Le==null?void 0:Le.message_filters)==null?void 0:ve.source)||[],$e=[...he].sort((it,tt)=>{const lt=Qe==null?void 0:Qe.includes(it.wallet_address),ft=Qe==null?void 0:Qe.includes(tt.wallet_address);return Number(ft)-Number(lt)});o($e)}}else P((Ie==null?void 0:Ie.error_message)||"Failed to fetch filter info"),console.error("API telegram filter info error:",Ie==null?void 0:Ie.error_message)}catch(je){console.error("Fetch Error:",je),P("Failed to fetch filter info")}finally{v(!1)}},X=async()=>{const he=window.localStorage.getItem("hyperToken"),ge=window.localStorage.getItem("hyperAddress");if(!he){r(!0);return}const ye=[...new Set(l==null?void 0:l.map(Le=>Le.split("::")[0]))];let ve={};ye.length>0&&(ve.source=ye);const je=U.filter(Le=>!Le.includes("Spot"));je.length>0&&(ve.type=je),ye.length===0&&U.length===0&&(ve={});const Ie={address:s?s==null?void 0:s.toLowerCase():ge,token:he,filters:ve};try{C(!0);const Le=await fetch("https://dextrabothypev2.nftinit.io/api/subscriber/telegram_filter_save/",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(Ie)}),Qe=await Le.json();Le.ok&&Qe.success?(d(Qe.filters),fe(Qe.filters),R(!0),rn.success("Filter saved successfully",{style:{border:"1px solid #22c55e",padding:"16px",color:"#fff",borderRadius:"999px",background:"#14532d",height:"40px",width:"340px",minWidth:"340px"},iconTheme:{primary:"#22c55e",secondary:"#FFFAEE"}})):(P((Qe==null?void 0:Qe.error_message)||"Failed to save filter"),console.error("API telegram filter save error:",Qe==null?void 0:Qe.error_message))}catch(Le){console.error("Fetch Error:",Le),P("Failed to save filter")}finally{C(!1)}};m.useEffect(()=>{a.length>0&&u&&fe(u)},[a,u]),m.useEffect(()=>{e&&ne()},[e]);const re=he=>{const{value:ge,checked:ye}=he.target;if(ge==="all"){const ve=a.map(je=>`${je.wallet_address}::${je.tag}`);c(ye?ve:[])}else c(ve=>ye?[...ve,ge]:ve.filter(je=>je!==ge))},pe=a==null?void 0:a.map(he=>`${he.wallet_address}::${he.tag}`),Y=a.length>0&&(pe==null?void 0:pe.every(he=>l==null?void 0:l.includes(he))),ie=he=>{const{value:ge,checked:ye}=he.target;if(ge==="all")if(ye){const ve=F==null?void 0:F.filter(je=>!(je!=null&&je.includes("Spot")));L(ve)}else L([]);else L(ve=>ye?[...ve,ge]:ve.filter(je=>je!==ge))},G=(F==null?void 0:F.filter(he=>!he.includes("Spot"))).length,ee=U.filter(he=>!he.includes("Spot")).length,ae=ee===G&&G>0,fe=he=>{const ge=he==null?void 0:he.message_filters;if(ge&&(Array.isArray(ge.type)&&L(ge.type.filter(ye=>!ye.includes("Spot"))),Array.isArray(ge.source))){const ye=a.filter(ve=>{var je;return(je=ge.source)==null?void 0:je.includes(ve.wallet_address)}).map(ve=>`${ve.wallet_address}::${ve.tag}`);c(ye)}},Ne=()=>{t(!1),Q(!1),o([]),L([]),c([])};return i.jsxs(i.Fragment,{children:[i.jsx(Kin,{open:I,setOpen:R,handleTelegramClick:n,setIsfilterModal:t}),i.jsxs(Ea,{open:e,onClose:Ne,className:"relative z-50 font-manrope",children:[i.jsx(ja,{transition:!0,style:{backgroundColor:"rgba(0, 0, 0, 0.48)"},className:"fixed inset-0 transition-opacity"}),i.jsx("div",{className:"fixed inset-0 z-50 w-screen overflow-y-auto",children:i.jsx("div",{className:"flex min-h-full justify-center p-4 text-center items-center sm:p-0",children:i.jsx(xa,{transition:!0,className:"relative transform overflow-hidden bg-[#242424] text-left shadow-xl transition-all rounded-3xl",children:i.jsxs("div",{style:{boxShadow:"0px 4px 24px 0px rgba(0, 0, 0, 0.32)",backdropFilter:"blur(16px)"},className:"flex flex-col items-center gap-6 w-[300px] sm:w-[411px] bg-[#242424] rounded-3xl pt-[33px] pb-8",children:[i.jsx("div",{onClick:()=>Ne(),className:`${l.length===0&&U.length===0?"hover:bg-[rgba(103,255,189,0.16)]":"hover:bg-[#787070]"} cursor-pointer absolute top-2 right-2 sm:top-8 sm:right-6 w-9 h-9 rounded-full flex justify-center items-center `,children:i.jsx("img",{className:"p-1",src:Ba,alt:"close"})}),i.jsx("div",{className:"flex justify-start items-center gap-3 w-full px-6 sm:px-10",children:i.jsx("div",{className:"text-white text-[21px] font-semibold font-['Manrope']",children:"Telegram Notifications"})}),i.jsxs("div",{className:"w-full pl-6 sm:pl-8 pr-2",children:[i.jsx("div",{className:"flex justify-between items-center mb-2 pr-6 max-w-[244px] sm:max-w-full",children:i.jsxs("div",{className:"flex justify-start items-center gap-2 pl-2",children:[i.jsx("span",{className:"text-white text-xs sm:text-sm font-manrope font-semibold leading-[8px]",children:"Source Wallet"}),i.jsx("span",{className:"text-[10px] sm:text-sm text-white font-semibold",children:(l==null?void 0:l.length)>0?`(${l==null?void 0:l.length} of ${a==null?void 0:a.length} selected)`:""})]})}),i.jsx("div",{className:"relative max-w-[244px] sm:max-w-full",children:i.jsx("div",{className:"w-full bg-transparent rounded-md mt-[2px] transition-all duration-200",children:i.jsx("div",{className:"max-h-[186px] overflow-y-auto scrollbar-custom-scrollbar-dark pr-0 sm:pr-[17px]",children:f?i.jsx("div",{className:"flex w-full h-full justify-center items-center min-h-[160px]",children:i.jsxs("div",{role:"status",className:"flex justify-center items-center h-5 w-[32px] px-0.5 py-1.5 rounded-md",children:[i.jsxs("svg",{"aria-hidden":"true",className:"inline w-10 h-10 text-gray-200 animate-spin dark:text-gray-600 fill-[#67FFBD]",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),i.jsx("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]}),i.jsx("span",{className:"sr-only",children:"Loading..."})]})}):i.jsxs(i.Fragment,{children:[(a==null?void 0:a.length)>0?i.jsxs(i.Fragment,{children:[i.jsxs("label",{className:"flex sticky top-0 z-10 bg-[#242424] justify-between items-center gap-2 cursor-pointer text-white font-semibold pt-1 pb-2 px-2 text-[13px] font-manrope leading-[8px]",children:[i.jsx("span",{className:`${Y?"text-white":"text-[#7C7C7C]"}`,children:"All"}),i.jsx("input",{type:"checkbox",value:"all",checked:Y,onChange:re,className:"hidden"}),i.jsx("div",{className:`w-[32px] h-[18px] flex items-center px-[2px] rounded-full transition-colors duration-200 ${Y?"bg-[#1DE674]":"bg-white/10"}`,children:i.jsx("div",{className:`w-[14px] h-[14px] bg-white rounded-full shadow transform transition-transform duration-200 ${Y?"translate-x-[14px]":"translate-x-0"}`})})]}),i.jsx("div",{className:"h-[1px] w-full bg-[#353535]"})]}):i.jsx("div",{className:"py-2 text-center text-[#7c7c7c] text-sm font-semibold",children:"No source wallet"}),a==null?void 0:a.map((he,ge)=>{var je,Ie,Le,Qe,$e;const ye=`${he==null?void 0:he.wallet_address}::${he==null?void 0:he.tag}`,ve=l==null?void 0:l.includes(ye);return i.jsxs("label",{className:"flex justify-between items-center gap-2 h-8 px-2 cursor-pointer text-white text-sm font-semibold rounded-md bg-[#353535] my-1 hover:bg-[#464646]",children:[i.jsxs("div",{className:"flex items-center gap-1",children:[i.jsx("div",{className:`${ve?"text-white":"text-[#7C7C7C]"} text-[13px] font-semibold min-w-[88px]`,children:((je=he.wallet_address)==null?void 0:je.slice(0,5))+"..."+((Ie=he.wallet_address)==null?void 0:Ie.slice(-4))}),i.jsx("span",{className:`${ve?"text-white":"text-[#7C7C7C]"} sm:hidden h-[18px] bg-[#424242] rounded-[256px] px-1.5 text-[13px] font-medium font-['Manrope'] leading-[8px] tracking-tight flex justify-center items-center`,children:((Le=he.tag)==null?void 0:Le.length)>10?`${(Qe=he==null?void 0:he.tag)==null?void 0:Qe.slice(0,10)}...`:`${he==null?void 0:he.tag}`}),i.jsx("span",{className:`${ve?"text-white":"text-[#7C7C7C]"} hidden sm:flex h-[18px] bg-[#424242] rounded-[256px] px-1.5 text-[13px] font-medium font-['Manrope'] leading-[8px] tracking-tight justify-center items-center`,children:(($e=he.tag)==null?void 0:$e.length)>24?`${he==null?void 0:he.tag.slice(0,24)}...`:`${he==null?void 0:he.tag}`})]}),i.jsx("input",{type:"checkbox",value:`${he==null?void 0:he.wallet_address}::${he==null?void 0:he.tag}`,checked:ve,onChange:re,className:"hidden"}),i.jsx("div",{className:`w-[32px] h-[18px] flex items-center px-[2px] rounded-full transition-colors duration-200 ${ve?"bg-[#1DE674]":"bg-white/10"}`,children:i.jsx("div",{className:`w-[14px] h-[14px] bg-white rounded-full shadow transform transition-transform duration-200 ${ve?"translate-x-[14px]":"translate-x-0"}`})})]},ge)})]})})})})]}),i.jsxs("div",{className:`${(a==null?void 0:a.length)>4?"pr-[36px] sm:pr-[30px]":"pr-6"} w-full pl-6 sm:pl-8`,children:[i.jsx("div",{className:"flex justify-between items-center mb-2 mt-4 max-w-[244px] sm:max-w-full",children:i.jsxs("div",{className:"flex justify-start items-center gap-2 pl-2",children:[i.jsx("span",{className:"text-white text-xs sm:text-sm font-manrope font-semibold leading-[8px]",children:"Source Wallet Type"}),i.jsx("span",{className:"text-[10px] sm:text-sm text-white font-semibold",children:ee>0?`(${ee} of ${G} selected)`:""})]})}),i.jsx("div",{className:"relative max-w-[244px] sm:max-w-full",children:i.jsx("div",{className:"w-full rounded-md mt-[2px] transition-all duration-200",children:i.jsxs("div",{className:"max-h-[296px] overflow-y-auto scrollbar-custom-scrollbar-dark",children:[i.jsxs("label",{className:"flex sticky top-0 z-10 justify-between items-center gap-2 cursor-pointer text-white font-semibold py-1 px-2 text-[13px] font-manrope leading-[8px]",children:[i.jsx("span",{className:`${ae?"text-white":"text-[#7C7C7C]"}`,children:"All"}),i.jsx("input",{type:"checkbox",value:"all",checked:ae,onChange:ie,className:"hidden"}),i.jsx("div",{className:`w-[32px] h-[18px] flex items-center px-[2px] rounded-full transition-colors duration-200 ${ae?"bg-[#1DE674]":"bg-white/10"}`,children:i.jsx("div",{className:`w-[14px] h-[14px] bg-white rounded-full shadow transform transition-transform duration-200 ${ae?"translate-x-[14px]":"translate-x-0"}`})})]}),i.jsx("div",{className:"h-[1px] w-full bg-[#353535] my-1"}),F==null?void 0:F.map((he,ge)=>{const ye=U==null?void 0:U.includes(he);return i.jsxs("label",{className:"flex justify-between items-center gap-2 h-8 hover:bg-[#464646] cursor-pointer text-white text-[13px] font-semibold rounded-md px-2 leading-[8px] bg-[#353535] my-1",children:[i.jsx("span",{className:`${ye?"text-white":"text-[#7C7C7C]"}`,children:he}),i.jsx("input",{type:"checkbox",value:he,checked:ye,onChange:ie,className:"hidden"}),i.jsx("div",{className:`w-[32px] h-[18px] flex items-center px-[2px] rounded-full transition-colors duration-200 ${ye?"bg-[#1DE674]":"bg-white/10"}`,children:i.jsx("div",{className:`w-[14px] h-[14px] bg-white rounded-full shadow transform transition-transform duration-200 ${ye?"translate-x-[14px]":"translate-x-0"}`})})]},ge)})]})})})]}),i.jsx("div",{onClick:he=>{if(he.preventDefault(),!f&&!g&&!w)if((l==null?void 0:l.length)===0||(U==null?void 0:U.length)===0){rn.success(i.jsx(i.Fragment,{children:i.jsx("span",{style:{color:"#ff797c",paddingLeft:"5px"},children:"Select at least one wallet or type."})}),{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(255, 121, 124, 0.32)",width:"350px",minWidth:"350px",height:"40px",backdropFilter:"blur(48px)"},iconTheme:{primary:"#ff797c",secondary:"#7d3031"}});return}else X()},className:`${!f&&!g&&!w&&(l==null?void 0:l.length)>0&&(U==null?void 0:U.length)>0?"cursor-pointer bg-[rgba(103,255,189,0.16)] text-[#67FFBD] hover:bg-[rgba(103,255,189,0.26)]":"cursor-pointer bg-[#787070] text-[#A6A6A6] border border-[#787070]"} w-full max-w-[230px] sm:max-w-[341px] mr-2 sm:mr-0 sm:ml-2 h-8 px-6 py-3 rounded-[10px] flex justify-center items-center gap-2.5`,children:i.jsx("div",{className:"pointer-events-none text-[13px] font-semibold font-['Inter'] leading-[8px]",children:f||g||w?i.jsxs("div",{role:"status",className:"flex justify-center items-center h-5 min-h-5 w-[32px] px-0.5 py-1.5 rounded-md",children:[i.jsxs("svg",{"aria-hidden":"true",className:"inline w-4 h-4 text-gray-200 animate-spin dark:text-gray-600 fill-[#67FFBD]",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),i.jsx("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]}),i.jsx("span",{className:"sr-only",children:"Loading..."})]}):"Next"})}),N&&i.jsx("p",{className:"mt-2 text-sm text-red-500",children:N})]})})})})]})]})},Xin=({isMenu:e})=>{const[t,n]=m.useState(!1),[r,s]=m.useState(!1),{setSignModalOpen:a,setTelegramChatId:o,setSubscriberRole:l,setIsReferralCode:c,setIsReferralCodeName:u,setMushboomerETH:d,setIsWhitelist:f,setMushboomerSOL:x,telegramChatId:g}=m.useContext(Qr);ns();const v=async()=>{var C,N;let w="";try{const P=window.localStorage.getItem("hyperToken"),I=window.localStorage.getItem("hyperAddress");if(!P){a(!0);return}if(I&&P){const R=await Ei(I,P);if(!R.success){console.error("Account check failed:",R.message);return}if(o(R==null?void 0:R.telegram_chat_id),l(R==null?void 0:R.subscriber_role),d((C=R==null?void 0:R.mushboomer_counts)==null?void 0:C.eth),x((N=R==null?void 0:R.mushboomer_counts)==null?void 0:N.sol),c(R==null?void 0:R.referral_code),u(R==null?void 0:R.refcode),f(R==null?void 0:R.whitelist),R.telegram_chat_id==null||R.telegram_chat_id==""||R.telegram_chat_id=="0"){const F=await Rbt(I,P);if(!F.success){console.error("Telegram-ID kunne ikke hentes:",R.message),rn.error(F.message);return}F.success&&(w=e=="My Activities"?`https://t.me/DextraCopyTraderBot?start=${F.telegram_temp_password}`:`https://t.me/DextraTraderBot?start=${F.telegram_temp_password}`)}else w=e=="My Activities"?"https://t.me/DextraCopyTraderBot":"https://t.me/DextraTraderBot"}w?window.open(w,"_blank"):(console.error("Failed to generate Telegram URL"),rn.error("Failed to generate Telegram URL"))}catch(P){console.error("Error during Telegram handling:",P),rn.error(P.message)}};return i.jsxs(i.Fragment,{children:[i.jsx(Gin,{open:t,setOpen:n,handleTelegramClick:v}),i.jsx(Yin,{open:r,setOpen:s,handleTelegramClick:v}),i.jsx("div",{className:"flex justify-center items-center",children:g==null||g==""||g=="0"?i.jsx("div",{onClick:w=>{w.preventDefault(),window.localStorage.getItem("hyperToken")?e=="My Activities"?s(!0):n(!0):a(!0)},className:`${e=="My Activities"?"bg-[#7445ff] hover:bg-[#7445ff]/80":"bg-white/40 hover:bg-white/50"} h-8 min-h-8 px-3 py-[5px] rounded-[256px] flex justify-start items-center gap-2 cursor-pointer`,children:i.jsx("div",{className:"min-w-max text-white text-[13px] font-semibold font-manrope leading-[8px] pointer-events-none",children:e=="My Activities"?"My Activities - Telegram":"Tracked Wallets - Telegram"})}):i.jsx("div",{onClick:w=>{w.preventDefault(),e=="My Activities"?s(!0):v()},className:`${e=="My Activities"?"bg-[#7445ff] hover:bg-[#7445ff]/80":"bg-white/40 hover:bg-white/50"} h-8 min-h-8 px-3 py-[5px] rounded-[256px] flex justify-start items-center gap-2 cursor-pointer`,children:i.jsx("div",{className:"min-w-max text-white text-[13px] font-semibold font-manrope leading-[8px] pointer-events-none",children:e=="My Activities"?"My Activities - Telegram":"Tracked Wallets - Telegram"})})})]})};function Qin(e){var Ft,Ke,Bt,$t,qe,Ye,ht,Zt,zt,Et,nt,Ue,Rt,We,at,mt,Dt,Tt,dn,on,gn,Nn,kn,yn,Vn,Gn,Dn,Kn,Cn,sn,Me,en,an,Nt,Yn,xn,Mt,tn,In,Xn,or,lr;const[t,n]=m.useState(!1),r=m.useRef(null),{isConnected:s,address:a}=ns(),[o,l]=m.useState([]);m.useEffect(()=>{var zn,Jn;const Qt=(zn=e.advancedFilters)==null?void 0:zn.coinFeed;if(Qt&&((Jn=e.dataCoin)==null?void 0:Jn.length)>0){const Lt=Qt.map(jn=>e.dataCoin.find(Ee=>Ee.value===jn)).filter(Boolean);e.setSelectedCoins(Lt)}},[e.dataCoin]);const c=Qt=>{if(!Qt)return;const Jn=Array.isArray(Qt)?Qt:[Qt],Lt=e.selectedCoins||[],jn=[...Lt,...Jn.filter(h=>!Lt.some(p=>p.value===h.value))],Ee=jn.map(h=>h.value);Ee.join(","),e.setSelectedCoins(jn),e.setAdvancedFilters(h=>({...h,coinFeed:Ee}))},[u,d]=m.useState(!1),[f,x]=m.useState(!1),[g,v]=m.useState(!1),[w,C]=m.useState(!1),[N,P]=m.useState(!1),[I,R]=m.useState(!1),F=()=>{d(Qt=>!Qt)},U=()=>{x(Qt=>!Qt)},L=()=>{v(Qt=>!Qt)},z=()=>{C(Qt=>!Qt)},Q=()=>{P(Qt=>!Qt)},ne=()=>{R(Qt=>!Qt)},J=Qt=>{const{value:zn,checked:Jn}=Qt.target;e.setAdvancedFilters(Lt=>{let jn=[...Lt.positionFeed];return zn==="all"?jn=Jn?[...je]:[]:Jn?jn.push(zn):jn=jn.filter(Ee=>Ee!==zn),localStorage.setItem("positionFeed",JSON.stringify(jn)),{...Lt,positionFeed:jn}})},X=()=>{localStorage.setItem("positionFeed",JSON.stringify([])),e.setAdvancedFilters(Qt=>({...Qt,positionFeed:[]}))},re=Qt=>{const{value:zn,checked:Jn}=Qt.target;e.setAdvancedFilters(Lt=>{let jn=[...Lt.typeFeed];return zn==="all"?jn=Jn?[...Qe]:[]:Jn?jn.push(zn):jn=jn.filter(Ee=>Ee!==zn),{...Lt,typeFeed:jn}})},pe=()=>{e.setAdvancedFilters(Qt=>({...Qt,typeFeed:[]}))},Y=Qt=>{const{value:zn,checked:Jn}=Qt.target;e.setAdvancedFilters(Lt=>{let jn=[...Lt.dexMarket];return zn==="all"?jn=Jn?[...$e]:[]:Jn?jn.push(zn):jn=jn.filter(Ee=>Ee!==zn),{...Lt,dexMarket:jn}})},ie=()=>{e.setAdvancedFilters(Qt=>({...Qt,dexMarket:[]}))},oe=()=>{e.setSearchTagSellect([])},G=((Ft=e.selectTradeWalletData)==null?void 0:Ft.length)>0?o:e.walletTags,V=Qt=>{const{value:zn,checked:Jn}=Qt.target;e.setSearchTagSellect(Lt=>{let jn=[...Lt];return zn==="all"?jn=Jn?G==null?void 0:G.map(Ee=>Ee.tag):[]:Jn?jn==null||jn.push(zn):jn=jn==null?void 0:jn.filter(Ee=>Ee!==zn),jn})},ee=Qt=>{e.setAdvancedFilters(zn=>({...zn,directionFeed:Qt})),R(!1)},ae=()=>{e.setAdvancedFilters(Qt=>({...Qt,directionFeed:""})),R(!1)},fe=()=>{e.setSelectTradeWalletData([])},[Ne,he]=m.useState(!1),ge=async Qt=>{const{value:zn,checked:Jn}=Qt.target;let Lt;e.setSelectTradeWalletData(jn=>{var Ee;return zn==="all"?Lt=Jn?(Ee=e.tradeWalletData)==null?void 0:Ee.map(h=>h.wallet):[]:(Lt=Jn?[...jn,zn]:jn==null?void 0:jn.filter(h=>h!==zn),!Jn&&jn.includes("all")&&(Lt=Lt==null?void 0:Lt.filter(h=>h!=="all"))),Lt}),e.setSearchTagSellect([]),setTimeout(async()=>{var jn;if((Lt==null?void 0:Lt.length)!==0)try{he(!0);const Ee=window.localStorage.getItem("hyperToken");if(!Ee){setSignModalOpen(!0);return}const p=await fetch("https://dextrabothypev2.nftinit.io/api/hyper/trade/feed/tag_list/",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:a,token:Ee,trader_wallets:Lt})});if(!p.ok)throw new Error(`Server responded with status ${p.status}`);const S=await p.json();if(S.success){const _=(jn=S==null?void 0:S.data)==null?void 0:jn.map(k=>({tag:k==null?void 0:k.tag,wallet:k==null?void 0:k.wallet_address}));l(_),he(!1)}else console.log(S.error_message),he(!1)}catch(Ee){console.log("Error :>> ",Ee),he(!1)}},0)},ye={control:(Qt,{isFocused:zn})=>{var Jn,Lt,jn,Ee;return{...Qt,display:"flex",alignItems:"center",paddingLeft:"21px",backgroundColor:"#353535",minHeight:"32px",maxHeight:"32px",minWidth:"244px",maxWidth:"244px",border:((Lt=(Jn=e.advancedFilters)==null?void 0:Jn.coinFeed)==null?void 0:Lt.length)>0?"1px solid #8d67ff":"none",boxShadow:"none",borderRadius:"6px",":hover":{border:((Ee=(jn=e.advancedFilters)==null?void 0:jn.coinFeed)==null?void 0:Ee.length)>0?"1px solid #8d67ff":"none"}}},menu:Qt=>({...Qt,backgroundColor:"#353535",maxWidth:"244px"}),menuList:Qt=>({...Qt,backgroundColor:"#353535",maxHeight:"180px",zIndex:4}),clearIndicator:Qt=>({...Qt,color:"#b3b3b3",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",width:"20px",height:"20px",minWidth:"20px",minHeight:"20px",padding:"0px",paddingRight:"5px",":hover":{color:"white"}}),dropdownIndicator:Qt=>({...Qt,color:"#b3b3b3",cursor:"pointer",alignItems:"center",justifyContent:"center",width:"25px",height:"25px",minWidth:"25px",minHeight:"25px",padding:"0px",paddingRight:"5px",paddingLeft:"5px",display:"none",":hover":{color:"white"}}),indicatorSeparator:()=>({display:"none"}),option:(Qt,{data:zn,isDisabled:Jn,isFocused:Lt,isSelected:jn})=>{const Ee=xi(zn.color);return{...Qt,fontSize:"14px",fontWeight:"600",backgroundColor:Jn?void 0:jn?zn.color:Lt?Ee.alpha(.1).css():void 0,color:"white",cursor:Jn?"not-allowed":"pointer",":active":{...Qt[":active"],backgroundColor:Jn?void 0:jn?zn.color:Ee.alpha(.9).css()}}},multiValue:(Qt,{data:zn})=>{const Jn=xi(zn.color);return{...Qt,backgroundColor:Jn.alpha(.4).css()}},multiValueLabel:(Qt,{data:zn})=>({...Qt,color:"white"}),multiValueRemove:(Qt,{data:zn})=>({...Qt,color:"white",":hover":{backgroundColor:"rgba(255, 255, 255, 0.3)",color:"white"}}),input:Qt=>({...Qt,color:"white"}),valueContainer:Qt=>({...Qt,paddingTop:"0px",fontSize:"14px",fontWeight:"600"})},ve=(Qt,zn)=>{var Lt;const Jn=(Lt=zn.selectedCoins)==null?void 0:Lt.filter(jn=>jn.value!==Qt.value);Jn.map(jn=>jn.value).join(","),zn.setSelectedCoins(Jn),zn.setAdvancedFilters(jn=>({...jn,coinFeed:Jn==null?void 0:Jn.map(Ee=>Ee.value)}))};m.useEffect(()=>{const Qt=zn=>{r.current&&!r.current.contains(zn.target)&&n(!1)};return document.addEventListener("mousedown",Qt),()=>{document.removeEventListener("mousedown",Qt)}},[]);const je=["Open Position","Increase","Decrease","Changed Position","Position Closed","Other"],Ie=(Ke=e.advancedFilters.positionFeed)==null?void 0:Ke.length,Le=je.length,Qe=["Open Position","Increase","Decrease","Changed Position","Position Closed","Spot","Twaps"],$e=["HyperLiquid","Lighter"],it=(Bt=e.advancedFilters.typeFeed)==null?void 0:Bt.length,tt=Qe.length,lt=($t=e.advancedFilters.dexMarket)==null?void 0:$t.length,ft=$e.length,ut=(qe=e.searchTagSellect)==null?void 0:qe.length,qt=G==null?void 0:G.length,It=(Ye=e.selectTradeWalletData)==null?void 0:Ye.length,nn=(ht=e.tradeWalletData)==null?void 0:ht.length,jt=["Long","Short"],cn=({src:Qt,alt:zn})=>{const[Jn,Lt]=Ae.useState(!1);return Jn?i.jsx("div",{className:"rounded-full w-4 h-4 min-w-4 min-h-4 mr-1 bg-[#4F4F4F] flex items-center justify-center",children:i.jsx("span",{className:"text-white text-xs"})}):i.jsx("img",{src:Qt,alt:zn,className:"rounded-full w-4 h-4 min-w-4 min-h-4 mr-1",loading:"lazy",onError:()=>Lt(!0)})},un=Qt=>{const{data:zn,innerRef:Jn,innerProps:Lt,selectProps:jn}=Qt,Ee=jn.styles.option({},Qt);return i.jsxs("div",{ref:Jn,...Lt,style:Ee,className:"flex items-center p-2",children:[i.jsx(cn,{src:zn.icon,alt:zn.label}),zn.label]})};return i.jsxs("div",{className:"text-white flex flex-wrap justify-center font-manrope gap-4 pt-2",children:[i.jsxs("div",{className:"col-span-1 flex flex-col gap-[13px] justify-start w-full max-w-full z-3",children:[i.jsxs("div",{className:"flex justify-between items-center",children:[i.jsx("p",{className:"text-[#c9c9c9] text-[13px] font-semibold font-manrope leading-[8px]",children:"DEX"}),i.jsx("div",{onClick:ie,className:"h-5 px-2 py-1.5 rounded-md border border-[#353535] justify-start items-center gap-2 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-[#cdcdcd] text-[11px] font-semibold font-manrope leading-[8px] pointer-events-none",children:"Clear"})})]}),i.jsxs("div",{className:"relative w-full max-w-[244px]",children:[i.jsxs("div",{className:`${lt>0?"border border-[#8d67ff]":""} flex justify-between items-center bg-[#353535] text-white rounded-md py-3 px-2.5 cursor-pointer select-none h-8`,onClick:L,children:[i.jsx("span",{className:`${lt>0?"text-white":"text-[#7c7c7c]"} text-sm font-semibold font-manrope leading-[8px]`,children:lt>0?`${lt} of ${ft} selected`:"Select Dex"}),i.jsx(Yh,{className:`w-3.5 h-3.5 transition ${g?"rotate-180":""}`})]}),g&&i.jsx("div",{className:"w-full bg-[#353535] rounded-md mt-[2px] p-1 transition-all duration-200",children:i.jsxs("div",{className:"max-h-[260px] overflow-y-auto",children:[i.jsxs("label",{className:"flex items-center gap-2 p-[7px] h-8 relative rounded hover:bg-[#464646] cursor-pointer text-white text-sm font-semibold font-manrope leading-[8px]",children:[i.jsx("input",{type:"checkbox",value:"all",checked:((zt=(Zt=e.advancedFilters)==null?void 0:Zt.dexMarket)==null?void 0:zt.length)===$e.length,onChange:Y,className:"hidden"}),i.jsx("div",{className:`w-4 h-4 flex items-center justify-center border ${((nt=(Et=e.advancedFilters)==null?void 0:Et.dexMarket)==null?void 0:nt.length)===$e.length?"bg-[#3ec78c] border-[#3ec78c]":"border-[#9d9d9d]"} w-[18px] h-[18px] relative rounded border`,children:((Rt=(Ue=e.advancedFilters)==null?void 0:Ue.dexMarket)==null?void 0:Rt.length)===($e==null?void 0:$e.length)&&i.jsx("img",{src:Yc,alt:"",className:"w-[8.50px] h-[5.66px] ml-[2px]"})}),"All"]}),i.jsx("div",{className:"h-[2px] w-full bg-[#404040]"}),$e==null?void 0:$e.map((Qt,zn)=>{var Jn,Lt,jn,Ee,h,p;return i.jsxs("label",{className:"flex items-center gap-2 p-[7px] h-8 relative rounded hover:bg-[#464646] cursor-pointer text-white text-sm font-semibold font-manrope leading-[8px]",children:[i.jsx("input",{type:"checkbox",value:Qt,checked:(Lt=(Jn=e.advancedFilters)==null?void 0:Jn.dexMarket)==null?void 0:Lt.includes(Qt),onChange:Y,className:"hidden"}),i.jsx("div",{className:`w-4 h-4 flex items-center justify-center border ${(Ee=(jn=e.advancedFilters)==null?void 0:jn.dexMarket)!=null&&Ee.includes(Qt)?"bg-[#3ec78c] border-[#3ec78c]":"border-[#9d9d9d]"} w-[18px] h-[18px] relative rounded border`,children:((p=(h=e.advancedFilters)==null?void 0:h.dexMarket)==null?void 0:p.includes(Qt))&&i.jsx("img",{src:Yc,alt:"",className:"w-[8.50px] h-[5.66px] ml-[2px]"})}),Qt==="HyperLiquid"?i.jsx("img",{src:dx,alt:"hyper",className:"w-4 h-4 rounded-sm"}):Qt==="Lighter"?i.jsx(Xf,{className:"w-4 h-4 text-[#fff]"}):null,Qt]},zn)})]})})]})]}),i.jsxs("div",{className:"col-span-1 flex flex-col gap-[13px] justify-start w-full max-w-full z-3",children:[i.jsxs("div",{className:"flex justify-between items-center",children:[i.jsx("p",{className:"text-[#c9c9c9] text-[13px] font-semibold font-manrope leading-[8px]",children:"Follower Wallet"}),i.jsx("div",{onClick:fe,className:"h-5 px-2 py-1.5 rounded-md border border-[#353535] justify-start items-center gap-2 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-[#cdcdcd] text-[11px] font-semibold font-manrope leading-[8px] pointer-events-none",children:"Clear"})})]}),i.jsxs("div",{className:"relative w-full max-w-[244px]",children:[i.jsxs("div",{className:`${It>0?"border border-[#8d67ff]":""} flex justify-between items-center bg-[#353535] text-white rounded-md py-3 px-2.5 cursor-pointer select-none h-8`,onClick:Q,children:[i.jsx("span",{className:`${It>0?"text-white":"text-[#7c7c7c]"} text-sm font-semibold font-manrope leading-[8px]`,children:It>0?`${It} of ${nn} selected`:"Select Wallet"}),i.jsx(Yh,{className:`w-3.5 h-3.5 transition ${N?"rotate-180":""}`})]}),N&&i.jsx("div",{className:"w-full bg-[#353535] rounded-md mt-[2px] p-1 transition-all duration-200",children:i.jsxs("div",{className:"max-h-40 overflow-y-auto scrollbar-custom-scrollbar-dark",children:[i.jsxs("label",{className:"flex items-center gap-2 p-[7px] h-8 relative rounded hover:bg-[#464646] cursor-pointer text-white text-sm font-semibold font-manrope leading-[8px]",children:[i.jsx("input",{type:"checkbox",value:"all",checked:((We=e.selectTradeWalletData)==null?void 0:We.length)===((at=e.tradeWalletData)==null?void 0:at.length),onChange:ge,className:"hidden"}),i.jsx("div",{className:`w-4 h-4 flex items-center justify-center border ${((mt=e.selectTradeWalletData)==null?void 0:mt.length)===((Dt=e.tradeWalletData)==null?void 0:Dt.length)?"bg-[#3ec78c] border-[#3ec78c]":"border-[#9d9d9d]"} w-[18px] h-[18px] relative rounded border`,children:((Tt=e.selectTradeWalletData)==null?void 0:Tt.length)===((dn=e.tradeWalletData)==null?void 0:dn.length)&&i.jsx("img",{src:Yc,alt:"",className:"w-[8.50px] h-[5.66px] ml-[2px]"})}),"All"]}),i.jsx("div",{className:"h-[2px] w-full bg-[#404040]"}),e.isWalletLoading?i.jsx("span",{className:"text-[#7c7c7c] text-center py-2 text-sm font-semibold font-manrope leading-[8px]",children:'"Loading..."'}):(on=e.tradeWalletData)==null?void 0:on.map((Qt,zn)=>{var Jn,Lt,jn,Ee,h,p,S;return i.jsxs("label",{className:"flex items-center gap-2 p-[7px] h-8 relative rounded hover:bg-[#464646] cursor-pointer text-white text-sm font-semibold font-manrope leading-[8px]",children:[i.jsx("input",{type:"checkbox",value:Qt==null?void 0:Qt.wallet,checked:(Jn=e.selectTradeWalletData)==null?void 0:Jn.includes(Qt==null?void 0:Qt.wallet),onChange:ge,className:"hidden"}),i.jsx("div",{className:`w-4 h-4 flex items-center justify-center border ${(Lt=e.selectTradeWalletData)!=null&&Lt.includes(Qt==null?void 0:Qt.wallet)?"bg-[#3ec78c] border-[#3ec78c]":"border-[#9d9d9d]"} w-[18px] h-[18px] relative rounded border`,children:((jn=e.selectTradeWalletData)==null?void 0:jn.includes(Qt==null?void 0:Qt.wallet))&&i.jsx("img",{src:Yc,alt:"",className:"w-[8.50px] h-[5.66px] ml-[2px]"})}),((Ee=Qt==null?void 0:Qt.wallet)==null?void 0:Ee.slice(0,5))+"..."+((h=Qt==null?void 0:Qt.wallet)==null?void 0:h.slice(-4)),` (${((p=Qt==null?void 0:Qt.name)==null?void 0:p.length)>10?((S=Qt==null?void 0:Qt.name)==null?void 0:S.slice(0,10))+"...":Qt==null?void 0:Qt.name})`]},zn)})]})})]})]}),i.jsxs("div",{className:"col-span-1 flex flex-col gap-[13px] justify-start w-full max-w-full z-3",children:[i.jsxs("div",{className:"flex justify-between items-center",children:[i.jsx("p",{className:"text-[#c9c9c9] text-[13px] font-semibold font-manrope leading-[8px]",children:"Source Wallet"}),i.jsx("div",{onClick:oe,className:"h-5 px-2 py-1.5 rounded-md border border-[#353535] justify-start items-center gap-2 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-[#cdcdcd] text-[11px] font-semibold font-manrope leading-[8px] pointer-events-none",children:"Clear"})})]}),i.jsxs("div",{className:"relative w-full max-w-[244px]",children:[i.jsxs("div",{className:`${ut>0?"border border-[#8d67ff]":""} flex justify-between items-center bg-[#353535] text-white rounded-md py-3 px-2.5 cursor-pointer select-none h-8`,onClick:z,children:[i.jsx("span",{className:`${ut>0?"text-white":"text-[#7c7c7c]"} text-sm font-semibold font-manrope leading-[8px]`,children:ut>0?`${ut} of ${qt} selected`:"Select Wallet"}),i.jsx(Yh,{className:`w-3.5 h-3.5 transition ${w?"rotate-180":""}`})]}),w&&i.jsx("div",{className:"w-full bg-[#353535] rounded-md mt-[2px] p-1 transition-all duration-200",children:Ne?i.jsx("p",{className:"text-[#7c7c7c] text-center py-2 text-sm font-semibold font-manrope leading-[8px]",children:"Loading..."}):i.jsxs("div",{className:"max-h-40 overflow-y-auto scrollbar-custom-scrollbar-dark",children:[i.jsxs("label",{className:"flex items-center gap-2 p-[7px] h-8 relative rounded hover:bg-[#464646] cursor-pointer text-white text-sm font-semibold font-manrope",children:[i.jsx("input",{type:"checkbox",value:"all",checked:((gn=e.searchTagSellect)==null?void 0:gn.length)===(G==null?void 0:G.length),onChange:V,className:"hidden"}),i.jsx("div",{className:`w-4 h-4 flex items-center justify-center border ${((Nn=e.searchTagSellect)==null?void 0:Nn.length)===(G==null?void 0:G.length)?"bg-[#3ec78c] border-[#3ec78c]":"border-[#9d9d9d]"} w-[18px] h-[18px] relative rounded border`,children:((kn=e.searchTagSellect)==null?void 0:kn.length)===(G==null?void 0:G.length)&&i.jsx("img",{src:Yc,alt:"",className:"w-[8.50px] h-[5.66px] ml-[2px]"})}),"All"]}),i.jsx("div",{className:"h-[2px] w-full bg-[#404040]"}),G==null?void 0:G.map((Qt,zn)=>{var Jn,Lt,jn,Ee,h,p;return i.jsxs("label",{className:"flex items-center gap-2 p-[7px] h-8 relative rounded hover:bg-[#464646] cursor-pointer text-white text-sm font-semibold font-manrope",children:[i.jsx("input",{type:"checkbox",value:Qt==null?void 0:Qt.tag,checked:(Jn=e.searchTagSellect)==null?void 0:Jn.includes(Qt==null?void 0:Qt.tag),onChange:V,className:"hidden"}),i.jsx("div",{className:`w-4 h-4 flex items-center justify-center border ${(Lt=e.searchTagSellect)!=null&&Lt.includes(Qt==null?void 0:Qt.tag)?"bg-[#3ec78c] border-[#3ec78c]":"border-[#9d9d9d]"} w-[18px] h-[18px] relative rounded border`,children:((jn=e.searchTagSellect)==null?void 0:jn.includes(Qt==null?void 0:Qt.tag))&&i.jsx("img",{src:Yc,alt:"",className:"w-[8.50px] h-[5.66px] ml-[2px]"})}),(Qt==null?void 0:Qt.wallet)&&((Ee=Qt==null?void 0:Qt.wallet)==null?void 0:Ee.slice(0,5))+"..."+((h=Qt==null?void 0:Qt.wallet)==null?void 0:h.slice(-4))," ",Qt!=null&&Qt.tag&&(Qt==null?void 0:Qt.tag.length)>10?`(${(p=Qt==null?void 0:Qt.tag)==null?void 0:p.slice(0,10)}...)`:`(${Qt==null?void 0:Qt.tag})`]},zn)})]})})]})]}),i.jsxs("div",{className:"col-span-1 flex flex-col gap-[7px] justify-start max-w-full z-3",children:[i.jsxs("div",{className:"flex justify-between items-center",children:[i.jsx("div",{className:"text-[#c9c9c9] text-[13px] font-semibold font-manrope leading-[8px]",children:"Search Coin"}),i.jsx("div",{onClick:()=>{e.setSelectedCoins([]),e.setAdvancedFilters(Qt=>({...Qt,coinFeed:""}))},className:"h-5 px-2 py-1.5 rounded-md border border-[#353535] justify-start items-center gap-2 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-[#cdcdcd] text-[11px] font-semibold font-manrope leading-[8px] pointer-events-none",children:"Clear Coins"})})]}),i.jsx("div",{className:"float-left w-full",ref:r,children:i.jsxs("div",{className:"min-w-full relative",children:[i.jsx(_y,{className:"text-[#646464] absolute left-[6px] top-[6px] z-10"}),i.jsx(Cl,{closeMenuOnSelect:!1,value:[],isMulti:!0,options:e.dataCoin.filter(Qt=>Array.isArray(e.selectedCoins)&&!e.selectedCoins.some(zn=>zn.value===Qt.value)),components:{Option:un},styles:ye,onChange:c,menuIsOpen:t,onMenuOpen:()=>n(!0),placeholder:e.isLoadingCoin?i.jsx("span",{className:"text-[#7e7e7e] text-sm font-medium font-inter leading-[8px]",children:"Loading..."}):i.jsx("span",{className:"text-[#7e7e7e] text-sm font-medium font-inter leading-[8px]",children:"Search Coin"}),noOptionsMessage:()=>e.isLoadingCoin?i.jsx("span",{className:"text-[#7e7e7e] text-sm font-medium font-inter leading-[8px]",children:"Loading..."}):i.jsx("span",{className:"text-[#7e7e7e] text-sm font-medium font-inter leading-[8px]",children:"No data available"})}),i.jsx("div",{className:`absolute top-[220px] z-[4] left-0 w-full max-w-[244px] bg-[#303030] flex flex-wrap gap-1 p-1 border border-[#3a3a3a] mt-1 ${t?"block":"hidden"} ${t&&((yn=e.selectedCoins)==null?void 0:yn.length)>0?"block":"hidden"}`,children:e.selectedCoins&&((Vn=e.selectedCoins)==null?void 0:Vn.map(Qt=>i.jsxs("div",{className:"h-6 pl-1.5 rounded-md border border-[#3a3a3a] justify-start items-center gap-0.5 flex",children:[i.jsx(cn,{src:Qt==null?void 0:Qt.icon,alt:Qt==null?void 0:Qt.value}),i.jsx("div",{className:"text-[#cdcdcd] text-[11px] font-semibold font-manrope leading-[8px] py-1 min-w-max",children:Qt.label}),i.jsx("div",{onClick:zn=>{zn.stopPropagation(),ve(Qt,e)},className:"cursor-pointer group w-full h-full flex justify-center items-center pr-1.5 py-1",children:i.jsx(nw,{className:"group-hover:text-[#cdcdcd] text-[#7C7C7C] w-[5.66px] h-[5.66px] min-w-[5.66px] min-h-[5.66px]"})})]},Qt.value)))}),i.jsx("div",{className:`${((Gn=e.selectedCoins)==null?void 0:Gn.length)>0?"mt-2.5":""} flex flex-wrap gap-1 max-w-[244px]`,children:e.selectedCoins&&((Dn=e.selectedCoins)==null?void 0:Dn.map(Qt=>i.jsxs("div",{className:"h-6 pl-1.5 rounded-md border border-[#3a3a3a] justify-start items-center gap-0.5 flex ",children:[i.jsx(cn,{src:Qt==null?void 0:Qt.icon,alt:Qt==null?void 0:Qt.value}),i.jsx("div",{className:"text-[#cdcdcd] text-[11px] font-semibold font-manrope leading-[8px] py-1 min-w-max",children:Qt.label}),i.jsx("div",{onClick:()=>ve(Qt,e),className:"cursor-pointer group w-full h-full flex justify-center items-center pr-1.5 py-1",children:i.jsx(nw,{className:"group-hover:text-[#cdcdcd] text-[#7C7C7C] w-[5.66px] h-[5.66px] min-w-[5.66px] min-h-[5.66px]"})})]},Qt.value)))})]})})]}),i.jsxs("div",{className:"col-span-1 flex flex-col gap-[13px] justify-start w-full max-w-full z-3",children:[i.jsxs("div",{className:"flex justify-between items-center",children:[i.jsx("p",{className:"text-[#c9c9c9] text-[13px] font-semibold font-manrope leading-[8px]",children:"Source Wallet Type"}),i.jsx("div",{onClick:pe,className:"h-5 px-2 py-1.5 rounded-md border border-[#353535] justify-start items-center gap-2 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-[#cdcdcd] text-[11px] font-semibold font-manrope leading-[8px] pointer-events-none",children:"Clear"})})]}),i.jsxs("div",{className:"relative w-full max-w-[244px]",children:[i.jsxs("div",{className:`${it>0?"border border-[#8d67ff]":""} flex justify-between items-center bg-[#353535] text-white rounded-md py-3 px-2.5 cursor-pointer select-none h-8`,onClick:U,children:[i.jsx("span",{className:`${it>0?"text-white":"text-[#7c7c7c]"} text-sm font-semibold font-manrope leading-[8px]`,children:it>0?`${it} of ${tt} selected`:"Select Type"}),i.jsx(Yh,{className:`w-3.5 h-3.5 transition ${f?"rotate-180":""}`})]}),f&&i.jsx("div",{className:"w-full bg-[#353535] rounded-md mt-[2px] p-1 transition-all duration-200",children:i.jsxs("div",{className:"max-h-[260px] overflow-y-auto",children:[i.jsxs("label",{className:"flex items-center gap-2 p-[7px] h-8 relative rounded hover:bg-[#464646] cursor-pointer text-white text-sm font-semibold font-manrope leading-[8px]",children:[i.jsx("input",{type:"checkbox",value:"all",checked:((Cn=(Kn=e.advancedFilters)==null?void 0:Kn.typeFeed)==null?void 0:Cn.length)===Qe.length,onChange:re,className:"hidden"}),i.jsx("div",{className:`w-4 h-4 flex items-center justify-center border ${((Me=(sn=e.advancedFilters)==null?void 0:sn.typeFeed)==null?void 0:Me.length)===Qe.length?"bg-[#3ec78c] border-[#3ec78c]":"border-[#9d9d9d]"} w-[18px] h-[18px] relative rounded border`,children:((an=(en=e.advancedFilters)==null?void 0:en.typeFeed)==null?void 0:an.length)===(Qe==null?void 0:Qe.length)&&i.jsx("img",{src:Yc,alt:"",className:"w-[8.50px] h-[5.66px] ml-[2px]"})}),"All"]}),i.jsx("div",{className:"h-[2px] w-full bg-[#404040]"}),Qe==null?void 0:Qe.map((Qt,zn)=>{var Jn,Lt,jn,Ee,h,p;return i.jsxs("label",{className:"flex items-center gap-2 p-[7px] h-8 relative rounded hover:bg-[#464646] cursor-pointer text-white text-sm font-semibold font-manrope leading-[8px]",children:[i.jsx("input",{type:"checkbox",value:Qt,checked:(Lt=(Jn=e.advancedFilters)==null?void 0:Jn.typeFeed)==null?void 0:Lt.includes(Qt),onChange:re,className:"hidden"}),i.jsx("div",{className:`w-4 h-4 flex items-center justify-center border ${(Ee=(jn=e.advancedFilters)==null?void 0:jn.typeFeed)!=null&&Ee.includes(Qt)?"bg-[#3ec78c] border-[#3ec78c]":"border-[#9d9d9d]"} w-[18px] h-[18px] relative rounded border`,children:((p=(h=e.advancedFilters)==null?void 0:h.typeFeed)==null?void 0:p.includes(Qt))&&i.jsx("img",{src:Yc,alt:"",className:"w-[8.50px] h-[5.66px] ml-[2px]"})}),Qt]},zn)})]})})]})]}),i.jsxs("div",{className:"col-span-1 flex flex-col gap-[13px] justify-start w-full max-w-full z-3",children:[i.jsxs("div",{className:"flex justify-between items-center",children:[i.jsx("p",{className:"text-[#c9c9c9] text-[13px] font-semibold font-manrope leading-[8px]",children:"Follower Wallet Status"}),i.jsx("div",{onClick:X,className:"h-5 px-2 py-1.5 rounded-md border border-[#353535] justify-start items-center gap-2 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-[#cdcdcd] text-[11px] font-semibold font-manrope leading-[8px] pointer-events-none",children:"Clear"})})]}),i.jsxs("div",{className:"relative w-full max-w-[244px]",children:[i.jsxs("div",{className:`${Ie>0?"border border-[#8d67ff]":""} flex justify-between items-center bg-[#353535] text-white rounded-md py-3 px-2.5 cursor-pointer select-none h-8`,onClick:F,children:[i.jsx("span",{className:`${Ie>0?"text-white":"text-[#7c7c7c]"} text-sm font-semibold font-manrope leading-[8px]`,children:Ie>0?`${Ie} of ${Le} selected`:"Select Status"}),i.jsx(Yh,{className:`w-3.5 h-3.5 transition ${u?"rotate-180":""}`})]}),u&&i.jsx("div",{className:"w-full bg-[#353535] rounded-md mt-[2px] p-1 transition-all duration-200",children:i.jsxs("div",{className:"max-h-[228px] overflow-y-auto",children:[i.jsxs("label",{className:"flex items-center gap-2 p-[7px] h-8 relative rounded hover:bg-[#464646] cursor-pointer text-white text-sm font-semibold font-manrope leading-[8px]",children:[i.jsx("input",{type:"checkbox",value:"all",checked:((Yn=(Nt=e.advancedFilters)==null?void 0:Nt.positionFeed)==null?void 0:Yn.length)===(je==null?void 0:je.length),onChange:J,className:"hidden"}),i.jsx("div",{className:`w-4 h-4 flex items-center justify-center border ${((Mt=(xn=e.advancedFilters)==null?void 0:xn.positionFeed)==null?void 0:Mt.length)===(je==null?void 0:je.length)?"bg-[#3ec78c] border-[#3ec78c]":"border-[#9d9d9d]"} w-[18px] h-[18px] relative rounded border`,children:((In=(tn=e.advancedFilters)==null?void 0:tn.positionFeed)==null?void 0:In.length)===(je==null?void 0:je.length)&&i.jsx("img",{src:Yc,alt:"",className:"w-[8.50px] h-[5.66px] ml-[2px]"})}),"All"]}),i.jsx("div",{className:"h-[2px] w-full bg-[#404040]"}),je==null?void 0:je.map((Qt,zn)=>{var Jn,Lt,jn,Ee,h,p;return i.jsxs("label",{className:"flex items-center gap-2 p-[7px] h-8 relative rounded hover:bg-[#464646] cursor-pointer text-white text-sm font-semibold font-manrope leading-[8px]",children:[i.jsx("input",{type:"checkbox",value:Qt,checked:(Lt=(Jn=e.advancedFilters)==null?void 0:Jn.positionFeed)==null?void 0:Lt.includes(Qt),onChange:J,className:"hidden"}),i.jsx("div",{className:`w-4 h-4 flex items-center justify-center border ${(Ee=(jn=e.advancedFilters)==null?void 0:jn.positionFeed)!=null&&Ee.includes(Qt)?"bg-[#3ec78c] border-[#3ec78c]":"border-[#9d9d9d]"} w-[18px] h-[18px] relative rounded border`,children:((p=(h=e.advancedFilters)==null?void 0:h.positionFeed)==null?void 0:p.includes(Qt))&&i.jsx("img",{src:Yc,alt:"",className:"w-[8.50px] h-[5.66px] ml-[2px]"})}),Qt==="Other"?"System Message":Qt]},zn)})]})})]})]}),i.jsxs("div",{className:"col-span-1 flex flex-col gap-[13px] justify-start w-full max-w-full z-3",children:[i.jsxs("div",{className:"flex justify-between items-center",children:[i.jsx("p",{className:"text-[#c9c9c9] text-[13px] font-semibold font-manrope leading-[8px]",children:"Direction"}),i.jsx("div",{onClick:ae,className:"h-5 px-2 py-1.5 rounded-md border border-[#353535] justify-start items-center gap-2 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-[#cdcdcd] text-[11px] font-semibold font-manrope leading-[8px] pointer-events-none",children:"Clear"})})]}),i.jsxs("div",{className:"relative w-full max-w-[244px]",children:[i.jsxs("div",{className:`${(Xn=e.advancedFilters)!=null&&Xn.directionFeed?"border border-[#8d67ff]":""} flex justify-between items-center bg-[#353535] text-white rounded-md py-3 px-2.5 cursor-pointer select-none h-8`,onClick:ne,children:[i.jsx("span",{className:`${(or=e.advancedFilters)!=null&&or.directionFeed?"text-white":"text-[#7c7c7c]"} text-sm font-semibold font-manrope leading-[8px]`,children:((lr=e.advancedFilters)==null?void 0:lr.directionFeed)||"Select Direction"}),i.jsx(Yh,{className:`w-3.5 h-3.5 transition ${I?"rotate-180":""}`})]}),I&&i.jsx("div",{className:"w-full bg-[#353535] rounded-md mt-[2px] p-1 transition-all duration-200",children:i.jsx("div",{className:"max-h-40 overflow-y-auto",children:jt==null?void 0:jt.map((Qt,zn)=>i.jsx("div",{onClick:()=>ee(Qt),className:"flex items-center gap-2 p-[7px] h-8 relative rounded hover:bg-[#464646] cursor-pointer text-white text-sm font-semibold font-manrope",children:Qt},zn))})})]})]})]})}const Zin=({advancedFilters:e,setAdvancedFilters:t,getFeedClearData:n,getFeedData:r,dataCoin:s,selectedCoins:a,setSelectedCoins:o,isLoadingCoin:l,setIsLoadingCoin:c,walletTagData:u,walletTags:d,searchWalletSellect:f,setSearchWalletSellect:x,walletTagLoading:g,tradeWalletData:v,selectTradeWalletData:w,setSelectTradeWalletData:C,searchTagSellect:N,setSearchTagSellect:P,isWalletLoading:I})=>i.jsxs("div",{className:"bg-[#232323] rounded-2xl min-h-[380px] min-w-max lg:min-w-[286px] max-w-[286px] p-1 py-3 font-manrope overflow-hidden relative h-[calc(100vh-236px)] mt-4",children:[i.jsxs("div",{className:"w-full flex justify-between items-center pt-[2px] pl-4 pr-1 pb-[10px]",children:[i.jsx("div",{className:"text-white text-base font-semibold font-manrope leading-[8px]",children:"Filters"}),i.jsx("div",{onClick:()=>{n()},className:"h-5 px-2 py-1.5 bg-[#3d3d3d] rounded-md justify-start items-center gap-2 inline-flex mr-3 cursor-pointer",children:i.jsx("div",{className:"text-[#cdcdcd] text-[11px] font-semibold font-manrope leading-[8px] pointer-events-none",children:"Clear All"})})]}),i.jsx("div",{className:"h-full w-full overflow-y-scroll font-manrope py-1 pl-4 pr-3",children:i.jsx("div",{className:"font-manrope font-normal pb-[120px] sm:pb-[80px] max-w-[256px]",children:i.jsx(Qin,{advancedFilters:e,setAdvancedFilters:t,dataCoin:s,selectedCoins:a,setSelectedCoins:o,isLoadingCoin:l,setIsLoadingCoin:c,walletTagData:u,searchWalletSellect:f,setSearchWalletSellect:x,walletTagLoading:g,tradeWalletData:v,selectTradeWalletData:w,setSelectTradeWalletData:C,searchTagSellect:N,setSearchTagSellect:P,walletTags:d,isWalletLoading:I})})}),i.jsx("div",{className:"absolute bottom-0 w-full",children:i.jsx("div",{className:"sticky h-12 bg-[#1b1b1b]/30 rounded-bl-2xl rounded-br-2xl border-t border-[#353535] backdrop-blur-[32px] min-h-14 pt-[11px] w-full z-10",children:i.jsx("div",{className:"flex justify-center -ml-3",children:i.jsx("div",{onClick:()=>r(),className:"w-[234px] h-8 px-6 py-3 bg-[#7445ff] rounded-[10px] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-[#8860ff] justify-center items-center gap-2.5 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px] pointer-events-none",children:"Apply Filters"})})})})})]});var Jin={cm:!0,mm:!0,in:!0,px:!0,pt:!0,pc:!0,em:!0,ex:!0,ch:!0,rem:!0,vw:!0,vh:!0,vmin:!0,vmax:!0,"%":!0};function ean(e){if(typeof e=="number")return{value:e,unit:"px"};var t,n=(e.match(/^[0-9.]*/)||"").toString();n.includes(".")?t=parseFloat(n):t=parseInt(n,10);var r=(e.match(/[^0-9]*$/)||"").toString();return Jin[r]?{value:t,unit:r}:(console.warn("React Spinners: ".concat(e," is not a valid css value. Defaulting to ").concat(t,"px.")),{value:t,unit:"px"})}function lw(e){var t=ean(e);return"".concat(t.value).concat(t.unit)}var Fne=function(e,t,n){var r="react-spinners-".concat(e,"-").concat(n);if(typeof window>"u"||!window.document)return r;var s=document.createElement("style");document.head.appendChild(s);var a=s.sheet,o=`
@keyframes `.concat(r,` {
`).concat(t,`
}
`);return a&&a.insertRule(o,0),r},WL=function(){return WL=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s])}return e},WL.apply(this,arguments)},tan=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,r=Object.getOwnPropertySymbols(e);s<r.length;s++)t.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(e,r[s])&&(n[r[s]]=e[r[s]]);return n},nan=Fne("BeatLoader","50% {transform: scale(0.75);opacity: 0.2} 100% {transform: scale(1);opacity: 1}","beat");function QUe(e){var t=e.loading,n=t===void 0?!0:t,r=e.color,s=r===void 0?"#000000":r,a=e.speedMultiplier,o=a===void 0?1:a,l=e.cssOverride,c=l===void 0?{}:l,u=e.size,d=u===void 0?15:u,f=e.margin,x=f===void 0?2:f,g=tan(e,["loading","color","speedMultiplier","cssOverride","size","margin"]),v=WL({display:"inherit"},c),w=function(C){return{display:"inline-block",backgroundColor:s,width:lw(d),height:lw(d),margin:lw(x),borderRadius:"100%",animation:"".concat(nan," ").concat(.7/o,"s ").concat(C%2?"0s":"".concat(.35/o,"s")," infinite linear"),animationFillMode:"both"}};return n?m.createElement("span",WL({style:v},g),m.createElement("span",{style:w(1)}),m.createElement("span",{style:w(2)}),m.createElement("span",{style:w(3)})):null}var qL=function(){return qL=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s])}return e},qL.apply(this,arguments)},ran=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,r=Object.getOwnPropertySymbols(e);s<r.length;s++)t.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(e,r[s])&&(n[r[s]]=e[r[s]]);return n},_Ce=[Fne("PuffLoader","0% {transform: scale(0)} 100% {transform: scale(1.0)}","puff-1"),Fne("PuffLoader","0% {opacity: 1} 100% {opacity: 0}","puff-2")];function ZUe(e){var t=e.loading,n=t===void 0?!0:t,r=e.color,s=r===void 0?"#000000":r,a=e.speedMultiplier,o=a===void 0?1:a,l=e.cssOverride,c=l===void 0?{}:l,u=e.size,d=u===void 0?60:u,f=ran(e,["loading","color","speedMultiplier","cssOverride","size"]),x=qL({display:"inherit",position:"relative",width:lw(d),height:lw(d)},c),g=function(v){return{position:"absolute",height:lw(d),width:lw(d),border:"thick solid ".concat(s),borderRadius:"50%",opacity:"1",top:"0",left:"0",animationFillMode:"both",animation:"".concat(_Ce[0],", ").concat(_Ce[1]),animationDuration:"".concat(2/o,"s"),animationIterationCount:"infinite",animationTimingFunction:"cubic-bezier(0.165, 0.84, 0.44, 1), cubic-bezier(0.3, 0.61, 0.355, 1)",animationDelay:v===1?"-1s":"0s"}};return n?m.createElement("span",qL({style:x},f),m.createElement("span",{style:g(1)}),m.createElement("span",{style:g(2)})):null}function san({feedData:e}){var l,c;const[t,n]=m.useState(null);function r({date:u}){const[d,f]=m.useState(Mo(u));return m.useEffect(()=>{const x=setInterval(()=>{f(Mo(u))},1e3);return()=>clearInterval(x)},[u]),i.jsx("span",{className:"text-xs text-[#a5a5a5] font-normal",children:d.dateTime})}const s=u=>n(u),a=()=>n(null),o=u=>u?["Sell","Close Short","Open Short"].includes(u)||u.includes("Short")?"Short":["Buy","Close Long","Open Long"].includes(u)||u.includes("Long")?"Long":u:"-";return i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"flex lg:hidden flex-col gap-3 w-full font-manrope font-semibold pb-2",children:[(!e||e.length===0)&&i.jsx("div",{className:"flex justify-center items-center w-full py-10",children:i.jsx(ZUe,{color:"#ffffff",size:40})}),e==null?void 0:e.map((u,d)=>{var f,x,g,v,w,C;return i.jsxs("div",{children:[i.jsxs("div",{className:"w-full border-2 border-[#232323] rounded-tl-xl rounded-tr-xl p-3 flex items-start gap-3 cursor-pointer",onClick:()=>s(u),children:[i.jsxs("div",{className:"w-8 h-8 bg-[#6ed8ff] rounded-full flex items-center justify-center relative",children:[i.jsx("img",{src:Gi,alt:"",className:"w-6 h-6"}),(u==null?void 0:u.target_platform)==="hyper"?i.jsx("div",{className:"absolute top-12 flex justify-start items-center gap-2",children:i.jsx("img",{src:dx,alt:"hyper",className:"w-4 h-4 rounded-sm"})}):(u==null?void 0:u.target_platform)==="lighter"?i.jsx("div",{className:"absolute top-12 flex justify-start items-center gap-2",children:i.jsx(Xf,{className:"w-4 h-4 text-[#fff]"})}):""]}),i.jsxs("div",{className:"flex flex-col gap-1",children:[i.jsxs("div",{className:"flex items-center gap-2 text-white text-sm font-semibold",children:[u!=null&&u.listen_user?u.listen_user.slice(0,5)+"..."+u.listen_user.slice(-4):"-",i.jsx("img",{src:wo,alt:"",className:"w-4 h-4 cursor-pointer",onClick:N=>{N.stopPropagation(),navigator.clipboard.writeText((u==null?void 0:u.listen_user)||""),rn.success("Successfully copied.",{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(103, 255, 189, 0.16)",width:"280px",minWidth:"280px",height:"40px",backdropFilter:"blur(16px)"},iconTheme:{primary:"#67FFBD",secondary:"#276047"}})}})]}),i.jsxs("div",{className:"flex flex-col text-xs text-[#a5a5a5]",children:[i.jsx("span",{children:su(u==null?void 0:u.time)}),i.jsx(r,{date:u==null?void 0:u.time})]}),i.jsxs("div",{className:"text-xs font-semibold",children:[i.jsx("span",{className:"text-white",children:"Size:"})," ",u!=null&&u.sz?Er(u==null?void 0:u.sz):"-"]}),i.jsxs("div",{className:"text-xs font-semibold",children:[i.jsx("span",{className:"text-white",children:"Entry Price:"})," ",u!=null&&u.markPrice?"$"+Er(u==null?void 0:u.markPrice):"-"]}),i.jsxs("div",{className:"flex justify-start items-center gap-2",children:[i.jsx("img",{src:`https://app.hyperliquid.xyz/coins/${u==null?void 0:u.coin}.svg`||Va,onError:N=>ra(N),alt:"",className:"w-5 h-5"}),i.jsxs("div",{className:"text-[13px] text-white font-bold",children:[u==null?void 0:u.coin,"/",(u==null?void 0:u.feeToken)||"USDC"]}),i.jsxs("div",{className:`${o(u==null?void 0:u.dir)==="Long"?"bg-[#67ffbd]/20 text-[#67ffbd]":o(u==null?void 0:u.dir)==="Short"?"bg-[#ff797c]/20 text-[#ff797c]":(u==null?void 0:u.dir)==="Buy"?"bg-[#67ffbd]/20 text-[#67ffbd]":(u==null?void 0:u.dir)==="Sell"?"bg-[#ff797c]/20 text-[#ff797c]":"bg-[#767676]/20 text-[#cccccc]"} h-5 pl-2 pr-2 py-1 rounded-md flex items-center gap-1 w-max`,children:[i.jsx("div",{className:"w-3 h-3",children:(f=u==null?void 0:u.dir)!=null&&f.includes("Long")?(u==null?void 0:u.dir)==="Short > Long"?i.jsx(Ps,{className:"text-[#67ffbd] rotate-180 w-3 h-3"}):(u==null?void 0:u.dir)==="Long > Short"?i.jsx(Ps,{className:"text-[#ff797c] w-3 h-3"}):i.jsx(Ps,{className:"text-[#67ffbd] rotate-180 w-3 h-3"}):(u==null?void 0:u.dir)==="Buy"?i.jsx(Ps,{className:"text-[#67ffbd] rotate-180 w-3 h-3"}):i.jsx(Ps,{className:"text-[#ff797c] w-3 h-3"})}),i.jsxs("div",{className:"text-[11px] font-semibold",children:[(u==null?void 0:u.dir)||"-"," ",u!=null&&u.leverage?`${u.leverage}x`:""]})]})]})]})]}),i.jsx("div",{className:`${u!=null&&u.success?"bg-[#67ffbd]/20 border-[#67ffbd]/25":"bg-[#ff797c]/20 border-[#ff797c]/25"} flex justify-start items-center h-8 max-h-8 rounded-bl-[18px] rounded-br-[18px] border-t w-full py-1.5`,children:i.jsxs("div",{className:"text-white text-sm font-manrope leading-none flex justify-start items-center px-2 gap-2",children:[u!=null&&u.success?i.jsx("img",{src:pM,alt:""}):i.jsx("img",{src:mM,alt:""}),i.jsx("div",{className:`${u!=null&&u.success?"text-[#67ffbd]":"text-[#ff787b]"} text-xs font-bold font-manrope leading-3 tracking-tight`,children:u!=null&&u.success?"Status:":"System Message:"}),i.jsx("div",{className:"text-white text-xs font-semibold font-manrope leading-3 tracking-tight -ml-1",children:u!=null&&u.success?((x=u==null?void 0:u.message)==null?void 0:x.split("-")[0])||"-":"For details, use web version"}),i.jsx("div",{onClick:()=>{window.open(`/wallet-details/${u==null?void 0:u.trader_wallet}`,"_blank")},className:"h-[18px] px-1.5 py-1 bg-white rounded-[256px] justify-center items-center gap-0.5 inline-flex cursor-pointer -ml-0.5",children:i.jsx("div",{className:"w-14 text-center truncate overflow-hidden whitespace-nowrap text-[#273f35] text-xs font-semibold font-manrope leading-[13px]",children:u!=null&&u.wallet_name?u==null?void 0:u.wallet_name:u!=null&&u.trader_wallet?((g=u==null?void 0:u.trader_wallet)==null?void 0:g.slice(0,5))+"..."+((v=u==null?void 0:u.trader_wallet)==null?void 0:v.slice(-4)):"--"})}),i.jsxs("div",{className:"text-white text-xs font-semibold font-manrope leading-3 tracking-tight -ml-0.5",children:["by"," "]}),i.jsx("div",{onClick:()=>{window.open(`/wallet-details/${u==null?void 0:u.listen_user}`,"_blank")},className:"h-[18px] px-1.5 py-1 bg-[#a5ffd8] rounded-[256px] justify-center items-center gap-0.5 inline-flex -ml-0.5 cursor-pointer",children:i.jsx("div",{className:"w-14 text-center truncate overflow-hidden whitespace-nowrap text-[#1e563e] text-xs font-semibold font-manrope leading-[13px]",children:u!=null&&u.tag?u==null?void 0:u.tag:u!=null&&u.listen_user?((w=u==null?void 0:u.listen_user)==null?void 0:w.slice(0,5))+"..."+((C=u==null?void 0:u.listen_user)==null?void 0:C.slice(-4)):"--"})})]})})]},d)})]}),t&&i.jsx(up,{isOpen:!!t,onClose:a,children:i.jsxs("div",{className:"flex flex-col gap-4 p-2 font-manrope font-semibold",children:[i.jsxs("div",{className:"flex gap-2 items-center",children:[i.jsx("div",{className:"w-8 h-8 bg-[#6ed8ff] rounded-full flex items-center justify-center",children:i.jsx("img",{src:Gi,alt:"",className:"w-6 h-6"})}),i.jsxs("div",{className:"flex flex-col",children:[i.jsxs("div",{className:"inline-flex items-center gap-2",children:[i.jsx("div",{className:"text-white text-sm font-semibold",children:t!=null&&t.listen_user?t.listen_user.slice(0,5)+"..."+t.listen_user.slice(-4):"-"}),i.jsx("span",{onClick:()=>{navigator.clipboard.writeText((t==null?void 0:t.listen_user)||"")},children:i.jsx("img",{src:wo,alt:"",className:"w-4 h-4 cursor-pointer",onClick:u=>{u.stopPropagation(),navigator.clipboard.writeText((t==null?void 0:t.listen_user)||"")}})})]}),i.jsxs("div",{className:"flex flex-col text-[11px] text-[#a5a5a5]",children:[i.jsx("span",{children:su(t==null?void 0:t.time)}),i.jsx(r,{date:t==null?void 0:t.time})]})]})]}),i.jsxs("div",{className:"flex flex-col gap-2 text-sm text-[#9b9b9b]",children:[i.jsxs("div",{className:"text-white flex items-center gap-2",children:[i.jsx("img",{src:t!=null&&t.success?pM:mM,alt:"",className:"w-4 h-4"}),"Status: ",t!=null&&t.success?"Success":"Failed"]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-white",children:"Order ID:"})," ",(t==null?void 0:t.oid)||"-"]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-white",children:"Type:"})," ",(t==null?void 0:t.fill_direction_type)||"-"]}),i.jsxs("div",{className:"flex items-center gap-1 text-white",children:["Direction:",i.jsxs("div",{className:`${o(t==null?void 0:t.dir)==="Long"?"bg-[#67ffbd]/20 text-[#67ffbd]":o(t==null?void 0:t.dir)==="Short"?"bg-[#ff797c]/20 text-[#ff797c]":(t==null?void 0:t.dir)==="Buy"?"bg-[#67ffbd]/20 text-[#67ffbd]":(t==null?void 0:t.dir)==="Sell"?"bg-[#ff797c]/20 text-[#ff797c]":"bg-[#767676]/20 text-[#cccccc]"} h-5 pl-1 pr-1.5 py-1 rounded-md flex items-center gap-1`,children:[i.jsx("div",{className:"w-3 h-3",children:(l=t==null?void 0:t.dir)!=null&&l.includes("Long")?(t==null?void 0:t.dir)==="Short > Long"?i.jsx(Ps,{className:"text-[#67ffbd] rotate-180 w-3 h-3"}):(t==null?void 0:t.dir)==="Long > Short"?i.jsx(Ps,{className:"text-[#ff797c] w-3 h-3"}):i.jsx(Ps,{className:"text-[#67ffbd] rotate-180 w-3 h-3"}):(t==null?void 0:t.dir)==="Buy"?i.jsx(Ps,{className:"text-[#67ffbd] rotate-180 w-3 h-3"}):i.jsx(Ps,{className:"text-[#ff797c] w-3 h-3"})}),i.jsxs("div",{className:"text-[11px] font-semibold",children:[(t==null?void 0:t.dir)||"-"," ",t!=null&&t.leverage?`${t.leverage}x`:""]})]})]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-white",children:"Price:"})," ",t!=null&&t.px?"$"+Er(t==null?void 0:t.px):"-"]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-white",children:"Size:"})," ",t!=null&&t.sz?Er(t==null?void 0:t.sz):"-"]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-white",children:"Entry Price:"})," ",t!=null&&t.markPrice?"$"+Er(t==null?void 0:t.markPrice):"-"]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-white",children:"PnL:"})," ",t!=null&&t.closedPnl?"$"+Er(Math.abs(t==null?void 0:t.closedPnl)):"-"]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-white",children:"Fee:"})," ",t!=null&&t.fee?"$"+Er(Math.abs(t==null?void 0:t.fee)):"-"]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-white",children:"Margin Mode:"})," ",(t==null?void 0:t.is_cross)==null||t!=null&&t.is_cross?"Cross":"Isolated"]}),i.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[i.jsx("img",{src:`https://app.hyperliquid.xyz/coins/${t==null?void 0:t.coin}.svg`||Va,onError:u=>ra(u),alt:"",className:"w-5 h-5"}),i.jsxs("span",{className:"font-bold text-white",children:[t==null?void 0:t.coin,"/",(t==null?void 0:t.feeToken)||"USDC"]})]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-white",children:"Message: "}),((c=t==null?void 0:t.message)==null?void 0:c.split("-")[0])||"-"]})]})]})})]})}const ian=()=>{var $t;const{isConnected:e,address:t}=ns(),{setSignModalOpen:n,copyTradeWatchList:r,hyperToken:s}=m.useContext(Qr),[a,o]=m.useState(!1),[l,c]=m.useState(!1),[u,d]=m.useState([]),f=m.useRef(null),[x,g]=m.useState(0),[v,w]=m.useState(!1),[C,N]=m.useState(!0),[P,I]=m.useState([]),[R,F]=m.useState(!0),[U,L]=m.useState([]),[z,Q]=m.useState([]),[ne,J]=m.useState([]),[X,re]=m.useState([]),[pe,Y]=m.useState([]),[ie,oe]=m.useState(!1),[G,V]=m.useState([]),[ee,ae]=m.useState([]),Ne=localStorage.getItem("isDateCopyTradeFormat")||"date",[he,ge]=m.useState(Ne),[ye,ve]=m.useState(!1);m.useEffect(()=>{localStorage.setItem("isDateCopyTradeFormat",he)},[he]),m.useEffect(()=>{(async()=>{var Ye,ht;try{const zt=await(await fetch("https://dextrabothypev2.nftinit.io/api/hyper/get_coins/")).json(),Et=()=>xi.random().hex(),nt=(ht=(Ye=zt.coins)==null?void 0:Ye.filter(Ue=>!Ue.startsWith("@")&&!Ue.endsWith("/USDC")))==null?void 0:ht.map(Ue=>({value:Ue,label:Ue.endsWith("/USDC")?Ue+" (Spot)":Ue,icon:`https://app.hyperliquid.xyz/coins/${Ue}.svg`,color:Et()}));I(nt),F(!1)}catch(Zt){console.error("Data extraction error:",Zt),F(!1)}})()},[]);const[je,Ie]=m.useState({userWalletFeed:"",coinFeed:"",positionFeed:[],directionFeed:"",statusFeed:"",typeFeed:"",dexMarket:[]});m.useEffect(()=>{const qe=["Open Position","Increase","Decrease","Changed Position","Position Closed","Other"],Ye=localStorage.getItem("positionFeed"),ht=Ye&&Array.isArray(JSON.parse(Ye))?JSON.parse(Ye):qe;Ie(Zt=>({...Zt,positionFeed:ht}))},[]);const Le=m.useRef(je);m.useEffect(()=>{Le.current=je},[je]);const Qe=async(qe=!1)=>{var ht,Zt,zt;g(0),w(!0),N(!0);const Ye=window.localStorage.getItem("hyperToken");try{o(!0),c(!0);const Et=window.localStorage.getItem("hyperAddress");if(!Ye){n(!0);return}const nt={};(G==null?void 0:G.length)>0&&(nt.copy_trader=G),(ne==null?void 0:ne.length)>0&&(nt.trader=ne),(ee==null?void 0:ee.length)>0&&(nt.tag=ee),((ht=je==null?void 0:je.coinFeed)==null?void 0:ht.length)>0&&(nt.coin=je.coinFeed.includes(",")?je.coinFeed.split(",").map(Nn=>Nn.trim()):je.coinFeed);const Ue=localStorage.getItem("positionFeed"),Rt=qe?Ue&&JSON.parse(Ue)||["Open Position","Increase","Decrease","Changed Position","Position Closed","Other"]:je.positionFeed;(Rt==null?void 0:Rt.length)>0&&(Rt==null?void 0:Rt.length)<6&&(nt.position=Rt),((Zt=je==null?void 0:je.typeFeed)==null?void 0:Zt.length)>0&&((zt=je==null?void 0:je.typeFeed)==null?void 0:zt.length)<7&&(nt.type=je.typeFeed),je!=null&&je.directionFeed&&(nt.direction=je.directionFeed),je!=null&&je.statusFeed&&(je.statusFeed==="On"?nt.status=!0:je.statusFeed==="Off"?nt.status=!1:je.statusFeed==="All"&&delete nt.status);const We=((je==null?void 0:je.dexMarket)||[]).map(Nn=>Nn.toLowerCase()),at=We.includes("hyperliquid"),mt=We.includes("lighter"),Dt=[];at&&!mt?Dt.push("https://dextrabothypev2.nftinit.io/api/hyper/trade/feed_new/"):mt&&!at?Dt.push("https://dextrabothypev2.nftinit.io/api/hyper/trade/feed_new_lg/"):Dt.push("https://dextrabothypev2.nftinit.io/api/hyper/trade/feed_new/","https://dextrabothypev2.nftinit.io/api/hyper/trade/feed_new_lg/");const Tt=await Promise.all(Dt.map(Nn=>fetch(Nn,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:t?t.toLowerCase():Et,token:Ye,offset:0,...Object.keys(nt).length&&{filters:nt}})}))),on=(await Promise.all(Tt.map(Nn=>Nn.json()))).filter(Nn=>Nn.success&&Array.isArray(Nn.data)).flatMap(Nn=>Nn.data).sort((Nn,kn)=>new Date(kn.time)-new Date(Nn.time));d(on),g(Nn=>Nn+50),on.length<50&&N(!1);const gn=on.map(Nn=>({wallet:Nn.trader_wallet,name:Nn.wallet_name}));Q(Nn=>{const kn=new Map(Nn.map(yn=>[yn.wallet,yn.name]));return gn.forEach(yn=>{kn.has(yn.wallet)||kn.set(yn.wallet,yn.name)}),Array.from(kn,([yn,Vn])=>({wallet:yn,name:Vn}))})}catch(Et){console.log("Error :>> ",Et)}finally{o(!1),c(!1),w(!1)}},$e=async()=>{const qe=window.localStorage.getItem("hyperToken");try{oe(!0);const Ye="https://dextrabothypev2.nftinit.io/api/hyper/trade/feed/tag_list/",ht=window.localStorage.getItem("hyperAddress");if(!qe){n(!0);return}const Zt=await fetch(Ye,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:t?t.toLowerCase():ht,token:qe})});if(!Zt.ok)throw new Error(`Server responded with status ${Zt.status}`);const zt=await Zt.json();if(zt.success){re(zt==null?void 0:zt.data);const Et=zt==null?void 0:zt.data.map(nt=>nt.tag?{tag:nt.tag,wallet:nt.wallet_address}:null).filter(nt=>nt!==null);Y(Et)}else console.log(zt.error_message)}catch(Ye){console.log("Error :>> ",Ye)}finally{oe(!1)}};m.useEffect(()=>{Qe(!0),$e()},[s]);const it=async()=>{g(0),w(!0),N(!0);const qe=window.localStorage.getItem("hyperToken");try{o(!0);const Ye=window.localStorage.getItem("hyperAddress");if(!qe){n(!0);return}const ht=((je==null?void 0:je.dexMarket)||[]).map(We=>We.toLowerCase()),Zt=ht.includes("hyperliquid"),zt=ht.includes("lighter"),Et=[];Zt&&!zt?Et.push("https://dextrabothypev2.nftinit.io/api/hyper/trade/feed_new/"):zt&&!Zt?Et.push("https://dextrabothypev2.nftinit.io/api/hyper/trade/feed_new_lg/"):Et.push("https://dextrabothypev2.nftinit.io/api/hyper/trade/feed_new/","https://dextrabothypev2.nftinit.io/api/hyper/trade/feed_new_lg/");const nt=await Promise.all(Et.map(We=>fetch(We,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:t?t.toLowerCase():Ye,token:qe,offset:0})}))),Rt=(await Promise.all(nt.map(We=>We.json()))).filter(We=>We.success&&Array.isArray(We.data)).flatMap(We=>We.data).sort((We,at)=>new Date(at.time)-new Date(We.time));d(Rt),g(We=>We+50),Rt.length<50&&N(!1),localStorage.setItem("positionFeed",JSON.stringify([])),Ie({userWalletFeed:"",coinFeed:"",positionFeed:[],directionFeed:"",statusFeed:"",typeFeed:[],dexMarket:[]}),L([]),V([]),J([]),ae([])}catch(Ye){console.log("Error :>> ",Ye)}finally{o(!1),w(!1)}},tt=async()=>{var Ye,ht,Zt,zt,Et;if(v)return;w(!0);const qe=window.localStorage.getItem("hyperToken");try{const nt=window.localStorage.getItem("hyperAddress");if(!qe){n(!0);return}const Ue={};(G==null?void 0:G.length)>0&&(Ue.copy_trader=G),(ne==null?void 0:ne.length)>0&&(Ue.trader=ne),(ee==null?void 0:ee.length)>0&&(Ue.tag=ee),je!=null&&je.coinFeed&&((Ye=je==null?void 0:je.coinFeed)==null?void 0:Ye.length)>0&&(Ue.coin=je.coinFeed.includes(",")?je.coinFeed.split(",").map(gn=>gn.trim()):je.coinFeed),((ht=je==null?void 0:je.positionFeed)==null?void 0:ht.length)>0&&((Zt=je==null?void 0:je.positionFeed)==null?void 0:Zt.length)<6&&(Ue.position=je.positionFeed),((zt=je==null?void 0:je.typeFeed)==null?void 0:zt.length)>0&&((Et=je==null?void 0:je.typeFeed)==null?void 0:Et.length)<7&&(Ue.type=je.typeFeed),je!=null&&je.directionFeed&&(Ue.direction=je.directionFeed),je!=null&&je.statusFeed&&(je.statusFeed==="On"?Ue.status=!0:je.statusFeed==="Off"?Ue.status=!1:je.statusFeed==="All"&&delete Ue.status);const Rt=((je==null?void 0:je.dexMarket)||[]).map(gn=>gn.toLowerCase()),We=Rt.includes("hyperliquid"),at=Rt.includes("lighter"),mt=[];We&&!at?mt.push("https://dextrabothypev2.nftinit.io/api/hyper/trade/feed_new/"):at&&!We?mt.push("https://dextrabothypev2.nftinit.io/api/hyper/trade/feed_new_lg/"):mt.push("https://dextrabothypev2.nftinit.io/api/hyper/trade/feed_new/","https://dextrabothypev2.nftinit.io/api/hyper/trade/feed_new_lg/");const Dt=await Promise.all(mt.map(gn=>fetch(gn,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:t?t.toLowerCase():nt,token:qe,offset:x,...Object.keys(Ue).length&&{filters:Ue}})}))),dn=(await Promise.all(Dt.map(gn=>gn.json()))).filter(gn=>gn.success&&Array.isArray(gn.data)).flatMap(gn=>gn.data).sort((gn,Nn)=>new Date(Nn.time)-new Date(gn.time));d(gn=>[...gn,...dn].sort((kn,yn)=>new Date(yn.time)-new Date(kn.time))),g(gn=>gn+50),dn.length<50&&N(!1);const on=dn.map(gn=>({wallet:gn.trader_wallet,name:gn.wallet_name}));Q(gn=>{const Nn=new Set(gn.map(yn=>yn.wallet)),kn=[...gn];return on.forEach(yn=>{Nn.has(yn.wallet)||(Nn.add(yn.wallet),kn.push(yn))}),kn})}catch(nt){console.log("Error :>> ",nt)}finally{w(!1)}},lt=(qe,Ye)=>{let ht;return function(...Zt){clearTimeout(ht),ht=setTimeout(()=>{qe.apply(this,Zt)},Ye)}},ft=()=>{const qe=f.current;qe.scrollTop+qe.clientHeight>=qe.scrollHeight-10&&C&&!v&&tt()};m.useEffect(()=>{const qe=lt(ft,300),Ye=f.current;return Ye.addEventListener("scroll",qe),()=>{Ye.removeEventListener("scroll",qe)}},[x,C,v]);const ut=m.useRef(null),qt=m.useRef(!1),It=m.useRef(t),nn=m.useRef(r),jt=m.useRef(s);m.useEffect(()=>{It.current=t},[t]),m.useEffect(()=>{nn.current=r},[r]),m.useEffect(()=>{jt.current=s},[s]);const cn="hyper_get_trade_message";m.useEffect(()=>{if(!s||qt.current)return;const qe=Ny("https://dextrabothypesocketv2.nftinit.io/");return ut.current=qe,qt.current=!0,qe.on("connect",()=>{console.log("Socket connected");const Ye=()=>{var zt;const ht=(zt=It.current)==null?void 0:zt.toLowerCase(),Zt=jt.current;ht&&Zt?qe.emit("subscribe",{login:ht,token:Zt}):setTimeout(Ye,300)};Ye()}),qe.on(cn,function(Ye){var Rt;const ht=Le.current,Zt=(Rt=(ht==null?void 0:ht.dexMarket)||[])==null?void 0:Rt.map(We=>We.toLowerCase()),zt=Zt.includes("hyperliquid"),Et=Zt.includes("lighter"),Ue=(Array.isArray(Ye)?Ye:[Ye]).filter(We=>We!=null&&We.target_platform?zt&&!Et?We.target_platform==="hyper":Et&&!zt?We.target_platform==="lighter":!0:!1);d(We=>{const at=[...Ue,...We],mt=Le.current;return at==null?void 0:at.filter(Tt=>{var dn,on,gn,Nn,kn,yn,Vn,Gn,Dn;if(!Tt||(G==null?void 0:G.length)>0&&!(G!=null&&G.includes((dn=Tt==null?void 0:Tt.listen_user)==null?void 0:dn.toLowerCase()))||(ne==null?void 0:ne.length)>0&&!(ne!=null&&ne.includes((on=Tt==null?void 0:Tt.trader_wallet)==null?void 0:on.toLowerCase()))||(ee==null?void 0:ee.length)>0&&!(ee!=null&&ee.includes(Tt==null?void 0:Tt.tag))||((gn=mt.coinFeed)==null?void 0:gn.length)>0&&!((Nn=mt.coinFeed)!=null&&Nn.includes(Tt==null?void 0:Tt.coin)))return!1;if(((kn=mt==null?void 0:mt.typeFeed)==null?void 0:kn.length)>0){const Cn=((yn=mt==null?void 0:mt.typeFeed)==null?void 0:yn.includes("Twaps"))&&(Tt==null?void 0:Tt.is_twap)===!0,sn=(Tt==null?void 0:Tt.fill_direction_type)&&((Vn=mt==null?void 0:mt.typeFeed)==null?void 0:Vn.includes(Tt==null?void 0:Tt.fill_direction_type));if(!(Cn||sn))return!1}if(((Gn=mt==null?void 0:mt.positionFeed)==null?void 0:Gn.length)>0){const Kn=Ft(Tt);if(!((Dn=mt==null?void 0:mt.positionFeed)!=null&&Dn.includes(Kn)))return!1}else return!0;return!(mt!=null&&mt.directionFeed&&un(Tt)!==(mt==null?void 0:mt.directionFeed))})})}),qe.io.on("reconnect_attempt",Ye=>{console.log("reconnect_attempt",Ye)}),qe.io.on("reconnect",Ye=>{console.log("reconnect",Ye),qe.emit("room",cn)}),qe.io.on("reconnect_failed",()=>{console.log("reconnect_failed")}),qe.io.on("reconnect_error",Ye=>{console.log("reconnect_error",Ye)}),qe.io.on("error",Ye=>{console.log("error",Ye)}),qe.on("disconnect",()=>{console.log("Socket disconnected"),qt.current=!1}),()=>{qe.disconnect(),console.log("Socket cleanup on unmount")}},[s]);const un=qe=>qe!=null&&qe.dir?["Sell","Close Short","Open Short"].includes(qe==null?void 0:qe.dir)?"Short":["Buy","Close Long","Open Long"].includes(qe==null?void 0:qe.dir)?"Long":(qe==null?void 0:qe.dir)||"--":"--",Ft=qe=>{var Zt,zt;const Ye=(zt=(Zt=qe.message)==null?void 0:Zt.split("-")[0])==null?void 0:zt.trim();if(!Ye)return"Other";const ht=/^Position Changed \(/;return Ye==="Close Position"?"Position Closed":Ye==="Position Increase"?"Increase":Ye==="Position Decreased"?"Decrease":ht.test(Ye)?"Changed Position":Ye==="Open Position"?"Open Position":"Other"};function Ke({date:qe}){const[Ye,ht]=m.useState(Mo(qe));return m.useEffect(()=>{const Zt=setInterval(()=>{ht(Mo(qe))},1e3);return()=>clearInterval(Zt)},[qe]),i.jsx("span",{className:"text-[#a5a5a5] text-[11px] font-normal font-manrope leading-[13px] tracking-tight",children:Ye.dateTime})}const Bt={kBONK:"BONK",kPEPE:"PEPE",kSHIB:"SHIB",kFLOKI:"FLOKI",kNEIRO:"NEIRO",kDOGS:"DOGS",kLUNC:"LUNC"};return i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"lg:hidden flex flex-col w-full p-2",children:i.jsx("button",{className:"px-2 py-2 text-xs font-medium rounded border border-gray-600 text-white hover:bg-[#1D1D1D] w-full bg-[#171717]",onClick:()=>ve(!ye),children:ye?"Hide Filters":"Show Filters"})}),i.jsx("div",{className:`${ye?"block":"hidden"} lg:block mx-auto`,children:i.jsx(Zin,{advancedFilters:je,setAdvancedFilters:Ie,getFeedData:Qe,getFeedClearData:it,dataCoin:P,selectedCoins:U,setSelectedCoins:L,isLoadingCoin:R,setIsLoadingCoin:F,walletTagData:X,walletTags:pe,searchWalletSellect:G,setSearchWalletSellect:V,walletTagLoading:ie,tradeWalletData:z,selectTradeWalletData:ne,setSelectTradeWalletData:J,searchTagSellect:ee,setSearchTagSellect:ae,isWalletLoading:l})}),i.jsx(san,{feedData:u}),i.jsx("div",{ref:f,className:"hidden lg:flex flex-col items-start justify-start mt-4 overflow-scroll xl:min-w-max max-h-[calc(100%-50px)]",children:!u||(u==null?void 0:u.length)==0||a?i.jsx("div",{className:"flex w-full justify-center items-center",children:i.jsx("div",{className:"flex min-h-[72vh] w-[100%] sm:w-[75%] min-w-[970px] justify-center items-center text-center",children:a?i.jsx(Da,{}):i.jsx("div",{className:"flex justify-center items-center min-w-[480px]",children:i.jsxs("div",{className:"flex flex-col justify-center items-center gap-3 min-w-max overflow-x-hidden",children:[i.jsx("img",{src:ac,alt:""}),i.jsxs("div",{className:"flex flex-col items-center h-max gap-3",children:[i.jsx("div",{className:"text-[#d3d3d3] text-sm font-semibold font-manrope leading-[8px] pt-3",children:"The activities of the follower wallets will be displayed on this page."}),i.jsx("div",{className:"text-center -mt-2",children:i.jsxs("span",{className:"text-[#979797] text-[13px] font-normal font-manrope leading-[14px] tracking-wide",children:["Feed page includes the activities occur after a wallet is favorited."," "]})})]})]})})})}):i.jsx("ul",{className:"flex flex-col items-start justify-start gap-1",children:Array.isArray(u)&&u.length>0&&(($t=u==null?void 0:u.map)==null?void 0:$t.call(u,(qe,Ye)=>{var ht,Zt,zt,Et,nt,Ue,Rt,We,at,mt,Dt,Tt,dn,on,gn,Nn;return i.jsx("li",{children:i.jsxs("div",{className:"flex justify-start items-start gap-[11px]",children:[i.jsxs("div",{className:"flex flex-col items-start justify-start h-full",children:[i.jsx("div",{className:`${(ht=qe==null?void 0:qe.dir)!=null&&ht.includes("Long")?(qe==null?void 0:qe.dir)==="Short > Long"?"bg-[#67ffbd]/20":(qe==null?void 0:qe.dir)==="Long > Short"?"bg-[#ff797c]/20":"bg-[#67ffbd]/20":(qe==null?void 0:qe.dir)=="Buy"?"bg-[#67ffbd]/20":"bg-[#ff797c]/20"} flex justify-center items-center w-6 h-6 rounded-full`,children:i.jsx("div",{className:"w-3 h-3 relative",children:(Zt=qe==null?void 0:qe.dir)!=null&&Zt.includes("Long")?(qe==null?void 0:qe.dir)==="Short > Long"?i.jsx(Ps,{className:"text-[#67FFBD] rotate-180 w-3 h-3"}):(qe==null?void 0:qe.dir)==="Long > Short"?i.jsx(Ps,{className:"text-[#FF797C] w-3 h-3"}):i.jsx(Ps,{className:"text-[#67FFBD] rotate-180 w-3 h-3"}):(qe==null?void 0:qe.dir)=="Buy"?i.jsx(Ps,{className:"text-[#67FFBD] rotate-180 w-3 h-3"}):i.jsx(Ps,{className:"text-[#FF797C] w-3 h-3"})})}),i.jsx("div",{className:"flex justify-center w-6",children:i.jsx("div",{className:"w-[1px] min-h-[163px] h-full border border-[#242424]"})})]}),i.jsxs("div",{className:"flex flex-col items-start justify-start gap-[6px] w-full min-w-max h-[176px] min-h-[176px] rounded-[18px] border border-[#232323]",children:[i.jsxs("div",{className:"flex justify-between items-center gap-2 w-full px-3 py-2",children:[i.jsxs("div",{className:"flex justify-start items-center gap-2",children:[i.jsxs("div",{className:"flex justify-start items-center gap-2",children:[i.jsx("div",{className:"w-8 h-8 bg-[#6ed8ff] rounded-full relative",children:i.jsx("img",{src:Gi,alt:"",className:"w-8 h-8"})}),(qe==null?void 0:qe.target_platform)==="hyper"?i.jsxs("div",{className:"flex justify-start items-center gap-2 min-w-max",children:[i.jsx("img",{src:dx,alt:"hyper",className:"w-4 h-4 rounded-sm"}),i.jsx("span",{className:"text-white text-[13px] font-normal font-['Manrope'] leading-[13px] tracking-tight",children:"Hyperliquid"})]}):(qe==null?void 0:qe.target_platform)==="lighter"?i.jsxs("div",{className:"flex justify-start items-center gap-2 min-w-max",children:[i.jsx(Xf,{className:"w-4 h-4 text-[#fff]"}),i.jsx("span",{className:"text-white text-[13px] font-normal font-['Manrope'] leading-[13px] tracking-tight",children:"Lighter"})]}):""]}),i.jsxs("div",{className:"flex flex-col items-start justify-center gap-[2px]",children:[i.jsxs("div",{onClick:()=>{window.open(`/wallet-details/${qe==null?void 0:qe.listen_user}`,"_blank")},className:"flex justify-start items-center gap-1.5 cursor-pointer",children:[i.jsx("div",{className:"text-white text-base font-semibold font-manrope leading-none ",children:(qe==null?void 0:qe.listen_user)&&((zt=qe==null?void 0:qe.listen_user)==null?void 0:zt.slice(0,5))+"..."+((Et=qe==null?void 0:qe.listen_user)==null?void 0:Et.slice(-4))}),i.jsx("img",{onClick:kn=>{kn.stopPropagation(),navigator.clipboard.writeText(qe==null?void 0:qe.listen_user),rn.success("Successfully copied.",{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(103, 255, 189, 0.16)",width:"280px",minWidth:"280px",height:"40px",backdropFilter:"blur(16px)"},iconTheme:{primary:"#67FFBD",secondary:"#276047"}})},src:wo,alt:"",className:"cursor-pointer"})]}),i.jsxs("div",{className:"flex justify-start items-center gap-1.5 text-[#a5a5a5] text-[11px] font-normal font-manrope leading-[13px] tracking-tight",children:[i.jsxs("span",{className:"text-white text-[11px] font-normal font-['Manrope'] leading-[13px] tracking-tight min-w-max ml-[1px]",children:["Order ID:"," ",i.jsx("span",{className:"text-[#a5a5a5]",children:(qe==null?void 0:qe.oid)&&(qe==null?void 0:qe.oid)})]}),i.jsx("span",{onClick:kn=>{kn.stopPropagation(),navigator.clipboard.writeText(qe==null?void 0:qe.oid),rn.success("Successfully copied.",{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(103, 255, 189, 0.16)",width:"280px",minWidth:"280px",height:"40px",backdropFilter:"blur(16px)"},iconTheme:{primary:"#67FFBD",secondary:"#276047"}})},className:"cursor-pointer pr-0.5",children:i.jsx("img",{src:wo,alt:"",className:"w-3.5 h-3.5 min-w-3.5 min-h-3.5"})})]})]})]}),i.jsxs("div",{className:"flex flex-col items-end justify-start gap-[2px] w-full pl-2 pt-2 relative",children:[i.jsx("div",{onClick:()=>{ge(he=="time"?"date":"time")},className:"text-[#a5a5a5] text-[11px] font-normal font-manrope leading-[13px] tracking-tight cursor-pointer",children:he=="time"?i.jsx(Ke,{date:qe==null?void 0:qe.time}):su(qe==null?void 0:qe.time)}),i.jsxs("div",{className:"flex justify-start items-center gap-2 -m-[2px]",children:[i.jsxs("div",{children:[i.jsxs("span",{className:"text-[#9b9b9b] text-[13px] font-normal font-manrope leading-[21px] tracking-tight",children:["opened a new"," ",(qe==null?void 0:qe.dir)=="Sell"?"spot sell":(qe==null?void 0:qe.dir)=="Buy"?"spot buy":(nt=qe==null?void 0:qe.dir)==null?void 0:nt.toLowerCase()," ","position for"," "]}),i.jsxs("span",{className:"pl-1 text-white text-[13px] font-normal font-manrope leading-[21px] tracking-tight",children:[qe==null?void 0:qe.coin,"/",(qe==null?void 0:qe.feeToken)==null?"USDC":qe==null?void 0:qe.feeToken]})]}),i.jsx("div",{className:"w-5 h-5 bg-transparent rounded-[256px]",children:i.jsx("img",{src:`https://app.hyperliquid.xyz/coins/${Bt[qe==null?void 0:qe.coin]||((Ue=qe==null?void 0:qe.coin)==null?void 0:Ue.split("/")[0])}.svg`||Va,alt:qe==null?void 0:qe.coin,className:"rounded-full w-5 h-5 min-w-5 min-h-5",loading:"lazy",onError:kn=>ra(kn)})})]})]})]}),i.jsx("div",{className:"px-2",children:i.jsx("div",{className:"w-full min-w-auto min-w-[920px] h-[72px] min-h-[72px] bg-[#232323] rounded-xl border border-[#353535] pt-4 pl-4",children:i.jsxs("div",{className:"flex justify-start items-center gap-4 overflow-x-scroll scroll-smooth",children:[i.jsxs("div",{className:"sticky left-0 z-[8] bg-[#232323] flex justify-start items-center gap-4",children:[i.jsxs("div",{className:"flex flex-col justify-start items-start gap-1",children:[i.jsx("div",{className:"text-[#9b9b9b] text-xs font-normal font-manrope leading-[13px] tracking-wide",children:"Asset"}),i.jsxs("div",{className:"flex justify-start items-center gap-1",children:[i.jsx("div",{className:"w-5 h-5 bg-transparent rounded-[256px]",children:i.jsx("img",{src:`https://app.hyperliquid.xyz/coins/${Bt[qe==null?void 0:qe.coin]||((Rt=qe==null?void 0:qe.coin)==null?void 0:Rt.split("/")[0])}.svg`||Va,alt:qe==null?void 0:qe.coin,className:"rounded-full w-5 h-5 min-w-5 min-h-5",loading:"lazy",onError:kn=>ra(kn)})}),i.jsxs("div",{className:"text-white text-sm font-semibold font-manrope leading-[13px] tracking-tight",children:[qe==null?void 0:qe.coin,"/",(qe==null?void 0:qe.feeToken)==null?"USDC":qe==null?void 0:qe.feeToken]})]})]}),i.jsx("div",{className:"w-px h-8 bg-[#353535]"})]}),i.jsxs("div",{className:"flex justify-start items-center gap-4",children:[i.jsxs("div",{className:"flex flex-col justify-start items-start gap-1",children:[i.jsx("div",{className:"text-[#9b9b9b] text-xs font-normal font-manrope leading-[13px] tracking-wide",children:"Direction"}),i.jsx("div",{className:"flex justify-start items-center",children:i.jsxs("div",{className:`${(We=qe==null?void 0:qe.dir)!=null&&We.includes("Long")?(qe==null?void 0:qe.dir)==="Short > Long"?"text-[#67ffbd] bg-[#67ffbd]/20":(qe==null?void 0:qe.dir)==="Long > Short"?"text-[#ff787b] bg-[#ff797c]/20":"text-[#67ffbd] bg-[#67ffbd]/20":(qe==null?void 0:qe.dir)=="Buy"?"text-[#67ffbd] bg-[#67ffbd]/20":"text-[#ff787b] bg-[#ff797c]/20"} h-5 pl-1 pr-1.5 py-1 rounded-md justify-start items-center gap-0.5 inline-flex min-w-max`,children:[i.jsx("div",{className:"w-3 h-3 justify-center items-center flex",children:i.jsx("div",{className:"w-3 h-3 relative",children:(at=qe==null?void 0:qe.dir)!=null&&at.includes("Long")?(qe==null?void 0:qe.dir)==="Short > Long"?i.jsx(Ps,{className:"text-[#67FFBD] rotate-180 w-3 h-3"}):(qe==null?void 0:qe.dir)==="Long > Short"?i.jsx(Ps,{className:"text-[#FF797C] w-3 h-3"}):i.jsx(Ps,{className:"text-[#67FFBD] rotate-180 w-3 h-3"}):(qe==null?void 0:qe.dir)=="Buy"?i.jsx(Ps,{className:"text-[#67FFBD] rotate-180 w-3 h-3"}):i.jsx(Ps,{className:"text-[#FF797C] w-3 h-3"})})}),i.jsxs("div",{className:"text-[11px] font-semibold font-manrope leading-[8px] tracking-wide",children:[(qe==null?void 0:qe.dir)=="Sell"?"Sell":(qe==null?void 0:qe.dir)=="Buy"?"Buy":(qe==null?void 0:qe.dir)=="Close Short"?"Short":(qe==null?void 0:qe.dir)=="Close Long"?"Long":(qe==null?void 0:qe.dir)=="Open Short"?"Short":(qe==null?void 0:qe.dir)=="Open Long"?"Long":qe!=null&&qe.dir?qe==null?void 0:qe.dir:"--",qe!=null&&qe.leverage?" - "+(qe==null?void 0:qe.leverage)+"x":""]})]})})]}),i.jsx("div",{className:"w-px h-8 bg-[#353535]"})]}),i.jsxs("div",{className:"flex justify-start items-center gap-4",children:[i.jsx(fv,{title:"Type",value:qe!=null&&qe.fill_direction_type?qe!=null&&qe.is_twap?`${qe==null?void 0:qe.fill_direction_type} - Twap`:qe==null?void 0:qe.fill_direction_type:"--",color:"text-white"}),i.jsx("div",{className:"w-px h-8 bg-[#353535]"})]}),i.jsxs("div",{className:"flex justify-start items-center gap-4",children:[i.jsx(fv,{title:"Price",value:Er(qe==null?void 0:qe.px),color:"text-white"}),i.jsx("div",{className:"w-px h-8 bg-[#353535]"})]}),i.jsxs("div",{className:"flex justify-start items-center gap-4",children:[i.jsx(fv,{title:"Size",value:Er(qe==null?void 0:qe.sz),color:"text-white"}),i.jsx("div",{className:"w-px h-8 bg-[#353535]"})]}),i.jsxs("div",{className:"flex justify-start items-center gap-4",children:[i.jsx(fv,{title:"Entry Price",value:qe!=null&&qe.markPrice?`$${Er(qe==null?void 0:qe.markPrice)}`:Er(qe==null?void 0:qe.markPrice),color:"text-white"}),i.jsx("div",{className:"w-px h-8 bg-[#353535]"})]}),i.jsxs("div",{className:"flex justify-start items-center gap-4",children:[i.jsx(fv,{title:"PnL",value:qe!=null&&qe.closedPnl?`$${Er(Math.abs(qe==null?void 0:qe.closedPnl))}`:Er(Math.abs(qe==null?void 0:qe.closedPnl)),color:`${(qe==null?void 0:qe.closedPnl)>=0?"text-[#67ffbd]":"text-[#ff787b]"}`}),i.jsx("div",{className:"w-px h-8 bg-[#353535]"})]}),i.jsxs("div",{className:"flex justify-start items-center gap-4",children:[i.jsx(fv,{title:"Fee",value:qe!=null&&qe.fee?`$${Er(Math.abs(qe==null?void 0:qe.fee))}`:Er(Math.abs(qe==null?void 0:qe.fee)),color:"text-[#ff787b]"}),i.jsx("div",{className:"w-px h-8 bg-[#353535]"})]}),i.jsxs("div",{className:"flex justify-start items-center gap-4",children:[i.jsx(fv,{title:"Margin Mode",value:(qe==null?void 0:qe.is_cross)==null||qe!=null&&qe.is_cross?"Cross":"Isolated",color:"text-white"}),i.jsx("div",{className:"w-px h-8 bg-transparent"})]})]})})}),i.jsx("div",{className:`${qe!=null&&qe.success?"bg-[#67ffbd]/20 border-[#67ffbd]/25":"bg-[#ff797c]/20 border-[#ff797c]/25"} flex justify-start items-center h-8 max-h-8 rounded-bl-[18px] rounded-br-[18px] border-t w-full py-1.5`,children:i.jsxs("div",{className:"text-white text-sm font-manrope leading-none flex justify-start items-center px-2 gap-2",children:[qe!=null&&qe.success?i.jsx("img",{src:pM,alt:""}):i.jsx("img",{src:mM,alt:""}),i.jsx("div",{className:`${qe!=null&&qe.success?"text-[#67ffbd]":"text-[#ff787b]"} text-xs font-semibold font-manrope leading-3 tracking-tight`,children:qe!=null&&qe.success?"Status:":"System Message:"}),i.jsxs("div",{className:"text-white text-xs font-semibold font-manrope leading-3 tracking-tight -ml-1",children:[qe!=null&&qe.message&&((mt=qe==null?void 0:qe.message)==null?void 0:mt.length)>100?`${(Dt=qe==null?void 0:qe.message)==null?void 0:Dt.slice(0,100)}...`:qe==null?void 0:qe.message," ","on"]}),i.jsx("div",{onClick:()=>{window.open(`/wallet-details/${qe==null?void 0:qe.trader_wallet}`,"_blank")},className:"h-[18px] px-1.5 py-1 bg-white rounded-[256px] justify-center items-center gap-0.5 inline-flex cursor-pointer -ml-0.5",children:i.jsx("div",{className:"text-[#273f35] text-xs font-semibold font-manrope leading-[13px]",children:qe!=null&&qe.wallet_name?qe==null?void 0:qe.wallet_name:qe!=null&&qe.trader_wallet?((Tt=qe==null?void 0:qe.trader_wallet)==null?void 0:Tt.slice(0,5))+"..."+((dn=qe==null?void 0:qe.trader_wallet)==null?void 0:dn.slice(-4)):"--"})}),i.jsxs("div",{className:"text-white text-xs font-semibold font-manrope leading-3 tracking-tight -ml-0.5",children:["by"," "]}),i.jsx("div",{onClick:()=>{window.open(`/wallet-details/${qe==null?void 0:qe.listen_user}`,"_blank")},className:"h-[18px] px-1.5 py-1 bg-[#a5ffd8] rounded-[256px] justify-center items-center gap-0.5 inline-flex -ml-0.5 cursor-pointer",children:i.jsx("div",{className:"text-[#1e563e] text-xs font-semibold font-manrope leading-[13px]",children:qe!=null&&qe.tag?qe==null?void 0:qe.tag:qe!=null&&qe.listen_user?((on=qe==null?void 0:qe.listen_user)==null?void 0:on.slice(0,5))+"..."+((gn=qe==null?void 0:qe.listen_user)==null?void 0:gn.slice(-4)):"--"})}),(qe==null?void 0:qe.message)&&((Nn=qe==null?void 0:qe.message)==null?void 0:Nn.trim())=="Reverse Direction detected: Action skipped."&&i.jsx("a",{href:"https://docs.dextrabot.com/copy-trade/copytrade/reverse-direction",target:"_blank",rel:"noopener noreferrer",className:"p-1.5 rounded-lg shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] flex justify-center items-center gap-2.5 cursor-pointer bg-white",children:i.jsx("div",{className:"text-[#1b1b1b] text-[11px] font-medium font-['Inter'] leading-[8px]",children:"Read Details"})})]})})]})]})},Ye)}))})})]})},fv=({title:e,value:t,color:n})=>i.jsxs("div",{className:"flex flex-col justify-start items-start gap-1 min-w-max",children:[i.jsx("div",{className:"text-[#9b9b9b] text-xs font-normal font-manrope leading-[13px] tracking-wide min-w-max",children:e}),i.jsx("div",{className:"flex justify-start items-center min-w-max",children:i.jsx("div",{className:`${n} text-sm font-semibold font-manrope leading-[13px] tracking-tight min-w-max`,children:t})})]}),aan=({isMenu:e,setIsMenu:t,handleMenuChange:n})=>{const{trackedWatchList:r,getTrackedWatchList:s,copyTradeWatchList:a,getCopyTradeWatchList:o}=m.useContext(Qr);return m.useEffect(()=>{window.localStorage.getItem("hyperToken")&&(s(),o())},[e]),i.jsx("div",{className:"flex flex-col items-start gap-4 justify-start text-white w-full h-full font-manrope",children:i.jsxs("div",{className:"flex flex-col items-start justify-start w-full gap-[17px] bg-[#161616] max-w-full font-manrope h-full",children:[i.jsxs("div",{className:"flex flex-col items-start justify-start gap-2 font-manrope max-w-full w-full bg-[#161616] ",children:[i.jsx("div",{className:"text-[#7e7e7e] text-[11px] font-medium font-inter leading-[8px]",children:"Hype / Explore"}),i.jsx("div",{className:"flex items-center justify-start gap-4",children:i.jsx("div",{className:"text-white text-lg font-medium font-manrope leading-[21px] min-w-max",children:"My Activities"})})]}),i.jsxs("div",{className:"flex justify-center sm:justify-between items-center gap-2 flex-wrap sm:flex-nowrap max-h-max w-full sm:pr-2",children:[i.jsxs("div",{className:"flex justify-start items-center gap-2",children:[i.jsx(kCe,{title:"My Activities",isMenu:e,setIsMenu:t,handleMenuChange:n,lengthInfo:a?a.length:0}),i.jsx(kCe,{title:"Tracked Wallets",isMenu:e,setIsMenu:t,handleMenuChange:n,lengthInfo:r?r.length:0})]}),i.jsx("div",{className:"flex justify-center w-full sm:justify-end",children:i.jsx(Xin,{isMenu:e})})]}),i.jsx("div",{className:"flex items-start justify-start gap-2 w-full lg:w-auto lg:min-w-[860px] lg:max-w-max h-full",children:e==="Tracked Wallets"?i.jsxs("div",{className:"w-full",children:[i.jsx("div",{className:"hidden lg:block",children:i.jsx(Vin,{})}),i.jsx("div",{className:"block lg:hidden",children:i.jsx(qin,{})})]}):e==="My Activities"?i.jsx("div",{className:"flex flex-col lg:flex-row items-start justify-start gap-2 w-full lg:min-w-[900px] lg:max-w-max h-full",children:i.jsx(ian,{})}):i.jsx("div",{className:"flex items-start justify-start gap-2 w-full min-w-[860px] max-w-[1180px] h-full",children:"An unexpected error occurred."})})]})})},kCe=({title:e,lengthInfo:t,isMenu:n,setIsMenu:r,handleMenuChange:s})=>i.jsxs("div",{onClick:()=>s(e),className:`${n===e?"bg-white text-[#161616]":"bg-[#1b1b1b] text-[#9b9b9b]"} h-8 px-3 py-2 rounded-[256px] justify-center items-center gap-2 inline-flex cursor-pointer`,children:[i.jsx("div",{className:"text-[13px] font-semibold font-manrope leading-[8px] min-w-max",children:e}),i.jsx("div",{className:`${n===e?"text-white bg-[#ff5a5a]":"text-[#9b9b9b] bg-[#282828]"} p-1 rounded-md justify-center items-center gap-0.5 flex`,children:i.jsx("div",{className:"text-[11px] font-semibold font-manrope leading-[8px] tracking-wide min-w-max",children:t})})]}),oan=()=>{const{setTelegramChatId:e,setSubscriberRole:t,setSubsExpireDay:n,setMushboomerETH:r,setMushboomerSOL:s,isReferralCode:a,setIsReferralCode:o,setIsWhitelist:l,setHyperToken:c,setHyperAddress:u,setSignModalOpen:d}=m.useContext(Qr),f=oc(),[x,g]=m.useState(null);m.useEffect(()=>{const w=f.hash;w==="#tracked-wallets"?g("Tracked Wallets"):(w==="#my-activities"||window.history.replaceState(null,"",`${window.location.pathname}#my-activities`),g("My Activities"))},[f.hash]);const v=w=>{g(w),w==="Tracked Wallets"?window.history.replaceState(null,"",`${window.location.pathname}#tracked-wallets`):w==="My Activities"&&window.history.replaceState(null,"",`${window.location.pathname}#my-activities`)};return m.useEffect(()=>{(async()=>{var P,I;const C=window.localStorage.getItem("hyperToken"),N=window.localStorage.getItem("hyperAddress");if(!(!C||!N))try{const R=await Ei(N.toLowerCase(),C);R!=null&&R.success?(e(R==null?void 0:R.telegram_chat_id),t(R==null?void 0:R.subscriber_role),n(R==null?void 0:R.subs_expire_day),r((P=R==null?void 0:R.mushboomer_counts)==null?void 0:P.eth),s((I=R==null?void 0:R.mushboomer_counts)==null?void 0:I.sol),o(R==null?void 0:R.referral_code),l(R==null?void 0:R.whitelist)):(window.localStorage.removeItem("hyperToken"),window.localStorage.removeItem("hyperAddress"),c(""),u(""))}catch(R){console.error("Token verification error:",R),console.error(R.message||"An unknown error occurred.")}})()},[]),x?i.jsxs(i.Fragment,{children:[i.jsx(So,{children:i.jsxs(Ro,{children:[i.jsx("title",{children:"Live Transaction Feed for Your Favorite Hyperliquid Wallets - Dextrabot"}),i.jsx("meta",{name:"description",content:"Stay updated with live transactions from your favorite HyperLiquid wallets. Monitor trades in real time and react instantly with DextraBot’s transaction feed."}),i.jsx("meta",{name:"og:title",content:"Live Transaction Feed for Your Favorite Hyperliquid Wallets - Dextrabot"}),i.jsx("meta",{name:"og:description",content:"Stay updated with live transactions from your favorite HyperLiquid wallets. Monitor trades in real time and react instantly with DextraBot’s transaction feed."}),i.jsx("meta",{name:"og:image",content:"https://app.dextrabot.com/dextrabotIcon.png"}),i.jsx("meta",{name:"og:url",content:"https://app.dextrabot.com/my-activities"})]})}),i.jsx("div",{className:"flex justify-center items-center w-full h-screen min-h-max px-4 pt-4 bg-[#161616]",children:i.jsx("div",{className:"flex flex-col items-stretch justify-center h-full gap-[26px] w-full xl:w-max flex-grow xl:flex-grow-0",children:i.jsx(aan,{isMenu:x,setIsMenu:g,handleMenuChange:v})})})]}):null},lan=({open:e,setOpen:t,handleEnterCode:n,inputValue:r,isEnterLoading:s})=>i.jsxs(Ea,{open:e,onClose:()=>{},className:"relative z-50 font-manrope",children:[i.jsx(ja,{transition:!0,style:{backgroundColor:"rgba(0, 0, 0, 0.48)"},className:"fixed inset-0 transition-opacity data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in"}),i.jsx("div",{className:"fixed inset-0 z-50 w-screen overflow-y-auto",children:i.jsx("div",{className:"flex min-h-full items-end justify-center p-4 text-center sm:items-center sm:p-0",children:i.jsx(xa,{transition:!0,className:"relative transform overflow-hidden bg-[#101010] text-left shadow-xl transition-all data-[closed]:translate-y-4 data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in data-[closed]:sm:translate-y-0 data-[closed]:sm:scale-95 rounded-3xl",children:i.jsx("div",{className:"flex flex-col justify-start items-center gap-6 w-[400px] h-max relative bg-[#252525] rounded-3xl pt-4 pb-6",children:i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"pt-4",children:i.jsx("img",{src:Gi,alt:"",className:"w-[86px h-[86px]"})}),i.jsxs("div",{className:"flex flex-col items-center justify-start gap-2",children:[i.jsx("div",{className:"text-center text-white text-[24px] font-manrope leading-none",children:"Join now"}),i.jsx("div",{className:"w-[300px] text-center text-white/60 text-sm font-medium font-manrope leading-[18px] tracking-[0.28px] pt-4 pb-2 px-2",children:"Using a referral code will give you a 4% discount on your fees."})]}),i.jsxs("div",{role:"status",className:`${s?"":"hidden"} flex justify-center items-center w-full max-h-8`,children:[i.jsxs("svg",{"aria-hidden":"true",className:"w-8 h-8 text-gray-200 animate-spin dark:text-gray-600 fill-white",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),i.jsx("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]}),i.jsx("span",{className:"sr-only",children:"Loading..."})]}),i.jsx("div",{onClick:a=>{a.preventDefault(),s||n()},className:`${s?"cursor-not-allowed":"cursor-pointer"} w-[286px] h-8 px-6 py-3 bg-[#7445ff] rounded-[10px] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-[#8860ff] justify-center items-center gap-2.5 inline-flex`,children:i.jsxs("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px]",children:["Join with code: ",r]})})]})})})})})]}),can=({handleEnterCode:e,handleChange:t,error:n,handleGenerateCode:r,handleGenerateChange:s,generateError:a,generateData:o,userReferansCode:l,setInputValue:c,inputValue:u,setGenerateValue:d,generateValue:f,setIsMenu:x,isMenu:g,setGenerateCode:v,generateCode:w,setIsGenerateLoading:C,isGenerateLoading:N,setIsEnterLoading:P,isEnterLoading:I,divRef:R,isEnterModal:F,setIsEnterModal:U})=>{const{mushboomerETH:L,mushboomerSOL:z,isReferralCode:Q,isWhitelist:ne}=m.useContext(Qr),J=w?`https://app.dextrabot.com/referral/${w}`:"";return i.jsxs(i.Fragment,{children:[!l&&i.jsx(lan,{open:F,setOpen:U,handleEnterCode:e,inputValue:u,isEnterLoading:I}),i.jsxs("div",{ref:R,className:"flex flex-col justify-start items-start gap-[30px] h-max relative bg-[#232323] rounded-2xl overflow-hidden pt-[18px] px-[18px] w-max mx-auto lg:mx-0",children:[i.jsx("div",{className:"text-white text-2xl font-semibold font-manrope leading-[8px]",children:"Referrals"}),i.jsxs("div",{className:"flex flex-col justify-start items-start",children:[i.jsxs("div",{className:"flex justify-start items-center w-full gap-[8px] pt-[2px]",children:[i.jsx("div",{onClick:()=>x("Enter Code"),className:`${g=="Enter Code"?"text-white":"text-[#8b8b8b]"} w-[136px] h-[37px] px-2 py-1.5 justify-center items-center gap-2 inline-flex text-[13px] font-semibold font-manrope leading-[8px] cursor-pointer`,children:"Enter Code"}),i.jsx("div",{onClick:()=>x("Create Code"),className:`${g=="Create Code"?"text-white":"text-[#8b8b8b]"} w-[136px] h-[37px] px-2 py-1.5 justify-center items-center gap-2 inline-flex text-[13px] font-semibold font-manrope leading-[8px] cursor-pointer min-w-max`,children:"Create Code"})]}),i.jsxs("div",{className:"flex justify-start items-center w-full",children:[i.jsx("div",{className:`${g=="Enter Code"?"bg-white":"bg-[#8b8b8b]"} w-[143px] h-0.5 `}),i.jsx("div",{className:`${g=="Create Code"?"bg-white":"bg-[#8b8b8b]"} w-[143px] h-0.5 `})]})]}),i.jsxs("div",{className:"flex flex-col justify-start items-start gap-2 w-full",children:[i.jsxs("div",{className:`${l&&g=="Enter Code"||g=="Create Code"&&w||!(ne||L>0||z>0)||g=="Claim"?"hidden":""} flex justify-start items-center gap-[4px] has-tooltip relative`,children:[i.jsx("div",{className:"text-[#7c7c7c] text-[13px] font-semibold font-manrope leading-[8px] min-w-max",children:g=="Enter Code"?"Referral Code":"Set your Referral Code"}),i.jsx(Ni,{className:"text-[#7C7C7C]"}),i.jsx("span",{className:`${g=="Enter Code"?"ml-44":"ml-32"}`,children:i.jsx(Fa,{content:"Valid characters: '_', '-', 0-9, A-Z, 4-10 length",positionTop:!0,alignRight:!1})})]}),g=="Enter Code"?i.jsxs(i.Fragment,{children:[i.jsx("input",{type:"text",value:u,onChange:t,placeholder:"Code",className:`${u!=null&&u!=null&&u!=""?"border border-[#8d67ff]":""} ${l?"hidden":""} py-[4px] bg-[#1b1b1b] rounded-md block text-white text-sm font-medium font-inter leading-[8px] w-[286px] min-w-[286px] px-4 focus:ring-1 focus:ring-[#8d67ff] focus:outline-none placeholder:text-[#7F7F7F] placeholder:font-inter placeholder:text-sm placeholder:font-medium placeholder:leading-[8px] h-[38px]`}),i.jsx("div",{className:`${!l&&n?"block":"hidden"} w-[286px] h-8 px-3 py-2 bg-[#3b2626] rounded-md justify-start items-center gap-2.5 inline-flex`,children:i.jsx("div",{className:"text-[#ff787b] text-xs font-semibold font-manrope leading-none",children:n&&n})}),I?i.jsxs("div",{role:"status",className:"flex justify-center items-center w-full my-[30px]",children:[i.jsxs("svg",{"aria-hidden":"true",className:"w-8 h-8 text-gray-200 animate-spin dark:text-gray-600 fill-white",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),i.jsx("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]}),i.jsx("span",{className:"sr-only",children:"Loading..."})]}):i.jsx("div",{className:`${l?"block":"hidden"} w-[286px] h-8 px-3 py-2 rounded-md justify-start items-center gap-2.5 inline-flex mt-[40px] mb-[60px]`,children:i.jsxs("div",{className:"text-white text-base font-semibold font-manrope leading-[8px] flex flex-col items-center justify-center gap-[18px] w-full",children:[i.jsx("img",{src:Xbt,alt:""}),l&&`'${l}' has been applied.`]})}),i.jsx("div",{onClick:()=>{e()},className:`${l?"hidden":""} w-[286px] h-8 px-6 py-3 bg-[#7445ff] rounded-[10px] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-[#8860ff] justify-center items-center gap-2.5 inline-flex mt-2 cursor-pointer`,children:i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px]",children:"Enter Code"})}),i.jsx("div",{className:`${l?"hidden":""} w-[286px] h-14 p-2.5 bg-[#ffd979]/20 rounded-md justify-start items-center gap-2.5 inline-flex`,children:i.jsx("div",{className:"w-[266px] text-[#ffd978] text-[13px] font-semibold font-manrope leading-none",children:"Using a referral code will give you a 4% discount on your fees"})})]}):g=="Claim"?i.jsx(i.Fragment,{children:i.jsx("div",{className:"flex justify-center items-cente w-[286px] mt-[54px] mb-[70px]",children:i.jsx("div",{className:"text-[#7c7c7c] text-[16px] font-semibold font-['Manrope'] leading-[8px] ",children:"Coming soon"})})}):ne||L>0||z>0?i.jsxs(i.Fragment,{children:[i.jsx("input",{type:"text",value:f,onChange:s,placeholder:"Code",className:`${f!=null&&f!=null&&f!=""?"border border-[#8d67ff]":""} ${w?"hidden":""} py-[4px] bg-[#1b1b1b] rounded-md block text-white text-sm font-medium font-inter leading-[8px] w-[286px] min-w-[286px] px-4 focus:ring-1 focus:ring-[#8d67ff] focus:outline-none placeholder:text-[#7F7F7F] placeholder:font-inter placeholder:text-sm placeholder:font-medium placeholder:leading-[8px] h-[38px]`,disabled:!!w}),i.jsx("div",{className:`${!w&&a?"block":"hidden"} w-[286px] h-8 px-3 py-2 bg-[#3b2626] rounded-md justify-start items-center gap-2.5 inline-flex`,children:i.jsx("div",{className:"text-[#ff787b] text-xs font-semibold font-manrope leading-none",children:a&&a})}),N?i.jsxs("div",{role:"status",className:"flex justify-center items-center w-full my-[30px]",children:[i.jsxs("svg",{"aria-hidden":"true",className:"w-8 h-8 text-gray-200 animate-spin dark:text-gray-600 fill-white",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),i.jsx("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]}),i.jsx("span",{className:"sr-only",children:"Loading..."})]}):i.jsx("div",{className:`${w?"block":"hidden"} w-full h-8 px-3 py-2 rounded-md justify-start items-center gap-2.5 inline-flex mt-[40px] mb-[60px]`,children:i.jsxs("div",{className:"text-white text-base font-semibold font-manrope leading-[8px] flex flex-col items-center justify-center gap-[18px] w-full",children:[i.jsx("img",{src:Qbt,alt:""}),w&&`'${w}' created successfully!`]})}),i.jsx("div",{onClick:()=>{r()},className:`${w?"hidden":""} w-[286px] h-8 px-6 py-3 bg-[#7445ff] rounded-[10px] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-[#8860ff] justify-center items-center gap-2.5 inline-flex mt-2 cursor-pointer`,children:i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px]",children:"Create Code"})})]}):i.jsxs("div",{className:"flex flex-col items-center justify-center w-[286px] gap-4 px-4 text-white",children:[i.jsx("span",{className:"text-center mb-5 font-bold underline",children:"You need to have at least 1 Mushboomer ETH or 1 Mushboomer SOL, or have entered a referral code to be able to copy trade."}),i.jsx("div",{onClick:()=>{window.open("https://blur.io/collection/mushboomers","_blank")},className:"w-[184px] h-8 px-6 py-3 bg-[#7445ff] rounded-[10px] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-[#8860ff] justify-center items-center gap-2.5 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px]",children:"Mushboomers Eth"})}),i.jsx("div",{onClick:()=>{window.open("https://www.tensor.trade/trade/mushboomers","_blank")},className:"w-[184px] h-8 px-6 py-3 bg-[#7445ff] rounded-[10px] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-[#8860ff] justify-center items-center gap-2.5 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px]",children:"Mushboomers Sol"})}),i.jsx("div",{onClick:()=>{x("Enter Code")},className:"w-[184px] h-8 px-6 py-3 bg-[#7445ff] rounded-[10px] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-[#8860ff] justify-center items-center gap-2.5 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px]",children:"Referral Code"})})]})]}),i.jsx("div",{className:`${w&&g=="Create Code"||l&&g=="Enter Code"||g=="Claim"?"hidden":"block"} w-[286px] h-px bg-[#3e3e3e] -mt-[14px]`}),i.jsxs("div",{className:"flex flex-col justify-start items-start gap-[25px] -mt-[14px] bg-[#393939] -mx-[18px] px-4 py-4 h-full w-[328px] border-t border-dashed border-neutral-500",children:[i.jsxs("div",{className:"flex flex-col justify-start items-start gap-[10px]",children:[i.jsx("div",{className:"text-[#cfcfcf] text-[13px] font-semibold font-manrope leading-[8px]",children:"Your Referral Code"}),i.jsxs("div",{onClick:X=>{X.preventDefault(),w&&(navigator.clipboard.writeText(w||""),rn.success("Successfully copied.",{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(103, 255, 189, 0.16)",width:"280px",minWidth:"280px",height:"40px",backdropFilter:"blur(16px)"},iconTheme:{primary:"#67FFBD",secondary:"#276047"}}))},className:`${w?"cursor-pointer":"cursor-not-allowed"} flex justify-start items-center gap-1.5`,children:[i.jsx("img",{src:hM,alt:"",className:"text-white w-[18px] h-[18px]"}),i.jsx("div",{className:"text-white text-sm font-semibold font-manrope leading-[21px]",children:w||"You haven't created a referral code yet"})]})]}),i.jsxs("div",{className:"flex flex-col justify-start items-start gap-[10px]",children:[i.jsx("div",{className:"text-[#cfcfcf] text-[13px] font-semibold font-manrope leading-[8px]",children:"Your Referral URL"}),i.jsxs("div",{onClick:X=>{X.preventDefault(),(w||o)&&(navigator.clipboard.writeText(w?`https://app.dextrabot.com/referral/${w}`:o&&o),rn.success("Successfully copied.",{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(103, 255, 189, 0.16)",width:"280px",minWidth:"280px",height:"40px",backdropFilter:"blur(16px)"},iconTheme:{primary:"#67FFBD",secondary:"#276047"}}))},className:`${w||o?"cursor-pointer":"cursor-not-allowed"} flex justify-start items-center gap-1.5`,children:[i.jsx("img",{src:hM,alt:"",className:"text-white w-[18px] h-[18px]"}),i.jsx("div",{className:`${w||o?"underline":"no-underline"} text-[#82ffc8] text-sm font-medium font-manrope leading-[21px]`,children:w?J.slice(0,36)+"...":o?o.slice(0,30)+"...":i.jsx("span",{className:"text-white",children:"-"})})]})]})]})]})]})},uC=({title:e,sortKey:t,sortOption:n,setSortOption:r,isFilterIcon:s})=>{const a=()=>{r(n===t?`-${t}`:t)};return i.jsx(i.Fragment,{children:i.jsxs("div",{onClick:()=>a(),className:`${e==="Wallet"?"sm:sticky left-0 h-8":s?"justify-end":"justify-start"} flex items-center gap-1 min-w-max font-manrope`,children:[i.jsx("div",{className:`${n.includes(t)?"text-white":""} cursor-pointer flex items-center justify-end group`,children:e}),i.jsx(uU,{sortKey:t,state:n,className:""})]})})};function uan({open:e,setOpen:t}){return i.jsxs(Ea,{open:e,onClose:t,className:"relative z-50 font-manrope",children:[i.jsx(ja,{transition:!0,style:{backgroundColor:"rgba(0, 0, 0, 0.48)"},className:"fixed inset-0 transition-opacity data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in"}),i.jsx("div",{className:"fixed inset-0 z-50 w-screen overflow-y-auto",children:i.jsx("div",{className:"flex min-h-full items-end justify-center p-4 text-center sm:items-center sm:p-0",children:i.jsx(xa,{transition:!0,className:"relative transform overflow-hidden bg-[#101010] text-left shadow-xl transition-all data-[closed]:translate-y-4 data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in data-[closed]:sm:translate-y-0 data-[closed]:sm:scale-95 rounded-3xl",children:i.jsx("div",{className:"flex flex-col justify-start items-center gap-8 w-[400px] h-max relative bg-[#252525] rounded-3xl pt-4 pb-6",children:i.jsxs(i.Fragment,{children:[i.jsx("div",{onClick:()=>{t(!1)},className:"cursor-pointer flex w-full items-center justify-end absolute right-2 top-1",children:i.jsx("span",{className:"absolute top-2 right-2 w-9 h-9 rounded-full p-1 flex justify-center items-center hover:bg-[#7535FE]",children:i.jsx("img",{className:"p-1",src:Ba})})}),i.jsx("div",{className:"pt-4",children:i.jsx("img",{src:tae,alt:"",className:"w-[86px h-[86px]"})}),i.jsxs("div",{className:"flex flex-col items-center justify-start gap-2",children:[i.jsx("div",{className:"text-center text-white text-[24px] font-manrope leading-none",children:"Your claim is being processed"}),i.jsx("div",{className:"w-[300px] text-center text-white/60 text-sm font-medium font-manrope leading-[18px] tracking-[0.28px] pt-4 pb-8 px-2",children:"Referral Claim process may take 24h to verify and complete your transaction. If anything goes wrong after 24h, you can open a ticket on discord."})]})]})})})})})]})}const dan=({data:e,dataLoading:t,dataError:n,height:r,handleRefTable:s,dataUsage:a,dataUsageLoading:o,dataUsageError:l,setIsOnTableTab:c,isOnTableTab:u})=>{var pe,Y,ie,oe;const{isConnected:d,address:f}=ns(),{setSignModalOpen:x,hyperToken:g}=m.useContext(Qr),[v,w]=m.useState(!1),[C,N]=m.useState(!1),[P,I]=m.useState(!1),R=m.useMemo(()=>{var V;const G=new Map;return(V=e==null?void 0:e.claim_lists)==null||V.forEach(ee=>{var fe;const ae=((fe=ee==null?void 0:ee.subscriber_address)==null?void 0:fe.toLowerCase())||"";if(!G.has(ae))G.set(ae,{...ee,total_ref_claimable:parseFloat(ee==null?void 0:ee.total_ref_claimable)||0});else{const Ne=G.get(ae);G.set(ae,{...Ne,total_ref_claimable:(Ne==null?void 0:Ne.total_ref_claimable)+(parseFloat(ee==null?void 0:ee.total_ref_claimable)||0)})}}),Array.from(G.values())},[e]),F="-total_ref_claimable",[U,L]=m.useState(F),z=G=>R==null?void 0:R.sort((V,ee)=>{const ae=V.subscriber_address?V.subscriber_address.toLowerCase():"",fe=ee.subscriber_address?ee.subscriber_address.toLowerCase():"";return G==="-level"?ee.level-V.level:G==="level"?V.level-ee.level:G==="-subscriber_address"?ae<fe?-1:ae>fe?1:0:G==="subscriber_address"?ae>fe?-1:ae<fe?1:0:G==="-total_ref_claimable"?ee.total_ref_claimable-V.total_ref_claimable:G==="total_ref_claimable"?V.total_ref_claimable-ee.total_ref_claimable:G==="-last_active_date"?new Date(ee.last_active_date)-new Date(V.last_active_date):G==="last_active_date"?new Date(V.last_active_date)-new Date(ee.last_active_date):0}),Q="-created_at",[ne,J]=m.useState(Q),X=G=>{var V;return(V=a.claim_lists)==null?void 0:V.sort((ee,ae)=>{const fe=ee.address?ee.address.toLowerCase():"",Ne=ae.address?ae.address.toLowerCase():"";return G==="-level"?ae.level-ee.level:G==="level"?ee.level-ae.level:G==="-address"?fe<Ne?-1:fe>Ne?1:0:G==="address"?fe>Ne?-1:fe<Ne?1:0:G==="-created_at"?new Date(ae.created_at)-new Date(ee.created_at):G==="created_at"?new Date(ee.created_at)-new Date(ae.created_at):0})},re=async()=>{try{w(!0);const G=window.localStorage.getItem("hyperToken"),V="https://dextrabothypev2.nftinit.io/api/subscriber/claim/request/";if(!G){x(!0),w(!1);return}const ee=window.localStorage.getItem("hyperAddress"),fe=await(await fetch(V,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:f?f.toLowerCase():ee,token:G})})).json();fe.success?(s(),I(!0)):(console.log(fe.error_message),N(fe.error_message),rn.error(fe.error_message))}catch(G){console.error("Error in like function:",G),N(G.message||"An unknown error occurred.")}finally{w(!1)}};return i.jsxs(i.Fragment,{children:[i.jsx(uan,{open:P,setOpen:I}),i.jsxs("div",{style:r==0?{maxHeight:"450px"}:{maxHeight:r},className:"flex flex-col justify-start items-start text-white font-manrope rounded-2xl h-auto sm:h-full w-full lg:w-max overflow-auto gap-3",children:[i.jsx("div",{className:"flex justify-between items-center w-full px-6 bg-[#232323] p-4 roundend-[16px]",children:i.jsxs("div",{className:"flex flex-col items-start justify-end gap-2",children:[i.jsxs("div",{className:"flex justify-start items-start gap-2",children:[i.jsxs("div",{className:"flex flex-col items-start justify-start w-full h-full gap-2",children:[i.jsx("div",{className:"text-[#7c7c7c] text-[13px] font-semibold font-manrope leading-[8px] min-w-max",children:"Total Earnings"}),i.jsx("div",{className:"text-[#67ffbd] text-[21px] font-semibold font-manrope leading-[21px]",children:e!=null&&e.total_claim_fee?`$${Er(e==null?void 0:e.total_claim_fee)}`:"--"})]}),i.jsx("div",{className:"w-px h-10 bg-[#353535]"}),i.jsxs("div",{className:"flex flex-col items-start justify-start w-full h-full gap-2",children:[i.jsx("div",{className:"text-[#7c7c7c] text-[13px] font-semibold font-manrope leading-[8px] min-w-max",children:"Claimed"}),i.jsx("div",{className:"text-[#67ffbd] text-[21px] font-semibold font-manrope leading-[21px]",children:e!=null&&e.total_claimed_fee?`$${Er(e==null?void 0:e.total_claimed_fee)}`:"--"})]}),i.jsx("div",{className:"w-px h-10 bg-[#353535]"}),i.jsxs("div",{className:"flex flex-col items-start justify-start w-full h-full gap-2",children:[i.jsx("div",{className:"text-[#7c7c7c] text-[13px] font-semibold font-manrope leading-[8px] min-w-max",children:"Pending Earnings"}),i.jsx("div",{className:"text-[#67ffbd] text-[21px] font-semibold font-manrope leading-[21px]",children:e!=null&&e.unexpired_fee?`$${Er(e==null?void 0:e.unexpired_fee)}`:"--"})]}),i.jsx("div",{className:"w-px h-10 bg-[#353535]"}),i.jsxs("div",{className:"flex flex-col items-start justify-start w-full h-full gap-2",children:[i.jsx("div",{className:"text-[#7c7c7c] text-[13px] font-semibold font-manrope leading-[8px] min-w-max",children:"Available to Claim"}),i.jsx("div",{className:"text-[#67ffbd] text-[21px] font-semibold font-manrope leading-[21px]",children:e!=null&&e.total_claimable_fee?`$${Er(e==null?void 0:e.total_claimable_fee)}`:"--"})]}),i.jsx("div",{onClick:G=>{G.preventDefault(),g?v||((e==null?void 0:e.total_claimable_fee)<50?rn.success(i.jsxs(i.Fragment,{children:[i.jsx("span",{style:{color:"#ff797c",paddingLeft:"5px"},children:"Minimum claim limit is"}),i.jsx("span",{style:{color:"#ffffff",paddingLeft:"5px"},children:"$50."})]}),{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(255, 121, 124, 0.32)",width:"300px",minWidth:"300px",height:"40px",backdropFilter:"blur(48px)"},iconTheme:{primary:"#ff797c",secondary:"#7d3031"}}):(e==null?void 0:e.total_claimable_fee)>=50&&re()):x(!0)},className:`${v?"cursor-not-allowed":"cursor-pointer"} claim-button-claim-button flex justify-center items-center px-4 rounded-md font-inter font-semibold text-[13px] not-italic h-8 leading-[8px] text-white min-w-[80px] ml-4`,children:v?i.jsxs("div",{role:"status",className:"flex justify-center items-center h-5 min-h-5 w-[40px] px-2 py-1.5 rounded-md",children:[i.jsxs("svg",{"aria-hidden":"true",class:"inline w-4 h-4 text-gray-200 animate-spin dark:text-gray-600 fill-[#67FFBD]",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),i.jsx("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]}),i.jsx("span",{class:"sr-only",children:"Loading..."})]}):i.jsx("span",{className:"min-w-max",children:"Claim"})})]}),i.jsxs("div",{className:"flex justify-between items-center w-full h-full gap-1.5",children:[i.jsxs("div",{className:"flex flex-col justify-start items-start",children:[i.jsxs("div",{className:"flex justify-start items-center w-full gap-[8px]",children:[i.jsx("div",{onClick:()=>c("Earnings"),className:`${u=="Earnings"?"text-white":"text-[#8b8b8b]"} w-[116px] px-2 py-1.5 justify-center items-center gap-2 inline-flex text-[13px] font-semibold font-manrope leading-[8px] cursor-pointer`,children:"Earnings"}),i.jsx("div",{onClick:()=>c("Referrals"),className:`${u=="Referrals"?"text-white":"text-[#8b8b8b]"} w-[116px] px-2 py-1.5 justify-center items-center gap-2 inline-flex text-[13px] font-semibold font-manrope leading-[8px] cursor-pointer min-w-max`,children:"Referrals"})]}),i.jsxs("div",{className:"flex justify-start items-center w-full pt-1.5",children:[i.jsx("div",{className:`${u=="Earnings"?"bg-white":"bg-[#8b8b8b]"} w-[123px] h-0.5 `}),i.jsx("div",{className:`${u=="Referrals"?"bg-white":"bg-[#8b8b8b]"} w-[123px] h-0.5 `})]})]}),i.jsx("div",{className:"text-[#aaaaaa] text-xs font-semibold font-manrope leading-none max-w-max mr-2",children:"• Minimum Withdrawal Amount: $50"})]})]})}),i.jsx("div",{className:"w-full min-w-[600px] max-w-[790px] h-full overflow-x-scroll relative overflow-y-scroll flex-grow bg-[#242424]",children:u=="Earnings"?i.jsxs("table",{className:"w-full relative",children:[i.jsx("thead",{className:"sticky top-0 z-[3] bg-[#242424] whitespace-nowrap",children:i.jsxs("tr",{className:"w-full z-[4] text-[#9b9b9b] text-[13px] font-semibold font-manrope leading-[13px] tracking-tight",children:[i.jsx("th",{scope:"col",className:"font-medium sticky left-0 h-8 pl-6 min-w-[150px] sm:min-w-[170px] z-[8] bg-[#242424] rounded-tl-2xl",children:i.jsx(uC,{title:"Referred Wallet",sortKey:"subscriber_address",sortOption:U,setSortOption:L,isFilterIcon:!1})}),i.jsx("th",{scope:"col",className:"bg-[#242424] h-10 px-1 min-w-[100px] sm:min-w-[120px]",children:i.jsx(uC,{title:"Level",sortKey:"level",sortOption:U,setSortOption:L,isFilterIcon:!1})}),i.jsx("th",{scope:"col",className:"bg-[#242424] h-10 min-w-[110px] sm:min-w-[110px] rounded-tr-2xl pl-1 pr-4",children:i.jsx(uC,{title:"Earnings",sortKey:"total_ref_claimable",sortOption:U,setSortOption:L,isFilterIcon:!1})})]})}),i.jsx("tbody",{children:!e||t?i.jsx("tr",{className:"text-center w-full h-full",children:i.jsx("td",{colSpan:3,children:i.jsx("div",{className:"flex min-h-[25vh] flex-col justify-center items-center ml-[45%] w-max",children:i.jsx(Da,{})})})}):n&&!(e!=null&&e.claim_lists)?i.jsx("tr",{className:"text-center w-full h-full",children:i.jsx("td",{colSpan:3,children:i.jsx("div",{className:"flex min-h-[25vh] flex-col justify-center items-center ml-[27%] w-max",children:i.jsx(zl,{})})})}):(e==null?void 0:e.length)==0||((pe=e==null?void 0:e.claim_lists)==null?void 0:pe.length)==0?i.jsx("tr",{className:"text-center w-full h-full",children:i.jsx("td",{colSpan:3,children:i.jsx("div",{className:"flex min-h-[25vh] flex-col justify-center items-center ml-[30%] w-max",children:i.jsx("div",{className:"flex items-center justify-center gap-4 px-4 py-2 flex-col",children:i.jsxs("div",{className:"flex flex-col justify-center items-center gap-3 -ml-16",children:[i.jsx("img",{src:ac,alt:""}),i.jsxs("div",{className:"flex flex-col items-center h-max gap-3",children:[i.jsx("div",{className:"text-[#d3d3d3] text-sm font-semibold font-manrope leading-[8px] pt-3",children:"No referral earnings yet."}),i.jsxs("div",{className:"flex flex-col items-center justify-start text-center -mt-1",children:[i.jsx("span",{className:"text-[#979797] text-[13px] font-normal font-manrope leading-[14px] tracking-wide",children:"Share your referral link and watch your earnings appear"}),i.jsx("br",{}),i.jsxs("span",{className:"text-[#979797] text-[13px] font-normal font-manrope leading-[14px] tracking-wide -mt-5",children:[" ","here as users start trading."]})]})]})]})})})})}):(Y=z(U))==null?void 0:Y.map((G,V)=>i.jsxs("tr",{className:`${V%2===0,"bg-[#242424]"} relative group hover:bg-[#353535] h-[32px] border-b border-[#232323] text-white`,children:[i.jsx("td",{scope:"row",className:`${V%2==0,"bg-[#242424]"} sticky left-0 z-[2] group-hover:bg-[#353535]`,children:i.jsx("div",{className:"group-hover:bg-[#353535] flex justify-start items-center gap-2 pl-4 h-[32px] max-h-[32px]",children:i.jsx("div",{className:"group-hover:bg-[#353535] flex justify-start items-center gap-2 h-[32px] max-h-[32px]",children:i.jsx("div",{className:"flex justify-start items-center gap-1",children:i.jsx(aa,{info1:`${(G==null?void 0:G.subscriber_address).slice(0,5)+"..."+(G==null?void 0:G.subscriber_address).slice(-4)}`,info1_Color:"text-white",rowTwo:!1})})})})}),i.jsx("td",{scope:"row",className:"group-hover:bg-[#353535]",children:i.jsx("div",{className:"group-hover:bg-[#353535] flex justify-start items-center gap-4 min-h-[32px] px-1",children:i.jsx("div",{className:"group-hover:bg-[#353535] flex justify-start items-center gap-2 h-[32px] max-h-[32px]",children:i.jsx("div",{className:"flex justify-start items-center gap-1.5 text-white text-sm font-semibold font-manrope leading-[8px]",children:G!=null&&G.level?`L${G==null?void 0:G.level}`:"--"})})})}),i.jsx("td",{children:i.jsx("div",{className:"group-hover:bg-[#353535] flex justify-start items-center gap-4 min-h-[32px] pl-1 pr-4",children:i.jsx("div",{className:"flex justify-start items-center gap-1.5 text-[#1ce6a2] text-sm font-semibold font-manrope leading-[8px]",children:G!=null&&G.total_ref_claimable?`$${Er(G==null?void 0:G.total_ref_claimable)}`:"--"})})})]},V))})]}):i.jsxs("table",{className:"w-full relative",children:[i.jsx("thead",{className:"sticky top-0 z-[3] bg-[#242424] whitespace-nowrap",children:i.jsxs("tr",{className:"w-full z-[4] text-[#9b9b9b] text-[13px] font-semibold font-manrope leading-[13px] tracking-tight",children:[i.jsx("th",{scope:"col",className:"font-medium sticky left-0 h-8 pl-6 min-w-[150px] sm:min-w-[170px] z-[8] bg-[#242424] rounded-tl-2xl",children:i.jsx(uC,{title:"Referred Wallet",sortKey:"address",sortOption:ne,setSortOption:J,isFilterIcon:!1})}),i.jsx("th",{scope:"col",className:"bg-[#242424] h-10 px-1 min-w-[100px] sm:min-w-[120px]",children:i.jsx(uC,{title:"Level",sortKey:"level",sortOption:ne,setSortOption:J,isFilterIcon:!1})}),i.jsx("th",{scope:"col",className:"bg-[#242424] h-10 min-w-[110px] sm:min-w-[110px] rounded-tr-2xl pl-1 pr-4",children:i.jsx(uC,{title:"Join Date",sortKey:"created_at",sortOption:ne,setSortOption:J,isFilterIcon:!1})})]})}),i.jsx("tbody",{children:!a||o?i.jsx("tr",{className:"text-center w-full h-full",children:i.jsx("td",{colSpan:3,children:i.jsx("div",{className:"flex min-h-[25vh] flex-col justify-center items-center ml-[45%] w-max",children:i.jsx(Da,{})})})}):l&&!(a!=null&&a.claim_lists)?i.jsx("tr",{className:"text-center w-full h-full",children:i.jsx("td",{colSpan:3,children:i.jsx("div",{className:"flex min-h-[25vh] flex-col justify-center items-center ml-[27%] w-max",children:i.jsx(zl,{})})})}):(a==null?void 0:a.length)==0||((ie=a==null?void 0:a.claim_lists)==null?void 0:ie.length)==0?i.jsx("tr",{className:"text-center w-full h-full",children:i.jsx("td",{colSpan:3,children:i.jsx("div",{className:"flex min-h-[25vh] flex-col justify-center items-center ml-[30%] w-max",children:i.jsx("div",{className:"flex items-center justify-center gap-4 px-4 py-2 flex-col",children:i.jsxs("div",{className:"flex flex-col justify-center items-center gap-3 -ml-16",children:[i.jsx("img",{src:ac,alt:""}),i.jsxs("div",{className:"flex flex-col items-center h-max gap-3",children:[i.jsx("div",{className:"text-[#d3d3d3] text-sm font-semibold font-manrope leading-[8px] pt-3",children:"No referral yet."}),i.jsxs("div",{className:"flex flex-col items-center justify-start text-center -mt-1",children:[i.jsx("span",{className:"text-[#979797] text-[13px] font-normal font-manrope leading-[14px] tracking-wide",children:"Share your referral link and watch your referrals appear"}),i.jsx("br",{}),i.jsxs("span",{className:"text-[#979797] text-[13px] font-normal font-manrope leading-[14px] tracking-wide -mt-5",children:[" ","here as users start trading."]})]})]})]})})})})}):(oe=X(ne))==null?void 0:oe.map((G,V)=>i.jsxs("tr",{className:`${V%2===0,"bg-[#242424]"} relative group hover:bg-[#353535] h-[32px] border-b border-[#232323] text-white`,children:[i.jsx("td",{scope:"row",className:`${V%2==0,"bg-[#242424]"} sticky left-0 z-[2] group-hover:bg-[#353535]`,children:i.jsx("div",{className:"group-hover:bg-[#353535] flex justify-start items-center gap-2 pl-4 h-[32px] max-h-[32px]",children:i.jsx("div",{className:"group-hover:bg-[#353535] flex justify-start items-center gap-2 h-[32px] max-h-[32px]",children:i.jsx("div",{className:"flex justify-start items-center gap-1",children:i.jsx(aa,{info1:`${(G==null?void 0:G.address).slice(0,5)+"..."+(G==null?void 0:G.address).slice(-4)}`,info1_Color:"text-white",rowTwo:!1})})})})}),i.jsx("td",{scope:"row",className:"group-hover:bg-[#353535]",children:i.jsx("div",{className:"group-hover:bg-[#353535] flex justify-start items-center gap-4 min-h-[32px] px-1",children:i.jsx("div",{className:"group-hover:bg-[#353535] flex justify-start items-center gap-2 h-[32px] max-h-[32px]",children:i.jsx("div",{className:"flex justify-start items-center gap-1.5 text-white text-sm font-semibold font-manrope leading-[8px]",children:G!=null&&G.level?`L${G==null?void 0:G.level}`:"--"})})})}),i.jsx("td",{children:i.jsx("div",{className:"group-hover:bg-[#353535] flex justify-start items-center gap-4 min-h-[32px] pl-1 pr-4",children:i.jsx("div",{className:"flex justify-start items-center gap-1.5 text-white text-sm font-semibold font-manrope leading-[8px]",children:G!=null&&G.created_at?Jlt(G==null?void 0:G.created_at):"--"})})})]},V))})]})})]})]})},fan=({open:e,setOpen:t})=>i.jsxs(Ea,{open:e,onClose:t,className:"relative z-50 font-manrope",children:[i.jsx(ja,{transition:!0,style:{backgroundColor:"rgba(0, 0, 0, 0.48)"},className:"fixed inset-0 transition-opacity data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in"}),i.jsx("div",{className:"fixed inset-0 z-50 w-screen overflow-y-auto",children:i.jsx("div",{className:"flex min-h-full items-end justify-center p-4 text-center sm:items-center sm:p-0",children:i.jsx(xa,{transition:!0,className:"relative transform overflow-hidden bg-[#101010] text-left shadow-xl transition-all data-[closed]:translate-y-4 data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in data-[closed]:sm:translate-y-0 data-[closed]:sm:scale-95 rounded-3xl",children:i.jsx("div",{className:"flex flex-col justify-start items-center gap-8 w-[400px] h-max relative bg-[#252525] rounded-3xl pt-4 pb-6",children:i.jsxs(i.Fragment,{children:[i.jsx("div",{onClick:()=>{t(!1)},className:"cursor-pointer flex w-full items-center justify-end absolute right-2 top-1",children:i.jsx("span",{className:"absolute top-2 right-2 w-9 h-9 rounded-full p-1 flex justify-center items-center hover:bg-[#7535FE]",children:i.jsx("img",{className:"p-1",src:Ba})})}),i.jsx("div",{className:"pt-4",children:i.jsx("img",{src:oke,alt:"",className:"w-[86px h-[86px]"})}),i.jsxs("div",{className:"flex flex-col items-center justify-start gap-4",children:[i.jsx("div",{className:"text-center text-white text-sm font-medium font-['Inter'] leading-4 tracking-[-0.28px]",children:"Trial activated!"}),i.jsx("div",{className:"w-[200px] text-center text-white text-[13px] font-normal font-['Inter'] leading-4",children:"Enjoy your 2-day premium trial."}),i.jsx("div",{className:"flex flex-col items-center gap-6 mt-[33px]",children:i.jsx("div",{onClick:()=>{window.open("https://app.dextrabot.com/referral#lighter-farming","_blank")},className:"w-[345px] h-10 px-6 py-3 bg-white hover:bg-[#E5E5E5] rounded-xl shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] inline-flex justify-center items-center gap-2.5 cursor-pointer",children:i.jsx("div",{className:"justify-start text-black text-sm font-semibold font-['Inter'] leading-none",children:"Try Lighter Farming"})})})]})]})})})})})]}),han=()=>{const{isConnected:e,address:t}=ns(),{setSignModalOpen:n,hyperToken:r,setTelegramChatId:s,setSubscriberRole:a,setSubsExpireDay:o,setMushboomerETH:l,setMushboomerSOL:c,setIsReferralCode:u,setIsReferralCodeName:d,setIsWhitelist:f,setHyperToken:x,setHyperAddress:g}=m.useContext(Qr),[v,w]=m.useState("Enter Code"),[C,N]=m.useState("Earnings"),P=t5(),I=(P==null?void 0:P.code)||"",[R,F]=m.useState(""),[U,L]=m.useState(""),[z,Q]=m.useState(null),[ne,J]=m.useState(""),[X,re]=m.useState(""),[pe,Y]=m.useState(""),[ie,oe]=m.useState(""),[G,V]=m.useState(!1),[ee,ae]=m.useState(!1),[fe,Ne]=m.useState([]),[he,ge]=m.useState(!1),[ye,ve]=m.useState(!1),[je,Ie]=m.useState(!1),[Le,Qe]=m.useState([]),[$e,it]=m.useState(!1),[tt,lt]=m.useState(!1),[ft,ut]=m.useState(!1),qt=m.useRef(null),[It,nn]=m.useState(0);m.useEffect(()=>{I&&(F(I),Ie(!0))},[I]);const jt=ht=>{let Zt=ht.target.value.toUpperCase();/^[0-9A-Z_-]{0,10}$/.test(Zt)&&(F(Zt),L(""))},cn=ht=>{let Zt=ht.target.value.toUpperCase();/^[0-9A-Z_-]{0,10}$/.test(Zt)&&(J(Zt),re(""))},un=async()=>{var ht,Zt;try{const zt=window.localStorage.getItem("hyperToken"),Et="https://dextrabothypev2.nftinit.io/api/subscriber/refcode/info/";if(!zt){n(!0);return}const nt=window.localStorage.getItem("hyperAddress"),Rt=await(await fetch(Et,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:t?t.toLowerCase():nt,token:zt})})).json();Rt.success?(Q((ht=Rt==null?void 0:Rt.data)==null?void 0:ht.referrer_code),oe((Zt=Rt==null?void 0:Rt.data)==null?void 0:Zt.my_refcode)):console.log(Rt.error_message)}catch(zt){console.error("Error referans request:",zt)}};m.useEffect(()=>{un(),qe(),Ye()},[r]);const Ft=async ht=>{try{V(!0);const Zt=window.localStorage.getItem("hyperToken"),zt="https://dextrabothypev2.nftinit.io/api/subscriber/refcode/set/";Zt||(n(!0),V(!1));const Et=window.localStorage.getItem("hyperAddress"),Ue=await(await fetch(zt,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:t?t.toLowerCase():Et,token:Zt,refcode:ht})})).json();Ue.success?(Q(ht),V(!1),Ie(!1),rn.success("Referral code add successfully",{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(103, 255, 189, 0.32)",width:"380px",minWidth:"380px",height:"40px",backdropFilter:"blur(48px)"},iconTheme:{primary:"#67FFBD",secondary:"#276047"}}),Ue!=null&&Ue.trial_farming&&ut(!0)):(console.log(Ue.error_message),L(Ue.error_message),je&&rn.success(i.jsx(i.Fragment,{children:i.jsx("span",{children:Ue.error_message})}),{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(255, 121, 124, 0.32)",width:"360px",minWidth:"360px",height:"40px",backdropFilter:"blur(48px)"},iconTheme:{primary:"#ff797c",secondary:"#7d3031"}}),V(!1))}catch(Zt){console.error("Error in like function:",Zt),L(Zt.message),je&&rn.error(Zt.message),V(!1)}},Ke=async ht=>{try{ae(!0);const Zt=window.localStorage.getItem("hyperToken"),zt="https://dextrabothypev2.nftinit.io/api/subscriber/refcode/generate/";Zt||(n(!0),ae(!1));const Et=window.localStorage.getItem("hyperAddress"),Ue=await(await fetch(zt,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:t?t.toLowerCase():Et,token:Zt,refcode:ht})})).json();Ue.success?(Y(`https://app.dextrabot.com/referral/${Ue==null?void 0:Ue.refcode}`),oe(Ue==null?void 0:Ue.refcode),ae(!1)):(console.log(Ue.error_message),ae(!1),re(Ue.error_message))}catch(Zt){console.error("Error in like function:",Zt),re(Zt.message),ae(!1)}},Bt=()=>{R.length<4?(L("You must enter at least 4 characters!"),je&&rn.error("This refcode is wrong")):(L(""),Ft(R))},$t=()=>{ne.length<4?re(ie?"You have a generated code, you cannot generate it again.":"You must enter at least 4 characters!"):(re(""),Ke(ne))};m.useEffect(()=>{(async()=>{var Et,nt;const Zt=window.localStorage.getItem("hyperToken"),zt=window.localStorage.getItem("hyperAddress");if(!(!Zt||!zt))try{const Ue=await Ei(zt.toLowerCase(),Zt);Ue!=null&&Ue.success?(s(Ue==null?void 0:Ue.telegram_chat_id),a(Ue==null?void 0:Ue.subscriber_role),o(Ue==null?void 0:Ue.subs_expire_day),l((Et=Ue==null?void 0:Ue.mushboomer_counts)==null?void 0:Et.eth),c((nt=Ue==null?void 0:Ue.mushboomer_counts)==null?void 0:nt.sol),u(Ue==null?void 0:Ue.referral_code),d(Ue==null?void 0:Ue.refcode),f(Ue==null?void 0:Ue.whitelist)):(window.localStorage.removeItem("hyperToken"),window.localStorage.removeItem("hyperAddress"),x(""),g(""))}catch(Ue){console.error("Token verification error:",Ue),console.error(Ue.message||"An unknown error occurred.")}})()},[z]);const qe=async()=>{try{ge(!0);const ht=window.localStorage.getItem("hyperToken"),Zt="https://dextrabothypev2.nftinit.io/api/subscriber/refcode/claims/";if(!ht){n(!0),ge(!1);return}const zt=window.localStorage.getItem("hyperAddress"),nt=await(await fetch(Zt,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:t?t.toLowerCase():zt,token:ht})})).json();nt.success?(Ne(nt==null?void 0:nt.data),ge(!1)):(console.log(nt.error_message),ve(nt.error_message),ge(!1))}catch(ht){console.error("Error in like function:",ht),ve(ht.message),ge(!1)}},Ye=async()=>{try{it(!0);const ht=window.localStorage.getItem("hyperToken"),Zt="https://dextrabothypev2.nftinit.io/api/subscriber/refcode/usage/";if(!ht){n(!0),it(!1);return}const zt=window.localStorage.getItem("hyperAddress"),nt=await(await fetch(Zt,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:t?t.toLowerCase():zt,token:ht})})).json();nt.success?(Qe(nt==null?void 0:nt.data),it(!1)):(console.log(nt.error_message),lt(nt.error_message),it(!1))}catch(ht){console.error("Error in like function:",ht),lt(ht.message),it(!1)}};return m.useEffect(()=>{const ht=()=>{qt.current&&nn(qt.current.clientHeight)},Zt=new ResizeObserver(ht);return qt.current&&Zt.observe(qt.current),()=>{Zt.disconnect()}},[]),i.jsxs(i.Fragment,{children:[i.jsx(fan,{open:ft,setOpen:ut}),i.jsx(So,{children:i.jsxs(Ro,{children:[i.jsx("title",{children:"Invite & Earn – DextraBot Referral Program"}),i.jsx("link",{rel:"canonical",href:"https://app.dextrabot.com/referral"}),i.jsx("meta",{name:"description",content:"Earn passive income by referring friends to DextraBot! Get a share of the trading fees from every transaction they make. Invite, grow your network, and start earning today!"}),i.jsx("meta",{name:"og:title",content:"Invite & Earn – DextraBot Referral Program"}),i.jsx("meta",{name:"og:description",content:"Earn passive income by referring friends to DextraBot! Get a share of the trading fees from every transaction they make. Invite, grow your network, and start earning today!"}),i.jsx("meta",{name:"og:image",content:"https://app.dextrabot.com/dextrabotIcon.png"}),i.jsx("meta",{name:"og:url",content:"https://app.dextrabot.com/referral"})]})}),i.jsx("div",{className:"flex justify-center items-start w-full h-[calc(100vh-5rem)] min-h-max px-4 pt-4 pb-10 bg-[#161616]",children:i.jsx("div",{className:"flex flex-col items-stretch justify-start h-full gap-[26px] w-full lg:w-max flex-grow lg:flex-grow-0",children:i.jsxs("div",{className:"flex flex-col items-stretch justify-start w-full gap-8",children:[i.jsxs("div",{className:"flex flex-col sm:flex-row justify-start items-start gap-8 min-w-full w-full",children:[i.jsx(can,{handleEnterCode:Bt,handleChange:jt,error:U,handleGenerateCode:$t,handleGenerateChange:cn,generateError:X,generateData:pe,userReferansCode:z,setInputValue:F,setGenerateValue:J,inputValue:R,generateValue:ne,setIsMenu:w,isMenu:v,setGenerateCode:oe,generateCode:ie,setIsGenerateLoading:ae,isGenerateLoading:ee,setIsEnterLoading:V,isEnterLoading:G,divRef:qt,isEnterModal:je,setIsEnterModal:Ie}),i.jsx(dan,{data:fe,dataLoading:he,dataError:ye,height:It,handleRefTable:qe,dataUsage:Le,dataUsageLoading:$e,dataUsageError:tt,setIsOnTableTab:N,isOnTableTab:C})]}),i.jsxs("div",{className:"flex flex-col items-center justify-center h-full gap-2 bg-[#232323] rounded-2xl mb-10 p-4",children:[i.jsxs("div",{onClick:()=>window.open("https://docs.dextrabot.com/refferal","_blank"),className:"flex justify-center items-center w-max gap-1.5 rounded-[10px] cursor-pointer",children:[i.jsx("div",{className:"text-white text-sm font-medium font-manrope leading-[18px] tracking-tight w-full sm:max-w-[500px] mb-2",children:"See the full Referral System with Bonuses Details"}),i.jsx("img",{src:gm,alt:"Dextrabot - Referral",className:"w-3 h-3 mb-2"})]}),i.jsx("img",{src:Ybt,alt:"",className:"text-center text-xs w-[900px] h-max sm:h-[450px] mb-10 lg:mb-0"})]})]})})})]})};function Bce({open:e,setOpen:t,data:n,walletData:r,withdrawableUsdc:s,setWithdrawableUsdc:a,modalWalletId:o,setModalWalletId:l}){const{setSignModalOpen:c}=m.useContext(Qr),{isConnected:u,address:d}=ns(),[f,x]=m.useState(""),[g,v]=m.useState(!1),[w,C]=m.useState("");m.useEffect(()=>{const I=n.find(R=>R.wallet_address===r);I&&a(I==null?void 0:I.withdrawableUsdc)},[n]);const N=async()=>{var I,R,F,U,L,z;try{v(!0);const Q=window.localStorage.getItem("hyperToken"),ne="https://dextrabothypev2.nftinit.io/api/wallet/request-withdraw";Q||(c(!0),v(!1)),C("");const J=window.localStorage.getItem("hyperAddress"),re=await(await fetch(ne,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:d?d.toLowerCase():J,token:Q,wallet_id:o??null,amount:f??0,destination:d?d.toLowerCase():J})})).json();re.success?(((R=(I=re==null?void 0:re.result)==null?void 0:I.result)==null?void 0:R.status)=="err"?(v(!1),C((U=(F=re==null?void 0:re.result)==null?void 0:F.result)==null?void 0:U.response)):((z=(L=re==null?void 0:re.result)==null?void 0:L.result)==null?void 0:z.status)=="ok"&&(v(!1),x(""),rn.success("The operation was successful.",{style:{border:"1px solid #22c55e",padding:"16px",color:"#fff",borderRadius:"999px",background:"#14532d",height:"60px",width:"380px",maxWidth:"none",whiteSpace:"nowrap"},iconTheme:{primary:"#22c55e",secondary:"#FFFAEE"}}),t(!1)),v(!1)):(console.log(re.error_message),v(!1),C("The transaction failed, please try again."))}catch(Q){console.error("Error widthdraw amount:",Q),v(!1),C(Q.message)}},P=I=>{x(I.target.value)};return i.jsx(i.Fragment,{children:i.jsxs(Ea,{open:e,onClose:()=>{},className:"relative z-50 font-manrope",children:[i.jsx(ja,{transition:!0,style:{backgroundColor:"rgba(0, 0, 0, 0.48)"},className:"fixed inset-0 transition-opacity data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in"}),i.jsx("div",{className:"fixed inset-0 z-50 w-screen overflow-y-auto",children:i.jsx("div",{className:"flex min-h-full items-end justify-center p-4 text-center sm:items-center sm:p-0",children:i.jsx(xa,{transition:!0,className:"relative transform overflow-hidden bg-[#101010] text-left shadow-xl transition-all data-[closed]:translate-y-4 data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in data-[closed]:sm:translate-y-0 data-[closed]:sm:scale-95 rounded-3xl",children:i.jsx("div",{className:"flex flex-col justify-start items-center gap-8 w-[440px] h-max relative bg-[#252525] rounded-3xl py-4 text-white",children:i.jsxs(i.Fragment,{children:[i.jsx("div",{onClick:()=>{t(!1),x(""),a(null),C("")},className:"cursor-pointer flex w-full items-center justify-end absolute right-2 top-1",children:i.jsx("span",{className:"absolute top-2 right-2 w-9 h-9 rounded-full p-1 flex justify-center items-center hover:bg-[#7535FE]",children:i.jsx("img",{className:"p-1",src:Ba})})}),i.jsx("div",{className:"pt-4",children:i.jsx("img",{src:Gi,alt:"",className:"w-[86px h-[86px]"})}),i.jsxs("div",{className:"flex flex-col items-start justify-center gap-2 text-white",children:[i.jsx("div",{className:"w-[365px] text-center text-white text-xl font-semibold font-manrope leading-7",children:"The withdrawal amount will be sent to your Login wallet on the Arbitrum network."}),i.jsxs("div",{className:"flex justify-start items-center gap-1",children:[i.jsx("span",{className:"text-white/60 text-sm font-medium font-manrope leading-none tracking-tight",children:"Connected(Login) Wallet:"}),i.jsx("span",{className:"text-sm font-medium font-inter leading-none",children:d&&d.slice(0,6)+"..."+d.slice(-4)}),i.jsx("img",{onClick:I=>{I.stopPropagation(),navigator.clipboard.writeText(d),rn.success("Successfully copied.",{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(103, 255, 189, 0.16)",width:"280px",minWidth:"280px",height:"40px",backdropFilter:"blur(16px)"},iconTheme:{primary:"#67FFBD",secondary:"#276047"}})},src:wo,alt:"",className:"cursor-pointer"})]}),i.jsx("div",{className:"flex justify-start mt-4 relative",children:i.jsx("input",{type:"text",value:r&&`${r}`,placeholder:"wallet",disabled:!0,className:"shadow-sm py-0.5 bg-[#303030] block sm:text-sm font-semibold font-manrope leading-none rounded-md px-2 outline-[#404040] placeholder:text-[#7F7F7F] cursor-not-allowed text-white/50 h-8 w-[360px]"})}),i.jsxs("div",{className:"flex justify-start items-center gap-2",children:[i.jsxs("div",{className:"flex relative",children:[i.jsx("input",{value:f,onChange:I=>{let R=I.target.value;R.includes("-")?R=R.replace("-",""):(R===""||parseFloat(R)>=0)&&P({...I,target:{...I.target,value:R}})},type:"number",name:"widthdrawAmount",placeholder:"Amount",min:0,max:s,className:`shadow-sm py-0.5 bg-[#303030] block sm:text-sm font-semibold font-manrope leading-none rounded-md w-36 min-w-36 pl-2 pr-7 ${f!=null&&f!==""?"border border-[#C5C5C5]":""} outline-[#404040] placeholder:text-[#7F7F7F] h-8 w-[305px]`}),i.jsx("p",{className:`${f!=null&&f!==""?"text-white":"text-[#7F7F7F]"} absolute right-1.5 top-1`,children:"$"})]}),i.jsx("button",{onClick:()=>x(s),className:"bg-[#505050] text-white text-xs px-[11px] py-0.5 rounded-md cursor-pointer hover:bg-[#606060] h-8 focus:outline-none focus:ring-0 border-none",children:"Max"})]}),i.jsx("span",{className:"text-white",children:s!=0&&!isNaN(s)?`$${Er(s)}`:"$0"})]}),g&&i.jsxs("div",{role:"status",className:"flex justify-center items-center h-5 min-h-5 w-[34px] px-0.5 rounded-md -my-6",children:[i.jsxs("svg",{"aria-hidden":"true",className:"inline w-4 h-4 text-gray-200 animate-spin dark:text-gray-600 fill-[#67FFBD]",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),i.jsx("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]}),i.jsx("span",{className:"sr-only",children:"Loading..."})]}),i.jsx("div",{onClick:I=>{I.preventDefault(),f!=null&&f!==""?g||N():rn.error("Please enter amount")},className:`${g?"cursor-not-allowed":"cursor-pointer"} h-8 pl-2 pr-3.5 py-3 bg-[#7445ff] rounded-[10px] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-[#8860ff] justify-center items-center gap-1.5 inline-flex w-44 mb-3`,children:i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px]",children:"Apply"})}),w&&i.jsx("div",{className:"h-6 p-2 w-[355px] bg-[#ff6f67]/20 rounded-lg justify-start items-center gap-2.5 inline-flex overflow-hidden -mt-7",children:i.jsx("span",{className:"text-[#ff6e67] text-xs font-semibold font-manrope leading-none tracking-tight",children:w})})]})})})})})]})})}const $ce=({handleListRequest:e,handlePageChange:t,isGenWalletModal:n,setIsGenWalletModal:r})=>{const{setSignModalOpen:s}=m.useContext(Qr);return i.jsxs(i.Fragment,{children:[i.jsx(f5,{open:n,setOpen:r,handleListRequest:e,handlePageChange:t}),i.jsx("div",{className:"flex justify-center items-center w-max h-max -mt-[14px] sm:-mt-0",children:i.jsxs("div",{onClick:a=>{a.preventDefault(),window.localStorage.getItem("hyperToken")?r(!0):s(!0)},className:"h-8 pl-2 pr-2 sm:pl-2 sm:pr-3.5 py-3 bg-[#7445ff] rounded-[10px] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-[#8860ff] justify-center items-center gap-1.5 inline-flex cursor-pointer my-2",children:[i.jsx("div",{"data-svg-wrapper":!0,children:i.jsxs("svg",{width:"19",height:"18",viewBox:"0 0 19 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("path",{d:"M5 9H14",stroke:"white",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),i.jsx("path",{d:"M9.5 13.5V4.5",stroke:"white",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})}),i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px]",children:"Add Account"})]})})]})};function Uce({open:e,setOpen:t,walletAddress:n}){return i.jsxs(Ea,{open:e,onClose:t,className:"relative z-50 font-manrope",children:[i.jsx(ja,{transition:!0,style:{backgroundColor:"rgba(0, 0, 0, 0.48)"},className:"fixed inset-0 transition-opacity data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in"}),i.jsx("div",{className:"fixed inset-0 z-50 w-screen overflow-y-auto",children:i.jsx("div",{className:"flex min-h-full items-end justify-center p-4 text-center sm:items-center sm:p-0",children:i.jsx(xa,{transition:!0,className:"relative transform overflow-hidden bg-[#101010] text-left shadow-xl transition-all data-[closed]:translate-y-4 data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in data-[closed]:sm:translate-y-0 data-[closed]:sm:scale-95 rounded-3xl",children:i.jsx("div",{className:"flex flex-col justify-start items-center gap-8 w-[400px] h-max relative bg-[#252525] rounded-3xl pt-4 pb-6",children:i.jsxs(i.Fragment,{children:[i.jsx("div",{onClick:()=>{t(!1)},className:"cursor-pointer flex w-full items-center justify-end absolute right-2 top-1",children:i.jsx("span",{className:"absolute top-2 right-2 w-9 h-9 rounded-full p-1 flex justify-center items-center hover:bg-[#7535FE]",children:i.jsx("img",{className:"p-1",src:Ba})})}),i.jsxs("div",{className:"flex flex-col items-center justify-start gap-2.5",children:[i.jsx("div",{className:"pt-4",children:i.jsx(rse,{className:"text-[#848484] w-[48px] h-[48px] rotate-180"})}),i.jsx("div",{className:"w-80 text-center text-white text-2xl font-semibold font-manrope leading-7",children:"Deposit Funds"}),i.jsxs("div",{className:"flex justify-start items-start gap-2 pt-[18px]",children:[i.jsx("div",{className:"w-8 h-8 bg-[#67ffbd]/20 rounded-[256px] justify-center items-center inline-flex",children:i.jsx("div",{className:"text-center text-[#67ffbd] text-base font-semibold font-manrope leading-7",children:"1"})}),i.jsxs("div",{className:"flex flex-col items-start justify-start gap-[9px]",children:[i.jsxs("div",{className:"w-[283px]",children:[i.jsxs("span",{className:"text-white text-sm font-medium font-manrope leading-none",children:["Copy your"," "]}),i.jsx("span",{className:"text-white text-sm font-bold font-manrope leading-none",children:"wallet address"})]}),i.jsxs("div",{className:"w-[283px] flex justify-start items-center gap-1.5",children:[i.jsx("span",{className:"text-white/60 text-[13px] font-light font-inter leading-none",children:n&&n.slice(0,5)+"..."+n.slice(-4)}),i.jsx("img",{onClick:r=>{r.stopPropagation(),navigator.clipboard.writeText(n),rn.success("Successfully copied.",{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(103, 255, 189, 0.16)",width:"280px",minWidth:"280px",height:"40px",backdropFilter:"blur(16px)"},iconTheme:{primary:"#67FFBD",secondary:"#276047"}})},src:wo,alt:"",className:"cursor-pointer"})]})]})]}),i.jsxs("div",{className:"flex justify-start items-start gap-2 pt-[10px]",children:[i.jsx("div",{className:"w-8 h-8 bg-[#67ffbd]/20 rounded-[256px] justify-center items-center inline-flex",children:i.jsx("div",{className:"text-center text-[#67ffbd] text-base font-semibold font-manrope leading-7",children:"2"})}),i.jsxs("div",{className:"flex flex-col items-start justify-center gap-[9px]",children:[i.jsx("div",{className:"w-[217px] text-white text-sm font-medium font-manrope leading-none tracking-tight",children:"Deposit USDC on the Arbitrum Network."}),i.jsxs("div",{className:"w-[283px]",children:[i.jsxs("span",{className:"text-white/60 text-[13px] font-light font-inter leading-none",children:["Minimum Deposit:"," "]}),i.jsx("span",{className:"text-[#67ffbd] text-[13px] font-semibold font-manrope leading-none",children:"15 USDC"})]})]})]}),i.jsxs("div",{className:"flex justify-start items-start gap-2 pt-[10px]",children:[i.jsx("div",{className:"w-8 h-8 bg-[#67ffbd]/20 rounded-[256px] justify-center items-center inline-flex",children:i.jsx("div",{className:"text-center text-[#67ffbd] text-base font-semibold font-manrope leading-7",children:"3"})}),i.jsx("div",{className:"w-[283px] text-white text-sm font-medium font-manrope leading-none tracking-tight",children:i.jsx("div",{className:"w-[250px]",children:"Any deposit from other networks or below the minimum amount will be lost."})})]}),i.jsxs("div",{className:"flex justify-start items-start gap-2 pt-[10px]",children:[i.jsx("div",{className:"w-8 h-8 bg-[#67ffbd]/20 rounded-[256px] justify-center items-center inline-flex",children:i.jsx("div",{className:"text-center text-[#67ffbd] text-base font-semibold font-manrope leading-7",children:"4"})}),i.jsxs("div",{className:"w-[283px] text-white text-sm font-medium font-manrope leading-none",children:["Once funds arrive, you are ready ",i.jsx("br",{}),"for Copy Trade"]})]})]})]})})})})})]})}const zce=({open:e,setOpen:t,handleDeleteWallet:n,deleteWalleInfo:r,confirmClosePositions:s,setConfirmClosePositions:a,confirmWithdrawEquity:o,setConfirmWithdrawEquity:l})=>{const c=(r==null?void 0:r.unrealizedPnL)!=0&&(r==null?void 0:r.unrealizedPnL)!=null&&(r==null?void 0:r.unrealizedPnL)!=null&&!s||(r==null?void 0:r.perpEquity)!=0&&(r==null?void 0:r.perpEquity)!=null&&(r==null?void 0:r.perpEquity)!=null&&!o;return i.jsx(i.Fragment,{children:i.jsxs(Ea,{open:e,onClose:()=>{},className:"relative z-50 font-manrope",children:[i.jsx(ja,{transition:!0,style:{backgroundColor:"rgba(0, 0, 0, 0.48)"},className:"fixed inset-0 transition-opacity data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in"}),i.jsx("div",{className:"fixed inset-0 z-50 w-screen overflow-y-auto",children:i.jsx("div",{className:"flex min-h-full items-end justify-center p-4 text-center sm:items-center sm:p-0",children:i.jsx(xa,{transition:!0,className:"relative transform overflow-hidden bg-[#101010] text-left shadow-xl transition-all data-[closed]:translate-y-4 data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in data-[closed]:sm:translate-y-0 data-[closed]:sm:scale-95 rounded-3xl",children:i.jsx("div",{className:"flex flex-col justify-start items-center gap-8 w-[490px] h-max relative bg-[#252525] rounded-3xl py-4 text-white",children:i.jsxs(i.Fragment,{children:[i.jsx("div",{onClick:()=>{t(!1),a(!1),l(!1)},className:"cursor-pointer flex w-full items-center justify-end absolute right-2 top-1",children:i.jsx("span",{className:"absolute top-2 right-2 w-9 h-9 rounded-full p-1 flex justify-center items-center hover:bg-[#7535FE]",children:i.jsx("img",{className:"p-1",src:Ba})})}),i.jsx("div",{className:"pt-4",children:i.jsx("img",{src:Gi,alt:"",className:"w-[86px h-[86px]"})}),i.jsxs("div",{className:"flex flex-col justify-start items-center gap-2",children:[i.jsx("div",{className:" text-center text-white text-2xl font-semibold font-manrope leading-7",children:(r==null?void 0:r.unrealizedPnL)!=0&&(r==null?void 0:r.unrealizedPnL)!=null&&(r==null?void 0:r.unrealizedPnL)!=null?"Cannot Delete Wallet: Open Positions":(r==null?void 0:r.perpEquity)!=0&&(r==null?void 0:r.perpEquity)!=null&&(r==null?void 0:r.perpEquity)!=null?"Wallet Has Remaining Perp Equity":"Confirm Wallet Deletion"}),i.jsx("div",{className:"w-[398px] text-center text-white/60 text-[16px] font-medium font-manrope leading-5",children:(r==null?void 0:r.unrealizedPnL)!=0&&(r==null?void 0:r.unrealizedPnL)!=null&&(r==null?void 0:r.unrealizedPnL)!=null||(r==null?void 0:r.perpEquity)!=0&&(r==null?void 0:r.perpEquity)!=null&&(r==null?void 0:r.perpEquity)!=null?"":"Are you sure you want to delete this Follower Wallet? This action cannot be undone."}),i.jsxs("div",{className:`${((r==null?void 0:r.unrealizedPnL)==0||(r==null?void 0:r.unrealizedPnL)==null||(r==null?void 0:r.unrealizedPnL)==null)&&(r==null?void 0:r.perpEquity)!=0&&(r==null?void 0:r.perpEquity)!=null&&(r==null?void 0:r.perpEquity)!=null?"ml-32":"ml-4"} flex flex-col gap-3 items-start w-[398px]`,children:[(r==null?void 0:r.unrealizedPnL)!=0&&(r==null?void 0:r.unrealizedPnL)!=null&&(r==null?void 0:r.unrealizedPnL)!=null&&i.jsxs("label",{className:"flex items-center gap-2 cursor-pointer select-none",children:[i.jsx("input",{type:"checkbox",checked:s,onChange:u=>a(u.target.checked),className:"hidden peer"}),i.jsx("div",{className:`w-[18px] h-[18px] flex items-center justify-center rounded border transition-all duration-200 ${s?"bg-[#3ec78c] border-[#3ec78c]":"border-[#9d9d9d]"}`,children:s&&i.jsx("img",{src:Yc,alt:"",className:"w-[8.50px] h-[5.66px] ml-[2px]"})}),i.jsx("span",{className:"text-white/60 text-[16px] font-medium font-manrope leading-5",children:"I have closed all my open positions in this wallet."})]}),(r==null?void 0:r.perpEquity)!=0&&(r==null?void 0:r.perpEquity)!=null&&(r==null?void 0:r.perpEquity)!=null&&i.jsxs("label",{className:"flex items-center gap-2 cursor-pointer select-none",children:[i.jsx("input",{type:"checkbox",checked:o,onChange:u=>l(u.target.checked),className:"hidden peer"}),i.jsx("div",{className:`w-[18px] h-[18px] flex items-center justify-center rounded border transition-all duration-200 ${o?"bg-[#3ec78c] border-[#3ec78c]":"border-[#9d9d9d]"}`,children:o&&i.jsx("img",{src:Yc,alt:"",className:"w-[8.50px] h-[5.66px] ml-[2px]"})}),i.jsx("span",{className:"text-white/60 text-[16px] font-medium font-manrope leading-5",children:"I've withdrawn all my perp equity."})]})]})]}),i.jsxs("div",{className:"flex items-center justify-center gap-4 mb-3",children:[i.jsx("div",{onClick:()=>{t(!1)},className:"h-8 px-4 py-3 rounded-xl shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-white justify-center items-center gap-2.5 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px]",children:"Cancel"})}),i.jsx("div",{onClick:u=>{u.preventDefault(),c||n(r==null?void 0:r.walletId,r==null?void 0:r.walletName,r==null?void 0:r.wallet)},className:`${c?"bg-gray-500 border-gray-600 cursor-not-allowed":"bg-[#7445ff] border-[#8860ff] cursor-pointer"} h-8 px-2 py-3 rounded-[10px] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] justify-center items-center gap-1.5 inline-flex`,children:i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px]",children:"Delete"})})]})]})})})})})]})})},Hce=({rowData:e})=>e?i.jsxs("div",{className:"flex flex-col gap-4 p-4 bg-[#2e2e2e]/40 rounded-2xl",children:[i.jsxs("div",{className:"flex flex-col",children:[i.jsx("span",{className:"text-xs text-[#ababab]",children:"Name"}),i.jsx("span",{className:"text-sm font-semibold text-white",children:e.wallet_name})]}),i.jsxs("div",{className:"flex flex-col",children:[i.jsx("span",{className:"text-xs text-[#ababab]",children:"Follower Wallet"}),i.jsx("span",{className:"text-sm font-medium text-white break-all",children:e.wallet_address})]}),i.jsxs("div",{className:"flex flex-col",children:[i.jsx("span",{className:"text-xs text-[#ababab]",children:"Creation Date"}),i.jsx("span",{className:"text-sm font-medium text-white",children:p3(e.wallet_created_data)})]}),i.jsxs("div",{className:"flex flex-col",children:[i.jsx("span",{className:"text-xs text-[#ababab]",children:"Perp Equity"}),i.jsxs("span",{className:"text-sm font-semibold text-white",children:["$",Er(e.perpEquity)??0]})]}),i.jsxs("div",{className:"flex flex-col",children:[i.jsx("span",{className:"text-xs text-[#ababab]",children:"uPnL"}),i.jsxs("span",{className:`text-sm font-semibold ${e.unrealizedPnl>=0?"text-[#4ae3b5]":"text-[#ff6b6b]"}`,children:["$",Er(Math.abs(e.unrealizedPnl))]})]}),i.jsxs("div",{className:"flex flex-col",children:[i.jsx("span",{className:"text-xs text-[#ababab]",children:"Margin Used"}),i.jsxs("span",{className:"text-sm font-semibold text-white",children:["$",Er(e.marginUsed)??0]})]}),i.jsxs("div",{className:"flex flex-col",children:[i.jsx("span",{className:"text-xs text-[#ababab]",children:"Available Balance"}),i.jsxs("span",{className:"text-sm font-semibold text-white",children:["$",Er(e.withdrawableUsdc)??0]})]})]}):null,pan=({data:e,loading:t,error:n,socketLoading:r,currentPage:s,handlePageChange:a,allWallets:o,lighterWallet:l,extendedWallet:c,handleListRequest:u,isSelectMenu:d,setIsSelectMenu:f})=>{var un;const[x,g]=m.useState(!1),{setSignModalOpen:v}=m.useContext(Qr),{isConnected:w,address:C}=ns(),N=5,[P,I]=m.useState(null),[R,F]=m.useState(null),[U,L]=m.useState(!1),[z,Q]=m.useState(null),[ne,J]=m.useState(!1),[X,re]=m.useState("");m.useState({});const[pe,Y]=m.useState({}),[ie,oe]=m.useState(!1),[G,V]=m.useState({wallet:"",walletId:"",walletName:"",unrealizedPnL:"",perpEquity:""}),[ee,ae]=m.useState(!1),[fe,Ne]=m.useState(!1),he="-perpEquity",[ge,ye]=m.useState(he),ve=Ft=>e.sort((Ke,Bt)=>{if(Ke.version===3&&Bt.version!==3)return-1;if(Bt.version===3&&Ke.version!==3)return 1;const $t=Ke.wallet_name?Ke.wallet_name.toUpperCase():"",qe=Bt.wallet_name?Bt.wallet_name.toUpperCase():"",Ye=Ke.wallet_address?Ke.wallet_address.toLowerCase():"",ht=Bt.wallet_address?Bt.wallet_address.toLowerCase():"";return Ft==="wallet_name"?$t<qe?-1:$t>qe?1:0:Ft==="-wallet_name"?$t>qe?-1:$t<qe?1:0:Ft==="-wallet_address"?Ye<ht?-1:Ye>ht?1:0:Ft==="wallet_address"?Ye>ht?-1:Ye<ht?1:0:Ft==="-wallet_created_data"?new Date(Bt.wallet_created_data)-new Date(Ke.wallet_created_data):Ft==="wallet_created_data"?new Date(Ke.wallet_created_data)-new Date(Bt.wallet_created_data):Ft==="-perpEquity"?Bt.perpEquity-Ke.perpEquity:Ft==="perpEquity"?Ke.perpEquity-Bt.perpEquity:Ft==="-unrealizedPnl"?Bt.unrealizedPnl-Ke.unrealizedPnl:Ft==="unrealizedPnl"?Ke.unrealizedPnl-Bt.unrealizedPnl:Ft==="-marginUsed"?Bt.marginUsed-Ke.marginUsed:Ft==="marginUsed"?Ke.marginUsed-Bt.marginUsed:Ft==="-withdrawableUsdc"?Bt.withdrawableUsdc-Ke.withdrawableUsdc:Ft==="withdrawableUsdc"?Ke.withdrawableUsdc-Bt.withdrawableUsdc:0}),je=async(Ft,Ke,Bt)=>{if(!Ft||!Ke||!Bt){console.error("Delete order called with invalid parameters"),rn.error("Delete order called with invalid parameters");return}const $t=`${Ft}_${Ke}`;try{Y(Et=>({...Et,[$t]:!0}));const qe=window.localStorage.getItem("hyperToken"),Ye="https://dextrabothypev2.nftinit.io/api/wallet/delete";if(!qe){v(!0),Y(Et=>({...Et,[$t]:!1}));return}const ht=window.localStorage.getItem("hyperAddress"),Zt=await fetch(Ye,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:C?C.toLowerCase():ht,token:qe,wallet_id:Ft.toString()})});if(!Zt.ok)throw new zl(`Server responded with status ${Zt.status}`);const zt=await Zt.json();zt.success?(u(),V({wallet:"",walletId:"",walletName:"",unrealizedPnL:"",perpEquity:""}),ae(!1),Ne(!1),oe(!1),Y(Et=>({...Et,[$t]:!1})),rn.success(i.jsxs(i.Fragment,{children:[i.jsx("span",{children:Bt.slice(0,5)+"..."+Bt.slice(-3)}),i.jsxs("span",{style:{color:"#ff797c",paddingLeft:"5px"},children:[" ","removed from generated wallets"]})]}),{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(255, 121, 124, 0.32)",width:"440px",minWidth:"440px",height:"40px",backdropFilter:"blur(48px)"},iconTheme:{primary:"#ff797c",secondary:"#7d3031"}})):(console.log(zt.error_message),rn.error(zt.error_message),Y(Et=>({...Et,[$t]:!1})))}catch(qe){console.error("Error deleting wallet:",qe),rn.error(qe.message),Y(Ye=>({...Ye,[$t]:!1}))}},Ie=m.useRef(null),Le=()=>{Ie.current&&(Ie.current.scrollLeft-=100)},Qe=()=>{Ie.current&&(Ie.current.scrollLeft+=100)},$e=()=>{Ie.current&&(Ie.current.scrollTop+=200)},it=()=>{Ie.current&&(Ie.current.scrollTop-=200)},tt=Ft=>Ft>=640&&Ft<1024?4:Ft>=1024&&Ft<1240?7:Ft>=1240&&Ft<1540||Ft>=1540?8:3,[lt,ft]=m.useState(null),[ut,qt]=m.useState(!1),[It,nn]=m.useState(!1);m.useEffect(()=>{const Ft=()=>{nn(window.innerWidth<640)};return window.addEventListener("resize",Ft),Ft(),()=>window.removeEventListener("resize",Ft)},[]);const jt=Ft=>{It&&(ft(Ft),qt(!0))};m.useEffect(()=>{const Ft=window.location.hash;if(!Ft)return;const Ke=Ft.split("#").filter(Boolean);Ke.includes("add-account")&&(g(!0),Ke[0]==="hyperliquid"&&(f("HYPER"),localStorage.setItem("isWalletSelectMenu","HYPER")),Ke[0]==="lighter"&&(f("LIGHTER"),localStorage.setItem("isWalletSelectMenu","LIGHTER")),Ke[0]==="extended"&&(f("EXTENDED"),localStorage.setItem("isWalletSelectMenu","EXTENDED")))},[]);const cn=Ft=>{g(!1),Ft==="HYPER"?(window.history.replaceState(null,"",`${window.location.pathname}#hyperliquid`),f("HYPER"),localStorage.setItem("isWalletSelectMenu","HYPER")):Ft==="LIGHTER"?(window.history.replaceState(null,"",`${window.location.pathname}#lighter`),f("LIGHTER"),localStorage.setItem("isWalletSelectMenu","LIGHTER")):Ft==="EXTENDED"&&(window.history.replaceState(null,"",`${window.location.pathname}#extended`),f("EXTENDED"),localStorage.setItem("isWalletSelectMenu","EXTENDED"))};return i.jsxs(i.Fragment,{children:[i.jsx(Bce,{open:U,setOpen:L,data:e,walletData:P,withdrawableUsdc:z,setWithdrawableUsdc:Q,modalWalletId:R,setModalWalletId:F}),i.jsx(Uce,{open:ne,setOpen:J,walletAddress:X}),i.jsx(zce,{open:ie,setOpen:oe,handleDeleteWallet:je,deleteWalleInfo:G,confirmClosePositions:ee,setConfirmClosePositions:ae,confirmWithdrawEquity:fe,setConfirmWithdrawEquity:Ne}),i.jsx(up,{isOpen:ut,onClose:()=>qt(!1),children:i.jsx(Hce,{rowData:lt})}),i.jsxs("div",{className:"flex flex-col items-stretch justify-start gap-[17px] text-white bg-[#161616] w-full h-full sm:min-h-[340px] max-h-max font-manrope relative",children:[i.jsxs("div",{className:"flex justify-start items-center gap-10 pl-2 sm:pl-0 pt-4",children:[i.jsxs("div",{className:"hidden sm:flex flex-col items-start justify-start gap-2 font-manrope min-w-max bg-[#161616] ",children:[i.jsx("div",{className:"text-[#7e7e7e] text-[11px] font-medium font-inter leading-[8px]",children:"Hype / Explore"}),i.jsx("div",{className:"flex items-center justify-start gap-4",children:i.jsx("div",{className:"text-white text-lg font-medium font-manrope leading-[21px]",children:"Wallet Management"})})]}),i.jsxs("div",{className:"flex flex-col items-start lg:flex-row lg:justify-start lg:items-center gap-1 lg:gap-10",children:[i.jsx($ce,{handleListRequest:u,handlePageChange:a,isGenWalletModal:x,setIsGenWalletModal:g}),i.jsxs("div",{className:"flex justify-start items-center gap-1.5 w-max h-max rounded-lg border border-[#333333] p-1",children:[i.jsx(KY,{title:"HYPER",label:"HYPERLIQUID",walletLength:o,handleSelectMenuChange:cn,isSelectMenu:d}),i.jsx(KY,{title:"LIGHTER",label:"LIGHTER",walletLength:l,handleSelectMenuChange:cn,isSelectMenu:d}),i.jsx(KY,{title:"EXTENDED",label:"EXTENDED",walletLength:c,handleSelectMenuChange:cn,isSelectMenu:d})]})]})]}),i.jsxs("div",{className:"relative w-full h-full",children:[i.jsxs("div",{className:"absolute -top-5 right-4 z-10 hidden justify-start items-center gap-2",children:[i.jsx("button",{onClick:Le,className:"bg-[#353535] hover:bg-gray-600 text-white p-1 rounded-lg focus:outline-none focus:ring-0 border-none",children:i.jsx("span",{className:"w-6 h-6",children:i.jsx(Xa,{className:"text-gray-300 w-4 h-4 rotate-90"})})}),i.jsx("button",{onClick:Qe,className:"bg-[#353535] hover:bg-gray-600 text-white p-1 rounded-lg focus:outline-none focus:ring-0 border-none",children:i.jsx("span",{className:"w-6 h-6",children:i.jsx(Xa,{className:"text-gray-300 w-4 h-4 -rotate-90"})})}),i.jsx("button",{onClick:it,className:"bg-[#353535] hover:bg-gray-600 text-white p-1 rounded-lg focus:outline-none focus:ring-0 border-none",children:i.jsx("span",{className:"w-6 h-6",children:i.jsx(Xa,{className:"text-gray-300 w-4 h-4 -rotate-180"})})}),i.jsx("button",{onClick:$e,className:"bg-[#353535] hover:bg-gray-600 text-white p-1 rounded-lg focus:outline-none focus:ring-0 border-none",children:i.jsx("span",{className:"w-6 h-6",children:i.jsx(Xa,{className:"text-gray-300 w-4 h-4 "})})})]}),i.jsx("div",{className:"w-full h-auto sm:h-max max-w-[100%] overflow-scroll relative flex-grow",ref:Ie,children:i.jsxs("table",{className:"w-full relative",children:[i.jsx("thead",{className:"sticky top-0 z-[3] bg-[#161616] whitespace-nowrap",children:i.jsxs("tr",{className:"w-full z-[4] text-[#9b9b9b] text-[13px] font-semibold font-manrope leading-[13px] tracking-tight",children:[i.jsx("th",{scope:"col",className:"font-medium sm:sticky bg-[#161616] sm:left-0 h-8 pl-3 min-w-[120px] sm:min-w-[140px] z-[8]",children:i.jsx(hi,{title:"Name",sortKey:"wallet_name",sortOption:ge,setSortOption:ye,isFilterIcon:!1})}),i.jsx("th",{scope:"col",className:"sm:sticky bg-[#161616] sm:left-[140px] h-10 px-1 min-w-[160px] sm:min-w-[190px] z-[8]",children:i.jsx(hi,{title:"Follower Wallet",sortKey:"wallet_address",sortOption:ge,setSortOption:ye,isFilterIcon:!1})}),i.jsx("th",{scope:"col",className:"min-w-[110px] sm:min-w-[110px] px-1 hidden sm:table-cell",children:i.jsx(hi,{title:"Creation Date",sortKey:"wallet_created_data",sortOption:ge,setSortOption:ye,isFilterIcon:!1})}),i.jsx("th",{scope:"col",className:"min-w-[120px] sm:min-w-[120px] px-1",children:i.jsx(hi,{title:"Perp Equity",sortKey:"perpEquity",sortOption:ge,setSortOption:ye,isFilterIcon:!0})}),i.jsx("th",{scope:"col",className:"min-w-[134px] sm:min-w-[134px] px-1",children:i.jsx(hi,{title:"uPnL",sortKey:"unrealizedPnl",sortOption:ge,setSortOption:ye,isFilterIcon:!0})}),i.jsx("th",{scope:"col",className:"min-w-[104px] sm:min-w-[104px] px-1 hidden sm:table-cell",children:i.jsx(hi,{title:"Margin",sortKey:"marginUsed",sortOption:ge,setSortOption:ye,isFilterIcon:!0})}),i.jsx("th",{scope:"col",className:"min-w-[130px] sm:min-w-[130px] px-1 hidden sm:table-cell",children:i.jsx(hi,{title:"Avail. Balance",sortKey:"withdrawableUsdc",sortOption:ge,setSortOption:ye,isFilterIcon:!0})}),i.jsx("th",{scope:"col",className:"min-w-[330px] sm:min-w-[330px] pl-1 pr-4 hidden sm:table-cell",children:i.jsx("div",{className:"font-medium flex items-center justify-start w-full min-w-max",children:i.jsx("div",{className:"flex items-center justify-end w-full"})})})]})}),i.jsx("tbody",{children:!e||t?i.jsx("tr",{className:"text-center w-full h-full",children:i.jsx("td",{colSpan:tt(window.innerWidth),children:i.jsx("div",{className:"fixed top-1/3 left-1/2 transform -translate-x-1/2 -translate-y-1/2 z-10 min-h-[30vh] flex flex-col justify-center items-center",children:i.jsx(Da,{})})})}):n&&!e?i.jsx("tr",{className:"text-center w-full h-full",children:i.jsx("td",{colSpan:tt(window.innerWidth),children:i.jsx("div",{className:"flex min-h-[30vh] flex-col justify-center items-center top-[7%] lg:top-[10%] left-[20%] sm:left-[40%] lg:left-[50%] 2xl:left-[45%] z-10",children:i.jsx(zl,{})})})}):(e==null?void 0:e.length)==0?i.jsx("tr",{className:"text-center w-full h-full",children:i.jsx("td",{colSpan:tt(window.innerWidth),children:i.jsx("div",{className:"flex min-h-[30vh] flex-col justify-center items-center top-[7%] lg:top-[15%] left-[20%] sm:left-[40%] lg:left-[50%] 2xl:left-[45%] z-10",children:i.jsx("div",{className:"flex items-center justify-center gap-4 px-4 py-2 flex-col",children:i.jsxs("div",{className:"flex flex-col justify-center items-center gap-3 ml-1 sm:-ml-16",children:[i.jsx("img",{src:ac,alt:""}),i.jsxs("div",{className:"flex flex-col items-center h-max gap-3",children:[i.jsx("div",{className:"text-[#d3d3d3] text-sm font-semibold font-manrope leading-[8px] pt-3",children:"You have not created a wallet yet."}),i.jsxs("div",{className:"text-center -mt-2",children:[i.jsxs("span",{className:"text-[#979797] text-[13px] font-normal font-manrope leading-[14px] tracking-wide",children:["Please use the"," "]}),i.jsx("span",{className:"text-white text-[13px] font-normal font-manrope leading-[14px] tracking-wide",children:"'Add Account'"}),i.jsxs("span",{className:"text-[#979797] text-[13px] font-normal font-manrope leading-[14px] tracking-wide",children:[" ","button to create a wallet."]})]})]})]})})})})}):(un=ve(ge))==null?void 0:un.map((Ft,Ke)=>{const Bt=!isNaN(Ft==null?void 0:Ft.perpEquity)&&!isNaN(Ft==null?void 0:Ft.marginUsed)?(Ft==null?void 0:Ft.perpEquity)-(Ft==null?void 0:Ft.marginUsed):0,$t=It?{onClick:()=>jt(Ft),className:"cursor-pointer"}:{};return i.jsxs("tr",{...$t,className:`${Ke%2===0,"bg-[#161616]"} relative group hover:bg-[#222222] h-[44px] border-b border-[#232323] text-white`,children:[i.jsx("td",{scope:"row",className:`${Ke%2==0,"bg-[#161616]"} sm:sticky sm:left-0 z-[2] group-hover:bg-[#222222]`,children:i.jsx("div",{className:"group-hover:bg-[#222222] flex justify-start items-center gap-2 pl-2 h-[44px] max-h-[44px] ",children:(Ft==null?void 0:Ft.version)==3?i.jsx(mi,{content:"This is an API wallet created from your login wallet. It enables copy trading without withdrawal permissions, keeping your funds safe.",children:i.jsxs("div",{className:"flex justify-start items-center has-tooltip relative",children:[i.jsx("div",{className:"text-sm font-semibold font-manrope leading-none flex items-center justify-start pl-1 gap-0.5 min-w-max",children:(Ft==null?void 0:Ft.wallet_name.length)>=12?(Ft==null?void 0:Ft.wallet_name).slice(0,12)+"... (API-AGENT) Wallet":(Ft==null?void 0:Ft.wallet_name)+"(API-AGENT) Wallet"}),(Ft==null?void 0:Ft.wallet_name.length)>=12&&i.jsx("span",{className:"ml-3",children:i.jsx(Fa,{content:`${Ft==null?void 0:Ft.wallet_name}`,positionTop:!0,alignRight:!1})}),i.jsx(Ni,{className:"text-[#7C7C7C] w-4 min-w-4 min-h-4 h-4 ml-1"})]})}):i.jsxs("div",{className:"flex justify-start items-center has-tooltip relative",children:[i.jsx("div",{className:"text-sm font-semibold font-manrope leading-none flex items-center justify-start pl-1 gap-0.5",children:(Ft==null?void 0:Ft.wallet_name.length)>=12?(Ft==null?void 0:Ft.wallet_name).slice(0,12)+"...":Ft==null?void 0:Ft.wallet_name}),(Ft==null?void 0:Ft.wallet_name.length)>=12&&i.jsx("span",{className:"ml-3",children:i.jsx(Fa,{content:`${Ft==null?void 0:Ft.wallet_name}`,positionTop:!0,alignRight:!1})})]})})}),i.jsx("td",{scope:"row",className:`${Ke%2===0,"bg-[#161616]"} sm:sticky sm:left-[140px] z-[2] group-hover:bg-[#222222]`,children:i.jsx("div",{className:"group-hover:bg-[#222222] flex justify-start items-center gap-4 min-h-[44px] max-h-[44px]",children:i.jsxs("div",{onClick:()=>{window.open(`/wallet-details/${Ft==null?void 0:Ft.wallet_address}`,"_blank")},className:"group-hover:bg-[#222222] flex justify-start items-center gap-2 h-[44px] max-h-[44px] cursor-pointer",children:[i.jsx("div",{className:"fle justify-center items-center",children:i.jsx("div",{className:"w-4 h-4 sm:w-6 sm:h-6 bg-[#4a4a4a] rounded-full",children:i.jsx("img",{src:Gi,alt:"",className:"w-4 h-4 sm:w-6 sm:h-6"})})}),i.jsxs("div",{className:"flex justify-start items-center gap-1.5",children:[i.jsx(aa,{info1:`${(Ft==null?void 0:Ft.wallet_address).slice(0,5)+"..."+(Ft==null?void 0:Ft.wallet_address).slice(-4)}`,info1_Color:"text-white",rowTwo:!1}),i.jsx("img",{onClick:qe=>{qe.stopPropagation(),navigator.clipboard.writeText(Ft==null?void 0:Ft.wallet_address),rn.success("Successfully copied.",{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(103, 255, 189, 0.16)",width:"280px",minWidth:"280px",height:"40px",backdropFilter:"blur(16px)"},iconTheme:{primary:"#67FFBD",secondary:"#276047"}})},src:wo,alt:"",className:"cursor-pointer"})]})]})})}),i.jsx("td",{className:"hidden sm:table-cell",children:i.jsx("div",{className:"flex flex-col items-start gap-0.5",children:i.jsx("div",{className:"text-sm font-semibold font-manrope leading-none flex items-center justify-start pl-1 gap-0.5",children:(Ft==null?void 0:Ft.wallet_created_data)&&p3(Ft==null?void 0:Ft.wallet_created_data)})})}),i.jsx("td",{children:i.jsx("div",{className:"flex flex-col items-end gap-0.5",children:i.jsx("div",{className:"text-sm font-semibold font-manrope leading-none flex items-center justify-start pl-1 gap-0.5 text-white",children:r?"Loading...":(Ft==null?void 0:Ft.perpEquity)!=0&&!isNaN(Ft==null?void 0:Ft.perpEquity)?`$${Er(Ft==null?void 0:Ft.perpEquity)}`:"$0"})})}),i.jsx("td",{children:i.jsx("div",{className:"flex flex-col items-end gap-0.5",children:i.jsx("div",{className:`${(Ft==null?void 0:Ft.unrealizedPnl)>=0?"text-[#4ae3b5]":"text-[#ff6b6b]"} text-sm font-semibold font-manrope leading-none flex items-center justify-start pl-1 gap-0.5`,children:r?i.jsx("span",{className:"text-white",children:"Loading..."}):(Ft==null?void 0:Ft.unrealizedPnl)!=0&&!isNaN(Ft==null?void 0:Ft.unrealizedPnl)?`$${Er(Math.abs(Ft==null?void 0:Ft.unrealizedPnl))}`:"$0"})})}),i.jsx("td",{className:"hidden sm:table-cell",children:i.jsx("div",{className:"flex flex-col items-end gap-0.5",children:i.jsx("div",{className:"text-white text-sm font-semibold font-manrope leading-none flex items-center justify-start pl-1 gap-0.5",children:r?i.jsx("span",{className:"text-white",children:"Loading..."}):(Ft==null?void 0:Ft.marginUsed)!=0&&!isNaN(Ft==null?void 0:Ft.marginUsed)?`$${Er(Ft==null?void 0:Ft.marginUsed)}`:"$0"})})}),i.jsx("td",{className:"hidden sm:table-cell",children:i.jsx("div",{className:"flex flex-col items-end gap-0.5",children:i.jsx("div",{className:`${!r&&Bt<0?"text-[#ff6b6b]":"text-white"} text-sm font-semibold font-manrope leading-none flex items-center justify-start pl-1 gap-0.5`,children:r?i.jsx("span",{children:"Loading..."}):isNaN(Bt)?"$0":`$${Er(Math.abs(Bt))}`})})}),i.jsx("td",{className:"hidden sm:table-cell",children:i.jsxs("div",{className:"flex items-center justify-end gap-2 pr-3",children:[(Ft==null?void 0:Ft.version)===3?i.jsx(mi,{content:"Deposits are not available for API wallets. Please fund your login wallet on Hyperliquid to start trading.",children:i.jsxs("div",{className:"w-[91px] h-[26px] px-2 py-1.5 rounded-md border border-[#353535] justify-center items-center gap-2 hidden sm:inline-flex opacity-80",children:[i.jsx(xy,{className:"text-[#848484] w-[14px] h-[14px] rotate-180"}),i.jsx("div",{className:"text-white text-[11px] font-semibold font-manrope leading-[8px] tracking-tight opacity-60",children:"Deposit"})]})}):i.jsxs("div",{onClick:()=>{J(!0),re(Ft==null?void 0:Ft.wallet_address)},className:"w-[91px] h-[26px] px-2 py-1.5 rounded-md border border-[#353535] justify-center items-center gap-2 hidden sm:inline-flex cursor-pointer",children:[i.jsx(xy,{className:"text-[#848484] w-[14px] h-[14px] rotate-180"}),i.jsx("div",{className:"text-white text-[11px] font-semibold font-manrope leading-[8px] tracking-tight",children:"Deposit"})]}),(Ft==null?void 0:Ft.version)===3?i.jsx(mi,{content:"Withdrawals cannot be made with API wallets. Use your login wallet on Hyperliquid for withdrawals.",children:i.jsxs("div",{className:"w-[91px] h-[26px] px-2 py-1.5 rounded-md border border-[#353535] justify-center items-center gap-2 hidden sm:inline-flex opacity-80",children:[i.jsx(xy,{className:"text-[#848484] w-[14px] h-[14px]"}),i.jsx("div",{className:"text-white text-[11px] font-semibold font-manrope leading-[8px] tracking-tight opacity-60",children:"Withdraw"})]})}):i.jsxs("div",{onClick:()=>{Q(Ft==null?void 0:Ft.withdrawableUsdc),L(!0),I(Ft==null?void 0:Ft.wallet_address),F(Ft==null?void 0:Ft.wallet_id)},className:"w-[91px] h-[26px] px-2 py-1.5 rounded-md border border-[#353535] justify-center items-center gap-2 hidden sm:inline-flex cursor-pointer",children:[i.jsx(xy,{className:"text-[#848484] w-[14px] h-[14px]"}),i.jsx("div",{className:"text-white text-[11px] font-semibold font-manrope leading-[8px] tracking-tight",children:"Withdraw"})]}),pe[`${Ft==null?void 0:Ft.wallet_id}_${Ft==null?void 0:Ft.wallet_name.toLowerCase()}`]?i.jsxs("div",{role:"status",className:"flex justify-center items-center h-5 min-h-5 w-[90px] px-2 py-1.5 rounded-md",children:[i.jsxs("svg",{"aria-hidden":"true",className:"inline w-4 h-4 text-gray-200 animate-spin dark:text-gray-600 fill-[#67FFBD]",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),i.jsx("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]}),i.jsx("span",{className:"sr-only",children:"Loading..."})]}):(Ft==null?void 0:Ft.version)===3?i.jsx(mi,{content:"API wallets cannot be deleted here. To remove this wallet, please delete it from the Hyperliquid API page.",children:i.jsx("div",{className:"w-[91px] h-[26px] px-2 py-1.5 rounded-md border border-[#353535] justify-center items-center gap-2 hidden sm:inline-flex opacity-80",children:i.jsx("div",{className:"text-white text-[11px] font-semibold font-manrope leading-[8px] tracking-tight opacity-60",children:"Delete"})})}):i.jsx("div",{onClick:()=>{V({wallet:Ft==null?void 0:Ft.wallet_address,walletId:Ft==null?void 0:Ft.wallet_id,walletName:Ft==null?void 0:Ft.wallet_name.toLowerCase(),unrealizedPnL:Ft==null?void 0:Ft.unrealizedPnl,perpEquity:Ft==null?void 0:Ft.perpEquity}),oe(!0)},className:"w-[91px] h-[26px] px-2 py-1.5 rounded-md border border-[#353535] justify-center items-center gap-2 hidden sm:inline-flex cursor-pointer",children:i.jsx("div",{className:"text-white text-[11px] font-semibold font-manrope leading-[8px] tracking-tight",children:"Delete"})})]})})]},Ke)})})]})})]}),i.jsxs("div",{className:`flex justify-start items-center gap-2 absolute top-[10px] sm:top-6 right-1 sm:translate-x-0 sm:right-2
`,children:[i.jsx("button",{onClick:()=>a(s-1),disabled:s===1,className:`${s===1?"cursor-not-allowed":"cursor-pointer"} h-8 px-2 sm:px-4 py-3 rounded-xl shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-white justify-center items-center gap-2.5 inline-flex bg-transparent`,children:i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px]",children:"Previous"})}),i.jsxs("div",{className:"text-white text-[14px] font-medium font-inter leading-[8px] w-20 sm:w-auto text-center",children:["Page ",s," / ",Math.ceil(o.length/N)]}),i.jsx("button",{onClick:()=>a(s+1),disabled:s*N>=o.length,className:`${s*N>=o.length?"cursor-not-allowed":"cursor-pointer"} h-8 px-2 sm:px-4 py-3 rounded-xl shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-white justify-center items-center gap-2.5 inline-flex bg-transparent`,children:i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px]",children:"Next"})})]})]})]})},KY=({title:e,label:t,handleSelectMenuChange:n,isSelectMenu:r,walletLength:s})=>i.jsxs("div",{onClick:()=>n(e),className:`${r==e?"bg-[#67ffbd]/20 text-[#67FFBD]":"bg-transparent text-[#9b9b9b]"} ${e==="HYPER"?"gap-1":e==="LIGHTER"?"gap-0.5":"gap-1"} text-[13px] font-medium font-manrope leading-[8px] cursor-pointer flex justify-center items-center min-w-max rounded-md px-[6px] sm:px-[10px] h-[22px]`,children:[e==="HYPER"?i.jsx("img",{src:dx,alt:"hyper",className:"w-4 h-4 rounded-sm"}):e==="LIGHTER"?i.jsx(Xf,{className:"w-4 h-4 text-[#fff]"}):e==="EXTENDED"?i.jsx("img",{src:"https://app.extended.exchange/assets/logo/extended.svg",alt:"Extended",className:"h-[20px] text-white -ml-0.5"}):null,`${t} (${(s==null?void 0:s.length)>0?"⚡"+(s==null?void 0:s.length)+" wallet":"🔌 Not Connected"}) `]});function JUe({open:e,setOpen:t,data:n,setShare:r,setTradeInfo:s}){const a=m.useRef(null),o=async()=>{if(a.current)try{await document.fonts.ready,await new Promise(v=>setTimeout(v,500));const x=await P1(a.current,{cacheBust:!0,backgroundColor:null,useCORS:!0,style:{transform:"scale(1)",transformOrigin:"top left"}}),g=document.createElement("a");g.href=x,g.download="dextrabot.png",document.body.appendChild(g),g.click(),document.body.removeChild(g),rn.success("PNG successfully downloaded!")}catch(x){console.error("Error generating PNG:",x),rn.error("Failed to download PNG.")}},[l,c]=m.useState(),[u,d]=m.useState(!0),f=async x=>{d(!0);try{const v=await(await fetch(`https://api.allorigins.win/raw?url=${encodeURIComponent(x)}`)).blob();return new Promise((w,C)=>{const N=new FileReader;N.onloadend=()=>w(N.result),N.onerror=C,N.readAsDataURL(v)})}catch(g){throw console.error("Image conversion failed:",g),g}finally{d(!1)}};return m.useEffect(()=>{n!=null&&n.coin&&f(`https://app.hyperliquid.xyz/coins/${n==null?void 0:n.coin}.svg`).then(x=>c(x)).catch(()=>c(Va))},[n==null?void 0:n.coin]),i.jsxs(Ea,{open:e,onClose:()=>{},className:"relative z-50 font-manrope",children:[i.jsx(ja,{transition:!0,style:{backgroundColor:"rgba(0, 0, 0, 0.48)"},className:"fixed inset-0 transition-opacity data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in"}),i.jsx("div",{className:"fixed inset-0 z-50 w-screen overflow-y-auto",children:i.jsx("div",{className:"flex min-h-full items-end justify-center p-4 text-center sm:items-center sm:p-0",children:i.jsx(xa,{transition:!0,className:"relative bg-[#101010] text-left shadow-xl transition-all data-[closed]:translate-y-4 data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in data-[closed]:sm:translate-y-0 scale-75",children:i.jsx("div",{className:"flex flex-col justify-start items-center gap-8 w-max relative bg-[#1b1b1b] rounded-2xl",children:i.jsxs(i.Fragment,{children:[i.jsx("div",{onClick:()=>{t(!1),r(!1),setTimeout(()=>{s(x=>({...x,coin:"",type:"",leverage:0,roe:0,entryPrice:0,markPrice:0,pnl:0}))},300)},className:"cursor-pointer flex w-full items-center justify-end absolute right-2 top-1",children:i.jsx("span",{className:"absolute top-2 right-2 w-9 h-9 rounded-full p-1 flex justify-center items-center hover:bg-[#7535FE]",children:i.jsx("img",{className:"p-1",src:Ba})})}),i.jsxs("div",{className:"flex flex-col items-start justify-start gap-4 w-full",children:[i.jsx("div",{className:"flex justify-start items-center w-full pt-6 pl-6 text-white text-base font-semibold font-manrope leading-[8px]",children:"Share PnL"}),i.jsxs("div",{className:"flex justify-start items-center w-full gap-2 px-2 pb-2.5",children:[i.jsx("div",{ref:a,style:{overflow:"visible",position:"relative"},className:"w-[858px] h-[608px] rounded-2xl border border-dashed border-[#353535] justify-center items-center inline-flex overflow-hidden",children:i.jsxs("div",{className:"w-[850px] h-[600px] rounded-xl flex justify-start items-center bg-[#0F1211]",children:[i.jsx("div",{className:"flex justify-start items-center w-[502px] max-h-[600px] bg-[#0F1211] rounded-xl share-pnl-background",children:i.jsxs("div",{className:"flex flex-col items-start gap-4 px-[22px] py-[40px] h-full w-full",children:[i.jsxs("div",{className:"flex justify-start items-center gap-4 relative",children:[i.jsx("img",{src:EA,alt:"",className:"w-12 h-12 max-w-12 min-h-12"}),i.jsx("p",{className:"flex justify-center items-center text-white text-2xl font-semibold font-manrope",children:"Dextrabot - Copy Trade"})]}),i.jsxs("div",{className:"flex flex-col items-start justify-start ",children:[i.jsxs("div",{className:"flex justify-start items-center gap-2 relative mt-6",children:[i.jsx("div",{className:"w-8 h-8 rounded-full flex justify-center items-center",children:i.jsx("div",{className:"w-8 h-8 rounded-full flex justify-center items-center",children:u?i.jsxs("div",{role:"status",className:"flex justify-center items-center h-5 min-h-5 w-[34px] px-0.5 py-1.5 rounded-md",children:[i.jsxs("svg",{"aria-hidden":"true",className:"inline w-4 h-4 text-gray-200 animate-spin dark:text-gray-600 fill-[#67FFBD]",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),i.jsx("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]}),i.jsx("span",{className:"sr-only",children:"Loading..."})]}):i.jsx("img",{src:l||Va,alt:"",className:"rounded-full w-8 h-8",loading:"lazy",onError:x=>ra(x)})})}),i.jsx("div",{className:"text-white text-[32px] font-semibold font-manrope flex items-center",children:n!=null&&n.coin?n==null?void 0:n.coin:"--"}),i.jsx("div",{className:`${(n==null?void 0:n.type)=="Long"?"bg-[#67ffbd]/20 text-[#67ffbd]":"bg-[#ff797c]/20 text-[#ff787b]"} h-9 w-20 min-w-[80px] px-3 flex-shrink-0 rounded-md flex justify-center items-center text-[20px] font-semibold font-manrope uppercase tracking-wide`,children:n!=null&&n.type?n==null?void 0:n.type:"--"}),i.jsxs("div",{className:`${(n==null?void 0:n.type)=="Long"?"bg-[#67ffbd]/20 text-[#67ffbd]":"bg-[#ff797c]/20 text-[#ff787b]"} h-9 w-16 min-w-[64px] px-3 flex-shrink-0 rounded-md flex justify-center items-center text-[20px] font-semibold font-manrope tracking-wide`,children:[n!=null&&n.leverage?n==null?void 0:n.leverage:"--","x"]})]}),i.jsxs("div",{className:`${(n==null?void 0:n.roe)>=0?"text-[#67ffbd]":"text-[#ff6767]"} text-[86px] font-semibold font-manrope leading-[92px] inline-flex justify-center items-center min-w-max`,children:[(n==null?void 0:n.roe)>=0?"+":"-",ao(Math.abs(n==null?void 0:n.roe)),"%"]})]}),i.jsxs("div",{className:"flex justify-start items-start gap-[45px] pt-[12px]",children:[i.jsxs("div",{className:"flex flex-col justify-start items-start gap-[2px] max-h-max",children:[i.jsx("div",{className:"text-white/50 text-lg font-medium font-manrope tracking-wider flex",children:"UNREALIZED PNL"}),i.jsx("div",{className:`${(n==null?void 0:n.pnl)>=0?"text-[#67ffbd]":"text-[#ff787b]"} text-[32px] font-semibold font-manrope leading-none flex`,children:n!=null&&n.pnl?`$${ao(Math.abs(n==null?void 0:n.pnl))}`:ao(Math.abs(n==null?void 0:n.pnl))})]}),i.jsxs("div",{className:"flex flex-col justify-start items-start gap-[2px] max-h-max",children:[i.jsx("div",{className:"text-white/50 text-lg font-medium font-manrope tracking-wider flex",children:"ENTRY PRICE"}),i.jsx("div",{className:"text-white text-[32px] font-semibold font-manrope leading-none flex",children:n!=null&&n.entryPrice?`$${fy(n==null?void 0:n.entryPrice)}`:fy(n==null?void 0:n.entryPrice)})]})]}),i.jsx("div",{className:"flex justify-start items-start gap-[45px] pt-[12px]",children:i.jsxs("div",{className:"flex flex-col justify-start items-start gap-[2px] max-h-max",children:[i.jsx("div",{className:"text-white/50 text-lg font-medium font-manrope tracking-wider flex",children:"MARK PRICE"}),i.jsx("div",{className:"text-white text-[32px] font-semibold font-manrope leading-none flex",children:n!=null&&n.markPrice?`$${fy(n==null?void 0:n.markPrice)}`:fy(n==null?void 0:n.markPrice)})]})}),i.jsx("div",{className:"flex justify-start items-start gap-[65px] pt-[26px]",children:i.jsxs("div",{className:"flex flex-col justify-start items-start gap-[2px] max-h-max",children:[i.jsx("div",{className:"text-white/50 text-lg font-medium font-manrope leading-loose tracking-wider flex",children:"REFERRAL"}),i.jsx("div",{className:"text-white text-[32px] font-semibold font-manrope leading-none flex",children:n!=null&&n.referral?n==null?void 0:n.referral:"--"})]})}),i.jsx("div",{className:"flex justify-start items-start pt-[1px]",children:i.jsx("div",{className:"text-[#828483] text-lg font-medium font-manrope leading-loose tracking-wide",children:n!=null&&n.referral?`https://app.dextrabot.com/referral/${n==null?void 0:n.referral}`:"https://app.dextrabot.com"})})]})}),i.jsx("div",{className:"flex justify-center items-center h-[600px] max-h-[600px] bg-[#0F1211] rounded-tr-xl rounded-br-xl max-w-[378px] overflow-hidden",children:n!=null&&n.roe&&(n==null?void 0:n.roe)>=0?i.jsx("img",{src:AA,alt:"",className:"h-full"}):i.jsx("img",{src:jA,alt:"",className:"h-full"})})]})}),i.jsxs("div",{className:"flex flex-col items-start justify-between gap-4 w-[400px] h-[600px] bg-[#232323] rounded-2xl p-4",children:[i.jsxs("div",{className:"flex flex-col justify-start items-start w-full gap-4",children:[i.jsx("div",{className:"text-white text-base font-semibold font-manrope leading-[21px]",children:"Customization"}),i.jsx("div",{className:"text-[#b1b1b1] text-[13px] font-semibold font-manrope leading-[8px] pt-0.5",children:"Referral Code"}),i.jsxs("div",{className:"flex justify-start items-center gap-2 px-2.5 w-full h-8 bg-[#1b1b1b] rounded-md border border-[#303030]",children:[i.jsx("div",{className:"text-[#7b7b7b] text-sm font-medium font-inter leading-[8px]",children:"#"}),i.jsx("div",{className:"text-white text-sm font-medium font-inter leading-[8px]",children:n!=null&&n.referral?n==null?void 0:n.referral:"--"})]}),i.jsx("div",{className:"text-[#b1b1b1] text-[13px] font-semibold font-manrope leading-[8px] pt-0.5",children:"Comment"}),i.jsx("div",{className:"flex justify-start items-center gap-2 p-2 w-full h-max bg-[#1b1b1b] rounded-lg border border-[#303030]",children:i.jsx("div",{className:"w-max text-[#909090] text-sm font-normal font-inter leading-[18px]",children:n!=null&&n.referral?i.jsxs("span",{children:["Profit like the pros! 🤑 Copy top traders automatically with Dextrabot. Use my referral"," ",n==null?void 0:n.referral," & save 4% on fees! @Dextrabot 🚀"]}):i.jsx("span",{children:"Profit like the pros! 🤑 Copy top traders automatically with @Dextrabot 🚀"})})})]}),i.jsxs("div",{className:"flex flex-col items-start justify-center gap-2.5 w-full",children:[i.jsx("div",{onClick:x=>{x.stopPropagation(),navigator.clipboard.writeText(n!=null&&n.referral?`https://app.dextrabot.com/referral/${n==null?void 0:n.referral}`:"https://app.dextrabot.com"),rn.success("Successfully copied.",{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(103, 255, 189, 0.16)",width:"280px",minWidth:"280px",height:"40px",backdropFilter:"blur(16px)"},iconTheme:{primary:"#67FFBD",secondary:"#276047"}})},className:"w-full h-8 px-4 py-3 rounded-[10px] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-[#353535] justify-center items-center gap-2.5 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px]",children:"Copy URL"})}),i.jsx("div",{onClick:x=>{x.preventDefault(),u||o()},className:`${u?"cursor-not-allowed":"cursor-pointer"} w-full h-8 px-4 py-3 rounded-[10px] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-[#353535] justify-center items-center gap-2.5 inline-flex has-tooltip relative`,children:i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px]",children:u?"Hang tight! Your image is on the way... 🚀":"Download PNG"})}),i.jsx("a",{href:`https://x.com/intent/post?url=${n!=null&&n.referral&&(n==null?void 0:n.referral)!=="--"?`https://app.dextrabot.com/referral/${n==null?void 0:n.referral}`:"https://app.dextrabot.com"}&text=Profit%20like%20the%20pros!%20🤑%20Copy%20top%20traders%20automatically${n!=null&&n.referral&&(n==null?void 0:n.referral)!=="--"?`%20with%20Dextrabot.%20Use%20my%20referral%20${n==null?void 0:n.referral}%20and%20save%204%25%20on%20fees!`:"%20with%20%40Dextrabot"}%20🚀%0A`,target:"_blank",className:"w-full h-8 px-6 py-3 bg-white rounded-[10px] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border justify-center items-center gap-2.5 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-[#363636] text-[13px] font-medium font-inter leading-[8px]",children:"Share on X"})})]})]})]})]})]})})})})})]})}const man=({data:e})=>{const{isConnected:t,address:n}=ns(),{setSignModalOpen:r,hyperToken:s,isReferralCodeName:a}=m.useContext(Qr),[o,l]=m.useState("");m.useState({});const[c,u]=m.useState(!1),[d,f]=m.useState(""),[x,g]=m.useState(!1),v=m.useRef(null),w=m.useRef(null),[C,N]=m.useState(!1),[P,I]=m.useState(!1),[R,F]=m.useState({coin:"",type:"",leverage:0,roe:0,entryPrice:0,markPrice:0,referral:"",pnl:0}),U="-unrealizedPnl",[L,z]=m.useState(U),[Q,ne]=m.useState([]),[J,X]=m.useState(!1);m.useEffect(()=>{if(e.length===0||J)return;const fe=e.reduce((Ne,he)=>parseFloat(he.perpEquity||0)>parseFloat(Ne.perpEquity||0)?he:Ne);fe.wallet_address&&l(fe.wallet_address)},[e,J]);const re=(fe,Ne,he)=>{const ge=fe==null?void 0:fe.filter(ye=>ye&&ye.walletAddress&&ye.asset).filter(ye=>{var ve,je;return he?(je=(ve=ye==null?void 0:ye.asset)==null?void 0:ve.toString())==null?void 0:je.toUpperCase().includes(he.toUpperCase()):!0});return ge==null?void 0:ge.sort((ye,ve)=>{const je=ye.wallet_name?ye.wallet_name.toUpperCase():"",Ie=ve.wallet_name?ve.wallet_name.toUpperCase():"",Le=ye.tag?ye.tag.toUpperCase():"",Qe=ve.tag?ve.tag.toUpperCase():"",$e=ye.asset?ye.asset.toUpperCase():"",it=ve.asset?ve.asset.toUpperCase():"",tt=ye.type==="Long"?1:0,lt=ve.type==="Long"?1:0,ft=ye.type==="Short"?1:0,ut=ve.type==="Short"?1:0;return Ne==="wallet_name"?je<Ie?-1:je>Ie?1:0:Ne==="-wallet_name"?je>Ie?-1:je<Ie?1:0:Ne==="-unrealizedPnl"?ve.unrealizedPnl-ye.unrealizedPnl:Ne==="unrealizedPnl"?ye.unrealizedPnl-ve.unrealizedPnl:Ne==="-roe"?ve.roe-ye.roe:Ne==="roe"?ye.roe-ve.roe:Ne==="-size"?ve.size-ye.size:Ne==="size"?ye.size-ve.size:Ne==="-entryPrice"?ve.entryPrice-ye.entryPrice:Ne==="entryPrice"?ye.entryPrice-ve.entryPrice:Ne==="-currentPrice"?ve.currentPrice-ye.currentPrice:Ne==="currentPrice"?ye.currentPrice-ve.currentPrice:Ne==="-leverage"?ve.leverage-ye.leverage:Ne==="leverage"?ye.leverage-ve.leverage:Ne==="-positionValue"?ve.positionValue-ye.positionValue:Ne==="positionValue"?ye.positionValue-ve.positionValue:Ne==="-marginUsed"?ve.marginUsed-ye.marginUsed:Ne==="marginUsed"?ye.marginUsed-ve.marginUsed:Ne==="funding"?ve.funding-ye.funding:Ne==="-funding"?ye.funding-ve.funding:Ne==="-liquidationPrice"?ve.liquidationPrice-ye.liquidationPrice:Ne==="liquidationPrice"?ye.liquidationPrice-ve.liquidationPrice:Ne==="-tag"?Le<Qe?-1:Le>Qe?1:0:Ne==="tag"?Le>Qe?-1:Le<Qe?1:0:Ne==="-coin"?$e<it?-1:$e>it?1:0:Ne==="coin"?$e>it?-1:$e<it?1:0:Ne==="-type_leverage"?tt!==lt?lt-tt:ve.leverage-ye.leverage:Ne==="type_leverage"?ft!==ut?ut-ft:ve.leverage-ye.leverage:0})},pe=async fe=>{if(fe===""&&Q.filter(Ne=>Ne!==void 0).length===0||fe===""&&re(Q,L,d).length===0||re(Q,L,d).length===0){rn.success("There are no open positions to close.",{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(255, 121, 124, 0.32)",width:"400px",minWidth:"400px",height:"40px",backdropFilter:"blur(48px)"},iconTheme:{primary:"#ff797c",secondary:"#7d3031"}});return}if(fe===""&&(e==null?void 0:e.length)>0){const Ne=re(Q,L,d),he=[...new Set(Ne.map(ge=>ge.wallet_id))];if(he.length===0){rn.success("There are no open positions to close.",{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(255, 121, 124, 0.32)",width:"400px",minWidth:"400px",height:"40px",backdropFilter:"blur(48px)"},iconTheme:{primary:"#ff797c",secondary:"#7d3031"}});return}try{if(u(!0),!window.localStorage.getItem("hyperToken")){r(!0),u(!1);return}await Promise.all(he.map(ye=>Y(ye,!1))),rn.success("All close order operations successful.",{style:{border:"1px solid #22c55e",padding:"16px",color:"#fff",borderRadius:"999px",background:"#14532d",width:"400px",minWidth:"400px",height:"60px"},iconTheme:{primary:"#22c55e",secondary:"#FFFAEE"}})}catch(ge){console.error("Error closing all orders:",ge)}finally{u(!1)}return}await Y(fe)},Y=async(fe,Ne=!0)=>{if(Q.filter(he=>he!==void 0).length===0){rn.success("There are no open positions to closes.",{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(255, 121, 124, 0.32)",width:"400px",minWidth:"400px",height:"40px",backdropFilter:"blur(48px)"},iconTheme:{primary:"#ff797c",secondary:"#7d3031"}});return}if(!fe){console.error("Close order called with invalid parameters"),rn.error("Close order called with invalid parameters");return}try{u(!0);const he=window.localStorage.getItem("hyperToken"),ge="https://dextrabothypev2.nftinit.io/api/hyper/order/close_order_all_new/";if(!he){r(!0),u(!1);return}const ye=window.localStorage.getItem("hyperAddress"),ve=await fetch(ge,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:n?n.toLowerCase():ye,token:he,wallet_id:fe.toString()})});if(!ve.ok)throw new Error(`Server responded with status ${ve.status}`);const je=await ve.json();je.status=="ok"?(u(!1),Ne&&rn.success("Close order operation successful.",{style:{border:"1px solid #22c55e",padding:"16px",color:"#fff",borderRadius:"999px",background:"#14532d",height:"60px",width:"400px",minWidth:"400px"},iconTheme:{primary:"#22c55e",secondary:"#FFFAEE"}})):je.success?(u(!1),Ne&&rn.success("There are no open positions to close.",{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(255, 121, 124, 0.32)",width:"400px",minWidth:"400px",height:"40px",backdropFilter:"blur(48px)"},iconTheme:{primary:"#ff797c",secondary:"#7d3031"}})):(console.log("Close order operation failed."),rn.error("Close order operation failed."),u(!1))}catch(he){throw console.error("Something went wrong!"),rn.error("Something went wrong!"),u(!1),he}},[ie,oe]=m.useState(!1);m.useEffect(()=>{const fe=()=>{(localStorage.getItem("walletManagementInfo")!==void 0||localStorage.getItem("walletManagementInfo")!==null)&&Date.now()-Number(localStorage.getItem("walletManagementInfo"))>=864e5&&oe(!0)};fe();const Ne=setInterval(()=>{fe()},1e3*60*30);return()=>{clearInterval(Ne)}},[]);const G=async fe=>{try{const Ne=window.localStorage.getItem("hyperToken"),he="https://dextrabothypev2.nftinit.io/api/hyper/following/position_info/";if(!Ne){r(!0);return}const ge=fe==null?void 0:fe.filter(Ie=>Ie&&Ie.walletAddress&&Ie.asset).map(Ie=>({wallet:Ie.walletAddress,coin:Ie.asset})),ye=window.localStorage.getItem("hyperAddress"),je=await(await fetch(he,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:n?n.toLowerCase():ye,token:Ne,positions:ge})})).json();je.success?ne(Ie=>Ie.map(Le=>{const Qe=je==null?void 0:je.data.find($e=>($e==null?void 0:$e.wallet)===(Le==null?void 0:Le.walletAddress)&&($e==null?void 0:$e.coin)===(Le==null?void 0:Le.asset));return{...Le,tag:Qe==null?void 0:Qe.tag,tagWallet:Qe==null?void 0:Qe.cp_wallet}})):(console.log(je.error_message),rn.error(je.error_message))}catch(Ne){console.error("Error tag request",Ne),rn.error(Ne.message)}},V=m.useRef(Q==null?void 0:Q.filter(fe=>(fe==null?void 0:fe.walletAddress)&&(fe==null?void 0:fe.asset)).length),ee=m.useRef(),ae=m.useRef(!0);return m.useEffect(()=>{const fe=Q==null?void 0:Q.filter(he=>he!==void 0&&(he==null?void 0:he.walletAddress)&&(he==null?void 0:he.asset)),Ne=fe==null?void 0:fe.length;if(Ne>0&&Ne>V.current){const he=o===""?Q:Q.filter(ge=>(ge==null?void 0:ge.wallet_id)==o);ae.current?(G(he),ae.current=!1):(ee.current&&clearTimeout(ee.current),ee.current=setTimeout(()=>{G(he)},5e3))}V.current=Ne},[Q]),m.useEffect(()=>{if((Q==null?void 0:Q.filter(fe=>fe!==void 0&&(fe==null?void 0:fe.walletAddress)&&(fe==null?void 0:fe.asset)).length)>0){const fe=o==""?Q:Q==null?void 0:Q.filter(Ne=>(Ne==null?void 0:Ne.wallet_id)==o);(fe==null?void 0:fe.length)>0&&G(fe)}},[o]),m.useEffect(()=>{function fe(Ne){v.current&&!v.current.contains(Ne.target)&&setIsDropdownOpen(!1),w.current&&!w.current.contains(Ne.target)&&g(!1)}return document.addEventListener("mousedown",fe),()=>document.removeEventListener("mousedown",fe)},[]),i.jsx(i.Fragment,{children:i.jsxs(i.Fragment,{children:[i.jsx(JUe,{open:C,setOpen:N,data:R,setShare:I,setTradeInfo:F}),i.jsxs("div",{className:"flex flex-col items-stretch justify-start gap-[17px] text-white bg-[#161616] w-full h-full min-h-[500px] max-h-max font-manrope relative sm:pt-10",children:[i.jsxs("div",{className:"flex items-center justify-start gap-4",children:[i.jsx("div",{className:"text-white text-lg font-medium font-manrope leading-[21px] w-full",children:"Manage Positions"}),i.jsx("div",{className:"flex sm:hidden items-center justify-end w-full gap-1 min-w-max",children:i.jsx("div",{className:"flex items-center justify-end group",children:i.jsxs("div",{onClick:fe=>{fe.preventDefault(),c||pe(o)},className:"h-[26px] pl-1 pr-2 py-1.5 bg-[#67ffbd]/20 hover:bg-[#67ffbd]/30 rounded-md inline-flex justify-start items-center gap-2 cursor-pointer",children:[i.jsx("div",{className:"",children:i.jsx("img",{src:nae,alt:"",className:"w-4 h-4"})}),c?i.jsxs("div",{role:"status",className:"flex justify-center items-center h-5 min-h-5 w-[66px] px-2 py-1.5 rounded-md",children:[i.jsxs("svg",{"aria-hidden":"true",className:"inline w-4 h-4 text-gray-200 animate-spin dark:text-gray-600 fill-[#67FFBD]",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),i.jsx("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]}),i.jsx("span",{className:"sr-only",children:"Loading..."})]}):i.jsx("div",{className:"justify-start text-[#67ffbd] text-[11px] font-semibold font-manrope leading-[8px] tracking-tight",children:"Fast Close All"})]})})})]}),i.jsxs("div",{className:"relative w-full h-full",children:[i.jsxs("div",{className:"flex justify-start items-center gap-2",children:[i.jsxs("div",{className:"flex justify-start items-center gap-2",children:[i.jsx("span",{className:"font-bold min-w-[200px] lg:min-w-max text-xs sm:text-[14px]",children:"Select wallet to see your current positions:"}),i.jsxs("select",{className:"rounded-md py-0.5 bg-[#303030] text-white text-md outline-none w-full h-8 min-w-[150px] px-2",onChange:fe=>{l(fe.target.value),X(!0)},value:o,children:[i.jsx("option",{value:"",children:"All"}),e==null?void 0:e.map(fe=>i.jsx("option",{value:fe==null?void 0:fe.wallet_address,children:`${fe==null?void 0:fe.wallet_name} - (${(fe==null?void 0:fe.wallet_address).slice(0,5)+"..."+(fe==null?void 0:fe.wallet_address).slice(-4)})`},fe==null?void 0:fe.wallet_id))]})]}),ie&&i.jsxs("div",{className:"hidden sm:flex justify-center items-center ml-10 h-16 pl-3 py-4 pr-5 bg-[#ff9800]/20 rounded-lg gap-3 w-max min-w-max relative",children:[i.jsx("div",{onClick:fe=>{fe.stopPropagation(),localStorage.setItem("walletManagementInfo",`${Date.now()}`),oe(!1)},className:"cursor-pointer flex w-full items-center justify-end absolute right-2 top-1",children:i.jsx("span",{className:"absolute -top-0.5 -right-1.5 w-7 h-7 rounded-full p-0.5 flex justify-center items-center hover:bg-[#7535FE]",children:i.jsx("img",{className:"p-1",src:Ba})})}),i.jsx("img",{src:Jbt,alt:""}),i.jsx("div",{className:"font-semibold flex justify-start items-center text-white text-md outline-none max-w-[600px]",children:"Make sure you are performing all the actions on Dextrabot for the Copy Trade account. Don't close or open positions manually on Hyperliquid."})]})]}),i.jsx("div",{className:"w-full h-max max-w-[100%] min-h-[60vh] sm:min-h-[36vh] overflow-scroll relative flex-grow",children:i.jsx(XUe,{initialAddress:o,wallets:o===""?e:void 0})})]})]})]})})},xan=({data:e,loading:t,error:n,socketLoading:r,currentPage:s,handlePageChange:a,allWallets:o,handleListRequest:l,isSelectMenu:c,setIsSelectMenu:u,hyperWallet:d,lighterWallet:f,extendedWallet:x})=>{var Ft;const[g,v]=m.useState(!1),{setSignModalOpen:w}=m.useContext(Qr),{isConnected:C,address:N}=ns(),P=5,[I,R]=m.useState(null),[F,U]=m.useState(null),[L,z]=m.useState(!1),[Q,ne]=m.useState(null),[J,X]=m.useState(!1),[re,pe]=m.useState("");m.useState({});const[Y,ie]=m.useState({}),[oe,G]=m.useState(!1),[V,ee]=m.useState({wallet:"",walletId:"",walletName:"",unrealizedPnL:"",perpEquity:""}),[ae,fe]=m.useState(!1),[Ne,he]=m.useState(!1),ge="-perpEquity",[ye,ve]=m.useState(ge),je=Ke=>e.sort((Bt,$t)=>{if(Bt.version===3&&$t.version!==3)return-1;if($t.version===3&&Bt.version!==3)return 1;const qe=Bt.wallet_name?Bt.wallet_name.toUpperCase():"",Ye=$t.wallet_name?$t.wallet_name.toUpperCase():"",ht=Bt.wallet_address?Bt.wallet_address.toLowerCase():"",Zt=$t.wallet_address?$t.wallet_address.toLowerCase():"";return Ke==="wallet_name"?qe<Ye?-1:qe>Ye?1:0:Ke==="-wallet_name"?qe>Ye?-1:qe<Ye?1:0:Ke==="-wallet_address"?ht<Zt?-1:ht>Zt?1:0:Ke==="wallet_address"?ht>Zt?-1:ht<Zt?1:0:Ke==="-wallet_created_data"?new Date($t.wallet_created_data)-new Date(Bt.wallet_created_data):Ke==="wallet_created_data"?new Date(Bt.wallet_created_data)-new Date($t.wallet_created_data):Ke==="-perpEquity"?$t.perpEquity-Bt.perpEquity:Ke==="perpEquity"?Bt.perpEquity-$t.perpEquity:Ke==="-unrealizedPnl"?$t.unrealizedPnl-Bt.unrealizedPnl:Ke==="unrealizedPnl"?Bt.unrealizedPnl-$t.unrealizedPnl:Ke==="-marginUsed"?$t.marginUsed-Bt.marginUsed:Ke==="marginUsed"?Bt.marginUsed-$t.marginUsed:Ke==="-withdrawableUsdc"?$t.withdrawableUsdc-Bt.withdrawableUsdc:Ke==="withdrawableUsdc"?Bt.withdrawableUsdc-$t.withdrawableUsdc:0}),Ie=async(Ke,Bt,$t)=>{if(!Ke||!Bt||!$t){console.error("Delete order called with invalid parameters"),rn.error("Delete order called with invalid parameters");return}const qe=`${Ke}_${Bt}`;try{ie(nt=>({...nt,[qe]:!0}));const Ye=window.localStorage.getItem("hyperToken"),ht="https://dextrabothypev2.nftinit.io/api/wallet/delete-lighter";if(!Ye){w(!0),ie(nt=>({...nt,[qe]:!1}));return}const Zt=window.localStorage.getItem("hyperAddress"),zt=await fetch(ht,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:N?N.toLowerCase():Zt,token:Ye,wallet_id:Ke})});if(!zt.ok)throw new zl(`Server responded with status ${zt.status}`);const Et=await zt.json();Et.success?(l(),ee({wallet:"",walletId:"",walletName:"",unrealizedPnL:"",perpEquity:""}),fe(!1),he(!1),G(!1),ie(nt=>({...nt,[qe]:!1})),rn.success(i.jsxs(i.Fragment,{children:[i.jsx("span",{children:$t.slice(0,5)+"..."+$t.slice(-3)}),i.jsxs("span",{style:{color:"#ff797c",paddingLeft:"5px"},children:[" ","removed from generated wallets"]})]}),{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(255, 121, 124, 0.32)",width:"440px",minWidth:"440px",height:"40px",backdropFilter:"blur(48px)"},iconTheme:{primary:"#ff797c",secondary:"#7d3031"}})):(console.log(Et.error_message),rn.error(Et.error_message),ie(nt=>({...nt,[qe]:!1})))}catch(Ye){console.error("Error deleting wallet:",Ye),rn.error(Ye.message),ie(ht=>({...ht,[qe]:!1}))}},Le=m.useRef(null),Qe=()=>{Le.current&&(Le.current.scrollLeft-=100)},$e=()=>{Le.current&&(Le.current.scrollLeft+=100)},it=()=>{Le.current&&(Le.current.scrollTop+=200)},tt=()=>{Le.current&&(Le.current.scrollTop-=200)},lt=Ke=>Ke>=640&&Ke<1024?4:Ke>=1024&&Ke<1240?7:Ke>=1240&&Ke<1540||Ke>=1540?8:3,[ft,ut]=m.useState(null),[qt,It]=m.useState(!1),[nn,jt]=m.useState(!1);m.useEffect(()=>{const Ke=()=>{jt(window.innerWidth<640)};return window.addEventListener("resize",Ke),Ke(),()=>window.removeEventListener("resize",Ke)},[]);const cn=Ke=>{nn&&(ut(Ke),It(!0))};m.useEffect(()=>{const Ke=window.location.hash;if(!Ke)return;const Bt=Ke.split("#").filter(Boolean);Bt.includes("add-account")&&(v(!0),Bt[0]==="hyperliquid"&&(u("HYPER"),localStorage.setItem("isWalletSelectMenu","HYPER")),Bt[0]==="lighter"&&(u("LIGHTER"),localStorage.setItem("isWalletSelectMenu","LIGHTER")),Bt[0]==="extended"&&(u("EXTENDED"),localStorage.setItem("isWalletSelectMenu","EXTENDED")))},[]);const un=Ke=>{v(!1),Ke==="HYPER"?(window.history.replaceState(null,"",`${window.location.pathname}#hyperliquid`),u("HYPER"),localStorage.setItem("isWalletSelectMenu","HYPER")):Ke==="LIGHTER"?(window.history.replaceState(null,"",`${window.location.pathname}#lighter`),u("LIGHTER"),localStorage.setItem("isWalletSelectMenu","LIGHTER")):Ke==="EXTENDED"&&(window.history.replaceState(null,"",`${window.location.pathname}#extended`),u("EXTENDED"),localStorage.setItem("isWalletSelectMenu","EXTENDED"))};return i.jsxs(i.Fragment,{children:[i.jsx(Bce,{open:L,setOpen:z,data:e,walletData:I,withdrawableUsdc:Q,setWithdrawableUsdc:ne,modalWalletId:F,setModalWalletId:U}),i.jsx(Uce,{open:J,setOpen:X,walletAddress:re}),i.jsx(zce,{open:oe,setOpen:G,handleDeleteWallet:Ie,deleteWalleInfo:V,confirmClosePositions:ae,setConfirmClosePositions:fe,confirmWithdrawEquity:Ne,setConfirmWithdrawEquity:he}),i.jsx(up,{isOpen:qt,onClose:()=>It(!1),children:i.jsx(Hce,{rowData:ft})}),i.jsxs("div",{className:"flex flex-col items-stretch justify-start gap-[17px] text-white bg-[#161616] w-full h-full sm:min-h-[340px] max-h-max font-manrope relative",children:[i.jsxs("div",{className:"flex justify-start items-center gap-10 pl-2 sm:pl-0 pt-4",children:[i.jsxs("div",{className:"hidden sm:flex flex-col items-start justify-start gap-2 font-manrope min-w-max bg-[#161616] ",children:[i.jsx("div",{className:"text-[#7e7e7e] text-[11px] font-medium font-inter leading-[8px]",children:"Hype / Explore"}),i.jsx("div",{className:"flex items-center justify-start gap-4",children:i.jsx("div",{className:"text-white text-lg font-medium font-manrope leading-[21px]",children:"Wallet Management"})})]}),i.jsxs("div",{className:"flex flex-col items-start lg:flex-row lg:justify-start lg:items-center gap-1 lg:gap-10",children:[i.jsx($ce,{handleListRequest:l,handlePageChange:a,isGenWalletModal:g,setIsGenWalletModal:v}),i.jsxs("div",{className:"flex justify-start items-center gap-1.5 w-max h-max rounded-lg border border-[#333333] p-1",children:[i.jsx(YY,{title:"HYPER",label:"HYPERLIQUID",walletLength:d,handleSelectMenuChange:un,isSelectMenu:c}),i.jsx(YY,{title:"LIGHTER",label:"LIGHTER",walletLength:f,handleSelectMenuChange:un,isSelectMenu:c}),i.jsx(YY,{title:"EXTENDED",label:"EXTENDED",walletLength:x,handleSelectMenuChange:un,isSelectMenu:c})]})]})]}),i.jsxs("div",{className:"relative w-full h-full",children:[i.jsxs("div",{className:"absolute -top-5 right-4 z-10 hidden justify-start items-center gap-2",children:[i.jsx("button",{onClick:Qe,className:"bg-[#353535] hover:bg-gray-600 text-white p-1 rounded-lg focus:outline-none focus:ring-0 border-none",children:i.jsx("span",{className:"w-6 h-6",children:i.jsx(Xa,{className:"text-gray-300 w-4 h-4 rotate-90"})})}),i.jsx("button",{onClick:$e,className:"bg-[#353535] hover:bg-gray-600 text-white p-1 rounded-lg focus:outline-none focus:ring-0 border-none",children:i.jsx("span",{className:"w-6 h-6",children:i.jsx(Xa,{className:"text-gray-300 w-4 h-4 -rotate-90"})})}),i.jsx("button",{onClick:tt,className:"bg-[#353535] hover:bg-gray-600 text-white p-1 rounded-lg focus:outline-none focus:ring-0 border-none",children:i.jsx("span",{className:"w-6 h-6",children:i.jsx(Xa,{className:"text-gray-300 w-4 h-4 -rotate-180"})})}),i.jsx("button",{onClick:it,className:"bg-[#353535] hover:bg-gray-600 text-white p-1 rounded-lg focus:outline-none focus:ring-0 border-none",children:i.jsx("span",{className:"w-6 h-6",children:i.jsx(Xa,{className:"text-gray-300 w-4 h-4 "})})})]}),i.jsx("div",{className:"w-full h-auto sm:h-max max-w-[100%] overflow-scroll relative flex-grow",ref:Le,children:i.jsxs("table",{className:"w-full relative",children:[i.jsx("thead",{className:"sticky top-0 z-[3] bg-[#161616] whitespace-nowrap",children:i.jsxs("tr",{className:"w-full z-[4] text-[#9b9b9b] text-[13px] font-semibold font-manrope leading-[13px] tracking-tight",children:[i.jsx("th",{scope:"col",className:"font-medium sm:sticky bg-[#161616] sm:left-0 h-8 pl-3 min-w-[120px] sm:min-w-[140px] z-[8]",children:i.jsx(hi,{title:"Name",sortKey:"wallet_name",sortOption:ye,setSortOption:ve,isFilterIcon:!1})}),i.jsx("th",{scope:"col",className:"sm:sticky bg-[#161616] sm:left-[140px] h-10 px-1 min-w-[160px] sm:min-w-[190px] z-[8]",children:i.jsx(hi,{title:"Follower Wallet",sortKey:"wallet_address",sortOption:ye,setSortOption:ve,isFilterIcon:!1})}),i.jsx("th",{scope:"col",className:"min-w-[110px] sm:min-w-[110px] px-1 hidden sm:table-cell",children:i.jsx(hi,{title:"Creation Date",sortKey:"wallet_created_data",sortOption:ye,setSortOption:ve,isFilterIcon:!1})}),i.jsx("th",{scope:"col",className:"min-w-[330px] sm:min-w-[330px] pl-1 pr-4 hidden sm:table-cell",children:i.jsx("div",{className:"font-medium flex items-center justify-start w-full min-w-max",children:i.jsx("div",{className:"flex items-center justify-end w-full"})})})]})}),i.jsx("tbody",{children:!e||t?i.jsx("tr",{className:"text-center w-full h-full",children:i.jsx("td",{colSpan:lt(window.innerWidth),children:i.jsx("div",{className:"fixed top-1/3 left-1/2 transform -translate-x-1/2 -translate-y-1/2 z-10 min-h-[30vh] flex flex-col justify-center items-center",children:i.jsx(Da,{})})})}):n&&!e?i.jsx("tr",{className:"text-center w-full h-full",children:i.jsx("td",{colSpan:lt(window.innerWidth),children:i.jsx("div",{className:"flex min-h-[30vh] flex-col justify-center items-center top-[7%] lg:top-[10%] left-[20%] sm:left-[40%] lg:left-[50%] 2xl:left-[45%] z-10",children:i.jsx(zl,{})})})}):(e==null?void 0:e.length)==0?i.jsx("tr",{className:"text-center w-full h-full",children:i.jsx("td",{colSpan:lt(window.innerWidth),children:i.jsx("div",{className:"flex min-h-[30vh] flex-col justify-center items-center top-[7%] lg:top-[15%] left-[20%] sm:left-[40%] lg:left-[50%] 2xl:left-[45%] z-10",children:i.jsx("div",{className:"flex items-center justify-center gap-4 px-4 py-2 flex-col",children:i.jsxs("div",{className:"flex flex-col justify-center items-center gap-3 ml-1 sm:-ml-16",children:[i.jsx("img",{src:ac,alt:""}),i.jsxs("div",{className:"flex flex-col items-center h-max gap-3",children:[i.jsx("div",{className:"text-[#d3d3d3] text-sm font-semibold font-manrope leading-[8px] pt-3",children:"You have not created a wallet yet."}),i.jsxs("div",{className:"text-center -mt-2",children:[i.jsxs("span",{className:"text-[#979797] text-[13px] font-normal font-manrope leading-[14px] tracking-wide",children:["Please use the"," "]}),i.jsx("span",{className:"text-white text-[13px] font-normal font-manrope leading-[14px] tracking-wide",children:"'Add Account'"}),i.jsxs("span",{className:"text-[#979797] text-[13px] font-normal font-manrope leading-[14px] tracking-wide",children:[" ","button to create a wallet."]})]})]})]})})})})}):(Ft=je(ye))==null?void 0:Ft.map((Ke,Bt)=>{!isNaN(Ke==null?void 0:Ke.perpEquity)&&!isNaN(Ke==null?void 0:Ke.marginUsed)&&(Ke==null?void 0:Ke.perpEquity)-(Ke==null?void 0:Ke.marginUsed);const $t=nn?{onClick:()=>cn(Ke),className:"cursor-pointer"}:{};return i.jsxs("tr",{...$t,className:`${Bt%2===0,"bg-[#161616]"} relative group hover:bg-[#222222] h-[44px] border-b border-[#232323] text-white`,children:[i.jsx("td",{scope:"row",className:`${Bt%2==0,"bg-[#161616]"} sm:sticky sm:left-0 z-[2] group-hover:bg-[#222222]`,children:i.jsx("div",{className:"group-hover:bg-[#222222] flex justify-start items-center gap-2 pl-2 h-[44px] max-h-[44px] ",children:(Ke==null?void 0:Ke.version)==3?i.jsx(mi,{content:"This is an API wallet created from your login wallet. It enables copy trading without withdrawal permissions, keeping your funds safe.",children:i.jsxs("div",{className:"flex justify-start items-center has-tooltip relative",children:[i.jsx("div",{className:"text-sm font-semibold font-manrope leading-none flex items-center justify-start pl-1 gap-0.5 min-w-max",children:(Ke==null?void 0:Ke.wallet_name.length)>=12?(Ke==null?void 0:Ke.wallet_name).slice(0,12)+"... (API-AGENT) Wallet":(Ke==null?void 0:Ke.wallet_name)+"(API-AGENT) Wallet"}),(Ke==null?void 0:Ke.wallet_name.length)>=12&&i.jsx("span",{className:"ml-3",children:i.jsx(Fa,{content:`${Ke==null?void 0:Ke.wallet_name}`,positionTop:!0,alignRight:!1})}),i.jsx(Ni,{className:"text-[#7C7C7C] w-4 min-w-4 min-h-4 h-4 ml-1"})]})}):i.jsxs("div",{className:"flex justify-start items-center has-tooltip relative",children:[i.jsx("div",{className:"text-sm font-semibold font-manrope leading-none flex items-center justify-start pl-1 gap-0.5",children:(Ke==null?void 0:Ke.wallet_name.length)>=12?(Ke==null?void 0:Ke.wallet_name).slice(0,12)+"...":Ke==null?void 0:Ke.wallet_name}),(Ke==null?void 0:Ke.wallet_name.length)>=12&&i.jsx("span",{className:"ml-3",children:i.jsx(Fa,{content:`${Ke==null?void 0:Ke.wallet_name}`,positionTop:!0,alignRight:!1})})]})})}),i.jsx("td",{scope:"row",className:`${Bt%2===0,"bg-[#161616]"} sm:sticky sm:left-[140px] z-[2] group-hover:bg-[#222222]`,children:i.jsx("div",{className:"group-hover:bg-[#222222] flex justify-start items-center gap-4 min-h-[44px] max-h-[44px]",children:i.jsxs("div",{onClick:()=>{window.open(`/wallet-details/${Ke==null?void 0:Ke.wallet_address}`,"_blank")},className:"group-hover:bg-[#222222] flex justify-start items-center gap-2 h-[44px] max-h-[44px] cursor-pointer",children:[i.jsx("div",{className:"fle justify-center items-center",children:i.jsx("div",{className:"w-4 h-4 sm:w-6 sm:h-6 bg-[#4a4a4a] rounded-full",children:i.jsx("img",{src:Gi,alt:"",className:"w-4 h-4 sm:w-6 sm:h-6"})})}),i.jsxs("div",{className:"flex justify-start items-center gap-1.5",children:[i.jsx(aa,{info1:`${(Ke==null?void 0:Ke.wallet_address).slice(0,5)+"..."+(Ke==null?void 0:Ke.wallet_address).slice(-4)}`,info1_Color:"text-white",rowTwo:!1}),i.jsx("img",{onClick:qe=>{qe.stopPropagation(),navigator.clipboard.writeText(Ke==null?void 0:Ke.wallet_address),rn.success("Successfully copied.",{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(103, 255, 189, 0.16)",width:"280px",minWidth:"280px",height:"40px",backdropFilter:"blur(16px)"},iconTheme:{primary:"#67FFBD",secondary:"#276047"}})},src:wo,alt:"",className:"cursor-pointer"})]})]})})}),i.jsx("td",{className:"hidden sm:table-cell",children:i.jsx("div",{className:"flex flex-col items-start gap-0.5",children:i.jsx("div",{className:"text-sm font-semibold font-manrope leading-none flex items-center justify-start pl-1 gap-0.5",children:(Ke==null?void 0:Ke.wallet_created_data)&&p3(Ke==null?void 0:Ke.wallet_created_data)})})}),i.jsx("td",{className:"hidden sm:table-cell",children:i.jsxs("div",{className:"flex items-center justify-end gap-2 pr-3",children:[i.jsx(mi,{content:"Deposits are currently unavailable.",children:i.jsxs("div",{className:"w-[91px] h-[26px] px-2 py-1.5 rounded-md border border-[#353535] justify-center items-center gap-2 hidden sm:inline-flex opacity-80",children:[i.jsx(xy,{className:"text-[#848484] w-[14px] h-[14px] rotate-180"}),i.jsx("div",{className:"text-white text-[11px] font-semibold font-manrope leading-[8px] tracking-tight opacity-60",children:"Deposit"})]})}),i.jsx(mi,{content:"Withdrawals are currently unavailable.",children:i.jsxs("div",{className:"w-[91px] h-[26px] px-2 py-1.5 rounded-md border border-[#353535] justify-center items-center gap-2 hidden sm:inline-flex opacity-80",children:[i.jsx(xy,{className:"text-[#848484] w-[14px] h-[14px]"}),i.jsx("div",{className:"text-white text-[11px] font-semibold font-manrope leading-[8px] tracking-tight opacity-60",children:"Withdraw"})]})}),Y[`${Ke==null?void 0:Ke.wallet_id}_${Ke==null?void 0:Ke.wallet_name.toLowerCase()}`]?i.jsxs("div",{role:"status",className:"flex justify-center items-center h-5 min-h-5 w-[90px] px-2 py-1.5 rounded-md",children:[i.jsxs("svg",{"aria-hidden":"true",className:"inline w-4 h-4 text-gray-200 animate-spin dark:text-gray-600 fill-[#67FFBD]",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),i.jsx("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]}),i.jsx("span",{className:"sr-only",children:"Loading..."})]}):(Ke==null?void 0:Ke.version)===3?i.jsx(mi,{content:"API wallets cannot be deleted here. To remove this wallet, please delete it from the Hyperliquid API page.",children:i.jsx("div",{className:"w-[91px] h-[26px] px-2 py-1.5 rounded-md border border-[#353535] justify-center items-center gap-2 hidden sm:inline-flex opacity-80",children:i.jsx("div",{className:"text-white text-[11px] font-semibold font-manrope leading-[8px] tracking-tight opacity-60",children:"Delete"})})}):i.jsx("div",{onClick:()=>{ee({wallet:Ke==null?void 0:Ke.wallet_address,walletId:Ke==null?void 0:Ke.wallet_id,walletName:Ke==null?void 0:Ke.wallet_name.toLowerCase(),unrealizedPnL:Ke==null?void 0:Ke.unrealizedPnl,perpEquity:Ke==null?void 0:Ke.perpEquity}),G(!0)},className:"w-[91px] h-[26px] px-2 py-1.5 rounded-md border border-[#353535] justify-center items-center gap-2 hidden sm:inline-flex cursor-pointer",children:i.jsx("div",{className:"text-white text-[11px] font-semibold font-manrope leading-[8px] tracking-tight",children:"Delete"})})]})})]},Bt)})})]})})]}),i.jsxs("div",{className:`flex justify-start items-center gap-2 absolute top-[10px] sm:top-6 right-1 sm:translate-x-0 sm:right-2
`,children:[i.jsx("button",{onClick:()=>a(s-1),disabled:s===1,className:`${s===1?"cursor-not-allowed":"cursor-pointer"} h-8 px-2 sm:px-4 py-3 rounded-xl shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-white justify-center items-center gap-2.5 inline-flex bg-transparent`,children:i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px]",children:"Previous"})}),i.jsxs("div",{className:"text-white text-[14px] font-medium font-inter leading-[8px] w-20 sm:w-auto text-center",children:["Page ",s," / ",Math.ceil(o.length/P)]}),i.jsx("button",{onClick:()=>a(s+1),disabled:s*P>=o.length,className:`${s*P>=o.length?"cursor-not-allowed":"cursor-pointer"} h-8 px-2 sm:px-4 py-3 rounded-xl shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-white justify-center items-center gap-2.5 inline-flex bg-transparent`,children:i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px]",children:"Next"})})]})]})]})},YY=({title:e,label:t,handleSelectMenuChange:n,isSelectMenu:r,walletLength:s})=>i.jsxs("div",{onClick:()=>n(e),className:`${r==e?"bg-[#67ffbd]/20 text-[#67FFBD]":"bg-transparent text-[#9b9b9b]"} ${e==="HYPER"?"gap-1":e==="LIGHTER"?"gap-0.5":"gap-1"} text-[13px] font-medium font-manrope leading-[8px] cursor-pointer flex justify-center items-center min-w-max rounded-md px-[6px] sm:px-[10px] h-[22px]`,children:[e==="HYPER"?i.jsx("img",{src:dx,alt:"hyper",className:"w-4 h-4 rounded-sm"}):e==="LIGHTER"?i.jsx(Xf,{className:"w-4 h-4 text-[#fff]"}):e==="EXTENDED"?i.jsx("img",{src:"https://app.extended.exchange/assets/logo/extended.svg",alt:"Extended",className:"h-[20px] text-white -ml-0.5"}):null,`${t} (${(s==null?void 0:s.length)>0?"⚡"+(s==null?void 0:s.length)+" wallet":"🔌 Not Connected"}) `]}),gan=({initialAddress:e="",wallets:t,positions:n,setPositions:r,isWalletIndex:s,posLoading:a,setPosLoading:o,setGenerateWalletData:l})=>{var qe;const{getTrackedWatchList:c,hyperToken:u,copyTradeWatchList:d,getCopyTradeWatchList:f,setTelegramChatId:x,setSubscriberRole:g,setSubsExpireDay:v,setMushboomerETH:w,setMushboomerSOL:C,setIsReferralCode:N,isReferralCodeName:P,setIsReferralCodeName:I,setIsWhitelist:R,setHyperToken:F,setHyperAddress:U,setSignModalOpen:L,latestPnL:z}=m.useContext(Qr),{address:Q}=ns(),[ne,J]=m.useState(!1);m.useState({}),m.useState(!1),m.useEffect(()=>{if(!(s!=null&&s.index))return;const Ye=new WebSocket("wss://mainnet.zklighter.elliot.ai/stream");let ht;Ye.onopen=()=>{console.log("Lighter WebSocket connected"),Ye.send(JSON.stringify({type:"subscribe",channel:`account_all/${s.index}`})),ht=setInterval(()=>{Ye.readyState===WebSocket.OPEN&&Ye.send(JSON.stringify({type:"subscribe",channel:`account_all/${s.index}`}))},5e3)},Ye.onmessage=zt=>{const Et=JSON.parse(zt==null?void 0:zt.data);if(Et!=null&&Et.positions&&Object.keys(Et.positions).length>0){const nt=Object.values(Et.positions).filter(at=>Number(at.position)!==0).map(at=>({funding:0,leverage:at.initial_margin_fraction?Math.round(100/Number(at.initial_margin_fraction)):0,positionValue:Number(at.position_value??0),unrealizedPnl:Number(at.unrealized_pnl??0),currentPrice:at.avg_entry_price&&at.unrealized_pnl&&at.position&&at.sign?Number(at.avg_entry_price)+Number(at.unrealized_pnl)/(Number(at.position)*Number(at.sign)):Number(at.position_value)/Math.abs(Number(at.position)),entryPrice:Number(at.avg_entry_price??0),size:Number(at.position??0),type:Number(at.sign)>0?"Long":"Short",asset:at.symbol??"",sign:Number(at.sign??1)})),Ue=nt.reduce((at,mt)=>at+mt.unrealizedPnl,0),Rt=nt.reduce((at,mt)=>{const Dt=mt.leverage>0?mt.leverage:1,Tt=mt.positionValue/Dt;return at+(isFinite(Tt)?Tt:0)},0),We=Number(Et.available_balance??0);l(at=>at==null?void 0:at.map(mt=>{var Dt;return((Dt=mt.wallet_address)==null?void 0:Dt.toLowerCase())===(e==null?void 0:e.toLowerCase())?{...mt,unrealizedPnl:Ue.toFixed(6),withdrawableUsdc:We.toFixed(6),marginUsed:Rt.toFixed(6),positions:nt}:mt})),r(nt),(he==null?void 0:he.length)>0&&o(!1)}else r([]),a&&o(!1)},Ye.onclose=zt=>{console.log("🔌 ZkLighter WebSocket disconnected",zt.code,zt.reason),clearInterval(ht)},Ye.onerror=zt=>{console.error("❌ ZkLighter WS error:",zt),clearInterval(ht)};const Zt=()=>{Ye.readyState===WebSocket.OPEN&&Ye.send(JSON.stringify({type:"unsubscribe",channel:`account_all/${s.index}`})),clearInterval(ht),Ye.close()};return window.addEventListener("beforeunload",Zt),()=>{Zt(),window.removeEventListener("beforeunload",Zt)}},[s]);const X=m.useRef(null),re=()=>{X.current&&(X.current.scrollLeft-=200)},pe=()=>{X.current&&(X.current.scrollLeft+=200)},Y=()=>{X.current&&(X.current.scrollTop+=200)},ie=()=>{X.current&&(X.current.scrollTop-=200)};m.useEffect(()=>{(async()=>{var zt,Et;const ht=window.localStorage.getItem("hyperToken"),Zt=window.localStorage.getItem("hyperAddress");if(!(!ht||!Zt))try{const nt=await Ei(Zt.toLowerCase(),ht);nt!=null&&nt.success?(x(nt==null?void 0:nt.telegram_chat_id),g(nt==null?void 0:nt.subscriber_role),v(nt==null?void 0:nt.subs_expire_day),w((zt=nt==null?void 0:nt.mushboomer_counts)==null?void 0:zt.eth),C((Et=nt==null?void 0:nt.mushboomer_counts)==null?void 0:Et.sol),N(nt==null?void 0:nt.referral_code),I(nt==null?void 0:nt.refcode),R(nt==null?void 0:nt.whitelist)):(window.localStorage.removeItem("hyperToken"),window.localStorage.removeItem("hyperAddress"),F(""),U(""))}catch(nt){console.error("Token verification error:",nt),console.error(nt.message||"An unknown error occurred.")}})()},[]);const[oe,G]=m.useState(""),[V,ee]=m.useState(!1),ae=m.useRef(null);m.useEffect(()=>{function Ye(ht){ae.current&&!ae.current.contains(ht.target)&&ee(!1)}return document.addEventListener("mousedown",Ye),()=>document.removeEventListener("mousedown",Ye)},[]);const[fe,Ne]=m.useState([]),he=n==null?void 0:n.filter(Ye=>{var ht;return oe?(ht=Ye.asset)==null?void 0:ht.toLowerCase().includes(oe.toLowerCase()):!0}).map(Ye=>{const ht=fe.find(Zt=>Zt.coin===Ye.asset&&(Zt.wallet||"").toLowerCase()===(Ye.wallet||"").toLowerCase());return{...Ye,tagName:(ht==null?void 0:ht.tag)||null,tagWallet:(ht==null?void 0:ht.cp_wallet)||null}}),ge="-unrealizedPnl",[ye,ve]=m.useState(ge),je=Ye=>{const nt=he==null?void 0:he.map(Ue=>{const Rt=Ue!=null&&Ue.positionValue&&(Ue!=null&&Ue.leverage)?Ue.unrealizedPnl*Ue.leverage*100/Ue.positionValue:0,We=.004+6e-4*Ue.leverage;let at=0;(Ue==null?void 0:Ue.type)==="Long"?at=Ue.entryPrice*(Ue.leverage/(Ue.leverage+1-Ue.leverage*We)):at=Ue.entryPrice*(Ue.leverage/(Ue.leverage-1+Ue.leverage*We));const mt=at*5.05,Dt=Ue.leverage?Ue.positionValue/Ue.leverage:0,Tt=Ue.positionValue*1e-4*(Ue.sign??-1);return{...Ue,roe:Rt,liquidationPrice:mt,marginUsed:Dt,funding:Tt}});return nt==null?void 0:nt.sort((Ue,Rt)=>{const We=Ue.tagName?Ue.tagName.toUpperCase():"",at=Rt.tagName?Rt.tagName.toUpperCase():"",mt=Ue.asset?Ue.asset.toUpperCase():"",Dt=Rt.asset?Rt.asset.toUpperCase():"",Tt=Ue.type==="Long"?1:0,dn=Rt.type==="Long"?1:0,on=Ue.type==="Short"?1:0,gn=Rt.type==="Short"?1:0;return Ye==="-unrealizedPnl"?Rt.unrealizedPnl-Ue.unrealizedPnl:Ye==="unrealizedPnl"?Ue.unrealizedPnl-Rt.unrealizedPnl:Ye==="-roe"?Rt.roe-Ue.roe:Ye==="roe"?Ue.roe-Rt.roe:Ye==="-size"?Rt.size-Ue.size:Ye==="size"?Ue.size-Rt.size:Ye==="-entryPrice"?Rt.entryPrice-Ue.entryPrice:Ye==="entryPrice"?Ue.entryPrice-Rt.entryPrice:Ye==="-currentPrice"?Rt.currentPrice-Ue.currentPrice:Ye==="currentPrice"?Ue.currentPrice-Rt.currentPrice:Ye==="-leverage"?Rt.leverage-Ue.leverage:Ye==="leverage"?Ue.leverage-Rt.leverage:Ye==="-positionValue"?Rt.positionValue-Ue.positionValue:Ye==="positionValue"?Ue.positionValue-Rt.positionValue:Ye==="-marginUsed"?Rt.marginUsed-Ue.marginUsed:Ye==="marginUsed"?Ue.marginUsed-Rt.marginUsed:Ye==="-funding"?Rt.funding-Ue.funding:Ye==="funding"?Ue.funding-Rt.funding:Ye==="-liquidationPrice"?Rt.liquidationPrice-Ue.liquidationPrice:Ye==="liquidationPrice"?Ue.liquidationPrice-Rt.liquidationPrice:Ye==="-entryTime"?new Date(Rt.latestFill)-new Date(Ue.latestFill):Ye==="entryTime"?new Date(Ue.latestFill)-new Date(Rt.latestFill):Ye==="-source_tag"?We<at?-1:We>at?1:0:Ye==="source_tag"?We>at?-1:We<at?1:0:Ye==="-type_leverage"?Tt!==dn?dn-Tt:Rt.leverage-Ue.leverage:Ye==="type_leverage"?on!==gn?gn-on:Rt.leverage-Ue.leverage:Ye==="-asset"?mt<Dt?-1:mt>Dt?1:0:Ye==="asset"?mt>Dt?-1:mt<Dt?1:0:0})};n.length,n.filter(Ye=>Ye.unrealizedPnl>=0).length;const[Ie,Le]=m.useState({coin:"",type:"",leverage:0,roe:0,entryPrice:0,markPrice:0,referral:"",positionDistribution:0,pnl:0,closePx:0}),$e=localStorage.getItem("isDateOpenPositionsLighterFormat")||"date",[it,tt]=m.useState($e);m.useEffect(()=>{localStorage.setItem("isDateOpenPositionsLighterFormat",it)},[it]);const[lt,ft]=m.useState([]),ut=async()=>{try{const Ye=window.localStorage.getItem("hyperToken");if(!Ye){L(!0);return}const ht="https://dextrabothypev2.nftinit.io/api/wallet/list-lighter",Zt=window.localStorage.getItem("hyperAddress"),Et=await(await fetch(ht,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:Q?Q.toLowerCase():Zt,token:Ye,balance:"false"})})).json();Et!=null&&Et.success?(ft(Et.data||[]),Ft(Et.data)):console.log(Et.error_message)}catch(Ye){console.error("Error fetching generate wallet list:",Ye)}};m.useEffect(()=>{window.localStorage.getItem("hyperToken")&&ut()},[u]);const[qt,It]=m.useState([]),[nn,jt]=m.useState(!0),[cn,un]=m.useState(!1);m.useEffect(()=>{he&&he.length>0&&(Ke(),lt.length>0&&nn&&Ft())},[he]);const Ft=()=>{qt.length!==0&&(Bt(qt),nn&&jt(!1))};m.useEffect(()=>{const Ye=window.localStorage.getItem("hyperToken");qt.length&&Ye&&Bt(qt)},[qt]);const Ke=()=>{const Ye=window.localStorage.getItem("hyperToken");let ht=!1;const Zt=[...qt];he.forEach(zt=>{var Rt;const Et=zt.asset,nt=(Rt=zt.wallet||e)==null?void 0:Rt.toLowerCase();Zt.some(We=>We.coin===Et&&(We.wallet||"").toLowerCase()===nt)||(Zt.push({coin:Et,wallet:nt}),ht=!0)}),ht&&(It(Zt),lt.some(Et=>Et.wallet_address===(e==null?void 0:e.toLowerCase()))&&Ye&&Bt(Zt))},Bt=async Ye=>{if(!cn)try{un(!0);const ht=window.localStorage.getItem("hyperToken"),Zt="https://dextrabothypev2.nftinit.io/api/hyper/following/position_info/";if(!ht||!Ye){un(!1);return}ht||L(!0);const zt=window.localStorage.getItem("hyperAddress"),nt=await(await fetch(Zt,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:Q?Q.toLowerCase():zt,token:ht,positions:Ye})})).json();nt.success?Ne(nt==null?void 0:nt.data):(console.log(nt.error_message),rn.error(nt.error_message))}catch(ht){console.error("Error tag request",ht),rn.error(ht.message)}finally{un(!1)}};(t==null?void 0:t.length)>1||lt.some(Ye=>Ye.wallet_address===(e==null?void 0:e.toLowerCase()));const $t={kBONK:"BONK",kPEPE:"PEPE",kSHIB:"SHIB",kFLOKI:"FLOKI",kNEIRO:"NEIRO",kDOGS:"DOGS",kLUNC:"LUNC"};return i.jsxs("div",{className:"w-full",children:[i.jsx(pT,{open:ne,setOpen:J,data:Ie,setTradeInfo:Le}),i.jsxs("div",{className:"relative w-full ",children:[i.jsxs("div",{className:"absolute -top-6 right-2 z-10 hidden lg:flex justify-start items-center gap-2",children:[i.jsx("button",{onClick:re,className:"bg-[#353535] hover:bg-gray-600 text-white p-1 rounded-lg focus:outline-none focus:ring-0 border-none",children:i.jsx("span",{className:"w-6 h-6",children:i.jsx(Bl,{className:"text-gray-300 w-4 h-4 rotate-90"})})}),i.jsx("button",{onClick:pe,className:"bg-[#353535] hover:bg-gray-600 text-white p-1 rounded-lg focus:outline-none focus:ring-0 border-none",children:i.jsx("span",{className:"w-6 h-6",children:i.jsx(Bl,{className:"text-gray-300 w-4 h-4 -rotate-90"})})}),i.jsx("button",{onClick:ie,className:"bg-[#353535] hover:bg-gray-600 text-white p-1 rounded-lg focus:outline-none focus:ring-0 border-none",children:i.jsx("span",{className:"w-6 h-6",children:i.jsx(Bl,{className:"text-gray-300 w-4 h-4 -rotate-180"})})}),i.jsx("button",{onClick:Y,className:"bg-[#353535] hover:bg-gray-600 text-white p-1 rounded-lg focus:outline-none focus:ring-0 border-none",children:i.jsx("span",{className:"w-6 h-6",children:i.jsx(Bl,{className:"text-gray-300 w-4 h-4 "})})})]}),i.jsx("div",{ref:X,className:"w-full overflow-scroll min-h-[60vh] max-h-[60vh] h-full flex-grow mt-1 mb-3 bg-[#161616] border-collapse rounded-lg pb-24",children:i.jsxs("table",{className:"w-full relative",children:[i.jsx("thead",{className:"sticky top-0 z-[3] bg-[#161616] whitespace-nowrap",children:i.jsxs("tr",{className:"w-full z-[4] font-semibold leading-[13px] tracking-[0.26px] text-[#9b9b9b] text-[13px] font-manrope mr-3",children:[i.jsx("th",{scope:"col",className:"sticky bg-[#161616] left-0 h-10 pl-2 sm:pl-6 min-w-[130px] sm:min-w-[145px] z-[8]",children:i.jsxs("div",{className:"flex justify-start items-center gap-2 relative",children:[i.jsx(hi,{title:"Coin",sortKey:"asset",sortOption:ye,setSortOption:ve,isFilterIcon:!1}),i.jsxs("div",{className:"flex items-center justify-start",children:[i.jsx("button",{onClick:()=>ee(!V),className:`${oe?"bg-gray-900":"bg-[#555555]"} inline-flex items-center p-1 rounded hover:bg-gray-700 focus:outline-none focus:ring-0 border-none`,children:i.jsx($f,{className:`w-4 h-4 ${oe?"text-blue-500":"text-white"}`})}),V&&i.jsxs("div",{ref:ae,className:`absolute left-[58px] mt-32 w-[208px]
bg-[#222] border border-gray-700 rounded shadow-lg p-2 z-10`,children:[i.jsxs("div",{className:"flex justify-between items-center px-2 pb-2 border-b border-gray-600",children:[i.jsx("span",{className:"text-white text-sm font-semibold",children:"Filter"}),i.jsx("div",{onClick:()=>G(""),className:"h-5 px-2 py-1.5 bg-[#3d3d3d] rounded-md justify-start items-center gap-2 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-[#cdcdcd] text-[11px] font-semibold font-manrope leading-[8px] pointer-events-none",children:"Clear All"})})]}),i.jsx("input",{type:"text",value:oe,onChange:Ye=>G(Ye.target.value),className:"bg-[#333] rounded text-white py-1 px-2 text-sm outline-none mt-2 placeholder:text-sm placeholder:font-semibold placeholder:font-manrope placeholder:text-[#7c7c7c]",placeholder:"Coin"})]})]})]})}),i.jsx(ban,{className:"min-w-[100px] sm:min-w-[120px] px-1",title:"Type",sortKey:"type_leverage",sortOption:ye,setSortOption:ve}),i.jsx(hv,{className:"min-w-[80px] sm:min-w-[80px] px-1",title:"Size",sortKey:"size",sortOption:ye,setSortOption:ve}),i.jsx(hv,{className:"min-w-[130px] sm:min-w-[145px] px-1",title:"Position Value",sortKey:"positionValue",sortOption:ye,setSortOption:ve}),i.jsx(hv,{className:"min-w-[120px] sm:min-w-[120px] px-1",title:"Entry Price",sortKey:"entryPrice",sortOption:ye,setSortOption:ve}),i.jsx(hv,{className:"min-w-[120px] sm:min-w-[120px] px-1",title:"Mark Price",sortKey:"currentPrice",sortOption:ye,setSortOption:ve}),i.jsx(hv,{className:"min-w-[100px] sm:min-w-[160px] px-1",title:"PnL(ROE%)",sortKey:"unrealizedPnl",sortOption:ye,setSortOption:ve}),i.jsx(hv,{className:"min-w-[120px] sm:min-w-[130px] px-1",title:"Margin",sortKey:"marginUsed",sortOption:ye,setSortOption:ve}),i.jsx(hv,{className:"min-w-[110px] sm:min-w-[130px] px-1",title:"Funding",sortKey:"funding",sortOption:ye,setSortOption:ve})]})}),i.jsx("tbody",{children:a?i.jsx("tr",{className:"text-center w-full h-full",children:i.jsx("td",{colSpan:window.innerWidth>=640&&window.innerWidth<768?5:window.innerWidth>=768&&window.innerWidth<1024?6:window.innerWidth>=1024&&window.innerWidth<1240?8:window.innerWidth>=1240&&window.innerWidth<1540?10:window.innerWidth>=1540?12:4,className:"h-[36vh]",children:i.jsx("div",{className:"flex w-full justify-center items-center",children:i.jsx("div",{className:"flex min-h-[36vh] w-[100%] sm:w-[75%] max-w-[300px] sm:max-w-[700px] justify-center items-center text-center",children:i.jsx(Da,{})})})})}):(he==null?void 0:he.length)==0?i.jsx("tr",{className:"text-center w-full h-full",children:i.jsx("td",{colSpan:window.innerWidth>=640&&window.innerWidth<768?5:window.innerWidth>=768&&window.innerWidth<1024?6:window.innerWidth>=1024&&window.innerWidth<1240?8:window.innerWidth>=1240&&window.innerWidth<1540?10:window.innerWidth>=1540?12:4,className:"h-[36vh]",children:i.jsx("div",{className:"flex w-full justify-center items-center",children:i.jsx("div",{className:"flex min-h-[36vh] w-[100%] sm:w-[75%] max-w-[300px] sm:max-w-[700px] justify-center items-center text-center",children:i.jsxs("div",{className:"flex flex-col justify-center items-center gap-3",children:[i.jsx("img",{src:ac,alt:""}),i.jsxs("div",{className:"flex flex-col items-center h-max gap-3",children:[i.jsx("div",{className:"text-[#d3d3d3] text-sm font-semibold font-manrope leading-[8px] pt-3",children:"No open positions are currently available"}),i.jsxs("div",{className:"text-center -mt-2",children:[i.jsxs("span",{className:"text-[#979797] text-[13px] font-normal font-manrope leading-[14px] tracking-wide",children:["To discover a different wallet, you can use the"," "]}),i.jsx("span",{className:"text-white text-[13px] font-normal font-manrope leading-[14px] tracking-wide",children:"'Discover Wallets'"}),i.jsxs("span",{className:"text-[#979797] text-[13px] font-normal font-manrope leading-[14px] tracking-wide",children:[" ","tab above."]})]})]})]})})})})}):(qe=je(ye))==null?void 0:qe.map((Ye,ht)=>{var Rt;const Zt=Ye!=null&&Ye.positionValue&&(Ye!=null&&Ye.leverage)?(Ye==null?void 0:Ye.unrealizedPnl)*(Ye==null?void 0:Ye.leverage)*100/(Ye==null?void 0:Ye.positionValue):0,zt=.004+6e-4*Ye.leverage;Ye.entryPrice*(Ye.leverage/(Ye.sign===1?Ye.leverage+1-Ye.leverage*zt:Ye.leverage-1+Ye.leverage*zt));const Et=Ye!=null&&Ye.leverage?(Ye==null?void 0:Ye.positionValue)/(Ye==null?void 0:Ye.leverage):0,Ue=(Ye==null?void 0:Ye.positionValue)*1e-4*(Ye==null?void 0:Ye.sign);return i.jsxs(Ae.Fragment,{children:[i.jsxs("tr",{className:"relative group bg-[#1b1b1b] hover:bg-[#222222] h-[32px] max-h-[32px] text-white rounded-2xl",style:{margin:"2px"},children:[i.jsx("td",{scope:"row",className:"sticky left-0 z-[2] bg-[#1b1b1b] group-hover:bg-[#222222] sm:rounded-l-2xl",children:i.jsx("div",{onClick:()=>{window.open(`/terminal/${Ye==null?void 0:Ye.asset}`,"_blank")},className:"group-hover:bg-[#222222] flex justify-start items-center gap-2 pl-2 sm:pl-6 h-8 max-h-14 rounded-2xl cursor-pointer",children:i.jsxs("div",{className:"flex justify-start items-center gap-1.5",children:[i.jsx("div",{className:"w-5 h-5 rounded-full",children:i.jsx("img",{src:`https://app.hyperliquid.xyz/coins/${$t[Ye.asset]||((Rt=Ye.asset)==null?void 0:Rt.split("/")[0])}.svg`||Va,alt:Ye==null?void 0:Ye.asset,className:"rounded-full w-5 h-5 min-w-5 min-h-5",loading:"lazy",onError:We=>ra(We)})}),i.jsx("div",{className:"text-white text-sm font-semibold font-manrope leading-[13px] tracking-[0.18px]",children:Ye.asset})]})})}),i.jsx("td",{scope:"row",className:"z-[2] bg-[#1b1b1b] group-hover:bg-[#222222]",children:i.jsx("div",{className:"group-hover:bg-[#222222] flex justify-start items-center gap-2 h-8 max-h-8",children:i.jsxs("div",{className:`${Ye.type==="Long"?"text-[#67ffbd] bg-[#67ffbd]/20":"text-[#ff787b] bg-[#ff797c]/20"} h-5 pl-1 pr-1.5 py-1 rounded-md justify-start items-center gap-0.5 inline-flex`,children:[i.jsx("div",{className:"w-3 h-3 justify-center items-center flex",children:i.jsx("div",{className:"w-3 h-3 relative",children:Ye.type==="Long"?i.jsx(Ps,{className:"text-[#67FFBD] rotate-180 w-3 h-3"}):i.jsx(Ps,{className:"text-[#FF797C] w-3 h-3"})})}),i.jsxs("div",{className:" text-[11px] font-semibold font-manrope leading-[8px] tracking-wide uppercase",children:[Ye.type," - ",Ye==null?void 0:Ye.leverage,"x"]})]})})}),i.jsx("td",{children:i.jsx("div",{className:"pl-1 pr-2 flex flex-col items-end gap-2 font-manrope",children:i.jsx("div",{className:"text-white text-sm font-semibold font-manrope leading-[13px] tracking-tight",children:ao(Math.abs(Ye.size))})})}),i.jsx("td",{children:i.jsx("div",{className:"pl-1 pr-2 flex flex-col items-end gap-2 font-manrope",children:i.jsx("div",{className:"text-white text-sm font-semibold font-manrope leading-[13px] tracking-[0.18px]",children:Ye.positionValue?`$${ao(Ye.positionValue)}`:ao(Ye.positionValue)})})}),i.jsx("td",{children:i.jsx("div",{className:"pl-1 pr-2 flex flex-col items-end gap-2 font-manrope",children:i.jsx("div",{className:"text-white text-sm font-semibold font-manrope leading-[13px] tracking-[0.18px]",children:Ye.entryPrice?`$${Er(Ye.entryPrice)}`:Er(Ye.entryPrice)})})}),i.jsx("td",{children:i.jsx("div",{className:"pl-1 pr-2 flex flex-col items-end gap-2 font-manrope",children:i.jsx("div",{className:"text-white text-sm font-semibold font-manrope leading-[13px] tracking-[0.18px]",children:Ye.currentPrice?`$${Er(Ye.currentPrice)}`:Er(Ye.currentPrice)})})}),i.jsx("td",{children:i.jsxs("div",{onClick:()=>{Le(We=>({...We,coin:Ye.asset,type:Ye.type,leverage:Ye.leverage,roe:Zt,entryPrice:Ye.entryPrice,markPrice:Ye.currentPrice,pnl:Ye.unrealizedPnl,referral:window.localStorage.getItem("hyperToken")?P:null})),J(!0)},className:"pl-1 pr-2 flex justify-end gap-2 font-manrope cursor-pointer min-w-max",children:[i.jsxs("div",{className:`${Ye.unrealizedPnl>=0?"text-[#67ffbd]":"text-[#ff787b]"} text-sm font-semibold font-manrope leading-[13px] tracking-[0.18px]`,children:[Ye.unrealizedPnl?`$${ao(Math.abs(Ye.unrealizedPnl))}`:ao(Math.abs(Ye.unrealizedPnl)),` (${ao(Math.abs(Zt.toFixed(2)))}%)`]}),i.jsx("div",{className:"flex justify-center items-center rounded",children:i.jsx("img",{src:gm,alt:"",className:"w-[14px] h-[14px] min-w-[14px] min-h-[14px]"})})]})}),i.jsx("td",{children:i.jsx("div",{className:"pl-1 pr-2 flex flex-col items-end gap-2 font-manrope",children:i.jsx("div",{className:"text-white text-sm font-semibold font-manrope leading-[13px] tracking-[0.18px] min-w-max",children:Et?`$${ao(Et)}`:ao(Et)})})}),i.jsx("td",{children:i.jsx("div",{className:"pl-1 pr-2 flex flex-col items-end gap-2 font-manrope",children:i.jsx("div",{className:`${!isNaN(Number(Ue))&&Number(Ue)<=0?"text-[#67ffbd]":"text-[#ff787b]"} text-sm font-semibold font-manrope leading-[13px] tracking-[0.18px]`,children:isNaN(Number(Ue))?"$0.00":`$${Math.abs(Number(Ue)).toFixed(4)}`})})})]}),i.jsx("tr",{children:i.jsx("td",{colSpan:"100",style:{height:"2px"}})})]},ht)})})]})})]})]})},hv=({className:e,title:t,sortKey:n,sortOption:r,setSortOption:s})=>i.jsx("th",{scope:"col",className:e,children:i.jsx(hi,{title:t,sortKey:n,sortOption:r,setSortOption:s,isFilterIcon:!0})}),ban=({className:e,title:t,sortKey:n,sortOption:r,setSortOption:s})=>i.jsx("th",{scope:"col",className:e,children:i.jsx(hi,{title:t,sortKey:n,sortOption:r,setSortOption:s,isFilterIcon:!1})}),yan=({initialAddress:e="",wallets:t,isWalletIndex:n,posLoading:r,setPosLoading:s,setGenerateWalletData:a})=>{const[o,l]=m.useState("positions"),[c,u]=m.useState([]);return i.jsxs("div",{className:"w-full",children:[i.jsxs("div",{className:"flex justify-start items-center w-full gap-2 mb-2 mx-4 mt-4 relative overflow-x-auto whitespace-nowrap scrollbar-hide [-ms-overflow-style:none] [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:[i.jsx("div",{className:"absolute bottom-0 left-0 w-[80%] h-[1px] bg-[#2A2A2A]"}),i.jsx("div",{onClick:()=>l("positions"),className:`${o==="positions"?"active text-[#67FFBD] border-b border-[#67FFBD] z-20":"text-[#C1C1C1]"} h-6 px-2 py-3 flex justify-center items-center gap-2.5 cursor-pointer font-manrope font-semibold pb-4 hover:text-[#67FFBD]`,children:i.jsxs("div",{className:"flex items-center text-[13px] font-semibold font-manrope leading-[8px] pointer-events-none min-w-max",children:[i.jsx("span",{className:"mr-2",children:"Open Positions"}),i.jsx("span",{className:"flex w-[22px] h-[22px] px-3 justify-center items-center gap-[2px] flex-shrink-0 rounded-md bg-[rgba(103,255,189,0.16)] text-[14px] font-semibold font-manrope",children:c.length})]})})]}),o==="positions"?i.jsx(gan,{initialAddress:e,wallets:t,positions:c,setPositions:u,isWalletIndex:n,posLoading:r,setPosLoading:s,setGenerateWalletData:a}):""]})},van=({data:e,isWalletIndex:t,fetchAllIndex:n,setGenerateWalletData:r})=>{const{isConnected:s,address:a}=ns(),{setSignModalOpen:o,hyperToken:l,isReferralCodeName:c}=m.useContext(Qr),[u,d]=m.useState(""),[f,x]=m.useState(!0);m.useState({});const[g,v]=m.useState(!1),[w,C]=m.useState(""),[N,P]=m.useState(!1),I=m.useRef(null),R=m.useRef(null),[F,U]=m.useState(!1),[L,z]=m.useState(!1),[Q,ne]=m.useState({coin:"",type:"",leverage:0,roe:0,entryPrice:0,markPrice:0,referral:"",pnl:0}),J="-unrealizedPnl",[X,re]=m.useState(J),[pe,Y]=m.useState([]),[ie,oe]=m.useState(!1);m.useEffect(()=>{if(e.length===0||ie)return;const ve=e.reduce((je,Ie)=>parseFloat(Ie.perpEquity||0)>parseFloat(je.perpEquity||0)?Ie:je);ve.wallet_address&&d(ve.wallet_address)},[e,ie]);const G=(ve,je,Ie)=>{const Le=ve==null?void 0:ve.filter(Qe=>Qe&&Qe.walletAddress&&Qe.asset).filter(Qe=>{var $e,it;return Ie?(it=($e=Qe==null?void 0:Qe.asset)==null?void 0:$e.toString())==null?void 0:it.toUpperCase().includes(Ie.toUpperCase()):!0});return Le==null?void 0:Le.sort((Qe,$e)=>{const it=Qe.wallet_name?Qe.wallet_name.toUpperCase():"",tt=$e.wallet_name?$e.wallet_name.toUpperCase():"",lt=Qe.tag?Qe.tag.toUpperCase():"",ft=$e.tag?$e.tag.toUpperCase():"",ut=Qe.asset?Qe.asset.toUpperCase():"",qt=$e.asset?$e.asset.toUpperCase():"",It=Qe.type==="Long"?1:0,nn=$e.type==="Long"?1:0,jt=Qe.type==="Short"?1:0,cn=$e.type==="Short"?1:0;return je==="wallet_name"?it<tt?-1:it>tt?1:0:je==="-wallet_name"?it>tt?-1:it<tt?1:0:je==="-unrealizedPnl"?$e.unrealizedPnl-Qe.unrealizedPnl:je==="unrealizedPnl"?Qe.unrealizedPnl-$e.unrealizedPnl:je==="-roe"?$e.roe-Qe.roe:je==="roe"?Qe.roe-$e.roe:je==="-size"?$e.size-Qe.size:je==="size"?Qe.size-$e.size:je==="-entryPrice"?$e.entryPrice-Qe.entryPrice:je==="entryPrice"?Qe.entryPrice-$e.entryPrice:je==="-currentPrice"?$e.currentPrice-Qe.currentPrice:je==="currentPrice"?Qe.currentPrice-$e.currentPrice:je==="-leverage"?$e.leverage-Qe.leverage:je==="leverage"?Qe.leverage-$e.leverage:je==="-positionValue"?$e.positionValue-Qe.positionValue:je==="positionValue"?Qe.positionValue-$e.positionValue:je==="-marginUsed"?$e.marginUsed-Qe.marginUsed:je==="marginUsed"?Qe.marginUsed-$e.marginUsed:je==="funding"?$e.funding-Qe.funding:je==="-funding"?Qe.funding-$e.funding:je==="-liquidationPrice"?$e.liquidationPrice-Qe.liquidationPrice:je==="liquidationPrice"?Qe.liquidationPrice-$e.liquidationPrice:je==="-tag"?lt<ft?-1:lt>ft?1:0:je==="tag"?lt>ft?-1:lt<ft?1:0:je==="-coin"?ut<qt?-1:ut>qt?1:0:je==="coin"?ut>qt?-1:ut<qt?1:0:je==="-type_leverage"?It!==nn?nn-It:$e.leverage-Qe.leverage:je==="type_leverage"?jt!==cn?cn-jt:$e.leverage-Qe.leverage:0})},V=async ve=>{if(ve===""&&pe.filter(je=>je!==void 0).length===0||ve===""&&G(pe,X,w).length===0||G(pe,X,w).length===0){rn.success("There are no open positions to close.",{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(255, 121, 124, 0.32)",width:"400px",minWidth:"400px",height:"40px",backdropFilter:"blur(48px)"},iconTheme:{primary:"#ff797c",secondary:"#7d3031"}});return}if(ve===""&&(e==null?void 0:e.length)>0){const je=G(pe,X,w),Ie=[...new Set(je.map(Le=>Le.wallet_id))];if(Ie.length===0){rn.success("There are no open positions to close.",{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(255, 121, 124, 0.32)",width:"400px",minWidth:"400px",height:"40px",backdropFilter:"blur(48px)"},iconTheme:{primary:"#ff797c",secondary:"#7d3031"}});return}try{if(v(!0),!window.localStorage.getItem("hyperToken")){o(!0),v(!1);return}await Promise.all(Ie.map(Qe=>ee(Qe,!1))),rn.success("All close order operations successful.",{style:{border:"1px solid #22c55e",padding:"16px",color:"#fff",borderRadius:"999px",background:"#14532d",width:"400px",minWidth:"400px",height:"60px"},iconTheme:{primary:"#22c55e",secondary:"#FFFAEE"}})}catch(Le){console.error("Error closing all orders:",Le)}finally{v(!1)}return}await ee(ve)},ee=async(ve,je=!0)=>{if(pe.filter(Ie=>Ie!==void 0).length===0){rn.success("There are no open positions to closes.",{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(255, 121, 124, 0.32)",width:"400px",minWidth:"400px",height:"40px",backdropFilter:"blur(48px)"},iconTheme:{primary:"#ff797c",secondary:"#7d3031"}});return}if(!ve){console.error("Close order called with invalid parameters"),rn.error("Close order called with invalid parameters");return}try{v(!0);const Ie=window.localStorage.getItem("hyperToken"),Le="https://dextrabothypev2.nftinit.io/api/hyper/order/close_order_all_new/";if(!Ie){o(!0),v(!1);return}const Qe=window.localStorage.getItem("hyperAddress"),$e=await fetch(Le,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:a?a.toLowerCase():Qe,token:Ie,wallet_id:ve.toString()})});if(!$e.ok)throw new Error(`Server responded with status ${$e.status}`);const it=await $e.json();it.status=="ok"?(v(!1),je&&rn.success("Close order operation successful.",{style:{border:"1px solid #22c55e",padding:"16px",color:"#fff",borderRadius:"999px",background:"#14532d",height:"60px",width:"400px",minWidth:"400px"},iconTheme:{primary:"#22c55e",secondary:"#FFFAEE"}})):it.success?(v(!1),je&&rn.success("There are no open positions to close.",{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(255, 121, 124, 0.32)",width:"400px",minWidth:"400px",height:"40px",backdropFilter:"blur(48px)"},iconTheme:{primary:"#ff797c",secondary:"#7d3031"}})):(console.log("Close order operation failed."),rn.error("Close order operation failed."),v(!1))}catch(Ie){throw console.error("Something went wrong!"),rn.error("Something went wrong!"),v(!1),Ie}},[ae,fe]=m.useState(!1);m.useEffect(()=>{const ve=()=>{(localStorage.getItem("walletManagementInfo")!==void 0||localStorage.getItem("walletManagementInfo")!==null)&&Date.now()-Number(localStorage.getItem("walletManagementInfo"))>=864e5&&fe(!0)};ve();const je=setInterval(()=>{ve()},1e3*60*30);return()=>{clearInterval(je)}},[]);const Ne=async ve=>{try{const je=window.localStorage.getItem("hyperToken"),Ie="https://dextrabothypev2.nftinit.io/api/hyper/following/position_info/";if(!je){o(!0);return}const Le=ve==null?void 0:ve.filter(tt=>tt&&tt.walletAddress&&tt.asset).map(tt=>({wallet:tt.walletAddress,coin:tt.asset})),Qe=window.localStorage.getItem("hyperAddress"),it=await(await fetch(Ie,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:a?a.toLowerCase():Qe,token:je,positions:Le})})).json();it.success?Y(tt=>tt.map(lt=>{const ft=it==null?void 0:it.data.find(ut=>(ut==null?void 0:ut.wallet)===(lt==null?void 0:lt.walletAddress)&&(ut==null?void 0:ut.coin)===(lt==null?void 0:lt.asset));return{...lt,tag:ft==null?void 0:ft.tag,tagWallet:ft==null?void 0:ft.cp_wallet}})):(console.log(it.error_message),rn.error(it.error_message))}catch(je){console.error("Error tag request",je),rn.error(je.message)}},he=m.useRef(pe==null?void 0:pe.filter(ve=>(ve==null?void 0:ve.walletAddress)&&(ve==null?void 0:ve.asset)).length),ge=m.useRef(),ye=m.useRef(!0);return m.useEffect(()=>{const ve=pe==null?void 0:pe.filter(Ie=>Ie!==void 0&&(Ie==null?void 0:Ie.walletAddress)&&(Ie==null?void 0:Ie.asset)),je=ve==null?void 0:ve.length;if(je>0&&je>he.current){const Ie=u===""?pe:pe.filter(Le=>(Le==null?void 0:Le.wallet_id)==u);ye.current?(Ne(Ie),ye.current=!1):(ge.current&&clearTimeout(ge.current),ge.current=setTimeout(()=>{Ne(Ie)},5e3))}he.current=je},[pe]),m.useEffect(()=>{if((pe==null?void 0:pe.filter(ve=>ve!==void 0&&(ve==null?void 0:ve.walletAddress)&&(ve==null?void 0:ve.asset)).length)>0){const ve=u==""?pe:pe==null?void 0:pe.filter(je=>(je==null?void 0:je.wallet_id)==u);(ve==null?void 0:ve.length)>0&&Ne(ve)}},[u]),m.useEffect(()=>{function ve(je){I.current&&!I.current.contains(je.target)&&setIsDropdownOpen(!1),R.current&&!R.current.contains(je.target)&&P(!1)}return document.addEventListener("mousedown",ve),()=>document.removeEventListener("mousedown",ve)},[]),i.jsx(i.Fragment,{children:i.jsxs(i.Fragment,{children:[i.jsx(JUe,{open:F,setOpen:U,data:Q,setShare:z,setTradeInfo:ne}),i.jsxs("div",{className:"flex flex-col items-stretch justify-start gap-[17px] text-white bg-[#161616] w-full h-full min-h-[500px] max-h-max font-manrope relative sm:pt-10",children:[i.jsxs("div",{className:"flex items-center justify-start gap-4",children:[i.jsx("div",{className:"text-white text-lg font-medium font-manrope leading-[21px] w-full",children:"Manage Positions"}),i.jsx("div",{className:"flex sm:hidden items-center justify-end w-full gap-1 min-w-max",children:i.jsx("div",{className:"flex items-center justify-end group",children:i.jsxs("div",{onClick:ve=>{ve.preventDefault(),g||V(u)},className:"h-[26px] pl-1 pr-2 py-1.5 bg-[#67ffbd]/20 hover:bg-[#67ffbd]/30 rounded-md inline-flex justify-start items-center gap-2 cursor-pointer",children:[i.jsx("div",{className:"",children:i.jsx("img",{src:nae,alt:"",className:"w-4 h-4"})}),g?i.jsxs("div",{role:"status",className:"flex justify-center items-center h-5 min-h-5 w-[66px] px-2 py-1.5 rounded-md",children:[i.jsxs("svg",{"aria-hidden":"true",className:"inline w-4 h-4 text-gray-200 animate-spin dark:text-gray-600 fill-[#67FFBD]",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),i.jsx("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]}),i.jsx("span",{className:"sr-only",children:"Loading..."})]}):i.jsx("div",{className:"justify-start text-[#67ffbd] text-[11px] font-semibold font-manrope leading-[8px] tracking-tight",children:"Fast Close All"})]})})})]}),i.jsxs("div",{className:"relative w-full h-full",children:[i.jsxs("div",{className:"flex justify-start items-center gap-2",children:[i.jsxs("div",{className:"flex justify-start items-center gap-2",children:[i.jsx("span",{className:"font-bold min-w-[200px] lg:min-w-max text-xs sm:text-[14px]",children:"Select wallet to see your current positions:"}),i.jsx("select",{className:"rounded-md py-0.5 bg-[#303030] text-white text-md outline-none w-full h-8 min-w-[150px] px-2",onChange:ve=>{d(ve.target.value),oe(!0),n(ve.target.value),x(!0),r(je=>je==null?void 0:je.map(Ie=>({...Ie,unrealizedPnl:0,marginUsed:0})))},value:u,children:e==null?void 0:e.map(ve=>i.jsx("option",{value:ve==null?void 0:ve.wallet_address,children:`${ve==null?void 0:ve.wallet_name} - (${(ve==null?void 0:ve.wallet_address).slice(0,5)+"..."+(ve==null?void 0:ve.wallet_address).slice(-4)})`},ve==null?void 0:ve.wallet_id))})]}),!1]}),i.jsx("div",{className:"w-full h-max max-w-[100%] min-h-[60vh] sm:min-h-[36vh] overflow-scroll relative flex-grow",children:i.jsx(yan,{initialAddress:u,wallets:u===""?e:void 0,isWalletIndex:t,posLoading:f,setPosLoading:x,setGenerateWalletData:r})})]})]})]})})},wan=({isSelectMenu:e,setIsSelectMenu:t,hyperWallet:n,lighterWallet:r,extendedWallet:s,lighterWalletList:a})=>{const{isConnected:o,address:l}=ns(),{setSignModalOpen:c,hyperToken:u}=m.useContext(Qr),[d,f]=m.useState([]),[x,g]=m.useState(!1),[v,w]=m.useState(null),[C,N]=m.useState(!0),[P,I]=m.useState(null),[R,F]=m.useState([]),[U,L]=m.useState(()=>parseInt(localStorage.getItem("walletManagementLighterPage"))||1),z=5,[Q,ne]=m.useState(!1),[J,X]=m.useState(!1);m.useEffect(()=>{window.localStorage.getItem("hyperToken")?re():(c(!0),f([]),window.localStorage.setItem("walletManagementLighterPage",1))},[o,u]);const re=async()=>{var oe;try{g(!0);const G=window.localStorage.getItem("hyperToken");if(!G){c(!0);return}const V="https://dextrabothypev2.nftinit.io/api/wallet/list-lighter",ee=window.localStorage.getItem("hyperAddress"),fe=await(await fetch(V,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:l?l.toLowerCase():ee,token:G})})).json();if(fe.success){a(),F(fe.data||[]),ne(!0);const Ne=parseInt(localStorage.getItem("walletManagementLighterPage"))||1,he=Math.max(Math.ceil(((fe==null?void 0:fe.data)||[]).length/z),1),ge=Math.min(Ne,he);L(ge),localStorage.setItem("walletManagementLighterPage",ge),Y(ge,fe.data||[]);const ye=(ge-1)*z,ve=(oe=fe.data)==null?void 0:oe[ye];ve&&pe(ve==null?void 0:ve.wallet_address)}else console.log(fe.error_message),g(!1),w(fe.error_message)}catch(G){console.error("Error fetching lighter wallet list:",G),g(!1),w(G.message)}},pe=async oe=>{try{const V=`https://mainnet.zklighter.elliot.ai/api/v1/accountsByL1Address?l1_address=${jc(oe)}`,ae=await(await fetch(V,{method:"GET",headers:{accept:"application/json"}})).json();if(ae.sub_accounts&&ae.sub_accounts.length>0){const fe=ae.sub_accounts[0],Ne=(fe==null?void 0:fe.collateral)??fe.collateral??"",he=(fe==null?void 0:fe.margin_used)??"",ge=(fe==null?void 0:fe.available_balance)??"",ye=(fe==null?void 0:fe.unrealized_pnl)??"",ve=(fe==null?void 0:fe.positions)??[];f(je=>je==null?void 0:je.map(Ie=>Ie.wallet_address.toLowerCase()===oe.toLowerCase()?{...Ie,perpEquity:Ne,unrealizedPnl:ye,withdrawableUsdc:ge,marginUsed:he,positions:ve}:Ie)),I(fe),X(!0),g(!1),N(!1)}}catch(G){console.error("Error fetching lighter index:",G)}};m.useEffect(()=>{const oe=()=>{const G=parseInt(localStorage.getItem("walletManagementLighterPage"))||1;G!==U&&Q&&J&&(L(G),Y(G,R))};return window.addEventListener("storage",oe),()=>{window.removeEventListener("storage",oe)}},[U,R,Q,J]);const Y=(oe,G)=>{if(!G||G.length===0){g(!1);return}g(!0);const V=(oe-1)*z,ee=V+z,ae=G.slice(V,ee);f(ae)},ie=oe=>{oe<1||oe>Math.ceil(R.length/z)||(g(!0),L(oe),localStorage.setItem("walletManagementLighterPage",oe),Y(oe,R))};return i.jsxs(i.Fragment,{children:[i.jsx(xan,{data:d,loading:x,error:v,socketLoading:C,handlePageChange:ie,handleListRequest:re,currentPage:U,allWallets:R,isSelectMenu:e,setIsSelectMenu:t,hyperWallet:n,lighterWallet:r,extendedWallet:s}),i.jsx(van,{data:d,setGenerateWalletData:f,isWalletIndex:P,fetchAllIndex:pe})]})},Can=({data:e,loading:t,error:n,socketLoading:r,currentPage:s,handlePageChange:a,allWallets:o,handleListRequest:l,isSelectMenu:c,setIsSelectMenu:u,hyperWallet:d,lighterWallet:f,extendedWallet:x})=>{var Ft;const[g,v]=m.useState(!1),{setSignModalOpen:w}=m.useContext(Qr),{isConnected:C,address:N}=ns(),P=5,[I,R]=m.useState(null),[F,U]=m.useState(null),[L,z]=m.useState(!1),[Q,ne]=m.useState(null),[J,X]=m.useState(!1),[re,pe]=m.useState("");m.useState({});const[Y,ie]=m.useState({}),[oe,G]=m.useState(!1),[V,ee]=m.useState({wallet:"",walletId:"",walletName:"",unrealizedPnL:"",perpEquity:""}),[ae,fe]=m.useState(!1),[Ne,he]=m.useState(!1),ge="-perpEquity",[ye,ve]=m.useState(ge),je=Ke=>e.sort((Bt,$t)=>{if(Bt.version===3&&$t.version!==3)return-1;if($t.version===3&&Bt.version!==3)return 1;const qe=Bt.wallet_name?Bt.wallet_name.toUpperCase():"",Ye=$t.wallet_name?$t.wallet_name.toUpperCase():"",ht=Bt.wallet_address?Bt.wallet_address.toLowerCase():"",Zt=$t.wallet_address?$t.wallet_address.toLowerCase():"";return Ke==="wallet_name"?qe<Ye?-1:qe>Ye?1:0:Ke==="-wallet_name"?qe>Ye?-1:qe<Ye?1:0:Ke==="-wallet_address"?ht<Zt?-1:ht>Zt?1:0:Ke==="wallet_address"?ht>Zt?-1:ht<Zt?1:0:Ke==="-wallet_created_data"?new Date($t.wallet_created_data)-new Date(Bt.wallet_created_data):Ke==="wallet_created_data"?new Date(Bt.wallet_created_data)-new Date($t.wallet_created_data):Ke==="-perpEquity"?$t.perpEquity-Bt.perpEquity:Ke==="perpEquity"?Bt.perpEquity-$t.perpEquity:Ke==="-unrealizedPnl"?$t.unrealizedPnl-Bt.unrealizedPnl:Ke==="unrealizedPnl"?Bt.unrealizedPnl-$t.unrealizedPnl:Ke==="-marginUsed"?$t.marginUsed-Bt.marginUsed:Ke==="marginUsed"?Bt.marginUsed-$t.marginUsed:Ke==="-withdrawableUsdc"?$t.withdrawableUsdc-Bt.withdrawableUsdc:Ke==="withdrawableUsdc"?Bt.withdrawableUsdc-$t.withdrawableUsdc:0}),Ie=async(Ke,Bt,$t)=>{if(!Ke||!Bt||!$t){console.error("Delete order called with invalid parameters"),rn.error("Delete order called with invalid parameters");return}const qe=`${Ke}_${Bt}`;try{ie(nt=>({...nt,[qe]:!0}));const Ye=window.localStorage.getItem("hyperToken"),ht="https://dextrabothypev2.nftinit.io/api/wallet/delete-extended";if(!Ye){w(!0),ie(nt=>({...nt,[qe]:!1}));return}const Zt=window.localStorage.getItem("hyperAddress"),zt=await fetch(ht,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:N?N.toLowerCase():Zt,token:Ye,wallet_id:Ke})});if(!zt.ok)throw new zl(`Server responded with status ${zt.status}`);const Et=await zt.json();Et.success?(l(),ee({wallet:"",walletId:"",walletName:"",unrealizedPnL:"",perpEquity:""}),fe(!1),he(!1),G(!1),ie(nt=>({...nt,[qe]:!1})),rn.success(i.jsxs(i.Fragment,{children:[i.jsx("span",{children:$t.slice(0,5)+"..."+$t.slice(-3)}),i.jsxs("span",{style:{color:"#ff797c",paddingLeft:"5px"},children:[" ","removed from generated wallets"]})]}),{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(255, 121, 124, 0.32)",width:"440px",minWidth:"440px",height:"40px",backdropFilter:"blur(48px)"},iconTheme:{primary:"#ff797c",secondary:"#7d3031"}})):(console.log(Et.error_message),rn.error(Et.error_message),ie(nt=>({...nt,[qe]:!1})))}catch(Ye){console.error("Error deleting wallet:",Ye),rn.error(Ye.message),ie(ht=>({...ht,[qe]:!1}))}},Le=m.useRef(null),Qe=()=>{Le.current&&(Le.current.scrollLeft-=100)},$e=()=>{Le.current&&(Le.current.scrollLeft+=100)},it=()=>{Le.current&&(Le.current.scrollTop+=200)},tt=()=>{Le.current&&(Le.current.scrollTop-=200)},lt=Ke=>Ke>=640&&Ke<1024?4:Ke>=1024&&Ke<1240?7:Ke>=1240&&Ke<1540||Ke>=1540?8:3,[ft,ut]=m.useState(null),[qt,It]=m.useState(!1),[nn,jt]=m.useState(!1);m.useEffect(()=>{const Ke=()=>{jt(window.innerWidth<640)};return window.addEventListener("resize",Ke),Ke(),()=>window.removeEventListener("resize",Ke)},[]);const cn=Ke=>{nn&&(ut(Ke),It(!0))};m.useEffect(()=>{const Ke=window.location.hash;if(!Ke)return;const Bt=Ke.split("#").filter(Boolean);Bt.includes("add-account")&&(v(!0),Bt[0]==="hyperliquid"&&(u("HYPER"),localStorage.setItem("isWalletSelectMenu","HYPER")),Bt[0]==="lighter"&&(u("LIGHTER"),localStorage.setItem("isWalletSelectMenu","LIGHTER")),Bt[0]==="extended"&&(u("EXTENDED"),localStorage.setItem("isWalletSelectMenu","EXTENDED")))},[]);const un=Ke=>{v(!1),Ke==="HYPER"?(window.history.replaceState(null,"",`${window.location.pathname}#hyperliquid`),u("HYPER"),localStorage.setItem("isWalletSelectMenu","HYPER")):Ke==="LIGHTER"?(window.history.replaceState(null,"",`${window.location.pathname}#lighter`),u("LIGHTER"),localStorage.setItem("isWalletSelectMenu","LIGHTER")):Ke==="EXTENDED"&&(window.history.replaceState(null,"",`${window.location.pathname}#extended`),u("EXTENDED"),localStorage.setItem("isWalletSelectMenu","EXTENDED"))};return i.jsxs(i.Fragment,{children:[i.jsx(Bce,{open:L,setOpen:z,data:e,walletData:I,withdrawableUsdc:Q,setWithdrawableUsdc:ne,modalWalletId:F,setModalWalletId:U}),i.jsx(Uce,{open:J,setOpen:X,walletAddress:re}),i.jsx(zce,{open:oe,setOpen:G,handleDeleteWallet:Ie,deleteWalleInfo:V,confirmClosePositions:ae,setConfirmClosePositions:fe,confirmWithdrawEquity:Ne,setConfirmWithdrawEquity:he}),i.jsx(up,{isOpen:qt,onClose:()=>It(!1),children:i.jsx(Hce,{rowData:ft})}),i.jsxs("div",{className:"flex flex-col items-stretch justify-start gap-[17px] text-white bg-[#161616] w-full h-full sm:min-h-[340px] max-h-max font-manrope relative",children:[i.jsxs("div",{className:"flex justify-start items-center gap-10 pl-2 sm:pl-0 pt-4",children:[i.jsxs("div",{className:"hidden sm:flex flex-col items-start justify-start gap-2 font-manrope min-w-max bg-[#161616] ",children:[i.jsx("div",{className:"text-[#7e7e7e] text-[11px] font-medium font-inter leading-[8px]",children:"Hype / Explore"}),i.jsx("div",{className:"flex items-center justify-start gap-4",children:i.jsx("div",{className:"text-white text-lg font-medium font-manrope leading-[21px]",children:"Wallet Management"})})]}),i.jsxs("div",{className:"flex flex-col items-start lg:flex-row lg:justify-start lg:items-center gap-1 lg:gap-10",children:[i.jsx($ce,{handleListRequest:l,handlePageChange:a,isGenWalletModal:g,setIsGenWalletModal:v}),i.jsxs("div",{className:"flex justify-start items-center gap-1.5 w-max h-max rounded-lg border border-[#333333] p-1",children:[i.jsx(XY,{title:"HYPER",label:"HYPERLIQUID",walletLength:d,handleSelectMenuChange:un,isSelectMenu:c}),i.jsx(XY,{title:"LIGHTER",label:"LIGHTER",walletLength:f,handleSelectMenuChange:un,isSelectMenu:c}),i.jsx(XY,{title:"EXTENDED",label:"EXTENDED",walletLength:x,handleSelectMenuChange:un,isSelectMenu:c})]})]})]}),i.jsxs("div",{className:"relative w-full h-full",children:[i.jsxs("div",{className:"absolute -top-5 right-4 z-10 hidden justify-start items-center gap-2",children:[i.jsx("button",{onClick:Qe,className:"bg-[#353535] hover:bg-gray-600 text-white p-1 rounded-lg focus:outline-none focus:ring-0 border-none",children:i.jsx("span",{className:"w-6 h-6",children:i.jsx(Xa,{className:"text-gray-300 w-4 h-4 rotate-90"})})}),i.jsx("button",{onClick:$e,className:"bg-[#353535] hover:bg-gray-600 text-white p-1 rounded-lg focus:outline-none focus:ring-0 border-none",children:i.jsx("span",{className:"w-6 h-6",children:i.jsx(Xa,{className:"text-gray-300 w-4 h-4 -rotate-90"})})}),i.jsx("button",{onClick:tt,className:"bg-[#353535] hover:bg-gray-600 text-white p-1 rounded-lg focus:outline-none focus:ring-0 border-none",children:i.jsx("span",{className:"w-6 h-6",children:i.jsx(Xa,{className:"text-gray-300 w-4 h-4 -rotate-180"})})}),i.jsx("button",{onClick:it,className:"bg-[#353535] hover:bg-gray-600 text-white p-1 rounded-lg focus:outline-none focus:ring-0 border-none",children:i.jsx("span",{className:"w-6 h-6",children:i.jsx(Xa,{className:"text-gray-300 w-4 h-4 "})})})]}),i.jsx("div",{className:"w-full h-auto sm:h-max max-w-[100%] overflow-scroll relative flex-grow",ref:Le,children:i.jsxs("table",{className:"w-full relative",children:[i.jsx("thead",{className:"sticky top-0 z-[3] bg-[#161616] whitespace-nowrap",children:i.jsxs("tr",{className:"w-full z-[4] text-[#9b9b9b] text-[13px] font-semibold font-manrope leading-[13px] tracking-tight",children:[i.jsx("th",{scope:"col",className:"font-medium sm:sticky bg-[#161616] sm:left-0 h-8 pl-3 min-w-[120px] sm:min-w-[140px] z-[8]",children:i.jsx(hi,{title:"Name",sortKey:"wallet_name",sortOption:ye,setSortOption:ve,isFilterIcon:!1})}),i.jsx("th",{scope:"col",className:"sm:sticky bg-[#161616] sm:left-[140px] h-10 px-1 min-w-[160px] sm:min-w-[190px] z-[8]",children:i.jsx(hi,{title:"Follower Wallet",sortKey:"wallet_address",sortOption:ye,setSortOption:ve,isFilterIcon:!1})}),i.jsx("th",{scope:"col",className:"min-w-[110px] sm:min-w-[110px] px-1 hidden sm:table-cell",children:i.jsx(hi,{title:"Creation Date",sortKey:"wallet_created_data",sortOption:ye,setSortOption:ve,isFilterIcon:!1})}),i.jsx("th",{scope:"col",className:"min-w-[330px] sm:min-w-[330px] pl-1 pr-4 hidden sm:table-cell",children:i.jsx("div",{className:"font-medium flex items-center justify-start w-full min-w-max",children:i.jsx("div",{className:"flex items-center justify-end w-full"})})})]})}),i.jsx("tbody",{children:!e||t?i.jsx("tr",{className:"text-center w-full h-full",children:i.jsx("td",{colSpan:lt(window.innerWidth),children:i.jsx("div",{className:"fixed top-1/3 left-1/2 transform -translate-x-1/2 -translate-y-1/2 z-10 min-h-[30vh] flex flex-col justify-center items-center",children:i.jsx(Da,{})})})}):n&&!e?i.jsx("tr",{className:"text-center w-full h-full",children:i.jsx("td",{colSpan:lt(window.innerWidth),children:i.jsx("div",{className:"flex min-h-[30vh] flex-col justify-center items-center top-[7%] lg:top-[10%] left-[20%] sm:left-[40%] lg:left-[50%] 2xl:left-[45%] z-10",children:i.jsx(zl,{})})})}):(e==null?void 0:e.length)==0?i.jsx("tr",{className:"text-center w-full h-full",children:i.jsx("td",{colSpan:lt(window.innerWidth),children:i.jsx("div",{className:"flex min-h-[30vh] flex-col justify-center items-center top-[7%] lg:top-[15%] left-[20%] sm:left-[40%] lg:left-[50%] 2xl:left-[45%] z-10",children:i.jsx("div",{className:"flex items-center justify-center gap-4 px-4 py-2 flex-col",children:i.jsxs("div",{className:"flex flex-col justify-center items-center gap-3 ml-1 sm:-ml-16",children:[i.jsx("img",{src:ac,alt:""}),i.jsxs("div",{className:"flex flex-col items-center h-max gap-3",children:[i.jsx("div",{className:"text-[#d3d3d3] text-sm font-semibold font-manrope leading-[8px] pt-3",children:"You have not created a wallet yet."}),i.jsxs("div",{className:"text-center -mt-2",children:[i.jsxs("span",{className:"text-[#979797] text-[13px] font-normal font-manrope leading-[14px] tracking-wide",children:["Please use the"," "]}),i.jsx("span",{className:"text-white text-[13px] font-normal font-manrope leading-[14px] tracking-wide",children:"'Add Account'"}),i.jsxs("span",{className:"text-[#979797] text-[13px] font-normal font-manrope leading-[14px] tracking-wide",children:[" ","button to create a wallet."]})]})]})]})})})})}):(Ft=je(ye))==null?void 0:Ft.map((Ke,Bt)=>{!isNaN(Ke==null?void 0:Ke.perpEquity)&&!isNaN(Ke==null?void 0:Ke.marginUsed)&&(Ke==null?void 0:Ke.perpEquity)-(Ke==null?void 0:Ke.marginUsed);const $t=nn?{onClick:()=>cn(Ke),className:"cursor-pointer"}:{};return i.jsxs("tr",{...$t,className:`${Bt%2===0,"bg-[#161616]"} relative group hover:bg-[#222222] h-[44px] border-b border-[#232323] text-white`,children:[i.jsx("td",{scope:"row",className:`${Bt%2==0,"bg-[#161616]"} sm:sticky sm:left-0 z-[2] group-hover:bg-[#222222]`,children:i.jsx("div",{className:"group-hover:bg-[#222222] flex justify-start items-center gap-2 pl-2 h-[44px] max-h-[44px] ",children:(Ke==null?void 0:Ke.version)==3?i.jsx(mi,{content:"This is an API wallet created from your login wallet. It enables copy trading without withdrawal permissions, keeping your funds safe.",children:i.jsxs("div",{className:"flex justify-start items-center has-tooltip relative",children:[i.jsx("div",{className:"text-sm font-semibold font-manrope leading-none flex items-center justify-start pl-1 gap-0.5 min-w-max",children:(Ke==null?void 0:Ke.wallet_name.length)>=12?(Ke==null?void 0:Ke.wallet_name).slice(0,12)+"... (API-AGENT) Wallet":(Ke==null?void 0:Ke.wallet_name)+"(API-AGENT) Wallet"}),(Ke==null?void 0:Ke.wallet_name.length)>=12&&i.jsx("span",{className:"ml-3",children:i.jsx(Fa,{content:`${Ke==null?void 0:Ke.wallet_name}`,positionTop:!0,alignRight:!1})}),i.jsx(Ni,{className:"text-[#7C7C7C] w-4 min-w-4 min-h-4 h-4 ml-1"})]})}):i.jsxs("div",{className:"flex justify-start items-center has-tooltip relative",children:[i.jsx("div",{className:"text-sm font-semibold font-manrope leading-none flex items-center justify-start pl-1 gap-0.5",children:(Ke==null?void 0:Ke.wallet_name.length)>=12?(Ke==null?void 0:Ke.wallet_name).slice(0,12)+"...":Ke==null?void 0:Ke.wallet_name}),(Ke==null?void 0:Ke.wallet_name.length)>=12&&i.jsx("span",{className:"ml-3",children:i.jsx(Fa,{content:`${Ke==null?void 0:Ke.wallet_name}`,positionTop:!0,alignRight:!1})})]})})}),i.jsx("td",{scope:"row",className:`${Bt%2===0,"bg-[#161616]"} sm:sticky sm:left-[140px] z-[2] group-hover:bg-[#222222]`,children:i.jsx("div",{className:"group-hover:bg-[#222222] flex justify-start items-center gap-4 min-h-[44px] max-h-[44px]",children:i.jsxs("div",{onClick:()=>{window.open(`/wallet-details/${Ke==null?void 0:Ke.wallet_address}`,"_blank")},className:"group-hover:bg-[#222222] flex justify-start items-center gap-2 h-[44px] max-h-[44px] cursor-pointer",children:[i.jsx("div",{className:"fle justify-center items-center",children:i.jsx("div",{className:"w-4 h-4 sm:w-6 sm:h-6 bg-[#4a4a4a] rounded-full",children:i.jsx("img",{src:Gi,alt:"",className:"w-4 h-4 sm:w-6 sm:h-6"})})}),i.jsxs("div",{className:"flex justify-start items-center gap-1.5",children:[i.jsx(aa,{info1:`${(Ke==null?void 0:Ke.wallet_address).slice(0,5)+"..."+(Ke==null?void 0:Ke.wallet_address).slice(-4)}`,info1_Color:"text-white",rowTwo:!1}),i.jsx("img",{onClick:qe=>{qe.stopPropagation(),navigator.clipboard.writeText(Ke==null?void 0:Ke.wallet_address),rn.success("Successfully copied.",{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(103, 255, 189, 0.16)",width:"280px",minWidth:"280px",height:"40px",backdropFilter:"blur(16px)"},iconTheme:{primary:"#67FFBD",secondary:"#276047"}})},src:wo,alt:"",className:"cursor-pointer"})]})]})})}),i.jsx("td",{className:"hidden sm:table-cell",children:i.jsx("div",{className:"flex flex-col items-start gap-0.5",children:i.jsx("div",{className:"text-sm font-semibold font-manrope leading-none flex items-center justify-start pl-1 gap-0.5",children:(Ke==null?void 0:Ke.wallet_created_data)&&p3(Ke==null?void 0:Ke.wallet_created_data)})})}),i.jsx("td",{className:"hidden sm:table-cell",children:i.jsxs("div",{className:"flex items-center justify-end gap-2 pr-3",children:[i.jsx(mi,{content:"Deposits are currently unavailable.",children:i.jsxs("div",{className:"w-[91px] h-[26px] px-2 py-1.5 rounded-md border border-[#353535] justify-center items-center gap-2 hidden sm:inline-flex opacity-80",children:[i.jsx(xy,{className:"text-[#848484] w-[14px] h-[14px] rotate-180"}),i.jsx("div",{className:"text-white text-[11px] font-semibold font-manrope leading-[8px] tracking-tight opacity-60",children:"Deposit"})]})}),i.jsx(mi,{content:"Withdrawals are currently unavailable.",children:i.jsxs("div",{className:"w-[91px] h-[26px] px-2 py-1.5 rounded-md border border-[#353535] justify-center items-center gap-2 hidden sm:inline-flex opacity-80",children:[i.jsx(xy,{className:"text-[#848484] w-[14px] h-[14px]"}),i.jsx("div",{className:"text-white text-[11px] font-semibold font-manrope leading-[8px] tracking-tight opacity-60",children:"Withdraw"})]})}),Y[`${Ke==null?void 0:Ke.wallet_id}_${Ke==null?void 0:Ke.wallet_name.toLowerCase()}`]?i.jsxs("div",{role:"status",className:"flex justify-center items-center h-5 min-h-5 w-[90px] px-2 py-1.5 rounded-md",children:[i.jsxs("svg",{"aria-hidden":"true",className:"inline w-4 h-4 text-gray-200 animate-spin dark:text-gray-600 fill-[#67FFBD]",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),i.jsx("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]}),i.jsx("span",{className:"sr-only",children:"Loading..."})]}):(Ke==null?void 0:Ke.version)===3?i.jsx(mi,{content:"API wallets cannot be deleted here. To remove this wallet, please delete it from the Hyperliquid API page.",children:i.jsx("div",{className:"w-[91px] h-[26px] px-2 py-1.5 rounded-md border border-[#353535] justify-center items-center gap-2 hidden sm:inline-flex opacity-80",children:i.jsx("div",{className:"text-white text-[11px] font-semibold font-manrope leading-[8px] tracking-tight opacity-60",children:"Delete"})})}):i.jsx("div",{onClick:()=>{ee({wallet:Ke==null?void 0:Ke.wallet_address,walletId:Ke==null?void 0:Ke.wallet_id,walletName:Ke==null?void 0:Ke.wallet_name.toLowerCase(),unrealizedPnL:Ke==null?void 0:Ke.unrealizedPnl,perpEquity:Ke==null?void 0:Ke.perpEquity}),G(!0)},className:"w-[91px] h-[26px] px-2 py-1.5 rounded-md border border-[#353535] justify-center items-center gap-2 hidden sm:inline-flex cursor-pointer",children:i.jsx("div",{className:"text-white text-[11px] font-semibold font-manrope leading-[8px] tracking-tight",children:"Delete"})})]})})]},Bt)})})]})})]}),i.jsxs("div",{className:`flex justify-start items-center gap-2 absolute top-[10px] sm:top-6 right-1 sm:translate-x-0 sm:right-2
`,children:[i.jsx("button",{onClick:()=>a(s-1),disabled:s===1,className:`${s===1?"cursor-not-allowed":"cursor-pointer"} h-8 px-2 sm:px-4 py-3 rounded-xl shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-white justify-center items-center gap-2.5 inline-flex bg-transparent`,children:i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px]",children:"Previous"})}),i.jsxs("div",{className:"text-white text-[14px] font-medium font-inter leading-[8px] w-20 sm:w-auto text-center",children:["Page ",s," / ",Math.ceil(o.length/P)]}),i.jsx("button",{onClick:()=>a(s+1),disabled:s*P>=o.length,className:`${s*P>=o.length?"cursor-not-allowed":"cursor-pointer"} h-8 px-2 sm:px-4 py-3 rounded-xl shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-white justify-center items-center gap-2.5 inline-flex bg-transparent`,children:i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px]",children:"Next"})})]})]})]})},XY=({title:e,label:t,handleSelectMenuChange:n,isSelectMenu:r,walletLength:s})=>i.jsxs("div",{onClick:()=>n(e),className:`${r==e?"bg-[#67ffbd]/20 text-[#67FFBD]":"bg-transparent text-[#9b9b9b]"} ${e==="HYPER"?"gap-1":e==="LIGHTER"?"gap-0.5":"gap-1"} text-[13px] font-medium font-manrope leading-[8px] cursor-pointer flex justify-center items-center min-w-max rounded-md px-[6px] sm:px-[10px] h-[22px]`,children:[e==="HYPER"?i.jsx("img",{src:dx,alt:"hyper",className:"w-4 h-4 rounded-sm"}):e==="LIGHTER"?i.jsx(Xf,{className:"w-4 h-4 text-[#fff]"}):e==="EXTENDED"?i.jsx("img",{src:"https://app.extended.exchange/assets/logo/extended.svg",alt:"Extended",className:"h-[20px] text-white -ml-0.5"}):null,`${t} (${(s==null?void 0:s.length)>0?"⚡"+(s==null?void 0:s.length)+" wallet":"🔌 Not Connected"}) `]}),San=({isSelectMenu:e,setIsSelectMenu:t,hyperWallet:n,lighterWallet:r,extendedWallet:s,fetchAllWalletList:a})=>{const{isConnected:o,address:l}=ns(),{setSignModalOpen:c,hyperToken:u}=m.useContext(Qr),[d,f]=m.useState([]),[x,g]=m.useState(!1),[v,w]=m.useState(null),[C,N]=m.useState(!0);m.useState(null);const[P,I]=m.useState([]),[R,F]=m.useState(()=>parseInt(localStorage.getItem("walletManagementExtendedPage"))||1),U=5,[L,z]=m.useState(!1),[Q,ne]=m.useState(!1);m.useEffect(()=>{window.localStorage.getItem("hyperToken")?J():(c(!0),f([]),window.localStorage.setItem("walletManagementExtendedPage",1))},[o,u]);const J=async()=>{var pe,Y;try{g(!0);const ie=window.localStorage.getItem("hyperToken");if(!ie){c(!0);return}const oe="https://dextrabothypev2.nftinit.io/api/wallet/list-extended",G=window.localStorage.getItem("hyperAddress"),ee=await(await fetch(oe,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:l?l.toLowerCase():G,token:ie})})).json();if(ee.success&&((pe=ee==null?void 0:ee.data)==null?void 0:pe.length)>0){a(),I(ee.data||[]),z(!0);const ae=parseInt(localStorage.getItem("walletManagementExtendedPage"))||1,fe=Math.max(Math.ceil(((ee==null?void 0:ee.data)||[]).length/U),1),Ne=Math.min(ae,fe);F(Ne),localStorage.setItem("walletManagementExtendedPage",Ne),X(Ne,ee.data||[]);const he=(Ne-1)*U,ge=(Y=ee.data)==null?void 0:Y[he];g(!1)}else console.log(ee.error_message),g(!1),w(ee.error_message),f([])}catch(ie){console.error("Error fetching lighter wallet list:",ie),g(!1),w(ie.message)}};m.useEffect(()=>{const pe=()=>{const Y=parseInt(localStorage.getItem("walletManagementExtendedPage"))||1;Y!==R&&L&&Q&&(F(Y),X(Y,P))};return window.addEventListener("storage",pe),()=>{window.removeEventListener("storage",pe)}},[R,P,L,Q]);const X=(pe,Y)=>{if(!Y||Y.length===0){g(!1);return}g(!0);const ie=(pe-1)*U,oe=ie+U,G=Y.slice(ie,oe);f(G)},re=pe=>{pe<1||pe>Math.ceil(P.length/U)||(g(!0),F(pe),localStorage.setItem("walletManagementExtendedPage",pe),X(pe,P))};return i.jsx(i.Fragment,{children:i.jsx(Can,{data:d,loading:x,error:v,socketLoading:C,handlePageChange:re,handleListRequest:J,currentPage:R,allWallets:P,isSelectMenu:e,setIsSelectMenu:t,hyperWallet:n,lighterWallet:r,extendedWallet:s})})},Nan="wss://api.hyperliquid.xyz/ws",Aan=()=>{const e=oc(),{isConnected:t,address:n}=ns(),{setSignModalOpen:r,hyperToken:s,setTelegramChatId:a,setSubscriberRole:o,setSubsExpireDay:l,setMushboomerETH:c,setMushboomerSOL:u,setIsReferralCode:d,setIsReferralCodeName:f,setIsWhitelist:x,setHyperToken:g,setHyperAddress:v}=m.useContext(Qr),w=m.useRef(null),C=m.useRef(null),N=m.useRef(null),[P,I]=m.useState([]),[R,F]=m.useState(!1),[U,L]=m.useState(null),[z,Q]=m.useState(!0),[ne,J]=m.useState("null");m.useEffect(()=>{const $e=e.hash;if($e){const it=$e.split("#").filter(Boolean);it[0]==="hyperliquid"?(J("HYPER"),localStorage.setItem("isWalletSelectMenu","HYPER")):it[0]==="lighter"?(J("LIGHTER"),localStorage.setItem("isWalletSelectMenu","LIGHTER")):it[0]==="extended"?(J("EXTENDED"),localStorage.setItem("isWalletSelectMenu","EXTENDED")):(window.history.replaceState(null,"",`${window.location.pathname}#hyperliquid`),J("HYPER"),localStorage.setItem("isWalletSelectMenu","HYPER"))}else window.history.replaceState(null,"",`${window.location.pathname}#hyperliquid`),J("HYPER"),localStorage.setItem("isWalletSelectMenu","HYPER")},[e.hash]);const[X,re]=m.useState([]),[pe,Y]=m.useState([]),[ie,oe]=m.useState([]),[G,V]=m.useState(()=>parseInt(localStorage.getItem("walletManagementPage"))||1),ee=5,[ae,fe]=m.useState(!1);m.useEffect(()=>{window.localStorage.getItem("hyperToken")?(Ne(),he(),ge()):(r(!0),I([]),window.localStorage.setItem("walletManagementPage",1))},[t,s]);const Ne=async()=>{try{F(!0);const $e=window.localStorage.getItem("hyperToken");if(!$e){r(!0);return}const it="https://dextrabothypev2.nftinit.io/api/wallet/list",tt=window.localStorage.getItem("hyperAddress"),ft=await(await fetch(it,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:n?n.toLowerCase():tt,token:$e,balance:"false"})})).json();if(ft.success){oe(ft.data||[]),fe(!0);const ut=parseInt(localStorage.getItem("walletManagementPage"))||1,qt=Math.max(Math.ceil(((ft==null?void 0:ft.data)||[]).length/ee),1),It=Math.min(ut,qt);V(It),localStorage.setItem("walletManagementPage",It),Le(It,ft.data||[])}else console.log(ft.error_message),F(!1),L(ft.error_message)}catch($e){console.error("Error fetching wallet list:",$e),F(!1),L($e.message)}},he=async()=>{try{F(!0);const $e=window.localStorage.getItem("hyperToken");if(!$e){r(!0);return}const it="https://dextrabothypev2.nftinit.io/api/wallet/list-lighter",tt=window.localStorage.getItem("hyperAddress"),ft=await(await fetch(it,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:n?n.toLowerCase():tt,token:$e})})).json();ft.success&&re(ft.data||[])}catch($e){console.error("Error fetching wallet list:",$e)}},ge=async()=>{try{F(!0);const $e=window.localStorage.getItem("hyperToken");if(!$e){r(!0);return}const it="https://dextrabothypev2.nftinit.io/api/wallet/list-extended",tt=window.localStorage.getItem("hyperAddress"),ft=await(await fetch(it,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:n?n.toLowerCase():tt,token:$e})})).json();ft.success&&Y(ft.data||[])}catch($e){console.error("Error fetching wallet list:",$e)}},ye=$e=>$e!=null&&$e.assetPositions?$e.assetPositions.filter(it=>{if(!it.position||!it.position.szi)return!1;const tt=parseFloat(it.position.szi);return!isNaN(tt)&&tt!==0}).map(it=>{const tt=it.position,lt=parseFloat(tt.szi),ft=parseFloat(tt.entryPx),ut=parseFloat(tt.positionValue),qt=parseFloat(tt.unrealizedPnl),It=parseFloat(tt.returnOnEquity)*100,nn=parseFloat(tt.marginUsed),jt=tt.leverage.value,cn=tt.leverage.type,un=parseFloat(tt.cumFunding.sinceOpen),Ft=lt>0?"Long":"Short";return{asset:tt.coin,type:Ft,size:lt,entryPrice:ft.toFixed(4),currentPrice:(ut/Math.abs(lt)).toFixed(4),leverage:jt,leverageType:cn,positionValue:ut.toFixed(2),marginUsed:nn.toFixed(2),unrealizedPnl:qt.toFixed(2),roe:It.toFixed(2),funding:un.toFixed(4),liquidationPrice:tt.liquidationPx?parseFloat(tt.liquidationPx).toFixed(2):"N/A"}}):[],ve=()=>{w.current&&(console.log("Closing WebSocket connection..."),w.current.readyState===WebSocket.OPEN&&w.current.send(JSON.stringify({method:"unsubscribe",subscription:{type:"webData2"}})),w.current.close(),w.current=null),N.current&&(clearInterval(N.current),N.current=null),C.current&&(clearTimeout(C.current),C.current=null)},je=$e=>{w.current=new WebSocket(Nan),w.current.onopen=()=>{console.log("WebSocket Connected"),$e.forEach(it=>{let tt={method:"subscribe",subscription:{type:"webData2",user:it==null?void 0:it.wallet_address}};w.current.send(JSON.stringify(tt))}),N.current=setInterval(()=>{var it;if(((it=w.current)==null?void 0:it.readyState)===WebSocket.OPEN){const tt={id:99,method:"ping"};w.current.send(JSON.stringify(tt))}},3e4)},w.current.onclose=it=>{console.log("WebSocket Disconnected",it.code,it.reason),N.current&&(clearInterval(N.current),N.current=null),it.code!==1e3&&(C.current||(C.current=setTimeout(()=>{C.current=null,je($e)},5e3)))},w.current.onerror=it=>{console.error("WebSocket Error:",it)},w.current.onmessage=it=>{try{const tt=JSON.parse(it.data);if(tt.method==="pong")return;if(tt.result==="success"){console.log("Successfully subscribed to channel");return}tt.channel==="webData2"&&Ie(tt)}catch(tt){console.error("Error processing WebSocket message:",tt),console.error("Raw message that caused error:",it.data),Q(!1)}}},Ie=$e=>{I(it=>{let tt=!1;const lt=it.map(ft=>{var ut,qt,It,nn,jt,cn,un,Ft,Ke,Bt,$t,qe,Ye;if((ft==null?void 0:ft.wallet_address.toLowerCase())===((ut=$e==null?void 0:$e.data)==null?void 0:ut.user.toLowerCase())){const ht=(nn=(It=(qt=$e==null?void 0:$e.data)==null?void 0:qt.clearinghouseState)==null?void 0:It.assetPositions)==null?void 0:nn.reduce((Et,nt)=>{var Ue;return Et+(parseFloat((Ue=nt==null?void 0:nt.position)==null?void 0:Ue.unrealizedPnl)||0)},0),Zt=ye((jt=$e==null?void 0:$e.data)==null?void 0:jt.clearinghouseState),zt={...ft,perpEquity:(Ft=(un=(cn=$e==null?void 0:$e.data)==null?void 0:cn.clearinghouseState)==null?void 0:un.marginSummary)==null?void 0:Ft.accountValue,unrealizedPnl:ht,withdrawableUsdc:(Bt=(Ke=$e==null?void 0:$e.data)==null?void 0:Ke.clearinghouseState)==null?void 0:Bt.withdrawable,marginUsed:(Ye=(qe=($t=$e==null?void 0:$e.data)==null?void 0:$t.clearinghouseState)==null?void 0:qe.marginSummary)==null?void 0:Ye.totalMarginUsed,positions:Zt};if(JSON.stringify(ft)!==JSON.stringify(zt))return tt=!0,zt}return ft});return tt?lt:it}),setTimeout(()=>{F(!1),Q(!1)},3e3)};m.useEffect(()=>{const $e=()=>{const it=parseInt(localStorage.getItem("walletManagementPage"))||1;it!==G&&ae&&(ve(),V(it),Le(it,ie))};return window.addEventListener("storage",$e),()=>{window.removeEventListener("storage",$e)}},[G,ie,ae]);const Le=($e,it)=>{if(!it||it.length===0){F(!1);return}F(!0);const tt=($e-1)*ee,lt=tt+ee,ft=it.slice(tt,lt);I(ft),ve(),je(ft)},Qe=$e=>{$e<1||$e>Math.ceil(ie.length/ee)||(F(!0),V($e),localStorage.setItem("walletManagementPage",$e),Le($e,ie))};return m.useEffect(()=>()=>{ve()},[e.pathname]),m.useEffect(()=>{(async()=>{var lt,ft;const it=window.localStorage.getItem("hyperToken"),tt=window.localStorage.getItem("hyperAddress");if(!(!it||!tt))try{const ut=await Ei(tt.toLowerCase(),it);ut!=null&&ut.success?(a(ut==null?void 0:ut.telegram_chat_id),o(ut==null?void 0:ut.subscriber_role),l(ut==null?void 0:ut.subs_expire_day),c((lt=ut==null?void 0:ut.mushboomer_counts)==null?void 0:lt.eth),u((ft=ut==null?void 0:ut.mushboomer_counts)==null?void 0:ft.sol),d(ut==null?void 0:ut.referral_code),f(ut==null?void 0:ut.refcode),x(ut==null?void 0:ut.whitelist)):(window.localStorage.removeItem("hyperToken"),window.localStorage.removeItem("hyperAddress"),g(""),v(""))}catch(ut){console.error("Token verification error:",ut),console.error(ut.message||"An unknown error occurred.")}})()},[]),i.jsxs(i.Fragment,{children:[i.jsx(So,{children:i.jsxs(Ro,{children:[i.jsx("title",{children:"Wallet Management | Create & Fund Trading Wallets | Dextrabot"}),i.jsx("meta",{name:"description",content:"Create, fund, and manage your follower wallets on Dextrabot. Start copy trading today."}),i.jsx("meta",{name:"og:title",content:"Wallet Management | Create & Fund Trading Wallets | Dextrabot"}),i.jsx("meta",{name:"og:description",content:"Create, fund, and manage your follower wallets on Dextrabot. Start copy trading today."}),i.jsx("meta",{name:"og:image",content:"https://app.dextrabot.com/dextrabotIcon.png"}),i.jsx("meta",{name:"og:url",content:"https://app.dextrabot.com/wallet-management"})]})}),i.jsx("div",{style:{height:"calc(100vh - 5rem)"},className:"flex justify-center items-center w-full h-auto px-1 pt-1 sm:px-6 sm:pt-2 bg-[#161616] overflow-scroll",children:i.jsx("div",{className:"flex flex-col items-stretch justify-start h-full gap-[26px] w-full flex-grow xl:flex-grow-0",children:ne==="HYPER"?i.jsxs(i.Fragment,{children:[i.jsx(pan,{data:P,loading:R,error:U,socketLoading:z,handlePageChange:Qe,handleListRequest:Ne,currentPage:G,allWallets:ie,lighterWallet:X,extendedWallet:pe,isSelectMenu:ne,setIsSelectMenu:J}),i.jsx(man,{data:P,loading:R,error:U,socketLoading:z,handlePageChange:Qe,currentPage:G,allWallets:ie})]}):ne==="LIGHTER"?i.jsx(i.Fragment,{children:i.jsx(wan,{isSelectMenu:ne,setIsSelectMenu:J,hyperWallet:ie,lighterWallet:X,extendedWallet:pe,lighterWalletList:he})}):i.jsx(i.Fragment,{children:i.jsx(San,{isSelectMenu:ne,setIsSelectMenu:J,hyperWallet:ie,lighterWallet:X,extendedWallet:pe,fetchAllWalletList:ge})})})})]})};function jan({open:e,setOpen:t,copyTradeDelete:n,isDeleteWallet:r}){return i.jsxs(Ea,{open:e,onClose:t,className:"relative z-50 font-manrope",children:[i.jsx(ja,{transition:!0,style:{backgroundColor:"rgba(0, 0, 0, 0.48)"},className:"fixed inset-0 transition-opacity data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in"}),i.jsx("div",{className:"fixed inset-0 z-50 w-screen overflow-y-auto",children:i.jsx("div",{className:"flex min-h-full items-end justify-center p-4 text-center sm:items-center sm:p-0",children:i.jsx(xa,{transition:!0,className:"relative transform overflow-hidden bg-[#101010] text-left shadow-xl transition-all data-[closed]:translate-y-4 data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in data-[closed]:sm:translate-y-0 data-[closed]:sm:scale-95 rounded-3xl",children:i.jsx("div",{className:"flex flex-col justify-start items-center gap-8 w-[400px] h-max relative bg-[#252525] rounded-3xl pt-4 pb-6",children:i.jsxs(i.Fragment,{children:[i.jsx("div",{onClick:()=>{t(!1)},className:"cursor-pointer flex w-full items-center justify-end absolute right-2 top-1",children:i.jsx("span",{className:"absolute top-2 right-2 w-9 h-9 rounded-full p-1 flex justify-center items-center hover:bg-[#7535FE]",children:i.jsx("img",{className:"p-1",src:Ba})})}),i.jsx("div",{className:"pt-4",children:i.jsx("img",{src:Gi,alt:"",className:"w-[86px h-[86px]"})}),i.jsxs("div",{className:"flex flex-col justify-start items-center gap-2",children:[i.jsx("div",{className:"w-80 text-center text-white text-2xl font-semibold font-manropeleading-7",children:"Confirm Delete"}),i.jsx("div",{className:"w-[348px] text-center text-white/60 text-[16px] font-medium font-manrope leading-5",children:"Are you sure you want to delete this copy trade task? This action cannot be undone."})]}),i.jsxs("div",{className:"flex items-center justify-center gap-4",children:[i.jsx("div",{onClick:()=>{t(!1)},className:"h-8 px-4 py-3 rounded-xl shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-white justify-center items-center gap-2.5 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px]",children:"Cancel"})}),i.jsx("div",{onClick:()=>{n(r.followerWallet,r.sourceWallet,r.platform,r.id)},className:"h-8 px-2.5 bg-[#7445ff] rounded-[10px] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-[#8860ff] justify-center items-center gap-1.5 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px]",children:"Delete"})})]})]})})})})})]})}const eze=({open:e=!1,setOpen:t=()=>{},checkAccountCopy:n,roleType:r="farming"})=>{const{setSignModalOpen:s,setTelegramChatId:a,setSubscriberRole:o,setSubsExpireDay:l,setMushboomerETH:c,setMushboomerSOL:u,setIsReferralCode:d,setIsReferralCodeName:f,setIsWhitelist:x,setHyperToken:g,setHyperAddress:v}=m.useContext(Qr),{address:w}=ns(),[C,N]=m.useState(!1),[P,I]=m.useState(!1),[R,F]=m.useState(""),[U,L]=m.useState(""),[z,Q]=m.useState(""),ne=async()=>{var ie,oe;const pe=window.localStorage.getItem("hyperToken"),Y=window.localStorage.getItem("hyperAddress");if(!(!pe||!Y))try{setLoadingCheckAccount(!0);const G=await Ei(Y.toLowerCase(),pe);G!=null&&G.success?(a(G==null?void 0:G.telegram_chat_id),o(G==null?void 0:G.subscriber_role),l(G==null?void 0:G.subs_expire_day),c((ie=G==null?void 0:G.mushboomer_counts)==null?void 0:ie.eth),u((oe=G==null?void 0:G.mushboomer_counts)==null?void 0:oe.sol),d(G==null?void 0:G.referral_code),f(G==null?void 0:G.refcode),x(G==null?void 0:G.whitelist),g(pe),v(Y),Q(G==null?void 0:G.farming_tools),setLoadingCheckAccount(!1)):(window.localStorage.removeItem("hyperToken"),window.localStorage.removeItem("hyperAddress"),g(""),v(""),setLoadingCheckAccount(!1))}catch(G){console.error("Token verification error:",G),console.error(G.message||"An unknown error occurred."),setLoadingCheckAccount(!1)}},J=async()=>new Sl(window.ethereum).eth.getAccounts(Y=>Y),X=async(pe="farming",Y=24,ie=5e3)=>{Y<=0||(await new Promise(oe=>setTimeout(oe,ie)),await ne(),pe==="farming"&&!z?X(pe,Y-1,ie):n())},re=async()=>{L("");const pe=window.localStorage.getItem("hyperToken"),Y=window.localStorage.getItem("hyperAddress");if(!pe||!w){s(!0);return}I(!0),N(!0);try{await window.ethereum.request({method:"wallet_switchEthereumChain",params:[{chainId:"0x1"}]})}catch(G){console.error("Failed to switch network",G),N(!1);return}const ie=new Sl(window.ethereum);var oe=await J();if(oe.length>0?oe=oe[0]:oe=void 0,oe){const V={from:oe,to:"0xdEAe8586eD227A5096EBae47342fFc1ED99f13F9",value:"120000000000000000"};await ie.eth.sendTransaction(V).then(ee=>{console.log("txHash :>> ",ee),N(!1),F(ee.transactionHash),fetch("https://dextrabothypev2.nftinit.io/api/hyper/payment/save/",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:w?w.toLowerCase():Y,token:pe,payment_tx:ee.transactionHash,payment_role:r==="bots_extra_slot"?"bots_extra_slot":"farming_tools"})}),ne(),X(r)}).catch(ee=>{console.log(ee),ee.code===-32003||ee.message.includes("insufficient funds")?L("Insufficient funds."):ee.message==="MetaMask Tx Signature: User denied transaction signature."&&I(!1)})}else await ie.eth.requestAccounts()};return i.jsxs(i.Fragment,{children:[i.jsx(bd,{open:P,setOpen:I,transactionHash:R,transactionLoading:C,paymentPresaleRole:z,errorFunds:U,activeMethod:2}),i.jsxs("div",{className:"fixed inset-0 z-[51] flex items-center justify-center",children:[i.jsx("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-[2px]",onClick:()=>t(!1)}),i.jsx("div",{className:"relative w-[380px] max-w-[92vw] rounded-3xl bg-[#1B1B1B] text-white shadow-xl border border-[#404040] max-h-[97dvh] overflow-y-auto p-5",children:i.jsxs("div",{className:"flex flex-col w-full gap-8 py-6",children:[i.jsx("div",{className:"mx-auto",children:i.jsx("img",{src:_A,alt:""})}),i.jsx("div",{className:"flex justify-center items-center",children:i.jsx("div",{className:"text-lg font-semibold",children:"Copy Trade"})}),i.jsx("div",{className:"text-center text-[#bdbdbd] text-sm px-6 leading-5 -mt-6",children:"You don't have an active subscription yet. Subscribe now to unlock trading bots, copy trading, and farming tools across multiple DEXs."}),i.jsx("div",{onClick:()=>{re()},className:"flex items-center justify-center h-8 px-6 rounded-[10px] text-[13px] border bg-[#7446FF] border-[#8861FF] hover:bg-[#5834C3] cursor-pointer min-w-max font-semibold",children:"Subscribe / 0.12 ETH"})]})})]})]})},Ean=({loading:e,error:t,trackerData:n,isRequest:r,handleCopyDelete:s,deleteLoading:a,isDeleteModalOpen:o,setIsDeleteModalOpen:l,isDeleteWallet:c,setIsDeleteWallet:u,slotTotalCount:d,checkSlotAccount:f,slotCountWallets:x,subsRole:g,slotCount:v})=>{const{trackedWatchList:w,setSignModalOpen:C}=m.useContext(Qr),{isConnected:N,address:P}=ns(),[I,R]=m.useState(!1),[F,U]=m.useState(null),[L,z]=m.useState(""),[Q,ne]=m.useState(""),[J,X]=m.useState([]),[re,pe]=m.useState(!1),[Y,ie]=m.useState({}),[oe,G]=m.useState({}),[V,ee]=m.useState([]),[ae,fe]=m.useState([]),[Ne,he]=m.useState(null),[ge,ye]=m.useState(!1),[ve,je]=m.useState(!1),[Ie,Le]=m.useState(!1),[Qe,$e]=m.useState([]),it=m.useRef(null),[tt,lt]=m.useState([]),ft=m.useRef(!1);m.useEffect(()=>{const Ue={};n==null||n.forEach(Rt=>{const We=`${Rt==null?void 0:Rt.wm_address}_${Rt==null?void 0:Rt.wallet_address}_${Rt==null?void 0:Rt.wallet_id}`;Ue[We]=Rt==null?void 0:Rt.copy_trait_mode}),ie(Ue),!ft.current&&(n==null?void 0:n.length)>0&&(qt(),ft.current=!0)},[n]),m.useEffect(()=>{if((n==null?void 0:n.length)>0){const Ue=[...n];(V==null?void 0:V.length)>0&&V.forEach(Rt=>{var We;((We=Rt.openPositionCoinList)==null?void 0:We.length)>0&&Rt.generated_wallet_public&&!Ue.some(at=>at.wallet_address.toLowerCase()===Rt.generated_wallet_public.toLowerCase())&&Ue.push({wallet_address:Rt.generated_wallet_public})}),fe(Rt=>{const We=Rt.map(mt=>mt.wallet_address).sort().join(","),at=Ue.map(mt=>mt.wallet_address).sort().join(",");return We!==at?Ue:Rt})}},[n,V]);const ut=async(Ue,Rt,We,at,mt)=>{const Dt=`${Ue}_${Rt}_${mt}`;try{const Tt=window.localStorage.getItem("hyperToken"),dn="https://dextrabothypev2.nftinit.io/api/test_app/following/status/";Tt||C(!0),G(kn=>({...kn,[Dt]:!0}));const on=window.localStorage.getItem("hyperAddress"),Nn=await(await fetch(dn,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:P?P.toLowerCase():on,token:Tt,follow_address:Rt==null?void 0:Rt.toLowerCase(),copy_trait_mode:We,target_platform:at,wallet_id:mt})})).json();Nn.success?(ie(kn=>({...kn,[Dt]:We})),f()):(console.log(Nn.error_message),rn.error(Nn.error_message))}catch(Tt){console.error("Error status mode:",Tt),rn.error(Tt.message||"Something went wrong!")}finally{G(Tt=>({...Tt,[Dt]:!1}))}},qt=async()=>{try{const Ue=window.localStorage.getItem("hyperToken"),Rt=window.localStorage.getItem("hyperAddress"),We="https://dextrabothypev2.nftinit.io/api/wallet/generated_wallet_summary";Ue||C(!0);const at=await fetch(We,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:P?P.toLowerCase():Rt,token:Ue})});if(!at.ok)throw new zl(`Server responded with status ${at.status}`);const mt=await at.json();mt.success?ee(mt.data):(console.log(mt.error_message),rn.error(mt.error_message))}catch(Ue){console.error("Error in like function:",Ue),rn.error(Ue.message||"Something went wrong!")}},It="tag",[nn,jt]=m.useState(It),cn=(Ue,Rt,We,at)=>Ue!=null&&Ue.length?[...Ue].sort((mt,Dt)=>{var Xn,or,lr,Qt;if(!Y||Object.keys(Y).length===0)return 0;const Tt=`${mt.wm_address}_${mt.wallet_address}_${mt.wallet_id}`,dn=`${Dt.wm_address}_${Dt.wallet_address}_${Dt.wallet_id}`;if(Y!=null&&Y[Tt]&&!(Y!=null&&Y[dn]))return-1;if(!(Y!=null&&Y[Tt])&&(Y!=null&&Y[dn]))return 1;const on=We.find(zn=>zn.wallet_address===mt.wallet_address)||{},gn=We.find(zn=>zn.wallet_address===Dt.wallet_address)||{},Nn=We.find(zn=>{var Jn,Lt;return((Jn=zn.wallet_address)==null?void 0:Jn.toLowerCase())===((Lt=mt==null?void 0:mt.wm_address)==null?void 0:Lt.toLowerCase())})||{},kn=We.find(zn=>{var Jn,Lt;return((Jn=zn.wallet_address)==null?void 0:Jn.toLowerCase())===((Lt=Dt==null?void 0:Dt.wm_address)==null?void 0:Lt.toLowerCase())})||{},yn=on.data?on.data.reduce((zn,Jn)=>zn+parseFloat(Jn.unrealizedPnl||0),0):0,Vn=gn.data?gn.data.reduce((zn,Jn)=>zn+parseFloat(Jn.unrealizedPnl||0),0):0,Gn=at==null?void 0:at.find(zn=>{var Jn,Lt,jn,Ee;return((Jn=zn==null?void 0:zn.generated_wallet_public)==null?void 0:Jn.toLowerCase())===((Lt=mt==null?void 0:mt.wm_address)==null?void 0:Lt.toLowerCase())&&((jn=zn==null?void 0:zn.copy_trader_wallet)==null?void 0:jn.toLowerCase())===((Ee=mt==null?void 0:mt.wallet_address)==null?void 0:Ee.toLowerCase())}),Dn=at==null?void 0:at.find(zn=>{var Jn,Lt,jn,Ee;return((Jn=zn==null?void 0:zn.generated_wallet_public)==null?void 0:Jn.toLowerCase())===((Lt=Dt==null?void 0:Dt.wm_address)==null?void 0:Lt.toLowerCase())&&((jn=zn==null?void 0:zn.copy_trader_wallet)==null?void 0:jn.toLowerCase())===((Ee=Dt==null?void 0:Dt.wallet_address)==null?void 0:Ee.toLowerCase())}),Kn=Gn?Gn.total_pnl:0,Cn=Dn?Dn.total_pnl:0,sn=Gn&&((Xn=Gn.openPositionCoinList)==null?void 0:Xn.length)>0&&((or=Nn.data)==null?void 0:or.length)>0?Gn.openPositionCoinList.reduce((zn,Jn)=>{const Lt=Nn.data.find(jn=>jn.asset===Jn);return Lt!=null&&Lt.unrealizedPnl?zn+parseFloat(Lt.unrealizedPnl):zn},0):0,Me=Dn&&((lr=Dn.openPositionCoinList)==null?void 0:lr.length)>0&&((Qt=kn.data)==null?void 0:Qt.length)>0?Dn.openPositionCoinList.reduce((zn,Jn)=>{const Lt=kn.data.find(jn=>jn.asset===Jn);return Lt!=null&&Lt.unrealizedPnl?zn+parseFloat(Lt.unrealizedPnl):zn},0):0,en=mt.tag?mt.tag.toUpperCase():"",an=Dt.tag?Dt.tag.toUpperCase():"",Nt=mt.wm_name?mt.wm_name.toUpperCase():"",Yn=Dt.wm_name?Dt.wm_name.toUpperCase():"",xn=mt.wallet_address?mt.wallet_address.toLowerCase():"",Mt=Dt.wallet_address?Dt.wallet_address.toLowerCase():"",tn=mt.wm_address?mt.wm_address.toLowerCase():"",In=Dt.wm_address?Dt.wm_address.toLowerCase():"";return Rt==="tag"?en<an?-1:en>an?1:0:Rt==="-tag"?en>an?-1:en<an?1:0:Rt==="-wallet_address"?xn<Mt?-1:xn>Mt?1:0:Rt==="wallet_address"?xn>Mt?-1:xn<Mt?1:0:Rt==="-wm_address"?tn<In?-1:tn>In?1:0:Rt==="wm_address"?tn>In?-1:tn<In?1:0:Rt==="perp_equity"?(on.perp_equity||0)-(gn.perp_equity||0):Rt==="-perp_equity"?(gn.perp_equity||0)-(on.perp_equity||0):Rt==="margin_usage"?(on.margin_usage||0)-(gn.margin_usage||0):Rt==="-margin_usage"?(gn.margin_usage||0)-(on.margin_usage||0):Rt==="unrealizedPnl"?yn-Vn:Rt==="-unrealizedPnl"?Vn-yn:Rt==="-wm_name"?Nt<Yn?-1:Nt>Yn?1:0:Rt==="wm_name"?Nt>Yn?-1:Nt<Yn?1:0:Rt==="total_pnl"?Kn-Cn:Rt==="-total_pnl"?Cn-Kn:Rt==="totalUnrealizedPnl"?sn-Me:Rt==="-totalUnrealizedPnl"?Me-sn:Rt==="-created_at"?new Date(Dt.created_at)-new Date(mt.created_at):Rt==="created_at"?new Date(mt.created_at)-new Date(Dt.created_at):0}):[];m.useEffect(()=>{if(!(n!=null&&n.length))return;const Ue=n.filter(Rt=>!!(!(Qe!=null&&Qe.length)||Qe.includes("HyperLiquid")&&Rt.target_platform==="hyper"||Qe.includes("Lighter")&&Rt.target_platform==="lighter"));lt(cn(Ue,nn,J,V))},[nn,n,Qe]);const un=async(Ue,Rt)=>{try{z(Ue),ne(Rt);const We=window.localStorage.getItem("hyperToken"),at=window.localStorage.getItem("hyperAddress"),mt="https://dextrabothypev2.nftinit.io/api/test_app/following/info/";We||C(!0);const Dt=await fetch(mt,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:P?P.toLowerCase():at,token:We,follow_address:Ue.toLowerCase()})});if(!Dt.ok)throw new zl(`Server responded with status ${Dt.status}`);const Tt=await Dt.json();Tt.success?(U(Array.isArray(Tt==null?void 0:Tt.data)?[...Tt.data].sort((dn,on)=>new Date(on.created_at||0)-new Date(dn.created_at||0)):Tt==null?void 0:Tt.data),R(!0)):(console.log(Tt.error_message),rn.error(Tt.error_message))}catch(We){console.error("Error in like function:",We),rn.error(We.message||"Something went wrong!")}},Ft=Ue=>Ue!=null&&Ue.assetPositions?Ue.assetPositions.filter(Rt=>{if(!Rt.position||!Rt.position.szi)return!1;const We=parseFloat(Rt.position.szi);return!isNaN(We)&&We!==0}).map(Rt=>{const We=Rt.position,at=parseFloat(We.szi),mt=parseFloat(We.entryPx),Dt=parseFloat(We.positionValue),Tt=parseFloat(We.unrealizedPnl),dn=parseFloat(We.returnOnEquity)*100,on=parseFloat(We.marginUsed),gn=We.leverage.value,Nn=parseFloat(We.cumFunding.sinceOpen),kn=at>0?"Long":"Short";return{asset:We.coin,type:kn,size:Math.abs(at),entryPrice:mt.toFixed(2),currentPrice:(Dt/Math.abs(at)).toFixed(2),leverage:gn,positionValue:Dt.toFixed(2),marginUsed:on.toFixed(2),unrealizedPnl:Tt.toFixed(2),roe:dn.toFixed(2),funding:Nn.toFixed(4),liquidationPrice:We.liquidationPx?parseFloat(We.liquidationPx).toFixed(2):"N/A"}}):[],Ke=async Ue=>{try{const We=await fs.post("https://api-ui.hyperliquid.xyz/info",{type:"clearinghouseState",user:Ue});if(We.data){const at=Ft(We.data);X(mt=>{var Dt,Tt,dn,on;return[...mt,{wallet_address:Ue,perp_equity:(Tt=(Dt=We==null?void 0:We.data)==null?void 0:Dt.marginSummary)==null?void 0:Tt.accountValue,margin_usage:parseFloat((dn=We==null?void 0:We.data)==null?void 0:dn.marginSummary.totalMarginUsed)/parseFloat((on=We==null?void 0:We.data)==null?void 0:on.marginSummary.accountValue),data:at}]})}}catch(Rt){console.error("Error fetching user state from HyperState:",Rt)}},Bt=async Ue=>{try{const Rt=window.localStorage.getItem("hyperToken"),We=window.localStorage.getItem("hyperAddress"),mt=await fetch("https://dextrabothypev2.nftinit.io/api/hyper/trade/getclearinghousestate/",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:P?P.toLowerCase():We,token:Rt,follow_address:Ue.toLowerCase()})});if(mt.ok){const Dt=await mt.json();if(Dt.success){const Tt=Ft(Dt==null?void 0:Dt.data);X(dn=>{var on;return[...dn,{wallet_address:Ue,perp_equity:(on=Dt==null?void 0:Dt.data.marginSummary)==null?void 0:on.accountValue,margin_usage:parseFloat(Dt==null?void 0:Dt.data.marginSummary.totalMarginUsed)/parseFloat(Dt==null?void 0:Dt.data.marginSummary.accountValue),data:Tt}]})}}else if(mt.status===500)console.warn(`Received 500 error for ${Ue}, retrying with getUserHyperState`),await Ke(Ue);else throw new zl(`Request failed with status ${mt.status}`)}catch(Rt){console.error("Error fetching user state:",Rt)}},$t=m.useRef(new Set);m.useEffect(()=>{!e&&r&&(ae==null?void 0:ae.length)>0&&(async()=>{var We;const Rt=new Set;for(let at=0;at<ae.length;at++){const mt=ae[at],Dt=(We=mt==null?void 0:mt.wallet_address)==null?void 0:We.toLowerCase();if(!(!Dt||$t.current.has(Dt))){Rt.add(Dt),$t.current.add(Dt);try{await Bt(Dt)}catch(Tt){console.error(`Error fetching user state for wallet ${Dt}:`,Tt)}await new Promise(Tt=>setTimeout(Tt,500))}}})()},[r,e,ae]),m.useEffect(()=>{I||f()},[I]);const qe=m.useRef(null),Ye=()=>{qe.current&&(qe.current.scrollLeft-=100)},ht=()=>{qe.current&&(qe.current.scrollLeft+=100)},Zt=()=>{qe.current&&(qe.current.scrollTop+=200)},zt=()=>{qe.current&&(qe.current.scrollTop-=200)},Et=["HyperLiquid","Lighter"],nt=Ue=>{$e(Rt=>Rt.includes(Ue)?Rt.filter(We=>We!==Ue):[...Rt,Ue])};return m.useEffect(()=>{function Ue(Rt){it.current&&!it.current.contains(Rt.target)&&Le(!1)}return document.addEventListener("mousedown",Ue),()=>document.removeEventListener("mousedown",Ue)},[]),i.jsxs(i.Fragment,{children:[i.jsx(w5,{open:I,setOpen:R,copyTradeData:F,copyTradeWallet:L,setCopyTradeWallet:z,setCopyTradeData:U,sourcePage:Q}),i.jsx(jan,{open:o,setOpen:l,copyTradeDelete:s,isDeleteWallet:c}),ge&&Na.createPortal(i.jsx(Ele,{open:ge,setOpen:ye,oldSlotCount:Ne,checkAccountTrade:f,tradeMarket:"copyTrade"}),document.body),ve&&Na.createPortal(i.jsx(eze,{open:ve,setOpen:je,checkAccountCopy:f}),document.body),i.jsxs("div",{className:"flex flex-col items-stretch justify-start gap-[17px] text-white bg-[#161616] w-full h-full font-manrope",children:[i.jsxs("div",{className:"flex flex-col items-start justify-start gap-2 font-manrope max-w-full w-full bg-[#161616] pl-2 sm:pl-0 pt-4",children:[i.jsx("div",{className:"text-[#7e7e7e] text-[11px] font-medium font-inter leading-[8px]",children:"Hype / Explore"}),i.jsx("div",{className:"flex items-center justify-start gap-4",children:i.jsx("div",{className:"text-white text-lg font-medium font-manrope leading-[21px]",children:"Copy Trade"})})]}),i.jsxs("div",{className:"relative w-full h-full",children:[i.jsxs("div",{className:"absolute hidden -top-6 right-4 z-10 lg:flex justify-start items-center gap-2",children:[i.jsx("button",{onClick:Ye,className:"bg-[#353535] hover:bg-gray-600 text-white p-1 rounded-lg focus:outline-none focus:ring-0 border-none block",children:i.jsx("span",{className:"w-6 h-6",children:i.jsx(Xa,{className:"text-gray-300 w-4 h-4 rotate-90"})})}),i.jsx("button",{onClick:ht,className:"bg-[#353535] hover:bg-gray-600 text-white p-1 rounded-lg focus:outline-none focus:ring-0 border-none block",children:i.jsx("span",{className:"w-6 h-6",children:i.jsx(Xa,{className:"text-gray-300 w-4 h-4 -rotate-90"})})}),i.jsx("button",{onClick:zt,className:"bg-[#353535] hover:bg-gray-600 text-white p-1 rounded-lg focus:outline-none focus:ring-0 border-none",children:i.jsx("span",{className:"w-6 h-6",children:i.jsx(Xa,{className:"text-gray-300 w-4 h-4 -rotate-180"})})}),i.jsx("button",{onClick:Zt,className:"bg-[#353535] hover:bg-gray-600 text-white p-1 rounded-lg focus:outline-none focus:ring-0 border-none",children:i.jsx("span",{className:"w-6 h-6",children:i.jsx(Xa,{className:"text-gray-300 w-4 h-4 "})})})]}),i.jsx("div",{className:"w-full h-full overflow-x-scroll relative overflow-y-scroll flex-grow",ref:qe,children:i.jsxs("table",{className:"w-full relative mb-20",children:[i.jsx("thead",{className:"sticky top-0 z-[3] bg-[#161616] whitespace-nowrap",children:i.jsxs("tr",{className:"w-full z-[4] text-[#9b9b9b] text-[13px] font-semibold font-manrope leading-[13px] tracking-tight",children:[i.jsx("th",{scope:"col",className:"font-medium sm:sticky bg-[#161616] sm:left-0 h-8 pl-3 min-w-[95px] sm:min-w-[95px] z-[8]",children:i.jsx("div",{className:"flex items-center justify-start w-full min-w-max sticky left-0 h-8",children:i.jsx("div",{className:"flex items-center justify-start",children:"Status"})})}),i.jsx("th",{scope:"col",className:"font-medium sm:sticky bg-[#161616] left-[95px] h-8 px-1 min-w-[130px] z-[8]",children:i.jsx("div",{className:"flex items-center justify-start w-full min-w-max sticky left-0 h-8",children:i.jsx("div",{className:"flex items-center justify-start",children:"Actions"})})}),i.jsx("th",{scope:"col",className:"font-medium sm:sticky bg-[#161616] left-[225px] h-8 px-1 min-w-[75px] z-[8]",children:i.jsxs("div",{className:"flex items-center justify-start w-full min-w-max sticky left-0 h-8",children:[i.jsx("div",{className:"flex items-center justify-start",children:"DEX"}),i.jsxs("div",{className:"flex items-center justify-start",children:[i.jsx("button",{onClick:()=>{Le(!Ie)},className:`${Qe.length>0?"bg-gray-900":"bg-[#555555]"} ml-2 inline-flex items-center p-1 rounded hover:bg-gray-700 focus:outline-none focus:ring-0 border-none`,children:i.jsx($f,{className:`w-4 h-4 ${Qe.length>0?"text-blue-500":"text-white"}`})}),Ie&&i.jsxs("div",{ref:it,className:`absolute left-[58px] mt-32 w-[208px]
bg-[#222] border border-gray-700 rounded shadow-lg p-2 z-10`,children:[i.jsxs("div",{className:"flex justify-between items-center px-2 pb-2 border-b border-gray-600",children:[i.jsx("span",{className:"text-white text-sm font-semibold",children:"Filter"}),i.jsx("div",{onClick:()=>$e(""),className:"h-5 px-2 py-1.5 bg-[#3d3d3d] rounded-md justify-start items-center gap-2 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-[#cdcdcd] text-[11px] font-semibold font-manrope leading-[8px] pointer-events-none",children:"Clear All"})})]}),Et==null?void 0:Et.map(Ue=>i.jsxs("label",{className:"flex items-center gap-2 p-[7px] h-6 relative rounded hover:bg-[#464646] cursor-pointer text-white text-[13px] font-semibold font-manrope leading-[8px] mt-2",children:[i.jsx("input",{type:"checkbox",checked:Qe.includes(Ue),onChange:()=>nt(Ue),className:"mr-2 bg-[#3b3b3b] hidden "}),i.jsx("div",{className:`w-4 h-4 max-w-4 max-h-4 flex items-center justify-center border ${Qe.includes(Ue)?"bg-[#3ec78c] border-[#3ec78c]":"border-[#9d9d9d]"} w-[18px] h-[18px] relative rounded border`,children:Qe.includes(Ue)&&i.jsx("img",{src:Yc,alt:"",className:"w-[8.50px] h-[5.66px] ml-[1px]"})}),Ue]},Ue))]})]})]})}),i.jsx("th",{scope:"col",className:"sm:sticky bg-[#161616] lg:left-[300px] h-10 px-1 min-w-[130px] z-[7]",children:i.jsx(hi,{title:"Follower Name",sortKey:"wm_name",sortOption:nn,setSortOption:jt,isFilterIcon:!1})}),i.jsx("th",{scope:"col",className:"bg-[#161616] h-10 px-1 min-w-[145px] z-[8]",children:i.jsx(hi,{title:"Follower Wallet",sortKey:"wm_address",sortOption:nn,setSortOption:jt,isFilterIcon:!1})}),i.jsx("th",{scope:"col",className:"bg-[#161616] h-10 px-1 min-w-[130px]",children:i.jsx(hi,{title:"Source Tag",sortKey:"tag",sortOption:nn,setSortOption:jt,isFilterIcon:!1})}),i.jsx("th",{scope:"col",className:"bg-[#161616] h-10 px-1 min-w-[140px] z-[8]",children:i.jsx(hi,{title:"Source Wallet",sortKey:"wallet_address",sortOption:nn,setSortOption:jt,isFilterIcon:!1})}),i.jsx("th",{scope:"col",className:"min-w-[110px] pl-1",children:i.jsx(hi,{title:"Follower PnL",sortKey:"total_pnl",sortOption:nn,setSortOption:jt,isFilterIcon:!0})}),i.jsx("th",{scope:"col",className:"min-w-[130px] pl-1",children:i.jsx(hi,{title:"Follower uPnL",sortKey:"totalUnrealizedPnl",sortOption:nn,setSortOption:jt,isFilterIcon:!0})}),i.jsx("th",{scope:"col",className:"min-w-[115px] sm:min-w-[115px] pl-1",children:i.jsx(hi,{title:"Perp Equity",sortKey:"perp_equity",sortOption:nn,setSortOption:jt,isFilterIcon:!0})}),i.jsx("th",{scope:"col",className:"min-w-[130px] sm:min-w-[130px] pl-1",children:i.jsx(hi,{title:"Margin Usage",sortKey:"margin_usage",sortOption:nn,setSortOption:jt,isFilterIcon:!0})}),i.jsx("th",{scope:"col",className:"min-w-[114px] sm:min-w-[114px] pl-1",children:i.jsx(hi,{title:"uPnL",sortKey:"unrealizedPnl",sortOption:nn,setSortOption:jt,isFilterIcon:!0})}),i.jsx("th",{scope:"col",className:"min-w-[124px] sm:min-w-[124px] pl-1",children:i.jsx(hi,{title:"Created Date",sortKey:"created_at",sortOption:nn,setSortOption:jt,isFilterIcon:!0})}),i.jsx("th",{scope:"col",className:"min-w-[100px] pl-1 pr-4",children:i.jsx("div",{className:"flex items-center justify-center gap-1 min-w-max font-manrope",children:i.jsx("div",{className:"cursor-pointer flex items-center justify-end group"})})})]})}),i.jsx("tbody",{children:!n||e?i.jsx("tr",{className:"text-center w-full h-full",children:i.jsx("td",{colSpan:12,children:i.jsx("div",{className:"flex min-h-[66vh] flex-col justify-center items-center -mt-16 ml-[45%] w-max",children:i.jsx(Da,{})})})}):t&&!n?i.jsx("tr",{className:"text-center w-full h-full",children:i.jsx("td",{colSpan:13,children:i.jsx("div",{className:"flex min-h-[66vh] flex-col justify-center items-center ml-[33%] w-max",children:i.jsx(zl,{})})})}):(n==null?void 0:n.length)==0?i.jsx("tr",{className:"text-center w-full h-full",children:i.jsx("td",{colSpan:13,children:i.jsx("div",{className:"flex min-h-[44vh] h-66 flex-col justify-center items-center ml-[33%] w-max",children:i.jsx("div",{className:"flex items-center justify-center gap-4 px-4 py-2 flex-col",children:i.jsxs("div",{className:"flex flex-col justify-center items-center gap-3 -ml-16",children:[i.jsx("img",{src:ac,alt:""}),i.jsxs("div",{className:"flex flex-col items-center h-max gap-3",children:[i.jsx("div",{className:"text-[#d3d3d3] text-sm font-semibold font-manrope leading-[8px] pt-3",children:"You haven't added a wallet to your copied wallet list yet."}),i.jsxs("div",{className:"text-center -mt-2",children:[i.jsxs("span",{className:"text-[#979797] text-[13px] font-normal font-manrope leading-[14px] tracking-wide",children:["To start copy trading, please visit the"," "]}),i.jsx("span",{className:"text-white text-[13px] font-normal font-manrope leading-[14px] tracking-wide",children:"'Discover Wallets'"}),i.jsxs("span",{className:"text-[#979797] text-[13px] font-normal font-manrope leading-[14px] tracking-wide",children:[" ","page."]})]})]})]})})})})}):tt==null?void 0:tt.map((Ue,Rt)=>{var on,gn,Nn,kn,yn;const We=J.find(Vn=>Vn.wallet_address===Ue.wallet_address),at=J.find(Vn=>Vn.wallet_address===(Ue==null?void 0:Ue.wm_address)),mt=V==null?void 0:V.find(Vn=>{var Gn,Dn,Kn,Cn;return((Gn=Vn==null?void 0:Vn.generated_wallet_public)==null?void 0:Gn.toLowerCase())===((Dn=Ue==null?void 0:Ue.wm_address)==null?void 0:Dn.toLowerCase())&&((Kn=Vn==null?void 0:Vn.copy_trader_wallet)==null?void 0:Kn.toLowerCase())===((Cn=Ue==null?void 0:Ue.wallet_address)==null?void 0:Cn.toLowerCase())}),Dt=mt?mt.total_pnl:null;let Tt=0;mt&&((on=mt==null?void 0:mt.openPositionCoinList)==null?void 0:on.length)>0&&((gn=at==null?void 0:at.data)==null?void 0:gn.length)>0&&((Nn=mt==null?void 0:mt.openPositionCoinList)==null||Nn.forEach(Vn=>{var Dn;const Gn=(Dn=at==null?void 0:at.data)==null?void 0:Dn.find(Kn=>{var Cn;return((Cn=Kn==null?void 0:Kn.asset)==null?void 0:Cn.toLowerCase().trim())===(Vn==null?void 0:Vn.toLowerCase().trim())});Gn&&(Gn!=null&&Gn.unrealizedPnl)&&(Tt+=parseFloat(Gn==null?void 0:Gn.unrealizedPnl))}));const dn=`${Ue.follower_wallet}_${Ue.wallet_address}_${Ue.wallet_id}`;return i.jsxs("tr",{className:`${Rt%2===0,"bg-[#161616]"} relative group hover:bg-[#222222] h-[56px] border-b border-[#232323] text-white`,children:[i.jsx("td",{scope:"row",className:`${Rt%2==0,"bg-[#161616]"} sm:sticky sm:left-0 z-[2] group-hover:bg-[#222222]`,children:(()=>{const Vn=x==null?void 0:x.includes(Ue.wallet_id),Gn=`${Ue==null?void 0:Ue.wm_address}_${Ue==null?void 0:Ue.wallet_address}_${Ue==null?void 0:Ue.wallet_id}`,Dn=d===0&&!Y[Gn]&&!Vn,Kn=g;return i.jsxs("div",{className:"group-hover:bg-[#222222] flex justify-start items-center gap-2.5 pl-2 h-14 max-h-14 relative",children:[i.jsxs("div",{className:"relative group/switch",children:[i.jsx(Eo,{checked:!!Y[Gn],onChange:()=>{if(!Kn&&(Ue==null?void 0:Ue.target_platform)==="lighter"){je(!0);return}if(Dn&&(Ue==null?void 0:Ue.target_platform)==="lighter"){he(v),ye(!0);return}ut(Ue==null?void 0:Ue.wm_address,Ue.wallet_address,!Y[Gn],Ue==null?void 0:Ue.target_platform,Ue==null?void 0:Ue.wallet_id)},disabled:oe[Gn],className:`${Y[Gn]?"bg-[#1DE674]":"bg-[#353535]"} ${oe[Gn]?"cursor-not-allowed":"cursor-pointer"} flex h-[18px] w-[28px] rounded-[256px] p-1 transition-colors`,children:i.jsx("span",{"aria-hidden":"true",className:`${Y[Gn]?"translate-x-1.5 bg-white":"-translate-x-[1px] bg-[#D5D5D5]"} inline-block size-[14px] -mt-[3px] rounded-full shadow-lg transition`})}),!Kn&&(Ue==null?void 0:Ue.target_platform)==="lighter"?i.jsx("div",{className:"absolute -left-1 translate-x-0 top-[-34px] px-2 py-1 text-xs rounded-md bg-[#353535] text-white whitespace-nowrap opacity-0 group-hover/switch:opacity-100 transition duration-200",children:"Subscribe"}):Dn&&(Ue==null?void 0:Ue.target_platform)==="lighter"&&i.jsx("div",{className:"absolute -left-1 translate-x-0 top-[-34px] px-2 py-1 text-xs rounded-md bg-[#353535] text-white whitespace-nowrap opacity-0 group-hover/switch:opacity-100 transition duration-200",children:"Get more slots"})]}),oe[Gn]?i.jsxs("div",{role:"status",className:"flex justify-center items-center h-5 min-h-5 w-[34px] px-0.5 py-1.5 rounded-md",children:[i.jsxs("svg",{"aria-hidden":"true",className:"inline w-4 h-4 text-gray-200 animate-spin dark:text-gray-600 fill-[#67FFBD]",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),i.jsx("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]}),i.jsx("span",{className:"sr-only",children:"Loading..."})]}):Y[Gn]?"On":"Off"]})})()}),i.jsx("td",{scope:"row",className:`${Rt%2==0,"bg-[#161616]"} sm:sticky left-[95px] z-[2] group-hover:bg-[#222222]`,children:i.jsx("div",{className:"group-hover:bg-[#222222] flex justify-start items-center gap-2 pl-0.5 h-14 max-h-14",children:i.jsxs("div",{className:"flex justify-start items-center gap-1.5",children:[i.jsx("div",{onClick:()=>{un(Ue==null?void 0:Ue.wallet_address,Ue==null?void 0:Ue.wallet_id)},className:`${n!=null&&n.some(Vn=>Vn.wallet_address===(Ue==null?void 0:Ue.wallet_address))?"bg-[#67ffbd] text-[#161616] font-semibold":"border border-[#67ffbd] bg-[#161616] text-[#67ffbd] hover:bg-[#67ffbd] hover:text-[#161616] font-bold"} h-[22px] rounded-[256px] justify-center items-center gap-1 inline-flex cursor-pointer text-xs font-['Manrope'] leading-[8px] tracking-tight px-2 min-w-max`,children:"Copy Trade"}),i.jsx(v5,{walletAddress:Ue==null?void 0:Ue.wallet_address,children:i.jsx("div",{className:"w-[18px] h-[18px] justify-center items-center flex cursor-pointer",children:w.some(Vn=>Vn.wallet_address===(Ue==null?void 0:Ue.wallet_address))?i.jsx("img",{src:o5,alt:"",className:"w-3.5 h-3.5 min-w-3.5 min-h-3.5"}):i.jsx("img",{src:NA,alt:"",className:"w-3.5 h-3.5 min-w-3.5 min-h-3.5"})})})]})})}),i.jsx("td",{scope:"row",className:`${Rt%2==0,"bg-[#161616]"} sm:sticky left-[225px] z-[2] group-hover:bg-[#222222]`,children:i.jsx("div",{className:"group-hover:bg-[#222222] flex justify-start items-center gap-2 pl-5 h-14 max-h-14",children:i.jsx("div",{className:"flex justify-start items-center gap-1.5",children:(Ue==null?void 0:Ue.target_platform)==="lighter"?i.jsx(mi,{content:"Lighter",children:i.jsx("div",{className:"flex justify-start items-center gap-1",children:i.jsx(Xf,{className:"w-4 h-4 text-[#fff]"})})}):(Ue==null?void 0:Ue.target_platform)==="hyper"?i.jsx("div",{className:"flex justify-start items-center gap-1",children:i.jsx(mi,{content:"Hyperliquid",children:i.jsx("div",{className:"flex justify-start items-center gap-1",children:i.jsx("img",{src:dx,alt:"",className:"w-4 h-4 text-[#fff]"})})})}):i.jsx("div",{className:"flex justify-start items-center gap-1",children:i.jsx(mi,{content:"Dextrabot",children:i.jsx("div",{className:"flex justify-start items-center gap-1",children:i.jsx("img",{src:Gi,alt:"",className:"w-4 h-4 text-[#fff]"})})})})})})}),i.jsx("td",{scope:"row",className:`${Rt%2===0,"bg-[#161616]"} sm:sticky lg:left-[300px] z-[1] group-hover:bg-[#222222]`,children:i.jsx("div",{className:"group-hover:bg-[#222222] flex justify-start items-center gap-4 min-h-[56px]",children:i.jsx("div",{className:"group-hover:bg-[#222222] flex justify-start items-center gap-2 h-16 max-h-16",children:i.jsxs("div",{className:"flex justify-start items-center gap-1.5 has-tooltip relative",children:[i.jsx(aa,{info1:Ue!=null&&Ue.wm_name?(Ue==null?void 0:Ue.wm_name.length)>=13?(Ue==null?void 0:Ue.wm_name).slice(0,13)+"...":Ue==null?void 0:Ue.wm_name:"--",info1_Color:"text-white",rowTwo:!1}),(Ue==null?void 0:Ue.wm_name)&&(Ue==null?void 0:Ue.wm_name.length)>=13&&i.jsx("span",{className:"-ml-[9px]",children:i.jsx(Fa,{content:`${Ue==null?void 0:Ue.wm_name}`,positionTop:!0,alignRight:!1})})]})})})}),i.jsx("td",{scope:"row",className:`${Rt%2===0,"bg-[#161616]"} z-[2] group-hover:bg-[#222222]`,children:i.jsx("div",{className:"group-hover:bg-[#222222] flex justify-start items-center gap-4 min-h-[56px]",children:i.jsx("div",{onClick:()=>{window.open(`/wallet-details/${Ue==null?void 0:Ue.wm_address}`,"_blank")},className:"cursor-pointer group-hover:bg-[#222222] flex justify-start items-center gap-2 h-16 max-h-16",children:i.jsxs("div",{className:"flex justify-start items-center gap-1.5",children:[i.jsx(aa,{info1:`${(Ue==null?void 0:Ue.wm_address).slice(0,5)+"..."+(Ue==null?void 0:Ue.wm_address).slice(-4)}`,info1_Color:"text-white",rowTwo:!1}),i.jsx("img",{onClick:Vn=>{Vn.stopPropagation(),navigator.clipboard.writeText(Ue==null?void 0:Ue.wm_address),rn.success("Successfully copied.",{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(103, 255, 189, 0.16)",width:"280px",minWidth:"280px",height:"40px",backdropFilter:"blur(16px)"},iconTheme:{primary:"#67FFBD",secondary:"#276047"}})},src:wo,alt:"",className:"cursor-pointer"})]})})})}),i.jsx("td",{scope:"row",className:`${Rt%2===0,"bg-[#161616]"} group-hover:bg-[#222222]`,children:i.jsx("div",{className:"group-hover:bg-[#222222] flex justify-start items-center gap-4 min-h-[56px]",children:i.jsx("div",{className:"group-hover:bg-[#222222] flex justify-start items-center gap-2 h-16 max-h-16",children:i.jsxs("div",{className:"flex justify-start items-center gap-1.5 has-tooltip relative",children:[i.jsx(aa,{info1:Ue!=null&&Ue.tag?(Ue==null?void 0:Ue.tag.length)>=10?(Ue==null?void 0:Ue.tag).slice(0,10)+"...":Ue==null?void 0:Ue.tag:"--",info1_Color:"text-white",rowTwo:!1}),(Ue==null?void 0:Ue.tag)&&(Ue==null?void 0:Ue.tag.length)>=10&&i.jsx("span",{className:"-ml-[9px]",children:i.jsx(Fa,{content:`${Ue==null?void 0:Ue.tag}`,positionTop:!0,alignRight:!1})})]})})})}),i.jsx("td",{scope:"row",className:`${Rt%2===0,"bg-[#161616]"} group-hover:bg-[#222222]`,children:i.jsx("div",{className:"group-hover:bg-[#222222] flex justify-start items-center gap-4 min-h-[56px]",children:i.jsx("div",{onClick:()=>{window.open(`/wallet-details/${Ue==null?void 0:Ue.wallet_address}`,"_blank")},className:"cursor-pointer group-hover:bg-[#222222] flex justify-start items-center gap-2 h-16 max-h-16",children:i.jsxs("div",{className:"flex justify-start items-center gap-1.5",children:[i.jsx(aa,{info1:`${(Ue==null?void 0:Ue.wallet_address).slice(0,5)+"..."+(Ue==null?void 0:Ue.wallet_address).slice(-4)}`,info1_Color:"text-white",rowTwo:!1}),i.jsx("img",{onClick:Vn=>{Vn.stopPropagation(),navigator.clipboard.writeText(Ue==null?void 0:Ue.wallet_address),rn.success("Successfully copied.",{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(103, 255, 189, 0.16)",width:"280px",minWidth:"280px",height:"40px",backdropFilter:"blur(16px)"},iconTheme:{primary:"#67FFBD",secondary:"#276047"}})},src:wo,alt:"",className:"cursor-pointer"})]})})})}),i.jsx("td",{children:i.jsx(Sh,{info:Dt!==null?`$${Er(Math.abs(Dt))}`:"--",textColor:`${Dt>=0?"text-[#4ae3b5]":"text-[#ff6b6b]"}`})}),i.jsx("td",{children:i.jsx(Sh,{info:mt?`$${Er(Math.abs(Tt))}`:"--",textColor:`${Tt>=0?"text-[#4ae3b5]":"text-[#ff6b6b]"}`})}),i.jsx("td",{children:re?i.jsx(Sh,{info:"Loading...",textColor:"text-white"}):We?i.jsx(Sh,{info:(We==null?void 0:We.perp_equity)!=0?`$${Er(We==null?void 0:We.perp_equity)}`:"$0",textColor:"text-white"}):i.jsx(Sh,{info:"Loading...",textColor:"text-white"})}),i.jsx("td",{children:re?i.jsx(Sh,{info:"Loading...",textColor:"text-white"}):We?i.jsx(Sh,{info:isNaN(We==null?void 0:We.margin_usage)?"0%":`${((We==null?void 0:We.margin_usage)*100).toFixed(2)}%`,textColor:"text-white"}):i.jsx(Sh,{info:"Loading...",textColor:"text-white"})}),i.jsx("td",{children:re?i.jsx(Sh,{info:"Loading...",textColor:"text-white"}):We?i.jsx(Sh,{info:(We==null?void 0:We.data)!=0?`$${Er(Math.abs((kn=We==null?void 0:We.data)==null?void 0:kn.reduce((Vn,Gn)=>Vn+parseFloat(Gn.unrealizedPnl||0),0)))}`:"$0",textColor:`${((yn=We==null?void 0:We.data)==null?void 0:yn.reduce((Vn,Gn)=>Vn+parseFloat(Gn.unrealizedPnl),0))>=0?"text-[#4ae3b5]":"text-[#ff6b6b]"}`}):i.jsx(Sh,{info:"Loading...",textColor:"text-white"})}),i.jsx("td",{children:i.jsx(Sh,{info:(Ue==null?void 0:Ue.created_at)&&p3(Ue==null?void 0:Ue.created_at),textColor:"text-white"})}),i.jsx("td",{className:"pr-4",children:i.jsx("div",{className:"pl-1 flex flex-col items-end gap-2 font-manrope",children:a[dn]?i.jsxs("div",{role:"status",className:"flex justify-center items-center h-5 min-h-5 w-[54px] px-2 py-1.5 rounded-md",children:[i.jsxs("svg",{"aria-hidden":"true",className:"inline w-4 h-4 text-gray-200 animate-spin dark:text-gray-600 fill-[#67FFBD]",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),i.jsx("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]}),i.jsx("span",{className:"sr-only",children:"Loading..."})]}):i.jsx("div",{onClick:()=>{u({followerWallet:Ue==null?void 0:Ue.wm_address,sourceWallet:Ue==null?void 0:Ue.wallet_address,platform:Ue==null?void 0:Ue.target_platform,id:Ue==null?void 0:Ue.wallet_id}),l(!0)},className:"h-5 px-2 py-1.5 rounded-md border border-white justify-start items-center gap-2 inline-flex",children:i.jsx("div",{className:"text-white text-[11px] font-semibold font-manrope leading-[8px] tracking-tight cursor-pointer",children:"Delete"})})})})]},Rt)})})]})})]})]})]})},Sh=({info:e,textColor:t})=>i.jsx("div",{className:"flex flex-col items-end gap-0.5",children:i.jsx("div",{className:`${t} text-sm font-semibold font-manrope leading-none flex items-center justify-start pl-1 gap-0.5`,children:e})}),_an=()=>{const[e,t]=m.useState(!1),[n,r]=m.useState(!1),{isConnected:s,address:a}=ns(),{copyTradeWatchList:o,getCopyTradeWatchList:l,trackedWatchList:c,getTrackedWatchList:u,copyWatchListLoading:d,copyWatchListError:f,setTelegramChatId:x,setSubscriberRole:g,setSubsExpireDay:v,setMushboomerETH:w,setIsWhitelist:C,setMushboomerSOL:N,setIsReferralCode:P,setIsReferralCodeName:I,setHyperToken:R,setHyperAddress:F,hyperToken:U}=m.useContext(Qr),[L,z]=m.useState({}),[Q,ne]=m.useState(!1),[J,X]=m.useState({followerWallet:"",sourceWallet:"",platform:"",id:null}),[re,pe]=m.useState(0),[Y,ie]=m.useState([]),[oe,G]=m.useState(""),[V,ee]=m.useState(0);m.useEffect(()=>{U&&(l(),u(),t(!0),r(!0))},[U]);const ae=async()=>{var ye,ve,je,Ie;const he=window.localStorage.getItem("hyperToken"),ge=window.localStorage.getItem("hyperAddress");if(!(!he||!ge))try{const Le=await Ei(ge.toLowerCase(),he);Le!=null&&Le.success?(x(Le==null?void 0:Le.telegram_chat_id),g(Le==null?void 0:Le.subscriber_role),v(Le==null?void 0:Le.subs_expire_day),w((ye=Le==null?void 0:Le.mushboomer_counts)==null?void 0:ye.eth),N((ve=Le==null?void 0:Le.mushboomer_counts)==null?void 0:ve.sol),P(Le==null?void 0:Le.referral_code),I(Le==null?void 0:Le.refcode),C(Le==null?void 0:Le.whitelist),pe((je=Le==null?void 0:Le.copy_trade_slots_info)==null?void 0:je.total_slot_count),ie(Le==null?void 0:Le.copy_trade_slots_wallets),G(Le==null?void 0:Le.farming_tools),ee((Ie=Le==null?void 0:Le.copy_trade_slots_info)==null?void 0:Ie.extra_slot_count)):(window.localStorage.removeItem("hyperToken"),window.localStorage.removeItem("hyperAddress"),R(""),F(""))}catch(Le){console.error("Token verification error:",Le)}};m.useEffect(()=>{ae()},[]);const fe=async(he,ge,ye,ve)=>{const je=`${he}_${ge}_${ve}`;try{const Ie=window.localStorage.getItem("hyperToken"),Le="https://dextrabothypev2.nftinit.io/api/test_app/following/unfollow/";if(!Ie||!ge||!ye||!ve||!he)throw new Error("Required information is missing. Please log in or connect your wallet.");z(tt=>({...tt,[je]:!0}));const Qe=window.localStorage.getItem("hyperAddress"),$e=await fetch(Le,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:a?a.toLowerCase():Qe,token:Ie,follow_address:ge.toLowerCase(),target_platform:ye,wallet_id:ve})});if(!$e.ok)throw new Error(`Failed to unlike: ${$e.status} ${$e.statusText}`);const it=await $e.json();it.success?(z(tt=>({...tt,[je]:!1})),l(),ne(!1),X({followerWallet:"",sourceWallet:"",platform:"",id:null}),ae(),rn.success(`${ge==null?void 0:ge.slice(0,5)}...${ge==null?void 0:ge.slice(-3)} removed from watchlist`,{style:{border:"1px solid #22c55e",padding:"16px",color:"#fff",borderRadius:"999px",background:"#14532d",height:"60px"},iconTheme:{primary:"#22c55e",secondary:"#FFFAEE"}})):(rn.error(it.error_message),z(tt=>({...tt,[je]:!1})),ne(!1))}catch(Ie){rn.error(Ie.message||"Something went wrong!"),z(Le=>({...Le,[je]:!1})),ne(!1)}},Ne=!!window.localStorage.getItem("hyperToken");return i.jsxs(i.Fragment,{children:[i.jsx(So,{children:i.jsx(Ro,{children:Ne?i.jsxs(i.Fragment,{children:[i.jsx("title",{children:"Copy Trade on Hyperliquid | Mirror Top Traders with Dextrabot"}),i.jsx("meta",{name:"description",content:"Automatically copy trade top-performing Hyperliquid traders with customizable risk parameters. Set position sizing, stop-loss levels, and take-profit targets with Dextrabot's copy trade system."}),i.jsx("meta",{property:"og:title",content:"Copy Trade on Hyperliquid | Mirror Top Traders with Dextrabot"}),i.jsx("meta",{property:"og:description",content:"Automatically copy trade top-performing Hyperliquid traders with customizable risk parameters. Set position sizing, stop-loss levels, and take-profit targets with Dextrabot's copy trade system."}),i.jsx("meta",{property:"og:image",content:"https://app.dextrabot.com/dextrabotIcon.png"}),i.jsx("meta",{property:"og:url",content:"https://app.dextrabot.com/copy-trade"})]}):i.jsxs(i.Fragment,{children:[i.jsx("title",{children:"Dextrabot Copy Trading | Automate Hyperliquid Trading with Top Performers"}),i.jsx("meta",{name:"description",content:"Replicate top Hyperliquid traders automatically with Dextrabot's advanced copy trading system. Set custom risk parameters, position sizing, and selective token filtering for precise portfolio control."}),i.jsx("meta",{property:"og:title",content:"Dextrabot Copy Trading | Automate Hyperliquid Trading with Top Performers"}),i.jsx("meta",{property:"og:description",content:"Replicate top Hyperliquid traders automatically with Dextrabot's advanced copy trading system. Set custom risk parameters, position sizing, and selective token filtering for precise portfolio control."}),i.jsx("meta",{property:"og:image",content:"https://app.dextrabot.com/dextrabotIcon.png"}),i.jsx("meta",{property:"og:url",content:"https://app.dextrabot.com/copy-trade"})]})})}),i.jsx("div",{style:{height:"calc(100vh - 5rem)"},className:"flex justify-center items-center w-full h-full px-1 pt-1 sm:px-6 sm:pt-6 bg-[#161616] overflow-hidden",children:i.jsx("div",{className:"flex flex-col items-stretch justify-center h-full gap-[26px] w-full flex-grow xl:flex-grow-0",children:Ne?i.jsx(Ean,{loading:d,error:f,trackerData:o,isRequest:e,handleCopyDelete:fe,deleteLoading:L,isDeleteModalOpen:Q,setIsDeleteModalOpen:ne,isDeleteWallet:J,setIsDeleteWallet:X,slotTotalCount:re,checkSlotAccount:ae,slotCountWallets:Y,subsRole:oe,slotCount:V}):i.jsx("div",{className:"flex justify-center items-center w-full",children:i.jsx(fU,{})})})})]})},kan=({volumeLeaderboardData:e,userData:t,currentPage:n=1,rowsPerPage:r=25})=>{const[s,a]=m.useState([]),[o,l]=m.useState({key:null,direction:"asc"}),c=localStorage.getItem("hyperAddress");localStorage.getItem("hyperToken");const u=(t==null?void 0:t.refCode)||(t==null?void 0:t.refcode)||(typeof window<"u"?window.localStorage.getItem("refcode"):"")||"";m.useEffect(()=>{const x=c?c.toLowerCase():null,g=e.map(v=>{const w=v.out_subscriber_address?v.out_subscriber_address.toLowerCase():null,C=v.owner||x&&w===x;return{...v,owner:!!C,refCode:C&&u?u:v.refCode||v.refcode||null,referral_xp:v.referral_xp??v.calculated_xp??v.overall_point_result??0}});a(g)},[e,c,u]);const d=x=>{let v=["overall_point_result","referral_xp"].includes(x)?"desc":"asc";o.key===x&&(v=o.direction==="asc"?"desc":"asc");const w=[...s].sort((C,N)=>{const P=parseFloat(C[x])||0,I=parseFloat(N[x])||0;return P<I?v==="asc"?-1:1:P>I?v==="asc"?1:-1:0});a(w),l({key:x,direction:v})},f=x=>o.key!==x?i.jsx(F3,{className:"inline ml-2 text-white"}):o.direction==="asc"?i.jsx(P3,{className:"inline ml-2 text-white"}):i.jsx(I3,{className:"inline ml-2 text-white"});return i.jsx("div",{className:"overflow-x-auto mobile-scroll-indicator",children:i.jsxs("table",{className:"w-full text-white min-w-[900px]",children:[i.jsx("thead",{className:"text-left",children:i.jsxs("tr",{children:[i.jsxs("th",{className:"px-3 sm:px-6 py-3 sm:py-4 cursor-pointer flex items-center text-gray-300 font-semibold text-xs sm:text-sm",onClick:()=>d("ranking"),children:["# ",f("ranking")]}),i.jsx("th",{className:"px-3 sm:px-6 py-3 sm:py-4 text-gray-300 font-semibold text-xs sm:text-sm",children:"Wallet"}),i.jsxs("th",{className:"px-3 sm:px-6 py-3 sm:py-4 cursor-pointer text-gray-300 font-semibold text-xs sm:text-sm",onClick:()=>d("overall_point_result"),children:[i.jsx("span",{className:"hidden sm:inline",children:"XP"}),i.jsx("span",{className:"sm:hidden",children:"Points"})," ",f("overall_point_result")]}),i.jsxs("th",{className:"px-3 sm:px-6 py-3 sm:py-4 cursor-pointer text-gray-300 font-semibold text-xs sm:text-sm",onClick:()=>d("referral_xp"),children:[i.jsx("span",{className:"hidden sm:inline",children:"Referral XP"}),i.jsx("span",{className:"sm:hidden",children:"Ref XP"})," ",f("referral_xp")]})]})}),i.jsx("tbody",{children:s.slice((n-1)*r,n*r).map((x,g)=>{const v=(n-1)*r+g,w=v%2===0?"bg-[#1b1b1b]":"bg-[#1f1f1f]",C=x.owner?"bg-[#162720] ring-1 ring-emerald-400/30":"";return i.jsxs("tr",{className:`${w} ${C} group text-white transition-colors hover:bg-[#222222]`,children:[i.jsx("td",{className:"px-3 sm:px-6 py-3 sm:py-4",children:i.jsx("span",{className:"text-sm sm:text-lg font-bold",children:x.ranking||"Unranked"})}),i.jsx("td",{className:"px-3 sm:px-6 py-3 sm:py-4",children:i.jsxs("div",{className:"flex items-center gap-2 text-white",children:[i.jsx("span",{className:"font-mono text-xs sm:text-sm",children:KD(x.out_subscriber_address)}),x.owner&&i.jsx("span",{className:"text-[10px] uppercase tracking-wide text-[#67FFBD] bg-[#132822] border border-emerald-400/40 rounded-full px-2 py-0.5",children:"You"})]})}),i.jsx("td",{className:"px-3 sm:px-6 py-3 sm:py-4",children:i.jsx("span",{className:"text-xs sm:text-sm",children:Er(x.calculated_xp||0)})}),i.jsx("td",{className:"px-3 sm:px-6 py-3 sm:py-4",children:i.jsx("span",{className:"text-xs sm:text-sm",children:Er(x.referral_xp??x.calculated_xp??0)})})]},v)})})]})})},Tan=({pnlLeaderboardData:e,userData:t,currentPage:n=1,rowsPerPage:r=25})=>{var x,g,v,w;const[s,a]=m.useState([]),o=localStorage.getItem("hyperAddress"),l=localStorage.getItem("hyperToken"),[c,u]=m.useState({key:null,direction:"asc"});m.useEffect(()=>{a(e)},[e]);const d=C=>{let N="asc";c.key===C&&c.direction==="asc"&&(N="desc");const P=[...s].sort((I,R)=>{const F=parseFloat(I[C])||0,U=parseFloat(R[C])||0;return F<U?N==="asc"?-1:1:F>U?N==="asc"?1:-1:0});a(P),u({key:C,direction:N})},f=C=>c.key!==C?i.jsx(F3,{className:"inline ml-2 text-white"}):c.direction==="asc"?i.jsx(P3,{className:"inline ml-2 text-white"}):i.jsx(I3,{className:"inline ml-2 text-white"});return i.jsx("div",{className:"mx-auto w-full sm:w-4/6 overflow-x-auto shadow-lg mt-[24px] h-[100vh] overflow-auto rounded-xl bg-[#161616]",children:i.jsxs("table",{className:"table-fixed min-w-full text-white border-separate border-spacing-y-2 rounded-xl",children:[i.jsx("thead",{className:"text-left sticky -top-1 z-10",children:i.jsxs("tr",{className:"text-white font-manrope text-[14px] font-semibold leading-[13px] tracking-[0.26px] bg-[#161616]",children:[i.jsxs("th",{className:"px-4 py-3 cursor-pointer flex items-center",onClick:()=>d("ranked"),children:["# ",f("ranked")]}),i.jsx("th",{className:"px-4 py-3",children:"Wallet"}),i.jsxs("th",{className:"flex items-center px-4 py-3",children:[i.jsx("span",{className:"text-[#67FFBD] [text-shadow:0px_0px_8px_rgba(103,255,189,0.48)] font-manrope text-[14px] not-italic font-semibold leading-[32px] tracking-[0.56px]",children:"Booster"}),i.jsx("img",{src:tyt,alt:"Dextrabot"})]}),i.jsxs("th",{className:"px-4 py-3 cursor-pointer relative",onClick:()=>d("daily_point_result"),children:["Points 24h",f("daily_point_result")]}),i.jsxs("th",{className:"flex justify-end items-center px-4 py-3 cursor-pointer relative",onClick:()=>d("total_pnl"),children:[i.jsx("span",{className:"text-[#D65AFF] [text-shadow:0px_0px_8px_rgba(214,90,255,0.48)] font-manrope text-[14px] not-italic font-semibold leading-[32px] tracking-[0.56px]",children:"Total Points"}),i.jsx("img",{src:nyt,alt:"Dextrabot"}),f("total_pnl")]})]})}),i.jsxs("tbody",{className:"text-left",children:[o&&l&&t&&Object.keys(t).length>0?i.jsxs("tr",{className:"text-white font-manrope text-[14px] font-bold leading-[13px] tracking-[0.28px] bg-[#2D2D2D]",children:[i.jsx("td",{className:"h-[inherit] rounded-l-2xl p-0",children:i.jsx("div",{className:`min-w-[48px] w-fit px-2 h-12 flex items-center justify-center text-black font-bold text-[18px] first:rounded-tl-2xl first:rounded-bl-2xl ${t.ranked===1?"bg-[#67FFBD]":t.ranked===2?"bg-[#D65AFF]":t.ranked===3?"bg-[#36C9FF]":"bg-[#525252] text-white"}`,children:t.ranked||"Unranked"})}),i.jsx("td",{className:"px-4 py-3 font-semibold",children:i.jsx("div",{className:"flex justify-left items-center gap-2 cursor-pointer",children:i.jsx("span",{className:"w-[75px] text-[#67FFBD]",children:"You"})})}),i.jsx("td",{className:"px-4 py-3 font-bold flex items-center gap-2",children:i.jsxs("div",{className:"flex items-center gap-2 min-h-[24px]",children:[((x=t.mushInfo)==null?void 0:x.eth)>0&&i.jsxs("a",{href:"https://blur.io/eth/collection/mushboomers",target:"_blank",rel:"noopener noreferrer",className:"relative",children:[i.jsx("img",{src:Vme,className:"w-[24px] h-[24px] cursor-pointer",alt:"Mushboomers"}),i.jsx("span",{className:"absolute right-[-8px] top-[-8px] bg-[rgba(103,103,103,0.32)] backdrop-blur-[4px] text-white text-xs rounded-full px-1 flex items-center justify-center w-5 h-5 font-semibold font-manrope",children:t.mushInfo.eth})]}),((g=t.mushInfo)==null?void 0:g.sol)>0&&i.jsxs("a",{href:"https://www.tensor.trade/trade/mushboomers",target:"_blank",rel:"noopener noreferrer",className:"relative",children:[i.jsx("img",{src:Wme,className:"w-[24px] h-[24px] cursor-pointer",alt:"Mushboomers"}),i.jsx("span",{className:"absolute right-[-8px] top-[-8px] bg-[rgba(103,103,103,0.32)] backdrop-blur-[4px] text-white text-xs rounded-full px-1 flex items-center justify-center w-5 h-5 font-semibold font-manrope",children:t.mushInfo.sol})]}),((v=t.mushInfo)==null?void 0:v.eth)===0&&((w=t.mushInfo)==null?void 0:w.sol)===0&&i.jsx("div",{className:"w-[24px] h-[24px]"})]})}),i.jsx("td",{className:"px-4 py-3 font-semibold",children:Er(t.daily_point_result)}),i.jsx("td",{className:"px-4 py-3 font-semibold rounded-br-2xl rounded-tr-2xl text-right",children:Er(t.total_pnl)})]}):(o||l)&&(!t||Object.keys(t).length===0)?i.jsxs("tr",{className:"text-white font-manrope text-[14px] font-bold leading-[13px] tracking-[0.28px] bg-[#2D2D2D]",children:[i.jsx("td",{className:"h-[inherit] rounded-l-2xl p-0",children:i.jsx("div",{className:"bg-[#525252] min-w-[48px] w-fit px-2 h-12 flex items-center justify-center text-white font-bold text-[18px] first:rounded-tl-2xl first:rounded-bl-2xl font-manrope",children:"Unranked"})}),i.jsx("td",{className:"px-4 py-3 font-bold text-[#67FFBD]",children:"You"}),i.jsx("td",{className:"px-4 py-3 text-[#FFF] font-semibold",children:"-"}),i.jsx("td",{className:"px-4 py-3 font-bold flex items-center gap-2",children:"-"}),i.jsx("td",{className:"px-4 py-3 font-semibold rounded-br-2xl rounded-tr-2xl text-right",children:"-"})]}):null,s.slice((n-1)*r,n*r).map((C,N)=>{const P=(n-1)*r+N,I=P%2===0?"bg-[#1b1b1b]":"bg-[#1f1f1f]",R=C.owner?"bg-[#162720] ring-1 ring-emerald-400/30":"";return i.jsxs("tr",{className:`text-white h-[50px] font-manrope text-[14px] font-bold leading-[13px] tracking-[0.28px] ${I} ${R} group hover:bg-[#222222]`,children:[i.jsx("td",{className:"h-[inherit] rounded-l-2xl p-0",children:i.jsx("div",{className:`min-w-[48px] w-fit px-2 h-full flex items-center justify-center text-black font-bold text-[18px] first:rounded-tl-2xl first:rounded-bl-2xl ${C.ranked===1?"bg-[#67FFBD]":C.ranked===2?"bg-[#D65AFF]":C.ranked===3?"bg-[#36C9FF]":"bg-[#2D2D2D] text-white"}`,children:C.ranked||"Unranked"})}),i.jsx("td",{className:"px-4 py-3",children:i.jsx("div",{className:"flex justify-left items-center gap-2 cursor-pointer",children:i.jsx("span",{className:"w-[75px]",children:KD(C.subscriber_address)})})}),i.jsx("td",{className:"px-4 py-3 font-bold flex items-center gap-2",children:i.jsxs("div",{className:"flex items-center gap-2 min-h-[24px] pl-1",children:[C.mushInfo.eth>0&&i.jsxs("a",{href:"https://blur.io/eth/collection/mushboomers",target:"_blank",rel:"noopener noreferrer",className:"relative",children:[i.jsx("img",{src:Vme,className:"w-[24px] h-[24px] cursor-pointer",alt:"Mushboomers"}),i.jsx("span",{className:"absolute right-[-8px] top-[-8px] bg-[rgba(103,103,103,0.32)] backdrop-blur-[4px] text-white text-xs rounded-full px-1 flex items-center justify-center w-5 h-5 font-semibold font-manrope",children:C.mushInfo.eth})]}),C.mushInfo.sol>0&&i.jsxs("a",{href:"https://www.tensor.trade/trade/mushboomers",target:"_blank",rel:"noopener noreferrer",className:"relative",children:[i.jsx("img",{src:Wme,className:"w-[24px] h-[24px] cursor-pointer",alt:"Mushboomers"}),i.jsx("span",{className:"absolute right-[-8px] top-[-8px] bg-[rgba(103,103,103,0.32)] backdrop-blur-[4px] text-white text-xs rounded-full px-1 flex items-center justify-center w-5 h-5 font-semibold font-manrope",children:C.mushInfo.sol})]}),C.mushInfo.eth===0&&C.mushInfo.sol===0&&i.jsx("div",{className:"w-[24px] h-[24px]"})]})}),i.jsx("td",{className:"px-4 py-3 font-semibold",children:Er(C.daily_point_result)}),i.jsx("td",{className:"px-4 py-3 font-semibold last:rounded-tr-xl last:rounded-br-xl text-right",children:Er(C.total_pnl)})]},P)})]})]})})},Ian="/assets/bg_-D6bvhHQD.png",Pan=({className:e="w-4 h-4"})=>i.jsxs("svg",{className:e,viewBox:"0 0 9 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("g",{clipPath:"url(#paint0_angular_3845_132_clip_path)",children:i.jsx("g",{transform:"matrix(0 0.008 -0.0045 0 4.35268 6.96028)",children:i.jsx("foreignObject",{x:"-1189.48",y:"-1189.48",width:"2378.97",height:"2378.97",children:i.jsx("div",{xmlns:"http://www.w3.org/1999/xhtml",className:"h-full w-full opacity-100",style:{background:"conic-gradient(from 90deg,rgba(230, 159, 29, 1) 0deg,rgba(255, 225, 0, 1) 360deg)"}})})})}),i.jsx("path",{d:"M3.48108 0.509775C3.86338 -0.169925 4.84198 -0.169925 5.22428 0.509775L8.57688 6.46998C8.74818 6.77448 8.74818 7.14607 8.57688 7.45057L5.22428 13.4108C4.84198 14.0905 3.86338 14.0905 3.48108 13.4108L0.128475 7.45057C-0.042825 7.14607 -0.042825 6.77448 0.128475 6.46998L3.48108 0.509775Z",fill:"url(#gradient)"}),i.jsx("defs",{children:i.jsx("clipPath",{id:"paint0_angular_3845_132_clip_path",children:i.jsx("path",{d:"M3.48108 0.509775C3.86338 -0.169925 4.84198 -0.169925 5.22428 0.509775L8.57688 6.46998C8.74818 6.77448 8.74818 7.14607 8.57688 7.45057L5.22428 13.4108C4.84198 14.0905 3.86338 14.0905 3.48108 13.4108L0.128475 7.45057C-0.042825 7.14607 -0.042825 6.77448 0.128475 6.46998L3.48108 0.509775Z"})})})]}),Fan=({className:e="w-4 h-4"})=>i.jsxs("svg",{className:e,viewBox:"0 0 9 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("g",{clipPath:"url(#paint0_angular_3845_127_clip_path)",children:i.jsx("g",{transform:"matrix(0 0.008 -0.0045 0 4.35268 6.96028)",children:i.jsx("foreignObject",{x:"-1189.48",y:"-1189.48",width:"2378.97",height:"2378.97",children:i.jsx("div",{xmlns:"http://www.w3.org/1999/xhtml",className:"h-full w-full opacity-100",style:{background:"conic-gradient(from 90deg,rgba(255, 255, 255, 1) 0deg,rgba(214, 214, 214, 1) 360deg)"}})})})}),i.jsx("path",{d:"M3.48108 0.509775C3.86338 -0.169925 4.84198 -0.169925 5.22428 0.509775L8.57688 6.46998C8.74818 6.77448 8.74818 7.14607 8.57688 7.45057L5.22428 13.4108C4.84198 14.0905 3.86338 14.0905 3.48108 13.4108L0.128475 7.45057C-0.042825 7.14607 -0.042825 6.77448 0.128475 6.46998L3.48108 0.509775Z",fill:"url(#gradient)"}),i.jsx("defs",{children:i.jsx("clipPath",{id:"paint0_angular_3845_127_clip_path",children:i.jsx("path",{d:"M3.48108 0.509775C3.86338 -0.169925 4.84198 -0.169925 5.22428 0.509775L8.57688 6.46998C8.74818 6.77448 8.74818 7.14607 8.57688 7.45057L5.22428 13.4108C4.84198 14.0905 3.86338 14.0905 3.48108 13.4108L0.128475 7.45057C-0.042825 7.14607 -0.042825 6.77448 0.128475 6.46998L3.48108 0.509775Z"})})})]}),Oan=()=>{const[e,t]=m.useState([]),[n,r]=m.useState([]),[s,a]=m.useState(null),[o,l]=m.useState(null),[c,u]=m.useState("volume"),[d,f]=m.useState(!1),[x,g]=m.useState(!1),[v,w]=m.useState(!1),[C,N]=m.useState(1),P=25,I=m.useRef(null),R=m.useRef(null),{isConnected:F,address:U}=ns(),{openConnectModal:L}=y5(),{walletLogin:z,signIn:Q,hyperToken:ne,hyperAddress:J,setSignInConnectButtonOpen:X,isReferralCodeName:re}=m.useContext(Qr),pe=()=>{F?window.localStorage.getItem("hyperToken")&&ne?z():Q(1):(L(),X(!0))},Y=re||window.localStorage.getItem("refcode")||"",ie=Y?`https://app.dextrabot.com/referral/${Y}`:"",oe=()=>{if(!J||!ne){pe();return}f(!0)},G=()=>{if(!J||!ne){pe();return}g(!0)},V=ut=>{ut&&(navigator.clipboard.writeText(ut),rn.success("Copied to clipboard"))},ee=async()=>{var ut;if(I.current)try{(ut=document==null?void 0:document.fonts)!=null&&ut.ready&&await document.fonts.ready;const qt=await P1(I.current,{cacheBust:!0,backgroundColor:"#040707",pixelRatio:2}),It=document.createElement("a");It.href=qt,It.download="dextrabot-leaderboard-rank.png",document.body.appendChild(It),It.click(),document.body.removeChild(It),rn.success("Image downloaded")}catch(qt){console.error("Share card download error",qt),rn.error("Failed to download image")}};m.useCallback(()=>{fs.get("https://dextrabothypev2.nftinit.io/api/subscriber/leaderboard/").then(qt=>{const It=(qt.data.data||[]).map(nn=>({ranking:nn.rank_position,out_subscriber_address:nn.address,overall_pos_value:nn.total_volume,calculated_xp:nn.total_xp,overall_point_result:nn.total_xp,referral_xp:nn.ref_bf_xp,refCode:nn.refCode??null,daily_pos_value:null,generated_wallets:[],owner:!!nn.owner}));t(It)}).catch(qt=>{console.error("Error fetching volume data:",qt)})},[]),m.useEffect(()=>{const ut="https://dextrabothypev2.nftinit.io/api/subscriber/leaderboard/",qt=It=>(It||[]).map(nn=>({ranking:nn.rank_position,out_subscriber_address:nn.address,overall_pos_value:nn.total_volume,calculated_xp:nn.total_xp,overall_point_result:nn.total_xp,referral_xp:nn.ref_bf_xp,refCode:nn.refCode??null,daily_pos_value:null,generated_wallets:[],owner:!!nn.owner}));fs.get(ut).then(It=>{const nn=qt(It.data.data);t(nn),r(nn)}).catch(It=>{console.error("Error fetching leaderboard data:",It),t([]),r([])})},[]);const ae=m.useCallback(()=>{R.current&&R.current.abort();const ut=J||typeof window<"u"&&window.localStorage.getItem("hyperAddress"),qt=ne||typeof window<"u"&&window.localStorage.getItem("hyperToken");if(ut&&qt){w(!0);const It="https://dextrabothypev2.nftinit.io/api/subscriber/leaderboard/",nn=new AbortController;R.current=nn,fs.post(It,{address:ut,token:qt},{headers:{"Content-Type":"application/json"},signal:nn.signal}).then(jt=>{if(!nn.signal.aborted){if(jt.data.ownerRank)a(jt.data.ownerRank);else if(jt.data.data){const cn=jt.data.data.find(un=>{var Ft;return((Ft=un.address)==null?void 0:Ft.toLowerCase())===(ut==null?void 0:ut.toLowerCase())});a(cn?{ranking:cn.rank_position,rank_position:cn.rank_position,overall_pos_value:cn.total_volume,total_volume:cn.total_volume,calculated_xp:cn.total_xp,total_xp:cn.total_xp,overall_point_result:cn.total_xp,referral_xp:cn.ref_bf_xp,refCode:cn.refCode}:null)}else a(null);w(!1)}}).catch(jt=>{jt.name!=="CanceledError"&&!nn.signal.aborted&&(console.error("API Error (Volume):",jt),w(!1))})}else a(null),w(!1)},[J,ne]),fe=m.useCallback(()=>{const ut=J||typeof window<"u"&&window.localStorage.getItem("hyperAddress"),qt=ne||typeof window<"u"&&window.localStorage.getItem("hyperToken");ut&&qt?fs.post("https://dextrabothypev2.nftinit.io/api/subscriber/leaderboard/",{address:ut,token:qt},{headers:{"Content-Type":"application/json"}}).then(It=>{if(It.data.ownerRanks)l(It.data.ownerRanks[0]);else if(It.data.ownerRank)l(It.data.ownerRank);else if(It.data.data){const nn=It.data.data.find(jt=>{var cn;return((cn=jt.address)==null?void 0:cn.toLowerCase())===(ut==null?void 0:ut.toLowerCase())});l(nn?{ranked:nn.rank_position,rank_position:nn.rank_position,subscriber_address:nn.address,total_pnl:nn.total_xp,daily_point_result:nn.daily_point_result||0,mushInfo:nn.mushInfo||{eth:0,sol:0}}:null)}else l(null)}).catch(It=>console.error("API Error (PnL):",It)):l(null)},[J,ne]);m.useEffect(()=>{ae(),c==="pnl"&&fe();const ut=()=>{ae(),c==="pnl"&&fe()};return window.addEventListener("localStorageUpdated",ut),()=>{window.removeEventListener("localStorageUpdated",ut),R.current&&R.current.abort()}},[J,ne,c,ae,fe]);const Ne=m.useMemo(()=>c==="volume"?s:o,[c,s,o]),he=m.useMemo(()=>(Ne==null?void 0:Ne.ranking)??"--",[Ne==null?void 0:Ne.ranking]),ge=m.useMemo(()=>(Ne==null?void 0:Ne.overall_pos_value)??(Ne==null?void 0:Ne.total_volume)??0,[Ne==null?void 0:Ne.overall_pos_value,Ne==null?void 0:Ne.total_volume]),ye=m.useMemo(()=>(Ne==null?void 0:Ne.calculated_xp)??(Ne==null?void 0:Ne.total_xp)??0,[Ne==null?void 0:Ne.calculated_xp,Ne==null?void 0:Ne.total_xp]),ve=m.useMemo(()=>s?s.overall_point_result??s.total_xp??s.calculated_xp??(s.calculated_xp||0)+(s.referral_xp||0):0,[s]),je=m.useMemo(()=>s?s.overall_pos_value??s.total_volume??0:0,[s]),Ie=m.useMemo(()=>s?s.rank_position??s.ranking??"Unranked":"Unranked",[s]),Le=m.useMemo(()=>c==="volume"?e:n,[c,e,n]),Qe=m.useMemo(()=>Math.ceil(Le.length/P),[Le.length,P]),$e=Le.length;m.useEffect(()=>{N(1)},[c]);const it=m.useCallback(ut=>{ut>=1&&ut<=Qe&&(N(ut),window.scrollTo({top:0,behavior:"smooth"}))},[Qe]),tt=Ne?`Here’s my @Dextrabot rank #${he}. Volume (All Time): $${Er(ge)} · XP: ${Er(ye)}. Farming points and stacking profit at the same time.`:"Here’s my @Dextrabot rank. Farming points and stacking profit at the same time.",lt=ie||"https://app.dextrabot.com/leaderboard",ft=`https://x.com/intent/post?text=${encodeURIComponent(tt)}&url=${encodeURIComponent(lt)}`;return i.jsxs(i.Fragment,{children:[i.jsx(So,{children:i.jsxs(Ro,{children:[i.jsx("meta",{name:"description",content:"See the top traders on DextraBot ranked by trading volume. Track the best-performing users and find inspiration for your next trade."}),i.jsx("meta",{name:"og:title",content:"Top Traders Leaderboard – Track the Best Performers on DextraBot"}),i.jsx("meta",{name:"og:description",content:"See the top traders on DextraBot ranked by trading volume. Track the best-performing users and find inspiration for your next trade."}),i.jsx("meta",{name:"og:image",content:"https://app.dextrabot.com/dextrabotIcon.png"}),i.jsx("meta",{name:"og:url",content:"https://app.dextrabot.com/leaderboard"})]})}),i.jsxs("div",{className:"min-h-screen bg-black relative overflow-hidden",children:[i.jsx("div",{className:"absolute top-0 right-0 w-[1200px] h-full pointer-events-none hidden lg:block bg-contain bg-right-top bg-no-repeat z-[1]",style:{backgroundImage:`url(${Ian})`}}),i.jsxs("div",{className:"relative z-10 max-w-7xl mx-auto px-4 sm:px-6 py-8 sm:py-16",children:[i.jsx("div",{className:"mb-6 sm:mb-10 pl-0 pr-4 sm:pr-16 py-6 sm:py-12 leaderboard-card rounded-2xl",children:i.jsxs("div",{className:"flex flex-col lg:flex-row lg:items-center lg:justify-between gap-6 lg:gap-12",children:[i.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center gap-6 sm:gap-8 lg:gap-32",children:[i.jsx("div",{className:"flex-shrink-0",children:J&&ne?i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[i.jsx("span",{className:"text-white text-xs sm:text-sm",children:"Connected"}),i.jsx("div",{className:"w-2 h-2 bg-green-500 rounded-full"})]}),i.jsx("div",{className:"text-white font-mono text-sm sm:text-lg font-bold",children:KD(J)})]}):i.jsx("button",{onClick:pe,className:"bg-blue-600 hover:bg-blue-700 text-white px-4 py-2 rounded-2xl font-semibold transition-colors text-sm h-10 w-full sm:w-auto",children:"Connect Wallet"})}),i.jsxs("div",{className:"grid grid-cols-3 sm:flex sm:items-center gap-4 sm:gap-8 lg:gap-32",children:[i.jsxs("div",{className:"flex-shrink-0",children:[i.jsx("div",{className:"text-gray-400 text-xs sm:text-sm mb-1",children:"XP"}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"text-white font-bold text-sm sm:text-lg",children:v&&J&&ne?"...":J&&ne&&s?Er(ve):"0"}),i.jsx(Pan,{className:"w-4 h-4 sm:w-5 sm:h-5"})]})]}),i.jsxs("div",{className:"flex-shrink-0",children:[i.jsx("div",{className:"text-gray-400 text-xs sm:text-sm mb-1",children:"Volume"}),i.jsxs("div",{className:"text-white font-bold text-sm sm:text-lg",children:["$",v&&J&&ne?"...":J&&ne&&s?Er(je):"0"]})]}),i.jsxs("div",{className:"flex-shrink-0",children:[i.jsx("div",{className:"text-gray-400 text-xs sm:text-sm mb-1",children:"#"}),i.jsx("div",{className:"text-white font-bold text-sm sm:text-lg",children:v&&J&&ne?"...":J&&ne&&s?Ie:"Unranked"})]})]})]}),i.jsxs("div",{className:"flex flex-col sm:flex-row items-stretch sm:items-center gap-4 sm:gap-6",children:[i.jsxs("button",{onClick:G,className:"flex items-center justify-center gap-2 bg-white hover:bg-gray-100 text-black px-3 py-2 rounded-2xl font-semibold transition-colors text-sm border border-gray-300 h-10 w-full sm:w-auto whitespace-nowrap",children:[i.jsx("span",{className:"text-black",children:"𝕏"}),i.jsx("span",{className:"hidden sm:inline",children:"Share your rank"}),i.jsx("span",{className:"sm:hidden",children:"Share"}),i.jsxs("span",{className:"bg-black text-white text-xs px-2 py-1 rounded-lg flex items-center gap-1",children:[i.jsx("span",{children:"200"}),i.jsx(Fan,{className:"w-3 h-3"})]})]}),i.jsx("button",{onClick:oe,className:"flex items-center justify-center text-black px-4 py-2 rounded-2xl font-semibold transition-colors text-sm h-10 w-full sm:w-20 bg-[#1DE674]",children:"Invite"})]})]})}),i.jsxs("div",{className:"mb-8 sm:mb-12",children:[i.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4 sm:gap-6 mt-12 sm:mt-16 mb-0",children:[i.jsx("h2",{className:"text-2xl sm:text-3xl lg:text-4xl font-bold text-white",children:"Leaderboard"}),Le.length>0&&i.jsxs("div",{className:"flex flex-col sm:flex-row items-end sm:items-center gap-2",children:[i.jsxs("div",{className:"flex items-center gap-2 text-[12px] font-semibold",children:[i.jsx(Ni,{className:"text-white hidden sm:block"}),i.jsx("span",{className:"text-white",children:$e}),i.jsx("span",{className:"text-white",children:"wallets found"})]}),i.jsxs("div",{className:"flex items-center gap-1",children:[i.jsx("button",{onClick:()=>it(C-1),disabled:C===1,className:`${C===1?"cursor-not-allowed text-white/30":"text-white hover:bg-white/40"} relative inline-flex items-center justify-center p-1.5 rounded-md bg-[#3d3d3d] w-7 h-7`,children:i.jsx(Yh,{className:`w-3 h-3 rotate-90 ${C===1?"text-white/30":"text-white"}`})}),i.jsxs("div",{className:"px-3 py-1 rounded-md bg-[#3d3d3d]/60 text-sm font-medium text-white min-w-max h-7 flex items-center",children:[C," / ",Math.max(Qe,1)]}),i.jsx("button",{onClick:()=>it(C+1),disabled:C===Qe||Qe===0,className:`${C===Qe||Qe===0?"cursor-not-allowed text-white/30":"text-white hover:bg-white/40"} relative inline-flex items-center justify-center p-1.5 rounded-md bg-[#3d3d3d] w-7 h-7`,children:i.jsx(Yh,{className:`w-3 h-3 -rotate-90 ${C===Qe||Qe===0?"text-white/30":"text-white"}`})})]})]})]}),i.jsx("div",{className:"leaderboard-card rounded-2xl overflow-hidden mt-4 sm:mt-6",children:c==="volume"?i.jsx(kan,{volumeLeaderboardData:e,userData:s,currentPage:C,rowsPerPage:P}):c==="pnl"?i.jsx(Tan,{pnlLeaderboardData:n,userData:o,currentPage:C,rowsPerPage:P}):i.jsx(i.Fragment,{})})]})]})]}),i.jsx(up,{isOpen:d,onClose:()=>f(!1),blurBackground:!0,children:i.jsxs("div",{className:"w-[320px] sm:w-[420px] bg-[#1c1c1c] rounded-3xl p-6 text-white",children:[i.jsxs("div",{className:"mb-6",children:[i.jsx("p",{className:"text-sm uppercase tracking-widest text-green-300/80 mb-2",children:"Invite friends"}),i.jsx("h3",{className:"text-2xl font-semibold mb-2",children:"Share your referral"}),i.jsx("p",{className:"text-sm text-white/70",children:"You can send your code or unique link."})]}),Y?i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{className:"bg-[#262626] rounded-2xl p-4 flex items-center justify-between gap-4",children:[i.jsxs("div",{children:[i.jsx("p",{className:"text-xs text-white/60 mb-1",children:"Your Referral Code"}),i.jsx("p",{className:"text-lg font-semibold",children:Y})]}),i.jsx("button",{className:"p-2 rounded-xl border border-white/10 transition hover:bg-white/10",onClick:()=>V(Y),children:i.jsx("img",{src:hM,alt:"Copy referral code",className:"w-4 h-4"})})]}),i.jsxs("div",{className:"bg-[#262626] rounded-2xl p-4 flex items-center justify-between gap-4",children:[i.jsxs("div",{className:"min-w-0",children:[i.jsx("p",{className:"text-xs text-white/60 mb-1",children:"Your Referral URL"}),i.jsx("p",{className:"text-sm text-green-300 truncate",children:ie})]}),i.jsx("button",{className:"p-2 rounded-xl border border-white/10 transition hover:bg-white/10",onClick:()=>V(ie),children:i.jsx("img",{src:hM,alt:"Copy referral url",className:"w-4 h-4"})})]})]}):null,!Y&&i.jsxs("div",{className:"text-xs text-white/50 mt-4",children:["You can create your referral code on the"," ",i.jsx("a",{href:"/referral",className:"text-green-300 hover:text-green-200 underline",children:"Referral page"}),"."]})]})}),i.jsx(up,{isOpen:x,onClose:()=>g(!1),blurBackground:!0,children:i.jsxs("div",{className:"w-[340px] sm:w-[460px] bg-[#101010] rounded-3xl p-6 text-white",children:[i.jsxs("div",{ref:I,className:"bg-gradient-to-b from-[#0c1414] via-[#040707] to-[#040505] rounded-[32px] border border-emerald-500/10 p-5 shadow-[0_0_60px_rgba(0,255,200,0.08)]",children:[i.jsxs("div",{className:"flex items-center justify-between mb-5",children:[i.jsx("div",{children:i.jsx("p",{className:"text-sm uppercase tracking-[0.3em] text-white/70",children:"Leaderboard"})}),i.jsxs("div",{className:"flex items-center gap-2 px-3 py-1 rounded-full bg-white/5 border border-white/10",children:[i.jsx("img",{src:_A,alt:"Dextrabot",className:"w-5 h-5 rounded-full"}),i.jsx("span",{className:"text-xs font-semibold tracking-wide",children:"DEXTRABOT"})]})]}),i.jsxs("div",{className:"mt-5 bg-[#05090a] rounded-3xl p-5 text-center border border-white/5",children:[i.jsx("p",{className:"text-xs uppercase tracking-[0.4em] text-white/50",children:"Rank"}),i.jsx("p",{className:"text-4xl font-bold text-[#67FFBD] mt-2",children:(Ne==null?void 0:Ne.ranking)??"--"}),i.jsxs("div",{className:"grid grid-cols-2 gap-3 mt-6 text-left",children:[i.jsxs("div",{className:"bg-white/3 rounded-2xl p-3 border border-white/5",children:[i.jsx("p",{className:"text-[11px] uppercase tracking-wide text-white/50",children:"Volume (All Time)"}),i.jsxs("p",{className:"text-lg font-semibold text-white mt-1",children:["$",Er((Ne==null?void 0:Ne.overall_pos_value)??(Ne==null?void 0:Ne.total_volume)??0)]})]}),i.jsxs("div",{className:"bg-white/3 rounded-2xl p-3 border border-white/5",children:[i.jsx("p",{className:"text-[11px] uppercase tracking-wide text-white/50",children:"XP"}),i.jsx("p",{className:"text-lg font-semibold text-white mt-1",children:Er((Ne==null?void 0:Ne.calculated_xp)??(Ne==null?void 0:Ne.total_xp)??0)})]})]})]}),i.jsxs("div",{className:"mt-4 flex items-center justify-between text-[11px] text-white/50",children:[i.jsx("span",{children:"Generated by Dextrabot"}),i.jsx("span",{children:new Date().toLocaleDateString("en-US",{month:"short",day:"numeric"})})]})]}),!Ne&&i.jsx("p",{className:"text-xs text-white/60 mt-4",children:"Connect your wallet and climb the leaderboard to unlock personalized stats."}),i.jsxs("div",{className:"mt-6 space-y-3",children:[i.jsx("button",{onClick:ee,className:"w-full border border-emerald-400/60 rounded-2xl py-3 text-emerald-300 font-semibold hover:bg-emerald-400/10 transition disabled:opacity-40 disabled:cursor-not-allowed",disabled:!Ne,children:"Download image"}),i.jsx("a",{href:ft,target:"_blank",rel:"noopener noreferrer",className:"w-full block text-center bg-white text-black font-semibold rounded-2xl py-3 hover:bg-gray-100 transition",children:"Share on X"})]})]})})]})};function Man({title:e,titleId:t,...n},r){return m.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?m.createElement("title",{id:t},e):null,m.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 6.75h16.5M3.75 12h16.5m-16.5 5.25h16.5"}))}const Ran=m.forwardRef(Man);function Lan({title:e,titleId:t,...n},r){return m.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?m.createElement("title",{id:t},e):null,m.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m19.5 8.25-7.5 7.5-7.5-7.5"}))}const Dan=m.forwardRef(Lan);function Ban({title:e,titleId:t,...n},r){return m.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?m.createElement("title",{id:t},e):null,m.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 19.5 8.25 12l7.5-7.5"}))}const $an=m.forwardRef(Ban);function Uan({title:e,titleId:t,...n},r){return m.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?m.createElement("title",{id:t},e):null,m.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m8.25 4.5 7.5 7.5-7.5 7.5"}))}const QY=m.forwardRef(Uan);function zan({title:e,titleId:t,...n},r){return m.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?m.createElement("title",{id:t},e):null,m.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m4.5 15.75 7.5-7.5 7.5 7.5"}))}const Han=m.forwardRef(zan);function Van({title:e,titleId:t,...n},r){return m.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?m.createElement("title",{id:t},e):null,m.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m21 21-5.197-5.197m0 0A7.5 7.5 0 1 0 5.196 5.196a7.5 7.5 0 0 0 10.607 10.607Z"}))}const Wan=m.forwardRef(Van);function qan({title:e,titleId:t,...n},r){return m.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?m.createElement("title",{id:t},e):null,m.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18 18 6M6 6l12 12"}))}const tze=m.forwardRef(qan),TCe=[{name:"Blog",key:"blog",href:"https://blog.dextrabot.com/"},{name:"Features",key:"features",href:"/#features"},{name:"How it works?",key:"howItWorks",href:"/#howitworks"},{name:"FAQ",key:"faq",href:"/#faq"},{name:"Launch",key:"launchApp",href:"/hyperliquid-fee-calculator"}];function Gan(...e){return e.filter(Boolean).join(" ")}const Vce=({scrollToFeatures:e,scrollToHowItWorks:t,scrollToFAQ:n})=>i.jsxs(u8e,{as:"nav",className:"bg-transparent lg:pt-[24px]",children:[i.jsx("div",{className:"mx-auto max-w-7xl px-2 sm:px-0",children:i.jsxs("div",{className:"relative flex h-16 items-center justify-between",children:[i.jsx("div",{className:"absolute inset-y-0 left-0 flex items-center pr-2 sm:static sm:inset-auto sm:ml-1 sm:pr-0",children:i.jsx(MD,{as:"div",className:"relative ml-1",children:i.jsxs("div",{onClick:()=>{window.location.href="/"},className:"flex justify-start items-center gap-4 cursor-pointer",children:[i.jsx("img",{src:byt,alt:"Dextrabot",className:"w-12 h-12"}),i.jsx("div",{className:"justify-start text-white text-2xl font-semibold font-['Manrope'] leading-[21px]",children:"Dextrabot"})]})})}),i.jsx("div",{className:"absolute inset-y-0 right-0 flex items-center sm:hidden",children:i.jsxs(Jre,{className:"group relative inline-flex items-center justify-center rounded-md p-2 text-gray-400 bg-[#1e1e1e] hover:bg-[#353535] hover:text-white focus:outline-none focus:ring-0 border-none",children:[i.jsx("span",{className:"absolute -inset-0.5"}),i.jsx("span",{className:"sr-only",children:"Open main menu"}),i.jsx(Ran,{"aria-hidden":"true",className:"block size-6 group-data-[open]:hidden"}),i.jsx(tze,{"aria-hidden":"true",className:"hidden size-6 group-data-[open]:block"})]})}),i.jsx("div",{className:"flex flex-1 items-center justify-center sm:items-stretch sm:justify-end",children:i.jsx("div",{className:"hidden sm:ml-6 sm:block mr-2",children:i.jsx("div",{className:"flex items-center space-x-6",children:TCe.map(r=>i.jsx("a",{href:r.href||"#",onClick:s=>{r.href||s.preventDefault(),r.key==="features"&&(e==null||e()),r.key==="howItWorks"&&(t==null||t()),r.key==="faq"&&(n==null||n())},className:Gan(r.current?"bg-transparent text-white":`${r.name==="Launch"?"text-[#121213] hover:text-[#121213] hover:scale-105 transition-transform duration-300":"text-white/50 hover:text-white"}`,"",r.name==="Launch"?"w-24 h-10 px-12 py-3 bg-white rounded-[256px] inline-flex justify-center items-center gap-2.5 text-[#121213] text-sm font-semibold font-manrope leading-8":"rounded-md text-sm font-semibold font-manrope leading-8 h-8"),children:r.name},r.name))})})})]})}),i.jsx(ese,{className:"sm:hidden",children:i.jsx("div",{className:"space-y-1 px-2 pb-3 pt-2",children:TCe.map(r=>r.key==="launchApp"?i.jsx("a",{href:r.href,className:"block rounded-md px-3 py-2 text-base font-medium text-white hover:text-white bg-[#1a1a1a] hover:bg-[#353535]",children:r.name},r.name):i.jsx("button",{onClick:async()=>{r.key==="features"&&(e==null||e()),r.key==="howItWorks"&&(t==null||t()),r.key==="faq"&&(n==null||n())},className:"w-full text-left block rounded-md px-3 py-2 text-base font-medium text-white/50 bg-transparent hover:bg-[#353535] hover:text-white focus:outline-none focus:ring-0 border-none",children:r.name},r.name))})})]}),Kan=()=>{const[e,t]=m.useState("");return i.jsx("section",{className:"px-1 py-5 sm:py-[64px] text-center",children:i.jsx("div",{className:"max-w-7xl mx-auto",children:i.jsx("div",{className:"flex flex-col items-center gap-[88px]",children:i.jsxs("div",{className:"flex flex-col lg:flex-row items-center lg:items-start gap-6",children:[i.jsx("div",{className:"w-full lg:flex-[0.45] flex justify-center lg:justify-start",children:i.jsx("div",{className:"bg-transparent p-1 rounded-xl h-full",children:i.jsxs("div",{className:"flex flex-col items-start gap-4",children:[i.jsx("h1",{className:"max-w-[553px] w-full lg:w-[553px] justify-start text-white text-[36px] sm:text-[56px] font-semibold font-['Manrope'] leading-[42px] sm:leading-[64px] text-left",children:"Dextrabot - Find and Copy Trade Top Hyperliquid Wallets"}),i.jsx("div",{className:"max-w-[512px] justify-start text-[#aaaaaa] text-base font-medium font-['Manrope'] leading-[21px] tracking-tight text-left",children:"Discover profitable traders, analyze their performance, and automatically copy their strategies with customizable risk settings."}),i.jsxs("div",{className:"flex flex-col sm:flex-row justify-start items-center gap-4 sm:gap-6 pt-[22px] w-full",children:[i.jsx("div",{onClick:()=>{window.location.href="/discover-wallets"},className:"w-full sm:w-auto sm:before:max-w-[200px] h-12 px-2 sm:px-6 py-1 sm:py-3 bg-[#67ffbd] rounded-[256px] flex justify-center items-center cursor-pointer hover:scale-105 transition-transform duration-300",children:i.jsx("span",{className:"text-[#103324] text-lg font-semibold font-['Manrope'] leading-6 min-w-max",children:"Start Copy Trade"})}),i.jsx("div",{onClick:()=>{window.location.href="/discover-wallets"},className:"w-full sm:w-auto sm:max-w-[200px] h-12 px-2 sm:px-6 py-1 sm:py-3 bg-[#1e1e1e] rounded-[256px] flex justify-center items-center cursor-pointer hover:scale-105 transition-transform duration-300",children:i.jsx("span",{className:"text-white text-lg font-semibold font-['Manrope'] leading-6 min-w-max ",children:"Discover Wallets"})})]}),i.jsx("div",{className:"w-full",children:i.jsxs("div",{className:"w-full sm:w-[424px] h-12 px-4 py-3 bg-[#1e1e1e] rounded-[256px] flex items-center gap-2.5 relative mt-2",children:[i.jsx(_y,{className:"text-white"}),i.jsx("input",{type:"text",value:e,onChange:n=>t(n.target.value),placeholder:"Track and Analyze Wallet",className:"flex bg-transparent outline-none border-none text-[#cfcfcf] placeholder-[#636363] text-lg font-normal font-['Manrope'] leading-[21px] pr-10 w-full sm:w-[424px]"}),i.jsx("div",{onClick:n=>{if(n.preventDefault(),!e)rn.error("Please enter a wallet address");else if(e.match(/^0x[a-fA-F0-9]{40}$/))window.open(`/wallet-details/${e}`,"_blank"),setTimeout(()=>{t("")},200);else{rn.error("Please enter a valid Ethereum address");return}},className:"w-10 h-10 bg-[#67ffbd]/20 rounded-[256px] inline-flex justify-center items-center absolute right-1 hover:scale-105 transition-transform duration-300 cursor-pointer",children:i.jsx("img",{src:gyt,alt:"search",className:"w-6 h-6 min-w-6 min-h-6"})})]})})]})})}),i.jsx("div",{className:"w-full lg:flex-[0.55]",children:i.jsx("div",{className:"bg-transparent rounded-xl shadow-lg h-full",children:i.jsx("div",{className:"w-full",children:i.jsx("img",{src:lyt,alt:"Copy trade Hyperliquid wallets with Dextrabot platform and customizable risk settings",className:"w-full h-auto max-w-[728px] mx-auto"})})})})]})})})})},Yan=()=>i.jsx("section",{className:"py-16 bg-transparent",children:i.jsxs("div",{className:"max-w-7xl mx-auto",children:[i.jsx("h2",{className:"text-center justify-start text-white text-[40px] font-semibold font-['Manrope'] leading-[48px] mb-10",children:"Dextrabot Features"}),i.jsxs("div",{className:"flex flex-wrap xl:flex-nowrap justify-center gap-4",children:[i.jsxs("div",{className:"flex flex-col gap-4",children:[i.jsxs("div",{className:"flex flex-wrap md:flex-nowrap justify-center md:justify-start gap-4",children:[i.jsx(Y7,{title:"Copy Trade",description:"Automatically copy trade perpetual positions with customizable risk parameters",altInfo:"Automated copy trading perpetual positions on Hyperliquid with customizable risk parameters",icon:cyt,cssInfo:"w-[348px] h-[348px]",imgCss:"absolute bottom-0 left-0"}),i.jsx(Y7,{title:"Discover Wallets",description:"Find overlooked high-performers on Hyperliquid with advanced filtering",altInfo:"Find high-performing wallets on Hyperliquid with advanced filtering and wallet discovery",icon:dyt,cssInfo:"w-[348px] h-[348px]",imgCss:"absolute -bottom-2"})]}),i.jsxs("div",{className:"flex flex-wrap md:flex-nowrap justify-center md:justify-start gap-4",children:[i.jsx(Y7,{title:"Real-Time Alerts",description:"Get instant Telegram notifications for all trading activities",altInfo:"Real-time Telegram notifications for all Hyperliquid trading activities and copy trades",icon:fyt,cssInfo:"w-[348px] h-[348px]",imgCss:"absolute bottom-[20px] w-[294px] h-[204px]"}),i.jsx(Y7,{title:"Referrals",description:"Earn up to 65% reward through our multi-level program",altInfo:"Earn up to 65% rewards through Dextrabot's multi-level referral program for crypto traders",icon:uyt,cssInfo:"w-[348px] h-[348px]",imgCss:"absolute bottom-0 -left-1"})]})]}),i.jsx(Y7,{title:"Analyze Wallet",description:"Track performance metrics, open positions, and trading patterns",icon:hyt,altInfo:"Track performance metrics, open positions, and trading patterns of top Hyperliquid wallets",cssInfo:"max-w-full md:w-[720px] xl:w-[552px] h-[500px] md:h-[916px] xl:h-[716px] bg-[#161616] rounded-3xl p-6 text-white flex-shrink-0 relative overflow-hidden hover:scale-105 transition-transform duration-300",imgCss:"absolute bottom-0 left-6"})]})]})}),Y7=({title:e,description:t,altInfo:n,icon:r,cssInfo:s,imgCss:a})=>i.jsxs("div",{className:`${s} bg-[#161616] rounded-3xl p-6 text-white relative overflow-hidden hover:scale-105 transition-transform duration-300`,children:[i.jsx("div",{className:"text-start justify-start text-white text-[21px] font-semibold font-['Manrope'] leading-normal mb-1",children:e}),i.jsx("div",{className:"w-[290px] justify-start text-[#979797] text-sm font-medium font-['Manrope'] leading-[21px]",children:t}),i.jsx("img",{src:r,alt:n,className:a})]}),Xan=()=>i.jsx("section",{className:"py-16 bg-transparent",children:i.jsxs("div",{className:"max-w-7xl mx-auto",children:[i.jsx("h2",{className:"text-center justify-start text-white text-[40px] font-semibold font-['Manrope'] leading-[48px] mb-10",children:"Three Simple Steps to Start Copy Trade"}),i.jsxs("div",{className:"flex flex-wrap xl:flex-nowrap justify-center gap-4",children:[i.jsx(ZY,{title:"Discover",description:"Find profitable wallets using our advanced filters",icon:pyt,altInfo:"Discover profitable Hyperliquid wallets using Dextrabot's advanced filtering system"}),i.jsx(ZY,{title:"Analyze",description:"Examine detailed metrics and trading patterns",icon:myt,altInfo:"Examine detailed PnL metrics and win rate statistics for Hyperliquid trading strategies"}),i.jsx(ZY,{title:"Copy Trade",description:"Set your risk parameters and start automating",icon:xyt,altInfo:"Set custom take profit and stop loss parameters for automated copy trading on Hyperliquid"})]})]})}),ZY=({title:e,description:t,altInfo:n,icon:r,imgCss:s})=>i.jsxs("div",{className:"w-[348px] xl:w-[416px] h-[348px] bg-[#161616] rounded-3xl p-6 text-white relative overflow-hidden hover:scale-105 transition-transform duration-300",children:[i.jsx("div",{className:"text-start justify-start text-white text-[21px] font-semibold font-['Manrope'] leading-normal mb-1",children:e}),i.jsx("div",{className:"w-[290px] justify-start text-[#979797] text-sm font-medium font-['Manrope'] leading-[21px]",children:t}),i.jsx("img",{src:r,alt:n,className:"absolute bottom-[12px] left-1/2 transform -translate-x-1/2 w-[314px] xl:w-[382px]"})]}),ICe=({className:e})=>i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",className:e,children:i.jsx("path",{d:"M16.6004 7.45831L11.1671 12.8916C10.5254 13.5333 9.47539 13.5333 8.83372 12.8916L3.40039 7.45831",stroke:"currentColor",strokeWidth:"1.5",strokeMiterlimit:"10",strokeLinecap:"round",strokeLinejoin:"round"})}),Qan=()=>{const e=[{question:"How does copy trade work on Dextrabot?",answer:"Dextrabot monitors wallet activity and automatically executes the same perpetual positions in your account based on your risk settings."},{question:"What fees does Dextrabot charge?",answer:"Dextrabot charges 0.055% on trade size for copy trade transactions. Use a referral code for a 4% discount."},{question:"How do I set up Telegram notifications?",answer:"Connect your Telegram account through the Tracker page to receive instant alerts about wallet activities and copy trades."},{question:"What risk management options are available?",answer:"Dextrabot offers customizable stop-loss and take-profit levels, position size limits, and margin increase controls for comprehensive risk management."},{question:" How does the referral program work?",answer:"You can earn up to 65% reward on the fees generated by traders you refer to Dextrabot, with multi-tier commissions coming soon."},{question:"Can I copy multiple wallets simultaneously?",answer:"Yes, you can copy trade multiple wallets at once, each with their own customized risk parameters and position sizing."}];return i.jsx("section",{className:"py-16 bg-transparent",children:i.jsxs("div",{className:"max-w-7xl mx-auto",children:[i.jsx("div",{className:"text-center justify-start text-white text-[40px] font-semibold font-['Manrope'] leading-[48px] mb-[18px]",children:"FAQ"}),i.jsx("h2",{className:"w-full text-center justify-center text-white/60 text-lg font-semibold font-['Manrope'] leading-normal",children:"Frequently Asked Questions"}),i.jsx("dl",{className:"mt-[41px] divide-y divide-gray-900/10 border-none outline-none w-full lg:w-[777px] mx-auto",children:e.map(t=>i.jsx(u8e,{as:"div",className:"my-4 first:pt-0 last:pb-0 rounded-2xl bg-[#161616]",children:i.jsxs("dt",{children:[i.jsxs(Jre,{className:"group flex w-full items-start justify-start text-left text-white gap-4 border-none bg-transparent focus:outline-none focus:ring-0 first:pt-4 last:pb-4",children:[i.jsxs("span",{className:"ml-1 flex h-7 items-center",children:[i.jsx(ICe,{"aria-hidden":"true",className:"size-6 group-data-[open]:hidden"}),i.jsx(ICe,{"aria-hidden":"true",className:"size-6 rotate-180 group-[&:not([data-open])]:hidden"})]}),i.jsx("span",{className:"text-start justify-start text-white text-base font-semibold font-['Manrope'] leading-normal",children:t.question})]}),i.jsx(ese,{as:"dd",className:"pr-12 ml-[64px] pb-4 -mt-2",children:i.jsx("p",{className:"w-full lg:w-[683px] justify-start text-[#cfcfcf] text-sm font-medium font-['Manrope'] leading-normal",children:t.answer})})]})},t.question))})]})})},Zan=({className:e})=>i.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",className:e,children:[i.jsx("g",{clipPath:"url(#clip0_235_3767)",children:i.jsx("path",{d:"M8.99969 0.180054C4.12852 0.180054 0.179688 4.12889 0.179688 9.00005C0.179688 13.8712 4.12852 17.8201 8.99969 17.8201C13.8709 17.8201 17.8197 13.8712 17.8197 9.00005C17.8197 4.12889 13.8709 0.180054 8.99969 0.180054ZM13.0879 6.17836C12.9552 7.57303 12.3808 10.9575 12.0885 12.5195C11.9649 13.1804 11.7214 13.4021 11.4858 13.4237C10.9737 13.4709 10.5847 13.0853 10.0886 12.7601C9.3123 12.2512 8.87375 11.9344 8.12021 11.4379C7.24942 10.8641 7.81393 10.5488 8.3102 10.0331C8.44008 9.8982 10.6968 7.84552 10.7405 7.65931C10.7459 7.63601 10.7512 7.54906 10.6995 7.50339C10.6477 7.45773 10.5718 7.4732 10.5168 7.48561C10.439 7.5033 9.19888 8.32296 6.7965 9.94461C6.44453 10.1863 6.12571 10.3041 5.84003 10.2979C5.52511 10.2911 4.91933 10.1199 4.46898 9.97345C3.91663 9.79393 3.47762 9.699 3.51585 9.39407C3.53577 9.23522 3.75449 9.07281 4.17202 8.90684C6.74324 7.7866 8.45778 7.04805 9.31564 6.69117C11.765 5.67235 12.274 5.49538 12.6058 5.48948C12.6787 5.48827 12.8419 5.50634 12.9475 5.59208C13.0178 5.65316 13.0626 5.7384 13.0731 5.83094C13.091 5.94583 13.0959 6.06236 13.0879 6.17836Z",fill:"currentColor"})}),i.jsx("defs",{children:i.jsx("clipPath",{id:"clip0_235_3767",children:i.jsx("rect",{width:"18",height:"18",fill:"currentColor"})})})]}),Jan=({className:e})=>i.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",className:e,children:[i.jsx("g",{clipPath:"url(#clip0_235_3764)",children:i.jsx("path",{d:"M11.0256 0.672607H13.1722L8.48225 6.03344L14 13.3269H9.67983L6.2965 8.90286L2.42433 13.3269H0.2765L5.29317 7.59269L0 0.673191H4.42983L7.48825 4.71686L11.0256 0.672607ZM10.2725 12.0424H11.4619L3.7835 1.89002H2.50717L10.2725 12.0424Z",fill:"currentColor"})}),i.jsx("defs",{children:i.jsx("clipPath",{id:"clip0_235_3764",children:i.jsx("rect",{width:"14",height:"14",fill:"currentColor"})})})]}),eon=({className:e})=>i.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e,children:i.jsx("path",{d:"M16.9419 3.52317C15.6473 2.91744 14.263 2.47723 12.8157 2.22656C12.638 2.5479 12.4304 2.98012 12.2872 3.32394C10.7487 3.09258 9.22445 3.09258 7.7143 3.32394C7.57116 2.98012 7.3588 2.5479 7.17947 2.22656C5.73067 2.47723 4.3448 2.91906 3.05016 3.52638C0.438869 7.47238 -0.269009 11.3204 0.0849305 15.1137C1.81688 16.4071 3.49534 17.1928 5.14548 17.7069C5.55291 17.1462 5.91628 16.5501 6.22931 15.9219C5.63313 15.6954 5.06211 15.4158 4.52256 15.0912C4.6657 14.9852 4.80571 14.8743 4.94098 14.7603C8.23183 16.2995 11.8074 16.2995 15.0589 14.7603C15.1958 14.8743 15.3358 14.9852 15.4774 15.0912C14.9362 15.4174 14.3637 15.6969 13.7675 15.9235C14.0805 16.5501 14.4423 17.1478 14.8513 17.7085C16.503 17.1944 18.183 16.4087 19.915 15.1137C20.3303 10.7163 19.2056 6.90361 16.9419 3.52317ZM6.67765 12.7809C5.68977 12.7809 4.87963 11.8586 4.87963 10.7355C4.87963 9.61247 5.67247 8.68864 6.67765 8.68864C7.68285 8.68864 8.49297 9.61086 8.47567 10.7355C8.47723 11.8586 7.68285 12.7809 6.67765 12.7809ZM13.3223 12.7809C12.3344 12.7809 11.5243 11.8586 11.5243 10.7355C11.5243 9.61247 12.3171 8.68864 13.3223 8.68864C14.3275 8.68864 15.1376 9.61086 15.1203 10.7355C15.1203 11.8586 14.3275 12.7809 13.3223 12.7809Z",fill:"currentColor"})}),Wce=()=>i.jsxs("footer",{className:"bg-[#121213] pt-12 pb-28 sm:pt-6 sm:pb-6 text-center text-sm text-gray-400",children:[i.jsxs("div",{className:"flex flex-col sm:flex-row justify-center items-center gap-[32px] relative",children:[i.jsx("div",{onClick:()=>window.location.href="https://blog.dextrabot.com/",className:"text-center justify-start text-[#696969] hover:text-white text-[13px] font-semibold font-['Manrope'] leading-normal cursor-pointer",children:"Blog"}),i.jsx("div",{onClick:()=>window.location.href="/sitemap",className:"text-center justify-start text-[#696969] hover:text-white text-[13px] font-semibold font-['Manrope'] leading-normal cursor-pointer",children:"Sitemap"}),i.jsx("div",{onClick:()=>window.location.href="/videos",className:"text-center justify-start text-[#696969] hover:text-white text-[13px] font-semibold font-['Manrope'] leading-normal cursor-pointer",children:"Videos"}),i.jsx("div",{onClick:()=>window.open("https://docs.dextrabot.com/","_blank"),className:"text-center justify-start text-[#696969] hover:text-white text-[13px] font-semibold font-['Manrope'] leading-normal cursor-pointer",children:"Documentation"}),i.jsx("div",{onClick:()=>window.open("https://docs.dextrabot.com/faq-and-official-links/risk-disclaimer","_blank"),className:"text-center justify-start text-[#696969] hover:text-white text-[13px] font-semibold font-['Manrope'] leading-normal cursor-pointer",children:"Risk Disclaimer"}),i.jsxs("div",{className:"flex justify-center sm:justify-start items-center gap-4",children:[i.jsx("div",{onClick:()=>{window.open("https://x.com/dextrabot","_blank")},className:"rounded-full cursor-pointer p-[1px]",children:i.jsx(Jan,{className:"text-[#696969] hover:text-white"})}),i.jsx("div",{onClick:()=>{window.open("https://discord.gg/dextrabot","_blank")},className:"rounded-full cursor-pointer p-[1px]",children:i.jsx(eon,{className:"text-[#696969] hover:text-white"})}),i.jsx("div",{onClick:()=>{window.open("https://t.me/Dextrabot_Official","_blank")},className:"rounded-full cursor-pointer p-[1px]",children:i.jsx(Zan,{className:"text-[#696969] hover:text-white"})})]}),i.jsxs("div",{className:"hidden xl:flex absolute right-2 justify-end items-center text-center text-[#696969] hover:text-white text-[13px] font-semibold font-['Manrope'] leading-normal",children:["© ",new Date().getFullYear()," Dextrabot. All rights reserved."]})]}),i.jsxs("div",{className:"block xl:hidden text-center text-[#696969] hover:text-white text-[13px] font-semibold font-['Manrope'] leading-normal mt-6",children:["© ",new Date().getFullYear()," Dextrabot. All rights reserved."]})]}),ton=()=>{const e=m.useRef(null),t=m.useRef(null),n=m.useRef(null);return i.jsxs(i.Fragment,{children:[i.jsx(So,{children:i.jsxs(Ro,{children:[i.jsx("meta",{name:"description",content:"Find high-performing Hyperliquid wallets, analyze their trading patterns, and automatically copy their strategies with custom risk settings. Real-time alerts via Telegram."}),i.jsx("meta",{name:"og:title",content:"Dextrabot | Discover and Copy Trade Top Hyperliquid Wallets"}),i.jsx("meta",{name:"og:description",content:"Find high-performing Hyperliquid wallets, analyze their trading patterns, and automatically copy their strategies with custom risk settings. Real-time alerts via Telegram."}),i.jsx("meta",{name:"og:image",content:"https://app.dextrabot.com/dextrabotIcon.png"}),i.jsx("meta",{name:"og:url",content:"https://app.dextrabot.com/"}),i.jsx("link",{rel:"canonical",href:"https://app.dextrabot.com/"}),i.jsx("meta",{name:"theme-color",content:"#121213"}),i.jsx("script",{type:"application/ld+json",children:JSON.stringify({"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://app.dextrabot.com/#organization",name:"Dextrabot",url:"https://app.dextrabot.com/",logo:{"@type":"ImageObject","@id":"https://app.dextrabot.com/#logo",url:"https://app.dextrabot.com/assets/dextrabotIcon-B5aLRkPC.png",width:192,height:192,caption:"Dextrabot - Copy Trade on Hyperliquid"},sameAs:["https://x.com/dextrabot","https://discord.gg/dextrabot"]},{"@type":"WebSite","@id":"https://app.dextrabot.com/#website",url:"https://app.dextrabot.com/",name:"Dextrabot",description:"Find profitable Hyperliquid traders, analyze their strategies, and automatically copy their trades. Real-time alerts and advanced analytics for Hyperliquid.",publisher:{"@id":"https://app.dextrabot.com/#organization"},potentialAction:{"@type":"SearchAction",target:"https://app.dextrabot.com/wallet-details/{search_term_string}","query-input":"required name=search_term_string"}},{"@type":"WebPage","@id":"https://app.dextrabot.com/#webpage",url:"https://app.dextrabot.com/",name:"Discover, Analyze & Copy Trade Top Traders on Hyperliquid | Dextrabot",isPartOf:{"@id":"https://app.dextrabot.com/#website"},about:{"@id":"https://app.dextrabot.com/#organization"},description:"Find profitable Hyperliquid traders, analyze their strategies, and automatically copy their trades with customizable risk parameters.",inLanguage:"en-US"},{"@type":"SoftwareApplication","@id":"https://app.dextrabot.com/#softwareapplication",name:"Dextrabot",operatingSystem:"Web",applicationCategory:"DeFiApplication",offers:{"@type":"Offer",price:"0.055",priceCurrency:"USDC",priceSpecification:{"@type":"UnitPriceSpecification",price:"0.055",priceCurrency:"USDC",unitCode:"PERCENT",description:"0.055% fee for every copy trade transaction"}},featureList:["Copy Trade","Wallet Discovery","Performance Analytics","Real-time Alerts","Telegram Notifications"]},{"@type":"FAQPage","@id":"https://app.dextrabot.com/#faqpage",mainEntity:[{"@type":"Question",name:"How does copy trade work on Dextrabot?",acceptedAnswer:{"@type":"Answer",text:"Dextrabot monitors wallet activity and automatically executes the same perpetual positions in your account based on your risk settings."}},{"@type":"Question",name:"What fees does Dextrabot charge?",acceptedAnswer:{"@type":"Answer",text:"Dextrabot charges 0.055% on trade size for copy trade transactions. Use a referral code for a 4% discount."}},{"@type":"Question",name:"How do I set up Telegram notifications?",acceptedAnswer:{"@type":"Answer",text:"Connect your Telegram account through the Tracker page to receive instant alerts about wallet activities and copy trades."}},{"@type":"Question",name:"What risk management options are available?",acceptedAnswer:{"@type":"Answer",text:"Dextrabot offers customizable stop-loss and take-profit levels, position size limits, and margin increase controls for comprehensive risk management."}},{"@type":"Question",name:"How does the referral program work?",acceptedAnswer:{"@type":"Answer",text:"You can earn up to 65% reward on the fees generated by traders you refer to Dextrabot, with multi-tier commissions coming soon."}},{"@type":"Question",name:"Can I copy multiple wallets simultaneously?",acceptedAnswer:{"@type":"Answer",text:"Yes, you can copy trade multiple wallets at once, each with their own customized risk parameters and position sizing."}}]}]})})]})}),i.jsxs("div",{className:"bg-[#121213] p-4 w-screen h-screen overflow-x-hidden overflow-y-auto relative z-50",children:[i.jsx("div",{className:"landing-green-background-landing h-full w-full absolute -z-10 top-0"}),i.jsx(Vce,{scrollToFeatures:()=>{var r;return(r=e.current)==null?void 0:r.scrollIntoView({behavior:"smooth"})},scrollToHowItWorks:()=>{var r;return(r=t.current)==null?void 0:r.scrollIntoView({behavior:"smooth"})},scrollToFAQ:()=>{var r;return(r=n.current)==null?void 0:r.scrollIntoView({behavior:"smooth"})}}),i.jsx(Kan,{}),i.jsx("div",{ref:e,children:i.jsx(Yan,{})}),i.jsx("div",{ref:t,children:i.jsx(Xan,{})}),i.jsx("div",{ref:n,children:i.jsx(Qan,{})}),i.jsx(Wce,{})]})]})};var Xx={},PCe;function non(){if(PCe)return Xx;PCe=1;var e=Xx.__assign||function(){return e=Object.assign||function(d){for(var f,x=1,g=arguments.length;x<g;x++){f=arguments[x];for(var v in f)Object.prototype.hasOwnProperty.call(f,v)&&(d[v]=f[v])}return d},e.apply(this,arguments)},t=Xx.__createBinding||(Object.create?function(d,f,x,g){g===void 0&&(g=x);var v=Object.getOwnPropertyDescriptor(f,x);(!v||("get"in v?!f.__esModule:v.writable||v.configurable))&&(v={enumerable:!0,get:function(){return f[x]}}),Object.defineProperty(d,g,v)}:function(d,f,x,g){g===void 0&&(g=x),d[g]=f[x]}),n=Xx.__setModuleDefault||(Object.create?function(d,f){Object.defineProperty(d,"default",{enumerable:!0,value:f})}:function(d,f){d.default=f}),r=Xx.__importStar||function(){var d=function(f){return d=Object.getOwnPropertyNames||function(x){var g=[];for(var v in x)Object.prototype.hasOwnProperty.call(x,v)&&(g[g.length]=v);return g},d(f)};return function(f){if(f&&f.__esModule)return f;var x={};if(f!=null)for(var g=d(f),v=0;v<g.length;v++)g[v]!=="default"&&t(x,f,g[v]);return n(x,f),x}}(),s=Xx.__rest||function(d,f){var x={};for(var g in d)Object.prototype.hasOwnProperty.call(d,g)&&f.indexOf(g)<0&&(x[g]=d[g]);if(d!=null&&typeof Object.getOwnPropertySymbols=="function")for(var v=0,g=Object.getOwnPropertySymbols(d);v<g.length;v++)f.indexOf(g[v])<0&&Object.prototype.propertyIsEnumerable.call(d,g[v])&&(x[g[v]]=d[g[v]]);return x};Object.defineProperty(Xx,"__esModule",{value:!0});var a=r(ax()),o=WUe(),l=qUe(),c=[(0,l.createAnimation)("PacmanLoader","0% {transform: rotate(0deg)} 50% {transform: rotate(-44deg)}","pacman-1"),(0,l.createAnimation)("PacmanLoader","0% {transform: rotate(0deg)} 50% {transform: rotate(44deg)}","pacman-2")];function u(d){var f=d.loading,x=f===void 0?!0:f,g=d.color,v=g===void 0?"#000000":g,w=d.speedMultiplier,C=w===void 0?1:w,N=d.cssOverride,P=N===void 0?{}:N,I=d.size,R=I===void 0?25:I,F=d.margin,U=F===void 0?2:F,L=s(d,["loading","color","speedMultiplier","cssOverride","size","margin"]),z=(0,o.parseLengthAndUnit)(R),Q=z.value,ne=z.unit,J=e({display:"inherit",position:"relative",fontSize:0,height:"".concat(Q*2).concat(ne),width:"".concat(Q*2).concat(ne)},P),X=(0,l.createAnimation)("PacmanLoader",`75% {opacity: 0.7}
100% {transform: translate(`.concat("".concat(-4*Q).concat(ne),", ").concat("".concat(-Q/4).concat(ne),")}"),"ball"),re=function(V){return{width:"".concat(Q/3).concat(ne),height:"".concat(Q/3).concat(ne),backgroundColor:v,margin:(0,o.cssValue)(U),borderRadius:"100%",transform:"translate(0, ".concat("".concat(-Q/4).concat(ne),")"),position:"absolute",top:"".concat(Q).concat(ne),left:"".concat(Q*4).concat(ne),animation:"".concat(X," ").concat(1/C,"s ").concat(V*.25,"s infinite linear"),animationFillMode:"both"}},pe="".concat((0,o.cssValue)(R)," solid transparent"),Y="".concat((0,o.cssValue)(R)," solid ").concat(v),ie=function(V){return{width:0,height:0,borderRight:pe,borderTop:V===0?pe:Y,borderLeft:Y,borderBottom:V===0?Y:pe,borderRadius:(0,o.cssValue)(R),position:"absolute",animation:"".concat(c[V]," ").concat(.8/C,"s infinite ease-in-out"),animationFillMode:"both"}},oe=ie(0),G=ie(1);return x?a.createElement("span",e({style:J},L),a.createElement("span",{style:oe}),a.createElement("span",{style:G}),a.createElement("span",{style:re(2)}),a.createElement("span",{style:re(3)}),a.createElement("span",{style:re(4)}),a.createElement("span",{style:re(5)})):null}return Xx.default=u,Xx}var ron=non();const son=Ti(ron),ion=()=>{const{setHyperToken:e,setHyperAddress:t}=m.useContext(Qr),[n]=qNe(),r=Vo(),s=n.get("temp_mobile_password");return m.useEffect(()=>{s?(async()=>{try{const o=await fs.post("https://dextrabothypev2.nftinit.io/api/subscriber/sign_mobile_complete/",{temp_mobile_password:s},{headers:{"Content-Type":"application/json"}}),{token:l,address:c}=o.data;setTimeout(()=>{window.localStorage.setItem("hyperToken",l),window.localStorage.setItem("hyperAddress",c),t(c),e(l),rn.success("Authentication successful.",{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(103, 255, 189, 0.16)",width:"280px",minWidth:"280px",height:"40px",backdropFilter:"blur(16px)"},iconTheme:{primary:"#67FFBD",secondary:"#276047"}}),r("/discover-wallets")},1e3)}catch{rn.error("Invalid QR or request failed."),r("/")}})():r("/")},[s,e,t,r]),i.jsxs("div",{className:"w-screen text-white flex flex-col items-center justify-center min-h-screen gap-4 ",children:[i.jsx("img",{src:Gi,alt:"",className:"w-24 h-24"}),i.jsx("div",{className:"font-manrope font-bold text-lg",children:"Welcome to Dextrabot"}),i.jsx("div",{className:"font-manrope font-bold text-lg",children:"Authenticating..."}),i.jsx(son,{color:"#46eda1",size:30})]})},aon=()=>i.jsxs(i.Fragment,{children:[i.jsx(So,{children:i.jsxs(Ro,{children:[i.jsx("meta",{name:"description",content:"Navigate all sections of Dextrabot through our comprehensive sitemap. Find links to copy trading features, wallet management, leaderboards, and more in one convenient location."}),i.jsx("meta",{name:"og:title",content:"Complete Dextrabot Website Sitemap"}),i.jsx("meta",{name:"og:description",content:"Navigate all sections of Dextrabot through our comprehensive sitemap. Find links to copy trading features, wallet management, leaderboards, and more in one convenient location."}),i.jsx("meta",{name:"og:image",content:"https://app.dextrabot.com/dextrabotIcon.png"}),i.jsx("meta",{name:"og:url",content:"https://app.dextrabot.com/sitemap"})]})}),i.jsxs("div",{className:"bg-[#121213] p-4 w-screen h-screen overflow-x-hidden overflow-y-auto relative z-50",children:[i.jsx("div",{className:"h-full w-full absolute -z-10 -mt-[138px]"}),i.jsx(Vce,{scrollToFeatures:()=>{var e;return(e=featuresRef.current)==null?void 0:e.scrollIntoView({behavior:"smooth"})},scrollToHowItWorks:()=>{var e;return(e=howItWorksRef.current)==null?void 0:e.scrollIntoView({behavior:"smooth"})},scrollToFAQ:()=>{var e;return(e=faQRef.current)==null?void 0:e.scrollIntoView({behavior:"smooth"})}}),i.jsx("section",{className:"px-1 py-5 sm:py-[64px] text-center h-[calc(100vh-190px)]",children:i.jsx("div",{className:"max-w-7xl mx-auto h-full",children:i.jsx("div",{className:"flex flex-col items-start gap-[88px] h-full",children:i.jsxs("div",{className:"flex flex-col items-start justify-start gap-6 h-full",children:[i.jsx("h2",{className:"text-start justify-start text-white text-[40px] font-semibold font-['Manrope'] leading-[48px]",children:"Dextrabot Sitemap"}),i.jsx("div",{className:"flex flex-col items-start",children:i.jsx("nav",{"aria-label":"Sitemap",children:i.jsxs("ul",{className:"text-start text-[#c9c9c9] text-base font-semibold font-['Manrope']",children:[i.jsx("li",{children:i.jsx("a",{href:"/",className:"hover:text-white text-[#c9c9c9] underline",children:"Dextrabot Homepage"})}),i.jsx("li",{children:i.jsx("a",{href:"/discover-wallets",className:"hover:text-white text-[#c9c9c9] underline",children:"Discover Wallets"})}),i.jsx("li",{children:i.jsx("a",{href:"/copy-trade",className:"hover:text-white text-[#c9c9c9] underline",children:"Copy Trade"})}),i.jsx("li",{children:i.jsx("a",{href:"/wallet-management",className:"hover:text-white text-[#c9c9c9] underline",children:"Wallet Management"})}),i.jsx("li",{children:i.jsx("a",{href:"/tracked-wallets",className:"hover:text-white text-[#c9c9c9] underline",children:"Tracked Wallets"})}),i.jsx("li",{children:i.jsx("a",{href:"/tracker",className:"hover:text-white text-[#c9c9c9] underline",children:"My Activities"})}),i.jsx("li",{children:i.jsx("a",{href:"/referral",className:"hover:text-white text-[#c9c9c9] underline",children:"Referral"})}),i.jsx("li",{children:i.jsx("a",{href:"/leaderboard",className:"hover:text-white text-[#c9c9c9] underline",children:"Leaderboard"})})]})})})]})})})}),i.jsx(Wce,{})]})]}),oon=()=>{const e=[{id:"JDdZ5yWmEXk",title:"The Best Vaults on Hyperliquid (Get your free Google Vault Analysis Sheet)"},{id:"bCJTNChKfFA",title:"Copy Trading Challenge: Day 7: Wallet Adjustments (Reduced the Number of Copy Traded Wallets to one)"},{id:"l6xkJugg1PY",title:"Copy Trading Vaults on Hyperliquid (with Dextrabot)"},{id:"Yu_V6YNw6oA",title:"Hottest Copy Traded Wallets (Hyperliquid Copy Trading)"},{id:"OwpWPDGBJUU",title:"Copy Trading Challenge: Day 6 (+1500 USD) - Hyperliquid Copy Trading"},{id:"gN11fXPPFvU",title:"Copy Trading Challenge: Day 2 (Analysing Current Situation & Some Tips / Info on Hyperliquid)"},{id:"LDEjjcR-FqE",title:"Copy Trading Challenge: Day 1 (Finding & Analysing Wallets - Starting Copy Trading on Hyperliquid)"},{id:"HVxt-rnXHfk",title:"Copy Trading Tips & Tricks - (Hyperliquid Automated Copy Trading)"},{id:"e6ePwfGaMRc",title:"Hyperliquid Copy Trading: Mirror Copy Trading (Trade At The Same Margin Usage As The Source Wallet)"},{id:"Z1QB190V9M0",title:"Hyperliquid Copy Trading: Copy Current Positions (Dextrabot)"},{id:"C_mqwSqT2mI",title:"Hyperliquid Copy Trading Software in Action!"},{id:"jJYxbdkq514",title:"Hyperliqud Free Wallet Tracker (Telegram and Webpage) - Copy Trading"},{id:"gpzB62yp-rY",title:"Hyperliqud Copy Trading & Wallet Analysis Tool (Dextra: First of its kind!)"}];return i.jsxs(i.Fragment,{children:[i.jsx(So,{children:i.jsxs(Ro,{children:[i.jsx("title",{children:"Hyperliquid Copy Trade Video Tutorials & Guides"}),i.jsx("meta",{name:"description",content:"Watch step-by-step Dextrabot video tutorials on Hyperliquid copy trading. Learn how to set up copy trading and discover profitable wallets."}),i.jsx("meta",{name:"og:title",content:"Hyperliquid Copy Trade Video Tutorials & Guides"}),i.jsx("meta",{name:"og:description",content:"Watch step-by-step Dextrabot video tutorials on Hyperliquid copy trading. Learn how to set up copy trading and discover profitable wallets."}),i.jsx("meta",{name:"og:image",content:"https://app.dextrabot.com/dextrabotIcon.png"}),i.jsx("meta",{name:"og:url",content:"https://app.dextrabot.com/videos"})]})}),i.jsxs("div",{className:"bg-[#121213] p-4 w-screen h-screen overflow-x-hidden overflow-y-auto relative z-50",children:[i.jsx("div",{className:"h-full w-full absolute -z-10 -mt-[138px]"}),i.jsx(Vce,{scrollToFeatures:()=>{var t;return(t=featuresRef.current)==null?void 0:t.scrollIntoView({behavior:"smooth"})},scrollToHowItWorks:()=>{var t;return(t=howItWorksRef.current)==null?void 0:t.scrollIntoView({behavior:"smooth"})},scrollToFAQ:()=>{var t;return(t=faQRef.current)==null?void 0:t.scrollIntoView({behavior:"smooth"})}}),i.jsx("section",{className:"px-1 py-5 sm:py-[64px] text-center",children:i.jsx("div",{className:"max-w-7xl mx-auto h-full",children:i.jsx("div",{className:"flex flex-col items-start gap-[88px] h-full",children:i.jsxs("div",{className:"flex flex-col items-center justify-center gap-6 h-full",children:[i.jsx("h2",{className:"text-center justify-start text-white text-[40px] font-semibold font-['Manrope'] leading-[48px]",children:"Hyperliquid Copy Trade Video Tutorials & Guides"}),i.jsx("div",{className:"flex justify-center flex-wrap gap-6",children:e.map(t=>i.jsxs("div",{className:"w-full sm:w-1/4 bg-[#1c1c1c] rounded-xl overflow-hidden shadow-md p-4",children:[i.jsx("div",{className:"text-white font-semibold text-base p-4 h-32",children:t.title}),i.jsx("div",{className:"aspect-w-16 aspect-h-9",children:i.jsx("iframe",{src:`https://www.youtube.com/embed/${t.id}`,title:t.title,allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,className:"w-full h-48 rounded-xl"})})]},t.id))})]})})})}),i.jsx(Wce,{})]})]})},UP=(e,t=2)=>Number(e).toLocaleString("en-US",{style:"currency",currency:"USD",maximumFractionDigits:t}),JY=(e,t=2)=>Number(e).toLocaleString("en-US",{maximumFractionDigits:t}),FCe=e=>`${(e*100).toFixed(2)}%`,eX=e=>Math.floor((Date.now()-e)/864e5);function lon(){const[e,t]=m.useState([]),[n,r]=m.useState(!0),[s,a]=m.useState(""),[o,l]=m.useState(""),[c,u]=m.useState(""),[d,f]=m.useState(""),[x,g]=m.useState(""),[v,w]=m.useState(!1),[C,N]=m.useState(""),[P,I]=m.useState("tvl"),[R,F]=m.useState("desc"),[U,L]=m.useState(20),[z,Q]=m.useState(1),ne=ee=>(ee.summary.name||"").trim()==="Hyperliquidity Provider (HLP)",J=()=>{r(!0),fs.get("https://stats-data.hyperliquid.xyz/Mainnet/vaults").then(ee=>t(Array.isArray(ee.data)?ee.data:[])).finally(()=>r(!1))};m.useEffect(()=>J(),[]);const X=(ee,ae)=>{var Ne;const fe=(Ne=ee.pnls)==null?void 0:Ne.find(([he])=>he===ae);return fe?parseFloat(fe[1].slice(-1)[0]||0):0},re=m.useMemo(()=>{if(!e.length)return null;const ee=e.reduce((fe,Ne)=>fe+ +Ne.summary.tvl,0),ae=e.reduce((fe,Ne)=>fe+(Ne.apr||0),0)/e.length;return{total:e.length,active:e.filter(fe=>!fe.summary.isClosed).length,tvl:ee,avgApr:ae,profitable:e.filter(fe=>X(fe,"allTime")>0).length}},[e]),pe=m.useMemo(()=>e.filter(ee=>{const ae=+ee.summary.tvl,fe=ee.apr||0,Ne=X(ee,"month"),he=X(ee,"allTime"),ge=eX(ee.summary.createTimeMillis),ye=(ee.summary.name||"").toLowerCase()+(ee.summary.vaultAddress||"").toLowerCase();return!(s&&ae<+s||o&&fe*100<+o||c&&Ne<+c||d&&he<+d||x&&ge<+x||!v&&ee.summary.isClosed||C&&!ye.includes(C.toLowerCase()))}),[e,s,o,c,d,x,v,C]),Y=(ee,ae)=>{var fe;switch(ae){case"name":return((fe=ee.summary.name)==null?void 0:fe.toLowerCase())||"";case"apr":return ee.apr||0;case"tvl":return+ee.summary.tvl;case"p30":return X(ee,"month");case"pAll":return X(ee,"allTime");case"days":return eX(ee.summary.createTimeMillis);default:return 0}},ie=m.useMemo(()=>[...pe].sort((ee,ae)=>{const fe=Y(ee,P),Ne=Y(ae,P);return fe===Ne?0:R==="asc"?fe>Ne?1:-1:fe<Ne?1:-1}),[pe,P,R]),oe=Math.max(1,Math.ceil(ie.length/U)),G=ie.slice((z-1)*U,z*U),V=(ee,ae)=>i.jsx("th",{onClick:()=>I(ee)||F(P===ee?R==="asc"?"desc":"asc":"desc"),className:`px-3 py-2 cursor-pointer whitespace-nowrap ${P===ee?"text-[#67FFBD]":""}`,children:ae},ee);return n?i.jsx("div",{className:"flex justify-center items-center w-full py-10",children:i.jsx(ZUe,{color:"#ffffff",size:40})}):i.jsxs(i.Fragment,{children:[i.jsx(So,{children:i.jsxs(Ro,{children:[i.jsx("title",{children:"Hyperliquid Vaults Dashboard | Track Performance Metrics | Dextrabot"}),i.jsx("meta",{name:"description",content:"Monitor real-time performance of 7,200+ Hyperliquid vaults with comprehensive metrics on TVL, APR, and PnL. Filter by performance criteria to find the most profitable vaults."}),i.jsx("meta",{name:"og:title",content:"Hyperliquid Vaults Dashboard | Track Performance Metrics | Dextrabot"}),i.jsx("meta",{name:"og:description",content:"Monitor real-time performance of 7,200+ Hyperliquid vaults with comprehensive metrics on TVL, APR, and PnL. Filter by performance criteria to find the most profitable vaults."}),i.jsx("meta",{name:"og:image",content:"https://app.dextrabot.com/dextrabotIcon.png"}),i.jsx("meta",{name:"og:url",content:"https://app.dextrabot.com/hyperliquid-vaults"})]})}),i.jsxs("div",{className:"max-w-7xl mx-auto p-6 font-manrope font-bold w-full",children:[i.jsx("h1",{className:"text-3xl font-bold text-center mb-8 text-white",children:"Hyperliquid Vaults Dashboard"}),i.jsx("button",{onClick:()=>{J(),Q(1)},disabled:n,className:"bg-[#1c1c1c] hover:bg-[#303030] text-white px-4 py-2 rounded disabled:opacity-40 text-sm font-bold mb-4 flex justify-end",children:n?"Refreshing…":"Refresh Data"}),re&&i.jsx("div",{className:"grid sm:grid-cols-2 lg:grid-cols-5 gap-4 mb-8 text-center",children:[["Total Vaults",JY(re.total,0)],["Active Vaults",JY(re.active,0)],["Total TVL",UP(re.tvl,0)],["Average APR",FCe(re.avgApr)],["Profitable Vaults",JY(re.profitable,0)]].map(([ee,ae])=>i.jsxs("div",{className:"bg-[#1c1c1c] rounded-lg p-4",children:[i.jsx("p",{className:"text-sm text-gray-400 mb-1",children:ee}),i.jsx("p",{className:"text-xl font-semibold text-white",children:ae})]},ee))}),i.jsxs("div",{className:"bg-[#1c1c1c] rounded-lg p-4 mb-8",children:[i.jsx("h2",{className:"text-xl font-semibold mb-4 text-white",children:"Filters"}),i.jsxs("div",{className:"grid md:grid-cols-6 gap-4 mb-4",children:[[["Min TVL",s,a],["Min APR (%)",o,l],["Min 30d PNL",c,u],["Min All-Time PNL",d,f],["Min Days",x,g]].map(([ee,ae,fe])=>i.jsxs("div",{className:"flex flex-col",children:[i.jsx("label",{className:"text-sm text-gray-300 mb-1",children:ee}),i.jsx("input",{type:"number",value:ae===0?"":ae,placeholder:"0",onChange:Ne=>fe(Ne.target.value===""?"":+Ne.target.value),className:"bg-[#303030] text-white rounded px-3 py-2 outline-none"})]},ee)),i.jsxs("div",{className:"flex flex-col",children:[i.jsx("label",{className:"text-sm text-gray-300 mb-1",children:"Search"}),i.jsx("input",{value:C,onChange:ee=>N(ee.target.value),className:"bg-[#303030] text-white rounded px-3 py-2 outline-none"})]})]}),i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsxs("label",{className:"flex items-center text-sm text-gray-300",children:[i.jsx("input",{type:"checkbox",checked:v,onChange:ee=>w(ee.target.checked),className:"mr-2"}),"Show Closed Vaults"]}),i.jsx("button",{onClick:()=>{a(""),l(""),u(""),f(""),g(""),w(!1),N("")},className:"bg-[#303030] text-white px-3 py-1 text-sm font-bold rounded",children:"Reset"})]})]}),i.jsx("div",{className:"rounded-lg overflow-auto border border-[#303030]",children:i.jsxs("table",{className:"min-w-full text-sm text-gray-200 border-separate border-spacing-y-1",children:[i.jsx("thead",{className:"bg-[#161616]",children:i.jsxs("tr",{children:[V("name","Vault"),V("tvl","TVL"),V("apr","APR"),V("p30","30d PNL"),V("pAll","All-Time PNL"),V("days","Days")]})}),i.jsx("tbody",{children:G.map((ee,ae)=>{const fe=+ee.summary.tvl,Ne=ee.apr||0,he=X(ee,"month"),ge=X(ee,"allTime"),ye=eX(ee.summary.createTimeMillis),ve=ee.summary.vaultAddress;return i.jsxs("tr",{className:"border-b border-[#1b1b1b] bg-[#1b1b1b] hover:bg-[#222222] text-center",children:[i.jsxs("td",{className:"px-3 py-2 whitespace-nowrap flex items-center gap-2",children:[i.jsx("a",{href:`https://app.hyperliquid.xyz/vaults/${ve}`,target:"_blank",rel:"noopener noreferrer",className:"hover:text-[#67FFBD] font-bold text-white",children:ee.summary.name||"Unnamed"}),i.jsx("a",{href:`/wallet-details/${ve}`,target:"_blank",rel:"noopener noreferrer",children:i.jsx("img",{src:Gi,className:"w-4 h-4"})}),ne(ee)&&i.jsx("span",{className:"text-[#FF7173] ml-1",children:"(Protocol Vault)"})]}),i.jsx("td",{className:"px-3 py-2",children:UP(fe)}),i.jsx("td",{className:"px-3 py-2",children:FCe(Ne)}),i.jsx("td",{className:`px-3 py-2 ${he>=0?"text-[#67FFBD]":"text-[#FF7173]"}`,children:UP(he)}),i.jsx("td",{className:`px-3 py-2 ${ge>=0?"text-[#67FFBD]":"text-[#FF7173]"}`,children:UP(ge)}),i.jsx("td",{className:"px-3 py-2",children:ye})]},ve)})})]})}),i.jsxs("div",{className:"flex items-center justify-between mt-4 text-gray-200",children:[i.jsxs("div",{className:"text-sm",children:["Rows:",i.jsx("select",{value:U,onChange:ee=>{L(+ee.target.value),Q(1)},className:"bg-[#303030] ml-2 px-2 py-1 rounded text-sm font-bold",children:[10,20,30,40,50,100].map(ee=>i.jsx("option",{children:ee},ee))})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("button",{onClick:()=>Q(ee=>Math.max(1,ee-1)),disabled:z===1,className:"px-2 py-1 bg-[#1c1c1c] rounded disabled:opacity-40",children:"‹"}),i.jsxs("span",{className:"text-sm",children:[z,"/",oe]}),i.jsx("button",{onClick:()=>Q(ee=>Math.min(oe,ee+1)),disabled:z===oe,className:"px-2 py-1 bg-[#1c1c1c] rounded disabled:opacity-40",children:"›"})]})]})]})]})}const Nh=({title:e,sortKey:t,sortOption:n,setSortOption:r,isFilterIcon:s})=>{const a=()=>{r(n===`-${t}`?t:`-${t}`)};return i.jsx(i.Fragment,{children:i.jsxs("div",{onClick:()=>a(),className:`${e==="Wallet"?"sm:sticky left-0 h-8":s?"justify-end":"justify-start"} flex items-center gap-1 min-w-max font-manrope cursor-pointer`,children:[i.jsx("div",{className:`${n.includes(t)?"text-white":""} cursor-pointer flex items-center justify-end group`,children:e}),i.jsx(uU,{sortKey:t,state:n,className:""})]})})},con=({data:e,period:t})=>i.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-2 lg:gap-4 px-2 sm:px-0 min-w-max",children:e?e==null?void 0:e.map((n,r)=>i.jsxs(m.Fragment,{children:[i.jsx(gb,{title:"Total Notional",value:n!=null&&n.total_notional?n==null?void 0:n.total_notional:"--",info:`${n!=null&&n.ticker_count?n==null?void 0:n.ticker_count:"--"} tickers`,icon:Gme,period:t}),i.jsx(gb,{title:"Long Positions",value:n!=null&&n.long_exposure?n==null?void 0:n.long_exposure:"--",info:"Long exposure",icon:gJ,period:t}),i.jsx(gb,{title:"Short Positions",value:n!=null&&n.short_exposure?n==null?void 0:n.short_exposure:"--",info:"Short exposure",icon:bJ,period:t}),i.jsx(gb,{title:"Global Bias",value:n!=null&&n.global_bias?n==null?void 0:n.global_bias:"--",info:`L/S: ${n!=null&&n.long_ratio_percent?n==null?void 0:n.long_ratio_percent:"--"}%`,icon:4,period:t})]},r)):i.jsxs(i.Fragment,{children:[i.jsx(gb,{title:"Total Notional",value:"--",info:"--",icon:Gme,period:t}),i.jsx(gb,{title:"Long Positions",value:"--",info:"Long exposure",icon:gJ,period:t}),i.jsx(gb,{title:"Short Positions",value:"--",info:"Short exposure",icon:bJ,period:t}),i.jsx(gb,{title:"Global Bias",value:"--",info:"L/S: --",icon:4,period:t})]})}),gb=({title:e,value:t,info:n,icon:r,period:s})=>i.jsxs("div",{style:{background:"linear-gradient(180deg, #000000 0%, #1C1C1C 100%)"},className:"h-20 lg:h-28 bg-[#1c1c1c] rounded-2xl p-2 lg:p-6 min-w-max relative overflow-hidden",children:[i.jsxs("div",{className:"flex justify-start items-start w-full h-full gap-2",children:[i.jsx("div",{className:"w-8 h-11 lg:w-12 lg:h-11 bg-[#1e1e1e] rounded-md border-[0.50px] border-[#313131] flex justify-center items-center",children:r===4?i.jsx(DRt,{className:`${t=="LONG"?"text-[#34D399]":(t=="SHORT","text-[#F87171]")} w-4 h-4 lg:w-5 lg:h-5`}):i.jsx("img",{src:r,alt:"",className:"w-4 h-4 lg:w-5 lg:h-5"})}),i.jsxs("div",{className:"flex flex-col items-start justify-start gap-2",children:[i.jsx("div",{className:"justify-start text-[#9b9b9b] text-[13px] lg:text-[14px] font-semibold font-['Manrope'] leading-[13px] tracking-tight mt-[3px]",children:`${e}`}),i.jsx("div",{className:"justify-start text-white text-[15px] lg:text-[17px] font-semibold font-['Manrope'] leading-[13px] tracking-tight",children:e==="Global Bias"?t:`$${tct(t)}`}),i.jsx("div",{className:"justify-start text-[#7e7e7e] text-[11px] lg:text-[12px] font-medium font-['Inter'] leading-[8px] tracking-tight mt-2",children:n})]})]}),r===4&&i.jsx("div",{className:`${t=="LONG"?"bg-[#67ffbd]/20":t=="SHORT"?"bg-[#ff797c]/20":""} h-2 lg:h-4 w-full absolute bottom-0 right-0 rounded-t-2xl`})]}),One=({data_1:e,data_2:t,margin:n})=>i.jsxs("div",{className:`${n=="true"?"mt-3":""} flex flex-col items-start justify-start gap-2 w-full px-1`,children:[i.jsx("div",{className:"text-white bg-transparent text-xs font-medium font-inter leading-[8px] tracking-[0.18px] w-full",children:i.jsxs("span",{className:"flex justify-between items-center",children:[i.jsx("span",{className:"text-[#67ffbd]",children:e?`${e}%`:"--"}),i.jsx("span",{className:"text-[#ff787b]",children:t?`${t}%`:"--"})]})}),i.jsxs("div",{className:"h-1 w-full bg-[#333333] rounded-[256px] flex gap-[2px] overflow-hidden",children:[i.jsx("div",{style:e?isNaN(e)?{width:"0%"}:{width:`${e}%`}:{width:"0%"},className:"flex justify-center items-center h-1 bg-[#67FFBD] rounded-[256px] text-[#67ffbd] text-[11px] font-bold font-inter leading-[8px] tracking-[0.18px]"}),i.jsx("div",{style:t?isNaN(t)?{width:"0%"}:{width:`${t}%`}:{width:"0%"},className:"bg-[#FF797C] h-1 rounded-[256px] flex justify-center items-center text-[#67ffbd] text-[11px] font-bold font-inter leading-[8px] tracking-[0.18px]"})]}),i.jsx("div",{className:"text-white bg-transparent text-[11px] font-medium font-inter leading-[8px] tracking-[0.18px] w-full",children:i.jsxs("span",{className:"flex justify-between items-center",children:[i.jsx("span",{className:"text-[#67ffbd]",children:"Long"}),i.jsx("span",{className:"text-[#ff787b]",children:"Short"})]})})]}),uon=({data:e,loading:t,error:n,period:r,periods:s,handlePeriodChange:a})=>{var ne,J;const o="-total_notional",[l,c]=m.useState(o),[u,d]=m.useState("All"),f=m.useRef({}),[x,g]=m.useState(""),v=m.useRef(null),w=X=>{var pe;const re=(pe=e.data)==null?void 0:pe.filter(Y=>{var oe,G,V,ee,ae;if(u!=="All"&&Y.majority_side!==u)return!1;const ie=(oe=x==null?void 0:x.trim())==null?void 0:oe.toLowerCase();return!(ie!==""&&!((V=(G=Y==null?void 0:Y.asset)==null?void 0:G.toLowerCase())!=null&&V.includes(ie)||(ae=(ee=Y==null?void 0:Y.coin_name)==null?void 0:ee.toLowerCase())!=null&&ae.includes(ie)))});return re==null?void 0:re.sort((Y,ie)=>{const oe=Y.asset?Y.asset.toUpperCase():"",G=ie.asset?ie.asset.toUpperCase():"",V=Y.majority_side==="LONG"?1:0,ee=ie.majority_side==="LONG"?1:0,ae=Y.majority_side==="SHORT"?1:0,fe=ie.majority_side==="SHORT"?1:0,Ne=Y.maj_side_pnl==="Profit"?1:0,he=ie.maj_side_pnl==="Profit"?1:0,ge=Y.maj_side_pnl==="Loss"?1:0,ye=ie.maj_side_pnl==="Loss"?1:0,ve=$e=>{if(!$e||typeof $e!="string"||!$e.includes("/"))return 0;const[it,tt]=$e.split("/").map(lt=>Number(lt.trim()));return tt!==0?it/tt:0},je=ve(Y.traders_l_s),Ie=ve(ie.traders_l_s),Le=$e=>{var lt,ft;const it=parseFloat((lt=$e==null?void 0:$e.asset_change24h)==null?void 0:lt.markPx),tt=parseFloat((ft=$e==null?void 0:$e.asset_change24h)==null?void 0:ft.prevDayPx);return!it||!tt||isNaN(it)||isNaN(tt)||tt===0?-1/0:(it-tt)/tt*100},Qe=$e=>{var tt;const it=parseFloat((tt=$e==null?void 0:$e.asset_change24h)==null?void 0:tt.markPx);return isNaN(it)?0:it};return X==="asset"?oe<G?-1:oe>G?1:0:X==="-asset"?oe>G?-1:oe<G?1:0:X==="-total_notional"?ie.total_notional-Y.total_notional:X==="total_notional"?Y.total_notional-ie.total_notional:X==="-price"?Qe(ie)-Qe(Y):X==="price"?Qe(Y)-Qe(ie):X==="-long_notional"?ie.long_notional-Y.long_notional:X==="long_notional"?Y.long_notional-ie.long_notional:X==="-short_notional"?ie.short_notional-Y.short_notional:X==="short_notional"?Y.short_notional-ie.short_notional:X==="-total_long_pnl"?ie.total_long_pnl-Y.total_long_pnl:X==="total_long_pnl"?Y.total_long_pnl-ie.total_long_pnl:X==="-total_short_pnl"?ie.total_short_pnl-Y.total_short_pnl:X==="total_short_pnl"?Y.total_short_pnl-ie.total_short_pnl:X==="-majority_side"?ee-V:X==="majority_side"?fe-ae:X==="-l_s_ratio"?ie.l_s_ratio-Y.l_s_ratio:X==="l_s_ratio"?Y.l_s_ratio-ie.l_s_ratio:X==="-long_ratio"?ie.long_ratio-Y.long_ratio:X==="long_ratio"?Y.long_ratio-ie.long_ratio:X==="-short_ratio"?ie.short_ratio-Y.short_ratio:X==="short_ratio"?Y.short_ratio-ie.short_ratio:X==="-maj_side_notional"?ie.maj_side_notional-Y.maj_side_notional:X==="maj_side_notional"?Y.maj_side_notional-ie.maj_side_notional:X==="-maj_side_pnl"?he-Ne:X==="maj_side_pnl"?ye-ge:X==="-traders_l_s"?Ie-je:X==="traders_l_s"?je-Ie:X==="-open_interest"?ie.open_interest-Y.open_interest:X==="open_interest"?Y.open_interest-ie.open_interest:X==="-change_24h"?Le(ie)-Le(Y):X==="change_24h"?Le(Y)-Le(ie):0})},C=m.useRef(null),N=()=>{C.current&&(C.current.scrollLeft-=100)},P=()=>{C.current&&(C.current.scrollLeft+=100)},I=()=>{C.current&&(C.current.scrollTop+=200)},R=()=>{C.current&&(C.current.scrollTop-=200)},F=X=>{var re;X.key==="Escape"&&(g(""),(re=v.current)==null||re.blur())},U=({coin:X,price:re,prevPricesRef:pe})=>{const[Y,ie]=m.useState("text-white");return m.useEffect(()=>{if(!X||re==null||isNaN(re))return;const oe=parseFloat(re),G=pe.current[X]??0;oe>G?ie("text-[#1DE6A3]"):oe<G&&ie("text-[#FF7173]"),pe.current[X]=oe;const V=setTimeout(()=>{ie("text-white")},800);return()=>clearTimeout(V)},[re,X]),i.jsx(Qx,{info:re==null||isNaN(re)?i.jsx("div",{className:"flex items-center justify-end w-[96px]",children:i.jsx("div",{className:"w-[96px] max-w-[96px] h-[20px] rounded skeleton-ticker-text short"})}):`$${re>=1e3?Ww(re):re}`,textColor:Y})},L={kBONK:"BONK",kPEPE:"PEPE",kSHIB:"SHIB",kFLOKI:"FLOKI",kNEIRO:"NEIRO",kDOGS:"DOGS",kLUNC:"LUNC"},z=()=>i.jsx("div",{className:"flex items-center justify-end w-[96px]",children:i.jsx("div",{className:"w-[96px] max-w-[96px] h-[20px] rounded skeleton-ticker-text short"})}),Q=X=>X>=376&&X<500?4:X>=500&&X<640?5:X>=640&&X<768?6:X>=768&&X<1024?7:X>=1024&&X<1280?9:X>=1280&&X<1540?11:X>=1540&&X<1700||X>=1700?12:3;return i.jsx(i.Fragment,{children:i.jsxs("div",{className:"flex flex-col items-stretch justify-start gap-[10px] sm:gap-[13px] text-white bg-[#161616] w-full h-full font-manrope",children:[i.jsx("div",{className:"flex justify-between sm:justify-start items-center gap-6 w-full sm:w-max",children:i.jsxs("div",{className:"flex flex-row sm:flex-col justify-between items-center sm:items-start sm:justify-start gap-2 font-manrope max-w-full w-max sm:w-full bg-[#161616] pl-2 sm:pl-0 pt-1 pr-2 sm:pr-0",children:[i.jsx("div",{className:"text-[#7e7e7e] text-[11px] font-medium font-inter leading-[8px]",children:"Hype / Explore"}),i.jsx("div",{className:"flex items-center justify-start gap-4",children:i.jsx("div",{className:"text-white text-sm sm:text-lg font-medium font-manrope leading-[21px]",children:"Ticker"})})]})}),i.jsx(con,{data:e.topbox,period:r}),i.jsxs("div",{className:"flex justify-start items-center gap-2 w-full h-max px-2 sm:px-0",children:[i.jsxs("div",{className:"flex justify-start items-center gap-0.5 w-max h-max rounded-lg border border-[#333333] p-1",children:[i.jsx("input",{ref:v,type:"text",value:x,onChange:X=>g(X.target.value),onKeyDown:F,className:"bg-[#222222] rounded text-white py-1 pl-2 pr-4 w-40 text-sm outline-none placeholder:text-sm placeholder:font-semibold placeholder:font-manrope placeholder:text-[#7c7c7c]",placeholder:"Search Coin"}),i.jsx("div",{onClick:()=>g(""),className:"text-[#aaa] hover:text-white outline-none focus:outline-none focus:ring-0 border-none w-4 h-[26px] bg-[#222222] hover:bg-[#333333] rounded flex justify-center items-center cursor-pointer",children:i.jsx("img",{src:Ba,alt:"",className:"w-[14px] h-[14px] min-w-[14px] min-h-[14px]"})})]}),i.jsxs("div",{className:"flex justify-start items-center gap-1.5 w-max h-max rounded-lg border border-[#333333] p-1",children:[i.jsx(tX,{title:"All",set_click:()=>d("All"),tableSortButton:u}),i.jsx(tX,{title:"LONG",set_click:()=>d("LONG"),tableSortButton:u}),i.jsx(tX,{title:"SHORT",set_click:()=>d("SHORT"),tableSortButton:u})]})]}),i.jsxs("div",{className:"relative w-full h-full",children:[i.jsxs("div",{className:"absolute -top-6 right-4 z-10 hidden sm:flex justify-start items-center gap-2",children:[i.jsx("button",{onClick:N,className:"bg-[#353535] hover:bg-gray-600 text-white p-1 rounded-lg focus:outline-none focus:ring-0 border-none block lg:hidden",children:i.jsx("span",{className:"w-6 h-6",children:i.jsx(Xa,{className:"text-gray-300 w-4 h-4 rotate-90"})})}),i.jsx("button",{onClick:P,className:"bg-[#353535] hover:bg-gray-600 text-white p-1 rounded-lg focus:outline-none focus:ring-0 border-none block lg:hidden",children:i.jsx("span",{className:"w-6 h-6",children:i.jsx(Xa,{className:"text-gray-300 w-4 h-4 -rotate-90"})})}),i.jsx("button",{onClick:R,className:"bg-[#353535] hover:bg-gray-600 text-white p-1 rounded-lg focus:outline-none focus:ring-0 border-none",children:i.jsx("span",{className:"w-6 h-6",children:i.jsx(Xa,{className:"text-gray-300 w-4 h-4 -rotate-180"})})}),i.jsx("button",{onClick:I,className:"bg-[#353535] hover:bg-gray-600 text-white p-1 rounded-lg focus:outline-none focus:ring-0 border-none",children:i.jsx("span",{className:"w-6 h-6",children:i.jsx(Xa,{className:"text-gray-300 w-4 h-4 "})})})]}),i.jsx("div",{className:"w-full h-[calc(100vh-330px)] sm:h-[calc(100vh-390px)] md:h-[calc(100vh-305px)] lg:h-[calc(100vh-340px)] overflow-x-scroll relative overflow-y-scroll flex-grow",ref:C,children:i.jsxs("table",{className:"w-full relative mb-20",children:[i.jsx("thead",{className:"sticky top-0 z-[3] bg-[#161616] whitespace-nowrap",children:i.jsxs("tr",{className:"w-full z-[4] text-[#9b9b9b] text-[13px] font-semibold font-manrope leading-[13px] tracking-tight",children:[i.jsx("th",{scope:"col",className:"font-medium sm:sticky bg-[#161616] sm:left-0 h-8 pl-3 min-w-[160px] z-[8]",children:i.jsx(Nh,{title:"Coin",sortKey:"asset",sortOption:l,setSortOption:c,isFilterIcon:!1})}),i.jsx("th",{scope:"col",className:"min-w-[120px] px-1",children:i.jsx(Nh,{title:"Majority Side",sortKey:"majority_side",sortOption:l,setSortOption:c,isFilterIcon:!1})}),i.jsx("th",{scope:"col",className:"min-w-[110px] ",children:i.jsxs("div",{className:"flex justify-end items-center gap-1.5 min-w-[110px] px-1",children:[i.jsx("span",{className:"w-1.5 h-1.5 min-w-1.5 min-h-1.5 bg-[#67FFBD] inline-block rounded-full live-dot"}),i.jsx(Nh,{title:"Mark Price",sortKey:"price",sortOption:l,setSortOption:c,isFilterIcon:!0})]})}),i.jsx("th",{scope:"col",className:"min-w-[170px] ",children:i.jsxs("div",{className:"flex justify-end items-center gap-1.5 min-w-[110px] px-1",children:[i.jsx("span",{className:"w-1.5 h-1.5 min-w-1.5 min-h-1.5 bg-[#67FFBD] inline-block rounded-full live-dot"}),i.jsx(Nh,{title:"24h Change",sortKey:"change_24h",sortOption:l,setSortOption:c,isFilterIcon:!0})]})}),i.jsx("th",{scope:"col",className:"min-w-[120px] px-1",children:i.jsx(Nh,{title:"Long PnL",sortKey:"total_long_pnl",sortOption:l,setSortOption:c,isFilterIcon:!0})}),i.jsx("th",{scope:"col",className:"min-w-[110px] px-1",children:i.jsx(Nh,{title:"Short PnL",sortKey:"total_short_pnl",sortOption:l,setSortOption:c,isFilterIcon:!0})}),i.jsx("th",{scope:"col",className:"min-w-[130px] px-1",children:i.jsx(Nh,{title:"Long Notional",sortKey:"long_notional",sortOption:l,setSortOption:c,isFilterIcon:!0})}),i.jsx("th",{scope:"col",className:"min-w-[135px] px-1",children:i.jsx(Nh,{title:"Short Notional",sortKey:"short_notional",sortOption:l,setSortOption:c,isFilterIcon:!0})}),i.jsx("th",{scope:"col",className:"min-w-[135px] px-1",children:i.jsx(Nh,{title:"Total Notional",sortKey:"total_notional",sortOption:l,setSortOption:c,isFilterIcon:!0})}),i.jsx("th",{scope:"col",className:"min-w-[190px] px-1",children:i.jsx(Nh,{title:"Long/Short Ratio",sortKey:"long_ratio",sortOption:l,setSortOption:c,isFilterIcon:!0})}),i.jsx("th",{scope:"col",className:"min-w-[130px] px-1",children:i.jsx(Nh,{title:"Traders (L/S)",sortKey:"traders_l_s",sortOption:l,setSortOption:c,isFilterIcon:!0})}),i.jsx("th",{scope:"col",className:"min-w-[140px] pl-1 pr-4",children:i.jsx(Nh,{title:"Open Interest",sortKey:"open_interest",sortOption:l,setSortOption:c,isFilterIcon:!0})})]})}),i.jsx("tbody",{children:!e.data||t?i.jsx("tr",{className:"text-center w-full h-full",children:i.jsx("td",{colSpan:Q(window.innerWidth),children:i.jsx("div",{className:"flex min-h-[66vh] flex-col justify-center items-center -mt-16 ml-[45%] w-max",children:i.jsx(Da,{})})})}):n&&!e.data?i.jsx("tr",{className:"text-center w-full h-full",children:i.jsx("td",{colSpan:Q(window.innerWidth),children:i.jsx("div",{className:"flex min-h-[26vh] sm:min-h-[50vh] flex-col justify-center items-center ml-[18%] sm:ml-[25%] md:ml-[39%] w-max",children:i.jsx(zl,{})})})}):((ne=e.data)==null?void 0:ne.length)==0?i.jsx("tr",{className:"text-center w-full h-full",children:i.jsx("td",{colSpan:Q(window.innerWidth),children:i.jsx("div",{className:"flex min-h-[26vh] sm:min-h-[50vh] flex-col justify-center items-center ml-[18%] sm:ml-[25%] md:ml-[39%] w-max",children:i.jsx(EUe,{})})})}):(J=w(l))==null?void 0:J.map((X,re)=>{var pe,Y,ie,oe,G,V,ee,ae,fe,Ne,he,ge,ye,ve,je,Ie,Le,Qe;return i.jsx(Ae.Fragment,{children:i.jsxs("tr",{className:`${re%2===0,"bg-[#161616]"} relative group hover:bg-[#222222] h-[56px] border-b border-[#232323] text-white`,children:[i.jsx("td",{scope:"row",onClick:()=>{window.open(`/terminal/${X==null?void 0:X.asset}`,"_blank")},className:`${re%2==0,"bg-[#161616]"} sm:sticky sm:left-0 z-[2] group-hover:bg-[#222222] cursor-pointer`,children:i.jsx("div",{className:"group-hover:bg-[#222222] flex justify-start items-center gap-2.5 pl-2 h-14 max-h-14",children:i.jsxs("div",{className:"flex justify-start items-center gap-1",children:[i.jsx("img",{src:`https://app.hyperliquid.xyz/coins/${L[X==null?void 0:X.asset]||((pe=X==null?void 0:X.asset)==null?void 0:pe.split("/")[0])}.svg`||dummyImage,alt:X==null?void 0:X.asset,className:"rounded-full w-5 h-5 min-w-5 min-h-5 bg-gray-700",loading:"lazy",onError:$e=>fm($e)}),i.jsx(Qx,{info:X!=null&&X.asset?X==null?void 0:X.asset:"--",textColor:"text-white"}),i.jsx("div",{className:"flex justify-center items-center rounded",children:i.jsx("img",{src:gm,alt:"",className:"w-[12px] h-[12px] min-w-[12px] min-h-[12px]"})})]})})}),i.jsx("td",{children:i.jsx("div",{className:"group-hover:bg-[#222222] flex justify-start items-center gap-2 h-8 max-h-8",children:i.jsxs("div",{className:`${X.majority_side=="LONG"?"text-[#67ffbd] bg-[#67ffbd]/20":X.majority_side=="SHORT"?"text-[#ff787b] bg-[#ff797c]/20":"text-[#67ffbd] bg-[#67ffbd]/20"} h-5 pl-1 pr-1.5 py-1 rounded-md justify-start items-center gap-0.5 inline-flex`,children:[i.jsx("div",{className:"w-3 h-3 justify-center items-center flex",children:i.jsx("div",{className:"w-3 h-3 relative",children:X.majority_side=="LONG"?i.jsx(Ps,{className:"text-[#67FFBD] rotate-180 w-3 h-3"}):X.majority_side=="SHORT"?i.jsx(Ps,{className:"text-[#FF797C] w-3 h-3"}):i.jsx(Ps,{className:"text-[#67FFBD] rotate-180 w-3 h-3"})})}),i.jsx("div",{className:" text-[11px] font-semibold font-manrope leading-[8px] tracking-wide",children:X.majority_side?X.majority_side:"--"})]})})}),i.jsx("td",{className:"px-1",children:i.jsx(U,{coin:X==null?void 0:X.asset,price:(Y=X==null?void 0:X.asset_change24h)==null?void 0:Y.markPx,prevPricesRef:f})}),i.jsx("td",{className:"px-1",children:i.jsx(don,{info:((ie=X==null?void 0:X.asset_change24h)==null?void 0:ie.markPx)-((oe=X==null?void 0:X.asset_change24h)==null?void 0:oe.prevDayPx)?((G=X==null?void 0:X.asset_change24h)==null?void 0:G.markPx)-((V=X==null?void 0:X.asset_change24h)==null?void 0:V.prevDayPx)>0?"+"+Math.abs(parseFloat(((ee=X==null?void 0:X.asset_change24h)==null?void 0:ee.markPx)-((ae=X==null?void 0:X.asset_change24h)==null?void 0:ae.prevDayPx)).toFixed(5)):"-"+Math.abs(parseFloat(((fe=X==null?void 0:X.asset_change24h)==null?void 0:fe.markPx)-((Ne=X==null?void 0:X.asset_change24h)==null?void 0:Ne.prevDayPx)).toFixed(5)):z(),info_2:(((he=X==null?void 0:X.asset_change24h)==null?void 0:he.markPx)-((ge=X==null?void 0:X.asset_change24h)==null?void 0:ge.prevDayPx))/((ye=X==null?void 0:X.asset_change24h)==null?void 0:ye.prevDayPx)*100,color_1:`${((ve=X==null?void 0:X.asset_change24h)==null?void 0:ve.markPx)-((je=X==null?void 0:X.asset_change24h)==null?void 0:je.prevDayPx)>=0?"text-[#1DE6A3]":"text-[#FF7173]"}`,color_2:`${(((Ie=X==null?void 0:X.asset_change24h)==null?void 0:Ie.markPx)-((Le=X==null?void 0:X.asset_change24h)==null?void 0:Le.prevDayPx))/((Qe=X==null?void 0:X.asset_change24h)==null?void 0:Qe.prevDayPx)*100>0?"text-[#1DE6A3]":"text-[#FF7173]"}`})}),i.jsx("td",{className:"px-1",children:i.jsx(Qx,{info:(X==null?void 0:X.total_long_pnl)==null||isNaN(parseFloat(X==null?void 0:X.total_long_pnl))?"--":`$${ed(Math.abs(X==null?void 0:X.total_long_pnl))}`,textColor:`${(X==null?void 0:X.total_long_pnl)==null||isNaN(parseFloat(X==null?void 0:X.total_long_pnl))||(X==null?void 0:X.total_long_pnl)==0?"text-white":(X==null?void 0:X.total_long_pnl)>0?"text-[#1DE6A3]":"text-[#FF7173]"}`})}),i.jsx("td",{className:"px-1",children:i.jsx(Qx,{info:(X==null?void 0:X.total_short_pnl)==null||isNaN(parseFloat(X==null?void 0:X.total_short_pnl))?"--":`$${ed(Math.abs(X==null?void 0:X.total_short_pnl))}`,textColor:`${(X==null?void 0:X.total_short_pnl)==null||isNaN(parseFloat(X==null?void 0:X.total_short_pnl))||(X==null?void 0:X.total_short_pnl)==0?"text-white":(X==null?void 0:X.total_short_pnl)>0?"text-[#1DE6A3]":"text-[#FF7173]"}`})}),i.jsx("td",{className:"px-1",children:i.jsx(Qx,{info:(X==null?void 0:X.long_notional)==null||isNaN(parseFloat(X==null?void 0:X.long_notional))?"--":`$${ed(X==null?void 0:X.long_notional)}`,textColor:"text-white"})}),i.jsx("td",{className:"px-1",children:i.jsx(Qx,{info:(X==null?void 0:X.short_notional)==null||isNaN(parseFloat(X==null?void 0:X.short_notional))?"--":`$${ed(X==null?void 0:X.short_notional)}`,textColor:"text-white"})}),i.jsx("td",{className:"px-1",children:i.jsx(Qx,{info:(X==null?void 0:X.total_notional)==null||isNaN(parseFloat(X==null?void 0:X.total_notional))?"--":`$${ed(X==null?void 0:X.total_notional)}`,textColor:"text-white"})}),i.jsx("td",{className:"",children:i.jsx("div",{className:"flex justify-end w-full",children:i.jsx("div",{className:"flex justify-end w-full max-w-[150px]",children:i.jsx(One,{data_1:X!=null&&X.long_ratio?parseFloat(X==null?void 0:X.long_ratio).toFixed(2):0,data_2:X!=null&&X.short_ratio?parseFloat(X==null?void 0:X.short_ratio).toFixed(2):0,margin:"false"})})})}),i.jsx("td",{className:"px-1",children:i.jsx(Qx,{info:X!=null&&X.traders_l_s?X==null?void 0:X.traders_l_s:"--",textColor:"text-white"})}),i.jsx("td",{className:"pr-4",children:i.jsx(Qx,{info:(X==null?void 0:X.open_interest)==null||isNaN(parseFloat(X==null?void 0:X.open_interest))?"--":`$${ed(X==null?void 0:X.open_interest)}`,textColor:"text-white"})})]})},re)})})]})})]})]})})},Qx=({info:e,textColor:t})=>i.jsx("div",{className:"flex flex-col items-end gap-0.5",children:i.jsx("div",{className:`${t} text-sm font-semibold font-manrope leading-none flex items-center justify-start px-1 gap-0.5`,children:e})}),don=({info:e,info_2:t,color_1:n,color_2:r})=>i.jsx("div",{className:"flex justify-end items-center gap-0.5",children:t?i.jsxs(i.Fragment,{children:[i.jsx("div",{className:`${n} text-sm font-semibold font-manrope leading-none flex items-center justify-start px-1 gap-0.5`,children:e}),i.jsx("div",{className:`${n} flex justify-center items-center max-h-2`,children:e?"/":""}),i.jsx("div",{className:`${r} text-sm font-semibold font-manrope leading-none flex items-center justify-start px-1 gap-0.5`,children:`${t>0?"+":"-"}${parseFloat(t).toFixed(2)}%`})]}):i.jsx("div",{className:`${n} text-sm font-semibold font-manrope leading-none flex items-center justify-start px-1 gap-0.5`,children:e})}),tX=({title:e,set_click:t,tableSortButton:n})=>i.jsx("div",{onClick:t,className:`${n==e?"bg-[#3d3d3d] text-white":"bg-[#161616] text-[#9b9b9b]"} text-[13px] font-medium font-manrope leading-[8px] cursor-pointer flex justify-center items-center min-w-max rounded-md px-[6px] sm:px-[10px] h-7`,children:e}),fon=()=>{ns();const{setTelegramChatId:e,setSubscriberRole:t,setSubsExpireDay:n,setMushboomerETH:r,setIsWhitelist:s,setMushboomerSOL:a,setIsReferralCode:o,setIsReferralCodeName:l,setHyperToken:c,setHyperAddress:u,hyperToken:d}=m.useContext(Qr),[f,x]=m.useState([]),[g,v]=m.useState(!1),[w,C]=m.useState(null),N=[{index:0,name:"1D",value:1},{index:1,name:"7D",value:7},{index:2,name:"30D",value:30},{index:3,name:"90D",value:90}],P=parseInt(localStorage.getItem("ticker_period")),I=!isNaN(P)&&N[P]?N[P].value:N[1].value,[R,F]=m.useState(I),U=z=>{F(Number(z)),localStorage.setItem("ticker_period",N.findIndex(Q=>Q.value===Number(z)).toFixed(0))},L=async()=>{try{v(!0);const Q=await fetch("https://dextradata.nftinit.io/api/hyper/analytics_v2/",{method:"GET",headers:{Accept:"application/json","Content-Type":"application/json"}});if(!Q.ok)throw new Error("Network response was not ok");const ne=await Q.json();ne!=null&&ne.success?(x(ne),v(!1)):(v(!1),C(ne==null?void 0:ne.error_message),console.error("Error fetching analytics data:",ne==null?void 0:ne.error_message))}catch(z){setError(z.message),v(!1),console.error("Error fetching analytics data:",z)}finally{v(!1)}};return m.useEffect(()=>{L()},[]),m.useEffect(()=>{const z=new WebSocket("wss://api-ui.hyperliquid.xyz/ws");z.onopen=()=>{z.send(JSON.stringify({method:"subscribe",subscription:{type:"webData2",user:"0x0000000000000000000000000000000000000000"}}))},z.onmessage=J=>{var re;const X=JSON.parse(J==null?void 0:J.data);if(X.channel==="webData2"){const pe=X.data,Y=pe.assetCtxs,ie=(re=pe.meta)==null?void 0:re.universe;if(Array.isArray(Y)&&Array.isArray(ie)){const oe=Y.map((G,V)=>{var ee;return{...G,name:((ee=ie[V])==null?void 0:ee.name)??null}});x(G=>{if(!G||!Array.isArray(G.data))return G;const V=G.data.map(ee=>{const ae=oe.find(fe=>fe.name===ee.asset);return ae?{...ee,asset_change24h:ae}:ee});return{...G,data:V}})}else console.error("missing assetCtxs or universe:",{assetCtxs:Y,universe:ie})}};const Q=()=>{z.readyState===WebSocket.OPEN&&z.send(JSON.stringify({method:"unsubscribe",subscription:{type:"webData2",user:"0x0000000000000000000000000000000000000000"}})),z.close()},ne=()=>{Q(),window.removeEventListener("beforeunload",Q)};return window.addEventListener("beforeunload",Q),ne},[]),m.useEffect(()=>{(async()=>{var J,X;const Q=window.localStorage.getItem("hyperToken"),ne=window.localStorage.getItem("hyperAddress");if(!(!Q||!ne))try{const re=await Ei(ne.toLowerCase(),Q);re!=null&&re.success?(e(re==null?void 0:re.telegram_chat_id),t(re==null?void 0:re.subscriber_role),n(re==null?void 0:re.subs_expire_day),r((J=re==null?void 0:re.mushboomer_counts)==null?void 0:J.eth),a((X=re==null?void 0:re.mushboomer_counts)==null?void 0:X.sol),o(re==null?void 0:re.referral_code),l(re==null?void 0:re.refcode),s(re==null?void 0:re.whitelist)):(window.localStorage.removeItem("hyperToken"),window.localStorage.removeItem("hyperAddress"),c(""),u(""))}catch(re){console.error("Token verification error:",re)}})()},[]),i.jsxs(i.Fragment,{children:[i.jsx(So,{children:i.jsx(Ro,{children:i.jsxs(i.Fragment,{children:[i.jsx("title",{children:"Real-time Crypto Positions Tracker | Top Hyperliquid Traders | Dextrabot"}),i.jsx("meta",{name:"description",content:"Track real-time positions of top-performing Hyperliquid traders by cryptocurrency. View live long/short exposure, trading volumes, and performance metrics for BTC, ETH, SOL and more. Copy profitable strategies instantly."}),i.jsx("meta",{property:"og:title",content:"Real-time Crypto Positions Tracker | Top Hyperliquid Traders | Dextrabot"}),i.jsx("meta",{property:"og:description",content:"Track real-time positions of top-performing Hyperliquid traders by cryptocurrency. View live long/short exposure, trading volumes, and performance metrics for BTC, ETH, SOL and more. Copy profitable strategies instantly."}),i.jsx("meta",{property:"og:image",content:"https://app.dextrabot.com/dextrabotIcon.png"}),i.jsx("meta",{property:"og:url",content:"https://app.dextrabot.com/ticker"})]})})}),i.jsx("div",{className:"flex justify-center items-center w-full h-[calc(100vh-65px)] sm:h-[calc(100vh-80px)] px-1 pt-1 sm:px-6 sm:pt-3 bg-[#161616] overflow-hidden",children:i.jsx("div",{className:"flex flex-col items-stretch justify-center h-full gap-[26px] w-full flex-grow xl:flex-grow-0",children:i.jsx(uon,{data:f,loading:g,error:w,period:R,periods:N,handlePeriodChange:U})})})]})},qce=m.createContext({});function Gce(e){const t=m.useRef(null);return t.current===null&&(t.current=e()),t.current}const Kce=typeof window<"u",nze=Kce?m.useLayoutEffect:m.useEffect,hU=m.createContext(null),zP=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function hon(e,t){let n=new Set,r=new Set,s=!1,a=!1;const o=new WeakSet;let l={delta:0,timestamp:0,isProcessing:!1};function c(d){o.has(d)&&(u.schedule(d),e()),d(l)}const u={schedule:(d,f=!1,x=!1)=>{const v=x&&s?n:r;return f&&o.add(d),v.has(d)||v.add(d),d},cancel:d=>{r.delete(d),o.delete(d)},process:d=>{if(l=d,s){a=!0;return}s=!0,[n,r]=[r,n],n.forEach(c),n.clear(),s=!1,a&&(a=!1,u.process(d))}};return u}const pon=40;function rze(e,t){let n=!1,r=!0;const s={delta:0,timestamp:0,isProcessing:!1},a=()=>n=!0,o=zP.reduce((I,R)=>(I[R]=hon(a),I),{}),{setup:l,read:c,resolveKeyframes:u,preUpdate:d,update:f,preRender:x,render:g,postRender:v}=o,w=()=>{const I=Oc.useManualTiming?s.timestamp:performance.now();n=!1,Oc.useManualTiming||(s.delta=r?1e3/60:Math.max(Math.min(I-s.timestamp,pon),1)),s.timestamp=I,s.isProcessing=!0,l.process(s),c.process(s),u.process(s),d.process(s),f.process(s),x.process(s),g.process(s),v.process(s),s.isProcessing=!1,n&&t&&(r=!1,e(w))},C=()=>{n=!0,r=!0,s.isProcessing||e(w)};return{schedule:zP.reduce((I,R)=>{const F=o[R];return I[R]=(U,L=!1,z=!1)=>(n||C(),F.schedule(U,L,z)),I},{}),cancel:I=>{for(let R=0;R<zP.length;R++)o[zP[R]].cancel(I)},state:s,steps:o}}const{schedule:Oo,cancel:Xy,state:Kc,steps:nX}=rze(typeof requestAnimationFrame<"u"?requestAnimationFrame:al,!0);let CO;function mon(){CO=void 0}const Jd={now:()=>(CO===void 0&&Jd.set(Kc.isProcessing||Oc.useManualTiming?Kc.timestamp:performance.now()),CO),set:e=>{CO=e,queueMicrotask(mon)}},sze=e=>t=>typeof t=="string"&&t.startsWith(e),Yce=sze("--"),xon=sze("var(--"),Xce=e=>xon(e)?gon.test(e.split("/*")[0].trim()):!1,gon=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,i8={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},B_={...i8,transform:e=>Fc(0,1,e)},HP={...i8,default:1},d9=e=>Math.round(e*1e5)/1e5,Qce=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function bon(e){return e==null}const yon=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Zce=(e,t)=>n=>!!(typeof n=="string"&&yon.test(n)&&n.startsWith(e)||t&&!bon(n)&&Object.prototype.hasOwnProperty.call(n,t)),ize=(e,t,n)=>r=>{if(typeof r!="string")return r;const[s,a,o,l]=r.match(Qce);return{[e]:parseFloat(s),[t]:parseFloat(a),[n]:parseFloat(o),alpha:l!==void 0?parseFloat(l):1}},von=e=>Fc(0,255,e),rX={...i8,transform:e=>Math.round(von(e))},cw={test:Zce("rgb","red"),parse:ize("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+rX.transform(e)+", "+rX.transform(t)+", "+rX.transform(n)+", "+d9(B_.transform(r))+")"};function won(e){let t="",n="",r="",s="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),s=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),s=e.substring(4,5),t+=t,n+=n,r+=r,s+=s),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:s?parseInt(s,16)/255:1}}const Mne={test:Zce("#"),parse:won,transform:cw.transform},mT=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Eb=mT("deg"),V0=mT("%"),li=mT("px"),Con=mT("vh"),Son=mT("vw"),OCe={...V0,parse:e=>V0.parse(e)/100,transform:e=>V0.transform(e*100)},zC={test:Zce("hsl","hue"),parse:ize("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+V0.transform(d9(t))+", "+V0.transform(d9(n))+", "+d9(B_.transform(r))+")"},Dl={test:e=>cw.test(e)||Mne.test(e)||zC.test(e),parse:e=>cw.test(e)?cw.parse(e):zC.test(e)?zC.parse(e):Mne.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?cw.transform(e):zC.transform(e),getAnimatableNone:e=>{const t=Dl.parse(e);return t.alpha=0,Dl.transform(t)}},Non=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function Aon(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(Qce))==null?void 0:t.length)||0)+(((n=e.match(Non))==null?void 0:n.length)||0)>0}const aze="number",oze="color",jon="var",Eon="var(",MCe="${}",_on=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function $_(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},s=[];let a=0;const l=t.replace(_on,c=>(Dl.test(c)?(r.color.push(a),s.push(oze),n.push(Dl.parse(c))):c.startsWith(Eon)?(r.var.push(a),s.push(jon),n.push(c)):(r.number.push(a),s.push(aze),n.push(parseFloat(c))),++a,MCe)).split(MCe);return{values:n,split:l,indexes:r,types:s}}function lze(e){return $_(e).values}function cze(e){const{split:t,types:n}=$_(e),r=t.length;return s=>{let a="";for(let o=0;o<r;o++)if(a+=t[o],s[o]!==void 0){const l=n[o];l===aze?a+=d9(s[o]):l===oze?a+=Dl.transform(s[o]):a+=s[o]}return a}}const kon=e=>typeof e=="number"?0:Dl.test(e)?Dl.getAnimatableNone(e):e;function Ton(e){const t=lze(e);return cze(e)(t.map(kon))}const Qy={test:Aon,parse:lze,createTransformer:cze,getAnimatableNone:Ton};function sX(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function Ion({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let s=0,a=0,o=0;if(!t)s=a=o=n;else{const l=n<.5?n*(1+t):n+t-n*t,c=2*n-l;s=sX(c,l,e+1/3),a=sX(c,l,e),o=sX(c,l,e-1/3)}return{red:Math.round(s*255),green:Math.round(a*255),blue:Math.round(o*255),alpha:r}}function GL(e,t){return n=>n>0?t:e}const zo=(e,t,n)=>e+(t-e)*n,iX=(e,t,n)=>{const r=e*e,s=n*(t*t-r)+r;return s<0?0:Math.sqrt(s)},Pon=[Mne,cw,zC],Fon=e=>Pon.find(t=>t.test(e));function RCe(e){const t=Fon(e);if(!t)return!1;let n=t.parse(e);return t===zC&&(n=Ion(n)),n}const LCe=(e,t)=>{const n=RCe(e),r=RCe(t);if(!n||!r)return GL(e,t);const s={...n};return a=>(s.red=iX(n.red,r.red,a),s.green=iX(n.green,r.green,a),s.blue=iX(n.blue,r.blue,a),s.alpha=zo(n.alpha,r.alpha,a),cw.transform(s))},Rne=new Set(["none","hidden"]);function Oon(e,t){return Rne.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function Mon(e,t){return n=>zo(e,t,n)}function Jce(e){return typeof e=="number"?Mon:typeof e=="string"?Xce(e)?GL:Dl.test(e)?LCe:Don:Array.isArray(e)?uze:typeof e=="object"?Dl.test(e)?LCe:Ron:GL}function uze(e,t){const n=[...e],r=n.length,s=e.map((a,o)=>Jce(a)(a,t[o]));return a=>{for(let o=0;o<r;o++)n[o]=s[o](a);return n}}function Ron(e,t){const n={...e,...t},r={};for(const s in n)e[s]!==void 0&&t[s]!==void 0&&(r[s]=Jce(e[s])(e[s],t[s]));return s=>{for(const a in r)n[a]=r[a](s);return n}}function Lon(e,t){const n=[],r={color:0,var:0,number:0};for(let s=0;s<t.values.length;s++){const a=t.types[s],o=e.indexes[a][r[a]],l=e.values[o]??0;n[s]=l,r[a]++}return n}const Don=(e,t)=>{const n=Qy.createTransformer(t),r=$_(e),s=$_(t);return r.indexes.var.length===s.indexes.var.length&&r.indexes.color.length===s.indexes.color.length&&r.indexes.number.length>=s.indexes.number.length?Rne.has(e)&&!s.values.length||Rne.has(t)&&!r.values.length?Oon(e,t):ux(uze(Lon(r,s),s.values),n):GL(e,t)};function dze(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?zo(e,t,n):Jce(e)(e,t)}const Bon=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>Oo.update(t,n),stop:()=>Xy(t),now:()=>Kc.isProcessing?Kc.timestamp:Jd.now()}},fze=(e,t,n=10)=>{let r="";const s=Math.max(Math.round(t/n),2);for(let a=0;a<s;a++)r+=Math.round(e(a/(s-1))*1e4)/1e4+", ";return`linear(${r.substring(0,r.length-2)})`},KL=2e4;function eue(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<KL;)t+=n,r=e.next(t);return t>=KL?1/0:t}function $on(e,t=100,n){const r=n({...e,keyframes:[0,t]}),s=Math.min(eue(r),KL);return{type:"keyframes",ease:a=>r.next(s*a).value/t,duration:rl(s)}}const Uon=5;function hze(e,t,n){const r=Math.max(t-Uon,0);return BD(n-e(r),t-r)}const el={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},DCe=.001;function zon({duration:e=el.duration,bounce:t=el.bounce,velocity:n=el.velocity,mass:r=el.mass}){let s,a,o=1-t;o=Fc(el.minDamping,el.maxDamping,o),e=Fc(el.minDuration,el.maxDuration,rl(e)),o<1?(s=u=>{const d=u*o,f=d*e,x=d-n,g=Lne(u,o),v=Math.exp(-f);return DCe-x/g*v},a=u=>{const f=u*o*e,x=f*n+n,g=Math.pow(o,2)*Math.pow(u,2)*e,v=Math.exp(-f),w=Lne(Math.pow(u,2),o);return(-s(u)+DCe>0?-1:1)*((x-g)*v)/w}):(s=u=>{const d=Math.exp(-u*e),f=(u-n)*e+1;return-.001+d*f},a=u=>{const d=Math.exp(-u*e),f=(n-u)*(e*e);return d*f});const l=5/e,c=Von(s,a,l);if(e=Hl(e),isNaN(c))return{stiffness:el.stiffness,damping:el.damping,duration:e};{const u=Math.pow(c,2)*r;return{stiffness:u,damping:o*2*Math.sqrt(r*u),duration:e}}}const Hon=12;function Von(e,t,n){let r=n;for(let s=1;s<Hon;s++)r=r-e(r)/t(r);return r}function Lne(e,t){return e*Math.sqrt(1-t*t)}const Won=["duration","bounce"],qon=["stiffness","damping","mass"];function BCe(e,t){return t.some(n=>e[n]!==void 0)}function Gon(e){let t={velocity:el.velocity,stiffness:el.stiffness,damping:el.damping,mass:el.mass,isResolvedFromDuration:!1,...e};if(!BCe(e,qon)&&BCe(e,Won))if(e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),s=r*r,a=2*Fc(.05,1,1-(e.bounce||0))*Math.sqrt(s);t={...t,mass:el.mass,stiffness:s,damping:a}}else{const n=zon(e);t={...t,...n,mass:el.mass},t.isResolvedFromDuration=!0}return t}function YL(e=el.visualDuration,t=el.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:s}=n;const a=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],l={done:!1,value:a},{stiffness:c,damping:u,mass:d,duration:f,velocity:x,isResolvedFromDuration:g}=Gon({...n,velocity:-rl(n.velocity||0)}),v=x||0,w=u/(2*Math.sqrt(c*d)),C=o-a,N=rl(Math.sqrt(c/d)),P=Math.abs(C)<5;r||(r=P?el.restSpeed.granular:el.restSpeed.default),s||(s=P?el.restDelta.granular:el.restDelta.default);let I;if(w<1){const F=Lne(N,w);I=U=>{const L=Math.exp(-w*N*U);return o-L*((v+w*N*C)/F*Math.sin(F*U)+C*Math.cos(F*U))}}else if(w===1)I=F=>o-Math.exp(-N*F)*(C+(v+N*C)*F);else{const F=N*Math.sqrt(w*w-1);I=U=>{const L=Math.exp(-w*N*U),z=Math.min(F*U,300);return o-L*((v+w*N*C)*Math.sinh(z)+F*C*Math.cosh(z))/F}}const R={calculatedDuration:g&&f||null,next:F=>{const U=I(F);if(g)l.done=F>=f;else{let L=F===0?v:0;w<1&&(L=F===0?Hl(v):hze(I,F,U));const z=Math.abs(L)<=r,Q=Math.abs(o-U)<=s;l.done=z&&Q}return l.value=l.done?o:U,l},toString:()=>{const F=Math.min(eue(R),KL),U=fze(L=>R.next(F*L).value,F,30);return F+"ms "+U},toTransition:()=>{}};return R}YL.applyToOptions=e=>{const t=$on(e,100,YL);return e.ease=t.ease,e.duration=Hl(t.duration),e.type="keyframes",e};function Dne({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:s=10,bounceStiffness:a=500,modifyTarget:o,min:l,max:c,restDelta:u=.5,restSpeed:d}){const f=e[0],x={done:!1,value:f},g=z=>l!==void 0&&z<l||c!==void 0&&z>c,v=z=>l===void 0?c:c===void 0||Math.abs(l-z)<Math.abs(c-z)?l:c;let w=n*t;const C=f+w,N=o===void 0?C:o(C);N!==C&&(w=N-f);const P=z=>-w*Math.exp(-z/r),I=z=>N+P(z),R=z=>{const Q=P(z),ne=I(z);x.done=Math.abs(Q)<=u,x.value=x.done?N:ne};let F,U;const L=z=>{g(x.value)&&(F=z,U=YL({keyframes:[x.value,v(x.value)],velocity:hze(I,z,x.value),damping:s,stiffness:a,restDelta:u,restSpeed:d}))};return L(0),{calculatedDuration:null,next:z=>{let Q=!1;return!U&&F===void 0&&(Q=!0,R(z),L(z)),F!==void 0&&z>=F?U.next(z-F):(!Q&&R(z),x)}}}function Kon(e,t,n){const r=[],s=n||Oc.mix||dze,a=e.length-1;for(let o=0;o<a;o++){let l=s(e[o],e[o+1]);if(t){const c=Array.isArray(t)?t[o]||al:t;l=ux(c,l)}r.push(l)}return r}function Yon(e,t,{clamp:n=!0,ease:r,mixer:s}={}){const a=e.length;if(ES(a===t.length),a===1)return()=>t[0];if(a===2&&t[0]===t[1])return()=>t[1];const o=e[0]===e[1];e[0]>e[a-1]&&(e=[...e].reverse(),t=[...t].reverse());const l=Kon(t,r,s),c=l.length,u=d=>{if(o&&d<e[0])return t[0];let f=0;if(c>1)for(;f<e.length-2&&!(d<e[f+1]);f++);const x=K0(e[f],e[f+1],d);return l[f](x)};return n?d=>u(Fc(e[0],e[a-1],d)):u}function Xon(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const s=K0(0,t,r);e.push(zo(n,1,s))}}function Qon(e){const t=[0];return Xon(t,e.length-1),t}function Zon(e,t){return e.map(n=>n*t)}function Jon(e,t){return e.map(()=>t||hse).splice(0,e.length-1)}function f9({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const s=y8e(r)?r.map(HO):HO(r),a={done:!1,value:t[0]},o=Zon(n&&n.length===t.length?n:Qon(t),e),l=Yon(o,t,{ease:Array.isArray(s)?s:Jon(t,s)});return{calculatedDuration:e,next:c=>(a.value=l(c),a.done=c>=e,a)}}const eln=e=>e!==null;function tue(e,{repeat:t,repeatType:n="loop"},r,s=1){const a=e.filter(eln),l=s<0||t&&n!=="loop"&&t%2===1?0:a.length-1;return!l||r===void 0?a[l]:r}const tln={decay:Dne,inertia:Dne,tween:f9,keyframes:f9,spring:YL};function pze(e){typeof e.type=="string"&&(e.type=tln[e.type])}class nue{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,n){return this.finished.then(t,n)}}const nln=e=>e/100;class rue extends nue{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{var r,s;const{motionValue:n}=this.options;n&&n.updatedAt!==Jd.now()&&this.tick(Jd.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(s=(r=this.options).onStop)==null||s.call(r))},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){const{options:t}=this;pze(t);const{type:n=f9,repeat:r=0,repeatDelay:s=0,repeatType:a,velocity:o=0}=t;let{keyframes:l}=t;const c=n||f9;c!==f9&&typeof l[0]!="number"&&(this.mixKeyframes=ux(nln,dze(l[0],l[1])),l=[0,100]);const u=c({...t,keyframes:l});a==="mirror"&&(this.mirroredGenerator=c({...t,keyframes:[...l].reverse(),velocity:-o})),u.calculatedDuration===null&&(u.calculatedDuration=eue(u));const{calculatedDuration:d}=u;this.calculatedDuration=d,this.resolvedDuration=d+s,this.totalDuration=this.resolvedDuration*(r+1)-s,this.generator=u}updateTime(t){const n=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(t,n=!1){const{generator:r,totalDuration:s,mixKeyframes:a,mirroredGenerator:o,resolvedDuration:l,calculatedDuration:c}=this;if(this.startTime===null)return r.next(0);const{delay:u=0,keyframes:d,repeat:f,repeatType:x,repeatDelay:g,type:v,onUpdate:w,finalKeyframe:C}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-s/this.speed,this.startTime)),n?this.currentTime=t:this.updateTime(t);const N=this.currentTime-u*(this.playbackSpeed>=0?1:-1),P=this.playbackSpeed>=0?N<0:N>s;this.currentTime=Math.max(N,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=s);let I=this.currentTime,R=r;if(f){const z=Math.min(this.currentTime,s)/l;let Q=Math.floor(z),ne=z%1;!ne&&z>=1&&(ne=1),ne===1&&Q--,Q=Math.min(Q,f+1),!!(Q%2)&&(x==="reverse"?(ne=1-ne,g&&(ne-=g/l)):x==="mirror"&&(R=o)),I=Fc(0,1,ne)*l}const F=P?{done:!1,value:d[0]}:R.next(I);a&&(F.value=a(F.value));let{done:U}=F;!P&&c!==null&&(U=this.playbackSpeed>=0?this.currentTime>=s:this.currentTime<=0);const L=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&U);return L&&v!==Dne&&(F.value=tue(d,this.options,C,this.speed)),w&&w(F.value),L&&this.finish(),F}then(t,n){return this.finished.then(t,n)}get duration(){return rl(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+rl(t)}get time(){return rl(this.currentTime)}set time(t){var n;t=Hl(t),this.currentTime=t,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),(n=this.driver)==null||n.start(!1)}get speed(){return this.playbackSpeed}set speed(t){this.updateTime(Jd.now());const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=rl(this.currentTime))}play(){var s,a;if(this.isStopped)return;const{driver:t=Bon,startTime:n}=this.options;this.driver||(this.driver=t(o=>this.tick(o))),(a=(s=this.options).onPlay)==null||a.call(s);const r=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=r):this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime||(this.startTime=n??r),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(Jd.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var t,n;this.notifyFinished(),this.teardown(),this.state="finished",(n=(t=this.options).onComplete)==null||n.call(t)}cancel(){var t,n;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(n=(t=this.options).onCancel)==null||n.call(t)}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){var n;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(n=this.driver)==null||n.stop(),t.observe(this)}}function rln(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const uw=e=>e*180/Math.PI,Bne=e=>{const t=uw(Math.atan2(e[1],e[0]));return $ne(t)},sln={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:Bne,rotateZ:Bne,skewX:e=>uw(Math.atan(e[1])),skewY:e=>uw(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},$ne=e=>(e=e%360,e<0&&(e+=360),e),$Ce=Bne,UCe=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),zCe=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),iln={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:UCe,scaleY:zCe,scale:e=>(UCe(e)+zCe(e))/2,rotateX:e=>$ne(uw(Math.atan2(e[6],e[5]))),rotateY:e=>$ne(uw(Math.atan2(-e[2],e[0]))),rotateZ:$Ce,rotate:$Ce,skewX:e=>uw(Math.atan(e[4])),skewY:e=>uw(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function Une(e){return e.includes("scale")?1:0}function zne(e,t){if(!e||e==="none")return Une(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,s;if(n)r=iln,s=n;else{const l=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=sln,s=l}if(!s)return Une(t);const a=r[t],o=s[1].split(",").map(oln);return typeof a=="function"?a(o):o[a]}const aln=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return zne(n,t)};function oln(e){return parseFloat(e.trim())}const a8=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],o8=new Set(a8),HCe=e=>e===i8||e===li,lln=new Set(["x","y","z"]),cln=a8.filter(e=>!lln.has(e));function uln(e){const t=[];return cln.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const c3={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>zne(t,"x"),y:(e,{transform:t})=>zne(t,"y")};c3.translateX=c3.x;c3.translateY=c3.y;const u3=new Set;let Hne=!1,Vne=!1,Wne=!1;function mze(){if(Vne){const e=Array.from(u3).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const s=uln(r);s.length&&(n.set(r,s),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const s=n.get(r);s&&s.forEach(([a,o])=>{var l;(l=r.getValue(a))==null||l.set(o)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}Vne=!1,Hne=!1,u3.forEach(e=>e.complete(Wne)),u3.clear()}function xze(){u3.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Vne=!0)})}function dln(){Wne=!0,xze(),mze(),Wne=!1}class sue{constructor(t,n,r,s,a,o=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=s,this.element=a,this.isAsync=o}scheduleResolve(){this.state="scheduled",this.isAsync?(u3.add(this),Hne||(Hne=!0,Oo.read(xze),Oo.resolveKeyframes(mze))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:s}=this;if(t[0]===null){const a=s==null?void 0:s.get(),o=t[t.length-1];if(a!==void 0)t[0]=a;else if(r&&n){const l=r.readValue(n,o);l!=null&&(t[0]=l)}t[0]===void 0&&(t[0]=o),s&&a===void 0&&s.set(t[0])}rln(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),u3.delete(this)}cancel(){this.state==="scheduled"&&(u3.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const fln=e=>e.startsWith("--");function hln(e,t,n){fln(t)?e.style.setProperty(t,n):e.style[t]=n}const pln=oA(()=>window.ScrollTimeline!==void 0),mln={};function xln(e,t){const n=oA(e);return()=>mln[t]??n()}const gze=xln(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Pj=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,VCe={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Pj([0,.65,.55,1]),circOut:Pj([.55,0,1,.45]),backIn:Pj([.31,.01,.66,-.59]),backOut:Pj([.33,1.53,.69,.99])};function bze(e,t){if(e)return typeof e=="function"?gze()?fze(e,t):"ease-out":pse(e)?Pj(e):Array.isArray(e)?e.map(n=>bze(n,t)||VCe.easeOut):VCe[e]}function gln(e,t,n,{delay:r=0,duration:s=300,repeat:a=0,repeatType:o="loop",ease:l="easeOut",times:c}={},u=void 0){const d={[t]:n};c&&(d.offset=c);const f=bze(l,s);Array.isArray(f)&&(d.easing=f);const x={delay:r,duration:s,easing:Array.isArray(f)?"linear":f,fill:"both",iterations:a+1,direction:o==="reverse"?"alternate":"normal"};return u&&(x.pseudoElement=u),e.animate(d,x)}function yze(e){return typeof e=="function"&&"applyToOptions"in e}function bln({type:e,...t}){return yze(e)&&gze()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class yln extends nue{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,!t)return;const{element:n,name:r,keyframes:s,pseudoElement:a,allowFlatten:o=!1,finalKeyframe:l,onComplete:c}=t;this.isPseudoElement=!!a,this.allowFlatten=o,this.options=t,ES(typeof t.type!="string");const u=bln(t);this.animation=gln(n,r,s,u,a),u.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!a){const d=tue(s,this.options,l,this.speed);this.updateMotionValue?this.updateMotionValue(d):hln(n,r,d),this.animation.cancel()}c==null||c(),this.notifyFinished()}}play(){this.isStopped||(this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){var t,n;(n=(t=this.animation).finish)==null||n.call(t)}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;t==="idle"||t==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var t,n;this.isPseudoElement||(n=(t=this.animation).commitStyles)==null||n.call(t)}get duration(){var n,r;const t=((r=(n=this.animation.effect)==null?void 0:n.getComputedTiming)==null?void 0:r.call(n).duration)||0;return rl(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+rl(t)}get time(){return rl(Number(this.animation.currentTime)||0)}set time(t){this.finishedTime=null,this.animation.currentTime=Hl(t)}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return Number(this.animation.startTime)}set startTime(t){this.animation.startTime=t}attachTimeline({timeline:t,observe:n}){var r;return this.allowFlatten&&((r=this.animation.effect)==null||r.updateTiming({easing:"linear"})),this.animation.onfinish=null,t&&pln()?(this.animation.timeline=t,al):n(this)}}const vze={anticipate:cse,backInOut:lse,circInOut:fse};function vln(e){return e in vze}function wln(e){typeof e.ease=="string"&&vln(e.ease)&&(e.ease=vze[e.ease])}const WCe=10;class Cln extends yln{constructor(t){wln(t),pze(t),super(t),t.startTime&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:n,onUpdate:r,onComplete:s,element:a,...o}=this.options;if(!n)return;if(t!==void 0){n.set(t);return}const l=new rue({...o,autoplay:!1}),c=Hl(this.finishedTime??this.time);n.setWithVelocity(l.sample(c-WCe).value,l.sample(c).value,WCe),l.stop()}}const qCe=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Qy.test(e)||e==="0")&&!e.startsWith("url("));function Sln(e){const t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function Nln(e,t,n,r){const s=e[0];if(s===null)return!1;if(t==="display"||t==="visibility")return!0;const a=e[e.length-1],o=qCe(s,t),l=qCe(a,t);return!o||!l?!1:Sln(e)||(n==="spring"||yze(n))&&r}function qne(e){e.duration=0,e.type="keyframes"}const Aln=new Set(["opacity","clipPath","filter","transform"]),jln=oA(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function Eln(e){var d;const{motionValue:t,name:n,repeatDelay:r,repeatType:s,damping:a,type:o}=e;if(!(((d=t==null?void 0:t.owner)==null?void 0:d.current)instanceof HTMLElement))return!1;const{onUpdate:c,transformTemplate:u}=t.owner.getProps();return jln()&&n&&Aln.has(n)&&(n!=="transform"||!u)&&!c&&!r&&s!=="mirror"&&a!==0&&o!=="inertia"}const _ln=40;class kln extends nue{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:s=0,repeatDelay:a=0,repeatType:o="loop",keyframes:l,name:c,motionValue:u,element:d,...f}){var v;super(),this.stop=()=>{var w,C;this._animation&&(this._animation.stop(),(w=this.stopTimeline)==null||w.call(this)),(C=this.keyframeResolver)==null||C.cancel()},this.createdAt=Jd.now();const x={autoplay:t,delay:n,type:r,repeat:s,repeatDelay:a,repeatType:o,name:c,motionValue:u,element:d,...f},g=(d==null?void 0:d.KeyframeResolver)||sue;this.keyframeResolver=new g(l,(w,C,N)=>this.onKeyframesResolved(w,C,x,!N),c,u,d),(v=this.keyframeResolver)==null||v.scheduleResolve()}onKeyframesResolved(t,n,r,s){this.keyframeResolver=void 0;const{name:a,type:o,velocity:l,delay:c,isHandoff:u,onUpdate:d}=r;this.resolvedAt=Jd.now(),Nln(t,a,o,l)||((Oc.instantAnimations||!c)&&(d==null||d(tue(t,r,n))),t[0]=t[t.length-1],qne(r),r.repeat=0);const x={startTime:s?this.resolvedAt?this.resolvedAt-this.createdAt>_ln?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:t},g=!u&&Eln(x)?new Cln({...x,element:x.motionValue.owner.current}):new rue(x);g.finished.then(()=>this.notifyFinished()).catch(al),this.pendingTimeline&&(this.stopTimeline=g.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=g}get finished(){return this._animation?this.animation.finished:this._finished}then(t,n){return this.finished.finally(t).then(()=>{})}get animation(){var t;return this._animation||((t=this.keyframeResolver)==null||t.resume(),dln()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){var t;this._animation&&this.animation.cancel(),(t=this.keyframeResolver)==null||t.cancel()}}const Tln=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Iln(e){const t=Tln.exec(e);if(!t)return[,];const[,n,r,s]=t;return[`--${n??r}`,s]}function wze(e,t,n=1){const[r,s]=Iln(e);if(!r)return;const a=window.getComputedStyle(t).getPropertyValue(r);if(a){const o=a.trim();return RD(o)?parseFloat(o):o}return Xce(s)?wze(s,t,n+1):s}function iue(e,t){return(e==null?void 0:e[t])??(e==null?void 0:e.default)??e}const Cze=new Set(["width","height","top","left","right","bottom",...a8]),Pln={test:e=>e==="auto",parse:e=>e},Sze=e=>t=>t.test(e),Nze=[i8,li,V0,Eb,Son,Con,Pln],GCe=e=>Nze.find(Sze(e));function Fln(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||DD(e):!0}const Oln=new Set(["brightness","contrast","saturate","opacity"]);function Mln(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(Qce)||[];if(!r)return e;const s=n.replace(r,"");let a=Oln.has(t)?1:0;return r!==n&&(a*=100),t+"("+a+s+")"}const Rln=/\b([a-z-]*)\(.*?\)/gu,Gne={...Qy,getAnimatableNone:e=>{const t=e.match(Rln);return t?t.map(Mln).join(" "):e}},KCe={...i8,transform:Math.round},Lln={rotate:Eb,rotateX:Eb,rotateY:Eb,rotateZ:Eb,scale:HP,scaleX:HP,scaleY:HP,scaleZ:HP,skew:Eb,skewX:Eb,skewY:Eb,distance:li,translateX:li,translateY:li,translateZ:li,x:li,y:li,z:li,perspective:li,transformPerspective:li,opacity:B_,originX:OCe,originY:OCe,originZ:li},aue={borderWidth:li,borderTopWidth:li,borderRightWidth:li,borderBottomWidth:li,borderLeftWidth:li,borderRadius:li,radius:li,borderTopLeftRadius:li,borderTopRightRadius:li,borderBottomRightRadius:li,borderBottomLeftRadius:li,width:li,maxWidth:li,height:li,maxHeight:li,top:li,right:li,bottom:li,left:li,padding:li,paddingTop:li,paddingRight:li,paddingBottom:li,paddingLeft:li,margin:li,marginTop:li,marginRight:li,marginBottom:li,marginLeft:li,backgroundPositionX:li,backgroundPositionY:li,...Lln,zIndex:KCe,fillOpacity:B_,strokeOpacity:B_,numOctaves:KCe},Dln={...aue,color:Dl,backgroundColor:Dl,outlineColor:Dl,fill:Dl,stroke:Dl,borderColor:Dl,borderTopColor:Dl,borderRightColor:Dl,borderBottomColor:Dl,borderLeftColor:Dl,filter:Gne,WebkitFilter:Gne},Aze=e=>Dln[e];function jze(e,t){let n=Aze(e);return n!==Gne&&(n=Qy),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const Bln=new Set(["auto","none","0"]);function $ln(e,t,n){let r=0,s;for(;r<e.length&&!s;){const a=e[r];typeof a=="string"&&!Bln.has(a)&&$_(a).values.length&&(s=e[r]),r++}if(s&&n)for(const a of t)e[a]=jze(n,s)}class Uln extends sue{constructor(t,n,r,s,a){super(t,n,r,s,a,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let c=0;c<t.length;c++){let u=t[c];if(typeof u=="string"&&(u=u.trim(),Xce(u))){const d=wze(u,n.current);d!==void 0&&(t[c]=d),c===t.length-1&&(this.finalKeyframe=u)}}if(this.resolveNoneKeyframes(),!Cze.has(r)||t.length!==2)return;const[s,a]=t,o=GCe(s),l=GCe(a);if(o!==l)if(HCe(o)&&HCe(l))for(let c=0;c<t.length;c++){const u=t[c];typeof u=="string"&&(t[c]=parseFloat(u))}else c3[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,r=[];for(let s=0;s<t.length;s++)(t[s]===null||Fln(t[s]))&&r.push(s);r.length&&$ln(t,r,n)}measureInitialState(){const{element:t,unresolvedKeyframes:n,name:r}=this;if(!t||!t.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=c3[r](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const s=n[n.length-1];s!==void 0&&t.getValue(r,s).jump(s,!1)}measureEndState(){var l;const{element:t,name:n,unresolvedKeyframes:r}=this;if(!t||!t.current)return;const s=t.getValue(n);s&&s.jump(this.measuredOrigin,!1);const a=r.length-1,o=r[a];r[a]=c3[n](t.measureViewportBox(),window.getComputedStyle(t.current)),o!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=o),(l=this.removedTransforms)!=null&&l.length&&this.removedTransforms.forEach(([c,u])=>{t.getValue(c).set(u)}),this.resolveNoneKeyframes()}}function zln(e,t,n){if(e instanceof EventTarget)return[e];if(typeof e=="string"){const s=document.querySelectorAll(e);return s?Array.from(s):[]}return Array.from(e)}const Eze=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function _ze(e){return LD(e)&&"offsetHeight"in e}const YCe=30,Hln=e=>!isNaN(parseFloat(e));class Vln{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{var a;const s=Jd.now();if(this.updatedAt!==s&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&((a=this.events.change)==null||a.notify(this.current),this.dependents))for(const o of this.dependents)o.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=Jd.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=Hln(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new lA);const r=this.events[t].add(n);return t==="change"?()=>{r(),Oo.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-r}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){var t;(t=this.events.change)==null||t.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=Jd.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>YCe)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,YCe);return BD(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){var t,n;(t=this.dependents)==null||t.clear(),(n=this.events.destroy)==null||n.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function GN(e,t){return new Vln(e,t)}const{schedule:oue,cancel:wvn}=rze(queueMicrotask,!1),Mp={x:!1,y:!1};function kze(){return Mp.x||Mp.y}function Wln(e){return e==="x"||e==="y"?Mp[e]?null:(Mp[e]=!0,()=>{Mp[e]=!1}):Mp.x||Mp.y?null:(Mp.x=Mp.y=!0,()=>{Mp.x=Mp.y=!1})}function Tze(e,t){const n=zln(e),r=new AbortController,s={passive:!0,...t,signal:r.signal};return[n,s,()=>r.abort()]}function XCe(e){return!(e.pointerType==="touch"||kze())}function qln(e,t,n={}){const[r,s,a]=Tze(e,n),o=l=>{if(!XCe(l))return;const{target:c}=l,u=t(c,l);if(typeof u!="function"||!c)return;const d=f=>{XCe(f)&&(u(f),c.removeEventListener("pointerleave",d))};c.addEventListener("pointerleave",d,s)};return r.forEach(l=>{l.addEventListener("pointerenter",o,s)}),a}const Ize=(e,t)=>t?e===t?!0:Ize(e,t.parentElement):!1,lue=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,Gln=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function Kln(e){return Gln.has(e.tagName)||e.tabIndex!==-1}const SO=new WeakSet;function QCe(e){return t=>{t.key==="Enter"&&e(t)}}function aX(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const Yln=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=QCe(()=>{if(SO.has(n))return;aX(n,"down");const s=QCe(()=>{aX(n,"up")}),a=()=>aX(n,"cancel");n.addEventListener("keyup",s,t),n.addEventListener("blur",a,t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)};function ZCe(e){return lue(e)&&!kze()}function Xln(e,t,n={}){const[r,s,a]=Tze(e,n),o=l=>{const c=l.currentTarget;if(!ZCe(l))return;SO.add(c);const u=t(c,l),d=(g,v)=>{window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",x),SO.has(c)&&SO.delete(c),ZCe(g)&&typeof u=="function"&&u(g,{success:v})},f=g=>{d(g,c===window||c===document||n.useGlobalTarget||Ize(c,g.target))},x=g=>{d(g,!1)};window.addEventListener("pointerup",f,s),window.addEventListener("pointercancel",x,s)};return r.forEach(l=>{(n.useGlobalTarget?window:l).addEventListener("pointerdown",o,s),_ze(l)&&(l.addEventListener("focus",u=>Yln(u,s)),!Kln(l)&&!l.hasAttribute("tabindex")&&(l.tabIndex=0))}),a}function Pze(e){return LD(e)&&"ownerSVGElement"in e}function Qln(e){return Pze(e)&&e.tagName==="svg"}const Ou=e=>!!(e&&e.getVelocity),Zln=[...Nze,Dl,Qy],Jln=e=>Zln.find(Sze(e)),cue=m.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function JCe(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function ecn(...e){return t=>{let n=!1;const r=e.map(s=>{const a=JCe(s,t);return!n&&typeof a=="function"&&(n=!0),a});if(n)return()=>{for(let s=0;s<r.length;s++){const a=r[s];typeof a=="function"?a():JCe(e[s],null)}}}}function tcn(...e){return m.useCallback(ecn(...e),e)}class ncn extends m.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(n&&t.isPresent&&!this.props.isPresent){const r=n.offsetParent,s=_ze(r)&&r.offsetWidth||0,a=this.props.sizeRef.current;a.height=n.offsetHeight||0,a.width=n.offsetWidth||0,a.top=n.offsetTop,a.left=n.offsetLeft,a.right=s-a.width-a.left}return null}componentDidUpdate(){}render(){return this.props.children}}function rcn({children:e,isPresent:t,anchorX:n,root:r}){const s=m.useId(),a=m.useRef(null),o=m.useRef({width:0,height:0,top:0,left:0,right:0}),{nonce:l}=m.useContext(cue),c=tcn(a,e==null?void 0:e.ref);return m.useInsertionEffect(()=>{const{width:u,height:d,top:f,left:x,right:g}=o.current;if(t||!a.current||!u||!d)return;const v=n==="left"?`left: ${x}`:`right: ${g}`;a.current.dataset.motionPopId=s;const w=document.createElement("style");l&&(w.nonce=l);const C=r??document.head;return C.appendChild(w),w.sheet&&w.sheet.insertRule(`
[data-motion-pop-id="${s}"] {
position: absolute !important;
width: ${u}px !important;
height: ${d}px !important;
${v}px !important;
top: ${f}px !important;
}
`),()=>{C.contains(w)&&C.removeChild(w)}},[t]),i.jsx(ncn,{isPresent:t,childRef:a,sizeRef:o,children:m.cloneElement(e,{ref:c})})}const scn=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:s,presenceAffectsLayout:a,mode:o,anchorX:l,root:c})=>{const u=Gce(icn),d=m.useId();let f=!0,x=m.useMemo(()=>(f=!1,{id:d,initial:t,isPresent:n,custom:s,onExitComplete:g=>{u.set(g,!0);for(const v of u.values())if(!v)return;r&&r()},register:g=>(u.set(g,!1),()=>u.delete(g))}),[n,u,r]);return a&&f&&(x={...x}),m.useMemo(()=>{u.forEach((g,v)=>u.set(v,!1))},[n]),m.useEffect(()=>{!n&&!u.size&&r&&r()},[n]),o==="popLayout"&&(e=i.jsx(rcn,{isPresent:n,anchorX:l,root:c,children:e})),i.jsx(hU.Provider,{value:x,children:e})};function icn(){return new Map}function Fze(e=!0){const t=m.useContext(hU);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:s}=t,a=m.useId();m.useEffect(()=>{if(e)return s(a)},[e]);const o=m.useCallback(()=>e&&r&&r(a),[a,r,e]);return!n&&r?[!1,o]:[!0]}const VP=e=>e.key||"";function e4e(e){const t=[];return m.Children.forEach(e,n=>{m.isValidElement(n)&&t.push(n)}),t}const xT=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:s=!0,mode:a="sync",propagate:o=!1,anchorX:l="left",root:c})=>{const[u,d]=Fze(o),f=m.useMemo(()=>e4e(e),[e]),x=o&&!u?[]:f.map(VP),g=m.useRef(!0),v=m.useRef(f),w=Gce(()=>new Map),[C,N]=m.useState(f),[P,I]=m.useState(f);nze(()=>{g.current=!1,v.current=f;for(let U=0;U<P.length;U++){const L=VP(P[U]);x.includes(L)?w.delete(L):w.get(L)!==!0&&w.set(L,!1)}},[P,x.length,x.join("-")]);const R=[];if(f!==C){let U=[...f];for(let L=0;L<P.length;L++){const z=P[L],Q=VP(z);x.includes(Q)||(U.splice(L,0,z),R.push(z))}return a==="wait"&&R.length&&(U=R),I(e4e(U)),N(f),null}const{forceRender:F}=m.useContext(qce);return i.jsx(i.Fragment,{children:P.map(U=>{const L=VP(U),z=o&&!u?!1:f===P||x.includes(L),Q=()=>{if(w.has(L))w.set(L,!0);else return;let ne=!0;w.forEach(J=>{J||(ne=!1)}),ne&&(F==null||F(),I(v.current),o&&(d==null||d()),r&&r())};return i.jsx(scn,{isPresent:z,initial:!g.current||n?void 0:!1,custom:t,presenceAffectsLayout:s,mode:a,root:c,onExitComplete:z?void 0:Q,anchorX:l,children:U},L)})})},Oze=m.createContext({strict:!1}),t4e={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},KN={};for(const e in t4e)KN[e]={isEnabled:t=>t4e[e].some(n=>!!t[n])};function acn(e){for(const t in e)KN[t]={...KN[t],...e[t]}}const ocn=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function XL(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||ocn.has(e)}let Mze=e=>!XL(e);function lcn(e){typeof e=="function"&&(Mze=t=>t.startsWith("on")?!XL(t):e(t))}try{lcn(require("@emotion/is-prop-valid").default)}catch{}function ccn(e,t,n){const r={};for(const s in e)s==="values"&&typeof e.values=="object"||(Mze(s)||n===!0&&XL(s)||!t&&!XL(s)||e.draggable&&s.startsWith("onDrag"))&&(r[s]=e[s]);return r}const pU=m.createContext({});function mU(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function U_(e){return typeof e=="string"||Array.isArray(e)}const uue=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],due=["initial",...uue];function xU(e){return mU(e.animate)||due.some(t=>U_(e[t]))}function Rze(e){return!!(xU(e)||e.variants)}function ucn(e,t){if(xU(e)){const{initial:n,animate:r}=e;return{initial:n===!1||U_(n)?n:void 0,animate:U_(r)?r:void 0}}return e.inherit!==!1?t:{}}function dcn(e){const{initial:t,animate:n}=ucn(e,m.useContext(pU));return m.useMemo(()=>({initial:t,animate:n}),[n4e(t),n4e(n)])}function n4e(e){return Array.isArray(e)?e.join(" "):e}const z_={};function fcn(e){for(const t in e)z_[t]=e[t],Yce(t)&&(z_[t].isCSSVariable=!0)}function Lze(e,{layout:t,layoutId:n}){return o8.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!z_[e]||e==="opacity")}const hcn={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},pcn=a8.length;function mcn(e,t,n){let r="",s=!0;for(let a=0;a<pcn;a++){const o=a8[a],l=e[o];if(l===void 0)continue;let c=!0;if(typeof l=="number"?c=l===(o.startsWith("scale")?1:0):c=parseFloat(l)===0,!c||n){const u=Eze(l,aue[o]);if(!c){s=!1;const d=hcn[o]||o;r+=`${d}(${u}) `}n&&(t[o]=u)}}return r=r.trim(),n?r=n(t,s?"":r):s&&(r="none"),r}function fue(e,t,n){const{style:r,vars:s,transformOrigin:a}=e;let o=!1,l=!1;for(const c in t){const u=t[c];if(o8.has(c)){o=!0;continue}else if(Yce(c)){s[c]=u;continue}else{const d=Eze(u,aue[c]);c.startsWith("origin")?(l=!0,a[c]=d):r[c]=d}}if(t.transform||(o||n?r.transform=mcn(t,e.transform,n):r.transform&&(r.transform="none")),l){const{originX:c="50%",originY:u="50%",originZ:d=0}=a;r.transformOrigin=`${c} ${u} ${d}`}}const hue=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Dze(e,t,n){for(const r in t)!Ou(t[r])&&!Lze(r,n)&&(e[r]=t[r])}function xcn({transformTemplate:e},t){return m.useMemo(()=>{const n=hue();return fue(n,t,e),Object.assign({},n.vars,n.style)},[t])}function gcn(e,t){const n=e.style||{},r={};return Dze(r,n,e),Object.assign(r,xcn(e,t)),r}function bcn(e,t){const n={},r=gcn(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}const ycn={offset:"stroke-dashoffset",array:"stroke-dasharray"},vcn={offset:"strokeDashoffset",array:"strokeDasharray"};function wcn(e,t,n=1,r=0,s=!0){e.pathLength=1;const a=s?ycn:vcn;e[a.offset]=li.transform(-r);const o=li.transform(t),l=li.transform(n);e[a.array]=`${o} ${l}`}function Bze(e,{attrX:t,attrY:n,attrScale:r,pathLength:s,pathSpacing:a=1,pathOffset:o=0,...l},c,u,d){if(fue(e,l,u),c){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:f,style:x}=e;f.transform&&(x.transform=f.transform,delete f.transform),(x.transform||f.transformOrigin)&&(x.transformOrigin=f.transformOrigin??"50% 50%",delete f.transformOrigin),x.transform&&(x.transformBox=(d==null?void 0:d.transformBox)??"fill-box",delete f.transformBox),t!==void 0&&(f.x=t),n!==void 0&&(f.y=n),r!==void 0&&(f.scale=r),s!==void 0&&wcn(f,s,a,o,!1)}const $ze=()=>({...hue(),attrs:{}}),Uze=e=>typeof e=="string"&&e.toLowerCase()==="svg";function Ccn(e,t,n,r){const s=m.useMemo(()=>{const a=$ze();return Bze(a,t,Uze(r),e.transformTemplate,e.style),{...a.attrs,style:{...a.style}}},[t]);if(e.style){const a={};Dze(a,e.style,e),s.style={...a,...s.style}}return s}const Scn=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function pue(e){return typeof e!="string"||e.includes("-")?!1:!!(Scn.indexOf(e)>-1||/[A-Z]/u.test(e))}function Ncn(e,t,n,{latestValues:r},s,a=!1){const l=(pue(e)?Ccn:bcn)(t,r,s,e),c=ccn(t,typeof e=="string",a),u=e!==m.Fragment?{...c,...l,ref:n}:{},{children:d}=t,f=m.useMemo(()=>Ou(d)?d.get():d,[d]);return m.createElement(e,{...u,children:f})}function r4e(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function mue(e,t,n,r){if(typeof t=="function"){const[s,a]=r4e(r);t=t(n!==void 0?n:e.custom,s,a)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[s,a]=r4e(r);t=t(n!==void 0?n:e.custom,s,a)}return t}function NO(e){return Ou(e)?e.get():e}function Acn({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,s){return{latestValues:jcn(n,r,s,e),renderState:t()}}function jcn(e,t,n,r){const s={},a=r(e,{});for(const x in a)s[x]=NO(a[x]);let{initial:o,animate:l}=e;const c=xU(e),u=Rze(e);t&&u&&!c&&e.inherit!==!1&&(o===void 0&&(o=t.initial),l===void 0&&(l=t.animate));let d=n?n.initial===!1:!1;d=d||o===!1;const f=d?l:o;if(f&&typeof f!="boolean"&&!mU(f)){const x=Array.isArray(f)?f:[f];for(let g=0;g<x.length;g++){const v=mue(e,x[g]);if(v){const{transitionEnd:w,transition:C,...N}=v;for(const P in N){let I=N[P];if(Array.isArray(I)){const R=d?I.length-1:0;I=I[R]}I!==null&&(s[P]=I)}for(const P in w)s[P]=w[P]}}}return s}const zze=e=>(t,n)=>{const r=m.useContext(pU),s=m.useContext(hU),a=()=>Acn(e,t,r,s);return n?a():Gce(a)};function xue(e,t,n){var a;const{style:r}=e,s={};for(const o in r)(Ou(r[o])||t.style&&Ou(t.style[o])||Lze(o,e)||((a=n==null?void 0:n.getValue(o))==null?void 0:a.liveStyle)!==void 0)&&(s[o]=r[o]);return s}const Ecn=zze({scrapeMotionValuesFromProps:xue,createRenderState:hue});function Hze(e,t,n){const r=xue(e,t,n);for(const s in e)if(Ou(e[s])||Ou(t[s])){const a=a8.indexOf(s)!==-1?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s;r[a]=e[s]}return r}const _cn=zze({scrapeMotionValuesFromProps:Hze,createRenderState:$ze}),kcn=Symbol.for("motionComponentSymbol");function HC(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function Tcn(e,t,n){return m.useCallback(r=>{r&&e.onMount&&e.onMount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):HC(n)&&(n.current=r))},[t])}const gue=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),Icn="framerAppearId",Vze="data-"+gue(Icn),Wze=m.createContext({});function Pcn(e,t,n,r,s){var w,C;const{visualElement:a}=m.useContext(pU),o=m.useContext(Oze),l=m.useContext(hU),c=m.useContext(cue).reducedMotion,u=m.useRef(null);r=r||o.renderer,!u.current&&r&&(u.current=r(e,{visualState:t,parent:a,props:n,presenceContext:l,blockInitialAnimation:l?l.initial===!1:!1,reducedMotionConfig:c}));const d=u.current,f=m.useContext(Wze);d&&!d.projection&&s&&(d.type==="html"||d.type==="svg")&&Fcn(u.current,n,s,f);const x=m.useRef(!1);m.useInsertionEffect(()=>{d&&x.current&&d.update(n,l)});const g=n[Vze],v=m.useRef(!!g&&!((w=window.MotionHandoffIsComplete)!=null&&w.call(window,g))&&((C=window.MotionHasOptimisedAnimation)==null?void 0:C.call(window,g)));return nze(()=>{d&&(x.current=!0,window.MotionIsMounted=!0,d.updateFeatures(),d.scheduleRenderMicrotask(),v.current&&d.animationState&&d.animationState.animateChanges())}),m.useEffect(()=>{d&&(!v.current&&d.animationState&&d.animationState.animateChanges(),v.current&&(queueMicrotask(()=>{var N;(N=window.MotionHandoffMarkAsComplete)==null||N.call(window,g)}),v.current=!1),d.enteringChildren=void 0)}),d}function Fcn(e,t,n,r){const{layoutId:s,layout:a,drag:o,dragConstraints:l,layoutScroll:c,layoutRoot:u,layoutCrossfade:d}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:qze(e.parent)),e.projection.setOptions({layoutId:s,layout:a,alwaysMeasureLayout:!!o||l&&HC(l),visualElement:e,animationType:typeof a=="string"?a:"both",initialPromotionConfig:r,crossfade:d,layoutScroll:c,layoutRoot:u})}function qze(e){if(e)return e.options.allowProjection!==!1?e.projection:qze(e.parent)}function oX(e,{forwardMotionProps:t=!1}={},n,r){n&&acn(n);const s=pue(e)?_cn:Ecn;function a(l,c){let u;const d={...m.useContext(cue),...l,layoutId:Ocn(l)},{isStatic:f}=d,x=dcn(l),g=s(l,f);if(!f&&Kce){Mcn();const v=Rcn(d);u=v.MeasureLayout,x.visualElement=Pcn(e,g,d,r,v.ProjectionNode)}return i.jsxs(pU.Provider,{value:x,children:[u&&x.visualElement?i.jsx(u,{visualElement:x.visualElement,...d}):null,Ncn(e,l,Tcn(g,x.visualElement,c),g,f,t)]})}a.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const o=m.forwardRef(a);return o[kcn]=e,o}function Ocn({layoutId:e}){const t=m.useContext(qce).id;return t&&e!==void 0?t+"-"+e:e}function Mcn(e,t){m.useContext(Oze).strict}function Rcn(e){const{drag:t,layout:n}=KN;if(!t&&!n)return{};const r={...t,...n};return{MeasureLayout:t!=null&&t.isEnabled(e)||n!=null&&n.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}function Lcn(e,t){if(typeof Proxy>"u")return oX;const n=new Map,r=(a,o)=>oX(a,o,e,t),s=(a,o)=>r(a,o);return new Proxy(s,{get:(a,o)=>o==="create"?r:(n.has(o)||n.set(o,oX(o,void 0,e,t)),n.get(o))})}function Gze({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function Dcn({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function Bcn(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function lX(e){return e===void 0||e===1}function Kne({scale:e,scaleX:t,scaleY:n}){return!lX(e)||!lX(t)||!lX(n)}function Iv(e){return Kne(e)||Kze(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Kze(e){return s4e(e.x)||s4e(e.y)}function s4e(e){return e&&e!=="0%"}function QL(e,t,n){const r=e-n,s=t*r;return n+s}function i4e(e,t,n,r,s){return s!==void 0&&(e=QL(e,s,r)),QL(e,n,r)+t}function Yne(e,t=0,n=1,r,s){e.min=i4e(e.min,t,n,r,s),e.max=i4e(e.max,t,n,r,s)}function Yze(e,{x:t,y:n}){Yne(e.x,t.translate,t.scale,t.originPoint),Yne(e.y,n.translate,n.scale,n.originPoint)}const a4e=.999999999999,o4e=1.0000000000001;function $cn(e,t,n,r=!1){const s=n.length;if(!s)return;t.x=t.y=1;let a,o;for(let l=0;l<s;l++){a=n[l],o=a.projectionDelta;const{visualElement:c}=a.options;c&&c.props.style&&c.props.style.display==="contents"||(r&&a.options.layoutScroll&&a.scroll&&a!==a.root&&WC(e,{x:-a.scroll.offset.x,y:-a.scroll.offset.y}),o&&(t.x*=o.x.scale,t.y*=o.y.scale,Yze(e,o)),r&&Iv(a.latestValues)&&WC(e,a.latestValues))}t.x<o4e&&t.x>a4e&&(t.x=1),t.y<o4e&&t.y>a4e&&(t.y=1)}function VC(e,t){e.min=e.min+t,e.max=e.max+t}function l4e(e,t,n,r,s=.5){const a=zo(e.min,e.max,s);Yne(e,t,n,a,r)}function WC(e,t){l4e(e.x,t.x,t.scaleX,t.scale,t.originX),l4e(e.y,t.y,t.scaleY,t.scale,t.originY)}function Xze(e,t){return Gze(Bcn(e.getBoundingClientRect(),t))}function Ucn(e,t,n){const r=Xze(e,n),{scroll:s}=t;return s&&(VC(r.x,s.offset.x),VC(r.y,s.offset.y)),r}const c4e=()=>({translate:0,scale:1,origin:0,originPoint:0}),qC=()=>({x:c4e(),y:c4e()}),u4e=()=>({min:0,max:0}),ml=()=>({x:u4e(),y:u4e()}),Xne={current:null},Qze={current:!1};function zcn(){if(Qze.current=!0,!!Kce)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>Xne.current=e.matches;e.addEventListener("change",t),t()}else Xne.current=!1}const Hcn=new WeakMap;function Vcn(e,t,n){for(const r in t){const s=t[r],a=n[r];if(Ou(s))e.addValue(r,s);else if(Ou(a))e.addValue(r,GN(s,{owner:e}));else if(a!==s)if(e.hasValue(r)){const o=e.getValue(r);o.liveStyle===!0?o.jump(s):o.hasAnimated||o.set(s)}else{const o=e.getStaticValue(r);e.addValue(r,GN(o!==void 0?o:s,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const d4e=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class Wcn{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:s,blockInitialAnimation:a,visualState:o},l={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=sue,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const x=Jd.now();this.renderScheduledAt<x&&(this.renderScheduledAt=x,Oo.render(this.render,!1,!0))};const{latestValues:c,renderState:u}=o;this.latestValues=c,this.baseTarget={...c},this.initialValues=n.initial?{...c}:{},this.renderState=u,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=s,this.options=l,this.blockInitialAnimation=!!a,this.isControllingVariants=xU(n),this.isVariantNode=Rze(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:d,...f}=this.scrapeMotionValuesFromProps(n,{},this);for(const x in f){const g=f[x];c[x]!==void 0&&Ou(g)&&g.set(c[x])}}mount(t){var n;this.current=t,Hcn.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((r,s)=>this.bindToMotionValue(s,r)),Qze.current||zcn(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:Xne.current,(n=this.parent)==null||n.addChild(this),this.update(this.props,this.presenceContext)}unmount(){var t;this.projection&&this.projection.unmount(),Xy(this.notifyUpdate),Xy(this.render),this.valueSubscriptions.forEach(n=>n()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),(t=this.parent)==null||t.removeChild(this);for(const n in this.events)this.events[n].clear();for(const n in this.features){const r=this.features[n];r&&(r.unmount(),r.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,n){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const r=o8.has(t);r&&this.onBindTransform&&this.onBindTransform();const s=n.on("change",o=>{this.latestValues[t]=o,this.props.onUpdate&&Oo.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let a;window.MotionCheckAppearSync&&(a=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{s(),a&&a(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in KN){const n=KN[t];if(!n)continue;const{isEnabled:r,Feature:s}=n;if(!this.features[t]&&s&&r(this.props)&&(this.features[t]=new s(this)),this.features[t]){const a=this.features[t];a.isMounted?a.update():(a.mount(),a.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):ml()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<d4e.length;r++){const s=d4e[r];this.propEventSubscriptions[s]&&(this.propEventSubscriptions[s](),delete this.propEventSubscriptions[s]);const a="on"+s,o=t[a];o&&(this.propEventSubscriptions[s]=this.on(s,o))}this.prevMotionValues=Vcn(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const r=this.values.get(t);n!==r&&(r&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=GN(n===null?void 0:n,{owner:this}),this.addValue(t,r)),r}readValue(t,n){let r=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return r!=null&&(typeof r=="string"&&(RD(r)||DD(r))?r=parseFloat(r):!Jln(r)&&Qy.test(n)&&(r=jze(t,n)),this.setBaseTarget(t,Ou(r)?r.get():r)),Ou(r)?r.get():r}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var a;const{initial:n}=this.props;let r;if(typeof n=="string"||typeof n=="object"){const o=mue(this.props,n,(a=this.presenceContext)==null?void 0:a.custom);o&&(r=o[t])}if(n&&r!==void 0)return r;const s=this.getBaseTargetFromProps(this.props,t);return s!==void 0&&!Ou(s)?s:this.initialValues[t]!==void 0&&r===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new lA),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){oue.render(this.render)}}class Zze extends Wcn{constructor(){super(...arguments),this.KeyframeResolver=Uln}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Ou(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function Jze(e,{style:t,vars:n},r,s){const a=e.style;let o;for(o in t)a[o]=t[o];s==null||s.applyProjectionStyles(a,r);for(o in n)a.setProperty(o,n[o])}function qcn(e){return window.getComputedStyle(e)}class Gcn extends Zze{constructor(){super(...arguments),this.type="html",this.renderInstance=Jze}readValueFromInstance(t,n){var r;if(o8.has(n))return(r=this.projection)!=null&&r.isProjecting?Une(n):aln(t,n);{const s=qcn(t),a=(Yce(n)?s.getPropertyValue(n):s[n])||0;return typeof a=="string"?a.trim():a}}measureInstanceViewportBox(t,{transformPagePoint:n}){return Xze(t,n)}build(t,n,r){fue(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return xue(t,n,r)}}const eHe=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function Kcn(e,t,n,r){Jze(e,t,void 0,r);for(const s in t.attrs)e.setAttribute(eHe.has(s)?s:gue(s),t.attrs[s])}class Ycn extends Zze{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=ml}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(o8.has(n)){const r=Aze(n);return r&&r.default||0}return n=eHe.has(n)?n:gue(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return Hze(t,n,r)}build(t,n,r){Bze(t,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(t,n,r,s){Kcn(t,n,r,s)}mount(t){this.isSVGTag=Uze(t.tagName),super.mount(t)}}const Xcn=(e,t)=>pue(e)?new Ycn(t):new Gcn(t,{allowProjection:e!==m.Fragment});function b4(e,t,n){const r=e.getProps();return mue(r,t,n!==void 0?n:r.custom,e)}const Qne=e=>Array.isArray(e);function Qcn(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,GN(n))}function Zcn(e){return Qne(e)?e[e.length-1]||0:e}function Jcn(e,t){const n=b4(e,t);let{transitionEnd:r={},transition:s={},...a}=n||{};a={...a,...r};for(const o in a){const l=Zcn(a[o]);Qcn(e,o,l)}}function eun(e){return!!(Ou(e)&&e.add)}function Zne(e,t){const n=e.getValue("willChange");if(eun(n))return n.add(t);if(!n&&Oc.WillChange){const r=new Oc.WillChange("auto");e.addValue("willChange",r),r.add(t)}}function tHe(e){return e.props[Vze]}const tun=e=>e!==null;function nun(e,{repeat:t,repeatType:n="loop"},r){const s=e.filter(tun),a=t&&n!=="loop"&&t%2===1?0:s.length-1;return s[a]}const run={type:"spring",stiffness:500,damping:25,restSpeed:10},sun=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),iun={type:"keyframes",duration:.8},aun={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},oun=(e,{keyframes:t})=>t.length>2?iun:o8.has(e)?e.startsWith("scale")?sun(t[1]):run:aun;function lun({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:s,repeat:a,repeatType:o,repeatDelay:l,from:c,elapsed:u,...d}){return!!Object.keys(d).length}const bue=(e,t,n,r={},s,a)=>o=>{const l=iue(r,e)||{},c=l.delay||r.delay||0;let{elapsed:u=0}=r;u=u-Hl(c);const d={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...l,delay:-u,onUpdate:x=>{t.set(x),l.onUpdate&&l.onUpdate(x)},onComplete:()=>{o(),l.onComplete&&l.onComplete()},name:e,motionValue:t,element:a?void 0:s};lun(l)||Object.assign(d,oun(e,d)),d.duration&&(d.duration=Hl(d.duration)),d.repeatDelay&&(d.repeatDelay=Hl(d.repeatDelay)),d.from!==void 0&&(d.keyframes[0]=d.from);let f=!1;if((d.type===!1||d.duration===0&&!d.repeatDelay)&&(qne(d),d.delay===0&&(f=!0)),(Oc.instantAnimations||Oc.skipAnimations)&&(f=!0,qne(d),d.delay=0),d.allowFlatten=!l.type&&!l.ease,f&&!a&&t.get()!==void 0){const x=nun(d.keyframes,l);if(x!==void 0){Oo.update(()=>{d.onUpdate(x),d.onComplete()});return}}return l.isSync?new rue(d):new kln(d)};function cun({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function nHe(e,t,{delay:n=0,transitionOverride:r,type:s}={}){let{transition:a=e.getDefaultTransition(),transitionEnd:o,...l}=t;r&&(a=r);const c=[],u=s&&e.animationState&&e.animationState.getState()[s];for(const d in l){const f=e.getValue(d,e.latestValues[d]??null),x=l[d];if(x===void 0||u&&cun(u,d))continue;const g={delay:n,...iue(a||{},d)},v=f.get();if(v!==void 0&&!f.isAnimating&&!Array.isArray(x)&&x===v&&!g.velocity)continue;let w=!1;if(window.MotionHandoffAnimation){const N=tHe(e);if(N){const P=window.MotionHandoffAnimation(N,d,Oo);P!==null&&(g.startTime=P,w=!0)}}Zne(e,d),f.start(bue(d,f,x,e.shouldReduceMotion&&Cze.has(d)?{type:!1}:g,e,w));const C=f.animation;C&&c.push(C)}return o&&Promise.all(c).then(()=>{Oo.update(()=>{o&&Jcn(e,o)})}),c}function rHe(e,t,n,r=0,s=1){const a=Array.from(e).sort((u,d)=>u.sortNodePosition(d)).indexOf(t),o=e.size,l=(o-1)*r;return typeof n=="function"?n(a,o):s===1?a*r:l-a*r}function Jne(e,t,n={}){var c;const r=b4(e,t,n.type==="exit"?(c=e.presenceContext)==null?void 0:c.custom:void 0);let{transition:s=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(s=n.transitionOverride);const a=r?()=>Promise.all(nHe(e,r,n)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(u=0)=>{const{delayChildren:d=0,staggerChildren:f,staggerDirection:x}=s;return uun(e,t,u,d,f,x,n)}:()=>Promise.resolve(),{when:l}=s;if(l){const[u,d]=l==="beforeChildren"?[a,o]:[o,a];return u().then(()=>d())}else return Promise.all([a(),o(n.delay)])}function uun(e,t,n=0,r=0,s=0,a=1,o){const l=[];for(const c of e.variantChildren)c.notify("AnimationStart",t),l.push(Jne(c,t,{...o,delay:n+(typeof r=="function"?0:r)+rHe(e.variantChildren,c,r,s,a)}).then(()=>c.notify("AnimationComplete",t)));return Promise.all(l)}function dun(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const s=t.map(a=>Jne(e,a,n));r=Promise.all(s)}else if(typeof t=="string")r=Jne(e,t,n);else{const s=typeof t=="function"?b4(e,t,n.custom):t;r=Promise.all(nHe(e,s,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}function sHe(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}const fun=due.length;function iHe(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?iHe(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<fun;n++){const r=due[n],s=e.props[r];(U_(s)||s===!1)&&(t[r]=s)}return t}const hun=[...uue].reverse(),pun=uue.length;function mun(e){return t=>Promise.all(t.map(({animation:n,options:r})=>dun(e,n,r)))}function xun(e){let t=mun(e),n=f4e(),r=!0;const s=c=>(u,d)=>{var x;const f=b4(e,d,c==="exit"?(x=e.presenceContext)==null?void 0:x.custom:void 0);if(f){const{transition:g,transitionEnd:v,...w}=f;u={...u,...w,...v}}return u};function a(c){t=c(e)}function o(c){const{props:u}=e,d=iHe(e.parent)||{},f=[],x=new Set;let g={},v=1/0;for(let C=0;C<pun;C++){const N=hun[C],P=n[N],I=u[N]!==void 0?u[N]:d[N],R=U_(I),F=N===c?P.isActive:null;F===!1&&(v=C);let U=I===d[N]&&I!==u[N]&&R;if(U&&r&&e.manuallyAnimateOnMount&&(U=!1),P.protectedKeys={...g},!P.isActive&&F===null||!I&&!P.prevProp||mU(I)||typeof I=="boolean")continue;const L=gun(P.prevProp,I);let z=L||N===c&&P.isActive&&!U&&R||C>v&&R,Q=!1;const ne=Array.isArray(I)?I:[I];let J=ne.reduce(s(N),{});F===!1&&(J={});const{prevResolvedValues:X={}}=P,re={...X,...J},pe=oe=>{z=!0,x.has(oe)&&(Q=!0,x.delete(oe)),P.needsAnimating[oe]=!0;const G=e.getValue(oe);G&&(G.liveStyle=!1)};for(const oe in re){const G=J[oe],V=X[oe];if(g.hasOwnProperty(oe))continue;let ee=!1;Qne(G)&&Qne(V)?ee=!sHe(G,V):ee=G!==V,ee?G!=null?pe(oe):x.add(oe):G!==void 0&&x.has(oe)?pe(oe):P.protectedKeys[oe]=!0}P.prevProp=I,P.prevResolvedValues=J,P.isActive&&(g={...g,...J}),r&&e.blockInitialAnimation&&(z=!1);const Y=U&&L;z&&(!Y||Q)&&f.push(...ne.map(oe=>{const G={type:N};if(typeof oe=="string"&&r&&!Y&&e.manuallyAnimateOnMount&&e.parent){const{parent:V}=e,ee=b4(V,oe);if(V.enteringChildren&&ee){const{delayChildren:ae}=ee.transition||{};G.delay=rHe(V.enteringChildren,e,ae)}}return{animation:oe,options:G}}))}if(x.size){const C={};if(typeof u.initial!="boolean"){const N=b4(e,Array.isArray(u.initial)?u.initial[0]:u.initial);N&&N.transition&&(C.transition=N.transition)}x.forEach(N=>{const P=e.getBaseTarget(N),I=e.getValue(N);I&&(I.liveStyle=!0),C[N]=P??null}),f.push({animation:C})}let w=!!f.length;return r&&(u.initial===!1||u.initial===u.animate)&&!e.manuallyAnimateOnMount&&(w=!1),r=!1,w?t(f):Promise.resolve()}function l(c,u){var f;if(n[c].isActive===u)return Promise.resolve();(f=e.variantChildren)==null||f.forEach(x=>{var g;return(g=x.animationState)==null?void 0:g.setActive(c,u)}),n[c].isActive=u;const d=o(c);for(const x in n)n[x].protectedKeys={};return d}return{animateChanges:o,setActive:l,setAnimateFunction:a,getState:()=>n,reset:()=>{n=f4e()}}}function gun(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!sHe(t,e):!1}function pv(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function f4e(){return{animate:pv(!0),whileInView:pv(),whileHover:pv(),whileTap:pv(),whileDrag:pv(),whileFocus:pv(),exit:pv()}}class v2{constructor(t){this.isMounted=!1,this.node=t}update(){}}class bun extends v2{constructor(t){super(t),t.animationState||(t.animationState=xun(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();mU(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)==null||t.call(this)}}let yun=0;class vun extends v2{constructor(){super(...arguments),this.id=yun++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;const s=this.node.animationState.setActive("exit",!t);n&&!t&&s.then(()=>{n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const wun={animation:{Feature:bun},exit:{Feature:vun}};function H_(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function gT(e){return{point:{x:e.pageX,y:e.pageY}}}const Cun=e=>t=>lue(t)&&e(t,gT(t));function h9(e,t,n,r){return H_(e,t,Cun(n),r)}const aHe=1e-4,Sun=1-aHe,Nun=1+aHe,oHe=.01,Aun=0-oHe,jun=0+oHe;function cd(e){return e.max-e.min}function Eun(e,t,n){return Math.abs(e-t)<=n}function h4e(e,t,n,r=.5){e.origin=r,e.originPoint=zo(t.min,t.max,e.origin),e.scale=cd(n)/cd(t),e.translate=zo(n.min,n.max,e.origin)-e.originPoint,(e.scale>=Sun&&e.scale<=Nun||isNaN(e.scale))&&(e.scale=1),(e.translate>=Aun&&e.translate<=jun||isNaN(e.translate))&&(e.translate=0)}function p9(e,t,n,r){h4e(e.x,t.x,n.x,r?r.originX:void 0),h4e(e.y,t.y,n.y,r?r.originY:void 0)}function p4e(e,t,n){e.min=n.min+t.min,e.max=e.min+cd(t)}function _un(e,t,n){p4e(e.x,t.x,n.x),p4e(e.y,t.y,n.y)}function m4e(e,t,n){e.min=t.min-n.min,e.max=e.min+cd(t)}function m9(e,t,n){m4e(e.x,t.x,n.x),m4e(e.y,t.y,n.y)}function Th(e){return[e("x"),e("y")]}const lHe=({current:e})=>e?e.ownerDocument.defaultView:null,x4e=(e,t)=>Math.abs(e-t);function kun(e,t){const n=x4e(e.x,t.x),r=x4e(e.y,t.y);return Math.sqrt(n**2+r**2)}class cHe{constructor(t,n,{transformPagePoint:r,contextWindow:s=window,dragSnapToOrigin:a=!1,distanceThreshold:o=3}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const x=uX(this.lastMoveEventInfo,this.history),g=this.startEvent!==null,v=kun(x.offset,{x:0,y:0})>=this.distanceThreshold;if(!g&&!v)return;const{point:w}=x,{timestamp:C}=Kc;this.history.push({...w,timestamp:C});const{onStart:N,onMove:P}=this.handlers;g||(N&&N(this.lastMoveEvent,x),this.startEvent=this.lastMoveEvent),P&&P(this.lastMoveEvent,x)},this.handlePointerMove=(x,g)=>{this.lastMoveEvent=x,this.lastMoveEventInfo=cX(g,this.transformPagePoint),Oo.update(this.updatePoint,!0)},this.handlePointerUp=(x,g)=>{this.end();const{onEnd:v,onSessionEnd:w,resumeAnimation:C}=this.handlers;if(this.dragSnapToOrigin&&C&&C(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const N=uX(x.type==="pointercancel"?this.lastMoveEventInfo:cX(g,this.transformPagePoint),this.history);this.startEvent&&v&&v(x,N),w&&w(x,N)},!lue(t))return;this.dragSnapToOrigin=a,this.handlers=n,this.transformPagePoint=r,this.distanceThreshold=o,this.contextWindow=s||window;const l=gT(t),c=cX(l,this.transformPagePoint),{point:u}=c,{timestamp:d}=Kc;this.history=[{...u,timestamp:d}];const{onSessionStart:f}=n;f&&f(t,uX(c,this.history)),this.removeListeners=ux(h9(this.contextWindow,"pointermove",this.handlePointerMove),h9(this.contextWindow,"pointerup",this.handlePointerUp),h9(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),Xy(this.updatePoint)}}function cX(e,t){return t?{point:t(e.point)}:e}function g4e(e,t){return{x:e.x-t.x,y:e.y-t.y}}function uX({point:e},t){return{point:e,delta:g4e(e,uHe(t)),offset:g4e(e,Tun(t)),velocity:Iun(t,.1)}}function Tun(e){return e[0]}function uHe(e){return e[e.length-1]}function Iun(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const s=uHe(e);for(;n>=0&&(r=e[n],!(s.timestamp-r.timestamp>Hl(t)));)n--;if(!r)return{x:0,y:0};const a=rl(s.timestamp-r.timestamp);if(a===0)return{x:0,y:0};const o={x:(s.x-r.x)/a,y:(s.y-r.y)/a};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function Pun(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?zo(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?zo(n,e,r.max):Math.min(e,n)),e}function b4e(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function Fun(e,{top:t,left:n,bottom:r,right:s}){return{x:b4e(e.x,n,s),y:b4e(e.y,t,r)}}function y4e(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function Oun(e,t){return{x:y4e(e.x,t.x),y:y4e(e.y,t.y)}}function Mun(e,t){let n=.5;const r=cd(e),s=cd(t);return s>r?n=K0(t.min,t.max-r,e.min):r>s&&(n=K0(e.min,e.max-s,t.min)),Fc(0,1,n)}function Run(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const ere=.35;function Lun(e=ere){return e===!1?e=0:e===!0&&(e=ere),{x:v4e(e,"left","right"),y:v4e(e,"top","bottom")}}function v4e(e,t,n){return{min:w4e(e,t),max:w4e(e,n)}}function w4e(e,t){return typeof e=="number"?e:e[t]||0}const Dun=new WeakMap;class Bun{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=ml(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:n=!1,distanceThreshold:r}={}){const{presenceContext:s}=this.visualElement;if(s&&s.isPresent===!1)return;const a=f=>{const{dragSnapToOrigin:x}=this.getProps();x?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(gT(f).point)},o=(f,x)=>{const{drag:g,dragPropagation:v,onDragStart:w}=this.getProps();if(g&&!v&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Wln(g),!this.openDragLock))return;this.latestPointerEvent=f,this.latestPanInfo=x,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Th(N=>{let P=this.getAxisMotionValue(N).get()||0;if(V0.test(P)){const{projection:I}=this.visualElement;if(I&&I.layout){const R=I.layout.layoutBox[N];R&&(P=cd(R)*(parseFloat(P)/100))}}this.originPoint[N]=P}),w&&Oo.postRender(()=>w(f,x)),Zne(this.visualElement,"transform");const{animationState:C}=this.visualElement;C&&C.setActive("whileDrag",!0)},l=(f,x)=>{this.latestPointerEvent=f,this.latestPanInfo=x;const{dragPropagation:g,dragDirectionLock:v,onDirectionLock:w,onDrag:C}=this.getProps();if(!g&&!this.openDragLock)return;const{offset:N}=x;if(v&&this.currentDirection===null){this.currentDirection=$un(N),this.currentDirection!==null&&w&&w(this.currentDirection);return}this.updateAxis("x",x.point,N),this.updateAxis("y",x.point,N),this.visualElement.render(),C&&C(f,x)},c=(f,x)=>{this.latestPointerEvent=f,this.latestPanInfo=x,this.stop(f,x),this.latestPointerEvent=null,this.latestPanInfo=null},u=()=>Th(f=>{var x;return this.getAnimationState(f)==="paused"&&((x=this.getAxisMotionValue(f).animation)==null?void 0:x.play())}),{dragSnapToOrigin:d}=this.getProps();this.panSession=new cHe(t,{onSessionStart:a,onStart:o,onMove:l,onSessionEnd:c,resumeAnimation:u},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:d,distanceThreshold:r,contextWindow:lHe(this.visualElement)})}stop(t,n){const r=t||this.latestPointerEvent,s=n||this.latestPanInfo,a=this.isDragging;if(this.cancel(),!a||!s||!r)return;const{velocity:o}=s;this.startAnimation(o);const{onDragEnd:l}=this.getProps();l&&Oo.postRender(()=>l(r,s))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,r){const{drag:s}=this.getProps();if(!r||!WP(t,s,this.currentDirection))return;const a=this.getAxisMotionValue(t);let o=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(o=Pun(o,this.constraints[t],this.elastic[t])),a.set(o)}resolveConstraints(){var a;const{dragConstraints:t,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(a=this.visualElement.projection)==null?void 0:a.layout,s=this.constraints;t&&HC(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=Fun(r.layoutBox,t):this.constraints=!1,this.elastic=Lun(n),s!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&Th(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=Run(r.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!HC(t))return!1;const r=t.current,{projection:s}=this.visualElement;if(!s||!s.layout)return!1;const a=Ucn(r,s.root,this.visualElement.getTransformPagePoint());let o=Oun(s.layout.layoutBox,a);if(n){const l=n(Dcn(o));this.hasMutatedConstraints=!!l,l&&(o=Gze(l))}return o}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:s,dragTransition:a,dragSnapToOrigin:o,onDragTransitionEnd:l}=this.getProps(),c=this.constraints||{},u=Th(d=>{if(!WP(d,n,this.currentDirection))return;let f=c[d]||{};o&&(f={min:0,max:0});const x=s?200:1e6,g=s?40:1e7,v={type:"inertia",velocity:r?t[d]:0,bounceStiffness:x,bounceDamping:g,timeConstant:750,restDelta:1,restSpeed:10,...a,...f};return this.startAxisValueAnimation(d,v)});return Promise.all(u).then(l)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return Zne(this.visualElement,t),r.start(bue(t,r,0,n,this.visualElement,!1))}stopAnimation(){Th(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){Th(t=>{var n;return(n=this.getAxisMotionValue(t).animation)==null?void 0:n.pause()})}getAnimationState(t){var n;return(n=this.getAxisMotionValue(t).animation)==null?void 0:n.state}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,r=this.visualElement.getProps(),s=r[n];return s||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){Th(n=>{const{drag:r}=this.getProps();if(!WP(n,r,this.currentDirection))return;const{projection:s}=this.visualElement,a=this.getAxisMotionValue(n);if(s&&s.layout){const{min:o,max:l}=s.layout.layoutBox[n];a.set(t[n]-zo(o,l,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!HC(n)||!r||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};Th(o=>{const l=this.getAxisMotionValue(o);if(l&&this.constraints!==!1){const c=l.get();s[o]=Mun({min:c,max:c},this.constraints[o])}});const{transformTemplate:a}=this.visualElement.getProps();this.visualElement.current.style.transform=a?a({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),Th(o=>{if(!WP(o,t,null))return;const l=this.getAxisMotionValue(o),{min:c,max:u}=this.constraints[o];l.set(zo(c,u,s[o]))})}addListeners(){if(!this.visualElement.current)return;Dun.set(this.visualElement,this);const t=this.visualElement.current,n=h9(t,"pointerdown",c=>{const{drag:u,dragListener:d=!0}=this.getProps();u&&d&&this.start(c)}),r=()=>{const{dragConstraints:c}=this.getProps();HC(c)&&c.current&&(this.constraints=this.resolveRefConstraints())},{projection:s}=this.visualElement,a=s.addEventListener("measure",r);s&&!s.layout&&(s.root&&s.root.updateScroll(),s.updateLayout()),Oo.read(r);const o=H_(window,"resize",()=>this.scalePositionWithinConstraints()),l=s.addEventListener("didUpdate",({delta:c,hasLayoutChanged:u})=>{this.isDragging&&u&&(Th(d=>{const f=this.getAxisMotionValue(d);f&&(this.originPoint[d]+=c[d].translate,f.set(f.get()+c[d].translate))}),this.visualElement.render())});return()=>{o(),n(),a(),l&&l()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:s=!1,dragConstraints:a=!1,dragElastic:o=ere,dragMomentum:l=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:s,dragConstraints:a,dragElastic:o,dragMomentum:l}}}function WP(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function $un(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class Uun extends v2{constructor(t){super(t),this.removeGroupControls=al,this.removeListeners=al,this.controls=new Bun(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||al}unmount(){this.removeGroupControls(),this.removeListeners()}}const C4e=e=>(t,n)=>{e&&Oo.postRender(()=>e(t,n))};class zun extends v2{constructor(){super(...arguments),this.removePointerDownListener=al}onPointerDown(t){this.session=new cHe(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:lHe(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:s}=this.node.getProps();return{onSessionStart:C4e(t),onStart:C4e(n),onMove:r,onEnd:(a,o)=>{delete this.session,s&&Oo.postRender(()=>s(a,o))}}}mount(){this.removePointerDownListener=h9(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const AO={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function S4e(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const X7={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(li.test(e))e=parseFloat(e);else return e;const n=S4e(e,t.target.x),r=S4e(e,t.target.y);return`${n}% ${r}%`}},Hun={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,s=Qy.parse(e);if(s.length>5)return r;const a=Qy.createTransformer(e),o=typeof s[0]!="number"?1:0,l=n.x.scale*t.x,c=n.y.scale*t.y;s[0+o]/=l,s[1+o]/=c;const u=zo(l,c,.5);return typeof s[2+o]=="number"&&(s[2+o]/=u),typeof s[3+o]=="number"&&(s[3+o]/=u),a(s)}};let dX=!1;class Vun extends m.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:s}=this.props,{projection:a}=t;fcn(Wun),a&&(n.group&&n.group.add(a),r&&r.register&&s&&r.register(a),dX&&a.root.didUpdate(),a.addEventListener("animationComplete",()=>{this.safeToRemove()}),a.setOptions({...a.options,onExitComplete:()=>this.safeToRemove()})),AO.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:s,isPresent:a}=this.props,{projection:o}=r;return o&&(o.isPresent=a,dX=!0,s||t.layoutDependency!==n||n===void 0||t.isPresent!==a?o.willUpdate():this.safeToRemove(),t.isPresent!==a&&(a?o.promote():o.relegate()||Oo.postRender(()=>{const l=o.getStack();(!l||!l.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),oue.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:s}=t;dX=!0,s&&(s.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(s),r&&r.deregister&&r.deregister(s))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function dHe(e){const[t,n]=Fze(),r=m.useContext(qce);return i.jsx(Vun,{...e,layoutGroup:r,switchLayoutGroup:m.useContext(Wze),isPresent:t,safeToRemove:n})}const Wun={borderRadius:{...X7,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:X7,borderTopRightRadius:X7,borderBottomLeftRadius:X7,borderBottomRightRadius:X7,boxShadow:Hun};function qun(e,t,n){const r=Ou(e)?e:GN(e);return r.start(bue("",r,t,n)),r.animation}const Gun=(e,t)=>e.depth-t.depth;class Kun{constructor(){this.children=[],this.isDirty=!1}add(t){yk(this.children,t),this.isDirty=!0}remove(t){vk(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(Gun),this.isDirty=!1,this.children.forEach(t)}}function Yun(e,t){const n=Jd.now(),r=({timestamp:s})=>{const a=s-n;a>=t&&(Xy(r),e(a-t))};return Oo.setup(r,!0),()=>Xy(r)}const fHe=["TopLeft","TopRight","BottomLeft","BottomRight"],Xun=fHe.length,N4e=e=>typeof e=="string"?parseFloat(e):e,A4e=e=>typeof e=="number"||li.test(e);function Qun(e,t,n,r,s,a){s?(e.opacity=zo(0,n.opacity??1,Zun(r)),e.opacityExit=zo(t.opacity??1,0,Jun(r))):a&&(e.opacity=zo(t.opacity??1,n.opacity??1,r));for(let o=0;o<Xun;o++){const l=`border${fHe[o]}Radius`;let c=j4e(t,l),u=j4e(n,l);if(c===void 0&&u===void 0)continue;c||(c=0),u||(u=0),c===0||u===0||A4e(c)===A4e(u)?(e[l]=Math.max(zo(N4e(c),N4e(u),r),0),(V0.test(u)||V0.test(c))&&(e[l]+="%")):e[l]=u}(t.rotate||n.rotate)&&(e.rotate=zo(t.rotate||0,n.rotate||0,r))}function j4e(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const Zun=hHe(0,.5,dse),Jun=hHe(.5,.95,al);function hHe(e,t,n){return r=>r<e?0:r>t?1:n(K0(e,t,r))}function E4e(e,t){e.min=t.min,e.max=t.max}function Ah(e,t){E4e(e.x,t.x),E4e(e.y,t.y)}function _4e(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function k4e(e,t,n,r,s){return e-=t,e=QL(e,1/n,r),s!==void 0&&(e=QL(e,1/s,r)),e}function edn(e,t=0,n=1,r=.5,s,a=e,o=e){if(V0.test(t)&&(t=parseFloat(t),t=zo(o.min,o.max,t/100)-o.min),typeof t!="number")return;let l=zo(a.min,a.max,r);e===a&&(l-=t),e.min=k4e(e.min,t,n,l,s),e.max=k4e(e.max,t,n,l,s)}function T4e(e,t,[n,r,s],a,o){edn(e,t[n],t[r],t[s],t.scale,a,o)}const tdn=["x","scaleX","originX"],ndn=["y","scaleY","originY"];function I4e(e,t,n,r){T4e(e.x,t,tdn,n?n.x:void 0,r?r.x:void 0),T4e(e.y,t,ndn,n?n.y:void 0,r?r.y:void 0)}function P4e(e){return e.translate===0&&e.scale===1}function pHe(e){return P4e(e.x)&&P4e(e.y)}function F4e(e,t){return e.min===t.min&&e.max===t.max}function rdn(e,t){return F4e(e.x,t.x)&&F4e(e.y,t.y)}function O4e(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function mHe(e,t){return O4e(e.x,t.x)&&O4e(e.y,t.y)}function M4e(e){return cd(e.x)/cd(e.y)}function R4e(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class sdn{constructor(){this.members=[]}add(t){yk(this.members,t),t.scheduleRender()}remove(t){if(vk(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(s=>t===s);if(n===0)return!1;let r;for(let s=n;s>=0;s--){const a=this.members[s];if(a.isPresent!==!1){r=a;break}}return r?(this.promote(r),!0):!1}promote(t,n){const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.instance&&r.scheduleRender(),t.scheduleRender(),t.resumeFrom=r,n&&(t.resumeFrom.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:s}=t.options;s===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:r}=t;n.onExitComplete&&n.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function idn(e,t,n){let r="";const s=e.x.translate/t.x,a=e.y.translate/t.y,o=(n==null?void 0:n.z)||0;if((s||a||o)&&(r=`translate3d(${s}px, ${a}px, ${o}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:u,rotate:d,rotateX:f,rotateY:x,skewX:g,skewY:v}=n;u&&(r=`perspective(${u}px) ${r}`),d&&(r+=`rotate(${d}deg) `),f&&(r+=`rotateX(${f}deg) `),x&&(r+=`rotateY(${x}deg) `),g&&(r+=`skewX(${g}deg) `),v&&(r+=`skewY(${v}deg) `)}const l=e.x.scale*t.x,c=e.y.scale*t.y;return(l!==1||c!==1)&&(r+=`scale(${l}, ${c})`),r||"none"}const fX=["","X","Y","Z"],adn=1e3;let odn=0;function hX(e,t,n,r){const{latestValues:s}=t;s[e]&&(n[e]=s[e],t.setStaticValue(e,0),r&&(r[e]=0))}function xHe(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=tHe(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:s,layoutId:a}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",Oo,!(s||a))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&xHe(r)}function gHe({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:s}){return class{constructor(o={},l=t==null?void 0:t()){this.id=odn++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(udn),this.nodes.forEach(pdn),this.nodes.forEach(mdn),this.nodes.forEach(ddn)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=l?l.root||l:this,this.path=l?[...l.path,l]:[],this.parent=l,this.depth=l?l.depth+1:0;for(let c=0;c<this.path.length;c++)this.path[c].shouldResetTransform=!0;this.root===this&&(this.nodes=new Kun)}addEventListener(o,l){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new lA),this.eventHandlers.get(o).add(l)}notifyListeners(o,...l){const c=this.eventHandlers.get(o);c&&c.notify(...l)}hasListeners(o){return this.eventHandlers.has(o)}mount(o){if(this.instance)return;this.isSVG=Pze(o)&&!Qln(o),this.instance=o;const{layoutId:l,layout:c,visualElement:u}=this.options;if(u&&!u.current&&u.mount(o),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(c||l)&&(this.isLayoutDirty=!0),e){let d,f=0;const x=()=>this.root.updateBlockedByResize=!1;Oo.read(()=>{f=window.innerWidth}),e(o,()=>{const g=window.innerWidth;g!==f&&(f=g,this.root.updateBlockedByResize=!0,d&&d(),d=Yun(x,250),AO.hasAnimatedSinceResize&&(AO.hasAnimatedSinceResize=!1,this.nodes.forEach(B4e)))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&u&&(l||c)&&this.addEventListener("didUpdate",({delta:d,hasLayoutChanged:f,hasRelativeLayoutChanged:x,layout:g})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const v=this.options.transition||u.getDefaultTransition()||vdn,{onLayoutAnimationStart:w,onLayoutAnimationComplete:C}=u.getProps(),N=!this.targetLayout||!mHe(this.targetLayout,g),P=!f&&x;if(this.options.layoutRoot||this.resumeFrom||P||f&&(N||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const I={...iue(v,"layout"),onPlay:w,onComplete:C};(u.shouldReduceMotion||this.options.layoutRoot)&&(I.delay=0,I.type=!1),this.startAnimation(I),this.setAnimationOrigin(d,P)}else f||B4e(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=g})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),Xy(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(xdn),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&xHe(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let d=0;d<this.path.length;d++){const f=this.path[d];f.shouldResetTransform=!0,f.updateScroll("snapshot"),f.options.layoutRoot&&f.willUpdate(!1)}const{layoutId:l,layout:c}=this.options;if(l===void 0&&!c)return;const u=this.getTransformTemplate();this.prevTransformTemplateValue=u?u(this.latestValues,""):void 0,this.updateSnapshot(),o&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(L4e);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(D4e);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(hdn),this.nodes.forEach(ldn),this.nodes.forEach(cdn)):this.nodes.forEach(D4e),this.clearAllSnapshots();const l=Jd.now();Kc.delta=Fc(0,1e3/60,l-Kc.timestamp),Kc.timestamp=l,Kc.isProcessing=!0,nX.update.process(Kc),nX.preRender.process(Kc),nX.render.process(Kc),Kc.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,oue.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(fdn),this.sharedNodes.forEach(gdn)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Oo.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Oo.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!cd(this.snapshot.measuredBox.x)&&!cd(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let c=0;c<this.path.length;c++)this.path[c].updateScroll();const o=this.layout;this.layout=this.measure(!1),this.layoutCorrected=ml(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:l}=this.options;l&&l.notify("LayoutMeasure",this.layout.layoutBox,o?o.layoutBox:void 0)}updateScroll(o="measure"){let l=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===o&&(l=!1),l&&this.instance){const c=r(this.instance);this.scroll={animationId:this.root.animationId,phase:o,isRoot:c,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:c}}}resetTransform(){if(!s)return;const o=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,l=this.projectionDelta&&!pHe(this.projectionDelta),c=this.getTransformTemplate(),u=c?c(this.latestValues,""):void 0,d=u!==this.prevTransformTemplateValue;o&&this.instance&&(l||Iv(this.latestValues)||d)&&(s(this.instance,u),this.shouldResetTransform=!1,this.scheduleRender())}measure(o=!0){const l=this.measurePageBox();let c=this.removeElementScroll(l);return o&&(c=this.removeTransform(c)),wdn(c),{animationId:this.root.animationId,measuredBox:l,layoutBox:c,latestValues:{},source:this.id}}measurePageBox(){var u;const{visualElement:o}=this.options;if(!o)return ml();const l=o.measureViewportBox();if(!(((u=this.scroll)==null?void 0:u.wasRoot)||this.path.some(Cdn))){const{scroll:d}=this.root;d&&(VC(l.x,d.offset.x),VC(l.y,d.offset.y))}return l}removeElementScroll(o){var c;const l=ml();if(Ah(l,o),(c=this.scroll)!=null&&c.wasRoot)return l;for(let u=0;u<this.path.length;u++){const d=this.path[u],{scroll:f,options:x}=d;d!==this.root&&f&&x.layoutScroll&&(f.wasRoot&&Ah(l,o),VC(l.x,f.offset.x),VC(l.y,f.offset.y))}return l}applyTransform(o,l=!1){const c=ml();Ah(c,o);for(let u=0;u<this.path.length;u++){const d=this.path[u];!l&&d.options.layoutScroll&&d.scroll&&d!==d.root&&WC(c,{x:-d.scroll.offset.x,y:-d.scroll.offset.y}),Iv(d.latestValues)&&WC(c,d.latestValues)}return Iv(this.latestValues)&&WC(c,this.latestValues),c}removeTransform(o){const l=ml();Ah(l,o);for(let c=0;c<this.path.length;c++){const u=this.path[c];if(!u.instance||!Iv(u.latestValues))continue;Kne(u.latestValues)&&u.updateSnapshot();const d=ml(),f=u.measurePageBox();Ah(d,f),I4e(l,u.latestValues,u.snapshot?u.snapshot.layoutBox:void 0,d)}return Iv(this.latestValues)&&I4e(l,this.latestValues),l}setTargetDelta(o){this.targetDelta=o,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(o){this.options={...this.options,...o,crossfade:o.crossfade!==void 0?o.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==Kc.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(o=!1){var x;const l=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=l.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=l.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=l.isSharedProjectionDirty);const c=!!this.resumingFrom||this!==l;if(!(o||c&&this.isSharedProjectionDirty||this.isProjectionDirty||(x=this.parent)!=null&&x.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:d,layoutId:f}=this.options;if(!(!this.layout||!(d||f))){if(this.resolvedRelativeTargetAt=Kc.timestamp,!this.targetDelta&&!this.relativeTarget){const g=this.getClosestProjectingParent();g&&g.layout&&this.animationProgress!==1?(this.relativeParent=g,this.forceRelativeParentToResolveTarget(),this.relativeTarget=ml(),this.relativeTargetOrigin=ml(),m9(this.relativeTargetOrigin,this.layout.layoutBox,g.layout.layoutBox),Ah(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=ml(),this.targetWithTransforms=ml()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),_un(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):Ah(this.target,this.layout.layoutBox),Yze(this.target,this.targetDelta)):Ah(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget)){this.attemptToResolveRelativeTarget=!1;const g=this.getClosestProjectingParent();g&&!!g.resumingFrom==!!this.resumingFrom&&!g.options.layoutScroll&&g.target&&this.animationProgress!==1?(this.relativeParent=g,this.forceRelativeParentToResolveTarget(),this.relativeTarget=ml(),this.relativeTargetOrigin=ml(),m9(this.relativeTargetOrigin,this.target,g.target),Ah(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}}}getClosestProjectingParent(){if(!(!this.parent||Kne(this.parent.latestValues)||Kze(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var v;const o=this.getLead(),l=!!this.resumingFrom||this!==o;let c=!0;if((this.isProjectionDirty||(v=this.parent)!=null&&v.isProjectionDirty)&&(c=!1),l&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(c=!1),this.resolvedRelativeTargetAt===Kc.timestamp&&(c=!1),c)return;const{layout:u,layoutId:d}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(u||d))return;Ah(this.layoutCorrected,this.layout.layoutBox);const f=this.treeScale.x,x=this.treeScale.y;$cn(this.layoutCorrected,this.treeScale,this.path,l),o.layout&&!o.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(o.target=o.layout.layoutBox,o.targetWithTransforms=ml());const{target:g}=o;if(!g){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(_4e(this.prevProjectionDelta.x,this.projectionDelta.x),_4e(this.prevProjectionDelta.y,this.projectionDelta.y)),p9(this.projectionDelta,this.layoutCorrected,g,this.latestValues),(this.treeScale.x!==f||this.treeScale.y!==x||!R4e(this.projectionDelta.x,this.prevProjectionDelta.x)||!R4e(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",g))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(o=!0){var l;if((l=this.options.visualElement)==null||l.scheduleRender(),o){const c=this.getStack();c&&c.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=qC(),this.projectionDelta=qC(),this.projectionDeltaWithTransform=qC()}setAnimationOrigin(o,l=!1){const c=this.snapshot,u=c?c.latestValues:{},d={...this.latestValues},f=qC();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!l;const x=ml(),g=c?c.source:void 0,v=this.layout?this.layout.source:void 0,w=g!==v,C=this.getStack(),N=!C||C.members.length<=1,P=!!(w&&!N&&this.options.crossfade===!0&&!this.path.some(ydn));this.animationProgress=0;let I;this.mixTargetDelta=R=>{const F=R/1e3;$4e(f.x,o.x,F),$4e(f.y,o.y,F),this.setTargetDelta(f),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(m9(x,this.layout.layoutBox,this.relativeParent.layout.layoutBox),bdn(this.relativeTarget,this.relativeTargetOrigin,x,F),I&&rdn(this.relativeTarget,I)&&(this.isProjectionDirty=!1),I||(I=ml()),Ah(I,this.relativeTarget)),w&&(this.animationValues=d,Qun(d,u,this.latestValues,F,P,N)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=F},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){var l,c,u;this.notifyListeners("animationStart"),(l=this.currentAnimation)==null||l.stop(),(u=(c=this.resumingFrom)==null?void 0:c.currentAnimation)==null||u.stop(),this.pendingAnimation&&(Xy(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Oo.update(()=>{AO.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=GN(0)),this.currentAnimation=qun(this.motionValue,[0,1e3],{...o,velocity:0,isSync:!0,onUpdate:d=>{this.mixTargetDelta(d),o.onUpdate&&o.onUpdate(d)},onStop:()=>{},onComplete:()=>{o.onComplete&&o.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(adn),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:l,target:c,layout:u,latestValues:d}=o;if(!(!l||!c||!u)){if(this!==o&&this.layout&&u&&bHe(this.options.animationType,this.layout.layoutBox,u.layoutBox)){c=this.target||ml();const f=cd(this.layout.layoutBox.x);c.x.min=o.target.x.min,c.x.max=c.x.min+f;const x=cd(this.layout.layoutBox.y);c.y.min=o.target.y.min,c.y.max=c.y.min+x}Ah(l,c),WC(l,d),p9(this.projectionDeltaWithTransform,this.layoutCorrected,l,d)}}registerSharedNode(o,l){this.sharedNodes.has(o)||this.sharedNodes.set(o,new sdn),this.sharedNodes.get(o).add(l);const u=l.options.initialPromotionConfig;l.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(l):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var l;const{layoutId:o}=this.options;return o?((l=this.getStack())==null?void 0:l.lead)||this:this}getPrevLead(){var l;const{layoutId:o}=this.options;return o?(l=this.getStack())==null?void 0:l.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:l,preserveFollowOpacity:c}={}){const u=this.getStack();u&&u.promote(this,c),o&&(this.projectionDelta=void 0,this.needsReset=!0),l&&this.setOptions({transition:l})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let l=!1;const{latestValues:c}=o;if((c.z||c.rotate||c.rotateX||c.rotateY||c.rotateZ||c.skewX||c.skewY)&&(l=!0),!l)return;const u={};c.z&&hX("z",o,u,this.animationValues);for(let d=0;d<fX.length;d++)hX(`rotate${fX[d]}`,o,u,this.animationValues),hX(`skew${fX[d]}`,o,u,this.animationValues);o.render();for(const d in u)o.setStaticValue(d,u[d]),this.animationValues&&(this.animationValues[d]=u[d]);o.scheduleRender()}applyProjectionStyles(o,l){if(!this.instance||this.isSVG)return;if(!this.isVisible){o.visibility="hidden";return}const c=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,o.visibility="",o.opacity="",o.pointerEvents=NO(l==null?void 0:l.pointerEvents)||"",o.transform=c?c(this.latestValues,""):"none";return}const u=this.getLead();if(!this.projectionDelta||!this.layout||!u.target){this.options.layoutId&&(o.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,o.pointerEvents=NO(l==null?void 0:l.pointerEvents)||""),this.hasProjected&&!Iv(this.latestValues)&&(o.transform=c?c({},""):"none",this.hasProjected=!1);return}o.visibility="";const d=u.animationValues||u.latestValues;this.applyTransformsToTarget();let f=idn(this.projectionDeltaWithTransform,this.treeScale,d);c&&(f=c(d,f)),o.transform=f;const{x,y:g}=this.projectionDelta;o.transformOrigin=`${x.origin*100}% ${g.origin*100}% 0`,u.animationValues?o.opacity=u===this?d.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:d.opacityExit:o.opacity=u===this?d.opacity!==void 0?d.opacity:"":d.opacityExit!==void 0?d.opacityExit:0;for(const v in z_){if(d[v]===void 0)continue;const{correct:w,applyTo:C,isCSSVariable:N}=z_[v],P=f==="none"?d[v]:w(d[v],u);if(C){const I=C.length;for(let R=0;R<I;R++)o[C[R]]=P}else N?this.options.visualElement.renderState.vars[v]=P:o[v]=P}this.options.layoutId&&(o.pointerEvents=u===this?NO(l==null?void 0:l.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(o=>{var l;return(l=o.currentAnimation)==null?void 0:l.stop()}),this.root.nodes.forEach(L4e),this.root.sharedNodes.clear()}}}function ldn(e){e.updateLayout()}function cdn(e){var n;const t=((n=e.resumeFrom)==null?void 0:n.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:s}=e.layout,{animationType:a}=e.options,o=t.source!==e.layout.source;a==="size"?Th(f=>{const x=o?t.measuredBox[f]:t.layoutBox[f],g=cd(x);x.min=r[f].min,x.max=x.min+g}):bHe(a,t.layoutBox,r)&&Th(f=>{const x=o?t.measuredBox[f]:t.layoutBox[f],g=cd(r[f]);x.max=x.min+g,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[f].max=e.relativeTarget[f].min+g)});const l=qC();p9(l,r,t.layoutBox);const c=qC();o?p9(c,e.applyTransform(s,!0),t.measuredBox):p9(c,r,t.layoutBox);const u=!pHe(l);let d=!1;if(!e.resumeFrom){const f=e.getClosestProjectingParent();if(f&&!f.resumeFrom){const{snapshot:x,layout:g}=f;if(x&&g){const v=ml();m9(v,t.layoutBox,x.layoutBox);const w=ml();m9(w,r,g.layoutBox),mHe(v,w)||(d=!0),f.options.layoutRoot&&(e.relativeTarget=w,e.relativeTargetOrigin=v,e.relativeParent=f)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:t,delta:c,layoutDelta:l,hasLayoutChanged:u,hasRelativeLayoutChanged:d})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function udn(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function ddn(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function fdn(e){e.clearSnapshot()}function L4e(e){e.clearMeasurements()}function D4e(e){e.isLayoutDirty=!1}function hdn(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function B4e(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function pdn(e){e.resolveTargetDelta()}function mdn(e){e.calcProjection()}function xdn(e){e.resetSkewAndRotation()}function gdn(e){e.removeLeadSnapshot()}function $4e(e,t,n){e.translate=zo(t.translate,0,n),e.scale=zo(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function U4e(e,t,n,r){e.min=zo(t.min,n.min,r),e.max=zo(t.max,n.max,r)}function bdn(e,t,n,r){U4e(e.x,t.x,n.x,r),U4e(e.y,t.y,n.y,r)}function ydn(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const vdn={duration:.45,ease:[.4,0,.1,1]},z4e=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),H4e=z4e("applewebkit/")&&!z4e("chrome/")?Math.round:al;function V4e(e){e.min=H4e(e.min),e.max=H4e(e.max)}function wdn(e){V4e(e.x),V4e(e.y)}function bHe(e,t,n){return e==="position"||e==="preserve-aspect"&&!Eun(M4e(t),M4e(n),.2)}function Cdn(e){var t;return e!==e.root&&((t=e.scroll)==null?void 0:t.wasRoot)}const Sdn=gHe({attachResizeListener:(e,t)=>H_(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),pX={current:void 0},yHe=gHe({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!pX.current){const e=new Sdn({});e.mount(window),e.setOptions({layoutScroll:!0}),pX.current=e}return pX.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),Ndn={pan:{Feature:zun},drag:{Feature:Uun,ProjectionNode:yHe,MeasureLayout:dHe}};function W4e(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const s="onHover"+n,a=r[s];a&&Oo.postRender(()=>a(t,gT(t)))}class Adn extends v2{mount(){const{current:t}=this.node;t&&(this.unmount=qln(t,(n,r)=>(W4e(this.node,r,"Start"),s=>W4e(this.node,s,"End"))))}unmount(){}}class jdn extends v2{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=ux(H_(this.node.current,"focus",()=>this.onFocus()),H_(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function q4e(e,t,n){const{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap",n==="Start");const s="onTap"+(n==="End"?"":n),a=r[s];a&&Oo.postRender(()=>a(t,gT(t)))}class Edn extends v2{mount(){const{current:t}=this.node;t&&(this.unmount=Xln(t,(n,r)=>(q4e(this.node,r,"Start"),(s,{success:a})=>q4e(this.node,s,a?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const tre=new WeakMap,mX=new WeakMap,_dn=e=>{const t=tre.get(e.target);t&&t(e)},kdn=e=>{e.forEach(_dn)};function Tdn({root:e,...t}){const n=e||document;mX.has(n)||mX.set(n,{});const r=mX.get(n),s=JSON.stringify(t);return r[s]||(r[s]=new IntersectionObserver(kdn,{root:e,...t})),r[s]}function Idn(e,t,n){const r=Tdn(t);return tre.set(e,n),r.observe(e),()=>{tre.delete(e),r.unobserve(e)}}const Pdn={some:0,all:1};class Fdn extends v2{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:s="some",once:a}=t,o={root:n?n.current:void 0,rootMargin:r,threshold:typeof s=="number"?s:Pdn[s]},l=c=>{const{isIntersecting:u}=c;if(this.isInView===u||(this.isInView=u,a&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);const{onViewportEnter:d,onViewportLeave:f}=this.node.getProps(),x=u?d:f;x&&x(c)};return Idn(this.node.current,o,l)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(Odn(t,n))&&this.startObserver()}unmount(){}}function Odn({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const Mdn={inView:{Feature:Fdn},tap:{Feature:Edn},focus:{Feature:jdn},hover:{Feature:Adn}},Rdn={layout:{ProjectionNode:yHe,MeasureLayout:dHe}},Ldn={...wun,...Mdn,...Ndn,...Rdn},vo=Lcn(Ldn,Xcn);function yue({markets:e=[],value:t="",onChange:n=()=>{},loading:r=!1,iconsBaseUrl:s="https://app.hyperliquid.xyz/coins",mode:a="single",pairWhitelist:o=null,pairBase:l=[],showIcon:c=!0}){const[u,d]=m.useState(!1),[f,x]=m.useState(!1),[g,v]=m.useState(""),[w,C]=m.useState(0),[N,P]=m.useState(0),[I,R]=m.useState(320),[F,U]=m.useState("vol"),[L,z]=m.useState("desc"),[Q,ne]=m.useState("all"),[J,X]=m.useState(()=>{try{const lt=localStorage.getItem("favCoins");return lt?new Set(JSON.parse(lt)):new Set}catch{return new Set}}),re=m.useRef(null),pe=m.useRef(null),Y=150,ie={kBONK:"BONK",kPEPE:"PEPE",kSHIB:"SHIB",kFLOKI:"FLOKI",kNEIRO:"NEIRO",kDOGS:"DOGS",kLUNC:"LUNC"},oe=lt=>{var ut;const ft=(ut=lt==null?void 0:lt.split("/")[0])==null?void 0:ut.replace("-USD","").replace("/USD","");return ie[ft]||ft},G=lt=>lt==null||isNaN(lt)?"--":Intl.NumberFormat(void 0,{notation:"compact",maximumFractionDigits:2}).format(Number(lt)),V=(lt,ft=6)=>lt==null||isNaN(lt)?"--":Number(lt).toLocaleString(void 0,{minimumFractionDigits:0,maximumFractionDigits:ft}),ee=lt=>{const ft=new Set(J);ft.has(lt)?ft.delete(lt):ft.add(lt),X(ft),localStorage.setItem("favCoins",JSON.stringify([...ft]))},ae=lt=>{F===lt?z(ft=>ft==="asc"?"desc":"asc"):(U(lt),z("desc"))},fe=m.useMemo(()=>((e==null?void 0:e.map(ft=>{const ut=ft.rawSymbol||ft.symbol||ft.coin||ft.ticker||"";let qt=ft.symbol||ft.coin||ft.ticker||ut,It=ft.builder||ft.dex||"";if(ft.kind==="hip3"){const Ye=ut.indexOf(":");!It&&Ye>=0&&(It=ut.slice(0,Ye),qt=ut.slice(Ye+1))}const nn=ft.lastPrice??ft.last??ft.markPrice??null,jt=ft.change24hPct??ft.chg24??null,cn=ft.volume??ft.vol??ft.dayNtlVlm??null,un=ft.fundingRate??ft.funding??null,Ft=ft.openInterest??ft.oi??null,Ke=ft.openInterestUsd??ft.oiUsd??(Ft!=null&&nn!=null?Number(Ft)*Number(nn):null),Bt=ft.leverage!=null?ft.leverage:ft.lev!=null?ft.lev:null,$t=ft.kind||(It?"hip3":"perp"),qe=ft.coin||qt.replace(/-USDH$/,"").replace(/-USDC$/,"").replace(/-USD$/,"").replace(/\/USD$/,"");return{kind:$t,builder:It,dex:ft.dex||"",symbol:qt,rawSymbol:ut,last:nn,chg24:jt,vol:cn,funding:un,openInterest:Ke,leverage:Bt!=null&&isFinite(Bt)?Math.floor(Bt):null,coinForChange:qe}}))??[]).filter(ft=>ft.symbol),[e]),Ne=m.useMemo(()=>{const lt=new Map;for(const ft of fe){const ut=ft.symbol.replace("-USD","").replace("/USD","");lt.set(ut,ft)}return lt},[fe]),he=m.useMemo(()=>{if(a!=="pair")return[];const lt=fe.filter(cn=>cn.kind!=="hip3"),ft=lt.map(cn=>cn.symbol.replace("-USD","").replace("/USD","")),ut=Array.from(new Set(ft)),qt=Array.isArray(o)?new Set(o):null;let It=Array.isArray(l)&&l.length?l:lt.slice().sort((cn,un)=>Number(un.vol||0)-Number(cn.vol||0)).slice(0,30).map(cn=>cn.symbol.replace("-USD","").replace("/USD",""));It=It.filter(cn=>ut.includes(cn));const nn=[],jt=new Set;for(let cn=0;cn<It.length;cn++){const un=It[cn];for(let Ft=0;Ft<ut.length;Ft++){const Ke=ut[Ft];if(!un||!Ke||un===Ke)continue;const Bt=`${un}/${Ke}`;if(jt.has(Bt)||qt&&!qt.has(Bt))continue;jt.add(Bt);const $t=Ne.get(un),qe=Ne.get(Ke),Ye=$t&&qe&&Number($t.last)>0&&Number(qe.last)>0?Number($t.last)/Number(qe.last):null,ht=$t&&qe?Math.min(Number($t.vol||0),Number(qe.vol||0)):null;if(nn.push({kind:"pair",builder:"",dex:"",symbol:Bt,rawSymbol:Bt,last:Ye,chg24:null,vol:ht,funding:null,openInterest:null,leverage:null,coinForChange:Bt}),nn.length>=300)return nn}}return nn},[a,fe,o,l,Ne]),ge=m.useMemo(()=>fe.some(lt=>lt.kind==="hip3"),[fe]);m.useEffect(()=>{a==="pair"&&(U("vol"),z("desc"),ne("perps"))},[a]),m.useEffect(()=>{!ge&&Q==="hip3"&&ne("all")},[ge,Q]),m.useEffect(()=>{a==="pair"&&(U("vol"),z("desc"),ne("perps"))},[a]);const ye=m.useMemo(()=>{const lt=g.trim().toLowerCase();let ut=a==="pair"?he.slice():fe.slice();a!=="pair"&&(Q==="perps"?ut=ut.filter(It=>It.kind!=="hip3"):Q==="hip3"&&(ut=ut.filter(It=>It.kind==="hip3"))),lt&&(ut=ut.filter(It=>It.symbol.toLowerCase().includes(lt)));const qt=It=>It==null||isNaN(Number(It))?NaN:Number(It);return ut.sort((It,nn)=>{const jt=J.has(It.symbol)?1:0,cn=J.has(nn.symbol)?1:0;if(jt!==cn)return cn-jt;const un=qt(It[F]),Ft=qt(nn[F]),Ke=isNaN(un),Bt=isNaN(Ft);return Ke&&Bt?It.symbol.localeCompare(nn.symbol):Ke?1:Bt?-1:un===Ft?It.symbol.localeCompare(nn.symbol):L==="asc"?un-Ft:Ft-un}),ut},[a,fe,he,g,J,F,L,Q]),ve=()=>{const lt=pe.current;if(!lt)return;const ft=lt.getBoundingClientRect(),ut=getComputedStyle(lt),qt=parseFloat(ut.paddingLeft)||0,It=document.documentElement.clientWidth,nn=16,cn=Math.min(740,It-nn*2);let un=ft.left+qt;un+cn>It-nn&&(un=It-nn-cn),un<nn&&(un=nn),R(cn),P(un),C(ft.bottom+8)},je=()=>{ve(),d(!0),requestAnimationFrame(()=>x(!0))},Ie=()=>{x(!1),setTimeout(()=>d(!1),Y)};m.useEffect(()=>{const lt=ut=>ut.key==="Escape"&&u&&Ie(),ft=ut=>{var qt;return u&&!((qt=re.current)!=null&&qt.contains(ut.target))&&Ie()};return document.addEventListener("keydown",lt),document.addEventListener("mousedown",ft),document.addEventListener("touchstart",ft,{passive:!0}),()=>{document.removeEventListener("keydown",lt),document.removeEventListener("mousedown",ft),document.removeEventListener("touchstart",ft)}},[u]),m.useLayoutEffect(()=>{if(!u)return;ve();const lt=()=>ve(),ft=()=>ve();return window.addEventListener("scroll",lt,!0),window.addEventListener("resize",ft),()=>{window.removeEventListener("scroll",lt,!0),window.removeEventListener("resize",ft)}},[u]);const Le=t&&t.length>8?"min-w-[120px]":t&&t.length>6?"min-w-[108px]":"min-w-[96px]",Qe=lt=>{lt.currentTarget.src="data:image/svg+xml;utf8,"+encodeURIComponent("<svg xmlns='http://www.w3.org/2000/svg' width='20' height='20'><rect width='100%' height='100%' fill='#2a2a2a'/></svg>")},$e=({active:lt,dir:ft})=>i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:`w-3 h-3 ml-1 ${lt?"text-white":"text-[#6a6a6a]"}`,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:ft==="asc"?i.jsx("path",{d:"M7 14l5-5 5 5"}):i.jsx("path",{d:"M7 10l5 5 5-5"})}),it=m.useMemo(()=>a!=="pair"?t||"Select":t||"Select Pair",[a,t]),tt=({children:lt})=>i.jsx("span",{className:"tabular-nums whitespace-nowrap",children:lt});return i.jsxs("div",{className:`relative ${Le} z-[30]`,ref:re,children:[i.jsx("div",{ref:pe,className:" text-white px-1 py-2 rounded cursor-pointer text-[14px] font-medium font-['Inter'] select-none leading-none",onClick:()=>u?Ie():je(),children:i.jsxs("div",{className:"flex items-center justify-start gap-2",children:[i.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[i.jsx("span",{className:"truncate text-white font-inter text-[14px] not-italic font-medium leading-4 tracking-[-0.28px]",children:it}),i.jsx("span",{className:"inline-flex px-1 py-[2px] justify-center items-center gap-[10px] rounded-[6px] bg-[rgba(103,255,189,0.16)] text-[#67FFBD] font-inter text-[11px] not-italic font-medium leading-4 w-12",children:(()=>{const lt=fe.find(ft=>a==="pair"?ft.symbol===t:ft.rawSymbol===t||ft.symbol===t||ft.coinForChange===t);return lt&<.kind==="hip3"?"HIP-3":"PERP"})()})]}),i.jsx("span",{className:"text-[#929292] ml-auto",children:"▾"})," "]})}),u&&i.jsx("div",{className:`fixed inset-0 z-[55] bg-black/50 transition-opacity duration-[${Y}ms] ${f?"opacity-100":"opacity-0"}`,"aria-hidden":!0,onClick:Ie}),u&&i.jsx("div",{className:`fixed z-[60] transition-all duration-[${Y}ms] ease-out ${f?"opacity-100 translate-y-0 scale-100":"opacity-0 translate-y-1 scale-[0.99]"}`,style:{top:w,left:N,width:I,willChange:"transform, opacity"},children:i.jsxs("div",{className:"bg-[#121212] border border-[#2a2a2a] shadow-xl rounded-md overflow-hidden",children:[i.jsxs("div",{className:"p-2",children:[a!=="pair"&&ge&&i.jsx("div",{className:"mb-2 inline-flex text-[11px] bg-[#1b1b1b] rounded-lg p-0.5",children:[["all","All Coins"],["perps","Perps"],["hip3","HIP-3"]].map(([lt,ft])=>i.jsx("button",{className:`px-2 py-1 rounded-md font-bold ${Q===lt?"bg-[#262626] text-white":"text-[#8a8a8a]"}`,onClick:()=>ne(lt),children:ft},lt))}),i.jsxs("div",{className:"relative",children:[i.jsx("input",{value:g,onChange:lt=>v(lt.target.value),placeholder:a==="pair"?"Search pairs (e.g., BTC/ETH)":"Search markets...",className:"w-full pr-8 py-1.5 pl-2.5 bg-[#1b1b1b] rounded-md border border-[#303030] h-8 block text-white text-[12px] font-medium placeholder:text-[#535353] focus:outline-none leading-none",autoFocus:!0}),i.jsx("div",{className:"absolute right-2 top-1 pointer-events-none",children:i.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",className:"w-5 h-5 text-[#646464]",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",children:[i.jsx("circle",{cx:"11",cy:"11",r:"7",strokeWidth:"1.5"}),i.jsx("path",{d:"M20 20L17 17",strokeWidth:"1.5"})]})})]})]}),i.jsx("div",{className:"max-h-[400px] overflow-y-auto",children:i.jsxs("table",{className:"w-full text-[12px] font-inter table-fixed",children:[i.jsxs("colgroup",{children:[i.jsx("col",{className:"w-[44px]"}),i.jsx("col",{className:"w-[220px]"}),i.jsx("col",{className:"w-[80px]"}),a!=="pair"&&i.jsxs(i.Fragment,{children:[i.jsx("col",{className:"w-[160px]"}),i.jsx("col",{}),i.jsx("col",{}),i.jsx("col",{})]})]}),i.jsx("thead",{className:"sticky top-0 bg-[#141414] border-b border-[#1f1f1f] text-[#9B9B9B]",children:i.jsxs("tr",{children:[i.jsx("th",{className:"text-left align-middle"}),i.jsx("th",{className:"text-left align-middle",children:a==="pair"?"Pair":"Symbol"}),i.jsx("th",{className:"text-right align-middle",children:i.jsxs("span",{className:"inline-flex items-center cursor-pointer select-none",onClick:()=>ae("last"),children:["Last Price",i.jsx("span",{className:"ml-1",children:i.jsx($e,{active:F==="last",dir:F==="last"?L:"desc"})})]})}),a!=="pair"&&i.jsxs(i.Fragment,{children:[i.jsx("th",{className:"text-right align-middle",children:i.jsxs("span",{className:"inline-flex items-center cursor-pointer select-none",onClick:()=>ae("chg24"),children:["24h Change",i.jsx("span",{className:"ml-1",children:i.jsx($e,{active:F==="chg24",dir:F==="chg24"?L:"desc"})})]})}),i.jsx("th",{className:"text-right align-middle",children:i.jsxs("span",{className:"inline-flex items-center cursor-pointer select-none",onClick:()=>ae("vol"),children:["Vol",i.jsx("span",{className:"ml-1",children:i.jsx($e,{active:F==="vol",dir:F==="vol"?L:"desc"})})]})}),i.jsx("th",{className:"text-right align-middle",children:i.jsxs("span",{className:"inline-flex items-center cursor-pointer select-none",onClick:()=>ae("funding"),children:["Funding",i.jsx("span",{className:"ml-1",children:i.jsx($e,{active:F==="funding",dir:F==="funding"?L:"desc"})})]})}),i.jsx("th",{className:"text-right align-middle",children:i.jsxs("span",{className:"inline-flex items-center cursor-pointer select-none",onClick:()=>ae("openInterest"),children:["Open Int.",i.jsx("span",{className:"ml-1",children:i.jsx($e,{active:F==="openInterest",dir:F==="openInterest"?L:"desc"})})]})})]})]})}),i.jsx("tbody",{className:"divide-y divide-[#1f1f1f]",children:r?i.jsx("tr",{children:i.jsx("td",{className:"px-3 py-4 text-[#888888]",colSpan:a==="pair"?3:7,children:"Loading..."})}):ye.length===0?i.jsx("tr",{children:i.jsx("td",{className:"px-3 py-4 text-[#888888]",colSpan:a==="pair"?3:7,children:"No matches found"})}):ye.map(lt=>{const ft=J.has(lt.symbol),ut=a==="pair"&<.symbol.includes("/"),[qt,It]=ut?lt.symbol.split("/"):[null,null],nn=`${lt.kind||"perp"}:${lt.builder||""}:${lt.rawSymbol||lt.symbol}`;return i.jsxs("tr",{className:"hover:bg-[#1b1b1b]/70 cursor-pointer",onClick:()=>{const jt=a==="pair"?lt.symbol:lt.kind==="hip3"&<.rawSymbol?lt.rawSymbol:lt.coinForChange;n(jt),Ie()},children:[i.jsx("td",{className:"align-middle",children:i.jsx("button",{onClick:jt=>{jt.stopPropagation(),ee(lt.symbol)},className:`shrink-0 bg-transparent ${ft?"text-yellow-400":"text-[#9b9b9b]"} hover:text-yellow-400`,title:ft?"Unfavorite":"Favorite",children:ft?i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"w-3.5 h-3.5",viewBox:"0 0 24 24",fill:"currentColor",children:i.jsx("path",{d:"M12 .587l3.668 7.568L24 9.75l-6 5.85 1.42 8.41L12 19.77 4.58 24l1.42-8.4L0 9.75l8.332-1.595z"})}):i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"w-3.5 h-3.5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",children:i.jsx("path",{d:"M12 17.77l-6.18 3.73 1.42-6.82L2 9.75l6.91-1.32L12 2l3.09 6.43L22 9.75l-5.24 4.93 1.42 6.82z",strokeWidth:"1.2"})})})}),i.jsx("td",{className:"align-middle",children:i.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[c&&i.jsx(i.Fragment,{children:ut?i.jsxs(i.Fragment,{children:[i.jsx("img",{src:`${s}/${qt}.svg`,alt:qt,className:"rounded-full w-4 h-4 bg-gray-700",loading:"lazy",onError:Qe}),i.jsx("span",{className:"text-[#8a8a8a] text-xs",children:"/"}),i.jsx("img",{src:`${s}/${It}.svg`,alt:It,className:"rounded-full w-4 h-4 bg-gray-700",loading:"lazy",onError:Qe})]}):i.jsx("img",{src:lt.kind==="hip3"?`${s}/${lt.builder}:${lt.symbol.replace(/-USDC$/,"").replace(/-USDH$/,"")}.svg`:`${s}/${oe(lt.symbol)}.svg`,alt:lt.symbol,className:"rounded-full w-4 h-4 bg-gray-700",loading:"lazy",onError:Qe})}),i.jsx("span",{className:"font-semibold text-white",children:a==="pair"||lt.kind==="hip3"?lt.symbol:lt.symbol.replace(/-USD$/,"").replace(/\/USD$/,"")}),a!=="pair"&&i.jsxs("span",{className:"ml-1 inline-flex items-center gap-1",children:[lt.leverage&&i.jsxs("span",{className:"px-1.5 py-[2px] rounded-[6px] bg-[rgba(103,255,189,0.16)] text-[#67FFBD] text-[11px] font-semibold",children:[lt.leverage,"x"]}),lt.kind==="hip3"&<.builder&&i.jsx("span",{className:"px-1.5 py-[2px] rounded-[6px] bg-[rgba(103,255,189,0.16)] text-[#67FFBD] text-[11px] font-semibold uppercase",children:lt.builder})]})]})}),i.jsx("td",{className:"text-right text-white font-medium align-middle",children:i.jsx(tt,{children:lt.last==null||lt.last===0?"--":V(lt.last)})}),a!=="pair"&&i.jsxs(i.Fragment,{children:[i.jsx("td",{className:"text-right font-medium align-middle",children:i.jsx(tt,{children:lt.chg24==null||isNaN(Number(lt.chg24))||lt.last==null||lt.last===0?"--":(()=>{const jt=Number(lt.chg24),cn=Number(lt.last),un=cn/(1+jt/100||1),Ft=cn-un,Ke=Math.abs(Ft);let Bt;Ke>=1e3?Bt=0:Ke>=100?Bt=2:Bt=4;const $t=Ft>=0?"+":"-",qe=Ke.toLocaleString(void 0,{minimumFractionDigits:Bt,maximumFractionDigits:Bt}),Ye=`${jt>0?"+":""}${jt.toFixed(2)}%`,ht=jt>0?"#67FFBD":"#FF7173";return i.jsx("span",{style:{color:ht},children:`${$t}${qe} / ${Ye}`})})()})}),i.jsx("td",{className:"text-right text-white font-medium align-middle",children:i.jsx(tt,{children:G(lt.vol)})}),i.jsx("td",{className:"text-right text-white font-medium align-middle",children:i.jsx(tt,{children:lt.funding==null||isNaN(Number(lt.funding))?"--":(Number(lt.funding)*100).toFixed(4)+"%"})}),i.jsx("td",{className:"text-right text-white font-medium align-middle",children:i.jsx(tt,{children:lt.openInterest==null||isNaN(Number(lt.openInterest))?"--":"$"+G(lt.openInterest)})})]})]},nn)})})]})})]})})]})}let qP=null;function Ddn(){return typeof window>"u"?null:(qP||(qP=new Audio("/success.mp3"),qP.volume=.9),qP)}function Bdn(){const e=Ddn();if(e)try{e.currentTime=0;const t=e.play();t&&typeof t.then=="function"&&t.catch(function(){})}catch{}}function $dn(){const e=typeof window<"u"?window.ethereum:null;if(!e)return null;if(Array.isArray(e.providers)&&e.providers.length){const t=e.providers.find(r=>r&&r.isMetaMask);if(t)return t;const n=e.providers.find(r=>r&&r.isCoinbaseWallet);return n||e.providers[0]}return e}let nre=null;function Udn(e){typeof e=="object"&&!Array.isArray(e)?nre=e:nre=null}async function zdn(e,t){let n=await e.request({method:"eth_chainId"});if((n==null?void 0:n.toLowerCase())!==t.toLowerCase()){try{await e.request({method:"wallet_switchEthereumChain",params:[{chainId:t}]})}catch(r){if(r&&r.code===4902)await e.request({method:"wallet_addEthereumChain",params:[{chainId:t,chainName:"Arbitrum One",nativeCurrency:{name:"ETH",symbol:"ETH",decimals:18},rpcUrls:["https://arb1.arbitrum.io/rpc"],blockExplorerUrls:["https://arbiscan.io/"]}]});else throw r}if(n=await e.request({method:"eth_chainId"}),(n==null?void 0:n.toLowerCase())!==t.toLowerCase())throw new Error(`Wrong network after switch: active ${parseInt(n,16)} expected ${parseInt(t,16)}.`)}}function G4e(e,t){return fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t||{})}).then(n=>{if(!n.ok)throw new Error(`HTTP ${n.status} on ${e}`);return n.json()})}function K4e(e){if(typeof e=="function")return e();const t=typeof window<"u"?window.localStorage.getItem("hyperAddress"):null,n=typeof window<"u"?window.localStorage.getItem("hyperToken"):null;return{address:t,token:n}}function xX(e){if(typeof window>"u")return null;for(const t of e){const n=window.localStorage.getItem(t);if(n!=null&&n!=="")return n}return null}function vue(e){const t=e&&e.response&&e.response.data&&e.response.data.statuses,n=e&&e.statuses;return Array.isArray(t)?t:Array.isArray(n)?n:[]}function Hdn(e){return vue(e).some(t=>{const n=String(t.status||t.s||"").toLowerCase();return n.includes("placed")||n.includes("resting")})}function Vdn(e){return vue(e).some(n=>{const r=String(n.status||n.s||"").toLowerCase();return r.includes("filled")||r.includes("success")||!!n.filled})}function GP(e){const t=new Set;function n(r){if(!r||typeof r!="object"||t.has(r))return null;if(t.add(r),r.oid!=null&&!Number.isNaN(Number(r.oid)))return Number(r.oid);if(r.o!=null&&!Number.isNaN(Number(r.o)))return Number(r.o);for(const s in r){const a=n(r[s]);if(a!=null)return a}return null}return n(e)}function YN({baseUrl:e="https://api.hyperliquid.xyz",address:t,signer:n,vaultAddress:r=null,dex:s="",defaultSlippage:a=.08,isMainnet:o=!0,signatureChainIdHex:l="0xa4b1",getPK:c=()=>typeof window<"u"?localStorage.getItem("hl_pk"):null,dextraApiBase:u="https://dextrabothypev2.nftinit.io",builderAddress:d="0x49ae63056b3a0be0b166813ee687309ab653c07c",getAuth:f,defaultFromStart:x="website",defaultAppType:g="terminal",defaultLeverage:v=null,getLeverage:w,feeTtlMs:C=12e4}={}){if(!t)throw new Error("address is required for info calls");if(!n||typeof n.sign!="function")throw new Error("signer with sign(action, nonce) is required for exchange actions");let N=null;const P={"Content-Type":"application/json"},I=6,R=o?"Mainnet":"Testnet",F=async(We,at)=>{const mt=e+We,Dt=await fetch(mt,{method:"POST",headers:P,body:JSON.stringify(at)});if(!Dt.ok)throw new Error(`HTTP ${Dt.status} on ${We}`);return Dt.json()},U=(We,at)=>{if(!We||typeof We!="object")return NaN;const mt=String(at||"").trim();if(!mt)return NaN;const Dt=mt.toUpperCase();if(We[mt]!=null){const on=Number(We[mt]);if(Number.isFinite(on))return on}if(We[Dt]!=null){const on=Number(We[Dt]);if(Number.isFinite(on))return on}const Tt=Dt.indexOf("-");if(Tt>0){const on=Dt.slice(0,Tt);if(Dt.slice(Tt+1)==="PERP"&&We[on]!=null){const Nn=Number(We[on]);if(Number.isFinite(Nn))return Nn}}const dn=Object.keys(We).find(on=>String(on).toUpperCase()===Dt);if(dn){const on=Number(We[dn]);if(Number.isFinite(on))return on}return NaN},L={allMids:async()=>F("/info",{type:"allMids",dex:s}),openOrders:async(We=t)=>F("/info",{type:"openOrders",user:We,dex:s}),frontendOpenOrders:async(We=t)=>F("/info",{type:"frontendOpenOrders",user:We,dex:s}),clearinghouseState:async(We=t)=>F("/info",{type:"clearinghouseState",user:We,dex:s}),meta:async()=>{if(N)return N;const We=await F("/info",{type:"allPerpMetas"});return N=We,We},metaAndAssetCtxs:async()=>F("/info",{type:"metaAndAssetCtxs",dex:s}),twapHistory:async(We=t)=>F("/info",{type:"twapHistory",user:We,dex:s}),userTwapSliceFills:async(We=t)=>F("/info",{type:"userTwapSliceFills",user:We,dex:s}),userTwapSliceFillsByTime:async({user:We=t,startTime:at,endTime:mt,aggregateByTime:Dt}={})=>{const Tt={type:"userTwapSliceFillsByTime",user:We,startTime:at,dex:s};return mt!=null&&(Tt.endTime=mt),Dt!=null&&(Tt.aggregateByTime=!!Dt),F("/info",Tt)}};async function z(We){const at=await Q(),mt=String(We).toUpperCase();for(let Dt=0;Dt<at.length;Dt++){const Tt=at[Dt];if(Array.isArray(Tt.universe)){const dn=Tt.universe.findIndex(on=>on.name.toUpperCase()===mt);if(dn!==-1){let on;return Dt===0?on=dn:on=1e5+Dt*1e4+dn,{entry:Tt.universe[dn],index:on,block:Tt}}}}throw new Error(`Unknown perp symbol: ${We}`)}const Q=async()=>{if(N)return N;const We=await L.meta();return N=We,We},ne=async We=>(await z(We)).index,J=async We=>(await z(We)).entry.szDecimals,X=We=>{const[at,mt=""]=String(We).split(".");if(!mt)return at;const Dt=mt.replace(/0+$/,"");return Dt.length?`${at}.${Dt}`:at},re=async(We,at)=>{const mt=await J(We),Dt=Math.max(0,I-Number(mt)),Tt=Math.abs(Number(at));if(!(Tt>0)||!Number.isFinite(Tt))return Dt;const dn=Tt>=1?Math.floor(Math.log10(Tt))+1:0,on=Math.max(0,5-dn);return Math.min(Dt,on)},pe=async(We,at)=>{const mt=await re(We,at);return Number((1/10**mt).toFixed(mt))},Y=async(We,at,mt)=>{const Dt=await re(We,at),Tt=10**-Dt,dn=Number(at),on=mt?Math.floor(dn/Tt)*Tt:Math.ceil(dn/Tt)*Tt;return X(Number(on).toFixed(Dt))},ie=async(We,at)=>{if(at==null||!Number.isFinite(Number(at)))throw new Error("price required");const mt=await re(We,at),Dt=Number(at),Tt=mt===0?Math.round(Dt):Math.round(Dt*10**mt)/10**mt;return X(Tt.toFixed(mt))},oe=async(We,at)=>{if(at==null||!Number.isFinite(Number(at)))throw new Error("size required");const mt=await J(We);return X(Number(at).toFixed(Number(mt)))},G=async(We,at,mt,Dt=a)=>{let Tt=mt;if(Tt==null){let on=U(nre,We);if(!Number.isFinite(on)){const gn=await L.allMids();on=U(gn,We)}if(Tt=on,!Number.isFinite(Tt))throw new Error(`Mid price not available for ${We}`)}const dn=at?Tt*(1+Dt):Tt*(1-Dt);return Y(We,dn,at)},V=new Set(["usdSend","spotSend","usdClassTransfer","withdraw3","cDeposit","cWithdraw","approveBuilderFee"]),ee=()=>({name:"HyperliquidSignTransaction",version:"1",chainId:parseInt(l,16),verifyingContract:"0x0000000000000000000000000000000000000000"}),ae=(We,at)=>{switch(We.type){case"usdSend":return{primaryType:"HyperliquidTransaction:UsdSend",types:{"HyperliquidTransaction:UsdSend":[{name:"hyperliquidChain",type:"string"},{name:"destination",type:"string"},{name:"amount",type:"string"},{name:"time",type:"uint64"}]},message:{hyperliquidChain:R,destination:String(We.destination).toLowerCase(),amount:String(We.amount),time:at}};case"spotSend":return{primaryType:"HyperliquidTransaction:SpotSend",types:{"HyperliquidTransaction:SpotSend":[{name:"hyperliquidChain",type:"string"},{name:"destination",type:"string"},{name:"token",type:"string"},{name:"amount",type:"string"},{name:"time",type:"uint64"}]},message:{hyperliquidChain:R,destination:String(We.destination).toLowerCase(),token:We.token,amount:String(We.amount),time:at}};case"usdClassTransfer":return{primaryType:"HyperliquidTransaction:UsdClassTransfer",types:{"HyperliquidTransaction:UsdClassTransfer":[{name:"hyperliquidChain",type:"string"},{name:"amount",type:"string"},{name:"toPerp",type:"bool"},{name:"nonce",type:"uint64"}]},message:{hyperliquidChain:R,amount:String(We.amount),toPerp:!!We.toPerp,nonce:at}};case"withdraw3":return{primaryType:"HyperliquidTransaction:Withdraw",types:{"HyperliquidTransaction:Withdraw":[{name:"hyperliquidChain",type:"string"},{name:"destination",type:"string"},{name:"amount",type:"string"},{name:"time",type:"uint64"}]},message:{hyperliquidChain:R,destination:String(We.destination).toLowerCase(),amount:String(We.amount),time:at}};case"cDeposit":return{primaryType:"HyperliquidTransaction:CDeposit",types:{"HyperliquidTransaction:CDeposit":[{name:"hyperliquidChain",type:"string"},{name:"wei",type:"string"},{name:"nonce",type:"uint64"}]},message:{hyperliquidChain:R,wei:String(We.wei),nonce:at}};case"cWithdraw":return{primaryType:"HyperliquidTransaction:CWithdraw",types:{"HyperliquidTransaction:CWithdraw":[{name:"hyperliquidChain",type:"string"},{name:"wei",type:"string"},{name:"nonce",type:"uint64"}]},message:{hyperliquidChain:R,wei:String(We.wei),nonce:at}};case"approveBuilderFee":return{primaryType:"HyperliquidTransaction:ApproveBuilderFee",types:{"HyperliquidTransaction:ApproveBuilderFee":[{name:"hyperliquidChain",type:"string"},{name:"maxFeeRate",type:"string"},{name:"builder",type:"address"},{name:"nonce",type:"uint64"}]},message:{hyperliquidChain:R,maxFeeRate:We.maxFeeRate.endsWith("%")?We.maxFeeRate:`${We.maxFeeRate}%`,builder:We.builder.toLowerCase(),nonce:at}};default:return null}},fe=We=>{const at=nu.from(We),mt=at.v>=27?at.v:at.v+27;return{r:at.r,s:at.s,v:mt}},Ne=async(We,at)=>{const mt=ae(We,at);if(!mt)throw new Error("Unsupported typed action");const Dt=ee(),Tt=Object.assign({},mt.types,{EIP712Domain:[{name:"name",type:"string"},{name:"version",type:"string"},{name:"chainId",type:"uint256"},{name:"verifyingContract",type:"address"}]}),dn=(c()||"").trim();if(dn){const Nn=await new kae(dn).signTypedData(Dt,mt.types,mt.message);return fe(Nn)}const on=$dn();if(on){await zdn(on,l);let gn=await on.request({method:"eth_accounts"});(!gn||!gn.length)&&(gn=await on.request({method:"eth_requestAccounts"}));const Nn=gn[0];if(!Nn)throw new Error("No connected account in wallet");if(String(Nn).toLowerCase()!==String(t).toLowerCase())throw new Error(`Connected wallet ${Nn} does not match HL address ${t}.`);const kn={domain:Dt,types:Tt,primaryType:mt.primaryType,message:mt.message},yn=await on.request({method:"eth_signTypedData_v4",params:[Nn,JSON.stringify(kn)]});return fe(yn)}throw new Error("No signer for typed action")};let he={ts:0,fee:null};async function ge(We=!1){const at=Date.now();if(!We&&he.fee!=null&&at-he.ts<C)return{builder_fee:he.fee};const{address:mt,token:Dt}=K4e(f);if(!mt||!Dt)return{builder_fee:null};const Tt=u+"/api/subscriber/check_account/",dn=await G4e(Tt,{address:mt,token:Dt}),on=(dn==null?void 0:dn.builder_fee)!=null?Number(dn.builder_fee):null;return he={ts:at,fee:on},{builder_fee:on}}async function ye(We){if(We.type!=="order")return We;const{builder_fee:at}=await ge();return at==null?We:{...We,builder:{b:d,f:Number(at)}}}function ve(We){return We!=null&&We.fromStart?We.fromStart:xX(["dextra_from_start","from_start"])||x||null}function je(We){return We!=null&&We.appType?We.appType:xX(["dextra_app_type","app_type"])||g||null}async function Ie(We,at){if((at==null?void 0:at.leverage)!=null)return Number(at.leverage);if(typeof w=="function"){const Dt=await w(We);if(Dt!=null)return Number(Dt)}const mt=xX([`leverage:${We}`,`${We}_leverage`,"dextra_leverage","hl_leverage","leverage"])||v;return mt!=null?Number(mt):null}async function Le(We){const at=await L.clearinghouseState(t),mt=((at==null?void 0:at.assetPositions)||[]).find(Tt=>{var dn,on;return((on=(dn=Tt==null?void 0:Tt.position)==null?void 0:dn.coin)==null?void 0:on.toUpperCase())===String(We).toUpperCase()});if(!mt)return null;const Dt=Number(mt.position.szi||0);return{side:Dt>=0?"long":"short",size:Math.abs(Dt)}}async function Qe({symbol:We,isBuy:at,usePosSide:mt,size:Dt,price:Tt,telemetry:dn,oid:on}){var Cn;if(!on&&on!==0)return;const{address:gn,token:Nn}=K4e(f);if(!gn||!Nn)return;const kn=typeof window<"u"?window.localStorage.getItem("hl:wallet_id"):null,yn=We?await Ie(We,dn):null,Vn=mt&&((Cn=await Le(We))==null?void 0:Cn.side)||(at?"long":"short"),{builder_fee:Gn}=await ge(),Dn={address:gn,token:Nn,order_params:{coin:String(We),wallet_id:kn!=null?Number(kn):null,leverage:yn!=null?Number(yn):null,size:Dt!=null?Number(Dt):null,from_start:ve(dn),app_type:je(dn),price:Tt!=null?Number(Tt):null,fee_amount:Gn!=null?Number(Gn):null,side:String(Vn),oid:Number(on)}},Kn=u+"/api/hyper/order_save/";try{await G4e(Kn,Dn)}catch{}}async function $e(We,at){const mt=at??Date.now(),Dt=We.type==="order"?await ye(We):We,Tt=V.has(Dt.type)?await Ne(Dt,mt):await n.sign(Dt,mt),dn={action:Dt,nonce:mt,signature:Tt,...r?{vaultAddress:r}:{}};return F("/exchange",dn)}async function it(We,at){var on;const mt=await $e(We),Dt=vue(mt),Tt=Vdn(mt)||Hdn(mt)||(mt==null?void 0:mt.status)==="ok"||((on=mt==null?void 0:mt.response)==null?void 0:on.status)==="ok";let dn=null;return Tt&&(Bdn(),dn=GP(mt),dn==null&&Dt&&Dt.length&&(dn=GP(Dt))),await Qe({symbol:at.symbol,isBuy:at.isBuy,usePosSide:!!at.usePosSide,size:at.size,price:at.price,telemetry:at.telemetry,oid:dn}),mt}const tt=async({symbol:We,isBuy:at,size:mt,price:Dt,tif:Tt="Gtc",reduceOnly:dn=!1,cloid:on,builder:gn,telemetry:Nn}={})=>{const kn=await ne(We),yn=await oe(We,mt),Vn=await Y(We,Dt,!!at),Dn={type:"order",orders:[{a:kn,b:!!at,p:Vn,s:yn,r:!!dn,t:{limit:{tif:Tt}},...on?{c:on}:{}}],grouping:"na",...gn?{builder:gn}:{}};return it(Dn,{symbol:We,isBuy:at,size:yn,price:Vn,telemetry:Nn,usePosSide:!1})},lt=async({symbol:We,isBuy:at,size:mt,price:Dt,tif:Tt="Gtc",reduceOnly:dn=!1,tpPrice:on=null,slPrice:gn=null,triggerSlippage:Nn=.08,cloid:kn,builder:yn,telemetry:Vn}={})=>{const Gn=await ne(We),Dn=await oe(We,mt),Kn=[],Cn=await Y(We,Dt,!!at);Kn.push({a:Gn,b:!!at,p:Cn,s:Dn,r:!!dn,t:{limit:{tif:Tt}},...kn?{c:kn}:{}});const sn=!at;if(gn!=null&&gn!==""&&Number(gn)>0){const en=await ie(We,gn),an=await G(We,sn,Number(en),Nn);Kn.push({a:Gn,b:sn,p:an,s:Dn,r:!0,t:{trigger:{isMarket:!0,triggerPx:en,tpsl:"sl"}}})}if(on!=null&&on!==""&&Number(on)>0){const en=await ie(We,on),an=await G(We,sn,Number(en),Nn);Kn.push({a:Gn,b:sn,p:an,s:Dn,r:!0,t:{trigger:{isMarket:!0,triggerPx:en,tpsl:"tp"}}})}const Me={type:"order",orders:Kn,grouping:Kn.length>1?"normalTpsl":"na",...yn?{builder:yn}:{}};return it(Me,{symbol:We,isBuy:at,size:Dn,price:Cn,telemetry:Vn,usePosSide:!1})},ft=async({symbol:We,tpPrice:at=null,slPrice:mt=null,size:Dt=null,useLimitPx:Tt=!1,triggerSlippage:dn=.1,telemetry:on}={})=>{const gn=await Le(We);if(!gn)throw new Error(`No open position for ${We}`);const Nn=await ne(We),kn=await oe(We,Dt??gn.size),yn=gn.side==="short",Vn=[];let Gn=null;if(mt!=null&&Number(mt)>0){const Kn=await ie(We,mt),Cn=Tt?Kn:await G(We,yn,Number(Kn),dn);Vn.push({a:Nn,b:yn,p:Cn,s:kn,r:!0,t:{trigger:{isMarket:!Tt,triggerPx:Kn,tpsl:"sl"}}}),Gn=Gn??Kn}if(at!=null&&Number(at)>0){const Kn=await ie(We,at),Cn=Tt?Kn:await G(We,yn,Number(Kn),dn);Vn.push({a:Nn,b:yn,p:Cn,s:kn,r:!0,t:{trigger:{isMarket:!Tt,triggerPx:Kn,tpsl:"tp"}}}),Gn=Gn??Kn}if(!Vn.length)throw new Error("TP/SL price required");return it({type:"order",orders:Vn,grouping:"normalTpsl"},{symbol:We,isBuy:yn,size:kn,price:Gn??0,telemetry:on,usePosSide:!0})},ut=async(We={})=>(await Ke({filter:"tpsl",symbol:We.symbol}),ft(We)),qt=async(We,at,mt,{price:Dt,slippage:Tt=a,cloid:dn,tif:on="Ioc",reduceOnly:gn=!1,builder:Nn,telemetry:kn}={})=>{const yn=await G(We,at,Dt,Tt);return tt({symbol:We,isBuy:at,size:mt,price:yn,tif:"FrontendMarket",reduceOnly:gn,cloid:dn,builder:Nn,telemetry:kn})},It=async(We,at,{price:mt,slippage:Dt=a,cloid:Tt,tif:dn="Ioc",reduceOnly:on=!0,builder:gn,telemetry:Nn}={})=>{let kn,yn=at;if(yn==null){const sn=await L.clearinghouseState(t),Me=((sn==null?void 0:sn.assetPositions)||[]).find(an=>{var Nt,Yn;return((Yn=(Nt=an==null?void 0:an.position)==null?void 0:Nt.coin)==null?void 0:Yn.toUpperCase())===String(We).toUpperCase()});if(!Me)throw new Error(`No position found for ${We}`);const en=parseFloat(Me.position.szi);if(!en)throw new Error(`No open size on ${We}`);yn=Math.abs(en),kn=en<0}else try{const sn=await L.clearinghouseState(t),Me=((sn==null?void 0:sn.assetPositions)||[]).find(an=>{var Nt,Yn;return((Yn=(Nt=an==null?void 0:an.position)==null?void 0:Nt.coin)==null?void 0:Yn.toUpperCase())===String(We).toUpperCase()});kn=(Me?parseFloat(Me.position.szi):0)<0}catch{kn=!1}const Vn=await G(We,kn,mt,Dt),Gn=await ne(We),Dn=await oe(We,yn),Cn={type:"order",orders:[{a:Gn,b:kn,p:Vn,s:Dn,r:!0,t:{limit:{tif:"FrontendMarket"}},...Tt?{c:Tt}:{}}],grouping:"na",...gn?{builder:gn}:{}};return it(Cn,{symbol:We,isBuy:kn,size:Dn,price:Vn,telemetry:Nn,usePosSide:!0})},nn=async We=>{const at=await L.openOrders(t),mt=We?at.filter(on=>on.coin.toUpperCase()===String(We).toUpperCase()):at;if(!mt.length)return{status:"ok",response:{type:"cancel",data:{count:0}}};const Dt=new Map;for(const on of mt)Dt.has(on.coin)||Dt.set(on.coin,await ne(on.coin));const dn={type:"cancel",cancels:mt.map(on=>({a:Dt.get(on.coin),o:Number(on.oid)}))};return $e(dn)},jt=async We=>{const at=We==null?{type:"scheduleCancel"}:{type:"scheduleCancel",time:Date.now()+Math.max(5e3,Number(We))};return $e(at)},cn=async({symbol:We,isBuy:at,size:mt,minutes:Dt,randomize:Tt=!1,reduceOnly:dn=!1}={})=>{var Gn,Dn,Kn,Cn,sn,Me,en,an;const on=await ne(We),gn=await oe(We,mt),kn={type:"twapOrder",twap:{a:on,b:!!at,s:gn,r:!!dn,m:Number(Dt),t:!!Tt}},yn=await $e(kn),Vn=((Kn=(Dn=(Gn=yn==null?void 0:yn.response)==null?void 0:Gn.data)==null?void 0:Dn.status)==null?void 0:Kn.error)||((sn=(Cn=yn==null?void 0:yn.response)==null?void 0:Cn.data)==null?void 0:sn.error)||((en=(Me=yn==null?void 0:yn.data)==null?void 0:Me.status)==null?void 0:en.error)||((an=yn==null?void 0:yn.data)==null?void 0:an.error);if(Vn)throw new Error(Vn);return yn},un=async({symbol:We,twapId:at}={})=>{const Dt={type:"twapCancel",a:await ne(We),t:Number(at)};return $e(Dt)},Ft=async({symbol:We,oid:at,cloid:mt}={})=>{const Dt=await ne(We);if(at!=null&&/^\d+$/.test(String(at)))return $e({type:"cancel",cancels:[{a:Dt,o:Number(at)}]});if(mt)return $e({type:"cancelByCloid",cancels:[{asset:Dt,cloid:String(mt)}]});throw new Error("cancelOrder requires a numeric oid or a cloid")},Ke=async({filter:We="all",symbol:at=null}={})=>{const mt=await L.openOrders(t),Dt=Array.isArray(mt)?mt:[],Tt=kn=>{const yn=String(kn.orderType||kn.type||"").toLowerCase();return We==="all"?!0:We==="limit"?yn==="limit":We==="tpsl"?yn.includes("take profit")||yn.includes("stop"):We==="reduceOnly"?!!kn.reduceOnly:We==="nonReduce"?!kn.reduceOnly:!1},dn=Dt.filter(kn=>(!at||String(kn.coin).toUpperCase()===String(at).toUpperCase())&&Tt(kn));if(!dn.length)return{ok:!0,count:0};const on=new Map,gn=[];for(const kn of dn){let yn=on.get(kn.coin);yn||(yn=await ne(kn.coin),on.set(kn.coin,yn)),gn.push({a:yn,o:Number(kn.oid)})}return $e({type:"cancel",cancels:gn})},Bt=async()=>{const We=await L.clearinghouseState(t),mt=(Array.isArray(We==null?void 0:We.assetPositions)?We.assetPositions:[]).map(Dt=>Dt==null?void 0:Dt.position).filter(Dt=>Math.abs(Number((Dt==null?void 0:Dt.szi)||0))>0);for(const Dt of mt){const Tt=Dt.coin,dn=Math.abs(Number(Dt.szi));await It(Tt,dn,{tif:"FrontendMarket",reduceOnly:!0})}return!0},$t={usdTransfer:async(We,at)=>{const mt=Date.now(),Dt={type:"usdSend",hyperliquidChain:R,signatureChainId:l,destination:String(We).toLowerCase(),amount:String(at),time:mt};return $e(Dt)},spotTransfer:async(We,at,mt)=>{const Dt=Date.now(),Tt={type:"spotSend",hyperliquidChain:R,signatureChainId:l,destination:String(We).toLowerCase(),token:at,amount:String(mt),time:Dt};return $e(Tt)},usdClassTransfer:async(We,at)=>{const mt=Date.now(),Dt={type:"usdClassTransfer",hyperliquidChain:R,signatureChainId:l,amount:String(We),toPerp:!!at,nonce:mt};return $e(Dt,mt)},withdraw:async(We,at)=>{const mt=Date.now(),Dt={type:"withdraw3",hyperliquidChain:R,signatureChainId:l,destination:String(We).toLowerCase(),amount:String(at),time:mt};return $e(Dt,mt)},cDeposit:async We=>{const at=Date.now(),mt={type:"cDeposit",hyperliquidChain:R,signatureChainId:l,wei:String(We),nonce:at};return $e(mt,at)},cWithdraw:async We=>{const at=Date.now(),mt={type:"cWithdraw",hyperliquidChain:R,signatureChainId:l,wei:String(We),nonce:at};return $e(mt,at)},approveBuilderFee:async({builder:We,maxFeeRate:at})=>{const mt=Date.now(),Dt={type:"approveBuilderFee",hyperliquidChain:R,signatureChainId:l,builder:String(We).toLowerCase(),maxFeeRate:String(at),nonce:mt};return $e(Dt,mt)}},qe=(()=>{const We="hl:pairs",at=()=>{try{return JSON.parse(localStorage.getItem(We)||"[]")}catch{return[]}},mt=gn=>{try{localStorage.setItem(We,JSON.stringify(gn))}catch{}};return{read:at,write:mt,get:gn=>at().find(Nn=>Nn.id===gn)||null,add:gn=>{const Nn=at();Nn.push(gn),mt(Nn)},upsert:gn=>{const Nn=at().filter(kn=>kn.id!==gn.id);Nn.push(gn),mt(Nn)},remove:gn=>mt(at().filter(Nn=>Nn.id!==gn))}})(),Ye=(We="PAIR")=>`${We}-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`;async function ht(We,at,mt,Dt,Tt){const dn=[{symbol:at.symbol,side:"long",size:Number(at.size),oid:GP(Dt)??null},{symbol:mt.symbol,side:"short",size:Number(mt.size),oid:GP(Tt)??null}];return qe.add({id:We,createdAt:Date.now(),legs:dn}),{pairId:We,long:{oid:dn[0].oid},short:{oid:dn[1].oid}}}const Zt=async({long:We,short:at,entrySlippage:mt=a,triggerSlippage:Dt=.1,telemetry:Tt,pairId:dn}={})=>{if(!(We!=null&&We.symbol)||!(at!=null&&at.symbol))throw new Error("pair requires long.symbol and short.symbol");if(!(Number(We.size)>0)||!(Number(at.size)>0))throw new Error("pair sizes must be > 0");const on=dn||Ye(),[gn,Nn]=await Promise.all([placeMarketWithTPSL({symbol:We.symbol,isBuy:!0,size:Number(We.size),entrySlippage:mt,tpPrice:We.tpPrice??null,slPrice:We.slPrice??null,triggerSlippage:Dt,telemetry:Tt,cloid:`${on}:L`}),placeMarketWithTPSL({symbol:at.symbol,isBuy:!1,size:Number(at.size),entrySlippage:mt,tpPrice:at.tpPrice??null,slPrice:at.slPrice??null,triggerSlippage:Dt,telemetry:Tt,cloid:`${on}:S`})]);return ht(on,We,at,gn,Nn)},zt=async({long:We,short:at,triggerSlippage:mt=a,telemetry:Dt,pairId:Tt}={})=>{if(!(We!=null&&We.symbol)||!(at!=null&&at.symbol))throw new Error("pair requires long.symbol and short.symbol");const dn=Tt||Ye(),[on,gn]=await Promise.all([We.tpPrice||We.slPrice?lt({symbol:We.symbol,isBuy:!0,size:Number(We.size),price:Number(We.price),tif:String(We.tif||"Gtc"),reduceOnly:!!We.reduceOnly,tpPrice:We.tpPrice??null,slPrice:We.slPrice??null,triggerSlippage:mt,telemetry:Dt,cloid:`${dn}:L`}):tt({symbol:We.symbol,isBuy:!0,size:Number(We.size),price:Number(We.price),tif:String(We.tif||"Gtc"),reduceOnly:!!We.reduceOnly,telemetry:Dt,cloid:`${dn}:L`}),at.tpPrice||at.slPrice?lt({symbol:at.symbol,isBuy:!1,size:Number(at.size),price:Number(at.price),tif:String(at.tif||"Gtc"),reduceOnly:!!at.reduceOnly,tpPrice:at.tpPrice??null,slPrice:at.slPrice??null,triggerSlippage:mt,telemetry:Dt,cloid:`${dn}:S`}):tt({symbol:at.symbol,isBuy:!1,size:Number(at.size),price:Number(at.price),tif:String(at.tif||"Gtc"),reduceOnly:!!at.reduceOnly,telemetry:Dt,cloid:`${dn}:S`})]);return ht(dn,We,at,on,gn)},Et=async({long:We,short:at,telemetry:mt,pairId:Dt}={})=>{if(!(We!=null&&We.symbol)||!(at!=null&&at.symbol))throw new Error("pair requires long.symbol and short.symbol");const Tt=Dt||Ye(),[dn,on]=await Promise.all([cn({symbol:We.symbol,isBuy:!0,size:Number(We.size),minutes:Number(We.minutes),randomize:!!We.randomize,reduceOnly:!!We.reduceOnly}),cn({symbol:at.symbol,isBuy:!1,size:Number(at.size),minutes:Number(at.minutes),randomize:!!at.randomize,reduceOnly:!!at.reduceOnly})]);return ht(Tt,We,at,dn,on)};async function nt(We){var Tt;const at=await L.clearinghouseState(t),mt=((at==null?void 0:at.assetPositions)||[]).find(dn=>{var on,gn;return((gn=(on=dn==null?void 0:dn.position)==null?void 0:on.coin)==null?void 0:gn.toUpperCase())===String(We).toUpperCase()}),Dt=Number(((Tt=mt==null?void 0:mt.position)==null?void 0:Tt.szi)||0);return{size:Math.abs(Dt),side:Dt>=0?"long":"short"}}return{updateLeverage:async(We,at,mt)=>{var gn,Nn,kn,yn,Vn,Gn,Dn,Kn;const Tt={type:"updateLeverage",asset:await ne(We),isCross:String(at||"").toLowerCase()==="cross",leverage:Number(mt)},dn=await $e(Tt),on=((kn=(Nn=(gn=dn==null?void 0:dn.response)==null?void 0:gn.data)==null?void 0:Nn.status)==null?void 0:kn.error)||((Vn=(yn=dn==null?void 0:dn.response)==null?void 0:yn.data)==null?void 0:Vn.error)||((Dn=(Gn=dn==null?void 0:dn.data)==null?void 0:Gn.status)==null?void 0:Dn.error)||((Kn=dn==null?void 0:dn.data)==null?void 0:Kn.error)||((dn==null?void 0:dn.status)==="err"?dn==null?void 0:dn.response:null);if(on)throw new Error(String(on));return dn},placeOrder:tt,placeLimitWithTPSL:lt,placeTPSLForPosition:ft,replaceTPSLForPosition:ut,cancelAllOrders:nn,scheduleCancel:jt,marketOpen:qt,marketClose:It,placeMarketWithTPSL:async We=>{const at=await G(We.symbol,We.isBuy,null,We.entrySlippage??a);return lt({...We,price:Number(at),tif:"FrontendMarket"})},placeTwapOrder:cn,cancelTwapOrder:un,cancelOrder:Ft,cancelOrdersFiltered:Ke,closeAllPositions:Bt,marketOpenPair:Zt,limitOpenPair:zt,twapOpenPair:Et,marketClosePair:async({pairId:We,slippage:at=a,fraction:mt=1,telemetry:Dt}={})=>{const Tt=qe.get(We);if(!Tt)throw new Error("Unknown pairId");const[dn]=Tt.legs.filter(Cn=>Cn.side==="long"),[on]=Tt.legs.filter(Cn=>Cn.side==="short");if(!dn||!on)throw new Error("Pair legs corrupted");const[gn,Nn]=await Promise.all([nt(dn.symbol),nt(on.symbol)]),kn=Math.max(0,Math.min(gn.size,dn.size)*Number(mt||1)),yn=Math.max(0,Math.min(Nn.size,on.size)*Number(mt||1)),Vn=[];if(kn>0&&Vn.push(It(dn.symbol,kn,{slippage:at,reduceOnly:!0,telemetry:Dt,cloid:`${We}:L:CLOSE`})),yn>0&&Vn.push(It(on.symbol,yn,{slippage:at,reduceOnly:!0,telemetry:Dt,cloid:`${We}:S:CLOSE`})),!Vn.length)return{pairId:We,message:"Nothing to close"};const Gn=await Promise.all(Vn),[Dn,Kn]=await Promise.all([nt(dn.symbol),nt(on.symbol)]);return Dn.size===0&&Kn.size===0&&qe.remove(We),{pairId:We,results:Gn}},pairs:{list:()=>qe.read(),get:We=>qe.get(We),remove:We=>qe.remove(We)},info:L,transfers:$t,utils:{getPerpAssetId:ne,getSzDecimals:J,toPxString:ie,toSzString:oe,withSlippagePx:G,trimZeros:X,getPxDecimalsAt:re,getTickSize:pe,quantizePx:Y}}}const rre="https://api.hyperliquid.xyz/info",Wdn="wss://api.hyperliquid.xyz/ws";function qdn(e){const t=String(e||""),n=t.indexOf(":");if(n>=0){const r=t.slice(0,n),s=t.slice(n+1);return{builder:r,symbol:s+(r==="xyz"?"-USDC":"-USDH")}}return{builder:null,symbol:t}}const Vd={rows:[],subs:new Set,started:!1,ws:null,timer:null};function vHe(){for(const e of Vd.subs)try{e(Vd.rows)}catch{}}async function Gdn(){const t=await(await fetch(rre,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({type:"metaAndAssetCtxs"})})).json(),n=Array.isArray(t)?t[0]:t.meta||t||{},r=Array.isArray(t)?t[1]:t.assetCtxs||[];return(n&&n.universe?n.universe:[]).map((o,l)=>{const c=r&&r[l]||{},u=o.name,d=Number(c.markPx??c.midPx??0),f=Number(c.prevDayPx??0);return{kind:"perp",dex:"",builder:"",rawSymbol:u,coin:u,symbol:`${u}-USD`,last:d,prevDayPx:f,chg24:f?(d-f)/f*100:0,vol:Number(c.dayNtlVlm??0),funding:Number(c.funding??0),leverage:o.maxLeverage??null,openInterest:Number(c.openInterest??0)}})}async function Kdn(){try{const t=await(await fetch(rre,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({type:"perpDexs"})})).json();let n=[];Array.isArray(t)?n=t:Array.isArray(t.dexs)&&(n=t.dexs);const r=n.map(a=>a?typeof a=="string"?a:typeof a=="object"&&a.name?a.name:null:null).filter(a=>{if(!a)return!1;const o=String(a),l=o.toLowerCase();return!(o==="HL"||l==="vntl"||l==="flx")}),s=[];for(const a of r)try{const l=await(await fetch(rre,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({type:"metaAndAssetCtxs",dex:a})})).json(),c=Array.isArray(l)?l[0]:l.meta||l||{},u=Array.isArray(l)?l[1]:l.assetCtxs||[],d=c&&c.universe?c.universe:[];for(let f=0;f<d.length;f++){const x=d[f],g=u[f]||{},v=qdn(x.name),w=Number(g.markPx??g.midPx??0),C=Number(g.prevDayPx??0);s.push({kind:"hip3",dex:a,builder:v.builder||a,rawSymbol:x.name,coin:v.symbol,symbol:v.symbol,last:w,prevDayPx:C,chg24:C?(w-C)/C*100:0,vol:Number(g.dayNtlVlm??0),funding:Number(g.funding??0),leverage:x.maxLeverage??null,openInterest:Number(g.openInterest??0)})}}catch{}return s}catch{return[]}}async function Y4e(){try{const[e,t]=await Promise.all([Gdn(),Kdn()]);Vd.rows=[...e,...t],vHe()}catch{}}function Ydn(){if(!Vd.started){Vd.started=!0,Y4e(),Vd.timer=setInterval(Y4e,6e4);try{const e=new WebSocket(Wdn);Vd.ws=e,e.onopen=()=>{try{e.send(JSON.stringify({method:"subscribe",subscription:{type:"allMids",dex:"ALL_DEXS"}}))}catch{}},e.onmessage=t=>{let n;try{n=JSON.parse(t.data||"{}")}catch{return}if(n.channel!=="allMids")return;const r=n.data&&n.data.mids||{};Udn(r);const s=Vd.rows.map(a=>{const o=a.rawSymbol||a.symbol||a.coin,c=String(o).replace(/^[a-z0-9]+:/i,""),u=a.coin,d=a.symbol,f=o,x=r[c]??r[u]??r[d]??r[f]??null;if(x==null)return a;const g=Number(x),v=a.prevDayPx?(g-a.prevDayPx)/a.prevDayPx*100:a.chg24||0;return{...a,last:g,chg24:v}});Vd.rows=s,vHe()},e.onclose=()=>{Vd.ws=null}}catch{}}}function gU(){const[e,t]=m.useState(Vd.rows);return m.useEffect(()=>{Ydn(),t(Vd.rows);const n=r=>{t(r)};return Vd.subs.add(n),()=>{Vd.subs.delete(n)}},[]),e}const gX=({children:e,text:t})=>{const[n,r]=m.useState({x:0,y:0}),[s,a]=m.useState(!1);return i.jsxs("div",{className:"relative inline-block",onMouseMove:o=>{const l=o.currentTarget.getBoundingClientRect();r({x:o.clientX-l.left,y:o.clientY-l.top})},onMouseEnter:()=>a(!0),onMouseLeave:()=>a(!1),children:[i.jsx("span",{className:"underline decoration-dotted underline-offset-2 cursor-help",children:e}),i.jsx(xT,{children:s&&i.jsx(vo.div,{className:"absolute z-50 px-3 py-2 text-xs text-white bg-black rounded-md pointer-events-none shadow-lg w-72",style:{top:n.y+18,left:n.x+18},initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.9},transition:{type:"spring",stiffness:300,damping:25},children:t})})]})},Xdn=({coin:e,onCoinChange:t,headerData:n,setIsDigits:r,mode:s="single",pairKey:a="BTC/ETH",onPairChange:o=()=>{},markets:l=[],market:c="hyperliquid"})=>{const u=(n==null?void 0:n.nextFundingTime)??(n==null?void 0:n.nextFundingRate),[d,f]=m.useState(L(u)),[x,g]=m.useState((n==null?void 0:n.markPx)||0),[v,w]=m.useState("text-white"),[C,N]=m.useState({last:null,mark:null,oracle:null}),P=m.useRef((n==null?void 0:n.markPx)||0),I=gU(),R=l.length?l:I,F=c==="hyperliquid"&&s==="pair",U={kBONK:"BONK",kPEPE:"PEPE",kSHIB:"SHIB",kFLOKI:"FLOKI",kNEIRO:"NEIRO",kDOGS:"DOGS",kLUNC:"LUNC"};m.useEffect(()=>{if(!F&&(n==null?void 0:n.markPx)!=null){const fe=n.markPx.toString(),Ne=fe.includes(".")?fe.split(".")[1].length:0;r(Ne)}},[F,n==null?void 0:n.markPx]),m.useEffect(()=>{if(!F)return;let fe=!1;const Ne=async()=>{var he;try{const ye=await(await fetch("https://api-ui.hyperliquid.xyz/info",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"allMids"})})).json(),ve=((he=ye==null?void 0:ye.data)==null?void 0:he.universe)||[],[je,Ie]=String(a).split("/"),Le=ve.find(ft=>(ft==null?void 0:ft.name)===je),Qe=ve.find(ft=>(ft==null?void 0:ft.name)===Ie),$e=Number((Le==null?void 0:Le.markPx)||0),it=Number((Qe==null?void 0:Qe.markPx)||0),tt=Number((Le==null?void 0:Le.oraclePx)||0),lt=Number((Qe==null?void 0:Qe.oraclePx)||0);if($e>0&&it>0){const ft=$e/it,ut=tt>0&<>0?tt/lt:null;N({last:ft,mark:ft,oracle:ut});const qt=ft.toString().includes(".")?ft.toString().split(".")[1].length:0;r(qt)}}catch{}fe||setTimeout(Ne,1500)};return Ne(),()=>{fe=!0}},[F,a]);function L(fe){const Ne=new Date,he=Ne.getTime(),ge=Number(fe);if(Number.isFinite(ge)&&ge>he){const it=Math.max(0,Math.floor((ge-he)/1e3)),tt=String(Math.floor(it/3600)).padStart(2,"0"),lt=String(Math.floor(it%3600/60)).padStart(2,"0"),ft=String(it%60).padStart(2,"0");return`${tt}:${lt}:${ft}`}Ne.setSeconds(Ne.getSeconds()+1);const ye=Date.UTC(Ne.getUTCFullYear(),Ne.getUTCMonth(),Ne.getUTCDate(),Ne.getUTCHours(),Ne.getUTCMinutes(),Ne.getUTCSeconds()),je=new Date(Date.UTC(Ne.getUTCFullYear(),Ne.getUTCMonth(),Ne.getUTCDate(),Ne.getUTCHours()+1,0,0,0)).getTime()-ye,Ie=Math.floor(je/1e3),Le=String(Math.floor(Ie/3600)).padStart(2,"0"),Qe=String(Math.floor(Ie%3600/60)).padStart(2,"0"),$e=String(Ie%60).padStart(2,"0");return`${Le}:${Qe}:${$e}`}m.useEffect(()=>{f(L(u));const fe=setInterval(()=>f(L(u)),1e3);return()=>clearInterval(fe)},[u]),m.useEffect(()=>{if(F){const fe=C.mark;if(!fe)return;const Ne=P.current;fe>Ne?w("text-[#1DE6A3]"):fe<Ne&&w("text-[#FF7173]"),g(fe);const he=setTimeout(()=>w("text-white"),800);return P.current=fe,()=>clearTimeout(he)}else{if(!(n!=null&&n.markPx))return;const fe=n.markPx,Ne=P.current;fe>Ne?w("text-[#1DE6A3]"):fe<Ne&&w("text-[#FF7173]"),g(fe);const he=setTimeout(()=>w("text-white"),800);return P.current=fe,()=>clearTimeout(he)}},[F,C.mark,n==null?void 0:n.markPx]);const z=()=>i.jsx("div",{className:"flex items-center justify-start w-[76px]",children:i.jsx("div",{className:"w-[76px] max-w-[76px] h-[16px] rounded skeleton-ticker-text short ml-4 mt-1"})}),Q=(n==null?void 0:n.source)==="extended",ne=fe=>{const Ne=Number(fe);if(!Number.isFinite(Ne))return z();const he=Math.abs(Ne);let ge=1;return he>=1e3?ge=1:he>=100?ge=2:he>=1?ge=3:he>=.1?ge=4:ge=6,Ne.toLocaleString(void 0,{maximumFractionDigits:ge})},J=fe=>fe==null||isNaN(fe)?z():fe>=1e3?Ww(fe):fe,X=fe=>{const Ne=Number(fe);if(!Number.isFinite(Ne))return z();const he=Math.abs(Ne),ge=Ne>=0?"+":"-";if(!Q)return`${ge}${he.toFixed(5)}`;let ye=0;he<.1?ye=6:he<1?ye=4:he<10?ye=2:he<100&&(ye=1);const ve=he.toFixed(ye),je=ye>0?ve.replace(/\.?0+$/,""):ve;return`${ge}${je}`},re=Number.isFinite(n==null?void 0:n.markPx)&&Number.isFinite(n==null?void 0:n.prevDayPx)?n.markPx-n.prevDayPx:null,pe=re!=null&&(n!=null&&n.prevDayPx)?re/n.prevDayPx*100:null,Y=re!=null?X(re):null,ie=re==null?"text-white":re>=0?"text-[#1DE6A3]":"text-[#FF7173]",oe=pe==null?"text-white":pe>=0?"text-[#1DE6A3]":"text-[#FF7173]",G=()=>{const[fe,Ne]=String(a).split("/");return i.jsxs("div",{className:"flex -space-x-2 items-center",children:[i.jsx("img",{src:`https://app.hyperliquid.xyz/coins/${fe||""}.svg`||Va,alt:"pair_a",className:"w-8 h-8 min-w-8 min-h-8 rounded-full bg-[#2a2a2a]",loading:"lazy",onError:he=>fm(he)}),i.jsx("img",{src:`https://app.hyperliquid.xyz/coins/${Ne||""}.svg`||Va,alt:"pair_b",className:"w-8 h-8 min-w-8 min-h-8 rounded-full bg-[#2a2a2a] border border-[#0f0f0f]",loading:"lazy",onError:he=>fm(he)})]})},V=F?"pair":"single",ee=F?a:e,ae=F?o:t;return i.jsx("div",{className:"flex justify-between items-center gap-2 md:gap-4 w-full relative",children:i.jsxs("div",{className:"flex justify-between xl:justify-start items-center gap-2 sm:gap-4 w-full sm:w-max",children:[i.jsxs("div",{className:"flex justify-start items-center gap-1.5",children:[i.jsx("div",{className:"flex justify-center items-center",children:F?i.jsx(G,{}):i.jsx("img",{src:`https://app.hyperliquid.xyz/coins/${U[e]||(e==null?void 0:e.split("/")[0])}.svg`||Va,alt:"token_image",className:"w-8 h-8 min-w-8 min-h-8 rounded-full",loading:"lazy",onError:fe=>fm(fe)})}),i.jsx(yue,{markets:R,value:ee,onChange:ae,loading:!R.length,showIcon:!0,mode:V})]}),i.jsx("div",{className:"hidden lg:flex bg-[#101010]",children:F?i.jsx(i.Fragment,{}):i.jsxs(i.Fragment,{children:[i.jsx(dC,{title:i.jsx(gX,{text:"Used for margining, computing unrealized PnL, liquidations and triggering TP/SL orders.",children:"Mark"}),widthValue:"70px",info:Q?ne(x):J(x),color_1:v}),i.jsx(dC,{title:i.jsx(gX,{text:"Median price from external sources reported by validators; used to calculate funding rates.",children:"Oracle"}),widthValue:"80px",info:Q?ne(n==null?void 0:n.oraclePx):J(n==null?void 0:n.oraclePx),color_1:"text-white"}),i.jsx(dC,{title:"24h Change",widthValue:"120px",info:Y??z(),info_2:pe,color_1:ie,color_2:oe}),i.jsx(dC,{title:"24h Volume",widthValue:"130px",info:n!=null&&n.dayNtlVlm?`$${Er(parseFloat(n==null?void 0:n.dayNtlVlm))}`:z(),color_1:"text-white"}),i.jsx(dC,{title:"Open Interest",widthValue:"130px",info:n!=null&&n.oraclePx?`$${Er(parseFloat((n==null?void 0:n.oraclePx)*(n==null?void 0:n.openInterest)))}`:z(),color_1:"text-white"}),i.jsx(dC,{title:i.jsx(gX,{text:"If the funding rate is positive, longs pay shorts. If negative, shorts pay longs.",children:"Funding"}),title_2:"Countdown",widthValue:"145px",info:(n==null?void 0:n.funding)!=null?((n==null?void 0:n.funding)*100).toFixed(4)+"%":z(),info_2:(n==null?void 0:n.funding)!=null?d:z(),color_1:"text-[#1DE6A3]",color_2:"text-white",isLast:!0})]})}),i.jsx("div",{className:"flex lg:hidden justify-start items-center gap-4",children:"All Positions"})]})})},dC=({title:e,title_2:t,widthValue:n,info:r,info_2:s,color_1:a,color_2:o,isLast:l})=>i.jsxs("div",{className:"flex items-center",children:[i.jsxs("div",{style:{minWidth:n},className:"flex flex-col items-center justify-center",children:[i.jsx("div",{className:"flex flex-col items-start",children:t?i.jsxs("div",{className:`text-[#B7B7B7] text-[12px] font-medium font-inter leading
-snug`,children:[e," / ",t]}):i.jsx("div",{className:"text-[#B7B7B7] text-[12px] font-medium font-inter leading-snug",children:e})}),s?i.jsxs("div",{className:"flex justify-start items-center gap-1",children:[i.jsx("div",{className:`${a} text-[12px] font-semibold font-inter leading-[16px]`,children:r}),i.jsx("div",{className:`${a} flex justify-center items-center max-h-2`,children:r?"/":""}),i.jsx("div",{className:`${o} text-[12px] font-semibold font-inter leading-[16px]`,children:t=="Countdown"?s:`${s>0?"+":""}${parseFloat(s).toFixed(2)}%`})]}):i.jsx("div",{className:`${a} text-[12px] font-semibold font-inter leading-[16px]`,children:r})]}),!l&&i.jsx("div",{className:"border-l border-[#3E3E3E]",style:{height:24}})]}),Qdn="wss://api.hyperliquid.xyz/ws",bX=new Map;function X4e(e){const t=(e||"").toLowerCase();return t?(bX.has(t)||bX.set(t,{key:t,ws:null,ping:null,subs:new Set,connected:!1,connecting:!1}),bX.get(t)):null}function wHe(e){if(!e||e.connecting||e.connected)return;e.connecting=!0;const t=new WebSocket(Qdn);e.ws=t,t.onopen=()=>{e.connected=!0,e.connecting=!1;try{t.send(JSON.stringify({method:"subscribe",subscription:{type:"user",user:e.key}})),t.send(JSON.stringify({method:"subscribe",subscription:{type:"webData2",user:e.key}})),t.send(JSON.stringify({method:"subscribe",subscription:{type:"webData3",user:e.key}}))}catch{}e.ping=setInterval(()=>{try{t.send(JSON.stringify({id:99,method:"ping"}))}catch{}},3e4)},t.onmessage=r=>{let s;try{s=JSON.parse(r.data)}catch{return}(s==null?void 0:s.method)!=="pong"&&e.subs.forEach(a=>{try{a(s)}catch{}})};const n=()=>{e.connected=!1,e.connecting=!1;try{t.close()}catch{}e.ping&&(clearInterval(e.ping),e.ping=null),e.ws=null,e.subs.size&&setTimeout(()=>wHe(e),1500)};t.onclose=n,t.onerror=n}function CHe(e,t){const n=X4e(e);return n?(n.subs.add(t),wHe(n),()=>{const r=X4e(e);if(r&&(r.subs.delete(t),!r.subs.size&&r.ws))try{r.ws.close()}catch{}}):()=>{}}const Zdn="https://api.hyperliquid.xyz/info",yX=new Map,Jdn=["xyz"];function efn(e){const t=(e==null?void 0:e.toLowerCase())||"";return t?(yX.has(t)||yX.set(t,{key:t,rows:[],count:void 0,loading:!0,emptyTimer:null,tpslByCoin:{},viewOrdersOnly:new Set,subs:new Set}),yX.get(t)):null}function SHe(e){e.subs.forEach(t=>{try{t({rows:e.rows,count:e.count,loading:e.loading,tpslByCoin:e.tpslByCoin,viewOrdersOnly:e.viewOrdersOnly})}catch{}})}function tfn(e){return(Array.isArray(e)?e:[]).filter(n=>{var r;return((r=n==null?void 0:n.position)==null?void 0:r.szi)&&Number(n.position.szi)!==0}).map(n=>{var v,w,C;const r=n.position,s=Number(r.szi||0),a=Number(r.positionValue||0),o=Number(r.entryPx||0),l=Math.abs(s)>0?a/Math.abs(s):0,c=Number(r.unrealizedPnl||0),u=Number(r.returnOnEquity||0)*100,d=r.liquidationPx?Number(r.liquidationPx):null,f=Number(r.marginUsed||0),x=Number(((v=r.leverage)==null?void 0:v.value)||0),g=((w=r.leverage)==null?void 0:w.type)||null;return{id:`${r.coin}:${r.entryPx}:${r.szi}`,coin:r.coin,type:s>0?"Long":"Short",size:s,positionValue:a,entryPrice:o,markPrice:l,pnl:c,roe:u,liquidationPx:d,marginUsed:f,leverage:{value:x,type:g},funding:Number(((C=r.cumFunding)==null?void 0:C.sinceOpen)||0)}})}function Q4e(e,t){const n=tfn(t);e.rows=n,e.count=n.length,e.loading=!1,SHe(e)}function KP(e,t){if(Array.isArray(t)&&t.length>0){e.emptyTimer&&(clearTimeout(e.emptyTimer),e.emptyTimer=null),Q4e(e,t);return}e.emptyTimer||(e.emptyTimer=setTimeout(()=>{e.emptyTimer=null,Q4e(e,[])},1e3))}function YP(e,t){const n=Array.isArray(t)?t:[],r={},s=new Set,a=new Set;for(const o of n)if(o!=null&&o.coin&&(s.add(o.coin),o.isPositionTpsl)){a.add(o.coin);const l=r[o.coin]||{tp:null,sl:null},c=Number(o.triggerPx||o.limitPx||0),u=String(o.orderType||"").toLowerCase();u.includes("take profit")&&(l.tp=Number.isFinite(c)?c:l.tp),u.includes("stop")&&(l.sl=Number.isFinite(c)?c:l.sl),r[o.coin]=l}for(const o of s)a.has(o)||(r[o]={tp:null,sl:null});e.tpslByCoin=r,SHe(e)}function NHe(e){const t=[],n=new Set;function r(s){if(Array.isArray(s))for(const a of s){if(!a)continue;const o=a.oid!=null?String(a.oid):a.cloid!=null?String(a.cloid):`${a.coin||""}-${a.timestamp||""}-${a.limitPx||""}-${a.side||""}`;n.has(o)||(n.add(o),t.push(a))}}if(!e)return t;if(Array.isArray(e))return r(e),t;if(typeof e!="object")return t;if(Array.isArray(e.orders)&&r(e.orders),r(e.openOrders),e.clearinghouseState&&typeof e.clearinghouseState=="object"&&r(e.clearinghouseState.openOrders),Array.isArray(e.perpDexStates))for(const s of e.perpDexStates)!s||typeof s!="object"||(Array.isArray(s.orders)&&r(s.orders),r(s.openOrders),s.clearinghouseState&&typeof s.clearinghouseState=="object"&&r(s.clearinghouseState.openOrders));return t}function AHe(e){let t=[],n=!1;if(e&&typeof e=="object"){const a=e.clearinghouseState;if(Array.isArray(a&&a.assetPositions)?(t.push(...a.assetPositions),n=!0):Array.isArray(e.assetPositions)&&(t.push(...e.assetPositions),n=!0),Array.isArray(e.perpDexStates)){let o=!1;for(const l of e.perpDexStates){if(!l||!l.clearinghouseState)continue;const c=l.clearinghouseState.assetPositions;Array.isArray(c)&&c.length>0&&(o=!0,t.push(...c))}o&&(n=!0)}}const r=NHe(e),s=r.length>0;return{hasAssetPositions:n,assetPositions:t,hasOpenOrders:s,openOrders:r}}function nfn(e){if(!e||typeof e!="object")return{assetPositions:[],openOrders:[]};const{hasAssetPositions:t,assetPositions:n,hasOpenOrders:r,openOrders:s}=AHe(e);return{assetPositions:t?n:[],openOrders:r?s:[]}}function wue(e){const[t,n]=m.useState({rows:[],count:void 0,loading:!0,tpslByCoin:{},viewOrdersOnly:new Set});return m.useEffect(()=>{const r=e==null?void 0:e.toLowerCase();if(!r)return;const s=efn(r),a=l=>n(l);s.subs.add(a),n({rows:s.rows,count:s.count,loading:s.loading,tpslByCoin:s.tpslByCoin,viewOrdersOnly:s.viewOrdersOnly});const o=CHe(r,l=>{if(!l)return;const c=l.channel;if(c==="user"){const u=l.data&&l.data.state;if(!u)return;Array.isArray(u.assetPositions)&&KP(s,u.assetPositions);const d=NHe(u);d.length&&YP(s,d);return}if(c==="webData2"||c==="webData3"){const u=l.data||{},{hasAssetPositions:d,assetPositions:f,hasOpenOrders:x,openOrders:g}=AHe(u);d&&KP(s,f),x&&YP(s,g)}});return(async()=>{try{const l=Jdn.map(f=>{const x={type:"clearinghouseState",user:r};return f&&(x.dex=f),x}),c=await Promise.all(l.map(f=>fetch(Zdn,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(f)}).then(x=>x.json()).catch(()=>null))),u=[],d=[];for(const f of c){if(!f)continue;const{assetPositions:x,openOrders:g}=nfn(f);Array.isArray(x)&&x.length&&u.push(...x),Array.isArray(g)&&g.length&&d.push(...g)}KP(s,u),YP(s,d)}catch{KP(s,[]),YP(s,[])}})(),()=>{s.subs.delete(a),o()}},[e]),t}function jHe(e){const{count:t}=wue(e);return t}const vX=new Map;function rfn(e){const t=(e==null?void 0:e.toLowerCase())||"";return t?(vX.has(t)||vX.set(t,{key:t,rows:[],count:void 0,loading:!0,subs:new Set,emptyTimer:null}),vX.get(t)):null}function sfn(e){e.subs.forEach(t=>{try{t({rows:e.rows,count:e.count,loading:e.loading})}catch{}})}function ifn(e){return(Array.isArray(e)?e:[]).map(n=>({id:`${n.oid}-${n.timestamp}`,coin:n.coin,side:n.side==="B"?"Buy":"Sell",sideRaw:n.side,type:n.orderType,size:Number(n.sz)>0?Number(n.sz):"--",originalSize:Number(n.origSz)>0?Number(n.origSz):"--",price:Number(n.triggerPx)>0?"Market":Number(n.limitPx),limitPx:Number(n.limitPx||0),triggerPx:Number(n.triggerPx)||"N/A",isTrigger:!!n.isTrigger,reduceOnly:!!n.reduceOnly,tif:n.tif||null,orderValue:Number(n.limitPx||0)>0&&Number(n.sz||0)!==0?Number(n.limitPx)*Math.abs(Number(n.sz)):0,timestamp:Number(n.timestamp||0),children:Array.isArray(n.children)?n.children:[],isPositionTpsl:!!n.isPositionTpsl,cloid:n.cloid||null,oid:n.oid})).sort((n,r)=>r.timestamp-n.timestamp)}function wX(e){const t=[],n=new Set;function r(s){if(Array.isArray(s))for(const a of s){if(!a)continue;const o=a.oid!=null?String(a.oid):a.cloid!=null?String(a.cloid):`${a.coin||""}-${a.timestamp||""}-${a.limitPx||""}-${a.side||""}`;n.has(o)||(n.add(o),t.push(a))}}if(!e)return t;if(Array.isArray(e)){for(const s of e)!s||typeof s!="object"||(Array.isArray(s.orders)&&r(s.orders),Array.isArray(s.openOrders)&&r(s.openOrders));return t}if(typeof e!="object")return t;if(Array.isArray(e.orders)&&r(e.orders),Array.isArray(e.openOrders)&&r(e.openOrders),e.clearinghouseState&&typeof e.clearinghouseState=="object"&&Array.isArray(e.clearinghouseState.openOrders)&&r(e.clearinghouseState.openOrders),Array.isArray(e.perpDexStates))for(const s of e.perpDexStates)!s||typeof s!="object"||(Array.isArray(s.orders)&&r(s.orders),Array.isArray(s.openOrders)&&r(s.openOrders),s.clearinghouseState&&typeof s.clearinghouseState=="object"&&Array.isArray(s.clearinghouseState.openOrders)&&r(s.clearinghouseState.openOrders));return t}function Z4e(e){if(!e||typeof e!="object")return!1;if(Array.isArray(e.orders)||Array.isArray(e.openOrders)||e.clearinghouseState&&typeof e.clearinghouseState=="object"&&Array.isArray(e.clearinghouseState.openOrders))return!0;if(Array.isArray(e.perpDexStates)){for(const t of e.perpDexStates)if(!(!t||typeof t!="object")&&(Array.isArray(t.orders)||Array.isArray(t.openOrders)||t.clearinghouseState&&typeof t.clearinghouseState=="object"&&Array.isArray(t.clearinghouseState.openOrders)))return!0}return!1}function CX(e,t){const n=ifn(t);e.rows=n,e.count=n.length,e.loading=!1,sfn(e)}function SX(e,t,n){if(t.length>0){e.emptyTimer&&(clearTimeout(e.emptyTimer),e.emptyTimer=null),CX(e,t);return}if(n===0){e.emptyTimer&&(clearTimeout(e.emptyTimer),e.emptyTimer=null),CX(e,[]);return}e.emptyTimer||(e.emptyTimer=setTimeout(()=>{e.emptyTimer=null,!(n>0)&&CX(e,[])},2e3))}function Cue(e){const t=(e==null?void 0:e.toLowerCase())||"",n=jHe(e),[r,s]=m.useState({rows:[],count:void 0,loading:!0});return m.useEffect(()=>{if(!t){s({rows:[],count:0,loading:!1});return}const a=rfn(t);if(!a){s({rows:[],count:0,loading:!1});return}const o=c=>s(c);a.subs.add(o),s({rows:a.rows,count:a.count,loading:a.loading});const l=CHe(t,c=>{if(!c)return;const u=c.channel,d=c.data||{};if(u==="openOrders"){const f=wX(d);SX(a,f,n);return}if(u==="user"){const f=d.state;if(!f||!Z4e(f))return;const x=wX(f);SX(a,x,n);return}if(u==="webData2"||u==="webData3"){if(!Z4e(d))return;const f=wX(d);SX(a,f,n);return}});return()=>{a.subs.delete(o),l()}},[t,n]),r}function afn(e){const{count:t}=Cue(e);return t}const mv={"1m":"1","5m":"5","15m":"15","30m":"30","1h":"60","4h":"240","12h":"720","1d":"1D","1w":"1W","1M":"1M"},Fj={"1m":60,"5m":300,"15m":900,"30m":1800,"1h":3600,"4h":14400,"12h":43200,"1d":86400,"1w":604800,"1M":2592e3},XP={1:"1m",5:"5m",15:"15m",30:"30m",60:"1h",240:"4h",720:"12h","1D":"1d",D:"1d","1W":"1w",W:"1w","1M":"1M",M:"1M"},ofn="wss://api.starknet.extended.exchange",NX="https://api.starknet.extended.exchange/api/v1",AX="https://express-proxy-delta.vercel.app/proxy?url=",lfn={"1m":"PT1M","5m":"PT5M","15m":"PT15M","30m":"PT30M","1h":"PT1H","4h":"PT4H","12h":"PT12H","1d":"PT24H","1w":"P7D","1M":"P30D"},cfn="https://mainnet.zklighter.elliot.ai/api/v1/candles",ufn="https://mainnet.zklighter.elliot.ai/api/v1/candlesticks",dfn=["tv.js","charting_library.standalone.js","charting_library.js"];let QP=null;function ffn(e="/charting_library/"){return typeof window>"u"?Promise.resolve(null):window.TradingView&&window.TradingView.widget?Promise.resolve(window.TradingView):QP||(QP=(async()=>{for(const t of dfn){const n=e.replace(/\/?$/,"/")+t;if(!document.querySelector(`script[data-tv-lib="${n}"]`)){const s=document.createElement("script");s.src=n,s.async=!0,s.dataset.tvLib=n,document.body.appendChild(s),await new Promise(a=>{s.onload=a,s.onerror=a})}if(window.TradingView&&window.TradingView.widget)return window.TradingView;let r=0;for(;(!window.TradingView||!window.TradingView.widget)&&r<40;)await new Promise(s=>setTimeout(s,25)),r++;if(window.TradingView&&window.TradingView.widget)return window.TradingView}return window.TradingView||null})(),QP)}const hfn="#133024",EHe="#67FFBD",pfn="#311621",_He="#FF79AD",mfn={background:hfn,border:EHe},xfn={background:pfn,border:_He},gfn="#67FFBD",bfn="rgba(103,255,189,0.12)",yfn="#67FFBD",vfn="#FF797C",wfn="rgba(255,121,124,0.12)",Cfn="#FF79AD",Sfn="#67FFBD",Nfn="rgba(103,255,189,0.08)",Afn="#67FFBD",J4e="#FF79AD",eSe="rgba(255,121,173,0.08)",tSe="#FF79AD",x9=e=>{const t=String(e||"").trim().toUpperCase();return t==="SELL"||t==="SHORT"||t==="S"?"S":t==="BUY"||t==="LONG"||t==="B"?"B":""},jO="",nSe="tv_chart_layout_v3",bb=e=>typeof e=="string"&&e.includes("/");function jfn(e){const t=[e.isBuy,e.b,e.buy,e.side,e.dir,e.takerSide,e.action];for(const n of t){if(n===!0||n===1)return!0;if(n===!1||n===0)return!1;if(typeof n=="string"){const r=n.toLowerCase();if(r==="buy"||r==="b"||r==="long")return!0;if(r==="sell"||r==="s"||r==="short")return!1}}return!1}function kHe(e){const t=new Date(e);return Date.UTC(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate())}function Efn(e){const t=new Date(e),n=kHe(e),r=t.getUTCDay();return n-r*864e5}function _fn(e){const t=new Date(e);return Date.UTC(t.getUTCFullYear(),t.getUTCMonth(),1)}function xv(e,t){if(t==="1d")return kHe(e);if(t==="1w")return Efn(e);if(t==="1M")return _fn(e);const n=Fj[t]||60;return Math.floor(e/1e3/n)*n*1e3}function Sue(e){return/limit/i.test(String(e.type||""))?Number(e.limitPx)||0:Number(e.triggerPx)||0}function THe(e){return Number(e.sz??e.size??e.sizeCoin??e.coinSize??e.baseSize??e.qty??e.quantity??0)||0}function kfn(e,t){const n=x9(e.sideRaw||e.side),r=/take\s*profit/i.test(String(e.type||"")),s=/stop/i.test(String(e.type||"")),a=Sue(e),o=THe(e),l=e.coin||t||"",c=o>0?` (${o.toLocaleString(void 0,{maximumFractionDigits:6})}${l?" "+l:""})`:"";return r?jO+`TP ${n==="S"?">":"<"} ${a}${c}`:s?jO+`SL ${n==="S"?"<":">"} ${a}${c}`:jO+`Limit ${a}${c}`}function Tfn(e){const t=/take\s*profit/i.test(String(e.type||"")),n=/stop/i.test(String(e.type||"")),r=x9(e.sideRaw||e.side),s=r==="S"||r==="A";return n?{txt:vfn,bg:wfn,br:Cfn}:t?s?{txt:J4e,bg:eSe,br:tSe}:{txt:gfn,bg:bfn,br:yfn}:s?{txt:J4e,bg:eSe,br:tSe}:{txt:Sfn,bg:Nfn,br:Afn}}function rSe(e){return!e||typeof e!="object"||!Array.isArray(e.charts)?e:{...e,charts:e.charts.map(n=>!n||!Array.isArray(n.panes)?n:{...n,panes:n.panes.map(r=>{if(!r||!Array.isArray(r.sources))return r;const s=r.sources.filter(a=>{if(!a||typeof a!="object")return!0;const o=a.state||{},l=o.text||o.title||"";return!(typeof l=="string"&&l[0]===jO)});return{...r,sources:s}})})}}function Ifn(e,t){const n=e.oid??e.cloid??e.clientOrderId??e.hash??e.orderId??e.id??null,r=e.sideRaw??e.side??"";return String(n??`${e.coin||t}|${r}|${Sue(e)}`)}function sSe(e,t,n){var r,s,a,o;if(n!=null){try{(r=e==null?void 0:e.removeEntity)==null||r.call(e,n)}catch{}try{(s=t==null?void 0:t.removeEntity)==null||s.call(t,n)}catch{}try{const l=(a=t==null?void 0:t.getShapeById)==null?void 0:a.call(t,n);(o=l==null?void 0:l.remove)==null||o.call(l)}catch{}}}function ZP(e,t,n){e.forEach(r=>{r&&(typeof r.then=="function"?r.then(s=>{s!=null&&sSe(t,n,s)}).catch(()=>{}):sSe(t,n,r))})}const Pfn=(()=>{if(typeof Intl<"u"&&Intl.DateTimeFormat)try{const e=Intl.DateTimeFormat().resolvedOptions().timeZone;if(e&&typeof e=="string")return e}catch{}return"Etc/UTC"})();function jX({coin:e="BTC",interval:t="1h",domId:n,libPath:r="/charting_library/",walletAddress:s,gridLines:a=[],market:o="hyperliquid",lighterMarketId:l=null,extendedMarket:c=null,extendedLastPrice:u=null,extendedApiKey:d=null}){const f=m.useRef(null),x=m.useRef(null),g=m.useRef(null),v=m.useRef(new Map),[w,C]=m.useState(!1),N=m.useRef([]),P=m.useRef([]),I=Cue(s||"").rows,R=m.useRef(null),F=m.useRef(t),U=m.useRef(new Map),L=m.useRef(0),[z,Q]=m.useState([]);m.useEffect(()=>{I.length>0&&(N.current=I)},[I]);let ne;I.length===0?(L.current+=1,L.current<=1?ne=N.current:ne=I):(L.current=0,ne=I);const J=m.useMemo(()=>o!=="hyperliquid"?[]:ne.filter(G=>G&&G.coin===e),[ne,e,o]);m.useEffect(()=>{if(o!=="extended"||!d){Q([]);return}let G=!1;const V=async()=>{try{const ae=`${NX}/user/orders`,fe=`${AX}${encodeURIComponent(ae)}`,he=await(await fetch(fe,{headers:{"X-Api-Key":d}})).json().catch(()=>null);if(G)return;const ye=((he==null?void 0:he.data)&&Array.isArray(he.data)&&he.data||(Array.isArray(he)?he:[])).map((ve,je)=>{var Ie;return{id:ve.id??je,market:(ve.market||"").toUpperCase(),type:(ve.type||"").toUpperCase(),side:x9(ve.side)||(ve.side||"").toUpperCase(),sideRaw:x9(ve.side)||"B",status:(ve.status||"").toUpperCase(),limitPx:Number(ve.price)||null,triggerPx:((Ie=ve.trigger)==null?void 0:Ie.triggerPrice)!=null?Number(ve.trigger.triggerPrice):null,qty:Number(ve.qty)||null,takeProfit:ve.takeProfit||null,stopLoss:ve.stopLoss||null,reduceOnly:!!ve.reduceOnly,createdTime:ve.createdTime||null,updatedTime:ve.updatedTime||null}}).filter(ve=>ve.status==="NEW"||ve.status==="PARTIALLY_FILLED");Q(ye)}catch{G||Q([])}};V();const ee=setInterval(V,1e4);return()=>{G=!0,clearInterval(ee)}},[o,d]);const X=m.useMemo(()=>{if(o==="hyperliquid")return J;if(o==="extended"){const G=String(c||e||"").toUpperCase();return z.filter(V=>String(V.market||"").toUpperCase()===G)}return[]},[o,J,z,c,e]);let re=Pfn;try{const G=typeof window<"u"?JSON.parse(window.localStorage.getItem("tradingview.chartproperties")||"null"):null;G&&G.timezone&&(re=G.timezone)}catch{}const pe=typeof window<"u"?window.localStorage.getItem("tranding_chart_interval_time"):null,Y=pe&&mv[pe]?pe:t,ie=mv[Y]||"60";m.useEffect(()=>{I.length>0&&(P.current=I)},[I]),m.useEffect(()=>{if(!w)return;const G=x.current,V=G&&G.activeChart&&G.activeChart();if(!V)return;const ee=mv[t]?mv[t]:Object.values(mv).includes(t)?t:ie,ae=R.current!==e,fe=F.current!==t;if(ae){R.current=e,F.current=t;const Ne=g.current;if(Ne&&typeof Ne.clearMarksCache=="function")try{Ne.clearMarksCache()}catch{}try{V.setSymbol(e,ee,()=>{var he;try{V.requestMarksRefresh&&V.requestMarksRefresh(),(he=V.autoScaleAllSeries)==null||he.call(V)}catch{}})}catch{}}else if(fe){F.current=t;try{V.setResolution(ee,()=>{var Ne;try{V.requestMarksRefresh&&V.requestMarksRefresh(),(Ne=V.autoScaleAllSeries)==null||Ne.call(V)}catch{}})}catch{}}},[e,t,w,ie]),m.useEffect(()=>{let G=!0;return(async()=>{const V=await ffn(r);if(!G||!V||!V.widget||!f.current)return;f.current.innerHTML="";let ee=5;function ae(ye,ve,je,Ie,Le,Qe,$e){let it=ye||null,tt=$e||null,lt=null,ft=null,ut=null,qt=null,It=null,nn=null;const jt={},cn={},un={},Ft={};let Ke=!0,Bt=Qe,$t=null,qe=0;const Ye=sn=>+String(sn).slice(0,13);let ht="1h",Zt="",zt=[],Et=null,nt=null,Ue=null;const Rt=sn=>lfn[sn]||"PT1M",We=sn=>{if(Le)return Le;const Me=String(sn||"");return!Me||Me.includes("/")?"":Me.includes("-")?Me:`${Me}-USD`},at=(sn,Me)=>{if(!Me)return;const en=Ft[Me]||[],an=en[en.length-1];an&&an.time===sn.time?en[en.length-1]=sn:en.push(sn),en.length>2e3&&en.splice(0,en.length-2e3),Ft[Me]=en},mt=(sn,Me,en)=>{const an=Ft[sn]||[];return an.length?an.filter(Nt=>Number.isFinite(Nt.time)&&Nt.time/1e3>=Me&&Nt.time/1e3<=en):[]},Dt=(sn,Me,en)=>{const an=Number(Bt);if(!Number.isFinite(an)||an<=0)return[];const Nt=xv(en*1e3,sn);return Math.floor(Nt/1e3)<Me?[]:[{time:Nt,open:an,high:an,low:an,close:an,volume:0}]};function Tt(){je==="hyperliquid"&&(lt||(lt=new WebSocket("wss://api-ui.hyperliquid.xyz/ws"),lt.onopen=()=>{It&<&<.send(JSON.stringify({method:"subscribe",subscription:It}))},lt.onmessage=sn=>{var an;const Me=(an=JSON.parse(sn.data))==null?void 0:an.data;if(!Me||!Me.c)return;const en={time:Ye(Me.t),open:+Me.o,high:+Me.h,low:+Me.l,close:+Me.c,volume:Me.v??0};Object.values(jt).forEach(Nt=>Nt(en))},lt.onclose=()=>{lt=null}))}function dn(){je==="extended"&&(!nn||ft||(ft=new WebSocket(nn),ft.onmessage=sn=>{let Me;try{Me=JSON.parse(sn.data)}catch{return}const en=Array.isArray(Me==null?void 0:Me.data)?Me.data:[];en.length&&en.forEach(an=>{const Nt={time:Ye(an.T),open:+an.o,high:+an.h,low:+an.l,close:+an.c,volume:an.v!=null?Number(an.v):0};!Number.isFinite(Nt.time)||!Number.isFinite(Nt.open)||(at(Nt,ht),Object.values(jt).forEach(Yn=>Yn(Nt)))})},ft.onclose=()=>{ft=null}))}function on(sn,Me,en){if(je!=="hyperliquid")return;if(ut)try{ut.close()}catch{}if(qt)try{qt.close()}catch{}nt=null,Ue=null,ut=new WebSocket("wss://api-ui.hyperliquid.xyz/ws"),qt=new WebSocket("wss://api-ui.hyperliquid.xyz/ws"),ut.onopen=()=>{ut&&ut.send(JSON.stringify({method:"subscribe",subscription:{type:"candle",coin:sn,interval:en}}))},qt.onopen=()=>{qt&&qt.send(JSON.stringify({method:"subscribe",subscription:{type:"candle",coin:Me,interval:en}}))};const an=Nt=>Yn=>{var or;const xn=(or=JSON.parse(Yn.data))==null?void 0:or.data;if(!xn||!xn.c)return;const Mt={time:Ye(xn.t),open:+xn.o,high:+xn.h,low:+xn.l,close:+xn.c,volume:xn.v??0};if(Nt==="A"?nt=Mt:Ue=Mt,!nt||!Ue)return;const tn=xv(nt.time,ht),In=xv(Ue.time,ht);if(tn!==In)return;const Xn={time:Math.max(nt.time,Ue.time),open:nt.open/Ue.open,high:nt.high/Ue.high,low:nt.low/Ue.low,close:nt.close/Ue.close,volume:0};Object.values(jt).forEach(lr=>lr(Xn))};ut.onmessage=an("A"),qt.onmessage=an("B"),ut.onclose=()=>{ut=null},qt.onclose=()=>{qt=null}}function gn(sn){const Me=String(sn||"");return Me==="BTC"||Me==="ETH"?2:Me.startsWith("1000")||Me.includes("/")?4:3}async function Nn(sn,Me,en,an){const xn=(Fj[Me]||60)*1e4,Mt=Math.max(en*1e3,an*1e3-xn*1e3),{data:tn}=await fs.post("https://api-ui.hyperliquid.xyz/info",{type:"candleSnapshot",req:{coin:sn,interval:Me,startTime:Mt,endTime:an*1e3}});return(Array.isArray(tn)?tn:tn&&tn.data?tn.data:[]).map(Xn=>({time:Ye(Xn.t),open:+Xn.o,high:+Xn.h,low:+Xn.l,close:+Xn.c,volume:Xn.v??0})).sort((Xn,or)=>Xn.time-or.time)}async function kn(sn,Me,en,an,Nt){const[Yn,xn]=await Promise.all([Nn(sn,en,an,Nt),Nn(Me,en,an,Nt)]),Mt=[];let tn=0,In=0;for(;tn<Yn.length&&In<xn.length;){const Xn=xv(Yn[tn].time,ht),or=xv(xn[In].time,ht);Xn===or?(Mt.push({time:Math.max(Yn[tn].time,xn[In].time),open:Yn[tn].open/xn[In].open,high:Yn[tn].high/xn[In].high,low:Yn[tn].low/xn[In].low,close:Yn[tn].close/xn[In].close,volume:0}),tn++,In++):Xn<or?tn++:In++}return Mt}async function yn(sn,Me,en,an){if(sn==null)return[];const Nt=Fj[Me]||60,Yn=Math.max(Nt,an-en),xn=Math.max(1,Math.ceil(Yn/Nt)),Mt={market_id:sn,resolution:Me,r:Me,start_timestamp:en*1e3,end_timestamp:an*1e3,start:en*1e3,end:an*1e3,count_back:xn,limit:xn,set_timestamp_to_end:!0},tn=lr=>{if(!lr)return null;if(Array.isArray(lr)){const[h,p,S,_,k,T]=lr;return{time:Ye(h),open:+p,high:+S,low:+_,close:+k,volume:Number(T??0)||0}}const Qt=lr.t??lr.time??lr.timestamp??lr.start_timestamp??lr.startTime??lr.start_time??0,zn=lr.o??lr.open,Jn=lr.h??lr.high,Lt=lr.l??lr.low,jn=lr.c??lr.close,Ee=lr.v??lr.volume??lr.V??0;return{time:Ye(Qt),open:+zn,high:+Jn,low:+Lt,close:+jn,volume:Number(Ee??0)||0}},In=lr=>lr.map(Qt=>tn(Qt)).filter(Qt=>Qt&&Number.isFinite(Qt.time)&&Number.isFinite(Qt.open)&&Qt.time/1e3>=en&&Qt.time/1e3<=an).sort((Qt,zn)=>Qt.time-zn.time),Xn=async lr=>{const{data:Qt}=await fs.get(lr,{params:Mt});return Qt?Array.isArray(Qt.c)?Qt.c:Array.isArray(Qt.data)?Qt.data:Array.isArray(Qt.candlesticks)?Qt.candlesticks:Array.isArray(Qt.candles)?Qt.candles:Array.isArray(Qt)?Qt:[]:[]};let or=[];try{or=await Xn(cfn)}catch{}if(!or.length)try{or=await Xn(ufn)}catch{}return In(or)}async function Vn(sn,Me,en,an){if(!sn)return[];const Nt=Fj[Me]||60,Yn=Math.max(Nt,an-en),xn=Math.min(1e4,Math.max(1,Math.ceil(Yn/Nt))),Mt=Rt(Me),tn=`${NX}/info/candles/${sn}/trades?interval=${Mt}&limit=${xn}&endTime=${an*1e3}`,In=`${AX}${encodeURIComponent(tn)}`,{data:Xn}=await fs.get(In);return(Array.isArray(Xn==null?void 0:Xn.data)?Xn.data:[]).map(lr=>({time:Ye(lr.T),open:+lr.o,high:+lr.h,low:+lr.l,close:+lr.c,volume:lr.v!=null?Number(lr.v):0})).filter(lr=>Number.isFinite(lr.time)&&Number.isFinite(lr.open)&&lr.time/1e3>=en&&lr.time/1e3<=an).sort((lr,Qt)=>lr.time-Qt.time)}async function Gn(sn,Me,en){if(!it)return[];if(bb(sn))return[];const{data:an}=await fs.post("https://api.hyperliquid.xyz/info",{type:"userFills",user:it,coin:sn,startTime:Me*1e3,endTime:en*1e3});return(Array.isArray(an)?an:an&&an.data?an.data:[]).filter(xn=>{const Mt=xn.coin||xn.asset||xn.symbol;return Mt?String(Mt).toUpperCase()===String(sn).toUpperCase():!0}).map(xn=>({t:+String(xn.time).slice(0,13),b:jfn(xn),px:Number(xn.px||xn.price),sz:Number(xn.sz||xn.size)})).filter(xn=>xn.t/1e3>=Me&&xn.t/1e3<=en&&Number.isFinite(xn.px)&&xn.px>0)}async function Dn(sn,Me,en){if(!tt)return[];if(!sn)return[];const an=`${NX}/user/trades`,Nt=`${AX}${encodeURIComponent(an)}`,{data:Yn}=await fs.get(Nt,{headers:{"X-Api-Key":tt}}),xn=Array.isArray(Yn==null?void 0:Yn.data)?Yn.data:Array.isArray(Yn)?Yn:[],Mt=String(sn||"").toUpperCase();return xn.filter(tn=>String(tn.market||"").toUpperCase()===Mt).map(tn=>({t:+String(tn.createdTime||tn.time||tn.paidTime||0).slice(0,13),b:x9(tn.side)!=="S"})).filter(tn=>tn.t/1e3>=Me&&tn.t/1e3<=en&&Number.isFinite(tn.t))}function Kn(sn){cn[sn]&&(clearInterval(cn[sn]),delete cn[sn])}function Cn(){Object.keys(cn).forEach(sn=>{Kn(sn)})}return{setWallet:sn=>{it=sn||null,Zt="",zt=[],Et=null},setExtendedApiKey:sn=>{tt=sn||null,Zt="",zt=[],Et=null},setExtendedFallbackPrice:sn=>{Bt=sn},clearMarksCache:()=>{Zt="",zt=[],Et=null},onReady:sn=>sn({supported_resolutions:Object.values(mv),supports_group_request:!1,supports_marks:!0,supports_timescale_marks:!1,supports_time:!0}),resolveSymbol:(sn,Me)=>{$t=sn;const en=un[sn]??gn(sn);un[sn]=en,typeof ve=="function"&&ve(en),Me({name:sn,ticker:sn,full_name:sn,description:bb(sn)?sn:sn+"/USD",type:"crypto",session:"24x7",timezone:re,exchange:je==="lighter"?"Lighter":je==="extended"?"Extended":"Hyperliquid",pricescale:Math.pow(10,en),minmov:1,has_intraday:!0,supported_resolutions:Object.values(mv),data_status:"streaming"})},getServerTime:sn=>sn(Math.floor(Date.now()/1e3)),getBars:async(sn,Me,{from:en,to:an},Nt,Yn)=>{const xn=sn.ticker||sn.name,Mt=++qe;try{const tn=XP[Me]||"1m";tn&&(ht=tn);let In=[];if(je==="lighter")bb(xn)||(In=await yn(Ie,tn,en,an));else if(je==="extended"){if(!bb(xn)){const Xn=We(xn);if(Xn&&Ke)try{In=await Vn(Xn,tn,en,an)}catch{Ke=!1}In.length||(In=mt(tn,en,an)),In.length||(In=Dt(tn,en,an))}}else if(bb(xn)){const Xn=String(xn).split("/"),or=Xn[0],lr=Xn[1];In=await kn(or,lr,tn,en,an)}else In=await Nn(xn,tn,en,an);if(xn!==$t||Mt!==qe)return;Nt(In,{noData:In.length===0})}catch(tn){const In=tn&&tn.response&&tn.response.status;if(je==="lighter"&&In===400){xn===$t&&Mt===qe&&Nt([],{noData:!0});return}try{Yn(tn&&tn.message?tn.message:"Datafeed error")}catch{}}},getMarks:async(sn,Me,en,an,Nt)=>{const Yn=sn.ticker||sn.name;if(bb(Yn))return an([]);const xn=XP[Nt]||null;xn&&(ht=xn);let Mt=Number(Me),tn=Number(en);const In=Math.floor(Date.now()/1e3);(!Number.isFinite(Mt)||!Number.isFinite(tn)||tn<=Mt||Mt<=0||tn<=0)&&(tn=In,Mt=tn-30*24*3600);const Xn=je==="extended"?We(Yn):Yn;if(je==="extended"&&!tt)return an([]);const or=[je,Xn||Yn,Mt,tn,ht];je==="extended"&&or.push(tt||"no-key");const lr=or.join("|");if(lr===Zt&&zt.length)return an(zt);if(Et&&Et.key===lr){const zn=await Et.promise;return an(zn)}Et={key:lr,promise:(async()=>{try{let zn=new Map;if(je==="hyperliquid"){const Lt=await Gn(Yn,Mt,tn);zn=new Map;for(const jn of Lt){const Ee=xv(jn.t,ht),h=Math.floor(Ee/1e3),p=jn.b?"B":"S",S=h+"-"+p;zn.has(S)||zn.set(S,{time:h,isBuy:jn.b})}}else if(je==="extended"){const Lt=await Dn(Xn,Mt,tn);zn=new Map;for(const jn of Lt){const Ee=xv(jn.t,ht),h=Math.floor(Ee/1e3),p=jn.b?"B":"S",S=h+"-"+p;zn.has(S)||zn.set(S,{time:h,isBuy:jn.b})}}const Jn=Array.from(zn.values()).map((Lt,jn)=>({id:Lt.time+"-"+(Lt.isBuy?"B":"S")+"-"+jn,time:Lt.time,color:Lt.isBuy?mfn:xfn,label:Lt.isBuy?"B":"S",labelFontColor:Lt.isBuy?EHe:_He,text:Lt.isBuy?"Buy":"Sell",minSize:16,borderWidth:1,hoveredBorderWidth:2})).sort((Lt,jn)=>Lt.time-jn.time);return Zt=lr,zt=Jn,Et=null,Jn}catch{return Et=null,[]}})()};const Qt=await Et.promise;an(Qt)},getTimescaleMarks:(sn,Me,en,an)=>an([]),subscribeBars:(sn,Me,en,an)=>{const Nt=sn.ticker||sn.name,Yn=XP[Me]||"1m";if(jt[an]=en,ht=Yn,je==="lighter"){Kn(an);const xn=Fj[ht]||60,Mt=Math.max(2e3,Math.min(15e3,Math.floor(xn*1e3/3)));let tn=0;const In=async()=>{try{const Xn=Math.floor(Date.now()/1e3),or=Xn-xn*500,lr=await yn(Ie,ht,or,Xn);if(!Array.isArray(lr)||!lr.length)return;const Qt=lr[lr.length-1];if(!Number.isFinite(Qt.time))return;if(Qt.time>tn){tn=Qt.time;const zn=jt[an];zn&&zn(Qt)}}catch{}};In(),cn[an]=setInterval(In,Mt);return}if(je==="extended"){if(bb(Nt))return;const xn=We(Nt);if(!xn)return;const Mt=Rt(Yn);if(nn=`${ofn}/stream.extended.exchange/v1/candles/${encodeURIComponent(xn)}/trades?interval=${encodeURIComponent(Mt)}`,ft){try{ft.close()}catch{}ft=null}dn();return}if(je==="hyperliquid")if(bb(Nt)){const xn=String(Nt).split("/"),Mt=xn[0],tn=xn[1];on(Mt,tn,Yn)}else{if(It={type:"candle",coin:Nt,interval:Yn},lt){try{lt.close()}catch{}lt=null}Tt()}},unsubscribeBars:sn=>{delete jt[sn],Kn(sn)},cleanup:()=>{try{lt&<.close()}catch{}try{ft&&ft.close()}catch{}try{ut&&ut.close()}catch{}try{qt&&qt.close()}catch{}Cn(),Zt="",zt=[],Et=null,nt=null,Ue=null,nn=null}}}const fe=ae(s||null,ye=>{ee=ye},o,l,c,u,o==="extended"?d:null);g.current=fe;let Ne=null;if(typeof window<"u"){const ye=window.localStorage.getItem(nSe);if(ye)try{Ne=rSe(JSON.parse(ye))}catch{}}const he={container:f.current.id,library_path:r,datafeed:fe,autosize:!0,theme:"dark",locale:"en",timezone:re,loading_screen:{backgroundColor:"#101010"},enabled_features:["timeframes_toolbar","two_character_bar_marks_labels"],disabled_features:["header_symbol_search","symbol_search_hot_key","header_interval_dialog_button","header_settings","header_fullscreen_button","header_compare","header_undo_redo"],auto_save_delay:5,custom_formatters:{price:ye=>Number(ye).toLocaleString("en-US",{minimumFractionDigits:ee,maximumFractionDigits:ee})},custom_css_url:"/tv-custom.css",overrides:{"paneProperties.background":"#101010","paneProperties.backgroundGradientStartColor":"#101010","paneProperties.backgroundGradientEndColor":"#101010","paneProperties.vertGridProperties.color":"#202020","paneProperties.horzGridProperties.color":"#202020","scalesProperties.textColor":"#dcdada","scalesProperties.abbreviateLabel":!1,"mainSeriesProperties.candleStyle.upColor":"#67FFBD","mainSeriesProperties.candleStyle.downColor":"#FF7272","mainSeriesProperties.candleStyle.borderUpColor":"#67FFBD","mainSeriesProperties.candleStyle.borderDownColor":"#FF7272","mainSeriesProperties.candleStyle.wickUpColor":"#67FFBD","mainSeriesProperties.candleStyle.wickDownColor":"#FF7272","timeScale.rightOffset":100,"scalesProperties.allowSymbolChange":!0,"scalesProperties.backgroundColor":"#101010","scalesProperties.showLeftScale":!1,"scalesProperties.showRightScale":!0,"scalesProperties.vertTouchDrag":!0,"scalesProperties.vertScrollZoom":!0}};Ne?he.saved_data=Ne:(he.symbol=e,he.interval=ie);const ge=new window.TradingView.widget(he);x.current=ge,ge.onChartReady(()=>{const ye=ge.activeChart(),ve=()=>{var Ie;try{(Ie=ye.autoScaleAllSeries)==null||Ie.call(ye)}catch{}},je=()=>{!ge||!ge.save||typeof window>"u"||ge.save(Ie=>{try{const Le=rSe(Ie||{});window.localStorage.setItem(nSe,JSON.stringify(Le||{}))}catch{}})};if(!Ne)try{const Ie=Math.floor(Date.now()/1e3);ye.setVisibleRange({from:Ie-30*24*3600,to:Ie},{percentRightMargin:.2}),ve()}catch{}try{ye.setEntityMarksVisible(!0)}catch{}ye.onIntervalChanged().subscribe(null,Ie=>{try{const Le=XP[Ie]||Ie||ie;Le&&typeof window<"u"&&window.localStorage.setItem("tranding_chart_interval_time",Le)}catch{}try{ye.requestMarksRefresh()}catch{}je()}),ge.subscribe("onAutoSaveNeeded",()=>{je()}),je(),C(!0)})})(),()=>{G=!1;const V=x.current,ee=g.current;try{const ae=V&&V.activeChart&&V.activeChart();ae&&(ZP(v.current,V,ae),v.current.clear(),ZP(U.current,V,ae),U.current.clear())}catch{}try{ee&&ee.cleanup&&ee.cleanup()}catch{}try{V&&V.remove&&V.remove()}catch{}x.current=null,g.current=null,C(!1)}},[r,o,l,c,e,t,s]),m.useEffect(()=>{if(!g.current)return;g.current.setWallet(s||null);const G=x.current;if(!G||!w)return;const V=G.activeChart&&G.activeChart();if(V)try{V.requestMarksRefresh&&V.requestMarksRefresh()}catch{}},[s,w]),m.useEffect(()=>{g.current&&typeof g.current.setExtendedApiKey=="function"&&g.current.setExtendedApiKey(o==="extended"&&d||null)},[d,o]),m.useEffect(()=>{if(!g.current||o!=="extended")return;const G=g.current.setExtendedFallbackPrice;typeof G=="function"&&G(u)},[u,o]),m.useEffect(()=>{if(!w||o!=="hyperliquid"&&o!=="extended")return;const G=x.current,V=G&&G.activeChart&&G.activeChart();if(!V||!V.createMultipointShape)return;const ee=v.current;ZP(ee,G,V),ee.clear();const ae=Array.isArray(X)?X:[];if(!ae.length)return;const fe=V.getVisibleRange&&V.getVisibleRange(),Ne=Math.floor(Date.now()/1e3),he=fe&&fe.to||Ne,ge=new Map;for(const ye of ae){const ve=Sue(ye);if(!Number.isFinite(ve)||ve<=0)continue;const je=ye.sideRaw==="S"?"S":"B",Ie=/take\s*profit/i.test(String(ye.type||"")),Le=/stop/i.test(String(ye.type||"")),$e=`${ve}|${je}|${Ie?"TP":Le?"SL":"L"}`,it=THe(ye);if(!ge.has($e))ge.set($e,{base:ye,px:ve,sz:it});else{const tt=ge.get($e);tt.sz+=it}}ge.forEach(({base:ye,px:ve,sz:je})=>{const Ie=Tfn(ye),Le={...ye,sz:je},Qe=kfn(Le,e),$e={time:he,price:ve};try{const it=V.createMultipointShape([$e],{shape:"horizontal_line",text:Qe,lock:!0,disableSelection:!0,disableSave:!0,overrides:{linecolor:Ie.br,linewidth:1,linestyle:2,extendLeft:!0,extendRight:!0,showLabel:!0,textcolor:Ie.txt,fillBackground:!0,backgroundColor:Ie.bg,bold:!1,fontsize:11}}),tt=Ifn(Le,e);v.current.set(tt,it)}catch{}})},[X,w,e,o]),m.useEffect(()=>{if(!w||X.length>0)return;const G=x.current,V=G&&G.activeChart&&G.activeChart();if(!V)return;let ee=null;try{const ge=V.getPanes&&V.getPanes();if(Array.isArray(ge)&&ge[0]){const ye=ge[0].getRightPriceScales&&ge[0].getRightPriceScales();Array.isArray(ye)&&ye[0]?ee=ye[0]:ge[0].getMainSourcePriceScale&&(ee=ge[0].getMainSourcePriceScale())}}catch{}const ae=U.current;if(ZP(ae,G,V),ae.clear(),!Array.isArray(a)){try{ee&&ee.setAutoScale(!0)}catch{}return}const fe=V.getVisibleRange&&V.getVisibleRange(),Ne=Math.floor(Date.now()/1e3),he=fe&&fe.to||Ne;if(a.forEach((ge,ye)=>{const ve=Number(typeof ge=="number"?ge:ge&&ge.price);if(!Number.isFinite(ve)||ve<=0)return;const je=typeof ge=="object"&&ge?ge.side:null,Ie=je==="buy"?"#1EC98A":je==="sell"?"#FF5C7A":"#444CFF";try{const Le=V.createMultipointShape([{time:he,price:ve}],{shape:"horizontal_line",lock:!0,disableSelection:!0,disableSave:!0,text:"",overrides:{linecolor:Ie,linewidth:1,linestyle:2,extendLeft:!0,extendRight:!0,showLabel:!1,fillBackground:!1}});ae.set(`grid-${e}-${ye}-${ve}`,Le)}catch{}}),ee)try{ee.setAutoScale(!0)}catch{}},[a,w,e,X.length]);const oe=n||`tv_${e}_container`;return i.jsx("div",{id:oe,ref:f,className:"relative h-full min-h-[320px] w-full bg-[#101010]"})}const Ffn=({headerData:e,setIsDigits:t,markets:n=[],coin:r="",onCoinChange:s=()=>{},marketsLoading:a=!1})=>{const o=(e==null?void 0:e.source)==="extended",l=(e==null?void 0:e.nextFundingTime)??(e==null?void 0:e.nextFundingRate),[c,u]=m.useState(EX(l)),[d,f]=m.useState((e==null?void 0:e.markPx)||0),[x,g]=m.useState("text-white"),v=m.useRef((e==null?void 0:e.markPx)||0);m.useEffect(()=>{var ne;if((e==null?void 0:e.markPx)!=null){const J=((ne=e.markPx.toString().split(".")[1])==null?void 0:ne.length)||0;t(J)}},[e==null?void 0:e.markPx,t]),m.useEffect(()=>{u(EX(l));const ne=setInterval(()=>u(EX(l)),1e3);return()=>clearInterval(ne)},[l]),m.useEffect(()=>{if((e==null?void 0:e.markPx)==null)return;const ne=e.markPx,J=v.current;ne>J?g("text-[#1DE6A3]"):ne<J&&g("text-[#FF7173]"),f(ne);const X=setTimeout(()=>g("text-white"),700);return v.current=ne,()=>clearTimeout(X)},[e==null?void 0:e.markPx]);const w=(e==null?void 0:e.markPx)!=null&&(e==null?void 0:e.prevDayPx)!=null?e.markPx-e.prevDayPx:null,C=w!=null?w/e.prevDayPx*100:null,N=C!=null?C>=0?"text-[#1DE6A3]":"text-[#FF7173]":"text-white",P=ne=>{const J=Number(ne);if(!Number.isFinite(J))return null;const X=Math.abs(J);let re=1;return X>=1e3?re=1:X>=100?re=2:X>=1?re=3:X>=.1?re=4:re=6,J.toLocaleString(void 0,{maximumFractionDigits:re})},I=ne=>ne==null||isNaN(ne)?null:ne>=1e3?Ww(ne):ne,R=ne=>{const J=Number(ne);if(!Number.isFinite(J))return null;const X=Math.abs(J),re=J>=0?"+":"-";if(!o)return`${re}${X.toFixed(5)}`;let pe=0;X<.1?pe=6:X<1?pe=4:X<10?pe=2:X<100&&(pe=1);const Y=X.toFixed(pe),ie=pe>0?Y.replace(/\.?0+$/,""):Y;return`${re}${ie}`},F=w!=null?R(w):null,U=d!=null?o?P(d):I(d):null,L=(e==null?void 0:e.dayNtlVlm)!=null?`$${Ww(Number(e.dayNtlVlm))}`:null,z=(e==null?void 0:e.oraclePx)!=null&&(e==null?void 0:e.openInterest)!=null?`$${Ww(Number(e.oraclePx*e.openInterest))}`:null,Q=(e==null?void 0:e.funding)!=null?`${(e.funding*100).toFixed(4)}%`:null;return i.jsxs("div",{className:"flex items-center w-full gap-2",children:[i.jsx("div",{className:"flex-none",children:i.jsx(yue,{markets:n,value:r,onChange:s,loading:a,showIcon:!0})}),i.jsx("div",{className:"flex-1 overflow-x-auto whitespace-nowrap [-ms-overflow-style:none] [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:i.jsxs("div",{className:"flex items-center px-1",children:[i.jsx(Q7,{label:"Mid Price",value:U,tone:x}),i.jsx(Q7,{label:"24h Change",value:F,sub:C!=null?`${C>=0?"+":"-"}${Math.abs(C).toFixed(2)}%`:null,tone:N}),i.jsx(Q7,{label:"Vol 24h",value:L}),i.jsx(Q7,{label:"Open Interest",value:z}),i.jsx(Q7,{label:"Funding",value:Q,sub:e!=null&&e.funding?c:null,tone:"text-[#50D2C1]"})]})})]})};function EX(e){const t=new Date,n=t.getTime(),r=Number(e);if(Number.isFinite(r)&&r>n){const d=Math.max(0,Math.floor((r-n)/1e3)),f=String(Math.floor(d/3600)).padStart(2,"0"),x=String(Math.floor(d%3600/60)).padStart(2,"0"),g=String(d%60).padStart(2,"0");return`${f}:${x}:${g}`}t.setSeconds(t.getSeconds()+1);const s=Date.UTC(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate(),t.getUTCHours(),t.getUTCMinutes(),t.getUTCSeconds()),a=Date.UTC(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate(),t.getUTCHours()+1,0,0,0),o=Math.floor((a-s)/1e3),l=String(Math.floor(o/3600)).padStart(2,"0"),c=String(Math.floor(o%3600/60)).padStart(2,"0"),u=String(o%60).padStart(2,"0");return`${l}:${c}:${u}`}const Q7=({label:e,value:t,sub:n=null,tone:r="text-white"})=>i.jsxs("div",{className:"shrink-0 inline-flex items-baseline gap-1 pr-3 mr-3 border-r border-white/5 last:mr-0 last:pr-0 last:border-r-0",children:[i.jsx("span",{className:"text-[11px] leading-none text-[#909090]",children:e}),i.jsx("span",{className:`text-xs leading-none font-semibold font-inter tabular-nums ${r}`,children:t??i.jsx(Ofn,{w:"90px"})}),n!=null&&i.jsx("span",{className:`text-[11px] leading-none ${r}`,children:n})]}),Ofn=({w:e="90px"})=>i.jsx("span",{className:"inline-block align-middle h-[12px] rounded skeleton-ticker-text short",style:{width:e}}),Mfn=({coin:e,data:t,loading:n,period:r,periods:s,handlePeriodChange:a})=>i.jsx("div",{className:"flex justify-start items-start p-4 w-full",children:i.jsxs("div",{className:"flex flex-col items-start justify-center gap-4 w-full",children:[i.jsxs("div",{className:"flex flex-col items-start justify-center gap-[12px] w-full",children:[i.jsxs("div",{className:"flex justify-between items-center w-full",children:[i.jsxs("div",{className:"flex justify-start items-center gap-0.5 xl:gap-2 w-full",children:[i.jsx("div",{className:"text-[#dcdada] text-[11px] xl:text-sm font-semibold font-inter leading-4 tracking-wider uppercase",children:"Positioning"}),n&&i.jsxs("div",{role:"status",className:"flex justify-center items-center h-5 min-h-5 w-[32px] xl:w-[54px] px-0.5 xl:px-2 py-1.5 rounded-md",children:[i.jsxs("svg",{"aria-hidden":"true",className:"inline w-4 h-4 text-gray-200 animate-spin dark:text-gray-600 fill-[#67FFBD]",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),i.jsx("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]}),i.jsx("span",{className:"sr-only",children:"Loading..."})]})]}),i.jsx("div",{className:"flex xl:hidden",children:i.jsx(Ice,{periods:s,selectedPeriod:r,handlePeriod:a,borderColor:"ticker"})})]}),i.jsxs("div",{className:"flex flex-col items-start justify-center gap-1.5 w-full min-w-full border border-[#333333] rounded-lg p-1.5",children:[i.jsx(Fp,{name:"Total Positions",info:t!=null&&t.total_notional?`$${ed(t==null?void 0:t.total_notional)}`:"--",color:1}),i.jsx(Fp,{name:"Traders",info:t!=null&&t.total_traders?`${ed(t==null?void 0:t.total_traders)}`:"--",color:1,info_1:"true"}),i.jsx(One,{data_1:t!=null&&t.long_percentage?t==null?void 0:t.long_percentage:0,data_2:t!=null&&t.long_percentage?parseFloat(100-(t==null?void 0:t.long_percentage)).toFixed(2):0,margin:"true"})]})]}),i.jsxs("div",{className:"flex flex-col items-start justify-center gap-[12px] w-full",children:[i.jsx("div",{className:"text-[#dcdada] text-[11px] xl:text-sm font-semibold font-inter leading-4 tracking-wider uppercase",children:"Breakdown"}),i.jsxs("div",{className:"flex flex-col items-start justify-center gap-1.5 w-full min-w-full border border-[#333333] rounded-lg p-1.5",children:[i.jsx(Fp,{name:"Long",info:t!=null&&t.long_qty?`${Er(t==null?void 0:t.long_qty)} ${e}`:"--",color:2}),i.jsx(Fp,{name:"Total",info:t!=null&&t.total_qty?`${Er(t==null?void 0:t.total_qty)} ${e}`:"--",color:1}),i.jsx(Fp,{name:"Short",info:t!=null&&t.short_qty?`${Er(t==null?void 0:t.short_qty)} ${e}`:"--",color:3,info_1:"true"}),i.jsx(One,{data_1:t!=null&&t.long_pct?t==null?void 0:t.long_pct:0,data_2:t!=null&&t.short_pct?t==null?void 0:t.short_pct:0})]})]}),i.jsxs("div",{className:"flex flex-col items-start justify-center gap-[12px] w-full",children:[i.jsx("div",{className:"text-[#dcdada] text-[11px] xl:text-sm font-semibold font-inter leading-4 tracking-wider uppercase",children:"Position Stats"}),i.jsxs("div",{className:"flex flex-col items-start justify-center gap-1.5 w-full min-w-full border border-[#67FFBD] rounded-lg p-3",children:[i.jsxs("div",{className:"flex justify-start items-center gap-2 pb-2.5",children:[i.jsx("div",{className:"text-[#67FFBD] text-[10px] font-semibold font-inter leading-[10px] tracking-wide uppercase",children:"Long"}),i.jsx("img",{src:gJ,alt:""})]}),i.jsx(Fp,{name:"Total Notional",info:t!=null&&t.total_long_notional?`$${ed(t==null?void 0:t.total_long_notional)}`:"--",color:1}),i.jsx(Fp,{name:"Avg Entry",info:t!=null&&t.avg_long_entry?`$${Er(t==null?void 0:t.avg_long_entry)}`:"--",color:1}),i.jsx(Fp,{name:"Total PnL",info:t!=null&&t.total_long_pnl?`$${ed(Math.abs(t==null?void 0:t.total_long_pnl))}`:"--",color:(t==null?void 0:t.total_long_pnl)==null||isNaN(parseFloat(t==null?void 0:t.total_long_pnl))||(t==null?void 0:t.total_long_pnl)==0?1:(t==null?void 0:t.total_long_pnl)>0?2:3,info_1:"true"}),i.jsxs("div",{className:"flex justify-start items-center gap-2 w-full mt-3",children:[i.jsx(iSe,{data_1:t!=null&&t.long_profit_ratio?t==null?void 0:t.long_profit_ratio:0,color:"Long"}),i.jsxs("div",{className:"text-[#7b7b7b] text-[11px] font-normal font-['Inter'] leading-none min-w-max flex justify-start items-center",children:[t!=null&&t.long_profit_ratio?t==null?void 0:t.long_profit_ratio:"--","% in profit"]})]})]}),i.jsxs("div",{className:"flex flex-col items-start justify-center gap-1.5 w-full min-w-full border border-[#FF797C] rounded-lg p-3",children:[i.jsxs("div",{className:"flex justify-start items-center gap-2 pb-2.5",children:[i.jsx("div",{className:"text-[#FF797C] text-[10px] font-semibold font-inter leading-[10px] tracking-wide uppercase",children:"Short"}),i.jsx("img",{src:bJ,alt:""})]}),i.jsx(Fp,{name:"Total Notional",info:t!=null&&t.total_short_notional?`$${ed(t==null?void 0:t.total_short_notional)}`:"--",color:1}),i.jsx(Fp,{name:"Avg Entry",info:t!=null&&t.avg_short_entry?`$${Er(t==null?void 0:t.avg_short_entry)}`:"--",color:1}),i.jsx(Fp,{name:"Total PnL",info:t!=null&&t.total_short_pnl?`$${ed(Math.abs(t==null?void 0:t.total_short_pnl))}`:"--",info_1:"true",color:(t==null?void 0:t.total_short_pnl)==null||isNaN(parseFloat(t==null?void 0:t.total_short_pnl))||(t==null?void 0:t.total_short_pnl)==0?1:(t==null?void 0:t.total_short_pnl)>0?2:3}),i.jsxs("div",{className:"flex justify-start items-center gap-2 w-full mt-3",children:[i.jsx(iSe,{data_1:t!=null&&t.short_profit_ratio?t==null?void 0:t.short_profit_ratio:0,color:"Short"}),i.jsxs("div",{className:"text-[#7b7b7b] text-[11px] font-normal font-['Inter'] leading-none min-w-max flex justify-start items-center",children:[t!=null&&t.short_profit_ratio?t==null?void 0:t.short_profit_ratio:"--","% in profit"]})]})]})]})]})}),Fp=({name:e,info:t,info_1:n,color:r})=>i.jsxs("div",{className:"flex flex-col items-start w-full gap-1.5",children:[i.jsxs("div",{className:"flex justify-between items-center w-full",children:[i.jsx("div",{className:"text-[#b0b0b0] text-xs font-semibold font-inter leading-none",children:e}),i.jsx("div",{className:`${r==1?"bg-[#313137] text-white":r==2?"bg-[#1de6a3]/20 text-[#67ffbd]":r==3?"bg-[#ff797c]/20 text-[#ff787b]":""} h-6 p-2 rounded-[256px] justify-start items-center gap-2 inline-flex`,children:i.jsx("div",{className:"text-[11px] font-semibold font-inter leading-none",children:t})})]}),i.jsx("div",{className:`${n==="true"?"hidden":""} w-full h-px bg-[#282d33]`})]}),iSe=({data_1:e,color:t})=>i.jsx("div",{className:"h-1 w-full bg-[#333333] rounded-[256px] flex gap-[2px] overflow-hidden",children:i.jsx("div",{style:e?isNaN(e)?{width:"0%"}:{width:`${e}%`}:{width:"0%"},className:`${t=="Long"?"bg-[#67FFBD]":t=="Short"?"bg-[#FF797C]":"bg-[#67FFBD]"} flex justify-center items-center h-1 rounded-[256px] text-[11px] font-bold font-inter leading-[8px] tracking-[0.18px]`})}),Rfn="wss://api.hyperliquid.xyz/ws",Lfn="https://api.hyperliquid.xyz/info",ZL=e=>e==null?0:Number(e),JL=(e,t=6)=>isNaN(e)?"--":e.toLocaleString(void 0,{maximumFractionDigits:t}),Dfn=(e,t)=>{if(isNaN(e))return"--";const n=Number(t);let r=0;return n>0&&n<1&&(r=Math.min(8,Math.max(0,-Math.floor(Math.log10(n))))),e.toLocaleString(void 0,{minimumFractionDigits:0,maximumFractionDigits:r})},Bfn=e=>{if(e>=1)return e.toLocaleString();const t=Math.min(8,Math.max(0,-Math.floor(Math.log10(e))));return e.toFixed(t)},IHe={BTC:{1:{value:1,nSigFigs:null,mantissa:null},10:{value:2,nSigFigs:5,mantissa:null},20:{value:5,nSigFigs:5,mantissa:2},50:{value:10,nSigFigs:5,mantissa:5},100:{value:100,nSigFigs:3,mantissa:null},1e3:{value:1e3,nSigFigs:2,mantissa:null}},ETH:{.1:{value:.1,nSigFigs:null,mantissa:null},.2:{value:.2,nSigFigs:5,mantissa:2},.5:{value:.5,nSigFigs:5,mantissa:5},1:{value:1,nSigFigs:4,mantissa:null},10:{value:10,nSigFigs:3,mantissa:null},100:{value:100,nSigFigs:2,mantissa:null}}},$fn=e=>{if(!e)return null;const t=String(e).toUpperCase(),n=IHe[t];return n?Object.values(n).map(s=>s.value).filter(s=>Number.isFinite(s)&&s>0).sort((s,a)=>s-a):null},Ufn=(e,t)=>{if(!e)return null;const n=String(e).toUpperCase(),r=IHe[n];if(!r)return null;const s=Number(t)||0;return Object.values(r).find(l=>l.value===s)||null};function aSe(e,t,n){const r=new Map;for(const s of e||[]){const a=ZL(s.px),o=ZL(s.sz);if(!a||!o||!t)continue;const l=n==="bid"?Math.floor(a/t)*t:Math.ceil(a/t)*t,c=Number(l.toFixed(12));r.set(c,(r.get(c)||0)+o)}return[...r.entries()].map(([s,a])=>({price:s,size:a}))}async function zfn(e){var o;const n=await fetch(Lfn,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"l2Book",coin:e})});if(!n.ok)throw new Error("info request failed");const r=await n.json(),s=(r==null?void 0:r.levels)||((o=r==null?void 0:r.data)==null?void 0:o.levels),a=Array.isArray(s==null?void 0:s[0])&&s[0]||(s==null?void 0:s.bs)||(s==null?void 0:s.bids)||[];if(!Array.isArray(a)||!a.length)throw new Error("orderbook empty or bad format");return a}function Hfn(e){const t=e.slice(0,10).map(o=>Number(o.px??(Array.isArray(o)?o[0]:void 0))).filter(o=>Number.isFinite(o)),n=[];for(let o=0;o<t.length-1;o++){const l=t[o]-t[o+1];l>0&&n.push(l)}if(!n.length)return 0;const s=Math.min(...n).toFixed(18).replace(/0+$/g,"").replace(/\.$/,""),a=Number(s);return Number.isFinite(a)?a:0}function Vfn(e){const t=e.toFixed(18).replace(/0+$/g,"").replace(/\.$/,""),n=Number(t);return Number.isFinite(n)?n:0}function Wfn(e,t){if(!e||e<=0)return[];const n=Math.floor(Math.log10(e)),r=[];t>0&&r.push(t);const s=n-4,a=Math.pow(10,s);[1,2,5].forEach(g=>r.push(g*a));const o=n-3;r.push(Math.pow(10,o));const l=n-2;r.push(Math.pow(10,l));const c=n-1;r.push(Math.pow(10,c));const u=r.filter(g=>g>0&&Number.isFinite(g)).map(Vfn),d=Array.from(new Set(u)).sort((g,v)=>g-v),f=t>0?t:0;return d.filter(g=>g>=f&&g>0)}function oSe(e){const n=(e||"").toUpperCase()==="BTC"?[1,10,20,50,100,1e3,1e4]:[.001,.01,.1,10,100];return Array.from(new Set(n)).sort((r,s)=>r-s)}async function qfn(e){if(!e)return[];const t=String(e).trim(),n=$fn(t);if(n&&n.length)return n;const r=t.toUpperCase();try{const s=await zfn(t),a=s[0],o=Number((a==null?void 0:a.px)??(Array.isArray(a)?a[0]:void 0));if(!Number.isFinite(o)||o<=0)throw new Error("bad bestBid");const l=Hfn(s);let c=Wfn(o,l);return r!=="BTC"?c=c.filter(u=>u!==1):c.includes(1)||c.push(1),c=Array.from(new Set(c.filter(u=>Number.isFinite(u)&&u>0))).sort((u,d)=>u-d),c.length?c:oSe(t)}catch(s){return console.error("getUiStepsForCoin error",t,s),oSe(t)}}function Gfn(e,t){const n=Ufn(t,e);if(n)return{nSigFigs:n.nSigFigs,mantissa:n.mantissa};const r=Number(e)||0;let s=null;r>=1e4?s=2:r>=1e3?s=3:r>=100?s=4:r>=10&&(s=5);let a;if(s===5&&r>=10){const o=Math.pow(10,Math.floor(Math.log10(r))),l=Math.floor(r/o);l<2?a=1:l<5?a=2:a=5}return{nSigFigs:s,mantissa:a}}function Kfn(e,t){return!e&&!t?!0:!e||!t?!1:e.type===t.type&&e.coin===t.coin&&(e.nSigFigs??null)===(t.nSigFigs??null)&&(e.mantissa??null)===(t.mantissa??null)}function Yfn({coin:e,rows:t=10,onSelectPrice:n,onBest:r}){const s=m.useRef(null),a=m.useRef([]),o=m.useRef(null),l=m.useRef(0),c=m.useRef(null),u=m.useRef(null),[d,f]=m.useState({bids:[],asks:[]}),[x,g]=m.useState("COIN"),[v,w]=m.useState(null),[C,N]=m.useState([]),P=(G,V)=>x==="USD"?G*V:G,I=x==="USD"?"USD":e,R=G=>{const V=s.current;V&&V.readyState===WebSocket.OPEN?V.send(JSON.stringify(G)):(a.current.push(G),F())},F=()=>{const G=s.current;if(G&&(G.readyState===WebSocket.OPEN||G.readyState===WebSocket.CONNECTING)||o.current)return;const V=new WebSocket(Rfn);s.current=V,V.onopen=()=>{l.current=0,a.current.splice(0,a.current.length).forEach(ae=>V.send(JSON.stringify(ae)))},V.onmessage=ee=>{var Le;const ae=JSON.parse(ee.data||"{}");if((ae==null?void 0:ae.channel)!=="l2Book")return;const fe=(ae==null?void 0:ae.data)??ae,Ne=(fe==null?void 0:fe.coin)??(ae==null?void 0:ae.coin);if(!Ne||Ne!==c.current)return;const he=(fe==null?void 0:fe.levels)??((Le=fe==null?void 0:fe.data)==null?void 0:Le.levels)??(ae==null?void 0:ae.levels);let ge,ye;if(Array.isArray(he))ge=he[0]||[],ye=he[1]||[];else if(he)ge=he.bs||he.bids||[],ye=he.as||he.asks||[];else return;const ve=Qe=>(Qe||[]).map($e=>{const it=Number(Array.isArray($e)?$e[0]:$e.px),tt=Number(Array.isArray($e)?$e[1]:$e.sz);return{px:it,sz:tt}}).filter($e=>Number.isFinite($e.px)&&$e.px>0&&Number.isFinite($e.sz)&&$e.sz>0),je=ve(ge),Ie=ve(ye);f({bids:je,asks:Ie})},V.onclose=()=>{l.current=Math.min(l.current+1,6),o.current=setTimeout(()=>{o.current=null,F()},500*Math.pow(2,l.current))},V.onerror=()=>{try{V.close()}catch{}}},U=G=>{G&&(Kfn(u.current,G)||(u.current&&R({method:"unsubscribe",subscription:u.current}),u.current=G,R({method:"subscribe",subscription:G})))},L=()=>{f({bids:[],asks:[]})};m.useEffect(()=>{let G=!1;try{s.current&&s.current.readyState<=1&&(s.current.onmessage=null,s.current.onopen=null,s.current.onclose=null,s.current.onerror=null,s.current.close())}catch{}if(s.current=null,u.current=null,a.current=[],l.current=0,o.current=null,L(),N([]),w(null),c.current=e||null,!!e)return F(),(async()=>{const V=await qfn(e);G||(N(V),w(V[0]??null))})(),()=>{G=!0}},[e]),m.useEffect(()=>{if(!e)return;const G=v||1,{nSigFigs:V,mantissa:ee}=Gfn(G,e),ae={type:"l2Book",coin:e};V!=null&&(ae.nSigFigs=V),ee!=null&&(ae.mantissa=ee),U(ae)},[e,v]);const z=m.useMemo(()=>(d.bids||[]).map(G=>ZL(G.px)).filter(G=>Number.isFinite(G)&&G>0),[d]),Q=m.useMemo(()=>(d.asks||[]).map(G=>ZL(G.px)).filter(G=>Number.isFinite(G)&&G>0),[d]),ne=z.length?Math.max(...z):null,J=Q.length?Math.min(...Q):null;m.useEffect(()=>{ne!=null&&J!=null&&(r==null||r({bestBid:ne,bestAsk:J,mid:(ne+J)/2}))},[ne,J,r]);const X=m.useMemo(()=>{const G=Number(v)||1,V=aSe(d.bids,G,"bid").sort((ae,fe)=>fe.price-ae.price),ee=aSe(d.asks,G,"ask").sort((ae,fe)=>ae.price-fe.price);return{bids:V,asksAsc:ee}},[d,v]),re=m.useMemo(()=>{const G=X.asksAsc.slice(0,t);let V=0;return G.map(ae=>(V+=P(ae.size,ae.price),{...ae,total:V})).reverse()},[X,t,x]),pe=m.useMemo(()=>{const G=X.bids.slice(0,t);let V=0;return G.map(ee=>(V+=P(ee.size,ee.price),{...ee,total:V}))},[X,t,x]),Y=m.useMemo(()=>{if(ne==null||J==null)return null;const G=Math.abs(J-ne),V=(J+ne)/2;return{diff:G,pct:V?G/V*100:0}},[ne,J]),ie=Math.max(re.reduce((G,V)=>Math.max(G,V.total||0),0),1e-9),oe=Math.max(pe.reduce((G,V)=>Math.max(G,V.total||0),0),1e-9);return i.jsxs("div",{className:"flex flex-col h-full w-full font-semibold font-inter",children:[i.jsxs("div",{className:"flex items-center justify-between px-3 py-2 border-b border-[#292929]",children:[i.jsx(cSe,{value:String(v??""),onChange:G=>w(Number(G)),items:(C||[]).map(G=>({key:String(G),label:Bfn(G)}))}),i.jsx(cSe,{value:x,onChange:g,items:[{key:"USD",label:"USD"},{key:"COIN",label:e}],align:"right"})]}),i.jsxs("div",{className:"grid grid-cols-[84px_1fr_1fr] px-3 py-2 text-[11px] text-[#9b9b9b] w-full",children:[i.jsx("span",{className:"uppercase",children:"Price"}),i.jsxs("span",{className:"uppercase text-center",children:["Size (",I,")"]}),i.jsxs("span",{className:"uppercase text-right",children:["Total (",I,")"]})]}),i.jsx("div",{className:"flex-1 overflow-hidden w-full",children:i.jsxs("div",{className:"overflow-auto w-full",children:[re.map((G,V)=>i.jsx(lSe,{side:"ask",step:Number(v)||1,price:G.price,size:G.size!=null?P(G.size,G.price):null,total:G.total,widthPct:G.total?Math.min(100,G.total/ie*100):0,onClick:()=>G.price!=null&&(n==null?void 0:n(G.price)),unit:x},`ask-${V}`)),i.jsxs("div",{className:"grid grid-cols-[84px_1fr_1fr] px-3 py-2 text-[11px] text-[#9b9b9b] border-y border-[#292929] my-1 w-full",children:[i.jsx("span",{className:"uppercase",children:"Spread"}),i.jsx("span",{className:"text-right",children:Y?JL(Y.diff,4):"--"}),i.jsx("span",{className:"text-right",children:Y?`${JL(Y.pct,4)}%`:"--"})]}),pe.map((G,V)=>i.jsx(lSe,{side:"bid",step:Number(v)||1,price:G.price,size:G.size!=null?P(G.size,G.price):null,total:G.total,widthPct:G.total?Math.min(100,G.total/oe*100):0,onClick:()=>G.price!=null&&(n==null?void 0:n(G.price)),unit:x},`bid-${V}`))]})})]})}function lSe({side:e,price:t,size:n,total:r,widthPct:s,onClick:a,step:o,unit:l}){const c=t==null,u=e==="bid"?"from-transparent to-[#67ffbd]/30":"from-transparent to-[#FF7272]/30",d=e==="bid"?"text-[#67FFBD]":"text-[#FF797C]",f=l==="USD";return i.jsxs("div",{className:"relative w-full font-semibold",children:[!c&&i.jsx("div",{className:`absolute left-0 top-px bottom-px bg-gradient-to-r ${u} transition-all duration-300 ease-[cubic-bezier(0.42,0,0.58,1)]`,style:{width:`${Math.max(0,s-2)}%`}}),i.jsxs("div",{className:`grid grid-cols-[84px_1fr_1fr] px-3 py-1 text-xs relative w-full ${c?"":"cursor-pointer"}`,onClick:c?void 0:a,children:[i.jsx("span",{className:`${c?"text-[#555]":d} hover:text-white`,children:c?"—":Dfn(t,o)}),i.jsx("span",{className:"text-center text-[#dcdada] hover:text-white",children:c?"—":JL(n,f?0:6)}),i.jsx("span",{className:"text-right text-[#a8a8a8] hover:text-white",children:c?"—":JL(r,f?0:6)})]})]})}function cSe({value:e,onChange:t,items:n,align:r="left"}){var l,c;const[s,a]=m.useState(!1),o=m.useRef(null);return m.useEffect(()=>{if(!s)return;const u=d=>{o.current&&(o.current.contains(d.target)||a(!1))};return window.addEventListener("mousedown",u),window.addEventListener("touchstart",u),()=>{window.removeEventListener("mousedown",u),window.removeEventListener("touchstart",u)}},[s]),i.jsxs("div",{className:"relative",ref:o,children:[i.jsxs("button",{className:"h-7 px-2 text-xs rounded-md border border-[#292929] bg-[#101010] text-[#dcdada] flex items-center gap-1",onClick:()=>a(u=>!u),children:[((l=n.find(u=>u.key===e))==null?void 0:l.label)??((c=n.find(u=>String(u.key)===String(e)))==null?void 0:c.label)??e,i.jsx("span",{className:"text-[#8b8b8b]",children:"▾"})]}),s&&i.jsx("div",{className:`absolute z-10 mt-1 min-w-[80px] rounded-md border border-[#292929] bg-[#101010] p-1 ${r==="right"?"right-0":"left-0"}`,children:n.map(u=>i.jsx("div",{className:`px-2 py-1 text-xs rounded cursor-pointer ${String(u.key)===String(e)?"bg-[#262626] text-white":"text-[#dcdada] hover:bg-[#262626]"}`,onClick:()=>{t(u.key),a(!1)},children:u.label},u.key))})]})}const Xfn="wss://api.hyperliquid.xyz/ws",Qfn=e=>`https://app.hyperliquid.xyz/explorer/tx/${e}`,uSe=e=>e==null?0:Number(e),Zfn=(e,t=6)=>isNaN(e)?"--":e.toLocaleString(void 0,{maximumFractionDigits:t}),Jfn=e=>isNaN(e)?"--":e.toLocaleString(void 0,{minimumFractionDigits:0,maximumFractionDigits:4}),ehn=e=>new Date(e).toLocaleTimeString([],{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"});function thn({coin:e,maxRows:t=300}){const n=m.useRef(null),r=m.useRef(null),s=m.useRef([]),a=m.useRef(null),[o,l]=m.useState([]);m.useEffect(()=>{var g,v;const u=w=>({method:"subscribe",subscription:{type:"trades",coin:w}}),d=w=>({method:"unsubscribe",subscription:{type:"trades",coin:w}});if(!n.current)n.current=new WebSocket(Xfn),n.current.onopen=()=>{var w;(w=n.current)==null||w.send(JSON.stringify(u(e))),a.current=setInterval(()=>{var C;try{(C=n.current)==null||C.send(JSON.stringify({method:"ping"}))}catch{}},3e4)};else{if(r.current&&r.current!==e)try{(g=n.current)==null||g.send(JSON.stringify(d(r.current)))}catch{}try{(v=n.current)==null||v.send(JSON.stringify(u(e)))}catch{}}const f=w=>{const C=JSON.parse(w.data||"{}");if((C==null?void 0:C.channel)==="trades"&&(C!=null&&C.data)){const N=Array.isArray(C.data)?C.data:[C.data];s.current.push(...N)}};n.current.addEventListener("message",f);const x=setInterval(()=>{if(!s.current.length)return;const w=s.current.splice(0,s.current.length);l(C=>{const N=[...w,...C],P=[],I=new Set;for(const R of N){const F=R.tid??`${R.hash??""}-${R.time??""}`;if(!I.has(F)&&(I.add(F),P.push(R),P.length>=t))break}return P.sort((R,F)=>(F.time||0)-(R.time||0)),P})},150);return r.current=e,()=>{var w;(w=n.current)==null||w.removeEventListener("message",f),clearInterval(x)}},[e,t]),m.useEffect(()=>()=>{var u;a.current&&clearInterval(a.current);try{(u=n.current)==null||u.close()}catch{}},[]);const c=m.useMemo(()=>o,[o]);return i.jsxs("div",{className:"flex flex-col h-full w-full font-semibold",children:[i.jsxs("div",{className:"grid grid-cols-[100px_1fr_90px_28px] px-3 py-2 text-[11px] text-[#9b9b9b]",children:[i.jsx("span",{className:"uppercase whitespace-nowrap",children:"PRICE"}),i.jsxs("span",{className:"uppercase text-center whitespace-nowrap",children:["SIZE (",String(e).toUpperCase(),")"]}),i.jsx("span",{className:"uppercase text-right whitespace-nowrap",children:"TIME"}),i.jsx("span",{})]}),i.jsx("div",{className:"flex-1 overflow-auto",children:c.map(u=>{const d=uSe(u.px),f=uSe(u.sz),v=String(u.side||"").toLowerCase().startsWith("b")?"text-[#67FFBD]":"text-[#FF797C]";return i.jsxs("div",{className:"grid grid-cols-[100px_1fr_90px_28px] px-3 py-1.5 text-xs items-center font-inter",children:[i.jsx("div",{className:v,children:Jfn(d)}),i.jsx("div",{className:"text-right text-[#dcdada]",children:Zfn(f)}),i.jsx("div",{className:"text-right text-[#a8a8a8]",children:u.time?ehn(u.time):"--:--:--"}),i.jsx("div",{className:"flex justify-end",children:u.hash?i.jsx("a",{href:Qfn(u.hash),target:"_blank",rel:"noreferrer",className:"text-white hover:text-white opacity-70 hover:opacity-100",children:i.jsx(xet,{className:"w-4 h-4 shrink-0"})}):null})]},(u.tid??u.hash)+String(u.time))})})]})}function nhn({coin:e,data:t,loading:n,period:r,periods:s,handlePeriodChange:a,onBookPrice:o,onBest:l,className:c=""}){const[u,d]=m.useState("orderbook"),[f,x]=m.useState("orderbook"),g=[{k:"orderbook",t:"Order Book"},{k:"trades",t:"Trades"}],v=N=>{x(u),d(N)},w=g.findIndex(N=>N.k===u)>g.findIndex(N=>N.k===f)?"right":"left",C={enter:N=>({x:N==="right"?24:-24,opacity:0}),center:{x:0,opacity:1},exit:N=>({x:N==="right"?-24:24,opacity:0})};return i.jsx("div",{className:`flex h-full min-h-0 flex-col gap-2 ${c}`,children:i.jsxs("div",{className:"bg-[#101010] flex-1 min-h-0 overflow-hidden relative rounded-[16px] pt-2",children:[i.jsx("div",{className:"relative flex w-full px-2 gap-2",children:g.map(N=>{const P=u===N.k;return i.jsxs("button",{onClick:()=>v(N.k),className:`relative flex-1 flex items-center justify-center py-[6px] cursor-pointer font-semibold text-xs rounded-[12px] bg-transparent ${P?"text-white":"text-[#a8a8a8] hover:text-white"}`,children:[P&&i.jsx(vo.span,{layoutId:"side-pill",className:"absolute inset-0 bg-[#262626] rounded-[12px]",transition:{type:"spring",stiffness:380,damping:30}}),i.jsx("span",{className:"relative z-10",children:N.t})]},N.k)})}),i.jsx("div",{className:"relative w-full h-[calc(100%-40px)] min-h-0",children:i.jsx(xT,{mode:"wait",custom:w,children:i.jsxs(vo.div,{custom:w,variants:C,initial:"enter",animate:"center",exit:"exit",transition:{type:"spring",stiffness:320,damping:28},className:"absolute inset-0",children:[u==="position"&&i.jsx("div",{className:"h-full overflow-auto",children:i.jsx(Mfn,{coin:e,data:t,loading:n,period:r,periods:s,handlePeriodChange:a})}),u==="orderbook"&&i.jsx("div",{className:"h-full overflow-hidden",children:i.jsx(Yfn,{coin:e,rows:9,onSelectPrice:o,onBest:l})}),u==="trades"&&i.jsx("div",{className:"h-full overflow-auto",children:i.jsx(thn,{coin:e})})]},u)})})]})})}const PHe="#101010",Io="#101010",Oa="#2b3640",Li="#929292",yi="#929292",Fg="#67FFBD",Oj="#FF7272",rhn="https://dextrabothypev2.nftinit.io",shn=[{key:"market",label:"Market"},{key:"limit",label:"Limit"},{key:"twap",label:"Twap"}];function ihn({mode:e,onModeChange:t,className:n=""}){const r=m.useMemo(()=>shn,[]),s=m.useRef(null),a=m.useRef({}),[o,l]=m.useState({w:0,x:0}),c=()=>{const u=a.current[e],d=s.current;if(!u||!d)return;const f=u.getBoundingClientRect(),x=d.getBoundingClientRect();l({w:f.width,x:f.left-x.left})};return m.useEffect(()=>{c()},[e]),m.useEffect(()=>{const u=()=>c();return window.addEventListener("resize",u),()=>window.removeEventListener("resize",u)},[e]),i.jsxs("div",{ref:s,className:`relative flex items-center justify-evenly gap-8 ${n}`,style:{borderBottom:`1px solid ${Oa}`},children:[r.map(u=>{const d=e===u.key;return i.jsx("button",{ref:f=>a.current[u.key]=f,onClick:()=>t(u.key),className:"relative font-semibold bg-transparent",style:{color:d?"#FFFFFF":yi,opacity:d?1:.85,letterSpacing:"-0.01em"},children:u.label},u.key)}),i.jsx("div",{className:"absolute bottom-[-1px] left-0 h-[2px] rounded-full transition-all duration-200",style:{width:o.w,transform:`translateX(${o.x}px)`,background:"#67FFBD"}})]})}function y4({children:e,onClick:t}){return i.jsx("button",{onClick:t,className:"w-full px-[16px] py-[6px] bg-[#262626] grid place-items-center rounded-[8px] text-white font-semibold",style:{border:`1px solid ${Oa}`},children:e})}function yb({label:e,value:t,onChange:n,right:r,clearZeroOnFocus:s=!0,restoreZeroOnBlur:a=!0}){const o=r?Ae.cloneElement(r,{onClick:c=>{Number(t)===0&&n(""),typeof r.props.onClick=="function"&&r.props.onClick(c)}}):null,l=c=>{let u=c.target.value;if(u===""||u==="."){n(u);return}if(u.includes(".")){const[d,f=""]=u.split(".");u=f?`${d}.${f.slice(0,2)}`:d}n(u)};return i.jsxs("div",{className:"mb-3",children:[i.jsx("div",{className:"mb-1",style:{color:yi},children:e}),i.jsxs("div",{className:"flex items-center gap-2 h-[30px] px-2 rounded-lg",style:{background:Io,border:`1px solid ${Oa}`},children:[i.jsx("input",{className:"min-w-0 flex-1 bg-transparent outline-none font-inter text-white placeholder:text-gray-500",inputMode:"decimal",type:"number",value:t,onChange:l,onFocus:()=>{s&&String(t)!==""&&Number(t)===0&&n("")},onBlur:c=>{a&&(c.target.value===""||c.target.value===".")&&n("0")},placeholder:"0.00",style:{fontFeatureSettings:'"tnum"'}}),i.jsx("div",{className:"shrink-0",children:o})]})]})}function JP({value:e,onChange:t,items:n}){var o;const[r,s]=m.useState(!1),a=((o=n.find(l=>l.key===e))==null?void 0:o.label)??e;return i.jsxs("div",{className:"relative",children:[i.jsxs("div",{onClick:()=>s(l=>!l),className:"h-[26px] px-2 rounded-md flex justify-center items-center cursor-pointer",style:{background:Io,color:Li},children:[a," ▾"]}),r&&i.jsx("div",{className:"absolute right-0 z-40 mt-1 min-w-[140px] rounded-md p-1",style:{background:Io,border:`1px solid ${Oa}`},children:n.map(l=>i.jsx("div",{className:"px-2 py-1 rounded cursor-pointer",style:{background:l.key===e?"#26313b":"transparent",color:l.key===e?"#ffffff":Li},onClick:()=>{t(l.key),s(!1)},children:l.label},l.key))})]})}function gv({k:e,v:t,strong:n=!1,link:r=!1}){return i.jsxs("div",{className:"flex items-center justify-between text-[#929292] font-inter text-[13px] font-normal leading-4 space-y-2",children:[i.jsx("span",{children:e}),i.jsx("span",{style:{color:Li},children:t})]})}function dSe({children:e,onClick:t,className:n=""}){return i.jsx("button",{onClick:t,className:`flex justify-center items-center h-[30px] px-4 py-2 shrink-0 rounded-lg border border-[rgba(80,80,80,0.32)] text-white font-inter text-[13px] not-italic font-normal leading-[16px] bg-transparent ${n}`,children:e})}function um({title:e,children:t}){return i.jsxs("div",{className:"w-[520px] max-w-[92vw]",style:{background:PHe,border:`1px solid ${Oa}`,borderRadius:16,padding:16},children:[e&&i.jsx("div",{className:"mb-3 text-sm font-semibold",style:{color:Li},children:e}),t]})}function P0({children:e,onClick:t}){return i.jsx("button",{onClick:t,className:"w-full h-[38px] rounded-xl font-semibold text-sm",style:{background:Fg,color:"#0f151a"},children:e})}function _X({active:e,onClick:t,title:n,desc:r}){return i.jsxs("button",{onClick:t,className:"w-full text-left rounded-xl p-3 mb-2",style:{background:e?"rgba(103,255,189,0.12)":Io,border:`1px solid ${e?"#67FFBD":Oa}`,color:Li},children:[i.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[i.jsx("span",{className:"w-2 h-2 rounded-full",style:{background:e?"#67FFBD":"#555"}}),i.jsx("div",{className:"font-semibold",children:n})]}),i.jsx("div",{className:"text-[12px] leading-5",style:{color:yi},children:r})]})}function Jh({open:e,onClose:t,children:n}){const[r,s]=m.useState(!1),[a,o]=m.useState(!1);return m.useEffect(()=>{if(e)s(!0),requestAnimationFrame(()=>o(!0)),document.body.style.overflow="hidden";else{o(!1),document.body.style.overflow="";const l=setTimeout(()=>s(!1),200);return()=>clearTimeout(l)}},[e]),m.useEffect(()=>{const l=c=>{c.key==="Escape"&&t()};return e&&window.addEventListener("keydown",l),()=>window.removeEventListener("keydown",l)},[e,t]),r?Na.createPortal(i.jsx("div",{className:`fixed inset-0 z-[9999] flex items-center justify-center transition-opacity ${a?"opacity-100":"opacity-0"}`,style:{background:"rgba(0,0,0,0.45)",backdropFilter:"blur(6px)"},onMouseDown:t,children:i.jsx("div",{className:`transform transition-all ${a?"translate-y-0 scale-100":"translate-y-2 scale-[0.98]"} relative`,onMouseDown:l=>l.stopPropagation(),children:n})}),document.body):null}function Zp({onClick:e}){return i.jsx("button",{onClick:e,className:"w-full h-[36px] rounded-xl font-bold text-[12px] transition-opacity mb-2 flex items-center justify-center bg-[#67FFBD] text-black",children:"Connect"})}function sre(e=""){return e?`${e.slice(0,6)}...${e.slice(-4)}`:""}const kX="https://api.hyperliquid.xyz/info",ahn="wss://api.hyperliquid.xyz/ws",TX={accountValue:0,withdrawable:0,totalNtlPos:0,totalRawUsd:0,totalMarginUsed:0,crossMaintenanceMarginUsed:0,unrealizedPnl:0,crossAccountValue:0};function bT(e){const[t,n]=m.useState(TX),[r,s]=m.useState([]),[a,o]=m.useState({}),[l,c]=m.useState({}),[u,d]=m.useState({}),[f,x]=m.useState(!1),g=m.useRef(null),v=m.useRef(null);m.useEffect(()=>{let P=!0;return n(TX),s([]),o({}),c({}),d({}),x(!1),e?((async()=>{try{const[I,R,F]=await Promise.all([fetch(kX,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"clearinghouseState",user:e})}),fetch(kX,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"spotClearinghouseState",user:e})}),fetch(kX,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"spotMeta"})})]);if(!P)return;const U=await I.json(),L=await R.json(),z=await F.json(),Q=(U==null?void 0:U.marginSummary)||{},ne=(U==null?void 0:U.crossMarginSummary)||{},J=Array.isArray(U==null?void 0:U.assetPositions)?U.assetPositions.reduce((oe,G)=>{var V;return oe+Number(((V=G==null?void 0:G.position)==null?void 0:V.unrealizedPnl)||0)},0):0,X={accountValue:Number((Q==null?void 0:Q.accountValue)||0),totalNtlPos:Number((Q==null?void 0:Q.totalNtlPos)||0),totalRawUsd:Number((Q==null?void 0:Q.totalRawUsd)||0),withdrawable:Number((U==null?void 0:U.withdrawable)||0),totalMarginUsed:Number((Q==null?void 0:Q.totalMarginUsed)||0),crossMaintenanceMarginUsed:Number((U==null?void 0:U.crossMaintenanceMarginUsed)||0),unrealizedPnl:J,crossAccountValue:Number((ne==null?void 0:ne.accountValue)||0)},re=Array.isArray(L==null?void 0:L.balances)?L.balances.map(oe=>({coin:String(oe.coin),total:Number(oe.total||0),hold:Number(oe.hold||0)})):[],pe={},Y={};if((Array.isArray(z==null?void 0:z.tokens)?z.tokens:[]).forEach(oe=>{const G=oe==null?void 0:oe.name;G&&(oe.tokenId&&(pe[G]=oe.tokenId),Y[G]={tokenId:oe.tokenId||null,evmContract:oe.evmContract||null})}),!P)return;n(X),s(re),o(pe),c(Y)}catch{if(!P)return;n(TX),s([]),o({}),c({})}finally{P&&x(!0)}})(),()=>{P=!1}):(P&&x(!0),()=>{P=!1})},[e]),m.useEffect(()=>{if(!e)return;const P=new WebSocket(ahn);return g.current=P,P.onopen=()=>{[{method:"subscribe",subscription:{type:"user",user:e}},{method:"subscribe",subscription:{type:"webData2",user:e}}].forEach(I=>P.send(JSON.stringify(I))),v.current=setInterval(()=>{P.readyState===WebSocket.OPEN&&P.send(JSON.stringify({id:99,method:"ping"}))},3e4)},P.onmessage=I=>{var R,F,U,L,z,Q;try{const ne=JSON.parse(I.data);if((ne==null?void 0:ne.channel)==="webData2"&&((R=ne==null?void 0:ne.data)!=null&&R.clearinghouseState)){const X=ne.data.clearinghouseState,re=(X==null?void 0:X.marginSummary)||{},pe=(X==null?void 0:X.crossMarginSummary)||{},Y=Array.isArray(X==null?void 0:X.assetPositions)?X.assetPositions.reduce((ie,oe)=>{var G;return ie+Number(((G=oe==null?void 0:oe.position)==null?void 0:G.unrealizedPnl)||0)},0):0;n(ie=>({...ie,accountValue:Number((re==null?void 0:re.accountValue)||0),totalNtlPos:Number((re==null?void 0:re.totalNtlPos)||0),totalRawUsd:Number((re==null?void 0:re.totalRawUsd)||0),withdrawable:(X==null?void 0:X.withdrawable)!=null?Number(X.withdrawable):ie.withdrawable,totalMarginUsed:Number((re==null?void 0:re.totalMarginUsed)||0),crossMaintenanceMarginUsed:Number((X==null?void 0:X.crossMaintenanceMarginUsed)||0),crossAccountValue:Number((pe==null?void 0:pe.accountValue)||0),unrealizedPnl:Y}))}if((ne==null?void 0:ne.channel)==="webData2"&&Array.isArray((F=ne==null?void 0:ne.data)==null?void 0:F.assetCtxs)){const X={};for(const re of ne.data.assetCtxs){const pe=re==null?void 0:re.coin,Y=Number((re==null?void 0:re.midPx)??(re==null?void 0:re.markPx)??(re==null?void 0:re.px));pe&&Number.isFinite(Y)&&(X[pe]=Y)}Object.keys(X).length&&d(re=>({...re,...X}))}if((ne==null?void 0:ne.channel)==="user"&&((U=ne==null?void 0:ne.data)!=null&&U.state)){const X=ne.data.state,re=(X==null?void 0:X.marginSummary)||{},pe=Array.isArray(X==null?void 0:X.assetPositions)?X.assetPositions.reduce((Y,ie)=>{var oe;return Y+Number(((oe=ie==null?void 0:ie.position)==null?void 0:oe.unrealizedPnl)||0)},0):void 0;n(Y=>({...Y,accountValue:Number((re==null?void 0:re.accountValue)||0),totalNtlPos:Number((re==null?void 0:re.totalNtlPos)||0),totalRawUsd:Number((re==null?void 0:re.totalRawUsd)||0),totalMarginUsed:Number((re==null?void 0:re.totalMarginUsed)||0),...pe!=null?{unrealizedPnl:pe}:{}}))}const J=Array.isArray((z=(L=ne==null?void 0:ne.data)==null?void 0:L.spotState)==null?void 0:z.balances)?ne.data.spotState.balances:Array.isArray((Q=ne==null?void 0:ne.data)==null?void 0:Q.balances)?ne.data.balances:null;if(Array.isArray(J)){const X=J.filter(re=>re&&re.coin).map(re=>({coin:String(re.coin),total:Number(re.total||0),hold:Number(re.hold||0)}));s(X)}}catch{}},P.onclose=()=>{v.current&&clearInterval(v.current)},P.onerror=()=>{},()=>{v.current&&clearInterval(v.current);try{P.close()}catch{}}},[e]);const w=m.useMemo(()=>({spot:r.reduce((I,R)=>{if(R.coin==="USDC")return I+Number(R.total||0);const F=u[R.coin];return I+(F?Number(R.total||0)*Number(F):0)},0),perps:t.accountValue}),[r,u,t.accountValue]),C=m.useMemo(()=>{const P=t.accountValue,I=t.unrealizedPnl,R=Number(t.crossAccountValue||0)>0?Number(t.crossAccountValue||0):Number(P||0),F=R>0?Number(t.crossMaintenanceMarginUsed||0)/R:0,U=Number(t.crossMaintenanceMarginUsed||0),L=P>0?t.totalNtlPos/P:0;return{balance:P,uPnl:I,cmr:F,maintenanceMargin:U,crossLeverage:L}},[t]);return{rows:m.useMemo(()=>{const P=[];return P.push({id:"perps",kind:"perps",coin:"USDC",unit:"USDC",totalDisplay:t.accountValue,totalSort:t.accountValue,availableDisplay:t.withdrawable,availableSort:t.withdrawable,usdcValue:t.accountValue}),r.forEach(I=>{const R=Math.max(0,Number(I.total||0)-Number(I.hold||0)),F=u[I.coin],U=I.coin==="USDC"?Number(I.total||0):Number(F)?Number(I.total||0)*Number(F):null;P.push({id:`spot-${I.coin}`,kind:"spot",coin:I.coin,unit:I.coin,totalDisplay:I.total,totalSort:I.total,availableDisplay:R,availableSort:R,usdcValue:U})}),P},[t,r,u]),perps:t,spotBalances:r,tokenIdMap:a,tokenMetaMap:l,priceMap:u,accountEquity:w,perpsOverview:C,initialLoaded:f}}const ohn="https://dextrabothypev2.nftinit.io/api/wallet/request-agent",lhn="https://express-proxy-delta.vercel.app/proxy?url=",chn="https://api.starknet.extended.exchange/api/v1",FHe=e=>`${Number(e||0).toLocaleString(void 0,{minimumFractionDigits:2,maximumFractionDigits:2})} USDC`;function uhn({w:e,active:t,onSelect:n,open:r,mode:s,balances:a}){const[o,l]=m.useState(!1),[c,u]=m.useState(!1);m.useEffect(()=>{try{l(!!localStorage.getItem("hyperToken"))}catch{}},[]);const d=(e.wallet_address||"").toLowerCase(),{perpsOverview:f}=bT(d),x=f==null?void 0:f.balance,g=a&&a[e.wallet_id!=null?String(e.wallet_id):""],v=e.available_balance??e.availableForTrade??e.available_for_trade??e.balance??e.available??null;let w=null;s==="lighter"||s==="extended"?w=g!=null?Number(g):v!=null?Number(v):NaN:w=x;const C=Number.isFinite(w);return m.useEffect(()=>{if(!r||!o)return;u(!0);const N=setTimeout(()=>u(!1),2e3);return()=>clearTimeout(N)},[r,o,d]),m.useEffect(()=>{C&&u(!1)},[C]),i.jsxs("div",{className:"px-3 py-2 rounded cursor-pointer",style:{background:t?"#26313b":"transparent",color:t?"#ffffff":Li},onClick:n,children:[i.jsxs("div",{className:"text-xs font-semibold flex items-center gap-2",children:[i.jsx("span",{children:e.wallet_name}),c?i.jsx(QUe,{size:3,color:"#ffffff"}):C?i.jsxs("span",{className:"text-[11px]",children:["— ",FHe(w)]}):""]}),i.jsx("div",{className:"text-[11px]",style:{color:yi},children:sre(e.wallet_address)})]})}function yT({wallets:e=[],value:t,onChange:n,selectedBalance:r,mode:s="hyper"}){const[a,o]=m.useState(!1),[l,c]=m.useState(!1),[u,d]=m.useState(0),[f,x]=m.useState(!1),[g,v]=m.useState({}),w=m.useRef(new Set),C=m.useRef(null),N=m.useRef(null),{address:P}=ns();m.useEffect(()=>{const Q=()=>{try{c(!!localStorage.getItem("hyperToken")),d(ne=>ne+1)}catch{}};return Q(),window.addEventListener("localStorageUpdated",Q),window.addEventListener("storage",Q),()=>{window.removeEventListener("localStorageUpdated",Q),window.removeEventListener("storage",Q)}},[]),m.useEffect(()=>{if(!l||!t)return;x(!0);const Q=setTimeout(()=>x(!1),2e3);return()=>clearTimeout(Q)},[t,l]),m.useEffect(()=>{var ne;Number.isFinite(Number(r))&&x(!1);const Q=e&&e.length?String(((ne=e.find(J=>String(J.wallet_id)===String(t))||e[0])==null?void 0:ne.wallet_id)??""):null;Q&&Number.isFinite(Number(r))&&Number(r)>=0&&(C.current=Q,v(J=>J[Q]===Number(r)?J:{...J,[Q]:Number(r)}))},[r,e,t]),m.useEffect(()=>{const Q=J=>{N.current&&(N.current.contains(J.target)||o(!1))},ne=J=>{J.key==="Escape"&&o(!1)};return document.addEventListener("pointerdown",Q,!0),document.addEventListener("keydown",ne),()=>{document.removeEventListener("pointerdown",Q,!0),document.removeEventListener("keydown",ne)}},[]);const I=e&&e.length>0,R=I?e.find(Q=>String(Q.wallet_id)===String(t))||(t?null:e[0]):null,F=R&&R.wallet_address?`${R.wallet_name||`Wallet ${R.wallet_id}`} — ${sre(R.wallet_address)}`:R?R.wallet_name||`Wallet ${R.wallet_id}`:P?`MetaMask — ${sre(P)}`:"Select Wallet";let U=null;if(Number.isFinite(Number(r)))U=Number(r);else if(R){const ne=(g&&g[R.wallet_id!=null?String(R.wallet_id):""])??R.available_balance??R.availableForTrade??R.available_for_trade??R.balance??R.available??null,J=Number(ne);Number.isFinite(J)&&(U=J)}const L=R&&!f&&U!=null?`${F} — ${FHe(U)}`:F,z=m.useCallback(async Q=>{var G;if(s!=="hyper")return{data:{agent_pk:null,from_cache:!1}};const ne=localStorage.getItem("hyperTradeToken")||"",J=localStorage.getItem("hyperToken")||"",X=localStorage.getItem("hyperAddress")||"",re=`hl_pk:${Q}`,pe=localStorage.getItem(re);if(pe)return localStorage.setItem("hl_pk",pe),{data:{agent_pk:pe,from_cache:!0}};const ie=await(await fetch(ohn,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({address:X,trade_token:ne,token:J,wallet_id:String(Q)})})).json().catch(()=>({})),oe=(G=ie==null?void 0:ie.data)==null?void 0:G.agent_pk;return oe&&(localStorage.setItem(re,oe),localStorage.setItem("hl_pk",oe)),ie},[s]);return m.useEffect(()=>{if(!R||s!=="hyper"||!l)return;const ne=`hl_pk:${String(R.wallet_id)}`,J=localStorage.getItem("hyperTradeToken")||"",X=localStorage.getItem("hyperToken")||"",re=localStorage.getItem("hyperAddress")||"";if(!(!J||!X||!re)){try{const pe=localStorage.getItem(ne);if(pe){localStorage.setItem("hl_pk",pe);return}}catch{}z(R.wallet_id).catch(()=>{})}},[l,s,R,z,u]),m.useEffect(()=>{if(typeof window>"u")return;const Q=s==="lighter"?"lighter":"hl";if(e&&e.length){const ne=e.find(re=>String(re.wallet_id)===String(t))||e[0];if(!ne)return;const J=String(ne.wallet_id),X=String(ne.wallet_address||"").toLowerCase();try{window.localStorage.setItem(`${Q}_selected_wallet_id`,J),window.localStorage.setItem(`${Q}_selected_wallet_address`,X),window.dispatchEvent(new Event("localStorageUpdated")),window.dispatchEvent(new CustomEvent("hl_selected_wallet_changed",{detail:{id:J,address:X,mode:s}})),s==="hyper"&&l&&z(ne.wallet_id).catch(()=>{})}catch{}}else if(P){const ne="",J=String(P||"").toLowerCase();try{window.localStorage.setItem(`${Q}_selected_wallet_id`,ne),window.localStorage.setItem(`${Q}_selected_wallet_address`,J),window.dispatchEvent(new Event("localStorageUpdated")),window.dispatchEvent(new CustomEvent("hl_selected_wallet_changed",{detail:{id:ne,address:J,mode:s}}))}catch{}}},[e,t,s,P,l,z]),m.useEffect(()=>{if(s!=="extended")return;let Q=!1;const ne=async J=>{var ie,oe,G;const X=J.wallet_id!=null?String(J.wallet_id):"";if(!X||w.current.has(X))return;const re=g[X];if(Number.isFinite(re)&&re>0)return;const pe=J.available_balance??J.availableForTrade??J.available_for_trade??J.balance??J.available??null,Y=Number(pe);if(Number.isFinite(Y)&&Y>0){v(V=>V[X]===Y?V:{...V,[X]:Y});return}if(J.wallet_api_key){w.current.add(X);try{const V=`${lhn}${encodeURIComponent(`${chn}/user/balance`)}`,ae=await(await fetch(V,{headers:{"X-Api-Key":J.wallet_api_key}})).json().catch(()=>({}));if(Q)return;const fe=((ie=ae==null?void 0:ae.data)==null?void 0:ie.availableForTrade)??(ae==null?void 0:ae.availableForTrade)??((oe=ae==null?void 0:ae.data)==null?void 0:oe.available_balance)??(ae==null?void 0:ae.available_balance)??((G=ae==null?void 0:ae.data)==null?void 0:G.available)??(ae==null?void 0:ae.available)??null,Ne=Number(fe);Number.isFinite(Ne)&&v(he=>he[X]===Ne?he:{...he,[X]:Ne})}catch{}finally{w.current.delete(X)}}};return e.forEach(J=>ne(J)),()=>{Q=!0}},[e,s,g]),i.jsxs("div",{className:"relative",ref:N,children:[i.jsxs("div",{onClick:()=>o(Q=>!Q),className:"h-[32px] px-3 rounded-md flex justify-between items-center cursor-pointer",style:{background:Io,border:`1px solid ${Oa}`,color:Li},children:[i.jsxs("span",{className:"truncate text-xs flex items-center gap-1",children:[L,f&&i.jsx(QUe,{size:3,color:"#ffffff"})]}),i.jsx("span",{className:"ml-2",children:"▾"})]}),a&&i.jsxs("div",{className:"absolute z-50 mt-1 w-full max-h-[240px] overflow-auto rounded-md p-1",style:{background:Io,border:`1px solid ${Oa}`},children:[i.jsxs("div",{onClick:()=>{o(!1);const Q=s==="hyper"?"hyperliquid":s==="lighter"?"lighter":"extended";window.open(`/wallet-management#${Q}#add-account#${Q}`,"_blank")},className:"px-3 py-2 text-[#1de674] font-semibold text-sm cursor-pointer flex justify-start items-center gap-1.5 border border-[#8860ff] rounded-md mb-1 bg-[#7445ff]",children:[i.jsx("div",{"data-svg-wrapper":!0,children:i.jsxs("svg",{width:"19",height:"18",viewBox:"0 0 19 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("path",{d:"M5 9H14",stroke:"white",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),i.jsx("path",{d:"M9.5 13.5V4.5",stroke:"white",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})}),i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px]",children:"Add Account"})]}),I&&e.map(Q=>{const ne=String(Q.wallet_id)===String(t);return i.jsx(uhn,{w:Q,active:ne,open:a,mode:s,balances:g,onSelect:async()=>{n(String(Q.wallet_id)),o(!1);try{await z(Q.wallet_id)}catch{}}},Q.wallet_id)}),!I&&i.jsx("div",{className:"px-3 py-2 text-xs",style:{color:yi},children:"No wallets"})]})]})}const IX=new Map;function dhn(e,t){const n=IX.get(e);if(n)return n;const r=Promise.resolve().then(t).finally(()=>IX.delete(e));return IX.set(e,r),r}const fhn=15e3,fSe=new Map;function OHe(e,t,n=!0,{pollMs:r=0,refreshOnFocus:s=!1}={}){const[a,o]=m.useState([]),[l,c]=m.useState(!1),u=m.useCallback(async()=>{if(!e||!t){o([]);return}const d=`wallets:${e}:${n?1:0}`,f=Date.now(),x=fSe.get(d);if(x&&f-x.ts<fhn)return o(x.data),c(!1),x.data;c(!0);const g=await dhn(d,async()=>{const w=await(await fetch(`${rhn}/api/wallet/confirmed-list`,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:e,token:t})})).json();let C=Array.isArray(w==null?void 0:w.data)?w.data:Array.isArray(w)?w:w!=null&&w.wallet_id?[w]:[];return C=C.map(N=>{var P,I,R;return{...N,balances:{eth:((P=N==null?void 0:N.balances)==null?void 0:P.eth)??0,usdc:((I=N==null?void 0:N.balances)==null?void 0:I.usdc)??0,hyper_usdc:((R=N==null?void 0:N.balances)==null?void 0:R.hyper_usdc)??0}}}),C});return o(g),fSe.set(d,{ts:Date.now(),data:g}),c(!1),g},[e,t,n]);return m.useEffect(()=>{(async()=>await u())()},[u]),m.useEffect(()=>{if(!s)return;const d=()=>{document.visibilityState==="visible"&&u()};return document.addEventListener("visibilitychange",d),()=>document.removeEventListener("visibilitychange",d)},[u,s]),m.useEffect(()=>{if(!r)return;const d=setInterval(u,r);return()=>clearInterval(d)},[u,r]),{wallets:a,loading:l,refresh:u}}function XN({value:e,onChange:t,accent:n="#67FFBD",trackBg:r="rgba(255,255,255,0.12)",marks:s=[0,25,33,50,66,75,100],className:a="",snap:o=!1}){const[l,c]=m.useState(!1),u=(C,N,P)=>Math.max(N,Math.min(P,C)),d=Math.max(2,s.length)-1,f=C=>{const N=u(Number(C)||0,s[0],s[s.length-1]);if(N<=s[0])return 0;if(N>=s[s.length-1])return 100;let P=0;for(;P<d&&N>s[P+1];)P++;const I=s[P+1]-s[P]||1,R=(N-s[P])/I;return(P+R)/d*100},x=C=>{const P=u(Number(C)||0,0,100)/100*d,I=Math.min(d-1,Math.floor(P)),R=P-I,F=s[I]+(s[I+1]-s[I])*R;if(!o)return F;let U=s[0],L=1/0;for(const z of s){const Q=Math.abs(z-F);Q<L&&(L=Q,U=z)}return U},g=f(e),v=Math.round(u(e,0,100)),w={type:"spring",stiffness:420,damping:32,mass:.2};return i.jsxs("div",{className:`relative w-full pt-4 pb-5 ${a}`,children:[i.jsx("div",{className:"absolute inset-x-0 top-5 h-2 rounded-full",style:{background:r},children:i.jsx(im.div,{className:"h-2 rounded-full",animate:{width:`${g}%`},transition:w,style:{background:n}})}),i.jsx("div",{className:"absolute inset-x-0 top-6",children:s.map((C,N)=>{const P=N/d*100,I=g/100*d;return N<=I?null:i.jsx("div",{className:"absolute -translate-x-1/2 -translate-y-1/2 top-1/2",style:{left:`${P}%`},children:i.jsx("div",{className:"h-[10px] w-[10px] rounded-full",style:{background:n,boxShadow:"0 0 0 2px rgba(0,0,0,0.35) inset"}})},N)})}),i.jsx(im.div,{className:`${g>34?"-ml-2.5":"ml-2.5"} absolute top-5 -translate-y-full -translate-x-1/2 pointer-events-none z-10`,animate:{left:`${g}%`},transition:w,children:i.jsx("div",{className:"h-[18px] min-w-[24px] px-2 rounded-[6px] flex items-center justify-center text-[12px] leading-none",style:{background:n,color:"#0d0d0d",border:`1px solid ${Oa}`},children:v})}),i.jsx(im.div,{className:"absolute top-[17px] -translate-x-1/2 -translate-y-1/2 z-20 pointer-events-none",animate:{left:`${g-2}%`,scale:l?1.12:1},transition:w,children:i.jsx("div",{className:"h-4 w-4 rounded-full",style:{background:"#0f151a",border:`2px solid ${n}`}})}),i.jsx("div",{className:"absolute inset-x-0 bottom-0",children:s.map((C,N)=>{if(N===0)return null;const P=N/d*100;return i.jsxs("div",{className:"absolute -translate-x-1/2 text-[12px] text-[#CFCFCF]",style:{left:`${P}%`},children:[C,"%"]},N)})}),i.jsx("input",{type:"range",min:0,max:100,step:.1,value:g,onMouseDown:()=>c(!0),onMouseUp:()=>c(!1),onTouchStart:()=>c(!0),onTouchEnd:()=>c(!1),onChange:C=>t(Math.round(x(C.target.value))),className:"absolute -left-2 -right-2 top-0 h-8 opacity-0 cursor-pointer z-30"})]})}const fC=42161,eF=10,PX=[{type:"function",name:"decimals",stateMutability:"view",inputs:[],outputs:[{type:"uint8"}]},{type:"function",name:"balanceOf",stateMutability:"view",inputs:[{type:"address"}],outputs:[{type:"uint256"}]},{type:"function",name:"transfer",stateMutability:"nonpayable",inputs:[{type:"address"},{type:"uint256"}],outputs:[{type:"bool"}]}],e0={BTC:"bc1plaavkq4u7wj8cc8nhrm6rxkhz9ylurw2u6l42ne7gw4493hvacks8wct4q",ETH:"0xa1D7ad9f7065BeE7b0b3E2AC30C9ddAaD9A70C71",SOL:"HWzcDXaTB2mPXvQYQy2g6PCNaj4mhTPVNoJP8zVupHJs",XPL:"0xa1D7ad9f7065BeE7b0b3E2AC30C9ddAaD9A70C71",USDC_BRIDGE_2:"0x2Df1c51E09aECF9cacB7bc98cB1742757f163dF7"},bv={USDC:{kind:"usdc",chains:[{key:"Arbitrum",label:"Arbitrum"}],icon:"USDC",bridge:e0.USDC_BRIDGE_2},BTC:{kind:"address",chains:[{key:"Bitcoin",label:"Bitcoin"}],icon:"BTC",address:e0.BTC,eta:"~21 minutes",fee:"~$2.29",min:"0.002 BTC",networkNote:"This address can only receive BTC on the Bitcoin network. Deposits below 0.002 BTC and deposits from other networks will result in a loss of funds."},ETH:{kind:"address",chains:[{key:"Ethereum",label:"Ethereum"}],icon:"ETH",address:e0.ETH,eta:"~3 minutes",fee:"~$1.22",min:"0.05 ETH",networkNote:"This address can only receive ETH on the Ethereum network. ETH sent from L2s (e.g. Arbitrum, Base, Optimism) will be lost. Any other asset (e.g., USDC, USDT) sent from Ethereum will be lost. Deposits below 0.05 ETH will result in a loss of funds."},SOL:{kind:"address",chains:[{key:"Solana",label:"Solana"}],icon:"SOL",address:e0.SOL,eta:"~1 minute",fee:"~1.40",min:"0.2 SOL",networkNote:"This address can only receive SOL on the Solana network. Any other asset (e.g., USDC, USDT) sent from Solana will be lost. Deposits below 0.2 SOL will result in a loss of funds."},"2Z":{kind:"address",chains:[{key:"Solana",label:"Solana"}],icon:"2Z",address:e0.SOL,eta:"~1 minute",fee:"~1.21",min:"150 2Z",networkNote:"This address can only receive 2Z on the Solana network. Deposits below 150 2Z will result in a loss of funds."},BONK:{kind:"address",chains:[{key:"Solana",label:"Solana"}],icon:"BONK",address:e0.SOL,eta:"~1 minute",fee:"~1.21",min:"1000000 BONK",networkNote:"This address can only receive BONK on the Solana network. Deposits below 1000000 BONK will result in a loss of funds."},FARTCOIN:{kind:"address",chains:[{key:"Solana",label:"Solana"}],icon:"FARTCOIN",address:e0.SOL,eta:"~1 minute",fee:"~1.21",min:"20 FARTCOIN",networkNote:"This address can only receive FARTCOIN on the Solana network. Deposits below 20 FARTCOIN will result in a loss of funds."},PUMP:{kind:"address",chains:[{key:"Solana",label:"Solana"}],icon:"PUMP",address:e0.SOL,eta:"~1 minute",fee:"~1.21",networkNote:"This address can only receive PUMP on the Solana network."},SPX:{kind:"address",chains:[{key:"Solana",label:"Solana"}],icon:"SPX",address:e0.SOL,eta:"~1 minute",fee:"~1.21",networkNote:"This address can only receive SPX on the Solana network."},XPL:{kind:"address",chains:[{key:"Plasma",label:"Plasma"}],icon:"XPL",address:e0.XPL,eta:"~1 minute",fee:"~1.20",min:"15 XPL",networkNote:"This address can only receive XPL on the Plasma network. Deposits below 15 XPL will result in a loss of funds."}};function hhn({open:e,onClose:t,initialAsset:n="USDC",initialChain:r,toWalletAddress:s,usdcTokenAddress:a="0xaf88d065e77c8cC2239327C5EDb3A432268e5831"}){const[o,l]=m.useState(n),[c,u]=m.useState(r||bv[n].chains[0].key),d=bv[o],[f,x]=m.useState(""),[g,v]=m.useState(!1),[w,C]=m.useState(null),[N,P]=m.useState(!1);m.useEffect(()=>{e&&(l(n),u(r||bv[n].chains[0].key),x(""),v(!1),C(null),P(!1))},[e,n,r]);const I=m.useMemo(()=>`https://app.hyperliquid.xyz/coins/${(d.icon||o).toUpperCase()}.svg`,[o,d.icon]);d.kind==="usdc"?`${c}`:`${o}${c}`;const{address:R,isConnected:F}=ns(),U=vA(),{switchChainAsync:L}=Wie(),z=b_e(),{writeContractAsync:Q}=dgt(),ne=o==="USDC",J=ne&&c==="Arbitrum",X=ne&&c!=="Arbitrum",re=J&&U!==fC,{data:pe}=Nme({address:a,abi:PX,functionName:"decimals",chainId:fC,query:{enabled:J}}),Y=Number(pe??6),{data:ie,refetch:oe}=Nme({address:a,abi:PX,functionName:"balanceOf",args:[R??"0x0000000000000000000000000000000000000000"],chainId:fC,query:{enabled:J&&!!R}}),G=m.useMemo(()=>{try{return ie?Ek(ie,Y):"0.00"}catch{return"0.00"}},[ie,Y]),V=J&&Number(f||0)<eF;function ee(ye,ve="error"){C({text:ye,type:ve})}function ae(ye){const ve=String((ye==null?void 0:ye.shortMessage)||(ye==null?void 0:ye.message)||ye||"");return ve.toLowerCase().includes("does not match the connection's chain")||ve.toLowerCase().includes("chain mismatch")||ve.toLowerCase().includes("connector chain")?"You're not on Arbitrum. Please switch to Arbitrum.":ve}async function fe(){try{if(!F)return ee("Wallet is not connected");if(X)return ee("The deposit bridge supports Arbitrum only");re&&await L({chainId:fC});const ye=String(f||"").trim();if(!ye||Number(ye)<=0)return ee("Enter a valid amount");if(Number(ye)<eF)return ee(`Minimum is ${eF} USDC`);const ve=amt(ye,Y);v(!0),C({type:"info",text:"Submitting transaction..."});const je=await Q({address:a,abi:PX,functionName:"transfer",args:[bv.USDC.bridge,ve],chainId:fC});C({type:"info",text:"Waiting for confirmation..."}),await z.waitForTransactionReceipt({hash:je}),C({type:"success",text:"Deposit completed"}),x(""),oe==null||oe()}catch(ye){ee(ae(ye),"error")}finally{v(!1)}}function Ne(ye){var ve;ye&&((ve=navigator.clipboard)==null||ve.writeText(ye),P(!0),setTimeout(()=>P(!1),1500))}const he=X?"Arbitrum Required":J?re?"Deposit":g?"Depositing...":"Deposit":"Done",ge=g||X||J&&V;return i.jsx(Jh,{open:e,onClose:t,children:i.jsxs("div",{className:"relative",children:[i.jsx("button",{onClick:t,className:"absolute -top-1 right-1 w-8 h-8 rounded-full grid place-items-center text-white/90 bg-transparent",children:"×"}),i.jsxs("div",{className:"w-[560px] max-w-[92vw] rounded-2xl shadow-xl border border-[#2a2a2a] bg-[#101010] p-5",children:[i.jsx("div",{className:"w-12 h-12 rounded-full mx-auto -mt-10 mb-2 overflow-hidden flex justify-center items-center bg-[#1B1B1B]",children:i.jsx("img",{src:I,alt:o,className:"w-10 h-10",onError:ye=>{ye.currentTarget.style.display="none"}})}),i.jsx("div",{className:"text-center text-[18px] font-semibold mb-4 text-white",children:d.kind==="usdc"?`Deposit USDC from ${c}`:`Deposit ${o} from ${c}`}),w&&i.jsx("div",{className:"p-2 rounded-lg text-[12px] mb-3",style:{background:w.type==="error"?"#3b1f1f":w.type==="success"?"#1f3b2b":"#1b2a3b",color:w.type==="error"?"#ffb4b4":w.type==="success"?"#b7ffd8":"#c9e1ff",border:"1px solid #2a2a2a"},children:w.text}),i.jsxs("div",{className:"space-y-3",children:[i.jsxs("div",{className:"h-[42px] rounded-lg border border-[#2a2a2a] bg-[#262626] px-3 flex items-center justify-between",children:[i.jsx("span",{className:"text-[13px] text-[#b7b7b7]",children:"Asset"}),i.jsxs("div",{className:"relative",children:[i.jsx("select",{className:"appearance-none bg-transparent text-[13px] text-white outline-none",value:o,onChange:ye=>{var je;const ve=ye.target.value;l(ve),u((je=bv[ve].chains[0])==null?void 0:je.key),C(null)},children:Object.keys(bv).map(ye=>i.jsx("option",{value:ye,children:ye},ye))}),i.jsx("svg",{className:"pointer-events-none absolute right-0 top-1/2 -translate-y-1/2 w-4 h-4 text-[#8c8c8c]",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:i.jsx("path",{d:"M6 9l6 6 6-6"})})]})]}),i.jsxs("div",{className:"h-[42px] rounded-lg border border-[#2a2a2a] bg-[#262626] px-3 flex items-center justify-between",children:[i.jsx("span",{className:"text-[13px] text-[#b7b7b7]",children:"Deposit Chain"}),i.jsxs("div",{className:"relative",children:[i.jsx("select",{className:"appearance-none bg-transparent pr-6 text-[13px] text-white outline-none",value:c,onChange:ye=>{u(ye.target.value),C(null)},children:bv[o].chains.map(ye=>i.jsx("option",{value:ye.key,children:ye.label},ye.key))}),i.jsx("svg",{className:"pointer-events-none absolute right-0 top-1/2 -translate-y-1/2 w-4 h-4 text-[#8c8c8c]",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:i.jsx("path",{d:"M6 9l6 6 6-6"})})]})]}),s&&d.kind!=="usdc"&&i.jsxs("div",{className:"h-[42px] rounded-lg border border-[#2a2a2a] bg-[#262626] px-3 flex items-center justify-between",children:[i.jsx("span",{className:"text-[13px] text-[#b7b7b7]",children:"To"}),i.jsxs("span",{className:"text-xs text-white",children:[s.slice(0,6),"...",s.slice(-4)]})]}),J&&i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"relative h-[42px] rounded-lg border border-[#2a2a2a] bg-[#262626] flex items-center justify-between px-3",children:[i.jsx("input",{type:"text",className:"w-full bg-transparent outline-none text-[13px] text-white placeholder:text-[#6a6a6a] font-mono pr-[55px]",placeholder:"0.00",value:f,onChange:ye=>x(ye.target.value.replace(",",".").replace(/[^\d.]/g,"")),inputMode:"decimal"}),i.jsxs("button",{type:"button",onClick:()=>x(String(G)),className:"absolute right-3 text-[12px] text-[#67FFBD] font-semibold",children:["MAX: ",Number(G||0).toFixed(2)]})]}),i.jsxs("div",{className:"text-[11px]",style:{color:V?"#ffb4b4":"#9BA3A7"},children:["Minimum: ",eF," USDC"]})]}),ne&&i.jsx(i.Fragment,{children:X&&i.jsxs("div",{className:"p-2 rounded-lg text-[12px] mt-1 border border-[#2a2a2a] bg-[#3b1f1f] text-[#ffb4b4]",children:["The deposit bridge supports ",i.jsx("b",{children:"Arbitrum"})," only. Please select Arbitrum as the deposit chain."]})}),d.kind==="address"&&i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"text-[12px] leading-5 text-[#9BA3A7]",children:["Deposits should arrive after ",d.eta,". This service is provided by Unit Protocol. Estimated fee ",d.fee," depending on the ",c," network."]}),i.jsxs("div",{className:"h-[42px] rounded-lg border border-[#2a2a2a] bg-[#262626] px-3 flex items-center justify-between",children:[i.jsx("span",{className:"text-[13px] text-[#b7b7b7]",children:"Address"}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"text-xs text-white truncate max-w-[240px]",children:d.address}),i.jsx("button",{onClick:()=>Ne(d.address),className:"text-[12px] text-[#67FFBD]",children:"Copy"})]})]}),N&&i.jsx("div",{className:"text-[11px] text-[#67FFBD]",children:"Copied ✓"}),d.networkNote&&i.jsxs("div",{className:"p-2 rounded-lg text-[12px] mt-1 border border-[#2a2a2a] bg-[#3b1f1f] text-[#ffb4b4]",children:["IMPORTANT: ",d.min?`Minimum ${d.min}. `:"",d.networkNote]})]}),i.jsx("button",{onClick:ne?X?void 0:re?async()=>{try{C(null),await L({chainId:fC}),C({type:"success",text:"Switched to Arbitrum"})}catch(ye){C({type:"error",text:ae(ye)})}}:fe:t,disabled:ge,className:"w-full h-[44px] mt-2 rounded-xl font-semibold text-sm disabled:opacity-60 bg[rgba(103,255,189,0.16)] text-[#67FFBD] ",children:he})]})]})]})})}function phn(e){const t=e.length;let n=0,r=0;for(;r<t;){let s=e.charCodeAt(r++);if(s&4294967168)if(!(s&4294965248))n+=2;else{if(s>=55296&&s<=56319&&r<t){const a=e.charCodeAt(r);(a&64512)===56320&&(++r,s=((s&1023)<<10)+(a&1023)+65536)}s&4294901760?n+=4:n+=3}else{n++;continue}}return n}function mhn(e,t,n){const r=e.length;let s=n,a=0;for(;a<r;){let o=e.charCodeAt(a++);if(o&4294967168)if(!(o&4294965248))t[s++]=o>>6&31|192;else{if(o>=55296&&o<=56319&&a<r){const l=e.charCodeAt(a);(l&64512)===56320&&(++a,o=((o&1023)<<10)+(l&1023)+65536)}o&4294901760?(t[s++]=o>>18&7|240,t[s++]=o>>12&63|128,t[s++]=o>>6&63|128):(t[s++]=o>>12&15|224,t[s++]=o>>6&63|128)}else{t[s++]=o;continue}t[s++]=o&63|128}}const xhn=new TextEncoder,ghn=50;function bhn(e,t,n){xhn.encodeInto(e,t.subarray(n))}function yhn(e,t,n){e.length>ghn?bhn(e,t,n):mhn(e,t,n)}new TextDecoder;class tF{constructor(t,n){this.type=t,this.data=n}}class eD extends Error{constructor(t){super(t);const n=Object.create(eD.prototype);Object.setPrototypeOf(this,n),Object.defineProperty(this,"name",{configurable:!0,enumerable:!1,value:eD.name})}}function vhn(e,t,n){const r=n/4294967296,s=n;e.setUint32(t,r),e.setUint32(t+4,s)}function MHe(e,t,n){const r=Math.floor(n/4294967296),s=n;e.setUint32(t,r),e.setUint32(t+4,s)}function whn(e,t){const n=e.getInt32(t),r=e.getUint32(t+4);return n*4294967296+r}const Chn=-1,Shn=4294967296-1,Nhn=17179869184-1;function Ahn({sec:e,nsec:t}){if(e>=0&&t>=0&&e<=Nhn)if(t===0&&e<=Shn){const n=new Uint8Array(4);return new DataView(n.buffer).setUint32(0,e),n}else{const n=e/4294967296,r=e&4294967295,s=new Uint8Array(8),a=new DataView(s.buffer);return a.setUint32(0,t<<2|n&3),a.setUint32(4,r),s}else{const n=new Uint8Array(12),r=new DataView(n.buffer);return r.setUint32(0,t),MHe(r,4,e),n}}function jhn(e){const t=e.getTime(),n=Math.floor(t/1e3),r=(t-n*1e3)*1e6,s=Math.floor(r/1e9);return{sec:n+s,nsec:r-s*1e9}}function Ehn(e){if(e instanceof Date){const t=jhn(e);return Ahn(t)}else return null}function _hn(e){const t=new DataView(e.buffer,e.byteOffset,e.byteLength);switch(e.byteLength){case 4:return{sec:t.getUint32(0),nsec:0};case 8:{const n=t.getUint32(0),r=t.getUint32(4),s=(n&3)*4294967296+r,a=n>>>2;return{sec:s,nsec:a}}case 12:{const n=whn(t,4),r=t.getUint32(0);return{sec:n,nsec:r}}default:throw new eD(`Unrecognized data size for timestamp (expected 4, 8, or 12): ${e.length}`)}}function khn(e){const t=_hn(e);return new Date(t.sec*1e3+t.nsec/1e6)}const Thn={type:Chn,encode:Ehn,decode:khn};class ire{constructor(){this.builtInEncoders=[],this.builtInDecoders=[],this.encoders=[],this.decoders=[],this.register(Thn)}register({type:t,encode:n,decode:r}){if(t>=0)this.encoders[t]=n,this.decoders[t]=r;else{const s=-1-t;this.builtInEncoders[s]=n,this.builtInDecoders[s]=r}}tryToEncode(t,n){for(let r=0;r<this.builtInEncoders.length;r++){const s=this.builtInEncoders[r];if(s!=null){const a=s(t,n);if(a!=null){const o=-1-r;return new tF(o,a)}}}for(let r=0;r<this.encoders.length;r++){const s=this.encoders[r];if(s!=null){const a=s(t,n);if(a!=null){const o=r;return new tF(o,a)}}}return t instanceof tF?t:null}decode(t,n,r){const s=n<0?this.builtInDecoders[-1-n]:this.decoders[n];return s?s(t,n,r):new tF(n,t)}}ire.defaultCodec=new ire;function Ihn(e){return e instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer}function Phn(e){return e instanceof Uint8Array?e:ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):Ihn(e)?new Uint8Array(e):Uint8Array.from(e)}const Fhn=100,Ohn=2048;class Nue{constructor(t){this.entered=!1,this.extensionCodec=(t==null?void 0:t.extensionCodec)??ire.defaultCodec,this.context=t==null?void 0:t.context,this.useBigInt64=(t==null?void 0:t.useBigInt64)??!1,this.maxDepth=(t==null?void 0:t.maxDepth)??Fhn,this.initialBufferSize=(t==null?void 0:t.initialBufferSize)??Ohn,this.sortKeys=(t==null?void 0:t.sortKeys)??!1,this.forceFloat32=(t==null?void 0:t.forceFloat32)??!1,this.ignoreUndefined=(t==null?void 0:t.ignoreUndefined)??!1,this.forceIntegerToFloat=(t==null?void 0:t.forceIntegerToFloat)??!1,this.pos=0,this.view=new DataView(new ArrayBuffer(this.initialBufferSize)),this.bytes=new Uint8Array(this.view.buffer)}clone(){return new Nue({extensionCodec:this.extensionCodec,context:this.context,useBigInt64:this.useBigInt64,maxDepth:this.maxDepth,initialBufferSize:this.initialBufferSize,sortKeys:this.sortKeys,forceFloat32:this.forceFloat32,ignoreUndefined:this.ignoreUndefined,forceIntegerToFloat:this.forceIntegerToFloat})}reinitializeState(){this.pos=0}encodeSharedRef(t){if(this.entered)return this.clone().encodeSharedRef(t);try{return this.entered=!0,this.reinitializeState(),this.doEncode(t,1),this.bytes.subarray(0,this.pos)}finally{this.entered=!1}}encode(t){if(this.entered)return this.clone().encode(t);try{return this.entered=!0,this.reinitializeState(),this.doEncode(t,1),this.bytes.slice(0,this.pos)}finally{this.entered=!1}}doEncode(t,n){if(n>this.maxDepth)throw new Error(`Too deep objects in depth ${n}`);t==null?this.encodeNil():typeof t=="boolean"?this.encodeBoolean(t):typeof t=="number"?this.forceIntegerToFloat?this.encodeNumberAsFloat(t):this.encodeNumber(t):typeof t=="string"?this.encodeString(t):this.useBigInt64&&typeof t=="bigint"?this.encodeBigInt64(t):this.encodeObject(t,n)}ensureBufferSizeToWrite(t){const n=this.pos+t;this.view.byteLength<n&&this.resizeBuffer(n*2)}resizeBuffer(t){const n=new ArrayBuffer(t),r=new Uint8Array(n),s=new DataView(n);r.set(this.bytes),this.view=s,this.bytes=r}encodeNil(){this.writeU8(192)}encodeBoolean(t){t===!1?this.writeU8(194):this.writeU8(195)}encodeNumber(t){!this.forceIntegerToFloat&&Number.isSafeInteger(t)?t>=0?t<128?this.writeU8(t):t<256?(this.writeU8(204),this.writeU8(t)):t<65536?(this.writeU8(205),this.writeU16(t)):t<4294967296?(this.writeU8(206),this.writeU32(t)):this.useBigInt64?this.encodeNumberAsFloat(t):(this.writeU8(207),this.writeU64(t)):t>=-32?this.writeU8(224|t+32):t>=-128?(this.writeU8(208),this.writeI8(t)):t>=-32768?(this.writeU8(209),this.writeI16(t)):t>=-2147483648?(this.writeU8(210),this.writeI32(t)):this.useBigInt64?this.encodeNumberAsFloat(t):(this.writeU8(211),this.writeI64(t)):this.encodeNumberAsFloat(t)}encodeNumberAsFloat(t){this.forceFloat32?(this.writeU8(202),this.writeF32(t)):(this.writeU8(203),this.writeF64(t))}encodeBigInt64(t){t>=BigInt(0)?(this.writeU8(207),this.writeBigUint64(t)):(this.writeU8(211),this.writeBigInt64(t))}writeStringHeader(t){if(t<32)this.writeU8(160+t);else if(t<256)this.writeU8(217),this.writeU8(t);else if(t<65536)this.writeU8(218),this.writeU16(t);else if(t<4294967296)this.writeU8(219),this.writeU32(t);else throw new Error(`Too long string: ${t} bytes in UTF-8`)}encodeString(t){const r=phn(t);this.ensureBufferSizeToWrite(5+r),this.writeStringHeader(r),yhn(t,this.bytes,this.pos),this.pos+=r}encodeObject(t,n){const r=this.extensionCodec.tryToEncode(t,this.context);if(r!=null)this.encodeExtension(r);else if(Array.isArray(t))this.encodeArray(t,n);else if(ArrayBuffer.isView(t))this.encodeBinary(t);else if(typeof t=="object")this.encodeMap(t,n);else throw new Error(`Unrecognized object: ${Object.prototype.toString.apply(t)}`)}encodeBinary(t){const n=t.byteLength;if(n<256)this.writeU8(196),this.writeU8(n);else if(n<65536)this.writeU8(197),this.writeU16(n);else if(n<4294967296)this.writeU8(198),this.writeU32(n);else throw new Error(`Too large binary: ${n}`);const r=Phn(t);this.writeU8a(r)}encodeArray(t,n){const r=t.length;if(r<16)this.writeU8(144+r);else if(r<65536)this.writeU8(220),this.writeU16(r);else if(r<4294967296)this.writeU8(221),this.writeU32(r);else throw new Error(`Too large array: ${r}`);for(const s of t)this.doEncode(s,n+1)}countWithoutUndefined(t,n){let r=0;for(const s of n)t[s]!==void 0&&r++;return r}encodeMap(t,n){const r=Object.keys(t);this.sortKeys&&r.sort();const s=this.ignoreUndefined?this.countWithoutUndefined(t,r):r.length;if(s<16)this.writeU8(128+s);else if(s<65536)this.writeU8(222),this.writeU16(s);else if(s<4294967296)this.writeU8(223),this.writeU32(s);else throw new Error(`Too large map object: ${s}`);for(const a of r){const o=t[a];this.ignoreUndefined&&o===void 0||(this.encodeString(a),this.doEncode(o,n+1))}}encodeExtension(t){if(typeof t.data=="function"){const r=t.data(this.pos+6),s=r.length;if(s>=4294967296)throw new Error(`Too large extension object: ${s}`);this.writeU8(201),this.writeU32(s),this.writeI8(t.type),this.writeU8a(r);return}const n=t.data.length;if(n===1)this.writeU8(212);else if(n===2)this.writeU8(213);else if(n===4)this.writeU8(214);else if(n===8)this.writeU8(215);else if(n===16)this.writeU8(216);else if(n<256)this.writeU8(199),this.writeU8(n);else if(n<65536)this.writeU8(200),this.writeU16(n);else if(n<4294967296)this.writeU8(201),this.writeU32(n);else throw new Error(`Too large extension object: ${n}`);this.writeI8(t.type),this.writeU8a(t.data)}writeU8(t){this.ensureBufferSizeToWrite(1),this.view.setUint8(this.pos,t),this.pos++}writeU8a(t){const n=t.length;this.ensureBufferSizeToWrite(n),this.bytes.set(t,this.pos),this.pos+=n}writeI8(t){this.ensureBufferSizeToWrite(1),this.view.setInt8(this.pos,t),this.pos++}writeU16(t){this.ensureBufferSizeToWrite(2),this.view.setUint16(this.pos,t),this.pos+=2}writeI16(t){this.ensureBufferSizeToWrite(2),this.view.setInt16(this.pos,t),this.pos+=2}writeU32(t){this.ensureBufferSizeToWrite(4),this.view.setUint32(this.pos,t),this.pos+=4}writeI32(t){this.ensureBufferSizeToWrite(4),this.view.setInt32(this.pos,t),this.pos+=4}writeF32(t){this.ensureBufferSizeToWrite(4),this.view.setFloat32(this.pos,t),this.pos+=4}writeF64(t){this.ensureBufferSizeToWrite(8),this.view.setFloat64(this.pos,t),this.pos+=8}writeU64(t){this.ensureBufferSizeToWrite(8),vhn(this.view,this.pos,t),this.pos+=8}writeI64(t){this.ensureBufferSizeToWrite(8),MHe(this.view,this.pos,t),this.pos+=8}writeBigUint64(t){this.ensureBufferSizeToWrite(8),this.view.setBigUint64(this.pos,t),this.pos+=8}writeBigInt64(t){this.ensureBufferSizeToWrite(8),this.view.setBigInt64(this.pos,t),this.pos+=8}}function RHe(e,t){return new Nue(t).encodeSharedRef(e)}const Mhn={name:"Exchange",version:"1",chainId:1337,verifyingContract:"0x0000000000000000000000000000000000000000"},Rhn={Agent:[{name:"source",type:"string"},{name:"connectionId",type:"bytes32"}]};function Lhn(e){if(typeof e!="string"||!e.includes("."))return String(e);const t=e.replace(/\.?0+$/,"");return t==="-0"?"0":t}function are(e){if(!e||typeof e!="object")return e;if(Array.isArray(e))return e.map(are);const t={...e};for(const n in t){if(!Object.prototype.hasOwnProperty.call(t,n))continue;const r=t[n];r&&typeof r=="object"?t[n]=are(r):(n==="p"||n==="s")&&typeof r=="string"&&(t[n]=Lhn(r))}return t}function Dhn(e){return hs(e)}function Bhn(e,t,n){const r=are(e),s=RHe(r),a=t==null?9:29,o=new Uint8Array(s.length+a);o.set(s);const l=new DataView(o.buffer);return l.setBigUint64(s.length,BigInt(n),!1),t==null?l.setUint8(s.length+8,0):(l.setUint8(s.length+8,1),o.set(Dhn(t),s.length+9)),lo(o)}function $hn(e,t){return{source:t?"a":"b",connectionId:e}}async function Uhn(e,t){const n=await e.signTypedData(t.domain,t.types,t.message),{r,s,v:a}=nu.from(n);return{r,s,v:a}}async function zhn(e,t,n,r,s){const a=Bhn(t,n,r),o=$hn(a,s);return Uhn(e,{domain:Mhn,types:Rhn,primaryType:"Agent",message:o})}function vT({getPK:e=()=>typeof window<"u"?localStorage.getItem("hl_pk"):null,isMainnet:t=!0,vaultAddress:n=null}={}){return{sign:async(r,s)=>{const a=e();if(!a)throw new Error("Please sign in to perform this action.");const o=new kae(a);return zhn(o,r,n,s,t)}}}function Hhn(e){return new kae(e).address}function Vhn({open:e,onClose:t,children:n,title:r}){return e?i.jsxs("div",{className:"fixed inset-0 z-[999] flex items-center justify-center",children:[i.jsx("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-[1px]",onClick:t}),i.jsxs("div",{className:"relative w-[560px] max-w-[92vw] rounded-2xl border border-[#2A2A2A] bg-[#161616] shadow-2xl",children:[i.jsxs("div",{className:"px-5 pt-4 pb-2 flex items-center justify-between",children:[i.jsx("div",{className:"font-inter text-[18px] leading-6 text-white",children:r}),i.jsx("button",{onClick:t,className:"w-8 h-8 flex items-center justify-center rounded-lg bg-[#222] text-[#BDBDBD]",children:"✕"})]}),i.jsx("div",{className:"px-5 pb-5",children:n})]})]}):null}const Whn=({children:e})=>i.jsx("div",{className:"text-[12px] text-[#9B9B9B] font-inter mb-1 font-semibold",children:e}),qhn=({value:e,onChange:t,placeholder:n})=>i.jsx("input",{value:e,onChange:r=>t(r.target.value),placeholder:n,inputMode:"decimal",className:"flex-1 min-w-0 h-10 px-3 rounded-lg bg-[#101010] border border-[#2A2A2A] text-white outline-none"});function hSe(e,t=6){return Number(e||0).toLocaleString(void 0,{maximumFractionDigits:t})}const FX=e=>e==="perps"?"Perps":"Spot";function LHe({open:e,onClose:t,perpsAvailable:n=0,spotUsdcAvailable:r=0,onSubmit:s,loading:a=!1,initialToPerp:o=!1}){const[l,c]=m.useState(o?"spot":"perps"),[u,d]=m.useState("");m.useEffect(()=>{e&&(c(o?"spot":"perps"),d(""))},[o,e]);const f=l==="perps"?"spot":"perps",x=Number(l==="perps"?n||0:r||0),g=()=>c(N=>N==="perps"?"spot":"perps"),v=()=>d(String(x)),w=()=>s==null?void 0:s({toPerp:l==="spot",amount:u,available:x}),C=!Number(u)||Number(u)<=0||Number(u)>x||a;return i.jsxs(Vhn,{open:e,onClose:t,title:"Transfer USDC",children:[i.jsx("p",{className:"text-[13px] text-[#9B9B9B] mb-3",children:"Transfer USDC between your Perps and Spot balances."}),i.jsx("div",{className:"flex justify-center mb-3 text-xs",children:i.jsxs("button",{onClick:g,className:"inline-flex items-center gap-2 px-3 py-1 rounded-lg border border-[#2A2A2A] bg-transparent hover:bg-[#101010] text-sm",children:[i.jsx("span",{className:`${l==="perps"?"text-[#67FFBD] font-medium":"text-[#bdbdbd]"}`,children:FX(l)}),i.jsx(Tae,{className:"text-[#67FFBD]"}),i.jsx("span",{className:`${f==="perps"?"text-[#67FFBD] font-medium":"text-[#bdbdbd]"}`,children:FX(f)})]})}),i.jsxs("div",{className:"space-y-2 text-xs",children:[i.jsx(Whn,{children:"Amount (USDC)"}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(qhn,{value:u,onChange:d,placeholder:"0.0"}),i.jsxs("button",{onClick:v,className:"shrink-0 w-28 h-10 px-2 py-0 rounded-lg bg-[#1F2A23] border border-[#2F3B33] text-[#67FFBD] hover:opacity-95 flex flex-col items-end justify-center leading-tight text-right",title:"Use maximum available",children:[i.jsx("span",{className:"text-[10px] opacity-80",children:"MAX"}),i.jsx("span",{className:"text-[12px] font-medium truncate",children:hSe(x,6)})]})]}),i.jsxs("div",{className:"text-[12px] text-[#9B9B9B]",children:["Available (",FX(l),"): ",hSe(x,6)," USDC"]})]}),i.jsx("button",{onClick:w,disabled:C,className:`w-full h-11 rounded-xl mt-5 font-medium ${C?"bg-[#2C2C2C] text-[#8A8A8A] cursor-not-allowed":"bg-[rgba(103,255,189,0.16)] text-[#67FFBD] hover:opacity-95"}`,children:a?"Processing...":"Confirm"})]})}function pSe({label:e,children:t}){return i.jsxs("div",{className:"mb-3",children:[i.jsx("div",{className:"mb-1 text-[12px]",style:{color:yi},children:e}),i.jsx("div",{className:"flex items-center gap-2",children:t})]})}const OX=42161,Ghn="0xa4b1",mSe="Mainnet";function Khn(e){const t=e.startsWith("0x")?e.slice(2):e,n="0x"+t.slice(0,64),r="0x"+t.slice(64,128);let s=parseInt(t.slice(128,130),16);return s<27&&(s+=27),{r:n,s:r,v:s}}function Yhn({open:e,onClose:t,perpsBalance:n=0,defaultDest:r=""}){const{address:s}=ns(),a=vA(),{switchChainAsync:o}=Wie(),{signTypedDataAsync:l}=ugt(),[c,u]=m.useState(""),[d,f]=m.useState(r||s||""),[x,g]=m.useState(!1),[v,w]=m.useState(null);m.useEffect(()=>{e&&(u(""),f(r||s||""),g(!1),w(null))},[e,r,s]);const C=m.useMemo(()=>{const R=Math.max(0,Number(n||0)-1);return R>0?Number(R.toFixed(6)):0},[n]),N="Withdraw USDC to Arbitrum";async function P(){var R;try{const F=Number(c||0);if(!F||F<=1){w({type:"error",text:"Enter an amount greater than $1 (fee)."});return}if(F>C){w({type:"error",text:"Amount exceeds available balance (after $1 fee)."});return}const U=(d||"").trim().toLowerCase();if(!/^0x[a-f0-9]{40}$/.test(U)){w({type:"error",text:"Invalid destination address."});return}if(a!==OX)try{await o({chainId:OX})}catch{w({type:"error",text:"Switch to Arbitrum to withdraw."});return}g(!0),w({type:"info",text:"Signing request..."});const L=Date.now(),z={name:"HyperliquidSignTransaction",version:"1",chainId:OX,verifyingContract:"0x0000000000000000000000000000000000000000"},Q={"HyperliquidTransaction:Withdraw":[{name:"hyperliquidChain",type:"string"},{name:"destination",type:"string"},{name:"amount",type:"string"},{name:"time",type:"uint64"}]},ne={hyperliquidChain:mSe,destination:U,amount:String(F),time:L},J=await l({domain:z,types:Q,primaryType:"HyperliquidTransaction:Withdraw",message:ne});w({type:"info",text:"Submitting..."});const X={action:{type:"withdraw3",signatureChainId:Ghn,hyperliquidChain:mSe,destination:U,amount:String(F),time:L},nonce:L,signature:Khn(J)},re=await fetch("https://api.hyperliquid.xyz/exchange",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(X)}).then(pe=>pe.json());if((re==null?void 0:re.status)==="ok")w({type:"success",text:"Withdraw submitted. Funds will arrive shortly."}),setTimeout(()=>{u(""),t==null||t()},700),(R=window==null?void 0:window.dispatchEvent)==null||R.call(window,new Event("balances:refresh"));else{const pe=typeof(re==null?void 0:re.response)=="string"?re.response:JSON.stringify(re);w({type:"error",text:pe||"Withdraw failed."})}}catch(F){w({type:"error",text:String((F==null?void 0:F.message)||F)})}finally{g(!1)}}const I=v&&i.jsx("div",{className:"p-2 rounded-lg text-[12px] mb-3",style:{border:`1px solid ${Oa}`,background:v.type==="error"?"#3b1f1f":v.type==="success"?"#1f3b2b":"#1b2a3b",color:v.type==="error"?"#ffb4b4":v.type==="success"?"#b7ffd8":"#c9e1ff"},children:v.text});return i.jsx(Jh,{open:e,onClose:t,children:i.jsxs(um,{title:N,children:[I,i.jsxs(pSe,{label:"Amount",children:[i.jsxs("div",{className:"flex items-center gap-2 h-[36px] px-2 rounded-lg",style:{background:Io,border:`1px solid ${Oa}`,width:"100%"},children:[i.jsx("input",{className:"min-w-0 flex-1 bg-transparent outline-none text-right text-sm",inputMode:"decimal",placeholder:"0.0",style:{color:Li,fontFeatureSettings:'"tnum"'},value:c,onChange:R=>u(R.target.value)}),i.jsx("button",{className:"text-xs text-[#67FFBD] h-6 flex items-center justify-center",onClick:()=>u(C?String(C):"0"),children:"MAX"})]}),i.jsxs("div",{className:"text-[11px]",style:{color:yi},children:["MAX: ",C.toFixed(6)," USDC"]})]}),i.jsx(pSe,{label:"Destination Address",children:i.jsxs("div",{className:"flex items-center gap-2 h-[36px] px-2 rounded-lg",style:{background:Io,border:`1px solid ${Oa}`,width:"100%"},children:[i.jsx("input",{className:"min-w-0 flex-1 bg-transparent outline-none text-sm",placeholder:"0x...",style:{color:Li},value:d,onChange:R=>f(R.target.value)}),i.jsx("button",{className:"text-xs h-6 flex items-center justify-center text-[#67FFBD]",onClick:async()=>{const R=await navigator.clipboard.readText().catch(()=>"");R&&f(R.trim())},children:"Paste"})]})}),i.jsx("div",{className:"p-2 rounded-lg text-[12px] mb-3",style:{background:"#3b1f1f",color:"#ffb4b4",border:`1px solid ${Oa}`},children:"IMPORTANT: A $1 fee is deducted from each withdrawal."}),i.jsx("button",{onClick:P,disabled:x,className:"w-full h-[42px] mt-1 rounded-xl font-semibold text-sm disabled:opacity-60",style:{background:Fg,color:"#0f151a"},children:x?"Submitting...":"Withdraw"})]})})}function Xhn({value:e,onChange:t,leftLabel:n,rightLabel:r,leftUsd:s=0,rightUsd:a=0}){const o=m.useRef(null),l=m.useRef(!1),c=g=>Math.max(0,Math.min(100,g)),u=g=>{const v=o.current;if(!v)return e;const w=v.getBoundingClientRect(),C=(g-w.left)/w.width*100;return Math.round(c(C))},d=g=>{l.current&&t(u(g.clientX))},f=()=>{l.current=!1,window.removeEventListener("pointermove",d),window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",f)},x=g=>{l.current=!0,t(u(g.clientX)),window.addEventListener("pointermove",d,{passive:!0}),window.addEventListener("pointerup",f,{passive:!0}),window.addEventListener("pointercancel",f,{passive:!0})};return m.useEffect(()=>f,[]),i.jsxs("div",{children:[i.jsxs("div",{className:"flex justify-between text-[12px] mb-1",children:[i.jsxs("span",{className:"font-semibold",style:{color:Fg},children:[n,": ",e,"%"]}),i.jsxs("span",{className:"font-semibold",style:{color:Oj},children:[r,": ",100-e,"%"]})]}),i.jsxs("div",{ref:o,onPointerDown:x,className:"relative h-[10px] select-none",style:{cursor:"pointer",touchAction:"none"},children:[i.jsx("div",{className:"absolute inset-0 rounded-full",style:{background:`linear-gradient(90deg, ${Fg}80 0%, ${Fg}80 ${e}%, ${Oj}80 ${e}%, ${Oj}80 100%)`,border:`1px solid ${Oa}`}}),i.jsx("div",{className:"absolute -translate-x-1/2 -translate-y-1/2 rounded-md w-4 h-4",style:{left:`${e}%`,top:"50%",background:Fg,boxShadow:"0 0 0 1px rgba(0,0,0,0.35)",pointerEvents:"none"}})]}),i.jsxs("div",{className:"flex justify-between text-[12px] mt-1",children:[i.jsx("span",{style:{color:Fg},children:s?`${s.toLocaleString(void 0,{maximumFractionDigits:2})} USDC`:""}),i.jsx("span",{style:{color:Oj},children:a?`${a.toLocaleString(void 0,{maximumFractionDigits:2})} USDC`:""})]})]})}function Qhn(e){return jl({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"circle",attr:{cx:"12",cy:"12",r:"3"},child:[]},{tag:"path",attr:{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"},child:[]}]})(e)}function Zhn({skipConfirm:e,setSkipConfirm:t}){const[n,r]=m.useState(!1),s=m.useRef(null);return m.useEffect(()=>{const a=o=>{!s.current||s.current.contains(o.target)||r(!1)};return document.addEventListener("mousedown",a),()=>document.removeEventListener("mousedown",a)},[]),i.jsxs("div",{className:"relative",ref:s,children:[i.jsx("button",{onClick:()=>r(a=>!a),className:"ml-2 text-[#9B9B9B] hover:text-white p-1 rounded-md",children:i.jsx(Qhn,{size:14})}),n&&i.jsx("div",{className:"absolute right-0 top-6 w-[24 0px] rounded-lg bg-[#101010] border border-[#2A2A2A] shadow-xl p-3 z-50",children:i.jsxs("label",{className:"flex items-center gap-2 text-[12px] text-white cursor-pointer select-none",children:[i.jsx("input",{type:"checkbox",className:"accent-[#67FFBD]",checked:e,onChange:a=>t(a.target.checked)}),"Skip Close Position Confirmation"]})})]})}const MX="wss://api.hyperliquid.xyz/ws";function Z7(e,t=2){const n=Number(e||0),r={maximumFractionDigits:t,minimumFractionDigits:n===0?2:0};return n.toLocaleString(void 0,r)}function xSe(e){return Number(e||0).toLocaleString(void 0,{minimumFractionDigits:2,maximumFractionDigits:2})}const gSe=e=>{const t=String(e||"").toUpperCase();return t==="GTC"?"Gtc":t==="IOC"?"Ioc":t==="ALO"?"Alo":"Gtc"};function Jhn(e,t,n){if(!e||!n||n<=0)return null;const r=t==="buy"?e.asks:e.bids;if(!(r!=null&&r.length))return null;let s=n,a=0;for(const{px:o,sz:l}of r){const c=Math.min(s,l);if(a+=c*o,s-=c,s<=0)break}return s>1e-12?null:a/n}function epn({book:e,side:t,sizeCoin:n,mid:r}){const s=Jhn(e,t,n);if(!s||!r)return 0;const a=s/r,o=t==="buy"?a-1:1-a;return Math.max(0,o*100)}const DHe={position:"bottom-right",style:{background:"#1e1e1e",color:"#fff",fontSize:12,border:"1px solid #2A2A2A"}},tpn="dextra-global-toast";function Ua(e,t){return rn.promise(e,t,{id:tpn,...DHe})}const J7=e=>Number(e||0);function npn(e){var r,s,a;const t=[],n=((s=(r=e==null?void 0:e.response)==null?void 0:r.data)==null?void 0:s.statuses)||((a=e==null?void 0:e.data)==null?void 0:a.statuses)||[];for(const o of n){const l=o==null?void 0:o.filled;(l==null?void 0:l.oid)!=null&&t.push(Number(l.oid));const c=o==null?void 0:o.resting;(c==null?void 0:c.oid)!=null&&t.push(Number(c.oid)),(o==null?void 0:o.oid)!=null&&t.push(Number(o.oid))}return[...new Set(t)]}async function rpn(e,t){const n=String(e||"").toLowerCase(),r=[];for(const s of t)try{const o=await(await fetch("https://api.hyperliquid.xyz/info",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"orderStatus",user:n,oid:s})})).json();r.push({oid:s,data:o})}catch(a){r.push({oid:s,error:String((a==null?void 0:a.message)||a)})}return r}function spn({longSymbol:e,shortSymbol:t,longSize:n,shortSize:r,orderType:s,reduceOnlyFlag:a,maxSlipVal:o,tpOnFlag:l,tpVal:c,slVal:u,userAddr:d,lev:f,coinSym:x,isPairMode:g,isBuySide:v,sizeCoinVal:w}){return{userAddress:String(d||"").toLowerCase(),order:{actionType:a?"CLOSE":"OPEN",orderType:String(s||"MARKET").toUpperCase(),long:e||(g?"":v?x:""),short:t||(g||v?"":x),leverage:J7(f)||1,longSize:J7(n??(g?0:v?w:0)),shortSize:J7(r??(g||v?0:w)),slippage:Number(o||0),takeProfit:l&&J7(c)>0?String(c):"",stopLoss:l&&J7(u)>0?String(u):""}}}async function RX({draft:e,responses:t,user:n}){const r=[];for(const o of Array.isArray(t)?t:[t])r.push(...npn(o));const s=r.length?await rpn(n,r):[];return{...e,exchangeOids:r,orderStatus:s}}function hC(e){return e.then(t=>{var r,s,a;const n=(a=(s=(r=t==null?void 0:t.response)==null?void 0:r.data)==null?void 0:s.statuses)==null?void 0:a[0];if(n!=null&&n.error)throw new Error(n.error);if(n!=null&&n.filled){const o=n.filled;return`Filled ${o.totalSz} @ ${o.avgPx}`}return n!=null&&n.resting?`Placing order (oid ${n.resting.oid})`:typeof(t==null?void 0:t.response)=="string"?t.response:"Order placed"})}function bSe({coin:e="ETH",midPrice:t,selectedPrice:n,onSubmit:r,maxLeverage:s=25,wallet:a,onWalletChange:o,uiMode:l="single",pairKey:c="BTC/ETH"}){const[u,d]=m.useState("market"),[f,x]=m.useState("buy"),[g,v]=m.useState(""),[w,C]=m.useState(""),[N,P]=m.useState("USD"),[I,R]=m.useState(0),[F,U]=m.useState(!1),[L,z]=m.useState("GTC"),[Q,ne]=m.useState(!1),[J,X]=m.useState(""),[re,pe]=m.useState(""),[Y,ie]=m.useState(""),[oe,G]=m.useState(""),[V,ee]=m.useState(!1),[ae,fe]=m.useState(!1),[Ne,he]=m.useState(!1),[ge,ye]=m.useState("Cross"),[ve,je]=m.useState("Cross"),[Ie,Le]=m.useState(s),[Qe,$e]=m.useState(!1),[it,tt]=m.useState(!1),[lt,ft]=m.useState(!1),[ut,qt]=m.useState("One-Way"),[It,nn]=m.useState(""),[jt,cn]=m.useState("USDC"),[un,Ft]=m.useState(0),[Ke,Bt]=m.useState(5),[$t,qe]=m.useState(!1),[Ye,ht]=m.useState(0),[Zt,zt]=m.useState(!1),[Et,nt]=m.useState(null),[Ue,Rt]=m.useState(null),[We,at]=m.useState(null),[mt,Dt]=m.useState(s),[Tt,dn]=m.useState(null),[on,gn]=m.useState({address:null,token:null}),[Nn,kn]=m.useState(null),[yn,Vn]=m.useState(null),[Gn,Dn]=m.useState(null),[Kn,Cn]=m.useState(50),[sn,Me]=m.useState(!1),[en,an]=m.useState({bids:[],asks:[]}),[Nt,Yn]=m.useState(!1),[xn,Mt]=m.useState(String(e)),[tn,In]=m.useState(()=>{if(typeof window>"u")return"8";const vn=localStorage.getItem("hl_max_slip_pct");if(vn==null||vn==="")return"8";const Mn=Number(vn);return Number.isFinite(Mn)&&Mn>0?String(Mn):"8"}),[Xn,or]=m.useState(""),[lr,Qt]=m.useState({}),[zn,Jn]=m.useState([]),[Lt,jn]=m.useState(!1),Ee=m.useRef(null),h=m.useRef(null),[p,S]=m.useState(()=>localStorage.getItem("skipCloseConfirm")==="true"),[_,k]=m.useState([0,0]),[T,B]=m.useState({takerPct:null,makerPct:null});m.useEffect(()=>{localStorage.setItem("skipCloseConfirm",p?"true":"false")},[p]);const q=m.useMemo(()=>Math.max(0,Number(tn||0))/100,[tn]),te=vn=>String(vn||"").trim().toUpperCase(),ue="dextrabot.last_used_leverage",de=()=>{try{return JSON.parse(localStorage.getItem(ue)||"{}")}catch{return{}}},xe=vn=>{const Mn=`leverage:${te(vn)}`,ot=Number(localStorage.getItem(Mn));return Number.isFinite(ot)&&ot>0?ot:null},Se=vn=>{const Mn=te(vn),ot=de(),Vt=Number(ot==null?void 0:ot[Mn]);return Number.isFinite(Vt)&&Vt>0?Vt:xe(Mn)},ke=(vn,Mn)=>{var Wn;const ot=te(vn),Vt=Math.max(1,Number(Mn)||1),er=de();er[ot]=Vt,localStorage.setItem(ue,JSON.stringify(er)),localStorage.setItem(`leverage:${ot}`,String(Vt)),(Wn=window.dispatchEvent)==null||Wn.call(window,new Event("localStorageUpdated"))},{isConnected:Re}=ns(),{openConnectModal:Ge}=y5(),{setSignInConnectButtonOpen:Fe}=m.useContext(Qr),{address:st}=ns(),se=typeof window<"u"&&window.matchMedia("(max-width: 768px)").matches,Be=!!(typeof window<"u"&&localStorage.getItem("hyperToken")&&(Re||se)),De=m.useRef(null);m.useEffect(()=>{const vn=st?st.toLowerCase():null;if(De.current&&De.current!==vn&&typeof window<"u"){const Mn=window.localStorage;Mn.removeItem("hyperToken"),Mn.removeItem("hyperAddress"),Mn.removeItem("hyperTradeToken"),Mn.removeItem("hl_pk"),Mn.removeItem("hl:wallet_id"),Object.keys(Mn).forEach(ot=>{ot.startsWith("hl_pk:")&&Mn.removeItem(ot)}),window.dispatchEvent(new Event("localStorageUpdated"))}De.current=vn,nt(null)},[st]),m.useEffect(()=>{const vn=(a==null?void 0:a.id)!=null?String(a.id):null;if(vn==null){nt(null);return}nt(Mn=>Mn!=null&&String(Mn)===vn?Mn:vn)},[a==null?void 0:a.id]),m.useEffect(()=>{Et!=null&&localStorage.setItem("hl:wallet_id",String(Et))},[Et]);const _e=m.useRef(null);m.useEffect(()=>{l!=="pair"&&xn&&_e.current===xn&&ke(xn,Ie)},[Ie,xn,l]),m.useEffect(()=>{let vn,Mn=!0;function ot(){vn=new WebSocket(MX),vn.onopen=()=>{const Vt={method:"subscribe",subscription:{type:"l2Book",coin:String(e).toUpperCase()}};vn.send(JSON.stringify(Vt))},vn.onmessage=Vt=>{var Ms;if(!Mn)return;const er=JSON.parse(Vt.data),Wn=((Ms=er==null?void 0:er.data)==null?void 0:Ms.levels)||(er==null?void 0:er.levels),Fr=(Wn==null?void 0:Wn.bs)||(Wn==null?void 0:Wn.bids)||[],kr=(Wn==null?void 0:Wn.as)||(Wn==null?void 0:Wn.asks)||[],ts=At=>At.map(ir=>Array.isArray(ir)?{px:Number(ir[0]),sz:Number(ir[1])}:{px:Number(ir.px),sz:Number(ir.sz)}).filter(ir=>ir.px>0&&ir.sz>0);(Fr.length||kr.length)&&an({bids:ts(Fr),asks:ts(kr)})}}return ot(),()=>{Mn=!1;try{vn&&vn.close()}catch{}}},[e]),m.useEffect(()=>{const vn=()=>{const Mn=typeof window<"u"?localStorage.getItem("hyperAddress"):null,ot=typeof window<"u"?localStorage.getItem("hyperToken"):null;gn({address:Mn,token:ot})};return vn(),window.addEventListener("localStorageUpdated",vn),window.addEventListener("storage",vn),()=>{window.removeEventListener("localStorageUpdated",vn),window.removeEventListener("storage",vn)}},[]);const Je=()=>{const vn=parseFloat(String(tn).replace(",",".")),ot=Math.max(.01,Math.min(50,Number.isFinite(vn)?vn:8)).toString();In(ot),localStorage.setItem("hl_max_slip_pct",ot),Yn(!1)},{wallets:ct}=OHe(on.address,on.token,!0,{pollMs:5e3});m.useEffect(()=>{if(!ct||!ct.length||Et&&ct.some(ot=>String(ot.wallet_id)===String(Et)))return;const vn=ct.find(ot=>ot.confirmed)||ct[0];if(!vn)return;const Mn=String(vn.wallet_id);String(Et)!==Mn&&(nt(Mn),o==null||o({id:Mn,address:vn.wallet_address}))},[ct,Et,o]);const gt=m.useMemo(()=>(ct||[]).find(vn=>String(vn.wallet_id)===String(Et))||null,[ct,Et]);m.useEffect(()=>{n!=null&&n!==""&&(d("limit"),v(Number(n)))},[n]),m.useEffect(()=>{let vn=!0;jn(!1);async function Mn(){try{const Vt=await(await fetch("https://api.hyperliquid.xyz/info",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"metaAndAssetCtxs"})})).json(),er=Array.isArray(Vt)?Vt[0]:Vt,Wn=(er==null?void 0:er.universe)||[],Fr=new Map(Wn.map(Ms=>{const At=typeof Ms=="string"?Ms:(Ms==null?void 0:Ms.name)??(Ms==null?void 0:Ms[0])??"";return[te(At),typeof Ms=="string"?{name:At}:Ms]}));if(l==="pair"){const[Ms,At]=String(c||"").split("/").map(Hr=>Hr.trim()),ir=Fr.get(te(Ms)),Hn=Fr.get(te(At));if(vn){const Hr=(ir==null?void 0:ir.maxLeverage)??s,os=(Hn==null?void 0:Hn.maxLeverage)??s,is=Math.max(1,Math.min(Hr,os));Dt(is),Le(ms=>Math.min(ms||1,is)),Rt(null),at(null),dn(null),Mt(null),jn(!0)}return}const kr=Fr.get(te(e));if(!kr){vn&&(Rt(null),at(null),Dt(s),Le(Ms=>Math.min(Ms||1,s)),dn(null),Mt(String(e)),jn(!0));return}const ts=(kr==null?void 0:kr.name)||String(e);if(vn){Rt(0),at((kr==null?void 0:kr.szDecimals)??0),Dt((kr==null?void 0:kr.maxLeverage)??s),dn((kr==null?void 0:kr.maintenanceMarginFraction)??(kr==null?void 0:kr.mmr)??null),Mt(ts);const Ms=Se(ts),At=Ms!=null?Math.min((kr==null?void 0:kr.maxLeverage)??s,Math.max(1,Ms)):Math.min((kr==null?void 0:kr.maxLeverage)??s,Math.max(1,Ie||1));Le(At),_e.current=ts,jn(!0)}}catch{vn&&(Rt(null),at(null),Dt(s),Le(ot=>Math.min(ot||1,s)),dn(null),Mt(String(e)),jn(!0))}}return Mn(),()=>{vn=!1}},[e,s,l,c]);const Xt=f==="buy",wt=Xt?Fg:Oj,Xe=m.useMemo(()=>{var ot,Vt,er,Wn;const vn=(Vt=(ot=en==null?void 0:en.bids)==null?void 0:ot[0])==null?void 0:Vt.px,Mn=(Wn=(er=en==null?void 0:en.asks)==null?void 0:er[0])==null?void 0:Wn.px;return Number.isFinite(vn)&&Number.isFinite(Mn)&&vn>0&&Mn>0?(Mn+vn)/2:null},[en]),Oe=m.useMemo(()=>{if(u==="limit"&&g!=="")return Number(g);const vn=Number(t||0);if(vn>0)return vn;if(Number(Xe||0)>0)return Number(Xe);const Mn=Number((lr||{})[e]||0);return Mn>0?Mn:0},[u,g,t,Xe,lr,e]),bt=gt==null?void 0:gt.wallet_address,{accountEquity:kt,perpsOverview:Ut,spotBalances:fn,perps:On}=bT(bt),{rows:Sn}=wue(bt);m.useEffect(()=>{let vn=!1;async function Mn(){var Vt,er,Wn,Fr;if(!bt){vn||B({takerPct:null,makerPct:null});return}try{const ts=await(await fetch("https://api.hyperliquid.xyz/info",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"userFees",user:bt.toLowerCase()})})).json();if(vn)return;const Ms=Number(ts.userCrossRate??((Vt=ts.feeSchedule)==null?void 0:Vt.cross)??NaN),At=Number(ts.userAddRate??((er=ts.feeSchedule)==null?void 0:er.add)??NaN);if(!Number.isFinite(Ms)||!Number.isFinite(At)){B({takerPct:null,makerPct:null});return}const ir=Number(ts.activeReferralDiscount??((Wn=ts.feeSchedule)==null?void 0:Wn.referralDiscount)??0)||0,Hn=Number(((Fr=ts.activeStakingDiscount)==null?void 0:Fr.discount)??0)||0,Hr=Math.max(0,1-ir-Hn),os=Ms*Hr,is=At*Hr;B({takerPct:os*100,makerPct:is*100})}catch{vn||B({takerPct:null,makerPct:null})}}Mn();const ot=setInterval(Mn,5*60*1e3);return()=>{vn=!0,clearInterval(ot)}},[bt]);const yr=m.useMemo(()=>{const{takerPct:vn,makerPct:Mn}=T;if(vn==null||Mn==null)return"—";const ot=Vt=>Number(Vt).toLocaleString(void 0,{minimumFractionDigits:4,maximumFractionDigits:4});return`${ot(vn)}% / ${ot(Mn)}%`},[T]);m.useEffect(()=>{let vn=!1;async function Mn(){if(!(!bt||l==="pair"))try{const Vt=await(await fetch("https://api.hyperliquid.xyz/info",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"activeAssetData",user:bt.toLowerCase(),coin:String(xn||e)})})).json();if(vn)return;const er=Vt==null?void 0:Vt.leverage;if(!er)return;const Wn=String(er.type||"").toLowerCase()==="cross"?"Cross":"Isolated",kr=Math.max(1,Math.min(mt||s,Number(er.value||er.leverage)||1));ye(Wn),je(Wn),Le(kr)}catch{}}return Mn(),()=>{vn=!0}},[bt,e,l,mt,s]),m.useEffect(()=>{if(!bt)return;const vn=new WebSocket(MX);return Ee.current=vn,vn.onopen=()=>{vn.send(JSON.stringify({method:"subscribe",subscription:{type:"user",user:bt}})),vn.send(JSON.stringify({method:"subscribe",subscription:{type:"webData2",user:bt}})),h.current=setInterval(()=>{vn.readyState===WebSocket.OPEN&&vn.send(JSON.stringify({id:99,method:"ping"}))},3e4)},vn.onmessage=Mn=>{var ot,Vt,er,Wn;try{const Fr=JSON.parse(Mn.data),kr=(Fr==null?void 0:Fr.data)||{},ts=(ot=kr==null?void 0:kr.meta)==null?void 0:ot.universe,Ms=kr==null?void 0:kr.allMids;if(Array.isArray(ts)&&Array.isArray(Ms)&&ts.length===Ms.length){const ir={};for(let Hn=0;Hn<ts.length;Hn++){const Hr=typeof ts[Hn]=="string"?ts[Hn]:((Vt=ts[Hn])==null?void 0:Vt.name)||((er=ts[Hn])==null?void 0:er[0]),os=Number(Ms[Hn]);Hr&&Number.isFinite(os)&&(ir[Hr]=os)}Qt(Hn=>({...Hn,...ir}))}const At=Array.isArray((Wn=kr==null?void 0:kr.spotState)==null?void 0:Wn.balances)?kr.spotState.balances:Array.isArray(kr==null?void 0:kr.balances)?kr.balances:null;Array.isArray(At)&&Jn(At.filter(ir=>ir&&ir.coin).map(ir=>({coin:String(ir.coin),total:Number(ir.total||0),hold:Number(ir.hold||0)})))}catch{}},vn.onclose=()=>{h.current&&clearInterval(h.current)},()=>{h.current&&clearInterval(h.current);try{vn.close()}catch{}}},[bt]),m.useEffect(()=>{if(!bt){k([0,0]);return}k([0,0]);let vn=!0;const Mn=new WebSocket(MX);return Mn.onopen=()=>{Mn.send(JSON.stringify({method:"subscribe",subscription:{type:"activeAssetData",user:bt.toLowerCase(),coin:String(e)}}))},Mn.onmessage=ot=>{if(vn)try{const Vt=JSON.parse(ot.data);if(Vt.channel==="activeAssetData"&&Vt.data){const er=Vt.data.availableToTrade||[];k([Number(er[0]||0),Number(er[1]||0)])}}catch{}},Mn.onclose=()=>{vn&&k([0,0])},()=>{vn=!1;try{Mn.close()}catch{}}},[bt,e]);const Pn=m.useMemo(()=>{const vn=(fn||[]).find(Mn=>Mn.coin==="USDC");return vn?Math.max(0,Number(vn.total||0)-Number(vn.hold||0)):0},[fn]),En=m.useMemo(()=>{if(!zn.length)return null;let vn=0;for(const Mn of zn){const ot=Number(Mn.total||0);if(ot>0)if(Mn.coin==="USDC")vn+=ot;else{const Vt=lr[Mn.coin];Number.isFinite(Vt)&&Vt>0&&(vn+=ot*Vt)}}return vn},[zn,lr]),$n=Number((On==null?void 0:On.accountValue)??0),Bn=Number((On==null?void 0:On.totalMarginUsed)??0),_r=Math.max(0,$n-Bn),sr=_r,rr=_r<1;async function Rr({toPerp:vn,amount:Mn,available:ot}){var Vt;try{if(Me(!0),!Nn){await Ua(Promise.reject(new Error("Trading is not ready (HL not initialized)")),{loading:"Validating...",success:"OK",error:Wn=>Wn.message});return}if(!Number(Mn)){await Ua(Promise.reject(new Error("Amount is invalid")),{loading:"Validating...",success:"OK",error:Wn=>Wn.message});return}if(Number(Mn)>Number(ot||0)){await Ua(Promise.reject(new Error("Amount exceeds available")),{loading:"Validating...",success:"OK",error:Wn=>Wn.message});return}const er=Nn.transfers.usdClassTransfer(String(Mn),!!vn).then(Wn=>{if((Wn==null?void 0:Wn.status)==="ok")return"Transfer successful.";const Fr=typeof(Wn==null?void 0:Wn.response)=="string"?Wn.response:"Transfer failed";throw new Error(Fr)});await Ua(er,{loading:`Transferring ${Mn} USDC ${vn?"Spot → Perps":"Perps → Spot"}...`,success:Wn=>Wn,error:Wn=>(Wn==null?void 0:Wn.message)||"Transfer failed"}),(Vt=window==null?void 0:window.dispatchEvent)==null||Vt.call(window,new Event("balances:refresh")),$e(!1)}catch{}finally{Me(!1)}}const Jr=(()=>{const vn=Number(w)||0;return N==="COIN"?vn:Oe?vn/Oe:0})(),ws=Jr*(Oe||0),ls=Ie?ws/Ie:0;function et(vn){const Mn=Math.max(1,Number(Ie)||1),ot=Math.max(0,Number(Tt)||0),Vt=vn/Mn+vn*ot,er=sr>0?Vt/sr*100:0;R(Math.max(0,Math.min(100,Math.round(er))))}function yt(vn){R(vn);const Mn=Math.max(1,Number(Ie)||1),ot=Math.max(0,Number(Tt)||0),Vt=vn/100*sr,er=1/Mn+ot,Wn=er>0?Vt/er:0;if(l==="pair"){or(Wn?String(Wn.toFixed(2)):"");return}if(N==="USD")C(Wn?String(Wn.toFixed(2)):"");else{const Fr=Oe?Wn/Oe:0,kr=We??4;C(Fr?String(Fr.toFixed(kr)):""),et(Fr*Oe)}}function Tn(vn){const Mn=Math.max(1,Number(Ie)||1),ot=Math.max(0,Number(Tt)||0),Vt=vn/Mn+vn*ot,er=sr>0?Vt/sr*100:0;ht(Math.max(0,Math.min(100,Math.round(er))))}function tr(vn){const Mn=Math.max(0,Math.min(100,Number(vn)||0));ht(Mn);const ot=Math.max(1,Number(Ie)||1),Vt=Math.max(0,Number(Tt)||0),er=Mn/100*sr,Wn=1/ot+Vt,Fr=Wn>0?er/Wn:0;if(jt==="COIN"){const kr=Oe?Fr/Oe:0,ts=We??4;nn(kr?String(kr.toFixed(ts)):"")}else nn(Fr?String(Fr.toFixed(2)):"")}function Ar(vn){nn(vn);const Mn=Number(vn)||0,Vt=(jt==="COIN"?Mn:Oe?Mn/Oe:0)*(Oe||0);Tn(Vt)}function Br(vn){if(vn===jt)return;const Mn=Number(It)||0;let ot="";if(vn==="USDC")ot=String(((Mn||0)*(Oe||0)).toFixed(2)),cn("USDC"),nn(ot),Tn(Number(ot)||0);else if(!Oe)cn("COIN"),nn(""),Tn(0);else{const Vt=We??4;ot=String(((Mn||0)/Oe).toFixed(Vt)),cn("COIN"),nn(ot),Tn((Number(ot)||0)*Oe)}}function Vr(vn){C(vn);const Mn=Number(vn)||0,Vt=(N==="COIN"?Mn:Oe?Mn/Oe:0)*(Oe||0);et(Vt)}function dr(vn){const Mn=vn==="USDC"?"USD":vn;if(Mn===N)return;const ot=Number(w)||0;let Vt="";if(Mn==="USD")Vt=String(((ot||0)*(Oe||0)).toFixed(2)),P("USD"),C(Vt),et(Number(Vt)||0);else if(!Oe)P("COIN"),C(""),et(0);else{const er=We??4;Vt=String(((ot||0)/Oe).toFixed(er)),P("COIN"),C(Vt),et((Number(Vt)||0)*Oe)}}function jr({entry:vn,side:Mn,notionalUSD:ot,maintenanceFrac:Vt,marginMode:er,accountValueUSD:Wn,isolatedMarginUSD:Fr}){const kr=Number(vn)||0,ts=Math.abs(Number(ot)||0);if(!kr||!ts)return null;const Ms=Mn==="buy"?1:-1,At=Math.max(0,Number(Vt)||0),ir=ts/kr,Hn=ts*At;let Hr;er==="Cross"?Hr=Wn-Hn:Hr=Fr-Hn;const os=1-At*Ms;if(!ir||!isFinite(os))return null;const is=kr-Ms*(Hr/ir)/os;return Math.max(0,is)}const ps=Number((Ut==null?void 0:Ut.balance)??0),gr=typeof Tt=="number"?Tt:.01,es=Jr>0&&Oe?jr({entry:Oe,side:f,notionalUSD:ws,maintenanceFrac:gr,marginMode:ge,accountValueUSD:ps}):null;m.useEffect(()=>{Vr(w)},[N,Oe,Ie,sr]),m.useEffect(()=>{u==="twap"&&Ar(It)},[u,jt,It,Oe,Ie,sr]);const Gs=m.useMemo(()=>epn({book:en,side:f,sizeCoin:Jr,mid:t}),[en,f,Jr,t]);m.useEffect(()=>{let vn=!1;async function Mn(){if(!(gt!=null&>.wallet_address)||!Et){kn(null);return}const ot=vT({getPK:()=>typeof window<"u"?localStorage.getItem("hl_pk"):null,isMainnet:!0,vaultAddress:null}),Vt=YN({address:gt.wallet_address,signer:ot,dex:"",defaultSlippage:q});vn||kn(Vt)}return Mn(),()=>{vn=!0}},[Et,gt==null?void 0:gt.wallet_address,q]);const Es=vn=>vn||vn===0?String(Math.trunc(Number(vn))):"",xr=Number(Oe||0),Gt=vn=>{ie(vn),Vn("pct");const Mn=Number(vn),ot=Math.max(1,Number(Ie)||1);if(!xr||!isFinite(Mn)){X("");return}const Vt=Mn/(ot*100),er=Xt?xr*(1+Vt):xr*(1-Vt);X(Es(er))};m.useEffect(()=>{Q&&(X(""),pe(""),ie(""),G(""),Vn(null),Dn(null))},[f]);const ce=vn=>{X(vn),Vn("price");const Mn=Number(vn),ot=Math.max(1,Number(Ie)||1);if(!xr||!Mn){ie("");return}const Vt=Mn/xr,er=Xt?(Vt-1)*ot*100:(1-Vt)*ot*100;ie(String(Number(er).toFixed(2)))},rt=vn=>{G(vn),Dn("pct");const Mn=Number(vn),ot=Math.max(1,Number(Ie)||1);if(!xr||!isFinite(Mn)){pe("");return}const Vt=Mn/(ot*100),er=Xt?xr*(1-Vt):xr*(1+Vt);pe(Es(er))},Pt=vn=>{pe(vn),Dn("price");const Mn=Number(vn),ot=Math.max(1,Number(Ie)||1);if(!xr||!Mn){G("");return}const Vt=Mn/xr,er=Xt?(1-Vt)*ot*100:(Vt-1)*ot*100;G(String(Number(er).toFixed(2)))};m.useEffect(()=>{xr&&(Q&&(yn==="pct"?Gt(Y):yn==="price"&&ce(J)),Gn==="pct"?rt(oe):Gn==="price"&&Pt(re))},[xr,Ie]);function vt(){var vn;(vn=window==null?void 0:window.dispatchEvent)==null||vn.call(window,new Event("balances:refresh"))}async function ln(vn){const Mn=()=>{typeof vn=="function"&&vn()};if(!Et){await Ua(Promise.reject(new Error("Select a wallet")),{loading:"Validating...",success:"OK",error:Wn=>Wn.message}),Mn();return}if(!Nn){await Ua(Promise.reject(new Error("Please sign in to perform this action.")),{loading:"Validating...",success:"OK",error:Wn=>Wn.message}),Mn();return}const ot=String(ge||"").toLowerCase().startsWith("iso")?"isolated":"cross",er=Math.max(1,Math.min(mt||s,Number(Ie)||1));if(!Ir&&Math.abs(Yr||0)>0){const Wn=String(ve||"").toLowerCase().startsWith("iso")?"isolated":"cross";if(ot!==Wn){await Ua(new Promise(Fr=>Fr()),{loading:"Validating...",success:()=>{throw new Error("Cannot switch leverage type with open position.")},error:Fr=>Fr.message}),ye(ve),Mn();return}}try{if(l==="pair"){const[Wn,Fr]=String(c||"").split("/").map(ts=>ts.trim().toUpperCase()),kr=Promise.all([Nn.updateLeverage(Wn,ot,er),Nn.updateLeverage(Fr,ot,er)]);await Ua(kr,{loading:`Updating for ${Wn}/${Fr}...`,success:()=>"Updated",error:ts=>(ts==null?void 0:ts.message)||"Failed to update leverage for pair"})}else{const Wn=xn||String(e).toUpperCase(),Fr=Nn.updateLeverage(Wn,ot,er);await Ua(Fr,{loading:`Updating for ${Wn}...`,success:()=>"Updated",error:kr=>(kr==null?void 0:kr.message)||"Failed to update leverage"}),je(ge)}Mn()}catch{ye(ve),Mn()}}async function mn(){const[vn,Mn]=String(c||"").split("/").map(ot=>ot.trim().toUpperCase());try{if(!Et){await Ua(Promise.reject(new Error("Select a wallet")),{loading:"Validating...",success:"OK",error:Hr=>Hr.message});return}if(!Nn){await Ua(Promise.reject(new Error("Trading is not ready (HL not initialized)")),{loading:"Validating...",success:"OK",error:Hr=>Hr.message});return}const ot=await Nn.info.allMids(),Vt=Number(ot[vn]||0),er=Number(ot[Mn]||0);if(!(Vt>0&&er>0)){await Ua(Promise.reject(new Error("Mid price not available for pair")),{loading:"Validating...",success:"OK",error:Hr=>Hr.message});return}const Wn=Math.max(1,Math.min(Number(Ie)||1,Number(mt)||1));Wn!==Ie&&(Le(Wn),rn.success(`Leverage adjusted to ${Wn}x`,DHe));let Fr=Number(Xn)>0?Number(Xn):I/100*sr*Wn;if(!(Fr>0)){await Ua(Promise.reject(new Error("Enter a valid total notional for pair")),{loading:"Validating...",success:"OK",error:Hr=>Hr.message});return}const kr=Math.max(0,Math.min(100,Number(Kn)||0))/100,ts=Fr*kr,Ms=Fr-ts,At=ts/Vt,ir=Ms/er,Hn=spn({longSymbol:vn,shortSymbol:Mn,longSize:At,shortSize:ir,orderType:u,reduceOnlyFlag:!!F,maxSlipVal:q,tpOnFlag:!1,tpVal:"",slVal:"",userAddr:(gt==null?void 0:gt.wallet_address)||st,lev:Wn,coinSym:"",isPairMode:!0,isBuySide:!0,sizeCoinVal:0});if(u==="market"){const Hr=F?Nn.marketClose(vn,void 0,{tif:"Ioc",reduceOnly:!0,slippage:q}):Nn.marketOpen(vn,!0,Number(At),{tif:"Ioc",reduceOnly:!1,slippage:q}),os=F?Nn.marketClose(Mn,void 0,{tif:"Ioc",reduceOnly:!0,slippage:q}):Nn.marketOpen(Mn,!1,Number(ir),{tif:"Ioc",reduceOnly:!1,slippage:q}),is=(async()=>{const[ms,gs]=await Promise.all([Hr,os]);return await RX({draft:Hn,responses:[ms,gs],user:Hn.userAddress}),"Pair market placed"})();await Ua(is,{loading:`Opening ${vn} long / ${Mn} short...`,success:ms=>ms,error:ms=>(ms==null?void 0:ms.message)||"Pair order failed"}),vt(),R(0),or("");return}if(u==="limit"){const Hr=gSe(L),os=Nn.placeOrder({symbol:vn,isBuy:!0,size:Number(At),price:Vt,tif:Hr,reduceOnly:!1}),is=Nn.placeOrder({symbol:Mn,isBuy:!1,size:Number(ir),price:er,tif:Hr,reduceOnly:!1}),ms=(async()=>{const[gs,$i]=await Promise.all([os,is]);return await RX({draft:Hn,responses:[gs,$i],user:Hn.userAddress}),"Pair limit placed"})();await Ua(ms,{loading:`Placing ${vn} long / ${Mn} short limits...`,success:gs=>gs,error:gs=>(gs==null?void 0:gs.message)||"Pair limit failed"}),vt(),R(0),or("");return}if(u==="twap"){const Hr=Math.max(5,Math.min(1440,Number(un||0)*60+Number(Ke||0))),os=Nn.placeTwapOrder({symbol:vn,isBuy:!0,size:Number(At),minutes:Hr,randomize:!!$t,reduceOnly:!!F}),is=Nn.placeTwapOrder({symbol:Mn,isBuy:!1,size:Number(ir),minutes:Hr,randomize:!!$t,reduceOnly:!!F}),ms=(async()=>{const[gs,$i]=await Promise.all([os,is]);return await RX({draft:Hn,responses:[gs,$i],user:Hn.userAddress}),"Pair TWAP started"})();await Ua(ms,{loading:"Starting pair TWAP...",success:gs=>gs,error:gs=>(gs==null?void 0:gs.message)||"Pair TWAP failed"}),vt(),R(0),or("");return}await Ua(Promise.reject(new Error("Unsupported mode for pair")),{loading:"Validating...",success:"OK",error:Hr=>Hr.message})}catch{}}const cr=m.useMemo(()=>{const vn=Number(un||0)*60+Number(Ke||0);return vn?Math.max(5,Math.min(1440,vn)):0},[un,Ke]),Nr=m.useMemo(()=>{if(!cr)return 0;const vn=Math.floor(cr*60/30);return Math.max(1,vn+1)},[cr]),fr=m.useMemo(()=>{const vn=Number(It)||0;return vn>0?jt==="COIN"?vn:Oe?vn/Oe:0:0},[It,jt,Oe]),ur=m.useMemo(()=>!Nr||!(fr>0)?0:fr/Nr,[fr,Nr]),Yr=m.useMemo(()=>{const vn=String(e||"").toUpperCase();if(!Sn||!Sn.length)return 0;const Mn=Sn.find(ot=>String(ot.coin||"").toUpperCase()===vn);return Mn?Number(Mn.size||0):0},[Sn,e]);async function ss(){try{if(!Et){await Ua(Promise.reject(new Error("Select a wallet")),{loading:"Validating...",success:"OK",error:Mn=>Mn.message});return}if(!Nn){await Ua(Promise.reject(new Error("Trading is not ready (HL not initialized)")),{loading:"Validating...",success:"OK",error:Mn=>Mn.message});return}if(l==="pair"){zt(!0),await mn(),zt(!1);return}const vn=Number(w)||0;if((u==="market"||u==="limit")&&vn<=0&&!(u==="market"&&F)){await Ua(Promise.reject(new Error("Enter a valid amount")),{loading:"Validating...",success:"OK",error:Mn=>Mn.message});return}if(zt(!0),u==="market")if(F){const Mn=vn>0?hC(Nn.marketClose(e,Number(Jr),{tif:"Ioc",reduceOnly:!0,slippage:q})):hC(Nn.marketClose(e,void 0,{tif:"Ioc",reduceOnly:!0,slippage:q}));await Ua(Mn,{loading:`Closing ${e} position...`,success:ot=>ot,error:ot=>(ot==null?void 0:ot.message)||"Close failed"}),vt()}else{const Mn=Q&&J!==""&&Number(J)>0,ot=Q&&re!==""&&Number(re)>0,Vt=hC(Mn||ot?Nn.placeMarketWithTPSL({symbol:e,isBuy:Xt,size:Number(Jr),entrySlippage:q,tpPrice:Mn?Number(J):null,slPrice:ot?Number(re):null,triggerSlippage:.1}):Nn.marketOpen(e,Xt,Number(Jr),{tif:"Ioc",reduceOnly:!1,slippage:q}));await Ua(Vt,{loading:`Placing ${Xt?"Buy":"Sell"} market order...`,success:er=>er,error:er=>(er==null?void 0:er.message)||"Order failed"}),vt(),R(0),C("")}else if(u==="limit"){const Mn=gSe(L),ot=Q&&J!==""&&Number(J)>0,Vt=Q&&re!==""&&Number(re)>0,er=hC(ot||Vt?Nn.placeLimitWithTPSL({symbol:e,isBuy:Xt,size:Number(Jr),price:Number(g),tif:Mn,reduceOnly:F,tpPrice:ot?Number(J):null,slPrice:Vt?Number(re):null,triggerSlippage:q}):Nn.placeOrder({symbol:e,isBuy:Xt,size:Number(Jr),price:Number(g),tif:Mn,reduceOnly:F}));await Ua(er,{loading:`Placing ${Xt?"Buy":"Sell"} limit order...`,success:Wn=>Wn,error:Wn=>(Wn==null?void 0:Wn.message)||"Order failed"}),vt(),R(0),C("")}else if(u==="twap"){const Mn=cr;if(!Mn){await Ua(Promise.reject(new Error("Enter a valid running time (min 5 minutes)")),{loading:"Validating...",success:"OK",error:Wn=>Wn.message}),zt(!1);return}let ot=0;const Vt=Number(It)||0;if(jt==="COIN")ot=Vt;else{if(!Oe){await Ua(Promise.reject(new Error("Price required to convert USD to size")),{loading:"Validating...",success:"OK",error:Wn=>Wn.message}),zt(!1);return}ot=Vt/Oe}if(!(ot>0)){await Ua(Promise.reject(new Error("Enter a valid TWAP size")),{loading:"Validating...",success:"OK",error:Wn=>Wn.message}),zt(!1);return}const er=Nn.placeTwapOrder({symbol:e,isBuy:Xt,size:Number(ot),minutes:Mn,randomize:!!$t,reduceOnly:!!F});await Ua(er,{loading:`Starting TWAP for ${e}...`,success:()=>`TWAP started: ${Number(ot).toLocaleString(void 0,{maximumFractionDigits:We??4})} ${e} over ${Mn}m`,error:Wn=>(Wn==null?void 0:Wn.message)||"TWAP failed"}),vt()}else{await Ua(Promise.reject(new Error("This mode is not wired to HyperSDK yet")),{loading:"Validating...",success:"OK",error:Mn=>Mn.message}),zt(!1);return}}catch{}finally{zt(!1)}}const Ir=l==="pair",[mr,Qn]=String(c||"").split("/").map(vn=>vn.trim().toUpperCase()),xs=m.useMemo(()=>Ir?0:Number((Xt?_[0]:_[1])||0),[Ir,Xt,_]),Xs=Number(Ir?Xn||0:ws||0),ii=u!=="twap"&&Xs<10,Pr=ii?"Order must have minimum value of $10.":rr?"Not Enough Margin":Zt?"Placing...":u==="twap"?l==="pair"?"Start Pair TWAP":"Start TWAP":u==="scale"?"Place Scale Orders":l==="pair"?"Place Pair Order":"Place Order";return i.jsxs("div",{className:"w-full text-[12px]",style:{background:PHe,borderRadius:16,padding:12},children:[i.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[i.jsxs("div",{className:"flex flex-1 gap-2",children:[i.jsx(y4,{onClick:()=>ee(!0),children:ge}),i.jsx(y4,{onClick:Lt?()=>fe(!0):void 0,children:Lt?`${Ie}x`:i.jsx("span",{className:"flex items-center justify-center gap-1",children:i.jsx("span",{className:"inline-block w-3 h-3 border-2 border-[#67FFBD] border-t-transparent rounded-full animate-spin"})})}),i.jsx(y4,{onClick:()=>he(!0),children:ut})]}),i.jsx(Zhn,{skipConfirm:p,setSkipConfirm:S})]}),Be&&i.jsx("div",{className:"mb-3",children:i.jsx(yT,{wallets:ct,value:Et,selectedBalance:Ut==null?void 0:Ut.balance,onChange:vn=>{if(String(Et)===String(vn))return;nt(vn);const Mn=(ct||[]).find(ot=>String(ot.wallet_id)===String(vn));o==null||o({id:String(vn),address:(Mn==null?void 0:Mn.wallet_address)||null})}})}),i.jsx(ihn,{mode:u,onModeChange:d,moreItems:[{key:"twap",label:"TWAP"}],className:"mb-3"}),!Ir&&i.jsx("div",{className:"mb-1",children:i.jsxs("div",{className:"mb-3 grid grid-cols-2 gap-2",children:[i.jsx("button",{type:"button",onClick:()=>x("buy"),className:"h-[34px] rounded-lg font-bold transition-colors flex justify-center items-center",style:{background:f==="buy"?"rgb(103, 255, 189)":Io,color:f==="buy"?"rgb(15, 21, 26)":Li},children:"Buy / Long"}),i.jsx("button",{type:"button",onClick:()=>x("sell"),className:"h-[34px] rounded-lg font-bold transition-colors flex justify-center items-center",style:{background:f==="sell"?"rgb(255,121,124)":Io,color:f==="sell"?"rgb(15, 21, 26)":Li},children:"Sell / Short"})]})}),i.jsxs("div",{className:"flex items-center justify-between mb-2",children:[i.jsx("div",{style:{color:yi},children:"Available to Trade"}),i.jsxs("div",{className:"text-white font-semibold",children:[xs.toLocaleString(void 0,{maximumFractionDigits:2})," ","USDC"]})]}),i.jsxs("div",{className:"flex items-center justify-between mb-2",children:[i.jsx("div",{style:{color:yi},children:"Current Position"}),i.jsx("div",{className:"text-white font-semibold",children:Yr?`${Math.abs(Yr).toLocaleString(void 0,{maximumFractionDigits:We??5})} ${e}`:`0.00000 ${e}`})]}),!Ir&&u==="limit"&&i.jsx("div",{className:"mb-3",children:i.jsx(yb,{label:"Price (USDC)",value:g,onChange:v,right:i.jsx("div",{className:"h-[22px] px-2 rounded-md flex justify-center items-center cursor-pointer",style:{background:"#1b242c",color:"#67FFBD",border:`1px solid ${Oa}`},onClick:()=>v(t??""),children:"Mid"})})}),!Ir&&(u==="market"||u==="limit")&&i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"mb-3",children:i.jsx(yb,{label:"Size",value:w,onChange:Vr,right:i.jsx(JP,{value:N,onChange:dr,items:[{key:"USD",label:"USDC"},{key:"COIN",label:e}]})})}),i.jsxs("div",{className:"flex items-center gap-3 mb-6 ",children:[i.jsx(XN,{value:I,onChange:yt,accent:wt}),i.jsxs("div",{className:"h-[30px] rounded-lg flex items-center px-2",style:{width:84,background:Io,border:`1px solid ${Oa}`},children:[i.jsx("input",{className:"w-full bg-transparent outline-none text-right text-xs",inputMode:"numeric",value:I,onChange:vn=>yt(Math.max(0,Math.min(100,Number(vn.target.value)||0))),style:{color:Li,fontFeatureSettings:'"tnum"'}}),i.jsx("span",{style:{color:yi},className:"ml-1",children:"%"})]})]}),i.jsxs("div",{className:`${u==="market"?"flex-col space-y-2":"flex"} items-center justify-between mb-2`,children:[i.jsxs("label",{className:"flex items-center gap-2",style:{color:"#c9d1d9"},children:[i.jsx("input",{type:"checkbox",className:"accent-[#67FFBD]",checked:F,onChange:vn=>U(vn.target.checked)}),"Reduce Only"]}),u==="limit"&&i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(mi,{align:"left",content:"Time In Force <br><br>GTC (Good Til Cancel): Order will rest until filled or canceled.<br><br>IOC (Immediate Or Cancel): Any portion that is not immediately filled will be canceled.<br><br>ALO (Add Liquidity Only): Order will exist only as a limit order on the book. Also known as post-only.",children:i.jsx("span",{style:{color:yi},children:"TIF"})}),i.jsx(JP,{value:L,onChange:z,items:[{key:"GTC",label:"GTC"},{key:"IOC",label:"IOC"},{key:"ALO",label:"ALO"}]})]}),u==="market"&&i.jsxs("label",{className:"flex items-center gap-2",style:{color:"#c9d1d9"},children:[i.jsx("input",{type:"checkbox",className:"accent-[#67FFBD]",checked:Q,onChange:vn=>ne(vn.target.checked)}),"TP/SL"]})]}),u==="limit"&&i.jsxs("label",{className:"flex items-center gap-2 mb-2",style:{color:"#c9d1d9"},children:[i.jsx("input",{type:"checkbox",className:"accent-[#67FFBD]",checked:Q,onChange:vn=>ne(vn.target.checked)}),"TP/SL"]}),Q&&i.jsxs("div",{className:"grid grid-cols-2 gap-2 mb-3",children:[i.jsx(yb,{label:"TP",value:J,onChange:ce}),i.jsx(yb,{label:"Gain %",value:Y,onChange:Gt,right:i.jsx("span",{style:{color:yi},children:"%"})}),i.jsx(yb,{label:"SL",value:re,onChange:Pt}),i.jsx(yb,{label:"Loss %",value:oe,onChange:rt,right:i.jsx("span",{style:{color:yi},children:"%"})})]})]}),Ir&&i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"mb-2 w-full flex justify-between gap-2",children:[i.jsxs("span",{className:"h-[34px] rounded-lg font-semibold bg-[rgba(103,255,189,0.16)] text-[#67FFBD] flex justify-center items-center w-1/2",children:[i.jsx("img",{src:`https://app.hyperliquid.xyz/coins/${mr}.svg`,alt:"Dextrabot - Terminal",className:"w-4 h-4 mr-2"}),mr," Long"]}),i.jsxs("span",{className:"h-[34px] rounded-lg font-semibold bg-[rgba(255,121,124,0.12)] text-[#FF7272] flex justify-center items-center w-1/2",children:[i.jsx("img",{src:`https://app.hyperliquid.xyz/coins/${Qn}.svg`,alt:"Dextrabot - Terminal",className:"w-4 h-4 mr-2"}),Qn," Short"]})]}),i.jsx("div",{className:"mb-3",children:i.jsx(Xhn,{value:Kn,onChange:Cn,leftLabel:mr,rightLabel:Qn,leftUsd:Number(Xn||0)>0?Number(Xn)*Kn/100:0,rightUsd:Number(Xn||0)>0?Number(Xn)*(100-Kn)/100:0})}),i.jsx("div",{className:"mb-3",children:i.jsx(yb,{label:"Size (USD)",value:Xn,onChange:vn=>{or(vn)},right:i.jsx("div",{className:"h-[22px] px-2 rounded-md flex justify-center items-center cursor-pointer",style:{background:"#1b242c",color:"#67FFBD",border:`1px solid ${Oa}`},onClick:()=>{const vn=sr*(Number(Ie)||1);or(String(vn.toFixed(2)))},children:"Max"})})}),i.jsxs("div",{className:"flex items-center justify-between mb-2",children:[i.jsxs("label",{className:"flex items-center gap-2",style:{color:"#c9d1d9"},children:[i.jsx("input",{type:"checkbox",className:"accent-[#67FFBD]",checked:F,onChange:vn=>U(vn.target.checked)}),"Reduce Only"]}),u==="limit"&&i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{style:{color:yi},children:"TIF"}),i.jsx(JP,{value:L,onChange:z,items:[{key:"GTC",label:"GTC"},{key:"IOC",label:"IOC"},{key:"ALO",label:"ALO"}]})]})]})]}),u==="twap"&&!Ir&&i.jsxs(i.Fragment,{children:[i.jsx(yb,{label:"Total Size",value:It,onChange:Ar,right:i.jsx(JP,{value:jt,onChange:Br,items:[{key:"USDC",label:"USDC"},{key:"COIN",label:e}]})}),i.jsxs("div",{className:"flex items-center gap-3 mb-8 mt-3",children:[i.jsx(XN,{value:Ye,onChange:tr,accent:wt}),i.jsxs("div",{className:"h-[30px] rounded-lg flex items-center px-2",style:{width:84,background:Io,border:`1px solid ${Oa}`},children:[i.jsx("input",{className:"w-full bg-transparent outline-none text-right text-xs",inputMode:"numeric",value:Ye,onChange:vn=>tr(Math.max(0,Math.min(100,Number(vn.target.value)||0))),style:{color:Li,fontFeatureSettings:'"tnum"'}}),i.jsx("span",{style:{color:yi},className:"ml-1",children:"%"})]})]}),i.jsx("div",{className:"mb-2 mt-3",style:{color:yi},children:"Running Time (5m - 24h)"}),i.jsxs("div",{className:"grid grid-cols-2 gap-2 mb-3",children:[i.jsx("div",{className:"h-[30px] px-2 rounded-lg flex items-center",style:{background:Io,border:`1px solid ${Oa}`},children:i.jsx("input",{className:"w-full bg-transparent outline-none text-right",inputMode:"numeric",placeholder:"Hour(s)",value:un===0?"":un,onChange:vn=>{const Mn=vn.target.value.replace(/[^\d]/g,""),ot=Math.max(0,Math.min(24,Number(Mn)||0));Ft(ot)},style:{color:un?"#FFFFFF":yi,fontFeatureSettings:'"tnum"'}})}),i.jsx("div",{className:"h-[30px] px-2 rounded-lg flex items-center",style:{background:Io,border:`1px solid ${Oa}`},children:i.jsx("input",{className:"w-full bg-transparent outline-none text-right",inputMode:"numeric",placeholder:"Minute(s)",value:Ke===0?"":Ke,onFocus:()=>{Ke===5&&Bt(0)},onChange:vn=>{const Mn=vn.target.value.replace(/[^\d]/g,""),ot=Math.max(0,Math.min(59,Number(Mn)||0));Bt(ot)},style:{color:Ke?"#FFFFFF":yi,fontFeatureSettings:'"tnum"'}})})]}),i.jsxs("div",{className:"flex-col space-y-2 items-center gap-6 mb-3",children:[i.jsxs("label",{className:"flex items-center gap-2",style:{color:"#c9d1d9"},children:[i.jsx("input",{type:"checkbox",className:"accent-[#67FFBD]",checked:$t,onChange:vn=>qe(vn.target.checked)}),"Randomize"]}),i.jsxs("label",{className:"flex items-center gap-2",style:{color:"#c9d1d9"},children:[i.jsx("input",{type:"checkbox",className:"accent-[#67FFBD]",checked:F,onChange:vn=>U(vn.target.checked)}),"Reduce Only"]})]})]}),Be?i.jsx("button",{onClick:ss,disabled:Zt||!Et||rr||ii,className:"w-full h-[32px] rounded-xl font-bold transition-opacity mb-2 flex items-center justify-center disabled:opacity-60",style:{background:wt,color:"#0f151a"},children:Pr}):i.jsx(Zp,{onClick:()=>{Ge==null||Ge(),Fe(!0)}}),u==="twap"&&!Ir?i.jsxs("div",{className:"mt-4 border-t border-b border-dashed border-[#2F2F2F]",children:[i.jsxs("div",{className:"flex items-center justify-between px-0 py-2 text-[13px] font-inter leading-4 border-t border-dashed border-[#2F2F2F] first:border-t-0",children:[i.jsx("span",{className:"text-[#929292]",children:"Frequency"}),i.jsx("span",{className:"text-white",children:"30 seconds"})]}),i.jsxs("div",{className:"flex items-center justify-between px-0 py-2 text-[13px] font-inter leading-4 border-t border-dashed border-[#2F2F2F] first:border-t-0",children:[i.jsx("span",{className:"text-[#929292]",children:"Runtime"}),i.jsxs("span",{className:"text-white",children:[cr.toLocaleString(void 0,{maximumFractionDigits:0})," ","minutes"]})]}),i.jsxs("div",{className:"flex items-center justify-between px-0 py-2 text-[13px] font-inter leading-4 border-t border-dashed border-[#2F2F2F] first:border-t-0",children:[i.jsx("span",{className:"text-[#929292]",children:"Number of Orders"}),i.jsx("span",{className:"text-white",children:Nr.toLocaleString(void 0,{maximumFractionDigits:0})})]}),i.jsxs("div",{className:"flex items-center justify-between px-0 py-2 text-[13px] font-inter leading-4 border-t border-dashed border-[#2F2F2F] first:border-t-0",children:[i.jsx("span",{className:"text-[#929292]",children:"Size per Suborder"}),i.jsx("span",{className:"text-white",children:ur>0?`${ur.toLocaleString(void 0,{maximumFractionDigits:We??5})} ${e}`:`0.00000 ${e}`})]}),i.jsxs("div",{className:"flex items-center justify-between px-0 py-2 text-[13px] font-inter leading-4 border-t border-dashed border-[#2F2F2F] first:border-t-0",children:[i.jsx("span",{className:"text-[#929292]",children:"Fees"}),i.jsx("span",{className:"text-[#67FFBD]",children:yr})]})]}):i.jsxs("div",{className:"mt-4 border-t border-b border-dashed border-[#2F2F2F]",children:[i.jsxs("div",{className:"flex items-center justify-between px-0 py-2 text-[13px] font-inter leading-4 border-t border-dashed border-[#2F2F2F] first:border-t-0",children:[i.jsx("span",{className:"text-[#929292]",children:"Liquidation Price"}),i.jsx("span",{className:"text-white",children:Ir?"-":es?`$${es.toLocaleString(void 0,{maximumFractionDigits:2})}`:"$0.00"})]}),i.jsxs("div",{className:"flex items-center justify-between px-0 py-2 text-[13px] font-inter leading-4 border-t border-dashed border-[#2F2F2F] first:border-t-0",children:[i.jsx("span",{className:"text-[#929292]",children:"Order Value"}),i.jsx("span",{className:"text-white",children:Ir?`$${Number(Xn||0).toLocaleString(void 0,{maximumFractionDigits:2})}`:`$${(ws||0).toLocaleString(void 0,{maximumFractionDigits:2})}`})]}),i.jsxs("div",{className:"flex items-center justify-between px-0 py-2 text-[13px] font-inter leading-4 border-t border-dashed border-[#2F2F2F] first:border-t-0",children:[i.jsx("span",{className:"text-[#929292]",children:"Margin Required"}),i.jsx("span",{className:"text-white",children:Ir?`$${(Number(Xn||0)/(Number(Ie)||1)||0).toLocaleString(void 0,{maximumFractionDigits:2})}`:`$${(ls||0).toLocaleString(void 0,{maximumFractionDigits:2})}`})]}),i.jsxs("div",{className:"flex items-center justify-between px-0 py-2 text-[13px] font-inter leading-4 border-t border-dashed border-[#2F2F2F] first:border-t-0",children:[i.jsx("span",{className:"text-[#929292]",children:"Slippage"}),i.jsxs("button",{type:"button",onClick:()=>Yn(!0),className:"text-[#67FFBD] hover:opacity-80 h-5 text-xs flex justify-center items-center",children:[`Est: ${Gs}% / `,`Max: ${Number(tn||0).toFixed(2)}%`]})]})]}),Be&>&&i.jsx("button",{onClick:()=>ft(!0),className:"flex w-full h-[32px] px-4 py-2 justify-center items-center gap-[10px] shrink-0 rounded-lg bg[rgba(103,255,189,0.16)] text-[#67FFBD] font-inter text-[13px] not-italic font-medium leading-[16px] mt-3 transition-opacity",children:"Deposit"}),Be&>&&i.jsxs("div",{className:"flex w-full gap-2 mt-2",children:[i.jsxs(dSe,{onClick:()=>$e(!0),className:"flex-1",children:["Perps ",i.jsx(Tae,{className:"mx-1 text-xs"})," Spot"]}),i.jsx(dSe,{onClick:()=>tt(!0),className:"flex-1",children:"Withdraw"})]}),i.jsxs("div",{className:"mt-3 pt-2",children:[i.jsx("div",{className:"mb-2 text-white font-inter text-[13px] font-normal leading-4",children:"Account Equity"}),i.jsx(gv,{k:"Spot",v:`$${xSe(En??Number(kt.spot||0))}`}),i.jsx(gv,{k:"Perps",v:`$${xSe(Ut.balance)}`})]}),i.jsxs("div",{className:"mt-3 pt-2",children:[i.jsx("div",{className:"mb-2 text-white font-inter text-[13px] font-normal leading-4",children:"Perps Overview"}),i.jsx(gv,{k:"Balance",v:`$${Z7(Ut.balance,2)}`}),i.jsx(gv,{k:"Unrealized PNL",v:i.jsxs("span",{style:{color:Ut.uPnl<0?"#FF7173":"#67FFBD"},children:["$",Z7(Ut.uPnl,2)]})}),i.jsx(gv,{k:"Cross Margin Ratio",v:i.jsxs("span",{style:{color:Ut.cmr>=.5?"#FF7173":"#67FFBD"},children:[Z7(Ut.cmr*100,2),"%"]}),link:!0}),i.jsx(gv,{k:"Maintenance Margin",v:`$${Z7(Ut.maintenanceMargin,2)}`}),i.jsx(gv,{k:"Cross Account Leverage",v:`${Z7(Ut.crossLeverage,2)}x`})]}),i.jsx(hhn,{open:lt,onClose:()=>ft(!1),initialAsset:"USDC",initialChain:"Arbitrum",toWalletAddress:(gt==null?void 0:gt.wallet_address)||""}),i.jsx(LHe,{open:Qe,onClose:()=>$e(!1),perpsAvailable:_r,spotUsdcAvailable:Pn,onSubmit:Rr,loading:sn,initialToPerp:!1}),i.jsx(Yhn,{open:it,onClose:()=>tt(!1),perpsBalance:Number((Ut==null?void 0:Ut.balance)??0),defaultDest:st||""}),i.jsx(Jh,{open:ae,onClose:()=>fe(!1),children:i.jsxs(um,{title:"Adjust Leverage",children:[i.jsxs("div",{className:"text-[12px] leading-5 mb-3",style:{color:yi},children:["Control the leverage used for ",Ir?`${mr}/${Qn}`:e," ","positions. The maximum leverage is ",mt,"x. Max position size decreases the higher your leverage."]}),i.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[i.jsx("input",{type:"range",min:1,max:mt,step:1,value:Ie,onChange:vn=>Le(Number(vn.target.value)),className:"flex-1",style:{accentColor:Fg}}),i.jsxs("div",{className:"h-[36px] rounded-lg flex items-center px-2",style:{width:84,background:Io,border:`1px solid ${Oa}`},children:[i.jsx("input",{className:"w-full bg-transparent outline-none text-right",inputMode:"numeric",value:Ie,onChange:vn=>Le(Math.max(1,Math.min(mt,Number(vn.target.value)||1))),style:{color:Li,fontFeatureSettings:'"tnum"'}}),i.jsx("span",{style:{color:yi},className:"ml-1",children:"x"})]})]}),i.jsx(P0,{onClick:()=>ln(()=>fe(!1)),children:"Confirm"}),i.jsxs("div",{className:"mt-3 flex items-start gap-2 text-[12px]",style:{color:"#ffd27a"},children:[i.jsx("span",{children:"⚠️"}),i.jsx("span",{children:"Higher leverage increases the risk of liquidation."})]})]})}),i.jsx(Jh,{open:Nt,onClose:()=>Yn(!1),children:i.jsxs(um,{title:"Adjust Max Slippage",children:[i.jsx("div",{className:"text-[12px] leading-5 mb-3",style:{color:yi},children:"Max slippage only affects market orders placed from the order form. Closing positions will use max slippage of 8% and market TP/SL orders will use max slippage of 10%."}),i.jsxs("div",{className:"h-[36px] rounded-lg flex items-center px-2 mb-3",style:{width:120,background:Io,border:`1px solid ${Oa}`},children:[i.jsx("input",{className:"w-full bg-transparent outline-none text-right",type:"text",inputMode:"decimal",value:tn,onChange:vn=>{const Mn=vn.target.value.replace(",",".");if(Mn===""){In("");return}/^\d*\.?\d*$/.test(Mn)&&In(Mn)},style:{color:Li,fontFeatureSettings:'"tnum"'}}),i.jsx("span",{style:{color:yi},className:"ml-1",children:"%"})]}),i.jsx(P0,{onClick:Je,children:"Confirm"})]})}),i.jsx(Jh,{open:V,onClose:()=>ee(!1),children:i.jsxs(um,{title:`${Ir?`${mr}/${Qn}`:e} Margin Mode`,children:[i.jsx(_X,{active:ge==="Cross",onClick:()=>ye("Cross"),title:"Cross",desc:"All cross positions share the same cross margin as collateral. In the event of liquidation, your cross margin balance and any remaining open positions under assets in this mode may be forfeited."}),i.jsx(_X,{active:ge==="Isolated",onClick:()=>ye("Isolated"),title:"Isolated",desc:"Manage your risk on individual positions by restricting the amount of margin allocated to each. If the margin ratio of an isolated position reaches 100%, the position will be liquidated. Margin can be added or removed to individual positions in this mode."}),i.jsx("div",{className:"mt-3",children:i.jsx(P0,{onClick:()=>ln(()=>ee(!1)),children:"Confirm"})})]})}),i.jsx(Jh,{open:Ne,onClose:()=>he(!1),children:i.jsxs(um,{title:"Position Mode",children:[i.jsx(_X,{active:ut==="One-Way",onClick:()=>qt("One-Way"),title:"One-Way",desc:"Open orders in the same direction merge into a single position for each market."}),i.jsx("div",{className:"mt-3",children:i.jsx(P0,{onClick:()=>he(!1),children:"Confirm"})})]})})]})}const vb=({name:e,minFilterType:t,maxFilterType:n,handleChange:r,minInputName:s,maxInputName:a,isTooltip:o})=>{const l=f=>{f.preventDefault()},c=f=>{f.target.addEventListener("wheel",l,{passive:!1})},u=f=>{f.target.removeEventListener("wheel",l)},d=f=>{["-","+","e"].includes(f.key)&&f.preventDefault()};return i.jsxs("div",{className:`${e=="Account Value"?"mb-20":""} col-span-1 flex flex-col justify-start max-w-full z-3 font-manrope gap-[13px] mx-4`,children:[i.jsxs("p",{className:"text-[#c9c9c9] text-[13px] font-semibold font-manrope leading-[8px] flex justify-start items-center gap-1",children:[e,o&&i.jsxs("span",{className:"flex justify-start items-center has-tooltip relative",children:[i.jsx(Ni,{className:"text-[#c9c9c9] w-4 min-w-4 min-h-4 h-4"}),i.jsx("span",{className:"",children:i.jsx(Fa,{content:"Snapshot data per hour",positionTop:!1,alignRight:!0})})]})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("input",{value:t,onChange:r,type:"number",name:s,onFocus:c,onBlur:u,autoComplete:"off",onKeyDown:["Unrealized PnL","Funding Paid"].includes(e)?void 0:d,placeholder:"Min",className:`py-0.5 bg-[#1b1b1b] rounded-md border border-[#303030] h-8 block text-white text-sm font-medium font-inter leading-[8px] w-1/2 px-2 ${t!=null&&t!==""?"border border-[#8d67ff]":""} focus:ring-1 focus:ring-[#8d67ff] focus:outline-none placeholder:text-[#535353] placeholder:text-sm placeholder:font-medium placeholder:font-inter placeholder:leading-[8px]`}),i.jsx("input",{value:n,onChange:r,type:"number",name:a,autoComplete:"off",onFocus:c,onBlur:u,onKeyDown:["Unrealized PnL","Funding Paid"].includes(e)?void 0:d,placeholder:"Max",className:`bg-[#1b1b1b] rounded-md border border-[#303030] py-0.5 h-8 block sm:text-sm font-semibold font-manrope leading-none w-1/2 px-2 ${n!=null&&n!==""?"border border-[#8d67ff]":""} focus:ring-1 focus:ring-[#8d67ff] focus:outline-none placeholder:text-[#535353] placeholder:text-sm placeholder:font-medium placeholder:font-inter placeholder:leading-[8px]`})]})]})},ipn=({walletFilter:e,setWalletFilter:t,filterTerminal:n,setFilterTerminal:r,resetFilters:s})=>{const a=m.useRef(null),o=c=>{const{name:u,value:d}=c.target;r(f=>({...f,[u]:d}))},l=c=>{var u;c.key==="Escape"&&(t(""),(u=a.current)==null||u.blur())};return i.jsxs("div",{className:"flex flex-col items-center gap-4 w-full h-full p-1 sm:p-2 mt-4 sm:px-0 overflow-y-scroll",children:[i.jsxs("div",{className:"flex flex-col items-center gap-2.5 w-[90%] sm:w-[90%]",children:[i.jsx("div",{className:"text-[#c9c9c9] text-[13px] font-semibold font-manrope leading-[8px] flex justify-start items-center gap-1 w-full pl-1",children:"Search Wallet"}),i.jsxs("div",{className:"flex justify-center items-center gap-0.5 h-max rounded-lg border border-[#333333] w-full overflow-hidden p-0.5",children:[i.jsx("input",{ref:a,type:"text",value:e,name:"walletFilter",onChange:c=>t(c.target.value),onKeyDown:l,className:"bg-[#353535] rounded text-white py-1 pl-2 pr-3 w-full text-sm outline-none placeholder:text-sm placeholder:font-semibold placeholder:font-manrope placeholder:text-[#7c7c7c] font-manrope",placeholder:"Search Wallet"}),i.jsx("div",{onClick:()=>t(""),className:"text-[#aaa] hover:text-white outline-none focus:outline-none focus:ring-0 border-none w-4 h-[26px] bg-[#353535] hover:bg-[#333333] rounded-l rounded-r-lg flex justify-center items-center cursor-pointer",children:i.jsx("img",{src:Ba,alt:"",className:"w-[14px] h-[14px] min-w-[14px] min-h-[14px]"})})]})]}),i.jsx(vb,{minFilterType:n==null?void 0:n.min_notional,maxFilterType:n==null?void 0:n.max_notional,handleChange:o,minInputName:"min_notional",maxInputName:"max_notional",name:"Notional",isTooltip:!1}),i.jsx(vb,{minFilterType:n==null?void 0:n.min_size,maxFilterType:n==null?void 0:n.max_size,handleChange:o,minInputName:"min_size",maxInputName:"max_size",name:"Size",isTooltip:!1}),i.jsx(vb,{minFilterType:n==null?void 0:n.min_entry,maxFilterType:n==null?void 0:n.max_entry,handleChange:o,minInputName:"min_entry",maxInputName:"max_entry",name:"Entry",isTooltip:!1}),i.jsx(vb,{minFilterType:n==null?void 0:n.min_liq_price,maxFilterType:n==null?void 0:n.max_liq_price,handleChange:o,minInputName:"min_liq_price",maxInputName:"max_liq_price",name:"Liq. Price",isTooltip:!1}),i.jsx(vb,{minFilterType:n==null?void 0:n.min_unrealized_pnL,maxFilterType:n==null?void 0:n.max_unrealized_pnL,handleChange:o,minInputName:"min_unrealized_pnL",maxInputName:"max_unrealized_pnL",name:"Unrealized PnL",isTooltip:!1}),i.jsx(vb,{minFilterType:n==null?void 0:n.min_funding_paid,maxFilterType:n==null?void 0:n.max_funding_paid,handleChange:o,minInputName:"min_funding_paid",maxInputName:"max_funding_paid",name:"Funding Paid",isTooltip:!1}),i.jsx(vb,{minFilterType:n==null?void 0:n.min_account_value,maxFilterType:n==null?void 0:n.max_account_value,handleChange:o,minInputName:"min_account_value",maxInputName:"max_account_value",name:"Margin",isTooltip:!1}),i.jsx(vb,{minFilterType:n==null?void 0:n.min_perp_equity,maxFilterType:n==null?void 0:n.max_perp_equity,handleChange:o,minInputName:"min_perp_equity",maxInputName:"max_perp_equity",name:"Account Value",isTooltip:!1})]})},BHe=m.createContext({key:"All",setKey:()=>{}});function apn({children:e}){const t=typeof window<"u"&&localStorage.getItem("terminal_side_filter")||"All",[n,r]=m.useState(t);m.useEffect(()=>{typeof window<"u"&&localStorage.setItem("terminal_side_filter",n)},[n]);const s=m.useMemo(()=>({key:n,setKey:r}),[n]);return i.jsx(BHe.Provider,{value:s,children:e})}function w2(){return m.useContext(BHe)}function opn({className:e=""}){const{key:t,setKey:n}=w2(),r=["All","Active","Long","Short"];return i.jsxs("label",{className:`inline-flex items-center gap-2 ${e}`,children:[i.jsx("span",{className:"text-[#9B9B9B] text-[12px]",children:"Filter"}),i.jsx("select",{value:t,onChange:s=>n(s.target.value),className:"h-7 bg-[#262626] text-white text-[12px] rounded-md px-2 border border-[#2F2F2F] outline-none",children:r.map(s=>i.jsx("option",{value:s,children:s},s))})]})}function lpn(e){var a;const t=((e==null?void 0:e.direction)||(e==null?void 0:e.posSide)||(e==null?void 0:e.position_side)||"").toString().toLowerCase();if(t==="long")return"Long";if(t==="short")return"Short";const n=((e==null?void 0:e.dir)||(e==null?void 0:e.sideText)||"").toString().toLowerCase();if(n.includes("open long")||n.includes("close short")||n.includes("short > long")||n.endsWith(" long"))return"Long";if(n.includes("open short")||n.includes("close long")||n.includes("long > short")||n.endsWith(" short"))return"Short";const r=((e==null?void 0:e.side)||"").toString();if(r==="B"||r==="Buy")return"Long";if(r==="A"||r==="Sell")return"Short";if((e==null?void 0:e.isBuy)===!0||(e==null?void 0:e.b)===!0)return"Long";if((e==null?void 0:e.isBuy)===!1||(e==null?void 0:e.b)===!1)return"Short";const s=Number((e==null?void 0:e.szi)??(e==null?void 0:e.size)??((a=e==null?void 0:e.position)==null?void 0:a.szi)??0);return s>0?"Long":s<0?"Short":(e==null?void 0:e.side)==="Long"||(e==null?void 0:e.type)==="Long"?"Long":(e==null?void 0:e.side)==="Short"||(e==null?void 0:e.type)==="Short"?"Short":null}function cpn(e,t){var n;if(t==="positions"){const r=Number((e==null?void 0:e.szi)??(e==null?void 0:e.size)??((n=e==null?void 0:e.position)==null?void 0:n.szi)??0);return Math.abs(r)>0}return!0}function Jg(e,t="generic",n="All"){if(!Array.isArray(e)||e.length===0)return e||[];if(n==="All")return e;if(n==="Active")return e.filter(s=>cpn(s,t));const r=n;return e.filter(s=>{const a=lpn(s);return a?a===r:!1})}const upn=({data:e,loading:t,error:n,isDigits:r,period:s,periods:a,handlePeriodChange:o})=>{const[l,c]=m.useState("All"),[u,d]=m.useState(!1),{key:f}=w2(),{copyTradeWatchList:x,trackedWatchList:g,setSignModalOpen:v}=m.useContext(Qr),{address:w}=ns(),[C,N]=m.useState(!1),[P,I]=m.useState(null),[R,F]=m.useState(null),[U,L]=m.useState(""),[z,Q]=m.useState(""),[ne,J]=m.useState({min_notional:"",max_notional:"",min_size:"",max_size:"",min_entry:"",max_entry:"",min_mark_price:"",max_mark_price:"",min_liq_price:"",max_liq_price:"",min_unrealized_pnL:"",max_unrealized_pnL:"",min_funding_paid:"",max_funding_paid:"",min_account_value:"",max_account_value:"",min_perp_equity:"",max_perp_equity:""}),X=()=>{c("All"),Q(""),J({min_notional:"",max_notional:"",min_size:"",max_size:"",min_entry:"",max_entry:"",min_mark_price:"",max_mark_price:"",min_liq_price:"",max_liq_price:"",min_unrealized_pnL:"",max_unrealized_pnL:"",min_funding_paid:"",max_funding_paid:"",min_account_value:"",max_account_value:"",min_perp_equity:"",max_perp_equity:""})},pe=((G,V)=>V.reduce((ee,ae)=>{const fe=G[ae];return fe!==void 0&&fe!==""&&fe!==null&&ee++,ee},0))({...ne,walletFilter:z},[...Object.keys(ne),"walletFilter"]),Y=m.useMemo(()=>Jg(e,"positions",f),[e,f]),ie=async({walletAddress:G,isFollow:V,isScalper:ee})=>{try{L(G);const ae=window.localStorage.getItem("hyperToken"),fe=window.localStorage.getItem("hyperAddress");if(!ae){v(!0);return}const Ne=V?"https://dextrabothypev2.nftinit.io/api/test_app/following/info/":"https://dextrabothypev2.nftinit.io/api/hyper/following/get_setting/",he=V?{address:w?w.toLowerCase():fe,token:ae,follow_address:G.toLowerCase()}:{address:w?w.toLowerCase():fe,token:ae},ge=await fetch(Ne,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(he)});if(!ge.ok)throw new zl(`Server responded with status ${ge.status}`);const ye=await ge.json();ye.success?(I(Array.isArray(ye==null?void 0:ye.data)?[...ye.data].sort((ve,je)=>new Date(je.created_at||0)-new Date(ve.created_at||0)):ye==null?void 0:ye.data),F(ee),N(!0)):rn.error(ye.error_message)}catch(ae){rn.error(ae.message||"Something went wrong!")}},oe=[{key:"action",label:"Action",sortable:!1,width:"125px",render:(G,V)=>i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("div",{onClick:ee=>{ee.preventDefault();const ae=x==null?void 0:x.some(fe=>fe.wallet_address===(V==null?void 0:V.address));ie({walletAddress:V==null?void 0:V.address,isFollow:ae,isScalper:V==null?void 0:V.is_scalper})},className:`${x.some(ee=>ee.wallet_address===(V==null?void 0:V.address))?"bg-[#67ffbd] text-[#161616] font-semibold":"border border-[#67ffbd] bg-[#161616] text-[#67ffbd] hover:bg-[#67ffbd] hover:text-[#161616] font-bold"} h-[22px] rounded-[256px] inline-flex items-center px-2 text-[12px] leading-[8px] tracking-tight cursor-pointer`,children:"Copy Trade"}),i.jsx(v5,{walletAddress:V==null?void 0:V.address,children:i.jsx("div",{className:"w-[18px] h-[18px] flex items-center justify-center cursor-pointer",children:g.some(ee=>ee.wallet_address===(V==null?void 0:V.address))?i.jsx("img",{src:o5,alt:"",className:"w-3.5 h-3.5 min-w-3.5 min-h-3.5"}):i.jsx("img",{src:NA,alt:"",className:"w-3.5 h-3.5 min-w-3.5 min-h-3.5"})})})]})},{key:"address",label:"Wallet",sortable:!0,sortValue:G=>(G.address||"").toLowerCase(),render:(G,V)=>i.jsx("div",{onClick:()=>window.open(`/wallet-details/${V==null?void 0:V.address}`,"_blank"),className:"flex items-center gap-2.5 cursor-pointer",children:i.jsxs("div",{className:"flex items-center gap-1",children:[i.jsx(Zx,{info:V!=null&&V.address?`${V.address.slice(0,5)}...${V.address.slice(-4)}`:"--",textColor:"text-white"}),i.jsx("img",{onClick:ee=>{ee.stopPropagation(),navigator.clipboard.writeText((V==null?void 0:V.address)||""),rn.success("Successfully copied.",{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(103, 255, 189, 0.16)",width:"280px",minWidth:"280px",height:"40px",backdropFilter:"blur(16px)"},iconTheme:{primary:"#67FFBD",secondary:"#276047"}})},src:wo,alt:"",className:"cursor-pointer"})]})})},{key:"direction",label:"Direction",sortable:!0,sortValue:G=>G.direction==="long"?1:G.direction==="short"?0:-1,render:(G,V)=>i.jsx("div",{className:"flex items-center gap-2 h-8",children:i.jsxs("div",{className:`${V.direction==="long"?"text-[#67ffbd] bg-[#67ffbd]/20":V.direction==="short"?"text-[#ff787b] bg-[#ff797c]/20":"text-[#67ffbd] bg-[#67ffbd]/20"} h-5 pl-1 pr-1.5 py-1 rounded-md inline-flex items-center gap-0.5`,children:[i.jsx("div",{className:"w-3 h-3 flex items-center justify-center",children:V.direction==="long"?i.jsx(Ps,{className:"text-[#67FFBD] rotate-180 w-3 h-3"}):V.direction==="short"?i.jsx(Ps,{className:"text-[#FF797C] w-3 h-3"}):i.jsx(Ps,{className:"text-[#67FFBD] rotate-180 w-3 h-3"})}),i.jsxs("div",{className:"text-[11px] font-semibold leading-[8px] tracking-wide uppercase",children:[V.direction," - ",V.leverage_value,"x"]})]})})},{key:"notional",label:"Notional",sortable:!0,sortValue:G=>Number(G.notional)||-1/0,render:(G,V)=>i.jsx(Zx,{info:(V==null?void 0:V.notional)==null||isNaN(parseFloat(V==null?void 0:V.notional))?"--":`$${ed(V==null?void 0:V.notional)}`,textColor:"text-white"})},{key:"szi",label:"Size",sortable:!0,sortValue:G=>Number(G.szi)||-1/0,render:(G,V)=>i.jsx(Zx,{info:(V==null?void 0:V.szi)==null||isNaN(parseFloat(V==null?void 0:V.szi))?"--":`${Er(V==null?void 0:V.szi)}`,textColor:"text-white"})},{key:"entry_price",label:"Entry Price",sortable:!0,sortValue:G=>Number(G.entry_price)||-1/0,render:(G,V)=>i.jsx(Zx,{info:(V==null?void 0:V.entry_price)==null||isNaN(parseFloat(V==null?void 0:V.entry_price))?"--":`$${Ww(parseFloat(V==null?void 0:V.entry_price).toFixed((V==null?void 0:V.entry_price)>=1e4?0:r))}`,textColor:"text-white"})},{key:"liq_price",label:"Liq. Price",sortable:!0,sortValue:G=>Number(G.liq_price)||-1/0,render:(G,V)=>i.jsx(Zx,{info:(V==null?void 0:V.liq_price)==null||isNaN(parseFloat(V==null?void 0:V.liq_price))?"--":`$${Ww(parseFloat(V==null?void 0:V.liq_price).toFixed((V==null?void 0:V.liq_price)>=1e4?0:r))}`,textColor:"text-white"})},{key:"unrealized_pnl",label:"Unrealized PnL",sortable:!0,sortValue:G=>Number(G.unrealized_pnl)||0,render:(G,V)=>i.jsx(Zx,{info:(V==null?void 0:V.unrealized_pnl)==null||isNaN(parseFloat(V==null?void 0:V.unrealized_pnl))?"--":`$${Er(Math.abs(V==null?void 0:V.unrealized_pnl))}`,textColor:`${(V==null?void 0:V.unrealized_pnl)==null||isNaN(parseFloat(V==null?void 0:V.unrealized_pnl))||(V==null?void 0:V.unrealized_pnl)===0?"text-white":(V==null?void 0:V.unrealized_pnl)>0?"text-[#1DE6A3]":"text-[#FF7173]"}`})},{key:"funding_paid",label:"Funding Paid",sortable:!0,sortValue:G=>Number(G.funding_paid)||0,render:(G,V)=>i.jsx(Zx,{info:(V==null?void 0:V.funding_paid)==null||isNaN(parseFloat(V==null?void 0:V.funding_paid))?"--":`$${Er(Math.abs(V==null?void 0:V.funding_paid))}`,textColor:`${(V==null?void 0:V.funding_paid)==null||isNaN(parseFloat(V==null?void 0:V.funding_paid))||(V==null?void 0:V.funding_paid)===0?"text-white":(V==null?void 0:V.funding_paid)>0?"text-[#1DE6A3]":"text-[#FF7173]"}`})},{key:"account_value",label:"Margin",sortable:!0,sortValue:G=>Number(G.account_value)||-1/0,render:(G,V)=>i.jsx(Zx,{info:(V==null?void 0:V.account_value)==null||isNaN(parseFloat(V==null?void 0:V.account_value))?"--":`$${ed(V==null?void 0:V.account_value)}`,textColor:"text-white"})},{key:"perp_equity",label:"Account Value",sortable:!0,sortValue:G=>Number(G.perp_equity)||-1/0,render:(G,V)=>i.jsx(Zx,{info:(V==null?void 0:V.perp_equity)==null||isNaN(parseFloat(V==null?void 0:V.perp_equity))?"--":`$${ed(V==null?void 0:V.perp_equity)}`,textColor:"text-white"})}];return i.jsxs(i.Fragment,{children:[i.jsx(w5,{open:C,setOpen:N,copyTradeData:P,copyTradeWallet:U,setCopyTradeWallet:L,isScalper:R,setCopyTradeData:I}),i.jsxs("div",{className:"flex flex-col w-full h-full mt-4",children:[i.jsx("div",{className:"flex flex-col md:flex-row md:items-center md:justify-between gap-2 md:gap-0 pl-3 pr-5",children:i.jsxs("div",{className:"flex flex-row justify-start items-center gap-2 sm:gap-4 md:gap-2 lg:gap-4 flex-wrap",children:[i.jsxs("div",{className:"flex justify-start items-center gap-2 sm:gap-4 md:gap-2 lg:gap-4",children:[i.jsxs("button",{onClick:()=>d(!u),className:`${pe>0?"bg-gray-900":"bg-[#555555]"} inline-flex items-center p-1 rounded hover:bg-gray-700 focus:outline-none border-none relative`,children:[i.jsx($f,{className:`w-4 h-4 ${pe>0?"text-blue-500":"text-white"}`}),pe>0&&i.jsx("div",{className:"absolute -top-2 -right-2 rounded-full w-4 h-4 text-[11px] bg-[#8D67FF] text-white flex justify-center items-center",children:pe})]}),pe>0&&i.jsx(dpn,{title:"Reset Filter",set_click:()=>X(),tableSortButton:"Reset"})]}),i.jsx("div",{className:"flex",children:i.jsx(Ice,{periods:a,selectedPeriod:s,handlePeriod:o,borderColor:"ticker"})}),t&&i.jsxs("div",{role:"status",className:"flex justify-center items-center h-5 min-h-5 w-[54px] px-2 py-1.5 rounded-md",children:[i.jsxs("svg",{"aria-hidden":"true",className:"inline w-4 h-4 text-gray-200 animate-spin dark:text-gray-600 fill-[#67FFBD]",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),i.jsx("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]}),i.jsx("span",{className:"sr-only",children:"Loading..."})]})]})}),i.jsxs("div",{className:"flex flex-col sm:flex-row w-full h-full",children:[i.jsxs("div",{className:`${u?"":"hidden"} w-[95%] sm:w-72 sm:min-w-72 h-[calc(100%-70px)] bg-[#232323] border border-[#292929] rounded-2xl m-2 overflow-hidden`,children:[i.jsxs("div",{className:"w-full sticky top-0 bg-[#232323] flex justify-between items-center pt-[2px] pl-3 pr-1 mt-3",children:[i.jsx("div",{className:"text-white text-base font-semibold font-inter leading-[8px]",children:"Filters"}),i.jsx("div",{onClick:()=>X(),className:"h-5 px-2 py-1.5 bg-[#3d3d3d] rounded-md inline-flex items-center mr-3 cursor-pointer",children:i.jsx("div",{className:"text-[#cdcdcd] text-[11px] font-semibold font-inter leading-[8px] pointer-events-none",children:"Clear All"})})]}),i.jsx(ipn,{walletFilter:z,setWalletFilter:Q,filterTerminal:ne,setFilterTerminal:J,resetFilters:X})]}),i.jsx("div",{className:"w-full h-[calc(100%-60px)] relative flex-grow",children:t?i.jsx("div",{className:"flex min-h-[66vh] flex-col justify-center items-center -mt-10",children:i.jsx(Da,{})}):n&&!e?i.jsx("div",{className:"flex min-h-[26vh] sm:min-h-[66vh] flex-col justify-center items-center",children:i.jsx(zl,{})}):(Y==null?void 0:Y.length)===0?i.jsx("div",{className:"flex w-full justify-center items-center",children:i.jsx("div",{className:"flex min-h-[36vh] w-[100%] sm:w-[75%] max-w-[300px] sm:max-w-[700px] justify-center items-center text-center",children:i.jsxs("div",{className:"flex flex-col justify-center items-center gap-3",children:[i.jsx("img",{src:ac,alt:""}),i.jsxs("div",{className:"flex flex-col items-center h-max gap-3",children:[i.jsx("div",{className:"text-[#d3d3d3] text-sm font-semibold font-inter leading-[8px] pt-3",children:"No data matched the selected filter range."}),i.jsx("div",{className:"text-center -mt-2",children:i.jsx("span",{className:"text-[#979797] text-[13px] font-normal font-inter leading-[14px] tracking-wide",children:"Please adjust your filters and try again."})})]})]})})}):i.jsx(Ru,{data:Y,columns:oe,rowHeight:30,listHeight:560,tableClassName:"mt-2",theadClassName:"sticky top-0 z-10 whitespace-nowrap rounded-2xl px-2 py-2 flex !rounded-none bg-transparent !text-[#9B9B9B] font-inter !text-[11px] not-italic font-semibold leading-[13px] tracking-[-0.13px]",tbodyClassName:"px-1",rowClassName:"border-b border-[#1E1E1E] bg-transparent !rounded-none",cellClassName:()=>"py-1 flex !text-[11px] font-normal"})})]})]})]})},Zx=({info:e,textColor:t})=>i.jsx("div",{className:"flex flex-col items-end gap-0.5",children:i.jsx("div",{className:`${t} text-[12px] font-semibold font-inter leading-none flex items-center justify-start px-1 gap-0.5`,children:e})}),dpn=({title:e,set_click:t,tableSortButton:n})=>i.jsx("div",{onClick:t,className:`${n==e?"bg-[#3d3d3d] text-white":n=="Reset"?"bg-[#3d3d3d] text-white hover:bg-[#4d4d4d]":"bg-[#161616] text-[#9b9b9b]"} text-[12px] font-medium font-inter leading-[8px] cursor-pointer flex justify-center items-center min-w-max rounded-md px-[6px] sm:px-[10px] h-7`,children:e});function Pv(e,t=2){return Number(e||0).toLocaleString(void 0,{maximumFractionDigits:t})}function ySe(e){return new Promise(t=>setTimeout(t,e))}function vSe(e){if(!e)return"";const t=String(e);return t.slice(0,6)+"..."+t.slice(-4)}function fpn({open:e,onClose:t,children:n,title:r}){return e?i.jsxs("div",{className:"fixed inset-0 z-[999] flex items-center justify-center",children:[i.jsx("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-[1px]",onClick:t}),i.jsxs("div",{className:"relative w-[560px] max-w-[92vw] rounded-2xl border border-[#2A2A2A] bg-[#161616] shadow-2xl",children:[i.jsxs("div",{className:"px-5 pt-4 pb-2 flex items-center justify-between",children:[i.jsx("div",{className:"font-inter text-[18px] leading-6 text-white",children:r}),i.jsx("button",{onClick:t,className:"w-8 h-8 flex items-center justify-center rounded-lg bg-[#222] text-[#BDBDBD]",children:"✕"})]}),i.jsx("div",{className:"px-5 pb-5",children:n})]})]}):null}function nF({children:e}){return i.jsx("div",{className:"text-[12px] text-[#9B9B9B] font-inter mb-1",children:e})}function wSe({value:e,onChange:t,placeholder:n,invalid:r=!1}){return i.jsx("input",{value:e,onChange:s=>t(s.target.value),placeholder:n,className:`w-full h-10 px-3 rounded-lg bg-[#101010] outline-none text:white ${r?"border border-[#FF7173]":"border border-[#2A2A2A]"}`})}function CSe({value:e,onChange:t,options:n,disabled:r=!1}){return i.jsx("select",{disabled:r,value:e,onChange:s=>t(s.target.value),className:`w-full h-10 px-3 rounded-lg bg-[#101010] border text-white outline-none ${r?"border-[#2A2A2A] opacity-60 cursor-not-allowed":"border-[#2A2A2A]"}`,children:n.map(s=>i.jsx("option",{value:s.value,className:"bg-[#101010]",children:s.label},s.value))})}function hpn({children:e}){return i.jsx("div",{className:"grid grid-cols-2 gap-4",children:e})}function ppn({onMax:e}){return i.jsx("button",{onClick:e,className:"px-2 h-8 rounded-md bg-[#1F2A23] text-[#67FFBD] text-[12px] font-medium ml-2",children:"MAX"})}function mpn({children:e,onClick:t,disabled:n,loading:r}){return i.jsx("button",{onClick:t,disabled:n||r,className:`${n||r?"bg-[#2C2C2C] text-[#8A8A8A] cursor-not-allowed":"bg[rgba(103,255,189,0.16)] text-[#67FFBD] hover:opacity-95"} w-full h-9 rounded-xl mt-5 font-medium`,children:r?"Processing...":e})}function xpn(){const e=typeof window<"u"?window.ethereum:null;if(!e)return null;if(Array.isArray(e.providers)&&e.providers.length){const t=e.providers.find(r=>r&&r.isMetaMask);if(t)return t;const n=e.providers.find(r=>r&&r.isCoinbaseWallet);return n||e.providers[0]}return e}async function gpn(e,t){let n=await e.request({method:"eth_chainId"});if((n==null?void 0:n.toLowerCase())!==t.toLowerCase())try{await e.request({method:"wallet_switchEthereumChain",params:[{chainId:t}]})}catch(r){if(r&&r.code===4902)await e.request({method:"wallet_addEthereumChain",params:[{chainId:t,chainName:"Arbitrum One",nativeCurrency:{name:"ETH",symbol:"ETH",decimals:18},rpcUrls:["https://arb1.arbitrum.io/rpc"],blockExplorerUrls:["https://arbiscan.io/"]}]});else throw r}}const bpn=e=>typeof e=="string"&&/^0x[0-9a-fA-F]{40}$/.test(e.trim());function ypn({open:e,onClose:t,perpsAvailable:n,spotBalances:r,onSubmit:s,loading:a}){const o=[{value:"USDC",label:"USDC"},...r.filter(U=>U.coin!=="USDC").map(U=>({value:U.coin,label:U.coin}))],[l,c]=m.useState(""),[u,d]=m.useState("perps"),[f,x]=m.useState("USDC"),[g,v]=m.useState("");m.useEffect(()=>{u==="perps"&&x("USDC")},[u]);const w=u==="perps"?Number(n||0):r.find(L=>L.coin===f)?Math.max(0,Number(b.total||0)-Number(b.hold||0)):0,C=()=>v(String(w)),N=()=>s({kind:"send",from:u,token:f,destination:l,amount:g,available:w}),P=bpn(l),I=Number(g)>0&&Number(g)<=Number(w||0),R=!P||!I,F=l.length>0&&!P;return i.jsx(fpn,{open:e,onClose:t,title:"Send Tokens",children:i.jsxs("div",{className:"space-y-4 text-xs",children:[i.jsxs("div",{children:[i.jsx(nF,{children:"Destination"}),i.jsx(wSe,{value:l,onChange:c,placeholder:"Enter Hyperliquid account address (0x…)",invalid:F})]}),i.jsxs(hpn,{children:[i.jsxs("div",{children:[i.jsx(nF,{children:"From Account"}),i.jsx(CSe,{value:u,onChange:U=>d(U),options:[{value:"perps",label:"Perps Account"},{value:"spot",label:"Spot Account"}]})]}),i.jsxs("div",{children:[i.jsx(nF,{children:"Token"}),i.jsx(CSe,{value:f,onChange:x,options:o,disabled:u==="perps"})]})]}),i.jsxs("div",{children:[i.jsx(nF,{children:"Amount"}),i.jsxs("div",{className:"flex items-center",children:[i.jsx(wSe,{value:g,onChange:v,placeholder:"0.0"}),i.jsx(ppn,{onMax:C})]}),i.jsxs("div",{className:"mt-1 text-[12px] text-[#9B9B9B]",children:["Available: ",Pv(w,6)," ",f]})]}),i.jsx(mpn,{onClick:N,disabled:R,loading:a,children:"Send"})]})})}const vpn={name:"Exchange",version:"1",chainId:1337,verifyingContract:"0x0000000000000000000000000000000000000000"},wpn={Agent:[{name:"source",type:"string"},{name:"connectionId",type:"bytes32"}]};function Cpn(e){if(typeof e!="string"||!e.includes("."))return String(e);const t=e.replace(/\.?0+$/,"");return t==="-0"?"0":t}function ore(e){if(!e||typeof e!="object")return e;if(Array.isArray(e))return e.map(ore);const t={...e};for(const n in t){if(!Object.prototype.hasOwnProperty.call(t,n))continue;const r=t[n];r&&typeof r=="object"?t[n]=ore(r):(n==="p"||n==="s")&&typeof r=="string"&&(t[n]=Cpn(r))}return t}function Spn(e,t,n){const r=ore(e),s=RHe(r),a=t==null?9:29,o=new Uint8Array(s.length+a);o.set(s);const l=new DataView(o.buffer);return l.setBigUint64(s.length,BigInt(n),!1),t==null?l.setUint8(s.length+8,0):(l.setUint8(s.length+8,1),o.set(hs(t),s.length+9)),lo(o)}function Npn(e,t){return{source:t?"a":"b",connectionId:e}}function Apn(e){const t=e.startsWith("0x")?e.slice(2):e,n="0x"+t.slice(0,64),r="0x"+t.slice(64,128);let s=parseInt(t.slice(128,130),16);return s<27&&(s+=27),{r:n,s:r,v:s}}async function jpn(e,t){const n=xpn();if(!n)throw new Error("No injected provider");return await gpn(n,"0xa4b1"),await n.request({method:"eth_signTypedData_v4",params:[e,JSON.stringify(t)]})}function Epn({addr:e,isMainnet:t=!0,vaultAddress:n=null}){return{sign:async(r,s)=>{const a=Spn(r,n,s),o={domain:vpn,types:wpn,primaryType:"Agent",message:Npn(a,t)},l=await jpn(e,o);return Apn(l)}}}const SSe=e=>e?`${e.slice(0,6)}...${e.slice(-4)}`:"-";function _pn({walletAddress:e,listHeight:t=560}){const{address:n}=ns(),{latestPnL:r}=m.useContext(Qr),[s,a]=m.useState(()=>typeof window>"u"?e||null:window.localStorage.getItem("hl_selected_wallet_address")||null||e||null);m.useEffect(()=>{const ie=()=>{if(typeof window>"u")return;const oe=window.localStorage.getItem("hl_selected_wallet_address")||null;a(oe||e||null)};return ie(),window.addEventListener("hl_selected_wallet_changed",ie),window.addEventListener("storage",ie),()=>{window.removeEventListener("hl_selected_wallet_changed",ie),window.removeEventListener("storage",ie)}},[e]);const o=bT(s?s.toLowerCase():null),{perps:l={},spotBalances:c=[],tokenIdMap:u={},tokenMetaMap:d={},priceMap:f={},initialLoaded:x=!1}=o,[g,v]=m.useState({send:!1,transfer:!1,transferInitToPerp:!1}),[w,C]=m.useState(!1),N=m.useMemo(()=>{const ie=typeof window<"u"?localStorage.getItem("hl_pk"):null,oe=ie?Hhn(ie).toLowerCase():null,G=n?n.toLowerCase():null,V=s?s.toLowerCase():null,ee=ie&&oe&&V&&oe===V;return{mode:ee?"local":!ee&&G?"metamask":"none",localAddr:oe,mmAddr:G,targetAddr:V}},[n,s]);m.useEffect(()=>{const ie=oe=>{var V;const G=!!((V=oe==null?void 0:oe.detail)!=null&&V.toPerp);v(ee=>({...ee,transfer:!0,transferInitToPerp:G}))};return window.addEventListener("balances:open-transfer",ie),()=>window.removeEventListener("balances:open-transfer",ie)},[]);const P=m.useMemo(()=>{try{if(!s)return null;if(N.mode==="local"){const ie=vT({getPK:()=>typeof window<"u"?localStorage.getItem("hl_pk"):null,isMainnet:!0,vaultAddress:null});return YN({address:s,signer:ie,isMainnet:!0,signatureChainIdHex:"0xa4b1",getPK:()=>typeof window<"u"?localStorage.getItem("hl_pk"):null})}if(N.mode==="metamask"&&N.mmAddr){const ie=Epn({addr:N.mmAddr,isMainnet:!0,vaultAddress:null});return YN({address:s,signer:ie,isMainnet:!0,signatureChainIdHex:"0xa4b1",getPK:()=>null})}return null}catch{return null}},[s,N]);m.useEffect(()=>{const ie=()=>{(async()=>{try{await fetch("https://api.hyperliquid.xyz/info",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"clearinghouseState",user:s})}).then(oe=>oe.json()),window.dispatchEvent(new CustomEvent("noop"))}catch{}})()};return window.addEventListener("balances:refresh",ie),()=>window.removeEventListener("balances:refresh",ie)},[s]);const I=m.useMemo(()=>c||[],[c]),R=m.useMemo(()=>{const ie=I.find(oe=>oe.coin==="USDC");return ie?Math.max(0,Number(ie.total||0)-Number(ie.hold||0)):0},[I]),F=()=>{const ie=N.mode==="local"?N.localAddr:N.mode==="metamask"?N.mmAddr:null;return ie?N.targetAddr?ie!==N.targetAddr?(rn.error(`Connected wallet ${vSe(ie)} does not match selected account ${vSe(N.targetAddr)}. Switch wallet or change the selected account.`,{id:"addr-mismatch",duration:6e3}),!1):!0:(rn.error("Target account is missing.",{id:"target-missing"}),!1):(rn.error("Wallet not connected or signer unavailable.",{id:"signer-missing"}),!1)},U=()=>{rn.error("No deposit found for this account. Please deposit USDC (Arbitrum) to Hyperliquid before performing this action.",{id:"err-deposit"})},L=async({from:ie,token:oe,destination:G,amount:V,available:ee})=>{var ae;try{if(C(!0),!P)throw new Error("SDK not ready");if(!F())return;const fe=(G||"").trim().toLowerCase();if(!fe||!fe.startsWith("0x")||fe.length!==42)throw new Error("Destination address is invalid");if(!Number(V))throw new Error("Amount is invalid");if(Number(V)>Number(ee||0))throw new Error("Amount exceeds available balance");let Ne;if(ie==="perps")Ne=await P.transfers.usdTransfer(fe,V);else{const he=u[oe];if(!he)throw new Error(`TokenId not found for ${oe}`);const ge=`${oe}:${he}`;Ne=await P.transfers.spotTransfer(fe,ge,String(V))}if((Ne==null?void 0:Ne.status)==="ok")rn.success("Send successful.",{id:"send-success"}),await ySe(600),(ae=window==null?void 0:window.dispatchEvent)==null||ae.call(window,new Event("balances:refresh"));else{const he=typeof(Ne==null?void 0:Ne.response)=="string"?Ne.response:JSON.stringify(Ne);he&&he.toLowerCase().includes("must deposit")?U():rn.error(`Send failed: ${he||"Unknown error"}`,{id:"send-error"})}}catch(fe){const Ne=(fe==null?void 0:fe.message)||"Send failed";Ne.toLowerCase().includes("must deposit")?U():rn.error(Ne,{id:"send-error"})}finally{C(!1),v(fe=>({...fe,send:!1}))}},z=async({toPerp:ie,amount:oe,available:G})=>{var V;try{if(C(!0),!P)throw new Error("SDK not ready");if(!F())return;if(!Number(oe))throw new Error("Amount is invalid");if(Number(oe)>Number(G||0))throw new Error("Amount exceeds available balance");const ee=await P.transfers.usdClassTransfer(String(oe),!!ie);if((ee==null?void 0:ee.status)==="ok")rn.success("Transfer successful.",{id:"transfer-success"}),await ySe(600),(V=window==null?void 0:window.dispatchEvent)==null||V.call(window,new Event("balances:refresh"));else{const ae=typeof(ee==null?void 0:ee.response)=="string"?ee.response:JSON.stringify(ee);ae&&ae.toLowerCase().includes("must deposit")?U():rn.error(`Transfer failed: ${ae||"Unknown error"}`,{id:"transfer-error"})}}catch(ee){const ae=(ee==null?void 0:ee.message)||"Transfer failed";ae.toLowerCase().includes("must deposit")?U():rn.error(ae,{id:"transfer-error"})}finally{C(!1),v(ee=>({...ee,transfer:!1}))}},Q=1,[ne,J]=m.useState(()=>typeof window>"u"?!1:localStorage.getItem("hide_small_balances")==="1");m.useEffect(()=>{const ie=oe=>{var G;typeof((G=oe==null?void 0:oe.detail)==null?void 0:G.value)=="boolean"?J(oe.detail.value):J(typeof window<"u"&&localStorage.getItem("hide_small_balances")==="1")};return window.addEventListener("balances:hide-small-changed",ie),()=>window.removeEventListener("balances:hide-small-changed",ie)},[]);const X=m.useMemo(()=>ie=>{if(Number.isFinite(Number(ie.usdcValue)))return Number(ie.usdcValue);const oe=f[ie.coin],G=Number(ie.totalDisplay??0);return Number.isFinite(oe)&&Number.isFinite(G)?oe*G:null},[f]),re=m.useMemo(()=>{const ie=[],oe=Number((l==null?void 0:l.accountValue)??0),G=Number((l==null?void 0:l.totalMarginUsed)??0),V=Math.max(0,oe-G);return ie.push({id:"USDC_PERPS",kind:"perps",coin:"USDC",unit:"USDC",usdcValue:oe,totalDisplay:oe,availableDisplay:V,totalSort:oe,availableSort:V}),I.forEach(ee=>{const ae=String(ee.coin),fe=Number(ee.total||0),Ne=Number(ee.hold||0),he=Math.max(0,fe-Ne);let ge=null;ae==="USDC"&&(ge=fe);const ye=f[ae];ge==null&&Number.isFinite(ye)&&(ge=ye*fe),ie.push({id:`SPOT_${ae}`,kind:"spot",coin:ae,unit:ae,usdcValue:ge,totalDisplay:fe,availableDisplay:he,totalSort:fe,availableSort:he})}),ie},[l,I,f]),pe=m.useMemo(()=>ne?re.filter(ie=>{if(ie.kind==="perps")return!0;const oe=X(ie);return oe!=null?oe>=Q:Number(ie.totalDisplay??0)>=1e-6}):re,[re,ne,X]),Y=m.useMemo(()=>[{key:"coin",label:"Coin",sortable:!0,sortValue:ie=>ie.coin,render:(ie,oe)=>i.jsxs("span",{className:"text-white",children:[oe.coin," ",oe.kind==="perps"?i.jsx("span",{className:"text-[#9B9B9B]",children:"(Perps)"}):oe.coin==="USDC"&&oe.kind==="spot"?i.jsx("span",{className:"text-[#9B9B9B]",children:"(Spot)"}):null]})},{key:"total",label:"Total Balance",sortable:!0,sortValue:ie=>ie.totalSort,render:(ie,oe)=>i.jsxs("span",{className:"text-white",children:[Pv(oe.totalDisplay)," ",i.jsx("span",{className:"text-[#9B9B9B]",children:oe.unit})]})},{key:"available",label:"Available Balance",sortable:!0,sortValue:ie=>ie.availableSort,render:(ie,oe)=>{const G=oe.kind==="perps"&&oe.coin==="USDC",V=Number((l==null?void 0:l.withdrawable)||0),ee=G?`Available balance to open positions ignoring open orders. ${Pv(V,2)} USDC is availableto withdraw.`:void 0;return i.jsxs("span",{className:"text-white underline-offset-2",title:ee,children:[Pv(oe.availableDisplay)," ",i.jsx("span",{className:"text-[#9B9B9B]",children:oe.unit})]})}},{key:"usdcValue",label:"USDC Value",sortable:!0,sortValue:ie=>{const oe=X(ie);return oe??-1},render:(ie,oe)=>{const G=X(oe);return i.jsxs("span",{className:"text-white",children:[G!=null?Pv(G):"-"," ",G!=null?i.jsx("span",{className:"text-[#9B9B9B]",children:"USDC"}):null]})}},{key:"pnlRoe",label:"PnL (ROE %)",sortable:!1,render:(ie,oe)=>{if(oe.kind!=="perps")return i.jsx("span",{className:"text-white",children:"-"});const G=r==null?void 0:r.all,V=Number((l==null?void 0:l.accountValue)||0),ee=V>0&&typeof G=="number"?G/V*100:null,ae=typeof G!="number"?"text-white":G>0?"text-[#67FFBD]":G<0?"text-[#FF7173]":"text-white";return i.jsxs("span",{className:ae,children:[typeof G!="number"?"-":`$${Pv(Math.abs(G),2)}`," ",i.jsx("span",{className:"text-[#9B9B9B]",children:ee==null?"":`(${Pv(Math.abs(ee),2)}%)`})]})}},{key:"send",label:"Send",sortable:!1,render:(ie,oe)=>oe.kind==="perps"||oe.coin==="USDC"?i.jsxs("button",{onClick:()=>v(G=>({...G,send:!0})),className:"p-0 inline-flex items-center gap-1 h-5 text-white bg-transparent hover:opacity-90 -ml-1",title:"Send",children:[i.jsx(T6t,{}),i.jsx("span",{children:"Send"})]}):null},{key:"transfer",label:"Transfer",sortable:!1,render:(ie,oe)=>oe.coin==="USDC"?i.jsxs("button",{onClick:()=>v(G=>({...G,transfer:!0,transferInitToPerp:oe.kind==="spot"})),className:"p-0 inline-flex items-center gap-1 h-5 text-white bg-transparent hover:opacity-90 -ml-1",title:oe.kind==="perps"?"Transfer to Spot":"Transfer to Perpetual",children:[i.jsx(Tae,{}),i.jsx("span",{children:oe.kind==="perps"?"Transfer to Spot":"Transfer to Perps"})]}):null},{key:"contract",label:"Contract",sortable:!1,render:(ie,oe)=>{const G=d[oe.coin],V=(G==null?void 0:G.tokenId)||null,ee=(G==null?void 0:G.evmContract)||null;if(V){const ae=`https://app.hyperliquid.xyz/explorer/token/${V}`;return i.jsx("a",{href:ae,target:"_blank",rel:"noreferrer",className:"text-white bg-transparent hover:text-white/80 -ml-2",children:SSe(V)})}if(ee){const ae=`https://arbiscan.io/token/${ee}`;return i.jsx("a",{href:ae,target:"_blank",rel:"noreferrer",className:"text-white bg-transparent -ml-2",children:SSe(ee)})}return i.jsx("span",{className:"text-[#9B9B9B] -ml-2",children:"-"})}}],[r==null?void 0:r.all,l,X,d]);return x?i.jsxs(i.Fragment,{children:[i.jsx(Ru,{data:pe,columns:Y,rowHeight:30,listHeight:t,tableClassName:"mt-2",theadClassName:"sticky top-0 z-10 whitespace-nowrap rounded-2xl px-2 py-2 flex !rounded-none bg-transparent !text-[#9B9B9B] font-inter !text-[11px] not-italic font-semibold leading-[13px] tracking-[-0.13px]",tbodyClassName:"px-1",rowClassName:"border-b border-[#1E1E1E] bg-transparent !rounded-none",cellClassName:()=>"py-1 flex !text-[11px] font-semibold",rowKey:ie=>ie.id}),i.jsx(ypn,{open:g.send,onClose:()=>v(ie=>({...ie,send:!1})),perpsAvailable:l==null?void 0:l.withdrawable,spotBalances:I,onSubmit:L,loading:w}),i.jsx(LHe,{open:g.transfer,onClose:()=>v(ie=>({...ie,transfer:!1})),perpsAvailable:l==null?void 0:l.withdrawable,spotUsdcAvailable:R,onSubmit:z,loading:w,initialToPerp:!!g.transferInitToPerp})]}):i.jsx("div",{className:"mt-2 flex pt-12 justify-center text-[12px] text-[#9B9B9B]",style:{height:t},children:"Loading..."})}const kpn={position:"bottom-right",style:{background:"#1e1e1e",color:"#fff",fontSize:12,border:"1px solid #2A2A2A"}},Tpn="dextra-global-toast";function LX(e,t){return rn.promise(e,t,{id:Tpn,...kpn})}async function DX(e){const t=vT({getPK:()=>typeof window<"u"?localStorage.getItem("hl_pk"):null,isMainnet:!0,vaultAddress:null});return YN({address:e,signer:t,dex:""})}function mo(e,t=6){return Number(e||0).toLocaleString(void 0,{maximumFractionDigits:t})}function Ipn(e){return e?e.charAt(0).toUpperCase()+e.slice(1):""}function Aue({open:e,onClose:t,title:n,width:r=720,children:s}){return e?Na.createPortal(i.jsxs("div",{className:"fixed inset-0 z-[99999] font-inter",children:[i.jsx("div",{className:"absolute inset-0 bg-black/60",onClick:t}),i.jsxs("div",{className:"absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 max-w[95vw] rounded-2xl border border-[#2A2A2A] bg-[#161616] shadow-2xl",style:{width:r},children:[i.jsxs("div",{className:"px-5 pt-4 pb-2 flex items-center justify-between",children:[i.jsx("div",{className:"text-white text-[16px]",children:n}),i.jsx("button",{onClick:t,className:"flex justify-center items-center w-8 h-8 rounded-lg bg-[#222] text-[#BDBDBD]",title:"Close",children:"✕"})]}),i.jsx("div",{className:"px-5 pb-5",children:s})]})]}),document.body):null}const Og=({children:e})=>i.jsx("div",{className:"text-[11px] text-[#9B9B9B] mb-1",children:e}),lre=({value:e,onChange:t,placeholder:n})=>i.jsx("input",{value:e,onChange:r=>t(r.target.value),placeholder:n,className:"w-full h-9 px-3 rounded-lg bg-[#101010] border border-[#2A2A2A] text-white outline-none font-inter text-[11px]"}),BX=({children:e,right:t})=>i.jsxs("div",{className:"h-9 rounded-lg bg-[#0E0E0E] border border-[#2A2A2A] px-3 flex items-center justify-between text-[#CFCFCF]",children:[i.jsx("span",{className:"text-[11px]",children:e}),t?i.jsx("span",{className:"text-[#9B9B9B] text-[11px]",children:t}):null]}),$He=({children:e,onClick:t,disabled:n,loading:r})=>i.jsxs("button",{onClick:t,disabled:n||r,className:`w-full h-8 rounded-xl !mt-10 font-medium font-inter text-[12px] flex items-center justify-center gap-2 ${n||r?"bg-[#2C2C2C] text-[#8A8A8A] cursor-not-allowed":"bg-[#67FFBD] text-[#101010] hover:opacity-95"}`,children:[r?i.jsx(Yy,{size:14,color:"#FFF"}):null,i.jsx("span",{children:e})]});function Ppn({open:e,onClose:t,row:n,onConfirm:r,initialTab:s="limit",busy:a=!1}){const[o,l]=Ae.useState(s),[c,u]=Ae.useState(n!=null&&n.markPrice?String(n.markPrice):""),[d,f]=Ae.useState(100),x=Ae.useRef(!1),g=Math.abs(Number((n==null?void 0:n.size)||0));Number((n==null?void 0:n.entryPrice)||0);const v=Number((n==null?void 0:n.markPrice)??(n==null?void 0:n.midPrice)??0),w=g*d/100,C=Number(c||0);Ae.useEffect(()=>{e&&!x.current&&(l(s),f(100),u(n!=null&&n.markPrice?String(n.markPrice):""),x.current=!0),!e&&x.current&&(x.current=!1)},[e,s,n==null?void 0:n.markPrice]);const N=()=>{a||(o==="market"?r==null||r({mode:"market",id:n==null?void 0:n.id,coin:n==null?void 0:n.coin,side:n==null?void 0:n.type,size:w}):r==null||r({mode:"limit",id:n==null?void 0:n.id,coin:n==null?void 0:n.coin,side:n==null?void 0:n.type,price:C,size:w}))},P=o==="market"?"Market Close":"Limit Close",I=o==="market"?"This will attempt to immediately close the position.":"This will send an order to close your position at the limit price.";return i.jsx(Aue,{open:e,onClose:a?()=>{}:t,title:P,width:500,children:i.jsxs("div",{className:"space-y-4",children:[i.jsx("div",{className:"text-[12px] text-[#9B9B9B]",children:I}),i.jsxs("div",{className:"flex items-center justify-between text-[11px]",children:[i.jsx(Og,{children:"Size"}),i.jsxs("div",{className:"text-[#CFCFCF]",children:[mo(g)," ",n==null?void 0:n.coin]})]}),o==="market"?i.jsxs("div",{className:"grid gap-3",children:[i.jsxs("div",{children:[i.jsx(Og,{children:"Price"}),i.jsx(BX,{right:"",children:i.jsx("span",{className:"text-white",children:"Market"})})]}),i.jsxs("div",{children:[i.jsx(Og,{children:"Size"}),i.jsx(BX,{right:"USDC",children:mo(w*v,2)})]})]}):i.jsxs("div",{className:"grid gap-3",children:[i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx(Og,{children:"Price (USD)"}),i.jsx("button",{className:"text-[11px] text-[#67FFBD] px-2 py-0.5 rounded-md hover:opacity-90",onClick:()=>u(String(v)),children:"Mid"})]}),i.jsx(lre,{value:c,onChange:u,placeholder:"0.0"})]}),i.jsxs("div",{children:[i.jsx(Og,{children:"Size"}),i.jsx(BX,{right:"USDC",children:mo(w*(C||v),2)})]})]}),i.jsx(XN,{value:d,onChange:f,accent:"#67FFBD",trackBg:"rgba(255,255,255,0.12)",marks:[0,25,50,75,100],snap:!0}),i.jsx($He,{onClick:N,disabled:o==="limit"&&!c,loading:a,children:o==="market"?"Market Close":"Confirm"})]})})}function Fpn({open:e,onClose:t,row:n,onConfirm:r,busy:s=!1}){const a=Math.abs(Number((n==null?void 0:n.size)||0)),o=(n==null?void 0:n.type)==="Long"?"Short":"Long";return i.jsx(Aue,{open:e,onClose:s?()=>{}:t,width:640,title:`Reverse ${n==null?void 0:n.coin} Position`,children:i.jsxs("div",{className:"space-y-4",children:[i.jsx("div",{className:"rounded-xl border border-[#8d6a2a] bg-[#2a2212] text-[#f1c76c] p-3 text-[12px]",children:"This will close your existing positions and open reversed positions with the same size. This action cannot be undone."}),i.jsx("div",{className:"rounded-xl border border-[#2A2A2A] bg-[#101010] p-4 text-[12px]",children:i.jsxs("div",{className:"grid grid-cols-[1fr_1fr_1fr] gap-2",children:[i.jsx("div",{className:"text-[#9B9B9B]",children:"Asset"}),i.jsx("div",{className:"text-[#9B9B9B]",children:"Current Side"}),i.jsx("div",{className:"text-[#9B9B9B]",children:"New Side"}),i.jsx("div",{className:"text-white",children:n==null?void 0:n.coin}),i.jsxs("div",{className:"text-[#67FFBD]",children:[n==null?void 0:n.type," ",mo(a)]}),i.jsxs("div",{className:"text-[#FF797C]",children:[o," ",mo(a)]})]})}),i.jsxs("div",{className:"flex gap-3",children:[i.jsx("button",{onClick:t,disabled:s,className:`flex-1 h-10 rounded-xl border border-[#2A2A2A] bg-transparent text-white hover:bg-white/5 ${s?"opacity-60 cursor-not-allowed":""}`,children:"Cancel"}),i.jsx("button",{onClick:()=>r==null?void 0:r({mode:"reverse",id:n==null?void 0:n.id,coin:n==null?void 0:n.coin,from:n==null?void 0:n.type,to:o,size:a}),disabled:s,className:`flex-1 h-10 rounded-xl bg-[#67FFBD] text-[#101010] hover:opacity-95 ${s?"opacity-60 cursor-not-allowed":""}`,children:s?i.jsx(Yy,{size:14,color:"#FFF"}):"Reverse"})]})]})})}const NSe=({value:e,onChange:t,placeholder:n="0"})=>i.jsxs("div",{className:"relative",children:[i.jsx("input",{value:e,onChange:r=>t(r.target.value),placeholder:n,className:"w-full h-9 px-3 pr-8 rounded-lg bg-[#101010] border border-[#2A2A2A] text-white outline-none font-inter text-[11px] text-right",inputMode:"decimal"}),i.jsx("span",{className:"absolute right-2 top-1/2 -translate-y-1/2 text-[#9B9B9B] text-[11px]",children:"%"})]});function Opn({open:e,onClose:t,row:n,initialTp:r,initialSl:s,onSubmit:a}){var ie;const[o,l]=m.useState(r?String(r):""),[c,u]=m.useState(s?String(s):""),[d,f]=m.useState(""),[x,g]=m.useState(""),[v,w]=m.useState(!1),[C,N]=m.useState(!1),P=Number((n==null?void 0:n.entryPrice)||0),I=Number((n==null?void 0:n.markPrice)??0),R=Math.abs(Number((n==null?void 0:n.size)||0)),F=n==null?void 0:n.type,U=(((ie=n==null?void 0:n.leverage)==null?void 0:ie.type)||(n==null?void 0:n.marginType)||"").toString(),L=oe=>Number.isFinite(oe)?Math.max(0,oe):0,z=(oe,G=4)=>Number.isFinite(oe)?String(Number(oe.toFixed(G))):"",Q=oe=>{var ae;if(!P)return"";const G=Number(oe);if(!Number.isFinite(G))return"";const V=Number(((ae=n==null?void 0:n.leverage)==null?void 0:ae.value)||1),ee=(F==="Long"?G/P-1:1-G/P)*100*V;return z(L(ee),2)},ne=oe=>{var ae;if(!P)return"";const G=Number(oe);if(!Number.isFinite(G))return"";const V=Number(((ae=n==null?void 0:n.leverage)==null?void 0:ae.value)||1),ee=(F==="Long"?1-G/P:G/P-1)*100*V;return z(L(ee),2)},J=oe=>{var fe;const G=Number(oe);if(!Number.isFinite(G)||!P)return"";const V=Number(((fe=n==null?void 0:n.leverage)==null?void 0:fe.value)||1),ee=G/(V*100),ae=F==="Long"?P*(1+ee):P*(1-ee);return z(ae,4)},X=oe=>{var fe;const G=Number(oe);if(!Number.isFinite(G)||!P)return"";const V=Number(((fe=n==null?void 0:n.leverage)==null?void 0:fe.value)||1),ee=G/(V*100),ae=F==="Long"?P*(1-ee):P*(1+ee);return z(ae,4)};m.useEffect(()=>{if(e){const oe=r?String(r):"",G=s?String(s):"";l(oe),u(G),f(oe?Q(oe):""),g(G?ne(G):""),w(!1),N(!1)}},[e,r,s]);const re=o&&R?Math.max(0,(F==="Long"?Number(o)-I:I-Number(o))*R):0,pe=c&&R?Math.max(0,(F==="Long"?I-Number(c):Number(c)-I)*R):0,Y=()=>{a==null||a({id:n==null?void 0:n.id,coin:n==null?void 0:n.coin,side:F,tpPrice:o?Number(o):null,slPrice:c?Number(c):null,configureAmount:v,useLimitPx:C}),t()};return i.jsx(Aue,{open:e,onClose:t,title:`TP/SL for Position - ${(n==null?void 0:n.coin)||"--"} - ${U||F||"--"}`,children:i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{className:"rounded-xl border border-[#2A2A2A] bg-[#101010] p-4 text-[12px] space-y-2",children:[i.jsxs("div",{className:"flex justify-between text-[#9B9B9B]",children:[i.jsx("span",{children:"Position"}),i.jsxs("span",{className:"text-[#1DE6A3]",children:[mo(R)," ",i.jsx("span",{className:"text-[#67FFBD]",children:n==null?void 0:n.coin})]})]}),i.jsxs("div",{className:"flex justify-between text-[#9B9B9B]",children:[i.jsx("span",{children:"Entry Price"}),i.jsx("span",{className:"text-white",children:mo(P,4)})]}),i.jsxs("div",{className:"flex justify-between text-[#9B9B9B]",children:[i.jsx("span",{children:"Mark Price"}),i.jsx("span",{className:"text-white",children:mo(I,4)})]})]}),i.jsxs("div",{className:"rounded-xl border border-[#2A2A2A] bg-[#101010] p-4 space-y-6",children:[i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-[1fr_220px] gap-6 items-start",children:[i.jsxs("div",{children:[i.jsx(Og,{children:"TP Price"}),i.jsx(lre,{value:o,onChange:oe=>{l(oe),f(oe?Q(oe):"")},placeholder:"0.0"}),i.jsx("div",{className:"text-[11px] text-[#9B9B9B] mt-1",children:"Est Gain:"}),i.jsxs("div",{className:"text-[11px] text-[#67FFBD]",children:["+$",mo(re,2)]})]}),i.jsxs("div",{children:[i.jsx(Og,{children:"Gain"}),i.jsx(NSe,{value:d,onChange:oe=>{f(oe),l(oe?J(oe):"")}})]})]}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-[1fr_220px] gap-6 items-start",children:[i.jsxs("div",{children:[i.jsx(Og,{children:"SL Price"}),i.jsx(lre,{value:c,onChange:oe=>{u(oe),g(oe?ne(oe):"")},placeholder:"0.0"}),i.jsx("div",{className:"text-[11px] text-[#9B9B9B] mt-1",children:"Est Loss:"}),i.jsxs("div",{className:"text-[11px] text-[#FF7173]",children:["-$",mo(pe,2)]})]}),i.jsxs("div",{children:[i.jsx(Og,{children:"Loss"}),i.jsx(NSe,{value:x,onChange:oe=>{g(oe),u(oe?X(oe):"")}})]})]}),i.jsxs("div",{className:"flex items-center gap-6 text-[12px] text-white",children:[i.jsxs("label",{className:"flex items-center gap-2 cursor-pointer select-none",children:[i.jsx("input",{type:"checkbox",className:"accent-[#67FFBD]",checked:v,onChange:oe=>w(oe.target.checked)}),i.jsx("span",{children:"Configure Amount"})]}),i.jsxs("label",{className:"flex items-center gap-2 cursor-pointer select-none",children:[i.jsx("input",{type:"checkbox",className:"accent-[#67FFBD]",checked:C,onChange:oe=>N(oe.target.checked)}),i.jsx("span",{children:"Limit Price"})]})]}),i.jsx($He,{onClick:Y,disabled:!o&&!c,children:"Confirm"})]})]})})}function Mpn({selectedRow:e,onOpenCloseModal:t,onOpenReverse:n,onCloseAll:r,busyCloseAll:s}){const[a,o]=m.useState(!1),l=m.useRef(null),[c,u]=m.useState({x:0,y:0});return m.useEffect(()=>{var f;if(!a)return;const d=(f=l.current)==null?void 0:f.getBoundingClientRect();d&&u({x:d.left,y:d.bottom+6})},[a]),m.useEffect(()=>{if(!a)return;const d=()=>o(!1),f=x=>{l.current&&l.current.contains(x.target)||d()};return window.addEventListener("resize",d),window.addEventListener("scroll",d),document.addEventListener("pointerdown",f),()=>{window.removeEventListener("resize",d),window.removeEventListener("scroll",d),document.removeEventListener("pointerdown",f)}},[a]),i.jsxs(i.Fragment,{children:[i.jsxs("button",{ref:l,className:"w-[100px] min-w-0 h-8 px-2 rounded-lg border border-[#2A2A2A] bg-[#161616] text-[#CFCFCF] text-xs flex items-center justify-between overflow-hidden",onClick:d=>{d.stopPropagation(),o(f=>!f)},title:"Close menu",children:[i.jsx("span",{className:"truncate",children:"Close"}),i.jsx("span",{className:"opacity-70 ml-2",children:"▾"})]}),a&&Na.createPortal(i.jsx("div",{className:"fixed z-[99998] w-[300px] rounded-xl border border-[#2A2A2A] bg-[#0F0F0F] shadow-2xl p-3",style:{top:c.y,left:c.x},onPointerDown:d=>d.stopPropagation(),children:i.jsxs("div",{className:"mt-2 text-[13px] text-white/90",children:[i.jsx("div",{className:`${e?"hover:bg-white/5":"opacity-40 pointer-events-none"} px-2 py-1.5 rounded cursor-pointer`,onClick:()=>e&&(t==null?void 0:t("limit")),children:"Limit Close"}),i.jsx("div",{className:`${e?"hover:bg-white/5":"opacity-40 pointer-events-none"} px-2 py-1.5 rounded cursor-pointer`,onClick:()=>e&&(t==null?void 0:t("market")),children:"Market Close"}),i.jsxs("div",{className:`px-2 py-1.5 rounded cursor-pointer ${s?"opacity-60 pointer-events-none":"hover:bg-white/5"}`,onClick:()=>!s&&(r==null?void 0:r()),children:["Close All (Market)",s?i.jsx("span",{className:"inline-flex ml-2 align-middle",children:i.jsx(Yy,{size:12,color:"#FFF"})}):null]})]})}),document.body)]})}function Rpn({walletAddress:e,listHeight:t=560}){var he,ge,ye,ve;const{isReferralCodeName:n}=m.useContext(Qr),{rows:r,tpslByCoin:s={},viewOrdersOnly:a}=wue(e),[o,l]=m.useState(e||"");m.useEffect(()=>{l(e||"")},[r]);const c=(o||"")===(e||""),u=m.useMemo(()=>c?r.map(je=>({...je,id:je.id})):[],[c,r]),{key:d}=w2(),[f,x]=m.useState({}),[g,v]=m.useState(null),[w,C]=m.useState(!1),[N,P]=m.useState({coin:"",type:"",leverage:0,roe:0,entryPrice:0,markPrice:0,referral:"",positionDistribution:0,pnl:0,closePx:0}),[I,R]=m.useState(null),F=m.useMemo(()=>u.find(je=>je.id===I)||null,[u,I]),[U,L]=m.useState(!1),[z,Q]=m.useState("limit"),[ne,J]=m.useState(!1),[X,re]=m.useState(!1),[pe,Y]=m.useState(!1),ie=()=>typeof window<"u"&&window.localStorage.getItem("skipCloseConfirm")==="true",oe={kBONK:"BONK",kPEPE:"PEPE",kSHIB:"SHIB",kFLOKI:"FLOKI",kNEIRO:"NEIRO",kDOGS:"DOGS",kLUNC:"LUNC"},G=je=>oe[je]||je,V=m.useCallback(async({id:je,coin:Ie,tpPrice:Le,slPrice:Qe,configureAmount:$e,useLimitPx:it})=>{var tt;try{const lt=await DX(e);await LX(lt.replaceTPSLForPosition({symbol:Ie,tpPrice:Le??null,slPrice:Qe??null,useLimitPx:!!it,triggerSlippage:.1}),{loading:`Placing TP/SL for ${Ie}...`,success:`TP/SL placed for ${Ie}`,error:ft=>`TP/SL failed: ${(ft==null?void 0:ft.message)||ft}`}),x(ft=>({...ft,[je]:{tp:Le||null,sl:Qe||null}})),(tt=window.dispatchEvent)==null||tt.call(window,new Event("orders:refresh"))}catch{}finally{v(null)}},[e]);m.useEffect(()=>{if(w&&!N.referral){const je=n||window.localStorage.getItem("refcode")||"";je&&P(Ie=>({...Ie,referral:je}))}},[w,n,N.referral]);const ee=m.useCallback(async je=>{re(!0);try{const Ie=await DX(e),Le=je.mode==="market"?Ie.marketClose(je.coin,je.size,{tif:"Ioc",reduceOnly:!0}):Ie.placeOrder({symbol:je.coin,isBuy:je.side==="Short",size:je.size,price:je.price,tif:"Gtc",reduceOnly:!0});await LX(Le,{loading:`Closing ${je.coin} ${je.mode}...`,success:`Closed ${je.coin} (${mo(je.size)} ${je.mode})`,error:Qe=>`Close failed: ${je.coin} • ${(Qe==null?void 0:Qe.message)||Qe}`}),L(!1)}finally{re(!1)}},[e]),ae=m.useMemo(()=>[{key:"coin",label:"Coin",sortable:!0,sortValue:Ie=>Ie.coin||"",render:(Ie,Le)=>{var it;const Qe=Vo(),$e=()=>Qe(`/terminal/hyperliquid/${Le.coin}`);return i.jsxs("div",{onPointerDown:$e,className:"flex gap-1 items-center text-white font-medium min-w-[120px] cursor-pointer hover:opacity-80",children:[i.jsx("img",{src:`https://app.hyperliquid.xyz/coins/${G(Le.coin)}.svg`,onError:ra,className:"w-5 h-5 mr-2",alt:Le.coin}),i.jsx("span",{children:Ie.replace("xyz:","")||"--"}),i.jsx("div",{className:"flex justify-start items-center gap-2 h-8 ml-1",children:i.jsx("div",{className:`${Le.type==="Long"?"text-[#67ffbd] bg-[#67ffbd]/20":"text-[#ff787b] bg-[#ff797c]/20"} h-5 pl-1 pr-1.5 py-1 rounded-md inline-flex items-center gap-1`,children:i.jsxs("div",{className:"text-[11px] font-semibold tracking-wide uppercase",children:[mo(((it=Le.leverage)==null?void 0:it.value)??0,0),"x"]})})})]})}},{key:"size",label:"Size",sortable:!0,sortValue:Ie=>Math.abs(Ie.size),render:(Ie,Le)=>i.jsxs("span",{className:`font-medium ${Le.type==="Long"?"text-[#67ffbd]":"text-[#ff787b]"}`,children:[mo(Math.abs(Ie))," ",Le.coin.replace("xyz:","")]})},{key:"positionValue",label:"Pos. Val.",sortable:!0,sortValue:Ie=>Ie.positionValue,render:Ie=>i.jsxs("span",{className:"text-white font-semibold",children:["$",mo(Ie,2)]})},{key:"entryPrice",label:"Entry Price",sortable:!0,sortValue:Ie=>Ie.entryPrice,render:Ie=>i.jsxs("span",{className:"text-white font-semibold",children:["$",mo(Ie,4)]})},{key:"markPrice",label:"Mark Price",sortable:!0,sortValue:Ie=>Ie.markPrice,render:Ie=>i.jsxs("span",{className:"text-white font-semibold",children:["$",mo(Ie,4)]})},{key:"pnl",label:"PnL (ROE%)",headerTooltip:"Mark price is used to estimate unrealized PNL. Only trade prices are used for realized PNL.",sortable:!0,sortValue:Ie=>Ie.pnl,render:(Ie,Le)=>i.jsxs("div",{className:"flex items-center justify-end gap-1",children:[i.jsxs("span",{className:Le.pnl>=0?"text-[#67FFBD]":"text-[#FF797C]",children:["$",mo(Math.abs(Le.pnl),2)," ",i.jsxs("span",{className:"text-[#9B9B9B]",children:["(",mo(Math.abs(Le.roe),1),"%)"]})]}),i.jsx("button",{onClick:Qe=>{var it;Qe.stopPropagation();const $e=n||window.localStorage.getItem("refcode")||"";P({coin:Le.coin,type:Le.type.toUpperCase(),leverage:((it=Le.leverage)==null?void 0:it.value)||0,roe:Le.roe||0,entryPrice:Number(Le.entryPrice||0),markPrice:Number(Le.markPrice||0),referral:$e,positionDistribution:0,pnl:Number(Le.pnl||0),closePx:0}),C(!0)},className:"flex items-center h-6 text-[#67FFBD] text-[11px] font-semibold bg-transparent -ml-3",title:"Share",children:i.jsx("img",{src:gm,alt:"",className:"w-[14px] h-[14px] min-w-[14px] min-h-[14px]"})})]})},{key:"liquidationPx",label:"Liq. Price",sortable:!0,sortValue:Ie=>Ie.liquidationPx??-1,render:Ie=>Ie==null?i.jsx("span",{className:"text-[#979797]",children:"--"}):i.jsx("span",{className:"text-white font-semibold",children:mo(Ie,0)})},{key:"marginUsed",label:"Margin",headerTooltip:"For isolated positions margin includes unrealized pnl.",sortable:!0,sortValue:Ie=>Ie.marginUsed,render:(Ie,Le)=>{var it;const Qe=Le.marginUsed,$e=(it=Le.leverage)!=null&&it.type?Ipn(Le.leverage.type):null;return i.jsxs("span",{className:"text-white font-semibold",children:["$",mo(Qe,2)," ",$e?i.jsxs("span",{className:"text-[#9B9B9B]",children:["(",$e,")"]}):null]})}},{key:"funding",label:"Funding",headerTooltip:"Net funding payments since the position was opened. Hover for all-time and since changed.",sortable:!0,sortValue:Ie=>Ie.funding,render:Ie=>i.jsxs("span",{className:Number(Ie)<=0?"text-[#67FFBD] font-semibold":"text-[#FF797C] font-semibold",children:["$",mo(Math.abs(Ie),4)]})},{key:"close",label:i.jsx(Mpn,{selectedRow:F,onOpenCloseModal:async Ie=>{if(F){if(Q(Ie),Ie==="market"&&ie()){await ee({mode:"market",id:F==null?void 0:F.id,coin:F==null?void 0:F.coin,side:F==null?void 0:F.type,size:Math.abs(Number((F==null?void 0:F.size)||0))});return}L(!0)}},onOpenReverse:()=>F&&J(!0),onCloseAll:async()=>{Y(!0);try{const Ie=await DX(e);await LX(Ie.closeAllPositions(),{loading:"Closing all positions...",success:"Closed all positions",error:Le=>`Close all failed: ${(Le==null?void 0:Le.message)||Le}`})}finally{Y(!1)}},busyCloseAll:pe}),sortable:!1,align:"start",render:(Ie,Le)=>i.jsxs("div",{className:"w-full flex items-center gap-1",children:[i.jsx("button",{onClick:()=>{R(Le.id),Q("limit"),L(!0)},className:"flex justify-center items-center h-5 px-2 rounded-md text-[11px] font-semibold text-[#0f151a] bg-[rgb(103,255,189)] -ml-2",children:"Limit"}),i.jsx("button",{onClick:async()=>{R(Le.id),Q("market"),ie()?await ee({mode:"market",id:Le.id,coin:Le.coin,side:Le.type,size:Math.abs(Number(Le.size||0))}):L(!0)},className:"flex justify-center items-center h-5 px-2 rounded-md text-[11px] font-semibold text-[#0f151a] bg-[rgb(103,255,189)]",children:"Market"})]})},{key:"tpSl",label:"TP/SL",sortable:!1,render:(Ie,Le)=>{const Qe=s==null?void 0:s[Le.coin],$e=Qe&&(Qe.tp||Qe.sl),it=a instanceof Set?a.has(Le.coin):!1,tt=f[Le.id];return $e?i.jsxs("div",{className:"flex items-center justify-end gap-2 text-[#CFCFCF]",children:[i.jsxs("span",{className:"text-[#CFCFCF]",children:[Qe.tp?mo(Qe.tp,0):"--"," /"," ",Qe.sl?mo(Qe.sl,0):"--"]}),i.jsx("button",{onClick:()=>v(Le),className:"opacity-80 hover:opacity-100 bg-transparent p-0",children:"✎"})]}):it?i.jsx("div",{className:"flex items-center justify-end",children:i.jsx("button",{onClick:()=>window.dispatchEvent(new CustomEvent("terminal:setTab",{detail:{tab:"open"}})),className:"h-6 px-2 rounded-md text-[11px] font-semibold text-[#67ffbd] bg[rgba(103,255,189,0.16)] flex justify-center items-center",children:"View Orders"})}):tt&&(tt.tp||tt.sl)?i.jsxs("div",{className:"flex items-center justify-end gap-2 text-[#CFCFCF]",children:[i.jsxs("span",{className:"text-[#CFCFCF]",children:[tt.tp?mo(tt.tp,0):"--"," /"," ",tt.sl?mo(tt.sl,0):"--"]}),i.jsx("button",{onClick:()=>v(Le),className:"opacity-80 hover:opacity-100 bg-transparent",children:"✎"})]}):i.jsx("div",{className:"flex items-center justify-end gap-2 text-[#CFCFCF]",children:i.jsx("button",{onClick:()=>v(Le),className:"text-[#CFCFCF] underline underline-offset-4 decoration-dotted hover:text-white p-0 bg-transparent",children:"-- / -- ✎"})})}}],[F,n,f,s,a,e,pe,ee]),fe=g?((he=s==null?void 0:s[g.coin])==null?void 0:he.tp)??((ge=f[g.id])==null?void 0:ge.tp)??null:null,Ne=g?((ye=s==null?void 0:s[g.coin])==null?void 0:ye.sl)??((ve=f[g.id])==null?void 0:ve.sl)??null:null;return i.jsxs(i.Fragment,{children:[i.jsx(Ru,{data:Jg(u,"positions",d),columns:ae,rowHeight:30,listHeight:t,tableClassName:"mt-2 font-inter",theadClassName:"sticky top-0 z-10 whitespace-nowrap rounded-2xl px-2 py-2 flex !rounded-none bg-transparent !text-[#9B9B9B] font-inter !text-[11px] not-italic font-semibold leading-[13px] tracking-[-0.13px]",tbodyClassName:"px-1",rowClassName:je=>`border-b border-[#1E1E1E] bg-transparent !rounded-none ${I===je.id?"bg-[#0d0d0d]":""}`,cellClassName:()=>"py-1 flex min-w-0 !text-[11px] font-normal",rowKey:je=>je.id,onRowClick:je=>R(je.id),emptyRenderer:()=>i.jsx("div",{className:"flex items-center justify-center h-[200px] text-[#9B9B9B] text-sm",children:"No open positions"})}),i.jsx(Opn,{open:!!g,onClose:()=>v(null),row:g,initialTp:fe,initialSl:Ne,onSubmit:V}),i.jsx(Ppn,{open:U&&!!F,onClose:()=>L(!1),row:F,initialTab:z,onConfirm:ee,busy:X}),i.jsx(Fpn,{open:ne&&!!F,onClose:()=>J(!1),row:F,onConfirm:je=>{J(!1),console.log("REVERSE CONFIRM",je)}}),i.jsx(pT,{open:w,setOpen:C,data:N,setTradeInfo:P})]})}async function ASe(e){const t=vT({getPK:()=>typeof window<"u"?localStorage.getItem("hl_pk"):null,isMainnet:!0,vaultAddress:null});return YN({address:e,signer:t,dex:""})}function cre(e,t=2,n=!0){return Number(e||0).toLocaleString(void 0,{minimumFractionDigits:n?0:t,maximumFractionDigits:t})}function Lpn(e,t=2){return`${Number(e||0).toLocaleString(void 0,{minimumFractionDigits:t,maximumFractionDigits:t})} USDC`}function Dpn(e){if(!e)return"--";const t=new Date(Number(e)),n=String(t.getDate()).padStart(2,"0"),r=String(t.getMonth()+1).padStart(2,"0"),s=t.getFullYear(),a=String(t.getHours()).padStart(2,"0"),o=String(t.getMinutes()).padStart(2,"0"),l=String(t.getSeconds()).padStart(2,"0");return`${n}/${r}/${s} - ${a}:${o}:${l}`}function Bpn(e){const t=e.side==="Buy"?"B":e.side==="Sell"?"A":e.side;return t==="B"?e.reduceOnly?"Close Short":"Open Long":t==="A"?e.reduceOnly?"Close Long":"Open Short":"-"}function $pn({open:e,onClose:t,children:n,title:r}){return e?i.jsxs("div",{className:"fixed inset-0 z-[999] flex items-center justify-center",children:[i.jsx("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-[1px]",onClick:t}),i.jsxs("div",{className:"relative z-[1000] w-[760px] max-w-[95vw] rounded-2xl border border-[#262626] bg-[#141414] p-6 shadow-2xl",children:[i.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[i.jsx("div",{className:"text-white font-semibold",children:r}),i.jsx("button",{onClick:t,className:"rounded-md px-2 py-1 text-[#9B9B9B] hover:bg-[#1F1F1F] hover:text-white",children:"×"})]}),n]})]}):null}function Upn(e){return typeof(e==null?void 0:e.type)=="string"&&e.type.toLowerCase()==="limit"}function zpn(e){return typeof e=="string"&&e.toLowerCase().includes("stop")}function Hpn(e){return typeof e=="string"&&e.toLowerCase().includes("take profit")}function Vpn(e){return e==="B"?"Long":"Short"}function Wpn(e){return e==="B"?"Short":"Long"}function ej({k:e,v:t,strong:n}){return i.jsxs("div",{className:"flex items-center justify-between text-[13px] leading-5",children:[i.jsx("span",{className:"text-[#9B9B9B]",children:e}),i.jsx("span",{className:n?"text-white font-semibold":"text-white",children:t})]})}function rF({title:e,order:t,parentRawSide:n}){const r=!!t,s=r?t.side?Vpn(t.side):Wpn(n):"--",a=r&&typeof t.orderType=="string"&&t.orderType.toLowerCase()==="limit";return i.jsxs("div",{className:"rounded-xl border border-[#2a2a2a] bg-[#161616] px-4 py-3",children:[e?i.jsx("div",{className:"mb-2 text-[13px] text-[#9B9B9B]",children:e}):null,r?i.jsxs("div",{className:"space-y-1.5",children:[i.jsx(ej,{k:"Order Type",v:t.orderType||"--"}),i.jsx(ej,{k:"Side",v:s}),i.jsx(ej,{k:"Amount",v:`${t.sz}`}),i.jsx(ej,{k:"Trigger",v:t.triggerCondition&&t.triggerCondition!=="N/A"?t.triggerCondition:"N/A"}),i.jsx(ej,{k:"Price",v:a?`$${cre(t.limitPx,3)}`:"Market"})]}):i.jsx("div",{className:"text-[#9B9B9B]",children:"—"})]})}function qpn({onBulkCancel:e,busy:t}){const[n,r]=m.useState(!1),s=m.useRef(null),[a,o]=m.useState({x:0,y:0});m.useEffect(()=>{var u;if(!n)return;const c=(u=s.current)==null?void 0:u.getBoundingClientRect();c&&o({x:c.left,y:c.bottom+6})},[n]),m.useEffect(()=>{if(!n)return;const c=()=>r(!1),u=d=>{s.current&&s.current.contains(d.target)||c()};return window.addEventListener("resize",c),window.addEventListener("scroll",c),document.addEventListener("pointerdown",u),()=>{window.removeEventListener("resize",c),window.removeEventListener("scroll",c),document.removeEventListener("pointerdown",u)}},[n]);const l=({label:c,val:u,showSpinner:d})=>i.jsx("div",{className:`px-2 py-1.5 rounded cursor-pointer ${t?"opacity-60 pointer-events-none":"hover:bg-white/5"}`,onClick:()=>{t||(e==null||e(u),r(!1))},children:i.jsxs("div",{className:"flex items-center",children:[i.jsx("span",{children:c}),d&&t?i.jsx("span",{className:"inline-flex ml-2 align-middle",children:i.jsx(Yy,{size:12,color:"#FFF"})}):null]})});return i.jsxs(i.Fragment,{children:[i.jsxs("button",{ref:s,className:"w-[120px] min-w-0 h-8 px-2 rounded-lg border border-[#2A2A2A] bg-[#161616] text-[#CFCFCF] text-xs flex items-center justify-between overflow-hidden",onClick:c=>{c.stopPropagation(),r(u=>!u)},title:"Cancel menu",children:[i.jsx("span",{className:"truncate",children:"Cancel"}),i.jsx("span",{className:"opacity-70 ml-2",children:"▾"})]}),n&&Na.createPortal(i.jsx("div",{className:"fixed z-[99998] w-[260px] rounded-xl border border-[#2A2A2A] bg-[#0F0F0F] shadow-2xl p-3",style:{top:a.y,left:a.x},onPointerDown:c=>c.stopPropagation(),children:i.jsxs("div",{className:"mt-2 text-[13px] text-white/90",children:[i.jsx(l,{label:"Cancel All",val:"all",showSpinner:!0}),i.jsx(l,{label:"Cancel Limit",val:"limit"}),i.jsx(l,{label:"Cancel TP/SL",val:"tpsl"}),i.jsx(l,{label:"Cancel ReduceOnly",val:"reduceOnly"}),i.jsx(l,{label:"Cancel Non-Reduce",val:"nonReduce"})]})}),document.body)]})}function Gpn({walletAddress:e,listHeight:t=560,onCancelOrder:n,onBulkCancel:r}){const{rows:s,loading:a}=Cue(e),[o,l]=m.useState(!1),[c,u]=m.useState(null),[d,f]=m.useState(null),[x,g]=m.useState(null),{key:v}=w2(),[w,C]=m.useState(new Set),[N,P]=m.useState(!1),I=V=>w.has(V),R=V=>C(ee=>new Set([...ee,V])),F=V=>C(ee=>{const ae=new Set(ee);return ae.delete(V),ae}),U=m.useCallback(async V=>{await(await ASe(e)).cancelOrder({symbol:V.coin,oid:V.oid})},[e]),L=m.useCallback(async V=>{await(await ASe(e)).cancelOrdersFiltered({filter:V})},[e]),z={kBONK:"BONK",kPEPE:"PEPE",kSHIB:"SHIB",kFLOKI:"FLOKI",kNEIRO:"NEIRO",kDOGS:"DOGS",kLUNC:"LUNC"},Q=V=>z[V]||V,ne=n??U,J=r??L,X=m.useCallback(async V=>{const ee=V.oid;if(!I(ee)){R(ee);try{await rn.promise(Promise.resolve(ne(V)),{loading:`Cancelling: ${V.coin} #${ee}...`,success:`Cancelled: ${V.coin} #${ee}`,error:ae=>`Cancel failed: ${V.coin} #${ee} • ${(ae==null?void 0:ae.message)||ae}`},{position:"bottom-right",style:{background:"#1e1e1e",color:"#fff",fontSize:12}})}finally{F(ee)}}},[ne,w]),re=V=>V==="all"?"All orders":V==="limit"?"Limit orders":V==="tpsl"?"TP/SL orders":V==="reduceOnly"?"ReduceOnly orders":V==="nonReduce"?"Non-Reduce orders":V,pe=m.useCallback(async V=>{if(V){P(!0);try{await rn.promise(Promise.resolve(J(V)),{loading:`Bulk cancelling: ${re(V)}...`,success:`Bulk cancelled: ${re(V)}`,error:ee=>`Bulk cancel failed: ${re(V)} • ${(ee==null?void 0:ee.message)||ee}`},{position:"bottom-right",style:{background:"#1e1e1e",color:"#fff",fontSize:12}})}finally{P(!1)}}},[J]),Y=m.useCallback(V=>{const ee=Array.isArray(V==null?void 0:V.children)?V.children:[],ae=ee.find(Ne=>Hpn(Ne.orderType))||null,fe=ee.find(Ne=>zpn(Ne.orderType))||null;u({orderType:V.type,coin:V.coin,side:V.sideRaw,sz:V.size,limitPx:V.limitPx,triggerCondition:V.triggerCondition,timestamp:V.timestamp}),f(fe||ae||null),g(ae&&fe?ae:null),l(!0)},[]),ie=m.useMemo(()=>[{key:"timestamp",label:"Time",sortable:!0,width:"140px",sortValue:V=>V.timestamp,render:V=>i.jsx("span",{className:"text-white",children:Dpn(V)})},{key:"type",label:"Type",sortable:!0,width:"120px",sortValue:V=>V.type||"",render:(V,ee)=>i.jsx("span",{className:"text-white",children:ee.type||"--"})},{key:"coin",label:"Coin",sortable:!0,sortValue:V=>V.coin||"",render:(V,ee)=>{const ae=(ee.side==="B",ee.reduceOnly?"text-[#FF797C]":"text-[#67FFBD]"),fe=Vo(),Ne=()=>fe(`/terminal/hyperliquid/${ee.coin}`);return i.jsxs("div",{onPointerDown:Ne,className:"flex items-center font-medium cursor-pointer hover:opacity-80",children:[i.jsx("img",{src:`https://app.hyperliquid.xyz/coins/${Q(ee.coin)}.svg`,onError:ra,className:"w-5 h-5 mr-2",alt:ee.coin}),i.jsx("span",{className:ae,children:ee.coin.replace("xyz:","")||"--"})]})}},{key:"side",label:"Direction",sortable:!0,sortValue:V=>V.side==="B"?1:0,render:(V,ee)=>{const ae=Bpn(ee),fe=ee.side==="Sell";return i.jsx("span",{className:`h-5 px-1.5 py-1 rounded-md text-[11px] font-semibold flex justify-center items-center ${fe?"text-[#FF797C] bg-[#FF797C]/20":"text-[#67FFBD] bg-[#67FFBD]/20"}`,children:ae})}},{key:"size",label:"Size",sortable:!0,sortValue:V=>V.size,render:V=>i.jsx("span",{className:"text-white font-semibold",children:V})},{key:"originalSize",label:"Original Size",sortable:!0,sortValue:V=>Math.abs(V.originalSize),render:V=>i.jsx("span",{className:"text-white font-semibold",children:V})},{key:"orderValue",label:"Order value",sortable:!0,sortValue:V=>Math.abs(V.orderValue),render:V=>i.jsx("span",{className:"text-white font-semibold",children:Lpn(V,2)})},{key:"price",label:"Price",sortable:!0,sortValue:V=>V.limitPx,render:(V,ee)=>{if(ee.price==="Market")return i.jsx("span",{className:"text-white font-semibold",children:"Market"});const ae=typeof ee.pxDecimals=="number"?ee.pxDecimals:3;return i.jsx("span",{className:"text-white font-semibold",children:cre(ee.limitPx,ae)})}},{key:"reduceOnly",label:"Reduce",sortable:!0,sortValue:V=>V.reduceOnly?1:0,render:V=>i.jsx("span",{className:"text-white font-semibold",children:V?"Yes":"No"})},{key:"triggerCondition",label:"Trigger",sortable:!0,sortValue:V=>V.triggerPx||0,width:"140px",render:(V,ee)=>ee.triggerPx&&ee.triggerPx!=="N/A"?i.jsx("span",{className:"text-white font-semibold",children:ee.type==="Stop Market"?`Price Below ${ee.triggerPx}`:ee.type==="Take Profit Market"?`Price Above ${ee.triggerPx}`:ee.triggerPx}):i.jsx("span",{children:"N/A"})},{key:"tp_sl",label:"TP/SL",sortable:!1,render:(V,ee)=>{const ae=Array.isArray(ee.children)&&ee.children.length>0;return Upn(ee)&&ae?i.jsx("button",{onClick:fe=>{fe.stopPropagation(),Y(ee)},className:"text-[#67FFBD] hover:opacity-80 underline underline-offset-4 p-0 -ml-2 w-full bg-transparent",children:i.jsx("span",{className:"flex justify-start",children:"View"})}):i.jsx("span",{className:"text-[#9B9B9B]",children:"--"})}},{key:"cancel",label:i.jsx(qpn,{onBulkCancel:pe,busy:N}),sortable:!1,render:(V,ee)=>{const ae=I(ee.oid);return i.jsx("button",{onClick:fe=>{fe.stopPropagation(),ae||X(ee)},disabled:ae,className:`h-6 w-6 flex items-center justify-center rounded-md border text-[#FF797C] transition-all duration-200 p-1 text-[11px] ${ae?"opacity-60 cursor-not-allowed border-red-500/30 bg-red-500/10":"border-[#2A2A2A] bg-red-500/20 hover:bg-red-500/30 border-red-500/50 hover:bg-[#2A0F12]"}`,title:ae?"Cancelling...":"Cancel order",children:ae?i.jsx(Yy,{size:12,color:"#FF797C"}):"×"})}}],[Y,X,pe,N,w]),oe=(d?1:0)+(x?1:0),G=c?`${c.coin} • TP/SL for Limit @ ${cre(c.limitPx,3)}`:"Take Profit / Stop Loss";return i.jsxs(i.Fragment,{children:[i.jsx(Ru,{data:Jg(s,"openOrders",v),loading:a,columns:ie,rowHeight:30,listHeight:t,tableClassName:"mt-2",theadClassName:"sticky top-0 z-10 whitespace-nowrap rounded-2xl px-2 py-2 flex !rounded-none bg-transparent !text-[#9B9B9B] font-inter !text-[11px] not-italic font-semibold leading-[13px] tracking-[-0.13px]",tbodyClassName:"px-1",rowClassName:"border-b border-[#1E1E1E] bg-transparent !rounded-none",cellClassName:()=>"py-1 flex !text-[11px] font-normal",rowKey:V=>V.id,emptyState:i.jsx("div",{className:"px-3 py-6 text-[#9B9B9B]",children:"No open orders"})}),i.jsxs($pn,{open:o,onClose:()=>l(!1),title:G,children:[i.jsx("div",{className:"text-center text-[14px] text-[#9B9B9B] mb-4",children:oe===2?"If order A is filled, orders B and C will be placed":"If order A is filled, order B will be placed"}),i.jsxs("div",{className:"flex flex-col items-stretch gap-6",children:[i.jsxs("div",{className:"mx-auto",children:[i.jsx("div",{className:"text-center text-[#9B9B9B] mb-2",children:"Order A"}),i.jsx("div",{className:"w-[360px]",children:i.jsx(rF,{title:"",order:c,parentRawSide:c==null?void 0:c.side})})]}),i.jsx("div",{className:"relative mx-auto h-10 w-px bg-[#2a2a2a]"}),oe===2?i.jsxs("div",{className:"grid grid-cols-2 gap-6",children:[i.jsx("div",{className:"text-center text-[#9B9B9B] mb-2",children:"If order B filled, cancel order C"}),i.jsx("div",{className:"text-center text-[#9B9B9B] mb-2",children:"If order C filled, cancel order B"}),i.jsx(rF,{title:"Order B",order:d,parentRawSide:c==null?void 0:c.side}),i.jsx(rF,{title:"Order C",order:x,parentRawSide:c==null?void 0:c.side})]}):i.jsxs("div",{className:"grid grid-cols-1 gap-6",children:[i.jsx("div",{className:"text-center text-[#9B9B9B] mb-2",children:"Order B"}),i.jsx(rF,{title:"",order:d,parentRawSide:c==null?void 0:c.side})]})]})]})]})}async function Kpn(e){const t=vT({getPK:()=>typeof window<"u"?localStorage.getItem("hl_pk"):null,isMainnet:!0,vaultAddress:null});return YN({address:e,signer:t,dex:""})}const Ypn="wss://api.hyperliquid.xyz/ws",UHe="https://api.hyperliquid.xyz/info";function yv(e,t=6){return Number(e||0).toLocaleString(void 0,{maximumFractionDigits:t})}function tj(e,t=2){return Number(e||0).toLocaleString(void 0,{maximumFractionDigits:t})}function $X(e){if(!e)return"--";const t=new Date(Number(e)),n=String(t.getDate()).padStart(2,"0"),r=String(t.getMonth()+1).padStart(2,"0"),s=t.getFullYear(),a=String(t.getHours()).padStart(2,"0"),o=String(t.getMinutes()).padStart(2,"0"),l=String(t.getSeconds()).padStart(2,"0");return`${n}/${r}/${s} - ${a}:${o}:${l}`}function UX(e){return e?"Yes":"No"}function zHe(e,t){const n=Number(t||0);return n?Number(e||0)/n:null}const zX=new Map;function HHe(e){const t=(e==null?void 0:e.toLowerCase())||"";return t?(zX.has(t)||zX.set(t,{key:t,subs:new Set,ping:null,ws:null,connected:!1,booting:!1,activeRows:[],historyRows:[],fillRows:[],loadingActive:!0,loadingHistory:!0,loadingFills:!0,hydratedActive:!1}),zX.get(t)):null}function Z3(e){const t={activeRows:e.activeRows,historyRows:e.historyRows,fillRows:e.fillRows,loadingActive:e.loadingActive,loadingHistory:e.loadingHistory,loadingFills:e.loadingFills,hydratedActive:e.hydratedActive};e.subs.forEach(n=>n(t))}function EO(e){var t;try{(t=e.ws)==null||t.close()}catch{}e.ws=null,e.ping&&(clearInterval(e.ping),e.ping=null),e.connected=!1}function Xpn(e){var s;const t=((s=e==null?void 0:e.data)==null?void 0:s.clearingHouseState)??(e==null?void 0:e.data)??e;if(!t||!Object.prototype.hasOwnProperty.call(t,"twapStates"))return{has:!1,pairs:[]};const n=t.twapStates;let r=[];return Array.isArray(n)&&(n.length===1&&Array.isArray(n[0])&&Array.isArray(n[0][0])?r=n[0]:n.length&&Array.isArray(n[0])?r=n:r=[]),{has:!0,pairs:r}}function VHe(e){if(e.booting||e.connected)return;e.booting=!0,EO(e);const t=new WebSocket(Ypn);e.ws=t,t.onopen=()=>{e.connected=!0,!e.hydratedActive&&e.activeRows.length===0&&(e.loadingActive=!0,Z3(e)),t.send(JSON.stringify({method:"subscribe",subscription:{type:"webData2",user:e.key}})),e.ping=setInterval(()=>{try{t.send(JSON.stringify({id:1,method:"ping"}))}catch{}},3e4)},t.onmessage=n=>{try{const r=JSON.parse(n.data);if((r==null?void 0:r.method)==="pong")return;const{has:s,pairs:a}=Xpn(r);if(s){const o=[];for(const l of a){if(!Array.isArray(l)||l.length<2)continue;const[c,u]=l;if(!u||((u==null?void 0:u.user)||"").toLowerCase()!==e.key)continue;const d=zHe(u.executedNtl,u.executedSz);o.push({id:String(c),twapId:Number(c),coin:u.coin,sz:Number(u.sz||0),executedSz:Number(u.executedSz||0),avgPx:d,minutes:Number(u.minutes||0),reduceOnly:!!u.reduceOnly,randomize:!!u.randomize,timestamp:Number(u.timestamp||0),side:u.side,errors:"--"})}o.sort((l,c)=>c.timestamp-l.timestamp),e.activeRows=o,e.hydratedActive=!0,e.loadingActive=!1,Z3(e)}}catch{}},t.onclose=()=>{EO(e),setTimeout(()=>VHe(e),1500)},t.onerror=()=>{EO(e)},e.booting=!1}async function WHe(e){try{e.loadingHistory=!0,Z3(e);const n=await(await fetch(UHe,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"twapHistory",user:e.key})})).json(),s=(Array.isArray(n)?n:[]).map((a,o)=>{var u,d;const l=(a==null?void 0:a.state)||{},c=zHe(l.executedNtl,l.executedSz);return{id:`${a.time}-${o}`,time:Number(a.time)*1e3,coin:l.coin,totalSz:Number(l.sz||0),executedSz:Number(l.executedSz||0),avgPx:c,totalMinutes:Number(l.minutes||0),reduceOnly:!!l.reduceOnly,randomize:!!l.randomize,status:(((u=a==null?void 0:a.status)==null?void 0:u.status)||"").charAt(0).toUpperCase()+(((d=a==null?void 0:a.status)==null?void 0:d.status)||"").slice(1)}});s.sort((a,o)=>o.time-a.time),e.historyRows=s}catch{e.historyRows=[]}finally{e.loadingHistory=!1,Z3(e)}}function Qpn(e){const n=(Array.isArray(e)?e:[]).map(s=>{const a=(s==null?void 0:s.fill)||s,o=(s==null?void 0:s.twapId)??null;return{id:`${a==null?void 0:a.oid}-${a==null?void 0:a.time}`,coin:a==null?void 0:a.coin,dir:a==null?void 0:a.dir,px:Number((a==null?void 0:a.px)||0),sz:Number((a==null?void 0:a.sz)||0),fee:Number((a==null?void 0:a.fee)||0),closedPnl:Number((a==null?void 0:a.closedPnl)||0),oid:Number((a==null?void 0:a.oid)||0),time:Number((a==null?void 0:a.time)||0),twapId:o}}),r=new Map;return n.forEach(s=>{r.has(s.id)||r.set(s.id,s)}),[...r.values()].sort((s,a)=>a.time-s.time)}async function qHe(e){try{e.loadingFills=!0,Z3(e);const n=await(await fetch(UHe,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"userTwapSliceFills",user:e.key})})).json();e.fillRows=Qpn(n||[])}catch{e.fillRows=[]}finally{e.loadingFills=!1,Z3(e)}}function Zpn(e){const t=(e==null?void 0:e.toLowerCase())||"",[n,r]=m.useState({activeRows:[],historyRows:[],fillRows:[],loadingActive:!0,loadingHistory:!0,loadingFills:!0,hydratedActive:!1});return m.useEffect(()=>{const s=HHe(t);if(!s){r({activeRows:[],historyRows:[],fillRows:[],loadingActive:!0,loadingHistory:!1,loadingFills:!1,hydratedActive:!1});return}const a=o=>r(o);return s.subs.add(a),r({activeRows:s.activeRows,historyRows:s.historyRows,fillRows:s.fillRows,loadingActive:s.loadingActive,loadingHistory:s.loadingHistory,loadingFills:s.loadingFills,hydratedActive:s.hydratedActive}),VHe(s),WHe(s),qHe(s),()=>{s.subs.delete(a),s.subs.size===0&&EO(s)}},[t]),n}function Jpn(e){const t=Math.max(0,Math.floor(e/1e3)),n=String(Math.floor(t/3600)).padStart(2,"0"),r=String(Math.floor(t%3600/60)).padStart(2,"0"),s=String(t%60).padStart(2,"0");return`${n}:${r}:${s}`}function emn(e=1e3){const[t,n]=m.useState(Date.now());return m.useEffect(()=>{const r=setInterval(()=>n(Date.now()),e);return()=>clearInterval(r)},[e]),t}function _O(e=""){const t=e.toLowerCase();return t.includes("long")||t==="buy"}function kO(e=""){const t=e.toLowerCase();return t.includes("short")||t==="sell"}function tmn(e=""){return _O(e)&&!kO(e)?3:_O(e)&&kO(e)?2:kO(e)&&!_O(e)?1:0}function nmn({walletAddress:e}){const{activeRows:t,historyRows:n,fillRows:r,loadingActive:s,loadingHistory:a,loadingFills:o,hydratedActive:l}=Zpn(e),c=emn(1e3),u=m.useMemo(()=>t.map(re=>({...re,runtimeMs:Math.max(0,c-Number(re.timestamp||0))})),[t,c]),{key:d}=w2(),[f,x]=m.useState(new Set),g=re=>f.has(re),v=re=>x(pe=>new Set([...pe,re])),w=re=>x(pe=>{const Y=new Set(pe);return Y.delete(re),Y}),C=async re=>{const pe=re.twapId??Number(re.id);if(!g(pe)){v(pe);try{const Y=await Kpn(e);await rn.promise(Y.cancelTwapOrder({symbol:re.coin,twapId:pe}),{loading:`Terminating: ${re.coin} #${pe}...`,success:`Terminated: ${re.coin} #${pe}`,error:oe=>`Terminate failed: ${re.coin} #${pe} • ${(oe==null?void 0:oe.message)||oe}`},{position:"bottom-right",style:{background:"#1e1e1e",color:"#fff",fontSize:12}});const ie=HHe(e);if(ie){const oe=String(pe);ie.activeRows=ie.activeRows.filter(G=>String(G.twapId??G.id)!==oe),ie.hydratedActive=!0,Z3(ie),WHe(ie),qHe(ie)}}finally{w(pe)}}},[N,P]=m.useState("active"),[I,R]=m.useState("active"),F=["active","history","fills"],U=F.indexOf(N)>F.indexOf(I)?"right":"left",L={enter:re=>({x:re==="right"?24:-24,opacity:0}),center:{x:0,opacity:1},exit:re=>({x:re==="right"?-24:24,opacity:0})};m.useEffect(()=>{const re=setInterval(()=>{},3e4);return()=>clearInterval(re)},[]);const z=(re,pe,Y)=>re?i.jsxs("div",{className:"px-3 py-6 flex items-center gap-2 text-[#9B9B9B]",children:[i.jsx(Yy,{size:14,color:"#9B9B9B"}),i.jsx("span",{children:Y})]}):i.jsx("div",{className:"px-3 py-6 text-[#9B9B9B]",children:pe}),Q=m.useMemo(()=>[{key:"coin",label:"Coin",sortable:!0,sortValue:re=>re.coin||"",render:(re,pe)=>{const Y=pe.side==="A"||pe.side==="Buy"?"text-[#FF797C]":"text-[#67FFBD]",ie=Vo(),oe=()=>ie(`/terminal/hyperliquid/${pe.coin}`);return i.jsxs("div",{onPointerDown:oe,className:"flex items-center font-medium cursor-pointer hover:opacity-80",children:[i.jsx("img",{src:`https://app.hyperliquid.xyz/coins/${pe.coin}.svg`,onError:ra,className:"w-5 h-5 mr-2",alt:pe.coin}),i.jsx("span",{className:`font-bold ${Y}`,children:re||"--"})]})}},{key:"sz",label:"Size",sortable:!0,sortValue:re=>re.sz,render:(re,pe)=>{const Y=pe.side==="A"||pe.side==="Buy"?"text-[#FF797C]":"text-[#67FFBD]";return i.jsxs("span",{className:Y,children:[yv(re)," ",pe.coin]})}},{key:"executedSz",label:"Executed Size",sortable:!0,sortValue:re=>re.executedSz,render:(re,pe)=>{const Y=pe.side==="A"||pe.side==="Buy"?"text-[#FF797C]":"text-[#67FFBD]";return re&&Number(re)!==0?i.jsxs("span",{className:Y,children:[yv(re)," ",pe.coin]}):i.jsx("span",{className:"text-[#9B9B9B]",children:"--"})}},{key:"avgPx",label:"Average Price",sortable:!0,sortValue:re=>re.avgPx||0,render:re=>re?i.jsx("span",{className:"text-white font-semibold",children:tj(re,0)}):"--"},{key:"runtime",label:"Running Time / Total",sortable:!0,sortValue:re=>re.runtimeMs??0,render:(re,pe)=>(Math.max(0,Math.floor((Date.now()-pe.timestamp)/6e4)),i.jsxs("span",{className:"text-white font-semibold",children:[Jpn(pe.runtimeMs??0)," / ",pe.minutes," minutes"]}))},{key:"reduceOnly",label:"Reduce",sortable:!0,sortValue:re=>re.reduceOnly?1:0,render:re=>i.jsx("span",{className:"text-white font-semibold",children:UX(re)})},{key:"timestamp",label:"Creation Time",sortable:!0,sortValue:re=>re.timestamp,render:re=>i.jsx("span",{className:"text-white font-semibold",children:$X(re)})},{key:"errors",label:"Errors",sortable:!1,render:re=>i.jsx("span",{className:"text-[#9B9B9B] font-semibold",children:re||"--"})},{key:"terminate",label:"Terminate",sortable:!1,render:(re,pe)=>{const Y=pe.twapId??Number(pe.id),ie=g(Y);return i.jsx("button",{onClick:oe=>{oe.stopPropagation(),ie||C(pe)},disabled:ie,className:`h-6 w-6 flex items-center justify-center rounded-md border text-[#FF797C]
transition-colors duration-150 p-1 text-[11px]
border-red-500/50 mb-[1px] ${ie?"opacity-60 cursor-not-allowed bg-red-500/10":"bg-red-500/20"}`,title:ie?"Terminating...":"Terminate",children:ie?i.jsx(Yy,{size:12,color:"#FF797C"}):"×"})}}],[f,e]),ne=m.useMemo(()=>[{key:"time",label:"Time",sortable:!0,sortValue:re=>re.time,render:re=>i.jsx("span",{className:"text-white font-semibold",children:$X(re)})},{key:"coin",label:"Coin",sortable:!0,sortValue:re=>re.coin||"",render:(re,pe)=>{const Y=pe.side==="A"||pe.side==="Buy"?"text-[#FF797C]":"text-[#67FFBD]",ie=Vo(),oe=()=>ie(`/terminal/hyperliquid/${pe.coin}`);return i.jsxs("div",{onPointerDown:oe,className:"flex items-center font-medium cursor-pointer hover:opacity-80",children:[i.jsx("img",{src:`https://app.hyperliquid.xyz/coins/${pe.coin}.svg`,onError:ra,className:"w-5 h-5 mr-2",alt:pe.coin}),i.jsx("span",{className:`font-bold ${Y}`,children:re||"--"})]})}},{key:"totalSz",label:"Total Size",sortable:!0,sortValue:re=>re.totalSz,render:(re,pe)=>i.jsxs("span",{className:pe.side==="A"||pe.side==="Buy"?"text-[#FF797C]":"text-[#67FFBD]",children:[yv(re)," ",pe.coin]})},{key:"executedSz",label:"Executed Size",sortable:!0,sortValue:re=>re.executedSz,render:(re,pe)=>i.jsxs("span",{className:pe.side==="A"||pe.side==="Buy"?"text-[#FF797C]":"text-[#67FFBD]",children:[yv(re)," ",pe.coin]})},{key:"avgPx",label:"Average Price",sortable:!0,sortValue:re=>re.avgPx||0,render:re=>re?i.jsx("span",{className:"text-white font-semibold",children:tj(re,0)}):"--"},{key:"totalMinutes",label:"Total Runtime",sortable:!0,sortValue:re=>re.totalMinutes,render:re=>i.jsxs("span",{className:"text-white font-semibold",children:[yv(re,0)," minutes"]})},{key:"reduceOnly",label:"Reduce",sortable:!0,sortValue:re=>re.reduceOnly?1:0,render:re=>i.jsx("span",{className:"text-white font-semibold",children:UX(re)})},{key:"randomize",label:"Randomize",sortable:!0,sortValue:re=>re.randomize?1:0,render:re=>i.jsx("span",{className:"text-white font-semibold",children:UX(re)})},{key:"status",label:"Status",sortable:!0,sortValue:re=>re.status||"",render:re=>i.jsx("span",{className:"text-white font-semibold",children:re||"--"})}],[]),J=m.useMemo(()=>[{key:"time",label:"Time",sortable:!0,sortValue:re=>re.time,render:(re,pe)=>i.jsx("span",{className:"text-white font-semibold",children:$X(pe.time)})},{key:"coin",label:"Coin",sortable:!0,sortValue:re=>re.coin||"",render:(re,pe)=>{const Y=pe.side==="A"||pe.side==="Buy"?"text-[#FF797C]":"text-[#67FFBD]",ie=Vo(),oe=()=>ie(`/terminal/hyperliquid/${pe.coin}`);return i.jsxs("div",{onPointerDown:oe,className:"flex items-center font-medium cursor-pointer hover:opacity-80",children:[i.jsx("img",{src:`https://app.hyperliquid.xyz/coins/${pe.coin}.svg`,onError:ra,className:"w-5 h-5 mr-2",alt:pe.coin}),i.jsx("span",{className:`font-bold ${Y}`,children:re||"--"})]})}},{key:"dir",label:"Direction",sortable:!0,sortValue:re=>tmn(re.dir),render:re=>i.jsx("span",{className:`${kO(re)?"text-[#FF6B6B]":_O(re)?"text-[#67FFBD]":"text-white"}`,children:re||"--"})},{key:"px",label:"Price",sortable:!0,sortValue:re=>re.px,render:re=>re!=null?i.jsxs("span",{className:"text-white font-semibold",children:["$",tj(re,0)]}):"--"},{key:"sz",label:"Size",sortable:!0,sortValue:re=>re.sz,render:re=>i.jsx("span",{className:"text-white font-semibold",children:yv(re)})},{key:"tradeValue",label:"Trade Value",sortable:!0,sortValue:re=>re.px*re.sz,render:(re,pe)=>pe.px&&pe.sz?i.jsxs("span",{className:"text-white font-semibold",children:["$",tj(pe.px*pe.sz)]}):"--"},{key:"fee",label:"Fee",sortable:!0,sortValue:re=>re.fee,render:re=>i.jsx("span",{className:"text-white font-semibold",children:yv(re)})},{key:"closedPnl",label:"Closed PnL",sortable:!0,sortValue:re=>re.closedPnl-re.fee,render:(re,pe)=>{const Y=Number(pe.closedPnl||0)-Number(pe.fee||0),ie=Y>0,oe=Y<0;return i.jsxs("span",{className:`${ie?"text-[#67FFBD] font-semibold":oe?"text-[#FF797C] font-semibold":"text-white font-semibold"}`,children:["$",tj(Math.abs(Y))]})}},{key:"oid",label:"Order ID",sortable:!0,sortValue:re=>re.oid,render:re=>i.jsx("span",{className:"text-[#979797] font-semibold",children:re||"--"})}],[]),X=i.jsx("div",{className:"px-3",children:i.jsx("div",{className:"relative flex gap-2 overflow-x-auto whitespace-nowrap py-2",children:[{k:"active",t:"Active"},{k:"history",t:"History"},{k:"fills",t:"Fill History"}].map(re=>{const pe=N===re.k;return i.jsxs("button",{onClick:()=>{R(N),P(re.k)},className:`relative cursor-pointer font-inter text-[12px] leading-[15px] px-4 py-[6px] flex items-center justify-center gap-[10px] rounded-lg bg-transparent ${pe?"text-white":"text-[#929292] hover:text-white"}`,children:[pe&&i.jsx(vo.span,{layoutId:"twap-pill",className:"absolute inset-0 rounded-lg bg-[#262626]",transition:{type:"spring",stiffness:380,damping:30}}),i.jsx("span",{className:"relative z-10",children:re.t})]},re.k)})})});return i.jsxs("div",{className:"flex flex-col h-full",children:[X,i.jsx("div",{className:"flex-1 min-h-0 relative",children:i.jsx(xT,{mode:"wait",custom:U,children:i.jsx(vo.div,{custom:U,variants:L,initial:"enter",animate:"center",exit:"exit",transition:{type:"spring",stiffness:320,damping:28},className:"absolute inset-0",children:N==="active"?i.jsx(Ru,{data:Jg(u,"twap",d),loading:s||!l,columns:Q,rowHeight:28,listHeight:560,tableClassName:"mt-2",theadClassName:"sticky top-0 z-10 whitespace-nowrap rounded-2xl px-2 py-2 flex !rounded-none bg-transparent !text-[#9B9B9B] font-inter !text-[11px] not-italic font-semibold leading-[12px] tracking-[-0.13px]",tbodyClassName:"px-1",rowClassName:"border-b border-[#1E1E1E] bg-transparent !rounded-none",cellClassName:()=>"py-1 flex !text-[11px] font-normal",rowKey:re=>re.id,emptyState:z(s||!l,"No Active TWAP","Loading Active TWAP…")}):N==="history"?i.jsx(Ru,{data:Jg(n,"twap",d),loading:a,columns:ne,rowHeight:28,listHeight:560,tableClassName:"mt-2",theadClassName:"sticky top-0 z-10 whitespace-nowrap rounded-2xl px-2 py-2 flex !rounded-none bg-transparent !text-[#9B9B9B] font-inter !text-[11px] not-italic font-semibold leading-[12px] tracking-[-0.13px]",tbodyClassName:"px-1",rowClassName:"border-b border-[#1E1E1E] bg-transparent !rounded-none",cellClassName:()=>"py-1 flex !text-[11px] font-normal",rowKey:re=>re.id,emptyState:z(a,"No TWAP History","Loading TWAP History…")}):i.jsx(Ru,{data:Jg(r,"twap",d),loading:o,columns:J,rowHeight:28,listHeight:560,tableClassName:"mt-2",theadClassName:"sticky top-0 z-10 whitespace-nowrap rounded-2xl px-2 py-2 flex !rounded-none bg-transparent !text-[#9B9B9B] font-inter !text-[11px] not-italic font-semibold leading-[12px] tracking-[-0.13px]",tbodyClassName:"px-1",rowClassName:"border-b border-[#1E1E1E] bg-transparent !rounded-none",cellClassName:()=>"py-1 flex !text-[11px] font-normal",rowKey:re=>re.id,emptyState:z(o,"No TWAP fills available","Loading TWAP fills…")})},N)})})]})}const rmn="wss://api.hyperliquid.xyz/ws",smn="https://api-ui.hyperliquid.xyz/info",imn={kBONK:"BONK",kPEPE:"PEPE",kSHIB:"SHIB",kFLOKI:"FLOKI",kNEIRO:"NEIRO",kDOGS:"DOGS",kLUNC:"LUNC"},amn=e=>imn[e]||e;function omn(e,t=6){return Number(e||0).toLocaleString(void 0,{maximumFractionDigits:t})}function nj(e,t=2){return`$${Number(e||0).toLocaleString(void 0,{maximumFractionDigits:t})}`}function ure(e){return e==="Open Long"||e==="Close Short"||e==="Short > Long"}function dre(e){return e==="Open Short"||e==="Close Long"||e==="Long > Short"}function lmn(e){return ure(e)?1:dre(e)?0:-1}function cmn(e){const t=Date.now(),n=Math.max(0,t-Number(e||0)),r=Math.floor(n/1e3);if(r<60)return`${r}s ago`;const s=Math.floor(r/60);if(s<60)return`${s}m ago`;const a=Math.floor(s/60);return a<24?`${a}h ${s%60}m ago`:`${Math.floor(a/24)}d ${a%24}h ago`}function umn(e){if(!e)return"--";const t=new Date(Number(e)),n=String(t.getDate()).padStart(2,"0"),r=String(t.getMonth()+1).padStart(2,"0"),s=t.getFullYear(),a=String(t.getHours()).padStart(2,"0"),o=String(t.getMinutes()).padStart(2,"0"),l=String(t.getSeconds()).padStart(2,"0");return`${n}/${r}/${s} - ${a}:${o}:${l}`}const HX=new Map;function dmn(e,t=!0){const n=(e==null?void 0:e.toLowerCase())||"";if(!n)return null;HX.has(n)||HX.set(n,{key:n,rows:[],loading:!0,ws:null,ping:null,subs:new Set,booting:!1,connected:!1,hydrated:!1,aggregateByTime:t});const r=HX.get(n);return r.aggregateByTime=t,r}function fre(e){e.subs.forEach(t=>t({rows:e.rows,loading:e.loading}))}function TO(e){var t;try{(t=e.ws)==null||t.close()}catch{}e.ws=null,e.ping&&(clearInterval(e.ping),e.ping=null),e.connected=!1}function GHe(e){const n=(Array.isArray(e)?e:[]).map(s=>({id:`${(s==null?void 0:s.hash)||""}`,oid:s==null?void 0:s.oid,coin:s==null?void 0:s.coin,dir:(s==null?void 0:s.dir)||((s==null?void 0:s.side)==="B"?"Buy":(s==null?void 0:s.side)==="S"?"Sell":""),px:Number((s==null?void 0:s.px)||0),sz:Number((s==null?void 0:s.sz)||0),fee:Number((s==null?void 0:s.fee)||0),feeToken:(s==null?void 0:s.feeToken)||"USDC",closedPnl:Number((s==null?void 0:s.closedPnl)||0),time:Number((s==null?void 0:s.time)||0)})),r=new Map;return n.forEach(s=>{s.id&&!r.has(s.id)&&r.set(s.id,s)}),[...r.values()].sort((s,a)=>a.time-s.time)}async function fmn(e){try{e.loading=!0,fre(e);const n=await(await fetch(smn,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({aggregateByTime:!!e.aggregateByTime,type:"userFills",user:e.key})})).json();e.rows=GHe(n||[]),e.hydrated=!0}catch{e.rows=[]}finally{e.loading=!1,fre(e)}}function jSe(e,t){const n=(t==null?void 0:t.fills)||t||[];if(!Array.isArray(n)||!n.length)return;const r=GHe(n),s=[...e.rows],a=new Set(s.map(o=>o.id));r.forEach(o=>{a.has(o.id)||(s.unshift(o),a.add(o.id))}),s.sort((o,l)=>l.time-o.time),e.rows=s,fre(e)}async function KHe(e){if(e.booting||e.connected)return;e.booting=!0,TO(e);const t=new WebSocket(rmn);e.ws=t,t.onopen=()=>{e.connected=!0,t.send(JSON.stringify({method:"subscribe",subscription:{aggregateByTime:!!e.aggregateByTime,type:"userFills",user:e.key}})),e.ping=setInterval(()=>{try{t.send(JSON.stringify({id:99,method:"ping"}))}catch{}},3e4)},t.onmessage=n=>{var r,s;try{const a=JSON.parse(n.data);if((a==null?void 0:a.method)==="pong"||(a==null?void 0:a.result)==="success")return;(a==null?void 0:a.channel)==="userFills"&&jSe(e,a==null?void 0:a.data),(a==null?void 0:a.channel)==="user"&&((r=a==null?void 0:a.data)!=null&&r.fills)&&jSe(e,(s=a==null?void 0:a.data)==null?void 0:s.fills)}catch{}},t.onclose=()=>{TO(e),setTimeout(()=>KHe(e),1500)},t.onerror=()=>{TO(e)},e.booting=!1}function hmn(e,t){const n=(e==null?void 0:e.toLowerCase())||"",[r,s]=m.useState({rows:[],loading:!0});return m.useEffect(()=>{const a=dmn(n,t);if(!a){s({rows:[],loading:!1});return}const o=l=>s(l);return a.subs.add(o),s({rows:a.rows,loading:a.loading}),fmn(a),KHe(a),()=>{a.subs.delete(o),a.subs.size===0&&TO(a)}},[n,t]),r}function pmn({walletAddress:e,listHeight:t=560}){const[n,r]=m.useState(()=>typeof window>"u"?!0:window.localStorage.getItem("tradeHistoryAggregate")!=="false");m.useEffect(()=>{typeof window<"u"&&window.localStorage.setItem("tradeHistoryAggregate",n?"true":"false")},[n]);const{rows:s,loading:a}=hmn(e,n),[o,l]=m.useState(typeof window<"u"&&localStorage.getItem("isDateTradeHistoryFormat")||"date"),c=m.useRef(o);m.useEffect(()=>{typeof window<"u"&&localStorage.setItem("isDateTradeHistoryFormat",o),c.current=o},[o]);const{key:u}=w2(),{isReferralCodeName:d}=m.useContext(Qr),[f,x]=m.useState(!1),[g,v]=m.useState({coin:"",type:"",leverage:0,roe:0,entryPrice:0,markPrice:0,referral:"",positionDistribution:0,pnl:0,closePx:0}),[w,C]=m.useState(()=>new Map),N=m.useCallback(async R=>{const F=typeof window<"u"?window.localStorage.getItem("hyperAddress"):null,U=typeof window<"u"?window.localStorage.getItem("hyperToken"):null;if(!F||!U||!R||R.length===0)return null;try{const{data:L}=await fs.post("https://dextrabothypev2.nftinit.io/api/hyper/order/get_leverage_with_oids/",{address:F,token:U,position_oids:R},{headers:{"Content-Type":"application/json"}});if(L&&L.success){const z=parseFloat(L.leverage);return C(Q=>{const ne=new Map(Q);return R.forEach(J=>ne.set(String(J),z)),ne}),z}}catch(L){console.error("leverage fetch error:",L)}return null},[]);m.useEffect(()=>{if(f&&!g.referral){const R=d||typeof window<"u"&&window.localStorage.getItem("refcode")||"";R&&v(F=>({...F,referral:R}))}},[f,d,g.referral]);const P=m.useMemo(()=>[{key:"time",label:"Time",sortable:!0,sortValue:R=>R.time,render:(R,F)=>i.jsx("button",{onClick:()=>l(U=>U==="date"?"relative":"date"),className:"text-left text-white bg-transparent font-semibold",children:c.current==="date"?umn(F.time):cmn(F.time)})},{key:"coin",label:"Coin",sortable:!0,sortValue:R=>R.coin||"",render:(R,F)=>{const U=Vo(),L=()=>U(`/terminal/hyperliquid/${F.coin}`);return i.jsxs("div",{onPointerDown:L,className:"flex items-center text-white font-medium cursor-pointer hover:opacity-80",children:[i.jsx("img",{src:`https://app.hyperliquid.xyz/coins/${amn(F.coin)}.svg`,onError:ra,className:"w-5 h-5 mr-2",alt:F.coin}),i.jsx("span",{className:`font-bold ${dre(F.dir)?"text-[#FF6B6B]":ure(F.dir)?"text-[#67FFBD]":"text-white"}`,children:R||"--"})]})}},{key:"dir",label:"Direction",sortable:!0,sortValue:R=>lmn(R.dir),render:R=>i.jsx("span",{className:`font-semibold ${dre(R)?"text-[#FF6B6B]":ure(R)?"text-[#67FFBD]":"text-white"}`,children:R||"--"})},{key:"px",label:"Price",sortable:!0,sortValue:R=>R.px,render:R=>i.jsx("span",{className:"text-white font-semibold",children:nj(R)})},{key:"sz",label:"Size",sortable:!0,sortValue:R=>R.sz,render:(R,F)=>i.jsxs("span",{className:"text-white font-semibold",children:[omn(R)," ",i.jsx("span",{className:"text-[#9B9B9B]",children:F.coin})]})},{key:"tradeValue",label:"Trade Value",sortable:!0,sortValue:R=>R.px*R.sz,render:(R,F)=>i.jsxs("span",{className:"text-white font-semibold",children:[nj(F.px*F.sz)," ",i.jsx("span",{className:"text-[#9B9B9B]",children:"USDC"})]})},{key:"fee",label:"Fee",sortable:!0,sortValue:R=>R.fee,render:(R,F)=>i.jsxs("span",{className:"text-white font-semibold",children:[nj(R)," ",i.jsx("span",{className:"text-[#9B9B9B]",children:F.feeToken||"USDC"})]})},{key:"netPnl",label:"Closed PnL",sortable:!0,sortValue:R=>R.closedPnl-R.fee,render:(R,F)=>{const U=Number(F.closedPnl||0),L=Number(F.fee||0),z=U-L,Q=z>0,ne=z<0,J=!!U,X=Number(F.px||0)*Number(F.sz||0),re=X>0?z/X*100:0;return i.jsxs("div",{className:"flex items-center justify-between gap-2",children:[i.jsxs("span",{className:`${Q?"text-[#67FFBD] font-semibold":ne?"text-[#FF797C] font-semibold":"text-white font-semibold"}`,children:[z===0?nj(0):`${z<0?"-":""}${nj(Math.abs(z))}`," ",i.jsx("span",{className:"text-[#9B9B9B]",children:"USDC"})]}),J&&i.jsx("button",{onClick:async()=>{const pe=d||typeof window<"u"&&window.localStorage.getItem("refcode")||"";let Y=0;const ie=F.oid;if(ie){const oe=w.get(String(ie));if(oe!=null)Y=oe;else{const G=await N([ie]);typeof G=="number"&&!Number.isNaN(G)&&(Y=G)}}v({coin:F.coin||"",type:(F.dir||"").toUpperCase(),leverage:Y,roe:re,entryPrice:Number(F.px||0),markPrice:Number(F.px||0),referral:pe,positionDistribution:0,pnl:Number(z||0),closePx:Number(F.px||0)}),x(!0)},className:"flex items-center h-6 text-[#67FFBD] text-[11px] font-semibold bg-transparent p-0",title:"Share",children:i.jsx("img",{src:gm,alt:"",className:"w-[14px] h-[14px] min-w-[14px] min-h-[14px]"})})]})}}],[o,d,N,w]),I=m.useMemo(()=>Jg(s,"trades",u),[s,u]);return i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"flex items-center justify-end mt-2 px-1 mr-5",children:i.jsxs("label",{className:"flex items-center gap-2 text-[11px] text-[#9B9B9B]",children:[i.jsx("span",{children:"Aggregate"}),i.jsx("input",{type:"checkbox",checked:n,onChange:R=>r(R.target.checked),className:"w-3 h-3 accent-[#67FFBD]"})]})}),i.jsx(Ru,{data:I,loading:a,columns:P,rowHeight:30,listHeight:t,tableClassName:"mt-2",theadClassName:"sticky top-0 z-10 whitespace-nowrap rounded-2xl px-2 py-2 flex !rounded-none bg-transparent !text-[#9B9B9B] font-inter !text-[11px] not-italic font-semibold leading-[13px] tracking-[-0.13px]",tbodyClassName:"px-1",rowClassName:"border-b border-[#1E1E1E] bg-transparent !rounded-none",cellClassName:()=>"py-1 flex !text-[11px] font-normal",rowKey:R=>R.id,emptyState:i.jsx("div",{className:"px-3 py-6 text-[#9B9B9B]",children:"No trades"})}),i.jsx(pT,{open:f,setOpen:x,data:g,setTradeInfo:v,pnlTitle:""})]})}const mmn="https://api.hyperliquid.xyz/info";function xmn(e,t=6){return Number(e||0).toLocaleString(void 0,{maximumFractionDigits:t})}function ESe(e,t=4){return`$${Number(e||0).toLocaleString(void 0,{maximumFractionDigits:t})}`}function gmn(e){return`${(Number(e||0)*100).toLocaleString(void 0,{maximumFractionDigits:6})}%`}function bmn(e){const t=Date.now(),n=Math.max(0,t-Number(e||0)),r=Math.floor(n/1e3);if(r<60)return`${r}s ago`;const s=Math.floor(r/60);if(s<60)return`${s}m ago`;const a=Math.floor(s/60);return a<24?`${a}h ${s%60}m ago`:`${Math.floor(a/24)}d ${a%24}h ago`}function ymn(e){if(!e)return"--";const t=new Date(Number(e)),n=String(t.getDate()).padStart(2,"0"),r=String(t.getMonth()+1).padStart(2,"0"),s=t.getFullYear(),a=String(t.getHours()).padStart(2,"0"),o=String(t.getMinutes()).padStart(2,"0"),l=String(t.getSeconds()).padStart(2,"0");return`${n}/${r}/${s} - ${a}:${o}:${l}`}function vmn({walletAddress:e,listHeight:t=560,days:n=30}){const[r,s]=m.useState([]),[a,o]=m.useState(!0),[l,c]=m.useState(typeof window<"u"&&localStorage.getItem("isDateFundingHistoryFormat")||"date"),{key:u}=w2(),d=m.useRef(l);m.useEffect(()=>{typeof window<"u"&&localStorage.setItem("isDateFundingHistoryFormat",l),d.current=l},[l]),m.useEffect(()=>{let x=!0;async function g(){if(!e){x&&(s([]),o(!1));return}try{o(!0);const v=Date.now()-n*24*60*60*1e3,C=await(await fetch(mmn,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"userFunding",user:e,startTime:v})})).json(),P=(Array.isArray(C)?C:Array.isArray(C==null?void 0:C.data)?C.data:[]).map((I,R)=>{const F=(I==null?void 0:I.delta)||{},U=Number((F==null?void 0:F.szi)||0),L=Number((F==null?void 0:F.fundingRate)||0),z=Number((F==null?void 0:F.usdc)||0);let Q=U>0?"Long":U<0?"Short":null;return!Q&&L!==0&&z!==0&&(Q=L>0?z<0?"Long":"Short":z<0?"Short":"Long"),Q||(Q="Flat"),{id:`${I.time||R}-${F.coin||""}-${R}`,time:Number((I==null?void 0:I.time)||0),coin:(F==null?void 0:F.coin)||"",rate:Number((F==null?void 0:F.fundingRate)||0),size:U,amount:z,token:"USDC",side:Q}}).sort((I,R)=>R.time-I.time);x&&s(P)}catch{x&&s([])}finally{x&&o(!1)}}return g(),()=>{x=!1}},[e,n]);const f=m.useMemo(()=>[{key:"time",label:"Time",sortable:!0,sortValue:x=>x.time,render:(x,g)=>i.jsx("button",{onClick:()=>c(v=>v==="date"?"relative":"date"),className:"text-left text-white bg-transparent font-semibold",children:d.current==="date"?ymn(g.time):bmn(g.time)})},{key:"coin",label:"Coin",sortable:!0,sortValue:x=>x.coin||"",render:(x,g)=>{const v=g.side==="Long"?"text-[#67FFBD]":g.side==="Short"?"text-[#FF6B6B]":"text-white",w=Vo(),C=()=>w(`/terminal/hyperliquid/${g.coin}`);return i.jsxs("div",{onPointerDown:C,className:`flex items-center font-medium cursor-pointer hover:opacity-80 ${v}`,children:[i.jsx("img",{src:`https://app.hyperliquid.xyz/coins/${g.coin}.svg`,onError:ra,className:"w-5 h-5 mr-2",alt:g.coin}),i.jsx("span",{children:x||"--"})]})}},{key:"size",label:"Size",sortable:!0,sortValue:x=>x.size,render:(x,g)=>i.jsxs("span",{className:"text-white font-semibold",children:[xmn(x)," ",i.jsx("span",{className:"text-[#9B9B9B]",children:g.coin})]})},{key:"side",label:"Position Side",sortable:!0,sortValue:x=>x.side,render:x=>{const g=x==="Long"?"text-[#67ffbd] bg-[#67ffbd]/20":x==="Short"?"text-[#ff797c] bg-[#ff797c]/20":"text-[#9B9B9B] bg-[#9B9B9B]/10";return i.jsx("span",{className:`flex justify-center items-center h-5 px-2 py-1 rounded-md text-[11px] font-semibold uppercase ${g}`,children:x})}},{key:"amount",label:"Payment",sortable:!0,sortValue:x=>x.amount,render:x=>{const g=x>0?"text-[#67FFBD]":x<0?"text-[#FF6B6B]":"text-white";return i.jsx("span",{className:g,children:x===0?ESe(0):`${x<0?"-":""}${ESe(Math.abs(x))}`})}},{key:"rate",label:"Rate",sortable:!0,sortValue:x=>x.rate,render:x=>i.jsx("span",{className:"text-white font-semibold",children:gmn(x)})}],[]);return i.jsx(Ru,{data:Jg(r,"funding",u),loading:a,columns:f,rowHeight:30,listHeight:t,tableClassName:"mt-2",theadClassName:"sticky top-0 z-10 whitespace-nowrap rounded-2xl px-2 py-2 flex !rounded-none bg-transparent !text-[#9B9B9B] font-inter !text-[11px] not-italic font-semibold leading-[13px] tracking-[-0.13px]",tbodyClassName:"px-1",rowClassName:"border-b border-[#1E1E1E] bg-transparent !rounded-none",cellClassName:()=>"py-1 flex !text-[11px] font-normal",rowKey:x=>x.id,emptyState:i.jsx("div",{className:"px-3 py-6 text-[#9B9B9B]",children:"No funding records"})})}function sF(e,t=6){return Number(e||0).toLocaleString(void 0,{maximumFractionDigits:t})}function wmn(e){if(!e)return"--";const t=new Date(Number(e)),n=String(t.getDate()).padStart(2,"0"),r=String(t.getMonth()+1).padStart(2,"0"),s=t.getFullYear(),a=String(t.getHours()).padStart(2,"0"),o=String(t.getMinutes()).padStart(2,"0"),l=String(t.getSeconds()).padStart(2,"0");return`${n}/${r}/${s} - ${a}:${o}:${l}`}function Cmn(e){return e.side==="B"?e.reduceOnly?"Close Short":"Open Long":e.side==="A"?e.reduceOnly?"Close Long":"Open Short":e.side||"-"}function hre(e){return e==="Open Long"||e==="Close Short"||e==="Short > Long"}function pre(e){return e==="Open Short"||e==="Close Long"||e==="Long > Short"}function Smn(e){return hre(e)?1:pre(e)?0:-1}function Nmn({walletAddress:e,listHeight:t=560}){const[n,r]=m.useState([]),[s,a]=m.useState(!1),{key:o}=w2();m.useEffect(()=>{let c=!0;async function u(){if(!e){c&&r([]);return}try{a(!0);const x=(await(await fetch("https://api.hyperliquid.xyz/info",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"historicalOrders",user:e})})).json()||[]).map(g=>{var C;const v=g.order||{},w=Math.max(0,Number(v.origSz||0)-Number(v.sz||0));return{id:`${v.oid}-${g.status}`,time:Number(g.statusTimestamp||v.timestamp||0),type:v.orderType||"-",coin:v.coin||"-",sideText:Cmn(v),size:Number(v.sz||0),filled:w,orderValue:(C=v.orderType)!=null&&C.toLowerCase().includes("market")?"Market":`${(Number(v.limitPx)/1e3).toFixed(2)} USDC`,priceLabel:v.orderType==="Market"?"Market":`${sF(Number(v.limitPx||0),2)} USD`,reduceOnly:!!v.reduceOnly,trigger:v.triggerCondition&&v.triggerCondition!=="N/A"?`${v.triggerCondition} @ ${sF(Number(v.triggerPx||0),4)}`:"N/A",status:g.status?g.status[0].toUpperCase()+g.status.slice(1):"-",orderId:v.oid}});x.sort((g,v)=>v.time-g.time),c&&r(x)}catch{c&&r([])}finally{c&&a(!1)}}return u(),()=>{c=!1}},[e]);const l=m.useMemo(()=>[{key:"time",label:"Time",width:"140px",sortable:!0,sortValue:c=>c.time,render:c=>i.jsx("span",{className:"text-white font-semibold",children:wmn(c)})},{key:"type",label:"Type",sortable:!0,sortValue:c=>c.type||"",render:c=>i.jsx("span",{className:"text-white font-semibold",children:c})},{key:"coin",label:"Coin",sortable:!0,sortValue:c=>c.coin||"",render:(c,u)=>{const d=Vo(),f=()=>d(`/terminal/hyperliquid/${u.coin}`);return i.jsxs("div",{onPointerDown:f,className:"flex items-center font-medium cursor-pointer hover:opacity-80",children:[i.jsx("img",{src:`https://app.hyperliquid.xyz/coins/${u.coin}.svg`,onError:ra,className:"w-5 h-5 mr-2",alt:u.coin}),i.jsx("span",{className:`font-bold ${pre(u.sideText)?"text-[#FF6B6B]":hre(u.sideText)?"text-[#67FFBD]":"text-white"}`,children:c})]})}},{key:"sideText",label:"Side",sortable:!0,sortValue:c=>Smn(c.sideText),render:c=>i.jsx("span",{className:`font-semibold ${pre(c)?"text-[#FF6B6B]":hre(c)?"text-[#67FFBD]":"text-white"}`,children:c})},{key:"size",label:"Size",sortable:!0,sortValue:c=>c.size,render:c=>Number(c)>0?i.jsx("span",{className:"text-white font-semibold",children:sF(c)}):i.jsx("span",{className:"text-white font-semibold",children:"--"})},{key:"filled",label:"Filled",sortable:!0,sortValue:c=>c.filled,render:c=>Number(c)>0?i.jsx("span",{className:"text-white font-semibold",children:sF(c)}):i.jsx("span",{className:"text-white font-semibold",children:"--"})},{key:"orderValue",label:"Order Value",sortable:!0,sortValue:c=>c.orderValue,render:c=>i.jsx("span",{className:"text-white font-semibold",children:c})},{key:"priceLabel",label:"Price",sortable:!0,sortValue:c=>c.priceLabel==="Market"?-1:Number(String(c.priceLabel).replace(/[^0-9.]/g,"")),render:c=>i.jsx("span",{className:"text-white font-semibold",children:c})},{key:"reduceOnly",label:"Reduce",sortable:!0,sortValue:c=>c.reduceOnly?1:0,render:c=>i.jsx("span",{className:"text-whitefont-semibold",children:c?"✓":"–"})},{key:"trigger",label:"Trigger",sortable:!0,sortValue:c=>c.trigger||"",render:c=>i.jsx("span",{className:"text-white font-semibold",children:c||"N/A"})},{key:"status",label:"Status",sortable:!0,sortValue:c=>c.status||"",render:c=>i.jsx("span",{className:"text-white font-semibold",children:c})},{key:"orderId",label:"Order ID",sortable:!0,sortValue:c=>c.trigger||"",render:c=>i.jsx("span",{className:"text-white font-semibold",children:c})}],[]);return i.jsx(Ru,{data:Jg(n,"orderHistory",o),columns:l,loading:s,skeletonRowCount:12,rowHeight:30,listHeight:t,tableClassName:"mt-2",theadClassName:"sticky top-0 z-10 whitespace-nowrap rounded-2xl px-2 py-2 flex !rounded-none bg-transparent !text-[#9B9B9B] font-inter !text-[11px] not-italic font-semibold leading-[13px] tracking-[-0.13px]",tbodyClassName:"px-1",rowClassName:"border-b border-[#1E1E1E] bg-transparent !rounded-none",cellClassName:()=>"py-1 flex !text-[11px] font-normal",rowKey:c=>c.id})}const Amn="https://dextrabothypev2.nftinit.io/api/hyper/gridbot/list/",jmn="https://dextrabothypev2.nftinit.io/api/hyper/gridbot/update/",Emn="https://dextrabothypev2.nftinit.io/api/hyper/gridbot/update/",_mn="https://dextrabothypev2.nftinit.io/api/hyper/extended_bot/update/";function _Se(e,t=4){const n=Number(e||0);return Number.isFinite(n)?n.toLocaleString(void 0,{maximumFractionDigits:t}):"--"}function kmn(e,t=2){const n=Number(e||0);return Number.isFinite(n)?`$${n.toLocaleString(void 0,{maximumFractionDigits:t})}`:"--"}const Tmn={kBONK:"BONK",kPEPE:"PEPE",kSHIB:"SHIB",kFLOKI:"FLOKI",kNEIRO:"NEIRO",kDOGS:"DOGS",kLUNC:"LUNC"},rj=e=>{if(typeof e=="string"){const t=e.match(/^([A-Za-z]+:)(.*)$/);if(t){const n=t[1].toLowerCase(),r=t[2];return n+r}}return Tmn[e]||e},Imn=e=>e&&e.length>10?`${e.slice(0,6)}...${e.slice(-4)}`:e||"--";function IO({walletAddress:e,sourceMarket:t="hyper"}){var U,L;const{botSlotsInfo:n,refreshBotSlots:r}=m.useContext(Qr)||{},[s,a]=m.useState([]),[o,l]=m.useState(!1),[c,u]=m.useState(null),[d,f]=m.useState(0),[x,g]=m.useState(null),v=Vo();m.useEffect(()=>{let z=!0;async function Q(){if(typeof window>"u")return;const ne=window.localStorage.getItem("hyperAddress"),J=window.localStorage.getItem("hyperToken");if(!ne||!J){z&&(a([]),l(!1));return}try{l(!0);const re=await(await fetch(Amn,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({address:ne,token:J})})).json(),Y=(Array.isArray(re==null?void 0:re.data)?re.data:Array.isArray(re)?re:[]).filter(ie=>t?ie.source_market===t:!0);z&&a(Y)}catch{z&&(a([]),rn.error("Failed to load bots"))}finally{z&&l(!1)}}return Q(),()=>{z=!1}},[e,t,d]),m.useEffect(()=>{const z=Q=>{const ne=Q&&Q.detail&&Q.detail.sourceMarket;ne&&ne!==t||f(J=>J+1)};return window.addEventListener("gridbotUpdated",z),()=>{window.removeEventListener("gridbotUpdated",z)}},[t]);const w=m.useMemo(()=>{const z=s.map(Q=>{const ne=Q.bot_params||{},J=ne.investment||{},X=ne.priceRange||{},re=ne.liquidationPrices||{},pe=ne.direction==="long"?"Long":ne.direction==="short"?"Short":"--";return{id:Q.id,coin:Q.coin||ne.symbol||"--",market:Q.source_market||"",status:Q.is_deleted?"Stopped":"Active",side:pe,gridType:ne.gridType||"--",gridCount:ne.gridCount??"--",lower:X.lower??null,upper:X.upper??null,currentPrice:ne.currentPrice??null,leverage:J.leverage??null,collateral:J.collateral??null,totalInvestment:J.totalInvestment??null,liqLong:re.long??null,liqShort:re.short??null,trailingUp:ne.trailing_up??null,trailingDown:ne.trailing_down??null,slUp:ne.sl_up??null,slDown:ne.sl_down??null,timestamp:ne.timestamp||null,walletName:Q.wm_name||null,walletAddress:Q.wm_address||null,walletId:Q.wallet_id??null,raw:Q}});return z.sort((Q,ne)=>{const J=Q.status==="Active",X=ne.status==="Active";if(J!==X)return J?-1:1;const re=Q.timestamp?new Date(Q.timestamp).getTime():0;return(ne.timestamp?new Date(ne.timestamp).getTime():0)-re}),z},[s]),C=async(z,Q)=>{var X,re,pe;if(!z||!z.raw||typeof window>"u")return;const ne=window.localStorage.getItem("hyperAddress"),J=window.localStorage.getItem("hyperToken");if(!ne||!J){rn.error("Please sign in to manage bots");return}try{u(z.id);const Y={is_deleted:Q,bot_params:z.raw.bot_params||{}},ie=String(((X=z.raw)==null?void 0:X.source_market)||"").toLowerCase().includes("lighter")?Emn:String(((re=z.raw)==null?void 0:re.source_market)||"").toLowerCase().includes("extended")?_mn:jmn,G=await(await fetch(ie,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({address:ne,token:J,bot_id:z.id,update_params:Y})})).json().catch(()=>null);if(!(G!=null&&G.success)){const V=(G==null?void 0:G.error_message)||(G==null?void 0:G.message)||(G==null?void 0:G.detail)||"Failed to update bot";throw new Error(V)}rn.success(Q?"Bot stopped":"Bot started"),a(V=>V.map(ee=>ee.id===z.id?{...ee,is_deleted:Q}:ee)),r==null||r(),typeof window<"u"&&window.dispatchEvent(new CustomEvent("gridbotUpdated",{detail:{sourceMarket:((pe=z.raw)==null?void 0:pe.source_market)||t}})),f(V=>V+1)}catch(Y){rn.error(Y.message||"Failed to update bot")}finally{u(null)}},N=z=>{if(!z||!z.raw||typeof window>"u")return;const Q=z.status==="Active",ne=(J,X)=>{var oe,G,V,ee;const re=((oe=J==null?void 0:J.raw)==null?void 0:oe.wallet_id)??(J==null?void 0:J.walletId),pe=((G=X==null?void 0:X.raw)==null?void 0:G.wallet_id)??(X==null?void 0:X.walletId);if(re&&pe&&String(re)===String(pe))return!0;const Y=((J==null?void 0:J.walletAddress)||((V=J==null?void 0:J.raw)==null?void 0:V.wm_address)||"").toLowerCase(),ie=((X==null?void 0:X.walletAddress)||((ee=X==null?void 0:X.raw)==null?void 0:ee.wm_address)||"").toLowerCase();return!!(Y&&ie&&Y===ie)};if(!Q){if(w.some(X=>{var re,pe;return X.id!==z.id&&X.status==="Active"&&((re=X.raw)==null?void 0:re.source_market)===((pe=z.raw)==null?void 0:pe.source_market)&&ne(X,z)})){rn.error("You already have an active bot on this wallet. Please add an account.");return}g(z);return}C(z,Q)},P=()=>g(null),I=()=>{x&&(C(x,!1),g(null))},R=z=>{var re,pe,Y;if(!z)return;const Q=z.coin;if(!Q)return;const ne=((re=z.raw)==null?void 0:re.source_market)||z.market||t,J=z.status==="Active",X={sourceMarket:ne,coin:Q,botParams:((pe=z.raw)==null?void 0:pe.bot_params)||{},walletId:(Y=z.raw)==null?void 0:Y.wallet_id,isActive:J};if(typeof window<"u"){try{window.localStorage.setItem("gridbot:pending_selection",JSON.stringify(X))}catch{}window.dispatchEvent(new CustomEvent("gridbotSelectFromTasks",{detail:X}))}v(ne==="hyper"?`/terminal/hyperliquid/${rj(Q)}#gridbot`:ne==="lighter"?`/terminal/lighter/${rj(Q)}#gridbot`:`/terminal/extended/${rj(Q)}#gridbot`)},F=m.useMemo(()=>[{key:"status",label:"Status",sortable:!0,sortValue:z=>z.status==="Active"?1:0,render:z=>{const Q=z==="Active"?"text-[#67ffbd] bg-[#67ffbd]/15":"text-[#9B9B9B] bg-[#9B9B9B]/10";return i.jsx("span",{className:`inline-flex h-6 items-center justify-center px-2 py-[2px] rounded-md text-[11px] font-semibold ${Q}`,children:z})}},{key:"coin",label:"Coin",sortable:!0,sortValue:z=>z.coin||"",render:(z,Q)=>{var re;const ne=Vo(),J=String(((re=Q.raw)==null?void 0:re.source_market)||Q.market||t||"").toLowerCase();J.includes("lighter")||J.includes("extended");const X=()=>ne(`/terminal/${J}/${rj(Q.coin)}${Q.status==="Active"||Q.status==="Stopped"?"#gridbot":""}`);return i.jsxs("div",{onPointerDown:X,className:"flex items-center gap-2 text-white font-medium hover:opacity-80 cursor-pointer",children:[i.jsx("img",{src:`https://app.hyperliquid.xyz/coins/${rj(z)}.svg`,onError:ra,className:"w-4 h-4",alt:z}),i.jsx("span",{children:z.replace("XYZ:","")||"--"})]})}},{key:"wallet",label:"Wallet",sortable:!0,sortValue:z=>z.walletName||z.walletAddress||"",render:(z,Q)=>{const ne=Q.walletName||"Wallet",J=Q.walletAddress?Imn(Q.walletAddress):"--";return i.jsxs("div",{className:"flex flex-col leading-[14px]",children:[i.jsx("span",{className:"text-white font-medium",children:ne}),i.jsx("span",{className:"text-[10px] text-white/60",children:J})]})}},{key:"gridCount",label:"Grids",sortable:!0},{key:"lower",label:"Lower",sortable:!0,render:z=>z==null?"--":i.jsx("span",{className:"text-[#67FFBD] font-semibold",children:_Se(z)})},{key:"upper",label:"Upper",sortable:!0,render:z=>z==null?"--":i.jsx("span",{className:"text-[#FF797C] font-semibold",children:_Se(z)})},{key:"investment",label:"Investment",sortable:!0,sortValue:z=>z.totalInvestment??z.collateral??0,render:(z,Q)=>i.jsx("div",{className:"flex flex-col leading-[14px]",children:i.jsx("span",{className:"text-white font-semibold",children:Q.collateral!=null?kmn(Q.collateral):"--"})})},{key:"leverage",label:"Lev",sortable:!0,render:z=>z==null?"--":`${z}x`},{key:"gridType",label:"Grid Type",sortable:!0},{key:"actions",label:"Actions",render:(z,Q)=>{const ne=Q.status==="Active",J=c===Q.id;return i.jsxs("div",{className:"relative z-10 flex items-center justify-start gap-2",onClick:X=>X.stopPropagation(),onMouseDown:X=>X.stopPropagation(),children:[i.jsx("button",{type:"button",onPointerDown:X=>{X.preventDefault(),X.stopPropagation(),R(Q)},className:"h-6 flex justify-center items-center px-2 rounded-md text-[11px] font-semibold bg-[#161616] text-[#E5E7EB] hover:bg-[#1F2933]",children:i.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[i.jsx("path",{d:"M12 20h9"}),i.jsx("path",{d:"M16.5 3.5a2.121 2.121 0 1 1 3 3L7 19l-4 1 1-4Z"})]})}),i.jsx("button",{type:"button",disabled:J,onPointerDown:X=>{X.preventDefault(),X.stopPropagation(),N(Q)},className:`h-6 flex justify-center items-center px-3 rounded-md text-[11px] font-semibold ${ne?"bg-[#2a1616] text-[#ff797c] hover:bg-[#3a1c1c]":"bg-[#101613] text-[#67ffbd] hover:bg-[#19201b]"} disabled:opacity-60 disabled:cursor-not-allowed`,children:J?"Saving...":ne?"Stop":"Start"})]})}}],[c]);return i.jsxs(i.Fragment,{children:[i.jsx(Ru,{data:w,loading:o,columns:F,rowHeight:32,listHeight:560,tableClassName:"mt-2",theadClassName:"sticky top-0 z-10 whitespace-nowrap rounded-2xl px-2 py-2 flex !rounded-none bg-transparent !text-[#9B9B9B] font-inter !text-[11px] not-italic font-semibold leading-[13px] tracking-[-0.13px]",tbodyClassName:"px-1",rowClassName:"border-b border-[#1E1E1E] bg-transparent",cellClassName:()=>"py-1 text-[11px] font-normal",rowKey:z=>z.id,emptyState:i.jsx("div",{className:"px-3 py-6 text-[#9B9B9B]",children:"No bots for this market"})}),i.jsx(up,{isOpen:!!x,onClose:P,children:i.jsxs("div",{className:"w-[320px] sm:w-[380px] rounded-2xl bg-[#050505] px-6 py-5 text-[#E5E7EB]",onClick:z=>z.stopPropagation(),children:[i.jsxs("div",{className:"text-sm font-semibold text-white",children:["Start"," ",String(((U=x==null?void 0:x.raw)==null?void 0:U.source_market)||"").toLowerCase().includes("lighter")?"Lighter":String(((L=x==null?void 0:x.raw)==null?void 0:L.source_market)||"").toLowerCase().includes("extended")?"Extended":"Hyperliquid"," ","Grid Bot?"]}),i.jsxs("p",{className:"mt-3 text-[13px] text-[#9B9B9B]",children:["You are starting the"," ",i.jsx("span",{className:"text-white font-bold",children:x==null?void 0:x.coin})," ","grid bot. Make sure your parameters are correct."]}),i.jsxs("div",{className:"mt-5 flex items-center justify-end gap-3",children:[i.jsx("button",{type:"button",onClick:P,className:"h-9 rounded-xl border border-[#2c2c2c] px-4 text-[12px] font-semibold text-[#9B9B9B] transition hover:border-[#3f3f3f] hover:text-white",children:"Cancel"}),i.jsx("button",{type:"button",onClick:I,className:"h-9 rounded-xl bg-[#67FFBD] px-4 text-[12px] font-semibold text-black transition hover:brightness-105",children:"Start Bot"})]})]})})]})}function Pmn(){const[e,t]=m.useState(()=>typeof window>"u"?!1:localStorage.getItem("hide_small_balances")==="1");return m.useEffect(()=>{typeof window<"u"&&(localStorage.setItem("hide_small_balances",e?"1":"0"),window.dispatchEvent(new CustomEvent("balances:hide-small-changed",{detail:{value:e}})))},[e]),i.jsxs("label",{className:"inline-flex items-center gap-2 text-[12px] text-white mr-3 mt-1.5",children:[i.jsx("input",{type:"checkbox",className:"accent-[#67FFBD] w-[14px] h-[14px]",checked:e,onChange:n=>t(n.target.checked)}),"Hide Small Balances"]})}function Fmn(e){const{data:t,loading:n,error:r,isDigits:s,period:a,periods:o,handlePeriodChange:l,className:c="",minHeight:u="min-h-[560px]",walletAddress:d,coin:f,sourceMarket:x="hyper"}=e,{setSignInConnectButtonOpen:g}=m.useContext(Qr),[v,w]=m.useState(()=>typeof window>"u"?d||null:window.localStorage.getItem("hl_selected_wallet_address")||d||null);m.useEffect(()=>{const fe=()=>{if(typeof window>"u"){w(d||null);return}const Ne=window.localStorage.getItem("hl_selected_wallet_address");w(Ne||d||null)};return fe(),window.addEventListener("hl_selected_wallet_changed",fe),window.addEventListener("storage",fe),()=>{window.removeEventListener("hl_selected_wallet_changed",fe),window.removeEventListener("storage",fe)}},[d]);const C=v||d||null,[N,P]=m.useState(()=>C);m.useEffect(()=>{C&&P(C)},[C]);const I=C||N||null,[R,F]=m.useState({address:null,token:null}),[U,L]=m.useState(!1);m.useEffect(()=>{const fe=()=>{const Ne=typeof window<"u"?localStorage.getItem("hyperAddress"):null,he=typeof window<"u"?localStorage.getItem("hyperToken"):null;F({address:Ne,token:he}),L(!0)};return fe(),window.addEventListener("localStorageUpdated",fe),window.addEventListener("storage",fe),()=>{window.removeEventListener("localStorageUpdated",fe),window.removeEventListener("storage",fe)}},[]);const z=!!(R.address&&R.token),Q=fe=>fe==="balances"?"Connect your wallet to see your balances":fe==="positions"?"Connect your wallet to see your positions":fe==="open"?"Connect your wallet to see your open orders":fe==="twap"?"Connect your wallet to see your TWAP orders":fe==="trades"?"Connect your wallet to see your trade history":fe==="funding"?"Connect your wallet to see your funding history":fe==="orders"?"Connect your wallet to see your order history":"Connect your wallet to continue",ne=(fe,Ne)=>U?z?fe:i.jsxs("div",{className:"w-full h-full flex flex-col items-center py-10 gap-3",children:[i.jsx("p",{className:"text-[13px] text-[#9BA1A6]",children:Q(Ne)}),i.jsx("div",{className:"w-[220px]",children:i.jsx(Zp,{onClick:()=>g(!0)})})]}):fe,X=`terminalTabs:${typeof window<"u"?window.location.pathname:"tt"}`,[re,pe]=m.useState(()=>typeof window>"u"?"balances":localStorage.getItem(X)||"balances"),Y=jHe(I),ie=afn(I),oe=[{k:"balances",t:"Balances"},{k:"positions",t:`Positions${z&&Number.isFinite(Y)?` (${Y})`:""}`},{k:"open",t:`Open Orders${z&&Number.isFinite(ie)?` (${ie})`:""}`},{k:"twap",t:"TWAP"},{k:"trades",t:"Trade History"},{k:"funding",t:"Funding History"},{k:"orders",t:"Order History"},{k:"all",t:"Top Traders"},{k:"bots",t:"Bot Tasks"}];m.useEffect(()=>{oe.map(Ne=>Ne.k).includes(re)||pe("balances")},[oe,re]),m.useEffect(()=>{typeof window<"u"&&localStorage.setItem(X,re)},[re,X]),m.useEffect(()=>{const fe=Ne=>{var ye;const he=(ye=Ne==null?void 0:Ne.detail)==null?void 0:ye.tab,ge=oe.map(ve=>ve.k);he&&ge.includes(he)&&pe(he)};return window.addEventListener("terminal:setTab",fe),()=>window.removeEventListener("terminal:setTab",fe)},[oe]);const G=fe=>{pe(fe)},V=(I||"no-wallet").toLowerCase();let ee;re==="balances"?ee=i.jsx(_pn,{walletAddress:I}):re==="positions"?ee=i.jsx(Rpn,{walletAddress:I,coin:f}):re==="open"?ee=i.jsx(Gpn,{walletAddress:I}):re==="twap"?ee=i.jsx(nmn,{walletAddress:I}):re==="trades"?ee=i.jsx(pmn,{walletAddress:I}):re==="funding"?ee=i.jsx(vmn,{walletAddress:I}):re==="orders"?ee=i.jsx(Nmn,{walletAddress:I}):re==="bots"?ee=i.jsx(IO,{walletAddress:I,sourceMarket:x}):re==="all"?ee=i.jsx(upn,{data:t,loading:n,error:r,isDigits:s,period:a,periods:o,handlePeriodChange:l}):ee=i.jsx("div",{className:"h-full"});const ae=re==="all"?ee:ne(ee,re);return i.jsx(apn,{children:i.jsxs("div",{className:`bg-[#101010] rounded-2xl flex flex-col h-full ${u} overflow-hidden ${c}`,children:[i.jsx("div",{className:"px-3",children:i.jsxs("div",{className:"relative flex overflow-x-auto whitespace-nowrap pt-2 -mb-3",children:[oe.map(fe=>{const Ne=re===fe.k;return i.jsxs("button",{onClick:()=>G(fe.k),className:`relative cursor-pointer font-inter text-[13px] font-normal leading-[16px] px-2 py-[6px] flex items-center justify-center gap-[10px] text-xs rounded-lg bg-transparent ${Ne?"text-white":"text-[#929292] hover:text-white"}`,children:[Ne&&i.jsx("span",{className:"absolute inset-0 rounded-lg bg-[#262626]"}),i.jsx("span",{className:"relative z-10",children:fe.t})]},fe.k)}),i.jsx("div",{className:"absolute right-3 top-2 hidden md:flex items-center gap-3",children:re==="balances"?i.jsx(Pmn,{}):i.jsx(opn,{})})]})}),i.jsx("div",{className:"flex-1 min-h-0 relative",children:i.jsx("div",{className:"absolute inset-0",children:ae})})]})},V)}function jue(){const[e,t]=m.useState([]),n=["XAG","XAU","USDKRW","USDJPY","USDCAD","USDCHF","NZDUSD","AUDUSD","GBPUSD","EURUSD","HOOD"];return m.useEffect(()=>{let r=!1,s=!1;async function a(){if(!s){s=!0;try{const c=await(await fetch("https://mainnet.zklighter.elliot.ai/api/v1/orderBookDetails")).json(),u=((c==null?void 0:c.order_book_details)||[]).filter(d=>!n.includes(d.symbol)).map(d=>{const f=Number(d.last_trade_price??0),x=Number(d.daily_price_low??0),g=Number(d.daily_price_high??0),v=Number(d.daily_price_change??0),w=Number(d.daily_quote_token_volume??0),C=Number(d.open_interest??0),N=f>0?C*f:null;return{symbol:d.symbol,last:f,chg24:v,vol:w,funding:null,openInterest:N,marketId:d.market_id,priceDecimals:d.supported_price_decimals??d.price_decimals??6,sizeDecimals:d.supported_size_decimals??d.size_decimals??0,minBaseAmount:Number(d.min_base_amount??0),minQuoteAmount:Number(d.min_quote_amount??0),raw:d}});r||t(u)}catch{r||t([])}s=!1}}a();const o=setInterval(a,5e3);return()=>{r=!0,clearInterval(o),s=!1}},[]),e}const Omn="https://dextrabothypev2.nftinit.io/api/hyper/get_farming_coins/?app=extended",Mmn="https://dextrabothypesocketv2.nftinit.io/",Rmn='J5a5j28NeLpQbf"=h',Lmn=6e4,Dmn=e=>{if(e==null||e==="")return null;const t=Number(e);return Number.isFinite(t)?t:null},Jx=(...e)=>{for(const t of e){const n=Dmn(t);if(n!=null)return n}return null},YHe=e=>String(e||"").trim().toUpperCase(),Bmn=e=>YHe(e).replace(/-USD$/,"").replace(/\/USD$/,"");function $mn(e,t){var N;if(!e||typeof e!="object")return null;const n=YHe(e.value||e.symbol||e.market||e.coin||e.label),r=Bmn(e.label||e.assetName||e.uiName||n);if(!n&&!r)return null;const s=e.marketStats||{},a=Jx(s.lastPrice,s.markPrice,s.indexPrice,e.lastPrice,e.markPrice,e.last),o=Jx(s.markPrice,e.markPrice,s.lastPrice,e.lastPrice,a),l=Jx(e.volume,s.dailyVolume,e.vol),c=Jx(s.fundingRate,e.fundingRate,e.funding),u=Jx(s.openInterestBase,e.openInterestBase),d=Jx(s.openInterest,e.openInterestUsd,e.openInterest),f=Jx((N=e==null?void 0:e.tradingConfig)==null?void 0:N.maxLeverage,e.maxLeverage,e.leverage,e.max_leverage);let x=null;const g=Jx(s.dailyPriceChange,e.dailyPriceChange);if(g!=null&&a!=null){const P=a-g;P&&(x=g/P*100)}if(x==null){const P=Jx(s.dailyPriceChangePercentage,e.dailyPriceChangePercentage,e.change24hPct,e.chg24);P!=null&&(x=Math.abs(P)<=1?P*100:P)}const v=r||n,w=Number.isFinite(x)?x:null,C=e.market_index??e.marketIndex??e.marketId??e.market_id??e.idx??e.id??t??null;return{...e,symbol:v,coin:v,rawSymbol:n||v,last:a,lastPrice:a,markPrice:o,change24hPct:w,chg24:w,volume:l,vol:l,fundingRate:c,funding:c,openInterest:u??d,openInterestUsd:d??(u!=null&&a!=null?u*a:null),leverage:f,maxLeverage:f??e.maxLeverage,marketStats:s,source:"extended",market_index:C,marketIndex:C,marketId:C,market_id:C,_idx:t}}const Gd={rows:[],subs:new Set,started:!1,socket:null,timer:null};function Umn(){for(const e of Gd.subs)try{e(Gd.rows)}catch{}}function XHe(e){var t,n,r;return e?Array.isArray(e)?e:Array.isArray(e==null?void 0:e.data)?e.data:Array.isArray((t=e==null?void 0:e.data)==null?void 0:t.data)?e.data.data:Array.isArray(e==null?void 0:e.coins)?e.coins:Array.isArray((n=e==null?void 0:e.data)==null?void 0:n.coins)?e.data.coins:Array.isArray(e==null?void 0:e.markets)?e.markets:Array.isArray((r=e==null?void 0:e.data)==null?void 0:r.markets)?e.data.markets:e!=null&&e.marketStats||e!=null&&e.tradingConfig||e!=null&&e.value||e!=null&&e.symbol||e!=null&&e.label?[e]:[]:[]}function QHe(e){const t=e.map((n,r)=>$mn(n,r)).filter(n=>n&&n.symbol);return t.length?(Gd.rows=t,Umn(),!0):!1}function kSe(e){const t=XHe(e);return t.length?QHe(t):!1}async function TSe(){try{const t=await(await fetch(Omn)).json(),n=XHe(t);if(!n.length)return;QHe(n)}catch{}}function zmn(){if(!Gd.started){Gd.started=!0,TSe(),Gd.timer=setInterval(()=>{Gd.socket&&Gd.socket.connected||TSe()},Lmn);try{const e=Ny(Mmn);Gd.socket=e;const t=()=>{try{e.emit("extended_feed_subscribe",{password:Rmn},r=>kSe(r))}catch{}};e.on("connect",t),e.io.on("reconnect",t);const n=new Set(["connect","disconnect","connect_error","reconnect_attempt","reconnect_error"]);e.onAny((r,...s)=>{if(!(!s.length||n.has(r))){for(const a of s)if(kSe(a))return}})}catch{}}}function Eue(){const[e,t]=m.useState(Gd.rows);return m.useEffect(()=>{zmn();const n=r=>t(r);return Gd.subs.add(n),Gd.rows.length&&t(Gd.rows),()=>{Gd.subs.delete(n)}},[]),e}const Hmn=["arithmetic","geometric"];function Vmn(e,t,n,r){const s=Number(e),a=Number(t),o=Number(n);if(!Number.isFinite(s)||!Number.isFinite(a)||!Number.isFinite(o))return[];if(o<2||a<=s)return[];if(r==="geometric"){const c=Math.pow(a/s,1/(o-1));return Array.from({length:o},(u,d)=>s*Math.pow(c,d))}const l=(a-s)/(o-1);return Array.from({length:o},(c,u)=>s+l*u)}function ISe({entry:e,side:t,notionalUSD:n,maintenanceFrac:r,marginMode:s,accountValueUSD:a,isolatedMarginUSD:o}){const l=Number(e)||0,c=Math.abs(Number(n)||0);if(!l||!c)return null;const u=t==="buy"?1:-1,d=Math.max(0,Number(r)||0),f=c/l,x=c*d;let g;s==="Cross"?g=a-x:g=o-x;const v=1-d*u;if(!f||!isFinite(v))return null;const w=l-u*(g/f)/v;return Math.max(0,w)}function PSe({coin:e,midPrice:t,selectedPrice:n,wallet:r,onLevelsChange:s}){const a=jue(),[o]=m.useState("short"),[l,c]=m.useState(""),[u,d]=m.useState(""),[f,x]=m.useState(2),[g,v]=m.useState("2"),[w,C]=m.useState(""),[N,P]=m.useState("arithmetic"),[I,R]=m.useState(""),[F,U]=m.useState(0),[L,z]=m.useState(10),[Q,ne]=m.useState(!1),[J,X]=m.useState(!1),[re,pe]=m.useState(!1),[Y,ie]=m.useState(50),[oe,G]=m.useState([]),[V,ee]=m.useState(!1),[ae,fe]=m.useState(0),[Ne,he]=m.useState(!1),[ge,ye]=m.useState(!1),[ve,je]=m.useState(0),[Ie,Le]=m.useState(!1),[Qe,$e]=m.useState(0),[it,tt]=m.useState(!1),[lt,ft]=m.useState(!0),[ut,qt]=m.useState(!1),[It,nn]=m.useState(()=>r&&r.id&&r.address?{id:r.id,address:r.address}:{id:null,address:null}),jt=m.useRef(!1),{refreshBotSlots:cn,botSlotsInfo:un}=m.useContext(Qr),Ft=m.useCallback(async()=>{try{const k=window.localStorage.getItem("hyperToken"),T=window.localStorage.getItem("hyperAddress");if(!k||!T){ft(!1),qt(!0);return}const B=await Ei(T.toLowerCase(),k);ft(!!(B!=null&&B.farming_tools))}catch{ft(!1)}finally{qt(!0)}},[]);m.useEffect(()=>{cn==null||cn(),Ft()},[cn,Ft]);const Ke=m.useMemo(()=>{const k=Array.isArray(un)?un:[],T=k.find(B=>String((B==null?void 0:B.bot_type)||"").toLowerCase()==="grid_bot"&&String((B==null?void 0:B.source_market)||"").toLowerCase()==="lighter");return T||k.find(B=>String((B==null?void 0:B.bot_type)||"").toLowerCase()==="grid_bot")},[un]),Bt=Number((Ke==null?void 0:Ke.total_slot_count)||0),$t=Number((Ke==null?void 0:Ke.using_extra_slot_count)||0)+Number((Ke==null?void 0:Ke.using_subs_slot_count)||0),qe=Bt+$t,Ye=Ke?Bt<=0:!1,ht=Ye;m.useEffect(()=>{r&&r.id&&r.address&&nn(k=>k.id===r.id&&k.address&&k.address.toLowerCase()===r.address.toLowerCase()?k:{id:r.id,address:r.address})},[r==null?void 0:r.id,r==null?void 0:r.address]);const Zt=m.useMemo(()=>a.find(k=>k.symbol===e),[a,e]),zt=Zt&&Zt.raw&&Zt.raw.last_trade_price!=null&&Number(Zt.raw.last_trade_price)||0;m.useEffect(()=>{let k=!1;async function T(){try{const q=await(await fetch("https://dextrabothypev2.nftinit.io/api/hyper/get_farming_coins/?app=lighter_fr")).json().catch(()=>null);if(!q||k)return;const te=Array.isArray(q)&&q||Array.isArray(q.data)&&q.data||Array.isArray(q.coins)&&q.coins||[],ue=String(e||"").toUpperCase(),de=te.find(Se=>String(Se.value||Se.label||Se.symbol||Se.coin||"").toUpperCase()===ue),xe=de&&de.maxLeverage!=null?Number(de.maxLeverage):null;!k&&xe!=null&&Number.isFinite(xe)&&xe>0&&(ie(xe),z(Se=>{const ke=Number(Se)||1;return Math.min(xe,Math.max(1,ke))}))}catch{if(k)return}}return e&&T(),()=>{k=!0}},[e]),m.useEffect(()=>{let k=!1;async function T(){if(typeof window>"u")return;const B=window.localStorage.getItem("hyperAddress"),q=window.localStorage.getItem("hyperToken");if(!B||!q){k||G([]);return}ee(!0);try{const ue=await(await fetch("https://dextrabothypev2.nftinit.io/api/wallet/list-lighter",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({address:B,token:q})})).json().catch(()=>null);if(!ue||k)return;let de=[];Array.isArray(ue)?de=ue:Array.isArray(ue.data)?de=ue.data:ue&&ue.wallet_id!=null&&(de=[ue]);const xe=await Promise.all(de.map(async Se=>{let ke=null;if(Se.available_balance!=null){const Re=Number(Se.available_balance);Number.isFinite(Re)&&(ke=Re)}else if(Se.balance!=null){const Re=Number(Se.balance);Number.isFinite(Re)&&(ke=Re)}try{if(Se.wallet_address){const Ge=await(await fetch(`https://mainnet.zklighter.elliot.ai/api/v1/account?by=l1_address&value=${encodeURIComponent(jc(Se.wallet_address))}`)).json().catch(()=>null),Fe=Ge&&Array.isArray(Ge.accounts)&&Ge.accounts.length>0&&Ge.accounts[0];if(Fe&&Fe.available_balance!=null){const st=Number(Fe.available_balance);Number.isFinite(st)&&(ke=st)}}}catch{}return{wallet_id:Se.wallet_id,wallet_address:Se.wallet_address,wallet_name:Se.wallet_name||`Wallet ${Se.wallet_id}`,available_balance:ke}}));if(k)return;G(xe),nn(Se=>{if(Se&&Se.id)return Se;const ke=xe[0];return ke?{id:ke.wallet_id,address:ke.wallet_address}:Se})}catch{k||G([])}finally{k||ee(!1)}}return T(),()=>{k=!0}},[]);const Et=m.useMemo(()=>{if(!It||!It.id)return null;const k=oe.find(B=>String(B.wallet_id)===String(It.id));if(!k||k.available_balance==null)return null;const T=Number(k.available_balance);return Number.isFinite(T)?T:null},[oe,It]),nt=(k,T,B)=>{const q=typeof B=="boolean"?B:!0;if(k.priceRange&&k.priceRange.lower!=null&&k.priceRange.upper!=null&&Number.isFinite(Number(k.priceRange.lower))&&Number.isFinite(Number(k.priceRange.upper))&&(c(String(k.priceRange.lower)),d(String(k.priceRange.upper))),k.gridCount&&Number.isFinite(Number(k.gridCount))){const te=Number(k.gridCount);x(te),v(String(te))}if((k.gridType==="geometric"||k.gridType==="arithmetic")&&P(k.gridType),k.investment&&k.investment.leverage!=null&&Number.isFinite(Number(k.investment.leverage))){const te=Number(k.investment.leverage);z(te)}if(k.investment&&k.investment.collateral!=null&&Number.isFinite(Number(k.investment.collateral))){const te=Number(k.investment.collateral);if(R(String(te)),T&&T>0&&te>0){const ue=te/T*100;U(Math.max(0,Math.min(100,ue)))}else U(0)}else R(""),U(0);ne(q)};m.useEffect(()=>{if(typeof window>"u")return;if(!e||!(It!=null&&It.id)||!(It!=null&&It.address)){ne(!1);return}let k=!1;function T(){c(""),d(""),x(2),v("2"),P("arithmetic"),R(""),U(0),z(10),C("")}async function B(){X(!0);try{const q=window.localStorage.getItem("hyperToken");if(!q){k||(ne(!1),T(),X(!1));return}const te={address:localStorage.getItem("hyperAddress"),token:q,wallet_id:Number(It.id),source_market:"lighter",coin:String(e||"").toUpperCase()},de=await(await fetch("https://dextrabothypev2.nftinit.io/api/hyper/gridbot/info/",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(te)})).json().catch(()=>null);if(k)return;if(jt.current){jt.current=!1,X(!1);return}const xe=de&&de.data?de.data:de;xe&&typeof xe=="object"&&xe.is_deleted===!1&&xe.bot_params&&xe.bot_params?nt(xe.bot_params,Et,!0):(ne(!1),T())}catch{if(k)return;ne(!1),c(""),d(""),x(2),v("2"),P("arithmetic"),R(""),U(0),z(10),C("")}finally{k||X(!1)}}return B(),()=>{k=!0}},[e,It==null?void 0:It.id,It==null?void 0:It.address,ve]);const Ue=m.useMemo(()=>Vmn(l,u,f,N),[l,u,f,N]),Rt=m.useMemo(()=>{if(!Ue.length)return[];const k=Number(l),T=Number(u),B=Number.isFinite(k)&&Number.isFinite(T)?(k+T)/2:null;return Ue.map(q=>({price:q,side:B==null?null:q>=B?"sell":"buy"}))},[Ue,l,u]);m.useEffect(()=>{typeof s=="function"&&s(Rt)},[Rt,s]);const We=k=>{const T=Number(k);if(!(T>0))return;const q=T*.01;c((T-q).toFixed(2)),d((T+q).toFixed(2))};m.useEffect(()=>{const k=T=>{const B=T&&T.detail&&T.detail.sourceMarket;B&&B!=="lighter"||je(q=>q+1)};return window.addEventListener("gridbotUpdated",k),()=>{window.removeEventListener("gridbotUpdated",k)}},[]),m.useEffect(()=>{const k=T=>{const B=T&&T.detail;if(!B)return;const q=B.sourceMarket||B.source_market;if(q&&q!=="lighter"||String(B.coin||"").toUpperCase()!==String(e||"").toUpperCase())return;const ue=B.botParams||{};if(jt.current=!0,nt(ue,Et,B.isActive),B.isActive===!0?ne(!0):B.isActive===!1&&ne(!1),B.walletId&&oe&&oe.length){const de=oe.find(xe=>String(xe.wallet_id)===String(B.walletId));de&&nn({id:de.wallet_id,address:de.wallet_address})}};return window.addEventListener("gridbotSelectFromTasks",k),()=>{window.removeEventListener("gridbotSelectFromTasks",k)}},[e,oe]),m.useEffect(()=>{if(typeof window>"u")return;const k=window.localStorage.getItem("gridbot:pending_selection");if(!k)return;let T=null;try{T=JSON.parse(k)}catch{T=null}if(!(!T||T.sourceMarket&&T.sourceMarket!=="lighter"||String(T.coin||"").toUpperCase()!==String(e||"").toUpperCase())){if(jt.current=!0,nt(T.botParams||{},Et,T.isActive),T.isActive===!0?ne(!0):T.isActive===!1&&ne(!1),T.walletId&&oe&&oe.length){const B=oe.find(q=>String(q.wallet_id)===String(T.walletId));B&&nn({id:B.wallet_id,address:B.wallet_address})}try{window.localStorage.removeItem("gridbot:pending_selection")}catch{}}},[e,oe,Et]),m.useEffect(()=>{if(l||u)return;const k=zt>0?zt:Number(t||n||0);!Number.isFinite(k)||k<=0||We(k)},[zt,t,n,l,u]);const at=m.useMemo(()=>{if(zt>0)return zt;const k=Number(t||0);if(k>0)return k;const T=Number(n||0);if(T>0)return T;const B=Number(l),q=Number(u);return Number.isFinite(B)&&Number.isFinite(q)&&q>B?(B+q)/2:0},[zt,t,n,l,u]),mt=at,Dt=m.useMemo(()=>{const k=Math.max(1,Number(L)||1);return Math.min(Y,k)},[L,Y]),Tt=Number(I)||0,dn=Tt*Dt,on=Ue.length,gn=at>0?at:zt,Nn=gn>0&&on>0&&dn>0?Number((dn/on/gn).toFixed(5)):0,kn=Number.isFinite(Zt==null?void 0:Zt.sizeDecimals)?Zt.sizeDecimals:4,yn=Number.isFinite(Zt==null?void 0:Zt.priceDecimals)?Zt.priceDecimals:4,Vn=yn,Gn=(Zt==null?void 0:Zt.minBaseAmount)??0,Dn=(Zt==null?void 0:Zt.minQuoteAmount)??0,Kn=Nn>0?Number(Nn.toFixed(kn)):0,Cn=Kn>0&&Gn>0&&Kn<Gn,sn=Kn>0&&Dn>0&&Ue.length>0&&Ue.some(k=>k*Kn<Dn),Me=at>0&&dn>0&&Tt>0?ISe({entry:at,side:"buy",notionalUSD:dn,maintenanceFrac:.01,marginMode:"Cross",accountValueUSD:Tt,isolatedMarginUSD:Tt}):null,en=at>0&&dn>0&&Tt>0?ISe({entry:at,side:"sell",notionalUSD:dn,maintenanceFrac:.01,marginMode:"Cross",accountValueUSD:Tt,isolatedMarginUSD:Tt}):null,an=m.useMemo(()=>{if(!l&&!u)return"";const k=Number(l),T=Number(u);if(!Number.isFinite(k)||!Number.isFinite(T))return"";if(!(T>k))return"Upper price must be greater than lower price.";if(mt>0){if(k>mt)return`Lower price cannot be above mark price (${mt.toFixed(yn)}).`;if(T<mt)return`Upper price cannot be below mark price (${mt.toFixed(yn)}).`}return""},[l,u,mt,yn]),Nt=m.useMemo(()=>{const k=Number(l),T=Number(u);return!(!Number.isFinite(k)||!Number.isFinite(T)||!(T>k)||mt>0&&(k>mt||T<mt))},[l,u,mt]),Yn=on>1&&Nt&&Tt>0&&Dt>0&&(It==null?void 0:It.id)&&(It==null?void 0:It.address),xn=ae>0,Mt=!!w,tn=Cn||sn,In=ut&&!lt,Xn=Yn&&!J&&!re&&!V&&!xn&&!Mt&&!tn&&!Ye&&!In,or=re||J||V||Mt?!1:Q||In?!0:tn||xn||Ye?!1:Yn,lr=re||J||V?!0:Q||In?!1:tn||xn||Ye||Mt?!0:!Yn,Qt=Q||re||J,zn=Y&&Y>0;m.useEffect(()=>{if(!ae)return;const k=setInterval(()=>{fe(T=>T>1?T-1:0)},1e3);return()=>clearInterval(k)},[ae]);const Jn=()=>{if(Qt)return;const k=zt>0?zt:at>0?at:Number(t||n||0);!Number.isFinite(k)||k<=0||We(k)},Lt=k=>{if(Qt)return;const T=Math.max(0,Math.min(100,Number(k)||0));if(U(T),!Et||Et<=0){T===0&&R("");return}const B=Et*T/100;R(B&&Number.isFinite(B)?String(B.toFixed(2)):"")},jn=k=>{if(Qt)return;R(k);const T=Number(k);if(!Et||!Number.isFinite(T)||T<=0||Et<=0){U(0);return}const B=T/Et*100;U(Math.max(0,Math.min(100,B)))},Ee=async()=>{if(!Xn||typeof window>"u"||!(It!=null&&It.address)||!(It!=null&&It.id))return;const k=Ue.filter(ke=>Number.isFinite(ke));if(k.length<2)return;const T=k[0],B=k[k.length-1],q=(T+B)/2,te=k.length,ue=window.localStorage.getItem("hyperToken");if(!ue)return;const de=Kn,xe={symbol:String(e||"").toUpperCase(),gridType:N==="geometric"?"geometric":"arithmetic",direction:o,priceRange:{lower:Number(T.toFixed(Vn)),upper:Number(B.toFixed(Vn)),middle:Number(q.toFixed(Vn))},gridCount:te,gridPrices:k.map(ke=>Number(ke.toFixed(Vn))),investment:{collateral:Tt,leverage:Dt,totalInvestment:dn,qtyPerOrder:de},liquidationPrices:{long:Me?Number(Me.toFixed(2)):null,short:en?Number(en.toFixed(2)):null},marginMode:"Cross",currentPrice:at||null,timestamp:new Date().toISOString()},Se={address:localStorage.getItem("hyperAddress"),token:ue,wallet_id:Number(It.id),source_market:"lighter",bot_params:xe,coin:String(e||"").toUpperCase()};pe(!0);try{const Re=await(await fetch("https://dextrabothypev2.nftinit.io/api/hyper/gridbot/save/",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Se)})).json().catch(()=>null);if(!(Re&&(Re.success===!0||Re.status==="ok"||Re.status==="success"))){const Fe=Re&&(Re.error_message||Re.message||Re.detail)||"Grid bot failed to start.";rn.error(Fe);return}ne(!0),typeof window<"u"&&window.dispatchEvent(new CustomEvent("gridbotUpdated",{detail:{sourceMarket:"lighter"}})),cn==null||cn(),rn.success("Grid bot started.")}catch{rn.error("An error occurred while starting the grid bot.")}finally{pe(!1)}},h=async()=>{if(typeof window>"u"||!(It!=null&&It.address)||!(It!=null&&It.id))return;const k=window.localStorage.getItem("hyperToken");if(!k)return;const T={address:localStorage.getItem("hyperAddress"),token:k,wallet_id:Number(It.id),source_market:"lighter",coin:String(e||"").toUpperCase()};pe(!0);try{const q=await(await fetch("https://dextrabothypev2.nftinit.io/api/hyper/gridbot/stop/",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(T)})).json().catch(()=>null);if(!(q&&(q.success===!0||q.status==="ok"||q.status==="success"))){const ue=q&&(q.error_message||q.message||q.detail)||"Grid bot could not be stopped.";rn.error(ue);return}ne(!1),fe(10),typeof window<"u"&&window.dispatchEvent(new CustomEvent("gridbotUpdated",{detail:{sourceMarket:"lighter"}})),cn==null||cn(),rn.success("Grid bot has been stopped.")}catch{rn.error("An error occurred while stopping the grid bot.")}finally{pe(!1)}},p=()=>{if(In){tt(!0);return}or&&(Q?h():ye(!0))},S=async()=>{Xn&&(ye(!1),await Ee())},_=In?"Subscribe / 0.12 ETH":re?Q?"Stopping...":"Starting...":Q?"Stop":xn?`Stopping ${ae}s`:"Start";return i.jsxs(i.Fragment,{children:[it&&i.jsx(eze,{open:it,setOpen:tt,checkAccountCopy:Ft,roleType:"farming"}),Ie&&i.jsx(m5,{open:Ie,setOpen:Le,oldSlotCount:Qe,checkAccountLighter:cn,product:"grid_bot"}),i.jsxs("div",{className:"h-full w-full flex flex-col text-[13px]",children:[i.jsx("div",{className:"px-3 pb-2 flex items-center justify-between border-b border-[#292929]"}),i.jsxs("div",{className:"flex-1 overflow-y-auto px-3 pb-3 space-y-4 mt-2",children:[i.jsxs("section",{className:"space-y-1",children:[i.jsx("span",{className:"text-xs text-white/70",children:"Lighter Wallet"}),i.jsx(yT,{wallets:oe,value:It&&It.id?String(It.id):"",onChange:k=>{const T=oe.find(B=>String(B.wallet_id)===String(k));T&&nn({id:T.wallet_id,address:T.wallet_address})},selectedBalance:Et,mode:"lighter"})]}),i.jsxs("section",{className:"space-y-2",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{className:"flex items-center gap-2 text-[12px] text-[#7C7C7C] font-semibold",children:[i.jsx(s5,{className:"w-4 h-4 text-[#67FFBD]"}),i.jsx("span",{children:"Slot"})]}),i.jsx("div",{className:"flex items-center gap-1 text-[#67FFBD] text-[12px] font-semibold",children:i.jsx("span",{children:qe?`${$t}/${qe}`:Ke?"0/0":"--"})})]}),i.jsxs("div",{className:"flex items-center justify-between gap-2",children:[i.jsx("div",{className:"text-[11px] text-[#7C7C7C]",children:Ye?"No slots left. Get more to start new grid bots.":""}),ht&&i.jsx("button",{type:"button",onClick:()=>{$e(Bt),Le(!0)},className:"flex items-center justify-center h-8 px-3 sm:px-5 rounded-[10px] text-[11px] sm:text-[13px] border bg-[#7446FF] border-[#8861FF] hover:bg-[#5834C3] cursor-pointer min-w-max font-semibold",children:"Get more slots"})]})]}),i.jsxs("section",{className:"space-y-1",children:[i.jsxs("div",{className:"flex items-center justify-between mt-2",children:[i.jsx("span",{className:"text-xs text-white/70",children:"Price Range"}),i.jsx("button",{type:"button",onClick:Jn,disabled:Qt,className:"text-[11px] px-2 py-0.5 rounded-md bg-[#161616] border border-[#292929] text-white/60 hover:text-white disabled:opacity-60 disabled:cursor-not-allowed",children:"Autofill"})]}),i.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[i.jsxs("div",{className:"flex flex-col gap-1",children:[i.jsx("span",{className:"text-[11px] text:white/40 text-white/40",children:"Lower"}),i.jsx("div",{className:"bg-[#161616] border border-[#292929] rounded-lg px-2 py-1.5 flex items-center",children:i.jsx("input",{value:l,onChange:k=>{Qt||c(k.target.value)},className:"bg-transparent outline-none flex-1 text-[13px]",placeholder:"0",inputMode:"decimal",disabled:Qt})})]}),i.jsxs("div",{className:"flex flex-col gap-1",children:[i.jsx("span",{className:"text-[11px] text-white/40",children:"Upper"}),i.jsx("div",{className:"bg-[#161616] border border-[#292929] rounded-lg px-2 py-1.5 flex items-center",children:i.jsx("input",{value:u,onChange:k=>{Qt||d(k.target.value)},className:"bg-transparent outline-none flex-1 text-[13px]",placeholder:"0",inputMode:"decimal",disabled:Qt})})]})]}),mt>0&&i.jsxs("div",{className:"text-[11px] text:white/40 text-white/40",children:["Mark Price: ",mt.toFixed(yn)]}),an&&i.jsx("div",{className:"text-[11px] text-[#FF7173]",children:an})]}),i.jsxs("section",{className:"space-y-1",children:[i.jsx("div",{className:"flex items-center justify-between",children:i.jsx("span",{className:"text-xs text-white/70",children:"Number of Grids (max 36, even only)"})}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("div",{className:"bg-[#161616] border border-[#292929] rounded-lg px-2 py-1.5 flex-1 flex items-center",children:i.jsx("input",{value:g,onChange:k=>{if(Qt)return;const T=k.target.value.replace(/[^\d]/g,"");if(v(T),C(""),T==="")return;const B=Number(T);if(Number.isFinite(B)){if(B<2){C("The minimum number of grids must be 2.");return}if(B>36){C("The maximum number of grids can be 36.");return}if(B%2!==0){C("The number of grids must be even.");return}x(B)}},className:"bg-transparent outline-none flex-1 text-[13px]",inputMode:"numeric",disabled:Qt})}),i.jsx("div",{className:"relative",children:i.jsx("select",{value:N,onChange:k=>{Qt||P(k.target.value)},className:"bg-[#161616] border border-[#292929] rounded-lg px-2 py-1.5 text-[12px] outline-none",disabled:Qt,children:Hmn.map(k=>i.jsx("option",{value:k,className:"bg-[#101010]",children:k[0].toUpperCase()+k.slice(1)},k))})})]}),i.jsxs("div",{className:"text-[11px] text-white/40",children:[w&&i.jsx("div",{className:"text-[11px] text-[#FF7173] mt-1",children:w}),"Step:"," ",Ue.length>1?(Ue[1]-Ue[0]).toFixed(Vn):"--"]})]}),i.jsxs("section",{className:"space-y-1",children:[i.jsx("span",{className:"text-xs text-white/70",children:"Investment"}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsxs("div",{className:"bg-[#161616] border border-[#292929] rounded-lg px-2 py-1.5 flex-1 flex items-center",children:[i.jsx("input",{value:I,onChange:k=>jn(k.target.value),className:"bg-transparent outline-none flex-1 text-[13px]",placeholder:"USDC",inputMode:"decimal",disabled:Qt}),i.jsx("span",{className:"text-[11px] text-white/40 ml-1",children:"USDC"})]}),i.jsx("div",{className:"flex flex-col gap-1 w-[120px]",children:i.jsx(y4,{onClick:zn&&!Qt?()=>he(!0):void 0,children:zn?`${Dt}x`:"--"})})]}),i.jsxs("div",{className:"flex items-center gap-3 mt-3 pb-6",children:[i.jsx(XN,{value:F,onChange:k=>Lt(k),accent:"#67FFBD"}),i.jsxs("div",{className:"h-[30px] rounded-lg flex items-center px-2",style:{width:84,background:Io,border:`1px solid ${Oa}`},children:[i.jsx("input",{className:"w-full bg-transparent outline-none text-right text-xs",inputMode:"numeric",value:F,onChange:k=>Lt(Math.max(0,Math.min(100,Number(k.target.value)||0))),style:{color:Li,fontFeatureSettings:'"tnum"'},disabled:Qt}),i.jsx("span",{style:{color:yi},className:"ml-1",children:"%"})]})]}),i.jsxs("div",{className:"text-[11px] text-white/40 flex justify-between mt-2 border-t border-[#292929] pt-4 font-semibold",children:[i.jsxs("span",{children:["Max ",e,": ",`${Y}x`]}),i.jsxs("span",{children:["Total:"," ",dn>0?`${dn.toFixed(2)} USDC`:"--"]})]}),i.jsxs("div",{className:"text-[11px] text-white/40 flex justify-between font-semibold",children:[i.jsxs("span",{children:["Qty per order:"," ",Kn>0?`${Kn} ${e}`:"--"]}),i.jsx("span",{children:"Margin Mode: Cross"})]})]}),i.jsxs("section",{className:"pt-2 border-t border-[#292929]",children:[i.jsxs("div",{className:"flex items-center justify-between text-[11px] text-white/40 mb-2",children:[i.jsx("span",{children:"Est. Liq Long"}),i.jsx("span",{children:Me?`$${Me.toLocaleString(void 0,{maximumFractionDigits:2})}`:"--"})]}),i.jsxs("div",{className:"flex items-center justify-between text-[11px] text-white/40 mb-3",children:[i.jsx("span",{children:"Est. Liq Short"}),i.jsx("span",{children:en?`$${en.toLocaleString(void 0,{maximumFractionDigits:2})}`:"--"})]}),i.jsx("button",{type:"button",onClick:p,disabled:lr,className:`w-full h-[32px] rounded-xl font-bold text-[13px] flex items-center justify-center transition-opacity ${lr?"bg-[#303030] text-white/40 cursor-not-allowed opacity-70":In?"bg-[#7446FF] text-white hover:bg-[#5834C3]":Q?"bg-[#FF7173] text:black text-black hover:opacity-90":"bg-[#67FFBD] text-black hover:opacity-90"}`,children:_}),Cn&&i.jsxs("div",{className:"mt-2 text-[11px] text-[#FF7173] text-center",children:["Quantity per order is below min size (",Gn," ",e,")."]}),sn&&i.jsxs("div",{className:"mt-2 text-[11px] text-[#FF7173] text-center",children:["Your order size is below minimum order size of $",Dn.toFixed(2),"."]})]})]})]}),i.jsx(Jh,{open:Ne,onClose:()=>he(!1),children:i.jsxs(um,{title:"Adjust Leverage",children:[i.jsxs("div",{className:"text-[12px] leading-5 mb-3",style:{color:yi},children:["Control the leverage used for ",e," grid bot positions. The maximum leverage is ",Y,"x."]}),i.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[i.jsx("input",{type:"range",min:1,max:Y||1,step:1,value:L,onChange:k=>z(Math.max(1,Math.min(Y||1,Number(k.target.value)))),className:"flex-1",style:{accentColor:"#67FFBD"}}),i.jsxs("div",{className:"h-[36px] rounded-lg flex items-center px-2",style:{width:84,background:Io,border:`1px solid ${Oa}`},children:[i.jsx("input",{className:"w-full bg-transparent outline-none text-right text-white",inputMode:"numeric",value:L,onChange:k=>{const T=Number(k.target.value)||1,B=Math.max(1,Math.min(Y||1,T));z(B)}}),i.jsx("span",{className:"text-[11px] text-white/40 ml-1",children:"x"})]})]}),i.jsx(P0,{onClick:()=>he(!1),children:"Confirm"})]})}),i.jsx(Jh,{open:ge,onClose:()=>ye(!1),children:i.jsxs(um,{title:`${e} Lighter Grid Bot`,children:[i.jsxs("div",{className:"flex items-center gap-2 mb-4 text-[10px]",children:[i.jsx("span",{className:"px-2 py-0.5 rounded-full bg-[#151b23] text-[#9CA3AF]",children:"Cross"}),i.jsxs("span",{className:"px-2 py-0.5 rounded-full bg-[#FF71731a] text-[#FF7173]",children:["Leverage ",Dt,"x"]})]}),i.jsxs("div",{className:"grid grid-cols-2 gap-y-2 gap-x-6 text-[12px] mb-4",children:[i.jsxs("div",{children:[i.jsx("div",{className:"text-[11px]",style:{color:yi},children:"Price Range"}),i.jsx("div",{className:"font-medium",style:{color:Li},children:Number.isFinite(Number(l))&&Number.isFinite(Number(u))?`${Number(l).toFixed(Vn)} - ${Number(u).toFixed(Vn)} USDC`:"--"})]}),i.jsxs("div",{children:[i.jsx("div",{className:"text-[11px]",style:{color:yi},children:"Number of Grids"}),i.jsx("div",{className:"font-medium",style:{color:Li},children:on||"--"})]}),i.jsxs("div",{children:[i.jsx("div",{className:"text-[11px]",style:{color:yi},children:"Mode"}),i.jsx("div",{className:"font-medium",style:{color:Li},children:N==="geometric"?"Geometric":"Arithmetic"})]}),i.jsxs("div",{children:[i.jsx("div",{className:"text-[11px]",style:{color:yi},children:"Qty Per Order"}),i.jsx("div",{className:"font-medium",style:{color:Li},children:Kn>0?`${Kn} ${e}`:"--"})]})]}),i.jsx("div",{className:"mt-2 pt-3 border-t border-[#292929]",children:i.jsxs("div",{className:"flex items-center justify-between text-[12px]",children:[i.jsx("span",{className:"font-medium",style:{color:Li},children:"Total Investment"}),i.jsx("span",{className:"font-semibold text-[#67FFBD]",children:dn>0?`${dn.toFixed(2)} USDC`:"--"})]})}),i.jsx("div",{className:"mt-4",children:i.jsx(P0,{onClick:S,disabled:re,children:re?"Starting...":"Confirm"})})]})})]})}const Wmn=["arithmetic","geometric"],qmn=6,ZHe="https://api.hyperliquid.xyz/info",Gmn=10,Kmn=10*60*1e3;let wb={data:null,ts:0,promise:null};async function Ymn(){const e=Date.now();if(wb.data&&e-wb.ts<Kmn)return wb.data;if(wb.promise)return wb.promise;const t=fetch(ZHe,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"allPerpMetas"})}).then(n=>n.json()).then(n=>{const r=Array.isArray(n)?n:[];return wb={data:r,ts:Date.now(),promise:null},r}).catch(n=>{throw wb.promise=null,n});return wb.promise=t,t}function Xmn(e,t,n,r){const s=Number(e),a=Number(t),o=Number(n);if(!Number.isFinite(s)||!Number.isFinite(a)||!Number.isFinite(o))return[];if(o<2||a<=s)return[];if(r==="geometric"){const c=Math.pow(a/s,1/(o-1));return Array.from({length:o},(u,d)=>s*Math.pow(c,d))}const l=(a-s)/(o-1);return Array.from({length:o},(c,u)=>s+l*u)}function FSe({entry:e,side:t,notionalUSD:n,maintenanceFrac:r,marginMode:s,accountValueUSD:a,isolatedMarginUSD:o}){const l=Number(e)||0,c=Math.abs(Number(n)||0);if(!l||!c)return null;const u=t==="buy"?1:-1,d=Math.max(0,Number(r)||0),f=c/l,x=c*d;let g;s==="Cross"?g=a-x:g=o-x;const v=1-d*u;if(!f||!isFinite(v))return null;const w=l-u*(g/f)/v;return Math.max(0,w)}function VX(e){const t=String(e||""),n=t.indexOf(":");return n>0?t.slice(0,n).toLowerCase():"hl"}function Qmn(e){let t=String(e||"").toUpperCase();if(!t)return"";t.endsWith("-PERP")&&(t=t.slice(0,-5));const n=t.indexOf("-USD");return n>0&&(t=t.slice(0,n)),t}function Zmn(e,t,n=6){if(!Number.isFinite(e)||e<=0)return n-(t||0);const r=5,s=Math.max(0,n-(t||0)),a=Math.floor(Math.log10(e))+1,o=Math.max(0,r-a);return Math.min(s,o)}function OSe({coin:e,midPrice:t,selectedPrice:n,wallet:r,onWalletChange:s,onLevelsChange:a}){const o=gU(),[l]=m.useState("short"),[c,u]=m.useState(""),[d,f]=m.useState(""),[x,g]=m.useState(2),[v,w]=m.useState("2"),[C,N]=m.useState(""),[P,I]=m.useState("arithmetic"),[R,F]=m.useState(""),[U,L]=m.useState(0),[z,Q]=m.useState(10),[ne,J]=m.useState(!1),[X,re]=m.useState(!1),[pe,Y]=m.useState(!1),[ie,oe]=m.useState(50),[G,V]=m.useState(0),[ee,ae]=m.useState(!1),[fe,Ne]=m.useState(!1),[he,ge]=m.useState(()=>r&&r.id&&r.address?{id:r.id,address:r.address}:{id:null,address:null}),[ye,ve]=m.useState({address:null,token:null}),[je,Ie]=m.useState(null),[Le,Qe]=m.useState(null),[$e,it]=m.useState(""),[tt,lt]=m.useState(""),[ft,ut]=m.useState(""),[qt,It]=m.useState(""),[nn,jt]=m.useState(!1),[cn,un]=m.useState(!1),[Ft,Ke]=m.useState(!1),[Bt,$t]=m.useState(!1),[qe,Ye]=m.useState(0),ht=()=>{u(""),f(""),g(2),w("2"),I("arithmetic"),F(""),L(0),Q(10),N(""),it(""),lt(""),ut(""),It(""),jt(!1),un(!1),Ke(!1),$t(!1)},{address:Zt,isConnected:zt}=ns();zt&&(typeof window<"u"&&window.localStorage.getItem("hyperToken"));const{wallets:Et,loading:nt}=OHe(ye.address,ye.token,!0,{pollMs:5e3}),Ue=m.useRef(!1),Rt=nt&&(!Et||Et.length===0);m.useEffect(()=>{r&&r.id&&r.address&&ge(ct=>ct.id===r.id&&ct.address&&ct.address.toLowerCase()===r.address.toLowerCase()?ct:{id:r.id,address:r.address})},[r==null?void 0:r.id,r==null?void 0:r.address]),m.useEffect(()=>{const ct=()=>{const gt=typeof window<"u"?window.localStorage.getItem("hyperAddress"):null,Xt=typeof window<"u"?window.localStorage.getItem("hyperToken"):null;ve({address:gt,token:Xt})};return ct(),window.addEventListener("localStorageUpdated",ct),window.addEventListener("storage",ct),()=>{window.removeEventListener("localStorageUpdated",ct),window.removeEventListener("storage",ct)}},[]),m.useEffect(()=>{if(he.id||!Et||!Et.length)return;const ct=Et.find(Xt=>Xt.confirmed)||Et[0];if(!ct)return;const gt={id:ct.wallet_id,address:ct.wallet_address};ge(gt),typeof s=="function"&&s({id:String(gt.id),address:gt.address})},[Et,he.id,s]),m.useEffect(()=>{e&&(ht(),J(!1))},[e]);const We=m.useMemo(()=>o.find(ct=>ct.symbol===e),[o,e]),at=We&&We.raw&&We.raw.last_trade_price!=null&&Number(We.raw.last_trade_price)||0;m.useEffect(()=>{let ct=!1;async function gt(){if(e)try{const wt=await(await fetch(ZHe,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"allPerpMetas"})})).json().catch(()=>null);if(!wt||ct)return;let Xe=null;for(const bt of wt)if(Array.isArray(bt==null?void 0:bt.universe)){for(const kt of bt.universe)if(String(kt.name||"").toUpperCase()===String(e||"").toUpperCase()){Xe=kt;break}}if(!Xe||!Number.isFinite(Xe.maxLeverage))return;const Oe=Number(Xe.maxLeverage);oe(Oe),Q(bt=>Math.min(Oe,Math.max(1,bt)))}catch{}}return gt(),()=>{ct=!0}},[e]),m.useEffect(()=>{let ct=!1;async function gt(){try{const wt=await(await fetch("https://dextrabothypev2.nftinit.io/api/hyper/get_farming_coins/?app=hyper_fr")).json().catch(()=>null);if(!wt||ct)return;const Xe=Array.isArray(wt)&&wt||Array.isArray(wt.data)&&wt.data||Array.isArray(wt.coins)&&wt.coins||[],Oe=String(e||"").toUpperCase(),bt=Xe.find(Ut=>String(Ut.value||Ut.label||Ut.symbol||Ut.coin||"").toUpperCase()===Oe),kt=bt&&bt.maxLeverage!=null?Number(bt.maxLeverage):null;!ct&&kt!=null&&Number.isFinite(kt)&&kt>0&&(oe(kt),Q(Ut=>Math.min(kt,Math.max(1,Number(Ut)||1))))}catch{}}return e&>(),()=>{ct=!0}},[e]);const mt=(he==null?void 0:he.address)||(Zt?Zt.toLowerCase():null),{perpsOverview:Dt}=bT(mt),Tt=m.useMemo(()=>{if(!Dt||Dt.balance==null)return null;const ct=Number(Dt.balance);return Number.isFinite(ct)?ct:null},[Dt]),dn=(ct,gt)=>{var Pn,En,$n,Bn;const Xt=ct.priceRange||{},wt=Array.isArray(ct.gridPrices)?ct.gridPrices:[];let Xe=Xt.lower,Oe=Xt.upper;(!Number.isFinite(Xe)||!Number.isFinite(Oe))&&wt.length>=2&&(Xe=wt[0],Oe=wt[wt.length-1]),Number.isFinite(Xe)?u(String(Xe)):u(""),Number.isFinite(Oe)?f(String(Oe)):f("");let bt=ct.gridCount;Number.isFinite(bt)||wt.length>=2&&(bt=wt.length),Number.isFinite(bt)?(g(bt),w(String(bt))):(g(2),w("2"));let kt=ct.gridType;kt!=="geometric"&&kt!=="arithmetic"&&(kt="arithmetic"),I(kt);const Ut=ct.investment||{};if(Ut&&Ut.leverage!=null&&Number.isFinite(Number(Ut.leverage))&&Q(Number(Ut.leverage)),Ut&&Ut.collateral!=null&&Number.isFinite(Number(Ut.collateral))){const _r=Number(Ut.collateral);if(F(String(_r)),gt&>>0&&_r>0){const sr=_r/gt*100;L(Math.max(0,Math.min(100,sr)))}else L(0)}else F(""),L(0);const fn=ct.trailing_up??((Pn=ct==null?void 0:ct.trailing)==null?void 0:Pn.up),On=ct.trailing_down??((En=ct==null?void 0:ct.trailing)==null?void 0:En.down),Sn=ct.sl_up??(($n=ct==null?void 0:ct.sl)==null?void 0:$n.up),yr=ct.sl_down??((Bn=ct==null?void 0:ct.sl)==null?void 0:Bn.down);it(fn!=null&&Number.isFinite(Number(fn))?String(fn):""),lt(On!=null&&Number.isFinite(Number(On))?String(On):""),ut(Sn!=null&&Number.isFinite(Number(Sn))?String(Sn):""),It(yr!=null&&Number.isFinite(Number(yr))?String(yr):""),jt(fn!=null&&Number.isFinite(Number(fn))),un(On!=null&&Number.isFinite(Number(On))),Ke(Sn!=null&&Number.isFinite(Number(Sn))),$t(yr!=null&&Number.isFinite(Number(yr)))};m.useEffect(()=>{if(typeof window>"u")return;if(!e||!(he!=null&&he.id)||!(he!=null&&he.address)){J(!1),ht();return}let ct=!1;async function gt(){re(!0);try{const Xt=window.localStorage.getItem("hyperToken");if(!Xt){ct||(J(!1),ht(),re(!1));return}const wt={address:window.localStorage.getItem("hyperAddress"),token:Xt,wallet_id:Number(he.id),source_market:"hyper",coin:String(e||"").toUpperCase()},Oe=await(await fetch("https://dextrabothypev2.nftinit.io/api/hyper/gridbot/info/",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(wt)})).json().catch(()=>null);if(ct)return;if(Ue.current){Ue.current=!1,re(!1);return}const bt=Oe&&Oe.data?Oe.data:Oe;bt&&typeof bt=="object"&&bt.is_deleted===!1&&bt.bot_params&&bt.bot_params?(dn(bt.bot_params,Tt),J(!0)):(J(!1),ht(),u(""),f(""))}catch{J(!1),ht(),u(""),f("")}finally{ct||re(!1)}}return gt(),()=>{ct=!0}},[e,he==null?void 0:he.id,he==null?void 0:he.address,qe]),m.useEffect(()=>{if(typeof window>"u")return;const ct=window.localStorage.getItem("gridbot:pending_selection");if(!ct)return;let gt=null;try{gt=JSON.parse(ct)}catch{gt=null}if(!(!gt||gt.sourceMarket&>.sourceMarket!=="hyper"||String(gt.coin||"").toUpperCase()!==String(e||"").toUpperCase())){if(Ue.current=!0,dn(gt.botParams||{},Tt),gt.isActive===!0?J(!0):gt.isActive===!1&&J(!1),gt.walletId&&Et&&Et.length){const Xt=Et.find(wt=>String(wt.wallet_id)===String(gt.walletId));if(Xt){const wt={id:Xt.wallet_id,address:Xt.wallet_address};ge(wt),typeof s=="function"&&s({id:String(wt.id),address:wt.address})}}try{window.localStorage.removeItem("gridbot:pending_selection")}catch{}}},[e,Et,s,Tt]),m.useEffect(()=>{const ct=gt=>{const Xt=gt&>.detail&>.detail.sourceMarket;Xt&&Xt!=="hyper"||Ye(wt=>wt+1)};return window.addEventListener("gridbotUpdated",ct),()=>{window.removeEventListener("gridbotUpdated",ct)}},[]),m.useEffect(()=>{const ct=gt=>{const Xt=gt&>.detail;if(!Xt)return;const wt=Xt.sourceMarket||Xt.source_market;if(wt&&wt!=="hyper"||String(Xt.coin||"").toUpperCase()!==String(e||"").toUpperCase())return;const Oe=Xt.botParams||{};if(dn(Oe,Tt),Ue.current=!0,Xt.isActive===!0?J(!0):Xt.isActive===!1&&J(!1),Xt.walletId&&Et&&Et.length){const bt=Et.find(kt=>String(kt.wallet_id)===String(Xt.walletId));if(bt){const kt={id:bt.wallet_id,address:bt.wallet_address};ge(kt),typeof s=="function"&&s({id:String(kt.id),address:kt.address})}}};return window.addEventListener("gridbotSelectFromTasks",ct),()=>{window.removeEventListener("gridbotSelectFromTasks",ct)}},[e,Et,s]);const on=m.useMemo(()=>Xmn(c,d,x,P),[c,d,x,P]),gn=m.useMemo(()=>{if(!on.length)return[];const ct=Number(c),gt=Number(d),Xt=Number.isFinite(ct)&&Number.isFinite(gt)?(ct+gt)/2:null;return on.map(wt=>({price:wt,side:Xt==null?null:wt>=Xt?"sell":"buy"}))},[on,c,d]);m.useEffect(()=>{typeof a=="function"&&a(gn)},[gn,a]);const Nn=ct=>{const gt=Number(ct);if(!(gt>0))return;const Xt=gt*.01;u((gt-Xt).toFixed(2)),f((gt+Xt).toFixed(2))},kn=m.useMemo(()=>{if(at>0)return at;const ct=Number(t||0);if(ct>0)return ct;const gt=Number(n||0);if(gt>0)return gt;const Xt=Number(c),wt=Number(d);return Number.isFinite(Xt)&&Number.isFinite(wt)&&wt>Xt?(Xt+wt)/2:0},[at,t,n,c,d]);m.useEffect(()=>{let ct=!1;async function gt(){const Xt=Qmn(e);if(!Xt){Ie(null),Qe(null);return}try{const wt=await Ymn();let Xe=null;e:for(const Oe of wt)if(Array.isArray(Oe==null?void 0:Oe.universe)){for(const bt of Oe.universe)if(String((bt==null?void 0:bt.name)||"").toUpperCase()===Xt){const Ut=Number(bt.szDecimals);Number.isFinite(Ut)&&(Xe=Ut);break e}}if(ct)return;Xe!=null?Ie(Xe):(Ie(null),Qe(null))}catch{Ie(null),Qe(null)}}return e?gt():(Ie(null),Qe(null)),()=>{ct=!0}},[e]),m.useEffect(()=>{if(!Number.isFinite(je)){Qe(null);return}const ct=Zmn(kn,je);Qe(ct)},[kn,je]);const yn=kn,Vn=m.useMemo(()=>Math.min(ie,Math.max(1,Number(z)||1)),[z,ie]),Gn=Number(R)||0,Dn=Gn*Vn,Kn=on.length,Cn=kn>0?kn:at,sn=Cn>0&&Kn>0&&Dn>0?Number((Dn/Kn/Cn).toFixed(5)):0,Me=Number.isFinite(je)?je:Number.isFinite(We==null?void 0:We.sizeDecimals)?We.sizeDecimals:4,en=m.useMemo(()=>{if(Number.isFinite(Le))return Le;const ct=Number.isFinite(Me)?Number(Me):4,gt=Math.max(0,qmn-ct),Xt=Math.abs(Number(kn||0));if(!(Xt>0)||!Number.isFinite(Xt))return gt;const wt=Xt>=1?Math.floor(Math.log10(Xt))+1:0,Xe=Math.max(0,5-wt);return Math.min(gt,Xe)},[Le,Me,kn]),an=en,Nt=(We==null?void 0:We.minBaseAmount)??0,Yn=(We==null?void 0:We.minQuoteAmount)??0,xn=sn>0?Number(sn.toFixed(Me)):0,Mt=xn>0&&Nt>0&&xn<Nt,tn=xn>0&&Yn>0&&on.length>0&&on.some(ct=>ct*xn<Yn),In=m.useMemo(()=>{if(xn<=0||on.length===0)return 0;let ct=1/0;for(const gt of on){if(!(gt>0))continue;const Xt=gt*xn;Xt<ct&&(ct=Xt)}return ct===1/0?0:ct},[xn,on]),Xn=xn<=0||In<Gmn,or=kn>0&&Dn>0&&Gn>0?FSe({entry:kn,side:"buy",notionalUSD:Dn,maintenanceFrac:.01,marginMode:"Cross",accountValueUSD:Gn,isolatedMarginUSD:Gn}):null,lr=kn>0&&Dn>0&&Gn>0?FSe({entry:kn,side:"sell",notionalUSD:Dn,maintenanceFrac:.01,marginMode:"Cross",accountValueUSD:Gn,isolatedMarginUSD:Gn}):null,Qt=m.useMemo(()=>{if(!c&&!d)return"";const ct=Number(c),gt=Number(d);if(!Number.isFinite(ct)||!Number.isFinite(gt))return"";if(!(gt>ct))return"Upper price must be greater than lower price.";if(yn>0){if(ct>yn)return`Lower price cannot be above mark price (${yn.toFixed(en)}).`;if(gt<yn)return`Upper price cannot be below mark price (${yn.toFixed(en)}).`}return""},[c,d,yn,en]),zn=m.useMemo(()=>{const ct=Number(c),gt=Number(d);return!(!Number.isFinite(ct)||!Number.isFinite(gt)||!(gt>ct)||yn>0&&(ct>yn||gt<yn))},[c,d,yn]),Jn=Number(c),Lt=Number(d),jn=Number($e),Ee=Number(tt),h=Number(ft),p=Number(qt),S=nn&&($e===""||!Number.isFinite(jn)||!(jn>Lt)),_=cn&&(tt===""||!Number.isFinite(Ee)||!(Ee<Jn));m.useEffect(()=>{nn||it(""),cn||lt("")},[nn,cn]),m.useEffect(()=>{Ft||ut(""),Bt||It("")},[Ft,Bt]);const k=Ft&&(ft===""||!Number.isFinite(h)||!nn&&Number.isFinite(Lt)&&!(h>Lt)||nn&&Number.isFinite(jn)&&!(h>jn)),T=Bt&&(qt===""||!Number.isFinite(p)||!cn&&Number.isFinite(Jn)&&!(p<Jn)||cn&&Number.isFinite(Ee)&&!(p<Ee)),B=Kn>1&&zn&&Gn>0&&Vn>0&&(he==null?void 0:he.id)&&(he==null?void 0:he.address),q=G>0,te=!!C,ue=Mt||tn,de=S||_||k||T,xe=B&&!X&&!pe&&!Rt&&!q&&!te&&!ue&&!Xn&&!de,Se=pe||X||Rt||te||ue||Xn||q||de?!1:ne?!0:B,ke=ne||pe||X||Rt;m.useEffect(()=>{if(!G)return;const ct=setInterval(()=>V(gt=>gt>1?gt-1:0),1e3);return()=>clearInterval(ct)},[G]);const Re=()=>{if(ke)return;const ct=at>0?at:kn>0?kn:Number(t||n||0);!Number.isFinite(ct)||ct<=0||Nn(ct)},Ge=ct=>{if(ke)return;const gt=Math.max(0,Math.min(100,Number(ct)||0));if(L(gt),!Tt||Tt<=0){gt===0&&F("");return}const Xt=Tt*gt/100;F(Xt&&Number.isFinite(Xt)?String(Xt.toFixed(2)):"")},Fe=ct=>{if(ke)return;F(ct);const gt=Number(ct);if(!Tt||!Number.isFinite(gt)||gt<=0||Tt<=0){L(0);return}const Xt=gt/Tt*100;L(Math.max(0,Math.min(100,Xt)))},st=async()=>{if(!xe||typeof window>"u"||!(he!=null&&he.address)||!(he!=null&&he.id))return;const ct=on.filter(On=>Number.isFinite(On));if(ct.length<2)return;const gt=ct[0],Xt=ct[ct.length-1],wt=(gt+Xt)/2,Xe=ct.length,Oe=window.localStorage.getItem("hyperToken");if(!Oe)return;if(nn&&S){rn.error("Trailing Up is invalid.");return}if(cn&&_){rn.error("Trailing Down is invalid.");return}if(Ft&&k){const On=nn?"SL Up must be greater than Trailing Up.":"SL Up must be greater than Upper price.";rn.error(On);return}if(Bt&&T){const On=cn?"SL Down must be less than Trailing Down.":"SL Down must be less than Lower price.";rn.error(On);return}const bt=xn,kt=VX(e),Ut={symbol:String(e||"").toUpperCase(),dex:kt,gridType:P==="geometric"?"geometric":"arithmetic",direction:l,priceRange:{lower:Number(gt.toFixed(an)),upper:Number(Xt.toFixed(an)),middle:Number(wt.toFixed(an))},gridCount:Xe,gridPrices:ct.map(On=>Number(On.toFixed(an))),investment:{collateral:Gn,leverage:Vn,totalInvestment:Dn,qtyPerOrder:bt},liquidationPrices:{long:or?Number(or.toFixed(2)):null,short:lr?Number(lr.toFixed(2)):null},trailing_up:nn&&!S?Number(jn.toFixed(an)):null,trailing_down:cn&&!_?Number(Ee.toFixed(an)):null,sl_up:Ft&&!k?Number(h.toFixed(an)):null,sl_down:Bt&&!T?Number(p.toFixed(an)):null,marginMode:"Cross",currentPrice:kn||null,timestamp:new Date().toISOString()},fn={address:window.localStorage.getItem("hyperAddress"),token:Oe,wallet_id:Number(he.id),source_market:"hyper",...kt?{dex:kt}:{},bot_params:Ut,coin:String(e||"").toUpperCase()};Y(!0);try{const Sn=await(await fetch("https://dextrabothypev2.nftinit.io/api/hyper/gridbot/save/",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(fn)})).json().catch(()=>null);if(!(Sn&&(Sn.success===!0||Sn.status==="ok"||Sn.status==="success"))){const Pn=Sn&&(Sn.error_message||Sn.message||Sn.detail)||"Grid bot failed to start.";rn.error(Pn);return}J(!0),typeof window<"u"&&window.dispatchEvent(new CustomEvent("gridbotUpdated",{detail:{sourceMarket:"hyper"}})),rn.success("Grid bot started.")}catch{rn.error("An error occurred while starting the grid bot.")}finally{Y(!1)}},se=async()=>{if(typeof window>"u"||!(he!=null&&he.address)||!(he!=null&&he.id))return;const ct=window.localStorage.getItem("hyperToken");if(!ct)return;const gt=VX(e),Xt={address:window.localStorage.getItem("hyperAddress"),token:ct,wallet_id:Number(he.id),source_market:"hyper",...gt?{dex:gt}:{},coin:String(e||"").toUpperCase()};Y(!0);try{const Xe=await(await fetch("https://dextrabothypev2.nftinit.io/api/hyper/gridbot/stop/",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Xt)})).json().catch(()=>null);if(!(Xe&&(Xe.success===!0||Xe.status==="ok"||Xe.status==="success"))){const bt=Xe&&(Xe.error_message||Xe.message||Xe.detail)||"Grid bot could not be stopped.";rn.error(bt);return}J(!1),V(10),typeof window<"u"&&window.dispatchEvent(new CustomEvent("gridbotUpdated",{detail:{sourceMarket:"hyper"}})),rn.success("Grid bot has been stopped.")}catch{rn.error("An error occurred while stopping the grid bot.")}finally{Y(!1)}},Ce=()=>{Se&&(ne?se():Ne(!0))},Be=async()=>{xe&&(Ne(!1),await st())},De=pe?ne?"Stopping...":"Starting...":ne?"Stop":q?`Stopping ${G}s`:"Start",_e=["xyz","vntl","flx"].includes(VX(e))?"Isolated":"Cross",Je=!1;return i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"h-full w-full flex flex-col text-[13px]",children:[i.jsx("div",{className:"px-3 pb-2 flex items-center justify-between border-b border-[#292929]"}),i.jsxs("div",{className:"flex-1 overflow-y-auto px-3 pb-3 space-y-4 mt-2",children:[i.jsxs("section",{className:"space-y-1",children:[i.jsx("span",{className:"text-xs text-white/70",children:"Perps Wallet"}),i.jsx(yT,{wallets:Et,value:he&&he.id?String(he.id):"",onChange:ct=>{const gt=(Et||[]).find(Xt=>String(Xt.wallet_id)===String(ct))||null;if(gt){const Xt={id:gt.wallet_id,address:gt.wallet_address};ge(Xt),typeof s=="function"&&s({id:String(Xt.id),address:Xt.address})}},selectedBalance:Tt})]}),i.jsxs("section",{className:"space-y-1",children:[i.jsxs("div",{className:"flex items-center justify-between mt-2",children:[i.jsx("span",{className:"text-xs text-white/70",children:"Price Range"}),i.jsx("button",{type:"button",onClick:Re,disabled:ke,className:"text-[11px] px-2 py-0.5 rounded-md bg-[#161616] border border-[#292929] text-white/60 hover:text-white disabled:opacity-60 disabled:cursor-not-allowed",children:"Autofill"})]}),i.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[i.jsxs("div",{className:"flex flex-col gap-1",children:[i.jsx("span",{className:"text-[11px] text-white/40",children:"Lower"}),i.jsx("div",{className:"bg-[#161616] border border-[#292929] rounded-lg px-2 py-1.5 flex items-center",children:i.jsx("input",{value:c,onChange:ct=>{ke||u(ct.target.value)},className:"bg-transparent outline-none flex-1 text-[13px]",placeholder:"0",inputMode:"decimal",disabled:ke})})]}),i.jsxs("div",{className:"flex flex-col gap-1",children:[i.jsx("span",{className:"text-[11px] text-white/40",children:"Upper"}),i.jsx("div",{className:"bg-[#161616] border border-[#292929] rounded-lg px-2 py-1.5 flex items-center",children:i.jsx("input",{value:d,onChange:ct=>{ke||f(ct.target.value)},className:"bg-transparent outline-none flex-1 text-[13px]",placeholder:"0",inputMode:"decimal",disabled:ke})})]})]}),yn>0&&i.jsxs("div",{className:"text-[11px] text-white/40",children:["Mark Price: ",yn.toFixed(en)]}),Qt&&i.jsx("div",{className:"text-[11px] text-[#FF7173]",children:Qt})]}),i.jsxs("section",{className:"space-y-1",children:[i.jsx("div",{className:"flex items-center justify-between",children:i.jsx("span",{className:"text-xs text-white/70",children:"Number of Grids (Even only)"})}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("div",{className:"bg-[#161616] border border-[#292929] rounded-lg px-2 py-1.5 flex-1 flex items-center",children:i.jsx("input",{value:v,onChange:ct=>{if(ke)return;const gt=ct.target.value.replace(/[^\d]/g,"");if(w(gt),N(""),gt==="")return;const Xt=Number(gt);if(Number.isFinite(Xt)){if(Xt<2){N("The minimum number of grids must be 2.");return}if(Xt>120){N("The maximum number of grids is 120.");return}if(Xt%2!==0){N("The number of grids must be even.");return}g(Xt)}},className:"bg-transparent outline-none flex-1 text-[13px]",inputMode:"numeric",disabled:ke})}),i.jsx("div",{className:"relative",children:i.jsx("select",{value:P,onChange:ct=>{ke||I(ct.target.value)},className:"bg-[#161616] border border-[#292929] rounded-lg px-2 py-1.5 text-[12px] outline-none",disabled:ke,children:Wmn.map(ct=>i.jsx("option",{value:ct,className:"bg-[#101010]",children:ct[0].toUpperCase()+ct.slice(1)},ct))})})]}),i.jsx("div",{className:"text-[11px] text-white/40",children:C&&i.jsx("div",{className:"text-[11px] text-[#FF7173] mt-1",children:C})})]}),Je,i.jsxs("section",{className:"space-y-1",children:[i.jsx("span",{className:"text-xs text-white/70",children:"Investment"}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsxs("div",{className:"bg-[#161616] border border-[#292929] rounded-lg px-2 py-1.5 flex-1 flex items-center",children:[i.jsx("input",{value:R,onChange:ct=>Fe(ct.target.value),className:"bg-transparent outline-none flex-1 text-[13px]",placeholder:"USDC",inputMode:"decimal",disabled:ke}),i.jsx("span",{className:"text-[11px] text-white/40 ml-1",children:"USDC"})]}),i.jsx("div",{className:"flex flex-col gap-1 w-[120px]",children:i.jsx(y4,{onClick:ie&&ie>0&&!ke?()=>ae(!0):void 0,children:ie&&ie>0?`${Vn}x`:"--"})})]}),i.jsxs("div",{className:"flex items-center gap-3 !mt-4 pb-6",children:[i.jsx(XN,{value:U,onChange:ct=>Ge(ct),accent:"#67FFBD"}),i.jsxs("div",{className:"h-[30px] rounded-lg flex items-center px-2",style:{width:84,background:Io,border:`1px solid ${Oa}`},children:[i.jsx("input",{className:"w-full bg-transparent outline-none text-right text-xs",inputMode:"numeric",value:U,onChange:ct=>Ge(Math.max(0,Math.min(100,Number(ct.target.value)||0))),style:{color:Li,fontFeatureSettings:'"tnum"'},disabled:ke}),i.jsx("span",{style:{color:yi},className:"ml-1",children:"%"})]})]}),i.jsxs("div",{className:"text-[11px] text-white/40 flex justify-between mt-2 border-t border-[#292929] pt-4 font-semibold",children:[i.jsxs("span",{children:["Max ",e,": ",`${ie}x`]}),i.jsxs("span",{children:["Total:"," ",Dn>0?`${Dn.toFixed(2)} USDC`:"--"]})]}),i.jsxs("div",{className:"text-[11px] text-white/40 flex justify-between font-semibold",children:[i.jsxs("span",{children:["Qty per order:"," ",xn>0?`${xn} ${e}`:"--"]}),i.jsxs("span",{children:["Margin Mode: ",_e]})]})]}),i.jsxs("section",{className:"pt-2 border-t border-[#292929]",children:[i.jsxs("div",{className:"flex items-center justify-between text-[11px] text-white/40 mb-2",children:[i.jsx("span",{children:"Est. Liq Long"}),i.jsx("span",{children:or?`$${or.toLocaleString(void 0,{maximumFractionDigits:2})}`:"--"})]}),i.jsxs("div",{className:"flex items-center justify-between text-[11px] text-white/40 mb-3",children:[i.jsx("span",{children:"Est. Liq Short"}),i.jsx("span",{children:lr?`$${lr.toLocaleString(void 0,{maximumFractionDigits:2})}`:"--"})]}),i.jsx("button",{type:"button",onClick:Ce,disabled:!Se,className:`w-full h-[32px] rounded-xl font-bold text-[13px] flex items-center justify-center transition-opacity ${Se?ne?"bg-[#FF7173] text-black hover:opacity-90":"bg-[#67FFBD] text-black hover:opacity-90":"bg-[#303030] text-white/40 cursor-not-allowed opacity-70"}`,children:De}),Mt&&i.jsxs("div",{className:"mt-2 text-[11px] text-[#FF7173] text-center",children:["Quantity per order is below min size (",Nt," ",e,")."]}),tn&&i.jsxs("div",{className:"mt-2 text-[11px] text-[#FF7173] text-center",children:["Your order size is below minimum order size of $",Yn.toFixed(2),"."]}),Xn&&i.jsx("div",{className:"mt-2 text-[11px] text-[#FF7173] text-center",children:"Each grid order must be at least $10 notional. Increase your investment, reduce the number of grids, or lower leverage."}),Je]})]})]}),i.jsx(Jh,{open:ee,onClose:()=>ae(!1),children:i.jsxs(um,{title:"Adjust Leverage",children:[i.jsxs("div",{className:"text-[12px] leading-5 mb-3",style:{color:yi},children:["Control the leverage used for ",e," grid bot positions. The maximum leverage is ",ie,"x."]}),i.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[i.jsx("input",{type:"range",min:1,max:ie||1,step:1,value:z,onChange:ct=>Q(Math.max(1,Math.min(ie||1,Number(ct.target.value)))),className:"flex-1",style:{accentColor:"#67FFBD"}}),i.jsxs("div",{className:"h-[36px] rounded-lg flex items-center px-2",style:{width:84,background:Io,border:`1px solid ${Oa}`},children:[i.jsx("input",{className:"w-full bg-transparent outline-none text-right text-white",inputMode:"numeric",value:z,onChange:ct=>{const gt=Number(ct.target.value)||1,Xt=Math.max(1,Math.min(ie||1,gt));Q(Xt)}}),i.jsx("span",{className:"text-[11px] text-white/40 ml-1",children:"x"})]})]}),i.jsx(P0,{onClick:()=>ae(!1),children:"Confirm"})]})}),i.jsx(Jh,{open:fe,onClose:()=>Ne(!1),children:i.jsxs(um,{title:`${e} Grid Bot`,children:[i.jsxs("div",{className:"flex items-center gap-2 mb-4 text-[10px]",children:[i.jsx("span",{className:"px-2 py-0.5 rounded-full bg-[#151b23] text-[#9CA3AF]",children:_e}),i.jsxs("span",{className:"px-2 py-0.5 rounded-full bg-[#FF71731a] text-[#FF7173]",children:["Leverage ",Vn,"x"]})]}),i.jsxs("div",{className:"grid grid-cols-2 gap-y-2 gap-x-6 text-[12px] mb-4",children:[i.jsxs("div",{children:[i.jsx("div",{className:"text-[11px]",style:{color:yi},children:"Price Range"}),i.jsx("div",{className:"font-medium",style:{color:Li},children:Number.isFinite(Number(c))&&Number.isFinite(Number(d))?`${Number(c).toFixed(an)} - ${Number(d).toFixed(an)} USDC`:"--"})]}),i.jsxs("div",{children:[i.jsx("div",{className:"text-[11px]",style:{color:yi},children:"Number of Grids"}),i.jsx("div",{className:"font-medium",style:{color:Li},children:Kn||"--"})]}),i.jsxs("div",{children:[i.jsx("div",{className:"text-[11px]",style:{color:yi},children:"Mode"}),i.jsx("div",{className:"font-medium",style:{color:Li},children:P==="geometric"?"Geometric":"Arithmetic"})]}),i.jsxs("div",{children:[i.jsx("div",{className:"text-[11px]",style:{color:yi},children:"Qty Per Order"}),i.jsx("div",{className:"font-medium",style:{color:Li},children:xn>0?`${xn} ${e}`:"--"})]}),Je,Je,Je,Je]}),i.jsx("div",{className:"mt-2 pt-3 border-t border-[#292929]",children:i.jsxs("div",{className:"flex items-center justify-between text-[12px]",children:[i.jsx("span",{className:"font-medium",style:{color:Li},children:"Total Investment"}),i.jsx("span",{className:"font-semibold text-[#67FFBD]",children:Dn>0?`${Dn.toFixed(2)} USDC`:"--"})]})}),i.jsx("div",{className:"mt-4",children:i.jsx(P0,{onClick:Be,disabled:pe,children:pe?"Starting...":"Confirm"})})]})})]})}const Jmn=["arithmetic","geometric"],e0n=10,t0n="https://express-proxy-delta.vercel.app/proxy?url=",n0n="https://api.starknet.extended.exchange/api/v1";function r0n(e,t,n,r,s,a=1){const o=Number(e),l=Number(t),c=Number(n);if(!Number.isFinite(o)||!Number.isFinite(l)||!Number.isFinite(c))return[];if(c<2||l<=o)return[];const u=Number.isFinite(Number(r))?Number(r):0,d=Math.max(1,Number(a)||1),f=Math.max(0,u)*d,x=c>0?f/c:0;if(s==="geometric"){if(!(o>0)||!(l>0))return[];const C=Math.pow(l/o,1/(c-1));return Array.from({length:c},(N,P)=>{const I=o*Math.pow(C,P),R=I>0?x/I:0;return{index:P,price:I,qty:R,order_size_usd:x}})}const g=(l-o)/(c-1),v=(o+l)/2,w=v>0?x/v:0;return Array.from({length:c},(C,N)=>{const P=o+g*N;return{index:N,price:P,qty:w,order_size_usd:x}})}function MSe({entry:e,side:t,notionalUSD:n,maintenanceFrac:r,marginMode:s,accountValueUSD:a,isolatedMarginUSD:o}){const l=Number(e)||0,c=Math.abs(Number(n)||0);if(!l||!c)return null;const u=t==="buy"?1:-1,d=Math.max(0,Number(r)||0),f=c/l,x=c*d;let g;s==="Cross"?g=a-x:g=o-x;const v=1-d*u;if(!f||!isFinite(v))return null;const w=l-u*(g/f)/v;return Math.max(0,w)}function WX(e){const t=String(e||""),n=t.indexOf(":");return n>0?t.slice(0,n).toLowerCase():"hl"}function s0n(e,t,n=6){if(!Number.isFinite(e)||e<=0)return n-0;const r=5,s=Math.max(0,n-0),a=Math.floor(Math.log10(e))+1,o=Math.max(0,r-a);return Math.min(s,o)}function RSe({coin:e,midPrice:t,selectedPrice:n,wallet:r,onWalletChange:s,onLevelsChange:a}){var Jr,ws,ls;const{setSignInConnectButtonOpen:o}=m.useContext(Qr),l=Eue();m.useState("short");const[c,u]=m.useState("neutral"),[d,f]=m.useState(""),[x,g]=m.useState(""),[v,w]=m.useState(2),[C,N]=m.useState("2"),[P,I]=m.useState(""),[R,F]=m.useState("arithmetic"),[U,L]=m.useState(""),[z,Q]=m.useState(0),[ne,J]=m.useState(10),[X,re]=m.useState(!1),[pe,Y]=m.useState(!1),[ie,oe]=m.useState(!1),[G,V]=m.useState(50),[ee,ae]=m.useState(0),[fe,Ne]=m.useState(!1),[he,ge]=m.useState(!1),[ye,ve]=m.useState(()=>r&&r.id&&r.address?{id:r.id,address:r.address,apiKey:r.apiKey}:{id:null,address:null,apiKey:null}),[je,Ie]=m.useState({address:null,token:null}),[Le,Qe]=m.useState(null),[$e,it]=m.useState(""),[tt,lt]=m.useState(""),[ft,ut]=m.useState(""),[qt,It]=m.useState(""),[nn,jt]=m.useState(!1),[cn,un]=m.useState(!1),[Ft,Ke]=m.useState(!1),[Bt,$t]=m.useState(!1),[qe,Ye]=m.useState(0),ht=m.useRef(null),Zt=m.useRef(!1),zt=et=>{const yt=Number(et);if(!Number.isFinite(yt)||yt<=0)return{num:null,str:""};const Tn=yt>=3?yt*.99:yt,tr=Number(Tn.toFixed(2));return{num:Number.isFinite(tr)?tr:null,str:Number.isFinite(tr)?String(yt.toFixed(2)):""}},Et=()=>{f(""),g(""),w(2),N("2"),F("arithmetic"),L(""),Q(0),J(10),I(""),u("neutral"),it(""),lt(""),ut(""),It(""),jt(!1),un(!1),Ke(!1),$t(!1),ht.current=null,Zt.current=!1},{address:nt,isConnected:Ue}=ns(),We=!(Ue&&!!(typeof window<"u"&&window.localStorage.getItem("hyperToken"))),[at,mt]=m.useState([]),[Dt,Tt]=m.useState(!1),dn=m.useRef(!1),on=Dt&&(!at||at.length===0);m.useEffect(()=>{r&&r.id&&r.address&&ve(et=>et.id===r.id&&et.address&&et.address.toLowerCase()===r.address.toLowerCase()?et:{id:r.id,address:r.address,apiKey:r.apiKey})},[r==null?void 0:r.id,r==null?void 0:r.address,r==null?void 0:r.apiKey]),m.useEffect(()=>{const et=()=>{const yt=typeof window<"u"?window.localStorage.getItem("hyperAddress"):null,Tn=typeof window<"u"?window.localStorage.getItem("hyperToken"):null;Ie({address:yt,token:Tn})};return et(),window.addEventListener("localStorageUpdated",et),window.addEventListener("storage",et),()=>{window.removeEventListener("localStorageUpdated",et),window.removeEventListener("storage",et)}},[]),m.useEffect(()=>{if(!je.address||!je.token){mt([]);return}let et=!1;return(async()=>{try{Tt(!0);const tr=await(await fetch("https://dextrabothypev2.nftinit.io/api/wallet/list-extended",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:je.address.toLowerCase(),token:je.token,balance:"true"})})).json().catch(()=>({}));if(et)return;if(tr!=null&&tr.success&&Array.isArray(tr.data)){const Ar=tr.data.map((Br,Vr)=>({...Br,wallet_id:Br.wallet_id??Br.id??Vr,wallet_address:Br.wallet_address||"",wallet_name:Br.wallet_name||Br.name||`Extended Wallet ${Vr+1}`,wallet_api_key:Br.wallet_api_key||Br.api_key||null}));mt(Ar)}else mt([])}catch(Tn){et||(console.error("Extended wallet list error",Tn),mt([]))}finally{et||Tt(!1)}})(),()=>{et=!0}},[je.address,je.token]),m.useEffect(()=>{if(ye.id||!at||!at.length)return;const et=at.find(Tn=>Tn.confirmed)||at[0];if(!et)return;const yt={id:et.wallet_id,address:et.wallet_address,apiKey:et.wallet_api_key};ve(yt),typeof s=="function"&&s({id:String(yt.id),address:yt.address,apiKey:yt.apiKey})},[at,ye.id,s]),m.useEffect(()=>{if(!(ye!=null&&ye.id)||!(at!=null&&at.length))return;const et=at.find(tr=>String(tr.wallet_id)===String(ye.id));if(!et||!(ye.apiKey!==et.wallet_api_key||!ye.address&&et.wallet_address))return;const Tn={id:et.wallet_id,address:et.wallet_address,apiKey:et.wallet_api_key};ve(Tn),typeof s=="function"&&s({id:String(Tn.id),address:Tn.address,apiKey:Tn.apiKey})},[ye==null?void 0:ye.id,ye==null?void 0:ye.apiKey,ye==null?void 0:ye.address,at,s]),m.useEffect(()=>{e&&(Et(),re(!1))},[e]);const gn=m.useMemo(()=>{if(!e)return null;const et=String(e).toUpperCase(),yt=et.replace(/-USD$/,"");return l.find(Tn=>{const tr=String((Tn==null?void 0:Tn.symbol)||"").toUpperCase(),Ar=String((Tn==null?void 0:Tn.rawSymbol)||"").toUpperCase();return tr===et||Ar===et||tr===yt||Ar===yt})||null},[l,e]),Nn=m.useMemo(()=>{const et=gn==null?void 0:gn.marketStats,yt=(et==null?void 0:et.markPrice)??(et==null?void 0:et.lastPrice)??(et==null?void 0:et.indexPrice)??(gn==null?void 0:gn.markPrice)??(gn==null?void 0:gn.lastPrice)??(gn==null?void 0:gn.last)??null,Tn=Number(yt);return Number.isFinite(Tn)?Tn:0},[gn]);m.useEffect(()=>{var Tn;const et=((Tn=gn==null?void 0:gn.tradingConfig)==null?void 0:Tn.maxLeverage)??(gn==null?void 0:gn.maxLeverage)??(gn==null?void 0:gn.leverage),yt=Number(et);!Number.isFinite(yt)||yt<=0||(V(yt),J(tr=>Math.min(yt,Math.max(1,Number(tr)||1))))},[gn]);const kn=(ye==null?void 0:ye.address)||(nt?nt.toLowerCase():null),{perpsOverview:yn}=bT(kn),Vn=m.useMemo(()=>{const et=at.find(Br=>String(Br.wallet_id)===String(ye==null?void 0:ye.id)),yt=(et==null?void 0:et.available_balance)??(et==null?void 0:et.balance)??null,Tn=Number(yt);if(!(ye!=null&&ye.apiKey))return Number.isFinite(Tn)?Tn:null;const tr=Number(Le==null?void 0:Le.availableForTrade);if(Number.isFinite(tr))return tr;if(Number.isFinite(Tn))return Tn;if(!yn||yn.balance==null)return null;const Ar=Number(yn.balance);return Number.isFinite(Ar)?Ar:null},[Le,yn,ye==null?void 0:ye.apiKey,ye==null?void 0:ye.id,at]);m.useEffect(()=>{if(!(ye!=null&&ye.apiKey)){Qe(null);return}let et=!1;const yt=async()=>{var tr,Ar,Br;try{const Vr=`${t0n}${encodeURIComponent(`${n0n}/user/balance`)}`,jr=await(await fetch(Vr,{headers:{"X-Api-Key":ye.apiKey}})).json().catch(()=>null);if(!et){const ps=((tr=jr==null?void 0:jr.data)==null?void 0:tr.availableForTrade)??(jr==null?void 0:jr.availableForTrade)??((Ar=jr==null?void 0:jr.data)==null?void 0:Ar.available_balance)??(jr==null?void 0:jr.available_balance)??((Br=jr==null?void 0:jr.data)==null?void 0:Br.available)??(jr==null?void 0:jr.available),gr=Number(ps);Qe({availableForTrade:Number.isFinite(gr)&&gr>=0?gr:null,raw:jr})}}catch{et||Qe(null)}};yt();const Tn=setInterval(yt,2e4);return()=>{et=!0,clearInterval(Tn)}},[ye==null?void 0:ye.apiKey]);const Gn=(et,yt)=>{var cr,Nr,fr,ur;const Tn=et.priceRange||{},Ar=(Array.isArray(et.gridPrices)?et.gridPrices:[]).map(Yr=>Yr&&typeof Yr=="object"&&Yr.price!=null?Number(Yr.price):Number(Yr)).filter(Yr=>Number.isFinite(Yr));let Br=Tn.lower,Vr=Tn.upper;(!Number.isFinite(Br)||!Number.isFinite(Vr))&&Ar.length>=2&&(Br=Ar[0],Vr=Ar[Ar.length-1]),Number.isFinite(Br)?f(String(Br)):f(""),Number.isFinite(Vr)?g(String(Vr)):g("");let dr=et.gridType;dr!=="geometric"&&dr!=="arithmetic"&&(dr="arithmetic"),F(dr);const jr=et.grid_side_mode??et.gridSideMode??et.gridSide??et.sideMode??null,ps=String(jr||"").toLowerCase(),gr=et.grid_count_base??et.gridCountBase??et.grid_count_input??et.gridCountInput??null,es=Number(gr);let Gs=et.gridCount;Number.isFinite(Gs)||Ar.length>=2&&(Gs=Ar.length);const Es=ps&&ps!=="neutral"&&Number.isFinite(es)?es:Gs;Number.isFinite(Es)?(w(Es),N(String(Es))):(w(2),N("2")),u(ps==="short"||ps==="short_only"?"short":ps==="long"||ps==="long_only"?"long":"neutral");const xr=et.investment||{};xr&&xr.leverage!=null&&Number.isFinite(Number(xr.leverage))&&J(Number(xr.leverage));const Gt=xr.wallet_balance??xr.walletBalance??xr.balance??xr.available_balance??xr.availableBalance??null,ce=(xr==null?void 0:xr.collateral_input)??(xr==null?void 0:xr.collateralInput)??(xr==null?void 0:xr.collateral)??(xr==null?void 0:xr.collateral_used)??(xr==null?void 0:xr.collateralUsed)??(xr==null?void 0:xr.collateralEffective)??null,rt=Number(ce);if(xr&&Number.isFinite(rt)){const{num:Yr,str:ss}=zt(rt);L(ss),ht.current=Yr;const Ir=xr.percentChosen!=null?Number(xr.percentChosen):xr.percent!=null?Number(xr.percent):null,mr=Ir!=null&&Number.isFinite(Ir),Qn=Number(Gt);if(mr)Q(Math.max(0,Math.min(100,Ir))),Zt.current=!1;else{const xs=Number.isFinite(Qn)&&Qn>0?Qn:yt;if(xs&&xs>0&&Yr>0){const Xs=Yr/xs*100;Q(Math.max(0,Math.min(100,Xs))),Zt.current=!1}else Q(0),Zt.current=Yr>0}}else L(""),Q(0),ht.current=null,Zt.current=!1;const Pt=et.trailing_up??((cr=et==null?void 0:et.trailing)==null?void 0:cr.up),vt=et.trailing_down??((Nr=et==null?void 0:et.trailing)==null?void 0:Nr.down),ln=et.sl_up??((fr=et==null?void 0:et.sl)==null?void 0:fr.up),mn=et.sl_down??((ur=et==null?void 0:et.sl)==null?void 0:ur.down);it(Pt!=null&&Number.isFinite(Number(Pt))?String(Pt):""),lt(vt!=null&&Number.isFinite(Number(vt))?String(vt):""),ut(ln!=null&&Number.isFinite(Number(ln))?String(ln):""),It(mn!=null&&Number.isFinite(Number(mn))?String(mn):""),jt(Pt!=null&&Number.isFinite(Number(Pt))),un(vt!=null&&Number.isFinite(Number(vt))),Ke(ln!=null&&Number.isFinite(Number(ln))),$t(mn!=null&&Number.isFinite(Number(mn)))};m.useEffect(()=>{if(!Zt.current)return;const et=Number(ht.current),yt=Number(Vn);if(!Number.isFinite(et)||et<=0||!Number.isFinite(yt)||yt<=0)return;const Tn=et/yt*100;Q(Math.max(0,Math.min(100,Tn))),Zt.current=!1},[Vn]),m.useEffect(()=>{if(typeof window>"u")return;if(!e||!(ye!=null&&ye.id)||!(ye!=null&&ye.address)){re(!1),Et();return}let et=!1;async function yt(){Y(!0);try{const Tn=window.localStorage.getItem("hyperToken");if(!Tn){et||(re(!1),Et(),Y(!1));return}const tr={address:window.localStorage.getItem("hyperAddress"),token:Tn,wallet_id:Number(ye.id),source_market:"extended",coin:String(e||"").toUpperCase()},Br=await(await fetch("https://dextrabothypev2.nftinit.io/api/hyper/extended_bot/info/",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(tr)})).json().catch(()=>null);if(et)return;if(dn.current){dn.current=!1,Y(!1);return}const Vr=Br&&Br.data?Br.data:Br,jr=(Array.isArray(Vr)?Vr:[Vr]).filter(Boolean).filter(gr=>gr&&typeof gr=="object"&&String(gr.coin||"").toUpperCase()===String(e||"").toUpperCase()&&String(gr.wallet_id||"")===String(ye.id||"")),ps=jr.find(gr=>gr&&typeof gr=="object"&&gr.is_deleted===!1&&gr.bot_params)||jr.find(gr=>gr&&typeof gr=="object"&&gr.is_deleted!==!0&&gr.bot_params)||null;if(ps){if(ps.wallet_id&&String(ps.wallet_id)!==String(ye.id)){const gr=at.find(es=>String(es.wallet_id)===String(ps.wallet_id));if(gr){const es={id:gr.wallet_id,address:gr.wallet_address,apiKey:gr.wallet_api_key};ve(es),typeof s=="function"&&s({id:String(es.id),address:es.address,apiKey:es.apiKey})}}Gn(ps.bot_params,Vn),re(!0)}else re(!1),Et(),f(""),g("")}catch{re(!1),Et(),f(""),g("")}finally{et||Y(!1)}}return yt(),()=>{et=!0}},[e,ye==null?void 0:ye.id,ye==null?void 0:ye.address,qe,at,s]),m.useEffect(()=>{if(typeof window>"u")return;const et=window.localStorage.getItem("gridbot:pending_selection");if(!et)return;let yt=null;try{yt=JSON.parse(et)}catch{yt=null}if(!(!yt||yt.sourceMarket&&yt.sourceMarket!=="extended"||String(yt.coin||"").toUpperCase()!==String(e||"").toUpperCase())){if(dn.current=!0,Gn(yt.botParams||{},Vn),yt.isActive===!0?re(!0):yt.isActive===!1&&re(!1),yt.walletId&&at&&at.length){const Tn=at.find(tr=>String(tr.wallet_id)===String(yt.walletId));if(Tn){const tr={id:Tn.wallet_id,address:Tn.wallet_address,apiKey:Tn.wallet_api_key};ve(tr),typeof s=="function"&&s({id:String(tr.id),address:tr.address,apiKey:tr.apiKey})}}try{window.localStorage.removeItem("gridbot:pending_selection")}catch{}}},[e,at,s,Vn]),m.useEffect(()=>{const et=yt=>{const Tn=yt&&yt.detail&&yt.detail.sourceMarket;Tn&&Tn!=="extended"||Ye(tr=>tr+1)};return window.addEventListener("gridbotUpdated",et),()=>{window.removeEventListener("gridbotUpdated",et)}},[]),m.useEffect(()=>{const et=yt=>{const Tn=yt&&yt.detail;if(!Tn)return;const tr=Tn.sourceMarket||Tn.source_market;if(tr&&tr!=="extended"||String(Tn.coin||"").toUpperCase()!==String(e||"").toUpperCase())return;const Br=Tn.botParams||{};if(Gn(Br,Vn),dn.current=!0,Tn.isActive===!0?re(!0):Tn.isActive===!1&&re(!1),Tn.walletId&&at&&at.length){const Vr=at.find(dr=>String(dr.wallet_id)===String(Tn.walletId));if(Vr){const dr={id:Vr.wallet_id,address:Vr.wallet_address,apiKey:Vr.wallet_api_key};ve(dr),typeof s=="function"&&s({id:String(dr.id),address:dr.address,apiKey:dr.apiKey})}}};return window.addEventListener("gridbotSelectFromTasks",et),()=>{window.removeEventListener("gridbotSelectFromTasks",et)}},[e,at,s]);const Dn=m.useMemo(()=>Math.min(G,Math.max(1,Number(ne)||1)),[ne,G]),Kn=(()=>{const et=Number(U);return!Number.isFinite(et)||et<=0?0:et>=3?et*.99:et})(),Cn=Number(U)||0,sn=m.useMemo(()=>{const et=Number(d),yt=Number(x);return!Number.isFinite(et)||!Number.isFinite(yt)?null:(et+yt)/2},[d,x]),Me=m.useMemo(()=>{if(Nn>0)return Nn;const et=Number(t||0);if(et>0)return et;const yt=Number(n||0);return yt>0?yt:sn!=null&&sn>0?sn:0},[Nn,t,n,sn]),en=Number.isFinite(Me)&&Me>0?Me:sn,an=m.useMemo(()=>r0n(d,x,v,Kn,R,Dn),[d,x,v,Kn,R,Dn]),Nt=m.useMemo(()=>{const et=an.map((ps,gr)=>{const es=Number(ps==null?void 0:ps.price);return Number.isFinite(es)?{index:Number.isFinite(ps==null?void 0:ps.index)?ps.index:gr,price:es}:null}).filter(Boolean);if(!et.length)return[];const yt=Kn*Dn,Tn=Number.isFinite(en)&&en>0?en:null;let tr=0,Ar=0;if(Tn!=null)for(const ps of et)ps.price>=Tn?Ar+=1:tr+=1;else tr=et.length;let Br=et.length;c==="long"?Br=tr+Ar*2:c==="short"&&(Br=Ar+tr*2),(!Number.isFinite(Br)||Br<=0)&&(Br=et.length);const Vr=Br>0?yt/Br:0,dr=sn??0,jr=R==="geometric";return et.map(ps=>{const gr=jr?ps.price>0?Vr/ps.price:0:dr>0?Vr/dr:0;return{index:ps.index,price:ps.price,qty:gr,order_size_usd:Vr}})},[an,Kn,Dn,sn,R,c,en]),Yn=m.useMemo(()=>Nt.length?Nt.map(et=>({price:et.price,side:en==null?null:Number(et.price)>=en?"sell":"buy"})):[],[Nt,en]);m.useEffect(()=>{typeof a=="function"&&a(Yn)},[Yn,a]);const xn=et=>{const yt=Number(et);if(!(yt>0))return;const Tn=yt*.01;f((yt-Tn).toFixed(2)),g((yt+Tn).toFixed(2))},Mt=Me,tn=Kn*Dn,In=Nt.length,Xn=m.useMemo(()=>{if(!Nt.length)return 0;let et=0,yt=0;for(const Tn of Nt){const tr=Number(Tn==null?void 0:Tn.qty);Number.isFinite(tr)&&(et+=tr,yt+=1)}return yt?et/yt:0},[Nt]),or=Number(gn==null?void 0:gn.collateralAssetPrecision),lr=Number(gn==null?void 0:gn.assetPrecision),Qt=(Jr=gn==null?void 0:gn.tradingConfig)==null?void 0:Jr.minOrderSizeChange,zn=(()=>{const et=Number(Qt);if(!Number.isFinite(et))return null;const[,yt=""]=String(Qt).split(".");return Math.max(0,yt.length)})(),Jn=Number.isFinite(or)?or:Number.isFinite(lr)?lr:4,Lt=zn!=null&&Number.isFinite(zn)?zn:Jn,jn=Number((ws=gn==null?void 0:gn.tradingConfig)==null?void 0:ws.minPriceChange),Ee=m.useMemo(()=>Number.isFinite(jn)&&jn>0?jn>=1?0:Math.min(8,Math.max(0,-Math.floor(Math.log10(jn)))):s0n(Me),[jn,Me]),h=Ee,p=Number(((ls=gn==null?void 0:gn.tradingConfig)==null?void 0:ls.minOrderSize)??0),S=0,_=Xn>0?Number(Xn.toFixed(Lt)):0,k=m.useMemo(()=>Nt.some(et=>Number(et==null?void 0:et.qty)>0),[Nt]),T=k&&p>0&&Nt.some(et=>{const yt=Number(et==null?void 0:et.qty);return Number.isFinite(yt)?yt<p:!1}),B=k&&S>0,q=m.useMemo(()=>{if(!k||Nt.length===0)return 0;let et=1/0;for(const yt of Nt){const Tn=Number(yt==null?void 0:yt.price),tr=Number(yt==null?void 0:yt.qty);if(!Number.isFinite(Tn)||!Number.isFinite(tr))continue;if(Tn<=0||tr<=0){et=0;break}const Ar=Tn*tr;Ar<et&&(et=Ar)}return et===1/0?0:et},[k,Nt]),te=k&&q<e0n,ue=Me>0&&tn>0&&Kn>0?MSe({entry:Me,side:"buy",notionalUSD:tn,maintenanceFrac:.01,marginMode:"Cross",accountValueUSD:Kn,isolatedMarginUSD:Kn}):null,de=Me>0&&tn>0&&Kn>0?MSe({entry:Me,side:"sell",notionalUSD:tn,maintenanceFrac:.01,marginMode:"Cross",accountValueUSD:Kn,isolatedMarginUSD:Kn}):null,xe=m.useMemo(()=>{if(!d&&!x)return"";const et=Number(d),yt=Number(x);if(!Number.isFinite(et)||!Number.isFinite(yt))return"";if(!(yt>et))return"Upper price must be greater than lower price.";if(Mt>0){if(et>Mt)return`Lower price cannot be above mark price (${Mt.toFixed(Ee)}).`;if(yt<Mt)return`Upper price cannot be below mark price (${Mt.toFixed(Ee)}).`}return""},[d,x,Mt,Ee]),Se=m.useMemo(()=>{const et=Number(d),yt=Number(x);return!(!Number.isFinite(et)||!Number.isFinite(yt)||!(yt>et)||Mt>0&&(et>Mt||yt<Mt))},[d,x,Mt]),ke=Number(d),Re=Number(x),Ge=Number($e),Fe=Number(tt),st=Number(ft),se=Number(qt),Ce=nn&&($e===""||!Number.isFinite(Ge)||!(Ge>Re)),Be=cn&&(tt===""||!Number.isFinite(Fe)||!(Fe<ke));m.useEffect(()=>{nn||it(""),cn||lt("")},[nn,cn]),m.useEffect(()=>{Ft||ut(""),Bt||It("")},[Ft,Bt]);const De=Ft&&(ft===""||!Number.isFinite(st)||!nn&&Number.isFinite(Re)&&!(st>Re)||nn&&Number.isFinite(Ge)&&!(st>Ge)),_e=Bt&&(qt===""||!Number.isFinite(se)||!cn&&Number.isFinite(ke)&&!(se<ke)||cn&&Number.isFinite(Fe)&&!(se<Fe)),Je=In>1&&Se&&Kn>0&&Dn>0&&(ye==null?void 0:ye.id)&&(ye==null?void 0:ye.address),ct=ee>0,gt=!!P,Xt=T||B,wt=Ce||Be||De||_e,Xe=Je&&!pe&&!ie&&!on&&!ct&&!gt&&!Xt&&!te&&!wt,Oe=ie||pe||on||gt||Xt||te||ct||wt?!1:X?!0:Je,bt=X||ie||pe||on;m.useEffect(()=>{if(!ee)return;const et=setInterval(()=>ae(yt=>yt>1?yt-1:0),1e3);return()=>clearInterval(et)},[ee]);const kt=()=>{if(bt)return;const et=Nn>0?Nn:Me>0?Me:Number(t||n||0);!Number.isFinite(et)||et<=0||xn(et)},Ut=et=>{if(bt)return;Zt.current=!1;const yt=Math.max(0,Math.min(100,Number(et)||0));if(Q(yt),!Vn||Vn<=0){yt===0&&L("");return}const Tn=Vn*yt/100;zt(Tn),L(Number.isFinite(Tn)?Tn.toFixed(2):"")},fn=et=>{if(bt)return;Zt.current=!1;const yt=Number(et);if(L(et),!Vn||!Number.isFinite(yt)||yt<=0||Vn<=0){Q(0);return}const Tn=(yt>=3?yt*.99:yt)/Vn*100;Q(Math.max(0,Math.min(100,Tn)))},On=async()=>{if(!Xe||typeof window>"u"||!(ye!=null&&ye.address)||!(ye!=null&&ye.id))return;const et=Nt.filter(Es=>Number.isFinite(Es==null?void 0:Es.price));if(et.length<2)return;const yt=et[0],Tn=et[et.length-1],tr=et.length,Ar=tr>1?tr-1:0,Br=R!=="geometric"&&Ar>0?(Tn.price-yt.price)/Ar:null,Vr=R==="geometric"&&Ar>0?Math.pow(Tn.price/yt.price,1/Ar):null,dr=(yt.price+Tn.price)/2,jr=window.localStorage.getItem("hyperToken");if(!jr)return;if(nn&&Ce){rn.error("Trailing Up is invalid.");return}if(cn&&Be){rn.error("Trailing Down is invalid.");return}if(Ft&&De){const Es=nn?"SL Up must be greater than Trailing Up.":"SL Up must be greater than Upper price.";rn.error(Es);return}if(Bt&&_e){const Es=cn?"SL Down must be less than Trailing Down.":"SL Down must be less than Lower price.";rn.error(Es);return}const ps=_,gr=WX(e),es={symbol:String(e||"").toUpperCase(),dex:gr,gridType:R==="geometric"?"geometric":"arithmetic",direction:c,grid_side_mode:c,grid_count_base:v,priceRange:{lower:Number(yt.price.toFixed(h)),upper:Number(Tn.price.toFixed(h)),middle:Number(dr.toFixed(h))},gridCount:tr,gridPrices:et.map(Es=>({price:Number(Es.price.toFixed(h)),qty:Number(Number(Es.qty||0).toFixed(Lt))})),trailing_up_grid_prices:(()=>{if(!(nn&&!Ce&&Number.isFinite(Ge)))return[];const Es=[];if(R==="geometric"&&Vr&&Vr>0){let xr=Tn.price*Vr,Gt=0;for(;xr<=Ge+1e-12&&Gt<500;){const ce=(Me>0,_);Es.push({price:Number(xr.toFixed(h)),qty:Number(ce.toFixed(Lt))}),xr*=Vr,Gt+=1}}else if(Br&&Br>0)for(let xr=Tn.price+Br,Gt=0;xr<=Ge+1e-12&&Gt<500;xr+=Br,Gt+=1)Es.push({price:Number(xr.toFixed(h)),qty:Number(_.toFixed(Lt))});return Es})(),trailing_down_grid_prices:(()=>{if(!(cn&&!Be&&Number.isFinite(Fe)))return[];const Es=[];if(R==="geometric"&&Vr&&Vr>0){let xr=yt.price/Vr,Gt=0;for(;xr>=Fe-1e-12&&Gt<500;)Es.push({price:Number(xr.toFixed(h)),qty:Number(_.toFixed(Lt))}),xr/=Vr,Gt+=1}else if(Br&&Br>0)for(let xr=yt.price-Br,Gt=0;xr>=Fe-1e-12&&Gt<500;xr-=Br,Gt+=1)Es.push({price:Number(xr.toFixed(h)),qty:Number(_.toFixed(Lt))});return Es})(),investment:{collateral:Cn,collateralUsed:Kn,percentChosen:z,leverage:Dn,totalInvestment:Kn,qtyPerOrder:ps},liquidationPrices:{long:ue?Number(ue.toFixed(2)):null,short:de?Number(de.toFixed(2)):null},trailing_up:nn&&!Ce?Number(Ge.toFixed(h)):null,trailing_down:cn&&!Be?Number(Fe.toFixed(h)):null,sl_up:Ft&&!De?Number(st.toFixed(h)):null,sl_down:Bt&&!_e?Number(se.toFixed(h)):null,marginMode:"Cross",currentPrice:Me||null,timestamp:new Date().toISOString()},Gs={address:window.localStorage.getItem("hyperAddress"),token:jr,wallet_id:Number(ye.id),source_market:"extended",bot_params:es,coin:String(e||"").toUpperCase()};oe(!0);try{const xr=await(await fetch("https://dextrabothypev2.nftinit.io/api/hyper/extended_bot/save/",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Gs)})).json().catch(()=>null);if(!(xr&&(xr.success===!0||xr.status==="ok"||xr.status==="success"))){const ce=xr&&(xr.error_message||xr.message||xr.detail)||"Grid bot failed to start.";rn.error(ce);return}re(!0),typeof window<"u"&&window.dispatchEvent(new CustomEvent("gridbotUpdated",{detail:{sourceMarket:"extended"}})),rn.success("Grid bot started.")}catch{rn.error("An error occurred while starting the grid bot.")}finally{oe(!1)}},Sn=async()=>{if(typeof window>"u"||!(ye!=null&&ye.address)||!(ye!=null&&ye.id))return;const et=window.localStorage.getItem("hyperToken");if(!et)return;WX(e);const yt={address:window.localStorage.getItem("hyperAddress"),token:et,wallet_id:Number(ye.id),source_market:"extended",coin:String(e||"").toUpperCase()};oe(!0);try{const tr=await(await fetch("https://dextrabothypev2.nftinit.io/api/hyper/extended_bot/stop/",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(yt)})).json().catch(()=>null);if(!(tr&&(tr.success===!0||tr.status==="ok"||tr.status==="success"))){const Br=tr&&(tr.error_message||tr.message||tr.detail)||"Grid bot could not be stopped.";rn.error(Br);return}re(!1),ae(10),typeof window<"u"&&window.dispatchEvent(new CustomEvent("gridbotUpdated",{detail:{sourceMarket:"extended"}})),rn.success("Grid bot has been stopped.")}catch{rn.error("An error occurred while stopping the grid bot.")}finally{oe(!1)}},yr=()=>{Oe&&(X?Sn():ge(!0))},Pn=async()=>{Xe&&(ge(!1),await On())},En=ie?X?"Stopping...":"Starting...":X?"Stop":ct?`Stopping ${ee}s`:"Start",$n=["xyz","vntl","flx"].includes(WX(e))?"Isolated":"Cross",Bn=nn&&!Ce,_r=cn&&!Be,sr=Ft&&!De,rr=Bt&&!_e,Rr=[{key:"neutral",label:"Neutral",activeClass:"bg-[#E6E6E6] text-[#101010] border-[#E6E6E6]"},{key:"short",label:"Short Only",activeClass:"bg-[#FF7173] text-[#0f151a] border-[#FF7173]"},{key:"long",label:"Long Only",activeClass:"bg-[#67FFBD] text-[#0f151a] border-[#67FFBD]"}];return i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"h-full w-full flex flex-col text-[13px]",children:[i.jsx("div",{className:"px-3 pb-2 flex items-center justify-between border-b border-[#292929]"}),i.jsxs("div",{className:"flex-1 overflow-y-auto px-3 pb-3 space-y-4 mt-2",children:[i.jsxs("section",{className:"space-y-1",children:[i.jsx("span",{className:"text-xs text-white/70",children:"Perps Wallet"}),i.jsx(yT,{wallets:at,mode:"extended",value:ye&&ye.id?String(ye.id):"",onChange:et=>{const yt=(at||[]).find(Tn=>String(Tn.wallet_id)===String(et))||null;if(yt){const Tn={id:yt.wallet_id,address:yt.wallet_address,apiKey:yt.wallet_api_key};ve(Tn),typeof s=="function"&&s({id:String(Tn.id),address:Tn.address,apiKey:Tn.apiKey})}},selectedBalance:Vn})]}),i.jsxs("section",{className:"space-y-2",children:[i.jsx("span",{className:"text-xs text-white/70",children:"Grid Mode"}),i.jsx("div",{className:"grid grid-cols-3 gap-2",children:Rr.map(et=>{const yt=c===et.key;return i.jsx("button",{type:"button",onClick:()=>{bt||u(et.key)},disabled:bt,"aria-pressed":yt,className:`h-8 rounded-lg border text-[11px] font-semibold transition-colors ${bt?"opacity-60 cursor-not-allowed":"cursor-pointer"} ${yt?et.activeClass:"bg-[#161616] text-white/60 border-[#292929] hover:text-white"}`,children:et.label},et.key)})})]}),i.jsxs("section",{className:"space-y-1",children:[i.jsxs("div",{className:"flex items-center justify-between mt-2",children:[i.jsx("span",{className:"text-xs text-white/70",children:"Price Range"}),i.jsx("button",{type:"button",onClick:kt,disabled:bt,className:"text-[11px] px-2 py-0.5 rounded-md bg-[#161616] border border-[#292929] text-white/60 hover:text-white disabled:opacity-60 disabled:cursor-not-allowed",children:"Autofill"})]}),i.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[i.jsxs("div",{className:"flex flex-col gap-1",children:[i.jsx("span",{className:"text-[11px] text-white/40",children:"Lower"}),i.jsx("div",{className:"bg-[#161616] border border-[#292929] rounded-lg px-2 py-1.5 flex items-center",children:i.jsx("input",{value:d,onChange:et=>{bt||f(et.target.value)},className:"bg-transparent outline-none flex-1 text-[13px]",placeholder:"0",inputMode:"decimal",disabled:bt})})]}),i.jsxs("div",{className:"flex flex-col gap-1",children:[i.jsx("span",{className:"text-[11px] text-white/40",children:"Upper"}),i.jsx("div",{className:"bg-[#161616] border border-[#292929] rounded-lg px-2 py-1.5 flex items-center",children:i.jsx("input",{value:x,onChange:et=>{bt||g(et.target.value)},className:"bg-transparent outline-none flex-1 text-[13px]",placeholder:"0",inputMode:"decimal",disabled:bt})})]})]}),Mt>0&&i.jsxs("div",{className:"text-[11px] text-white/40",children:["Mark Price: ",Mt.toFixed(Ee)]}),xe&&i.jsx("div",{className:"text-[11px] text-[#FF7173]",children:xe})]}),i.jsxs("section",{className:"space-y-1",children:[i.jsx("div",{className:"flex items-center justify-between",children:i.jsx("span",{className:"text-xs text-white/70",children:"Number of Grids (Even only)"})}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("div",{className:"bg-[#161616] border border-[#292929] rounded-lg px-2 py-1.5 flex-1 flex items-center",children:i.jsx("input",{value:C,onChange:et=>{if(bt)return;const yt=et.target.value.replace(/[^\d]/g,"");if(N(yt),I(""),yt==="")return;const Tn=Number(yt);if(Number.isFinite(Tn)){if(Tn<2){I("The minimum number of grids must be 2.");return}if(Tn>200){I("The maximum number of grids is 200.");return}if(Tn%2!==0){I("The number of grids must be even.");return}w(Tn)}},className:"bg-transparent outline-none flex-1 text-[13px]",inputMode:"numeric",disabled:bt})}),i.jsx("div",{className:"relative",children:i.jsx("select",{value:R,onChange:et=>{bt||F(et.target.value)},className:"bg-[#161616] border border-[#292929] rounded-lg px-2 py-1.5 text-[12px] outline-none",disabled:bt,children:Jmn.map(et=>i.jsx("option",{value:et,className:"bg-[#101010]",children:et[0].toUpperCase()+et.slice(1)},et))})})]}),i.jsx("div",{className:"text-[11px] text-white/40",children:P&&i.jsx("div",{className:"text-[11px] text-[#FF7173] mt-1",children:P})})]}),(c==="short"||c==="long")&&i.jsx("section",{className:"space-y-2",children:i.jsx("div",{className:"flex items-center gap-3 h-8 min-w-0",children:i.jsx(mi,{content:"Enable [Open a position on creation] to automatically open a position at market price when the grid is created.",children:i.jsxs("label",{className:"flex items-center gap-2 shrink-0 w-24",children:[i.jsx("input",{type:"checkbox",checked:!0,className:"accent-[#67FFBD]"}),i.jsx("span",{className:"text-[11px] select-none text-white/80 min-w-max",children:"Open a position on creation"})]})})})}),i.jsxs("section",{className:"space-y-1",children:[i.jsx("span",{className:"text-xs text-white/70",children:"Investment"}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsxs("div",{className:"bg-[#161616] border border-[#292929] rounded-lg px-2 py-1.5 flex-1 flex items-center",children:[i.jsx("input",{value:U,onChange:et=>fn(et.target.value),className:"bg-transparent outline-none flex-1 text-[13px]",placeholder:"USDC",inputMode:"decimal",disabled:bt}),i.jsx("span",{className:"text-[11px] text-white/40 ml-1",children:"USDC"})]}),i.jsx("div",{className:"flex flex-col gap-1 w-[120px]",children:i.jsx(y4,{onClick:G&&G>0&&!bt?()=>Ne(!0):void 0,children:G&&G>0?`${Dn}x`:"--"})})]}),i.jsxs("div",{className:"flex items-center gap-3 !mt-4 pb-6",children:[i.jsx(XN,{value:z,onChange:et=>Ut(et),accent:"#67FFBD"}),i.jsxs("div",{className:"h-[30px] rounded-lg flex items-center px-2",style:{width:84,background:Io,border:`1px solid ${Oa}`},children:[i.jsx("input",{className:"w-full bg-transparent outline-none text-right text-xs",inputMode:"numeric",value:z,onChange:et=>Ut(Math.max(0,Math.min(100,Number(et.target.value)||0))),style:{color:Li,fontFeatureSettings:'"tnum"'},disabled:bt}),i.jsx("span",{style:{color:yi},className:"ml-1",children:"%"})]})]}),i.jsxs("div",{className:"text-[11px] text-white/40 flex justify-between mt-2 border-t border-[#292929] pt-4 font-semibold",children:[i.jsxs("span",{children:["Max ",e,": ",`${G}x`]}),i.jsxs("span",{children:["Total:"," ",tn>0?`${tn.toFixed(2)} USDC`:"--"]})]}),i.jsxs("div",{className:"text-[11px] text-white/40 flex justify-between font-semibold",children:[i.jsxs("span",{children:["Qty per order:"," ",_>0?`${_} ${e}`:"--"]}),i.jsxs("span",{children:["Margin Mode: ",$n]})]})]}),i.jsxs("section",{className:"pt-2 border-t border-[#292929]",children:[i.jsxs("div",{className:"flex items-center justify-between text-[11px] text-white/40 mb-2",children:[i.jsx("span",{children:"Est. Liq Long"}),i.jsx("span",{children:ue?`$${ue.toLocaleString(void 0,{maximumFractionDigits:2})}`:"--"})]}),i.jsxs("div",{className:"flex items-center justify-between text-[11px] text-white/40 mb-3",children:[i.jsx("span",{children:"Est. Liq Short"}),i.jsx("span",{children:de?`$${de.toLocaleString(void 0,{maximumFractionDigits:2})}`:"--"})]}),We?i.jsx(Zp,{onClick:()=>typeof o=="function"?o(!0):null}):i.jsx("button",{type:"button",onClick:yr,disabled:!Oe,className:`w-full h-[32px] rounded-xl font-bold text-[13px] flex items-center justify-center transition-opacity ${Oe?X?"bg-[#FF7173] text-black hover:opacity-90":"bg-[#67FFBD] text-black hover:opacity-90":"bg-[#303030] text-white/40 cursor-not-allowed opacity-70"}`,children:En}),T&&i.jsxs("div",{className:"mt-2 text-[11px] text-[#FF7173] text-center",children:["Quantity per order is below min size (",p," ",e,")."]}),B,te&&i.jsx("div",{className:"mt-2 text-[11px] text-[#FF7173] text-center",children:"Each grid order must be at least $10 notional. Increase your investment, reduce the number of grids, or lower leverage."}),wt&&i.jsx("div",{className:"mt-2 text-[11px] text-[#FF7173] text-center",children:"Fix trailing/SL input errors to start."})]})]})]}),i.jsx(Jh,{open:fe,onClose:()=>Ne(!1),children:i.jsxs(um,{title:"Adjust Leverage",children:[i.jsxs("div",{className:"text-[12px] leading-5 mb-3",style:{color:yi},children:["Control the leverage used for ",e," grid bot positions. The maximum leverage is ",G,"x."]}),i.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[i.jsx("input",{type:"range",min:1,max:G||1,step:1,value:ne,onChange:et=>J(Math.max(1,Math.min(G||1,Number(et.target.value)))),className:"flex-1",style:{accentColor:"#67FFBD"}}),i.jsxs("div",{className:"h-[36px] rounded-lg flex items-center px-2",style:{width:84,background:Io,border:`1px solid ${Oa}`},children:[i.jsx("input",{className:"w-full bg-transparent outline-none text-right text-white",inputMode:"numeric",value:ne,onChange:et=>{const yt=Number(et.target.value)||1,Tn=Math.max(1,Math.min(G||1,yt));J(Tn)}}),i.jsx("span",{className:"text-[11px] text-white/40 ml-1",children:"x"})]})]}),i.jsx(P0,{onClick:()=>Ne(!1),children:"Confirm"})]})}),i.jsx(Jh,{open:he,onClose:()=>ge(!1),children:i.jsxs(um,{title:`${e} Grid Bot`,children:[i.jsxs("div",{className:"flex items-center gap-2 mb-4 text-[10px]",children:[i.jsx("span",{className:"px-2 py-0.5 rounded-full bg-[#151b23] text-[#9CA3AF]",children:$n}),i.jsxs("span",{className:"px-2 py-0.5 rounded-full bg-[#FF71731a] text-[#FF7173]",children:["Leverage ",Dn,"x"]})]}),i.jsxs("div",{className:"grid grid-cols-2 gap-y-2 gap-x-6 text-[12px] mb-4",children:[i.jsxs("div",{children:[i.jsx("div",{className:"text-[11px]",style:{color:yi},children:"Price Range"}),i.jsx("div",{className:"font-medium",style:{color:Li},children:Number.isFinite(Number(d))&&Number.isFinite(Number(x))?`${Number(d).toFixed(h)} - ${Number(x).toFixed(h)} USDC`:"--"})]}),i.jsxs("div",{children:[i.jsx("div",{className:"text-[11px]",style:{color:yi},children:"Number of Grids"}),i.jsx("div",{className:"font-medium",style:{color:Li},children:In||"--"})]}),i.jsxs("div",{children:[i.jsx("div",{className:"text-[11px]",style:{color:yi},children:"Mode"}),i.jsx("div",{className:"font-medium",style:{color:Li},children:R==="geometric"?"Geometric":"Arithmetic"})]}),i.jsxs("div",{children:[i.jsx("div",{className:"text-[11px]",style:{color:yi},children:"Qty Per Order"}),i.jsx("div",{className:"font-medium",style:{color:Li},children:_>0?`${_} ${e}`:"--"})]}),Bn&&i.jsxs("div",{children:[i.jsx("div",{className:"text-[11px]",style:{color:yi},children:"Trailing Up"}),i.jsxs("div",{className:"font-medium",style:{color:Li},children:[Number($e).toFixed(h)," USDC"]})]}),_r&&i.jsxs("div",{children:[i.jsx("div",{className:"text-[11px]",style:{color:yi},children:"Trailing Down"}),i.jsxs("div",{className:"font-medium",style:{color:Li},children:[Number(tt).toFixed(h)," USDC"]})]}),sr&&i.jsxs("div",{children:[i.jsx("div",{className:"text-[11px]",style:{color:yi},children:"SL Up"}),i.jsxs("div",{className:"font-medium",style:{color:Li},children:[Number(ft).toFixed(h)," USDC"]})]}),rr&&i.jsxs("div",{children:[i.jsx("div",{className:"text-[11px]",style:{color:yi},children:"SL Down"}),i.jsxs("div",{className:"font-medium",style:{color:Li},children:[Number(qt).toFixed(h)," USDC"]})]})]}),i.jsx("div",{className:"mt-2 pt-3 border-t border-[#292929]",children:i.jsxs("div",{className:"flex items-center justify-between text-[12px]",children:[i.jsx("span",{className:"font-medium",style:{color:Li},children:"Total Investment"}),i.jsx("span",{className:"font-semibold text-[#67FFBD]",children:tn>0?`${tn.toFixed(2)} USDC`:"--"})]})}),i.jsx("div",{className:"mt-4",children:i.jsx(P0,{onClick:Pn,disabled:ie,children:ie?"Starting...":"Confirm"})})]})})]})}const QN="/assets/fee-animation-Cvx53PQy.mp4",i0n="wss://mainnet.zklighter.elliot.ai/stream",a0n="https://api.hyperliquid.xyz/info",tD=e=>e==null?0:Number(e),nD=(e,t=6)=>isNaN(e)?"--":e.toLocaleString(void 0,{maximumFractionDigits:t}),o0n=(e,t)=>{if(isNaN(e))return"--";const n=Number(t);let r=0;return n>0&&n<1&&(r=Math.min(8,Math.max(0,-Math.floor(Math.log10(n))))),e.toLocaleString(void 0,{minimumFractionDigits:0,maximumFractionDigits:r})},l0n=e=>{if(e>=1)return e.toLocaleString();const t=Math.min(8,Math.max(0,-Math.floor(Math.log10(e))));return e.toFixed(t)},c0n={BTC:{1:{value:1},10:{value:2},20:{value:5},50:{value:10},100:{value:100},1e3:{value:1e3}},ETH:{.1:{value:.1},.2:{value:.2},.5:{value:.5},1:{value:1},10:{value:10},100:{value:100}}},u0n=e=>{if(!e)return null;const t=String(e).toUpperCase(),n=c0n[t];return n?Object.values(n).map(s=>s.value).filter(s=>Number.isFinite(s)&&s>0).sort((s,a)=>s-a):null};async function d0n(e){var o;const n=await fetch(a0n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"l2Book",coin:e})});if(!n.ok)throw new Error("info request failed");const r=await n.json(),s=(r==null?void 0:r.levels)||((o=r==null?void 0:r.data)==null?void 0:o.levels),a=Array.isArray(s==null?void 0:s[0])&&s[0]||(s==null?void 0:s.bs)||(s==null?void 0:s.bids)||[];if(!Array.isArray(a)||!a.length)throw new Error("orderbook empty or bad format");return a}function f0n(e){const t=e.slice(0,10).map(o=>Number(o.px??(Array.isArray(o)?o[0]:void 0))).filter(o=>Number.isFinite(o)),n=[];for(let o=0;o<t.length-1;o++){const l=t[o]-t[o+1];l>0&&n.push(l)}if(!n.length)return 0;const s=Math.min(...n).toFixed(18).replace(/0+$/g,"").replace(/\.$/,""),a=Number(s);return Number.isFinite(a)?a:0}function h0n(e){const t=e.toFixed(18).replace(/0+$/g,"").replace(/\.$/,""),n=Number(t);return Number.isFinite(n)?n:0}function p0n(e,t){if(!e||e<=0)return[];const n=Math.floor(Math.log10(e)),r=[];t>0&&r.push(t);const s=n-4,a=Math.pow(10,s);[1,2,5].forEach(g=>r.push(g*a));const o=n-3;r.push(Math.pow(10,o));const l=n-2;r.push(Math.pow(10,l));const c=n-1;r.push(Math.pow(10,c));const u=r.filter(g=>g>0&&Number.isFinite(g)).map(h0n),d=Array.from(new Set(u)).sort((g,v)=>g-v),f=t>0?t:0;return d.filter(g=>g>=f&&g>0)}function LSe(e){const n=(e||"").toUpperCase()==="BTC"?[1,10,20,50,100,1e3,1e4]:[.001,.01,.1,10,100];return Array.from(new Set(n)).sort((r,s)=>r-s)}async function m0n(e){if(!e)return[];const t=String(e).trim(),n=u0n(t);if(n&&n.length)return n;const r=t.toUpperCase();try{const s=await d0n(t),a=s[0],o=Number((a==null?void 0:a.px)??(Array.isArray(a)?a[0]:void 0));if(!Number.isFinite(o)||o<=0)throw new Error("bad bestBid");const l=f0n(s);let c=p0n(o,l);return r!=="BTC"?c=c.filter(u=>u!==1):c.includes(1)||c.push(1),c=Array.from(new Set(c.filter(u=>Number.isFinite(u)&&u>0))).sort((u,d)=>u-d),c.length?c:LSe(t)}catch(s){return console.error("getUiStepsForCoin error",t,s),LSe(t)}}function DSe(e,t,n){const r=new Map;for(const s of e||[]){const a=tD(s.px),o=tD(s.sz);if(!a||!o||!t)continue;const l=n==="bid"?Math.floor(a/t)*t:Math.ceil(a/t)*t,c=Number(l.toFixed(12));r.set(c,(r.get(c)||0)+o)}return[...r.entries()].map(([s,a])=>({price:s,size:a}))}function x0n({marketId:e,baseSymbol:t,rows:n=16,onSelectPrice:r,onBest:s}){const a=m.useRef(null),o=m.useRef(null),l=m.useRef(0),c=m.useRef({bids:new Map,asks:new Map}),u=m.useRef(!1),d=m.useRef(!0),[f,x]=m.useState({bids:[],asks:[]}),[g,v]=m.useState("COIN"),[w,C]=m.useState(null),[N,P]=m.useState([]),I=(oe,G)=>g==="USD"?oe*G:oe,R=g==="USD"?"USD":t?String(t):"COIN";m.useEffect(()=>(d.current=!0,()=>{d.current=!1}),[]);const F=()=>{u.current||(u.current=!0,requestAnimationFrame(()=>{if(u.current=!1,!d.current)return;const oe=c.current;if(!((oe==null?void 0:oe.bids)instanceof Map)||!((oe==null?void 0:oe.asks)instanceof Map))return;const G=512,V=Array.from(oe.bids.entries()).map(([ae,fe])=>({px:ae,sz:fe})).sort((ae,fe)=>fe.px-ae.px).slice(0,G),ee=Array.from(oe.asks.entries()).map(([ae,fe])=>({px:ae,sz:fe})).sort((ae,fe)=>ae.px-fe.px).slice(0,G);x({bids:V,asks:ee})}))},U=oe=>{if(oe==null)return;const G=a.current;if(G&&(G.readyState===WebSocket.OPEN||G.readyState===WebSocket.CONNECTING))return;const V=new WebSocket(i0n);a.current=V,V.onopen=()=>{l.current=0;const ee={type:"subscribe",channel:`order_book/${String(oe)}`};try{V.send(JSON.stringify(ee))}catch{}},V.onmessage=ee=>{let ae;try{ae=JSON.parse(ee.data||"{}")}catch{return}if((ae==null?void 0:ae.type)!=="update/order_book")return;const fe=`order_book:${String(oe)}`;if(ae.channel!==fe)return;const Ne=ae.order_book;if(!Ne)return;let he=c.current;(!he||typeof he!="object")&&(he={bids:new Map,asks:new Map},c.current=he),he.bids instanceof Map||(he.bids=new Map),he.asks instanceof Map||(he.asks=new Map);const ge=(ye,ve)=>{const je=Array.isArray(Ne[ye])?Ne[ye]:[];if(je.length)for(const Ie of je){const Le=Number(Ie.price),Qe=Number(Ie.size);Number.isFinite(Le)&&(!Number.isFinite(Qe)||Qe<=0?ve.delete(Le):ve.set(Le,Qe))}};ge("bids",he.bids),ge("asks",he.asks),F()},V.onclose=()=>{l.current=Math.min(l.current+1,6),!o.current&&(o.current=setTimeout(()=>{o.current=null,U(oe)},500*Math.pow(2,l.current)))},V.onerror=()=>{try{V.close()}catch{}}};m.useEffect(()=>{if(a.current)try{a.current.onmessage=null,a.current.onopen=null,a.current.onclose=null,a.current.onerror=null,a.current.close()}catch{}if(a.current=null,o.current&&(clearTimeout(o.current),o.current=null),l.current=0,c.current={bids:new Map,asks:new Map},x({bids:[],asks:[]}),P([]),C(null),e==null)return;U(e);let oe=!1;return(async()=>{const G=await m0n(t||"");oe||(P(G),C(G[0]??null))})(),()=>{oe=!0}},[e,t]);const L=m.useMemo(()=>(f.bids||[]).map(oe=>tD(oe.px)).filter(oe=>Number.isFinite(oe)&&oe>0),[f]),z=m.useMemo(()=>(f.asks||[]).map(oe=>tD(oe.px)).filter(oe=>Number.isFinite(oe)&&oe>0),[f]),Q=L.length?Math.max(...L):null,ne=z.length?Math.min(...z):null;m.useEffect(()=>{Q!=null&&ne!=null&&(s==null||s({bestBid:Q,bestAsk:ne,mid:(Q+ne)/2}))},[Q,ne,s]);const J=m.useMemo(()=>{const oe=Number(w)||1,G=DSe(f.bids,oe,"bid").sort((ee,ae)=>ae.price-ee.price),V=DSe(f.asks,oe,"ask").sort((ee,ae)=>ee.price-ae.price);return{bids:G,asksAsc:V}},[f,w]),X=m.useMemo(()=>{const oe=J.asksAsc.slice(0,n);let G=0;return oe.map(ee=>(G+=I(ee.size,ee.price),{...ee,total:G})).reverse()},[J,n,g]),re=m.useMemo(()=>{const oe=J.bids.slice(0,n);let G=0;return oe.map(V=>(G+=I(V.size,V.price),{...V,total:G}))},[J,n,g]),pe=m.useMemo(()=>{if(Q==null||ne==null)return null;const oe=Math.abs(ne-Q),G=(ne+Q)/2;return{diff:oe,pct:G?oe/G*100:0}},[Q,ne]),Y=Math.max(X.reduce((oe,G)=>Math.max(oe,G.total||0),0),1e-9),ie=Math.max(re.reduce((oe,G)=>Math.max(oe,G.total||0),0),1e-9);return i.jsxs("div",{className:"flex flex-col h-full w-full font-semibold font-inter",children:[i.jsxs("div",{className:"flex items-center justify-between px-3 py-2 border-b border-[#292929]",children:[i.jsx($Se,{value:String(w??""),onChange:oe=>C(Number(oe)),items:(N||[]).map(oe=>({key:String(oe),label:l0n(oe)}))}),i.jsx($Se,{value:g,onChange:v,items:[{key:"USD",label:"USD"},{key:"COIN",label:t||"COIN"}],align:"right"})]}),i.jsxs("div",{className:"grid grid-cols-[84px_1fr_1fr] px-3 py-2 text-[11px] text-[#9b9b9b] w-full",children:[i.jsx("span",{className:"uppercase",children:"Price"}),i.jsxs("span",{className:"uppercase text-center",children:["Size (",R,")"]}),i.jsxs("span",{className:"uppercase text-right",children:["Total (",R,")"]})]}),i.jsx("div",{className:"flex-1 overflow-hidden w-full",children:i.jsxs("div",{className:"overflow-auto w-full",children:[X.map((oe,G)=>i.jsx(BSe,{side:"ask",step:Number(w)||1,price:oe.price,size:oe.size!=null?I(oe.size,oe.price):null,total:oe.total,widthPct:oe.total?Math.min(100,oe.total/Y*100):0,onClick:()=>oe.price!=null&&(r==null?void 0:r(oe.price)),unit:g},`ask-${G}`)),i.jsxs("div",{className:"grid grid-cols-[84px_1fr_1fr] px-3 py-2 text-[11px] text-[#9b9b9b] border-y border-[#292929] my-1 w-full",children:[i.jsx("span",{className:"uppercase",children:"Spread"}),i.jsx("span",{className:"text-right",children:pe?nD(pe.diff,4):"--"}),i.jsx("span",{className:"text-right",children:pe?`${nD(pe.pct,4)}%`:"--"})]}),re.map((oe,G)=>i.jsx(BSe,{side:"bid",step:Number(w)||1,price:oe.price,size:oe.size!=null?I(oe.size,oe.price):null,total:oe.total,widthPct:oe.total?Math.min(100,oe.total/ie*100):0,onClick:()=>oe.price!=null&&(r==null?void 0:r(oe.price)),unit:g},`bid-${G}`))]})})]})}function BSe({side:e,price:t,size:n,total:r,widthPct:s,onClick:a,step:o,unit:l}){const c=t==null,u=e==="bid"?"from-transparent to-[#67ffbd]/30":"from-transparent to-[#FF7272]/30",d=e==="bid"?"text-[#67FFBD]":"text-[#FF797C]",f=l==="USD";return i.jsxs("div",{className:"relative w-full font-semibold",children:[!c&&i.jsx("div",{className:`absolute left-0 top-px bottom-px bg-gradient-to-r ${u} transition-all duration-300 ease-[cubic-bezier(0.42,0,0.58,1)]`,style:{width:`${Math.max(0,s-2)}%`}}),i.jsxs("div",{className:`grid grid-cols-[84px_1fr_1fr] px-3 py-1 text-xs relative w-full ${c?"":"cursor-pointer"}`,onClick:c?void 0:a,children:[i.jsx("span",{className:`${c?"text-[#555]":d} hover:text-white`,children:c?"—":o0n(t,o)}),i.jsx("span",{className:"text-center text-[#dcdada] hover:text-white",children:c?"—":nD(n,f?0:6)}),i.jsx("span",{className:"text-right text-[#a8a8a8] hover:text-white",children:c?"—":nD(r,f?0:6)})]})]})}function $Se({value:e,onChange:t,items:n,align:r="left"}){var l,c;const[s,a]=m.useState(!1),o=m.useRef(null);return m.useEffect(()=>{if(!s)return;const u=d=>{o.current&&(o.current.contains(d.target)||a(!1))};return window.addEventListener("mousedown",u),window.addEventListener("touchstart",u),()=>{window.removeEventListener("mousedown",u),window.removeEventListener("touchstart",u)}},[s]),i.jsxs("div",{className:"relative",ref:o,children:[i.jsxs("button",{className:"h-7 px-2 text-xs rounded-md border border-[#292929] bg-[#101010] text-[#dcdada] flex items-center gap-1",onClick:()=>a(u=>!u),children:[((l=n.find(u=>u.key===e))==null?void 0:l.label)??((c=n.find(u=>String(u.key)===String(e)))==null?void 0:c.label)??e,i.jsx("span",{className:"text-[#8b8b8b]",children:"▾"})]}),s&&i.jsx("div",{className:`absolute z-10 mt-1 min-w-[80px] rounded-md border border-[#292929] bg-[#101010] p-1 ${r==="right"?"right-0":"left-0"}`,children:n.map(u=>i.jsx("div",{className:`px-2 py-1 text-xs rounded cursor-pointer ${String(u.key)===String(e)?"bg-[#262626] text-white":"text-[#dcdada] hover:bg-[#262626]"}`,onClick:()=>{t(u.key),a(!1)},children:u.label},u.key))})]})}const Zu=e=>{const t=Number(e);return Number.isFinite(t)?t:0},USe=(e,t)=>{if(!Number.isFinite(e))return"--";const n=Math.abs(e),r=Math.pow(10,-t);return n>0&&n<r?"0":e.toLocaleString(void 0,{maximumFractionDigits:t})},zSe=(e,t=6)=>isNaN(e)?"--":e.toLocaleString(void 0,{maximumFractionDigits:t}),g0n=(e,t)=>{if(isNaN(e))return"--";const n=Number(t);let r=0;return n>0&&n<1&&(r=Math.min(8,Math.max(0,-Math.floor(Math.log10(n))))),e.toLocaleString(void 0,{minimumFractionDigits:0,maximumFractionDigits:r})},b0n=e=>{if(e>=1)return e.toLocaleString();const t=Math.min(8,Math.max(0,-Math.floor(Math.log10(e))));return e.toFixed(t)},y0n={BTC:{1:{value:1},10:{value:2},20:{value:5},50:{value:10},100:{value:100},1e3:{value:1e3}},ETH:{.1:{value:.1},.2:{value:.2},.5:{value:.5},1:{value:1},10:{value:10},100:{value:100}}},v0n=e=>{if(!e)return null;const t=String(e).toUpperCase(),n=y0n[t];return n?Object.values(n).map(s=>s.value).filter(s=>Number.isFinite(s)&&s>0).sort((s,a)=>s-a):null};function w0n(e){const t=e.toFixed(18).replace(/0+$/g,"").replace(/\.$/,""),n=Number(t);return Number.isFinite(n)?n:0}function C0n(e,t){if(!e||e<=0)return[];const n=Math.floor(Math.log10(e)),r=[];t>0&&r.push(t);const s=n-4,a=Math.pow(10,s);[1,2,5].forEach(g=>r.push(g*a));const o=n-3;r.push(Math.pow(10,o));const l=n-2;r.push(Math.pow(10,l));const c=n-1;r.push(Math.pow(10,c));const u=n;r.push(Math.pow(10,u));const d=r.filter(g=>g>0&&Number.isFinite(g)).map(w0n),f=Array.from(new Set(d)).sort((g,v)=>g-v),x=t>0?t:0;return f.filter(g=>g>=x&&g>0)}function HSe(e){const t=(e||"").toUpperCase();return t==="BTC"?[1,10,20,50,100,1e3,1e4]:t==="ETH"?[.1,.2,.5,1,5,10,50,100]:[1e-4,.001,.01,.1,1,10,100]}async function S0n(e,t){const n=`${e}/info/markets?market=${encodeURIComponent(t)}`,r=await fetch(n);if(!r.ok)throw new Error("markets info request failed");const s=await r.json();return(Array.isArray(s==null?void 0:s.data)?s.data:[])[0]||null}async function N0n(e,t){const n=`${e}/info/markets/${encodeURIComponent(t)}/orderbook`,r=await fetch(n);if(!r.ok)throw new Error("orderbook request failed");const s=await r.json(),a=s==null?void 0:s.data,o=Array.isArray(a==null?void 0:a.bid)?a.bid:[],l=Array.isArray(a==null?void 0:a.ask)?a.ask:[];return{bids:o,asks:l}}async function A0n({apiBaseUrl:e,market:t,baseSymbol:n}){var s,a,o,l;const r=v0n(n);if(r&&r.length)return r;try{const c=await S0n(e,t),u=Zu((s=c==null?void 0:c.tradingConfig)==null?void 0:s.minPriceChange),d=Zu((a=c==null?void 0:c.marketStats)==null?void 0:a.lastPrice)||Zu((o=c==null?void 0:c.marketStats)==null?void 0:o.askPrice)||Zu((l=c==null?void 0:c.marketStats)==null?void 0:l.bidPrice);let f=C0n(d,u);return f=Array.from(new Set(f.filter(x=>Number.isFinite(x)&&x>0))).sort((x,g)=>x-g),f.length?f:HSe(n)}catch{return HSe(n)}}function VSe(e,t,n){const r=new Map;for(const s of e||[]){const a=Zu(s.px),o=Zu(s.sz);if(!a||!o||!t)continue;const l=n==="bid"?Math.floor(a/t)*t:Math.ceil(a/t)*t,c=Number(l.toFixed(12));r.set(c,(r.get(c)||0)+o)}return[...r.entries()].map(([s,a])=>({price:s,size:a}))}function j0n({market:e,baseSymbol:t,rows:n=16,onSelectPrice:r,onBest:s,apiBaseUrl:a="https://express-proxy-delta.vercel.app/proxy?url=https://api.starknet.extended.exchange/api/v1",wsBaseUrl:o="wss://api.starknet.extended.exchange"}){var Ne;const c=m.useRef(null),u=m.useRef(null),d=m.useRef(0),f=m.useRef(null),x=m.useRef({bids:new Map,asks:new Map}),g=m.useRef(!1),v=m.useRef(!0),[w,C]=m.useState({bids:[],asks:[]}),[N,P]=m.useState("COIN"),[I,R]=m.useState(null),[F,U]=m.useState([]),L=(he,ge)=>N==="USD"?he*ge:he,z=N==="USD"?"USD":t?String(t):"COIN";m.useEffect(()=>(v.current=!0,()=>{v.current=!1}),[]);const Q=()=>{g.current||(g.current=!0,requestAnimationFrame(()=>{if(g.current=!1,!v.current)return;const he=x.current;if(!((he==null?void 0:he.bids)instanceof Map)||!((he==null?void 0:he.asks)instanceof Map))return;const ge=1024,ye=Array.from(he.bids.entries()).map(([je,Ie])=>({px:je,sz:Ie})).sort((je,Ie)=>Ie.px-je.px).slice(0,ge),ve=Array.from(he.asks.entries()).map(([je,Ie])=>({px:je,sz:Ie})).sort((je,Ie)=>je.px-Ie.px).slice(0,ge);C({bids:ye,asks:ve})}))},ne=(he,ge)=>{const ye=x.current||{bids:new Map,asks:new Map};ye.bids=new Map,ye.asks=new Map,x.current=ye;for(const ve of he||[]){const je=Zu((ve==null?void 0:ve.p)??(ve==null?void 0:ve.price)),Ie=Zu((ve==null?void 0:ve.q)??(ve==null?void 0:ve.qty));if(!je||!Number.isFinite(Ie)||Ie<=1e-8)continue;const Le=Number(Ie.toFixed(12));Le>1e-8&&ye.bids.set(je,Le)}for(const ve of ge||[]){const je=Zu((ve==null?void 0:ve.p)??(ve==null?void 0:ve.price)),Ie=Zu((ve==null?void 0:ve.q)??(ve==null?void 0:ve.qty));if(!je||!Number.isFinite(Ie)||Ie<=1e-8)continue;const Le=Number(Ie.toFixed(12));Le>1e-8&&ye.asks.set(je,Le)}},J=(he,ge)=>{for(const ye of he||[]){const ve=Zu(ye==null?void 0:ye.p),je=Zu(ye==null?void 0:ye.q);if(!ve||!Number.isFinite(je)||je===0)continue;const Le=Zu(ge.get(ve)||0)+je;if(Math.abs(Le)<=1e-8)ge.delete(ve);else{const Qe=Number(Le.toFixed(12));Qe<=0?ge.delete(ve):ge.set(ve,Qe)}}},X=he=>{if(!he)return;const ge=c.current;if(ge&&(ge.readyState===WebSocket.OPEN||ge.readyState===WebSocket.CONNECTING))return;const ye=`${o}/stream.extended.exchange/v1/orderbooks/${encodeURIComponent(he)}`,ve=new WebSocket(ye);c.current=ve,ve.onopen=()=>{d.current=0,f.current=null},ve.onmessage=je=>{let Ie;try{Ie=JSON.parse(je.data||"{}")}catch{return}const Le=Number(Ie==null?void 0:Ie.seq);if(Number.isFinite(Le)){const ut=f.current;if(ut!=null&&Le!==ut+1){try{ve.close()}catch{}return}f.current=Le}const Qe=String((Ie==null?void 0:Ie.type)||"").toUpperCase(),$e=Ie==null?void 0:Ie.data;if(!$e)return;const it=Array.isArray($e)?$e.find(ut=>String(ut==null?void 0:ut.m)===String(he)):$e;if(!it||String(it==null?void 0:it.m)!==String(he))return;const tt=String((it==null?void 0:it.t)||Qe).toUpperCase(),lt=(it==null?void 0:it.b)||[],ft=(it==null?void 0:it.a)||[];if(tt==="SNAPSHOT")ne(lt,ft);else if(tt==="DELTA"){const ut=x.current;ut!=null&&ut.bids||(ut.bids=new Map),ut!=null&&ut.asks||(ut.asks=new Map),J(lt,ut.bids),J(ft,ut.asks)}else return;Q()},ve.onclose=()=>{d.current=Math.min(d.current+1,6),!u.current&&(u.current=setTimeout(()=>{u.current=null,X(he)},500*Math.pow(2,d.current)))},ve.onerror=()=>{try{ve.close()}catch{}}};m.useEffect(()=>{if(c.current)try{c.current.onmessage=null,c.current.onopen=null,c.current.onclose=null,c.current.onerror=null,c.current.close()}catch{}if(c.current=null,u.current&&(clearTimeout(u.current),u.current=null),d.current=0,f.current=null,x.current={bids:new Map,asks:new Map},C({bids:[],asks:[]}),U([]),R(null),!e)return;let he=!1;return(async()=>{try{const ge=await N0n(a,e);if(he)return;ne(((ge==null?void 0:ge.bids)||[]).map(ye=>({price:ye.price,qty:ye.qty})),((ge==null?void 0:ge.asks)||[]).map(ye=>({price:ye.price,qty:ye.qty}))),Q()}catch{}})(),X(e),(async()=>{const ge=await A0n({apiBaseUrl:a,market:e,baseSymbol:t||e.split("-")[0]});he||(U(ge),R(ge[0]??null))})(),()=>{he=!0}},[e,t,a,o]);const re=m.useMemo(()=>(w.bids||[]).map(he=>Zu(he.px)).filter(he=>Number.isFinite(he)&&he>0),[w]),pe=m.useMemo(()=>(w.asks||[]).map(he=>Zu(he.px)).filter(he=>Number.isFinite(he)&&he>0),[w]),Y=re.length?Math.max(...re):null,ie=pe.length?Math.min(...pe):null;m.useEffect(()=>{Y!=null&&ie!=null&&(s==null||s({bestBid:Y,bestAsk:ie,mid:(Y+ie)/2}))},[Y,ie,s]);const oe=m.useMemo(()=>{const he=Number(I)||1,ge=VSe(w.bids,he,"bid").sort((ve,je)=>je.price-ve.price),ye=VSe(w.asks,he,"ask").sort((ve,je)=>ve.price-je.price);return{bids:ge,asksAsc:ye}},[w,I]),G=m.useMemo(()=>{const he=oe.asksAsc.slice(0,n);let ge=0;return he.map(ve=>(ge+=L(ve.size,ve.price),{...ve,total:ge})).reverse()},[oe,n,N]),V=m.useMemo(()=>{const he=oe.bids.slice(0,n);let ge=0;return he.map(ye=>(ge+=L(ye.size,ye.price),{...ye,total:ge}))},[oe,n,N]),ee=m.useMemo(()=>{if(Y==null||ie==null)return null;const he=Math.abs(ie-Y),ge=(ie+Y)/2;return{diff:he,pct:ge?he/ge*100:0}},[Y,ie]),ae=Math.max(G.reduce((he,ge)=>Math.max(he,ge.total||0),0),1e-9),fe=Math.max(V.reduce((he,ge)=>Math.max(he,ge.total||0),0),1e-9);return i.jsxs("div",{className:"flex flex-col h-full w-full font-semibold font-inter",children:[i.jsxs("div",{className:"flex items-center justify-between px-3 py-2 border-b border-[#292929]",children:[i.jsx(qSe,{value:String(I??""),onChange:he=>R(Number(he)),items:(F||[]).map(he=>({key:String(he),label:b0n(he)}))}),i.jsx(qSe,{value:N,onChange:P,items:[{key:"USD",label:"USD"},{key:"COIN",label:t||((Ne=e==null?void 0:e.split("-"))==null?void 0:Ne[0])||"COIN"}],align:"right"})]}),i.jsxs("div",{className:"grid grid-cols-[84px_1fr_1fr] px-3 py-2 text-[11px] text-[#9b9b9b] w-full",children:[i.jsx("span",{className:"uppercase",children:"Price"}),i.jsxs("span",{className:"uppercase text-center",children:["Size (",z,")"]}),i.jsxs("span",{className:"uppercase text-right",children:["Total (",z,")"]})]}),i.jsx("div",{className:"flex-1 overflow-hidden w-full",children:i.jsxs("div",{className:"overflow-auto w-full",children:[G.map((he,ge)=>i.jsx(WSe,{side:"ask",step:Number(I)||1,price:he.price,size:he.size!=null?L(he.size,he.price):null,total:he.total,widthPct:he.total?Math.min(100,he.total/ae*100):0,onClick:()=>he.price!=null&&(r==null?void 0:r(he.price)),unit:N},`ask-${ge}`)),i.jsxs("div",{className:"grid grid-cols-[84px_1fr_1fr] px-3 py-2 text-[11px] text-[#9b9b9b] border-y border-[#292929] my-1 w-full",children:[i.jsx("span",{className:"uppercase",children:"Spread"}),i.jsx("span",{className:"text-right",children:ee?zSe(ee.diff,4):"--"}),i.jsx("span",{className:"text-right",children:ee?`${zSe(ee.pct,4)}%`:"--"})]}),V.map((he,ge)=>i.jsx(WSe,{side:"bid",step:Number(I)||1,price:he.price,size:he.size!=null?L(he.size,he.price):null,total:he.total,widthPct:he.total?Math.min(100,he.total/fe*100):0,onClick:()=>he.price!=null&&(r==null?void 0:r(he.price)),unit:N},`bid-${ge}`))]})})]})}function WSe({side:e,price:t,size:n,total:r,widthPct:s,onClick:a,step:o,unit:l}){const c=t==null,u=e==="bid"?"from-transparent to-[#67ffbd]/30":"from-transparent to-[#FF7272]/30",d=e==="bid"?"text-[#67FFBD]":"text-[#FF797C]",x=l==="USD"?2:8;return i.jsxs("div",{className:"relative w-full font-semibold",children:[!c&&i.jsx("div",{className:`absolute left-0 top-px bottom-px bg-gradient-to-r ${u} transition-all duration-300 ease-[cubic-bezier(0.42,0,0.58,1)]`,style:{width:`${Math.max(0,s-2)}%`}}),i.jsxs("div",{className:`grid grid-cols-[84px_1fr_1fr] px-3 py-1 text-xs relative w-full ${c?"":"cursor-pointer"}`,onClick:c?void 0:a,children:[i.jsx("span",{className:`${c?"text-[#555]":d} hover:text-white`,children:c?"—":g0n(t,o)}),i.jsx("span",{className:"text-center text-[#dcdada] hover:text-white",children:c?"—":USe(n,x)}),i.jsx("span",{className:"text-right text-[#a8a8a8] hover:text-white",children:c?"—":USe(r,x)})]})]})}function qSe({value:e,onChange:t,items:n,align:r="left"}){var l,c;const[s,a]=m.useState(!1),o=m.useRef(null);return m.useEffect(()=>{if(!s)return;const u=d=>{o.current&&(o.current.contains(d.target)||a(!1))};return window.addEventListener("mousedown",u),window.addEventListener("touchstart",u),()=>{window.removeEventListener("mousedown",u),window.removeEventListener("touchstart",u)}},[s]),i.jsxs("div",{className:"relative",ref:o,children:[i.jsxs("button",{className:"h-7 px-2 text-xs rounded-md border border-[#292929] bg-[#101010] text-[#dcdada] flex items-center gap-1",onClick:()=>a(u=>!u),children:[((l=n.find(u=>u.key===e))==null?void 0:l.label)??((c=n.find(u=>String(u.key)===String(e)))==null?void 0:c.label)??e,i.jsx("span",{className:"text-[#8b8b8b]",children:"▾"})]}),s&&i.jsx("div",{className:`absolute z-10 mt-1 min-w-[80px] rounded-md border border-[#292929] bg-[#101010] p-1 ${r==="right"?"right-0":"left-0"}`,children:n.map(u=>i.jsx("div",{className:`px-2 py-1 text-xs rounded cursor-pointer ${String(u.key)===String(e)?"bg-[#262626] text-white":"text-[#dcdada] hover:bg-[#262626]"}`,onClick:()=>{t(u.key),a(!1)},children:u.label},u.key))})]})}const iF="#67FFBD",E0n={type:"spring",stiffness:260,damping:26,mass:1},JHe=e=>{const t=Number(e);return Number.isFinite(t)?t:null},eg=(...e)=>{for(const t of e){const n=JHe(t);if(n!=null)return n}return null},_0n=e=>{const t=JHe(e);return t==null?null:Math.abs(t)>1?t/100:t};function sj({title:e,subtitle:t}){return i.jsx("div",{className:"w-full h-full flex items-center justify-center px-4",children:i.jsxs("div",{className:"text-center",children:[i.jsx("div",{className:"text-sm text-white font-semibold mb-1",children:e}),i.jsx("div",{className:"text-xs text-white/50",children:t})]})})}function aF({code:e,onCodeChange:t,onSubmit:n,loading:r,checking:s,message:a}){const o=r||s||!e.trim();return i.jsxs("div",{className:"relative h-full w-full flex justify-center overflow-hidden rounded-[16px] bg-black",children:[i.jsx(vo.div,{className:"pointer-events-none absolute -inset-[40%] opacity-80 blur-3xl",style:{background:"radial-gradient(circle at 15% 0%, rgba(103,255,189,0.32), transparent 55%), radial-gradient(circle at 85% 100%, rgba(103,255,189,0.24), transparent 60%)"},initial:{x:"-4%",y:"-8%"},animate:{x:["-4%","4%","-2%","-4%"],y:["-8%","6%","2%","-8%"]},transition:{duration:24,repeat:1/0,ease:"easeInOut"}}),i.jsxs(vo.div,{initial:{opacity:0,y:16,scale:.96},animate:{opacity:1,y:0,scale:1},transition:{duration:.5,ease:[.16,1,.3,1]},className:"relative z-10 w-full max-w-[460px] rounded-2xl border border-[#17211b] bg-[#050505] shadow-[0_30px_90px_rgba(0,0,0,0.9)] overflow-hidden",children:[i.jsxs("div",{className:"relative",children:[i.jsx("div",{className:"absolute inset-0 pointer-events-none opacity-50",children:i.jsx("div",{className:"w-full h-full",style:{background:"radial-gradient(900px 500px at 50% -10%, rgba(103,255,189,0.45), transparent 70%)"}})}),i.jsx("video",{src:QN,autoPlay:!0,muted:!0,loop:!0,playsInline:!0,preload:"auto",className:"w-full h-[260px] object-cover bg-black"},QN)]}),i.jsxs("div",{className:"px-5 pb-5 pt-4 space-y-4",children:[i.jsxs("div",{className:"space-y-1",children:[i.jsx("div",{className:"text-[11px] font-medium tracking-[0.18em] uppercase",style:{color:iF},children:"Early Access"}),i.jsxs("div",{className:"text-lg font-semibold",children:["Enter ",i.jsx("span",{style:{color:iF},children:"Alpha Code"})]}),i.jsx("p",{className:"text-[12px] text-white/60",children:"Grid Bot is currently in private alpha. Enter your invitation code to unlock this feature in your account."})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("label",{className:"text-[11px] text-white/45",children:"Alpha Code"}),i.jsxs("div",{className:"flex gap-2",children:[i.jsx("input",{type:"text",value:e,onChange:l=>t(l.target.value.toUpperCase()),onKeyDown:l=>{l.key==="Enter"&&(l.preventDefault(),n())},placeholder:"DXTR-XXXXX",autoComplete:"off",spellCheck:!1,className:"flex-1 h-10 px-3 rounded-md bg-[#050505] border border-[#1e2e27] text-[13px] tracking-[0.18em] font-mono text-white placeholder:text-white/20 focus:outline-none focus:border-[#67FFBD]"}),i.jsx("button",{type:"button",onClick:n,disabled:o,className:`h-10 px-4 rounded-md text-[13px] font-semibold transition-colors ${o?"bg-[#101613] text-white/40 cursor-not-allowed":"text-black hover:opacity-90"}`,style:o?void 0:{backgroundColor:iF},children:r?"Checking…":"Access"})]})]}),(s||a)&&i.jsxs("div",{className:"text-[11px] min-h-[16px]",children:[s&&!a&&i.jsx("span",{className:"text-white/40",children:"Checking your eligibility…"}),a&&i.jsx("span",{style:{color:iF},children:a})]})]})]})]})}function k0n({data:e,loading:t,error:n,coin:r,setCoin:s,period:a,periods:o,handlePeriodChange:l}){var Xn,or,lr,Qt,zn,Jn;const c=Vo(),u=oc(),{exchange:d,coin:f}=t5(),{address:x,isConnected:g}=ns(),{setSignInConnectButtonOpen:v}=m.useContext(Qr),[w,C]=m.useState("single"),[N,P]=m.useState("BTC/ETH"),[I,R]=m.useState([]),[F,U]=m.useState(2),[L,z]=m.useState("1m"),[Q,ne]=m.useState(null),[J,X]=m.useState(null),[re,pe]=m.useState({}),[Y,ie]=m.useState({id:null,address:null}),[oe,G]=m.useState(!1),[V,ee]=m.useState(!1),[ae,fe]=m.useState(()=>typeof window>"u"||window.location.hash==="#gridbot"?"grid":window.location.hash==="#trade"?"trade":"grid"),[Ne,he]=m.useState([]),[ge,ye]=m.useState(()=>d==="lighter"?"lighter":d==="extended"?"extended":"hyperliquid"),[ve,je]=m.useState(()=>r||f||"BTC"),[Ie,Le]=m.useState(()=>d==="lighter"&&f||"BTC"),[Qe,$e]=m.useState(()=>d==="extended"&&f||"BTC"),[it,tt]=m.useState(null),[lt,ft]=m.useState(!1),[ut,qt]=m.useState(null),[It,nn]=m.useState(!1),[jt,cn]=m.useState(null),[un,Ft]=m.useState(!1),[Ke,Bt]=m.useState({address:null,token:null}),[$t,qe]=m.useState(!1),[Ye,ht]=m.useState(!1),[Zt,zt]=m.useState(!1),[Et,nt]=m.useState(!1),[Ue,Rt]=m.useState(""),[We,at]=m.useState(!1),[mt,Dt]=m.useState(""),Tt=m.useRef(null),dn=m.useRef(null),on=typeof window<"u"&&window.matchMedia("(max-width: 768px)").matches,gn=Lt=>z(Lt),Nn=gU(),kn=jue(),yn=Eue(),Vn=ge==="hyperliquid"?Nn:ge==="lighter"?kn:yn,Gn=ge==="hyperliquid"?!Nn.length:ge==="lighter"?!kn.length:!yn.length,Dn=ge==="hyperliquid"?ve:ge==="lighter"?Ie:Qe,Kn=ge==="hyperliquid"&&w==="pair"?N:Dn,Cn=ge==="hyperliquid"&&w==="pair"&&N.split("/")[0]||ve,sn=m.useMemo(()=>ge==="lighter"&&Dn?kn.find(Lt=>Lt.symbol===Dn):null,[ge,kn,Dn]),Me=(sn==null?void 0:sn.marketIndex)??(sn==null?void 0:sn.market_id)??(sn==null?void 0:sn.id)??((Xn=sn==null?void 0:sn.raw)==null?void 0:Xn.marketIndex)??((or=sn==null?void 0:sn.raw)==null?void 0:or.market_id)??((lr=sn==null?void 0:sn.raw)==null?void 0:lr.id)??null,en=m.useMemo(()=>{if(!Dn)return null;const Lt=String(Dn||"").toUpperCase(),jn=Lt.replace(/-USD$/,"");return yn.find(Ee=>{const h=String((Ee==null?void 0:Ee.symbol)||"").toUpperCase(),p=String((Ee==null?void 0:Ee.rawSymbol)||"").toUpperCase();return h===Lt||p===Lt||h===jn||p===jn})||null},[yn,Dn]),an=m.useMemo(()=>{if(en!=null&&en.rawSymbol)return en.rawSymbol;if(!Dn)return"";const Lt=String(Dn||"").toUpperCase();return Lt.includes("-")?Lt:`${Lt}-USD`},[en,Dn]),Nt=m.useMemo(()=>en!=null&&en.symbol?en.symbol:Dn?String(Dn||"").toUpperCase().replace(/-USD$/,"").replace(/\/USD$/,""):"",[en,Dn]),Yn=m.useMemo(()=>{const Lt=(en==null?void 0:en.lastPrice)??(en==null?void 0:en.last);if(Lt!=null&&Number.isFinite(Number(Lt)))return Number(Lt);const jn=en==null?void 0:en.marketStats,Ee=(jn==null?void 0:jn.lastPrice)??(jn==null?void 0:jn.markPrice)??(en==null?void 0:en.markPrice)??null;return Ee!=null&&Number.isFinite(Number(Ee))?Number(Ee):null},[en]);m.useEffect(()=>{u.hash==="#gridbot"?fe("grid"):u.hash==="#trade"?fe("trade"):u.hash||fe("grid")},[u.hash]),m.useEffect(()=>{d==="lighter"&&ge!=="lighter"?ye("lighter"):d==="hyperliquid"&&ge!=="hyperliquid"?ye("hyperliquid"):d==="extended"&&ge!=="extended"&&ye("extended")},[d,ge]),m.useEffect(()=>{d==="hyperliquid"?f&&f!==ve&&(je(f),s(f)):d==="lighter"?f&&f!==Ie&&Le(f):d==="extended"&&f&&f!==Qe&&$e(f)},[d,f,ve,Ie,Qe,s]),m.useEffect(()=>{const Lt=()=>{if(typeof window>"u")return;const jn=window.localStorage.getItem("hyperAddress"),Ee=window.localStorage.getItem("hyperToken");Bt({address:jn,token:Ee})};return Lt(),window.addEventListener("localStorageUpdated",Lt),window.addEventListener("storage",Lt),()=>{window.removeEventListener("localStorageUpdated",Lt),window.removeEventListener("storage",Lt)}},[]);const xn=m.useMemo(()=>!Ke.address||!Ke.token?!1:on?!0:x?Ke.address.toLowerCase()===x.toLowerCase():!1,[Ke.address,Ke.token,x,on]);m.useEffect(()=>{if(!xn){qe(!1),ht(!1),zt(!1),nt(!1),Rt(""),Dt("");return}if($t)return;let Lt=!1;return(async()=>{if(typeof window>"u")return;const Ee=window.localStorage.getItem("hyperToken"),h=window.localStorage.getItem("hyperAddress");if(!Ee||!h){Lt||(qe(!0),ht(!1),zt(!1));return}nt(!0);try{const p=await Ei(h.toLowerCase(),Ee);if(Lt)return;const S=(p==null?void 0:p.data)||p||{},_=(S==null?void 0:S.data)||S||{},k=_.grid_hyper_alpha_code??S.grid_hyper_alpha_code??!1,T=_.grid_lighter_alpha_code??S.grid_lighter_alpha_code??!1;ht(!k),zt(!T),qe(!0)}catch{Lt||(ht(!1),zt(!1),qe(!0))}finally{Lt||nt(!1)}})(),()=>{Lt=!0}},[xn,$t]),m.useEffect(()=>{xn&&qe(!1)},[ge,xn]),m.useEffect(()=>{(ge!=="lighter"||ae!=="grid")&&(Rt(""),Dt(""))},[ge,ae]);const Mt=async()=>{var Lt,jn,Ee,h;if(!Ue.trim()){rn.error("Please enter your alpha code");return}if(!Ke.address||!Ke.token){rn.error("Please sign in again");return}at(!0),Dt("");try{const p={address:Ke.address.toLowerCase(),token:Ke.token,alpha_code:Ue.trim(),source_market:ge==="hyperliquid"?"hyper":"lighter",app_type:"grid_bot"},_=(await fs.post("https://dextrabothypev2.nftinit.io/api/subscriber/alpha_code/set/",p)).data||{};if(_.success){const k=_.message||"Alpha code added successfully";rn.success(k),Dt(k),ge==="hyperliquid"?ht(!1):ge==="lighter"&&zt(!1),qe(!0)}else{const k=_.error_message||_.message||"This alpha code is invalid";rn.error(k),Dt(k)}}catch(p){const S=((jn=(Lt=p==null?void 0:p.response)==null?void 0:Lt.data)==null?void 0:jn.error_message)||((h=(Ee=p==null?void 0:p.response)==null?void 0:Ee.data)==null?void 0:h.message)||p.message||"Failed to validate alpha code";rn.error(S),Dt(S)}finally{at(!1)}};m.useEffect(()=>{ge==="hyperliquid"?s(ve):ge==="lighter"?!Ie&&kn.length>0&&Le(kn[0].symbol):ge==="extended"&&!Qe&&yn.length>0&&$e(yn[0].symbol)},[ge,ve,Ie,Qe,kn,yn,s]),m.useEffect(()=>{if(ge!=="extended"||!yn.length)return;const Lt=yn.some(jn=>jn.symbol===Qe);(!Qe||!Lt)&&$e(yn[0].symbol)},[ge,Qe,yn]),m.useEffect(()=>{if(!x){if(on&&Ke.address){ie(Lt=>Lt.address&&Lt.address.toLowerCase()===Ke.address.toLowerCase()?Lt:{id:null,address:Ke.address});return}ie(Lt=>Lt.address?{id:null,address:null}:Lt);return}ie(Lt=>Lt.address&&Lt.address.toLowerCase()===x.toLowerCase()?Lt:{id:null,address:x})},[x,Ke.address,on]),m.useEffect(()=>{if(ge!=="hyperliquid"){if(Tt.current){try{Tt.current.close()}catch{}Tt.current=null}R([]),dn.current=null;return}if(!Cn)return;const Lt=(jn,Ee)=>{if(jn)try{jn.readyState===WebSocket.OPEN&&jn.send(JSON.stringify(Ee))}catch(h){console.error("activeAssetCtx ws send error",h)}};if(Tt.current){const jn=Tt.current;dn.current&&dn.current!==Cn&&Lt(jn,{method:"unsubscribe",subscription:{type:"activeAssetCtx",coin:dn.current}}),Lt(jn,{method:"subscribe",subscription:{type:"activeAssetCtx",coin:Cn}})}else{const jn=new WebSocket("wss://api-ui.hyperliquid.xyz/ws");Tt.current=jn,jn.onopen=()=>{Lt(jn,{method:"subscribe",subscription:{type:"activeAssetCtx",coin:Cn}})},jn.onmessage=Ee=>{var p;let h;try{h=JSON.parse(Ee.data)}catch(S){console.error("activeAssetCtx ws parse error",S);return}(p=h==null?void 0:h.data)!=null&&p.ctx&&R({...h.data.ctx,source:"hyperliquid"})},jn.onclose=()=>{Tt.current===jn&&(Tt.current=null)},jn.onerror=Ee=>{console.error("activeAssetCtx ws error",Ee)}}dn.current=Cn},[Cn,ge]),m.useEffect(()=>()=>{Tt.current&&(Tt.current.close(),Tt.current=null)},[]),m.useEffect(()=>{if(ge!=="lighter")return;if(!Dn){R([]);return}const Lt=kn.find(k=>k.symbol===Dn);if(!Lt||!Lt.raw){R([]);return}const jn=Lt.raw,Ee=Number(jn.last_trade_price??0)||0,h=Number(jn.daily_price_change??0)||0,p=Number(jn.daily_quote_token_volume??0)||0,S=Number(jn.open_interest??0)||0,_=h&&Ee?Ee/(1+h/100):Ee;R({markPx:Ee,oraclePx:Ee,prevDayPx:_,dayNtlVlm:p,openInterest:S,funding:0,source:"lighter"})},[ge,Dn,kn]),m.useEffect(()=>{if(ge!=="extended")return;if(!en){R([]);return}const Lt=en.marketStats||{},jn=eg(Lt.markPrice,Lt.lastPrice,Lt.indexPrice,en.markPrice,en.lastPrice,en.last),Ee=eg(Lt.indexPrice,Lt.markPrice,Lt.lastPrice,en.indexPrice,jn),h=eg(Lt.dailyPriceChange,en.dailyPriceChange),p=eg(Lt.dailyPriceChangePercentage,en.dailyPriceChangePercentage,en.change24hPct,en.chg24),S=_0n(p);let _=null;if(jn!=null){if(h!=null){const de=jn-h;Number.isFinite(de)&&de>0&&(_=de)}if(_==null&&S!=null){const de=1+S;if(Number.isFinite(de)&&de!==0){const xe=jn/de;Number.isFinite(xe)&&xe>0&&(_=xe)}}}const k=eg(Lt.dailyVolume,en.volume,en.vol),T=eg(Lt.openInterestBase,en.openInterestBase),B=eg(Lt.openInterest,en.openInterestUsd,en.openInterest);let q=T;q==null&&B!=null&&Ee!=null&&Ee>0&&(q=B/Ee);const te=eg(Lt.fundingRate,en.fundingRate,en.funding),ue=eg(Lt.nextFundingRate,en.nextFundingRate);R({markPx:jn,oraclePx:Ee,prevDayPx:_,dayNtlVlm:k,openInterest:q,funding:te,nextFundingTime:ue,source:"extended"})},[ge,en]),m.useEffect(()=>{ge==="hyperliquid"&&he([])},[ge]),m.useEffect(()=>{ge==="lighter"&&(ne(null),X(null))},[ge]),m.useEffect(()=>{if(ge!=="lighter"){tt(null);return}if(!g||!x){tt(null);return}let Lt=!1;return(async()=>{if(typeof window>"u")return;const Ee=Ke.address,h=Ke.token;if(!Ee||!h){Lt||tt(null);return}if(Ee.toLowerCase()!==x.toLowerCase()){Lt||tt(null);return}ft(!0);try{const p=await fs.post("https://dextrabothypev2.nftinit.io/api/wallet/list-lighter",{address:Ee,token:h});if(Lt)return;const S=p.data;let _=[];if(Array.isArray(S)?_=S:S&&Array.isArray(S.data)?_=S.data:S&&S.wallet_id!=null&&(_=[S]),!_.length)tt(null);else{const k=_[0],T={id:k.wallet_id,address:k.wallet_address,name:k.wallet_name};tt(T),ie({id:T.id,address:T.address})}}catch{Lt||tt(null)}finally{Lt||ft(!1)}})(),()=>{Lt=!0}},[ge,g,x,Ke.address,Ke.token]),m.useEffect(()=>{if(ge!=="extended"){qt(null);return}const Lt=Ke.address,jn=Ke.token;if(!Lt||!jn){qt(null);return}if(!on&&x&&Lt.toLowerCase()!==x.toLowerCase()){qt(null);return}let Ee=!1;return(async()=>{nn(!0);try{const p=await fs.post("https://dextrabothypev2.nftinit.io/api/wallet/list-extended",{address:Lt,token:jn});if(Ee)return;const S=p.data;let _=[];if(Array.isArray(S)?_=S:S&&Array.isArray(S.data)?_=S.data:S&&S.wallet_id!=null&&(_=[S]),!_.length)qt(null);else{const k=_[0],T={id:k.wallet_id,address:k.wallet_address,name:k.wallet_name};qt(T),ie({id:T.id,address:T.address})}}catch{Ee||qt(null)}finally{Ee||nn(!1)}})(),()=>{Ee=!0}},[ge,Ke.address,Ke.token,x,on]),m.useEffect(()=>{if(ge!=="hyperliquid"){cn(null);return}if(!g||!x){cn(null);return}let Lt=!1;return(async()=>{if(typeof window>"u")return;const Ee=Ke.address,h=Ke.token;if(!Ee||!h){Lt||cn(null);return}if(Ee.toLowerCase()!==x.toLowerCase()){Lt||cn(null);return}Ft(!0);try{const p=await fs.post("https://dextrabothypev2.nftinit.io/api/wallet/confirmed-list",{address:Ee,token:h});if(Lt)return;const S=p.data;let _=!1;Array.isArray(S)?_=S.length>0:S&&Array.isArray(S.data)?_=S.data.length>0:S&&S.wallet_id!=null&&(_=!0),cn(_)}catch{Lt||cn(null)}finally{Lt||Ft(!1)}})(),()=>{Lt=!0}},[ge,g,x,Ke.address,Ke.token]);const tn=Lt=>{if(w==="pair")return;const jn=ae==="grid"?"#gridbot":"#trade";ge==="hyperliquid"?(je(Lt),s(Lt),c(`/terminal/hyperliquid/${Lt}${jn}`)):ge==="lighter"?(Le(Lt),c(`/terminal/lighter/${Lt}${jn}`)):($e(Lt),c(`/terminal/extended/${Lt}${jn}`))},In=()=>{typeof window>"u"||window.open("/dca-bot","_blank","noopener,noreferrer")};return i.jsxs("div",{className:"w-full min-h-screen bg-[#050505] text-white font-manrope p-2 mb-6",children:[i.jsx("div",{className:"flex items-center gap-2 mb-4",children:i.jsxs("div",{className:"inline-flex bg-[#161616] rounded-full p-1 text-[11px]",children:[i.jsxs("div",{className:"flex justify-center items-center",children:[i.jsx("img",{src:"https://i.imgflip.com/7zho2e.png",className:"w-4 h-4 mr-1 ml-2",alt:""}),i.jsx("button",{onClick:()=>{const Lt=ve||r||"BTC";fe("grid"),ye("hyperliquid"),c(`/terminal/hyperliquid/${Lt}#gridbot`)},className:`px-3 py-1 rounded-full transition mr-2 ${ge==="hyperliquid"?"bg-white text-black":"text:white/60 text-white/60 hover:text-white"}`,children:"Hyperliquid"})]}),i.jsxs("div",{className:"flex justify-center items-center mr-2",children:[i.jsx(Xf,{className:"w-4 h-4 text-[#fff] mr-1"}),i.jsx("button",{onClick:()=>{const Lt=Ie||"BTC";fe("grid"),ye("lighter"),c(`/terminal/lighter/${Lt}#gridbot`)},className:`px-3 py-1 rounded-full transition ${ge==="lighter"?"bg:white bg-white text-black":"text:white/60 text-white/60 hover:text-white"}`,children:"Lighter"})]}),i.jsxs("div",{className:"flex justify-center items-center",children:[i.jsx("img",{src:"https://app.extended.exchange/assets/favicon/favicon-32x32.png",className:"w-4 h-4 mr-1",alt:""}),i.jsx("button",{onClick:()=>{const Lt=Qe||"BTC";fe("grid"),ye("extended"),c(`/terminal/extended/${Lt}#gridbot`)},className:`px-3 py-1 rounded-full transition ${ge==="extended"?"bg-white text-black":"text:white/60 text-white/60 hover:text-white"}`,children:"Extended"})]})]})}),i.jsx(vo.div,{className:"fixed inset-0 pointer-events-none z-10",initial:{opacity:.14},animate:{opacity:0},transition:{duration:.9,ease:[.16,1,.3,1]},style:{background:"radial-gradient(1200px 600px at 50% 8%, rgba(255,255,255,0.08), rgba(0,0,0,0) 60%)"}}),i.jsx(i.Fragment,{children:i.jsxs("div",{className:"flex flex-col gap-1 xl:flex-row w-full min-w-0",children:[i.jsxs("div",{className:"flex flex-col gap-1 w-full min-w-0 xl:flex-1",children:[i.jsx(vo.div,{className:"xl:hidden bg-[#101010] border border-[#292929] px-2 rounded-[16px]",children:i.jsx("div",{className:"flex items-center justify-between w-full",children:i.jsx(Ffn,{coin:Dn,data:(Qt=e.position_info)==null?void 0:Qt[0],setIsDigits:U,headerData:I,active:L,onCoinChange:tn,markets:Vn,marketsLoading:Gn,mode:w,pairKey:N,onPairChange:P})})}),i.jsxs("div",{className:"flex flex-col gap-1 xl:grid xl:h-[600px] rounded-[16px]",style:{gridTemplateColumns:oe?"minmax(0,1fr) 24px":"minmax(0,1fr) 300px"},children:[i.jsxs(vo.div,{className:"relative bg-[#101010] border border-[#292929] overflow-hidden min-w-0 h-[420px] sm:h-[500px] xl:h-full rounded-[16px] flex flex-col",children:[i.jsx("div",{className:"hidden xl:flex h-[56px] w-full items-center justify-between px-2 border-b border-[#292929]",children:i.jsx(Xdn,{coin:Dn,data:(zn=e.position_info)==null?void 0:zn[0],setIsDigits:U,headerData:I,handleClick:gn,active:L,onCoinChange:tn,mode:w,pairKey:N,onPairChange:P,markets:Vn,market:ge})}),i.jsx("div",{className:"flex-1 min-h-0",children:ge==="hyperliquid"?i.jsx(jX,{coin:Kn,interval:L,walletAddress:Y==null?void 0:Y.address,gridLines:ae==="grid"?Ne:[],market:"hyperliquid"},`hl-${Kn}-${L}`):ge==="lighter"?i.jsx(jX,{coin:Dn,interval:"1h",walletAddress:Y==null?void 0:Y.address,gridLines:ae==="grid"?Ne:[],market:"lighter",lighterMarketId:Me},`lighter-${Dn}-${L}-${Me||"x"}`):i.jsx(jX,{coin:Dn,interval:L,walletAddress:Y==null?void 0:Y.address,gridLines:ae==="grid"?Ne:[],market:"extended",extendedMarket:an,extendedLastPrice:Yn},`extended-${Dn}-${L}-${an||"x"}`)})]}),i.jsxs(vo.div,{className:"hidden sm:flex w-full xl:h-full xl:min-h-0 relative rounded-[16px]",children:[!oe&&i.jsxs("div",{className:"group relative w-full h-full bg-[#101010] border border-[#292929] rounded-[16px] overflow-hidden",children:[i.jsx("button",{onClick:()=>G(!0),className:"hidden xl:flex absolute left-0 top-1/2 -translate-y-1/2 -translate-x-1/2 z-20 opacity-0 pointer-events-none group-hover:opacity-100 group-hover:pointer-events-auto transition-opacity bg-transparent",children:i.jsx("div",{className:"w-6 h-6 rounded-full bg-[#161616] border border-r-0 border-[#292929] flex items-center justify-center shadow",children:i.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",children:i.jsx("path",{d:"M9 6l6 6-6 6",stroke:"#CFCFCF",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})}),ge==="hyperliquid"?i.jsx(nhn,{className:"w-full xl:h-full xl:min-h-0 overflow-y-auto",coin:r,data:t?[]:(Jn=e.position_info)==null?void 0:Jn[0],loading:t,period:a,periods:o,handlePeriodChange:l,onBookPrice:Lt=>ne(Lt),onBest:({mid:Lt})=>X(Lt)}):ge==="lighter"?Me!=null?i.jsx(x0n,{marketId:Me,baseSymbol:Dn,rows:10,onSelectPrice:Lt=>ne(Lt),onBest:({mid:Lt})=>X(Lt)}):i.jsx(sj,{title:"Lighter Order Book",subtitle:"Select a market to see the order book"}):i.jsx(j0n,{market:an,baseSymbol:Nt||Dn,rows:10,onSelectPrice:Lt=>ne(Lt),onBest:({mid:Lt})=>X(Lt)})]}),oe&&i.jsxs("div",{className:"group relative w-[24px] h-full bg-[#101010] border border-[#292929] rounded-[16px] flex items-center justify-center",children:[i.jsx("button",{onClick:()=>G(!1),className:"hidden xl:flex absolute left-0 top-1/2 -translate-y-1/2 -translate-x-1/2 z-20 opacity-0 pointer-events-none group-hover:opacity-100 group-hover:pointer-events-auto transition-opacity bg-transparent",children:i.jsx("div",{className:"w-6 h-6 rounded-full bg-[#161616] border border-r-0 border-[#292929] flex items-center justify-center shadow",children:i.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",className:"rotate-180",children:i.jsx("path",{d:"M9 6l6 6-6 6",stroke:"#CFCFCF",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})}),i.jsx("div",{className:"-rotate-90 whitespace-nowrap text-[11px] tracking-wide text-[#BFBFBF]",children:"Position / Order Book / Trades"})]})]})]}),i.jsxs(vo.div,{className:"xl:hidden bg-[#101010] border border-[#292929] rounded-[16px]",children:[i.jsx("div",{className:"flex items-center justify-center pt-3 pb-2",children:i.jsxs("div",{className:"inline-flex bg-[#161616] rounded-full p-1 text-xs",children:[i.jsx("button",{onClick:()=>{const Lt=ge==="hyperliquid"?ve||r||"BTC":ge==="lighter"?Ie||"BTC":Qe||"BTC";he([]),fe("trade"),c(`/terminal/${ge}/${Lt}#trade`)},className:`px-3 py-1 rounded-full transition ${ae==="trade"?"bg-white text-black":"text-white/60 hover:text-white"}`,children:"Trade"}),i.jsx("button",{onClick:()=>{const Lt=ge==="hyperliquid"?ve||r||"BTC":ge==="lighter"?Ie||"BTC":Qe||"BTC";fe("grid"),c(`/terminal/${ge}/${Lt}#gridbot`)},className:`px-3 py-1 rounded-full transition ${ae==="grid"?"bg-white text-black":"text-white/60 hover:text-white"}`,children:ge==="hyperliquid"?"HL Grid Bot":ge==="lighter"?"Lighter Grid Bot":"Extended Grid Bot"}),ge==="extended"&&i.jsx("button",{onClick:In,className:"px-3 py-1 rounded-full transition text-white/60 hover:text-white",children:"DCA Bot"})]})}),i.jsx("div",{className:"min-h-[260px]",children:ae==="trade"?ge==="hyperliquid"?i.jsx(bSe,{coin:r,midPrice:J,selectedPrice:Q,maxLeverage:re[r]||25,wallet:Y,onWalletChange:ie,uiMode:w,pairKey:N},`trade-${Y.address}`):ge==="lighter"?i.jsx("div",{className:"h-[260px]",children:i.jsx(sj,{title:"Lighter Perp Trading",subtitle:"Coming Soon"})}):i.jsx("div",{className:"h-[260px]",children:i.jsx(sj,{title:"Extended Perp Trading",subtitle:"Coming Soon"})}):ge==="hyperliquid"?un||Et?i.jsx("div",{className:"w-full h-full flex items-center justify-center text-xs text-white/60",children:"Loading Hyperliquid account…"}):xn?Ye?i.jsx(aF,{code:Ue,onCodeChange:Rt,onSubmit:Mt,loading:We,checking:Et,message:mt}):jt===!1?i.jsx("div",{className:"w-full h-full flex items-center justify-center py-6",children:i.jsx("button",{onClick:()=>window.open("/wallet-management#hyperliquid","_blank","noopener,noreferrer"),className:"px-4 py-2 rounded-full bg-white text-black text-xs font-semibold",children:"Create HL Account"})}):i.jsx(OSe,{coin:Dn,midPrice:J,selectedPrice:Q,wallet:Y,onWalletChange:ie,onLevelsChange:he}):i.jsxs("div",{className:"w-full h-full flex flex-col items-center justify-center gap-3 px-4 py-6",children:[i.jsx("p",{className:"text-[13px] text-[#9BA1A6] text-center",children:"Connect your wallet to use Hyperliquid Grid Bot"}),i.jsx("div",{className:"w-[220px]",children:i.jsx(Zp,{onClick:()=>v(!0)})})]}):ge==="lighter"?lt||Et?i.jsx("div",{className:"w-full h-full flex items-center justify-center text-xs text-white/60 py-6",children:"Loading Lighter account…"}):xn?Zt?i.jsx(aF,{code:Ue,onCodeChange:Rt,onSubmit:Mt,loading:We,checking:Et,message:mt}):it?i.jsx(PSe,{coin:Dn,midPrice:J,selectedPrice:Q,wallet:Y,onLevelsChange:he}):i.jsx("div",{className:"w-full h-full flex items-center justify-center py-6",children:i.jsx("button",{onClick:()=>window.open("/wallet-management#lighter","_blank","noopener,noreferrer"),className:"px-4 py-2 rounded-full bg-white text-black text-xs font-semibold",children:"Create Lighter Account"})}):i.jsxs("div",{className:"w-full h-full flex flex-col items-center justify-center gap-3 px-4 py-6",children:[i.jsx("p",{className:"text-[13px] text-[#9BA1A6] text-center",children:"Connect your wallet to use Lighter Grid Bot"}),i.jsx("div",{className:"w-[220px]",children:i.jsx(Zp,{onClick:()=>v(!0)})})]}):It?i.jsx("div",{className:"w-full h-full flex items-center justify-center text-xs text-white/60 py-6",children:"Loading Extended account…"}):xn?ut?i.jsx(RSe,{coin:Dn,midPrice:J,selectedPrice:Q,wallet:Y,onLevelsChange:he}):i.jsx("div",{className:"w-full h-full flex items-center justify-center py-6",children:i.jsx("button",{onClick:()=>window.open("/wallet-management#extended","_blank","noopener,noreferrer"),className:"px-4 py-2 rounded-full bg-white text-black text-xs font-semibold",children:"Create Extended Account"})}):i.jsxs("div",{className:"w-full h-full flex flex-col items-center justify-center gap-3 px-4 py-6",children:[i.jsx("p",{className:"text-[13px] text-[#9BA1A6] text-center",children:"Connect your wallet to use Extended Grid Bot"}),i.jsx("div",{className:"w-[220px]",children:i.jsx(Zp,{onClick:()=>v(!0)})})]})})]}),ge==="lighter"&&xn&&i.jsx(vo.div,{className:"xl:hidden bg-[#101010] border border-[#292929] rounded-[16px] overflow-hidden",children:i.jsx(IO,{walletAddress:Y==null?void 0:Y.address,sourceMarket:"lighter"})}),i.jsx(vo.div,{className:"h-[500px] bg-[#101010] border border-[#292929] overflow-hidden rounded-[16px]",children:ge==="hyperliquid"?i.jsx(Fmn,{data:e.positions_list,loading:t,error:n,isDigits:F,period:a,periods:o,handlePeriodChange:l,className:"h-full",minHeight:"min-h-0",walletAddress:Y==null?void 0:Y.address,coin:r,sourceMarket:"hyper"},`tabs-${Y.address}`):ge==="lighter"?xn?i.jsx(IO,{walletAddress:Y==null?void 0:Y.address,sourceMarket:"lighter"}):i.jsxs("div",{className:"w-full h-full flex flex-col items-center justify-center gap-3 px-4",children:[i.jsx("p",{className:"text-[13px] text-[#9BA1A6] text-center",children:"Connect your wallet to manage Lighter grid bots"}),i.jsx("div",{className:"w-[220px]",children:i.jsx(Zp,{onClick:()=>v(!0)})})]}):i.jsx(IO,{walletAddress:Y==null?void 0:Y.address,sourceMarket:"extended"})})]}),i.jsxs(vo.div,{animate:{width:V?28:350},transition:E0n,className:"hidden xl:flex flex-col gap-1 rounded-[16px] overflow-visible",style:{minWidth:V?28:350},children:[!V&&i.jsxs("div",{className:"group relative bg-[#101010] border border-[#292929] flex-1 rounded-[16px] flex flex-col",children:[i.jsx("button",{onClick:()=>ee(!0),className:"hidden xl:flex absolute left-0 top-1/2 -translate-y-1/2 -translate-x-1/2 z-20 opacity-0 pointer-events-none group-hover:opacity-100 group-hover:pointer-events-auto transition-opacity bg-transparent",children:i.jsx("div",{className:"w-6 h-6 rounded-full bg-[#161616] border border-r-0 border-[#292929] flex items-center justify-center shadow",children:i.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",children:i.jsx("path",{d:"M9 6l6 6-6 6",stroke:"#CFCFCF",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})}),i.jsx("div",{className:"px-3 pt-3 pb-2 items-center justify-center flex",children:i.jsxs("div",{className:"inline-flex bg-[#161616] rounded-full p-1 text-xs",children:[i.jsx("button",{onClick:()=>{const Lt=ge==="hyperliquid"?ve||r||"BTC":ge==="lighter"?Ie||"BTC":Qe||"BTC";fe("trade"),he([]),c(`/terminal/${ge}/${Lt}#trade`)},className:`px-3 py-1 rounded-full transition ${ae==="trade"?"bg-white text-black":"text-white/60 hover:text-white"}`,children:"Trade"}),i.jsx("button",{onClick:()=>{const Lt=ge==="hyperliquid"?ve||r||"BTC":ge==="lighter"?Ie||"BTC":Qe||"BTC";fe("grid"),c(`/terminal/${ge}/${Lt}#gridbot`)},className:`px-3 py-1 rounded-full transition ${ae==="grid"?"bg-white text-black":"text-white/60 hover:text-white"}`,children:"Grid Bot"}),ge==="extended"&&i.jsx("button",{onClick:In,className:"px-3 py-1 rounded-full transition text-white/60 hover:text-white",children:"DCA Bot"})]})}),i.jsx("div",{className:"flex-1 overflow-hidden",children:ae==="trade"?ge==="hyperliquid"?i.jsx(bSe,{coin:r,midPrice:J,selectedPrice:Q,maxLeverage:re[r]||25,wallet:Y,onWalletChange:ie,uiMode:w,pairKey:N}):ge==="lighter"?i.jsx(sj,{title:"Lighter Perp Trading",subtitle:"Coming Soon"}):i.jsx(sj,{title:"Extended Perp Trading",subtitle:"Coming Soon"}):ge==="hyperliquid"?un||Et?i.jsx("div",{className:"w-full h-full flex items-center justify-center text-xs text-white/60",children:"Loading Hyperliquid account…"}):xn?Ye?i.jsx(aF,{code:Ue,onCodeChange:Rt,onSubmit:Mt,loading:We,checking:Et,message:mt}):jt===!1?i.jsx("div",{className:"w-full h-full flex items-center justify-center",children:i.jsx("button",{onClick:()=>window.open("/wallet-management#hyperliquid","_blank","noopener,noreferrer"),className:"px-4 py-2 rounded-full bg-white text-black text-xs font-semibold",children:"Create HL Account"})}):i.jsx(OSe,{coin:Dn,midPrice:J,selectedPrice:Q,wallet:Y,onWalletChange:ie,onLevelsChange:he}):i.jsxs("div",{className:"w-full h-full flex flex-col items-center justify-center gap-3 px-4",children:[i.jsx("p",{className:"text-[13px] text-[#9BA1A6] text-center",children:"Connect your wallet to use Hyperliquid Grid Bot"}),i.jsx("div",{className:"w-[220px]",children:i.jsx(Zp,{onClick:()=>v(!0)})})]}):ge==="lighter"?lt||Et?i.jsx("div",{className:"w-full h-full flex items-center justify-center text-xs text-white/60",children:"Loading Lighter account…"}):xn?Zt?i.jsx(aF,{code:Ue,onCodeChange:Rt,onSubmit:Mt,loading:We,checking:Et,message:mt}):it?i.jsx(PSe,{coin:Dn,midPrice:J,selectedPrice:Q,wallet:Y,onLevelsChange:he}):i.jsx("div",{className:"w-full h-full flex items-center justify-center",children:i.jsx("button",{onClick:()=>window.open("/wallet-management#lighter","_blank","noopener,noreferrer"),className:"px-4 py-2 rounded-full bg-white text-black text-xs font-semibold",children:"Create Lighter Account"})}):i.jsxs("div",{className:"w-full h-full flex flex-col items-center justify-center gap-3 px-4",children:[i.jsx("p",{className:"text-[13px] text-[#9BA1A6] text-center",children:"Connect your wallet to use Lighter Grid Bot"}),i.jsx("div",{className:"w-[220px]",children:i.jsx(Zp,{onClick:()=>v(!0)})})]}):It?i.jsx("div",{className:"w-full h-full flex items-center justify-center text-xs text-white/60",children:"Loading Extended account…"}):xn?ut?i.jsx(RSe,{coin:Dn,midPrice:J,selectedPrice:Q,wallet:Y,onLevelsChange:he}):i.jsx("div",{className:"w-full h-full flex items-center justify-center",children:i.jsx("button",{onClick:()=>window.open("/wallet-management#extended","_blank","noopener,noreferrer"),className:"px-4 py-2 rounded-full bg-white text-black text-xs font-semibold",children:"Create Extended Account"})}):i.jsxs("div",{className:"w-full h-full flex flex-col items-center justify-center gap-3 px-4",children:[i.jsx("p",{className:"text-[13px] text-[#9BA1A6] text-center",children:"Connect your wallet to use Extended Grid Bot"}),i.jsx("div",{className:"w-[220px]",children:i.jsx(Zp,{onClick:()=>v(!0)})})]})})]}),V&&i.jsxs("div",{className:"group relative h-full min-h-[505px] bg-[#101010] border border-[#292929] rounded-[16px] flex items-center justify-center",children:[i.jsx("button",{onClick:()=>ee(!1),className:"hidden xl:flex absolute left-0 top-1/2 -translate-y-1/2 -translate-x-1/2 opacity-0 pointer-events-none group-hover:opacity-100 group-hover:pointer-events-auto transition-opacity bg-transparent z-10",children:i.jsx("div",{className:"w-6 h-6 rounded-full bg-[#161616] border border-r-0 border-[#292929] flex items-center justify-center shadow z-10",children:i.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",children:i.jsx("path",{d:"M15 6L9 12l6 6",stroke:"#CFCFCF",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})}),i.jsx("div",{className:"-rotate-90 whitespace-nowrap text-[11px] tracking-wide text-[#BFBFBF] z-0",children:ae==="trade"?"Trade Panel":"Grid Bot"})]})]})]})})]})}const T0n=()=>{ns();const{setTelegramChatId:e,setSubscriberRole:t,setSubsExpireDay:n,setMushboomerETH:r,setIsWhitelist:s,setMushboomerSOL:a,setIsReferralCode:o,setIsReferralCodeName:l,setHyperToken:c,setHyperAddress:u,getCopyTradeWatchList:d,getTrackedWatchList:f}=m.useContext(Qr),{coin:x}=t5(),[g,v]=m.useState(x||"BTC"),w=gU();function C(ee){return ee?ee.includes(":")?ee.split(":")[1]:ee:""}function N(ee){if(!ee)return"";if(ee.includes(":")){const[ae,fe]=ee.split(":");return`${fe} (${ae})`}return ee}const P=C(g),I=w.find(ee=>ee.symbol===`${P}-USD`||ee.symbol===`${P}-USDH`||ee.symbol===`${P}-USDC`),R=(I==null?void 0:I.last)??(I==null?void 0:I.coin),U=`${R?(ee=>{if(ee==null||!isFinite(ee))return"";const ae=Number(ee),fe=Math.abs(ae),Ne=fe>=1e3?0:fe>=1?2:fe>=.1?6:7,he=ae.toFixed(Ne);return Number(he).toLocaleString(void 0,{maximumFractionDigits:Ne})})(R):""} | ${N(g)} | Dextrabot | Top Hyperliquid Wallets`;m.useEffect(()=>{U&&(document.title=U)},[U]);const[L,z]=m.useState([]),[Q,ne]=m.useState(!1),[J,X]=m.useState(null);m.useEffect(()=>{const ee=document.querySelector("main > div");return ee&&(ee.style.background="#050505"),()=>{ee&&(ee.style.background="")}},[]);const re=[{index:0,name:"1D",value:1},{index:1,name:"7D",value:7},{index:2,name:"30D",value:30},{index:3,name:"90D",value:90}],pe=parseInt(localStorage.getItem("ticker_period")),Y=!isNaN(pe)&&re[pe]?re[pe].value:re[1].value,[ie,oe]=m.useState(Y),G=ee=>{oe(Number(ee)),localStorage.setItem("ticker_period",re.findIndex(ae=>ae.value===Number(ee)).toFixed(0))},V=async({coin:ee,period:ae})=>{try{ne(!0);const fe=`https://dextradata.nftinit.io/api/hyper/terminal/v2/${ee}/${ae}`,Ne=await fetch(fe);if(!Ne.ok)throw z([]),new Error("Network response was not ok");const he=await Ne.json();he!=null&&he.success?(z(he),ne(!1),window.localStorage.getItem("hyperToken")&&(d(),f())):(z([]),ne(!1),X(he==null?void 0:he.error_message))}catch(fe){X(fe.message),ne(!1)}};return m.useEffect(()=>{g&&ie&&V({coin:g,period:ie})},[g,ie]),m.useEffect(()=>{(async()=>{var Ne,he;const ae=window.localStorage.getItem("hyperToken"),fe=window.localStorage.getItem("hyperAddress");if(!(!ae||!fe))try{const ge=await Ei(fe.toLowerCase(),ae);ge!=null&&ge.success?(e(ge==null?void 0:ge.telegram_chat_id),t(ge==null?void 0:ge.subscriber_role),n(ge==null?void 0:ge.subs_expire_day),r((Ne=ge==null?void 0:ge.mushboomer_counts)==null?void 0:Ne.eth),a((he=ge==null?void 0:ge.mushboomer_counts)==null?void 0:he.sol),o(ge==null?void 0:ge.referral_code),l(ge==null?void 0:ge.refcode),s(ge==null?void 0:ge.whitelist)):(window.localStorage.removeItem("hyperToken"),window.localStorage.removeItem("hyperAddress"),c(""),u(""))}catch(ge){console.error("Token verification error:",ge)}})()},[]),i.jsxs(i.Fragment,{children:[i.jsx(So,{children:i.jsxs(Ro,{children:[i.jsx("meta",{name:"description",content:`View real-time ${g} positions of top Hyperliquid traders wallet by wallet. Track entry prices, unrealized PnL, position sizes, and copy trade profitable Bitcoin strategies instantly.`}),i.jsx("meta",{property:"og:title",content:`${g} Terminal | Top Hyperliquid Wallets | Real-time Positions | Dextrabot`}),i.jsx("meta",{property:"og:description",content:`View real-time ${g} positions of top Hyperliquid traders wallet by wallet. Track entry prices, unrealized PnL, position sizes, and copy trade profitable Bitcoin strategies instantly.`}),i.jsx("meta",{property:"og:image",content:"https://app.dextrabot.com/dextrabotIcon.png"}),i.jsx("meta",{property:"og:url",content:`https://app.dextrabot.com/terminal/${g}`})]})}),i.jsx("div",{className:"flex justify-center w-full min-h-screen px-1 pt-1 sm:px-3 sm:pt-3 bg-[#161616]",children:i.jsx("div",{className:"flex flex-col items-stretch justify-center h-full gap-[26px] w-full flex-grow xl:flex-grow-0",children:i.jsx(k0n,{data:L,loading:Q,error:J,coin:g,setCoin:v,period:ie,periods:re,handlePeriodChange:G})})})]})},I0n="https://dextradata.nftinit.io/api/hyper/whale_stats/v2/",jh=e=>{if(e==null)return"-";const t=Number(e),n=t<0?"-":"",r=Math.abs(t);return r>=1e9?`${n}$${(r/1e9).toFixed(2)}B`:r>=1e6?`${n}$${(r/1e6).toFixed(2)}M`:r>=1e3?`${n}$${(r/1e3).toFixed(2)}K`:`${n}$${r.toFixed(2)}`},tg=e=>e==null?"-":`${Number(e).toFixed(1)}%`,oF=e=>`calc(${e}%)`;function P0n({onData:e}){const[t,n]=m.useState(null);if(m.useEffect(()=>{let l=null;const c=()=>fs.get(I0n).then(d=>{var x,g,v,w;const f=(w=(v=(g=(x=d.data)==null?void 0:x.results)==null?void 0:g.other)==null?void 0:v.tracker)==null?void 0:w[0];if(f){n(f);const C=f.total_position;C!==l&&(l=C,e==null||e(f))}}).catch(d=>{console.error("fetch error",d)});c();const u=setInterval(c,3e4);return()=>clearInterval(u)},[]),!t)return i.jsx("div",{className:"rounded-[16px] border border-[#1E1E1E] bg-[#101010] p-4 space-y-6",children:[...Array(3)].map((l,c)=>i.jsxs("div",{className:"space-y-3",children:[i.jsx("div",{className:"h-[32px] w-[160px] bg-[#202020] rounded-md animate-pulse"}),i.jsx("div",{className:"h-[24px] w-full max-w-[170px] bg-[#202020] rounded-md animate-pulse"}),i.jsx("div",{className:"h-[10px] w-[80%] bg-[#202020] rounded-md animate-pulse"}),i.jsx("div",{className:"h-[1px] w-full bg-[#262626]"})]},c))});const r=t.long.position_ratio,s=100-r,a=t.long.margin_ratio,o=100-a;return i.jsxs("div",{className:"font-inter w-full text-white space-y-3",children:[i.jsxs("div",{className:"flex items-center gap-[6px]",children:[i.jsx("img",{src:Oyt,alt:"Dextrabot - Whale Trades"}),i.jsx("h2",{className:"text-[16px] leading-[21px] tracking-[-0.32px] font-medium",children:"Overview"}),i.jsxs("div",{className:"flex items-center gap-1 bg-[#262626] p-1 rounded-full w-fit ml-[2px]",children:[i.jsxs("div",{className:"relative w-2 h-2 flex justify-center items-center",children:[i.jsx("span",{className:"absolute inline-flex h-full w-full rounded-full bg-[#67FFBD]/[0.32] animate-ping"}),i.jsx("span",{className:"relative inline-flex rounded-full h-1.5 w-1.5 bg-[#67FFBD]"})]}),i.jsx("span",{className:"text-white text-[10px] leading-[10px] font-medium",children:"LIVE"})]})]}),i.jsxs("div",{className:"rounded-[16px] border border-[#1E1E1E] bg-[#101010] p-4 space-y-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx(mi,{content:"Total value of whale positions opened in the last 24 hours.",children:i.jsxs("div",{className:"flex items-center gap-[6px] w-fit",children:[i.jsx("span",{className:"text-[#929292] text-[14px] tracking-[-0.14px]",children:"Open Positions"}),i.jsx("span",{className:"inline-flex items-center justify-center h-[18px] px-[6px] py-[3px] bg-[#202020] text-[10px] leading-[10px] font-medium rounded-full",children:"LAST 24H"}),i.jsx("img",{src:E0,alt:"Dextrabot - Whale Trades"})]})}),i.jsx("div",{className:"text-[20px] leading-[21px] tracking-[-0.2px] font-semibold",children:jh(t.total_position)}),i.jsxs("div",{className:"flex gap-1 h-[16px] w-full max-w-[170px]",children:[i.jsx("span",{className:"flex items-center justify-center bg-[#67FFBD] rounded-[4px] text-[#12450F] text-[10px] leading-[10px] font-semibold px-6",style:{width:oF(r)},children:tg(r)}),i.jsx("span",{className:"flex items-center justify-center bg-[#FF797C] rounded-[4px] text-[#5E2425] text-[10px] leading-[10px] font-semibold px-6",style:{width:oF(s)},children:tg(s)})]}),i.jsxs("div",{className:"flex items-center text-[10px] leading-[10px] font-medium gap-2",children:[i.jsxs("span",{className:"flex items-center gap-1.5",children:[i.jsx("span",{className:"w-2 h-2 rounded-full bg-[#67FFBD]"}),i.jsx("span",{children:"Long"}),i.jsx("span",{children:jh(t.long.position)}),i.jsxs("span",{className:"text-[#909090]",children:["(",tg(r),")"]})]}),i.jsx("span",{className:"h-[10px] w-px bg-[#262626]"}),i.jsxs("span",{className:"flex items-center gap-1",children:[i.jsx("span",{className:"w-2 h-2 rounded-full bg-[#FF797C]"}),i.jsx("span",{children:"Short"}),i.jsx("span",{children:jh(t.short.position)}),i.jsxs("span",{className:"text-[#909090]",children:["(",tg(s),")"]})]})]})]}),i.jsx("div",{className:"h-px w-full bg-[#262626]"}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(mi,{content:"Total margin whales are currently using across all positions.",children:i.jsxs("div",{className:"flex items-center gap-[6px] mt-2 w-fit",children:[i.jsx("span",{className:"text-[#929292] text-[14px] tracking-[-0.14px]",children:"Whale Margin Usage"}),i.jsx("img",{className:"mt-[2px]",src:E0,alt:"Dextrabot - Whale Trades"})]})}),i.jsxs("div",{className:"flex items-end gap-2",children:[i.jsx("span",{className:"text-[20px] leading-[21px] tracking-[-0.2px] font-semibold",children:jh(t.total_margin)}),i.jsx(mi,{content:"(Total Margin / Total Perp. Equity) * 100",children:i.jsxs("span",{className:"text-[#929292] font-inter text-[20px] not-italic font-semibold leading-[21px] tracking-[-0.2px]",children:["(",tg(t.total_margin/t.total_perp_equity*100),")"]})}),t.long.margin>t.short.margin?i.jsx("span",{className:"bg-[rgba(103,255,189,0.16)] p-[2px] rounded-full",children:i.jsx(rse,{className:"w-4 h-4 text-[#67FFBD]"})}):i.jsx("span",{className:"bg-[rgba(255,121,124,0.16)] p-[2px] rounded-full",children:i.jsx(Bl,{className:"w-4 h-4 text-[#FF797C]"})})]}),i.jsxs("div",{className:"flex gap-1 h-[16px] w-full max-w-[170px]",children:[i.jsx("span",{className:"flex items-center justify-center bg-[#67FFBD] rounded-[4px] text-[#12450F] text-[10px] leading-[10px] font-semibold px-6",style:{width:oF(a)},children:tg(a)}),i.jsx("span",{className:"flex items-center justify-center bg-[#FF797C] rounded-[4px] text-[#5E2425] text-[10px] leading-[10px] font-semibold px-6",style:{width:oF(o)},children:tg(o)})]}),i.jsxs("div",{className:"flex items-center text-[10px] leading-[10px] font-medium gap-2",children:[i.jsxs("span",{className:"flex items-center gap-1.5",children:[i.jsx("span",{className:"w-2 h-2 rounded-full bg-[#67FFBD]"}),i.jsx("span",{children:"Long"}),i.jsx("span",{className:"text-[#909090]",children:jh(t.long.margin)}),i.jsxs("span",{children:["(",tg(a),")"]})]}),i.jsx("span",{className:"h-[10px] w-px bg-[#262626]"}),i.jsxs("span",{className:"flex items-center gap-1",children:[i.jsx("span",{className:"w-2 h-2 rounded-full bg-[#FF797C]"}),i.jsx("span",{children:"Short"}),i.jsx("span",{className:"text-[#909090]",children:jh(t.short.margin)}),i.jsxs("span",{children:["(",tg(o),")"]})]})]})]}),i.jsx("div",{className:"h-px w-full bg-[#262626]"}),i.jsxs("div",{className:"flex gap-16",children:[i.jsxs("div",{children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx(mi,{content:"Whales’ unrealized profit and loss from open positions in the last 24 hours.",children:i.jsxs("div",{className:"flex items-center gap-[6px]",children:[i.jsx("div",{className:"text-[#929292] text-[14px] tracking-[-0.14px]",children:"PnL"}),i.jsx("img",{className:"mt-[2px]",src:E0,alt:"Dextrabot - Whale Trades"})]})}),i.jsx("div",{className:"text-[20px] leading-[21px] tracking-[-0.2px] font-semibold",children:jh(t.total_pnl)}),i.jsxs("div",{className:"flex items-center text-[10px] font-medium gap-1",children:[i.jsx("span",{className:"w-2 h-2 rounded-full bg-[#67FFBD]"})," Long"," ",jh(t.long.pnl)]})]}),i.jsxs("div",{className:"flex items-center text-[10px] font-medium gap-1",children:[i.jsx("span",{className:"w-2 h-2 rounded-full bg-[#FF797C]"})," Short"," ",jh(t.short.pnl)]})]}),i.jsxs("div",{children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx(mi,{content:"Funding fees paid or received by whales based on their open positions.",children:i.jsxs("div",{className:"flex items-center gap-[6px]",children:[i.jsx("div",{className:"text-[#929292] text-[14px] tracking-[-0.14px]",children:"Funding"}),i.jsx("img",{className:"mt-[2px]",src:E0,alt:"Dextrabot - Whale Trades"})]})}),i.jsx("div",{className:"text-[20px] leading-[21px] tracking-[-0.2px] font-semibold",children:jh(t.total_funding)}),i.jsxs("div",{className:"flex items-center text-[10px] font-medium gap-1",children:[i.jsx("span",{className:"w-2 h-2 rounded-full bg-[#67FFBD]"})," Long"," ",jh(t.long.funding)]})]}),i.jsxs("div",{className:"flex items-center text-[10px] font-medium gap-1",children:[i.jsx("span",{className:"w-2 h-2 rounded-full bg-[#FF797C]"})," Short"," ",jh(t.short.funding)]})]})]})]})]})}const Ju={1:{label:"Shrimp",emoji:"🦐",bg:"bg-[rgba(255,144,0,0.16)]",txt:"text-[#FF9000]"},2:{label:"Fish",emoji:"🐟",bg:"bg-[rgba(121,156,232,0.16)]",txt:"text-[#97B8FF]"},3:{label:"Dolphin",emoji:"🐬",bg:"bg-[rgba(103,255,245,0.16)]",txt:"text-[#4DDCDE]"},4:{label:"Apex Predator",emoji:"🦈",bg:"bg-[rgba(81,180,255,0.16)]",txt:"text-[#51B4FF]"},5:{label:"Small Whale",emoji:"🐋",bg:"bg-[rgba(255,121,173,0.16)]",txt:"text-[#FF79AD]"},6:{label:"Whale",emoji:"🐳",bg:"bg-[rgba(198,121,255,0.16)]",txt:"text-[#C679FF]"},7:{label:"Tidal Whale",emoji:"🌊",bg:"bg-[rgba(255,121,137,0.16)]",txt:"text-[#FF7989]"},8:{label:"Leviathan",emoji:"🐉",bg:"bg-[rgba(73,242,73,0.16)]",txt:"text-[#49F249]"}},V_=[{id:1,...Ju[1],description:"$0 – $250 — Low-value frequent trader"},{id:2,...Ju[2],description:"$250 – $10K — Small but active trader"},{id:3,...Ju[3],description:"$10K – $50K — Consistent mid-size trader"},{id:4,...Ju[4],description:"$50K – $100K — Aggressive high-leverage trader"},{id:5,...Ju[5],description:"$100K – $500K — Influential swing trader"},{id:6,...Ju[6],description:"$500K – $1M — Market-moving whale"},{id:7,...Ju[7],description:"$1M – $5M — Mega whale, highly impactful"},{id:8,...Ju[8],description:"≥ $5M — Rare leviathan with massive positions"}],_ue=e=>{if(e==null)return Ju[6];const t=Number(e);if(!isNaN(t)&&Ju[t])return Ju[t];const n=Object.values(Ju).find(a=>String(a.label).toLowerCase()===String(e).toLowerCase());if(n)return n;const r=a=>String(a).replace(/[\s_]+/g,"").toLowerCase();return Object.values(Ju).find(a=>r(a.label)===r(e))||Ju[6]},F0n="https://dextradata.nftinit.io/api/hyper/trade/highVolumeTrades/",O0n=e=>{const t=Date.now()-e,n=Math.floor(t/6e4);if(n<1)return"now";if(n<60)return`${n}m ago`;const r=Math.floor(n/60);return r<24?`${r}h ago`:`${Math.floor(r/24)}d ago`},pC=e=>{if(e==null)return"-";const t=Number(e),n=t<0?"-":"",r=Math.abs(t);return r>=1e9?`${n}$${(r/1e9).toFixed(2)}B`:r>=1e6?`${n}$${(r/1e6).toFixed(2)}M`:r>=1e3?`${n}$${(r/1e3).toFixed(2)}K`:`${n}$${r.toFixed(2)}`},M0n=e=>e<250?1:e<1e4?2:e<5e4?3:e<1e5?4:e<5e5?5:e<1e6?6:e<5e6?7:8,GSe=e=>_ue(M0n(e)),KSe=()=>{const[e,t]=m.useState([]),[n,r]=m.useState(!0),[s,a]=m.useState(Date.now()),[o,l]=m.useState(""),c=m.useCallback(async(x=!1)=>{x&&r(!0);try{const g=await fs.post(F0n,{limit:1e3,offset:0});if(g.data.success){const v=g.data.data.filter(w=>{var C;return!((C=w==null?void 0:w.typeDetail)!=null&&C.includes("Top100Wallet"))});t(v),a(Date.now())}}finally{x&&r(!1)}},[]);m.useEffect(()=>{c(!0);const x=setInterval(c,3e4);return()=>clearInterval(x)},[c]);const u=m.useMemo(()=>o?e.filter(x=>{var v;if(!o)return!0;const g=GSe((x==null?void 0:x.global_account_value)??0);return o===((v=V_.find(w=>w.label===g.label))==null?void 0:v.id)}):e,[e,o]),d=[{key:"rank",label:"#",width:"45px",render:(x,g,v)=>i.jsx("span",{className:"text-[#9B9B9B]",children:v+1})},{key:"wallet",label:"Address",width:"235px",render:(x,g)=>{const v=(g==null?void 0:g.global_account_value)??0,w=GSe(v);return i.jsxs("div",{className:"flex items-center gap-1.5 text-[14px] tracking-[0.24px]",children:[i.jsx("span",{className:"text-[18px] leading-none",children:w.emoji}),i.jsxs("span",{className:"max-w-20 mr-2",children:[g.wallet.slice(0,5),"...",g.wallet.slice(-4)]}),i.jsx("span",{className:`flex justify-center items-center px-1 h-6 rounded-[6px] text-[11px] font-medium ml-[10px] ${w.bg} ${w.txt}`,children:w.label})]})}},{key:"coin",label:"Symbol",sortable:!0,width:"90px",render:(x,g)=>i.jsxs("div",{className:"flex items-center gap-2 text-[14px]",children:[i.jsx("img",{src:`https://app.hyperliquid.xyz/coins/${g.coin}.svg`,onError:ra,className:"w-5 h-5"}),g.coin]})},{key:"activity",label:"Activity",width:"140px",render:(x,g)=>{var R,F,U,L;const v=(R=g==null?void 0:g.position_details)==null?void 0:R.direction,w=v==="Long",C=v==="Short",N=(L=(U=(F=g==null?void 0:g.position_details)==null?void 0:F.position)==null?void 0:U.leverage)==null?void 0:L.value,P=g.side==="Change Position"?w?"Short > Long":"Long > Short":v??"Position Close",I=v==="Long"||v==="Short";return i.jsxs("div",{className:"flex items-center gap-[10px]",children:[i.jsxs("div",{className:`inline-flex justify-center items-center gap-1 px-2 py-1 h-6 rounded-[6px] text-[11px] uppercase font-medium ${w?"text-[#67ffbd] bg-[rgba(103,255,189,0.16)]":C?"text-[#ff787b] bg-[rgba(255,131,117,0.16)]":"text-[#8B8B8B] bg-transparent"}`,children:[I&&i.jsx(Ps,{className:`w-3 h-3 ${w?"rotate-180 text-[#67ffbd]":"text-[#ff787b]"}`}),P]}),N&&i.jsxs("div",{className:"inline-flex justify-center items-center px-2 py-1 h-6 rounded-[6px] text-[11px] font-medium text-[#67ffbd] bg-[rgba(103,255,189,0.16)]",children:[N,"X"]})]})}},{key:"current_trade_value",label:"Trade",width:"80px",sortable:!0,render:x=>pC(x)},{key:"position_value",label:"Position",width:"90px",sortable:!0,sortValue:x=>{var g,v;return Number((v=(g=x==null?void 0:x.position_details)==null?void 0:g.position)==null?void 0:v.positionValue)},render:(x,g)=>{var v,w;return(w=(v=g==null?void 0:g.position_details)==null?void 0:v.position)!=null&&w.positionValue?pC(g.position_details.position.positionValue):"-"}},{key:"price",label:"Price",width:"80px",sortable:!0,sortValue:x=>{var g,v;return Number((v=(g=x==null?void 0:x.position_details)==null?void 0:g.position)==null?void 0:v.entryPx)},render:(x,g)=>{var v,w;return(w=(v=g==null?void 0:g.position_details)==null?void 0:v.position)!=null&&w.entryPx?pC(g.position_details.position.entryPx):"-"}},{key:"side",label:"Side",width:"120px",sortable:!0,sortValue:x=>(x==null?void 0:x.side)||"",render:x=>i.jsx("div",{className:`h-5 pl-1 pr-1.5 py-1 rounded-md inline-flex items-center gap-0.5 text-[11px] font-semibold font-manrope leading-[8px] tracking-wide uppercase ${x==="Increase"||x==="Change Position"?"text-[#67ffbd] bg-[#67ffbd]/20":x==="Decrease"||x==="Position Close"?"text-[#ff787b] bg-[#ff797c]/20":"text-white"}`,children:x||"-"})},{key:"position_details.position.size",label:"Size",sortable:!0,width:"110px",sortValue:x=>{var g,v;return Math.abs(Number((v=(g=x==null?void 0:x.position_details)==null?void 0:g.position)==null?void 0:v.szi))||0},render:(x,g)=>{var N,P;const v=(P=(N=g==null?void 0:g.position_details)==null?void 0:N.position)==null?void 0:P.szi,w=v>0,C=w?"text-[#3DB380]":v<0?"text-[#FF797C]":"text-white";return i.jsxs("span",{className:`font-semibold ${C} inline-flex items-center`,children:[isNaN(v)?"-":pC(Math.abs(v)),!isNaN(v)&&i.jsx("img",{src:w?aE:oE,className:"ml-[6px] w-[9px] h-[8px]",alt:""})]})}},{key:"position_details.position.entryPx",label:"Entry",sortable:!0,sortValue:x=>{var g,v;return Number((v=(g=x==null?void 0:x.position_details)==null?void 0:g.position)==null?void 0:v.entryPx)||0},width:"80px",render:(x,g)=>{var w,C;const v=(C=(w=g==null?void 0:g.position_details)==null?void 0:w.position)==null?void 0:C.entryPx;return v?`${pC(v)}`:"-"}},{key:"position_details.position.unrealizedPnl",label:"uPnL",sortable:!0,width:"100px",sortValue:x=>{var g,v;return Math.abs(Number((v=(g=x==null?void 0:x.position_details)==null?void 0:g.position)==null?void 0:v.unrealizedPnl))||0},render:(x,g)=>{var N,P;const v=parseFloat((P=(N=g==null?void 0:g.position_details)==null?void 0:N.position)==null?void 0:P.unrealizedPnl),w=v>0,C=w?"text-[#3DB380]":v<0?"text-[#FF797C]":"text-white";return i.jsxs("span",{className:`font-semibold ${C} inline-flex items-center`,children:[isNaN(v)?"-":`${pC(Math.abs(v))}`,!isNaN(v)&&i.jsx("img",{src:w?aE:oE,className:"ml-[6px] w-[9px] h-[8px]",alt:""})]})}},{key:"flags",label:i.jsx(mi,{content:"Quick view of this whale’s recent trading performance.",children:i.jsx("span",{children:"Last 5 T."})}),width:"90px",render:(x,g)=>{const v=g.last5Trade??[];return i.jsx("div",{className:"inline-flex h-[18px] px-[2px] py-[4px] justify-center items-center rounded-[6px] overflow-visible",children:v.slice(0,5).map((w,C)=>{let N="",P=null;return w===null?(N="bg-[#747474]",P=f8e):w===!0?(N="bg-[#67FFBD]",P=d8e):(N="bg-[#FF9C9C]",P=h8e),i.jsx("div",{className:`relative z[${C}] w-[18px] h-[18px] flex-shrink-0 flex items-center justify-center rounded-full border-2 border-[#101010] ${N} ${C!==0?"-ml-[6px]":""}`,children:i.jsx(P,{className:"w-3 h-3 text-black"})},C)})})}},{key:"insert_date",label:"Time",width:"80px",sortable:!0,sortValue:x=>{var g;return(g=x.insert_date)==null?void 0:g.$date},render:(x,g)=>{var v;return i.jsx("div",{className:"text-gray-400",children:O0n(new Date((v=g.insert_date)==null?void 0:v.$date).getTime())})}}],f=(x,g)=>{var R;const w=((R=x==null?void 0:x.position_details)==null?void 0:R.direction)==="Long",C=x.current_trade_value>=5e6,N=C?w?"before:bg-[#67FFBD] before:shadow-[0_0_12px_#67FFBD] before:h-[24px] before:top-1/2 before:-translate-y-1/2":"before:bg-[#FF797C] before:shadow-[0_0_12px_#FF797C] before:h-[24px] before:top-1/2 before:-translate-y-1/2":"before:bg-transparent";return`
relative before:content-[''] before:absolute before:left-[8px] before:w-[2px] before:rounded-full
${C?w?"bg-[rgba(103,255,189,0.16)]":"bg-[rgba(255,131,117,0.16)]":g%2===0?"bg-[#191919]":"bg-transparent"} ${N} ${C?w?"hover:bg-[rgba(14,70,53,0.32)]":"hover:bg-[rgba(74,16,18,0.32)]":"hover:bg-[rgba(39,39,39,0.32)]"} cursor-pointer mb-4 py-5 transition-colors duration-300
`};return n?i.jsx("div",{className:"rounded-[16px] bg-[#101010] p-4 space-y-4 mt-6",children:i.jsx("div",{className:"space-y-3",children:[...Array(32)].map((x,g)=>i.jsx("div",{className:"h-[42px] w-full bg-[#202020] rounded-md animate-pulse"},g))})}):i.jsx(i.Fragment,{children:i.jsxs("div",{className:"font-manrope font-medium relative p-1 mt-4 sm:w-[1440px] sm:mx-auto",children:[i.jsxs("div",{className:"flex-col items-center space-y-2 sm:pl-[60px]",children:[i.jsx("div",{className:"flex items-center justify-between",children:i.jsx(mi,{content:"Displays real-time executed trades from top whales.",children:i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("h2",{className:"text-white text-[16px] leading-[21px] font-medium tracking-[-0.32px] pl-[5px] font-inter",children:"Hot Whale Trades"}),i.jsxs("div",{className:"flex items-center gap-1 bg-[#262626] p-1 rounded-full w-fit",children:[i.jsxs("div",{className:"relative w-2 h-2 flex justify-center items-center",children:[i.jsx("span",{className:"absolute inline-flex h-full w-full rounded-full [#4DFF43]/[0.32] animate-ping"}),i.jsx("span",{className:"relative inline-flex rounded-full h-1.5 w-1.5 bg-[#4DFF43]"})]}),i.jsx("span",{className:"text-white text-[10px] leading-[10px] font-medium",children:"LIVE"})]}),i.jsx("img",{className:"-ml-[4px]",src:E0,alt:"Dextrabot - Hyperliquid Whale Trades"})]})})}),i.jsx("div",{className:"flex items-center",children:i.jsx("div",{className:"inline-flex items-center h-8 px-1.5 py-[18px] rounded-[8px] border border-[#262626] flex-shrink-0 gap-[12px]",children:i.jsxs("div",{className:"flex items-center gap-[12px]",children:[i.jsx("div",{onClick:()=>l(""),className:`flex items-center justify-center h-7 w-7 px-4 rounded-[8px] text-white text-[14px] font-inter leading-[16px] cursor-pointer transition-colors ${o===""?"bg-[#262626]":"hover:bg-[#262626]"}`,children:"All"}),V_.map(({id:x,label:g,emoji:v,description:w})=>{const C=o===g;return i.jsx("div",{onClick:()=>l(C?"":x),className:`h-7 w-7 flex items-center justify-center rounded-[8px] text-[18px] transition-colors cursor-pointer ${C?"bg-[#262626]":"hover:bg-[#262626]"}`,children:i.jsx(mi,{content:w,children:v})},x)})]})})})]}),i.jsx("div",{className:"pt-2 bg-[#101010] rounded-[16px]",children:i.jsx(Ru,{data:u,columns:d,tableClassName:"text-[14px] flex justify-center",theadClassName:"text-[13px] font-inter !text-[#9B9B9B] bg-transparent font-normal",tbodyClassName:"text-[14px]",cellClassName:"text-[14px] font-medium",rowClassName:f,rowHeight:42,listHeight:window.screen.height,rowKey:x=>{var g,v;return((g=x._id)==null?void 0:g.$oid)||((v=x.insert_date)==null?void 0:v.$date)},onVisibleRows:()=>{},onRowClick:x=>window.open(`/wallet-details/${x.wallet}`,"_blank")})})]})})},l8=e=>{let t=0;for(let n=0;n<e.length;n++){const r=e.charCodeAt(n);t=(t<<5)-t+r,t=t&t}return Math.abs(t)},eVe=(e,t)=>Math.floor(e/Math.pow(10,t)%10),mre=(e,t)=>!(eVe(e,t)%2),Nu=(e,t,n)=>{const r=e%t;return n&&eVe(e,n)%2===0?-r:r},J3=(e,t,n)=>t[e%n],R0n=e=>{e.slice(0,1)==="#"&&(e=e.slice(1));const t=parseInt(e.substr(0,2),16),n=parseInt(e.substr(2,2),16),r=parseInt(e.substr(4,2),16);return(t*299+n*587+r*114)/1e3>=128?"#000000":"#FFFFFF"},L0n=4,no=80;function D0n(e,t){const n=l8(e),r=t&&t.length;return Array.from({length:L0n},(s,a)=>({color:J3(n+a,t,r),translateX:Nu(n*(a+1),no/2-(a+17),1),translateY:Nu(n*(a+1),no/2-(a+17),2),rotate:Nu(n*(a+1),360),isSquare:mre(n,2)}))}const YSe=({name:e,colors:t,title:n,square:r,size:s,...a})=>{const o=D0n(e,t),l=m.useId();return i.jsxs("svg",{viewBox:"0 0 "+no+" "+no,fill:"none",role:"img",xmlns:"http://www.w3.org/2000/svg",width:s,height:s,...a,children:[n&&i.jsx("title",{children:e}),i.jsx("mask",{id:l,maskUnits:"userSpaceOnUse",x:0,y:0,width:no,height:no,children:i.jsx("rect",{width:no,height:no,rx:r?void 0:no*2,fill:"#FFFFFF"})}),i.jsxs("g",{mask:`url(#${l})`,children:[i.jsx("rect",{width:no,height:no,fill:o[0].color}),i.jsx("rect",{x:(no-60)/2,y:(no-20)/2,width:no,height:o[1].isSquare?no:no/8,fill:o[1].color,transform:"translate("+o[1].translateX+" "+o[1].translateY+") rotate("+o[1].rotate+" "+no/2+" "+no/2+")"}),i.jsx("circle",{cx:no/2,cy:no/2,fill:o[2].color,r:no/5,transform:"translate("+o[2].translateX+" "+o[2].translateY+")"}),i.jsx("line",{x1:0,y1:no/2,x2:no,y2:no/2,strokeWidth:2,stroke:o[3].color,transform:"translate("+o[3].translateX+" "+o[3].translateY+") rotate("+o[3].rotate+" "+no/2+" "+no/2+")"})]})]})},vv=90,B0n=5;function $0n(e,t){const n=l8(e),r=t&&t.length,s=Array.from({length:B0n},(o,l)=>J3(n+l,t,r)),a=[];return a[0]=s[0],a[1]=s[1],a[2]=s[1],a[3]=s[2],a[4]=s[2],a[5]=s[3],a[6]=s[3],a[7]=s[0],a[8]=s[4],a}const U0n=({name:e,colors:t,title:n,square:r,size:s,...a})=>{const o=$0n(e,t),l=Ae.useId();return i.jsxs("svg",{viewBox:"0 0 "+vv+" "+vv,fill:"none",role:"img",xmlns:"http://www.w3.org/2000/svg",width:s,height:s,...a,children:[n&&i.jsx("title",{children:e}),i.jsx("mask",{id:l,maskUnits:"userSpaceOnUse",x:0,y:0,width:vv,height:vv,children:i.jsx("rect",{width:vv,height:vv,rx:r?void 0:vv*2,fill:"#FFFFFF"})}),i.jsxs("g",{mask:`url(#${l})`,children:[i.jsx("path",{d:"M0 0h90v45H0z",fill:o[0]}),i.jsx("path",{d:"M0 45h90v45H0z",fill:o[1]}),i.jsx("path",{d:"M83 45a38 38 0 00-76 0h76z",fill:o[2]}),i.jsx("path",{d:"M83 45a38 38 0 01-76 0h76z",fill:o[3]}),i.jsx("path",{d:"M77 45a32 32 0 10-64 0h64z",fill:o[4]}),i.jsx("path",{d:"M77 45a32 32 0 11-64 0h64z",fill:o[5]}),i.jsx("path",{d:"M71 45a26 26 0 00-52 0h52z",fill:o[6]}),i.jsx("path",{d:"M71 45a26 26 0 01-52 0h52z",fill:o[7]}),i.jsx("circle",{cx:45,cy:45,r:23,fill:o[8]})]})]})},z0n=64,wv=80;function H0n(e,t){const n=l8(e),r=t&&t.length;return Array.from({length:z0n},(s,a)=>J3(n%(a+1),t,r))}const V0n=({name:e,colors:t,title:n,square:r,size:s,...a})=>{const o=H0n(e,t),l=m.useId();return i.jsxs("svg",{viewBox:"0 0 "+wv+" "+wv,fill:"none",role:"img",xmlns:"http://www.w3.org/2000/svg",width:s,height:s,...a,children:[n&&i.jsx("title",{children:e}),i.jsx("mask",{id:l,"mask-type":"alpha",maskUnits:"userSpaceOnUse",x:0,y:0,width:wv,height:wv,children:i.jsx("rect",{width:wv,height:wv,rx:r?void 0:wv*2,fill:"#FFFFFF"})}),i.jsxs("g",{mask:`url(#${l})`,children:[i.jsx("rect",{width:10,height:10,fill:o[0]}),i.jsx("rect",{x:20,width:10,height:10,fill:o[1]}),i.jsx("rect",{x:40,width:10,height:10,fill:o[2]}),i.jsx("rect",{x:60,width:10,height:10,fill:o[3]}),i.jsx("rect",{x:10,width:10,height:10,fill:o[4]}),i.jsx("rect",{x:30,width:10,height:10,fill:o[5]}),i.jsx("rect",{x:50,width:10,height:10,fill:o[6]}),i.jsx("rect",{x:70,width:10,height:10,fill:o[7]}),i.jsx("rect",{y:10,width:10,height:10,fill:o[8]}),i.jsx("rect",{y:20,width:10,height:10,fill:o[9]}),i.jsx("rect",{y:30,width:10,height:10,fill:o[10]}),i.jsx("rect",{y:40,width:10,height:10,fill:o[11]}),i.jsx("rect",{y:50,width:10,height:10,fill:o[12]}),i.jsx("rect",{y:60,width:10,height:10,fill:o[13]}),i.jsx("rect",{y:70,width:10,height:10,fill:o[14]}),i.jsx("rect",{x:20,y:10,width:10,height:10,fill:o[15]}),i.jsx("rect",{x:20,y:20,width:10,height:10,fill:o[16]}),i.jsx("rect",{x:20,y:30,width:10,height:10,fill:o[17]}),i.jsx("rect",{x:20,y:40,width:10,height:10,fill:o[18]}),i.jsx("rect",{x:20,y:50,width:10,height:10,fill:o[19]}),i.jsx("rect",{x:20,y:60,width:10,height:10,fill:o[20]}),i.jsx("rect",{x:20,y:70,width:10,height:10,fill:o[21]}),i.jsx("rect",{x:40,y:10,width:10,height:10,fill:o[22]}),i.jsx("rect",{x:40,y:20,width:10,height:10,fill:o[23]}),i.jsx("rect",{x:40,y:30,width:10,height:10,fill:o[24]}),i.jsx("rect",{x:40,y:40,width:10,height:10,fill:o[25]}),i.jsx("rect",{x:40,y:50,width:10,height:10,fill:o[26]}),i.jsx("rect",{x:40,y:60,width:10,height:10,fill:o[27]}),i.jsx("rect",{x:40,y:70,width:10,height:10,fill:o[28]}),i.jsx("rect",{x:60,y:10,width:10,height:10,fill:o[29]}),i.jsx("rect",{x:60,y:20,width:10,height:10,fill:o[30]}),i.jsx("rect",{x:60,y:30,width:10,height:10,fill:o[31]}),i.jsx("rect",{x:60,y:40,width:10,height:10,fill:o[32]}),i.jsx("rect",{x:60,y:50,width:10,height:10,fill:o[33]}),i.jsx("rect",{x:60,y:60,width:10,height:10,fill:o[34]}),i.jsx("rect",{x:60,y:70,width:10,height:10,fill:o[35]}),i.jsx("rect",{x:10,y:10,width:10,height:10,fill:o[36]}),i.jsx("rect",{x:10,y:20,width:10,height:10,fill:o[37]}),i.jsx("rect",{x:10,y:30,width:10,height:10,fill:o[38]}),i.jsx("rect",{x:10,y:40,width:10,height:10,fill:o[39]}),i.jsx("rect",{x:10,y:50,width:10,height:10,fill:o[40]}),i.jsx("rect",{x:10,y:60,width:10,height:10,fill:o[41]}),i.jsx("rect",{x:10,y:70,width:10,height:10,fill:o[42]}),i.jsx("rect",{x:30,y:10,width:10,height:10,fill:o[43]}),i.jsx("rect",{x:30,y:20,width:10,height:10,fill:o[44]}),i.jsx("rect",{x:30,y:30,width:10,height:10,fill:o[45]}),i.jsx("rect",{x:30,y:40,width:10,height:10,fill:o[46]}),i.jsx("rect",{x:30,y:50,width:10,height:10,fill:o[47]}),i.jsx("rect",{x:30,y:60,width:10,height:10,fill:o[48]}),i.jsx("rect",{x:30,y:70,width:10,height:10,fill:o[49]}),i.jsx("rect",{x:50,y:10,width:10,height:10,fill:o[50]}),i.jsx("rect",{x:50,y:20,width:10,height:10,fill:o[51]}),i.jsx("rect",{x:50,y:30,width:10,height:10,fill:o[52]}),i.jsx("rect",{x:50,y:40,width:10,height:10,fill:o[53]}),i.jsx("rect",{x:50,y:50,width:10,height:10,fill:o[54]}),i.jsx("rect",{x:50,y:60,width:10,height:10,fill:o[55]}),i.jsx("rect",{x:50,y:70,width:10,height:10,fill:o[56]}),i.jsx("rect",{x:70,y:10,width:10,height:10,fill:o[57]}),i.jsx("rect",{x:70,y:20,width:10,height:10,fill:o[58]}),i.jsx("rect",{x:70,y:30,width:10,height:10,fill:o[59]}),i.jsx("rect",{x:70,y:40,width:10,height:10,fill:o[60]}),i.jsx("rect",{x:70,y:50,width:10,height:10,fill:o[61]}),i.jsx("rect",{x:70,y:60,width:10,height:10,fill:o[62]}),i.jsx("rect",{x:70,y:70,width:10,height:10,fill:o[63]})]})]})},Qo=36;function W0n(e,t){const n=l8(e),r=t&&t.length,s=J3(n,t,r),a=Nu(n,10,1),o=a<5?a+Qo/9:a,l=Nu(n,10,2),c=l<5?l+Qo/9:l;return{wrapperColor:s,faceColor:R0n(s),backgroundColor:J3(n+13,t,r),wrapperTranslateX:o,wrapperTranslateY:c,wrapperRotate:Nu(n,360),wrapperScale:1+Nu(n,Qo/12)/10,isMouthOpen:mre(n,2),isCircle:mre(n,1),eyeSpread:Nu(n,5),mouthSpread:Nu(n,3),faceRotate:Nu(n,10,3),faceTranslateX:o>Qo/6?o/2:Nu(n,8,1),faceTranslateY:c>Qo/6?c/2:Nu(n,7,2)}}const XSe=({name:e,colors:t,title:n,square:r,size:s,...a})=>{const o=W0n(e,t),l=m.useId();return i.jsxs("svg",{viewBox:"0 0 "+Qo+" "+Qo,fill:"none",role:"img",xmlns:"http://www.w3.org/2000/svg",width:s,height:s,...a,children:[n&&i.jsx("title",{children:e}),i.jsx("mask",{id:l,maskUnits:"userSpaceOnUse",x:0,y:0,width:Qo,height:Qo,children:i.jsx("rect",{width:Qo,height:Qo,rx:r?void 0:Qo*2,fill:"#FFFFFF"})}),i.jsxs("g",{mask:`url(#${l})`,children:[i.jsx("rect",{width:Qo,height:Qo,fill:o.backgroundColor}),i.jsx("rect",{x:"0",y:"0",width:Qo,height:Qo,transform:"translate("+o.wrapperTranslateX+" "+o.wrapperTranslateY+") rotate("+o.wrapperRotate+" "+Qo/2+" "+Qo/2+") scale("+o.wrapperScale+")",fill:o.wrapperColor,rx:o.isCircle?Qo:Qo/6}),i.jsxs("g",{transform:"translate("+o.faceTranslateX+" "+o.faceTranslateY+") rotate("+o.faceRotate+" "+Qo/2+" "+Qo/2+")",children:[o.isMouthOpen?i.jsx("path",{d:"M15 "+(19+o.mouthSpread)+"c2 1 4 1 6 0",stroke:o.faceColor,fill:"none",strokeLinecap:"round"}):i.jsx("path",{d:"M13,"+(19+o.mouthSpread)+" a1,0.75 0 0,0 10,0",fill:o.faceColor}),i.jsx("rect",{x:14-o.eyeSpread,y:14,width:1.5,height:2,rx:1,stroke:"none",fill:o.faceColor}),i.jsx("rect",{x:20+o.eyeSpread,y:14,width:1.5,height:2,rx:1,stroke:"none",fill:o.faceColor})]})]})]})},q0n=4,Rd=80;function G0n(e,t){const n=l8(e),r=t&&t.length;return Array.from({length:q0n},(s,a)=>J3(n+a,t,r))}const K0n=({name:e,colors:t,title:n,square:r,size:s,...a})=>{const o=G0n(e,t),l=e.replace(/\s/g,""),c=m.useId();return i.jsxs("svg",{viewBox:"0 0 "+Rd+" "+Rd,fill:"none",role:"img",xmlns:"http://www.w3.org/2000/svg",width:s,height:s,...a,children:[n&&i.jsx("title",{children:e}),i.jsx("mask",{id:c,maskUnits:"userSpaceOnUse",x:0,y:0,width:Rd,height:Rd,children:i.jsx("rect",{width:Rd,height:Rd,rx:r?void 0:Rd*2,fill:"#FFFFFF"})}),i.jsxs("g",{mask:`url(#${c})`,children:[i.jsx("path",{fill:"url(#gradient_paint0_linear_"+l+")",d:"M0 0h80v40H0z"}),i.jsx("path",{fill:"url(#gradient_paint1_linear_"+l+")",d:"M0 40h80v40H0z"})]}),i.jsxs("defs",{children:[i.jsxs("linearGradient",{id:"gradient_paint0_linear_"+l,x1:Rd/2,y1:0,x2:Rd/2,y2:Rd/2,gradientUnits:"userSpaceOnUse",children:[i.jsx("stop",{stopColor:o[0]}),i.jsx("stop",{offset:1,stopColor:o[1]})]}),i.jsxs("linearGradient",{id:"gradient_paint1_linear_"+l,x1:Rd/2,y1:Rd/2,x2:Rd/2,y2:Rd,gradientUnits:"userSpaceOnUse",children:[i.jsx("stop",{stopColor:o[2]}),i.jsx("stop",{offset:1,stopColor:o[3]})]})]})]})},Y0n=3,gu=80;function X0n(e,t){const n=l8(e),r=t&&t.length;return Array.from({length:Y0n},(s,a)=>({color:J3(n+a,t,r),translateX:Nu(n*(a+1),gu/10,1),translateY:Nu(n*(a+1),gu/10,2),scale:1.2+Nu(n*(a+1),gu/20)/10,rotate:Nu(n*(a+1),360,1)}))}const tVe=({name:e,colors:t,title:n,square:r,size:s,...a})=>{const o=X0n(e,t),l=m.useId();return i.jsxs("svg",{viewBox:"0 0 "+gu+" "+gu,fill:"none",role:"img",xmlns:"http://www.w3.org/2000/svg",width:s,height:s,...a,children:[n&&i.jsx("title",{children:e}),i.jsx("mask",{id:l,maskUnits:"userSpaceOnUse",x:0,y:0,width:gu,height:gu,children:i.jsx("rect",{width:gu,height:gu,rx:r?void 0:gu*2,fill:"#FFFFFF"})}),i.jsxs("g",{mask:`url(#${l})`,children:[i.jsx("rect",{width:gu,height:gu,fill:o[0].color}),i.jsx("path",{filter:`url(#filter_${l})`,d:"M32.414 59.35L50.376 70.5H72.5v-71H33.728L26.5 13.381l19.057 27.08L32.414 59.35z",fill:o[1].color,transform:"translate("+o[1].translateX+" "+o[1].translateY+") rotate("+o[1].rotate+" "+gu/2+" "+gu/2+") scale("+o[2].scale+")"}),i.jsx("path",{filter:`url(#filter_${l})`,style:{mixBlendMode:"overlay"},d:"M22.216 24L0 46.75l14.108 38.129L78 86l-3.081-59.276-22.378 4.005 12.972 20.186-23.35 27.395L22.215 24z",fill:o[2].color,transform:"translate("+o[2].translateX+" "+o[2].translateY+") rotate("+o[2].rotate+" "+gu/2+" "+gu/2+") scale("+o[2].scale+")"})]}),i.jsx("defs",{children:i.jsxs("filter",{id:`filter_${l}`,filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB",children:[i.jsx("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),i.jsx("feBlend",{in:"SourceGraphic",in2:"BackgroundImageFix",result:"shape"}),i.jsx("feGaussianBlur",{stdDeviation:7,result:"effect1_foregroundBlur"})]})})]})},Q0n={pixel:V0n,bauhaus:YSe,ring:U0n,beam:XSe,sunset:K0n,marble:tVe,geometric:XSe,abstract:YSe},nVe=({variant:e="marble",colors:t=["#92A1C6","#146A7C","#F0AB3D","#C271B4","#C20D90"],name:n="Clara Barton",title:r=!1,size:s,square:a=!1,...o})=>{const l=Q0n[e]||tVe;return i.jsx(l,{colors:t,name:n,title:r,size:s,square:a,...o})},lF="rgba(155,155,155,0.16)";function Z0n({row:e}){var f,x,g,v,w,C,N,P,I,R,F,U;const t=(f=e==null?void 0:e.position_details)==null?void 0:f.direction,n=(v=(g=(x=e==null?void 0:e.position_details)==null?void 0:x.position)==null?void 0:g.leverage)==null?void 0:v.value,r=t==="Long",s=t==="Short",a=(C=(w=e==null?void 0:e.position_details)==null?void 0:w.position)==null?void 0:C.szi,o=(P=(N=e==null?void 0:e.position_details)==null?void 0:N.position)==null?void 0:P.entryPx,l=parseFloat((R=(I=e==null?void 0:e.position_details)==null?void 0:I.position)==null?void 0:R.unrealizedPnl),c=e.side==="Change Position"?r?"Short > Long":"Long > Short":t??"Position Close",u=t==="Long"||t==="Short",d=({label:L,value:z,extraClass:Q=""})=>i.jsxs("div",{className:"flex flex-col flex-1 px-2",children:[i.jsx("span",{className:"text-white/64 text-[12px] font-medium leading-[13px] tracking-[0.24px]",children:L}),i.jsx("span",{className:`text-[12px] font-semibold leading-[13px] tracking-[0.24px] ${Q}`,children:z})]});return i.jsxs("div",{className:"z-[80] w-[362px] h-[204px] rounded-[16px] bg-white/10 backdrop-blur-[43px] p-3 flex flex-col gap-3",children:[i.jsxs("div",{className:"flex items-center gap-1.5",children:[i.jsx(nVe,{size:20,name:e.wallet}),i.jsxs("span",{className:"text-white font-manrope text-[14px] font-semibold leading-[13px] tracking-[0.28px]",children:[e.wallet.slice(0,6),"...",e.wallet.slice(-4)]})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("img",{src:`https://app.hyperliquid.xyz/coins/${e.coin}.svg`,onError:ra,className:"w-8 h-8"}),i.jsxs("div",{className:"flex flex-col",children:[i.jsx("span",{className:"text-white text-[14px] font-semibold leading-[13px] tracking-[0.28px]",children:e.coin}),i.jsx("span",{className:"text-white/40 text-[12px] font-medium leading-[13px] tracking-[0.24px]",children:e.coin_name||""})]}),i.jsxs("div",{className:"ml-[10px] flex gap-[8px]",children:[i.jsxs("div",{className:`inline-flex items-center gap-1 px-1 py-1 h-6 rounded-[6px] text-[11px] uppercase font-medium ${r?"text-[#67ffbd] bg-[rgba(103,255,189,0.16)]":s?"text-[#ff787b] bg-[rgba(255,131,117,0.16)]":"text-[#8B8B8B] bg-transparent"}`,children:[u&&i.jsx(Ps,{className:`w-3 h-3 ${r?"rotate-180 text-[#67ffbd]":"text-[#ff787b]"}`}),c]}),n&&i.jsxs("div",{className:"inline-flex items-center px-2 py-1 h-6 rounded-[6px] text-[11px] font-medium text-[#67ffbd] bg-[rgba(103,255,189,0.16)]",children:[n,"X"]})]})]}),i.jsx("div",{style:{background:lF},className:"h-px w-full"}),i.jsxs("div",{className:"flex divide-x",style:{divideColor:lF},children:[i.jsx(d,{label:"Trade Value",value:`$${Er(e.current_trade_value)}`,extraClass:"text-[#67FFBD]"}),i.jsx(d,{label:"Side",value:e.side}),i.jsx(d,{label:"Entry",value:isNaN(o)?"-":i.jsx("span",{className:"inline-flex items-center",children:Er(Math.abs(o))})})]}),i.jsx("div",{style:{background:lF},className:"h-px w-full"}),i.jsxs("div",{className:"flex divide-x",style:{divideColor:lF},children:[i.jsx(d,{label:"Size",value:isNaN(a)?"-":Er(Math.abs(a))}),i.jsx(d,{label:"Entry Price",value:`$${Er(((U=(F=e==null?void 0:e.position_details)==null?void 0:F.position)==null?void 0:U.entryPx)||0)}`}),i.jsx(d,{label:"uPnL",value:isNaN(l)?"-":i.jsxs("span",{className:`inline-flex items-center ${l>0?"text-[#67FFBD]":l<0?"text-[#FF797C]":"text-white"}`,children:[`${l<0?"-":""}$${Er(Math.abs(l))}`,i.jsx("img",{src:l>0?aE:oE,className:"ml-[6px] w-[9px] h-[8px]"})]})})]})]})}function J0n(){const[e,t]=m.useState(!1);return m.useEffect(()=>{const n=()=>t(window.innerWidth<640);return n(),window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)},[]),e}const exn="https://dextradata.nftinit.io/api/hyper/trade/highVolumeTrades/",QSe=e=>{const t=Date.now()-e,n=Math.floor(t/6e4);if(n<1)return"now";if(n<60)return`${n}m ago`;const r=Math.floor(n/60);return r<24?`${r}h ago`:`${Math.floor(r/24)}d ago`},qX=e=>{if(e==null)return"-";const t=Number(e),n=t<0?"-":"",r=Math.abs(t);return r>=1e9?`${n}$${(r/1e9).toFixed(2)}B`:r>=1e6?`${n}$${(r/1e6).toFixed(2)}M`:r>=1e3?`${n}$${(r/1e3).toFixed(2)}K`:`${n}$${r.toFixed(2)}`},txn=e=>e<250?1:e<1e4?2:e<5e4?3:e<1e5?4:e<5e5?5:e<1e6?6:e<5e6?7:8,ZSe=e=>_ue(txn(e)),nxn=()=>{const[e,t]=m.useState([]),[n,r]=m.useState(!0),[s,a]=m.useState(!1),[o,l]=m.useState(Date.now()),[c,u]=m.useState(""),d=J0n(),f=m.useCallback(async(C=!1)=>{C&&r(!0);try{const N=await fs.post(exn,{limit:1e3,offset:0});if(N.data.success){const P=N.data.data.filter(I=>{var R;return!((R=I==null?void 0:I.typeDetail)!=null&&R.includes("Top100Wallet"))});t(P),l(Date.now())}}finally{C&&r(!1)}},[]);m.useEffect(()=>{f(!0);const C=setInterval(f,3e4);return()=>clearInterval(C)},[f]);const x=m.useMemo(()=>c?e.filter(C=>{var P;if(!c)return!0;const N=ZSe((C==null?void 0:C.global_account_value)??0);return c===((P=V_.find(I=>I.label===N.label))==null?void 0:P.id)}):e,[e,c]),g=[{key:"wallet",label:"Address",width:"235px",render:(C,N)=>{const P=(N==null?void 0:N.global_account_value)??0,I=ZSe(P);return i.jsx(mi,{content:i.jsx(Z0n,{row:N}),children:i.jsxs("div",{className:"flex items-center gap-1.5 text-[14px] tracking-[0.24px] cursor-pointer",children:[i.jsx("span",{className:"text-[18px] leading-none",children:I.emoji}),i.jsxs("span",{className:"max-w-20 mr-2",children:[N.wallet.slice(0,5),"...",N.wallet.slice(-4)]}),i.jsx("span",{className:`flex justify-center items-center px-1 h-6 rounded-[6px] text-[11px] font-medium ml-[10px] ${I.bg} ${I.txt}`,children:I.label})]})})}},{key:"coin",label:"Symbol",width:"114px",sortable:!0,render:(C,N)=>i.jsxs("div",{className:"flex items-center gap-2 text-[14px]",children:[i.jsx("img",{src:`https://app.hyperliquid.xyz/coins/${N.coin}.svg`,onError:ra,className:"w-5 h-5"}),N.coin]})},{key:"activity",label:"Activity",width:"130px",render:(C,N)=>{var z,Q,ne,J;const P=(z=N==null?void 0:N.position_details)==null?void 0:z.direction,I=P==="Long",R=P==="Short",F=(J=(ne=(Q=N==null?void 0:N.position_details)==null?void 0:Q.position)==null?void 0:ne.leverage)==null?void 0:J.value,U=N.side==="Change Position"?I?"Short > Long":"Long > Short":P??"Position Close",L=P==="Long"||P==="Short";return i.jsxs("div",{className:"flex items-center gap-1",children:[i.jsxs("div",{className:`inline-flex justify-center items-center gap-1 px-2 py-1 h-6 rounded-[6px] text-[11px] uppercase font-medium ${I?"text-[#67ffbd] bg-[rgba(103,255,189,0.16)]":R?"text-[#ff787b] bg-[rgba(255,131,117,0.16)]":"text-[#8B8B8B] bg-transparent"}`,children:[L&&i.jsx(Ps,{className:`w-3 h-3 ${I?"rotate-180 text-[#67ffbd]":"text-[#ff787b]"}`}),U]}),F&&i.jsxs("div",{className:`inline-flex justify-center items-center px-2 py-1 h-6 rounded-[6px] text-[11px] font-medium
${I?"text-[#67ffbd] bg-[rgba(103,255,189,0.16)]":R?"text-[#ff787b] bg-[rgba(255,131,117,0.16)]":"text-[#8B8B8B] bg-transparent"}`,children:[F,"X"]})]})}},{key:"current_trade_value",label:"Trade",width:"70px",sortable:!0,render:C=>qX(C)},{key:"position_value",label:"Position",sortable:!0,width:"85px",sortValue:C=>{var N,P;return Number((P=(N=C==null?void 0:C.position_details)==null?void 0:N.position)==null?void 0:P.positionValue)},render:(C,N)=>{var P,I;return(I=(P=N==null?void 0:N.position_details)==null?void 0:P.position)!=null&&I.positionValue?qX(N.position_details.position.positionValue):"-"}},{key:"price",label:"Price",width:"80px",sortable:!0,sortValue:C=>{var N,P;return Number((P=(N=C==null?void 0:C.position_details)==null?void 0:N.position)==null?void 0:P.entryPx)},render:(C,N)=>{var P,I;return(I=(P=N==null?void 0:N.position_details)==null?void 0:P.position)!=null&&I.entryPx?qX(N.position_details.position.entryPx):"-"}},{key:"flags",label:i.jsx(mi,{content:"Quick view of this whale’s recent trading performance.",children:i.jsx("span",{children:"Last 5 T."})}),width:"90px",render:(C,N)=>{const P=N.last5Trade??[];return i.jsx("div",{className:"inline-flex h-[18px] px-[2px] py-[4px] justify-center items-center rounded-[6px] overflow-visible",children:P.slice(0,5).map((I,R)=>{let F="",U=null;return I===null?(F="bg-[#747474]",U=f8e):I===!0?(F="bg-[#67FFBD]",U=d8e):(F="bg-[#FF9C9C]",U=h8e),i.jsx("div",{className:`relative z[${R}] w-[18px] h-[18px] flex-shrink-0 flex items-center justify-center rounded-full border-2 border-[#101010] ${F} ${R!==0?"-ml-[6px]":""}`,children:i.jsx(U,{className:"w-3 h-3 text-black"})},R)})})}},{key:"insert_date",label:"Time",sortable:!0,width:"80px",sortValue:C=>{var N;return(N=C.insert_date)==null?void 0:N.$date},render:(C,N)=>{var P;return i.jsx("div",{className:"text-gray-400",children:QSe(new Date((P=N.insert_date)==null?void 0:P.$date).getTime())})}}],v=m.useMemo(()=>d?g.slice(1):g,[g,d]),w=(C,N)=>{var z;const I=((z=C==null?void 0:C.position_details)==null?void 0:z.direction)==="Long",R=C.current_trade_value>=5e6,F=R?I?"before:bg-[#67FFBD] before:shadow-[0_0_12px_#67FFBD] before:h-[24px] before:top-1/2 before:-translate-y-1/2":"before:bg-[#FF797C] before:shadow-[0_0_12px_#FF797C] before:h-[24px] before:top-1/2 before:-translate-y-1/2":"before:bg-transparent";return`
relative before:content-[''] before:absolute before:left-[8px] before:w-[2px] before:rounded-full
${R?I?"bg-[rgba(103,255,189,0.16)]":"bg-[rgba(255,131,117,0.16)]":N%2===0?"bg-[#191919]":"bg-transparent"} ${F} ${R?I?"hover:bg-[rgba(14,70,53,0.32)]":"hover:bg-[rgba(74,16,18,0.32)]":"hover:bg-[rgba(39,39,39,0.32)]"} cursor-pointer mb-4 py-5 transition-colors duration-300
`};return n?i.jsxs("div",{className:"rounded-[16px] border border-[#1E1E1E] bg-[#101010] p-4 space-y-4",children:[i.jsx("div",{className:"flex justify-end",children:i.jsx("div",{className:"h-8 w-24 bg-[#202020] rounded-[8px] animate-pulse"})}),i.jsx("div",{className:"space-y-3",children:[...Array(7)].map((C,N)=>i.jsx("div",{className:"h-[34px] w-full bg-[#202020] rounded-md animate-pulse"},N))})]}):i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"w-full font-manrope font-medium relative mt-1",children:[i.jsxs("div",{className:"flex items-center justify-between pb-2",children:[i.jsx(mi,{content:"Real-time view of whales’ largest open positions.",children:i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("h2",{className:"text-white text-[16px] leading-[21px] font-medium tracking-[-0.32px] pl-[5px] font-inter",children:"Hot Whale Trades"}),i.jsxs("div",{className:"flex items-center gap-1 bg-[#262626] p-1 rounded-full w-fit",children:[i.jsxs("div",{className:"relative w-2 h-2 flex justify-center items-center",children:[i.jsx("span",{className:"absolute inline-flex h-full w-full rounded-full bg-[#4DFF43]/[0.32] animate-ping"}),i.jsx("span",{className:"relative inline-flex rounded-full h-1.5 w-1.5 bg-[#4DFF43]"})]}),i.jsx("span",{className:"text-white text-[10px] leading-[10px] font-medium",children:"LIVE"})]}),i.jsx("img",{className:"-ml-[4px]",src:E0,alt:"Dextrabot - Whale Trades"})]})}),i.jsxs("span",{className:"text-[#929292] text-[12px] font-medium",children:["Last updated ",QSe(o)]})]}),i.jsxs("div",{className:"laser-frame",children:[i.jsx("span",{className:"laser-beam"}),i.jsxs("div",{className:"pt-3 pl-3 pr-3 border border-[#1E1E1E] bg-[#101010] rounded-[16px]",children:[i.jsxs("div",{className:"w-full flex items-center justify-between mb-3",children:[i.jsx("div",{className:"flex items-center gap-[12px]",children:i.jsx("div",{className:"sm:w-auto w-[260px] overflow-x-auto whitespace-nowrap flex items-center gap-[12px] scrollbar-thin scrollbar-thumb-[#444] scrollbar-track-transparent",children:i.jsxs("div",{className:"flex items-center gap-[12px]",children:[i.jsx("div",{onClick:()=>u(""),className:`flex items-center justify-center h-7 w-7 px-4 rounded-[8px] text-white text-[14px] font-inter leading-[16px] cursor-pointer transition-colors ${c===""?"bg-[#262626]":"hover:bg-[#262626]"}`,children:"All"}),V_.map(({id:C,label:N,emoji:P,description:I})=>{const R=c===C;return i.jsx("div",{onClick:()=>u(R?"":C),className:`h-7 w-7 flex items-center justify-center rounded-[8px] text-[18px] transition-colors cursor-pointer ${R?"bg-[#262626]":"hover:bg-[#262626]"}`,children:i.jsx(mi,{content:I,children:P})},C)})]})})}),i.jsxs("div",{className:"flex items-center justify-center w-12 sm:w-40 font-medium text-[#929292] text-[14px] leading-[18px] gap-2 px-4 py-2 cursor-pointer bg-[#262626] rounded-[8px] hover:scale-105 hover:bg-[#585858] hover:text-white transition-all",onClick:()=>a(!0),children:[i.jsx("span",{className:"hidden sm:inline",children:"View Full Activity"}),i.jsx("img",{src:Myt,alt:"Expand",className:"w-5 h-5 sm:hidden"})]})]}),x.length===0?i.jsx("div",{className:"h-[312px] flex items-center justify-center text-[#9B9B9B] text-sm",children:"No data available for this filter."}):i.jsx(Ru,{data:x,columns:v,tableClassName:"text-[14px]",theadClassName:"text-[13px] font-inter !text-[#9B9B9B] bg-transparent font-normal",tbodyClassName:"text-[14px]",cellClassName:"text-[14px] text-right font-medium",rowClassName:w,rowHeight:42,listHeight:285,rowKey:C=>{var N,P;return((N=C._id)==null?void 0:N.$oid)||((P=C.insert_date)==null?void 0:P.$date)},onVisibleRows:()=>{},onRowClick:C=>window.open(`/wallet-details/${C.wallet}`,"_blank")})]})]})]}),s&&i.jsxs(up,{isOpen:s,onClose:()=>a(!1),fullscreen:d,children:[i.jsx("div",{className:"hidden sm:flex w-[95vw] max-h-[95vh] bg-[#101010] rounded-lg flex-col",children:i.jsx("div",{className:"px-4 py-2 overflow-x-auto",children:i.jsx("div",{className:"min-w-[1000px]",children:i.jsx(KSe,{})})})}),i.jsx("div",{className:" w-screen h-screen bg-[#101010] flex flex-col overflow-x-auto overflow-y-auto z-[9999]",children:i.jsx(KSe,{})})]})]})};function ui(e,t,{checkForDefaultPrevented:n=!0}={}){return function(s){if(e==null||e(s),n===!1||!s.defaultPrevented)return t==null?void 0:t(s)}}function JSe(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function bU(...e){return t=>{let n=!1;const r=e.map(s=>{const a=JSe(s,t);return!n&&typeof a=="function"&&(n=!0),a});if(n)return()=>{for(let s=0;s<r.length;s++){const a=r[s];typeof a=="function"?a():JSe(e[s],null)}}}}function au(...e){return m.useCallback(bU(...e),e)}function _5(e,t=[]){let n=[];function r(a,o){const l=m.createContext(o),c=n.length;n=[...n,o];const u=f=>{var N;const{scope:x,children:g,...v}=f,w=((N=x==null?void 0:x[e])==null?void 0:N[c])||l,C=m.useMemo(()=>v,Object.values(v));return i.jsx(w.Provider,{value:C,children:g})};u.displayName=a+"Provider";function d(f,x){var w;const g=((w=x==null?void 0:x[e])==null?void 0:w[c])||l,v=m.useContext(g);if(v)return v;if(o!==void 0)return o;throw new Error(`\`${f}\` must be used within \`${a}\``)}return[u,d]}const s=()=>{const a=n.map(o=>m.createContext(o));return function(l){const c=(l==null?void 0:l[e])||a;return m.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])}};return s.scopeName=e,[r,rxn(s,...t)]}function rxn(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(a){const o=r.reduce((l,{useScope:c,scopeName:u})=>{const f=c(a)[`__scope${u}`];return{...l,...f}},{});return m.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return n.scopeName=t.scopeName,n}var Zy=globalThis!=null&&globalThis.document?m.useLayoutEffect:()=>{},sxn=Iy[" useInsertionEffect ".trim().toString()]||Zy;function yU({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[s,a,o]=ixn({defaultProp:t,onChange:n}),l=e!==void 0,c=l?e:s;{const d=m.useRef(e!==void 0);m.useEffect(()=>{const f=d.current;f!==l&&console.warn(`${r} is changing from ${f?"controlled":"uncontrolled"} to ${l?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),d.current=l},[l,r])}const u=m.useCallback(d=>{var f;if(l){const x=axn(d)?d(e):d;x!==e&&((f=o.current)==null||f.call(o,x))}else a(d)},[l,e,a,o]);return[c,u]}function ixn({defaultProp:e,onChange:t}){const[n,r]=m.useState(e),s=m.useRef(n),a=m.useRef(t);return sxn(()=>{a.current=t},[t]),m.useEffect(()=>{var o;s.current!==n&&((o=a.current)==null||o.call(a,n),s.current=n)},[n,s]),[n,r,a]}function axn(e){return typeof e=="function"}function W_(e){const t=oxn(e),n=m.forwardRef((r,s)=>{const{children:a,...o}=r,l=m.Children.toArray(a),c=l.find(cxn);if(c){const u=c.props.children,d=l.map(f=>f===c?m.Children.count(u)>1?m.Children.only(null):m.isValidElement(u)?u.props.children:null:f);return i.jsx(t,{...o,ref:s,children:m.isValidElement(u)?m.cloneElement(u,void 0,d):null})}return i.jsx(t,{...o,ref:s,children:a})});return n.displayName=`${e}.Slot`,n}function oxn(e){const t=m.forwardRef((n,r)=>{const{children:s,...a}=n;if(m.isValidElement(s)){const o=dxn(s),l=uxn(a,s.props);return s.type!==m.Fragment&&(l.ref=r?bU(r,o):o),m.cloneElement(s,l)}return m.Children.count(s)>1?m.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var lxn=Symbol("radix.slottable");function cxn(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===lxn}function uxn(e,t){const n={...t};for(const r in t){const s=e[r],a=t[r];/^on[A-Z]/.test(r)?s&&a?n[r]=(...l)=>{const c=a(...l);return s(...l),c}:s&&(n[r]=s):r==="style"?n[r]={...s,...a}:r==="className"&&(n[r]=[s,a].filter(Boolean).join(" "))}return{...e,...n}}function dxn(e){var r,s;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var fxn=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Lc=fxn.reduce((e,t)=>{const n=W_(`Primitive.${t}`),r=m.forwardRef((s,a)=>{const{asChild:o,...l}=s,c=o?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),i.jsx(c,{...l,ref:a})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function rVe(e,t){e&&Na.flushSync(()=>e.dispatchEvent(t))}function sVe(e){const t=e+"CollectionProvider",[n,r]=_5(t),[s,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=w=>{const{scope:C,children:N}=w,P=Ae.useRef(null),I=Ae.useRef(new Map).current;return i.jsx(s,{scope:C,itemMap:I,collectionRef:P,children:N})};o.displayName=t;const l=e+"CollectionSlot",c=W_(l),u=Ae.forwardRef((w,C)=>{const{scope:N,children:P}=w,I=a(l,N),R=au(C,I.collectionRef);return i.jsx(c,{ref:R,children:P})});u.displayName=l;const d=e+"CollectionItemSlot",f="data-radix-collection-item",x=W_(d),g=Ae.forwardRef((w,C)=>{const{scope:N,children:P,...I}=w,R=Ae.useRef(null),F=au(C,R),U=a(d,N);return Ae.useEffect(()=>(U.itemMap.set(R,{ref:R,...I}),()=>void U.itemMap.delete(R))),i.jsx(x,{[f]:"",ref:F,children:P})});g.displayName=d;function v(w){const C=a(e+"CollectionConsumer",w);return Ae.useCallback(()=>{const P=C.collectionRef.current;if(!P)return[];const I=Array.from(P.querySelectorAll(`[${f}]`));return Array.from(C.itemMap.values()).sort((U,L)=>I.indexOf(U.ref.current)-I.indexOf(L.ref.current))},[C.collectionRef,C.itemMap])}return[{Provider:o,Slot:u,ItemSlot:g},v,r]}var hxn=m.createContext(void 0);function iVe(e){const t=m.useContext(hxn);return e||t||"ltr"}function y1(e){const t=m.useRef(e);return m.useEffect(()=>{t.current=e}),m.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function pxn(e,t=globalThis==null?void 0:globalThis.document){const n=y1(e);m.useEffect(()=>{const r=s=>{s.key==="Escape"&&n(s)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var mxn="DismissableLayer",xre="dismissableLayer.update",xxn="dismissableLayer.pointerDownOutside",gxn="dismissableLayer.focusOutside",eNe,aVe=m.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),vU=m.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:a,onInteractOutside:o,onDismiss:l,...c}=e,u=m.useContext(aVe),[d,f]=m.useState(null),x=(d==null?void 0:d.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,g]=m.useState({}),v=au(t,L=>f(L)),w=Array.from(u.layers),[C]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),N=w.indexOf(C),P=d?w.indexOf(d):-1,I=u.layersWithOutsidePointerEventsDisabled.size>0,R=P>=N,F=vxn(L=>{const z=L.target,Q=[...u.branches].some(ne=>ne.contains(z));!R||Q||(s==null||s(L),o==null||o(L),L.defaultPrevented||l==null||l())},x),U=wxn(L=>{const z=L.target;[...u.branches].some(ne=>ne.contains(z))||(a==null||a(L),o==null||o(L),L.defaultPrevented||l==null||l())},x);return pxn(L=>{P===u.layers.size-1&&(r==null||r(L),!L.defaultPrevented&&l&&(L.preventDefault(),l()))},x),m.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(eNe=x.body.style.pointerEvents,x.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),tNe(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(x.body.style.pointerEvents=eNe)}},[d,x,n,u]),m.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),tNe())},[d,u]),m.useEffect(()=>{const L=()=>g({});return document.addEventListener(xre,L),()=>document.removeEventListener(xre,L)},[]),i.jsx(Lc.div,{...c,ref:v,style:{pointerEvents:I?R?"auto":"none":void 0,...e.style},onFocusCapture:ui(e.onFocusCapture,U.onFocusCapture),onBlurCapture:ui(e.onBlurCapture,U.onBlurCapture),onPointerDownCapture:ui(e.onPointerDownCapture,F.onPointerDownCapture)})});vU.displayName=mxn;var bxn="DismissableLayerBranch",yxn=m.forwardRef((e,t)=>{const n=m.useContext(aVe),r=m.useRef(null),s=au(t,r);return m.useEffect(()=>{const a=r.current;if(a)return n.branches.add(a),()=>{n.branches.delete(a)}},[n.branches]),i.jsx(Lc.div,{...e,ref:s})});yxn.displayName=bxn;function vxn(e,t=globalThis==null?void 0:globalThis.document){const n=y1(e),r=m.useRef(!1),s=m.useRef(()=>{});return m.useEffect(()=>{const a=l=>{if(l.target&&!r.current){let c=function(){oVe(xxn,n,u,{discrete:!0})};const u={originalEvent:l};l.pointerType==="touch"?(t.removeEventListener("click",s.current),s.current=c,t.addEventListener("click",s.current,{once:!0})):c()}else t.removeEventListener("click",s.current);r.current=!1},o=window.setTimeout(()=>{t.addEventListener("pointerdown",a)},0);return()=>{window.clearTimeout(o),t.removeEventListener("pointerdown",a),t.removeEventListener("click",s.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function wxn(e,t=globalThis==null?void 0:globalThis.document){const n=y1(e),r=m.useRef(!1);return m.useEffect(()=>{const s=a=>{a.target&&!r.current&&oVe(gxn,n,{originalEvent:a},{discrete:!1})};return t.addEventListener("focusin",s),()=>t.removeEventListener("focusin",s)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function tNe(){const e=new CustomEvent(xre);document.dispatchEvent(e)}function oVe(e,t,n,{discrete:r}){const s=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&s.addEventListener(e,t,{once:!0}),r?rVe(s,a):s.dispatchEvent(a)}var GX=0;function lVe(){m.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??nNe()),document.body.insertAdjacentElement("beforeend",e[1]??nNe()),GX++,()=>{GX===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),GX--}},[])}function nNe(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var KX="focusScope.autoFocusOnMount",YX="focusScope.autoFocusOnUnmount",rNe={bubbles:!1,cancelable:!0},Cxn="FocusScope",kue=m.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:s,onUnmountAutoFocus:a,...o}=e,[l,c]=m.useState(null),u=y1(s),d=y1(a),f=m.useRef(null),x=au(t,w=>c(w)),g=m.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;m.useEffect(()=>{if(r){let w=function(I){if(g.paused||!l)return;const R=I.target;l.contains(R)?f.current=R:_b(f.current,{select:!0})},C=function(I){if(g.paused||!l)return;const R=I.relatedTarget;R!==null&&(l.contains(R)||_b(f.current,{select:!0}))},N=function(I){if(document.activeElement===document.body)for(const F of I)F.removedNodes.length>0&&_b(l)};document.addEventListener("focusin",w),document.addEventListener("focusout",C);const P=new MutationObserver(N);return l&&P.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",w),document.removeEventListener("focusout",C),P.disconnect()}}},[r,l,g.paused]),m.useEffect(()=>{if(l){iNe.add(g);const w=document.activeElement;if(!l.contains(w)){const N=new CustomEvent(KX,rNe);l.addEventListener(KX,u),l.dispatchEvent(N),N.defaultPrevented||(Sxn(_xn(cVe(l)),{select:!0}),document.activeElement===w&&_b(l))}return()=>{l.removeEventListener(KX,u),setTimeout(()=>{const N=new CustomEvent(YX,rNe);l.addEventListener(YX,d),l.dispatchEvent(N),N.defaultPrevented||_b(w??document.body,{select:!0}),l.removeEventListener(YX,d),iNe.remove(g)},0)}}},[l,u,d,g]);const v=m.useCallback(w=>{if(!n&&!r||g.paused)return;const C=w.key==="Tab"&&!w.altKey&&!w.ctrlKey&&!w.metaKey,N=document.activeElement;if(C&&N){const P=w.currentTarget,[I,R]=Nxn(P);I&&R?!w.shiftKey&&N===R?(w.preventDefault(),n&&_b(I,{select:!0})):w.shiftKey&&N===I&&(w.preventDefault(),n&&_b(R,{select:!0})):N===P&&w.preventDefault()}},[n,r,g.paused]);return i.jsx(Lc.div,{tabIndex:-1,...o,ref:x,onKeyDown:v})});kue.displayName=Cxn;function Sxn(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(_b(r,{select:t}),document.activeElement!==n)return}function Nxn(e){const t=cVe(e),n=sNe(t,e),r=sNe(t.reverse(),e);return[n,r]}function cVe(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const s=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||s?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function sNe(e,t){for(const n of e)if(!Axn(n,{upTo:t}))return n}function Axn(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function jxn(e){return e instanceof HTMLInputElement&&"select"in e}function _b(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&jxn(e)&&t&&e.select()}}var iNe=Exn();function Exn(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=aNe(e,t),e.unshift(t)},remove(t){var n;e=aNe(e,t),(n=e[0])==null||n.resume()}}}function aNe(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function _xn(e){return e.filter(t=>t.tagName!=="A")}var kxn=Iy[" useId ".trim().toString()]||(()=>{}),Txn=0;function rD(e){const[t,n]=m.useState(kxn());return Zy(()=>{e||n(r=>r??String(Txn++))},[e]),e||(t?`radix-${t}`:"")}var Ixn=typeof document<"u",Pxn=function(){},PO=Ixn?m.useLayoutEffect:Pxn;function sD(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,s;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(!sD(e[r],t[r]))return!1;return!0}if(s=Object.keys(e),n=s.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,s[r]))return!1;for(r=n;r--!==0;){const a=s[r];if(!(a==="_owner"&&e.$$typeof)&&!sD(e[a],t[a]))return!1}return!0}return e!==e&&t!==t}function uVe(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function oNe(e,t){const n=uVe(e);return Math.round(t*n)/n}function XX(e){const t=m.useRef(e);return PO(()=>{t.current=e}),t}function Fxn(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:s,elements:{reference:a,floating:o}={},transform:l=!0,whileElementsMounted:c,open:u}=e,[d,f]=m.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[x,g]=m.useState(r);sD(x,r)||g(r);const[v,w]=m.useState(null),[C,N]=m.useState(null),P=m.useCallback(G=>{G!==U.current&&(U.current=G,w(G))},[]),I=m.useCallback(G=>{G!==L.current&&(L.current=G,N(G))},[]),R=a||v,F=o||C,U=m.useRef(null),L=m.useRef(null),z=m.useRef(d),Q=c!=null,ne=XX(c),J=XX(s),X=XX(u),re=m.useCallback(()=>{if(!U.current||!L.current)return;const G={placement:t,strategy:n,middleware:x};J.current&&(G.platform=J.current),$Ae(U.current,L.current,G).then(V=>{const ee={...V,isPositioned:X.current!==!1};pe.current&&!sD(z.current,ee)&&(z.current=ee,Na.flushSync(()=>{f(ee)}))})},[x,t,n,J,X]);PO(()=>{u===!1&&z.current.isPositioned&&(z.current.isPositioned=!1,f(G=>({...G,isPositioned:!1})))},[u]);const pe=m.useRef(!1);PO(()=>(pe.current=!0,()=>{pe.current=!1}),[]),PO(()=>{if(R&&(U.current=R),F&&(L.current=F),R&&F){if(ne.current)return ne.current(R,F,re);re()}},[R,F,re,ne,Q]);const Y=m.useMemo(()=>({reference:U,floating:L,setReference:P,setFloating:I}),[P,I]),ie=m.useMemo(()=>({reference:R,floating:F}),[R,F]),oe=m.useMemo(()=>{const G={position:n,left:0,top:0};if(!ie.floating)return G;const V=oNe(ie.floating,d.x),ee=oNe(ie.floating,d.y);return l?{...G,transform:"translate("+V+"px, "+ee+"px)",...uVe(ie.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:V,top:ee}},[n,l,ie.floating,d.x,d.y]);return m.useMemo(()=>({...d,update:re,refs:Y,elements:ie,floatingStyles:oe}),[d,re,Y,ie,oe])}const Oxn=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:s}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?Kde({element:r.current,padding:s}).fn(n):{}:r?Kde({element:r,padding:s}).fn(n):{}}}},Mxn=(e,t)=>({...RAe(e),options:[e,t]}),Rxn=(e,t)=>({...LAe(e),options:[e,t]}),Lxn=(e,t)=>({...QQe(e),options:[e,t]}),Dxn=(e,t)=>({...DAe(e),options:[e,t]}),Bxn=(e,t)=>({...BAe(e),options:[e,t]}),$xn=(e,t)=>({...XQe(e),options:[e,t]}),Uxn=(e,t)=>({...Oxn(e),options:[e,t]});var zxn="Arrow",dVe=m.forwardRef((e,t)=>{const{children:n,width:r=10,height:s=5,...a}=e;return i.jsx(Lc.svg,{...a,ref:t,width:r,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:i.jsx("polygon",{points:"0,0 30,0 15,10"})})});dVe.displayName=zxn;var Hxn=dVe;function Vxn(e){const[t,n]=m.useState(void 0);return Zy(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const a=s[0];let o,l;if("borderBoxSize"in a){const c=a.borderBoxSize,u=Array.isArray(c)?c[0]:c;o=u.inlineSize,l=u.blockSize}else o=e.offsetWidth,l=e.offsetHeight;n({width:o,height:l})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var Tue="Popper",[fVe,c8]=_5(Tue),[Wxn,hVe]=fVe(Tue),pVe=e=>{const{__scopePopper:t,children:n}=e,[r,s]=m.useState(null);return i.jsx(Wxn,{scope:t,anchor:r,onAnchorChange:s,children:n})};pVe.displayName=Tue;var mVe="PopperAnchor",xVe=m.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...s}=e,a=hVe(mVe,n),o=m.useRef(null),l=au(t,o);return m.useEffect(()=>{a.onAnchorChange((r==null?void 0:r.current)||o.current)}),r?null:i.jsx(Lc.div,{...s,ref:l})});xVe.displayName=mVe;var Iue="PopperContent",[qxn,Gxn]=fVe(Iue),gVe=m.forwardRef((e,t)=>{var ve,je,Ie,Le,Qe,$e;const{__scopePopper:n,side:r="bottom",sideOffset:s=0,align:a="center",alignOffset:o=0,arrowPadding:l=0,avoidCollisions:c=!0,collisionBoundary:u=[],collisionPadding:d=0,sticky:f="partial",hideWhenDetached:x=!1,updatePositionStrategy:g="optimized",onPlaced:v,...w}=e,C=hVe(Iue,n),[N,P]=m.useState(null),I=au(t,it=>P(it)),[R,F]=m.useState(null),U=Vxn(R),L=(U==null?void 0:U.width)??0,z=(U==null?void 0:U.height)??0,Q=r+(a!=="center"?"-"+a:""),ne=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},J=Array.isArray(u)?u:[u],X=J.length>0,re={padding:ne,boundary:J.filter(Yxn),altBoundary:X},{refs:pe,floatingStyles:Y,placement:ie,isPositioned:oe,middlewareData:G}=Fxn({strategy:"fixed",placement:Q,whileElementsMounted:(...it)=>MAe(...it,{animationFrame:g==="always"}),elements:{reference:C.anchor},middleware:[Mxn({mainAxis:s+z,alignmentAxis:o}),c&&Rxn({mainAxis:!0,crossAxis:!1,limiter:f==="partial"?Lxn():void 0,...re}),c&&Dxn({...re}),Bxn({...re,apply:({elements:it,rects:tt,availableWidth:lt,availableHeight:ft})=>{const{width:ut,height:qt}=tt.reference,It=it.floating.style;It.setProperty("--radix-popper-available-width",`${lt}px`),It.setProperty("--radix-popper-available-height",`${ft}px`),It.setProperty("--radix-popper-anchor-width",`${ut}px`),It.setProperty("--radix-popper-anchor-height",`${qt}px`)}}),R&&Uxn({element:R,padding:l}),Xxn({arrowWidth:L,arrowHeight:z}),x&&$xn({strategy:"referenceHidden",...re})]}),[V,ee]=vVe(ie),ae=y1(v);Zy(()=>{oe&&(ae==null||ae())},[oe,ae]);const fe=(ve=G.arrow)==null?void 0:ve.x,Ne=(je=G.arrow)==null?void 0:je.y,he=((Ie=G.arrow)==null?void 0:Ie.centerOffset)!==0,[ge,ye]=m.useState();return Zy(()=>{N&&ye(window.getComputedStyle(N).zIndex)},[N]),i.jsx("div",{ref:pe.setFloating,"data-radix-popper-content-wrapper":"",style:{...Y,transform:oe?Y.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ge,"--radix-popper-transform-origin":[(Le=G.transformOrigin)==null?void 0:Le.x,(Qe=G.transformOrigin)==null?void 0:Qe.y].join(" "),...(($e=G.hide)==null?void 0:$e.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:i.jsx(qxn,{scope:n,placedSide:V,onArrowChange:F,arrowX:fe,arrowY:Ne,shouldHideArrow:he,children:i.jsx(Lc.div,{"data-side":V,"data-align":ee,...w,ref:I,style:{...w.style,animation:oe?void 0:"none"}})})})});gVe.displayName=Iue;var bVe="PopperArrow",Kxn={top:"bottom",right:"left",bottom:"top",left:"right"},yVe=m.forwardRef(function(t,n){const{__scopePopper:r,...s}=t,a=Gxn(bVe,r),o=Kxn[a.placedSide];return i.jsx("span",{ref:a.onArrowChange,style:{position:"absolute",left:a.arrowX,top:a.arrowY,[o]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[a.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[a.placedSide],visibility:a.shouldHideArrow?"hidden":void 0},children:i.jsx(Hxn,{...s,ref:n,style:{...s.style,display:"block"}})})});yVe.displayName=bVe;function Yxn(e){return e!==null}var Xxn=e=>({name:"transformOrigin",options:e,fn(t){var C,N,P;const{placement:n,rects:r,middlewareData:s}=t,o=((C=s.arrow)==null?void 0:C.centerOffset)!==0,l=o?0:e.arrowWidth,c=o?0:e.arrowHeight,[u,d]=vVe(n),f={start:"0%",center:"50%",end:"100%"}[d],x=(((N=s.arrow)==null?void 0:N.x)??0)+l/2,g=(((P=s.arrow)==null?void 0:P.y)??0)+c/2;let v="",w="";return u==="bottom"?(v=o?f:`${x}px`,w=`${-c}px`):u==="top"?(v=o?f:`${x}px`,w=`${r.floating.height+c}px`):u==="right"?(v=`${-c}px`,w=o?f:`${g}px`):u==="left"&&(v=`${r.floating.width+c}px`,w=o?f:`${g}px`),{data:{x:v,y:w}}}});function vVe(e){const[t,n="center"]=e.split("-");return[t,n]}var Pue=pVe,wU=xVe,Fue=gVe,Oue=yVe,Qxn="Portal",Mue=m.forwardRef((e,t)=>{var l;const{container:n,...r}=e,[s,a]=m.useState(!1);Zy(()=>a(!0),[]);const o=n||s&&((l=globalThis==null?void 0:globalThis.document)==null?void 0:l.body);return o?vre.createPortal(i.jsx(Lc.div,{...r,ref:t}),o):null});Mue.displayName=Qxn;function Zxn(e,t){return m.useReducer((n,r)=>t[n][r]??n,e)}var C2=e=>{const{present:t,children:n}=e,r=Jxn(t),s=typeof n=="function"?n({present:r.isPresent}):m.Children.only(n),a=au(r.ref,egn(s));return typeof n=="function"||r.isPresent?m.cloneElement(s,{ref:a}):null};C2.displayName="Presence";function Jxn(e){const[t,n]=m.useState(),r=m.useRef(null),s=m.useRef(e),a=m.useRef("none"),o=e?"mounted":"unmounted",[l,c]=Zxn(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return m.useEffect(()=>{const u=cF(r.current);a.current=l==="mounted"?u:"none"},[l]),Zy(()=>{const u=r.current,d=s.current;if(d!==e){const x=a.current,g=cF(u);e?c("MOUNT"):g==="none"||(u==null?void 0:u.display)==="none"?c("UNMOUNT"):c(d&&x!==g?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,c]),Zy(()=>{if(t){let u;const d=t.ownerDocument.defaultView??window,f=g=>{const w=cF(r.current).includes(g.animationName);if(g.target===t&&w&&(c("ANIMATION_END"),!s.current)){const C=t.style.animationFillMode;t.style.animationFillMode="forwards",u=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=C)})}},x=g=>{g.target===t&&(a.current=cF(r.current))};return t.addEventListener("animationstart",x),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{d.clearTimeout(u),t.removeEventListener("animationstart",x),t.removeEventListener("animationcancel",f),t.removeEventListener("animationend",f)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:m.useCallback(u=>{r.current=u?getComputedStyle(u):null,n(u)},[])}}function cF(e){return(e==null?void 0:e.animationName)||"none"}function egn(e){var r,s;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var QX="rovingFocusGroup.onEntryFocus",tgn={bubbles:!1,cancelable:!0},wT="RovingFocusGroup",[gre,wVe,ngn]=sVe(wT),[rgn,CVe]=_5(wT,[ngn]),[sgn,ign]=rgn(wT),SVe=m.forwardRef((e,t)=>i.jsx(gre.Provider,{scope:e.__scopeRovingFocusGroup,children:i.jsx(gre.Slot,{scope:e.__scopeRovingFocusGroup,children:i.jsx(agn,{...e,ref:t})})}));SVe.displayName=wT;var agn=m.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:s=!1,dir:a,currentTabStopId:o,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:c,onEntryFocus:u,preventScrollOnEntryFocus:d=!1,...f}=e,x=m.useRef(null),g=au(t,x),v=iVe(a),[w,C]=yU({prop:o,defaultProp:l??null,onChange:c,caller:wT}),[N,P]=m.useState(!1),I=y1(u),R=wVe(n),F=m.useRef(!1),[U,L]=m.useState(0);return m.useEffect(()=>{const z=x.current;if(z)return z.addEventListener(QX,I),()=>z.removeEventListener(QX,I)},[I]),i.jsx(sgn,{scope:n,orientation:r,dir:v,loop:s,currentTabStopId:w,onItemFocus:m.useCallback(z=>C(z),[C]),onItemShiftTab:m.useCallback(()=>P(!0),[]),onFocusableItemAdd:m.useCallback(()=>L(z=>z+1),[]),onFocusableItemRemove:m.useCallback(()=>L(z=>z-1),[]),children:i.jsx(Lc.div,{tabIndex:N||U===0?-1:0,"data-orientation":r,...f,ref:g,style:{outline:"none",...e.style},onMouseDown:ui(e.onMouseDown,()=>{F.current=!0}),onFocus:ui(e.onFocus,z=>{const Q=!F.current;if(z.target===z.currentTarget&&Q&&!N){const ne=new CustomEvent(QX,tgn);if(z.currentTarget.dispatchEvent(ne),!ne.defaultPrevented){const J=R().filter(ie=>ie.focusable),X=J.find(ie=>ie.active),re=J.find(ie=>ie.id===w),Y=[X,re,...J].filter(Boolean).map(ie=>ie.ref.current);jVe(Y,d)}}F.current=!1}),onBlur:ui(e.onBlur,()=>P(!1))})})}),NVe="RovingFocusGroupItem",AVe=m.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:s=!1,tabStopId:a,children:o,...l}=e,c=rD(),u=a||c,d=ign(NVe,n),f=d.currentTabStopId===u,x=wVe(n),{onFocusableItemAdd:g,onFocusableItemRemove:v,currentTabStopId:w}=d;return m.useEffect(()=>{if(r)return g(),()=>v()},[r,g,v]),i.jsx(gre.ItemSlot,{scope:n,id:u,focusable:r,active:s,children:i.jsx(Lc.span,{tabIndex:f?0:-1,"data-orientation":d.orientation,...l,ref:t,onMouseDown:ui(e.onMouseDown,C=>{r?d.onItemFocus(u):C.preventDefault()}),onFocus:ui(e.onFocus,()=>d.onItemFocus(u)),onKeyDown:ui(e.onKeyDown,C=>{if(C.key==="Tab"&&C.shiftKey){d.onItemShiftTab();return}if(C.target!==C.currentTarget)return;const N=cgn(C,d.orientation,d.dir);if(N!==void 0){if(C.metaKey||C.ctrlKey||C.altKey||C.shiftKey)return;C.preventDefault();let I=x().filter(R=>R.focusable).map(R=>R.ref.current);if(N==="last")I.reverse();else if(N==="prev"||N==="next"){N==="prev"&&I.reverse();const R=I.indexOf(C.currentTarget);I=d.loop?ugn(I,R+1):I.slice(R+1)}setTimeout(()=>jVe(I))}}),children:typeof o=="function"?o({isCurrentTabStop:f,hasTabStop:w!=null}):o})})});AVe.displayName=NVe;var ogn={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function lgn(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function cgn(e,t,n){const r=lgn(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return ogn[r]}function jVe(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function ugn(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var dgn=SVe,fgn=AVe,hgn=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},mC=new WeakMap,uF=new WeakMap,dF={},ZX=0,EVe=function(e){return e&&(e.host||EVe(e.parentNode))},pgn=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=EVe(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},mgn=function(e,t,n,r){var s=pgn(t,Array.isArray(e)?e:[e]);dF[n]||(dF[n]=new WeakMap);var a=dF[n],o=[],l=new Set,c=new Set(s),u=function(f){!f||l.has(f)||(l.add(f),u(f.parentNode))};s.forEach(u);var d=function(f){!f||c.has(f)||Array.prototype.forEach.call(f.children,function(x){if(l.has(x))d(x);else try{var g=x.getAttribute(r),v=g!==null&&g!=="false",w=(mC.get(x)||0)+1,C=(a.get(x)||0)+1;mC.set(x,w),a.set(x,C),o.push(x),w===1&&v&&uF.set(x,!0),C===1&&x.setAttribute(n,"true"),v||x.setAttribute(r,"true")}catch(N){console.error("aria-hidden: cannot operate on ",x,N)}})};return d(t),l.clear(),ZX++,function(){o.forEach(function(f){var x=mC.get(f)-1,g=a.get(f)-1;mC.set(f,x),a.set(f,g),x||(uF.has(f)||f.removeAttribute(r),uF.delete(f)),g||f.removeAttribute(n)}),ZX--,ZX||(mC=new WeakMap,mC=new WeakMap,uF=new WeakMap,dF={})}},_Ve=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),s=hgn(e);return s?(r.push.apply(r,Array.from(s.querySelectorAll("[aria-live], script"))),mgn(r,s,n,"aria-hidden")):function(){return null}},Rb=function(){return Rb=Object.assign||function(t){for(var n,r=1,s=arguments.length;r<s;r++){n=arguments[r];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},Rb.apply(this,arguments)};function xgn(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,r=Object.getOwnPropertySymbols(e);s<r.length;s++)t.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(e,r[s])&&(n[r[s]]=e[r[s]]);return n}function ggn(e,t,n){if(n||arguments.length===2)for(var r=0,s=t.length,a;r<s;r++)(a||!(r in t))&&(a||(a=Array.prototype.slice.call(t,0,r)),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var kVe=uRe(),JX=function(){},CU=m.forwardRef(function(e,t){var n=m.useRef(null),r=m.useState({onScrollCapture:JX,onWheelCapture:JX,onTouchMoveCapture:JX}),s=r[0],a=r[1],o=e.forwardProps,l=e.children,c=e.className,u=e.removeScrollBar,d=e.enabled,f=e.shards,x=e.sideCar,g=e.noRelative,v=e.noIsolation,w=e.inert,C=e.allowPinchZoom,N=e.as,P=N===void 0?"div":N,I=e.gapMode,R=xgn(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),F=x,U=LMe([n,t]),L=Rb(Rb({},R),s);return m.createElement(m.Fragment,null,d&&m.createElement(F,{sideCar:kVe,removeScrollBar:u,shards:f,noRelative:g,noIsolation:v,inert:w,setCallbacks:a,allowPinchZoom:!!C,lockRef:n,gapMode:I}),o?m.cloneElement(m.Children.only(l),Rb(Rb({},L),{ref:U})):m.createElement(P,Rb({},L,{className:c,ref:U}),l))});CU.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};CU.classNames={fullWidth:r9,zeroRight:n9};var bre=!1;if(typeof window<"u")try{var fF=Object.defineProperty({},"passive",{get:function(){return bre=!0,!0}});window.addEventListener("test",fF,fF),window.removeEventListener("test",fF,fF)}catch{bre=!1}var xC=bre?{passive:!1}:!1,bgn=function(e){return e.tagName==="TEXTAREA"},TVe=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!bgn(e)&&n[t]==="visible")},ygn=function(e){return TVe(e,"overflowY")},vgn=function(e){return TVe(e,"overflowX")},lNe=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var s=IVe(e,r);if(s){var a=PVe(e,r),o=a[1],l=a[2];if(o>l)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},wgn=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},Cgn=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},IVe=function(e,t){return e==="v"?ygn(t):vgn(t)},PVe=function(e,t){return e==="v"?wgn(t):Cgn(t)},Sgn=function(e,t){return e==="h"&&t==="rtl"?-1:1},Ngn=function(e,t,n,r,s){var a=Sgn(e,window.getComputedStyle(t).direction),o=a*r,l=n.target,c=t.contains(l),u=!1,d=o>0,f=0,x=0;do{if(!l)break;var g=PVe(e,l),v=g[0],w=g[1],C=g[2],N=w-C-a*v;(v||N)&&IVe(e,l)&&(f+=N,x+=v);var P=l.parentNode;l=P&&P.nodeType===Node.DOCUMENT_FRAGMENT_NODE?P.host:P}while(!c&&l!==document.body||c&&(t.contains(l)||t===l));return(d&&Math.abs(f)<1||!d&&Math.abs(x)<1)&&(u=!0),u},hF=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},cNe=function(e){return[e.deltaX,e.deltaY]},uNe=function(e){return e&&"current"in e?e.current:e},Agn=function(e,t){return e[0]===t[0]&&e[1]===t[1]},jgn=function(e){return`
.block-interactivity-`.concat(e,` {pointer-events: none;}
.allow-interactivity-`).concat(e,` {pointer-events: all;}
`)},Egn=0,gC=[];function _gn(e){var t=m.useRef([]),n=m.useRef([0,0]),r=m.useRef(),s=m.useState(Egn++)[0],a=m.useState(ele)[0],o=m.useRef(e);m.useEffect(function(){o.current=e},[e]),m.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var w=ggn([e.lockRef.current],(e.shards||[]).map(uNe),!0).filter(Boolean);return w.forEach(function(C){return C.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),w.forEach(function(C){return C.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var l=m.useCallback(function(w,C){if("touches"in w&&w.touches.length===2||w.type==="wheel"&&w.ctrlKey)return!o.current.allowPinchZoom;var N=hF(w),P=n.current,I="deltaX"in w?w.deltaX:P[0]-N[0],R="deltaY"in w?w.deltaY:P[1]-N[1],F,U=w.target,L=Math.abs(I)>Math.abs(R)?"h":"v";if("touches"in w&&L==="h"&&U.type==="range")return!1;var z=lNe(L,U);if(!z)return!0;if(z?F=L:(F=L==="v"?"h":"v",z=lNe(L,U)),!z)return!1;if(!r.current&&"changedTouches"in w&&(I||R)&&(r.current=F),!F)return!0;var Q=r.current||F;return Ngn(Q,C,w,Q==="h"?I:R)},[]),c=m.useCallback(function(w){var C=w;if(!(!gC.length||gC[gC.length-1]!==a)){var N="deltaY"in C?cNe(C):hF(C),P=t.current.filter(function(F){return F.name===C.type&&(F.target===C.target||C.target===F.shadowParent)&&Agn(F.delta,N)})[0];if(P&&P.should){C.cancelable&&C.preventDefault();return}if(!P){var I=(o.current.shards||[]).map(uNe).filter(Boolean).filter(function(F){return F.contains(C.target)}),R=I.length>0?l(C,I[0]):!o.current.noIsolation;R&&C.cancelable&&C.preventDefault()}}},[]),u=m.useCallback(function(w,C,N,P){var I={name:w,delta:C,target:N,should:P,shadowParent:kgn(N)};t.current.push(I),setTimeout(function(){t.current=t.current.filter(function(R){return R!==I})},1)},[]),d=m.useCallback(function(w){n.current=hF(w),r.current=void 0},[]),f=m.useCallback(function(w){u(w.type,cNe(w),w.target,l(w,e.lockRef.current))},[]),x=m.useCallback(function(w){u(w.type,hF(w),w.target,l(w,e.lockRef.current))},[]);m.useEffect(function(){return gC.push(a),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:x}),document.addEventListener("wheel",c,xC),document.addEventListener("touchmove",c,xC),document.addEventListener("touchstart",d,xC),function(){gC=gC.filter(function(w){return w!==a}),document.removeEventListener("wheel",c,xC),document.removeEventListener("touchmove",c,xC),document.removeEventListener("touchstart",d,xC)}},[]);var g=e.removeScrollBar,v=e.inert;return m.createElement(m.Fragment,null,v?m.createElement(a,{styles:jgn(s)}):null,g?m.createElement(pRe,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function kgn(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Tgn=fRe(kVe,_gn);var Rue=m.forwardRef(function(e,t){return m.createElement(CU,Rb({},e,{ref:t,sideCar:Tgn}))});Rue.classNames=CU.classNames;var yre=["Enter"," "],Ign=["ArrowDown","PageUp","Home"],FVe=["ArrowUp","PageDown","End"],Pgn=[...Ign,...FVe],Fgn={ltr:[...yre,"ArrowRight"],rtl:[...yre,"ArrowLeft"]},Ogn={ltr:["ArrowLeft"],rtl:["ArrowRight"]},CT="Menu",[q_,Mgn,Rgn]=sVe(CT),[k5,OVe]=_5(CT,[Rgn,c8,CVe]),SU=c8(),MVe=CVe(),[Lgn,u8]=k5(CT),[Dgn,ST]=k5(CT),RVe=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:s,onOpenChange:a,modal:o=!0}=e,l=SU(t),[c,u]=m.useState(null),d=m.useRef(!1),f=y1(a),x=iVe(s);return m.useEffect(()=>{const g=()=>{d.current=!0,document.addEventListener("pointerdown",v,{capture:!0,once:!0}),document.addEventListener("pointermove",v,{capture:!0,once:!0})},v=()=>d.current=!1;return document.addEventListener("keydown",g,{capture:!0}),()=>{document.removeEventListener("keydown",g,{capture:!0}),document.removeEventListener("pointerdown",v,{capture:!0}),document.removeEventListener("pointermove",v,{capture:!0})}},[]),i.jsx(Pue,{...l,children:i.jsx(Lgn,{scope:t,open:n,onOpenChange:f,content:c,onContentChange:u,children:i.jsx(Dgn,{scope:t,onClose:m.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:d,dir:x,modal:o,children:r})})})};RVe.displayName=CT;var Bgn="MenuAnchor",Lue=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,s=SU(n);return i.jsx(wU,{...s,...r,ref:t})});Lue.displayName=Bgn;var $gn="MenuPortal",[Svn,LVe]=k5($gn,{forceMount:void 0}),rp="MenuContent",[Ugn,Due]=k5(rp),DVe=m.forwardRef((e,t)=>{const n=LVe(rp,e.__scopeMenu),{forceMount:r=n.forceMount,...s}=e,a=u8(rp,e.__scopeMenu),o=ST(rp,e.__scopeMenu);return i.jsx(q_.Provider,{scope:e.__scopeMenu,children:i.jsx(C2,{present:r||a.open,children:i.jsx(q_.Slot,{scope:e.__scopeMenu,children:o.modal?i.jsx(zgn,{...s,ref:t}):i.jsx(Hgn,{...s,ref:t})})})})}),zgn=m.forwardRef((e,t)=>{const n=u8(rp,e.__scopeMenu),r=m.useRef(null),s=au(t,r);return m.useEffect(()=>{const a=r.current;if(a)return _Ve(a)},[]),i.jsx(Bue,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:ui(e.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),Hgn=m.forwardRef((e,t)=>{const n=u8(rp,e.__scopeMenu);return i.jsx(Bue,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),Vgn=W_("MenuContent.ScrollLock"),Bue=m.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:s,onOpenAutoFocus:a,onCloseAutoFocus:o,disableOutsidePointerEvents:l,onEntryFocus:c,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:f,onInteractOutside:x,onDismiss:g,disableOutsideScroll:v,...w}=e,C=u8(rp,n),N=ST(rp,n),P=SU(n),I=MVe(n),R=Mgn(n),[F,U]=m.useState(null),L=m.useRef(null),z=au(t,L,C.onContentChange),Q=m.useRef(0),ne=m.useRef(""),J=m.useRef(0),X=m.useRef(null),re=m.useRef("right"),pe=m.useRef(0),Y=v?Rue:m.Fragment,ie=v?{as:Vgn,allowPinchZoom:!0}:void 0,oe=V=>{var ve,je;const ee=ne.current+V,ae=R().filter(Ie=>!Ie.disabled),fe=document.activeElement,Ne=(ve=ae.find(Ie=>Ie.ref.current===fe))==null?void 0:ve.textValue,he=ae.map(Ie=>Ie.textValue),ge=n1n(he,ee,Ne),ye=(je=ae.find(Ie=>Ie.textValue===ge))==null?void 0:je.ref.current;(function Ie(Le){ne.current=Le,window.clearTimeout(Q.current),Le!==""&&(Q.current=window.setTimeout(()=>Ie(""),1e3))})(ee),ye&&setTimeout(()=>ye.focus())};m.useEffect(()=>()=>window.clearTimeout(Q.current),[]),lVe();const G=m.useCallback(V=>{var ae,fe;return re.current===((ae=X.current)==null?void 0:ae.side)&&s1n(V,(fe=X.current)==null?void 0:fe.area)},[]);return i.jsx(Ugn,{scope:n,searchRef:ne,onItemEnter:m.useCallback(V=>{G(V)&&V.preventDefault()},[G]),onItemLeave:m.useCallback(V=>{var ee;G(V)||((ee=L.current)==null||ee.focus(),U(null))},[G]),onTriggerLeave:m.useCallback(V=>{G(V)&&V.preventDefault()},[G]),pointerGraceTimerRef:J,onPointerGraceIntentChange:m.useCallback(V=>{X.current=V},[]),children:i.jsx(Y,{...ie,children:i.jsx(kue,{asChild:!0,trapped:s,onMountAutoFocus:ui(a,V=>{var ee;V.preventDefault(),(ee=L.current)==null||ee.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:i.jsx(vU,{asChild:!0,disableOutsidePointerEvents:l,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:f,onInteractOutside:x,onDismiss:g,children:i.jsx(dgn,{asChild:!0,...I,dir:N.dir,orientation:"vertical",loop:r,currentTabStopId:F,onCurrentTabStopIdChange:U,onEntryFocus:ui(c,V=>{N.isUsingKeyboardRef.current||V.preventDefault()}),preventScrollOnEntryFocus:!0,children:i.jsx(Fue,{role:"menu","aria-orientation":"vertical","data-state":eWe(C.open),"data-radix-menu-content":"",dir:N.dir,...P,...w,ref:z,style:{outline:"none",...w.style},onKeyDown:ui(w.onKeyDown,V=>{const ae=V.target.closest("[data-radix-menu-content]")===V.currentTarget,fe=V.ctrlKey||V.altKey||V.metaKey,Ne=V.key.length===1;ae&&(V.key==="Tab"&&V.preventDefault(),!fe&&Ne&&oe(V.key));const he=L.current;if(V.target!==he||!Pgn.includes(V.key))return;V.preventDefault();const ye=R().filter(ve=>!ve.disabled).map(ve=>ve.ref.current);FVe.includes(V.key)&&ye.reverse(),e1n(ye)}),onBlur:ui(e.onBlur,V=>{V.currentTarget.contains(V.target)||(window.clearTimeout(Q.current),ne.current="")}),onPointerMove:ui(e.onPointerMove,G_(V=>{const ee=V.target,ae=pe.current!==V.clientX;if(V.currentTarget.contains(ee)&&ae){const fe=V.clientX>pe.current?"right":"left";re.current=fe,pe.current=V.clientX}}))})})})})})})});DVe.displayName=rp;var Wgn="MenuGroup",$ue=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return i.jsx(Lc.div,{role:"group",...r,ref:t})});$ue.displayName=Wgn;var qgn="MenuLabel",BVe=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return i.jsx(Lc.div,{...r,ref:t})});BVe.displayName=qgn;var iD="MenuItem",dNe="menu.itemSelect",NU=m.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...s}=e,a=m.useRef(null),o=ST(iD,e.__scopeMenu),l=Due(iD,e.__scopeMenu),c=au(t,a),u=m.useRef(!1),d=()=>{const f=a.current;if(!n&&f){const x=new CustomEvent(dNe,{bubbles:!0,cancelable:!0});f.addEventListener(dNe,g=>r==null?void 0:r(g),{once:!0}),rVe(f,x),x.defaultPrevented?u.current=!1:o.onClose()}};return i.jsx($Ve,{...s,ref:c,disabled:n,onClick:ui(e.onClick,d),onPointerDown:f=>{var x;(x=e.onPointerDown)==null||x.call(e,f),u.current=!0},onPointerUp:ui(e.onPointerUp,f=>{var x;u.current||(x=f.currentTarget)==null||x.click()}),onKeyDown:ui(e.onKeyDown,f=>{const x=l.searchRef.current!=="";n||x&&f.key===" "||yre.includes(f.key)&&(f.currentTarget.click(),f.preventDefault())})})});NU.displayName=iD;var $Ve=m.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:s,...a}=e,o=Due(iD,n),l=MVe(n),c=m.useRef(null),u=au(t,c),[d,f]=m.useState(!1),[x,g]=m.useState("");return m.useEffect(()=>{const v=c.current;v&&g((v.textContent??"").trim())},[a.children]),i.jsx(q_.ItemSlot,{scope:n,disabled:r,textValue:s??x,children:i.jsx(fgn,{asChild:!0,...l,focusable:!r,children:i.jsx(Lc.div,{role:"menuitem","data-highlighted":d?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...a,ref:u,onPointerMove:ui(e.onPointerMove,G_(v=>{r?o.onItemLeave(v):(o.onItemEnter(v),v.defaultPrevented||v.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:ui(e.onPointerLeave,G_(v=>o.onItemLeave(v))),onFocus:ui(e.onFocus,()=>f(!0)),onBlur:ui(e.onBlur,()=>f(!1))})})})}),Ggn="MenuCheckboxItem",UVe=m.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...s}=e;return i.jsx(qVe,{scope:e.__scopeMenu,checked:n,children:i.jsx(NU,{role:"menuitemcheckbox","aria-checked":aD(n)?"mixed":n,...s,ref:t,"data-state":zue(n),onSelect:ui(s.onSelect,()=>r==null?void 0:r(aD(n)?!0:!n),{checkForDefaultPrevented:!1})})})});UVe.displayName=Ggn;var zVe="MenuRadioGroup",[Kgn,Ygn]=k5(zVe,{value:void 0,onValueChange:()=>{}}),HVe=m.forwardRef((e,t)=>{const{value:n,onValueChange:r,...s}=e,a=y1(r);return i.jsx(Kgn,{scope:e.__scopeMenu,value:n,onValueChange:a,children:i.jsx($ue,{...s,ref:t})})});HVe.displayName=zVe;var VVe="MenuRadioItem",WVe=m.forwardRef((e,t)=>{const{value:n,...r}=e,s=Ygn(VVe,e.__scopeMenu),a=n===s.value;return i.jsx(qVe,{scope:e.__scopeMenu,checked:a,children:i.jsx(NU,{role:"menuitemradio","aria-checked":a,...r,ref:t,"data-state":zue(a),onSelect:ui(r.onSelect,()=>{var o;return(o=s.onValueChange)==null?void 0:o.call(s,n)},{checkForDefaultPrevented:!1})})})});WVe.displayName=VVe;var Uue="MenuItemIndicator",[qVe,Xgn]=k5(Uue,{checked:!1}),GVe=m.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...s}=e,a=Xgn(Uue,n);return i.jsx(C2,{present:r||aD(a.checked)||a.checked===!0,children:i.jsx(Lc.span,{...s,ref:t,"data-state":zue(a.checked)})})});GVe.displayName=Uue;var Qgn="MenuSeparator",KVe=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return i.jsx(Lc.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});KVe.displayName=Qgn;var Zgn="MenuArrow",YVe=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,s=SU(n);return i.jsx(Oue,{...s,...r,ref:t})});YVe.displayName=Zgn;var Jgn="MenuSub",[Nvn,XVe]=k5(Jgn),Mj="MenuSubTrigger",QVe=m.forwardRef((e,t)=>{const n=u8(Mj,e.__scopeMenu),r=ST(Mj,e.__scopeMenu),s=XVe(Mj,e.__scopeMenu),a=Due(Mj,e.__scopeMenu),o=m.useRef(null),{pointerGraceTimerRef:l,onPointerGraceIntentChange:c}=a,u={__scopeMenu:e.__scopeMenu},d=m.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);return m.useEffect(()=>d,[d]),m.useEffect(()=>{const f=l.current;return()=>{window.clearTimeout(f),c(null)}},[l,c]),i.jsx(Lue,{asChild:!0,...u,children:i.jsx($Ve,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":s.contentId,"data-state":eWe(n.open),...e,ref:bU(t,s.onTriggerChange),onClick:f=>{var x;(x=e.onClick)==null||x.call(e,f),!(e.disabled||f.defaultPrevented)&&(f.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:ui(e.onPointerMove,G_(f=>{a.onItemEnter(f),!f.defaultPrevented&&!e.disabled&&!n.open&&!o.current&&(a.onPointerGraceIntentChange(null),o.current=window.setTimeout(()=>{n.onOpenChange(!0),d()},100))})),onPointerLeave:ui(e.onPointerLeave,G_(f=>{var g,v;d();const x=(g=n.content)==null?void 0:g.getBoundingClientRect();if(x){const w=(v=n.content)==null?void 0:v.dataset.side,C=w==="right",N=C?-5:5,P=x[C?"left":"right"],I=x[C?"right":"left"];a.onPointerGraceIntentChange({area:[{x:f.clientX+N,y:f.clientY},{x:P,y:x.top},{x:I,y:x.top},{x:I,y:x.bottom},{x:P,y:x.bottom}],side:w}),window.clearTimeout(l.current),l.current=window.setTimeout(()=>a.onPointerGraceIntentChange(null),300)}else{if(a.onTriggerLeave(f),f.defaultPrevented)return;a.onPointerGraceIntentChange(null)}})),onKeyDown:ui(e.onKeyDown,f=>{var g;const x=a.searchRef.current!=="";e.disabled||x&&f.key===" "||Fgn[r.dir].includes(f.key)&&(n.onOpenChange(!0),(g=n.content)==null||g.focus(),f.preventDefault())})})})});QVe.displayName=Mj;var ZVe="MenuSubContent",JVe=m.forwardRef((e,t)=>{const n=LVe(rp,e.__scopeMenu),{forceMount:r=n.forceMount,...s}=e,a=u8(rp,e.__scopeMenu),o=ST(rp,e.__scopeMenu),l=XVe(ZVe,e.__scopeMenu),c=m.useRef(null),u=au(t,c);return i.jsx(q_.Provider,{scope:e.__scopeMenu,children:i.jsx(C2,{present:r||a.open,children:i.jsx(q_.Slot,{scope:e.__scopeMenu,children:i.jsx(Bue,{id:l.contentId,"aria-labelledby":l.triggerId,...s,ref:u,align:"start",side:o.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:d=>{var f;o.isUsingKeyboardRef.current&&((f=c.current)==null||f.focus()),d.preventDefault()},onCloseAutoFocus:d=>d.preventDefault(),onFocusOutside:ui(e.onFocusOutside,d=>{d.target!==l.trigger&&a.onOpenChange(!1)}),onEscapeKeyDown:ui(e.onEscapeKeyDown,d=>{o.onClose(),d.preventDefault()}),onKeyDown:ui(e.onKeyDown,d=>{var g;const f=d.currentTarget.contains(d.target),x=Ogn[o.dir].includes(d.key);f&&x&&(a.onOpenChange(!1),(g=l.trigger)==null||g.focus(),d.preventDefault())})})})})})});JVe.displayName=ZVe;function eWe(e){return e?"open":"closed"}function aD(e){return e==="indeterminate"}function zue(e){return aD(e)?"indeterminate":e?"checked":"unchecked"}function e1n(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function t1n(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function n1n(e,t,n){const s=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,a=n?e.indexOf(n):-1;let o=t1n(e,Math.max(a,0));s.length===1&&(o=o.filter(u=>u!==n));const c=o.find(u=>u.toLowerCase().startsWith(s.toLowerCase()));return c!==n?c:void 0}function r1n(e,t){const{x:n,y:r}=e;let s=!1;for(let a=0,o=t.length-1;a<t.length;o=a++){const l=t[a],c=t[o],u=l.x,d=l.y,f=c.x,x=c.y;d>r!=x>r&&n<(f-u)*(r-d)/(x-d)+u&&(s=!s)}return s}function s1n(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return r1n(n,t)}function G_(e){return t=>t.pointerType==="mouse"?e(t):void 0}var i1n=RVe,a1n=Lue,o1n=DVe,l1n=$ue,c1n=BVe,u1n=NU,d1n=UVe,f1n=HVe,h1n=WVe,p1n=GVe,m1n=KVe,x1n=YVe,g1n=QVe,b1n=JVe,AU="DropdownMenu",[y1n,Avn]=_5(AU,[OVe]),ff=OVe(),[v1n,tWe]=y1n(AU),nWe=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:s,defaultOpen:a,onOpenChange:o,modal:l=!0}=e,c=ff(t),u=m.useRef(null),[d,f]=yU({prop:s,defaultProp:a??!1,onChange:o,caller:AU});return i.jsx(v1n,{scope:t,triggerId:rD(),triggerRef:u,contentId:rD(),open:d,onOpenChange:f,onOpenToggle:m.useCallback(()=>f(x=>!x),[f]),modal:l,children:i.jsx(i1n,{...c,open:d,onOpenChange:f,dir:r,modal:l,children:n})})};nWe.displayName=AU;var rWe="DropdownMenuTrigger",sWe=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...s}=e,a=tWe(rWe,n),o=ff(n);return i.jsx(a1n,{asChild:!0,...o,children:i.jsx(Lc.button,{type:"button",id:a.triggerId,"aria-haspopup":"menu","aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...s,ref:bU(t,a.triggerRef),onPointerDown:ui(e.onPointerDown,l=>{!r&&l.button===0&&l.ctrlKey===!1&&(a.onOpenToggle(),a.open||l.preventDefault())}),onKeyDown:ui(e.onKeyDown,l=>{r||(["Enter"," "].includes(l.key)&&a.onOpenToggle(),l.key==="ArrowDown"&&a.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(l.key)&&l.preventDefault())})})})});sWe.displayName=rWe;var iWe="DropdownMenuContent",aWe=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=tWe(iWe,n),a=ff(n),o=m.useRef(!1);return i.jsx(o1n,{id:s.contentId,"aria-labelledby":s.triggerId,...a,...r,ref:t,onCloseAutoFocus:ui(e.onCloseAutoFocus,l=>{var c;o.current||(c=s.triggerRef.current)==null||c.focus(),o.current=!1,l.preventDefault()}),onInteractOutside:ui(e.onInteractOutside,l=>{const c=l.detail.originalEvent,u=c.button===0&&c.ctrlKey===!0,d=c.button===2||u;(!s.modal||d)&&(o.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});aWe.displayName=iWe;var w1n="DropdownMenuGroup",C1n=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=ff(n);return i.jsx(l1n,{...s,...r,ref:t})});C1n.displayName=w1n;var S1n="DropdownMenuLabel",N1n=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=ff(n);return i.jsx(c1n,{...s,...r,ref:t})});N1n.displayName=S1n;var A1n="DropdownMenuItem",oWe=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=ff(n);return i.jsx(u1n,{...s,...r,ref:t})});oWe.displayName=A1n;var j1n="DropdownMenuCheckboxItem",E1n=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=ff(n);return i.jsx(d1n,{...s,...r,ref:t})});E1n.displayName=j1n;var _1n="DropdownMenuRadioGroup",k1n=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=ff(n);return i.jsx(f1n,{...s,...r,ref:t})});k1n.displayName=_1n;var T1n="DropdownMenuRadioItem",I1n=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=ff(n);return i.jsx(h1n,{...s,...r,ref:t})});I1n.displayName=T1n;var P1n="DropdownMenuItemIndicator",F1n=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=ff(n);return i.jsx(p1n,{...s,...r,ref:t})});F1n.displayName=P1n;var O1n="DropdownMenuSeparator",M1n=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=ff(n);return i.jsx(m1n,{...s,...r,ref:t})});M1n.displayName=O1n;var R1n="DropdownMenuArrow",L1n=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=ff(n);return i.jsx(x1n,{...s,...r,ref:t})});L1n.displayName=R1n;var D1n="DropdownMenuSubTrigger",B1n=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=ff(n);return i.jsx(g1n,{...s,...r,ref:t})});B1n.displayName=D1n;var $1n="DropdownMenuSubContent",U1n=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=ff(n);return i.jsx(b1n,{...s,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});U1n.displayName=$1n;var eQ=nWe,z1n=sWe,tQ=aWe,nQ=oWe,jU="Popover",[lWe,jvn]=_5(jU,[c8]),NT=c8(),[H1n,S2]=lWe(jU),cWe=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:s,onOpenChange:a,modal:o=!1}=e,l=NT(t),c=m.useRef(null),[u,d]=m.useState(!1),[f,x]=yU({prop:r,defaultProp:s??!1,onChange:a,caller:jU});return i.jsx(Pue,{...l,children:i.jsx(H1n,{scope:t,contentId:rD(),triggerRef:c,open:f,onOpenChange:x,onOpenToggle:m.useCallback(()=>x(g=>!g),[x]),hasCustomAnchor:u,onCustomAnchorAdd:m.useCallback(()=>d(!0),[]),onCustomAnchorRemove:m.useCallback(()=>d(!1),[]),modal:o,children:n})})};cWe.displayName=jU;var uWe="PopoverAnchor",V1n=m.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=S2(uWe,n),a=NT(n),{onCustomAnchorAdd:o,onCustomAnchorRemove:l}=s;return m.useEffect(()=>(o(),()=>l()),[o,l]),i.jsx(wU,{...a,...r,ref:t})});V1n.displayName=uWe;var dWe="PopoverTrigger",fWe=m.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=S2(dWe,n),a=NT(n),o=au(t,s.triggerRef),l=i.jsx(Lc.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":gWe(s.open),...r,ref:o,onClick:ui(e.onClick,s.onOpenToggle)});return s.hasCustomAnchor?l:i.jsx(wU,{asChild:!0,...a,children:l})});fWe.displayName=dWe;var Hue="PopoverPortal",[W1n,q1n]=lWe(Hue,{forceMount:void 0}),hWe=e=>{const{__scopePopover:t,forceMount:n,children:r,container:s}=e,a=S2(Hue,t);return i.jsx(W1n,{scope:t,forceMount:n,children:i.jsx(C2,{present:n||a.open,children:i.jsx(Mue,{asChild:!0,container:s,children:r})})})};hWe.displayName=Hue;var ZN="PopoverContent",pWe=m.forwardRef((e,t)=>{const n=q1n(ZN,e.__scopePopover),{forceMount:r=n.forceMount,...s}=e,a=S2(ZN,e.__scopePopover);return i.jsx(C2,{present:r||a.open,children:a.modal?i.jsx(K1n,{...s,ref:t}):i.jsx(Y1n,{...s,ref:t})})});pWe.displayName=ZN;var G1n=W_("PopoverContent.RemoveScroll"),K1n=m.forwardRef((e,t)=>{const n=S2(ZN,e.__scopePopover),r=m.useRef(null),s=au(t,r),a=m.useRef(!1);return m.useEffect(()=>{const o=r.current;if(o)return _Ve(o)},[]),i.jsx(Rue,{as:G1n,allowPinchZoom:!0,children:i.jsx(mWe,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ui(e.onCloseAutoFocus,o=>{var l;o.preventDefault(),a.current||(l=n.triggerRef.current)==null||l.focus()}),onPointerDownOutside:ui(e.onPointerDownOutside,o=>{const l=o.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0,u=l.button===2||c;a.current=u},{checkForDefaultPrevented:!1}),onFocusOutside:ui(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1})})})}),Y1n=m.forwardRef((e,t)=>{const n=S2(ZN,e.__scopePopover),r=m.useRef(!1),s=m.useRef(!1);return i.jsx(mWe,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{var o,l;(o=e.onCloseAutoFocus)==null||o.call(e,a),a.defaultPrevented||(r.current||(l=n.triggerRef.current)==null||l.focus(),a.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:a=>{var c,u;(c=e.onInteractOutside)==null||c.call(e,a),a.defaultPrevented||(r.current=!0,a.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const o=a.target;((u=n.triggerRef.current)==null?void 0:u.contains(o))&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&s.current&&a.preventDefault()}})}),mWe=m.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:a,disableOutsidePointerEvents:o,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:u,onInteractOutside:d,...f}=e,x=S2(ZN,n),g=NT(n);return lVe(),i.jsx(kue,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:a,children:i.jsx(vU,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:d,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:u,onDismiss:()=>x.onOpenChange(!1),children:i.jsx(Fue,{"data-state":gWe(x.open),role:"dialog",id:x.contentId,...g,...f,ref:t,style:{...f.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),xWe="PopoverClose",X1n=m.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=S2(xWe,n);return i.jsx(Lc.button,{type:"button",...r,ref:t,onClick:ui(e.onClick,()=>s.onOpenChange(!1))})});X1n.displayName=xWe;var Q1n="PopoverArrow",Z1n=m.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=NT(n);return i.jsx(Oue,{...s,...r,ref:t})});Z1n.displayName=Q1n;function gWe(e){return e?"open":"closed"}var J1n=cWe,ebn=fWe,tbn=hWe,nbn=pWe;const rbn=e=>`${e.slice(0,5)}...${e.slice(-4)}`,sbn=[{label:"$0 - $100,000",min:0,max:1e5},{label:"$100,000 - $500,000",min:1e5,max:5e5},{label:"$500,000 - $1,000,000",min:5e5,max:1e6},{label:"$1,000,000 - $5,000,000",min:1e6,max:5e6},{label:">$5,000,000",min:5e6,max:1/0},{label:"$0 - -$100,000",min:-1e5,max:0},{label:"-$100,000 - -$500,000",min:-5e5,max:-1e5},{label:"-$500,000 - -$1,000,000",min:-1e6,max:-5e5},{label:"-$1,000,000 - -$5,000,000",min:-5e6,max:-1e6},{label:"< -$5,000,000",min:-1/0,max:-5e6}];function ibn(){const[e,t]=m.useState([]),[n,r]=m.useState("All"),[s,a]=m.useState("All"),[o,l]=m.useState(null),[c,u]=m.useState("All"),[d,f]=m.useState("All"),[x,g]=m.useState(!1),[v,w]=m.useState(!1),[C,N]=m.useState(null),[P,I]=m.useState(null),[R,F]=m.useState(""),{setSignModalOpen:U,copyTradeWatchList:L,getCopyTradeWatchList:z,getTrackedWatchList:Q,setIsWhitelist:ne,setMushboomerETH:J,setMushboomerSOL:X}=m.useContext(Qr);m.useEffect(()=>{const G=()=>{const ee="https://dextradata.nftinit.io/api/hyper/top_whales/",ae=d==="All"?ee:`${ee}?user_tier=${d}`;fs.get(ae).then(fe=>{var Ne;return t(((Ne=fe.data)==null?void 0:Ne.positions_list)||[])})};G();const V=setInterval(G,3e4);return()=>clearInterval(V)},[d]),m.useEffect(()=>{const G=localStorage.getItem("hyperToken"),V=localStorage.getItem("hyperAddress");!G||!V||(async()=>{var ee,ae;try{const fe=await Ei(V.toLowerCase(),G);fe!=null&&fe.success&&(ne(fe.whitelist),J(((ee=fe.mushboomer_counts)==null?void 0:ee.eth)||0),X(((ae=fe.mushboomer_counts)==null?void 0:ae.sol)||0))}catch{}})()},[]),m.useEffect(()=>{localStorage.getItem("hyperToken")&&(z(),Q())},[]);const re=async({walletAddress:G,isFollow:V,isScalper:ee})=>{try{const ae=localStorage.getItem("hyperToken"),fe=localStorage.getItem("hyperAddress");if(!ae){U(!0);return}const Ne=V?"https://dextrabothypev2.nftinit.io/api/test_app/following/info/":"https://dextrabothypev2.nftinit.io/api/hyper/following/get_setting/",he=V?{address:fe?fe.toLowerCase():localAddress,token:ae,follow_address:G.toLowerCase()}:{address:fe?fe.toLowerCase():localAddress,token:ae},ye=await(await fetch(Ne,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(he)})).json();if(!ye.success){rn.error(ye.error_message||"Something went wrong");return}z(),Q(),I(Array.isArray(ye==null?void 0:ye.data)?[...ye.data].sort((ve,je)=>new Date(je.created_at||0)-new Date(ve.created_at||0)):ye==null?void 0:ye.data),F(G),N(ee),w(!0)}catch(ae){rn.error(ae.message||"Something went wrong")}},pe=m.useMemo(()=>[...new Set(e.map(G=>G.coin))],[e]),Y=m.useMemo(()=>e.filter(G=>{if(n!=="All"&&G.coin!==n||s!=="All"&&G.direction!==s.toLowerCase()||d!=="All"&&![String(d),Ju[d].label].includes(String(G.user_tier)))return!1;if(o){const V=Number(G.unrealized_pnl),ee=Math.min(o.min,o.max),ae=Math.max(o.min,o.max);if(V<ee||V>ae)return!1}return!(c==="Profit"&&Number(G.funding_paid)<=0||c==="Loss"&&Number(G.funding_paid)>=0)}),[e,n,s,o,c,d]),ie=G=>{if(G==null)return"-";const V=Number(G),ee=V<0?"-":"",ae=Math.abs(V);return ae>=1e9?`${ee}$${(ae/1e9).toFixed(2)}B`:ae>=1e6?`${ee}$${(ae/1e6).toFixed(2)}M`:ae>=1e3?`${ee}$${(ae/1e3).toFixed(2)}K`:`${ee}$${ae.toFixed(2)}`},oe=[{key:"rank",label:"#",width:"46px",render:(G,V,ee)=>i.jsx("span",{className:"text-[#9B9B9B]",children:ee+1})},{key:"wallet",label:"Wallet",width:"210px",render:(G,V)=>{const ee=_ue(V.user_tier);return i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"text-[18px] leading-none",children:ee.emoji}),i.jsx("a",{href:`/wallet-details/${V.address}`,target:"_blank",onClick:ae=>ae.stopPropagation(),className:"text-white font-medium hover:text-white w-24",children:rbn(V.address)}),i.jsx("span",{className:`flex justify-center items-center px-1 h-6 rounded-[6px] text-[11px] font-medium ${ee.bg} ${ee.txt}`,children:ee.label})]})}},{key:"coin",label:"Coin",sortable:!0,width:"95px",render:(G,V)=>i.jsxs("a",{href:`/terminal/${V.coin}`,target:"_blank",rel:"noreferrer",className:"flex items-center text-white hover:text-gray-400 font-medium",children:[i.jsx("img",{src:`https://app.hyperliquid.xyz/coins/${V.coin}.svg`,onError:ra,className:"w-5 h-5 mr-2"}),V.coin]})},{key:"direction",label:"Direction",width:"150px ",sortable:!0,render:(G,V)=>{const ee=V.direction==="long",ae=ee?"LONG":"SHORT",fe=ee?"#67FFBD":"#FF797C",Ne=ee?"bg-[#67ffbd]/20":"bg-[#ff797c]/20";return i.jsxs("div",{className:"flex items-center gap-1",children:[i.jsxs("div",{className:`inline-flex items-center gap-1 px-2 py-1 h-6 rounded-[6px] text-[11px] uppercase font-medium ${Ne}`,style:{color:fe},children:[i.jsx(Ps,{className:`w-3 h-3 ${ee?"rotate-180":""}`,style:{color:fe}}),ae]}),i.jsxs("div",{className:`inline-flex items-center px-2 py-1 h-6 rounded-[6px] text-[11px] font-medium ${Ne}`,style:{color:fe},children:[V.max_leverage,"X"]})]})}},{key:"notional",label:"Position",sortable:!0,width:"130px",sortValue:G=>Number(G.notional),render:(G,V)=>ie(Number(V.notional))},{key:"szi",label:"Size",sortable:!0,sortValue:G=>Number(G.szi),render:G=>ie(G)},{key:"entry_price",label:"Entry",sortable:!0,sortValue:G=>Number(G.entry_price),render:G=>ie(G)},{key:"market_price",label:"Market",sortable:!0,sortValue:G=>Number(G.market_price),render:G=>ie(G)},{key:"unrealized_pnl",label:"PnL",sortable:!0,sortValue:G=>Math.abs(Number(G.unrealized_pnl)),render:G=>{const V=Number(G)>=0;return i.jsxs("span",{className:`flex items-center ${V?"text-[#3DB380]":"text-[#FF797C]"}`,children:[ie(Math.abs(G)),i.jsx("img",{src:V?aE:oE,className:"ml-[6px] w-[9px] h-[8px]"})]})}},{key:"liq_price",label:"Liq. Price",sortable:!0,sortValue:G=>Number(G.liq_price),render:G=>ie(G)},{key:"funding_paid",label:"Fee",sortable:!0,sortValue:G=>Number(G.funding_paid),render:G=>{const V=Number(G)>=0;return i.jsxs("span",{className:`flex items-center ${V?"text-[#3DB380]":"text-[#FF797C]"}`,children:[ie(Math.abs(G)),i.jsx("img",{src:V?aE:oE,className:"ml-[6px] w-[9px] h-[8px]"})]})}},{key:"action",label:"Action",width:"100px",render:(G,V)=>{const ee=L.some(ae=>ae.wallet_address===V.address);return i.jsx("div",{onClick:ae=>{ae.preventDefault(),ae.stopPropagation(),re({walletAddress:V.address,isFollow:ee})},className:"flex w-[81px] py-2 px-4 justify-center items-center gap-2 flex-shrink-0 rounded-[8px] bg-[#262626] text-[#929292] font-inter text-[12px] font-normal leading-[8px] tracking-[-0.12px] cursor-pointer hover:bg-[#585858] hover:text-white transition-all",children:"Copy Trade"})}}];return i.jsxs(i.Fragment,{children:[i.jsx(w5,{open:v,setOpen:w,copyTradeData:P,copyTradeWallet:R,setCopyTradeWallet:F,isScalper:C,setCopyTradeData:I}),i.jsx(mi,{content:"Displays real-time executed trades from top whales.",children:i.jsxs("div",{className:"flex items-center gap-2 mb-4 mt-8 w-fit",children:[i.jsx("h2",{className:"text-white text-[16px] leading-[21px] font-medium tracking-[-0.32px] pl-[5px] font-inter",children:"Whale Positions"}),i.jsxs("div",{className:"flex items-center gap-1 bg-[#262626] p-1 rounded-full w-fit",children:[i.jsxs("div",{className:"relative w-2 h-2 flex justify-center items-center",children:[i.jsx("span",{className:"absolute inline-flex h-full w-full rounded-full bg-[#4DFF43]/[0.32] animate-ping"}),i.jsx("span",{className:"relative inline-flex rounded-full h-1.5 w-1.5 bg-[#4DFF43]"})]}),i.jsx("span",{className:"text-white text-[10px] leading-[10px] font-medium",children:"LIVE"})]}),i.jsx("img",{className:"-ml-[4px]",src:E0,alt:"Dextrabot - Whale Trades"})]})}),i.jsxs("div",{className:"w-full opacity-0 animate-fadeInUp",children:[i.jsxs("div",{className:"md:hidden mt-4",children:[i.jsxs("button",{onClick:()=>g(G=>!G),className:"w-[110px] h-[32px] rounded-[8px] flex items-center justify-center px-[8px] py-[12px] bg-[rgba(103,255,189,0.16)] text-[#67FFBD] font-manrope text-[14px] font-medium",children:[i.jsx("img",{src:Pyt,className:"w-[21px] h-[21px] mr-2"}),"Filters"]}),i.jsx("div",{className:`overflow-hidden transition-all duration-300 ${x?"max-h-[640px] mt-4":"max-h-0"}`,children:i.jsx(fNe,{mobile:!0,symbols:pe,symbol:n,setSymbol:r,side:s,setSide:a,pnl:o,setPnl:l,fund:c,setFund:u,tier:d,setTier:f})})]}),i.jsx("div",{className:"hidden md:block",children:i.jsx(fNe,{symbols:pe,symbol:n,setSymbol:r,side:s,setSide:a,pnl:o,setPnl:l,fund:c,setFund:u,tier:d,setTier:f})}),e.length===0?i.jsx("div",{className:"space-y-2",children:Array.from({length:34}).map((G,V)=>i.jsx("div",{className:"animate-pulse bg-[#202020] h-[24px] w-full rounded-md"},V))}):i.jsx(Ru,{data:Y,columns:oe,rowKey:G=>G.id,rowHeight:42,listHeight:window.innerHeight-180,tableClassName:"text-[14px]",theadClassName:"text-[13px] font-inter !text-[#9B9B9B] bg-transparent font-normal ",tbodyClassName:"text-[14px]",cellClassName:"text-[14px] font-medium",rowClassName:"bg-transparent border-b border-[#1E1E1E] last:border-0 py-5"})]})]})}function rQ({children:e,value:t}){return i.jsx(z1n,{asChild:!0,children:i.jsxs("button",{className:"h-8 px-3 rounded-lg flex items-center gap-2 text-[13px] bg-transparent text-[#fff] border border-[#2A2A2A]",children:[e,i.jsx(A9,{className:"w-4 h-4 shrink-0"})]})})}function fNe({mobile:e=!1,symbols:t,symbol:n,setSymbol:r,side:s,setSide:a,pnl:o,setPnl:l,fund:c,setFund:u,tier:d,setTier:f}){const[x,g]=m.useState(""),[v,w]=m.useState("");m.useEffect(()=>{if(x===""&&v===""){l(null);return}const N=x===""?null:Number(x),P=v===""?null:Number(v),I=N??P??0,R=P??N??1/0;l({min:I,max:R,label:`${I<0?"-":""}$${Math.abs(I)} - ${R===1/0?"∞":`${R<0?"-":""}$${Math.abs(R)}`}`})},[x,v]);const C=e?"flex flex-wrap gap-2 px-4 py-4 bg-[#1B1B1B] rounded-[16px]":"flex items-center gap-[8px] py-3 overflow-x-auto";return i.jsxs("div",{className:C,children:[!e&&i.jsxs("div",{className:"flex items-center gap-[8px] text-white font-medium pr-[8px]",children:[i.jsx("img",{src:Iyt,className:"w-[21px] h-[21px]"}),i.jsx("span",{className:"font-manrope text-[14px] font-medium",children:"Filters"})]}),i.jsxs(eQ,{children:[i.jsxs(rQ,{value:n!=="All",children:["Symbol"," ",i.jsxs("span",{className:"ml-1 px-1.5 py-0.5 flex items-center gap-1 text-white",children:[n!=="All"&&i.jsx("img",{src:`https://app.hyperliquid.xyz/coins/${n}.svg`,onError:ra,className:"w-4 h-4"}),n]})]}),i.jsx(tQ,{sideOffset:6,className:"z-50 min-w-[140px] max-h-[280px] overflow-y-auto rounded-md bg-[#242424] p-2",children:["All",...t].map(N=>i.jsxs(nQ,{onSelect:()=>r(N),className:`h-8 px-2 flex items-center gap-2 rounded cursor-pointer text-[#A8A8A8] font-inter text-[13px] font-medium leading-[8px] tracking-[-0.26px] hover:bg-[#353535] hover:text-white ${n===N?"bg-[#2F2F2F]":""}`,children:[N!=="All"&&i.jsx("img",{src:`https://app.hyperliquid.xyz/coins/${N}.svg`,onError:ra,className:"w-4 h-4"}),N]},N))})]}),i.jsxs(eQ,{children:[i.jsxs(rQ,{value:s!=="All",children:["Side ",i.jsx("span",{className:"ml-1 px-1.5 py-0.5 text-white",children:s})]}),i.jsx(tQ,{sideOffset:6,className:"z-50 rounded-md bg-[#242424] p-2 text-[#A8A8A8]",children:["All","Long","Short"].map(N=>i.jsx(nQ,{onSelect:()=>a(N),className:`h-8 px-2 flex items-center gap-2 rounded cursor-pointer text-[#A8A8A8] font-inter text-[13px] font-medium leading-[8px] tracking-[-0.26px] hover:bg-[#353535] hover:text-white ${s===N?"bg-[#2F2F2F]":""}`,children:N},N))})]}),i.jsxs(eQ,{children:[i.jsxs(rQ,{value:c!=="All",children:["Fee ",i.jsx("span",{className:"ml-1 px-1.5 py-0.5 text-white",children:c})]}),i.jsx(tQ,{sideOffset:6,className:"z-50 rounded-md bg-[#242424] p-2 text-[#A8A8A8]",children:["All","Profit","Loss"].map(N=>i.jsx(nQ,{onSelect:()=>u(N),className:`h-8 px-2 flex items-center gap-2 rounded cursor-pointer text-[#A8A8A8] font-inter text-[13px] font-medium leading-[8px] tracking-[-0.26px] hover:bg-[#353535] hover:text-white ${c===N?"bg-[#2F2F2F]":""}`,children:N},N))})]}),i.jsxs(J1n,{children:[i.jsx(ebn,{asChild:!0,children:i.jsxs("button",{className:"h-8 px-3 rounded-lg flex items-center gap-2 text-[13px] bg-transparent text-[#fff] border border-[#2A2A2A]",children:["Unrealized PnL",i.jsx("span",{className:"ml-1 px-1.5 py-0.5 text-white",children:o?o.label:"All"}),i.jsx(A9,{className:"w-4 h-4"})]})}),i.jsx(tbn,{children:i.jsxs(nbn,{sideOffset:6,align:"start",className:"z-50 w-64 rounded-lg bg-[#242424] p-4 space-y-4",children:[i.jsxs("div",{className:"flex items-center justify-between mb-4",children:[i.jsx("span",{className:"text-white font-manrope text-[13px] font-medium leading-[8px] pl-[15px]",children:"Unrealized PnL"}),i.jsx("button",{onClick:()=>{g(""),w("")},className:"rounded-[6px] border border-[#353535] px-2 py-[6px] text-[#CECECE] font-manrope text-[11px] font-medium leading-[8px] bg-transparent",children:"Clear"})]}),i.jsx("div",{className:"space-y-3",children:["Min","Max"].map((N,P)=>{const I=P===0?x:v,R=P===0?g:w,F=I!=="";return i.jsxs("div",{children:[i.jsx("label",{className:"block mb-1 text-[#A8A8A8] text-[13px] leading-[8px] tracking-[-0.26px] font-normal pl-[15px] pb-[9px]",children:N}),i.jsxs("div",{className:"relative",children:[i.jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-[#67FFBD] text-sm",children:"$"}),i.jsx("input",{type:"number",value:I,onChange:U=>R(U.target.value),placeholder:"..",className:`w-full h-[32px] pl-7 pr-3 rounded-md outline-none text-[14px] leading-[8px] tracking-[-0.28px] font-medium ${F?"bg-[rgba(103,255,189,0.16)] text-[#67FFBD]":"bg-[#353535] text-[#A8A8A8]"}`})]})]},N)})}),i.jsx("div",{className:"h-px bg-[#363636]"}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-white font-inter text-[13px] font-medium leading-[8px] pl-[15px] pb-[13px] pt-1",children:"Presets"}),sbn.map(N=>i.jsx("button",{onClick:()=>{N.label==="All"?(g(""),w("")):(g(N.min.toString()),w(N.max===1/0?"":N.max.toString()))},className:`w-full text-left px-3 py-2 rounded-md text-[13px] leading-[8px] tracking-[-0.26px] font-medium bg-transparent ${(o==null?void 0:o.label)===N.label?"bg-[#2F2F2F] text-white":"text-[#A8A8A8]"} hover:bg-[#2A2A2A] hover:rounded-[6px] hover:p-[9px] hover:text-white hover:border-none`,children:N.label},N.label))]})]})})]}),i.jsx("div",{className:"h-5 w-px bg-[#262626] mx-3"}),i.jsx("div",{className:"inline-flex items-center h-8 px-1.5 py-[18px] rounded-[8px] border border-[#262626] flex-shrink-0 gap-[12px]",children:i.jsxs("div",{className:"flex items-center gap-[12px]",children:[i.jsx("div",{onClick:()=>f("All"),className:`flex items-center justify-center h-7 w-7 px-4 rounded-[8px] text-white text-[14px] font-inter leading-[16px] cursor-pointer transition-colors ${d==="All"?"bg-[#262626]":"hover:bg-[#262626]"}`,children:"All"}),V_.map(({id:N,emoji:P,description:I})=>{const R=d===N;return i.jsx("div",{onClick:()=>f(R?"All":N),className:`h-7 w-7 flex items-center justify-center rounded-[8px] text-[18px] cursor-pointer transition-colors ${R?"bg-[#262626]":"hover:bg-[#262626]"}`,children:i.jsx(mi,{content:I,children:P})},N)})]})})]})}function abn({data:e}){var d,f;if(!e)return i.jsxs("div",{className:"rounded-[16px] border border-[#1E1E1E] bg-[#101010] p-4 flex justify-between items-center h-[128px] animate-pulse",children:[i.jsxs("div",{className:"space-y-3 max-w-[220px] flex-1",children:[i.jsx("div",{className:"h-[16px] w-[80px] rounded bg-[#262626]"}),i.jsx("div",{className:"h-[16px] w-[60px] rounded bg-[#262626]"}),i.jsx("div",{className:"h-[32px] w-full rounded bg-[#262626]"})]}),i.jsx("div",{className:"flex flex-col items-center gap-3",children:i.jsx("div",{className:"h-[96px] w-[96px] rounded-full bg-[#262626]"})})]});const t=((d=e.long)==null?void 0:d.position)??0,n=((f=e.short)==null?void 0:f.position)??0,r=t+n,s=t>=n,a=r?Math.round(Math.max(t,n)/r*100):0,o=s?"#67FFBD":"#FF797C",l=s?"#FF797C":"#67FFBD",c=s?"#1B4734":"#5E2425",u={chart:{type:"radialBar",sparkline:{enabled:!0}},plotOptions:{radialBar:{startAngle:-90,endAngle:90,hollow:{size:"60%"},track:{background:l,strokeWidth:"100%",margin:0},dataLabels:{show:!1}}},stroke:{lineCap:"round"},fill:{colors:[o]}};return i.jsxs("div",{className:"rounded-[16px] border border-[#1E1E1E] bg-[#101010] p-4 flex justify-between items-center h-[128px] opacity-0 animate-fadeInUp",children:[i.jsxs("div",{className:"space-y-2 max-w-[220px]",children:[i.jsx("div",{className:"text-[#929292] text-[14px] leading-[16px] tracking-[-0.14px]",children:"Direction"}),i.jsx("div",{className:"text-white text-[14px] font-semibold leading-[16px] tracking-[-0.14px]",children:s?"Long":"Short"}),i.jsxs("p",{className:"text-[#9C9C9C] text-[14px] leading-[16px] tracking-[-0.12px]",children:["The least loss and funding load in the last 24 hours is on the"," ",s?"Long":"Short"," side."]})]}),i.jsxs("div",{className:"flex flex-col items-center",children:[i.jsxs("div",{className:"relative w-[96px] h-[48px]",children:[i.jsx(VL,{options:u,series:[a],height:96,width:96,type:"radialBar"}),i.jsx("div",{className:"absolute inset-0 flex items-center justify-center translate-y-[10px]",children:i.jsxs("span",{className:"text-white font-semibold font-manrope text-[18px] leading-[21px] mt-5",children:["%",a]})})]}),i.jsxs("div",{className:`mt-3 rounded-[6px] px-1.5 py-1 flex items-center gap-1 ${s?"bg-[#67FFBD]":"bg-[#FF797C]"}`,children:[s?i.jsx(rse,{className:"w-[10px] h-[10px]",style:{color:c}}):i.jsx(Bl,{className:"w-[10px] h-[10px]",style:{color:c}}),i.jsx("span",{className:"text-[11px] font-semibold leading-[8px] tracking-[0.66px] font-[Manrope]",style:{color:c},children:s?"LONG":"SHORT"})]})]})]})}var sQ,EU="HoverCard",[bWe,Evn]=_5(EU,[c8]),_U=c8(),[obn,kU]=bWe(EU),yWe=e=>{const{__scopeHoverCard:t,children:n,open:r,defaultOpen:s,onOpenChange:a,openDelay:o=700,closeDelay:l=300}=e,c=_U(t),u=m.useRef(0),d=m.useRef(0),f=m.useRef(!1),x=m.useRef(!1),[g,v]=yU({prop:r,defaultProp:s??!1,onChange:a,caller:EU}),w=m.useCallback(()=>{clearTimeout(d.current),u.current=window.setTimeout(()=>v(!0),o)},[o,v]),C=m.useCallback(()=>{clearTimeout(u.current),!f.current&&!x.current&&(d.current=window.setTimeout(()=>v(!1),l))},[l,v]),N=m.useCallback(()=>v(!1),[v]);return m.useEffect(()=>()=>{clearTimeout(u.current),clearTimeout(d.current)},[]),i.jsx(obn,{scope:t,open:g,onOpenChange:v,onOpen:w,onClose:C,onDismiss:N,hasSelectionRef:f,isPointerDownOnContentRef:x,children:i.jsx(Pue,{...c,children:n})})};yWe.displayName=EU;var vWe="HoverCardTrigger",wWe=m.forwardRef((e,t)=>{const{__scopeHoverCard:n,...r}=e,s=kU(vWe,n),a=_U(n);return i.jsx(wU,{asChild:!0,...a,children:i.jsx(Lc.a,{"data-state":s.open?"open":"closed",...r,ref:t,onPointerEnter:ui(e.onPointerEnter,lD(s.onOpen)),onPointerLeave:ui(e.onPointerLeave,lD(s.onClose)),onFocus:ui(e.onFocus,s.onOpen),onBlur:ui(e.onBlur,s.onClose),onTouchStart:ui(e.onTouchStart,o=>o.preventDefault())})})});wWe.displayName=vWe;var Vue="HoverCardPortal",[lbn,cbn]=bWe(Vue,{forceMount:void 0}),CWe=e=>{const{__scopeHoverCard:t,forceMount:n,children:r,container:s}=e,a=kU(Vue,t);return i.jsx(lbn,{scope:t,forceMount:n,children:i.jsx(C2,{present:n||a.open,children:i.jsx(Mue,{asChild:!0,container:s,children:r})})})};CWe.displayName=Vue;var oD="HoverCardContent",SWe=m.forwardRef((e,t)=>{const n=cbn(oD,e.__scopeHoverCard),{forceMount:r=n.forceMount,...s}=e,a=kU(oD,e.__scopeHoverCard);return i.jsx(C2,{present:r||a.open,children:i.jsx(ubn,{"data-state":a.open?"open":"closed",...s,onPointerEnter:ui(e.onPointerEnter,lD(a.onOpen)),onPointerLeave:ui(e.onPointerLeave,lD(a.onClose)),ref:t})})});SWe.displayName=oD;var ubn=m.forwardRef((e,t)=>{const{__scopeHoverCard:n,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:a,onInteractOutside:o,...l}=e,c=kU(oD,n),u=_U(n),d=m.useRef(null),f=au(t,d),[x,g]=m.useState(!1);return m.useEffect(()=>{if(x){const v=document.body;return sQ=v.style.userSelect||v.style.webkitUserSelect,v.style.userSelect="none",v.style.webkitUserSelect="none",()=>{v.style.userSelect=sQ,v.style.webkitUserSelect=sQ}}},[x]),m.useEffect(()=>{if(d.current){const v=()=>{g(!1),c.isPointerDownOnContentRef.current=!1,setTimeout(()=>{var C;((C=document.getSelection())==null?void 0:C.toString())!==""&&(c.hasSelectionRef.current=!0)})};return document.addEventListener("pointerup",v),()=>{document.removeEventListener("pointerup",v),c.hasSelectionRef.current=!1,c.isPointerDownOnContentRef.current=!1}}},[c.isPointerDownOnContentRef,c.hasSelectionRef]),m.useEffect(()=>{d.current&&hbn(d.current).forEach(w=>w.setAttribute("tabindex","-1"))}),i.jsx(vU,{asChild:!0,disableOutsidePointerEvents:!1,onInteractOutside:o,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:ui(a,v=>{v.preventDefault()}),onDismiss:c.onDismiss,children:i.jsx(Fue,{...u,...l,onPointerDown:ui(l.onPointerDown,v=>{v.currentTarget.contains(v.target)&&g(!0),c.hasSelectionRef.current=!1,c.isPointerDownOnContentRef.current=!0}),ref:f,style:{...l.style,userSelect:x?"text":void 0,WebkitUserSelect:x?"text":void 0,"--radix-hover-card-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-hover-card-content-available-width":"var(--radix-popper-available-width)","--radix-hover-card-content-available-height":"var(--radix-popper-available-height)","--radix-hover-card-trigger-width":"var(--radix-popper-anchor-width)","--radix-hover-card-trigger-height":"var(--radix-popper-anchor-height)"}})})}),dbn="HoverCardArrow",fbn=m.forwardRef((e,t)=>{const{__scopeHoverCard:n,...r}=e,s=_U(n);return i.jsx(Oue,{...s,...r,ref:t})});fbn.displayName=dbn;function lD(e){return t=>t.pointerType==="touch"?void 0:e()}function hbn(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});for(;n.nextNode();)t.push(n.currentNode);return t}var pbn=yWe,mbn=wWe,xbn=CWe,gbn=SWe;const bbn="#67FFBD",ybn="#FF797C",iQ=e=>{const t=Math.abs(Number(e));return t>=1e9?`$${(t/1e9).toFixed(2)}B`:t>=1e6?`$${(t/1e6).toFixed(2)}M`:t>=1e3?`$${(t/1e3).toFixed(1)}K`:`$${t.toFixed(0)}`};function vbn({data:e=[],title:t=""}){const n=m.useMemo(()=>e.map(r=>({...r,total:r.total??r.long+r.short})).sort((r,s)=>s.total-r.total).slice(0,10),[e]);return i.jsxs("div",{className:"flex w-96 min-w-[240px] flex-col gap-[12px] rounded-[12px] border-[0.8px] border-[rgba(133,133,133,0.32)] bg-[rgba(255,255,255,0.08)] p-[12px] shadow-[0_4px_4px_0_#050505] backdrop-blur-[43px]",children:[i.jsx("div",{className:"flex items-center gap-2",children:i.jsx("span",{className:"text-[14px] font-medium leading-[14px] tracking-[-0.14px] text-white",children:t})}),n.map(r=>{const s=(r.long/r.total*100).toFixed(1),a=(100-s).toFixed(1),o=i.jsxs("div",{className:"flex flex-col gap-[2px] rounded-[8px] border-[0.8px] border-[rgba(133,133,133,0.32)] bg-[rgba(255,255,255,0.08)] shadow-[0_2px_2px_0_rgba(5,5,5,0.48)] backdrop-blur-[43px] p-2 space-y-[2px]",children:[i.jsxs("div",{className:"flex items-center gap-[6px]",children:[i.jsx("span",{className:"inline-block h-[6px] w-[6px] rounded-full",style:{backgroundColor:bbn}}),i.jsx("span",{className:"text-[10px] font-medium leading-[10px] text-white",children:"Long"}),i.jsx("span",{className:"text-[10px] font-medium leading-[10px] text-white",children:iQ(r.long)}),i.jsxs("span",{className:"text-[10px] font-medium leading-[10px] text-[#909090]",children:["(",s,"%)"]})]}),i.jsxs("div",{className:"flex items-center gap-[6px]",children:[i.jsx("span",{className:"inline-block h-[6px] w-[6px] rounded-full",style:{backgroundColor:ybn}}),i.jsx("span",{className:"text-[10px] font-medium leading-[10px] text-white",children:"Short"}),i.jsx("span",{className:"text-[10px] font-medium leading-[10px] text-white",children:iQ(r.short)}),i.jsxs("span",{className:"text-[10px] font-medium leading-[10px] text-[#909090]",children:["(",a,"%)"]})]})]});return i.jsx(mi,{content:o,children:i.jsxs("div",{className:"flex items-center gap-[8px] w-full",children:[i.jsxs("div",{className:"flex w-[100px] items-center gap-[4px] mt-[2px]",children:[i.jsx("img",{src:`https://app.hyperliquid.xyz/coins/${r.coin}.svg`,alt:r.coin,className:"h-[18px] w-[18px] rounded-full",onError:l=>{l.currentTarget.onerror=null,l.currentTarget.src="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18'%3E%3Ccircle cx='9' cy='9' r='9' fill='%23575757'/%3E%3C/svg%3E"}}),i.jsx("span",{className:"text-[12px] font-normal leading-[14px] tracking-[-0.12px] text-white",children:r.coin})]}),i.jsxs("div",{className:"flex h-[16px] w-full gap-[2px] overflow-hidden ml-3",children:[i.jsx("div",{className:"flex rounded-[4px] items-center justify-center bg-[rgba(103,255,189,0.16)] text-[10px] font-semibold leading-[10px] tracking-[-0.1px] text-[#67FFBD]",style:{flexGrow:r.long,flexBasis:0},children:s>=15?`${s}%`:""}),i.jsx("div",{className:"flex rounded-[4px] items-center justify-center bg-[rgba(255,121,124,0.16)] text-[10px] font-semibold leading-[10px] tracking-[-0.1px] text-[#FF797C]",style:{flexGrow:r.short,flexBasis:0},children:a>=15?`${a}%`:""})]}),i.jsx("span",{className:"w-[48px] text-right text-[12px] font-medium leading-[14px] tracking-[-0.12px] text-white mt-[2px]",children:iQ(r.total)})]})},r.coin)})]})}const wbn="https://dextradata.nftinit.io/api/hyper/wallet/whale/open_interest/?period=1d",Cbn="https://dextradata.nftinit.io/api/hyper/wallet/whale/tx_summary/?period=1d",Sbn={BTC:"Bitcoin",ETH:"Ethereum",HYPE:"Hyperliquid",SOL:"Solana",XRP:"XRP",PUMP:"Pump",FARTCOIN:"Fartcoin"},Nbn=e=>{if(e==null)return"-";const t=Number(e),n=t<0?"-":"",r=Math.abs(t);return r>=1e9?`${n}$${(r/1e9).toFixed(2)}B`:r>=1e6?`${n}$${(r/1e6).toFixed(2)}M`:r>=1e3?`${n}$${(r/1e3).toFixed(0)}K`:`${n}$${r.toFixed(0)}`};function Abn(){const[e,t]=m.useState(null),[n,r]=m.useState([]),[s,a]=m.useState([]);return m.useEffect(()=>{const o=async()=>{var c,u,d,f,x,g;try{const[v,w]=await Promise.all([fs.get(wbn),fs.get(Cbn)]),C=((u=(c=v.data)==null?void 0:c.position_summary)==null?void 0:u.slice(0,10).map(R=>({coin:R.coin,long:Number(R.long),short:Number(R.short),total:Number(R.total)})))||[],N=((f=(d=w.data)==null?void 0:d.whale_summary)==null?void 0:f.slice(0,10).map(R=>({coin:R.coin,long:Number(R.long_tx_count),short:Number(R.short_tx_count),total:Number(R.total_tx_count)})))||[];r(C),a(N);const P=C[0]||{},I=((g=(x=w.data)==null?void 0:x.whale_summary)==null?void 0:g[0])||{};t([{type:"position",title:"Highest OI",coin:P.coin||"",name:Sbn[P.coin]||P.coin,value:Nbn(P.total)},{type:"trader",title:"Most Traded",coin:I.coin||"",name:"Top Trader",value:`${I.whale_count??"-"} Whales | TX: ${I.total_tx_count??"-"}`}])}catch{t([])}};o();const l=setInterval(o,3e4);return()=>clearInterval(l)},[]),e?i.jsx("div",{className:"border border-[#1E1E1E] bg-[#101010] rounded-[16px] p-2 flex gap-2 h-[128px]",children:e.map(o=>i.jsxs(pbn,{openDelay:0,closeDelay:0,children:[i.jsx(mbn,{asChild:!0,children:i.jsxs("div",{className:"flex-1 bg-[#1B1B1B] rounded-[12px] p-[10px] flex flex-col gap-1 hover:bg-[#2A2A2A] transition cursor-pointer",children:[i.jsxs("div",{className:"flex gap-1 justify-between items-center",children:[i.jsx("span",{className:"text-[#929292] text-[14px] leading-[16px] tracking-[-0.14px]",children:o.title}),i.jsxs("div",{className:"relative w-3 h-3 flex justify-center items-center mt-[4px]",children:[i.jsx("span",{className:"absolute inline-flex h-full w-full rounded-full bg-[#4DFF43]/[0.32] animate-ping"}),i.jsx("span",{className:"relative inline-flex rounded-full h-1.5 w-1.5 bg-[#4DFF43]"})]})]}),i.jsxs("div",{children:[i.jsx("img",{src:o.coin!=="wallet"?`https://app.hyperliquid.xyz/coins/${o.coin}.svg`:"https://app.hyperliquid.xyz/coins/BTC.svg",alt:o.coin,className:"w-[24px] h-[24px] mt-[5px]"}),i.jsxs("div",{className:"flex items-center gap-1 mt-[5px]",children:[i.jsx("div",{className:"text-white text-[14px] font-semibold leading-[16px] tracking-[-0.14px]",children:o.coin}),i.jsx("span",{className:"text-[#B7B7B7] text-[12px] leading-[11px]",children:o.name})]})]}),i.jsx("div",{className:"text-white font-inter text-[13px] font-medium leading-[14px] tracking-[-0.14px] mt-[6px] break-words whitespace-normal",children:o.value})]})}),i.jsx(xbn,{children:i.jsx(gbn,{side:"right",align:"start",sideOffset:0,collisionPadding:8,children:i.jsx(vbn,{title:o.type==="position"?"Top 10 Open OI":"Top 5 Most Trades",data:o.type==="position"?n:s})})})]},o.title))}):i.jsx("div",{className:"border border-[#1E1E1E] bg-[#101010] rounded-[16px] p-2 flex gap-2 h-[128px]",children:Array.from({length:2}).map((o,l)=>i.jsxs("div",{className:"flex-1 bg-[#1B1B1B] rounded-[12px] p-[10px] flex flex-col gap-3 animate-pulse",children:[i.jsx("div",{className:"h-[16px] w-24 rounded bg-[#262626]"}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("div",{className:"h-6 w-6 rounded-full bg-[#262626]"}),i.jsx("div",{className:"h-[14px] w-24 rounded bg-[#262626]"})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("div",{className:"h-[14px] w-24 rounded bg-[#262626]"}),i.jsx("div",{className:"h-[14px] w-14 rounded bg-[#262626]"})]})]},l))})}const jbn="https://dextradata.nftinit.io/api/hyper/wallet/whale/top_user_pnl/?period=1d",Ebn="https://dextradata.nftinit.io/api/hyper/wallet/whale/high_risk_traders/?period=1d",_bn=e=>`${e.slice(0,5)}...${e.slice(-4)}`,kbn=e=>{const t=Math.abs(Number(e));return t>=1e9?`$${(t/1e9).toFixed(2)}B`:t>=1e6?`$${(t/1e6).toFixed(2)}M`:t>=1e3?`$${(t/1e3).toFixed(2)}K`:`$${t.toFixed(2)}`};function Tbn(){const[e,t]=m.useState(null);return m.useEffect(()=>{const n=async()=>{var s,a,o,l;try{const[c,u]=await Promise.all([fs.get(jbn),fs.get(Ebn)]),d=(a=(s=c.data)==null?void 0:s.top_users)==null?void 0:a[0],f=(l=(o=u.data)==null?void 0:o.high_risk_traders)==null?void 0:l[0],x=(g,v,w="growth_rate")=>({title:v,address:_bn(g.user_token),wallet:g.user_token,amount:`${Number(g.pnl)>=0?"+":"-"}${kbn(g.pnl)}`,percent:`${Number(g[w]||0).toFixed(1)}%`});t([x(d,"Today's Trader","growth_rate"),x(f,"Low Risk Trader","total_win_rate")])}catch(c){console.error("Error loading Highlighted Whales",c),t([])}};n();const r=setInterval(n,3e4);return()=>clearInterval(r)},[]),e?i.jsx("div",{className:"flex gap-2 rounded-[16px] border border-[#1E1E1E] bg-[#101010] p-2 ",children:e.map(({title:n,address:r,amount:s,percent:a,wallet:o},l)=>i.jsx("div",{className:"flex-1",children:i.jsx("a",{href:`/wallet-details/${o}`,target:"_blank",rel:"noopener noreferrer",className:"flex-1 cursor-pointer",children:i.jsxs("div",{className:"flex flex-col gap-4 rounded-[12px] bg-[#1B1B1B] p-[10px] hover:bg-[#2A2A2A] transition",children:[i.jsx("h3",{className:"text-[#929292] font-inter text-[14px] leading-[16px] tracking-[-0.14px]",children:n}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(nVe,{size:24,name:r}),i.jsx("span",{className:"text-white font-inter font-medium text-[14px] leading-[13px] tracking-[-0.14px]",children:r})]}),i.jsxs("div",{className:"flex items-center gap-1",children:[i.jsx("span",{className:"text-white font-inter font-medium text-[14px] leading-[13px] tracking-[-0.14px]",children:s}),i.jsx(mi,{content:n==="Today's Trader"?"Growth Rate":"Win Rate",children:i.jsx("div",{className:"flex h-[18px] w-[48px] items-center justify-center gap-[2px] rounded-[4px] bg-[#67FFBD]/20 pl-[4px] pr-[6px] py-[4px]",children:i.jsx("span",{className:"font-manrope text-[11px] font-semibold leading-[8px] text-[#67FFBD]",children:a})})})]})]})})},l))}):i.jsx("div",{className:"flex gap-4 rounded-[16px] border border-[#1E1E1E] bg-[#101010] p-2",children:Array.from({length:2}).map((n,r)=>i.jsx("div",{className:"flex-1 animate-pulse",children:i.jsxs("div",{className:"flex flex-col gap-4 rounded-[12px] bg-[#1B1B1B] p-[10px]",children:[i.jsx("div",{className:"h-[16px] w-24 rounded bg-[#262626]"}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("div",{className:"h-6 w-6 rounded-full bg-[#262626]"}),i.jsx("div",{className:"h-[14px] w-32 rounded bg-[#262626]"})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("div",{className:"h-[14px] w-20 rounded bg-[#262626]"}),i.jsx("div",{className:"h-[18px] w-12 rounded bg-[#262626]"})]})]})},r))})}function aQ(e){if(!e)return"-";const t=Math.floor((Date.now()-e.getTime())/1e3);return t<60?`Last updated ${t} sec ago`:`Last updated ${Math.floor(t/60)} min ago`}function Ibn({data:e,lastUpdated:t}){const[n,r]=m.useState(0);return m.useEffect(()=>{const s=setInterval(()=>{r(a=>a+1)},1e3);return()=>clearInterval(s)},[]),i.jsxs("div",{className:"w-full flex flex-col xl:flex-row gap-4 mt-10",children:[i.jsxs("div",{className:"flex-1 min-w-[300px] bg-transparent space-y-3",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx(mi,{content:`Shows overall market direction from whale positions in the last 24 hours.
Covers all coins on Hyperliquid.
Note: Only includes whales with PERP equity > $1M.`,children:i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("h2",{className:"text-white font-inter text-[16px] not-italic font-medium leading-[21px] tracking-[-0.32px]",children:"Market Insights"}),i.jsx("span",{className:"inline-flex items-center justify-center h-[18px] px-[6px] py-[3px] bg-[#202020] text-[10px] leading-[10px] font-medium rounded-full text-white",children:"LAST 24H"}),i.jsx("img",{className:"-ml-1",src:E0,alt:"Dextrabot - Whale Trades"})]})}),i.jsx("span",{className:"text-[#8B8B8B] font-inter text-[12px] not-italic font-normal leading-[14px] tracking-[0.12px]",children:aQ(t)})]}),i.jsx(abn,{data:e})]}),i.jsxs("div",{className:"flex-1 min-w-[300px] bg-transparent space-y-3",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx(mi,{content:"Highlights the most active assets by whale positions and trading volume.",children:i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("h2",{className:"text-white font-inter text-[16px] not-italic font-medium leading-[21px] tracking-[-0.32px]",children:"Asset Insights"}),i.jsx("span",{className:"inline-flex items-center justify-center h-[18px] px-[6px] py-[3px] bg-[#202020] text-[10px] leading-[10px] font-medium rounded-full text-white",children:"LAST 24H"}),i.jsx("img",{className:"-ml-1",src:E0,alt:"Dextrabot - Whale Trades"})]})}),i.jsx("span",{className:"text-[#8B8B8B] font-inter text-[12px] not-italic font-normal leading-[14px] tracking-[0.12px]",children:aQ(t)})]}),i.jsx(Abn,{})]}),i.jsxs("div",{className:"flex-1 min-w-[300px] bg-transparent space-y-3",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx(mi,{content:"Spotlights standout whale traders based on daily performance and risk profile.",children:i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("h2",{className:"text-white font-inter text-[16px] not-italic font-medium leading-[21px] tracking-[-0.32px]",children:"Highlighted Whales"}),i.jsx("span",{className:"inline-flex items-center justify-center h-[18px] px-[6px] py-[3px] bg-[#202020] text-[10px] leading-[10px] font-medium rounded-full text-white",children:"LAST 24H"}),i.jsx("img",{className:"-ml-1",src:E0,alt:"Dextrabot - Whale Trades"})]})}),i.jsx("span",{className:"text-[#8B8B8B] font-inter text-[12px] not-italic font-normal leading-[14px] tracking-[0.12px]",children:aQ(t)})]}),i.jsx(Tbn,{})]})]})}function Pbn(){const[e,t]=m.useState(null),[n,r]=m.useState(null);return m.useEffect(()=>{const s=document.querySelector("main");return s&&(s.style.background="#050505"),()=>{s&&(s.style.background="")}},[]),i.jsxs(i.Fragment,{children:[i.jsx(So,{children:i.jsxs(Ro,{children:[i.jsx("title",{children:"High Volume Trades on Hyperliquid"}),i.jsx("meta",{name:"description",content:"Track Hyperliquid high volume trades and whale activity in real-time."}),i.jsx("meta",{name:"og:title",content:"Hyperliquid High Volume Trades Tracker | DextraBot"}),i.jsx("meta",{name:"og:description",content:"Track Hyperliquid high volume trades and whale activity in real-time."}),i.jsx("meta",{name:"og:image",content:"https://app.dextrabot.com/dextrabotIcon.png"}),i.jsx("meta",{name:"og:url",content:"https://app.dextrabot.com/hyperliquid-whale-trades"})]})}),i.jsxs("div",{className:"max-w-[1440px] w-full mx-auto px-4 font-manrope relative mt-4",children:[i.jsxs("div",{className:"flex items-center justify-between mb-3",children:[i.jsxs("h1",{className:"flex items-center gap-[6px] py-4 text-[18px] leading-[21px] tracking-[-0.36px] font-normal",children:[i.jsx("span",{className:"text-[#929292] font-normal",children:"Dextrabot"}),i.jsx("span",{className:"text-[#929292] font-normal",children:"/"}),i.jsx("img",{className:"w-6 h-6",src:Ryt,alt:"Dextrabot - Hyperliquid Whale Trades"}),i.jsx("span",{className:"hidden sm:block text-white font-bold text-[16px]",children:"Hyperliquid Whale Trades"}),i.jsx("span",{className:"block sm:hidden text-white font-bold text-[16px]",children:"Whale Trades"})]}),i.jsx(mi,{content:"Join our Telegram for Hyperliquid whale alerts.",children:i.jsxs("a",{href:"https://t.me/+bYnGEvP0fB41M2I0",target:"_blank",rel:"noopener noreferrer",className:"rounded-[10px] border border-[#242424] inline-flex h-8 px-2 py-3 justify-center items-center gap-[10px] shrink-0 text-white font-manrope text-[13px] font-semibold leading-[8px] hover:text-white",children:[i.jsx("img",{src:Hbt,alt:"Dextrabot Whale Trades - Join Telegram"}),"Join Telegram"]})})]}),i.jsxs("div",{className:"flex flex-col space-y-4 sm:flex-row sm:space-y-0 sm:space-x-4",children:[i.jsx("div",{className:"w-full sm:w-1/3",children:i.jsx(P0n,{onData:s=>{t(s),r(new Date)}})}),i.jsx("div",{className:"w-full sm:w-2/3",children:i.jsx(nxn,{})})]}),i.jsx("div",{className:"mt-4",children:i.jsx(Ibn,{data:e,lastUpdated:n})}),i.jsx("div",{className:"mt-4",children:i.jsx(ibn,{})})]})]})}const Fbn=()=>{const{setSignModalOpen:e}=m.useContext(Qr),{address:t}=ns(),[n,r]=m.useState(Array(6).fill("")),[s,a]=m.useState(""),[o,l]=m.useState(!1),[c,u]=m.useState(!1),[d,f]=m.useState(!1),x=async()=>{try{const N=window.localStorage.getItem("hyperToken"),P=window.localStorage.getItem("hyperAddress");if(!N||n.join("")===""||n.join("").length<6){N?n.join("")===""?a("Please enter the verification code."):n.join("").length<6&&a("The verification code must be 6 characters long."):e(!0);return}l(!0),a("");const I="https://dextrabothypev2.nftinit.io/api/telegram/sign_with_telegram/",R={address:t?t.toLowerCase():P,token:N,temp_password:n.join("")},U=await(await fetch(I,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(R)})).json();U!=null&&U.success?(U!=null&&U.telegram_chat_id&&u(!0),r(Array(6).fill("")),rn.success(i.jsx(i.Fragment,{children:i.jsx("span",{style:{color:"#67ffbd",paddingLeft:"5px"},children:"Verified successfully."})}),{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(103, 255, 189, 0.32)",width:"280px",minWidth:"280px",height:"40px",backdropFilter:"blur(48px)"},iconTheme:{primary:"#67FFBD",secondary:"#276047"}}),l(!1)):(console.log(U.error_message),a("Invalid code. Please request a new code from Telegram and try again."),f(!0),l(!1))}catch(N){console.error("Error in telegram verify:",N),rn.error(N.message||"Something went wrong!"),a(N.message||"Something went wrong!"),f(!0),l(!1)}},g=(N,P)=>{f(!1);const I=[...n];I[P]=N.target.value.toUpperCase().slice(0,1),r(I),N.target.value.length===1&&P<5&&document.getElementById(`code-input-${P+1}`).focus()},v=N=>{f(!1);const P=N.clipboardData.getData("Text").slice(0,6),I=[...n];for(let F=0;F<P.length;F++)I[F]=P[F].toUpperCase();r(I);const R=document.getElementById(`code-input-${(P==null?void 0:P.length)-1}`);R==null||R.focus(),R==null||R.select()},w=(N,P)=>{var I,R;if(f(!1),N.key==="Backspace"){if(n[P]){const F=[...n];F[P]="",r(F)}else if(P>0){const F=document.getElementById(`code-input-${P-1}`),U=[...n];U[P-1]="",r(U),F==null||F.focus()}}else N.key==="ArrowLeft"&&P>0?(I=document.getElementById(`code-input-${P-1}`))==null||I.focus():N.key==="ArrowRight"&&P<5&&((R=document.getElementById(`code-input-${P+1}`))==null||R.focus())},C=()=>{r(Array(6).fill("")),f(!1)};return i.jsxs("div",{className:"flex flex-col items-center justify-center px-2 pb-2 gap-6 w-max h-max bg-[#212121]/90 rounded-2xl shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-[#2a2a2a] relative pt-10",onPaste:v,children:[s&&i.jsxs("div",{style:{backdropFilter:"blur(16px)"},className:"w-full max-w-[345px] px-3 py-2 bg-[#ff7171]/20 rounded-xl shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] flex justify-start items-center gap-2.5 absolute top-2 ",children:[i.jsx("img",{src:ec,alt:"",className:"mb-[2.5px]"}),i.jsx("div",{className:"flex justify-start text-[#ff7171] text-[13px] font-normal font-['Inter'] leading-4 tracking-[-0.26px]",children:s})]}),c?i.jsxs("div",{className:"flex flex-col items-center text-white text-base font-medium font-['Inter'] text-center gap-2",children:[i.jsx("img",{src:oke,alt:""}),i.jsx("div",{className:"text-center text-white text-sm font-medium font-['Inter'] leading-4 tracking-[-0.28px]",children:"Successfully"}),i.jsx("div",{className:" w-[186px] text-center text-white text-[13px] font-normal font-['Inter'] leading-4",children:"Your Telegram account is now synced with your wallet."}),i.jsx("div",{className:"flex flex-col items-center gap-6 mt-[33px]",children:i.jsxs("div",{onClick:()=>window.open("https://t.me/Dextrabot_CopyTrade_bot","_blank"),className:"w-[345px] h-10 px-6 py-3 bg-white hover:bg-[#E5E5E5] rounded-xl shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] inline-flex justify-center items-center gap-2.5 cursor-pointer",children:[i.jsx("img",{src:lke,alt:""}),i.jsx("div",{className:"justify-start text-black text-sm font-semibold font-['Inter'] leading-none",children:"Open Telegram App"})]})})]}):i.jsxs(i.Fragment,{children:[i.jsx("img",{src:Dyt,alt:"",className:"w-auto h-[40px]"}),i.jsx("h1",{className:"text-center text-white text-sm font-medium font-['Inter'] leading-4 tracking-[-0.28px]",children:"Verify Your Telegram Account"}),i.jsx("p",{className:"mb-2 -mt-4 text-center text-[#929292] text-[13px] font-normal font-['Inter'] leading-4 max-w-[240px]",children:"Enter the 6-character verification code sent to your Telegram account."}),i.jsx("div",{className:"flex gap-2",children:n.map((N,P)=>i.jsx("input",{id:`code-input-${P}`,type:"text",maxLength:"1",value:N,autoComplete:"off",onChange:I=>g(I,P),onKeyDown:I=>w(I,P),className:`${d?"border-[#ff787b]":"border-white/20"} w-10 h-12 text-center text-white text-[32px] font-medium font-['Inter'] leading-10 bg-transparent shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border-[0.60px] rounded-[10px] focus:bg-[#353535] outline-none`},P))}),i.jsxs("div",{className:"text-center",children:[i.jsxs("span",{class:"text-[#929292] text-[11px] font-normal font-['Inter'] leading-none",children:["Didn’t get a code?"," "]}),i.jsx("span",{onClick:()=>window.open("https://t.me/Dextrabot_CopyTrade_bot","_blank"),class:"text-[#929292] hover:text-white text-[11px] font-medium font-['Inter'] leading-4 cursor-pointer",children:"Open Telegram App"})]}),i.jsxs("div",{className:"flex items-center justify-center gap-2 relative",children:[i.jsx("div",{onClick:C,className:"w-[140px] h-10 px-6 py-3 rounded-xl shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] outline outline-1 outline-offset-[-1px] outline-[#424242] flex justify-center items-center gap-2.5 cursor-pointer group",children:i.jsx("div",{className:"text-[#b7b7b7] group-hover:text-white text-sm font-semibold font-['Inter'] leading-4 tracking-[-0.28px]",children:"Clear"})}),i.jsx("div",{onClick:N=>{N.preventDefault(),o||x()},className:"w-[196px] h-10 px-6 py-3 bg-white hover:bg-[#E5E5E5] rounded-xl shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] flex justify-center items-center gap-2.5 cursor-pointer",children:o?i.jsxs("div",{role:"status",className:"flex justify-center items-center h-5 min-h-5 w-[72px] px-2 py-1.5 rounded-md",children:[i.jsxs("svg",{"aria-hidden":"true",className:"inline w-4 h-4 text-gray-200 animate-spin dark:text-gray-600 fill-[#67FFBD]",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),i.jsx("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]}),i.jsx("span",{className:"sr-only",children:"Loading..."})]}):i.jsx("div",{className:"justify-start text-black text-sm font-semibold font-['Inter'] leading-[8px]",children:"Authorize Wallet"})})]})]})]})},Obn=()=>{const{isConnected:e,address:t}=ns(),{hyperToken:n,hyperAddress:r,setSignModalOpen:s,setTelegramChatId:a,setSubscriberRole:o,setSubsExpireDay:l,setMushboomerETH:c,setMushboomerSOL:u,setIsReferralCode:d,setIsReferralCodeName:f,setIsWhitelist:x,setHyperToken:g,setHyperAddress:v}=m.useContext(Qr),[w,C]=m.useState(!!window.localStorage.getItem("hyperToken"));return m.useEffect(()=>{const N=window.localStorage.getItem("hyperToken");C(!!N)},[t,e,n,r]),m.useEffect(()=>{(async()=>{var R,F;const P=window.localStorage.getItem("hyperToken"),I=window.localStorage.getItem("hyperAddress");if(!(!P||!I))try{const U=await Ei(I.toLowerCase(),P);U!=null&&U.success?(a(U==null?void 0:U.telegram_chat_id),o(U==null?void 0:U.subscriber_role),l(U==null?void 0:U.subs_expire_day),c((R=U==null?void 0:U.mushboomer_counts)==null?void 0:R.eth),u((F=U==null?void 0:U.mushboomer_counts)==null?void 0:F.sol),d(U==null?void 0:U.referral_code),f(U==null?void 0:U.refcode),x(U==null?void 0:U.whitelist)):(window.localStorage.removeItem("hyperToken"),window.localStorage.removeItem("hyperAddress"),g(""),v(""))}catch(U){console.error("Token verification error:",U),console.error(U.message||"An unknown error occurred.")}})()},[]),i.jsxs(i.Fragment,{children:[i.jsx(So,{children:i.jsxs(Ro,{children:[i.jsx("title",{children:"Telegram Verify – DextraBot"}),i.jsx("meta",{name:"description",content:"Verify your Telegram account to start earning with DextraBot's referral program. Follow the steps to confirm your Telegram identity and gain access to exclusive rewards."}),i.jsx("meta",{name:"og:title",content:"Telegram Verify – DextraBot"}),i.jsx("meta",{name:"og:description",content:"Verify your Telegram account to start earning with DextraBot's referral program. Follow the steps to confirm your Telegram identity and gain access to exclusive rewards."}),i.jsx("meta",{name:"og:image",content:"https://app.dextrabot.com/dextrabotIcon.png"}),i.jsx("meta",{name:"og:url",content:"https://app.dextrabot.com/telegram-verify"})]})}),i.jsx("div",{style:{background:"linear-gradient(135deg, #0d0d0d 0%, #1c1c1c 50%, #0d0d0d 100%)"},className:"flex justify-center items-center w-full h-[calc(100vh-6rem)] sm:h-[calc(100vh-5rem)] min-h-max max-h-[calc(100vh-6rem)] sm:max-h-[calc(100vh-5rem)] px-4 pt-16 sm:pt-4 pb-10 bg-[#161616]",children:w?i.jsx(Fbn,{}):i.jsx("div",{className:"flex justify-center items-center w-full",children:i.jsx(fU,{})})})]})};function Mbn({onRun:e}){const[t,n]=m.useState({wallet:"",pairs:[],equity:"",scale:"",period:"30D",method:"3"}),[r,s]=m.useState([]);m.useEffect(()=>{fetch("https://dextrabothypev2.nftinit.io/api/hyper/get_coins/").then(u=>u.json()).then(u=>s(u.coins.filter(d=>!d.startsWith("@")).map(d=>({value:d,label:d,icon:`https://app.hyperliquid.xyz/coins/${d}.svg`}))))},[]);const a=[{value:"All",label:"All"},...r],o=({label:u,icon:d})=>i.jsxs("div",{className:"flex items-center gap-2",children:[u!=="All"&&i.jsx("img",{src:d,alt:u,className:"w-4 h-4",onError:f=>f.currentTarget.style.display="none"}),i.jsx("span",{children:u})]}),l={control:(u,d)=>({...u,backgroundColor:"#1B1B1B",borderColor:"#303030",height:"32px",minHeight:"32px",borderRadius:"6px",boxShadow:"none",fontSize:"14px",alignItems:"center"}),valueContainer:u=>({...u,height:"32px",padding:"0 8px",display:"flex",alignItems:"center"}),input:u=>({...u,margin:0,padding:0,color:"#C9C9C9",fontSize:"14px",display:"flex",alignItems:"center"}),indicatorsContainer:u=>({...u,height:"32px"}),indicatorSeparator:u=>({...u,height:"16px",alignSelf:"center",backgroundColor:"#444"}),placeholder:u=>({...u,color:"#7F7F7F",fontSize:"14px",display:"flex",alignItems:"center"}),singleValue:u=>({...u,color:"#7F7F7F",fontSize:"14px",display:"flex",alignItems:"center"}),menu:u=>({...u,backgroundColor:"#1B1B1B",fontSize:"14px"}),option:(u,d)=>({...u,backgroundColor:d.isFocused?"#292929":"#1B1B1B",color:"#C9C9C9",fontSize:"14px",paddingTop:"8px",paddingBottom:"8px",display:"flex",alignItems:"center",":active":{backgroundColor:"#292929"}}),multiValue:u=>({...u,backgroundColor:"#292929"}),multiValueLabel:u=>({...u,color:"#fff",fontSize:"14px"}),multiValueRemove:u=>({...u,color:"#fff",":hover":{backgroundColor:"#555",color:"#fff"}})},c=u=>d=>n({...t,[u]:d.target.value});return i.jsxs("div",{className:"w-[388px] h-auto rounded-[16px] bg-[rgba(30,30,30,0.64)] backdrop-blur-[64px] p-6 flex flex-col gap-4",children:[i.jsx("h2",{className:"text-white font-inter text-[18px] font-semibold tracking-[-0.36px]",children:"Start your backtest"}),i.jsx("p",{className:"text-[#8E8E8E] text-[14px] leading-[16px] tracking-[-0.28px] w-[277px]",children:"Test how profitable it would be to copy any trader’s strategy"}),i.jsxs("label",{className:"flex flex-col gap-2",children:[i.jsx("span",{className:"text-[#C9C9C9] text-[13px] font-manrope font-medium tracking-[0.26px]",children:"Wallet Address"}),i.jsx("input",{className:"w-full h-[32px] rounded-[6px] border border-[#303030] bg-[#1B1B1B] px-3 text-[#7F7F7F] text-[14px] placeholder:text-[#7F7F7F] outline-none",placeholder:"Enter trader’s wallet address",value:t.wallet,onChange:c("wallet")})]}),i.jsxs("label",{className:"flex flex-col gap-2",children:[i.jsx("span",{className:"text-[#C9C9C9] text-[13px] font-manrope font-medium tracking-[0.26px]",children:"Method"}),i.jsxs("select",{value:t.method,onChange:c("method"),className:"w-full h-[32px] rounded-[6px] border border-[#303030] bg-[#1B1B1B] px-2 text-[14px] text-[#7F7F7F] outline-none",children:[i.jsx("option",{value:"1",disabled:!0,children:"Method I (coming soon)"}),i.jsx("option",{value:"2",disabled:!0,children:"Method II (coming soon)"}),i.jsx("option",{value:"3",children:"Method III"})]})]}),i.jsxs("label",{className:"flex flex-col gap-2",children:[i.jsx("span",{className:"text-[#C9C9C9] text-[13px] font-manrope font-medium tracking-[0.26px]",children:"Trading Pairs"}),i.jsx(Cl,{options:a,isMulti:!0,placeholder:"All",closeMenuOnSelect:!1,hideSelectedOptions:!1,formatOptionLabel:o,styles:l,value:t.pairs.length?a.filter(u=>t.pairs.includes(u.value)):null,onChange:u=>{u!=null&&u.some(d=>d.value==="All")?n({...t,pairs:[]}):n({...t,pairs:u?u.map(d=>d.value):[]})}})]}),i.jsxs("label",{className:"flex flex-col gap-2",children:[i.jsx("span",{className:"text-[#C9C9C9] text-[13px] font-manrope font-medium tracking-[0.26px]",children:"Initial Equity"}),i.jsx("input",{type:"number",placeholder:"1000",className:"w-full h-[32px] rounded-[6px] border border-[#303030] bg-[#1B1B1B] px-3 text-[#7F7F7F] text-[14px] placeholder:text-[#7F7F7F] outline-none",value:t.equity,onChange:c("equity")})]}),i.jsxs("label",{className:"flex flex-col gap-2",children:[i.jsx("span",{className:"text-[#C9C9C9] text-[13px] font-manrope font-medium tracking-[0.26px]",children:"Scaling Factor (%)"}),i.jsx("input",{type:"number",placeholder:"50",className:"w-full h-[32px] rounded-[6px] border border-[#303030] bg-[#1B1B1B] px-3 text-[#7F7F7F] text-[14px] placeholder:text-[#7F7F7F] outline-none",value:t.scale,onChange:c("scale")})]}),i.jsxs("div",{className:"flex flex-col gap-2",children:[i.jsx("span",{className:"text-[#C9C9C9] text-[13px] font-manrope font-medium tracking-[0.26px]",children:"Time Period"}),i.jsx("div",{className:"flex gap-2",children:["7D","30D","90D"].map(u=>i.jsx("button",{onClick:()=>n({...t,period:u}),className:`w-[40px] h-[32px] rounded-[6px] bg-transparent border border-[#303030] flex justify-center items-center text-[12px] ${t.period===u?"text-white":"text-[#7F7F7F]"}`,children:u},u))})]}),i.jsx("button",{onClick:()=>e(t),className:"h-[32px] mt-auto flex py-[12px] px-[24px] justify-center items-center gap-[10px] rounded-[10px] bg-[#1DE674] text-[#0B331C] text-[13px] font-inter font-semibold tracking-[-0.13px]",children:"Run Backtest"})]})}function Rbn(){const[e,t]=m.useState(0);return m.useEffect(()=>{const n=setInterval(()=>{t(r=>(r+1)%3)},600);return()=>clearInterval(n)},[]),i.jsxs("div",{className:"flex flex-col items-center justify-center h-full bg-transparent text-white text-[13px] font-inter space-y-2",children:[i.jsxs("div",{className:"text-center",children:[i.jsx("span",{className:"font-semibold leading-[14px] tracking-[-0.26px]",children:"Backtest Engine"})," ",i.jsx("span",{className:"font-normal leading-[14px] tracking-[-0.26px]",children:"is running..."})]}),i.jsx("div",{className:"text-[#7F7F7F] text-[13px] leading-[14px] tracking-[-0.26px] text-center font-normal",children:"Your strategy is being tested, the results will be here shortly...."}),i.jsx("div",{className:"flex gap-2 pt-1",children:[0,1,2].map(n=>i.jsx("div",{className:`w-[8px] h-[8px] rounded-full transition-all duration-300 ${n===e?"bg-[#1DE674]":"bg-[#404040]"}`},n))})]})}var Wue={};(function e(t,n,r,s){var a=!!(t.Worker&&t.Blob&&t.Promise&&t.OffscreenCanvas&&t.OffscreenCanvasRenderingContext2D&&t.HTMLCanvasElement&&t.HTMLCanvasElement.prototype.transferControlToOffscreen&&t.URL&&t.URL.createObjectURL),o=typeof Path2D=="function"&&typeof DOMMatrix=="function",l=function(){if(!t.OffscreenCanvas)return!1;var ee=new OffscreenCanvas(1,1),ae=ee.getContext("2d");ae.fillRect(0,0,1,1);var fe=ee.transferToImageBitmap();try{ae.createPattern(fe,"no-repeat")}catch{return!1}return!0}();function c(){}function u(ee){var ae=n.exports.Promise,fe=ae!==void 0?ae:t.Promise;return typeof fe=="function"?new fe(ee):(ee(c,c),null)}var d=function(ee,ae){return{transform:function(fe){if(ee)return fe;if(ae.has(fe))return ae.get(fe);var Ne=new OffscreenCanvas(fe.width,fe.height),he=Ne.getContext("2d");return he.drawImage(fe,0,0),ae.set(fe,Ne),Ne},clear:function(){ae.clear()}}}(l,new Map),f=function(){var ee=Math.floor(16.666666666666668),ae,fe,Ne={},he=0;return typeof requestAnimationFrame=="function"&&typeof cancelAnimationFrame=="function"?(ae=function(ge){var ye=Math.random();return Ne[ye]=requestAnimationFrame(function ve(je){he===je||he+ee-1<je?(he=je,delete Ne[ye],ge()):Ne[ye]=requestAnimationFrame(ve)}),ye},fe=function(ge){Ne[ge]&&cancelAnimationFrame(Ne[ge])}):(ae=function(ge){return setTimeout(ge,ee)},fe=function(ge){return clearTimeout(ge)}),{frame:ae,cancel:fe}}(),x=function(){var ee,ae,fe={};function Ne(he){function ge(ye,ve){he.postMessage({options:ye||{},callback:ve})}he.init=function(ve){var je=ve.transferControlToOffscreen();he.postMessage({canvas:je},[je])},he.fire=function(ve,je,Ie){if(ae)return ge(ve,null),ae;var Le=Math.random().toString(36).slice(2);return ae=u(function(Qe){function $e(it){it.data.callback===Le&&(delete fe[Le],he.removeEventListener("message",$e),ae=null,d.clear(),Ie(),Qe())}he.addEventListener("message",$e),ge(ve,Le),fe[Le]=$e.bind(null,{data:{callback:Le}})}),ae},he.reset=function(){he.postMessage({reset:!0});for(var ve in fe)fe[ve](),delete fe[ve]}}return function(){if(ee)return ee;if(!r&&a){var he=["var CONFETTI, SIZE = {}, module = {};","("+e.toString()+")(this, module, true, SIZE);","onmessage = function(msg) {"," if (msg.data.options) {"," CONFETTI(msg.data.options).then(function () {"," if (msg.data.callback) {"," postMessage({ callback: msg.data.callback });"," }"," });"," } else if (msg.data.reset) {"," CONFETTI && CONFETTI.reset();"," } else if (msg.data.resize) {"," SIZE.width = msg.data.resize.width;"," SIZE.height = msg.data.resize.height;"," } else if (msg.data.canvas) {"," SIZE.width = msg.data.canvas.width;"," SIZE.height = msg.data.canvas.height;"," CONFETTI = module.exports.create(msg.data.canvas);"," }","}"].join(`
`);try{ee=new Worker(URL.createObjectURL(new Blob([he])))}catch(ge){return typeof console!==void 0&&typeof console.warn=="function"&&console.warn("🎊 Could not load worker",ge),null}Ne(ee)}return ee}}(),g={particleCount:50,angle:90,spread:45,startVelocity:45,decay:.9,gravity:1,drift:0,ticks:200,x:.5,y:.5,shapes:["square","circle"],zIndex:100,colors:["#26ccff","#a25afd","#ff5e7e","#88ff5a","#fcff42","#ffa62d","#ff36ff"],disableForReducedMotion:!1,scalar:1};function v(ee,ae){return ae?ae(ee):ee}function w(ee){return ee!=null}function C(ee,ae,fe){return v(ee&&w(ee[ae])?ee[ae]:g[ae],fe)}function N(ee){return ee<0?0:Math.floor(ee)}function P(ee,ae){return Math.floor(Math.random()*(ae-ee))+ee}function I(ee){return parseInt(ee,16)}function R(ee){return ee.map(F)}function F(ee){var ae=String(ee).replace(/[^0-9a-f]/gi,"");return ae.length<6&&(ae=ae[0]+ae[0]+ae[1]+ae[1]+ae[2]+ae[2]),{r:I(ae.substring(0,2)),g:I(ae.substring(2,4)),b:I(ae.substring(4,6))}}function U(ee){var ae=C(ee,"origin",Object);return ae.x=C(ae,"x",Number),ae.y=C(ae,"y",Number),ae}function L(ee){ee.width=document.documentElement.clientWidth,ee.height=document.documentElement.clientHeight}function z(ee){var ae=ee.getBoundingClientRect();ee.width=ae.width,ee.height=ae.height}function Q(ee){var ae=document.createElement("canvas");return ae.style.position="fixed",ae.style.top="0px",ae.style.left="0px",ae.style.pointerEvents="none",ae.style.zIndex=ee,ae}function ne(ee,ae,fe,Ne,he,ge,ye,ve,je){ee.save(),ee.translate(ae,fe),ee.rotate(ge),ee.scale(Ne,he),ee.arc(0,0,1,ye,ve,je),ee.restore()}function J(ee){var ae=ee.angle*(Math.PI/180),fe=ee.spread*(Math.PI/180);return{x:ee.x,y:ee.y,wobble:Math.random()*10,wobbleSpeed:Math.min(.11,Math.random()*.1+.05),velocity:ee.startVelocity*.5+Math.random()*ee.startVelocity,angle2D:-ae+(.5*fe-Math.random()*fe),tiltAngle:(Math.random()*(.75-.25)+.25)*Math.PI,color:ee.color,shape:ee.shape,tick:0,totalTicks:ee.ticks,decay:ee.decay,drift:ee.drift,random:Math.random()+2,tiltSin:0,tiltCos:0,wobbleX:0,wobbleY:0,gravity:ee.gravity*3,ovalScalar:.6,scalar:ee.scalar,flat:ee.flat}}function X(ee,ae){ae.x+=Math.cos(ae.angle2D)*ae.velocity+ae.drift,ae.y+=Math.sin(ae.angle2D)*ae.velocity+ae.gravity,ae.velocity*=ae.decay,ae.flat?(ae.wobble=0,ae.wobbleX=ae.x+10*ae.scalar,ae.wobbleY=ae.y+10*ae.scalar,ae.tiltSin=0,ae.tiltCos=0,ae.random=1):(ae.wobble+=ae.wobbleSpeed,ae.wobbleX=ae.x+10*ae.scalar*Math.cos(ae.wobble),ae.wobbleY=ae.y+10*ae.scalar*Math.sin(ae.wobble),ae.tiltAngle+=.1,ae.tiltSin=Math.sin(ae.tiltAngle),ae.tiltCos=Math.cos(ae.tiltAngle),ae.random=Math.random()+2);var fe=ae.tick++/ae.totalTicks,Ne=ae.x+ae.random*ae.tiltCos,he=ae.y+ae.random*ae.tiltSin,ge=ae.wobbleX+ae.random*ae.tiltCos,ye=ae.wobbleY+ae.random*ae.tiltSin;if(ee.fillStyle="rgba("+ae.color.r+", "+ae.color.g+", "+ae.color.b+", "+(1-fe)+")",ee.beginPath(),o&&ae.shape.type==="path"&&typeof ae.shape.path=="string"&&Array.isArray(ae.shape.matrix))ee.fill(oe(ae.shape.path,ae.shape.matrix,ae.x,ae.y,Math.abs(ge-Ne)*.1,Math.abs(ye-he)*.1,Math.PI/10*ae.wobble));else if(ae.shape.type==="bitmap"){var ve=Math.PI/10*ae.wobble,je=Math.abs(ge-Ne)*.1,Ie=Math.abs(ye-he)*.1,Le=ae.shape.bitmap.width*ae.scalar,Qe=ae.shape.bitmap.height*ae.scalar,$e=new DOMMatrix([Math.cos(ve)*je,Math.sin(ve)*je,-Math.sin(ve)*Ie,Math.cos(ve)*Ie,ae.x,ae.y]);$e.multiplySelf(new DOMMatrix(ae.shape.matrix));var it=ee.createPattern(d.transform(ae.shape.bitmap),"no-repeat");it.setTransform($e),ee.globalAlpha=1-fe,ee.fillStyle=it,ee.fillRect(ae.x-Le/2,ae.y-Qe/2,Le,Qe),ee.globalAlpha=1}else if(ae.shape==="circle")ee.ellipse?ee.ellipse(ae.x,ae.y,Math.abs(ge-Ne)*ae.ovalScalar,Math.abs(ye-he)*ae.ovalScalar,Math.PI/10*ae.wobble,0,2*Math.PI):ne(ee,ae.x,ae.y,Math.abs(ge-Ne)*ae.ovalScalar,Math.abs(ye-he)*ae.ovalScalar,Math.PI/10*ae.wobble,0,2*Math.PI);else if(ae.shape==="star")for(var tt=Math.PI/2*3,lt=4*ae.scalar,ft=8*ae.scalar,ut=ae.x,qt=ae.y,It=5,nn=Math.PI/It;It--;)ut=ae.x+Math.cos(tt)*ft,qt=ae.y+Math.sin(tt)*ft,ee.lineTo(ut,qt),tt+=nn,ut=ae.x+Math.cos(tt)*lt,qt=ae.y+Math.sin(tt)*lt,ee.lineTo(ut,qt),tt+=nn;else ee.moveTo(Math.floor(ae.x),Math.floor(ae.y)),ee.lineTo(Math.floor(ae.wobbleX),Math.floor(he)),ee.lineTo(Math.floor(ge),Math.floor(ye)),ee.lineTo(Math.floor(Ne),Math.floor(ae.wobbleY));return ee.closePath(),ee.fill(),ae.tick<ae.totalTicks}function re(ee,ae,fe,Ne,he){var ge=ae.slice(),ye=ee.getContext("2d"),ve,je,Ie=u(function(Le){function Qe(){ve=je=null,ye.clearRect(0,0,Ne.width,Ne.height),d.clear(),he(),Le()}function $e(){r&&!(Ne.width===s.width&&Ne.height===s.height)&&(Ne.width=ee.width=s.width,Ne.height=ee.height=s.height),!Ne.width&&!Ne.height&&(fe(ee),Ne.width=ee.width,Ne.height=ee.height),ye.clearRect(0,0,Ne.width,Ne.height),ge=ge.filter(function(it){return X(ye,it)}),ge.length?ve=f.frame($e):Qe()}ve=f.frame($e),je=Qe});return{addFettis:function(Le){return ge=ge.concat(Le),Ie},canvas:ee,promise:Ie,reset:function(){ve&&f.cancel(ve),je&&je()}}}function pe(ee,ae){var fe=!ee,Ne=!!C(ae||{},"resize"),he=!1,ge=C(ae,"disableForReducedMotion",Boolean),ye=a&&!!C(ae||{},"useWorker"),ve=ye?x():null,je=fe?L:z,Ie=ee&&ve?!!ee.__confetti_initialized:!1,Le=typeof matchMedia=="function"&&matchMedia("(prefers-reduced-motion)").matches,Qe;function $e(tt,lt,ft){for(var ut=C(tt,"particleCount",N),qt=C(tt,"angle",Number),It=C(tt,"spread",Number),nn=C(tt,"startVelocity",Number),jt=C(tt,"decay",Number),cn=C(tt,"gravity",Number),un=C(tt,"drift",Number),Ft=C(tt,"colors",R),Ke=C(tt,"ticks",Number),Bt=C(tt,"shapes"),$t=C(tt,"scalar"),qe=!!C(tt,"flat"),Ye=U(tt),ht=ut,Zt=[],zt=ee.width*Ye.x,Et=ee.height*Ye.y;ht--;)Zt.push(J({x:zt,y:Et,angle:qt,spread:It,startVelocity:nn,color:Ft[ht%Ft.length],shape:Bt[P(0,Bt.length)],ticks:Ke,decay:jt,gravity:cn,drift:un,scalar:$t,flat:qe}));return Qe?Qe.addFettis(Zt):(Qe=re(ee,Zt,je,lt,ft),Qe.promise)}function it(tt){var lt=ge||C(tt,"disableForReducedMotion",Boolean),ft=C(tt,"zIndex",Number);if(lt&&Le)return u(function(nn){nn()});fe&&Qe?ee=Qe.canvas:fe&&!ee&&(ee=Q(ft),document.body.appendChild(ee)),Ne&&!Ie&&je(ee);var ut={width:ee.width,height:ee.height};ve&&!Ie&&ve.init(ee),Ie=!0,ve&&(ee.__confetti_initialized=!0);function qt(){if(ve){var nn={getBoundingClientRect:function(){if(!fe)return ee.getBoundingClientRect()}};je(nn),ve.postMessage({resize:{width:nn.width,height:nn.height}});return}ut.width=ut.height=null}function It(){Qe=null,Ne&&(he=!1,t.removeEventListener("resize",qt)),fe&&ee&&(document.body.contains(ee)&&document.body.removeChild(ee),ee=null,Ie=!1)}return Ne&&!he&&(he=!0,t.addEventListener("resize",qt,!1)),ve?ve.fire(tt,ut,It):$e(tt,ut,It)}return it.reset=function(){ve&&ve.reset(),Qe&&Qe.reset()},it}var Y;function ie(){return Y||(Y=pe(null,{useWorker:!0,resize:!0})),Y}function oe(ee,ae,fe,Ne,he,ge,ye){var ve=new Path2D(ee),je=new Path2D;je.addPath(ve,new DOMMatrix(ae));var Ie=new Path2D;return Ie.addPath(je,new DOMMatrix([Math.cos(ye)*he,Math.sin(ye)*he,-Math.sin(ye)*ge,Math.cos(ye)*ge,fe,Ne])),Ie}function G(ee){if(!o)throw new Error("path confetti are not supported in this browser");var ae,fe;typeof ee=="string"?ae=ee:(ae=ee.path,fe=ee.matrix);var Ne=new Path2D(ae),he=document.createElement("canvas"),ge=he.getContext("2d");if(!fe){for(var ye=1e3,ve=ye,je=ye,Ie=0,Le=0,Qe,$e,it=0;it<ye;it+=2)for(var tt=0;tt<ye;tt+=2)ge.isPointInPath(Ne,it,tt,"nonzero")&&(ve=Math.min(ve,it),je=Math.min(je,tt),Ie=Math.max(Ie,it),Le=Math.max(Le,tt));Qe=Ie-ve,$e=Le-je;var lt=10,ft=Math.min(lt/Qe,lt/$e);fe=[ft,0,0,ft,-Math.round(Qe/2+ve)*ft,-Math.round($e/2+je)*ft]}return{type:"path",path:ae,matrix:fe}}function V(ee){var ae,fe=1,Ne="#000000",he='"Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji", "EmojiOne Color", "Android Emoji", "Twemoji Mozilla", "system emoji", sans-serif';typeof ee=="string"?ae=ee:(ae=ee.text,fe="scalar"in ee?ee.scalar:fe,he="fontFamily"in ee?ee.fontFamily:he,Ne="color"in ee?ee.color:Ne);var ge=10*fe,ye=""+ge+"px "+he,ve=new OffscreenCanvas(ge,ge),je=ve.getContext("2d");je.font=ye;var Ie=je.measureText(ae),Le=Math.ceil(Ie.actualBoundingBoxRight+Ie.actualBoundingBoxLeft),Qe=Math.ceil(Ie.actualBoundingBoxAscent+Ie.actualBoundingBoxDescent),$e=2,it=Ie.actualBoundingBoxLeft+$e,tt=Ie.actualBoundingBoxAscent+$e;Le+=$e+$e,Qe+=$e+$e,ve=new OffscreenCanvas(Le,Qe),je=ve.getContext("2d"),je.font=ye,je.fillStyle=Ne,je.fillText(ae,it,tt);var lt=1/fe;return{type:"bitmap",bitmap:ve.transferToImageBitmap(),matrix:[lt,0,0,lt,-Le*lt/2,-Qe*lt/2]}}n.exports=function(){return ie().apply(this,arguments)},n.exports.reset=function(){ie().reset()},n.exports.create=pe,n.exports.shapeFromPath=G,n.exports.shapeFromText=V})(function(){return typeof window<"u"?window:typeof self<"u"?self:this||{}}(),Wue,!1);const Lbn=Wue.exports;Wue.exports.create;const Dbn=200,Bbn={origin:{y:.7}};function ij(e,t){Lbn({...Bbn,...t,particleCount:Math.floor(Dbn*e)})}function $bn(){ij(.25,{spread:26,startVelocity:55}),ij(.2,{spread:60}),ij(.35,{spread:100,decay:.91,scalar:.8}),ij(.1,{spread:120,startVelocity:25,decay:.92,scalar:1.2}),ij(.1,{spread:120,startVelocity:45})}function Ubn({result:e,period:t,onBack:n}){const[r,s]=m.useState(!1),[a,o]=m.useState(!1),[l,c]=m.useState({}),u="#00FF91",d="#252525",f=`PnL (${t})`,x=he=>{navigator.clipboard.writeText(he),rn.success("Successfully copied.",{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(103, 255, 189, 0.16)",width:"280px",minWidth:"280px",height:"40px",backdropFilter:"blur(16px)"},iconTheme:{primary:"#67FFBD",secondary:"#276047"}})},g=he=>he>=1e9?`${(he/1e9).toFixed(0)}B`:he>=1e6?`${(he/1e6).toFixed(0)}M`:he>=1e3?`${(he/1e3).toFixed(0)}K`:he.toFixed(0),{main:v,steps:w}=e,C=Object.values(e.steps).flat().map(he=>({...he,timestamp:new Date(he.timestamp).getTime()})).sort((he,ge)=>he.timestamp-ge.timestamp),N={};C.forEach(he=>{N[he.timestamp]=(N[he.timestamp]||0)+he.pnl_this_step});let P=e.main.initial_equity;const I=Object.entries(N).sort((he,ge)=>he[0]-ge[0]).map(([he,ge])=>(P+=ge,[Number(he),+P.toFixed(2)])),R=I.map(([,he])=>he);let F=R[0],U=0;R.forEach(he=>{he>F&&(F=he);const ge=(F-he)/F;ge>U&&(U=ge)});const L=(U*100).toFixed(2),z=C.filter(he=>he.pnl_this_step>0).length,Q=C.filter(he=>he.pnl_this_step<0).length,ne=`${(z/C.length*100).toFixed(2)}%`,J=I.slice(1).map(([,he],ge)=>{const ye=I[ge][1];return(he-ye)/ye}),X=he=>he.length?he.reduce((ge,ye)=>ge+ye,0)/he.length:0,re=he=>{const ge=X(he),ye=X(he.map(ve=>(ve-ge)**2));return Math.sqrt(ye)},pe=(re(J)?X(J)/re(J):0).toFixed(2),Y=((v.my_total_equity/v.initial_equity-1)*100).toFixed(2),ie={},oe=he=>{var ge;return{time:new Date(he.timestamp).toLocaleTimeString(),pnl:he.pnl_this_step,coin:he.coin,activity:{direction:((ge=he.trader_direction)==null?void 0:ge.toLowerCase())==="long"?"Long":"Short",leverage:he.trader_leverage},size:he.trader_szi,posValue:he.our_target_value,entry:he.our_pos_entry_price,close:he.market_price}};C.forEach(he=>{const ge=new Date(he.timestamp).toLocaleDateString();ie[ge]=ie[ge]||{rows:[],totalPnl:0},ie[ge].rows.push(oe(he)),ie[ge].totalPnl+=he.pnl_this_step});const G=Object.entries(ie).sort((he,ge)=>new Date(he[0])-new Date(ge[0]));let V=v.initial_equity;const ee=G.map(([he,{rows:ge,totalPnl:ye}])=>(V+=ye,{date:he,rows:ge,totalPnl:ye,equity:V}));m.useEffect(()=>{var he;if(((he=e==null?void 0:e.main)==null?void 0:he.final_pnl)>0){$bn(),o(!0);const ge=setTimeout(()=>o(!1),3e3);return()=>clearTimeout(ge)}},[e]);const ae={chart:{type:"area",toolbar:{show:!1},background:"transparent",animations:{enabled:!1}},stroke:{width:2,curve:"straight",colors:[u]},fill:{type:"gradient",gradient:{shade:"dark",shadeIntensity:1,opacityFrom:.45,opacityTo:0,stops:[0,100],colorStops:[{offset:0,color:u,opacity:.45},{offset:100,color:u,opacity:0}]}},grid:{show:!0,borderColor:d,strokeDashArray:6,xaxis:{lines:{show:!0}},yaxis:{lines:{show:!0}}},xaxis:{type:"datetime",labels:{style:{colors:"#9B9B9B",fontSize:"12px",fontFamily:"Manrope",fontWeight:500},datetimeUTC:!1,format:"dd/MM"}},yaxis:{labels:{style:{colors:"#9B9B9B",fontSize:"12px",fontFamily:"Manrope",fontWeight:500},formatter:he=>g(he)}},dataLabels:{enabled:!1},tooltip:{theme:"dark",x:{format:"dd/MM HH:mm"},y:{formatter:he=>`$${he.toFixed(2)}`},marker:{fillColors:[u]}},zoom:{enabled:!1},markers:{size:0,colors:[u]}},fe=[{key:"time",label:"Time",width:"0.7fr"},{key:"pnl",label:"PnL",width:"0.7fr",headerClassName:"flex justify-end",render:he=>i.jsxs("span",{className:`flex justify-end ${he<0?"text-[#FF797C]":"text-[#67FFBD]"}`,children:[he<0?"- $":"$",Math.abs(he).toFixed(2)]})},{key:"coin",label:"Symbol",sortable:!0,width:"0.7fr",render:(he,ge)=>i.jsxs("div",{className:"flex items-center gap-2 text-[12px]",children:[i.jsx("img",{src:`https://app.hyperliquid.xyz/coins/${ge.coin}.svg`,onError:ra,className:"w-5 h-5"}),ge.coin]})},{key:"activity",label:"Direction",width:"1.3fr",render:(he,ge)=>{const ye=ge.activity.direction==="Long";return i.jsxs("div",{className:`inline-flex justify-center items-center gap-1 px-2 py-1 h-6 rounded-[6px] w-[115px] text-[11px] uppercase font-semibold ${ye?"text-[#67ffbd] bg-[rgba(103,255,189,0.16)]":"text-[#ff787b] bg-[rgba(255,131,117,0.16)]"}`,children:[i.jsx(Ps,{className:`w-3 h-3 ${ye?"rotate-180 text-[#67ffbd]":"text-[#ff787b]"}`}),`${ge.activity.direction} - ${ge.activity.leverage}x`]})}},{key:"size",label:"Size",width:"0.8fr"},{key:"posValue",label:"Position Value",width:"1fr",render:he=>`$${he.toFixed(2)}`},{key:"entry",label:"Entry Price",width:"0.9fr",render:he=>`$${he.toLocaleString()}`},{key:"close",label:"Close Price",width:"0.9fr",render:he=>`$${he.toLocaleString()}`}],Ne=Object.values(l).some(Boolean);return i.jsxs(i.Fragment,{children:[a&&i.jsx("div",{className:"fixed inset-0 top-24 flex items-start justify-center z-50 pointer-events-none font-manrope",children:i.jsx("div",{className:"text-4xl font-bold text-white px-6 py-4 rounded-xl animate-pulse",children:"🎉 You are the winner! 🥳"})}),i.jsxs(up,{isOpen:r,onClose:()=>s(!1),children:[i.jsx("h2",{className:"text-white text-lg mb-4",children:"Perp Equity Chart"}),i.jsx(VL,{options:{...ae,chart:{...ae.chart,sparkline:{enabled:!1}}},series:[{name:"Equity",data:I}],type:"area",height:320,width:"100%"})]}),i.jsxs("div",{className:["animate-slide-in text-white font-inter p-4 sm:p-6 mx-auto","rounded-[24px] border border-[#343434] backdrop-blur-[64px]","mt-0 sm:mt-20 transition-[max-width] duration-300",Ne?"max-w-96 sm:max-w-5xl":"max-w-96 sm:max-w-xl"].join(" "),children:[i.jsxs("div",{className:"flex items-center justify-between mb-[19px]",children:[i.jsx("div",{className:"flex items-center gap-1",children:i.jsx("span",{className:"text-[18px] font-semibold",children:"My Backtest Results"})}),i.jsxs("div",{className:"flex gap-2",children:[i.jsx("button",{className:"px-6 py-3 text-[#0B331C] text-[13px] font-semibold rounded-[10px] bg-[#1DE674] h-[32px] flex justify-center items-center",onClick:n,children:"New Backtest"}),i.jsx("button",{className:"px-6 py-3 text-[#67FFBD] text-[13px] font-semibold rounded-[10px] bg-[rgba(103,255,189,0.16)] h-[32px] flex items-center gap-2",onClick:()=>x(window.location.href),children:"Share"})]})]}),i.jsx("div",{className:"grid grid-cols-4 gap-4",children:[["Initial Perp Equity",v.initial_equity,"white"],["Final Perp Equity",v.my_total_equity,v.my_total_equity<v.initial_equity?"#FF797C":"#67FFBD"],[f,v.final_pnl,v.final_pnl<0?"#FF797C":"#67FFBD"],["Max Drawdown",`${L}%`,"#FF797C"],["Win Rate",ne,"white"],["Win / Loss",i.jsxs("div",{className:"flex gap-0 sm:gap-1",children:[i.jsxs("span",{className:"flex gap-1 items-center",children:[i.jsx("span",{className:"text-[#67FFBD]",children:"●"}),z]})," ",i.jsxs("span",{className:"flex gap-1 items-center",children:[i.jsx("span",{className:"text-[#FF797C]",children:"●"}),Q]})]}),"white"],["Growth Rate",`${Y}%`,Y<0?"#FF797C":"#67FFBD"],["Sharpe",pe,"white"]].map(([he,ge,ye])=>i.jsxs("div",{children:[i.jsx("div",{className:"text-[#8E8E8E] text-[14px] pb-1",children:he}),i.jsx("div",{style:{color:ye},className:"text-[14px] font-semibold whitespace-nowrap",children:typeof ge=="number"?`$${ge.toFixed(2)}`:ge})]},he))}),i.jsxs("div",{className:"bg-[#1B1B1B] rounded-xl mt-4 mb-4",children:[i.jsxs("div",{className:"flex px-3 pt-3 justify-between items-center text-[#8E8E8E] text-[14px] mb-2",children:["Perp Equity Chart",i.jsx("img",{src:Lyt,alt:"expand",className:"cursor-pointer",onClick:()=>s(!0)})]}),i.jsx(VL,{options:ae,series:[{name:"Equity",data:I}],type:"area",height:150,width:"100%"})]}),i.jsx("div",{className:"bg-[#1B1B1B] rounded-xl divide-y divide-[#2A2A2A] max-h-[320px] overflow-y-auto overflow-x-hidden",children:ee.map(({date:he,rows:ge,totalPnl:ye,equity:ve})=>{const je=ye>=0,Ie=l[he];return i.jsxs("div",{children:[i.jsxs("button",{className:"w-full grid grid-cols-3 items-center px-4 py-[10px] text-[13px] font-semibold bg-transparent",onClick:()=>c(Le=>({...Le,[he]:!Ie})),children:[i.jsx("span",{className:"text-left text-white",children:he}),i.jsxs("span",{className:"text-center text-white",children:["$",ve.toFixed(2)]}),i.jsxs("span",{className:`text-right ${je?"text-[#67FFBD]":"text-[#FF797C]"}`,children:[je?"+":"-","$",Math.abs(ye).toFixed(2)]})]}),Ie&&i.jsx("div",{className:"overflow-x-auto",children:i.jsx(Ru,{columns:fe,data:ge,listHeight:Math.min(ge.length*36,180),rowClassName:"border-t border-[#2A2A2A] text-white !text-[13px] font-inter",tableClassName:"min-w-[900px] bg-[#1B1B1B] rounded-xl overflow-hidden",theadClassName:"bg-[#1B1B1B] !text-[#9B9B9B] font-manrope !text-[13px] font-semibold",tbodyClassName:"divide-y divide-[#2A2A2A]",cellClassName:"px-4 py-[10px]",rowHeight:36})})]},he)})})]})]})}const zbn=e=>{const t=new URLSearchParams;return t.set("wallet",e.wallet),e.pairs.length&&t.set("pairs",e.pairs.join(",")),t.set("equity",e.equity),t.set("scale",e.scale),t.set("period",e.period),t.set("method",e.method),t.toString()},Hbn=()=>{const e=new URLSearchParams(window.location.search);return{wallet:e.get("wallet")||"",pairs:e.get("pairs")?e.get("pairs").split(","):[],equity:e.get("equity")||"",scale:e.get("scale")||"",period:e.get("period")||"30D",method:e.get("method")||"3"}};function Vbn(){const[e,t]=m.useState("starter"),[n,r]=m.useState(null),[s,a]=m.useState("30D"),o=m.useCallback(async l=>{t("loading");const c={"7D":7,"30D":30,"90D":90},u=l.pairs.length?{coin:{$in:l.pairs}}:{},d={period:c[l.period]||1,filters:{user_wallet:l.wallet,...u},method:Number(l.method),initial_equity:Number(l.equity),scaling_factor:Number(l.scale),steps:!0};try{const x=await(await fetch("https://dextradata.nftinit.io/api/hyper/backtest/fills",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(d)})).json();if(x.error_message){rn.error(x.error_message),t("starter");return}window.history.replaceState(null,"","?"+zbn(l)),a(l.period),r(x),t("result")}catch(f){console.error(f),t("starter"),rn.error("Backtest failed. Please try again.")}},[]);return m.useEffect(()=>{const l=Hbn();l.wallet&&o(l)},[o]),i.jsxs("div",{className:"flex items-start sm:items-center justify-center w-screen h-screen mt-4 sm:mt-0 mb-32 sm:mb-0",children:[e==="starter"&&i.jsx(Mbn,{onRun:o}),e==="loading"&&i.jsx(Rbn,{}),e==="result"&&i.jsx(Ubn,{result:n,period:s,onBack:()=>{window.history.replaceState(null,"",window.location.pathname),t("starter")}})]})}const Wbn=({tg:e})=>{const{address:t}=ns(),[n,r]=m.useState(!1);return m.useEffect(()=>{if(!e||isNaN(Number(e)))return;(async()=>{try{const a=window.localStorage.getItem("hyperToken"),o=window.localStorage.getItem("hyperAddress"),l=await fetch("https://dextrabothypev2.nftinit.io/api/telegram/sign_api_wallet_telegram/",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:t?t.toLowerCase():o,token:a,telegram_id:e})});if(!l.ok)throw new Error(`Request failed with status ${l.status}`);const c=await l.json();c!=null&&c.success&&r(!0)}catch(a){console.error("Error sending data:",a)}})()},[e]),i.jsxs(i.Fragment,{children:[i.jsx(f5,{open:n,setOpen:r,handleListRequest:()=>{},handlePageChange:()=>{}}),i.jsx("div",{className:"flex flex-col items-center justify-center px-6 sm:px-16 pb-10 gap-6 w-max h-max bg-[#212121]/90 rounded-2xl shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-[#2a2a2a] relative pt-10",children:i.jsxs("div",{className:"flex flex-col items-center text-white text-base font-medium font-['Inter'] text-center gap-4",children:[i.jsx("img",{src:Gi,alt:"",className:"w-8 h-8"}),i.jsx("div",{className:"text-center text-white text-base font-medium font-['Inter'] leading-4 tracking-[-0.28px]",children:"Dextrabot Wallet Setup"}),i.jsx("div",{className:"max-w-[240px] text-center text-white text-[13px] font-normal font-['Inter'] leading-4",children:"Add an account to start your copy trading journey on Telegram. Choose between creating an API Wallet or a Generate Wallet."}),i.jsxs("div",{className:"flex flex-col items-center gap-6 mt-[33px]",children:[i.jsxs("div",{onClick:()=>{r(!0)},className:"w-full h-10 px-6 py-3 bg-[#7445ff] rounded-xl shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-[#8860ff] flex justify-center items-center gap-1 cursor-pointer",children:[i.jsx("div",{"data-svg-wrapper":!0,children:i.jsxs("svg",{width:"19",height:"18",viewBox:"0 0 19 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("path",{d:"M5 9H14",stroke:"white",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),i.jsx("path",{d:"M9.5 13.5V4.5",stroke:"white",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})}),i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px] min-w-max -mb-[1px]",children:"Add Account"})]}),i.jsxs("div",{onClick:()=>window.open("https://t.me/Dextrabot_CopyTrade_bot","_blank"),className:"w-full h-10 px-6 py-3 bg-white hover:bg-[#E5E5E5] rounded-xl shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] inline-flex justify-center items-center gap-2.5 cursor-pointer",children:[i.jsx("img",{src:lke,alt:""}),i.jsx("div",{className:"justify-start text-black text-sm font-semibold font-['Inter'] leading-none min-w-max",children:"Open Telegram App"})]})]})]})})]})},qbn=()=>{const[e]=qNe(),t=e==null?void 0:e.get("tg"),{isConnected:n,address:r}=ns(),{hyperToken:s,hyperAddress:a,setSignModalOpen:o,setTelegramChatId:l,setSubscriberRole:c,setSubsExpireDay:u,setMushboomerETH:d,setMushboomerSOL:f,setIsReferralCode:x,setIsReferralCodeName:g,setIsWhitelist:v,setHyperToken:w,setHyperAddress:C}=m.useContext(Qr),[N,P]=m.useState(!!window.localStorage.getItem("hyperToken"));return m.useEffect(()=>{const I=window.localStorage.getItem("hyperToken");P(!!I)},[r,n,s,a]),m.useEffect(()=>{(async()=>{var U,L;const R=window.localStorage.getItem("hyperToken"),F=window.localStorage.getItem("hyperAddress");if(!(!R||!F))try{const z=await Ei(F.toLowerCase(),R);z!=null&&z.success?(l(z==null?void 0:z.telegram_chat_id),c(z==null?void 0:z.subscriber_role),u(z==null?void 0:z.subs_expire_day),d((U=z==null?void 0:z.mushboomer_counts)==null?void 0:U.eth),f((L=z==null?void 0:z.mushboomer_counts)==null?void 0:L.sol),x(z==null?void 0:z.referral_code),g(z==null?void 0:z.refcode),v(z==null?void 0:z.whitelist)):(window.localStorage.removeItem("hyperToken"),window.localStorage.removeItem("hyperAddress"),w(""),C(""))}catch(z){console.error("Token verification error:",z),console.error(z.message||"An unknown error occurred.")}})()},[]),i.jsxs(i.Fragment,{children:[i.jsx(So,{children:i.jsxs(Ro,{children:[i.jsx("title",{children:"Dextrabot Telegram Wallet Setup – Create API or Generated Wallet"}),i.jsx("meta",{name:"description",content:"Easily set up your Telegram copy trading wallet on Dextrabot. Create an API Wallet with your own account or generate a new wallet instantly, then connect to Telegram to start trading."}),i.jsx("meta",{name:"og:title",content:"Dextrabot Telegram Wallet Setup – Create API or Generated Wallet"}),i.jsx("meta",{name:"og:description",content:"Easily set up your Telegram copy trading wallet on Dextrabot. Create an API Wallet with your own account or generate a new wallet instantly, then connect to Telegram to start trading."}),i.jsx("meta",{name:"og:image",content:"https://app.dextrabot.com/dextrabotIcon.png"}),i.jsx("meta",{name:"og:url",content:"https://app.dextrabot.com/telegram-api-wallet"})]})}),i.jsx("div",{style:{background:"linear-gradient(135deg, #0d0d0d 0%, #1c1c1c 50%, #0d0d0d 100%)"},className:"flex justify-center items-center w-full h-[calc(100vh-6rem)] sm:h-[calc(100vh-5rem)] min-h-max max-h-[calc(100vh-6rem)] sm:max-h-[calc(100vh-5rem)] px-4 pt-16 sm:pt-4 pb-10 bg-[#161616]",children:N?i.jsx(Wbn,{tg:t}):i.jsx("div",{className:"flex justify-center items-center w-full",children:i.jsx(fU,{})})})]})},hNe="/assets/share1-C-zw_JWP.jpg",Gbn="/assets/share2-DdEku457.jpg",Kbn="/assets/share3-CNxpeTYT.jpg",Ybn="/assets/share4-DJuI_ZiE.jpg",Xbn="/assets/share5-T6uiFcTh.jpg",Qbn="/assets/share6-DjS5fdAF.jpg",Zbn="/assets/share7-BaMtg3x6.jpg",Jbn="/assets/share8-xyCgNFII.jpg",eyn="/assets/share9-BLclkV1L.jpg",tyn="/assets/share10-C9sVwYdl.jpg",nyn="/assets/share11-_FKzaoRV.jpg",ryn="/assets/share12-DHiXk6_m.jpg",syn="/assets/share13-0mVBxTxA.jpg",iyn="/assets/share14-B6N7agx8.jpg",ayn="/assets/share15-D46qu5xc.jpg",oyn="/assets/share16-B06pZYlo.jpg",lyn="/assets/share17-C9ObNWuI.jpg",cyn="/assets/share18-DafUfIIP.jpg",uyn="/assets/share19-DdeHQJDd.jpg",dyn="/assets/share20-Cx0LCWyZ.jpg",fyn="/assets/lighter-banner-B9jyiBZ3.png",hyn="#67FFBD",pyn="https://dextrabothypev2.nftinit.io/api/hyper/fee_calculator_save/";function myn({initialWalletAddress:e}){const t=Vo(),[n,r]=m.useState(e||""),[s,a]=m.useState(!1),[o,l]=m.useState(null),[c,u]=m.useState(null),[d,f]=m.useState(e||""),[x,g]=m.useState(!1),[v,w]=m.useState(0),[C,N]=m.useState(!1),[P,I]=m.useState(hNe),[R,F]=m.useState(""),[U,L]=m.useState(""),z=m.useRef(!1),Q=m.useRef(null),ne=m.useRef(null),J=m.useRef(0),X=[hNe,Gbn,Kbn,Ybn,Xbn,Qbn,Zbn,Jbn,eyn,tyn,nyn,ryn,syn,iyn,ayn,oyn,lyn,cyn,uyn,dyn];m.useEffect(()=>{const Le=document.querySelector("main");Le&&(Le.style.background="#0b0b0b"),F(`${window.location.origin}${window.location.pathname}`);const Qe=decodeURIComponent((window.location.hash||"").replace(/^#/,"")),$e=window.location.pathname.split("/").filter(Boolean),it=$e[$e.length-1]||"",lt=it&&it.toLowerCase()!=="hyperliquid-fee-calculator"?decodeURIComponent(it):"",ft=Qe||lt;if(ft){f(ft),r(ft);const ut=`${window.location.pathname}#${encodeURIComponent(ft)}`;window.history.replaceState(null,"",ut),L(`${window.location.origin}${ut}`),oe(ft)}return()=>{Le&&(Le.style.background="")}},[]),m.useEffect(()=>{e&&e.trim()&&oe(e)},[e]);const re=Le=>{const Qe=Number(Le||0);return Math.abs(Qe)>=1e6?`$${(Qe/1e6).toFixed(2)}M`:Math.abs(Qe)>=1e3?`$${(Qe/1e3).toFixed(2)}K`:`$${Qe.toFixed(2)}`},pe=Le=>`$${Number(Le||0).toFixed(2)}`,Y=()=>new Date().toLocaleDateString("en-US",{month:"short",day:"numeric"}),ie=async Le=>{if(z.current)return;z.current=!0;const Qe=window.localStorage.getItem("hyperAddress")||"",$e={wallet_address:n||null,calculator_logs:{total_fee_spent:pe(((Le==null?void 0:Le.totalFee)||0)+((Le==null?void 0:Le.totalBuilderFee)||0)),trading_fees:pe((Le==null?void 0:Le.totalFee)||0),builder_fees:pe((Le==null?void 0:Le.totalBuilderFee)||0),total_fills:Number((Le==null?void 0:Le.totalFills)||0),created_at:Y()}};Qe&&($e.address=Qe);try{await fetch(pyn,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify($e)})}catch{}},oe=async Le=>{if(!Le){rn.error("Please enter a wallet address");return}z.current=!1,a(!0),l(null),u(null),g(!1),w(0),N(!1),t(`/hyperliquid-fee-calculator/${Le}`,{replace:!0}),L(`${window.location.origin}/hyperliquid-fee-calculator/${Le}`);try{await uin(Le,Qe=>{Qe.totalFills>=2e3&&g(!0),u({...Qe,isPartial:!Qe.isComplete}),w(Math.min(Qe.requestCount/12*100,100)),Qe.isComplete&&(g(!1),w(100),a(!1),N(!0),ie(Qe),t(`/hyperliquid-fee-calculator/${Le}`,{replace:!0}))})}catch(Qe){l(Qe.message||"Failed to calculate fees"),rn.error("Failed to calculate fees"),g(!1),a(!1)}},G=Le=>{f(Le),Le.trim()&&r(Le.trim())},V=(()=>{const Le=((c==null?void 0:c.totalFee)||0)+((c==null?void 0:c.totalBuilderFee)||0);return`I paid ${re(Le)} in total fees on Hyperliquid.
Generate your own fee report and see potential savings with 0% builder fees.`})(),ee=async()=>{if(Q.current)try{await document.fonts.ready;const Le=await P1(Q.current,{cacheBust:!0,backgroundColor:"#0b0b0b",useCORS:!0,pixelRatio:2}),Qe=document.createElement("a");Qe.href=Le,Qe.download="dextrabot-fee-card.png",document.body.appendChild(Qe),Qe.click(),document.body.removeChild(Qe)}catch{rn.error("Failed to download PNG.")}},ae=U||R||"https://app.dextrabot.com/hyperliquid-fee-calculator",fe=`https://x.com/intent/post?text=${encodeURIComponent(V)}&url=${encodeURIComponent(ae)}`,[Ne,he]=m.useState({rx:0,ry:0,gx:50,gy:50}),ge=12,ye=Le=>{ne.current&&(cancelAnimationFrame(J.current),J.current=requestAnimationFrame(()=>{const Qe=ne.current.getBoundingClientRect(),$e=(Le.clientX-Qe.left)/Qe.width,it=(Le.clientY-Qe.top)/Qe.height,tt=($e-.5)*(ge*2),lt=(.5-it)*(ge*2);he({rx:Math.max(-12,Math.min(ge,lt)),ry:Math.max(-12,Math.min(ge,tt)),gx:$e*100,gy:it*100})}))},ve=()=>{cancelAnimationFrame(J.current),he({rx:0,ry:0,gx:50,gy:50})},je=s,Ie=!n.trim();return i.jsxs(So,{children:[i.jsxs(Ro,{children:[i.jsx("title",{children:"Hyperliquid Fee Spent Report — Dextrabot"}),i.jsx("meta",{name:"description",content:"Hyperliquid Fee Spent Report"})]}),i.jsxs("div",{className:"relative text-white overflow-hidden overscroll-none",style:{fontFamily:"Manrope, ui-sans-serif"},children:[i.jsx("div",{className:"pointer-events-none fixed inset-x-0 top-16 bottom-0 opacity-40 ",style:{background:"radial-gradient(800px 800px at 10% 0%, rgba(103,255,189,0.12) 0%, transparent 60%), radial-gradient(900px 900px at 90% 100%, rgba(103,255,189,0.08) 0%, transparent 55%)"}}),i.jsx("div",{className:"pointer-events-none fixed inset-x-0 top-16 bottom-0 opacity-[0.06] ",style:{background:"repeating-linear-gradient(0deg, #fff 0, #fff 1px, transparent 1px, transparent 3px)"}}),i.jsxs("div",{className:" mx-auto pt-4 pb-4 gap-4 flex justify-center ",children:[!C&&i.jsxs(vo.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},className:"relative overflow-hidden rounded-2xl border border-[#17211b] bg-[#0a0c0c]",children:[i.jsx("div",{className:"absolute inset-0 opacity-60",style:{background:"radial-gradient(1000px 300px at 0% 0%, rgba(103,255,189,0.22) 0%, transparent 60%)"}}),i.jsx("div",{className:"absolute -inset-[1px] rounded-2xl",style:{background:"linear-gradient(120deg, rgba(103,255,189,0.35), transparent 25% 75%, rgba(103,255,189,0.2))",filter:"blur(10px)",opacity:.35}}),i.jsxs("div",{className:"relative grid grid-cols-1 lg:grid-cols-2 gap-10 p-8",children:[i.jsxs("div",{children:[i.jsxs("div",{className:"inline-flex items-center gap-3 bg-[#0b1511] border border-[#1e2e27] rounded-xl px-3 py-2 shadow-[0_0_24px_rgba(103,255,189,0.12)]",children:[i.jsx("img",{src:_A,alt:"Dextrabot",className:"w-7 h-7 rounded-md"}),i.jsx("span",{className:"text-[#d7ffe9] font-semibold tracking-wide",children:"Hyperliquid Fee Spent Report"})]}),i.jsxs("h2",{className:"mt-4 text-[28px] leading-tight font-extrabold tracking-tight",children:["Calculate Your Hyperliquid Trading Fees",i.jsx("br",{}),i.jsx("span",{style:{color:hyn},children:"Fee Report Generator"})]}),i.jsx("p",{className:"mt-3 text-[#a6b6b0] max-w-xl",children:"Discover how much you've paid in Hyperliquid trading fees. Free calculator generates your complete fee report."}),i.jsxs("div",{className:"mt-6",children:[i.jsxs("div",{className:"relative",children:[i.jsx("div",{className:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none",children:i.jsx(Wan,{className:"h-5 w-5 text-[#88a296]"})}),i.jsx("input",{type:"text",value:d,onChange:Le=>G(Le.target.value),placeholder:"Paste wallet address…",className:"w-full pl-10 pr-12 py-3 rounded-xl bg-[#060808] border border-[#1c2a24] text-white placeholder-[#6e857d] focus:outline-none focus:border-[#67FFBD] focus:ring-1 focus:ring-[#67FFBD]"}),d?i.jsx("button",{onClick:()=>{f(""),r(""),window.history.replaceState(null,"",window.location.pathname),L("")},className:"absolute inset-y-0 right-2 flex justify-center items-center h-10 top-[5px]",children:i.jsx(tze,{className:"h-6 w-6 text-[#8ea79e] hover:text-white transition-colors"})}):null]}),i.jsxs(vo.button,{whileTap:{scale:.98},onClick:()=>oe(n),disabled:je||Ie,className:`mt-3 relative overflow-hidden rounded-xl font-semibold py-3 px-5 transition-colors shadow-[0_0_24px_rgba(103,255,189,0.24)] ${je?"bg-[rgba(103,255,189,0.95)] text-[#0b0b0b]":Ie?"bg-[#16211b] text-[#7ea391] cursor-not-allowed border border-[#1e2e27]":"bg[rgba(103,255,189,0.95)]"}`,style:!je&&!Ie?{backgroundColor:"rgba(103,255,189,0.95)",color:"#0b0b0b"}:void 0,children:[i.jsx(xT,{initial:!1,children:je&&i.jsx(vo.span,{initial:{width:0,opacity:0},animate:{width:`${v}%`,opacity:1},exit:{width:0,opacity:0},transition:{ease:"easeOut",duration:.3},className:"absolute top-0 left-0 h-full bg-[#2bb584]"})}),i.jsx("span",{className:"relative z-10",children:je?"Calculating…":"Generate Report"})]})]})]}),i.jsx("div",{className:"relative",children:i.jsxs("div",{className:"rounded-2xl border border-[#1e2e27] bg-[#050707] overflow-hidden shadow-[0_0_60px_rgba(103,255,189,0.15)]",children:[i.jsx("div",{className:"pointer-events-none absolute inset-0 opacity-[0.06] rounded-2xl overflow-hidden",style:{background:"repeating-linear-gradient(180deg, #fff 0, #fff 1px, transparent 1px, transparent 3px)"}}),i.jsx("video",{src:QN,autoPlay:!0,muted:!0,loop:!0,playsInline:!0,preload:"auto",className:"w-full h-[320px] lg:h-[380px] object-cover"},QN)]})})]})]}),C&&c&&i.jsx(vo.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},exit:{opacity:0,y:-12},children:i.jsxs("div",{className:"flex flex-col lg:flex-row items-start gap-4",children:[i.jsx("div",{className:"shrink-0",children:i.jsxs("button",{onClick:()=>{N(!1),t("/hyperliquid-fee-calculator",{replace:!0})},className:"inline-flex items-center gap-2 rounded-lg px-3 py-2 border border-[#23372e] bg-[#0c1210] hover:bg-[#0f1714] text-[#d7ffe9]",children:[i.jsx($an,{className:"w-5 h-5"}),"Back"]})}),i.jsxs("div",{className:"shrink-0",children:[i.jsx(xyn,{refCard:Q,refWrap:ne,tilt:Ne,onMove:ye,onLeave:ve,feeData:c,selectedImage:P}),i.jsxs("div",{className:"rounded-2xl border border-[#1e2e27] bg-[#0a0c0c] overflow-hidden shadow-[0_0_30px_rgba(103,255,189,0.12)] p-4 mt-3",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:"w-8 h-8 rounded-full grid place-items-center bg-[#67FFBD22] text-[#67FFBD]",children:i.jsx(I6t,{})}),i.jsxs("div",{className:"flex-1",children:[i.jsx("div",{className:"text-[15px] font-semibold",children:"Share"}),i.jsx("div",{className:"text-xs text-[#a6b6b0]",children:"Share your card on X and show off your stats!"})]}),i.jsx(QY,{className:"w-5 h-5 text-[#7a8c86]"})]}),i.jsx("div",{className:"mt-3 grid grid-cols-1 gap-2",children:i.jsx("a",{href:fe,target:"_blank",className:"h-10 grid place-items-center rounded-lg bg-white text-[#111] hover:bg-[#eaeaea] transition-colors text-sm font-medium",children:"Share on X"})})]})]}),i.jsxs("div",{className:"w-full lg:w[420px] space-y-3",style:{width:"100%",maxWidth:"420px"},children:[i.jsx("a",{href:"https://t.me/Dextrabot_CopyTrade_bot",target:"_blank",className:"block rounded-2xl border border-[#1e2e27] bg-[#0a0c0c] hover:border-[#67FFBD66] hover:bg-[#0d120f] transition-colors",children:i.jsxs("div",{className:"flex items-center gap-3 p-4",children:[i.jsx("div",{className:"w-9 h-9 rounded-full grid place-items-center bg-[#67FFBD22] font-bold text-[#67FFBD]",children:i.jsx(A6t,{})}),i.jsxs("div",{className:"flex-1",children:[i.jsx("div",{className:"text-[15px] font-semibold text-[#67FFBD]",children:"Zero Builder Fee on HL"}),i.jsx("div",{className:"text-xs text-[#a6b6b0]",children:"Trade with Zero Builder Fees on HL via Telegram."})]}),i.jsx(QY,{className:"w-5 h-5 text-[#7a8c86]"})]})}),i.jsx("div",{className:"rounded-2xl border border-[#1e2e27] bg-[#0a0c0c] overflow-hidden shadow-[0_0_30px_rgba(103,255,189,0.12)]",children:i.jsxs("div",{className:"p-4 pb-[18px]",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:"w-8 h-8 rounded-full grid place-items-center bg-[#67FFBD22] text-[#67FFBD]",children:i.jsx(_6t,{})}),i.jsxs("div",{className:"flex-1",children:[i.jsx("div",{className:"text-[15px] font-semibold",children:"Choose an Image"}),i.jsx("div",{className:"text-xs text-[#a6b6b0]",children:"Pick a meme background and download your card."})]}),i.jsx(QY,{className:"w-5 h-5 text-[#7a8c86]"})]}),i.jsxs("div",{className:"mt-8",children:[i.jsx("div",{className:"grid grid-cols-4 gap-2 pb-4",children:X.map((Le,Qe)=>i.jsx(vo.button,{whileHover:{y:-2},whileTap:{scale:.98},onClick:()=>I(Le),className:`rounded-md overflow-hidden border ${P===Le?"border-[#67FFBD]":"border-[#2b2b2b]"}`,children:i.jsx("img",{src:Le,alt:`bg-${Qe}`,className:"w-full h-16 object-cover"})},Qe))}),i.jsxs("div",{className:"grid grid-cols-1 gap-2",children:[i.jsx("button",{onClick:ee,className:"h-8 flex justify-center items-center rounded-lg border border-[#1e2e27] bg-[#0e1211] hover:border-[#67FFBD66] hover:bg-[#111716] transition-colors text-sm font-medium",children:"Download Image"}),i.jsx("button",{onClick:()=>window.open(`/wallet-details/${n}`,"_blank","noopener,noreferrer"),className:"h-8 flex justify-center items-center rounded-lg border border-[#1e2e27] bg-[#0e1211] hover:border-[#67FFBD66] hover:bg-[#111716] transition-colors text-sm font-medium",children:"Go to Wallet Details"})]})]})]})})]})]})}),C&&i.jsx("div",{className:"rounded-2xl border border-[#1e2e27] bg-[#0a0c0c] overflow-hidden shadow-[0_0_30px_rgba(103,255,189,0.12)]",children:i.jsx("img",{src:fyn,alt:"Lighter — Zero Fee",className:"h-full w-full cursor-pointer",loading:"eager",decoding:"async",draggable:!1,onClick:()=>{window.location.hash="lighter-farming"}})})]})]})]})}function xyn({refCard:e,refWrap:t,tilt:n,onMove:r,onLeave:s,feeData:a,selectedImage:o}){const l=((a==null?void 0:a.totalFee)||0)+((a==null?void 0:a.totalBuilderFee)||0),c=f=>{const x=Number(f||0);return Math.abs(x)>=1e6?`$${(x/1e6).toFixed(2)}M`:Math.abs(x)>=1e3?`$${(x/1e3).toFixed(2)}K`:`$${x.toFixed(2)}`},d=m.useRef(new Date).current.toLocaleDateString("en-US",{month:"short",day:"numeric"});return a!=null&&a.isPartial,i.jsx("div",{ref:t,onMouseMove:r,onMouseLeave:s,className:"relative",style:{perspective:"1200px"},children:i.jsxs("div",{ref:e,className:"relative will-change-transform rounded-2xl overflow-hidden bg-[#0a0d0c] shadow-[0_30px_80px_rgba(0,0,0,0.45),0_0_60px_rgba(103,255,189,0.16)] border border-[#1c2d26]",style:{width:"clamp(280px, 450px, 520px)",aspectRatio:"3/4",transform:`rotateX(${n.rx}deg) rotateY(${n.ry}deg)`,transition:"transform 180ms ease-out"},children:[i.jsx("div",{className:"absolute -inset-[1px] rounded-[30px] pointer-events-none",style:{background:"linear-gradient(130deg, rgba(103,255,189,0.35), transparent 25% 75%, rgba(103,255,189,0.2))",filter:"blur(10px)",opacity:.35}}),i.jsxs("div",{className:"h-14 px-5 flex items-center justify-between bg-[#1b2622] border-b border-[#253730]",children:[i.jsx("div",{className:"text-sm tracking-wide text-[#cfeee0] font-semibold",children:"Hyperliquid Fee Spent Report"}),i.jsxs("div",{className:"flex items-center gap-2 rounded-full border border-white/10 bg-black/60 backdrop-blur px-3 py-1.5",children:[i.jsx("img",{src:Gi,alt:"",className:"w-5 h-5"}),i.jsx("span",{className:"text-[12px] tracking-wide font-semibold",children:"DEXTRABOT"})]})]}),i.jsx("div",{className:"px-5 pt-4",children:i.jsxs("div",{className:"relative h-64 rounded-xl overflow-hidden border border-[#2a3c35]",children:[i.jsx("img",{src:o,alt:"","aria-hidden":"true",className:"absolute inset-0 w-full h-full object-cover blur-md scale-110"}),i.jsx("div",{className:"absolute inset-0 bg-black/25"}),i.jsx("img",{src:o,alt:"Dextrabot - Hyperliquid Fee Calculator",className:"relative z-10 w-full h-full object-contain select-none",loading:"eager",decoding:"async",draggable:!1,style:{imageRendering:"-webkit-optimize-contrast"}})]})}),i.jsx("div",{className:"px-5 pb-5 pt-4",children:i.jsxs("div",{className:"relative rounded-2xl border border-[#21342c] bg-gradient-to-b from-[#0d1211] to-[#0a0e0d] p-6",children:[i.jsx("div",{className:"pointer-events-none absolute inset-0 rounded-2xl",style:{boxShadow:"inset 0 0 0 1px rgba(103,255,189,0.08)"}}),i.jsxs("div",{className:"text-center",children:[i.jsx("div",{className:"text-[22px] leading-6 font-extrabold text-white/95",children:"TOTAL FEE SPENT"}),i.jsx("div",{className:"mt-2 font-extrabold leading-none",style:{color:"#67FFBD",fontSize:"clamp(32px, 4.4vw, 48px)"},children:c(l)})]}),i.jsxs("div",{className:"mt-5 grid grid-cols-2 gap-4",children:[i.jsxs("div",{className:"text-center",children:[i.jsx("div",{className:"text-xs tracking-wide text-white/70",children:"TRADING FEES"}),i.jsx("div",{className:"text-[20px] font-bold text-white",children:c((a==null?void 0:a.totalFee)||0)})]}),i.jsxs("div",{className:"text-center",children:[i.jsx("div",{className:"text-xs tracking-wide text-white/70",children:"BUILDER FEES"}),i.jsx("div",{className:"text-[20px] font-bold text-white",children:c((a==null?void 0:a.totalBuilderFee)||0)})]})]}),i.jsxs("div",{className:"mt-5 flex items-center justify-center gap-6 text-[11px] text-white/70 px-2",children:[i.jsxs("div",{className:"whitespace-nowrap",style:{fontStyle:"italic"},children:["Shows Last ",((a==null?void 0:a.totalFills)||0).toLocaleString()," Fills"]}),i.jsxs("div",{className:"flex items-center gap-1 text-white/60 whitespace-nowrap",children:[i.jsx("img",{src:Gi,alt:"",className:"w-3 h-3"}),"Generated by Dextrabot"]}),i.jsxs("div",{className:"whitespace-nowrap",children:["Created on ",d]})]})]})}),i.jsx("div",{className:"pointer-events-none absolute inset-0 rounded-[28px] opacity-60 mix-blend-screen",style:{background:`radial-gradient(220px 220px at ${n.gx}% ${n.gy}%, rgba(103,255,189,0.25), transparent 60%)`}})]})})}const pNe=()=>{const{walletAddress:e}=t5(),{setTelegramChatId:t,setSubscriberRole:n,setSubsExpireDay:r,setMushboomerETH:s,setIsWhitelist:a,setMushboomerSOL:o,setIsReferralCode:l,setIsReferralCodeName:c,setHyperToken:u,setHyperAddress:d}=m.useContext(Qr);return m.useEffect(()=>{(async()=>{var v,w;const x=window.localStorage.getItem("hyperToken"),g=window.localStorage.getItem("hyperAddress");if(!(!x||!g))try{const C=await Ei(g.toLowerCase(),x);C!=null&&C.success?(t(C==null?void 0:C.telegram_chat_id),n(C==null?void 0:C.subscriber_role),r(C==null?void 0:C.subs_expire_day),s((v=C==null?void 0:C.mushboomer_counts)==null?void 0:v.eth),o((w=C==null?void 0:C.mushboomer_counts)==null?void 0:w.sol),l(C==null?void 0:C.referral_code),c(C==null?void 0:C.refcode),a(C==null?void 0:C.whitelist)):(window.localStorage.removeItem("hyperToken"),window.localStorage.removeItem("hyperAddress"),u(""),d(""))}catch(C){console.error("Token verification error:",C)}})()},[]),i.jsxs(i.Fragment,{children:[i.jsx(So,{children:i.jsxs(Ro,{children:[i.jsx("title",{children:"Copy Trade on Hyperliquid | Mirror Top Traders with Dextrabot"}),i.jsx("meta",{name:"description",content:"Automatically copy trade top-performing Hyperliquid traders with customizable risk parameters. Set position sizing, stop-loss levels, and take-profit targets with Dextrabot's copy trade system."}),i.jsx("meta",{property:"og:title",content:"Copy Trade on Hyperliquid | Mirror Top Traders with Dextrabot"}),i.jsx("meta",{property:"og:description",content:"Automatically copy trade top-performing Hyperliquid traders with customizable risk parameters. Set position sizing, stop-loss levels, and take-profit targets with Dextrabot's copy trade system."}),i.jsx("meta",{property:"og:image",content:"https://app.dextrabot.com/dextrabotIcon.png"}),i.jsx("meta",{property:"og:url",content:"https://app.dextrabot.com/hyperliquid-fee-calculator "})]})}),i.jsx("div",{style:{minHeight:"calc(100vh - 5rem)"},className:"flex justify-center items-start w-full h-full px-4 pt-6 pb-6 sm:px-6 sm:pt-6 sm:pb-6 bg-[#161616] overflow-auto",children:i.jsx("div",{className:"flex flex-col items-stretch justify-start gap-[26px] w-full flex-grow xl:flex-grow-0",children:i.jsx(myn,{initialWalletAddress:e})})})]})};function gyn(e){return jl({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M1.72 5.47a.75.75 0 0 1 1.06 0L9 11.69l3.756-3.756a.75.75 0 0 1 .985-.066 12.698 12.698 0 0 1 4.575 6.832l.308 1.149 2.277-3.943a.75.75 0 1 1 1.299.75l-3.182 5.51a.75.75 0 0 1-1.025.275l-5.511-3.181a.75.75 0 0 1 .75-1.3l3.943 2.277-.308-1.149a11.194 11.194 0 0 0-3.528-5.617l-3.809 3.81a.75.75 0 0 1-1.06 0L1.72 6.53a.75.75 0 0 1 0-1.061Z",clipRule:"evenodd"},child:[]}]})(e)}function mNe(e){return jl({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M15.22 6.268a.75.75 0 0 1 .968-.431l5.942 2.28a.75.75 0 0 1 .431.97l-2.28 5.94a.75.75 0 1 1-1.4-.537l1.63-4.251-1.086.484a11.2 11.2 0 0 0-5.45 5.173.75.75 0 0 1-1.199.19L9 12.312l-6.22 6.22a.75.75 0 0 1-1.06-1.061l6.75-6.75a.75.75 0 0 1 1.06 0l3.606 3.606a12.695 12.695 0 0 1 5.68-4.974l1.086-.483-4.251-1.632a.75.75 0 0 1-.432-.97Z",clipRule:"evenodd"},child:[]}]})(e)}function xNe(e){return jl({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M15.97 2.47a.75.75 0 0 1 1.06 0l4.5 4.5a.75.75 0 0 1 0 1.06l-4.5 4.5a.75.75 0 1 1-1.06-1.06l3.22-3.22H7.5a.75.75 0 0 1 0-1.5h11.69l-3.22-3.22a.75.75 0 0 1 0-1.06Zm-7.94 9a.75.75 0 0 1 0 1.06l-3.22 3.22H16.5a.75.75 0 0 1 0 1.5H4.81l3.22 3.22a.75.75 0 1 1-1.06 1.06l-4.5-4.5a.75.75 0 0 1 0-1.06l4.5-4.5a.75.75 0 0 1 1.06 0Z",clipRule:"evenodd"},child:[]}]})(e)}function gNe(e){return jl({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M2.25 12c0-5.385 4.365-9.75 9.75-9.75s9.75 4.365 9.75 9.75-4.365 9.75-9.75 9.75S2.25 17.385 2.25 12Zm8.706-1.442c1.146-.573 2.437.463 2.126 1.706l-.709 2.836.042-.02a.75.75 0 0 1 .67 1.34l-.04.022c-1.147.573-2.438-.463-2.127-1.706l.71-2.836-.042.02a.75.75 0 1 1-.671-1.34l.041-.022ZM12 9a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5Z",clipRule:"evenodd"},child:[]}]})(e)}function byn(e){return jl({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{d:"M12 .75a8.25 8.25 0 0 0-4.135 15.39c.686.398 1.115 1.008 1.134 1.623a.75.75 0 0 0 .577.706c.352.083.71.148 1.074.195.323.041.6-.218.6-.544v-4.661a6.714 6.714 0 0 1-.937-.171.75.75 0 1 1 .374-1.453 5.261 5.261 0 0 0 2.626 0 .75.75 0 1 1 .374 1.452 6.712 6.712 0 0 1-.937.172v4.66c0 .327.277.586.6.545.364-.047.722-.112 1.074-.195a.75.75 0 0 0 .577-.706c.02-.615.448-1.225 1.134-1.623A8.25 8.25 0 0 0 12 .75Z"},child:[]},{tag:"path",attr:{fillRule:"evenodd",d:"M9.013 19.9a.75.75 0 0 1 .877-.597 11.319 11.319 0 0 0 4.22 0 .75.75 0 1 1 .28 1.473 12.819 12.819 0 0 1-4.78 0 .75.75 0 0 1-.597-.876ZM9.754 22.344a.75.75 0 0 1 .824-.668 13.682 13.682 0 0 0 2.844 0 .75.75 0 1 1 .156 1.492 15.156 15.156 0 0 1-3.156 0 .75.75 0 0 1-.668-.824Z",clipRule:"evenodd"},child:[]}]})(e)}function yyn({value:e,onChange:t,options:n=[{value:"extended",label:"Extended"}],activeTextColor:r="#1de674",chevronColor:s="#1de674"}){const[a,o]=m.useState(!1),l=m.useRef(null);m.useEffect(()=>{const u=f=>{l.current&&(l.current.contains(f.target)||o(!1))},d=f=>{f.key==="Escape"&&o(!1)};return document.addEventListener("pointerdown",u,!0),document.addEventListener("keydown",d),()=>{document.removeEventListener("pointerdown",u,!0),document.removeEventListener("keydown",d)}},[]);const c=m.useMemo(()=>n.find(u=>String(u.value)===String(e))||n[0]||null,[n,e]);return i.jsxs("div",{className:"relative",ref:l,children:[i.jsxs("div",{onClick:()=>o(u=>!u),className:"h-[32px] px-3 rounded-md flex justify-between items-center cursor-pointer",style:{background:Io,border:`1px solid ${Oa}`,color:Li},children:[i.jsx("span",{className:"truncate text-xs font-medium",style:{color:Li},children:(c==null?void 0:c.label)||"Select"}),i.jsx("span",{className:"ml-2 flex items-center",children:i.jsx("span",{className:"ml-2",children:"▾"})})]}),a&&i.jsx("div",{className:"absolute z-50 mt-1 w-full max-h-[240px] overflow-auto rounded-md p-1",style:{background:Io,border:`1px solid ${Oa}`},children:n.map(u=>{const d=String(u.value)===String(e);return i.jsx("div",{className:"px-3 py-2 rounded cursor-pointer text-xs font-medium",style:{background:d?"#26313b":"transparent",color:d?"#ffffff":Li},onClick:()=>{t==null||t(u.value),o(!1)},children:u.label},u.value)})})]})}const kb="#67FFBD",FO="#ff7073",pF="#60A5FA",bNe="#A78BFA",vyn="#F97316",wyn={KBONK:"BONK",KPEPE:"PEPE",KSHIB:"SHIB",KFLOKI:"FLOKI",KNEIRO:"NEIRO",KDOGS:"DOGS",KLUNC:"LUNC"},Cyn=new Set(["KBONK","KPEPE","KSHIB"]),Syn="https://app.hyperliquid.xyz/coins",yNe={SAFE:{icon:"✅",color:kb,label:"Safe",tooltip:"Order can be safely executed with sufficient collateral buffer"},WARNING:{icon:"⚠️",color:vyn,label:"Warning",tooltip:"Position is approaching liquidation risk, consider reducing leverage or adding collateral"},STOPPED:{icon:"🛑",color:FO,label:"Stopped",tooltip:"Stop loss will trigger before this DCA order executes"},LIQUIDATED:{icon:"💀",color:"#991B1B",label:"Liquidated",tooltip:"Position will be liquidated at this price level"},CANCELLED:{icon:"❌",color:"#6B7280",label:"Cancelled",tooltip:"Order will not execute - position was already closed"},EXCEEDED:{icon:"⛔",color:"#6B7280",label:"Exceeded",tooltip:"Price deviation exceeds 100% - reduce deviation multiplier or number of orders"}},Ih=({children:e,content:t})=>{const[n,r]=m.useState(!1),[s,a]=m.useState({x:0,y:0}),o=m.useRef(null),l=u=>{const d=u.currentTarget.getBoundingClientRect();a({x:d.left+d.width/2,y:d.top}),r(!0)},c=e==null||typeof e=="string"&&e.trim()==="?"?i.jsx("div",{className:"flex items-center has-tooltip relative",children:i.jsx(Ni,{className:"text-[#7C7C7C] w-3.5 min-w-3.5 min-h-3.5 h-3.5"})}):e;return i.jsxs("span",{className:"relative inline-flex",children:[i.jsx("span",{ref:o,onMouseEnter:l,onMouseLeave:()=>r(!1),className:"cursor-help transition-colors ml-1 inline-flex",children:c}),n&&i.jsxs("div",{className:"fixed z-50 px-3 py-2 text-xs bg-[#1a1a1a] border border-[#333] rounded-lg shadow-xl max-w-xs text-[#ccc] whitespace-normal",style:{left:s.x,top:s.y-8,transform:"translate(-50%, -100%)"},children:[t,i.jsx("div",{className:"absolute left-1/2 -translate-x-1/2 top-full w-0 h-0",style:{borderLeft:"6px solid transparent",borderRight:"6px solid transparent",borderTop:"6px solid #333"}})]})]})},ng=({label:e,value:t,onChange:n,min:r,max:s,step:a,suffix:o,tooltip:l,placeholder:c,helperText:u,validate:d,readOnly:f=!1,forceError:x=!1,forceErrorMessage:g=null})=>{const[v,w]=m.useState(!1),C=F=>{const U=parseFloat(F);return d?d(U,F):r!==void 0&&!isNaN(U)&&U<parseFloat(r)?`Minimum value is ${r}`:s!==void 0&&!isNaN(U)&&U>parseFloat(s)?`Maximum value is ${s}`:null},N=F=>{let U=F.target.value;const L=parseFloat(U);U!==""&&r!==void 0&&!Number.isNaN(L)&&!Number.isNaN(parseFloat(r))&&L<parseFloat(r)&&(U=String(parseFloat(r))),U!==""&&s!==void 0&&!Number.isNaN(L)&&!Number.isNaN(parseFloat(s))&&L>parseFloat(s)&&(U=String(parseFloat(s))),n(U)},P=()=>{w(!0)},I=C(t),R=x&&(g||I)?g||I:v&&I?I:null;return i.jsxs("div",{className:"space-y-1.5",children:[i.jsxs("label",{className:"text-xs text-[#9b9b9b] flex items-center",children:[e,l&&i.jsx(Ih,{content:l,children:"?"})]}),i.jsxs("div",{className:"relative",children:[i.jsx("input",{type:"number",value:t,onChange:N,onBlur:P,onWheel:F=>F.currentTarget.blur(),min:r,max:s,step:a,readOnly:f,placeholder:c,className:`w-full px-3 py-2 rounded-lg ${f?"bg-[#101010]":"bg-[#161616]"} border text-white text-sm focus:outline-none transition-colors ${R?"border-[#ff7073] focus:border-[#ff7073]":f?"border-[#1c2a24] focus:border-[#1c2a24] cursor-not-allowed":"border-[#1c2a24] focus:border-[#67FFBD]"}`}),o&&i.jsx("span",{className:"absolute right-3 top-1/2 -translate-y-1/2 text-[#6e857d] text-sm",children:o})]}),R&&i.jsx("p",{className:"text-[10px] text-[#ff7073] px-1",children:R}),u&&!R&&i.jsx("p",{className:"text-[10px] text-[#666] px-1",children:u})]})},Nyn=e=>{const t=String(e||"").toUpperCase();return Cyn.has(t)?`1000${t.slice(1)}`:t},jo=(e,t=2)=>{if(e==null||isNaN(e))return"-";const n=Math.abs(e);return n>=1e9?`${(e/1e9).toFixed(2)}B`:n>=1e6?`${(e/1e6).toFixed(2)}M`:n>=1e3?`${(e/1e3).toFixed(2)}K`:e.toFixed(t)},Cb=(e,t=!1)=>e==null||isNaN(e)?"-":e<=0?t?"Safe ✓":"N/A":e>=1e4?`$${e.toFixed(1)}`:e>=1e3?`$${e.toFixed(2)}`:e>=100?`$${e.toFixed(3)}`:e>=10?`$${e.toFixed(4)}`:`$${e.toFixed(5)}`,Ayn=e=>e==null||isNaN(e)?"-":`${e.toFixed(2)}%`,jyn=(e,t)=>{const n=Number(e),r=!Number.isFinite(n)||n<=0?2:n<1e-4?8:n<.01?6:n<1?5:n<10?4:2,s=Number(t);return Math.max(r,Number.isFinite(s)&&s>0?s:0)},Cc=e=>String(e||"").toUpperCase().replace(/-USD(T)?$/,"").replace(/\/USD(T)?$/,"").replace(/USD(T)?$/,""),Eyn=(e,t=[])=>{const n=Cc(e),r=t.find(s=>{var o;const a=Cc(s.symbol||s.rawSymbol||((o=s.raw)==null?void 0:o.symbol)||s.market||"");return a===n||a===`${n}USDT`||a===`${n}USD`||a===n.replace(/USD$/,"")});return r?r.market_index??r.marketIndex??r.market_id??r.marketId??r.id??null:null},_yn=(e,t=[])=>{const n=Cc(e);return t.find(r=>{var a;const s=Cc(r.symbol||r.rawSymbol||((a=r.raw)==null?void 0:a.symbol)||r.market||"");return s===n||s===`${n}USDT`||s===`${n}USD`||s===n.replace(/USD$/,"")})||null},kyn=({value:e,onChange:t,min:n=1,max:r=100,tooltip:s})=>{const a=(e-n)/(r-n)*100,o=l=>{const c=l.target.value;if(c===""){t("1");return}const u=parseInt(c);isNaN(u)||t(String(Math.min(r,Math.max(n,u))))};return i.jsxs("div",{className:"space-y-1.5",children:[i.jsxs("label",{className:"text-xs text-[#9b9b9b] flex items-center",children:["Leverage",s&&i.jsx(Ih,{content:s,children:"?"})]}),i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsxs("div",{className:"flex-1 relative",children:[i.jsx("div",{className:"h-1.5 bg-[#1c2a24] rounded-full overflow-hidden",children:i.jsx("div",{className:"h-full bg-[#67FFBD] rounded-full transition-all",style:{width:`${a}%`}})}),i.jsx("input",{type:"range",min:n,max:r,value:e,onChange:l=>t(l.target.value),className:"absolute inset-0 w-full h-full opacity-0 cursor-pointer"}),i.jsx("div",{className:"absolute top-1/2 -translate-y-1/2 w-3.5 h-3.5 bg-[#67FFBD] rounded-full border-2 border-[#101010] pointer-events-none transition-all",style:{left:`calc(${a}% - 7px)`}})]}),i.jsxs("div",{className:"flex items-center bg-[#161616] border border-[#1c2a24] rounded-lg overflow-hidden",children:[i.jsx("input",{type:"number",value:e,onChange:o,onWheel:l=>l.currentTarget.blur(),min:n,max:r,className:"w-12 px-2 py-1.5 bg-transparent text-white text-sm text-center focus:outline-none [appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none"}),i.jsx("span",{className:"pr-2 text-[#6e857d] text-sm",children:"x"})]})]})]})},vNe=({className:e="",entryPrice:t,onEntryPriceChange:n,maxBudget:r,onBudgetChange:s})=>i.jsxs("div",{className:`bg-[#0f0f0f] border border-[#2b3640] rounded-lg px-3 py-2 flex items-center gap-3 text-xs text-[#cfd4db] whitespace-nowrap overflow-x-auto ${e}`,children:[i.jsxs("div",{className:"flex items-center gap-2 text-white font-semibold",children:[i.jsx("span",{className:"inline-flex items-center justify-center w-5 h-5 rounded-full bg-[#1b2630] text-[#67FFBD]",children:"i"}),i.jsx("span",{children:"Preview Mode"})]}),i.jsxs("div",{className:"flex-1 flex justify-center items-center gap-4",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"text-[#cfd4db] text-xs",children:"Entry Price:"}),i.jsx("input",{type:"number",value:t,onChange:a=>n==null?void 0:n(a.target.value.replace(",",".")),step:"0.000001",inputMode:"decimal",className:"h-8 px-3 rounded-lg bg-[#161616] border border-[#1c2a24] text-white text-xs focus:outline-none focus:border-[#67FFBD] w-28",placeholder:"0.000000"})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"text-[#cfd4db] text-xs",children:"Budget:"}),i.jsx("input",{type:"number",value:r,onChange:a=>s==null?void 0:s(a.target.value.replace(",",".")),step:"1",inputMode:"decimal",className:"h-8 px-3 rounded-lg bg-[#161616] border border-[#1c2a24] text-white text-xs focus:outline-none focus:border-[#67FFBD] w-28",placeholder:"0"})]})]}),i.jsxs("div",{className:"flex items-center gap-2 text-[#facc15] ml-auto",children:[i.jsx("span",{children:"⚠️"}),i.jsx("span",{className:"text-[11px] text-[#cfd4db]",children:"Calculator only (preview)"})]})]});function Tyn(){var Xe;const e=jue(),t=e.length===0,n=Eue(),r=n.length===0,[s,a]=m.useState("extended"),[o,l]=m.useState([]),[c,u]=m.useState(50),[d,f]=m.useState({}),[x,g]=m.useState("extended"),[v,w]=m.useState("BTC"),[C,N]=m.useState(""),[P,I]=m.useState("long"),[R,F]=m.useState("10"),[U,L]=m.useState("5"),[z,Q]=m.useState("10"),[ne,J]=m.useState("10"),[X,re]=m.useState("1500"),[pe,Y]=m.useState(!1),[ie,oe]=m.useState("1"),[G,V]=m.useState(""),[ee,ae]=m.useState(!0),[fe,Ne]=m.useState("0.50"),[he,ge]=m.useState("1.1"),[ye,ve]=m.useState("1"),[je,Ie]=m.useState(!0),[Le,Qe]=m.useState(!0),[$e,it]=m.useState(!0),[tt,lt]=m.useState(!0),[ft,ut]=m.useState("details"),[qt,It]=m.useState([]),[nn,jt]=m.useState(!1),[cn,un]=m.useState([]),[Ft,Ke]=m.useState(!1),[Bt,$t]=m.useState(null),[qe,Ye]=m.useState(!1),[ht,Zt]=m.useState({}),[zt,Et]=m.useState({}),[nt,Ue]=m.useState(null),Rt=m.useRef(!1),We=m.useRef(!0),at=m.useRef(0),mt=s==="extended"?n:e,Dt=s==="extended"?r:t,Tt=s==="extended"?"extended_selected_wallet_id":"lighter_selected_wallet_id",dn=m.useMemo(()=>`dca_last_coin_${s}`,[s]),on=m.useMemo(()=>`dca_settings_${s}`,[s]),gn=m.useMemo(()=>({baseOrderMargin:"5",dcaOrderMargin:"10",maxDcaOrders:"10",tpTarget:"1",stopLoss:"",priceDeviation:"0.50",dcaSizeMultiplier:"1.1",priceDevMultiplier:"1"}),[]);m.useEffect(()=>{if(typeof window>"u")return;const Oe=window.localStorage.getItem(on),bt={...gn};if(Oe)try{const kt=JSON.parse(Oe)||{};Object.keys(gn).forEach(Ut=>{kt[Ut]!==void 0&&kt[Ut]!==null&&(bt[Ut]=String(kt[Ut]))})}catch{}L(bt.baseOrderMargin),Q(bt.dcaOrderMargin),J(bt.maxDcaOrders),oe(bt.tpTarget),V(bt.stopLoss),Ne(bt.priceDeviation),ge(bt.dcaSizeMultiplier),ve(bt.priceDevMultiplier)},[on,gn]),m.useEffect(()=>{if(typeof window>"u")return;const Oe={baseOrderMargin:U,dcaOrderMargin:z,maxDcaOrders:ne,tpTarget:ie,stopLoss:G,priceDeviation:fe,dcaSizeMultiplier:he,priceDevMultiplier:ye};try{window.localStorage.setItem(on,JSON.stringify(Oe))}catch{}},[on,U,z,ne,ie,G,fe,he,ye]);const Nn=m.useMemo(()=>{const Oe=new Map;return o.forEach(bt=>{const kt=Cc(bt.value||bt.label||bt.symbol||bt.coin);if(!kt)return;const Ut=bt.maxLeverage??bt.max_leverage??bt.leverage??null,fn=Number(Ut);Oe.set(kt,Number.isFinite(fn)?fn:null)}),Oe},[o]),kn=m.useMemo(()=>mt.map(Oe=>{var fn,On,Sn;const bt=Cc(Oe.symbol||Oe.rawSymbol||((fn=Oe.raw)==null?void 0:fn.symbol)||Oe.market||Oe.coin),kt=Oe.leverage??Oe.maxLeverage??Oe.max_leverage??(bt?Nn.get(bt):null),Ut=Number.isFinite(Number(kt))&&Number(kt)>0?Number(kt):null;return{...Oe,symbol:Oe.symbol||((On=Oe.raw)==null?void 0:On.symbol)||Oe.rawSymbol||Oe.market||"",rawSymbol:Oe.rawSymbol||((Sn=Oe.raw)==null?void 0:Sn.symbol)||Oe.symbol,leverage:Ut,maxLeverage:Oe.maxLeverage??Oe.max_leverage??Ut}}),[mt,Nn]),yn="https://dextrabothypev2.nftinit.io/api/hyper/dca_bot",{setSignModalOpen:Vn,hyperToken:Gn,hyperAddress:Dn}=m.useContext(Qr),[Kn,Cn]=m.useState({address:null,token:null}),sn=m.useCallback(()=>Kn,[Kn]),[Me,en]=m.useState(!1),an=Oe=>{if(!Oe)return null;const bt=String(Oe);return bt==="null"||bt==="undefined"?null:bt};m.useEffect(()=>{const Oe=()=>{if(typeof window>"u")return;const kt=an(Dn||window.localStorage.getItem("hyperAddress")),Ut=an(Gn||window.localStorage.getItem("hyperToken"));Cn({address:kt,token:Ut}),(!kt||!Ut)&&(en(!1),un([]),$t(null),at.current=0)};Oe(),window.addEventListener("localStorageUpdated",Oe),window.addEventListener("storage",Oe);const bt=setInterval(()=>{if(typeof window>"u")return;const kt=an(Dn||window.localStorage.getItem("hyperAddress")),Ut=an(Gn||window.localStorage.getItem("hyperToken"));Cn(fn=>fn.address===kt&&fn.token===Ut?fn:{address:kt,token:Ut}),(!kt||!Ut)&&(en(!1),un([]),$t(null),at.current=0)},1500);return()=>{window.removeEventListener("localStorageUpdated",Oe),window.removeEventListener("storage",Oe),clearInterval(bt)}},[Gn,Dn]),m.useEffect(()=>{const Oe=!!Kn.token,bt=!!Kn.address;en(Oe&&bt)},[Kn]),m.useEffect(()=>()=>{We.current=!1},[]);const Nt=m.useCallback(async()=>{if(Rt.current)return;const Oe=Kn.address,bt=Kn.token;if(!Oe||!bt){Rt.current=!1,Ke(!1);return}const kt=Date.now();if(!(kt-at.current<4500)){at.current=kt,Rt.current=!0,Ke(!0);try{let Ut=[];const On=await(await fetch("https://dextrabothypev2.nftinit.io/api/wallet/list-extended",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({address:Oe.toLowerCase(),token:bt,balance:"true"})})).json().catch(()=>null);if(!We.current||!On){Rt.current=!1,Ke(!1);return}let Sn=[];if(Array.isArray(On)?Sn=On:Array.isArray(On==null?void 0:On.data)&&(Sn=On.data),Ut=await Promise.all(Sn.map(async(Pn,En)=>{var rr,Rr,Jr;let $n=null;const Bn=Number(Pn.available_balance??Pn.availableForTrade??Pn.available_for_trade??Pn.balance??Pn.available??null);Number.isFinite(Bn)&&($n=Bn);const _r=Pn.wallet_id??Pn.id??En,sr=Pn.wallet_api_key||Pn.api_key||null;if(sr&&$n==null)try{const ws=`https://express-proxy-delta.vercel.app/proxy?url==${encodeURIComponent("https://api.starknet.extended.exchange/api/v1/user/balance")}`,et=await(await fetch(ws,{headers:{"X-Api-Key":sr}})).json().catch(()=>null),yt=((rr=et==null?void 0:et.data)==null?void 0:rr.availableForTrade)??(et==null?void 0:et.availableForTrade)??((Rr=et==null?void 0:et.data)==null?void 0:Rr.available_balance)??(et==null?void 0:et.available_balance)??((Jr=et==null?void 0:et.data)==null?void 0:Jr.available)??(et==null?void 0:et.available),Tn=Number(yt);Number.isFinite(Tn)&&Tn>=0&&($n=Tn)}catch{}return{wallet_id:_r,wallet_address:Pn.wallet_address||Pn.address||"",wallet_name:Pn.wallet_name||Pn.name||`Extended Wallet ${En+1}`,available_balance:$n,wallet_api_key:sr}})),!We.current)return;un(Ut),Ut.length>0?$t(Pn=>{const En=typeof window<"u"?window.localStorage.getItem(Tt):null,$n=(Pn==null?void 0:Pn.id)??En,Bn=$n&&Ut.find(_r=>String(_r.wallet_id)===String($n))||Ut[0];return Bn?{id:Bn.wallet_id,address:Bn.wallet_address,apiKey:Bn.wallet_api_key}:null}):$t(null)}catch(Ut){console.error("Error loading wallets:",Ut),We.current&&un([])}finally{Rt.current=!1,We.current&&Ke(!1)}}},[Kn.address,Kn.token,s,Tt]);m.useEffect(()=>{Me&&Nt()},[Me,Nt]),m.useEffect(()=>{Kn.address&&Kn.token?(en(!0),Nt()):(en(!1),un([]),$t(null),at.current=0)},[Kn.address,Kn.token,Nt]),m.useEffect(()=>{const Oe=()=>Nt();return window.addEventListener("localStorageUpdated",Oe),window.addEventListener("storage",Oe),()=>{window.removeEventListener("localStorageUpdated",Oe),window.removeEventListener("storage",Oe)}},[Nt]),m.useEffect(()=>{at.current=0,un([]),$t(null),Ue(null)},[s]),m.useEffect(()=>{Y(!1)},[Bt==null?void 0:Bt.id,s]);const Yn=m.useMemo(()=>{if(!Bt||!Bt.id)return null;const Oe=cn.find(kt=>String(kt.wallet_id)===String(Bt.id));if(!Oe)return null;if(s==="extended"&&Bt.apiKey){const kt=Number(nt==null?void 0:nt.availableForTrade);if(Number.isFinite(kt))return kt}const bt=Number(Oe.available_balance??Oe.availableForTrade??Oe.available_for_trade??Oe.balance??Oe.available??null);return Number.isFinite(bt)?bt:null},[cn,Bt,s,nt]),xn=m.useCallback(async()=>{const Oe=Kn.address,bt=Kn.token;if(!Oe||!bt){It([]);return}jt(!0);try{const Ut=await(await fetch(`${yn}/info/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({address:Oe.toLowerCase(),token:bt,source_market:s})})).json().catch(()=>null),On=(Array.isArray(Ut==null?void 0:Ut.data)?Ut.data:Ut!=null&&Ut.data?[Ut.data]:[]).filter(Sn=>Sn?s?String(Sn.source_market||"").toLowerCase()===String(s||"").toLowerCase()?!0:s==="hyper"&&!Sn.source_market:!0:!1);It(On)}catch(kt){console.error("Error loading bots:",kt),It([])}finally{jt(!1)}},[sn,yn,s]);m.useEffect(()=>{xn()},[xn,Kn.address,Kn.token,s]);const Mt=m.useCallback(async()=>{var kt,Ut;const{address:Oe,token:bt}=sn();if(!Oe||!bt||!Bt||!Bt.id){rn.error("Please connect your wallet and select a wallet.");return}Ye(!0);try{const fn=(kt=v==null?void 0:v.toUpperCase())==null?void 0:kt.trim(),On=Nyn(fn);let Sn=null;if(s==="lighter")try{const tr=await(await fetch("https://mainnet.zklighter.elliot.ai/api/v1/funding-rates")).json().catch(()=>null);if(tr!=null&&tr.funding_rates&&Array.isArray(tr.funding_rates)){const Ar=tr.funding_rates.find(Br=>String(Br.symbol||"").toUpperCase().trim()===fn);console.log("coinRate",Ar),Ar&&Ar.market_id!=null?(Sn=Ar.market_id,console.log(`✅ Found market_id ${Sn} for coin ${fn} from funding-rates API (exchange: ${Ar.exchange})`)):(console.warn(`❌ Coin ${fn} not found in funding-rates API`),console.log("Sample available symbols:",tr.funding_rates.slice(0,20).map(Br=>Br.symbol)))}else console.warn("No funding_rates array in API response")}catch(Tn){console.error("Error fetching funding-rates API:",Tn),Sn=d[fn]||null,Sn&&console.log(`Using cached market_id ${Sn} for coin ${fn}`)}if(Sn===null){if(s==="extended"&&(!mt||!mt.length)){rn.error("Extended markets are loading. Please try again in a moment."),Ye(!1);return}Sn=Eyn(v,mt)}if(Sn===null&&s!=="extended"){console.error("Market not found for coin:",fn),rn.error(`Unable to find market index for ${fn}. Please make sure the coin is available on ${s}.`),Ye(!1);return}Sn!=null&&console.log(`Using market_index: ${Sn} for coin: ${fn}`);const yr=cn.find(Tn=>String(Tn.wallet_id)===String(Bt.id));if(!yr||!yr.wallet_id){rn.error("Unable to find selected wallet. Please select a wallet again."),Ye(!1);return}const Pn=Math.max(1,Math.min(Number(c)||100,Number(R)||1)),En=_yn(v,mt),$n=String(v||"").toUpperCase(),Bn=Number((En==null?void 0:En.maxLeverage)??(En==null?void 0:En.leverage)??(En==null?void 0:En.max_leverage)??c??0),_r=s==="extended"&&Bn>0?Math.min(Bn,Pn||Bn):Pn,sr=parseFloat(ie)||0,rr=Number(C)||Number(En==null?void 0:En.markPrice)||Number(En==null?void 0:En.lastPrice)||Number(En==null?void 0:En.last)||null,Rr=Number(((Ut=En==null?void 0:En.tradingConfig)==null?void 0:Ut.minOrderSize)??(En==null?void 0:En.minOrderSize)),Jr=Number.isFinite(Rr)&&Rr>0&&Number.isFinite(rr)&&rr>0?Rr*rr:null;if(s==="extended"&&Jr!=null){const Tn=parseFloat(U)||0,tr=parseFloat(z)||0,Ar=Tn*_r,Br=tr*_r;if(Ar<Jr||Br<Jr){const Vr=[];Ar<Jr&&Vr.push("Base Order"),Br<Jr&&Vr.push("DCA Order");const dr=Vr.length===1?` (${Vr[0]})`:Vr.length===2?" (Base Order & DCA Order)":"";rn.error(`Minimum order size for ${$n} is $${Jr.toFixed(2)}${dr}. Increase order size or leverage.`),Ye(!1);return}}const ws={direction:P,leverage:_r,base_amount_usd:parseFloat(U)||0,safety_amount_usd:parseFloat(z)||0,max_safety_orders:parseInt(ne)||0,price_deviation:parseFloat(fe)||.5,step_scale:parseFloat(ye)||1,volume_scale:parseFloat(he)||1.5,tp_percent:sr,stop_loss_percent:G?parseFloat(G):0};s!=="extended"&&Sn!=null&&(ws.market_index=Number.isFinite(Number(Sn))?Number(Sn):Sn);const ls={address:Oe.toLowerCase(),token:bt,wallet_id:yr.wallet_id,source_market:s,bot_params:ws,coin:On};console.log("DCA Bot API Request:",JSON.stringify(ls,null,2));const yt=await(await fetch(`${yn}/save/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(ls)})).json().catch(()=>null);yt!=null&&yt.success?(rn.success("DCA Bot started successfully!"),await xn(),ut("bots")):rn.error((yt==null?void 0:yt.error_message)||"Failed to start bot. Please try again.")}catch(fn){console.error("Error starting bot:",fn),rn.error("Error starting bot. Please try again.")}finally{Ye(!1)}},[sn,Bt,s,v,mt,d,cn,P,R,U,z,ne,fe,he,ye,ie,G,xn,yn]);m.useCallback(async Oe=>{const{address:bt,token:kt}=sn();if(!bt||!kt||!Bt||!Bt.id){rn.error("Please connect your wallet and select a wallet.");return}const Ut=cn.find(fn=>String(fn.wallet_id)===String(Bt.id));if(!Ut||!Ut.wallet_id){rn.error("Unable to find selected wallet. Please select a wallet again.");return}Zt(fn=>({...fn,[Oe]:!0}));try{const On=await(await fetch(`${yn}/stop/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({address:bt.toLowerCase(),token:kt,wallet_id:Ut.wallet_id,source_market:s,coin:v})})).json().catch(()=>null);On!=null&&On.success?await xn():rn.error((On==null?void 0:On.error_message)||"Failed to stop bot. Please try again.")}catch(fn){console.error("Error stopping bot:",fn),rn.error("Error stopping bot. Please try again.")}finally{Zt(fn=>({...fn,[Oe]:!1}))}},[sn,Bt,s,v,cn,xn,yn]);const tn=m.useCallback(async(Oe,bt,kt={})=>{const{address:Ut,token:fn}=sn();if(!Ut||!fn){rn.error("Please connect your wallet.");return}Zt(On=>({...On,[Oe]:!0})),It(On=>On.map(Sn=>Sn.id===Oe||Sn.bot_id===Oe?{...Sn,is_deleted:bt,...kt}:Sn));try{const Sn=await(await fetch(`${yn}/update/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({address:Ut.toLowerCase(),token:fn,bot_id:Oe,update_params:{is_deleted:bt,...kt}})})).json().catch(()=>null);if(Sn!=null&&Sn.success)await xn(),bt&&rn.success("DCA Bot has been stopped.");else{await xn();const yr=(Sn==null?void 0:Sn.error_message)||(Sn==null?void 0:Sn.message)||(Sn==null?void 0:Sn.detail)||(Sn==null?void 0:Sn.error),Pn=bt?"Failed to stop bot. Please try again.":"Cannot start this bot. Another bot for this coin may already be active. Stop it first or choose a different coin.";rn.error(yr||Pn)}}catch(On){console.error("Error updating bot:",On),await xn(),rn.error(bt?"Failed to stop bot. Please try again.":"Cannot start this bot. Another bot for this coin may already be active. Stop it first or choose a different coin.")}finally{Zt(On=>({...On,[Oe]:!1}))}},[sn,xn,yn]);m.useCallback(async Oe=>{const{address:bt,token:kt}=sn();if(!bt||!kt){rn.error("Please connect your wallet.");return}if(confirm("Are you sure you want to delete this bot? This action cannot be undone.")){Et(Ut=>({...Ut,[Oe]:!0})),It(Ut=>Ut.filter(fn=>fn.id!==Oe&&fn.bot_id!==Oe));try{const Ut=await fetch(`${yn}/update/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({address:bt.toLowerCase(),token:kt,bot_id:Oe,update_params:{permanent_delete:!0,is_deleted:!0}})}),fn=await Ut.json().catch(()=>null);if(console.log("Delete bot response:",fn),console.log("Response status:",Ut.status),fn!=null&&fn.success)await xn();else{console.log("Trying delete endpoint as fallback...");const On=await fetch(`${yn}/delete/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({address:bt.toLowerCase(),token:kt,bot_id:Oe})}),Sn=await On.json().catch(()=>null);if(console.log("Delete endpoint response:",Sn),Sn!=null&&Sn.success)await xn();else{await xn();const yr=(Sn==null?void 0:Sn.error_message)||(fn==null?void 0:fn.error_message)||(Sn==null?void 0:Sn.message)||(fn==null?void 0:fn.message)||(Sn==null?void 0:Sn.detail)||(fn==null?void 0:fn.detail)||`Failed to delete bot. Status: ${On.status||Ut.status}`;console.error("Delete bot error:",yr,{data:fn,deleteData:Sn}),rn.error(yr)}}}catch(Ut){console.error("Error deleting bot:",Ut),await xn(),rn.error(`Error deleting bot: ${Ut.message||"Please try again."}`)}finally{Et(Ut=>({...Ut,[Oe]:!1}))}}},[sn,xn,yn]),m.useEffect(()=>{let Oe=!1;async function bt(){try{const Ut=await(await fetch("https://mainnet.zklighter.elliot.ai/api/v1/funding-rates")).json().catch(()=>null);if(Oe||!(Ut!=null&&Ut.funding_rates))return;const fn={};Ut.funding_rates.filter(On=>On.exchange==="lighter").forEach(On=>{if(On.symbol&&On.market_id!=null){const Sn=String(On.symbol).toUpperCase().trim();fn[Sn]=On.market_id}}),Oe||(f(fn),console.log(`✅ Loaded ${Object.keys(fn).length} market IDs from funding-rates API for lighter exchange`))}catch(kt){console.error("Error loading market IDs from funding-rates API:",kt),Oe||f({})}}return bt(),()=>{Oe=!0}},[]),m.useEffect(()=>{let Oe=!1;async function bt(){try{const Ut=await(await fetch("https://dextrabothypev2.nftinit.io/api/hyper/get_farming_coins/?app=lighter_fr")).json().catch(()=>null);if(Oe)return;let fn=[];Array.isArray(Ut)?fn=Ut:Array.isArray(Ut==null?void 0:Ut.data)?fn=Ut.data:Array.isArray(Ut==null?void 0:Ut.coins)&&(fn=Ut.coins);const On=fn.map(Sn=>({value:String(Sn.value||Sn.label||Sn.symbol||Sn.coin||"").toUpperCase(),label:Sn.label||Sn.value||Sn.symbol||Sn.coin,maxLeverage:Sn.maxLeverage||50}));Oe||l(On)}catch{Oe||l([])}}return bt(),()=>{Oe=!0}},[]),m.useEffect(()=>{var yr;if(!mt.length)return;const Oe=Cc(v);if(Oe?mt.some(Pn=>Cc(Pn.symbol)===Oe):!1)return;const kt=typeof window<"u"?window.localStorage.getItem(dn):null,Ut=Cc(kt),fn=kt&&Ut?mt.some(Pn=>Cc(Pn.symbol)===Ut):!1,On=mt[0],Sn=fn?Ut:Cc((On==null?void 0:On.symbol)||((yr=On==null?void 0:On.raw)==null?void 0:yr.symbol)||(On==null?void 0:On.rawSymbol));w(Sn||"BTC")},[mt,v,dn]);const In=m.useMemo(()=>{const Oe=Cc(v);return Oe&&(mt.find(bt=>Cc(bt.symbol)===Oe)||mt.find(bt=>{var kt;return Cc(((kt=bt.raw)==null?void 0:kt.symbol)||bt.rawSymbol)===Oe}))||null},[mt,v]),Xn=m.useMemo(()=>{const Oe=Cc(v);if(!Oe)return null;const bt=wyn[Oe]||Oe;return(In==null?void 0:In.kind)==="hip3"&&(In!=null&&In.builder)?`${In.builder}:${bt}`:bt},[v,In]),or=m.useMemo(()=>{const Oe=Cc(v);return Oe&&qt.find(bt=>{var Ut,fn;const kt=Cc(bt.coin||bt.symbol||((Ut=bt.bot_params)==null?void 0:Ut.coin)||((fn=bt.bot_params)==null?void 0:fn.symbol));return!bt.is_deleted&&kt===Oe})||null},[qt,v]),lr=m.useMemo(()=>{const Oe=qt.filter(kt=>!kt.is_deleted),bt=qt.filter(kt=>kt.is_deleted);return[...Oe,...bt]},[qt]),Qt=Number(C)||Number(In==null?void 0:In.markPrice)||Number(In==null?void 0:In.lastPrice)||Number(In==null?void 0:In.last)||null,zn=Number(((Xe=In==null?void 0:In.tradingConfig)==null?void 0:Xe.minOrderSize)??(In==null?void 0:In.minOrderSize)),Jn=s==="extended"&&Number.isFinite(zn)&&zn>0&&Number.isFinite(Qt)&&Qt>0?zn*Qt:null,Lt=Math.max(1,Number(R)||1),jn=parseFloat(U)||0,Ee=parseFloat(z)||0,h=jn*Lt,p=Ee*Lt,S=s==="extended"&&Jn!=null&&h<Jn,_=s==="extended"&&Jn!=null&&p<Jn,k=S||_,T=Oe=>{if(Jn==null||!Number.isFinite(Lt)||Lt<=0)return"Minimum order size not met";const bt=Jn/Lt,kt=Math.abs(Lt-Math.round(Lt))<1e-6?Math.round(Lt):Number(Lt.toFixed(2));return`${Oe} must be at least $${bt.toFixed(2)} (min. $${Jn.toFixed(2)} notional ÷ ${kt}x leverage)`};m.useEffect(()=>{const Oe=o.find(Ut=>Ut.value===v),bt=s==="extended"?(In==null?void 0:In.maxLeverage)??(In==null?void 0:In.leverage)??(In==null?void 0:In.max_leverage)??50:Oe==null?void 0:Oe.maxLeverage,kt=Number(bt);Number.isFinite(kt)&&kt>0&&(u(kt),F(Ut=>{const fn=parseInt(Ut)||1;return String(Math.min(kt,Math.max(1,fn)))}))},[v,o,In,s]),m.useEffect(()=>{if(s!=="extended"||!(Bt!=null&&Bt.apiKey)){Ue(null);return}let Oe=!1;const bt=async()=>{var Ut,fn,On,Sn;try{const yr=`https://express-proxy-delta.vercel.app/proxy?url=${encodeURIComponent("https://api.starknet.extended.exchange/api/v1/user/balance")}`,En=await(await fetch(yr,{headers:{"X-Api-Key":Bt.apiKey}})).json().catch(()=>null);if(Oe)return;const $n=((Ut=En==null?void 0:En.data)==null?void 0:Ut.availableForTrade)??(En==null?void 0:En.availableForTrade)??((fn=En==null?void 0:En.data)==null?void 0:fn.available_balance)??(En==null?void 0:En.available_balance)??((On=En==null?void 0:En.data)==null?void 0:On.available)??(En==null?void 0:En.available),Bn=Number($n),_r=((Sn=En==null?void 0:En.data)==null?void 0:Sn.equity)??(En==null?void 0:En.equity),sr=Number(_r);Ue({availableForTrade:Number.isFinite(Bn)&&Bn>=0?Bn:null,equity:Number.isFinite(sr)?sr:null,raw:En})}catch{Oe||Ue(null)}};bt();const kt=setInterval(bt,2e4);return()=>{Oe=!0,clearInterval(kt)}},[s,Bt==null?void 0:Bt.apiKey]),m.useEffect(()=>{if(s!=="extended")return;const Oe=nt==null?void 0:nt.equity;Number.isFinite(Oe)&&!pe&&re(String(Oe))},[nt==null?void 0:nt.equity,s,pe]);const B=m.useRef(v),q=m.useRef(!1);m.useEffect(()=>{const Oe=B.current!==v,bt=!q.current&&!C;if((Oe||bt)&&(In!=null&&In.last)&&In.last>0){B.current=v,q.current=!0;const kt=jyn(In.last,In.priceDecimals);N(Number(In.last).toFixed(kt))}},[v,In==null?void 0:In.last,C]);const te=m.useCallback(Oe=>{const bt=Cc(Oe);w(bt),typeof window<"u"&&window.localStorage.setItem(dn,bt)},[dn]),ue=m.useCallback(Oe=>{Y(!0),re(Oe)},[]),de=m.useCallback(Oe=>{N(Oe)},[]),xe=Dt,Se=P==="smart",ke=m.useCallback(Oe=>{const bt=parseFloat(R)||10,kt=.6/bt,Ut=parseFloat(C)||0,fn=parseFloat(U)||0,On=parseFloat(z)||0,Sn=parseInt(ne)||0,yr=parseFloat(X)||1/0,Pn=parseFloat(fe)||0,En=parseFloat(he)||1.1,$n=parseFloat(ye)||1,Bn=parseFloat(ie)||0,_r=parseFloat(G)||100,sr=Oe==="smart",rr=Oe==="long";if(sr)return{orders:[],metrics:null};if(Ut<=0||fn<=0)return{orders:[],metrics:null};let Rr=fn;for(let ln=1;ln<=Sn;ln++)Rr+=On*Math.pow(En,ln-1);const Jr=[];let ws=0,ls=0,et=0,yt=0,Tn=0,tr=0,Ar=!1,Br=null;const Vr=yr,dr=fn*bt,jr=dr/Ut;ws=fn,ls=dr,et=jr,ws>yr&&(Ar=!0,Br=0);const ps=rr?(Ut*et-Vr)/(et*(1-kt)):(Vr+Ut*et)/(et*(1+kt)),gr=rr?Ut*(1+Bn/100):Ut*(1-Bn/100);let es="SAFE";ps<=0||(rr&&ps>=Ut||!rr&&ps<=Ut)&&(es="LIQUIDATED"),Ar&&(es="WARNING",tr++);const Gs=jr*Ut*kt,Es=Vr/Gs,xr=rr?(gr-Ut)*jr:(Ut-gr)*jr;Jr.push({label:"Base",deviation:0,price:Ut,margin:fn,positionValue:dr,coins:jr,totalCoins:jr,totalMargin:ws,avgEntry:Ut,tpPrice:gr,tpProfit:xr,liqPrice:ps,healthRatio:Es,status:es});let Gt=!1,ce=ps,rt=Ut,Pt=gr;for(let ln=1;ln<=Sn;ln++){ln===1?yt=Pn:yt+=Pn*Math.pow($n,ln-1);const mn=rr?Ut*(1-yt/100):Ut*(1+yt/100);if(Gt){Jr.push({label:`DCA ${ln}`,deviation:yt,price:mn,margin:null,positionValue:null,coins:null,totalCoins:null,totalMargin:null,avgEntry:null,tpPrice:null,tpProfit:null,liqPrice:null,healthRatio:null,status:"CANCELLED"});continue}if(mn<=0){Gt=!0,Jr.push({label:`DCA ${ln}-${Sn}`,deviation:yt,price:null,margin:null,positionValue:null,coins:null,totalCoins:null,totalMargin:null,avgEntry:null,tpPrice:null,tpProfit:null,liqPrice:null,healthRatio:null,status:"EXCEEDED",exceededCount:Sn-ln+1,isLong:rr});break}const cr=On*Math.pow(En,ln-1),Nr=cr*bt,fr=Nr/mn,ur=ws+cr;ur>yr&&!Ar&&(Ar=!0,Br=ln),ws=ur,ls+=Nr,et+=fr;const Yr=ls/et,ss=rr?(Yr*et-Vr)/(et*(1-kt)):(Vr+Yr*et)/(et*(1+kt));if(rr?ss>0&&mn<=ss:ss>0&&mn>=ss){Gt=!0,Jr.push({label:"💀 Liq",deviation:null,price:ce,margin:null,positionValue:null,coins:null,totalCoins:null,totalMargin:null,avgEntry:rt,tpPrice:Pt,tpProfit:null,liqPrice:ce,healthRatio:null,status:"LIQUIDATED"});for(let Vt=ln;Vt<=Sn;Vt++){let er=0;for(let kr=1;kr<=Vt;kr++)kr===1?er=Pn:er+=Pn*Math.pow($n,kr-1);const Wn=rr?Ut*(1-er/100):Ut*(1+er/100),Fr=Wn>0;Jr.push({label:`DCA ${Vt}`,deviation:er,price:Fr?Wn:null,margin:null,positionValue:null,coins:null,totalCoins:null,totalMargin:null,avgEntry:null,tpPrice:null,tpProfit:null,liqPrice:null,healthRatio:null,status:Fr?"CANCELLED":"EXCEEDED"})}break}const mr=rr?ss>=Yr:ss<=Yr,Qn=rr?Yr*(1+Bn/100):Yr*(1-Bn/100),xs=_r>=100?null:rr?Yr*(1-_r/100):Yr*(1+_r/100),Xs=rr?(mn-Yr)*et:(Yr-mn)*et,ii=Vr+Xs,Pr=et*mn*kt,vn=ii/Pr;let Mn="SAFE";if(mr){Gt=!0,Jr.push({label:`DCA ${ln}`,deviation:yt,price:mn,margin:cr,positionValue:Nr,coins:fr,totalCoins:et,totalMargin:ws,avgEntry:Yr,tpPrice:null,tpProfit:null,liqPrice:ss,healthRatio:null,status:"LIQUIDATED"});for(let Vt=ln+1;Vt<=Sn;Vt++){let er=0;for(let kr=1;kr<=Vt;kr++)kr===1?er=Pn:er+=Pn*Math.pow($n,kr-1);const Wn=rr?Ut*(1-er/100):Ut*(1+er/100),Fr=Wn>0;Jr.push({label:`DCA ${Vt}`,deviation:er,price:Fr?Wn:null,margin:null,positionValue:null,coins:null,totalCoins:null,totalMargin:null,avgEntry:null,tpPrice:null,tpProfit:null,liqPrice:null,healthRatio:null,status:Fr?"CANCELLED":"EXCEEDED"})}break}else xs!==null&&(rr&&mn<=xs||!rr&&mn>=xs)?(Mn="STOPPED",Gt=!0):vn<1.5?(Mn="WARNING",tr++):Tn++;const ot=rr?(Qn-Yr)*et:(Yr-Qn)*et;ce=ss,rt=Yr,Pt=Qn,Jr.push({label:`DCA ${ln}`,deviation:yt,price:mn,margin:cr,positionValue:Nr,coins:fr,totalCoins:et,totalMargin:ws,avgEntry:Yr,tpPrice:Qn,tpProfit:ot,liqPrice:ss,healthRatio:vn,status:Mn})}const vt=[...Jr].reverse().find(ln=>ln.status!=="CANCELLED")||Jr[Jr.length-1];return{orders:Jr,metrics:{totalMargin:ws,totalPositionValue:ls,liquidationPrice:vt.liqPrice,breakEvenPrice:vt.avgEntry,safeCount:Tn,warningCount:tr,budgetOk:!Ar,budgetExceededAt:Br,leverage:bt,requiredBudget:Rr}}},[C,R,U,z,ne,X,fe,he,ye,ie,G]),Re=m.useMemo(()=>ke(P),[ke,P]),Ge=m.useMemo(()=>Re.orders.filter(Oe=>Oe.status!=="CANCELLED").map(Oe=>({name:Oe.label,orderPrice:je&&Oe.price!=null&&Oe.price>0?Oe.price:null,avgEntry:Le&&Oe.avgEntry!=null&&Oe.avgEntry>0?Oe.avgEntry:null,tpPrice:$e&&Oe.tpPrice!=null&&Oe.tpPrice>0?Oe.tpPrice:null,liqPrice:tt&&Oe.liqPrice!=null&&Oe.liqPrice>0?Oe.liqPrice:null,status:Oe.status})),[Re.orders,je,Le,$e,tt]),Fe=m.useMemo(()=>{const Oe=[];if(Ge.forEach(fn=>{fn.orderPrice!=null&&Oe.push(fn.orderPrice),fn.avgEntry!=null&&Oe.push(fn.avgEntry),fn.tpPrice!=null&&Oe.push(fn.tpPrice)}),Oe.length===0)return["auto","auto"];const bt=Math.min(...Oe),kt=Math.max(...Oe),Ut=(kt-bt)*.1;return[Math.max(0,bt-Ut),kt+Ut]},[Ge]),st=Oe=>{const{cx:bt,cy:kt,payload:Ut}=Oe;return Ut.status==="LIQUIDATED"&&bt&&kt?i.jsx("text",{x:bt,y:kt,textAnchor:"middle",dominantBaseline:"middle",fontSize:14,children:"💀"}):null},se=Oe=>{switch(Oe){case"orderPrice":Ie(!je);break;case"avgEntry":Qe(!Le);break;case"tpPrice":it(!$e);break;case"liqPrice":lt(!tt);break}},Ce=Oe=>{const{payload:bt}=Oe;return i.jsx("div",{className:"flex flex-wrap justify-center gap-2 sm:gap-4 mt-2",children:bt.map((kt,Ut)=>{const fn=kt.dataKey==="orderPrice"?je:kt.dataKey==="avgEntry"?Le:kt.dataKey==="tpPrice"?$e:kt.dataKey==="liqPrice"?tt:!0;return i.jsxs("button",{onClick:()=>se(kt.dataKey),className:`flex items-center gap-1.5 text-xs px-2 py-1 rounded transition-all ${fn?"opacity-100":"opacity-40"}`,style:{color:kt.color},children:[i.jsx("span",{className:"w-3 h-0.5",style:{backgroundColor:kt.color}}),kt.value]},Ut)})})},{orders:Be,metrics:De}=Re,_e=Be.filter(Oe=>Oe.status!=="CANCELLED"),Je=m.useMemo(()=>{var Pn,En;if(!Se)return null;const Oe=ke("long"),bt=ke("short"),kt=(Pn=Oe.metrics)==null?void 0:Pn.safeCount,Ut=(En=bt.metrics)==null?void 0:En.safeCount,fn=Oe.orders.some($n=>$n.status==="LIQUIDATED"),On=bt.orders.some($n=>$n.status==="LIQUIDATED"),Sn=Number.isFinite(kt)&&Number.isFinite(Ut)?Math.max(kt,Ut):null;let yr=!1;return Number.isFinite(kt)&&Number.isFinite(Ut)?kt>Ut?yr=fn:Ut>kt?yr=On:yr=fn&&On:yr=fn||On,{safeOrders:Sn,hasLiquidation:yr}},[ke,Se]),ct=m.useMemo(()=>Se?!!(Je!=null&&Je.hasLiquidation):_e.some(Oe=>Oe.status==="LIQUIDATED"),[Se,_e,Je==null?void 0:Je.hasLiquidation]),gt=m.useMemo(()=>{if(!ct)return null;const Oe=Se?Je==null?void 0:Je.safeOrders:De==null?void 0:De.safeCount,bt=Number.isFinite(Oe)?Oe:0,kt=parseInt(ne)||0;return`Liquidation occurs before completing all DCA orders. Safe orders: ${bt} of ${kt}. Reduce leverage, widen spacing, or lower max DCA orders.`},[ct,Se,Je==null?void 0:Je.safeOrders,De==null?void 0:De.safeCount,ne]),Xt=m.useMemo(()=>{const Oe=Se?Je==null?void 0:Je.safeOrders:De==null?void 0:De.safeCount,bt=parseInt(ne);return!Number.isFinite(Oe)||!Number.isFinite(bt)?null:bt>Oe?`Only ${Oe} of ${bt} DCA orders are currently safe. Increase budget, reduce leverage, or lower Max DCA Orders.`:null},[Se,Je==null?void 0:Je.safeOrders,De==null?void 0:De.safeCount,ne]),wt=({variant:Oe="desktop"})=>{const bt=Oe==="desktop"?"px-4 py-5":"p-3";return i.jsxs("div",{className:`${bt} space-y-3`,children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"inline-flex h-8 w-8 items-center justify-center rounded-full bg-[#a78bfa]/15 text-[#d7c8ff]",children:i.jsx(xNe,{className:"w-4 h-4"})}),i.jsxs("div",{children:[i.jsx("div",{className:"text-sm font-semibold text-white",children:"Smart Direction Mode"}),i.jsx("p",{className:"text-[12px] text-[#9b9b9b]",children:"When Smart mode is enabled, the bot checks the Extended 24h price change before each trade:"})]})]}),i.jsx("div",{className:"rounded-lg border border-[#1c2a24] bg-[#0b1511] p-4 space-y-3",children:i.jsxs("div",{className:"flex items-start gap-2",children:[i.jsx(gNe,{className:"w-5 h-5 text-[#67FFBD] mt-0.5"}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-sm font-semibold text-white",children:"How it works"}),i.jsxs("div",{className:"space-y-2 text-sm text-[#cfd4db]",children:[i.jsxs("div",{className:"flex items-start gap-2",children:[i.jsx(mNe,{className:"w-4 h-4 mt-0.5 text-[#67FFBD]"}),i.jsx("span",{children:"If 24h change is positive (+%) → Opens a Long position."})]}),i.jsxs("div",{className:"flex items-start gap-2",children:[i.jsx(gyn,{className:"w-4 h-4 mt-0.5 text-[#ff7073]"}),i.jsxs("span",{children:[" ","If 24h change is negative (-%) → Opens a Short position."]})]}),i.jsxs("div",{className:"flex items-start gap-2",children:[i.jsx(gNe,{className:"w-4 h-4 mt-0.5 text-[#a78bfa]"}),i.jsx("span",{children:"Order details and calculations are not available in Smart mode since the direction is dynamic."})]})]})]})]})}),i.jsxs("div",{className:"flex items-start gap-2 rounded-lg border border-[#1c2a24] bg-[#111] p-3",children:[i.jsx(byn,{className:"w-5 h-5 text-[#facc15] mt-0.5"}),i.jsxs("p",{className:"text-[13px] text-[#e5e7eb]",children:[i.jsx("span",{className:"font-semibold text-white",children:"Tip:"})," To preview the DCA order table for Long or Short scenarios, switch the Direction selector to the desired mode."]})]})]})};return i.jsx("div",{className:"text-white",style:{fontFamily:"Manrope, sans-serif"},children:i.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-5",children:[i.jsxs("div",{className:"lg:col-span-1 space-y-4",children:[i.jsxs("div",{className:"bg-[#101010] rounded-xl border border-[#1c2a24] p-4",children:[i.jsxs("h3",{className:"text-sm font-semibold mb-4 text-[#d7ffe9] flex items-center gap-2",children:[i.jsx("span",{className:"w-5 h-5 rounded-full bg-[#67FFBD]/20 text-[#67FFBD] flex items-center justify-center text-xs",children:"1"}),"Market & Coin"]}),i.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[i.jsx("div",{className:"col-span-2",children:i.jsxs("div",{className:"space-y-1.5",children:[i.jsxs("label",{className:"text-xs text-[#9b9b9b] flex items-center",children:["Market",i.jsx(Ih,{content:"Extended is temporarily the only available market.",children:"?"})]}),i.jsx(yyn,{value:x,onChange:g})]})}),i.jsx("div",{className:"col-span-2",children:i.jsxs("div",{className:"space-y-1.5",children:[i.jsxs("label",{className:"text-xs text-[#9b9b9b] flex items-center",children:[s==="extended"?"Extended Wallet":"Lighter Wallet",i.jsx(Ih,{content:"Select the wallet to use for this DCA bot. The bot will execute trades using this wallet.",children:"?"})]}),Me?Ft?i.jsx("div",{className:"w-full px-3 py-2 rounded-lg bg-[#161616] border border-[#1c2a24] text-white text-sm flex items-center justify-center",children:i.jsxs("svg",{className:"animate-spin h-4 w-4 text-[#67FFBD]",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[i.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),i.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]})}):i.jsx(yT,{wallets:cn,value:Bt&&Bt.id?String(Bt.id):"",onChange:Oe=>{const bt=cn.find(kt=>String(kt.wallet_id)===String(Oe));bt&&($t({id:bt.wallet_id,address:bt.wallet_address,apiKey:bt.wallet_api_key}),typeof window<"u"&&window.localStorage.setItem(Tt,String(bt.wallet_id)))},selectedBalance:Yn,mode:s}):i.jsx("div",{className:"w-full",children:i.jsx(Zp,{onClick:()=>Vn(!0)})})]})}),i.jsx("div",{className:"col-span-2",children:i.jsxs("div",{className:"space-y-1.5",children:[i.jsxs("label",{className:"text-xs text-[#9b9b9b] flex items-center",children:["Coin",i.jsx(Ih,{content:"Select the trading pair. Price and max leverage will update automatically.",children:"?"})]}),i.jsxs("div",{className:"relative rounded-lg border border-[#1c2a24] bg-[#161616] px-2 py-1.5 flex items-center gap-2 h-8",children:[i.jsx("img",{src:`${Syn}/${Xn||"BTC"}.svg`,alt:v||"coin",className:"w-6 h-6 rounded-full bg-[#161616] border border-[#1c2a24]",loading:"lazy",onError:Oe=>fm(Oe)}),i.jsx("div",{className:"flex-1 min-w-0",children:i.jsx(yue,{markets:kn,value:v,onChange:te,loading:xe,showIcon:!0})})]})]})})]})]}),i.jsxs("div",{className:"bg-[#101010] rounded-xl border border-[#1c2a24] p-4",children:[i.jsxs("h3",{className:"text-sm font-semibold mb-4 text-[#d7ffe9] flex items-center gap-2",children:[i.jsx("span",{className:"w-5 h-5 rounded-full bg-[#67FFBD]/20 text-[#67FFBD] flex items-center justify-center text-xs",children:"2"}),"Position Setup"]}),i.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[i.jsxs("div",{className:"col-span-2 space-y-1.5",children:[i.jsxs("label",{className:"text-xs text-[#9b9b9b] flex items-center",children:["Direction",i.jsx(Ih,{content:"Long: Profit when price rises. Short: Profit when price falls.",children:"?"})]}),i.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[i.jsx("button",{type:"button",onClick:()=>I("short"),className:`py-2 px-3 rounded-lg text-sm font-medium transition-all border flex items-center justify-center gap-1 ${P==="short"?"bg-[#ff7073]/20 border-[#ff7073] text-[#ff7073]":"bg-[#161616] border-[#1c2a24] text-[#6e857d] hover:border-[#ff7073]/50"}`,children:"Short"}),i.jsx("button",{type:"button",onClick:()=>I("long"),className:`py-2 px-3 rounded-lg text-sm font-medium transition-all border flex items-center justify-center gap-1 ${P==="long"?"bg-[#67FFBD]/20 border-[#67FFBD] text-[#67FFBD]":"bg-[#161616] border-[#1c2a24] text-[#6e857d] hover:border-[#67FFBD]/50"}`,children:"Long"}),i.jsxs("button",{type:"button",onClick:()=>I("smart"),className:`py-2 px-3 rounded-lg text-sm font-medium transition-all border flex items-center justify-center gap-1 ${P==="smart"?"bg-[#a78bfa]/20 border-[#a78bfa] text-[#d7c8ff]":"bg-[#161616] border-[#1c2a24] text-[#7f7b9f] hover:border-[#a78bfa]/50"}`,children:[i.jsx(xNe,{className:"w-4 h-4"}),"Smart"]})]})]}),i.jsx("div",{className:"col-span-2",children:i.jsx(kyn,{value:R,onChange:F,min:1,max:c,tooltip:`Position multiplier. 10x leverage means $100 margin controls $1,000 position. Max leverage for ${v}: ${c}x`})})]})]}),i.jsxs("div",{className:"bg-[#101010] rounded-xl border border-[#1c2a24] p-4",children:[i.jsxs("h3",{className:"text-sm font-semibold mb-4 text-[#d7ffe9] flex items-center gap-2",children:[i.jsx("span",{className:"w-5 h-5 rounded-full bg-[#67FFBD]/20 text-[#67FFBD] flex items-center justify-center text-xs",children:"3"}),"Order Sizing"]}),i.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[i.jsx(ng,{label:"Base Order Margin",value:U,onChange:L,step:"1",min:"1",suffix:"$",tooltip:"Initial margin for the first position opened at Entry Price.",validate:(Oe,bt)=>!bt||isNaN(Oe)?"Required":Oe<1?"Must be at least 1":s==="extended"&&Jn!=null&&Oe*Lt<Jn?T("Base Order Margin"):null}),i.jsx(ng,{label:"DCA Order Margin",value:z,onChange:Q,step:"1",min:"1",suffix:"$",tooltip:"Starting margin for DCA orders.",validate:(Oe,bt)=>!bt||isNaN(Oe)?"Required":Oe<1?"Must be at least 1":s==="extended"&&Jn!=null&&Oe*Lt<Jn?T("DCA Order Margin"):null}),i.jsx(ng,{label:"Max DCA Orders",value:ne,onChange:J,step:"1",max:"50",tooltip:"Maximum number of DCA orders to place after the Base Order.",validate:(Oe,bt)=>!bt||isNaN(Oe)?"Required":Oe<1?"Minimum 1":Oe>50?"Maximum 50":null,forceError:ct||!!Xt,forceErrorMessage:gt||Xt}),i.jsx(ng,{label:"Available to Trade",value:Yn!=null?String(Yn):"",onChange:()=>{},step:"100",suffix:"$",readOnly:!0,tooltip:"Wallet balance available for trading. Read only."})]})]}),i.jsxs("div",{className:"bg-[#101010] rounded-xl border border-[#1c2a24] p-4",children:[i.jsxs("h3",{className:"text-sm font-semibold mb-4 text-[#d7ffe9] flex items-center gap-2",children:[i.jsx("span",{className:"w-5 h-5 rounded-full bg-[#67FFBD]/20 text-[#67FFBD] flex items-center justify-center text-xs",children:"4"}),"Exit Strategy"]}),i.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[i.jsx(ng,{label:"Take Profit",value:ie,onChange:oe,step:"0.1",suffix:"%",tooltip:"Target profit % calculated from the weighted average entry price."}),i.jsx(ng,{label:"Stop Loss",value:G,onChange:V,step:"1",suffix:"%",tooltip:"Maximum loss % from average entry before position closes. Leave empty to disable stop loss and rely only on liquidation"})]})]}),i.jsxs("div",{className:"bg-[#101010] rounded-xl border border-[#1c2a24] overflow-hidden",children:[i.jsxs("button",{onClick:()=>ae(!ee),className:"w-full flex items-center justify-between p-4 hover:bg-[#111] transition-colors",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"text-sm font-semibold text-[#d7ffe9]",children:"Advanced Settings"}),i.jsxs("span",{className:"text-xs text-[#666]",children:["Dev: ",fe,"% • Dev Mult: ",ye,"x • Size: ",he,"x"]})]}),ee?i.jsx(Han,{className:"w-4 h-4 text-[#67FFBD]"}):i.jsx(Dan,{className:"w-4 h-4 text-[#67FFBD]"})]}),i.jsx(xT,{children:ee&&i.jsx(vo.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.2},children:i.jsxs("div",{className:"px-4 pb-4 grid grid-cols-2 gap-3 border-t border-[#1c2a24] pt-3",children:[i.jsx(ng,{label:"Price Deviation",value:fe,onChange:Ne,step:"0.1",suffix:"%",tooltip:"Initial price change % from Entry Price to trigger DCA."}),i.jsx(ng,{label:"DCA Order Size Multiplier",value:he,onChange:ge,step:"0.1",suffix:"x",tooltip:"Multiplier for each DCA order's margin."}),i.jsx(ng,{label:"Price Deviation Multiplier",value:ye,onChange:ve,step:"0.05",suffix:"x",tooltip:"Multiplier for price gaps between DCA orders."})]})})})]}),(()=>{const Oe=C&&!isNaN(parseFloat(C))&&parseFloat(C)>0,bt=U&&!isNaN(parseFloat(U))&&parseFloat(U)>=1,kt=z&&!isNaN(parseFloat(z))&&parseFloat(z)>=1,Ut=ne&&!isNaN(parseInt(ne))&&parseInt(ne)>=1,fn=X&&!isNaN(parseFloat(X))&&parseFloat(X)>0,On=Oe&&bt&&kt&&Ut&&fn,Sn=k,yr=_r=>{const sr=parseFloat(C)||0,rr=parseFloat(U)||0,Rr=parseFloat(z)||0,Jr=parseInt(ne)||0,ws=parseFloat(X)||1/0,ls=parseFloat(he)||1.1;if(sr<=0||rr<=0)return null;let et=rr,yt=0,Tn=et>ws;Tn||(yt+=1);for(let Ar=1;Ar<=Jr;Ar++){const Br=Rr*Math.pow(ls,Ar-1);et+=Br,!Tn&&et>ws&&(Tn=!0),Tn||(yt+=1)}return{budgetOk:et<=ws,safeCount:yt}},Pn=Se?{long:yr(),short:yr()}:null,En=Se&&(Pn==null?void 0:Pn.long)&&(Pn==null?void 0:Pn.short)&&Pn.long.budgetOk&&Pn.short.budgetOk&&Pn.long.safeCount>0&&Pn.short.safeCount>0&&!Sn,$n=Se?On&&En:On&&De&&De.budgetOk&&De.safeCount>0&&!Sn;let Bn=null;if(!On)Bn="Please fill in all required fields";else if(Sn&&Jn!=null){const _r=[];S&&_r.push("Base Order"),_&&_r.push("DCA Order");const sr=_r.length===1?` (${_r[0]})`:_r.length===2?" (Base Order & DCA Order)":"";Bn=`Minimum order size for ${String(v||"").toUpperCase()} is $${Jn.toFixed(2)}${sr}. Increase order size or leverage.`}else!Se&&De&&!De.budgetOk?Bn="Budget exceeded - increase budget or reduce orders":!Se&&De&&De.safeCount===0?Bn="No safe orders - reduce leverage or increase budget":Se&&(!(Pn!=null&&Pn.long)||!(Pn!=null&&Pn.short)||!Pn.long.budgetOk||!Pn.short.budgetOk)?Bn="Budget exceeded in Smart mode - adjust margin or orders":Se&&(Pn!=null&&Pn.long)&&(Pn!=null&&Pn.short)&&(Pn.long.safeCount===0||Pn.short.safeCount===0)&&(Bn="No safe orders in Smart mode - reduce leverage or increase budget");return i.jsxs("div",{className:"bg-[#101010] rounded-xl border border-[#1c2a24] p-4",children:[(()=>{const _r=(or==null?void 0:or.id)||(or==null?void 0:or.bot_id),sr=_r&&ht[_r]===!0,rr=_r&&zt[_r]===!0,Rr=!!or,Jr=Rr?sr||rr:!$n||qe||!Bt||!Bt.id,ws=()=>{Rr&&_r?tn(_r,!0):Mt()};return i.jsx("button",{onClick:ws,disabled:Jr,className:`w-full py-2.5 rounded-lg text-sm font-semibold transition-all flex items-center justify-center gap-2 ${Rr?"bg-[#ff7073] text-black hover:bg-[#ff8a8d]":$n&&Bt&&Bt.id&&!qe?"bg-[#67FFBD] text-[#101010] hover:bg-[#9FFFDA]":"bg-[#333] text-[#666] cursor-not-allowed"} disabled:opacity-60 disabled:cursor-not-allowed`,children:Rr?sr?i.jsxs(i.Fragment,{children:[i.jsxs("svg",{className:"animate-spin h-5 w-5",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[i.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),i.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),"Stopping..."]}):i.jsxs(i.Fragment,{children:[i.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})}),"Stop DCA Bot"]}):qe?i.jsxs(i.Fragment,{children:[i.jsxs("svg",{className:"animate-spin h-5 w-5",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[i.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),i.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),"Starting..."]}):i.jsxs(i.Fragment,{children:[i.jsxs("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:[i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M14.752 11.168l-3.197-2.132A1 1 0 0010 9.87v4.263a1 1 0 001.555.832l3.197-2.132a1 1 0 000-1.664z"}),i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})]}),"Start DCA Bot"]})})})(),Bn&&i.jsx("p",{className:"text-xs text-[#ff7073] text-center mt-2",children:Bn}),(!Bt||!Bt.id)&&i.jsx("p",{className:"text-xs text-[#ff7073] text-center mt-2",children:"Please select a Extended wallet first"}),i.jsx("p",{className:"text-xs text-[#555] text-center mt-2",children:"Bot will execute orders on Extended exchange"})]})})(),i.jsx("div",{className:"h-4"})]}),i.jsxs("div",{className:"lg:col-span-2 space-y-4 pb-6",children:[i.jsx("div",{className:"bg-[#101010] rounded-xl border border-[#1c2a24] p-4 mb-4",children:i.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:"w-10 h-10 rounded-lg bg-[#0b1511] border border-[#1e2e27] flex items-center justify-center",children:i.jsx(mNe,{className:"w-5 h-5 text-[#67FFBD]"})}),i.jsxs("div",{children:[i.jsx("h1",{className:"text-base font-semibold text-[#d7ffe9]",children:"DCA Bot and Calculator"}),i.jsx("p",{className:"text-xs text-[#666] mt-1",children:"Plan your strategy and start DCAing"}),i.jsx("div",{className:"flex items-center mt-1 text-sm text-[#67FFBD]",children:i.jsxs("a",{href:"https://docs.dextrabot.com/dca-bot/extended-dca-bot",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-2 rounded-lg bg-[#101010]/70 hover:bg-[#111] transition-colors",children:[i.jsx("span",{className:"text-xs text-white",children:"New to DCA? Learn how it works"}),i.jsx("span",{children:"📚"})]})})]})]}),De&&i.jsxs("div",{className:"flex flex-wrap gap-4 sm:gap-6",children:[i.jsxs("div",{children:[i.jsxs("div",{className:"text-xs text-[#888] flex items-center mb-1",children:["Total Margin",i.jsx(Ih,{content:"Total margin required for Base Order + all DCA orders",children:"?"})]}),i.jsxs("div",{className:"text-lg sm:text-xl font-bold text-white",children:["$",jo(De.totalMargin)]})]}),i.jsxs("div",{children:[i.jsxs("div",{className:"text-xs text-[#888] flex items-center mb-1",children:["Position Value",i.jsx(Ih,{content:"Combined notional value of all positions. Total Margin × Leverage",children:"?"})]}),i.jsxs("div",{className:"text-lg sm:text-xl font-bold text-white",children:["$",jo(De.totalPositionValue)]}),i.jsxs("div",{className:"text-xs text-[#555]",children:[De.leverage,"x leverage"]})]}),i.jsxs("div",{children:[i.jsxs("div",{className:"text-xs text-[#888] flex items-center mb-1",children:["Safe Orders",i.jsx(Ih,{content:"DCA orders that can be executed safely.",children:"?"})]}),i.jsxs("div",{className:"text-lg sm:text-xl font-bold",style:{color:kb},children:[De.safeCount,"/",parseInt(ne)||0]})]})]})]})}),!Se&&i.jsxs("div",{className:"bg-[#101010] rounded-xl border border-[#1c2a24] p-4",children:[i.jsx("h3",{className:"text-sm font-semibold text-[#d7ffe9] mb-3",children:"Price Chart"}),i.jsx("div",{className:"h-[280px] sm:h-[320px]",children:i.jsx(cBe,{width:"100%",height:"100%",children:i.jsxs(drn,{data:Ge.length>0?Ge:[{name:"No Data",orderPrice:null,avgEntry:null,tpPrice:null,liqPrice:null}],margin:{top:10,right:20,left:10,bottom:5},children:[i.jsx(tUe,{strokeDasharray:"3 3",stroke:"#1c2a24"}),i.jsx(r8,{dataKey:"name",stroke:"#666",fontSize:10,interval:0,angle:Ge.length>6?-45:0,textAnchor:Ge.length>6?"end":"middle",height:Ge.length>6?50:30,tickFormatter:Oe=>Oe==="Base"?"B":Oe.startsWith("DCA")?`D${Oe.split(" ")[1]}`:Oe.includes("Liq")?"💀":Oe}),i.jsx(s8,{stroke:"#666",fontSize:10,tickFormatter:Oe=>`$${jo(Oe)}`,domain:Fe,allowDataOverflow:!0}),i.jsx(Yp,{contentStyle:{backgroundColor:"#101010",border:"1px solid #333",borderRadius:"6px",fontSize:"11px"},formatter:(Oe,bt)=>[Cb(Oe),bt],labelFormatter:Oe=>Oe==="B"?"Base Order":Oe.startsWith("D")?`DCA ${Oe.slice(1)}`:Oe}),i.jsx(i3,{content:Ce}),i.jsx(T0,{type:"monotone",dataKey:"orderPrice",name:"Order Price",stroke:kb,strokeWidth:2,dot:{fill:kb,r:3},connectNulls:!0}),i.jsx(T0,{type:"monotone",dataKey:"avgEntry",name:"Avg Entry",stroke:pF,strokeWidth:2,dot:{fill:pF,r:2},connectNulls:!0}),i.jsx(T0,{type:"monotone",dataKey:"tpPrice",name:"TP",stroke:bNe,strokeWidth:1.5,strokeDasharray:"4 4",dot:!1,connectNulls:!0}),i.jsx(T0,{type:"monotone",dataKey:"liqPrice",name:"Liq",stroke:FO,strokeWidth:1.5,strokeDasharray:"4 4",dot:st,connectNulls:!0})]})})}),i.jsxs("div",{className:"text-xs text-[#555] text-center mt-2",children:["B = Base Order • D1-D",ne," = DCA Orders • 💀 = Liquidation Point"]})]}),i.jsxs("div",{className:"bg-[#101010] rounded-xl border border-[#1c2a24] overflow-hidden hidden md:block",children:[i.jsxs("div",{className:"flex border-b border-[#1c2a24]",children:[i.jsx("button",{onClick:()=>ut("details"),className:`flex-1 px-4 py-3 text-sm font-medium transition-colors relative first:rounded-tl-xl last:rounded-tr-xl border ${ft==="details"?"text-[#67FFBD] bg-[#0b1511] border-[#67FFBD] shadow-[0_0_0_1px_rgba(103,255,189,0.35)]":"text-[#888] hover:text-white hover:bg-[#111] border-transparent"}`,children:"Order Details"}),i.jsx("button",{onClick:()=>ut("bots"),className:`flex-1 px-4 py-3 text-sm font-medium transition-colors relative first:rounded-tl-xl last:rounded-tr-xl border ${ft==="bots"?"text-[#67FFBD] bg-[#0b1511] border-[#67FFBD] shadow-[0_0_0_1px_rgba(103,255,189,0.35)]":"text-[#888] hover:text-white hover:bg-[#111] border-transparent"}`,children:"DCA Bots"})]}),ft==="details"&&(Se?i.jsx(wt,{variant:"desktop"}):i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"px-4 py-3",children:i.jsx(vNe,{entryPrice:C,onEntryPriceChange:de,maxBudget:X,onBudgetChange:ue})}),i.jsxs("div",{className:"overflow-x-auto",children:[i.jsxs("table",{className:"w-full text-xs",children:[i.jsx("thead",{children:i.jsxs("tr",{className:"bg-[#161616] text-[#888]",children:[i.jsx("th",{className:"px-3 py-2 text-left",children:"#"}),i.jsx("th",{className:"px-3 py-2 text-right",children:"Dev %"}),i.jsx("th",{className:"px-3 py-2 text-right",children:"Price"}),i.jsx("th",{className:"px-3 py-2 text-right hidden lg:table-cell",children:"Margin"}),i.jsx("th",{className:"px-3 py-2 text-right hidden xl:table-cell",children:"Pos. Value"}),i.jsxs("th",{className:"px-3 py-2 text-right",children:["Size (",v,")"]}),i.jsx("th",{className:"px-3 py-2 text-right hidden lg:table-cell",children:"Total Margin"}),i.jsx("th",{className:"px-3 py-2 text-right",children:"Avg Entry"}),i.jsx("th",{className:"px-3 py-2 text-right hidden lg:table-cell",children:"TP"}),i.jsx("th",{className:"px-3 py-2 text-right",children:i.jsxs("span",{className:"flex items-center justify-end gap-1",children:["TP Profit",i.jsx(Ih,{content:"Profit if price reaches Take Profit level after this order executes.",children:i.jsx("span",{className:"text-[#666]",children:"?"})})]})}),i.jsx("th",{className:"px-3 py-2 text-right",children:"Liq"}),i.jsx("th",{className:"px-3 py-2 text-center",children:"Status"})]})}),i.jsx("tbody",{children:_e.map((Oe,bt)=>{const kt=yNe[Oe.status];if(Oe.status==="EXCEEDED"){const Ut=Oe.isLong?"Price would drop below $0 (impossible). Reduce deviation multiplier or fewer DCA orders.":"Price deviation exceeds 100%. Reduce deviation multiplier or fewer DCA orders.";return i.jsx("tr",{className:"border-t border-[#1c2a24] bg-[#1a1a1a]",children:i.jsx("td",{colSpan:12,className:"px-3 py-3",children:i.jsxs("div",{className:"flex items-center gap-2 text-[#6B7280]",children:[i.jsx("span",{children:kt.icon}),i.jsxs("span",{className:"text-sm",children:[i.jsx("span",{className:"font-medium",children:Oe.label})," ","— ",Ut]})]})})},bt)}return i.jsxs("tr",{className:"border-t border-[#1c2a24] hover:bg-[#111]",children:[i.jsx("td",{className:"px-3 py-2 font-medium whitespace-nowrap",children:Oe.label}),i.jsx("td",{className:"px-3 py-2 text-right",children:Oe.deviation!=null?Ayn(Oe.deviation):"-"}),i.jsx("td",{className:"px-3 py-2 text-right",children:Cb(Oe.price)}),i.jsx("td",{className:"px-3 py-2 text-right hidden lg:table-cell",children:Oe.margin!=null?`$${jo(Oe.margin)}`:"-"}),i.jsx("td",{className:"px-3 py-2 text-right hidden xl:table-cell",children:Oe.positionValue!=null?`$${jo(Oe.positionValue)}`:"-"}),i.jsx("td",{className:"px-3 py-2 text-right",children:Oe.coins!=null?jo(Oe.coins,4):"-"}),i.jsx("td",{className:"px-3 py-2 text-right hidden lg:table-cell",children:Oe.totalMargin!=null?`$${jo(Oe.totalMargin)}`:"-"}),i.jsx("td",{className:"px-3 py-2 text-right",style:{color:pF},children:Cb(Oe.avgEntry)}),i.jsx("td",{className:"px-3 py-2 text-right hidden lg:table-cell",style:{color:bNe},children:Cb(Oe.tpPrice)}),i.jsx("td",{className:"px-3 py-2 text-right",style:{color:kb},children:Oe.tpProfit!=null?`$${jo(Oe.tpProfit)}`:"-"}),i.jsx("td",{className:"px-3 py-2 text-right",style:{color:Oe.liqPrice<=0?kb:FO},children:Cb(Oe.liqPrice,!0)}),i.jsx("td",{className:"px-3 py-2 text-center",children:i.jsx(Ih,{content:kt.tooltip,children:i.jsx("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 rounded text-[10px] font-medium cursor-help",style:{backgroundColor:`${kt.color}15`,color:kt.color},children:kt.icon})})})]},bt)})})]}),_e.length===0&&i.jsxs("div",{className:"p-8 text-center text-[#666] text-sm",children:[i.jsx("p",{children:"No orders to display"}),i.jsx("p",{className:"text-xs text-[#555] mt-1",children:"Enter entry price and base order margin to see order details"})]})]})]})),ft==="bots"&&i.jsx("div",{className:"p-4",children:nn?i.jsxs("div",{className:"text-center py-8",children:[i.jsx("div",{className:"w-16 h-16 mx-auto mb-4 rounded-full bg-[#0b1511] border border-[#1c2a24] flex items-center justify-center",children:i.jsxs("svg",{className:"animate-spin h-8 w-8 text-[#67FFBD]",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[i.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),i.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]})}),i.jsx("p",{className:"text-sm text-[#666]",children:"Loading bots..."})]}):lr.length===0?i.jsxs("div",{className:"text-center py-8",children:[i.jsx("div",{className:"w-16 h-16 mx-auto mb-4 rounded-full bg-[#0b1511] border border-[#1c2a24] flex items-center justify-center",children:i.jsx("svg",{className:"w-8 h-8 text-[#67FFBD]",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M9.75 17L9 20l-1 1h8l-1-1-.75-3M3 13h18M5 17h14a2 2 0 002-2V5a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"})})}),i.jsx("h4",{className:"text-sm font-medium text-[#d7ffe9] mb-2",children:"No Active DCA Bots"}),i.jsx("p",{className:"text-xs text-[#666] mb-4",children:'Configure your DCA strategy and click "Start Bot" to create your first bot.'}),i.jsx("p",{className:"text-xs text-[#555]",children:"Your active bots will appear here."})]}):i.jsx("div",{className:"space-y-3 max-h-[845px] overflow-y-auto pr-1",children:lr.map(Oe=>{const bt=!Oe.is_deleted,kt=Oe.bot_params||{},Ut=Oe.created_at?new Date(Oe.created_at):null,fn=Ut?(()=>{const Bn=Date.now()-Ut.getTime(),_r=Math.floor(Bn/(1e3*60*60)),sr=Math.floor(_r/24);return sr>0?`${sr}d ago`:_r>0?`${_r}h ago`:`${Math.floor(Bn/(1e3*60))}m ago`})():null,On=kt.direction==="long"?"Long":kt.direction==="short"?"Short":"Smart",Sn=kt.price_deviation??kt.priceDeviation??0,yr=kt.step_scale??kt.price_dev_multiplier??kt.priceDevMultiplier??0,Pn=kt.volume_scale??kt.dca_size_multiplier??kt.dcaSizeMultiplier??0,En=kt.tp_percent??kt.tp_target??kt.take_profit_percent??0,$n=kt.stop_loss_percent??kt.stop_loss??0;return kt.market_index??kt.marketIndex,kt.coin_idx??kt.coinIndex,i.jsxs("div",{className:"bg-[#111] rounded-lg p-4 border border-[#1c2a24]",children:[i.jsxs("div",{className:"flex justify-between items-start mb-3",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsxs("span",{className:"text-sm font-medium",children:[Oe.coin||v," DCA Bot"]}),bt?i.jsx("span",{className:"px-2 py-0.5 text-xs rounded bg-[#67FFBD]/20 text-[#67FFBD]",children:"Active"}):i.jsx("span",{className:"px-2 py-0.5 text-xs rounded bg-[#666]/20 text-[#666]",children:"Stopped"})]}),fn&&i.jsx("span",{className:"text-[11px] text-[#7c7c7c]",children:fn})]}),i.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 gap-2 text-xs mb-3",children:[i.jsxs("div",{children:[i.jsx("span",{className:"text-[#666]",children:"Direction:"}),i.jsx("span",{className:`ml-1 ${kt.direction==="long"?"text-[#67FFBD]":kt.direction==="short"?"text-[#ff7073]":"text-[#A78BFA]"}`,children:On})]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-[#666]",children:"Leverage:"}),i.jsxs("span",{className:"ml-1 text-white",children:[kt.leverage||0,"x"]})]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-[#666]",children:"Base Order Margin:"}),i.jsxs("span",{className:"ml-1 text-white",children:["$",jo(kt.base_amount_usd||kt.base_order_margin||0)]})]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-[#666]",children:"DCA Order Margin:"}),i.jsxs("span",{className:"ml-1 text-white",children:["$",jo(kt.safety_amount_usd||kt.dca_order_margin||0)]})]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-[#666]",children:"Max DCA Orders:"}),i.jsx("span",{className:"ml-1 text-white",children:kt.max_safety_orders||kt.max_dca_orders||0})]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-[#666]",children:"Price Deviation:"}),i.jsxs("span",{className:"ml-1 text-white",children:[jo(Sn),"%"]})]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-[#666]",children:"Price Deviation Multiplier:"}),i.jsxs("span",{className:"ml-1 text-white",children:[jo(yr),"x"]})]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-[#666]",children:"DCA Order Size Multiplier:"}),i.jsxs("span",{className:"ml-1 text-white",children:[jo(Pn),"x"]})]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-[#666]",children:"Take Profit:"}),i.jsxs("span",{className:"ml-1 text-[#67FFBD]",children:[jo(En),"%"]})]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-[#666]",children:"Stop Loss:"}),i.jsxs("span",{className:"ml-1 text-[#ff7073]",children:[jo($n),"%"]})]}),fn&&i.jsxs("div",{children:[i.jsx("span",{className:"text-[#666]",children:"Created:"}),i.jsx("span",{className:"ml-1 text-white",children:fn})]})]}),i.jsx("div",{className:"mt-4",children:i.jsx("button",{onClick:()=>tn(Oe.id||Oe.bot_id,bt),disabled:ht[Oe.id||Oe.bot_id]||zt[Oe.id||Oe.bot_id],className:`w-full py-2 rounded-lg text-sm font-semibold transition-colors ${bt?"bg-[#ff7073] text-black hover:bg-[#ff8a8d]":"bg-[#67FFBD] text-black hover:bg-[#8bffd0]"} disabled:opacity-60 disabled:cursor-not-allowed`,children:ht[Oe.id||Oe.bot_id]?bt?"Stopping...":"Starting...":bt?"Stop Bot":"Start Bot"})})]},Oe.id||Oe.bot_id)})})})]}),i.jsx("div",{className:"md:hidden space-y-2",children:i.jsxs("div",{className:"bg-[#101010] rounded-xl border border-[#1c2a24] overflow-hidden",children:[i.jsxs("div",{className:"flex border-b border-[#1c2a24]",children:[i.jsx("button",{onClick:()=>ut("details"),className:`flex-1 px-3 py-2 text-xs font-medium transition-colors relative first:rounded-tl-xl last:rounded-tr-xl border ${ft==="details"?"text-[#67FFBD] bg-[#0b1511] border-[#67FFBD] shadow-[0_0_0_1px_rgba(103,255,189,0.35)]":"text-[#888] hover:text-white border-transparent"}`,children:"Order Details"}),i.jsx("button",{onClick:()=>ut("bots"),className:`flex-1 px-3 py-2 text-xs font-medium transition-colors relative first:rounded-tl-xl last:rounded-tr-xl border ${ft==="bots"?"text-[#67FFBD] bg-[#0b1511] border-[#67FFBD] shadow-[0_0_0_1px_rgba(103,255,189,0.35)]":"text-[#888] hover:text-white border-transparent"}`,children:"DCA Bots"})]}),ft==="details"&&(Se?i.jsx(wt,{variant:"mobile"}):i.jsxs("div",{className:"p-3 space-y-2",children:[i.jsx(vNe,{className:"w-full",entryPrice:C,onEntryPriceChange:de,maxBudget:X,onBudgetChange:ue}),_e.map((Oe,bt)=>{const kt=yNe[Oe.status];if(Oe.status==="EXCEEDED"){const Ut=Oe.isLong?"Price would drop below $0":"Price deviation exceeds 100%";return i.jsx("div",{className:"bg-[#1a1a1a] rounded-lg p-3 border border-[#333]",children:i.jsxs("div",{className:"flex items-center gap-2 text-[#6B7280]",children:[i.jsx("span",{children:kt.icon}),i.jsxs("span",{className:"text-sm",children:[i.jsx("span",{className:"font-medium",children:Oe.label})," ","— ",Ut]})]})},bt)}return i.jsxs("div",{className:"bg-[#111] rounded-lg p-3 border border-[#1c2a24]",children:[i.jsxs("div",{className:"flex justify-between items-center mb-2",children:[i.jsx("span",{className:"font-medium text-sm",children:Oe.label}),i.jsx(Ih,{content:kt.tooltip,children:i.jsx("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 rounded text-[10px] font-medium cursor-help",style:{backgroundColor:`${kt.color}15`,color:kt.color},children:kt.icon})})]}),i.jsxs("div",{className:"grid grid-cols-2 gap-x-4 gap-y-1 text-xs",children:[i.jsxs("div",{className:"flex justify-between",children:[i.jsx("span",{className:"text-[#666]",children:"Price:"}),i.jsx("span",{children:Cb(Oe.price)})]}),i.jsxs("div",{className:"flex justify-between",children:[i.jsx("span",{className:"text-[#666]",children:"Size:"}),i.jsx("span",{children:Oe.coins!=null?`${jo(Oe.coins,4)} ${v}`:"-"})]}),i.jsxs("div",{className:"flex justify-between",children:[i.jsx("span",{className:"text-[#666]",children:"Avg Entry:"}),i.jsx("span",{style:{color:pF},children:Cb(Oe.avgEntry)})]}),i.jsxs("div",{className:"flex justify-between",children:[i.jsx("span",{className:"text-[#666]",children:"Liq:"}),i.jsx("span",{style:{color:Oe.liqPrice<=0?kb:FO},children:Cb(Oe.liqPrice,!0)})]}),i.jsxs("div",{className:"flex justify-between col-span-2 pt-1 border-t border-[#1c2a24] mt-1",children:[i.jsx("span",{className:"text-[#666]",children:"TP Profit:"}),i.jsx("span",{style:{color:kb},className:"font-medium",children:Oe.tpProfit!=null?`$${jo(Oe.tpProfit)}`:"-"})]})]})]},bt)})]})),ft==="bots"&&i.jsx("div",{className:"p-3",children:nn?i.jsxs("div",{className:"text-center py-6",children:[i.jsx("div",{className:"w-12 h-12 mx-auto mb-3 rounded-full bg-[#0b1511] border border-[#1c2a24] flex items-center justify-center",children:i.jsxs("svg",{className:"animate-spin h-6 w-6 text-[#67FFBD]",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[i.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),i.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]})}),i.jsx("p",{className:"text-[10px] text-[#666]",children:"Loading bots..."})]}):lr.length===0?i.jsxs("div",{className:"text-center py-6",children:[i.jsx("div",{className:"w-12 h-12 mx-auto mb-3 rounded-full bg-[#0b1511] border border-[#1c2a24] flex items-center justify-center",children:i.jsx("svg",{className:"w-6 h-6 text-[#67FFBD]",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M9.75 17L9 20l-1 1h8l-1-1-.75-3M3 13h18M5 17h14a2 2 0 002-2V5a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"})})}),i.jsx("h4",{className:"text-xs font-medium text-[#d7ffe9] mb-1",children:"No Active DCA Bots"}),i.jsx("p",{className:"text-[10px] text-[#666]",children:"Your bots will appear here."})]}):i.jsx("div",{className:"space-y-2 max-h-[360px] overflow-y-auto pr-1",children:lr.map(Oe=>{const bt=!Oe.is_deleted,kt=Oe.bot_params||{},Ut=Oe.created_at?new Date(Oe.created_at):null,fn=Ut?(()=>{const sr=Date.now()-Ut.getTime(),rr=Math.floor(sr/(1e3*60*60)),Rr=Math.floor(rr/24);return Rr>0?`${Rr}d ago`:rr>0?`${rr}h ago`:`${Math.floor(sr/(1e3*60))}m ago`})():null,On=kt.direction==="long"?"Long":kt.direction==="short"?"Short":"Smart",Sn=kt.price_deviation??kt.priceDeviation??0,yr=kt.step_scale??kt.price_dev_multiplier??kt.priceDevMultiplier??0,Pn=kt.volume_scale??kt.dca_size_multiplier??kt.dcaSizeMultiplier??0,En=kt.tp_percent??kt.tp_target??kt.take_profit_percent??0,$n=kt.stop_loss_percent??kt.stop_loss??0,Bn=kt.market_index??kt.marketIndex,_r=kt.coin_idx??kt.coinIndex;return i.jsxs("div",{className:"bg-[#111] rounded-lg p-3 border border-[#1c2a24]",children:[i.jsxs("div",{className:"flex justify-between items-start mb-2",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsxs("span",{className:"text-xs font-medium",children:[Oe.coin||v," DCA"]}),bt?i.jsx("span",{className:"px-1.5 py-0.5 text-[10px] rounded bg-[#67FFBD]/20 text-[#67FFBD]",children:"Active"}):i.jsx("span",{className:"px-1.5 py-0.5 text-[10px] rounded bg-[#666]/20 text-[#666]",children:"Stopped"})]}),fn&&i.jsx("span",{className:"text-[10px] text-[#7c7c7c]",children:fn})]}),i.jsxs("div",{className:"grid grid-cols-2 gap-x-3 gap-y-1 text-[10px]",children:[i.jsxs("div",{children:[i.jsx("span",{className:"text-[#666]",children:"Direction:"}),i.jsx("span",{className:`ml-1 ${kt.direction==="long"?"text-[#67FFBD]":kt.direction==="short"?"text-[#ff7073]":"text-[#A78BFA]"}`,children:On})]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-[#666]",children:"Leverage:"}),i.jsxs("span",{className:"ml-1 text-white",children:[kt.leverage||0,"x"]})]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-[#666]",children:"Base Order Margin:"}),i.jsxs("span",{className:"ml-1 text-white",children:["$",jo(kt.base_amount_usd||kt.base_order_margin||0)]})]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-[#666]",children:"DCA Order Margin:"}),i.jsxs("span",{className:"ml-1 text-white",children:["$",jo(kt.safety_amount_usd||kt.dca_order_margin||0)]})]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-[#666]",children:"Max DCA Orders:"}),i.jsx("span",{className:"ml-1 text-white",children:kt.max_safety_orders||kt.max_dca_orders||0})]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-[#666]",children:"Price Deviation:"}),i.jsxs("span",{className:"ml-1 text-white",children:[jo(Sn),"%"]})]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-[#666]",children:"Price Deviation Multiplier:"}),i.jsxs("span",{className:"ml-1 text-white",children:[jo(yr),"x"]})]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-[#666]",children:"DCA Order Size Multiplier:"}),i.jsxs("span",{className:"ml-1 text-white",children:[jo(Pn),"x"]})]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-[#666]",children:"TP:"}),i.jsxs("span",{className:"ml-1 text-[#67FFBD]",children:[jo(En),"%"]})]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-[#666]",children:"SL:"}),i.jsxs("span",{className:"ml-1 text-[#ff7073]",children:[jo($n),"%"]})]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-[#666]",children:"Market:"}),i.jsx("span",{className:"ml-1 text-white",children:Bn??"-"})]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-[#666]",children:"Coin Idx:"}),i.jsx("span",{className:"ml-1 text-white",children:_r??"-"})]}),fn&&i.jsxs("div",{children:[i.jsx("span",{className:"text-[#666]",children:"Created:"}),i.jsx("span",{className:"ml-1 text-white",children:fn})]})]}),i.jsx("div",{className:"mt-3",children:i.jsx("button",{onClick:()=>tn(Oe.id||Oe.bot_id,bt),disabled:ht[Oe.id||Oe.bot_id]||zt[Oe.id||Oe.bot_id],className:`w-full py-1.5 rounded-lg text-[11px] font-semibold transition-colors ${bt?"bg-[#ff7073] text-black hover:bg-[#ff8a8d]":"bg-[#67FFBD] text-black hover:bg-[#8bffd0]"} disabled:opacity-60 disabled:cursor-not-allowed`,children:ht[Oe.id||Oe.bot_id]?"...":bt?"Stop Bot":"Start Bot"})})]},Oe.id||Oe.bot_id)})})})]})})]})]})})}const Iyn=()=>{const{setTelegramChatId:e,setSubscriberRole:t,setSubsExpireDay:n,setMushboomerETH:r,setIsWhitelist:s,setMushboomerSOL:a,setIsReferralCode:o,setIsReferralCodeName:l,setHyperToken:c,setHyperAddress:u}=m.useContext(Qr);return m.useEffect(()=>{(async()=>{var g,v;const f=window.localStorage.getItem("hyperToken"),x=window.localStorage.getItem("hyperAddress");if(!(!f||!x))try{const w=await Ei(x.toLowerCase(),f);w!=null&&w.success?(e(w==null?void 0:w.telegram_chat_id),t(w==null?void 0:w.subscriber_role),n(w==null?void 0:w.subs_expire_day),r((g=w==null?void 0:w.mushboomer_counts)==null?void 0:g.eth),a((v=w==null?void 0:w.mushboomer_counts)==null?void 0:v.sol),o(w==null?void 0:w.referral_code),l(w==null?void 0:w.refcode),s(w==null?void 0:w.whitelist)):(window.localStorage.removeItem("hyperToken"),window.localStorage.removeItem("hyperAddress"),c(""),u(""))}catch(w){console.error("Token verification error:",w)}})()},[]),i.jsxs(i.Fragment,{children:[i.jsx(So,{children:i.jsxs(Ro,{children:[i.jsx("title",{children:"DCA Bot Calculator | Dollar Cost Averaging Strategy | Dextrabot"}),i.jsx("meta",{name:"description",content:"Calculate your DCA bot strategy for perpetual futures. Plan safety orders, visualize liquidation prices, and optimize your dollar cost averaging strategy."}),i.jsx("meta",{property:"og:title",content:"DCA Bot Calculator | Dollar Cost Averaging Strategy | Dextrabot"}),i.jsx("meta",{property:"og:description",content:"Calculate your DCA bot strategy for perpetual futures. Plan safety orders, visualize liquidation prices, and optimize your dollar cost averaging strategy."}),i.jsx("meta",{property:"og:image",content:"https://app.dextrabot.com/dextrabotIcon.png"}),i.jsx("meta",{property:"og:url",content:"https://app.dextrabot.com/dca-bot"})]})}),i.jsx("div",{style:{minHeight:"calc(100vh - 5rem)"},className:"flex justify-center items-start w-full h-full px-4 pt-6 pb-6 sm:px-6 sm:pt-6 sm:pb-6 bg-[#050505] overflow-auto",children:i.jsx("div",{className:"flex flex-col items-stretch justify-start gap-[26px] w-full max-w-[1400px]",children:i.jsx(Tyn,{})})})]})},aj=({size:e})=>i.jsxs("div",{role:"status",className:"flex justify-center items-center min-h-5 w-[54px] px-2 py-1.5 rounded-md",children:[i.jsxs("svg",{"aria-hidden":"true",className:`${e} inline text-gray-200 animate-spin dark:text-gray-600 fill-[#67FFBD]
`,viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),i.jsx("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]}),i.jsx("span",{className:"sr-only",children:"Loading..."})]}),cD="/assets/subscribeAnimation-oYDBxlRF.mp4",Pyn=()=>{const{setSignModalOpen:e,setTelegramChatId:t,setSubscriberRole:n,setSubsExpireDay:r,setMushboomerETH:s,setMushboomerSOL:a,setIsReferralCode:o,setIsReferralCodeName:l,setIsWhitelist:c,setHyperToken:u,setHyperAddress:d}=m.useContext(Qr),{address:f}=ns(),[x,g]=m.useState(1),[v,w]=m.useState(""),[C,N]=m.useState(""),[P,I]=m.useState(!1),[R,F]=m.useState(!1),[U,L]=m.useState(""),[z,Q]=m.useState(0),[ne,J]=m.useState(0),[X,re]=m.useState(!1),pe=ye=>/^\d*$/.test(ye),Y=ye=>{["e","E","+","-"].includes(ye.key)&&ye.preventDefault()},ie=m.useMemo(()=>{if(x==="")return!1;const ye=Number(x);return Number.isInteger(ye)&&ye>=1},[x]),V=(ye=>{const[ve,je]=ye.split(" "),[Ie,Le,Qe]=ve.split("-").map(Number),[$e,it]=je.split(":").map(Number);return new Date(Date.UTC(Qe,Le-1,Ie,$e-3,it))})("29-11-2025 23:59");m.useState(()=>new Date().getTime()>=V.getTime());const ee=m.useRef(z);m.useEffect(()=>{ee.current=z},[z]);const ae=m.useRef(0);m.useEffect(()=>{ae.current=ne},[ne]);const fe=async()=>{var je,Ie;const ye=window.localStorage.getItem("hyperToken"),ve=window.localStorage.getItem("hyperAddress");if(!(!ye||!ve))try{const Le=await Ei(ve.toLowerCase(),ye);Le!=null&&Le.success?(t(Le==null?void 0:Le.telegram_chat_id),n(Le==null?void 0:Le.subscriber_role),r(Le==null?void 0:Le.subs_expire_day),s((je=Le==null?void 0:Le.mushboomer_counts)==null?void 0:je.eth),a((Ie=Le==null?void 0:Le.mushboomer_counts)==null?void 0:Ie.sol),o(Le==null?void 0:Le.referral_code),l(Le==null?void 0:Le.refcode),c(Le==null?void 0:Le.whitelist),u(ye),d(ve),w(Le==null?void 0:Le.farming_tools),Q(Number((Le==null?void 0:Le.subs_expire_day)||0))):(window.localStorage.removeItem("hyperToken"),window.localStorage.removeItem("hyperAddress"),u(""),d(""))}catch(Le){console.error("Token verification error:",Le),console.error(Le.message||"An unknown error occurred.")}};m.useEffect(()=>{X&&fe()},[X]),m.useEffect(()=>{const ye=localStorage.getItem("hyperToken"),ve=localStorage.getItem("hyperAddress");re(!!(ye&&ve));const je=setInterval(()=>{const Ie=localStorage.getItem("hyperToken"),Le=localStorage.getItem("hyperAddress");re(!!(Ie&&Le))},800);return()=>clearInterval(je)},[]);const Ne=async()=>new Sl(window.ethereum).eth.getAccounts(ve=>ve),he=async(ye="subscribe",ve=24,je=5e3)=>{ve<=0||(await new Promise(Ie=>setTimeout(Ie,je)),await fe(),ye==="subscribe"&&ee.current===ae.current?he(ye,ve-1,je):fe())},ge=async ye=>{const ve=window.localStorage.getItem("hyperToken"),je=window.localStorage.getItem("hyperAddress");if(!ve||!f){e(!0);return}N(""),J(ee.current),ae.current=ee.current,F(!0),I(!0);try{await window.ethereum.request({method:"wallet_switchEthereumChain",params:[{chainId:"0x1"}]})}catch(Qe){console.error("Failed to switch network",Qe),I(!1);return}const Ie=new Sl(window.ethereum);var Le=await Ne();if(Le.length>0?Le=Le[0]:Le=void 0,Le){const $e=ye*.12,it=Ie.utils.toWei($e.toString(),"ether"),tt={from:Le,to:"0xdEAe8586eD227A5096EBae47342fFc1ED99f13F9",value:it};await Ie.eth.sendTransaction(tt).then(lt=>{console.log("txHash :>> ",lt),I(!1),L(lt.transactionHash),fetch("https://dextrabothypev2.nftinit.io/api/hyper/payment/save/",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:f?f.toLowerCase():je,token:ve,payment_tx:lt.transactionHash,payment_role:"farming_tools",tx_qty:Number(x)})}),fe(),he("subscribe")}).catch(lt=>{console.log(lt),lt.code===-32003||lt.message.includes("insufficient funds")?N("Insufficient funds."):lt.message==="MetaMask Tx Signature: User denied transaction signature."&&F(!1)})}else await Ie.eth.requestAccounts()};return window.localStorage.getItem("hyperToken"),i.jsxs(i.Fragment,{children:[i.jsx(bd,{open:R,setOpen:F,transactionHash:U,transactionLoading:P,paymentPresaleRole:!(z<=ne),errorFunds:C,activeMethod:2}),i.jsxs("div",{className:"flex flex-col md:flex-row items-center justify-start md:justify-center md:items-start gap-8 w-full h-screen md:h-full mb-72 md:mb-0",children:[i.jsx("div",{className:"flex justify-center items-start md:items-center w-full h-max md:h-full pl-0 sm:pl-4 md:pl-2",children:i.jsx("div",{className:"flex flex-col gap-2 pt-0 md:pt-7 lg:pt-0",children:i.jsx("div",{className:"flex flex-col items-start justify-start gap-4 md:mb-10 lg:mb-16",children:i.jsxs("div",{className:"flex flex-col gap-3 text-gray-200 text-sm leading-relaxed mt-2 max-w-[600px]",children:[i.jsxs("ul",{className:"space-y-2.5",children:[i.jsxs("li",{className:"flex items-start gap-2",children:[i.jsx("span",{className:"text-lg",children:"🌾"}),i.jsxs("div",{children:[i.jsx("p",{className:"text-base font-semibold text-white",children:"Farm Bot"}),i.jsxs("ul",{className:"text-sm text-gray-400",children:[i.jsx("li",{children:"• Generate volume, earn rewards."}),i.jsx("li",{children:"• Delta neutral = zero directional risk."}),i.jsx("li",{children:"• Safe automated farming."})]})]})]}),i.jsxs("li",{className:"flex items-start gap-2",children:[i.jsx("span",{className:"text-lg",children:"🎯"}),i.jsxs("div",{children:[i.jsx("p",{className:"text-base font-semibold text-white",children:"Grid Bot"}),i.jsxs("ul",{className:"text-sm text-gray-400",children:[i.jsx("li",{children:"• Auto-trade price ranges."}),i.jsx("li",{children:"• Profit from volatility."}),i.jsx("li",{children:"• Built-in risk management."})]})]})]}),i.jsxs("li",{className:"flex items-start gap-2",children:[i.jsx("span",{className:"text-lg",children:"🔄"}),i.jsxs("div",{children:[i.jsx("p",{className:"text-base font-semibold text-white",children:"Copy Trade"}),i.jsxs("ul",{className:"text-sm text-gray-400",children:[i.jsx("li",{children:"• Hyperliquid → Lighter copy trading."}),i.jsx("li",{children:"• Follow top traders automatically."}),i.jsx("li",{children:"• Scale positions to your size."})]})]})]})]}),i.jsx("p",{className:"mt-4 text-gray-300 text-base",children:"👉 Get Dextrabot's complete suite."})]})})})}),i.jsxs("div",{className:"relative mx-1 h-full py-10 hidden md:block",children:[i.jsx("div",{className:"w-[2px] h-full bg-[linear-gradient(to_bottom,rgba(255,140,0,0)_0%,rgba(255,140,0,0.8)_15%,rgba(255,50,150,0.8)_85%,rgba(255,50,150,0)_100%)]"}),i.jsx("div",{className:"absolute inset-0 w-[8px] h-full bg-[linear-gradient(to_bottom,rgba(255,140,0,0)_0%,rgba(255,140,0,0.4)_15%,rgba(255,50,150,0.4)_85%,rgba(255,50,150,0)_100%)] blur-md mx-auto"})]}),i.jsx("div",{className:"flex justify-center items-start md:items-center w-full h-full",children:i.jsxs("div",{className:"flex flex-col items-center gap-4 border border-[#404040] bg-[#141414] rounded-xl px-3 py-7 shadow-[0_0_25px_rgba(255,120,50,0.25)] min-w-[362px]",children:[i.jsx("div",{className:"rounded-lg overflow-hidden",children:i.jsx("video",{src:cD,autoPlay:!0,muted:!0,loop:!0,playsInline:!0,preload:"auto",className:"w-full h-[284px] lg:h-[284px] object-cover"},cD)}),i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex items-center justify-center gap-2",children:[i.jsx("button",{onClick:()=>g(ye=>{const ve=Number(ye||0);return ve>1?String(ve-1):"1"}),className:"w-8 h-8 flex items-center justify-center rounded-md bg-[#242424] border border-[#353535] text-[#bbb] hover:text-white hover:border-[#555] transition-all",children:"–"}),i.jsx("input",{value:x,onChange:ye=>{const ve=ye.target.value.trim();if(ve==="")return g("");pe(ve)&&g(ve)},onKeyDown:Y,inputMode:"numeric",autoComplete:"off",placeholder:"e.g. 10",className:"w-full h-8 text-center rounded-md bg-[#242424] border border-[#353535] text-white text-[13px] font-semibold outline-none placeholder:text-[#7F7F7F]"}),i.jsx("button",{onClick:()=>g(ye=>{const ve=Number(ye||0);return String(ve+1)}),className:"w-8 h-8 flex items-center justify-center rounded-md bg-[#242424] border border-[#353535] text-[#bbb] hover:text-white hover:border-[#555] transition-all",children:"+"})]}),x!==""&&!ie&&i.jsx("div",{className:"text-[#FF797C] text-[12px]",children:"Enter an integer that is at least 1."})]}),ie&&i.jsxs("div",{className:"text-[12px] font-semibold text-green-400",children:[" ",x," months will be added to your subscription."]}),i.jsx("div",{className:"relative flex items-center justify-center gap-3 px-4 py-2 rounded-xl shadow-[0_0_25px_rgba(255,140,0,0.15)] backdrop-blur-md bg-white/5 border border-white/10",children:i.jsxs("span",{className:"text-2xl font-bold bg-gradient-to-r from-orange-400 to-pink-500 bg-clip-text text-transparent",children:[(x*.12).toFixed(2)," ETH"]})}),i.jsx("div",{onClick:ye=>{ye.preventDefault(),ie&&ge(x)},className:`text-[10px] sm:text-xs xl:text-[13px] font-semibold text-gray-200 select-none border rounded-md px-4 py-2 ${ie?"border-[#8861FF] bg-[#7446FF] cursor-pointer":"bg-[#2a2a2a] border-[#3a3a3a] opacity-60 cursor-not-allowed"}`,children:"Buy Now"})]})})]})]})},Fyn=()=>{ns();const{setTelegramChatId:e,setSubscriberRole:t,setSubsExpireDay:n,setMushboomerETH:r,setMushboomerSOL:s,setIsReferralCode:a,setIsReferralCodeName:o,setIsWhitelist:l,setHyperToken:c,setHyperAddress:u}=m.useContext(Qr);return m.useEffect(()=>{(async()=>{var g,v;const f=window.localStorage.getItem("hyperToken"),x=window.localStorage.getItem("hyperAddress");if(!(!f||!x))try{const w=await Ei(x.toLowerCase(),f);w!=null&&w.success?(e(w==null?void 0:w.telegram_chat_id),t(w==null?void 0:w.subscriber_role),n(w==null?void 0:w.subs_expire_day),r((g=w==null?void 0:w.mushboomer_counts)==null?void 0:g.eth),s((v=w==null?void 0:w.mushboomer_counts)==null?void 0:v.sol),a(w==null?void 0:w.referral_code),o(w==null?void 0:w.refcode),l(w==null?void 0:w.whitelist)):(window.localStorage.removeItem("hyperToken"),window.localStorage.removeItem("hyperAddress"),c(""),u(""))}catch(w){console.error("Token verification error:",w),console.error(w.message||"An unknown error occurred.")}})()},[]),i.jsxs(i.Fragment,{children:[i.jsx(So,{children:i.jsxs(Ro,{children:[i.jsx("title",{children:"Dextrabot Subscription"}),i.jsx("meta",{name:"description",content:"Subscribe to Dextrabot and unlock automated trading bots including Farm Bot, Grid Bot, Market Maker and Copy Trade. Smart automation for Hyperliquid & Lighter."}),i.jsx("meta",{name:"og:title",content:"Dextrabot Subscription"}),i.jsx("meta",{name:"og:description",content:"Subscribe to Dextrabot and unlock automated trading bots including Farm Bot, Grid Bot, Market Maker and Copy Trade. Smart automation for Hyperliquid & Lighter."}),i.jsx("meta",{name:"og:image",content:"https://app.dextrabot.com/dextrabotIcon.png"}),i.jsx("meta",{name:"og:url",content:"https://app.dextrabot.com/subscribe"})]})}),i.jsx("div",{className:"flex justify-center items-start w-full h-[calc(100vh-5rem)] min-h-max px-4 pt-4 pb-10 bg-[#161616] md:bg-gradient-to-b from-[#0d0d0d] via-[#1a1a1a] to-[#0d0d0d]",children:i.jsx(Pyn,{})})]})},NWe=({open:e,setOpen:t,makerStatus:n,isStatusWallet:r,info:s,modalLoading:a})=>i.jsxs(Ea,{open:e,onClose:t,className:"relative z-50 font-manrope",children:[i.jsx(ja,{transition:!0,style:{backgroundColor:"rgba(0, 0, 0, 0.48)"},className:"fixed inset-0 transition-opacity data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in"}),i.jsx("div",{className:"fixed inset-0 z-50 w-screen overflow-y-auto",children:i.jsx("div",{className:"flex min-h-full items-end justify-center p-4 text-center sm:items-center sm:p-0",children:i.jsx(xa,{transition:!0,className:"relative transform overflow-hidden bg-[#101010] text-left shadow-xl transition-all data-[closed]:translate-y-4 data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in data-[closed]:sm:translate-y-0 data-[closed]:sm:scale-95 rounded-3xl",children:i.jsx("div",{className:"flex flex-col justify-start items-center gap-8 w-[400px] h-max relative bg-[#252525] rounded-3xl pt-4 pb-6",children:i.jsxs(i.Fragment,{children:[i.jsx("div",{onClick:()=>{t(!1)},className:"cursor-pointer flex w-full items-center justify-end absolute right-2 top-1",children:i.jsx("span",{className:"absolute top-2 right-2 w-9 h-9 rounded-full p-1 flex justify-center items-center hover:bg-[#7535FE]",children:i.jsx("img",{className:"p-1",src:Ba})})}),i.jsx("div",{className:"pt-4",children:i.jsx("img",{src:Gi,alt:"",className:"w-[86px h-[86px]"})}),i.jsxs("div",{className:"flex flex-col justify-start items-center gap-2",children:[i.jsx("div",{className:"w-80 text-center text-white text-2xl font-semibold font-manropeleading-7",children:"Are you sure?"}),i.jsx("div",{className:"w-[348px] text-center text-white/60 text-[16px] font-medium font-manrope leading-5",children:s==="settings"||s==="table"&&(r!=null&&r.isDeleted)?"Do you want to start this Market Maker operation?":"Do you want to stop this Market Maker operation?"})]}),i.jsxs("div",{className:"flex items-center justify-center gap-4",children:[i.jsx("div",{onClick:()=>{t(!1)},className:"h-8 px-4 py-3 rounded-xl shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-white justify-center items-center gap-2.5 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px]",children:"Cancel"})}),i.jsx("div",{onClick:o=>{a||(o.preventDefault(),s==="settings"?n():n(r))},className:`h-8 px-4 rounded-[10px] shadow border flex items-center justify-center cursor-pointer ${a?"bg-[#444] border-[#666] cursor-not-allowed":s==="settings"||s==="table"&&(r!=null&&r.isDeleted)?"bg-[#7445ff] border-[#8860ff]":"bg-[#ff4444] border-[#ff6666]"}`,children:a?i.jsx("span",{className:"text-white text-[13px] animate-pulse",children:"Loading..."}):i.jsx("span",{className:"text-white text-[13px]",children:s==="settings"||s==="table"&&(r!=null&&r.isDeleted)?"Start":"Stop"})})]})]})})})})})]}),Oyn=({fetchInfoOnOpen:e,setIsFilterWallet:t})=>{const[n,r]=m.useState([]),[s,a]=m.useState(""),[o,l]=m.useState(""),[c,u]=m.useState(""),[d,f]=m.useState([]),[x,g]=m.useState([]),[v,w]=m.useState(!1),[C,N]=m.useState(!1),[P,I]=m.useState(!1);m.useState(!1);const[R,F]=m.useState(""),[U,L]=m.useState(!1),[z,Q]=m.useState(null),[ne,J]=m.useState(""),[X,re]=m.useState(!1);m.useState(!1);const[pe,Y]=m.useState([]),[ie,oe]=m.useState("");m.useState("");const[G,V]=m.useState(100),[ee,ae]=m.useState("NEUTRAL"),[fe,Ne]=m.useState("AGGRESSIVE"),[he,ge]=m.useState("");m.useState(""),m.useState("");const[ye,ve]=m.useState(!1),[je,Ie]=m.useState(!1),[Le,Qe]=m.useState(!1),{setSignModalOpen:$e,setTelegramChatId:it,setSubscriberRole:tt,setMushboomerETH:lt,setMushboomerSOL:ft,setIsReferralCode:ut,setIsReferralCodeName:qt,setIsWhitelist:It,setHyperToken:nn,setHyperAddress:jt}=m.useContext(Qr),cn="https://dextrabothypev2.nftinit.io",un="https://api.hyperliquid.xyz/info",Ft={kBONK:"BONK",kPEPE:"PEPE",kSHIB:"SHIB",kFLOKI:"FLOKI",kNEIRO:"NEIRO",kDOGS:"DOGS",kLUNC:"LUNC"};m.useEffect(()=>{async function Mt(){var tn;if(open)try{const Xn=await(await fetch("https://dextrabothypev2.nftinit.io/api/hyper/get_farming_coins/?app=hyper")).json();if(Xn!=null&&Xn.coins){const or=(tn=Xn==null?void 0:Xn.coins)==null?void 0:tn.map(Qt=>{const zn=(Qt==null?void 0:Qt.value)||"",Jn=Ft[zn]||zn,Lt=Jn==="xyz:MSTR"?"":`https://app.hyperliquid.xyz/coins/${Jn}.svg`;return{...Qt,icon:Lt}}),lr=Xn.coins.filter(Qt=>Qt.value.includes(":")).map(Qt=>{const[zn,Jn]=Qt.value.split(":");return Jn});f(or),g(lr)}}catch(In){console.error("Failed to fetch coin list:",In)}}Mt()},[]);const Ke=Mt=>{var tn;return((tn=d.find(In=>In.label===Mt))==null?void 0:tn.maxLeverage)??100},Bt=Mt=>({HL_FEE:15e-5,BUILDER_FEE:2e-4,GROW_RATE:(x==null?void 0:x.includes(Mt))?.1:1}),$t=(Mt,tn)=>{if(!Mt||!tn)return"";const{HL_FEE:In,BUILDER_FEE:Xn,GROW_RATE:or}=Bt(tn);return(Number(Mt)*(In+Xn*or)).toFixed(0)},qe=(Mt,tn)=>{if(!Mt||!tn)return"";const{HL_FEE:In,BUILDER_FEE:Xn,GROW_RATE:or}=Bt(tn);return(Number(Mt)/(In+Xn*or)).toFixed(0)},Ye=Mt=>Mt===""||Mt===null?"":Number(Mt).toLocaleString("en-US"),ht=Mt=>Mt?Mt.replace(/,/g,""):"",Zt=Mt=>{if(Mt==null||Mt==="")return"0.00";const tn=Number(Mt);return Number.isNaN(tn)?"0.00":tn.toLocaleString(void 0,{minimumFractionDigits:2,maximumFractionDigits:2})},zt=Mt=>/^\d*$/.test(Mt),Et=Mt=>/^\d*\.?\d{0,6}$/.test(Mt),nt=Mt=>{["e","E","+","-"].includes(Mt.key)&&Mt.preventDefault()};m.useEffect(()=>{if(!o)return;const Mt=Ke(o),tn=Number(ie);!Number.isNaN(tn)&&tn>Mt&&oe(String(Mt)),!Number.isNaN(tn)&&tn<1&&ie!==""&&oe("1")},[o]);const Ue=m.useMemo(()=>{if(!z||!ie||!he)return"";const Mt=fe==="NORMAL"?.02:fe==="PASSIVE"?.05:.1,tn=Number(z)*Number(ie),In=Number(he)*Mt;return tn>In?"":"Insufficient margin to create order, please increase your margin."},[z,ie,he,fe]),Rt=m.useMemo(()=>{if(ie==="")return!1;const Mt=Number(ie),tn=Ke(o);return Number.isInteger(Mt)&&Mt>=1&&Mt<=tn},[ie,o,d]);m.useEffect(()=>{if(!o)return;const Mt=Ke(o),tn=Number(ie);!Number.isNaN(tn)&&tn>Mt&&oe(String(Mt)),!Number.isNaN(tn)&&tn<1&&ie!==""&&oe("1")},[o]);const We=m.useMemo(()=>{if(G==="")return!1;const Mt=Number(G);return Number.isNaN(Mt)?!1:Mt===0?!0:Mt>=0},[G]),at=m.useMemo(()=>{if(he==="")return!1;const Mt=Number(he);return!Number.isNaN(Mt)&&Mt>0},[he]),mt=m.useMemo(()=>n.map(Mt=>{const tn=(Mt==null?void 0:Mt.wallet_name)??(Mt==null?void 0:Mt.name)??(Mt==null?void 0:Mt.label)??String(Mt==null?void 0:Mt.wallet_id),In=(Mt==null?void 0:Mt.version)===3?`${tn} - (API-AGENT) Wallet`:tn;return{value:(Mt==null?void 0:Mt.wallet_id)??(Mt==null?void 0:Mt.id)??(Mt==null?void 0:Mt.value)??"",label:In,raw:Mt}}),[n]),Dt=m.useMemo(()=>{var Mt;return(Mt=mt.find(tn=>String(tn.value)===String(s)))==null?void 0:Mt.raw},[mt,s]),Tt=m.useMemo(()=>{const Mt=Dt||{};return Mt.address||Mt.evm_address||Mt.wallet_address||Mt.public_address||Mt.eth_address||Mt.addr||null},[Dt]),dn=s!==""&&o!==""&&X&&Rt&&at&&!Ue&&(ee==="LONG"||ee==="SHORT"||ee==="NEUTRAL")&&(fe==="AGGRESSIVE"||fe==="NORMAL"||fe==="PASSIVE");m.useEffect(()=>{const Mt=localStorage.getItem("hyperToken"),tn=localStorage.getItem("hyperAddress");re(!!(Mt&&tn));const In=setInterval(()=>{const Xn=localStorage.getItem("hyperToken"),or=localStorage.getItem("hyperAddress");re(!!(Xn&&or))},800);return()=>clearInterval(In)},[]),m.useEffect(()=>{F(""),X&&Nn()},[X]),m.useEffect(()=>{Tt?on(Tt):(Q(null),J(""),Y([]))},[Tt]),m.useEffect(()=>{X&&(e(),en())},[X]);async function on(Mt){var tn;try{J(""),L(!0),Q(null);const Xn=await(await fetch(un,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"clearinghouseState",user:Mt})})).json();Q((tn=Xn==null?void 0:Xn.marginSummary)==null?void 0:tn.accountValue)}catch(In){J(In.message||"Failed to load USDC balance.")}finally{L(!1)}}function gn(){const Mt=Tt||window.localStorage.getItem("hyperAddress");Mt&&on(Mt)}async function Nn(){try{w(!0);const Mt=window.localStorage.getItem("hyperToken"),tn=window.localStorage.getItem("hyperAddress");if(!Mt||!tn){re(!1),$e(!0);return}const Xn=await(await fetch(`${cn}/api/wallet/confirmed-list`,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:tn.toLowerCase(),token:Mt})})).json();Xn!=null&&Xn.success?r((Xn==null?void 0:Xn.data)||[]):F((Xn==null?void 0:Xn.error_message)||"Failed to load wallets.")}catch(Mt){F(Mt.message||"Wallet list error.")}finally{w(!1)}}async function kn(){if(!X){$e(!0);return}if(dn)try{I(!0),F(""),Qe(!0);const Mt=window.localStorage.getItem("hyperToken"),tn=window.localStorage.getItem("hyperAddress");if(!Mt||!tn){re(!1),$e(!0);return}const In={coin:c,leverage:Number(ie),volume:Number(he),orderBookDepth:1,perOrderPosValue:fe==="PASSIVE"?2:fe==="NORMAL"?5:10,direction:ee,executionMode:fe,budget:Number(G)},Xn={address:tn.toLowerCase(),token:Mt,wallet_id:Number(s),source_market:"hyper",bot_params:In,coin:o},lr=await(await fetch(`${cn}/api/hyper/mmbot/save/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Xn)})).json();lr!=null&&lr.success?(e(),rn.success("Successfully saved.",{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(103, 255, 189, 0.16)",width:"280px",minWidth:"280px",height:"40px",backdropFilter:"blur(16px)"},iconTheme:{primary:"#67FFBD",secondary:"#276047"}})):(F((lr==null?void 0:lr.error_message)||"Start failed."),rn.error((lr==null?void 0:lr.error_message)||"Save failed."))}catch(Mt){F(Mt.message||"An error occurred while saving.")}finally{I(!1),Ie(!1),Qe(!1)}}const yn=32,Vn={control:(Mt,tn)=>({...Mt,backgroundColor:"#242424",borderColor:tn.isFocused?"#67FFBD":"#353535",minHeight:yn,height:yn,boxShadow:"none",cursor:"pointer",alignItems:"center",minWidth:"max-content"}),valueContainer:Mt=>({...Mt,height:yn,paddingTop:0,paddingBottom:0,display:"flex",alignItems:"center"}),indicatorsContainer:Mt=>({...Mt,height:yn}),input:Mt=>({...Mt,color:"#FFFFFF",margin:0,padding:0}),singleValue:Mt=>({...Mt,color:"#FFFFFF",margin:0,lineHeight:"normal",fontSize:"12px",display:"flex",alignItems:"center"}),placeholder:Mt=>({...Mt,color:"#7F7F7F",fontSize:"12px"}),menu:Mt=>({...Mt,backgroundColor:"#242424",border:"1px solid #353535",zIndex:9999}),menuList:Mt=>({...Mt,paddingTop:0,paddingBottom:0,maxHeight:180}),option:(Mt,tn)=>({...Mt,backgroundColor:tn.isFocused?"#2e2e2e":"#242424",color:"#FFFFFF",cursor:"pointer",minHeight:yn,display:"flex",alignItems:"center",fontSize:"12px"}),dropdownIndicator:Mt=>({...Mt,color:"#9B9B9B",paddingTop:4,paddingBottom:4}),indicatorSeparator:Mt=>({...Mt,backgroundColor:"#353535"})},Gn=({max:Mt})=>i.jsxs("span",{className:"inline-flex items-center h-4 px-1.5 py-2 rounded bg-black/40 border border-[#2A2A2A] text-[10px] text-[#CECECE] font-bold",children:[Mt,"x"]}),Dn=()=>i.jsx("div",{className:"px-2 py-0.5 rounded-md bg-[#0f1b1b] text-[#67ffbd] text-[10px] font-semibold",children:"xyz"}),Kn=Mt=>{var In;const tn=x==null?void 0:x.includes(Mt.data.label);return i.jsx(Ca.Option,{...Mt,children:i.jsxs("div",{className:"flex items-center gap-2 px-3",children:[(In=Mt.data)!=null&&In.icon?i.jsx("img",{src:Mt.data.icon,alt:Mt.data.label,className:"w-4 h-4",onError:Xn=>Xn.currentTarget.style.display="none"}):i.jsx("div",{className:"rounded-full w-4 h-4 min-w-4 min-h-4 bg-[#4F4F4F]"}),i.jsx("span",{className:"text-white text-[13px]",children:Mt.data.label}),tn&&i.jsx(Dn,{}),i.jsx(Gn,{max:Mt.data.maxLeverage})]})})},Cn=Mt=>{var In;const tn=x==null?void 0:x.includes(Mt.data.label);return i.jsx(Ca.SingleValue,{...Mt,children:i.jsxs("div",{className:"flex items-center gap-2",children:[(In=Mt.data)!=null&&In.icon?i.jsx("img",{src:Mt.data.icon,alt:Mt.data.label,className:"w-4 h-4",onError:Xn=>Xn.currentTarget.style.display="none"}):i.jsx("div",{className:"rounded-full w-4 h-4 min-w-4 min-h-4 bg-[#4F4F4F]"}),i.jsx("span",{className:"text-white text-[13px]",children:Mt.data.label}),tn&&i.jsx(Dn,{}),i.jsx(Gn,{max:Mt.data.maxLeverage})]})})},sn=(Mt,tn)=>{if(l(Mt),u(tn),G===""&&he===""){V(100),ge(qe(100,Mt));return}if(G===""&&he!==""){V($t(he,Mt));return}if(G!==""&&he===""){ge(qe(G,Mt));return}V($t(he,Mt))},Me=d,en=async()=>{var In,Xn;const Mt=window.localStorage.getItem("hyperToken"),tn=window.localStorage.getItem("hyperAddress");if(!(!Mt||!tn))try{N(!0);const or=await Ei(tn.toLowerCase(),Mt);or!=null&&or.success?(it(or==null?void 0:or.telegram_chat_id),tt(or==null?void 0:or.subscriber_role),lt((In=or==null?void 0:or.mushboomer_counts)==null?void 0:In.eth),ft((Xn=or==null?void 0:or.mushboomer_counts)==null?void 0:Xn.sol),ut(or==null?void 0:or.referral_code),qt(or==null?void 0:or.refcode),It(or==null?void 0:or.whitelist),nn(Mt),jt(tn),N(!1)):(window.localStorage.removeItem("hyperToken"),window.localStorage.removeItem("hyperAddress"),nn(""),jt(""),N(!1))}catch(or){console.error("Token verification error:",or),console.error(or.message||"An unknown error occurred."),N(!1)}},an=Mt=>i.jsxs(Ca.MenuList,{...Mt,children:[i.jsxs("div",{onClick:()=>{Mt.selectProps.setIsGenWalletModal(!0)},className:"mx-2 mt-2 mb-1 px-3 py-2 bg-[#7445ff] hover:bg-[#5834C3] rounded-md text-white text-[13px] font-medium cursor-pointer flex items-center gap-2",children:[i.jsx("span",{className:"text-[18px] leading-none",children:"+"}),"Add Account"]}),i.jsx("div",{className:"h-px bg-[#353535] my-1 mx-2"}),Mt.children]}),Nt=v||P,Yn=!1,xn=Ke(o);return i.jsxs(i.Fragment,{children:[ye&&Na.createPortal(i.jsx("div",{className:"fixed inset-0 z-[999999999]",children:i.jsx(f5,{open:ye,setOpen:ve,handleListRequest:Nn,handlePageChange:()=>{}})}),document.body),i.jsx(NWe,{open:je,setOpen:Ie,makerStatus:kn,isStatusWallet:"",info:"settings",modalLoading:Le}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 gap-4 w-full",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px]",children:"Select Wallet"}),i.jsxs("div",{className:"relative",children:[i.jsx(Cl,{styles:Vn,isDisabled:Nt||v||Yn,isLoading:v,options:mt,components:{MenuList:an},setIsGenWalletModal:ve,value:mt.find(Mt=>String(Mt.value)===String(s))||null,onChange:Mt=>{a((Mt==null?void 0:Mt.value)??""),t((Mt==null?void 0:Mt.value)??"")},placeholder:X?v?"Loading...":"Select":"Connect to select",isSearchable:!0,onMenuOpen:()=>{X||$e(!0)},menuIsOpen:X?void 0:!1}),!X&&i.jsx("button",{type:"button",onClick:()=>$e(!0),className:"absolute inset-0 rounded-md cursor-pointer bg-transparent","aria-label":"Connect to select",title:"Connect"})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px]",children:"Select Coin"}),i.jsx(Cl,{styles:Vn,components:{Option:Kn,SingleValue:Cn},isDisabled:Nt||Yn,options:Me,value:Me.find(Mt=>Mt.label===o)||null,onChange:Mt=>sn((Mt==null?void 0:Mt.label)??"",(Mt==null?void 0:Mt.value)??""),placeholder:"Select",isSearchable:!0})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px]",children:"Leverage"}),i.jsx("input",{value:ie,onChange:Mt=>{const tn=Mt.target.value.trim();if(tn==="")return oe("");zt(tn)&&oe(tn)},onKeyDown:nt,inputMode:"numeric",autoComplete:"off",placeholder:o?`1–${xn}x`:"e.g. 3",className:`w-full h-8 px-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${ie===""?"border-[#353535]":Rt?"border-[#353535] focus:border-[#67FFBD]":"border-[#FF797C]"}`,disabled:Nt||Yn})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px]",children:"Budget"}),i.jsxs("div",{className:"relative",children:[i.jsx("span",{className:"absolute left-2 top-1/2 -translate-y-1/2 text-[#7F7F7F] font-semibold",children:"$"}),i.jsx("input",{value:Ye(G),onChange:Mt=>{let tn=ht(Mt.target.value);if(tn===""){V(""),ge("");return}if(Et(tn)){V(tn);const In=qe(tn,o);ge(In)}},onKeyDown:nt,inputMode:"decimal",autoComplete:"off",placeholder:"e.g. 5",className:`w-full h-8 pl-7 pr-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${G===""?"border-[#353535]":We?"border-[#353535] focus:border-[#67FFBD]":"border-[#FF797C]"}`,disabled:Nt||Yn})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px]",children:"Volume"}),i.jsxs("div",{className:"relative",children:[i.jsx("span",{className:"absolute left-2 top-1/2 -translate-y-1/2 text-[#7F7F7F] font-semibold",children:"$"}),i.jsx("input",{value:Ye(he),onChange:Mt=>{let tn=ht(Mt.target.value);if(tn===""){ge(""),V("");return}if(Et(tn)){ge(tn);const In=$t(tn,o);V(In)}},onKeyDown:nt,inputMode:"decimal",autoComplete:"off",placeholder:"VOLUME",className:`w-full h-8 pl-7 pr-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${he===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:Nt||Yn})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px]",children:"Directional Bias"}),i.jsxs("div",{className:"flex items-center gap-2 md:pr-6 xl:pt-1",children:[i.jsx("div",{"aria-pressed":ee==="SHORT",onClick:()=>ae("SHORT"),className:["inline-flex justify-center items-center gap-1.5 h-6 rounded-[8px] uppercase tracking-wide font-semibold transition-all border w-1/2","text-[8.5px] px-1",Nt||Yn?"cursor-not-allowed":"cursor-pointer",ee==="SHORT"?"bg-[#FF797C] text-black border-[#FF797C] shadow-[0_0_0_3px_rgba(255,121,124,0.25)]":"text-[#FF787B] bg-[#FF797C]/20 border-[#2A2A2A] hover:bg-[#FF797C]/30"].join(" "),children:i.jsx("span",{className:"min-w-max",children:"SHORT"})}),i.jsx("div",{"aria-pressed":ee==="NEUTRAL",onClick:()=>ae("NEUTRAL"),className:["inline-flex justify-center items-center gap-1.5 h-6 rounded-[8px] uppercase tracking-wide font-semibold transition-all border w-1/2","text-[8.5px] px-1",Nt||Yn?"cursor-not-allowed":"cursor-pointer",ee==="NEUTRAL"?"bg-[#3b82f6] text-[#ffffff] border-[#93c5fd] shadow-[0_0_0_3px_rgba(59,130,246,0.3)]":"text-[#3b82f6] bg-[rgba(59,130,246,0.15)] border-[rgba(59,130,246,0.15)] hover:bg-[#2563eb] hover:text-white"].join(" "),children:i.jsx("span",{className:"min-w-max",children:"NEUTRAL"})}),i.jsx("div",{"aria-pressed":ee==="LONG",onClick:()=>ae("LONG"),className:["inline-flex justify-center items-center gap-1.5 h-6 rounded-[8px] uppercase tracking-wide font-semibold transition-all border w-1/2","text-[8.5px] px-1",Nt||Yn?"cursor-not-allowed":"cursor-pointer",ee==="LONG"?"bg-[#67FFBD] text-black border-[#67FFBD] shadow-[0_0_0_3px_rgba(103,255,189,0.25)]":"text-[#67FFBD] bg-[#67FFBD]/15 border-[#2A2A2A] hover:bg-[#67FFBD]/25"].join(" "),children:i.jsx("span",{className:"min-w-max",children:"LONG"})})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px]",children:"Execution Mode"}),i.jsxs("div",{className:"flex items-center gap-3 xl:pt-1",children:[i.jsx("button",{"aria-pressed":fe==="AGGRESSIVE",onClick:()=>Ne("AGGRESSIVE"),className:["inline-flex justify-center items-center gap-1.5 h-6 px-2 rounded-[8px] uppercase tracking-wide text-[8.5px] font-semibold transition-all border w-1/2",Nt||Yn?"cursor-not-allowed":"cursor-pointer",fe==="AGGRESSIVE"?"bg-[#8e643a] text-white border-[#44382C]":"text-[#7C7C7C] bg-transparent border-[#404040] hover:bg-[#404040]/25 hover:text-white"].join(" "),children:i.jsxs("span",{children:["AGGRESSIVE ",fe==="AGGRESSIVE"?" ✓":""]})}),i.jsx("button",{"aria-pressed":fe==="NORMAL",onClick:()=>Ne("NORMAL"),className:["inline-flex justify-center items-center gap-1.5 h-6 px-2 rounded-[8px] uppercase tracking-wide text-[8.5px] font-semibold transition-all border w-1/2",Nt||Yn?"cursor-not-allowed":"cursor-pointer",fe==="NORMAL"?"bg-[#8e643a] text-white border-[#44382C]":"text-[#7C7C7C] bg-transparent border-[#404040] hover:bg-[#404040]/25 hover:text-white"].join(" "),children:i.jsxs("span",{children:["NORMAL ",fe==="NORMAL"?" ✓":""]})}),i.jsx("button",{"aria-pressed":fe==="PASSIVE",onClick:()=>Ne("PASSIVE"),className:["inline-flex justify-center items-center gap-1.5 h-6 px-2 rounded-[8px] uppercase tracking-wide text-[8.5px] font-semibold transition-all border w-1/2",Nt||Yn?"cursor-not-allowed":"cursor-pointer",fe==="PASSIVE"?"bg-[#8e643a] text-white border-[#44382C]":"text-[#7C7C7C] bg-transparent border-[#404040] hover:bg-[#404040]/25 hover:text-white"].join(" "),children:i.jsxs("span",{children:["PASSIVE ",fe==="PASSIVE"?" ✓":""]})})]})]})]}),i.jsxs("div",{className:"flex items-start gap-3 mt-3 pt-3 border-t border-[#353535] bg[rgba(27,27,27,0.32)] rounded-b-3xl w-full",children:[i.jsxs("div",{className:"flex basis-1/2 flex-col gap-1",children:[X&&i.jsxs("div",{className:"text-[12px] text-[#9B9B9B] flex items-center gap-2",children:["Available Perp Balance (USDC):",i.jsx("span",{className:"text-white",children:U?"Loading...":ne?"—":Zt(z??"0")}),i.jsx("div",{onClick:gn,className:"flex justify-center items-center cursor-pointer",title:"Refresh balance",children:i.jsx(jS,{className:`w-4 h-4 ${U?"animate-spin":""}`})})]}),Ue&&i.jsxs("div",{className:"flex justify-start items-center gap-2 text-[12px] text-[#FF797C] bg-[#3b2626] border border-[#ff797c]/30 rounded-md px-3 py-1.5 max-w-[470px]",children:[i.jsx("img",{src:ec,alt:"Dextrabot",className:"w-3.5 min-w-3.5 min-h-3.5 h-3.5"}),i.jsxs("div",{className:"text-[#FF797C] text-[11px] leading-[14px]",children:[Ue+" ",i.jsxs("span",{onClick:()=>window.open("https://docs.dextrabot.com/market-maker-bot/hyperliquid-market-maker-bot#margin-requirements","_blank"),className:"underline cursor-pointer text-[#FF797C] hover:text-white inline-flex items-center gap-1",children:["How it works",i.jsx("img",{src:gm,alt:"Dextrabot",className:"w-2.5 h-2.5"})]})]})]})]}),i.jsx("div",{className:"flex flex-col items-end sm:flex-row sm:justify-end gap-2 sm:gap-4 w-full basis-1/2",children:i.jsx("div",{className:"flex justify-end items-center",children:i.jsx("button",{onClick:()=>{Ie(!0)},disabled:!dn||Nt,className:`flex items-center justify-center h-8 px-6 rounded-[10px] text-[13px] border ${!dn||Nt?"bg-[#2a2a2a] border-[#3a3a3a] opacity-60 cursor-not-allowed":"bg-[#7446FF] border-[#8861FF] hover:bg-[#5834C3] cursor-pointer"}`,children:P?"Loading...":"Start"})})})]})]})},Myn=({isOpen:e,onClose:t,children:n,fullscreen:r=!1,blurBackground:s=!1})=>{const[a,o]=m.useState(e),[l,c]=m.useState(!1);m.useEffect(()=>{if(e)o(!0),requestAnimationFrame(()=>c(!0));else{c(!1);const d=setTimeout(()=>o(!1),300);return()=>clearTimeout(d)}},[e]),m.useEffect(()=>{const d=f=>{f.key==="Escape"&&u()};return a&&(document.body.style.overflow="hidden",document.addEventListener("keydown",d)),()=>{document.body.style.overflow="",document.removeEventListener("keydown",d)}},[a]);const u=()=>{c(!1),setTimeout(()=>{t()},300)};return a?Na.createPortal(i.jsxs("div",{className:`fixed inset-0 z-[100] transition-opacity duration-300 ${l?"opacity-100":"opacity-0"} flex items-center justify-center`,children:[i.jsx("div",{className:`absolute inset-0 ${s?"backdrop-blur-md bg-black/50":"bg-black/50"}`,onClick:u}),i.jsxs("div",{className:`relative bg-[#101010] shadow-lg transform transition-transform duration-300 ${l?"translate-y-0":"translate-y-full"} ${r?"w-screen h-[100dvh] rounded-none p-0":"w-auto max-w-[95vw] max-h-[95vh] rounded-t-[24px] p-2"}`,onClick:d=>d.stopPropagation(),children:[n,i.jsx("div",{className:`absolute ${r?"top-4 right-4 text-white":"top-2 right-4 text-gray-400 hover:text-white"} text-2xl cursor-pointer z-50`,onClick:u,children:"×"})]})]}),document.body):null},Ryn=({data:e,shareModalOpen:t,setShareModalOpen:n})=>{var C,N,P,I,R;const{isReferralCodeName:r}=m.useContext(Qr),[s,a]=m.useState(Va),[o,l]=m.useState(!0),c=m.useRef(null),u=async()=>{if(c.current)try{await document.fonts.ready,await new Promise(L=>setTimeout(L,500));const F=await P1(c.current,{cacheBust:!0,backgroundColor:null,useCORS:!0,style:{transform:"scale(1)",transformOrigin:"top left"}}),U=document.createElement("a");U.href=F,U.download="dextrabot-market-maker.png",document.body.appendChild(U),U.click(),document.body.removeChild(U),rn.success("PNG successfully downloaded!")}catch(F){console.error("Error generating PNG:",F),rn.error("Failed to download PNG.")}},d=async F=>{l(!0);try{const L=await(await fetch(`https://api.allorigins.win/raw?url=${encodeURIComponent(F)}`)).blob();return new Promise((z,Q)=>{const ne=new FileReader;ne.onloadend=()=>z(ne.result),ne.onerror=Q,ne.readAsDataURL(L)})}catch(U){throw console.error("Image conversion failed:",U),U}finally{l(!1)}};m.useEffect(()=>{e!=null&&e.coin&&d(`https://app.hyperliquid.xyz/coins/${e==null?void 0:e.coin}.svg`).then(F=>a(F)).catch(()=>a(Va))},[e]);const f=r||window.localStorage.getItem("refcode")||"",x=f?`https://app.dextrabot.com/referral/${f}`:"",g=e?`I’m market making #${e==null?void 0:e.coin} with Dextrabot on Hyperliquid HIP-3
Low risk. High XP.
Watch me farm the airdrop while everyone sleep.
Volume: $${((N=(C=e==null?void 0:e.bot_params)==null?void 0:C.volume)==null?void 0:N.toLocaleString("en-US"))||0}`:`I’m market making with Dextrabot on Hyperliquid HIP-3
Low risk. High XP.
Watch me farm the airdrop while everyone sleep.`,v=x||"https://app.dextrabot.com/market-maker",w=`https://x.com/intent/post?text=${encodeURIComponent(g)}&url=${encodeURIComponent(v)}`;return i.jsx(i.Fragment,{children:i.jsx(Myn,{isOpen:t,onClose:()=>n(!1),blurBackground:!0,children:i.jsxs("div",{className:"w-[340px] sm:w-[460px] bg-[#101010] rounded-3xl p-6 text-white",children:[i.jsxs("div",{ref:c,className:"bg-gradient-to-b from-[#0c1414] via-[#040707] to-[#040505] rounded-[32px] border border-emerald-500/10 p-5 shadow-[0_0_60px_rgba(0,255,200,0.08)]",children:[i.jsxs("div",{className:"flex items-center justify-between mb-5",children:[i.jsx("p",{className:"text-sm uppercase tracking-[0.3em] text-white/70",children:"Market Maker"}),i.jsxs("div",{className:"flex items-center gap-2 px-3 py-1 rounded-full bg-white/5 border border-white/10",children:[i.jsx("img",{src:_A,alt:"Dextrabot",className:"w-5 h-5 rounded-full"}),i.jsx("span",{className:"text-xs font-semibold tracking-wide",children:"DEXTRABOT"})]})]}),i.jsxs("div",{className:"mt-5 bg-[#05090a] rounded-3xl p-5 text-center border border-white/5",children:[i.jsx("p",{className:"text-xs uppercase tracking-[0.4em] text-white/50",children:"VOLUME"}),i.jsxs("p",{className:"text-4xl font-bold text-[#67FFBD] mt-2",children:["$",(P=e==null?void 0:e.bot_params)!=null&&P.volume?Fs((I=e==null?void 0:e.bot_params)==null?void 0:I.volume):"--"]}),i.jsxs("div",{className:"grid grid-cols-2 gap-3 mt-6 text-left",children:[i.jsxs("div",{className:"bg-white/3 rounded-2xl p-3 border border-white/5",children:[i.jsx("p",{className:"text-[11px] uppercase tracking-wide text-white/50",children:"Coin"}),i.jsxs("p",{className:"text-lg font-semibold text-white mt-1 flex items-center gap-2",children:[o?i.jsxs("div",{role:"status",className:"flex justify-center items-center h-5 min-h-5 w-[34px] px-0.5 py-1.5 rounded-md",children:[i.jsxs("svg",{"aria-hidden":"true",className:"inline w-4 h-4 text-gray-200 animate-spin dark:text-gray-600 fill-[#67FFBD]",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),i.jsx("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]}),i.jsx("span",{className:"sr-only",children:"Loading..."})]}):i.jsx("img",{src:s||Va,alt:"",className:"rounded-full w-8 h-8",onError:F=>ra(F)}),(e==null?void 0:e.coin)||"--"]})]}),i.jsxs("div",{className:"bg-white/3 rounded-2xl p-3 border border-white/5",children:[i.jsx("p",{className:"text-[11px] uppercase tracking-wide text-white/50",children:"Directional Bias"}),i.jsx("p",{className:"text-lg font-semibold text-white mt-1",children:((R=e==null?void 0:e.bot_params)==null?void 0:R.direction)||"--"})]})]})]}),i.jsxs("div",{className:"mt-4 flex items-center justify-between text-[11px] text-white/50",children:[i.jsx("span",{children:"Generated by Dextrabot"}),i.jsx("span",{children:new Date().toLocaleDateString("en-US",{month:"short",day:"numeric"})})]})]}),!e&&i.jsx("p",{className:"text-xs text-white/60 mt-4",children:"An unknown error has occurred."}),i.jsxs("div",{className:"mt-6 space-y-3",children:[i.jsx("button",{onClick:F=>{F.preventDefault(),o||u()},disabled:!e,className:`${o?"cursor-not-allowed":"cursor-pointer"} w-full border border-emerald-400/60 rounded-2xl py-3
text-emerald-300 font-semibold hover:bg-emerald-400/10
transition disabled:opacity-40 disabled:cursor-not-allowed`,children:"Download image"}),i.jsx("a",{href:w,target:"_blank",rel:"noopener noreferrer",className:`w-full block text-center bg-white text-black
font-semibold rounded-2xl py-3 hover:bg-gray-100 transition`,children:"Share on X"})]})]})})})},Lyn=({data:e,setData:t,loading:n,error:r,fetchInfoOnOpen:s,isFilterWallet:a})=>{var $t,qe;m.useContext(Qr);const{isConnected:o,address:l}=ns(),[c,u]=m.useState([]),[d,f]=m.useState(null),[x,g]=m.useState(!1);m.useState(!1);const[v,w]=m.useState(!1),[C,N]=m.useState(!1),[P,I]=m.useState({}),[R,F]=m.useState(!1),[U,L]=m.useState({id:"",walletAddress:"",isDeleted:!1}),[z,Q]=m.useState(!1),[ne,J]=m.useState(""),[X,re]=m.useState([]),[pe,Y]=m.useState([]),[ie,oe]=m.useState([]),[G,V]=m.useState(!1),[ee,ae]=m.useState(!1),[fe,Ne]=m.useState(!1),[he,ge]=m.useState(!1),ye=m.useRef(null),ve=m.useRef(null),je=m.useRef(null),Ie=m.useRef(null),[Le,Qe]=m.useState(!1),$e="tag",[it,tt]=m.useState($e),lt=Ye=>{if(!v){let ht=e;a&&(ht=ht==null?void 0:ht.filter(zt=>String(zt==null?void 0:zt.wallet_id)===String(a)));const Zt=ht==null?void 0:ht.filter(zt=>{var Et,nt,Ue,Rt,We,at,mt,Dt;if(X.length>0){const Tt=X.includes("HyperLiquid")&&(zt==null?void 0:zt.source_market)==="hyper",dn=X.includes("Lighter")&&(zt==null?void 0:zt.source_market)==="lighter";if(!Tt&&!dn)return!1}if(pe.length>0){const Tt=pe.includes("Short")&&((Et=zt==null?void 0:zt.bot_params)==null?void 0:Et.direction)==="SHORT",dn=pe.includes("Neutral")&&((nt=zt==null?void 0:zt.bot_params)==null?void 0:nt.direction)==="NEUTRAL",on=pe.includes("Long")&&((Ue=zt==null?void 0:zt.bot_params)==null?void 0:Ue.direction)==="LONG";if(!Tt&&!dn&&!on)return!1}if(ie.length>0){const Tt=ie.includes("Aggressive")&&((Rt=zt==null?void 0:zt.bot_params)==null?void 0:Rt.executionMode)==="AGGRESSIVE",dn=ie.includes("Normal")&&((We=zt==null?void 0:zt.bot_params)==null?void 0:We.executionMode)==="NORMAL",on=ie.includes("Passive")&&((at=zt==null?void 0:zt.bot_params)==null?void 0:at.executionMode)==="PASSIVE";if(!Tt&&!dn&&!on)return!1}return!(Le&&(zt!=null&&zt.is_deleted)||ne&&!((Dt=(mt=zt==null?void 0:zt.bot_params)==null?void 0:mt.coin)!=null&&Dt.toLowerCase().includes(ne.toLowerCase())))});return Zt==null?void 0:Zt.sort((zt,Et)=>{var Vn,Gn,Dn,Kn,Cn,sn,Me,en,an,Nt,Yn,xn,Mt,tn;const nt=((Gn=(Vn=zt==null?void 0:zt.bot_params)==null?void 0:Vn.coin)==null?void 0:Gn.toUpperCase())||"",Ue=((Kn=(Dn=Et==null?void 0:Et.bot_params)==null?void 0:Dn.coin)==null?void 0:Kn.toUpperCase())||"",Rt=(zt==null?void 0:zt.wallet_id)||0,We=(Et==null?void 0:Et.wallet_id)||0,at=Number(((Cn=zt==null?void 0:zt.bot_params)==null?void 0:Cn.volume)||0),mt=Number(((sn=Et==null?void 0:Et.bot_params)==null?void 0:sn.volume)||0),Dt=Number(((Me=zt==null?void 0:zt.bot_params)==null?void 0:Me.volume)||0),Tt=Number(((en=Et==null?void 0:Et.bot_params)==null?void 0:en.volume)||0),dn=Number(((an=zt==null?void 0:zt.bot_params)==null?void 0:an.volume)||0),on=Number(((Nt=Et==null?void 0:Et.bot_params)==null?void 0:Nt.volume)||0),gn=Number(((Yn=zt==null?void 0:zt.bot_params)==null?void 0:Yn.leverage)||0),Nn=Number(((xn=Et==null?void 0:Et.bot_params)==null?void 0:xn.leverage)||0),kn=Number(((Mt=zt==null?void 0:zt.bot_params)==null?void 0:Mt.budget)||0),yn=Number(((tn=Et==null?void 0:Et.bot_params)==null?void 0:tn.budget)||0);return Ye==="coin"?nt<Ue?-1:nt>Ue?1:0:Ye==="-coin"?nt>Ue?-1:nt<Ue?1:0:Ye==="account"?Rt>We?-1:Rt<We?1:0:Ye==="-account"?Rt<We?-1:Rt>We?1:0:Ye==="volume"?at-mt:Ye==="-volume"?mt-at:Ye==="order"?Dt-Tt:Ye==="-order"?Tt-Dt:Ye==="perOrder"?dn-on:Ye==="-perOrder"?on-dn:Ye==="leverage"?gn-Nn:Ye==="-leverage"?Nn-gn:Ye==="budget"?kn-yn:Ye==="-budget"?yn-kn:0})}return e},ft=m.useRef(null),ut=["Short","Neutral","Long"],qt=["Aggressive","Normal","Passive"],It=Ye=>{Y(ht=>ht.includes(Ye)?ht.filter(Zt=>Zt!==Ye):[...ht,Ye])},nn=Ye=>{oe(ht=>ht.includes(Ye)?ht.filter(Zt=>Zt!==Ye):[...ht,Ye])};m.useEffect(()=>{function Ye(ht){ye.current&&!ye.current.contains(ht.target)&&ae(!1),ve.current&&!ve.current.contains(ht.target)&&Ne(!1),Ie.current&&!Ie.current.contains(ht.target)&&ge(!1),je.current&&!je.current.contains(ht.target)&&V(!1)}return document.addEventListener("mousedown",Ye),()=>document.removeEventListener("mousedown",Ye)},[]);const jt=async({id:Ye,walletAddress:ht,isDeleted:Zt})=>{try{const zt=window.localStorage.getItem("hyperToken"),Et=window.localStorage.getItem("hyperAddress");if(!zt||!Et||!Ye){rn.error("Something went wrong!");return}Q(!0),ht&&I(at=>({...at,[ht]:!0}));const nt="https://dextrabothypev2.nftinit.io/api/hyper/mmbot/update/",Ue={is_deleted:!Zt},We=await(await fetch(nt,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:l?l.toLowerCase():Et,token:zt,bot_id:Number(Ye),update_params:Ue})})).json();We.success?(t((We==null?void 0:We.data)||[]),rn.success("Action completed successfully.")):rn.error(We.error_message),F(!1)}catch{rn.error("Something went wrong")}finally{Q(!1),I(zt=>({...zt,[ht]:!1}))}},cn=async()=>{try{const Ye=window.localStorage.getItem("hyperToken"),ht=window.localStorage.getItem("hyperAddress");if(!Ye||!ht)return;const Et=await(await fetch("https://dextrabothypev2.nftinit.io/api/hyper/mmbot/feed/",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:l?l.toLowerCase():ht,token:Ye})})).json();Et.success&&u((Et==null?void 0:Et.data)||[])}catch(Ye){rn.error(Ye.message||"Something went wrong")}finally{}};m.useEffect(()=>{cn();const Ye=setInterval(()=>{cn()},15e3);return()=>clearInterval(Ye)},[e]);const un=m.useMemo(()=>{const Ye={};return c==null||c.forEach(ht=>{ht!=null&&ht.id&&(Ye[ht.id]=ht.bot_params)}),Ye},[c]);m.useEffect(()=>{const Ye=localStorage.getItem("hyperToken"),ht=localStorage.getItem("hyperAddress");N(!!(Ye&&ht));const Zt=setInterval(()=>{const zt=localStorage.getItem("hyperToken"),Et=localStorage.getItem("hyperAddress");N(!!(zt&&Et))},800);return()=>clearInterval(Zt)},[]);const Ft={started:{label:"Started",color:"text-[#67FFBD]"},stopped:{label:"Stopped",color:"text-[#FF7173]"},completed:{label:"Completed",color:"text-[#F5D97A]"},forced_stopped:{label:"Stopped",color:"text-[#FF9E57]"}},Ke=()=>i.jsx(jS,{className:"w-4 h-4 text-yellow-400"}),Bt={kBONK:"BONK",kPEPE:"PEPE",kSHIB:"SHIB",kFLOKI:"FLOKI",kNEIRO:"NEIRO",kDOGS:"DOGS",kLUNC:"LUNC"};return i.jsxs(i.Fragment,{children:[i.jsx(NWe,{open:R,setOpen:F,makerStatus:jt,isStatusWallet:U,info:"table",modalLoading:z}),i.jsx(Ryn,{data:d,shareModalOpen:x,setShareModalOpen:g}),i.jsxs("div",{className:"flex flex-col items-stretch justify-start gap-[17px] text-white w-full font-manrope",children:[i.jsx("div",{className:"flex flex-col items-start justify-start gap-2 font-manrope max-w-full w-full pl-2 sm:pl-0 pt-2",children:i.jsxs("div",{className:"flex items-center justify-between gap-4 w-full px-2 sm:px-3",children:[i.jsx("div",{className:"text-white text-lg font-medium font-manrope leading-[21px]",children:"History"}),i.jsxs("label",{onClick:()=>Qe(!Le),className:"flex items-center gap-2 p-[3px] px-1 h-6 relative rounded cursor-pointer text-white text-[13px] font-semibold font-manrope",children:[i.jsx("div",{className:`w-[18px] h-[18px] flex items-center justify-center border ${Le?"bg-[#3ec78c] border-[#3ec78c]":"border-[#9d9d9d]"} rounded`,children:Le&&i.jsx("img",{src:Yc,alt:"",className:"w-[8.5px] h-[5.6px] ml-[1px]"})}),"Active Only"]})]})}),i.jsx("div",{className:"relative w-full h-full",children:i.jsx("div",{className:"w-full h-full max-h-[540px] overflow-x-scroll relative overflow-y-scroll flex-grow",ref:ft,children:i.jsxs("table",{className:"w-full relative mb-20",children:[i.jsx("thead",{className:"sticky top-0 z-[3] bg-[#090909] whitespace-nowrap",children:i.jsxs("tr",{className:"w-full z-[4] text-[#9b9b9b] text-[13px] font-semibold font-manrope leading-[13px] tracking-tight",children:[i.jsx("th",{scope:"col",className:"font-medium sm:sticky bg-[#090909] sm:left-0 h-8 pl-3 min-w-[120px] sm:min-w-[120px] z-[8] relative",children:i.jsxs("div",{className:"flex items-center justify-start w-full min-w-max sticky left-0 h-8",children:[i.jsx(hi,{title:"Coin",sortKey:"coin",sortOption:it,setSortOption:tt,isFilterIcon:!1}),i.jsxs("div",{className:"flex items-center justify-start",children:[i.jsx("button",{onClick:()=>V(!G),className:`${ne?"bg-gray-900":"bg-[#555555]"} inline-flex items-center p-1 rounded hover:bg-gray-700 focus:outline-none focus:ring-0 border-none`,children:i.jsx($f,{className:`w-4 h-4 ${ne?"text-blue-500":"text-white"}`})}),G&&i.jsxs("div",{ref:je,className:"absolute left-[58px] mt-32 w-[208px] bg-[#222] border border-gray-700 rounded shadow-lg p-2 z-10",children:[i.jsxs("div",{className:"flex justify-between items-center px-2 pb-2 border-b border-gray-600",children:[i.jsx("span",{className:"text-white text-sm font-semibold",children:"Filter"}),i.jsx("div",{onClick:()=>J(""),className:"h-5 px-2 py-1.5 bg-[#3d3d3d] rounded-md justify-start items-center gap-2 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-[#cdcdcd] text-[11px] font-semibold font-manrope leading-[8px] pointer-events-none",children:"Clear All"})})]}),i.jsx("input",{type:"text",value:ne,onChange:Ye=>J(Ye.target.value),className:"bg-[#333] rounded text-white py-1 px-2 text-sm outline-none mt-2 placeholder:text-sm placeholder:font-semibold placeholder:font-manrope placeholder:text-[#7c7c7c]",placeholder:"Coin"})]})]})]})}),i.jsx("th",{scope:"col",className:"font-medium sm:sticky bg-[#090909] left-[120px] h-8 px-1 min-w-[130px] z-[8] relative",children:i.jsx("div",{className:"flex items-center justify-start w-full min-w-max h-8",children:i.jsx("div",{className:"flex items-center justify-start",children:"Account"})})}),i.jsx("th",{scope:"col",className:"font-medium bg-[#090909] h-8 px-1 min-w-[100px] z-[7]",children:i.jsx("div",{className:"flex items-center justify-start w-full min-w-max h-8",children:i.jsx(hi,{title:"Leverage",sortKey:"leverage",sortOption:it,setSortOption:tt,isFilterIcon:!1})})}),i.jsx("th",{scope:"col",className:"bg-[#090909] h-10 px-1 min-w-[110px] z-[7]",children:i.jsx(hi,{title:"Volume",sortKey:"volume",sortOption:it,setSortOption:tt,isFilterIcon:!1})}),i.jsx("th",{scope:"col",className:"bg-[#090909] h-10 px-1 min-w-[120px] z-[8]",children:i.jsx(hi,{title:"Budget",sortKey:"budget",sortOption:it,setSortOption:tt,isFilterIcon:!1})}),i.jsx("th",{scope:"col",className:"bg-[#090909] h-10 px-1 min-w-[120px] z-[7] relative",children:i.jsxs("div",{className:"flex items-center justify-start w-full min-w-max h-8",children:[i.jsx("div",{className:"flex items-center justify-start",children:"Direction"}),i.jsxs("div",{className:"flex items-center justify-start",children:[i.jsx("button",{onClick:()=>Ne(!fe),className:`${pe.length>0?"bg-gray-900":"bg-[#555555]"} ml-2 inline-flex items-center p-1 rounded hover:bg-gray-700 focus:outline-none focus:ring-0 border-none`,children:i.jsx($f,{className:`w-4 h-4 ${pe.length>0?"text-blue-500":"text-white"}`})}),fe&&i.jsxs("div",{ref:ve,className:`absolute left-[58px] mt-44 w-[208px]
bg-[#222] border border-gray-700 rounded shadow-lg p-2 z-10`,children:[i.jsxs("div",{className:"flex justify-between items-center px-2 pb-2 border-b border-gray-600",children:[i.jsx("span",{className:"text-white text-sm font-semibold",children:"Filter"}),i.jsx("div",{onClick:()=>Y(""),className:"h-5 px-2 py-1.5 bg-[#3d3d3d] rounded-md justify-start items-center gap-2 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-[#cdcdcd] text-[11px] font-semibold font-manrope leading-[8px] pointer-events-none",children:"Clear All"})})]}),ut==null?void 0:ut.map(Ye=>i.jsxs("label",{className:"flex items-center gap-2 p-[7px] h-6 relative rounded hover:bg-[#464646] cursor-pointer text-white text-[13px] font-semibold font-manrope leading-[8px] mt-2",children:[i.jsx("input",{type:"checkbox",checked:pe.includes(Ye),onChange:()=>It(Ye),className:"mr-2 bg-[#3b3b3b] hidden "}),i.jsx("div",{className:`w-4 h-4 max-w-4 max-h-4 flex items-center justify-center border ${pe.includes(Ye)?"bg-[#3ec78c] border-[#3ec78c]":"border-[#9d9d9d]"} w-[18px] h-[18px] relative rounded border`,children:pe.includes(Ye)&&i.jsx("img",{src:Yc,alt:"",className:"w-[8.50px] h-[5.66px] ml-[1px]"})}),Ye]},Ye))]})]})]})}),i.jsx("th",{scope:"col",className:"bg-[#090909] h-10 px-1 min-w-[150px] z-[6] relative",children:i.jsxs("div",{className:"flex items-center justify-start w-full min-w-max h-8",children:[i.jsx("div",{className:"flex items-center justify-start",children:"Execution Mode"}),i.jsxs("div",{className:"flex items-center justify-start",children:[i.jsx("button",{onClick:()=>ge(!he),className:`${ie.length>0?"bg-gray-900":"bg-[#555555]"} ml-2 inline-flex items-center p-1 rounded hover:bg-gray-700 focus:outline-none focus:ring-0 border-none`,children:i.jsx($f,{className:`w-4 h-4 ${ie.length>0?"text-blue-500":"text-white"}`})}),he&&i.jsxs("div",{ref:Ie,className:`absolute left-[58px] mt-44 w-[208px]
bg-[#222] border border-gray-700 rounded shadow-lg p-2 z-10`,children:[i.jsxs("div",{className:"flex justify-between items-center px-2 pb-2 border-b border-gray-600",children:[i.jsx("span",{className:"text-white text-sm font-semibold",children:"Filter"}),i.jsx("div",{onClick:()=>oe(""),className:"h-5 px-2 py-1.5 bg-[#3d3d3d] rounded-md justify-start items-center gap-2 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-[#cdcdcd] text-[11px] font-semibold font-manrope leading-[8px] pointer-events-none",children:"Clear All"})})]}),qt==null?void 0:qt.map(Ye=>i.jsxs("label",{className:"flex items-center gap-2 p-[7px] h-6 relative rounded hover:bg-[#464646] cursor-pointer text-white text-[13px] font-semibold font-manrope leading-[8px] mt-2",children:[i.jsx("input",{type:"checkbox",checked:ie.includes(Ye),onChange:()=>nn(Ye),className:"mr-2 bg-[#3b3b3b] hidden "}),i.jsx("div",{className:`w-4 h-4 max-w-4 max-h-4 flex items-center justify-center border ${ie.includes(Ye)?"bg-[#3ec78c] border-[#3ec78c]":"border-[#9d9d9d]"} w-[18px] h-[18px] relative rounded border`,children:ie.includes(Ye)&&i.jsx("img",{src:Yc,alt:"",className:"w-[8.50px] h-[5.66px] ml-[1px]"})}),Ye]},Ye))]})]})]})}),i.jsx("th",{scope:"col",className:"min-w-[90px] px-1",children:i.jsx("div",{className:"flex items-center justify-start gap-1 min-w-max font-manrope",children:i.jsx("div",{className:"flex items-center justify-start group",children:"Process"})})}),i.jsx("th",{scope:"col",className:"min-w-[90px] px-1",children:i.jsx("div",{className:"flex items-center justify-start gap-1 min-w-max font-manrope",children:i.jsx("div",{className:"flex items-center justify-start group",children:"Status"})})}),i.jsx("th",{scope:"col",className:"min-w-[60px] px-1",children:i.jsx("div",{className:"flex items-center justify-center gap-1 min-w-max font-manrope",children:i.jsx("div",{className:"flex items-center justify-end group",children:"Actions"})})}),i.jsx("th",{scope:"col",className:"min-w-[60px] pl-1 pr-4",children:i.jsx("div",{className:"flex items-center justify-center gap-1 min-w-max font-manrope",children:i.jsx("div",{className:"flex items-center justify-end group"})})})]})}),i.jsx("tbody",{children:C?!e||n?i.jsx("tr",{className:"text-center w-full h-full",children:i.jsx("td",{colSpan:10,children:i.jsx("div",{className:"flex min-h-[66vh] flex-col justify-center items-center -mt-16 ml-[45%] w-max",children:i.jsx(Da,{})})})}):r&&!e?i.jsx("tr",{className:"text-center w-full h-full",children:i.jsx("td",{colSpan:10,children:i.jsx("div",{className:"flex min-h-[66vh] flex-col justify-center items-center ml-[33%] w-max",children:i.jsx(zl,{})})})}):(($t=lt(it))==null?void 0:$t.length)==0?i.jsx("tr",{className:"text-center w-full h-full",children:i.jsx("td",{colSpan:10,children:i.jsx("div",{className:`${(e==null?void 0:e.length)==0?"ml-[33%]":"ml-[40%]"} flex min-h-[44vh] h-66 flex-col justify-center items-center w-max`,children:i.jsx("div",{className:"flex items-center justify-center gap-4 px-4 py-2 flex-col",children:i.jsxs("div",{className:"flex flex-col justify-center items-center gap-3 -ml-16 md:-ml-0",children:[i.jsx("img",{src:ac,alt:""}),(e==null?void 0:e.length)==0?i.jsx("div",{className:"flex flex-col items-center h-max gap-3",children:i.jsx("div",{className:"text-[#d3d3d3] text-sm font-semibold font-manrope leading-[8px] pt-3",children:"You do not have any recorded transactions yet."})}):i.jsx("div",{className:"flex flex-col items-center h-max gap-3",children:i.jsx("div",{className:"text-[#d3d3d3] text-sm font-semibold font-manrope leading-[8px] pt-3",children:"No results match your filters."})})]})})})})}):(qe=lt(it))==null?void 0:qe.map((Ye,ht)=>{var Dt,Tt,dn,on,gn,Nn,kn,yn,Vn,Gn,Dn,Kn,Cn,sn;const Zt=!!(Ye!=null&&Ye.is_deleted),zt=Zt?"bg-[#3c1518]/70 border-[#ff6b6b]/60 text-[#ffd4d1] hover:bg-[#571f24]/80":"bg-[#123424]/70 border-[#2bd27c]/50 text-[#9cf7cb] hover:bg-[#185134]/80",Et=un[Ye==null?void 0:Ye.id]||{},nt=(Et==null?void 0:Et.status)||(Ye!=null&&Ye.is_deleted?"completed":"started"),Ue=Ft[nt],Rt=nt==="completed",We=Rt?"↻":Zt?"▶":"⏹",at=Et!=null&&Et.volume_usd?Et.current_volume/Et.volume_usd*100:0,mt=Math.min(100,Math.max(0,at));return i.jsxs("tr",{className:`relative group hover:bg-[#151515] h-[56px] border-b border-white/5 text-white transition-opacity ${Zt?"opacity-60":"opacity-100"}`,children:[i.jsx("td",{scope:"row",className:`${ht%2==0,"bg-[#151515]"} sm:sticky sm:left-0 z-[2] group-hover:bg-[#222222]`,children:i.jsx("div",{className:"group-hover:bg-[#222222] flex justify-start items-center gap-2.5 pl-2 h-14 max-h-14",children:i.jsx("div",{onClick:()=>{window.open(`/terminal/${Ye==null?void 0:Ye.coin}`,"_blank")},className:"group-hover:bg-[#222222] flex justify-start items-center gap-2 pl-1.5 sm:pl-1.5 h-8 max-h-14 rounded-2xl cursor-pointer",children:i.jsxs("div",{className:"flex justify-start items-center gap-1.5",children:[i.jsx("div",{className:"w-5 h-5 rounded-full",children:i.jsx("img",{src:`https://app.hyperliquid.xyz/coins/${Bt[(Dt=Ye==null?void 0:Ye.bot_params)==null?void 0:Dt.coin]||((dn=(Tt=Ye==null?void 0:Ye.bot_params)==null?void 0:Tt.coin)==null?void 0:dn.split("/")[0])}.svg`||Va,alt:(on=Ye==null?void 0:Ye.bot_params)==null?void 0:on.coin,className:"rounded-full w-5 h-5 min-w-5 min-h-5",loading:"lazy",onError:Me=>ra(Me)})}),i.jsx("div",{className:"text-white text-sm font-semibold font-manrope leading-[13px] tracking-[0.18px]",children:i.jsx("div",{className:"flex justify-start items-center gap-1",children:(()=>{var Yn;const Me=((Yn=Ye==null?void 0:Ye.bot_params)==null?void 0:Yn.coin)||"",en=Me.includes(":"),an=en?Me.split(":")[1]:Me,Nt=en?Me.split(":")[0]:null;return i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"text-white text-sm font-semibold",children:an}),Nt&&i.jsx("span",{className:"text-[8px] bg-[#233] text-[#67FFBD] px-1 py-[0.5px] rounded-md w-fit mt-[1px]",children:Nt})]})})()})})]})})})}),i.jsx("td",{scope:"row",className:`${ht%2==0,"bg-[#151515]"} sm:sticky left-[120px] z-[2] group-hover:bg-[#222222]`,children:i.jsx("div",{className:"group-hover:bg-[#222222] flex justify-start items-center gap-2 pl-0.5 h-14 max-h-14",children:i.jsx("div",{className:"flex justify-start items-center gap-1.5 text-sm font-semibold font-manrope leading-[13px] tracking-[0.28px]",children:(Ye==null?void 0:Ye.source_market)==="lighter"?i.jsx(mi,{content:"Lighter",children:i.jsxs("div",{className:"flex justify-start items-center gap-1",children:[i.jsx(Xf,{className:"w-4 h-4 text-[#fff]"}),i.jsx("p",{children:Ye==null?void 0:Ye.wm_name})]})}):(Ye==null?void 0:Ye.source_market)==="hyper"?i.jsx("div",{className:"flex justify-start items-center gap-1",children:i.jsx(mi,{content:"Hyperliquid",children:i.jsxs("div",{className:"flex justify-start items-center gap-1",children:[i.jsx("img",{src:dx,alt:"",className:"w-4 h-4 text-[#fff]"}),i.jsx("p",{children:Ye==null?void 0:Ye.wm_name})]})})}):i.jsx("div",{className:"flex justify-start items-center gap-1",children:i.jsx(mi,{content:"Dextrabot",children:i.jsxs("div",{className:"flex justify-start items-center gap-1",children:[i.jsx("img",{src:Gi,alt:"",className:"w-4 h-4 text-[#fff]"}),i.jsx("p",{children:Ye==null?void 0:Ye.wm_name})]})})})})})}),i.jsx("td",{scope:"row",className:`${ht%2==0,"bg-[#151515]"} z-[2] group-hover:bg-[#222222]`,children:i.jsx("div",{className:"group-hover:bg-[#222222] flex justify-start items-center gap-2 pl-5 h-14 max-h-14",children:i.jsx("div",{className:"flex justify-start items-center gap-1.5",children:i.jsx(aa,{info1:(gn=Ye==null?void 0:Ye.bot_params)!=null&&gn.leverage?`${(Nn=Ye==null?void 0:Ye.bot_params)==null?void 0:Nn.leverage}x`:"--",info1_Color:"text-white",rowTwo:!1})})})}),i.jsx("td",{scope:"row",className:`${ht%2==0,"bg-[#161616]"} z-[1] group-hover:bg-[#222222]`,children:i.jsx("div",{className:"group-hover:bg-[#222222] flex justify-start items-center gap-4 min-h-[56px]",children:i.jsx("div",{className:"group-hover:bg-[#222222] flex justify-start items-center gap-2 h-16 max-h-16",children:i.jsx("div",{className:"flex justify-start items-center gap-1.5 has-tooltip relative",children:i.jsx(aa,{info1:(kn=Ye==null?void 0:Ye.bot_params)!=null&&kn.volume?`$${(Vn=(yn=Ye==null?void 0:Ye.bot_params)==null?void 0:yn.volume)==null?void 0:Vn.toLocaleString("en-US")}`:"--",info1_Color:"text-white",rowTwo:!1})})})})}),i.jsx("td",{scope:"row",className:`${ht%2==0,"bg-[#161616]"} z-[2] group-hover:bg-[#222222]`,children:i.jsx("div",{className:"group-hover:bg-[#222222] flex justify-start items-center gap-4 min-h-[56px]",children:i.jsx("div",{className:"group-hover:bg-[#222222] flex justify-start items-center gap-2 h-16 max-h-16",children:i.jsx("div",{className:"flex justify-start items-center gap-1.5",children:i.jsx(aa,{info1:(Gn=Ye==null?void 0:Ye.bot_params)!=null&&Gn.budget?`$${(Kn=(Dn=Ye==null?void 0:Ye.bot_params)==null?void 0:Dn.budget)==null?void 0:Kn.toLocaleString("en-US")}`:"--",info1_Color:"text-white",rowTwo:!1})})})})}),i.jsx("td",{scope:"row",className:`${ht%2==0,"bg-[#161616]"} z-[2] group-hover:bg-[#222222]`,children:i.jsx("div",{className:"group-hover:bg-[#222222] flex justify-start items-center gap-4 min-h-[56px]",children:i.jsx("div",{className:"group-hover:bg-[#222222] flex justify-start items-center gap-2 h-16 max-h-16",children:i.jsx("div",{className:"flex justify-start items-center gap-1.5",children:i.jsx(aa,{info1:(Cn=Ye==null?void 0:Ye.bot_params)==null?void 0:Cn.direction,info1_Color:"text-white",rowTwo:!1})})})})}),i.jsx("td",{scope:"row",className:`${ht%2==0,"bg-[#161616]"} z-[2] group-hover:bg-[#222222]`,children:i.jsx("div",{className:"group-hover:bg-[#222222] flex justify-start items-center gap-4 min-h-[56px]",children:i.jsx("div",{className:"group-hover:bg-[#222222] flex justify-start items-center gap-2 h-16 max-h-16",children:i.jsx("div",{className:"flex justify-start items-center gap-1.5",children:i.jsx(aa,{info1:(sn=Ye==null?void 0:Ye.bot_params)==null?void 0:sn.executionMode,info1_Color:"text-white",rowTwo:!1})})})})}),i.jsx("td",{scope:"row",className:`${ht%2==0,"bg-[#161616]"} z-[2] group-hover:bg-[#222222]`,children:i.jsx("div",{className:"group-hover:bg-[#222222] flex justify-start items-center gap-4 min-h-[56px]",children:i.jsx("div",{className:"group-hover:bg-[#222222] flex justify-start items-center gap-2 h-16 max-h-16",children:i.jsx("div",{className:"flex justify-start items-center gap-1.5",children:i.jsx("div",{className:"w-16",children:i.jsxs("div",{className:"w-full h-5 rounded-md relative overflow-hidden",style:{backgroundColor:mt>=100?"rgba(40, 180, 40, 0.25)":"rgba(255, 170, 60, 0.15)"},children:[i.jsx("div",{className:"h-full transition-all duration-300",style:{width:`${mt||0}%`,backgroundColor:mt>=100?"#3ec78c":"#d68b38"}}),i.jsxs("div",{className:"absolute inset-0 flex items-center justify-center text-[10px] font-bold",style:{color:mt>=100?"#d0ffd9":"#ffcb8a"},children:[mt?mt.toFixed(0):"0","%"]})]})})})})})}),i.jsx("td",{scope:"row",className:`${ht%2==0,"bg-[#161616]"} z-[2] group-hover:bg-[#222222]`,children:i.jsx("div",{className:"group-hover:bg-[#222222] flex justify-start items-center gap-4 min-h-[56px]",children:i.jsx("div",{className:"group-hover:bg-[#222222] flex justify-start items-center gap-2 h-16 max-h-16",children:i.jsx("div",{className:"flex justify-start items-center gap-1.5",children:i.jsx(aa,{info1:Ue==null?void 0:Ue.label,info1_Color:Ue==null?void 0:Ue.color,rowTwo:!1})})})})}),i.jsx("td",{className:`${ht%2==0,"bg-[#161616]"} z-[2] group-hover:bg-[#222222]`,children:i.jsx("div",{className:"pl-1 flex flex-col items-end gap-2 font-manrope",children:P[Ye.wallet_address]?i.jsxs("div",{role:"status",className:"flex justify-center items-center h-5 min-h-5 w-[54px] px-2 py-1.5 rounded-md",children:[i.jsxs("svg",{"aria-hidden":"true",className:"inline w-4 h-4 text-gray-200 animate-spin dark:text-gray-600 fill-[#67FFBD]",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),i.jsx("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]}),i.jsx("span",{className:"sr-only",children:"Loading..."})]}):i.jsx("div",{onClick:()=>{L({id:Number(Ye==null?void 0:Ye.id),walletAddress:Ye==null?void 0:Ye.wm_address,isDeleted:Rt?!0:Ye==null?void 0:Ye.is_deleted}),F(!0)},className:`h-7 px-3 w-[42px] rounded-md border justify-center items-center gap-2 inline-flex cursor-pointer transition ${Rt?"bg-[#2d2d2d] border-[#444]":zt}`,title:We,children:i.jsx("div",{className:"text-[11px] font-semibold font-manrope leading-[8px] tracking-tight",children:Rt?i.jsx(Ke,{}):i.jsx("div",{className:"text-[11px] font-semibold font-manrope leading-[8px] tracking-tight",children:We})})})})}),i.jsx("td",{className:`${ht%2==0,"bg-[#161616]"} z-[2] group-hover:bg-[#222222] pr-4`,children:i.jsx("div",{onClick:()=>{f(Ye),g(!0)},className:"pl-1 flex flex-col items-end gap-2 font-manrope cursor-pointer",children:i.jsx(Iet,{className:"w-5 h-5 text-white"})})})]},ht)}):i.jsx("tr",{className:"text-center w-full h-full",children:i.jsx("td",{colSpan:10,children:i.jsx("div",{className:"flex min-h-[44vh] h-66 flex-col justify-center items-center ml-[33%] w-max",children:i.jsx("div",{className:"flex items-center justify-center gap-4 px-4 py-2 flex-col",children:i.jsxs("div",{className:"flex flex-col justify-center items-center gap-3 -ml-16 md:-ml-0",children:[i.jsx("img",{src:ac,alt:""}),i.jsx("div",{className:"flex flex-col items-center h-max gap-3",children:i.jsx("div",{className:"text-[#d3d3d3] text-sm font-semibold font-manrope leading-[8px] pt-3",children:"View your recorded transactions by connecting your wallet."})})]})})})})})})]})})})]})]})},Dyn="https://dextrabothypev2.nftinit.io",Byn=()=>{const[e,t]=m.useState(!1),[n,r]=m.useState([]),[s,a]=m.useState(""),[o,l]=m.useState("");async function c(){try{t(!0);const u=window.localStorage.getItem("hyperToken"),d=window.localStorage.getItem("hyperAddress");if(!u||!d)return;const x=await(await fetch(`${Dyn}/api/hyper/mmbot/list/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({address:d.toLowerCase(),token:u})})).json();x!=null&&x.success?r((x==null?void 0:x.data)||[]):(r([]),a((x==null?void 0:x.error_message)||"Failed to load info."))}catch(u){a(u.message||"Wallet list error.")}finally{t(!1)}}return i.jsxs("div",{className:"relative text-white overflow-hidden overscroll-none bg-[#050505]",children:[i.jsxs("div",{className:"pointer-events-none absolute inset-0",children:[i.jsx("div",{className:"absolute inset-0 opacity-60",style:{background:"radial-gradient(1200px 800px at 10% 0%, rgba(103,255,189,0.12), transparent 55%), radial-gradient(900px 900px at 90% 100%, rgba(96,93,255,0.12), transparent 55%)"}}),i.jsx("div",{className:"absolute inset-0 opacity-[0.08]",style:{background:"repeating-linear-gradient(90deg, rgba(255,255,255,0.08) 0, rgba(255,255,255,0.08) 1px, transparent 1px, transparent 120px)"}})]}),i.jsxs("div",{className:"relative mx-auto flex w-full flex-col gap-10 px-4 pb-16 pt-10 sm:px-6 lg:px-0",style:{fontFamily:"Manrope, ui-sans-serif"},children:[i.jsxs("div",{className:"relative mx-auto flex w-full flex-col gap-10 max-w-6xl",children:[i.jsx("div",{className:"absolute right-2 -top-11 text-xs font-semibold text-[#7C7C7C] mt-2",children:i.jsxs("div",{className:"flex justify-start items-center gap-2",children:[i.jsxs("div",{onClick:()=>window.open("https://www.youtube.com/watch?v=QJHZwcKMSI0","_blank"),className:"h-6 sm:h-7 w-[130px] py-2 bg-[#FF0000] rounded-[10px] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-[#ff4d4d] inline-flex justify-center items-center gap-1 cursor-pointer",children:[i.jsx("div",{"data-svg-wrapper":!0,children:i.jsx(qk,{className:"w-4 h-4 text-white"})}),i.jsx("div",{className:"text-white text-[13px] font-medium leading-[8px]",children:"YouTube"})]}),i.jsxs("div",{onClick:()=>window.open("https://docs.dextrabot.com/market-maker-bot/hyperliquid-market-maker-bot","_blank"),className:"h-6 sm:h-7 w-max py-[5px] rounded-[256px] flex justify-start items-center gap-2 cursor-pointer border border-[#353535] px-4 bg-[#242424] hover:bg-[#2e2e2e]",children:[i.jsx("img",{src:l5,className:"w-[14px] h-[14px]"}),i.jsx("div",{className:"min-w-max text-white text-xs font-medium font-manrope leading-none pointer-events-none",children:"Docs"})]})]})}),i.jsxs(vo.div,{initial:{opacity:0,y:16},animate:{opacity:1,y:0},transition:{duration:.4},className:"relative overflow-hidden rounded-[28px] border border-white/10 bg-[#050606]/90 px-4 pb-6 pt-8 shadow-[0_25px_80px_rgba(0,0,0,0.65)] backdrop-blur-xl sm:px-10",children:[i.jsx("div",{className:"absolute inset-0 opacity-40",children:i.jsx("div",{className:"absolute inset-y-0 left-0 w-1/3",style:{background:"radial-gradient(450px 200px at 0% 0%, rgba(103,255,189,0.3), transparent 75%)"}})}),i.jsx("div",{className:"relative z-10",children:i.jsx(Oyn,{fetchInfoOnOpen:c,setIsFilterWallet:l})})]})]}),i.jsx("section",{className:"relative w-full rounded-[32px] border border-white/10 bg-[#050606]/90 px-3 pb-4 pt-6 shadow-[0_25px_80px_rgba(0,0,0,0.65)] backdrop-blur-2xl sm:px-6",children:i.jsx("div",{className:"rounded-[28px] border border-white/5 bg-[#090909]/90 p-3 shadow-inner",children:i.jsx(Lyn,{data:n,setData:r,loading:e,error:s,fetchInfoOnOpen:c,isFilterWallet:o})})})]})]})},mF="#67FFBD",$yn=({code:e,onCodeChange:t,onSubmit:n,loading:r,loadingCheckAccount:s,message:a})=>{const o=r||s||!e.trim();return i.jsx("div",{className:"h-[calc(100vh-10rem)]",children:s?i.jsxs("div",{className:"absolute mx-auto z-50 h-full w-full flex justify-center items-center overflow-hidden rounded-[16px] bg-transparent",children:[i.jsx(vo.div,{className:"pointer-events-none absolute -inset-[40%] opacity-80 blur-3xl h-full",style:{background:"radial-gradient(circle at 15% 0%, rgba(103,255,189,0.32), transparent 55%), radial-gradient(circle at 85% 100%, rgba(103,255,189,0.24), transparent 60%)"},initial:{x:"-4%",y:"-8%"},animate:{x:["-4%","4%","-2%","-4%"],y:["-8%","6%","2%","-8%"]},transition:{duration:24,repeat:1/0,ease:"easeInOut"}}),i.jsx(Da,{})]}):i.jsxs("div",{className:"relative h-full w-full flex justify-center items-center overflow-hidden rounded-[16px] bg-black",children:[i.jsx(vo.div,{className:"pointer-events-none absolute -inset-[40%] opacity-80 blur-3xl h-full",style:{background:"radial-gradient(circle at 15% 0%, rgba(103,255,189,0.32), transparent 55%), radial-gradient(circle at 85% 100%, rgba(103,255,189,0.24), transparent 60%)"},initial:{x:"-4%",y:"-8%"},animate:{x:["-4%","4%","-2%","-4%"],y:["-8%","6%","2%","-8%"]},transition:{duration:24,repeat:1/0,ease:"easeInOut"}}),i.jsxs(vo.div,{initial:{opacity:0,y:16,scale:.96},animate:{opacity:1,y:0,scale:1},transition:{duration:.5,ease:[.16,1,.3,1]},className:"relative z-10 w-full max-w-[460px] rounded-2xl border border-[#17211b] bg-[#050505] shadow-[0_30px_90px_rgba(0,0,0,0.9)] overflow-hidden",children:[i.jsxs("div",{className:"relative",children:[i.jsx("div",{className:"absolute inset-0 pointer-events-none opacity-50",children:i.jsx("div",{className:"w-full h-full",style:{background:"radial-gradient(900px 500px at 50% -10%, rgba(103,255,189,0.45), transparent 70%)"}})}),i.jsx("video",{src:QN,autoPlay:!0,muted:!0,loop:!0,playsInline:!0,preload:"auto",className:"w-full h-[260px] object-cover bg-black"},QN)]}),i.jsxs("div",{className:"px-5 pb-5 pt-4 space-y-4",children:[i.jsxs("div",{className:"space-y-1",children:[i.jsx("div",{className:"text-[11px] font-medium tracking-[0.18em] uppercase",style:{color:mF},children:"Early Access"}),i.jsxs("div",{className:"text-lg font-semibold",children:["Enter ",i.jsx("span",{style:{color:mF},children:"Alpha Code"})]}),i.jsx("p",{className:"text-[12px] text-white/60",children:"Market Maker is currently in private alpha. Enter your invitation code to unlock this feature in your account."})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("label",{className:"text-[11px] text-white/45",children:"Alpha Code"}),i.jsxs("div",{className:"flex gap-2",children:[i.jsx("input",{type:"text",value:e,onChange:l=>t(l.target.value.toUpperCase()),onKeyDown:l=>{l.key==="Enter"&&(l.preventDefault(),n())},placeholder:"DXTR-XXXXX",autoComplete:"off",spellCheck:!1,className:"flex-1 h-10 px-3 rounded-md bg-[#050505] border border-[#1e2e27] text-[13px] tracking-[0.18em] font-mono text-white placeholder:text-white/20 focus:outline-none focus:border-[#67FFBD]"}),i.jsx("button",{type:"button",onClick:n,disabled:o,className:`h-10 px-4 rounded-md text-[13px] font-semibold transition-colors ${o?"bg-[#101613] text-white/40 cursor-not-allowed":"text-black hover:opacity-90"}`,style:o?void 0:{backgroundColor:mF},children:r?"Checking…":"Access"})]})]}),(s||a)&&i.jsxs("div",{className:"text-[11px] min-h-[16px]",children:[s&&!a&&i.jsx("span",{className:"text-white/40",children:"Checking your eligibility…"}),a&&i.jsx("span",{style:{color:mF},children:a})]})]})]})]})})},Uyn=()=>{const{setSignModalOpen:e}=m.useContext(Qr);return i.jsxs("div",{className:"relative h-[calc(100vh-10rem)]",children:[i.jsx("div",{className:"pointer-events-none absolute inset-0 opacity-80",style:{background:"radial-gradient(900px 600px at 0% 0%, rgba(103,255,189,0.16), transparent 65%), radial-gradient(700px 500px at 100% 100%, rgba(96,93,255,0.14), transparent 65%)"}}),i.jsx("div",{className:"pointer-events-none absolute inset-0 opacity-[0.08]",style:{background:"repeating-linear-gradient(135deg, rgba(255,255,255,0.06) 0, rgba(255,255,255,0.06) 1px, transparent 1px, transparent 10px)"}}),i.jsx("div",{className:"relative mx-auto z-10 flex h-full w-full max-w-4xl items-center justify-center px-4",children:i.jsxs("div",{className:"relative flex w-full max-w-xl flex-col items-center justify-center gap-4 rounded-[24px] border border-white/10 bg-[#050505]/95 px-6 py-7 shadow-[0_20px_60px_rgba(0,0,0,0.65)] backdrop-blur-xl",children:[i.jsx("div",{className:"absolute inset-x-10 -top-10 h-24 bg-gradient-to-br from-[#67ffbd]/40 via-transparent to-[#8570ff]/30 opacity-60 blur-2xl"}),i.jsxs("div",{className:"relative z-10 flex flex-col items-center gap-4",children:[i.jsx("div",{className:"inline-flex items-center rounded-full border border-[#1c2b25] bg-[#07130d] px-3 py-1 text-[11px] font-semibold uppercase tracking-[0.25em] text-[#67ffbd]",children:"Market Maker"}),i.jsx("p",{className:"text-sm font-semibold text-white sm:text-base",children:"Connect your wallet to use Market Maker"}),i.jsx("p",{className:"text-[12px] text-[#9BA1A6] text-center max-w-md",children:"To start and manage your market maker bots on Hyperliquid, you need to connect your wallet first."}),i.jsx("div",{className:"w-[220px] pt-1",children:i.jsx("button",{onClick:()=>e(!0),className:"w-full h-[36px] rounded-xl font-bold text-[12px] transition-opacity mb-2 flex items-center justify-center bg-[#67FFBD] text-black",children:"Connect"})})]})]})})]})},zyn=()=>{const{setTelegramChatId:e,setSubscriberRole:t,setMushboomerETH:n,setIsWhitelist:r,setMushboomerSOL:s,setIsReferralCode:a,setIsReferralCodeName:o,setHyperToken:l,setHyperAddress:c,setSignModalOpen:u}=m.useContext(Qr),[d,f]=m.useState(!1),[x,g]=m.useState(!1),[v,w]=m.useState(""),[C,N]=m.useState(!1),[P,I]=m.useState(""),[R,F]=m.useState(!1);m.useEffect(()=>{const L=localStorage.getItem("hyperToken"),z=localStorage.getItem("hyperAddress");f(!!(L&&z));const Q=setInterval(()=>{const ne=localStorage.getItem("hyperToken"),J=localStorage.getItem("hyperAddress");f(!!(ne&&J))},800);return()=>clearInterval(Q)},[]),m.useEffect(()=>{(async()=>{var ne,J;const z=window.localStorage.getItem("hyperToken"),Q=window.localStorage.getItem("hyperAddress");if(!(!z||!Q))try{F(!0);const X=await Ei(Q.toLowerCase(),z);X!=null&&X.success?(e(X==null?void 0:X.telegram_chat_id),t(X==null?void 0:X.subscriber_role),n((ne=X==null?void 0:X.mushboomer_counts)==null?void 0:ne.eth),s((J=X==null?void 0:X.mushboomer_counts)==null?void 0:J.sol),a(X==null?void 0:X.referral_code),o(X==null?void 0:X.refcode),r(X==null?void 0:X.whitelist),g(X==null?void 0:X.mm_hyper_alpha_code),F(!1)):(window.localStorage.removeItem("hyperToken"),window.localStorage.removeItem("hyperAddress"),l(""),c(""),F(!1))}catch(X){console.error("Token verification error:",X),F(!1)}})()},[d]);const U=async()=>{var Q,ne,J,X;const L=window.localStorage.getItem("hyperToken"),z=window.localStorage.getItem("hyperAddress");if(!v.trim()){rn.error("Please enter your alpha code");return}if(!L||!z){u(!0);return}N(!0),I("");try{const re={address:z==null?void 0:z.toLowerCase(),token:L,alpha_code:v.trim(),source_market:"hyper",app_type:"mm_bot"},Y=(await fs.post("https://dextrabothypev2.nftinit.io/api/subscriber/alpha_code/set/",re)).data||{};if(Y.success){const ie=Y.message||"Alpha code added successfully";rn.success(`${ie}`,{style:{border:"1px solid #22c55e",padding:"16px",color:"#fff",borderRadius:"999px",background:"#14532d",height:"60px"},iconTheme:{primary:"#22c55e",secondary:"#FFFAEE"}}),I(ie),g(!0)}else{const ie=Y.error_message||Y.message||"This alpha code is invalid";rn.success(`${ie}.`,{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(255, 121, 124, 0.32)",width:"400px",minWidth:"400px",height:"40px",backdropFilter:"blur(48px)"},iconTheme:{primary:"#ff797c",secondary:"#7d3031"}}),I(ie)}}catch(re){const pe=((ne=(Q=re==null?void 0:re.response)==null?void 0:Q.data)==null?void 0:ne.error_message)||((X=(J=re==null?void 0:re.response)==null?void 0:J.data)==null?void 0:X.message)||re.message||"Failed to validate alpha code";rn.success(`${pe}.`,{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(255, 121, 124, 0.32)",width:"300px",minWidth:"300px",height:"40px",backdropFilter:"blur(48px)"},iconTheme:{primary:"#ff797c",secondary:"#7d3031"}}),I(pe)}finally{N(!1)}};return i.jsxs(i.Fragment,{children:[i.jsx(So,{children:i.jsxs(Ro,{children:[i.jsx("title",{children:"Market Maker Bot (Hyperliquid) | Dextrabot"}),i.jsx("meta",{name:"description",content:"Automate market making on Hyperliquid. Generate trading volume and provide liquidity 24/7."}),i.jsx("meta",{property:"og:title",content:"Market Maker Bot (Hyperliquid) | Dextrabot"}),i.jsx("meta",{property:"og:description",content:"Automate market making on Hyperliquid. Generate trading volume and provide liquidity 24/7."}),i.jsx("meta",{property:"og:image",content:"https://app.dextrabot.com/dextrabotIcon.png"}),i.jsx("meta",{property:"og:url",content:"https://app.dextrabot.com/market-maker "})]})}),i.jsx("div",{style:{minHeight:"calc(100vh - 5rem)"},className:"flex justify-center items-start w-full h-full px-4 pt-6 pb-6 sm:px-6 sm:pt-6 sm:pb-6 bg-[#050505] overflow-auto",children:i.jsx("div",{className:"flex flex-col items-stretch justify-start gap-[26px] w-full flex-grow xl:flex-grow-0",children:d?x&&d?i.jsx(Byn,{}):i.jsx($yn,{code:v,onCodeChange:w,onSubmit:U,loading:C,loadingCheckAccount:R,message:P}):i.jsx(Uyn,{})})})]})},Hyn=({data:e,refreshAgent:t,loadingCheckAccount:n,slotCount:r})=>{var Y,ie,oe;const s=e==null?void 0:e.subs_expire_date,[a,o]=m.useState(!1),[l,c]=m.useState(!1),[u,d]=m.useState(!1),[f,x]=m.useState(null),g=s?new Date(s).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}):null,v={extended:{name:"Extended",type:"img",src:"https://app.extended.exchange/assets/logo/extended-long.svg"},lighter:{name:"Lighter",type:"component",component:i.jsx(Xf,{className:"w-6 h-6 text-white"})},pacifica:{name:"Pacifica",type:"img",src:"https://app.pacifica.fi/imgs/logo.svg"},paradex:{name:"Paradex",type:"component",component:i.jsx(oMe,{className:"h-2.5 text-white -ml-6"})},variational:{name:"Variational",type:"img",src:"https://omni.variational.io/_app/immutable/assets/full_omni_wordmark.DwlcSpMk.svg"},aster:{name:"Aster",type:"img",src:"https://static.asterdex.com/cloud-futures/static/images/aster/logo.svg"},basedapp:{name:"BasedApp",type:"img",src:cke},apex:{name:"Apex",type:"img",src:"https://omni.apex.exchange/assets/logo_content-CY9uyFbz.svg"}},w={lighter:{name:"Lighter",type:"component",src:i.jsx(Xf,{className:"w-6 h-6 text-white"})}},C=["aster","basedapp","apex","extended"],N=(e==null?void 0:e.slots_info)||{},P=Object.fromEntries(Object.entries(N).filter(([G])=>!C.includes(G))),I=Object.values(P).reduce((G,V)=>G+V.total_qty,0),R=Object.values(P).reduce((G,V)=>G+V.active_qty,0),F=(((Y=e==null?void 0:e.copy_trade_slots_info)==null?void 0:Y.using_slot_count)||0)+(((ie=e==null?void 0:e.copy_trade_slots_info)==null?void 0:ie.total_slot_count)||0),U=((oe=e==null?void 0:e.copy_trade_slots_info)==null?void 0:oe.using_slot_count)||0,L=((e==null?void 0:e.bot_slots_info)||[]).find(G=>String((G==null?void 0:G.bot_type)||"").toLowerCase()==="grid_bot"&&String((G==null?void 0:G.source_market)||"").toLowerCase()==="lighter")||{},z=(L==null?void 0:L.total_slot_count)||0,Q=(L==null?void 0:L.using_subs_slot_count)||0,ne=(L==null?void 0:L.using_extra_slot_count)||0,J=Q+ne,X=J+z,re=()=>{navigator.clipboard.writeText(`https://app.dextrabot.com/referral/${e.refcode}`),o(!0),setTimeout(()=>o(!1),2e3)},pe=!!window.localStorage.getItem("hyperToken");return i.jsxs(i.Fragment,{children:[l&&Na.createPortal(i.jsx(Ele,{open:l,setOpen:c,oldSlotCount:f,checkAccountTrade:n,tradeMarket:"copyTrade"}),document.body),u&&Na.createPortal(i.jsx(m5,{open:u,setOpen:d,oldSlotCount:J,checkAccountLighter:t,product:"grid_bot"}),document.body),i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:"w-10 h-10 rounded-xl bg-gradient-to-br from-orange-500 to-red-600 flex items-center justify-center text-2xl font-bold shadow-lg shadow-orange-500/30",children:i.jsx("img",{src:_A,alt:"",className:"w-7 h-7"})}),i.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"Profile"}),i.jsx("div",{onClick:()=>{t()},className:"flex justify-center items-center cursor-pointer",children:i.jsx(jS,{className:"w-4 h-4 text-[#929292] hover:text-white"})})]}),pe?i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:`${(e==null?void 0:e.subs_expire_day)===null?"flex":"hidden"} flex-col items-start gap-4 bg-gradient-to-br from-[#141414] to-[#0c0c0c] border border-white/5 rounded-2xl p-6 max-w-[480px] shadow-[0_0_40px_-15px_rgba(255,140,0,0.3)]`,children:[i.jsx("div",{className:"w-12 h-12 rounded-xl bg-gradient-to-br from-orange-500 to-red-600 flex items-center justify-center text-xl font-bold text-white shadow-lg shadow-orange-500/40",children:"!"}),i.jsx("h2",{className:"text-xl font-semibold text-white/90",children:"No Active Subscription"}),i.jsx("p",{className:"text-base text-white/70 leading-relaxed",children:"You don't have an active subscription yet. Subscribe now to unlock trading bots, copy trading, and farming tools across multiple DEXs."})]}),i.jsxs("div",{className:`${(e==null?void 0:e.subs_expire_day)===null||!(e!=null&&e.subs_expire_day)?"hidden":""} bg-gradient-to-br from-[#141414] to-[#0c0c0c] rounded-2xl p-6 border border-white/5 relative overflow-hidden w-full`,children:[i.jsx("div",{className:"absolute top-0 right-0 w-32 h-32 bg-gradient-to-br from-orange-500/10 to-transparent rounded-bl-full"}),i.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[i.jsx("span",{className:"text-orange-400",children:"⏱"}),i.jsx("h2",{className:"text-lg font-semibold text-white/90",children:"Subscription Status"}),n&&i.jsx("span",{className:"-ml-1",children:i.jsx(aj,{size:"w-3.5 h-3.5"})})]}),i.jsxs("div",{className:"flex flex-wrap items-baseline gap-2 mb-2",children:[i.jsx("span",{className:"text-4xl font-bold text-transparent bg-clip-text bg-gradient-to-r from-orange-400 to-red-500",children:e==null?void 0:e.subs_expire_day}),i.jsx("span",{className:"text-white/60 text-lg",children:"days remaining"})]}),i.jsxs("p",{className:"text-white/40 text-sm",children:["Expires on"," ",i.jsx("span",{className:"text-white/60",children:g||"-"})]})]}),i.jsxs("div",{className:`${(e==null?void 0:e.copy_trade_slots_info)===null?"hidden":""} bg-gradient-to-br from-[#141414] to-[#0c0c0c] rounded-2xl p-6 border border-white/5 relative overflow-hidden w-full`,children:[i.jsx("div",{className:"absolute top-0 right-0 w-32 h-32 bg-gradient-to-br from-orange-500/10 to-transparent rounded-bl-full"}),i.jsxs("div",{className:"flex justify-between items-center mb-2.5 gap-2",children:[i.jsxs("div",{className:"flex items-center gap-1 mb-3",children:[i.jsx("h2",{className:"text-lg font-semibold text-white/90",children:"Copy Trade Slots"}),n&&i.jsx("span",{className:"-ml-1",children:i.jsx(aj,{size:"w-3.5 h-3.5"})})]}),i.jsxs("div",{className:"px-3 py-1 bg-orange-500/10 rounded-lg text-orange-400 text-sm font-medium -mt-2.5",children:[U,"/",F," Active"]})]}),i.jsxs("div",{className:`flex items-center justify-between py-3 px-4 rounded-xl
bg-white/[0.02] hover:bg-white/[0.04] transition-colors
border border-white/5`,children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("span",{className:"h-5 flex items-center justify-center",children:w.lighter.src}),i.jsx("span",{className:"font-medium text-white/80",children:w.lighter.name})]}),i.jsxs("div",{className:"flex justify-end items-center gap-4",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:`w-2 h-2 rounded-full ${U>0?"bg-green-400 shadow-green-400/50 shadow-sm":"bg-white/20"}`}),i.jsx("span",{className:U>0?"text-green-400 font-semibold":"text-white/40",children:U}),i.jsx("span",{className:"text-white/30",children:"/"}),i.jsx("span",{className:"text-white/60",children:F})]}),i.jsx("div",{className:"w-24 h-1.5 bg-white/5 rounded-full overflow-hidden",children:i.jsx("div",{className:"h-full bg-gradient-to-r from-orange-500 to-red-500 rounded-full transition-all",style:{width:`${F>0?U/F*100:0}%`}})})]})]}),i.jsx("div",{className:"flex justify-end items-center w-full mt-4",children:i.jsx("button",{onClick:()=>{x(r),c(!0)},className:"px-4 py-1.5 rounded-lg text-sm font-semibold bg-gradient-to-r from-orange-500 to-red-500 text-white shadow-[0_0_12px_rgba(255,100,0,0.4)]hover:shadow-[0_0_18px_rgba(255,120,0,0.6)] transition-all",children:"Get More Slots"})})]}),i.jsxs("div",{className:`${X===0?"hidden":""} bg-gradient-to-br from-[#141414] to-[#0c0c0c] rounded-2xl p-6 border border-white/5 relative overflow-hidden w-full`,children:[i.jsx("div",{className:"absolute top-0 right-0 w-32 h-32 bg-gradient-to-br from-orange-500/10 to-transparent rounded-bl-full"}),i.jsxs("div",{className:"flex justify-between items-center mb-2.5 gap-2",children:[i.jsxs("div",{className:"flex items-center gap-1 mb-3",children:[i.jsx("h2",{className:"text-lg font-semibold text-white/90",children:"Grid Bot Slots"}),n&&i.jsx("span",{className:"-ml-1",children:i.jsx(aj,{size:"w-3.5 h-3.5"})})]}),i.jsxs("div",{className:"px-3 py-1 bg-orange-500/10 rounded-lg text-orange-400 text-sm font-medium -mt-2.5",children:[J,"/",X," Active"]})]}),i.jsxs("div",{className:`flex items-center justify-between py-3 px-4 rounded-xl
bg-white/[0.02] hover:bg-white/[0.04] transition-colors
border border-white/5`,children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("span",{className:"h-5 flex items-center justify-center",children:w.lighter.src}),i.jsx("span",{className:"font-medium text-white/80",children:"Lighter"})]}),i.jsxs("div",{className:"flex justify-end items-center gap-4",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:`w-2 h-2 rounded-full ${J>0?"bg-green-400 shadow-green-400/50 shadow-sm":"bg-white/20"}`}),i.jsx("span",{className:J>0?"text-green-400 font-semibold":"text-white/40",children:J}),i.jsx("span",{className:"text-white/30",children:"/"}),i.jsx("span",{className:"text-white/60",children:X})]}),i.jsx("div",{className:"w-24 h-1.5 bg-white/5 rounded-full overflow-hidden",children:i.jsx("div",{className:"h-full bg-gradient-to-r from-orange-500 to-red-500 rounded-full transition-all",style:{width:`${X>0?J/X*100:0}%`}})})]})]}),i.jsx("div",{className:"flex justify-end items-center w-full mt-4",children:i.jsx("button",{onClick:()=>{d(!0)},className:"px-4 py-1.5 rounded-lg text-sm font-semibold bg-gradient-to-r from-orange-500 to-red-500 text-white shadow-[0_0_12px_rgba(255,100,0,0.4)]hover:shadow-[0_0_18px_rgba(255,120,0,0.6)] transition-all",children:"Get More Slots"})})]}),i.jsxs("div",{className:`${Object.keys((e==null?void 0:e.slots_info)||{}).length===0?"hidden":""} bg-gradient-to-br from-[#141414] to-[#0c0c0c] rounded-2xl p-6 border border-white/5 w-full`,children:[i.jsxs("div",{className:"flex items-center justify-between mb-5",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("h2",{className:"text-lg font-semibold text-white/90",children:"Slots Overview"}),n&&i.jsx("span",{className:"-ml-1",children:i.jsx(aj,{size:"w-3.5 h-3.5"})})]}),i.jsxs("div",{className:"px-3 py-1 bg-orange-500/10 rounded-lg text-orange-400 text-sm font-medium",children:[R,"/",I," Active"]})]}),i.jsx("div",{className:"space-y-2",children:Object.entries(P).filter(([G])=>!C.includes(G)).map(([G,V])=>{var ee,ae,fe;return i.jsxs("div",{className:"flex items-center justify-between py-3 px-4 rounded-xl bg-white/[0.02] hover:bg-white/[0.04] transition-colors border border-transparent hover:border-white/5",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsxs("span",{className:`${G==="apex"?"h-6":G==="basedapp"?"h-3.5":G==="pacifica"?"h-5":G==="variational"?"h-3":"h-3.5"} flex items-center justify-center`,children:[((ee=v[G])==null?void 0:ee.type)==="img"&&i.jsx("img",{src:v[G].src,alt:v[G].name,className:"w-full h-full"}),((ae=v[G])==null?void 0:ae.type)==="component"&&v[G].component]}),G==="lighter"&&i.jsx("span",{className:"font-medium text-white/80 -ml-3",children:((fe=v[G])==null?void 0:fe.name)||G})]}),i.jsxs("div",{className:"flex items-center gap-4",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("div",{className:`w-2 h-2 rounded-full ${V.active_qty>0?"bg-green-400 shadow-lg shadow-green-400/50":"bg-white/20"}`}),i.jsx("span",{className:V.active_qty>0?"text-green-400 font-semibold":"text-white/40",children:V.active_qty}),i.jsx("span",{className:"text-white/30",children:"/"}),i.jsx("span",{className:"text-white/60",children:V.total_qty})]}),i.jsx("div",{className:"w-24 h-1.5 bg-white/5 rounded-full overflow-hidden",children:i.jsx("div",{className:"h-full bg-gradient-to-r from-orange-500 to-red-500 rounded-full transition-all",style:{width:`${V.active_qty/V.total_qty*100}%`}})})]})]},G)})})]}),i.jsxs("div",{className:`${e!=null&&e.referral_code&&(e==null?void 0:e.refcode)!==null?"":"hidden"} bg-gradient-to-br from-[#141414] to-[#0c0c0c] rounded-2xl p-6 border border-white/5 w-full`,children:[i.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[i.jsx("span",{className:"text-orange-400",children:"🎁"}),i.jsx("h2",{className:"text-lg font-semibold text-white/90",children:"Referral Code"}),n&&i.jsx("span",{className:"-ml-1",children:i.jsx(aj,{size:"w-3.5 h-3.5"})})]}),i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:"flex-1 px-4 py-3 bg-black/30 rounded-xl border border-white/10 font-mono text-lg text-orange-400 tracking-wider",children:e==null?void 0:e.refcode}),i.jsx("button",{onClick:re,className:"px-4 py-3 bg-white/5 border border-white/10 rounded-xl hover:bg-orange-500/10 hover:border-orange-500/30 transition-all group",children:a?i.jsx("span",{className:"text-green-400",children:"✓"}):i.jsx("span",{className:"text-white/60 group-hover:text-orange-400 transition-colors",children:"📋"})})]}),i.jsx("p",{className:"text-white/40 text-sm mt-3",children:"Share your code and earn rewards for each referral"})]})]}):i.jsxs("div",{className:"flex flex-col items-start gap-4 bg-gradient-to-br from-[#141414] to-[#0c0c0c] border border-white/5 rounded-2xl p-6 max-w-[480px] shadow-[0_0_40px_-15px_rgba(255,140,0,0.3)]",children:[i.jsx("div",{className:`w-12 h-12 rounded-xl bg-gradient-to-br from-orange-500 to-red-600
flex items-center justify-center text-xl font-bold text-white shadow-lg shadow-orange-500/40`,children:"!"}),i.jsx("h2",{className:"text-xl font-semibold text-white/90",children:"Wallet Not Connected"}),i.jsx("p",{className:"text-base text-white/70 leading-relaxed",children:"Connect your wallet to access your profile, manage subscriptions, and view your active trading slots."})]})]})},Vyn=()=>{const{setSignModalOpen:e,setTelegramChatId:t,setSubscriberRole:n,setSubsExpireDay:r,setMushboomerETH:s,setMushboomerSOL:a,setIsReferralCode:o,setIsReferralCodeName:l,setIsWhitelist:c,setHyperToken:u,setHyperAddress:d}=m.useContext(Qr),{address:f}=ns(),[x,g]=m.useState(1),[v,w]=m.useState({}),[C,N]=m.useState(""),[P,I]=m.useState(""),[R,F]=m.useState(!1),[U,L]=m.useState(!1),[z,Q]=m.useState(""),[ne,J]=m.useState(0),[X,re]=m.useState(0),[pe,Y]=m.useState(!1),[ie,oe]=m.useState(0),[G,V]=m.useState(!1),ee=it=>/^\d*$/.test(it),ae=it=>{["e","E","+","-"].includes(it.key)&&it.preventDefault()},fe=m.useMemo(()=>{if(x==="")return!1;const it=Number(x);return Number.isInteger(it)&&it>=1},[x]),ge=(it=>{const[tt,lt]=it.split(" "),[ft,ut,qt]=tt.split("-").map(Number),[It,nn]=lt.split(":").map(Number);return new Date(Date.UTC(qt,ut-1,ft,It-3,nn))})("29-11-2025 23:59");m.useState(()=>new Date().getTime()>=ge.getTime());const ye=m.useRef(ne);m.useEffect(()=>{ye.current=ne},[ne]);const ve=m.useRef(0);m.useEffect(()=>{ve.current=X},[X]);const je=async()=>{var lt,ft,ut;const it=window.localStorage.getItem("hyperToken"),tt=window.localStorage.getItem("hyperAddress");if(!(!it||!tt))try{V(!0);const qt=await Ei(tt.toLowerCase(),it);qt!=null&&qt.success?(t(qt==null?void 0:qt.telegram_chat_id),n(qt==null?void 0:qt.subscriber_role),r(qt==null?void 0:qt.subs_expire_day),s((lt=qt==null?void 0:qt.mushboomer_counts)==null?void 0:lt.eth),a((ft=qt==null?void 0:qt.mushboomer_counts)==null?void 0:ft.sol),o(qt==null?void 0:qt.referral_code),l(qt==null?void 0:qt.refcode),c(qt==null?void 0:qt.whitelist),u(it),d(tt),N(qt==null?void 0:qt.farming_tools),J(Number((qt==null?void 0:qt.subs_expire_day)||0)),w(qt),V(!1),oe(((ut=qt==null?void 0:qt.copy_trade_slots_info)==null?void 0:ut.extra_slot_count)||0)):(window.localStorage.removeItem("hyperToken"),window.localStorage.removeItem("hyperAddress"),u(""),d(""),V(!1))}catch(qt){console.error("Token verification error:",qt),console.error(qt.message||"An unknown error occurred."),V(!1)}};m.useEffect(()=>{pe&&je()},[pe]),m.useEffect(()=>{const it=localStorage.getItem("hyperToken"),tt=localStorage.getItem("hyperAddress");Y(!!(it&&tt));const lt=setInterval(()=>{const ft=localStorage.getItem("hyperToken"),ut=localStorage.getItem("hyperAddress");Y(!!(ft&&ut))},800);return()=>clearInterval(lt)},[]);const Ie=async()=>new Sl(window.ethereum).eth.getAccounts(tt=>tt),Le=async(it="subscribe",tt=24,lt=5e3)=>{tt<=0||(await new Promise(ft=>setTimeout(ft,lt)),await je(),it==="subscribe"&&ye.current===ve.current?Le(it,tt-1,lt):je())},Qe=async it=>{const tt=window.localStorage.getItem("hyperToken"),lt=window.localStorage.getItem("hyperAddress");if(!tt||!f){e(!0);return}I(""),re(ye.current),ve.current=ye.current,L(!0),F(!0);try{await window.ethereum.request({method:"wallet_switchEthereumChain",params:[{chainId:"0x1"}]})}catch(qt){console.error("Failed to switch network",qt),F(!1);return}const ft=new Sl(window.ethereum);var ut=await Ie();if(ut.length>0?ut=ut[0]:ut=void 0,ut){const It=it*.12,nn=ft.utils.toWei(It.toString(),"ether"),jt={from:ut,to:"0xdEAe8586eD227A5096EBae47342fFc1ED99f13F9",value:nn};await ft.eth.sendTransaction(jt).then(cn=>{console.log("txHash :>> ",cn),F(!1),Q(cn.transactionHash),fetch("https://dextrabothypev2.nftinit.io/api/hyper/payment/save/",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:f?f.toLowerCase():lt,token:tt,payment_tx:cn.transactionHash,payment_role:"farming_tools",tx_qty:Number(x)})}),je(),Le("subscribe")}).catch(cn=>{console.log(cn),cn.code===-32003||cn.message.includes("insufficient funds")?I("Insufficient funds."):cn.message==="MetaMask Tx Signature: User denied transaction signature."&&L(!1)})}else await ft.eth.requestAccounts()},$e=()=>{je()};return window.localStorage.getItem("hyperToken"),i.jsxs(i.Fragment,{children:[i.jsx(bd,{open:U,setOpen:L,transactionHash:z,transactionLoading:R,paymentPresaleRole:!(ne<=X),errorFunds:P,activeMethod:2}),i.jsxs("div",{className:"flex flex-col md:flex-row items-center justify-start md:justify-center md:items-start gap-8 w-full h-full bg-[#161616]",children:[i.jsx("div",{className:"flex justify-center items-start md:items-center w-full pl-0 sm:pl-4 md:pl-2",children:i.jsx("div",{className:"flex flex-col gap-2 pt-0 md:pt-7 lg:pt-0",children:i.jsx("div",{className:"flex flex-col items-start justify-start gap-4 md:mb-10 lg:mb-16 overflow-scroll h-full",children:i.jsx(Hyn,{data:v,refreshAgent:$e,loadingCheckAccount:G,slotCount:ie})})})}),i.jsxs("div",{className:"relative mx-1 h-full py-10 hidden md:block",children:[i.jsx("div",{className:"w-[2px] h-full bg-[linear-gradient(to_bottom,rgba(255,140,0,0)_0%,rgba(255,140,0,0.8)_15%,rgba(255,50,150,0.8)_85%,rgba(255,50,150,0)_100%)]"}),i.jsx("div",{className:"absolute inset-0 w-[8px] h-full bg-[linear-gradient(to_bottom,rgba(255,140,0,0)_0%,rgba(255,140,0,0.4)_15%,rgba(255,50,150,0.4)_85%,rgba(255,50,150,0)_100%)] blur-md mx-auto"})]}),i.jsx("div",{className:"flex flex-col justify-center items-center md:items-center w-full h-full gap-4 pb-10 mb:pb-0",children:i.jsxs("div",{className:"flex flex-col items-center gap-4 border border-[#404040] bg-[#141414] rounded-xl px-3 py-7 shadow-[0_0_25px_rgba(255,120,50,0.25)] min-w-[362px]",children:[i.jsx("div",{className:"rounded-lg overflow-hidden",children:i.jsx("video",{src:cD,autoPlay:!0,muted:!0,loop:!0,playsInline:!0,preload:"auto",className:"w-full h-[284px] lg:h-[284px] object-cover"},cD)}),i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex items-center justify-center gap-2",children:[i.jsx("button",{onClick:()=>g(it=>{const tt=Number(it||0);return tt>1?String(tt-1):"1"}),className:"w-8 h-8 flex items-center justify-center rounded-md bg-[#242424] border border-[#353535] text-[#bbb] hover:text-white hover:border-[#555] transition-all",children:"–"}),i.jsx("input",{value:x,onChange:it=>{const tt=it.target.value.trim();if(tt==="")return g("");ee(tt)&&g(tt)},onKeyDown:ae,inputMode:"numeric",autoComplete:"off",placeholder:"e.g. 10",className:"w-full h-8 text-center rounded-md bg-[#242424] border border-[#353535] text-white text-[13px] font-semibold outline-none placeholder:text-[#7F7F7F]"}),i.jsx("button",{onClick:()=>g(it=>{const tt=Number(it||0);return String(tt+1)}),className:"w-8 h-8 flex items-center justify-center rounded-md bg-[#242424] border border-[#353535] text-[#bbb] hover:text-white hover:border-[#555] transition-all",children:"+"})]}),x!==""&&!fe&&i.jsx("div",{className:"text-[#FF797C] text-[12px]",children:"Enter an integer that is at least 1."})]}),fe&&i.jsxs("div",{className:"text-[12px] font-semibold text-green-400",children:[" ",x," months will be added to your subscription."]}),i.jsx("div",{className:"relative flex items-center justify-center gap-3 px-4 py-2 rounded-xl shadow-[0_0_25px_rgba(255,140,0,0.15)] backdrop-blur-md bg-white/5 border border-white/10",children:i.jsxs("span",{className:"text-2xl font-bold bg-gradient-to-r from-orange-400 to-pink-500 bg-clip-text text-transparent",children:[(x*.12).toFixed(2)," ETH"]})}),i.jsx("div",{onClick:it=>{it.preventDefault(),fe&&Qe(x)},className:`text-[10px] sm:text-xs xl:text-[13px] font-semibold text-gray-200 select-none border rounded-md px-4 py-2 ${fe?"border-[#8861FF] bg-[#7446FF] cursor-pointer":"bg-[#2a2a2a] border-[#3a3a3a] opacity-60 cursor-not-allowed"}`,children:"Buy Now"})]})})]})]})},Wyn=()=>{ns();const{setTelegramChatId:e,setSubscriberRole:t,setSubsExpireDay:n,setMushboomerETH:r,setMushboomerSOL:s,setIsReferralCode:a,setIsReferralCodeName:o,setIsWhitelist:l,setHyperToken:c,setHyperAddress:u}=m.useContext(Qr);return m.useEffect(()=>{(async()=>{var g,v;const f=window.localStorage.getItem("hyperToken"),x=window.localStorage.getItem("hyperAddress");if(!(!f||!x))try{const w=await Ei(x.toLowerCase(),f);w!=null&&w.success?(e(w==null?void 0:w.telegram_chat_id),t(w==null?void 0:w.subscriber_role),n(w==null?void 0:w.subs_expire_day),r((g=w==null?void 0:w.mushboomer_counts)==null?void 0:g.eth),s((v=w==null?void 0:w.mushboomer_counts)==null?void 0:v.sol),a(w==null?void 0:w.referral_code),o(w==null?void 0:w.refcode),l(w==null?void 0:w.whitelist)):(window.localStorage.removeItem("hyperToken"),window.localStorage.removeItem("hyperAddress"),c(""),u(""))}catch(w){console.error("Token verification error:",w),console.error(w.message||"An unknown error occurred.")}})()},[]),i.jsxs(i.Fragment,{children:[i.jsx(So,{children:i.jsxs(Ro,{children:[i.jsx("title",{children:"My Profile - Dextrabot | Manage Your Trading Bots & Subscriptions"}),i.jsx("link",{rel:"canonical",href:"https://app.dextrabot.com/my-profile"}),i.jsx("meta",{name:"description",content:"View and manage your Dextrabot profile. Track your subscription status, active trading slots across multiple DEXs, referral rewards, and account features. Optimize your automated trading experience."}),i.jsx("meta",{name:"og:title",content:"My Profile - Dextrabot | Manage Your Trading Bots & Subscriptions"}),i.jsx("meta",{name:"og:description",content:"View and manage your Dextrabot profile. Track your subscription status, active trading slots across multiple DEXs, referral rewards, and account features. Optimize your automated trading experience."}),i.jsx("meta",{name:"og:image",content:"https://app.dextrabot.com/dextrabotIcon.png"}),i.jsx("meta",{name:"og:url",content:"https://app.dextrabot.com/my-profile"})]})}),i.jsx("div",{className:"flex justify-center items-start w-full h-[calc(100vh-5rem)] min-h-max px-4 pt-4 pb-10 bg-[#161616]",children:i.jsx("div",{className:"flex flex-col items-stretch justify-center h-full gap-[26px] w-full flex-grow xl:flex-grow-0",children:i.jsx(Vyn,{})})})]})},qyn=()=>{const{setSignModalOpen:e,setTelegramChatId:t,setSubscriberRole:n,setSubsExpireDay:r,setMushboomerETH:s,setMushboomerSOL:a,setIsReferralCode:o,setIsReferralCodeName:l,setIsWhitelist:c,setHyperToken:u,setHyperAddress:d}=m.useContext(Qr),{address:f}=ns(),[x,g]=m.useState(1),[v,w]=m.useState(""),[C,N]=m.useState(!1),[P,I]=m.useState(!1),[R,F]=m.useState(""),[U,L]=m.useState(0),[z,Q]=m.useState(0),[ne,J]=m.useState(!1),[X,re]=m.useState(!1),pe=Ne=>/^\d*$/.test(Ne),Y=Ne=>{["e","E","+","-"].includes(Ne.key)&&Ne.preventDefault()},ie=m.useMemo(()=>{if(x==="")return!1;const Ne=Number(x);return Number.isInteger(Ne)&&Ne>=1},[x]),oe=m.useRef(U);m.useEffect(()=>{oe.current=U},[U]);const G=m.useRef(0);m.useEffect(()=>{G.current=z},[z]);const V=async()=>{var ge,ye;const Ne=window.localStorage.getItem("hyperToken"),he=window.localStorage.getItem("hyperAddress");if(!(!Ne||!he))try{re(!0);const ve=await Ei(he.toLowerCase(),Ne);ve!=null&&ve.success?(t(ve==null?void 0:ve.telegram_chat_id),n(ve==null?void 0:ve.subscriber_role),r(ve==null?void 0:ve.subs_expire_day),s((ge=ve==null?void 0:ve.mushboomer_counts)==null?void 0:ge.eth),a((ye=ve==null?void 0:ve.mushboomer_counts)==null?void 0:ye.sol),o(ve==null?void 0:ve.referral_code),l(ve==null?void 0:ve.refcode),c(ve==null?void 0:ve.whitelist),u(Ne),d(he),L(Number((ve==null?void 0:ve.subs_expire_day)||0)),re(!1)):(window.localStorage.removeItem("hyperToken"),window.localStorage.removeItem("hyperAddress"),u(""),d(""),re(!1))}catch(ve){console.error("Token verification error:",ve),console.error(ve.message||"An unknown error occurred."),re(!1)}};m.useEffect(()=>{ne&&V()},[ne]),m.useEffect(()=>{const Ne=localStorage.getItem("hyperToken"),he=localStorage.getItem("hyperAddress");J(!!(Ne&&he));const ge=setInterval(()=>{const ye=localStorage.getItem("hyperToken"),ve=localStorage.getItem("hyperAddress");J(!!(ye&&ve))},800);return()=>clearInterval(ge)},[]);const ee=async()=>new Sl(window.ethereum).eth.getAccounts(he=>he),ae=async(Ne="subscribe",he=24,ge=5e3)=>{he<=0||(await new Promise(ye=>setTimeout(ye,ge)),await V(),Ne==="subscribe"&&oe.current===G.current?ae(Ne,he-1,ge):V())},fe=async Ne=>{const he=window.localStorage.getItem("hyperToken"),ge=window.localStorage.getItem("hyperAddress");if(!he||!f){e(!0);return}w(""),Q(oe.current),G.current=oe.current,I(!0),N(!0);try{await window.ethereum.request({method:"wallet_switchEthereumChain",params:[{chainId:"0x1"}]})}catch(je){console.error("Failed to switch network",je),N(!1);return}const ye=new Sl(window.ethereum);var ve=await ee();if(ve.length>0?ve=ve[0]:ve=void 0,ve){const Ie=Ne*.09,Le=ye.utils.toWei(Ie.toString(),"ether"),Qe={from:ve,to:"0xdEAe8586eD227A5096EBae47342fFc1ED99f13F9",value:Le};await ye.eth.sendTransaction(Qe).then($e=>{console.log("txHash :>> ",$e),N(!1),F($e.transactionHash),fetch("https://dextrabothypev2.nftinit.io/api/hyper/payment/save/",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:f?f.toLowerCase():ge,token:he,payment_tx:$e.transactionHash,payment_role:"farming_tools",tx_qty:Number(x)})}),V(),ae("subscribe")}).catch($e=>{console.log($e),$e.code===-32003||$e.message.includes("insufficient funds")?w("Insufficient funds."):$e.message==="MetaMask Tx Signature: User denied transaction signature."&&I(!1)})}else await ye.eth.requestAccounts()};return i.jsxs(i.Fragment,{children:[P&&Na.createPortal(i.jsx(bd,{open:P,setOpen:I,transactionHash:R,transactionLoading:C,paymentPresaleRole:!(U<=z),errorFunds:v,activeMethod:2}),document.body),i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex items-center justify-center gap-2",children:[i.jsx("button",{onClick:()=>g(Ne=>{const he=Number(Ne||0);return he>1?String(he-1):"1"}),className:"w-8 h-8 flex items-center justify-center rounded-md bg-[#242424] border border-[#353535] text-[#bbb] hover:text-white hover:border-[#555] transition-all",children:"–"}),i.jsx("input",{value:x,onChange:Ne=>{const he=Ne.target.value.trim();if(he==="")return g("");pe(he)&&g(he)},onKeyDown:Y,inputMode:"numeric",autoComplete:"off",placeholder:"e.g. 10",className:"w-full h-8 text-center rounded-md bg-[#242424] border border-[#353535] text-white text-[13px] font-semibold outline-none placeholder:text-[#7F7F7F]"}),i.jsx("button",{onClick:()=>g(Ne=>{const he=Number(Ne||0);return String(he+1)}),className:"w-8 h-8 flex items-center justify-center rounded-md bg-[#242424] border border-[#353535] text-[#bbb] hover:text-white hover:border-[#555] transition-all",children:"+"})]}),x!==""&&!ie&&i.jsx("div",{className:"text-[#FF797C] text-[12px]",children:"Enter an integer that is at least 1."})]}),ie&&i.jsxs("div",{className:"text-[12px] font-semibold text-green-400",children:[" ",x," months will be added to your subscription."]}),i.jsxs("div",{className:"relative flex items-center justify-center gap-3 px-4 py-2 rounded-xl shadow-[0_0_25px_rgba(255,140,0,0.15)] backdrop-blur-md bg-white/5 border border-white/10",children:[i.jsxs("span",{className:"line-through text-gray-400/70 text-xl",children:[(x*.12).toFixed(2)," ETH"]}),i.jsxs("span",{className:"text-2xl font-bold bg-gradient-to-r from-orange-400 to-pink-500 bg-clip-text text-transparent",children:[(x*.09).toFixed(2)," ETH"]})]}),i.jsx("div",{onClick:Ne=>{Ne.preventDefault(),ie&&fe(x)},className:`text-[10px] sm:text-xs xl:text-[13px] font-semibold text-gray-200 select-none border rounded-md px-4 py-2 ${ie?"border-[#8861FF] bg-[#7446FF] cursor-pointer":"bg-[#2a2a2a] border-[#3a3a3a] opacity-60 cursor-not-allowed"}`,children:"Buy Now"})]})},Gyn=({open:e,setOpen:t})=>{const{subsExpireDay:n}=m.useContext(Qr),r=()=>{const s=Date.now(),a=localStorage.getItem("hyperAddress");localStorage.setItem(`lighterCopyTradeDismissedAt_${a}`,s.toString()),t(!1)};return i.jsxs(Ea,{open:e,onClose:()=>{},className:"relative z-50 font-manrope",children:[i.jsx(ja,{transition:!0,style:{backgroundColor:"rgba(0, 0, 0, 0.48)"},className:"fixed inset-0 transition-opacity data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in"}),i.jsx("div",{className:"fixed inset-0 z-50 w-screen overflow-y-auto",children:i.jsx("div",{className:"flex min-h-full items-center justify-center p-4 text-center sm:p-0",children:i.jsx(xa,{transition:!0,className:"relative transform overflow-hidden bg-[#161616] text-left shadow-xl transition-all data-[closed]:translate-y-4 data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in data-[closed]:sm:translate-y-0 data-[closed]:sm:scale-95 rounded-3xl",children:i.jsxs("div",{className:"relative flex flex-col justify-start items-center gap-6 w-full min-h-[420px] p-4 sm:p-12 rounded-3xl max-w-[600px]",children:[i.jsx("button",{onClick:r,className:"cursor-pointer flex w-9 h-9 absolute right-3 top-3 rounded-full p-1 justify-center items-center hover:bg-[#7535FE]/70",children:i.jsx("img",{className:"p-1",src:Ba,alt:"close"})}),i.jsx("div",{className:"pt-4",children:i.jsx("img",{src:Gi,alt:"",className:"w-[86px h-[86px]"})}),i.jsx("div",{className:"flex justify-center items-center w-full",children:i.jsxs("div",{className:"flex flex-col items-center w-full gap-3 sm:gap-5",children:[i.jsxs("div",{className:"text-white font-manrope text-[20px] sm:text-[22px] font-extrabold leading-none",children:["Your subscription is ending in"," ",n||0," days"]}),i.jsxs("div",{className:"text-[13px] sm:text-[14px] text-center text-white/90 font-manrope font-semibold leading-[18px] max-w-[70ch]",children:["Renew now to keep access to Copy Trading, bots, and all premium features.",i.jsx("br",{}),i.jsx("br",{}),i.jsx("span",{className:"text-[#67FFBD] font-bold",children:"Renew now and get 25% off your subscription."})]}),i.jsx(qyn,{})]})})]})})})})]})},Kyn=({open:e,setOpen:t})=>{const n=()=>{localStorage.setItem("strategySelectorModalDismissedAt",Date.now().toString()),t(!1)},r=()=>{localStorage.setItem("strategySelectorModalDismissedAt",Date.now().toString())},s=[{key:"hyperGrid",title:"Hyperliquid Grid Bot",desc:"Automated grid trading on Hyperliquid futures.",icon:"https://app.hyperliquid.xyz/coins/HYPE.svg",url:"/terminal/hyperliquid/BTC#gridbot"},{key:"hlMaker",title:"Hyperliquid Market Maker Bot",desc:"Liquidity-providing market making with dynamic spreads.",icon:"https://app.hyperliquid.xyz/coins/HYPE.svg",url:"/market-maker"},{key:"lighterMaker",title:"Lighter DCA Bot",desc:"Automate your DCA entries on Lighter. Coming soon.",icon:i.jsx(Mg,{className:"w-4 h-4 text-white"}),comingSoon:!0},{key:"extendedMaker",title:"Extended DCA Bot",desc:"Advanced market making strategies.",icon:"https://app.extended.exchange/assets/logo/extended.svg",badge:"New",highlighted:!0,url:"/dca-bot"},{key:"lighterGrid",title:"Lighter Grid Bot",desc:"Automated grid trading on Lighter futures.",icon:i.jsx(Mg,{className:"w-4 h-4 text-white"}),url:"/terminal/lighter/BTC#gridbot"},{key:"extendedGrid",title:"Extended Grid Bot",desc:"Advanced grid logic with dynamic rebalancing.",icon:"https://app.extended.exchange/assets/logo/extended.svg",url:"/terminal/extended/BTC#gridbot",badge:"New",highlighted:!0},{key:"hlCopyTrade",title:"Hyperliquid Copy Trade",desc:"Automatically copy trade best Hyperliquid wallets.",icon:"https://app.hyperliquid.xyz/coins/HYPE.svg",url:"/discover-wallets"},{key:"lgCopyTrade",title:"Lighter Copy Trade",desc:"Automatically copy trade best Hyperliquid wallets on Lighter.",icon:i.jsx(Mg,{className:"w-4 h-4 text-white"}),url:"/discover-wallets"},{key:"lgDelta",title:"Lighter Delta Neutral",desc:"Delta-neutral farming on Lighter.",icon:i.jsx(Mg,{className:"w-4 h-4 text-white"}),url:"/discover-wallets#lighter-farming"},{key:"asterBot",title:"Aster Farming Bot",desc:"Farm points on Aster exchange.",icon:i.jsx(Uoe,{className:"w-4 h-4"}),url:"/discover-wallets#aster-farming"},{key:"extendedBot",title:"Extended Delta Neutral",desc:"Delta-neutral farming on Extended.",icon:"https://app.extended.exchange/assets/logo/extended.svg",url:"/discover-wallets#extended-farming",badge:"New",highlighted:!0},{key:"variationalBot",title:"Variational Farming Bot",desc:"Farm points on Variational exchange.",icon:uke,url:"/discover-wallets#variational-farming"},{key:"paradexBot",title:"Paradex Farming Bot",desc:"Farm points on Paradex exchange.",icon:fke,url:"/discover-wallets#paradex-farming"},{key:"pacificaBot",title:"Pacifica Farming Bot",desc:"Farm points on Pacifica exchange.",icon:"https://app.pacifica.fi/imgs/icon.svg",url:"/discover-wallets#pacifica-farming"},{key:"apexBot",title:"Apex Farming Bot",desc:"Farm points on Apex exchange.",icon:dke,url:"/discover-wallets#apex-farming"}],a=o=>{if(!o)return null;if(Ae.isValidElement(o))return o;if(typeof o=="function"){const l=o;return i.jsx(l,{className:"w-6 h-6"})}return typeof o=="string"&&(o.startsWith("/")||o.startsWith("http"))?i.jsx("img",{src:o,alt:"",className:"w-6 h-6 object-contain",draggable:!1}):i.jsx("span",{className:"text-2xl leading-none",children:o})};return i.jsxs(Ea,{open:e,onClose:n,className:"relative z-50",children:[i.jsx(ja,{className:"fixed inset-0 bg-black/50 backdrop-blur-sm"}),i.jsx("div",{className:"fixed inset-0 flex items-center justify-center px-3 pb-4 pt-10 sm:p-0",children:i.jsxs(xa,{className:"relative w-full max-w-[780px] max-h-[76vh] sm:max-h-[96vh] rounded-t-[28px] sm:rounded-[28px] border border-white/5 bg-gradient-to-b from-[#191919] via-[#141414] to-[#111111] p-4 sm:py-3 sm:px-6 shadow-[0_22px_60px_rgba(0,0,0,0.9)] overflow-y-auto",children:[i.jsx("button",{onClick:n,className:"cursor-pointer flex w-9 h-9 absolute right-3 top-3 rounded-full p-1 justify-center items-center hover:bg-[#7535FE]/70",children:i.jsx("img",{src:Ba,alt:"close",className:"w-4 h-4"})}),i.jsx("h2",{className:"text-white text-[20px] sm:text-[26px] font-extrabold text-center mb-3 sm:mb-4 tracking-tight",children:"What brings you here?"}),i.jsx("div",{className:"space-y-4",children:i.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-2.5",children:s==null?void 0:s.map(o=>i.jsxs("div",{onClick:()=>{o.url&&(o.url.startsWith("/"),window.open(o.url,"_blank"),r())},className:`relative rounded-2xl p-2.5 transition ${o.highlighted&&!o.comingSoon?"bg-[#111827] border border-[#1c2741] hover:bg-[#202020]":o.highlighted&&o.comingSoon?"bg-[#6B5CFF14] border border-[#6B5CFF59]":"bg-[#181818] border border-[#2a2a2a] hover:bg-[#202020]"} ${o.comingSoon?"cursor-not-allowed":"cursor-pointer"}`,children:[o.badge&&!o.comingSoon&&i.jsx("div",{className:"absolute -top-3 left-1/2 -translate-x-1/2 z-10",children:i.jsx("div",{className:"px-1 sm:px-2.5 py-0.5 rounded-md text-[9px] sm:text-[10px] font-bold bg-[#3b82f6] text-white shadow-md min-w-max",children:o.badge})}),o.badge&&o.comingSoon&&i.jsx("div",{className:"absolute -top-3 left-1/2 -translate-x-1/2 z-10",children:i.jsx("div",{className:"px-1.5 sm:px-2.5 py-0.5 rounded-md text-[9px] sm:text-[10px] font-bold bg-[#6B5CFF] text-white shadow-md min-w-max",children:o.badge})}),i.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[i.jsx("div",{className:"flex h-10 w-10 items-center justify-center rounded-xl bg-black/20 text-2xl",children:a(o.icon)}),i.jsx("div",{className:"text-white font-semibold text-sm",children:o.title}),o.desc&&i.jsx("div",{className:"text-[#9b9b9b] text-[11px] leading-tight",children:o.desc})]})]},o.key))})})]})})]})},Yyn=({open:e,setOpen:t})=>null,xF="#basedapp-farming",gF="#aster-farming",bF="#lighter-farming",yF="#apex-farming",vF="#variational-farming",wF="#extended-farming",CF="#paradex-farming",SF="#pacifica-farming";function Xyn(){const e=[{from:"/feed",to:"/tracker"},{from:"/wallet-activities",to:"/tracker"},{from:"/favorite-wallets",to:"/tracked-wallets"},{from:"/high-volume-trades",to:"/hyperliquid-whale-trades"}],{hyperToken:t,subsExpireDay:n}=m.useContext(Qr),r=oc(),s=Vo(),[a,o]=m.useState(!1),[l,c]=m.useState(!1),[u,d]=m.useState(!1),[f,x]=m.useState(!1),g=r.hash===xF,v=r.hash===gF,w=r.hash===bF,C=r.hash===yF,N=r.hash===vF,P=r.hash===wF,I=r.hash===CF,R=r.hash===SF,F=Ae.useCallback(re=>{re?r.hash!==xF&&s(r.pathname+r.search+xF,{replace:!0}):r.hash===xF&&s(r.pathname+r.search,{replace:!0})},[r.pathname,r.search,r.hash,s]),U=Ae.useCallback(re=>{re?r.hash!==gF&&s(r.pathname+r.search+gF,{replace:!0}):r.hash===gF&&s(r.pathname+r.search,{replace:!0})},[r.pathname,r.search,r.hash,s]),L=Ae.useCallback(re=>{re?r.hash!==bF&&s(r.pathname+r.search+bF,{replace:!0}):r.hash===bF&&s(r.pathname+r.search,{replace:!0})},[r.pathname,r.search,r.hash,s]),z=Ae.useCallback(re=>{re?r.hash!==yF&&s(r.pathname+r.search+yF,{replace:!0}):r.hash===yF&&s(r.pathname+r.search,{replace:!0})},[r.pathname,r.search,r.hash,s]),Q=Ae.useCallback(re=>{re?r.hash!==vF&&s(r.pathname+r.search+vF,{replace:!0}):r.hash===vF&&s(r.pathname+r.search,{replace:!0})},[r.pathname,r.search,r.hash,s]),ne=Ae.useCallback(re=>{re?r.hash!==wF&&s(r.pathname+r.search+wF,{replace:!0}):r.hash===wF&&s(r.pathname+r.search,{replace:!0})},[r.pathname,r.search,r.hash,s]),J=Ae.useCallback(re=>{re?r.hash!==CF&&s(r.pathname+r.search+CF,{replace:!0}):r.hash===CF&&s(r.pathname+r.search,{replace:!0})},[r.pathname,r.search,r.hash,s]),X=Ae.useCallback(re=>{re?r.hash!==SF&&s(r.pathname+r.search+SF,{replace:!0}):r.hash===SF&&s(r.pathname+r.search,{replace:!0})},[r.pathname,r.search,r.hash,s]);return m.useEffect(()=>{const re=localStorage.getItem("dailyPicksDismissedAt"),pe=localStorage.getItem("dailyPicksBlockedUntil"),Y=Date.now();if(pe&&Y<parseInt(pe)){o(!1);return}if(re){const ie=new Date(parseInt(re)).toDateString(),oe=new Date().toDateString();if(ie===oe){o(!1);return}}o(!0)},[r.pathname,t]),m.useEffect(()=>{const re=window.localStorage.getItem("hyperToken"),pe=localStorage.getItem("hyperAddress");if(!re||!pe)return;if(n===null||n===0||Number(n)>7){c(!1);return}const Y=localStorage.getItem(`lighterCopyTradeDismissedAt_${pe}`);if(Y){const ie=new Date(parseInt(Y)).toDateString(),oe=new Date().toDateString();if(ie===oe){window.location.pathname==="/my-profile"?c(!0):c(!1);return}}c(!0)},[r.pathname,t,n]),m.useEffect(()=>{const re=localStorage.getItem("strategySelectorModalDismissedAt");if(re){const pe=new Date(parseInt(re)).toDateString(),Y=new Date().toDateString();if(pe===Y){d(!1);return}}d(!0)},[r.pathname,t]),m.useEffect(()=>{if(localStorage.getItem("lighterReportModalDismissed")==="true"){x(!1);return}x(!0)},[r.pathname]),i.jsxs(i.Fragment,{children:[i.jsx("div",{children:i.jsx(XYe,{})}),i.jsxs("div",{children:[i.jsx(Uin,{}),i.jsxs(GKe,{children:[i.jsx(ya,{path:"/",element:i.jsx(ton,{})}),i.jsx(ya,{path:"/sitemap",element:i.jsx(aon,{})}),i.jsx(ya,{path:"/videos",element:i.jsx(oon,{})}),e.map(({from:re,to:pe})=>i.jsx(ya,{path:re,element:i.jsx(kde,{to:pe,replace:!0})},re)),i.jsxs(ya,{element:i.jsx(brn,{}),children:[i.jsx(ya,{path:"/mobile-auth",element:i.jsx(ion,{})}),i.jsx(ya,{path:"discover-wallets",element:i.jsx(Xsn,{})}),i.jsx(ya,{path:"/hyperliquid-vaults",element:i.jsx(lon,{})}),i.jsx(ya,{path:"/back-testing",element:i.jsx(Vbn,{})}),i.jsx(ya,{path:"/hyperliquid-whale-trades",element:i.jsx(Pbn,{})}),i.jsx(ya,{path:"wallet-details/:walletAddress",element:i.jsx(Bin,{})}),i.jsx(ya,{path:"tracked-wallets",element:i.jsx(Hin,{})}),i.jsx(ya,{path:"tracker",element:i.jsx(oan,{})}),i.jsx(ya,{path:"referral/:code?",element:i.jsx(han,{})}),i.jsx(ya,{path:"wallet-management",element:i.jsx(Aan,{})}),i.jsx(ya,{path:"copy-trade",element:i.jsx(_an,{})}),i.jsx(ya,{path:"leaderboard",element:i.jsx(Oan,{})}),i.jsx(ya,{path:"ticker",element:i.jsx(fon,{})}),i.jsx(ya,{path:"terminal",element:i.jsx(kde,{to:"/terminal/hyperliquid/BTC",replace:!0})}),i.jsx(ya,{path:"terminal/:coin",element:i.jsx(Qyn,{})}),i.jsx(ya,{path:"terminal/:exchange/:coin",element:i.jsx(T0n,{})}),i.jsx(ya,{path:"telegram-verify",element:i.jsx(Obn,{})}),i.jsx(ya,{path:"telegram-api-wallet",element:i.jsx(qbn,{})}),i.jsx(ya,{path:"subscribe",element:i.jsx(Fyn,{})}),i.jsx(ya,{path:"my-profile",element:i.jsx(Wyn,{})}),i.jsx(ya,{path:"hyperliquid-fee-calculator",element:i.jsx(pNe,{})}),i.jsx(ya,{path:"hyperliquid-fee-calculator/:walletAddress",element:i.jsx(pNe,{})}),i.jsx(ya,{path:"market-maker",element:i.jsx(zyn,{})}),i.jsx(ya,{path:"dca-bot",element:i.jsx(Iyn,{})})]}),i.jsx(ya,{path:"*",element:i.jsx(Zyn,{url:"https://dextrabot.com/"})})]}),i.jsx(zoe,{open:g,setOpen:F}),i.jsx(Gyn,{open:l,setOpen:c}),i.jsx(Kyn,{open:u,setOpen:d}),i.jsx(Yyn,{open:f,setOpen:x}),i.jsx(Hoe,{open:v,setOpen:U}),i.jsx(Voe,{open:w,setOpen:L}),i.jsx(Woe,{open:C,setOpen:z}),i.jsx(qoe,{open:N,setOpen:Q}),i.jsx(w$,{open:P,setOpen:ne}),i.jsx(Goe,{open:I,setOpen:J}),i.jsx(Koe,{open:R,setOpen:X})]})]})}function Qyn(){const{coin:e}=t5(),t=Vo();return m.useEffect(()=>{const n=e||"BTC",r=typeof window<"u"&&window.location.hash||"";t(`/terminal/hyperliquid/${n}${r}`,{replace:!0})},[e,t]),null}function Zyn({url:e}){return Ae.useEffect(()=>{window.location.replace(e)},[e]),i.jsx(So,{children:i.jsxs(Ro,{children:[i.jsx("meta",{name:"prerender-status-code",content:"301"}),i.jsx("meta",{name:"prerender-header",content:`Location: ${e}`})]})})}const Jyn="4953aed406a7fd4457496250b7e4efbc",e2n=PRt({appName:"Dextrabot",projectId:Jyn,chains:[ZE,o1e,a1e,i1e],transports:{[ZE.id]:uj(),[o1e.id]:uj(),[a1e.id]:uj(),[i1e.id]:uj()},ssr:!1}),t2n=new Nxt,n2n=document.getElementById("root"),r2n=MNe.createRoot(n2n);r2n.render(i.jsx(nYe,{children:i.jsx(Z0t,{config:e2n,children:i.jsx(qxt,{client:t2n,children:i.jsx(JOt,{modalSize:"compact",theme:hMe({borderRadius:"large",fontStack:"rounded",overlayBlur:"large"}),children:i.jsx(zbt,{children:i.jsx(Xyn,{})})})})})}));const wNe=Object.freeze(Object.defineProperty({__proto__:null,default:Wee},Symbol.toStringTag,{value:"Module"}));export{Dr as B,Bie as E,Hj as H,as as _,X2n as a,s1 as b,cB as c,cft as d,s2 as e,Y0 as f,nie as g,Ti as h,vie as i,i2n as j,Tu as k,R9e as l,D0t as m,iFt as r,Ic as s,yvn as t};